@ckeditor/ckeditor5-table 45.0.0-alpha.1 → 45.0.0-alpha.3

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.
Files changed (167) hide show
  1. package/build/table.js +1 -1
  2. package/build/translations/ar.js +1 -1
  3. package/build/translations/bg.js +1 -1
  4. package/build/translations/bn.js +1 -1
  5. package/build/translations/ca.js +1 -1
  6. package/build/translations/cs.js +1 -1
  7. package/build/translations/da.js +1 -1
  8. package/build/translations/de.js +1 -1
  9. package/build/translations/el.js +1 -1
  10. package/build/translations/es.js +1 -1
  11. package/build/translations/et.js +1 -1
  12. package/build/translations/fi.js +1 -1
  13. package/build/translations/fr.js +1 -1
  14. package/build/translations/he.js +1 -1
  15. package/build/translations/hi.js +1 -1
  16. package/build/translations/hu.js +1 -1
  17. package/build/translations/id.js +1 -1
  18. package/build/translations/it.js +1 -1
  19. package/build/translations/ja.js +1 -1
  20. package/build/translations/ko.js +1 -1
  21. package/build/translations/lt.js +1 -1
  22. package/build/translations/lv.js +1 -1
  23. package/build/translations/ms.js +1 -1
  24. package/build/translations/nl.js +1 -1
  25. package/build/translations/no.js +1 -1
  26. package/build/translations/pl.js +1 -1
  27. package/build/translations/pt-br.js +1 -1
  28. package/build/translations/pt.js +1 -1
  29. package/build/translations/ro.js +1 -1
  30. package/build/translations/ru.js +1 -1
  31. package/build/translations/sk.js +1 -1
  32. package/build/translations/sr.js +1 -1
  33. package/build/translations/sv.js +1 -1
  34. package/build/translations/th.js +1 -1
  35. package/build/translations/tr.js +1 -1
  36. package/build/translations/uk.js +1 -1
  37. package/build/translations/vi.js +1 -1
  38. package/build/translations/zh-cn.js +1 -1
  39. package/build/translations/zh.js +1 -1
  40. package/ckeditor5-metadata.json +2 -2
  41. package/dist/index-editor.css +4 -0
  42. package/dist/index.css +6 -0
  43. package/dist/index.css.map +1 -1
  44. package/dist/index.js +39 -86
  45. package/dist/index.js.map +1 -1
  46. package/dist/translations/ar.js +1 -1
  47. package/dist/translations/ar.umd.js +1 -1
  48. package/dist/translations/bg.js +1 -1
  49. package/dist/translations/bg.umd.js +1 -1
  50. package/dist/translations/bn.js +1 -1
  51. package/dist/translations/bn.umd.js +1 -1
  52. package/dist/translations/ca.js +1 -1
  53. package/dist/translations/ca.umd.js +1 -1
  54. package/dist/translations/cs.js +1 -1
  55. package/dist/translations/cs.umd.js +1 -1
  56. package/dist/translations/da.js +1 -1
  57. package/dist/translations/da.umd.js +1 -1
  58. package/dist/translations/de.js +1 -1
  59. package/dist/translations/de.umd.js +1 -1
  60. package/dist/translations/el.js +1 -1
  61. package/dist/translations/el.umd.js +1 -1
  62. package/dist/translations/es.js +1 -1
  63. package/dist/translations/es.umd.js +1 -1
  64. package/dist/translations/et.js +1 -1
  65. package/dist/translations/et.umd.js +1 -1
  66. package/dist/translations/fi.js +1 -1
  67. package/dist/translations/fi.umd.js +1 -1
  68. package/dist/translations/fr.js +1 -1
  69. package/dist/translations/fr.umd.js +1 -1
  70. package/dist/translations/he.js +1 -1
  71. package/dist/translations/he.umd.js +1 -1
  72. package/dist/translations/hi.js +1 -1
  73. package/dist/translations/hi.umd.js +1 -1
  74. package/dist/translations/hu.js +1 -1
  75. package/dist/translations/hu.umd.js +1 -1
  76. package/dist/translations/id.js +1 -1
  77. package/dist/translations/id.umd.js +1 -1
  78. package/dist/translations/it.js +1 -1
  79. package/dist/translations/it.umd.js +1 -1
  80. package/dist/translations/ja.js +1 -1
  81. package/dist/translations/ja.umd.js +1 -1
  82. package/dist/translations/ko.js +1 -1
  83. package/dist/translations/ko.umd.js +1 -1
  84. package/dist/translations/lt.js +1 -1
  85. package/dist/translations/lt.umd.js +1 -1
  86. package/dist/translations/lv.js +1 -1
  87. package/dist/translations/lv.umd.js +1 -1
  88. package/dist/translations/ms.js +1 -1
  89. package/dist/translations/ms.umd.js +1 -1
  90. package/dist/translations/nl.js +1 -1
  91. package/dist/translations/nl.umd.js +1 -1
  92. package/dist/translations/no.js +1 -1
  93. package/dist/translations/no.umd.js +1 -1
  94. package/dist/translations/pl.js +1 -1
  95. package/dist/translations/pl.umd.js +1 -1
  96. package/dist/translations/pt-br.js +1 -1
  97. package/dist/translations/pt-br.umd.js +1 -1
  98. package/dist/translations/pt.js +1 -1
  99. package/dist/translations/pt.umd.js +1 -1
  100. package/dist/translations/ro.js +1 -1
  101. package/dist/translations/ro.umd.js +1 -1
  102. package/dist/translations/ru.js +1 -1
  103. package/dist/translations/ru.umd.js +1 -1
  104. package/dist/translations/sk.js +1 -1
  105. package/dist/translations/sk.umd.js +1 -1
  106. package/dist/translations/sr.js +1 -1
  107. package/dist/translations/sr.umd.js +1 -1
  108. package/dist/translations/sv.js +1 -1
  109. package/dist/translations/sv.umd.js +1 -1
  110. package/dist/translations/th.js +1 -1
  111. package/dist/translations/th.umd.js +1 -1
  112. package/dist/translations/tr.js +1 -1
  113. package/dist/translations/tr.umd.js +1 -1
  114. package/dist/translations/uk.js +1 -1
  115. package/dist/translations/uk.umd.js +1 -1
  116. package/dist/translations/vi.js +1 -1
  117. package/dist/translations/vi.umd.js +1 -1
  118. package/dist/translations/zh-cn.js +1 -1
  119. package/dist/translations/zh-cn.umd.js +1 -1
  120. package/dist/translations/zh.js +1 -1
  121. package/dist/translations/zh.umd.js +1 -1
  122. package/lang/translations/ar.po +7 -7
  123. package/lang/translations/bg.po +7 -7
  124. package/lang/translations/bn.po +7 -7
  125. package/lang/translations/ca.po +7 -7
  126. package/lang/translations/cs.po +7 -7
  127. package/lang/translations/da.po +7 -7
  128. package/lang/translations/de.po +7 -7
  129. package/lang/translations/el.po +7 -7
  130. package/lang/translations/es.po +7 -7
  131. package/lang/translations/et.po +7 -7
  132. package/lang/translations/fi.po +7 -7
  133. package/lang/translations/fr.po +7 -7
  134. package/lang/translations/he.po +7 -7
  135. package/lang/translations/hi.po +7 -7
  136. package/lang/translations/hu.po +7 -7
  137. package/lang/translations/id.po +7 -7
  138. package/lang/translations/it.po +7 -7
  139. package/lang/translations/ja.po +7 -7
  140. package/lang/translations/ko.po +7 -7
  141. package/lang/translations/lt.po +7 -7
  142. package/lang/translations/lv.po +7 -7
  143. package/lang/translations/ms.po +7 -7
  144. package/lang/translations/nl.po +7 -7
  145. package/lang/translations/no.po +7 -7
  146. package/lang/translations/pl.po +7 -7
  147. package/lang/translations/pt-br.po +7 -7
  148. package/lang/translations/pt.po +7 -7
  149. package/lang/translations/ro.po +7 -7
  150. package/lang/translations/ru.po +7 -7
  151. package/lang/translations/sk.po +7 -7
  152. package/lang/translations/sr.po +7 -7
  153. package/lang/translations/sv.po +7 -7
  154. package/lang/translations/th.po +7 -7
  155. package/lang/translations/tr.po +7 -7
  156. package/lang/translations/uk.po +7 -7
  157. package/lang/translations/vi.po +7 -7
  158. package/lang/translations/zh-cn.po +7 -7
  159. package/lang/translations/zh.po +7 -7
  160. package/package.json +9 -9
  161. package/src/converters/tableproperties.d.ts +5 -1
  162. package/src/converters/tableproperties.js +12 -10
  163. package/src/tablecellproperties/tablecellpropertiesediting.js +5 -42
  164. package/src/tablelayout.d.ts +1 -1
  165. package/src/tablelayout.js +1 -1
  166. package/src/tableproperties/tablepropertiesediting.js +21 -18
  167. package/theme/tablelayout.css +6 -0
