@ckeditor/ckeditor5-table 45.2.1 → 46.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/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 +306 -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 +5 -3
- package/src/utils/ui/contextualballoon.js +2 -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
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import { Command, Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
|
|
|
6
6
|
import { toWidgetEditable, toWidget, Widget, isWidget, WidgetToolbarRepository } from '@ckeditor/ckeditor5-widget/dist/index.js';
|
|
7
7
|
import { first, global, CKEditorError, KeystrokeHandler, FocusTracker, Collection, getLocalizedArrowKeyCodeDirection, Rect, DomEmitterMixin, toUnit } from '@ckeditor/ckeditor5-utils/dist/index.js';
|
|
8
8
|
import { IconTable, IconTableColumn, IconTableRow, IconTableMergeCell, IconCheck, IconCancel, IconAlignBottom, IconAlignMiddle, IconAlignTop, IconAlignJustify, IconAlignRight, IconAlignCenter, IconAlignLeft, IconTableCellProperties, IconTableLayout, IconTableProperties, IconObjectInlineRight, IconObjectCenter, IconObjectInlineLeft, IconCaption } from '@ckeditor/ckeditor5-icons/dist/index.js';
|
|
9
|
-
import { View, addKeyboardHandlingForGrid, ButtonView, createDropdown, MenuBarMenuView, SwitchButtonView, SplitButtonView, addListToDropdown,
|
|
9
|
+
import { View, addKeyboardHandlingForGrid, ButtonView, createDropdown, MenuBarMenuView, SwitchButtonView, SplitButtonView, addListToDropdown, UIModel, ViewCollection, FocusCycler, InputTextView, ColorSelectorView, FormHeaderView, FormRowView, submitHandler, LabelView, LabeledFieldView, createLabeledDropdown, createLabeledInputText, ToolbarView, BalloonPanelView, ContextualBalloon, normalizeColorOptions, getLocalizedColorOptions, clickOutsideHandler, DropdownButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';
|
|
10
10
|
import { ClipboardMarkersUtils, ClipboardPipeline } from '@ckeditor/ckeditor5-clipboard/dist/index.js';
|
|
11
|
-
import { DomEventObserver,
|
|
11
|
+
import { DomEventObserver, isColorStyleValue, isLengthStyleValue, isPercentageStyleValue, addBorderStylesRules, addPaddingStylesRules, addBackgroundStylesRules, enableViewPlaceholder, ModelElement } from '@ckeditor/ckeditor5-engine/dist/index.js';
|
|
12
12
|
import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -16,11 +16,14 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
16
16
|
*
|
|
17
17
|
* @param options.modelAttribute The attribute to set.
|
|
18
18
|
* @param options.styleName The style name to convert.
|
|
19
|
+
* @param options.attributeName The HTML attribute name to convert.
|
|
20
|
+
* @param options.attributeType The HTML attribute type for value normalization.
|
|
19
21
|
* @param options.viewElement The view element name that should be converted.
|
|
20
22
|
* @param options.defaultValue The default value for the specified `modelAttribute`.
|
|
21
23
|
* @param options.shouldUpcast The function which returns `true` if style should be upcasted from this element.
|
|
24
|
+
* @internal
|
|
22
25
|
*/ function upcastStyleToAttribute(conversion, options) {
|
|
23
|
-
const { modelAttribute, styleName, viewElement, defaultValue, reduceBoxSides = false
|
|
26
|
+
const { modelAttribute, styleName, attributeName, attributeType, viewElement, defaultValue, reduceBoxSides = false } = options;
|
|
24
27
|
conversion.for('upcast').attributeToAttribute({
|
|
25
28
|
view: {
|
|
26
29
|
name: viewElement,
|
|
@@ -31,7 +34,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
31
34
|
model: {
|
|
32
35
|
key: modelAttribute,
|
|
33
36
|
value: (viewElement, conversionApi, data)=>{
|
|
34
|
-
|
|
37
|
+
// Ignore table elements inside figures and figures without the table class.
|
|
38
|
+
if (viewElement.name == 'table' && viewElement.parent.name == 'figure' || viewElement.name == 'figure' && !viewElement.hasClass('table')) {
|
|
35
39
|
return;
|
|
36
40
|
}
|
|
37
41
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
|
|
@@ -40,9 +44,46 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
40
44
|
if (localDefaultValue !== value) {
|
|
41
45
|
return value;
|
|
42
46
|
}
|
|
47
|
+
// Consume the style even if not applied to the element so it won't be processed by other converters.
|
|
48
|
+
conversionApi.consumable.consume(viewElement, {
|
|
49
|
+
styles: styleName
|
|
50
|
+
});
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
});
|
|
54
|
+
if (attributeName) {
|
|
55
|
+
conversion.for('upcast').attributeToAttribute({
|
|
56
|
+
view: {
|
|
57
|
+
name: viewElement,
|
|
58
|
+
attributes: {
|
|
59
|
+
[attributeName]: /.+/
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
model: {
|
|
63
|
+
key: modelAttribute,
|
|
64
|
+
value: (viewElement, conversionApi, data)=>{
|
|
65
|
+
// Convert attributes of table and table cell elements, ignore figure.
|
|
66
|
+
// Do not convert attribute if related style is set as it has a higher priority.
|
|
67
|
+
// Do not convert attribute if the element is a table inside a figure with the related style set.
|
|
68
|
+
if (viewElement.name == 'figure' || viewElement.hasStyle(styleName) || viewElement.name == 'table' && viewElement.parent.name == 'figure' && viewElement.parent.hasStyle(styleName)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
|
|
72
|
+
let value = viewElement.getAttribute(attributeName);
|
|
73
|
+
if (value && attributeType == 'length' && !value.endsWith('px')) {
|
|
74
|
+
value += 'px';
|
|
75
|
+
}
|
|
76
|
+
if (localDefaultValue !== value) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
// Consume the attribute even if not applied to the element so it won't be processed by other converters.
|
|
80
|
+
conversionApi.consumable.consume(viewElement, {
|
|
81
|
+
attributes: attributeName
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
46
87
|
}
|
|
47
88
|
/**
|
|
48
89
|
* Conversion helper for upcasting border styles for view elements.
|
|
@@ -51,6 +92,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
51
92
|
* @param defaultBorder.color The default `borderColor` value.
|
|
52
93
|
* @param defaultBorder.style The default `borderStyle` value.
|
|
53
94
|
* @param defaultBorder.width The default `borderWidth` value.
|
|
95
|
+
* @internal
|
|
54
96
|
*/ function upcastBorderStyles(conversion, viewElementName, modelAttributes, defaultBorder) {
|
|
55
97
|
conversion.for('upcast').add((dispatcher)=>dispatcher.on('element:' + viewElementName, (evt, data, conversionApi)=>{
|
|
56
98
|
// If the element was not converted by element-to-element converter,
|
|
@@ -124,6 +166,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
124
166
|
}
|
|
125
167
|
/**
|
|
126
168
|
* Conversion helper for downcasting an attribute to a style.
|
|
169
|
+
*
|
|
170
|
+
* @internal
|
|
127
171
|
*/ function downcastAttributeToStyle(conversion, options) {
|
|
128
172
|
const { modelElement, modelAttribute, styleName } = options;
|
|
129
173
|
conversion.for('downcast').attributeToAttribute({
|
|
@@ -141,6 +185,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
141
185
|
}
|
|
142
186
|
/**
|
|
143
187
|
* Conversion helper for downcasting attributes from the model table to a view table (not to `<figure>`).
|
|
188
|
+
*
|
|
189
|
+
* @internal
|
|
144
190
|
*/ function downcastTableAttribute(conversion, options) {
|
|
145
191
|
const { modelAttribute, styleName } = options;
|
|
146
192
|
conversion.for('downcast').add((dispatcher)=>dispatcher.on(`attribute:${modelAttribute}:table`, (evt, data, conversionApi)=>{
|
|
@@ -161,6 +207,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
161
207
|
}
|
|
162
208
|
/**
|
|
163
209
|
* Returns the default value for table or table cell property adjusted for layout tables.
|
|
210
|
+
*
|
|
211
|
+
* @internal
|
|
164
212
|
*/ function getDefaultValueAdjusted(defaultValue, layoutTableDefault, data) {
|
|
165
213
|
const modelElement = data.modelRange && first(data.modelRange.getItems({
|
|
166
214
|
shallow: true
|
|
@@ -201,6 +249,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
201
249
|
/**
|
|
202
250
|
* A common method to update the numeric value. If a value is the default one, it will be unset.
|
|
203
251
|
*
|
|
252
|
+
* @internal
|
|
204
253
|
* @param key An attribute key.
|
|
205
254
|
* @param value The new attribute value.
|
|
206
255
|
* @param item A model item on which the attribute will be set.
|
|
@@ -215,6 +264,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
215
264
|
/**
|
|
216
265
|
* A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.
|
|
217
266
|
*
|
|
267
|
+
* @internal
|
|
218
268
|
* @param writer The model writer.
|
|
219
269
|
* @param insertPosition The position at which the table cell should be inserted.
|
|
220
270
|
* @param attributes The element attributes.
|
|
@@ -227,6 +277,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
227
277
|
}
|
|
228
278
|
/**
|
|
229
279
|
* Checks if a table cell belongs to the heading column section.
|
|
280
|
+
*
|
|
281
|
+
* @internal
|
|
230
282
|
*/ function isHeadingColumnCell(tableUtils, tableCell) {
|
|
231
283
|
const table = tableCell.parent.parent;
|
|
232
284
|
const headingColumns = parseInt(table.getAttribute('headingColumns') || '0');
|
|
@@ -236,6 +288,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
236
288
|
/**
|
|
237
289
|
* Enables conversion for an attribute for simple view-model mappings.
|
|
238
290
|
*
|
|
291
|
+
* @internal
|
|
239
292
|
* @param options.defaultValue The default value for the specified `modelAttribute`.
|
|
240
293
|
*/ function enableProperty$1(schema, conversion, options) {
|
|
241
294
|
const { modelAttribute } = options;
|
|
@@ -244,6 +297,9 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
244
297
|
modelAttribute
|
|
245
298
|
]
|
|
246
299
|
});
|
|
300
|
+
schema.setAttributeProperties(modelAttribute, {
|
|
301
|
+
isFormatting: true
|
|
302
|
+
});
|
|
247
303
|
upcastStyleToAttribute(conversion, {
|
|
248
304
|
viewElement: /^(td|th)$/,
|
|
249
305
|
...options
|
|
@@ -255,6 +311,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
255
311
|
}
|
|
256
312
|
/**
|
|
257
313
|
* Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.
|
|
314
|
+
*
|
|
315
|
+
* @internal
|
|
258
316
|
*/ function getSelectionAffectedTable(selection) {
|
|
259
317
|
const selectedElement = selection.getSelectedElement();
|
|
260
318
|
// Is the command triggered from the `tableToolbar`?
|
|
@@ -276,6 +334,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
276
334
|
* ```xml
|
|
277
335
|
* <table></table>
|
|
278
336
|
* ```
|
|
337
|
+
*
|
|
338
|
+
* @internal
|
|
279
339
|
*/ function upcastTableFigure() {
|
|
280
340
|
return (dispatcher)=>{
|
|
281
341
|
dispatcher.on('element:figure', (evt, data, conversionApi)=>{
|
|
@@ -323,6 +383,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
323
383
|
* This conversion helper converts the table element as well as table rows.
|
|
324
384
|
*
|
|
325
385
|
* @returns Conversion helper.
|
|
386
|
+
* @internal
|
|
326
387
|
*/ function upcastTable() {
|
|
327
388
|
return (dispatcher)=>{
|
|
328
389
|
dispatcher.on('element:table', (evt, data, conversionApi)=>{
|
|
@@ -373,6 +434,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
373
434
|
* *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue
|
|
374
435
|
* of an improper table with all empty rows.
|
|
375
436
|
*
|
|
437
|
+
* @internal
|
|
376
438
|
* @returns Conversion helper.
|
|
377
439
|
*/ function skipEmptyTableRow() {
|
|
378
440
|
return (dispatcher)=>{
|
|
@@ -388,6 +450,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
388
450
|
/**
|
|
389
451
|
* A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.
|
|
390
452
|
*
|
|
453
|
+
* @internal
|
|
391
454
|
* @returns Conversion helper.
|
|
392
455
|
*/ function ensureParagraphInTableCell(elementName) {
|
|
393
456
|
return (dispatcher)=>{
|
|
@@ -950,7 +1013,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
950
1013
|
return this._rowIndex;
|
|
951
1014
|
}
|
|
952
1015
|
/**
|
|
953
|
-
* Returns the {@link module:engine/model/position~
|
|
1016
|
+
* Returns the {@link module:engine/model/position~ModelPosition} before the table slot.
|
|
954
1017
|
*/ getPositionBefore() {
|
|
955
1018
|
const model = this._table.root.document.model;
|
|
956
1019
|
return model.createPositionAt(this._table.getChild(this.row), this._cellIndex);
|
|
@@ -971,6 +1034,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
971
1034
|
|
|
972
1035
|
/**
|
|
973
1036
|
* Model table element to view table element conversion helper.
|
|
1037
|
+
*
|
|
1038
|
+
* @internal
|
|
974
1039
|
*/ function downcastTable(tableUtils, options) {
|
|
975
1040
|
return (table, { writer })=>{
|
|
976
1041
|
const headingRows = table.getAttribute('headingRows') || 0;
|
|
@@ -1003,6 +1068,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1003
1068
|
/**
|
|
1004
1069
|
* Model table row element to view `<tr>` element conversion helper.
|
|
1005
1070
|
*
|
|
1071
|
+
* @internal
|
|
1006
1072
|
* @returns Element creator.
|
|
1007
1073
|
*/ function downcastRow() {
|
|
1008
1074
|
return (tableRow, { writer })=>{
|
|
@@ -1015,6 +1081,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1015
1081
|
* This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)
|
|
1016
1082
|
* and `<td>` otherwise.
|
|
1017
1083
|
*
|
|
1084
|
+
* @internal
|
|
1018
1085
|
* @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
|
|
1019
1086
|
* @returns Element creator.
|
|
1020
1087
|
*/ function downcastCell(options = {}) {
|
|
@@ -1051,6 +1118,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1051
1118
|
* * For a single paragraph without attributes it returns `<span>` to simulate data table.
|
|
1052
1119
|
* * For all other cases it returns `<p>` element.
|
|
1053
1120
|
*
|
|
1121
|
+
* @internal
|
|
1054
1122
|
* @param options.asWidget If set to `true`, the downcast conversion will produce a widget.
|
|
1055
1123
|
* @returns Element creator.
|
|
1056
1124
|
*/ function convertParagraphInTableCell(options = {}) {
|
|
@@ -1080,14 +1148,17 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1080
1148
|
*
|
|
1081
1149
|
* * If returned `true` - to a `<span class="ck-table-bogus-paragraph">`
|
|
1082
1150
|
* * If returned `false` - to a `<p>`
|
|
1151
|
+
*
|
|
1152
|
+
* @internal
|
|
1083
1153
|
*/ function isSingleParagraphWithoutAttributes(modelElement) {
|
|
1084
1154
|
const tableCell = modelElement.parent;
|
|
1085
1155
|
const isSingleParagraph = tableCell.childCount == 1;
|
|
1086
1156
|
return isSingleParagraph && !hasAnyAttribute(modelElement);
|
|
1087
1157
|
}
|
|
1088
1158
|
/**
|
|
1089
|
-
* Converts a given {@link module:engine/view/element~
|
|
1090
|
-
* * Adds a {@link module:engine/view/element~
|
|
1159
|
+
* Converts a given {@link module:engine/view/element~ViewElement} to a table widget:
|
|
1160
|
+
* * Adds a {@link module:engine/view/element~ViewElement#_setCustomProperty custom property}
|
|
1161
|
+
* allowing to recognize the table widget element.
|
|
1091
1162
|
* * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.
|
|
1092
1163
|
*
|
|
1093
1164
|
* @param writer An instance of the view writer.
|
|
@@ -1371,6 +1442,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1371
1442
|
* ├───┼───┬───┤ ├───┤ └───────┴───┘
|
|
1372
1443
|
* 4 │ n │ o │ p │ │ q │
|
|
1373
1444
|
* └───┴───┴───┴───┴───┘
|
|
1445
|
+
*
|
|
1446
|
+
* @internal
|
|
1374
1447
|
*/ function cropTableToDimensions(sourceTable, cropDimensions, writer) {
|
|
1375
1448
|
const { startRow, startColumn, endRow, endColumn } = cropDimensions;
|
|
1376
1449
|
// Initialize the cropped table element.
|
|
@@ -1437,6 +1510,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1437
1510
|
*
|
|
1438
1511
|
* will return slot info for cells: "j", "f", "k".
|
|
1439
1512
|
*
|
|
1513
|
+
* @internal
|
|
1440
1514
|
* @param table The table to check.
|
|
1441
1515
|
* @param overlapRow The index of the row to check.
|
|
1442
1516
|
* @param startRow row to start analysis. Use it when it is known that the cells above that row will not overlap. Default value is 0.
|
|
@@ -1458,6 +1532,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1458
1532
|
/**
|
|
1459
1533
|
* Splits the table cell horizontally.
|
|
1460
1534
|
*
|
|
1535
|
+
* @internal
|
|
1461
1536
|
* @returns Created table cell, if any were created.
|
|
1462
1537
|
*/ function splitHorizontally(tableCell, splitRow, writer) {
|
|
1463
1538
|
const tableRow = tableCell.parent;
|
|
@@ -1520,6 +1595,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1520
1595
|
*
|
|
1521
1596
|
* will return slot info for cells: "b", "e", "i".
|
|
1522
1597
|
*
|
|
1598
|
+
* @internal
|
|
1523
1599
|
* @param table The table to check.
|
|
1524
1600
|
* @param overlapColumn The index of the column to check.
|
|
1525
1601
|
*/ function getHorizontallyOverlappingCells(table, overlapColumn) {
|
|
@@ -1537,6 +1613,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1537
1613
|
/**
|
|
1538
1614
|
* Splits the table cell vertically.
|
|
1539
1615
|
*
|
|
1616
|
+
* @internal
|
|
1540
1617
|
* @param columnIndex The table cell column index.
|
|
1541
1618
|
* @param splitColumn The index of column to split cell on.
|
|
1542
1619
|
* @returns Created table cell.
|
|
@@ -1562,6 +1639,8 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1562
1639
|
*
|
|
1563
1640
|
* If table cell width (or height) covers a column (or row) that is after a limit column (or row)
|
|
1564
1641
|
* this method will trim "colspan" (or "rowspan") attribute so the table cell will fit in a defined limits.
|
|
1642
|
+
*
|
|
1643
|
+
* @internal
|
|
1565
1644
|
*/ function trimTableCellIfNeeded(tableCell, cellRow, cellColumn, limitRow, limitColumn, writer) {
|
|
1566
1645
|
const colspan = parseInt(tableCell.getAttribute('colspan') || '1');
|
|
1567
1646
|
const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');
|
|
@@ -1728,6 +1807,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1728
1807
|
* 3 | | | | |
|
|
1729
1808
|
* +---+---+---+---+
|
|
1730
1809
|
*
|
|
1810
|
+
* @internal
|
|
1731
1811
|
* @returns Adjusted last row index.
|
|
1732
1812
|
*/ function adjustLastRowIndex(table, dimensions) {
|
|
1733
1813
|
const lastRowMap = Array.from(new TableWalker(table, {
|
|
@@ -1763,6 +1843,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
1763
1843
|
* ^
|
|
1764
1844
|
* last column, each cell has colspan = 2, so we need to return 3, not 2
|
|
1765
1845
|
*
|
|
1846
|
+
* @internal
|
|
1766
1847
|
* @returns Adjusted last column index.
|
|
1767
1848
|
*/ function adjustLastColumnIndex(table, dimensions) {
|
|
1768
1849
|
const lastColumnMap = Array.from(new TableWalker(table, {
|
|
@@ -2271,15 +2352,24 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2271
2352
|
*/ /**
|
|
2272
2353
|
* The minimum column width given as a percentage value. Used in situations when the table is not yet rendered, so it is impossible to
|
|
2273
2354
|
* calculate how many percentage of the table width would be {@link ~COLUMN_MIN_WIDTH_IN_PIXELS minimum column width in pixels}.
|
|
2355
|
+
*
|
|
2356
|
+
* @internal
|
|
2274
2357
|
*/ const COLUMN_MIN_WIDTH_AS_PERCENTAGE = 5;
|
|
2275
2358
|
/**
|
|
2276
2359
|
* The minimum column width in pixels when the maximum table width is known.
|
|
2360
|
+
* This value is an equivalent of `10%` of the default editor width (600px).
|
|
2361
|
+
*
|
|
2362
|
+
* @internal
|
|
2277
2363
|
*/ const COLUMN_MIN_WIDTH_IN_PIXELS = 40;
|
|
2278
2364
|
/**
|
|
2279
2365
|
* Determines how many digits after the decimal point are used to store the column width as a percentage value.
|
|
2366
|
+
*
|
|
2367
|
+
* @internal
|
|
2280
2368
|
*/ const COLUMN_WIDTH_PRECISION = 2;
|
|
2281
2369
|
/**
|
|
2282
2370
|
* The distance in pixels that the mouse has to move to start resizing the column.
|
|
2371
|
+
*
|
|
2372
|
+
* @internal
|
|
2283
2373
|
*/ const COLUMN_RESIZE_DISTANCE_THRESHOLD = 3;
|
|
2284
2374
|
|
|
2285
2375
|
/**
|
|
@@ -2288,6 +2378,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2288
2378
|
*
|
|
2289
2379
|
* Most notably if an entire table is removed it will not be included in returned set.
|
|
2290
2380
|
*
|
|
2381
|
+
* @internal
|
|
2291
2382
|
* @param model The model to collect the affected elements from.
|
|
2292
2383
|
* @returns A set of table model elements.
|
|
2293
2384
|
*/ function getChangedResizedTables(model) {
|
|
@@ -2342,6 +2433,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2342
2433
|
/**
|
|
2343
2434
|
* Calculates the percentage of the minimum column width given in pixels for a given table.
|
|
2344
2435
|
*
|
|
2436
|
+
* @internal
|
|
2345
2437
|
* @param modelTable A table model element.
|
|
2346
2438
|
* @param editor The editor instance.
|
|
2347
2439
|
* @returns The minimal column width in percentage.
|
|
@@ -2351,6 +2443,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2351
2443
|
/**
|
|
2352
2444
|
* Calculates the table width in pixels.
|
|
2353
2445
|
*
|
|
2446
|
+
* @internal
|
|
2354
2447
|
* @param modelTable A table model element.
|
|
2355
2448
|
* @param editor The editor instance.
|
|
2356
2449
|
* @returns The width of the table in pixels.
|
|
@@ -2378,6 +2471,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2378
2471
|
/**
|
|
2379
2472
|
* Returns the computed width (in pixels) of the DOM element without padding and borders.
|
|
2380
2473
|
*
|
|
2474
|
+
* @internal
|
|
2381
2475
|
* @param domElement A DOM element.
|
|
2382
2476
|
* @returns The width of the DOM element in pixels.
|
|
2383
2477
|
*/ function getElementWidthInPixels(domElement) {
|
|
@@ -2394,6 +2488,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2394
2488
|
* Returns the column indexes on the left and right edges of a cell. They differ if the cell spans
|
|
2395
2489
|
* across multiple columns.
|
|
2396
2490
|
*
|
|
2491
|
+
* @internal
|
|
2397
2492
|
* @param cell A table cell model element.
|
|
2398
2493
|
* @param tableUtils The Table Utils plugin instance.
|
|
2399
2494
|
* @returns An object containing the indexes of the left and right edges of the cell.
|
|
@@ -2408,6 +2503,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2408
2503
|
/**
|
|
2409
2504
|
* Rounds the provided value to a fixed-point number with defined number of digits after the decimal point.
|
|
2410
2505
|
*
|
|
2506
|
+
* @internal
|
|
2411
2507
|
* @param value A number to be rounded.
|
|
2412
2508
|
* @returns The rounded number.
|
|
2413
2509
|
*/ function toPrecision(value) {
|
|
@@ -2419,6 +2515,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2419
2515
|
* Clamps the number within the inclusive lower (min) and upper (max) bounds. Returned number is rounded using the
|
|
2420
2516
|
* {@link ~toPrecision `toPrecision()`} function.
|
|
2421
2517
|
*
|
|
2518
|
+
* @internal
|
|
2422
2519
|
* @param number A number to be clamped.
|
|
2423
2520
|
* @param min A lower bound.
|
|
2424
2521
|
* @param max An upper bound.
|
|
@@ -2435,6 +2532,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2435
2532
|
/**
|
|
2436
2533
|
* Creates an array with defined length and fills all elements with defined value.
|
|
2437
2534
|
*
|
|
2535
|
+
* @internal
|
|
2438
2536
|
* @param length The length of the array.
|
|
2439
2537
|
* @param value The value to fill the array with.
|
|
2440
2538
|
* @returns An array with defined length and filled with defined value.
|
|
@@ -2444,6 +2542,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2444
2542
|
/**
|
|
2445
2543
|
* Sums all array values that can be parsed to a float.
|
|
2446
2544
|
*
|
|
2545
|
+
* @internal
|
|
2447
2546
|
* @param array An array of numbers.
|
|
2448
2547
|
* @returns The sum of all array values.
|
|
2449
2548
|
*/ function sumArray(array) {
|
|
@@ -2454,12 +2553,13 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2454
2553
|
* changed proportionally so that they all sum back to 100%. If there are columns without specified width, the amount remaining
|
|
2455
2554
|
* after assigning the known widths will be distributed equally between them.
|
|
2456
2555
|
*
|
|
2556
|
+
* @internal
|
|
2457
2557
|
* @param columnWidths An array of column widths.
|
|
2458
2558
|
* @returns An array of column widths guaranteed to sum up to 100%.
|
|
2459
2559
|
*/ function normalizeColumnWidths(columnWidths) {
|
|
2460
2560
|
const widths = columnWidths.map((width)=>{
|
|
2461
|
-
if (width === 'auto') {
|
|
2462
|
-
return
|
|
2561
|
+
if (width === 'auto' || width === undefined) {
|
|
2562
|
+
return 'auto';
|
|
2463
2563
|
}
|
|
2464
2564
|
return parseFloat(width.replace('%', ''));
|
|
2465
2565
|
});
|
|
@@ -2506,6 +2606,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2506
2606
|
* * left and red padding,
|
|
2507
2607
|
* * border width.
|
|
2508
2608
|
*
|
|
2609
|
+
* @internal
|
|
2509
2610
|
* @param domCell A DOM cell element.
|
|
2510
2611
|
* @returns Width in pixels without `px` at the end.
|
|
2511
2612
|
*/ function getDomCellOuterWidth(domCell) {
|
|
@@ -2521,6 +2622,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
2521
2622
|
/**
|
|
2522
2623
|
* Updates column elements to match columns widths.
|
|
2523
2624
|
*
|
|
2625
|
+
* @internal
|
|
2524
2626
|
* @param columns
|
|
2525
2627
|
* @param tableColumnGroup
|
|
2526
2628
|
* @param normalizedWidths
|
|
@@ -3334,7 +3436,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
3334
3436
|
}
|
|
3335
3437
|
/**
|
|
3336
3438
|
* Returns all model table cells that the provided model selection's ranges
|
|
3337
|
-
* {@link module:engine/model/range~
|
|
3439
|
+
* {@link module:engine/model/range~ModelRange#start} inside.
|
|
3338
3440
|
*
|
|
3339
3441
|
* To obtain the cells selected from the outside, use
|
|
3340
3442
|
* {@link #getSelectedTableCells}.
|
|
@@ -3351,7 +3453,7 @@ import { isObject, debounce, isEqual, throttle } from 'es-toolkit/compat';
|
|
|
3351
3453
|
/**
|
|
3352
3454
|
* Returns all model table cells that are either completely selected
|
|
3353
3455
|
* by selection ranges or host selection range
|
|
3354
|
-
* {@link module:engine/model/range~
|
|
3456
|
+
* {@link module:engine/model/range~ModelRange#start start positions} inside them.
|
|
3355
3457
|
*
|
|
3356
3458
|
* Combines {@link #getTableCellsContainingSelection} and
|
|
3357
3459
|
* {@link #getSelectedTableCells}.
|
|
@@ -4070,6 +4172,8 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
|
|
|
4070
4172
|
* </tbody>
|
|
4071
4173
|
* </table>
|
|
4072
4174
|
* ```
|
|
4175
|
+
*
|
|
4176
|
+
* @internal
|
|
4073
4177
|
*/ function injectTableLayoutPostFixer(model) {
|
|
4074
4178
|
model.document.registerPostFixer((writer)=>tableLayoutPostFixer(writer, model));
|
|
4075
4179
|
}
|
|
@@ -4240,6 +4344,8 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
|
|
|
4240
4344
|
* </tableRow>
|
|
4241
4345
|
* </table>
|
|
4242
4346
|
* ```
|
|
4347
|
+
*
|
|
4348
|
+
* @internal
|
|
4243
4349
|
*/ function injectTableCellParagraphPostFixer(model) {
|
|
4244
4350
|
model.document.registerPostFixer((writer)=>tableCellContentsPostFixer(writer, model));
|
|
4245
4351
|
}
|
|
@@ -4323,6 +4429,8 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
|
|
|
4323
4429
|
* Table heading rows and heading columns are represented in the model by a `headingRows` and `headingColumns` attributes.
|
|
4324
4430
|
*
|
|
4325
4431
|
* When table headings attribute changes, all the cells/rows are marked to re-render to change between `<td>` and `<th>`.
|
|
4432
|
+
*
|
|
4433
|
+
* @internal
|
|
4326
4434
|
*/ function tableHeadingsRefreshHandler(model, editing) {
|
|
4327
4435
|
const differ = model.document.differ;
|
|
4328
4436
|
for (const change of differ.getChanges()){
|
|
@@ -4367,6 +4475,8 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
|
|
|
4367
4475
|
*
|
|
4368
4476
|
* When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is
|
|
4369
4477
|
* re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.
|
|
4478
|
+
*
|
|
4479
|
+
* @internal
|
|
4370
4480
|
*/ function tableCellRefreshHandler(model, editing) {
|
|
4371
4481
|
const differ = model.document.differ;
|
|
4372
4482
|
// Stores cells to be refreshed, so the table cell will be refreshed once for multiple changes.
|
|
@@ -4623,6 +4733,8 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
|
|
|
4623
4733
|
* The table size view.
|
|
4624
4734
|
*
|
|
4625
4735
|
* It renders a 10x10 grid to choose the inserted table size.
|
|
4736
|
+
*
|
|
4737
|
+
* @internal
|
|
4626
4738
|
*/ class InsertTableView extends View {
|
|
4627
4739
|
/**
|
|
4628
4740
|
* A collection of table size box items.
|
|
@@ -5108,7 +5220,7 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
|
|
|
5108
5220
|
* @param itemDefinitions A collection of dropdown items to update with the given option.
|
|
5109
5221
|
*/ function addListOption(option, editor, commands, itemDefinitions) {
|
|
5110
5222
|
if (option.type === 'button' || option.type === 'switchbutton') {
|
|
5111
|
-
const model = option.model = new
|
|
5223
|
+
const model = option.model = new UIModel(option.model);
|
|
5112
5224
|
const { commandName, bindIsOn } = option.model;
|
|
5113
5225
|
const command = editor.commands.get(commandName);
|
|
5114
5226
|
commands.push(command);
|
|
@@ -5356,7 +5468,7 @@ function getMaxOffset(tableCell, start, currentMaxOffset, which) {
|
|
|
5356
5468
|
* yes, it's a hack).
|
|
5357
5469
|
*
|
|
5358
5470
|
* When multiple cells are selected in the model and the user starts to type, the
|
|
5359
|
-
* {@link module:engine/view/document~
|
|
5471
|
+
* {@link module:engine/view/document~ViewDocument#event:insertText} event carries information provided by the
|
|
5360
5472
|
* beforeinput DOM event, that in turn only knows about this collapsed DOM selection in the last cell.
|
|
5361
5473
|
*
|
|
5362
5474
|
* As a result, the selected cells have no chance to be cleaned up. To fix this, this listener intercepts
|
|
@@ -5998,7 +6110,7 @@ function doVerticalSplit(table, splitColumn, limitRows, writer) {
|
|
|
5998
6110
|
});
|
|
5999
6111
|
}
|
|
6000
6112
|
/**
|
|
6001
|
-
* Handles {@link module:engine/view/document~
|
|
6113
|
+
* Handles {@link module:engine/view/document~ViewDocument#event:tab tab} events for the <kbd>Tab</kbd> key executed
|
|
6002
6114
|
* when the table widget is selected.
|
|
6003
6115
|
*/ _handleTabOnSelectedTable(bubblingEventInfo, domEventData) {
|
|
6004
6116
|
const editor = this.editor;
|
|
@@ -6015,7 +6127,7 @@ function doVerticalSplit(table, splitColumn, limitRows, writer) {
|
|
|
6015
6127
|
});
|
|
6016
6128
|
}
|
|
6017
6129
|
/**
|
|
6018
|
-
* Handles {@link module:engine/view/document~
|
|
6130
|
+
* Handles {@link module:engine/view/document~ViewDocument#event:tab tab} events for the <kbd>Tab</kbd> key executed
|
|
6019
6131
|
* inside table cells.
|
|
6020
6132
|
*/ _handleTab(bubblingEventInfo, domEventData) {
|
|
6021
6133
|
const editor = this.editor;
|
|
@@ -6074,7 +6186,7 @@ function doVerticalSplit(table, splitColumn, limitRows, writer) {
|
|
|
6074
6186
|
});
|
|
6075
6187
|
}
|
|
6076
6188
|
/**
|
|
6077
|
-
* Handles {@link module:engine/view/document~
|
|
6189
|
+
* Handles {@link module:engine/view/document~ViewDocument#event:keydown keydown} events.
|
|
6078
6190
|
*/ _onArrowKey(eventInfo, domEventData) {
|
|
6079
6191
|
const editor = this.editor;
|
|
6080
6192
|
const keyCode = domEventData.keyCode;
|
|
@@ -6244,9 +6356,11 @@ function doVerticalSplit(table, splitColumn, limitRows, writer) {
|
|
|
6244
6356
|
* - `'mouseleave'`
|
|
6245
6357
|
*
|
|
6246
6358
|
* Note that this observer is disabled by default. To enable this observer, it needs to be added to
|
|
6247
|
-
* {@link module:engine/view/view~
|
|
6359
|
+
* {@link module:engine/view/view~EditingView} using the {@link module:engine/view/view~EditingView#addObserver} method.
|
|
6248
6360
|
*
|
|
6249
6361
|
* The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.
|
|
6362
|
+
*
|
|
6363
|
+
* @internal
|
|
6250
6364
|
*/ class MouseEventsObserver extends DomEventObserver {
|
|
6251
6365
|
domEventType = [
|
|
6252
6366
|
'mousemove',
|
|
@@ -6604,6 +6718,8 @@ function haveSameTableParent(cellA, cellB) {
|
|
|
6604
6718
|
|
|
6605
6719
|
/**
|
|
6606
6720
|
* Depending on the position of the selection either return the selected table or the table higher in the hierarchy.
|
|
6721
|
+
*
|
|
6722
|
+
* @internal
|
|
6607
6723
|
*/ function getSelectionAffectedTableWidget(selection) {
|
|
6608
6724
|
const selectedTable = getSelectedTableWidget(selection);
|
|
6609
6725
|
if (selectedTable) {
|
|
@@ -6613,6 +6729,8 @@ function haveSameTableParent(cellA, cellB) {
|
|
|
6613
6729
|
}
|
|
6614
6730
|
/**
|
|
6615
6731
|
* Returns a table widget editing view element if one is selected.
|
|
6732
|
+
*
|
|
6733
|
+
* @internal
|
|
6616
6734
|
*/ function getSelectedTableWidget(selection) {
|
|
6617
6735
|
const viewElement = selection.getSelectedElement();
|
|
6618
6736
|
if (viewElement && isTableWidget(viewElement)) {
|
|
@@ -6622,6 +6740,8 @@ function haveSameTableParent(cellA, cellB) {
|
|
|
6622
6740
|
}
|
|
6623
6741
|
/**
|
|
6624
6742
|
* Returns a table widget editing view element if one is among the selection's ancestors.
|
|
6743
|
+
*
|
|
6744
|
+
* @internal
|
|
6625
6745
|
*/ function getTableWidgetAncestor(selection) {
|
|
6626
6746
|
const selectionPosition = selection.getFirstPosition();
|
|
6627
6747
|
if (!selectionPosition) {
|
|
@@ -6974,6 +7094,7 @@ const isEmpty = (val)=>val === '';
|
|
|
6974
7094
|
* labels. Used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}
|
|
6975
7095
|
* and {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}.
|
|
6976
7096
|
*
|
|
7097
|
+
* @internal
|
|
6977
7098
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
6978
7099
|
*/ function getBorderStyleLabels(t) {
|
|
6979
7100
|
return {
|
|
@@ -6992,6 +7113,7 @@ const isEmpty = (val)=>val === '';
|
|
|
6992
7113
|
* Returns a localized error string that can be displayed next to color (background, border)
|
|
6993
7114
|
* fields that have an invalid value.
|
|
6994
7115
|
*
|
|
7116
|
+
* @internal
|
|
6995
7117
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
6996
7118
|
*/ function getLocalizedColorErrorText(t) {
|
|
6997
7119
|
return t('The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".');
|
|
@@ -7000,6 +7122,7 @@ const isEmpty = (val)=>val === '';
|
|
|
7000
7122
|
* Returns a localized error string that can be displayed next to length (padding, border width)
|
|
7001
7123
|
* fields that have an invalid value.
|
|
7002
7124
|
*
|
|
7125
|
+
* @internal
|
|
7003
7126
|
* @param t The "t" function provided by the editor that is used to localize strings.
|
|
7004
7127
|
*/ function getLocalizedLengthErrorText(t) {
|
|
7005
7128
|
return t('The value is invalid. Try "10px" or "2em" or simply "2".');
|
|
@@ -7008,33 +7131,40 @@ const isEmpty = (val)=>val === '';
|
|
|
7008
7131
|
* Returns `true` when the passed value is an empty string or a valid CSS color expression.
|
|
7009
7132
|
* Otherwise, `false` is returned.
|
|
7010
7133
|
*
|
|
7011
|
-
* See {@link module:engine/view/styles/utils~
|
|
7134
|
+
* See {@link module:engine/view/styles/utils~isColorStyleValue}.
|
|
7135
|
+
*
|
|
7136
|
+
* @internal
|
|
7012
7137
|
*/ function colorFieldValidator(value) {
|
|
7013
7138
|
value = value.trim().toLowerCase();
|
|
7014
|
-
return isEmpty(value) ||
|
|
7139
|
+
return isEmpty(value) || isColorStyleValue(value);
|
|
7015
7140
|
}
|
|
7016
7141
|
/**
|
|
7017
7142
|
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
7018
7143
|
* Otherwise, `false` is returned.
|
|
7019
7144
|
*
|
|
7020
|
-
* See {@link module:engine/view/styles/utils~
|
|
7021
|
-
* See {@link module:engine/view/styles/utils~
|
|
7145
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
7146
|
+
* See {@link module:engine/view/styles/utils~isPercentageStyleValue}.
|
|
7147
|
+
*
|
|
7148
|
+
* @internal
|
|
7022
7149
|
*/ function lengthFieldValidator(value) {
|
|
7023
7150
|
value = value.trim();
|
|
7024
|
-
return isEmpty(value) || isNumberString(value) ||
|
|
7151
|
+
return isEmpty(value) || isNumberString(value) || isLengthStyleValue(value) || isPercentageStyleValue(value);
|
|
7025
7152
|
}
|
|
7026
7153
|
/**
|
|
7027
7154
|
* Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.
|
|
7028
7155
|
* Otherwise, `false` is returned.
|
|
7029
7156
|
*
|
|
7030
|
-
* See {@link module:engine/view/styles/utils~
|
|
7157
|
+
* See {@link module:engine/view/styles/utils~isLengthStyleValue}.
|
|
7158
|
+
*
|
|
7159
|
+
* @internal
|
|
7031
7160
|
*/ function lineWidthFieldValidator(value) {
|
|
7032
7161
|
value = value.trim();
|
|
7033
|
-
return isEmpty(value) || isNumberString(value) ||
|
|
7162
|
+
return isEmpty(value) || isNumberString(value) || isLengthStyleValue(value);
|
|
7034
7163
|
}
|
|
7035
7164
|
/**
|
|
7036
7165
|
* Generates item definitions for a UI dropdown that allows changing the border style of a table or a table cell.
|
|
7037
7166
|
*
|
|
7167
|
+
* @internal
|
|
7038
7168
|
* @param defaultStyle The default border.
|
|
7039
7169
|
*/ function getBorderStyleDefinitions(view, defaultStyle) {
|
|
7040
7170
|
const itemDefinitions = new Collection();
|
|
@@ -7042,7 +7172,7 @@ const isEmpty = (val)=>val === '';
|
|
|
7042
7172
|
for(const style in styleLabels){
|
|
7043
7173
|
const definition = {
|
|
7044
7174
|
type: 'button',
|
|
7045
|
-
model: new
|
|
7175
|
+
model: new UIModel({
|
|
7046
7176
|
_borderStyleValue: style,
|
|
7047
7177
|
label: styleLabels[style],
|
|
7048
7178
|
role: 'menuitemradio',
|
|
@@ -7072,6 +7202,7 @@ const isEmpty = (val)=>val === '';
|
|
|
7072
7202
|
* * have some icons,
|
|
7073
7203
|
* * set a certain UI view property value upon execution.
|
|
7074
7204
|
*
|
|
7205
|
+
* @internal
|
|
7075
7206
|
* @param options Configuration options
|
|
7076
7207
|
* @param options.view The view that has the observable property.
|
|
7077
7208
|
* @param options.icons Object with button icons.
|
|
@@ -7186,6 +7317,8 @@ const isEmpty = (val)=>val === '';
|
|
|
7186
7317
|
* }
|
|
7187
7318
|
* ];
|
|
7188
7319
|
* ```
|
|
7320
|
+
*
|
|
7321
|
+
* @internal
|
|
7189
7322
|
*/ const defaultColors = [
|
|
7190
7323
|
{
|
|
7191
7324
|
color: 'hsl(0, 0%, 0%)',
|
|
@@ -7917,6 +8050,7 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
|
|
|
7917
8050
|
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
|
|
7918
8051
|
* with respect to the table in the editor content, if one is selected.
|
|
7919
8052
|
*
|
|
8053
|
+
* @internal
|
|
7920
8054
|
* @param editor The editor instance.
|
|
7921
8055
|
* @param target Either "cell" or "table". Determines the target the balloon will be attached to.
|
|
7922
8056
|
*/ function repositionContextualBalloon(editor, target) {
|
|
@@ -7955,6 +8089,7 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
|
|
|
7955
8089
|
* to the selected table cell in the editor content.
|
|
7956
8090
|
*
|
|
7957
8091
|
* @param editor The editor instance.
|
|
8092
|
+
* @internal
|
|
7958
8093
|
*/ function getBalloonCellPositionData(editor) {
|
|
7959
8094
|
const mapper = editor.editing.mapper;
|
|
7960
8095
|
const domConverter = editor.editing.view.domConverter;
|
|
@@ -8010,6 +8145,8 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
|
|
|
8010
8145
|
* getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );
|
|
8011
8146
|
* getSingleValue( { top: 'foo', right: 'foo' } );
|
|
8012
8147
|
* ```
|
|
8148
|
+
*
|
|
8149
|
+
* @internal
|
|
8013
8150
|
*/ function getSingleValue(objectOrString) {
|
|
8014
8151
|
if (!objectOrString || !isObject(objectOrString)) {
|
|
8015
8152
|
return objectOrString;
|
|
@@ -8031,6 +8168,7 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
|
|
|
8031
8168
|
* getSingleValue( 'foo', 'px' ); // 'foo'
|
|
8032
8169
|
* ```
|
|
8033
8170
|
*
|
|
8171
|
+
* @internal
|
|
8034
8172
|
* @param defaultUnit A default unit added to a numeric value.
|
|
8035
8173
|
*/ function addDefaultUnitToNumericValue(value, defaultUnit) {
|
|
8036
8174
|
const numericValue = parseFloat(value);
|
|
@@ -8045,6 +8183,7 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
|
|
|
8045
8183
|
/**
|
|
8046
8184
|
* Returns the normalized configuration.
|
|
8047
8185
|
*
|
|
8186
|
+
* @internal
|
|
8048
8187
|
* @param config The configuration to normalize.
|
|
8049
8188
|
* @param options Options used to determine which properties should be added.
|
|
8050
8189
|
*/ function getNormalizedDefaultProperties(config, options = {}) {
|
|
@@ -8074,6 +8213,7 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
|
|
|
8074
8213
|
/**
|
|
8075
8214
|
* Returns the normalized default table properties.
|
|
8076
8215
|
*
|
|
8216
|
+
* @internal
|
|
8077
8217
|
* @param config The configuration to normalize.
|
|
8078
8218
|
* @param options Options used to determine which properties should be added.
|
|
8079
8219
|
*/ function getNormalizedDefaultTableProperties(config, options) {
|
|
@@ -8089,6 +8229,7 @@ const BALLOON_POSITIONS = /* #__PURE__ */ (()=>[
|
|
|
8089
8229
|
/**
|
|
8090
8230
|
* Returns the normalized default cell properties.
|
|
8091
8231
|
*
|
|
8232
|
+
* @internal
|
|
8092
8233
|
* @param config The configuration to normalize.
|
|
8093
8234
|
* @param options Options used to determine which properties should be added.
|
|
8094
8235
|
*/ function getNormalizedDefaultCellProperties(config, options) {
|
|
@@ -8626,6 +8767,8 @@ const propertyToCommandMap$1 = {
|
|
|
8626
8767
|
enableProperty$1(editor.model.schema, editor.conversion, {
|
|
8627
8768
|
modelAttribute: 'tableCellWidth',
|
|
8628
8769
|
styleName: 'width',
|
|
8770
|
+
attributeName: 'width',
|
|
8771
|
+
attributeType: 'length',
|
|
8629
8772
|
defaultValue: defaultTableCellProperties.width
|
|
8630
8773
|
});
|
|
8631
8774
|
editor.commands.add('tableCellWidth', new TableCellWidthCommand(editor, defaultTableCellProperties.width));
|
|
@@ -8989,7 +9132,7 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
8989
9132
|
includePaddingProperty: true,
|
|
8990
9133
|
isRightToLeftContent: editor.locale.contentLanguageDirection === 'rtl'
|
|
8991
9134
|
});
|
|
8992
|
-
editor.data.addStyleProcessorRules(
|
|
9135
|
+
editor.data.addStyleProcessorRules(addBorderStylesRules);
|
|
8993
9136
|
enableBorderProperties$1(schema, conversion, {
|
|
8994
9137
|
color: defaultTableCellProperties.borderColor,
|
|
8995
9138
|
style: defaultTableCellProperties.borderStyle,
|
|
@@ -9001,10 +9144,12 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9001
9144
|
enableProperty$1(schema, conversion, {
|
|
9002
9145
|
modelAttribute: 'tableCellHeight',
|
|
9003
9146
|
styleName: 'height',
|
|
9147
|
+
attributeName: 'height',
|
|
9148
|
+
attributeType: 'length',
|
|
9004
9149
|
defaultValue: defaultTableCellProperties.height
|
|
9005
9150
|
});
|
|
9006
9151
|
editor.commands.add('tableCellHeight', new TableCellHeightCommand(editor, defaultTableCellProperties.height));
|
|
9007
|
-
editor.data.addStyleProcessorRules(
|
|
9152
|
+
editor.data.addStyleProcessorRules(addPaddingStylesRules);
|
|
9008
9153
|
enableProperty$1(schema, conversion, {
|
|
9009
9154
|
modelAttribute: 'tableCellPadding',
|
|
9010
9155
|
styleName: 'padding',
|
|
@@ -9012,10 +9157,12 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9012
9157
|
defaultValue: defaultTableCellProperties.padding
|
|
9013
9158
|
});
|
|
9014
9159
|
editor.commands.add('tableCellPadding', new TableCellPaddingCommand(editor, defaultTableCellProperties.padding));
|
|
9015
|
-
editor.data.addStyleProcessorRules(
|
|
9160
|
+
editor.data.addStyleProcessorRules(addBackgroundStylesRules);
|
|
9016
9161
|
enableProperty$1(schema, conversion, {
|
|
9017
9162
|
modelAttribute: 'tableCellBackgroundColor',
|
|
9018
9163
|
styleName: 'background-color',
|
|
9164
|
+
attributeName: 'bgcolor',
|
|
9165
|
+
attributeType: 'color',
|
|
9019
9166
|
defaultValue: defaultTableCellProperties.backgroundColor
|
|
9020
9167
|
});
|
|
9021
9168
|
editor.commands.add('tableCellBackgroundColor', new TableCellBackgroundColorCommand(editor, defaultTableCellProperties.backgroundColor));
|
|
@@ -9041,6 +9188,11 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9041
9188
|
schema.extend('tableCell', {
|
|
9042
9189
|
allowAttributes: Object.values(modelAttributes)
|
|
9043
9190
|
});
|
|
9191
|
+
for (const modelAttribute of Object.values(modelAttributes)){
|
|
9192
|
+
schema.setAttributeProperties(modelAttribute, {
|
|
9193
|
+
isFormatting: true
|
|
9194
|
+
});
|
|
9195
|
+
}
|
|
9044
9196
|
upcastBorderStyles(conversion, 'td', modelAttributes, defaultBorder);
|
|
9045
9197
|
upcastBorderStyles(conversion, 'th', modelAttributes, defaultBorder);
|
|
9046
9198
|
downcastAttributeToStyle(conversion, {
|
|
@@ -9069,6 +9221,9 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9069
9221
|
'tableCellHorizontalAlignment'
|
|
9070
9222
|
]
|
|
9071
9223
|
});
|
|
9224
|
+
schema.setAttributeProperties('tableCellHorizontalAlignment', {
|
|
9225
|
+
isFormatting: true
|
|
9226
|
+
});
|
|
9072
9227
|
conversion.for('downcast').attributeToAttribute({
|
|
9073
9228
|
model: {
|
|
9074
9229
|
name: 'tableCell',
|
|
@@ -9094,7 +9249,13 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9094
9249
|
value: (viewElement, conversionApi, data)=>{
|
|
9095
9250
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'left', data);
|
|
9096
9251
|
const align = viewElement.getStyle('text-align');
|
|
9097
|
-
|
|
9252
|
+
if (align !== localDefaultValue) {
|
|
9253
|
+
return align;
|
|
9254
|
+
}
|
|
9255
|
+
// Consume the style even if not applied to the element so it won't be processed by other converters.
|
|
9256
|
+
conversionApi.consumable.consume(viewElement, {
|
|
9257
|
+
styles: 'text-align'
|
|
9258
|
+
});
|
|
9098
9259
|
}
|
|
9099
9260
|
}
|
|
9100
9261
|
})// Support for the `align` attribute as the backward compatibility while pasting from other sources.
|
|
@@ -9110,7 +9271,13 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9110
9271
|
value: (viewElement, conversionApi, data)=>{
|
|
9111
9272
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'left', data);
|
|
9112
9273
|
const align = viewElement.getAttribute('align');
|
|
9113
|
-
|
|
9274
|
+
if (align !== localDefaultValue) {
|
|
9275
|
+
return align;
|
|
9276
|
+
}
|
|
9277
|
+
// Consume the style even if not applied to the element so it won't be processed by other converters.
|
|
9278
|
+
conversionApi.consumable.consume(viewElement, {
|
|
9279
|
+
attributes: 'align'
|
|
9280
|
+
});
|
|
9114
9281
|
}
|
|
9115
9282
|
}
|
|
9116
9283
|
});
|
|
@@ -9125,6 +9292,9 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9125
9292
|
'tableCellVerticalAlignment'
|
|
9126
9293
|
]
|
|
9127
9294
|
});
|
|
9295
|
+
schema.setAttributeProperties('tableCellVerticalAlignment', {
|
|
9296
|
+
isFormatting: true
|
|
9297
|
+
});
|
|
9128
9298
|
conversion.for('downcast').attributeToAttribute({
|
|
9129
9299
|
model: {
|
|
9130
9300
|
name: 'tableCell',
|
|
@@ -9150,7 +9320,13 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9150
9320
|
value: (viewElement, conversionApi, data)=>{
|
|
9151
9321
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'middle', data);
|
|
9152
9322
|
const align = viewElement.getStyle('vertical-align');
|
|
9153
|
-
|
|
9323
|
+
if (align !== localDefaultValue) {
|
|
9324
|
+
return align;
|
|
9325
|
+
}
|
|
9326
|
+
// Consume the style even if not applied to the element so it won't be processed by other converters.
|
|
9327
|
+
conversionApi.consumable.consume(viewElement, {
|
|
9328
|
+
styles: 'vertical-align'
|
|
9329
|
+
});
|
|
9154
9330
|
}
|
|
9155
9331
|
}
|
|
9156
9332
|
})// Support for the `align` attribute as the backward compatibility while pasting from other sources.
|
|
@@ -9166,7 +9342,13 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9166
9342
|
value: (viewElement, conversionApi, data)=>{
|
|
9167
9343
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'middle', data);
|
|
9168
9344
|
const valign = viewElement.getAttribute('valign');
|
|
9169
|
-
|
|
9345
|
+
if (valign !== localDefaultValue) {
|
|
9346
|
+
return valign;
|
|
9347
|
+
}
|
|
9348
|
+
// Consume the attribute even if not applied to the element so it won't be processed by other converters.
|
|
9349
|
+
conversionApi.consumable.consume(viewElement, {
|
|
9350
|
+
attributes: 'valign'
|
|
9351
|
+
});
|
|
9170
9352
|
}
|
|
9171
9353
|
}
|
|
9172
9354
|
});
|
|
@@ -9358,7 +9540,7 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9358
9540
|
* @param label The localized label for the dropdown item.
|
|
9359
9541
|
* @returns The dropdown item definition.
|
|
9360
9542
|
*/ function createTableTypeDropdownItem(tableTypeCommand, type, label) {
|
|
9361
|
-
const model = new
|
|
9543
|
+
const model = new UIModel({
|
|
9362
9544
|
label,
|
|
9363
9545
|
role: 'menuitemradio',
|
|
9364
9546
|
withText: true,
|
|
@@ -9489,6 +9671,8 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9489
9671
|
/**
|
|
9490
9672
|
* Returns a upcast helper that ensures the number of `<tableColumn>` elements corresponds to the actual number of columns in the table,
|
|
9491
9673
|
* because the input data might have too few or too many <col> elements.
|
|
9674
|
+
*
|
|
9675
|
+
* @internal
|
|
9492
9676
|
*/ function upcastColgroupElement(tableUtilsPlugin) {
|
|
9493
9677
|
return (dispatcher)=>dispatcher.on('element:colgroup', (evt, data, conversionApi)=>{
|
|
9494
9678
|
const modelTable = data.modelCursor.findAncestor('table');
|
|
@@ -9512,6 +9696,8 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9512
9696
|
}
|
|
9513
9697
|
/**
|
|
9514
9698
|
* Returns downcast helper for adding `ck-table-resized` class if there is a `<tableColumnGroup>` element inside the table.
|
|
9699
|
+
*
|
|
9700
|
+
* @internal
|
|
9515
9701
|
*/ function downcastTableResizedClass() {
|
|
9516
9702
|
return (dispatcher)=>dispatcher.on('insert:table', (evt, data, conversionApi)=>{
|
|
9517
9703
|
const viewWriter = conversionApi.writer;
|
|
@@ -9528,6 +9714,19 @@ const ALIGN_VALUES_REG_EXP$1 = /^(left|center|right|justify)$/;
|
|
|
9528
9714
|
priority: 'low'
|
|
9529
9715
|
});
|
|
9530
9716
|
}
|
|
9717
|
+
/**
|
|
9718
|
+
* Returns a upcast helper that removes the `ck-table-resized` class from the table element.
|
|
9719
|
+
*
|
|
9720
|
+
* @internal
|
|
9721
|
+
*/ function upcastTableResizedClass() {
|
|
9722
|
+
return (dispatcher)=>{
|
|
9723
|
+
dispatcher.on('element:table', (evt, data, conversionApi)=>{
|
|
9724
|
+
conversionApi.consumable.consume(data.viewItem, {
|
|
9725
|
+
classes: 'ck-table-resized'
|
|
9726
|
+
});
|
|
9727
|
+
});
|
|
9728
|
+
};
|
|
9729
|
+
}
|
|
9531
9730
|
|
|
9532
9731
|
const toPx = /* #__PURE__ */ toUnit('px');
|
|
9533
9732
|
/**
|
|
@@ -9644,16 +9843,17 @@ const toPx = /* #__PURE__ */ toUnit('px');
|
|
|
9644
9843
|
/**
|
|
9645
9844
|
* Registers new attributes for a table model element.
|
|
9646
9845
|
*/ _extendSchema() {
|
|
9647
|
-
this.editor.model.schema
|
|
9846
|
+
const schema = this.editor.model.schema;
|
|
9847
|
+
schema.extend('table', {
|
|
9648
9848
|
allowAttributes: [
|
|
9649
9849
|
'tableWidth'
|
|
9650
9850
|
]
|
|
9651
9851
|
});
|
|
9652
|
-
|
|
9852
|
+
schema.register('tableColumnGroup', {
|
|
9653
9853
|
allowIn: 'table',
|
|
9654
9854
|
isLimit: true
|
|
9655
9855
|
});
|
|
9656
|
-
|
|
9856
|
+
schema.register('tableColumn', {
|
|
9657
9857
|
allowIn: 'tableColumnGroup',
|
|
9658
9858
|
allowAttributes: [
|
|
9659
9859
|
'columnWidth',
|
|
@@ -9661,6 +9861,9 @@ const toPx = /* #__PURE__ */ toUnit('px');
|
|
|
9661
9861
|
],
|
|
9662
9862
|
isLimit: true
|
|
9663
9863
|
});
|
|
9864
|
+
schema.setAttributeProperties('columnWidth', {
|
|
9865
|
+
isFormatting: true
|
|
9866
|
+
});
|
|
9664
9867
|
}
|
|
9665
9868
|
/**
|
|
9666
9869
|
* Registers table column resize post-fixer.
|
|
@@ -9757,7 +9960,6 @@ const toPx = /* #__PURE__ */ toUnit('px');
|
|
|
9757
9960
|
}
|
|
9758
9961
|
},
|
|
9759
9962
|
model: {
|
|
9760
|
-
name: 'table',
|
|
9761
9963
|
key: 'tableWidth',
|
|
9762
9964
|
value: (viewElement)=>{
|
|
9763
9965
|
const parent = viewElement.parent;
|
|
@@ -9790,6 +9992,7 @@ const toPx = /* #__PURE__ */ toUnit('px');
|
|
|
9790
9992
|
view: 'col'
|
|
9791
9993
|
});
|
|
9792
9994
|
conversion.for('downcast').add(downcastTableResizedClass());
|
|
9995
|
+
conversion.for('upcast').add(upcastTableResizedClass());
|
|
9793
9996
|
conversion.for('upcast').add(upcastColgroupElement(this._tableUtilsPlugin));
|
|
9794
9997
|
conversion.for('upcast').attributeToAttribute({
|
|
9795
9998
|
view: {
|
|
@@ -11002,7 +11205,7 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11002
11205
|
const defaultTableProperties = getNormalizedDefaultTableProperties(editor.config.get('table.tableProperties.defaultProperties'), {
|
|
11003
11206
|
includeAlignmentProperty: true
|
|
11004
11207
|
});
|
|
11005
|
-
editor.data.addStyleProcessorRules(
|
|
11208
|
+
editor.data.addStyleProcessorRules(addBorderStylesRules);
|
|
11006
11209
|
enableBorderProperties(schema, conversion, {
|
|
11007
11210
|
color: defaultTableProperties.borderColor,
|
|
11008
11211
|
style: defaultTableProperties.borderStyle,
|
|
@@ -11016,19 +11219,25 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11016
11219
|
enableTableToFigureProperty(schema, conversion, {
|
|
11017
11220
|
modelAttribute: 'tableWidth',
|
|
11018
11221
|
styleName: 'width',
|
|
11222
|
+
attributeName: 'width',
|
|
11223
|
+
attributeType: 'length',
|
|
11019
11224
|
defaultValue: defaultTableProperties.width
|
|
11020
11225
|
});
|
|
11021
11226
|
editor.commands.add('tableWidth', new TableWidthCommand(editor, defaultTableProperties.width));
|
|
11022
11227
|
enableTableToFigureProperty(schema, conversion, {
|
|
11023
11228
|
modelAttribute: 'tableHeight',
|
|
11024
11229
|
styleName: 'height',
|
|
11230
|
+
attributeName: 'height',
|
|
11231
|
+
attributeType: 'length',
|
|
11025
11232
|
defaultValue: defaultTableProperties.height
|
|
11026
11233
|
});
|
|
11027
11234
|
editor.commands.add('tableHeight', new TableHeightCommand(editor, defaultTableProperties.height));
|
|
11028
|
-
editor.data.addStyleProcessorRules(
|
|
11235
|
+
editor.data.addStyleProcessorRules(addBackgroundStylesRules);
|
|
11029
11236
|
enableProperty(schema, conversion, {
|
|
11030
11237
|
modelAttribute: 'tableBackgroundColor',
|
|
11031
11238
|
styleName: 'background-color',
|
|
11239
|
+
attributeName: 'bgcolor',
|
|
11240
|
+
attributeType: 'color',
|
|
11032
11241
|
defaultValue: defaultTableProperties.backgroundColor
|
|
11033
11242
|
});
|
|
11034
11243
|
editor.commands.add('tableBackgroundColor', new TableBackgroundColorCommand(editor, defaultTableProperties.backgroundColor));
|
|
@@ -11050,6 +11259,11 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11050
11259
|
schema.extend('table', {
|
|
11051
11260
|
allowAttributes: Object.values(modelAttributes)
|
|
11052
11261
|
});
|
|
11262
|
+
for (const modelAttribute of Object.values(modelAttributes)){
|
|
11263
|
+
schema.setAttributeProperties(modelAttribute, {
|
|
11264
|
+
isFormatting: true
|
|
11265
|
+
});
|
|
11266
|
+
}
|
|
11053
11267
|
upcastBorderStyles(conversion, 'table', modelAttributes, defaultBorder);
|
|
11054
11268
|
downcastTableAttribute(conversion, {
|
|
11055
11269
|
modelAttribute: modelAttributes.color,
|
|
@@ -11074,6 +11288,9 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11074
11288
|
'tableAlignment'
|
|
11075
11289
|
]
|
|
11076
11290
|
});
|
|
11291
|
+
schema.setAttributeProperties('tableAlignment', {
|
|
11292
|
+
isFormatting: true
|
|
11293
|
+
});
|
|
11077
11294
|
conversion.for('downcast').attributeToAttribute({
|
|
11078
11295
|
model: {
|
|
11079
11296
|
name: 'table',
|
|
@@ -11124,13 +11341,23 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11124
11341
|
model: {
|
|
11125
11342
|
key: 'tableAlignment',
|
|
11126
11343
|
value: (viewElement, conversionApi, data)=>{
|
|
11344
|
+
// Ignore other figure elements.
|
|
11345
|
+
if (viewElement.name == 'figure' && !viewElement.hasClass('table')) {
|
|
11346
|
+
return;
|
|
11347
|
+
}
|
|
11127
11348
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
|
|
11128
11349
|
let align = viewElement.getStyle('float');
|
|
11129
11350
|
// CSS: `float:none` => Model: `alignment:center`.
|
|
11130
11351
|
if (align === 'none') {
|
|
11131
11352
|
align = 'center';
|
|
11132
11353
|
}
|
|
11133
|
-
|
|
11354
|
+
if (align !== localDefaultValue) {
|
|
11355
|
+
return align;
|
|
11356
|
+
}
|
|
11357
|
+
// Consume the style even if not applied to the element so it won't be processed by other converters.
|
|
11358
|
+
conversionApi.consumable.consume(viewElement, {
|
|
11359
|
+
styles: 'float'
|
|
11360
|
+
});
|
|
11134
11361
|
}
|
|
11135
11362
|
}
|
|
11136
11363
|
})// Support for the `margin-left:auto; margin-right:auto;` CSS definition for the table alignment.
|
|
@@ -11145,25 +11372,44 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11145
11372
|
model: {
|
|
11146
11373
|
key: 'tableAlignment',
|
|
11147
11374
|
value: (viewElement, conversionApi, data)=>{
|
|
11375
|
+
// Ignore other figure elements.
|
|
11376
|
+
if (viewElement.name == 'figure' && !viewElement.hasClass('table')) {
|
|
11377
|
+
return;
|
|
11378
|
+
}
|
|
11148
11379
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
|
|
11149
11380
|
const align = 'center';
|
|
11150
|
-
|
|
11381
|
+
if (align !== localDefaultValue) {
|
|
11382
|
+
return align;
|
|
11383
|
+
}
|
|
11384
|
+
// Consume the styles even if not applied to the element so it won't be processed by other converters.
|
|
11385
|
+
conversionApi.consumable.consume(viewElement, {
|
|
11386
|
+
styles: [
|
|
11387
|
+
'margin-left',
|
|
11388
|
+
'margin-right'
|
|
11389
|
+
]
|
|
11390
|
+
});
|
|
11151
11391
|
}
|
|
11152
11392
|
}
|
|
11153
11393
|
})// Support for the `align` attribute as the backward compatibility while pasting from other sources.
|
|
11154
11394
|
.attributeToAttribute({
|
|
11155
11395
|
view: {
|
|
11396
|
+
name: 'table',
|
|
11156
11397
|
attributes: {
|
|
11157
11398
|
align: ALIGN_VALUES_REG_EXP
|
|
11158
11399
|
}
|
|
11159
11400
|
},
|
|
11160
11401
|
model: {
|
|
11161
|
-
name: 'table',
|
|
11162
11402
|
key: 'tableAlignment',
|
|
11163
11403
|
value: (viewElement, conversionApi, data)=>{
|
|
11164
11404
|
const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
|
|
11165
11405
|
const align = viewElement.getAttribute('align');
|
|
11166
|
-
|
|
11406
|
+
if (align !== localDefaultValue) {
|
|
11407
|
+
return align;
|
|
11408
|
+
}
|
|
11409
|
+
// Consume the attribute even if not applied to the element so it won't be processed by other converters.
|
|
11410
|
+
conversionApi.consumable.consume(viewElement, {
|
|
11411
|
+
attributes: 'align'
|
|
11412
|
+
});
|
|
11167
11413
|
}
|
|
11168
11414
|
}
|
|
11169
11415
|
});
|
|
@@ -11179,6 +11425,9 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11179
11425
|
modelAttribute
|
|
11180
11426
|
]
|
|
11181
11427
|
});
|
|
11428
|
+
schema.setAttributeProperties(modelAttribute, {
|
|
11429
|
+
isFormatting: true
|
|
11430
|
+
});
|
|
11182
11431
|
upcastStyleToAttribute(conversion, {
|
|
11183
11432
|
viewElement: 'table',
|
|
11184
11433
|
...options
|
|
@@ -11194,9 +11443,11 @@ const FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;
|
|
|
11194
11443
|
modelAttribute
|
|
11195
11444
|
]
|
|
11196
11445
|
});
|
|
11446
|
+
schema.setAttributeProperties(modelAttribute, {
|
|
11447
|
+
isFormatting: true
|
|
11448
|
+
});
|
|
11197
11449
|
upcastStyleToAttribute(conversion, {
|
|
11198
11450
|
viewElement: /^(table|figure)$/,
|
|
11199
|
-
shouldUpcast: (element)=>!(element.name == 'table' && element.parent.name == 'figure'),
|
|
11200
11451
|
...options
|
|
11201
11452
|
});
|
|
11202
11453
|
downcastAttributeToStyle(conversion, {
|
|
@@ -12075,6 +12326,8 @@ const propertyToCommandMap = {
|
|
|
12075
12326
|
*
|
|
12076
12327
|
* * If there are many caption model element, they are merged into one model.
|
|
12077
12328
|
* * A final, merged caption model is placed at the end of the table.
|
|
12329
|
+
*
|
|
12330
|
+
* @internal
|
|
12078
12331
|
*/ function injectTableCaptionPostFixer(model) {
|
|
12079
12332
|
model.document.registerPostFixer((writer)=>tableCaptionPostFixer(writer, model));
|
|
12080
12333
|
}
|
|
@@ -12116,6 +12369,7 @@ const propertyToCommandMap = {
|
|
|
12116
12369
|
* Checks if the provided model element is a `table`.
|
|
12117
12370
|
*
|
|
12118
12371
|
* @param modelElement Element to check if it is a table.
|
|
12372
|
+
* @internal
|
|
12119
12373
|
*/ function isTable(modelElement) {
|
|
12120
12374
|
return !!modelElement && modelElement.is('element', 'table');
|
|
12121
12375
|
}
|
|
@@ -12123,6 +12377,7 @@ const propertyToCommandMap = {
|
|
|
12123
12377
|
* Returns the caption model element from a given table element. Returns `null` if no caption is found.
|
|
12124
12378
|
*
|
|
12125
12379
|
* @param tableModelElement Table element in which we will try to find a caption element.
|
|
12380
|
+
* @internal
|
|
12126
12381
|
*/ function getCaptionFromTableModelElement(tableModelElement) {
|
|
12127
12382
|
for (const node of tableModelElement.getChildren()){
|
|
12128
12383
|
if (node.is('element', 'caption')) {
|
|
@@ -12135,6 +12390,7 @@ const propertyToCommandMap = {
|
|
|
12135
12390
|
* Returns the caption model element for a model selection. Returns `null` if the selection has no caption element ancestor.
|
|
12136
12391
|
*
|
|
12137
12392
|
* @param selection The selection checked for caption presence.
|
|
12393
|
+
* @internal
|
|
12138
12394
|
*/ function getCaptionFromModelSelection(selection) {
|
|
12139
12395
|
const tableElement = getSelectionAffectedTable(selection);
|
|
12140
12396
|
if (!tableElement) {
|
|
@@ -12150,6 +12406,7 @@ const propertyToCommandMap = {
|
|
|
12150
12406
|
* - A `<caption>` inside a <table>.
|
|
12151
12407
|
*
|
|
12152
12408
|
* @returns Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element cannot be matched.
|
|
12409
|
+
* @internal
|
|
12153
12410
|
*/ function matchTableCaptionViewElement(element) {
|
|
12154
12411
|
const parent = element.parent;
|
|
12155
12412
|
if (element.name == 'figcaption' && parent && parent.is('element', 'figure') && parent.hasClass('table')) {
|
|
@@ -12323,7 +12580,7 @@ const propertyToCommandMap = {
|
|
|
12323
12580
|
const figcaptionElement = writer.createEditableElement('figcaption');
|
|
12324
12581
|
writer.setCustomProperty('tableCaption', true, figcaptionElement);
|
|
12325
12582
|
figcaptionElement.placeholder = t('Enter table caption');
|
|
12326
|
-
|
|
12583
|
+
enableViewPlaceholder({
|
|
12327
12584
|
view,
|
|
12328
12585
|
element: figcaptionElement,
|
|
12329
12586
|
keepOnFocus: true
|
|
@@ -12334,7 +12591,7 @@ const propertyToCommandMap = {
|
|
|
12334
12591
|
injectTableCaptionPostFixer(editor.model);
|
|
12335
12592
|
}
|
|
12336
12593
|
/**
|
|
12337
|
-
* Returns the saved {@link module:engine/model/element~
|
|
12594
|
+
* Returns the saved {@link module:engine/model/element~ModelElement#toJSON JSONified} caption
|
|
12338
12595
|
* of a table model element.
|
|
12339
12596
|
*
|
|
12340
12597
|
* See {@link #_saveCaption}.
|
|
@@ -12344,10 +12601,10 @@ const propertyToCommandMap = {
|
|
|
12344
12601
|
* @returns The model caption element or `null` if there is none.
|
|
12345
12602
|
*/ _getSavedCaption(tableModelElement) {
|
|
12346
12603
|
const jsonObject = this._savedCaptionsMap.get(tableModelElement);
|
|
12347
|
-
return jsonObject ?
|
|
12604
|
+
return jsonObject ? ModelElement.fromJSON(jsonObject) : null;
|
|
12348
12605
|
}
|
|
12349
12606
|
/**
|
|
12350
|
-
* Saves a {@link module:engine/model/element~
|
|
12607
|
+
* Saves a {@link module:engine/model/element~ModelElement#toJSON JSONified} caption for
|
|
12351
12608
|
* a table element to allow restoring it in the future.
|
|
12352
12609
|
*
|
|
12353
12610
|
* A caption is saved every time it gets hidden. The
|
|
@@ -12443,5 +12700,5 @@ const propertyToCommandMap = {
|
|
|
12443
12700
|
}
|
|
12444
12701
|
}
|
|
12445
12702
|
|
|
12446
|
-
export { PlainTableOutput, Table, TableCaption, TableCaptionEditing, TableCaptionUI, TableCellProperties, TableCellPropertiesEditing, TableCellPropertiesUI, TableCellWidthEditing, TableClipboard, TableColumnResize, TableColumnResizeEditing, TableEditing, TableKeyboard, TableLayout, TableLayoutEditing, TableMouse, TableProperties, TablePropertiesEditing, TablePropertiesUI, TableSelection, TableToolbar, TableUI, TableUtils };
|
|
12703
|
+
export { InsertColumnCommand, InsertRowCommand, InsertTableCommand, InsertTableLayoutCommand, MergeCellCommand, MergeCellsCommand, PlainTableOutput, RemoveColumnCommand, RemoveRowCommand, SelectColumnCommand, SelectRowCommand, SetHeaderColumnCommand, SetHeaderRowCommand, SplitCellCommand, Table, TableAlignmentCommand, TableBackgroundColorCommand, TableBorderColorCommand, TableBorderStyleCommand, TableBorderWidthCommand, TableCaption, TableCaptionEditing, TableCaptionUI, TableCellBackgroundColorCommand, TableCellBorderColorCommand, TableCellBorderStyleCommand, TableCellBorderWidthCommand, TableCellHeightCommand, TableCellHorizontalAlignmentCommand, TableCellPaddingCommand, TableCellProperties, TableCellPropertiesEditing, TableCellPropertiesUI, TableCellPropertiesView, TableCellPropertyCommand, TableCellVerticalAlignmentCommand, TableCellWidthCommand, TableCellWidthEditing, TableClipboard, TableColumnResize, TableColumnResizeEditing, TableEditing, TableHeightCommand, TableKeyboard, TableLayout, TableLayoutEditing, TableLayoutUI, TableMouse, TableProperties, TablePropertiesEditing, TablePropertiesUI, TablePropertiesView, TablePropertyCommand, TableSelection, TableToolbar, TableTypeCommand, TableUI, TableUtils, TableWalker, TableWidthCommand, TableWidthsCommand, ToggleTableCaptionCommand, InsertTableView as _InsertTableView, COLUMN_MIN_WIDTH_AS_PERCENTAGE as _TABLE_COLUMN_MIN_WIDTH_AS_PERCENTAGE, COLUMN_MIN_WIDTH_IN_PIXELS as _TABLE_COLUMN_MIN_WIDTH_IN_PIXELS, COLUMN_RESIZE_DISTANCE_THRESHOLD as _TABLE_COLUMN_RESIZE_DISTANCE_THRESHOLD, COLUMN_WIDTH_PRECISION as _TABLE_COLUMN_WIDTH_PRECISION, defaultColors as _TABLE_DEFAULT_COLORS, ColorInputView as _TableColorInputView, MouseEventsObserver as _TableMouseEventsObserver, addDefaultUnitToNumericValue as _addDefaultUnitToNumericValue, adjustLastColumnIndex as _adjustLastTableColumnIndex, adjustLastRowIndex as _adjustLastTableRowIndex, clamp as _clamp, colorFieldValidator as _colorTableFieldValidator, convertParagraphInTableCell as _convertParagraphInTableCell, createEmptyTableCell as _createEmptyTableCell, createFilledArray as _createFilledArray, cropTableToDimensions as _cropTableToDimensions, downcastTable as _downcastTable, downcastTableAttribute as _downcastTableAttribute, downcastAttributeToStyle as _downcastTableAttributeToStyle, downcastCell as _downcastTableCell, downcastTableResizedClass as _downcastTableResizedClass, downcastRow as _downcastTableRow, enableProperty$1 as _enableTableCellProperty, ensureParagraphInTableCell as _ensureParagraphInTableCell, fillToolbar as _fillTableOrCellToolbar, getBalloonCellPositionData as _getBalloonTableCellPositionData, getBalloonTablePositionData as _getBalloonTablePositionData, getBorderStyleLabels as _getBorderTableStyleLabels, getChangedResizedTables as _getChangedResizedTables, getDefaultValueAdjusted as _getDefaultTableValueAdjusted, getDomCellOuterWidth as _getDomTableCellOuterWidth, getElementWidthInPixels as _getElementWidthInPixels, getHorizontallyOverlappingCells as _getHorizontallyOverlappingTableCells, getLabeledColorInputCreator as _getLabeledTableColorInputCreator, getLocalizedColorErrorText as _getLocalizedTableColorErrorText, getLocalizedLengthErrorText as _getLocalizedTableLengthErrorText, getNormalizedDefaultProperties as _getNormalizedDefaultTableBaseProperties, getNormalizedDefaultCellProperties as _getNormalizedDefaultTableCellProperties, getNormalizedDefaultTableProperties as _getNormalizedDefaultTableProperties, getSelectedTableWidget as _getSelectedTableWidget, getSelectionAffectedTable as _getSelectionAffectedTable, getSelectionAffectedTableWidget as _getSelectionAffectedTableWidget, getSingleValue as _getTableBorderBoxSingleValue, getCaptionFromTableModelElement as _getTableCaptionFromModelElement, getCaptionFromModelSelection as _getTableCaptionFromModelSelection, getColumnEdgesIndexes as _getTableColumnEdgesIndexes, getTableColumnElements as _getTableColumnElements, getColumnGroupElement as _getTableColumnGroupElement, getColumnMinWidthAsPercentage as _getTableColumnMinWidthAsPercentage, getTableColumnsWidths as _getTableColumnsWidths, getBorderStyleDefinitions as _getTableOrCellBorderStyleDefinitions, getTableWidgetAncestor as _getTableWidgetAncestor, getTableWidthInPixels as _getTableWidthInPixels, getVerticallyOverlappingCells as _getVerticallyOverlappingTableCells, injectTableCaptionPostFixer as _injectTableCaptionPostFixer, injectTableCellParagraphPostFixer as _injectTableCellParagraphPostFixer, injectTableLayoutPostFixer as _injectTableLayoutPostFixer, isSingleParagraphWithoutAttributes as _isSingleTableParagraphWithoutAttributes, isHeadingColumnCell as _isTableHeadingColumnCell, isTable as _isTableModelElement, lengthFieldValidator as _lengthTableFieldValidator, lineWidthFieldValidator as _lineWidthTableFieldValidator, matchTableCaptionViewElement as _matchTableCaptionViewElement, normalizeColumnWidths as _normalizeTableColumnWidths, removeEmptyColumns as _removeEmptyTableColumns, removeEmptyRows as _removeEmptyTableRows, removeEmptyRowsColumns as _removeEmptyTableRowsColumns, repositionContextualBalloon as _repositionTableContextualBalloon, skipEmptyTableRow as _skipEmptyTableRow, splitHorizontally as _splitTableCellHorizontally, splitVertically as _splitTableCellVertically, sumArray as _sumArray, tableCellRefreshHandler as _tableCellRefreshHandler, tableHeadingsRefreshHandler as _tableHeadingsRefreshHandler, toPrecision as _toPrecision, translateColSpanAttribute as _translateTableColspanAttribute, trimTableCellIfNeeded as _trimTableCellIfNeeded, upcastStyleToAttribute as _upcastNormalizedTableStyleToAttribute, upcastTable as _upcastTable, upcastBorderStyles as _upcastTableBorderStyles, upcastColgroupElement as _upcastTableColgroupElement, upcastTableFigure as _upcastTableFigure, updateColumnElements as _updateTableColumnElements, updateNumericAttribute as _updateTableNumericAttribute };
|
|
12447
12704
|
//# sourceMappingURL=index.js.map
|