@ckeditor/ckeditor5-table 0.0.0-nightly-20250605.0 → 0.0.0-nightly-20250607.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 (165) hide show
  1. package/build/table.js +1 -1
  2. package/dist/index-content.css +2 -1
  3. package/dist/index.css +2 -1
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.js +50 -6
  6. package/dist/index.js.map +1 -1
  7. package/package.json +9 -9
  8. package/src/commands/insertcolumncommand.d.ts +1 -1
  9. package/src/commands/insertcolumncommand.js +1 -1
  10. package/src/commands/insertrowcommand.d.ts +1 -1
  11. package/src/commands/insertrowcommand.js +1 -1
  12. package/src/commands/inserttablecommand.d.ts +1 -1
  13. package/src/commands/inserttablecommand.js +1 -1
  14. package/src/commands/inserttablelayoutcommand.d.ts +1 -1
  15. package/src/commands/inserttablelayoutcommand.js +1 -1
  16. package/src/commands/mergecellcommand.d.ts +1 -1
  17. package/src/commands/mergecellcommand.js +2 -2
  18. package/src/commands/mergecellscommand.d.ts +1 -1
  19. package/src/commands/mergecellscommand.js +2 -2
  20. package/src/commands/removecolumncommand.d.ts +1 -1
  21. package/src/commands/removecolumncommand.js +2 -2
  22. package/src/commands/removerowcommand.d.ts +1 -1
  23. package/src/commands/removerowcommand.js +1 -1
  24. package/src/commands/selectcolumncommand.d.ts +1 -1
  25. package/src/commands/selectcolumncommand.js +2 -2
  26. package/src/commands/selectrowcommand.d.ts +1 -1
  27. package/src/commands/selectrowcommand.js +1 -1
  28. package/src/commands/setheadercolumncommand.d.ts +1 -1
  29. package/src/commands/setheadercolumncommand.js +1 -1
  30. package/src/commands/setheaderrowcommand.d.ts +1 -1
  31. package/src/commands/setheaderrowcommand.js +1 -1
  32. package/src/commands/splitcellcommand.d.ts +1 -1
  33. package/src/commands/splitcellcommand.js +1 -1
  34. package/src/converters/downcast.d.ts +1 -1
  35. package/src/converters/downcast.js +1 -1
  36. package/src/converters/table-caption-post-fixer.d.ts +1 -1
  37. package/src/converters/table-caption-post-fixer.js +1 -1
  38. package/src/converters/table-cell-paragraph-post-fixer.d.ts +1 -1
  39. package/src/converters/table-cell-paragraph-post-fixer.js +1 -1
  40. package/src/converters/table-cell-refresh-handler.d.ts +1 -1
  41. package/src/converters/table-cell-refresh-handler.js +1 -1
  42. package/src/converters/table-headings-refresh-handler.d.ts +1 -1
  43. package/src/converters/table-headings-refresh-handler.js +2 -2
  44. package/src/converters/table-layout-post-fixer.d.ts +1 -1
  45. package/src/converters/table-layout-post-fixer.js +2 -2
  46. package/src/converters/upcasttable.d.ts +1 -1
  47. package/src/converters/upcasttable.js +1 -1
  48. package/src/index.d.ts +55 -55
  49. package/src/index.js +55 -24
  50. package/src/plaintableoutput.d.ts +2 -2
  51. package/src/plaintableoutput.js +2 -2
  52. package/src/table.d.ts +7 -7
  53. package/src/table.js +7 -7
  54. package/src/tablecaption/tablecaptionediting.d.ts +1 -1
  55. package/src/tablecaption/tablecaptionediting.js +3 -3
  56. package/src/tablecaption/tablecaptionui.d.ts +1 -1
  57. package/src/tablecaption/tablecaptionui.js +1 -1
  58. package/src/tablecaption/toggletablecaptioncommand.d.ts +1 -1
  59. package/src/tablecaption/toggletablecaptioncommand.js +1 -1
  60. package/src/tablecaption.d.ts +3 -3
  61. package/src/tablecaption.js +3 -3
  62. package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +2 -2
  63. package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +2 -2
  64. package/src/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +2 -2
  65. package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +2 -2
  66. package/src/tablecellproperties/commands/tablecellborderstylecommand.d.ts +2 -2
  67. package/src/tablecellproperties/commands/tablecellborderstylecommand.js +2 -2
  68. package/src/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +2 -2
  69. package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +2 -2
  70. package/src/tablecellproperties/commands/tablecellheightcommand.d.ts +2 -2
  71. package/src/tablecellproperties/commands/tablecellheightcommand.js +2 -2
  72. package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +2 -2
  73. package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +2 -2
  74. package/src/tablecellproperties/commands/tablecellpaddingcommand.d.ts +2 -2
  75. package/src/tablecellproperties/commands/tablecellpaddingcommand.js +2 -2
  76. package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +1 -1
  77. package/src/tablecellproperties/commands/tablecellpropertycommand.js +1 -1
  78. package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +2 -2
  79. package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +2 -2
  80. package/src/tablecellproperties/tablecellpropertiesediting.d.ts +3 -3
  81. package/src/tablecellproperties/tablecellpropertiesediting.js +16 -11
  82. package/src/tablecellproperties/tablecellpropertiesui.d.ts +2 -2
  83. package/src/tablecellproperties/tablecellpropertiesui.js +2 -2
  84. package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +2 -2
  85. package/src/tablecellproperties/ui/tablecellpropertiesview.js +1 -1
  86. package/src/tablecellproperties.d.ts +3 -3
  87. package/src/tablecellproperties.js +3 -3
  88. package/src/tablecellwidth/commands/tablecellwidthcommand.d.ts +2 -2
  89. package/src/tablecellwidth/commands/tablecellwidthcommand.js +2 -2
  90. package/src/tablecellwidth/tablecellwidthediting.d.ts +2 -2
  91. package/src/tablecellwidth/tablecellwidthediting.js +3 -3
  92. package/src/tableclipboard.d.ts +3 -3
  93. package/src/tableclipboard.js +4 -4
  94. package/src/tablecolumnresize/converters.d.ts +5 -1
  95. package/src/tablecolumnresize/converters.js +10 -0
  96. package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +3 -3
  97. package/src/tablecolumnresize/tablecolumnresizeediting.js +13 -10
  98. package/src/tablecolumnresize/tablewidthscommand.d.ts +1 -1
  99. package/src/tablecolumnresize/tablewidthscommand.js +1 -1
  100. package/src/tablecolumnresize/utils.d.ts +1 -1
  101. package/src/tablecolumnresize/utils.js +2 -2
  102. package/src/tablecolumnresize.d.ts +3 -3
  103. package/src/tablecolumnresize.js +3 -3
  104. package/src/tableconfig.d.ts +1 -1
  105. package/src/tableediting.d.ts +2 -2
  106. package/src/tableediting.js +19 -19
  107. package/src/tablekeyboard.d.ts +3 -3
  108. package/src/tablekeyboard.js +4 -4
  109. package/src/tablelayout/commands/tabletypecommand.d.ts +1 -1
  110. package/src/tablelayout/commands/tabletypecommand.js +1 -1
  111. package/src/tablelayout/tablelayoutediting.d.ts +2 -2
  112. package/src/tablelayout/tablelayoutediting.js +4 -4
  113. package/src/tablelayout/tablelayoutui.d.ts +1 -1
  114. package/src/tablelayout/tablelayoutui.js +2 -2
  115. package/src/tablelayout.d.ts +5 -5
  116. package/src/tablelayout.js +5 -5
  117. package/src/tablemouse/mouseeventsobserver.d.ts +1 -1
  118. package/src/tablemouse/mouseeventsobserver.js +1 -1
  119. package/src/tablemouse.d.ts +3 -3
  120. package/src/tablemouse.js +4 -4
  121. package/src/tableproperties/commands/tablealignmentcommand.d.ts +2 -2
  122. package/src/tableproperties/commands/tablealignmentcommand.js +2 -2
  123. package/src/tableproperties/commands/tablebackgroundcolorcommand.d.ts +2 -2
  124. package/src/tableproperties/commands/tablebackgroundcolorcommand.js +2 -2
  125. package/src/tableproperties/commands/tablebordercolorcommand.d.ts +2 -2
  126. package/src/tableproperties/commands/tablebordercolorcommand.js +2 -2
  127. package/src/tableproperties/commands/tableborderstylecommand.d.ts +2 -2
  128. package/src/tableproperties/commands/tableborderstylecommand.js +2 -2
  129. package/src/tableproperties/commands/tableborderwidthcommand.d.ts +2 -2
  130. package/src/tableproperties/commands/tableborderwidthcommand.js +2 -2
  131. package/src/tableproperties/commands/tableheightcommand.d.ts +2 -2
  132. package/src/tableproperties/commands/tableheightcommand.js +2 -2
  133. package/src/tableproperties/commands/tablepropertycommand.d.ts +1 -1
  134. package/src/tableproperties/commands/tablepropertycommand.js +1 -1
  135. package/src/tableproperties/commands/tablewidthcommand.d.ts +2 -2
  136. package/src/tableproperties/commands/tablewidthcommand.js +2 -2
  137. package/src/tableproperties/tablepropertiesediting.d.ts +2 -2
  138. package/src/tableproperties/tablepropertiesediting.js +15 -9
  139. package/src/tableproperties/tablepropertiesui.d.ts +2 -2
  140. package/src/tableproperties/tablepropertiesui.js +2 -2
  141. package/src/tableproperties/ui/tablepropertiesview.d.ts +2 -2
  142. package/src/tableproperties/ui/tablepropertiesview.js +1 -1
  143. package/src/tableproperties.d.ts +3 -3
  144. package/src/tableproperties.js +3 -3
  145. package/src/tableselection.d.ts +2 -2
  146. package/src/tableselection.js +3 -3
  147. package/src/tabletoolbar.d.ts +1 -1
  148. package/src/tabletoolbar.js +1 -1
  149. package/src/tableui.d.ts +1 -1
  150. package/src/tableui.js +2 -2
  151. package/src/tableutils.d.ts +2 -2
  152. package/src/tableutils.js +2 -2
  153. package/src/tablewalker.d.ts +1 -1
  154. package/src/tablewalker.js +1 -1
  155. package/src/ui/colorinputview.d.ts +1 -1
  156. package/src/ui/colorinputview.js +1 -1
  157. package/src/ui/inserttableview.d.ts +1 -1
  158. package/src/ui/inserttableview.js +1 -1
  159. package/src/utils/common.d.ts +1 -1
  160. package/src/utils/common.js +1 -0
  161. package/src/utils/structure.d.ts +1 -1
  162. package/src/utils/structure.js +1 -1
  163. package/src/utils/ui/table-properties.d.ts +3 -3
  164. package/src/utils/ui/table-properties.js +1 -1
  165. package/theme/tablecaption.css +2 -1
