@ckeditor/ckeditor5-table 48.8.1-alpha.4 → 49.0.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.
- package/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +12 -1
- package/dist/augmentation.d.ts +83 -80
- package/dist/commands/insertcolumncommand.d.ts +50 -50
- package/dist/commands/insertrowcommand.d.ts +49 -49
- package/dist/commands/inserttablecommand.d.ts +48 -43
- package/dist/commands/inserttablelayoutcommand.d.ts +39 -34
- package/dist/commands/mergecellcommand.d.ts +63 -63
- package/dist/commands/mergecellscommand.d.ts +24 -24
- package/dist/commands/removecolumncommand.d.ts +24 -24
- package/dist/commands/removerowcommand.d.ts +24 -24
- package/dist/commands/selectcolumncommand.d.ts +28 -28
- package/dist/commands/selectrowcommand.d.ts +28 -28
- package/dist/commands/setfooterrowcommand.d.ts +48 -48
- package/dist/commands/setheadercolumncommand.d.ts +45 -45
- package/dist/commands/setheaderrowcommand.d.ts +48 -48
- package/dist/commands/splitcellcommand.d.ts +39 -38
- package/dist/converters/downcast.d.ts +77 -77
- package/dist/converters/table-caption-post-fixer.d.ts +18 -18
- package/dist/converters/table-cell-paragraph-post-fixer.d.ts +30 -30
- package/dist/converters/table-cell-refresh-handler.d.ts +16 -16
- package/dist/converters/table-layout-post-fixer.d.ts +224 -224
- package/dist/converters/table-structure-post-fixer.d.ts +16 -16
- package/dist/converters/table-structure-refresh-handler.d.ts +15 -15
- package/dist/converters/tableproperties.d.ts +98 -98
- package/dist/converters/upcasttable.d.ts +47 -47
- package/dist/index-content.css +116 -105
- package/dist/index-content.css.map +1 -0
- package/dist/index-editor.css +718 -601
- package/dist/index-editor.css.map +1 -0
- package/dist/index.css +781 -650
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +103 -98
- package/dist/index.js +13669 -14491
- package/dist/index.js.map +1 -1
- package/dist/plaintableoutput.d.ts +28 -28
- package/dist/table.d.ts +38 -39
- package/dist/tablecaption/tablecaptionediting.d.ts +62 -62
- package/dist/tablecaption/tablecaptionui.d.ts +18 -18
- package/dist/tablecaption/toggletablecaptioncommand.d.ts +61 -61
- package/dist/tablecaption/utils.d.ts +31 -31
- package/dist/tablecaption.d.ts +22 -23
- package/dist/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +27 -27
- package/dist/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +32 -32
- package/dist/tablecellproperties/commands/tablecellborderstylecommand.d.ts +32 -32
- package/dist/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +46 -46
- package/dist/tablecellproperties/commands/tablecellheightcommand.d.ts +41 -41
- package/dist/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +27 -27
- package/dist/tablecellproperties/commands/tablecellpaddingcommand.d.ts +46 -46
- package/dist/tablecellproperties/commands/tablecellpropertycommand.d.ts +79 -79
- package/dist/tablecellproperties/commands/tablecelltypecommand.d.ts +42 -42
- package/dist/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +35 -35
- package/dist/tablecellproperties/tablecellpropertiesediting.d.ts +49 -49
- package/dist/tablecellproperties/tablecellpropertiesui.d.ts +130 -123
- package/dist/tablecellproperties/tablecellpropertiesutils.d.ts +13 -13
- package/dist/tablecellproperties/ui/tablecellpropertiesview.d.ts +255 -257
- package/dist/tablecellproperties.d.ts +29 -29
- package/dist/tablecellwidth/commands/tablecellwidthcommand.d.ts +41 -41
- package/dist/tablecellwidth/tablecellwidthediting.d.ts +28 -28
- package/dist/tableclipboard.d.ts +79 -79
- package/dist/tablecolumnresize/commands/tablecolumnwidthcommand.d.ts +56 -0
- package/dist/tablecolumnresize/constants.d.ts +40 -25
- package/dist/tablecolumnresize/converters.d.ts +20 -20
- package/dist/tablecolumnresize/tablecolumnresizeediting.d.ts +263 -184
- package/dist/tablecolumnresize/tablewidthscommand.d.ts +31 -31
- package/dist/tablecolumnresize/utils.d.ts +166 -127
- package/dist/tablecolumnresize.d.ts +24 -25
- package/dist/tableconfig.d.ts +736 -670
- package/dist/tableediting.d.ts +98 -99
- package/dist/tablekeyboard.d.ts +67 -67
- package/dist/tablelayout/commands/tabletypecommand.d.ts +38 -38
- package/dist/tablelayout/tablelayoutediting.d.ts +57 -58
- package/dist/tablelayout/tablelayoutui.d.ts +27 -27
- package/dist/tablelayout.d.ts +25 -25
- package/dist/tablemouse/mouseeventsobserver.d.ts +54 -54
- package/dist/tablemouse.d.ts +47 -47
- package/dist/tableproperties/commands/tablealignmentcommand.d.ts +27 -27
- package/dist/tableproperties/commands/tablebackgroundcolorcommand.d.ts +27 -27
- package/dist/tableproperties/commands/tablebordercolorcommand.d.ts +32 -32
- package/dist/tableproperties/commands/tableborderstylecommand.d.ts +32 -32
- package/dist/tableproperties/commands/tableborderwidthcommand.d.ts +46 -46
- package/dist/tableproperties/commands/tableheightcommand.d.ts +41 -41
- package/dist/tableproperties/commands/tablepropertycommand.d.ts +64 -64
- package/dist/tableproperties/commands/tablewidthcommand.d.ts +41 -41
- package/dist/tableproperties/tablepropertiesediting.d.ts +48 -48
- package/dist/tableproperties/tablepropertiesui.d.ts +131 -131
- package/dist/tableproperties/ui/tablepropertiesview.d.ts +210 -207
- package/dist/tableproperties.d.ts +29 -29
- package/dist/tablescroll/tablescrollediting.d.ts +91 -0
- package/dist/tablescroll/watchers.d.ts +29 -0
- package/dist/tablescroll.d.ts +23 -0
- package/dist/tableselection.d.ts +105 -106
- package/dist/tabletoolbar.d.ts +31 -31
- package/dist/tableui.d.ts +53 -53
- package/dist/tableutils.d.ts +532 -532
- package/dist/tablewalker.d.ts +342 -350
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +5 -3
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +5 -3
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +5 -3
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +5 -3
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +5 -3
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +5 -3
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +5 -3
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +5 -3
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +5 -3
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +5 -3
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +5 -3
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +5 -3
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +5 -3
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +5 -3
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +5 -3
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +5 -3
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +5 -3
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +5 -3
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +5 -3
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +5 -3
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +5 -3
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +5 -3
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +5 -3
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +5 -3
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +5 -3
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +5 -3
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +5 -3
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +5 -3
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +5 -3
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +5 -3
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +5 -3
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +5 -3
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +5 -3
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +5 -3
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +5 -3
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +5 -3
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +5 -3
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +5 -3
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +5 -3
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +5 -3
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +5 -3
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +5 -3
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +5 -3
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +5 -3
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +5 -3
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +5 -3
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +5 -3
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +5 -3
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +5 -3
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +5 -3
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +5 -3
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +5 -3
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +5 -3
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +5 -3
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +5 -3
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +5 -3
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +5 -3
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +5 -3
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +5 -3
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +5 -3
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +5 -3
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +5 -3
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +5 -3
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +5 -3
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +5 -3
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +5 -3
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +5 -3
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +5 -3
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +5 -3
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +5 -3
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +5 -3
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +5 -3
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +5 -3
- package/dist/ui/colorinputview.d.ts +136 -137
- package/dist/ui/inserttableview.d.ts +77 -78
- package/dist/utils/common.d.ts +64 -58
- package/dist/utils/structure.d.ts +229 -229
- package/dist/utils/table-properties.d.ts +92 -92
- package/dist/utils/ui/contextualballoon.d.ts +28 -28
- package/dist/utils/ui/table-properties.d.ts +130 -192
- package/dist/utils/ui/widget.d.ts +22 -22
- package/package.json +11 -10
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import type { Editor } from
|
|
9
|
-
import { TableCellPropertyCommand } from
|
|
6
|
+
* @module table/tablecellwidth/commands/tablecellwidthcommand
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { TableCellPropertyCommand } from "../../tablecellproperties/commands/tablecellpropertycommand.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
11
|
+
* The table cell width command.
|
|
12
|
+
*
|
|
13
|
+
* The command is registered by the {@link module:table/tablecellwidth/tablecellwidthediting~TableCellWidthEditing} as
|
|
14
|
+
* the `'tableCellWidth'` editor command.
|
|
15
|
+
*
|
|
16
|
+
* To change the width of selected cells, execute the command:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* editor.execute( 'tableCellWidth', {
|
|
20
|
+
* value: '50px'
|
|
21
|
+
* } );
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* **Note**: This command adds a default `'px'` unit to numeric values. Executing:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* editor.execute( 'tableCellWidth', {
|
|
28
|
+
* value: '50'
|
|
29
|
+
* } );
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* will set the `width` attribute to `'50px'` in the model.
|
|
33
|
+
*/
|
|
34
34
|
export declare class TableCellWidthCommand extends TableCellPropertyCommand {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new `TableCellWidthCommand` instance.
|
|
37
|
+
*
|
|
38
|
+
* @param editor An editor in which this command will be used.
|
|
39
|
+
* @param defaultValue The default value of the attribute.
|
|
40
|
+
*/
|
|
41
|
+
constructor(editor: Editor, defaultValue: string);
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
override _getValueToSet(value: string | number | undefined): unknown;
|
|
46
46
|
}
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { TableEditing } from
|
|
6
|
+
* @module table/tablecellwidth/tablecellwidthediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { TableEditing } from "./../tableediting.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
* The table cell width editing feature.
|
|
12
|
+
*
|
|
13
|
+
* Introduces `tableCellWidth` table cell model attribute alongside with its converters
|
|
14
|
+
* and a command.
|
|
15
|
+
*/
|
|
16
16
|
export declare class TableCellWidthEditing extends Plugin {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): "TableCellWidthEditing";
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static override get isOfficialPlugin(): true;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get requires(): PluginDependenciesOf<[TableEditing]>;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
init(): void;
|
|
33
33
|
}
|
package/dist/tableclipboard.d.ts
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { ClipboardPipeline, ClipboardMarkersUtils } from
|
|
6
|
-
import { Plugin } from
|
|
7
|
-
import type { ModelDocumentFragment, ModelElement, ModelItem, Model, ModelPosition, ModelWriter } from
|
|
8
|
-
import { TableSelection } from
|
|
9
|
-
import { type TableSlot } from
|
|
10
|
-
import { TableUtils } from
|
|
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 { ClipboardPipeline, ClipboardMarkersUtils } from "@ckeditor/ckeditor5-clipboard";
|
|
6
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
7
|
+
import type { ModelDocumentFragment, ModelElement, ModelItem, Model, ModelPosition, ModelWriter } from "@ckeditor/ckeditor5-engine";
|
|
8
|
+
import { TableSelection } from "./tableselection.js";
|
|
9
|
+
import { type TableSlot } from "./tablewalker.js";
|
|
10
|
+
import { TableUtils } from "./tableutils.js";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* This plugin adds support for copying/cutting/pasting fragments of tables.
|
|
13
|
+
* It is loaded automatically by the {@link module:table/table~Table} plugin.
|
|
14
|
+
*/
|
|
15
15
|
export declare class TableClipboard extends Plugin {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "TableClipboard";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static override get isOfficialPlugin(): true;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): PluginDependenciesOf<[ClipboardMarkersUtils, ClipboardPipeline, TableSelection, TableUtils]>;
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
init(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Sets up listening for events from the clipboard pipeline to properly handle
|
|
34
|
+
* table content merging during paste/drop operations.
|
|
35
|
+
*
|
|
36
|
+
* When a user is dragging and dropping a table, we want to insert the entire table into
|
|
37
|
+
* a table cell instead of merging table contents. For paste and other events,
|
|
38
|
+
* the normal table merge behavior is applied.
|
|
39
|
+
*/
|
|
40
|
+
private _listenToContentInsertion;
|
|
41
|
+
/**
|
|
42
|
+
* Copies table content to a clipboard on "copy" & "cut" events.
|
|
43
|
+
*
|
|
44
|
+
* @param evt An object containing information about the handled event.
|
|
45
|
+
* @param data Clipboard event data.
|
|
46
|
+
*/
|
|
47
|
+
private _onCopyCut;
|
|
48
|
+
/**
|
|
49
|
+
* Overrides default {@link module:engine/model/model~Model#insertContent `model.insertContent()`} method to handle pasting table inside
|
|
50
|
+
* selected table fragment.
|
|
51
|
+
*
|
|
52
|
+
* Depending on selected table fragment:
|
|
53
|
+
* - If a selected table fragment is smaller than paste table it will crop pasted table to match dimensions.
|
|
54
|
+
* - If dimensions are equal it will replace selected table fragment with a pasted table contents.
|
|
55
|
+
*
|
|
56
|
+
* @param content The content to insert.
|
|
57
|
+
* @param selectable The selection into which the content should be inserted.
|
|
58
|
+
* If not provided the current model document selection will be used.
|
|
59
|
+
*/
|
|
60
|
+
private _onInsertContent;
|
|
61
|
+
/**
|
|
62
|
+
* Inserts provided `selectedTableCells` into `pastedTable`.
|
|
63
|
+
*/
|
|
64
|
+
private _replaceSelectedCells;
|
|
65
|
+
/**
|
|
66
|
+
* Replaces the part of selectedTable with pastedTable.
|
|
67
|
+
*/
|
|
68
|
+
private _replaceSelectedCellsWithPasted;
|
|
69
|
+
/**
|
|
70
|
+
* Replaces a single table slot.
|
|
71
|
+
*
|
|
72
|
+
* @returns Inserted table cell or null if slot should remain empty.
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
_replaceTableSlotCell(tableSlot: TableSlot, cellToInsert: ModelElement | null, insertPosition: ModelPosition, writer: ModelWriter): ModelElement | null;
|
|
76
|
+
/**
|
|
77
|
+
* Extracts the table for pasting into a table.
|
|
78
|
+
*
|
|
79
|
+
* @param content The content to insert.
|
|
80
|
+
* @param model The editor model.
|
|
81
|
+
*/
|
|
82
|
+
getTableIfOnlyTableInContent(content: ModelDocumentFragment | ModelItem, model: Model): ModelElement | null;
|
|
83
83
|
}
|
|
@@ -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
|
+
}
|
|
@@ -1,33 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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/constants
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The minimum column width given as a percentage value. Used in situations when the table is not yet rendered, so it is impossible to
|
|
10
|
+
* calculate how many percentage of the table width would be {@link ~COLUMN_MIN_WIDTH_IN_PIXELS minimum column width in pixels}.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
14
|
export declare const COLUMN_MIN_WIDTH_AS_PERCENTAGE = 5;
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
* The minimum column width in pixels when the maximum table width is known.
|
|
17
|
+
* This value is an equivalent of `10%` of the default editor width (600px).
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
21
|
export declare const COLUMN_MIN_WIDTH_IN_PIXELS = 40;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
* Determines how many digits after the decimal point are used to store the column width as a percentage value.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
27
|
export declare const COLUMN_WIDTH_PRECISION = 2;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
* The distance in pixels that the mouse has to move to start resizing the column.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
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;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import type { DowncastDispatcher, UpcastDispatcher } from
|
|
9
|
-
import { type TableUtils } from
|
|
6
|
+
* @module table/tablecolumnresize/converters
|
|
7
|
+
*/
|
|
8
|
+
import type { DowncastDispatcher, UpcastDispatcher } from "@ckeditor/ckeditor5-engine";
|
|
9
|
+
import { type TableUtils } from "../tableutils.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
* Returns a upcast helper that ensures the number of `<tableColumn>` elements corresponds to the actual number of columns in the table,
|
|
12
|
+
* because the input data might have too few or too many <col> elements.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
16
|
export declare function upcastColgroupElement(tableUtilsPlugin: TableUtils): (dispatcher: UpcastDispatcher) => void;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
* Returns downcast helper for adding `ck-table-resized` class if there is a `<tableColumnGroup>` element inside the table.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
22
|
export declare function downcastTableResizedClass(): (dispatcher: DowncastDispatcher) => void;
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
* Returns a upcast helper that removes the `ck-table-resized` class from the table element.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
28
|
export declare function upcastTableResizedClass(): (dispatcher: UpcastDispatcher) => void;
|