@ckeditor/ckeditor5-table 0.0.0-nightly-20260118.0 → 0.0.0-nightly-next-20260118.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 (356) hide show
  1. package/ckeditor5-metadata.json +16 -7
  2. package/{src → dist}/augmentation.d.ts +0 -15
  3. package/{src → dist}/commands/insertcolumncommand.d.ts +1 -1
  4. package/{src → dist}/commands/insertrowcommand.d.ts +1 -1
  5. package/{src → dist}/commands/inserttablecommand.d.ts +1 -1
  6. package/{src → dist}/commands/inserttablelayoutcommand.d.ts +1 -1
  7. package/{src → dist}/commands/mergecellcommand.d.ts +3 -3
  8. package/{src → dist}/commands/mergecellscommand.d.ts +1 -1
  9. package/{src → dist}/commands/removecolumncommand.d.ts +1 -1
  10. package/{src → dist}/commands/removerowcommand.d.ts +1 -1
  11. package/{src → dist}/commands/selectcolumncommand.d.ts +1 -1
  12. package/{src → dist}/commands/selectrowcommand.d.ts +1 -1
  13. package/{src → dist}/commands/setheadercolumncommand.d.ts +1 -1
  14. package/{src → dist}/commands/setheaderrowcommand.d.ts +1 -1
  15. package/{src → dist}/commands/splitcellcommand.d.ts +1 -1
  16. package/{src → dist}/converters/downcast.d.ts +2 -2
  17. package/{src → dist}/converters/table-caption-post-fixer.d.ts +1 -1
  18. package/{src → dist}/converters/table-cell-paragraph-post-fixer.d.ts +1 -1
  19. package/{src → dist}/converters/table-cell-refresh-handler.d.ts +1 -1
  20. package/{src → dist}/converters/table-headings-refresh-handler.d.ts +1 -1
  21. package/{src → dist}/converters/table-layout-post-fixer.d.ts +1 -1
  22. package/{src → dist}/converters/tableproperties.d.ts +2 -2
  23. package/{src → dist}/converters/upcasttable.d.ts +1 -1
  24. package/dist/index-content.css +30 -30
  25. package/dist/index-editor.css +104 -170
  26. package/dist/index.css +147 -237
  27. package/dist/index.css.map +1 -1
  28. package/{src → dist}/index.d.ts +2 -5
  29. package/dist/index.js +423 -2408
  30. package/dist/index.js.map +1 -1
  31. package/{src → dist}/plaintableoutput.d.ts +1 -1
  32. package/{src → dist}/table.d.ts +2 -2
  33. package/{src → dist}/tablecaption/tablecaptionediting.d.ts +2 -2
  34. package/{src → dist}/tablecaption/tablecaptionui.d.ts +1 -1
  35. package/{src → dist}/tablecaption/toggletablecaptioncommand.d.ts +1 -1
  36. package/{src → dist}/tablecaption/utils.d.ts +1 -1
  37. package/{src → dist}/tablecaption.d.ts +1 -1
  38. package/{src → dist}/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +1 -1
  39. package/{src → dist}/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +2 -2
  40. package/{src → dist}/tablecellproperties/commands/tablecellborderstylecommand.d.ts +2 -2
  41. package/{src → dist}/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +2 -2
  42. package/{src → dist}/tablecellproperties/commands/tablecellheightcommand.d.ts +1 -1
  43. package/{src → dist}/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +1 -1
  44. package/{src → dist}/tablecellproperties/commands/tablecellpaddingcommand.d.ts +2 -2
  45. package/{src → dist}/tablecellproperties/commands/tablecellpropertycommand.d.ts +2 -2
  46. package/{src → dist}/tablecellproperties/commands/tablecelltypecommand.d.ts +2 -6
  47. package/{src → dist}/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +1 -1
  48. package/{src → dist}/tablecellproperties/tablecellpropertiesediting.d.ts +1 -1
  49. package/{src → dist}/tablecellproperties/tablecellpropertiesui.d.ts +2 -2
  50. package/dist/tablecellproperties/tablecellpropertiesutils.d.ts +18 -0
  51. package/{src/tablecellproperties/ui/tablecellpropertiesviewexperimental.d.ts → dist/tablecellproperties/ui/tablecellpropertiesview.d.ts} +11 -12
  52. package/{src → dist}/tablecellproperties.d.ts +1 -1
  53. package/{src → dist}/tablecellwidth/commands/tablecellwidthcommand.d.ts +1 -1
  54. package/{src → dist}/tablecellwidth/tablecellwidthediting.d.ts +1 -1
  55. package/{src → dist}/tableclipboard.d.ts +3 -3
  56. package/{src → dist}/tablecolumnresize/converters.d.ts +1 -1
  57. package/{src → dist}/tablecolumnresize/tablecolumnresizeediting.d.ts +2 -2
  58. package/{src → dist}/tablecolumnresize/tablewidthscommand.d.ts +2 -2
  59. package/{src → dist}/tablecolumnresize/utils.d.ts +2 -2
  60. package/{src → dist}/tablecolumnresize.d.ts +1 -1
  61. package/{src → dist}/tableconfig.d.ts +26 -6
  62. package/{src → dist}/tableediting.d.ts +3 -3
  63. package/{src → dist}/tablekeyboard.d.ts +3 -3
  64. package/{src → dist}/tablelayout/commands/tabletypecommand.d.ts +1 -1
  65. package/{src → dist}/tablelayout/tablelayoutediting.d.ts +1 -1
  66. package/{src → dist}/tablelayout/tablelayoutui.d.ts +1 -1
  67. package/{src → dist}/tablelayout.d.ts +1 -1
  68. package/{src → dist}/tablemouse/mouseeventsobserver.d.ts +1 -1
  69. package/{src → dist}/tablemouse.d.ts +1 -1
  70. package/{src → dist}/tableproperties/commands/tablealignmentcommand.d.ts +1 -1
  71. package/{src → dist}/tableproperties/commands/tablebackgroundcolorcommand.d.ts +1 -1
  72. package/{src → dist}/tableproperties/commands/tablebordercolorcommand.d.ts +2 -2
  73. package/{src → dist}/tableproperties/commands/tableborderstylecommand.d.ts +2 -2
  74. package/{src → dist}/tableproperties/commands/tableborderwidthcommand.d.ts +2 -2
  75. package/{src → dist}/tableproperties/commands/tableheightcommand.d.ts +1 -1
  76. package/{src → dist}/tableproperties/commands/tablepropertycommand.d.ts +2 -2
  77. package/{src → dist}/tableproperties/commands/tablewidthcommand.d.ts +1 -1
  78. package/{src → dist}/tableproperties/tablepropertiesediting.d.ts +1 -1
  79. package/{src → dist}/tableproperties/tablepropertiesui.d.ts +2 -2
  80. package/{src → dist}/tableproperties/ui/tablepropertiesview.d.ts +10 -2
  81. package/{src → dist}/tableproperties.d.ts +1 -1
  82. package/{src → dist}/tableselection.d.ts +2 -2
  83. package/{src → dist}/tabletoolbar.d.ts +2 -2
  84. package/{src → dist}/tableui.d.ts +1 -1
  85. package/{src → dist}/tableutils.d.ts +2 -2
  86. package/{src → dist}/tablewalker.d.ts +1 -1
  87. package/{src → dist}/ui/colorinputview.d.ts +2 -2
  88. package/{src → dist}/ui/inserttableview.d.ts +2 -2
  89. package/{src → dist}/utils/common.d.ts +2 -2
  90. package/{src → dist}/utils/structure.d.ts +1 -1
  91. package/{src → dist}/utils/table-properties.d.ts +1 -1
  92. package/{src → dist}/utils/ui/contextualballoon.d.ts +2 -2
  93. package/{src → dist}/utils/ui/table-properties.d.ts +2 -2
  94. package/{src → dist}/utils/ui/widget.d.ts +1 -1
  95. package/package.json +26 -49
  96. package/build/table.js +0 -5
  97. package/build/translations/af.js +0 -1
  98. package/build/translations/ar.js +0 -1
  99. package/build/translations/ast.js +0 -1
  100. package/build/translations/az.js +0 -1
  101. package/build/translations/be.js +0 -1
  102. package/build/translations/bg.js +0 -1
  103. package/build/translations/bn.js +0 -1
  104. package/build/translations/bs.js +0 -1
  105. package/build/translations/ca.js +0 -1
  106. package/build/translations/cs.js +0 -1
  107. package/build/translations/da.js +0 -1
  108. package/build/translations/de-ch.js +0 -1
  109. package/build/translations/de.js +0 -1
  110. package/build/translations/el.js +0 -1
  111. package/build/translations/en-au.js +0 -1
  112. package/build/translations/en-gb.js +0 -1
  113. package/build/translations/eo.js +0 -1
  114. package/build/translations/es-co.js +0 -1
  115. package/build/translations/es.js +0 -1
  116. package/build/translations/et.js +0 -1
  117. package/build/translations/eu.js +0 -1
  118. package/build/translations/fa.js +0 -1
  119. package/build/translations/fi.js +0 -1
  120. package/build/translations/fr.js +0 -1
  121. package/build/translations/gl.js +0 -1
  122. package/build/translations/gu.js +0 -1
  123. package/build/translations/he.js +0 -1
  124. package/build/translations/hi.js +0 -1
  125. package/build/translations/hr.js +0 -1
  126. package/build/translations/hu.js +0 -1
  127. package/build/translations/hy.js +0 -1
  128. package/build/translations/id.js +0 -1
  129. package/build/translations/it.js +0 -1
  130. package/build/translations/ja.js +0 -1
  131. package/build/translations/jv.js +0 -1
  132. package/build/translations/kk.js +0 -1
  133. package/build/translations/km.js +0 -1
  134. package/build/translations/kn.js +0 -1
  135. package/build/translations/ko.js +0 -1
  136. package/build/translations/ku.js +0 -1
  137. package/build/translations/lt.js +0 -1
  138. package/build/translations/lv.js +0 -1
  139. package/build/translations/ms.js +0 -1
  140. package/build/translations/nb.js +0 -1
  141. package/build/translations/ne.js +0 -1
  142. package/build/translations/nl.js +0 -1
  143. package/build/translations/no.js +0 -1
  144. package/build/translations/oc.js +0 -1
  145. package/build/translations/pl.js +0 -1
  146. package/build/translations/pt-br.js +0 -1
  147. package/build/translations/pt.js +0 -1
  148. package/build/translations/ro.js +0 -1
  149. package/build/translations/ru.js +0 -1
  150. package/build/translations/si.js +0 -1
  151. package/build/translations/sk.js +0 -1
  152. package/build/translations/sl.js +0 -1
  153. package/build/translations/sq.js +0 -1
  154. package/build/translations/sr-latn.js +0 -1
  155. package/build/translations/sr.js +0 -1
  156. package/build/translations/sv.js +0 -1
  157. package/build/translations/th.js +0 -1
  158. package/build/translations/ti.js +0 -1
  159. package/build/translations/tk.js +0 -1
  160. package/build/translations/tr.js +0 -1
  161. package/build/translations/tt.js +0 -1
  162. package/build/translations/ug.js +0 -1
  163. package/build/translations/uk.js +0 -1
  164. package/build/translations/ur.js +0 -1
  165. package/build/translations/uz.js +0 -1
  166. package/build/translations/vi.js +0 -1
  167. package/build/translations/zh-cn.js +0 -1
  168. package/build/translations/zh.js +0 -1
  169. package/lang/contexts.json +0 -82
  170. package/lang/translations/af.po +0 -332
  171. package/lang/translations/ar.po +0 -332
  172. package/lang/translations/ast.po +0 -332
  173. package/lang/translations/az.po +0 -332
  174. package/lang/translations/be.po +0 -332
  175. package/lang/translations/bg.po +0 -332
  176. package/lang/translations/bn.po +0 -334
  177. package/lang/translations/bs.po +0 -332
  178. package/lang/translations/ca.po +0 -332
  179. package/lang/translations/cs.po +0 -332
  180. package/lang/translations/da.po +0 -332
  181. package/lang/translations/de-ch.po +0 -332
  182. package/lang/translations/de.po +0 -332
  183. package/lang/translations/el.po +0 -332
  184. package/lang/translations/en-au.po +0 -332
  185. package/lang/translations/en-gb.po +0 -332
  186. package/lang/translations/en.po +0 -332
  187. package/lang/translations/eo.po +0 -332
  188. package/lang/translations/es-co.po +0 -332
  189. package/lang/translations/es.po +0 -332
  190. package/lang/translations/et.po +0 -332
  191. package/lang/translations/eu.po +0 -332
  192. package/lang/translations/fa.po +0 -332
  193. package/lang/translations/fi.po +0 -332
  194. package/lang/translations/fr.po +0 -332
  195. package/lang/translations/gl.po +0 -332
  196. package/lang/translations/gu.po +0 -332
  197. package/lang/translations/he.po +0 -332
  198. package/lang/translations/hi.po +0 -332
  199. package/lang/translations/hr.po +0 -332
  200. package/lang/translations/hu.po +0 -332
  201. package/lang/translations/hy.po +0 -332
  202. package/lang/translations/id.po +0 -332
  203. package/lang/translations/it.po +0 -332
  204. package/lang/translations/ja.po +0 -332
  205. package/lang/translations/jv.po +0 -332
  206. package/lang/translations/kk.po +0 -332
  207. package/lang/translations/km.po +0 -332
  208. package/lang/translations/kn.po +0 -332
  209. package/lang/translations/ko.po +0 -332
  210. package/lang/translations/ku.po +0 -332
  211. package/lang/translations/lt.po +0 -332
  212. package/lang/translations/lv.po +0 -332
  213. package/lang/translations/ms.po +0 -332
  214. package/lang/translations/nb.po +0 -332
  215. package/lang/translations/ne.po +0 -332
  216. package/lang/translations/nl.po +0 -332
  217. package/lang/translations/no.po +0 -332
  218. package/lang/translations/oc.po +0 -332
  219. package/lang/translations/pl.po +0 -332
  220. package/lang/translations/pt-br.po +0 -332
  221. package/lang/translations/pt.po +0 -332
  222. package/lang/translations/ro.po +0 -332
  223. package/lang/translations/ru.po +0 -332
  224. package/lang/translations/si.po +0 -332
  225. package/lang/translations/sk.po +0 -332
  226. package/lang/translations/sl.po +0 -332
  227. package/lang/translations/sq.po +0 -332
  228. package/lang/translations/sr-latn.po +0 -332
  229. package/lang/translations/sr.po +0 -332
  230. package/lang/translations/sv.po +0 -332
  231. package/lang/translations/th.po +0 -332
  232. package/lang/translations/ti.po +0 -332
  233. package/lang/translations/tk.po +0 -332
  234. package/lang/translations/tr.po +0 -332
  235. package/lang/translations/tt.po +0 -332
  236. package/lang/translations/ug.po +0 -332
  237. package/lang/translations/uk.po +0 -332
  238. package/lang/translations/ur.po +0 -332
  239. package/lang/translations/uz.po +0 -332
  240. package/lang/translations/vi.po +0 -332
  241. package/lang/translations/zh-cn.po +0 -332
  242. package/lang/translations/zh.po +0 -332
  243. package/src/augmentation.js +0 -5
  244. package/src/commands/insertcolumncommand.js +0 -71
  245. package/src/commands/insertrowcommand.js +0 -70
  246. package/src/commands/inserttablecommand.js +0 -69
  247. package/src/commands/inserttablelayoutcommand.js +0 -65
  248. package/src/commands/mergecellcommand.js +0 -206
  249. package/src/commands/mergecellscommand.js +0 -94
  250. package/src/commands/removecolumncommand.js +0 -109
  251. package/src/commands/removerowcommand.js +0 -82
  252. package/src/commands/selectcolumncommand.js +0 -60
  253. package/src/commands/selectrowcommand.js +0 -56
  254. package/src/commands/setheadercolumncommand.js +0 -76
  255. package/src/commands/setheaderrowcommand.js +0 -83
  256. package/src/commands/splitcellcommand.js +0 -58
  257. package/src/converters/downcast.js +0 -298
  258. package/src/converters/table-caption-post-fixer.js +0 -55
  259. package/src/converters/table-cell-paragraph-post-fixer.js +0 -109
  260. package/src/converters/table-cell-refresh-handler.js +0 -47
  261. package/src/converters/table-headings-refresh-handler.js +0 -51
  262. package/src/converters/table-layout-post-fixer.js +0 -369
  263. package/src/converters/tableproperties.js +0 -444
  264. package/src/converters/upcasttable.js +0 -385
  265. package/src/index.js +0 -98
  266. package/src/plaintableoutput.js +0 -49
  267. package/src/table.js +0 -50
  268. package/src/tablecaption/tablecaptionediting.js +0 -136
  269. package/src/tablecaption/tablecaptionui.js +0 -64
  270. package/src/tablecaption/toggletablecaptioncommand.js +0 -105
  271. package/src/tablecaption/utils.js +0 -61
  272. package/src/tablecaption.js +0 -34
  273. package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +0 -30
  274. package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +0 -44
  275. package/src/tablecellproperties/commands/tablecellborderstylecommand.js +0 -44
  276. package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +0 -64
  277. package/src/tablecellproperties/commands/tablecellheightcommand.js +0 -51
  278. package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +0 -30
  279. package/src/tablecellproperties/commands/tablecellpaddingcommand.js +0 -64
  280. package/src/tablecellproperties/commands/tablecellpropertycommand.js +0 -138
  281. package/src/tablecellproperties/commands/tablecelltypecommand.js +0 -167
  282. package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +0 -38
  283. package/src/tablecellproperties/tablecellpropertiesediting.js +0 -412
  284. package/src/tablecellproperties/tablecellpropertiesui.js +0 -385
  285. package/src/tablecellproperties/tablecellpropertiesuiexperimental.d.ts +0 -128
  286. package/src/tablecellproperties/tablecellpropertiesuiexperimental.js +0 -408
  287. package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +0 -229
  288. package/src/tablecellproperties/ui/tablecellpropertiesview.js +0 -612
  289. package/src/tablecellproperties/ui/tablecellpropertiesviewexperimental.js +0 -744
  290. package/src/tablecellproperties.js +0 -40
  291. package/src/tablecellwidth/commands/tablecellwidthcommand.js +0 -51
  292. package/src/tablecellwidth/tablecellwidthediting.js +0 -53
  293. package/src/tableclipboard.js +0 -500
  294. package/src/tablecolumnresize/constants.js +0 -33
  295. package/src/tablecolumnresize/converters.js +0 -62
  296. package/src/tablecolumnresize/tablecolumnresizeediting.js +0 -729
  297. package/src/tablecolumnresize/tablewidthscommand.js +0 -61
  298. package/src/tablecolumnresize/utils.js +0 -370
  299. package/src/tablecolumnresize.js +0 -36
  300. package/src/tableconfig.js +0 -5
  301. package/src/tableediting.js +0 -246
  302. package/src/tablekeyboard.js +0 -273
  303. package/src/tablelayout/commands/tabletypecommand.js +0 -68
  304. package/src/tablelayout/tablelayoutediting.js +0 -295
  305. package/src/tablelayout/tablelayoutui.js +0 -196
  306. package/src/tablelayout.js +0 -37
  307. package/src/tablemouse/mouseeventsobserver.js +0 -34
  308. package/src/tablemouse.js +0 -178
  309. package/src/tableproperties/commands/tablealignmentcommand.js +0 -30
  310. package/src/tableproperties/commands/tablebackgroundcolorcommand.js +0 -30
  311. package/src/tableproperties/commands/tablebordercolorcommand.js +0 -44
  312. package/src/tableproperties/commands/tableborderstylecommand.js +0 -44
  313. package/src/tableproperties/commands/tableborderwidthcommand.js +0 -64
  314. package/src/tableproperties/commands/tableheightcommand.js +0 -54
  315. package/src/tableproperties/commands/tablepropertycommand.js +0 -103
  316. package/src/tableproperties/commands/tablewidthcommand.js +0 -54
  317. package/src/tableproperties/tablepropertiesediting.js +0 -546
  318. package/src/tableproperties/tablepropertiesui.js +0 -374
  319. package/src/tableproperties/tablepropertiesuiexperimental.d.ts +0 -136
  320. package/src/tableproperties/tablepropertiesuiexperimental.js +0 -375
  321. package/src/tableproperties/ui/tablepropertiesview.js +0 -520
  322. package/src/tableproperties/ui/tablepropertiesviewexperimental.d.ts +0 -216
  323. package/src/tableproperties/ui/tablepropertiesviewexperimental.js +0 -544
  324. package/src/tableproperties.js +0 -40
  325. package/src/tableselection.js +0 -323
  326. package/src/tabletoolbar.js +0 -63
  327. package/src/tableui.js +0 -335
  328. package/src/tableutils.js +0 -1282
  329. package/src/tablewalker.js +0 -489
  330. package/src/ui/colorinputview.js +0 -305
  331. package/src/ui/inserttableview.js +0 -192
  332. package/src/utils/common.js +0 -118
  333. package/src/utils/structure.js +0 -452
  334. package/src/utils/table-properties.js +0 -121
  335. package/src/utils/ui/contextualballoon.js +0 -111
  336. package/src/utils/ui/table-properties.js +0 -390
  337. package/src/utils/ui/table-propertiesexperimental.d.ts +0 -215
  338. package/src/utils/ui/table-propertiesexperimental.js +0 -391
  339. package/src/utils/ui/widget.js +0 -56
  340. package/theme/colorinput.css +0 -39
  341. package/theme/formrow-experimental.css +0 -15
  342. package/theme/formrow.css +0 -13
  343. package/theme/inserttable.css +0 -10
  344. package/theme/table.css +0 -144
  345. package/theme/tablecaption.css +0 -66
  346. package/theme/tablecellproperties-experimental.css +0 -4
  347. package/theme/tablecellproperties.css +0 -28
  348. package/theme/tablecolumnresize.css +0 -62
  349. package/theme/tableediting.css +0 -10
  350. package/theme/tableform-experimental.css +0 -61
  351. package/theme/tableform.css +0 -64
  352. package/theme/tablelayout.css +0 -74
  353. package/theme/tableproperties-experimental.css +0 -78
  354. package/theme/tableproperties.css +0 -18
  355. package/theme/tableselection.css +0 -10
  356. /package/{src → dist}/tablecolumnresize/constants.d.ts +0 -0
