@ckeditor/ckeditor5-table 48.8.1-alpha.4 → 49.0.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 (251) hide show
  1. package/LICENSE.md +1 -1
  2. package/ckeditor5-metadata.json +12 -1
  3. package/dist/augmentation.d.ts +83 -80
  4. package/dist/commands/insertcolumncommand.d.ts +50 -50
  5. package/dist/commands/insertrowcommand.d.ts +49 -49
  6. package/dist/commands/inserttablecommand.d.ts +48 -43
  7. package/dist/commands/inserttablelayoutcommand.d.ts +39 -34
  8. package/dist/commands/mergecellcommand.d.ts +63 -63
  9. package/dist/commands/mergecellscommand.d.ts +24 -24
  10. package/dist/commands/removecolumncommand.d.ts +24 -24
  11. package/dist/commands/removerowcommand.d.ts +24 -24
  12. package/dist/commands/selectcolumncommand.d.ts +28 -28
  13. package/dist/commands/selectrowcommand.d.ts +28 -28
  14. package/dist/commands/setfooterrowcommand.d.ts +48 -48
  15. package/dist/commands/setheadercolumncommand.d.ts +45 -45
  16. package/dist/commands/setheaderrowcommand.d.ts +48 -48
  17. package/dist/commands/splitcellcommand.d.ts +39 -38
  18. package/dist/converters/downcast.d.ts +77 -77
  19. package/dist/converters/table-caption-post-fixer.d.ts +18 -18
  20. package/dist/converters/table-cell-paragraph-post-fixer.d.ts +30 -30
  21. package/dist/converters/table-cell-refresh-handler.d.ts +16 -16
  22. package/dist/converters/table-layout-post-fixer.d.ts +224 -224
  23. package/dist/converters/table-structure-post-fixer.d.ts +16 -16
  24. package/dist/converters/table-structure-refresh-handler.d.ts +15 -15
  25. package/dist/converters/tableproperties.d.ts +98 -98
  26. package/dist/converters/upcasttable.d.ts +47 -47
  27. package/dist/index-content.css +116 -105
  28. package/dist/index-content.css.map +1 -0
  29. package/dist/index-editor.css +718 -601
  30. package/dist/index-editor.css.map +1 -0
  31. package/dist/index.css +781 -650
  32. package/dist/index.css.map +1 -1
  33. package/dist/index.d.ts +103 -98
  34. package/dist/index.js +13669 -14491
  35. package/dist/index.js.map +1 -1
  36. package/dist/plaintableoutput.d.ts +28 -28
  37. package/dist/table.d.ts +38 -39
  38. package/dist/tablecaption/tablecaptionediting.d.ts +62 -62
  39. package/dist/tablecaption/tablecaptionui.d.ts +18 -18
  40. package/dist/tablecaption/toggletablecaptioncommand.d.ts +61 -61
  41. package/dist/tablecaption/utils.d.ts +31 -31
  42. package/dist/tablecaption.d.ts +22 -23
  43. package/dist/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +27 -27
  44. package/dist/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +32 -32
  45. package/dist/tablecellproperties/commands/tablecellborderstylecommand.d.ts +32 -32
  46. package/dist/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +46 -46
  47. package/dist/tablecellproperties/commands/tablecellheightcommand.d.ts +41 -41
  48. package/dist/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +27 -27
  49. package/dist/tablecellproperties/commands/tablecellpaddingcommand.d.ts +46 -46
  50. package/dist/tablecellproperties/commands/tablecellpropertycommand.d.ts +79 -79
  51. package/dist/tablecellproperties/commands/tablecelltypecommand.d.ts +42 -42
  52. package/dist/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +35 -35
  53. package/dist/tablecellproperties/tablecellpropertiesediting.d.ts +49 -49
  54. package/dist/tablecellproperties/tablecellpropertiesui.d.ts +130 -123
  55. package/dist/tablecellproperties/tablecellpropertiesutils.d.ts +13 -13
  56. package/dist/tablecellproperties/ui/tablecellpropertiesview.d.ts +255 -257
  57. package/dist/tablecellproperties.d.ts +29 -29
  58. package/dist/tablecellwidth/commands/tablecellwidthcommand.d.ts +41 -41
  59. package/dist/tablecellwidth/tablecellwidthediting.d.ts +28 -28
  60. package/dist/tableclipboard.d.ts +79 -79
  61. package/dist/tablecolumnresize/commands/tablecolumnwidthcommand.d.ts +56 -0
  62. package/dist/tablecolumnresize/constants.d.ts +40 -25
  63. package/dist/tablecolumnresize/converters.d.ts +20 -20
  64. package/dist/tablecolumnresize/tablecolumnresizeediting.d.ts +263 -184
  65. package/dist/tablecolumnresize/tablewidthscommand.d.ts +31 -31
  66. package/dist/tablecolumnresize/utils.d.ts +166 -127
  67. package/dist/tablecolumnresize.d.ts +24 -25
  68. package/dist/tableconfig.d.ts +736 -670
  69. package/dist/tableediting.d.ts +98 -99
  70. package/dist/tablekeyboard.d.ts +67 -67
  71. package/dist/tablelayout/commands/tabletypecommand.d.ts +38 -38
  72. package/dist/tablelayout/tablelayoutediting.d.ts +57 -58
  73. package/dist/tablelayout/tablelayoutui.d.ts +27 -27
  74. package/dist/tablelayout.d.ts +25 -25
  75. package/dist/tablemouse/mouseeventsobserver.d.ts +54 -54
  76. package/dist/tablemouse.d.ts +47 -47
  77. package/dist/tableproperties/commands/tablealignmentcommand.d.ts +27 -27
  78. package/dist/tableproperties/commands/tablebackgroundcolorcommand.d.ts +27 -27
  79. package/dist/tableproperties/commands/tablebordercolorcommand.d.ts +32 -32
  80. package/dist/tableproperties/commands/tableborderstylecommand.d.ts +32 -32
  81. package/dist/tableproperties/commands/tableborderwidthcommand.d.ts +46 -46
  82. package/dist/tableproperties/commands/tableheightcommand.d.ts +41 -41
  83. package/dist/tableproperties/commands/tablepropertycommand.d.ts +64 -64
  84. package/dist/tableproperties/commands/tablewidthcommand.d.ts +41 -41
  85. package/dist/tableproperties/tablepropertiesediting.d.ts +48 -48
  86. package/dist/tableproperties/tablepropertiesui.d.ts +131 -131
  87. package/dist/tableproperties/ui/tablepropertiesview.d.ts +210 -207
  88. package/dist/tableproperties.d.ts +29 -29
  89. package/dist/tablescroll/tablescrollediting.d.ts +91 -0
  90. package/dist/tablescroll/watchers.d.ts +29 -0
  91. package/dist/tablescroll.d.ts +23 -0
  92. package/dist/tableselection.d.ts +105 -106
  93. package/dist/tabletoolbar.d.ts +31 -31
  94. package/dist/tableui.d.ts +53 -53
  95. package/dist/tableutils.d.ts +532 -532
  96. package/dist/tablewalker.d.ts +342 -350
  97. package/dist/translations/af.js +1 -1
  98. package/dist/translations/af.umd.js +5 -3
  99. package/dist/translations/ar.js +1 -1
  100. package/dist/translations/ar.umd.js +5 -3
  101. package/dist/translations/ast.js +1 -1
  102. package/dist/translations/ast.umd.js +5 -3
  103. package/dist/translations/az.js +1 -1
  104. package/dist/translations/az.umd.js +5 -3
  105. package/dist/translations/be.js +1 -1
  106. package/dist/translations/be.umd.js +5 -3
  107. package/dist/translations/bg.js +1 -1
  108. package/dist/translations/bg.umd.js +5 -3
  109. package/dist/translations/bn.js +1 -1
  110. package/dist/translations/bn.umd.js +5 -3
  111. package/dist/translations/bs.js +1 -1
  112. package/dist/translations/bs.umd.js +5 -3
  113. package/dist/translations/ca.js +1 -1
  114. package/dist/translations/ca.umd.js +5 -3
  115. package/dist/translations/cs.js +1 -1
  116. package/dist/translations/cs.umd.js +5 -3
  117. package/dist/translations/da.js +1 -1
  118. package/dist/translations/da.umd.js +5 -3
  119. package/dist/translations/de-ch.js +1 -1
  120. package/dist/translations/de-ch.umd.js +5 -3
  121. package/dist/translations/de.js +1 -1
  122. package/dist/translations/de.umd.js +5 -3
  123. package/dist/translations/el.js +1 -1
  124. package/dist/translations/el.umd.js +5 -3
  125. package/dist/translations/en-au.js +1 -1
  126. package/dist/translations/en-au.umd.js +5 -3
  127. package/dist/translations/en-gb.js +1 -1
  128. package/dist/translations/en-gb.umd.js +5 -3
  129. package/dist/translations/en.js +1 -1
  130. package/dist/translations/en.umd.js +5 -3
  131. package/dist/translations/eo.js +1 -1
  132. package/dist/translations/eo.umd.js +5 -3
  133. package/dist/translations/es-co.js +1 -1
  134. package/dist/translations/es-co.umd.js +5 -3
  135. package/dist/translations/es.js +1 -1
  136. package/dist/translations/es.umd.js +5 -3
  137. package/dist/translations/et.js +1 -1
  138. package/dist/translations/et.umd.js +5 -3
  139. package/dist/translations/eu.js +1 -1
  140. package/dist/translations/eu.umd.js +5 -3
  141. package/dist/translations/fa.js +1 -1
  142. package/dist/translations/fa.umd.js +5 -3
  143. package/dist/translations/fi.js +1 -1
  144. package/dist/translations/fi.umd.js +5 -3
  145. package/dist/translations/fr.js +1 -1
  146. package/dist/translations/fr.umd.js +5 -3
  147. package/dist/translations/gl.js +1 -1
  148. package/dist/translations/gl.umd.js +5 -3
  149. package/dist/translations/gu.js +1 -1
  150. package/dist/translations/gu.umd.js +5 -3
  151. package/dist/translations/he.js +1 -1
  152. package/dist/translations/he.umd.js +5 -3
  153. package/dist/translations/hi.js +1 -1
  154. package/dist/translations/hi.umd.js +5 -3
  155. package/dist/translations/hr.js +1 -1
  156. package/dist/translations/hr.umd.js +5 -3
  157. package/dist/translations/hu.js +1 -1
  158. package/dist/translations/hu.umd.js +5 -3
  159. package/dist/translations/hy.js +1 -1
  160. package/dist/translations/hy.umd.js +5 -3
  161. package/dist/translations/id.js +1 -1
  162. package/dist/translations/id.umd.js +5 -3
  163. package/dist/translations/it.js +1 -1
  164. package/dist/translations/it.umd.js +5 -3
  165. package/dist/translations/ja.js +1 -1
  166. package/dist/translations/ja.umd.js +5 -3
  167. package/dist/translations/jv.js +1 -1
  168. package/dist/translations/jv.umd.js +5 -3
  169. package/dist/translations/kk.js +1 -1
  170. package/dist/translations/kk.umd.js +5 -3
  171. package/dist/translations/km.js +1 -1
  172. package/dist/translations/km.umd.js +5 -3
  173. package/dist/translations/kn.js +1 -1
  174. package/dist/translations/kn.umd.js +5 -3
  175. package/dist/translations/ko.js +1 -1
  176. package/dist/translations/ko.umd.js +5 -3
  177. package/dist/translations/ku.js +1 -1
  178. package/dist/translations/ku.umd.js +5 -3
  179. package/dist/translations/lt.js +1 -1
  180. package/dist/translations/lt.umd.js +5 -3
  181. package/dist/translations/lv.js +1 -1
  182. package/dist/translations/lv.umd.js +5 -3
  183. package/dist/translations/ms.js +1 -1
  184. package/dist/translations/ms.umd.js +5 -3
  185. package/dist/translations/nb.js +1 -1
  186. package/dist/translations/nb.umd.js +5 -3
  187. package/dist/translations/ne.js +1 -1
  188. package/dist/translations/ne.umd.js +5 -3
  189. package/dist/translations/nl.js +1 -1
  190. package/dist/translations/nl.umd.js +5 -3
  191. package/dist/translations/no.js +1 -1
  192. package/dist/translations/no.umd.js +5 -3
  193. package/dist/translations/oc.js +1 -1
  194. package/dist/translations/oc.umd.js +5 -3
  195. package/dist/translations/pl.js +1 -1
  196. package/dist/translations/pl.umd.js +5 -3
  197. package/dist/translations/pt-br.js +1 -1
  198. package/dist/translations/pt-br.umd.js +5 -3
  199. package/dist/translations/pt.js +1 -1
  200. package/dist/translations/pt.umd.js +5 -3
  201. package/dist/translations/ro.js +1 -1
  202. package/dist/translations/ro.umd.js +5 -3
  203. package/dist/translations/ru.js +1 -1
  204. package/dist/translations/ru.umd.js +5 -3
  205. package/dist/translations/si.js +1 -1
  206. package/dist/translations/si.umd.js +5 -3
  207. package/dist/translations/sk.js +1 -1
  208. package/dist/translations/sk.umd.js +5 -3
  209. package/dist/translations/sl.js +1 -1
  210. package/dist/translations/sl.umd.js +5 -3
  211. package/dist/translations/sq.js +1 -1
  212. package/dist/translations/sq.umd.js +5 -3
  213. package/dist/translations/sr-latn.js +1 -1
  214. package/dist/translations/sr-latn.umd.js +5 -3
  215. package/dist/translations/sr.js +1 -1
  216. package/dist/translations/sr.umd.js +5 -3
  217. package/dist/translations/sv.js +1 -1
  218. package/dist/translations/sv.umd.js +5 -3
  219. package/dist/translations/th.js +1 -1
  220. package/dist/translations/th.umd.js +5 -3
  221. package/dist/translations/ti.js +1 -1
  222. package/dist/translations/ti.umd.js +5 -3
  223. package/dist/translations/tk.js +1 -1
  224. package/dist/translations/tk.umd.js +5 -3
  225. package/dist/translations/tr.js +1 -1
  226. package/dist/translations/tr.umd.js +5 -3
  227. package/dist/translations/tt.js +1 -1
  228. package/dist/translations/tt.umd.js +5 -3
  229. package/dist/translations/ug.js +1 -1
  230. package/dist/translations/ug.umd.js +5 -3
  231. package/dist/translations/uk.js +1 -1
  232. package/dist/translations/uk.umd.js +5 -3
  233. package/dist/translations/ur.js +1 -1
  234. package/dist/translations/ur.umd.js +5 -3
  235. package/dist/translations/uz.js +1 -1
  236. package/dist/translations/uz.umd.js +5 -3
  237. package/dist/translations/vi.js +1 -1
  238. package/dist/translations/vi.umd.js +5 -3
  239. package/dist/translations/zh-cn.js +1 -1
  240. package/dist/translations/zh-cn.umd.js +5 -3
  241. package/dist/translations/zh.js +1 -1
  242. package/dist/translations/zh.umd.js +5 -3
  243. package/dist/ui/colorinputview.d.ts +136 -137
  244. package/dist/ui/inserttableview.d.ts +77 -78
  245. package/dist/utils/common.d.ts +64 -58
  246. package/dist/utils/structure.d.ts +229 -229
  247. package/dist/utils/table-properties.d.ts +92 -92
  248. package/dist/utils/ui/contextualballoon.d.ts +28 -28
  249. package/dist/utils/ui/table-properties.d.ts +130 -192
  250. package/dist/utils/ui/widget.d.ts +22 -22
  251. package/package.json +11 -10
