@atlaskit/editor-plugin-table 1.5.0 → 1.5.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cjs/i18n/cs.js +2 -2
  3. package/dist/cjs/i18n/en_ZZ.js +43 -0
  4. package/dist/cjs/i18n/ja.js +4 -4
  5. package/dist/cjs/i18n/ko.js +1 -1
  6. package/dist/cjs/i18n/sv.js +1 -1
  7. package/dist/cjs/i18n/vi.js +2 -2
  8. package/dist/cjs/i18n/zh.js +3 -3
  9. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +10 -0
  10. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  11. package/dist/cjs/plugins/table/ui/consts.js +8 -3
  12. package/dist/cjs/plugins/table/ui/ui-styles.js +2 -2
  13. package/dist/cjs/version.json +1 -1
  14. package/dist/es2019/i18n/cs.js +2 -2
  15. package/dist/es2019/i18n/en_ZZ.js +36 -0
  16. package/dist/es2019/i18n/ja.js +4 -4
  17. package/dist/es2019/i18n/ko.js +1 -1
  18. package/dist/es2019/i18n/sv.js +1 -1
  19. package/dist/es2019/i18n/vi.js +2 -2
  20. package/dist/es2019/i18n/zh.js +3 -3
  21. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +10 -0
  22. package/dist/es2019/plugins/table/ui/common-styles.js +3 -3
  23. package/dist/es2019/plugins/table/ui/consts.js +6 -2
  24. package/dist/es2019/plugins/table/ui/ui-styles.js +3 -3
  25. package/dist/es2019/version.json +1 -1
  26. package/dist/esm/i18n/cs.js +2 -2
  27. package/dist/esm/i18n/en_ZZ.js +36 -0
  28. package/dist/esm/i18n/ja.js +4 -4
  29. package/dist/esm/i18n/ko.js +1 -1
  30. package/dist/esm/i18n/sv.js +1 -1
  31. package/dist/esm/i18n/vi.js +2 -2
  32. package/dist/esm/i18n/zh.js +3 -3
  33. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +10 -0
  34. package/dist/esm/plugins/table/ui/common-styles.js +2 -2
  35. package/dist/esm/plugins/table/ui/consts.js +6 -2
  36. package/dist/esm/plugins/table/ui/ui-styles.js +3 -3
  37. package/dist/esm/version.json +1 -1
  38. package/dist/types/i18n/en_ZZ.d.ts +35 -0
  39. package/dist/types/plugins/table/ui/consts.d.ts +2 -1
  40. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +35 -0
  41. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +2 -1
  42. package/examples/99-testing.tsx +1 -4
  43. package/package.json +7 -6
  44. package/src/__tests__/integration/sticky-header.ts +5 -1
  45. package/src/__tests__/unit/color-picker.ts +2 -0
  46. package/src/__tests__/unit/commands/misc.ts +2 -0
  47. package/src/__tests__/unit/commands.ts +2 -0
  48. package/src/__tests__/unit/event-handlers.ts +2 -0
  49. package/src/__tests__/unit/get-toolbar-config.ts +2 -0
  50. package/src/__tests__/unit/index.ts +2 -0
  51. package/src/__tests__/unit/keymap.ts +2 -0
  52. package/src/__tests__/unit/layout.ts +2 -0
  53. package/src/__tests__/unit/pm-plugins/main-with-allow-collapse.ts +2 -0
  54. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +2 -0
  55. package/src/__tests__/unit/pm-plugins/table-selection-keymap.ts +2 -0
  56. package/src/__tests__/unit/utils/collapse.ts +4 -1
  57. package/src/i18n/cs.ts +2 -2
  58. package/src/i18n/en_ZZ.ts +41 -0
  59. package/src/i18n/ja.ts +4 -4
  60. package/src/i18n/ko.ts +1 -1
  61. package/src/i18n/sv.ts +1 -1
  62. package/src/i18n/vi.ts +2 -2
  63. package/src/i18n/zh.ts +3 -3
  64. package/src/plugins/table/pm-plugins/table-resizing/utils/resize-state.ts +11 -0
  65. package/src/plugins/table/ui/common-styles.ts +3 -3
  66. package/src/plugins/table/ui/consts.ts +6 -2
  67. package/src/plugins/table/ui/ui-styles.ts +3 -3
