@ckeditor/ckeditor5-ui 43.0.0 → 43.1.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 (274) hide show
  1. package/dist/bindings/clickoutsidehandler.d.ts +5 -3
  2. package/dist/dropdown/dropdownview.d.ts +21 -8
  3. package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +48 -0
  4. package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +40 -0
  5. package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +21 -0
  6. package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +26 -0
  7. package/dist/dropdown/menu/dropdownmenulistview.d.ts +28 -0
  8. package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +38 -0
  9. package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +135 -0
  10. package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +144 -0
  11. package/dist/dropdown/menu/utils.d.ts +128 -0
  12. package/dist/dropdown/utils.d.ts +58 -0
  13. package/dist/editableui/editableuiview.d.ts +1 -1
  14. package/dist/editableui/inline/inlineeditableuiview.d.ts +13 -9
  15. package/dist/editorui/editorui.d.ts +4 -0
  16. package/dist/index-editor.css +16 -0
  17. package/dist/index.css +31 -0
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.ts +7 -1
  20. package/dist/index.js +4717 -3869
  21. package/dist/index.js.map +1 -1
  22. package/dist/menubar/utils.d.ts +5 -5
  23. package/dist/panel/balloon/contextualballoon.d.ts +12 -6
  24. package/dist/toolbar/balloon/balloontoolbar.d.ts +5 -0
  25. package/dist/translations/af.js +1 -1
  26. package/dist/translations/af.umd.js +1 -1
  27. package/dist/translations/ar.js +1 -1
  28. package/dist/translations/ar.umd.js +1 -1
  29. package/dist/translations/ast.js +1 -1
  30. package/dist/translations/ast.umd.js +1 -1
  31. package/dist/translations/az.js +1 -1
  32. package/dist/translations/az.umd.js +1 -1
  33. package/dist/translations/bg.js +1 -1
  34. package/dist/translations/bg.umd.js +1 -1
  35. package/dist/translations/bn.js +1 -1
  36. package/dist/translations/bn.umd.js +1 -1
  37. package/dist/translations/bs.js +1 -1
  38. package/dist/translations/bs.umd.js +1 -1
  39. package/dist/translations/ca.js +1 -1
  40. package/dist/translations/ca.umd.js +1 -1
  41. package/dist/translations/cs.js +1 -1
  42. package/dist/translations/cs.umd.js +1 -1
  43. package/dist/translations/da.js +1 -1
  44. package/dist/translations/da.umd.js +1 -1
  45. package/dist/translations/de-ch.js +1 -1
  46. package/dist/translations/de-ch.umd.js +1 -1
  47. package/dist/translations/de.js +1 -1
  48. package/dist/translations/de.umd.js +1 -1
  49. package/dist/translations/el.js +1 -1
  50. package/dist/translations/el.umd.js +1 -1
  51. package/dist/translations/en-au.js +1 -1
  52. package/dist/translations/en-au.umd.js +1 -1
  53. package/dist/translations/en-gb.js +1 -1
  54. package/dist/translations/en-gb.umd.js +1 -1
  55. package/dist/translations/en.js +1 -1
  56. package/dist/translations/en.umd.js +1 -1
  57. package/dist/translations/eo.js +1 -1
  58. package/dist/translations/eo.umd.js +1 -1
  59. package/dist/translations/es-co.js +1 -1
  60. package/dist/translations/es-co.umd.js +1 -1
  61. package/dist/translations/es.js +1 -1
  62. package/dist/translations/es.umd.js +1 -1
  63. package/dist/translations/et.js +1 -1
  64. package/dist/translations/et.umd.js +1 -1
  65. package/dist/translations/eu.js +1 -1
  66. package/dist/translations/eu.umd.js +1 -1
  67. package/dist/translations/fa.js +1 -1
  68. package/dist/translations/fa.umd.js +1 -1
  69. package/dist/translations/fi.js +1 -1
  70. package/dist/translations/fi.umd.js +1 -1
  71. package/dist/translations/fr.js +1 -1
  72. package/dist/translations/fr.umd.js +1 -1
  73. package/dist/translations/gl.js +1 -1
  74. package/dist/translations/gl.umd.js +1 -1
  75. package/dist/translations/he.js +1 -1
  76. package/dist/translations/he.umd.js +1 -1
  77. package/dist/translations/hi.js +1 -1
  78. package/dist/translations/hi.umd.js +1 -1
  79. package/dist/translations/hr.js +1 -1
  80. package/dist/translations/hr.umd.js +1 -1
  81. package/dist/translations/hu.js +1 -1
  82. package/dist/translations/hu.umd.js +1 -1
  83. package/dist/translations/id.js +1 -1
  84. package/dist/translations/id.umd.js +1 -1
  85. package/dist/translations/it.js +1 -1
  86. package/dist/translations/it.umd.js +1 -1
  87. package/dist/translations/ja.js +1 -1
  88. package/dist/translations/ja.umd.js +1 -1
  89. package/dist/translations/jv.js +1 -1
  90. package/dist/translations/jv.umd.js +1 -1
  91. package/dist/translations/km.js +1 -1
  92. package/dist/translations/km.umd.js +1 -1
  93. package/dist/translations/kn.js +1 -1
  94. package/dist/translations/kn.umd.js +1 -1
  95. package/dist/translations/ko.js +1 -1
  96. package/dist/translations/ko.umd.js +1 -1
  97. package/dist/translations/ku.js +1 -1
  98. package/dist/translations/ku.umd.js +1 -1
  99. package/dist/translations/lt.js +1 -1
  100. package/dist/translations/lt.umd.js +1 -1
  101. package/dist/translations/lv.js +1 -1
  102. package/dist/translations/lv.umd.js +1 -1
  103. package/dist/translations/ms.js +1 -1
  104. package/dist/translations/ms.umd.js +1 -1
  105. package/dist/translations/nb.js +1 -1
  106. package/dist/translations/nb.umd.js +1 -1
  107. package/dist/translations/ne.js +1 -1
  108. package/dist/translations/ne.umd.js +1 -1
  109. package/dist/translations/nl.js +1 -1
  110. package/dist/translations/nl.umd.js +1 -1
  111. package/dist/translations/no.js +1 -1
  112. package/dist/translations/no.umd.js +1 -1
  113. package/dist/translations/pl.js +1 -1
  114. package/dist/translations/pl.umd.js +1 -1
  115. package/dist/translations/pt-br.js +1 -1
  116. package/dist/translations/pt-br.umd.js +1 -1
  117. package/dist/translations/pt.js +1 -1
  118. package/dist/translations/pt.umd.js +1 -1
  119. package/dist/translations/ro.js +1 -1
  120. package/dist/translations/ro.umd.js +1 -1
  121. package/dist/translations/ru.js +1 -1
  122. package/dist/translations/ru.umd.js +1 -1
  123. package/dist/translations/sk.js +1 -1
  124. package/dist/translations/sk.umd.js +1 -1
  125. package/dist/translations/sl.js +1 -1
  126. package/dist/translations/sl.umd.js +1 -1
  127. package/dist/translations/sq.js +1 -1
  128. package/dist/translations/sq.umd.js +1 -1
  129. package/dist/translations/sr-latn.js +1 -1
  130. package/dist/translations/sr-latn.umd.js +1 -1
  131. package/dist/translations/sr.js +1 -1
  132. package/dist/translations/sr.umd.js +1 -1
  133. package/dist/translations/sv.js +1 -1
  134. package/dist/translations/sv.umd.js +1 -1
  135. package/dist/translations/th.js +1 -1
  136. package/dist/translations/th.umd.js +1 -1
  137. package/dist/translations/ti.js +1 -1
  138. package/dist/translations/ti.umd.js +1 -1
  139. package/dist/translations/tk.js +1 -1
  140. package/dist/translations/tk.umd.js +1 -1
  141. package/dist/translations/tr.js +1 -1
  142. package/dist/translations/tr.umd.js +1 -1
  143. package/dist/translations/tt.js +1 -1
  144. package/dist/translations/tt.umd.js +1 -1
  145. package/dist/translations/ug.js +1 -1
  146. package/dist/translations/ug.umd.js +1 -1
  147. package/dist/translations/uk.js +1 -1
  148. package/dist/translations/uk.umd.js +1 -1
  149. package/dist/translations/ur.js +1 -1
  150. package/dist/translations/ur.umd.js +1 -1
  151. package/dist/translations/uz.js +1 -1
  152. package/dist/translations/uz.umd.js +1 -1
  153. package/dist/translations/vi.js +1 -1
  154. package/dist/translations/vi.umd.js +1 -1
  155. package/dist/translations/zh-cn.js +1 -1
  156. package/dist/translations/zh-cn.umd.js +1 -1
  157. package/dist/translations/zh.js +1 -1
  158. package/dist/translations/zh.umd.js +1 -1
  159. package/lang/contexts.json +1 -1
  160. package/lang/translations/af.po +4 -4
  161. package/lang/translations/ar.po +4 -4
  162. package/lang/translations/ast.po +4 -4
  163. package/lang/translations/az.po +4 -4
  164. package/lang/translations/bg.po +4 -4
  165. package/lang/translations/bn.po +4 -4
  166. package/lang/translations/bs.po +4 -4
  167. package/lang/translations/ca.po +4 -4
  168. package/lang/translations/cs.po +4 -4
  169. package/lang/translations/da.po +4 -4
  170. package/lang/translations/de-ch.po +4 -4
  171. package/lang/translations/de.po +4 -4
  172. package/lang/translations/el.po +4 -4
  173. package/lang/translations/en-au.po +4 -4
  174. package/lang/translations/en-gb.po +4 -4
  175. package/lang/translations/en.po +4 -4
  176. package/lang/translations/eo.po +4 -4
  177. package/lang/translations/es-co.po +4 -4
  178. package/lang/translations/es.po +4 -4
  179. package/lang/translations/et.po +4 -4
  180. package/lang/translations/eu.po +4 -4
  181. package/lang/translations/fa.po +4 -4
  182. package/lang/translations/fi.po +4 -4
  183. package/lang/translations/fr.po +4 -4
  184. package/lang/translations/gl.po +4 -4
  185. package/lang/translations/he.po +4 -4
  186. package/lang/translations/hi.po +4 -4
  187. package/lang/translations/hr.po +4 -4
  188. package/lang/translations/hu.po +4 -4
  189. package/lang/translations/id.po +4 -4
  190. package/lang/translations/it.po +4 -4
  191. package/lang/translations/ja.po +4 -4
  192. package/lang/translations/jv.po +4 -4
  193. package/lang/translations/km.po +4 -4
  194. package/lang/translations/kn.po +4 -4
  195. package/lang/translations/ko.po +4 -4
  196. package/lang/translations/ku.po +4 -4
  197. package/lang/translations/lt.po +4 -4
  198. package/lang/translations/lv.po +4 -4
  199. package/lang/translations/ms.po +4 -4
  200. package/lang/translations/nb.po +4 -4
  201. package/lang/translations/ne.po +4 -4
  202. package/lang/translations/nl.po +4 -4
  203. package/lang/translations/no.po +4 -4
  204. package/lang/translations/pl.po +4 -4
  205. package/lang/translations/pt-br.po +4 -4
  206. package/lang/translations/pt.po +4 -4
  207. package/lang/translations/ro.po +4 -4
  208. package/lang/translations/ru.po +4 -4
  209. package/lang/translations/sk.po +4 -4
  210. package/lang/translations/sl.po +4 -4
  211. package/lang/translations/sq.po +4 -4
  212. package/lang/translations/sr-latn.po +4 -4
  213. package/lang/translations/sr.po +4 -4
  214. package/lang/translations/sv.po +4 -4
  215. package/lang/translations/th.po +4 -4
  216. package/lang/translations/ti.po +4 -4
  217. package/lang/translations/tk.po +4 -4
  218. package/lang/translations/tr.po +4 -4
  219. package/lang/translations/tt.po +4 -4
  220. package/lang/translations/ug.po +4 -4
  221. package/lang/translations/uk.po +4 -4
  222. package/lang/translations/ur.po +4 -4
  223. package/lang/translations/uz.po +4 -4
  224. package/lang/translations/vi.po +4 -4
  225. package/lang/translations/zh-cn.po +4 -4
  226. package/lang/translations/zh.po +4 -4
  227. package/package.json +4 -3
  228. package/src/bindings/clickoutsidehandler.d.ts +5 -3
  229. package/src/bindings/clickoutsidehandler.js +3 -2
  230. package/src/dialog/dialog.js +0 -1
  231. package/src/dropdown/dropdownview.d.ts +21 -8
  232. package/src/dropdown/menu/dropdownmenubehaviors.d.ts +44 -0
  233. package/src/dropdown/menu/dropdownmenubehaviors.js +119 -0
  234. package/src/dropdown/menu/dropdownmenubuttonview.d.ts +36 -0
  235. package/src/dropdown/menu/dropdownmenubuttonview.js +65 -0
  236. package/src/dropdown/menu/dropdownmenulistitembuttonview.d.ts +17 -0
  237. package/src/dropdown/menu/dropdownmenulistitembuttonview.js +29 -0
  238. package/src/dropdown/menu/dropdownmenulistitemview.d.ts +22 -0
  239. package/src/dropdown/menu/dropdownmenulistitemview.js +34 -0
  240. package/src/dropdown/menu/dropdownmenulistview.d.ts +24 -0
  241. package/src/dropdown/menu/dropdownmenulistview.js +29 -0
  242. package/src/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +34 -0
  243. package/src/dropdown/menu/dropdownmenunestedmenupanelview.js +63 -0
  244. package/src/dropdown/menu/dropdownmenunestedmenuview.d.ts +131 -0
  245. package/src/dropdown/menu/dropdownmenunestedmenuview.js +191 -0
  246. package/src/dropdown/menu/dropdownmenurootlistview.d.ts +140 -0
  247. package/src/dropdown/menu/dropdownmenurootlistview.js +160 -0
  248. package/src/dropdown/menu/utils.d.ts +124 -0
  249. package/src/dropdown/menu/utils.js +61 -0
  250. package/src/dropdown/utils.d.ts +58 -0
  251. package/src/dropdown/utils.js +101 -18
  252. package/src/editableui/editableuiview.d.ts +1 -1
  253. package/src/editableui/inline/inlineeditableuiview.d.ts +13 -9
  254. package/src/editableui/inline/inlineeditableuiview.js +29 -6
  255. package/src/editorui/accessibilityhelp/accessibilityhelp.js +3 -1
  256. package/src/editorui/editorui.d.ts +4 -0
  257. package/src/editorui/editorui.js +16 -1
  258. package/src/editorui/poweredby.js +0 -1
  259. package/src/index.d.ts +7 -1
  260. package/src/index.js +6 -0
  261. package/src/menubar/menubarmenuview.js +1 -0
  262. package/src/menubar/utils.d.ts +5 -5
  263. package/src/menubar/utils.js +21 -12
  264. package/src/panel/balloon/balloonpanelview.js +19 -12
  265. package/src/panel/balloon/contextualballoon.d.ts +12 -6
  266. package/src/panel/balloon/contextualballoon.js +24 -24
  267. package/src/toolbar/balloon/balloontoolbar.d.ts +5 -0
  268. package/src/toolbar/balloon/balloontoolbar.js +26 -5
  269. package/src/toolbar/block/blocktoolbar.js +0 -2
  270. package/theme/components/dropdown/menu/dropdownmenu.css +8 -0
  271. package/theme/components/dropdown/menu/dropdownmenubutton.css +9 -0
  272. package/theme/components/dropdown/menu/dropdownmenulistitem.css +10 -0
  273. package/theme/components/dropdown/menu/dropdownmenulistitembutton.css +10 -0
  274. package/theme/components/dropdown/menu/dropdownmenupanel.css +11 -0
