@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.
Files changed (170) hide show
  1. package/README.md +1 -1
  2. package/build/table.js +1 -1
  3. package/ckeditor5-metadata.json +6 -6
  4. package/package.json +34 -29
  5. package/src/augmentation.d.ts +76 -0
  6. package/src/augmentation.js +5 -0
  7. package/src/commands/insertcolumncommand.d.ts +55 -0
  8. package/src/commands/insertcolumncommand.js +45 -60
  9. package/src/commands/insertrowcommand.d.ts +54 -0
  10. package/src/commands/insertrowcommand.js +44 -59
  11. package/src/commands/inserttablecommand.d.ts +44 -0
  12. package/src/commands/inserttablecommand.js +50 -68
  13. package/src/commands/mergecellcommand.d.ts +68 -0
  14. package/src/commands/mergecellcommand.js +169 -244
  15. package/src/commands/mergecellscommand.d.ts +28 -0
  16. package/src/commands/mergecellscommand.js +72 -101
  17. package/src/commands/removecolumncommand.d.ts +29 -0
  18. package/src/commands/removecolumncommand.js +88 -102
  19. package/src/commands/removerowcommand.d.ts +29 -0
  20. package/src/commands/removerowcommand.js +63 -80
  21. package/src/commands/selectcolumncommand.d.ts +33 -0
  22. package/src/commands/selectcolumncommand.js +41 -54
  23. package/src/commands/selectrowcommand.d.ts +33 -0
  24. package/src/commands/selectrowcommand.js +38 -48
  25. package/src/commands/setheadercolumncommand.d.ts +50 -0
  26. package/src/commands/setheadercolumncommand.js +48 -73
  27. package/src/commands/setheaderrowcommand.d.ts +53 -0
  28. package/src/commands/setheaderrowcommand.js +56 -85
  29. package/src/commands/splitcellcommand.d.ts +43 -0
  30. package/src/commands/splitcellcommand.js +35 -49
  31. package/src/converters/downcast.d.ts +63 -0
  32. package/src/converters/downcast.js +98 -130
  33. package/src/converters/table-caption-post-fixer.d.ts +20 -0
  34. package/src/converters/table-caption-post-fixer.js +36 -52
  35. package/src/converters/table-cell-paragraph-post-fixer.d.ts +32 -0
  36. package/src/converters/table-cell-paragraph-post-fixer.js +88 -119
  37. package/src/converters/table-cell-refresh-handler.d.ts +18 -0
  38. package/src/converters/table-cell-refresh-handler.js +29 -48
  39. package/src/converters/table-headings-refresh-handler.d.ts +17 -0
  40. package/src/converters/table-headings-refresh-handler.js +35 -54
  41. package/src/converters/table-layout-post-fixer.d.ts +226 -0
  42. package/src/converters/table-layout-post-fixer.js +276 -313
  43. package/src/converters/tableproperties.d.ts +54 -0
  44. package/src/converters/tableproperties.js +136 -168
  45. package/src/converters/upcasttable.d.ts +49 -0
  46. package/src/converters/upcasttable.js +199 -251
  47. package/src/index.d.ts +60 -0
  48. package/src/index.js +1 -2
  49. package/src/plaintableoutput.d.ts +25 -0
  50. package/src/plaintableoutput.js +107 -135
  51. package/src/table.d.ts +33 -0
  52. package/src/table.js +12 -88
  53. package/src/tablecaption/tablecaptionediting.d.ts +63 -0
  54. package/src/tablecaption/tablecaptionediting.js +104 -135
  55. package/src/tablecaption/tablecaptionui.d.ts +21 -0
  56. package/src/tablecaption/tablecaptionui.js +42 -58
  57. package/src/tablecaption/toggletablecaptioncommand.d.ts +68 -0
  58. package/src/tablecaption/toggletablecaptioncommand.js +77 -92
  59. package/src/tablecaption/utils.d.ts +42 -0
  60. package/src/tablecaption/utils.js +35 -61
  61. package/src/tablecaption.d.ts +22 -0
  62. package/src/tablecaption.js +12 -19
  63. package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +32 -0
  64. package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +14 -20
  65. package/src/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +37 -0
  66. package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +27 -37
  67. package/src/tablecellproperties/commands/tablecellborderstylecommand.d.ts +37 -0
  68. package/src/tablecellproperties/commands/tablecellborderstylecommand.js +27 -37
  69. package/src/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +51 -0
  70. package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +42 -53
  71. package/src/tablecellproperties/commands/tablecellheightcommand.d.ts +46 -0
  72. package/src/tablecellproperties/commands/tablecellheightcommand.js +29 -36
  73. package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +32 -0
  74. package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +14 -20
  75. package/src/tablecellproperties/commands/tablecellpaddingcommand.d.ts +51 -0
  76. package/src/tablecellproperties/commands/tablecellpaddingcommand.js +42 -53
  77. package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +62 -0
  78. package/src/tablecellproperties/commands/tablecellpropertycommand.js +77 -122
  79. package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +40 -0
  80. package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +14 -20
  81. package/src/tablecellproperties/tablecellpropertiesediting.d.ts +41 -0
  82. package/src/tablecellproperties/tablecellpropertiesediting.js +193 -236
  83. package/src/tablecellproperties/tablecellpropertiesui.d.ts +111 -0
  84. package/src/tablecellproperties/tablecellpropertiesui.js +302 -456
  85. package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +227 -0
  86. package/src/tablecellproperties/ui/tablecellpropertiesview.js +509 -844
  87. package/src/tablecellproperties.d.ts +28 -0
  88. package/src/tablecellproperties.js +12 -98
  89. package/src/tablecellwidth/commands/tablecellwidthcommand.d.ts +46 -0
  90. package/src/tablecellwidth/commands/tablecellwidthcommand.js +29 -35
  91. package/src/tablecellwidth/tablecellwidthediting.d.ts +28 -0
  92. package/src/tablecellwidth/tablecellwidthediting.js +25 -38
  93. package/src/tableclipboard.d.ts +63 -0
  94. package/src/tableclipboard.js +429 -568
  95. package/src/tablecolumnresize/constants.d.ts +20 -0
  96. package/src/tablecolumnresize/constants.js +0 -10
  97. package/src/tablecolumnresize/converters.d.ts +18 -0
  98. package/src/tablecolumnresize/converters.js +35 -119
  99. package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +137 -0
  100. package/src/tablecolumnresize/tablecolumnresizeediting.js +545 -711
  101. package/src/tablecolumnresize/tablewidthscommand.d.ts +38 -0
  102. package/src/tablecolumnresize/tablewidthscommand.js +61 -0
  103. package/src/tablecolumnresize/utils.d.ts +141 -0
  104. package/src/tablecolumnresize/utils.js +256 -233
  105. package/src/tablecolumnresize.d.ts +24 -0
  106. package/src/tablecolumnresize.js +12 -19
  107. package/src/tableconfig.d.ts +331 -0
  108. package/src/tableconfig.js +5 -0
  109. package/src/tableediting.d.ts +97 -0
  110. package/src/tableediting.js +157 -176
  111. package/src/tablekeyboard.d.ts +63 -0
  112. package/src/tablekeyboard.js +261 -344
  113. package/src/tablemouse/mouseeventsobserver.d.ts +62 -0
  114. package/src/tablemouse/mouseeventsobserver.js +13 -50
  115. package/src/tablemouse.d.ts +46 -0
  116. package/src/tablemouse.js +154 -202
  117. package/src/tableproperties/commands/tablealignmentcommand.d.ts +32 -0
  118. package/src/tableproperties/commands/tablealignmentcommand.js +14 -20
  119. package/src/tableproperties/commands/tablebackgroundcolorcommand.d.ts +32 -0
  120. package/src/tableproperties/commands/tablebackgroundcolorcommand.js +14 -20
  121. package/src/tableproperties/commands/tablebordercolorcommand.d.ts +37 -0
  122. package/src/tableproperties/commands/tablebordercolorcommand.js +27 -37
  123. package/src/tableproperties/commands/tableborderstylecommand.d.ts +37 -0
  124. package/src/tableproperties/commands/tableborderstylecommand.js +27 -37
  125. package/src/tableproperties/commands/tableborderwidthcommand.d.ts +51 -0
  126. package/src/tableproperties/commands/tableborderwidthcommand.js +42 -53
  127. package/src/tableproperties/commands/tableheightcommand.d.ts +46 -0
  128. package/src/tableproperties/commands/tableheightcommand.js +29 -33
  129. package/src/tableproperties/commands/tablepropertycommand.d.ts +61 -0
  130. package/src/tableproperties/commands/tablepropertycommand.js +68 -112
  131. package/src/tableproperties/commands/tablewidthcommand.d.ts +46 -0
  132. package/src/tableproperties/commands/tablewidthcommand.js +29 -33
  133. package/src/tableproperties/tablepropertiesediting.d.ts +39 -0
  134. package/src/tableproperties/tablepropertiesediting.js +163 -210
  135. package/src/tableproperties/tablepropertiesui.d.ts +113 -0
  136. package/src/tableproperties/tablepropertiesui.js +293 -439
  137. package/src/tableproperties/ui/tablepropertiesview.d.ts +203 -0
  138. package/src/tableproperties/ui/tablepropertiesview.js +427 -718
  139. package/src/tableproperties.d.ts +28 -0
  140. package/src/tableproperties.js +12 -95
  141. package/src/tableselection.d.ts +106 -0
  142. package/src/tableselection.js +279 -376
  143. package/src/tabletoolbar.d.ts +31 -0
  144. package/src/tabletoolbar.js +38 -92
  145. package/src/tableui.d.ts +53 -0
  146. package/src/tableui.js +281 -338
  147. package/src/tableutils.d.ts +448 -0
  148. package/src/tableutils.js +1015 -1229
  149. package/src/tablewalker.d.ts +323 -0
  150. package/src/tablewalker.js +308 -548
  151. package/src/ui/colorinputview.d.ts +143 -0
  152. package/src/ui/colorinputview.js +229 -366
  153. package/src/ui/formrowview.d.ts +61 -0
  154. package/src/ui/formrowview.js +38 -84
  155. package/src/ui/inserttableview.d.ts +77 -0
  156. package/src/ui/inserttableview.js +152 -242
  157. package/src/utils/common.d.ts +42 -0
  158. package/src/utils/common.js +33 -57
  159. package/src/utils/structure.d.ts +245 -0
  160. package/src/utils/structure.js +261 -379
  161. package/src/utils/table-properties.d.ts +67 -0
  162. package/src/utils/table-properties.js +60 -81
  163. package/src/utils/ui/contextualballoon.d.ts +34 -0
  164. package/src/utils/ui/contextualballoon.js +70 -89
  165. package/src/utils/ui/table-properties.d.ts +193 -0
  166. package/src/utils/ui/table-properties.js +259 -319
  167. package/src/utils/ui/widget.d.ts +16 -0
  168. package/src/utils/ui/widget.js +24 -46
  169. package/src/tablecolumnresize/tablecolumnwidthscommand.js +0 -55
  170. package/src/tablecolumnresize/tablewidthresizecommand.js +0 -65