@@ -269,28 +269,28 @@ msgstr "Tablo"
269
269
 
270
270
  msgctxt "Label for the insert table layout toolbar button."
271
271
  msgid "Insert table layout"
272
- msgstr ""
272
+ msgstr "Tablo düzeni ekle"
273
273
 
274
274
  msgctxt "The accessible label used in the table layout insert UI element."
275
275
  msgid "Table layout"
276
- msgstr ""
276
+ msgstr "Tablo düzeni"
277
277
 
278
278
  msgctxt "The accessible label of the layout table type dropdown button."
279
279
  msgid "Layout table"
280
- msgstr ""
280
+ msgstr "Düzen tablosu"
281
281
 
282
282
  msgctxt "The accessible label of the content table type dropdown button."
283
283
  msgid "Content table"
284
- msgstr ""
284
+ msgstr "İçerik tablosu"
285
285
 
286
286
  msgctxt "The accessible label of the table balloon button that displays a user interface to choose table type."
287
287
  msgid "Choose table type"
288
- msgstr ""
288
+ msgstr "Tablo türünü seç"
289
289
 
290
290
  msgctxt "The accessible label of the table type toolbar button."
291
291
  msgid "Table type"
292
- msgstr ""
292
+ msgstr "Tablo türü"
293
293
 