@@ -1,698 +1,764 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module table/tableconfig
7
- */
8
- import type { ToolbarConfigItem } from '@ckeditor/ckeditor5-core';
9
- import type { ColorOption, ColorPickerConfig } from '@ckeditor/ckeditor5-ui';
6
+ * @module table/tableconfig
7
+ */
8
+ import type { ToolbarConfigItem } from "@ckeditor/ckeditor5-core";
9
+ import type { ColorOption, ColorPickerConfig } from "@ckeditor/ckeditor5-ui";
10
10
  /**
11
- * The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
12
- *
13
- * ```ts
14
- * ClassicEditor
15
- * .create( editorElement, {
16
- * table: ... // Table feature options.
17
- * } )
18
- * .then( ... )
19
- * .catch( ... );
20
- * ```
21
- *
22
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
23
- */
11
+ * The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.
12
+ *
13
+ * ```ts
14
+ * ClassicEditor
15
+ * .create( {
16
+ * table: ... // Table feature options.
17
+ * } )
18
+ * .then( ... )
19
+ * .catch( ... );
20
+ * ```
21
+ *
22
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
23
+ */
24
24
  export interface TableConfig {
25
- /**
26
- * Number of rows and columns to render by the table heading when inserting new tables.
27
- *
28
- * You can configure it like this:
29
- *
30
- * ```ts
31
- * const tableConfig = {
32
- * defaultHeadings: {
33
- * rows: 1,
34
- * columns: 1
35
- * }
36
- * };
37
- * ```
38
- *
39
- * Both rows and columns properties are optional, defaulting to 0 (no heading).
40
- */
41
- defaultHeadings?: {
42
- rows?: number;
43
- columns?: number;
44
- };
45
- /**
46
- * Number of footer rows to render by default when inserting new tables.
47
- *
48
- * You can configure it like this:
49
- *
50
- * ```ts
51
- * const tableConfig = {
52
- * defaultFooters: 1
53
- * };
54
- * ```
55
- *
56
- * The rows property is optional, defaulting to 0 (no footer).
57
- * This option is ignored when {@link module:table/tableconfig~TableConfig#enableFooters `config.table.enableFooters`} is `false`.
58
- */
59
- defaultFooters?: number;
60
- /**
61
- * Enables support for table footers (`<tfoot>`).
62
- *
63
- * When set to `true`, the editor will upcast and downcast `<tfoot>` elements, and the footer toggle will be visible
64
- * in the table row dropdown.
65
- * When set to `false` (default), footer rows are ignored and the footer toggle is hidden in the table row dropdown.
66
- *
67
- * @default false
68
- */
69
- enableFooters?: boolean;
70
- /**
71
- * Items to be placed in the table content toolbar.
72
- * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
73
- *
74
- * Assuming that you use the {@link module:table/tableui~TableUI} feature, the following toolbar items will be available
75
- * in {@link module:ui/componentfactory~ComponentFactory}:
76
- *
77
- * * `'tableRow'`,
78
- * * `'tableColumn'`,
79
- * * `'mergeTableCells'`.
80
- *
81
- * You can thus configure the toolbar like this:
82
- *
83
- * ```ts
84
- * const tableConfig = {
85
- * contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
86
- * };
87
- * ```
88
- *
89
- * Of course, the same buttons can also be used in the
90
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
91
- *
92
- * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
93
- */
94
- contentToolbar?: Array<ToolbarConfigItem>;
95
- /**
96
- * Items to be placed in the table toolbar.
97
- * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
98
- *
99
- * You can thus configure the toolbar like this:
100
- *
101
- * ```ts
102
- * const tableConfig = {
103
- * tableToolbar: [ 'blockQuote' ]
104
- * };
105
- * ```
106
- *
107
- * Of course, the same buttons can also be used in the
108
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
109
- *
110
- * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
111
- */
112
- tableToolbar?: Array<ToolbarConfigItem>;
113
- /**
114
- * The configuration of the table properties user interface (balloon). It allows us to define:
115
- *
116
- * * The color palette for the table border color style field (`tableProperties.borderColors`),
117
- * * The color palette for the table background style field (`tableProperties.backgroundColors`).
118
- *
119
- * ```ts
120
- * const tableConfig = {
121
- * tableProperties: {
122
- * borderColors: [
123
- * {
124
- * color: 'hsl(0, 0%, 90%)',
125
- * label: 'Light grey'
126
- * },
127
- * // ...
128
- * ],
129
- * backgroundColors: [
130
- * {
131
- * color: 'hsl(120, 75%, 60%)',
132
- * label: 'Green'
133
- * },
134
- * // ...
135
- * ]
136
- * }
137
- * };
138
- * ```
139
- *
140
- * * The default styles for tables (`tableProperties.defaultProperties`):
141
- *
142
- * ```
143
- * const tableConfig = {
144
- * tableProperties: {
145
- * defaultProperties: {
146
- * borderStyle: 'dashed',
147
- * borderColor: 'hsl(0, 0%, 90%)',
148
- * borderWidth: '3px',
149
- * alignment: 'left'
150
- * }
151
- * }
152
- * }
153
- * ```
154
- *
155
- * {@link module:table/tableconfig~TablePropertiesOptions Read more about the supported properties.}
156
- *
157
- * **Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor,
158
- * i.e., they do not limit or filter the colors in the data. They are used only in the user interface,
159
- * allowing users to pick colors more conveniently. The `defaultProperties` option does impact the data.
160
- * The editor model will not keep the default values.
161
- *
162
- * The default color palettes for the table background and the table border are the same
163
- * ({@link module:table/utils/ui/table-properties#defaultColors check out their content}).
164
- *
165
- * Both color palette configurations must follow the
166
- * {@link module:table/tableconfig~TableColorConfig table color configuration format}.
167
- *
168
- * Read more about configuring the table feature in {@link module:table/tableconfig~TableConfig}.
169
- */
170
- tableProperties?: TablePropertiesConfig;
171
- /**
172
- * The configuration of the table cell properties user interface (balloon). It allows us to define:
173
- *
174
- * * The color palette for the cell border color style field (`tableCellProperties.borderColors`),
175
- * * The color palette for the cell background style field (`tableCellProperties.backgroundColors`).
176
- *
177
- * ```ts
178
- * const tableConfig = {
179
- * tableCellProperties: {
180
- * borderColors: [
181
- * {
182
- * color: 'hsl(0, 0%, 90%)',
183
- * label: 'Light grey'
184
- * },
185
- * // ...
186
- * ],
187
- * backgroundColors: [
188
- * {
189
- * color: 'hsl(120, 75%, 60%)',
190
- * label: 'Green'
191
- * },
192
- * // ...
193
- * ]
194
- * }
195
- * };
196
- * ```
197
- *
198
- * * The default styles for table cells (`tableCellProperties.defaultProperties`):
199
- *
200
- * ```ts
201
- * const tableConfig = {
202
- * tableCellProperties: {
203
- * defaultProperties: {
204
- * horizontalAlignment: 'right',
205
- * verticalAlignment: 'bottom',
206
- * padding: '5px'
207
- * }
208
- * }
209
- * }
210
- * ```
211
- *
212
- * {@link module:table/tableconfig~TablePropertiesOptions Read more about the supported properties.}
213
- *
214
- * **Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor,
215
- * i.e., they do not limit or filter the colors in the data. They are used only in the user interface,
216
- * allowing users to pick colors in a more convenient way. The `defaultProperties` option does impact the data.
217
- * The editor model will not keep the default values.
218
- *
219
- * The default color palettes for the cell background and the cell border are identical
220
- * ({@link module:table/utils/ui/table-properties#defaultColors check out their content}).
221
- *
222
- * Both color palette configurations must follow the
223
- * {@link module:table/tableconfig~TableColorConfig table color configuration format}.
224
- *
225
- * Read more about configuring the table feature in {@link module:table/tableconfig~TableConfig}.
226
- */
227
- tableCellProperties?: TableCellPropertiesConfig;
228
- /**
229
- * Configuration of the table layout feature.
230
- *
231
- * ```ts
232
- * const tableConfig = {
233
- * tableLayout: ... // Table layout feature config.
234
- * };
235
- * ```
236
- */
237
- tableLayout?: TableLayoutConfig;
238
- /**
239
- * Configuration of the table caption feature.
240
- *
241
- * ```ts
242
- * const tableConfig = {
243
- * tableCaption: ... // Table caption feature config.
244
- * };
245
- * ```
246
- */
247
- tableCaption?: TableCaptionConfig;
248
- /**
249
- * When set to `true` (default), the editor visually displays dashed borders around table elements (`<table>`, `<td>`, `<th>`)
250
- * that contain inline styles explicitly removing borders (for example: `border: none`, `border-top-style: none`, etc.).
251
- *
252
- * This visualization is shown **only in the editing view**.
253
- * It does not modify the underlying table data or the HTML produced by the editor.
254
- * When set to `false`, the editor will not render any dashed borders, and elements with `border: none`
255
- * will remain visually borderless during editing.
256
- *
257
- * ```ts
258
- * const tableConfig = {
259
- * showHiddenBorders: false
260
- * };
261
- * ```
262
- *
263
- * @default true
264
- */
265
- showHiddenBorders?: boolean;
25
+ /**
26
+ * Number of rows and columns to render by the table heading when inserting new tables.
27
+ *
28
+ * You can configure it like this:
29
+ *
30
+ * ```ts
31
+ * const tableConfig = {
32
+ * defaultHeadings: {
33
+ * rows: 1,
34
+ * columns: 1
35
+ * }
36
+ * };
37
+ * ```
38
+ *
39
+ * Both rows and columns properties are optional, defaulting to 0 (no heading).
40
+ */
41
+ defaultHeadings?: {
42
+ rows?: number;
43
+ columns?: number;
44
+ };
45
+ /**
46
+ * Number of footer rows to render by default when inserting new tables.
47
+ *
48
+ * You can configure it like this:
49
+ *
50
+ * ```ts
51
+ * const tableConfig = {
52
+ * defaultFooters: 1
53
+ * };
54
+ * ```
55
+ *
56
+ * The rows property is optional, defaulting to 0 (no footer).
57
+ * This option is ignored when {@link module:table/tableconfig~TableConfig#enableFooters `config.table.enableFooters`} is `false`.
58
+ */
59
+ defaultFooters?: number;
60
+ /**
61
+ * Enables support for table footers (`<tfoot>`).
62
+ *
63
+ * When set to `true`, the editor will upcast and downcast `<tfoot>` elements, and the footer toggle will be visible
64
+ * in the table row dropdown.
65
+ * When set to `false` (default), footer rows are ignored and the footer toggle is hidden in the table row dropdown.
66
+ *
67
+ * @default false
68
+ */
69
+ enableFooters?: boolean;
70
+ /**
71
+ * Items to be placed in the table content toolbar.
72
+ * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
73
+ *
74
+ * Assuming that you use the {@link module:table/tableui~TableUI} feature, the following toolbar items will be available
75
+ * in {@link module:ui/componentfactory~ComponentFactory}:
76
+ *
77
+ * * `'tableRow'`,
78
+ * * `'tableColumn'`,
79
+ * * `'mergeTableCells'`.
80
+ *
81
+ * You can thus configure the toolbar like this:
82
+ *
83
+ * ```ts
84
+ * const tableConfig = {
85
+ * contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
86
+ * };
87
+ * ```
88
+ *
89
+ * Of course, the same buttons can also be used in the
90
+ * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
91
+ *
92
+ * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
93
+ */
94
+ contentToolbar?: Array<ToolbarConfigItem>;
95
+ /**
96
+ * Items to be placed in the table toolbar.
97
+ * The {@link module:table/tabletoolbar~TableToolbar} plugin is required to make this toolbar work.
98
+ *
99
+ * You can thus configure the toolbar like this:
100
+ *
101
+ * ```ts
102
+ * const tableConfig = {
103
+ * tableToolbar: [ 'blockQuote' ]
104
+ * };
105
+ * ```
106
+ *
107
+ * Of course, the same buttons can also be used in the
108
+ * {@link module:core/editor/editorconfig~EditorConfig#toolbar main editor toolbar}.
109
+ *
110
+ * Read more about configuring the toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
111
+ */
112
+ tableToolbar?: Array<ToolbarConfigItem>;
113
+ /**
114
+ * The configuration of the table properties user interface (balloon). It allows us to define:
115
+ *
116
+ * * The color palette for the table border color style field (`tableProperties.borderColors`),
117
+ * * The color palette for the table background style field (`tableProperties.backgroundColors`).
118
+ *
119
+ * ```ts
120
+ * const tableConfig = {
121
+ * tableProperties: {
122
+ * borderColors: [
123
+ * {
124
+ * color: 'hsl(0, 0%, 90%)',
125
+ * label: 'Light grey'
126
+ * },
127
+ * // ...
128
+ * ],
129
+ * backgroundColors: [
130
+ * {
131
+ * color: 'hsl(120, 75%, 60%)',
132
+ * label: 'Green'
133
+ * },
134
+ * // ...
135
+ * ]
136
+ * }
137
+ * };
138
+ * ```
139
+ *
140
+ * * The default styles for tables (`tableProperties.defaultProperties`):
141
+ *
142
+ * ```
143
+ * const tableConfig = {
144
+ * tableProperties: {
145
+ * defaultProperties: {
146
+ * borderStyle: 'dashed',
147
+ * borderColor: 'hsl(0, 0%, 90%)',
148
+ * borderWidth: '3px',
149
+ * alignment: 'left'
150
+ * }
151
+ * }
152
+ * }
153
+ * ```
154
+ *
155
+ * {@link module:table/tableconfig~TablePropertiesOptions Read more about the supported properties.}
156
+ *
157
+ * **Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor,
158
+ * i.e., they do not limit or filter the colors in the data. They are used only in the user interface,
159
+ * allowing users to pick colors more conveniently. The `defaultProperties` option does impact the data.
160
+ * The editor model will not keep the default values.
161
+ *
162
+ * The default color palettes for the table background and the table border are the same
163
+ * ({@link module:table/utils/ui/table-properties#defaultColors check out their content}).
164
+ *
165
+ * Both color palette configurations must follow the
166
+ * {@link module:table/tableconfig~TableColorConfig table color configuration format}.
167
+ *
168
+ * Read more about configuring the table feature in {@link module:table/tableconfig~TableConfig}.
169
+ */
170
+ tableProperties?: TablePropertiesConfig;
171
+ /**
172
+ * The configuration of the table cell properties user interface (balloon). It allows us to define:
173
+ *
174
+ * * The color palette for the cell border color style field (`tableCellProperties.borderColors`),
175
+ * * The color palette for the cell background style field (`tableCellProperties.backgroundColors`).
176
+ *
177
+ * ```ts
178
+ * const tableConfig = {
179
+ * tableCellProperties: {
180
+ * borderColors: [
181
+ * {
182
+ * color: 'hsl(0, 0%, 90%)',
183
+ * label: 'Light grey'
184
+ * },
185
+ * // ...
186
+ * ],
187
+ * backgroundColors: [
188
+ * {
189
+ * color: 'hsl(120, 75%, 60%)',
190
+ * label: 'Green'
191
+ * },
192
+ * // ...
193
+ * ]
194
+ * }
195
+ * };
196
+ * ```
197
+ *
198
+ * * The default styles for table cells (`tableCellProperties.defaultProperties`):
199
+ *
200
+ * ```ts
201
+ * const tableConfig = {
202
+ * tableCellProperties: {
203
+ * defaultProperties: {
204
+ * horizontalAlignment: 'right',
205
+ * verticalAlignment: 'bottom',
206
+ * padding: '5px'
207
+ * }
208
+ * }
209
+ * }
210
+ * ```
211
+ *
212
+ * {@link module:table/tableconfig~TablePropertiesOptions Read more about the supported properties.}
213
+ *
214
+ * **Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor,
215
+ * i.e., they do not limit or filter the colors in the data. They are used only in the user interface,
216
+ * allowing users to pick colors in a more convenient way. The `defaultProperties` option does impact the data.
217
+ * The editor model will not keep the default values.
218
+ *
219
+ * The default color palettes for the cell background and the cell border are identical
220
+ * ({@link module:table/utils/ui/table-properties#defaultColors check out their content}).
221
+ *
222
+ * Both color palette configurations must follow the
223
+ * {@link module:table/tableconfig~TableColorConfig table color configuration format}.
224
+ *
225
+ * Read more about configuring the table feature in {@link module:table/tableconfig~TableConfig}.
226
+ */
227
+ tableCellProperties?: TableCellPropertiesConfig;
228
+ /**
229
+ * Configuration of the table layout feature.
230
+ *
231
+ * ```ts
232
+ * const tableConfig = {
233
+ * tableLayout: ... // Table layout feature config.
234
+ * };
235
+ * ```
236
+ */
237
+ tableLayout?: TableLayoutConfig;
238
+ /**
239
+ * Configuration of the table caption feature.
240
+ *
241
+ * ```ts
242
+ * const tableConfig = {
243
+ * tableCaption: ... // Table caption feature config.
244
+ * };
245
+ * ```
246
+ */
247
+ tableCaption?: TableCaptionConfig;
248
+ /**
249
+ * Configuration of the table scroll feature.
250
+ *
251
+ * ```ts
252
+ * const tableConfig = {
253
+ * tableScroll: ... // Table scroll feature config.
254
+ * };
255
+ * ```
256
+ */
257
+ tableScroll?: TableScrollConfig;
258
+ /**
259
+ * When set to `true` (default), the editor visually displays dashed borders around table elements (`<table>`, `<td>`, `<th>`)
260
+ * that contain inline styles explicitly removing borders (for example: `border: none`, `border-top-style: none`, etc.).
261
+ *
262
+ * This visualization is shown **only in the editing view**.
263
+ * It does not modify the underlying table data or the HTML produced by the editor.
264
+ * When set to `false`, the editor will not render any dashed borders, and elements with `border: none`
265
+ * will remain visually borderless during editing.
266
+ *
267
+ * ```ts
268
+ * const tableConfig = {
269
+ * showHiddenBorders: false
270
+ * };
271
+ * ```
272
+ *
273
+ * @default true
274
+ */
275
+ showHiddenBorders?: boolean;
266
276
  }
