@atlaskit/editor-plugin-table 7.6.4 → 7.6.6
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/commands/column-resize.js +62 -16
- package/dist/cjs/commands/go-to-next-cell.js +5 -2
- package/dist/cjs/commands-with-analytics.js +8 -2
- package/dist/cjs/nodeviews/ExternalDropTargets.js +2 -0
- package/dist/cjs/nodeviews/TableComponent.js +8 -6
- package/dist/cjs/nodeviews/TableResizer.js +2 -1
- package/dist/cjs/plugin.js +58 -57
- package/dist/cjs/pm-plugins/keymap.js +26 -8
- package/dist/cjs/pm-plugins/main.js +15 -4
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +4 -2
- package/dist/cjs/ui/DragHandle/index.js +2 -2
- package/dist/cjs/ui/DragPreview/index.js +2 -0
- package/dist/cjs/ui/FloatingContextualButton/FixedButton.js +10 -6
- package/dist/cjs/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/cjs/ui/FloatingInsertButton/InsertButton.js +1 -0
- package/dist/cjs/ui/LayoutButton/index.js +2 -0
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -0
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +3 -0
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -0
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +1 -0
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +4 -0
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/cjs/ui/common-styles.js +4 -0
- package/dist/cjs/ui/ui-styles.js +93 -37
- package/dist/es2019/commands/column-resize.js +53 -4
- package/dist/es2019/commands/go-to-next-cell.js +5 -2
- package/dist/es2019/commands-with-analytics.js +8 -2
- package/dist/es2019/nodeviews/ExternalDropTargets.js +2 -0
- package/dist/es2019/nodeviews/TableComponent.js +9 -7
- package/dist/es2019/nodeviews/TableResizer.js +2 -1
- package/dist/es2019/plugin.js +4 -2
- package/dist/es2019/pm-plugins/keymap.js +25 -9
- package/dist/es2019/pm-plugins/main.js +15 -4
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +4 -2
- package/dist/es2019/ui/DragHandle/index.js +2 -2
- package/dist/es2019/ui/DragPreview/index.js +2 -0
- package/dist/es2019/ui/FloatingContextualButton/FixedButton.js +10 -6
- package/dist/es2019/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/es2019/ui/FloatingInsertButton/InsertButton.js +1 -0
- package/dist/es2019/ui/LayoutButton/index.js +2 -0
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -0
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +3 -0
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -0
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +1 -0
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +4 -0
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/es2019/ui/common-styles.js +4 -0
- package/dist/es2019/ui/ui-styles.js +66 -70
- package/dist/esm/commands/column-resize.js +62 -16
- package/dist/esm/commands/go-to-next-cell.js +5 -2
- package/dist/esm/commands-with-analytics.js +8 -2
- package/dist/esm/nodeviews/ExternalDropTargets.js +2 -0
- package/dist/esm/nodeviews/TableComponent.js +9 -7
- package/dist/esm/nodeviews/TableResizer.js +2 -1
- package/dist/esm/plugin.js +58 -57
- package/dist/esm/pm-plugins/keymap.js +26 -8
- package/dist/esm/pm-plugins/main.js +15 -4
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +4 -2
- package/dist/esm/ui/DragHandle/index.js +2 -2
- package/dist/esm/ui/DragPreview/index.js +2 -0
- package/dist/esm/ui/FloatingContextualButton/FixedButton.js +10 -6
- package/dist/esm/ui/FloatingDeleteButton/index.js +2 -0
- package/dist/esm/ui/FloatingInsertButton/InsertButton.js +1 -0
- package/dist/esm/ui/LayoutButton/index.js +2 -0
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +2 -0
- package/dist/esm/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +3 -0
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +1 -0
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -0
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +4 -0
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +3 -1
- package/dist/esm/ui/common-styles.js +4 -0
- package/dist/esm/ui/ui-styles.js +93 -37
- package/dist/types/commands/column-resize.d.ts +23 -4
- package/dist/types/commands/go-to-next-cell.d.ts +2 -1
- package/dist/types/commands-with-analytics.d.ts +2 -1
- package/dist/types/pm-plugins/keymap.d.ts +3 -1
- package/dist/types/types.d.ts +7 -0
- package/dist/types-ts4.5/commands/column-resize.d.ts +23 -4
- package/dist/types-ts4.5/commands/go-to-next-cell.d.ts +2 -1
- package/dist/types-ts4.5/commands-with-analytics.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +3 -1
- package/dist/types-ts4.5/types.d.ts +7 -0
- package/package.json +4 -4
- package/src/commands/column-resize.ts +105 -29
- package/src/commands/go-to-next-cell.ts +10 -2
- package/src/commands-with-analytics.ts +11 -5
- package/src/nodeviews/ExternalDropTargets.tsx +2 -0
- package/src/nodeviews/TableComponent.tsx +14 -16
- package/src/nodeviews/TableResizer.tsx +2 -1
- package/src/plugin.tsx +3 -1
- package/src/pm-plugins/keymap.ts +44 -6
- package/src/pm-plugins/main.ts +18 -4
- package/src/pm-plugins/table-resizing/event-handlers.ts +6 -2
- package/src/types.ts +8 -0
- package/src/ui/DragHandle/index.tsx +2 -2
- package/src/ui/DragPreview/index.tsx +2 -0
- package/src/ui/FloatingContextualButton/FixedButton.tsx +9 -6
- package/src/ui/FloatingDeleteButton/index.tsx +2 -0
- package/src/ui/FloatingInsertButton/InsertButton.tsx +1 -0
- package/src/ui/LayoutButton/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +2 -0
- package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +3 -0
- package/src/ui/TableFloatingControls/CornerControls/ClassicCornerControls.tsx +1 -0
- package/src/ui/TableFloatingControls/NumberColumn/index.tsx +1 -0
- package/src/ui/TableFloatingControls/RowControls/ClassicControls.tsx +4 -0
- package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +5 -1
- package/src/ui/common-styles.ts +2 -0
- package/src/ui/ui-styles.ts +90 -79
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.6.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#86633](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86633) [`d9780cd1adb8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d9780cd1adb8) - ED-22713: Fixed table resizing not working with keyboard shortcuts
|
|
8
|
+
- [#86724](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86724) [`718a9aa2424d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/718a9aa2424d) - [ED-22607] Remove references to maxFrames for multi bodied extensions and bump adf-schema from 35.7.0 to 35.8.0
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.6.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#85342](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/85342) [`9a6a1786bc65`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9a6a1786bc65) - [ux] Migrates table styles to space tokens
|
|
16
|
+
|
|
3
17
|
## 7.6.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.stopKeyboardColumnResizing = exports.initiateKeyboardColumnResizing = exports.changeColumnWidthByStep = exports.activateNextResizeArea = void 0;
|
|
7
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
7
8
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
8
9
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
9
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
@@ -66,25 +67,35 @@ var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosi
|
|
|
66
67
|
return false;
|
|
67
68
|
};
|
|
68
69
|
};
|
|
69
|
-
var initiateKeyboardColumnResizing = exports.initiateKeyboardColumnResizing = function initiateKeyboardColumnResizing(
|
|
70
|
-
|
|
70
|
+
var initiateKeyboardColumnResizing = exports.initiateKeyboardColumnResizing = function initiateKeyboardColumnResizing(_ref) {
|
|
71
|
+
var ariaNotify = _ref.ariaNotify,
|
|
72
|
+
getIntl = _ref.getIntl;
|
|
73
|
+
return function (state, dispatch, view) {
|
|
74
|
+
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-column-resizing_emcvz')) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
var selection = state.selection;
|
|
78
|
+
var selectionRect = (0, _utils.isSelectionType)(selection, 'cell') ? (0, _utils.getSelectionRect)(selection) : (0, _utils.findCellRectClosestToPos)(selection.$from);
|
|
79
|
+
var cell = (0, _utils.findCellClosestToPos)(selection.$from);
|
|
80
|
+
if (ariaNotify && getIntl) {
|
|
81
|
+
ariaNotify(getIntl().formatMessage(_messages.tableMessages.startedColumnResize));
|
|
82
|
+
}
|
|
83
|
+
if (selectionRect && cell && view) {
|
|
84
|
+
return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos)(state, dispatch);
|
|
85
|
+
}
|
|
71
86
|
return false;
|
|
72
|
-
}
|
|
73
|
-
var selection = state.selection;
|
|
74
|
-
var selectionRect = (0, _utils.isSelectionType)(selection, 'cell') ? (0, _utils.getSelectionRect)(selection) : (0, _utils.findCellRectClosestToPos)(selection.$from);
|
|
75
|
-
var cell = (0, _utils.findCellClosestToPos)(selection.$from);
|
|
76
|
-
if (selectionRect && cell && view) {
|
|
77
|
-
return updateResizeHandleAndStatePosition(selectionRect.top, selectionRect.right, cell.pos)(state, dispatch);
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
87
|
+
};
|
|
80
88
|
};
|
|
81
|
-
var activateNextResizeArea = exports.activateNextResizeArea = function activateNextResizeArea(
|
|
89
|
+
var activateNextResizeArea = exports.activateNextResizeArea = function activateNextResizeArea(_ref2) {
|
|
90
|
+
var direction = _ref2.direction,
|
|
91
|
+
ariaNotify = _ref2.ariaNotify,
|
|
92
|
+
getIntl = _ref2.getIntl;
|
|
82
93
|
return function (state, dispatch, view) {
|
|
83
94
|
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-column-resizing_emcvz')) {
|
|
84
95
|
return false;
|
|
85
96
|
}
|
|
86
|
-
var
|
|
87
|
-
resizeHandlePos =
|
|
97
|
+
var _ref3 = (0, _pluginFactory2.getPluginState)(state) || {},
|
|
98
|
+
resizeHandlePos = _ref3.resizeHandlePos;
|
|
88
99
|
// If No resizing has initiated, skip to regular handler
|
|
89
100
|
if (!resizeHandlePos) {
|
|
90
101
|
return false;
|
|
@@ -107,6 +118,18 @@ var activateNextResizeArea = exports.activateNextResizeArea = function activateN
|
|
|
107
118
|
}
|
|
108
119
|
var currentCellRect = tableMap.findCell($currentCell.pos - $currentCell.start(-1));
|
|
109
120
|
var $nextCell = (0, _utils.nextCell)($currentCell, 'horiz', direction);
|
|
121
|
+
if (ariaNotify && getIntl) {
|
|
122
|
+
var columnDirection = '';
|
|
123
|
+
if (direction === 1) {
|
|
124
|
+
columnDirection = getIntl().formatMessage(_messages.tableMessages.columnRightResize);
|
|
125
|
+
}
|
|
126
|
+
if (direction === -1) {
|
|
127
|
+
columnDirection = getIntl().formatMessage(_messages.tableMessages.columnLeftResize);
|
|
128
|
+
}
|
|
129
|
+
ariaNotify(getIntl().formatMessage(_messages.tableMessages.focusedOtherResize, {
|
|
130
|
+
direction: columnDirection
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
110
133
|
if ($nextCell) {
|
|
111
134
|
// we are somewhere in between the side columns of the table
|
|
112
135
|
var offset = $nextCell.pos - $nextCell.start(-1);
|
|
@@ -127,8 +150,12 @@ var activateNextResizeArea = exports.activateNextResizeArea = function activateN
|
|
|
127
150
|
return false;
|
|
128
151
|
};
|
|
129
152
|
};
|
|
130
|
-
var changeColumnWidthByStep = exports.changeColumnWidthByStep = function changeColumnWidthByStep(
|
|
131
|
-
var
|
|
153
|
+
var changeColumnWidthByStep = exports.changeColumnWidthByStep = function changeColumnWidthByStep(_ref4) {
|
|
154
|
+
var stepSize = _ref4.stepSize,
|
|
155
|
+
getEditorContainerWidth = _ref4.getEditorContainerWidth,
|
|
156
|
+
isTableScalingEnabled = _ref4.isTableScalingEnabled,
|
|
157
|
+
ariaNotify = _ref4.ariaNotify,
|
|
158
|
+
getIntl = _ref4.getIntl;
|
|
132
159
|
return function (state, dispatch, view) {
|
|
133
160
|
var customTr = state.tr;
|
|
134
161
|
var fakeDispatch = function fakeDispatch(tr) {
|
|
@@ -190,10 +217,26 @@ var changeColumnWidthByStep = exports.changeColumnWidthByStep = function changeC
|
|
|
190
217
|
if (dispatch) {
|
|
191
218
|
dispatch(customTr);
|
|
192
219
|
}
|
|
220
|
+
if (ariaNotify && getIntl) {
|
|
221
|
+
ariaNotify(getIntl().formatMessage(_messages.tableMessages.changedColumnWidth, {
|
|
222
|
+
width: Math.floor(newResizeState.cols[colIndex].width)
|
|
223
|
+
}));
|
|
224
|
+
if (newResizeState.cols.length === colIndex + 1) {
|
|
225
|
+
if (newResizeState.overflow === true) {
|
|
226
|
+
ariaNotify(getIntl().formatMessage(_messages.tableMessages.columnResizeLast));
|
|
227
|
+
}
|
|
228
|
+
if (newResizeState.overflow === false) {
|
|
229
|
+
ariaNotify(getIntl().formatMessage(_messages.tableMessages.columnResizeOverflow));
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
193
233
|
return true;
|
|
194
234
|
};
|
|
195
235
|
};
|
|
196
|
-
var stopKeyboardColumnResizing = exports.stopKeyboardColumnResizing = function stopKeyboardColumnResizing(
|
|
236
|
+
var stopKeyboardColumnResizing = exports.stopKeyboardColumnResizing = function stopKeyboardColumnResizing(_ref5) {
|
|
237
|
+
var ariaNotify = _ref5.ariaNotify,
|
|
238
|
+
getIntl = _ref5.getIntl,
|
|
239
|
+
originalTr = _ref5.originalTr;
|
|
197
240
|
return function (state, dispatch) {
|
|
198
241
|
if (!(0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-column-resizing_emcvz')) {
|
|
199
242
|
return false;
|
|
@@ -218,6 +261,9 @@ var stopKeyboardColumnResizing = exports.stopKeyboardColumnResizing = function s
|
|
|
218
261
|
}, function () {
|
|
219
262
|
return customTr.setMeta('scrollIntoView', false);
|
|
220
263
|
})(state, fakeDispatch);
|
|
264
|
+
if (ariaNotify && getIntl) {
|
|
265
|
+
ariaNotify(getIntl().formatMessage(_messages.tableMessages.columnResizeStop));
|
|
266
|
+
}
|
|
221
267
|
if (dispatch) {
|
|
222
268
|
dispatch(customTr);
|
|
223
269
|
return true;
|
|
@@ -16,7 +16,7 @@ var _columnResize = require("./column-resize");
|
|
|
16
16
|
|
|
17
17
|
var TAB_FORWARD_DIRECTION = 1;
|
|
18
18
|
var TAB_BACKWARD_DIRECTION = -1;
|
|
19
|
-
var goToNextCell = exports.goToNextCell = function goToNextCell(editorAnalyticsAPI) {
|
|
19
|
+
var goToNextCell = exports.goToNextCell = function goToNextCell(editorAnalyticsAPI, ariaNotify, getIntl) {
|
|
20
20
|
return function (direction) {
|
|
21
21
|
return function (state, dispatch, view) {
|
|
22
22
|
var table = (0, _utils2.findTable)(state.selection);
|
|
@@ -27,7 +27,10 @@ var goToNextCell = exports.goToNextCell = function goToNextCell(editorAnalyticsA
|
|
|
27
27
|
var _getPluginState;
|
|
28
28
|
var isColumnResizing = (_getPluginState = (0, _pluginFactory.getPluginState)(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.isKeyboardResize;
|
|
29
29
|
if (isColumnResizing) {
|
|
30
|
-
(0, _columnResize.stopKeyboardColumnResizing)(
|
|
30
|
+
(0, _columnResize.stopKeyboardColumnResizing)({
|
|
31
|
+
ariaNotify: ariaNotify,
|
|
32
|
+
getIntl: getIntl
|
|
33
|
+
})(state, dispatch, view);
|
|
31
34
|
return true;
|
|
32
35
|
}
|
|
33
36
|
}
|
|
@@ -191,7 +191,7 @@ var insertRowWithAnalytics = exports.insertRowWithAnalytics = function insertRow
|
|
|
191
191
|
};
|
|
192
192
|
};
|
|
193
193
|
var changeColumnWidthByStepWithAnalytics = exports.changeColumnWidthByStepWithAnalytics = function changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI) {
|
|
194
|
-
return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, inputMethod) {
|
|
194
|
+
return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, inputMethod, ariaNotify, getIntl) {
|
|
195
195
|
return (0, _analytics2.withEditorAnalyticsAPI)(function (state) {
|
|
196
196
|
var _getSelectedTableInfo2 = (0, _utils2.getSelectedTableInfo)(state.selection),
|
|
197
197
|
table = _getSelectedTableInfo2.table,
|
|
@@ -213,7 +213,13 @@ var changeColumnWidthByStepWithAnalytics = exports.changeColumnWidthByStepWithAn
|
|
|
213
213
|
totalColumnCount: totalColumnCount
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
|
-
})(editorAnalyticsAPI)((0, _columnResize.changeColumnWidthByStep)(
|
|
216
|
+
})(editorAnalyticsAPI)((0, _columnResize.changeColumnWidthByStep)({
|
|
217
|
+
stepSize: stepSize,
|
|
218
|
+
getEditorContainerWidth: getEditorContainerWidth,
|
|
219
|
+
isTableScalingEnabled: isTableScalingEnabled,
|
|
220
|
+
ariaNotify: ariaNotify,
|
|
221
|
+
getIntl: getIntl
|
|
222
|
+
}));
|
|
217
223
|
};
|
|
218
224
|
};
|
|
219
225
|
var insertColumnWithAnalytics = exports.insertColumnWithAnalytics = function insertColumnWithAnalytics(editorAnalyticsAPI) {
|
|
@@ -52,6 +52,7 @@ var ExternalDropTargets = exports.ExternalDropTargets = function ExternalDropTar
|
|
|
52
52
|
width: getTableWrapperWidth(),
|
|
53
53
|
overflow: 'hidden',
|
|
54
54
|
position: 'absolute',
|
|
55
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
55
56
|
top: "-".concat(_consts.dropTargetExtendedWidth - _styles.tableMarginTop, "px"),
|
|
56
57
|
pointerEvents: 'auto',
|
|
57
58
|
zIndex: "".concat(_consts.dropTargetsZIndex)
|
|
@@ -61,6 +62,7 @@ var ExternalDropTargets = exports.ExternalDropTargets = function ExternalDropTar
|
|
|
61
62
|
style: {
|
|
62
63
|
display: 'flex',
|
|
63
64
|
// move drop targets based on table wrapper scroll
|
|
65
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
64
66
|
marginLeft: "-".concat(getScrollOffset(), "px")
|
|
65
67
|
}
|
|
66
68
|
}, colWidths === null || colWidths === void 0 ? void 0 : colWidths.map(function (width, index) {
|
|
@@ -35,7 +35,6 @@ var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
|
|
|
35
35
|
var _consts = require("../pm-plugins/table-resizing/utils/consts");
|
|
36
36
|
var _dom = require("../pm-plugins/table-resizing/utils/dom");
|
|
37
37
|
var _types = require("../types");
|
|
38
|
-
var _consts2 = require("../ui/consts");
|
|
39
38
|
var _TableFloatingColumnControls = _interopRequireDefault(require("../ui/TableFloatingColumnControls"));
|
|
40
39
|
var _TableFloatingControls = _interopRequireDefault(require("../ui/TableFloatingControls"));
|
|
41
40
|
var _utils5 = require("../utils");
|
|
@@ -748,7 +747,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
748
747
|
style: {
|
|
749
748
|
visibility: showBeforeShadow && hasHeaderRow ? 'visible' : 'hidden',
|
|
750
749
|
top: "".concat(topStickyShadowPosition, "px"),
|
|
751
|
-
paddingBottom: "".concat(isDragAndDropEnabled
|
|
750
|
+
paddingBottom: "".concat(isDragAndDropEnabled && "var(--ds-space-025, 2px)")
|
|
752
751
|
}
|
|
753
752
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
754
753
|
className: (0, _classnames2.default)(_types.TableCssClassName.TABLE_NODE_WRAPPER),
|
|
@@ -767,10 +766,11 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
767
766
|
}, allowControls && colControls), stickyScrollbar && /*#__PURE__*/_react.default.createElement("div", {
|
|
768
767
|
className: _types.TableCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER,
|
|
769
768
|
style: {
|
|
770
|
-
height:
|
|
769
|
+
height: "var(--ds-space-250, 20px)",
|
|
770
|
+
// MAX_BROWSER_SCROLLBAR_HEIGHT
|
|
771
771
|
display: 'none',
|
|
772
772
|
// prevent unwanted scroll during table resize without removing scrollbar container from the dom
|
|
773
|
-
width: isResizing ?
|
|
773
|
+
width: isResizing ? "var(--ds-space-0, 0px)" : '100%'
|
|
774
774
|
}
|
|
775
775
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
776
776
|
style: {
|
|
@@ -784,14 +784,16 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
784
784
|
}), this.state.stickyHeader && /*#__PURE__*/_react.default.createElement("div", {
|
|
785
785
|
style: {
|
|
786
786
|
position: 'absolute',
|
|
787
|
-
right: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? "".concat((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ?
|
|
787
|
+
right: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? "".concat((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.increase-shadow-visibility_lh89r') ? "var(--ds-space-400, 32px)" // tableOverflowShadowWidthWide
|
|
788
|
+
: "var(--ds-space-100, 8px)" // tableOverflowShadowWidth
|
|
789
|
+
) : "var(--ds-space-negative-025, -2px)"
|
|
788
790
|
}
|
|
789
791
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
790
792
|
className: "".concat(_types.TableCssClassName.TABLE_RIGHT_SHADOW, " ").concat(_types.TableCssClassName.TABLE_STICKY_SHADOW),
|
|
791
793
|
style: {
|
|
792
794
|
visibility: showAfterShadow && hasHeaderRow ? 'visible' : 'hidden',
|
|
793
795
|
top: "".concat(topStickyShadowPosition, "px"),
|
|
794
|
-
paddingBottom: "".concat(isDragAndDropEnabled
|
|
796
|
+
paddingBottom: "".concat(isDragAndDropEnabled && "var(--ds-space-025, 2px)")
|
|
795
797
|
}
|
|
796
798
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
797
799
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM,
|
|
@@ -40,7 +40,7 @@ var handles = {
|
|
|
40
40
|
};
|
|
41
41
|
var handleStyles = {
|
|
42
42
|
right: {
|
|
43
|
-
// eslint-disable-next-line
|
|
43
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
44
44
|
right: '-14px',
|
|
45
45
|
marginTop: "var(--ds-space-150, 12px)"
|
|
46
46
|
}
|
|
@@ -297,6 +297,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
297
297
|
if (newWidth > maxWidth || newWidth < resizerMinWidth) {
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
+
setLocalTableWidth(newWidth);
|
|
300
301
|
handleResizeStop({
|
|
301
302
|
width: width,
|
|
302
303
|
x: 0,
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -176,14 +176,15 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
176
176
|
// plugin as it is currently swallowing backspace events inside tables
|
|
177
177
|
{
|
|
178
178
|
name: 'tableKeymap',
|
|
179
|
-
plugin: function plugin() {
|
|
180
|
-
var
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
179
|
+
plugin: function plugin(_ref6) {
|
|
180
|
+
var getIntl = _ref6.getIntl;
|
|
181
|
+
var _ref7 = options || {},
|
|
182
|
+
dragAndDropEnabled = _ref7.dragAndDropEnabled,
|
|
183
|
+
_ref7$isTableScalingE = _ref7.isTableScalingEnabled,
|
|
184
|
+
isTableScalingEnabled = _ref7$isTableScalingE === void 0 ? false : _ref7$isTableScalingE,
|
|
185
|
+
_ref7$fullWidthEnable = _ref7.fullWidthEnabled,
|
|
186
|
+
fullWidthEnabled = _ref7$fullWidthEnable === void 0 ? false : _ref7$fullWidthEnable;
|
|
187
|
+
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, fullWidthEnabled, api, getIntl);
|
|
187
188
|
}
|
|
188
189
|
}, {
|
|
189
190
|
name: 'tableSelectionKeymap',
|
|
@@ -193,12 +194,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
193
194
|
}, {
|
|
194
195
|
name: 'tableEditing',
|
|
195
196
|
plugin: function plugin() {
|
|
196
|
-
var
|
|
197
|
-
dragAndDropEnabled =
|
|
197
|
+
var _ref8 = options || {},
|
|
198
|
+
dragAndDropEnabled = _ref8.dragAndDropEnabled;
|
|
198
199
|
return (0, _pmPlugins.tableEditing)({
|
|
199
|
-
reportFixedTable: function reportFixedTable(
|
|
200
|
-
var tr =
|
|
201
|
-
reason =
|
|
200
|
+
reportFixedTable: function reportFixedTable(_ref9) {
|
|
201
|
+
var tr = _ref9.tr,
|
|
202
|
+
reason = _ref9.reason;
|
|
202
203
|
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent({
|
|
203
204
|
action: _analytics.TABLE_ACTION.FIXED,
|
|
204
205
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
@@ -214,48 +215,48 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
214
215
|
}
|
|
215
216
|
}, {
|
|
216
217
|
name: 'tableStickyHeaders',
|
|
217
|
-
plugin: function plugin(
|
|
218
|
-
var dispatch =
|
|
219
|
-
eventDispatcher =
|
|
218
|
+
plugin: function plugin(_ref10) {
|
|
219
|
+
var dispatch = _ref10.dispatch,
|
|
220
|
+
eventDispatcher = _ref10.eventDispatcher;
|
|
220
221
|
return options && options.tableOptions.stickyHeaders ? (0, _stickyHeaders.createPlugin)(dispatch, function () {
|
|
221
222
|
return [];
|
|
222
223
|
}) : undefined;
|
|
223
224
|
}
|
|
224
225
|
}, {
|
|
225
226
|
name: 'tableDragAndDrop',
|
|
226
|
-
plugin: function plugin(
|
|
227
|
-
var dispatch =
|
|
227
|
+
plugin: function plugin(_ref11) {
|
|
228
|
+
var dispatch = _ref11.dispatch;
|
|
228
229
|
return options !== null && options !== void 0 && options.dragAndDropEnabled ? (0, _dragAndDrop.createPlugin)(dispatch, editorAnalyticsAPI) : undefined;
|
|
229
230
|
}
|
|
230
231
|
}, {
|
|
231
232
|
name: 'tableLocalId',
|
|
232
|
-
plugin: function plugin(
|
|
233
|
-
var dispatch =
|
|
233
|
+
plugin: function plugin(_ref12) {
|
|
234
|
+
var dispatch = _ref12.dispatch;
|
|
234
235
|
return (0, _tableLocalId.createPlugin)(dispatch);
|
|
235
236
|
}
|
|
236
237
|
}, {
|
|
237
238
|
name: 'tableWidth',
|
|
238
|
-
plugin: function plugin(
|
|
239
|
+
plugin: function plugin(_ref13) {
|
|
239
240
|
var _options$fullWidthEna;
|
|
240
|
-
var dispatchAnalyticsEvent =
|
|
241
|
-
dispatch =
|
|
241
|
+
var dispatchAnalyticsEvent = _ref13.dispatchAnalyticsEvent,
|
|
242
|
+
dispatch = _ref13.dispatch;
|
|
242
243
|
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) : undefined;
|
|
243
244
|
}
|
|
244
245
|
},
|
|
245
246
|
// TODO: should be deprecated and eventually replaced with 'tableAnalyticsPlugin'
|
|
246
247
|
{
|
|
247
248
|
name: 'tableOverflowAnalyticsPlugin',
|
|
248
|
-
plugin: function plugin(
|
|
249
|
+
plugin: function plugin(_ref14) {
|
|
249
250
|
var _options$tableResizin;
|
|
250
|
-
var dispatch =
|
|
251
|
-
dispatchAnalyticsEvent =
|
|
251
|
+
var dispatch = _ref14.dispatch,
|
|
252
|
+
dispatchAnalyticsEvent = _ref14.dispatchAnalyticsEvent;
|
|
252
253
|
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);
|
|
253
254
|
}
|
|
254
255
|
}, {
|
|
255
256
|
name: 'tableAnalyticsPlugin',
|
|
256
|
-
plugin: function plugin(
|
|
257
|
-
var dispatch =
|
|
258
|
-
dispatchAnalyticsEvent =
|
|
257
|
+
plugin: function plugin(_ref15) {
|
|
258
|
+
var dispatch = _ref15.dispatch,
|
|
259
|
+
dispatchAnalyticsEvent = _ref15.dispatchAnalyticsEvent;
|
|
259
260
|
return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.analytics-plugin-moved-event') ? (0, _plugin.createPlugin)(dispatch, dispatchAnalyticsEvent) : undefined;
|
|
260
261
|
}
|
|
261
262
|
}, {
|
|
@@ -286,12 +287,12 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
286
287
|
}
|
|
287
288
|
return plugins;
|
|
288
289
|
},
|
|
289
|
-
contentComponent: function contentComponent(
|
|
290
|
-
var editorView =
|
|
291
|
-
popupsMountPoint =
|
|
292
|
-
popupsBoundariesElement =
|
|
293
|
-
popupsScrollableElement =
|
|
294
|
-
dispatchAnalyticsEvent =
|
|
290
|
+
contentComponent: function contentComponent(_ref16) {
|
|
291
|
+
var editorView = _ref16.editorView,
|
|
292
|
+
popupsMountPoint = _ref16.popupsMountPoint,
|
|
293
|
+
popupsBoundariesElement = _ref16.popupsBoundariesElement,
|
|
294
|
+
popupsScrollableElement = _ref16.popupsScrollableElement,
|
|
295
|
+
dispatchAnalyticsEvent = _ref16.dispatchAnalyticsEvent;
|
|
295
296
|
return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
|
|
296
297
|
component: _analytics.ACTION_SUBJECT.TABLES_PLUGIN,
|
|
297
298
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
@@ -305,30 +306,30 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
305
306
|
stickyHeadersState: _stickyHeaders.pluginKey,
|
|
306
307
|
dragAndDropState: _dragAndDrop.pluginKey
|
|
307
308
|
},
|
|
308
|
-
render: function render(
|
|
309
|
-
var resizingPluginState =
|
|
310
|
-
stickyHeadersState =
|
|
311
|
-
tablePluginState =
|
|
312
|
-
tableWidthPluginState =
|
|
313
|
-
dragAndDropState =
|
|
309
|
+
render: function render(_ref17) {
|
|
310
|
+
var resizingPluginState = _ref17.tableResizingPluginState,
|
|
311
|
+
stickyHeadersState = _ref17.stickyHeadersState,
|
|
312
|
+
tablePluginState = _ref17.tablePluginState,
|
|
313
|
+
tableWidthPluginState = _ref17.tableWidthPluginState,
|
|
314
|
+
dragAndDropState = _ref17.dragAndDropState;
|
|
314
315
|
var state = editorView.state;
|
|
315
316
|
var isColumnResizing = resizingPluginState === null || resizingPluginState === void 0 ? void 0 : resizingPluginState.dragging;
|
|
316
317
|
var isTableResizing = tableWidthPluginState === null || tableWidthPluginState === void 0 ? void 0 : tableWidthPluginState.resizing;
|
|
317
318
|
var isResizing = isColumnResizing || isTableResizing;
|
|
318
|
-
var
|
|
319
|
-
tableNode =
|
|
320
|
-
tablePos =
|
|
321
|
-
targetCellPosition =
|
|
322
|
-
isContextualMenuOpen =
|
|
323
|
-
layout =
|
|
324
|
-
tableRef =
|
|
325
|
-
pluginConfig =
|
|
326
|
-
insertColumnButtonIndex =
|
|
327
|
-
insertRowButtonIndex =
|
|
328
|
-
isHeaderColumnEnabled =
|
|
329
|
-
isHeaderRowEnabled =
|
|
330
|
-
isDragAndDropEnabled =
|
|
331
|
-
tableWrapperTarget =
|
|
319
|
+
var _ref18 = tablePluginState,
|
|
320
|
+
tableNode = _ref18.tableNode,
|
|
321
|
+
tablePos = _ref18.tablePos,
|
|
322
|
+
targetCellPosition = _ref18.targetCellPosition,
|
|
323
|
+
isContextualMenuOpen = _ref18.isContextualMenuOpen,
|
|
324
|
+
layout = _ref18.layout,
|
|
325
|
+
tableRef = _ref18.tableRef,
|
|
326
|
+
pluginConfig = _ref18.pluginConfig,
|
|
327
|
+
insertColumnButtonIndex = _ref18.insertColumnButtonIndex,
|
|
328
|
+
insertRowButtonIndex = _ref18.insertRowButtonIndex,
|
|
329
|
+
isHeaderColumnEnabled = _ref18.isHeaderColumnEnabled,
|
|
330
|
+
isHeaderRowEnabled = _ref18.isHeaderRowEnabled,
|
|
331
|
+
isDragAndDropEnabled = _ref18.isDragAndDropEnabled,
|
|
332
|
+
tableWrapperTarget = _ref18.tableWrapperTarget;
|
|
332
333
|
var allowControls = pluginConfig.allowControls;
|
|
333
334
|
var stickyHeader = stickyHeadersState ? (0, _stickyHeaders.findStickyHeaderForTable)(stickyHeadersState, tablePos) : undefined;
|
|
334
335
|
var LayoutContent = options && !options.tableResizingEnabled && (0, _utils2.isLayoutSupported)(state) && options.breakoutEnabled ? /*#__PURE__*/_react.default.createElement(_LayoutButton.default, {
|
|
@@ -409,8 +410,8 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
409
410
|
}));
|
|
410
411
|
},
|
|
411
412
|
pluginsOptions: {
|
|
412
|
-
quickInsert: function quickInsert(
|
|
413
|
-
var formatMessage =
|
|
413
|
+
quickInsert: function quickInsert(_ref19) {
|
|
414
|
+
var formatMessage = _ref19.formatMessage;
|
|
414
415
|
return [{
|
|
415
416
|
id: 'table',
|
|
416
417
|
title: formatMessage(_messages.toolbarInsertBlockMessages.table),
|
|
@@ -28,11 +28,15 @@ var createTableWithAnalytics = function createTableWithAnalytics(isTableScalingE
|
|
|
28
28
|
})(editorAnalyticsAPI)((0, _commands2.createTable)(isTableScalingEnabled, isFullWidthModeEnabled));
|
|
29
29
|
};
|
|
30
30
|
function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEnabled) {
|
|
31
|
+
var _pluginInjectionApi$a;
|
|
31
32
|
var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
32
33
|
var isFullWidthEnabled = arguments.length > 4 ? arguments[4] : undefined;
|
|
34
|
+
var pluginInjectionApi = arguments.length > 5 ? arguments[5] : undefined;
|
|
35
|
+
var getIntl = arguments.length > 6 ? arguments[6] : undefined;
|
|
33
36
|
var list = {};
|
|
34
|
-
|
|
35
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.
|
|
37
|
+
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
38
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.nextCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
39
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.previousCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
|
|
36
40
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.toggleTable.common, createTableWithAnalytics(isTableScalingEnabled, !!isFullWidthEnabled, editorAnalyticsAPI), list);
|
|
37
41
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.backspace.common, (0, _commands.chainCommands)((0, _commandsWithAnalytics.deleteTableIfSelectedWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD), (0, _commandsWithAnalytics.emptyMultipleCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.KEYBOARD)), list);
|
|
38
42
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.backspace.common, _commands2.moveCursorBackward, list);
|
|
@@ -61,12 +65,26 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEn
|
|
|
61
65
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.deleteRow.common, (0, _commandsWithAnalytics.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut)(editorAnalyticsAPI), list);
|
|
62
66
|
}
|
|
63
67
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-column-resizing_emcvz')) {
|
|
64
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.startColumnResizing.common, _columnResize.initiateKeyboardColumnResizing
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.
|
|
69
|
-
|
|
68
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.startColumnResizing.common, (0, _columnResize.initiateKeyboardColumnResizing)({
|
|
69
|
+
ariaNotify: ariaNotifyPlugin,
|
|
70
|
+
getIntl: getIntl
|
|
71
|
+
}), list);
|
|
72
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveRight.common, (0, _columnResize.activateNextResizeArea)({
|
|
73
|
+
direction: 1,
|
|
74
|
+
ariaNotify: ariaNotifyPlugin,
|
|
75
|
+
getIntl: getIntl
|
|
76
|
+
}), list);
|
|
77
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, (0, _columnResize.activateNextResizeArea)({
|
|
78
|
+
direction: -1,
|
|
79
|
+
ariaNotify: ariaNotifyPlugin,
|
|
80
|
+
getIntl: getIntl
|
|
81
|
+
}), list);
|
|
82
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.decreaseMediaSize.common, (0, _commandsWithAnalytics.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI)(-10, getEditorContainerWidth, isTableScalingEnabled, _analytics.INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
83
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.increaseMediaSize.common, (0, _commandsWithAnalytics.changeColumnWidthByStepWithAnalytics)(editorAnalyticsAPI)(10, getEditorContainerWidth, isTableScalingEnabled, _analytics.INPUT_METHOD.SHORTCUT, ariaNotifyPlugin, getIntl), list);
|
|
84
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.escape.common, (0, _columnResize.stopKeyboardColumnResizing)({
|
|
85
|
+
ariaNotify: ariaNotifyPlugin,
|
|
86
|
+
getIntl: getIntl
|
|
87
|
+
}), list);
|
|
70
88
|
}
|
|
71
89
|
return (0, _keymap.keymap)(list);
|
|
72
90
|
}
|
|
@@ -33,6 +33,7 @@ var _pluginKey = require("./plugin-key");
|
|
|
33
33
|
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; }
|
|
34
34
|
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; }
|
|
35
35
|
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, breakoutEnabled, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled) {
|
|
36
|
+
var _accessibilityUtils;
|
|
36
37
|
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
37
38
|
pluginConfig: pluginConfig,
|
|
38
39
|
isTableHovered: false,
|
|
@@ -53,6 +54,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
53
54
|
// Used to prevent invalid table cell spans being reported more than once per editor/document
|
|
54
55
|
var invalidTableIds = [];
|
|
55
56
|
var editorViewRef = null;
|
|
57
|
+
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_accessibilityUtils = pluginInjectionApi.accessibilityUtils) === null || _accessibilityUtils === void 0 ? void 0 : _accessibilityUtils.actions.ariaNotify;
|
|
56
58
|
var getCurrentEditorState = function getCurrentEditorState() {
|
|
57
59
|
var editorView = editorViewRef;
|
|
58
60
|
if (!editorView) {
|
|
@@ -114,7 +116,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
114
116
|
}
|
|
115
117
|
var tableNode = (0, _utils3.findTable)(state.selection);
|
|
116
118
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-column-resizing_emcvz')) {
|
|
117
|
-
// when cursor leaves the table we need to stop column resizing
|
|
119
|
+
// when keyboard cursor leaves the table we need to stop column resizing
|
|
118
120
|
var pluginPrevState = (0, _pluginFactory.getPluginState)(prevState);
|
|
119
121
|
var isStopKeyboardColumResizing = pluginPrevState.isResizeHandleWidgetAdded && pluginPrevState.isKeyboardResize;
|
|
120
122
|
if (isStopKeyboardColumResizing) {
|
|
@@ -126,11 +128,17 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
126
128
|
// Add/delete row
|
|
127
129
|
tableNode.node.attrs.localId !== pluginPrevState.tableNode.attrs.localId) {
|
|
128
130
|
// Jump to another table
|
|
129
|
-
(0, _columnResize.stopKeyboardColumnResizing)(
|
|
131
|
+
(0, _columnResize.stopKeyboardColumnResizing)({
|
|
132
|
+
ariaNotify: ariaNotifyPlugin,
|
|
133
|
+
getIntl: getIntl
|
|
134
|
+
})(state, dispatch);
|
|
130
135
|
}
|
|
131
136
|
} else if (!tableNode) {
|
|
132
137
|
// selection outside of table
|
|
133
|
-
(0, _columnResize.stopKeyboardColumnResizing)(
|
|
138
|
+
(0, _columnResize.stopKeyboardColumnResizing)({
|
|
139
|
+
ariaNotify: ariaNotifyPlugin,
|
|
140
|
+
getIntl: getIntl
|
|
141
|
+
})(state, dispatch);
|
|
134
142
|
}
|
|
135
143
|
}
|
|
136
144
|
}
|
|
@@ -237,7 +245,10 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
237
245
|
var _getPluginState = (0, _pluginFactory.getPluginState)(state),
|
|
238
246
|
isKeyboardResize = _getPluginState.isKeyboardResize;
|
|
239
247
|
if (isKeyboardResize) {
|
|
240
|
-
(0, _columnResize.stopKeyboardColumnResizing)(
|
|
248
|
+
(0, _columnResize.stopKeyboardColumnResizing)({
|
|
249
|
+
ariaNotify: ariaNotifyPlugin,
|
|
250
|
+
getIntl: getIntl
|
|
251
|
+
})(state, dispatch);
|
|
241
252
|
return false;
|
|
242
253
|
}
|
|
243
254
|
}
|
|
@@ -129,7 +129,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
129
129
|
/** if column resize had started via keyboard but continued by mouse
|
|
130
130
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
131
131
|
*/
|
|
132
|
-
return (0, _columnResize.stopKeyboardColumnResizing)()(state, dispatch, view);
|
|
132
|
+
return (0, _columnResize.stopKeyboardColumnResizing)({})(state, dispatch, view);
|
|
133
133
|
} else {
|
|
134
134
|
return (0, _commands.stopResizing)()(state, dispatch);
|
|
135
135
|
}
|
|
@@ -190,7 +190,9 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
190
190
|
/** if column resize had started via keyboard but continued by mouse
|
|
191
191
|
* or mouse pointer leaves the table but mouse button still pressed
|
|
192
192
|
*/
|
|
193
|
-
return (0, _columnResize.stopKeyboardColumnResizing)(
|
|
193
|
+
return (0, _columnResize.stopKeyboardColumnResizing)({
|
|
194
|
+
originalTr: tr
|
|
195
|
+
})(state, dispatch, view);
|
|
194
196
|
} else {
|
|
195
197
|
return (0, _commands.stopResizing)(tr)(state, dispatch);
|
|
196
198
|
}
|
|
@@ -164,8 +164,8 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
164
164
|
// 16px here because it's the size of drag handle button's large side
|
|
165
165
|
width: isRow ? "var(--ds-space-200, 16px)" // 16px here because it's the size of drag handle button's large side
|
|
166
166
|
: "calc(100% - ".concat(_consts.dragTableInsertColumnButtonSize, "px)"),
|
|
167
|
-
left: isRow ?
|
|
168
|
-
bottom: isColumn ?
|
|
167
|
+
left: isRow ? "var(--ds-space-050, 4px)" : undefined,
|
|
168
|
+
bottom: isColumn ? "var(--ds-space-0, 0px)" : undefined,
|
|
169
169
|
alignSelf: isColumn ? 'none' : 'center',
|
|
170
170
|
zIndex: isColumn ? '-1' : 'auto'
|
|
171
171
|
},
|
|
@@ -31,7 +31,9 @@ var DragPreview = exports.DragPreview = function DragPreview(_ref) {
|
|
|
31
31
|
}, /*#__PURE__*/_react.default.createElement(_DragInMotionIcon.DragInMotionIcon, {
|
|
32
32
|
style: {
|
|
33
33
|
position: 'absolute',
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
34
35
|
marginLeft: "".concat(marginLeft, "px"),
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
35
37
|
marginTop: "".concat(marginTop, "px"),
|
|
36
38
|
transform: transform
|
|
37
39
|
}
|