294
294
  msgctxt "The accessible label of dropdown list that displays a user interface to choose table type."
295
295
  msgid "Table type options"
296
- msgstr ""
296
+ msgstr "Tablo türü seçenekleri"
@@ -269,28 +269,28 @@ msgstr "Таблиця"
269
269
 
270
270
  msgctxt "Label for the insert table layout toolbar button."
271
271
  msgid "Insert table layout"
272
- msgstr ""
272
+ msgstr "Вставити формат таблиці"
273
273
 
274
274
  msgctxt "The accessible label used in the table layout insert UI element."
275
275
  msgid "Table layout"
276
- msgstr ""
276
+ msgstr "Формат таблиці"
277
277
 
278
278
  msgctxt "The accessible label of the layout table type dropdown button."
279
279
  msgid "Layout table"
280
- msgstr ""
280
+ msgstr "Формат таблиці"
281
281
 
282
282
  msgctxt "The accessible label of the content table type dropdown button."
283
283
  msgid "Content table"
284
- msgstr ""
284
+ msgstr "Вміст таблиці"
285
285
 
286
286
  msgctxt "The accessible label of the table balloon button that displays a user interface to choose table type."
287
287
  msgid "Choose table type"
288
- msgstr ""
288
+ msgstr "Вибрати тип таблиці"
289
289
 
290
290
  msgctxt "The accessible label of the table type toolbar button."
291
291
  msgid "Table type"
292
- msgstr ""
292
+ msgstr "Тип таблиці"
293
293
 
294
294
  msgctxt "The accessible label of dropdown list that displays a user interface to choose table type."
295
295
  msgid "Table type options"
296
- msgstr ""
296
+ msgstr "Опції типу таблиці"
@@ -269,28 +269,28 @@ msgstr "Bảng"
269
269
 
270
270
  msgctxt "Label for the insert table layout toolbar button."
271
271
  msgid "Insert table layout"
272
- msgstr ""
272
+ msgstr "Chèn bố cục bảng"
273
273
 
274
274
  msgctxt "The accessible label used in the table layout insert UI element."
275
275
  msgid "Table layout"
276
- msgstr ""
276
+ msgstr "Bố cục bảng"
277
277
 
278
278
  msgctxt "The accessible label of the layout table type dropdown button."
279
279
  msgid "Layout table"
280
- msgstr ""
280
+ msgstr "Bảng bố cục"
281
281
 
