@ckeditor/ckeditor5-ui 42.0.2 → 43.0.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +1 -539
  2. package/dist/button/button.d.ts +0 -6
  3. package/dist/button/buttonview.d.ts +16 -4
  4. package/dist/button/filedialogbuttonview.d.ts +42 -15
  5. package/dist/button/listitembuttonview.d.ts +82 -0
  6. package/dist/editorui/accessibilityhelp/accessibilityhelp.d.ts +1 -1
  7. package/dist/editorui/editorui.d.ts +57 -0
  8. package/dist/editorui/editoruiview.d.ts +5 -0
  9. package/dist/focuscycler.d.ts +53 -7
  10. package/dist/formheader/formheaderview.d.ts +1 -2
  11. package/dist/highlightedtext/buttonlabelwithhighlightview.d.ts +34 -0
  12. package/dist/highlightedtext/labelwithhighlightview.d.ts +30 -0
  13. package/dist/index-editor.css +32 -0
  14. package/dist/index.css +42 -0
  15. package/dist/index.css.map +1 -1
  16. package/dist/index.d.ts +6 -2
  17. package/dist/index.js +4934 -4291
  18. package/dist/index.js.map +1 -1
  19. package/dist/menubar/menubarmenubuttonview.d.ts +2 -2
  20. package/dist/menubar/menubarmenulistitembuttonview.d.ts +2 -2
  21. package/dist/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +2 -2
  22. package/dist/menubar/menubarmenulistview.d.ts +5 -0
  23. package/dist/menubar/menubarview.d.ts +10 -1
  24. package/dist/menubar/utils.d.ts +16 -10
  25. package/dist/panel/balloon/balloonpanelview.d.ts +13 -1
  26. package/dist/search/filtergroupanditemnames.d.ts +19 -0
  27. package/dist/toolbar/block/blocktoolbar.d.ts +14 -0
  28. package/dist/tooltipmanager.d.ts +0 -7
  29. package/dist/translations/sr-latn.js +1 -1
  30. package/dist/translations/sr-latn.umd.js +1 -1
  31. package/lang/translations/sr-latn.po +17 -17
  32. package/package.json +3 -3
  33. package/src/arialiveannouncer.js +0 -1
  34. package/src/bindings/draggableviewmixin.js +1 -1
  35. package/src/button/button.d.ts +0 -6
  36. package/src/button/buttonview.d.ts +16 -4
  37. package/src/button/buttonview.js +32 -2
  38. package/src/button/filedialogbuttonview.d.ts +42 -15
  39. package/src/button/filedialogbuttonview.js +69 -27
  40. package/src/button/listitembuttonview.d.ts +78 -0
  41. package/src/button/listitembuttonview.js +129 -0
  42. package/src/colorpicker/colorpickerview.js +5 -0
  43. package/src/colorselector/colorgridsfragmentview.js +9 -5
  44. package/src/dialog/dialog.js +4 -1
  45. package/src/dialog/dialogview.js +1 -14
  46. package/src/dropdown/utils.js +23 -3
  47. package/src/editorui/accessibilityhelp/accessibilityhelp.d.ts +1 -1
  48. package/src/editorui/accessibilityhelp/accessibilityhelp.js +20 -12
  49. package/src/editorui/bodycollection.js +2 -1
  50. package/src/editorui/editorui.d.ts +57 -0
  51. package/src/editorui/editorui.js +104 -12
  52. package/src/editorui/editoruiview.d.ts +5 -0
  53. package/src/focuscycler.d.ts +53 -7
  54. package/src/focuscycler.js +79 -1
  55. package/src/formheader/formheaderview.d.ts +1 -2
  56. package/src/formheader/formheaderview.js +1 -2
  57. package/src/highlightedtext/buttonlabelwithhighlightview.d.ts +30 -0
  58. package/src/highlightedtext/buttonlabelwithhighlightview.js +31 -0
  59. package/src/highlightedtext/labelwithhighlightview.d.ts +26 -0
  60. package/src/highlightedtext/labelwithhighlightview.js +33 -0
  61. package/src/index.d.ts +6 -2
  62. package/src/index.js +6 -2
  63. package/src/menubar/menubarmenubuttonview.d.ts +2 -2
  64. package/src/menubar/menubarmenubuttonview.js +2 -2
  65. package/src/menubar/menubarmenulistitembuttonview.d.ts +2 -2
  66. package/src/menubar/menubarmenulistitembuttonview.js +2 -2
  67. package/src/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +2 -2
  68. package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +2 -2
  69. package/src/menubar/menubarmenulistview.d.ts +5 -0
  70. package/src/menubar/menubarmenulistview.js +49 -0
  71. package/src/menubar/menubarview.d.ts +10 -1
  72. package/src/menubar/menubarview.js +11 -4
  73. package/src/menubar/utils.d.ts +16 -10
  74. package/src/menubar/utils.js +84 -53
  75. package/src/panel/balloon/balloonpanelview.d.ts +13 -1
  76. package/src/panel/balloon/balloonpanelview.js +41 -3
  77. package/src/search/filtergroupanditemnames.d.ts +15 -0
  78. package/src/search/filtergroupanditemnames.js +38 -0
  79. package/src/search/text/searchtextview.js +1 -0
  80. package/src/toolbar/balloon/balloontoolbar.js +1 -1
  81. package/src/toolbar/block/blocktoolbar.d.ts +14 -0
  82. package/src/toolbar/block/blocktoolbar.js +83 -3
  83. package/src/tooltipmanager.d.ts +0 -7
  84. package/src/tooltipmanager.js +1 -18
  85. package/theme/components/button/listitembutton.css +38 -0