@@ -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/table.html",
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/table.html#table-and-cell-styling-tools",
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/table.html#table-and-cell-styling-tools",
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/table.html#toolbars",
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/table.html#table-caption",
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/table.html#table-column-resize",
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": "36.0.1",
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": "^36.0.1",
15
+ "ckeditor5": "^37.0.0-alpha.1",
16
16
  "lodash-es": "^4.17.15"
17
17
  },
18
18
  "devDependencies": {
19
- "@ckeditor/ckeditor5-alignment": "^36.0.1",
20
- "@ckeditor/ckeditor5-basic-styles": "^36.0.1",
21
- "@ckeditor/ckeditor5-block-quote": "^36.0.1",
22
- "@ckeditor/ckeditor5-clipboard": "^36.0.1",
23
- "@ckeditor/ckeditor5-core": "^36.0.1",
24
- "@ckeditor/ckeditor5-dev-utils": "^32.0.0",
25
- "@ckeditor/ckeditor5-editor-classic": "^36.0.1",
26
- "@ckeditor/ckeditor5-engine": "^36.0.1",
27
- "@ckeditor/ckeditor5-highlight": "^36.0.1",
28
- "@ckeditor/ckeditor5-horizontal-line": "^36.0.1",
29
- "@ckeditor/ckeditor5-html-support": "^36.0.1",
30
- "@ckeditor/ckeditor5-image": "^36.0.1",
31
- "@ckeditor/ckeditor5-indent": "^36.0.1",
32
- "@ckeditor/ckeditor5-link": "^36.0.1",
33
- "@ckeditor/ckeditor5-list": "^36.0.1",
34
- "@ckeditor/ckeditor5-media-embed": "^36.0.1",
35
- "@ckeditor/ckeditor5-paragraph": "^36.0.1",
36
- "@ckeditor/ckeditor5-theme-lark": "^36.0.1",
37
- "@ckeditor/ckeditor5-typing": "^36.0.1",
38
- "@ckeditor/ckeditor5-ui": "^36.0.1",
39
- "@ckeditor/ckeditor5-undo": "^36.0.1",
40
- "@ckeditor/ckeditor5-utils": "^36.0.1",
41
- "@ckeditor/ckeditor5-widget": "^36.0.1",
42
- "@ckeditor/ckeditor5-source-editing": "^36.0.1",
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,5 @@
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
+ export {};
@@ -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
- * editor.execute( 'insertTableColumnLeft' );
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
- * editor.execute( 'insertTableColumnRight' );
25
- *
26
- * @extends module:core/command~Command
23
+ * ```ts
24
+ * editor.execute( 'insertTableColumnRight' );
25
+ * ```
27
26
  */
28
27
  export default class InsertColumnCommand extends Command {
29
- /**
30
- * Creates a new `InsertColumnCommand` instance.
31
- *
32
- * @param {module:core/editor/editor~Editor} editor An editor on which this command will be used.
33
- * @param {Object} options
34
- * @param {String} [options.order="right"] The order of insertion relative to the column in which the caret is located.
35
- * Possible values: `"left"` and `"right"`.
36
- */
37
- constructor( editor, options = {} ) {
38
- super( editor );
39
-
40
- /**
41
- * The order of insertion relative to the column in which the caret is located.
42
- *
43
- * @readonly
44
- * @member {String} module:table/commands/insertcolumncommand~InsertColumnCommand#order
45
- */
46
- this.order = options.order || 'right';
47
- }
48
-
49
- /**
50
- * @inheritDoc
51
- */
52
- refresh() {
53
- const selection = this.editor.model.document.selection;
54
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
55
- const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells( selection ).length;
56
-
57
- this.isEnabled = isAnyCellSelected;
58
- }
59
-
60
- /**
61
- * Executes the command.
62
- *
63
- * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column
64
- * in which the selection is set.
65
- *
66
- * @fires execute
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
- * editor.execute( 'insertTableRowBelow' );
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
- * editor.execute( 'insertTableRowAbove' );
25
- *
26
- * @extends module:core/command~Command
23
+ * ```ts
24
+ * editor.execute( 'insertTableRowAbove' );
25
+ * ```
27
26
  */
28
27
  export default class InsertRowCommand extends Command {
29
- /**
30
- * Creates a new `InsertRowCommand` instance.
31
- *
32
- * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.
33
- * @param {Object} options
34
- * @param {String} [options.order="below"] The order of insertion relative to the row in which the caret is located.
35
- * Possible values: `"above"` and `"below"`.
36
- */
37
- constructor( editor, options = {} ) {
38
- super( editor );
39
-
40
- /**
41
- * The order of insertion relative to the row in which the caret is located.
42
- *
43
- * @readonly
44
- * @member {String} module:table/commands/insertrowcommand~InsertRowCommand#order
45
- */
46
- this.order = options.order || 'below';
47
- }
48
-
49
- /**
50
- * @inheritDoc
51
- */
52
- refresh() {
53
- const selection = this.editor.model.document.selection;
54
- const tableUtils = this.editor.plugins.get( 'TableUtils' );
55
- const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells( selection ).length;
56
-
57
- this.isEnabled = isAnyCellSelected;
58
- }
59
-
60
- /**
61
- * Executes the command.
62
- *
63
- * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.
64
- *
65
- * @fires execute
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
+ }