@@ -0,0 +1,128 @@
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
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
+ */
9
+ /**
10
+ * @module ui/dropdown/menu/utils
11
+ */
12
+ import type { PositioningFunction } from '@ckeditor/ckeditor5-utils';
13
+ /**
14
+ * Contains every positioning function used by {@link module:ui/dropdown/menu/dropdownmenunestedmenuview~DropdownMenuNestedMenuView} that
15
+ * decides where the {@link module:ui/dropdown/menu/dropdownmenunestedmenuview~DropdownMenuNestedMenuView#panelView} should be placed.
16
+ *
17
+ * Positioning functions:
18
+ *
19
+ * ┌──────┬───────────────┐
20
+ * │ │ │
21
+ * └──────┤ │
22
+ * │ │
23
+ * │ ES │
24
+ * └───────────────┘
25
+ *
26
+ * ┌───────────────┬──────┐
27
+ * │ │ │
28
+ * │ ├──────┘
29
+ * │ │
30
+ * │ WS │
31
+ * └───────────────┘
32
+ *
33
+ * ┌───────────────┐
34
+ * │ EN │
35
+ * │ │
36
+ * ┌──────┤ │
37
+ * │ │ │
38
+ * └──────┴───────────────┘
39
+ *
40
+ * ┌───────────────┐
41
+ * │ WN │
42
+ * │ │
43
+ * │ ├──────┐
44
+ * │ │ │
45
+ * └───────────────┴──────┘
46
+ */
47
+ export declare const DropdownMenuPanelPositioningFunctions: Record<string, PositioningFunction>;
48
+ /**
49
+ * Represents the definition of a dropdown menu.
50
+ */
51
+ export type DropdownNestedMenuDefinition = {
52
+ /**
53
+ * Unique ID for the menu.
54
+ */
55
+ id: string;
56
+ /**
57
+ * The menu name. It is used as a label for the button which opens the menu list.
58
+ */
59
+ menu: string;
60
+ /**
61
+ * The children of the dropdown menu.
62
+ */
63
+ children: DropdownMenuDefinition;
64
+ };
65
+ /**
66
+ * Represents the definition of a dropdown menu item.
67
+ */
68
+ export type DropdownMenuButtonDefinition = {
69
+ /**
70
+ * Unique ID for the button.
71
+ */
72
+ id: string;
73
+ /**
74
+ * The label for the button.
75
+ */
76
+ label: string;
77
+ };
78
+ /**
79
+ * A definition for a nestable menu component.
80
+ *
81
+ * The menu can be flat and include only top-level items, or it can include multiple levels of nested sub-menus.
82
+ *
83
+ * Example:
84
+ *
85
+ * ```ts
86
+ * [
87
+ * {
88
+ * id: 'menu_1',
89
+ * menu: 'Menu 1',
90
+ * children: [
91
+ * {
92
+ * id: 'menu_1_1',
93
+ * menu: 'Nested menu 1',
94
+ * children: [
95
+ * {
96
+ * id: 'item_x',
97
+ * label: 'Item X'
98
+ * }
99
+ * ]
100
+ * },
101
+ * {
102
+ * id: 'menu_1_2',
103
+ * menu: 'Nested menu 2',
104
+ * children: [
105
+ * {
106
+ * id: 'item_y',
107
+ * label: 'Item Y'
108
+ * },
109
+ * {
110
+ * id: 'item_z',
111
+ * label: 'Item Z'
112
+ * }
113
+ * ]
114
+ * }
115
+ * ]
116
+ * },
117
+ * {
118
+ * id: 'top_a',
119
+ * label: 'Top Item A'
120
+ * },
121
+ * {
122
+ * id: 'top_b',
123
+ * label: 'Top Item B'
124
+ * }
125
+ * ];
126
+ * ```
127
+ */
128
+ export type DropdownMenuDefinition = Array<DropdownNestedMenuDefinition | DropdownMenuButtonDefinition>;
@@ -13,9 +13,11 @@ import type Model from '../model.js';
13
13
  import type DropdownButton from './button/dropdownbutton.js';
