@atlaskit/editor-plugin-table 17.3.18 → 17.3.20
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 +16 -0
- package/dist/cjs/nodeviews/TableContainer.js +11 -4
- package/dist/cjs/nodeviews/TableResizer.js +10 -17
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +9 -14
- package/dist/cjs/ui/ContentComponent.js +1 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +36 -45
- package/dist/cjs/ui/FloatingContextualMenu/index.js +3 -4
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +5 -8
- package/dist/cjs/ui/toolbar.js +1 -3
- package/dist/es2019/nodeviews/TableContainer.js +11 -4
- package/dist/es2019/nodeviews/TableResizer.js +10 -17
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +7 -13
- package/dist/es2019/ui/ContentComponent.js +1 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +6 -12
- package/dist/es2019/ui/FloatingContextualMenu/index.js +3 -4
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +5 -8
- package/dist/es2019/ui/toolbar.js +1 -3
- package/dist/esm/nodeviews/TableContainer.js +11 -4
- package/dist/esm/nodeviews/TableResizer.js +10 -17
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +9 -14
- package/dist/esm/ui/ContentComponent.js +1 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +36 -45
- package/dist/esm/ui/FloatingContextualMenu/index.js +3 -4
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +5 -8
- package/dist/esm/ui/toolbar.js +1 -3
- package/dist/types/types/index.d.ts +2 -2
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/types/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 17.3.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`81937b9af604e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/81937b9af604e) -
|
|
8
|
+
[ux] fix table border late render issue
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 17.3.19
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`7ef3027df8198`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ef3027df8198) -
|
|
16
|
+
remove platform_editor_lovability_user_intent experiment
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 17.3.18
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -30,7 +30,9 @@ var InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
30
30
|
var className = _ref.className,
|
|
31
31
|
style = _ref.style,
|
|
32
32
|
node = _ref.node,
|
|
33
|
-
children = _ref.children
|
|
33
|
+
children = _ref.children,
|
|
34
|
+
tableWrapperHeight = _ref.tableWrapperHeight;
|
|
35
|
+
var bordersReady = (0, _expValEquals.expValEquals)('platform_editor_table_borders_ready_fix', 'isEnabled', true) ? tableWrapperHeight !== undefined && tableWrapperHeight > 0 : undefined;
|
|
34
36
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
37
|
ref: ref
|
|
36
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -41,6 +43,7 @@ var InnerContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
41
43
|
className: className,
|
|
42
44
|
"data-number-column": node.attrs.isNumberColumnEnabled,
|
|
43
45
|
"data-layout": node.attrs.layout,
|
|
46
|
+
"data-borders-ready": bordersReady,
|
|
44
47
|
"data-testid": "table-container"
|
|
45
48
|
}, children);
|
|
46
49
|
});
|
|
@@ -335,9 +338,12 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
335
338
|
ref: containerRef
|
|
336
339
|
}, /*#__PURE__*/_react.default.createElement(_TableResizer.TableResizer, (0, _extends2.default)({}, tableResizerProps, {
|
|
337
340
|
disabled: isLivePageViewMode
|
|
338
|
-
}), /*#__PURE__*/_react.default.createElement(InnerContainer
|
|
341
|
+
}), /*#__PURE__*/_react.default.createElement(InnerContainer
|
|
342
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
343
|
+
, {
|
|
339
344
|
className: className,
|
|
340
|
-
node: node
|
|
345
|
+
node: node,
|
|
346
|
+
tableWrapperHeight: tableWrapperHeight
|
|
341
347
|
}, children))));
|
|
342
348
|
});
|
|
343
349
|
var TableContainer = exports.TableContainer = function TableContainer(_ref5) {
|
|
@@ -396,7 +402,8 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref5) {
|
|
|
396
402
|
var isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
|
|
397
403
|
var resizableTableWidth = isFullPageAppearance ? (0, _misc.getTableResizerContainerForFullPageWidthInCSS)(node, isTableScalingEnabled) : "calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2))";
|
|
398
404
|
return /*#__PURE__*/_react.default.createElement(InnerContainer, {
|
|
399
|
-
node: node
|
|
405
|
+
node: node,
|
|
406
|
+
tableWrapperHeight: tableWrapperHeight
|
|
400
407
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
401
408
|
,
|
|
402
409
|
className: (0, _classnames.default)(className, {
|
|
@@ -25,7 +25,6 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
25
25
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
26
26
|
var _insm = require("@atlaskit/insm");
|
|
27
27
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
28
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
29
28
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
30
29
|
var _commandsWithAnalytics = require("../pm-plugins/commands/commands-with-analytics");
|
|
31
30
|
var _misc = require("../pm-plugins/commands/misc");
|
|
@@ -162,7 +161,6 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
162
161
|
setSnappingEnabled = _useState2[1];
|
|
163
162
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
164
163
|
formatMessage = _useIntl.formatMessage;
|
|
165
|
-
var isToolbarAIFCEnabled = Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar);
|
|
166
164
|
var currentSelection = (_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection;
|
|
167
165
|
var tableFromSelection = (0, _react.useMemo)(function () {
|
|
168
166
|
return (0, _utils.findTable)(currentSelection);
|
|
@@ -248,6 +246,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
248
246
|
};
|
|
249
247
|
}, [editorView, displayGuideline, displayGapCursor]);
|
|
250
248
|
var handleResizeStart = (0, _react.useCallback)(function () {
|
|
249
|
+
var _pluginInjectionApi$u;
|
|
251
250
|
if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
|
|
252
251
|
var _insm$session;
|
|
253
252
|
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableResize');
|
|
@@ -266,19 +265,16 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
266
265
|
tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
|
|
267
266
|
name: _analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
|
|
268
267
|
});
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
tr: tr
|
|
273
|
-
});
|
|
274
|
-
}
|
|
268
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$u = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u === void 0 || _pluginInjectionApi$u.commands.setCurrentUserIntent('resizing')({
|
|
269
|
+
tr: tr
|
|
270
|
+
});
|
|
275
271
|
dispatch(tr);
|
|
276
272
|
var visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(_guidelines.PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth, excludeGuidelineConfig) : _guidelines.defaultGuidelines, containerWidth, lineLength, Boolean(isTableScalingEnabled), Boolean(isFullWidthModeEnabled));
|
|
277
273
|
setSnappingEnabled(displayGuideline(visibleGuidelines));
|
|
278
274
|
if (onResizeStart) {
|
|
279
275
|
onResizeStart();
|
|
280
276
|
}
|
|
281
|
-
}, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef,
|
|
277
|
+
}, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, isFullWidthModeEnabled, lineLength, containerWidth, excludeGuidelineConfig, displayGuideline, onResizeStart, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$u2 = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u2 === void 0 ? void 0 : _pluginInjectionApi$u2.commands]);
|
|
282
278
|
var handleResize = (0, _react.useCallback)(
|
|
283
279
|
// Ignored via go/ees005
|
|
284
280
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -326,7 +322,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
326
322
|
return (0, _rafSchd.default)(handleResize);
|
|
327
323
|
}, [handleResize]);
|
|
328
324
|
var handleResizeStop = (0, _react.useCallback)(function (originalState, delta) {
|
|
329
|
-
var _node$attrs$localId2, _node$attrs2;
|
|
325
|
+
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3;
|
|
330
326
|
isResizing.current = false;
|
|
331
327
|
var newWidth = originalState.width + delta.width;
|
|
332
328
|
var originalNewWidth = newWidth;
|
|
@@ -343,12 +339,9 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
343
339
|
tableRef: null
|
|
344
340
|
});
|
|
345
341
|
tr.setMeta('is-resizer-resizing', false);
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
tr: tr
|
|
350
|
-
});
|
|
351
|
-
}
|
|
342
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$u3 = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u3 === void 0 || _pluginInjectionApi$u3.commands.setCurrentUserIntent('default')({
|
|
343
|
+
tr: tr
|
|
344
|
+
});
|
|
352
345
|
var frameRateSamples = endMeasure();
|
|
353
346
|
if (frameRateSamples.length > 0) {
|
|
354
347
|
var resizeFrameRatePayloads = (0, _analytics2.generateResizeFrameRatePayloads)({
|
|
@@ -415,7 +408,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
415
408
|
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
416
409
|
}
|
|
417
410
|
return newWidth;
|
|
418
|
-
}, [editorView, getPos, node, isCommentEditor, widthToWidest,
|
|
411
|
+
}, [editorView, getPos, node, isCommentEditor, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage]);
|
|
419
412
|
var handleTableSizeChangeOnKeypress = (0, _react.useCallback)(function (step) {
|
|
420
413
|
var newWidth = width + step;
|
|
421
414
|
if (newWidth < resizerMinWidth) {
|
|
@@ -84,19 +84,17 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
84
84
|
// watch for changes
|
|
85
85
|
return localId === (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId);
|
|
86
86
|
},
|
|
87
|
-
onDragStart: function onDragStart(
|
|
88
|
-
var
|
|
87
|
+
onDragStart: function onDragStart() {
|
|
88
|
+
var _api$userIntent;
|
|
89
89
|
if ((0, _expValEquals.expValEquals)('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
|
|
90
90
|
var _insm$session3;
|
|
91
91
|
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
92
92
|
}
|
|
93
93
|
(0, _commands.toggleDragMenu)(false)(editorView.state, editorView.dispatch);
|
|
94
|
-
|
|
95
|
-
var _api$userIntent;
|
|
96
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('dragging'));
|
|
97
|
-
}
|
|
94
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('dragging'));
|
|
98
95
|
},
|
|
99
96
|
onDrag: function onDrag(event) {
|
|
97
|
+
var _api$userIntent2;
|
|
100
98
|
var data = (0, _monitor.getDraggableDataFromEvent)(event);
|
|
101
99
|
// If no data can be found then it's most like we do not want to perform any drag actions
|
|
102
100
|
if (!data) {
|
|
@@ -111,10 +109,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
111
109
|
var dropTargetType = sourceType === 'table-row' ? _consts.DropTargetType.ROW : _consts.DropTargetType.COLUMN;
|
|
112
110
|
var hasMergedCells = (0, _mergedCells.hasMergedCellsInBetween)([targetAdjustedIndex - 1, targetAdjustedIndex], dropTargetType)(editorView.state.selection);
|
|
113
111
|
(0, _commands.setDropTarget)(dropTargetType, targetAdjustedIndex, hasMergedCells)(editorView.state, editorView.dispatch);
|
|
114
|
-
|
|
115
|
-
var _api$userIntent2;
|
|
116
|
-
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.commands.setCurrentUserIntent('dragging'));
|
|
117
|
-
}
|
|
112
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.commands.setCurrentUserIntent('dragging'));
|
|
118
113
|
},
|
|
119
114
|
onDrop: function onDrop(event) {
|
|
120
115
|
var _cell$row, _cell$col, _api$userIntent3;
|
|
@@ -140,7 +135,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
140
135
|
}
|
|
141
136
|
};
|
|
142
137
|
tr.setMeta(_pluginKey.pluginKey, action);
|
|
143
|
-
if ((
|
|
138
|
+
if ((api === null || api === void 0 || (_api$userIntent3 = api.userIntent) === null || _api$userIntent3 === void 0 || (_api$userIntent3 = _api$userIntent3.sharedState.currentState()) === null || _api$userIntent3 === void 0 ? void 0 : _api$userIntent3.currentUserIntent) === 'dragging') {
|
|
144
139
|
var _api$userIntent4;
|
|
145
140
|
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$userIntent4 = api.userIntent) === null || _api$userIntent4 === void 0 ? void 0 : _api$userIntent4.commands.setCurrentUserIntent('default'));
|
|
146
141
|
}
|
|
@@ -226,7 +221,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
226
221
|
var isCommentEditor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
227
222
|
var api = arguments.length > 5 ? arguments[5] : undefined;
|
|
228
223
|
return new _safePlugin.SafePlugin({
|
|
229
|
-
state: (0, _pluginFactory2.createPluginState)(dispatch, function (
|
|
224
|
+
state: (0, _pluginFactory2.createPluginState)(dispatch, function () {
|
|
230
225
|
return {
|
|
231
226
|
decorationSet: _view.DecorationSet.empty,
|
|
232
227
|
dropTargetType: _consts.DropTargetType.NONE,
|
|
@@ -303,7 +298,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
303
298
|
return decorationSet;
|
|
304
299
|
},
|
|
305
300
|
handleKeyDown: function handleKeyDown(view, event) {
|
|
306
|
-
var
|
|
301
|
+
var _ref7;
|
|
307
302
|
var tr = view.state.tr;
|
|
308
303
|
var keysToTrapWhen = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];
|
|
309
304
|
|
|
@@ -327,7 +322,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, editor
|
|
|
327
322
|
var isDragHandleFocused = ['drag-handle-button-row', 'drag-handle-button-column'
|
|
328
323
|
// Ignored via go/ees005
|
|
329
324
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
330
|
-
].includes((
|
|
325
|
+
].includes((_ref7 = event.target || null) === null || _ref7 === void 0 ? void 0 : _ref7.id);
|
|
331
326
|
var keysToTrap = ['Enter', ' '];
|
|
332
327
|
var _getPluginState3 = (0, _pluginFactory2.getPluginState)(view.state),
|
|
333
328
|
_getPluginState3$isDr = _getPluginState3.isDragMenuOpen,
|
|
@@ -13,7 +13,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
13
13
|
var _resizer = require("@atlaskit/editor-common/resizer");
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
|
-
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
17
16
|
var _FloatingContextualButton = _interopRequireDefault(require("./FloatingContextualButton"));
|
|
18
17
|
var _FloatingContextualMenu = _interopRequireDefault(require("./FloatingContextualMenu"));
|
|
19
18
|
var _FloatingDeleteButton = _interopRequireDefault(require("./FloatingDeleteButton"));
|
|
@@ -148,7 +147,7 @@ var ContentComponentInternal = function ContentComponentInternal(_ref) {
|
|
|
148
147
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
149
148
|
isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
|
|
150
149
|
api: api,
|
|
151
|
-
isDragMenuOpen:
|
|
150
|
+
isDragMenuOpen: isDragMenuOpen
|
|
152
151
|
}), isDragAndDropEnabled && /*#__PURE__*/_react.default.createElement(_FloatingDragMenu.default, {
|
|
153
152
|
editorView: editorView,
|
|
154
153
|
mountPoint: popupsMountPoint,
|
|
@@ -38,9 +38,7 @@ var _tableColumnsDistribute = _interopRequireDefault(require("@atlaskit/icon/cor
|
|
|
38
38
|
var _tableRowAddBelow = _interopRequireDefault(require("@atlaskit/icon/core/table-row-add-below"));
|
|
39
39
|
var _tableRowDelete = _interopRequireDefault(require("@atlaskit/icon/core/table-row-delete"));
|
|
40
40
|
var _primitives = require("@atlaskit/primitives");
|
|
41
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
42
41
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
43
|
-
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
44
42
|
var _commands = require("../../pm-plugins/commands");
|
|
45
43
|
var _commandsWithAnalytics = require("../../pm-plugins/commands/commands-with-analytics");
|
|
46
44
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
@@ -728,14 +726,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
728
726
|
var _getPluginState11 = (0, _pluginFactory.getPluginState)(this.props.editorView.state),
|
|
729
727
|
isDragAndDropEnabled = _getPluginState11.isDragAndDropEnabled,
|
|
730
728
|
isContextualMenuOpen = _getPluginState11.isContextualMenuOpen;
|
|
731
|
-
if (isDragAndDropEnabled && this.props.isDragMenuOpen && isContextualMenuOpen
|
|
729
|
+
if (isDragAndDropEnabled && this.props.isDragMenuOpen && isContextualMenuOpen) {
|
|
732
730
|
(0, _commands.toggleContextualMenu)()(this.props.editorView.state, this.props.editorView.dispatch);
|
|
733
731
|
}
|
|
734
732
|
}
|
|
735
733
|
}, {
|
|
736
734
|
key: "render",
|
|
737
735
|
value: function render() {
|
|
738
|
-
var _this2 = this;
|
|
739
736
|
var _this$props13 = this.props,
|
|
740
737
|
isOpen = _this$props13.isOpen,
|
|
741
738
|
offset = _this$props13.offset,
|
|
@@ -748,47 +745,41 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
748
745
|
var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
|
|
749
746
|
var isOpenAllowed = false;
|
|
750
747
|
isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
return (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
|
|
787
|
-
userIntent: "tableContextualMenuPopupOpen",
|
|
788
|
-
api: api
|
|
789
|
-
}, popupContent());
|
|
790
|
-
}
|
|
791
|
-
return popupContent();
|
|
748
|
+
return (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
|
|
749
|
+
userIntent: "tableContextualMenuPopupOpen",
|
|
750
|
+
api: api
|
|
751
|
+
}, (0, _react2.jsx)("div", {
|
|
752
|
+
"data-testid": "table-cell-contextual-menu"
|
|
753
|
+
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
754
|
+
,
|
|
755
|
+
onMouseLeave: this.closeSubmenu,
|
|
756
|
+
ref: this.dropdownMenuRef
|
|
757
|
+
}, (0, _react2.jsx)(_uiMenu.DropdownMenu
|
|
758
|
+
//This needs be removed when the a11y is completely handled
|
|
759
|
+
//Disabling key navigation now as it works only partially
|
|
760
|
+
, {
|
|
761
|
+
arrowKeyNavigationProviderOptions: {
|
|
762
|
+
type: _uiMenu.ArrowKeyNavigationType.MENU,
|
|
763
|
+
disableArrowKeyNavigation: !isCellMenuOpenByKeyboard || this.state.isSubmenuOpen
|
|
764
|
+
},
|
|
765
|
+
items: items,
|
|
766
|
+
isOpen: isOpenAllowed,
|
|
767
|
+
onOpenChange: this.handleOpenChange,
|
|
768
|
+
onItemActivated: this.onMenuItemActivated,
|
|
769
|
+
onMouseEnter: this.handleItemMouseEnter,
|
|
770
|
+
onMouseLeave: this.handleItemMouseLeave,
|
|
771
|
+
fitHeight: 188,
|
|
772
|
+
fitWidth: isDragAndDropEnabled ? _consts.contextualMenuDropdownWidthDnD : _consts.contextualMenuDropdownWidth,
|
|
773
|
+
shouldFocusFirstItem: function shouldFocusFirstItem() {
|
|
774
|
+
return Boolean(isCellMenuOpenByKeyboard);
|
|
775
|
+
},
|
|
776
|
+
boundariesElement: boundariesElement,
|
|
777
|
+
offset: offset,
|
|
778
|
+
section: isDragAndDropEnabled ? {
|
|
779
|
+
hasSeparator: true
|
|
780
|
+
} : undefined,
|
|
781
|
+
allowEnterDefaultBehavior: this.state.isSubmenuOpen
|
|
782
|
+
})));
|
|
792
783
|
}
|
|
793
784
|
}]);
|
|
794
785
|
}(_react.Component);
|
|
@@ -11,7 +11,6 @@ var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
12
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
13
13
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
|
-
var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
|
|
15
14
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
16
15
|
var _consts = require("../consts");
|
|
17
16
|
var _ContextualMenu = _interopRequireDefault(require("./ContextualMenu"));
|
|
@@ -37,8 +36,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
37
36
|
getEditorFeatureFlags = _ref.getEditorFeatureFlags,
|
|
38
37
|
isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard,
|
|
39
38
|
isCommentEditor = _ref.isCommentEditor,
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
api = _ref.api,
|
|
40
|
+
isDragMenuOpen = _ref.isDragMenuOpen;
|
|
42
41
|
if ((0, _expValEquals.expValEquals)('platform_editor_hydratable_ui', 'isEnabled', true) && !editorView) {
|
|
43
42
|
return null;
|
|
44
43
|
}
|
|
@@ -120,7 +119,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
120
119
|
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard,
|
|
121
120
|
isCommentEditor: isCommentEditor,
|
|
122
121
|
api: api,
|
|
123
|
-
isDragMenuOpen:
|
|
122
|
+
isDragMenuOpen: isDragMenuOpen
|
|
124
123
|
})));
|
|
125
124
|
};
|
|
126
125
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -26,7 +26,6 @@ var _paintBucket = _interopRequireDefault(require("@atlaskit/icon/core/paint-buc
|
|
|
26
26
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
27
|
var _primitives = require("@atlaskit/primitives");
|
|
28
28
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
29
|
-
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
30
29
|
var _toggle = _interopRequireDefault(require("@atlaskit/toggle"));
|
|
31
30
|
var _commands = require("../../pm-plugins/commands");
|
|
32
31
|
var _commandsWithAnalytics = require("../../pm-plugins/commands/commands-with-analytics");
|
|
@@ -239,7 +238,6 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
239
238
|
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
|
|
240
239
|
menuItems = _convertToDropdownIte.menuItems,
|
|
241
240
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
242
|
-
var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
|
|
243
241
|
var handleSubMenuRef = function handleSubMenuRef(ref) {
|
|
244
242
|
// Ignored via go/ees005
|
|
245
243
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -569,7 +567,10 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
569
567
|
items: [createRowNumbersMenuItem()]
|
|
570
568
|
});
|
|
571
569
|
}
|
|
572
|
-
|
|
570
|
+
return (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
|
|
571
|
+
api: api,
|
|
572
|
+
userIntent: "tableDragMenuPopupOpen"
|
|
573
|
+
}, (0, _react2.jsx)(_DropdownMenu.DropdownMenu, {
|
|
573
574
|
disableKeyboardHandling: isSubmenuOpen,
|
|
574
575
|
section: {
|
|
575
576
|
hasSeparator: true
|
|
@@ -584,10 +585,6 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
584
585
|
direction: direction,
|
|
585
586
|
boundariesElement: boundariesElement,
|
|
586
587
|
scrollableElement: scrollableElement
|
|
587
|
-
});
|
|
588
|
-
return isToolbarAIFCEnabled || (0, _expValEquals.expValEquals)('platform_editor_lovability_user_intent', 'isEnabled', true) ? (0, _react2.jsx)(_userIntent.UserIntentPopupWrapper, {
|
|
589
|
-
api: api,
|
|
590
|
-
userIntent: (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_user_intent', 'isEnabled', true) ? 'tableDragMenuPopupOpen' : undefined
|
|
591
|
-
}, Menu) : Menu;
|
|
588
|
+
}));
|
|
592
589
|
});
|
|
593
590
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(DragMenu);
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -438,12 +438,10 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(getE
|
|
|
438
438
|
// won't be suppressed.
|
|
439
439
|
var shouldSuppressAllToolbars = isTableState && pluginState.editorHasFocus && !isViewMode;
|
|
440
440
|
if (shouldSuppressAllToolbars) {
|
|
441
|
-
var userIntentEnabled = Boolean((api === null || api === void 0 ? void 0 : api.userIntent) && (0, _expValEquals.expValEquals)('platform_editor_lovability_user_intent', 'isEnabled', true));
|
|
442
441
|
return {
|
|
443
442
|
title: toolbarTitle,
|
|
444
443
|
items: [],
|
|
445
|
-
nodeType: nodeType
|
|
446
|
-
__suppressAllToolbars: userIntentEnabled ? undefined : true
|
|
444
|
+
nodeType: nodeType
|
|
447
445
|
};
|
|
448
446
|
}
|
|
449
447
|
}
|
|
@@ -20,8 +20,10 @@ const InnerContainer = /*#__PURE__*/forwardRef(({
|
|
|
20
20
|
className,
|
|
21
21
|
style,
|
|
22
22
|
node,
|
|
23
|
-
children
|
|
23
|
+
children,
|
|
24
|
+
tableWrapperHeight
|
|
24
25
|
}, ref) => {
|
|
26
|
+
const bordersReady = expValEquals('platform_editor_table_borders_ready_fix', 'isEnabled', true) ? tableWrapperHeight !== undefined && tableWrapperHeight > 0 : undefined;
|
|
25
27
|
return /*#__PURE__*/React.createElement("div", {
|
|
26
28
|
ref: ref
|
|
27
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
@@ -32,6 +34,7 @@ const InnerContainer = /*#__PURE__*/forwardRef(({
|
|
|
32
34
|
className: className,
|
|
33
35
|
"data-number-column": node.attrs.isNumberColumnEnabled,
|
|
34
36
|
"data-layout": node.attrs.layout,
|
|
37
|
+
"data-borders-ready": bordersReady,
|
|
35
38
|
"data-testid": "table-container"
|
|
36
39
|
}, children);
|
|
37
40
|
});
|
|
@@ -329,9 +332,12 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
329
332
|
ref: containerRef
|
|
330
333
|
}, /*#__PURE__*/React.createElement(TableResizer, _extends({}, tableResizerProps, {
|
|
331
334
|
disabled: isLivePageViewMode
|
|
332
|
-
}), /*#__PURE__*/React.createElement(InnerContainer
|
|
335
|
+
}), /*#__PURE__*/React.createElement(InnerContainer
|
|
336
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
337
|
+
, {
|
|
333
338
|
className: className,
|
|
334
|
-
node: node
|
|
339
|
+
node: node,
|
|
340
|
+
tableWrapperHeight: tableWrapperHeight
|
|
335
341
|
}, children))));
|
|
336
342
|
});
|
|
337
343
|
export const TableContainer = ({
|
|
@@ -393,7 +399,8 @@ export const TableContainer = ({
|
|
|
393
399
|
const isFullPageAppearance = !isCommentEditor && !isChromelessEditor;
|
|
394
400
|
const resizableTableWidth = isFullPageAppearance ? getTableResizerContainerForFullPageWidthInCSS(node, isTableScalingEnabled) : `calc(100cqw - calc(var(--ak-editor--large-gutter-padding) * 2))`;
|
|
395
401
|
return /*#__PURE__*/React.createElement(InnerContainer, {
|
|
396
|
-
node: node
|
|
402
|
+
node: node,
|
|
403
|
+
tableWrapperHeight: tableWrapperHeight
|
|
397
404
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
398
405
|
,
|
|
399
406
|
className: classNames(className, {
|
|
@@ -15,7 +15,6 @@ import { akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFul
|
|
|
15
15
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
16
16
|
import { insm } from '@atlaskit/insm';
|
|
17
17
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
|
-
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
19
18
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
19
|
import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
|
|
21
20
|
import { updateWidthToWidest } from '../pm-plugins/commands/misc';
|
|
@@ -149,7 +148,6 @@ export const TableResizer = ({
|
|
|
149
148
|
const {
|
|
150
149
|
formatMessage
|
|
151
150
|
} = useIntl();
|
|
152
|
-
const isToolbarAIFCEnabled = Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar);
|
|
153
151
|
const currentSelection = (_editorView$state = editorView.state) === null || _editorView$state === void 0 ? void 0 : _editorView$state.selection;
|
|
154
152
|
const tableFromSelection = useMemo(() => {
|
|
155
153
|
return findTable(currentSelection);
|
|
@@ -237,6 +235,7 @@ export const TableResizer = ({
|
|
|
237
235
|
};
|
|
238
236
|
}, [editorView, displayGuideline, displayGapCursor]);
|
|
239
237
|
const handleResizeStart = useCallback(() => {
|
|
238
|
+
var _pluginInjectionApi$u;
|
|
240
239
|
if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
|
|
241
240
|
var _insm$session;
|
|
242
241
|
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableResize');
|
|
@@ -259,19 +258,16 @@ export const TableResizer = ({
|
|
|
259
258
|
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
260
259
|
name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED
|
|
261
260
|
});
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
tr
|
|
266
|
-
});
|
|
267
|
-
}
|
|
261
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$u = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u === void 0 ? void 0 : _pluginInjectionApi$u.commands.setCurrentUserIntent('resizing')({
|
|
262
|
+
tr
|
|
263
|
+
});
|
|
268
264
|
dispatch(tr);
|
|
269
265
|
const visibleGuidelines = getVisibleGuidelines(isTableScalingEnabled ? defaultGuidelinesForPreserveTable(PRESERVE_TABLE_GUIDELINES_LENGTH_OFFSET, isFullWidthModeEnabled ? lineLength + 2 * getPadding(containerWidth) : containerWidth, excludeGuidelineConfig) : defaultGuidelines, containerWidth, lineLength, Boolean(isTableScalingEnabled), Boolean(isFullWidthModeEnabled));
|
|
270
266
|
setSnappingEnabled(displayGuideline(visibleGuidelines));
|
|
271
267
|
if (onResizeStart) {
|
|
272
268
|
onResizeStart();
|
|
273
269
|
}
|
|
274
|
-
}, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef,
|
|
270
|
+
}, [startMeasure, editorView, displayGapCursor, node.attrs.localId, tableRef, isTableScalingEnabled, isFullWidthModeEnabled, lineLength, containerWidth, excludeGuidelineConfig, displayGuideline, onResizeStart, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$u2 = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u2 === void 0 ? void 0 : _pluginInjectionApi$u2.commands]);
|
|
275
271
|
const handleResize = useCallback(
|
|
276
272
|
// Ignored via go/ees005
|
|
277
273
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -319,7 +315,7 @@ export const TableResizer = ({
|
|
|
319
315
|
}, [countFrames, isCommentEditor, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
|
|
320
316
|
const scheduleResize = useMemo(() => rafSchd(handleResize), [handleResize]);
|
|
321
317
|
const handleResizeStop = useCallback((originalState, delta) => {
|
|
322
|
-
var _node$attrs$localId2, _node$attrs2;
|
|
318
|
+
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3;
|
|
323
319
|
isResizing.current = false;
|
|
324
320
|
let newWidth = originalState.width + delta.width;
|
|
325
321
|
const originalNewWidth = newWidth;
|
|
@@ -338,12 +334,9 @@ export const TableResizer = ({
|
|
|
338
334
|
tableRef: null
|
|
339
335
|
});
|
|
340
336
|
tr.setMeta('is-resizer-resizing', false);
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
tr
|
|
345
|
-
});
|
|
346
|
-
}
|
|
337
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$u3 = pluginInjectionApi.userIntent) === null || _pluginInjectionApi$u3 === void 0 ? void 0 : _pluginInjectionApi$u3.commands.setCurrentUserIntent('default')({
|
|
338
|
+
tr
|
|
339
|
+
});
|
|
347
340
|
const frameRateSamples = endMeasure();
|
|
348
341
|
if (frameRateSamples.length > 0) {
|
|
349
342
|
const resizeFrameRatePayloads = generateResizeFrameRatePayloads({
|
|
@@ -411,7 +404,7 @@ export const TableResizer = ({
|
|
|
411
404
|
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableResize');
|
|
412
405
|
}
|
|
413
406
|
return newWidth;
|
|
414
|
-
}, [editorView, getPos, node, isCommentEditor, widthToWidest,
|
|
407
|
+
}, [editorView, getPos, node, isCommentEditor, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage]);
|
|
415
408
|
const handleTableSizeChangeOnKeypress = useCallback(step => {
|
|
416
409
|
const newWidth = width + step;
|
|
417
410
|
if (newWidth < resizerMinWidth) {
|
|
@@ -85,20 +85,17 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
85
85
|
// watch for changes
|
|
86
86
|
return localId === (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId);
|
|
87
87
|
},
|
|
88
|
-
onDragStart: ({
|
|
89
|
-
|
|
90
|
-
}) => {
|
|
88
|
+
onDragStart: () => {
|
|
89
|
+
var _api$userIntent;
|
|
91
90
|
if (expValEquals('cc_editor_interactivity_monitoring', 'isEnabled', true)) {
|
|
92
91
|
var _insm$session3;
|
|
93
92
|
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 ? void 0 : _insm$session3.startFeature('tableDragAndDrop');
|
|
94
93
|
}
|
|
95
94
|
toggleDragMenu(false)(editorView.state, editorView.dispatch);
|
|
96
|
-
|
|
97
|
-
var _api$userIntent;
|
|
98
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('dragging'));
|
|
99
|
-
}
|
|
95
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('dragging'));
|
|
100
96
|
},
|
|
101
97
|
onDrag(event) {
|
|
98
|
+
var _api$userIntent2;
|
|
102
99
|
const data = getDraggableDataFromEvent(event);
|
|
103
100
|
// If no data can be found then it's most like we do not want to perform any drag actions
|
|
104
101
|
if (!data) {
|
|
@@ -115,10 +112,7 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
115
112
|
const dropTargetType = sourceType === 'table-row' ? DropTargetType.ROW : DropTargetType.COLUMN;
|
|
116
113
|
const hasMergedCells = hasMergedCellsInBetween([targetAdjustedIndex - 1, targetAdjustedIndex], dropTargetType)(editorView.state.selection);
|
|
117
114
|
setDropTarget(dropTargetType, targetAdjustedIndex, hasMergedCells)(editorView.state, editorView.dispatch);
|
|
118
|
-
|
|
119
|
-
var _api$userIntent2;
|
|
120
|
-
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.commands.setCurrentUserIntent('dragging'));
|
|
121
|
-
}
|
|
115
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent2 = api.userIntent) === null || _api$userIntent2 === void 0 ? void 0 : _api$userIntent2.commands.setCurrentUserIntent('dragging'));
|
|
122
116
|
},
|
|
123
117
|
onDrop(event) {
|
|
124
118
|
var _cell$row, _cell$col, _api$userIntent3, _api$userIntent3$shar;
|
|
@@ -145,7 +139,7 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
145
139
|
}
|
|
146
140
|
};
|
|
147
141
|
tr.setMeta(tablePluginKey, action);
|
|
148
|
-
if (
|
|
142
|
+
if ((api === null || api === void 0 ? void 0 : (_api$userIntent3 = api.userIntent) === null || _api$userIntent3 === void 0 ? void 0 : (_api$userIntent3$shar = _api$userIntent3.sharedState.currentState()) === null || _api$userIntent3$shar === void 0 ? void 0 : _api$userIntent3$shar.currentUserIntent) === 'dragging') {
|
|
149
143
|
var _api$userIntent4;
|
|
150
144
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$userIntent4 = api.userIntent) === null || _api$userIntent4 === void 0 ? void 0 : _api$userIntent4.commands.setCurrentUserIntent('default'));
|
|
151
145
|
}
|
|
@@ -230,7 +224,7 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
230
224
|
};
|
|
231
225
|
export const createPlugin = (dispatch, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false, api) => {
|
|
232
226
|
return new SafePlugin({
|
|
233
|
-
state: createPluginState(dispatch,
|
|
227
|
+
state: createPluginState(dispatch, () => ({
|
|
234
228
|
decorationSet: DecorationSet.empty,
|
|
235
229
|
dropTargetType: DropTargetType.NONE,
|
|
236
230
|
dropTargetIndex: 0,
|