@ckeditor/ckeditor5-ui 41.3.0-alpha.4 → 41.3.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 (324) hide show
  1. package/ckeditor5-metadata.json +1 -1
  2. package/lang/contexts.json +12 -2
  3. package/lang/translations/af.po +210 -0
  4. package/lang/translations/ar.po +44 -4
  5. package/lang/translations/ast.po +44 -4
  6. package/lang/translations/az.po +44 -4
  7. package/lang/translations/bg.po +44 -4
  8. package/lang/translations/bn.po +44 -4
  9. package/lang/translations/bs.po +210 -0
  10. package/lang/translations/ca.po +44 -4
  11. package/lang/translations/cs.po +44 -4
  12. package/lang/translations/da.po +44 -4
  13. package/lang/translations/de-ch.po +44 -4
  14. package/lang/translations/de.po +44 -4
  15. package/lang/translations/el.po +44 -4
  16. package/lang/translations/en-au.po +44 -4
  17. package/lang/translations/en-gb.po +44 -4
  18. package/lang/translations/en.po +44 -4
  19. package/lang/translations/eo.po +44 -4
  20. package/lang/translations/es-co.po +210 -0
  21. package/lang/translations/es.po +44 -4
  22. package/lang/translations/et.po +44 -4
  23. package/lang/translations/eu.po +44 -4
  24. package/lang/translations/fa.po +44 -4
  25. package/lang/translations/fi.po +44 -4
  26. package/lang/translations/fr.po +44 -4
  27. package/lang/translations/gl.po +44 -4
  28. package/lang/translations/he.po +44 -4
  29. package/lang/translations/hi.po +44 -4
  30. package/lang/translations/hr.po +44 -4
  31. package/lang/translations/hu.po +44 -4
  32. package/lang/translations/id.po +44 -4
  33. package/lang/translations/it.po +44 -4
  34. package/lang/translations/ja.po +44 -4
  35. package/lang/translations/jv.po +210 -0
  36. package/lang/translations/km.po +44 -4
  37. package/lang/translations/kn.po +44 -4
  38. package/lang/translations/ko.po +44 -4
  39. package/lang/translations/ku.po +44 -4
  40. package/lang/translations/lt.po +44 -4
  41. package/lang/translations/lv.po +44 -4
  42. package/lang/translations/ms.po +44 -4
  43. package/lang/translations/nb.po +44 -4
  44. package/lang/translations/ne.po +44 -4
  45. package/lang/translations/nl.po +44 -4
  46. package/lang/translations/no.po +44 -4
  47. package/lang/translations/pl.po +44 -4
  48. package/lang/translations/pt-br.po +44 -4
  49. package/lang/translations/pt.po +44 -4
  50. package/lang/translations/ro.po +44 -4
  51. package/lang/translations/ru.po +44 -4
  52. package/lang/translations/sk.po +44 -4
  53. package/lang/translations/sl.po +44 -4
  54. package/lang/translations/sq.po +44 -4
  55. package/lang/translations/sr-latn.po +44 -4
  56. package/lang/translations/sr.po +44 -4
  57. package/lang/translations/sv.po +44 -4
  58. package/lang/translations/th.po +44 -4
  59. package/lang/translations/tk.po +44 -4
  60. package/lang/translations/tr.po +44 -4
  61. package/lang/translations/tt.po +44 -4
  62. package/lang/translations/ug.po +44 -4
  63. package/lang/translations/uk.po +44 -4
  64. package/lang/translations/ur.po +44 -4
  65. package/lang/translations/uz.po +44 -4
  66. package/lang/translations/vi.po +44 -4
  67. package/lang/translations/zh-cn.po +44 -4
  68. package/lang/translations/zh.po +44 -4
  69. package/package.json +3 -4
  70. package/src/button/button.d.ts +6 -0
  71. package/src/button/buttonview.d.ts +4 -0
  72. package/src/button/buttonview.js +1 -0
  73. package/src/button/filedialogbuttonview.d.ts +80 -0
  74. package/src/button/filedialogbuttonview.js +103 -0
  75. package/src/dropdown/utils.js +1 -5
  76. package/src/editorui/accessibilityhelp/accessibilityhelp.d.ts +4 -0
  77. package/src/editorui/accessibilityhelp/accessibilityhelp.js +25 -9
  78. package/src/index.d.ts +12 -3
  79. package/src/index.js +10 -2
  80. package/src/menubar/menubarmenubuttonview.d.ts +35 -0
  81. package/src/menubar/menubarmenubuttonview.js +64 -0
  82. package/src/menubar/menubarmenulistitembuttonview.d.ts +21 -0
  83. package/src/menubar/menubarmenulistitembuttonview.js +30 -0
  84. package/src/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +23 -0
  85. package/src/menubar/menubarmenulistitemfiledialogbuttonview.js +32 -0
  86. package/src/menubar/menubarmenulistitemview.d.ts +25 -0
  87. package/src/menubar/menubarmenulistitemview.js +34 -0
  88. package/src/menubar/menubarmenulistview.d.ts +24 -0
  89. package/src/menubar/menubarmenulistview.js +23 -0
  90. package/src/menubar/menubarmenupanelview.d.ts +53 -0
  91. package/src/menubar/menubarmenupanelview.js +60 -0
  92. package/src/menubar/menubarmenuview.d.ts +109 -0
  93. package/src/menubar/menubarmenuview.js +159 -0
  94. package/src/menubar/menubarview.d.ts +164 -0
  95. package/src/menubar/menubarview.js +254 -0
  96. package/src/menubar/utils.d.ts +432 -0
  97. package/src/menubar/utils.js +1320 -0
  98. package/src/toolbar/toolbarview.js +5 -3
  99. package/src/tooltipmanager.d.ts +11 -0
  100. package/src/tooltipmanager.js +37 -6
  101. package/theme/components/menubar/menubar.css +10 -0
  102. package/theme/components/menubar/menubarmenu.css +9 -0
  103. package/theme/components/menubar/menubarmenubutton.css +11 -0
  104. package/theme/components/menubar/menubarmenulistitem.css +10 -0
  105. package/theme/components/menubar/menubarmenulistitembutton.css +10 -0
  106. package/theme/components/menubar/menubarmenupanel.css +62 -0
  107. package/theme/components/tooltip/tooltip.css +0 -3
  108. package/theme/globals/_reset.css +13 -0
  109. package/theme/globals/globals.css +1 -0
  110. package/dist/content-index.css +0 -4
  111. package/dist/editor-index.css +0 -445
  112. package/dist/index.css +0 -844
  113. package/dist/index.css.map +0 -1
  114. package/dist/translations/ar.d.ts +0 -8
  115. package/dist/translations/ar.js +0 -5
  116. package/dist/translations/ast.d.ts +0 -8
  117. package/dist/translations/ast.js +0 -5
  118. package/dist/translations/az.d.ts +0 -8
  119. package/dist/translations/az.js +0 -5
  120. package/dist/translations/bg.d.ts +0 -8
  121. package/dist/translations/bg.js +0 -5
  122. package/dist/translations/bn.d.ts +0 -8
  123. package/dist/translations/bn.js +0 -5
  124. package/dist/translations/ca.d.ts +0 -8
  125. package/dist/translations/ca.js +0 -5
  126. package/dist/translations/cs.d.ts +0 -8
  127. package/dist/translations/cs.js +0 -5
  128. package/dist/translations/da.d.ts +0 -8
  129. package/dist/translations/da.js +0 -5
  130. package/dist/translations/de-ch.d.ts +0 -8
  131. package/dist/translations/de-ch.js +0 -5
  132. package/dist/translations/de.d.ts +0 -8
  133. package/dist/translations/de.js +0 -5
  134. package/dist/translations/el.d.ts +0 -8
  135. package/dist/translations/el.js +0 -5
  136. package/dist/translations/en-au.d.ts +0 -8
  137. package/dist/translations/en-au.js +0 -5
  138. package/dist/translations/en-gb.d.ts +0 -8
  139. package/dist/translations/en-gb.js +0 -5
  140. package/dist/translations/en.d.ts +0 -8
  141. package/dist/translations/en.js +0 -5
  142. package/dist/translations/eo.d.ts +0 -8
  143. package/dist/translations/eo.js +0 -5
  144. package/dist/translations/es.d.ts +0 -8
  145. package/dist/translations/es.js +0 -5
  146. package/dist/translations/et.d.ts +0 -8
  147. package/dist/translations/et.js +0 -5
  148. package/dist/translations/eu.d.ts +0 -8
  149. package/dist/translations/eu.js +0 -5
  150. package/dist/translations/fa.d.ts +0 -8
  151. package/dist/translations/fa.js +0 -5
  152. package/dist/translations/fi.d.ts +0 -8
  153. package/dist/translations/fi.js +0 -5
  154. package/dist/translations/fr.d.ts +0 -8
  155. package/dist/translations/fr.js +0 -5
  156. package/dist/translations/gl.d.ts +0 -8
  157. package/dist/translations/gl.js +0 -5
  158. package/dist/translations/he.d.ts +0 -8
  159. package/dist/translations/he.js +0 -5
  160. package/dist/translations/hi.d.ts +0 -8
  161. package/dist/translations/hi.js +0 -5
  162. package/dist/translations/hr.d.ts +0 -8
  163. package/dist/translations/hr.js +0 -5
  164. package/dist/translations/hu.d.ts +0 -8
  165. package/dist/translations/hu.js +0 -5
  166. package/dist/translations/id.d.ts +0 -8
  167. package/dist/translations/id.js +0 -5
  168. package/dist/translations/it.d.ts +0 -8
  169. package/dist/translations/it.js +0 -5
  170. package/dist/translations/ja.d.ts +0 -8
  171. package/dist/translations/ja.js +0 -5
  172. package/dist/translations/km.d.ts +0 -8
  173. package/dist/translations/km.js +0 -5
  174. package/dist/translations/kn.d.ts +0 -8
  175. package/dist/translations/kn.js +0 -5
  176. package/dist/translations/ko.d.ts +0 -8
  177. package/dist/translations/ko.js +0 -5
  178. package/dist/translations/ku.d.ts +0 -8
  179. package/dist/translations/ku.js +0 -5
  180. package/dist/translations/lt.d.ts +0 -8
  181. package/dist/translations/lt.js +0 -5
  182. package/dist/translations/lv.d.ts +0 -8
  183. package/dist/translations/lv.js +0 -5
  184. package/dist/translations/ms.d.ts +0 -8
  185. package/dist/translations/ms.js +0 -5
  186. package/dist/translations/nb.d.ts +0 -8
  187. package/dist/translations/nb.js +0 -5
  188. package/dist/translations/ne.d.ts +0 -8
  189. package/dist/translations/ne.js +0 -5
  190. package/dist/translations/nl.d.ts +0 -8
  191. package/dist/translations/nl.js +0 -5
  192. package/dist/translations/no.d.ts +0 -8
  193. package/dist/translations/no.js +0 -5
  194. package/dist/translations/pl.d.ts +0 -8
  195. package/dist/translations/pl.js +0 -5
  196. package/dist/translations/pt-br.d.ts +0 -8
  197. package/dist/translations/pt-br.js +0 -5
  198. package/dist/translations/pt.d.ts +0 -8
  199. package/dist/translations/pt.js +0 -5
  200. package/dist/translations/ro.d.ts +0 -8
  201. package/dist/translations/ro.js +0 -5
  202. package/dist/translations/ru.d.ts +0 -8
  203. package/dist/translations/ru.js +0 -5
  204. package/dist/translations/sk.d.ts +0 -8
  205. package/dist/translations/sk.js +0 -5
  206. package/dist/translations/sl.d.ts +0 -8
  207. package/dist/translations/sl.js +0 -5
  208. package/dist/translations/sq.d.ts +0 -8
  209. package/dist/translations/sq.js +0 -5
  210. package/dist/translations/sr-latn.d.ts +0 -8
  211. package/dist/translations/sr-latn.js +0 -5
  212. package/dist/translations/sr.d.ts +0 -8
  213. package/dist/translations/sr.js +0 -5
  214. package/dist/translations/sv.d.ts +0 -8
  215. package/dist/translations/sv.js +0 -5
  216. package/dist/translations/th.d.ts +0 -8
  217. package/dist/translations/th.js +0 -5
  218. package/dist/translations/tk.d.ts +0 -8
  219. package/dist/translations/tk.js +0 -5
  220. package/dist/translations/tr.d.ts +0 -8
  221. package/dist/translations/tr.js +0 -5
  222. package/dist/translations/tt.d.ts +0 -8
  223. package/dist/translations/tt.js +0 -5
  224. package/dist/translations/ug.d.ts +0 -8
  225. package/dist/translations/ug.js +0 -5
  226. package/dist/translations/uk.d.ts +0 -8
  227. package/dist/translations/uk.js +0 -5
  228. package/dist/translations/ur.d.ts +0 -8
  229. package/dist/translations/ur.js +0 -5
  230. package/dist/translations/uz.d.ts +0 -8
  231. package/dist/translations/uz.js +0 -5
  232. package/dist/translations/vi.d.ts +0 -8
  233. package/dist/translations/vi.js +0 -5
  234. package/dist/translations/zh-cn.d.ts +0 -8
  235. package/dist/translations/zh-cn.js +0 -5
  236. package/dist/translations/zh.d.ts +0 -8
  237. package/dist/translations/zh.js +0 -5
  238. package/dist/types/arialiveannouncer.d.ts +0 -102
  239. package/dist/types/augmentation.d.ts +0 -92
  240. package/dist/types/autocomplete/autocompleteview.d.ts +0 -85
  241. package/dist/types/bindings/addkeyboardhandlingforgrid.d.ts +0 -31
  242. package/dist/types/bindings/clickoutsidehandler.d.ts +0 -32
  243. package/dist/types/bindings/csstransitiondisablermixin.d.ts +0 -44
  244. package/dist/types/bindings/draggableviewmixin.d.ts +0 -50
  245. package/dist/types/bindings/injectcsstransitiondisabler.d.ts +0 -63
  246. package/dist/types/bindings/preventdefault.d.ts +0 -37
  247. package/dist/types/bindings/submithandler.d.ts +0 -61
  248. package/dist/types/button/button.d.ts +0 -179
  249. package/dist/types/button/buttonlabel.d.ts +0 -38
  250. package/dist/types/button/buttonlabelview.d.ts +0 -35
  251. package/dist/types/button/buttonview.d.ts +0 -185
  252. package/dist/types/button/switchbuttonview.d.ts +0 -49
  253. package/dist/types/collapsible/collapsibleview.d.ts +0 -74
  254. package/dist/types/colorgrid/colorgridview.d.ts +0 -136
  255. package/dist/types/colorgrid/colortileview.d.ts +0 -32
  256. package/dist/types/colorgrid/utils.d.ts +0 -51
  257. package/dist/types/colorpicker/colorpickerview.d.ts +0 -146
  258. package/dist/types/colorpicker/utils.d.ts +0 -52
  259. package/dist/types/colorselector/colorgridsfragmentview.d.ts +0 -199
  260. package/dist/types/colorselector/colorpickerfragmentview.d.ts +0 -133
  261. package/dist/types/colorselector/colorselectorview.d.ts +0 -246
  262. package/dist/types/colorselector/documentcolorcollection.d.ts +0 -74
  263. package/dist/types/componentfactory.d.ts +0 -85
  264. package/dist/types/dialog/dialog.d.ts +0 -277
  265. package/dist/types/dialog/dialogactionsview.d.ts +0 -73
  266. package/dist/types/dialog/dialogcontentview.d.ts +0 -31
  267. package/dist/types/dialog/dialogview.d.ts +0 -260
  268. package/dist/types/dropdown/button/dropdownbutton.d.ts +0 -29
  269. package/dist/types/dropdown/button/dropdownbuttonview.d.ts +0 -52
  270. package/dist/types/dropdown/button/splitbuttonview.d.ts +0 -166
  271. package/dist/types/dropdown/dropdownpanelfocusable.d.ts +0 -25
  272. package/dist/types/dropdown/dropdownpanelview.d.ts +0 -66
  273. package/dist/types/dropdown/dropdownview.d.ts +0 -319
  274. package/dist/types/dropdown/utils.d.ts +0 -239
  275. package/dist/types/editableui/editableuiview.d.ts +0 -76
  276. package/dist/types/editableui/inline/inlineeditableuiview.d.ts +0 -44
  277. package/dist/types/editorui/accessibilityhelp/accessibilityhelp.d.ts +0 -51
  278. package/dist/types/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +0 -39
  279. package/dist/types/editorui/bodycollection.d.ts +0 -59
  280. package/dist/types/editorui/boxed/boxededitoruiview.d.ts +0 -44
  281. package/dist/types/editorui/editorui.d.ts +0 -292
  282. package/dist/types/editorui/editoruiview.d.ts +0 -43
  283. package/dist/types/editorui/poweredby.d.ts +0 -75
  284. package/dist/types/focuscycler.d.ts +0 -249
  285. package/dist/types/formheader/formheaderview.d.ts +0 -63
  286. package/dist/types/highlightedtext/highlightedtextview.d.ts +0 -42
  287. package/dist/types/icon/iconview.d.ts +0 -92
  288. package/dist/types/iframe/iframeview.d.ts +0 -54
  289. package/dist/types/index.d.ts +0 -78
  290. package/dist/types/input/inputbase.d.ts +0 -123
  291. package/dist/types/input/inputview.d.ts +0 -40
  292. package/dist/types/inputnumber/inputnumberview.d.ts +0 -53
  293. package/dist/types/inputtext/inputtextview.d.ts +0 -22
  294. package/dist/types/label/labelview.d.ts +0 -40
  295. package/dist/types/labeledfield/labeledfieldview.d.ts +0 -191
  296. package/dist/types/labeledfield/utils.d.ts +0 -127
  297. package/dist/types/labeledinput/labeledinputview.d.ts +0 -129
  298. package/dist/types/list/listitemgroupview.d.ts +0 -63
  299. package/dist/types/list/listitemview.d.ts +0 -40
  300. package/dist/types/list/listseparatorview.d.ts +0 -22
  301. package/dist/types/list/listview.d.ts +0 -128
  302. package/dist/types/model.d.ts +0 -26
  303. package/dist/types/notification/notification.d.ts +0 -215
  304. package/dist/types/panel/balloon/balloonpanelview.d.ts +0 -689
  305. package/dist/types/panel/balloon/contextualballoon.d.ts +0 -303
  306. package/dist/types/panel/sticky/stickypanelview.d.ts +0 -160
  307. package/dist/types/search/filteredview.d.ts +0 -35
  308. package/dist/types/search/searchinfoview.d.ts +0 -49
  309. package/dist/types/search/searchresultsview.d.ts +0 -58
  310. package/dist/types/search/text/searchtextqueryview.d.ts +0 -80
  311. package/dist/types/search/text/searchtextview.d.ts +0 -223
  312. package/dist/types/spinner/spinnerview.d.ts +0 -29
  313. package/dist/types/template.d.ts +0 -946
  314. package/dist/types/textarea/textareaview.d.ts +0 -108
  315. package/dist/types/toolbar/balloon/balloontoolbar.d.ts +0 -121
  316. package/dist/types/toolbar/block/blockbuttonview.d.ts +0 -39
  317. package/dist/types/toolbar/block/blocktoolbar.d.ts +0 -157
  318. package/dist/types/toolbar/normalizetoolbarconfig.d.ts +0 -44
  319. package/dist/types/toolbar/toolbarlinebreakview.d.ts +0 -22
  320. package/dist/types/toolbar/toolbarseparatorview.d.ts +0 -22
  321. package/dist/types/toolbar/toolbarview.d.ts +0 -271
  322. package/dist/types/tooltipmanager.d.ts +0 -188
  323. package/dist/types/view.d.ts +0 -426
  324. package/dist/types/viewcollection.d.ts +0 -143