267
277
  /**
268
- * The configuration of the table properties user interface (balloon).
269
- */
278
+ * The configuration of the table properties user interface (balloon).
279
+ */
270
280
  export interface TablePropertiesConfig {
271
- /**
272
- * The color palette for the table border color picker.
273
- *
274
- * ```ts
275
- * const tableConfig = {
276
- * tableProperties: {
277
- * borderColors: [
278
- * {
279
- * color: 'hsl(0, 0%, 0%)',
280
- * label: 'Black'
281
- * },
282
- * {
283
- * color: 'hsl(0, 0%, 100%)',
284
- * label: 'White',
285
- * hasBorder: true
286
- * }
287
- * ]
288
- * }
289
- * };
290
- * ```
291
- *
292
- * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
293
- *
294
- * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
295
- *
296
- * @see {@link module:table/tableconfig~TableColorConfig}
297
- */
298
- borderColors?: TableColorConfig;
299
- /**
300
- * The color palette for the table background color picker.
301
- *
302
- * ```ts
303
- * const tableConfig = {
304
- * tableProperties: {
305
- * backgroundColors: [
306
- * {
307
- * color: 'hsl(0, 0%, 100%)',
308
- * label: 'White',
309
- * hasBorder: true
310
- * },
311
- * {
312
- * color: 'hsl(120, 75%, 60%)',
313
- * label: 'Green'
314
- * }
315
- * ]
316
- * }
317
- * };
318
- * ```
319
- *
320
- * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
321
- *
322
- * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
323
- *
324
- * @see {@link module:table/tableconfig~TableColorConfig}
325
- */
326
- backgroundColors?: TableColorConfig;
327
- /**
328
- * Default styles for newly created tables.
329
- *
330
- * ```ts
331
- * const tableConfig = {
332
- * tableProperties: {
333
- * defaultProperties: {
334
- * borderStyle: 'dashed',
335
- * borderColor: 'hsl(0, 0%, 90%)',
336
- * borderWidth: '3px',
337
- * alignment: 'left',
338
- * width: '550px',
339
- * height: '450px'
340
- * }
341
- * }
342
- * }
343
- * ```
344
- *
345
- * **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
346
- *
347
- * See {@link module:table/tableconfig~TablePropertiesOptions} for the full list of properties.
348
- */
349
- defaultProperties?: TablePropertiesOptions;
350
- /**
351
- * Configuration of the table alignment behavior in the editor output.
352
- *
353
- * ```ts
354
- * const tableConfig = {
355
- * tableProperties: {
356
- * alignment: {
357
- * useInlineStyles: true // Use inline styles instead of CSS classes
358
- * }
359
- * }
360
- * };
361
- * ```
362
- */
363
- alignment?: TableAlignmentConfig;
364
- /**
365
- * Configuration of the color picker in the table properties balloon.
366
- *
367
- * If set to `false` the picker will not appear.
368
- */
369
- colorPicker?: false | ColorPickerConfig;
281
+ /**
282
+ * The color palette for the table border color picker.
283
+ *
284
+ * ```ts
285
+ * const tableConfig = {
286
+ * tableProperties: {
287
+ * borderColors: [
288
+ * {
289
+ * color: 'hsl(0, 0%, 0%)',
290
+ * label: 'Black'
291
+ * },
292
+ * {
293
+ * color: 'hsl(0, 0%, 100%)',
294
+ * label: 'White',
295
+ * hasBorder: true
296
+ * }
297
+ * ]
298
+ * }
299
+ * };
300
+ * ```
301
+ *
302
+ * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
303
+ *
304
+ * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
305
+ *
306
+ * @see {@link module:table/tableconfig~TableColorConfig}
307
+ */
308
+ borderColors?: TableColorConfig;
309
+ /**
310
+ * The color palette for the table background color picker.
311
+ *
312
+ * ```ts
313
+ * const tableConfig = {
314
+ * tableProperties: {
315
+ * backgroundColors: [
316
+ * {
317
+ * color: 'hsl(0, 0%, 100%)',
318
+ * label: 'White',
319
+ * hasBorder: true
320
+ * },
321
+ * {
322
+ * color: 'hsl(120, 75%, 60%)',
323
+ * label: 'Green'
324
+ * }
325
+ * ]
326
+ * }
327
+ * };
328
+ * ```
329
+ *
330
+ * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
331
+ *
332
+ * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
333
+ *
334
+ * @see {@link module:table/tableconfig~TableColorConfig}
335
+ */
336
+ backgroundColors?: TableColorConfig;
337
+ /**
338
+ * Default styles for newly created tables.
339
+ *
340
+ * ```ts
341
+ * const tableConfig = {
342
+ * tableProperties: {
343
+ * defaultProperties: {
344
+ * borderStyle: 'dashed',
345
+ * borderColor: 'hsl(0, 0%, 90%)',
346
+ * borderWidth: '3px',
347
+ * alignment: 'left',
348
+ * width: '550px',
349
+ * height: '450px'
350
+ * }
351
+ * }
352
+ * }
353
+ * ```
354
+ *
355
+ * **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
356
+ *
357
+ * See {@link module:table/tableconfig~TablePropertiesOptions} for the full list of properties.
358
+ */
359
+ defaultProperties?: TablePropertiesOptions;
360
+ /**
361
+ * Configuration of the table alignment behavior in the editor output.
362
+ *
363
+ * ```ts
364
+ * const tableConfig = {
365
+ * tableProperties: {
366
+ * alignment: {
367
+ * useInlineStyles: true // Use inline styles instead of CSS classes
368
+ * }
369
+ * }
370
+ * };
371
+ * ```
372
+ */
373
+ alignment?: TableAlignmentConfig;
374
+ /**
375
+ * The number of columns in the `borderColors` and `backgroundColors` palettes of the table properties balloon.
376
+ *
377
+ * ```ts
378
+ * const tableConfig = {
379
+ * tableProperties: {
380
+ * colorGridColumns: 8
381
+ * }
382
+ * };
383
+ * ```
384
+ *
385
+ * Defaults to {@link module:ui/colorgrid/colors~defaultColorGridColumns}.
386
+ */
387
+ colorGridColumns?: number;
388
+ /**
389
+ * Configuration of the color picker in the table properties balloon.
390
+ *
391
+ * If set to `false` the picker will not appear.
392
+ */
393
+ colorPicker?: false | ColorPickerConfig;
370
394
  }
