@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,110 +1,110 @@
|
|
|
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 { BoxStyleSides } from
|
|
6
|
+
* @module table/utils/table-properties
|
|
7
|
+
*/
|
|
8
|
+
import type { BoxStyleSides } from "@ckeditor/ckeditor5-engine";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
* Returns a string if all four values of box sides are equal.
|
|
11
|
+
*
|
|
12
|
+
* If a string is passed, it is treated as a single value (pass-through).
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* // Returns 'foo':
|
|
16
|
+
* getSingleValue( { top: 'foo', right: 'foo', bottom: 'foo', left: 'foo' } );
|
|
17
|
+
* getSingleValue( 'foo' );
|
|
18
|
+
*
|
|
19
|
+
* // Returns undefined:
|
|
20
|
+
* getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );
|
|
21
|
+
* getSingleValue( { top: 'foo', right: 'foo' } );
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
26
|
export declare function getSingleValue(objectOrString: BoxStyleSides | string | undefined): string | undefined;
|
|
27
27
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
* Adds a unit to a value if the value is a number or a string representing a number.
|
|
29
|
+
*
|
|
30
|
+
* **Note**: It does nothing to non-numeric values.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* getSingleValue( 25, 'px' ); // '25px'
|
|
34
|
+
* getSingleValue( 25, 'em' ); // '25em'
|
|
35
|
+
* getSingleValue( '25em', 'px' ); // '25em'
|
|
36
|
+
* getSingleValue( 'foo', 'px' ); // 'foo'
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
* @param defaultUnit A default unit added to a numeric value.
|
|
41
|
+
*/
|
|
42
42
|
export declare function addDefaultUnitToNumericValue(value: string | number | undefined, defaultUnit: string): string | number | undefined;
|
|
43
43
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
* Interface representing the normalized default properties for table and cell elements.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
48
|
export interface NormalizedDefaultProperties {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
borderStyle: string;
|
|
50
|
+
borderWidth: string;
|
|
51
|
+
borderColor: string;
|
|
52
|
+
backgroundColor: string;
|
|
53
|
+
width: string;
|
|
54
|
+
height: string;
|
|
55
|
+
alignment?: string;
|
|
56
|
+
padding?: string;
|
|
57
|
+
verticalAlignment?: string;
|
|
58
|
+
horizontalAlignment?: string;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
* Options used to determine which properties should be added to the normalized configuration.
|
|
62
|
+
*
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
65
|
export type NormalizeTableDefaultPropertiesOptions = {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Whether the "alignment" property should be added.
|
|
68
|
+
*/
|
|
69
|
+
includeAlignmentProperty?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Whether the "padding" property should be added.
|
|
72
|
+
*/
|
|
73
|
+
includePaddingProperty?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Whether the "verticalAlignment" property should be added.
|
|
76
|
+
*/
|
|
77
|
+
includeVerticalAlignmentProperty?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the "horizontalAlignment" property should be added.
|
|
80
|
+
*/
|
|
81
|
+
includeHorizontalAlignmentProperty?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Whether the content is right-to-left.
|
|
84
|
+
*/
|
|
85
|
+
isRightToLeftContent?: boolean;
|
|
86
86
|
};
|
|
87
87
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
* Returns the normalized configuration.
|
|
89
|
+
*
|
|
90
|
+
* @internal
|
|
91
|
+
* @param config The configuration to normalize.
|
|
92
|
+
* @param options Options used to determine which properties should be added.
|
|
93
|
+
*/
|
|
94
94
|
export declare function getNormalizedDefaultProperties(config?: Partial<NormalizedDefaultProperties>, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
|
|
95
95
|
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
* Returns the normalized default table properties.
|
|
97
|
+
*
|
|
98
|
+
* @internal
|
|
99
|
+
* @param config The configuration to normalize.
|
|
100
|
+
* @param options Options used to determine which properties should be added.
|
|
101
|
+
*/
|
|
102
102
|
export declare function getNormalizedDefaultTableProperties(config?: Partial<NormalizedDefaultProperties>, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
|
|
103
103
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
* Returns the normalized default cell properties.
|
|
105
|
+
*
|
|
106
|
+
* @internal
|
|
107
|
+
* @param config The configuration to normalize.
|
|
108
|
+
* @param options Options used to determine which properties should be added.
|
|
109
|
+
*/
|
|
110
110
|
export declare function getNormalizedDefaultCellProperties(config?: Partial<NormalizedDefaultProperties>, options?: NormalizeTableDefaultPropertiesOptions): NormalizedDefaultProperties;
|
|
@@ -1,36 +1,36 @@
|
|
|
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 DomOptimalPositionOptions } from
|
|
9
|
-
import type { Editor } from
|
|
6
|
+
* @module table/utils/ui/contextualballoon
|
|
7
|
+
*/
|
|
8
|
+
import { type DomOptimalPositionOptions } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import type { Editor } from "@ckeditor/ckeditor5-core";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
* A helper utility that positions the
|
|
12
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
|
|
13
|
+
* with respect to the table in the editor content, if one is selected.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
* @param editor The editor instance.
|
|
17
|
+
* @param target Either "cell" or "table". Determines the target the balloon will be attached to.
|
|
18
|
+
*/
|
|
19
19
|
export declare function repositionContextualBalloon(editor: Editor, target: string): void;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
* Returns the positioning options that control the geometry of the
|
|
22
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
|
|
23
|
+
* to the selected table in the editor content.
|
|
24
|
+
*
|
|
25
|
+
* @param editor The editor instance.
|
|
26
|
+
*/
|
|
27
27
|
export declare function getBalloonTablePositionData(editor: Editor): Partial<DomOptimalPositionOptions>;
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
* Returns the positioning options that control the geometry of the
|
|
30
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
|
|
31
|
+
* to the selected table cell in the editor content.
|
|
32
|
+
*
|
|
33
|
+
* @param editor The editor instance.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
36
|
export declare function getBalloonCellPositionData(editor: Editor): Partial<DomOptimalPositionOptions>;
|
|
@@ -1,215 +1,153 @@
|
|
|
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 ColorOption, type LabeledFieldView, type ListDropdownItemDefinition, type NormalizedColorOption, type ToolbarView, type View, type ColorPickerConfig } from
|
|
9
|
-
import { Collection, type LocaleTranslate } from
|
|
10
|
-
import { type TableCellPropertiesView } from
|
|
11
|
-
import { type TablePropertiesView } from
|
|
12
|
-
import { ColorInputView } from
|
|
6
|
+
* @module table/utils/ui/table-properties
|
|
7
|
+
*/
|
|
8
|
+
import { type ColorOption, type LabeledFieldView, type ListDropdownItemDefinition, type NormalizedColorOption, type ToolbarView, type View, type ColorPickerConfig } from "@ckeditor/ckeditor5-ui";
|
|
9
|
+
import { Collection, type LocaleTranslate } from "@ckeditor/ckeditor5-utils";
|
|
10
|
+
import { type TableCellPropertiesView } from "../../tablecellproperties/ui/tablecellpropertiesview.js";
|
|
11
|
+
import { type TablePropertiesView } from "../../tableproperties/ui/tablepropertiesview.js";
|
|
12
|
+
import { ColorInputView } from "../../ui/colorinputview.js";
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
* Returns an object containing pairs of CSS border style values and their localized UI
|
|
15
|
+
* labels. Used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
|
|
16
|
+
* and {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
20
|
+
*/
|
|
21
21
|
export declare function getBorderStyleLabels(t: LocaleTranslate): Record<string, string>;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
* Returns a localized error string that can be displayed next to color (background, border)
|
|
24
|
+
* fields that have an invalid value.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
28
|
+
*/
|
|
29
29
|
export declare function getLocalizedColorErrorText(t: LocaleTranslate): string;
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
* Returns a localized error string that can be displayed next to length (padding, border width)
|
|
32
|
+
* fields that have an invalid value.
|
|
33
|
+
*
|
|
34
|
+
* @internal
|
|
35
|
+
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
36
|
+
*/
|
|
37
37
|
export declare function getLocalizedLengthErrorText(t: LocaleTranslate): string;
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
* Returns `true` when the passed value is an empty string or a valid CSS color expression.
|
|
40
|
+
* Otherwise, `false` is returned.
|
|
41
|
+
*
|
|
42
|
+
* See {@link module:engine/view/styles/utils~isColorStyleValue}.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
46
|
export declare function colorFieldValidator(value: string): boolean;
|
|
47
47
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
49
|
+
* Otherwise, `false` is returned.
|
|
50
|
+
*
|
|
51
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
52
|
+
* See {@link module:engine/view/styles/utils~isPercentageStyleValue}.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
56
|
export declare function lengthFieldValidator(value: string): boolean;
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
59
|
+
* Otherwise, `false` is returned.
|
|
60
|
+
*
|
|
61
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
62
|
+
*
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
65
|
export declare function lineWidthFieldValidator(value: string): boolean;
|
|
66
66
|
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
* Generates item definitions for a UI dropdown that allows changing the border style of a table or a table cell.
|
|
68
|
+
*
|
|
69
|
+
* @internal
|
|
70
|
+
* @param defaultStyle The default border.
|
|
71
|
+
*/
|
|
72
72
|
export declare function getBorderStyleDefinitions(view: TableCellPropertiesView | TablePropertiesView, defaultStyle: string): Collection<ListDropdownItemDefinition>;
|
|
73
73
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
export declare function fillToolbar<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
74
|
+
* A helper that fills a toolbar with buttons that:
|
|
75
|
+
*
|
|
76
|
+
* * have some labels,
|
|
77
|
+
* * have some icons,
|
|
78
|
+
* * set a certain UI view property value upon execution.
|
|
79
|
+
*
|
|
80
|
+
* @internal
|
|
81
|
+
* @param options Configuration options
|
|
82
|
+
* @param options.view The view that has the observable property.
|
|
83
|
+
* @param options.icons Object with button icons.
|
|
84
|
+
* @param options.toolbar The toolbar to fill with buttons.
|
|
85
|
+
* @param options.labels Object with button labels.
|
|
86
|
+
* @param options.propertyName The name of the observable property in the view.
|
|
87
|
+
* @param options.nameToValue A function that maps a button name to a value. By default names are the same as values.
|
|
88
|
+
* @param options.defaultValue Default value for the property.
|
|
89
|
+
*/
|
|
90
|
+
export declare function fillToolbar<
|
|
91
|
+
TView extends View,
|
|
92
|
+
TPropertyName extends keyof TView
|
|
93
|
+
>(options: {
|
|
94
|
+
view: TView;
|
|
95
|
+
icons: Record<string, string>;
|
|
96
|
+
toolbar: ToolbarView;
|
|
97
|
+
labels: Record<number, string>;
|
|
98
|
+
propertyName: TPropertyName;
|
|
99
|
+
nameToValue?: (name: string) => string;
|
|
100
|
+
defaultValue?: string;
|
|
98
101
|
}): void;
|
|
99
102
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
* color: 'hsl(0, 0%, 0%)',
|
|
111
|
-
* label: 'Black'
|
|
112
|
-
* },
|
|
113
|
-
* {
|
|
114
|
-
* color: 'hsl(0, 0%, 30%)',
|
|
115
|
-
* label: 'Dim grey'
|
|
116
|
-
* },
|
|
117
|
-
* {
|
|
118
|
-
* color: 'hsl(0, 0%, 60%)',
|
|
119
|
-
* label: 'Grey'
|
|
120
|
-
* },
|
|
121
|
-
* {
|
|
122
|
-
* color: 'hsl(0, 0%, 90%)',
|
|
123
|
-
* label: 'Light grey'
|
|
124
|
-
* },
|
|
125
|
-
* {
|
|
126
|
-
* color: 'hsl(0, 0%, 100%)',
|
|
127
|
-
* label: 'White',
|
|
128
|
-
* hasBorder: true
|
|
129
|
-
* },
|
|
130
|
-
* {
|
|
131
|
-
* color: 'hsl(0, 75%, 60%)',
|
|
132
|
-
* label: 'Red'
|
|
133
|
-
* },
|
|
134
|
-
* {
|
|
135
|
-
* color: 'hsl(30, 75%, 60%)',
|
|
136
|
-
* label: 'Orange'
|
|
137
|
-
* },
|
|
138
|
-
* {
|
|
139
|
-
* color: 'hsl(60, 75%, 60%)',
|
|
140
|
-
* label: 'Yellow'
|
|
141
|
-
* },
|
|
142
|
-
* {
|
|
143
|
-
* color: 'hsl(90, 75%, 60%)',
|
|
144
|
-
* label: 'Light green'
|
|
145
|
-
* },
|
|
146
|
-
* {
|
|
147
|
-
* color: 'hsl(120, 75%, 60%)',
|
|
148
|
-
* label: 'Green'
|
|
149
|
-
* },
|
|
150
|
-
* {
|
|
151
|
-
* color: 'hsl(150, 75%, 60%)',
|
|
152
|
-
* label: 'Aquamarine'
|
|
153
|
-
* },
|
|
154
|
-
* {
|
|
155
|
-
* color: 'hsl(180, 75%, 60%)',
|
|
156
|
-
* label: 'Turquoise'
|
|
157
|
-
* },
|
|
158
|
-
* {
|
|
159
|
-
* color: 'hsl(210, 75%, 60%)',
|
|
160
|
-
* label: 'Light blue'
|
|
161
|
-
* },
|
|
162
|
-
* {
|
|
163
|
-
* color: 'hsl(240, 75%, 60%)',
|
|
164
|
-
* label: 'Blue'
|
|
165
|
-
* },
|
|
166
|
-
* {
|
|
167
|
-
* color: 'hsl(270, 75%, 60%)',
|
|
168
|
-
* label: 'Purple'
|
|
169
|
-
* }
|
|
170
|
-
* ];
|
|
171
|
-
* ```
|
|
172
|
-
*
|
|
173
|
-
* @internal
|
|
174
|
-
*/
|
|
103
|
+
* A default color palette used by various user interfaces related to tables, for instance,
|
|
104
|
+
* by {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI} or
|
|
105
|
+
* {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI}.
|
|
106
|
+
*
|
|
107
|
+
* The color palette follows the {@link module:table/tableconfig~TableColorConfig table color configuration format}
|
|
108
|
+
* and is shared with the other features that display a color grid. See
|
|
109
|
+
* {@link module:ui/colorgrid/colors~defaultColors} for its contents.
|
|
110
|
+
*
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
175
113
|
export declare const defaultColors: Array<ColorOption>;
|
|
176
114
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
115
|
+
* Returns a creator for a color input with a label.
|
|
116
|
+
*
|
|
117
|
+
* For given options, it returns a function that creates an instance of a
|
|
118
|
+
* {@link module:table/ui/colorinputview~ColorInputView color input} logically related to
|
|
119
|
+
* a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in the DOM.
|
|
120
|
+
*
|
|
121
|
+
* The helper does the following:
|
|
122
|
+
*
|
|
123
|
+
* * It sets the color input `id` and `ariaDescribedById` attributes.
|
|
124
|
+
* * It binds the color input `isReadOnly` to the labeled view.
|
|
125
|
+
* * It binds the color input `hasError` to the labeled view.
|
|
126
|
+
* * It enables a logic that cleans up the error when the user starts typing in the color input.
|
|
127
|
+
*
|
|
128
|
+
* Usage:
|
|
129
|
+
*
|
|
130
|
+
* ```ts
|
|
131
|
+
* const colorInputCreator = getLabeledColorInputCreator( {
|
|
132
|
+
* colorConfig: [ ... ],
|
|
133
|
+
* columns: 3,
|
|
134
|
+
* } );
|
|
135
|
+
*
|
|
136
|
+
* const labeledInputView = new LabeledFieldView( locale, colorInputCreator );
|
|
137
|
+
* console.log( labeledInputView.view ); // A color input instance.
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* @internal
|
|
141
|
+
* @param options Color input options.
|
|
142
|
+
* @param options.colorConfig The configuration of the color palette displayed in the input's dropdown.
|
|
143
|
+
* @param options.columns The configuration of the number of columns the color palette consists of in the input's dropdown.
|
|
144
|
+
* @param options.defaultColorValue If specified, the color input view will replace the "Remove color" button with
|
|
145
|
+
* the "Restore default" button. Instead of clearing the input field, the default color value will be set.
|
|
146
|
+
* @param options.colorPickerConfig The configuration of the color picker. You could disable it or define your output format.
|
|
147
|
+
*/
|
|
210
148
|
export declare function getLabeledColorInputCreator(options: {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
149
|
+
colorConfig: Array<NormalizedColorOption>;
|
|
150
|
+
columns?: number;
|
|
151
|
+
defaultColorValue?: string;
|
|
152
|
+
colorPickerConfig: false | ColorPickerConfig;
|
|
215
153
|
}): (labeledFieldView: LabeledFieldView, viewUid: string, statusUid: string) => ColorInputView;
|