@ckeditor/ckeditor5-ui 40.2.0 → 41.1.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 (282) hide show
  1. package/CHANGELOG.md +8 -8
  2. package/LICENSE.md +1 -1
  3. package/lang/contexts.json +3 -1
  4. package/lang/translations/ar.po +9 -1
  5. package/lang/translations/ast.po +9 -1
  6. package/lang/translations/az.po +9 -1
  7. package/lang/translations/bg.po +9 -1
  8. package/lang/translations/bn.po +9 -1
  9. package/lang/translations/ca.po +9 -1
  10. package/lang/translations/cs.po +9 -1
  11. package/lang/translations/da.po +9 -1
  12. package/lang/translations/de-ch.po +9 -1
  13. package/lang/translations/de.po +9 -1
  14. package/lang/translations/el.po +9 -1
  15. package/lang/translations/en-au.po +9 -1
  16. package/lang/translations/en-gb.po +9 -1
  17. package/lang/translations/en.po +9 -1
  18. package/lang/translations/eo.po +9 -1
  19. package/lang/translations/es.po +14 -6
  20. package/lang/translations/et.po +9 -1
  21. package/lang/translations/eu.po +9 -1
  22. package/lang/translations/fa.po +9 -1
  23. package/lang/translations/fi.po +9 -1
  24. package/lang/translations/fr.po +9 -1
  25. package/lang/translations/gl.po +9 -1
  26. package/lang/translations/he.po +9 -1
  27. package/lang/translations/hi.po +9 -1
  28. package/lang/translations/hr.po +9 -1
  29. package/lang/translations/hu.po +9 -1
  30. package/lang/translations/id.po +9 -1
  31. package/lang/translations/it.po +9 -1
  32. package/lang/translations/ja.po +9 -1
  33. package/lang/translations/km.po +9 -1
  34. package/lang/translations/kn.po +9 -1
  35. package/lang/translations/ko.po +9 -1
  36. package/lang/translations/ku.po +9 -1
  37. package/lang/translations/lt.po +9 -1
  38. package/lang/translations/lv.po +9 -1
  39. package/lang/translations/ms.po +9 -1
  40. package/lang/translations/nb.po +9 -1
  41. package/lang/translations/ne.po +9 -1
  42. package/lang/translations/nl.po +9 -1
  43. package/lang/translations/no.po +9 -1
  44. package/lang/translations/pl.po +9 -1
  45. package/lang/translations/pt-br.po +9 -1
  46. package/lang/translations/pt.po +9 -1
  47. package/lang/translations/ro.po +9 -1
  48. package/lang/translations/ru.po +9 -1
  49. package/lang/translations/sk.po +9 -1
  50. package/lang/translations/sl.po +9 -1
  51. package/lang/translations/sq.po +9 -1
  52. package/lang/translations/sr-latn.po +9 -1
  53. package/lang/translations/sr.po +9 -1
  54. package/lang/translations/sv.po +9 -1
  55. package/lang/translations/th.po +9 -1
  56. package/lang/translations/tk.po +9 -1
  57. package/lang/translations/tr.po +9 -1
  58. package/lang/translations/tt.po +9 -1
  59. package/lang/translations/ug.po +9 -1
  60. package/lang/translations/uk.po +9 -1
  61. package/lang/translations/ur.po +9 -1
  62. package/lang/translations/uz.po +9 -1
  63. package/lang/translations/vi.po +9 -1
  64. package/lang/translations/zh-cn.po +9 -1
  65. package/lang/translations/zh.po +9 -1
  66. package/package.json +4 -3
  67. package/src/arialiveannouncer.d.ts +14 -10
  68. package/src/arialiveannouncer.js +11 -8
  69. package/src/augmentation.d.ts +3 -2
  70. package/src/augmentation.js +1 -1
  71. package/src/autocomplete/autocompleteview.d.ts +4 -4
  72. package/src/autocomplete/autocompleteview.js +4 -3
  73. package/src/bindings/addkeyboardhandlingforgrid.d.ts +2 -2
  74. package/src/bindings/addkeyboardhandlingforgrid.js +1 -1
  75. package/src/bindings/clickoutsidehandler.d.ts +1 -1
  76. package/src/bindings/clickoutsidehandler.js +1 -1
  77. package/src/bindings/csstransitiondisablermixin.d.ts +2 -2
  78. package/src/bindings/csstransitiondisablermixin.js +1 -1
  79. package/src/bindings/draggableviewmixin.d.ts +46 -0
  80. package/src/bindings/draggableviewmixin.js +144 -0
  81. package/src/bindings/injectcsstransitiondisabler.d.ts +2 -2
  82. package/src/bindings/injectcsstransitiondisabler.js +1 -1
  83. package/src/bindings/preventdefault.d.ts +3 -3
  84. package/src/bindings/preventdefault.js +1 -1
  85. package/src/bindings/submithandler.d.ts +2 -2
  86. package/src/bindings/submithandler.js +1 -1
  87. package/src/button/button.d.ts +4 -1
  88. package/src/button/button.js +1 -1
  89. package/src/button/buttonlabel.d.ts +2 -2
  90. package/src/button/buttonlabel.js +1 -1
  91. package/src/button/buttonlabelview.d.ts +3 -3
  92. package/src/button/buttonlabelview.js +2 -2
  93. package/src/button/buttonview.d.ts +6 -6
  94. package/src/button/buttonview.js +4 -4
  95. package/src/button/switchbuttonview.d.ts +3 -3
  96. package/src/button/switchbuttonview.js +3 -3
  97. package/src/collapsible/collapsibleview.d.ts +7 -6
  98. package/src/collapsible/collapsibleview.js +3 -3
  99. package/src/colorgrid/colorgridview.d.ts +5 -5
  100. package/src/colorgrid/colorgridview.js +4 -4
  101. package/src/colorgrid/colortileview.d.ts +2 -2
  102. package/src/colorgrid/colortileview.js +2 -2
  103. package/src/colorgrid/utils.d.ts +1 -1
  104. package/src/colorgrid/utils.js +1 -1
  105. package/src/colorpicker/colorpickerview.d.ts +12 -7
  106. package/src/colorpicker/colorpickerview.js +12 -9
  107. package/src/colorpicker/utils.d.ts +6 -1
  108. package/src/colorpicker/utils.js +10 -1
  109. package/src/colorselector/colorgridsfragmentview.d.ts +9 -8
  110. package/src/colorselector/colorgridsfragmentview.js +10 -11
  111. package/src/colorselector/colorpickerfragmentview.d.ts +9 -8
  112. package/src/colorselector/colorpickerfragmentview.js +7 -8
  113. package/src/colorselector/colorselectorview.d.ts +9 -9
  114. package/src/colorselector/colorselectorview.js +6 -6
  115. package/src/colorselector/documentcolorcollection.d.ts +2 -2
  116. package/src/colorselector/documentcolorcollection.js +1 -1
  117. package/src/componentfactory.d.ts +2 -2
  118. package/src/componentfactory.js +1 -1
  119. package/src/dialog/dialog.d.ts +273 -0
  120. package/src/dialog/dialog.js +261 -0
  121. package/src/dialog/dialogactionsview.d.ts +69 -0
  122. package/src/dialog/dialogactionsview.js +98 -0
  123. package/src/dialog/dialogcontentview.d.ts +27 -0
  124. package/src/dialog/dialogcontentview.js +35 -0
  125. package/src/dialog/dialogview.d.ts +256 -0
  126. package/src/dialog/dialogview.js +466 -0
  127. package/src/dropdown/button/dropdownbutton.d.ts +3 -3
  128. package/src/dropdown/button/dropdownbutton.js +1 -1
  129. package/src/dropdown/button/dropdownbuttonview.d.ts +4 -4
  130. package/src/dropdown/button/dropdownbuttonview.js +3 -3
  131. package/src/dropdown/button/splitbuttonview.d.ts +7 -7
  132. package/src/dropdown/button/splitbuttonview.js +3 -3
  133. package/src/dropdown/dropdownpanelfocusable.d.ts +1 -1
  134. package/src/dropdown/dropdownpanelfocusable.js +1 -1
  135. package/src/dropdown/dropdownpanelview.d.ts +4 -4
  136. package/src/dropdown/dropdownpanelview.js +2 -2
  137. package/src/dropdown/dropdownview.d.ts +8 -8
  138. package/src/dropdown/dropdownview.js +5 -4
  139. package/src/dropdown/utils.d.ts +9 -9
  140. package/src/dropdown/utils.js +15 -15
  141. package/src/editableui/editableuiview.d.ts +3 -3
  142. package/src/editableui/editableuiview.js +2 -2
  143. package/src/editableui/inline/inlineeditableuiview.d.ts +4 -4
  144. package/src/editableui/inline/inlineeditableuiview.js +2 -2
  145. package/src/editorui/bodycollection.d.ts +3 -3
  146. package/src/editorui/bodycollection.js +3 -3
  147. package/src/editorui/boxed/boxededitoruiview.d.ts +3 -3
  148. package/src/editorui/boxed/boxededitoruiview.js +3 -3
  149. package/src/editorui/editorui.d.ts +7 -7
  150. package/src/editorui/editorui.js +5 -5
  151. package/src/editorui/editoruiview.d.ts +4 -4
  152. package/src/editorui/editoruiview.js +3 -3
  153. package/src/editorui/poweredby.d.ts +1 -1
  154. package/src/editorui/poweredby.js +4 -4
  155. package/src/focuscycler.d.ts +29 -10
  156. package/src/focuscycler.js +46 -17
  157. package/src/formheader/formheaderview.d.ts +4 -4
  158. package/src/formheader/formheaderview.js +3 -3
  159. package/src/highlightedtext/highlightedtextview.d.ts +2 -2
  160. package/src/highlightedtext/highlightedtextview.js +2 -2
  161. package/src/icon/iconview.d.ts +5 -2
  162. package/src/icon/iconview.js +4 -3
  163. package/src/iframe/iframeview.d.ts +2 -2
  164. package/src/iframe/iframeview.js +2 -2
  165. package/src/index.d.ts +67 -68
  166. package/src/index.js +63 -65
  167. package/src/input/inputbase.d.ts +2 -2
  168. package/src/input/inputbase.js +2 -2
  169. package/src/input/inputview.d.ts +2 -2
  170. package/src/input/inputview.js +2 -2
  171. package/src/inputnumber/inputnumberview.d.ts +2 -2
  172. package/src/inputnumber/inputnumberview.js +2 -2
  173. package/src/inputtext/inputtextview.d.ts +2 -2
  174. package/src/inputtext/inputtextview.js +2 -2
  175. package/src/label/labelview.d.ts +2 -2
  176. package/src/label/labelview.js +2 -2
  177. package/src/labeledfield/labeledfieldview.d.ts +5 -5
  178. package/src/labeledfield/labeledfieldview.js +3 -3
  179. package/src/labeledfield/utils.d.ts +14 -14
  180. package/src/labeledfield/utils.js +13 -13
  181. package/src/labeledinput/labeledinputview.d.ts +4 -4
  182. package/src/labeledinput/labeledinputview.js +3 -3
  183. package/src/list/listitemgroupview.d.ts +5 -5
  184. package/src/list/listitemgroupview.js +5 -5
  185. package/src/list/listitemview.d.ts +4 -4
  186. package/src/list/listitemview.js +2 -2
  187. package/src/list/listseparatorview.d.ts +2 -2
  188. package/src/list/listseparatorview.js +2 -2
  189. package/src/list/listview.d.ts +9 -8
  190. package/src/list/listview.js +7 -7
  191. package/src/model.d.ts +1 -1
  192. package/src/model.js +1 -1
  193. package/src/notification/notification.d.ts +1 -1
  194. package/src/notification/notification.js +1 -1
  195. package/src/panel/balloon/balloonpanelview.d.ts +4 -4
  196. package/src/panel/balloon/balloonpanelview.js +5 -4
  197. package/src/panel/balloon/contextualballoon.d.ts +5 -5
  198. package/src/panel/balloon/contextualballoon.js +7 -9
  199. package/src/panel/sticky/stickypanelview.d.ts +9 -9
  200. package/src/panel/sticky/stickypanelview.js +7 -7
  201. package/src/search/filteredview.d.ts +2 -2
  202. package/src/search/filteredview.js +1 -1
  203. package/src/search/searchinfoview.d.ts +3 -3
  204. package/src/search/searchinfoview.js +2 -2
  205. package/src/search/searchresultsview.d.ts +5 -5
  206. package/src/search/searchresultsview.js +3 -3
  207. package/src/search/text/searchtextqueryview.d.ts +5 -5
  208. package/src/search/text/searchtextqueryview.js +5 -5
  209. package/src/search/text/searchtextview.d.ts +12 -12
  210. package/src/search/text/searchtextview.js +6 -6
  211. package/src/spinner/spinnerview.d.ts +2 -2
  212. package/src/spinner/spinnerview.js +2 -2
  213. package/src/template.d.ts +3 -3
  214. package/src/template.js +3 -3
  215. package/src/textarea/textareaview.d.ts +18 -2
  216. package/src/textarea/textareaview.js +46 -6
  217. package/src/toolbar/balloon/balloontoolbar.d.ts +3 -3
  218. package/src/toolbar/balloon/balloontoolbar.js +5 -5
  219. package/src/toolbar/block/blockbuttonview.d.ts +2 -2
  220. package/src/toolbar/block/blockbuttonview.js +2 -2
  221. package/src/toolbar/block/blocktoolbar.d.ts +4 -4
  222. package/src/toolbar/block/blocktoolbar.js +6 -6
  223. package/src/toolbar/normalizetoolbarconfig.d.ts +1 -1
  224. package/src/toolbar/normalizetoolbarconfig.js +1 -1
  225. package/src/toolbar/toolbarlinebreakview.d.ts +2 -2
  226. package/src/toolbar/toolbarlinebreakview.js +2 -2
  227. package/src/toolbar/toolbarseparatorview.d.ts +2 -2
  228. package/src/toolbar/toolbarseparatorview.js +2 -2
  229. package/src/toolbar/toolbarview.d.ts +7 -6
  230. package/src/toolbar/toolbarview.js +17 -15
  231. package/src/tooltipmanager.d.ts +3 -3
  232. package/src/tooltipmanager.js +5 -4
  233. package/src/view.d.ts +3 -3
  234. package/src/view.js +3 -3
  235. package/src/viewcollection.d.ts +2 -2
  236. package/src/viewcollection.js +1 -1
  237. package/theme/components/arialiveannouncer/arialiveannouncer.css +1 -1
  238. package/theme/components/autocomplete/autocomplete.css +2 -2
  239. package/theme/components/button/button.css +1 -1
  240. package/theme/components/button/switchbutton.css +1 -1
  241. package/theme/components/collapsible/collapsible.css +1 -1
  242. package/theme/components/colorgrid/colorgrid.css +1 -1
  243. package/theme/components/colorpicker/colorpicker.css +1 -1
  244. package/theme/components/colorselector/colorselector.css +1 -1
  245. package/theme/components/dialog/dialog.css +39 -0
  246. package/theme/components/dialog/dialogactions.css +11 -0
  247. package/theme/components/dropdown/dropdown.css +3 -3
  248. package/theme/components/dropdown/listdropdown.css +1 -1
  249. package/theme/components/dropdown/splitbutton.css +1 -1
  250. package/theme/components/dropdown/toolbardropdown.css +1 -1
  251. package/theme/components/editorui/editorui.css +1 -1
  252. package/theme/components/formheader/formheader.css +1 -1
  253. package/theme/components/highlightedtext/highlightedtext.css +1 -1
  254. package/theme/components/icon/icon.css +1 -1
  255. package/theme/components/input/input.css +1 -1
  256. package/theme/components/label/label.css +1 -1
  257. package/theme/components/labeledfield/labeledfieldview.css +1 -1
  258. package/theme/components/labeledinput/labeledinput.css +1 -1
  259. package/theme/components/list/list.css +1 -1
  260. package/theme/components/panel/balloonpanel.css +2 -2
  261. package/theme/components/panel/balloonrotator.css +1 -1
  262. package/theme/components/panel/fakepanel.css +2 -2
  263. package/theme/components/panel/stickypanel.css +2 -2
  264. package/theme/components/responsive-form/responsiveform.css +1 -1
  265. package/theme/components/search/search.css +1 -1
  266. package/theme/components/spinner/spinner.css +1 -1
  267. package/theme/components/textarea/textarea.css +1 -1
  268. package/theme/components/toolbar/blocktoolbar.css +1 -1
  269. package/theme/components/toolbar/toolbar.css +1 -1
  270. package/theme/components/tooltip/tooltip.css +2 -2
  271. package/theme/globals/_hidden.css +1 -1
  272. package/theme/globals/_poweredby.css +2 -2
  273. package/theme/globals/_reset.css +1 -1
  274. package/theme/globals/_transition.css +1 -1
  275. package/theme/globals/_zindex.css +3 -2
  276. package/theme/globals/globals.css +1 -1
  277. package/theme/mixins/_dir.css +1 -1
  278. package/theme/mixins/_rwd.css +1 -1
  279. package/theme/mixins/_unselectable.css +1 -1
  280. package/theme/icons/color-palette.svg +0 -1
  281. package/theme/icons/next-arrow.svg +0 -1
  282. package/theme/icons/previous-arrow.svg +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ui",