371
395
  /**
372
- * The configuration of the table default properties feature.
373
- */
396
+ * The configuration of the table default properties feature.
397
+ */
374
398
  export interface TablePropertiesOptions {
375
- /**
376
- * The default `width` of the table.
377
- */
378
- width?: string;
379
- /**
380
- * The default `height` of the table.
381
- */
382
- height?: string;
383
- /**
384
- * The default `background-color` of the table.
385
- */
386
- backgroundColor?: string;
387
- /**
388
- * The default `border-color` of the table.
389
- */
390
- borderColor?: string;
391
- /**
392
- * The default `border-width` of the table.
393
- */
394
- borderWidth?: string;
395
- /**
396
- * The default `border-style` of the table.
397
- *
398
- * @default 'none'
399
- */
400
- borderStyle?: string;
401
- /**
402
- * The default `alignment` of the table.
403
- *
404
- * @default 'center'
405
- */
406
- alignment?: string;
399
+ /**
400
+ * The default `width` of the table.
401
+ */
402
+ width?: string;
403
+ /**
404
+ * The default `height` of the table.
405
+ */
406
+ height?: string;
407
+ /**
408
+ * The default `background-color` of the table.
409
+ */
410
+ backgroundColor?: string;
411
+ /**
412
+ * The default `border-color` of the table.
413
+ */
414
+ borderColor?: string;
415
+ /**
416
+ * The default `border-width` of the table.
417
+ */
418
+ borderWidth?: string;
419
+ /**
420
+ * The default `border-style` of the table.
421
+ *
422
+ * @default 'none'
423
+ */
424
+ borderStyle?: string;
425
+ /**
426
+ * The default `alignment` of the table.
427
+ *
428
+ * @default 'center'
429
+ */
430
+ alignment?: string;
407
431
  }
