@ckeditor/ckeditor5-ui 35.2.1 → 35.3.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.
Files changed (59) hide show
  1. package/package.json +31 -23
  2. package/src/bindings/addkeyboardhandlingforgrid.js +45 -57
  3. package/src/bindings/clickoutsidehandler.js +15 -21
  4. package/src/bindings/injectcsstransitiondisabler.js +16 -20
  5. package/src/bindings/preventdefault.js +6 -8
  6. package/src/bindings/submithandler.js +5 -7
  7. package/src/button/button.js +5 -0
  8. package/src/button/buttonview.js +220 -259
  9. package/src/button/switchbuttonview.js +56 -71
  10. package/src/colorgrid/colorgridview.js +135 -197
  11. package/src/colorgrid/colortileview.js +37 -47
  12. package/src/colorgrid/utils.js +57 -66
  13. package/src/componentfactory.js +79 -93
  14. package/src/dropdown/button/dropdownbutton.js +5 -0
  15. package/src/dropdown/button/dropdownbuttonview.js +44 -57
  16. package/src/dropdown/button/splitbuttonview.js +159 -207
  17. package/src/dropdown/dropdownpanelfocusable.js +5 -0
  18. package/src/dropdown/dropdownpanelview.js +101 -112
  19. package/src/dropdown/dropdownview.js +396 -438
  20. package/src/dropdown/utils.js +164 -213
  21. package/src/editableui/editableuiview.js +125 -141
  22. package/src/editableui/inline/inlineeditableuiview.js +44 -54
  23. package/src/editorui/bodycollection.js +61 -75
  24. package/src/editorui/boxed/boxededitoruiview.js +91 -104
  25. package/src/editorui/editoruiview.js +30 -39
  26. package/src/focuscycler.js +214 -245
  27. package/src/formheader/formheaderview.js +58 -70
  28. package/src/icon/iconview.js +145 -111
  29. package/src/iframe/iframeview.js +37 -49
  30. package/src/index.js +0 -17
  31. package/src/input/inputview.js +170 -198
  32. package/src/inputnumber/inputnumberview.js +48 -56
  33. package/src/inputtext/inputtextview.js +14 -18
  34. package/src/label/labelview.js +44 -53
  35. package/src/labeledfield/labeledfieldview.js +212 -235
  36. package/src/labeledfield/utils.js +39 -57
  37. package/src/labeledinput/labeledinputview.js +190 -221
  38. package/src/list/listitemview.js +40 -50
  39. package/src/list/listseparatorview.js +15 -19
  40. package/src/list/listview.js +94 -115
  41. package/src/model.js +19 -25
  42. package/src/notification/notification.js +151 -202
  43. package/src/panel/balloon/balloonpanelview.js +535 -628
  44. package/src/panel/balloon/contextualballoon.js +611 -732
  45. package/src/panel/sticky/stickypanelview.js +238 -270
  46. package/src/template.js +1049 -1479
  47. package/src/toolbar/balloon/balloontoolbar.js +337 -424
  48. package/src/toolbar/block/blockbuttonview.js +32 -42
  49. package/src/toolbar/block/blocktoolbar.js +375 -477
  50. package/src/toolbar/normalizetoolbarconfig.js +17 -21
  51. package/src/toolbar/toolbarlinebreakview.js +15 -19
  52. package/src/toolbar/toolbarseparatorview.js +15 -19
  53. package/src/toolbar/toolbarview.js +866 -1053
  54. package/src/tooltipmanager.js +324 -353
  55. package/src/view.js +389 -430
  56. package/src/viewcollection.js +147 -178
  57. package/src/button/button.jsdoc +0 -165
  58. package/src/dropdown/button/dropdownbutton.jsdoc +0 -22
  59. package/src/dropdown/dropdownpanelfocusable.jsdoc +0 -27
@@ -2,11 +2,9 @@
2
2
  * @license Copyright (c) 2003-2022, 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
-
6
5
  /**
7
6
  * @module ui/dropdown/utils
8
7
  */
