@ckeditor/ckeditor5-ui 47.4.0 → 47.5.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ui",
3
- "version": "47.4.0",
3
+ "version": "47.5.0-alpha.0",
4
4
  "description": "The UI framework and standard UI library of CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -17,11 +17,11 @@
17
17
  "type": "module",
18
18
  "main": "src/index.js",
19
19
  "dependencies": {
20
- "@ckeditor/ckeditor5-core": "47.4.0",
21
- "@ckeditor/ckeditor5-editor-multi-root": "47.4.0",
22
- "@ckeditor/ckeditor5-engine": "47.4.0",
23
- "@ckeditor/ckeditor5-icons": "47.4.0",
24
- "@ckeditor/ckeditor5-utils": "47.4.0",
20
+ "@ckeditor/ckeditor5-core": "47.5.0-alpha.0",
21
+ "@ckeditor/ckeditor5-editor-multi-root": "47.5.0-alpha.0",
22
+ "@ckeditor/ckeditor5-engine": "47.5.0-alpha.0",
23
+ "@ckeditor/ckeditor5-icons": "47.5.0-alpha.0",
24
+ "@ckeditor/ckeditor5-utils": "47.5.0-alpha.0",
25
25
  "@types/color-convert": "2.0.4",
26
26
  "color-convert": "3.1.0",
27
27
  "color-parse": "2.0.2",
@@ -68,4 +68,4 @@
68
68
  "./ckeditor5-metadata.json": "./ckeditor5-metadata.json",
69
69
  "./package.json": "./package.json"
70
70
  }
71
- }
71
+ }
@@ -72,6 +72,10 @@ export declare class BalloonToolbar extends Plugin {
72
72
  * @inheritDoc
73
73
  */
74
74
  init(): void;
75
+ /**
76
+ * Returns whether the toolbar is visible in the ContextualBalloon.
77
+ */
78
+ private get _isToolbarVisible();
75
79
  /**
76
80
  * Creates the toolbar view instance.
77
81
  */
@@ -106,8 +106,7 @@ export class BalloonToolbar extends Plugin {
106
106
  const selection = editor.model.document.selection;
107
107
  // Show/hide the toolbar on editable focus/blur.
108
108
  this.listenTo(this.focusTracker, 'change:isFocused', (evt, name, isFocused) => {
109
- const isToolbarVisible = this._balloon.visibleView === this.toolbarView;
110
- if (!isFocused && isToolbarVisible) {
109
+ if (!isFocused && this._isToolbarVisible) {
111
110
  this.hide();
112
111
  }
113
112
  else if (isFocused) {
@@ -155,6 +154,12 @@ export class BalloonToolbar extends Plugin {
155
154
  this.toolbarView.fillFromConfig(this._balloonConfig, this.editor.ui.componentFactory);
156
155
  });
157
156
  }
157
+ /**
158
+ * Returns whether the toolbar is visible in the ContextualBalloon.
159
+ */
160
+ get _isToolbarVisible() {
161
+ return this._balloon.visibleView === this.toolbarView;
162
+ }
158
163
  /**
159
164
  * Creates the toolbar view instance.
160
165
  */
@@ -284,7 +289,9 @@ export class BalloonToolbar extends Plugin {
284
289
  * * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).
285
290
  */
286
291
  _updatePosition() {
287
- this._balloon.updatePosition(this._getBalloonPositionData());
292
+ if (this._isToolbarVisible) {
293
+ this._balloon.updatePosition(this._getBalloonPositionData());
294
+ }
288
295
  }
289
296
  /**
290
297
  * @inheritDoc