@atlaskit/editor-plugin-table 7.31.1 → 7.31.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.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/commands/insert.js +16 -19
- package/dist/cjs/commands-with-analytics.js +5 -7
- package/dist/cjs/plugin.js +2 -3
- package/dist/cjs/pm-plugins/keymap.js +9 -10
- package/dist/cjs/toolbar.js +9 -12
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +12 -19
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +8 -12
- package/dist/cjs/ui/FloatingDragMenu/index.js +3 -8
- package/dist/cjs/ui/FloatingDragMenu/styles.js +1 -2
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -7
- package/dist/cjs/utils/drag-menu.js +7 -9
- package/dist/es2019/commands/insert.js +10 -10
- package/dist/es2019/commands-with-analytics.js +4 -4
- package/dist/es2019/plugin.js +2 -3
- package/dist/es2019/pm-plugins/keymap.js +5 -5
- package/dist/es2019/toolbar.js +5 -6
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -11
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +8 -10
- package/dist/es2019/ui/FloatingDragMenu/index.js +3 -6
- package/dist/es2019/ui/FloatingDragMenu/styles.js +2 -2
- package/dist/es2019/ui/FloatingInsertButton/index.js +3 -6
- package/dist/es2019/utils/drag-menu.js +4 -4
- package/dist/esm/commands/insert.js +16 -19
- package/dist/esm/commands-with-analytics.js +5 -7
- package/dist/esm/plugin.js +2 -3
- package/dist/esm/pm-plugins/keymap.js +9 -10
- package/dist/esm/toolbar.js +9 -12
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +12 -19
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +8 -12
- package/dist/esm/ui/FloatingDragMenu/index.js +3 -8
- package/dist/esm/ui/FloatingDragMenu/styles.js +1 -2
- package/dist/esm/ui/FloatingInsertButton/index.js +3 -7
- package/dist/esm/utils/drag-menu.js +7 -9
- package/dist/types/commands/insert.d.ts +5 -5
- package/dist/types/commands-with-analytics.d.ts +3 -4
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/toolbar.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +0 -2
- package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/commands/insert.d.ts +5 -5
- package/dist/types-ts4.5/commands-with-analytics.d.ts +3 -4
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +0 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +3 -3
- package/src/commands/insert.ts +3 -10
- package/src/commands-with-analytics.ts +7 -8
- package/src/plugin.tsx +0 -4
- package/src/pm-plugins/keymap.ts +0 -5
- package/src/toolbar.tsx +0 -8
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +8 -15
- package/src/ui/FloatingDragMenu/DragMenu.tsx +5 -17
- package/src/ui/FloatingDragMenu/index.tsx +1 -7
- package/src/ui/FloatingDragMenu/styles.ts +4 -6
- package/src/ui/FloatingInsertButton/index.tsx +5 -10
- package/src/utils/drag-menu.ts +5 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.31.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#165001](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165001)
|
|
8
|
+
[`d77bdbfe892ed`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d77bdbfe892ed) -
|
|
9
|
+
tidy table duplicate cell color experiment
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 7.31.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#164992](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/164992)
|
|
17
|
+
[`16878c96150af`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/16878c96150af) -
|
|
18
|
+
tidy table sort order experiment
|
|
19
|
+
|
|
3
20
|
## 7.31.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -30,10 +30,9 @@ function addColumnAtCustomStep(column) {
|
|
|
30
30
|
}
|
|
31
31
|
function addColumnAt(api) {
|
|
32
32
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
var
|
|
36
|
-
var isCommentEditor = arguments.length > 5 ? arguments[5] : undefined;
|
|
33
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
|
|
34
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 3 ? arguments[3] : undefined;
|
|
35
|
+
var isCommentEditor = arguments.length > 4 ? arguments[4] : undefined;
|
|
37
36
|
return function (column) {
|
|
38
37
|
var allowAddColumnCustomStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
39
38
|
var view = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -42,7 +41,7 @@ function addColumnAt(api) {
|
|
|
42
41
|
if (allowAddColumnCustomStep) {
|
|
43
42
|
updatedTr = addColumnAtCustomStep(column)(updatedTr);
|
|
44
43
|
} else {
|
|
45
|
-
updatedTr = (0, _utils2.addColumnAt)(column
|
|
44
|
+
updatedTr = (0, _utils2.addColumnAt)(column)(updatedTr);
|
|
46
45
|
}
|
|
47
46
|
var table = (0, _utils2.findTable)(updatedTr.selection);
|
|
48
47
|
if (table) {
|
|
@@ -66,10 +65,9 @@ function addColumnAt(api) {
|
|
|
66
65
|
// Command to add a column before the column with the selection.
|
|
67
66
|
var addColumnBefore = exports.addColumnBefore = function addColumnBefore(api) {
|
|
68
67
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
69
|
-
var
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
var isCommentEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
68
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
69
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
70
|
+
var isCommentEditor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
73
71
|
return function (state, dispatch, view) {
|
|
74
72
|
var table = (0, _utils2.findTable)(state.selection);
|
|
75
73
|
if (!table) {
|
|
@@ -77,7 +75,7 @@ var addColumnBefore = exports.addColumnBefore = function addColumnBefore(api) {
|
|
|
77
75
|
}
|
|
78
76
|
if (dispatch) {
|
|
79
77
|
var rect = (0, _utils2.selectedRect)(state);
|
|
80
|
-
dispatch(addColumnAt(api, isTableScalingEnabled,
|
|
78
|
+
dispatch(addColumnAt(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(rect.left, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
81
79
|
}
|
|
82
80
|
return true;
|
|
83
81
|
};
|
|
@@ -85,7 +83,7 @@ var addColumnBefore = exports.addColumnBefore = function addColumnBefore(api) {
|
|
|
85
83
|
|
|
86
84
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
87
85
|
// Command to add a column after the column with the selection.
|
|
88
|
-
var addColumnAfter = exports.addColumnAfter = function addColumnAfter(api, isTableScalingEnabled,
|
|
86
|
+
var addColumnAfter = exports.addColumnAfter = function addColumnAfter(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor) {
|
|
89
87
|
return function (state, dispatch, view) {
|
|
90
88
|
var table = (0, _utils2.findTable)(state.selection);
|
|
91
89
|
if (!table) {
|
|
@@ -93,20 +91,19 @@ var addColumnAfter = exports.addColumnAfter = function addColumnAfter(api, isTab
|
|
|
93
91
|
}
|
|
94
92
|
if (dispatch) {
|
|
95
93
|
var rect = (0, _utils2.selectedRect)(state);
|
|
96
|
-
dispatch(addColumnAt(api, isTableScalingEnabled,
|
|
94
|
+
dispatch(addColumnAt(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(rect.right, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
97
95
|
}
|
|
98
96
|
return true;
|
|
99
97
|
};
|
|
100
98
|
};
|
|
101
99
|
var insertColumn = exports.insertColumn = function insertColumn(api) {
|
|
102
100
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
103
|
-
var
|
|
104
|
-
var
|
|
105
|
-
var
|
|
106
|
-
var isCommentEditor = arguments.length > 5 ? arguments[5] : undefined;
|
|
101
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
|
|
102
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 3 ? arguments[3] : undefined;
|
|
103
|
+
var isCommentEditor = arguments.length > 4 ? arguments[4] : undefined;
|
|
107
104
|
return function (column) {
|
|
108
105
|
return function (state, dispatch, view) {
|
|
109
|
-
var tr = addColumnAt(api, isTableScalingEnabled,
|
|
106
|
+
var tr = addColumnAt(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(column, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr);
|
|
110
107
|
var table = (0, _utils2.findTable)(tr.selection);
|
|
111
108
|
if (!table) {
|
|
112
109
|
return false;
|
|
@@ -120,7 +117,7 @@ var insertColumn = exports.insertColumn = function insertColumn(api) {
|
|
|
120
117
|
};
|
|
121
118
|
};
|
|
122
119
|
};
|
|
123
|
-
var insertRow = exports.insertRow = function insertRow(row, moveCursorToTheNewRow
|
|
120
|
+
var insertRow = exports.insertRow = function insertRow(row, moveCursorToTheNewRow) {
|
|
124
121
|
return function (state, dispatch) {
|
|
125
122
|
// Don't clone the header row
|
|
126
123
|
var headerRowEnabled = (0, _utils3.checkIfHeaderRowEnabled)(state.selection);
|
|
@@ -131,7 +128,7 @@ var insertRow = exports.insertRow = function insertRow(row, moveCursorToTheNewRo
|
|
|
131
128
|
if (row === 0 && headerRowEnabled) {
|
|
132
129
|
return false;
|
|
133
130
|
}
|
|
134
|
-
var tr = clonePreviousRow ? (0, _utils3.copyPreviousRow)(state.schema)(row)(state.tr) : (0, _utils2.addRowAt)(row, undefined
|
|
131
|
+
var tr = clonePreviousRow ? (0, _utils3.copyPreviousRow)(state.schema)(row)(state.tr) : (0, _utils2.addRowAt)(row, undefined)(state.tr);
|
|
135
132
|
var table = (0, _utils2.findTable)(tr.selection);
|
|
136
133
|
if (!table) {
|
|
137
134
|
return false;
|
|
@@ -167,7 +167,6 @@ var addRowAroundSelection = exports.addRowAroundSelection = function addRowAroun
|
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
169
|
var insertRowWithAnalytics = exports.insertRowWithAnalytics = function insertRowWithAnalytics(editorAnalyticsAPI) {
|
|
170
|
-
var isCellbackgroundDuplicated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
171
170
|
return function (inputMethod, options) {
|
|
172
171
|
return (0, _analytics2.withEditorAnalyticsAPI)(function (state) {
|
|
173
172
|
var _getSelectedTableInfo = (0, _utils2.getSelectedTableInfo)(state.selection),
|
|
@@ -185,7 +184,7 @@ var insertRowWithAnalytics = exports.insertRowWithAnalytics = function insertRow
|
|
|
185
184
|
},
|
|
186
185
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
187
186
|
};
|
|
188
|
-
})(editorAnalyticsAPI)((0, _insert.insertRow)(options.index, options.moveCursorToInsertedRow
|
|
187
|
+
})(editorAnalyticsAPI)((0, _insert.insertRow)(options.index, options.moveCursorToInsertedRow));
|
|
189
188
|
};
|
|
190
189
|
};
|
|
191
190
|
var changeColumnWidthByStepWithAnalytics = exports.changeColumnWidthByStepWithAnalytics = function changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api) {
|
|
@@ -225,10 +224,9 @@ var changeColumnWidthByStepWithAnalytics = exports.changeColumnWidthByStepWithAn
|
|
|
225
224
|
};
|
|
226
225
|
var insertColumnWithAnalytics = exports.insertColumnWithAnalytics = function insertColumnWithAnalytics(api, editorAnalyticsAPI) {
|
|
227
226
|
var isTableScalingEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
228
|
-
var
|
|
229
|
-
var
|
|
230
|
-
var
|
|
231
|
-
var isCommentEditor = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
227
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
228
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
229
|
+
var isCommentEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
232
230
|
return function (inputMethod, position) {
|
|
233
231
|
return (0, _analytics2.withEditorAnalyticsAPI)(function (state) {
|
|
234
232
|
var _getSelectedTableInfo3 = (0, _utils2.getSelectedTableInfo)(state.selection),
|
|
@@ -246,7 +244,7 @@ var insertColumnWithAnalytics = exports.insertColumnWithAnalytics = function ins
|
|
|
246
244
|
},
|
|
247
245
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
248
246
|
};
|
|
249
|
-
})(editorAnalyticsAPI)((0, _insert.insertColumn)(api, isTableScalingEnabled,
|
|
247
|
+
})(editorAnalyticsAPI)((0, _insert.insertColumn)(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(position));
|
|
250
248
|
};
|
|
251
249
|
};
|
|
252
250
|
var deleteRowsWithAnalytics = exports.deleteRowsWithAnalytics = function deleteRowsWithAnalytics(editorAnalyticsAPI) {
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -66,7 +66,7 @@ var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
|
66
66
|
* from `@atlaskit/editor-core`.
|
|
67
67
|
*/
|
|
68
68
|
var tablesPlugin = function tablesPlugin(_ref) {
|
|
69
|
-
var _api$analytics, _api$accessibilityUti, _options$getEditorFea,
|
|
69
|
+
var _api$analytics, _api$accessibilityUti, _options$getEditorFea, _api$analytics2;
|
|
70
70
|
var options = _ref.config,
|
|
71
71
|
api = _ref.api;
|
|
72
72
|
var editorViewRef = {
|
|
@@ -83,7 +83,6 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
83
83
|
var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
84
84
|
var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && (isTableFixedColumnWidthsOptionEnabled || ( // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
|
|
85
85
|
options === null || options === void 0 ? void 0 : options.isCommentEditor));
|
|
86
|
-
var isCellBackgroundDuplicated = (options === null || options === void 0 || (_options$getEditorFea2 = options.getEditorFeatureFlags) === null || _options$getEditorFea2 === void 0 ? void 0 : _options$getEditorFea2.call(options).tableDuplicateCellColouring) || false;
|
|
87
86
|
return {
|
|
88
87
|
name: 'table',
|
|
89
88
|
// Use getSharedState to store fullWidthEnabled and wasFullWidthModeEnabled to guarantee access
|
|
@@ -269,7 +268,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
269
268
|
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
270
269
|
_ref7$tableResizingEn = _ref7.tableResizingEnabled,
|
|
271
270
|
tableResizingEnabled = _ref7$tableResizingEn === void 0 ? false : _ref7$tableResizingEn;
|
|
272
|
-
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl,
|
|
271
|
+
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
273
272
|
}
|
|
274
273
|
}, {
|
|
275
274
|
name: 'tableSelectionKeymap',
|
|
@@ -21,12 +21,11 @@ function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, e
|
|
|
21
21
|
var isFullWidthEnabled = arguments.length > 7 ? arguments[7] : undefined;
|
|
22
22
|
var pluginInjectionApi = arguments.length > 8 ? arguments[8] : undefined;
|
|
23
23
|
var getIntl = arguments.length > 9 ? arguments[9] : undefined;
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var isTableResizingEnabled = arguments.length > 15 ? arguments[15] : undefined;
|
|
24
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
25
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 11 ? arguments[11] : undefined;
|
|
26
|
+
var isCommentEditor = arguments.length > 12 ? arguments[12] : undefined;
|
|
27
|
+
var isChromelessEditor = arguments.length > 13 ? arguments[13] : undefined;
|
|
28
|
+
var isTableResizingEnabled = arguments.length > 14 ? arguments[14] : undefined;
|
|
30
29
|
var list = {};
|
|
31
30
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
32
31
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.nextCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
@@ -38,12 +37,12 @@ function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, e
|
|
|
38
37
|
// Add row/column shortcuts
|
|
39
38
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowBefore.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('TOP'), list);
|
|
40
39
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowAfter.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
41
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBefore.common, (0, _insert.addColumnBefore)(api, isTableScalingEnabled,
|
|
42
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(api, isTableScalingEnabled,
|
|
40
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBefore.common, (0, _insert.addColumnBefore)(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
41
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
43
42
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowBeforeVO.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('TOP'), list);
|
|
44
43
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowAfterVO.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
45
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBeforeVO.common, (0, _insert.addColumnBefore)(api, isTableScalingEnabled,
|
|
46
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfterVO.common, (0, _insert.addColumnAfter)(api, isTableScalingEnabled,
|
|
44
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBeforeVO.common, (0, _insert.addColumnBefore)(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
45
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfterVO.common, (0, _insert.addColumnAfter)(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent), list);
|
|
47
46
|
if (dragAndDropEnabled) {
|
|
48
47
|
// Move row/column shortcuts
|
|
49
48
|
/**
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -143,10 +143,9 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
|
|
|
143
143
|
var _pluginState$pluginCo, _pluginState$pluginCo2;
|
|
144
144
|
var formatMessage = _ref2.formatMessage;
|
|
145
145
|
var isTableScalingEnabled = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
146
|
-
var
|
|
147
|
-
var
|
|
148
|
-
var
|
|
149
|
-
var isCommentEditor = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
|
|
146
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
147
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
148
|
+
var isCommentEditor = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
150
149
|
var top = initialSelectionRect.top,
|
|
151
150
|
bottom = initialSelectionRect.bottom,
|
|
152
151
|
right = initialSelectionRect.right,
|
|
@@ -161,7 +160,7 @@ var getToolbarCellOptionsConfig = exports.getToolbarCellOptionsConfig = function
|
|
|
161
160
|
var selectionRect = getClosestSelectionRect(state);
|
|
162
161
|
var index = selectionRect === null || selectionRect === void 0 ? void 0 : selectionRect.right;
|
|
163
162
|
if (index) {
|
|
164
|
-
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(api, editorAnalyticsAPI, isTableScalingEnabled,
|
|
163
|
+
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(_analytics.INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
|
|
165
164
|
}
|
|
166
165
|
return true;
|
|
167
166
|
},
|
|
@@ -389,8 +388,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
|
|
|
389
388
|
};
|
|
390
389
|
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
|
|
391
390
|
var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor) : [];
|
|
392
|
-
var
|
|
393
|
-
var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.isCommentEditor);
|
|
391
|
+
var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, options === null || options === void 0 ? void 0 : options.isCommentEditor);
|
|
394
392
|
var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, options === null || options === void 0 ? void 0 : options.isCommentEditor) : [];
|
|
395
393
|
var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, getEditorView);
|
|
396
394
|
|
|
@@ -477,15 +475,14 @@ var separator = function separator(hidden) {
|
|
|
477
475
|
var getCellItems = function getCellItems(state, view, _ref3, getEditorContainerWidth, api, editorAnalyticsAPI) {
|
|
478
476
|
var formatMessage = _ref3.formatMessage;
|
|
479
477
|
var isTableScalingEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
480
|
-
var
|
|
481
|
-
var
|
|
482
|
-
var
|
|
483
|
-
var isCommentEditor = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
478
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
479
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
|
|
480
|
+
var isCommentEditor = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
|
|
484
481
|
var initialSelectionRect = getClosestSelectionRect(state);
|
|
485
482
|
if (initialSelectionRect) {
|
|
486
483
|
var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
|
|
487
484
|
formatMessage: formatMessage
|
|
488
|
-
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled,
|
|
485
|
+
}, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor);
|
|
489
486
|
return [cellOptions, separator(cellOptions.hidden)];
|
|
490
487
|
}
|
|
491
488
|
return [];
|
|
@@ -423,14 +423,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
423
423
|
});
|
|
424
424
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createOriginalContextMenuItems", function () {
|
|
425
425
|
var items = [];
|
|
426
|
-
var getEditorFeatureFlags = _this.props.getEditorFeatureFlags;
|
|
427
|
-
var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
428
|
-
_ref2$tableSortColumn = _ref2.tableSortColumnReorder,
|
|
429
|
-
tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
|
|
430
426
|
var sortColumnItems = _this.createSortColumnItems();
|
|
431
427
|
var backgroundColorItem = _this.createBackgroundColorItem();
|
|
432
428
|
var distributeColumnsItem = _this.createDistributeColumnsItem();
|
|
433
|
-
|
|
429
|
+
sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
|
|
434
430
|
backgroundColorItem && items.push(backgroundColorItem);
|
|
435
431
|
items.push(_this.createInsertColumnItem());
|
|
436
432
|
items.push(_this.createInsertRowItem());
|
|
@@ -438,7 +434,6 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
438
434
|
items.push(_this.createDeleteRowItem());
|
|
439
435
|
items.push.apply(items, (0, _toConsumableArray2.default)(_this.createMergeSplitCellItems()));
|
|
440
436
|
distributeColumnsItem && items.push(distributeColumnsItem);
|
|
441
|
-
!tableSortColumnReorder && sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
|
|
442
437
|
items.push(_this.createClearCellsItem());
|
|
443
438
|
return [{
|
|
444
439
|
items: items
|
|
@@ -469,8 +464,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
469
464
|
items[1].items.push(deleteRowItem);
|
|
470
465
|
return items;
|
|
471
466
|
});
|
|
472
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMenuItemActivated", function (
|
|
473
|
-
var item =
|
|
467
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMenuItemActivated", function (_ref2) {
|
|
468
|
+
var item = _ref2.item;
|
|
474
469
|
var _this$props10 = _this.props,
|
|
475
470
|
editorView = _this$props10.editorView,
|
|
476
471
|
selectionRect = _this$props10.selectionRect,
|
|
@@ -486,11 +481,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
486
481
|
targetCellPosition = _getPluginState11.targetCellPosition,
|
|
487
482
|
_getPluginState11$isT = _getPluginState11.isTableScalingEnabled,
|
|
488
483
|
isTableScalingEnabled = _getPluginState11$isT === void 0 ? false : _getPluginState11$isT;
|
|
489
|
-
var
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
_ref4$tableWithFixedC = _ref4.tableWithFixedColumnWidthsOption,
|
|
493
|
-
tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
|
|
484
|
+
var _ref3 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
485
|
+
_ref3$tableWithFixedC = _ref3.tableWithFixedColumnWidthsOption,
|
|
486
|
+
tableWithFixedColumnWidthsOption = _ref3$tableWithFixedC === void 0 ? false : _ref3$tableWithFixedC;
|
|
494
487
|
// context menu opened by keyboard and any item except 'background' activated
|
|
495
488
|
// or color has been chosen from color palette
|
|
496
489
|
if (isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen)) {
|
|
@@ -536,11 +529,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
536
529
|
_this.toggleOpen();
|
|
537
530
|
break;
|
|
538
531
|
case 'insert_column':
|
|
539
|
-
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(_this.props.api, editorAnalyticsAPI, isTableScalingEnabled,
|
|
532
|
+
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(_this.props.api, editorAnalyticsAPI, isTableScalingEnabled, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent, isCommentEditor)(_analytics.INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
|
|
540
533
|
_this.toggleOpen();
|
|
541
534
|
break;
|
|
542
535
|
case 'insert_row':
|
|
543
|
-
(0, _commandsWithAnalytics.insertRowWithAnalytics)(editorAnalyticsAPI
|
|
536
|
+
(0, _commandsWithAnalytics.insertRowWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, {
|
|
544
537
|
index: selectionRect.bottom,
|
|
545
538
|
moveCursorToInsertedRow: true
|
|
546
539
|
})(state, dispatch);
|
|
@@ -619,8 +612,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
619
612
|
}
|
|
620
613
|
}
|
|
621
614
|
});
|
|
622
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (
|
|
623
|
-
var item =
|
|
615
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (_ref4) {
|
|
616
|
+
var item = _ref4.item;
|
|
624
617
|
var _this$props13 = _this.props,
|
|
625
618
|
_this$props13$editorV = _this$props13.editorView,
|
|
626
619
|
state = _this$props13$editorV.state,
|
|
@@ -643,8 +636,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
643
636
|
(0, _commands.hoverMergedCells)()(state, dispatch);
|
|
644
637
|
}
|
|
645
638
|
});
|
|
646
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseLeave", function (
|
|
647
|
-
var item =
|
|
639
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseLeave", function (_ref5) {
|
|
640
|
+
var item = _ref5.item;
|
|
648
641
|
var _this$props$editorVie = _this.props.editorView,
|
|
649
642
|
state = _this$props$editorVie.state,
|
|
650
643
|
dispatch = _this$props$editorVie.dispatch;
|
|
@@ -105,20 +105,18 @@ var MapDragMenuOptionIdToMessage = {
|
|
|
105
105
|
plural: null
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
var getGroupedDragMenuConfig = function getGroupedDragMenuConfig(
|
|
108
|
+
var getGroupedDragMenuConfig = function getGroupedDragMenuConfig() {
|
|
109
109
|
var groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down']];
|
|
110
110
|
var sortColumnItems = ['sort_column_asc', 'sort_column_desc'];
|
|
111
|
-
|
|
111
|
+
groupedDragMenuConfig.unshift(sortColumnItems);
|
|
112
112
|
return groupedDragMenuConfig;
|
|
113
113
|
};
|
|
114
114
|
var elementBeforeIconStyles = (0, _primitives.xcss)({
|
|
115
115
|
marginRight: 'space.negative.075',
|
|
116
116
|
display: 'flex'
|
|
117
117
|
});
|
|
118
|
-
var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage) {
|
|
119
|
-
var
|
|
120
|
-
var selectionRect = arguments.length > 3 ? arguments[3] : undefined;
|
|
121
|
-
var groupedDragMenuConfig = getGroupedDragMenuConfig(tableSortColumnReorder);
|
|
118
|
+
var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect) {
|
|
119
|
+
var groupedDragMenuConfig = getGroupedDragMenuConfig();
|
|
122
120
|
var menuItemsArr = (0, _toConsumableArray2.default)(Array(groupedDragMenuConfig.length)).map(function () {
|
|
123
121
|
return [];
|
|
124
122
|
});
|
|
@@ -213,10 +211,8 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
213
211
|
scrollableElement = _ref.scrollableElement,
|
|
214
212
|
boundariesElement = _ref.boundariesElement,
|
|
215
213
|
isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
216
|
-
tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
|
|
217
214
|
shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
|
|
218
215
|
isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled,
|
|
219
|
-
tableSortColumnReorder = _ref.tableSortColumnReorder,
|
|
220
216
|
ariaNotifyPlugin = _ref.ariaNotifyPlugin,
|
|
221
217
|
isCommentEditor = _ref.isCommentEditor;
|
|
222
218
|
var state = editorView.state,
|
|
@@ -232,8 +228,8 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
232
228
|
var selectionRect = (0, _utils2.isSelectionType)(selection, 'cell') ? (0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
|
|
233
229
|
var hasMergedCellsInTable = (_tableMap$hasMergedCe = tableMap === null || tableMap === void 0 ? void 0 : tableMap.hasMergedCells()) !== null && _tableMap$hasMergedCe !== void 0 ? _tableMap$hasMergedCe : false;
|
|
234
230
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
235
|
-
var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled,
|
|
236
|
-
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage,
|
|
231
|
+
var dragMenuConfig = (0, _dragMenu.getDragMenuConfig)(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, ariaNotifyPlugin, isCommentEditor);
|
|
232
|
+
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
|
|
237
233
|
menuItems = _convertToDropdownIte.menuItems,
|
|
238
234
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
239
235
|
var handleSubMenuRef = function handleSubMenuRef(ref) {
|
|
@@ -282,7 +278,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
282
278
|
className: _styles.DropdownMenuSharedCssClassName.SUBMENU
|
|
283
279
|
// 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
280
|
,
|
|
285
|
-
css: (0, _styles2.dragMenuBackgroundColorStyles)(
|
|
281
|
+
css: (0, _styles2.dragMenuBackgroundColorStyles)()
|
|
286
282
|
}, (0, _react2.jsx)("div", {
|
|
287
283
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
288
284
|
css: (0, _styles2.cellColourPreviewStyles)(background)
|
|
@@ -480,7 +476,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
480
476
|
return null;
|
|
481
477
|
}
|
|
482
478
|
if (allowBackgroundColor) {
|
|
483
|
-
|
|
479
|
+
menuItems[1].items.unshift(createBackgroundColorMenuItem());
|
|
484
480
|
}
|
|
485
481
|
|
|
486
482
|
// If first row, add toggle for Header row, default is true
|
|
@@ -12,6 +12,7 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
|
12
12
|
var _consts = require("../consts");
|
|
13
13
|
var _DragMenu = _interopRequireDefault(require("./DragMenu"));
|
|
14
14
|
var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
15
|
+
var _getEditorFeatureFlag;
|
|
15
16
|
var mountPoint = _ref.mountPoint,
|
|
16
17
|
boundariesElement = _ref.boundariesElement,
|
|
17
18
|
scrollableElement = _ref.scrollableElement,
|
|
@@ -39,13 +40,9 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
39
40
|
if (!targetHandleRef || !(editorView.state.selection instanceof _cellSelection.CellSelection)) {
|
|
40
41
|
return null;
|
|
41
42
|
}
|
|
42
|
-
var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
43
|
-
_ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
|
|
44
|
-
tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
|
|
43
|
+
var _ref2 = (_getEditorFeatureFlag = getEditorFeatureFlags === null || getEditorFeatureFlags === void 0 ? void 0 : getEditorFeatureFlags()) !== null && _getEditorFeatureFlag !== void 0 ? _getEditorFeatureFlag : {},
|
|
45
44
|
_ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
|
|
46
|
-
tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC
|
|
47
|
-
_ref2$tableSortColumn = _ref2.tableSortColumnReorder,
|
|
48
|
-
tableSortColumnReorder = _ref2$tableSortColumn === void 0 ? false : _ref2$tableSortColumn;
|
|
45
|
+
tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC;
|
|
49
46
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (tableWithFixedColumnWidthsOption || isCommentEditor);
|
|
50
47
|
return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
51
48
|
alignX: direction === 'row' ? 'right' : undefined,
|
|
@@ -81,10 +78,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
81
78
|
boundariesElement: boundariesElement,
|
|
82
79
|
scrollableElement: scrollableElement,
|
|
83
80
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
84
|
-
tableDuplicateCellColouring: tableDuplicateCellColouring,
|
|
85
81
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
86
82
|
isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
|
|
87
|
-
tableSortColumnReorder: tableSortColumnReorder,
|
|
88
83
|
ariaNotifyPlugin: ariaNotifyPlugin,
|
|
89
84
|
api: api,
|
|
90
85
|
isCommentEditor: isCommentEditor || false
|
|
@@ -23,8 +23,7 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
|
|
|
23
23
|
|
|
24
24
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
25
25
|
var dragMenuBackgroundColorStyles = exports.dragMenuBackgroundColorStyles = function dragMenuBackgroundColorStyles() {
|
|
26
|
-
|
|
27
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), tableSortColumnReorder ? _consts.TABLE_DRAG_MENU_PADDING_TOP + _consts.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + _consts.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT : 0, _consts.dragMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.DRAG_SUBMENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
|
|
26
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tborder-radius: ", ";\n\t\tbackground: ", ";\n\t\tbox-shadow: ", ";\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\ttop: ", "px; // move the submenu down when 'sort increasing/decreasing' appear before background color picker\n\t\tleft: ", "px;\n\t\tpadding: ", ";\n\n\t\t> div {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t.", " {\n\t\tdisplay: flex;\n\n\t\t&::before {\n\t\t\tcontent: '';\n\t\t\tdisplay: block;\n\t\t\tborder: 1px solid ", ";\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '\u203A';\n\t\t\tmargin-left: ", ";\n\t\t\tline-height: 14px;\n\t\t\tcolor: ", ";\n\t\t}\n\t}\n"])), _types.TableCssClassName.DRAG_SUBMENU, "var(--ds-border-radius, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(_colors.N60A, ", 0 0 1px ").concat(_colors.N60A), ")"), _consts.TABLE_DRAG_MENU_PADDING_TOP + _consts.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT + _consts.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT, _consts.dragMenuDropdownWidth, "var(--ds-space-100, 8px)", _types.TableCssClassName.DRAG_SUBMENU_ICON, _adfSchema.tableBackgroundBorderColor, "var(--ds-border-radius, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(_colors.N90, ")"));
|
|
28
27
|
};
|
|
29
28
|
|
|
30
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
@@ -180,14 +180,12 @@ var FloatingInsertButton = exports.FloatingInsertButton = /*#__PURE__*/function
|
|
|
180
180
|
var _this$props3 = this.props,
|
|
181
181
|
editorView = _this$props3.editorView,
|
|
182
182
|
insertRowButtonIndex = _this$props3.insertRowButtonIndex,
|
|
183
|
-
editorAnalyticsAPI = _this$props3.editorAnalyticsAPI
|
|
184
|
-
getEditorFeatureFlags = _this$props3.getEditorFeatureFlags;
|
|
183
|
+
editorAnalyticsAPI = _this$props3.editorAnalyticsAPI;
|
|
185
184
|
if (typeof insertRowButtonIndex !== 'undefined') {
|
|
186
185
|
event.preventDefault();
|
|
187
186
|
var state = editorView.state,
|
|
188
187
|
dispatch = editorView.dispatch;
|
|
189
|
-
|
|
190
|
-
(0, _commandsWithAnalytics.insertRowWithAnalytics)(editorAnalyticsAPI, featureFlags && featureFlags.tableDuplicateCellColouring)(_analytics.INPUT_METHOD.BUTTON, {
|
|
188
|
+
(0, _commandsWithAnalytics.insertRowWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.BUTTON, {
|
|
191
189
|
index: insertRowButtonIndex,
|
|
192
190
|
moveCursorToInsertedRow: true
|
|
193
191
|
})(state, dispatch);
|
|
@@ -206,14 +204,12 @@ var FloatingInsertButton = exports.FloatingInsertButton = /*#__PURE__*/function
|
|
|
206
204
|
if (typeof insertColumnButtonIndex !== 'undefined') {
|
|
207
205
|
event.preventDefault();
|
|
208
206
|
var _ref = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
209
|
-
_ref$tableDuplicateCe = _ref.tableDuplicateCellColouring,
|
|
210
|
-
tableDuplicateCellColouring = _ref$tableDuplicateCe === void 0 ? false : _ref$tableDuplicateCe,
|
|
211
207
|
_ref$tableWithFixedCo = _ref.tableWithFixedColumnWidthsOption,
|
|
212
208
|
tableWithFixedColumnWidthsOption = _ref$tableWithFixedCo === void 0 ? false : _ref$tableWithFixedCo;
|
|
213
209
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (tableWithFixedColumnWidthsOption || isCommentEditor);
|
|
214
210
|
var state = editorView.state,
|
|
215
211
|
dispatch = editorView.dispatch;
|
|
216
|
-
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(this.props.api, editorAnalyticsAPI, isTableScalingEnabled,
|
|
212
|
+
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(this.props.api, editorAnalyticsAPI, isTableScalingEnabled, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent, isCommentEditor)(_analytics.INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
|
|
217
213
|
}
|
|
218
214
|
}
|
|
219
215
|
}]);
|
|
@@ -85,12 +85,10 @@ var defaultSelectionRect = {
|
|
|
85
85
|
var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(direction, getEditorContainerWidth, hasMergedCellsInTable, editorView, api, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired) {
|
|
86
86
|
var _tableMap$height, _tableMap$height2, _tableMap$width, _tableMap$width2;
|
|
87
87
|
var isTableScalingEnabled = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
var ariaNotifyPlugin = arguments.length > 16 ? arguments[16] : undefined;
|
|
93
|
-
var isCommentEditor = arguments.length > 17 && arguments[17] !== undefined ? arguments[17] : false;
|
|
88
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
|
|
89
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
|
|
90
|
+
var ariaNotifyPlugin = arguments.length > 14 ? arguments[14] : undefined;
|
|
91
|
+
var isCommentEditor = arguments.length > 15 && arguments[15] !== undefined ? arguments[15] : false;
|
|
94
92
|
var selection = editorView.state.selection;
|
|
95
93
|
var _getTablePluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
96
94
|
getIntl = _getTablePluginState.getIntl;
|
|
@@ -201,12 +199,12 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
201
199
|
iconFallback: iconFallback,
|
|
202
200
|
onClick: function onClick(state, dispatch) {
|
|
203
201
|
if (direction === 'row') {
|
|
204
|
-
(0, _commandsWithAnalytics.insertRowWithAnalytics)(editorAnalyticsAPI
|
|
202
|
+
(0, _commandsWithAnalytics.insertRowWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.TABLE_CONTEXT_MENU, {
|
|
205
203
|
index: (index !== null && index !== void 0 ? index : 0) + offset,
|
|
206
204
|
moveCursorToInsertedRow: true
|
|
207
205
|
})(state, dispatch);
|
|
208
206
|
} else {
|
|
209
|
-
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(api, editorAnalyticsAPI, isTableScalingEnabled,
|
|
207
|
+
(0, _commandsWithAnalytics.insertColumnWithAnalytics)(api, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(_analytics.INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
|
|
210
208
|
}
|
|
211
209
|
return true;
|
|
212
210
|
},
|
|
@@ -281,6 +279,6 @@ var getDragMenuConfig = exports.getDragMenuConfig = function getDragMenuConfig(d
|
|
|
281
279
|
};
|
|
282
280
|
})));
|
|
283
281
|
var allConfigs = (0, _toConsumableArray2.default)(restConfigs);
|
|
284
|
-
|
|
282
|
+
allConfigs.unshift.apply(allConfigs, (0, _toConsumableArray2.default)(sortConfigs));
|
|
285
283
|
return allConfigs.filter(Boolean);
|
|
286
284
|
};
|