@ckeditor/ckeditor5-table 44.3.0 → 45.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/table.js +2 -2
  3. package/build/translations/af.js +1 -1
  4. package/build/translations/ar.js +1 -1
  5. package/build/translations/ast.js +1 -1
  6. package/build/translations/az.js +1 -1
  7. package/build/translations/be.js +1 -0
  8. package/build/translations/bg.js +1 -1
  9. package/build/translations/bn.js +1 -1
  10. package/build/translations/bs.js +1 -1
  11. package/build/translations/ca.js +1 -1
  12. package/build/translations/cs.js +1 -1
  13. package/build/translations/da.js +1 -1
  14. package/build/translations/de-ch.js +1 -1
  15. package/build/translations/de.js +1 -1
  16. package/build/translations/el.js +1 -1
  17. package/build/translations/en-au.js +1 -1
  18. package/build/translations/en-gb.js +1 -1
  19. package/build/translations/eo.js +1 -1
  20. package/build/translations/es-co.js +1 -1
  21. package/build/translations/es.js +1 -1
  22. package/build/translations/et.js +1 -1
  23. package/build/translations/eu.js +1 -1
  24. package/build/translations/fa.js +1 -1
  25. package/build/translations/fi.js +1 -1
  26. package/build/translations/fr.js +1 -1
  27. package/build/translations/gl.js +1 -1
  28. package/build/translations/gu.js +1 -1
  29. package/build/translations/he.js +1 -1
  30. package/build/translations/hi.js +1 -1
  31. package/build/translations/hr.js +1 -1
  32. package/build/translations/hu.js +1 -1
  33. package/build/translations/hy.js +1 -1
  34. package/build/translations/id.js +1 -1
  35. package/build/translations/it.js +1 -1
  36. package/build/translations/ja.js +1 -1
  37. package/build/translations/jv.js +1 -1
  38. package/build/translations/kk.js +1 -1
  39. package/build/translations/km.js +1 -1
  40. package/build/translations/kn.js +1 -1
  41. package/build/translations/ko.js +1 -1
  42. package/build/translations/ku.js +1 -1
  43. package/build/translations/lt.js +1 -1
  44. package/build/translations/lv.js +1 -1
  45. package/build/translations/ms.js +1 -1
  46. package/build/translations/nb.js +1 -1
  47. package/build/translations/ne.js +1 -1
  48. package/build/translations/nl.js +1 -1
  49. package/build/translations/no.js +1 -1
  50. package/build/translations/oc.js +1 -1
  51. package/build/translations/pl.js +1 -1
  52. package/build/translations/pt-br.js +1 -1
  53. package/build/translations/pt.js +1 -1
  54. package/build/translations/ro.js +1 -1
  55. package/build/translations/ru.js +1 -1
  56. package/build/translations/si.js +1 -1
  57. package/build/translations/sk.js +1 -1
  58. package/build/translations/sl.js +1 -1
  59. package/build/translations/sq.js +1 -1
  60. package/build/translations/sr-latn.js +1 -1
  61. package/build/translations/sr.js +1 -1
  62. package/build/translations/sv.js +1 -1
  63. package/build/translations/th.js +1 -1
  64. package/build/translations/ti.js +1 -1
  65. package/build/translations/tk.js +1 -1
  66. package/build/translations/tr.js +1 -1
  67. package/build/translations/tt.js +1 -1
  68. package/build/translations/ug.js +1 -1
  69. package/build/translations/uk.js +1 -1
  70. package/build/translations/ur.js +1 -1
  71. package/build/translations/uz.js +1 -1
  72. package/build/translations/vi.js +1 -1
  73. package/build/translations/zh-cn.js +1 -1
  74. package/build/translations/zh.js +1 -1
  75. package/ckeditor5-metadata.json +64 -6
  76. package/dist/index-content.css +50 -25
  77. package/dist/index-editor.css +115 -16
  78. package/dist/index.css +226 -60
  79. package/dist/index.css.map +1 -1
  80. package/dist/index.js +3128 -2275
  81. package/dist/index.js.map +1 -1
  82. package/dist/translations/af.js +1 -1
  83. package/dist/translations/af.umd.js +1 -1
  84. package/dist/translations/ar.js +1 -1
  85. package/dist/translations/ar.umd.js +1 -1
  86. package/dist/translations/ast.js +1 -1
  87. package/dist/translations/ast.umd.js +1 -1
  88. package/dist/translations/az.js +1 -1
  89. package/dist/translations/az.umd.js +1 -1
  90. package/dist/translations/be.d.ts +8 -0
  91. package/dist/translations/be.js +5 -0
  92. package/dist/translations/be.umd.js +11 -0
  93. package/dist/translations/bg.js +1 -1
  94. package/dist/translations/bg.umd.js +1 -1
  95. package/dist/translations/bn.js +1 -1
  96. package/dist/translations/bn.umd.js +1 -1
  97. package/dist/translations/bs.js +1 -1
  98. package/dist/translations/bs.umd.js +1 -1
  99. package/dist/translations/ca.js +1 -1
  100. package/dist/translations/ca.umd.js +1 -1
  101. package/dist/translations/cs.js +1 -1
  102. package/dist/translations/cs.umd.js +1 -1
  103. package/dist/translations/da.js +1 -1
  104. package/dist/translations/da.umd.js +1 -1
  105. package/dist/translations/de-ch.js +1 -1
  106. package/dist/translations/de-ch.umd.js +1 -1
  107. package/dist/translations/de.js +1 -1
  108. package/dist/translations/de.umd.js +1 -1
  109. package/dist/translations/el.js +1 -1
  110. package/dist/translations/el.umd.js +1 -1
  111. package/dist/translations/en-au.js +1 -1
  112. package/dist/translations/en-au.umd.js +1 -1
  113. package/dist/translations/en-gb.js +1 -1
  114. package/dist/translations/en-gb.umd.js +1 -1
  115. package/dist/translations/en.js +1 -1
  116. package/dist/translations/en.umd.js +1 -1
  117. package/dist/translations/eo.js +1 -1
  118. package/dist/translations/eo.umd.js +1 -1
  119. package/dist/translations/es-co.js +1 -1
  120. package/dist/translations/es-co.umd.js +1 -1
  121. package/dist/translations/es.js +1 -1
  122. package/dist/translations/es.umd.js +1 -1
  123. package/dist/translations/et.js +1 -1
  124. package/dist/translations/et.umd.js +1 -1
  125. package/dist/translations/eu.js +1 -1
  126. package/dist/translations/eu.umd.js +1 -1
  127. package/dist/translations/fa.js +1 -1
  128. package/dist/translations/fa.umd.js +1 -1
  129. package/dist/translations/fi.js +1 -1
  130. package/dist/translations/fi.umd.js +1 -1
  131. package/dist/translations/fr.js +1 -1
  132. package/dist/translations/fr.umd.js +1 -1
  133. package/dist/translations/gl.js +1 -1
  134. package/dist/translations/gl.umd.js +1 -1
  135. package/dist/translations/gu.js +1 -1
  136. package/dist/translations/gu.umd.js +1 -1
  137. package/dist/translations/he.js +1 -1
  138. package/dist/translations/he.umd.js +1 -1
  139. package/dist/translations/hi.js +1 -1
  140. package/dist/translations/hi.umd.js +1 -1
  141. package/dist/translations/hr.js +1 -1
  142. package/dist/translations/hr.umd.js +1 -1
  143. package/dist/translations/hu.js +1 -1
  144. package/dist/translations/hu.umd.js +1 -1
  145. package/dist/translations/hy.js +1 -1
  146. package/dist/translations/hy.umd.js +1 -1
  147. package/dist/translations/id.js +1 -1
  148. package/dist/translations/id.umd.js +1 -1
  149. package/dist/translations/it.js +1 -1
  150. package/dist/translations/it.umd.js +1 -1
  151. package/dist/translations/ja.js +1 -1
  152. package/dist/translations/ja.umd.js +1 -1
  153. package/dist/translations/jv.js +1 -1
  154. package/dist/translations/jv.umd.js +1 -1
  155. package/dist/translations/kk.js +1 -1
  156. package/dist/translations/kk.umd.js +1 -1
  157. package/dist/translations/km.js +1 -1
  158. package/dist/translations/km.umd.js +1 -1
  159. package/dist/translations/kn.js +1 -1
  160. package/dist/translations/kn.umd.js +1 -1
  161. package/dist/translations/ko.js +1 -1
  162. package/dist/translations/ko.umd.js +1 -1
  163. package/dist/translations/ku.js +1 -1
  164. package/dist/translations/ku.umd.js +1 -1
  165. package/dist/translations/lt.js +1 -1
  166. package/dist/translations/lt.umd.js +1 -1
  167. package/dist/translations/lv.js +1 -1
  168. package/dist/translations/lv.umd.js +1 -1
  169. package/dist/translations/ms.js +1 -1
  170. package/dist/translations/ms.umd.js +1 -1
  171. package/dist/translations/nb.js +1 -1
  172. package/dist/translations/nb.umd.js +1 -1
  173. package/dist/translations/ne.js +1 -1
  174. package/dist/translations/ne.umd.js +1 -1
  175. package/dist/translations/nl.js +1 -1
  176. package/dist/translations/nl.umd.js +1 -1
  177. package/dist/translations/no.js +1 -1
  178. package/dist/translations/no.umd.js +1 -1
  179. package/dist/translations/oc.js +1 -1
  180. package/dist/translations/oc.umd.js +1 -1
  181. package/dist/translations/pl.js +1 -1
  182. package/dist/translations/pl.umd.js +1 -1
  183. package/dist/translations/pt-br.js +1 -1
  184. package/dist/translations/pt-br.umd.js +1 -1
  185. package/dist/translations/pt.js +1 -1
  186. package/dist/translations/pt.umd.js +1 -1
  187. package/dist/translations/ro.js +1 -1
  188. package/dist/translations/ro.umd.js +1 -1
  189. package/dist/translations/ru.js +1 -1
  190. package/dist/translations/ru.umd.js +1 -1
  191. package/dist/translations/si.js +1 -1
  192. package/dist/translations/si.umd.js +1 -1
  193. package/dist/translations/sk.js +1 -1
  194. package/dist/translations/sk.umd.js +1 -1
  195. package/dist/translations/sl.js +1 -1
  196. package/dist/translations/sl.umd.js +1 -1
  197. package/dist/translations/sq.js +1 -1
  198. package/dist/translations/sq.umd.js +1 -1
  199. package/dist/translations/sr-latn.js +1 -1
  200. package/dist/translations/sr-latn.umd.js +1 -1
  201. package/dist/translations/sr.js +1 -1
  202. package/dist/translations/sr.umd.js +1 -1
  203. package/dist/translations/sv.js +1 -1
  204. package/dist/translations/sv.umd.js +1 -1
  205. package/dist/translations/th.js +1 -1
  206. package/dist/translations/th.umd.js +1 -1
  207. package/dist/translations/ti.js +1 -1
  208. package/dist/translations/ti.umd.js +1 -1
  209. package/dist/translations/tk.js +1 -1
  210. package/dist/translations/tk.umd.js +1 -1
  211. package/dist/translations/tr.js +1 -1
  212. package/dist/translations/tr.umd.js +1 -1
  213. package/dist/translations/tt.js +1 -1
  214. package/dist/translations/tt.umd.js +1 -1
  215. package/dist/translations/ug.js +1 -1
  216. package/dist/translations/ug.umd.js +1 -1
  217. package/dist/translations/uk.js +1 -1
  218. package/dist/translations/uk.umd.js +1 -1
  219. package/dist/translations/ur.js +1 -1
  220. package/dist/translations/ur.umd.js +1 -1
  221. package/dist/translations/uz.js +1 -1
  222. package/dist/translations/uz.umd.js +1 -1
  223. package/dist/translations/vi.js +1 -1
  224. package/dist/translations/vi.umd.js +1 -1
  225. package/dist/translations/zh-cn.js +1 -1
  226. package/dist/translations/zh-cn.umd.js +1 -1
  227. package/dist/translations/zh.js +1 -1
  228. package/dist/translations/zh.umd.js +1 -1
  229. package/lang/contexts.json +8 -1
  230. package/lang/translations/af.po +28 -0
  231. package/lang/translations/ar.po +28 -0
  232. package/lang/translations/ast.po +28 -0
  233. package/lang/translations/az.po +28 -0
  234. package/lang/translations/be.po +296 -0
  235. package/lang/translations/bg.po +28 -0
  236. package/lang/translations/bn.po +28 -0
  237. package/lang/translations/bs.po +28 -0
  238. package/lang/translations/ca.po +28 -0
  239. package/lang/translations/cs.po +28 -0
  240. package/lang/translations/da.po +28 -0
  241. package/lang/translations/de-ch.po +28 -0
  242. package/lang/translations/de.po +28 -0
  243. package/lang/translations/el.po +28 -0
  244. package/lang/translations/en-au.po +28 -0
  245. package/lang/translations/en-gb.po +28 -0
  246. package/lang/translations/en.po +28 -0
  247. package/lang/translations/eo.po +28 -0
  248. package/lang/translations/es-co.po +28 -0
  249. package/lang/translations/es.po +28 -0
  250. package/lang/translations/et.po +28 -0
  251. package/lang/translations/eu.po +28 -0
  252. package/lang/translations/fa.po +28 -0
  253. package/lang/translations/fi.po +28 -0
  254. package/lang/translations/fr.po +28 -0
  255. package/lang/translations/gl.po +28 -0
  256. package/lang/translations/gu.po +28 -0
  257. package/lang/translations/he.po +28 -0
  258. package/lang/translations/hi.po +28 -0
  259. package/lang/translations/hr.po +28 -0
  260. package/lang/translations/hu.po +28 -0
  261. package/lang/translations/hy.po +28 -0
  262. package/lang/translations/id.po +28 -0
  263. package/lang/translations/it.po +28 -0
  264. package/lang/translations/ja.po +28 -0
  265. package/lang/translations/jv.po +28 -0
  266. package/lang/translations/kk.po +28 -0
  267. package/lang/translations/km.po +28 -0
  268. package/lang/translations/kn.po +28 -0
  269. package/lang/translations/ko.po +28 -0
  270. package/lang/translations/ku.po +28 -0
  271. package/lang/translations/lt.po +28 -0
  272. package/lang/translations/lv.po +28 -0
  273. package/lang/translations/ms.po +28 -0
  274. package/lang/translations/nb.po +28 -0
  275. package/lang/translations/ne.po +28 -0
  276. package/lang/translations/nl.po +28 -0
  277. package/lang/translations/no.po +28 -0
  278. package/lang/translations/oc.po +28 -0
  279. package/lang/translations/pl.po +28 -0
  280. package/lang/translations/pt-br.po +28 -0
  281. package/lang/translations/pt.po +28 -0
  282. package/lang/translations/ro.po +28 -0
  283. package/lang/translations/ru.po +28 -0
  284. package/lang/translations/si.po +28 -0
  285. package/lang/translations/sk.po +28 -0
  286. package/lang/translations/sl.po +28 -0
  287. package/lang/translations/sq.po +28 -0
  288. package/lang/translations/sr-latn.po +28 -0
  289. package/lang/translations/sr.po +28 -0
  290. package/lang/translations/sv.po +28 -0
  291. package/lang/translations/th.po +28 -0
  292. package/lang/translations/ti.po +28 -0
  293. package/lang/translations/tk.po +28 -0
  294. package/lang/translations/tr.po +28 -0
  295. package/lang/translations/tt.po +28 -0
  296. package/lang/translations/ug.po +28 -0
  297. package/lang/translations/uk.po +28 -0
  298. package/lang/translations/ur.po +28 -0
  299. package/lang/translations/uz.po +28 -0
  300. package/lang/translations/vi.po +28 -0
  301. package/lang/translations/zh-cn.po +28 -0
  302. package/lang/translations/zh.po +28 -0
  303. package/package.json +10 -9
  304. package/src/augmentation.d.ts +5 -1
  305. package/src/commands/insertcolumncommand.js +4 -0
  306. package/src/commands/insertrowcommand.js +4 -0
  307. package/src/commands/inserttablelayoutcommand.d.ts +39 -0
  308. package/src/commands/inserttablelayoutcommand.js +65 -0
  309. package/src/commands/mergecellcommand.js +8 -0
  310. package/src/commands/setheadercolumncommand.js +9 -4
  311. package/src/commands/setheaderrowcommand.js +8 -3
  312. package/src/commands/splitcellcommand.js +4 -0
  313. package/src/converters/downcast.js +1 -1
  314. package/src/converters/tableproperties.js +25 -5
  315. package/src/index.d.ts +4 -0
  316. package/src/index.js +2 -0
  317. package/src/plaintableoutput.d.ts +3 -0
  318. package/src/plaintableoutput.js +12 -1
  319. package/src/tablecaption/tablecaptionediting.js +7 -0
  320. package/src/tablecaption/tablecaptionui.js +3 -2
  321. package/src/tablecaption/toggletablecaptioncommand.js +1 -1
  322. package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +11 -1
  323. package/src/tablecellproperties/commands/tablecellpropertycommand.js +40 -2
  324. package/src/tablecellproperties/tablecellpropertiesediting.js +50 -9
  325. package/src/tablecellproperties/tablecellpropertiesui.d.ts +13 -1
  326. package/src/tablecellproperties/tablecellpropertiesui.js +60 -11
  327. package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +2 -1
  328. package/src/tablecellproperties/ui/tablecellpropertiesview.js +82 -13
  329. package/src/tableclipboard.d.ts +9 -0
  330. package/src/tableclipboard.js +28 -1
  331. package/src/tablecolumnresize/constants.d.ts +4 -0
  332. package/src/tablecolumnresize/constants.js +4 -0
  333. package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +8 -0
  334. package/src/tablecolumnresize/tablecolumnresizeediting.js +50 -10
  335. package/src/tableconfig.d.ts +38 -0
  336. package/src/tableediting.js +4 -0
  337. package/src/tablelayout/commands/tabletypecommand.d.ts +43 -0
  338. package/src/tablelayout/commands/tabletypecommand.js +68 -0
  339. package/src/tablelayout/tablelayoutediting.d.ts +54 -0
  340. package/src/tablelayout/tablelayoutediting.js +276 -0
  341. package/src/tablelayout/tablelayoutui.d.ts +32 -0
  342. package/src/tablelayout/tablelayoutui.js +189 -0
  343. package/src/tablelayout.d.ts +31 -0
  344. package/src/tablelayout.js +37 -0
  345. package/src/tablemouse/mouseeventsobserver.js +3 -6
  346. package/src/tableproperties/commands/tablepropertycommand.d.ts +11 -1
  347. package/src/tableproperties/commands/tablepropertycommand.js +23 -1
  348. package/src/tableproperties/tablepropertiesediting.js +49 -11
  349. package/src/tableproperties/tablepropertiesui.d.ts +21 -3
  350. package/src/tableproperties/tablepropertiesui.js +73 -26
  351. package/src/tableproperties/ui/tablepropertiesview.d.ts +4 -3
  352. package/src/tableproperties/ui/tablepropertiesview.js +70 -9
  353. package/src/tableselection.js +19 -1
  354. package/src/tableui.js +7 -9
  355. package/src/tablewalker.js +99 -4
  356. package/src/ui/colorinputview.js +34 -0
  357. package/src/ui/inserttableview.js +12 -0
  358. package/src/utils/structure.js +7 -1
  359. package/src/utils/table-properties.d.ts +3 -3
  360. package/src/utils/table-properties.js +1 -1
  361. package/src/utils/ui/table-properties.js +7 -1
  362. package/theme/formrow.css +0 -10
  363. package/theme/table.css +52 -35
  364. package/theme/tablecolumnresize.css +5 -0
  365. package/theme/tableform.css +6 -0
  366. package/theme/tablelayout.css +62 -0
  367. package/src/ui/formrowview.d.ts +0 -61
  368. package/src/ui/formrowview.js +0 -57
  369. package/theme/form.css +0 -11
  370. package/theme/icons/table-cell-properties.svg +0 -1
  371. package/theme/icons/table-column.svg +0 -1
  372. package/theme/icons/table-merge-cell.svg +0 -1
  373. package/theme/icons/table-properties.svg +0 -1
  374. package/theme/icons/table-row.svg +0 -1