408
432
  /**
409
- * The configuration of the table cell properties user interface (balloon).
410
- */
433
+ * The configuration of the table cell properties user interface (balloon).
434
+ */
411
435
  export interface TableCellPropertiesConfig {
412
- /**
413
- * The color palette for the table cell border color picker.
414
- *
415
- * ```ts
416
- * const tableConfig = {
417
- * tableCellProperties: {
418
- * borderColors: [
419
- * {
420
- * color: 'hsl(0, 0%, 0%)',
421
- * label: 'Black'
422
- * },
423
- * {
424
- * color: 'hsl(0, 0%, 100%)',
425
- * label: 'White',
426
- * hasBorder: true
427
- * }
428
- * ]
429
- * }
430
- * };
431
- * ```
432
- *
433
- * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
434
- *
435
- * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
436
- *
437
- * @see {@link module:table/tableconfig~TableColorConfig}
438
- */
439
- borderColors?: TableColorConfig;
440
- /**
441
- * The color palette for the table cell background color picker.
442
- *
443
- * ```ts
444
- * const tableConfig = {
445
- * tableCellProperties: {
446
- * backgroundColors: [
447
- * {
448
- * color: 'hsl(0, 0%, 100%)',
449
- * label: 'White',
450
- * hasBorder: true
451
- * },
452
- * {
453
- * color: 'hsl(120, 75%, 60%)',
454
- * label: 'Green'
455
- * }
456
- * ]
457
- * }
458
- * };
459
- * ```
460
- *
461
- * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
462
- *
463
- * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
464
- *
465
- * @see {@link module:table/tableconfig~TableColorConfig}
466
- */
467
- backgroundColors?: TableColorConfig;
468
- /**
469
- * Default styles for newly created table cells.
470
- *
471
- * ```ts
472
- * const tableConfig = {
473
- * tableCellProperties: {
474
- * defaultProperties: {
475
- * borderStyle: 'dashed',
476
- * borderColor: 'hsl(0, 0%, 90%)',
477
- * borderWidth: '3px',
478
- * horizontalAlignment: 'center',
479
- * verticalAlignment: 'middle',
480
- * padding: '10px'
481
- * }
482
- * }
483
- * }
484
- * ```
485
- *
486
- * **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
487
- *
488
- * See {@link module:table/tableconfig~TableCellPropertiesOptions} for the full list of properties.
489
- */
490
- defaultProperties?: TableCellPropertiesOptions;
491
- /**
492
- * Configuration of the color picker in the table cell properties balloon.
493
- *
494
- * If set to `false` the picker will not appear.
495
- */
496
- colorPicker?: false | ColorPickerConfig;
497
- /**
498
- * If set to `true`, the `scope` attribute will be applied to table headers (`<th>`) based on their position in the table.
499
- *
500
- * The table cell properties UI will extend a dropdown with two more options that allow manually setting the header scope:
501
- *
502
- * * `Column header` — sets `scope="col"` on `<th>`.
503
- * * `Row header` — sets `scope="row"` on `<th>`.
504
- *
505
- * If header cell is both in a heading row and a heading column, the `col` scope will be prioritized by the header rows
506
- * and columns setting logic. In such case, the user can manually change the scope using the table cell properties UI.
507
- *
508
- * To disable this behavior:
509
- *
510
- * ```ts
511
- * const tableConfig = {
512
- * tableCellProperties: {
513
- * scopedHeaders: false
514
- * }
515
- * };
516
- * ```
517
- *
518
- * @default true
519
- */
520
- scopedHeaders?: boolean;
436
+ /**
437
+ * The color palette for the table cell border color picker.
438
+ *
439
+ * ```ts
440
+ * const tableConfig = {
441
+ * tableCellProperties: {
442
+ * borderColors: [
443
+ * {
444
+ * color: 'hsl(0, 0%, 0%)',
445
+ * label: 'Black'
446
+ * },
447
+ * {
448
+ * color: 'hsl(0, 0%, 100%)',
449
+ * label: 'White',
450
+ * hasBorder: true
451
+ * }
452
+ * ]
453
+ * }
454
+ * };
455
+ * ```
456
+ *
457
+ * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
458
+ *
459
+ * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
460
+ *
461
+ * @see {@link module:table/tableconfig~TableColorConfig}
462
+ */
463
+ borderColors?: TableColorConfig;
464
+ /**
465
+ * The color palette for the table cell background color picker.
466
+ *
467
+ * ```ts
468
+ * const tableConfig = {
469
+ * tableCellProperties: {
470
+ * backgroundColors: [
471
+ * {
472
+ * color: 'hsl(0, 0%, 100%)',
473
+ * label: 'White',
474
+ * hasBorder: true
475
+ * },
476
+ * {
477
+ * color: 'hsl(120, 75%, 60%)',
478
+ * label: 'Green'
479
+ * }
480
+ * ]
481
+ * }
482
+ * };
483
+ * ```
484
+ *
485
+ * **Note**: This configuration only affects the UI. It does not limit or filter the colors in the data.
486
+ *
487
+ * Defaults to {@link module:table/utils/ui/table-properties#defaultColors}.
488
+ *
489
+ * @see {@link module:table/tableconfig~TableColorConfig}
490
+ */
491
+ backgroundColors?: TableColorConfig;
492
+ /**
493
+ * Default styles for newly created table cells.
494
+ *
495
+ * ```ts
496
+ * const tableConfig = {
497
+ * tableCellProperties: {
498
+ * defaultProperties: {
499
+ * borderStyle: 'dashed',
500
+ * borderColor: 'hsl(0, 0%, 90%)',
501
+ * borderWidth: '3px',
502
+ * horizontalAlignment: 'center',
503
+ * verticalAlignment: 'middle',
504
+ * padding: '10px'
505
+ * }
506
+ * }
507
+ * }
508
+ * ```
509
+ *
510
+ * **Note**: The model does not store the default values. The editor will only keep values that differ from the defaults.
511
+ *
512
+ * See {@link module:table/tableconfig~TableCellPropertiesOptions} for the full list of properties.
513
+ */
514
+ defaultProperties?: TableCellPropertiesOptions;
515
+ /**
516
+ * The number of columns in the `borderColors` and `backgroundColors` palettes of the table cell properties balloon.
517
+ *
518
+ * ```ts
519
+ * const tableConfig = {
520
+ * tableCellProperties: {
521
+ * colorGridColumns: 8
522
+ * }
523
+ * };
524
+ * ```
525
+ *
526
+ * Defaults to {@link module:ui/colorgrid/colors~defaultColorGridColumns}.
527
+ */
528
+ colorGridColumns?: number;
529
+ /**
530
+ * Configuration of the color picker in the table cell properties balloon.
531
+ *
532
+ * If set to `false` the picker will not appear.
533
+ */
534
+ colorPicker?: false | ColorPickerConfig;
535
+ /**
536
+ * If set to `true`, the `scope` attribute will be applied to table headers (`<th>`) based on their position in the table.
537
+ *
538
+ * The table cell properties UI will extend a dropdown with two more options that allow manually setting the header scope:
539
+ *
540
+ * * `Column header` — sets `scope="col"` on `<th>`.
541
+ * * `Row header` — sets `scope="row"` on `<th>`.
542
+ *
543
+ * If header cell is both in a heading row and a heading column, the `col` scope will be prioritized by the header rows
544
+ * and columns setting logic. In such case, the user can manually change the scope using the table cell properties UI.
545
+ *
546
+ * To disable this behavior:
547
+ *
548
+ * ```ts
549
+ * const tableConfig = {
550
+ * tableCellProperties: {
551
+ * scopedHeaders: false
552
+ * }
553
+ * };
554
+ * ```
555
+ *
556
+ * @default true
557
+ */
558
+ scopedHeaders?: boolean;
521
559
  }
