@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
@@ -266,3 +266,31 @@ msgstr "在表格中移動"
266
266
  msgctxt "The accessible label of the menu bar button that displays a user interface to insert a table into editor content."
267
267
  msgid "Table"
268
268
  msgstr "表格"
269
+
270
+ msgctxt "Label for the insert table layout toolbar button."
271
+ msgid "Insert table layout"
272
+ msgstr ""
273
+
274
+ msgctxt "The accessible label used in the table layout insert UI element."
275
+ msgid "Table layout"
276
+ msgstr ""
277
+
278
+ msgctxt "The accessible label of the layout table type dropdown button."
279
+ msgid "Layout table"
280
+ msgstr ""
281
+
282
+ msgctxt "The accessible label of the content table type dropdown button."
283
+ msgid "Content table"
284
+ msgstr ""
285
+
286
+ msgctxt "The accessible label of the table balloon button that displays a user interface to choose table type."
287
+ msgid "Choose table type"
288
+ msgstr ""
289
+
290
+ msgctxt "The accessible label of the table type toolbar button."
291
+ msgid "Table type"
292
+ msgstr ""
293
+
294
+ msgctxt "The accessible label of dropdown list that displays a user interface to choose table type."
295
+ msgid "Table type options"
296
+ msgstr ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-table",
3
- "version": "44.3.0",
3
+ "version": "45.0.0-alpha.1",
4
4
  "description": "Table feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,14 +13,15 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "ckeditor5": "44.3.0",
17
- "@ckeditor/ckeditor5-clipboard": "44.3.0",
18
- "@ckeditor/ckeditor5-core": "44.3.0",
19
- "@ckeditor/ckeditor5-engine": "44.3.0",
20
- "@ckeditor/ckeditor5-ui": "44.3.0",
21
- "@ckeditor/ckeditor5-utils": "44.3.0",
22
- "@ckeditor/ckeditor5-widget": "44.3.0",
23
- "lodash-es": "4.17.21"
16
+ "ckeditor5": "45.0.0-alpha.1",
17
+ "@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.1",
18
+ "@ckeditor/ckeditor5-core": "45.0.0-alpha.1",
19
+ "@ckeditor/ckeditor5-engine": "45.0.0-alpha.1",
20
+ "@ckeditor/ckeditor5-icons": "45.0.0-alpha.1",
21
+ "@ckeditor/ckeditor5-ui": "45.0.0-alpha.1",
22
+ "@ckeditor/ckeditor5-utils": "45.0.0-alpha.1",
23
+ "@ckeditor/ckeditor5-widget": "45.0.0-alpha.1",
24
+ "es-toolkit": "1.32.0"
24
25
  },
25
26
  "author": "CKSource (http://cksource.com/)",
26
27
  "license": "SEE LICENSE IN LICENSE.md",