package/src/tableui.js CHANGED
@@ -5,13 +5,11 @@
5
5
  /**
6
6
  * @module table/tableui
7
7
  */
8
- import { icons, Plugin } from 'ckeditor5/src/core.js';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { IconTable, IconTableColumn, IconTableRow, IconTableMergeCell } from 'ckeditor5/src/icons.js';
9
10
  import { addListToDropdown, createDropdown, ViewModel, SplitButtonView, SwitchButtonView, MenuBarMenuView } from 'ckeditor5/src/ui.js';
10
11
  import { Collection } from 'ckeditor5/src/utils.js';
11
12
  import InsertTableView from './ui/inserttableview.js';
12
- import tableColumnIcon from './../theme/icons/table-column.svg';
13
- import tableRowIcon from './../theme/icons/table-row.svg';
14
- import tableMergeCellIcon from './../theme/icons/table-merge-cell.svg';
15
13
  /**
16
14
  * The table UI plugin. It introduces:
17
15
  *
@@ -50,7 +48,7 @@ export default class TableUI extends Plugin {
50
48
  dropdownView.bind('isEnabled').to(command);
51
49
  // Decorate dropdown's button.
52
50
  dropdownView.buttonView.set({
53
- icon: icons.table,
51
+ icon: IconTable,
54
52
  label: t('Insert table'),
55
53
  tooltip: true
56
54
  });
@@ -86,7 +84,7 @@ export default class TableUI extends Plugin {
86
84
  });
87
85
  menuView.buttonView.set({
88
86
  label: t('Table'),
89
- icon: icons.table
87
+ icon: IconTable
90
88
  });
91
89
  menuView.panelView.children.add(insertTableView);
92
90
  menuView.bind('isEnabled').to(command);
@@ -132,7 +130,7 @@ export default class TableUI extends Plugin {
132
130
  }
133
131
  }
134
132
  ];
135
- return this._prepareDropdown(t('Column'), tableColumnIcon, options, locale);
133
+ return this._prepareDropdown(t('Column'), IconTableColumn, options, locale);
136
134
  });
137
135
  editor.ui.componentFactory.add('tableRow', locale => {
138
136
  const options = [
@@ -174,7 +172,7 @@ export default class TableUI extends Plugin {
174
172
  }
175
173
  }
176
174
  ];
177
- return this._prepareDropdown(t('Row'), tableRowIcon, options, locale);
175
+ return this._prepareDropdown(t('Row'), IconTableRow, options, locale);
178
176
  });
179
177
  editor.ui.componentFactory.add('mergeTableCells', locale => {
180
178
  const options = [
@@ -222,7 +220,7 @@ export default class TableUI extends Plugin {
222
220
  }
223
221
  }
224
222
  ];
225
- return this._prepareMergeSplitButtonDropdown(t('Merge cells'), tableMergeCellIcon, options, locale);
223
+ return this._prepareMergeSplitButtonDropdown(t('Merge cells'), IconTableMergeCell, options, locale);
226
224
  });
227
225
  }
228
226
  /**
@@ -7,6 +7,73 @@
7
7
  * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
8
8
  */