14
14
  import type { FocusableView } from '../focuscycler.js';
15
15
  import type { FalsyValue } from '../template.js';
16
+ import type BodyCollection from '../editorui/bodycollection.js';
16
17
  import { type Collection, type Locale } from '@ckeditor/ckeditor5-utils';
17
18
  import '../../theme/components/dropdown/toolbardropdown.css';
18
19
  import '../../theme/components/dropdown/listdropdown.css';
20
+ import type { DropdownMenuDefinition } from './menu/utils.js';
19
21
  /**
20
22
  * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},
21
23
  * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},
@@ -81,10 +83,66 @@ import '../../theme/components/dropdown/listdropdown.css';
81
83
  *
82
84
  * @param locale The locale instance.
83
85
  * @param ButtonClassOrInstance The dropdown button view class. Needs to implement the
86
+ * @param behaviorOptions Attributes for the default behavior of the dropdown.
87
+ *
84
88
  * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.
85
89
  * @returns The dropdown view instance.
86
90
  */
87
91
  export declare function createDropdown(locale: Locale | undefined, ButtonClassOrInstance?: (new (locale?: Locale) => DropdownButton & FocusableView) | (DropdownButton & FocusableView)): DropdownView;
92
+ /**
93
+ * Adds a menu UI component to a dropdown and sets all common behaviors and interactions between the dropdown and the menu.
94
+ *
95
+ * Use this helper to create multi-level dropdown menus that are displayed in a toolbar.
96
+ *
97
+ * Internally, it creates an instance of {@link module:ui/dropdown/menu/dropdownmenurootlistview~DropdownMenuRootListView}.
98
+ *
99
+ * Example:
100
+ *
101
+ * ```ts
102
+ * const definitions = [
103
+ * {
104
+ * id: 'menu_1',
105
+ * menu: 'Menu 1',
106
+ * children: [
107
+ * {
108
+ * id: 'menu_1_a',
109
+ * label: 'Item A'
110
+ * },
111
+ * {
112
+ * id: 'menu_1_b',
113
+ * label: 'Item B'
114
+ * }
115
+ * ]
116
+ * },
117
+ * {
118
+ * id: 'top_a',
119
+ * label: 'Top Item A'
120
+ * },
121
+ * {
122
+ * id: 'top_b',
123
+ * label: 'Top Item B'
124
+ * }
125
+ * ];
126
+ *
127
+ * const dropdownView = createDropdown( editor.locale );
128
+ *
129
+ * addMenuToDropdown( dropdownView, editor.ui.view.body, definitions );
130
+ * ```
131
+ *
132
+ * After using this helper, the `dropdown` will fire {@link module:ui/dropdown/dropdownview~DropdownViewEvent `execute`} event when
133
+ * a nested menu button is pressed.
134
+ *
135
+ * The helper will make sure that the `dropdownMenuRootListView` is lazy loaded, i.e., the menu component structure will be initialized
136
+ * and rendered only after the `dropdown` is opened for the first time.
137
+ *
138
+ * @param dropdownView A dropdown instance to which the menu component will be added.
139
+ * @param body Body collection to which floating menu panels will be added.
140
+ * @param definition The menu component definition.
141
+ * @param options.ariaLabel Label used by assistive technologies to describe the top-level menu.
142
+ */
143
+ export declare function addMenuToDropdown(dropdownView: DropdownView, body: BodyCollection, definition: DropdownMenuDefinition, options?: {
144
+ ariaLabel?: string;
145
+ }): void;
88
146
  /**
89
147
  * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.
90
148
  *
@@ -38,7 +38,7 @@ export default class EditableUIView extends View {
38
38
  /**
39
39
  * The element which is the main editable element (usually the one with `contentEditable="true"`).
40
40
  */
