@ckeditor/ckeditor5-ui 44.3.0 → 45.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.
Files changed (107) hide show
  1. package/LICENSE.md +1 -1
  2. package/ckeditor5-metadata.json +1 -1
  3. package/dist/index-editor.css +28 -0
  4. package/dist/index.css +33 -0
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.js +196 -74
  7. package/dist/index.js.map +1 -1
  8. package/dist/translations/be.d.ts +8 -0
  9. package/dist/translations/be.js +5 -0
  10. package/dist/translations/be.umd.js +11 -0
  11. package/lang/translations/be.po +208 -0
  12. package/package.json +12 -6
  13. package/src/arialiveannouncer.js +24 -0
  14. package/src/autocomplete/autocompleteview.js +29 -25
  15. package/src/badge/badge.js +23 -15
  16. package/src/bindings/draggableviewmixin.js +12 -12
  17. package/src/button/buttonview.js +35 -5
  18. package/src/button/filedialogbuttonview.js +11 -1
  19. package/src/button/listitembuttonview.js +14 -10
  20. package/src/button/switchbuttonview.js +4 -0
  21. package/src/collapsible/collapsibleview.d.ts +1 -4
  22. package/src/collapsible/collapsibleview.js +13 -2
  23. package/src/colorgrid/colorgridview.js +18 -2
  24. package/src/colorgrid/colortileview.d.ts +1 -4
  25. package/src/colorgrid/colortileview.js +3 -3
  26. package/src/colorpicker/colorpickerview.js +28 -1
  27. package/src/colorselector/colorgridsfragmentview.js +80 -4
  28. package/src/colorselector/colorpickerfragmentview.js +44 -3
  29. package/src/colorselector/colorselectorview.js +36 -0
  30. package/src/componentfactory.js +8 -4
  31. package/src/dialog/dialog.js +18 -0
  32. package/src/dialog/dialogactionsview.js +20 -0
  33. package/src/dialog/dialogcontentview.js +4 -0
  34. package/src/dialog/dialogview.d.ts +1 -1
  35. package/src/dialog/dialogview.js +56 -11
  36. package/src/dropdown/button/dropdownbuttonview.d.ts +0 -3
  37. package/src/dropdown/button/dropdownbuttonview.js +6 -2
  38. package/src/dropdown/button/splitbuttonview.d.ts +1 -4
  39. package/src/dropdown/button/splitbuttonview.js +27 -3
  40. package/src/dropdown/dropdownpanelview.js +8 -0
  41. package/src/dropdown/dropdownview.js +235 -184
  42. package/src/dropdown/menu/dropdownmenubuttonview.d.ts +0 -3
  43. package/src/dropdown/menu/dropdownmenubuttonview.js +6 -2
  44. package/src/dropdown/menu/dropdownmenulistitembuttonview.js +1 -0
  45. package/src/dropdown/menu/dropdownmenulistitemview.js +4 -0
  46. package/src/dropdown/menu/dropdownmenunestedmenuview.js +31 -8
  47. package/src/dropdown/menu/dropdownmenurootlistview.js +16 -8
  48. package/src/editableui/editableuiview.js +22 -4
  49. package/src/editableui/inline/inlineeditableuiview.js +4 -0
  50. package/src/editorui/accessibilityhelp/accessibilityhelp.js +8 -11
  51. package/src/editorui/bodycollection.js +13 -0
  52. package/src/editorui/boxed/boxededitoruiview.js +14 -0
  53. package/src/editorui/editorui.d.ts +1 -1
  54. package/src/editorui/editorui.js +56 -25
  55. package/src/editorui/editoruiview.d.ts +15 -1
  56. package/src/editorui/editoruiview.js +22 -0
  57. package/src/editorui/evaluationbadge.js +5 -5
  58. package/src/editorui/poweredby.d.ts +1 -4
  59. package/src/editorui/poweredby.js +5 -2
  60. package/src/focuscycler.js +31 -0
  61. package/src/formheader/formheaderview.js +8 -0
  62. package/src/formrow/formrowview.d.ts +57 -0
  63. package/src/formrow/formrowview.js +56 -0
  64. package/src/highlightedtext/highlightedtextview.js +1 -1
  65. package/src/highlightedtext/labelwithhighlightview.js +4 -0
  66. package/src/icon/iconview.js +25 -16
  67. package/src/index.d.ts +1 -0
  68. package/src/index.js +1 -0
  69. package/src/input/inputbase.js +5 -0
  70. package/src/label/labelview.js +5 -0
  71. package/src/labeledfield/labeledfieldview.js +20 -0
  72. package/src/labeledinput/labeledinputview.js +13 -0
  73. package/src/list/listitemgroupview.js +15 -0
  74. package/src/list/listitemview.js +4 -0
  75. package/src/list/listview.js +27 -5
  76. package/src/menubar/menubarmenubuttonview.d.ts +0 -3
  77. package/src/menubar/menubarmenubuttonview.js +6 -2
  78. package/src/menubar/menubarmenupanelview.js +4 -0
  79. package/src/menubar/menubarmenuview.js +23 -6
  80. package/src/menubar/menubarview.d.ts +8 -0
  81. package/src/menubar/menubarview.js +27 -7
  82. package/src/menubar/utils.d.ts +6 -0
  83. package/src/menubar/utils.js +16 -3
  84. package/src/model.js +1 -1
  85. package/src/panel/balloon/balloonpanelview.js +464 -449
  86. package/src/panel/balloon/contextualballoon.js +60 -24
  87. package/src/panel/sticky/stickypanelview.js +14 -0
  88. package/src/search/searchresultsview.js +18 -0
  89. package/src/search/text/searchtextqueryview.d.ts +0 -3
  90. package/src/search/text/searchtextqueryview.js +15 -3
  91. package/src/search/text/searchtextview.js +43 -3
  92. package/src/template.js +69 -1
  93. package/src/textarea/textareaview.js +12 -5
  94. package/src/toolbar/balloon/balloontoolbar.d.ts +1 -1
  95. package/src/toolbar/balloon/balloontoolbar.js +38 -11
  96. package/src/toolbar/block/blocktoolbar.js +24 -8
  97. package/src/toolbar/toolbarview.d.ts +15 -2
  98. package/src/toolbar/toolbarview.js +206 -58
  99. package/src/tooltipmanager.js +50 -32
  100. package/src/view.js +76 -0
  101. package/src/viewcollection.js +4 -0
  102. package/theme/components/form/form.css +87 -0
  103. package/theme/components/formrow/formrow.css +32 -0
  104. package/theme/icons/accessibility.svg +0 -1
  105. package/theme/icons/color-tile-check.svg +0 -1
  106. package/theme/icons/dropdown-arrow.svg +0 -1
  107. package/theme/icons/project-logo.svg +0 -1
