@ckeditor/ckeditor5-table 47.3.0 → 47.4.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.
- package/LICENSE.md +1 -1
- package/build/table.js +3 -3
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/ast.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/be.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/en-gb.js +1 -1
- package/build/translations/eo.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/eu.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/gu.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/hy.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/kk.js +1 -1
- package/build/translations/km.js +1 -1
- package/build/translations/kn.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/ku.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nb.js +1 -1
- package/build/translations/ne.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/oc.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/si.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sl.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/ti.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/dist/index-content.css +5 -1
- package/dist/index-editor.css +77 -86
- package/dist/index.css +124 -127
- package/dist/index.css.map +1 -1
- package/dist/index.js +863 -138
- package/dist/index.js.map +1 -1
- package/dist/translations/af.d.ts +1 -1
- package/dist/translations/af.js +2 -2
- package/dist/translations/af.umd.js +2 -2
- package/dist/translations/ar.d.ts +1 -1
- package/dist/translations/ar.js +2 -2
- package/dist/translations/ar.umd.js +2 -2
- package/dist/translations/ast.d.ts +1 -1
- package/dist/translations/ast.js +2 -2
- package/dist/translations/ast.umd.js +2 -2
- package/dist/translations/az.d.ts +1 -1
- package/dist/translations/az.js +2 -2
- package/dist/translations/az.umd.js +2 -2
- package/dist/translations/be.d.ts +1 -1
- package/dist/translations/be.js +2 -2
- package/dist/translations/be.umd.js +2 -2
- package/dist/translations/bg.d.ts +1 -1
- package/dist/translations/bg.js +2 -2
- package/dist/translations/bg.umd.js +2 -2
- package/dist/translations/bn.d.ts +1 -1
- package/dist/translations/bn.js +2 -2
- package/dist/translations/bn.umd.js +2 -2
- package/dist/translations/bs.d.ts +1 -1
- package/dist/translations/bs.js +2 -2
- package/dist/translations/bs.umd.js +2 -2
- package/dist/translations/ca.d.ts +1 -1
- package/dist/translations/ca.js +2 -2
- package/dist/translations/ca.umd.js +2 -2
- package/dist/translations/cs.d.ts +1 -1
- package/dist/translations/cs.js +2 -2
- package/dist/translations/cs.umd.js +2 -2
- package/dist/translations/da.d.ts +1 -1
- package/dist/translations/da.js +2 -2
- package/dist/translations/da.umd.js +2 -2
- package/dist/translations/de-ch.d.ts +1 -1
- package/dist/translations/de-ch.js +2 -2
- package/dist/translations/de-ch.umd.js +2 -2
- package/dist/translations/de.d.ts +1 -1
- package/dist/translations/de.js +2 -2
- package/dist/translations/de.umd.js +2 -2
- package/dist/translations/el.d.ts +1 -1
- package/dist/translations/el.js +2 -2
- package/dist/translations/el.umd.js +2 -2
- package/dist/translations/en-au.d.ts +1 -1
- package/dist/translations/en-au.js +2 -2
- package/dist/translations/en-au.umd.js +2 -2
- package/dist/translations/en-gb.d.ts +1 -1
- package/dist/translations/en-gb.js +2 -2
- package/dist/translations/en-gb.umd.js +2 -2
- package/dist/translations/en.d.ts +1 -1
- package/dist/translations/en.js +2 -2
- package/dist/translations/en.umd.js +2 -2
- package/dist/translations/eo.d.ts +1 -1
- package/dist/translations/eo.js +2 -2
- package/dist/translations/eo.umd.js +2 -2
- package/dist/translations/es-co.d.ts +1 -1
- package/dist/translations/es-co.js +2 -2
- package/dist/translations/es-co.umd.js +2 -2
- package/dist/translations/es.d.ts +1 -1
- package/dist/translations/es.js +2 -2
- package/dist/translations/es.umd.js +2 -2
- package/dist/translations/et.d.ts +1 -1
- package/dist/translations/et.js +2 -2
- package/dist/translations/et.umd.js +2 -2
- package/dist/translations/eu.d.ts +1 -1
- package/dist/translations/eu.js +2 -2
- package/dist/translations/eu.umd.js +2 -2
- package/dist/translations/fa.d.ts +1 -1
- package/dist/translations/fa.js +2 -2
- package/dist/translations/fa.umd.js +2 -2
- package/dist/translations/fi.d.ts +1 -1
- package/dist/translations/fi.js +2 -2
- package/dist/translations/fi.umd.js +2 -2
- package/dist/translations/fr.d.ts +1 -1
- package/dist/translations/fr.js +2 -2
- package/dist/translations/fr.umd.js +2 -2
- package/dist/translations/gl.d.ts +1 -1
- package/dist/translations/gl.js +2 -2
- package/dist/translations/gl.umd.js +2 -2
- package/dist/translations/gu.d.ts +1 -1
- package/dist/translations/gu.js +2 -2
- package/dist/translations/gu.umd.js +2 -2
- package/dist/translations/he.d.ts +1 -1
- package/dist/translations/he.js +2 -2
- package/dist/translations/he.umd.js +2 -2
- package/dist/translations/hi.d.ts +1 -1
- package/dist/translations/hi.js +2 -2
- package/dist/translations/hi.umd.js +2 -2
- package/dist/translations/hr.d.ts +1 -1
- package/dist/translations/hr.js +2 -2
- package/dist/translations/hr.umd.js +2 -2
- package/dist/translations/hu.d.ts +1 -1
- package/dist/translations/hu.js +2 -2
- package/dist/translations/hu.umd.js +2 -2
- package/dist/translations/hy.d.ts +1 -1
- package/dist/translations/hy.js +2 -2
- package/dist/translations/hy.umd.js +2 -2
- package/dist/translations/id.d.ts +1 -1
- package/dist/translations/id.js +2 -2
- package/dist/translations/id.umd.js +2 -2
- package/dist/translations/it.d.ts +1 -1
- package/dist/translations/it.js +2 -2
- package/dist/translations/it.umd.js +2 -2
- package/dist/translations/ja.d.ts +1 -1
- package/dist/translations/ja.js +2 -2
- package/dist/translations/ja.umd.js +2 -2
- package/dist/translations/jv.d.ts +1 -1
- package/dist/translations/jv.js +2 -2
- package/dist/translations/jv.umd.js +2 -2
- package/dist/translations/kk.d.ts +1 -1
- package/dist/translations/kk.js +2 -2
- package/dist/translations/kk.umd.js +2 -2
- package/dist/translations/km.d.ts +1 -1
- package/dist/translations/km.js +2 -2
- package/dist/translations/km.umd.js +2 -2
- package/dist/translations/kn.d.ts +1 -1
- package/dist/translations/kn.js +2 -2
- package/dist/translations/kn.umd.js +2 -2
- package/dist/translations/ko.d.ts +1 -1
- package/dist/translations/ko.js +2 -2
- package/dist/translations/ko.umd.js +2 -2
- package/dist/translations/ku.d.ts +1 -1
- package/dist/translations/ku.js +2 -2
- package/dist/translations/ku.umd.js +2 -2
- package/dist/translations/lt.d.ts +1 -1
- package/dist/translations/lt.js +2 -2
- package/dist/translations/lt.umd.js +2 -2
- package/dist/translations/lv.d.ts +1 -1
- package/dist/translations/lv.js +2 -2
- package/dist/translations/lv.umd.js +2 -2
- package/dist/translations/ms.d.ts +1 -1
- package/dist/translations/ms.js +2 -2
- package/dist/translations/ms.umd.js +2 -2
- package/dist/translations/nb.d.ts +1 -1
- package/dist/translations/nb.js +2 -2
- package/dist/translations/nb.umd.js +2 -2
- package/dist/translations/ne.d.ts +1 -1
- package/dist/translations/ne.js +2 -2
- package/dist/translations/ne.umd.js +2 -2
- package/dist/translations/nl.d.ts +1 -1
- package/dist/translations/nl.js +2 -2
- package/dist/translations/nl.umd.js +2 -2
- package/dist/translations/no.d.ts +1 -1
- package/dist/translations/no.js +2 -2
- package/dist/translations/no.umd.js +2 -2
- package/dist/translations/oc.d.ts +1 -1
- package/dist/translations/oc.js +2 -2
- package/dist/translations/oc.umd.js +2 -2
- package/dist/translations/pl.d.ts +1 -1
- package/dist/translations/pl.js +2 -2
- package/dist/translations/pl.umd.js +2 -2
- package/dist/translations/pt-br.d.ts +1 -1
- package/dist/translations/pt-br.js +2 -2
- package/dist/translations/pt-br.umd.js +2 -2
- package/dist/translations/pt.d.ts +1 -1
- package/dist/translations/pt.js +2 -2
- package/dist/translations/pt.umd.js +2 -2
- package/dist/translations/ro.d.ts +1 -1
- package/dist/translations/ro.js +2 -2
- package/dist/translations/ro.umd.js +2 -2
- package/dist/translations/ru.d.ts +1 -1
- package/dist/translations/ru.js +2 -2
- package/dist/translations/ru.umd.js +2 -2
- package/dist/translations/si.d.ts +1 -1
- package/dist/translations/si.js +2 -2
- package/dist/translations/si.umd.js +2 -2
- package/dist/translations/sk.d.ts +1 -1
- package/dist/translations/sk.js +2 -2
- package/dist/translations/sk.umd.js +2 -2
- package/dist/translations/sl.d.ts +1 -1
- package/dist/translations/sl.js +2 -2
- package/dist/translations/sl.umd.js +2 -2
- package/dist/translations/sq.d.ts +1 -1
- package/dist/translations/sq.js +2 -2
- package/dist/translations/sq.umd.js +2 -2
- package/dist/translations/sr-latn.d.ts +1 -1
- package/dist/translations/sr-latn.js +2 -2
- package/dist/translations/sr-latn.umd.js +2 -2
- package/dist/translations/sr.d.ts +1 -1
- package/dist/translations/sr.js +2 -2
- package/dist/translations/sr.umd.js +2 -2
- package/dist/translations/sv.d.ts +1 -1
- package/dist/translations/sv.js +2 -2
- package/dist/translations/sv.umd.js +2 -2
- package/dist/translations/th.d.ts +1 -1
- package/dist/translations/th.js +2 -2
- package/dist/translations/th.umd.js +2 -2
- package/dist/translations/ti.d.ts +1 -1
- package/dist/translations/ti.js +2 -2
- package/dist/translations/ti.umd.js +2 -2
- package/dist/translations/tk.d.ts +1 -1
- package/dist/translations/tk.js +2 -2
- package/dist/translations/tk.umd.js +2 -2
- package/dist/translations/tr.d.ts +1 -1
- package/dist/translations/tr.js +2 -2
- package/dist/translations/tr.umd.js +2 -2
- package/dist/translations/tt.d.ts +1 -1
- package/dist/translations/tt.js +2 -2
- package/dist/translations/tt.umd.js +2 -2
- package/dist/translations/ug.d.ts +1 -1
- package/dist/translations/ug.js +2 -2
- package/dist/translations/ug.umd.js +2 -2
- package/dist/translations/uk.d.ts +1 -1
- package/dist/translations/uk.js +2 -2
- package/dist/translations/uk.umd.js +2 -2
- package/dist/translations/ur.d.ts +1 -1
- package/dist/translations/ur.js +2 -2
- package/dist/translations/ur.umd.js +2 -2
- package/dist/translations/uz.d.ts +1 -1
- package/dist/translations/uz.js +2 -2
- package/dist/translations/uz.umd.js +2 -2
- package/dist/translations/vi.d.ts +1 -1
- package/dist/translations/vi.js +2 -2
- package/dist/translations/vi.umd.js +2 -2
- package/dist/translations/zh-cn.d.ts +1 -1
- package/dist/translations/zh-cn.js +2 -2
- package/dist/translations/zh-cn.umd.js +2 -2
- package/dist/translations/zh.d.ts +1 -1
- package/dist/translations/zh.js +2 -2
- package/dist/translations/zh.umd.js +2 -2
- package/lang/contexts.json +3 -0
- package/lang/translations/af.po +13 -1
- package/lang/translations/ar.po +13 -1
- package/lang/translations/ast.po +13 -1
- package/lang/translations/az.po +13 -1
- package/lang/translations/be.po +13 -1
- package/lang/translations/bg.po +13 -1
- package/lang/translations/bn.po +13 -1
- package/lang/translations/bs.po +13 -1
- package/lang/translations/ca.po +13 -1
- package/lang/translations/cs.po +13 -1
- package/lang/translations/da.po +13 -1
- package/lang/translations/de-ch.po +13 -1
- package/lang/translations/de.po +13 -1
- package/lang/translations/el.po +13 -1
- package/lang/translations/en-au.po +13 -1
- package/lang/translations/en-gb.po +13 -1
- package/lang/translations/en.po +13 -1
- package/lang/translations/eo.po +13 -1
- package/lang/translations/es-co.po +13 -1
- package/lang/translations/es.po +13 -1
- package/lang/translations/et.po +13 -1
- package/lang/translations/eu.po +13 -1
- package/lang/translations/fa.po +13 -1
- package/lang/translations/fi.po +13 -1
- package/lang/translations/fr.po +13 -1
- package/lang/translations/gl.po +13 -1
- package/lang/translations/gu.po +13 -1
- package/lang/translations/he.po +13 -1
- package/lang/translations/hi.po +13 -1
- package/lang/translations/hr.po +13 -1
- package/lang/translations/hu.po +13 -1
- package/lang/translations/hy.po +13 -1
- package/lang/translations/id.po +13 -1
- package/lang/translations/it.po +13 -1
- package/lang/translations/ja.po +13 -1
- package/lang/translations/jv.po +13 -1
- package/lang/translations/kk.po +13 -1
- package/lang/translations/km.po +13 -1
- package/lang/translations/kn.po +13 -1
- package/lang/translations/ko.po +13 -1
- package/lang/translations/ku.po +13 -1
- package/lang/translations/lt.po +13 -1
- package/lang/translations/lv.po +13 -1
- package/lang/translations/ms.po +13 -1
- package/lang/translations/nb.po +13 -1
- package/lang/translations/ne.po +13 -1
- package/lang/translations/nl.po +13 -1
- package/lang/translations/no.po +13 -1
- package/lang/translations/oc.po +13 -1
- package/lang/translations/pl.po +13 -1
- package/lang/translations/pt-br.po +13 -1
- package/lang/translations/pt.po +13 -1
- package/lang/translations/ro.po +13 -1
- package/lang/translations/ru.po +13 -1
- package/lang/translations/si.po +13 -1
- package/lang/translations/sk.po +13 -1
- package/lang/translations/sl.po +13 -1
- package/lang/translations/sq.po +13 -1
- package/lang/translations/sr-latn.po +13 -1
- package/lang/translations/sr.po +13 -1
- package/lang/translations/sv.po +13 -1
- package/lang/translations/th.po +13 -1
- package/lang/translations/ti.po +13 -1
- package/lang/translations/tk.po +13 -1
- package/lang/translations/tr.po +13 -1
- package/lang/translations/tt.po +13 -1
- package/lang/translations/ug.po +13 -1
- package/lang/translations/uk.po +13 -1
- package/lang/translations/ur.po +13 -1
- package/lang/translations/uz.po +13 -1
- package/lang/translations/vi.po +13 -1
- package/lang/translations/zh-cn.po +13 -1
- package/lang/translations/zh.po +13 -1
- package/package.json +10 -10
- package/src/augmentation.d.ts +11 -2
- package/src/augmentation.js +1 -1
- package/src/commands/insertcolumncommand.d.ts +1 -1
- package/src/commands/insertcolumncommand.js +1 -1
- package/src/commands/insertrowcommand.d.ts +1 -1
- package/src/commands/insertrowcommand.js +1 -1
- package/src/commands/inserttablecommand.d.ts +1 -1
- package/src/commands/inserttablecommand.js +1 -1
- package/src/commands/inserttablelayoutcommand.d.ts +1 -1
- package/src/commands/inserttablelayoutcommand.js +1 -1
- package/src/commands/mergecellcommand.d.ts +1 -1
- package/src/commands/mergecellcommand.js +1 -1
- package/src/commands/mergecellscommand.d.ts +1 -1
- package/src/commands/mergecellscommand.js +1 -1
- package/src/commands/removecolumncommand.d.ts +1 -1
- package/src/commands/removecolumncommand.js +1 -1
- package/src/commands/removerowcommand.d.ts +1 -1
- package/src/commands/removerowcommand.js +1 -1
- package/src/commands/selectcolumncommand.d.ts +1 -1
- package/src/commands/selectcolumncommand.js +1 -1
- package/src/commands/selectrowcommand.d.ts +1 -1
- package/src/commands/selectrowcommand.js +1 -1
- package/src/commands/setheadercolumncommand.d.ts +1 -1
- package/src/commands/setheadercolumncommand.js +3 -3
- package/src/commands/setheaderrowcommand.d.ts +1 -1
- package/src/commands/setheaderrowcommand.js +2 -3
- package/src/commands/splitcellcommand.d.ts +1 -1
- package/src/commands/splitcellcommand.js +1 -1
- package/src/converters/downcast.d.ts +5 -3
- package/src/converters/downcast.js +21 -9
- package/src/converters/table-caption-post-fixer.d.ts +1 -1
- package/src/converters/table-caption-post-fixer.js +1 -1
- package/src/converters/table-cell-paragraph-post-fixer.d.ts +1 -1
- package/src/converters/table-cell-paragraph-post-fixer.js +1 -1
- package/src/converters/table-cell-refresh-handler.d.ts +1 -1
- package/src/converters/table-cell-refresh-handler.js +1 -1
- package/src/converters/table-headings-refresh-handler.d.ts +1 -1
- package/src/converters/table-headings-refresh-handler.js +1 -1
- package/src/converters/table-layout-post-fixer.d.ts +1 -1
- package/src/converters/table-layout-post-fixer.js +1 -1
- package/src/converters/tableproperties.d.ts +1 -1
- package/src/converters/tableproperties.js +1 -1
- package/src/converters/upcasttable.d.ts +1 -1
- package/src/converters/upcasttable.js +13 -6
- package/src/index.d.ts +3 -2
- package/src/index.js +3 -2
- package/src/plaintableoutput.d.ts +1 -1
- package/src/plaintableoutput.js +1 -1
- package/src/table.d.ts +1 -1
- package/src/table.js +1 -1
- package/src/tablecaption/tablecaptionediting.d.ts +1 -1
- package/src/tablecaption/tablecaptionediting.js +1 -1
- package/src/tablecaption/tablecaptionui.d.ts +1 -1
- package/src/tablecaption/tablecaptionui.js +1 -1
- package/src/tablecaption/toggletablecaptioncommand.d.ts +1 -1
- package/src/tablecaption/toggletablecaptioncommand.js +1 -1
- package/src/tablecaption/utils.d.ts +1 -1
- package/src/tablecaption/utils.js +1 -1
- package/src/tablecaption.d.ts +1 -1
- package/src/tablecaption.js +1 -1
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellborderstylecommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellborderstylecommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellheightcommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellheightcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpaddingcommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellpaddingcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +20 -2
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +9 -1
- package/src/tablecellproperties/commands/tablecelltypecommand.d.ts +53 -0
- package/src/tablecellproperties/commands/tablecelltypecommand.js +167 -0
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +1 -1
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +1 -1
- package/src/tablecellproperties/tablecellpropertiesediting.d.ts +1 -4
- package/src/tablecellproperties/tablecellpropertiesediting.js +121 -1
- package/src/tablecellproperties/tablecellpropertiesui.d.ts +1 -1
- package/src/tablecellproperties/tablecellpropertiesui.js +1 -1
- package/src/tablecellproperties/tablecellpropertiesuiexperimental.d.ts +1 -1
- package/src/tablecellproperties/tablecellpropertiesuiexperimental.js +34 -12
- package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +1 -1
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +1 -1
- package/src/tablecellproperties/ui/tablecellpropertiesviewexperimental.d.ts +33 -4
- package/src/tablecellproperties/ui/tablecellpropertiesviewexperimental.js +130 -19
- package/src/tablecellproperties.d.ts +1 -1
- package/src/tablecellproperties.js +1 -1
- package/src/tablecellwidth/commands/tablecellwidthcommand.d.ts +1 -1
- package/src/tablecellwidth/commands/tablecellwidthcommand.js +1 -1
- package/src/tablecellwidth/tablecellwidthediting.d.ts +1 -1
- package/src/tablecellwidth/tablecellwidthediting.js +1 -1
- package/src/tableclipboard.d.ts +1 -1
- package/src/tableclipboard.js +1 -1
- package/src/tablecolumnresize/constants.d.ts +1 -1
- package/src/tablecolumnresize/constants.js +1 -1
- package/src/tablecolumnresize/converters.d.ts +1 -1
- package/src/tablecolumnresize/converters.js +1 -1
- package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +1 -1
- package/src/tablecolumnresize/tablecolumnresizeediting.js +1 -1
- package/src/tablecolumnresize/tablewidthscommand.d.ts +1 -1
- package/src/tablecolumnresize/tablewidthscommand.js +1 -1
- package/src/tablecolumnresize/utils.d.ts +1 -1
- package/src/tablecolumnresize/utils.js +1 -1
- package/src/tablecolumnresize.d.ts +1 -1
- package/src/tablecolumnresize.js +1 -1
- package/src/tableconfig.d.ts +19 -1
- package/src/tableconfig.js +1 -1
- package/src/tableediting.d.ts +1 -1
- package/src/tableediting.js +24 -6
- package/src/tablekeyboard.d.ts +1 -1
- package/src/tablekeyboard.js +1 -1
- package/src/tablelayout/commands/tabletypecommand.d.ts +1 -1
- package/src/tablelayout/commands/tabletypecommand.js +1 -1
- package/src/tablelayout/tablelayoutediting.d.ts +1 -1
- package/src/tablelayout/tablelayoutediting.js +1 -1
- package/src/tablelayout/tablelayoutui.d.ts +1 -1
- package/src/tablelayout/tablelayoutui.js +12 -5
- package/src/tablelayout.d.ts +1 -1
- package/src/tablelayout.js +1 -1
- package/src/tablemouse/mouseeventsobserver.d.ts +1 -1
- package/src/tablemouse/mouseeventsobserver.js +1 -1
- package/src/tablemouse.d.ts +1 -1
- package/src/tablemouse.js +1 -1
- package/src/tableproperties/commands/tablealignmentcommand.d.ts +1 -1
- package/src/tableproperties/commands/tablealignmentcommand.js +1 -1
- package/src/tableproperties/commands/tablebackgroundcolorcommand.d.ts +1 -1
- package/src/tableproperties/commands/tablebackgroundcolorcommand.js +1 -1
- package/src/tableproperties/commands/tablebordercolorcommand.d.ts +1 -1
- package/src/tableproperties/commands/tablebordercolorcommand.js +1 -1
- package/src/tableproperties/commands/tableborderstylecommand.d.ts +1 -1
- package/src/tableproperties/commands/tableborderstylecommand.js +1 -1
- package/src/tableproperties/commands/tableborderwidthcommand.d.ts +1 -1
- package/src/tableproperties/commands/tableborderwidthcommand.js +1 -1
- package/src/tableproperties/commands/tableheightcommand.d.ts +1 -1
- package/src/tableproperties/commands/tableheightcommand.js +1 -1
- package/src/tableproperties/commands/tablepropertycommand.d.ts +1 -1
- package/src/tableproperties/commands/tablepropertycommand.js +1 -1
- package/src/tableproperties/commands/tablewidthcommand.d.ts +1 -1
- package/src/tableproperties/commands/tablewidthcommand.js +1 -1
- package/src/tableproperties/tablepropertiesediting.d.ts +1 -1
- package/src/tableproperties/tablepropertiesediting.js +1 -1
- package/src/tableproperties/tablepropertiesui.d.ts +1 -1
- package/src/tableproperties/tablepropertiesui.js +1 -1
- package/src/tableproperties/tablepropertiesuiexperimental.d.ts +1 -1
- package/src/tableproperties/tablepropertiesuiexperimental.js +1 -1
- package/src/tableproperties/ui/tablepropertiesview.d.ts +1 -1
- package/src/tableproperties/ui/tablepropertiesview.js +1 -1
- package/src/tableproperties/ui/tablepropertiesviewexperimental.d.ts +1 -1
- package/src/tableproperties/ui/tablepropertiesviewexperimental.js +1 -1
- package/src/tableproperties.d.ts +1 -1
- package/src/tableproperties.js +1 -1
- package/src/tableselection.d.ts +1 -1
- package/src/tableselection.js +1 -1
- package/src/tabletoolbar.d.ts +1 -1
- package/src/tabletoolbar.js +1 -1
- package/src/tableui.d.ts +1 -1
- package/src/tableui.js +1 -1
- package/src/tableutils.d.ts +39 -1
- package/src/tableutils.js +220 -14
- package/src/tablewalker.d.ts +1 -1
- package/src/tablewalker.js +1 -1
- package/src/ui/colorinputview.d.ts +1 -1
- package/src/ui/colorinputview.js +1 -1
- package/src/ui/inserttableview.d.ts +1 -1
- package/src/ui/inserttableview.js +1 -1
- package/src/utils/common.d.ts +24 -1
- package/src/utils/common.js +43 -1
- package/src/utils/structure.d.ts +1 -1
- package/src/utils/structure.js +1 -1
- package/src/utils/table-properties.d.ts +1 -1
- package/src/utils/table-properties.js +1 -1
- package/src/utils/ui/contextualballoon.d.ts +1 -1
- package/src/utils/ui/contextualballoon.js +1 -1
- package/src/utils/ui/table-properties.d.ts +1 -1
- package/src/utils/ui/table-properties.js +1 -1
- package/src/utils/ui/table-propertiesexperimental.d.ts +1 -1
- package/src/utils/ui/table-propertiesexperimental.js +1 -1
- package/src/utils/ui/widget.d.ts +1 -1
- package/src/utils/ui/widget.js +1 -1
- package/theme/colorinput.css +1 -1
- package/theme/formrow-experimental.css +1 -1
- package/theme/formrow.css +1 -1
- package/theme/inserttable.css +1 -1
- package/theme/table.css +7 -2
- package/theme/tablecaption.css +1 -1
- package/theme/tablecellproperties-experimental.css +4 -0
- package/theme/tablecellproperties.css +1 -1
- package/theme/tablecolumnresize.css +1 -1
- package/theme/tableediting.css +1 -1
- package/theme/tableform-experimental.css +1 -13
- package/theme/tableform.css +6 -7
- package/theme/tablelayout.css +1 -1
- package/theme/tableproperties-experimental.css +1 -1
- package/theme/tableproperties.css +1 -1
- package/theme/tableselection.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tableproperties.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tableproperties.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tableselection.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tableselection.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tabletoolbar.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tabletoolbar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tableui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tableui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tableutils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
@@ -350,6 +350,44 @@ export declare class TableUtils extends Plugin {
|
|
|
350
350
|
* {@link #getTableCellsContainingSelection}.
|
|
351
351
|
*/
|
|
352
352
|
getSelectedTableCells(selection: ModelSelection | ModelDocumentSelection): Array<ModelElement>;
|
|
353
|
+
/**
|
|
354
|
+
* Sets the number of heading rows for the given `table`.
|
|
355
|
+
*
|
|
356
|
+
* @param writer The model writer.
|
|
357
|
+
* @param table The table model element.
|
|
358
|
+
* @param headingRows The number of heading rows to set.
|
|
359
|
+
* @param options Additional options.
|
|
360
|
+
* @param options.shallow If set to `true` it will only update the `headingRows` attribute
|
|
361
|
+
* without updating the cell types in the table. Default is `false`.
|
|
362
|
+
* @param options.resetFormerHeadingCells If set to `true`, it will check if the rows that are no longer in the heading section
|
|
363
|
+
* should be updated to body cells. Default is `true`.
|
|
364
|
+
* @param options.autoExpand If set to `true`, it will check if the following rows look like a header and expand the heading section.
|
|
365
|
+
* Default is `true`.
|
|
366
|
+
*/
|
|
367
|
+
setHeadingRowsCount(writer: ModelWriter, table: ModelElement, headingRows: number, options?: {
|
|
368
|
+
shallow?: boolean;
|
|
369
|
+
resetFormerHeadingCells?: boolean;
|
|
370
|
+
autoExpand?: boolean;
|
|
371
|
+
}): void;
|
|
372
|
+
/**
|
|
373
|
+
* Sets the number of heading columns for the given `table`.
|
|
374
|
+
*
|
|
375
|
+
* @param writer The model writer to use.
|
|
376
|
+
* @param table The table model element.
|
|
377
|
+
* @param headingColumns The number of heading columns to set.
|
|
378
|
+
* @param options Additional options.
|
|
379
|
+
* @param options.shallow If set to `true` it will only update the `headingColumns` attribute
|
|
380
|
+
* without updating the cell types in the table. Default is `false`.
|
|
381
|
+
* @param options.resetFormerHeadingCells If set to `true`, it will check if the columns that are no longer in the heading section
|
|
382
|
+
* should be updated to body cells. Default is `true`.
|
|
383
|
+
* @param options.autoExpand If set to `true`, it will check if the following columns look like a header and expand the heading section.
|
|
384
|
+
* Default is `true`.
|
|
385
|
+
*/
|
|
386
|
+
setHeadingColumnsCount(writer: ModelWriter, table: ModelElement, headingColumns: number, options?: {
|
|
387
|
+
shallow?: boolean;
|
|
388
|
+
resetFormerHeadingCells?: boolean;
|
|
389
|
+
autoExpand?: boolean;
|
|
390
|
+
}): void;
|
|
353
391
|
/**
|
|
354
392
|
* Returns all model table cells that the provided model selection's ranges
|
|
355
393
|
* {@link module:engine/model/range~ModelRange#start} inside.
|
package/src/tableutils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { CKEditorError } from 'ckeditor5/src/utils.js';
|
|
9
9
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
10
|
import { TableWalker } from './tablewalker.js';
|
|
11
|
-
import { createEmptyTableCell, updateNumericAttribute } from './utils/common.js';
|
|
11
|
+
import { createEmptyTableCell, updateNumericAttribute, isEntireCellsLineHeader, isTableCellTypeEnabled } from './utils/common.js';
|
|
12
12
|
import { removeEmptyColumns, removeEmptyRows } from './utils/structure.js';
|
|
13
13
|
import { getTableColumnElements } from './tablecolumnresize/utils.js';
|
|
14
14
|
/**
|
|
@@ -103,10 +103,10 @@ export class TableUtils extends Plugin {
|
|
|
103
103
|
const columns = options.columns || 2;
|
|
104
104
|
createEmptyRows(writer, table, 0, rows, columns);
|
|
105
105
|
if (options.headingRows) {
|
|
106
|
-
|
|
106
|
+
this.setHeadingRowsCount(writer, table, Math.min(options.headingRows, rows));
|
|
107
107
|
}
|
|
108
108
|
if (options.headingColumns) {
|
|
109
|
-
|
|
109
|
+
this.setHeadingColumnsCount(writer, table, Math.min(options.headingColumns, columns));
|
|
110
110
|
}
|
|
111
111
|
return table;
|
|
112
112
|
}
|
|
@@ -144,6 +144,7 @@ export class TableUtils extends Plugin {
|
|
|
144
144
|
const rowsToInsert = options.rows || 1;
|
|
145
145
|
const isCopyStructure = options.copyStructureFromAbove !== undefined;
|
|
146
146
|
const copyStructureFrom = options.copyStructureFromAbove ? insertAt - 1 : insertAt;
|
|
147
|
+
const cellTypeEnabled = isTableCellTypeEnabled(this.editor);
|
|
147
148
|
const rows = this.getRows(table);
|
|
148
149
|
const columns = this.getColumns(table);
|
|
149
150
|
if (insertAt > rows) {
|
|
@@ -155,14 +156,29 @@ export class TableUtils extends Plugin {
|
|
|
155
156
|
throw new CKEditorError('tableutils-insertrows-insert-out-of-range', this, { options });
|
|
156
157
|
}
|
|
157
158
|
model.change(writer => {
|
|
158
|
-
|
|
159
|
+
let headingRows = table.getAttribute('headingRows') || 0;
|
|
160
|
+
const headingColumns = table.getAttribute('headingColumns') || 0;
|
|
159
161
|
// Inserting rows inside heading section requires to update `headingRows` attribute as the heading section will grow.
|
|
160
162
|
if (headingRows > insertAt) {
|
|
161
|
-
|
|
163
|
+
headingRows += rowsToInsert;
|
|
164
|
+
this.setHeadingRowsCount(writer, table, headingRows, {
|
|
165
|
+
shallow: true
|
|
166
|
+
});
|
|
162
167
|
}
|
|
163
168
|
// Inserting at the end or at the beginning of a table doesn't require to calculate anything special.
|
|
164
169
|
if (!isCopyStructure && (insertAt === 0 || insertAt === rows)) {
|
|
165
|
-
createEmptyRows(writer, table, insertAt, rowsToInsert, columns);
|
|
170
|
+
const rows = createEmptyRows(writer, table, insertAt, rowsToInsert, columns);
|
|
171
|
+
if (cellTypeEnabled) {
|
|
172
|
+
for (let rowOffset = 0; rowOffset < rows.length; rowOffset++) {
|
|
173
|
+
const row = rows[rowOffset];
|
|
174
|
+
for (let columnIndex = 0; columnIndex < columns; columnIndex++) {
|
|
175
|
+
const cell = row[columnIndex];
|
|
176
|
+
if (insertAt + rowOffset < headingRows || columnIndex < headingColumns) {
|
|
177
|
+
writer.setAttribute('tableCellType', 'header', cell);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
166
182
|
return;
|
|
167
183
|
}
|
|
168
184
|
// Iterate over all the rows above the inserted rows in order to check for the row-spanned cells.
|
|
@@ -194,7 +210,11 @@ export class TableUtils extends Plugin {
|
|
|
194
210
|
const insertPosition = writer.createPositionAt(tableRow, 'end');
|
|
195
211
|
// Insert the empty cell only if this slot is not row-spanned from any other cell.
|
|
196
212
|
if (colspan > 0) {
|
|
197
|
-
createEmptyTableCell(writer, insertPosition, colspan > 1 ? { colspan } : undefined);
|
|
213
|
+
const insertedCells = createEmptyTableCell(writer, insertPosition, colspan > 1 ? { colspan } : undefined);
|
|
214
|
+
// If we insert row in heading section, set proper cell type.
|
|
215
|
+
if (cellTypeEnabled && (insertAt + rowIndex < headingRows || cellIndex < headingColumns)) {
|
|
216
|
+
writer.setAttribute('tableCellType', 'header', insertedCells);
|
|
217
|
+
}
|
|
198
218
|
}
|
|
199
219
|
// Skip the col-spanned slots, there won't be any cells.
|
|
200
220
|
cellIndex += Math.abs(colspan) - 1;
|
|
@@ -233,21 +253,36 @@ export class TableUtils extends Plugin {
|
|
|
233
253
|
const model = this.editor.model;
|
|
234
254
|
const insertAt = options.at || 0;
|
|
235
255
|
const columnsToInsert = options.columns || 1;
|
|
256
|
+
const cellTypeEnabled = isTableCellTypeEnabled(this.editor);
|
|
236
257
|
model.change(writer => {
|
|
237
|
-
const
|
|
258
|
+
const headingRows = table.getAttribute('headingRows') || 0;
|
|
259
|
+
let headingColumns = table.getAttribute('headingColumns');
|
|
238
260
|
// Inserting columns inside heading section requires to update `headingColumns` attribute as the heading section will grow.
|
|
239
261
|
if (insertAt < headingColumns) {
|
|
240
|
-
|
|
262
|
+
headingColumns += columnsToInsert;
|
|
263
|
+
this.setHeadingColumnsCount(writer, table, headingColumns, {
|
|
264
|
+
shallow: true
|
|
265
|
+
});
|
|
241
266
|
}
|
|
242
267
|
const tableColumns = this.getColumns(table);
|
|
243
268
|
// Inserting at the end and at the beginning of a table doesn't require to calculate anything special.
|
|
244
269
|
if (insertAt === 0 || tableColumns === insertAt) {
|
|
270
|
+
let rowIndex = 0;
|
|
245
271
|
for (const tableRow of table.getChildren()) {
|
|
246
272
|
// Ignore non-row elements inside the table (e.g. caption).
|
|
247
273
|
if (!tableRow.is('element', 'tableRow')) {
|
|
248
274
|
continue;
|
|
249
275
|
}
|
|
250
|
-
createCells(columnsToInsert, writer, writer.createPositionAt(tableRow, insertAt ? 'end' : 0));
|
|
276
|
+
const insertedCells = createCells(columnsToInsert, writer, writer.createPositionAt(tableRow, insertAt ? 'end' : 0));
|
|
277
|
+
if (cellTypeEnabled) {
|
|
278
|
+
// If we insert column in heading section, set proper cell type.
|
|
279
|
+
for (let columnOffset = 0; columnOffset < insertedCells.length; columnOffset++) {
|
|
280
|
+
if (insertAt + columnOffset < headingColumns || rowIndex < headingRows) {
|
|
281
|
+
writer.setAttribute('tableCellType', 'header', insertedCells[columnOffset]);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
rowIndex++;
|
|
251
286
|
}
|
|
252
287
|
return;
|
|
253
288
|
}
|
|
@@ -271,7 +306,15 @@ export class TableUtils extends Plugin {
|
|
|
271
306
|
else {
|
|
272
307
|
// It's either cell at this column index or spanned cell by a row-spanned cell from row above.
|
|
273
308
|
// In table above it's cell "e" and a spanned position from row below (empty cell between cells "g" and "h")
|
|
274
|
-
createCells(columnsToInsert, writer, tableSlot.getPositionBefore());
|
|
309
|
+
const insertedCells = createCells(columnsToInsert, writer, tableSlot.getPositionBefore());
|
|
310
|
+
// If we insert column in heading section, set proper cell type.
|
|
311
|
+
if (cellTypeEnabled) {
|
|
312
|
+
for (let columnOffset = 0; columnOffset < insertedCells.length; columnOffset++) {
|
|
313
|
+
if (insertAt + columnOffset < headingColumns || row < headingRows) {
|
|
314
|
+
writer.setAttribute('tableCellType', 'header', insertedCells[columnOffset]);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
275
318
|
}
|
|
276
319
|
}
|
|
277
320
|
});
|
|
@@ -347,6 +390,15 @@ export class TableUtils extends Plugin {
|
|
|
347
390
|
// because of cleaning empty rows and we only removed one of them.
|
|
348
391
|
removeEmptyRows(table, this);
|
|
349
392
|
}
|
|
393
|
+
// 3. If next rows are entirely header, adjust heading rows count.
|
|
394
|
+
if (isTableCellTypeEnabled(this.editor)) {
|
|
395
|
+
let headingRows = table.getAttribute('headingRows') || 0;
|
|
396
|
+
const totalRows = this.getRows(table);
|
|
397
|
+
while (headingRows < totalRows && isEntireCellsLineHeader({ table, row: headingRows })) {
|
|
398
|
+
headingRows++;
|
|
399
|
+
}
|
|
400
|
+
this.setHeadingRowsCount(writer, table, headingRows, { shallow: true });
|
|
401
|
+
}
|
|
350
402
|
});
|
|
351
403
|
}
|
|
352
404
|
/**
|
|
@@ -416,6 +468,15 @@ export class TableUtils extends Plugin {
|
|
|
416
468
|
// because of cleaning empty columns and we only removed one of them.
|
|
417
469
|
removeEmptyColumns(table, this);
|
|
418
470
|
}
|
|
471
|
+
// If next columns are entirely header, adjust heading columns count.
|
|
472
|
+
if (isTableCellTypeEnabled(this.editor)) {
|
|
473
|
+
let headingColumns = table.getAttribute('headingColumns') || 0;
|
|
474
|
+
const totalColumns = this.getColumns(table);
|
|
475
|
+
while (headingColumns < totalColumns && isEntireCellsLineHeader({ table, column: headingColumns })) {
|
|
476
|
+
headingColumns++;
|
|
477
|
+
}
|
|
478
|
+
this.setHeadingColumnsCount(writer, table, headingColumns, { shallow: true });
|
|
479
|
+
}
|
|
419
480
|
});
|
|
420
481
|
}
|
|
421
482
|
/**
|
|
@@ -728,6 +789,130 @@ export class TableUtils extends Plugin {
|
|
|
728
789
|
}
|
|
729
790
|
return cells;
|
|
730
791
|
}
|
|
792
|
+
/**
|
|
793
|
+
* Sets the number of heading rows for the given `table`.
|
|
794
|
+
*
|
|
795
|
+
* @param writer The model writer.
|
|
796
|
+
* @param table The table model element.
|
|
797
|
+
* @param headingRows The number of heading rows to set.
|
|
798
|
+
* @param options Additional options.
|
|
799
|
+
* @param options.shallow If set to `true` it will only update the `headingRows` attribute
|
|
800
|
+
* without updating the cell types in the table. Default is `false`.
|
|
801
|
+
* @param options.resetFormerHeadingCells If set to `true`, it will check if the rows that are no longer in the heading section
|
|
802
|
+
* should be updated to body cells. Default is `true`.
|
|
803
|
+
* @param options.autoExpand If set to `true`, it will check if the following rows look like a header and expand the heading section.
|
|
804
|
+
* Default is `true`.
|
|
805
|
+
*/
|
|
806
|
+
setHeadingRowsCount(writer, table, headingRows, options = {}) {
|
|
807
|
+
const { shallow, resetFormerHeadingCells = true, autoExpand = true } = options;
|
|
808
|
+
const oldHeadingRows = table.getAttribute('headingRows') || 0;
|
|
809
|
+
if (headingRows === oldHeadingRows) {
|
|
810
|
+
return;
|
|
811
|
+
}
|
|
812
|
+
updateNumericAttribute('headingRows', headingRows, table, writer, 0);
|
|
813
|
+
if (shallow || !isTableCellTypeEnabled(this.editor)) {
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
// Set header type to all cells in new heading rows.
|
|
817
|
+
for (const { cell, row, column } of new TableWalker(table, { endRow: headingRows - 1 })) {
|
|
818
|
+
updateTableCellType({
|
|
819
|
+
table,
|
|
820
|
+
writer,
|
|
821
|
+
cell,
|
|
822
|
+
row,
|
|
823
|
+
column
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
// If heading rows were reduced, set body type to all cells in rows that are no longer in heading section.
|
|
827
|
+
if (resetFormerHeadingCells && headingRows < oldHeadingRows) {
|
|
828
|
+
for (let row = headingRows; row < oldHeadingRows; row++) {
|
|
829
|
+
// Handle edge case when some cells were already changed to body type manually,
|
|
830
|
+
// before changing heading rows count.
|
|
831
|
+
if (!isEntireCellsLineHeader({ table, row })) {
|
|
832
|
+
break;
|
|
833
|
+
}
|
|
834
|
+
for (const { cell, row: cellRow, column } of new TableWalker(table, { row })) {
|
|
835
|
+
updateTableCellType({
|
|
836
|
+
table,
|
|
837
|
+
writer,
|
|
838
|
+
cell,
|
|
839
|
+
row: cellRow,
|
|
840
|
+
column
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
// If following rows looks like header, expand heading rows to cover them.
|
|
846
|
+
if (autoExpand && headingRows > oldHeadingRows) {
|
|
847
|
+
const totalRows = this.getRows(table);
|
|
848
|
+
while (headingRows < totalRows && isEntireCellsLineHeader({ table, row: headingRows })) {
|
|
849
|
+
headingRows++;
|
|
850
|
+
}
|
|
851
|
+
updateNumericAttribute('headingRows', headingRows, table, writer, 0);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Sets the number of heading columns for the given `table`.
|
|
856
|
+
*
|
|
857
|
+
* @param writer The model writer to use.
|
|
858
|
+
* @param table The table model element.
|
|
859
|
+
* @param headingColumns The number of heading columns to set.
|
|
860
|
+
* @param options Additional options.
|
|
861
|
+
* @param options.shallow If set to `true` it will only update the `headingColumns` attribute
|
|
862
|
+
* without updating the cell types in the table. Default is `false`.
|
|
863
|
+
* @param options.resetFormerHeadingCells If set to `true`, it will check if the columns that are no longer in the heading section
|
|
864
|
+
* should be updated to body cells. Default is `true`.
|
|
865
|
+
* @param options.autoExpand If set to `true`, it will check if the following columns look like a header and expand the heading section.
|
|
866
|
+
* Default is `true`.
|
|
867
|
+
*/
|
|
868
|
+
setHeadingColumnsCount(writer, table, headingColumns, options = {}) {
|
|
869
|
+
const { shallow, resetFormerHeadingCells = true, autoExpand = true } = options;
|
|
870
|
+
const oldHeadingColumns = table.getAttribute('headingColumns') || 0;
|
|
871
|
+
if (headingColumns === oldHeadingColumns) {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
updateNumericAttribute('headingColumns', headingColumns, table, writer, 0);
|
|
875
|
+
if (shallow || !isTableCellTypeEnabled(this.editor)) {
|
|
876
|
+
return;
|
|
877
|
+
}
|
|
878
|
+
// Set header type to all cells in new heading columns.
|
|
879
|
+
for (const { cell, row, column } of new TableWalker(table, { endColumn: headingColumns - 1 })) {
|
|
880
|
+
updateTableCellType({
|
|
881
|
+
table,
|
|
882
|
+
writer,
|
|
883
|
+
cell,
|
|
884
|
+
row,
|
|
885
|
+
column
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
// If heading columns were reduced, set body type to all cells in columns that are no longer in heading section.
|
|
889
|
+
if (resetFormerHeadingCells && headingColumns < oldHeadingColumns) {
|
|
890
|
+
for (let column = headingColumns; column < oldHeadingColumns; column++) {
|
|
891
|
+
// Handle edge case when some cells were already changed to body type manually,
|
|
892
|
+
// before changing heading columns count.
|
|
893
|
+
if (!isEntireCellsLineHeader({ table, column })) {
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
896
|
+
for (const { cell, row, column: cellColumn } of new TableWalker(table, { column })) {
|
|
897
|
+
updateTableCellType({
|
|
898
|
+
table,
|
|
899
|
+
writer,
|
|
900
|
+
cell,
|
|
901
|
+
row,
|
|
902
|
+
column: cellColumn
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
// If following columns looks like header, expand heading columns to cover them.
|
|
908
|
+
if (autoExpand && headingColumns > oldHeadingColumns) {
|
|
909
|
+
const totalColumns = this.getColumns(table);
|
|
910
|
+
while (headingColumns < totalColumns && isEntireCellsLineHeader({ table, column: headingColumns })) {
|
|
911
|
+
headingColumns++;
|
|
912
|
+
}
|
|
913
|
+
updateNumericAttribute('headingColumns', headingColumns, table, writer, 0);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
731
916
|
/**
|
|
732
917
|
* Returns all model table cells that the provided model selection's ranges
|
|
733
918
|
* {@link module:engine/model/range~ModelRange#start} inside.
|
|
@@ -913,11 +1098,13 @@ export class TableUtils extends Plugin {
|
|
|
913
1098
|
* @param tableCellToInsert The number of cells to insert in each row.
|
|
914
1099
|
*/
|
|
915
1100
|
function createEmptyRows(writer, table, insertAt, rows, tableCellToInsert, attributes = {}) {
|
|
1101
|
+
const insertedRows = [];
|
|
916
1102
|
for (let i = 0; i < rows; i++) {
|
|
917
1103
|
const tableRow = writer.createElement('tableRow');
|
|
918
1104
|
writer.insert(tableRow, table, insertAt);
|
|
919
|
-
createCells(tableCellToInsert, writer, writer.createPositionAt(tableRow, 'end'), attributes);
|
|
1105
|
+
insertedRows.push(createCells(tableCellToInsert, writer, writer.createPositionAt(tableRow, 'end'), attributes));
|
|
920
1106
|
}
|
|
1107
|
+
return insertedRows;
|
|
921
1108
|
}
|
|
922
1109
|
/**
|
|
923
1110
|
* Creates cells at a given position.
|
|
@@ -925,9 +1112,14 @@ function createEmptyRows(writer, table, insertAt, rows, tableCellToInsert, attri
|
|
|
925
1112
|
* @param cells The number of cells to create
|
|
926
1113
|
*/
|
|
927
1114
|
function createCells(cells, writer, insertPosition, attributes = {}) {
|
|
1115
|
+
const createdCells = [];
|
|
1116
|
+
let currentPosition = insertPosition;
|
|
928
1117
|
for (let i = 0; i < cells; i++) {
|
|
929
|
-
createEmptyTableCell(writer,
|
|
1118
|
+
const cell = createEmptyTableCell(writer, currentPosition, attributes);
|
|
1119
|
+
createdCells.push(cell);
|
|
1120
|
+
currentPosition = writer.createPositionAfter(cell);
|
|
930
1121
|
}
|
|
1122
|
+
return createdCells;
|
|
931
1123
|
}
|
|
932
1124
|
/**
|
|
933
1125
|
* Evenly distributes the span of a cell to a number of provided cells.
|
|
@@ -1074,3 +1266,17 @@ function getBiggestRectangleArea(rows, columns) {
|
|
|
1074
1266
|
const firstColumn = Math.min(...columnIndexes);
|
|
1075
1267
|
return (lastRow - firstRow + 1) * (lastColumn - firstColumn + 1);
|
|
1076
1268
|
}
|
|
1269
|
+
/**
|
|
1270
|
+
* Updates the `tableCellType` attribute of a table cell based on its position in the table
|
|
1271
|
+
* and the table's `headingRows` and `headingColumns` attributes.
|
|
1272
|
+
*/
|
|
1273
|
+
function updateTableCellType({ writer, table, row, column, cell }) {
|
|
1274
|
+
const headingRows = table.getAttribute('headingRows') || 0;
|
|
1275
|
+
const headingColumns = table.getAttribute('headingColumns') || 0;
|
|
1276
|
+
if (row >= headingRows && column >= headingColumns) {
|
|
1277
|
+
writer.removeAttribute('tableCellType', cell);
|
|
1278
|
+
}
|
|
1279
|
+
else {
|
|
1280
|
+
writer.setAttribute('tableCellType', 'header', cell);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
package/src/tablewalker.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/tablewalker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/ui/colorinputview.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
package/src/utils/common.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|
|
6
6
|
* @module table/utils/common
|
|
7
7
|
*/
|
|
8
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
8
9
|
import type { Conversion, ModelElement, ModelItem, ModelPosition, ModelSchema, ModelWriter, ModelDocumentSelection } from 'ckeditor5/src/engine.js';
|
|
9
10
|
import { type TableUtils } from '../tableutils.js';
|
|
10
11
|
/**
|
|
@@ -53,3 +54,25 @@ export declare function enableProperty(schema: ModelSchema, conversion: Conversi
|
|
|
53
54
|
* @internal
|
|
54
55
|
*/
|
|
55
56
|
export declare function getSelectionAffectedTable(selection: ModelDocumentSelection): ModelElement;
|
|
57
|
+
/**
|
|
58
|
+
* Groups table cells by their parent table.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare function groupCellsByTable(tableCells: Array<ModelElement>): Map<ModelElement, Array<ModelElement>>;
|
|
63
|
+
/**
|
|
64
|
+
* Checks if all cells in a given row or column are header cells.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare function isEntireCellsLineHeader({ table, row, column }: {
|
|
69
|
+
table: ModelElement;
|
|
70
|
+
row?: number;
|
|
71
|
+
column?: number;
|
|
72
|
+
}): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Checks whether the `tableCellType` attribute is enabled in the editor schema and the experimental flag is set.
|
|
75
|
+
*
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
export declare function isTableCellTypeEnabled(editor: Editor): boolean;
|
package/src/utils/common.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
import { downcastAttributeToStyle, upcastStyleToAttribute } from '../converters/tableproperties.js';
|
|
6
|
+
import { TableWalker } from '../tablewalker.js';
|
|
6
7
|
/**
|
|
7
8
|
* A common method to update the numeric value. If a value is the default one, it will be unset.
|
|
8
9
|
*
|
|
@@ -74,3 +75,44 @@ export function getSelectionAffectedTable(selection) {
|
|
|
74
75
|
}
|
|
75
76
|
return selection.getFirstPosition().findAncestor('table');
|
|
76
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Groups table cells by their parent table.
|
|
80
|
+
*
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
export function groupCellsByTable(tableCells) {
|
|
84
|
+
const tableMap = new Map();
|
|
85
|
+
for (const tableCell of tableCells) {
|
|
86
|
+
const table = tableCell.findAncestor('table');
|
|
87
|
+
if (!tableMap.has(table)) {
|
|
88
|
+
tableMap.set(table, []);
|
|
89
|
+
}
|
|
90
|
+
tableMap.get(table).push(tableCell);
|
|
91
|
+
}
|
|
92
|
+
return tableMap;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Checks if all cells in a given row or column are header cells.
|
|
96
|
+
*
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
export function isEntireCellsLineHeader({ table, row, column }) {
|
|
100
|
+
const tableWalker = new TableWalker(table, { row, column });
|
|
101
|
+
for (const { cell } of tableWalker) {
|
|
102
|
+
const cellType = cell.getAttribute('tableCellType');
|
|
103
|
+
if (cellType !== 'header') {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Checks whether the `tableCellType` attribute is enabled in the editor schema and the experimental flag is set.
|
|
111
|
+
*
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
export function isTableCellTypeEnabled(editor) {
|
|
115
|
+
const { model, config } = editor;
|
|
116
|
+
return (model.schema.checkAttribute('tableCell', 'tableCellType') &&
|
|
117
|
+
config.get('experimentalFlags.tableCellTypeSupport') === true);
|
|
118
|
+
}
|
package/src/utils/structure.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
5
|
/**
|