41
- private _editableElement;
41
+ protected _editableElement: HTMLElement | null | undefined;
42
42
  /**
43
43
  * Whether an external {@link #_editableElement} was passed into the constructor, which also means
44
44
  * the view will not render its {@link #template}.
@@ -17,10 +17,9 @@ import type { Locale } from '@ckeditor/ckeditor5-utils';
17
17
  */
18
18
  export default class InlineEditableUIView extends EditableUIView {
19
19
  /**
20
- * A function that gets called with the instance of this view as an argument and should return a string that
21
- * represents the label of the editable for assistive technologies.
20
+ * The cached options object passed to the constructor.
22
21
  */
23
- private readonly _generateLabel;
22
+ private readonly _options;
24
23
  /**
25
24
  * Creates an instance of the InlineEditableUIView class.
26
25
  *
@@ -30,15 +29,20 @@ export default class InlineEditableUIView extends EditableUIView {
30
29
  * {@link module:ui/editableui/editableuiview~EditableUIView}
31
30
  * will create it. Otherwise, the existing element will be used.
32
31
  * @param options Additional configuration of the view.
33
- * @param options.label A function that gets called with the instance of this view as an argument
34
- * and should return a string that represents the label of the editable for assistive technologies. If not provided,
35
- * a default label generator is used.
32
+ * @param options.label The label of the editable for assistive technologies. If not provided, a default label is used or,
33
+ * the existing `aria-label` attribute value from the specified `editableElement` is preserved.
36
34
  */
37
- constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement, options?: {
38
- label?: (view: InlineEditableUIView) => string;
39
- });
35
+ constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement, options?: InlineEditableUIViewOptions);
40
36
  /**
41
37
  * @inheritDoc
42
38
  */