@@ -1,52 +0,0 @@
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
- * Color formats handled by color converter.
11
- */
12
- export type ColorPickerOutputFormat = 'hex' | 'rgb' | 'hsl' | 'hwb' | 'lab' | 'lch';
13
- /**
14
- * Configuration of the color picker feature.
15
- *
16
- * It can be forced to apply colors in the editor in a particular format.
17
- *
18
- * @default `{
19
- * format: 'hsl'
20
- * }`
21
- */
22
- export type ColorPickerConfig = {
23
- format?: ColorPickerOutputFormat;
24
- };
25
- /**
26
- * Configuration of the color picker view.
27
- *
28
- * It can be used to enforce a particular color format or hide the color input.
29
- */
30
- export type ColorPickerViewConfig = ColorPickerConfig & {
31
- hideInput?: boolean;
32
- };
33
- /**
34
- * Parses and converts the color string to requested format. Handles variety of color spaces
35
- * like `hsl`, `hex` or `rgb`.
36
- *
37
- * @param color
38
- * @returns A color string.
39
- */
40
- export declare function convertColor(color: string, outputFormat: ColorPickerOutputFormat): string;
41
- /**
42
- * Converts a color string to hex format.
43
- *
44
- * @param color
45
- * @returns A color string.
46
- */
47
- export declare function convertToHex(color: string): string;
48
- /**
49
- * Registers the custom element in the
50
- * [CustomElementsRegistry](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry).
51
- */
52
- export declare function registerCustomElement(elementName: string, constructor: CustomElementConstructor): void;
@@ -1,199 +0,0 @@
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/colorselector/colorgridsfragmentview
11
- */
12
- import View from '../view.js';
13
- import ButtonView from '../button/buttonview.js';
14
- import ColorGridView, { type ColorDefinition } from '../colorgrid/colorgridview.js';
15
- import DocumentColorCollection from './documentcolorcollection.js';
16
- import type { Model } from '@ckeditor/ckeditor5-engine';
17
- import type { FocusTracker, Locale } from '@ckeditor/ckeditor5-utils';
18
- import type ViewCollection from '../viewcollection.js';
19
- import type { FocusableView } from '../focuscycler.js';
20
- /**
21
- * One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
22
- *
23
- * It provides a UI that allows users to select colors from the a predefined set and from existing document colors.
24
- *
25
- * It consists of the following sub–components:
26
- *
27
- * * A "Remove color" button,
28
- * * A static {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors defined in the configuration,
29
- * * A dynamic {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors used in the document.
30
- * * If color picker is configured, the "Color Picker" button is visible too.
31
- */
32
- export default class ColorGridsFragmentView extends View {
33
- /**
34
- * A collection of the children of the table.
35
- */
36
- readonly items: ViewCollection;
37
- /**
38
- * An array with objects representing colors to be displayed in the grid.
39
- */
40
- colorDefinitions: Array<ColorDefinition>;
41
- /**
42
- * Tracks information about the DOM focus in the list.
43
- */
44
- readonly focusTracker: FocusTracker;
45
- /**
46
- * The number of columns in the color grid.
47
- */
48
- columns: number;
49
- /**
50
- * Preserves the reference to {@link module:ui/colorselector/documentcolorcollection~DocumentColorCollection} used to collect
51
- * definitions that store the document colors.
52
- *
53
- * @readonly
54
- */
55
- documentColors: DocumentColorCollection;
56
- /**
57
- * The maximum number of colors in the document colors section.
58
- * If it equals 0, the document colors section is not added.
59
- *
60
- * @readonly
61
- */
62
- documentColorsCount?: number;
63
- /**
64
- * Keeps the value of the command associated with the table for the current selection.
65
- */
66
- selectedColor: string;
67
- /**
68
- * Preserves the reference to {@link module:ui/colorgrid/colorgridview~ColorGridView} used to create
69
- * the default (static) color set.
70
- *
71
- * The property is loaded once the the parent dropdown is opened the first time.
72
- *
73
- * @readonly
74
- */
75
- staticColorsGrid: ColorGridView | undefined;
76
- /**
77
- * Preserves the reference to {@link module:ui/colorgrid/colorgridview~ColorGridView} used to create
78
- * the document colors. It remains undefined if the document colors feature is disabled.
79
- *
80
- * The property is loaded once the the parent dropdown is opened the first time.
81
- *
82
- * @readonly
83
- */
84
- documentColorsGrid: ColorGridView | undefined;
85
- /**
86
- * The "Color picker" button view.
87
- */
88
- colorPickerButtonView?: ButtonView;
89
- /**
90
- * The "Remove color" button view.
91
- */
92
- removeColorButtonView: ButtonView;
93
- /**
94
- * The property which is responsible for is component visible or not.
95
- */
96
- isVisible: boolean;
97
- /**
98
- * A collection of views that can be focused in the view.
99
- *
100
- * @readonly
101
- */
102
- protected _focusables: ViewCollection<FocusableView>;
103
- /**
104
- * Document color section's label.
105
- *
106
- * @readonly
107
- */
108
- private _documentColorsLabel?;
109
- /**
110
- * The label of the button responsible for removing color attributes.
111
- */
112
- private _removeButtonLabel;
113
- /**
114
- * The label of the button responsible for switching to the color picker component.
115
- */
116
- private _colorPickerLabel;
117
- /**
118
- * Creates an instance of the view.
119
- *
120
- * @param locale The localization services instance.
121
- * @param colors An array with definitions of colors to be displayed in the table.
122
- * @param columns The number of columns in the color grid.
123
- * @param removeButtonLabel The label of the button responsible for removing the color.
124
- * @param colorPickerLabel The label of the button responsible for color picker appearing.
125
- * @param documentColorsLabel The label for the section with the document colors.
126
- * @param documentColorsCount The number of colors in the document colors section inside the color dropdown.
127
- * @param focusTracker Tracks information about the DOM focus in the list.
128
- * @param focusables A collection of views that can be focused in the view.
129
- */
130
- constructor(locale: Locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, focusTracker, focusables }: {
131
- colors: Array<ColorDefinition>;
132
- columns: number;
133
- removeButtonLabel: string;
134
- colorPickerLabel: string;
135
- documentColorsLabel?: string;
136
- documentColorsCount?: number;
137
- focusTracker: FocusTracker;
138
- focusables: ViewCollection<FocusableView>;
139
- });
140
- /**
141
- * Scans through the editor model and searches for text node attributes with the given attribute name.
142
- * Found entries are set as document colors.
143
- *
144
- * All the previously stored document colors will be lost in the process.
145
- *
146
- * @param model The model used as a source to obtain the document colors.
147
- * @param attributeName Determines the name of the related model's attribute for a given dropdown.
148
- */
149
- updateDocumentColors(model: Model, attributeName: string): void;
150
- /**
151
- * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgridview~ColorGridView}s
152
- * available in the {@link module:ui/colorselector/colorselectorview~ColorSelectorView}. It guarantees that the selection will
153
- * occur only in one of them.
154
- */
155
- updateSelectedColors(): void;
156
- /**
157
- * @inheritDoc
158
- */
159
- render(): void;
160
- /**
161
- * Focuses the component.
162
- */
163
- focus(): void;
164
- /**
165
- * @inheritDoc
166
- */
167
- destroy(): void;
168
- /**
169
- * Handles displaying the color picker button (if it was previously created) and making it focusable.
170
- */
171
- addColorPickerButton(): void;
172
- /**
173
- * Adds color selector elements to focus tracker.
174
- */
175
- private _addColorSelectorElementsToFocusTracker;
176
- /**
177
- * Creates the button responsible for displaying the color picker component.
178
- */
179
- private _createColorPickerButton;
180
- /**
181
- * Adds the remove color button as a child of the current view.
182
- */
183
- private _createRemoveColorButton;
184
- /**
185
- * Creates a static color grid based on the editor configuration.
186
- */
187
- private _createStaticColorsGrid;
188
- /**
189
- * Creates the document colors section view and binds it to {@link #documentColors}.
190
- */
191
- private _createDocumentColorsGrid;
192
- /**
193
- * Adds a given color to the document colors list. If possible, the method will attempt to use
194
- * data from the {@link #colorDefinitions} (label, color options).
195
- *
196
- * @param color A string that stores the value of the recently applied color.
197
- */
198
- private _addColorToDocumentColors;
199
- }
@@ -1,133 +0,0 @@
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/colorselector/colorpickerfragmentview
11
- */
12
- import View from '../view.js';
13
- import ButtonView from '../button/buttonview.js';
14
- import type ViewCollection from '../viewcollection.js';
15
- import type { FocusableView } from '../focuscycler.js';
16
- import { default as ColorPickerView } from '../colorpicker/colorpickerview.js';
17
- import type { FocusTracker, KeystrokeHandler, Locale } from '@ckeditor/ckeditor5-utils';
18
- import type { ColorPickerViewConfig } from '../colorpicker/utils.js';
19
- /**
20
- * One of the fragments of {@link module:ui/colorselector/colorselectorview~ColorSelectorView}.
21
- *
22
- * It allows users to select a color from a color picker.
23
- *
24
- * It consists of the following sub–components:
25
- *
26
- * * A color picker saturation and hue sliders,
27
- * * A text input accepting colors in HEX format,
28
- * * "Save" and "Cancel" action buttons.
29
- */
30
- export default class ColorPickerFragmentView extends View {
31
- /**
32
- * A collection of component's children.
33
- */
34
- readonly items: ViewCollection;
35
- /**
36
- * A view with saturation and hue sliders and color input.
37
- */
38
- colorPickerView?: ColorPickerView;
39
- /**
40
- * The "Save" button view.
41
- */
42
- saveButtonView: ButtonView;
43
- /**
44
- * The "Cancel" button view.
45
- */
46
- cancelButtonView: ButtonView;
47
- /**
48
- * The action bar where are "Save" button and "Cancel" button.
49
- */
50
- actionBarView: View;
51
- /**
52
- * Tracks information about the DOM focus in the list.
53
- */
54
- readonly focusTracker: FocusTracker;
55
- /**
56
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
57
- */
58
- readonly keystrokes: KeystrokeHandler;
59
- /**
60
- * Indicates whether the component is visible or not.
61
- */
62
- isVisible: boolean;
63
- /**
64
- * Keeps the value of the command associated with the component for the current selection.
65
- */
66
- selectedColor?: string;
67
- /**
68
- * A collection of views that can be focused in the view.
69
- *
70
- * @readonly
71
- */
72
- protected _focusables: ViewCollection<FocusableView>;
73
- /**
74
- * A reference to the configuration of {@link #colorPickerView}. `false` when the view was
75
- * configured without a color picker.
76
- *
77
- * @readonly
78
- */
79
- private _colorPickerViewConfig;
80
- /**
81
- * Creates an instance of the view.
82
- *
83
- * @param locale The localization services instance.
84
- * @param focusTracker Tracks information about the DOM focus in the list.
85
- * @param focusables A collection of views that can be focused in the view..
86
- * @param keystrokes An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
87
- * @param colorPickerViewConfig The configuration of color picker feature. If set to `false`, the color picker
88
- * will not be rendered.
89
- */
90
- constructor(locale: Locale, { focusTracker, focusables, keystrokes, colorPickerViewConfig }: {
91
- focusTracker: FocusTracker;
92
- focusables: ViewCollection<FocusableView>;
93
- keystrokes: KeystrokeHandler;
94
- colorPickerViewConfig: ColorPickerViewConfig | false;
95
- });
96
- /**
97
- * @inheritDoc
98
- */
99
- render(): void;
100
- /**
101
- * @inheritDoc
102
- */
103
- destroy(): void;
104
- /**
105
- * Focuses the color picker.
106
- */
107
- focus(): void;
108
- /**
109
- * When color picker is focused and "enter" is pressed it executes command.
110
- */
111
- private _executeOnEnterPress;
112
- /**
113
- * Removes default behavior of arrow keys in dropdown.
114
- */
115
- private _stopPropagationOnArrowsKeys;
116
- /**
117
- * Adds color picker elements to focus tracker.
118
- */
119
- private _addColorPickersElementsToFocusTracker;
120
- /**
121
- * Creates bar containing "Save" and "Cancel" buttons.
122
- */
123
- private _createActionBarView;
124
- /**
125
- * Creates "Save" and "Cancel" buttons.
126
- */
127
- private _createActionButtons;
128
- /**
129
- * Fires the `execute` event if color in color picker has been changed
130
- * by the user.
131
- */
132
- private _executeUponColorChange;
133
- }
@@ -1,246 +0,0 @@
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/colorselector/colorselectorview
11
- */
12
- import FocusCycler, { type FocusableView } from '../focuscycler.js';
13
- import View from '../view.js';
14
- import ViewCollection from '../viewcollection.js';
15
- import { FocusTracker, KeystrokeHandler, type Locale } from '@ckeditor/ckeditor5-utils';
16
- import type { ColorPickerViewConfig } from '../colorpicker/utils.js';
17
- import type { ColorDefinition } from '../colorgrid/colorgridview.js';
18
- import type { Model } from '@ckeditor/ckeditor5-engine';
19
- import ColorGridsFragmentView from './colorgridsfragmentview.js';
20
- import ColorPickerFragmentView from './colorpickerfragmentview.js';
21
- import '../../theme/components/colorselector/colorselector.css';
22
- /**
23
- * The configurable color selector view class. It allows users to select colors from a predefined set of colors as well as from
24
- * a color picker.
25
- *
26
- * This meta-view is is made of two components (fragments):
27
- *
28
- * * {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorGridsFragmentView},
29
- * * {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorPickerFragmentView}.
30
- *
31
- * ```ts
32
- * const colorDefinitions = [
33
- * { color: '#000', label: 'Black', options: { hasBorder: false } },
34
- * { color: 'rgb(255, 255, 255)', label: 'White', options: { hasBorder: true } },
35
- * { color: 'red', label: 'Red', options: { hasBorder: false } }
36
- * ];
37
- *
38
- * const selectorView = new ColorSelectorView( locale, {
39
- * colors: colorDefinitions,
40
- * columns: 5,
41
- * removeButtonLabel: 'Remove color',
42
- * documentColorsLabel: 'Document colors',
43
- * documentColorsCount: 4,
44
- * colorPickerViewConfig: {
45
- * format: 'hsl'
46
- * }
47
- * } );
48
- *
49
- * selectorView.appendUI();
50
- * selectorView.selectedColor = 'red';
51
- * selectorView.updateSelectedColors();
52
- *
53
- * selectorView.on<ColorSelectorExecuteEvent>( 'execute', ( evt, data ) => {
54
- * console.log( 'Color changed', data.value, data.source );
55
- * } );
56
- *
57
- * selectorView.on<ColorSelectorColorPickerShowEvent>( 'colorPicker:show', ( evt ) => {
58
- * console.log( 'Color picker showed up', evt );
59
- * } );
60
- *
61
- * selectorView.on<ColorSelectorColorPickerCancelEvent>( 'colorPicker:cancel', ( evt ) => {
62
- * console.log( 'Color picker cancel', evt );
63
- * } );
64
- *
65
- * selectorView.render();
66
- *
67
- * document.body.appendChild( selectorView.element );
68
- * ```
69
- */
70
- export default class ColorSelectorView extends View {
71
- /**
72
- * Tracks information about the DOM focus in the list.
73
- */
74
- readonly focusTracker: FocusTracker;
75
- /**
76
- * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
77
- */
78
- readonly keystrokes: KeystrokeHandler;
79
- /**
80
- * A collection of components.
81
- */
82
- readonly items: ViewCollection;
83
- /**
84
- * A fragment that allows users to select colors from the a predefined set and from existing document colors.
85
- */
86
- readonly colorGridsFragmentView: ColorGridsFragmentView;
87
- /**
88
- * A fragment that allows users to select a color from a color picker.
89
- */
90
- readonly colorPickerFragmentView: ColorPickerFragmentView;
91
- /**
92
- * Keeps the value of the command associated with the component for the current selection.
93
- */
94
- selectedColor?: string;
95
- /**
96
- * Reflects the visibility state of the color grids fragment.
97
- *
98
- * @internal
99
- */
100
- _isColorGridsFragmentVisible: boolean;
101
- /**
102
- * Reflects the visibility state of the color picker fragment.
103
- *
104
- * @internal
105
- */
106
- _isColorPickerFragmentVisible: boolean;
107
- /**
108
- * Helps cycling over focusable {@link #items} in the list.
109
- *
110
- * @readonly
111
- */
112
- protected _focusCycler: FocusCycler;
113
- /**
114
- * A collection of views that can be focused in the view.
115
- *
116
- * @readonly
117
- */
118
- protected _focusables: ViewCollection<FocusableView>;
119
- /**
120
- * The configuration of color picker sub-component.
121
- */
122
- private _colorPickerViewConfig;
123
- /**
124
- * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.
125
- *
126
- * @param locale The localization services instance.
127
- * @param colors An array with definitions of colors to be displayed in the table.
128
- * @param columns The number of columns in the color grid.
129
- * @param removeButtonLabel The label of the button responsible for removing the color.
130
- * @param colorPickerLabel The label of the button responsible for color picker appearing.
131
- * @param documentColorsLabel The label for the section with the document colors.
132
- * @param documentColorsCount The number of colors in the document colors section inside the color dropdown.
133
- * @param colorPickerViewConfig The configuration of color picker feature. If set to `false`, the color picker will be hidden.
134
- */
135
- constructor(locale: Locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, colorPickerViewConfig }: {
136
- colors: Array<ColorDefinition>;
137
- columns: number;
138
- removeButtonLabel: string;
139
- documentColorsLabel?: string;
140
- documentColorsCount?: number;
141
- colorPickerLabel: string;
142
- colorPickerViewConfig: ColorPickerViewConfig | false;
143
- });
144
- /**
145
- * @inheritDoc
146
- */
147
- render(): void;
148
- /**
149
- * @inheritDoc
150
- */
151
- destroy(): void;
152
- /**
153
- * Renders the internals of the component on demand:
154
- * * {@link #colorPickerFragmentView},
155
- * * {@link #colorGridsFragmentView}.
156
- *
157
- * It allows for deferring component initialization to improve the performance.
158
- *
159
- * See {@link #showColorPickerFragment}, {@link #showColorGridsFragment}.
160
- */
161
- appendUI(): void;
162
- /**
163
- * Shows the {@link #colorPickerFragmentView} and hides the {@link #colorGridsFragmentView}.
164
- *
165
- * **Note**: It requires {@link #appendUI} to be called first.
166
- *
167
- * See {@link #showColorGridsFragment}, {@link ~ColorSelectorView#event:colorPicker:show}.
168
- */
169
- showColorPickerFragment(): void;
170
- /**
171
- * Shows the {@link #colorGridsFragmentView} and hides the {@link #colorPickerFragmentView}.
172
- *
173
- * See {@link #showColorPickerFragment}.
174
- *
175
- * **Note**: It requires {@link #appendUI} to be called first.
176
- */
177
- showColorGridsFragment(): void;
178
- /**
179
- * Focuses the first focusable element in {@link #items}.
180
- */
181
- focus(): void;
182
- /**
183
- * Focuses the last focusable element in {@link #items}.
184
- */
185
- focusLast(): void;
186
- /**
187
- * Scans through the editor model and searches for text node attributes with the given `attributeName`.
188
- * Found entries are set as document colors in {@link #colorGridsFragmentView}.
189
- *
190
- * All the previously stored document colors will be lost in the process.
191
- *
192
- * @param model The model used as a source to obtain the document colors.
193
- * @param attributeName Determines the name of the related model's attribute for a given dropdown.
194
- */
195
- updateDocumentColors(model: Model, attributeName: string): void;
196
- /**
197
- * Refreshes the state of the selected color in one or both grids located in {@link #colorGridsFragmentView}.
198
- *
199
- * It guarantees that the selection will occur only in one of them.
200
- */
201
- updateSelectedColors(): void;
202
- /**
203
- * Appends the view containing static and document color grid views.
204
- */
205
- private _appendColorGridsFragment;
206
- /**
207
- * Appends the view with the color picker.
208
- */
209
- private _appendColorPickerFragment;
210
- }
211
- /**
212
- * Fired whenever the color was changed. There are multiple sources of this event and you can distinguish them
213
- * using the `source` property passed along this event.
214
- *
215
- * @eventName ~ColorSelectorView#execute
216
- */
217
- export type ColorSelectorExecuteEvent = {
218
- name: 'execute';
219
- args: [
220
- {
221
- value: string;
222
- source: 'staticColorsGrid' | 'documentColorsGrid' | 'removeColorButton' | 'colorPicker' | 'colorPickerSaveButton';
223
- }
224
- ];
225
- };
226
- /**
227
- * Fired when the user pressed the "Cancel" button in the
228
- * {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorPickerFragmentView}.
229
- *
230
- * @eventName ~ColorSelectorView#colorPicker:cancel
231
- */
232
- export type ColorSelectorColorPickerCancelEvent = {
233
- name: 'colorPicker:cancel';
234
- args: [];
235
- };
236
- /**
237
- * Fired whenever {@link module:ui/colorselector/colorselectorview~ColorSelectorView#colorPickerFragmentView} is shown.
238
- *
239
- * See {@link ~ColorSelectorView#showColorPickerFragment}.
240
- *
241
- * @eventName ~ColorSelectorView#colorPicker:show
242
- */
243
- export type ColorSelectorColorPickerShowEvent = {
244
- name: 'colorPicker:show';
245
- args: [];
246
- };