@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,114 @@
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/tableproperties/tablepropertiesui
7
+ */
8
+ import { type Editor, Plugin } from 'ckeditor5/src/core.js';
9
+ import { ContextualBalloon } from 'ckeditor5/src/ui.js';
10
+ import TablePropertiesView from './ui/tablepropertiesview.js';
11
+ /**
12
+ * The table properties UI plugin. It introduces the `'tableProperties'` button
13
+ * that opens a form allowing to specify visual styling of an entire table.
14
+ *
15
+ * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.
16
+ */
17
+ export default class TablePropertiesUI extends Plugin {
18
+ /**
19
+ * The default table properties.
20
+ */
21
+ private _defaultTableProperties;
22
+ /**
23
+ * The contextual balloon plugin instance.
24
+ */
25
+ private _balloon;
26
+ /**
27
+ * The properties form view displayed inside the balloon.
28
+ */
29
+ view: TablePropertiesView | null;
30
+ /**
31
+ * The batch used to undo all changes made by the form (which are live, as the user types)
32
+ * when "Cancel" was pressed. Each time the view is shown, a new batch is created.
33
+ */
34
+ private _undoStepBatch?;
35
+ /**
36
+ * Flag used to indicate whether view is ready to execute update commands
37
+ * (it finished loading initial data).
38
+ */
39
+ private _isReady?;
40
+ /**
41
+ * @inheritDoc
42
+ */
43
+ static get requires(): readonly [typeof ContextualBalloon];
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ static get pluginName(): "TablePropertiesUI";
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ constructor(editor: Editor);
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ init(): void;
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ destroy(): void;
60
+ /**
61
+ * Creates the {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView} instance.
62
+ *
63
+ * @returns The table properties form view instance.
64
+ */
65
+ private _createPropertiesView;
66
+ /**
67
+ * In this method the "editor data -> UI" binding is happening.
68
+ *
69
+ * When executed, this method obtains selected table property values from various table commands
70
+ * and passes them to the {@link #view}.
71
+ *
72
+ * This way, the UI stays up–to–date with the editor data.
73
+ */
74
+ private _fillViewFormFromCommandValues;
75
+ /**
76
+ * Shows the {@link #view} in the {@link #_balloon}.
77
+ *
78
+ * **Note**: Each time a view is shown, the new {@link #_undoStepBatch} is created that contains
79
+ * all changes made to the document when the view is visible, allowing a single undo step
80
+ * for all of them.
81
+ */
82
+ protected _showView(): void;
83
+ /**
84
+ * Removes the {@link #view} from the {@link #_balloon}.
85
+ */
86
+ protected _hideView(): void;
87
+ /**
88
+ * Repositions the {@link #_balloon} or hides the {@link #view} if a table is no longer selected.
89
+ */
90
+ protected _updateView(): void;
91
+ /**
92
+ * Returns `true` when the {@link #view} is the visible in the {@link #_balloon}.
93
+ */
94
+ private get _isViewVisible();
95
+ /**
96
+ * Returns `true` when the {@link #view} is in the {@link #_balloon}.
97
+ */
98
+ private get _isViewInBalloon();
99
+ /**
100
+ * Creates a callback that when executed upon {@link #view view's} property change
101
+ * executes a related editor command with the new property value.
102
+ *
103
+ * If new value will be set to the default value, the command will not be executed.
104
+ *
105
+ * @param commandName The command that will be executed.
106
+ */
107
+ private _getPropertyChangeCallback;
108
+ /**
109
+ * Creates a callback that when executed upon {@link #view view's} property change:
110
+ * * executes a related editor command with the new property value if the value is valid,
111
+ * * or sets the error text next to the invalid field, if the value did not pass the validation.
112
+ */
113
+ private _getValidatedPropertyChangeCallback;
114
+ }
@@ -0,0 +1,207 @@
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/tableproperties/ui/tablepropertiesview
7
+ */
8
+ import { ButtonView, FocusCycler, LabeledFieldView, ToolbarView, View, ViewCollection, type DropdownView, type InputTextView, type NormalizedColorOption, type ColorPickerConfig, type FocusableView } from 'ckeditor5/src/ui.js';
9
+ import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
10
+ import '../../../theme/form.css';
11
+ import '../../../theme/tableform.css';
12
+ import '../../../theme/tableproperties.css';
13
+ import type ColorInputView from '../../ui/colorinputview.js';
14
+ import type { TablePropertiesOptions } from '../../tableconfig.js';
15
+ /**
16
+ * Additional configuration of the view.
17
+ */
18
+ export interface TablePropertiesViewOptions {
19
+ /**
20
+ * A configuration of the border color palette used by the
21
+ * {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView#borderColorInput}.
22
+ */
23
+ borderColors: Array<NormalizedColorOption>;
24
+ /**
25
+ * A configuration of the background color palette used by the
26
+ * {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView#backgroundInput}.
27
+ */
28
+ backgroundColors: Array<NormalizedColorOption>;
29
+ /**
30
+ * The default table properties.
31
+ */
32
+ defaultTableProperties: TablePropertiesOptions;
33
+ /**
34
+ * The default color picker config.
35
+ */
36
+ colorPickerConfig: false | ColorPickerConfig;
37
+ }
38
+ /**
39
+ * The class representing a table properties form, allowing users to customize
40
+ * certain style aspects of a table, for instance, border, background color, alignment, etc..
41
+ */
42
+ export default class TablePropertiesView extends View {
43
+ /**
44
+ * The value of the border style.
45
+ *
46
+ * @observable
47
+ * @default ''
48
+ */
49
+ borderStyle: string;
50
+ /**
51
+ * The value of the border width style.
52
+ *
53
+ * @observable
54
+ * @default ''
55
+ */
56
+ borderWidth: string;
57
+ /**
58
+ * The value of the border color style.
59
+ *
60
+ * @observable
61
+ * @default ''
62
+ */
63
+ borderColor: string;
64
+ /**
65
+ * The value of the background color style.
66
+ *
67
+ * @observable
68
+ * @default ''
69
+ */
70
+ backgroundColor: string;
71
+ /**
72
+ * The value of the table width style.
73
+ *
74
+ * @observable
75
+ * @default ''
76
+ */
77
+ width: string;
78
+ /**
79
+ * The value of the table height style.
80
+ *
81
+ * @observable
82
+ * @default ''
83
+ */
84
+ height: string;
85
+ /**
86
+ * The value of the table alignment style.
87
+ *
88
+ * @observable
89
+ * @default ''
90
+ */
91
+ alignment: string;
92
+ /**
93
+ * Options passed to the view. See {@link #constructor} to learn more.
94
+ */
95
+ readonly options: TablePropertiesViewOptions;
96
+ /**
97
+ * Tracks information about the DOM focus in the form.
98
+ */
99
+ readonly focusTracker: FocusTracker;
100
+ /**
101
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
102
+ */
103
+ readonly keystrokes: KeystrokeHandler;
104
+ /**
105
+ * A collection of child views in the form.
106
+ */
107
+ readonly children: ViewCollection;
108
+ /**
109
+ * A dropdown that allows selecting the style of the table border.
110
+ */
111
+ readonly borderStyleDropdown: LabeledFieldView<DropdownView>;
112
+ /**
113
+ * An input that allows specifying the width of the table border.
114
+ */
115
+ readonly borderWidthInput: LabeledFieldView<InputTextView>;
116
+ /**
117
+ * An input that allows specifying the color of the table border.
118
+ */
119
+ readonly borderColorInput: LabeledFieldView<ColorInputView>;
120
+ /**
121
+ * An input that allows specifying the table background color.
122
+ */
123
+ readonly backgroundInput: LabeledFieldView<ColorInputView>;
124
+ /**
125
+ * An input that allows specifying the table width.
126
+ */
127
+ readonly widthInput: LabeledFieldView<InputTextView>;
128
+ /**
129
+ * An input that allows specifying the table height.
130
+ */
131
+ readonly heightInput: LabeledFieldView<InputTextView>;
132
+ /**
133
+ * A toolbar with buttons that allow changing the alignment of an entire table.
134
+ */
135
+ readonly alignmentToolbar: ToolbarView;
136
+ /**
137
+ * The "Save" button view.
138
+ */
139
+ saveButtonView: ButtonView;
140
+ /**
141
+ * The "Cancel" button view.
142
+ */
143
+ cancelButtonView: ButtonView;
144
+ /**
145
+ * A collection of views that can be focused in the form.
146
+ */
147
+ protected readonly _focusables: ViewCollection<FocusableView>;
148
+ /**
149
+ * Helps cycling over {@link #_focusables} in the form.
150
+ */
151
+ protected readonly _focusCycler: FocusCycler;
152
+ /**
153
+ * @param locale The {@link module:core/editor/editor~Editor#locale} instance.
154
+ * @param options Additional configuration of the view.
155
+ */
156
+ constructor(locale: Locale, options: TablePropertiesViewOptions);
157
+ /**
158
+ * @inheritDoc
159
+ */
160
+ render(): void;
161
+ /**
162
+ * @inheritDoc
163
+ */
164
+ destroy(): void;
165
+ /**
166
+ * Focuses the fist focusable field in the form.
167
+ */
168
+ focus(): void;
169
+ /**
170
+ * Creates the following form fields:
171
+ *
172
+ * * {@link #borderStyleDropdown},
173
+ * * {@link #borderWidthInput},
174
+ * * {@link #borderColorInput}.
175
+ */
176
+ private _createBorderFields;
177
+ /**
178
+ * Creates the following form fields:
179
+ *
180
+ * * {@link #backgroundInput}.
181
+ */
182
+ private _createBackgroundFields;
183
+ /**
184
+ * Creates the following form fields:
185
+ *
186
+ * * {@link #widthInput},
187
+ * * {@link #heightInput}.
188
+ */
189
+ private _createDimensionFields;
190
+ /**
191
+ * Creates the following form fields:
192
+ *
193
+ * * {@link #alignmentToolbar}.
194
+ */
195
+ private _createAlignmentFields;
196
+ /**
197
+ * Creates the following form controls:
198
+ *
199
+ * * {@link #saveButtonView},
200
+ * * {@link #cancelButtonView}.
201
+ */
202
+ private _createActionButtons;
203
+ /**
204
+ * Provides localized labels for {@link #alignmentToolbar} buttons.
205
+ */
206
+ private get _alignmentLabels();
207
+ }
@@ -0,0 +1,30 @@
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/tableproperties
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import TablePropertiesEditing from './tableproperties/tablepropertiesediting.js';
10
+ import TablePropertiesUI from './tableproperties/tablepropertiesui.js';
11
+ /**
12
+ * The table properties feature. Enables support for setting properties of tables (size, border, background, etc.).
13
+ *
14
+ * Read more in the {@glink features/tables/tables-styling Table and cell styling tools} section.
15
+ * See also the {@link module:table/tablecellproperties~TableCellProperties} plugin.
16
+ *
17
+ * This is a "glue" plugin that loads the
18
+ * {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing table properties editing feature} and
19
+ * the {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI table properties UI feature}.
20
+ */
21
+ export default class TableProperties extends Plugin {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get pluginName(): "TableProperties";
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get requires(): readonly [typeof TablePropertiesEditing, typeof TablePropertiesUI];
30
+ }
@@ -0,0 +1,107 @@
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/tableselection
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import type { Element, DocumentFragment } from 'ckeditor5/src/engine.js';
10
+ import TableUtils from './tableutils.js';
11
+ import '../theme/tableselection.css';
12
+ /**
13
+ * This plugin enables the advanced table cells, rows and columns selection.
14
+ * It is loaded automatically by the {@link module:table/table~Table} plugin.
15
+ */
16
+ export default class TableSelection extends Plugin {
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName(): "TableSelection";
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires(): readonly [typeof TableUtils, typeof TableUtils];
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ init(): void;
29
+ /**
30
+ * Returns the currently selected table cells or `null` if it is not a table cells selection.
31
+ */
32
+ getSelectedTableCells(): Array<Element> | null;
33
+ /**
34
+ * Returns the selected table fragment as a document fragment.
35
+ */
36
+ getSelectionAsFragment(): DocumentFragment | null;
37
+ /**
38
+ * Sets the model selection based on given anchor and target cells (can be the same cell).
39
+ * Takes care of setting the backward flag.
40
+ *
41
+ * ```ts
42
+ * const modelRoot = editor.model.document.getRoot();
43
+ * const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );
44
+ * const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );
45
+ *
46
+ * const tableSelection = editor.plugins.get( 'TableSelection' );
47
+ * tableSelection.setCellSelection( firstCell, lastCell );
48
+ * ```
49
+ */
50
+ setCellSelection(anchorCell: Element, targetCell: Element): void;
51
+ /**
52
+ * Returns the focus cell from the current selection.
53
+ */
54
+ getFocusCell(): Element | null;
55
+ /**
56
+ * Returns the anchor cell from the current selection.
57
+ */
58
+ getAnchorCell(): Element | null;
59
+ /**
60
+ * Defines a selection converter which marks the selected cells with a specific class.
61
+ *
62
+ * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the
63
+ * selection is backward or not, the last cell will usually be close to the "focus" end of the selection
64
+ * (a selection has anchor and focus).
65
+ *
66
+ * The real DOM selection is then hidden with CSS.
67
+ */
68
+ private _defineSelectionConverter;
69
+ /**
70
+ * Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,
71
+ * it collapses the multi-cell selection to a regular selection placed inside a table cell.
72
+ *
73
+ * This listener helps features that disable the table selection plugin bring the selection
74
+ * to a clear state they can work with (for instance, because they don't support multiple cell selection).
75
+ */
76
+ private _enablePluginDisabling;
77
+ /**
78
+ * Overrides the default `model.deleteContent()` behavior over a selected table fragment.
79
+ *
80
+ * @param args Delete content method arguments.
81
+ */
82
+ private _handleDeleteContent;
83
+ /**
84
+ * This handler makes it possible to remove the content of all selected cells by starting to type.
85
+ * If you take a look at {@link #_defineSelectionConverter} you will find out that despite the multi-cell selection being set
86
+ * in the model, the view selection is collapsed in the last cell (because most browsers are unable to render multi-cell selections;
87
+ * yes, it's a hack).
88
+ *
89
+ * When multiple cells are selected in the model and the user starts to type, the
90
+ * {@link module:engine/view/document~Document#event:insertText} event carries information provided by the
91
+ * beforeinput DOM event, that in turn only knows about this collapsed DOM selection in the last cell.
92
+ *
93
+ * As a result, the selected cells have no chance to be cleaned up. To fix this, this listener intercepts
94
+ * the event and injects the custom view selection in the data that translates correctly to the actual state
95
+ * of the multi-cell selection in the model.
96
+ *
97
+ * @param data Insert text event data.
98
+ */
99
+ private _handleInsertTextEvent;
100
+ /**
101
+ * Returns an array of table cells that should be selected based on the
102
+ * given anchor cell and target (focus) cell.
103
+ *
104
+ * The cells are returned in a reverse direction if the selection is backward.
105
+ */
106
+ private _getCellsToSelect;
107
+ }
@@ -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/tabletoolbar
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { WidgetToolbarRepository } from 'ckeditor5/src/widget.js';
10
+ /**
11
+ * The table toolbar class. It creates toolbars for the table feature and its content (for now only for the table cell content).
12
+ *
13
+ * The table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the
14
+ * {@link module:table/tableconfig~TableConfig#tableToolbar `table.tableToolbar` configuration option}.
15
+ *
16
+ * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the
17
+ * {@link module:table/tableconfig~TableConfig#contentToolbar `table.contentToolbar` configuration option}.
18
+ */
19
+ export default class TableToolbar extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get requires(): readonly [typeof WidgetToolbarRepository];
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName(): "TableToolbar";
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ afterInit(): void;
32
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module table/tableui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ /**
10
+ * The table UI plugin. It introduces:
11
+ *
12
+ * * The `'insertTable'` dropdown,
13
+ * * The `'tableColumn'` dropdown,
14
+ * * The `'tableRow'` dropdown,
15
+ * * The `'mergeTableCells'` split button.
16
+ *
17
+ * The `'tableColumn'`, `'tableRow'` and `'mergeTableCells'` dropdowns work best with {@link module:table/tabletoolbar~TableToolbar}.
18
+ */
19
+ export default class TableUI extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get pluginName(): "TableUI";
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ init(): void;
28
+ /**
29
+ * Creates a dropdown view from a set of options.
30
+ *
31
+ * @param label The dropdown button label.
32
+ * @param icon An icon for the dropdown button.
33
+ * @param options The list of options for the dropdown.
34
+ */
35
+ private _prepareDropdown;
36
+ /**
37
+ * Creates a dropdown view with a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} for
38
+ * merge (and split)–related commands.
39
+ *
40
+ * @param label The dropdown button label.
41
+ * @param icon An icon for the dropdown button.
42
+ * @param options The list of options for the dropdown.
43
+ */
44
+ private _prepareMergeSplitButtonDropdown;
45
+ /**
46
+ * Injects a {@link module:ui/list/listview~ListView} into the passed dropdown with buttons
47
+ * which execute editor commands as configured in passed options.
48
+ *
49
+ * @param options The list of options for the dropdown.
50
+ * @returns Commands the list options are interacting with.
51
+ */
52
+ private _fillDropdownWithListOptions;
53
+ }