@@ -2,14 +2,11 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- /**
6
- * @module ui/collapsible/collapsibleview
7
- */
8
- import type { Locale } from '@ckeditor/ckeditor5-utils';
9
5
  import View from '../view.js';
10
6
  import ButtonView from '../button/buttonview.js';
11
7
  import type ViewCollection from '../viewcollection.js';
12
8
  import type { FocusableView } from '../focuscycler.js';
9
+ import type { Locale } from '@ckeditor/ckeditor5-utils';
13
10
  import '../../theme/components/collapsible/collapsible.css';
14
11
  /**
15
12
  * A collapsible UI component. Consists of a labeled button and a container which can be collapsed
@@ -2,9 +2,12 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
+ /**
6
+ * @module ui/collapsible/collapsibleview
7
+ */
8
+ import { IconDropdownArrow } from '@ckeditor/ckeditor5-icons';
5
9
  import View from '../view.js';
6
10
  import ButtonView from '../button/buttonview.js';
7
- import dropdownArrowIcon from '../../theme/icons/dropdown-arrow.svg';
8
11
  import '../../theme/components/collapsible/collapsible.css';
9
12
  /**
10
13
  * A collapsible UI component. Consists of a labeled button and a container which can be collapsed
@@ -13,6 +16,14 @@ import '../../theme/components/collapsible/collapsible.css';
13
16
  * @internal
14
17
  */
