@ckeditor/ckeditor5-table 41.2.0 → 41.3.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.
Files changed (89) hide show
  1. package/dist/content-index.css +55 -0
  2. package/dist/editor-index.css +150 -0
  3. package/dist/index.css +362 -0
  4. package/dist/index.css.map +1 -0
  5. package/dist/index.js +11660 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/types/augmentation.d.ts +76 -0
  8. package/dist/types/commands/insertcolumncommand.d.ts +55 -0
  9. package/dist/types/commands/insertrowcommand.d.ts +54 -0
  10. package/dist/types/commands/inserttablecommand.d.ts +44 -0
  11. package/dist/types/commands/mergecellcommand.d.ts +68 -0
  12. package/dist/types/commands/mergecellscommand.d.ts +28 -0
  13. package/dist/types/commands/removecolumncommand.d.ts +29 -0
  14. package/dist/types/commands/removerowcommand.d.ts +29 -0
  15. package/dist/types/commands/selectcolumncommand.d.ts +33 -0
  16. package/dist/types/commands/selectrowcommand.d.ts +33 -0
  17. package/dist/types/commands/setheadercolumncommand.d.ts +50 -0
  18. package/dist/types/commands/setheaderrowcommand.d.ts +53 -0
  19. package/dist/types/commands/splitcellcommand.d.ts +43 -0
  20. package/dist/types/converters/downcast.d.ts +63 -0
  21. package/dist/types/converters/table-caption-post-fixer.d.ts +20 -0
  22. package/dist/types/converters/table-cell-paragraph-post-fixer.d.ts +32 -0
  23. package/dist/types/converters/table-cell-refresh-handler.d.ts +18 -0
  24. package/dist/types/converters/table-headings-refresh-handler.d.ts +17 -0
  25. package/dist/types/converters/table-layout-post-fixer.d.ts +226 -0
  26. package/dist/types/converters/tableproperties.d.ts +54 -0
  27. package/dist/types/converters/upcasttable.d.ts +49 -0
  28. package/dist/types/index.d.ts +60 -0
  29. package/dist/types/plaintableoutput.d.ts +26 -0
  30. package/dist/types/table.d.ts +40 -0
  31. package/dist/types/tablecaption/tablecaptionediting.d.ts +63 -0
  32. package/dist/types/tablecaption/tablecaptionui.d.ts +21 -0
  33. package/dist/types/tablecaption/toggletablecaptioncommand.d.ts +68 -0
  34. package/dist/types/tablecaption/utils.d.ts +38 -0
  35. package/dist/types/tablecaption.d.ts +24 -0
  36. package/dist/types/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +32 -0
  37. package/dist/types/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +37 -0
  38. package/dist/types/tablecellproperties/commands/tablecellborderstylecommand.d.ts +37 -0
  39. package/dist/types/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +51 -0
  40. package/dist/types/tablecellproperties/commands/tablecellheightcommand.d.ts +46 -0
  41. package/dist/types/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +32 -0
  42. package/dist/types/tablecellproperties/commands/tablecellpaddingcommand.d.ts +51 -0
  43. package/dist/types/tablecellproperties/commands/tablecellpropertycommand.d.ts +62 -0
  44. package/dist/types/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +40 -0
  45. package/dist/types/tablecellproperties/tablecellpropertiesediting.d.ts +43 -0
  46. package/dist/types/tablecellproperties/tablecellpropertiesui.d.ts +112 -0
  47. package/dist/types/tablecellproperties/ui/tablecellpropertiesview.d.ts +228 -0
  48. package/dist/types/tablecellproperties.d.ts +30 -0
  49. package/dist/types/tablecellwidth/commands/tablecellwidthcommand.d.ts +46 -0
  50. package/dist/types/tablecellwidth/tablecellwidthediting.d.ts +29 -0
  51. package/dist/types/tableclipboard.d.ts +70 -0
  52. package/dist/types/tablecolumnresize/constants.d.ts +20 -0
  53. package/dist/types/tablecolumnresize/converters.d.ts +18 -0
  54. package/dist/types/tablecolumnresize/tablecolumnresizeediting.d.ts +139 -0
  55. package/dist/types/tablecolumnresize/tablewidthscommand.d.ts +38 -0
  56. package/dist/types/tablecolumnresize/utils.d.ts +148 -0
  57. package/dist/types/tablecolumnresize.d.ts +26 -0
  58. package/dist/types/tableconfig.d.ts +343 -0
  59. package/dist/types/tableediting.d.ts +98 -0
  60. package/dist/types/tablekeyboard.d.ts +68 -0
  61. package/dist/types/tablemouse/mouseeventsobserver.d.ts +62 -0
  62. package/dist/types/tablemouse.d.ts +48 -0
  63. package/dist/types/tableproperties/commands/tablealignmentcommand.d.ts +32 -0
  64. package/dist/types/tableproperties/commands/tablebackgroundcolorcommand.d.ts +32 -0
  65. package/dist/types/tableproperties/commands/tablebordercolorcommand.d.ts +37 -0
  66. package/dist/types/tableproperties/commands/tableborderstylecommand.d.ts +37 -0
  67. package/dist/types/tableproperties/commands/tableborderwidthcommand.d.ts +51 -0
  68. package/dist/types/tableproperties/commands/tableheightcommand.d.ts +46 -0
  69. package/dist/types/tableproperties/commands/tablepropertycommand.d.ts +61 -0
  70. package/dist/types/tableproperties/commands/tablewidthcommand.d.ts +46 -0
  71. package/dist/types/tableproperties/tablepropertiesediting.d.ts +40 -0
  72. package/dist/types/tableproperties/tablepropertiesui.d.ts +114 -0
  73. package/dist/types/tableproperties/ui/tablepropertiesview.d.ts +207 -0
  74. package/dist/types/tableproperties.d.ts +30 -0
  75. package/dist/types/tableselection.d.ts +107 -0
  76. package/dist/types/tabletoolbar.d.ts +32 -0
  77. package/dist/types/tableui.d.ts +53 -0
  78. package/dist/types/tableutils.d.ts +448 -0
  79. package/dist/types/tablewalker.d.ts +362 -0
  80. package/dist/types/ui/colorinputview.d.ts +140 -0
  81. package/dist/types/ui/formrowview.d.ts +61 -0
  82. package/dist/types/ui/inserttableview.d.ts +77 -0
  83. package/dist/types/utils/common.d.ts +46 -0
  84. package/dist/types/utils/structure.d.ts +245 -0
  85. package/dist/types/utils/table-properties.d.ts +67 -0
  86. package/dist/types/utils/ui/contextualballoon.d.ts +34 -0
  87. package/dist/types/utils/ui/table-properties.d.ts +195 -0
  88. package/dist/types/utils/ui/widget.d.ts +20 -0
  89. package/package.json +3 -2
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ 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';
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-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/insertcolumncommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
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
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/insertrowcommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
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
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/inserttablecommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
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
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/mergecellcommand
7
+ */
8
+ import type { Node } from 'ckeditor5/src/engine.js';
9
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
10
+ import type { ArrowKeyCodeDirection } from 'ckeditor5/src/utils.js';
11
+ /**
12
+ * The merge cell command.
13
+ *
14
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,
15
+ * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.
16
+ *
17
+ * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.
18
+ *
19
+ * For example, to merge with a cell to the right:
20
+ *
21
+ * ```ts
22
+ * editor.execute( 'mergeTableCellRight' );
23
+ * ```
24
+ *
25
+ * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)
26
+ * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)
27
+ * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.
28
+ */
29
+ export default class MergeCellCommand extends Command {
30
+ /**
31
+ * The direction that indicates which cell will be merged with the currently selected one.
32
+ */
33
+ readonly direction: ArrowKeyCodeDirection;
34
+ /**
35
+ * Whether the merge is horizontal (left/right) or vertical (up/down).
36
+ */
37
+ readonly isHorizontal: boolean;
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ value: Node | undefined;
42
+ /**
43
+ * Creates a new `MergeCellCommand` instance.
44
+ *
45
+ * @param editor The editor on which this command will be used.
46
+ * @param options.direction Indicates which cell to merge with the currently selected one.
47
+ * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.
48
+ */
49
+ constructor(editor: Editor, options: {
50
+ direction: ArrowKeyCodeDirection;
51
+ });
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ refresh(): void;
56
+ /**
57
+ * Executes the command.
58
+ *
59
+ * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.
60
+ *
61
+ * @fires execute
62
+ */
63
+ execute(): void;
64
+ /**
65
+ * Returns a cell that can be merged with the current cell depending on the command's direction.
66
+ */
67
+ private _getMergeableCell;
68
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import { Command } from 'ckeditor5/src/core.js';
6
+ /**
7
+ * The merge cells command.
8
+ *
9
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.
10
+ *
11
+ * For example, to merge selected table cells:
12
+ *
13
+ * ```ts
14
+ * editor.execute( 'mergeTableCells' );
15
+ * ```
16
+ */
17
+ export default class MergeCellsCommand extends Command {
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ refresh(): void;
22
+ /**
23
+ * Executes the command.
24
+ *
25
+ * @fires execute
26
+ */
27
+ execute(): void;
28
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/removecolumncommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The remove column command.
11
+ *
12
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.
13
+ *
14
+ * To remove the column containing the selected cell, execute the command:
15
+ *
16
+ * ```ts
17
+ * editor.execute( 'removeTableColumn' );
18
+ * ```
19
+ */
20
+ export default class RemoveColumnCommand extends Command {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ refresh(): void;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ execute(): void;
29
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/removerowcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The remove row command.
11
+ *
12
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.
13
+ *
14
+ * To remove the row containing the selected cell, execute the command:
15
+ *
16
+ * ```ts
17
+ * editor.execute( 'removeTableRow' );
18
+ * ```
19
+ */
20
+ export default class RemoveRowCommand extends Command {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ refresh(): void;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ execute(): void;
29
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/selectcolumncommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The select column command.
11
+ *
12
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.
13
+ *
14
+ * To select the columns containing the selected cells, execute the command:
15
+ *
16
+ * ```ts
17
+ * editor.execute( 'selectTableColumn' );
18
+ * ```
19
+ */
20
+ export default class SelectColumnCommand extends Command {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ constructor(editor: Editor);
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ refresh(): void;
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ execute(): void;
33
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/selectrowcommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The select row command.
11
+ *
12
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.
13
+ *
14
+ * To select the rows containing the selected cells, execute the command:
15
+ *
16
+ * ```ts
17
+ * editor.execute( 'selectTableRow' );
18
+ * ```
19
+ */
20
+ export default class SelectRowCommand extends Command {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ constructor(editor: Editor);
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ refresh(): void;
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ execute(): void;
33
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/setheadercolumncommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The header column command.
11
+ *
12
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
13
+ *
14
+ * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)
15
+ * by executing:
16
+ *
17
+ * ```ts
18
+ * editor.execute( 'setTableColumnHeader' );
19
+ * ```
20
+ *
21
+ * **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command
22
+ * will make it a regular column back again (including the following columns).
23
+ */
24
+ export default class SetHeaderColumnCommand extends Command {
25
+ /**
26
+ * Flag indicating whether the command is active. The command is active when the
27
+ * {@link module:engine/model/selection~Selection} is in a header column.
28
+ *
29
+ * @observable
30
+ */
31
+ value: boolean;
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ refresh(): void;
36
+ /**
37
+ * Executes the command.
38
+ *
39
+ * When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.
40
+ *
41
+ * When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.
42
+ *
43
+ * @fires execute
44
+ * @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header columns according to
45
+ * the `forceValue` parameter instead of the current model state.
46
+ */
47
+ execute(options?: {
48
+ forceValue?: boolean;
49
+ }): void;
50
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/setheaderrowcommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The header row command.
11
+ *
12
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.
13
+ *
14
+ * You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:
15
+ *
16
+ * ```ts
17
+ * editor.execute( 'setTableRowHeader' );
18
+ * ```
19
+ *
20
+ * **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command
21
+ * will make it a regular row back again (including the following rows).
22
+ */
23
+ export default class SetHeaderRowCommand extends Command {
24
+ /**
25
+ * Flag indicating whether the command is active. The command is active when the
26
+ * {@link module:engine/model/selection~Selection} is in a header row.
27
+ *
28
+ * @observable
29
+ */
30
+ value: boolean;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ refresh(): void;
35
+ /**
36
+ * Executes the command.
37
+ *
38
+ * When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.
39
+ *
40
+ * When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.
41
+ *
42
+ * @fires execute
43
+ * @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header rows according to
44
+ * the `forceValue` parameter instead of the current model state.
45
+ */
46
+ execute(options?: {
47
+ forceValue?: boolean;
48
+ }): void;
49
+ /**
50
+ * Checks if a table cell is in the heading section.
51
+ */
52
+ private _isInHeading;
53
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/commands/splitcellcommand
7
+ */
8
+ import { Command, type Editor } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The split cell command.
11
+ *
12
+ * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`
13
+ * and `'splitTableCellHorizontally'` editor commands.
14
+ *
15
+ * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:
16
+ *
17
+ * ```ts
18
+ * editor.execute( 'splitTableCellVertically' );
19
+ * ```
20
+ */
21
+ export default class SplitCellCommand extends Command {
22
+ /**
23
+ * The direction that indicates which cell will be split.
24
+ */
25
+ readonly direction: 'horizontally' | 'vertically';
26
+ /**
27
+ * Creates a new `SplitCellCommand` instance.
28
+ *
29
+ * @param editor The editor on which this command will be used.
30
+ * @param options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.
31
+ */
32
+ constructor(editor: Editor, options?: {
33
+ direction?: 'horizontally' | 'vertically';
34
+ });
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ refresh(): void;
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ execute(): void;
43
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { Element, ElementCreatorFunction } from 'ckeditor5/src/engine.js';
6
+ import type TableUtils from '../tableutils.js';
7
+ import type { AdditionalSlot } from '../tableediting.js';
8
+ /**
9
+ * Model table element to view table element conversion helper.
10
+ */
11
+ export declare function downcastTable(tableUtils: TableUtils, options: DowncastTableOptions): ElementCreatorFunction;
12
+ /**
13
+ * Model table row element to view `<tr>` element conversion helper.
14
+ *
15
+ * @returns Element creator.
16
+ */
17
+ export declare function downcastRow(): ElementCreatorFunction;
18
+ /**
19
+ * Model table cell element to view `<td>` or `<th>` element conversion helper.
20
+ *
21
+ * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
22
+ * and `<td>` otherwise.
23
+ *
24
+ * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
25
+ * @returns Element creator.
26
+ */
27
+ export declare function downcastCell(options?: {
28
+ asWidget?: boolean;
29
+ }): ElementCreatorFunction;
30
+ /**
31
+ * Overrides paragraph inside table cell conversion.
32
+ *
33
+ * This converter:
34
+ * * should be used to override default paragraph conversion.
35
+ * * It will only convert `<paragraph>` placed directly inside `<tableCell>`.
36
+ * * For a single paragraph without attributes it returns `<span>` to simulate data table.
37
+ * * For all other cases it returns `<p>` element.
38
+ *
39
+ * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
40
+ * @returns Element creator.
41
+ */
42
+ export declare function convertParagraphInTableCell(options?: {
43
+ asWidget?: boolean;
44
+ }): ElementCreatorFunction;
45
+ /**
46
+ * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.
47
+ *
48
+ * The paragraph should be converted in the editing view to:
49
+ *
50
+ * * If returned `true` - to a `<span class="ck-table-bogus-paragraph">`
51
+ * * If returned `false` - to a `<p>`
52
+ */
53
+ export declare function isSingleParagraphWithoutAttributes(modelElement: Element): boolean;
54
+ export interface DowncastTableOptions {
55
+ /**
56
+ * If set to `true`, the downcast conversion will produce a widget.
57
+ */
58
+ asWidget?: boolean;
59
+ /**
60
+ * Array of additional slot handlers.
61
+ */
62
+ additionalSlots: Array<AdditionalSlot>;
63
+ }