9
9
  export default class TableWalker {
10
+ /**
11
+ * The walker's table element.
12
+ *
13
+ * @internal
14
+ */
15
+ _table;
16
+ /**
17
+ * A row index from which this iterator will start.
18
+ */
19
+ _startRow;
20
+ /**
21
+ * A row index at which this iterator will end.
22
+ */
23
+ _endRow;
24
+ /**
25
+ * If set, the table walker will only output cells from a given column and following ones or cells that overlap them.
26
+ */
27
+ _startColumn;
28
+ /**
29
+ * If set, the table walker will only output cells up to a given column.
30
+ */
31
+ _endColumn;
32
+ /**
33
+ * Enables output of spanned cells that are normally not yielded.
34
+ */
35
+ _includeAllSlots;
36
+ /**
37
+ * Row indexes to skip from the iteration.
38
+ */
39
+ _skipRows;
40
+ /**
41
+ * The current row index.
42
+ *
43
+ * @internal
44
+ */
45
+ _row;
46
+ /**
47
+ * The index of the current row element in the table.
48
+ *
49
+ * @internal
50
+ */
51
+ _rowIndex;
52
+ /**
53
+ * The current column index.
54
+ *
55
+ * @internal
56
+ */
57
+ _column;
58
+ /**
59
+ * The cell index in a parent row. For spanned cells when {@link #_includeAllSlots} is set to `true`,
60
+ * this represents the index of the next table cell.
61
+ *
62
+ * @internal
63
+ */
64
+ _cellIndex;
65
+ /**
66
+ * Holds a map of spanned cells in a table.
67
+ */
68
+ _spannedCells;
69
+ /**
70
+ * Index of the next column where a cell is anchored.
71
+ */
72
+ _nextCellAtColumn;
73
+ /**
74
+ * Indicates whether the iterator jumped to (or close to) the start row, ignoring rows that don't need to be traversed.
75
+ */
76
+ _jumpedToStartRow = false;
10
77
  /**
11
78
  * Creates an instance of the table walker.
12
79
  *
@@ -84,10 +151,6 @@ export default class TableWalker {
84
151
  * @param options.includeAllSlots Also return values for spanned cells. Default value is "false".
85
152
  */
86
153
  constructor(table, options = {}) {
87
- /**
88
- * Indicates whether the iterator jumped to (or close to) the start row, ignoring rows that don't need to be traversed.
89
- */
90
- this._jumpedToStartRow = false;
91
154
  this._table = table;
92
155
  this._startRow = options.row !== undefined ? options.row : options.startRow || 0;
93
156
  this._endRow = options.row !== undefined ? options.row : options.endRow;
@@ -324,6 +387,38 @@ export default class TableWalker {
324
387
  * An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.
325
388
  */
326
389
  class TableSlot {
390
+ /**
391
+ * The current table cell.
392
+ */
393
+ cell;
394
+ /**
395
+ * The row index of a table slot.
396
+ */
397
+ row;
398
+ /**
399
+ * The column index of a table slot.
400
+ */
401
+ column;
402
+ /**
403
+ * The row index of a cell anchor slot.
404
+ */
405
+ cellAnchorRow;
406
+ /**
407
+ * The column index of a cell anchor slot.
408
+ */
409
+ cellAnchorColumn;
410
+ /**
411
+ * The index of the current cell in the parent row.
412
+ */
413
+ _cellIndex;
414
+ /**
415
+ * The index of the current row element in the table.
416
+ */
417
+ _rowIndex;
418
+ /**
419
+ * The table element.
420
+ */
421
+ _table;
327
422
  /**
328
423
  * Creates an instance of the table walker value.
329
424
  *
@@ -15,6 +15,40 @@ import '../../theme/colorinput.css';
15
15
  * @internal
16
16
  */
17
17
  export default class ColorInputView extends View {
18
+ /**
19
+ * A cached reference to the options passed to the constructor.
20
+ */
21
+ options;
22
+ /**
23
+ * Tracks information about the DOM focus in the view.
24
+ */
25
+ focusTracker;
26
+ /**
27
+ * Helps cycling over focusable children in the input view.
28
+ */
29
+ focusCycler;
30
+ /**
31
+ * A collection of views that can be focused in the view.
32
+ */
33
+ _focusables;
34
+ /**
35
+ * An instance of the dropdown allowing to select a color from a grid.
36
+ */
37
+ dropdownView;
38
+ /**
39
+ * An instance of the input allowing the user to type a color value.
40
+ */
41
+ inputView;
42
+ /**
43
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
44
+ */
45
+ keystrokes;
46
+ /**
47
+ * The flag that indicates whether the user is still typing.
48
+ * If set to true, it means that the text input field ({@link #inputView}) still has the focus.
49
+ * So, we should interrupt the user by replacing the input's value.
50
+ */
51
+ _stillTyping;
18
52
  /**
19
53
  * Creates an instance of the color input view.
20
54
  *
@@ -14,6 +14,18 @@ import './../../theme/inserttable.css';
14
14
  * It renders a 10x10 grid to choose the inserted table size.
15
15
  */
16
16
  export default class InsertTableView extends View {
17
+ /**
18
+ * A collection of table size box items.
19
+ */
20
+ items;
21
+ /**
22
+ * Listen to `keydown` events fired in this view's main element.
23
+ */
24
+ keystrokes;
25
+ /**
26
+ * Tracks information about the DOM focus in the grid.
27
+ */
28
+ focusTracker;
17
29
  /**
18
30
  * @inheritDoc
19
31
  */
@@ -35,8 +35,14 @@ import { createEmptyTableCell, updateNumericAttribute } from './common.js';
35
35
  */
36
36
  export function cropTableToDimensions(sourceTable, cropDimensions, writer) {
37
37
  const { startRow, startColumn, endRow, endColumn } = cropDimensions;
38
- // Create empty table with empty rows equal to crop height.
38
+ // Initialize the cropped table element.
39
39
  const croppedTable = writer.createElement('table');
40
+ // Copy table type attribute if present.
41
+ const sourceTableType = sourceTable.getAttribute('tableType');
42
+ if (sourceTableType) {
43
+ writer.setAttribute('tableType', sourceTableType, croppedTable);
44
+ }
45
+ // Create empty table with empty rows equal to crop height.
40
46
  const cropHeight = endRow - startRow + 1;
41
47
  for (let i = 0; i < cropHeight; i++) {
42
48
  writer.insertElement('tableRow', croppedTable, 'end');
@@ -80,18 +80,18 @@ export type NormalizeTableDefaultPropertiesOptions = {
80
80
  * @param config The configuration to normalize.
81
81
  * @param options Options used to determine which properties should be added.
82
82
  */
83
- export declare function getNormalizedDefaultProperties(config: Partial<NormalizedDefaultProperties> | undefined, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
83
+ export declare function getNormalizedDefaultProperties(config?: Partial<NormalizedDefaultProperties>, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
84
84
  /**
85
85
  * Returns the normalized default table properties.
86
86
  *
87
87
  * @param config The configuration to normalize.
88
88
  * @param options Options used to determine which properties should be added.
89
89
  */
90
- export declare function getNormalizedDefaultTableProperties(config: Partial<NormalizedDefaultProperties> | undefined, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
90
+ export declare function getNormalizedDefaultTableProperties(config?: Partial<NormalizedDefaultProperties>, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
91
91
  /**
92
92
  * Returns the normalized default cell properties.
93
93
  *
94
94
  * @param config The configuration to normalize.
95
95
  * @param options Options used to determine which properties should be added.
96
96
  */
97
- export declare function getNormalizedDefaultCellProperties(config: Partial<NormalizedDefaultProperties> | undefined, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
97
+ export declare function getNormalizedDefaultCellProperties(config?: Partial<NormalizedDefaultProperties>, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
@@ -2,7 +2,7 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import { isObject } from 'lodash-es';
5
+ import { isObject } from 'es-toolkit/compat';
6
6
  /**
7
7
  * Returns a string if all four values of box sides are equal.
8
8
  *
@@ -146,7 +146,13 @@ export function fillToolbar(options) {
146
146
  return buttonValue === valueToCompare;
147
147
  });
148
148
  button.on('execute', () => {
149
- view[propertyName] = buttonValue;
149
+ // Allow toggling alignment if there is no default value specified (especially for layout tables).
150
+ if (!defaultValue && buttonValue && view[propertyName] === buttonValue) {
151
+ view[propertyName] = undefined;
152
+ }
153
+ else {
154
+ view[propertyName] = buttonValue;
155
+ }
150
156
  });
151
157
  toolbar.items.add(button);
152
158
  }
package/theme/formrow.css CHANGED
@@ -4,16 +4,6 @@
4
4
  */
5
5
 
6
6
  .ck.ck-form__row {
7
- display: flex;
8
- flex-direction: row;
9
- flex-wrap: nowrap;
10
- justify-content: space-between;
11
-
12
- /* Ignore labels that work as fieldset legends */
13
- & > *:not(.ck-label) {
14
- flex-grow: 1;
15
- }
16
-
17
7
  &.ck-table-form__action-row {
18
8
  & .ck-button-save,
19
9
  & .ck-button-cancel {
package/theme/table.css CHANGED
@@ -3,41 +3,68 @@
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
5
 
6
- .ck-content .table {
7
- /* Give the table widget some air and center it horizontally */
8
- /* The first value should be equal to --ck-spacing-large variable if used in the editor context
9
- to avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */
10
- margin: 0.9em auto;
11
- display: table;
6
+ .ck-content {
7
+ /* Text alignment of the table header should match the editor settings and override the native browser styling,
8
+ when content is available outside the editor. See https://github.com/ckeditor/ckeditor5/issues/6638 */
9
+ &[dir="rtl"] .table th {
10
+ text-align: right;
11
+ }
12
+
13
+ &[dir="ltr"] .table th {
14
+ text-align: left;
15
+ }
16
+
17
+ & figure.table:not(.layout-table) {
18
+ display: table;
12
19
 
13
- & table {
20
+ & > table {
21
+ width: 100%;
22
+ height: 100%;
23
+ }
24
+ }
25
+
26
+ & figure.table:not(.layout-table),
27
+ & table.table:not(.layout-table) {
28
+ /* Give the table widget some air and center it horizontally */
29
+ /* The first value should be equal to --ck-spacing-large variable if used in the editor context
30
+ to avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */
31
+ margin: 0.9em auto;
32
+ }
33
+
34
+ & table.table:not(.layout-table),
35
+ & figure.table:not(.layout-table) > table {
14
36
  /* The table cells should have slight borders */
15
37
  border-collapse: collapse;
16
38
  border-spacing: 0;
17
39
 
18
- /* Table width and height are set on the parent <figure>. Make sure the table inside stretches
19
- to the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */
20
- width: 100%;
21
- height: 100%;
22
-
23
40
  /* The outer border of the table should be slightly darker than the inner lines.
24
41
  Also see https://github.com/ckeditor/ckeditor5-table/issues/50. */
25
42
  border: 1px double hsl(0, 0%, 70%);
26
43
 
27
- & td,
28
- & th {
29
- min-width: 2em;
30
- padding: .4em;
44
+ & > thead,
45
+ & > tbody {
46
+ /* The linter is disabled here because linter is confused when resolving the `table.table:not(.layout-table)`
47
+ and `figure.table:not(.layout-table) > table` selectors combined with below selectors.
48
+ There is no need to split it into two large structures with same code just to make linter happy. */
49
+ /* stylelint-disable no-descending-specificity */
50
+ & > tr {
51
+ & > th {
52
+ font-weight: bold;
53
+ background: hsla(0, 0%, 0%, 5%);
54
+ }
31
55
 
32
- /* The border is inherited from .ck-editor__nested-editable styles, so theoretically it's not necessary here.
33
- However, the border is a content style, so it should use .ck-content (so it works outside the editor).
34
- Hence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */
35
- border: 1px solid hsl(0, 0%, 75%);
36
- }
56
+ & > td,
57
+ & > th {
58
+ /* stylelint-enable no-descending-specificity */
59
+ min-width: 2em;
60
+ padding: .4em;
37
61
 
38
- & th {
39
- font-weight: bold;
40
- background: hsla(0, 0%, 0%, 5%);
62
+ /* The border is inherited from .ck-editor__nested-editable styles, so theoretically it's not necessary here.
63
+ However, the border is a content style, so it should use .ck-content (so it works outside the editor).
64
+ Hence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */
65
+ border: 1px solid hsl(0, 0%, 75%);
66
+ }
67
+ }
41
68
  }
42
69
  }
43
70
  }
@@ -54,21 +81,11 @@
54
81
  * For now, resetting the height to `initial` in the print mode works as a workaround.
55
82
  */
56
83
  @media print {
57
- .ck-content .table table {
84
+ .ck-content figure.table > table {
58
85
  height: initial;
59
86
  }
60
87
  }
61
88
 
62
- /* Text alignment of the table header should match the editor settings and override the native browser styling,
63
- when content is available outside the editor. See https://github.com/ckeditor/ckeditor5/issues/6638 */
64
- .ck-content[dir="rtl"] .table th {
65
- text-align: right;
66
- }
67
-
68
- .ck-content[dir="ltr"] .table th {
69
- text-align: left;
70
- }
71
-
72
89
  .ck-editor__editable .ck-table-bogus-paragraph {
73
90
  /*
74
91
  * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.
@@ -25,6 +25,11 @@
25
25
  /* To prevent text overflowing beyond its cell when columns are resized by resize handler
26
26
  (https://github.com/ckeditor/ckeditor5/pull/14379#issuecomment-1589460978). */
27
27
  overflow-wrap: break-word;
28
+ }
29
+
30
+ .ck.ck-editor__editable .table td,
31
+ .ck.ck-editor__editable .table th {
32
+ /* The resizer element is placed inside each cell, so it must be positioned relatively to the cell. */
28
33
  position: relative;
29
34
  }
30
35
 
@@ -31,6 +31,12 @@
31
31
  flex-grow: 0;
32
32
  }
33
33
  }
34
+
35
+ /* Ignore labels that work as fieldset legends */
36
+ /* Fallback for table dimension operator */
37
+ & > *:not(.ck-label, .ck-table-form__dimension-operator) {
38
+ flex-grow: 1;
39
+ }
34
40
  }
35
41
 
36
42
  & .ck.ck-labeled-field-view {
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Copyright (c) 2003-2025, 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
+
6
+ .ck-editor__editable {
7
+ &.ck-editor__editable_inline {
8
+ & > .ck-widget.ck-widget_with-selection-handle.layout-table {
9
+ &:first-child {
10
+ margin-top: var(--ck-spacing-large);
11
+ }
12
+ /*
13
+ * This value should match with the default margins of the block elements (like .media, .image or .table)
14
+ * to avoid a content jumping when the fake selection container shows up (See https://github.com/ckeditor/ckeditor5/issues/9825).
15
+ */
16
+ &:last-child,
17
+ /* Fallback for hidden fake selection div */
18
+ &:nth-last-child(2):has( + .ck-fake-selection-container) {
19
+ margin-bottom: var(--ck-spacing-large);
20
+ }
21
+ }
22
+ }
23
+
24
+ & .table.layout-table {
25
+ display: table;
26
+ margin: 0;
27
+
28
+ /* Widget type around overrides. */
29
+ &.ck-widget {
30
+ &:hover > .ck-widget__selection-handle {
31
+ opacity: 0.75;
32
+ visibility: visible;
33
+
34
+ &:hover {
35
+ opacity: 1;
36
+ }
37
+ }
38
+
39
+ /* Because of setting the opacity to 0.75 to the selection handle for the layout table,
40
+ it overrides the similar selector in widget (specificity is higher),
41
+ thats why we must override it here also. */
42
+ &:has( .ck-widget:hover ) > .ck-widget__selection-handle {
43
+ opacity: 0;
44
+ visibility: hidden;
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ .ck-content {
51
+ & table.table.layout-table,
52
+ & figure.table.layout-table {
53
+ /* Do not reserve space above and below the layout table. */
54
+ margin-top: 0;
55
+ margin-bottom: 0;
56
+ }
57
+
58
+ & table.table.layout-table,
59
+ & figure.table.layout-table > table {
60
+ border-spacing: 0;
61
+ }
62
+ }
@@ -1,61 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2025, 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
- /**
6
- * @module table/ui/formrowview
7
- */
8
- import { View, type LabelView, type ViewCollection } from 'ckeditor5/src/ui.js';
9
- import type { Locale } from 'ckeditor5/src/utils.js';
10
- import '../../theme/formrow.css';
11
- /**
12
- * The class representing a single row in a complex form,
13
- * used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.
14
- *
15
- * **Note**: For now this class is private. When more use cases arrive (beyond ckeditor5-table),
16
- * it will become a component in ckeditor5-ui.
17
- *
18
- * @internal
19
- */
20
- export default class FormRowView extends View {
21
- /**
22
- * An additional CSS class added to the {@link #element}.
23
- *
24
- * @observable
25
- */
26
- class: string | null;
27
- /**
28
- * A collection of row items (buttons, dropdowns, etc.).
29
- */
30
- readonly children: ViewCollection;
31
- /**
32
- * The role property reflected by the `role` DOM attribute of the {@link #element}.
33
- *
34
- * **Note**: Used only when a `labelView` is passed to constructor `options`.
35
- *
36
- * @observable
37
- * @internal
38
- */
39
- _role: string | null;
40
- /**
41
- * The ARIA property reflected by the `aria-labelledby` DOM attribute of the {@link #element}.
42
- *
43
- * **Note**: Used only when a `labelView` is passed to constructor `options`.
44
- *
45
- * @observable
46
- * @internal
47
- */
48
- _ariaLabelledBy: string | null;
49
- /**
50
- * Creates an instance of the form row class.
51
- *
52
- * @param locale The locale instance.
53
- * @param options.labelView When passed, the row gets the `group` and `aria-labelledby`
54
- * DOM attributes and gets described by the label.
55
- */
56
- constructor(locale: Locale, options?: {
57
- children?: Array<View>;
58
- class?: string;
59
- labelView?: LabelView;
60
- });
61
- }
@@ -1,57 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2025, 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
- /**
6
- * @module table/ui/formrowview
7
- */
8
- import { View } from 'ckeditor5/src/ui.js';
9
- import '../../theme/formrow.css';
10
- /**
11
- * The class representing a single row in a complex form,
12
- * used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.
13
- *
14
- * **Note**: For now this class is private. When more use cases arrive (beyond ckeditor5-table),
15
- * it will become a component in ckeditor5-ui.
16
- *
17
- * @internal
18
- */
19
- export default class FormRowView extends View {
20
- /**
21
- * Creates an instance of the form row class.
22
- *
23
- * @param locale The locale instance.
24
- * @param options.labelView When passed, the row gets the `group` and `aria-labelledby`
25
- * DOM attributes and gets described by the label.
26
- */
27
- constructor(locale, options = {}) {
28
- super(locale);
29
- const bind = this.bindTemplate;
30
- this.set('class', options.class || null);
31
- this.children = this.createCollection();
32
- if (options.children) {
33
- options.children.forEach(child => this.children.add(child));
34
- }
35
- this.set('_role', null);
36
- this.set('_ariaLabelledBy', null);
37
- if (options.labelView) {
38
- this.set({
39
- _role: 'group',
40
- _ariaLabelledBy: options.labelView.id
41
- });
42
- }
43
- this.setTemplate({
44
- tag: 'div',
45
- attributes: {
46
- class: [
47
- 'ck',
48
- 'ck-form__row',
49
- bind.to('class')
50
- ],
51
- role: bind.to('_role'),
52
- 'aria-labelledby': bind.to('_ariaLabelledBy')
53
- },
54
- children: this.children
55
- });
56
- }
57
- }
package/theme/form.css DELETED
@@ -1,11 +0,0 @@
1
- /*
2
- * Copyright (c) 2003-2025, 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
-
6
- /*
7
- * Note: This file should contain the wireframe styles only. But since there are no such styles,
8
- * it acts as a message to the builder telling that it should look for the corresponding styles
9
- * **in the theme** when compiling the editor.
10
- */
11
-
@@ -1 +0,0 @@
1
- <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z"/></svg>
@@ -1 +0,0 @@
1
- <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>
@@ -1 +0,0 @@
1
- <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>