3
- "version": "40.2.0",
3
+ "version": "41.1.0",
4
4
  "description": "The UI framework and standard UI library of CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -9,10 +9,11 @@
9
9
  "ckeditor5-lib",
10
10
  "ckeditor5-dll"
11
11
  ],
12
+ "type": "module",
12
13
  "main": "src/index.js",
13
14
  "dependencies": {
14
- "@ckeditor/ckeditor5-core": "40.2.0",
15
- "@ckeditor/ckeditor5-utils": "40.2.0",
15
+ "@ckeditor/ckeditor5-core": "41.1.0",
16
+ "@ckeditor/ckeditor5-utils": "41.1.0",
16
17
  "color-convert": "2.0.1",
17
18
  "color-parse": "1.4.2",
18
19
  "lodash-es": "4.17.21",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -7,18 +7,22 @@
7
7
  */
8
8
  import type { Editor } from '@ckeditor/ckeditor5-core';
9
9
  import type { Locale } from '@ckeditor/ckeditor5-utils';
10
- import type ViewCollection from './viewcollection';
11
- import View from './view';
10
+ import type ViewCollection from './viewcollection.js';
11
+ import View from './view.js';
12
12
  import '../theme/components/arialiveannouncer/arialiveannouncer.css';
13
13
  /**
14
14
  * The politeness level of an `aria-live` announcement.
15
15
  *
16
- * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Politeness_levels
16
+ * Available keys are:
17
+ * * `AriaLiveAnnouncerPoliteness.POLITE`,
18
+ * * `AriaLiveAnnouncerPoliteness.ASSERTIVE`
19
+ *
20
+ * [Learn more](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Politeness_levels).
17
21
  */
18
- export declare enum AriaLiveAnnouncerPoliteness {
19
- POLITE = "polite",
20
- ASSERTIVE = "assertive"
21
- }
22
+ export declare const AriaLiveAnnouncerPoliteness: {
23
+ readonly POLITE: "polite";
24
+ readonly ASSERTIVE: "assertive";
25
+ };
22
26
  /**
23
27
  * An accessibility helper that manages all ARIA live regions associated with an editor instance. ARIA live regions announce changes
24
28
  * to the state of the editor features.
@@ -62,7 +66,7 @@ export default class AriaLiveAnnouncer {
62
66
  * editor.ui.ariaLiveAnnouncer.announce( 'network', 'Connection lost. Reconnecting.' );
63
67
  * ```
64
68
  */
65
- announce(regionName: string, announcementText: string, politeness?: AriaLiveAnnouncerPoliteness): void;
69
+ announce(regionName: string, announcementText: string, politeness?: typeof AriaLiveAnnouncerPoliteness[keyof typeof AriaLiveAnnouncerPoliteness]): void;
66
70
  }
