@ckeditor/ckeditor5-table 44.3.0 → 45.0.0-alpha.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/LICENSE.md +1 -1
- package/build/table.js +2 -2
- 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 -0
- 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/ckeditor5-metadata.json +64 -6
- package/dist/index-content.css +50 -25
- package/dist/index-editor.css +115 -16
- package/dist/index.css +226 -60
- package/dist/index.css.map +1 -1
- package/dist/index.js +2907 -2247
- package/dist/index.js.map +1 -1
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.d.ts +8 -0
- package/dist/translations/be.js +5 -0
- package/dist/translations/be.umd.js +11 -0
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/lang/contexts.json +8 -1
- package/lang/translations/af.po +28 -0
- package/lang/translations/ar.po +28 -0
- package/lang/translations/ast.po +28 -0
- package/lang/translations/az.po +28 -0
- package/lang/translations/be.po +296 -0
- package/lang/translations/bg.po +28 -0
- package/lang/translations/bn.po +28 -0
- package/lang/translations/bs.po +28 -0
- package/lang/translations/ca.po +28 -0
- package/lang/translations/cs.po +28 -0
- package/lang/translations/da.po +28 -0
- package/lang/translations/de-ch.po +28 -0
- package/lang/translations/de.po +28 -0
- package/lang/translations/el.po +28 -0
- package/lang/translations/en-au.po +28 -0
- package/lang/translations/en-gb.po +28 -0
- package/lang/translations/en.po +28 -0
- package/lang/translations/eo.po +28 -0
- package/lang/translations/es-co.po +28 -0
- package/lang/translations/es.po +28 -0
- package/lang/translations/et.po +28 -0
- package/lang/translations/eu.po +28 -0
- package/lang/translations/fa.po +28 -0
- package/lang/translations/fi.po +28 -0
- package/lang/translations/fr.po +28 -0
- package/lang/translations/gl.po +28 -0
- package/lang/translations/gu.po +28 -0
- package/lang/translations/he.po +28 -0
- package/lang/translations/hi.po +28 -0
- package/lang/translations/hr.po +28 -0
- package/lang/translations/hu.po +28 -0
- package/lang/translations/hy.po +28 -0
- package/lang/translations/id.po +28 -0
- package/lang/translations/it.po +28 -0
- package/lang/translations/ja.po +28 -0
- package/lang/translations/jv.po +28 -0
- package/lang/translations/kk.po +28 -0
- package/lang/translations/km.po +28 -0
- package/lang/translations/kn.po +28 -0
- package/lang/translations/ko.po +28 -0
- package/lang/translations/ku.po +28 -0
- package/lang/translations/lt.po +28 -0
- package/lang/translations/lv.po +28 -0
- package/lang/translations/ms.po +28 -0
- package/lang/translations/nb.po +28 -0
- package/lang/translations/ne.po +28 -0
- package/lang/translations/nl.po +28 -0
- package/lang/translations/no.po +28 -0
- package/lang/translations/oc.po +28 -0
- package/lang/translations/pl.po +28 -0
- package/lang/translations/pt-br.po +28 -0
- package/lang/translations/pt.po +28 -0
- package/lang/translations/ro.po +28 -0
- package/lang/translations/ru.po +28 -0
- package/lang/translations/si.po +28 -0
- package/lang/translations/sk.po +28 -0
- package/lang/translations/sl.po +28 -0
- package/lang/translations/sq.po +28 -0
- package/lang/translations/sr-latn.po +28 -0
- package/lang/translations/sr.po +28 -0
- package/lang/translations/sv.po +28 -0
- package/lang/translations/th.po +28 -0
- package/lang/translations/ti.po +28 -0
- package/lang/translations/tk.po +28 -0
- package/lang/translations/tr.po +28 -0
- package/lang/translations/tt.po +28 -0
- package/lang/translations/ug.po +28 -0
- package/lang/translations/uk.po +28 -0
- package/lang/translations/ur.po +28 -0
- package/lang/translations/uz.po +28 -0
- package/lang/translations/vi.po +28 -0
- package/lang/translations/zh-cn.po +28 -0
- package/lang/translations/zh.po +28 -0
- package/package.json +10 -9
- package/src/augmentation.d.ts +5 -1
- package/src/commands/insertcolumncommand.js +4 -0
- package/src/commands/insertrowcommand.js +4 -0
- package/src/commands/inserttablelayoutcommand.d.ts +39 -0
- package/src/commands/inserttablelayoutcommand.js +65 -0
- package/src/commands/mergecellcommand.js +8 -0
- package/src/commands/setheadercolumncommand.js +9 -4
- package/src/commands/setheaderrowcommand.js +8 -3
- package/src/commands/splitcellcommand.js +4 -0
- package/src/converters/downcast.js +1 -1
- package/src/index.d.ts +4 -0
- package/src/index.js +2 -0
- package/src/plaintableoutput.d.ts +3 -0
- package/src/plaintableoutput.js +12 -1
- package/src/tablecaption/tablecaptionediting.js +7 -0
- package/src/tablecaption/tablecaptionui.js +3 -2
- package/src/tablecaption/toggletablecaptioncommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +8 -0
- package/src/tablecellproperties/tablecellpropertiesui.js +25 -3
- package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +2 -1
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +82 -13
- package/src/tableclipboard.d.ts +9 -0
- package/src/tableclipboard.js +28 -1
- package/src/tablecolumnresize/constants.d.ts +4 -0
- package/src/tablecolumnresize/constants.js +4 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +8 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.js +50 -10
- package/src/tableconfig.d.ts +38 -0
- package/src/tableediting.js +4 -0
- package/src/tablelayout/commands/tabletypecommand.d.ts +43 -0
- package/src/tablelayout/commands/tabletypecommand.js +68 -0
- package/src/tablelayout/tablelayoutediting.d.ts +54 -0
- package/src/tablelayout/tablelayoutediting.js +276 -0
- package/src/tablelayout/tablelayoutui.d.ts +32 -0
- package/src/tablelayout/tablelayoutui.js +189 -0
- package/src/tablelayout.d.ts +31 -0
- package/src/tablelayout.js +37 -0
- package/src/tablemouse/mouseeventsobserver.js +3 -6
- package/src/tableproperties/commands/tablepropertycommand.js +8 -0
- package/src/tableproperties/tablepropertiesui.d.ts +8 -2
- package/src/tableproperties/tablepropertiesui.js +44 -19
- package/src/tableproperties/ui/tablepropertiesview.d.ts +2 -1
- package/src/tableproperties/ui/tablepropertiesview.js +70 -9
- package/src/tableselection.js +19 -1
- package/src/tableui.js +7 -9
- package/src/tablewalker.js +99 -4
- package/src/ui/colorinputview.js +34 -0
- package/src/ui/inserttableview.js +12 -0
- package/src/utils/structure.js +7 -1
- package/src/utils/table-properties.js +1 -1
- package/theme/formrow.css +0 -10
- package/theme/table.css +52 -35
- package/theme/tablecolumnresize.css +5 -0
- package/theme/tableform.css +6 -0
- package/theme/tablelayout.css +62 -0
- package/src/ui/formrowview.d.ts +0 -61
- package/src/ui/formrowview.js +0 -57
- package/theme/form.css +0 -11
- package/theme/icons/table-cell-properties.svg +0 -1
- package/theme/icons/table-column.svg +0 -1
- package/theme/icons/table-merge-cell.svg +0 -1
- package/theme/icons/table-properties.svg +0 -1
- package/theme/icons/table-row.svg +0 -1
package/lang/translations/zh.po
CHANGED
|
@@ -266,3 +266,31 @@ msgstr "在表格中移動"
|
|
|
266
266
|
msgctxt "The accessible label of the menu bar button that displays a user interface to insert a table into editor content."
|
|
267
267
|
msgid "Table"
|
|
268
268
|
msgstr "表格"
|
|
269
|
+
|
|
270
|
+
msgctxt "Label for the insert table layout toolbar button."
|
|
271
|
+
msgid "Insert table layout"
|
|
272
|
+
msgstr ""
|
|
273
|
+
|
|
274
|
+
msgctxt "The accessible label used in the table layout insert UI element."
|
|
275
|
+
msgid "Table layout"
|
|
276
|
+
msgstr ""
|
|
277
|
+
|
|
278
|
+
msgctxt "The accessible label of the layout table type dropdown button."
|
|
279
|
+
msgid "Layout table"
|
|
280
|
+
msgstr ""
|
|
281
|
+
|
|
282
|
+
msgctxt "The accessible label of the content table type dropdown button."
|
|
283
|
+
msgid "Content table"
|
|
284
|
+
msgstr ""
|
|
285
|
+
|
|
286
|
+
msgctxt "The accessible label of the table balloon button that displays a user interface to choose table type."
|
|
287
|
+
msgid "Choose table type"
|
|
288
|
+
msgstr ""
|
|
289
|
+
|
|
290
|
+
msgctxt "The accessible label of the table type toolbar button."
|
|
291
|
+
msgid "Table type"
|
|
292
|
+
msgstr ""
|
|
293
|
+
|
|
294
|
+
msgctxt "The accessible label of dropdown list that displays a user interface to choose table type."
|
|
295
|
+
msgid "Table type options"
|
|
296
|
+
msgstr ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.0.0-alpha.0",
|
|
4
4
|
"description": "Table feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"ckeditor5": "
|
|
17
|
-
"@ckeditor/ckeditor5-clipboard": "
|
|
18
|
-
"@ckeditor/ckeditor5-core": "
|
|
19
|
-
"@ckeditor/ckeditor5-engine": "
|
|
20
|
-
"@ckeditor/ckeditor5-
|
|
21
|
-
"@ckeditor/ckeditor5-
|
|
22
|
-
"@ckeditor/ckeditor5-
|
|
23
|
-
"
|
|
16
|
+
"ckeditor5": "45.0.0-alpha.0",
|
|
17
|
+
"@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.0",
|
|
18
|
+
"@ckeditor/ckeditor5-core": "45.0.0-alpha.0",
|
|
19
|
+
"@ckeditor/ckeditor5-engine": "45.0.0-alpha.0",
|
|
20
|
+
"@ckeditor/ckeditor5-icons": "45.0.0-alpha.0",
|
|
21
|
+
"@ckeditor/ckeditor5-ui": "45.0.0-alpha.0",
|
|
22
|
+
"@ckeditor/ckeditor5-utils": "45.0.0-alpha.0",
|
|
23
|
+
"@ckeditor/ckeditor5-widget": "45.0.0-alpha.0",
|
|
24
|
+
"es-toolkit": "1.32.0"
|
|
24
25
|
},
|
|
25
26
|
"author": "CKSource (http://cksource.com/)",
|
|
26
27
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/augmentation.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import type { TableConfig, Table, TableCaption, TableCaptionEditing, TableCaptionUI, TableCellProperties, TableCellPropertiesEditing, TableCellPropertiesUI, TableCellWidthEditing, TableClipboard, TableColumnResize, TableColumnResizeEditing, TableEditing, TableKeyboard, TableMouse, TableProperties, TablePropertiesEditing, TablePropertiesUI, TableSelection, TableToolbar, TableUI, TableUtils, PlainTableOutput, InsertColumnCommand, InsertRowCommand, InsertTableCommand, MergeCellCommand, MergeCellsCommand, RemoveColumnCommand, RemoveRowCommand, SelectColumnCommand, SelectRowCommand, SetHeaderColumnCommand, SetHeaderRowCommand, SplitCellCommand, ToggleTableCaptionCommand, TableCellBackgroundColorCommand, TableCellBorderColorCommand, TableCellBorderStyleCommand, TableCellBorderWidthCommand, TableCellHeightCommand, TableCellHorizontalAlignmentCommand, TableCellPaddingCommand, TableCellVerticalAlignmentCommand, TableCellWidthCommand, TableAlignmentCommand, TableBackgroundColorCommand, TableBorderColorCommand, TableBorderStyleCommand, TableBorderWidthCommand, TableHeightCommand, TableWidthCommand } from './index.js';
|
|
5
|
+
import type { TableConfig, Table, TableCaption, TableCaptionEditing, TableCaptionUI, TableCellProperties, TableCellPropertiesEditing, TableCellPropertiesUI, TableCellWidthEditing, TableClipboard, TableColumnResize, TableColumnResizeEditing, TableEditing, TableKeyboard, TableLayout, TableLayoutEditing, TableMouse, TableProperties, TablePropertiesEditing, TablePropertiesUI, TableSelection, TableToolbar, TableUI, TableUtils, PlainTableOutput, InsertColumnCommand, InsertRowCommand, InsertTableCommand, InsertTableLayoutCommand, MergeCellCommand, MergeCellsCommand, RemoveColumnCommand, RemoveRowCommand, SelectColumnCommand, SelectRowCommand, SetHeaderColumnCommand, SetHeaderRowCommand, TableTypeCommand, SplitCellCommand, ToggleTableCaptionCommand, TableCellBackgroundColorCommand, TableCellBorderColorCommand, TableCellBorderStyleCommand, TableCellBorderWidthCommand, TableCellHeightCommand, TableCellHorizontalAlignmentCommand, TableCellPaddingCommand, TableCellVerticalAlignmentCommand, TableCellWidthCommand, TableAlignmentCommand, TableBackgroundColorCommand, TableBorderColorCommand, TableBorderStyleCommand, TableBorderWidthCommand, TableHeightCommand, TableWidthCommand } from './index.js';
|
|
6
6
|
declare module '@ckeditor/ckeditor5-core' {
|
|
7
7
|
interface EditorConfig {
|
|
8
8
|
/**
|
|
@@ -26,6 +26,8 @@ declare module '@ckeditor/ckeditor5-core' {
|
|
|
26
26
|
[TableColumnResizeEditing.pluginName]: TableColumnResizeEditing;
|
|
27
27
|
[TableEditing.pluginName]: TableEditing;
|
|
28
28
|
[TableKeyboard.pluginName]: TableKeyboard;
|
|
29
|
+
[TableLayout.pluginName]: TableLayout;
|
|
30
|
+
[TableLayoutEditing.pluginName]: TableLayoutEditing;
|
|
29
31
|
[TableMouse.pluginName]: TableMouse;
|
|
30
32
|
[TableProperties.pluginName]: TableProperties;
|
|
31
33
|
[TablePropertiesEditing.pluginName]: TablePropertiesEditing;
|
|
@@ -42,6 +44,7 @@ declare module '@ckeditor/ckeditor5-core' {
|
|
|
42
44
|
insertTableRowAbove: InsertRowCommand;
|
|
43
45
|
insertTableRowBelow: InsertRowCommand;
|
|
44
46
|
insertTable: InsertTableCommand;
|
|
47
|
+
insertTableLayout: InsertTableLayoutCommand;
|
|
45
48
|
mergeTableCellRight: MergeCellCommand;
|
|
46
49
|
mergeTableCellLeft: MergeCellCommand;
|
|
47
50
|
mergeTableCellDown: MergeCellCommand;
|
|
@@ -72,5 +75,6 @@ declare module '@ckeditor/ckeditor5-core' {
|
|
|
72
75
|
tableBorderWidth: TableBorderWidthCommand;
|
|
73
76
|
tableHeight: TableHeightCommand;
|
|
74
77
|
tableWidth: TableWidthCommand;
|
|
78
|
+
tableType: TableTypeCommand;
|
|
75
79
|
}
|
|
76
80
|
}
|
|
@@ -25,6 +25,10 @@ import { Command } from 'ckeditor5/src/core.js';
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export default class InsertColumnCommand extends Command {
|
|
28
|
+
/**
|
|
29
|
+
* The order of insertion relative to the column in which the caret is located.
|
|
30
|
+
*/
|
|
31
|
+
order;
|
|
28
32
|
/**
|
|
29
33
|
* Creates a new `InsertColumnCommand` instance.
|
|
30
34
|
*
|
|
@@ -25,6 +25,10 @@ import { Command } from 'ckeditor5/src/core.js';
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export default class InsertRowCommand extends Command {
|
|
28
|
+
/**
|
|
29
|
+
* The order of insertion relative to the row in which the caret is located.
|
|
30
|
+
*/
|
|
31
|
+
order;
|
|
28
32
|
/**
|
|
29
33
|
* Creates a new `InsertRowCommand` instance.
|
|
30
34
|
*
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/commands/inserttablelayoutcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The insert table layout command.
|
|
11
|
+
*
|
|
12
|
+
* The command is registered by {@link module:table/tablelayout/tablelayoutediting~TableLayoutEditing}
|
|
13
|
+
* as the `'insertTableLayout'` editor command.
|
|
14
|
+
*
|
|
15
|
+
* To insert a layout table at the current selection, execute the command and specify the dimensions:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.execute( 'insertTableLayout', { rows: 20, columns: 5 } );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export default class InsertTableLayoutCommand extends Command {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
refresh(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Executes the command.
|
|
28
|
+
*
|
|
29
|
+
* Inserts a layout table with the given number of rows and columns into the editor.
|
|
30
|
+
*
|
|
31
|
+
* @param options.rows The number of rows to create in the inserted table. Default value is 2.
|
|
32
|
+
* @param options.columns The number of columns to create in the inserted table. Default value is 2.
|
|
33
|
+
* @fires execute
|
|
34
|
+
*/
|
|
35
|
+
execute(options?: {
|
|
36
|
+
rows?: number;
|
|
37
|
+
columns?: number;
|
|
38
|
+
}): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/commands/inserttablelayoutcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The insert table layout command.
|
|
11
|
+
*
|
|
12
|
+
* The command is registered by {@link module:table/tablelayout/tablelayoutediting~TableLayoutEditing}
|
|
13
|
+
* as the `'insertTableLayout'` editor command.
|
|
14
|
+
*
|
|
15
|
+
* To insert a layout table at the current selection, execute the command and specify the dimensions:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.execute( 'insertTableLayout', { rows: 20, columns: 5 } );
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export default class InsertTableLayoutCommand extends Command {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
refresh() {
|
|
26
|
+
const model = this.editor.model;
|
|
27
|
+
const selection = model.document.selection;
|
|
28
|
+
const schema = model.schema;
|
|
29
|
+
this.isEnabled = isAllowedInParent(selection, schema);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Executes the command.
|
|
33
|
+
*
|
|
34
|
+
* Inserts a layout table with the given number of rows and columns into the editor.
|
|
35
|
+
*
|
|
36
|
+
* @param options.rows The number of rows to create in the inserted table. Default value is 2.
|
|
37
|
+
* @param options.columns The number of columns to create in the inserted table. Default value is 2.
|
|
38
|
+
* @fires execute
|
|
39
|
+
*/
|
|
40
|
+
execute(options = {}) {
|
|
41
|
+
const editor = this.editor;
|
|
42
|
+
const model = editor.model;
|
|
43
|
+
const tableUtils = editor.plugins.get('TableUtils');
|
|
44
|
+
model.change(writer => {
|
|
45
|
+
const normalizedOptions = { rows: options.rows || 2, columns: options.columns || 2 };
|
|
46
|
+
const table = tableUtils.createTable(writer, normalizedOptions);
|
|
47
|
+
writer.setAttribute('tableType', 'layout', table);
|
|
48
|
+
model.insertObject(table, null, null, { findOptimalPosition: 'auto' });
|
|
49
|
+
const singleColumnWidth = `${100 / normalizedOptions.columns}%`;
|
|
50
|
+
const columnWidths = Array(normalizedOptions.columns).fill(singleColumnWidth);
|
|
51
|
+
const tableWidthsCommand = editor.commands.get('resizeColumnWidths');
|
|
52
|
+
// Make the table full-width with equal columns width.
|
|
53
|
+
tableWidthsCommand.execute({ tableWidth: '100%', columnWidths, table });
|
|
54
|
+
writer.setSelection(writer.createPositionAt(table.getNodeByPath([0, 0, 0]), 0));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Checks if the table is allowed in the parent.
|
|
60
|
+
*/
|
|
61
|
+
function isAllowedInParent(selection, schema) {
|
|
62
|
+
const positionParent = selection.getFirstPosition().parent;
|
|
63
|
+
const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;
|
|
64
|
+
return schema.checkChild(validParent, 'table');
|
|
65
|
+
}
|
|
@@ -25,6 +25,14 @@ import { removeEmptyRowsColumns } from '../utils/structure.js';
|
|
|
25
25
|
* (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
|
|
26
26
|
*/
|
|
27
27
|
export default class MergeCellCommand extends Command {
|
|
28
|
+
/**
|
|
29
|
+
* The direction that indicates which cell will be merged with the currently selected one.
|
|
30
|
+
*/
|
|
31
|
+
direction;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the merge is horizontal (left/right) or vertical (up/down).
|
|
34
|
+
*/
|
|
35
|
+
isHorizontal;
|
|
28
36
|
/**
|
|
29
37
|
* Creates a new `MergeCellCommand` instance.
|
|
30
38
|
*
|
|
@@ -28,12 +28,17 @@ export default class SetHeaderColumnCommand extends Command {
|
|
|
28
28
|
* @inheritDoc
|
|
29
29
|
*/
|
|
30
30
|
refresh() {
|
|
31
|
-
const model = this.editor.model;
|
|
32
31
|
const tableUtils = this.editor.plugins.get('TableUtils');
|
|
32
|
+
const model = this.editor.model;
|
|
33
33
|
const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
if (selectedCells.length === 0) {
|
|
35
|
+
this.isEnabled = false;
|
|
36
|
+
this.value = false;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const table = selectedCells[0].findAncestor('table');
|
|
40
|
+
this.isEnabled = model.schema.checkAttribute(table, 'headingColumns');
|
|
41
|
+
this.value = selectedCells.every(cell => isHeadingColumnCell(tableUtils, cell));
|
|
37
42
|
}
|
|
38
43
|
/**
|
|
39
44
|
* Executes the command.
|
|
@@ -30,9 +30,14 @@ export default class SetHeaderRowCommand extends Command {
|
|
|
30
30
|
const tableUtils = this.editor.plugins.get('TableUtils');
|
|
31
31
|
const model = this.editor.model;
|
|
32
32
|
const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (selectedCells.length === 0) {
|
|
34
|
+
this.isEnabled = false;
|
|
35
|
+
this.value = false;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const table = selectedCells[0].findAncestor('table');
|
|
39
|
+
this.isEnabled = model.schema.checkAttribute(table, 'headingRows');
|
|
40
|
+
this.value = selectedCells.every(cell => this._isInHeading(cell, cell.parent.parent));
|
|
36
41
|
}
|
|
37
42
|
/**
|
|
38
43
|
* Executes the command.
|
|
@@ -19,6 +19,10 @@ import { Command } from 'ckeditor5/src/core.js';
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
export default class SplitCellCommand extends Command {
|
|
22
|
+
/**
|
|
23
|
+
* The direction that indicates which cell will be split.
|
|
24
|
+
*/
|
|
25
|
+
direction;
|
|
22
26
|
/**
|
|
23
27
|
* Creates a new `SplitCellCommand` instance.
|
|
24
28
|
*
|
|
@@ -73,7 +73,7 @@ export function downcastCell(options = {}) {
|
|
|
73
73
|
const isHeading = tableSlot.row < headingRows || tableSlot.column < headingColumns;
|
|
74
74
|
const cellElementName = isHeading ? 'th' : 'td';
|
|
75
75
|
result = options.asWidget ?
|
|
76
|
-
toWidgetEditable(writer.createEditableElement(cellElementName), writer) :
|
|
76
|
+
toWidgetEditable(writer.createEditableElement(cellElementName), writer, { withAriaRole: false }) :
|
|
77
77
|
writer.createContainerElement(cellElementName);
|
|
78
78
|
break;
|
|
79
79
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export { default as TableCellProperties } from './tablecellproperties.js';
|
|
|
14
14
|
export { default as TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
|
|
15
15
|
export { default as TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
|
|
16
16
|
export { default as TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
|
|
17
|
+
export { default as TableLayout } from './tablelayout.js';
|
|
18
|
+
export { default as TableLayoutEditing } from './tablelayout/tablelayoutediting.js';
|
|
17
19
|
export { default as TableProperties } from './tableproperties.js';
|
|
18
20
|
export { default as TablePropertiesEditing } from './tableproperties/tablepropertiesediting.js';
|
|
19
21
|
export { default as TablePropertiesUI } from './tableproperties/tablepropertiesui.js';
|
|
@@ -31,6 +33,8 @@ export type { TableConfig } from './tableconfig.js';
|
|
|
31
33
|
export type { default as InsertColumnCommand } from './commands/insertcolumncommand.js';
|
|
32
34
|
export type { default as InsertRowCommand } from './commands/insertrowcommand.js';
|
|
33
35
|
export type { default as InsertTableCommand } from './commands/inserttablecommand.js';
|
|
36
|
+
export type { default as InsertTableLayoutCommand } from './commands/inserttablelayoutcommand.js';
|
|
37
|
+
export type { default as TableTypeCommand } from './tablelayout/commands/tabletypecommand.js';
|
|
34
38
|
export type { default as MergeCellCommand } from './commands/mergecellcommand.js';
|
|
35
39
|
export type { default as MergeCellsCommand } from './commands/mergecellscommand.js';
|
|
36
40
|
export type { default as RemoveColumnCommand } from './commands/removecolumncommand.js';
|
package/src/index.js
CHANGED
|
@@ -14,6 +14,8 @@ export { default as TableCellProperties } from './tablecellproperties.js';
|
|
|
14
14
|
export { default as TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
|
|
15
15
|
export { default as TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
|
|
16
16
|
export { default as TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
|
|
17
|
+
export { default as TableLayout } from './tablelayout.js';
|
|
18
|
+
export { default as TableLayoutEditing } from './tablelayout/tablelayoutediting.js';
|
|
17
19
|
export { default as TableProperties } from './tableproperties.js';
|
|
18
20
|
export { default as TablePropertiesEditing } from './tableproperties/tablepropertiesediting.js';
|
|
19
21
|
export { default as TablePropertiesUI } from './tableproperties/tablepropertiesui.js';
|
|
@@ -9,6 +9,9 @@ import { Plugin } from 'ckeditor5/src/core.js';
|
|
|
9
9
|
import Table from './table.js';
|
|
10
10
|
/**
|
|
11
11
|
* The plain table output feature.
|
|
12
|
+
*
|
|
13
|
+
* This feature strips the `<figure>` tag from the table data. This is because this tag is not supported
|
|
14
|
+
* by most popular email clients and removing it ensures compatibility.
|
|
12
15
|
*/
|
|
13
16
|
export default class PlainTableOutput extends Plugin {
|
|
14
17
|
/**
|
package/src/plaintableoutput.js
CHANGED
|
@@ -9,6 +9,9 @@ import { Plugin } from 'ckeditor5/src/core.js';
|
|
|
9
9
|
import Table from './table.js';
|
|
10
10
|
/**
|
|
11
11
|
* The plain table output feature.
|
|
12
|
+
*
|
|
13
|
+
* This feature strips the `<figure>` tag from the table data. This is because this tag is not supported
|
|
14
|
+
* by most popular email clients and removing it ensures compatibility.
|
|
12
15
|
*/
|
|
13
16
|
export default class PlainTableOutput extends Plugin {
|
|
14
17
|
/**
|
|
@@ -56,6 +59,14 @@ export default class PlainTableOutput extends Plugin {
|
|
|
56
59
|
if (editor.plugins.has('TableProperties')) {
|
|
57
60
|
downcastTableBorderAndBackgroundAttributes(editor);
|
|
58
61
|
}
|
|
62
|
+
editor.conversion.for('upcast').add(dispatcher => {
|
|
63
|
+
dispatcher.on('element:table', (evt, data, conversionApi) => {
|
|
64
|
+
// It's not necessary to upcast the `table` class. This class was only added in data downcast
|
|
65
|
+
// to center a plain table in the editor output.
|
|
66
|
+
// See: https://github.com/ckeditor/ckeditor5/issues/17888.
|
|
67
|
+
conversionApi.consumable.consume(data.viewItem, { classes: 'table' });
|
|
68
|
+
});
|
|
69
|
+
});
|
|
59
70
|
}
|
|
60
71
|
}
|
|
61
72
|
/**
|
|
@@ -96,7 +107,7 @@ function downcastTableElement(table, { writer }) {
|
|
|
96
107
|
// {table-body-rows-slot}
|
|
97
108
|
// </tbody>
|
|
98
109
|
// </table>
|
|
99
|
-
return writer.createContainerElement('table',
|
|
110
|
+
return writer.createContainerElement('table', { class: 'table' }, [childrenSlot, ...tableContentElements]);
|
|
100
111
|
}
|
|
101
112
|
/**
|
|
102
113
|
* Register table border and background attributes converters.
|
|
@@ -15,6 +15,13 @@ import { isTable, matchTableCaptionViewElement } from './utils.js';
|
|
|
15
15
|
* The table caption editing plugin.
|
|
16
16
|
*/
|
|
17
17
|
export default class TableCaptionEditing extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* A map that keeps saved JSONified table captions and table model elements they are
|
|
20
|
+
* associated with.
|
|
21
|
+
*
|
|
22
|
+
* To learn more about this system, see {@link #_saveCaption}.
|
|
23
|
+
*/
|
|
24
|
+
_savedCaptionsMap;
|
|
18
25
|
/**
|
|
19
26
|
* @inheritDoc
|
|
20
27
|
*/
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module table/tablecaption/tablecaptionui
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { ButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { IconCaption } from 'ckeditor5/src/icons.js';
|
|
10
11
|
import { getCaptionFromModelSelection } from './utils.js';
|
|
11
12
|
/**
|
|
12
13
|
* The table caption UI plugin. It introduces the `'toggleTableCaption'` UI button.
|
|
@@ -35,7 +36,7 @@ export default class TableCaptionUI extends Plugin {
|
|
|
35
36
|
const command = editor.commands.get('toggleTableCaption');
|
|
36
37
|
const view = new ButtonView(locale);
|
|
37
38
|
view.set({
|
|
38
|
-
icon:
|
|
39
|
+
icon: IconCaption,
|
|
39
40
|
tooltip: true,
|
|
40
41
|
isToggleable: true
|
|
41
42
|
});
|
|
@@ -38,7 +38,7 @@ export default class ToggleTableCaptionCommand extends Command {
|
|
|
38
38
|
refresh() {
|
|
39
39
|
const editor = this.editor;
|
|
40
40
|
const tableElement = getSelectionAffectedTable(editor.model.document.selection);
|
|
41
|
-
this.isEnabled = !!tableElement;
|
|
41
|
+
this.isEnabled = !!tableElement && editor.model.schema.checkChild(tableElement, 'caption');
|
|
42
42
|
if (!this.isEnabled) {
|
|
43
43
|
this.value = false;
|
|
44
44
|
}
|
|
@@ -12,6 +12,14 @@ import { Command } from 'ckeditor5/src/core.js';
|
|
|
12
12
|
* The command is a base command for other table cell property commands.
|
|
13
13
|
*/
|
|
14
14
|
export default class TableCellPropertyCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* The attribute that will be set by the command.
|
|
17
|
+
*/
|
|
18
|
+
attributeName;
|
|
19
|
+
/**
|
|
20
|
+
* The default value for the attribute.
|
|
21
|
+
*/
|
|
22
|
+
_defaultValue;
|
|
15
23
|
/**
|
|
16
24
|
* Creates a new `TableCellPropertyCommand` instance.
|
|
17
25
|
*
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
* @module table/tablecellproperties/tablecellpropertiesui
|
|
7
7
|
*/
|
|
8
8
|
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { IconTableCellProperties } from 'ckeditor5/src/icons.js';
|
|
9
10
|
import { ButtonView, clickOutsideHandler, ContextualBalloon, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui.js';
|
|
10
11
|
import TableCellPropertiesView from './ui/tablecellpropertiesview.js';
|
|
11
12
|
import { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, defaultColors, lengthFieldValidator, lineWidthFieldValidator } from '../utils/ui/table-properties.js';
|
|
12
|
-
import { debounce } from '
|
|
13
|
+
import { debounce } from 'es-toolkit/compat';
|
|
13
14
|
import { getTableWidgetAncestor } from '../utils/ui/widget.js';
|
|
14
15
|
import { getBalloonCellPositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon.js';
|
|
15
|
-
import tableCellProperties from './../../theme/icons/table-cell-properties.svg';
|
|
16
16
|
import { getNormalizedDefaultCellProperties } from '../utils/table-properties.js';
|
|
17
17
|
const ERROR_TEXT_TIMEOUT = 500;
|
|
18
18
|
// Map of view properties and related commands.
|
|
@@ -34,6 +34,28 @@ const propertyToCommandMap = {
|
|
|
34
34
|
* It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
|
|
35
35
|
*/
|
|
36
36
|
export default class TableCellPropertiesUI extends Plugin {
|
|
37
|
+
/**
|
|
38
|
+
* The default table cell properties.
|
|
39
|
+
*/
|
|
40
|
+
_defaultTableCellProperties;
|
|
41
|
+
/**
|
|
42
|
+
* The contextual balloon plugin instance.
|
|
43
|
+
*/
|
|
44
|
+
_balloon;
|
|
45
|
+
/**
|
|
46
|
+
* The cell properties form view displayed inside the balloon.
|
|
47
|
+
*/
|
|
48
|
+
view;
|
|
49
|
+
/**
|
|
50
|
+
* The batch used to undo all changes made by the form (which are live, as the user types)
|
|
51
|
+
* when "Cancel" was pressed. Each time the view is shown, a new batch is created.
|
|
52
|
+
*/
|
|
53
|
+
_undoStepBatch;
|
|
54
|
+
/**
|
|
55
|
+
* Flag used to indicate whether view is ready to execute update commands
|
|
56
|
+
* (it finished loading initial data).
|
|
57
|
+
*/
|
|
58
|
+
_isReady;
|
|
37
59
|
/**
|
|
38
60
|
* @inheritDoc
|
|
39
61
|
*/
|
|
@@ -81,7 +103,7 @@ export default class TableCellPropertiesUI extends Plugin {
|
|
|
81
103
|
const view = new ButtonView(locale);
|
|
82
104
|
view.set({
|
|
83
105
|
label: t('Cell properties'),
|
|
84
|
-
icon:
|
|
106
|
+
icon: IconTableCellProperties,
|
|
85
107
|
tooltip: true
|
|
86
108
|
});
|
|
87
109
|
this.listenTo(view, 'execute', () => this._showView());
|
|
@@ -9,7 +9,8 @@ import { ButtonView, FocusCycler, LabeledFieldView, ToolbarView, View, ViewColle
|
|
|
9
9
|
import { KeystrokeHandler, FocusTracker, type Locale } from 'ckeditor5/src/utils.js';
|
|
10
10
|
import type ColorInputView from '../../ui/colorinputview.js';
|
|
11
11
|
import type { TableCellPropertiesOptions } from '../../tableconfig.js';
|
|
12
|
-
import '
|
|
12
|
+
import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
|
|
13
|
+
import '../../../theme/formrow.css';
|
|
13
14
|
import '../../../theme/tableform.css';
|
|
14
15
|
import '../../../theme/tablecellproperties.css';
|
|
15
16
|
export interface TableCellPropertiesViewOptions {
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module table/tablecellproperties/ui/tablecellpropertiesview
|
|
7
7
|
*/
|
|
8
|
-
import { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
8
|
+
import { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormRowView, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
9
9
|
import { KeystrokeHandler, FocusTracker } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import {
|
|
10
|
+
import { IconAlignBottom, IconAlignCenter, IconAlignJustify, IconAlignLeft, IconAlignMiddle, IconAlignRight, IconAlignTop, IconCancel, IconCheck } from 'ckeditor5/src/icons.js';
|
|
11
11
|
import { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties.js';
|
|
12
|
-
|
|
13
|
-
import '
|
|
12
|
+
// eslint-disable-next-line ckeditor5-rules/ckeditor-imports
|
|
13
|
+
import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
|
|
14
|
+
import '../../../theme/formrow.css';
|
|
14
15
|
import '../../../theme/tableform.css';
|
|
15
16
|
import '../../../theme/tablecellproperties.css';
|
|
16
17
|
/**
|
|
@@ -18,6 +19,74 @@ import '../../../theme/tablecellproperties.css';
|
|
|
18
19
|
* certain style aspects of a table cell, for instance, border, padding, text alignment, etc..
|
|
19
20
|
*/
|
|
20
21
|
export default class TableCellPropertiesView extends View {
|
|
22
|
+
/**
|
|
23
|
+
* Options passed to the view. See {@link #constructor} to learn more.
|
|
24
|
+
*/
|
|
25
|
+
options;
|
|
26
|
+
/**
|
|
27
|
+
* Tracks information about the DOM focus in the form.
|
|
28
|
+
*/
|
|
29
|
+
focusTracker;
|
|
30
|
+
/**
|
|
31
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
32
|
+
*/
|
|
33
|
+
keystrokes;
|
|
34
|
+
/**
|
|
35
|
+
* A collection of child views in the form.
|
|
36
|
+
*/
|
|
37
|
+
children;
|
|
38
|
+
/**
|
|
39
|
+
* A dropdown that allows selecting the style of the table cell border.
|
|
40
|
+
*/
|
|
41
|
+
borderStyleDropdown;
|
|
42
|
+
/**
|
|
43
|
+
* An input that allows specifying the width of the table cell border.
|
|
44
|
+
*/
|
|
45
|
+
borderWidthInput;
|
|
46
|
+
/**
|
|
47
|
+
* An input that allows specifying the color of the table cell border.
|
|
48
|
+
*/
|
|
49
|
+
borderColorInput;
|
|
50
|
+
/**
|
|
51
|
+
* An input that allows specifying the table cell background color.
|
|
52
|
+
*/
|
|
53
|
+
backgroundInput;
|
|
54
|
+
/**
|
|
55
|
+
* An input that allows specifying the table cell padding.
|
|
56
|
+
*/
|
|
57
|
+
paddingInput;
|
|
58
|
+
/**
|
|
59
|
+
* An input that allows specifying the table cell width.
|
|
60
|
+
*/
|
|
61
|
+
widthInput;
|
|
62
|
+
/**
|
|
63
|
+
* An input that allows specifying the table cell height.
|
|
64
|
+
*/
|
|
65
|
+
heightInput;
|
|
66
|
+
/**
|
|
67
|
+
* A toolbar with buttons that allow changing the horizontal text alignment in a table cell.
|
|
68
|
+
*/
|
|
69
|
+
horizontalAlignmentToolbar;
|
|
70
|
+
/**
|
|
71
|
+
* A toolbar with buttons that allow changing the vertical text alignment in a table cell.
|
|
72
|
+
*/
|
|
73
|
+
verticalAlignmentToolbar;
|
|
74
|
+
/**
|
|
75
|
+
* The "Save" button view.
|
|
76
|
+
*/
|
|
77
|
+
saveButtonView;
|
|
78
|
+
/**
|
|
79
|
+
* The "Cancel" button view.
|
|
80
|
+
*/
|
|
81
|
+
cancelButtonView;
|
|
82
|
+
/**
|
|
83
|
+
* A collection of views that can be focused in the form.
|
|
84
|
+
*/
|
|
85
|
+
_focusables;
|
|
86
|
+
/**
|
|
87
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
88
|
+
*/
|
|
89
|
+
_focusCycler;
|
|
21
90
|
/**
|
|
22
91
|
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
23
92
|
* @param options Additional configuration of the view.
|
|
@@ -412,13 +481,13 @@ export default class TableCellPropertiesView extends View {
|
|
|
412
481
|
const t = this.t;
|
|
413
482
|
const alignmentLabel = new LabelView(locale);
|
|
414
483
|
const ALIGNMENT_ICONS = {
|
|
415
|
-
left:
|
|
416
|
-
center:
|
|
417
|
-
right:
|
|
418
|
-
justify:
|
|
419
|
-
top:
|
|
420
|
-
middle:
|
|
421
|
-
bottom:
|
|
484
|
+
left: IconAlignLeft,
|
|
485
|
+
center: IconAlignCenter,
|
|
486
|
+
right: IconAlignRight,
|
|
487
|
+
justify: IconAlignJustify,
|
|
488
|
+
top: IconAlignTop,
|
|
489
|
+
middle: IconAlignMiddle,
|
|
490
|
+
bottom: IconAlignBottom
|
|
422
491
|
};
|
|
423
492
|
alignmentLabel.text = t('Table cell text alignment');
|
|
424
493
|
// -- Horizontal ---------------------------------------------------
|
|
@@ -489,7 +558,7 @@ export default class TableCellPropertiesView extends View {
|
|
|
489
558
|
];
|
|
490
559
|
saveButtonView.set({
|
|
491
560
|
label: t('Save'),
|
|
492
|
-
icon:
|
|
561
|
+
icon: IconCheck,
|
|
493
562
|
class: 'ck-button-save',
|
|
494
563
|
type: 'submit',
|
|
495
564
|
withText: true
|
|
@@ -499,7 +568,7 @@ export default class TableCellPropertiesView extends View {
|
|
|
499
568
|
});
|
|
500
569
|
cancelButtonView.set({
|
|
501
570
|
label: t('Cancel'),
|
|
502
|
-
icon:
|
|
571
|
+
icon: IconCancel,
|
|
503
572
|
class: 'ck-button-cancel',
|
|
504
573
|
withText: true
|
|
505
574
|
});
|