@ckeditor/ckeditor5-table 45.2.1 → 46.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/build/table.js +1 -1
  2. package/dist/index-content.css +6 -5
  3. package/dist/index-editor.css +46 -46
  4. package/dist/index.css +63 -62
  5. package/dist/index.css.map +1 -1
  6. package/dist/index.js +305 -49
  7. package/dist/index.js.map +1 -1
  8. package/package.json +10 -10
  9. package/src/commands/insertcolumncommand.d.ts +1 -1
  10. package/src/commands/insertcolumncommand.js +1 -1
  11. package/src/commands/insertrowcommand.d.ts +1 -1
  12. package/src/commands/insertrowcommand.js +1 -1
  13. package/src/commands/inserttablecommand.d.ts +1 -1
  14. package/src/commands/inserttablecommand.js +1 -1
  15. package/src/commands/inserttablelayoutcommand.d.ts +1 -1
  16. package/src/commands/inserttablelayoutcommand.js +1 -1
  17. package/src/commands/mergecellcommand.d.ts +3 -3
  18. package/src/commands/mergecellcommand.js +2 -2
  19. package/src/commands/mergecellscommand.d.ts +1 -1
  20. package/src/commands/mergecellscommand.js +2 -2
  21. package/src/commands/removecolumncommand.d.ts +1 -1
  22. package/src/commands/removecolumncommand.js +2 -2
  23. package/src/commands/removerowcommand.d.ts +1 -1
  24. package/src/commands/removerowcommand.js +1 -1
  25. package/src/commands/selectcolumncommand.d.ts +1 -1
  26. package/src/commands/selectcolumncommand.js +2 -2
  27. package/src/commands/selectrowcommand.d.ts +1 -1
  28. package/src/commands/selectrowcommand.js +1 -1
  29. package/src/commands/setheadercolumncommand.d.ts +2 -2
  30. package/src/commands/setheadercolumncommand.js +1 -1
  31. package/src/commands/setheaderrowcommand.d.ts +2 -2
  32. package/src/commands/setheaderrowcommand.js +1 -1
  33. package/src/commands/splitcellcommand.d.ts +1 -1
  34. package/src/commands/splitcellcommand.js +1 -1
  35. package/src/converters/downcast.d.ts +21 -9
  36. package/src/converters/downcast.js +11 -3
  37. package/src/converters/table-caption-post-fixer.d.ts +3 -1
  38. package/src/converters/table-caption-post-fixer.js +3 -1
  39. package/src/converters/table-cell-paragraph-post-fixer.d.ts +3 -1
  40. package/src/converters/table-cell-paragraph-post-fixer.js +3 -1
  41. package/src/converters/table-cell-refresh-handler.d.ts +3 -1
  42. package/src/converters/table-cell-refresh-handler.js +3 -1
  43. package/src/converters/table-headings-refresh-handler.d.ts +3 -1
  44. package/src/converters/table-headings-refresh-handler.js +4 -2
  45. package/src/converters/table-layout-post-fixer.d.ts +3 -1
  46. package/src/converters/table-layout-post-fixer.js +4 -2
  47. package/src/converters/tableproperties.d.ts +17 -1
  48. package/src/converters/tableproperties.js +49 -2
  49. package/src/converters/upcasttable.d.ts +6 -1
  50. package/src/converters/upcasttable.js +6 -1
  51. package/src/index.d.ts +89 -56
  52. package/src/index.js +84 -24
  53. package/src/plaintableoutput.d.ts +2 -2
  54. package/src/plaintableoutput.js +2 -2
  55. package/src/table.d.ts +7 -7
  56. package/src/table.js +7 -7
  57. package/src/tablecaption/tablecaptionediting.d.ts +6 -6
  58. package/src/tablecaption/tablecaptionediting.js +8 -8
  59. package/src/tablecaption/tablecaptionui.d.ts +1 -1
  60. package/src/tablecaption/tablecaptionui.js +1 -1
  61. package/src/tablecaption/toggletablecaptioncommand.d.ts +1 -1
  62. package/src/tablecaption/toggletablecaptioncommand.js +1 -1
  63. package/src/tablecaption/utils.d.ts +8 -4
  64. package/src/tablecaption/utils.js +4 -0
  65. package/src/tablecaption.d.ts +3 -3
  66. package/src/tablecaption.js +3 -3
  67. package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +2 -2
  68. package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +2 -2
  69. package/src/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +4 -4
  70. package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +2 -2
  71. package/src/tablecellproperties/commands/tablecellborderstylecommand.d.ts +4 -4
  72. package/src/tablecellproperties/commands/tablecellborderstylecommand.js +2 -2
  73. package/src/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +4 -4
  74. package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +2 -2
  75. package/src/tablecellproperties/commands/tablecellheightcommand.d.ts +2 -2
  76. package/src/tablecellproperties/commands/tablecellheightcommand.js +2 -2
  77. package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +2 -2
  78. package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +2 -2
  79. package/src/tablecellproperties/commands/tablecellpaddingcommand.d.ts +4 -4
  80. package/src/tablecellproperties/commands/tablecellpaddingcommand.js +2 -2
  81. package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +3 -3
  82. package/src/tablecellproperties/commands/tablecellpropertycommand.js +1 -1
  83. package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +2 -2
  84. package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +2 -2
  85. package/src/tablecellproperties/tablecellpropertiesediting.d.ts +3 -3
  86. package/src/tablecellproperties/tablecellpropertiesediting.js +44 -19
  87. package/src/tablecellproperties/tablecellpropertiesui.d.ts +2 -2
  88. package/src/tablecellproperties/tablecellpropertiesui.js +2 -2
  89. package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +2 -2
  90. package/src/tablecellproperties/ui/tablecellpropertiesview.js +1 -1
  91. package/src/tablecellproperties.d.ts +3 -3
  92. package/src/tablecellproperties.js +3 -3
  93. package/src/tablecellwidth/commands/tablecellwidthcommand.d.ts +2 -2
  94. package/src/tablecellwidth/commands/tablecellwidthcommand.js +2 -2
  95. package/src/tablecellwidth/tablecellwidthediting.d.ts +2 -2
  96. package/src/tablecellwidth/tablecellwidthediting.js +5 -3
  97. package/src/tableclipboard.d.ts +6 -6
  98. package/src/tableclipboard.js +4 -4
  99. package/src/tablecolumnresize/constants.d.ts +9 -0
  100. package/src/tablecolumnresize/constants.js +9 -0
  101. package/src/tablecolumnresize/converters.d.ts +11 -1
  102. package/src/tablecolumnresize/converters.js +16 -0
  103. package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +7 -7
  104. package/src/tablecolumnresize/tablecolumnresizeediting.js +13 -11
  105. package/src/tablecolumnresize/tablewidthscommand.d.ts +3 -3
  106. package/src/tablecolumnresize/tablewidthscommand.js +1 -1
  107. package/src/tablecolumnresize/utils.d.ts +23 -11
  108. package/src/tablecolumnresize/utils.js +14 -2
  109. package/src/tablecolumnresize.d.ts +3 -3
  110. package/src/tablecolumnresize.js +3 -3
  111. package/src/tableconfig.d.ts +3 -1
  112. package/src/tableediting.d.ts +7 -7
  113. package/src/tableediting.js +19 -19
  114. package/src/tablekeyboard.d.ts +8 -8
  115. package/src/tablekeyboard.js +7 -7
  116. package/src/tablelayout/commands/tabletypecommand.d.ts +1 -1
  117. package/src/tablelayout/commands/tabletypecommand.js +1 -1
  118. package/src/tablelayout/tablelayoutediting.d.ts +2 -2
  119. package/src/tablelayout/tablelayoutediting.js +4 -4
  120. package/src/tablelayout/tablelayoutui.d.ts +1 -1
  121. package/src/tablelayout/tablelayoutui.js +4 -4
  122. package/src/tablelayout.d.ts +5 -5
  123. package/src/tablelayout.js +5 -5
  124. package/src/tablemouse/mouseeventsobserver.d.ts +13 -11
  125. package/src/tablemouse/mouseeventsobserver.js +4 -2
  126. package/src/tablemouse.d.ts +3 -3
  127. package/src/tablemouse.js +4 -4
  128. package/src/tableproperties/commands/tablealignmentcommand.d.ts +2 -2
  129. package/src/tableproperties/commands/tablealignmentcommand.js +2 -2
  130. package/src/tableproperties/commands/tablebackgroundcolorcommand.d.ts +2 -2
  131. package/src/tableproperties/commands/tablebackgroundcolorcommand.js +2 -2
  132. package/src/tableproperties/commands/tablebordercolorcommand.d.ts +4 -4
  133. package/src/tableproperties/commands/tablebordercolorcommand.js +2 -2
  134. package/src/tableproperties/commands/tableborderstylecommand.d.ts +4 -4
  135. package/src/tableproperties/commands/tableborderstylecommand.js +2 -2
  136. package/src/tableproperties/commands/tableborderwidthcommand.d.ts +4 -4
  137. package/src/tableproperties/commands/tableborderwidthcommand.js +2 -2
  138. package/src/tableproperties/commands/tableheightcommand.d.ts +2 -2
  139. package/src/tableproperties/commands/tableheightcommand.js +2 -2
  140. package/src/tableproperties/commands/tablepropertycommand.d.ts +4 -4
  141. package/src/tableproperties/commands/tablepropertycommand.js +1 -1
  142. package/src/tableproperties/commands/tablewidthcommand.d.ts +2 -2
  143. package/src/tableproperties/commands/tablewidthcommand.js +2 -2
  144. package/src/tableproperties/tablepropertiesediting.d.ts +2 -2
  145. package/src/tableproperties/tablepropertiesediting.js +49 -21
  146. package/src/tableproperties/tablepropertiesui.d.ts +2 -2
  147. package/src/tableproperties/tablepropertiesui.js +2 -2
  148. package/src/tableproperties/ui/tablepropertiesview.d.ts +2 -2
  149. package/src/tableproperties/ui/tablepropertiesview.js +1 -1
  150. package/src/tableproperties.d.ts +3 -3
  151. package/src/tableproperties.js +3 -3
  152. package/src/tableselection.d.ts +9 -9
  153. package/src/tableselection.js +4 -4
  154. package/src/tabletoolbar.d.ts +1 -1
  155. package/src/tabletoolbar.js +1 -1
  156. package/src/tableui.d.ts +1 -1
  157. package/src/tableui.js +4 -4
  158. package/src/tableutils.d.ts +25 -26
  159. package/src/tableutils.js +4 -4
  160. package/src/tablewalker.d.ts +8 -8
  161. package/src/tablewalker.js +2 -2
  162. package/src/ui/colorinputview.d.ts +6 -1
  163. package/src/ui/colorinputview.js +1 -1
  164. package/src/ui/inserttableview.d.ts +3 -1
  165. package/src/ui/inserttableview.js +3 -1
  166. package/src/utils/common.d.ts +16 -7
  167. package/src/utils/common.js +9 -1
  168. package/src/utils/structure.d.ts +24 -14
  169. package/src/utils/structure.js +11 -1
  170. package/src/utils/table-properties.d.ts +15 -2
  171. package/src/utils/table-properties.js +6 -0
  172. package/src/utils/ui/contextualballoon.d.ts +4 -3
  173. package/src/utils/ui/contextualballoon.js +1 -0
  174. package/src/utils/ui/table-properties.d.ts +20 -7
  175. package/src/utils/ui/table-properties.js +24 -11
  176. package/src/utils/ui/widget.d.ts +6 -0
  177. package/src/utils/ui/widget.js +6 -0
  178. package/theme/tablecaption.css +9 -8
  179. package/theme/tablecolumnresize.css +2 -2
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module table/tablewalker
7
7
  */
