@ckeditor/ckeditor5-table 0.0.0-internal-20241017.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/LICENSE.md +21 -0
- package/README.md +26 -0
- package/build/table.js +5 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/az.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de-ch.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/en-gb.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fa.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/hy.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/ku.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/nb.js +1 -0
- package/build/translations/ne.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sl.js +1 -0
- package/build/translations/sq.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/tk.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/tt.js +1 -0
- package/build/translations/ug.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/ur.js +1 -0
- package/build/translations/uz.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +193 -0
- package/dist/augmentation.d.ts +80 -0
- package/dist/commands/insertcolumncommand.d.ts +59 -0
- package/dist/commands/insertrowcommand.d.ts +58 -0
- package/dist/commands/inserttablecommand.d.ts +48 -0
- package/dist/commands/mergecellcommand.d.ts +72 -0
- package/dist/commands/mergecellscommand.d.ts +32 -0
- package/dist/commands/removecolumncommand.d.ts +33 -0
- package/dist/commands/removerowcommand.d.ts +33 -0
- package/dist/commands/selectcolumncommand.d.ts +37 -0
- package/dist/commands/selectrowcommand.d.ts +37 -0
- package/dist/commands/setheadercolumncommand.d.ts +54 -0
- package/dist/commands/setheaderrowcommand.d.ts +57 -0
- package/dist/commands/splitcellcommand.d.ts +47 -0
- package/dist/converters/downcast.d.ts +67 -0
- package/dist/converters/table-caption-post-fixer.d.ts +24 -0
- package/dist/converters/table-cell-paragraph-post-fixer.d.ts +36 -0
- package/dist/converters/table-cell-refresh-handler.d.ts +22 -0
- package/dist/converters/table-headings-refresh-handler.d.ts +21 -0
- package/dist/converters/table-layout-post-fixer.d.ts +230 -0
- package/dist/converters/tableproperties.d.ts +58 -0
- package/dist/converters/upcasttable.d.ts +53 -0
- package/dist/index-content.css +76 -0
- package/dist/index-editor.css +201 -0
- package/dist/index.css +394 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +11522 -0
- package/dist/index.js.map +1 -0
- package/dist/plaintableoutput.d.ts +34 -0
- package/dist/table.d.ts +48 -0
- package/dist/tablecaption/tablecaptionediting.d.ts +71 -0
- package/dist/tablecaption/tablecaptionui.d.ts +29 -0
- package/dist/tablecaption/toggletablecaptioncommand.d.ts +72 -0
- package/dist/tablecaption/utils.d.ts +42 -0
- package/dist/tablecaption.d.ts +32 -0
- package/dist/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +36 -0
- package/dist/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +41 -0
- package/dist/tablecellproperties/commands/tablecellborderstylecommand.d.ts +41 -0
- package/dist/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +55 -0
- package/dist/tablecellproperties/commands/tablecellheightcommand.d.ts +50 -0
- package/dist/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +36 -0
- package/dist/tablecellproperties/commands/tablecellpaddingcommand.d.ts +55 -0
- package/dist/tablecellproperties/commands/tablecellpropertycommand.d.ts +66 -0
- package/dist/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +44 -0
- package/dist/tablecellproperties/tablecellpropertiesediting.d.ts +51 -0
- package/dist/tablecellproperties/tablecellpropertiesui.d.ts +120 -0
- package/dist/tablecellproperties/ui/tablecellpropertiesview.d.ts +232 -0
- package/dist/tablecellproperties.d.ts +38 -0
- package/dist/tablecellwidth/commands/tablecellwidthcommand.d.ts +50 -0
- package/dist/tablecellwidth/tablecellwidthediting.d.ts +37 -0
- package/dist/tableclipboard.d.ts +78 -0
- package/dist/tablecolumnresize/constants.d.ts +24 -0
- package/dist/tablecolumnresize/converters.d.ts +22 -0
- package/dist/tablecolumnresize/tablecolumnresizeediting.d.ts +147 -0
- package/dist/tablecolumnresize/tablewidthscommand.d.ts +42 -0
- package/dist/tablecolumnresize/utils.d.ts +152 -0
- package/dist/tablecolumnresize.d.ts +34 -0
- package/dist/tableconfig.d.ts +347 -0
- package/dist/tableediting.d.ts +106 -0
- package/dist/tablekeyboard.d.ts +76 -0
- package/dist/tablemouse/mouseeventsobserver.d.ts +66 -0
- package/dist/tablemouse.d.ts +56 -0
- package/dist/tableproperties/commands/tablealignmentcommand.d.ts +36 -0
- package/dist/tableproperties/commands/tablebackgroundcolorcommand.d.ts +36 -0
- package/dist/tableproperties/commands/tablebordercolorcommand.d.ts +41 -0
- package/dist/tableproperties/commands/tableborderstylecommand.d.ts +41 -0
- package/dist/tableproperties/commands/tableborderwidthcommand.d.ts +55 -0
- package/dist/tableproperties/commands/tableheightcommand.d.ts +50 -0
- package/dist/tableproperties/commands/tablepropertycommand.d.ts +65 -0
- package/dist/tableproperties/commands/tablewidthcommand.d.ts +50 -0
- package/dist/tableproperties/tablepropertiesediting.d.ts +48 -0
- package/dist/tableproperties/tablepropertiesui.d.ts +122 -0
- package/dist/tableproperties/ui/tablepropertiesview.d.ts +211 -0
- package/dist/tableproperties.d.ts +38 -0
- package/dist/tableselection.d.ts +115 -0
- package/dist/tabletoolbar.d.ts +40 -0
- package/dist/tableui.d.ts +62 -0
- package/dist/tableutils.d.ts +456 -0
- package/dist/tablewalker.d.ts +366 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en-gb.umd.js +11 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/hy.d.ts +8 -0
- package/dist/translations/hy.js +5 -0
- package/dist/translations/hy.umd.js +11 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/nb.umd.js +11 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/ne.umd.js +11 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sl.d.ts +8 -0
- package/dist/translations/sl.js +5 -0
- package/dist/translations/sl.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/tt.umd.js +11 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/ug.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/ui/colorinputview.d.ts +144 -0
- package/dist/ui/formrowview.d.ts +65 -0
- package/dist/ui/inserttableview.d.ts +85 -0
- package/dist/utils/common.d.ts +50 -0
- package/dist/utils/structure.d.ts +249 -0
- package/dist/utils/table-properties.d.ts +101 -0
- package/dist/utils/ui/contextualballoon.d.ts +38 -0
- package/dist/utils/ui/table-properties.d.ts +199 -0
- package/dist/utils/ui/widget.d.ts +24 -0
- package/lang/contexts.json +67 -0
- package/lang/translations/ar.po +278 -0
- package/lang/translations/az.po +278 -0
- package/lang/translations/bg.po +278 -0
- package/lang/translations/bn.po +280 -0
- package/lang/translations/ca.po +278 -0
- package/lang/translations/cs.po +278 -0
- package/lang/translations/da.po +278 -0
- package/lang/translations/de-ch.po +278 -0
- package/lang/translations/de.po +278 -0
- package/lang/translations/el.po +278 -0
- package/lang/translations/en-au.po +278 -0
- package/lang/translations/en-gb.po +278 -0
- package/lang/translations/en.po +278 -0
- package/lang/translations/es.po +278 -0
- package/lang/translations/et.po +278 -0
- package/lang/translations/fa.po +278 -0
- package/lang/translations/fi.po +278 -0
- package/lang/translations/fr.po +278 -0
- package/lang/translations/gl.po +278 -0
- package/lang/translations/he.po +278 -0
- package/lang/translations/hi.po +278 -0
- package/lang/translations/hr.po +278 -0
- package/lang/translations/hu.po +278 -0
- package/lang/translations/hy.po +278 -0
- package/lang/translations/id.po +278 -0
- package/lang/translations/it.po +278 -0
- package/lang/translations/ja.po +278 -0
- package/lang/translations/ko.po +278 -0
- package/lang/translations/ku.po +278 -0
- package/lang/translations/lt.po +278 -0
- package/lang/translations/lv.po +278 -0
- package/lang/translations/ms.po +278 -0
- package/lang/translations/nb.po +278 -0
- package/lang/translations/ne.po +278 -0
- package/lang/translations/nl.po +278 -0
- package/lang/translations/no.po +278 -0
- package/lang/translations/pl.po +278 -0
- package/lang/translations/pt-br.po +278 -0
- package/lang/translations/pt.po +278 -0
- package/lang/translations/ro.po +278 -0
- package/lang/translations/ru.po +278 -0
- package/lang/translations/sk.po +278 -0
- package/lang/translations/sl.po +278 -0
- package/lang/translations/sq.po +278 -0
- package/lang/translations/sr-latn.po +278 -0
- package/lang/translations/sr.po +278 -0
- package/lang/translations/sv.po +278 -0
- package/lang/translations/th.po +278 -0
- package/lang/translations/tk.po +278 -0
- package/lang/translations/tr.po +278 -0
- package/lang/translations/tt.po +278 -0
- package/lang/translations/ug.po +278 -0
- package/lang/translations/uk.po +278 -0
- package/lang/translations/ur.po +278 -0
- package/lang/translations/uz.po +278 -0
- package/lang/translations/vi.po +278 -0
- package/lang/translations/zh-cn.po +278 -0
- package/lang/translations/zh.po +278 -0
- package/package.json +45 -0
- package/src/augmentation.d.ts +76 -0
- package/src/augmentation.js +5 -0
- package/src/commands/insertcolumncommand.d.ts +55 -0
- package/src/commands/insertcolumncommand.js +67 -0
- package/src/commands/insertrowcommand.d.ts +54 -0
- package/src/commands/insertrowcommand.js +66 -0
- package/src/commands/inserttablecommand.d.ts +44 -0
- package/src/commands/inserttablecommand.js +69 -0
- package/src/commands/mergecellcommand.d.ts +68 -0
- package/src/commands/mergecellcommand.js +198 -0
- package/src/commands/mergecellscommand.d.ts +28 -0
- package/src/commands/mergecellscommand.js +94 -0
- package/src/commands/removecolumncommand.d.ts +29 -0
- package/src/commands/removecolumncommand.js +109 -0
- package/src/commands/removerowcommand.d.ts +29 -0
- package/src/commands/removerowcommand.js +82 -0
- package/src/commands/selectcolumncommand.d.ts +33 -0
- package/src/commands/selectcolumncommand.js +60 -0
- package/src/commands/selectrowcommand.d.ts +33 -0
- package/src/commands/selectrowcommand.js +56 -0
- package/src/commands/setheadercolumncommand.d.ts +50 -0
- package/src/commands/setheadercolumncommand.js +71 -0
- package/src/commands/setheaderrowcommand.d.ts +53 -0
- package/src/commands/setheaderrowcommand.js +79 -0
- package/src/commands/splitcellcommand.d.ts +43 -0
- package/src/commands/splitcellcommand.js +54 -0
- package/src/converters/downcast.d.ts +63 -0
- package/src/converters/downcast.js +146 -0
- package/src/converters/table-caption-post-fixer.d.ts +20 -0
- package/src/converters/table-caption-post-fixer.js +53 -0
- package/src/converters/table-cell-paragraph-post-fixer.d.ts +32 -0
- package/src/converters/table-cell-paragraph-post-fixer.js +107 -0
- package/src/converters/table-cell-refresh-handler.d.ts +18 -0
- package/src/converters/table-cell-refresh-handler.js +45 -0
- package/src/converters/table-headings-refresh-handler.d.ts +17 -0
- package/src/converters/table-headings-refresh-handler.js +49 -0
- package/src/converters/table-layout-post-fixer.d.ts +226 -0
- package/src/converters/table-layout-post-fixer.js +367 -0
- package/src/converters/tableproperties.d.ts +54 -0
- package/src/converters/tableproperties.js +159 -0
- package/src/converters/upcasttable.d.ts +49 -0
- package/src/converters/upcasttable.js +243 -0
- package/src/index.d.ts +60 -0
- package/src/index.js +30 -0
- package/src/plaintableoutput.d.ts +30 -0
- package/src/plaintableoutput.js +129 -0
- package/src/table.d.ts +44 -0
- package/src/table.js +50 -0
- package/src/tablecaption/tablecaptionediting.d.ts +67 -0
- package/src/tablecaption/tablecaptionediting.js +128 -0
- package/src/tablecaption/tablecaptionui.d.ts +25 -0
- package/src/tablecaption/tablecaptionui.js +63 -0
- package/src/tablecaption/toggletablecaptioncommand.d.ts +68 -0
- package/src/tablecaption/toggletablecaptioncommand.js +105 -0
- package/src/tablecaption/utils.d.ts +38 -0
- package/src/tablecaption/utils.js +57 -0
- package/src/tablecaption.d.ts +28 -0
- package/src/tablecaption.js +34 -0
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +32 -0
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +30 -0
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +37 -0
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +44 -0
- package/src/tablecellproperties/commands/tablecellborderstylecommand.d.ts +37 -0
- package/src/tablecellproperties/commands/tablecellborderstylecommand.js +44 -0
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +51 -0
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +64 -0
- package/src/tablecellproperties/commands/tablecellheightcommand.d.ts +46 -0
- package/src/tablecellproperties/commands/tablecellheightcommand.js +51 -0
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +32 -0
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +30 -0
- package/src/tablecellproperties/commands/tablecellpaddingcommand.d.ts +51 -0
- package/src/tablecellproperties/commands/tablecellpaddingcommand.js +64 -0
- package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +62 -0
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +92 -0
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +40 -0
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +38 -0
- package/src/tablecellproperties/tablecellpropertiesediting.d.ts +47 -0
- package/src/tablecellproperties/tablecellpropertiesediting.js +247 -0
- package/src/tablecellproperties/tablecellpropertiesui.d.ts +116 -0
- package/src/tablecellproperties/tablecellpropertiesui.js +336 -0
- package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +228 -0
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +541 -0
- package/src/tablecellproperties.d.ts +34 -0
- package/src/tablecellproperties.js +40 -0
- package/src/tablecellwidth/commands/tablecellwidthcommand.d.ts +46 -0
- package/src/tablecellwidth/commands/tablecellwidthcommand.js +51 -0
- package/src/tablecellwidth/tablecellwidthediting.d.ts +33 -0
- package/src/tablecellwidth/tablecellwidthediting.js +51 -0
- package/src/tableclipboard.d.ts +74 -0
- package/src/tableclipboard.js +473 -0
- package/src/tablecolumnresize/constants.d.ts +20 -0
- package/src/tablecolumnresize/constants.js +20 -0
- package/src/tablecolumnresize/converters.d.ts +18 -0
- package/src/tablecolumnresize/converters.js +46 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +143 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.js +589 -0
- package/src/tablecolumnresize/tablewidthscommand.d.ts +38 -0
- package/src/tablecolumnresize/tablewidthscommand.js +61 -0
- package/src/tablecolumnresize/utils.d.ts +148 -0
- package/src/tablecolumnresize/utils.js +358 -0
- package/src/tablecolumnresize.d.ts +30 -0
- package/src/tablecolumnresize.js +36 -0
- package/src/tableconfig.d.ts +343 -0
- package/src/tableconfig.js +5 -0
- package/src/tableediting.d.ts +102 -0
- package/src/tableediting.js +197 -0
- package/src/tablekeyboard.d.ts +72 -0
- package/src/tablekeyboard.js +310 -0
- package/src/tablemouse/mouseeventsobserver.d.ts +62 -0
- package/src/tablemouse/mouseeventsobserver.js +35 -0
- package/src/tablemouse.d.ts +52 -0
- package/src/tablemouse.js +178 -0
- package/src/tableproperties/commands/tablealignmentcommand.d.ts +32 -0
- package/src/tableproperties/commands/tablealignmentcommand.js +30 -0
- package/src/tableproperties/commands/tablebackgroundcolorcommand.d.ts +32 -0
- package/src/tableproperties/commands/tablebackgroundcolorcommand.js +30 -0
- package/src/tableproperties/commands/tablebordercolorcommand.d.ts +37 -0
- package/src/tableproperties/commands/tablebordercolorcommand.js +44 -0
- package/src/tableproperties/commands/tableborderstylecommand.d.ts +37 -0
- package/src/tableproperties/commands/tableborderstylecommand.js +44 -0
- package/src/tableproperties/commands/tableborderwidthcommand.d.ts +51 -0
- package/src/tableproperties/commands/tableborderwidthcommand.js +64 -0
- package/src/tableproperties/commands/tableheightcommand.d.ts +46 -0
- package/src/tableproperties/commands/tableheightcommand.js +54 -0
- package/src/tableproperties/commands/tablepropertycommand.d.ts +61 -0
- package/src/tableproperties/commands/tablepropertycommand.js +81 -0
- package/src/tableproperties/commands/tablewidthcommand.d.ts +46 -0
- package/src/tableproperties/commands/tablewidthcommand.js +54 -0
- package/src/tableproperties/tablepropertiesediting.d.ts +44 -0
- package/src/tableproperties/tablepropertiesediting.js +212 -0
- package/src/tableproperties/tablepropertiesui.d.ts +118 -0
- package/src/tableproperties/tablepropertiesui.js +327 -0
- package/src/tableproperties/ui/tablepropertiesview.d.ts +207 -0
- package/src/tableproperties/ui/tablepropertiesview.js +458 -0
- package/src/tableproperties.d.ts +34 -0
- package/src/tableproperties.js +40 -0
- package/src/tableselection.d.ts +111 -0
- package/src/tableselection.js +303 -0
- package/src/tabletoolbar.d.ts +36 -0
- package/src/tabletoolbar.js +63 -0
- package/src/tableui.d.ts +58 -0
- package/src/tableui.js +337 -0
- package/src/tableutils.d.ts +452 -0
- package/src/tableutils.js +1076 -0
- package/src/tablewalker.d.ts +362 -0
- package/src/tablewalker.js +393 -0
- package/src/ui/colorinputview.d.ts +140 -0
- package/src/ui/colorinputview.js +271 -0
- package/src/ui/formrowview.d.ts +61 -0
- package/src/ui/formrowview.js +57 -0
- package/src/ui/inserttableview.d.ts +81 -0
- package/src/ui/inserttableview.js +178 -0
- package/src/utils/common.d.ts +46 -0
- package/src/utils/common.js +68 -0
- package/src/utils/structure.d.ts +245 -0
- package/src/utils/structure.js +426 -0
- package/src/utils/table-properties.d.ts +97 -0
- package/src/utils/table-properties.js +115 -0
- package/src/utils/ui/contextualballoon.d.ts +34 -0
- package/src/utils/ui/contextualballoon.js +109 -0
- package/src/utils/ui/table-properties.d.ts +195 -0
- package/src/utils/ui/table-properties.js +362 -0
- package/src/utils/ui/widget.d.ts +20 -0
- package/src/utils/ui/widget.js +48 -0
- package/theme/colorinput.css +39 -0
- package/theme/form.css +11 -0
- package/theme/formrow.css +23 -0
- package/theme/icons/table-cell-properties.svg +1 -0
- package/theme/icons/table-column.svg +1 -0
- package/theme/icons/table-merge-cell.svg +1 -0
- package/theme/icons/table-properties.svg +1 -0
- package/theme/icons/table-row.svg +1 -0
- package/theme/inserttable.css +10 -0
- package/theme/table.css +84 -0
- package/theme/tablecaption.css +63 -0
- package/theme/tablecellproperties.css +28 -0
- package/theme/tablecolumnresize.css +67 -0
- package/theme/tableediting.css +10 -0
- package/theme/tableform.css +59 -0
- package/theme/tableproperties.css +18 -0
- package/theme/tableselection.css +10 -0
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tableproperties/ui/tablepropertiesview
|
|
7
|
+
*/
|
|
8
|
+
import { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import { icons } from 'ckeditor5/src/core.js';
|
|
11
|
+
import { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties.js';
|
|
12
|
+
import FormRowView from '../../ui/formrowview.js';
|
|
13
|
+
import '../../../theme/form.css';
|
|
14
|
+
import '../../../theme/tableform.css';
|
|
15
|
+
import '../../../theme/tableproperties.css';
|
|
16
|
+
/**
|
|
17
|
+
* The class representing a table properties form, allowing users to customize
|
|
18
|
+
* certain style aspects of a table, for instance, border, background color, alignment, etc..
|
|
19
|
+
*/
|
|
20
|
+
export default class TablePropertiesView extends View {
|
|
21
|
+
/**
|
|
22
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
23
|
+
* @param options Additional configuration of the view.
|
|
24
|
+
*/
|
|
25
|
+
constructor(locale, options) {
|
|
26
|
+
super(locale);
|
|
27
|
+
this.set({
|
|
28
|
+
borderStyle: '',
|
|
29
|
+
borderWidth: '',
|
|
30
|
+
borderColor: '',
|
|
31
|
+
backgroundColor: '',
|
|
32
|
+
width: '',
|
|
33
|
+
height: '',
|
|
34
|
+
alignment: ''
|
|
35
|
+
});
|
|
36
|
+
this.options = options;
|
|
37
|
+
const { borderStyleDropdown, borderWidthInput, borderColorInput, borderRowLabel } = this._createBorderFields();
|
|
38
|
+
const { backgroundRowLabel, backgroundInput } = this._createBackgroundFields();
|
|
39
|
+
const { widthInput, operatorLabel, heightInput, dimensionsLabel } = this._createDimensionFields();
|
|
40
|
+
const { alignmentToolbar, alignmentLabel } = this._createAlignmentFields();
|
|
41
|
+
this.focusTracker = new FocusTracker();
|
|
42
|
+
this.keystrokes = new KeystrokeHandler();
|
|
43
|
+
this.children = this.createCollection();
|
|
44
|
+
this.borderStyleDropdown = borderStyleDropdown;
|
|
45
|
+
this.borderWidthInput = borderWidthInput;
|
|
46
|
+
this.borderColorInput = borderColorInput;
|
|
47
|
+
this.backgroundInput = backgroundInput;
|
|
48
|
+
this.widthInput = widthInput;
|
|
49
|
+
this.heightInput = heightInput;
|
|
50
|
+
this.alignmentToolbar = alignmentToolbar;
|
|
51
|
+
// Defer creating to make sure other fields are present and the Save button can
|
|
52
|
+
// bind its #isEnabled to their error messages so there's no way to save unless all
|
|
53
|
+
// fields are valid.
|
|
54
|
+
const { saveButtonView, cancelButtonView } = this._createActionButtons();
|
|
55
|
+
this.saveButtonView = saveButtonView;
|
|
56
|
+
this.cancelButtonView = cancelButtonView;
|
|
57
|
+
this._focusables = new ViewCollection();
|
|
58
|
+
this._focusCycler = new FocusCycler({
|
|
59
|
+
focusables: this._focusables,
|
|
60
|
+
focusTracker: this.focusTracker,
|
|
61
|
+
keystrokeHandler: this.keystrokes,
|
|
62
|
+
actions: {
|
|
63
|
+
// Navigate form fields backwards using the Shift + Tab keystroke.
|
|
64
|
+
focusPrevious: 'shift + tab',
|
|
65
|
+
// Navigate form fields forwards using the Tab key.
|
|
66
|
+
focusNext: 'tab'
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
// Form header.
|
|
70
|
+
this.children.add(new FormHeaderView(locale, {
|
|
71
|
+
label: this.t('Table properties')
|
|
72
|
+
}));
|
|
73
|
+
// Border row.
|
|
74
|
+
this.children.add(new FormRowView(locale, {
|
|
75
|
+
labelView: borderRowLabel,
|
|
76
|
+
children: [
|
|
77
|
+
borderRowLabel,
|
|
78
|
+
borderStyleDropdown,
|
|
79
|
+
borderColorInput,
|
|
80
|
+
borderWidthInput
|
|
81
|
+
],
|
|
82
|
+
class: 'ck-table-form__border-row'
|
|
83
|
+
}));
|
|
84
|
+
// Background row.
|
|
85
|
+
this.children.add(new FormRowView(locale, {
|
|
86
|
+
labelView: backgroundRowLabel,
|
|
87
|
+
children: [
|
|
88
|
+
backgroundRowLabel,
|
|
89
|
+
backgroundInput
|
|
90
|
+
],
|
|
91
|
+
class: 'ck-table-form__background-row'
|
|
92
|
+
}));
|
|
93
|
+
this.children.add(new FormRowView(locale, {
|
|
94
|
+
children: [
|
|
95
|
+
// Dimensions row.
|
|
96
|
+
new FormRowView(locale, {
|
|
97
|
+
labelView: dimensionsLabel,
|
|
98
|
+
children: [
|
|
99
|
+
dimensionsLabel,
|
|
100
|
+
widthInput,
|
|
101
|
+
operatorLabel,
|
|
102
|
+
heightInput
|
|
103
|
+
],
|
|
104
|
+
class: 'ck-table-form__dimensions-row'
|
|
105
|
+
}),
|
|
106
|
+
// Alignment row.
|
|
107
|
+
new FormRowView(locale, {
|
|
108
|
+
labelView: alignmentLabel,
|
|
109
|
+
children: [
|
|
110
|
+
alignmentLabel,
|
|
111
|
+
alignmentToolbar
|
|
112
|
+
],
|
|
113
|
+
class: 'ck-table-properties-form__alignment-row'
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}));
|
|
117
|
+
// Action row.
|
|
118
|
+
this.children.add(new FormRowView(locale, {
|
|
119
|
+
children: [
|
|
120
|
+
this.saveButtonView,
|
|
121
|
+
this.cancelButtonView
|
|
122
|
+
],
|
|
123
|
+
class: 'ck-table-form__action-row'
|
|
124
|
+
}));
|
|
125
|
+
this.setTemplate({
|
|
126
|
+
tag: 'form',
|
|
127
|
+
attributes: {
|
|
128
|
+
class: [
|
|
129
|
+
'ck',
|
|
130
|
+
'ck-form',
|
|
131
|
+
'ck-table-form',
|
|
132
|
+
'ck-table-properties-form'
|
|
133
|
+
],
|
|
134
|
+
// https://github.com/ckeditor/ckeditor5-link/issues/90
|
|
135
|
+
tabindex: '-1'
|
|
136
|
+
},
|
|
137
|
+
children: this.children
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @inheritDoc
|
|
142
|
+
*/
|
|
143
|
+
render() {
|
|
144
|
+
super.render();
|
|
145
|
+
// Enable the "submit" event for this view. It can be triggered by the #saveButtonView
|
|
146
|
+
// which is of the "submit" DOM "type".
|
|
147
|
+
submitHandler({
|
|
148
|
+
view: this
|
|
149
|
+
});
|
|
150
|
+
// Maintain continuous focus cycling over views that have focusable children and focus cyclers themselves.
|
|
151
|
+
[this.borderColorInput, this.backgroundInput].forEach(view => {
|
|
152
|
+
this._focusCycler.chain(view.fieldView.focusCycler);
|
|
153
|
+
});
|
|
154
|
+
[
|
|
155
|
+
this.borderStyleDropdown,
|
|
156
|
+
this.borderColorInput,
|
|
157
|
+
this.borderWidthInput,
|
|
158
|
+
this.backgroundInput,
|
|
159
|
+
this.widthInput,
|
|
160
|
+
this.heightInput,
|
|
161
|
+
this.alignmentToolbar,
|
|
162
|
+
this.saveButtonView,
|
|
163
|
+
this.cancelButtonView
|
|
164
|
+
].forEach(view => {
|
|
165
|
+
// Register the view as focusable.
|
|
166
|
+
this._focusables.add(view);
|
|
167
|
+
// Register the view in the focus tracker.
|
|
168
|
+
this.focusTracker.add(view.element);
|
|
169
|
+
});
|
|
170
|
+
// Mainly for closing using "Esc" and navigation using "Tab".
|
|
171
|
+
this.keystrokes.listenTo(this.element);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* @inheritDoc
|
|
175
|
+
*/
|
|
176
|
+
destroy() {
|
|
177
|
+
super.destroy();
|
|
178
|
+
this.focusTracker.destroy();
|
|
179
|
+
this.keystrokes.destroy();
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Focuses the fist focusable field in the form.
|
|
183
|
+
*/
|
|
184
|
+
focus() {
|
|
185
|
+
this._focusCycler.focusFirst();
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Creates the following form fields:
|
|
189
|
+
*
|
|
190
|
+
* * {@link #borderStyleDropdown},
|
|
191
|
+
* * {@link #borderWidthInput},
|
|
192
|
+
* * {@link #borderColorInput}.
|
|
193
|
+
*/
|
|
194
|
+
_createBorderFields() {
|
|
195
|
+
const defaultTableProperties = this.options.defaultTableProperties;
|
|
196
|
+
const defaultBorder = {
|
|
197
|
+
style: defaultTableProperties.borderStyle,
|
|
198
|
+
width: defaultTableProperties.borderWidth,
|
|
199
|
+
color: defaultTableProperties.borderColor
|
|
200
|
+
};
|
|
201
|
+
const colorInputCreator = getLabeledColorInputCreator({
|
|
202
|
+
colorConfig: this.options.borderColors,
|
|
203
|
+
columns: 5,
|
|
204
|
+
defaultColorValue: defaultBorder.color,
|
|
205
|
+
colorPickerConfig: this.options.colorPickerConfig
|
|
206
|
+
});
|
|
207
|
+
const locale = this.locale;
|
|
208
|
+
const t = this.t;
|
|
209
|
+
const accessibleLabel = t('Style');
|
|
210
|
+
// -- Group label ---------------------------------------------
|
|
211
|
+
const borderRowLabel = new LabelView(locale);
|
|
212
|
+
borderRowLabel.text = t('Border');
|
|
213
|
+
// -- Style ---------------------------------------------------
|
|
214
|
+
const styleLabels = getBorderStyleLabels(t);
|
|
215
|
+
const borderStyleDropdown = new LabeledFieldView(locale, createLabeledDropdown);
|
|
216
|
+
borderStyleDropdown.set({
|
|
217
|
+
label: accessibleLabel,
|
|
218
|
+
class: 'ck-table-form__border-style'
|
|
219
|
+
});
|
|
220
|
+
borderStyleDropdown.fieldView.buttonView.set({
|
|
221
|
+
ariaLabel: accessibleLabel,
|
|
222
|
+
ariaLabelledBy: undefined,
|
|
223
|
+
isOn: false,
|
|
224
|
+
withText: true,
|
|
225
|
+
tooltip: accessibleLabel
|
|
226
|
+
});
|
|
227
|
+
borderStyleDropdown.fieldView.buttonView.bind('label').to(this, 'borderStyle', value => {
|
|
228
|
+
return styleLabels[value ? value : 'none'];
|
|
229
|
+
});
|
|
230
|
+
borderStyleDropdown.fieldView.on('execute', evt => {
|
|
231
|
+
this.borderStyle = evt.source._borderStyleValue;
|
|
232
|
+
});
|
|
233
|
+
borderStyleDropdown.bind('isEmpty').to(this, 'borderStyle', value => !value);
|
|
234
|
+
addListToDropdown(borderStyleDropdown.fieldView, getBorderStyleDefinitions(this, defaultBorder.style), {
|
|
235
|
+
role: 'menu',
|
|
236
|
+
ariaLabel: accessibleLabel
|
|
237
|
+
});
|
|
238
|
+
// -- Width ---------------------------------------------------
|
|
239
|
+
const borderWidthInput = new LabeledFieldView(locale, createLabeledInputText);
|
|
240
|
+
borderWidthInput.set({
|
|
241
|
+
label: t('Width'),
|
|
242
|
+
class: 'ck-table-form__border-width'
|
|
243
|
+
});
|
|
244
|
+
borderWidthInput.fieldView.bind('value').to(this, 'borderWidth');
|
|
245
|
+
borderWidthInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);
|
|
246
|
+
borderWidthInput.fieldView.on('input', () => {
|
|
247
|
+
this.borderWidth = borderWidthInput.fieldView.element.value;
|
|
248
|
+
});
|
|
249
|
+
// -- Color ---------------------------------------------------
|
|
250
|
+
const borderColorInput = new LabeledFieldView(locale, colorInputCreator);
|
|
251
|
+
borderColorInput.set({
|
|
252
|
+
label: t('Color'),
|
|
253
|
+
class: 'ck-table-form__border-color'
|
|
254
|
+
});
|
|
255
|
+
borderColorInput.fieldView.bind('value').to(this, 'borderColor');
|
|
256
|
+
borderColorInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);
|
|
257
|
+
borderColorInput.fieldView.on('input', () => {
|
|
258
|
+
this.borderColor = borderColorInput.fieldView.value;
|
|
259
|
+
});
|
|
260
|
+
// Reset the border color and width fields depending on the `border-style` value.
|
|
261
|
+
this.on('change:borderStyle', (evt, name, newValue, oldValue) => {
|
|
262
|
+
// When removing the border (`border-style:none`), clear the remaining `border-*` properties.
|
|
263
|
+
// See: https://github.com/ckeditor/ckeditor5/issues/6227.
|
|
264
|
+
if (!isBorderStyleSet(newValue)) {
|
|
265
|
+
this.borderColor = '';
|
|
266
|
+
this.borderWidth = '';
|
|
267
|
+
}
|
|
268
|
+
// When setting the `border-style` from `none`, set the default `border-color` and `border-width` properties.
|
|
269
|
+
if (!isBorderStyleSet(oldValue)) {
|
|
270
|
+
this.borderColor = defaultBorder.color;
|
|
271
|
+
this.borderWidth = defaultBorder.width;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
return {
|
|
275
|
+
borderRowLabel,
|
|
276
|
+
borderStyleDropdown,
|
|
277
|
+
borderColorInput,
|
|
278
|
+
borderWidthInput
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Creates the following form fields:
|
|
283
|
+
*
|
|
284
|
+
* * {@link #backgroundInput}.
|
|
285
|
+
*/
|
|
286
|
+
_createBackgroundFields() {
|
|
287
|
+
const locale = this.locale;
|
|
288
|
+
const t = this.t;
|
|
289
|
+
// -- Group label ---------------------------------------------
|
|
290
|
+
const backgroundRowLabel = new LabelView(locale);
|
|
291
|
+
backgroundRowLabel.text = t('Background');
|
|
292
|
+
// -- Background color input -----------------------------------
|
|
293
|
+
const backgroundInputCreator = getLabeledColorInputCreator({
|
|
294
|
+
colorConfig: this.options.backgroundColors,
|
|
295
|
+
columns: 5,
|
|
296
|
+
defaultColorValue: this.options.defaultTableProperties.backgroundColor,
|
|
297
|
+
colorPickerConfig: this.options.colorPickerConfig
|
|
298
|
+
});
|
|
299
|
+
const backgroundInput = new LabeledFieldView(locale, backgroundInputCreator);
|
|
300
|
+
backgroundInput.set({
|
|
301
|
+
label: t('Color'),
|
|
302
|
+
class: 'ck-table-properties-form__background'
|
|
303
|
+
});
|
|
304
|
+
backgroundInput.fieldView.bind('value').to(this, 'backgroundColor');
|
|
305
|
+
backgroundInput.fieldView.on('input', () => {
|
|
306
|
+
this.backgroundColor = backgroundInput.fieldView.value;
|
|
307
|
+
});
|
|
308
|
+
return {
|
|
309
|
+
backgroundRowLabel,
|
|
310
|
+
backgroundInput
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Creates the following form fields:
|
|
315
|
+
*
|
|
316
|
+
* * {@link #widthInput},
|
|
317
|
+
* * {@link #heightInput}.
|
|
318
|
+
*/
|
|
319
|
+
_createDimensionFields() {
|
|
320
|
+
const locale = this.locale;
|
|
321
|
+
const t = this.t;
|
|
322
|
+
// -- Label ---------------------------------------------------
|
|
323
|
+
const dimensionsLabel = new LabelView(locale);
|
|
324
|
+
dimensionsLabel.text = t('Dimensions');
|
|
325
|
+
// -- Width ---------------------------------------------------
|
|
326
|
+
const widthInput = new LabeledFieldView(locale, createLabeledInputText);
|
|
327
|
+
widthInput.set({
|
|
328
|
+
label: t('Width'),
|
|
329
|
+
class: 'ck-table-form__dimensions-row__width'
|
|
330
|
+
});
|
|
331
|
+
widthInput.fieldView.bind('value').to(this, 'width');
|
|
332
|
+
widthInput.fieldView.on('input', () => {
|
|
333
|
+
this.width = widthInput.fieldView.element.value;
|
|
334
|
+
});
|
|
335
|
+
// -- Operator ---------------------------------------------------
|
|
336
|
+
const operatorLabel = new View(locale);
|
|
337
|
+
operatorLabel.setTemplate({
|
|
338
|
+
tag: 'span',
|
|
339
|
+
attributes: {
|
|
340
|
+
class: [
|
|
341
|
+
'ck-table-form__dimension-operator'
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
children: [
|
|
345
|
+
{ text: '×' }
|
|
346
|
+
]
|
|
347
|
+
});
|
|
348
|
+
// -- Height ---------------------------------------------------
|
|
349
|
+
const heightInput = new LabeledFieldView(locale, createLabeledInputText);
|
|
350
|
+
heightInput.set({
|
|
351
|
+
label: t('Height'),
|
|
352
|
+
class: 'ck-table-form__dimensions-row__height'
|
|
353
|
+
});
|
|
354
|
+
heightInput.fieldView.bind('value').to(this, 'height');
|
|
355
|
+
heightInput.fieldView.on('input', () => {
|
|
356
|
+
this.height = heightInput.fieldView.element.value;
|
|
357
|
+
});
|
|
358
|
+
return {
|
|
359
|
+
dimensionsLabel,
|
|
360
|
+
widthInput,
|
|
361
|
+
operatorLabel,
|
|
362
|
+
heightInput
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Creates the following form fields:
|
|
367
|
+
*
|
|
368
|
+
* * {@link #alignmentToolbar}.
|
|
369
|
+
*/
|
|
370
|
+
_createAlignmentFields() {
|
|
371
|
+
const locale = this.locale;
|
|
372
|
+
const t = this.t;
|
|
373
|
+
// -- Label ---------------------------------------------------
|
|
374
|
+
const alignmentLabel = new LabelView(locale);
|
|
375
|
+
alignmentLabel.text = t('Alignment');
|
|
376
|
+
// -- Toolbar ---------------------------------------------------
|
|
377
|
+
const alignmentToolbar = new ToolbarView(locale);
|
|
378
|
+
alignmentToolbar.set({
|
|
379
|
+
isCompact: true,
|
|
380
|
+
ariaLabel: t('Table alignment toolbar')
|
|
381
|
+
});
|
|
382
|
+
fillToolbar({
|
|
383
|
+
view: this,
|
|
384
|
+
icons: {
|
|
385
|
+
left: icons.objectLeft,
|
|
386
|
+
center: icons.objectCenter,
|
|
387
|
+
right: icons.objectRight
|
|
388
|
+
},
|
|
389
|
+
toolbar: alignmentToolbar,
|
|
390
|
+
labels: this._alignmentLabels,
|
|
391
|
+
propertyName: 'alignment',
|
|
392
|
+
defaultValue: this.options.defaultTableProperties.alignment
|
|
393
|
+
});
|
|
394
|
+
return {
|
|
395
|
+
alignmentLabel,
|
|
396
|
+
alignmentToolbar
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Creates the following form controls:
|
|
401
|
+
*
|
|
402
|
+
* * {@link #saveButtonView},
|
|
403
|
+
* * {@link #cancelButtonView}.
|
|
404
|
+
*/
|
|
405
|
+
_createActionButtons() {
|
|
406
|
+
const locale = this.locale;
|
|
407
|
+
const t = this.t;
|
|
408
|
+
const saveButtonView = new ButtonView(locale);
|
|
409
|
+
const cancelButtonView = new ButtonView(locale);
|
|
410
|
+
const fieldsThatShouldValidateToSave = [
|
|
411
|
+
this.borderWidthInput,
|
|
412
|
+
this.borderColorInput,
|
|
413
|
+
this.backgroundInput,
|
|
414
|
+
this.widthInput,
|
|
415
|
+
this.heightInput
|
|
416
|
+
];
|
|
417
|
+
saveButtonView.set({
|
|
418
|
+
label: t('Save'),
|
|
419
|
+
icon: icons.check,
|
|
420
|
+
class: 'ck-button-save',
|
|
421
|
+
type: 'submit',
|
|
422
|
+
withText: true
|
|
423
|
+
});
|
|
424
|
+
saveButtonView.bind('isEnabled').toMany(fieldsThatShouldValidateToSave, 'errorText', (...errorTexts) => {
|
|
425
|
+
return errorTexts.every(errorText => !errorText);
|
|
426
|
+
});
|
|
427
|
+
cancelButtonView.set({
|
|
428
|
+
label: t('Cancel'),
|
|
429
|
+
icon: icons.cancel,
|
|
430
|
+
class: 'ck-button-cancel',
|
|
431
|
+
withText: true
|
|
432
|
+
});
|
|
433
|
+
cancelButtonView.delegate('execute').to(this, 'cancel');
|
|
434
|
+
return {
|
|
435
|
+
saveButtonView, cancelButtonView
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Provides localized labels for {@link #alignmentToolbar} buttons.
|
|
440
|
+
*/
|
|
441
|
+
get _alignmentLabels() {
|
|
442
|
+
const locale = this.locale;
|
|
443
|
+
const t = this.t;
|
|
444
|
+
const left = t('Align table to the left');
|
|
445
|
+
const center = t('Center table');
|
|
446
|
+
const right = t('Align table to the right');
|
|
447
|
+
// Returns object with a proper order of labels.
|
|
448
|
+
if (locale.uiLanguageDirection === 'rtl') {
|
|
449
|
+
return { right, center, left };
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
return { left, center, right };
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
function isBorderStyleSet(value) {
|
|
457
|
+
return value !== 'none';
|
|
458
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tableproperties
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import TablePropertiesEditing from './tableproperties/tablepropertiesediting.js';
|
|
10
|
+
import TablePropertiesUI from './tableproperties/tablepropertiesui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The table properties feature. Enables support for setting properties of tables (size, border, background, etc.).
|
|
13
|
+
*
|
|
14
|
+
* Read more in the {@glink features/tables/tables-styling Table and cell styling tools} section.
|
|
15
|
+
* See also the {@link module:table/tablecellproperties~TableCellProperties} plugin.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin that loads the
|
|
18
|
+
* {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing table properties editing feature} and
|
|
19
|
+
* the {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI table properties UI feature}.
|
|
20
|
+
*/
|
|
21
|
+
export default class TableProperties extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "TableProperties";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get isOfficialPlugin(): true;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get requires(): readonly [typeof TablePropertiesEditing, typeof TablePropertiesUI];
|
|
34
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tableproperties
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import TablePropertiesEditing from './tableproperties/tablepropertiesediting.js';
|
|
10
|
+
import TablePropertiesUI from './tableproperties/tablepropertiesui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The table properties feature. Enables support for setting properties of tables (size, border, background, etc.).
|
|
13
|
+
*
|
|
14
|
+
* Read more in the {@glink features/tables/tables-styling Table and cell styling tools} section.
|
|
15
|
+
* See also the {@link module:table/tablecellproperties~TableCellProperties} plugin.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin that loads the
|
|
18
|
+
* {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing table properties editing feature} and
|
|
19
|
+
* the {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI table properties UI feature}.
|
|
20
|
+
*/
|
|
21
|
+
export default class TableProperties extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName() {
|
|
26
|
+
return 'TableProperties';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
static get isOfficialPlugin() {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static get requires() {
|
|
38
|
+
return [TablePropertiesEditing, TablePropertiesUI];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tableselection
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import type { Element, DocumentFragment } from 'ckeditor5/src/engine.js';
|
|
10
|
+
import TableUtils from './tableutils.js';
|
|
11
|
+
import '../theme/tableselection.css';
|
|
12
|
+
/**
|
|
13
|
+
* This plugin enables the advanced table cells, rows and columns selection.
|
|
14
|
+
* It is loaded automatically by the {@link module:table/table~Table} plugin.
|
|
15
|
+
*/
|
|
16
|
+
export default class TableSelection extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): "TableSelection";
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get isOfficialPlugin(): true;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get requires(): readonly [typeof TableUtils, typeof TableUtils];
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
init(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the currently selected table cells or `null` if it is not a table cells selection.
|
|
35
|
+
*/
|
|
36
|
+
getSelectedTableCells(): Array<Element> | null;
|
|
37
|
+
/**
|
|
38
|
+
* Returns the selected table fragment as a document fragment.
|
|
39
|
+
*/
|
|
40
|
+
getSelectionAsFragment(): DocumentFragment | null;
|
|
41
|
+
/**
|
|
42
|
+
* Sets the model selection based on given anchor and target cells (can be the same cell).
|
|
43
|
+
* Takes care of setting the backward flag.
|
|
44
|
+
*
|
|
45
|
+
* ```ts
|
|
46
|
+
* const modelRoot = editor.model.document.getRoot();
|
|
47
|
+
* const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );
|
|
48
|
+
* const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );
|
|
49
|
+
*
|
|
50
|
+
* const tableSelection = editor.plugins.get( 'TableSelection' );
|
|
51
|
+
* tableSelection.setCellSelection( firstCell, lastCell );
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
setCellSelection(anchorCell: Element, targetCell: Element): void;
|
|
55
|
+
/**
|
|
56
|
+
* Returns the focus cell from the current selection.
|
|
57
|
+
*/
|
|
58
|
+
getFocusCell(): Element | null;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the anchor cell from the current selection.
|
|
61
|
+
*/
|
|
62
|
+
getAnchorCell(): Element | null;
|
|
63
|
+
/**
|
|
64
|
+
* Defines a selection converter which marks the selected cells with a specific class.
|
|
65
|
+
*
|
|
66
|
+
* The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the
|
|
67
|
+
* selection is backward or not, the last cell will usually be close to the "focus" end of the selection
|
|
68
|
+
* (a selection has anchor and focus).
|
|
69
|
+
*
|
|
70
|
+
* The real DOM selection is then hidden with CSS.
|
|
71
|
+
*/
|
|
72
|
+
private _defineSelectionConverter;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,
|
|
75
|
+
* it collapses the multi-cell selection to a regular selection placed inside a table cell.
|
|
76
|
+
*
|
|
77
|
+
* This listener helps features that disable the table selection plugin bring the selection
|
|
78
|
+
* to a clear state they can work with (for instance, because they don't support multiple cell selection).
|
|
79
|
+
*/
|
|
80
|
+
private _enablePluginDisabling;
|
|
81
|
+
/**
|
|
82
|
+
* Overrides the default `model.deleteContent()` behavior over a selected table fragment.
|
|
83
|
+
*
|
|
84
|
+
* @param args Delete content method arguments.
|
|
85
|
+
*/
|
|
86
|
+
private _handleDeleteContent;
|
|
87
|
+
/**
|
|
88
|
+
* This handler makes it possible to remove the content of all selected cells by starting to type.
|
|
89
|
+
* If you take a look at {@link #_defineSelectionConverter} you will find out that despite the multi-cell selection being set
|
|
90
|
+
* in the model, the view selection is collapsed in the last cell (because most browsers are unable to render multi-cell selections;
|
|
91
|
+
* yes, it's a hack).
|
|
92
|
+
*
|
|
93
|
+
* When multiple cells are selected in the model and the user starts to type, the
|
|
94
|
+
* {@link module:engine/view/document~Document#event:insertText} event carries information provided by the
|
|
95
|
+
* beforeinput DOM event, that in turn only knows about this collapsed DOM selection in the last cell.
|
|
96
|
+
*
|
|
97
|
+
* As a result, the selected cells have no chance to be cleaned up. To fix this, this listener intercepts
|
|
98
|
+
* the event and injects the custom view selection in the data that translates correctly to the actual state
|
|
99
|
+
* of the multi-cell selection in the model.
|
|
100
|
+
*
|
|
101
|
+
* @param data Insert text event data.
|
|
102
|
+
*/
|
|
103
|
+
private _handleInsertTextEvent;
|
|
104
|
+
/**
|
|
105
|
+
* Returns an array of table cells that should be selected based on the
|
|
106
|
+
* given anchor cell and target (focus) cell.
|
|
107
|
+
*
|
|
108
|
+
* The cells are returned in a reverse direction if the selection is backward.
|
|
109
|
+
*/
|
|
110
|
+
private _getCellsToSelect;
|
|
111
|
+
}
|