282
282
  msgctxt "The accessible label of the content table type dropdown button."
283
283
  msgid "Content table"
284
- msgstr ""
284
+ msgstr "Bảng nội dung"
285
285
 
286
286
  msgctxt "The accessible label of the table balloon button that displays a user interface to choose table type."
287
287
  msgid "Choose table type"
288
- msgstr ""
288
+ msgstr "Chọn loại bảng"
289
289
 
290
290
  msgctxt "The accessible label of the table type toolbar button."
291
291
  msgid "Table type"
292
- msgstr ""
292
+ msgstr "Loại bảng"
293
293
 
294
294
  msgctxt "The accessible label of dropdown list that displays a user interface to choose table type."
295
295
  msgid "Table type options"
296
- msgstr ""
296
+ msgstr "Tùy chọn loại bảng"
@@ -269,28 +269,28 @@ msgstr "表格"
269
269
 
270
270
  msgctxt "Label for the insert table layout toolbar button."
271
271
  msgid "Insert table layout"
272
- msgstr ""
272
+ msgstr "插入表格布局"
273
273
 
274
274
  msgctxt "The accessible label used in the table layout insert UI element."
275
275
  msgid "Table layout"
276
- msgstr ""
276
+ msgstr "表格布局"
277
277
 
278
278
  msgctxt "The accessible label of the layout table type dropdown button."
279
279
  msgid "Layout table"
280
- msgstr ""
280
+ msgstr "布局表格"
281
281
 
282
282
  msgctxt "The accessible label of the content table type dropdown button."
283
283
  msgid "Content table"
284
- msgstr ""
284
+ msgstr "内容表格"
285
285
 
286
286
  msgctxt "The accessible label of the table balloon button that displays a user interface to choose table type."
287
287
  msgid "Choose table type"
288
- msgstr ""
288
+ msgstr "选择表格类型"
289
289
 
290
290
  msgctxt "The accessible label of the table type toolbar button."
291
291
  msgid "Table type"
292
- msgstr ""
292
+ msgstr "表格类型"
293
293
 
294
294
  msgctxt "The accessible label of dropdown list that displays a user interface to choose table type."
295
295
  msgid "Table type options"
296
- msgstr ""
296
+ msgstr "表格类型选项"
@@ -269,28 +269,28 @@ msgstr "表格"
269
269
 
270
270
  msgctxt "Label for the insert table layout toolbar button."
271
271
  msgid "Insert table layout"
272
- msgstr ""
272
+ msgstr "插入表格版面配置"
273
273
 
274
274
  msgctxt "The accessible label used in the table layout insert UI element."
275
275
  msgid "Table layout"
276
- msgstr ""
276
+ msgstr "表格版面配置"
277
277
 
278
278
  msgctxt "The accessible label of the layout table type dropdown button."
279
279
  msgid "Layout table"
280
- msgstr ""
280
+ msgstr "版面配置表格"
281
281
 
282
282
  msgctxt "The accessible label of the content table type dropdown button."
283
283
  msgid "Content table"
284
- msgstr ""
284
+ msgstr "內容表格"
285
285
 
286
286
  msgctxt "The accessible label of the table balloon button that displays a user interface to choose table type."
287
287
  msgid "Choose table type"
288
- msgstr ""
288
+ msgstr "選擇表格類型"
289
289
 
290
290
  msgctxt "The accessible label of the table type toolbar button."
291
291
  msgid "Table type"
292
- msgstr ""
292
+ msgstr "表格類型"
293
293
 
294
294
  msgctxt "The accessible label of dropdown list that displays a user interface to choose table type."
295
295
  msgid "Table type options"