@@ -8,16 +8,16 @@
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { addBorderRules, addPaddingRules, addBackgroundRules } from 'ckeditor5/src/engine.js';
10
10
  import { downcastAttributeToStyle, getDefaultValueAdjusted, upcastBorderStyles } from '../converters/tableproperties.js';
11
- import TableEditing from './../tableediting.js';
12
- import TableCellWidthEditing from '../tablecellwidth/tablecellwidthediting.js';
13
- import TableCellPaddingCommand from './commands/tablecellpaddingcommand.js';
14
- import TableCellHeightCommand from './commands/tablecellheightcommand.js';
15
- import TableCellBackgroundColorCommand from './commands/tablecellbackgroundcolorcommand.js';
16
- import TableCellVerticalAlignmentCommand from './commands/tablecellverticalalignmentcommand.js';
17
- import TableCellHorizontalAlignmentCommand from './commands/tablecellhorizontalalignmentcommand.js';
18
- import TableCellBorderStyleCommand from './commands/tablecellborderstylecommand.js';
19
- import TableCellBorderColorCommand from './commands/tablecellbordercolorcommand.js';
20
- import TableCellBorderWidthCommand from './commands/tablecellborderwidthcommand.js';
11
+ import { TableEditing } from './../tableediting.js';
12
+ import { TableCellWidthEditing } from '../tablecellwidth/tablecellwidthediting.js';
13
+ import { TableCellPaddingCommand } from './commands/tablecellpaddingcommand.js';
14
+ import { TableCellHeightCommand } from './commands/tablecellheightcommand.js';
15
+ import { TableCellBackgroundColorCommand } from './commands/tablecellbackgroundcolorcommand.js';
16
+ import { TableCellVerticalAlignmentCommand } from './commands/tablecellverticalalignmentcommand.js';
17
+ import { TableCellHorizontalAlignmentCommand } from './commands/tablecellhorizontalalignmentcommand.js';
18
+ import { TableCellBorderStyleCommand } from './commands/tablecellborderstylecommand.js';
19
+ import { TableCellBorderColorCommand } from './commands/tablecellbordercolorcommand.js';
20
+ import { TableCellBorderWidthCommand } from './commands/tablecellborderwidthcommand.js';
21
21
  import { getNormalizedDefaultCellProperties } from '../utils/table-properties.js';
