@ckeditor/ckeditor5-table 45.2.1-alpha.9 → 46.0.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/build/table.js +1 -1
- package/dist/index-content.css +6 -5
- package/dist/index-editor.css +46 -46
- package/dist/index.css +63 -62
- package/dist/index.css.map +1 -1
- package/dist/index.js +305 -49
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/commands/insertcolumncommand.d.ts +1 -1
- package/src/commands/insertcolumncommand.js +1 -1
- package/src/commands/insertrowcommand.d.ts +1 -1
- package/src/commands/insertrowcommand.js +1 -1
- package/src/commands/inserttablecommand.d.ts +1 -1
- package/src/commands/inserttablecommand.js +1 -1
- package/src/commands/inserttablelayoutcommand.d.ts +1 -1
- package/src/commands/inserttablelayoutcommand.js +1 -1
- package/src/commands/mergecellcommand.d.ts +3 -3
- package/src/commands/mergecellcommand.js +2 -2
- package/src/commands/mergecellscommand.d.ts +1 -1
- package/src/commands/mergecellscommand.js +2 -2
- package/src/commands/removecolumncommand.d.ts +1 -1
- package/src/commands/removecolumncommand.js +2 -2
- package/src/commands/removerowcommand.d.ts +1 -1
- package/src/commands/removerowcommand.js +1 -1
- package/src/commands/selectcolumncommand.d.ts +1 -1
- package/src/commands/selectcolumncommand.js +2 -2
- package/src/commands/selectrowcommand.d.ts +1 -1
- package/src/commands/selectrowcommand.js +1 -1
- package/src/commands/setheadercolumncommand.d.ts +2 -2
- package/src/commands/setheadercolumncommand.js +1 -1
- package/src/commands/setheaderrowcommand.d.ts +2 -2
- package/src/commands/setheaderrowcommand.js +1 -1
- package/src/commands/splitcellcommand.d.ts +1 -1
- package/src/commands/splitcellcommand.js +1 -1
- package/src/converters/downcast.d.ts +21 -9
- package/src/converters/downcast.js +11 -3
- package/src/converters/table-caption-post-fixer.d.ts +3 -1
- package/src/converters/table-caption-post-fixer.js +3 -1
- package/src/converters/table-cell-paragraph-post-fixer.d.ts +3 -1
- package/src/converters/table-cell-paragraph-post-fixer.js +3 -1
- package/src/converters/table-cell-refresh-handler.d.ts +3 -1
- package/src/converters/table-cell-refresh-handler.js +3 -1
- package/src/converters/table-headings-refresh-handler.d.ts +3 -1
- package/src/converters/table-headings-refresh-handler.js +4 -2
- package/src/converters/table-layout-post-fixer.d.ts +3 -1
- package/src/converters/table-layout-post-fixer.js +4 -2
- package/src/converters/tableproperties.d.ts +17 -1
- package/src/converters/tableproperties.js +49 -2
- package/src/converters/upcasttable.d.ts +6 -1
- package/src/converters/upcasttable.js +6 -1
- package/src/index.d.ts +89 -56
- package/src/index.js +84 -24
- package/src/plaintableoutput.d.ts +2 -2
- package/src/plaintableoutput.js +2 -2
- package/src/table.d.ts +7 -7
- package/src/table.js +7 -7
- package/src/tablecaption/tablecaptionediting.d.ts +6 -6
- package/src/tablecaption/tablecaptionediting.js +8 -8
- package/src/tablecaption/tablecaptionui.d.ts +1 -1
- package/src/tablecaption/tablecaptionui.js +1 -1
- package/src/tablecaption/toggletablecaptioncommand.d.ts +1 -1
- package/src/tablecaption/toggletablecaptioncommand.js +1 -1
- package/src/tablecaption/utils.d.ts +8 -4
- package/src/tablecaption/utils.js +4 -0
- package/src/tablecaption.d.ts +3 -3
- package/src/tablecaption.js +3 -3
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.d.ts +2 -2
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.d.ts +4 -4
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellborderstylecommand.d.ts +4 -4
- package/src/tablecellproperties/commands/tablecellborderstylecommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.d.ts +4 -4
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellheightcommand.d.ts +2 -2
- package/src/tablecellproperties/commands/tablecellheightcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.d.ts +2 -2
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellpaddingcommand.d.ts +4 -4
- package/src/tablecellproperties/commands/tablecellpaddingcommand.js +2 -2
- package/src/tablecellproperties/commands/tablecellpropertycommand.d.ts +3 -3
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.d.ts +2 -2
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +2 -2
- package/src/tablecellproperties/tablecellpropertiesediting.d.ts +3 -3
- package/src/tablecellproperties/tablecellpropertiesediting.js +44 -19
- package/src/tablecellproperties/tablecellpropertiesui.d.ts +2 -2
- package/src/tablecellproperties/tablecellpropertiesui.js +2 -2
- package/src/tablecellproperties/ui/tablecellpropertiesview.d.ts +2 -2
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +1 -1
- package/src/tablecellproperties.d.ts +3 -3
- package/src/tablecellproperties.js +3 -3
- package/src/tablecellwidth/commands/tablecellwidthcommand.d.ts +2 -2
- package/src/tablecellwidth/commands/tablecellwidthcommand.js +2 -2
- package/src/tablecellwidth/tablecellwidthediting.d.ts +2 -2
- package/src/tablecellwidth/tablecellwidthediting.js +5 -3
- package/src/tableclipboard.d.ts +6 -6
- package/src/tableclipboard.js +4 -4
- package/src/tablecolumnresize/constants.d.ts +9 -0
- package/src/tablecolumnresize/constants.js +9 -0
- package/src/tablecolumnresize/converters.d.ts +11 -1
- package/src/tablecolumnresize/converters.js +16 -0
- package/src/tablecolumnresize/tablecolumnresizeediting.d.ts +7 -7
- package/src/tablecolumnresize/tablecolumnresizeediting.js +13 -11
- package/src/tablecolumnresize/tablewidthscommand.d.ts +3 -3
- package/src/tablecolumnresize/tablewidthscommand.js +1 -1
- package/src/tablecolumnresize/utils.d.ts +23 -11
- package/src/tablecolumnresize/utils.js +14 -2
- package/src/tablecolumnresize.d.ts +3 -3
- package/src/tablecolumnresize.js +3 -3
- package/src/tableconfig.d.ts +3 -1
- package/src/tableediting.d.ts +7 -7
- package/src/tableediting.js +19 -19
- package/src/tablekeyboard.d.ts +8 -8
- package/src/tablekeyboard.js +7 -7
- package/src/tablelayout/commands/tabletypecommand.d.ts +1 -1
- package/src/tablelayout/commands/tabletypecommand.js +1 -1
- package/src/tablelayout/tablelayoutediting.d.ts +2 -2
- package/src/tablelayout/tablelayoutediting.js +4 -4
- package/src/tablelayout/tablelayoutui.d.ts +1 -1
- package/src/tablelayout/tablelayoutui.js +4 -4
- package/src/tablelayout.d.ts +5 -5
- package/src/tablelayout.js +5 -5
- package/src/tablemouse/mouseeventsobserver.d.ts +13 -11
- package/src/tablemouse/mouseeventsobserver.js +4 -2
- package/src/tablemouse.d.ts +3 -3
- package/src/tablemouse.js +4 -4
- package/src/tableproperties/commands/tablealignmentcommand.d.ts +2 -2
- package/src/tableproperties/commands/tablealignmentcommand.js +2 -2
- package/src/tableproperties/commands/tablebackgroundcolorcommand.d.ts +2 -2
- package/src/tableproperties/commands/tablebackgroundcolorcommand.js +2 -2
- package/src/tableproperties/commands/tablebordercolorcommand.d.ts +4 -4
- package/src/tableproperties/commands/tablebordercolorcommand.js +2 -2
- package/src/tableproperties/commands/tableborderstylecommand.d.ts +4 -4
- package/src/tableproperties/commands/tableborderstylecommand.js +2 -2
- package/src/tableproperties/commands/tableborderwidthcommand.d.ts +4 -4
- package/src/tableproperties/commands/tableborderwidthcommand.js +2 -2
- package/src/tableproperties/commands/tableheightcommand.d.ts +2 -2
- package/src/tableproperties/commands/tableheightcommand.js +2 -2
- package/src/tableproperties/commands/tablepropertycommand.d.ts +4 -4
- package/src/tableproperties/commands/tablepropertycommand.js +1 -1
- package/src/tableproperties/commands/tablewidthcommand.d.ts +2 -2
- package/src/tableproperties/commands/tablewidthcommand.js +2 -2
- package/src/tableproperties/tablepropertiesediting.d.ts +2 -2
- package/src/tableproperties/tablepropertiesediting.js +49 -21
- package/src/tableproperties/tablepropertiesui.d.ts +2 -2
- package/src/tableproperties/tablepropertiesui.js +2 -2
- package/src/tableproperties/ui/tablepropertiesview.d.ts +2 -2
- package/src/tableproperties/ui/tablepropertiesview.js +1 -1
- package/src/tableproperties.d.ts +3 -3
- package/src/tableproperties.js +3 -3
- package/src/tableselection.d.ts +9 -9
- package/src/tableselection.js +4 -4
- package/src/tabletoolbar.d.ts +1 -1
- package/src/tabletoolbar.js +1 -1
- package/src/tableui.d.ts +1 -1
- package/src/tableui.js +4 -4
- package/src/tableutils.d.ts +25 -26
- package/src/tableutils.js +4 -4
- package/src/tablewalker.d.ts +8 -8
- package/src/tablewalker.js +2 -2
- package/src/ui/colorinputview.d.ts +6 -1
- package/src/ui/colorinputview.js +1 -1
- package/src/ui/inserttableview.d.ts +3 -1
- package/src/ui/inserttableview.js +3 -1
- package/src/utils/common.d.ts +16 -7
- package/src/utils/common.js +9 -1
- package/src/utils/structure.d.ts +24 -14
- package/src/utils/structure.js +11 -1
- package/src/utils/table-properties.d.ts +15 -2
- package/src/utils/table-properties.js +6 -0
- package/src/utils/ui/contextualballoon.d.ts +4 -3
- package/src/utils/ui/contextualballoon.js +1 -0
- package/src/utils/ui/table-properties.d.ts +20 -7
- package/src/utils/ui/table-properties.js +24 -11
- package/src/utils/ui/widget.d.ts +6 -0
- package/src/utils/ui/widget.js +6 -0
- package/theme/tablecaption.css +9 -8
- package/theme/tablecolumnresize.css +2 -2
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { type ColorOption, type LabeledFieldView, type ListDropdownItemDefinition, type NormalizedColorOption, type ToolbarView, type View, type ColorPickerConfig } from 'ckeditor5/src/ui.js';
|
|
9
9
|
import { Collection, type LocaleTranslate } from 'ckeditor5/src/utils.js';
|
|
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';
|
|
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
14
|
* Returns an object containing pairs of CSS border style values and their localized UI
|
|
15
15
|
* labels. Used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
|
|
16
16
|
* and {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}.
|
|
17
17
|
*
|
|
18
|
+
* @internal
|
|
18
19
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
19
20
|
*/
|
|
20
21
|
export declare function getBorderStyleLabels(t: LocaleTranslate): Record<string, string>;
|
|
@@ -22,6 +23,7 @@ export declare function getBorderStyleLabels(t: LocaleTranslate): Record<string,
|
|
|
22
23
|
* Returns a localized error string that can be displayed next to color (background, border)
|
|
23
24
|
* fields that have an invalid value.
|
|
24
25
|
*
|
|
26
|
+
* @internal
|
|
25
27
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
26
28
|
*/
|
|
27
29
|
export declare function getLocalizedColorErrorText(t: LocaleTranslate): string;
|
|
@@ -29,6 +31,7 @@ export declare function getLocalizedColorErrorText(t: LocaleTranslate): string;
|
|
|
29
31
|
* Returns a localized error string that can be displayed next to length (padding, border width)
|
|
30
32
|
* fields that have an invalid value.
|
|
31
33
|
*
|
|
34
|
+
* @internal
|
|
32
35
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
33
36
|
*/
|
|
34
37
|
export declare function getLocalizedLengthErrorText(t: LocaleTranslate): string;
|
|
@@ -36,27 +39,34 @@ export declare function getLocalizedLengthErrorText(t: LocaleTranslate): string;
|
|
|
36
39
|
* Returns `true` when the passed value is an empty string or a valid CSS color expression.
|
|
37
40
|
* Otherwise, `false` is returned.
|
|
38
41
|
*
|
|
39
|
-
* See {@link module:engine/view/styles/utils~
|
|
42
|
+
* See {@link module:engine/view/styles/utils~isColorStyleValue}.
|
|
43
|
+
*
|
|
44
|
+
* @internal
|
|
40
45
|
*/
|
|
41
46
|
export declare function colorFieldValidator(value: string): boolean;
|
|
42
47
|
/**
|
|
43
48
|
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
44
49
|
* Otherwise, `false` is returned.
|
|
45
50
|
*
|
|
46
|
-
* See {@link module:engine/view/styles/utils~
|
|
47
|
-
* See {@link module:engine/view/styles/utils~
|
|
51
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
52
|
+
* See {@link module:engine/view/styles/utils~isPercentageStyleValue}.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
48
55
|
*/
|
|
49
56
|
export declare function lengthFieldValidator(value: string): boolean;
|
|
50
57
|
/**
|
|
51
58
|
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
52
59
|
* Otherwise, `false` is returned.
|
|
53
60
|
*
|
|
54
|
-
* See {@link module:engine/view/styles/utils~
|
|
61
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
62
|
+
*
|
|
63
|
+
* @internal
|
|
55
64
|
*/
|
|
56
65
|
export declare function lineWidthFieldValidator(value: string): boolean;
|
|
57
66
|
/**
|
|
58
67
|
* Generates item definitions for a UI dropdown that allows changing the border style of a table or a table cell.
|
|
59
68
|
*
|
|
69
|
+
* @internal
|
|
60
70
|
* @param defaultStyle The default border.
|
|
61
71
|
*/
|
|
62
72
|
export declare function getBorderStyleDefinitions(view: TableCellPropertiesView | TablePropertiesView, defaultStyle: string): Collection<ListDropdownItemDefinition>;
|
|
@@ -67,6 +77,7 @@ export declare function getBorderStyleDefinitions(view: TableCellPropertiesView
|
|
|
67
77
|
* * have some icons,
|
|
68
78
|
* * set a certain UI view property value upon execution.
|
|
69
79
|
*
|
|
80
|
+
* @internal
|
|
70
81
|
* @param options Configuration options
|
|
71
82
|
* @param options.view The view that has the observable property.
|
|
72
83
|
* @param options.icons Object with button icons.
|
|
@@ -158,6 +169,8 @@ export declare function fillToolbar<TView extends View, TPropertyName extends ke
|
|
|
158
169
|
* }
|
|
159
170
|
* ];
|
|
160
171
|
* ```
|
|
172
|
+
*
|
|
173
|
+
* @internal
|
|
161
174
|
*/
|
|
162
175
|
export declare const defaultColors: Array<ColorOption>;
|
|
163
176
|
/**
|
|
@@ -5,16 +5,17 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module table/utils/ui/table-properties
|
|
7
7
|
*/
|
|
8
|
-
import { ButtonView,
|
|
8
|
+
import { ButtonView, UIModel } from 'ckeditor5/src/ui.js';
|
|
9
9
|
import { Collection } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import {
|
|
11
|
-
import ColorInputView from '../../ui/colorinputview.js';
|
|
10
|
+
import { isColorStyleValue, isLengthStyleValue, isPercentageStyleValue } from 'ckeditor5/src/engine.js';
|
|
11
|
+
import { ColorInputView } from '../../ui/colorinputview.js';
|
|
12
12
|
const isEmpty = (val) => val === '';
|
|
13
13
|
/**
|
|
14
14
|
* Returns an object containing pairs of CSS border style values and their localized UI
|
|
15
15
|
* labels. Used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
|
|
16
16
|
* and {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}.
|
|
17
17
|
*
|
|
18
|
+
* @internal
|
|
18
19
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
19
20
|
*/
|
|
20
21
|
export function getBorderStyleLabels(t) {
|
|
@@ -34,6 +35,7 @@ export function getBorderStyleLabels(t) {
|
|
|
34
35
|
* Returns a localized error string that can be displayed next to color (background, border)
|
|
35
36
|
* fields that have an invalid value.
|
|
36
37
|
*
|
|
38
|
+
* @internal
|
|
37
39
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
38
40
|
*/
|
|
39
41
|
export function getLocalizedColorErrorText(t) {
|
|
@@ -43,6 +45,7 @@ export function getLocalizedColorErrorText(t) {
|
|
|
43
45
|
* Returns a localized error string that can be displayed next to length (padding, border width)
|
|
44
46
|
* fields that have an invalid value.
|
|
45
47
|
*
|
|
48
|
+
* @internal
|
|
46
49
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
47
50
|
*/
|
|
48
51
|
export function getLocalizedLengthErrorText(t) {
|
|
@@ -52,36 +55,43 @@ export function getLocalizedLengthErrorText(t) {
|
|
|
52
55
|
* Returns `true` when the passed value is an empty string or a valid CSS color expression.
|
|
53
56
|
* Otherwise, `false` is returned.
|
|
54
57
|
*
|
|
55
|
-
* See {@link module:engine/view/styles/utils~
|
|
58
|
+
* See {@link module:engine/view/styles/utils~isColorStyleValue}.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
56
61
|
*/
|
|
57
62
|
export function colorFieldValidator(value) {
|
|
58
63
|
value = value.trim().toLowerCase();
|
|
59
|
-
return isEmpty(value) ||
|
|
64
|
+
return isEmpty(value) || isColorStyleValue(value);
|
|
60
65
|
}
|
|
61
66
|
/**
|
|
62
67
|
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
63
68
|
* Otherwise, `false` is returned.
|
|
64
69
|
*
|
|
65
|
-
* See {@link module:engine/view/styles/utils~
|
|
66
|
-
* See {@link module:engine/view/styles/utils~
|
|
70
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
71
|
+
* See {@link module:engine/view/styles/utils~isPercentageStyleValue}.
|
|
72
|
+
*
|
|
73
|
+
* @internal
|
|
67
74
|
*/
|
|
68
75
|
export function lengthFieldValidator(value) {
|
|
69
76
|
value = value.trim();
|
|
70
|
-
return isEmpty(value) || isNumberString(value) ||
|
|
77
|
+
return isEmpty(value) || isNumberString(value) || isLengthStyleValue(value) || isPercentageStyleValue(value);
|
|
71
78
|
}
|
|
72
79
|
/**
|
|
73
80
|
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
74
81
|
* Otherwise, `false` is returned.
|
|
75
82
|
*
|
|
76
|
-
* See {@link module:engine/view/styles/utils~
|
|
83
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
84
|
+
*
|
|
85
|
+
* @internal
|
|
77
86
|
*/
|
|
78
87
|
export function lineWidthFieldValidator(value) {
|
|
79
88
|
value = value.trim();
|
|
80
|
-
return isEmpty(value) || isNumberString(value) ||
|
|
89
|
+
return isEmpty(value) || isNumberString(value) || isLengthStyleValue(value);
|
|
81
90
|
}
|
|
82
91
|
/**
|
|
83
92
|
* Generates item definitions for a UI dropdown that allows changing the border style of a table or a table cell.
|
|
84
93
|
*
|
|
94
|
+
* @internal
|
|
85
95
|
* @param defaultStyle The default border.
|
|
86
96
|
*/
|
|
87
97
|
export function getBorderStyleDefinitions(view, defaultStyle) {
|
|
@@ -90,7 +100,7 @@ export function getBorderStyleDefinitions(view, defaultStyle) {
|
|
|
90
100
|
for (const style in styleLabels) {
|
|
91
101
|
const definition = {
|
|
92
102
|
type: 'button',
|
|
93
|
-
model: new
|
|
103
|
+
model: new UIModel({
|
|
94
104
|
_borderStyleValue: style,
|
|
95
105
|
label: styleLabels[style],
|
|
96
106
|
role: 'menuitemradio',
|
|
@@ -121,6 +131,7 @@ export function getBorderStyleDefinitions(view, defaultStyle) {
|
|
|
121
131
|
* * have some icons,
|
|
122
132
|
* * set a certain UI view property value upon execution.
|
|
123
133
|
*
|
|
134
|
+
* @internal
|
|
124
135
|
* @param options Configuration options
|
|
125
136
|
* @param options.view The view that has the observable property.
|
|
126
137
|
* @param options.icons Object with button icons.
|
|
@@ -237,6 +248,8 @@ export function fillToolbar(options) {
|
|
|
237
248
|
* }
|
|
238
249
|
* ];
|
|
239
250
|
* ```
|
|
251
|
+
*
|
|
252
|
+
* @internal
|
|
240
253
|
*/
|
|
241
254
|
export const defaultColors = [
|
|
242
255
|
{
|
package/src/utils/ui/widget.d.ts
CHANGED
|
@@ -8,13 +8,19 @@
|
|
|
8
8
|
import type { ViewDocumentSelection, ViewElement } from 'ckeditor5/src/engine.js';
|
|
9
9
|
/**
|
|
10
10
|
* Depending on the position of the selection either return the selected table or the table higher in the hierarchy.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
11
13
|
*/
|
|
12
14
|
export declare function getSelectionAffectedTableWidget(selection: ViewDocumentSelection): ViewElement | null;
|
|
13
15
|
/**
|
|
14
16
|
* Returns a table widget editing view element if one is selected.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
15
19
|
*/
|
|
16
20
|
export declare function getSelectedTableWidget(selection: ViewDocumentSelection): ViewElement | null;
|
|
17
21
|
/**
|
|
18
22
|
* Returns a table widget editing view element if one is among the selection's ancestors.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
19
25
|
*/
|
|
20
26
|
export declare function getTableWidgetAncestor(selection: ViewDocumentSelection): ViewElement | null;
|
package/src/utils/ui/widget.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import { isWidget } from 'ckeditor5/src/widget.js';
|
|
6
6
|
/**
|
|
7
7
|
* Depending on the position of the selection either return the selected table or the table higher in the hierarchy.
|
|
8
|
+
*
|
|
9
|
+
* @internal
|
|
8
10
|
*/
|
|
9
11
|
export function getSelectionAffectedTableWidget(selection) {
|
|
10
12
|
const selectedTable = getSelectedTableWidget(selection);
|
|
@@ -15,6 +17,8 @@ export function getSelectionAffectedTableWidget(selection) {
|
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
19
|
* Returns a table widget editing view element if one is selected.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
18
22
|
*/
|
|
19
23
|
export function getSelectedTableWidget(selection) {
|
|
20
24
|
const viewElement = selection.getSelectedElement();
|
|
@@ -25,6 +29,8 @@ export function getSelectedTableWidget(selection) {
|
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
31
|
* Returns a table widget editing view element if one is among the selection's ancestors.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
28
34
|
*/
|
|
29
35
|
export function getTableWidgetAncestor(selection) {
|
|
30
36
|
const selectionPosition = selection.getFirstPosition();
|
package/theme/tablecaption.css
CHANGED
|
@@ -6,19 +6,20 @@
|
|
|
6
6
|
@import "@ckeditor/ckeditor5-ui/theme/mixins/_mediacolors.css";
|
|
7
7
|
|
|
8
8
|
:root {
|
|
9
|
-
--ck-color-
|
|
10
|
-
--ck-color-
|
|
11
|
-
--ck-color-
|
|
9
|
+
--ck-content-color-table-caption-background: hsl(0, 0%, 97%);
|
|
10
|
+
--ck-content-color-table-caption-text: hsl(0, 0%, 20%);
|
|
11
|
+
--ck-color-table-caption-highlighted-background: hsl(52deg 100% 50%);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/* Content styles */
|
|
15
15
|
.ck-content .table > figcaption {
|
|
16
16
|
display: table-caption;
|
|
17
17
|
caption-side: top;
|
|
18
|
-
word-break:
|
|
18
|
+
word-break: normal;
|
|
19
|
+
overflow-wrap: anywhere;
|
|
19
20
|
text-align: center;
|
|
20
|
-
color: var(--ck-color-
|
|
21
|
-
background-color: var(--ck-color-
|
|
21
|
+
color: var(--ck-content-color-table-caption-text);
|
|
22
|
+
background-color: var(--ck-content-color-table-caption-background);
|
|
22
23
|
padding: .6em;
|
|
23
24
|
font-size: .75em;
|
|
24
25
|
outline-offset: -1px;
|
|
@@ -54,10 +55,10 @@
|
|
|
54
55
|
|
|
55
56
|
@keyframes ck-table-caption-highlight {
|
|
56
57
|
0% {
|
|
57
|
-
background-color: var(--ck-color-
|
|
58
|
+
background-color: var(--ck-color-table-caption-highlighted-background);
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
100% {
|
|
61
|
-
background-color: var(--ck-color-
|
|
62
|
+
background-color: var(--ck-content-color-table-caption-background);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
:root {
|
|
7
|
-
--ck-color-
|
|
7
|
+
--ck-color-table-column-resizer-hover: var(--ck-color-base-active);
|
|
8
8
|
--ck-table-column-resizer-width: 7px;
|
|
9
9
|
|
|
10
10
|
/* The offset used for absolute positioning of the resizer element, so that it is placed exactly above the cell border.
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
.ck.ck-editor__editable .table .ck-table-column-resizer:hover,
|
|
54
54
|
.ck.ck-editor__editable .table .ck-table-column-resizer__active {
|
|
55
|
-
background-color: var(--ck-color-
|
|
55
|
+
background-color: var(--ck-color-table-column-resizer-hover);
|
|
56
56
|
opacity: 0.25;
|
|
57
57
|
}
|
|
58
58
|
|