@ckeditor/ckeditor5-table 36.0.1 → 37.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/table.js +1 -1
- package/ckeditor5-metadata.json +6 -6
- package/package.json +34 -29
- 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 +45 -60
- package/src/commands/insertrowcommand.d.ts +54 -0
- package/src/commands/insertrowcommand.js +44 -59
- package/src/commands/inserttablecommand.d.ts +44 -0
- package/src/commands/inserttablecommand.js +50 -68
- package/src/commands/mergecellcommand.d.ts +68 -0
- package/src/commands/mergecellcommand.js +169 -244
- package/src/commands/mergecellscommand.d.ts +28 -0
- package/src/commands/mergecellscommand.js +72 -101
- package/src/commands/removecolumncommand.d.ts +29 -0
- package/src/commands/removecolumncommand.js +88 -102
- package/src/commands/removerowcommand.d.ts +29 -0
- package/src/commands/removerowcommand.js +63 -80
- package/src/commands/selectcolumncommand.d.ts +33 -0
- package/src/commands/selectcolumncommand.js +41 -54
- package/src/commands/selectrowcommand.d.ts +33 -0
- package/src/commands/selectrowcommand.js +38 -48
- package/src/commands/setheadercolumncommand.d.ts +50 -0
- package/src/commands/setheadercolumncommand.js +48 -73
- package/src/commands/setheaderrowcommand.d.ts +53 -0
- package/src/commands/setheaderrowcommand.js +56 -85
- package/src/commands/splitcellcommand.d.ts +43 -0
- package/src/commands/splitcellcommand.js +35 -49
- package/src/converters/downcast.d.ts +63 -0
- package/src/converters/downcast.js +98 -130
- package/src/converters/table-caption-post-fixer.d.ts +20 -0
- package/src/converters/table-caption-post-fixer.js +36 -52
- package/src/converters/table-cell-paragraph-post-fixer.d.ts +32 -0
- package/src/converters/table-cell-paragraph-post-fixer.js +88 -119
- package/src/converters/table-cell-refresh-handler.d.ts +18 -0
- package/src/converters/table-cell-refresh-handler.js +29 -48
- package/src/converters/table-headings-refresh-handler.d.ts +17 -0
- package/src/converters/table-headings-refresh-handler.js +35 -54
- package/src/converters/table-layout-post-fixer.d.ts +226 -0
- package/src/converters/table-layout-post-fixer.js +276 -313
- package/src/converters/tableproperties.d.ts +54 -0
- package/src/converters/tableproperties.js +136 -168
- package/src/converters/upcasttable.d.ts +49 -0
- package/src/converters/upcasttable.js +199 -251
- package/src/index.d.ts +60 -0
- package/src/index.js +1 -2
- package/src/plaintableoutput.d.ts +25 -0
- package/src/plaintableoutput.js +107 -135
- package/src/table.d.ts +33 -0
- package/src/table.js +12 -88
- package/src/tablecaption/tablecaptionediting.d.ts +63 -0
- package/src/tablecaption/tablecaptionediting.js +104 -135
- package/src/tablecaption/tablecaptionui.d.ts +21 -0
- package/src/tablecaption/tablecaptionui.js +42 -58
- package/src/tablecaption/toggletablecaptioncommand.d.ts +68 -0
- package/src/tablecaption/toggletablecaptioncommand.js +77 -92
- package/src/tablecaption/utils.d.ts +42 -0
- package/src/tablecaption/utils.js +35 -61
- package/src/tablecaption.d.ts +22 -0
- package/src/tablecaption.js +12 -19
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +32 -0
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +14 -20
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +37 -0
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +27 -37
- package/src/tablecellproperties/commands/tablecellborderstylecommand.d.ts +37 -0
- package/src/tablecellproperties/commands/tablecellborderstylecommand.js +27 -37
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +51 -0
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +42 -53
- package/src/tablecellproperties/commands/tablecellheightcommand.d.ts +46 -0
- package/src/tablecellproperties/commands/tablecellheightcommand.js +29 -36
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +32 -0
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +14 -20
- package/src/tablecellproperties/commands/tablecellpaddingcommand.d.ts +51 -0
- package/src/tablecellproperties/commands/tablecellpaddingcommand.js +42 -53
- package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +62 -0
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +77 -122
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +40 -0
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +14 -20
- package/src/tablecellproperties/tablecellpropertiesediting.d.ts +41 -0
- package/src/tablecellproperties/tablecellpropertiesediting.js +193 -236
- package/src/tablecellproperties/tablecellpropertiesui.d.ts +111 -0
- package/src/tablecellproperties/tablecellpropertiesui.js +302 -456
- package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +227 -0
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +509 -844
- package/src/tablecellproperties.d.ts +28 -0
- package/src/tablecellproperties.js +12 -98
- package/src/tablecellwidth/commands/tablecellwidthcommand.d.ts +46 -0
- package/src/tablecellwidth/commands/tablecellwidthcommand.js +29 -35
- package/src/tablecellwidth/tablecellwidthediting.d.ts +28 -0
- package/src/tablecellwidth/tablecellwidthediting.js +25 -38
- package/src/tableclipboard.d.ts +63 -0
- package/src/tableclipboard.js +429 -568
- package/src/tablecolumnresize/constants.d.ts +20 -0
- package/src/tablecolumnresize/constants.js +0 -10
- package/src/tablecolumnresize/converters.d.ts +18 -0
- package/src/tablecolumnresize/converters.js +35 -119
- package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +137 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.js +545 -711
- package/src/tablecolumnresize/tablewidthscommand.d.ts +38 -0
- package/src/tablecolumnresize/tablewidthscommand.js +61 -0
- package/src/tablecolumnresize/utils.d.ts +141 -0
- package/src/tablecolumnresize/utils.js +256 -233
- package/src/tablecolumnresize.d.ts +24 -0
- package/src/tablecolumnresize.js +12 -19
- package/src/tableconfig.d.ts +331 -0
- package/src/tableconfig.js +5 -0
- package/src/tableediting.d.ts +97 -0
- package/src/tableediting.js +157 -176
- package/src/tablekeyboard.d.ts +63 -0
- package/src/tablekeyboard.js +261 -344
- package/src/tablemouse/mouseeventsobserver.d.ts +62 -0
- package/src/tablemouse/mouseeventsobserver.js +13 -50
- package/src/tablemouse.d.ts +46 -0
- package/src/tablemouse.js +154 -202
- package/src/tableproperties/commands/tablealignmentcommand.d.ts +32 -0
- package/src/tableproperties/commands/tablealignmentcommand.js +14 -20
- package/src/tableproperties/commands/tablebackgroundcolorcommand.d.ts +32 -0
- package/src/tableproperties/commands/tablebackgroundcolorcommand.js +14 -20
- package/src/tableproperties/commands/tablebordercolorcommand.d.ts +37 -0
- package/src/tableproperties/commands/tablebordercolorcommand.js +27 -37
- package/src/tableproperties/commands/tableborderstylecommand.d.ts +37 -0
- package/src/tableproperties/commands/tableborderstylecommand.js +27 -37
- package/src/tableproperties/commands/tableborderwidthcommand.d.ts +51 -0
- package/src/tableproperties/commands/tableborderwidthcommand.js +42 -53
- package/src/tableproperties/commands/tableheightcommand.d.ts +46 -0
- package/src/tableproperties/commands/tableheightcommand.js +29 -33
- package/src/tableproperties/commands/tablepropertycommand.d.ts +61 -0
- package/src/tableproperties/commands/tablepropertycommand.js +68 -112
- package/src/tableproperties/commands/tablewidthcommand.d.ts +46 -0
- package/src/tableproperties/commands/tablewidthcommand.js +29 -33
- package/src/tableproperties/tablepropertiesediting.d.ts +39 -0
- package/src/tableproperties/tablepropertiesediting.js +163 -210
- package/src/tableproperties/tablepropertiesui.d.ts +113 -0
- package/src/tableproperties/tablepropertiesui.js +293 -439
- package/src/tableproperties/ui/tablepropertiesview.d.ts +203 -0
- package/src/tableproperties/ui/tablepropertiesview.js +427 -718
- package/src/tableproperties.d.ts +28 -0
- package/src/tableproperties.js +12 -95
- package/src/tableselection.d.ts +106 -0
- package/src/tableselection.js +279 -376
- package/src/tabletoolbar.d.ts +31 -0
- package/src/tabletoolbar.js +38 -92
- package/src/tableui.d.ts +53 -0
- package/src/tableui.js +281 -338
- package/src/tableutils.d.ts +448 -0
- package/src/tableutils.js +1015 -1229
- package/src/tablewalker.d.ts +323 -0
- package/src/tablewalker.js +308 -548
- package/src/ui/colorinputview.d.ts +143 -0
- package/src/ui/colorinputview.js +229 -366
- package/src/ui/formrowview.d.ts +61 -0
- package/src/ui/formrowview.js +38 -84
- package/src/ui/inserttableview.d.ts +77 -0
- package/src/ui/inserttableview.js +152 -242
- package/src/utils/common.d.ts +42 -0
- package/src/utils/common.js +33 -57
- package/src/utils/structure.d.ts +245 -0
- package/src/utils/structure.js +261 -379
- package/src/utils/table-properties.d.ts +67 -0
- package/src/utils/table-properties.js +60 -81
- package/src/utils/ui/contextualballoon.d.ts +34 -0
- package/src/utils/ui/contextualballoon.js +70 -89
- package/src/utils/ui/table-properties.d.ts +193 -0
- package/src/utils/ui/table-properties.js +259 -319
- package/src/utils/ui/widget.d.ts +16 -0
- package/src/utils/ui/widget.js +24 -46
- package/src/tablecolumnresize/tablecolumnwidthscommand.js +0 -55
- package/src/tablecolumnresize/tablewidthresizecommand.js +0 -65
package/ckeditor5-metadata.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "Table",
|
|
5
5
|
"className": "Table",
|
|
6
6
|
"description": "Adds table creation and editing tools that help content authors bring tabular data into their documents.",
|
|
7
|
-
"docs": "features/
|
|
7
|
+
"docs": "features/tables/tables.html",
|
|
8
8
|
"path": "src/table.js",
|
|
9
9
|
"uiComponents": [
|
|
10
10
|
{
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"name": "Table cell properties",
|
|
67
67
|
"className": "TableCellProperties",
|
|
68
68
|
"description": "Adds the ability to style individual table cells.",
|
|
69
|
-
"docs": "features/
|
|
69
|
+
"docs": "features/tables/tables-styling.html",
|
|
70
70
|
"path": "src/tablecellproperties",
|
|
71
71
|
"requires": [
|
|
72
72
|
"Table",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"name": "Table properties",
|
|
106
106
|
"className": "TableProperties",
|
|
107
107
|
"description": "Adds the ability to style entire tables.",
|
|
108
|
-
"docs": "features/
|
|
108
|
+
"docs": "features/tables/tables-styling.html",
|
|
109
109
|
"path": "src/tableproperties",
|
|
110
110
|
"requires": [
|
|
111
111
|
"Table",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"name": "Table toolbar",
|
|
145
145
|
"className": "TableToolbar",
|
|
146
146
|
"description": "Creates configurable toolbars for both the table feature and table content. They show up when the table widget or the content inside a table cell are selected.",
|
|
147
|
-
"docs": "features/
|
|
147
|
+
"docs": "features/tables/tables.html#toolbars",
|
|
148
148
|
"path": "src/tabletoolbar.js",
|
|
149
149
|
"requires": [
|
|
150
150
|
"Table"
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"name": "Table caption",
|
|
159
159
|
"className": "TableCaption",
|
|
160
160
|
"description": "Adds support for table captions, which inform the reader about the content of the table. Using captions is also beneficial from the accessibility point of view.",
|
|
161
|
-
"docs": "features/
|
|
161
|
+
"docs": "features/tables/tables-caption.html",
|
|
162
162
|
"path": "src/tablecaption.js",
|
|
163
163
|
"requires": [
|
|
164
164
|
"Table"
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"name": "Table column resize",
|
|
175
175
|
"className": "TableColumnResize",
|
|
176
176
|
"description": "Adds support for table column resize, which allows to set the width of each column in a table using a resize handle.",
|
|
177
|
-
"docs": "features/
|
|
177
|
+
"docs": "features/tables/tables-resize.html",
|
|
178
178
|
"path": "src/tablecolumnresize.js",
|
|
179
179
|
"requires": [
|
|
180
180
|
"Table"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0-alpha.1",
|
|
4
4
|
"description": "Table feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,35 +12,36 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "^
|
|
15
|
+
"ckeditor5": "^37.0.0-alpha.1",
|
|
16
16
|
"lodash-es": "^4.17.15"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ckeditor/ckeditor5-alignment": "^
|
|
20
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
|
21
|
-
"@ckeditor/ckeditor5-block-quote": "^
|
|
22
|
-
"@ckeditor/ckeditor5-clipboard": "^
|
|
23
|
-
"@ckeditor/ckeditor5-core": "^
|
|
24
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
|
25
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
|
26
|
-
"@ckeditor/ckeditor5-engine": "^
|
|
27
|
-
"@ckeditor/ckeditor5-highlight": "^
|
|
28
|
-
"@ckeditor/ckeditor5-horizontal-line": "^
|
|
29
|
-
"@ckeditor/ckeditor5-html-support": "^
|
|
30
|
-
"@ckeditor/ckeditor5-image": "^
|
|
31
|
-
"@ckeditor/ckeditor5-indent": "^
|
|
32
|
-
"@ckeditor/ckeditor5-link": "^
|
|
33
|
-
"@ckeditor/ckeditor5-list": "^
|
|
34
|
-
"@ckeditor/ckeditor5-media-embed": "^
|
|
35
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
|
36
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
|
37
|
-
"@ckeditor/ckeditor5-typing": "^
|
|
38
|
-
"@ckeditor/ckeditor5-ui": "^
|
|
39
|
-
"@ckeditor/ckeditor5-undo": "^
|
|
40
|
-
"@ckeditor/ckeditor5-utils": "^
|
|
41
|
-
"@ckeditor/ckeditor5-widget": "^
|
|
42
|
-
"@ckeditor/ckeditor5-source-editing": "^
|
|
19
|
+
"@ckeditor/ckeditor5-alignment": "^37.0.0-alpha.1",
|
|
20
|
+
"@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.1",
|
|
21
|
+
"@ckeditor/ckeditor5-block-quote": "^37.0.0-alpha.1",
|
|
22
|
+
"@ckeditor/ckeditor5-clipboard": "^37.0.0-alpha.1",
|
|
23
|
+
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.1",
|
|
24
|
+
"@ckeditor/ckeditor5-dev-utils": "^35.0.0",
|
|
25
|
+
"@ckeditor/ckeditor5-editor-classic": "^37.0.0-alpha.1",
|
|
26
|
+
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.1",
|
|
27
|
+
"@ckeditor/ckeditor5-highlight": "^37.0.0-alpha.1",
|
|
28
|
+
"@ckeditor/ckeditor5-horizontal-line": "^37.0.0-alpha.1",
|
|
29
|
+
"@ckeditor/ckeditor5-html-support": "^37.0.0-alpha.1",
|
|
30
|
+
"@ckeditor/ckeditor5-image": "^37.0.0-alpha.1",
|
|
31
|
+
"@ckeditor/ckeditor5-indent": "^37.0.0-alpha.1",
|
|
32
|
+
"@ckeditor/ckeditor5-link": "^37.0.0-alpha.1",
|
|
33
|
+
"@ckeditor/ckeditor5-list": "^37.0.0-alpha.1",
|
|
34
|
+
"@ckeditor/ckeditor5-media-embed": "^37.0.0-alpha.1",
|
|
35
|
+
"@ckeditor/ckeditor5-paragraph": "^37.0.0-alpha.1",
|
|
36
|
+
"@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.1",
|
|
37
|
+
"@ckeditor/ckeditor5-typing": "^37.0.0-alpha.1",
|
|
38
|
+
"@ckeditor/ckeditor5-ui": "^37.0.0-alpha.1",
|
|
39
|
+
"@ckeditor/ckeditor5-undo": "^37.0.0-alpha.1",
|
|
40
|
+
"@ckeditor/ckeditor5-utils": "^37.0.0-alpha.1",
|
|
41
|
+
"@ckeditor/ckeditor5-widget": "^37.0.0-alpha.1",
|
|
42
|
+
"@ckeditor/ckeditor5-source-editing": "^37.0.0-alpha.1",
|
|
43
43
|
"json-diff": "^0.5.4",
|
|
44
|
+
"typescript": "^4.8.4",
|
|
44
45
|
"webpack": "^5.58.1",
|
|
45
46
|
"webpack-cli": "^4.9.0"
|
|
46
47
|
},
|
|
@@ -59,13 +60,17 @@
|
|
|
59
60
|
},
|
|
60
61
|
"files": [
|
|
61
62
|
"lang",
|
|
62
|
-
"src",
|
|
63
|
+
"src/**/*.js",
|
|
64
|
+
"src/**/*.d.ts",
|
|
63
65
|
"theme",
|
|
64
66
|
"build",
|
|
65
67
|
"ckeditor5-metadata.json",
|
|
66
68
|
"CHANGELOG.md"
|
|
67
69
|
],
|
|
68
70
|
"scripts": {
|
|
69
|
-
"dll:build": "webpack"
|
|
70
|
-
|
|
71
|
+
"dll:build": "webpack",
|
|
72
|
+
"build": "tsc -p ./tsconfig.json",
|
|
73
|
+
"postversion": "npm run build"
|
|
74
|
+
},
|
|
75
|
+
"types": "src/index.d.ts"
|
|
71
76
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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
|
+
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';
|
|
6
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
7
|
+
interface EditorConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The configuration of the {@link module:table/table~Table} feature.
|
|
10
|
+
*
|
|
11
|
+
* Read more in {@link module:table/tableconfig~TableConfig}.
|
|
12
|
+
*/
|
|
13
|
+
table?: TableConfig;
|
|
14
|
+
}
|
|
15
|
+
interface PluginsMap {
|
|
16
|
+
[Table.pluginName]: Table;
|
|
17
|
+
[TableCaption.pluginName]: TableCaption;
|
|
18
|
+
[TableCaptionEditing.pluginName]: TableCaptionEditing;
|
|
19
|
+
[TableCaptionUI.pluginName]: TableCaptionUI;
|
|
20
|
+
[TableCellProperties.pluginName]: TableCellProperties;
|
|
21
|
+
[TableCellPropertiesEditing.pluginName]: TableCellPropertiesEditing;
|
|
22
|
+
[TableCellPropertiesUI.pluginName]: TableCellPropertiesUI;
|
|
23
|
+
[TableCellWidthEditing.pluginName]: TableCellWidthEditing;
|
|
24
|
+
[TableClipboard.pluginName]: TableClipboard;
|
|
25
|
+
[TableColumnResize.pluginName]: TableColumnResize;
|
|
26
|
+
[TableColumnResizeEditing.pluginName]: TableColumnResizeEditing;
|
|
27
|
+
[TableEditing.pluginName]: TableEditing;
|
|
28
|
+
[TableKeyboard.pluginName]: TableKeyboard;
|
|
29
|
+
[TableMouse.pluginName]: TableMouse;
|
|
30
|
+
[TableProperties.pluginName]: TableProperties;
|
|
31
|
+
[TablePropertiesEditing.pluginName]: TablePropertiesEditing;
|
|
32
|
+
[TablePropertiesUI.pluginName]: TablePropertiesUI;
|
|
33
|
+
[TableSelection.pluginName]: TableSelection;
|
|
34
|
+
[TableToolbar.pluginName]: TableToolbar;
|
|
35
|
+
[TableUI.pluginName]: TableUI;
|
|
36
|
+
[TableUtils.pluginName]: TableUtils;
|
|
37
|
+
[PlainTableOutput.pluginName]: PlainTableOutput;
|
|
38
|
+
}
|
|
39
|
+
interface CommandsMap {
|
|
40
|
+
insertTableColumnLeft: InsertColumnCommand;
|
|
41
|
+
insertTableColumnRight: InsertColumnCommand;
|
|
42
|
+
insertTableRowAbove: InsertRowCommand;
|
|
43
|
+
insertTableRowBelow: InsertRowCommand;
|
|
44
|
+
insertTable: InsertTableCommand;
|
|
45
|
+
mergeTableCellRight: MergeCellCommand;
|
|
46
|
+
mergeTableCellLeft: MergeCellCommand;
|
|
47
|
+
mergeTableCellDown: MergeCellCommand;
|
|
48
|
+
mergeTableCellUp: MergeCellCommand;
|
|
49
|
+
mergeTableCells: MergeCellsCommand;
|
|
50
|
+
removeTableColumn: RemoveColumnCommand;
|
|
51
|
+
removeTableRow: RemoveRowCommand;
|
|
52
|
+
selectTableColumn: SelectColumnCommand;
|
|
53
|
+
selectTableRow: SelectRowCommand;
|
|
54
|
+
setTableColumnHeader: SetHeaderColumnCommand;
|
|
55
|
+
setTableRowHeader: SetHeaderRowCommand;
|
|
56
|
+
splitTableCellVertically: SplitCellCommand;
|
|
57
|
+
splitTableCellHorizontally: SplitCellCommand;
|
|
58
|
+
toggleTableCaption: ToggleTableCaptionCommand;
|
|
59
|
+
tableCellBackgroundColor: TableCellBackgroundColorCommand;
|
|
60
|
+
tableCellBorderColor: TableCellBorderColorCommand;
|
|
61
|
+
tableCellBorderStyle: TableCellBorderStyleCommand;
|
|
62
|
+
tableCellBorderWidth: TableCellBorderWidthCommand;
|
|
63
|
+
tableCellHeight: TableCellHeightCommand;
|
|
64
|
+
tableCellHorizontalAlignment: TableCellHorizontalAlignmentCommand;
|
|
65
|
+
tableCellPadding: TableCellPaddingCommand;
|
|
66
|
+
tableCellVerticalAlignment: TableCellVerticalAlignmentCommand;
|
|
67
|
+
tableCellWidth: TableCellWidthCommand;
|
|
68
|
+
tableAlignment: TableAlignmentCommand;
|
|
69
|
+
tableBackgroundColor: TableBackgroundColorCommand;
|
|
70
|
+
tableBorderColor: TableBorderColorCommand;
|
|
71
|
+
tableBorderStyle: TableBorderStyleCommand;
|
|
72
|
+
tableBorderWidth: TableBorderWidthCommand;
|
|
73
|
+
tableHeight: TableHeightCommand;
|
|
74
|
+
tableWidth: TableWidthCommand;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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/commands/insertcolumncommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The insert column command.
|
|
11
|
+
*
|
|
12
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and
|
|
13
|
+
* `'insertTableColumnRight'` editor commands.
|
|
14
|
+
*
|
|
15
|
+
* To insert a column to the left of the selected cell, execute the following command:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.execute( 'insertTableColumnLeft' );
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* To insert a column to the right of the selected cell, execute the following command:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* editor.execute( 'insertTableColumnRight' );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
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
|
+
readonly order: 'left' | 'right';
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new `InsertColumnCommand` instance.
|
|
34
|
+
*
|
|
35
|
+
* @param editor An editor on which this command will be used.
|
|
36
|
+
* @param options.order The order of insertion relative to the column in which the caret is located.
|
|
37
|
+
* Possible values: `"left"` and `"right"`. Default value is "right".
|
|
38
|
+
*/
|
|
39
|
+
constructor(editor: Editor, options?: {
|
|
40
|
+
order?: 'left' | 'right';
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
refresh(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Executes the command.
|
|
48
|
+
*
|
|
49
|
+
* Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
|
|
50
|
+
* in which the selection is set.
|
|
51
|
+
*
|
|
52
|
+
* @fires execute
|
|
53
|
+
*/
|
|
54
|
+
execute(): void;
|
|
55
|
+
}
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module table/commands/insertcolumncommand
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
import { Command } from 'ckeditor5/src/core';
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* The insert column command.
|
|
14
11
|
*
|
|
@@ -17,66 +14,54 @@ import { Command } from 'ckeditor5/src/core';
|
|
|
17
14
|
*
|
|
18
15
|
* To insert a column to the left of the selected cell, execute the following command:
|
|
19
16
|
*
|
|
20
|
-
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.execute( 'insertTableColumnLeft' );
|
|
19
|
+
* ```
|
|
21
20
|
*
|
|
22
21
|
* To insert a column to the right of the selected cell, execute the following command:
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* editor.execute( 'insertTableColumnRight' );
|
|
25
|
+
* ```
|
|
27
26
|
*/
|
|
28
27
|
export default class InsertColumnCommand extends Command {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
execute() {
|
|
69
|
-
const editor = this.editor;
|
|
70
|
-
const selection = editor.model.document.selection;
|
|
71
|
-
const tableUtils = editor.plugins.get( 'TableUtils' );
|
|
72
|
-
const insertBefore = this.order === 'left';
|
|
73
|
-
|
|
74
|
-
const affectedTableCells = tableUtils.getSelectionAffectedTableCells( selection );
|
|
75
|
-
const columnIndexes = tableUtils.getColumnIndexes( affectedTableCells );
|
|
76
|
-
|
|
77
|
-
const column = insertBefore ? columnIndexes.first : columnIndexes.last;
|
|
78
|
-
const table = affectedTableCells[ 0 ].findAncestor( 'table' );
|
|
79
|
-
|
|
80
|
-
tableUtils.insertColumns( table, { columns: 1, at: insertBefore ? column : column + 1 } );
|
|
81
|
-
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new `InsertColumnCommand` instance.
|
|
30
|
+
*
|
|
31
|
+
* @param editor An editor on which this command will be used.
|
|
32
|
+
* @param options.order The order of insertion relative to the column in which the caret is located.
|
|
33
|
+
* Possible values: `"left"` and `"right"`. Default value is "right".
|
|
34
|
+
*/
|
|
35
|
+
constructor(editor, options = {}) {
|
|
36
|
+
super(editor);
|
|
37
|
+
this.order = options.order || 'right';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
refresh() {
|
|
43
|
+
const selection = this.editor.model.document.selection;
|
|
44
|
+
const tableUtils = this.editor.plugins.get('TableUtils');
|
|
45
|
+
const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells(selection).length;
|
|
46
|
+
this.isEnabled = isAnyCellSelected;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Executes the command.
|
|
50
|
+
*
|
|
51
|
+
* Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
|
|
52
|
+
* in which the selection is set.
|
|
53
|
+
*
|
|
54
|
+
* @fires execute
|
|
55
|
+
*/
|
|
56
|
+
execute() {
|
|
57
|
+
const editor = this.editor;
|
|
58
|
+
const selection = editor.model.document.selection;
|
|
59
|
+
const tableUtils = editor.plugins.get('TableUtils');
|
|
60
|
+
const insertBefore = this.order === 'left';
|
|
61
|
+
const affectedTableCells = tableUtils.getSelectionAffectedTableCells(selection);
|
|
62
|
+
const columnIndexes = tableUtils.getColumnIndexes(affectedTableCells);
|
|
63
|
+
const column = insertBefore ? columnIndexes.first : columnIndexes.last;
|
|
64
|
+
const table = affectedTableCells[0].findAncestor('table');
|
|
65
|
+
tableUtils.insertColumns(table, { columns: 1, at: insertBefore ? column : column + 1 });
|
|
66
|
+
}
|
|
82
67
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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/commands/insertrowcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The insert row command.
|
|
11
|
+
*
|
|
12
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and
|
|
13
|
+
* `'insertTableRowAbove'` editor commands.
|
|
14
|
+
*
|
|
15
|
+
* To insert a row below the selected cell, execute the following command:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.execute( 'insertTableRowBelow' );
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* To insert a row above the selected cell, execute the following command:
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* editor.execute( 'insertTableRowAbove' );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
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
|
+
readonly order: 'above' | 'below';
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new `InsertRowCommand` instance.
|
|
34
|
+
*
|
|
35
|
+
* @param editor The editor on which this command will be used.
|
|
36
|
+
* @param options.order The order of insertion relative to the row in which the caret is located.
|
|
37
|
+
* Possible values: `"above"` and `"below"`. Default value is "below"
|
|
38
|
+
*/
|
|
39
|
+
constructor(editor: Editor, options?: {
|
|
40
|
+
order?: 'above' | 'below';
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
refresh(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Executes the command.
|
|
48
|
+
*
|
|
49
|
+
* Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
|
|
50
|
+
*
|
|
51
|
+
* @fires execute
|
|
52
|
+
*/
|
|
53
|
+
execute(): void;
|
|
54
|
+
}
|
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module table/commands/insertrowcommand
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
import { Command } from 'ckeditor5/src/core';
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* The insert row command.
|
|
14
11
|
*
|
|
@@ -17,65 +14,53 @@ import { Command } from 'ckeditor5/src/core';
|
|
|
17
14
|
*
|
|
18
15
|
* To insert a row below the selected cell, execute the following command:
|
|
19
16
|
*
|
|
20
|
-
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* editor.execute( 'insertTableRowBelow' );
|
|
19
|
+
* ```
|
|
21
20
|
*
|
|
22
21
|
* To insert a row above the selected cell, execute the following command:
|
|
23
22
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* editor.execute( 'insertTableRowAbove' );
|
|
25
|
+
* ```
|
|
27
26
|
*/
|
|
28
27
|
export default class InsertRowCommand extends Command {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
execute() {
|
|
68
|
-
const editor = this.editor;
|
|
69
|
-
const selection = editor.model.document.selection;
|
|
70
|
-
const tableUtils = editor.plugins.get( 'TableUtils' );
|
|
71
|
-
const insertAbove = this.order === 'above';
|
|
72
|
-
|
|
73
|
-
const affectedTableCells = tableUtils.getSelectionAffectedTableCells( selection );
|
|
74
|
-
const rowIndexes = tableUtils.getRowIndexes( affectedTableCells );
|
|
75
|
-
|
|
76
|
-
const row = insertAbove ? rowIndexes.first : rowIndexes.last;
|
|
77
|
-
const table = affectedTableCells[ 0 ].findAncestor( 'table' );
|
|
78
|
-
|
|
79
|
-
tableUtils.insertRows( table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove } );
|
|
80
|
-
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new `InsertRowCommand` instance.
|
|
30
|
+
*
|
|
31
|
+
* @param editor The editor on which this command will be used.
|
|
32
|
+
* @param options.order The order of insertion relative to the row in which the caret is located.
|
|
33
|
+
* Possible values: `"above"` and `"below"`. Default value is "below"
|
|
34
|
+
*/
|
|
35
|
+
constructor(editor, options = {}) {
|
|
36
|
+
super(editor);
|
|
37
|
+
this.order = options.order || 'below';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
refresh() {
|
|
43
|
+
const selection = this.editor.model.document.selection;
|
|
44
|
+
const tableUtils = this.editor.plugins.get('TableUtils');
|
|
45
|
+
const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells(selection).length;
|
|
46
|
+
this.isEnabled = isAnyCellSelected;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Executes the command.
|
|
50
|
+
*
|
|
51
|
+
* Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
|
|
52
|
+
*
|
|
53
|
+
* @fires execute
|
|
54
|
+
*/
|
|
55
|
+
execute() {
|
|
56
|
+
const editor = this.editor;
|
|
57
|
+
const selection = editor.model.document.selection;
|
|
58
|
+
const tableUtils = editor.plugins.get('TableUtils');
|
|
59
|
+
const insertAbove = this.order === 'above';
|
|
60
|
+
const affectedTableCells = tableUtils.getSelectionAffectedTableCells(selection);
|
|
61
|
+
const rowIndexes = tableUtils.getRowIndexes(affectedTableCells);
|
|
62
|
+
const row = insertAbove ? rowIndexes.first : rowIndexes.last;
|
|
63
|
+
const table = affectedTableCells[0].findAncestor('table');
|
|
64
|
+
tableUtils.insertRows(table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove });
|
|
65
|
+
}
|
|
81
66
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, 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/commands/inserttablecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The insert table command.
|
|
11
|
+
*
|
|
12
|
+
* The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.
|
|
13
|
+
*
|
|
14
|
+
* To insert a table at the current selection, execute the command and specify the dimensions:
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* editor.execute( 'insertTable', { rows: 20, columns: 5 } );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export default class InsertTableCommand extends Command {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
refresh(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Executes the command.
|
|
27
|
+
*
|
|
28
|
+
* Inserts a table with the given number of rows and columns into the editor.
|
|
29
|
+
*
|
|
30
|
+
* @param options.rows The number of rows to create in the inserted table. Default value is 2.
|
|
31
|
+
* @param options.columns The number of columns to create in the inserted table. Default value is 2.
|
|
32
|
+
* @param options.headingRows The number of heading rows. If not provided it will default to
|
|
33
|
+
* {@link module:table/tableconfig~TableConfig#defaultHeadings `config.table.defaultHeadings.rows`} table config.
|
|
34
|
+
* @param options.headingColumns The number of heading columns. If not provided it will default to
|
|
35
|
+
* {@link module:table/tableconfig~TableConfig#defaultHeadings `config.table.defaultHeadings.columns`} table config.
|
|
36
|
+
* @fires execute
|
|
37
|
+
*/
|
|
38
|
+
execute(options?: {
|
|
39
|
+
rows?: number;
|
|
40
|
+
columns?: number;
|
|
41
|
+
headingRows?: number;
|
|
42
|
+
headingColumns?: number;
|
|
43
|
+
}): void;
|
|
44
|
+
}
|