@ckeditor/ckeditor5-table 41.2.0 → 41.3.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 (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,20 @@
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/converters/table-caption-post-fixer
7
+ */
8
+ import type { Model } from 'ckeditor5/src/engine.js';
9
+ /**
10
+ * Injects a table caption post-fixer into the model.
11
+ *
12
+ * The role of the table caption post-fixer is to ensure that the table with caption have the correct structure
13
+ * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
14
+ *
15
+ * The correct structure means that:
16
+ *
17
+ * * If there are many caption model element, they are merged into one model.
18
+ * * A final, merged caption model is placed at the end of the table.
19
+ */
20
+ export default function injectTableCaptionPostFixer(model: Model): void;
@@ -0,0 +1,32 @@
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/converters/table-cell-paragraph-post-fixer
7
+ */
8
+ import type { Model } from 'ckeditor5/src/engine.js';
9
+ /**
10
+ * Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.
11
+ *
12
+ * A table cell must contain at least one block element as a child. An empty table cell will have an empty `paragraph` as a child.
13
+ *
14
+ * ```xml
15
+ * <table>
16
+ * <tableRow>
17
+ * <tableCell></tableCell>
18
+ * </tableRow>
19
+ * </table>
20
+ * ```
21
+ *
22
+ * Will be fixed to:
23
+ *
24
+ * ```xml
25
+ * <table>
26
+ * <tableRow>
27
+ * <tableCell><paragraph></paragraph></tableCell>
28
+ * </tableRow>
29
+ * </table>
30
+ * ```
31
+ */
32
+ export default function injectTableCellParagraphPostFixer(model: Model): void;
@@ -0,0 +1,18 @@
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/converters/table-cell-refresh-handler
7
+ */
8
+ import type { EditingController, Model } from 'ckeditor5/src/engine.js';
9
+ /**
10
+ * A table cell refresh handler which marks the table cell in the differ to have it re-rendered.
11
+ *
12
+ * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block
13
+ * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.
14
+ *
15
+ * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
16
+ * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
17
+ */
18
+ export default function tableCellRefreshHandler(model: Model, editing: EditingController): void;
@@ -0,0 +1,17 @@
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/converters/table-headings-refresh-handler
7
+ */
8
+ import type { EditingController, Model } from 'ckeditor5/src/engine.js';
9
+ /**
10
+ * A table headings refresh handler which marks the table cells or rows in the differ to have it re-rendered
11
+ * if the headings attribute changed.
12
+ *
13
+ * Table heading rows and heading columns are represented in the model by a `headingRows` and `headingColumns` attributes.
14
+ *
15
+ * When table headings attribute changes, all the cells/rows are marked to re-render to change between `<td>` and `<th>`.
16
+ */
17
+ export default function tableHeadingsRefreshHandler(model: Model, editing: EditingController): void;
@@ -0,0 +1,226 @@
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/converters/table-layout-post-fixer
7
+ */
8
+ import type { Model } from 'ckeditor5/src/engine.js';
9
+ /**
10
+ * Injects a table layout post-fixer into the model.
11
+ *
12
+ * The role of the table layout post-fixer is to ensure that the table rows have the correct structure
13
+ * after a {@link module:engine/model/model~Model#change `change()`} block was executed.
14
+ *
15
+ * The correct structure means that:
16
+ *
17
+ * * All table rows have the same size.
18
+ * * None of the table cells extend vertically beyond their section (either header or body).
19
+ * * A table cell has always at least one element as a child.
20
+ *
21
+ * If the table structure is not correct, the post-fixer will automatically correct it in two steps:
22
+ *
23
+ * 1. It will clip table cells that extend beyond their section.
24
+ * 2. It will add empty table cells to the rows that are narrower than the widest table row.
25
+ *
26
+ * ## Clipping overlapping table cells
27
+ *
28
+ * Such situation may occur when pasting a table (or a part of a table) to the editor from external sources.
29
+ *
30
+ * For example, see the following table which has a cell (FOO) with the rowspan attribute (2):
31
+ *
32
+ * ```xml
33
+ * <table headingRows="1">
34
+ * <tableRow>
35
+ * <tableCell rowspan="2"><paragraph>FOO</paragraph></tableCell>
36
+ * <tableCell colspan="2"><paragraph>BAR</paragraph></tableCell>
37
+ * </tableRow>
38
+ * <tableRow>
39
+ * <tableCell><paragraph>BAZ</paragraph></tableCell>
40
+ * <tableCell><paragraph>XYZ</paragraph></tableCell>
41
+ * </tableRow>
42
+ * </table>
43
+ * ```
44
+ *
45
+ * It will be rendered in the view as:
46
+ *
47
+ * ```xml
48
+ * <table>
49
+ * <thead>
50
+ * <tr>
51
+ * <td rowspan="2">FOO</td>
52
+ * <td colspan="2">BAR</td>
53
+ * </tr>
54
+ * </thead>
55
+ * <tbody>
56
+ * <tr>
57
+ * <td>BAZ</td>
58
+ * <td>XYZ</td>
59
+ * </tr>
60
+ * </tbody>
61
+ * </table>
62
+ * ```
63
+ *
64
+ * In the above example the table will be rendered as a table with two rows: one in the header and second one in the body.
65
+ * The table cell (FOO) cannot span over multiple rows as it would extend from the header to the body section.
66
+ * The `rowspan` attribute must be changed to (1). The value (1) is the default value of the `rowspan` attribute
67
+ * so the `rowspan` attribute will be removed from the model.
68
+ *
69
+ * The table cell with BAZ in the content will be in the first column of the table.
70
+ *
71
+ * ## Adding missing table cells
72
+ *
73
+ * The table post-fixer will insert empty table cells to equalize table row sizes (the number of columns).
74
+ * The size of a table row is calculated by counting column spans of table cells, both horizontal (from the same row) and
75
+ * vertical (from the rows above).
76
+ *
77
+ * In the above example, the table row in the body section of the table is narrower then the row from the header: it has two cells
78
+ * with the default colspan (1). The header row has one cell with colspan (1) and the second with colspan (2).
79
+ * The table cell (FOO) does not extend beyond the head section (and as such will be fixed in the first step of this post-fixer).
80
+ * The post-fixer will add a missing table cell to the row in the body section of the table.
81
+ *
82
+ * The table from the above example will be fixed and rendered to the view as below:
83
+ *
84
+ * ```xml
85
+ * <table>
86
+ * <thead>
87
+ * <tr>
88
+ * <td rowspan="2">FOO</td>
89
+ * <td colspan="2">BAR</td>
90
+ * </tr>
91
+ * </thead>
92
+ * <tbody>
93
+ * <tr>
94
+ * <td>BAZ</td>
95
+ * <td>XYZ</td>
96
+ * </tr>
97
+ * </tbody>
98
+ * </table>
99
+ * ```
100
+ *
101
+ * ## Collaboration and undo - Expectations vs post-fixer results
102
+ *
103
+ * The table post-fixer only ensures proper structure without a deeper analysis of the nature of the change. As such, it might lead
104
+ * to a structure which was not intended by the user. In particular, it will also fix undo steps (in conjunction with collaboration)
105
+ * in which the editor content might not return to the original state.
106
+ *
107
+ * This will usually happen when one or more users change the size of the table.
108
+ *
109
+ * As an example see the table below:
110
+ *
111
+ * ```xml
112
+ * <table>
113
+ * <tbody>
114
+ * <tr>
115
+ * <td>11</td>
116
+ * <td>12</td>
117
+ * </tr>
118
+ * <tr>
119
+ * <td>21</td>
120
+ * <td>22</td>
121
+ * </tr>
122
+ * </tbody>
123
+ * </table>
124
+ * ```
125
+ *
126
+ * and the user actions:
127
+ *
128
+ * 1. Both users have a table with two rows and two columns.
129
+ * 2. User A adds a column at the end of the table. This will insert empty table cells to two rows.
130
+ * 3. User B adds a row at the end of the table. This will insert a row with two empty table cells.
131
+ * 4. Both users will have a table as below:
132
+ *
133
+ * ```xml
134
+ * <table>
135
+ * <tbody>
136
+ * <tr>
137
+ * <td>11</td>
138
+ * <td>12</td>
139
+ * <td>(empty, inserted by A)</td>
140
+ * </tr>
141
+ * <tr>
142
+ * <td>21</td>
143
+ * <td>22</td>
144
+ * <td>(empty, inserted by A)</td>
145
+ * </tr>
146
+ * <tr>
147
+ * <td>(empty, inserted by B)</td>
148
+ * <td>(empty, inserted by B)</td>
149
+ * </tr>
150
+ * </tbody>
151
+ * </table>
152
+ * ```
153
+ *
154
+ * The last row is shorter then others so the table post-fixer will add an empty row to the last row:
155
+ *
156
+ * ```xml
157
+ * <table>
158
+ * <tbody>
159
+ * <tr>
160
+ * <td>11</td>
161
+ * <td>12</td>
162
+ * <td>(empty, inserted by A)</td>
163
+ * </tr>
164
+ * <tr>
165
+ * <td>21</td>
166
+ * <td>22</td>
167
+ * <td>(empty, inserted by A)</td>
168
+ * </tr>
169
+ * <tr>
170
+ * <td>(empty, inserted by B)</td>
171
+ * <td>(empty, inserted by B)</td>
172
+ * <td>(empty, inserted by the post-fixer)</td>
173
+ * </tr>
174
+ * </tbody>
175
+ * </table>
176
+ * ```
177
+ *
178
+ * Unfortunately undo does not know the nature of the changes and depending on which user applies the post-fixer changes, undoing them
179
+ * might lead to a broken table. If User B undoes inserting the column to the table, the undo engine will undo only the operations of
180
+ * inserting empty cells to rows from the initial table state (row 1 and 2) but the cell in the post-fixed row will remain:
181
+ *
182
+ * ```xml
183
+ * <table>
184
+ * <tbody>
185
+ * <tr>
186
+ * <td>11</td>
187
+ * <td>12</td>
188
+ * </tr>
189
+ * <tr>
190
+ * <td>21</td>
191
+ * <td>22</td>
192
+ * </tr>
193
+ * <tr>
194
+ * <td>(empty, inserted by B)</td>
195
+ * <td>(empty, inserted by B)</td>
196
+ * <td>(empty, inserted by a post-fixer)</td>
197
+ * </tr>
198
+ * </tbody>
199
+ * </table>
200
+ * ```
201
+ *
202
+ * After undo, the table post-fixer will detect that two rows are shorter than others and will fix the table to:
203
+ *
204
+ * ```xml
205
+ * <table>
206
+ * <tbody>
207
+ * <tr>
208
+ * <td>11</td>
209
+ * <td>12</td>
210
+ * <td>(empty, inserted by a post-fixer after undo)</td>
211
+ * </tr>
212
+ * <tr>
213
+ * <td>21</td>
214
+ * <td>22</td>
215
+ * <td>(empty, inserted by a post-fixer after undo)</td>
216
+ * </tr>
217
+ * <tr>
218
+ * <td>(empty, inserted by B)</td>
219
+ * <td>(empty, inserted by B)</td>
220
+ * <td>(empty, inserted by a post-fixer)</td>
221
+ * </tr>
222
+ * </tbody>
223
+ * </table>
224
+ * ```
225
+ */
226
+ export default function injectTableLayoutPostFixer(model: Model): void;
@@ -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/converters/tableproperties
7
+ */
8
+ import type { Conversion, ViewElement } from 'ckeditor5/src/engine.js';
9
+ /**
10
+ * Conversion helper for upcasting attributes using normalized styles.
11
+ *
12
+ * @param options.modelAttribute The attribute to set.
13
+ * @param options.styleName The style name to convert.
14
+ * @param options.viewElement The view element name that should be converted.
15
+ * @param options.defaultValue The default value for the specified `modelAttribute`.
16
+ * @param options.shouldUpcast The function which returns `true` if style should be upcasted from this element.
17
+ */
18
+ export declare function upcastStyleToAttribute(conversion: Conversion, options: {
19
+ modelAttribute: string;
20
+ styleName: string;
21
+ viewElement: string | RegExp;
22
+ defaultValue: string;
23
+ reduceBoxSides?: boolean;
24
+ shouldUpcast?: (viewElement: ViewElement) => boolean;
25
+ }): void;
26
+ export interface StyleValues {
27
+ color: string;
28
+ style: string;
29
+ width: string;
30
+ }
31
+ /**
32
+ * Conversion helper for upcasting border styles for view elements.
33
+ *
34
+ * @param defaultBorder The default border values.
35
+ * @param defaultBorder.color The default `borderColor` value.
36
+ * @param defaultBorder.style The default `borderStyle` value.
37
+ * @param defaultBorder.width The default `borderWidth` value.
38
+ */
39
+ export declare function upcastBorderStyles(conversion: Conversion, viewElementName: string, modelAttributes: StyleValues, defaultBorder: StyleValues): void;
40
+ /**
41
+ * Conversion helper for downcasting an attribute to a style.
42
+ */
43
+ export declare function downcastAttributeToStyle(conversion: Conversion, options: {
44
+ modelElement: string;
45
+ modelAttribute: string;
46
+ styleName: string;
47
+ }): void;
48
+ /**
49
+ * Conversion helper for downcasting attributes from the model table to a view table (not to `<figure>`).
50
+ */
51
+ export declare function downcastTableAttribute(conversion: Conversion, options: {
52
+ modelAttribute: string;
53
+ styleName: string;
54
+ }): void;
@@ -0,0 +1,49 @@
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/converters/upcasttable
7
+ */
8
+ import type { UpcastDispatcher } from 'ckeditor5/src/engine.js';
9
+ /**
10
+ * Returns a function that converts the table view representation:
11
+ *
12
+ * ```xml
13
+ * <figure class="table"><table>...</table></figure>
14
+ * ```
15
+ *
16
+ * to the model representation:
17
+ *
18
+ * ```xml
19
+ * <table></table>
20
+ * ```
21
+ */
22
+ export declare function upcastTableFigure(): (dispatcher: UpcastDispatcher) => void;
23
+ /**
24
+ * View table element to model table element conversion helper.
25
+ *
26
+ * This conversion helper converts the table element as well as table rows.
27
+ *
28
+ * @returns Conversion helper.
29
+ */
30
+ export default function upcastTable(): (dispatcher: UpcastDispatcher) => void;
31
+ /**
32
+ * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.
33
+ *
34
+ * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells
35
+ * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only
36
+ * rows that have related `tableRow` elements).
37
+ *
38
+ * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue
39
+ * of an improper table with all empty rows.
40
+ *
41
+ * @returns Conversion helper.
42
+ */
43
+ export declare function skipEmptyTableRow(): (dispatcher: UpcastDispatcher) => void;
44
+ /**
45
+ * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.
46
+ *
47
+ * @returns Conversion helper.
48
+ */
49
+ export declare function ensureParagraphInTableCell(elementName: string): (dispatcher: UpcastDispatcher) => void;
@@ -0,0 +1,60 @@
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
7
+ */
8
+ export { default as PlainTableOutput } from './plaintableoutput.js';
9
+ export { default as Table } from './table.js';
10
+ export { default as TableEditing } from './tableediting.js';
11
+ export { default as TableUI } from './tableui.js';
12
+ export { default as TableToolbar } from './tabletoolbar.js';
13
+ export { default as TableCellProperties } from './tablecellproperties.js';
14
+ export { default as TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
15
+ export { default as TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
16
+ export { default as TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
17
+ export { default as TableProperties } from './tableproperties.js';
18
+ export { default as TablePropertiesEditing } from './tableproperties/tablepropertiesediting.js';
19
+ export { default as TablePropertiesUI } from './tableproperties/tablepropertiesui.js';
20
+ export { default as TableCaption } from './tablecaption.js';
21
+ export { default as TableCaptionEditing } from './tablecaption/tablecaptionediting.js';
22
+ export { default as TableCaptionUI } from './tablecaption/tablecaptionui.js';
23
+ export { default as TableClipboard } from './tableclipboard.js';
24
+ export { default as TableMouse } from './tablemouse.js';
25
+ export { default as TableKeyboard } from './tablekeyboard.js';
26
+ export { default as TableSelection } from './tableselection.js';
27
+ export { default as TableUtils } from './tableutils.js';
28
+ export { default as TableColumnResize } from './tablecolumnresize.js';
29
+ export { default as TableColumnResizeEditing } from './tablecolumnresize/tablecolumnresizeediting.js';
30
+ export type { TableConfig } from './tableconfig.js';
31
+ export type { default as InsertColumnCommand } from './commands/insertcolumncommand.js';
32
+ export type { default as InsertRowCommand } from './commands/insertrowcommand.js';
33
+ export type { default as InsertTableCommand } from './commands/inserttablecommand.js';
34
+ export type { default as MergeCellCommand } from './commands/mergecellcommand.js';
35
+ export type { default as MergeCellsCommand } from './commands/mergecellscommand.js';
36
+ export type { default as RemoveColumnCommand } from './commands/removecolumncommand.js';
37
+ export type { default as RemoveRowCommand } from './commands/removerowcommand.js';
38
+ export type { default as SelectColumnCommand } from './commands/selectcolumncommand.js';
39
+ export type { default as SelectRowCommand } from './commands/selectrowcommand.js';
40
+ export type { default as SetHeaderColumnCommand } from './commands/setheadercolumncommand.js';
41
+ export type { default as SetHeaderRowCommand } from './commands/setheaderrowcommand.js';
42
+ export type { default as SplitCellCommand } from './commands/splitcellcommand.js';
43
+ export type { default as ToggleTableCaptionCommand } from './tablecaption/toggletablecaptioncommand.js';
44
+ export type { default as TableCellBackgroundColorCommand } from './tablecellproperties/commands/tablecellbackgroundcolorcommand.js';
45
+ export type { default as TableCellBorderColorCommand } from './tablecellproperties/commands/tablecellbordercolorcommand.js';
46
+ export type { default as TableCellBorderStyleCommand } from './tablecellproperties/commands/tablecellborderstylecommand.js';
47
+ export type { default as TableCellBorderWidthCommand } from './tablecellproperties/commands/tablecellborderwidthcommand.js';
48
+ export type { default as TableCellHeightCommand } from './tablecellproperties/commands/tablecellheightcommand.js';
49
+ export type { default as TableCellHorizontalAlignmentCommand } from './tablecellproperties/commands/tablecellhorizontalalignmentcommand.js';
50
+ export type { default as TableCellPaddingCommand } from './tablecellproperties/commands/tablecellpaddingcommand.js';
51
+ export type { default as TableCellVerticalAlignmentCommand } from './tablecellproperties/commands/tablecellverticalalignmentcommand.js';
52
+ export type { default as TableCellWidthCommand } from './tablecellwidth/commands/tablecellwidthcommand.js';
53
+ export type { default as TableAlignmentCommand } from './tableproperties/commands/tablealignmentcommand.js';
54
+ export type { default as TableBackgroundColorCommand } from './tableproperties/commands/tablebackgroundcolorcommand.js';
55
+ export type { default as TableBorderColorCommand } from './tableproperties/commands/tablebordercolorcommand.js';
56
+ export type { default as TableBorderStyleCommand } from './tableproperties/commands/tableborderstylecommand.js';
57
+ export type { default as TableBorderWidthCommand } from './tableproperties/commands/tableborderwidthcommand.js';
58
+ export type { default as TableHeightCommand } from './tableproperties/commands/tableheightcommand.js';
59
+ export type { default as TableWidthCommand } from './tableproperties/commands/tablewidthcommand.js';
60
+ import './augmentation.js';
@@ -0,0 +1,26 @@
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/plaintableoutput
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import Table from './table.js';
10
+ /**
11
+ * The plain table output feature.
12
+ */
13
+ export default class PlainTableOutput extends Plugin {
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ static get pluginName(): "PlainTableOutput";
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get requires(): readonly [typeof Table];
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ init(): void;
26
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/table
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { Widget } from 'ckeditor5/src/widget.js';
10
+ import TableEditing from './tableediting.js';
11
+ import TableUI from './tableui.js';
12
+ import TableSelection from './tableselection.js';
13
+ import TableClipboard from './tableclipboard.js';
14
+ import TableKeyboard from './tablekeyboard.js';
15
+ import TableMouse from './tablemouse.js';
16
+ import '../theme/table.css';
17
+ /**
18
+ * The table plugin.
19
+ *
20
+ * For a detailed overview, check the {@glink features/tables/tables Table feature documentation}.
21
+ *
22
+ * This is a "glue" plugin that loads the following table features:
23
+ *
24
+ * * {@link module:table/tableediting~TableEditing editing feature},
25
+ * * {@link module:table/tableselection~TableSelection selection feature},
26
+ * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},
27
+ * * {@link module:table/tablemouse~TableMouse mouse selection feature},
28
+ * * {@link module:table/tableclipboard~TableClipboard clipboard feature},
29
+ * * {@link module:table/tableui~TableUI UI feature}.
30
+ */
31
+ export default class Table extends Plugin {
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get requires(): readonly [typeof TableEditing, typeof TableUI, typeof TableSelection, typeof TableMouse, typeof TableKeyboard, typeof TableClipboard, typeof Widget];
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ static get pluginName(): "Table";
40
+ }
@@ -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
+ /**
6
+ * @module table/tablecaption/tablecaptionediting
7
+ */
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
+ import { Element } from 'ckeditor5/src/engine.js';
10
+ /**
11
+ * The table caption editing plugin.
12
+ */
13
+ export default class TableCaptionEditing extends Plugin {
14
+ /**
15
+ * A map that keeps saved JSONified table captions and table model elements they are
16
+ * associated with.
17
+ *
18
+ * To learn more about this system, see {@link #_saveCaption}.
19
+ */
20
+ private _savedCaptionsMap;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "TableCaptionEditing";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ constructor(editor: Editor);
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ init(): void;
33
+ /**
34
+ * Returns the saved {@link module:engine/model/element~Element#toJSON JSONified} caption
35
+ * of a table model element.
36
+ *
37
+ * See {@link #_saveCaption}.
38
+ *
39
+ * @internal
40
+ * @param tableModelElement The model element the caption should be returned for.
41
+ * @returns The model caption element or `null` if there is none.
42
+ */
43
+ _getSavedCaption(tableModelElement: Element): Element | null;
44
+ /**
45
+ * Saves a {@link module:engine/model/element~Element#toJSON JSONified} caption for
46
+ * a table element to allow restoring it in the future.
47
+ *
48
+ * A caption is saved every time it gets hidden. The
49
+ * user should be able to restore it on demand.
50
+ *
51
+ * **Note**: The caption cannot be stored in the table model element attribute because,
52
+ * for instance, when the model state propagates to collaborators, the attribute would get
53
+ * lost (mainly because it does not convert to anything when the caption is hidden) and
54
+ * the states of collaborators' models would de-synchronize causing numerous issues.
55
+ *
56
+ * See {@link #_getSavedCaption}.
57
+ *
58
+ * @internal
59
+ * @param tableModelElement The model element the caption is saved for.
60
+ * @param caption The caption model element to be saved.
61
+ */
62
+ _saveCaption(tableModelElement: Element, caption: Element): void;
63
+ }
@@ -0,0 +1,21 @@
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/tablecaption/tablecaptionui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The table caption UI plugin. It introduces the `'toggleTableCaption'` UI button.
11
+ */
12
+ export default class TableCaptionUI extends Plugin {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get pluginName(): "TableCaptionUI";
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ init(): void;
21
+ }