@@ -30,12 +30,14 @@ import tablePlugin from '../../../plugins/table';
30
30
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
31
31
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
32
32
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
33
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
33
34
 
34
35
  describe('table plugin: commands', () => {
35
36
  const createEditor = createProsemirrorEditorFactory();
36
37
  const preset = new Preset<LightEditorPlugin>()
37
38
  .add([featureFlagsPlugin, {}])
38
39
  .add([analyticsPlugin, {}])
40
+ .add(decorationsPlugin)
39
41
  .add(panelPlugin)
40
42
  .add(contentInsertionPlugin)
41
43
  .add([
@@ -65,6 +65,7 @@ import textFormattingPlugin from '@atlaskit/editor-core/src/plugins/text-formatt
65
65
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
66
66
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
67
67
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
68
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
68
69
 
69
70
  const TABLE_LOCAL_ID = 'test-table-local-id';
70
71
 
@@ -86,6 +87,7 @@ describe('table plugin: actions', () => {
86
87
  .add([featureFlagsPlugin, {}])
87
88
  .add([analyticsPlugin, {}])
88
89
  .add(contentInsertionPlugin)
90
+ .add(decorationsPlugin)
89
91
  .add(widthPlugin)
90
92
  .add(gridPlugin)
91
93
  .add(tablePlugin)
@@ -40,6 +40,7 @@ import { gridPlugin } from '@atlaskit/editor-plugin-grid';
40
40
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
41
41
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
42
42
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
43
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
43
44
 
44
45
  describe('table plugin: decorations', () => {
45
46
  const createEditor = createProsemirrorEditorFactory();
@@ -166,6 +167,7 @@ describe('table event handlers', () => {
166
167
  .add([featureFlagsPlugin, {}])
167
168
  .add([analyticsPlugin, {}])
168
169
  .add(contentInsertionPlugin)
170
+ .add(decorationsPlugin)
169
171
  .add(widthPlugin)
170
172
  .add(gridPlugin)
171
173
  .add(tablePlugin)
@@ -32,6 +32,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
32
32
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
33
33
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
34
34
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
35
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
35
36
 
36
37
  const formatMessage: (t: { id: string }) => string = (message) =>
37
38
  `${message.id}`;
@@ -80,6 +81,7 @@ describe('getToolbarConfig', () => {
80
81
  .add([featureFlagsPlugin, {}])
81
82
  .add([analyticsPlugin, {}])
82
83
  .add(contentInsertionPlugin)
84
+ .add(decorationsPlugin)
83
85
  .add(widthPlugin)
84
86
  .add(dataConsumerPlugin)
85
87
  .add(extensionPlugin)
@@ -67,6 +67,7 @@ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
67
67
  import tablePlugin from '../../plugins/table-plugin';
68
68
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
69
69
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
70
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
70
71
 
71
72
  const TABLE_LOCAL_ID = 'test-table-local-id';
72
73
 
@@ -100,6 +101,7 @@ describe('table plugin', () => {
100
101
  .add([analyticsPlugin, {}])
101
102
  .add([deprecatedAnalyticsPlugin, {}])
102
103
  .add(contentInsertionPlugin)
104
+ .add(decorationsPlugin)
103
105
  .add(widthPlugin)
104
106
  .add(gridPlugin)
105
107
  .add([tablePlugin, { tableOptions }])
@@ -62,6 +62,7 @@ import { widthPlugin } from '@atlaskit/editor-plugin-width';
62
62
  import editorDisabledPlugin from '@atlaskit/editor-core/src/plugins/editor-disabled';
63
63
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
64
64
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
65
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
65
66
 
66
67
  const TABLE_LOCAL_ID = 'test-table-local-id';
67
68
 
@@ -89,6 +90,7 @@ describe('table keymap', () => {
89
90
  .add([analyticsPlugin, { createAnalyticsEvent }])
90
91
  .add([deprecatedAnalyticsPlugin, { createAnalyticsEvent }])
91
92
  .add(contentInsertionPlugin)
93
+ .add(decorationsPlugin)
92
94
  .add(widthPlugin)
93
95
  .add(gridPlugin)
94
96
  .add(selectionPlugin)
@@ -39,6 +39,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
39
39
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
40
40
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
41
41
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
42
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
42
43
 
43
44
  describe('table toolbar', () => {
44
45
  const tableOptions = {
@@ -53,6 +54,7 @@ describe('table toolbar', () => {
53
54
  .add([featureFlagsPlugin, {}])
54
55
  .add([analyticsPlugin, {}])
55
56
  .add(contentInsertionPlugin)
57
+ .add(decorationsPlugin)
56
58
  .add(widthPlugin)
57
59
  .add([tablePlugin, { tableOptions }])
58
60
  .add(expandPlugin)
@@ -25,6 +25,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
25
25
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
26
26
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
27
27
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
28
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
28
29
 
29
30
  describe('tables: main plugin with allowCollapse: true', () => {
30
31
  const createEditor = createProsemirrorEditorFactory();
@@ -35,6 +36,7 @@ describe('tables: main plugin with allowCollapse: true', () => {
35
36
  .add([featureFlagsPlugin, {}])
36
37
  .add([analyticsPlugin, {}])
37
38
  .add(contentInsertionPlugin)
39
+ .add(decorationsPlugin)
38
40
  .add(widthPlugin)
39
41
  .add(tablePlugin)
40
42
  .add(expandPlugin)
@@ -33,6 +33,7 @@ import {
33
33
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
34
34
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
35
35
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
36
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
36
37
 
37
38
  describe('table-resizing/event-handlers', () => {
38
39
  const editorAnalyticsAPIFake: EditorAnalyticsAPI = {
@@ -49,6 +50,7 @@ describe('table-resizing/event-handlers', () => {
49
50
  .add([featureFlagsPlugin, {}])
50
51
  .add([analyticsPlugin, {}])
51
52
  .add(contentInsertionPlugin)
53
+ .add(decorationsPlugin)
52
54
  .add([
53
55
  tablePlugin,
54
56
  {
@@ -31,6 +31,7 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
31
31
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
32
32
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
33
33
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
34
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
34
35
 
35
36
  const TABLE_LOCAL_ID = 'test-table-local-id';
36
37
  describe('table selection keymap', () => {
@@ -48,6 +49,7 @@ describe('table selection keymap', () => {
48
49
  .add([featureFlagsPlugin, {}])
49
50
  .add([analyticsPlugin, {}])
50
51
  .add(contentInsertionPlugin)
52
+ .add(decorationsPlugin)
51
53
  .add(selectionPlugin)
52
54
  .add([tablePlugin, { tableOptions: {}, editorSelectionAPI }])
53
55
  .add(panelPlugin)
@@ -21,6 +21,7 @@ import {
21
21
  import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
22
22
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
23
23
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
24
+ import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
24
25
 
25
26
  describe('collapse', () => {
26
27
  const createEditor = createProsemirrorEditorFactory();
@@ -32,7 +33,9 @@ describe('collapse', () => {
32
33
  .add(contentInsertionPlugin)
33
34
  .add(tablePlugin);
34
35
 
35
- const finalPreset = expandInPlugins ? preset.add(expandPlugin) : preset;
36
+ const finalPreset = expandInPlugins
37
+ ? preset.add(decorationsPlugin).add(expandPlugin)
38
+ : preset;
36
39
 
37
40
  return createEditor({ doc, preset: finalPreset });
38
41
  };
package/src/i18n/cs.ts CHANGED
@@ -16,9 +16,9 @@ export default {
16
16
  'fabric.editor.cornerControl': 'Zvýraznit tabulku',
17
17
  'fabric.editor.distributeColumns': 'Rozložení sloupců',
18
18
  'fabric.editor.extension.confirmDeleteLinkedModalMessagePrefix': 'Odstraňování',
19
- 'fabric.editor.extension.deleteElementTitle': 'Vymazat prvek',
19
+ 'fabric.editor.extension.deleteElementTitle': 'Odstranit prvek',
20
20
  'fabric.editor.extension.sourceNoTitledName': 'tento prvek',
21
- 'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': 'Vymazat také všechny připojené prvky',
21
+ 'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': 'Odstranit také všechny připojené prvky',
22
22
  'fabric.editor.headerColumn': 'Sloupec záhlaví',
23
23
  'fabric.editor.headerRow': 'Řádek záhlaví',
24
24
  'fabric.editor.insertColumn': 'Vložit sloupec napravo',
@@ -0,0 +1,41 @@
1
+ /* prettier-ignore */
2
+ /**
3
+ * NOTE:
4
+ *
5
+ * This file is automatically generated by Traduki 2.0.
6
+ * DO NOT CHANGE IT BY HAND or your changes will be lost.
7
+ */
8
+ //
9
+ export default {
10
+ 'fabric.editor.canNotSortTable': "⁣⁢⚠️ You can't sort a table with merged cells⁡⁡‌⁠⁠‌‍⁣⁤",
11
+ 'fabric.editor.cellBackground': '⁣⁢Cell background‌؜‍⁠‌⁠⁡‍‍؜‍⁣⁤',
12
+ 'fabric.editor.cellOptions': '⁣⁢Cell options؜؜⁠⁠‍⁡⁡⁣⁤',
13
+ 'fabric.editor.clearCells':
14
+ '{0, plural, one {⁣⁢Clear cell؜⁡‍؜‌⁠‍⁠‌؜‌‍⁠⁣⁤} other {⁣⁢Clear cells؜⁡‍؜‌⁠‍⁠‌؜‌‍⁠⁣⁤}}',
15
+ 'fabric.editor.collapseTable': '⁣⁢Collapse table‌؜⁡‍⁠⁡⁠‌؜‍‌⁡⁡⁣⁤',
16
+ 'fabric.editor.cornerControl': '⁣⁢Highlight table؜⁡؜⁠⁠⁠‌⁣⁤',
17
+ 'fabric.editor.distributeColumns': '⁣⁢Distribute columns؜‍‍⁡‍‌؜‍‍‌⁣⁤',
18
+ 'fabric.editor.extension.confirmDeleteLinkedModalMessagePrefix': '⁣⁢Deleting؜‌‌⁠⁠؜‍؜⁡‌؜‌‌‌‌‌⁣⁤',
19
+ 'fabric.editor.extension.deleteElementTitle': '⁣⁢Delete element؜‌⁠⁡‍‌⁠⁡‌؜؜؜‍⁣⁤',
20
+ 'fabric.editor.extension.sourceNoTitledName': '⁣⁢this element⁠⁠‍⁡‍؜⁠‌⁡؜⁡؜‍⁣⁤',
21
+ 'fabric.editor.floatingToolbar.confirmModalCheckboxLabel':
22
+ '⁣⁢Also delete connected elements‌⁡⁡‍‍⁡⁡⁠‌؜؜⁣⁤',
23
+ 'fabric.editor.headerColumn': '⁣⁢Header column⁡⁡‌؜‌‌⁠⁠⁠⁡⁣⁤',
24
+ 'fabric.editor.headerRow': '⁣⁢Header row‍‌⁠⁠⁡⁠⁡⁠⁠⁠‌⁣⁤',
25
+ 'fabric.editor.insertColumn': '⁣⁢Insert column right⁠‍⁡⁠⁠؜⁡⁠⁡‌‌⁣⁤',
26
+ 'fabric.editor.insertRow': '⁣⁢Insert row below⁡⁡⁠؜‌⁠⁡‌‍⁣⁤',
27
+ 'fabric.editor.mergeCells': '⁣⁢Merge cells⁠‌⁡‍⁡⁡⁡؜⁣⁤',
28
+ 'fabric.editor.numberedColumn': '⁣⁢Numbered column⁡؜؜⁡⁡‌؜؜‍‍‌‌‍⁡⁡⁣⁤',
29
+ 'fabric.editor.removeColumns':
30
+ '{0, plural, one {⁣⁢Delete column‌‍؜‌‌⁠؜⁡⁣⁤} other {⁣⁢Delete columns‌‍؜‌‌⁠؜⁡⁣⁤}}',
31
+ 'fabric.editor.removeRows':
32
+ '{0, plural, one {⁣⁢Delete row⁠‍‍‌‍⁠؜‌⁣⁤} other {⁣⁢Delete rows⁠‍‍‌‍⁠؜‌⁣⁤}}',
33
+ 'fabric.editor.rowControl': '⁣⁢Highlight row‍‌⁠⁡⁠؜‌⁠؜؜؜؜؜⁣⁤',
34
+ 'fabric.editor.sortColumnASC': '⁣⁢Sort column A → Z⁠؜‍⁠⁠‌‌⁡‌‍⁣⁤',
35
+ 'fabric.editor.sortColumnDESC': '⁣⁢Sort column Z → A؜⁡‌؜‌‌‍⁡‌‌‍‍‌‍؜؜⁡⁣⁤',
36
+ 'fabric.editor.splitCell': '⁣⁢Split cell⁠‌‍؜⁠⁠؜‍؜⁡؜‌‍⁣⁤',
37
+ 'fabric.editor.tableOptions': '⁣⁢Table options؜؜‍‌؜⁡؜⁠⁣⁤',
38
+ 'fabric.editor.tables.confirmDeleteLinkedModalMessage':
39
+ '⁣⁢Deleting {nodeName} will break anything connected to it.⁠⁡⁠‍‍⁠؜⁠⁡⁠⁣⁤',
40
+ 'fabric.editor.tables.confirmDeleteLinkedModalOKButton': '⁣⁢Delete؜⁡‍؜؜⁡⁠⁣⁤',
41
+ };
package/src/i18n/ja.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  //Japanese
9
9
  export default {
10
- 'fabric.editor.canNotSortTable': '⚠️ 統合したセルで表を並べ替えることはできません',
10
+ 'fabric.editor.canNotSortTable': '⚠️ 結合セルを含む表は並べ替えられません。',
11
11
  'fabric.editor.cellBackground': 'セルの背景',
12
12
  'fabric.editor.cellOptions': 'セルのオプション',
13
13
  'fabric.editor.clearCells': '{0, plural, other {セルをクリア}}',
@@ -22,13 +22,13 @@ export default {
22
22
  'fabric.editor.headerRow': 'ヘッダーの行',
23
23
  'fabric.editor.insertColumn': '列を右に挿入',
24
24
  'fabric.editor.insertRow': '行を下に挿入',
25
- 'fabric.editor.mergeCells': 'セルをマージ',
25
+ 'fabric.editor.mergeCells': 'セルを結合',
26
26
  'fabric.editor.numberedColumn': '番号付き列',
27
27
  'fabric.editor.removeColumns': '{0, plural, other {列を削除}}',
28
28
  'fabric.editor.removeRows': '{0, plural, other {行を削除}}',
29
29
  'fabric.editor.rowControl': '行をハイライト',
30
- 'fabric.editor.sortColumnASC': '列の並べ替え A → Z',
31
- 'fabric.editor.sortColumnDESC': '列の並べ替え Z → A',
30
+ 'fabric.editor.sortColumnASC': '列の並べ替え: 昇順',
31
+ 'fabric.editor.sortColumnDESC': '列の並べ替え: 降順',
32
32
  'fabric.editor.splitCell': 'セルを分割',
33
33
  'fabric.editor.tableOptions': '表のオプション',
34
34
  'fabric.editor.tables.confirmDeleteLinkedModalMessage':
package/src/i18n/ko.ts CHANGED
@@ -24,7 +24,7 @@ export default {
24
24
  'fabric.editor.numberedColumn': '번호 매기기 열',
25
25
  'fabric.editor.removeColumns': '{0, plural, other {열 삭제}}',
26
26
  'fabric.editor.removeRows': '{0, plural, other {행 삭제}}',
27
- 'fabric.editor.rowControl': '열 강조',
27
+ 'fabric.editor.rowControl': '열 강조 표시',
28
28
  'fabric.editor.sortColumnASC': '열 정렬: 오름차순',
29
29
  'fabric.editor.sortColumnDESC': '열 정렬: 내림차순',
30
30
  'fabric.editor.splitCell': '셀 나누기',
package/src/i18n/sv.ts CHANGED
@@ -10,7 +10,7 @@ export default {
10
10
  'fabric.editor.canNotSortTable': '⚠️ Du kan inte sortera en panelvy med sammanslagna celler',
11
11
  'fabric.editor.cellBackground': 'Cellbakgrund',
12
12
  'fabric.editor.cellOptions': 'Cellalternativ',
13
- 'fabric.editor.clearCells': '{0, plural, one {Rensa celler} other {Rensa celler}}',
13
+ 'fabric.editor.clearCells': '{0, plural, one {Rensa cell} other {Rensa celler}}',
14
14
  'fabric.editor.collapseTable': 'Dölj tabell',
15
15
  'fabric.editor.cornerControl': 'Markera tabellen',
16
16
  'fabric.editor.distributeColumns': 'Fördela kolumner',
package/src/i18n/vi.ts CHANGED
@@ -12,7 +12,7 @@ export default {
12
12
  'fabric.editor.cellOptions': 'Tùy chọn ô',
13
13
  'fabric.editor.clearCells': '{0, plural, other {Xóa ô}}',
14
14
  'fabric.editor.collapseTable': 'Thu gọn bảng',
15
- 'fabric.editor.cornerControl': 'Bảng nổi bật',
15
+ 'fabric.editor.cornerControl': 'Làm nổi bật bảng',
16
16
  'fabric.editor.distributeColumns': 'Phân phối cột',
17
17
  'fabric.editor.extension.deleteElementTitle': 'Xóa thành phần',
18
18
  'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': 'Đồng thời xóa các thành phần được kết nối',
@@ -24,7 +24,7 @@ export default {
24
24
  'fabric.editor.numberedColumn': 'Cột được đánh số',
25
25
  'fabric.editor.removeColumns': '{0, plural, other {Xóa cột}}',
26
26
  'fabric.editor.removeRows': '{0, plural, other {Xóa hàng}}',
27
- 'fabric.editor.rowControl': 'Hàng nổi bật',
27
+ 'fabric.editor.rowControl': 'Làm nổi bật hàng',
28
28
  'fabric.editor.sortColumnASC': 'Sắp xếp cột A → Z',
29
29
  'fabric.editor.sortColumnDESC': 'Sắp xếp cột Z → A',
30
30
  'fabric.editor.splitCell': 'Tách ô',
package/src/i18n/zh.ts CHANGED
@@ -18,8 +18,8 @@ export default {
18
18
  'fabric.editor.extension.deleteElementTitle': '删除元素',
19
19
  'fabric.editor.extension.sourceNoTitledName': '此元素',
20
20
  'fabric.editor.floatingToolbar.confirmModalCheckboxLabel': '同时删除已连接的元素',
21
- 'fabric.editor.headerColumn': '标头列',
22
- 'fabric.editor.headerRow': '表头行',
21
+ 'fabric.editor.headerColumn': '标题列',
22
+ 'fabric.editor.headerRow': '标题行',
23
23
  'fabric.editor.insertColumn': '在右侧插入列',
24
24
  'fabric.editor.insertRow': '在下方插入行',
25
25
  'fabric.editor.mergeCells': '合并单元格',
@@ -29,7 +29,7 @@ export default {
29
29
  'fabric.editor.rowControl': '突出显示行',
30
30
  'fabric.editor.sortColumnASC': '对列 A → Z 进行排序',
31
31
  'fabric.editor.sortColumnDESC': '对列 Z → A 进行排序',
32
- 'fabric.editor.splitCell': '分离单元格',
32
+ 'fabric.editor.splitCell': '拆分单元格',
33
33
  'fabric.editor.tableOptions': '表格选项',
34
34
  'fabric.editor.tables.confirmDeleteLinkedModalMessage': '删除 {nodeName} 将断开与其连接的所有内容。',
35
35
  'fabric.editor.tables.confirmDeleteLinkedModalOKButton': '删除',
@@ -289,6 +289,12 @@ export const getNewResizeStateFromSelectedColumns = (
289
289
  domAtPos: (pos: number) => { node: Node; offset: number },
290
290
  getEditorContainerWidth: GetEditorContainerWidth,
291
291
  ): ResizeStateWithAnalytics | undefined => {
292
+ // Fail early so that we don't do complex calculations for no reason
293
+ const numColumnsSelected = rect.right - rect.left;
294
+ if (numColumnsSelected <= 1) {
295
+ return;
296
+ }
297
+
292
298
  const { totalRowCount, totalColumnCount, table } = getSelectedTableInfo(
293
299
  state.selection,
294
300
  );
@@ -297,6 +303,11 @@ export const getNewResizeStateFromSelectedColumns = (
297
303
  return;
298
304
  }
299
305
 
306
+ // Fail early so that we don't do complex calculations for no reason
307
+ if (!hasTableBeenResized(table.node)) {
308
+ return;
309
+ }
310
+
300
311
  const maybeTable = domAtPos(table.start).node as HTMLElement;
301
312
  const tableRef = maybeTable.closest('table');
302
313
 
@@ -24,7 +24,7 @@ import { TableCssClassName as ClassName } from '../types';
24
24
 
25
25
  import {
26
26
  tableCellBackgroundColor,
27
- tableToolbarColor,
27
+ tableHeaderCellBackgroundColor,
28
28
  tableBorderColor,
29
29
  tableCellSelectedColor,
30
30
  tableToolbarSelectedColor,
@@ -481,7 +481,7 @@ export const tableStyles = (
481
481
  border: 1px solid ${tableBorderColor(props)};
482
482
  border-radius: 0;
483
483
  border-top-left-radius: ${tableBorderRadiusSize}px;
484
- background: ${tableToolbarColor(props)};
484
+ background: ${tableHeaderCellBackgroundColor(props)};
485
485
  box-sizing: border-box;
486
486
  padding: 0;
487
487
  :focus {
@@ -598,7 +598,7 @@ export const tableStyles = (
598
598
  padding: 10px 2px;
599
599
  text-align: center;
600
600
  font-size: ${relativeFontSizeToBase16(fontSize())};
601
- background-color: ${tableToolbarColor(props)};
601
+ background-color: ${tableHeaderCellBackgroundColor(props)};
602
602
  color: ${tableTextColor(props)};
603
603
  border-color: ${tableBorderColor(props)};
604
604
 
@@ -38,6 +38,10 @@ export const tableCellBackgroundColor = themed({
38
38
  light: token('elevation.surface', N0),
39
39
  dark: token('elevation.surface', DN30),
40
40
  });
41
+ export const tableHeaderCellBackgroundColor = themed({
42
+ light: token('color.background.neutral', akEditorTableToolbar),
43
+ dark: token('color.background.neutral', akEditorTableToolbarDark),
44
+ });
41
45
  export const tableToolbarColor = themed({
42
46
  light: token('color.background.neutral.subtle', akEditorTableToolbar),
43
47
  dark: token('color.background.neutral.subtle', akEditorTableToolbarDark),
@@ -47,8 +51,8 @@ export const tableTextColor = themed({
47
51
  dark: token('color.text.subtlest', DN400),
48
52
  });
49
53
  export const tableBorderColor = themed({
50
- light: token('color.border', akEditorTableBorder),
51
- dark: token('color.border', akEditorTableBorderDark),
54
+ light: token('color.background.accent.gray.subtler', akEditorTableBorder),
55
+ dark: token('color.background.accent.gray.subtler', akEditorTableBorderDark),
52
56
  });
53
57
  export const tableFloatingControlsColor = token(
54
58
  'color.background.neutral',
@@ -21,9 +21,9 @@ import {
21
21
  Y200,
22
22
  } from '@atlaskit/theme/colors';
23
23
  import {
24
- tableToolbarColor,
25
24
  tableBorderColor,
26
25
  tableToolbarSelectedColor,
26
+ tableHeaderCellBackgroundColor,
27
27
  tableBorderSelectedColor,
28
28
  tableCellDeleteColor,
29
29
  tableBorderDeleteColor,
@@ -95,7 +95,7 @@ const Button = (cssString?: string) => css`
95
95
 
96
96
  export const HeaderButton = (props: ThemeProps, cssString?: string) => css`
97
97
  .${ClassName.CONTROLS_BUTTON} {
98
- background: ${tableToolbarColor(props)};
98
+ background: ${tableHeaderCellBackgroundColor(props)};
99
99
  border: 1px solid ${tableBorderColor(props)};
100
100
  display: block;
101
101
  box-sizing: border-box;
@@ -297,7 +297,7 @@ export const OverflowShadow = (props: ThemeProps) => css`
297
297
  `;
298
298
 
299
299
  const columnHeaderButton = (props: ThemeProps, cssString?: string) => css`
300
- background: ${tableToolbarColor(props)};
300
+ background: ${tableHeaderCellBackgroundColor(props)};
301
301
  border: 1px solid ${tableBorderColor(props)};
302
302
  display: block;
303
303
  box-sizing: border-box;