9
-
10
8
  import DropdownPanelView from './dropdownpanelview';
11
9
  import DropdownView from './dropdownview';
12
10
  import DropdownButtonView from './button/dropdownbuttonview';
@@ -15,15 +13,12 @@ import ListView from '../list/listview';
15
13
  import ListItemView from '../list/listitemview';
16
14
  import ListSeparatorView from '../list/listseparatorview';
17
15
  import ButtonView from '../button/buttonview';
16
+ import SplitButtonView from './button/splitbuttonview';
18
17
  import SwitchButtonView from '../button/switchbuttonview';
19
-
20
18
  import clickOutsideHandler from '../bindings/clickoutsidehandler';
21
-
22
19
  import { global, priorities, logWarning } from '@ckeditor/ckeditor5-utils';
23
-
24
20
  import '../../theme/components/dropdown/toolbardropdown.css';
25
21
  import '../../theme/components/dropdown/listdropdown.css';
26
-
27
22
  /**
28
23
  * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
29
24
  * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
@@ -86,25 +81,20 @@ import '../../theme/components/dropdown/listdropdown.css';
86
81
  * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
87
82
  * @returns {module:ui/dropdown/dropdownview~DropdownView} The dropdown view instance.
88
83
  */
89
- export function createDropdown( locale, ButtonClass = DropdownButtonView ) {
90
- const buttonView = new ButtonClass( locale );
91
-
92
- const panelView = new DropdownPanelView( locale );
93
- const dropdownView = new DropdownView( locale, buttonView, panelView );
94
-
95
- buttonView.bind( 'isEnabled' ).to( dropdownView );
96
-
97
- if ( buttonView instanceof DropdownButtonView ) {
98
- buttonView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
99
- } else {
100
- buttonView.arrowView.bind( 'isOn' ).to( dropdownView, 'isOpen' );
101
- }
102
-
103
- addDefaultBehavior( dropdownView );
104
-
105
- return dropdownView;
84
+ export function createDropdown(locale, ButtonClass = DropdownButtonView) {
85
+ const buttonView = new ButtonClass(locale);
86
+ const panelView = new DropdownPanelView(locale);
87
+ const dropdownView = new DropdownView(locale, buttonView, panelView);
88
+ buttonView.bind('isEnabled').to(dropdownView);
89
+ if (buttonView instanceof SplitButtonView) {
90
+ buttonView.arrowView.bind('isOn').to(dropdownView, 'isOpen');
91
+ }
92
+ else {
93
+ buttonView.bind('isOn').to(dropdownView, 'isOpen');
94
+ }
95
+ addDefaultBehavior(dropdownView);
96
+ return dropdownView;
106
97
  }
107
-
108
98
  /**
109
99
  * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
110
100
  *
@@ -140,30 +130,24 @@ export function createDropdown( locale, ButtonClass = DropdownButtonView ) {
140
130
  * as a whole resulting in the focus moving to its first focusable item (default behavior of
141
131
  * {@link module:ui/dropdown/dropdownview~DropdownView}).
142
132
  */
143
- export function addToolbarToDropdown( dropdownView, buttons, options = {} ) {
144
- const locale = dropdownView.locale;
145
- const t = locale.t;
146
- const toolbarView = dropdownView.toolbarView = new ToolbarView( locale );
147
-
148
- toolbarView.set( 'ariaLabel', t( 'Dropdown toolbar' ) );
149
-
150
- dropdownView.extendTemplate( {
151
- attributes: {
152
- class: [ 'ck-toolbar-dropdown' ]
153
- }
154
- } );
155
-
156
- buttons.map( view => toolbarView.items.add( view ) );
157
-
158
- if ( options.enableActiveItemFocusOnDropdownOpen ) {
159
- // Accessibility: Focus the first active button in the toolbar when the dropdown gets open.
160
- focusChildOnDropdownOpen( dropdownView, () => toolbarView.items.find( item => item.isOn ) );
161
- }
162
-
163
- dropdownView.panelView.children.add( toolbarView );
164
- toolbarView.items.delegate( 'execute' ).to( dropdownView );
133
+ export function addToolbarToDropdown(dropdownView, buttons, options = {}) {
134
+ const locale = dropdownView.locale;
135
+ const t = locale.t;
136
+ const toolbarView = dropdownView.toolbarView = new ToolbarView(locale);
137
+ toolbarView.set('ariaLabel', t('Dropdown toolbar'));
138
+ dropdownView.extendTemplate({
139
+ attributes: {
140
+ class: ['ck-toolbar-dropdown']
141
+ }
142
+ });
143
+ buttons.map(view => toolbarView.items.add(view));
144
+ if (options.enableActiveItemFocusOnDropdownOpen) {
145
+ // Accessibility: Focus the first active button in the toolbar when the dropdown gets open.
146
+ focusChildOnDropdownOpen(dropdownView, () => toolbarView.items.find((item) => item.isOn));
147
+ }
148
+ dropdownView.panelView.children.add(toolbarView);
149
+ toolbarView.items.delegate('execute').to(dropdownView);
165
150
  }
166
-
167
151
  /**
168
152
  * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.
169
153
  *
@@ -209,47 +193,40 @@ export function addToolbarToDropdown( dropdownView, buttons, options = {} ) {
209
193
  * @param {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>} items
210
194
  * A collection of the list item definitions to populate the list.
211
195
  */
212
- export function addListToDropdown( dropdownView, items ) {
213
- const locale = dropdownView.locale;
214
- const listView = dropdownView.listView = new ListView( locale );
215
-
216
- listView.items.bindTo( items ).using( ( { type, model } ) => {
217
- if ( type === 'separator' ) {
218
- return new ListSeparatorView( locale );
219
- } else if ( type === 'button' || type === 'switchbutton' ) {
220
- const listItemView = new ListItemView( locale );
221
- let buttonView;
222
-
223
- if ( type === 'button' ) {
224
- buttonView = new ButtonView( locale );
225
- } else {
226
- buttonView = new SwitchButtonView( locale );
227
- }
228
-
229
- // Bind all model properties to the button view.
230
- buttonView.bind( ...Object.keys( model ) ).to( model );
231
- buttonView.delegate( 'execute' ).to( listItemView );
232
-
233
- listItemView.children.add( buttonView );
234
-
235
- return listItemView;
236
- }
237
- } );
238
-
239
- dropdownView.panelView.children.add( listView );
240
-
241
- listView.items.delegate( 'execute' ).to( dropdownView );
242
-
243
- // Accessibility: Focus the first active button in the list when the dropdown gets open.
244
- focusChildOnDropdownOpen( dropdownView, () => listView.items.find( item => {
245
- if ( item instanceof ListItemView ) {
246
- return item.children.first.isOn;
247
- }
248
-
249
- return false;
250
- } ) );
196
+ export function addListToDropdown(dropdownView, items) {
197
+ const locale = dropdownView.locale;
198
+ const listView = dropdownView.listView = new ListView(locale);
199
+ listView.items.bindTo(items).using(def => {
200
+ if (def.type === 'separator') {
201
+ return new ListSeparatorView(locale);
202
+ }
203
+ else if (def.type === 'button' || def.type === 'switchbutton') {
204
+ const listItemView = new ListItemView(locale);
205
+ let buttonView;
206
+ if (def.type === 'button') {
207
+ buttonView = new ButtonView(locale);
208
+ }
209
+ else {
210
+ buttonView = new SwitchButtonView(locale);
211
+ }
212
+ // Bind all model properties to the button view.
213
+ buttonView.bind(...Object.keys(def.model)).to(def.model);
214
+ buttonView.delegate('execute').to(listItemView);
215
+ listItemView.children.add(buttonView);
216
+ return listItemView;
217
+ }
218
+ return null;
219
+ });
220
+ dropdownView.panelView.children.add(listView);
221
+ listView.items.delegate('execute').to(dropdownView);
222
+ // Accessibility: Focus the first active button in the list when the dropdown gets open.
223
+ focusChildOnDropdownOpen(dropdownView, () => listView.items.find(item => {
224
+ if (item instanceof ListItemView) {
225
+ return item.children.first.isOn;
226
+ }
227
+ return false;
228
+ }));
251
229
  }
252
-
253
230
  /**
254
231
  * A helper to be used on an existing {@link module:ui/dropdown/dropdownview~DropdownView} that focuses
255
232
  * a specific child in DOM when the dropdown {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}.
@@ -260,159 +237,133 @@ export function addListToDropdown( dropdownView, items ) {
260
237
  * If falsy value is returned, a default behavior of the dropdown will engage focusing the first focusable child in
261
238
  * the {@link module:ui/dropdown/dropdownview~DropdownView#panelView}.
262
239
  */
263
- export function focusChildOnDropdownOpen( dropdownView, childSelectorCallback ) {
264
- dropdownView.on( 'change:isOpen', () => {
265
- if ( !dropdownView.isOpen ) {
266
- return;
267
- }
268
-
269
- const childToFocus = childSelectorCallback();
270
-
271
- if ( !childToFocus ) {
272
- return;
273
- }
274
-
275
- if ( typeof childToFocus.focus === 'function' ) {
276
- childToFocus.focus();
277
- } else {
278
- /**
279
- * The child view of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} is missing the `focus()` method
280
- * and could not be focused when the dropdown got {@link module:ui/dropdown/dropdownview~DropdownView#isOpen open}.
281
- *
282
- * Making the content of a dropdown focusable in this case greatly improves the accessibility. Please make the view instance
283
- * implements the {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable focusable interface} for the best user
284
- * experience.
285
- *
286
- * @error ui-dropdown-focus-child-on-open-child-missing-focus
287
- * @param {module:ui/view~View} view
288
- */
289
- logWarning( 'ui-dropdown-focus-child-on-open-child-missing-focus', { view: childToFocus } );
290
- }
291
-
292
- // * Let the panel show up first (do not focus an invisible element).
293
- // * Execute after focusDropdownPanelOnOpen(). See focusDropdownPanelOnOpen() to learn more.
294
- }, { priority: priorities.low - 10 } );
240
+ export function focusChildOnDropdownOpen(dropdownView, childSelectorCallback) {
241
+ dropdownView.on('change:isOpen', () => {
242
+ if (!dropdownView.isOpen) {
243
+ return;
244
+ }
245
+ const childToFocus = childSelectorCallback();
246
+ if (!childToFocus) {
247
+ return;
248
+ }
249
+ if (typeof childToFocus.focus === 'function') {
250
+ childToFocus.focus();
251
+ }
252
+ else {
253
+ /**
254
+ * The child view of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} is missing the `focus()` method
255
+ * and could not be focused when the dropdown got {@link module:ui/dropdown/dropdownview~DropdownView#isOpen open}.
256
+ *
257
+ * Making the content of a dropdown focusable in this case greatly improves the accessibility. Please make the view instance
258
+ * implements the {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable focusable interface} for the best user
259
+ * experience.
260
+ *
261
+ * @error ui-dropdown-focus-child-on-open-child-missing-focus
262
+ * @param {module:ui/view~View} view
263
+ */
264
+ logWarning('ui-dropdown-focus-child-on-open-child-missing-focus', { view: childToFocus });
265
+ }
266
+ // * Let the panel show up first (do not focus an invisible element).
267
+ // * Execute after focusDropdownPanelOnOpen(). See focusDropdownPanelOnOpen() to learn more.
268
+ }, { priority: priorities.low - 10 });
295
269
  }
296
-
297
270
  // Add a set of default behaviors to dropdown view.
298
271
  //
299
272
  // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
300
- function addDefaultBehavior( dropdownView ) {
301
- closeDropdownOnClickOutside( dropdownView );
302
- closeDropdownOnExecute( dropdownView );
303
- closeDropdownOnBlur( dropdownView );
304
- focusDropdownContentsOnArrows( dropdownView );
305
- focusDropdownButtonOnClose( dropdownView );
306
- focusDropdownPanelOnOpen( dropdownView );
273
+ function addDefaultBehavior(dropdownView) {
274
+ closeDropdownOnClickOutside(dropdownView);
275
+ closeDropdownOnExecute(dropdownView);
276
+ closeDropdownOnBlur(dropdownView);
277
+ focusDropdownContentsOnArrows(dropdownView);
278
+ focusDropdownButtonOnClose(dropdownView);
279
+ focusDropdownPanelOnOpen(dropdownView);
307
280
  }
308
-
309
281
  // Adds a behavior to a dropdownView that closes opened dropdown when user clicks outside the dropdown.
310
282
  //
311
283
  // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
312
- function closeDropdownOnClickOutside( dropdownView ) {
313
- dropdownView.on( 'render', () => {
314
- clickOutsideHandler( {
315
- emitter: dropdownView,
316
- activator: () => dropdownView.isOpen,
317
- callback: () => {
318
- dropdownView.isOpen = false;
319
- },
320
- contextElements: [ dropdownView.element ]
321
- } );
322
- } );
284
+ function closeDropdownOnClickOutside(dropdownView) {
285
+ dropdownView.on('render', () => {
286
+ clickOutsideHandler({
287
+ emitter: dropdownView,
288
+ activator: () => dropdownView.isOpen,
289
+ callback: () => {
290
+ dropdownView.isOpen = false;
291
+ },
292
+ contextElements: [dropdownView.element]
293
+ });
294
+ });
323
295
  }
324
-
325
296
  // Adds a behavior to a dropdownView that closes the dropdown view on "execute" event.
326
297
  //
327
298
  // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
328
- function closeDropdownOnExecute( dropdownView ) {
329
- // Close the dropdown when one of the list items has been executed.
330
- dropdownView.on( 'execute', evt => {
331
- // Toggling a switch button view should not close the dropdown.
332
- if ( evt.source instanceof SwitchButtonView ) {
333
- return;
334
- }
335
-
336
- dropdownView.isOpen = false;
337
- } );
299
+ function closeDropdownOnExecute(dropdownView) {
300
+ // Close the dropdown when one of the list items has been executed.
301
+ dropdownView.on('execute', evt => {
302
+ // Toggling a switch button view should not close the dropdown.
303
+ if (evt.source instanceof SwitchButtonView) {
304
+ return;
305
+ }
306
+ dropdownView.isOpen = false;
307
+ });
338
308
  }
339
-
340
309
  // Adds a behavior to a dropdown view that closes opened dropdown when it loses focus.
341
310
  //
342
311
  // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
343
- function closeDropdownOnBlur( dropdownView ) {
344
- dropdownView.focusTracker.on( 'change:isFocused', ( evt, name, isFocused ) => {
345
- if ( dropdownView.isOpen && !isFocused ) {
346
- dropdownView.isOpen = false;
347
- }
348
- } );
312
+ function closeDropdownOnBlur(dropdownView) {
313
+ dropdownView.focusTracker.on('change:isFocused', (evt, name, isFocused) => {
314
+ if (dropdownView.isOpen && !isFocused) {
315
+ dropdownView.isOpen = false;
316
+ }
317
+ });
349
318
  }
350
-
351
319
  // Adds a behavior to a dropdownView that focuses the dropdown's panel view contents on keystrokes.
352
320
  //
353
321
  // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
354
- function focusDropdownContentsOnArrows( dropdownView ) {
355
- // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.
356
- dropdownView.keystrokes.set( 'arrowdown', ( data, cancel ) => {
357
- if ( dropdownView.isOpen ) {
358
- dropdownView.panelView.focus();
359
- cancel();
360
- }
361
- } );
362
-
363
- // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.
364
- dropdownView.keystrokes.set( 'arrowup', ( data, cancel ) => {
365
- if ( dropdownView.isOpen ) {
366
- dropdownView.panelView.focusLast();
367
- cancel();
368
- }
369
- } );
322
+ function focusDropdownContentsOnArrows(dropdownView) {
323
+ // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.
324
+ dropdownView.keystrokes.set('arrowdown', (data, cancel) => {
325
+ if (dropdownView.isOpen) {
326
+ dropdownView.panelView.focus();
327
+ cancel();
328
+ }
329
+ });
330
+ // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.
331
+ dropdownView.keystrokes.set('arrowup', (data, cancel) => {
332
+ if (dropdownView.isOpen) {
333
+ dropdownView.panelView.focusLast();
334
+ cancel();
335
+ }
336
+ });
370
337
  }
371
-
372
338
  // Adds a behavior that focuses the #buttonView when the dropdown was closed but focus was within the #panelView element.
373
339
  // This makes sure the focus is never lost.
374
340
  //
375
341
  // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
376
- function focusDropdownButtonOnClose( dropdownView ) {
377
- dropdownView.on( 'change:isOpen', ( evt, name, isOpen ) => {
378
- if ( isOpen ) {
379
- return;
380
- }
381
-
382
- // If the dropdown was closed, move the focus back to the button (#12125).
383
- // Don't touch the focus, if it moved somewhere else (e.g. moved to the editing root on #execute) (#12178).
384
- // Note: Don't use the state of the DropdownView#focusTracker here. It fires #blur with the timeout.
385
- if ( dropdownView.panelView.element.contains( global.document.activeElement ) ) {
386
- dropdownView.buttonView.focus();
387
- }
388
- } );
342
+ function focusDropdownButtonOnClose(dropdownView) {
343
+ dropdownView.on('change:isOpen', (evt, name, isOpen) => {
344
+ if (isOpen) {
345
+ return;
346
+ }
347
+ // If the dropdown was closed, move the focus back to the button (#12125).
348
+ // Don't touch the focus, if it moved somewhere else (e.g. moved to the editing root on #execute) (#12178).
349
+ // Note: Don't use the state of the DropdownView#focusTracker here. It fires #blur with the timeout.
350
+ if (dropdownView.panelView.element.contains(global.document.activeElement)) {
351
+ dropdownView.buttonView.focus();
352
+ }
353
+ });
389
354
  }
390
-
391
355
  // Adds a behavior that focuses the #panelView when dropdown gets open (accessibility).
392
356
  //
393
357
  // @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
394
- function focusDropdownPanelOnOpen( dropdownView ) {
395
- dropdownView.on( 'change:isOpen', ( evt, name, isOpen ) => {
396
- if ( !isOpen ) {
397
- return;
398
- }
399
-
400
- // Focus the first item in the dropdown when the dropdown opened.
401
- dropdownView.panelView.focus();
402
-
403
- // * Let the panel show up first (do not focus an invisible element).
404
- // * Also, execute before focusChildOnDropdownOpen() to make sure this helper does not break the
405
- // focus of a specific child by kicking in too late and resetting the focus in the panel.
406
- }, { priority: 'low' } );
358
+ function focusDropdownPanelOnOpen(dropdownView) {
359
+ dropdownView.on('change:isOpen', (evt, name, isOpen) => {
360
+ if (!isOpen) {
361
+ return;
362
+ }
363
+ // Focus the first item in the dropdown when the dropdown opened.
364
+ dropdownView.panelView.focus();
365
+ // * Let the panel show up first (do not focus an invisible element).
366
+ // * Also, execute before focusChildOnDropdownOpen() to make sure this helper does not break the
367
+ // focus of a specific child by kicking in too late and resetting the focus in the panel.
368
+ }, { priority: 'low' });
407
369
  }
408
-
409
- /**
410
- * A definition of the list item used by the {@link module:ui/dropdown/utils~addListToDropdown}
411
- * utility.
412
- *
413
- * @typedef {Object} module:ui/dropdown/utils~ListDropdownItemDefinition
414
- *
415
- * @property {String} type Either `'separator'`, `'button'` or `'switchbutton'`.
416
- * @property {module:ui/model~Model} [model] Model of the item (when **not** `'separator'`).
417
- * Its properties fuel the newly created list item (or its children, depending on the `type`).
418
- */