@ckeditor/ckeditor5-table 31.0.0 → 33.0.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 +2 -2
- package/build/table.js +3 -3
- package/build/table.js.map +1 -0
- package/build/translations/cs.js +1 -1
- package/build/translations/el.js +1 -0
- package/build/translations/es.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/uz.js +1 -0
- package/build/translations/zh.js +1 -1
- package/lang/translations/ar.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/cs.po +4 -4
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +261 -0
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/es.po +43 -43
- package/lang/translations/et.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/id.po +11 -11
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +4 -4
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/uz.po +261 -0
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +4 -4
- package/package.json +26 -24
- package/src/commands/insertcolumncommand.js +5 -5
- package/src/commands/insertrowcommand.js +5 -5
- package/src/commands/inserttablecommand.js +1 -1
- package/src/commands/mergecellcommand.js +5 -6
- package/src/commands/mergecellscommand.js +6 -5
- package/src/commands/removecolumncommand.js +9 -8
- package/src/commands/removerowcommand.js +6 -7
- package/src/commands/selectcolumncommand.js +5 -5
- package/src/commands/selectrowcommand.js +6 -6
- package/src/commands/setheadercolumncommand.js +6 -5
- package/src/commands/setheaderrowcommand.js +8 -5
- package/src/commands/splitcellcommand.js +5 -5
- package/src/converters/downcast.js +77 -408
- package/src/converters/table-caption-post-fixer.js +1 -1
- package/src/converters/table-cell-paragraph-post-fixer.js +1 -1
- package/src/converters/{table-cell-refresh-post-fixer.js → table-cell-refresh-handler.js} +9 -20
- package/src/converters/table-headings-refresh-handler.js +68 -0
- package/src/converters/table-layout-post-fixer.js +1 -1
- package/src/converters/tableproperties.js +6 -5
- package/src/converters/upcasttable.js +7 -3
- package/src/index.js +1 -1
- package/src/plaintableoutput.js +151 -0
- package/src/table.js +1 -1
- package/src/tablecaption/tablecaptionediting.js +1 -1
- package/src/tablecaption/tablecaptionui.js +3 -3
- package/src/tablecaption/toggletablecaptioncommand.js +3 -3
- package/src/tablecaption/utils.js +1 -1
- package/src/tablecaption.js +1 -1
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellborderstylecommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellheightcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellpaddingcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +6 -5
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellwidthcommand.js +2 -2
- package/src/tablecellproperties/tablecellpropertiesediting.js +42 -35
- package/src/tablecellproperties/tablecellpropertiesui.js +1 -1
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +11 -1
- package/src/tablecellproperties.js +1 -1
- package/src/tableclipboard.js +19 -16
- package/src/tableediting.js +49 -28
- package/src/tablekeyboard.js +7 -6
- package/src/tablemouse/mouseeventsobserver.js +1 -1
- package/src/tablemouse.js +7 -5
- package/src/tableproperties/commands/tablealignmentcommand.js +2 -2
- package/src/tableproperties/commands/tablebackgroundcolorcommand.js +2 -2
- package/src/tableproperties/commands/tablebordercolorcommand.js +2 -2
- package/src/tableproperties/commands/tableborderstylecommand.js +2 -2
- package/src/tableproperties/commands/tableborderwidthcommand.js +2 -2
- package/src/tableproperties/commands/tableheightcommand.js +2 -2
- package/src/tableproperties/commands/tablepropertycommand.js +2 -2
- package/src/tableproperties/commands/tablewidthcommand.js +2 -2
- package/src/tableproperties/tablepropertiesediting.js +29 -21
- package/src/tableproperties/tablepropertiesui.js +1 -1
- package/src/tableproperties/ui/tablepropertiesview.js +11 -1
- package/src/tableproperties.js +1 -1
- package/src/tableselection.js +10 -9
- package/src/tabletoolbar.js +1 -1
- package/src/tableui.js +1 -1
- package/src/tableutils.js +311 -1
- package/src/tablewalker.js +1 -1
- package/src/ui/colorinputview.js +1 -1
- package/src/ui/formrowview.js +1 -1
- package/src/ui/inserttableview.js +1 -1
- package/src/utils/common.js +1 -1
- package/src/utils/structure.js +1 -1
- package/src/utils/table-properties.js +1 -1
- package/src/utils/ui/contextualballoon.js +1 -1
- package/src/utils/ui/table-properties.js +1 -1
- package/src/utils/ui/widget.js +1 -1
- package/theme/colorinput.css +1 -1
- package/theme/form.css +1 -1
- package/theme/formrow.css +1 -1
- package/theme/inserttable.css +1 -1
- package/theme/table.css +2 -2
- package/theme/tablecaption.css +1 -1
- package/theme/tablecellproperties.css +1 -1
- package/theme/tableediting.css +1 -1
- package/theme/tableform.css +1 -1
- package/theme/tableproperties.css +1 -1
- package/theme/tableselection.css +1 -1
- package/src/converters/table-heading-rows-refresh-post-fixer.js +0 -72
- package/src/utils/selection.js +0 -276
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
import { Command } from 'ckeditor5/src/core';
|
|
11
11
|
|
|
12
|
-
import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* The select row command.
|
|
16
14
|
*
|
|
@@ -37,7 +35,8 @@ export default class SelectRowCommand extends Command {
|
|
|
37
35
|
* @inheritDoc
|
|
38
36
|
*/
|
|
39
37
|
refresh() {
|
|
40
|
-
const
|
|
38
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
39
|
+
const selectedCells = tableUtils.getSelectionAffectedTableCells( this.editor.model.document.selection );
|
|
41
40
|
|
|
42
41
|
this.isEnabled = selectedCells.length > 0;
|
|
43
42
|
}
|
|
@@ -47,8 +46,9 @@ export default class SelectRowCommand extends Command {
|
|
|
47
46
|
*/
|
|
48
47
|
execute() {
|
|
49
48
|
const model = this.editor.model;
|
|
50
|
-
const
|
|
51
|
-
const
|
|
49
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
50
|
+
const referenceCells = tableUtils.getSelectionAffectedTableCells( model.document.selection );
|
|
51
|
+
const rowIndexes = tableUtils.getRowIndexes( referenceCells );
|
|
52
52
|
|
|
53
53
|
const table = referenceCells[ 0 ].findAncestor( 'table' );
|
|
54
54
|
const rangesToSelect = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
isHeadingColumnCell,
|
|
14
14
|
updateNumericAttribute
|
|
15
15
|
} from '../utils/common';
|
|
16
|
-
import { getColumnIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
|
17
16
|
import { getHorizontallyOverlappingCells, splitVertically } from '../utils/structure';
|
|
18
17
|
|
|
19
18
|
/**
|
|
@@ -37,8 +36,9 @@ export default class SetHeaderColumnCommand extends Command {
|
|
|
37
36
|
*/
|
|
38
37
|
refresh() {
|
|
39
38
|
const model = this.editor.model;
|
|
40
|
-
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
|
|
41
39
|
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
40
|
+
|
|
41
|
+
const selectedCells = tableUtils.getSelectionAffectedTableCells( model.document.selection );
|
|
42
42
|
const isInTable = selectedCells.length > 0;
|
|
43
43
|
|
|
44
44
|
this.isEnabled = isInTable;
|
|
@@ -71,11 +71,12 @@ export default class SetHeaderColumnCommand extends Command {
|
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
74
75
|
const model = this.editor.model;
|
|
75
|
-
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
|
|
76
|
+
const selectedCells = tableUtils.getSelectionAffectedTableCells( model.document.selection );
|
|
76
77
|
const table = selectedCells[ 0 ].findAncestor( 'table' );
|
|
77
78
|
|
|
78
|
-
const { first, last } = getColumnIndexes( selectedCells );
|
|
79
|
+
const { first, last } = tableUtils.getColumnIndexes( selectedCells );
|
|
79
80
|
const headingColumnsToSet = this.value ? first : last + 1;
|
|
80
81
|
|
|
81
82
|
model.change( writer => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import { Command } from 'ckeditor5/src/core';
|
|
11
11
|
|
|
12
12
|
import { updateNumericAttribute } from '../utils/common';
|
|
13
|
-
import { getRowIndexes, getSelectionAffectedTableCells } from '../utils/selection';
|
|
14
13
|
import { getVerticallyOverlappingCells, splitHorizontally } from '../utils/structure';
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -32,8 +31,9 @@ export default class SetHeaderRowCommand extends Command {
|
|
|
32
31
|
* @inheritDoc
|
|
33
32
|
*/
|
|
34
33
|
refresh() {
|
|
34
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
35
35
|
const model = this.editor.model;
|
|
36
|
-
const selectedCells = getSelectionAffectedTableCells( model.document.selection );
|
|
36
|
+
const selectedCells = tableUtils.getSelectionAffectedTableCells( model.document.selection );
|
|
37
37
|
const isInTable = selectedCells.length > 0;
|
|
38
38
|
|
|
39
39
|
this.isEnabled = isInTable;
|
|
@@ -65,11 +65,14 @@ export default class SetHeaderRowCommand extends Command {
|
|
|
65
65
|
if ( options.forceValue === this.value ) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
68
70
|
const model = this.editor.model;
|
|
69
|
-
|
|
71
|
+
|
|
72
|
+
const selectedCells = tableUtils.getSelectionAffectedTableCells( model.document.selection );
|
|
70
73
|
const table = selectedCells[ 0 ].findAncestor( 'table' );
|
|
71
74
|
|
|
72
|
-
const { first, last } = getRowIndexes( selectedCells );
|
|
75
|
+
const { first, last } = tableUtils.getRowIndexes( selectedCells );
|
|
73
76
|
const headingRowsToSet = this.value ? first : last + 1;
|
|
74
77
|
const currentHeadingRows = table.getAttribute( 'headingRows' ) || 0;
|
|
75
78
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Command } from 'ckeditor5/src/core';
|
|
11
|
-
import { getSelectionAffectedTableCells } from '../utils/selection';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* The split cell command.
|
|
@@ -46,7 +45,8 @@ export default class SplitCellCommand extends Command {
|
|
|
46
45
|
* @inheritDoc
|
|
47
46
|
*/
|
|
48
47
|
refresh() {
|
|
49
|
-
const
|
|
48
|
+
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
49
|
+
const selectedCells = tableUtils.getSelectionAffectedTableCells( this.editor.model.document.selection );
|
|
50
50
|
|
|
51
51
|
this.isEnabled = selectedCells.length === 1;
|
|
52
52
|
}
|
|
@@ -55,9 +55,9 @@ export default class SplitCellCommand extends Command {
|
|
|
55
55
|
* @inheritDoc
|
|
56
56
|
*/
|
|
57
57
|
execute() {
|
|
58
|
-
const tableCell = getSelectionAffectedTableCells( this.editor.model.document.selection )[ 0 ];
|
|
59
|
-
const isHorizontal = this.direction === 'horizontally';
|
|
60
58
|
const tableUtils = this.editor.plugins.get( 'TableUtils' );
|
|
59
|
+
const tableCell = tableUtils.getSelectionAffectedTableCells( this.editor.model.document.selection )[ 0 ];
|
|
60
|
+
const isHorizontal = this.direction === 'horizontally';
|
|
61
61
|
|
|
62
62
|
if ( isHorizontal ) {
|
|
63
63
|
tableUtils.splitCellHorizontally( tableCell, 2 );
|