67
71
  /**
68
72
  * The view that aggregates all `aria-live` regions.
@@ -85,7 +89,7 @@ export declare class AriaLiveAnnouncerRegionView extends View {
85
89
  /**
86
90
  * Current politeness level of the region.
87
91
  */
88
- politeness: AriaLiveAnnouncerPoliteness;
92
+ politeness: typeof AriaLiveAnnouncerPoliteness[keyof typeof AriaLiveAnnouncerPoliteness];
89
93
  /**
90
94
  * A unique name of the region, usually associated with a specific editor feature or system.
91
95
  */
@@ -1,19 +1,22 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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 View from './view';
5
+ import View from './view.js';
6
6
  import '../theme/components/arialiveannouncer/arialiveannouncer.css';
7
7
  /**
8
8
  * The politeness level of an `aria-live` announcement.
9
9
  *
10
- * See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Politeness_levels
10
+ * Available keys are:
11
+ * * `AriaLiveAnnouncerPoliteness.POLITE`,
12
+ * * `AriaLiveAnnouncerPoliteness.ASSERTIVE`
13
+ *
14
+ * [Learn more](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions#Politeness_levels).
11
15
  */
12
- export var AriaLiveAnnouncerPoliteness;
13
- (function (AriaLiveAnnouncerPoliteness) {
14
- AriaLiveAnnouncerPoliteness["POLITE"] = "polite";
15
- AriaLiveAnnouncerPoliteness["ASSERTIVE"] = "assertive";
16
- })(AriaLiveAnnouncerPoliteness || (AriaLiveAnnouncerPoliteness = {}));
16
+ export const AriaLiveAnnouncerPoliteness = {
17
+ POLITE: 'polite',
18
+ ASSERTIVE: 'assertive'
19
+ };
17
20
  /**
18
21
  * An accessibility helper that manages all ARIA live regions associated with an editor instance. ARIA live regions announce changes
19
22
  * to the state of the editor features.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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 type { BalloonToolbar, BlockToolbar, ContextualBalloon, Notification } from './index';
5
+ import type { BalloonToolbar, BlockToolbar, ContextualBalloon, Notification, Dialog } from './index.js';
6
6
  import type { ToolbarConfig } from '@ckeditor/ckeditor5-core';
7
7
  declare module '@ckeditor/ckeditor5-core' {
8
8
  interface EditorConfig {
@@ -81,6 +81,7 @@ declare module '@ckeditor/ckeditor5-core' {
81
81
  [BalloonToolbar.pluginName]: BalloonToolbar;
82
82
  [BlockToolbar.pluginName]: BlockToolbar;
83
83
  [ContextualBalloon.pluginName]: ContextualBalloon;
84
+ [Dialog.pluginName]: Dialog;
84
85
  [Notification.pluginName]: Notification;
85
86
  }
86
87
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  export {};
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/autocomplete/autocompleteview
7
7
  */