522
560
  /**
523
- * An array of color definitions (either strings or objects).
524
- *
525
- * ```ts
526
- * const colors = [
527
- * {
528
- * color: 'hsl(0, 0%, 60%)',
529
- * label: 'Grey'
530
- * },
531
- * 'hsl(0, 0%, 80%)',
532
- * {
533
- * color: 'hsl(0, 0%, 90%)',
534
- * label: 'Light grey'
535
- * },
536
- * {
537
- * color: 'hsl(0, 0%, 100%)',
538
- * label: 'White',
539
- * hasBorder: true
540
- * },
541
- * '#FF0000'
542
- * ]
543
- * ```
544
- *
545
- * Usually used as a configuration parameter, for instance in
546
- * {@link module:table/tableconfig~TableConfig#tableProperties `config.table.tableProperties`}
547
- * or {@link module:table/tableconfig~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
548
- */
561
+ * An array of color definitions (either strings or objects).
562
+ *
563
+ * ```ts
564
+ * const colors = [
565
+ * {
566
+ * color: 'hsl(0, 0%, 60%)',
567
+ * label: 'Grey'
568
+ * },
569
+ * 'hsl(0, 0%, 80%)',
570
+ * {
571
+ * color: 'hsl(0, 0%, 90%)',
572
+ * label: 'Light grey'
573
+ * },
574
+ * {
575
+ * color: 'hsl(0, 0%, 100%)',
576
+ * label: 'White',
577
+ * hasBorder: true
578
+ * },
579
+ * '#FF0000'
580
+ * ]
581
+ * ```
582
+ *
583
+ * Usually used as a configuration parameter, for instance in
584
+ * {@link module:table/tableconfig~TableConfig#tableProperties `config.table.tableProperties`}
585
+ * or {@link module:table/tableconfig~TableConfig#tableCellProperties `config.table.tableCellProperties`}.
586
+ */
549
587
  export type TableColorConfig = Array<ColorOption>;
550
588
  /**
551
- * The configuration of the table cell default properties feature.
552
- */
589
+ * The configuration of the table cell default properties feature.
590
+ */
553
591
  export interface TableCellPropertiesOptions {
554
- /**
555
- * The default `width` of the table cell.
556
- */
557
- width?: string;
558
- /**
559
- * The default `height` of the table cell.
560
- */
561
- height?: string;
562
- /**
563
- * The default `padding` of the table cell.
564
- */
565
- padding?: string;
566
- /**
567
- * The default `background-color` of the table cell.
568
- */
569
- backgroundColor?: string;
570
- /**
571
- * The default `border-color` of the table cell.
572
- */
573
- borderColor?: string;
574
- /**
575
- * The default `border-width` of the table cell.
576
- */
577
- borderWidth?: string;
578
- /**
579
- * The default `border-style` of the table cell.
580
- *
581
- * @default 'none'
582
- */
583
- borderStyle?: string;
584
- /**
585
- * The default `horizontalAlignment` of the table cell.
586
- *
587
- * @default 'center'
588
- */
589
- horizontalAlignment?: string;
590
- /**
591
- * The default `verticalAlignment` of the table cell.
592
- *
593
- * @default 'middle'
594
- */
595
- verticalAlignment?: string;
592
+ /**
593
+ * The default `width` of the table cell.
594
+ */
595
+ width?: string;
596
+ /**
597
+ * The default `height` of the table cell.
598
+ */
599
+ height?: string;
600
+ /**
601
+ * The default `padding` of the table cell.
602
+ */
603
+ padding?: string;
604
+ /**
605
+ * The default `background-color` of the table cell.
606
+ */
607
+ backgroundColor?: string;
608
+ /**
609
+ * The default `border-color` of the table cell.
610
+ */
611
+ borderColor?: string;
612
+ /**
613
+ * The default `border-width` of the table cell.
614
+ */
615
+ borderWidth?: string;
616
+ /**
617
+ * The default `border-style` of the table cell.
618
+ *
619
+ * @default 'none'
620
+ */
621
+ borderStyle?: string;
622
+ /**
623
+ * The default `horizontalAlignment` of the table cell.
624
+ *
625
+ * @default 'center'
626
+ */
627
+ horizontalAlignment?: string;
628
+ /**
629
+ * The default `verticalAlignment` of the table cell.
630
+ *
631
+ * @default 'middle'
632
+ */
633
+ verticalAlignment?: string;
596
634
  }
597
635
  /**
598
- * The configuration of the table layout feature.
599
- */
636
+ * The configuration of the table layout feature.
637
+ */
600
638
  export interface TableLayoutConfig {
601
- /**
602
- * Sets the preferred type for loading external tables.
603
- *
604
- * This setting overrides the default detection method and uses the specified type ('content' or 'layout').
605
- *
606
- * ```ts
607
- * ClassicEditor
608
- * .create( {
609
- * table: {
610
- * tableLayout: {
611
- * preferredExternalTableType: 'content' // or 'layout'
612
- * }
613
- * }
614
- * } )
615
- * .then( ... )
616
- * .catch( ... );
617
- * ```
618
- */
619
- preferredExternalTableType: TableType;
620
- /**
621
- * When set to `true`, the editor strips the `<figure>` tag from the table data with the "content" type.
622
- *
623
- * ```ts
624
- * ClassicEditor
625
- * .create( {
626
- * table: {
627
- * tableLayout: {
628
- * stripFigureFromContentTable: true // or false
629
- * }
630
- * }
631
- * } )
632
- * .then( ... )
633
- * .catch( ... );
634
- * ```
635
- *
636
- * @default false
637
- */
638
- stripFigureFromContentTable?: boolean;
639
+ /**
640
+ * Sets the preferred type for loading external tables.
641
+ *
642
+ * This setting overrides the default detection method and uses the specified type ('content' or 'layout').
643
+ *
644
+ * ```ts
645
+ * ClassicEditor
646
+ * .create( {
647
+ * table: {
648
+ * tableLayout: {
649
+ * preferredExternalTableType: 'content' // or 'layout'
650
+ * }
651
+ * }
652
+ * } )
653
+ * .then( ... )
654
+ * .catch( ... );
655
+ * ```
656
+ */
657
+ preferredExternalTableType: TableType;
658
+ /**
659
+ * When set to `true`, the editor strips the `<figure>` tag from the table data with the "content" type.
660
+ *
661
+ * ```ts
662
+ * ClassicEditor
663
+ * .create( {
664
+ * table: {
665
+ * tableLayout: {
666
+ * stripFigureFromContentTable: true // or false
667
+ * }
668
+ * }
669
+ * } )
670
+ * .then( ... )
671
+ * .catch( ... );
672
+ * ```
673
+ *
674
+ * @default false
675
+ */
676
+ stripFigureFromContentTable?: boolean;
639
677
  }
640
678
  /**
641
- * The configuration of the table caption feature.
642
- */
679
+ * The configuration of the table caption feature.
680
+ */
643
681
  export interface TableCaptionConfig {
644
- /**
645
- * Sets the preferred HTML structure for table captions.
646
- *
647
- * When this option is `false` (the default) the structure is like this:
648
- *
649
- * ```html
650
- * <figure class="table">
651
- * <table>
652
- * <tbody> ... </tbody>
653
- * </table>
654
- * <figcaption> ... </figcaption>
655
- * </figure>
656
- * ```
657
- *
658
- * When this option is `true` the structure is like this:
659
- *
660
- * ```html
661
- * <figure class="table">
662
- * <table>
663
- * <tbody> ... </tbody>
664
- * <caption> ... </caption>
665
- * </table>
666
- * </figure>
667
- * ```
668
- *
669
- * ```ts
670
- * ClassicEditor
671
- * .create( {
672
- * table: {
673
- * tableCaption: {
674
- * useCaptionElement: true
675
- * }
676
- * }
677
- * } )
678
- * .then( ... )
679
- * .catch( ... );
680
- * ```
681
- */
682
- useCaptionElement?: boolean;
682
+ /**
683
+ * Sets the preferred HTML structure for table captions.
684
+ *
685
+ * When this option is `false` (the default) the structure is like this:
686
+ *
687
+ * ```html
688
+ * <figure class="table">
689
+ * <table>
690
+ * <tbody> ... </tbody>
691
+ * </table>
692
+ * <figcaption> ... </figcaption>
693
+ * </figure>
694
+ * ```
695
+ *
696
+ * When this option is `true` the structure is like this:
697
+ *
698
+ * ```html
699
+ * <figure class="table">
700
+ * <table>
701
+ * <tbody> ... </tbody>
702
+ * <caption> ... </caption>
703
+ * </table>
704
+ * </figure>
705
+ * ```
706
+ *
707
+ * ```ts
708
+ * ClassicEditor
709
+ * .create( {
710
+ * table: {
711
+ * tableCaption: {
712
+ * useCaptionElement: true
713
+ * }
714
+ * }
715
+ * } )
716
+ * .then( ... )
717
+ * .catch( ... );
718
+ * ```
719
+ */
720
+ useCaptionElement?: boolean;
683
721
  }
684
722
  /**
685
- * The type of the table.
686
- */
687
- export type TableType = 'content' | 'layout';
723
+ * The configuration of the table scroll feature.
724
+ */
725
+ export interface TableScrollConfig {
726
+ /**
727
+ * The list of table types for which a table that is wider than its container is allowed to become
728
+ * horizontally scrollable, and for which the column resize handle is allowed to drag the table's width
729
+ * past 100% of the container width.
730
+ *
731
+ * By default, only `'content'` tables are scrollable. Layout tables are not included by default, since
732
+ * letting a layout table grow past the container width can easily break the intended page layout - to
733
+ * allow it anyway, add `'layout'` to the list:
734
+ *
735
+ * ```ts
736
+ * const tableConfig = {
737
+ * tableScroll: {
738
+ * tableTypes: [ 'content', 'layout' ]
739
+ * }
740
+ * };
741
+ * ```
742
+ *
743
+ * Note that regardless of this setting, only a table that is a direct child of the editing root can become
744
+ * scrollable - a table nested inside another table, a block quote, or any other container never scrolls.
745
+ *
746
+ * @default [ 'content' ]
747
+ */
748
+ tableTypes?: Array<TableType>;
749
+ }
750
+ /**
751
+ * The type of the table.
752
+ */
753
+ export type TableType = "content" | "layout";
688
754
  export interface TableAlignmentConfig {
689
- /**
690
- * Whether to use inline styles for table alignment in the editor output.
691
- *
692
- * * When `true`, the alignment is rendered as inline styles.
693
- * * When `false` (default), the alignment is rendered as CSS classes.
694
- *
695
- * @default false
696
- */
697
- useInlineStyles?: boolean;
755
+ /**
756
+ * Whether to use inline styles for table alignment in the editor output.
757
+ *
758
+ * * When `true`, the alignment is rendered as inline styles.
759
+ * * When `false` (default), the alignment is rendered as CSS classes.
760
+ *
761
+ * @default false
762
+ */
763
+ useInlineStyles?: boolean;
698
764
  }