@@ -11,6 +11,7 @@ import TooltipManager from '../tooltipmanager.js';
11
11
  import PoweredBy from './poweredby.js';
12
12
  import AriaLiveAnnouncer from '../arialiveannouncer.js';
13
13
  import { ObservableMixin, isVisible, FocusTracker } from '@ckeditor/ckeditor5-utils';
14
+ import { normalizeMenuBarConfig } from '../menubar/utils.js';
14
15
  /**
15
16
  * A class providing the minimal interface that is required to successfully bootstrap any editor UI.
16
17
  */
@@ -37,6 +38,14 @@ export default class EditorUI extends /* #__PURE__ */ ObservableMixin() {
37
38
  * All available & focusable toolbars.
38
39
  */
39
40
  this._focusableToolbarDefinitions = [];
41
+ /**
42
+ * All additional menu bar items, groups or menus that have their default location defined.
43
+ */
44
+ this._extraMenuBarElements = [];
45
+ /**
46
+ * The last focused element to which focus should return on `Esc` press.
47
+ */
48
+ this._lastFocusedForeignElement = null;
40
49
  const editingView = editor.editing.view;
41
50
  this.editor = editor;
42
51
  this.componentFactory = new ComponentFactory(editor);
@@ -180,6 +189,48 @@ export default class EditorUI extends /* #__PURE__ */ ObservableMixin() {
180
189
  }
181
190
  this._focusableToolbarDefinitions.push({ toolbarView, options });
182
191
  }
192
+ /**
193
+ * Registers an extra menu bar element, which could be a single item, a group of items, or a menu containing groups.
194
+ *
195
+ * ```ts
196
+ * // Register a new menu bar item.
197
+ * editor.ui.extendMenuBar( {
198
+ * item: 'menuBar:customFunctionButton',
199
+ * position: 'after:menuBar:bold'
200
+ * } );
201
+ *
202
+ * // Register a new menu bar group.
203
+ * editor.ui.extendMenuBar( {
204
+ * group: {
205
+ * groupId: 'customGroup',
206
+ * items: [
207
+ * 'menuBar:customFunctionButton'
208
+ * ]
209
+ * },
210
+ * position: 'start:help'
211
+ * } );
212
+ *
213
+ * // Register a new menu bar menu.
214
+ * editor.ui.extendMenuBar( {
215
+ * menu: {
216
+ * menuId: 'customMenu',
217
+ * label: 'customMenu',
218
+ * groups: [
219
+ * {
220
+ * groupId: 'customGroup',
221
+ * items: [
222
+ * 'menuBar:customFunctionButton'
223
+ * ]
224
+ * }
225
+ * ]
226
+ * },
227
+ * position: 'after:help'
228
+ * } );
229
+ * ```
230
+ */
231
+ extendMenuBar(config) {
232
+ this._extraMenuBarElements.push(config);
233
+ }
183
234
  /**
184
235
  * Stores all editable elements used by the editor instance.
185
236
  *
@@ -199,6 +250,42 @@ export default class EditorUI extends /* #__PURE__ */ ObservableMixin() {
199
250
  'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.', { editorUI: this });
200
251
  return this._editableElementsMap;
201
252
  }