8
8
  import { type PositioningFunction, type Locale } from '@ckeditor/ckeditor5-utils';
9
- import SearchTextView, { type SearchTextViewConfig } from '../search/text/searchtextview';
10
- import type SearchResultsView from '../search/searchresultsview';
11
- import type InputBase from '../input/inputbase';
9
+ import SearchTextView, { type SearchTextViewConfig } from '../search/text/searchtextview.js';
10
+ import type SearchResultsView from '../search/searchresultsview.js';
11
+ import type InputBase from '../input/inputbase.js';
12
12
  import '../../theme/components/autocomplete/autocomplete.css';
13
13
  /**
14
14
  * The autocomplete component's view class. It extends the {@link module:ui/search/text/searchtextview~SearchTextView} class
@@ -1,19 +1,19 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/autocomplete/autocompleteview
7
7
  */
8
8
  import { getOptimalPosition, global, toUnit, Rect } from '@ckeditor/ckeditor5-utils';
9
- import SearchTextView from '../search/text/searchtextview';
9
+ import SearchTextView from '../search/text/searchtextview.js';
10
10
  import '../../theme/components/autocomplete/autocomplete.css';
11
11
  /**
12
12
  * The autocomplete component's view class. It extends the {@link module:ui/search/text/searchtextview~SearchTextView} class
13
13
  * with a floating {@link #resultsView} that shows up when the user starts typing and hides when they blur
14
14
  * the component.
15
15
  */