43
39
  render(): void;
40
+ /**
41
+ * Returns a normalized label for the editable view based on the environment.
42
+ */
43
+ getEditableAriaLabel(): string;
44
44
  }
45
+ type InlineEditableUIViewOptions = {
46
+ label?: ((view: InlineEditableUIView) => string) | string | Record<string, string>;
47
+ };
48
+ export {};
@@ -286,6 +286,10 @@ export default abstract class EditorUI extends /* #__PURE__ */ EditorUI_base {
286
286
  * @param data The payload carried by the `scrollToTheSelection` event.
287
287
  */
288
288
  private _handleScrollToTheSelection;
289
+ /**
290
+ * Ensures that the focus tracker is aware of all views' DOM elements in the body collection.
291
+ */
292
+ private _bindBodyCollectionWithFocusTracker;
289
293
  }
290
294
  /**
291
295
  * Fired when the editor UI is ready.
@@ -352,6 +352,22 @@ a.ck.ck-button{
352
352
  z-index:calc(var(--ck-z-default) + 1);
353
353
  }
354
354
 
355
+ .ck.ck-dropdown-menu-list__nested-menu__button > .ck-dropdown-menu-list__nested-menu__button__arrow{
356
+ pointer-events:none;
357
+ z-index:var(--ck-z-default);
358
+ }
359
+
360
+ .ck.ck-dropdown-menu__nested-menu__panel{
361
+ position:absolute;
362
+ max-height:314px;
363
+ overflow-y:auto;
364
+ z-index:calc(var(--ck-z-panel) + 1);
365
+ }
366
+
367
+ .ck.ck-dropdown-menu-list__nested-menu{
368
+ display:block;
369
+ }
370
+
355
371
  .ck.ck-aria-live-announcer{
356
372
  position:absolute;
357
373
  left:-10000px;
package/dist/index.css CHANGED
@@ -489,6 +489,37 @@ a.ck.ck-button {
489
489
  z-index: calc(var(--ck-z-default) + 1);
490
490
  }
491
491
 
492
+ /*
493
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
494
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
495
+ */
496
+
497
+ .ck.ck-dropdown-menu-list__nested-menu__button > .ck-dropdown-menu-list__nested-menu__button__arrow {
498
+ pointer-events: none;
499
+ z-index: var(--ck-z-default);
500
+ }
501
+
502
+ /*
503
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
504
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
505
+ */
506
+
507
+ .ck.ck-dropdown-menu__nested-menu__panel {
508
+ position: absolute;
509
+ max-height: 314px; /* With the default settings, this is equal to 10 menu items. */
510
+ overflow-y: auto;
511
+ z-index: calc(var(--ck-z-panel) + 1);
512
+ }
513
+
514
+ /*
515
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
516
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
517
+ */
518
+
519
+ .ck.ck-dropdown-menu-list__nested-menu {
520
+ display: block;
521
+ }
522
+
492
523
  /*
493
524
  * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
494
525
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license