@ckeditor/ckeditor5-table 47.4.0 → 47.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-table",
3
- "version": "47.4.0",
3
+ "version": "47.5.0-alpha.1",
4
4
  "description": "Table feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,14 +13,14 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "ckeditor5": "47.4.0",
17
- "@ckeditor/ckeditor5-clipboard": "47.4.0",
18
- "@ckeditor/ckeditor5-core": "47.4.0",
19
- "@ckeditor/ckeditor5-engine": "47.4.0",
20
- "@ckeditor/ckeditor5-icons": "47.4.0",
21
- "@ckeditor/ckeditor5-ui": "47.4.0",
22
- "@ckeditor/ckeditor5-utils": "47.4.0",
23
- "@ckeditor/ckeditor5-widget": "47.4.0",
16
+ "ckeditor5": "47.5.0-alpha.1",
17
+ "@ckeditor/ckeditor5-clipboard": "47.5.0-alpha.1",
18
+ "@ckeditor/ckeditor5-core": "47.5.0-alpha.1",
19
+ "@ckeditor/ckeditor5-engine": "47.5.0-alpha.1",
20
+ "@ckeditor/ckeditor5-icons": "47.5.0-alpha.1",
21
+ "@ckeditor/ckeditor5-ui": "47.5.0-alpha.1",
22
+ "@ckeditor/ckeditor5-utils": "47.5.0-alpha.1",
23
+ "@ckeditor/ckeditor5-widget": "47.5.0-alpha.1",
24
24
  "es-toolkit": "1.39.5"
25
25
  },
26
26
  "author": "CKSource (http://cksource.com/)",
@@ -65,4 +65,4 @@
65
65
  "./ckeditor5-metadata.json": "./ckeditor5-metadata.json",
66
66
  "./package.json": "./package.json"
67
67
  }
68
- }
68
+ }
@@ -65,8 +65,8 @@ export function upcastStyleToAttribute(conversion, options) {
65
65
  }
66
66
  const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
67
67
  let value = viewElement.getAttribute(attributeName);
68
- if (value && attributeType == 'length' && !value.endsWith('px')) {
69
- value += 'px';
68
+ if (value && attributeType == 'length') {
69
+ value = parseFloat(value) + (value.endsWith('%') ? '%' : 'px');
70
70
  }
71
71
  if (localDefaultValue !== value) {
72
72
  return value;
@@ -171,8 +171,9 @@ export function upcastBorderStyles(editor, viewElementName, modelAttributes, def
171
171
  return;
172
172
  }
173
173
  const modelElement = modelRange?.start?.nodeAfter;
174
- // If model element has already border style attribute, skip the conversion.
175
- if (!modelElement || modelElement.hasAttribute(modelAttributes.style)) {
174
+ // If model element has any non-default border attribute, skip the conversion.
175
+ if (!modelElement ||
176
+ Object.values(modelAttributes).some(attributeName => modelElement.hasAttribute(attributeName))) {
176
177
  return;
177
178
  }
178
179
  conversionApi.writer.setAttribute(modelAttributes.style, 'none', modelElement);
@@ -675,9 +675,14 @@ export class TableColumnResizeEditing extends Plugin {
675
675
  const modelTable = modelLeftCell.findAncestor('table');
676
676
  const leftColumnIndex = getColumnEdgesIndexes(modelLeftCell, this._tableUtilsPlugin).rightEdge;
677
677
  const lastColumnIndex = this._tableUtilsPlugin.getColumns(modelTable) - 1;
678
+ let tableAlignment = modelTable.getAttribute('tableAlignment');
679
+ if (modelTable.getAttribute('tableType') !== 'layout') {
680
+ tableAlignment ||= editor.config.get('table.tableProperties.defaultProperties.alignment');
681
+ tableAlignment ||= 'center';
682
+ }
678
683
  const isRightEdge = leftColumnIndex === lastColumnIndex;
679
- const isTableCentered = !modelTable.hasAttribute('tableAlignment');
680
684
  const isLtrContent = editor.locale.contentLanguageDirection !== 'rtl';
685
+ const isTableCentered = tableAlignment === 'center';
681
686
  const viewTable = viewLeftCell.findAncestor('table');
682
687
  const viewFigure = viewTable.findAncestor('figure');
683
688
  const viewColgroup = [...viewTable.getChildren()]