16
- export default class AutocompleteView extends SearchTextView {
16
+ class AutocompleteView extends SearchTextView {
17
17
  /**
18
18
  * @inheritDoc
19
19
  */
@@ -151,3 +151,4 @@ AutocompleteView.defaultResultsPositions = [
151
151
  * A function used to calculate the optimal position for the dropdown panel.
152
152
  */
153
153
  AutocompleteView._getOptimalPosition = getOptimalPosition;
154
+ export default AutocompleteView;
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/bindings/addkeyboardhandlingforgrid
7
7
  */
8
8
  import type { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
9
- import type ViewCollection from '../viewcollection';
9
+ import type ViewCollection from '../viewcollection.js';
10
10
  /**
11
11
  * A helper that adds a keyboard navigation support (arrow up/down/left/right) for grids.
12
12
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /* global document */
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/bindings/csstransitiondisablermixin
7
7
  */
8
8
  import type { Constructor, Mixed } from '@ckeditor/ckeditor5-utils';
9
- import type View from '../view';
9
+ import type View from '../view.js';
10
10
  /**
11
11
  * A mixin that brings the possibility to temporarily disable CSS transitions using
12
12
  * {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -0,0 +1,46 @@
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/bindings/draggableviewmixin
7
+ */
8
+ import type View from '../view.js';
9
+ import { type Constructor, type Mixed } from '@ckeditor/ckeditor5-utils';
10
+ /**
11
+ * A mixin that brings the possibility to observe dragging of the view element.
12
+ * The view has to implement the {@link ~DraggableView} interface to use it:
13
+ *
14
+ * ```js
15
+ * export default class MyDraggableView extends DraggableViewMixin( View ) implements DraggableView {
16
+ * // ...
17
+ * }
18
+ * ```
19
+ *
20
+ * Creating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:
21
+ * * `mousedown` and `touchstart` on the view element - starting the dragging.
22
+ * * `mousemove` and `touchmove` on the document - updating the view coordinates.
23
+ * * `mouseup` and `touchend` on the document - stopping the dragging.
24
+ *
25
+ * The mixin itself does not provide a visual feedback (that is, the dragged element does not change its position) -
26
+ * it is up to the developer to implement it.
27
+ */
28
+ export default function DraggableViewMixin<Base extends Constructor<View>>(view: Base): Mixed<Base, DraggableView>;
29
+ /**
30
+ * An interface that should be implemented by views that want to be draggable.
31
+ */
32
+ export interface DraggableView extends View {
33
+ get dragHandleElement(): HTMLElement | null;
34
+ }
35
+ /**
36
+ * An event data object for the {@link ~DraggableView} `drag` event. Fired when the view is dragged.
37
+ */
38
+ export type DraggableViewDragEvent = {
39
+ name: 'drag';
40
+ args: [
41
+ {
42
+ deltaX: number;
43
+ deltaY: number;
44
+ }
45
+ ];
46
+ };
@@ -0,0 +1,144 @@
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 { global } from '@ckeditor/ckeditor5-utils';
6
+ /**
7
+ * A mixin that brings the possibility to observe dragging of the view element.
8
+ * The view has to implement the {@link ~DraggableView} interface to use it:
9
+ *
10
+ * ```js
11
+ * export default class MyDraggableView extends DraggableViewMixin( View ) implements DraggableView {
12
+ * // ...
13
+ * }
14
+ * ```
15
+ *
16
+ * Creating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:
17
+ * * `mousedown` and `touchstart` on the view element - starting the dragging.
18
+ * * `mousemove` and `touchmove` on the document - updating the view coordinates.
19
+ * * `mouseup` and `touchend` on the document - stopping the dragging.
20
+ *
21
+ * The mixin itself does not provide a visual feedback (that is, the dragged element does not change its position) -
22
+ * it is up to the developer to implement it.
23
+ */
24
+ export default function DraggableViewMixin(view) {
25
+ class DraggableMixin extends view {
26
+ /**
27
+ * @inheritdoc
28
+ */
29
+ constructor(...args) {
30
+ super(...args);
31
+ /**
32
+ * A bound version of {@link #_onDrag}.
33
+ */
34
+ this._onDragBound = this._onDrag.bind(this);
35
+ /**
36
+ * A bound version of {@link #_onDragEnd}.
37
+ */
38
+ this._onDragEndBound = this._onDragEnd.bind(this);
39
+ /**
40
+ * The last coordinates of the view. It is updated on every mouse move.
41
+ */
42
+ this._lastDraggingCoordinates = { x: 0, y: 0 };
43
+ this.on('render', () => {
44
+ this._attachListeners();
45
+ });
46
+ this.set('isDragging', false);
47
+ }
48
+ /**
49
+ * Attaches the listeners for the drag start.
50
+ */
51
+ _attachListeners() {
52
+ this.listenTo(this.element, 'mousedown', this._onDragStart.bind(this));
53
+ this.listenTo(this.element, 'touchstart', this._onDragStart.bind(this));
54
+ }
55
+ /**
56
+ * Attaches the listeners for the dragging and drag end.
57
+ */
58
+ _attachDragListeners() {
59
+ this.listenTo(global.document, 'mouseup', this._onDragEndBound);
60
+ this.listenTo(global.document, 'touchend', this._onDragEndBound);
61
+ this.listenTo(global.document, 'mousemove', this._onDragBound);
62
+ this.listenTo(global.document, 'touchmove', this._onDragBound);
63
+ }
64
+ /**
65
+ * Detaches the listeners after the drag end.
66
+ */
67
+ _detachDragListeners() {
68
+ this.stopListening(global.document, 'mouseup', this._onDragEndBound);
69
+ this.stopListening(global.document, 'touchend', this._onDragEndBound);
70
+ this.stopListening(global.document, 'mousemove', this._onDragBound);
71
+ this.stopListening(global.document, 'touchmove', this._onDragBound);
72
+ }
73
+ /**
74
+ * Starts the dragging listeners and sets the initial view coordinates.
75
+ */
76
+ _onDragStart(evt, domEvt) {
77
+ if (!this._isHandleElementPressed(domEvt)) {
78
+ return;
79
+ }
80
+ this._attachDragListeners();
81
+ let x = 0;
82
+ let y = 0;
83
+ // If dragging is performed with a mouse, there is only one set of coordinates available.
84
+ // But when using a touch device, there may be many of them, so use the coordinates from the first touch.
85
+ if (domEvt instanceof MouseEvent) {
86
+ x = domEvt.clientX;
87
+ y = domEvt.clientY;
88
+ }
89
+ else {
90
+ x = domEvt.touches[0].clientX;
91
+ y = domEvt.touches[0].clientY;
92
+ }
93
+ this._lastDraggingCoordinates = { x, y };
94
+ this.isDragging = true;
95
+ }
96
+ /**
97
+ * Updates the view coordinates and fires the `drag` event.
98
+ */
99
+ _onDrag(evt, domEvt) {
100
+ // If dragging was stopped by some external intervention, stop listening.
101
+ if (!this.isDragging) {
102
+ this._detachDragListeners();
103
+ return;
104
+ }
105
+ let newX = 0;
106
+ let newY = 0;
107
+ // If dragging is performed with a mouse, there is only one set of coordinates available.
108
+ // But when using a touch device, there may be many of them, so use the coordinates from the first touch.
109
+ if (domEvt instanceof MouseEvent) {
110
+ newX = domEvt.clientX;
111
+ newY = domEvt.clientY;
112
+ }
113
+ else {
114
+ newX = domEvt.touches[0].clientX;
115
+ newY = domEvt.touches[0].clientY;
116
+ }
117
+ // Prevents selection of text while dragging on Safari.
118
+ domEvt.preventDefault();
119
+ this.fire('drag', {
120
+ deltaX: Math.round(newX - this._lastDraggingCoordinates.x),
121
+ deltaY: Math.round(newY - this._lastDraggingCoordinates.y)
122
+ });
123
+ this._lastDraggingCoordinates = { x: newX, y: newY };
124
+ }
125
+ /**
126
+ * Stops the dragging and detaches the listeners.
127
+ */
128
+ _onDragEnd() {
129
+ this._detachDragListeners();
130
+ this.isDragging = false;
131
+ }
132
+ /**
133
+ * Checks if the drag handle element was pressed.
134
+ */
135
+ _isHandleElementPressed(domEvt) {
136
+ if (!this.dragHandleElement) {
137
+ return false;
138
+ }
139
+ return this.dragHandleElement === domEvt.target ||
140
+ (domEvt.target instanceof HTMLElement && this.dragHandleElement.contains(domEvt.target));
141
+ }
142
+ }
143
+ return DraggableMixin;
144
+ }
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/bindings/injectcsstransitiondisabler
7
7
  */
8
- import type View from '../view';
8
+ import type View from '../view.js';
9
9
  /**
10
10
  * A decorator that brings the possibility to temporarily disable CSS transitions using
11
11
  * {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/bindings/preventdefault
7
7
  */
8
- import type { ListenerBinding } from '../template';
9
- import type View from '../view';
8
+ import type { ListenerBinding } from '../template.js';
9
+ import type View from '../view.js';
10
10
  /**
11
11
  * A helper which executes a native `Event.preventDefault()` if the target of an event equals the
12
12
  * {@link module:ui/view~View#element element of the view}. It shortens the definition of a
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/bindings/submithandler
7
7
  */
8
- import type View from '../view';
8
+ import type View from '../view.js';
9
9
  /**
10
10
  * A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM
11
11
  * `submit` event, prevents the default web browser behavior (navigation and page reload) and
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
@@ -118,6 +118,9 @@ export default interface Button {
118
118
  * (Optional) An XML {@link module:ui/icon/iconview~IconView#content content} of the icon.
119
119
  * When defined, an `iconView` should be added to the button.
120
120
  *
121
+ * The user must provide the entire XML string, not just the path. See the
122
+ * {@glink framework/architecture/ui-library#setting-label-icon-and-tooltip UI library} guide for details.
123
+ *
121
124
  * @observable
122
125
  */
123
126
  icon: string | undefined;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  export {};
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/button/buttonlabel
7
7
  */
8
- import type View from '../view';
8
+ import type View from '../view.js';
9
9
  /**
10
10
  * The button label interface. Implemented by the {@link module:ui/button/buttonlabelview~ButtonLabelView}
11
11
  * and any label view that can be used with the {@link module:ui/button/buttonview~ButtonView}.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  export {};
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/button/buttonlabelview
7
7
  */
8
- import View from '../view';
9
- import type ButtonLabel from './buttonlabel';
8
+ import View from '../view.js';
9
+ import type ButtonLabel from './buttonlabel.js';
10
10
  /**
11
11
  * A default implementation of the button view's label. It comes with a dynamic text support
12
12
  * via {@link module:ui/button/buttonlabelview~ButtonLabelView#text} property.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/button/buttonlabelview
7
7
  */
8
- import View from '../view';
8
+ import View from '../view.js';
9
9
  /**
10
10
  * A default implementation of the button view's label. It comes with a dynamic text support
11
11
  * via {@link module:ui/button/buttonlabelview~ButtonLabelView#text} property.
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/button/buttonview
7
7
  */
8
- import View from '../view';
9
- import IconView from '../icon/iconview';
10
- import type ViewCollection from '../viewcollection';
11
- import type { default as Button } from './button';
12
- import type ButtonLabel from './buttonlabel';
8
+ import View from '../view.js';
9
+ import IconView from '../icon/iconview.js';
10
+ import type ViewCollection from '../viewcollection.js';
11
+ import type { default as Button } from './button.js';
12
+ import type ButtonLabel from './buttonlabel.js';
13
13
  import { type Locale } from '@ckeditor/ckeditor5-utils';
14
14
  import '../../theme/components/button/button.css';
15
15
  /**
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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
5
  /**
6
6
  * @module ui/button/buttonview
7
7
  */
8
- import View from '../view';
9
- import IconView from '../icon/iconview';
10
- import ButtonLabelView from './buttonlabelview';
8
+ import View from '../view.js';
9
+ import IconView from '../icon/iconview.js';
10
+ import ButtonLabelView from './buttonlabelview.js';
11
11
  import { env, getEnvKeystrokeText, uid, delay } from '@ckeditor/ckeditor5-utils';
12
12
  import '../../theme/components/button/button.css';
13
13
  /**