浏览代码

Merge branch 'master' into t/ckeditor5/1151

Aleksander Nowodzinski 6 年之前
父节点
当前提交
db06019bdc
共有 34 个文件被更改,包括 247 次插入213 次删除
  1. 7 0
      packages/ckeditor5-ui/CHANGELOG.md
  2. 1 1
      packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js
  3. 1 1
      packages/ckeditor5-ui/docs/framework/guides/external-ui.md
  4. 3 3
      packages/ckeditor5-ui/lang/translations/az.po
  5. 3 3
      packages/ckeditor5-ui/lang/translations/de.po
  6. 3 3
      packages/ckeditor5-ui/lang/translations/en-au.po
  7. 3 3
      packages/ckeditor5-ui/lang/translations/es.po
  8. 3 3
      packages/ckeditor5-ui/lang/translations/et.po
  9. 3 3
      packages/ckeditor5-ui/lang/translations/fr.po
  10. 3 3
      packages/ckeditor5-ui/lang/translations/gl.po
  11. 3 3
      packages/ckeditor5-ui/lang/translations/hu.po
  12. 3 3
      packages/ckeditor5-ui/lang/translations/id.po
  13. 3 3
      packages/ckeditor5-ui/lang/translations/it.po
  14. 3 3
      packages/ckeditor5-ui/lang/translations/ku.po
  15. 3 3
      packages/ckeditor5-ui/lang/translations/ne.po
  16. 3 3
      packages/ckeditor5-ui/lang/translations/no.po
  17. 6 6
      packages/ckeditor5-ui/lang/translations/pl.po
  18. 3 3
      packages/ckeditor5-ui/lang/translations/pt-br.po
  19. 3 3
      packages/ckeditor5-ui/lang/translations/tr.po
  20. 3 3
      packages/ckeditor5-ui/lang/translations/zh-cn.po
  21. 3 3
      packages/ckeditor5-ui/lang/translations/zh.po
  22. 17 17
      packages/ckeditor5-ui/package.json
  23. 6 2
      packages/ckeditor5-ui/src/componentfactory.js
  24. 17 19
      packages/ckeditor5-ui/src/panel/balloon/balloonpanelview.js
  25. 68 58
      packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js
  26. 9 3
      packages/ckeditor5-ui/src/template.js
  27. 4 1
      packages/ckeditor5-ui/src/view.js
  28. 4 1
      packages/ckeditor5-ui/src/viewcollection.js
  29. 8 7
      packages/ckeditor5-ui/tests/componentfactory.js
  30. 1 3
      packages/ckeditor5-ui/tests/dropdown/utils.js
  31. 17 16
      packages/ckeditor5-ui/tests/panel/balloon/contextualballoon.js
  32. 19 17
      packages/ckeditor5-ui/tests/template.js
  33. 4 3
      packages/ckeditor5-ui/tests/view.js
  34. 7 7
      packages/ckeditor5-ui/tests/viewcollection.js

+ 7 - 0
packages/ckeditor5-ui/CHANGELOG.md

@@ -1,6 +1,13 @@
 Changelog
 =========
 