15
18
  export default class CollapsibleView extends View {
19
+ /**
20
+ * The main button that, when clicked, collapses or expands the container with {@link #children}.
21
+ */
22
+ buttonView;
23
+ /**
24
+ * A collection of the child views that can be collapsed by clicking the {@link #buttonView}.
25
+ */
26
+ children;
16
27
  /**
17
28
  * Creates an instance of the collapsible view.
18
29
  *
@@ -78,7 +89,7 @@ export default class CollapsibleView extends View {
78
89
  const bind = buttonView.bindTemplate;
79
90
  buttonView.set({
80
91
  withText: true,
81
- icon: dropdownArrowIcon
92
+ icon: IconDropdownArrow
82
93
  });
83
94
  buttonView.extendTemplate({
84
95
  attributes: {
@@ -14,6 +14,22 @@ import '../../theme/components/colorgrid/colorgrid.css';
14
14
  * A grid of {@link module:ui/colorgrid/colortileview~ColorTileView color tiles}.
15
15
  */
16
16
  export default class ColorGridView extends View {
17
+ /**
18
+ * A number of columns for the tiles grid.
19
+ */
20
+ columns;
21
+ /**
22
+ * Collection of the child tile views.
23
+ */
24
+ items;
25
+ /**
26
+ * Tracks information about DOM focus in the grid.
27
+ */
28
+ focusTracker;
29
+ /**
30
+ * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
31
+ */
32
+ keystrokes;
17
33
  /**
18
34
  * Creates an instance of a color grid containing {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.
19
35
  *
@@ -27,7 +43,7 @@ export default class ColorGridView extends View {
27
43
  constructor(locale, options) {
28
44
  super(locale);
29
45
  const colorDefinitions = options && options.colorDefinitions ? options.colorDefinitions : [];
30
- this.columns = options && options.columns ? options.columns : 5;
46
+ this.columns = options?.columns || 5;
31
47
  const viewStyleAttribute = {
32
48
  gridTemplateColumns: `repeat( ${this.columns}, 1fr)`
33
49
  };
@@ -110,7 +126,7 @@ export default class ColorGridView extends View {
110
126
  focusTracker: this.focusTracker,
111
127
  gridItems: this.items,
112
128
  numberOfColumns: this.columns,
113
- uiLanguageDirection: this.locale && this.locale.uiLanguageDirection
129
+ uiLanguageDirection: this.locale?.uiLanguageDirection
114
130
  });
115
131
  }
116
132
  /**
@@ -2,11 +2,8 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- /**
6
- * @module ui/colorgrid/colortileview
7
- */
8
- import ButtonView from '../button/buttonview.js';
9
5
  import { type Locale } from '@ckeditor/ckeditor5-utils';
6
+ import ButtonView from '../button/buttonview.js';
10
7
  /**
11
8
  * This class represents a single color tile in the {@link module:ui/colorgrid/colorgridview~ColorGridView}.
12
9
  */
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module ui/colorgrid/colortileview
7
7
  */
8
- import ButtonView from '../button/buttonview.js';
8
+ import { IconColorTileCheck } from '@ckeditor/ckeditor5-icons';
9
9
  import { env } from '@ckeditor/ckeditor5-utils';
10
- import checkIcon from '../../theme/icons/color-tile-check.svg';
10
+ import ButtonView from '../button/buttonview.js';
11
11
  /**
12
12
  * This class represents a single color tile in the {@link module:ui/colorgrid/colorgridview~ColorGridView}.
13
13
  */
@@ -17,7 +17,7 @@ export default class ColorTileView extends ButtonView {
17
17
  const bind = this.bindTemplate;
18
18
  this.set('color', undefined);
19
19
  this.set('hasBorder', false);
20
- this.icon = checkIcon;
20
+ this.icon = IconColorTileCheck;
21
21
  this.extendTemplate({
22
22
  attributes: {
23
23
  style: {
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { convertColor, convertToHex, registerCustomElement } from './utils.js';
9
9
  import { global, env } from '@ckeditor/ckeditor5-utils';
10
- import { debounce } from 'lodash-es';
10
+ import { debounce } from 'es-toolkit/compat';
11
11
  import View from '../view.js';
12
12
  import LabeledFieldView from '../labeledfield/labeledfieldview.js';
13
13
  import { createLabeledInputText } from '../labeledfield/utils.js';
@@ -19,6 +19,25 @@ const waitingTime = 150;
19
19
  * A class which represents a color picker with an input field for defining custom colors.
20
20
  */
21
21
  export default class ColorPickerView extends View {
22
+ /**
23
+ * Container for a `#` sign prefix and an input for displaying and defining custom colors
24
+ * in HEX format.
25
+ */
26
+ hexInputRow;
27
+ /**
28
+ * Debounced function updating the `color` property in the component
29
+ * and firing the `ColorPickerColorSelectedEvent`. Executed whenever color in component
30
+ * is changed by the user interaction (through the palette or input).
31
+ *
32
+ * @private
33
+ */
34
+ _debounceColorPickerEvent;
35
+ /**
36
+ * A reference to the configuration of the color picker specified in the constructor.
37
+ *
38
+ * @private
39
+ */
40
+ _config;
22
41
  /**
23
42
  * Creates a view of color picker.
24
43
  *
@@ -273,6 +292,14 @@ class HashView extends View {
273
292
  //
274
293
  // @private
275
294
  class ColorPickerInputRowView extends View {
295
+ /**
296
+ * A collection of row items (buttons, dropdowns, etc.).
297
+ */
298
+ children;
299
+ /**
300
+ * Hex input view element.
301
+ */
302
+ inputView;
276
303
  /**
277
304
  * Creates an instance of the form row class.
278
305
  *
@@ -11,7 +11,7 @@ import ColorGridView from '../colorgrid/colorgridview.js';
11
11
  import ColorTileView from '../colorgrid/colortileview.js';
12
12
  import Template from '../template.js';
13
13
  import DocumentColorCollection from './documentcolorcollection.js';
14
- import { icons } from '@ckeditor/ckeditor5-core';
14
+ import { IconEraser, IconColorPalette } from '@ckeditor/ckeditor5-icons';
15
15
  /**
16
16
  * One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
17
17
  *
@@ -25,6 +25,82 @@ import { icons } from '@ckeditor/ckeditor5-core';
25
25
  * * If color picker is configured, the "Color Picker" button is visible too.
26
26
  */
27
27
  export default class ColorGridsFragmentView extends View {
28
+ /**
29
+ * A collection of the children of the table.
30
+ */
31
+ items;
32
+ /**
33
+ * An array with objects representing colors to be displayed in the grid.
34
+ */
35
+ colorDefinitions;
36
+ /**
37
+ * Tracks information about the DOM focus in the list.
38
+ */
39
+ focusTracker;
40
+ /**
41
+ * The number of columns in the color grid.
42
+ */
43
+ columns;
44
+ /**
45
+ * Preserves the reference to {@link module:ui/colorselector/documentcolorcollection~DocumentColorCollection} used to collect
46
+ * definitions that store the document colors.
47
+ *
48
+ * @readonly
49
+ */
50
+ documentColors;
51
+ /**
52
+ * The maximum number of colors in the document colors section.
53
+ * If it equals 0, the document colors section is not added.
54
+ *
55
+ * @readonly
56
+ */
57
+ documentColorsCount;
58
+ /**
59
+ * Preserves the reference to {@link module:ui/colorgrid/colorgridview~ColorGridView} used to create
60
+ * the default (static) color set.
61
+ *
62
+ * The property is loaded once the the parent dropdown is opened the first time.
63
+ *
64
+ * @readonly
65
+ */
66
+ staticColorsGrid;
67
+ /**
68
+ * Preserves the reference to {@link module:ui/colorgrid/colorgridview~ColorGridView} used to create
69
+ * the document colors. It remains undefined if the document colors feature is disabled.
70
+ *
71
+ * The property is loaded once the the parent dropdown is opened the first time.
72
+ *
73
+ * @readonly
74
+ */
75
+ documentColorsGrid;
76
+ /**
77
+ * The "Color picker" button view.
78
+ */
79
+ colorPickerButtonView;
80
+ /**
81
+ * The "Remove color" button view.
82
+ */
83
+ removeColorButtonView;
84
+ /**
85
+ * A collection of views that can be focused in the view.
86
+ *
87
+ * @readonly
88
+ */
89
+ _focusables;
90
+ /**
91
+ * Document color section's label.
92
+ *
93
+ * @readonly
94
+ */
95
+ _documentColorsLabel;
96
+ /**
97
+ * The label of the button responsible for removing color attributes.
98
+ */
99
+ _removeButtonLabel;
100
+ /**
101
+ * The label of the button responsible for switching to the color picker component.
102
+ */
103
+ _colorPickerLabel;
28
104
  /**
29
105
  * Creates an instance of the view.
30
106
  *
@@ -182,7 +258,7 @@ export default class ColorGridsFragmentView extends View {
182
258
  this.colorPickerButtonView.set({
183
259
  label: this._colorPickerLabel,
184
260
  withText: true,
185
- icon: icons.colorPalette,
261
+ icon: IconColorPalette,
186
262
  class: 'ck-color-selector__color-picker'
187
263
  });
188
264
  this.colorPickerButtonView.on('execute', () => {
@@ -196,7 +272,7 @@ export default class ColorGridsFragmentView extends View {
196
272
  const buttonView = new ButtonView();
197
273
  buttonView.set({
198
274
  withText: true,
199
- icon: icons.eraser,
275
+ icon: IconEraser,
200
276
  label: this._removeButtonLabel
201
277
  });
202
278
  buttonView.class = 'ck-color-selector__remove-color';
@@ -242,7 +318,7 @@ export default class ColorGridsFragmentView extends View {
242
318
  const colorTile = new ColorTileView();
243
319
  colorTile.set({
244
320
  color: colorObj.color,
245
- hasBorder: colorObj.options && colorObj.options.hasBorder
321
+ hasBorder: colorObj.options?.hasBorder
246
322
  });
247
323
  if (colorObj.label) {
248
324
  colorTile.set({
@@ -8,7 +8,7 @@
8
8
  import View from '../view.js';
9
9
  import ButtonView from '../button/buttonview.js';
10
10
  import { default as ColorPickerView } from '../colorpicker/colorpickerview.js';
11
- import { icons } from '@ckeditor/ckeditor5-core';
11
+ import { IconCancel, IconCheck } from '@ckeditor/ckeditor5-icons';
12
12
  /**
13
13
  * One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
14
14
  *
@@ -21,6 +21,47 @@ import { icons } from '@ckeditor/ckeditor5-core';
21
21
  * * "Save" and "Cancel" action buttons.
22
22
  */
23
23
  export default class ColorPickerFragmentView extends View {
24
+ /**
25
+ * A collection of component's children.
26
+ */
27
+ items;
28
+ /**
29
+ * A view with saturation and hue sliders and color input.
30
+ */
31
+ colorPickerView;
32
+ /**
33
+ * The "Save" button view.
34
+ */
35
+ saveButtonView;
36
+ /**
37
+ * The "Cancel" button view.
38
+ */
39
+ cancelButtonView;
40
+ /**
41
+ * The action bar where are "Save" button and "Cancel" button.
42
+ */
43
+ actionBarView;
44
+ /**
45
+ * Tracks information about the DOM focus in the list.
46
+ */
47
+ focusTracker;
48
+ /**
49
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
50
+ */
51
+ keystrokes;
52
+ /**
53
+ * A collection of views that can be focused in the view.
54
+ *
55
+ * @readonly
56
+ */
57
+ _focusables;
58
+ /**
59
+ * A reference to the configuration of {@link #colorPickerView}. `false` when the view was
60
+ * configured without a color picker.
61
+ *
62
+ * @readonly
63
+ */
64
+ _colorPickerViewConfig;
24
65
  /**
25
66
  * Creates an instance of the view.
26
67
  *
@@ -168,14 +209,14 @@ export default class ColorPickerFragmentView extends View {
168
209
  const saveButtonView = new ButtonView(locale);
169
210
  const cancelButtonView = new ButtonView(locale);
170
211
  saveButtonView.set({
171
- icon: icons.check,
212
+ icon: IconCheck,
172
213
  class: 'ck-button-save',
173
214
  type: 'button',
174
215
  withText: false,
175
216
  label: t('Accept')
176
217
  });
177
218
  cancelButtonView.set({
178
- icon: icons.cancel,
219
+ icon: IconCancel,
179
220
  class: 'ck-button-cancel',
180
221
  type: 'button',
181
222
  withText: false,
@@ -61,6 +61,42 @@ import '../../theme/components/colorselector/colorselector.css';
61
61
  * ```
62
62
  */
63
63
  export default class ColorSelectorView extends View {
64
+ /**
65
+ * Tracks information about the DOM focus in the list.
66
+ */
67
+ focusTracker;
68
+ /**
69
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
70
+ */
71
+ keystrokes;
72
+ /**
73
+ * A collection of components.
74
+ */
75
+ items;
76
+ /**
77
+ * A fragment that allows users to select colors from the a predefined set and from existing document colors.
78
+ */
79
+ colorGridsFragmentView;
80
+ /**
81
+ * A fragment that allows users to select a color from a color picker.
82
+ */
83
+ colorPickerFragmentView;
84
+ /**
85
+ * Helps cycling over focusable {@link #items} in the list.
86
+ *
87
+ * @readonly
88
+ */
89
+ _focusCycler;
90
+ /**
91
+ * A collection of views that can be focused in the view.
92
+ *
93
+ * @readonly
94
+ */
95
+ _focusables;
96
+ /**
97
+ * The configuration of color picker sub-component.
98
+ */
99
+ _colorPickerViewConfig;
64
100
  /**
65
101
  * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
66
102
  *
@@ -31,16 +31,20 @@ import { CKEditorError } from '@ckeditor/ckeditor5-utils';
31
31
  * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.
32
32
  */
33
33
  export default class ComponentFactory {
34
+ /**
35
+ * The editor instance that the factory belongs to.
36
+ */
37
+ editor;
38
+ /**
39
+ * Registered component factories.
40
+ */
41
+ _components = new Map();
34
42
  /**
35
43
  * Creates an instance of the factory.
36
44
  *
37
45
  * @param editor The editor instance.
38
46
  */
39
47
  constructor(editor) {
40
- /**
41
- * Registered component factories.
42
- */
43
- this._components = new Map();
44
48
  this.editor = editor;
45
49
  }
46
50
  /**
@@ -8,6 +8,24 @@ import DialogView, { DialogViewPosition } from './dialogview.js';
8
8
  * The dialog controller class. It is used to show and hide the {@link module:ui/dialog/dialogview~DialogView}.
9
9
  */
10
10
  export default class Dialog extends Plugin {
11
+ /**
12
+ * The currently visible dialog view instance.
13
+ */
14
+ view;
15
+ /**
16
+ * The `Dialog` plugin instance which most recently showed the dialog.
17
+ *
18
+ * Only one dialog can be visible at once, even if there are many editor instances on the page.
19
+ * If an editor wants to show a dialog, it should first hide the dialog that is already opened.
20
+ * But only the `Dialog` instance that showed the dialog is able able to properly hide it.
21
+ * This is why we need to store it in a globally available space (static property).
22
+ * This way every `Dialog` plugin in every editor is able to correctly close any open dialog window.
23
+ */
24
+ static _visibleDialogPlugin;
25
+ /**
26
+ * A configurable callback called when the dialog is hidden.
27
+ */
28
+ _onHide;
11
29
  /**
12
30
  * @inheritDoc
13
31
  */
@@ -15,6 +15,26 @@ import '../../theme/components/dialog/dialogactions.css';
15
15
  * A dialog actions view class. It contains button views which are used to execute dialog actions.
16
16
  */
17
17
  export default class DialogActionsView extends View {
18
+ /**
19
+ * A collection of button views.
20
+ */
21
+ children;
22
+ /**
23
+ * A keystroke handler instance.
24
+ */
25
+ keystrokes;
26
+ /**
27
+ * A focus cycler instance.
28
+ */
29
+ focusCycler;
30
+ /**
31
+ * A focus tracker instance.
32
+ */
33
+ _focusTracker;
34
+ /**
35
+ * A collection of focusable views.
36
+ */
37
+ _focusables;
18
38
  /**
19
39
  * @inheritDoc
20
40
  */
@@ -10,6 +10,10 @@ import View from '../view.js';
10
10
  * A dialog content view class.
11
11
  */
12
12
  export default class DialogContentView extends View {
13
+ /**
14
+ * A collection of content items.
15
+ */
16
+ children;
13
17
  /**
14
18
  * @inheritDoc
15
19
  */
@@ -105,7 +105,7 @@ export default class DialogView extends /* #__PURE__ */ DialogView_base implemen
105
105
  *
106
106
  * @observable
107
107
  */
108
- position: typeof DialogViewPosition[keyof typeof DialogViewPosition];
108
+ position: typeof DialogViewPosition[keyof typeof DialogViewPosition] | null;
109
109
  /**
110
110
  * A flag indicating that the dialog should be shown. Once set to `true`, the dialog will be shown
111
111
  * after its position is calculated. Until then, the dialog is transparent and not visible.
@@ -6,7 +6,7 @@
6
6
  * @module ui/dialog/dialogview
7
7
  */
8
8
  import { KeystrokeHandler, FocusTracker, Rect, global, toUnit } from '@ckeditor/ckeditor5-utils';
9
- import { icons } from '@ckeditor/ckeditor5-core';
9
+ import { IconCancel } from '@ckeditor/ckeditor5-icons';
10
10
  import ViewCollection from '../viewcollection.js';
11
11
  import View from '../view.js';
12
12
  import FormHeaderView from '../formheader/formheaderview.js';
@@ -46,16 +46,65 @@ const toPx = /* #__PURE__ */ toUnit('px');
46
46
  * A dialog view class.
47
47
  */
48
48
  class DialogView extends /* #__PURE__ */ DraggableViewMixin(View) {
49
+ /**
50
+ * A collection of the child views inside of the dialog.
51
+ * A dialog can have 3 optional parts: header, content, and actions.
52
+ */
53
+ parts;
54
+ /**
55
+ * A header view of the dialog. It is also a drag handle of the dialog.
56
+ */
57
+ headerView;
58
+ /**
59
+ * A close button view. It is automatically added to the header view if present.
60
+ */
61
+ closeButtonView;
62
+ /**
63
+ * A view with the action buttons available to the user.
64
+ */
65
+ actionsView;
66
+ /**
67
+ * A default dialog element offset from the reference element (e.g. editor editable area).
68
+ */
69
+ static defaultOffset = 15;
70
+ /**
71
+ * A view with the dialog content.
72
+ */
73
+ contentView;
74
+ /**
75
+ * A keystroke handler instance.
76
+ */
77
+ keystrokes;
78
+ /**
79
+ * A focus tracker instance.
80
+ */
81
+ focusTracker;
82
+ /**
83
+ * A flag indicating if the dialog was moved manually. If so, its position
84
+ * will not be updated automatically upon window resize or document scroll.
85
+ */
86
+ wasMoved = false;
87
+ /**
88
+ * A callback returning the DOM root that requested the dialog.
89
+ */
90
+ _getCurrentDomRoot;
91
+ /**
92
+ * A callback returning the configured editor viewport offset.
93
+ */
94
+ _getViewportOffset;
95
+ /**
96
+ * The list of the focusable elements inside the dialog view.
97
+ */
98
+ _focusables;
99
+ /**
100
+ * The focus cycler instance.
101
+ */
102
+ _focusCycler;
49
103
  /**
50
104
  * @inheritDoc
51
105
  */
52
106
  constructor(locale, { getCurrentDomRoot, getViewportOffset, keystrokeHandlerOptions }) {
53
107
  super(locale);
54
- /**
55
- * A flag indicating if the dialog was moved manually. If so, its position
56
- * will not be updated automatically upon window resize or document scroll.
57
- */
58
- this.wasMoved = false;
59
108
  const bind = this.bindTemplate;
60
109
  const t = locale.t;
61
110
  this.set('className', '');
@@ -454,14 +503,10 @@ class DialogView extends /* #__PURE__ */ DraggableViewMixin(View) {
454
503
  buttonView.set({
455
504
  label: t('Close'),
456
505
  tooltip: true,
457
- icon: icons.cancel
506
+ icon: IconCancel
458
507
  });
459
508
  buttonView.on('execute', () => this.fire('close', { source: 'closeButton' }));
460
509
  return buttonView;
461
510
  }
462
511
  }
463
- /**
464
- * A default dialog element offset from the reference element (e.g. editor editable area).
465
- */
466
- DialogView.defaultOffset = 15;
467
512
  export default DialogView;
@@ -2,9 +2,6 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- /**
6
- * @module ui/dropdown/button/dropdownbuttonview
7
- */
8
5
  import ButtonView from '../../button/buttonview.js';
9
6
  import type DropdownButton from './dropdownbutton.js';
10
7
  import IconView from '../../icon/iconview.js';
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module ui/dropdown/button/dropdownbuttonview
7
7
  */
8
+ import { IconDropdownArrow } from '@ckeditor/ckeditor5-icons';
8
9
  import ButtonView from '../../button/buttonview.js';
9
10
  import IconView from '../../icon/iconview.js';
10
- import dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';
11
11
  /**
12
12
  * The default dropdown button view class.
13
13
  *
@@ -28,6 +28,10 @@ import dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';
28
28
  * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.
29
29
  */
30
30
  export default class DropdownButtonView extends ButtonView {
31
+ /**
32
+ * An icon that displays arrow to indicate a dropdown button.
33
+ */
34
+ arrowView;
31
35
  /**
32
36
  * @inheritDoc
33
37
  */
@@ -55,7 +59,7 @@ export default class DropdownButtonView extends ButtonView {
55
59
  */
56
60
  _createArrowView() {
57
61
  const arrowView = new IconView();
58
- arrowView.content = dropdownArrowIcon;
62
+ arrowView.content = IconDropdownArrow;
59
63
  arrowView.extendTemplate({
60
64
  attributes: {
61
65
  class: 'ck-dropdown__arrow'
@@ -2,16 +2,13 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- /**
6
- * @module ui/dropdown/button/splitbuttonview
7
- */
5
+ import { KeystrokeHandler, FocusTracker, type Locale } from '@ckeditor/ckeditor5-utils';
8
6
  import View from '../../view.js';
9
7
  import ButtonView from '../../button/buttonview.js';
10
8
  import type ViewCollection from '../../viewcollection.js';
11
9
  import type Button from '../../button/button.js';
12
10
  import type DropdownButton from './dropdownbutton.js';
13
11
  import type { FocusableView } from '../../focuscycler.js';
14
- import { KeystrokeHandler, FocusTracker, type Locale } from '@ckeditor/ckeditor5-utils';
15
12
  import '../../../theme/components/dropdown/splitbutton.css';
16
13
  /**
17
14
  * The split button view class.