@ckeditor/ckeditor5-ui 35.4.0 → 36.0.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/LICENSE.md +1 -1
- package/package.json +21 -21
- package/src/bindings/addkeyboardhandlingforgrid.js +1 -1
- package/src/bindings/clickoutsidehandler.js +5 -7
- package/src/bindings/injectcsstransitiondisabler.js +1 -1
- package/src/bindings/preventdefault.js +1 -1
- package/src/bindings/submithandler.js +1 -1
- package/src/button/button.js +1 -1
- package/src/button/buttonview.js +1 -1
- package/src/button/switchbuttonview.js +1 -1
- package/src/colorgrid/colorgridview.js +1 -1
- package/src/colorgrid/colortileview.js +1 -1
- package/src/colorgrid/utils.js +1 -1
- package/src/componentfactory.js +1 -1
- package/src/dropdown/button/dropdownbutton.js +1 -1
- package/src/dropdown/button/dropdownbuttonview.js +1 -1
- package/src/dropdown/button/splitbuttonview.js +1 -1
- package/src/dropdown/dropdownpanelfocusable.js +1 -1
- package/src/dropdown/dropdownpanelview.js +1 -1
- package/src/dropdown/dropdownview.js +1 -1
- package/src/dropdown/utils.js +84 -27
- package/src/editableui/editableuiview.js +1 -1
- package/src/editableui/inline/inlineeditableuiview.js +1 -1
- package/src/editorui/bodycollection.js +1 -1
- package/src/editorui/boxed/boxededitoruiview.js +1 -1
- package/src/editorui/editorui.js +476 -0
- package/src/editorui/editoruiview.js +1 -1
- package/src/focuscycler.js +1 -1
- package/src/formheader/formheaderview.js +1 -1
- package/src/icon/iconview.js +1 -1
- package/src/iframe/iframeview.js +10 -10
- package/src/index.js +3 -1
- package/src/input/inputview.js +1 -1
- package/src/inputnumber/inputnumberview.js +1 -1
- package/src/inputtext/inputtextview.js +1 -1
- package/src/label/labelview.js +1 -1
- package/src/labeledfield/labeledfieldview.js +1 -1
- package/src/labeledfield/utils.js +1 -1
- package/src/labeledinput/labeledinputview.js +1 -1
- package/src/list/listitemview.js +1 -1
- package/src/list/listseparatorview.js +1 -1
- package/src/list/listview.js +10 -2
- package/src/model.js +1 -1
- package/src/notification/notification.js +1 -1
- package/src/panel/balloon/balloonpanelview.js +1 -1
- package/src/panel/balloon/contextualballoon.js +37 -15
- package/src/panel/sticky/stickypanelview.js +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/normalizetoolbarconfig.js +1 -1
- package/src/toolbar/toolbarlinebreakview.js +1 -1
- package/src/toolbar/toolbarseparatorview.js +1 -1
- package/src/toolbar/toolbarview.js +15 -7
- package/src/tooltipmanager.js +1 -1
- package/src/view.js +1 -1
- package/src/viewcollection.js +1 -1
- package/theme/components/button/button.css +1 -1
- package/theme/components/button/switchbutton.css +1 -1
- package/theme/components/colorgrid/colorgrid.css +1 -1
- package/theme/components/dropdown/dropdown.css +1 -1
- package/theme/components/dropdown/listdropdown.css +1 -1
- package/theme/components/dropdown/splitbutton.css +1 -1
- package/theme/components/dropdown/toolbardropdown.css +1 -1
- package/theme/components/editorui/editorui.css +1 -1
- package/theme/components/formheader/formheader.css +1 -1
- package/theme/components/icon/icon.css +1 -1
- package/theme/components/input/input.css +1 -1
- package/theme/components/label/label.css +1 -1
- package/theme/components/labeledfield/labeledfieldview.css +1 -1
- package/theme/components/labeledinput/labeledinput.css +1 -1
- package/theme/components/list/list.css +1 -1
- package/theme/components/panel/balloonpanel.css +1 -1
- package/theme/components/panel/balloonrotator.css +1 -1
- package/theme/components/panel/fakepanel.css +1 -1
- package/theme/components/panel/stickypanel.css +1 -1
- package/theme/components/responsive-form/responsiveform.css +1 -1
- package/theme/components/toolbar/blocktoolbar.css +1 -1
- package/theme/components/toolbar/toolbar.css +1 -1
- package/theme/components/tooltip/tooltip.css +1 -1
- package/theme/globals/_hidden.css +1 -1
- package/theme/globals/_reset.css +1 -1
- package/theme/globals/_transition.css +1 -1
- package/theme/globals/_zindex.css +1 -1
- package/theme/globals/globals.css +1 -1
- package/theme/mixins/_dir.css +1 -1
- package/theme/mixins/_rwd.css +1 -1
- package/theme/mixins/_unselectable.css +1 -1
package/src/model.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -63,6 +63,9 @@ export default class ContextualBalloon extends Plugin {
|
|
|
63
63
|
*/
|
|
64
64
|
constructor(editor) {
|
|
65
65
|
super(editor);
|
|
66
|
+
this._view = null;
|
|
67
|
+
this._rotatorView = null;
|
|
68
|
+
this._fakePanelsView = null;
|
|
66
69
|
/**
|
|
67
70
|
* The {@link module:utils/dom/position~Options#limiter position limiter}
|
|
68
71
|
* for the {@link #view balloon}, used when no `limiter` has been passed into {@link #add}
|
|
@@ -91,15 +94,6 @@ export default class ContextualBalloon extends Plugin {
|
|
|
91
94
|
* @member {module:ui/view~View|null} #visibleView
|
|
92
95
|
*/
|
|
93
96
|
this.set('visibleView', null);
|
|
94
|
-
/**
|
|
95
|
-
* The common balloon panel view.
|
|
96
|
-
*
|
|
97
|
-
* @readonly
|
|
98
|
-
* @member {module:ui/panel/balloon/balloonpanelview~BalloonPanelView} #view
|
|
99
|
-
*/
|
|
100
|
-
this.view = new BalloonPanelView(editor.locale);
|
|
101
|
-
editor.ui.view.body.add(this.view);
|
|
102
|
-
editor.ui.focusTracker.add(this.view.element);
|
|
103
97
|
/**
|
|
104
98
|
* The map of views and their stacks.
|
|
105
99
|
*
|
|
@@ -139,23 +133,38 @@ export default class ContextualBalloon extends Plugin {
|
|
|
139
133
|
* @private
|
|
140
134
|
* @type {module:ui/panel/balloon/contextualballoon~RotatorView}
|
|
141
135
|
*/
|
|
142
|
-
this._rotatorView =
|
|
136
|
+
this._rotatorView = null;
|
|
143
137
|
/**
|
|
144
138
|
* Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.
|
|
145
139
|
*
|
|
146
140
|
* @private
|
|
147
141
|
* @type {module:ui/view~View}
|
|
148
142
|
*/
|
|
149
|
-
this._fakePanelsView =
|
|
143
|
+
this._fakePanelsView = null;
|
|
150
144
|
}
|
|
151
145
|
/**
|
|
152
146
|
* @inheritDoc
|
|
153
147
|
*/
|
|
154
148
|
destroy() {
|
|
155
149
|
super.destroy();
|
|
156
|
-
this.
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
if (this._view) {
|
|
151
|
+
this._view.destroy();
|
|
152
|
+
}
|
|
153
|
+
if (this._rotatorView) {
|
|
154
|
+
this._rotatorView.destroy();
|
|
155
|
+
}
|
|
156
|
+
if (this._fakePanelsView) {
|
|
157
|
+
this._fakePanelsView.destroy();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The common balloon panel view.
|
|
162
|
+
*/
|
|
163
|
+
get view() {
|
|
164
|
+
if (!this._view) {
|
|
165
|
+
this._createPanelView();
|
|
166
|
+
}
|
|
167
|
+
return this._view;
|
|
159
168
|
}
|
|
160
169
|
/**
|
|
161
170
|
* Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.
|
|
@@ -179,6 +188,9 @@ export default class ContextualBalloon extends Plugin {
|
|
|
179
188
|
* @param {Boolean} [data.singleViewMode=false] Whether the view should be the only visible view even if other stacks were added.
|
|
180
189
|
*/
|
|
181
190
|
add(data) {
|
|
191
|
+
if (!this._view) {
|
|
192
|
+
this._createPanelView();
|
|
193
|
+
}
|
|
182
194
|
if (this.hasView(data.view)) {
|
|
183
195
|
/**
|
|
184
196
|
* Trying to add configuration of the same view more than once.
|
|
@@ -291,6 +303,16 @@ export default class ContextualBalloon extends Plugin {
|
|
|
291
303
|
}
|
|
292
304
|
this._showView(Array.from(stack.values()).pop());
|
|
293
305
|
}
|
|
306
|
+
/**
|
|
307
|
+
* Initializes view instances.
|
|
308
|
+
*/
|
|
309
|
+
_createPanelView() {
|
|
310
|
+
this._view = new BalloonPanelView(this.editor.locale);
|
|
311
|
+
this.editor.ui.view.body.add(this._view);
|
|
312
|
+
this.editor.ui.focusTracker.add(this._view.element);
|
|
313
|
+
this._rotatorView = this._createRotatorView();
|
|
314
|
+
this._fakePanelsView = this._createFakePanelsView();
|
|
315
|
+
}
|
|
294
316
|
/**
|
|
295
317
|
* Returns the stack of the currently visible view.
|
|
296
318
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/template.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -139,11 +139,11 @@ export default class BalloonToolbar extends Plugin {
|
|
|
139
139
|
this.listenTo(editor, 'ready', () => {
|
|
140
140
|
const editableElement = editor.ui.view.editable.element;
|
|
141
141
|
// Set #toolbarView's max-width on the initialization and update it on the editable resize.
|
|
142
|
-
this._resizeObserver = new ResizeObserver(editableElement,
|
|
142
|
+
this._resizeObserver = new ResizeObserver(editableElement, entry => {
|
|
143
143
|
// The max-width equals 90% of the editable's width for the best user experience.
|
|
144
144
|
// The value keeps the balloon very close to the boundaries of the editable and limits the cases
|
|
145
145
|
// when the balloon juts out from the editable element it belongs to.
|
|
146
|
-
this.toolbarView.maxWidth = toPx(
|
|
146
|
+
this.toolbarView.maxWidth = toPx(entry.contentRect.width * .9);
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
149
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -257,6 +257,17 @@ export default class ToolbarView extends View {
|
|
|
257
257
|
* to this toolbar and all nested ones as well.
|
|
258
258
|
*/
|
|
259
259
|
fillFromConfig(itemsOrConfig, factory, removeItems) {
|
|
260
|
+
this.items.addMany(this._buildItemsFromConfig(itemsOrConfig, factory, removeItems));
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* A utility that expands the plain toolbar configuration into a list of view items using a given component factory.
|
|
264
|
+
*
|
|
265
|
+
* @param {Array.<String>|Object} itemsOrConfig The toolbar items or the entire toolbar configuration object.
|
|
266
|
+
* @param {module:ui/componentfactory~ComponentFactory} factory A factory producing toolbar items.
|
|
267
|
+
* @param {Array.<String>} [removeItems] An array of items names to be removed from the configuration. When present, applies
|
|
268
|
+
* to this toolbar and all nested ones as well.
|
|
269
|
+
*/
|
|
270
|
+
_buildItemsFromConfig(itemsOrConfig, factory, removeItems) {
|
|
260
271
|
const config = normalizeToolbarConfig(itemsOrConfig);
|
|
261
272
|
const normalizedRemoveItems = removeItems || config.removeItems;
|
|
262
273
|
const itemsToAdd = this._cleanItemsConfiguration(config.items, factory, normalizedRemoveItems)
|
|
@@ -273,7 +284,7 @@ export default class ToolbarView extends View {
|
|
|
273
284
|
return factory.create(item);
|
|
274
285
|
})
|
|
275
286
|
.filter((item) => !!item);
|
|
276
|
-
|
|
287
|
+
return itemsToAdd;
|
|
277
288
|
}
|
|
278
289
|
/**
|
|
279
290
|
* Cleans up the {@link module:ui/toolbar/toolbarview~ToolbarView#items} of the toolbar by removing unwanted items and
|
|
@@ -439,8 +450,7 @@ export default class ToolbarView extends View {
|
|
|
439
450
|
else {
|
|
440
451
|
dropdownView.buttonView.withText = true;
|
|
441
452
|
}
|
|
442
|
-
addToolbarToDropdown(dropdownView,
|
|
443
|
-
dropdownView.toolbarView.fillFromConfig(items, componentFactory, removeItems);
|
|
453
|
+
addToolbarToDropdown(dropdownView, () => (dropdownView.toolbarView._buildItemsFromConfig(items, componentFactory, removeItems)));
|
|
444
454
|
return dropdownView;
|
|
445
455
|
}
|
|
446
456
|
}
|
|
@@ -896,15 +906,13 @@ class DynamicGrouping {
|
|
|
896
906
|
// Make sure the dropdown never sticks out to the left/right. It should be under the main toolbar.
|
|
897
907
|
// (https://github.com/ckeditor/ckeditor5/issues/5608)
|
|
898
908
|
dropdown.panelPosition = locale.uiLanguageDirection === 'ltr' ? 'sw' : 'se';
|
|
899
|
-
addToolbarToDropdown(dropdown,
|
|
909
|
+
addToolbarToDropdown(dropdown, this.groupedItems);
|
|
900
910
|
dropdown.buttonView.set({
|
|
901
911
|
label: t('Show more items'),
|
|
902
912
|
tooltip: true,
|
|
903
913
|
tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw',
|
|
904
914
|
icon: threeVerticalDots
|
|
905
915
|
});
|
|
906
|
-
// 1:1 pass–through binding.
|
|
907
|
-
dropdown.toolbarView.items.bindTo(this.groupedItems).using(item => item);
|
|
908
916
|
return dropdown;
|
|
909
917
|
}
|
|
910
918
|
/**
|
package/src/tooltipmanager.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/src/view.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/* eslint-disable @typescript-eslint/no-invalid-void-type */
|
package/src/viewcollection.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
package/theme/globals/_reset.css
CHANGED
package/theme/mixins/_dir.css
CHANGED
package/theme/mixins/_rwd.css
CHANGED