@atlaskit/editor-plugin-table 22.2.16 → 22.2.18
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 +15 -0
- package/dist/cjs/types/index.js +0 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +92 -171
- package/dist/cjs/ui/FloatingContextualMenu/index.js +3 -4
- package/dist/cjs/ui/FloatingContextualMenu/styles.js +3 -3
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +7 -17
- package/dist/cjs/ui/FloatingInsertButton/getPopupOptions.js +7 -9
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -2
- package/dist/cjs/ui/common-styles.js +1 -2
- package/dist/cjs/ui/consts.js +1 -2
- package/dist/cjs/ui/ui-styles.js +14 -19
- package/dist/es2019/types/index.js +0 -1
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +36 -131
- package/dist/es2019/ui/FloatingContextualMenu/index.js +4 -5
- package/dist/es2019/ui/FloatingContextualMenu/styles.js +4 -24
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +7 -17
- package/dist/es2019/ui/FloatingInsertButton/getPopupOptions.js +8 -10
- package/dist/es2019/ui/FloatingInsertButton/index.js +3 -2
- package/dist/es2019/ui/common-styles.js +2 -5
- package/dist/es2019/ui/consts.js +0 -1
- package/dist/es2019/ui/ui-styles.js +2 -13
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +93 -172
- package/dist/esm/ui/FloatingContextualMenu/index.js +4 -5
- package/dist/esm/ui/FloatingContextualMenu/styles.js +4 -4
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +7 -17
- package/dist/esm/ui/FloatingInsertButton/getPopupOptions.js +8 -10
- package/dist/esm/ui/FloatingInsertButton/index.js +3 -2
- package/dist/esm/ui/common-styles.js +1 -2
- package/dist/esm/ui/consts.js +0 -1
- package/dist/esm/ui/ui-styles.js +15 -20
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +1 -4
- package/dist/types/ui/FloatingContextualMenu/styles.d.ts +1 -1
- package/dist/types/ui/FloatingInsertButton/getPopupOptions.d.ts +1 -1
- package/dist/types/ui/consts.d.ts +0 -1
- package/dist/types/ui/ui-styles.d.ts +1 -1
- package/dist/types-ts4.5/types/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +1 -4
- package/dist/types-ts4.5/ui/FloatingContextualMenu/styles.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingInsertButton/getPopupOptions.d.ts +1 -1
- package/dist/types-ts4.5/ui/consts.d.ts +0 -1
- package/dist/types-ts4.5/ui/ui-styles.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 22.2.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`34d7b445ae298`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34d7b445ae298) -
|
|
8
|
+
[ux] EDITOR-6294 Removing tableDragAndDrop from plugin presets and cleaning up unused table code
|
|
9
|
+
for menus
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 22.2.17
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 22.2.16
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -140,7 +140,6 @@ var TableCssClassName = exports.TableCssClassName = _objectSpread(_objectSpread(
|
|
|
140
140
|
CONTEXTUAL_MENU_BUTTON_WRAP: "".concat(_adfSchema.tablePrefixSelector, "-contextual-menu-button-wrap"),
|
|
141
141
|
CONTEXTUAL_MENU_BUTTON: "".concat(_adfSchema.tablePrefixSelector, "-contextual-menu-button"),
|
|
142
142
|
CONTEXTUAL_MENU_BUTTON_FIXED: "".concat(_adfSchema.tablePrefixSelector, "-contextual-menu-button-fixed"),
|
|
143
|
-
CONTEXTUAL_MENU_ICON: "".concat(_adfSchema.tablePrefixSelector, "-contextual-submenu-icon"),
|
|
144
143
|
CONTEXTUAL_MENU_ICON_SMALL: "".concat(_adfSchema.tablePrefixSelector, "-contextual-submenu-icon-small"),
|
|
145
144
|
// come from prosemirror-table
|
|
146
145
|
SELECTED_CELL: 'selectedCell',
|
|
@@ -60,6 +60,9 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
60
60
|
* @jsx jsx
|
|
61
61
|
*/ /* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */ // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
62
62
|
var arrowsList = new Set(!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true) ? ['ArrowRight', 'ArrowLeft'] : ['ArrowRight']);
|
|
63
|
+
var dropdownMenuSection = {
|
|
64
|
+
hasSeparator: true
|
|
65
|
+
};
|
|
63
66
|
var elementBeforeIconStyles = (0, _primitives.xcss)({
|
|
64
67
|
marginRight: 'space.negative.075',
|
|
65
68
|
display: 'flex'
|
|
@@ -121,8 +124,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
121
124
|
isCellMenuOpenByKeyboard = _this$props.isCellMenuOpenByKeyboard;
|
|
122
125
|
var isSubmenuOpen = _this.state.isSubmenuOpen;
|
|
123
126
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
124
|
-
targetCellPosition = _getPluginState.targetCellPosition
|
|
125
|
-
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
127
|
+
targetCellPosition = _getPluginState.targetCellPosition;
|
|
126
128
|
if (allowBackgroundColor) {
|
|
127
129
|
var _node$attrs, _node$attrs2;
|
|
128
130
|
var node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
|
|
@@ -134,17 +136,17 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
134
136
|
var selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
135
137
|
var selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
136
138
|
return {
|
|
137
|
-
content:
|
|
139
|
+
content: formatMessage(_messages.tableMessages.backgroundColor),
|
|
138
140
|
value: {
|
|
139
141
|
name: 'background'
|
|
140
142
|
},
|
|
141
|
-
elemBefore:
|
|
143
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
142
144
|
xcss: elementBeforeIconStyles
|
|
143
145
|
}, (0, _react2.jsx)(_paintBucket.default, {
|
|
144
146
|
color: "currentColor",
|
|
145
147
|
spacing: "spacious",
|
|
146
148
|
label: formatMessage(_messages.tableMessages.backgroundColor)
|
|
147
|
-
}))
|
|
149
|
+
})),
|
|
148
150
|
elemAfter:
|
|
149
151
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
150
152
|
(0, _react2.jsx)("div", {
|
|
@@ -154,7 +156,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
154
156
|
css: (0, _styles2.cellColourPreviewStyles)(background)
|
|
155
157
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
156
158
|
,
|
|
157
|
-
className:
|
|
159
|
+
className: _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL
|
|
158
160
|
}), isSubmenuOpen && (0, _react2.jsx)("div", {
|
|
159
161
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
160
162
|
className: _types.TableCssClassName.CONTEXTUAL_SUBMENU,
|
|
@@ -214,10 +216,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
214
216
|
var _this$props2 = _this.props,
|
|
215
217
|
allowMergeCells = _this$props2.allowMergeCells,
|
|
216
218
|
state = _this$props2.editorView.state,
|
|
217
|
-
formatMessage = _this$props2.intl.formatMessage
|
|
218
|
-
editorView = _this$props2.editorView;
|
|
219
|
-
var _getPluginState2 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
220
|
-
isDragAndDropEnabled = _getPluginState2.isDragAndDropEnabled;
|
|
219
|
+
formatMessage = _this$props2.intl.formatMessage;
|
|
221
220
|
if (allowMergeCells) {
|
|
222
221
|
return [{
|
|
223
222
|
content: formatMessage(_messages.tableMessages.mergeCells),
|
|
@@ -225,37 +224,33 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
225
224
|
name: 'merge'
|
|
226
225
|
},
|
|
227
226
|
isDisabled: !(0, _merge.canMergeCells)(state.tr),
|
|
228
|
-
elemBefore:
|
|
227
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
229
228
|
xcss: elementBeforeIconStyles
|
|
230
229
|
}, (0, _react2.jsx)(_tableCellMerge.default, {
|
|
231
230
|
color: "currentColor",
|
|
232
231
|
spacing: "spacious",
|
|
233
232
|
label: formatMessage(_messages.tableMessages.mergeCells)
|
|
234
|
-
}))
|
|
233
|
+
}))
|
|
235
234
|
}, {
|
|
236
235
|
content: formatMessage(_messages.tableMessages.splitCell),
|
|
237
236
|
value: {
|
|
238
237
|
name: 'split'
|
|
239
238
|
},
|
|
240
239
|
isDisabled: !(0, _utils2.splitCell)(state),
|
|
241
|
-
elemBefore:
|
|
240
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
242
241
|
xcss: elementBeforeIconStyles
|
|
243
242
|
}, (0, _react2.jsx)(_tableCellSplit.default, {
|
|
244
243
|
color: "currentColor",
|
|
245
244
|
spacing: "spacious",
|
|
246
245
|
label: formatMessage(_messages.tableMessages.splitCell)
|
|
247
|
-
}))
|
|
246
|
+
}))
|
|
248
247
|
}];
|
|
249
248
|
}
|
|
250
249
|
return [];
|
|
251
250
|
});
|
|
252
251
|
(0, _defineProperty2.default)(_this, "createInsertColumnItem", function () {
|
|
253
|
-
var
|
|
254
|
-
|
|
255
|
-
editorView = _this$props3.editorView;
|
|
256
|
-
var _getPluginState3 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
257
|
-
isDragAndDropEnabled = _getPluginState3.isDragAndDropEnabled;
|
|
258
|
-
var content = formatMessage(isDragAndDropEnabled ? _messages.tableMessages.addColumnRight : _messages.tableMessages.insertColumn);
|
|
252
|
+
var formatMessage = _this.props.intl.formatMessage;
|
|
253
|
+
var content = formatMessage(_messages.tableMessages.addColumnRight);
|
|
259
254
|
return {
|
|
260
255
|
content: content,
|
|
261
256
|
value: {
|
|
@@ -265,7 +260,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
265
260
|
elemAfter: (0, _react2.jsx)("div", {
|
|
266
261
|
css: _shortcut.shortcutStyle
|
|
267
262
|
}, (0, _keymaps.tooltip)(_keymaps.addColumnAfter)),
|
|
268
|
-
elemBefore:
|
|
263
|
+
elemBefore:
|
|
269
264
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
270
265
|
(0, _react2.jsx)(_primitives.Box, {
|
|
271
266
|
xcss: elementBeforeIconStyles
|
|
@@ -273,17 +268,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
273
268
|
color: "currentColor",
|
|
274
269
|
spacing: "spacious",
|
|
275
270
|
label: formatMessage(_messages.tableMessages.addColumnRight)
|
|
276
|
-
}))
|
|
271
|
+
})),
|
|
277
272
|
'aria-label': (0, _keymaps.tooltip)(_keymaps.addColumnAfter, String(content))
|
|
278
273
|
};
|
|
279
274
|
});
|
|
280
275
|
(0, _defineProperty2.default)(_this, "createInsertRowItem", function () {
|
|
281
|
-
var
|
|
282
|
-
|
|
283
|
-
editorView = _this$props4.editorView;
|
|
284
|
-
var _getPluginState4 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
285
|
-
isDragAndDropEnabled = _getPluginState4.isDragAndDropEnabled;
|
|
286
|
-
var content = formatMessage(isDragAndDropEnabled ? _messages.tableMessages.addRowBelow : _messages.tableMessages.insertRow);
|
|
276
|
+
var formatMessage = _this.props.intl.formatMessage;
|
|
277
|
+
var content = formatMessage(_messages.tableMessages.addRowBelow);
|
|
287
278
|
return {
|
|
288
279
|
content: content,
|
|
289
280
|
value: {
|
|
@@ -293,23 +284,20 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
293
284
|
elemAfter: (0, _react2.jsx)("div", {
|
|
294
285
|
css: _shortcut.shortcutStyle
|
|
295
286
|
}, (0, _keymaps.tooltip)(_keymaps.addRowAfter)),
|
|
296
|
-
elemBefore:
|
|
287
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
297
288
|
xcss: elementBeforeIconStyles
|
|
298
289
|
}, (0, _react2.jsx)(_tableRowAddBelow.default, {
|
|
299
290
|
color: "currentColor",
|
|
300
291
|
spacing: "spacious",
|
|
301
292
|
label: formatMessage(_messages.tableMessages.addRowBelow)
|
|
302
|
-
}))
|
|
293
|
+
})),
|
|
303
294
|
'aria-label': (0, _keymaps.tooltip)(_keymaps.addRowAfter, String(content))
|
|
304
295
|
};
|
|
305
296
|
});
|
|
306
297
|
(0, _defineProperty2.default)(_this, "createClearCellsItem", function () {
|
|
307
|
-
var _this$
|
|
308
|
-
selectionRect = _this$
|
|
309
|
-
formatMessage = _this$
|
|
310
|
-
editorView = _this$props5.editorView;
|
|
311
|
-
var _getPluginState5 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
312
|
-
isDragAndDropEnabled = _getPluginState5.isDragAndDropEnabled;
|
|
298
|
+
var _this$props3 = _this.props,
|
|
299
|
+
selectionRect = _this$props3.selectionRect,
|
|
300
|
+
formatMessage = _this$props3.intl.formatMessage;
|
|
313
301
|
var top = selectionRect.top,
|
|
314
302
|
bottom = selectionRect.bottom,
|
|
315
303
|
right = selectionRect.right,
|
|
@@ -328,7 +316,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
328
316
|
elemAfter: (0, _react2.jsx)("div", {
|
|
329
317
|
css: _shortcut.shortcutStyle
|
|
330
318
|
}, (0, _keymaps.tooltip)(_keymaps.backspace)),
|
|
331
|
-
elemBefore:
|
|
319
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
332
320
|
xcss: elementBeforeIconStyles
|
|
333
321
|
}, (0, _react2.jsx)(_tableCellClear.default, {
|
|
334
322
|
color: "currentColor",
|
|
@@ -336,17 +324,14 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
336
324
|
label: formatMessage(_messages.tableMessages.clearCells, {
|
|
337
325
|
0: Math.max(noOfColumns, noOfRows)
|
|
338
326
|
})
|
|
339
|
-
}))
|
|
327
|
+
})),
|
|
340
328
|
'aria-label': (0, _keymaps.tooltip)(_keymaps.backspace, String(content))
|
|
341
329
|
};
|
|
342
330
|
});
|
|
343
331
|
(0, _defineProperty2.default)(_this, "createDeleteColumnItem", function () {
|
|
344
|
-
var _this$
|
|
345
|
-
selectionRect = _this$
|
|
346
|
-
formatMessage = _this$
|
|
347
|
-
editorView = _this$props6.editorView;
|
|
348
|
-
var _getPluginState6 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
349
|
-
isDragAndDropEnabled = _getPluginState6.isDragAndDropEnabled;
|
|
332
|
+
var _this$props4 = _this.props,
|
|
333
|
+
selectionRect = _this$props4.selectionRect,
|
|
334
|
+
formatMessage = _this$props4.intl.formatMessage;
|
|
350
335
|
var right = selectionRect.right,
|
|
351
336
|
left = selectionRect.left;
|
|
352
337
|
var noOfColumns = right - left;
|
|
@@ -357,7 +342,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
357
342
|
value: {
|
|
358
343
|
name: 'delete_column'
|
|
359
344
|
},
|
|
360
|
-
elemBefore:
|
|
345
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
361
346
|
xcss: elementBeforeIconStyles
|
|
362
347
|
}, (0, _react2.jsx)(_tableColumnDelete.default, {
|
|
363
348
|
color: "currentColor",
|
|
@@ -365,16 +350,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
365
350
|
label: formatMessage(_messages.tableMessages.removeColumns, {
|
|
366
351
|
0: noOfColumns
|
|
367
352
|
})
|
|
368
|
-
}))
|
|
353
|
+
}))
|
|
369
354
|
};
|
|
370
355
|
});
|
|
371
356
|
(0, _defineProperty2.default)(_this, "createDeleteRowItem", function () {
|
|
372
|
-
var _this$
|
|
373
|
-
selectionRect = _this$
|
|
374
|
-
formatMessage = _this$
|
|
375
|
-
editorView = _this$props7.editorView;
|
|
376
|
-
var _getPluginState7 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
377
|
-
isDragAndDropEnabled = _getPluginState7.isDragAndDropEnabled;
|
|
357
|
+
var _this$props5 = _this.props,
|
|
358
|
+
selectionRect = _this$props5.selectionRect,
|
|
359
|
+
formatMessage = _this$props5.intl.formatMessage;
|
|
378
360
|
var bottom = selectionRect.bottom,
|
|
379
361
|
top = selectionRect.top;
|
|
380
362
|
var noOfRows = bottom - top;
|
|
@@ -385,7 +367,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
385
367
|
value: {
|
|
386
368
|
name: 'delete_row'
|
|
387
369
|
},
|
|
388
|
-
elemBefore:
|
|
370
|
+
elemBefore: (0, _react2.jsx)(_primitives.Box, {
|
|
389
371
|
xcss: elementBeforeIconStyles
|
|
390
372
|
}, (0, _react2.jsx)(_tableRowDelete.default, {
|
|
391
373
|
color: "currentColor",
|
|
@@ -393,20 +375,20 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
393
375
|
label: formatMessage(_messages.tableMessages.removeRows, {
|
|
394
376
|
0: noOfRows
|
|
395
377
|
})
|
|
396
|
-
}))
|
|
378
|
+
}))
|
|
397
379
|
};
|
|
398
380
|
});
|
|
399
381
|
(0, _defineProperty2.default)(_this, "createDistributeColumnsItemInternal", function (partialMenuItem) {
|
|
400
382
|
var _newResizeState$chang;
|
|
401
|
-
var _this$
|
|
402
|
-
selectionRect = _this$
|
|
403
|
-
editorView = _this$
|
|
404
|
-
getEditorContainerWidth = _this$
|
|
405
|
-
getEditorFeatureFlags = _this$
|
|
406
|
-
formatMessage = _this$
|
|
407
|
-
var
|
|
408
|
-
|
|
409
|
-
isTableScalingEnabled =
|
|
383
|
+
var _this$props6 = _this.props,
|
|
384
|
+
selectionRect = _this$props6.selectionRect,
|
|
385
|
+
editorView = _this$props6.editorView,
|
|
386
|
+
getEditorContainerWidth = _this$props6.getEditorContainerWidth,
|
|
387
|
+
getEditorFeatureFlags = _this$props6.getEditorFeatureFlags,
|
|
388
|
+
formatMessage = _this$props6.intl.formatMessage;
|
|
389
|
+
var _getPluginState2 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
390
|
+
_getPluginState2$isTa = _getPluginState2.isTableScalingEnabled,
|
|
391
|
+
isTableScalingEnabled = _getPluginState2$isTa === void 0 ? false : _getPluginState2$isTa;
|
|
410
392
|
var _ref = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
411
393
|
_ref$tableWithFixedCo = _ref.tableWithFixedColumnWidthsOption,
|
|
412
394
|
tableWithFixedColumnWidthsOption = _ref$tableWithFixedCo === void 0 ? false : _ref$tableWithFixedCo;
|
|
@@ -420,62 +402,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
420
402
|
isDisabled: !wouldChange
|
|
421
403
|
}, partialMenuItem);
|
|
422
404
|
});
|
|
423
|
-
(0, _defineProperty2.default)(_this, "
|
|
424
|
-
var editorView = _this.props.editorView;
|
|
425
|
-
var _getPluginState9 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
426
|
-
isDragAndDropEnabled = _getPluginState9.isDragAndDropEnabled,
|
|
427
|
-
allowDistributeColumns = _getPluginState9.pluginConfig.allowDistributeColumns;
|
|
428
|
-
if (allowDistributeColumns && !isDragAndDropEnabled) {
|
|
429
|
-
return _this.createDistributeColumnsItemInternal();
|
|
430
|
-
}
|
|
431
|
-
return null;
|
|
432
|
-
});
|
|
433
|
-
(0, _defineProperty2.default)(_this, "createSortColumnItems", function () {
|
|
434
|
-
var _this$props9 = _this.props,
|
|
435
|
-
formatMessage = _this$props9.intl.formatMessage,
|
|
436
|
-
editorView = _this$props9.editorView,
|
|
437
|
-
allowColumnSorting = _this$props9.allowColumnSorting;
|
|
438
|
-
var _getPluginState0 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
439
|
-
isDragAndDropEnabled = _getPluginState0.isDragAndDropEnabled;
|
|
440
|
-
if (allowColumnSorting && !isDragAndDropEnabled) {
|
|
441
|
-
var hasMergedCellsInTable = (0, _table.getMergedCellsPositions)(editorView.state.tr).length > 0;
|
|
442
|
-
var warning = hasMergedCellsInTable ? {
|
|
443
|
-
tooltipDescription: formatMessage(_messages.tableMessages.canNotSortTable),
|
|
444
|
-
isDisabled: true
|
|
445
|
-
} : {};
|
|
446
|
-
return [_objectSpread({
|
|
447
|
-
content: formatMessage(_messages.tableMessages.sortColumnASC),
|
|
448
|
-
value: {
|
|
449
|
-
name: 'sort_column_asc'
|
|
450
|
-
}
|
|
451
|
-
}, warning), _objectSpread({
|
|
452
|
-
content: formatMessage(_messages.tableMessages.sortColumnDESC),
|
|
453
|
-
value: {
|
|
454
|
-
name: 'sort_column_desc'
|
|
455
|
-
}
|
|
456
|
-
}, warning)];
|
|
457
|
-
}
|
|
458
|
-
return null;
|
|
459
|
-
});
|
|
460
|
-
(0, _defineProperty2.default)(_this, "createOriginalContextMenuItems", function () {
|
|
461
|
-
var items = [];
|
|
462
|
-
var sortColumnItems = _this.createSortColumnItems();
|
|
463
|
-
var backgroundColorItem = _this.createBackgroundColorItem();
|
|
464
|
-
var distributeColumnsItem = _this.createDistributeColumnsItem();
|
|
465
|
-
sortColumnItems && items.push.apply(items, (0, _toConsumableArray2.default)(sortColumnItems));
|
|
466
|
-
backgroundColorItem && items.push(backgroundColorItem);
|
|
467
|
-
items.push(_this.createInsertColumnItem());
|
|
468
|
-
items.push(_this.createInsertRowItem());
|
|
469
|
-
items.push(_this.createDeleteColumnItem());
|
|
470
|
-
items.push(_this.createDeleteRowItem());
|
|
471
|
-
items.push.apply(items, (0, _toConsumableArray2.default)(_this.createMergeSplitCellItems()));
|
|
472
|
-
distributeColumnsItem && items.push(distributeColumnsItem);
|
|
473
|
-
items.push(_this.createClearCellsItem());
|
|
474
|
-
return [{
|
|
475
|
-
items: items
|
|
476
|
-
}];
|
|
477
|
-
});
|
|
478
|
-
(0, _defineProperty2.default)(_this, "createNewContextMenuItems", function () {
|
|
405
|
+
(0, _defineProperty2.default)(_this, "createContextMenuItems", function () {
|
|
479
406
|
var _items$0$items;
|
|
480
407
|
var backgroundColorItem = _this.createBackgroundColorItem();
|
|
481
408
|
var mergeSplitCellItems = _this.createMergeSplitCellItems();
|
|
@@ -505,21 +432,21 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
505
432
|
});
|
|
506
433
|
(0, _defineProperty2.default)(_this, "onMenuItemActivated", function (_ref2) {
|
|
507
434
|
var item = _ref2.item;
|
|
508
|
-
var _this$
|
|
509
|
-
editorView = _this$
|
|
510
|
-
selectionRect = _this$
|
|
511
|
-
editorAnalyticsAPI = _this$
|
|
512
|
-
getEditorContainerWidth = _this$
|
|
513
|
-
getEditorFeatureFlags = _this$
|
|
514
|
-
isCellMenuOpenByKeyboard = _this$
|
|
515
|
-
isCommentEditor = _this$
|
|
435
|
+
var _this$props7 = _this.props,
|
|
436
|
+
editorView = _this$props7.editorView,
|
|
437
|
+
selectionRect = _this$props7.selectionRect,
|
|
438
|
+
editorAnalyticsAPI = _this$props7.editorAnalyticsAPI,
|
|
439
|
+
getEditorContainerWidth = _this$props7.getEditorContainerWidth,
|
|
440
|
+
getEditorFeatureFlags = _this$props7.getEditorFeatureFlags,
|
|
441
|
+
isCellMenuOpenByKeyboard = _this$props7.isCellMenuOpenByKeyboard,
|
|
442
|
+
isCommentEditor = _this$props7.isCommentEditor;
|
|
516
443
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
517
444
|
var state = editorView.state,
|
|
518
445
|
dispatch = editorView.dispatch;
|
|
519
|
-
var
|
|
520
|
-
targetCellPosition =
|
|
521
|
-
|
|
522
|
-
isTableScalingEnabled =
|
|
446
|
+
var _getPluginState3 = (0, _pluginFactory.getPluginState)(state),
|
|
447
|
+
targetCellPosition = _getPluginState3.targetCellPosition,
|
|
448
|
+
_getPluginState3$isTa = _getPluginState3.isTableScalingEnabled,
|
|
449
|
+
isTableScalingEnabled = _getPluginState3$isTa === void 0 ? false : _getPluginState3$isTa;
|
|
523
450
|
var _ref3 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
524
451
|
_ref3$tableWithFixedC = _ref3.tableWithFixedColumnWidthsOption,
|
|
525
452
|
tableWithFixedColumnWidthsOption = _ref3$tableWithFixedC === void 0 ? false : _ref3$tableWithFixedC;
|
|
@@ -583,8 +510,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
583
510
|
_this.toggleOpen();
|
|
584
511
|
break;
|
|
585
512
|
case 'delete_row':
|
|
586
|
-
var
|
|
587
|
-
isHeaderRowRequired =
|
|
513
|
+
var _getPluginState4 = (0, _pluginFactory.getPluginState)(state),
|
|
514
|
+
isHeaderRowRequired = _getPluginState4.pluginConfig.isHeaderRowRequired;
|
|
588
515
|
(0, _commandsWithAnalytics.deleteRowsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, selectionRect, !!isHeaderRowRequired)(state, dispatch);
|
|
589
516
|
_this.toggleOpen();
|
|
590
517
|
break;
|
|
@@ -612,11 +539,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
612
539
|
}
|
|
613
540
|
});
|
|
614
541
|
(0, _defineProperty2.default)(_this, "toggleOpen", function () {
|
|
615
|
-
var _this$
|
|
616
|
-
isOpen = _this$
|
|
617
|
-
_this$
|
|
618
|
-
state = _this$
|
|
619
|
-
dispatch = _this$
|
|
542
|
+
var _this$props8 = _this.props,
|
|
543
|
+
isOpen = _this$props8.isOpen,
|
|
544
|
+
_this$props8$editorVi = _this$props8.editorView,
|
|
545
|
+
state = _this$props8$editorVi.state,
|
|
546
|
+
dispatch = _this$props8$editorVi.dispatch;
|
|
620
547
|
(0, _commands.toggleContextualMenu)()(state, dispatch);
|
|
621
548
|
if (!isOpen) {
|
|
622
549
|
_this.setState({
|
|
@@ -625,12 +552,12 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
625
552
|
}
|
|
626
553
|
});
|
|
627
554
|
(0, _defineProperty2.default)(_this, "handleOpenChange", function (payload) {
|
|
628
|
-
var _this$
|
|
629
|
-
_this$
|
|
630
|
-
state = _this$
|
|
631
|
-
dispatch = _this$
|
|
632
|
-
dom = _this$
|
|
633
|
-
isCellMenuOpenByKeyboard = _this$
|
|
555
|
+
var _this$props9 = _this.props,
|
|
556
|
+
_this$props9$editorVi = _this$props9.editorView,
|
|
557
|
+
state = _this$props9$editorVi.state,
|
|
558
|
+
dispatch = _this$props9$editorVi.dispatch,
|
|
559
|
+
dom = _this$props9$editorVi.dom,
|
|
560
|
+
isCellMenuOpenByKeyboard = _this$props9.isCellMenuOpenByKeyboard;
|
|
634
561
|
if (payload) {
|
|
635
562
|
var event = payload.event;
|
|
636
563
|
if (event && event instanceof KeyboardEvent) {
|
|
@@ -669,11 +596,11 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
669
596
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
670
597
|
(0, _defineProperty2.default)(_this, "handleItemMouseEnter", function (_ref4) {
|
|
671
598
|
var item = _ref4.item;
|
|
672
|
-
var _this$
|
|
673
|
-
_this$
|
|
674
|
-
state = _this$
|
|
675
|
-
dispatch = _this$
|
|
676
|
-
selectionRect = _this$
|
|
599
|
+
var _this$props0 = _this.props,
|
|
600
|
+
_this$props0$editorVi = _this$props0.editorView,
|
|
601
|
+
state = _this$props0$editorVi.state,
|
|
602
|
+
dispatch = _this$props0$editorVi.dispatch,
|
|
603
|
+
selectionRect = _this$props0.selectionRect;
|
|
677
604
|
if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_submenu_open_click', 'isEnabled', true)) {
|
|
678
605
|
if (item.value.name === 'background') {
|
|
679
606
|
if (!_this.state.isSubmenuOpen) {
|
|
@@ -717,10 +644,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
717
644
|
}
|
|
718
645
|
});
|
|
719
646
|
(0, _defineProperty2.default)(_this, "setColor", function (color) {
|
|
720
|
-
var _this$
|
|
721
|
-
editorView = _this$
|
|
722
|
-
editorAnalyticsAPI = _this$
|
|
723
|
-
isCellMenuOpenByKeyboard = _this$
|
|
647
|
+
var _this$props1 = _this.props,
|
|
648
|
+
editorView = _this$props1.editorView,
|
|
649
|
+
editorAnalyticsAPI = _this$props1.editorAnalyticsAPI,
|
|
650
|
+
isCellMenuOpenByKeyboard = _this$props1.isCellMenuOpenByKeyboard;
|
|
724
651
|
var state = editorView.state,
|
|
725
652
|
dispatch = editorView.dispatch,
|
|
726
653
|
dom = editorView.dom;
|
|
@@ -758,26 +685,22 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
758
685
|
}, {
|
|
759
686
|
key: "componentDidUpdate",
|
|
760
687
|
value: function componentDidUpdate() {
|
|
761
|
-
var
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
if (isDragAndDropEnabled && this.props.isDragMenuOpen && isContextualMenuOpen) {
|
|
688
|
+
var _getPluginState5 = (0, _pluginFactory.getPluginState)(this.props.editorView.state),
|
|
689
|
+
isContextualMenuOpen = _getPluginState5.isContextualMenuOpen;
|
|
690
|
+
if (this.props.isDragMenuOpen && isContextualMenuOpen) {
|
|
765
691
|
(0, _commands.toggleContextualMenu)()(this.props.editorView.state, this.props.editorView.dispatch);
|
|
766
692
|
}
|
|
767
693
|
}
|
|
768
694
|
}, {
|
|
769
695
|
key: "render",
|
|
770
696
|
value: function render() {
|
|
771
|
-
var _this$
|
|
772
|
-
isOpen = _this$
|
|
773
|
-
offset = _this$
|
|
774
|
-
boundariesElement = _this$
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
var _getPluginState12 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
779
|
-
isDragAndDropEnabled = _getPluginState12.isDragAndDropEnabled;
|
|
780
|
-
var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
|
|
697
|
+
var _this$props10 = this.props,
|
|
698
|
+
isOpen = _this$props10.isOpen,
|
|
699
|
+
offset = _this$props10.offset,
|
|
700
|
+
boundariesElement = _this$props10.boundariesElement,
|
|
701
|
+
isCellMenuOpenByKeyboard = _this$props10.isCellMenuOpenByKeyboard,
|
|
702
|
+
api = _this$props10.api;
|
|
703
|
+
var items = this.createContextMenuItems();
|
|
781
704
|
var isOpenAllowed = false;
|
|
782
705
|
isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
|
|
783
706
|
return (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
|
|
@@ -803,7 +726,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
803
726
|
onMouseEnter: this.handleItemMouseEnter,
|
|
804
727
|
onMouseLeave: this.handleItemMouseLeave,
|
|
805
728
|
fitHeight: 188,
|
|
806
|
-
fitWidth:
|
|
729
|
+
fitWidth: _consts.contextualMenuDropdownWidthDnD
|
|
807
730
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
808
731
|
,
|
|
809
732
|
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
@@ -811,9 +734,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
811
734
|
},
|
|
812
735
|
boundariesElement: boundariesElement,
|
|
813
736
|
offset: offset,
|
|
814
|
-
section:
|
|
815
|
-
hasSeparator: true
|
|
816
|
-
} : undefined,
|
|
737
|
+
section: dropdownMenuSection,
|
|
817
738
|
allowEnterDefaultBehavior: this.state.isSubmenuOpen
|
|
818
739
|
})));
|
|
819
740
|
}
|
|
@@ -43,8 +43,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
43
43
|
|
|
44
44
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
45
45
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
46
|
-
targetCellPosition = _getPluginState.targetCellPosition
|
|
47
|
-
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
46
|
+
targetCellPosition = _getPluginState.targetCellPosition;
|
|
48
47
|
if (!isOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition) {
|
|
49
48
|
return null;
|
|
50
49
|
}
|
|
@@ -73,7 +72,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
73
72
|
boundariesElement: boundariesElement,
|
|
74
73
|
scrollableElement: scrollableElement,
|
|
75
74
|
fitHeight: _consts.tablePopupMenuFitHeight,
|
|
76
|
-
fitWidth:
|
|
75
|
+
fitWidth: _consts.contextualMenuDropdownWidthDnD
|
|
77
76
|
// z-index value below is to ensure that this menu is above other floating menu
|
|
78
77
|
// in table, but below floating dialogs like typeaheads, pickers, etc.
|
|
79
78
|
,
|
|
@@ -84,7 +83,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
84
83
|
offset: [-7, 0],
|
|
85
84
|
stick: true
|
|
86
85
|
}, (0, _react.jsx)("div", {
|
|
87
|
-
css: (0, _styles.tablePopupStyles)(
|
|
86
|
+
css: (0, _styles.tablePopupStyles)()
|
|
88
87
|
}, (0, _react.jsx)(_ContextualMenu.default, {
|
|
89
88
|
editorView: editorView
|
|
90
89
|
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
@@ -19,8 +19,8 @@ var cellColourPreviewStyles = exports.cellColourPreviewStyles = function cellCol
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
var tablePopupStyles = exports.tablePopupStyles = function tablePopupStyles(
|
|
23
|
-
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
22
|
+
var tablePopupStyles = exports.tablePopupStyles = function tablePopupStyles(
|
|
23
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
24
24
|
) {
|
|
25
|
-
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: 0;\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:
|
|
25
|
+
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: 0;\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.CONTEXTUAL_SUBMENU, "var(--ds-radius-small, 3px)", "var(--ds-surface-overlay, #FFFFFF)", "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)", _consts.contextualMenuDropdownWidthDnD, "var(--ds-space-100, 8px)", _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL, _adfSchema.tableBackgroundBorderColor, "var(--ds-radius-small, 3px)", "var(--ds-space-050, 4px)", "var(--ds-icon, #292A2E)");
|
|
26
26
|
};
|
|
@@ -19,33 +19,25 @@ var _types = require("../../types");
|
|
|
19
19
|
var _consts = require("../consts");
|
|
20
20
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
21
21
|
|
|
22
|
-
var getInsertLineHeight = function getInsertLineHeight(tableRef, hasStickyHeaders
|
|
22
|
+
var getInsertLineHeight = function getInsertLineHeight(tableRef, hasStickyHeaders) {
|
|
23
23
|
// The line gets height 100% from the table,
|
|
24
24
|
// but since we have an overflow on the left,
|
|
25
25
|
// we should add an offset to make up for it.
|
|
26
26
|
var LINE_OFFSET = 3;
|
|
27
|
-
var ADDITIONAL_HEIGHT = hasStickyHeaders ? tableRef.getBoundingClientRect().top - _styles.tableMarginTop *
|
|
27
|
+
var ADDITIONAL_HEIGHT = hasStickyHeaders ? tableRef.getBoundingClientRect().top - _styles.tableMarginTop * 3 - LINE_OFFSET : _consts.tableToolbarSize + LINE_OFFSET;
|
|
28
28
|
return tableRef.offsetHeight + ADDITIONAL_HEIGHT;
|
|
29
29
|
};
|
|
30
|
-
var
|
|
30
|
+
var getNumberColumnWidth = function getNumberColumnWidth(tableRef) {
|
|
31
31
|
var parent = (0, _utils.closestElement)(tableRef, ".".concat(_types.TableCssClassName.TABLE_CONTAINER));
|
|
32
32
|
if (parent) {
|
|
33
|
-
return parent.querySelector(".".concat(_types.TableCssClassName.NUMBERED_COLUMN)) ? _consts.tableToolbarSize + _editorSharedStyles.akEditorTableNumberColumnWidth - 1 : _consts.tableToolbarSize;
|
|
34
|
-
}
|
|
35
|
-
return _consts.tableToolbarSize;
|
|
36
|
-
};
|
|
37
|
-
var getNumberColumnWidth = function getNumberColumnWidth(tableRef, isDragAndDropEnabled) {
|
|
38
|
-
var parent = (0, _utils.closestElement)(tableRef, ".".concat(_types.TableCssClassName.TABLE_CONTAINER));
|
|
39
|
-
if (parent && isDragAndDropEnabled) {
|
|
40
33
|
return parent.querySelector(".".concat(_types.TableCssClassName.NUMBERED_COLUMN)) ? _editorSharedStyles.akEditorTableNumberColumnWidth - 1 : 0;
|
|
41
34
|
}
|
|
42
35
|
return 0;
|
|
43
36
|
};
|
|
44
|
-
var getInsertLineWidth = function getInsertLineWidth(tableRef,
|
|
37
|
+
var getInsertLineWidth = function getInsertLineWidth(tableRef, isChromelessEditor) {
|
|
45
38
|
// The line gets width 100% from the table,
|
|
46
39
|
// but since we have an overflow on the left,
|
|
47
40
|
// we should add an offset to make up for it.
|
|
48
|
-
var LINE_OFFSET = 4;
|
|
49
41
|
var DRAG_LINE_OFFSET = isChromelessEditor ? 14 : 6;
|
|
50
42
|
var parentElement = tableRef.parentElement,
|
|
51
43
|
offsetWidth = tableRef.offsetWidth;
|
|
@@ -57,9 +49,7 @@ var getInsertLineWidth = function getInsertLineWidth(tableRef, isDragAndDropEnab
|
|
|
57
49
|
var _ref = parentElement,
|
|
58
50
|
scrollLeft = _ref.scrollLeft;
|
|
59
51
|
var diff = offsetWidth - parentOffsetWidth;
|
|
60
|
-
|
|
61
|
-
var lineOffset = isDragAndDropEnabled ? DRAG_LINE_OFFSET : LINE_OFFSET;
|
|
62
|
-
return Math.min(offsetWidth + toolbarSize, parentOffsetWidth + toolbarSize - Math.max(scrollLeft - diff, 0)) + lineOffset + getNumberColumnWidth(tableRef, isDragAndDropEnabled);
|
|
52
|
+
return Math.min(offsetWidth, parentOffsetWidth - Math.max(scrollLeft - diff, 0)) + DRAG_LINE_OFFSET + getNumberColumnWidth(tableRef);
|
|
63
53
|
};
|
|
64
54
|
var tooltipMessageByType = function tooltipMessageByType(type) {
|
|
65
55
|
return type === 'row' ? _messages.tableMessages.insertRow : _messages.tableMessages.insertColumn;
|
|
@@ -104,10 +94,10 @@ var InsertButtonForDragAndDrop = function InsertButtonForDragAndDrop(_ref2) {
|
|
|
104
94
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
105
95
|
,
|
|
106
96
|
style: type === 'row' ? {
|
|
107
|
-
width: getInsertLineWidth(tableRef,
|
|
97
|
+
width: getInsertLineWidth(tableRef, isChromelessEditor),
|
|
108
98
|
left: "var(--ds-space-150, 12px)"
|
|
109
99
|
} : {
|
|
110
|
-
height: getInsertLineHeight(tableRef, hasStickyHeaders
|
|
100
|
+
height: getInsertLineHeight(tableRef, hasStickyHeaders) - 8,
|
|
111
101
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
112
102
|
top: '-3px'
|
|
113
103
|
}
|