@atlaskit/editor-plugin-table 7.31.0 → 7.31.1
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 +9 -0
- package/dist/cjs/commands/column-resize.js +10 -8
- package/dist/cjs/commands/misc.js +4 -4
- package/dist/cjs/event-handlers.js +69 -65
- package/dist/cjs/plugin.js +52 -48
- package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +2 -2
- package/dist/cjs/pm-plugins/keymap.js +18 -15
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +35 -10
- package/dist/cjs/utils/decoration.js +28 -8
- package/dist/es2019/commands/column-resize.js +10 -8
- package/dist/es2019/commands/misc.js +4 -4
- package/dist/es2019/event-handlers.js +4 -4
- package/dist/es2019/plugin.js +12 -7
- package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +2 -2
- package/dist/es2019/pm-plugins/keymap.js +7 -4
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +33 -10
- package/dist/es2019/utils/decoration.js +26 -9
- package/dist/esm/commands/column-resize.js +10 -8
- package/dist/esm/commands/misc.js +4 -4
- package/dist/esm/event-handlers.js +69 -65
- package/dist/esm/plugin.js +52 -48
- package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +2 -2
- package/dist/esm/pm-plugins/keymap.js +18 -15
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/esm/pm-plugins/view-mode-sort/index.js +35 -10
- package/dist/esm/utils/decoration.js +28 -8
- package/dist/types/commands/column-resize.d.ts +5 -2
- package/dist/types/commands/misc.d.ts +3 -2
- package/dist/types/event-handlers.d.ts +2 -1
- package/dist/types/pm-plugins/decorations/utils/column-resizing.d.ts +2 -1
- package/dist/types/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
- package/dist/types/pm-plugins/table-resizing/plugin.d.ts +2 -1
- package/dist/types/pm-plugins/view-mode-sort/index.d.ts +2 -1
- package/dist/types/utils/decoration.d.ts +2 -1
- package/dist/types-ts4.5/commands/column-resize.d.ts +5 -2
- package/dist/types-ts4.5/commands/misc.d.ts +3 -2
- package/dist/types-ts4.5/event-handlers.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/decorations/utils/column-resizing.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/event-handlers.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/plugin.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/index.d.ts +2 -1
- package/dist/types-ts4.5/utils/decoration.d.ts +2 -1
- package/package.json +9 -5
- package/src/commands/column-resize.ts +18 -1
- package/src/commands/misc.ts +5 -0
- package/src/event-handlers.ts +22 -20
- package/src/plugin.tsx +10 -4
- package/src/pm-plugins/decorations/utils/column-resizing.ts +3 -0
- package/src/pm-plugins/keymap.ts +5 -0
- package/src/pm-plugins/main.ts +2 -1
- package/src/pm-plugins/table-resizing/event-handlers.ts +8 -1
- package/src/pm-plugins/table-resizing/plugin.ts +3 -0
- package/src/pm-plugins/view-mode-sort/index.ts +73 -34
- package/src/utils/decoration.ts +39 -13
|
@@ -19,7 +19,7 @@ var getTablePluginCommand = function getTablePluginCommand(actionPayload, origin
|
|
|
19
19
|
return (originalTr || tr).setMeta('addToHistory', false);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos) {
|
|
22
|
+
var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI) {
|
|
23
23
|
return function (state, dispatch) {
|
|
24
24
|
var customTr = state.tr;
|
|
25
25
|
var _getPluginState = getPluginState(state),
|
|
@@ -31,7 +31,7 @@ var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosi
|
|
|
31
31
|
if (!allowColumnResizing) {
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
|
-
var decorationsWithWidget = buildColumnResizingDecorations(rowIndex, columnIndex, true, getIntl)({
|
|
34
|
+
var decorationsWithWidget = buildColumnResizingDecorations(rowIndex, columnIndex, true, getIntl, nodeViewPortalProviderAPI)({
|
|
35
35
|
tr: customTr,
|
|
36
36
|
decorationSet: getDecorations(state)
|
|
37
37
|
});
|
|
@@ -63,7 +63,8 @@ var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosi
|
|
|
63
63
|
};
|
|
64
64
|
export var initiateKeyboardColumnResizing = function initiateKeyboardColumnResizing(_ref) {
|
|
65
65
|
var ariaNotify = _ref.ariaNotify,
|
|
66
|
-
getIntl = _ref.getIntl
|
|
66
|
+
getIntl = _ref.getIntl,
|
|
67
|
+
nodeViewPortalProviderAPI = _ref.nodeViewPortalProviderAPI;
|
|
67
68
|
return function (state, dispatch, view) {
|
|
68
69
|
var selection = state.selection;
|
|
69
70
|
var selectionRect = isSelectionType(selection, 'cell') ? getSelectionRect(selection) : findCellRectClosestToPos(selection.$from);
|
|
@@ -74,7 +75,7 @@ export var initiateKeyboardColumnResizing = function initiateKeyboardColumnResiz
|
|
|
74
75
|
});
|
|
75
76
|
}
|
|
76
77
|
if (selectionRect && cell && view) {
|
|
77
|
-
return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos)(state, dispatch);
|
|
78
|
+
return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos, nodeViewPortalProviderAPI)(state, dispatch);
|
|
78
79
|
}
|
|
79
80
|
return false;
|
|
80
81
|
};
|
|
@@ -82,7 +83,8 @@ export var initiateKeyboardColumnResizing = function initiateKeyboardColumnResiz
|
|
|
82
83
|
export var activateNextResizeArea = function activateNextResizeArea(_ref2) {
|
|
83
84
|
var direction = _ref2.direction,
|
|
84
85
|
ariaNotify = _ref2.ariaNotify,
|
|
85
|
-
getIntl = _ref2.getIntl
|
|
86
|
+
getIntl = _ref2.getIntl,
|
|
87
|
+
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
|
|
86
88
|
return function (state, dispatch, view) {
|
|
87
89
|
var _ref3 = getTableResizingPluginState(state) || {},
|
|
88
90
|
resizeHandlePos = _ref3.resizeHandlePos;
|
|
@@ -128,17 +130,17 @@ export var activateNextResizeArea = function activateNextResizeArea(_ref2) {
|
|
|
128
130
|
// we are somewhere in between the side columns of the table
|
|
129
131
|
var offset = $nextCell.pos - $nextCell.start(-1);
|
|
130
132
|
var rectForNextCell = tableMap.findCell(offset);
|
|
131
|
-
return updateResizeHandleAndStatePosition(rectForNextCell.top, rectForNextCell.right, $nextCell.pos)(state, dispatch, view);
|
|
133
|
+
return updateResizeHandleAndStatePosition(rectForNextCell.top, rectForNextCell.right, $nextCell.pos, nodeViewPortalProviderAPI)(state, dispatch, view);
|
|
132
134
|
} else {
|
|
133
135
|
// current position is in the one of the side columns of the table(left or right)
|
|
134
136
|
if (currentCellRect.left === 0) {
|
|
135
137
|
var lastCellInCurrentRow = tableMap.positionAt(currentCellRect.top, tableMap.width - 1, tableNode) + closestTable.start;
|
|
136
138
|
var $lastCell = state.doc.resolve(lastCellInCurrentRow);
|
|
137
|
-
return updateResizeHandleAndStatePosition(currentCellRect.top, tableMap.width, $lastCell.pos)(state, dispatch, view);
|
|
139
|
+
return updateResizeHandleAndStatePosition(currentCellRect.top, tableMap.width, $lastCell.pos, nodeViewPortalProviderAPI)(state, dispatch, view);
|
|
138
140
|
} else if (tableMap.width === currentCellRect.right) {
|
|
139
141
|
var firsCellInCurrentRow = tableMap.positionAt(currentCellRect.top, 0, tableNode) + closestTable.start;
|
|
140
142
|
var _$nextCell = state.doc.resolve(firsCellInCurrentRow);
|
|
141
|
-
return updateResizeHandleAndStatePosition(currentCellRect.top, 1, _$nextCell.pos)(state, dispatch);
|
|
143
|
+
return updateResizeHandleAndStatePosition(currentCellRect.top, 1, _$nextCell.pos, nodeViewPortalProviderAPI)(state, dispatch);
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
return false;
|
|
@@ -462,7 +462,7 @@ export var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton()
|
|
|
462
462
|
return tr.setMeta('addToHistory', false);
|
|
463
463
|
});
|
|
464
464
|
};
|
|
465
|
-
export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, isKeyboardResize) {
|
|
465
|
+
export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize) {
|
|
466
466
|
return createCommand(function (state) {
|
|
467
467
|
var tableNode = findTable(state.selection);
|
|
468
468
|
var _getPluginState3 = getPluginState(state),
|
|
@@ -474,7 +474,7 @@ export var addResizeHandleDecorations = function addResizeHandleDecorations(rowI
|
|
|
474
474
|
return {
|
|
475
475
|
type: 'ADD_RESIZE_HANDLE_DECORATIONS',
|
|
476
476
|
data: {
|
|
477
|
-
decorationSet: buildColumnResizingDecorations(rowIndex, columnIndex, includeTooltip, getIntl)({
|
|
477
|
+
decorationSet: buildColumnResizingDecorations(rowIndex, columnIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI)({
|
|
478
478
|
tr: state.tr,
|
|
479
479
|
decorationSet: getDecorations(state)
|
|
480
480
|
}),
|
|
@@ -488,7 +488,7 @@ export var addResizeHandleDecorations = function addResizeHandleDecorations(rowI
|
|
|
488
488
|
return tr.setMeta('addToHistory', false);
|
|
489
489
|
});
|
|
490
490
|
};
|
|
491
|
-
export var updateResizeHandleDecorations = function updateResizeHandleDecorations(rowIndex, columnIndex, includeTooltip) {
|
|
491
|
+
export var updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip) {
|
|
492
492
|
return createCommand(function (state) {
|
|
493
493
|
var tableNode = findTable(state.selection);
|
|
494
494
|
var _getPluginState4 = getPluginState(state),
|
|
@@ -509,7 +509,7 @@ export var updateResizeHandleDecorations = function updateResizeHandleDecoration
|
|
|
509
509
|
return {
|
|
510
510
|
type: 'UPDATE_RESIZE_HANDLE_DECORATIONS',
|
|
511
511
|
data: {
|
|
512
|
-
decorationSet: buildColumnResizingDecorations(resolvedRowIndex, resolvedColumnIndex, resolvedIncludeTooltip, getIntl)({
|
|
512
|
+
decorationSet: buildColumnResizingDecorations(resolvedRowIndex, resolvedColumnIndex, resolvedIncludeTooltip, getIntl, nodeViewPortalProviderAPI)({
|
|
513
513
|
tr: state.tr,
|
|
514
514
|
decorationSet: getDecorations(state)
|
|
515
515
|
}),
|
|
@@ -245,78 +245,82 @@ export var handleMouseLeave = function handleMouseLeave(view, event) {
|
|
|
245
245
|
|
|
246
246
|
// IMPORTANT: The mouse move handler has been setup with RAF schedule to avoid Reflows which will occur as some methods
|
|
247
247
|
// need to access the mouse event offset position and also the target clientWidth vallue.
|
|
248
|
-
var handleMouseMoveDebounce =
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
var element = event.target;
|
|
253
|
-
if (isColumnControlsDecorations(element) || isDragColumnFloatingInsertDot(element)) {
|
|
254
|
-
var state = view.state,
|
|
255
|
-
dispatch = view.dispatch;
|
|
256
|
-
var _getPluginState6 = getPluginState(state),
|
|
257
|
-
insertColumnButtonIndex = _getPluginState6.insertColumnButtonIndex;
|
|
258
|
-
var _getColumnOrRowIndex9 = getColumnOrRowIndex(element),
|
|
259
|
-
_getColumnOrRowIndex10 = _slicedToArray(_getColumnOrRowIndex9, 2),
|
|
260
|
-
startIndex = _getColumnOrRowIndex10[0],
|
|
261
|
-
endIndex = _getColumnOrRowIndex10[1];
|
|
262
|
-
var positionColumn = getMousePositionHorizontalRelativeByElement(event, offsetX, undefined) === 'right' ? endIndex : startIndex;
|
|
263
|
-
if (positionColumn !== insertColumnButtonIndex) {
|
|
264
|
-
return showInsertColumnButton(positionColumn)(state, dispatch);
|
|
248
|
+
var handleMouseMoveDebounce = function handleMouseMoveDebounce(nodeViewPortalProviderAPI) {
|
|
249
|
+
return rafSchedule(function (view, event, offsetX) {
|
|
250
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
251
|
+
return false;
|
|
265
252
|
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
253
|
+
var element = event.target;
|
|
254
|
+
if (isColumnControlsDecorations(element) || isDragColumnFloatingInsertDot(element)) {
|
|
255
|
+
var state = view.state,
|
|
256
|
+
dispatch = view.dispatch;
|
|
257
|
+
var _getPluginState6 = getPluginState(state),
|
|
258
|
+
insertColumnButtonIndex = _getPluginState6.insertColumnButtonIndex;
|
|
259
|
+
var _getColumnOrRowIndex9 = getColumnOrRowIndex(element),
|
|
260
|
+
_getColumnOrRowIndex10 = _slicedToArray(_getColumnOrRowIndex9, 2),
|
|
261
|
+
startIndex = _getColumnOrRowIndex10[0],
|
|
262
|
+
endIndex = _getColumnOrRowIndex10[1];
|
|
263
|
+
var positionColumn = getMousePositionHorizontalRelativeByElement(event, offsetX, undefined) === 'right' ? endIndex : startIndex;
|
|
264
|
+
if (positionColumn !== insertColumnButtonIndex) {
|
|
265
|
+
return showInsertColumnButton(positionColumn)(state, dispatch);
|
|
266
|
+
}
|
|
279
267
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
var
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
268
|
+
if (isRowControlsButton(element) || isDragRowFloatingInsertDot(element)) {
|
|
269
|
+
var _state3 = view.state,
|
|
270
|
+
_dispatch4 = view.dispatch;
|
|
271
|
+
var _getPluginState7 = getPluginState(_state3),
|
|
272
|
+
insertRowButtonIndex = _getPluginState7.insertRowButtonIndex;
|
|
273
|
+
var _getColumnOrRowIndex11 = getColumnOrRowIndex(element),
|
|
274
|
+
_getColumnOrRowIndex12 = _slicedToArray(_getColumnOrRowIndex11, 2),
|
|
275
|
+
_startIndex3 = _getColumnOrRowIndex12[0],
|
|
276
|
+
_endIndex2 = _getColumnOrRowIndex12[1];
|
|
277
|
+
var positionRow = getMousePositionVerticalRelativeByElement(event) === 'bottom' ? _endIndex2 : _startIndex3;
|
|
278
|
+
if (positionRow !== insertRowButtonIndex) {
|
|
279
|
+
return showInsertRowButton(positionRow)(_state3, _dispatch4);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (!isResizeHandleDecoration(element) && isCell(element)) {
|
|
283
|
+
var _positionColumn = getMousePositionHorizontalRelativeByElement(event, offsetX, RESIZE_HANDLE_AREA_DECORATION_GAP);
|
|
284
|
+
if (_positionColumn !== null) {
|
|
285
|
+
var _state4 = view.state,
|
|
286
|
+
_dispatch5 = view.dispatch;
|
|
287
|
+
var _getPluginState8 = getPluginState(_state4),
|
|
288
|
+
resizeHandleColumnIndex = _getPluginState8.resizeHandleColumnIndex,
|
|
289
|
+
resizeHandleRowIndex = _getPluginState8.resizeHandleRowIndex;
|
|
290
|
+
var isKeyboardResize = getPluginState(_state4).isKeyboardResize;
|
|
291
|
+
var tableCell = closestElement(element, 'td, th');
|
|
292
|
+
var cellStartPosition = view.posAtDOM(tableCell, 0);
|
|
293
|
+
var rect = findCellRectClosestToPos(_state4.doc.resolve(cellStartPosition));
|
|
294
|
+
if (rect) {
|
|
295
|
+
var columnEndIndexTarget = _positionColumn === 'left' ? rect.left : rect.right;
|
|
296
|
+
var rowIndexTarget = rect.top;
|
|
297
|
+
if ((columnEndIndexTarget !== resizeHandleColumnIndex || rowIndexTarget !== resizeHandleRowIndex || !hasResizeHandler({
|
|
298
|
+
target: element,
|
|
299
|
+
columnEndIndexTarget: columnEndIndexTarget
|
|
300
|
+
})) && !isKeyboardResize // if initiated by keyboard don't need to react on hover for other resize sliders
|
|
301
|
+
) {
|
|
302
|
+
return addResizeHandleDecorations(rowIndexTarget, columnEndIndexTarget, true, nodeViewPortalProviderAPI)(_state4, _dispatch5);
|
|
303
|
+
}
|
|
302
304
|
}
|
|
303
305
|
}
|
|
304
306
|
}
|
|
305
|
-
}
|
|
306
|
-
return false;
|
|
307
|
-
});
|
|
308
|
-
export var handleMouseMove = function handleMouseMove(view, event) {
|
|
309
|
-
if (!(event.target instanceof HTMLElement)) {
|
|
310
307
|
return false;
|
|
311
|
-
}
|
|
308
|
+
});
|
|
309
|
+
};
|
|
310
|
+
export var handleMouseMove = function handleMouseMove(nodeViewPortalProviderAPI) {
|
|
311
|
+
return function (view, event) {
|
|
312
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
312
315
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
// NOTE: When accessing offsetX in gecko from a deferred callback, it will return 0. However it will be non-zero if accessed
|
|
317
|
+
// within the scope of it's initial mouse move handler. Also Chrome does return the correct value, however it could trigger
|
|
318
|
+
// a reflow. So for now this will just grab the offsetX value immediately for gecko and chrome will calculate later
|
|
319
|
+
// in the deferred callback handler.
|
|
320
|
+
// Bug Tracking: https://bugzilla.mozilla.org/show_bug.cgi?id=1882903
|
|
321
|
+
handleMouseMoveDebounce(nodeViewPortalProviderAPI)(view, event, browser.gecko ? event.offsetX : NaN);
|
|
322
|
+
return false;
|
|
323
|
+
};
|
|
320
324
|
};
|
|
321
325
|
export function handleTripleClick(view, pos) {
|
|
322
326
|
var state = view.state,
|
package/dist/esm/plugin.js
CHANGED
|
@@ -201,6 +201,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
201
201
|
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
202
202
|
dispatch = _ref2.dispatch,
|
|
203
203
|
portalProviderAPI = _ref2.portalProviderAPI,
|
|
204
|
+
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI,
|
|
204
205
|
eventDispatcher = _ref2.eventDispatcher,
|
|
205
206
|
getIntl = _ref2.getIntl;
|
|
206
207
|
var _ref3 = options || {},
|
|
@@ -214,12 +215,13 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
214
215
|
isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled,
|
|
215
216
|
isCommentEditor = _ref3.isCommentEditor,
|
|
216
217
|
isChromelessEditor = _ref3.isChromelessEditor;
|
|
217
|
-
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor);
|
|
218
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor);
|
|
218
219
|
}
|
|
219
220
|
}, {
|
|
220
221
|
name: 'tablePMColResizing',
|
|
221
222
|
plugin: function plugin(_ref4) {
|
|
222
|
-
var dispatch = _ref4.dispatch
|
|
223
|
+
var dispatch = _ref4.dispatch,
|
|
224
|
+
nodeViewPortalProviderAPI = _ref4.nodeViewPortalProviderAPI;
|
|
223
225
|
var _ref5 = options || {},
|
|
224
226
|
fullWidthEnabled = _ref5.fullWidthEnabled,
|
|
225
227
|
tableOptions = _ref5.tableOptions,
|
|
@@ -231,7 +233,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
231
233
|
allowColumnResizing = _pluginConfig2.allowColumnResizing;
|
|
232
234
|
return allowColumnResizing ? createFlexiResizingPlugin(dispatch, {
|
|
233
235
|
lastColumnResizable: !fullWidthEnabled
|
|
234
|
-
}, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, api, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled, isTableAlignmentEnabled, !!(options !== null && options !== void 0 && options.isCommentEditor)) : undefined;
|
|
236
|
+
}, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled, isTableAlignmentEnabled, !!(options !== null && options !== void 0 && options.isCommentEditor)) : undefined;
|
|
235
237
|
}
|
|
236
238
|
}, {
|
|
237
239
|
name: 'tableEditing',
|
|
@@ -244,7 +246,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
244
246
|
{
|
|
245
247
|
name: 'tableKeymap',
|
|
246
248
|
plugin: function plugin(_ref6) {
|
|
247
|
-
var getIntl = _ref6.getIntl
|
|
249
|
+
var getIntl = _ref6.getIntl,
|
|
250
|
+
nodeViewPortalProviderAPI = _ref6.nodeViewPortalProviderAPI;
|
|
248
251
|
var _ref7 = options || {},
|
|
249
252
|
dragAndDropEnabled = _ref7.dragAndDropEnabled,
|
|
250
253
|
_ref7$isTableScalingE = _ref7.isTableScalingEnabled,
|
|
@@ -259,7 +262,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
259
262
|
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
260
263
|
_ref7$tableResizingEn = _ref7.tableResizingEnabled,
|
|
261
264
|
tableResizingEnabled = _ref7$tableResizingEn === void 0 ? false : _ref7$tableResizingEn;
|
|
262
|
-
return keymapPlugin(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
265
|
+
return keymapPlugin(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
263
266
|
}
|
|
264
267
|
}, {
|
|
265
268
|
name: 'tableSelectionKeymap',
|
|
@@ -306,45 +309,46 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
306
309
|
}
|
|
307
310
|
}, {
|
|
308
311
|
name: 'tableViewModeSort',
|
|
309
|
-
plugin: function plugin() {
|
|
310
|
-
|
|
312
|
+
plugin: function plugin(_ref13) {
|
|
313
|
+
var nodeViewPortalProviderAPI = _ref13.nodeViewPortalProviderAPI;
|
|
314
|
+
return api !== null && api !== void 0 && api.editorViewMode ? createViewModeSortPlugin(api, nodeViewPortalProviderAPI) : undefined;
|
|
311
315
|
}
|
|
312
316
|
}, {
|
|
313
317
|
name: 'tableLocalId',
|
|
314
|
-
plugin: function plugin(
|
|
315
|
-
var dispatch =
|
|
318
|
+
plugin: function plugin(_ref14) {
|
|
319
|
+
var dispatch = _ref14.dispatch;
|
|
316
320
|
return createTableLocalIdPlugin(dispatch);
|
|
317
321
|
}
|
|
318
322
|
}, {
|
|
319
323
|
name: 'tableWidth',
|
|
320
|
-
plugin: function plugin(
|
|
324
|
+
plugin: function plugin(_ref15) {
|
|
321
325
|
var _options$fullWidthEna, _options$isTableScali, _options$isTableAlign, _options$isCommentEdi;
|
|
322
|
-
var dispatchAnalyticsEvent =
|
|
323
|
-
dispatch =
|
|
326
|
+
var dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent,
|
|
327
|
+
dispatch = _ref15.dispatch;
|
|
324
328
|
return options !== null && options !== void 0 && options.tableResizingEnabled ? createTableWidthPlugin(dispatch, dispatchAnalyticsEvent, (_options$fullWidthEna = options === null || options === void 0 ? void 0 : options.fullWidthEnabled) !== null && _options$fullWidthEna !== void 0 ? _options$fullWidthEna : false, (_options$isTableScali = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) !== null && _options$isTableScali !== void 0 ? _options$isTableScali : false, (_options$isTableAlign = options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled) !== null && _options$isTableAlign !== void 0 ? _options$isTableAlign : false, (_options$isCommentEdi = options === null || options === void 0 ? void 0 : options.isCommentEditor) !== null && _options$isCommentEdi !== void 0 ? _options$isCommentEdi : false) : undefined;
|
|
325
329
|
}
|
|
326
330
|
}, {
|
|
327
331
|
name: 'tableWidthInCommentFix',
|
|
328
|
-
plugin: function plugin(
|
|
332
|
+
plugin: function plugin(_ref16) {
|
|
329
333
|
var _options$isTableAlign2;
|
|
330
|
-
var dispatch =
|
|
334
|
+
var dispatch = _ref16.dispatch;
|
|
331
335
|
return options !== null && options !== void 0 && options.tableResizingEnabled && options !== null && options !== void 0 && options.isCommentEditor ? createTableWidthInCommentFixPlugin(dispatch, (_options$isTableAlign2 = options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled) !== null && _options$isTableAlign2 !== void 0 ? _options$isTableAlign2 : false) : undefined;
|
|
332
336
|
}
|
|
333
337
|
},
|
|
334
338
|
// TODO: should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
335
339
|
{
|
|
336
340
|
name: 'tableOverflowAnalyticsPlugin',
|
|
337
|
-
plugin: function plugin(
|
|
341
|
+
plugin: function plugin(_ref17) {
|
|
338
342
|
var _options$tableResizin;
|
|
339
|
-
var dispatch =
|
|
340
|
-
dispatchAnalyticsEvent =
|
|
343
|
+
var dispatch = _ref17.dispatch,
|
|
344
|
+
dispatchAnalyticsEvent = _ref17.dispatchAnalyticsEvent;
|
|
341
345
|
return createTableOverflowAnalyticsPlugin(dispatch, dispatchAnalyticsEvent, (_options$tableResizin = options === null || options === void 0 ? void 0 : options.tableResizingEnabled) !== null && _options$tableResizin !== void 0 ? _options$tableResizin : false);
|
|
342
346
|
}
|
|
343
347
|
}, {
|
|
344
348
|
name: 'tableAnalyticsPlugin',
|
|
345
|
-
plugin: function plugin(
|
|
346
|
-
var dispatch =
|
|
347
|
-
dispatchAnalyticsEvent =
|
|
349
|
+
plugin: function plugin(_ref18) {
|
|
350
|
+
var dispatch = _ref18.dispatch,
|
|
351
|
+
dispatchAnalyticsEvent = _ref18.dispatchAnalyticsEvent;
|
|
348
352
|
return createTableAnalyticsPlugin(dispatch, dispatchAnalyticsEvent);
|
|
349
353
|
}
|
|
350
354
|
}, {
|
|
@@ -375,13 +379,13 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
375
379
|
}
|
|
376
380
|
return plugins;
|
|
377
381
|
},
|
|
378
|
-
contentComponent: function contentComponent(
|
|
382
|
+
contentComponent: function contentComponent(_ref19) {
|
|
379
383
|
var _api$featureFlags;
|
|
380
|
-
var editorView =
|
|
381
|
-
popupsMountPoint =
|
|
382
|
-
popupsBoundariesElement =
|
|
383
|
-
popupsScrollableElement =
|
|
384
|
-
dispatchAnalyticsEvent =
|
|
384
|
+
var editorView = _ref19.editorView,
|
|
385
|
+
popupsMountPoint = _ref19.popupsMountPoint,
|
|
386
|
+
popupsBoundariesElement = _ref19.popupsBoundariesElement,
|
|
387
|
+
popupsScrollableElement = _ref19.popupsScrollableElement,
|
|
388
|
+
dispatchAnalyticsEvent = _ref19.dispatchAnalyticsEvent;
|
|
385
389
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
386
390
|
component: ACTION_SUBJECT.TABLES_PLUGIN,
|
|
387
391
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
@@ -397,32 +401,32 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
397
401
|
stickyHeadersState: stickyHeadersPluginKey,
|
|
398
402
|
dragAndDropState: dragAndDropPluginKey
|
|
399
403
|
},
|
|
400
|
-
render: function render(
|
|
401
|
-
var resizingPluginState =
|
|
402
|
-
stickyHeadersState =
|
|
403
|
-
tablePluginState =
|
|
404
|
-
tableWidthPluginState =
|
|
405
|
-
dragAndDropState =
|
|
404
|
+
render: function render(_ref20) {
|
|
405
|
+
var resizingPluginState = _ref20.tableResizingPluginState,
|
|
406
|
+
stickyHeadersState = _ref20.stickyHeadersState,
|
|
407
|
+
tablePluginState = _ref20.tablePluginState,
|
|
408
|
+
tableWidthPluginState = _ref20.tableWidthPluginState,
|
|
409
|
+
dragAndDropState = _ref20.dragAndDropState;
|
|
406
410
|
var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
407
411
|
var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
|
|
408
412
|
var resizingTableLocalId = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableLocalId;
|
|
409
413
|
var resizingTableRef = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableRef;
|
|
410
414
|
var isResizing = isColumnResizing || isTableResizing;
|
|
411
415
|
var widthToWidest = tablePluginState === null || tablePluginState === void 0 ? void 0 : tablePluginState.widthToWidest;
|
|
412
|
-
var
|
|
413
|
-
tableNode =
|
|
414
|
-
tablePos =
|
|
415
|
-
targetCellPosition =
|
|
416
|
-
isContextualMenuOpen =
|
|
417
|
-
tableRef =
|
|
418
|
-
pluginConfig =
|
|
419
|
-
insertColumnButtonIndex =
|
|
420
|
-
insertRowButtonIndex =
|
|
421
|
-
isHeaderColumnEnabled =
|
|
422
|
-
isHeaderRowEnabled =
|
|
423
|
-
isDragAndDropEnabled =
|
|
424
|
-
tableWrapperTarget =
|
|
425
|
-
isCellMenuOpenByKeyboard =
|
|
416
|
+
var _ref21 = tablePluginState,
|
|
417
|
+
tableNode = _ref21.tableNode,
|
|
418
|
+
tablePos = _ref21.tablePos,
|
|
419
|
+
targetCellPosition = _ref21.targetCellPosition,
|
|
420
|
+
isContextualMenuOpen = _ref21.isContextualMenuOpen,
|
|
421
|
+
tableRef = _ref21.tableRef,
|
|
422
|
+
pluginConfig = _ref21.pluginConfig,
|
|
423
|
+
insertColumnButtonIndex = _ref21.insertColumnButtonIndex,
|
|
424
|
+
insertRowButtonIndex = _ref21.insertRowButtonIndex,
|
|
425
|
+
isHeaderColumnEnabled = _ref21.isHeaderColumnEnabled,
|
|
426
|
+
isHeaderRowEnabled = _ref21.isHeaderRowEnabled,
|
|
427
|
+
isDragAndDropEnabled = _ref21.isDragAndDropEnabled,
|
|
428
|
+
tableWrapperTarget = _ref21.tableWrapperTarget,
|
|
429
|
+
isCellMenuOpenByKeyboard = _ref21.isCellMenuOpenByKeyboard;
|
|
426
430
|
var allowControls = pluginConfig.allowControls;
|
|
427
431
|
var stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
|
|
428
432
|
return /*#__PURE__*/React.createElement(React.Fragment, null, targetCellPosition && (tableRef || isCellMenuOpenByKeyboard) && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/React.createElement(FloatingContextualButton, {
|
|
@@ -515,8 +519,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
515
519
|
}));
|
|
516
520
|
},
|
|
517
521
|
pluginsOptions: {
|
|
518
|
-
quickInsert: function quickInsert(
|
|
519
|
-
var formatMessage =
|
|
522
|
+
quickInsert: function quickInsert(_ref22) {
|
|
523
|
+
var formatMessage = _ref22.formatMessage;
|
|
520
524
|
return [{
|
|
521
525
|
id: 'table',
|
|
522
526
|
title: formatMessage(messages.table),
|
|
@@ -17,13 +17,13 @@ var updateLastCellElement = function updateLastCellElement(lastCellElementsDecor
|
|
|
17
17
|
return updateDecorations(tr.doc, decorationSet, lastCellElementsDecorations, TableDecorations.LAST_CELL_ELEMENT);
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl) {
|
|
20
|
+
export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI) {
|
|
21
21
|
return function (_ref3) {
|
|
22
22
|
var tr = _ref3.tr,
|
|
23
23
|
decorationSet = _ref3.decorationSet;
|
|
24
24
|
var _ref4 = columnEndIndex < 0 ? emptyDecorations : createResizeHandleDecoration(tr, rowEndIndex, {
|
|
25
25
|
right: columnEndIndex
|
|
26
|
-
}, includeTooltip, getIntl),
|
|
26
|
+
}, includeTooltip, getIntl, nodeViewPortalProviderAPI),
|
|
27
27
|
_ref5 = _slicedToArray(_ref4, 2),
|
|
28
28
|
columnResizesDecorations = _ref5[0],
|
|
29
29
|
lastCellElementsDecorations = _ref5[1];
|
|
@@ -7,19 +7,19 @@ import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSele
|
|
|
7
7
|
import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
8
8
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable } from '../commands/insert';
|
|
9
9
|
import { moveSourceWithAnalyticsViaShortcut } from '../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
10
|
-
export function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
10
|
+
export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
11
11
|
var _pluginInjectionApi$a;
|
|
12
|
-
var isTableScalingEnabled = arguments.length >
|
|
13
|
-
var isTableAlignmentEnabled = arguments.length >
|
|
14
|
-
var isFullWidthEnabled = arguments.length >
|
|
15
|
-
var pluginInjectionApi = arguments.length >
|
|
16
|
-
var getIntl = arguments.length >
|
|
17
|
-
var isCellBackgroundDuplicated = arguments.length >
|
|
18
|
-
var isTableFixedColumnWidthsOptionEnabled = arguments.length >
|
|
19
|
-
var shouldUseIncreasedScalingPercent = arguments.length >
|
|
20
|
-
var isCommentEditor = arguments.length >
|
|
21
|
-
var isChromelessEditor = arguments.length >
|
|
22
|
-
var isTableResizingEnabled = arguments.length >
|
|
12
|
+
var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
13
|
+
var isTableAlignmentEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
14
|
+
var isFullWidthEnabled = arguments.length > 7 ? arguments[7] : undefined;
|
|
15
|
+
var pluginInjectionApi = arguments.length > 8 ? arguments[8] : undefined;
|
|
16
|
+
var getIntl = arguments.length > 9 ? arguments[9] : undefined;
|
|
17
|
+
var isCellBackgroundDuplicated = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
18
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
|
|
19
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 12 ? arguments[12] : undefined;
|
|
20
|
+
var isCommentEditor = arguments.length > 13 ? arguments[13] : undefined;
|
|
21
|
+
var isChromelessEditor = arguments.length > 14 ? arguments[14] : undefined;
|
|
22
|
+
var isTableResizingEnabled = arguments.length > 15 ? arguments[15] : undefined;
|
|
23
23
|
var list = {};
|
|
24
24
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
25
25
|
bindKeymapWithCommand(nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
@@ -57,17 +57,20 @@ export function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, d
|
|
|
57
57
|
}
|
|
58
58
|
bindKeymapWithCommand(startColumnResizing.common, initiateKeyboardColumnResizing({
|
|
59
59
|
ariaNotify: ariaNotifyPlugin,
|
|
60
|
-
getIntl: getIntl
|
|
60
|
+
getIntl: getIntl,
|
|
61
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
61
62
|
}), list);
|
|
62
63
|
bindKeymapWithCommand(moveRight.common, activateNextResizeArea({
|
|
63
64
|
direction: 1,
|
|
64
65
|
ariaNotify: ariaNotifyPlugin,
|
|
65
|
-
getIntl: getIntl
|
|
66
|
+
getIntl: getIntl,
|
|
67
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
66
68
|
}), list);
|
|
67
69
|
bindKeymapWithCommand(moveLeft.common, activateNextResizeArea({
|
|
68
70
|
direction: -1,
|
|
69
71
|
ariaNotify: ariaNotifyPlugin,
|
|
70
|
-
getIntl: getIntl
|
|
72
|
+
getIntl: getIntl,
|
|
73
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
71
74
|
}), list);
|
|
72
75
|
bindKeymapWithCommand(decreaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api)(-10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
73
76
|
bindKeymapWithCommand(increaseMediaSize.common, changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api)(10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
@@ -22,7 +22,7 @@ import { isHeaderRowRequired, transformSliceTableLayoutDefaultToCenter } from '.
|
|
|
22
22
|
import { defaultHoveredCell, defaultTableSelection } from './default-table-selection';
|
|
23
23
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
24
24
|
import { pluginKey } from './plugin-key';
|
|
25
|
-
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) {
|
|
25
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) {
|
|
26
26
|
var _accessibilityUtils;
|
|
27
27
|
var state = createPluginState(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
28
28
|
pluginConfig: pluginConfig,
|
|
@@ -278,7 +278,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
278
278
|
blur: handleBlur,
|
|
279
279
|
mousedown: withCellTracking(handleMouseDown),
|
|
280
280
|
mouseleave: handleMouseLeave,
|
|
281
|
-
mousemove: whenTableInFocus(handleMouseMove),
|
|
281
|
+
mousemove: whenTableInFocus(handleMouseMove(nodeViewPortalProviderAPI)),
|
|
282
282
|
mouseenter: handleMouseEnter,
|
|
283
283
|
mouseup: whenTableInFocus(handleMouseUp),
|
|
284
284
|
click: withCellTracking(whenTableInFocus(handleClick))
|
|
@@ -18,7 +18,7 @@ import { currentColWidth, getResizeState, getTableMaxWidth, pointsAtCell, resize
|
|
|
18
18
|
import { TABLE_OFFSET_IN_COMMENT_EDITOR } from './utils/consts';
|
|
19
19
|
import { getScalingPercentForTableWithoutWidth, getTableScalingPercent } from './utils/misc';
|
|
20
20
|
import { scaleResizeState } from './utils/resize-column';
|
|
21
|
-
export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
21
|
+
export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
22
22
|
var _originalTable$attrs;
|
|
23
23
|
var state = view.state,
|
|
24
24
|
dispatch = view.dispatch;
|
|
@@ -103,7 +103,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
103
103
|
|
|
104
104
|
// When we start resizing a column we need to ensure the underlying tooltip is removed from the decoration to avoid
|
|
105
105
|
// unnecessary tooltips being displayed during drag.
|
|
106
|
-
updateResizeHandleDecorations(undefined, undefined, false)(state, dispatch);
|
|
106
|
+
updateResizeHandleDecorations(nodeViewPortalProviderAPI, undefined, undefined, false)(state, dispatch);
|
|
107
107
|
|
|
108
108
|
// for new column resizing, take the current scaled version of table widths and use those as the basis for resizing
|
|
109
109
|
// implication: the scaled version of the table becomes the source of truth
|
|
@@ -8,7 +8,7 @@ import { handleMouseDown } from './event-handlers';
|
|
|
8
8
|
import { createPluginState, getPluginState } from './plugin-factory';
|
|
9
9
|
import { pluginKey } from './plugin-key';
|
|
10
10
|
import { getResizeCellPos } from './utils';
|
|
11
|
-
export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, api, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
11
|
+
export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
12
12
|
var _ref$lastColumnResiza = _ref.lastColumnResizable,
|
|
13
13
|
lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
|
|
14
14
|
return new SafePlugin({
|
|
@@ -46,7 +46,7 @@ export function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorF
|
|
|
46
46
|
isColumnKeyboardResizeStarted = isKeyboardResize;
|
|
47
47
|
}
|
|
48
48
|
if (resizeHandlePos !== null && (!dragging || isColumnKeyboardResizeStarted)) {
|
|
49
|
-
if (handleMouseDown(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, api, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor)) {
|
|
49
|
+
if (handleMouseDown(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor)) {
|
|
50
50
|
var _state = view.state,
|
|
51
51
|
_dispatch = view.dispatch;
|
|
52
52
|
return setResizeHandlePos(resizeHandlePos)(_state, _dispatch);
|