22
22
  import { enableProperty } from '../utils/common.js';
23
23
  const VALIGN_VALUES_REG_EXP = /^(top|middle|bottom)$/;
@@ -41,7 +41,7 @@ const ALIGN_VALUES_REG_EXP = /^(left|center|right|justify)$/;
41
41
  * - horizontal and vertical alignment: the `'tableCellHorizontalAlignment'` and `'tableCellVerticalAlignment'` commands
42
42
  * - width and height: the `'tableCellWidth'` and `'tableCellHeight'` commands
43
43
  */
44
- export default class TableCellPropertiesEditing extends Plugin {
44
+ export class TableCellPropertiesEditing extends Plugin {
45
45
  /**
46
46
  * @inheritDoc
47
47
  */
@@ -131,6 +131,9 @@ function enableBorderProperties(schema, conversion, defaultBorder) {
131
131
  schema.extend('tableCell', {
132
132
  allowAttributes: Object.values(modelAttributes)
133
133
  });
134
+ for (const modelAttribute of Object.values(modelAttributes)) {
135
+ schema.setAttributeProperties(modelAttribute, { isFormatting: true });
136
+ }
134
137
  upcastBorderStyles(conversion, 'td', modelAttributes, defaultBorder);
135
138
  upcastBorderStyles(conversion, 'th', modelAttributes, defaultBorder);
136
139
  downcastAttributeToStyle(conversion, { modelElement: 'tableCell', modelAttribute: modelAttributes.style, styleName: 'border-style' });
@@ -146,6 +149,7 @@ function enableHorizontalAlignmentProperty(schema, conversion, defaultValue) {
146
149
  schema.extend('tableCell', {
147
150
  allowAttributes: ['tableCellHorizontalAlignment']
148
151
  });
152
+ schema.setAttributeProperties('tableCellHorizontalAlignment', { isFormatting: true });
149
153
  conversion.for('downcast')
150
154
  .attributeToAttribute({
151
155
  model: {
@@ -212,6 +216,7 @@ function enableVerticalAlignmentProperty(schema, conversion, defaultValue) {
212
216
  schema.extend('tableCell', {
213
217
  allowAttributes: ['tableCellVerticalAlignment']
214
218
  });
219
+ schema.setAttributeProperties('tableCellVerticalAlignment', { isFormatting: true });
215
220
  conversion.for('downcast')
216
221
  .attributeToAttribute({
217
222
  model: {
@@ -7,14 +7,14 @@
7
7
  */
8
8
  import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
9
  import { ContextualBalloon } from 'ckeditor5/src/ui.js';
10
- import TableCellPropertiesView from './ui/tablecellpropertiesview.js';
10
+ import { TableCellPropertiesView } from './ui/tablecellpropertiesview.js';
11
11
  /**
12
12
  * The table cell properties UI plugin. It introduces the `'tableCellProperties'` button
13
13
  * that opens a form allowing to specify the visual styling of a table cell.
14
14
  *
15
15
  * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
16
16
  */
17
- export default class TableCellPropertiesUI extends Plugin {
17
+ export declare class TableCellPropertiesUI extends Plugin {
18
18
  /**
19
19
  * The default table cell properties.
20
20
  */
@@ -8,7 +8,7 @@
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { IconTableCellProperties } from 'ckeditor5/src/icons.js';
10
10
  import { ButtonView, clickOutsideHandler, ContextualBalloon, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui.js';
11
- import TableCellPropertiesView from './ui/tablecellpropertiesview.js';
11
+ import { TableCellPropertiesView } from './ui/tablecellpropertiesview.js';
12
12
  import { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, defaultColors, lengthFieldValidator, lineWidthFieldValidator } from '../utils/ui/table-properties.js';
13
13
  import { debounce } from 'es-toolkit/compat';
14
14
  import { getSelectionAffectedTableWidget, getTableWidgetAncestor } from '../utils/ui/widget.js';
@@ -33,7 +33,7 @@ const propertyToCommandMap = {
33
33
  *
34
34
  * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
35
35
  */
36
- export default class TableCellPropertiesUI extends Plugin {
36
+ export class TableCellPropertiesUI extends Plugin {
37
37
  /**
38
38
  * The default table cell properties.
39
39
  */
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { ButtonView, FocusCycler, LabeledFieldView, ToolbarView, View, ViewCollection, type FocusableView, type NormalizedColorOption, type ColorPickerConfig } from 'ckeditor5/src/ui.js';
9
9
  import { KeystrokeHandler, FocusTracker, type Locale } from 'ckeditor5/src/utils.js';
10
- import type ColorInputView from '../../ui/colorinputview.js';
10
+ import { type ColorInputView } from '../../ui/colorinputview.js';
11
11
  import type { TableCellPropertiesOptions } from '../../tableconfig.js';
12
12
  import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
13
13
  import '../../../theme/formrow.css';
@@ -23,7 +23,7 @@ export interface TableCellPropertiesViewOptions {
23
23
  * The class representing a table cell properties form, allowing users to customize
24
24
  * certain style aspects of a table cell, for instance, border, padding, text alignment, etc..
25
25
  */
26
- export default class TableCellPropertiesView extends View {
26
+ export declare class TableCellPropertiesView extends View {
27
27
  /**
28
28
  * The value of the cell border style.
29
29
  *
@@ -18,7 +18,7 @@ import '../../../theme/tablecellproperties.css';
18
18
  * The class representing a table cell properties form, allowing users to customize
19
19
  * certain style aspects of a table cell, for instance, border, padding, text alignment, etc..
20
20
  */
21
- export default class TableCellPropertiesView extends View {
21
+ export class TableCellPropertiesView extends View {
22
22
  /**
23
23
  * Options passed to the view. See {@link #constructor} to learn more.
24
24
  */
@@ -6,8 +6,8 @@
6
6
  * @module table/tablecellproperties
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import TableCellPropertiesUI from './tablecellproperties/tablecellpropertiesui.js';
10
- import TableCellPropertiesEditing from './tablecellproperties/tablecellpropertiesediting.js';
9
+ import { TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
10
+ import { TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
11
11
  /**
12
12
  * The table cell properties feature. Enables support for setting properties of table cells (size, border, background, etc.).
13
13
  *
@@ -18,7 +18,7 @@ import TableCellPropertiesEditing from './tablecellproperties/tablecellpropertie
18
18
  * {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing table cell properties editing feature} and
19
19
  * the {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI table cell properties UI feature}.
20
20
  */
21
- export default class TableCellProperties extends Plugin {
21
+ export declare class TableCellProperties extends Plugin {
22
22
  /**
23
23
  * @inheritDoc
24
24
  */
@@ -6,8 +6,8 @@
6
6
  * @module table/tablecellproperties
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import TableCellPropertiesUI from './tablecellproperties/tablecellpropertiesui.js';
10
- import TableCellPropertiesEditing from './tablecellproperties/tablecellpropertiesediting.js';
9
+ import { TableCellPropertiesUI } from './tablecellproperties/tablecellpropertiesui.js';
10
+ import { TableCellPropertiesEditing } from './tablecellproperties/tablecellpropertiesediting.js';
11
11
  /**
12
12
  * The table cell properties feature. Enables support for setting properties of table cells (size, border, background, etc.).
13
13
  *
@@ -18,7 +18,7 @@ import TableCellPropertiesEditing from './tablecellproperties/tablecellpropertie
18
18
  * {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing table cell properties editing feature} and
19
19
  * the {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI table cell properties UI feature}.
20
20
  */
21
- export default class TableCellProperties extends Plugin {
21
+ export class TableCellProperties extends Plugin {
22
22
  /**
23
23
  * @inheritDoc
24
24
  */
@@ -6,7 +6,7 @@
6
6
  * @module table/tablecellwidth/commands/tablecellwidthcommand
7
7
  */
8
8
  import type { Editor } from 'ckeditor5/src/core.js';
9
- import TableCellPropertyCommand from '../../tablecellproperties/commands/tablecellpropertycommand.js';
9
+ import { TableCellPropertyCommand } from '../../tablecellproperties/commands/tablecellpropertycommand.js';
10
10
  /**
11
11
  * The table cell width command.
12
12
  *
@@ -31,7 +31,7 @@ import TableCellPropertyCommand from '../../tablecellproperties/commands/tablece
31
31
  *
32
32
  * will set the `width` attribute to `'50px'` in the model.
33
33
  */
34
- export default class TableCellWidthCommand extends TableCellPropertyCommand {
34
+ export declare class TableCellWidthCommand extends TableCellPropertyCommand {
35
35
  /**
36
36
  * Creates a new `TableCellWidthCommand` instance.
37
37
  *
@@ -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 TableCellPropertyCommand from '../../tablecellproperties/commands/tablecellpropertycommand.js';
5
+ import { TableCellPropertyCommand } from '../../tablecellproperties/commands/tablecellpropertycommand.js';
6
6
  import { addDefaultUnitToNumericValue } from '../../utils/table-properties.js';
7
7
  /**
8
8
  * The table cell width command.
@@ -28,7 +28,7 @@ import { addDefaultUnitToNumericValue } from '../../utils/table-properties.js';
28
28
  *
29
29
  * will set the `width` attribute to `'50px'` in the model.
30
30
  */
31
- export default class TableCellWidthCommand extends TableCellPropertyCommand {
31
+ export class TableCellWidthCommand extends TableCellPropertyCommand {
32
32
  /**
33
33
  * Creates a new `TableCellWidthCommand` instance.
34
34
  *
@@ -6,14 +6,14 @@
6
6
  * @module table/tablecellwidth/tablecellwidthediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import TableEditing from './../tableediting.js';
9
+ import { TableEditing } from './../tableediting.js';
10
10
  /**
11
11
  * The table cell width editing feature.
12
12
  *
13
13
  * Introduces `tableCellWidth` table cell model attribute alongside with its converters
14
14
  * and a command.
15
15
  */
16
- export default class TableCellWidthEditing extends Plugin {
16
+ export declare class TableCellWidthEditing extends Plugin {
17
17
  /**
18
18
  * @inheritDoc
19
19
  */
@@ -6,8 +6,8 @@
6
6
  * @module table/tablecellwidth/tablecellwidthediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import TableEditing from './../tableediting.js';
10
- import TableCellWidthCommand from './commands/tablecellwidthcommand.js';
9
+ import { TableEditing } from './../tableediting.js';
10
+ import { TableCellWidthCommand } from './commands/tablecellwidthcommand.js';
11
11
  import { getNormalizedDefaultCellProperties } from '../utils/table-properties.js';
12
12
  import { enableProperty } from '../utils/common.js';
13
13
  /**
@@ -16,7 +16,7 @@ import { enableProperty } from '../utils/common.js';
16
16
  * Introduces `tableCellWidth` table cell model attribute alongside with its converters
17
17
  * and a command.
18
18
  */
19
- export default class TableCellWidthEditing extends Plugin {
19
+ export class TableCellWidthEditing extends Plugin {
20
20
  /**
21
21
  * @inheritDoc
22
22
  */
@@ -5,14 +5,14 @@
5
5
  import { ClipboardPipeline, ClipboardMarkersUtils } from 'ckeditor5/src/clipboard.js';
6
6
  import { Plugin } from 'ckeditor5/src/core.js';
7
7
  import type { DocumentFragment, Element, Item, Model, Position, Writer } from 'ckeditor5/src/engine.js';
8
- import TableSelection from './tableselection.js';
8
+ import { TableSelection } from './tableselection.js';
9
9
  import { type TableSlot } from './tablewalker.js';
10
- import TableUtils from './tableutils.js';
10
+ import { TableUtils } from './tableutils.js';
11
11
  /**
12
12
  * This plugin adds support for copying/cutting/pasting fragments of tables.
13
13
  * It is loaded automatically by the {@link module:table/table~Table} plugin.
14
14
  */
15
- export default class TableClipboard extends Plugin {
15
+ export declare class TableClipboard extends Plugin {
16
16
  /**
17
17
  * @inheritDoc
18
18
  */
@@ -4,15 +4,15 @@
4
4
  */
5
5
  import { ClipboardPipeline, ClipboardMarkersUtils } from 'ckeditor5/src/clipboard.js';
6
6
  import { Plugin } from 'ckeditor5/src/core.js';
7
- import TableSelection from './tableselection.js';
8
- import TableWalker from './tablewalker.js';
9
- import TableUtils from './tableutils.js';
7
+ import { TableSelection } from './tableselection.js';
8
+ import { TableWalker } from './tablewalker.js';
9
+ import { TableUtils } from './tableutils.js';
10
10
  import { cropTableToDimensions, getHorizontallyOverlappingCells, getVerticallyOverlappingCells, removeEmptyRowsColumns, splitHorizontally, splitVertically, trimTableCellIfNeeded, adjustLastRowIndex, adjustLastColumnIndex } from './utils/structure.js';
11
11
  /**
12
12
  * This plugin adds support for copying/cutting/pasting fragments of tables.
13
13
  * It is loaded automatically by the {@link module:table/table~Table} plugin.
14
14
  */
15
- export default class TableClipboard extends Plugin {
15
+ export class TableClipboard extends Plugin {
16
16
  /**
17
17
  * @inheritDoc
18
18
  */
@@ -6,7 +6,7 @@
6
6
  * @module table/tablecolumnresize/converters
7
7
  */
8
8
  import type { DowncastDispatcher, UpcastDispatcher } from 'ckeditor5/src/engine.js';
9
- import type TableUtils from '../tableutils.js';
9
+ import { type TableUtils } from '../tableutils.js';
10
10
  /**
11
11
  * Returns a upcast helper that ensures the number of `<tableColumn>` elements corresponds to the actual number of columns in the table,
12
12
  * because the input data might have too few or too many <col> elements.
@@ -16,3 +16,7 @@ export declare function upcastColgroupElement(tableUtilsPlugin: TableUtils): (di
16
16
  * Returns downcast helper for adding `ck-table-resized` class if there is a `<tableColumnGroup>` element inside the table.
17
17
  */
18
18
  export declare function downcastTableResizedClass(): (dispatcher: DowncastDispatcher) => void;
19
+ /**
20
+ * Returns a upcast helper that removes the `ck-table-resized` class from the table element.
21
+ */
22
+ export declare function upcastTableResizedClass(): (dispatcher: UpcastDispatcher) => void;
@@ -44,3 +44,13 @@ export function downcastTableResizedClass() {
44
44
  }
45
45
  }, { priority: 'low' });
46
46
  }
47
+ /**
48
+ * Returns a upcast helper that removes the `ck-table-resized` class from the table element.
49
+ */
50
+ export function upcastTableResizedClass() {
51
+ return (dispatcher) => {
52
+ dispatcher.on('element:table', (evt, data, conversionApi) => {
53
+ conversionApi.consumable.consume(data.viewItem, { classes: 'ck-table-resized' });
54
+ });
55
+ };
56
+ }
@@ -4,12 +4,12 @@
4
4
  */
5
5
  import { Plugin, type Editor } from 'ckeditor5/src/core.js';
6
6
  import type { Element } from 'ckeditor5/src/engine.js';
7
- import TableEditing from '../tableediting.js';
8
- import TableUtils from '../tableutils.js';
7
+ import { TableEditing } from '../tableediting.js';
8
+ import { TableUtils } from '../tableutils.js';
9
9
  /**
10
10
  * The table column resize editing plugin.
11
11
  */
12
- export default class TableColumnResizeEditing extends Plugin {
12
+ export declare class TableColumnResizeEditing extends Plugin {
13
13
  /**
14
14
  * A flag indicating if the column resizing is in progress.
15
15
  */
@@ -8,19 +8,19 @@
8
8
  import { throttle, isEqual } from 'es-toolkit/compat';
9
9
  import { global, DomEmitterMixin, Rect, toUnit } from 'ckeditor5/src/utils.js';
10
10
  import { Plugin } from 'ckeditor5/src/core.js';
11
- import MouseEventsObserver from '../../src/tablemouse/mouseeventsobserver.js';
12
- import TableEditing from '../tableediting.js';
13
- import TableUtils from '../tableutils.js';
14
- import TableWalker from '../tablewalker.js';
15
- import TableWidthsCommand from './tablewidthscommand.js';
16
- import { downcastTableResizedClass, upcastColgroupElement } from './converters.js';
11
+ import { MouseEventsObserver } from '../../src/tablemouse/mouseeventsobserver.js';
12
+ import { TableEditing } from '../tableediting.js';
13
+ import { TableUtils } from '../tableutils.js';
14
+ import { TableWalker } from '../tablewalker.js';
15
+ import { TableWidthsCommand } from './tablewidthscommand.js';
16
+ import { downcastTableResizedClass, upcastColgroupElement, upcastTableResizedClass } from './converters.js';
17
17
  import { clamp, createFilledArray, sumArray, getColumnEdgesIndexes, getChangedResizedTables, getColumnMinWidthAsPercentage, getElementWidthInPixels, getTableWidthInPixels, normalizeColumnWidths, toPrecision, getDomCellOuterWidth, updateColumnElements, getColumnGroupElement, getTableColumnElements, getTableColumnsWidths } from './utils.js';
18
18
  import { COLUMN_MIN_WIDTH_IN_PIXELS, COLUMN_RESIZE_DISTANCE_THRESHOLD } from './constants.js';
19
19
  const toPx = /* #__PURE__ */ toUnit('px');
20
20
  /**
21
21
  * The table column resize editing plugin.
22
22
  */
23
- export default class TableColumnResizeEditing extends Plugin {
23
+ export class TableColumnResizeEditing extends Plugin {
24
24
  /**
25
25
  * A flag indicating if the column resizing is in progress.
26
26
  */
@@ -144,18 +144,20 @@ export default class TableColumnResizeEditing extends Plugin {
144
144
  * Registers new attributes for a table model element.
145
145
  */
146
146
  _extendSchema() {
147
- this.editor.model.schema.extend('table', {
147
+ const schema = this.editor.model.schema;
148
+ schema.extend('table', {
148
149
  allowAttributes: ['tableWidth']
149
150
  });
150
- this.editor.model.schema.register('tableColumnGroup', {
151
+ schema.register('tableColumnGroup', {
151
152
  allowIn: 'table',
152
153
  isLimit: true
153
154
  });
154
- this.editor.model.schema.register('tableColumn', {
155
+ schema.register('tableColumn', {
155
156
  allowIn: 'tableColumnGroup',
156
157
  allowAttributes: ['columnWidth', 'colSpan'],
157
158
  isLimit: true
158
159
  });
160
+ schema.setAttributeProperties('columnWidth', { isFormatting: true });
159
161
  }
160
162
  /**
161
163
  * Registers table column resize post-fixer.
@@ -287,6 +289,7 @@ export default class TableColumnResizeEditing extends Plugin {
287
289
  conversion.elementToElement({ model: 'tableColumnGroup', view: 'colgroup' });
288
290
  conversion.elementToElement({ model: 'tableColumn', view: 'col' });
289
291
  conversion.for('downcast').add(downcastTableResizedClass());
292
+ conversion.for('upcast').add(upcastTableResizedClass());
290
293
  conversion.for('upcast').add(upcastColgroupElement(this._tableUtilsPlugin));
291
294
  conversion.for('upcast').attributeToAttribute({
292
295
  view: {
@@ -11,7 +11,7 @@ import { Command } from 'ckeditor5/src/core.js';
11
11
  * Command used by the {@link module:table/tablecolumnresize~TableColumnResize Table column resize feature} that
12
12
  * updates the width of the whole table as well as its individual columns.
13
13
  */
14
- export default class TableWidthsCommand extends Command {
14
+ export declare class TableWidthsCommand extends Command {
15
15
  /**
16
16
  * @inheritDoc
17
17
  */
@@ -8,7 +8,7 @@ import { normalizeColumnWidths } from './utils.js';
8
8
  * Command used by the {@link module:table/tablecolumnresize~TableColumnResize Table column resize feature} that
9
9
  * updates the width of the whole table as well as its individual columns.
10
10
  */
11
- export default class TableWidthsCommand extends Command {
11
+ export class TableWidthsCommand extends Command {
12
12
  /**
13
13
  * @inheritDoc
14
14
  */
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import type { Editor } from 'ckeditor5/src/core.js';
9
9
  import type { Element, Model, Writer } from 'ckeditor5/src/engine.js';
10
- import type TableUtils from '../tableutils.js';
10
+ import { type TableUtils } from '../tableutils.js';
11
11
  /**
12
12
  * Returns all the inserted or changed table model elements in a given change set. Only the tables
13
13
  * with 'columnsWidth' attribute are taken into account. The returned set may be empty.
@@ -193,8 +193,8 @@ export function sumArray(array) {
193
193
  */
194
194
  export function normalizeColumnWidths(columnWidths) {
195
195
  const widths = columnWidths.map(width => {
196
- if (width === 'auto') {
197
- return width;
196
+ if (width === 'auto' || width === undefined) {
197
+ return 'auto';
198
198
  }
199
199
  return parseFloat(width.replace('%', ''));
200
200
  });
@@ -6,15 +6,15 @@
6
6
  * @module table/tablecolumnresize
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import TableColumnResizeEditing from './tablecolumnresize/tablecolumnresizeediting.js';
10
- import TableCellWidthEditing from './tablecellwidth/tablecellwidthediting.js';
9
+ import { TableColumnResizeEditing } from './tablecolumnresize/tablecolumnresizeediting.js';
10
+ import { TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
11
11
  import '../theme/tablecolumnresize.css';
12
12
  /**
13
13
  * The table column resize feature.
14
14
  *
15
15
  * It provides the possibility to set the width of each column in a table using a resize handler.
16
16
  */
17
- export default class TableColumnResize extends Plugin {
17
+ export declare class TableColumnResize extends Plugin {
18
18
  /**
19
19
  * @inheritDoc
20
20
  */
@@ -6,15 +6,15 @@
6
6
  * @module table/tablecolumnresize
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import TableColumnResizeEditing from './tablecolumnresize/tablecolumnresizeediting.js';
10
- import TableCellWidthEditing from './tablecellwidth/tablecellwidthediting.js';
9
+ import { TableColumnResizeEditing } from './tablecolumnresize/tablecolumnresizeediting.js';
10
+ import { TableCellWidthEditing } from './tablecellwidth/tablecellwidthediting.js';
11
11
  import '../theme/tablecolumnresize.css';
12
12
  /**
13
13
  * The table column resize feature.
14
14
  *
15
15
  * It provides the possibility to set the width of each column in a table using a resize handler.
16
16
  */
17
- export default class TableColumnResize extends Plugin {
17
+ export class TableColumnResize extends Plugin {
18
18
  /**
19
19
  * @inheritDoc
20
20
  */
@@ -23,7 +23,7 @@ import type { ColorOption, ColorPickerConfig } from 'ckeditor5/src/ui.js';
23
23
  */
24
24
  export interface TableConfig {
25
25
  /**
26
- * Number of rows and columns to render by default as table heading when inserting new tables.
26
+ * Number of rows and columns to render by table heading when inserting new tables.
27
27
  *
28
28
  * You can configure it like this:
29
29
  *
@@ -7,12 +7,12 @@
7
7
  */
8
8
  import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
9
  import type { PositionOffset, SlotFilter } from 'ckeditor5/src/engine.js';
10
- import TableUtils from '../src/tableutils.js';
10
+ import { TableUtils } from '../src/tableutils.js';
11
11
  import '../theme/tableediting.css';
12
12
  /**
13
13
  * The table editing feature.
14
14
  */
15
- export default class TableEditing extends Plugin {
15
+ export declare class TableEditing extends Plugin {
16
16
  /**
17
17
  * Handlers for creating additional slots in the table.
18
18
  */
@@ -6,30 +6,30 @@
6
6
  * @module table/tableediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import upcastTable, { ensureParagraphInTableCell, skipEmptyTableRow, upcastTableFigure } from './converters/upcasttable.js';
9
+ import { upcastTable, ensureParagraphInTableCell, skipEmptyTableRow, upcastTableFigure } from './converters/upcasttable.js';
10
10
  import { convertParagraphInTableCell, downcastCell, downcastRow, downcastTable } from './converters/downcast.js';
11
- import InsertTableCommand from './commands/inserttablecommand.js';
12
- import InsertRowCommand from './commands/insertrowcommand.js';
13
- import InsertColumnCommand from './commands/insertcolumncommand.js';
14
- import SplitCellCommand from './commands/splitcellcommand.js';
15
- import MergeCellCommand from './commands/mergecellcommand.js';
16
- import RemoveRowCommand from './commands/removerowcommand.js';
17
- import RemoveColumnCommand from './commands/removecolumncommand.js';
18
- import SetHeaderRowCommand from './commands/setheaderrowcommand.js';
19
- import SetHeaderColumnCommand from './commands/setheadercolumncommand.js';
20
- import MergeCellsCommand from './commands/mergecellscommand.js';
21
- import SelectRowCommand from './commands/selectrowcommand.js';
22
- import SelectColumnCommand from './commands/selectcolumncommand.js';
23
- import TableUtils from '../src/tableutils.js';
24
- import injectTableLayoutPostFixer from './converters/table-layout-post-fixer.js';
25
- import injectTableCellParagraphPostFixer from './converters/table-cell-paragraph-post-fixer.js';
26
- import tableHeadingsRefreshHandler from './converters/table-headings-refresh-handler.js';
27
- import tableCellRefreshHandler from './converters/table-cell-refresh-handler.js';
11
+ import { InsertTableCommand } from './commands/inserttablecommand.js';
12
+ import { InsertRowCommand } from './commands/insertrowcommand.js';
13
+ import { InsertColumnCommand } from './commands/insertcolumncommand.js';
14
+ import { SplitCellCommand } from './commands/splitcellcommand.js';
15
+ import { MergeCellCommand } from './commands/mergecellcommand.js';
16
+ import { RemoveRowCommand } from './commands/removerowcommand.js';
17
+ import { RemoveColumnCommand } from './commands/removecolumncommand.js';
18
+ import { SetHeaderRowCommand } from './commands/setheaderrowcommand.js';
19
+ import { SetHeaderColumnCommand } from './commands/setheadercolumncommand.js';
20
+ import { MergeCellsCommand } from './commands/mergecellscommand.js';
21
+ import { SelectRowCommand } from './commands/selectrowcommand.js';
22
+ import { SelectColumnCommand } from './commands/selectcolumncommand.js';
23
+ import { TableUtils } from '../src/tableutils.js';
24
+ import { injectTableLayoutPostFixer } from './converters/table-layout-post-fixer.js';
25
+ import { injectTableCellParagraphPostFixer } from './converters/table-cell-paragraph-post-fixer.js';
26
+ import { tableHeadingsRefreshHandler } from './converters/table-headings-refresh-handler.js';
27
+ import { tableCellRefreshHandler } from './converters/table-cell-refresh-handler.js';
28
28
  import '../theme/tableediting.css';
29
29
  /**
30
30
  * The table editing feature.
31
31
  */
32
- export default class TableEditing extends Plugin {
32
+ export class TableEditing extends Plugin {
33
33
  /**
34
34
  * Handlers for creating additional slots in the table.
35
35
  */
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @module table/tablekeyboard
7
7
  */
8
- import TableSelection from './tableselection.js';
9
- import TableUtils from './tableutils.js';
8
+ import { TableSelection } from './tableselection.js';
9
+ import { TableUtils } from './tableutils.js';
10
10
  import { Plugin } from 'ckeditor5/src/core.js';
11
11
  import { type ArrowKeyCodeDirection } from 'ckeditor5/src/utils.js';
12
12
  import type { Element } from 'ckeditor5/src/engine.js';
@@ -14,7 +14,7 @@ import type { Element } from 'ckeditor5/src/engine.js';
14
14
  * This plugin enables keyboard navigation for tables.
15
15
  * It is loaded automatically by the {@link module:table/table~Table} plugin.
16
16
  */
17
- export default class TableKeyboard extends Plugin {
17
+ export declare class TableKeyboard extends Plugin {
18
18
  /**
19
19
  * @inheritDoc
20
20
  */
@@ -5,16 +5,16 @@
5
5
  /**
6
6
  * @module table/tablekeyboard
7
7
  */
8
- import TableSelection from './tableselection.js';
9
- import TableWalker from './tablewalker.js';
10
- import TableUtils from './tableutils.js';
8
+ import { TableSelection } from './tableselection.js';
9
+ import { TableWalker } from './tablewalker.js';
10
+ import { TableUtils } from './tableutils.js';
11
11
  import { Plugin } from 'ckeditor5/src/core.js';
12
12
  import { getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils.js';
13
13
  /**
14
14
  * This plugin enables keyboard navigation for tables.
15
15
  * It is loaded automatically by the {@link module:table/table~Table} plugin.
16
16
  */
17
- export default class TableKeyboard extends Plugin {
17
+ export class TableKeyboard extends Plugin {
18
18
  /**
19
19
  * @inheritDoc
20
20
  */
@@ -19,7 +19,7 @@ import type { TableType } from '../../tableconfig.js';
19
19
  * editor.execute( 'tableType', 'layout' );
20
20
  * ```
21
21
  */
22
- export default class TableTypeCommand extends Command {
22
+ export declare class TableTypeCommand extends Command {
23
23
  /**
24
24
  * The table type of selected table.
25
25
  *
@@ -19,7 +19,7 @@ import { getSelectionAffectedTable } from '../../utils/common.js';
19
19
  * editor.execute( 'tableType', 'layout' );
20
20
  * ```
21
21
  */
22
- export default class TableTypeCommand extends Command {
22
+ export class TableTypeCommand extends Command {
23
23
  /**
24
24
  * @inheritDoc
25
25
  */