@ckeditor/ckeditor5-table 35.3.2 → 36.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/build/table.js +2 -2
- package/package.json +26 -26
- package/src/commands/insertcolumncommand.js +1 -1
- package/src/commands/insertrowcommand.js +1 -1
- package/src/commands/inserttablecommand.js +1 -1
- package/src/commands/mergecellcommand.js +1 -1
- package/src/commands/mergecellscommand.js +1 -1
- package/src/commands/removecolumncommand.js +1 -1
- package/src/commands/removerowcommand.js +1 -1
- package/src/commands/selectcolumncommand.js +1 -1
- package/src/commands/selectrowcommand.js +1 -1
- package/src/commands/setheadercolumncommand.js +1 -1
- package/src/commands/setheaderrowcommand.js +1 -1
- package/src/commands/splitcellcommand.js +1 -1
- package/src/converters/downcast.js +8 -5
- package/src/converters/table-caption-post-fixer.js +1 -1
- package/src/converters/table-cell-paragraph-post-fixer.js +1 -1
- package/src/converters/table-cell-refresh-handler.js +1 -1
- package/src/converters/table-headings-refresh-handler.js +1 -1
- package/src/converters/table-layout-post-fixer.js +1 -1
- package/src/converters/tableproperties.js +7 -2
- package/src/converters/upcasttable.js +21 -6
- package/src/index.js +1 -1
- package/src/plaintableoutput.js +1 -1
- package/src/table.js +1 -1
- package/src/tablecaption/tablecaptionediting.js +1 -1
- package/src/tablecaption/tablecaptionui.js +1 -1
- package/src/tablecaption/toggletablecaptioncommand.js +1 -1
- package/src/tablecaption/utils.js +1 -1
- package/src/tablecaption.js +1 -1
- package/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellbordercolorcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellborderstylecommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellborderwidthcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellheightcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpaddingcommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellpropertycommand.js +1 -1
- package/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js +1 -1
- package/src/tablecellproperties/tablecellpropertiesediting.js +1 -1
- package/src/tablecellproperties/tablecellpropertiesui.js +53 -32
- package/src/tablecellproperties/ui/tablecellpropertiesview.js +1 -1
- package/src/tablecellproperties.js +1 -1
- package/src/tablecellwidth/commands/tablecellwidthcommand.js +1 -1
- package/src/tablecellwidth/tablecellwidthediting.js +1 -1
- package/src/tableclipboard.js +1 -1
- package/src/tablecolumnresize/constants.js +1 -1
- package/src/tablecolumnresize/converters.js +5 -3
- package/src/tablecolumnresize/tablecolumnresizeediting.js +13 -15
- package/src/tablecolumnresize/tablecolumnwidthscommand.js +1 -1
- package/src/tablecolumnresize/tablewidthresizecommand.js +9 -4
- package/src/tablecolumnresize/utils.js +1 -25
- package/src/tablecolumnresize.js +1 -1
- package/src/tableediting.js +1 -40
- package/src/tablekeyboard.js +1 -1
- package/src/tablemouse/mouseeventsobserver.js +1 -1
- package/src/tablemouse.js +1 -1
- package/src/tableproperties/commands/tablealignmentcommand.js +1 -1
- package/src/tableproperties/commands/tablebackgroundcolorcommand.js +1 -1
- package/src/tableproperties/commands/tablebordercolorcommand.js +1 -1
- package/src/tableproperties/commands/tableborderstylecommand.js +1 -1
- package/src/tableproperties/commands/tableborderwidthcommand.js +1 -1
- package/src/tableproperties/commands/tableheightcommand.js +1 -1
- package/src/tableproperties/commands/tablepropertycommand.js +1 -1
- package/src/tableproperties/commands/tablewidthcommand.js +1 -1
- package/src/tableproperties/tablepropertiesediting.js +8 -2
- package/src/tableproperties/tablepropertiesui.js +32 -17
- package/src/tableproperties/ui/tablepropertiesview.js +1 -1
- package/src/tableproperties.js +1 -1
- package/src/tableselection.js +1 -1
- package/src/tabletoolbar.js +1 -1
- package/src/tableui.js +2 -2
- package/src/tableutils.js +1 -1
- package/src/tablewalker.js +2 -2
- package/src/ui/colorinputview.js +1 -1
- package/src/ui/formrowview.js +1 -1
- package/src/ui/inserttableview.js +3 -2
- package/src/utils/common.js +1 -1
- package/src/utils/structure.js +1 -1
- package/src/utils/table-properties.js +1 -1
- package/src/utils/ui/contextualballoon.js +1 -1
- package/src/utils/ui/table-properties.js +1 -1
- package/src/utils/ui/widget.js +1 -1
- package/theme/colorinput.css +1 -1
- package/theme/form.css +1 -1
- package/theme/formrow.css +1 -1
- package/theme/inserttable.css +1 -1
- package/theme/table.css +1 -1
- package/theme/tablecaption.css +1 -1
- package/theme/tablecellproperties.css +1 -1
- package/theme/tablecolumnresize.css +1 -1
- package/theme/tableediting.css +1 -1
- package/theme/tableform.css +1 -1
- package/theme/tableproperties.css +1 -1
- package/theme/tableselection.css +1 -1
- package/build/table.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "36.0.0",
|
|
4
4
|
"description": "Table feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,34 +12,34 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "^
|
|
15
|
+
"ckeditor5": "^36.0.0",
|
|
16
16
|
"lodash-es": "^4.17.15"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ckeditor/ckeditor5-alignment": "^
|
|
20
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
|
21
|
-
"@ckeditor/ckeditor5-block-quote": "^
|
|
22
|
-
"@ckeditor/ckeditor5-clipboard": "^
|
|
23
|
-
"@ckeditor/ckeditor5-core": "^
|
|
24
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
|
25
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
|
26
|
-
"@ckeditor/ckeditor5-engine": "^
|
|
27
|
-
"@ckeditor/ckeditor5-highlight": "^
|
|
28
|
-
"@ckeditor/ckeditor5-horizontal-line": "^
|
|
29
|
-
"@ckeditor/ckeditor5-html-support": "^
|
|
30
|
-
"@ckeditor/ckeditor5-image": "^
|
|
31
|
-
"@ckeditor/ckeditor5-indent": "^
|
|
32
|
-
"@ckeditor/ckeditor5-link": "^
|
|
33
|
-
"@ckeditor/ckeditor5-list": "^
|
|
34
|
-
"@ckeditor/ckeditor5-media-embed": "^
|
|
35
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
|
36
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
|
37
|
-
"@ckeditor/ckeditor5-typing": "^
|
|
38
|
-
"@ckeditor/ckeditor5-ui": "^
|
|
39
|
-
"@ckeditor/ckeditor5-undo": "^
|
|
40
|
-
"@ckeditor/ckeditor5-utils": "^
|
|
41
|
-
"@ckeditor/ckeditor5-widget": "^
|
|
42
|
-
"@ckeditor/ckeditor5-source-editing": "^
|
|
19
|
+
"@ckeditor/ckeditor5-alignment": "^36.0.0",
|
|
20
|
+
"@ckeditor/ckeditor5-basic-styles": "^36.0.0",
|
|
21
|
+
"@ckeditor/ckeditor5-block-quote": "^36.0.0",
|
|
22
|
+
"@ckeditor/ckeditor5-clipboard": "^36.0.0",
|
|
23
|
+
"@ckeditor/ckeditor5-core": "^36.0.0",
|
|
24
|
+
"@ckeditor/ckeditor5-dev-utils": "^32.0.0",
|
|
25
|
+
"@ckeditor/ckeditor5-editor-classic": "^36.0.0",
|
|
26
|
+
"@ckeditor/ckeditor5-engine": "^36.0.0",
|
|
27
|
+
"@ckeditor/ckeditor5-highlight": "^36.0.0",
|
|
28
|
+
"@ckeditor/ckeditor5-horizontal-line": "^36.0.0",
|
|
29
|
+
"@ckeditor/ckeditor5-html-support": "^36.0.0",
|
|
30
|
+
"@ckeditor/ckeditor5-image": "^36.0.0",
|
|
31
|
+
"@ckeditor/ckeditor5-indent": "^36.0.0",
|
|
32
|
+
"@ckeditor/ckeditor5-link": "^36.0.0",
|
|
33
|
+
"@ckeditor/ckeditor5-list": "^36.0.0",
|
|
34
|
+
"@ckeditor/ckeditor5-media-embed": "^36.0.0",
|
|
35
|
+
"@ckeditor/ckeditor5-paragraph": "^36.0.0",
|
|
36
|
+
"@ckeditor/ckeditor5-theme-lark": "^36.0.0",
|
|
37
|
+
"@ckeditor/ckeditor5-typing": "^36.0.0",
|
|
38
|
+
"@ckeditor/ckeditor5-ui": "^36.0.0",
|
|
39
|
+
"@ckeditor/ckeditor5-undo": "^36.0.0",
|
|
40
|
+
"@ckeditor/ckeditor5-utils": "^36.0.0",
|
|
41
|
+
"@ckeditor/ckeditor5-widget": "^36.0.0",
|
|
42
|
+
"@ckeditor/ckeditor5-source-editing": "^36.0.0",
|
|
43
43
|
"json-diff": "^0.5.4",
|
|
44
44
|
"webpack": "^5.58.1",
|
|
45
45
|
"webpack-cli": "^4.9.0"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -114,7 +114,7 @@ export function downcastCell( options = {} ) {
|
|
|
114
114
|
* @returns {Function} Element creator.
|
|
115
115
|
*/
|
|
116
116
|
export function convertParagraphInTableCell( options = {} ) {
|
|
117
|
-
return ( modelElement, { writer
|
|
117
|
+
return ( modelElement, { writer } ) => {
|
|
118
118
|
if ( !modelElement.parent.is( 'element', 'tableCell' ) ) {
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
@@ -126,9 +126,12 @@ export function convertParagraphInTableCell( options = {} ) {
|
|
|
126
126
|
if ( options.asWidget ) {
|
|
127
127
|
return writer.createContainerElement( 'span', { class: 'ck-table-bogus-paragraph' } );
|
|
128
128
|
} else {
|
|
129
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
// Using `<p>` in case there are some markers on it and transparentRendering will render it anyway.
|
|
130
|
+
const viewElement = writer.createContainerElement( 'p' );
|
|
131
|
+
|
|
132
|
+
writer.setCustomProperty( 'dataPipeline:transparentRendering', true, viewElement );
|
|
133
|
+
|
|
134
|
+
return viewElement;
|
|
132
135
|
}
|
|
133
136
|
};
|
|
134
137
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -17,9 +17,10 @@
|
|
|
17
17
|
* @param {String} options.viewElement The view element name that should be converted.
|
|
18
18
|
* @param {String} options.defaultValue The default value for the specified `modelAttribute`.
|
|
19
19
|
* @param {Boolean} [options.reduceBoxSides=false]
|
|
20
|
+
* @param {Function} [options.shouldUpcast] The function which returns `true` if style should be upcasted from this element.
|
|
20
21
|
*/
|
|
21
22
|
export function upcastStyleToAttribute( conversion, options ) {
|
|
22
|
-
const { viewElement, defaultValue, modelAttribute, styleName, reduceBoxSides = false } = options;
|
|
23
|
+
const { viewElement, defaultValue, modelAttribute, styleName, reduceBoxSides = false, shouldUpcast = () => true } = options;
|
|
23
24
|
|
|
24
25
|
conversion.for( 'upcast' ).attributeToAttribute( {
|
|
25
26
|
view: {
|
|
@@ -31,6 +32,10 @@ export function upcastStyleToAttribute( conversion, options ) {
|
|
|
31
32
|
model: {
|
|
32
33
|
key: modelAttribute,
|
|
33
34
|
value: viewElement => {
|
|
35
|
+
if ( !shouldUpcast( viewElement ) ) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
const normalized = viewElement.getNormalizedStyle( styleName );
|
|
35
40
|
const value = reduceBoxSides ? reduceBoxSidesValue( normalized ) : normalized;
|
|
36
41
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -29,7 +29,7 @@ export function upcastTableFigure() {
|
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
// Find
|
|
32
|
+
// Find a table element inside the figure element.
|
|
33
33
|
const viewTable = getViewTableFromFigure( data.viewItem );
|
|
34
34
|
|
|
35
35
|
// Do not convert if table element is absent or was already converted.
|
|
@@ -146,18 +146,33 @@ export function skipEmptyTableRow() {
|
|
|
146
146
|
*/
|
|
147
147
|
export function ensureParagraphInTableCell( elementName ) {
|
|
148
148
|
return dispatcher => {
|
|
149
|
-
dispatcher.on( `element:${ elementName }`, ( evt, data,
|
|
149
|
+
dispatcher.on( `element:${ elementName }`, ( evt, data, { writer } ) => {
|
|
150
150
|
// The default converter will create a model range on converted table cell.
|
|
151
151
|
if ( !data.modelRange ) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
+
const tableCell = data.modelRange.start.nodeAfter;
|
|
156
|
+
const modelCursor = writer.createPositionAt( tableCell, 0 );
|
|
157
|
+
|
|
155
158
|
// Ensure a paragraph in the model for empty table cells for converted table cells.
|
|
156
159
|
if ( data.viewItem.isEmpty ) {
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
writer.insertElement( 'paragraph', modelCursor );
|
|
161
|
+
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
159
164
|
|
|
160
|
-
|
|
165
|
+
const childNodes = Array.from( tableCell.getChildren() );
|
|
166
|
+
|
|
167
|
+
// In case there are only markers inside the table cell then move them to the paragraph.
|
|
168
|
+
if ( childNodes.every( node => node.is( 'element', '$marker' ) ) ) {
|
|
169
|
+
const paragraph = writer.createElement( 'paragraph' );
|
|
170
|
+
|
|
171
|
+
writer.insert( paragraph, writer.createPositionAt( tableCell, 0 ) );
|
|
172
|
+
|
|
173
|
+
for ( const node of childNodes ) {
|
|
174
|
+
writer.move( writer.createRangeOn( node ), writer.createPositionAt( paragraph, 'end' ) );
|
|
175
|
+
}
|
|
161
176
|
}
|
|
162
177
|
}, { priority: 'low' } );
|
|
163
178
|
};
|
package/src/index.js
CHANGED
package/src/plaintableoutput.js
CHANGED
package/src/table.js
CHANGED
package/src/tablecaption.js
CHANGED