@ckeditor/ckeditor5-ui 41.4.2 → 42.0.0-alpha.1
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/README.md +7 -1
- package/ckeditor5-metadata.json +1 -1
- package/dist/index.js +10016 -8366
- package/dist/index.js.map +1 -1
- package/dist/types/colorselector/documentcolorcollection.d.ts +1 -1
- package/dist/types/dialog/dialogview.d.ts +1 -1
- package/dist/types/editorui/accessibilityhelp/accessibilityhelp.d.ts +1 -1
- package/dist/types/editorui/editorui.d.ts +1 -1
- package/dist/types/editorui/poweredby.d.ts +1 -1
- package/dist/types/focuscycler.d.ts +1 -1
- package/dist/types/menubar/utils.d.ts +3 -1
- package/dist/types/model.d.ts +1 -1
- package/dist/types/panel/balloon/balloonpanelview.d.ts +27 -27
- package/dist/types/template.d.ts +1 -1
- package/dist/types/tooltipmanager.d.ts +1 -1
- package/dist/types/view.d.ts +1 -1
- package/package.json +3 -3
- package/src/colorselector/colorgridsfragmentview.js +2 -3
- package/src/colorselector/documentcolorcollection.d.ts +1 -1
- package/src/colorselector/documentcolorcollection.js +1 -1
- package/src/dialog/dialogview.d.ts +1 -1
- package/src/dialog/dialogview.js +2 -2
- package/src/editorui/accessibilityhelp/accessibilityhelp.d.ts +1 -1
- package/src/editorui/accessibilityhelp/accessibilityhelp.js +3 -1
- package/src/editorui/editorui.d.ts +1 -1
- package/src/editorui/editorui.js +1 -1
- package/src/editorui/poweredby.d.ts +1 -1
- package/src/editorui/poweredby.js +1 -1
- package/src/focuscycler.d.ts +1 -1
- package/src/focuscycler.js +1 -1
- package/src/menubar/utils.d.ts +3 -1
- package/src/menubar/utils.js +6 -2
- package/src/model.d.ts +1 -1
- package/src/model.js +1 -1
- package/src/panel/balloon/balloonpanelview.d.ts +27 -27
- package/src/panel/balloon/balloonpanelview.js +268 -269
- package/src/panel/balloon/contextualballoon.js +1 -1
- package/src/panel/sticky/stickypanelview.js +1 -1
- package/src/template.d.ts +1 -1
- package/src/template.js +1 -1
- package/src/toolbar/balloon/balloontoolbar.js +3 -3
- package/src/toolbar/block/blockbuttonview.js +1 -1
- package/src/toolbar/block/blocktoolbar.js +1 -1
- package/src/toolbar/toolbarview.js +2 -2
- package/src/tooltipmanager.d.ts +1 -1
- package/src/tooltipmanager.js +19 -7
- package/src/view.d.ts +1 -1
- package/src/view.js +1 -1
|
@@ -16,7 +16,7 @@ import { FocusTracker, KeystrokeHandler, Rect, ResizeObserver, global, isVisible
|
|
|
16
16
|
import { icons } from '@ckeditor/ckeditor5-core';
|
|
17
17
|
import { isObject } from 'lodash-es';
|
|
18
18
|
import '../../theme/components/toolbar/toolbar.css';
|
|
19
|
-
export const NESTED_TOOLBAR_ICONS = {
|
|
19
|
+
export const NESTED_TOOLBAR_ICONS = /* #__PURE__ */ (() => ({
|
|
20
20
|
alignLeft: icons.alignLeft,
|
|
21
21
|
bold: icons.bold,
|
|
22
22
|
importExport: icons.importExport,
|
|
@@ -26,7 +26,7 @@ export const NESTED_TOOLBAR_ICONS = {
|
|
|
26
26
|
threeVerticalDots: icons.threeVerticalDots,
|
|
27
27
|
pilcrow: icons.pilcrow,
|
|
28
28
|
dragIndicator: icons.dragIndicator
|
|
29
|
-
};
|
|
29
|
+
}))();
|
|
30
30
|
/**
|
|
31
31
|
* The toolbar view class.
|
|
32
32
|
*/
|
package/src/tooltipmanager.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ declare const TooltipManager_base: {
|
|
|
68
68
|
* **Note**: This class is a singleton. All editor instances re-use the same instance loaded by
|
|
69
69
|
* {@link module:ui/editorui/editorui~EditorUI} of the first editor.
|
|
70
70
|
*/
|
|
71
|
-
export default class TooltipManager extends TooltipManager_base {
|
|
71
|
+
export default class TooltipManager extends /* #__PURE__ */ TooltipManager_base {
|
|
72
72
|
/**
|
|
73
73
|
* The view rendering text of the tooltip.
|
|
74
74
|
*/
|
package/src/tooltipmanager.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module ui/tooltipmanager
|
|
7
7
|
*/
|
|
8
8
|
import View from './view.js';
|
|
9
|
-
import BalloonPanelView
|
|
9
|
+
import BalloonPanelView from './panel/balloon/balloonpanelview.js';
|
|
10
10
|
import { DomEmitterMixin, ResizeObserver, first, global, isVisible } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
import { isElement, debounce } from 'lodash-es';
|
|
12
12
|
import '../theme/components/tooltip/tooltip.css';
|
|
@@ -65,7 +65,7 @@ const BALLOON_CLASS = 'ck-tooltip';
|
|
|
65
65
|
* **Note**: This class is a singleton. All editor instances re-use the same instance loaded by
|
|
66
66
|
* {@link module:ui/editorui/editorui~EditorUI} of the first editor.
|
|
67
67
|
*/
|
|
68
|
-
class TooltipManager extends DomEmitterMixin() {
|
|
68
|
+
class TooltipManager extends /* #__PURE__ */ DomEmitterMixin() {
|
|
69
69
|
/**
|
|
70
70
|
* Creates an instance of the tooltip manager.
|
|
71
71
|
*/
|
|
@@ -217,7 +217,15 @@ class TooltipManager extends DomEmitterMixin() {
|
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
this._unpinTooltip();
|
|
220
|
-
|
|
220
|
+
// The tooltip should be pinned immediately when the element gets focused using keyboard.
|
|
221
|
+
// If it is focused using the mouse, the tooltip should be pinned after a delay to prevent flashing.
|
|
222
|
+
// See https://github.com/ckeditor/ckeditor5/issues/16383
|
|
223
|
+
if (evt.name === 'focus' && !elementWithTooltipAttribute.matches(':hover')) {
|
|
224
|
+
this._pinTooltip(elementWithTooltipAttribute, getTooltipData(elementWithTooltipAttribute));
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
this._pinTooltipDebounced(elementWithTooltipAttribute, getTooltipData(elementWithTooltipAttribute));
|
|
228
|
+
}
|
|
221
229
|
}
|
|
222
230
|
/**
|
|
223
231
|
* Handles hiding tooltips on `mouseleave` and `blur` in DOM.
|
|
@@ -300,6 +308,13 @@ class TooltipManager extends DomEmitterMixin() {
|
|
|
300
308
|
bodyViewCollection.add(this.balloonPanelView);
|
|
301
309
|
}
|
|
302
310
|
this.tooltipTextView.text = text;
|
|
311
|
+
this.balloonPanelView.class = [BALLOON_CLASS, cssClass]
|
|
312
|
+
.filter(className => className)
|
|
313
|
+
.join(' ');
|
|
314
|
+
// Ensure that all changes to the tooltip are set before pinning it.
|
|
315
|
+
// Setting class or text after pinning can cause the tooltip to be pinned in the wrong position.
|
|
316
|
+
// It happens especially often when tooltip has class modified (like adding `ck-tooltip_multi-line`).
|
|
317
|
+
// See https://github.com/ckeditor/ckeditor5/issues/16365
|
|
303
318
|
this.balloonPanelView.pin({
|
|
304
319
|
target: targetDomElement,
|
|
305
320
|
positions: TooltipManager.getPositioningFunctions(position)
|
|
@@ -312,9 +327,6 @@ class TooltipManager extends DomEmitterMixin() {
|
|
|
312
327
|
}
|
|
313
328
|
});
|
|
314
329
|
this._mutationObserver.attach(targetDomElement);
|
|
315
|
-
this.balloonPanelView.class = [BALLOON_CLASS, cssClass]
|
|
316
|
-
.filter(className => className)
|
|
317
|
-
.join(' ');
|
|
318
330
|
// Start responding to changes in editor UI or content layout. For instance, when collaborators change content
|
|
319
331
|
// and a contextual toolbar attached to a content starts to move (and so should move the tooltip).
|
|
320
332
|
// Note: Using low priority to let other listeners that position contextual toolbars etc. to react first.
|
|
@@ -370,7 +382,7 @@ class TooltipManager extends DomEmitterMixin() {
|
|
|
370
382
|
* A set of default {@link module:utils/dom/position~PositioningFunction positioning functions} used by the `TooltipManager`
|
|
371
383
|
* to pin tooltips in different positions.
|
|
372
384
|
*/
|
|
373
|
-
TooltipManager.defaultBalloonPositions = generatePositions({
|
|
385
|
+
TooltipManager.defaultBalloonPositions = BalloonPanelView.generatePositions({
|
|
374
386
|
heightOffset: 5,
|
|
375
387
|
sideOffset: 13
|
|
376
388
|
});
|
package/src/view.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ declare const View_base: import("@ckeditor/ckeditor5-utils").Mixed<{
|
|
|
78
78
|
* } );
|
|
79
79
|
* ```
|
|
80
80
|
*/
|
|
81
|
-
export default class View<TElement extends HTMLElement = HTMLElement> extends View_base {
|
|
81
|
+
export default class View<TElement extends HTMLElement = HTMLElement> extends /* #__PURE__ */ View_base {
|
|
82
82
|
/**
|
|
83
83
|
* An HTML element of the view. `null` until {@link #render rendered}
|
|
84
84
|
* from the {@link #template}.
|
package/src/view.js
CHANGED
|
@@ -75,7 +75,7 @@ import '../theme/globals/globals.css';
|
|
|
75
75
|
* } );
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
|
-
export default class View extends DomEmitterMixin(ObservableMixin()) {
|
|
78
|
+
export default class View extends /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ ObservableMixin()) {
|
|
79
79
|
/**
|
|
80
80
|
* Creates an instance of the {@link module:ui/view~View} class.
|
|
81
81
|
*
|