@atlaskit/editor-plugin-table 7.17.0 → 7.17.2
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/CHANGELOG.md +28 -0
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/cjs/nodeviews/TableResizer.js +2 -0
- package/dist/cjs/plugin.js +2 -1
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/cjs/toolbar.js +3 -0
- package/dist/cjs/ui/DragHandle/index.js +4 -2
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/cjs/ui/FloatingContextualButton/index.js +5 -1
- package/dist/cjs/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +47 -22
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/cjs/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +36 -13
- package/dist/cjs/ui/FloatingDragMenu/index.js +5 -2
- package/dist/cjs/ui/FloatingDragMenu/styles.js +12 -1
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +4 -2
- package/dist/cjs/ui/common-styles.js +3 -1
- package/dist/cjs/ui/consts.js +4 -1
- package/dist/cjs/ui/ui-styles.js +35 -3
- package/dist/cjs/utils/drag-menu.js +32 -27
- package/dist/es2019/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/es2019/nodeviews/TableResizer.js +2 -0
- package/dist/es2019/plugin.js +34 -31
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +3 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/es2019/toolbar.js +3 -0
- package/dist/es2019/ui/DragHandle/index.js +6 -2
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/es2019/ui/FloatingContextualButton/index.js +5 -1
- package/dist/es2019/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +38 -11
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/es2019/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +34 -13
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -2
- package/dist/es2019/ui/FloatingDragMenu/styles.js +11 -3
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +6 -2
- package/dist/es2019/ui/common-styles.js +3 -1
- package/dist/es2019/ui/consts.js +3 -0
- package/dist/es2019/ui/ui-styles.js +36 -3
- package/dist/es2019/utils/drag-menu.js +23 -19
- package/dist/esm/nodeviews/ExternalDropTargets.js +2 -1
- package/dist/esm/nodeviews/TableResizer.js +2 -0
- package/dist/esm/plugin.js +2 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +3 -3
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +2 -1
- package/dist/esm/toolbar.js +3 -0
- package/dist/esm/ui/DragHandle/index.js +4 -2
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +1 -1
- package/dist/esm/ui/FloatingContextualButton/index.js +5 -1
- package/dist/esm/ui/FloatingContextualButton/styles.js +10 -0
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +47 -22
- package/dist/esm/ui/FloatingContextualMenu/styles.js +3 -0
- package/dist/esm/ui/FloatingDeleteButton/index.js +4 -2
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +36 -13
- package/dist/esm/ui/FloatingDragMenu/index.js +5 -2
- package/dist/esm/ui/FloatingDragMenu/styles.js +13 -2
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +3 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +1 -1
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +4 -2
- package/dist/esm/ui/common-styles.js +3 -1
- package/dist/esm/ui/consts.js +3 -0
- package/dist/esm/ui/ui-styles.js +35 -3
- package/dist/esm/utils/drag-menu.js +32 -27
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +8 -0
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +16 -0
- package/dist/types/ui/TableFloatingControls/index.d.ts +8 -0
- package/dist/types/ui/consts.d.ts +3 -0
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +16 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/consts.d.ts +3 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +136 -147
- package/src/nodeviews/ExternalDropTargets.tsx +2 -1
- package/src/nodeviews/TableResizer.tsx +3 -0
- package/src/plugin.tsx +3 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +9 -3
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +2 -1
- package/src/toolbar.tsx +3 -0
- package/src/ui/DragHandle/index.tsx +4 -2
- package/src/ui/FloatingContextualButton/FixedButton.tsx +1 -1
- package/src/ui/FloatingContextualButton/index.tsx +2 -0
- package/src/ui/FloatingContextualButton/styles.ts +10 -0
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +22 -3
- package/src/ui/FloatingContextualMenu/index.tsx +1 -0
- package/src/ui/FloatingContextualMenu/styles.ts +2 -0
- package/src/ui/FloatingDeleteButton/index.tsx +2 -1
- package/src/ui/FloatingDragMenu/DragMenu.tsx +39 -16
- package/src/ui/FloatingDragMenu/DropdownMenu.tsx +1 -1
- package/src/ui/FloatingDragMenu/index.tsx +6 -2
- package/src/ui/FloatingDragMenu/styles.ts +20 -3
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -0
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +1 -1
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +4 -2
- package/src/ui/common-styles.ts +2 -1
- package/src/ui/consts.ts +4 -0
- package/src/ui/ui-styles.ts +25 -0
- package/src/utils/drag-menu.ts +28 -18
package/package.json
CHANGED
|
@@ -1,148 +1,137 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"platform.editor.explicit-html-element-check": {
|
|
139
|
-
"type": "boolean"
|
|
140
|
-
},
|
|
141
|
-
"platform.editor.table.live-pages-sorting_4malx": {
|
|
142
|
-
"type": "boolean"
|
|
143
|
-
},
|
|
144
|
-
"platform.editor.table.editor-num-col-style-changes": {
|
|
145
|
-
"type": "boolean"
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
2
|
+
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
+
"version": "7.17.2",
|
|
4
|
+
"description": "Table plugin for the @atlaskit/editor",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
|
+
"author": "Atlassian Pty Ltd",
|
|
10
|
+
"main": "dist/cjs/index.js",
|
|
11
|
+
"module": "dist/esm/index.js",
|
|
12
|
+
"module:es2019": "dist/es2019/index.js",
|
|
13
|
+
"types": "dist/types/index.d.ts",
|
|
14
|
+
"typesVersions": {
|
|
15
|
+
">=4.5 <4.9": {
|
|
16
|
+
"*": ["dist/types-ts4.5/*", "dist/types-ts4.5/index.d.ts"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"atlaskit:src": "src/index.ts",
|
|
21
|
+
"atlassian": {
|
|
22
|
+
"team": "Editor: Jenga",
|
|
23
|
+
"singleton": true,
|
|
24
|
+
"releaseModel": "continuous",
|
|
25
|
+
"runReact18": false
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@atlaskit/adf-schema": "^36.10.7",
|
|
29
|
+
"@atlaskit/button": "^17.17.0",
|
|
30
|
+
"@atlaskit/custom-steps": "^0.2.0",
|
|
31
|
+
"@atlaskit/editor-common": "^82.6.0",
|
|
32
|
+
"@atlaskit/editor-palette": "1.6.0",
|
|
33
|
+
"@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
|
|
34
|
+
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
|
35
|
+
"@atlaskit/editor-plugin-content-insertion": "^1.2.0",
|
|
36
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^1.2.0",
|
|
37
|
+
"@atlaskit/editor-plugin-guideline": "^1.1.0",
|
|
38
|
+
"@atlaskit/editor-plugin-selection": "^1.2.0",
|
|
39
|
+
"@atlaskit/editor-plugin-width": "^1.1.0",
|
|
40
|
+
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
41
|
+
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
42
|
+
"@atlaskit/editor-tables": "^2.7.0",
|
|
43
|
+
"@atlaskit/icon": "^22.3.0",
|
|
44
|
+
"@atlaskit/menu": "^2.4.0",
|
|
45
|
+
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
46
|
+
"@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
|
|
47
|
+
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.3.0",
|
|
48
|
+
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
49
|
+
"@atlaskit/primitives": "^7.2.0",
|
|
50
|
+
"@atlaskit/theme": "^12.9.0",
|
|
51
|
+
"@atlaskit/toggle": "^13.1.0",
|
|
52
|
+
"@atlaskit/tokens": "^1.50.0",
|
|
53
|
+
"@atlaskit/tooltip": "^18.4.0",
|
|
54
|
+
"@babel/runtime": "^7.0.0",
|
|
55
|
+
"@emotion/react": "^11.7.1",
|
|
56
|
+
"classnames": "^2.2.5",
|
|
57
|
+
"lodash": "^4.17.21",
|
|
58
|
+
"memoize-one": "^6.0.0",
|
|
59
|
+
"raf-schd": "^4.0.3"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": "^16.8.0",
|
|
63
|
+
"react-dom": "^16.8.0",
|
|
64
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"typescript": "~5.4.2"
|
|
68
|
+
},
|
|
69
|
+
"af:exports": {
|
|
70
|
+
"./types": "./src/types.ts",
|
|
71
|
+
".": "./src/index.ts",
|
|
72
|
+
"./ui/common-styles": "./src/ui/common-styles.ts",
|
|
73
|
+
"./ui/consts": "./src/ui/consts.ts",
|
|
74
|
+
"./plugin-key": "./src/pm-plugins/plugin-key.ts",
|
|
75
|
+
"./commands": "./src/commands/index.ts"
|
|
76
|
+
},
|
|
77
|
+
"techstack": {
|
|
78
|
+
"@atlassian/frontend": {
|
|
79
|
+
"import-structure": ["atlassian-conventions"],
|
|
80
|
+
"circular-dependencies": ["file-and-folder-level"]
|
|
81
|
+
},
|
|
82
|
+
"@repo/internal": {
|
|
83
|
+
"design-tokens": ["color"],
|
|
84
|
+
"deprecation": "no-deprecated-imports",
|
|
85
|
+
"styling": ["emotion"]
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"stricter": {
|
|
89
|
+
"no-unused-dependencies": {
|
|
90
|
+
"checkDevDependencies": true
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"platform-feature-flags": {
|
|
94
|
+
"platform.editor.table.insert-last-column-btn-stays-in-place": {
|
|
95
|
+
"type": "boolean"
|
|
96
|
+
},
|
|
97
|
+
"platform.editor.table.drag-move-options-logic-update_fp7xw": {
|
|
98
|
+
"type": "boolean"
|
|
99
|
+
},
|
|
100
|
+
"platform.editor.a11y-table-resizing_uapcv": {
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
},
|
|
103
|
+
"platform.editor.a11y-column-resizing_emcvz": {
|
|
104
|
+
"type": "boolean"
|
|
105
|
+
},
|
|
106
|
+
"platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg": {
|
|
107
|
+
"type": "boolean"
|
|
108
|
+
},
|
|
109
|
+
"platform.editor.transform-slice-for-nested-expand": {
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"platform.editor.table.cmd-a-select-table": {
|
|
113
|
+
"type": "boolean"
|
|
114
|
+
},
|
|
115
|
+
"platform.editor.table.use-shared-state-hook": {
|
|
116
|
+
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
|
|
119
|
+
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"platform.editor.table.colum-resizing-improvements": {
|
|
122
|
+
"type": "boolean"
|
|
123
|
+
},
|
|
124
|
+
"platform.editor.table.use-increased-scaling-percent": {
|
|
125
|
+
"type": "boolean"
|
|
126
|
+
},
|
|
127
|
+
"platform.editor.explicit-html-element-check": {
|
|
128
|
+
"type": "boolean"
|
|
129
|
+
},
|
|
130
|
+
"platform.editor.table.live-pages-sorting_4malx": {
|
|
131
|
+
"type": "boolean"
|
|
132
|
+
},
|
|
133
|
+
"platform.editor.table.editor-num-col-style-changes": {
|
|
134
|
+
"type": "boolean"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -53,10 +53,11 @@ export const ExternalDropTargets = ({
|
|
|
53
53
|
overflow: 'hidden',
|
|
54
54
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
55
55
|
position: 'absolute',
|
|
56
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
56
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
57
57
|
top: `-${dropTargetExtendedWidth - tableMarginTop}px`,
|
|
58
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
59
59
|
pointerEvents: 'auto',
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
60
61
|
zIndex: `${dropTargetsZIndex}`,
|
|
61
62
|
}}
|
|
62
63
|
data-testid="table-floating-column-extended-drop-targets"
|
|
@@ -350,6 +350,8 @@ export const TableResizer = ({
|
|
|
350
350
|
tableLocalId: node.attrs.localId,
|
|
351
351
|
tableRef: tableRef,
|
|
352
352
|
});
|
|
353
|
+
tr.setMeta('is-resizer-resizing', true);
|
|
354
|
+
|
|
353
355
|
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
354
356
|
name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED,
|
|
355
357
|
});
|
|
@@ -507,6 +509,7 @@ export const TableResizer = ({
|
|
|
507
509
|
tableLocalId: '',
|
|
508
510
|
tableRef: null,
|
|
509
511
|
});
|
|
512
|
+
tr.setMeta('is-resizer-resizing', false);
|
|
510
513
|
const frameRateSamples = endMeasure();
|
|
511
514
|
|
|
512
515
|
if (frameRateSamples.length > 0) {
|
package/src/plugin.tsx
CHANGED
|
@@ -639,7 +639,9 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
639
639
|
title: formatMessage(messages.table),
|
|
640
640
|
description: formatMessage(messages.tableDescription),
|
|
641
641
|
keywords: ['cell', 'table'],
|
|
642
|
-
priority:
|
|
642
|
+
priority: options?.getEditorFeatureFlags?.().platformEditorTypeaheadImprovedRelevancy
|
|
643
|
+
? 800
|
|
644
|
+
: 600,
|
|
643
645
|
keyshortcut: tooltip(toggleTable),
|
|
644
646
|
icon: () => <IconTable />,
|
|
645
647
|
action(insert, state) {
|
|
@@ -17,7 +17,7 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
17
17
|
import { stopKeyboardColumnResizing } from '../../commands/column-resize';
|
|
18
18
|
import { updateResizeHandleDecorations } from '../../commands/misc';
|
|
19
19
|
import { updateColumnWidths } from '../../transforms';
|
|
20
|
-
import { getSelectedColumnIndexes } from '../../utils';
|
|
20
|
+
import { getSelectedColumnIndexes, isTableNested } from '../../utils';
|
|
21
21
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
22
22
|
import { META_KEYS } from '../table-analytics';
|
|
23
23
|
|
|
@@ -192,7 +192,10 @@ export const handleMouseDown = (
|
|
|
192
192
|
|
|
193
193
|
const resizedDelta = clientX - startX;
|
|
194
194
|
|
|
195
|
-
if (
|
|
195
|
+
if (
|
|
196
|
+
getBooleanFF('platform.editor.table.colum-resizing-improvements') &&
|
|
197
|
+
!isTableNested(state, tablePos)
|
|
198
|
+
) {
|
|
196
199
|
const newResizeState = resizeColumnAndTable(
|
|
197
200
|
resizeState,
|
|
198
201
|
colIndex,
|
|
@@ -297,7 +300,10 @@ export const handleMouseDown = (
|
|
|
297
300
|
shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
298
301
|
}
|
|
299
302
|
|
|
300
|
-
if (
|
|
303
|
+
if (
|
|
304
|
+
getBooleanFF('platform.editor.table.colum-resizing-improvements') &&
|
|
305
|
+
!isTableNested(state, tablePos)
|
|
306
|
+
) {
|
|
301
307
|
resizeColumnAndTable(
|
|
302
308
|
resizeState,
|
|
303
309
|
colIndex,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
|
|
4
4
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
5
|
+
import { ALIGN_START } from '../../../utils/alignment';
|
|
5
6
|
|
|
6
7
|
import { getTableContainerElementWidth, getTableScalingPercent } from './misc';
|
|
7
8
|
import { growColumn, shrinkColumn, updateAffectedColumn } from './resize-logic';
|
|
@@ -61,7 +62,7 @@ export const resizeColumnAndTable = (
|
|
|
61
62
|
const tableContainerWidth = tableRef.closest('.pm-table-container')?.clientWidth;
|
|
62
63
|
|
|
63
64
|
const isOverflowed = !!(tableWidth && tableContainerWidth && tableWidth > tableContainerWidth);
|
|
64
|
-
let resizeAmount = amount * 2;
|
|
65
|
+
let resizeAmount = tableNode.attrs.layout === ALIGN_START && !isOverflowed ? amount : amount * 2;
|
|
65
66
|
|
|
66
67
|
// todo: reimplement - use getTableScalingPercentFrozen to get scaled percent before table width changes dynamically
|
|
67
68
|
// let scalePercent = 1;
|
package/src/toolbar.tsx
CHANGED
|
@@ -224,6 +224,7 @@ export const getToolbarCellOptionsConfig = (
|
|
|
224
224
|
},
|
|
225
225
|
selected: false,
|
|
226
226
|
disabled: false,
|
|
227
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
227
228
|
elemAfter: <div css={shortcutStyle}>{tooltip(addColumnAfter)}</div>,
|
|
228
229
|
},
|
|
229
230
|
{
|
|
@@ -242,6 +243,7 @@ export const getToolbarCellOptionsConfig = (
|
|
|
242
243
|
},
|
|
243
244
|
selected: false,
|
|
244
245
|
disabled: false,
|
|
246
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
245
247
|
elemAfter: <div css={shortcutStyle}>{tooltip(addRowAfter)}</div>,
|
|
246
248
|
},
|
|
247
249
|
{
|
|
@@ -414,6 +416,7 @@ export const getToolbarCellOptionsConfig = (
|
|
|
414
416
|
},
|
|
415
417
|
selected: false,
|
|
416
418
|
disabled: false,
|
|
419
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
417
420
|
elemAfter: <div css={shortcutStyle}>{tooltip(backspace)}</div>,
|
|
418
421
|
});
|
|
419
422
|
|
|
@@ -199,11 +199,13 @@ const DragHandleComponent = ({
|
|
|
199
199
|
data-testid="table-drag-handle-clickable-zone-button"
|
|
200
200
|
style={{
|
|
201
201
|
height: isRow
|
|
202
|
-
?
|
|
202
|
+
? // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
203
|
+
`calc(100% - ${dragTableInsertColumnButtonSize}px)`
|
|
203
204
|
: `${token('space.200', '16px')}`, // 16px here because it's the size of drag handle button's large side
|
|
204
205
|
width: isRow
|
|
205
206
|
? `${token('space.200', '16px')}` // 16px here because it's the size of drag handle button's large side
|
|
206
|
-
:
|
|
207
|
+
: // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
208
|
+
`calc(100% - ${dragTableInsertColumnButtonSize}px)`,
|
|
207
209
|
left: isRow ? `${token('space.050', '4px')}` : undefined,
|
|
208
210
|
bottom: isColumn ? `${token('space.0', '0px')}` : undefined,
|
|
209
211
|
alignSelf: isColumn ? 'none' : 'center',
|
|
@@ -160,7 +160,7 @@ export const FixedButton = ({
|
|
|
160
160
|
position: 'fixed',
|
|
161
161
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
162
162
|
top: stickyHeader.top + stickyHeader.padding + offset * 2,
|
|
163
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
163
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
164
164
|
zIndex: akEditorTableCellOnStickyHeaderZIndex,
|
|
165
165
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
166
166
|
left: calcLeftPos({
|
|
@@ -77,7 +77,9 @@ const FloatingContextualButtonInner = React.memo((props: Props & WrappedComponen
|
|
|
77
77
|
const button = (
|
|
78
78
|
<div
|
|
79
79
|
css={[
|
|
80
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
80
81
|
tableFloatingCellButtonStyles(),
|
|
82
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
81
83
|
isContextualMenuOpen && tableFloatingCellButtonSelectedStyles(),
|
|
82
84
|
]}
|
|
83
85
|
>
|
|
@@ -7,14 +7,17 @@ import { contextualMenuTriggerSize } from '../consts';
|
|
|
7
7
|
|
|
8
8
|
export const tableFloatingCellButtonStyles = () =>
|
|
9
9
|
css({
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
10
11
|
'> div': {
|
|
11
12
|
// Sits behind button to provide surface-color background
|
|
12
13
|
background: token('elevation.surface', N20),
|
|
13
14
|
borderRadius: token('border.radius', '3px'),
|
|
14
15
|
display: 'flex',
|
|
16
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
15
17
|
height: `${contextualMenuTriggerSize + 2}px`,
|
|
16
18
|
flexDirection: 'column',
|
|
17
19
|
},
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
18
21
|
'&& button': {
|
|
19
22
|
background: token('color.background.neutral', 'none'),
|
|
20
23
|
flexDirection: 'column',
|
|
@@ -25,15 +28,19 @@ export const tableFloatingCellButtonStyles = () =>
|
|
|
25
28
|
height: 'calc(100% - 4px)',
|
|
26
29
|
display: 'flex',
|
|
27
30
|
},
|
|
31
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
28
32
|
'&& button:hover': {
|
|
29
33
|
background: token('color.background.neutral.hovered', N30A),
|
|
30
34
|
},
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
31
36
|
'&& button:active': {
|
|
32
37
|
background: token('color.background.neutral.pressed', 'rgba(179, 212, 255, 0.6)'),
|
|
33
38
|
},
|
|
39
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
34
40
|
'&& button > span': {
|
|
35
41
|
margin: `0px ${token('space.negative.050', '-4px')}`,
|
|
36
42
|
},
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
37
44
|
'&& span': {
|
|
38
45
|
pointerEvents: 'none',
|
|
39
46
|
},
|
|
@@ -41,12 +48,15 @@ export const tableFloatingCellButtonStyles = () =>
|
|
|
41
48
|
|
|
42
49
|
export const tableFloatingCellButtonSelectedStyles = () =>
|
|
43
50
|
css({
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
44
52
|
'&& button': {
|
|
45
53
|
background: token('color.background.selected', N700),
|
|
46
54
|
},
|
|
55
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
47
56
|
'&& button:hover': {
|
|
48
57
|
background: token('color.background.selected.hovered', N700),
|
|
49
58
|
},
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
50
60
|
'&& button:active': {
|
|
51
61
|
background: token('color.background.selected.pressed', N700),
|
|
52
62
|
},
|
|
@@ -169,6 +169,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
169
169
|
: formatMessage(messages.cellBackground),
|
|
170
170
|
value: { name: 'background' },
|
|
171
171
|
elemBefore: isDragAndDropEnabled ? (
|
|
172
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
172
173
|
<span css={elementBeforeIconStyles}>
|
|
173
174
|
<EditorBackgroundColorIcon
|
|
174
175
|
label={formatMessage(messages.backgroundColor)}
|
|
@@ -180,6 +181,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
180
181
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
181
182
|
<div className={DropdownMenuSharedCssClassName.SUBMENU}>
|
|
182
183
|
<div
|
|
184
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
183
185
|
css={cellColourPreviewStyles(background)}
|
|
184
186
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
185
187
|
className={
|
|
@@ -228,6 +230,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
228
230
|
value: { name: 'merge' },
|
|
229
231
|
isDisabled: !canMergeCells(state.tr),
|
|
230
232
|
elemBefore: isDragAndDropEnabled ? (
|
|
233
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
231
234
|
<span css={elementBeforeIconStyles}>
|
|
232
235
|
<MergeCellsIcon />
|
|
233
236
|
</span>
|
|
@@ -238,6 +241,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
238
241
|
value: { name: 'split' },
|
|
239
242
|
isDisabled: !splitCell(state),
|
|
240
243
|
elemBefore: isDragAndDropEnabled ? (
|
|
244
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
241
245
|
<span css={elementBeforeIconStyles}>
|
|
242
246
|
<SplitCellIcon />
|
|
243
247
|
</span>
|
|
@@ -260,8 +264,10 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
260
264
|
isDragAndDropEnabled ? messages.addColumnRight : messages.insertColumn,
|
|
261
265
|
),
|
|
262
266
|
value: { name: 'insert_column' },
|
|
267
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
263
268
|
elemAfter: <div css={shortcutStyle}>{tooltip(addColumnAfter)}</div>,
|
|
264
269
|
elemBefore: isDragAndDropEnabled ? (
|
|
270
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
265
271
|
<span css={elementBeforeIconStyles}>
|
|
266
272
|
<AddColRightIcon />
|
|
267
273
|
</span>
|
|
@@ -279,8 +285,10 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
279
285
|
return {
|
|
280
286
|
content: formatMessage(isDragAndDropEnabled ? messages.addRowBelow : messages.insertRow),
|
|
281
287
|
value: { name: 'insert_row' },
|
|
288
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
282
289
|
elemAfter: <div css={shortcutStyle}>{tooltip(addRowAfter)}</div>,
|
|
283
290
|
elemBefore: isDragAndDropEnabled ? (
|
|
291
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
284
292
|
<span css={elementBeforeIconStyles}>
|
|
285
293
|
<AddRowBelowIcon />
|
|
286
294
|
</span>
|
|
@@ -304,8 +312,10 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
304
312
|
0: Math.max(noOfColumns, noOfRows),
|
|
305
313
|
}),
|
|
306
314
|
value: { name: 'clear' },
|
|
315
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
307
316
|
elemAfter: <div css={shortcutStyle}>{tooltip(backspace)}</div>,
|
|
308
317
|
elemBefore: isDragAndDropEnabled ? (
|
|
318
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
309
319
|
<span css={elementBeforeIconStyles}>
|
|
310
320
|
<CrossCircleIcon
|
|
311
321
|
label={formatMessage(messages.clearCells, {
|
|
@@ -334,6 +344,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
334
344
|
}),
|
|
335
345
|
value: { name: 'delete_column' },
|
|
336
346
|
elemBefore: isDragAndDropEnabled ? (
|
|
347
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
337
348
|
<span css={elementBeforeIconStyles}>
|
|
338
349
|
<RemoveIcon
|
|
339
350
|
label={formatMessage(messages.removeColumns, {
|
|
@@ -362,6 +373,7 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
362
373
|
}),
|
|
363
374
|
value: { name: 'delete_row' },
|
|
364
375
|
elemBefore: isDragAndDropEnabled ? (
|
|
376
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
365
377
|
<span css={elementBeforeIconStyles}>
|
|
366
378
|
<RemoveIcon
|
|
367
379
|
label={formatMessage(messages.removeRows, {
|
|
@@ -447,7 +459,16 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
447
459
|
|
|
448
460
|
private createOriginalContextMenuItems = () => {
|
|
449
461
|
let items: MenuItem[] = [];
|
|
462
|
+
const { getEditorFeatureFlags } = this.props;
|
|
463
|
+
const { tableSortColumnDiscoverability = false } = getEditorFeatureFlags
|
|
464
|
+
? getEditorFeatureFlags()
|
|
465
|
+
: {};
|
|
466
|
+
const sortColumnItems = this.createSortColumnItems();
|
|
450
467
|
const backgroundColorItem = this.createBackgroundColorItem();
|
|
468
|
+
const distributeColumnsItem = this.createDistributeColumnsItem();
|
|
469
|
+
|
|
470
|
+
tableSortColumnDiscoverability && sortColumnItems && items.push(...sortColumnItems);
|
|
471
|
+
|
|
451
472
|
backgroundColorItem && items.push(backgroundColorItem);
|
|
452
473
|
|
|
453
474
|
items.push(this.createInsertColumnItem());
|
|
@@ -460,11 +481,9 @@ export class ContextualMenu extends Component<Props & WrappedComponentProps, Sta
|
|
|
460
481
|
|
|
461
482
|
items.push(...this.createMergeSplitCellItems());
|
|
462
483
|
|
|
463
|
-
const distributeColumnsItem = this.createDistributeColumnsItem();
|
|
464
484
|
distributeColumnsItem && items.push(distributeColumnsItem);
|
|
465
485
|
|
|
466
|
-
|
|
467
|
-
sortColumnItems && items.push(...sortColumnItems);
|
|
486
|
+
!tableSortColumnDiscoverability && sortColumnItems && items.push(...sortColumnItems);
|
|
468
487
|
|
|
469
488
|
items.push(this.createClearCellsItem());
|
|
470
489
|
|
|
@@ -92,6 +92,7 @@ const FloatingContextualMenu = ({
|
|
|
92
92
|
offset={[-7, 0]}
|
|
93
93
|
stick={true}
|
|
94
94
|
>
|
|
95
|
+
{/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */}
|
|
95
96
|
<div css={tablePopupStyles(isDragAndDropEnabled)}>
|
|
96
97
|
<ContextualMenu
|
|
97
98
|
editorView={editorView}
|
|
@@ -10,10 +10,12 @@ import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD } from '../
|
|
|
10
10
|
export const cellColourPreviewStyles = (selectedColor: string) =>
|
|
11
11
|
css({
|
|
12
12
|
'&::before': {
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
13
14
|
background: selectedColor,
|
|
14
15
|
},
|
|
15
16
|
});
|
|
16
17
|
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
17
19
|
export const elementBeforeIconStyles = css({
|
|
18
20
|
marginRight: token('space.negative.075', '-6px'),
|
|
19
21
|
display: 'flex',
|