253
+ /**
254
+ * Initializes menu bar.
255
+ */
256
+ _initMenuBar(menuBarView) {
257
+ const menuBarViewElement = menuBarView.element;
258
+ this.focusTracker.add(menuBarViewElement);
259
+ this.editor.keystrokes.listenTo(menuBarViewElement);
260
+ const normalizedMenuBarConfig = normalizeMenuBarConfig(this.editor.config.get('menuBar') || {});
261
+ menuBarView.fillFromConfig(normalizedMenuBarConfig, this.componentFactory, this._extraMenuBarElements);
262
+ this.editor.keystrokes.set('Esc', (data, cancel) => {
263
+ if (!menuBarViewElement.contains(this.editor.ui.focusTracker.focusedElement)) {
264
+ return;
265
+ }
266
+ // Bring focus back to where it came from before focusing the toolbar:
267
+ // If it came from outside the engine view (e.g. source editing), move it there.
268
+ if (this._lastFocusedForeignElement) {
269
+ this._lastFocusedForeignElement.focus();
270
+ this._lastFocusedForeignElement = null;
271
+ }
272
+ // Else just focus the view editing.
273
+ else {
274
+ this.editor.editing.view.focus();
275
+ }
276
+ cancel();
277
+ });
278
+ this.editor.keystrokes.set('Alt+F9', (data, cancel) => {
279
+ // If menu bar is already focused do nothing.
280
+ if (menuBarViewElement.contains(this.editor.ui.focusTracker.focusedElement)) {
281
+ return;
282
+ }
283
+ this._saveLastFocusedForeignElement();
284
+ menuBarView.isFocusBorderEnabled = true;
285
+ menuBarView.focus();
286
+ cancel();
287
+ });
288
+ }
202
289
  /**
203
290
  * Returns viewport offsets object:
204
291
  *
@@ -246,18 +333,10 @@ export default class EditorUI extends /* #__PURE__ */ ObservableMixin() {
246
333
  _initFocusTracking() {
247
334
  const editor = this.editor;
248
335
  const editingView = editor.editing.view;
249
- let lastFocusedForeignElement;
250
336
  let candidateDefinitions;
251
337
  // Focus the next focusable toolbar on <kbd>Alt</kbd> + <kbd>F10</kbd>.
252
338
  editor.keystrokes.set('Alt+F10', (data, cancel) => {
253
- const focusedElement = this.focusTracker.focusedElement;
254
- // Focus moved out of a DOM element that
255
- // * is not a toolbar,
256
- // * does not belong to the editing view (e.g. source editing).
257
- if (Array.from(this._editableElementsMap.values()).includes(focusedElement) &&
258
- !Array.from(editingView.domRoots.values()).includes(focusedElement)) {
259
- lastFocusedForeignElement = focusedElement;
260
- }
339
+ this._saveLastFocusedForeignElement();
261
340
  const currentFocusedToolbarDefinition = this._getCurrentFocusedToolbarDefinition();
262
341
  // * When focusing a toolbar for the first time, set the array of definitions for successive presses of Alt+F10.
263
342
  // This ensures, the navigation works always the same and no pair of toolbars takes over
@@ -295,9 +374,9 @@ export default class EditorUI extends /* #__PURE__ */ ObservableMixin() {
295
374
  }
296
375
  // Bring focus back to where it came from before focusing the toolbar:
297
376
  // 1. If it came from outside the engine view (e.g. source editing), move it there.
298
- if (lastFocusedForeignElement) {
299
- lastFocusedForeignElement.focus();
300
- lastFocusedForeignElement = null;
377
+ if (this._lastFocusedForeignElement) {
378
+ this._lastFocusedForeignElement.focus();
379
+ this._lastFocusedForeignElement = null;
301
380
  }
302
381
  // 2. There are two possibilities left:
303
382
  // 2.1. It could be that the focus went from an editable element in the view (root or nested).
@@ -313,6 +392,19 @@ export default class EditorUI extends /* #__PURE__ */ ObservableMixin() {
313
392
  cancel();
314
393
  });
315
394
  }
395
+ /**
396
+ * Saves last focused element that doen not belong to editing view to restore focus on `Esc`.
397
+ */
398
+ _saveLastFocusedForeignElement() {
399
+ const focusedElement = this.focusTracker.focusedElement;
400
+ // Focus moved out of a DOM element that
401
+ // * is not a toolbar,
402
+ // * does not belong to the editing view (e.g. source editing).
403
+ if (Array.from(this._editableElementsMap.values()).includes(focusedElement) &&
404
+ !Array.from(this.editor.editing.view.domRoots.values()).includes(focusedElement)) {
405
+ this._lastFocusedForeignElement = focusedElement;
406
+ }
407
+ }
316
408
  /**
317
409
  * Returns definitions of toolbars that could potentially be focused, sorted by their importance for the user.
318
410
  *
@@ -10,6 +10,7 @@ import BodyCollection from './bodycollection.js';
10
10
  import type EditableUIView from '../editableui/editableuiview.js';
11
11
  import type { Locale, LocaleTranslate } from '@ckeditor/ckeditor5-utils';
12
12
  import '../../theme/components/editorui/editorui.css';
13
+ import type MenuBarView from '../menubar/menubarview.js';
13
14
  /**
14
15
  * The editor UI view class. Base class for the editor main views.
15
16
  */
@@ -22,6 +23,10 @@ export default abstract class EditorUIView extends View {
22
23
  locale: Locale;
23
24
  t: LocaleTranslate;
24
25
  abstract get editable(): EditableUIView;
26
+ /**
27
+ * Menu bar view instance. May not be initialized in some editor types.
28
+ */
29
+ menuBarView?: MenuBarView;
25
30
  /**
26
31
  * Creates an instance of the editor UI view class.
27
32
  *
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module ui/focuscycler
7
7
  */
8
- import { type ArrayOrItem, type FocusTracker, type KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
8
+ import { type ArrayOrItem, type FocusTracker, type KeystrokeHandler, type KeystrokeHandlerOptions } from '@ckeditor/ckeditor5-utils';
9
9
  import type View from './view.js';
10
10
  import type ViewCollection from './viewcollection.js';
11
11
  declare const FocusCycler_base: {
@@ -105,6 +105,7 @@ export default class FocusCycler extends /* #__PURE__ */ FocusCycler_base {
105
105
  focusables: ViewCollection<FocusableView>;
106
106
  focusTracker: FocusTracker;
107
107
  keystrokeHandler?: KeystrokeHandler;
108
+ keystrokeHandlerOptions?: KeystrokeHandlerOptions;
108
109
  actions?: FocusCyclerActions;
109
110
  });
110
111
  /**
@@ -164,6 +165,54 @@ export default class FocusCycler extends /* #__PURE__ */ FocusCycler_base {
164
165
  * **Note**: Hidden views (e.g. with `display: none`) are ignored.
165
166
  */
166
167
  focusPrevious(): void;
168
+ /**
169
+ * Allows for creating continuous focus cycling across multiple focus cyclers and their collections of {@link #focusables}.
170
+ *
171
+ * It starts listening to the {@link module:ui/focuscycler~FocusCyclerForwardCycleEvent} and
172
+ * {@link module:ui/focuscycler~FocusCyclerBackwardCycleEvent} events of the chained focus cycler and engages,
173
+ * whenever the user reaches the last (forwards navigation) or first (backwards navigation) focusable view
174
+ * and would normally start over. Instead, the navigation continues on the higher level (flattens).
175
+ *
176
+ * For instance, for the following nested focus navigation structure, the focus would get stuck the moment
177
+ * the AB gets focused and its focus cycler starts managing it:
178
+ *
179
+ * ┌────────────┐ ┌──────────────────────────────────┐ ┌────────────┐
180
+ * │ AA │ │ AB │ │ AC │
181
+ * │ │ │ │ │ │
182
+ * │ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │ │
183
+ * │ │ │ ┌──► ABA ├──► ABB ├──► ABC ├───┐ │ │ │
184
+ * │ ├───► │ └─────┘ └─────┘ └─────┘ │ │ │ │
185
+ * │ │ │ │ │ │ │ │
186
+ * │ │ │ │ │ │ │ │
187
+ * │ │ │ └──────────────────────────────┘ │ │ │
188
+ * │ │ │ │ │ │
189
+ * └────────────┘ └──────────────────────────────────┘ └────────────┘
190
+ *
191
+ * Chaining a focus tracker that manages AA, AB, and AC with the focus tracker that manages ABA, ABB, and ABC
192
+ * creates a seamless navigation experience instead:
193
+ *
194
+ * ┌────────────┐ ┌──────────────────────────────────┐ ┌────────────┐
195
+ * │ AA │ │ AB │ │ AC │
196
+ * │ │ │ │ │ │
197
+ * │ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │ │
198
+ * │ │ │ ┌──► ABA ├──► ABB ├──► ABC ├──┐ │ │ │
199
+ * ┌──► ├───┼─┘ └─────┘ └─────┘ └─────┘ └──┼───► ├──┐
200
+ * │ │ │ │ │ │ │ │
201
+ * │ │ │ │ │ │ │ │
202
+ * │ │ │ │ │ │ │ │
203
+ * │ │ │ │ │ │ │ │
204
+ * │ └────────────┘ └──────────────────────────────────┘ └────────────┘ │
205
+ * │ │
206
+ * │ │
207
+ * └──────────────────────────────────────────────────────────────────────────┘
208
+ *
209
+ * See {@link #unchain} to reverse the chaining.
210
+ */
211
+ chain(chainedFocusCycler: FocusCycler): void;
212
+ /**
213
+ * Reverses a chaining made by {@link #chain}.
214
+ */
215
+ unchain(otherFocusCycler: FocusCycler): void;
167
216
  /**
168
217
  * Focuses the given view if it exists.
169
218
  *
@@ -204,12 +253,9 @@ export type FocusableView = View & {
204
253
  export type ViewWithFocusCycler = FocusableView & {
205
254
  focusCycler: FocusCycler;
206
255
  };
207
- export interface FocusCyclerActions {
208
- focusFirst?: ArrayOrItem<string>;
209
- focusLast?: ArrayOrItem<string>;
210
- focusNext?: ArrayOrItem<string>;
211
- focusPrevious?: ArrayOrItem<string>;
212
- }
256
+ export type FocusCyclerActions = {
257
+ [key in 'focusFirst' | 'focusLast' | 'focusPrevious' | 'focusNext']?: ArrayOrItem<string>;
258
+ };
213
259
  /**
214
260
  * Fired when the focus cycler is about to move the focus from the last focusable item
215
261
  * to the first one.
@@ -80,7 +80,7 @@ export default class FocusCycler extends /* #__PURE__ */ EmitterMixin() {
80
80
  options.keystrokeHandler.set(keystroke, (data, cancel) => {
81
81
  this[methodName]();
82
82
  cancel();
83
- });
83
+ }, options.keystrokeHandlerOptions);
84
84
  }
85
85
  }
86
86
  }
@@ -198,6 +198,84 @@ export default class FocusCycler extends /* #__PURE__ */ EmitterMixin() {
198
198
  this._focus(previous, -1);
199
199
  }
200
200
  }
201
+ /**
202
+ * Allows for creating continuous focus cycling across multiple focus cyclers and their collections of {@link #focusables}.
203
+ *
204
+ * It starts listening to the {@link module:ui/focuscycler~FocusCyclerForwardCycleEvent} and
205
+ * {@link module:ui/focuscycler~FocusCyclerBackwardCycleEvent} events of the chained focus cycler and engages,
206
+ * whenever the user reaches the last (forwards navigation) or first (backwards navigation) focusable view
207
+ * and would normally start over. Instead, the navigation continues on the higher level (flattens).
208
+ *
209
+ * For instance, for the following nested focus navigation structure, the focus would get stuck the moment
210
+ * the AB gets focused and its focus cycler starts managing it:
211
+ *
212
+ * ┌────────────┐ ┌──────────────────────────────────┐ ┌────────────┐
213
+ * │ AA │ │ AB │ │ AC │
214
+ * │ │ │ │ │ │
215
+ * │ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │ │
216
+ * │ │ │ ┌──► ABA ├──► ABB ├──► ABC ├───┐ │ │ │
217
+ * │ ├───► │ └─────┘ └─────┘ └─────┘ │ │ │ │
218
+ * │ │ │ │ │ │ │ │
219
+ * │ │ │ │ │ │ │ │
220
+ * │ │ │ └──────────────────────────────┘ │ │ │
221
+ * │ │ │ │ │ │
222
+ * └────────────┘ └──────────────────────────────────┘ └────────────┘
223
+ *
224
+ * Chaining a focus tracker that manages AA, AB, and AC with the focus tracker that manages ABA, ABB, and ABC
225
+ * creates a seamless navigation experience instead:
226
+ *
227
+ * ┌────────────┐ ┌──────────────────────────────────┐ ┌────────────┐
228
+ * │ AA │ │ AB │ │ AC │
229
+ * │ │ │ │ │ │
230
+ * │ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │ │
231
+ * │ │ │ ┌──► ABA ├──► ABB ├──► ABC ├──┐ │ │ │
232
+ * ┌──► ├───┼─┘ └─────┘ └─────┘ └─────┘ └──┼───► ├──┐
233
+ * │ │ │ │ │ │ │ │
234
+ * │ │ │ │ │ │ │ │
235
+ * │ │ │ │ │ │ │ │
236
+ * │ │ │ │ │ │ │ │
237
+ * │ └────────────┘ └──────────────────────────────────┘ └────────────┘ │
238
+ * │ │
239
+ * │ │
240
+ * └──────────────────────────────────────────────────────────────────────────┘
241
+ *
242
+ * See {@link #unchain} to reverse the chaining.
243
+ */
244
+ chain(chainedFocusCycler) {
245
+ const getCurrentFocusedView = () => {
246
+ // This may happen when one focus cycler does not include focusables of the other (horizontal case).
247
+ if (this.current === null) {
248
+ return null;
249
+ }
250
+ return this.focusables.get(this.current);
251
+ };
252
+ this.listenTo(chainedFocusCycler, 'forwardCycle', evt => {
253
+ const oldCurrent = getCurrentFocusedView();
254
+ this.focusNext();
255
+ // Stop the event propagation only if an attempt at focusing the view actually moved the focus.
256
+ // If not, let the otherFocusCycler handle the event.
257
+ if (oldCurrent !== getCurrentFocusedView()) {
258
+ evt.stop();
259
+ }
260
+ // The priority is critical for cycling across multiple chain levels when there's a single view at some of them only.
261
+ }, { priority: 'low' });
262
+ this.listenTo(chainedFocusCycler, 'backwardCycle', evt => {
263
+ const oldCurrent = getCurrentFocusedView();
264
+ this.focusPrevious();
265
+ // Stop the event propagation only if an attempt at focusing the view actually moved the focus.
266
+ // If not, let the otherFocusCycler handle the event.
267
+ if (oldCurrent !== getCurrentFocusedView()) {
268
+ evt.stop();
269
+ }
270
+ // The priority is critical for cycling across multiple chain levels when there's a single view at some of them only.
271
+ }, { priority: 'low' });
272
+ }
273
+ /**
274
+ * Reverses a chaining made by {@link #chain}.
275
+ */
276
+ unchain(otherFocusCycler) {
277
+ this.stopListening(otherFocusCycler);
278
+ }
201
279
  /**
202
280
  * Focuses the given view if it exists.
203
281
  *
@@ -18,8 +18,7 @@ import '../../theme/components/formheader/formheader.css';
18
18
  * The component can also be extended by any other elements, like: icons, dropdowns, etc.
19
19
  *
20
20
  * It is used i.a.
21
- * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
22
- * and {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}.
21
+ * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.
23
22
  *
24
23
  * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.
25
24
  */
@@ -16,8 +16,7 @@ import '../../theme/components/formheader/formheader.css';
16
16
  * The component can also be extended by any other elements, like: icons, dropdowns, etc.
17
17
  *
18
18
  * It is used i.a.
19
- * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
20
- * and {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}.
19
+ * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.
21
20
  *
22
21
  * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.
23
22
  */
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ui/highlightedtext/buttonlabelwithhighlightview
7
+ */
8
+ import type ButtonLabel from '../button/buttonlabel.js';
9
+ import HighlightedTextView from './highlightedtextview.js';
10
+ /**
11
+ * A button label view that can highlight a text fragment.
12
+ */
13
+ export default class ButtonLabelWithHighlightView extends HighlightedTextView implements ButtonLabel {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ style: string | undefined;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ text: string | undefined;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ id: string | undefined;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ constructor();
30
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import HighlightedTextView from './highlightedtextview.js';
6
+ /**
7
+ * A button label view that can highlight a text fragment.
8
+ */
9
+ export default class ButtonLabelWithHighlightView extends HighlightedTextView {
10
+ /**
11
+ * @inheritDoc
12
+ */
13
+ constructor() {
14
+ super();
15
+ this.set({
16
+ style: undefined,
17
+ text: undefined,
18
+ id: undefined
19
+ });
20
+ const bind = this.bindTemplate;
21
+ this.extendTemplate({
22
+ attributes: {
23
+ class: [
24
+ 'ck-button__label'
25
+ ],
26
+ style: bind.to('style'),
27
+ id: bind.to('id')
28
+ }
29
+ });
30
+ }
31
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ui/highlightedtext/labelwithhighlightview
7
+ */
8
+ import HighlightedTextView from './highlightedtextview.js';
9
+ import type LabelView from '../label/labelview.js';
10
+ /**
11
+ * A label view that can highlight a text fragment.
12
+ */
13
+ export default class LabelWithHighlightView extends HighlightedTextView implements LabelView {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ readonly id: string;
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ for: string | undefined;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ constructor();
26
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module ui/highlightedtext/labelwithhighlightview
7
+ */
8
+ import HighlightedTextView from './highlightedtextview.js';
9
+ import { uid } from '@ckeditor/ckeditor5-utils';
10
+ /**
11
+ * A label view that can highlight a text fragment.
12
+ */
13
+ export default class LabelWithHighlightView extends HighlightedTextView {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ constructor() {
18
+ super();
19
+ this.set('for', undefined);
20
+ const bind = this.bindTemplate;
21
+ this.id = `ck-editor__label_${uid()}`;
22
+ this.extendTemplate({
23
+ attributes: {
24
+ class: [
25
+ 'ck',
26
+ 'ck-label'
27
+ ],
28
+ id: this.id,
29
+ for: bind.to('for')
30
+ }
31
+ });
32
+ }
33
+ }
package/src/index.d.ts CHANGED
@@ -18,7 +18,8 @@ export type { default as ButtonLabel } from './button/buttonlabel.js';
18
18
  export { default as ButtonView } from './button/buttonview.js';
19
19
  export { default as ButtonLabelView } from './button/buttonlabelview.js';
20
20
  export { default as SwitchButtonView } from './button/switchbuttonview.js';
21
- export { default as FileDialogButtonView } from './button/filedialogbuttonview.js';
21
+ export { default as ListItemButtonView } from './button/listitembuttonview.js';
22
+ export { default as FileDialogButtonView, FileDialogListItemButtonView } from './button/filedialogbuttonview.js';
22
23
  export { default as CollapsibleView } from './collapsible/collapsibleview.js';
23
24
  export * from './colorgrid/utils.js';
24
25
  export { default as ColorGridView, type ColorDefinition } from './colorgrid/colorgridview.js';
@@ -53,6 +54,7 @@ export { default as ListItemGroupView } from './list/listitemgroupview.js';
53
54
  export { default as ListItemView } from './list/listitemview.js';
54
55
  export { default as ListSeparatorView } from './list/listseparatorview.js';
55
56
  export { default as ListView } from './list/listview.js';
57
+ export { default as filterGroupAndItemNames } from './search/filtergroupanditemnames.js';
56
58
  export { default as Notification } from './notification/notification.js';
57
59
  export { default as ViewModel } from './model.js';
58
60
  export { default as BalloonPanelView } from './panel/balloon/balloonpanelview.js';
@@ -63,6 +65,8 @@ export { default as SearchTextView, type SearchTextViewSearchEvent, type SearchT
63
65
  export { default as SearchInfoView } from './search/searchinfoview.js';
64
66
  export type { default as FilteredView, FilteredViewExecuteEvent } from './search/filteredview.js';
65
67
  export { default as HighlightedTextView } from './highlightedtext/highlightedtextview.js';
68
+ export { default as ButtonLabelWithHighlightView } from './highlightedtext/buttonlabelwithhighlightview.js';
69
+ export { default as LabelWithHighlightView } from './highlightedtext/labelwithhighlightview.js';
66
70
  export { default as TooltipManager } from './tooltipmanager.js';
67
71
  export { default as Template, type TemplateDefinition } from './template.js';
68
72
  export { default as SpinnerView } from './spinner/spinnerview.js';
@@ -79,5 +83,5 @@ export { default as MenuBarMenuListView } from './menubar/menubarmenulistview.js
79
83
  export { default as MenuBarMenuListItemView } from './menubar/menubarmenulistitemview.js';
80
84
  export { default as MenuBarMenuListItemButtonView } from './menubar/menubarmenulistitembuttonview.js';
81
85
  export { default as MenuBarMenuListItemFileDialogButtonView } from './menubar/menubarmenulistitemfiledialogbuttonview.js';
82
- export { normalizeMenuBarConfig, DefaultMenuBarItems, _initMenuBar } from './menubar/utils.js';
86
+ export { normalizeMenuBarConfig, DefaultMenuBarItems } from './menubar/utils.js';
83
87
  import './augmentation.js';
package/src/index.js CHANGED
@@ -17,7 +17,8 @@ export { default as BodyCollection } from './editorui/bodycollection.js';
17
17
  export { default as ButtonView } from './button/buttonview.js';
18
18
  export { default as ButtonLabelView } from './button/buttonlabelview.js';
19
19
  export { default as SwitchButtonView } from './button/switchbuttonview.js';
20
- export { default as FileDialogButtonView } from './button/filedialogbuttonview.js';
20
+ export { default as ListItemButtonView } from './button/listitembuttonview.js';
21
+ export { default as FileDialogButtonView, FileDialogListItemButtonView } from './button/filedialogbuttonview.js';
21
22
  export { default as CollapsibleView } from './collapsible/collapsibleview.js';
22
23
  export * from './colorgrid/utils.js';
23
24
  export { default as ColorGridView } from './colorgrid/colorgridview.js';
@@ -51,6 +52,7 @@ export { default as ListItemGroupView } from './list/listitemgroupview.js';
51
52
  export { default as ListItemView } from './list/listitemview.js';
52
53
  export { default as ListSeparatorView } from './list/listseparatorview.js';
53
54
  export { default as ListView } from './list/listview.js';
55
+ export { default as filterGroupAndItemNames } from './search/filtergroupanditemnames.js';
54
56
  export { default as Notification } from './notification/notification.js';
55
57
  export { default as ViewModel } from './model.js';
56
58
  export { default as BalloonPanelView } from './panel/balloon/balloonpanelview.js';
@@ -60,6 +62,8 @@ export { default as AutocompleteView } from './autocomplete/autocompleteview.js'
60
62
  export { default as SearchTextView } from './search/text/searchtextview.js';
61
63
  export { default as SearchInfoView } from './search/searchinfoview.js';
62
64
  export { default as HighlightedTextView } from './highlightedtext/highlightedtextview.js';
65
+ export { default as ButtonLabelWithHighlightView } from './highlightedtext/buttonlabelwithhighlightview.js';
66
+ export { default as LabelWithHighlightView } from './highlightedtext/labelwithhighlightview.js';
63
67
  export { default as TooltipManager } from './tooltipmanager.js';
64
68
  export { default as Template } from './template.js';
65
69
  export { default as SpinnerView } from './spinner/spinnerview.js';
@@ -76,5 +80,5 @@ export { default as MenuBarMenuListView } from './menubar/menubarmenulistview.js
76
80
  export { default as MenuBarMenuListItemView } from './menubar/menubarmenulistitemview.js';
77
81
  export { default as MenuBarMenuListItemButtonView } from './menubar/menubarmenulistitembuttonview.js';
78
82
  export { default as MenuBarMenuListItemFileDialogButtonView } from './menubar/menubarmenulistitemfiledialogbuttonview.js';
79
- export { normalizeMenuBarConfig, DefaultMenuBarItems, _initMenuBar } from './menubar/utils.js';
83
+ export { normalizeMenuBarConfig, DefaultMenuBarItems } from './menubar/utils.js';
80
84
  import './augmentation.js';
@@ -6,14 +6,14 @@
6
6
  * @module ui/menubar/menubarmenubuttonview
7
7
  */
8
8
  import IconView from '../icon/iconview.js';
9
- import ButtonView from '../button/buttonview.js';
9
+ import ListItemButtonView from '../button/listitembuttonview.js';
10
10
  import type { Locale } from '@ckeditor/ckeditor5-utils';
11
11
  import '../../theme/components/menubar/menubarmenubutton.css';
12
12
  /**
13
13
  * A menu {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#buttonView} class. Buttons like this one
14
14
  * open both top-level bar menus as well as sub-menus.
15
15
  */
16
- export default class MenuBarMenuButtonView extends ButtonView {
16
+ export default class MenuBarMenuButtonView extends ListItemButtonView {
17
17
  /**
18
18
  * An icon that displays an arrow to indicate a direction of the menu.
19
19
  */
@@ -6,14 +6,14 @@
6
6
  * @module ui/menubar/menubarmenubuttonview
7
7
  */
8
8
  import IconView from '../icon/iconview.js';
9
- import ButtonView from '../button/buttonview.js';
9
+ import ListItemButtonView from '../button/listitembuttonview.js';
10
10
  import dropdownArrowIcon from '../../theme/icons/dropdown-arrow.svg';
11
11
  import '../../theme/components/menubar/menubarmenubutton.css';
12
12
  /**
13
13
  * A menu {@link module:ui/menubar/menubarmenuview~MenuBarMenuView#buttonView} class. Buttons like this one
14
14
  * open both top-level bar menus as well as sub-menus.
15
15
  */
16
- export default class MenuBarMenuButtonView extends ButtonView {
16
+ export default class MenuBarMenuButtonView extends ListItemButtonView {
17
17
  /**
18
18
  * Creates an instance of the menu bar button view.
19
19
  *
@@ -6,12 +6,12 @@
6
6
  * @module ui/menubar/menubarmenulistitembuttonview
7
7
  */
8
8
  import type { Locale } from '@ckeditor/ckeditor5-utils';
9
- import ButtonView from '../button/buttonview.js';
9
+ import ListItemButtonView from '../button/listitembuttonview.js';
10
10
  import '../../theme/components/menubar/menubarmenulistitembutton.css';
11
11
  /**
12
12
  * A menu bar list button view. Buttons like this one execute user actions.
13
13
  */
14
- export default class MenuBarMenuListItemButtonView extends ButtonView {
14
+ export default class MenuBarMenuListItemButtonView extends ListItemButtonView {
15
15
  /**
16
16
  * Creates an instance of the menu bar list button view.
17
17
  *
@@ -2,12 +2,12 @@
2
2
  * @license Copyright (c) 2003-2024, 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
- import ButtonView from '../button/buttonview.js';
5
+ import ListItemButtonView from '../button/listitembuttonview.js';
6
6
  import '../../theme/components/menubar/menubarmenulistitembutton.css';
7
7
  /**
8
8
  * A menu bar list button view. Buttons like this one execute user actions.
9
9
  */
10
- export default class MenuBarMenuListItemButtonView extends ButtonView {
10
+ export default class MenuBarMenuListItemButtonView extends ListItemButtonView {
11
11
  /**
12
12
  * Creates an instance of the menu bar list button view.
13
13
  *