296
- msgstr ""
296
+ msgstr "表格類型選項"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-table",
3
- "version": "45.0.0-alpha.1",
3
+ "version": "45.0.0-alpha.3",
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": "45.0.0-alpha.1",
17
- "@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.1",
18
- "@ckeditor/ckeditor5-core": "45.0.0-alpha.1",
19
- "@ckeditor/ckeditor5-engine": "45.0.0-alpha.1",
20
- "@ckeditor/ckeditor5-icons": "45.0.0-alpha.1",
21
- "@ckeditor/ckeditor5-ui": "45.0.0-alpha.1",
22
- "@ckeditor/ckeditor5-utils": "45.0.0-alpha.1",
23
- "@ckeditor/ckeditor5-widget": "45.0.0-alpha.1",
16
+ "ckeditor5": "45.0.0-alpha.3",
17
+ "@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.3",
18
+ "@ckeditor/ckeditor5-core": "45.0.0-alpha.3",
19
+ "@ckeditor/ckeditor5-engine": "45.0.0-alpha.3",
20
+ "@ckeditor/ckeditor5-icons": "45.0.0-alpha.3",
21
+ "@ckeditor/ckeditor5-ui": "45.0.0-alpha.3",
22
+ "@ckeditor/ckeditor5-utils": "45.0.0-alpha.3",
23
+ "@ckeditor/ckeditor5-widget": "45.0.0-alpha.3",
24
24
  "es-toolkit": "1.32.0"
25
25
  },
26
26
  "author": "CKSource (http://cksource.com/)",
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module table/converters/tableproperties
7
7
  */
8
- import type { Conversion, ViewElement } from 'ckeditor5/src/engine.js';
8
+ import type { Conversion, UpcastConversionData, ViewElement } from 'ckeditor5/src/engine.js';
9
9
  /**
10
10
  * Conversion helper for upcasting attributes using normalized styles.
11
11
  *
@@ -52,3 +52,7 @@ export declare function downcastTableAttribute(conversion: Conversion, options:
52
52
  modelAttribute: string;
53
53
  styleName: string;
54
54
  }): void;
55
+ /**
56
+ * Returns the default value for table or table cell property adjusted for layout tables.
57
+ */
58
+ export declare function getDefaultValueAdjusted(defaultValue: string, layoutTableDefault: string, data: UpcastConversionData<ViewElement>): string;
@@ -27,16 +27,7 @@ export function upcastStyleToAttribute(conversion, options) {
27
27
  if (!shouldUpcast(viewElement)) {
28
28
  return;
29
29
  }
30
- let localDefaultValue = defaultValue;
31
- // Adjust default for layout tables.
32
- if (data.modelRange) {
33
- const modelElement = first(data.modelRange.getItems({ shallow: true }));
34
- const tableElement = modelElement && modelElement.is('element') &&
35
- modelElement.findAncestor('table', { includeSelf: true });
36
- if (tableElement && tableElement.getAttribute('tableType') == 'layout') {
37
- localDefaultValue = '';
38
- }
39
- }
30
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
40
31
  const normalized = viewElement.getNormalizedStyle(styleName);
41
32
  const value = reduceBoxSides ? reduceBoxSidesValue(normalized) : normalized;
42
33
  if (localDefaultValue !== value) {
@@ -157,6 +148,17 @@ export function downcastTableAttribute(conversion, options) {
157
148
  }
158
149
  }));
159
150
  }