@@ -1,385 +0,0 @@
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
- */
5
- import { createEmptyTableCell } from '../utils/common.js';
6
- import { getViewTableFromWrapper } from '../utils/structure.js';
7
- import { first } from 'ckeditor5/src/utils.js';
8
- /**
9
- * Returns a function that converts the table view representation:
10
- *
11
- * ```xml
12
- * <figure class="table"><table>...</table></figure>
13
- * ```
14
- *
15
- * to the model representation:
16
- *
17
- * ```xml
18
- * <table></table>
19
- * ```
20
- *
21
- * @internal
22
- */
23
- export function upcastTableFigure() {
24
- return (dispatcher) => {
25
- dispatcher.on('element:figure', (evt, data, conversionApi) => {
26
- // Do not convert if this is not a "table figure".
27
- if (!conversionApi.consumable.test(data.viewItem, { name: true, classes: 'table' })) {
28
- return;
29
- }
30
- // Find a table element inside the figure element.
31
- const viewTable = getViewTableFromWrapper(data.viewItem);
32
- // Do not convert if table element is absent or was already converted.
33
- if (!viewTable || !conversionApi.consumable.test(viewTable, { name: true })) {
34
- return;
35
- }
36
- // Consume the figure to prevent other converters from processing it again.
37
- conversionApi.consumable.consume(data.viewItem, { name: true, classes: 'table' });
38
- // Convert view table to model table.
39
- const conversionResult = conversionApi.convertItem(viewTable, data.modelCursor);
40
- // Get table element from conversion result.
41
- const modelTable = first(conversionResult.modelRange.getItems());
42
- // When table wasn't successfully converted then finish conversion.
43
- if (!modelTable || !modelTable.is('element', 'table')) {
44
- // Revert consumed figure so other features can convert it.
45
- conversionApi.consumable.revert(data.viewItem, { name: true, classes: 'table' });
46
- // If anyway some table content was converted, we have to pass the model range and cursor.
47
- if (conversionResult.modelRange && !conversionResult.modelRange.isCollapsed) {
48
- data.modelRange = conversionResult.modelRange;
49
- data.modelCursor = conversionResult.modelCursor;
50
- }
51
- return;
52
- }
53
- conversionApi.convertChildren(data.viewItem, conversionApi.writer.createPositionAt(modelTable, 'end'));
54
- conversionApi.updateConversionResult(modelTable, data);
55
- });
56
- };
57
- }
58
- /**
59
- * View table element to model table element conversion helper.
60
- *
61
- * This conversion helper converts the table element as well as table rows.
62
- *
63
- * @returns Conversion helper.
64
- * @internal
65
- */
66
- export function upcastTable() {
67
- return (dispatcher) => {
68
- dispatcher.on('element:table', (evt, data, conversionApi) => {
69
- const viewTable = data.viewItem;
70
- // When element was already consumed then skip it.
71
- if (!conversionApi.consumable.test(viewTable, { name: true })) {
72
- return;
73
- }
74
- const { rows, headingRows, headingColumns } = scanTable(viewTable);
75
- // Only set attributes if values is greater then 0.
76
- const attributes = {};
77
- if (headingColumns) {
78
- attributes.headingColumns = headingColumns;
79
- }
80
- if (headingRows) {
81
- attributes.headingRows = headingRows;
82
- }
83
- const table = conversionApi.writer.createElement('table', attributes);
84
- if (!conversionApi.safeInsert(table, data.modelCursor)) {
85
- return;
86
- }
87
- conversionApi.consumable.consume(viewTable, { name: true });
88
- // Upcast table rows in proper order (heading rows first).
89
- rows.forEach(row => conversionApi.convertItem(row, conversionApi.writer.createPositionAt(table, 'end')));
90
- // Convert everything else.
91
- conversionApi.convertChildren(viewTable, conversionApi.writer.createPositionAt(table, 'end'));
92
- // Create one row and one table cell for empty table.
93
- if (table.isEmpty) {
94
- const row = conversionApi.writer.createElement('tableRow');
95
- conversionApi.writer.insert(row, conversionApi.writer.createPositionAt(table, 'end'));
96
- createEmptyTableCell(conversionApi.writer, conversionApi.writer.createPositionAt(row, 'end'));
97
- }
98
- conversionApi.updateConversionResult(table, data);
99
- });
100
- };
101
- }
102
- /**
103
- * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.
104
- *
105
- * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells
106
- * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only
107
- * rows that have related `tableRow` elements).
108
- *
109
- * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue
110
- * of an improper table with all empty rows.
111
- *
112
- * @internal
113
- * @returns Conversion helper.
114
- */
115
- export function skipEmptyTableRow() {
116
- return (dispatcher) => {
117
- dispatcher.on('element:tr', (evt, data) => {
118
- if (data.viewItem.isEmpty && data.modelCursor.index == 0) {
119
- evt.stop();
120
- }
121
- }, { priority: 'high' });
122
- };
123
- }
124
- /**
125
- * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.
126
- *
127
- * @internal
128
- * @returns Conversion helper.
129
- */
130
- export function ensureParagraphInTableCell(elementName) {
131
- return (dispatcher) => {
132
- dispatcher.on(`element:${elementName}`, (evt, data, { writer }) => {
133
- // The default converter will create a model range on converted table cell.
134
- if (!data.modelRange) {
135
- return;
136
- }
137
- const tableCell = data.modelRange.start.nodeAfter;
138
- const modelCursor = writer.createPositionAt(tableCell, 0);
139
- // Ensure a paragraph in the model for empty table cells for converted table cells.
140
- if (data.viewItem.isEmpty) {
141
- writer.insertElement('paragraph', modelCursor);
142
- return;
143
- }
144
- const childNodes = Array.from(tableCell.getChildren());
145
- // In case there are only markers inside the table cell then move them to the paragraph.
146
- if (childNodes.every(node => node.is('element', '$marker'))) {
147
- const paragraph = writer.createElement('paragraph');
148
- writer.insert(paragraph, writer.createPositionAt(tableCell, 0));
149
- for (const node of childNodes) {
150
- writer.move(writer.createRangeOn(node), writer.createPositionAt(paragraph, 'end'));
151
- }
152
- }
153
- }, { priority: 'low' });
154
- };
155
- }
156
- /**
157
- * Scans table rows and extracts required metadata from the table:
158
- *
159
- * headingRows - The number of rows that go as table headers.
160
- * headingColumns - The maximum number of row headings.
161
- * rows - Sorted `<tr>` elements as they should go into the model - ie. if `<thead>` is inserted after `<tbody>` in the view.
162
- *
163
- * @param viewTable The view table element.
164
- * @returns The table metadata.
165
- */
166
- function scanTable(viewTable) {
167
- let headingColumns = undefined;
168
- let shouldAccumulateHeadingRows = true;
169
- // The `<tbody>` and `<thead>` sections in the DOM do not have to be in order `<thead>` -> `<tbody>` and there might be more than one
170
- // of them.
171
- // As the model does not have these sections, rows from different sections must be sorted.
172
- // For example, below is a valid HTML table:
173
- //
174
- // <table>
175
- // <tbody><tr><td>2</td></tr></tbody>
176
- // <thead><tr><td>1</td></tr></thead>
177
- // <tbody><tr><td>3</td></tr></tbody>
178
- // </table>
179
- //
180
- // But browsers will render rows in order as: 1 as the heading and 2 and 3 as the body.
181
- const headRows = [];
182
- const bodyRows = [];
183
- // Currently the editor does not support more then one <thead> section.
184
- // Only the first <thead> from the view will be used as a heading row and the others will be converted to body rows.
185
- let firstTheadElement;
186
- for (const tableChild of Array.from(viewTable.getChildren())) {
187
- // Only `<thead>`, `<tbody>` & `<tfoot>` from allowed table children can have `<tr>`s.
188
- // The else is for future purposes (mainly `<caption>`).
189
- if (tableChild.name !== 'tbody' && tableChild.name !== 'thead' && tableChild.name !== 'tfoot') {
190
- continue;
191
- }
192
- // Save the first `<thead>` in the table as table header - all other ones will be converted to table body rows.
193
- if (tableChild.name === 'thead' && !firstTheadElement) {
194
- shouldAccumulateHeadingRows = true;
195
- firstTheadElement = tableChild;
196
- }
197
- // There might be some extra empty text nodes between the `<tr>`s.
198
- // Make sure further code operates on `tr`s only. (#145)
199
- const trs = Array.from(tableChild.getChildren()).filter((el) => el.is('element', 'tr'));
200
- // Keep tracking of the previous row columns count to improve detection of heading rows.
201
- let maxPrevColumns = null;
202
- for (const tr of trs) {
203
- const trColumns = Array
204
- .from(tr.getChildren())
205
- .filter(el => el.is('element', 'td') || el.is('element', 'th'));
206
- // This <tr> is a child of a first <thead> element.
207
- if ((firstTheadElement && tableChild === firstTheadElement) ||
208
- (tableChild.name === 'tbody' &&
209
- trColumns.length > 0 &&
210
- // These conditions handles the case when the first column is a <th> element and it's the only column in the row.
211
- // This case is problematic because it's not clear if this row should be a heading row or not, as it may be result
212
- // of the cell span from the previous row.
213
- // Issue: https://github.com/ckeditor/ckeditor5/issues/17556
214
- (maxPrevColumns === null || trColumns.length === maxPrevColumns) &&
215
- trColumns.every(e => e.is('element', 'th')) &&
216
- // If there is at least one "normal" table row between heading rows, then stop accumulating heading rows.
217
- shouldAccumulateHeadingRows)) {
218
- headRows.push(tr);
219
- shouldAccumulateHeadingRows = true;
220
- }
221
- else {
222
- bodyRows.push(tr);
223
- shouldAccumulateHeadingRows = false;
224
- }
225
- // We use the maximum number of columns to avoid false positives when detecting
226
- // multiple rows with single column within `rowspan`. Without it the last row of `rowspan=3`
227
- // would be detected as a heading row because it has only one column (identical to the previous row).
228
- maxPrevColumns = Math.max(maxPrevColumns || 0, trColumns.length);
229
- }
230
- }
231
- // Generate the cell matrix so we can calculate the heading columns.
232
- const bodyMatrix = generateCellMatrix(bodyRows);
233
- for (const rowSlots of bodyMatrix) {
234
- // Look for the first non-`<th>` entry (either a `<td>` or a missing cell).
235
- let index = 0;
236
- while (index < rowSlots.length) {
237
- if (rowSlots[index]?.name !== 'th') {
238
- break;
239
- }
240
- index += 1;
241
- }
242
- // Update headingColumns.
243
- if (headingColumns === undefined || index < headingColumns) {
244
- headingColumns = index;
245
- }
246
- }
247
- return {
248
- headingRows: headRows.length,
249
- headingColumns: headingColumns || 0,
250
- rows: [...headRows, ...bodyRows]
251
- };
252
- }
253
- /**
254
- * Takes an array of `<tr>` elements and generates a "matrix" (square
255
- * two-dimensional array) describing which `<th>`s and `<td>`s fill which
256
- * "slots", factoring in `rowspan`s and `colspan`s. For example, given
257
- *
258
- * ```xml
259
- * <table>
260
- * <tr> <td>11</td> <td rowspan="2">12-22</td> <td>13</td> </tr>
261
- * <tr> <td>21</td> <td>23</td> </tr>
262
- * <tr> <td colspan="2">31-32</td> <td>33</rd> </tr>
263
- * </table>
264
- * ```
265
- *
266
- * The result would be (with cell elements' text content in place of the element
267
- * objects for readability):
268
- *
269
- * ```js
270
- * [
271
- * [ '11', '12-22', '13' ],
272
- * [ '21', '12-22', '23' ],
273
- * [ '31-32', '31-32', '33' ],
274
- * ]
275
- * ```
276
- *
277
- * This allows for a computation of heading columns that factors in the case
278
- * where a cell from a previous rows with a `rowspan` attribute effectively adds
279
- * an additional header cell to a subsequent row.
280
- *
281
- * There are also cases where cells are "missing" from a row. A simple one is
282
- * the case where a row simply has fewer cells than another row in the same
283
- * table. But another is one where a row has a cell with a `rowspan` that
284
- * effectively adds a cell to a subsequent row "off the end" of the row. In this
285
- * case, there will be a `null` value instead of an element object in that
286
- * position. For example,
287
- *
288
- * ```xml
289
- * <table>
290
- * <tr> <td>11</td> <td>12</td> <td rowspan="2">13-23</td> </tr>
291
- * <tr> <td>21</td> </tr>
292
- * <tr> <td>31</td> </tr>
293
- * </table>
294
- * ```
295
- *
296
- * would result in
297
- *
298
- * ```js
299
- * [
300
- * [ '11', '12', '13-23' ],
301
- * [ '21', null, '13-23' ],
302
- * [ '31', null, null ]
303
- * ]
304
- * ```
305
- *
306
- * @param trs the array of `<tr>` elements
307
- * @returns the cell matrix
308
- */
309
- function generateCellMatrix(trs) {
310
- // As we iterate, we keep track of cells with rowspans >1 so later rows can
311
- // factor them in. This trackes any such cells from previous rows.
312
- let prevRowspans = new Map();
313
- // This is the maximum number of columns we've encountered.
314
- let maxColumns = 0;
315
- const slots = trs.map(tr => {
316
- // This will be the slots that are in this row, including cells from
317
- // previous rows with a big enough "rowspan" to affect this row.
318
- const curSlots = [];
319
- // Get the cell elements
320
- const children = Array.from(tr.getChildren())
321
- .filter(child => child.name === 'th' || child.name === 'td');
322
- // This will be any cells in this row that have a rowspan >1, so we can
323
- // combine it with `prevRowspans` when we're done processing this row.
324
- const curRowspans = new Map();
325
- // We need to process all the cells in this row, but also previous rows'
326
- // cells with rowspans might add additional slots to the end of this row, so
327
- // we need to iterate until we've both consumed all the children _and_
328
- // filled out slots to the max number of columns we've encountered so far.
329
- while (children.length || curSlots.length < maxColumns) {
330
- const rowSpan = prevRowspans.get(curSlots.length);
331
- if (rowSpan && rowSpan.remaining > 0) {
332
- // We have a cell at this index in a previous row whose rowspan extends
333
- // it into this row, so we insert a copy of it here.
334
- curSlots.push(rowSpan.cell);
335
- }
336
- else {
337
- // See if we have more cells in the row.
338
- const cell = children.shift();
339
- if (cell) {
340
- // We do, so process it
341
- const colspan = parseInt(cell.getAttribute('colspan') || '1');
342
- const rowspan = parseInt(cell.getAttribute('rowspan') || '1');
343
- // Process this cell as many times as needed according to its colspan.
344
- for (let i = 0; i < colspan; i++) {
345
- // if we have a >1 rowspan, create a record in the rowSpans map for
346
- // this column index keeping track of it.
347
- if (rowspan > 1) {
348
- curRowspans.set(curSlots.length, { cell, remaining: rowspan - 1 });
349
- }
350
- curSlots.push(cell);
351
- }
352
- }
353
- else {
354
- // No remaining children in this row, so no cell in this slot.
355
- curSlots.push(null);
356
- continue;
357
- }
358
- }
359
- }
360
- // Now update the row spans. In weird edge cases where colspan and rowspan
361
- // conflict, we can end up with a cell in a column in this row that
362
- // "truncates" a row-spanning cell from a previous column, so make sure in
363
- // those cases, the value in `curRowspans` always "wins". We do this by
364
- // copying (and decrementing) values from `prevRowspans` into `curRowspans`
365
- // as long as there is no conflict, and then re-assigning `prevRowspans`.
366
- for (const [index, entry] of prevRowspans.entries()) {
367
- entry.remaining -= 1;
368
- if (entry.remaining > 0 && !curRowspans.has(index)) {
369
- curRowspans.set(index, entry);
370
- }
371
- }
372
- prevRowspans = curRowspans;
373
- // Finally, update `maxColumns`.
374
- maxColumns = Math.max(maxColumns, curSlots.length);
375
- return curSlots;
376
- });
377
- // Now expand any rows that have fewer than `maxColumns` with nulls so we have
378
- // a proper matrix.
379
- for (const rowSlots of slots) {
380
- while (rowSlots.length < maxColumns) {
381
- rowSlots.push(null);
382
- }
383
- }
384
- return slots;
385
- }
package/src/index.js DELETED
@@ -1,98 +0,0 @@
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
- */
5
- /**
6
- * @module table
7
- */
8
- export { PlainTableOutput } from './plaintableoutput.js';
9
- export { Table } from './table.js';
10
- export { TableWalker } from './tablewalker.js';
11
- export { TableEditing } from './tableediting.js';
12
- export { TableUI } from './tableui.js';
13
- export { TableToolbar } from './tabletoolbar.js';
14
- export { TableCellProperties } from './tablecellproperties.js';
15
- export { TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
16
- export { TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
17
- export { TableCellPropertiesView } from './tablecellproperties/ui/tablecellpropertiesview.js';
18
- export { TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
19
- export { TableLayout } from './tablelayout.js';
20
- export { TableLayoutEditing } from './tablelayout/tablelayoutediting.js';
21
- export { TableLayoutUI } from './tablelayout/tablelayoutui.js';
22
- export { TableProperties } from './tableproperties.js';
23
- export { TablePropertiesEditing } from './tableproperties/tablepropertiesediting.js';
24
- export { TablePropertiesUI } from './tableproperties/tablepropertiesui.js';
25
- export { TablePropertiesView } from './tableproperties/ui/tablepropertiesview.js';
26
- export { TableCaption } from './tablecaption.js';
27
- export { TableCaptionEditing } from './tablecaption/tablecaptionediting.js';
28
- export { TableCaptionUI } from './tablecaption/tablecaptionui.js';
29
- export { TableClipboard } from './tableclipboard.js';
30
- export { TableMouse } from './tablemouse.js';
31
- export { TableKeyboard } from './tablekeyboard.js';
32
- export { TableSelection } from './tableselection.js';
33
- export { TableUtils } from './tableutils.js';
34
- export { TableColumnResize } from './tablecolumnresize.js';
35
- export { TableColumnResizeEditing } from './tablecolumnresize/tablecolumnresizeediting.js';
36
- export { TableWidthsCommand } from './tablecolumnresize/tablewidthscommand.js';
37
- // [experimental] Remove in the v48.
38
- export { TablePropertiesUIExperimental } from './tableproperties/tablepropertiesuiexperimental.js';
39
- export { TablePropertiesViewExperimental } from './tableproperties/ui/tablepropertiesviewexperimental.js';
40
- export { TableCellPropertiesUIExperimental } from './tablecellproperties/tablecellpropertiesuiexperimental.js';
41
- export { TableCellPropertiesViewExperimental } from './tablecellproperties/ui/tablecellpropertiesviewexperimental.js';
42
- export { InsertColumnCommand } from './commands/insertcolumncommand.js';
43
- export { InsertRowCommand } from './commands/insertrowcommand.js';
44
- export { InsertTableCommand } from './commands/inserttablecommand.js';
45
- export { InsertTableLayoutCommand } from './commands/inserttablelayoutcommand.js';
46
- export { TableTypeCommand } from './tablelayout/commands/tabletypecommand.js';
47
- export { MergeCellCommand } from './commands/mergecellcommand.js';
48
- export { MergeCellsCommand } from './commands/mergecellscommand.js';
49
- export { RemoveColumnCommand } from './commands/removecolumncommand.js';
50
- export { RemoveRowCommand } from './commands/removerowcommand.js';
51
- export { SelectColumnCommand } from './commands/selectcolumncommand.js';
52
- export { SelectRowCommand } from './commands/selectrowcommand.js';
53
- export { SetHeaderColumnCommand } from './commands/setheadercolumncommand.js';
54
- export { SetHeaderRowCommand } from './commands/setheaderrowcommand.js';
55
- export { SplitCellCommand } from './commands/splitcellcommand.js';
56
- export { ToggleTableCaptionCommand } from './tablecaption/toggletablecaptioncommand.js';
57
- export { TableCellBackgroundColorCommand } from './tablecellproperties/commands/tablecellbackgroundcolorcommand.js';
58
- export { TableCellBorderColorCommand } from './tablecellproperties/commands/tablecellbordercolorcommand.js';
59
- export { TableCellBorderStyleCommand } from './tablecellproperties/commands/tablecellborderstylecommand.js';
60
- export { TableCellBorderWidthCommand } from './tablecellproperties/commands/tablecellborderwidthcommand.js';
61
- export { TableCellHeightCommand } from './tablecellproperties/commands/tablecellheightcommand.js';
62
- export { TableCellHorizontalAlignmentCommand } from './tablecellproperties/commands/tablecellhorizontalalignmentcommand.js';
63
- export { TableCellPaddingCommand } from './tablecellproperties/commands/tablecellpaddingcommand.js';
64
- export { TableCellVerticalAlignmentCommand } from './tablecellproperties/commands/tablecellverticalalignmentcommand.js';
65
- export { TableCellWidthCommand } from './tablecellwidth/commands/tablecellwidthcommand.js';
66
- export { TableAlignmentCommand } from './tableproperties/commands/tablealignmentcommand.js';
67
- export { TableBackgroundColorCommand } from './tableproperties/commands/tablebackgroundcolorcommand.js';
68
- export { TableBorderColorCommand } from './tableproperties/commands/tablebordercolorcommand.js';
69
- export { TableBorderStyleCommand } from './tableproperties/commands/tableborderstylecommand.js';
70
- export { TableBorderWidthCommand } from './tableproperties/commands/tableborderwidthcommand.js';
71
- export { TableHeightCommand } from './tableproperties/commands/tableheightcommand.js';
72
- export { TableWidthCommand } from './tableproperties/commands/tablewidthcommand.js';
73
- export { TablePropertyCommand } from './tableproperties/commands/tablepropertycommand.js';
74
- export { TableCellTypeCommand } from './tablecellproperties/commands/tablecelltypecommand.js';
75
- export { TableCellPropertyCommand } from './tablecellproperties/commands/tablecellpropertycommand.js';
76
- // Internal exports.
77
- export { downcastTable as _downcastTable, downcastRow as _downcastTableRow, downcastCell as _downcastTableCell, convertParagraphInTableCell as _convertParagraphInTableCell, isSingleParagraphWithoutAttributes as _isSingleTableParagraphWithoutAttributes } from './converters/downcast.js';
78
- export { injectTableCaptionPostFixer as _injectTableCaptionPostFixer } from './converters/table-caption-post-fixer.js';
79
- export { injectTableCellParagraphPostFixer as _injectTableCellParagraphPostFixer } from './converters/table-cell-paragraph-post-fixer.js';
80
- export { tableCellRefreshHandler as _tableCellRefreshHandler } from './converters/table-cell-refresh-handler.js';
81
- export { tableHeadingsRefreshHandler as _tableHeadingsRefreshHandler } from './converters/table-headings-refresh-handler.js';
82
- export { injectTableLayoutPostFixer as _injectTableLayoutPostFixer } from './converters/table-layout-post-fixer.js';
83
- export { upcastStyleToAttribute as _upcastNormalizedTableStyleToAttribute, upcastBorderStyles as _upcastTableBorderStyles, downcastAttributeToStyle as _downcastTableAttributeToStyle, downcastTableAttribute as _downcastTableAttribute, getDefaultValueAdjusted as _getDefaultTableValueAdjusted } from './converters/tableproperties.js';
84
- export { upcastTableFigure as _upcastTableFigure, upcastTable as _upcastTable, skipEmptyTableRow as _skipEmptyTableRow, ensureParagraphInTableCell as _ensureParagraphInTableCell } from './converters/upcasttable.js';
85
- export { isTable as _isTableModelElement, getCaptionFromTableModelElement as _getTableCaptionFromModelElement, getCaptionFromModelSelection as _getTableCaptionFromModelSelection, matchTableCaptionViewElement as _matchTableCaptionViewElement } from './tablecaption/utils.js';
86
- export { COLUMN_MIN_WIDTH_AS_PERCENTAGE as _TABLE_COLUMN_MIN_WIDTH_AS_PERCENTAGE, COLUMN_MIN_WIDTH_IN_PIXELS as _TABLE_COLUMN_MIN_WIDTH_IN_PIXELS, COLUMN_WIDTH_PRECISION as _TABLE_COLUMN_WIDTH_PRECISION, COLUMN_RESIZE_DISTANCE_THRESHOLD as _TABLE_COLUMN_RESIZE_DISTANCE_THRESHOLD } from './tablecolumnresize/constants.js';
87
- export { upcastColgroupElement as _upcastTableColgroupElement, downcastTableResizedClass as _downcastTableResizedClass } from './tablecolumnresize/converters.js';
88
- export { getChangedResizedTables as _getChangedResizedTables, getColumnMinWidthAsPercentage as _getTableColumnMinWidthAsPercentage, getTableWidthInPixels as _getTableWidthInPixels, getElementWidthInPixels as _getElementWidthInPixels, getColumnEdgesIndexes as _getTableColumnEdgesIndexes, toPrecision as _toPrecision, clamp as _clamp, createFilledArray as _createFilledArray, sumArray as _sumArray, normalizeColumnWidths as _normalizeTableColumnWidths, getDomCellOuterWidth as _getDomTableCellOuterWidth, updateColumnElements as _updateTableColumnElements, getColumnGroupElement as _getTableColumnGroupElement, getTableColumnElements as _getTableColumnElements, getTableColumnsWidths as _getTableColumnsWidths, translateColSpanAttribute as _translateTableColspanAttribute } from './tablecolumnresize/utils.js';
89
- export { MouseEventsObserver as _TableMouseEventsObserver } from './tablemouse/mouseeventsobserver.js';
90
- export { ColorInputView as _TableColorInputView } from './ui/colorinputview.js';
91
- export { InsertTableView as _InsertTableView } from './ui/inserttableview.js';
92
- export { updateNumericAttribute as _updateTableNumericAttribute, createEmptyTableCell as _createEmptyTableCell, isHeadingColumnCell as _isTableHeadingColumnCell, enableProperty as _enableTableCellProperty, getSelectionAffectedTable as _getSelectionAffectedTable } from './utils/common.js';
93
- export { cropTableToDimensions as _cropTableToDimensions, getVerticallyOverlappingCells as _getVerticallyOverlappingTableCells, splitHorizontally as _splitTableCellHorizontally, getHorizontallyOverlappingCells as _getHorizontallyOverlappingTableCells, splitVertically as _splitTableCellVertically, trimTableCellIfNeeded as _trimTableCellIfNeeded, removeEmptyColumns as _removeEmptyTableColumns, removeEmptyRows as _removeEmptyTableRows, removeEmptyRowsColumns as _removeEmptyTableRowsColumns, adjustLastRowIndex as _adjustLastTableRowIndex, adjustLastColumnIndex as _adjustLastTableColumnIndex } from './utils/structure.js';
94
- export { getSingleValue as _getTableBorderBoxSingleValue, addDefaultUnitToNumericValue as _addDefaultUnitToNumericValue, getNormalizedDefaultProperties as _getNormalizedDefaultTableBaseProperties, getNormalizedDefaultTableProperties as _getNormalizedDefaultTableProperties, getNormalizedDefaultCellProperties as _getNormalizedDefaultTableCellProperties } from './utils/table-properties.js';
95
- export { repositionContextualBalloon as _repositionTableContextualBalloon, getBalloonTablePositionData as _getBalloonTablePositionData, getBalloonCellPositionData as _getBalloonTableCellPositionData } from './utils/ui/contextualballoon.js';
96
- export { getBorderStyleLabels as _getBorderTableStyleLabels, getLocalizedColorErrorText as _getLocalizedTableColorErrorText, getLocalizedLengthErrorText as _getLocalizedTableLengthErrorText, colorFieldValidator as _colorTableFieldValidator, lengthFieldValidator as _lengthTableFieldValidator, lineWidthFieldValidator as _lineWidthTableFieldValidator, getBorderStyleDefinitions as _getTableOrCellBorderStyleDefinitions, fillToolbar as _fillTableOrCellToolbar, defaultColors as _TABLE_DEFAULT_COLORS, getLabeledColorInputCreator as _getLabeledTableColorInputCreator } from './utils/ui/table-properties.js';
97
- export { getSelectionAffectedTableWidget as _getSelectionAffectedTableWidget, getSelectedTableWidget as _getSelectedTableWidget, getTableWidgetAncestor as _getTableWidgetAncestor } from './utils/ui/widget.js';
98
- import './augmentation.js';
@@ -1,49 +0,0 @@
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
- */
5
- /**
6
- * @module table/plaintableoutput
7
- */
8
- import { Plugin } from 'ckeditor5/src/core.js';
9
- import { Table } from './table.js';
10
- /**
11
- * The plain table output feature.
12
- *
13
- * This feature strips the `<figure>` tag from the table data. This is because this tag is not supported
14
- * by most popular email clients and removing it ensures compatibility.
15
- */
16
- export class PlainTableOutput extends Plugin {
17
- /**
18
- * @inheritDoc
19
- */
20
- static get pluginName() {
21
- return 'PlainTableOutput';
22
- }
23
- /**
24
- * @inheritDoc
25
- */
26
- static get isOfficialPlugin() {
27
- return true;
28
- }
29
- /**
30
- * @inheritDoc
31
- */
32
- static get requires() {
33
- return [Table];
34
- }
35
- /**
36
- * @inheritDoc
37
- */
38
- init() {
39
- const editor = this.editor;
40
- editor.conversion.for('upcast').add(dispatcher => {
41
- dispatcher.on('element:table', (evt, data, conversionApi) => {
42
- // It's not necessary to upcast the `table` class. This class was only added in data downcast
43
- // to center a plain table in the editor output.
44
- // See: https://github.com/ckeditor/ckeditor5/issues/17888.
45
- conversionApi.consumable.consume(data.viewItem, { classes: 'table' });
46
- });
47
- });
48
- }
49
- }
package/src/table.js DELETED
@@ -1,50 +0,0 @@
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
- */
5
- /**
6
- * @module table/table
7
- */
8
- import { Plugin } from 'ckeditor5/src/core.js';
9
- import { Widget } from 'ckeditor5/src/widget.js';
10
- import { TableEditing } from './tableediting.js';
11
- import { TableUI } from './tableui.js';
12
- import { TableSelection } from './tableselection.js';
13
- import { TableClipboard } from './tableclipboard.js';
14
- import { TableKeyboard } from './tablekeyboard.js';
15
- import { TableMouse } from './tablemouse.js';
16
- import '../theme/table.css';
17
- /**
18
- * The table plugin.
19
- *
20
- * For a detailed overview, check the {@glink features/tables/tables Table feature documentation}.
21
- *
22
- * This is a "glue" plugin that loads the following table features:
23
- *
24
- * * {@link module:table/tableediting~TableEditing editing feature},
25
- * * {@link module:table/tableselection~TableSelection selection feature},
26
- * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},
27
- * * {@link module:table/tablemouse~TableMouse mouse selection feature},
28
- * * {@link module:table/tableclipboard~TableClipboard clipboard feature},
29
- * * {@link module:table/tableui~TableUI UI feature}.
30
- */
31
- export class Table extends Plugin {
32
- /**
33
- * @inheritDoc
34
- */
35
- static get requires() {
36
- return [TableEditing, TableUI, TableSelection, TableMouse, TableKeyboard, TableClipboard, Widget];
37
- }
38
- /**
39
- * @inheritDoc
40
- */
41
- static get pluginName() {
42
- return 'Table';
43
- }
44
- /**
45
- * @inheritDoc
46
- */
47
- static get isOfficialPlugin() {
48
- return true;
49
- }
50
- }