@ckeditor/ckeditor5-table 0.0.0-nightly-20250214.0 → 0.0.0-nightly-next-20250215.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/LICENSE.md +1 -1
- package/build/table.js +1 -1
- package/ckeditor5-metadata.json +6 -6
- package/dist/index.js +25 -34
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
- package/src/commands/insertcolumncommand.js +4 -0
- package/src/commands/insertrowcommand.js +4 -0
- package/src/commands/mergecellcommand.js +8 -0
- package/src/commands/splitcellcommand.js +4 -0
- package/src/tablecaption/tablecaptionediting.js +7 -0
- package/src/tablecaption/tablecaptionui.js +3 -2
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +8 -0
- package/src/tablecellproperties/tablecellpropertiesui.js +25 -3
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +78 -10
- package/src/tablecolumnresize/tablecolumnresizeediting.js +18 -1
- package/src/tableediting.js +4 -0
- package/src/tablemouse/mouseeventsobserver.js +3 -6
- package/src/tableproperties/commands/tablepropertycommand.js +8 -0
- package/src/tableproperties/tablepropertiesui.d.ts +1 -1
- package/src/tableproperties/tablepropertiesui.js +25 -7
- package/src/tableproperties/ui/tablepropertiesview.js +66 -6
- package/src/tableui.js +7 -9
- package/src/tablewalker.js +99 -4
- package/src/ui/colorinputview.js +34 -0
- package/src/ui/formrowview.js +4 -0
- package/src/ui/inserttableview.js +12 -0
- package/src/utils/table-properties.js +1 -1
- package/theme/icons/table-cell-properties.svg +0 -1
- package/theme/icons/table-column.svg +0 -1
- package/theme/icons/table-merge-cell.svg +0 -1
- package/theme/icons/table-properties.svg +0 -1
- package/theme/icons/table-row.svg +0 -1
package/src/tablewalker.js
CHANGED
|
@@ -7,6 +7,73 @@
|
|
|
7
7
|
* {@link module:table/tablewalker~TableSlot} with proper table cell attributes.
|
|
8
8
|
*/
|
|
9
9
|
export default class TableWalker {
|
|
10
|
+
/**
|
|
11
|
+
* The walker's table element.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
_table;
|
|
16
|
+
/**
|
|
17
|
+
* A row index from which this iterator will start.
|
|
18
|
+
*/
|
|
19
|
+
_startRow;
|
|
20
|
+
/**
|
|
21
|
+
* A row index at which this iterator will end.
|
|
22
|
+
*/
|
|
23
|
+
_endRow;
|
|
24
|
+
/**
|
|
25
|
+
* If set, the table walker will only output cells from a given column and following ones or cells that overlap them.
|
|
26
|
+
*/
|
|
27
|
+
_startColumn;
|
|
28
|
+
/**
|
|
29
|
+
* If set, the table walker will only output cells up to a given column.
|
|
30
|
+
*/
|
|
31
|
+
_endColumn;
|
|
32
|
+
/**
|
|
33
|
+
* Enables output of spanned cells that are normally not yielded.
|
|
34
|
+
*/
|
|
35
|
+
_includeAllSlots;
|
|
36
|
+
/**
|
|
37
|
+
* Row indexes to skip from the iteration.
|
|
38
|
+
*/
|
|
39
|
+
_skipRows;
|
|
40
|
+
/**
|
|
41
|
+
* The current row index.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
_row;
|
|
46
|
+
/**
|
|
47
|
+
* The index of the current row element in the table.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
_rowIndex;
|
|
52
|
+
/**
|
|
53
|
+
* The current column index.
|
|
54
|
+
*
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
_column;
|
|
58
|
+
/**
|
|
59
|
+
* The cell index in a parent row. For spanned cells when {@link #_includeAllSlots} is set to `true`,
|
|
60
|
+
* this represents the index of the next table cell.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
_cellIndex;
|
|
65
|
+
/**
|
|
66
|
+
* Holds a map of spanned cells in a table.
|
|
67
|
+
*/
|
|
68
|
+
_spannedCells;
|
|
69
|
+
/**
|
|
70
|
+
* Index of the next column where a cell is anchored.
|
|
71
|
+
*/
|
|
72
|
+
_nextCellAtColumn;
|
|
73
|
+
/**
|
|
74
|
+
* Indicates whether the iterator jumped to (or close to) the start row, ignoring rows that don't need to be traversed.
|
|
75
|
+
*/
|
|
76
|
+
_jumpedToStartRow = false;
|
|
10
77
|
/**
|
|
11
78
|
* Creates an instance of the table walker.
|
|
12
79
|
*
|
|
@@ -84,10 +151,6 @@ export default class TableWalker {
|
|
|
84
151
|
* @param options.includeAllSlots Also return values for spanned cells. Default value is "false".
|
|
85
152
|
*/
|
|
86
153
|
constructor(table, options = {}) {
|
|
87
|
-
/**
|
|
88
|
-
* Indicates whether the iterator jumped to (or close to) the start row, ignoring rows that don't need to be traversed.
|
|
89
|
-
*/
|
|
90
|
-
this._jumpedToStartRow = false;
|
|
91
154
|
this._table = table;
|
|
92
155
|
this._startRow = options.row !== undefined ? options.row : options.startRow || 0;
|
|
93
156
|
this._endRow = options.row !== undefined ? options.row : options.endRow;
|
|
@@ -324,6 +387,38 @@ export default class TableWalker {
|
|
|
324
387
|
* An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.
|
|
325
388
|
*/
|
|
326
389
|
class TableSlot {
|
|
390
|
+
/**
|
|
391
|
+
* The current table cell.
|
|
392
|
+
*/
|
|
393
|
+
cell;
|
|
394
|
+
/**
|
|
395
|
+
* The row index of a table slot.
|
|
396
|
+
*/
|
|
397
|
+
row;
|
|
398
|
+
/**
|
|
399
|
+
* The column index of a table slot.
|
|
400
|
+
*/
|
|
401
|
+
column;
|
|
402
|
+
/**
|
|
403
|
+
* The row index of a cell anchor slot.
|
|
404
|
+
*/
|
|
405
|
+
cellAnchorRow;
|
|
406
|
+
/**
|
|
407
|
+
* The column index of a cell anchor slot.
|
|
408
|
+
*/
|
|
409
|
+
cellAnchorColumn;
|
|
410
|
+
/**
|
|
411
|
+
* The index of the current cell in the parent row.
|
|
412
|
+
*/
|
|
413
|
+
_cellIndex;
|
|
414
|
+
/**
|
|
415
|
+
* The index of the current row element in the table.
|
|
416
|
+
*/
|
|
417
|
+
_rowIndex;
|
|
418
|
+
/**
|
|
419
|
+
* The table element.
|
|
420
|
+
*/
|
|
421
|
+
_table;
|
|
327
422
|
/**
|
|
328
423
|
* Creates an instance of the table walker value.
|
|
329
424
|
*
|
package/src/ui/colorinputview.js
CHANGED
|
@@ -15,6 +15,40 @@ import '../../theme/colorinput.css';
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
export default class ColorInputView extends View {
|
|
18
|
+
/**
|
|
19
|
+
* A cached reference to the options passed to the constructor.
|
|
20
|
+
*/
|
|
21
|
+
options;
|
|
22
|
+
/**
|
|
23
|
+
* Tracks information about the DOM focus in the view.
|
|
24
|
+
*/
|
|
25
|
+
focusTracker;
|
|
26
|
+
/**
|
|
27
|
+
* Helps cycling over focusable children in the input view.
|
|
28
|
+
*/
|
|
29
|
+
focusCycler;
|
|
30
|
+
/**
|
|
31
|
+
* A collection of views that can be focused in the view.
|
|
32
|
+
*/
|
|
33
|
+
_focusables;
|
|
34
|
+
/**
|
|
35
|
+
* An instance of the dropdown allowing to select a color from a grid.
|
|
36
|
+
*/
|
|
37
|
+
dropdownView;
|
|
38
|
+
/**
|
|
39
|
+
* An instance of the input allowing the user to type a color value.
|
|
40
|
+
*/
|
|
41
|
+
inputView;
|
|
42
|
+
/**
|
|
43
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
44
|
+
*/
|
|
45
|
+
keystrokes;
|
|
46
|
+
/**
|
|
47
|
+
* The flag that indicates whether the user is still typing.
|
|
48
|
+
* If set to true, it means that the text input field ({@link #inputView}) still has the focus.
|
|
49
|
+
* So, we should interrupt the user by replacing the input's value.
|
|
50
|
+
*/
|
|
51
|
+
_stillTyping;
|
|
18
52
|
/**
|
|
19
53
|
* Creates an instance of the color input view.
|
|
20
54
|
*
|
package/src/ui/formrowview.js
CHANGED
|
@@ -14,6 +14,18 @@ import './../../theme/inserttable.css';
|
|
|
14
14
|
* It renders a 10x10 grid to choose the inserted table size.
|
|
15
15
|
*/
|
|
16
16
|
export default class InsertTableView extends View {
|
|
17
|
+
/**
|
|
18
|
+
* A collection of table size box items.
|
|
19
|
+
*/
|
|
20
|
+
items;
|
|
21
|
+
/**
|
|
22
|
+
* Listen to `keydown` events fired in this view's main element.
|
|
23
|
+
*/
|
|
24
|
+
keystrokes;
|
|
25
|
+
/**
|
|
26
|
+
* Tracks information about the DOM focus in the grid.
|
|
27
|
+
*/
|
|
28
|
+
focusTracker;
|
|
17
29
|
/**
|
|
18
30
|
* @inheritDoc
|
|
19
31
|
*/
|
|
@@ -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 { isObject } from '
|
|
5
|
+
import { isObject } from 'es-toolkit/compat';
|
|
6
6
|
/**
|
|
7
7
|
* Returns a string if all four values of box sides are equal.
|
|
8
8
|
*
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M18 7v1H2V7h16zm0 5v1H2v-1h16z" opacity=".6"/><path d="M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z" opacity=".6"/><path d="M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z" opacity=".6"/><path d="m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z"/></svg>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z" opacity=".6"/><path d="M7 2h1v16H7V2zm5 0h1v16h-1V2z" opacity=".6"/><path d="M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z"/></svg>
|