@@ -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 type { TableConfig, Table, TableCaption, TableCaptionEditing, TableCaptionUI, TableCellProperties, TableCellPropertiesEditing, TableCellPropertiesUI, TableCellWidthEditing, TableClipboard, TableColumnResize, TableColumnResizeEditing, TableEditing, TableKeyboard, TableMouse, TableProperties, TablePropertiesEditing, TablePropertiesUI, TableSelection, TableToolbar, TableUI, TableUtils, PlainTableOutput, InsertColumnCommand, InsertRowCommand, InsertTableCommand, MergeCellCommand, MergeCellsCommand, RemoveColumnCommand, RemoveRowCommand, SelectColumnCommand, SelectRowCommand, SetHeaderColumnCommand, SetHeaderRowCommand, SplitCellCommand, ToggleTableCaptionCommand, TableCellBackgroundColorCommand, TableCellBorderColorCommand, TableCellBorderStyleCommand, TableCellBorderWidthCommand, TableCellHeightCommand, TableCellHorizontalAlignmentCommand, TableCellPaddingCommand, TableCellVerticalAlignmentCommand, TableCellWidthCommand, TableAlignmentCommand, TableBackgroundColorCommand, TableBorderColorCommand, TableBorderStyleCommand, TableBorderWidthCommand, TableHeightCommand, TableWidthCommand } from './index.js';
5
+ import type { TableConfig, Table, TableCaption, TableCaptionEditing, TableCaptionUI, TableCellProperties, TableCellPropertiesEditing, TableCellPropertiesUI, TableCellWidthEditing, TableClipboard, TableColumnResize, TableColumnResizeEditing, TableEditing, TableKeyboard, TableLayout, TableLayoutEditing, TableMouse, TableProperties, TablePropertiesEditing, TablePropertiesUI, TableSelection, TableToolbar, TableUI, TableUtils, PlainTableOutput, InsertColumnCommand, InsertRowCommand, InsertTableCommand, InsertTableLayoutCommand, MergeCellCommand, MergeCellsCommand, RemoveColumnCommand, RemoveRowCommand, SelectColumnCommand, SelectRowCommand, SetHeaderColumnCommand, SetHeaderRowCommand, TableTypeCommand, SplitCellCommand, ToggleTableCaptionCommand, TableCellBackgroundColorCommand, TableCellBorderColorCommand, TableCellBorderStyleCommand, TableCellBorderWidthCommand, TableCellHeightCommand, TableCellHorizontalAlignmentCommand, TableCellPaddingCommand, TableCellVerticalAlignmentCommand, TableCellWidthCommand, TableAlignmentCommand, TableBackgroundColorCommand, TableBorderColorCommand, TableBorderStyleCommand, TableBorderWidthCommand, TableHeightCommand, TableWidthCommand } from './index.js';
6
6
  declare module '@ckeditor/ckeditor5-core' {
7
7
  interface EditorConfig {
8
8
  /**
@@ -26,6 +26,8 @@ declare module '@ckeditor/ckeditor5-core' {
26
26
  [TableColumnResizeEditing.pluginName]: TableColumnResizeEditing;
27
27
  [TableEditing.pluginName]: TableEditing;
28
28
  [TableKeyboard.pluginName]: TableKeyboard;
29
+ [TableLayout.pluginName]: TableLayout;
30
+ [TableLayoutEditing.pluginName]: TableLayoutEditing;
29
31
  [TableMouse.pluginName]: TableMouse;
30
32
  [TableProperties.pluginName]: TableProperties;
31
33
  [TablePropertiesEditing.pluginName]: TablePropertiesEditing;
@@ -42,6 +44,7 @@ declare module '@ckeditor/ckeditor5-core' {
42
44
  insertTableRowAbove: InsertRowCommand;
43
45
  insertTableRowBelow: InsertRowCommand;
44
46
  insertTable: InsertTableCommand;
47
+ insertTableLayout: InsertTableLayoutCommand;
45
48
  mergeTableCellRight: MergeCellCommand;
46
49
  mergeTableCellLeft: MergeCellCommand;
47
50
  mergeTableCellDown: MergeCellCommand;
@@ -72,5 +75,6 @@ declare module '@ckeditor/ckeditor5-core' {
72
75
  tableBorderWidth: TableBorderWidthCommand;
73
76
  tableHeight: TableHeightCommand;
74
77
  tableWidth: TableWidthCommand;
78
+ tableType: TableTypeCommand;
75
79
  }
76
80
  }
@@ -25,6 +25,10 @@ import { Command } from 'ckeditor5/src/core.js';
25
25
  * ```
26
26
  */
27
27
  export default class InsertColumnCommand extends Command {
28
+ /**
29
+ * The order of insertion relative to the column in which the caret is located.
30
+ */
31
+ order;
28
32
  /**
29
33
  * Creates a new `InsertColumnCommand` instance.
30
34
  *
@@ -25,6 +25,10 @@ import { Command } from 'ckeditor5/src/core.js';
25
25
  * ```
26
26
  */
27
27
  export default class InsertRowCommand extends Command {
28
+ /**
29
+ * The order of insertion relative to the row in which the caret is located.
30
+ */
31
+ order;
28
32
  /**
29
33
  * Creates a new `InsertRowCommand` instance.
30
34
  *
@@ -0,0 +1,39 @@
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/commands/inserttablelayoutcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The insert table layout command.
11
+ *
12
+ * The command is registered by {@link module:table/tablelayout/tablelayoutediting~TableLayoutEditing}
13
+ * as the `'insertTableLayout'` editor command.
14
+ *
15
+ * To insert a layout table at the current selection, execute the command and specify the dimensions:
16
+ *
17
+ * ```ts
18
+ * editor.execute( 'insertTableLayout', { rows: 20, columns: 5 } );
19
+ * ```
20
+ */
21
+ export default class InsertTableLayoutCommand extends Command {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ refresh(): void;
26
+ /**
27
+ * Executes the command.
28
+ *
29
+ * Inserts a layout table with the given number of rows and columns into the editor.
30
+ *
31
+ * @param options.rows The number of rows to create in the inserted table. Default value is 2.
32
+ * @param options.columns The number of columns to create in the inserted table. Default value is 2.
33
+ * @fires execute
34
+ */
35
+ execute(options?: {
36
+ rows?: number;
37
+ columns?: number;
38
+ }): void;
39
+ }
@@ -0,0 +1,65 @@
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/commands/inserttablelayoutcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The insert table layout command.
11
+ *
12
+ * The command is registered by {@link module:table/tablelayout/tablelayoutediting~TableLayoutEditing}
13
+ * as the `'insertTableLayout'` editor command.
14
+ *
15
+ * To insert a layout table at the current selection, execute the command and specify the dimensions:
16
+ *
17
+ * ```ts
18
+ * editor.execute( 'insertTableLayout', { rows: 20, columns: 5 } );
19
+ * ```
20
+ */
21
+ export default class InsertTableLayoutCommand extends Command {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ refresh() {
26
+ const model = this.editor.model;
27
+ const selection = model.document.selection;
28
+ const schema = model.schema;
29
+ this.isEnabled = isAllowedInParent(selection, schema);
30
+ }
31
+ /**
32
+ * Executes the command.
33
+ *
34
+ * Inserts a layout table with the given number of rows and columns into the editor.
35
+ *
36
+ * @param options.rows The number of rows to create in the inserted table. Default value is 2.
37
+ * @param options.columns The number of columns to create in the inserted table. Default value is 2.
38
+ * @fires execute
39
+ */
40
+ execute(options = {}) {
41
+ const editor = this.editor;
42
+ const model = editor.model;
43
+ const tableUtils = editor.plugins.get('TableUtils');
44
+ model.change(writer => {
45
+ const normalizedOptions = { rows: options.rows || 2, columns: options.columns || 2 };
46
+ const table = tableUtils.createTable(writer, normalizedOptions);
47
+ writer.setAttribute('tableType', 'layout', table);
48
+ model.insertObject(table, null, null, { findOptimalPosition: 'auto' });
49
+ const singleColumnWidth = `${100 / normalizedOptions.columns}%`;
50
+ const columnWidths = Array(normalizedOptions.columns).fill(singleColumnWidth);
51
+ const tableWidthsCommand = editor.commands.get('resizeColumnWidths');
52
+ // Make the table full-width with equal columns width.
53
+ tableWidthsCommand.execute({ tableWidth: '100%', columnWidths, table });
54
+ writer.setSelection(writer.createPositionAt(table.getNodeByPath([0, 0, 0]), 0));
55
+ });
56
+ }
57
+ }
58
+ /**
59
+ * Checks if the table is allowed in the parent.
60
+ */
61
+ function isAllowedInParent(selection, schema) {
62
+ const positionParent = selection.getFirstPosition().parent;
63
+ const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;
64
+ return schema.checkChild(validParent, 'table');
65
+ }
@@ -25,6 +25,14 @@ import { removeEmptyRowsColumns } from '../utils/structure.js';
25
25
  * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
26
26
  */
27
27
  export default class MergeCellCommand extends Command {
28
+ /**
29
+ * The direction that indicates which cell will be merged with the currently selected one.
30
+ */
31
+ direction;
32
+ /**
33
+ * Whether the merge is horizontal (left/right) or vertical (up/down).
34
+ */
35
+ isHorizontal;
28
36
  /**
29
37
  * Creates a new `MergeCellCommand` instance.
30
38
  *
@@ -28,12 +28,17 @@ export default class SetHeaderColumnCommand extends Command {
28
28
  * @inheritDoc
29
29
  */
30
30
  refresh() {
31
- const model = this.editor.model;
32
31
  const tableUtils = this.editor.plugins.get('TableUtils');
32
+ const model = this.editor.model;
33
33
  const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);
34
- const isInTable = selectedCells.length > 0;
35
- this.isEnabled = isInTable;
36
- this.value = isInTable && selectedCells.every(cell => isHeadingColumnCell(tableUtils, cell));
34
+ if (selectedCells.length === 0) {
35
+ this.isEnabled = false;
36
+ this.value = false;
37
+ return;
38
+ }
39
+ const table = selectedCells[0].findAncestor('table');
40
+ this.isEnabled = model.schema.checkAttribute(table, 'headingColumns');
41
+ this.value = selectedCells.every(cell => isHeadingColumnCell(tableUtils, cell));
37
42
  }
38
43
  /**
39
44
  * Executes the command.
@@ -30,9 +30,14 @@ export default class SetHeaderRowCommand extends Command {
30
30
  const tableUtils = this.editor.plugins.get('TableUtils');
31
31
  const model = this.editor.model;
32
32
  const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);
33
- const isInTable = selectedCells.length > 0;
34
- this.isEnabled = isInTable;
35
- this.value = isInTable && selectedCells.every(cell => this._isInHeading(cell, cell.parent.parent));
33
+ if (selectedCells.length === 0) {
34
+ this.isEnabled = false;
35
+ this.value = false;
36
+ return;
37
+ }
38
+ const table = selectedCells[0].findAncestor('table');
39
+ this.isEnabled = model.schema.checkAttribute(table, 'headingRows');
40
+ this.value = selectedCells.every(cell => this._isInHeading(cell, cell.parent.parent));
36
41
  }
37
42
  /**
38
43
  * Executes the command.
@@ -19,6 +19,10 @@ import { Command } from 'ckeditor5/src/core.js';
19
19
  * ```
20
20
  */
21
21
  export default class SplitCellCommand extends Command {
22
+ /**
23
+ * The direction that indicates which cell will be split.
24
+ */
25
+ direction;
22
26
  /**
23
27
  * Creates a new `SplitCellCommand` instance.
24
28
  *
@@ -73,7 +73,7 @@ export function downcastCell(options = {}) {
73
73
  const isHeading = tableSlot.row < headingRows || tableSlot.column < headingColumns;
74
74
  const cellElementName = isHeading ? 'th' : 'td';
75
75
  result = options.asWidget ?
76
- toWidgetEditable(writer.createEditableElement(cellElementName), writer) :
76
+ toWidgetEditable(writer.createEditableElement(cellElementName), writer, { withAriaRole: false }) :
77
77
  writer.createContainerElement(cellElementName);
78
78
  break;
79
79
  }
@@ -2,6 +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 { first } from 'ckeditor5/src/utils.js';
5
6
  /**
6
7
  * Conversion helper for upcasting attributes using normalized styles.
7
8
  *
@@ -22,13 +23,23 @@ export function upcastStyleToAttribute(conversion, options) {
22
23
  },
23
24
  model: {
24
25
  key: modelAttribute,
25
- value: (viewElement) => {
26
+ value: (viewElement, conversionApi, data) => {
26
27
  if (!shouldUpcast(viewElement)) {
27
28
  return;
28
29
  }
30
+ let localDefaultValue = defaultValue;
31
+ // Adjust default for layout tables.
32
+ if (data.modelRange) {
33
+ const modelElement = first(data.modelRange.getItems({ shallow: true }));
34
+ const tableElement = modelElement && modelElement.is('element') &&
35
+ modelElement.findAncestor('table', { includeSelf: true });
36
+ if (tableElement && tableElement.getAttribute('tableType') == 'layout') {
37
+ localDefaultValue = '';
38
+ }
39
+ }
29
40
  const normalized = viewElement.getNormalizedStyle(styleName);
30
41
  const value = reduceBoxSides ? reduceBoxSidesValue(normalized) : normalized;
31
- if (defaultValue !== value) {
42
+ if (localDefaultValue !== value) {
32
43
  return value;
33
44
  }
34
45
  }
@@ -77,6 +88,15 @@ export function upcastBorderStyles(conversion, viewElementName, modelAttributes,
77
88
  return;
78
89
  }
79
90
  const modelElement = [...data.modelRange.getItems({ shallow: true })].pop();
91
+ const tableElement = modelElement.findAncestor('table', { includeSelf: true });
92
+ let localDefaultBorder = defaultBorder;
93
+ if (tableElement && tableElement.getAttribute('tableType') == 'layout') {
94
+ localDefaultBorder = {
95
+ style: 'none',
96
+ color: '',
97
+ width: ''
98
+ };
99
+ }
80
100
  conversionApi.consumable.consume(data.viewItem, matcherPattern);
81
101
  const normalizedBorder = {
82
102
  style: data.viewItem.getNormalizedStyle('border-style'),
@@ -88,13 +108,13 @@ export function upcastBorderStyles(conversion, viewElementName, modelAttributes,
88
108
  color: reduceBoxSidesValue(normalizedBorder.color),
89
109
  width: reduceBoxSidesValue(normalizedBorder.width)
90
110
  };
91
- if (reducedBorder.style !== defaultBorder.style) {
111
+ if (reducedBorder.style !== localDefaultBorder.style) {
92
112
  conversionApi.writer.setAttribute(modelAttributes.style, reducedBorder.style, modelElement);
93
113
  }
94
- if (reducedBorder.color !== defaultBorder.color) {
114
+ if (reducedBorder.color !== localDefaultBorder.color) {
95
115
  conversionApi.writer.setAttribute(modelAttributes.color, reducedBorder.color, modelElement);
96
116
  }
97
- if (reducedBorder.width !== defaultBorder.width) {
117
+ if (reducedBorder.width !== localDefaultBorder.width) {
98
118
  conversionApi.writer.setAttribute(modelAttributes.width, reducedBorder.width, modelElement);
99
119
  }
100
120
  }));
package/src/index.d.ts CHANGED
@@ -14,6 +14,8 @@ export { default as TableCellProperties } from './tablecellproperties.js';
14
14
  export { default as TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
15
15
  export { default as TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
16
16
  export { default as TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
17
+ export { default as TableLayout } from './tablelayout.js';
18
+ export { default as TableLayoutEditing } from './tablelayout/tablelayoutediting.js';
17
19
  export { default as TableProperties } from './tableproperties.js';
18
20
  export { default as TablePropertiesEditing } from './tableproperties/tablepropertiesediting.js';
19
21
  export { default as TablePropertiesUI } from './tableproperties/tablepropertiesui.js';
@@ -31,6 +33,8 @@ export type { TableConfig } from './tableconfig.js';
31
33
  export type { default as InsertColumnCommand } from './commands/insertcolumncommand.js';
32
34
  export type { default as InsertRowCommand } from './commands/insertrowcommand.js';
33
35
  export type { default as InsertTableCommand } from './commands/inserttablecommand.js';
36
+ export type { default as InsertTableLayoutCommand } from './commands/inserttablelayoutcommand.js';
37
+ export type { default as TableTypeCommand } from './tablelayout/commands/tabletypecommand.js';
34
38
  export type { default as MergeCellCommand } from './commands/mergecellcommand.js';
35
39
  export type { default as MergeCellsCommand } from './commands/mergecellscommand.js';
36
40
  export type { default as RemoveColumnCommand } from './commands/removecolumncommand.js';
package/src/index.js CHANGED
@@ -14,6 +14,8 @@ export { default as TableCellProperties } from './tablecellproperties.js';
14
14
  export { default as TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
15
15
  export { default as TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
16
16
  export { default as TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
17
+ export { default as TableLayout } from './tablelayout.js';
18
+ export { default as TableLayoutEditing } from './tablelayout/tablelayoutediting.js';
17
19
  export { default as TableProperties } from './tableproperties.js';
18
20
  export { default as TablePropertiesEditing } from './tableproperties/tablepropertiesediting.js';
19
21
  export { default as TablePropertiesUI } from './tableproperties/tablepropertiesui.js';
@@ -9,6 +9,9 @@ import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import Table from './table.js';
10
10
  /**
11
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.
12
15
  */
13
16
  export default class PlainTableOutput extends Plugin {
14
17
  /**
@@ -9,6 +9,9 @@ import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import Table from './table.js';
10
10
  /**
11
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.
12
15
  */
13
16
  export default class PlainTableOutput extends Plugin {
14
17
  /**
@@ -56,6 +59,14 @@ export default class PlainTableOutput extends Plugin {
56
59
  if (editor.plugins.has('TableProperties')) {
57
60
  downcastTableBorderAndBackgroundAttributes(editor);
58
61
  }
62
+ editor.conversion.for('upcast').add(dispatcher => {
63
+ dispatcher.on('element:table', (evt, data, conversionApi) => {
64
+ // It's not necessary to upcast the `table` class. This class was only added in data downcast
65
+ // to center a plain table in the editor output.
66
+ // See: https://github.com/ckeditor/ckeditor5/issues/17888.
67
+ conversionApi.consumable.consume(data.viewItem, { classes: 'table' });
68
+ });
69
+ });
59
70
  }
60
71
  }
61
72
  /**
@@ -96,7 +107,7 @@ function downcastTableElement(table, { writer }) {
96
107
  // {table-body-rows-slot}
97
108
  // </tbody>
98
109
  // </table>
99
- return writer.createContainerElement('table', null, [childrenSlot, ...tableContentElements]);
110
+ return writer.createContainerElement('table', { class: 'table' }, [childrenSlot, ...tableContentElements]);
100
111
  }
101
112
  /**
102
113
  * Register table border and background attributes converters.
@@ -15,6 +15,13 @@ import { isTable, matchTableCaptionViewElement } from './utils.js';
15
15
  * The table caption editing plugin.
16
16
  */
17
17
  export default class TableCaptionEditing extends Plugin {
18
+ /**
19
+ * A map that keeps saved JSONified table captions and table model elements they are
20
+ * associated with.
21
+ *
22
+ * To learn more about this system, see {@link #_saveCaption}.
23
+ */
24
+ _savedCaptionsMap;
18
25
  /**
19
26
  * @inheritDoc
20
27
  */
@@ -5,8 +5,9 @@
5
5
  /**
6
6
  * @module table/tablecaption/tablecaptionui
7
7
  */
8
- import { Plugin, icons } from 'ckeditor5/src/core.js';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { ButtonView } from 'ckeditor5/src/ui.js';
10
+ import { IconCaption } from 'ckeditor5/src/icons.js';
10
11
  import { getCaptionFromModelSelection } from './utils.js';
11
12
  /**
12
13
  * The table caption UI plugin. It introduces the `'toggleTableCaption'` UI button.
@@ -35,7 +36,7 @@ export default class TableCaptionUI extends Plugin {
35
36
  const command = editor.commands.get('toggleTableCaption');
36
37
  const view = new ButtonView(locale);
37
38
  view.set({
38
- icon: icons.caption,
39
+ icon: IconCaption,
39
40
  tooltip: true,
40
41
  isToggleable: true
41
42
  });
@@ -38,7 +38,7 @@ export default class ToggleTableCaptionCommand extends Command {
38
38
  refresh() {
39
39
  const editor = this.editor;
40
40
  const tableElement = getSelectionAffectedTable(editor.model.document.selection);
41
- this.isEnabled = !!tableElement;
41
+ this.isEnabled = !!tableElement && editor.model.schema.checkChild(tableElement, 'caption');
42
42
  if (!this.isEnabled) {
43
43
  this.value = false;
44
44
  }
@@ -19,8 +19,18 @@ export default class TableCellPropertyCommand extends Command {
19
19
  readonly attributeName: string;
20
20
  /**
21
21
  * The default value for the attribute.
22
+ *
23
+ * @readonly
24
+ */
25
+ protected _defaultValue: string | undefined;
26
+ /**
27
+ * The default value for the attribute for the content table.
28
+ */
29
+ private readonly _defaultContentTableValue;
30
+ /**
31
+ * The default value for the attribute for the layout table.
22
32
  */
23
- protected readonly _defaultValue: string;
33
+ private readonly _defaultLayoutTableValue;
24
34
  /**
25
35
  * Creates a new `TableCellPropertyCommand` instance.
26
36
  *
@@ -6,12 +6,31 @@
6
6
  * @module table/tablecellproperties/commands/tablecellpropertycommand
7
7
  */
8
8
  import { Command } from 'ckeditor5/src/core.js';
9
+ import { getSelectionAffectedTable } from '../../utils/common.js';
9
10
  /**
10
11
  * The table cell attribute command.
11
12
  *
12
13
  * The command is a base command for other table cell property commands.
13
14
  */
14
15
  export default class TableCellPropertyCommand extends Command {
16
+ /**
17
+ * The attribute that will be set by the command.
18
+ */
19
+ attributeName;
20
+ /**
21
+ * The default value for the attribute.
22
+ *
23
+ * @readonly
24
+ */
25
+ _defaultValue;
26
+ /**
27
+ * The default value for the attribute for the content table.
28
+ */
29
+ _defaultContentTableValue;
30
+ /**
31
+ * The default value for the attribute for the layout table.
32
+ */
33
+ _defaultLayoutTableValue;
15
34
  /**
16
35
  * Creates a new `TableCellPropertyCommand` instance.
17
36
  *
@@ -22,15 +41,34 @@ export default class TableCellPropertyCommand extends Command {
22
41
  constructor(editor, attributeName, defaultValue) {
23
42
  super(editor);
24
43
  this.attributeName = attributeName;
25
- this._defaultValue = defaultValue;
44
+ this._defaultContentTableValue = defaultValue;
45
+ // Hardcoded defaults for layout table.
46
+ switch (attributeName) {
47
+ case 'tableCellBorderStyle':
48
+ this._defaultLayoutTableValue = 'none';
49
+ break;
50
+ case 'tableCellHorizontalAlignment':
51
+ this._defaultLayoutTableValue = 'left';
52
+ break;
53
+ case 'tableCellVerticalAlignment':
54
+ this._defaultLayoutTableValue = 'middle';
55
+ break;
56
+ default:
57
+ this._defaultLayoutTableValue = undefined;
58
+ }
26
59
  }
27
60
  /**
28
61
  * @inheritDoc
29
62
  */
30
63
  refresh() {
31
64
  const editor = this.editor;
65
+ const selection = editor.model.document.selection;
32
66
  const tableUtils = this.editor.plugins.get('TableUtils');
33
- const selectedTableCells = tableUtils.getSelectionAffectedTableCells(editor.model.document.selection);
67
+ const selectedTableCells = tableUtils.getSelectionAffectedTableCells(selection);
68
+ const table = getSelectionAffectedTable(selection);
69
+ this._defaultValue = !table || table.getAttribute('tableType') !== 'layout' ?
70
+ this._defaultContentTableValue :
71
+ this._defaultLayoutTableValue;
34
72
  this.isEnabled = !!selectedTableCells.length;
35
73
  this.value = this._getSingleValue(selectedTableCells);
36
74
  }