151
+ /**
152
+ * Returns the default value for table or table cell property adjusted for layout tables.
153
+ */
154
+ export function getDefaultValueAdjusted(defaultValue, layoutTableDefault, data) {
155
+ const modelElement = data.modelRange && first(data.modelRange.getItems({ shallow: true }));
156
+ const tableElement = modelElement && modelElement.is('element') && modelElement.findAncestor('table', { includeSelf: true });
157
+ if (tableElement && tableElement.getAttribute('tableType') === 'layout') {
158
+ return layoutTableDefault;
159
+ }
160
+ return defaultValue;
161
+ }
160
162
  /**
161
163
  * Reduces the full top, right, bottom, left object to a single string if all sides are equal.
162
164
  * Returns original style otherwise.
@@ -6,9 +6,8 @@
6
6
  * @module table/tablecellproperties/tablecellpropertiesediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { first } from 'ckeditor5/src/utils.js';
10
9
  import { addBorderRules, addPaddingRules, addBackgroundRules } from 'ckeditor5/src/engine.js';
11
- import { downcastAttributeToStyle, upcastBorderStyles } from '../converters/tableproperties.js';
10
+ import { downcastAttributeToStyle, getDefaultValueAdjusted, upcastBorderStyles } from '../converters/tableproperties.js';
12
11
  import TableEditing from './../tableediting.js';
13
12
  import TableCellWidthEditing from '../tablecellwidth/tablecellwidthediting.js';
14
13
  import TableCellPaddingCommand from './commands/tablecellpaddingcommand.js';
@@ -168,16 +167,7 @@ function enableHorizontalAlignmentProperty(schema, conversion, defaultValue) {
168
167
  model: {
169
168
  key: 'tableCellHorizontalAlignment',
170
169
  value: (viewElement, conversionApi, data) => {
171
- let localDefaultValue = defaultValue;
172
- // Adjust default for layout tables.
173
- if (data.modelRange) {
174
- const modelElement = first(data.modelRange.getItems({ shallow: true }));
175
- const tableElement = modelElement && modelElement.is('element') &&
176
- modelElement.findAncestor('table', { includeSelf: true });
177
- if (tableElement && tableElement.getAttribute('tableType') == 'layout') {
178
- localDefaultValue = 'left';
179
- }
180
- }
170
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'left', data);
181
171
  const align = viewElement.getStyle('text-align');
182
172
  return align === localDefaultValue ? null : align;
183
173
  }
@@ -194,16 +184,7 @@ function enableHorizontalAlignmentProperty(schema, conversion, defaultValue) {
194
184
  model: {
195
185
  key: 'tableCellHorizontalAlignment',
196
186
  value: (viewElement, conversionApi, data) => {
197
- let localDefaultValue = defaultValue;
198
- // Adjust default for layout tables.
199
- if (data.modelRange) {
200
- const modelElement = first(data.modelRange.getItems({ shallow: true }));
201
- const tableElement = modelElement && modelElement.is('element') &&
202
- modelElement.findAncestor('table', { includeSelf: true });
203
- if (tableElement && tableElement.getAttribute('tableType') == 'layout') {
204
- localDefaultValue = 'left';
205
- }
206
- }
187
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'left', data);
207
188
  const align = viewElement.getAttribute('align');
208
189
  return align === localDefaultValue ? null : align;
209
190
  }
@@ -244,16 +225,7 @@ function enableVerticalAlignmentProperty(schema, conversion, defaultValue) {
244
225
  model: {
245
226
  key: 'tableCellVerticalAlignment',
246
227
  value: (viewElement, conversionApi, data) => {
247
- let localDefaultValue = defaultValue;
248
- // Adjust default for layout tables.
249
- if (data.modelRange) {
250
- const modelElement = first(data.modelRange.getItems({ shallow: true }));
251
- const tableElement = modelElement && modelElement.is('element') &&
252
- modelElement.findAncestor('table', { includeSelf: true });
253
- if (tableElement && tableElement.getAttribute('tableType') == 'layout') {
254
- localDefaultValue = 'middle';
255
- }
256
- }
228
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'middle', data);
257
229
  const align = viewElement.getStyle('vertical-align');
258
230
  return align === localDefaultValue ? null : align;
259
231
  }
@@ -270,16 +242,7 @@ function enableVerticalAlignmentProperty(schema, conversion, defaultValue) {
270
242
  model: {
271
243
  key: 'tableCellVerticalAlignment',
272
244
  value: (viewElement, conversionApi, data) => {
273
- let localDefaultValue = defaultValue;
274
- // Adjust default for layout tables.
275
- if (data.modelRange) {
276
- const modelElement = first(data.modelRange.getItems({ shallow: true }));
277
- const tableElement = modelElement && modelElement.is('element') &&
278
- modelElement.findAncestor('table', { includeSelf: true });
279
- if (tableElement && tableElement.getAttribute('tableType') == 'layout') {
280
- localDefaultValue = 'middle';
281
- }
282
- }
245
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, 'middle', data);
283
246
  const valign = viewElement.getAttribute('valign');
284
247
  return valign === localDefaultValue ? null : valign;
285
248
  }
@@ -13,7 +13,7 @@ import TableColumnResize from './tablecolumnresize.js';
13
13
  /**
14
14
  * The table plugin.
15
15
  *
16
- * For a detailed overview, check the {@glink features/tables/tables-layout Layout table feature documentation}.
16
+ * For a detailed overview, check the {@glink features/tables/layout-tables Layout table feature documentation}.
17
17
  */