+## [13.0.1](https://github.com/ckeditor/ckeditor5-ui/compare/v13.0.0...v13.0.1) (2019-07-04)
+
+### Other changes
+
+* Updated translations. ([1964cc0](https://github.com/ckeditor/ckeditor5-ui/commit/1964cc0)) ([11cfd41](https://github.com/ckeditor/ckeditor5-ui/commit/11cfd41))
+
+
 ## [13.0.0](https://github.com/ckeditor/ckeditor5-ui/compare/v12.1.0...v13.0.0) (2019-06-05)
 
 ### Features

+ 1 - 1
packages/ckeditor5-ui/docs/_snippets/examples/bootstrap-ui-inner.js

@@ -151,7 +151,7 @@ class BootstrapEditorUI extends EditorUI {
 		const editableElement = view.editable.element;
 
 		// Register editable element so it is available via getEditableElement() method.
-		this._editableElements.set( view.editable.name, editableElement );
+		this.setEditableElement( view.editable.name, editableElement );
 
 		// Let the editable UI element respond to the changes in the global editor focus tracker
 		// and let the focus tracker know about the editable element.

+ 1 - 1
packages/ckeditor5-ui/docs/framework/guides/external-ui.md

@@ -286,7 +286,7 @@ class BootstrapEditorUI extends EditorUI {
 		const editableElement = view.editable.element;
 
 		// Register editable element so it is available via getEditableElement() method.
-		this._editableElements.set( view.editable.name, editableElement );
+		this.setEditableElement( view.editable.name, editableElement );
 
 		// Let the editable UI element respond to the changes in the global editor focus tracker
 		// and let the focus tracker know about the editable element.

+ 3 - 3
packages/ckeditor5-ui/lang/translations/az.po

@@ -30,12 +30,12 @@ msgstr "Redaktə etmək bloku"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Növbəti"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Əvvəlki"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 (Cəmi %1)"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/de.po

@@ -30,12 +30,12 @@ msgstr "Absatz bearbeiten"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Nächste"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "vorherige"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 von %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/en-au.po

@@ -30,12 +30,12 @@ msgstr "Edit block"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Next"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Previous"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 of %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/es.po

@@ -30,12 +30,12 @@ msgstr "Cuadro de edición"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Siguiente"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Anterior"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 de %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/et.po

@@ -30,12 +30,12 @@ msgstr "Muuda plokki"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Järgmine"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Eelmine"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 / %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/fr.po

@@ -30,12 +30,12 @@ msgstr "Modifier le bloc"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Suivant"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Précedent"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 sur %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/gl.po

@@ -30,12 +30,12 @@ msgstr "Editar bloque"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Seguinte"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Anterior"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 de %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/hu.po

@@ -30,12 +30,12 @@ msgstr "Blokk szerkesztése"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Következő"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Előző"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 / %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/id.po

@@ -30,12 +30,12 @@ msgstr "Sunting blok"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Berikutnya"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Sebelumnya"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 dari %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/it.po

@@ -30,12 +30,12 @@ msgstr "Modifica blocco"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Avanti"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Indietro"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 di %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/ku.po

@@ -30,12 +30,12 @@ msgstr "دەستکاری بلۆک"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "دواتر"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "پێشتر"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 لە %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/ne.po

@@ -30,12 +30,12 @@ msgstr "ब्लक सम्पादन गर्न"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "अर्को"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "अघिल्लो"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "०% मध्ये १%"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/no.po

@@ -30,12 +30,12 @@ msgstr "Rediger blokk"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Neste"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Forrige"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 av %1"

+ 6 - 6
packages/ckeditor5-ui/lang/translations/pl.po

@@ -18,24 +18,24 @@ msgstr ""
 
 msgctxt "Title of the CKEditor5 editor."
 msgid "Rich Text Editor, %0"
-msgstr "Edytor tekstu RTF, %0"
+msgstr "Edytor tekstu sformatowanego, %0"
 
 msgctxt "Title of the CKEditor5 editor."
 msgid "Rich Text Editor"
-msgstr "Edytor tekstu RTF"
+msgstr "Edytor tekstu sformatowanego"
 
 msgctxt "Label of the block toolbar icon (a block toolbar is displayed next to each paragraph, heading, list item, etc. and contains e.g. block formatting options)"
 msgid "Edit block"
-msgstr "Edytuj block"
+msgstr "Edytuj blok"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Następny"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Poprzedni"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 z %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/pt-br.po

@@ -30,12 +30,12 @@ msgstr "Editor de bloco"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Próximo"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Anterior"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0 de %1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/tr.po

@@ -30,12 +30,12 @@ msgstr "Bloğu Düzenle"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "Sonraki"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "Önceki"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0/%1"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/zh-cn.po

@@ -30,12 +30,12 @@ msgstr "编辑框"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "下一步"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "上一步"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "第 %0 步,共 %1 步"

+ 3 - 3
packages/ckeditor5-ui/lang/translations/zh.po

@@ -30,12 +30,12 @@ msgstr "編輯區塊"
 
 msgctxt "Label for a button showing the next thing (tab, page, etc.)."
 msgid "Next"
-msgstr ""
+msgstr "下一"
 
 msgctxt "Label for a button showing the previous thing (tab, page, etc.)."
 msgid "Previous"
-msgstr ""
+msgstr "上一"
 
 msgctxt "Label for a 'page X of Y' status of a typical next/previous page navigation."
 msgid "%0 of %1"
-msgstr ""
+msgstr "%0/%1"

+ 17 - 17
packages/ckeditor5-ui/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ckeditor/ckeditor5-ui",
-  "version": "13.0.0",
+  "version": "13.0.1",
   "description": "The UI framework and standard UI library of CKEditor 5.",
   "keywords": [
     "ckeditor",
@@ -9,25 +9,25 @@
     "ckeditor5-lib"
   ],
   "dependencies": {
-    "@ckeditor/ckeditor5-core": "^12.1.1",
-    "@ckeditor/ckeditor5-utils": "^12.1.1",
+    "@ckeditor/ckeditor5-core": "^12.2.0",
+    "@ckeditor/ckeditor5-utils": "^13.0.0",
     "lodash-es": "^4.17.10"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-basic-styles": "^11.1.1",
-    "@ckeditor/ckeditor5-block-quote": "^11.1.0",
-    "@ckeditor/ckeditor5-editor-balloon": "^12.1.1",
-    "@ckeditor/ckeditor5-editor-classic": "^12.1.1",
-    "@ckeditor/ckeditor5-engine": "^13.1.1",
-    "@ckeditor/ckeditor5-enter": "^11.0.2",
-    "@ckeditor/ckeditor5-essentials": "^11.0.2",
-    "@ckeditor/ckeditor5-heading": "^11.0.2",
-    "@ckeditor/ckeditor5-image": "^13.1.0",
-    "@ckeditor/ckeditor5-link": "^11.0.2",
-    "@ckeditor/ckeditor5-list": "^12.0.2",
-    "@ckeditor/ckeditor5-mention": "^11.0.0",
-    "@ckeditor/ckeditor5-paragraph": "^11.0.2",
-    "@ckeditor/ckeditor5-typing": "^12.0.2",
+    "@ckeditor/ckeditor5-basic-styles": "^11.1.2",
+    "@ckeditor/ckeditor5-block-quote": "^11.1.1",
+    "@ckeditor/ckeditor5-editor-balloon": "^12.2.0",
+    "@ckeditor/ckeditor5-editor-classic": "^12.1.2",
+    "@ckeditor/ckeditor5-engine": "^13.2.0",
+    "@ckeditor/ckeditor5-enter": "^11.0.3",
+    "@ckeditor/ckeditor5-essentials": "^11.0.3",
+    "@ckeditor/ckeditor5-heading": "^11.0.3",
+    "@ckeditor/ckeditor5-image": "^13.1.1",
+    "@ckeditor/ckeditor5-link": "^11.1.0",
+    "@ckeditor/ckeditor5-list": "^12.0.3",
+    "@ckeditor/ckeditor5-mention": "^12.0.0",
+    "@ckeditor/ckeditor5-paragraph": "^11.0.3",
+    "@ckeditor/ckeditor5-typing": "^12.1.0",
     "eslint": "^5.5.0",
     "eslint-config-ckeditor5": "^1.0.11",
     "husky": "^1.3.1",

+ 6 - 2
packages/ckeditor5-ui/src/componentfactory.js

@@ -85,7 +85,9 @@ export default class ComponentFactory {
 			 * @param {String} name The name of the component.
 			 */
 			throw new CKEditorError(
-				'componentfactory-item-exists: The item already exists in the component factory.', { name }
+				'componentfactory-item-exists: The item already exists in the component factory.',
+				this,
+				{ name }
 			);
 		}
 
@@ -113,7 +115,9 @@ export default class ComponentFactory {
 			 * @param {String} name The name of the missing component.
 			 */
 			throw new CKEditorError(
-				'componentfactory-item-missing: The required component is not registered in the factory.', { name }
+				'componentfactory-item-missing: The required component is not registered in the factory.',
+				this,
+				{ name }
 			);
 		}
 

+ 17 - 19
packages/ckeditor5-ui/src/panel/balloon/balloonpanelview.js

@@ -1,6 +1,6 @@
 /**
  * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ * For licensing, see LICENSE.md.
  */
 
 /**
@@ -24,7 +24,7 @@ const defaultLimiterElement = global.document.body;
  *
  * A floating container which can
  * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any
- * {@link module:utils/dom/position~Options#target target} in DOM and remain in that position
+ * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position
  * e.g. when the web page is scrolled.
  *
  * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and
@@ -86,9 +86,9 @@ export default class BalloonPanelView extends View {
 		this.set( 'left', 0 );
 
 		/**
-		 * Balloon panel's current position. The position name is reflected in the CSS class set
-		 * to the balloon, i.e. `.ck-balloon-panel_arrow_nw` for "arrow_nw" position. The class
-		 * controls the minor aspects of the balloon's visual appearance like placement
+		 * The balloon panel's current position. The position name is reflected in the CSS class set
+		 * to the balloon, i.e. `.ck-balloon-panel_arrow_nw` for the "arrow_nw" position. The class
+		 * controls the minor aspects of the balloon's visual appearance like the placement
 		 * of an {@link #withArrow arrow}. To support a new position, an additional CSS must be created.
 		 *
 		 * Default position names correspond with
@@ -113,7 +113,7 @@ export default class BalloonPanelView extends View {
 
 		/**
 		 * Controls whether the balloon panel has an arrow. The presence of the arrow
-		 * is reflected in `ck-balloon-panel_with-arrow` CSS class.
+		 * is reflected in the `ck-balloon-panel_with-arrow` CSS class.
 		 *
 		 * @observable
 		 * @default true
@@ -130,7 +130,7 @@ export default class BalloonPanelView extends View {
 		this.set( 'class' );
 
 		/**
-		 * A callback that starts pining the panel when {@link #isVisible} gets
+		 * A callback that starts pinning the panel when {@link #isVisible} gets
 		 * `true`. Used by {@link #pin}.
 		 *
 		 * @private
@@ -138,7 +138,7 @@ export default class BalloonPanelView extends View {
 		 */
 
 		/**
-		 * Collection of the child views which creates balloon panel contents.
+		 * A collection of the child views that creates the balloon panel contents.
 		 *
 		 * @readonly
 		 * @member {module:ui/viewcollection~ViewCollection}
@@ -191,7 +191,7 @@ export default class BalloonPanelView extends View {
 	 * is visible to the user i.e. within the limits of the viewport.
 	 *
 	 * This method accepts configuration {@link module:utils/dom/position~Options options}
-	 * to set the `target`, optional `limiter` and `positions` the balloon should chose from.
+	 * to set the `target`, optional `limiter` and `positions` the balloon should choose from.
 	 *
 	 *		const panel = new BalloonPanelView( locale );
 	 *		const positions = BalloonPanelView.defaultPositions;
@@ -210,9 +210,7 @@ export default class BalloonPanelView extends View {
 	 * **Note**: Attaching the panel will also automatically {@link #show} it.
 	 *
 	 * **Note**: An attached panel will not follow its target when the window is scrolled or resized.
-	 * See the {@link #pin} method for more permanent positioning strategy.
-	 *
-	 * **Note**: If a limiter is not provided in the options the panel will use `document.body` as a default limiter.
+	 * See the {@link #pin} method for a more permanent positioning strategy.
 	 *
 	 * @param {module:utils/dom/position~Options} options Positioning options compatible with
 	 * {@link module:utils/dom/position~getOptimalPosition}. Default `positions` array is
@@ -255,8 +253,8 @@ export default class BalloonPanelView extends View {
 	 * or {@link module:utils/dom/position~Options#limiter} is scrolled,
 	 * * the browser window gets resized or scrolled.
 	 *
-	 * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target},
-	 * immune to the changing environment.
+	 * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}
+	 * and is immune to the changing environment.
 	 *
 	 *		const panel = new BalloonPanelView( locale );
 	 *		const positions = BalloonPanelView.defaultPositions;
@@ -364,8 +362,8 @@ export default class BalloonPanelView extends View {
 	}
 }
 
-// Returns the DOM element for given object or null, if there's none,
-// e.g. when passed object is a Rect instance or so.
+// Returns the DOM element for given object or null, if there is none,
+// e.g. when the passed object is a Rect instance or so.
 //
 // @private
 // @param {*} object
@@ -433,9 +431,9 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
 
 /**
  * A default set of positioning functions used by the balloon panel view
- * when attaching using {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
+ * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.
  *
- * The available positioning functions are as follow:
+ * The available positioning functions are as follows:
  *
  * **North**
  *
@@ -597,7 +595,7 @@ BalloonPanelView._getOptimalPosition = getOptimalPosition;
  *
  * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.
  *
- * The name that position function returns will be reflected in balloon panel's class that
+ * The name that the position function returns will be reflected in the balloon panel's class that
  * controls the placement of the "arrow". See {@link #position} to learn more.
  *
  * @member {Object} module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions

+ 68 - 58
packages/ckeditor5-ui/src/panel/balloon/contextualballoon.js

@@ -27,35 +27,36 @@ const toPx = toUnit( 'px' );
 /**
  * Provides the common contextual balloon for the editor.
  *
- * The role of this plugin is to unified contextual balloons logic, simplifies managing the views and helps
+ * The role of this plugin is to unify the contextual balloons logic, simplify views management and help
  * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}
  * instances in the editor.
  *
- * This plugin allows creating single or multiple panel stacks.
+ * This plugin allows for creating single or multiple panel stacks.
  *
- * Each stack may have multiple views, the one on the top is visible. When the visible view is removed from the stack,
- * the previous view becomes visible, etc. It might be useful to implement nested navigation in a balloon. For instance
- * toolbar view may have a link button. When you click it, link view (which let you set the URL) is created and put on
- * top of the toolbar view, so not link panel is displayed. When you finish editing link and close (remove) link view,
- * the toolbar view is visible back.
+ * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,
+ * the previous view becomes visible.
  *
- * However, there are cases when there are multiple independent balloons to be displayed. For instance, if the selection
+ * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.
+ * When you click it, a link view (which lets you set the URL) is created and put on top of the toolbar view, so the link panel
+ * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.
+ *
+ * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection
  * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.
- * Contextual balloon plugin will create a navigation bar to let users switch between these panel stacks - "next balloon"
- * and "previous balloon" buttons.
+ * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the "Next"
+ * and "Previous" buttons.
  *
  * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no
- * panels in any stack then balloon panel will be hidden.
+ * panels in any stack, the balloon panel will be hidden.
  *
- * **Note**: To force balloon panel to show only one view - even if there are other stacks - use `singleViewMode=true` option
- * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} view to a panel.
+ * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option
+ * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.
  *
- * From the implementation point of view, contextual ballon plugin is reusing a single
+ * From the implementation point of view, the contextual ballon plugin is reusing a single
  * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon
  * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},
  * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific
- * view you want to display. If there is are more than one panel stack to be displayed, the rotator view will add a
- * navigation bar. If there is only one stack, rotator view is transparent (do not add any UI elements).
+ * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a
+ * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).
  *
  * @extends module:core/plugin~Plugin
  */
@@ -78,7 +79,7 @@ export default class ContextualBalloon extends Plugin {
 		 * for the {@link #view balloon}, used when no `limiter` has been passed into {@link #add}
 		 * or {@link #updatePosition}.
 		 *
-		 * By default, a function, which obtains the farthest DOM
+		 * By default, a function that obtains the farthest DOM
 		 * {@link module:engine/view/rooteditableelement~RootEditableElement}
 		 * of the {@link module:engine/view/document~Document#selection}.
 		 *
@@ -97,7 +98,7 @@ export default class ContextualBalloon extends Plugin {
 		};
 
 		/**
-		 * The currently visible view or `null` when there are no views in the any stack.
+		 * The currently visible view or `null` when there are no views in any stack.
 		 *
 		 * @readonly
 		 * @observable
@@ -116,7 +117,7 @@ export default class ContextualBalloon extends Plugin {
 		editor.ui.focusTracker.add( this.view.element );
 
 		/**
-		 * Map of views and its stacks.
+		 * The map of views and their stacks.
 		 *
 		 * @private
 		 * @type {Map.<module:ui/view~View,Set>}
@@ -124,7 +125,7 @@ export default class ContextualBalloon extends Plugin {
 		this._viewToStack = new Map();
 
 		/**
-		 * Map of ids and stacks.
+		 * The map of IDs and stacks.
 		 *
 		 * @private
 		 * @type {Map.<String,Set>}
@@ -142,7 +143,7 @@ export default class ContextualBalloon extends Plugin {
 		this.set( '_numberOfStacks', 0 );
 
 		/**
-		 * Flag that controls the single view mode.
+		 * A flag that controls the single view mode.
 		 *
 		 * @private
 		 * @readonly
@@ -153,7 +154,7 @@ export default class ContextualBalloon extends Plugin {
 
 		/**
 		 * Rotator view embedded in the contextual balloon.
-		 * Displays currently visible view in the balloon and provides navigation for switching stacks.
+		 * Displays the currently visible view in the balloon and provides navigation for switching stacks.
 		 *
 		 * @private
 		 * @type {module:ui/panel/balloon/contextualballoon~RotatorView}
@@ -170,7 +171,7 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Returns `true` when the given view is in one of the stack. Otherwise returns `false`.
+	 * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.
 	 *
 	 * @param {module:ui/view~View} view
 	 * @returns {Boolean}
@@ -180,16 +181,16 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Adds a new view to the stack and makes it visible if current stack is visible
-	 * or it is a first view in the balloon.
+	 * Adds a new view to the stack and makes it visible if the current stack is visible
+	 * or it is the first view in the balloon.
 	 *
-	 * @param {Object} data Configuration of the view.
-	 * @param {String} [data.stackId='main'] Id of a stack that view is added to.
-	 * @param {module:ui/view~View} [data.view] Content of the balloon.
+	 * @param {Object} data The configuration of the view.
+	 * @param {String} [data.stackId='main'] The ID of the stack that the view is added to.
+	 * @param {module:ui/view~View} [data.view] The content of the balloon.
 	 * @param {module:utils/dom/position~Options} [data.position] Positioning options.
-	 * @param {String} [data.balloonClassName] Additional CSS class added to the {@link #view balloon} when visible.
+	 * @param {String} [data.balloonClassName] An additional CSS class added to the {@link #view balloon} when visible.
 	 * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
-	 * @param {Boolean} [data.singleViewMode=false] Whether the view should be only visible view - even if other stacks were added.
+	 * @param {Boolean} [data.singleViewMode=false] Whether the view should be the only visible view even if other stacks were added.
 	 */
 	add( data ) {
 		if ( this.hasView( data.view ) ) {
@@ -198,7 +199,10 @@ export default class ContextualBalloon extends Plugin {
 			 *
 			 * @error contextualballoon-add-view-exist
 			 */
-			throw new CKEditorError( 'contextualballoon-add-view-exist: Cannot add configuration of the same view twice.' );
+			throw new CKEditorError(
+				'contextualballoon-add-view-exist: Cannot add configuration of the same view twice.',
+				[ this, data ]
+			);
 		}
 
 		const stackId = data.stackId || 'main';
@@ -234,20 +238,23 @@ export default class ContextualBalloon extends Plugin {
 
 	/**
 	 * Removes the given view from the stack. If the removed view was visible,
-	 * then the view preceding it in the stack will become visible instead.
-	 * When there is no view in the stack then next stack will be displayed.
-	 * When there is not more stacks then balloon will hide.
+	 * the view preceding it in the stack will become visible instead.
+	 * When there is no view in the stack, the next stack will be displayed.
+	 * When there are no more stacks, the balloon will hide.
 	 *
 	 * @param {module:ui/view~View} view A view to be removed from the balloon.
 	 */
 	remove( view ) {
 		if ( !this.hasView( view ) ) {
 			/**
-			 * Trying to remove configuration of the view not defined in the stack.
+			 * Trying to remove the configuration of the view not defined in the stack.
 			 *
 			 * @error contextualballoon-remove-view-not-exist
 			 */
-			throw new CKEditorError( 'contextualballoon-remove-view-not-exist: Cannot remove configuration of not existing view.' );
+			throw new CKEditorError(
+				'contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.',
+				[ this, view ]
+			);
 		}
 
 		const stack = this._viewToStack.get( view );
@@ -283,8 +290,8 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Updates the position of the balloon using position data of the first visible view in the stack.
-	 * When new position data is given then position data of currently visible view will be updated.
+	 * Updates the position of the balloon using the position data of the first visible view in the stack.
+	 * When new position data is given, the position data of the currently visible view will be updated.
 	 *
 	 * @param {module:utils/dom/position~Options} [position] position options.
 	 */
@@ -298,7 +305,7 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Shows last view from the stack of a given id.
+	 * Shows the last view from the stack of a given ID.
 	 *
 	 * @param {String} id
 	 */
@@ -308,11 +315,14 @@ export default class ContextualBalloon extends Plugin {
 
 		if ( !stack ) {
 			/**
-			 * Trying to show not existing stack.
+			 * Trying to show a stack that does not exist.
 			 *
 			 * @error contextualballoon-showstack-stack-not-exist
 			 */
-			throw new CKEditorError( 'contextualballoon-showstack-stack-not-exist: Cannot show not existing stack.' );
+			throw new CKEditorError(
+				'contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.',
+				this
+			);
 		}
 
 		if ( this._visibleStack === stack ) {
@@ -323,7 +333,7 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Returns the stack of currently visible view.
+	 * Returns the stack of the currently visible view.
 	 *
 	 * @private
 	 * @type {Set}
@@ -333,7 +343,7 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Returns id of given stack.
+	 * Returns the ID of the given stack.
 	 *
 	 * @private
 	 * @param {Set} stack
@@ -346,7 +356,7 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Shows last view from the next stack.
+	 * Shows the last view from the next stack.
 	 *
 	 * @private
 	 */
@@ -363,7 +373,7 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Shows last view from the previous stack.
+	 * Shows the last view from the previous stack.
 	 *
 	 * @private
 	 */
@@ -454,12 +464,12 @@ export default class ContextualBalloon extends Plugin {
 	}
 
 	/**
-	 * Sets the view as a content of the balloon and attaches balloon using position
+	 * Sets the view as the content of the balloon and attaches the balloon using position
 	 * options of the first view.
 	 *
 	 * @private
 	 * @param {Object} data Configuration.
-	 * @param {module:ui/view~View} [data.view] View to show in the balloon.
+	 * @param {module:ui/view~View} [data.view] The view to show in the balloon.
 	 * @param {String} [data.balloonClassName=''] Additional class name which will be added to the {@link #view balloon}.
 	 * @param {Boolean} [data.withArrow=true] Whether the {@link #view balloon} should be rendered with an arrow.
 	 */
@@ -479,7 +489,7 @@ export default class ContextualBalloon extends Plugin {
 
 	/**
 	 * Returns position options of the last view in the stack.
-	 * This keeps the balloon in the same position when view is changed.
+	 * This keeps the balloon in the same position when the view is changed.
 	 *
 	 * @private
 	 * @returns {module:utils/dom/position~Options}
@@ -501,8 +511,8 @@ export default class ContextualBalloon extends Plugin {
 
 /**
  * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.
- * It is used for displaying last view from the current stack and providing navigation buttons for switching stacks.
- * See {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.
+ * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.
+ * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.
  *
  * @extends module:ui/view~View
  */
@@ -524,28 +534,28 @@ class RotatorView extends View {
 		this.set( 'isNavigationVisible', true );
 
 		/**
-		 * Used for checking if view is focused or not.
+		 * Used for checking if a view is focused or not.
 		 *
 		 * @type {module:utils/focustracker~FocusTracker}
 		 */
 		this.focusTracker = new FocusTracker();
 
 		/**
-		 * Navigation button for switching stack to the previous one.
+		 * Navigation button for switching the stack to the previous one.
 		 *
 		 * @type {module:ui/button/buttonview~ButtonView}
 		 */
 		this.buttonPrevView = this._createButtonView( t( 'Previous' ), prevIcon );
 
 		/**
-		 * Navigation button for switching stack to the next one.
+		 * Navigation button for switching the stack to the next one.
 		 *
 		 * @type {module:ui/button/buttonview~ButtonView}
 		 */
 		this.buttonNextView = this._createButtonView( t( 'Next' ), nextIcon );
 
 		/**
-		 * Collection of the child views which creates rotator content.
+		 * A collection of the child views that creates the rotator content.
 		 *
 		 * @readonly
 		 * @type {module:ui/viewcollection~ViewCollection}
@@ -611,7 +621,7 @@ class RotatorView extends View {
 	}
 
 	/**
-	 * Shows given view.
+	 * Shows a given view.
 	 *
 	 * @param {module:ui/view~View} view The view to show.
 	 */
@@ -621,7 +631,7 @@ class RotatorView extends View {
 	}
 
 	/**
-	 * Hides currently displayed view.
+	 * Hides the currently displayed view.
 	 */
 	hideView() {
 		this.content.clear();
@@ -631,8 +641,8 @@ class RotatorView extends View {
 	 * Creates a navigation button view.
 	 *
 	 * @private
-	 * @param {String} label The button's label.
-	 * @param {String} icon The button's icon.
+	 * @param {String} label The button label.
+	 * @param {String} icon The button icon.
 	 * @returns {module:ui/button/buttonview~ButtonView}
 	 */
 	_createButtonView( label, icon ) {

+ 9 - 3
packages/ckeditor5-ui/src/template.js

@@ -208,7 +208,10 @@ export default class Template {
 			 *
 			 * @error ui-template-revert-not-applied
 			 */
-			throw new CKEditorError( 'ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.' );
+			throw new CKEditorError(
+				'ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.',
+				[ this, node ]
+			);
 		}
 
 		this._revertTemplateFromNode( node, this._revertData );
@@ -409,7 +412,8 @@ export default class Template {
 			 * @error ui-template-wrong-syntax
 			 */
 			throw new CKEditorError(
-				'ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.'
+				'ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.',
+				this
 			);
 		}
 
@@ -1356,6 +1360,7 @@ function extendObjectValueArray( obj, ext ) {
 //
 // @param {module:ui/template~Template} def A template instance to be extended.
 // @param {module:ui/template~TemplateDefinition} def A definition which is to extend the template instance.
+// @param {Object} Error context.
 function extendTemplate( template, def ) {
 	if ( def.attributes ) {
 		if ( !template.attributes ) {
@@ -1385,7 +1390,8 @@ function extendTemplate( template, def ) {
 			 * @error ui-template-extend-children-mismatch
 			 */
 			throw new CKEditorError(
-				'ui-template-extend-children-mismatch: The number of children in extended definition does not match.'
+				'ui-template-extend-children-mismatch: The number of children in extended definition does not match.',
+				template
 			);
 		}
 

+ 4 - 1
packages/ckeditor5-ui/src/view.js

@@ -467,7 +467,10 @@ export default class View {
 			 *
 			 * @error ui-view-render-rendered
 			 */
-			throw new CKEditorError( 'ui-view-render-already-rendered: This View has already been rendered.' );
+			throw new CKEditorError(
+				'ui-view-render-already-rendered: This View has already been rendered.',
+				this
+			);
 		}
 
 		// Render #element of the view.

+ 4 - 1
packages/ckeditor5-ui/src/viewcollection.js

@@ -154,7 +154,10 @@ export default class ViewCollection extends Collection {
 			 *
 			 * @error ui-viewcollection-delegate-wrong-events
 			 */
-			throw new CKEditorError( 'ui-viewcollection-delegate-wrong-events: All event names must be strings.' );
+			throw new CKEditorError(
+				'ui-viewcollection-delegate-wrong-events: All event names must be strings.',
+				this
+			);
 		}
 
 		return {

+ 8 - 7
packages/ckeditor5-ui/tests/componentfactory.js

@@ -5,7 +5,8 @@
 
 import Editor from '@ckeditor/ckeditor5-core/src/editor/editor';
 import ComponentFactory from '../src/componentfactory';
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+
+import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
 describe( 'ComponentFactory', () => {
 	let editor, factory;
@@ -41,17 +42,17 @@ describe( 'ComponentFactory', () => {
 		it( 'throws when trying to override already registered component', () => {
 			factory.add( 'foo', () => {} );
 
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				factory.add( 'foo', () => {} );
-			} ).to.throw( CKEditorError, /^componentfactory-item-exists/ );
+			}, /^componentfactory-item-exists/, editor );
 		} );
 
 		it( 'throws when trying to override already registered component added with different case', () => {
 			factory.add( 'Foo', () => {} );
 
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				factory.add( 'foo', () => {} );
-			} ).to.throw( CKEditorError, /^componentfactory-item-exists/ );
+			}, /^componentfactory-item-exists/, editor );
 		} );
 
 		it( 'does not normalize component names', () => {
@@ -63,9 +64,9 @@ describe( 'ComponentFactory', () => {
 
 	describe( 'create()', () => {
 		it( 'throws when trying to create a component which has not been registered', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				factory.create( 'foo' );
-			} ).to.throw( CKEditorError, /^componentfactory-item-missing/ );
+			}, /^componentfactory-item-missing/, editor );
 		} );
 
 		it( 'creates an instance', () => {

+ 1 - 3
packages/ckeditor5-ui/tests/dropdown/utils.js

@@ -5,7 +5,7 @@
 
 /* globals document Event */
 
-import utilsTestUtils from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
+import { assertBinding } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
 import Collection from '@ckeditor/ckeditor5-utils/src/collection';
 
@@ -23,8 +23,6 @@ import ListItemView from '../../src/list/listitemview';
 import ListSeparatorView from '../../src/list/listseparatorview';
 import ListView from '../../src/list/listview';
 
-const assertBinding = utilsTestUtils.assertBinding;
-
 describe( 'utils', () => {
 	let locale, dropdownView;
 

+ 17 - 16
packages/ckeditor5-ui/tests/panel/balloon/contextualballoon.js

@@ -7,12 +7,13 @@ import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictest
 import ContextualBalloon from '../../../src/panel/balloon/contextualballoon';
 import BalloonPanelView from '../../../src/panel/balloon/balloonpanelview';
 import View from '../../../src/view';
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import { setData as setModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import { add as addTranslations, _clear as clearTranslations } from '@ckeditor/ckeditor5-utils/src/translation-service';
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
+import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
 /* global document, Event */
 
@@ -238,7 +239,7 @@ describe( 'ContextualBalloon', () => {
 		} );
 
 		it( 'should throw an error when try to add the same view more than once', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				balloon.add( {
 					view: viewA,
 					position: {
@@ -246,7 +247,7 @@ describe( 'ContextualBalloon', () => {
 						limiter: balloon.positionLimiter
 					}
 				} );
-			} ).to.throw( CKEditorError, /^contextualballoon-add-view-exist/ );
+			}, /^contextualballoon-add-view-exist/, editor );
 		} );
 
 		it( 'should use a provided limiter instead of #positionLimiter', () => {
@@ -459,9 +460,9 @@ describe( 'ContextualBalloon', () => {
 		} );
 
 		it( 'should throw an error when there is no stack of given id', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				balloon.showStack( 'second' );
-			} ).to.throw( CKEditorError, 'contextualballoon-showstack-stack-not-exist: Cannot show not existing stack.' );
+			}, /^contextualballoon-showstack-stack-not-exist/, editor );
 		} );
 	} );
 
@@ -503,9 +504,9 @@ describe( 'ContextualBalloon', () => {
 			balloon.remove( viewB );
 
 			expect( balloon.visibleView ).to.equal( viewA );
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				balloon.showStack( 'second' );
-			} ).to.throw();
+			}, /^contextualballoon-showstack-stack-not-exist/, editor );
 		} );
 
 		it( 'should switch stack to the next one when removed view was the last one in the visible stack', () => {
@@ -517,9 +518,9 @@ describe( 'ContextualBalloon', () => {
 			balloon.remove( viewA );
 
 			expect( balloon.visibleView ).to.equal( viewB );
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				balloon.showStack( 'main' );
-			} ).to.throw();
+			}, /^contextualballoon-showstack-stack-not-exist/, editor );
 		} );
 
 		it( 'should remove given view and set preceding in the stack as visible when removed view was visible', () => {
@@ -592,15 +593,15 @@ describe( 'ContextualBalloon', () => {
 			expect( balloon.hasView( viewB ) ).to.false;
 
 			// Does throw, so the stack is not there.
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				balloon.showStack( 'second' );
-			} ).to.throw();
+			}, /^contextualballoon-showstack-stack-not-exist/, editor );
 		} );
 
 		it( 'should throw an error when there is no given view in the stack', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				balloon.remove( viewB );
-			} ).to.throw( CKEditorError, /^contextualballoon-remove-view-not-exist/ );
+			}, /^contextualballoon-remove-view-not-exist/, editor );
 		} );
 
 		it( 'should set additional css class of visible view to BalloonPanelView', () => {
@@ -707,9 +708,9 @@ describe( 'ContextualBalloon', () => {
 		} );
 
 		it( 'should throw an error when there is no given view in the stack', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				balloon.remove( viewB );
-			} ).to.throw( CKEditorError, /^contextualballoon-remove-view-not-exist/ );
+			}, /^contextualballoon-remove-view-not-exist/, editor );
 		} );
 	} );
 
@@ -718,7 +719,7 @@ describe( 'ContextualBalloon', () => {
 			expect( () => {
 				balloon.destroy();
 				balloon.destroy();
-			} ).to.not.throw();
+			} );
 		} );
 
 		it( 'should not touch the DOM', () => {

+ 19 - 17
packages/ckeditor5-ui/tests/template.js

@@ -10,12 +10,14 @@ import { default as Template, TemplateToBinding, TemplateIfBinding } from '../sr
 import View from '../src/view';
 import ViewCollection from '../src/viewcollection';
 import Model from '../src/model';
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+
 import EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';
 import DomEmitterMixin from '@ckeditor/ckeditor5-utils/src/dom/emittermixin';
 import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';
 import log from '@ckeditor/ckeditor5-utils/src/log';
 
+import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
+
 let el, text;
 const injectedElements = [];
 
@@ -142,16 +144,16 @@ describe( 'Template', () => {
 
 	describe( 'render()', () => {
 		it( 'throws when the template definition is wrong', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				new Template( {} ).render();
-			} ).to.throw( CKEditorError, /ui-template-wrong-syntax/ );
+			}, /ui-template-wrong-syntax/ );
 
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				new Template( {
 					tag: 'p',
 					text: 'foo'
 				} ).render();
-			} ).to.throw( CKEditorError, /ui-template-wrong-syntax/ );
+			}, /ui-template-wrong-syntax/ );
 		} );
 
 		it( 'sets #_isRendered true', () => {
@@ -727,12 +729,12 @@ describe( 'Template', () => {
 		} );
 
 		it( 'throws when wrong template definition', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				new Template( {
 					tag: 'p',
 					text: 'foo'
 				} ).apply( el );
-			} ).to.throw( CKEditorError, /ui-template-wrong-syntax/ );
+			}, /ui-template-wrong-syntax/ );
 		} );
 
 		it( 'accepts empty template definition', () => {
@@ -1119,15 +1121,15 @@ describe( 'Template', () => {
 				tag: 'div'
 			} );
 
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				tpl.revert( el );
-			} ).to.throw( CKEditorError, /ui-template-revert-not-applied/ );
+			}, /ui-template-revert-not-applied/ );
 
 			tpl.render();
 
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				tpl.revert( el );
-			} ).to.throw( CKEditorError, /ui-template-revert-not-applied/ );
+			}, /ui-template-revert-not-applied/ );
 		} );
 
 		describe( 'text', () => {
@@ -2691,7 +2693,7 @@ describe( 'Template', () => {
 
 		describe( 'children', () => {
 			it( 'should throw when the number of children does not correspond', () => {
-				expect( () => {
+				expectToThrowCKEditorError( () => {
 					extensionTest(
 						{
 							tag: 'p',
@@ -2707,11 +2709,11 @@ describe( 'Template', () => {
 						},
 						'it should fail'
 					);
-				} ).to.throw( CKEditorError, /ui-template-extend-children-mismatch/ );
+				}, /ui-template-extend-children-mismatch/ );
 			} );
 
 			it( 'should throw when no children in target but extending one', () => {
-				expect( () => {
+				expectToThrowCKEditorError( () => {
 					extensionTest(
 						{
 							tag: 'p',
@@ -2725,11 +2727,11 @@ describe( 'Template', () => {
 						},
 						'it should fail'
 					);
-				} ).to.throw( CKEditorError, /ui-template-extend-children-mismatch/ );
+				}, /ui-template-extend-children-mismatch/ );
 			} );
 
 			it( 'should throw when the number of children does not correspond on some deeper level', () => {
-				expect( () => {
+				expectToThrowCKEditorError( () => {
 					extensionTest(
 						{
 							tag: 'p',
@@ -2768,7 +2770,7 @@ describe( 'Template', () => {
 						},
 						'it should fail'
 					);
-				} ).to.throw( CKEditorError, /ui-template-extend-children-mismatch/ );
+				}, /ui-template-extend-children-mismatch/ );
 			} );
 
 			it( 'extends existing - simple', () => {

+ 4 - 3
packages/ckeditor5-ui/tests/view.js

@@ -8,10 +8,11 @@
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import View from '../src/view';
 import Template from '../src/template';
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
+
 import Collection from '@ckeditor/ckeditor5-utils/src/collection';
 import ViewCollection from '../src/viewcollection';
 import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';
+import { assertCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
 let TestView, view, childA, childB;
 
@@ -215,8 +216,8 @@ describe( 'View', () => {
 				view.render();
 				throw new Error( 'This should not be executed.' );
 			} catch ( err ) {
-				expect( err ).to.be.instanceof( CKEditorError );
-				expect( err.message ).to.match( /^ui-view-render-already-rendered:/ );
+				// TODO
+				assertCKEditorError( err, /^ui-view-render-already-rendered:/, view );
 			}
 		} );
 

+ 7 - 7
packages/ckeditor5-ui/tests/viewcollection.js

@@ -5,11 +5,11 @@
 
 /* global document */
 
-import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import View from '../src/view';
 import ViewCollection from '../src/viewcollection';
 import normalizeHtml from '@ckeditor/ckeditor5-utils/tests/_utils/normalizehtml';
+import { expectToThrowCKEditorError } from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
 let collection;
 
@@ -169,17 +169,17 @@ describe( 'ViewCollection', () => {
 
 	describe( 'delegate()', () => {
 		it( 'should throw when event names are not strings', () => {
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				collection.delegate();
-			} ).to.throw( CKEditorError, /ui-viewcollection-delegate-wrong-events/ );
+			}, /ui-viewcollection-delegate-wrong-events/ );
 
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				collection.delegate( new Date() );
-			} ).to.throw( CKEditorError, /ui-viewcollection-delegate-wrong-events/ );
+			}, /ui-viewcollection-delegate-wrong-events/ );
 
-			expect( () => {
+			expectToThrowCKEditorError( () => {
 				collection.delegate( 'color', new Date() );
-			} ).to.throw( CKEditorError, /ui-viewcollection-delegate-wrong-events/ );
+			}, /ui-viewcollection-delegate-wrong-events/ );
 		} );
 
 		it( 'returns object', () => {