@atlaskit/editor-plugin-table 24.4.0 → 24.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/nodeviews/TableResizer.js +4 -10
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +12 -25
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +10 -22
- package/dist/es2019/nodeviews/TableResizer.js +4 -10
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +12 -25
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +10 -22
- package/dist/esm/nodeviews/TableResizer.js +4 -10
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +12 -25
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +10 -22
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 24.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 24.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`0e797fd81675f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e797fd81675f) -
|
|
14
|
+
Cleaning up interactivity monitoring experiment
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 24.4.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -257,11 +257,8 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
257
257
|
};
|
|
258
258
|
}, [editorView, displayGuideline, displayGapCursor]);
|
|
259
259
|
var handleResizeStart = (0, _react.useCallback)(function () {
|
|
260
|
-
var _pluginInjectionApi$u;
|
|
261
|
-
|
|
262
|
-
var _insm$session;
|
|
263
|
-
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableResize');
|
|
264
|
-
}
|
|
260
|
+
var _insm$session, _pluginInjectionApi$u;
|
|
261
|
+
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableResize');
|
|
265
262
|
startMeasure();
|
|
266
263
|
isResizing.current = true;
|
|
267
264
|
var dispatch = editorView.dispatch,
|
|
@@ -333,7 +330,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
333
330
|
return (0, _rafSchd.default)(handleResize);
|
|
334
331
|
}, [handleResize]);
|
|
335
332
|
var handleResizeStop = (0, _react.useCallback)(function (originalState, delta) {
|
|
336
|
-
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3;
|
|
333
|
+
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3, _insm$session2;
|
|
337
334
|
isResizing.current = false;
|
|
338
335
|
var newWidth = originalState.width + delta.width;
|
|
339
336
|
var originalNewWidth = newWidth;
|
|
@@ -414,10 +411,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
414
411
|
if (onResizeStop) {
|
|
415
412
|
onResizeStop();
|
|
416
413
|
}
|
|
417
|
-
|
|
418
|
-
var _insm$session2;
|
|
419
|
-
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
420
|
-
}
|
|
414
|
+
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
421
415
|
return newWidth;
|
|
422
416
|
}, [editorView, getPos, node, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage, isFullPageAppearance]);
|
|
423
417
|
var handleTableSizeChangeOnKeypress = (0, _react.useCallback)(function (step) {
|
|
@@ -39,20 +39,16 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
39
39
|
return type === 'table-row';
|
|
40
40
|
},
|
|
41
41
|
onDragStart: function onDragStart() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
|
|
45
|
-
}
|
|
42
|
+
var _insm$session;
|
|
43
|
+
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
|
|
46
44
|
// auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
|
|
47
45
|
// Ignored via go/ees005
|
|
48
46
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
49
47
|
editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
|
|
50
48
|
},
|
|
51
49
|
onDrop: function onDrop() {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
|
|
55
|
-
}
|
|
50
|
+
var _insm$session2;
|
|
51
|
+
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
|
|
56
52
|
// 'null' will remove the inline style
|
|
57
53
|
// Ignored via go/ees005
|
|
58
54
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -88,10 +84,8 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
88
84
|
return localId === (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId);
|
|
89
85
|
},
|
|
90
86
|
onDragStart: function onDragStart() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
94
|
-
}
|
|
87
|
+
var _insm$session3;
|
|
88
|
+
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
95
89
|
if ((0, _expValEquals.expValEquals)('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
96
90
|
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
|
97
91
|
var _api$userIntent;
|
|
@@ -160,13 +154,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
160
154
|
}
|
|
161
155
|
// If no data can be found then it's most like we do not want to perform any drop action
|
|
162
156
|
if (!data) {
|
|
163
|
-
var _event$source, _event$source2;
|
|
157
|
+
var _insm$session4, _event$source, _event$source2;
|
|
164
158
|
// If we're able to determine the source type of the dropped element then we should report to analytics that
|
|
165
159
|
// the drop event was cancelled. Otherwise we will cancel silently.
|
|
166
|
-
|
|
167
|
-
var _insm$session4;
|
|
168
|
-
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
|
|
169
|
-
}
|
|
160
|
+
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
|
|
170
161
|
if ((event === null || event === void 0 || (_event$source = event.source) === null || _event$source === void 0 || (_event$source = _event$source.data) === null || _event$source === void 0 ? void 0 : _event$source.type) === 'table-row' || (event === null || event === void 0 || (_event$source2 = event.source) === null || _event$source2 === void 0 || (_event$source2 = _event$source2.data) === null || _event$source2 === void 0 ? void 0 : _event$source2.type) === 'table-column') {
|
|
171
162
|
var _event$source$data;
|
|
172
163
|
return (0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data = event.source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.indexes, _analytics.TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
|
|
@@ -190,16 +181,15 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
190
181
|
|
|
191
182
|
// If the drop target index contains merged cells then we should not allow the drop to occur.
|
|
192
183
|
if ((0, _mergedCells.hasMergedCellsInBetween)([targetAdjustedIndex - 1, targetAdjustedIndex], sourceType === 'table-row' ? _consts.DropTargetType.ROW : _consts.DropTargetType.COLUMN)(editorView.state.selection)) {
|
|
184
|
+
var _insm$session5;
|
|
193
185
|
(0, _commandsWithAnalytics.clearDropTargetWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
|
|
194
186
|
// This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
|
|
195
187
|
_analytics.TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
|
|
196
|
-
|
|
197
|
-
var _insm$session5;
|
|
198
|
-
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
|
|
199
|
-
}
|
|
188
|
+
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
|
|
200
189
|
return;
|
|
201
190
|
}
|
|
202
191
|
requestAnimationFrame(function () {
|
|
192
|
+
var _insm$session6;
|
|
203
193
|
if (behaviour === 'clone') {
|
|
204
194
|
(0, _commandsWithAnalytics.cloneSourceWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes, targetIndex, targetDirection, tr)(editorView.state, editorView.dispatch);
|
|
205
195
|
} else {
|
|
@@ -226,10 +216,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
226
216
|
}
|
|
227
217
|
}
|
|
228
218
|
editorView.focus();
|
|
229
|
-
|
|
230
|
-
var _insm$session6;
|
|
231
|
-
(_insm$session6 = _insm.insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
|
|
232
|
-
}
|
|
219
|
+
(_insm$session6 = _insm.insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
|
|
233
220
|
});
|
|
234
221
|
}
|
|
235
222
|
})]));
|
|
@@ -9,7 +9,6 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
9
9
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
11
|
var _insm = require("@atlaskit/insm");
|
|
12
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
12
|
var _columnResize = require("../commands/column-resize");
|
|
14
13
|
var _misc = require("../commands/misc");
|
|
15
14
|
var _pluginFactory = require("../plugin-factory");
|
|
@@ -25,7 +24,7 @@ var _misc2 = require("./utils/misc");
|
|
|
25
24
|
var _resizeColumn = require("./utils/resize-column");
|
|
26
25
|
var _resizeState = require("./utils/resize-state");
|
|
27
26
|
var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isCommentEditor) {
|
|
28
|
-
var _originalTable$attrs;
|
|
27
|
+
var _insm$session, _originalTable$attrs;
|
|
29
28
|
var state = view.state,
|
|
30
29
|
dispatch = view.dispatch;
|
|
31
30
|
var editorDisabled = !view.editable;
|
|
@@ -38,10 +37,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
38
37
|
var _getTablePluginState = (0, _pluginFactory.getPluginState)(state),
|
|
39
38
|
isKeyboardResize = _getTablePluginState.isKeyboardResize;
|
|
40
39
|
event.preventDefault();
|
|
41
|
-
|
|
42
|
-
var _insm$session;
|
|
43
|
-
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableColumnResize');
|
|
44
|
-
}
|
|
40
|
+
(_insm$session = _insm.insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableColumnResize');
|
|
45
41
|
var tr = view.state.tr;
|
|
46
42
|
tr.setMeta(_tableAnalytics.META_KEYS.OVERFLOW_TRIGGER, {
|
|
47
43
|
name: _analytics.TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED_COLUMN
|
|
@@ -132,17 +128,13 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
132
128
|
var _getTablePluginState2 = (0, _pluginFactory.getPluginState)(state),
|
|
133
129
|
isTableHovered = _getTablePluginState2.isTableHovered;
|
|
134
130
|
if (resizeHandlePos === null) {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableColumnResize');
|
|
138
|
-
}
|
|
131
|
+
var _insm$session2;
|
|
132
|
+
(_insm$session2 = _insm.insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableColumnResize');
|
|
139
133
|
return (0, _commands.stopResizing)()(state, dispatch);
|
|
140
134
|
}
|
|
141
135
|
if (!(0, _misc2.pointsAtCell)(state.doc.resolve(resizeHandlePos))) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.endFeature('tableColumnResize');
|
|
145
|
-
}
|
|
136
|
+
var _insm$session3;
|
|
137
|
+
(_insm$session3 = _insm.insm.session) === null || _insm$session3 === void 0 || _insm$session3.endFeature('tableColumnResize');
|
|
146
138
|
return;
|
|
147
139
|
}
|
|
148
140
|
// resizeHandlePos could be remapped via a collab change.
|
|
@@ -155,10 +147,8 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
155
147
|
|
|
156
148
|
// If we let go in the same place we started, don't need to do anything.
|
|
157
149
|
if (dragging && clientX === dragging.startX) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableColumnResize');
|
|
161
|
-
}
|
|
150
|
+
var _insm$session4;
|
|
151
|
+
(_insm$session4 = _insm.insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableColumnResize');
|
|
162
152
|
if (isKeyboardResize || !isTableHovered) {
|
|
163
153
|
/** if column resize had started via keyboard but continued by mouse
|
|
164
154
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -170,6 +160,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
170
160
|
}
|
|
171
161
|
var tr = state.tr;
|
|
172
162
|
if (dragging) {
|
|
163
|
+
var _insm$session5;
|
|
173
164
|
var startX = dragging.startX;
|
|
174
165
|
|
|
175
166
|
// If the dimensions of the table have changed through a remote modification by another
|
|
@@ -225,10 +216,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
225
216
|
}
|
|
226
217
|
})(tr);
|
|
227
218
|
}
|
|
228
|
-
|
|
229
|
-
var _insm$session5;
|
|
230
|
-
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableColumnResize');
|
|
231
|
-
}
|
|
219
|
+
(_insm$session5 = _insm.insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableColumnResize');
|
|
232
220
|
if (isKeyboardResize || !isTableHovered) {
|
|
233
221
|
/** if column resize had started via keyboard but continued by mouse
|
|
234
222
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -246,11 +246,8 @@ export const TableResizer = ({
|
|
|
246
246
|
};
|
|
247
247
|
}, [editorView, displayGuideline, displayGapCursor]);
|
|
248
248
|
const handleResizeStart = useCallback(() => {
|
|
249
|
-
var _pluginInjectionApi$u;
|
|
250
|
-
|
|
251
|
-
var _insm$session;
|
|
252
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableResize');
|
|
253
|
-
}
|
|
249
|
+
var _insm$session, _pluginInjectionApi$u;
|
|
250
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableResize');
|
|
254
251
|
startMeasure();
|
|
255
252
|
isResizing.current = true;
|
|
256
253
|
const {
|
|
@@ -326,7 +323,7 @@ export const TableResizer = ({
|
|
|
326
323
|
}, [countFrames, isCommentEditor, isChromelessEditor, isFullPageAppearance, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
|
|
327
324
|
const scheduleResize = useMemo(() => rafSchd(handleResize), [handleResize]);
|
|
328
325
|
const handleResizeStop = useCallback((originalState, delta) => {
|
|
329
|
-
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3;
|
|
326
|
+
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3, _insm$session2;
|
|
330
327
|
isResizing.current = false;
|
|
331
328
|
let newWidth = originalState.width + delta.width;
|
|
332
329
|
const originalNewWidth = newWidth;
|
|
@@ -410,10 +407,7 @@ export const TableResizer = ({
|
|
|
410
407
|
if (onResizeStop) {
|
|
411
408
|
onResizeStop();
|
|
412
409
|
}
|
|
413
|
-
|
|
414
|
-
var _insm$session2;
|
|
415
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableResize');
|
|
416
|
-
}
|
|
410
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableResize');
|
|
417
411
|
return newWidth;
|
|
418
412
|
}, [editorView, getPos, node, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage, isFullPageAppearance]);
|
|
419
413
|
const handleTableSizeChangeOnKeypress = useCallback(step => {
|
|
@@ -35,20 +35,16 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
35
35
|
return type === 'table-row';
|
|
36
36
|
},
|
|
37
37
|
onDragStart() {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableDragAndDrop');
|
|
41
|
-
}
|
|
38
|
+
var _insm$session;
|
|
39
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableDragAndDrop');
|
|
42
40
|
// auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
|
|
43
41
|
// Ignored via go/ees005
|
|
44
42
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
45
43
|
editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
|
|
46
44
|
},
|
|
47
45
|
onDrop() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableDragAndDrop');
|
|
51
|
-
}
|
|
46
|
+
var _insm$session2;
|
|
47
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableDragAndDrop');
|
|
52
48
|
// 'null' will remove the inline style
|
|
53
49
|
// Ignored via go/ees005
|
|
54
50
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -89,10 +85,8 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
89
85
|
return localId === (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId);
|
|
90
86
|
},
|
|
91
87
|
onDragStart: () => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 ? void 0 : _insm$session3.startFeature('tableDragAndDrop');
|
|
95
|
-
}
|
|
88
|
+
var _insm$session3;
|
|
89
|
+
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 ? void 0 : _insm$session3.startFeature('tableDragAndDrop');
|
|
96
90
|
if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
97
91
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(({
|
|
98
92
|
tr
|
|
@@ -165,13 +159,10 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
165
159
|
}
|
|
166
160
|
// If no data can be found then it's most like we do not want to perform any drop action
|
|
167
161
|
if (!data) {
|
|
168
|
-
var _event$source, _event$source$data, _event$source2, _event$source2$data;
|
|
162
|
+
var _insm$session4, _event$source, _event$source$data, _event$source2, _event$source2$data;
|
|
169
163
|
// If we're able to determine the source type of the dropped element then we should report to analytics that
|
|
170
164
|
// the drop event was cancelled. Otherwise we will cancel silently.
|
|
171
|
-
|
|
172
|
-
var _insm$session4;
|
|
173
|
-
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 ? void 0 : _insm$session4.endFeature('tableDragAndDrop');
|
|
174
|
-
}
|
|
165
|
+
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 ? void 0 : _insm$session4.endFeature('tableDragAndDrop');
|
|
175
166
|
if ((event === null || event === void 0 ? void 0 : (_event$source = event.source) === null || _event$source === void 0 ? void 0 : (_event$source$data = _event$source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.type) === 'table-row' || (event === null || event === void 0 ? void 0 : (_event$source2 = event.source) === null || _event$source2 === void 0 ? void 0 : (_event$source2$data = _event$source2.data) === null || _event$source2$data === void 0 ? void 0 : _event$source2$data.type) === 'table-column') {
|
|
176
167
|
var _event$source$data2;
|
|
177
168
|
return clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data2 = event.source.data) === null || _event$source$data2 === void 0 ? void 0 : _event$source$data2.indexes, TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
|
|
@@ -197,16 +188,15 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
197
188
|
|
|
198
189
|
// If the drop target index contains merged cells then we should not allow the drop to occur.
|
|
199
190
|
if (hasMergedCellsInBetween([targetAdjustedIndex - 1, targetAdjustedIndex], sourceType === 'table-row' ? DropTargetType.ROW : DropTargetType.COLUMN)(editorView.state.selection)) {
|
|
191
|
+
var _insm$session5;
|
|
200
192
|
clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
|
|
201
193
|
// This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
|
|
202
194
|
TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
|
|
203
|
-
|
|
204
|
-
var _insm$session5;
|
|
205
|
-
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 ? void 0 : _insm$session5.endFeature('tableDragAndDrop');
|
|
206
|
-
}
|
|
195
|
+
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 ? void 0 : _insm$session5.endFeature('tableDragAndDrop');
|
|
207
196
|
return;
|
|
208
197
|
}
|
|
209
198
|
requestAnimationFrame(() => {
|
|
199
|
+
var _insm$session6;
|
|
210
200
|
if (behaviour === 'clone') {
|
|
211
201
|
cloneSourceWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes, targetIndex, targetDirection, tr)(editorView.state, editorView.dispatch);
|
|
212
202
|
} else {
|
|
@@ -234,10 +224,7 @@ const destroyFn = (editorView, editorAnalyticsAPI, isTableScalingEnabled, isTabl
|
|
|
234
224
|
}
|
|
235
225
|
}
|
|
236
226
|
editorView.focus();
|
|
237
|
-
|
|
238
|
-
var _insm$session6;
|
|
239
|
-
(_insm$session6 = insm.session) === null || _insm$session6 === void 0 ? void 0 : _insm$session6.endFeature('tableDragAndDrop');
|
|
240
|
-
}
|
|
227
|
+
(_insm$session6 = insm.session) === null || _insm$session6 === void 0 ? void 0 : _insm$session6.endFeature('tableDragAndDrop');
|
|
241
228
|
});
|
|
242
229
|
}
|
|
243
230
|
}));
|
|
@@ -3,7 +3,6 @@ import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
|
3
3
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
4
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { insm } from '@atlaskit/insm';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
import { stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
8
7
|
import { updateResizeHandleDecorations } from '../commands/misc';
|
|
9
8
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
@@ -19,7 +18,7 @@ import { currentColWidth, getTableMaxWidth, pointsAtCell, getScalingPercentForTa
|
|
|
19
18
|
import { resizeColumn } from './utils/resize-column';
|
|
20
19
|
import { getResizeState } from './utils/resize-state';
|
|
21
20
|
export const handleMouseDown = (view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isCommentEditor) => {
|
|
22
|
-
var _originalTable$attrs;
|
|
21
|
+
var _insm$session, _originalTable$attrs;
|
|
23
22
|
const {
|
|
24
23
|
state,
|
|
25
24
|
dispatch
|
|
@@ -36,10 +35,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
36
35
|
isKeyboardResize
|
|
37
36
|
} = getTablePluginState(state);
|
|
38
37
|
event.preventDefault();
|
|
39
|
-
|
|
40
|
-
var _insm$session;
|
|
41
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableColumnResize');
|
|
42
|
-
}
|
|
38
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 ? void 0 : _insm$session.startFeature('tableColumnResize');
|
|
43
39
|
const tr = view.state.tr;
|
|
44
40
|
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
45
41
|
name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED_COLUMN
|
|
@@ -136,17 +132,13 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
136
132
|
isTableHovered
|
|
137
133
|
} = getTablePluginState(state);
|
|
138
134
|
if (resizeHandlePos === null) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableColumnResize');
|
|
142
|
-
}
|
|
135
|
+
var _insm$session2;
|
|
136
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 ? void 0 : _insm$session2.endFeature('tableColumnResize');
|
|
143
137
|
return stopResizing()(state, dispatch);
|
|
144
138
|
}
|
|
145
139
|
if (!pointsAtCell(state.doc.resolve(resizeHandlePos))) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 ? void 0 : _insm$session3.endFeature('tableColumnResize');
|
|
149
|
-
}
|
|
140
|
+
var _insm$session3;
|
|
141
|
+
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 ? void 0 : _insm$session3.endFeature('tableColumnResize');
|
|
150
142
|
return;
|
|
151
143
|
}
|
|
152
144
|
// resizeHandlePos could be remapped via a collab change.
|
|
@@ -159,10 +151,8 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
159
151
|
|
|
160
152
|
// If we let go in the same place we started, don't need to do anything.
|
|
161
153
|
if (dragging && clientX === dragging.startX) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 ? void 0 : _insm$session4.endFeature('tableColumnResize');
|
|
165
|
-
}
|
|
154
|
+
var _insm$session4;
|
|
155
|
+
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 ? void 0 : _insm$session4.endFeature('tableColumnResize');
|
|
166
156
|
if (isKeyboardResize || !isTableHovered) {
|
|
167
157
|
/** if column resize had started via keyboard but continued by mouse
|
|
168
158
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -176,6 +166,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
176
166
|
tr
|
|
177
167
|
} = state;
|
|
178
168
|
if (dragging) {
|
|
169
|
+
var _insm$session5;
|
|
179
170
|
const {
|
|
180
171
|
startX
|
|
181
172
|
} = dragging;
|
|
@@ -233,10 +224,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
233
224
|
}
|
|
234
225
|
})(tr);
|
|
235
226
|
}
|
|
236
|
-
|
|
237
|
-
var _insm$session5;
|
|
238
|
-
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 ? void 0 : _insm$session5.endFeature('tableColumnResize');
|
|
239
|
-
}
|
|
227
|
+
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 ? void 0 : _insm$session5.endFeature('tableColumnResize');
|
|
240
228
|
if (isKeyboardResize || !isTableHovered) {
|
|
241
229
|
/** if column resize had started via keyboard but continued by mouse
|
|
242
230
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -248,11 +248,8 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
248
248
|
};
|
|
249
249
|
}, [editorView, displayGuideline, displayGapCursor]);
|
|
250
250
|
var handleResizeStart = useCallback(function () {
|
|
251
|
-
var _pluginInjectionApi$u;
|
|
252
|
-
|
|
253
|
-
var _insm$session;
|
|
254
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableResize');
|
|
255
|
-
}
|
|
251
|
+
var _insm$session, _pluginInjectionApi$u;
|
|
252
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableResize');
|
|
256
253
|
startMeasure();
|
|
257
254
|
isResizing.current = true;
|
|
258
255
|
var dispatch = editorView.dispatch,
|
|
@@ -324,7 +321,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
324
321
|
return rafSchd(handleResize);
|
|
325
322
|
}, [handleResize]);
|
|
326
323
|
var handleResizeStop = useCallback(function (originalState, delta) {
|
|
327
|
-
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3;
|
|
324
|
+
var _node$attrs$localId2, _node$attrs2, _pluginInjectionApi$u3, _insm$session2;
|
|
328
325
|
isResizing.current = false;
|
|
329
326
|
var newWidth = originalState.width + delta.width;
|
|
330
327
|
var originalNewWidth = newWidth;
|
|
@@ -405,10 +402,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
405
402
|
if (onResizeStop) {
|
|
406
403
|
onResizeStop();
|
|
407
404
|
}
|
|
408
|
-
|
|
409
|
-
var _insm$session2;
|
|
410
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
411
|
-
}
|
|
405
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableResize');
|
|
412
406
|
return newWidth;
|
|
413
407
|
}, [editorView, getPos, node, widthToWidest, endMeasure, displayGapCursor, displayGuideline, updateWidth, scheduleResize, onResizeStop, pluginInjectionApi, attachAnalyticsEvent, tableRef, isTableScalingEnabled, shouldUseIncreasedScalingPercent, formatMessage, isFullPageAppearance]);
|
|
414
408
|
var handleTableSizeChangeOnKeypress = useCallback(function (step) {
|
|
@@ -33,20 +33,16 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
33
33
|
return type === 'table-row';
|
|
34
34
|
},
|
|
35
35
|
onDragStart: function onDragStart() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
|
|
39
|
-
}
|
|
36
|
+
var _insm$session;
|
|
37
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableDragAndDrop');
|
|
40
38
|
// auto scroller doesn't work when scroll-behavior: smooth is set, this monitor temporarily removes it via inline styles
|
|
41
39
|
// Ignored via go/ees005
|
|
42
40
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
43
41
|
editorPageScrollContainer.style.setProperty('scroll-behavior', 'unset');
|
|
44
42
|
},
|
|
45
43
|
onDrop: function onDrop() {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
|
|
49
|
-
}
|
|
44
|
+
var _insm$session2;
|
|
45
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableDragAndDrop');
|
|
50
46
|
// 'null' will remove the inline style
|
|
51
47
|
// Ignored via go/ees005
|
|
52
48
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -82,10 +78,8 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
82
78
|
return localId === (tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId);
|
|
83
79
|
},
|
|
84
80
|
onDragStart: function onDragStart() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
88
|
-
}
|
|
81
|
+
var _insm$session3;
|
|
82
|
+
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 || _insm$session3.startFeature('tableDragAndDrop');
|
|
89
83
|
if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
90
84
|
api === null || api === void 0 || api.core.actions.execute(function (_ref7) {
|
|
91
85
|
var _api$userIntent;
|
|
@@ -154,13 +148,10 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
154
148
|
}
|
|
155
149
|
// If no data can be found then it's most like we do not want to perform any drop action
|
|
156
150
|
if (!data) {
|
|
157
|
-
var _event$source, _event$source2;
|
|
151
|
+
var _insm$session4, _event$source, _event$source2;
|
|
158
152
|
// If we're able to determine the source type of the dropped element then we should report to analytics that
|
|
159
153
|
// the drop event was cancelled. Otherwise we will cancel silently.
|
|
160
|
-
|
|
161
|
-
var _insm$session4;
|
|
162
|
-
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
|
|
163
|
-
}
|
|
154
|
+
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableDragAndDrop');
|
|
164
155
|
if ((event === null || event === void 0 || (_event$source = event.source) === null || _event$source === void 0 || (_event$source = _event$source.data) === null || _event$source === void 0 ? void 0 : _event$source.type) === 'table-row' || (event === null || event === void 0 || (_event$source2 = event.source) === null || _event$source2 === void 0 || (_event$source2 = _event$source2.data) === null || _event$source2 === void 0 ? void 0 : _event$source2.type) === 'table-column') {
|
|
165
156
|
var _event$source$data;
|
|
166
157
|
return clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, event.source.data.type, (_event$source$data = event.source.data) === null || _event$source$data === void 0 ? void 0 : _event$source$data.indexes, TABLE_STATUS.CANCELLED, tr)(editorView.state, editorView.dispatch);
|
|
@@ -184,16 +175,15 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
184
175
|
|
|
185
176
|
// If the drop target index contains merged cells then we should not allow the drop to occur.
|
|
186
177
|
if (hasMergedCellsInBetween([targetAdjustedIndex - 1, targetAdjustedIndex], sourceType === 'table-row' ? DropTargetType.ROW : DropTargetType.COLUMN)(editorView.state.selection)) {
|
|
178
|
+
var _insm$session5;
|
|
187
179
|
clearDropTargetWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes,
|
|
188
180
|
// This event is mrked as invalid because the user is attempting to drop an element in an area which has merged cells.
|
|
189
181
|
TABLE_STATUS.INVALID, tr)(editorView.state, editorView.dispatch);
|
|
190
|
-
|
|
191
|
-
var _insm$session5;
|
|
192
|
-
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
|
|
193
|
-
}
|
|
182
|
+
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableDragAndDrop');
|
|
194
183
|
return;
|
|
195
184
|
}
|
|
196
185
|
requestAnimationFrame(function () {
|
|
186
|
+
var _insm$session6;
|
|
197
187
|
if (behaviour === 'clone') {
|
|
198
188
|
cloneSourceWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.DRAG_AND_DROP, sourceType, sourceIndexes, targetIndex, targetDirection, tr)(editorView.state, editorView.dispatch);
|
|
199
189
|
} else {
|
|
@@ -220,10 +210,7 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI, isTableScalin
|
|
|
220
210
|
}
|
|
221
211
|
}
|
|
222
212
|
editorView.focus();
|
|
223
|
-
|
|
224
|
-
var _insm$session6;
|
|
225
|
-
(_insm$session6 = insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
|
|
226
|
-
}
|
|
213
|
+
(_insm$session6 = insm.session) === null || _insm$session6 === void 0 || _insm$session6.endFeature('tableDragAndDrop');
|
|
227
214
|
});
|
|
228
215
|
}
|
|
229
216
|
})]));
|
|
@@ -3,7 +3,6 @@ import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
|
3
3
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
4
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { insm } from '@atlaskit/insm';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
import { stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
8
7
|
import { updateResizeHandleDecorations } from '../commands/misc';
|
|
9
8
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
@@ -19,7 +18,7 @@ import { currentColWidth, getTableMaxWidth, pointsAtCell, getScalingPercentForTa
|
|
|
19
18
|
import { resizeColumn } from './utils/resize-column';
|
|
20
19
|
import { getResizeState } from './utils/resize-state';
|
|
21
20
|
export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isCommentEditor) {
|
|
22
|
-
var _originalTable$attrs;
|
|
21
|
+
var _insm$session, _originalTable$attrs;
|
|
23
22
|
var state = view.state,
|
|
24
23
|
dispatch = view.dispatch;
|
|
25
24
|
var editorDisabled = !view.editable;
|
|
@@ -32,10 +31,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
32
31
|
var _getTablePluginState = getTablePluginState(state),
|
|
33
32
|
isKeyboardResize = _getTablePluginState.isKeyboardResize;
|
|
34
33
|
event.preventDefault();
|
|
35
|
-
|
|
36
|
-
var _insm$session;
|
|
37
|
-
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableColumnResize');
|
|
38
|
-
}
|
|
34
|
+
(_insm$session = insm.session) === null || _insm$session === void 0 || _insm$session.startFeature('tableColumnResize');
|
|
39
35
|
var tr = view.state.tr;
|
|
40
36
|
tr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
41
37
|
name: TABLE_OVERFLOW_CHANGE_TRIGGER.RESIZED_COLUMN
|
|
@@ -126,17 +122,13 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
126
122
|
var _getTablePluginState2 = getTablePluginState(state),
|
|
127
123
|
isTableHovered = _getTablePluginState2.isTableHovered;
|
|
128
124
|
if (resizeHandlePos === null) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableColumnResize');
|
|
132
|
-
}
|
|
125
|
+
var _insm$session2;
|
|
126
|
+
(_insm$session2 = insm.session) === null || _insm$session2 === void 0 || _insm$session2.endFeature('tableColumnResize');
|
|
133
127
|
return stopResizing()(state, dispatch);
|
|
134
128
|
}
|
|
135
129
|
if (!pointsAtCell(state.doc.resolve(resizeHandlePos))) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 || _insm$session3.endFeature('tableColumnResize');
|
|
139
|
-
}
|
|
130
|
+
var _insm$session3;
|
|
131
|
+
(_insm$session3 = insm.session) === null || _insm$session3 === void 0 || _insm$session3.endFeature('tableColumnResize');
|
|
140
132
|
return;
|
|
141
133
|
}
|
|
142
134
|
// resizeHandlePos could be remapped via a collab change.
|
|
@@ -149,10 +141,8 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
149
141
|
|
|
150
142
|
// If we let go in the same place we started, don't need to do anything.
|
|
151
143
|
if (dragging && clientX === dragging.startX) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableColumnResize');
|
|
155
|
-
}
|
|
144
|
+
var _insm$session4;
|
|
145
|
+
(_insm$session4 = insm.session) === null || _insm$session4 === void 0 || _insm$session4.endFeature('tableColumnResize');
|
|
156
146
|
if (isKeyboardResize || !isTableHovered) {
|
|
157
147
|
/** if column resize had started via keyboard but continued by mouse
|
|
158
148
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
@@ -164,6 +154,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
164
154
|
}
|
|
165
155
|
var tr = state.tr;
|
|
166
156
|
if (dragging) {
|
|
157
|
+
var _insm$session5;
|
|
167
158
|
var startX = dragging.startX;
|
|
168
159
|
|
|
169
160
|
// If the dimensions of the table have changed through a remote modification by another
|
|
@@ -219,10 +210,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
219
210
|
}
|
|
220
211
|
})(tr);
|
|
221
212
|
}
|
|
222
|
-
|
|
223
|
-
var _insm$session5;
|
|
224
|
-
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableColumnResize');
|
|
225
|
-
}
|
|
213
|
+
(_insm$session5 = insm.session) === null || _insm$session5 === void 0 || _insm$session5.endFeature('tableColumnResize');
|
|
226
214
|
if (isKeyboardResize || !isTableHovered) {
|
|
227
215
|
/** if column resize had started via keyboard but continued by mouse
|
|
228
216
|
* or mouse pointer leaves the table but mouse button still pressed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "24.4.
|
|
3
|
+
"version": "24.4.2",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^12.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-content-insertion": "^12.0.0",
|
|
31
31
|
"@atlaskit/editor-plugin-editor-viewmode": "^14.0.0",
|
|
32
|
-
"@atlaskit/editor-plugin-extension": "15.0.
|
|
32
|
+
"@atlaskit/editor-plugin-extension": "15.0.24",
|
|
33
33
|
"@atlaskit/editor-plugin-guideline": "^12.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-interaction": "^22.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-limited-mode": "^9.0.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
|
|
54
54
|
"@atlaskit/primitives": "^20.5.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^124.1.0",
|
|
56
56
|
"@atlaskit/toggle": "^17.1.0",
|
|
57
57
|
"@atlaskit/tokens": "^15.5.0",
|
|
58
58
|
"@atlaskit/tooltip": "^23.1.0",
|