18
18
  export default class TableLayout extends Plugin {
19
19
  /**
@@ -13,7 +13,7 @@ import TableColumnResize from './tablecolumnresize.js';
13
13
  /**
14
14
  * The table plugin.
15
15
  *
16
- * For a detailed overview, check the {@glink features/tables/tables-layout Layout table feature documentation}.
16
+ * For a detailed overview, check the {@glink features/tables/layout-tables Layout table feature documentation}.
17
17
  */
18
18
  export default class TableLayout extends Plugin {
19
19
  /**
@@ -6,10 +6,9 @@
6
6
  * @module table/tableproperties/tablepropertiesediting
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
- import { first } from 'ckeditor5/src/utils.js';
10
9
  import { addBackgroundRules, addBorderRules } from 'ckeditor5/src/engine.js';
11
10
  import TableEditing from '../tableediting.js';
12
- import { downcastAttributeToStyle, downcastTableAttribute, upcastBorderStyles, upcastStyleToAttribute } from '../converters/tableproperties.js';
11
+ import { downcastAttributeToStyle, downcastTableAttribute, getDefaultValueAdjusted, upcastBorderStyles, upcastStyleToAttribute } from '../converters/tableproperties.js';
13
12
  import TableBackgroundColorCommand from './commands/tablebackgroundcolorcommand.js';
14
13
  import TableBorderColorCommand from './commands/tablebordercolorcommand.js';
15
14
  import TableBorderStyleCommand from './commands/tableborderstylecommand.js';
@@ -178,14 +177,7 @@ function enableAlignmentProperty(schema, conversion, defaultValue) {
178
177
  model: {
179
178
  key: 'tableAlignment',
180
179
  value: (viewElement, conversionApi, data) => {
181
- let localDefaultValue = defaultValue;
182
- // Adjust default for layout tables.
183
- if (data.modelRange) {
184
- const modelElement = first(data.modelRange.getItems({ shallow: true }));
185
- if (modelElement && modelElement.is('element') && modelElement.getAttribute('tableType') == 'layout') {
186
- localDefaultValue = '';
187
- }
188
- }
180
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
189
181
  let align = viewElement.getStyle('float');
190
182
  // CSS: `float:none` => Model: `alignment:center`.
191
183
  if (align === 'none') {
@@ -194,6 +186,24 @@ function enableAlignmentProperty(schema, conversion, defaultValue) {
194
186
  return align === localDefaultValue ? null : align;
195
187
  }
196
188
  }
189
+ })
190
+ // Support for the `margin-left:auto; margin-right:auto;` CSS definition for the table alignment.
191
+ .attributeToAttribute({
192
+ view: {
193
+ name: /^(table|figure)$/,
194
+ styles: {
195
+ 'margin-left': 'auto',
196
+ 'margin-right': 'auto'
197
+ }
198
+ },
199
+ model: {
200
+ key: 'tableAlignment',
201
+ value: (viewElement, conversionApi, data) => {
202
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
203
+ const align = 'center';
204
+ return align === localDefaultValue ? null : align;
205
+ }
206
+ }
197
207
  })
198
208
  // Support for the `align` attribute as the backward compatibility while pasting from other sources.
199
209
  .attributeToAttribute({
@@ -206,14 +216,7 @@ function enableAlignmentProperty(schema, conversion, defaultValue) {
206
216
  name: 'table',
207
217
  key: 'tableAlignment',
208
218
  value: (viewElement, conversionApi, data) => {
209
- let localDefaultValue = defaultValue;
210
- // Adjust default for layout tables.
211
- if (data.modelRange) {
212
- const modelElement = first(data.modelRange.getItems({ shallow: true }));
213
- if (modelElement && modelElement.is('element') && modelElement.getAttribute('tableType') == 'layout') {
214
- localDefaultValue = '';
215
- }
216
- }
219
+ const localDefaultValue = getDefaultValueAdjusted(defaultValue, '', data);
217
220
  const align = viewElement.getAttribute('align');
218
221
  return align === localDefaultValue ? null : align;
219
222
  }
@@ -27,6 +27,12 @@
27
27
 
28
28
  /* Widget type around overrides. */
29
29
  &.ck-widget {
30
+ &:hover {
31
+ /* To prevent the widget outline from being cut off at the bottom
32
+ when the next cell or table has a background color, for example. */
33
+ z-index: var(--ck-z-default);
34
+ }
35
+
30
36
  &:hover > .ck-widget__selection-handle {
31
37
  opacity: 0.75;
32
38
  visibility: visible;