@ckeditor/ckeditor5-table 48.3.1 → 48.4.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.
- package/ckeditor5-metadata.json +12 -1
- package/dist/augmentation.d.ts +4 -1
- package/dist/commands/inserttablecommand.d.ts +5 -0
- package/dist/commands/inserttablelayoutcommand.d.ts +5 -0
- package/dist/commands/splitcellcommand.d.ts +2 -1
- package/dist/index-content.css +81 -82
- package/dist/index-content.css.map +1 -0
- package/dist/index-editor.css +537 -450
- package/dist/index-editor.css.map +1 -0
- package/dist/index.css +214 -125
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +908 -60
- package/dist/index.js.map +1 -1
- package/dist/table.d.ts +0 -1
- package/dist/tablecaption.d.ts +0 -1
- package/dist/tablecellproperties/tablecellpropertiesui.d.ts +7 -0
- package/dist/tablecellproperties/ui/tablecellpropertiesview.d.ts +0 -3
- package/dist/tablecolumnresize/commands/tablecolumnwidthcommand.d.ts +56 -0
- package/dist/tablecolumnresize/constants.d.ts +15 -0
- package/dist/tablecolumnresize/tablecolumnresizeediting.d.ts +81 -2
- package/dist/tablecolumnresize/utils.d.ts +30 -0
- package/dist/tablecolumnresize.d.ts +0 -1
- package/dist/tableconfig.d.ts +38 -0
- package/dist/tableediting.d.ts +0 -1
- package/dist/tablelayout/tablelayoutediting.d.ts +0 -1
- package/dist/tableproperties/ui/tablepropertiesview.d.ts +0 -3
- package/dist/tablescroll/tablescrollediting.d.ts +82 -0
- package/dist/tablescroll/watchers.d.ts +23 -0
- package/dist/tablescroll.d.ts +23 -0
- package/dist/tableselection.d.ts +0 -1
- package/dist/ui/colorinputview.d.ts +0 -1
- package/dist/ui/inserttableview.d.ts +0 -1
- package/dist/utils/common.d.ts +6 -0
- package/package.json +10 -9
package/dist/table.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ import { TableSelection } from "./tableselection.js";
|
|
|
13
13
|
import { TableClipboard } from "./tableclipboard.js";
|
|
14
14
|
import { TableKeyboard } from "./tablekeyboard.js";
|
|
15
15
|
import { TableMouse } from "./tablemouse.js";
|
|
16
|
-
import "../theme/table.css";
|
|
17
16
|
/**
|
|
18
17
|
* The table plugin.
|
|
19
18
|
*
|
package/dist/tablecaption.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
import { TableCaptionEditing } from "./tablecaption/tablecaptionediting.js";
|
|
10
10
|
import { TableCaptionUI } from "./tablecaption/tablecaptionui.js";
|
|
11
|
-
import "../theme/tablecaption.css";
|
|
12
11
|
/**
|
|
13
12
|
* The table caption plugin.
|
|
14
13
|
*/
|
|
@@ -125,4 +125,11 @@ export declare class TableCellPropertiesUI extends Plugin {
|
|
|
125
125
|
* * Or sets the error text next to the invalid field, if the value did not pass the validation.
|
|
126
126
|
*/
|
|
127
127
|
private _getValidatedPropertyChangeCallback;
|
|
128
|
+
/**
|
|
129
|
+
* Returns the command that drives the width field. When the table is resized and the selection maps onto a single
|
|
130
|
+
* column, the width field is bound to (and executes) the `'tableColumnWidth'` command, so the width applies to the
|
|
131
|
+
* column instead of being set as a per-cell width that the column group would shadow. Otherwise it falls back to
|
|
132
|
+
* the `'tableCellWidth'` command.
|
|
133
|
+
*/
|
|
134
|
+
private _getWidthCommandName;
|
|
128
135
|
}
|
|
@@ -9,9 +9,6 @@ import { ButtonView, FocusCycler, LabeledFieldView, ToolbarView, View, ViewColle
|
|
|
9
9
|
import { KeystrokeHandler, FocusTracker, type Locale } from "@ckeditor/ckeditor5-utils";
|
|
10
10
|
import { type ColorInputView } from "../../ui/colorinputview.js";
|
|
11
11
|
import type { TableCellPropertiesOptions } from "../../tableconfig.js";
|
|
12
|
-
import "../../../theme/formrow.css";
|
|
13
|
-
import "../../../theme/tableform.css";
|
|
14
|
-
import "../../../theme/tablecellproperties.css";
|
|
15
12
|
export interface TableCellPropertiesViewOptions {
|
|
16
13
|
borderColors: Array<NormalizedColorOption>;
|
|
17
14
|
backgroundColors: Array<NormalizedColorOption>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tablecolumnresize/commands/tablecolumnwidthcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { Batch } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
/**
|
|
11
|
+
* The table column width command.
|
|
12
|
+
*
|
|
13
|
+
* The command is registered by the {@link module:table/tablecolumnresize/tablecolumnresizeediting~TableColumnResizeEditing}
|
|
14
|
+
* as the `'tableColumnWidth'` editor command.
|
|
15
|
+
*
|
|
16
|
+
* It sets the width of every column covered by the selected cells (keeping the whole table's width mode consistent),
|
|
17
|
+
* so the change actually takes effect in a resized table - where a per-cell width would be shadowed by the column
|
|
18
|
+
* group. The command is enabled whenever the selection maps onto the columns of a resized, regular table.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* editor.execute( 'tableColumnWidth', {
|
|
22
|
+
* value: '150px'
|
|
23
|
+
* } );
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* **Note**: This command adds a default `'px'` unit to numeric values. Executing:
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* editor.execute( 'tableColumnWidth', {
|
|
30
|
+
* value: '150'
|
|
31
|
+
* } );
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* will set the column width to `'150px'`.
|
|
35
|
+
*/
|
|
36
|
+
export declare class TableColumnWidthCommand extends Command {
|
|
37
|
+
/**
|
|
38
|
+
* The width of the first column covered by the selection, or `null` when the selection does not map onto table
|
|
39
|
+
* columns (for example when there is no cell selected or the table is not resized).
|
|
40
|
+
*
|
|
41
|
+
* @readonly
|
|
42
|
+
* @observable
|
|
43
|
+
*/
|
|
44
|
+
value: string | null;
|
|
45
|
+
/**
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
override refresh(): void;
|
|
49
|
+
/**
|
|
50
|
+
* @inheritDoc
|
|
51
|
+
*/
|
|
52
|
+
override execute(options?: {
|
|
53
|
+
value?: string | number;
|
|
54
|
+
batch?: Batch;
|
|
55
|
+
}): void;
|
|
56
|
+
}
|
|
@@ -31,3 +31,18 @@ export declare const COLUMN_WIDTH_PRECISION = 2;
|
|
|
31
31
|
* @internal
|
|
32
32
|
*/
|
|
33
33
|
export declare const COLUMN_RESIZE_DISTANCE_THRESHOLD = 3;
|
|
34
|
+
/**
|
|
35
|
+
* The distance (in pixels) around the container's width within which a dragged table edge snaps to exactly
|
|
36
|
+
* 100% of the container width, in either direction - making it easy to precisely land on that value.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare const TABLE_WIDTH_SNAP_THRESHOLD_IN_PIXELS = 5;
|
|
41
|
+
/**
|
|
42
|
+
* How much further (in pixels, on top of the snap threshold above) a table edge has to be dragged past the
|
|
43
|
+
* container's width before it actually starts growing past 100% again. This is what makes 100% "sticky" -
|
|
44
|
+
* while still letting the table grow past it with a deliberate, longer drag.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare const TABLE_WIDTH_GROWTH_RESISTANCE_IN_PIXELS = 10;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
6
|
-
import type { ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
6
|
+
import type { ViewDowncastWriter, ModelElement, ModelWriter, ViewElement } from "@ckeditor/ckeditor5-engine";
|
|
7
7
|
import { TableEditing } from "../tableediting.js";
|
|
8
8
|
import { TableUtils } from "../tableutils.js";
|
|
9
9
|
/**
|
|
@@ -12,8 +12,11 @@ import { TableUtils } from "../tableutils.js";
|
|
|
12
12
|
export declare class TableColumnResizeEditing extends Plugin {
|
|
13
13
|
/**
|
|
14
14
|
* A flag indicating if the column resizing is in progress.
|
|
15
|
+
*
|
|
16
|
+
* @observable
|
|
17
|
+
* @internal
|
|
15
18
|
*/
|
|
16
|
-
|
|
19
|
+
_isResizingActive: boolean;
|
|
17
20
|
/**
|
|
18
21
|
* A flag indicating if the column resizing is allowed. It is not allowed if the editor is in read-only
|
|
19
22
|
* or comments-only mode or the `TableColumnResize` plugin is disabled.
|
|
@@ -71,8 +74,17 @@ export declare class TableColumnResizeEditing extends Plugin {
|
|
|
71
74
|
/**
|
|
72
75
|
* @inheritDoc
|
|
73
76
|
*/
|
|
77
|
+
afterInit(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @inheritDoc
|
|
80
|
+
*/
|
|
74
81
|
override destroy(): void;
|
|
75
82
|
/**
|
|
83
|
+
* The table for which a column resize is currently in progress, or `null` if no resize is active.
|
|
84
|
+
* Only one table can be resized at a time.
|
|
85
|
+
*/
|
|
86
|
+
get resizingTable(): ModelElement | null;
|
|
87
|
+
/**
|
|
76
88
|
* Returns a 'tableColumnGroup' element from the 'table'.
|
|
77
89
|
*
|
|
78
90
|
* @param element A 'table' or 'tableColumnGroup' element.
|
|
@@ -94,6 +106,59 @@ export declare class TableColumnResizeEditing extends Plugin {
|
|
|
94
106
|
*/
|
|
95
107
|
getTableColumnsWidths(element: ModelElement): Array<string>;
|
|
96
108
|
/**
|
|
109
|
+
* Returns the table and the sorted, unique indexes of the columns covered by the given cells (a `colspan` cell
|
|
110
|
+
* covers several columns). Returns `null` when the selection cannot be mapped onto columns - a non-resized table
|
|
111
|
+
* or an irregular column structure.
|
|
112
|
+
*
|
|
113
|
+
* @param cells An array of 'tableCell' model elements.
|
|
114
|
+
*/
|
|
115
|
+
getColumnIndexesForCells(cells: Array<ModelElement>): {
|
|
116
|
+
table: ModelElement;
|
|
117
|
+
columnIndexes: Array<number>;
|
|
118
|
+
} | null;
|
|
119
|
+
/**
|
|
120
|
+
* Applies the given width to every column in `columnIndexes`, keeping the whole table's width mode consistent
|
|
121
|
+
* (see {@link module:table/tablecolumnresize/utils~isTableWidthInPixels}).
|
|
122
|
+
*
|
|
123
|
+
* @param writer A model writer instance.
|
|
124
|
+
* @param table A 'table' model element.
|
|
125
|
+
* @param columnIndexes Indexes of the columns the width is applied to.
|
|
126
|
+
* @param value The width to apply. May be expressed in pixels or as a percentage.
|
|
127
|
+
*/
|
|
128
|
+
applyColumnWidths(writer: ModelWriter, table: ModelElement, columnIndexes: Array<number>, value: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Converts the column widths of a resized table to the unit of the table's own width (`px` or `%`), so a table
|
|
131
|
+
* width change (in the table properties) also switches the columns' unit. It is a no-op when the table is not
|
|
132
|
+
* resized or the columns already use that unit.
|
|
133
|
+
*/
|
|
134
|
+
private _reconcileColumnUnits;
|
|
135
|
+
/**
|
|
136
|
+
* Applies a column width in the percentage mode: the target column gets the (clamped) percentage and the remaining
|
|
137
|
+
* columns are redistributed proportionally so that all the widths keep summing up to 100%.
|
|
138
|
+
*/
|
|
139
|
+
private _applyPercentageColumnWidths;
|
|
140
|
+
/**
|
|
141
|
+
* Applies a width to the target columns in the percentage mode when the selection reaches the last column. As
|
|
142
|
+
* there is no next column to balance against, the table itself grows or shrinks (like dragging the last column's
|
|
143
|
+
* right edge): every other column keeps its absolute width, so expressed against the resized table their
|
|
144
|
+
* percentages scale, and the table's own width scales by the inverse.
|
|
145
|
+
*/
|
|
146
|
+
private _growTableToColumnWidths;
|
|
147
|
+
/**
|
|
148
|
+
* Applies `width` to whichever element currently represents the table's actual width - by default the
|
|
149
|
+
* widget's `<figure>`. Passing `null` clears it instead of setting anything.
|
|
150
|
+
*
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
_setResizingTableWidth(writer: ViewDowncastWriter, viewFigure: ViewElement, width: string | null): void;
|
|
154
|
+
/**
|
|
155
|
+
* Returns the table's current actual width, read from whichever element holds it - by default the
|
|
156
|
+
* widget's `<figure>`.
|
|
157
|
+
*
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
_getResizingTableWidth(viewFigure: ViewElement): string;
|
|
161
|
+
/**
|
|
97
162
|
* Registers new attributes for a table model element.
|
|
98
163
|
*/
|
|
99
164
|
private _extendSchema;
|
|
@@ -186,3 +251,17 @@ export declare class TableColumnResizeEditing extends Plugin {
|
|
|
186
251
|
*/
|
|
187
252
|
private _registerResizerInserter;
|
|
188
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Given the table width a drag would naturally produce, returns the width that should actually be applied
|
|
256
|
+
* once snapping and growth resistance around the container's width are taken into account:
|
|
257
|
+
*
|
|
258
|
+
* * if the natural width lands close to the container's width (on either side), it's pulled to exactly
|
|
259
|
+
* match it,
|
|
260
|
+
* * if the natural width is past the container's width, it stays pinned at the container's width until the
|
|
261
|
+
* drag has gone far enough beyond it (the "resistance" zone) - past that point it keeps growing 1:1,
|
|
262
|
+
* continuing smoothly from where the resistance was overcome instead of jumping,
|
|
263
|
+
* * shrinking below the container's width is never resisted, only snapped when close.
|
|
264
|
+
*
|
|
265
|
+
* @internal
|
|
266
|
+
*/
|
|
267
|
+
export declare function applyContainerWidthResistance(naturalTableWidth: number, containerWidth: number): number;
|
|
@@ -46,6 +46,13 @@ export declare function getTableWidthInPixels(modelTable: ModelElement, editor:
|
|
|
46
46
|
*/
|
|
47
47
|
export declare function getElementWidthInPixels(domElement: HTMLElement): number;
|
|
48
48
|
/**
|
|
49
|
+
* Returns the inner pixel width of a given editing root, or `null` if the root has no
|
|
50
|
+
* DOM element attached yet (e.g. it hasn't been rendered for the first time).
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
export declare function getEditableWidth(editor: Editor, rootName: string): number | null;
|
|
55
|
+
/**
|
|
49
56
|
* Returns the column indexes on the left and right edges of a cell. They differ if the cell spans
|
|
50
57
|
* across multiple columns.
|
|
51
58
|
*
|
|
@@ -150,6 +157,21 @@ export declare function getTableColumnElements(element: ModelElement): Array<Mod
|
|
|
150
157
|
*/
|
|
151
158
|
export declare function getTableColumnsWidths(element: ModelElement): Array<string>;
|
|
152
159
|
/**
|
|
160
|
+
* Tells whether a table is in the pixel width mode, that is, its `tableWidth` attribute is expressed in pixels.
|
|
161
|
+
* The `tableWidth` unit is the single source of truth for the whole table's width mode.
|
|
162
|
+
*
|
|
163
|
+
* @internal
|
|
164
|
+
* @param table A 'table' model element.
|
|
165
|
+
*/
|
|
166
|
+
export declare function isTableWidthInPixels(table: ModelElement): boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Tells whether the given column widths are expressed in pixels.
|
|
169
|
+
*
|
|
170
|
+
* @internal
|
|
171
|
+
* @param columnWidths An array of column widths.
|
|
172
|
+
*/
|
|
173
|
+
export declare function isColumnWidthsInPixels(columnWidths: Array<string>): boolean;
|
|
174
|
+
/**
|
|
153
175
|
* Translates the `colSpan` model attribute into additional column widths and returns the resulting array.
|
|
154
176
|
*
|
|
155
177
|
* @internal
|
|
@@ -158,3 +180,11 @@ export declare function getTableColumnsWidths(element: ModelElement): Array<stri
|
|
|
158
180
|
* @returns An array of table column widths.
|
|
159
181
|
*/
|
|
160
182
|
export declare function translateColSpanAttribute(element: ModelElement, writer: ModelWriter): Array<string>;
|
|
183
|
+
/**
|
|
184
|
+
* Removes the `tableCellWidth` attribute from every cell of the given table. Once a column is resized (with the resize
|
|
185
|
+
* handler or the column-width command), a per-cell width is obsolete - the column width governs the layout - so it is
|
|
186
|
+
* dropped to keep the model clean.
|
|
187
|
+
*
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
export declare function removeCellWidthsFromTable(writer: ModelWriter, table: ModelElement): void;
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
import { TableColumnResizeEditing } from "./tablecolumnresize/tablecolumnresizeediting.js";
|
|
10
10
|
import { TableCellWidthEditing } from "./tablecellwidth/tablecellwidthediting.js";
|
|
11
|
-
import "../theme/tablecolumnresize.css";
|
|
12
11
|
/**
|
|
13
12
|
* The table column resize feature.
|
|
14
13
|
*
|
package/dist/tableconfig.d.ts
CHANGED
|
@@ -246,6 +246,16 @@ export interface TableConfig {
|
|
|
246
246
|
*/
|
|
247
247
|
tableCaption?: TableCaptionConfig;
|
|
248
248
|
/**
|
|
249
|
+
* Configuration of the table scroll feature.
|
|
250
|
+
*
|
|
251
|
+
* ```ts
|
|
252
|
+
* const tableConfig = {
|
|
253
|
+
* tableScroll: ... // Table scroll feature config.
|
|
254
|
+
* };
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
tableScroll?: TableScrollConfig;
|
|
258
|
+
/**
|
|
249
259
|
* When set to `true` (default), the editor visually displays dashed borders around table elements (`<table>`, `<td>`, `<th>`)
|
|
250
260
|
* that contain inline styles explicitly removing borders (for example: `border: none`, `border-top-style: none`, etc.).
|
|
251
261
|
*
|
|
@@ -682,6 +692,34 @@ export interface TableCaptionConfig {
|
|
|
682
692
|
useCaptionElement?: boolean;
|
|
683
693
|
}
|
|
684
694
|
/**
|
|
695
|
+
* The configuration of the table scroll feature.
|
|
696
|
+
*/
|
|
697
|
+
export interface TableScrollConfig {
|
|
698
|
+
/**
|
|
699
|
+
* The list of table types for which a table that is wider than its container is allowed to become
|
|
700
|
+
* horizontally scrollable, and for which the column resize handle is allowed to drag the table's width
|
|
701
|
+
* past 100% of the container width.
|
|
702
|
+
*
|
|
703
|
+
* By default, only `'content'` tables are scrollable. Layout tables are not included by default, since
|
|
704
|
+
* letting a layout table grow past the container width can easily break the intended page layout - to
|
|
705
|
+
* allow it anyway, add `'layout'` to the list:
|
|
706
|
+
*
|
|
707
|
+
* ```ts
|
|
708
|
+
* const tableConfig = {
|
|
709
|
+
* tableScroll: {
|
|
710
|
+
* tableTypes: [ 'content', 'layout' ]
|
|
711
|
+
* }
|
|
712
|
+
* };
|
|
713
|
+
* ```
|
|
714
|
+
*
|
|
715
|
+
* Note that regardless of this setting, only a table that is a direct child of the editing root can become
|
|
716
|
+
* scrollable - a table nested inside another table, a block quote, or any other container never scrolls.
|
|
717
|
+
*
|
|
718
|
+
* @default [ 'content' ]
|
|
719
|
+
*/
|
|
720
|
+
tableTypes?: Array<TableType>;
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
685
723
|
* The type of the table.
|
|
686
724
|
*/
|
|
687
725
|
export type TableType = "content" | "layout";
|
package/dist/tableediting.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
import type { ModelPositionOffset, DowncastSlotFilter } from "@ckeditor/ckeditor5-engine";
|
|
10
10
|
import { TableUtils } from "./tableutils.js";
|
|
11
|
-
import "../theme/tableediting.css";
|
|
12
11
|
/**
|
|
13
12
|
* The table editing feature.
|
|
14
13
|
*/
|
|
@@ -9,9 +9,6 @@ import { ButtonView, FocusCycler, LabeledFieldView, ToolbarView, View, ViewColle
|
|
|
9
9
|
import { FocusTracker, KeystrokeHandler, type Locale } from "@ckeditor/ckeditor5-utils";
|
|
10
10
|
import { type ColorInputView } from "../../ui/colorinputview.js";
|
|
11
11
|
import type { TablePropertiesOptions } from "../../tableconfig.js";
|
|
12
|
-
import "../../../theme/formrow.css";
|
|
13
|
-
import "../../../theme/tableform.css";
|
|
14
|
-
import "../../../theme/tableproperties.css";
|
|
15
12
|
/**
|
|
16
13
|
* Additional configuration of the view.
|
|
17
14
|
*/
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import type { ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
7
|
+
import { TableEditing } from "../tableediting.js";
|
|
8
|
+
/**
|
|
9
|
+
* The table scrolling editing plugin.
|
|
10
|
+
*/
|
|
11
|
+
export declare class TableScrollEditing extends Plugin {
|
|
12
|
+
/**
|
|
13
|
+
* Used to listen to native DOM events.
|
|
14
|
+
*/
|
|
15
|
+
private _domEmitter;
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "TableScrollEditing";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static override get isOfficialPlugin(): true;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): PluginDependenciesOf<[TableEditing]>;
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
constructor(editor: Editor);
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
init(): void;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
override destroy(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Whether a given table may overflow its container and become horizontally scrollable, and whether
|
|
42
|
+
* column/table resizing is allowed to grow it past the container's width.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
_isTableScrollable(table: ModelElement): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Determines whether a table overflows its container and applies the corresponding view state:
|
|
49
|
+
* the `ck-table-overflowing` class on the figure, and the actual (possibly container-exceeding)
|
|
50
|
+
* width on the inner `<table>` and a sibling `<figcaption>`, if present.
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
_updateTableScrollOverflowState(table: ModelElement, tableWidthOverride?: string | null): void;
|
|
55
|
+
/**
|
|
56
|
+
* Schedules a re-read of the widget figure's actual `scrollLeft` into `--ck-table-scroll-offset`, once
|
|
57
|
+
* the render reflecting the change that triggered it has actually happened - see the call site for why
|
|
58
|
+
* this can't just read (and force a reflow for) `scrollLeft` immediately instead.
|
|
59
|
+
*/
|
|
60
|
+
private _scheduleScrollOffsetSync;
|
|
61
|
+
/**
|
|
62
|
+
* Registers editing-only downcast listeners that keep overflow state in sync.
|
|
63
|
+
*/
|
|
64
|
+
private _registerConversion;
|
|
65
|
+
/**
|
|
66
|
+
* Keeps every overflowing table's `--ck-table-scroll-offset` custom property in sync with its
|
|
67
|
+
* `scrollLeft`, using a single delegated listener instead of one native listener per table.
|
|
68
|
+
*/
|
|
69
|
+
private _watchFiguresScroll;
|
|
70
|
+
/**
|
|
71
|
+
* Listen for column resize events and updates proper view element size.
|
|
72
|
+
*/
|
|
73
|
+
private _watchColumnResize;
|
|
74
|
+
/**
|
|
75
|
+
* Re-evaluates the overflow state of every table whenever the window or an editing root is resized.
|
|
76
|
+
*/
|
|
77
|
+
private _watchRootEditables;
|
|
78
|
+
/**
|
|
79
|
+
* Evaluates the overflow state of every newly inserted table.
|
|
80
|
+
*/
|
|
81
|
+
private _watchNewTables;
|
|
82
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tablescroll/watchers
|
|
7
|
+
*/
|
|
8
|
+
import { Collection } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import type { EditingView, Model, ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
/**
|
|
11
|
+
* Creates a live collection of all `table` model elements present in the document and keeps it
|
|
12
|
+
* up to date as tables are inserted, moved, or removed.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare function watchTableModelElements(model: Model): Collection<ModelElement>;
|
|
17
|
+
/**
|
|
18
|
+
* Observes the DOM width of every editing root and calls `onResize` whenever any of them changes width.
|
|
19
|
+
* Height-only changes are ignored, since only a root's width can make a table overflow it.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function watchRootsWidthResize(view: EditingView, onResize: () => void): () => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module table/tablescroll
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { TableScrollEditing } from "./tablescroll/tablescrollediting.js";
|
|
10
|
+
export declare class TableScroll extends Plugin {
|
|
11
|
+
/**
|
|
12
|
+
* @inheritDoc
|
|
13
|
+
*/
|
|
14
|
+
static get pluginName(): "TableScroll";
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static override get isOfficialPlugin(): true;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires(): PluginDependenciesOf<[TableScrollEditing]>;
|
|
23
|
+
}
|
package/dist/tableselection.d.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
import type { ModelElement, ModelDocumentFragment } from "@ckeditor/ckeditor5-engine";
|
|
10
10
|
import { TableUtils } from "./tableutils.js";
|
|
11
|
-
import "../theme/tableselection.css";
|
|
12
11
|
/**
|
|
13
12
|
* This plugin enables the advanced table cells, rows and columns selection.
|
|
14
13
|
* It is loaded automatically by the {@link module:table/table~Table} plugin.
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { View, InputTextView, FocusCycler, ViewCollection, type ColorDefinition, type DropdownView, type ColorPickerConfig, type FocusableView } from "@ckeditor/ckeditor5-ui";
|
|
9
9
|
import { FocusTracker, KeystrokeHandler, type Locale } from "@ckeditor/ckeditor5-utils";
|
|
10
|
-
import "../../theme/colorinput.css";
|
|
11
10
|
/**
|
|
12
11
|
* The options for the color input view.
|
|
13
12
|
*
|
package/dist/utils/common.d.ts
CHANGED
|
@@ -76,3 +76,9 @@ export declare function isEntireCellsLineHeader({ table, row, column }: {
|
|
|
76
76
|
* @internal
|
|
77
77
|
*/
|
|
78
78
|
export declare function isTableCellTypeEnabled(editor: Editor): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Yields every empty block (typically a `paragraph`) found inside the given table's cells.
|
|
81
|
+
*
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
export declare function getEmptyTableCellBlocks(table: ModelElement): IterableIterator<ModelElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-table",
|
|
3
|
-
"version": "48.
|
|
3
|
+
"version": "48.4.0-alpha.0",
|
|
4
4
|
"description": "Table feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -26,14 +26,15 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ckeditor/ckeditor5-clipboard": "48.
|
|
30
|
-
"@ckeditor/ckeditor5-core": "48.
|
|
31
|
-
"@ckeditor/ckeditor5-engine": "48.
|
|
32
|
-
"@ckeditor/ckeditor5-
|
|
33
|
-
"@ckeditor/ckeditor5-
|
|
34
|
-
"@ckeditor/ckeditor5-
|
|
35
|
-
"@ckeditor/ckeditor5-
|
|
36
|
-
"@ckeditor/ckeditor5-
|
|
29
|
+
"@ckeditor/ckeditor5-clipboard": "48.4.0-alpha.0",
|
|
30
|
+
"@ckeditor/ckeditor5-core": "48.4.0-alpha.0",
|
|
31
|
+
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.0",
|
|
32
|
+
"@ckeditor/ckeditor5-enter": "48.4.0-alpha.0",
|
|
33
|
+
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.0",
|
|
34
|
+
"@ckeditor/ckeditor5-typing": "48.4.0-alpha.0",
|
|
35
|
+
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.0",
|
|
36
|
+
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.0",
|
|
37
|
+
"@ckeditor/ckeditor5-widget": "48.4.0-alpha.0",
|
|
37
38
|
"es-toolkit": "1.45.1"
|
|
38
39
|
},
|
|
39
40
|
"files": [
|