@atlaskit/editor-plugin-table 7.31.0 → 7.31.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 +17 -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/ui/FloatingContextualMenu/ContextualMenu.js +12 -17
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +8 -11
- package/dist/cjs/ui/FloatingDragMenu/index.js +1 -4
- package/dist/cjs/ui/FloatingDragMenu/styles.js +1 -2
- package/dist/cjs/utils/decoration.js +28 -8
- package/dist/cjs/utils/drag-menu.js +3 -4
- 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/ui/FloatingContextualMenu/ContextualMenu.js +1 -8
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +8 -9
- package/dist/es2019/ui/FloatingDragMenu/index.js +1 -3
- package/dist/es2019/ui/FloatingDragMenu/styles.js +2 -2
- package/dist/es2019/utils/decoration.js +26 -9
- package/dist/es2019/utils/drag-menu.js +2 -2
- 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/ui/FloatingContextualMenu/ContextualMenu.js +12 -17
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +8 -11
- package/dist/esm/ui/FloatingDragMenu/index.js +1 -4
- package/dist/esm/ui/FloatingDragMenu/styles.js +1 -2
- package/dist/esm/utils/decoration.js +28 -8
- package/dist/esm/utils/drag-menu.js +3 -4
- 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/ui/FloatingDragMenu/DragMenu.d.ts +0 -1
- package/dist/types/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types/utils/decoration.d.ts +2 -1
- package/dist/types/utils/drag-menu.d.ts +1 -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/ui/FloatingDragMenu/DragMenu.d.ts +0 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/styles.d.ts +1 -1
- package/dist/types-ts4.5/utils/decoration.d.ts +2 -1
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -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/ui/FloatingContextualMenu/ContextualMenu.tsx +1 -5
- package/src/ui/FloatingDragMenu/DragMenu.tsx +5 -14
- package/src/ui/FloatingDragMenu/index.tsx +2 -6
- package/src/ui/FloatingDragMenu/styles.ts +4 -6
- package/src/utils/decoration.ts +39 -13
- package/src/utils/drag-menu.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.31.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#164992](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/164992)
|
|
8
|
+
[`16878c96150af`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/16878c96150af) -
|
|
9
|
+
tidy table sort order experiment
|
|
10
|
+
|
|
11
|
+
## 7.31.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#165078](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165078)
|
|
16
|
+
[`770231c1e2f01`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/770231c1e2f01) -
|
|
17
|
+
ED-25611: migrates table plugin from reactdom to portalprovider
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 7.31.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -25,7 +25,7 @@ var getTablePluginCommand = function getTablePluginCommand(actionPayload, origin
|
|
|
25
25
|
return (originalTr || tr).setMeta('addToHistory', false);
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
|
-
var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos) {
|
|
28
|
+
var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI) {
|
|
29
29
|
return function (state, dispatch) {
|
|
30
30
|
var customTr = state.tr;
|
|
31
31
|
var _getPluginState = (0, _pluginFactory.getPluginState)(state),
|
|
@@ -37,7 +37,7 @@ var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosi
|
|
|
37
37
|
if (!allowColumnResizing) {
|
|
38
38
|
return false;
|
|
39
39
|
}
|
|
40
|
-
var decorationsWithWidget = (0, _utils2.buildColumnResizingDecorations)(rowIndex, columnIndex, true, getIntl)({
|
|
40
|
+
var decorationsWithWidget = (0, _utils2.buildColumnResizingDecorations)(rowIndex, columnIndex, true, getIntl, nodeViewPortalProviderAPI)({
|
|
41
41
|
tr: customTr,
|
|
42
42
|
decorationSet: (0, _plugin.getDecorations)(state)
|
|
43
43
|
});
|
|
@@ -69,7 +69,8 @@ var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosi
|
|
|
69
69
|
};
|
|
70
70
|
var initiateKeyboardColumnResizing = exports.initiateKeyboardColumnResizing = function initiateKeyboardColumnResizing(_ref) {
|
|
71
71
|
var ariaNotify = _ref.ariaNotify,
|
|
72
|
-
getIntl = _ref.getIntl
|
|
72
|
+
getIntl = _ref.getIntl,
|
|
73
|
+
nodeViewPortalProviderAPI = _ref.nodeViewPortalProviderAPI;
|
|
73
74
|
return function (state, dispatch, view) {
|
|
74
75
|
var selection = state.selection;
|
|
75
76
|
var selectionRect = (0, _utils.isSelectionType)(selection, 'cell') ? (0, _utils.getSelectionRect)(selection) : (0, _utils.findCellRectClosestToPos)(selection.$from);
|
|
@@ -80,7 +81,7 @@ var initiateKeyboardColumnResizing = exports.initiateKeyboardColumnResizing = fu
|
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
83
|
if (selectionRect && cell && view) {
|
|
83
|
-
return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos)(state, dispatch);
|
|
84
|
+
return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos, nodeViewPortalProviderAPI)(state, dispatch);
|
|
84
85
|
}
|
|
85
86
|
return false;
|
|
86
87
|
};
|
|
@@ -88,7 +89,8 @@ var initiateKeyboardColumnResizing = exports.initiateKeyboardColumnResizing = fu
|
|
|
88
89
|
var activateNextResizeArea = exports.activateNextResizeArea = function activateNextResizeArea(_ref2) {
|
|
89
90
|
var direction = _ref2.direction,
|
|
90
91
|
ariaNotify = _ref2.ariaNotify,
|
|
91
|
-
getIntl = _ref2.getIntl
|
|
92
|
+
getIntl = _ref2.getIntl,
|
|
93
|
+
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
|
|
92
94
|
return function (state, dispatch, view) {
|
|
93
95
|
var _ref3 = (0, _pluginFactory2.getPluginState)(state) || {},
|
|
94
96
|
resizeHandlePos = _ref3.resizeHandlePos;
|
|
@@ -134,17 +136,17 @@ var activateNextResizeArea = exports.activateNextResizeArea = function activateN
|
|
|
134
136
|
// we are somewhere in between the side columns of the table
|
|
135
137
|
var offset = $nextCell.pos - $nextCell.start(-1);
|
|
136
138
|
var rectForNextCell = tableMap.findCell(offset);
|
|
137
|
-
return updateResizeHandleAndStatePosition(rectForNextCell.top, rectForNextCell.right, $nextCell.pos)(state, dispatch, view);
|
|
139
|
+
return updateResizeHandleAndStatePosition(rectForNextCell.top, rectForNextCell.right, $nextCell.pos, nodeViewPortalProviderAPI)(state, dispatch, view);
|
|
138
140
|
} else {
|
|
139
141
|
// current position is in the one of the side columns of the table(left or right)
|
|
140
142
|
if (currentCellRect.left === 0) {
|
|
141
143
|
var lastCellInCurrentRow = tableMap.positionAt(currentCellRect.top, tableMap.width - 1, tableNode) + closestTable.start;
|
|
142
144
|
var $lastCell = state.doc.resolve(lastCellInCurrentRow);
|
|
143
|
-
return updateResizeHandleAndStatePosition(currentCellRect.top, tableMap.width, $lastCell.pos)(state, dispatch, view);
|
|
145
|
+
return updateResizeHandleAndStatePosition(currentCellRect.top, tableMap.width, $lastCell.pos, nodeViewPortalProviderAPI)(state, dispatch, view);
|
|
144
146
|
} else if (tableMap.width === currentCellRect.right) {
|
|
145
147
|
var firsCellInCurrentRow = tableMap.positionAt(currentCellRect.top, 0, tableNode) + closestTable.start;
|
|
146
148
|
var _$nextCell = state.doc.resolve(firsCellInCurrentRow);
|
|
147
|
-
return updateResizeHandleAndStatePosition(currentCellRect.top, 1, _$nextCell.pos)(state, dispatch);
|
|
149
|
+
return updateResizeHandleAndStatePosition(currentCellRect.top, 1, _$nextCell.pos, nodeViewPortalProviderAPI)(state, dispatch);
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
152
|
return false;
|
|
@@ -469,7 +469,7 @@ var hideInsertColumnOrRowButton = exports.hideInsertColumnOrRowButton = function
|
|
|
469
469
|
return tr.setMeta('addToHistory', false);
|
|
470
470
|
});
|
|
471
471
|
};
|
|
472
|
-
var addResizeHandleDecorations = exports.addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, isKeyboardResize) {
|
|
472
|
+
var addResizeHandleDecorations = exports.addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize) {
|
|
473
473
|
return (0, _pluginFactory.createCommand)(function (state) {
|
|
474
474
|
var tableNode = (0, _utils2.findTable)(state.selection);
|
|
475
475
|
var _getPluginState3 = (0, _pluginFactory.getPluginState)(state),
|
|
@@ -481,7 +481,7 @@ var addResizeHandleDecorations = exports.addResizeHandleDecorations = function a
|
|
|
481
481
|
return {
|
|
482
482
|
type: 'ADD_RESIZE_HANDLE_DECORATIONS',
|
|
483
483
|
data: {
|
|
484
|
-
decorationSet: (0, _utils3.buildColumnResizingDecorations)(rowIndex, columnIndex, includeTooltip, getIntl)({
|
|
484
|
+
decorationSet: (0, _utils3.buildColumnResizingDecorations)(rowIndex, columnIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI)({
|
|
485
485
|
tr: state.tr,
|
|
486
486
|
decorationSet: (0, _plugin.getDecorations)(state)
|
|
487
487
|
}),
|
|
@@ -495,7 +495,7 @@ var addResizeHandleDecorations = exports.addResizeHandleDecorations = function a
|
|
|
495
495
|
return tr.setMeta('addToHistory', false);
|
|
496
496
|
});
|
|
497
497
|
};
|
|
498
|
-
var updateResizeHandleDecorations = exports.updateResizeHandleDecorations = function updateResizeHandleDecorations(rowIndex, columnIndex, includeTooltip) {
|
|
498
|
+
var updateResizeHandleDecorations = exports.updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip) {
|
|
499
499
|
return (0, _pluginFactory.createCommand)(function (state) {
|
|
500
500
|
var tableNode = (0, _utils2.findTable)(state.selection);
|
|
501
501
|
var _getPluginState4 = (0, _pluginFactory.getPluginState)(state),
|
|
@@ -516,7 +516,7 @@ var updateResizeHandleDecorations = exports.updateResizeHandleDecorations = func
|
|
|
516
516
|
return {
|
|
517
517
|
type: 'UPDATE_RESIZE_HANDLE_DECORATIONS',
|
|
518
518
|
data: {
|
|
519
|
-
decorationSet: (0, _utils3.buildColumnResizingDecorations)(resolvedRowIndex, resolvedColumnIndex, resolvedIncludeTooltip, getIntl)({
|
|
519
|
+
decorationSet: (0, _utils3.buildColumnResizingDecorations)(resolvedRowIndex, resolvedColumnIndex, resolvedIncludeTooltip, getIntl, nodeViewPortalProviderAPI)({
|
|
520
520
|
tr: state.tr,
|
|
521
521
|
decorationSet: (0, _plugin.getDecorations)(state)
|
|
522
522
|
}),
|
|
@@ -254,78 +254,82 @@ var handleMouseLeave = exports.handleMouseLeave = function handleMouseLeave(view
|
|
|
254
254
|
|
|
255
255
|
// IMPORTANT: The mouse move handler has been setup with RAF schedule to avoid Reflows which will occur as some methods
|
|
256
256
|
// need to access the mouse event offset position and also the target clientWidth vallue.
|
|
257
|
-
var handleMouseMoveDebounce =
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
var element = event.target;
|
|
262
|
-
if ((0, _utils3.isColumnControlsDecorations)(element) || (0, _utils3.isDragColumnFloatingInsertDot)(element)) {
|
|
263
|
-
var state = view.state,
|
|
264
|
-
dispatch = view.dispatch;
|
|
265
|
-
var _getPluginState6 = (0, _pluginFactory2.getPluginState)(state),
|
|
266
|
-
insertColumnButtonIndex = _getPluginState6.insertColumnButtonIndex;
|
|
267
|
-
var _getColumnOrRowIndex9 = (0, _utils3.getColumnOrRowIndex)(element),
|
|
268
|
-
_getColumnOrRowIndex10 = (0, _slicedToArray2.default)(_getColumnOrRowIndex9, 2),
|
|
269
|
-
startIndex = _getColumnOrRowIndex10[0],
|
|
270
|
-
endIndex = _getColumnOrRowIndex10[1];
|
|
271
|
-
var positionColumn = (0, _utils3.getMousePositionHorizontalRelativeByElement)(event, offsetX, undefined) === 'right' ? endIndex : startIndex;
|
|
272
|
-
if (positionColumn !== insertColumnButtonIndex) {
|
|
273
|
-
return (0, _commands.showInsertColumnButton)(positionColumn)(state, dispatch);
|
|
257
|
+
var handleMouseMoveDebounce = function handleMouseMoveDebounce(nodeViewPortalProviderAPI) {
|
|
258
|
+
return (0, _rafSchd.default)(function (view, event, offsetX) {
|
|
259
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
260
|
+
return false;
|
|
274
261
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
262
|
+
var element = event.target;
|
|
263
|
+
if ((0, _utils3.isColumnControlsDecorations)(element) || (0, _utils3.isDragColumnFloatingInsertDot)(element)) {
|
|
264
|
+
var state = view.state,
|
|
265
|
+
dispatch = view.dispatch;
|
|
266
|
+
var _getPluginState6 = (0, _pluginFactory2.getPluginState)(state),
|
|
267
|
+
insertColumnButtonIndex = _getPluginState6.insertColumnButtonIndex;
|
|
268
|
+
var _getColumnOrRowIndex9 = (0, _utils3.getColumnOrRowIndex)(element),
|
|
269
|
+
_getColumnOrRowIndex10 = (0, _slicedToArray2.default)(_getColumnOrRowIndex9, 2),
|
|
270
|
+
startIndex = _getColumnOrRowIndex10[0],
|
|
271
|
+
endIndex = _getColumnOrRowIndex10[1];
|
|
272
|
+
var positionColumn = (0, _utils3.getMousePositionHorizontalRelativeByElement)(event, offsetX, undefined) === 'right' ? endIndex : startIndex;
|
|
273
|
+
if (positionColumn !== insertColumnButtonIndex) {
|
|
274
|
+
return (0, _commands.showInsertColumnButton)(positionColumn)(state, dispatch);
|
|
275
|
+
}
|
|
288
276
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
277
|
+
if ((0, _utils3.isRowControlsButton)(element) || (0, _utils3.isDragRowFloatingInsertDot)(element)) {
|
|
278
|
+
var _state3 = view.state,
|
|
279
|
+
_dispatch4 = view.dispatch;
|
|
280
|
+
var _getPluginState7 = (0, _pluginFactory2.getPluginState)(_state3),
|
|
281
|
+
insertRowButtonIndex = _getPluginState7.insertRowButtonIndex;
|
|
282
|
+
var _getColumnOrRowIndex11 = (0, _utils3.getColumnOrRowIndex)(element),
|
|
283
|
+
_getColumnOrRowIndex12 = (0, _slicedToArray2.default)(_getColumnOrRowIndex11, 2),
|
|
284
|
+
_startIndex3 = _getColumnOrRowIndex12[0],
|
|
285
|
+
_endIndex2 = _getColumnOrRowIndex12[1];
|
|
286
|
+
var positionRow = (0, _utils3.getMousePositionVerticalRelativeByElement)(event) === 'bottom' ? _endIndex2 : _startIndex3;
|
|
287
|
+
if (positionRow !== insertRowButtonIndex) {
|
|
288
|
+
return (0, _commands.showInsertRowButton)(positionRow)(_state3, _dispatch4);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
if (!(0, _utils3.isResizeHandleDecoration)(element) && (0, _utils3.isCell)(element)) {
|
|
292
|
+
var _positionColumn = (0, _utils3.getMousePositionHorizontalRelativeByElement)(event, offsetX, _types.RESIZE_HANDLE_AREA_DECORATION_GAP);
|
|
293
|
+
if (_positionColumn !== null) {
|
|
294
|
+
var _state4 = view.state,
|
|
295
|
+
_dispatch5 = view.dispatch;
|
|
296
|
+
var _getPluginState8 = (0, _pluginFactory2.getPluginState)(_state4),
|
|
297
|
+
resizeHandleColumnIndex = _getPluginState8.resizeHandleColumnIndex,
|
|
298
|
+
resizeHandleRowIndex = _getPluginState8.resizeHandleRowIndex;
|
|
299
|
+
var isKeyboardResize = (0, _pluginFactory2.getPluginState)(_state4).isKeyboardResize;
|
|
300
|
+
var tableCell = (0, _utils.closestElement)(element, 'td, th');
|
|
301
|
+
var cellStartPosition = view.posAtDOM(tableCell, 0);
|
|
302
|
+
var rect = (0, _utils2.findCellRectClosestToPos)(_state4.doc.resolve(cellStartPosition));
|
|
303
|
+
if (rect) {
|
|
304
|
+
var columnEndIndexTarget = _positionColumn === 'left' ? rect.left : rect.right;
|
|
305
|
+
var rowIndexTarget = rect.top;
|
|
306
|
+
if ((columnEndIndexTarget !== resizeHandleColumnIndex || rowIndexTarget !== resizeHandleRowIndex || !(0, _utils3.hasResizeHandler)({
|
|
307
|
+
target: element,
|
|
308
|
+
columnEndIndexTarget: columnEndIndexTarget
|
|
309
|
+
})) && !isKeyboardResize // if initiated by keyboard don't need to react on hover for other resize sliders
|
|
310
|
+
) {
|
|
311
|
+
return (0, _commands.addResizeHandleDecorations)(rowIndexTarget, columnEndIndexTarget, true, nodeViewPortalProviderAPI)(_state4, _dispatch5);
|
|
312
|
+
}
|
|
311
313
|
}
|
|
312
314
|
}
|
|
313
315
|
}
|
|
314
|
-
}
|
|
315
|
-
return false;
|
|
316
|
-
});
|
|
317
|
-
var handleMouseMove = exports.handleMouseMove = function handleMouseMove(view, event) {
|
|
318
|
-
if (!(event.target instanceof HTMLElement)) {
|
|
319
316
|
return false;
|
|
320
|
-
}
|
|
317
|
+
});
|
|
318
|
+
};
|
|
319
|
+
var handleMouseMove = exports.handleMouseMove = function handleMouseMove(nodeViewPortalProviderAPI) {
|
|
320
|
+
return function (view, event) {
|
|
321
|
+
if (!(event.target instanceof HTMLElement)) {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
321
324
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
// NOTE: When accessing offsetX in gecko from a deferred callback, it will return 0. However it will be non-zero if accessed
|
|
326
|
+
// within the scope of it's initial mouse move handler. Also Chrome does return the correct value, however it could trigger
|
|
327
|
+
// a reflow. So for now this will just grab the offsetX value immediately for gecko and chrome will calculate later
|
|
328
|
+
// in the deferred callback handler.
|
|
329
|
+
// Bug Tracking: https://bugzilla.mozilla.org/show_bug.cgi?id=1882903
|
|
330
|
+
handleMouseMoveDebounce(nodeViewPortalProviderAPI)(view, event, _utils.browser.gecko ? event.offsetX : NaN);
|
|
331
|
+
return false;
|
|
332
|
+
};
|
|
329
333
|
};
|
|
330
334
|
function handleTripleClick(view, pos) {
|
|
331
335
|
var state = view.state,
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -208,6 +208,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
208
208
|
var dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
209
209
|
dispatch = _ref2.dispatch,
|
|
210
210
|
portalProviderAPI = _ref2.portalProviderAPI,
|
|
211
|
+
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI,
|
|
211
212
|
eventDispatcher = _ref2.eventDispatcher,
|
|
212
213
|
getIntl = _ref2.getIntl;
|
|
213
214
|
var _ref3 = options || {},
|
|
@@ -221,12 +222,13 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
221
222
|
isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled,
|
|
222
223
|
isCommentEditor = _ref3.isCommentEditor,
|
|
223
224
|
isChromelessEditor = _ref3.isChromelessEditor;
|
|
224
|
-
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor);
|
|
225
|
+
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor);
|
|
225
226
|
}
|
|
226
227
|
}, {
|
|
227
228
|
name: 'tablePMColResizing',
|
|
228
229
|
plugin: function plugin(_ref4) {
|
|
229
|
-
var dispatch = _ref4.dispatch
|
|
230
|
+
var dispatch = _ref4.dispatch,
|
|
231
|
+
nodeViewPortalProviderAPI = _ref4.nodeViewPortalProviderAPI;
|
|
230
232
|
var _ref5 = options || {},
|
|
231
233
|
fullWidthEnabled = _ref5.fullWidthEnabled,
|
|
232
234
|
tableOptions = _ref5.tableOptions,
|
|
@@ -238,7 +240,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
238
240
|
allowColumnResizing = _pluginConfig2.allowColumnResizing;
|
|
239
241
|
return allowColumnResizing ? (0, _tableResizing.createPlugin)(dispatch, {
|
|
240
242
|
lastColumnResizable: !fullWidthEnabled
|
|
241
|
-
}, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, api, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled, isTableAlignmentEnabled, !!(options !== null && options !== void 0 && options.isCommentEditor)) : undefined;
|
|
243
|
+
}, defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled || false, isNewColumnResizingEnabled, isTableAlignmentEnabled, !!(options !== null && options !== void 0 && options.isCommentEditor)) : undefined;
|
|
242
244
|
}
|
|
243
245
|
}, {
|
|
244
246
|
name: 'tableEditing',
|
|
@@ -251,7 +253,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
251
253
|
{
|
|
252
254
|
name: 'tableKeymap',
|
|
253
255
|
plugin: function plugin(_ref6) {
|
|
254
|
-
var getIntl = _ref6.getIntl
|
|
256
|
+
var getIntl = _ref6.getIntl,
|
|
257
|
+
nodeViewPortalProviderAPI = _ref6.nodeViewPortalProviderAPI;
|
|
255
258
|
var _ref7 = options || {},
|
|
256
259
|
dragAndDropEnabled = _ref7.dragAndDropEnabled,
|
|
257
260
|
_ref7$isTableScalingE = _ref7.isTableScalingEnabled,
|
|
@@ -266,7 +269,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
266
269
|
isChromelessEditor = _ref7$isChromelessEdi === void 0 ? false : _ref7$isChromelessEdi,
|
|
267
270
|
_ref7$tableResizingEn = _ref7.tableResizingEnabled,
|
|
268
271
|
tableResizingEnabled = _ref7$tableResizingEn === void 0 ? false : _ref7$tableResizingEn;
|
|
269
|
-
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
272
|
+
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, tableResizingEnabled);
|
|
270
273
|
}
|
|
271
274
|
}, {
|
|
272
275
|
name: 'tableSelectionKeymap',
|
|
@@ -313,45 +316,46 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
313
316
|
}
|
|
314
317
|
}, {
|
|
315
318
|
name: 'tableViewModeSort',
|
|
316
|
-
plugin: function plugin() {
|
|
317
|
-
|
|
319
|
+
plugin: function plugin(_ref13) {
|
|
320
|
+
var nodeViewPortalProviderAPI = _ref13.nodeViewPortalProviderAPI;
|
|
321
|
+
return api !== null && api !== void 0 && api.editorViewMode ? (0, _viewModeSort.createPlugin)(api, nodeViewPortalProviderAPI) : undefined;
|
|
318
322
|
}
|
|
319
323
|
}, {
|
|
320
324
|
name: 'tableLocalId',
|
|
321
|
-
plugin: function plugin(
|
|
322
|
-
var dispatch =
|
|
325
|
+
plugin: function plugin(_ref14) {
|
|
326
|
+
var dispatch = _ref14.dispatch;
|
|
323
327
|
return (0, _tableLocalId.createPlugin)(dispatch);
|
|
324
328
|
}
|
|
325
329
|
}, {
|
|
326
330
|
name: 'tableWidth',
|
|
327
|
-
plugin: function plugin(
|
|
331
|
+
plugin: function plugin(_ref15) {
|
|
328
332
|
var _options$fullWidthEna, _options$isTableScali, _options$isTableAlign, _options$isCommentEdi;
|
|
329
|
-
var dispatchAnalyticsEvent =
|
|
330
|
-
dispatch =
|
|
333
|
+
var dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent,
|
|
334
|
+
dispatch = _ref15.dispatch;
|
|
331
335
|
return options !== null && options !== void 0 && options.tableResizingEnabled ? (0, _tableWidth.createPlugin)(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;
|
|
332
336
|
}
|
|
333
337
|
}, {
|
|
334
338
|
name: 'tableWidthInCommentFix',
|
|
335
|
-
plugin: function plugin(
|
|
339
|
+
plugin: function plugin(_ref16) {
|
|
336
340
|
var _options$isTableAlign2;
|
|
337
|
-
var dispatch =
|
|
341
|
+
var dispatch = _ref16.dispatch;
|
|
338
342
|
return options !== null && options !== void 0 && options.tableResizingEnabled && options !== null && options !== void 0 && options.isCommentEditor ? (0, _tableWidthInCommentFix.createPlugin)(dispatch, (_options$isTableAlign2 = options === null || options === void 0 ? void 0 : options.isTableAlignmentEnabled) !== null && _options$isTableAlign2 !== void 0 ? _options$isTableAlign2 : false) : undefined;
|
|
339
343
|
}
|
|
340
344
|
},
|
|
341
345
|
// TODO: should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
342
346
|
{
|
|
343
347
|
name: 'tableOverflowAnalyticsPlugin',
|
|
344
|
-
plugin: function plugin(
|
|
348
|
+
plugin: function plugin(_ref17) {
|
|
345
349
|
var _options$tableResizin;
|
|
346
|
-
var dispatch =
|
|
347
|
-
dispatchAnalyticsEvent =
|
|
350
|
+
var dispatch = _ref17.dispatch,
|
|
351
|
+
dispatchAnalyticsEvent = _ref17.dispatchAnalyticsEvent;
|
|
348
352
|
return (0, _tableAnalytics.createPlugin)(dispatch, dispatchAnalyticsEvent, (_options$tableResizin = options === null || options === void 0 ? void 0 : options.tableResizingEnabled) !== null && _options$tableResizin !== void 0 ? _options$tableResizin : false);
|
|
349
353
|
}
|
|
350
354
|
}, {
|
|
351
355
|
name: 'tableAnalyticsPlugin',
|
|
352
|
-
plugin: function plugin(
|
|
353
|
-
var dispatch =
|
|
354
|
-
dispatchAnalyticsEvent =
|
|
356
|
+
plugin: function plugin(_ref18) {
|
|
357
|
+
var dispatch = _ref18.dispatch,
|
|
358
|
+
dispatchAnalyticsEvent = _ref18.dispatchAnalyticsEvent;
|
|
355
359
|
return (0, _plugin.createPlugin)(dispatch, dispatchAnalyticsEvent);
|
|
356
360
|
}
|
|
357
361
|
}, {
|
|
@@ -382,13 +386,13 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
382
386
|
}
|
|
383
387
|
return plugins;
|
|
384
388
|
},
|
|
385
|
-
contentComponent: function contentComponent(
|
|
389
|
+
contentComponent: function contentComponent(_ref19) {
|
|
386
390
|
var _api$featureFlags;
|
|
387
|
-
var editorView =
|
|
388
|
-
popupsMountPoint =
|
|
389
|
-
popupsBoundariesElement =
|
|
390
|
-
popupsScrollableElement =
|
|
391
|
-
dispatchAnalyticsEvent =
|
|
391
|
+
var editorView = _ref19.editorView,
|
|
392
|
+
popupsMountPoint = _ref19.popupsMountPoint,
|
|
393
|
+
popupsBoundariesElement = _ref19.popupsBoundariesElement,
|
|
394
|
+
popupsScrollableElement = _ref19.popupsScrollableElement,
|
|
395
|
+
dispatchAnalyticsEvent = _ref19.dispatchAnalyticsEvent;
|
|
392
396
|
return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
393
397
|
component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
|
|
394
398
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
@@ -404,32 +408,32 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
404
408
|
stickyHeadersState: _stickyHeaders.pluginKey,
|
|
405
409
|
dragAndDropState: _dragAndDrop.pluginKey
|
|
406
410
|
},
|
|
407
|
-
render: function render(
|
|
408
|
-
var resizingPluginState =
|
|
409
|
-
stickyHeadersState =
|
|
410
|
-
tablePluginState =
|
|
411
|
-
tableWidthPluginState =
|
|
412
|
-
dragAndDropState =
|
|
411
|
+
render: function render(_ref20) {
|
|
412
|
+
var resizingPluginState = _ref20.tableResizingPluginState,
|
|
413
|
+
stickyHeadersState = _ref20.stickyHeadersState,
|
|
414
|
+
tablePluginState = _ref20.tablePluginState,
|
|
415
|
+
tableWidthPluginState = _ref20.tableWidthPluginState,
|
|
416
|
+
dragAndDropState = _ref20.dragAndDropState;
|
|
413
417
|
var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
414
418
|
var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
|
|
415
419
|
var resizingTableLocalId = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableLocalId;
|
|
416
420
|
var resizingTableRef = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.tableRef;
|
|
417
421
|
var isResizing = isColumnResizing || isTableResizing;
|
|
418
422
|
var widthToWidest = tablePluginState === null || tablePluginState === void 0 ? void 0 : tablePluginState.widthToWidest;
|
|
419
|
-
var
|
|
420
|
-
tableNode =
|
|
421
|
-
tablePos =
|
|
422
|
-
targetCellPosition =
|
|
423
|
-
isContextualMenuOpen =
|
|
424
|
-
tableRef =
|
|
425
|
-
pluginConfig =
|
|
426
|
-
insertColumnButtonIndex =
|
|
427
|
-
insertRowButtonIndex =
|
|
428
|
-
isHeaderColumnEnabled =
|
|
429
|
-
isHeaderRowEnabled =
|
|
430
|
-
isDragAndDropEnabled =
|
|
431
|
-
tableWrapperTarget =
|
|
432
|
-
isCellMenuOpenByKeyboard =
|
|
423
|
+
var _ref21 = tablePluginState,
|
|
424
|
+
tableNode = _ref21.tableNode,
|
|
425
|
+
tablePos = _ref21.tablePos,
|
|
426
|
+
targetCellPosition = _ref21.targetCellPosition,
|
|
427
|
+
isContextualMenuOpen = _ref21.isContextualMenuOpen,
|
|
428
|
+
tableRef = _ref21.tableRef,
|
|
429
|
+
pluginConfig = _ref21.pluginConfig,
|
|
430
|
+
insertColumnButtonIndex = _ref21.insertColumnButtonIndex,
|
|
431
|
+
insertRowButtonIndex = _ref21.insertRowButtonIndex,
|
|
432
|
+
isHeaderColumnEnabled = _ref21.isHeaderColumnEnabled,
|
|
433
|
+
isHeaderRowEnabled = _ref21.isHeaderRowEnabled,
|
|
434
|
+
isDragAndDropEnabled = _ref21.isDragAndDropEnabled,
|
|
435
|
+
tableWrapperTarget = _ref21.tableWrapperTarget,
|
|
436
|
+
isCellMenuOpenByKeyboard = _ref21.isCellMenuOpenByKeyboard;
|
|
433
437
|
var allowControls = pluginConfig.allowControls;
|
|
434
438
|
var stickyHeader = stickyHeadersState ? (0, _stickyHeaders.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
435
439
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, targetCellPosition && (tableRef || isCellMenuOpenByKeyboard) && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/_react.default.createElement(_FloatingContextualButton.default, {
|
|
@@ -522,8 +526,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
522
526
|
}));
|
|
523
527
|
},
|
|
524
528
|
pluginsOptions: {
|
|
525
|
-
quickInsert: function quickInsert(
|
|
526
|
-
var formatMessage =
|
|
529
|
+
quickInsert: function quickInsert(_ref22) {
|
|
530
|
+
var formatMessage = _ref22.formatMessage;
|
|
527
531
|
return [{
|
|
528
532
|
id: 'table',
|
|
529
533
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
@@ -24,13 +24,13 @@ var updateLastCellElement = function updateLastCellElement(lastCellElementsDecor
|
|
|
24
24
|
return (0, _decoration.updateDecorations)(tr.doc, decorationSet, lastCellElementsDecorations, _types.TableDecorations.LAST_CELL_ELEMENT);
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
var buildColumnResizingDecorations = exports.buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl) {
|
|
27
|
+
var buildColumnResizingDecorations = exports.buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI) {
|
|
28
28
|
return function (_ref3) {
|
|
29
29
|
var tr = _ref3.tr,
|
|
30
30
|
decorationSet = _ref3.decorationSet;
|
|
31
31
|
var _ref4 = columnEndIndex < 0 ? emptyDecorations : (0, _decoration.createResizeHandleDecoration)(tr, rowEndIndex, {
|
|
32
32
|
right: columnEndIndex
|
|
33
|
-
}, includeTooltip, getIntl),
|
|
33
|
+
}, includeTooltip, getIntl, nodeViewPortalProviderAPI),
|
|
34
34
|
_ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
|
35
35
|
columnResizesDecorations = _ref5[0],
|
|
36
36
|
lastCellElementsDecorations = _ref5[1];
|
|
@@ -14,19 +14,19 @@ var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
|
14
14
|
var _columnResize = require("../commands/column-resize");
|
|
15
15
|
var _insert = require("../commands/insert");
|
|
16
16
|
var _commandsWithAnalytics2 = require("../pm-plugins/drag-and-drop/commands-with-analytics");
|
|
17
|
-
function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
17
|
+
function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
18
18
|
var _pluginInjectionApi$a;
|
|
19
|
-
var isTableScalingEnabled = arguments.length >
|
|
20
|
-
var isTableAlignmentEnabled = arguments.length >
|
|
21
|
-
var isFullWidthEnabled = arguments.length >
|
|
22
|
-
var pluginInjectionApi = arguments.length >
|
|
23
|
-
var getIntl = arguments.length >
|
|
24
|
-
var isCellBackgroundDuplicated = arguments.length >
|
|
25
|
-
var isTableFixedColumnWidthsOptionEnabled = arguments.length >
|
|
26
|
-
var shouldUseIncreasedScalingPercent = arguments.length >
|
|
27
|
-
var isCommentEditor = arguments.length >
|
|
28
|
-
var isChromelessEditor = arguments.length >
|
|
29
|
-
var isTableResizingEnabled = arguments.length >
|
|
19
|
+
var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
20
|
+
var isTableAlignmentEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
21
|
+
var isFullWidthEnabled = arguments.length > 7 ? arguments[7] : undefined;
|
|
22
|
+
var pluginInjectionApi = arguments.length > 8 ? arguments[8] : undefined;
|
|
23
|
+
var getIntl = arguments.length > 9 ? arguments[9] : undefined;
|
|
24
|
+
var isCellBackgroundDuplicated = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : false;
|
|
25
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
|
|
26
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 12 ? arguments[12] : undefined;
|
|
27
|
+
var isCommentEditor = arguments.length > 13 ? arguments[13] : undefined;
|
|
28
|
+
var isChromelessEditor = arguments.length > 14 ? arguments[14] : undefined;
|
|
29
|
+
var isTableResizingEnabled = arguments.length > 15 ? arguments[15] : undefined;
|
|
30
30
|
var list = {};
|
|
31
31
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
32
32
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.nextCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
@@ -64,17 +64,20 @@ function keymapPlugin(getEditorContainerWidth, api, editorAnalyticsAPI, dragAndD
|
|
|
64
64
|
}
|
|
65
65
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.startColumnResizing.common, (0, _columnResize.initiateKeyboardColumnResizing)({
|
|
66
66
|
ariaNotify: ariaNotifyPlugin,
|
|
67
|
-
getIntl: getIntl
|
|
67
|
+
getIntl: getIntl,
|
|
68
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
68
69
|
}), list);
|
|
69
70
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveRight.common, (0, _columnResize.activateNextResizeArea)({
|
|
70
71
|
direction: 1,
|
|
71
72
|
ariaNotify: ariaNotifyPlugin,
|
|
72
|
-
getIntl: getIntl
|
|
73
|
+
getIntl: getIntl,
|
|
74
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
73
75
|
}), list);
|
|
74
76
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, (0, _columnResize.activateNextResizeArea)({
|
|
75
77
|
direction: -1,
|
|
76
78
|
ariaNotify: ariaNotifyPlugin,
|
|
77
|
-
getIntl: getIntl
|
|
79
|
+
getIntl: getIntl,
|
|
80
|
+
nodeViewPortalProviderAPI: nodeViewPortalProviderAPI
|
|
78
81
|
}), list);
|
|
79
82
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.decreaseMediaSize.common, (0, _commandsWithAnalytics.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI, api)(-10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, _analytics.INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
80
83
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.increaseMediaSize.common, (0, _commandsWithAnalytics.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI, api)(10, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, !!isCommentEditor, _analytics.INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
@@ -29,7 +29,7 @@ var _pluginFactory = require("./plugin-factory");
|
|
|
29
29
|
var _pluginKey = require("./plugin-key");
|
|
30
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
31
31
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
32
|
-
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) {
|
|
32
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) {
|
|
33
33
|
var _accessibilityUtils;
|
|
34
34
|
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
35
35
|
pluginConfig: pluginConfig,
|
|
@@ -285,7 +285,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
285
285
|
blur: _eventHandlers.handleBlur,
|
|
286
286
|
mousedown: (0, _eventHandlers.withCellTracking)(_eventHandlers.handleMouseDown),
|
|
287
287
|
mouseleave: _eventHandlers.handleMouseLeave,
|
|
288
|
-
mousemove: (0, _eventHandlers.whenTableInFocus)(_eventHandlers.handleMouseMove),
|
|
288
|
+
mousemove: (0, _eventHandlers.whenTableInFocus)((0, _eventHandlers.handleMouseMove)(nodeViewPortalProviderAPI)),
|
|
289
289
|
mouseenter: _eventHandlers.handleMouseEnter,
|
|
290
290
|
mouseup: (0, _eventHandlers.whenTableInFocus)(_eventHandlers.handleMouseUp),
|
|
291
291
|
click: (0, _eventHandlers.withCellTracking)((0, _eventHandlers.whenTableInFocus)(_eventHandlers.handleClick))
|
|
@@ -25,7 +25,7 @@ var _misc2 = require("./utils/misc");
|
|
|
25
25
|
var _resizeColumn = require("./utils/resize-column");
|
|
26
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
|
-
var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
28
|
+
var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
29
29
|
var _originalTable$attrs;
|
|
30
30
|
var state = view.state,
|
|
31
31
|
dispatch = view.dispatch;
|
|
@@ -110,7 +110,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
110
110
|
|
|
111
111
|
// When we start resizing a column we need to ensure the underlying tooltip is removed from the decoration to avoid
|
|
112
112
|
// unnecessary tooltips being displayed during drag.
|
|
113
|
-
(0, _misc.updateResizeHandleDecorations)(undefined, undefined, false)(state, dispatch);
|
|
113
|
+
(0, _misc.updateResizeHandleDecorations)(nodeViewPortalProviderAPI, undefined, undefined, false)(state, dispatch);
|
|
114
114
|
|
|
115
115
|
// for new column resizing, take the current scaled version of table widths and use those as the basis for resizing
|
|
116
116
|
// implication: the scaled version of the table becomes the source of truth
|
|
@@ -15,7 +15,7 @@ var _eventHandlers = require("./event-handlers");
|
|
|
15
15
|
var _pluginFactory2 = require("./plugin-factory");
|
|
16
16
|
var _pluginKey = require("./plugin-key");
|
|
17
17
|
var _utils = require("./utils");
|
|
18
|
-
function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, api, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
18
|
+
function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureFlags, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isTableScalingEnabled, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor) {
|
|
19
19
|
var _ref$lastColumnResiza = _ref.lastColumnResizable,
|
|
20
20
|
lastColumnResizable = _ref$lastColumnResiza === void 0 ? true : _ref$lastColumnResiza;
|
|
21
21
|
return new _safePlugin.SafePlugin({
|
|
@@ -53,7 +53,7 @@ function createPlugin(dispatch, _ref, getEditorContainerWidth, getEditorFeatureF
|
|
|
53
53
|
isColumnKeyboardResizeStarted = isKeyboardResize;
|
|
54
54
|
}
|
|
55
55
|
if (resizeHandlePos !== null && (!dragging || isColumnKeyboardResizeStarted)) {
|
|
56
|
-
if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, api, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor)) {
|
|
56
|
+
if ((0, _eventHandlers.handleMouseDown)(view, event, resizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, isTableScalingEnabled || false, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, isNewColumnResizingEnabled, isTableAlignmentEnabled, isCommentEditor)) {
|
|
57
57
|
var _state = view.state,
|
|
58
58
|
_dispatch = view.dispatch;
|
|
59
59
|
return (0, _commands.setResizeHandlePos)(resizeHandlePos)(_state, _dispatch);
|