8
- import type { Element, Position } from 'ckeditor5/src/engine.js';
8
+ import type { ModelElement, ModelPosition } from 'ckeditor5/src/engine.js';
9
9
  /**
10
10
  * An object with configuration for `TableWalker`.
11
11
  */
@@ -43,13 +43,13 @@ export interface TableWalkerOptions {
43
43
  * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields
44
44
  * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
45
45
  */
46
- export default class TableWalker implements IterableIterator<TableSlot> {
46
+ export declare class TableWalker implements IterableIterator<TableSlot> {
47
47
  /**
48
48
  * The walker's table element.
49
49
  *
50
50
  * @internal
51
51
  */
52
- readonly _table: Element;
52
+ readonly _table: ModelElement;
53
53
  /**
54
54
  * A row index from which this iterator will start.
55
55
  */
@@ -187,7 +187,7 @@ export default class TableWalker implements IterableIterator<TableSlot> {
187
187
  * @param options.endColumn A column index at which this iterator should end. Can't be used together with `column`.
188
188
  * @param options.includeAllSlots Also return values for spanned cells. Default value is "false".
189
189
  */
190
- constructor(table: Element, options?: TableWalkerOptions);
190
+ constructor(table: ModelElement, options?: TableWalkerOptions);
191
191
  /**
192
192
  * Iterable interface.
193
193
  */
@@ -292,7 +292,7 @@ declare class TableSlot {
292
292
  /**
293
293
  * The current table cell.
294
294
  */
295
- readonly cell: Element;
295
+ readonly cell: ModelElement;
296
296
  /**
297
297
  * The row index of a table slot.
298
298
  */
@@ -329,7 +329,7 @@ declare class TableSlot {
329
329
  * @param anchorRow The row index of a cell anchor slot.
330
330
  * @param anchorColumn The column index of a cell anchor slot.
331
331
  */
332
- constructor(tableWalker: TableWalker, cell: Element, anchorRow: number, anchorColumn: number);
332
+ constructor(tableWalker: TableWalker, cell: ModelElement, anchorRow: number, anchorColumn: number);
333
333
  /**
334
334
  * Whether the cell is anchored in the current slot.
335
335
  */
@@ -347,9 +347,9 @@ declare class TableSlot {
347
347
  */
348
348
  get rowIndex(): number;
349
349
  /**
350
- * Returns the {@link module:engine/model/position~Position} before the table slot.
350
+ * Returns the {@link module:engine/model/position~ModelPosition} before the table slot.
351
351
  */
352
- getPositionBefore(): Position;
352
+ getPositionBefore(): ModelPosition;
353
353
  }
354
354
  export type { TableSlot };
355
355
  /**
@@ -6,7 +6,7 @@
6
6
  * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields
7
7
  * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
8
8
  */
9
- export default class TableWalker {
9
+ export class TableWalker {
10
10
  /**
11
11
  * The walker's table element.
12
12
  *
@@ -466,7 +466,7 @@ class TableSlot {
466
466
  return this._rowIndex;
467
467
  }
468
468
  /**
469
- * Returns the {@link module:engine/model/position~Position} before the table slot.
469
+ * Returns the {@link module:engine/model/position~ModelPosition} before the table slot.
470
470
  */
471
471
  getPositionBefore() {
472
472
  const model = this._table.root.document.model;
@@ -8,6 +8,11 @@
8
8
  import { View, InputTextView, FocusCycler, ViewCollection, type ColorDefinition, type DropdownView, type ColorPickerConfig, type FocusableView } from 'ckeditor5/src/ui.js';
9
9
  import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
10
10
  import '../../theme/colorinput.css';
11
+ /**
12
+ * The options for the color input view.
13
+ *
14
+ * @internal
15
+ */
11
16
  export type ColorInputViewOptions = {
12
17
  colorDefinitions: Array<ColorDefinition>;
13
18
  columns: number;
@@ -20,7 +25,7 @@ export type ColorInputViewOptions = {
20
25
  *
21
26
  * @internal
22
27
  */
23
- export default class ColorInputView extends View implements FocusableView {
28
+ export declare class ColorInputView extends View implements FocusableView {
24
29
  /**
25
30
  * The value of the input.
26
31
  *
@@ -14,7 +14,7 @@ import '../../theme/colorinput.css';
14
14
  *
15
15
  * @internal
16
16
  */
17
- export default class ColorInputView extends View {
17
+ export class ColorInputView extends View {
18
18
  /**
19
19
  * A cached reference to the options passed to the constructor.
20
20
  */
@@ -12,8 +12,10 @@ import './../../theme/inserttable.css';
12
12
  * The table size view.
13
13
  *
14
14
  * It renders a 10x10 grid to choose the inserted table size.
15
+ *
16
+ * @internal
15
17
  */
16
- export default class InsertTableView extends View {
18
+ export declare class InsertTableView extends View {
17
19
  /**
18
20
  * A collection of table size box items.
19
21
  */
@@ -12,8 +12,10 @@ import './../../theme/inserttable.css';
12
12
  * The table size view.
13
13
  *
14
14
  * It renders a 10x10 grid to choose the inserted table size.
15
+ *
16
+ * @internal
15
17
  */
16
- export default class InsertTableView extends View {
18
+ export class InsertTableView extends View {
17
19
  /**
18
20
  * A collection of table size box items.
19
21
  */
@@ -5,42 +5,51 @@
5
5
  /**
6
6
  * @module table/utils/common
7
7
  */
8
- import type { Conversion, Element, Item, Position, Schema, Writer, DocumentSelection } from 'ckeditor5/src/engine.js';
9
- import type TableUtils from '../tableutils.js';
8
+ import type { Conversion, ModelElement, ModelItem, ModelPosition, ModelSchema, ModelWriter, ModelDocumentSelection } from 'ckeditor5/src/engine.js';
9
+ import { type TableUtils } from '../tableutils.js';
10
10
  /**
11
11
  * A common method to update the numeric value. If a value is the default one, it will be unset.
12
12
  *
13
+ * @internal
13
14
  * @param key An attribute key.
14
15
  * @param value The new attribute value.
15
16
  * @param item A model item on which the attribute will be set.
16
17
  * @param defaultValue The default attribute value. If a value is lower or equal, it will be unset.
17
18
  */
18
- export declare function updateNumericAttribute(key: string, value: unknown, item: Item, writer: Writer, defaultValue?: unknown): void;
19
+ export declare function updateNumericAttribute(key: string, value: unknown, item: ModelItem, writer: ModelWriter, defaultValue?: unknown): void;
19
20
  /**
20
21
  * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
21
22
  *
23
+ * @internal
22
24
  * @param writer The model writer.
23
25
  * @param insertPosition The position at which the table cell should be inserted.
24
26
  * @param attributes The element attributes.
25
27
  * @returns Created table cell.
26
28
  */
27
- export declare function createEmptyTableCell(writer: Writer, insertPosition: Position, attributes?: Record<string, unknown>): Element;
29
+ export declare function createEmptyTableCell(writer: ModelWriter, insertPosition: ModelPosition, attributes?: Record<string, unknown>): ModelElement;
28
30
  /**
29
31
  * Checks if a table cell belongs to the heading column section.
32
+ *
33
+ * @internal
30
34
  */
31
- export declare function isHeadingColumnCell(tableUtils: TableUtils, tableCell: Element): boolean;
35
+ export declare function isHeadingColumnCell(tableUtils: TableUtils, tableCell: ModelElement): boolean;
32
36
  /**
33
37
  * Enables conversion for an attribute for simple view-model mappings.
34
38
  *
39
+ * @internal
35
40
  * @param options.defaultValue The default value for the specified `modelAttribute`.
36
41
  */
37
- export declare function enableProperty(schema: Schema, conversion: Conversion, options: {
42
+ export declare function enableProperty(schema: ModelSchema, conversion: Conversion, options: {
38
43
  modelAttribute: string;
39
44
  styleName: string;
45
+ attributeName?: string;
46
+ attributeType?: 'length' | 'color';
40
47
  defaultValue: string;
41
48
  reduceBoxSides?: boolean;
42
49
  }): void;
43
50
  /**
44
51
  * Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.
52
+ *
53
+ * @internal
45
54
  */
46
- export declare function getSelectionAffectedTable(selection: DocumentSelection): Element;
55
+ export declare function getSelectionAffectedTable(selection: ModelDocumentSelection): ModelElement;
@@ -2,10 +2,11 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import { downcastAttributeToStyle, upcastStyleToAttribute } from './../converters/tableproperties.js';
5
+ import { downcastAttributeToStyle, upcastStyleToAttribute } from '../converters/tableproperties.js';
6
6
  /**
7
7
  * A common method to update the numeric value. If a value is the default one, it will be unset.
8
8
  *
9
+ * @internal
9
10
  * @param key An attribute key.
10
11
  * @param value The new attribute value.
11
12
  * @param item A model item on which the attribute will be set.
@@ -22,6 +23,7 @@ export function updateNumericAttribute(key, value, item, writer, defaultValue =
22
23
  /**
23
24
  * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
24
25
  *
26
+ * @internal
25
27
  * @param writer The model writer.
26
28
  * @param insertPosition The position at which the table cell should be inserted.
27
29
  * @param attributes The element attributes.
@@ -35,6 +37,8 @@ export function createEmptyTableCell(writer, insertPosition, attributes = {}) {
35
37
  }
36
38
  /**
37
39
  * Checks if a table cell belongs to the heading column section.
40
+ *
41
+ * @internal
38
42
  */
39
43
  export function isHeadingColumnCell(tableUtils, tableCell) {
40
44
  const table = tableCell.parent.parent;
@@ -45,6 +49,7 @@ export function isHeadingColumnCell(tableUtils, tableCell) {
45
49
  /**
46
50
  * Enables conversion for an attribute for simple view-model mappings.
47
51
  *
52
+ * @internal
48
53
  * @param options.defaultValue The default value for the specified `modelAttribute`.
49
54
  */
50
55
  export function enableProperty(schema, conversion, options) {
@@ -52,11 +57,14 @@ export function enableProperty(schema, conversion, options) {
52
57
  schema.extend('tableCell', {
53
58
  allowAttributes: [modelAttribute]
54
59
  });
60
+ schema.setAttributeProperties(modelAttribute, { isFormatting: true });
55
61
  upcastStyleToAttribute(conversion, { viewElement: /^(td|th)$/, ...options });
56
62
  downcastAttributeToStyle(conversion, { modelElement: 'tableCell', ...options });
57
63
  }
58
64
  /**
59
65
  * Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.
66
+ *
67
+ * @internal
60
68
  */
61
69
  export function getSelectionAffectedTable(selection) {
62
70
  const selectedElement = selection.getSelectedElement();
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module table/utils/structure
7
7
  */
8
- import type { Element, Writer } from 'ckeditor5/src/engine.js';
8
+ import type { ModelElement, ModelWriter } from 'ckeditor5/src/engine.js';
9
9
  import { type TableSlot } from '../tablewalker.js';
10
- import type TableUtils from '../tableutils.js';
10
+ import { type TableUtils } from '../tableutils.js';
11
11
  /**
12
12
  * Returns a cropped table according to given dimensions.
13
13
 
@@ -36,13 +36,15 @@ import type TableUtils from '../tableutils.js';
36
36
  * ├───┼───┬───┤ ├───┤ └───────┴───┘
37
37
  * 4 │ n │ o │ p │ │ q │
38
38
  * └───┴───┴───┴───┴───┘
39
+ *
40
+ * @internal
39
41
  */
40
- export declare function cropTableToDimensions(sourceTable: Element, cropDimensions: {
42
+ export declare function cropTableToDimensions(sourceTable: ModelElement, cropDimensions: {
41
43
  startRow: number;
42
44
  startColumn: number;
43
45
  endRow: number;
44
46
  endColumn: number;
45
- }, writer: Writer): Element;
47
+ }, writer: ModelWriter): ModelElement;
46
48
  /**
47
49
  * Returns slot info of cells that starts above and overlaps a given row.
48
50
  *
@@ -62,17 +64,19 @@ export declare function cropTableToDimensions(sourceTable: Element, cropDimensio
62
64
  *
63
65
  * will return slot info for cells: "j", "f", "k".
64
66
  *
67
+ * @internal
65
68
  * @param table The table to check.
66
69
  * @param overlapRow The index of the row to check.
67
70
  * @param startRow row to start analysis. Use it when it is known that the cells above that row will not overlap. Default value is 0.
68
71
  */
69
- export declare function getVerticallyOverlappingCells(table: Element, overlapRow: number, startRow?: number): Array<TableSlot>;
72
+ export declare function getVerticallyOverlappingCells(table: ModelElement, overlapRow: number, startRow?: number): Array<TableSlot>;
70
73
  /**
71
74
  * Splits the table cell horizontally.
72
75
  *
76
+ * @internal
73
77
  * @returns Created table cell, if any were created.
74
78
  */
75
- export declare function splitHorizontally(tableCell: Element, splitRow: number, writer: Writer): Element | null;
79
+ export declare function splitHorizontally(tableCell: ModelElement, splitRow: number, writer: ModelWriter): ModelElement | null;
76
80
  /**
77
81
  * Returns slot info of cells that starts before and overlaps a given column.
78
82
  *
@@ -95,25 +99,29 @@ export declare function splitHorizontally(tableCell: Element, splitRow: number,
95
99
  *
96
100
  * will return slot info for cells: "b", "e", "i".
97
101
  *
102
+ * @internal
98
103
  * @param table The table to check.
99
104
  * @param overlapColumn The index of the column to check.
100
105
  */
101
- export declare function getHorizontallyOverlappingCells(table: Element, overlapColumn: number): Array<TableSlot>;
106
+ export declare function getHorizontallyOverlappingCells(table: ModelElement, overlapColumn: number): Array<TableSlot>;
102
107
  /**
103
108
  * Splits the table cell vertically.
104
109
  *
110
+ * @internal
105
111
  * @param columnIndex The table cell column index.
106
112
  * @param splitColumn The index of column to split cell on.
107
113
  * @returns Created table cell.
108
114
  */
109
- export declare function splitVertically(tableCell: Element, columnIndex: number, splitColumn: number, writer: Writer): Element;
115
+ export declare function splitVertically(tableCell: ModelElement, columnIndex: number, splitColumn: number, writer: ModelWriter): ModelElement;
110
116
  /**
111
117
  * Adjusts table cell dimensions to not exceed limit row and column.
112
118
  *
113
119
  * If table cell width (or height) covers a column (or row) that is after a limit column (or row)
114
120
  * this method will trim "colspan" (or "rowspan") attribute so the table cell will fit in a defined limits.
121
+ *
122
+ * @internal
115
123
  */
116
- export declare function trimTableCellIfNeeded(tableCell: Element, cellRow: number, cellColumn: number, limitRow: number, limitColumn: number, writer: Writer): void;
124
+ export declare function trimTableCellIfNeeded(tableCell: ModelElement, cellRow: number, cellColumn: number, limitRow: number, limitColumn: number, writer: ModelWriter): void;
117
125
  /**
118
126
  * Removes columns that have no cells anchored.
119
127
  *
@@ -136,7 +144,7 @@ export declare function trimTableCellIfNeeded(tableCell: Element, cellRow: numbe
136
144
  * @internal
137
145
  * @returns True if removed some columns.
138
146
  */
139
- export declare function removeEmptyColumns(table: Element, tableUtils: TableUtils): boolean;
147
+ export declare function removeEmptyColumns(table: ModelElement, tableUtils: TableUtils): boolean;
140
148
  /**
141
149
  * Removes rows that have no cells anchored.
142
150
  *
@@ -166,7 +174,7 @@ export declare function removeEmptyColumns(table: Element, tableUtils: TableUtil
166
174
  * @internal
167
175
  * @returns True if removed some rows.
168
176
  */
169
- export declare function removeEmptyRows(table: Element, tableUtils: TableUtils): boolean;
177
+ export declare function removeEmptyRows(table: ModelElement, tableUtils: TableUtils): boolean;
170
178
  /**
171
179
  * Removes rows and columns that have no cells anchored.
172
180
  *
@@ -191,7 +199,7 @@ export declare function removeEmptyRows(table: Element, tableUtils: TableUtils):
191
199
  *
192
200
  * @internal
193
201
  */
194
- export declare function removeEmptyRowsColumns(table: Element, tableUtils: TableUtils): void;
202
+ export declare function removeEmptyRowsColumns(table: ModelElement, tableUtils: TableUtils): void;
195
203
  /**
196
204
  * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).
197
205
  * The `dimensions.lastRow` is equal to last row index but selection might be bigger.
@@ -208,9 +216,10 @@ export declare function removeEmptyRowsColumns(table: Element, tableUtils: Table
208
216
  * 3 | | | | |
209
217
  * +---+---+---+---+
210
218
  *
219
+ * @internal
211
220
  * @returns Adjusted last row index.
212
221
  */
213
- export declare function adjustLastRowIndex(table: Element, dimensions: {
222
+ export declare function adjustLastRowIndex(table: ModelElement, dimensions: {
214
223
  firstRow: number;
215
224
  firstColumn: number;
216
225
  lastRow: number;
@@ -235,9 +244,10 @@ export declare function adjustLastRowIndex(table: Element, dimensions: {
235
244
  * ^
236
245
  * last column, each cell has colspan = 2, so we need to return 3, not 2
237
246
  *
247
+ * @internal
238
248
  * @returns Adjusted last column index.
239
249
  */
240
- export declare function adjustLastColumnIndex(table: Element, dimensions: {
250
+ export declare function adjustLastColumnIndex(table: ModelElement, dimensions: {
241
251
  firstRow: number;
242
252
  firstColumn: number;
243
253
  lastRow: number;
@@ -2,7 +2,7 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- import { default as TableWalker } from '../tablewalker.js';
5
+ import { TableWalker } from '../tablewalker.js';
6
6
  import { createEmptyTableCell, updateNumericAttribute } from './common.js';
7
7
  /**
8
8
  * Returns a cropped table according to given dimensions.
@@ -32,6 +32,8 @@ import { createEmptyTableCell, updateNumericAttribute } from './common.js';
32
32
  * ├───┼───┬───┤ ├───┤ └───────┴───┘
33
33
  * 4 │ n │ o │ p │ │ q │
34
34
  * └───┴───┴───┴───┴───┘
35
+ *
36
+ * @internal
35
37
  */
36
38
  export function cropTableToDimensions(sourceTable, cropDimensions, writer) {
37
39
  const { startRow, startColumn, endRow, endColumn } = cropDimensions;
@@ -93,6 +95,7 @@ export function cropTableToDimensions(sourceTable, cropDimensions, writer) {
93
95
  *
94
96
  * will return slot info for cells: "j", "f", "k".
95
97
  *
98
+ * @internal
96
99
  * @param table The table to check.
97
100
  * @param overlapRow The index of the row to check.
98
101
  * @param startRow row to start analysis. Use it when it is known that the cells above that row will not overlap. Default value is 0.
@@ -112,6 +115,7 @@ export function getVerticallyOverlappingCells(table, overlapRow, startRow = 0) {
112
115
  /**
113
116
  * Splits the table cell horizontally.
114
117
  *
118
+ * @internal
115
119
  * @returns Created table cell, if any were created.
116
120
  */
117
121
  export function splitHorizontally(tableCell, splitRow, writer) {
@@ -169,6 +173,7 @@ export function splitHorizontally(tableCell, splitRow, writer) {
169
173
  *
170
174
  * will return slot info for cells: "b", "e", "i".
171
175
  *
176
+ * @internal
172
177
  * @param table The table to check.
173
178
  * @param overlapColumn The index of the column to check.
174
179
  */
@@ -187,6 +192,7 @@ export function getHorizontallyOverlappingCells(table, overlapColumn) {
187
192
  /**
188
193
  * Splits the table cell vertically.
189
194
  *
195
+ * @internal
190
196
  * @param columnIndex The table cell column index.
191
197
  * @param splitColumn The index of column to split cell on.
192
198
  * @returns Created table cell.
@@ -213,6 +219,8 @@ export function splitVertically(tableCell, columnIndex, splitColumn, writer) {
213
219
  *
214
220
  * If table cell width (or height) covers a column (or row) that is after a limit column (or row)
215
221
  * this method will trim "colspan" (or "rowspan") attribute so the table cell will fit in a defined limits.
222
+ *
223
+ * @internal
216
224
  */
217
225
  export function trimTableCellIfNeeded(tableCell, cellRow, cellColumn, limitRow, limitColumn, writer) {
218
226
  const colspan = parseInt(tableCell.getAttribute('colspan') || '1');
@@ -377,6 +385,7 @@ export function removeEmptyRowsColumns(table, tableUtils) {
377
385
  * 3 | | | | |
378
386
  * +---+---+---+---+
379
387
  *
388
+ * @internal
380
389
  * @returns Adjusted last row index.
381
390
  */
382
391
  export function adjustLastRowIndex(table, dimensions) {
@@ -413,6 +422,7 @@ export function adjustLastRowIndex(table, dimensions) {
413
422
  * ^
414
423
  * last column, each cell has colspan = 2, so we need to return 3, not 2
415
424
  *
425
+ * @internal
416
426
  * @returns Adjusted last column index.
417
427
  */
418
428
  export function adjustLastColumnIndex(table, dimensions) {
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module table/utils/table-properties
7
7
  */
8
- import type { BoxSides } from 'ckeditor5/src/engine.js';
8
+ import type { BoxStyleSides } from 'ckeditor5/src/engine.js';
9
9
  /**
10
10
  * Returns a string if all four values of box sides are equal.
11
11
  *
@@ -20,8 +20,10 @@ import type { BoxSides } from 'ckeditor5/src/engine.js';
20
20
  * getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );
21
21
  * getSingleValue( { top: 'foo', right: 'foo' } );
22
22
  * ```
23
+ *
24
+ * @internal
23
25
  */
24
- export declare function getSingleValue(objectOrString: BoxSides | string | undefined): string | undefined;
26
+ export declare function getSingleValue(objectOrString: BoxStyleSides | string | undefined): string | undefined;
25
27
  /**
26
28
  * Adds a unit to a value if the value is a number or a string representing a number.
27
29
  *
@@ -34,9 +36,15 @@ export declare function getSingleValue(objectOrString: BoxSides | string | undef
34
36
  * getSingleValue( 'foo', 'px' ); // 'foo'
35
37
  * ```
36
38
  *
39
+ * @internal
37
40
  * @param defaultUnit A default unit added to a numeric value.
38
41
  */
39
42
  export declare function addDefaultUnitToNumericValue(value: string | number | undefined, defaultUnit: string): string | number | undefined;
43
+ /**
44
+ * Interface representing the normalized default properties for table and cell elements.
45
+ *
46
+ * @internal
47
+ */
40
48
  export interface NormalizedDefaultProperties {
41
49
  borderStyle: string;
42
50
  borderWidth: string;
@@ -51,6 +59,8 @@ export interface NormalizedDefaultProperties {
51
59
  }
52
60
  /**
53
61
  * Options used to determine which properties should be added to the normalized configuration.
62
+ *
63
+ * @internal
54
64
  */
55
65
  export type NormalizeTableDefaultPropertiesOptions = {
56
66
  /**
@@ -77,6 +87,7 @@ export type NormalizeTableDefaultPropertiesOptions = {
77
87
  /**
78
88
  * Returns the normalized configuration.
79
89
  *
90
+ * @internal
80
91
  * @param config The configuration to normalize.
81
92
  * @param options Options used to determine which properties should be added.
82
93
  */
@@ -84,6 +95,7 @@ export declare function getNormalizedDefaultProperties(config?: Partial<Normaliz
84
95
  /**
85
96
  * Returns the normalized default table properties.
86
97
  *
98
+ * @internal
87
99
  * @param config The configuration to normalize.
88
100
  * @param options Options used to determine which properties should be added.
89
101
  */
@@ -91,6 +103,7 @@ export declare function getNormalizedDefaultTableProperties(config?: Partial<Nor
91
103
  /**
92
104
  * Returns the normalized default cell properties.
93
105
  *
106
+ * @internal
94
107
  * @param config The configuration to normalize.
95
108
  * @param options Options used to determine which properties should be added.
96
109
  */
@@ -17,6 +17,8 @@ import { isObject } from 'es-toolkit/compat';
17
17
  * getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );
18
18
  * getSingleValue( { top: 'foo', right: 'foo' } );
19
19
  * ```
20
+ *
21
+ * @internal
20
22
  */
21
23
  export function getSingleValue(objectOrString) {
22
24
  if (!objectOrString || !isObject(objectOrString)) {
@@ -39,6 +41,7 @@ export function getSingleValue(objectOrString) {
39
41
  * getSingleValue( 'foo', 'px' ); // 'foo'
40
42
  * ```
41
43
  *
44
+ * @internal
42
45
  * @param defaultUnit A default unit added to a numeric value.
43
46
  */
44
47
  export function addDefaultUnitToNumericValue(value, defaultUnit) {
@@ -54,6 +57,7 @@ export function addDefaultUnitToNumericValue(value, defaultUnit) {
54
57
  /**
55
58
  * Returns the normalized configuration.
56
59
  *
60
+ * @internal
57
61
  * @param config The configuration to normalize.
58
62
  * @param options Options used to determine which properties should be added.
59
63
  */
@@ -84,6 +88,7 @@ export function getNormalizedDefaultProperties(config, options = {}) {
84
88
  /**
85
89
  * Returns the normalized default table properties.
86
90
  *
91
+ * @internal
87
92
  * @param config The configuration to normalize.
88
93
  * @param options Options used to determine which properties should be added.
89
94
  */
@@ -100,6 +105,7 @@ export function getNormalizedDefaultTableProperties(config, options) {
100
105
  /**
101
106
  * Returns the normalized default cell properties.
102
107
  *
108
+ * @internal
103
109
  * @param config The configuration to normalize.
104
110
  * @param options Options used to determine which properties should be added.
105
111
  */
@@ -5,13 +5,14 @@
5
5
  /**
6
6
  * @module table/utils/ui/contextualballoon
7
7
  */
8
- import { type PositionOptions } from 'ckeditor5/src/utils.js';
8
+ import { type DomOptimalPositionOptions } from 'ckeditor5/src/utils.js';
9
9
  import type { Editor } from 'ckeditor5/src/core.js';
10
10
  /**
11
11
  * A helper utility that positions the
12
12
  * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
13
13
  * with respect to the table in the editor content, if one is selected.
14
14
  *
15
+ * @internal
15
16
  * @param editor The editor instance.
16
17
  * @param target Either "cell" or "table". Determines the target the balloon will be attached to.
17
18
  */
@@ -23,7 +24,7 @@ export declare function repositionContextualBalloon(editor: Editor, target: stri
23
24
  *
24
25
  * @param editor The editor instance.
25
26
  */
26
- export declare function getBalloonTablePositionData(editor: Editor): Partial<PositionOptions>;
27
+ export declare function getBalloonTablePositionData(editor: Editor): Partial<DomOptimalPositionOptions>;
27
28
  /**
28
29
  * Returns the positioning options that control the geometry of the
29
30
  * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
@@ -31,4 +32,4 @@ export declare function getBalloonTablePositionData(editor: Editor): Partial<Pos
31
32
  *
32
33
  * @param editor The editor instance.
33
34
  */
34
- export declare function getBalloonCellPositionData(editor: Editor): Partial<PositionOptions>;
35
+ export declare function getBalloonCellPositionData(editor: Editor): Partial<DomOptimalPositionOptions>;
@@ -23,6 +23,7 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (() => [
23
23
  * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
24
24
  * with respect to the table in the editor content, if one is selected.
25
25
  *
26
+ * @internal
26
27
  * @param editor The editor instance.
27
28
  * @param target Either "cell" or "table". Determines the target the balloon will be attached to.
28
29
  */