@atlaskit/editor-plugin-table 7.18.2 → 7.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/commands/column-resize.js +0 -12
- package/dist/cjs/commands/go-to-next-cell.js +8 -11
- package/dist/cjs/commands/index.js +6 -0
- package/dist/cjs/commands/misc.js +15 -1
- package/dist/cjs/commands/selection.js +4 -11
- package/dist/cjs/event-handlers.js +7 -11
- package/dist/cjs/plugin.js +7 -4
- package/dist/cjs/pm-plugins/keymap.js +22 -21
- package/dist/cjs/pm-plugins/main.js +26 -30
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +13 -21
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +8 -11
- package/dist/cjs/reducer.js +1 -0
- package/dist/cjs/ui/FloatingContextualButton/index.js +18 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +170 -35
- package/dist/cjs/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/es2019/commands/column-resize.js +0 -12
- package/dist/es2019/commands/go-to-next-cell.js +8 -11
- package/dist/es2019/commands/index.js +1 -1
- package/dist/es2019/commands/misc.js +9 -1
- package/dist/es2019/commands/selection.js +4 -11
- package/dist/es2019/event-handlers.js +8 -12
- package/dist/es2019/plugin.js +7 -4
- package/dist/es2019/pm-plugins/keymap.js +24 -23
- package/dist/es2019/pm-plugins/main.js +27 -31
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +13 -21
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +9 -12
- package/dist/es2019/reducer.js +1 -0
- package/dist/es2019/ui/FloatingContextualButton/index.js +17 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +159 -24
- package/dist/es2019/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/esm/commands/column-resize.js +0 -12
- package/dist/esm/commands/go-to-next-cell.js +8 -11
- package/dist/esm/commands/index.js +1 -1
- package/dist/esm/commands/misc.js +14 -0
- package/dist/esm/commands/selection.js +4 -11
- package/dist/esm/event-handlers.js +7 -11
- package/dist/esm/plugin.js +7 -4
- package/dist/esm/pm-plugins/keymap.js +24 -23
- package/dist/esm/pm-plugins/main.js +26 -30
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +13 -21
- package/dist/esm/pm-plugins/table-resizing/plugin.js +8 -11
- package/dist/esm/reducer.js +1 -0
- package/dist/esm/ui/FloatingContextualButton/index.js +15 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +171 -40
- package/dist/esm/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/misc.d.ts +1 -0
- package/dist/types/types.d.ts +6 -0
- package/dist/types/ui/FloatingContextualButton/index.d.ts +1 -0
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +7 -3
- package/dist/types/ui/FloatingContextualMenu/index.d.ts +2 -1
- package/dist/types-ts4.5/commands/index.d.ts +1 -1
- package/dist/types-ts4.5/commands/misc.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +6 -0
- package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +7 -3
- package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +2 -1
- package/package.json +4 -4
- package/src/commands/column-resize.ts +0 -14
- package/src/commands/go-to-next-cell.ts +7 -10
- package/src/commands/index.ts +1 -0
- package/src/commands/misc.ts +13 -0
- package/src/commands/selection.ts +4 -11
- package/src/event-handlers.ts +6 -12
- package/src/plugin.tsx +6 -1
- package/src/pm-plugins/keymap.ts +65 -62
- package/src/pm-plugins/main.ts +27 -31
- package/src/pm-plugins/table-resizing/event-handlers.ts +11 -19
- package/src/pm-plugins/table-resizing/plugin.ts +7 -10
- package/src/reducer.ts +1 -0
- package/src/types.ts +8 -1
- package/src/ui/FloatingContextualButton/index.tsx +19 -1
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +207 -30
- package/src/ui/FloatingContextualMenu/index.tsx +3 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -13,7 +14,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
14
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _react = require("react");
|
|
17
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
18
|
var _react2 = require("@emotion/react");
|
|
18
19
|
var _reactIntlNext = require("react-intl-next");
|
|
19
20
|
var _customSteps = require("@atlaskit/custom-steps");
|
|
@@ -34,6 +35,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
34
35
|
var _commands = require("../../commands");
|
|
35
36
|
var _commandsWithAnalytics = require("../../commands-with-analytics");
|
|
36
37
|
var _pluginFactory = require("../../pm-plugins/plugin-factory");
|
|
38
|
+
var _pluginKey = require("../../pm-plugins/plugin-key");
|
|
37
39
|
var _resizeState = require("../../pm-plugins/table-resizing/utils/resize-state");
|
|
38
40
|
var _transforms = require("../../transforms");
|
|
39
41
|
var _types = require("../../types");
|
|
@@ -41,10 +43,13 @@ var _utils3 = require("../../utils");
|
|
|
41
43
|
var _consts = require("../consts");
|
|
42
44
|
var _icons = require("../icons");
|
|
43
45
|
var _styles2 = require("./styles");
|
|
46
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
47
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
44
48
|
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; }
|
|
45
49
|
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; }
|
|
46
50
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
47
51
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @atlaskit/design-system/prefer-primitives */ /** @jsx jsx */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
52
|
+
var arrowsList = new Set(['ArrowRight', 'ArrowLeft']);
|
|
48
53
|
var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
49
54
|
(0, _inherits2.default)(ContextualMenu, _Component);
|
|
50
55
|
var _super = _createSuper(ContextualMenu);
|
|
@@ -56,8 +61,10 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
56
61
|
}
|
|
57
62
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
58
63
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
59
|
-
isSubmenuOpen: false
|
|
64
|
+
isSubmenuOpen: false,
|
|
65
|
+
isOpenAllowed: false
|
|
60
66
|
});
|
|
67
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "dropdownMenuRef", /*#__PURE__*/_react.default.createRef());
|
|
61
68
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSubMenuRef", function (ref) {
|
|
62
69
|
var parent = (0, _utils.closestElement)(_this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
|
|
63
70
|
if (!(parent && ref)) {
|
|
@@ -75,15 +82,23 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
75
82
|
state = _this$props.editorView.state,
|
|
76
83
|
isOpen = _this$props.isOpen,
|
|
77
84
|
formatMessage = _this$props.intl.formatMessage,
|
|
78
|
-
editorView = _this$props.editorView
|
|
85
|
+
editorView = _this$props.editorView,
|
|
86
|
+
isCellMenuOpenByKeyboard = _this$props.isCellMenuOpenByKeyboard;
|
|
79
87
|
var isSubmenuOpen = _this.state.isSubmenuOpen;
|
|
80
88
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
81
89
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
82
90
|
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
83
91
|
if (allowBackgroundColor) {
|
|
84
|
-
var _node$attrs, _node$attrs2;
|
|
92
|
+
var _node$attrs, _node$attrs2, _node$attrs3;
|
|
85
93
|
var node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
|
|
86
94
|
var background = (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
|
|
95
|
+
var selectedRowIndex;
|
|
96
|
+
var selectedColumnIndex;
|
|
97
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
98
|
+
var selectedRowAndColumnFromPalette = (0, _uiColor.getSelectedRowAndColumnFromPalette)(_uiColor.cellBackgroundColorPalette, background, _consts.colorPalletteColumns);
|
|
99
|
+
selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
100
|
+
selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
101
|
+
}
|
|
87
102
|
return {
|
|
88
103
|
content: isDragAndDropEnabled ? formatMessage(_messages.tableMessages.backgroundColor) : formatMessage(_messages.tableMessages.cellBackground),
|
|
89
104
|
value: {
|
|
@@ -107,10 +122,27 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
107
122
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
108
123
|
,
|
|
109
124
|
className: isDragAndDropEnabled ? _types.TableCssClassName.CONTEXTUAL_MENU_ICON_SMALL : _types.TableCssClassName.CONTEXTUAL_MENU_ICON
|
|
110
|
-
}), isSubmenuOpen && (0, _react2.jsx)("div", {
|
|
125
|
+
}), (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && (0, _react2.jsx)("div", {
|
|
111
126
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
112
127
|
className: _types.TableCssClassName.CONTEXTUAL_SUBMENU,
|
|
113
128
|
ref: _this.handleSubMenuRef
|
|
129
|
+
}, (0, _react2.jsx)(_uiMenu.ArrowKeyNavigationProvider, {
|
|
130
|
+
type: _uiMenu.ArrowKeyNavigationType.COLOR,
|
|
131
|
+
selectedRowIndex: selectedRowIndex || 0,
|
|
132
|
+
selectedColumnIndex: selectedColumnIndex || 0,
|
|
133
|
+
handleClose: function handleClose() {
|
|
134
|
+
_this.setState({
|
|
135
|
+
isSubmenuOpen: false
|
|
136
|
+
});
|
|
137
|
+
if (_this.dropdownMenuRef && _this.dropdownMenuRef.current) {
|
|
138
|
+
var focusableItems = _this.dropdownMenuRef.current.querySelectorAll('div[tabindex="-1"]:not([disabled])');
|
|
139
|
+
if (focusableItems && focusableItems.length) {
|
|
140
|
+
focusableItems[0].focus();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
isPopupPositioned: true,
|
|
145
|
+
isOpenedByKeyboard: isCellMenuOpenByKeyboard
|
|
114
146
|
}, (0, _react2.jsx)(_uiColor.ColorPalette, {
|
|
115
147
|
cols: 7,
|
|
116
148
|
onClick: _this.setColor,
|
|
@@ -120,7 +152,22 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
120
152
|
paletteColorTooltipMessages: _uiColor.backgroundPaletteTooltipMessages,
|
|
121
153
|
hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
|
|
122
154
|
}
|
|
123
|
-
})))
|
|
155
|
+
}))) : isSubmenuOpen &&
|
|
156
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
157
|
+
(0, _react2.jsx)("div", {
|
|
158
|
+
className: _types.TableCssClassName.CONTEXTUAL_SUBMENU,
|
|
159
|
+
ref: _this.handleSubMenuRef
|
|
160
|
+
}, (0, _react2.jsx)(_uiColor.ColorPalette, {
|
|
161
|
+
cols: 7,
|
|
162
|
+
onClick: _this.setColor,
|
|
163
|
+
selectedColor: (node === null || node === void 0 || (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.background) || '#ffffff',
|
|
164
|
+
paletteOptions: {
|
|
165
|
+
palette: _uiColor.cellBackgroundColorPalette,
|
|
166
|
+
paletteColorTooltipMessages: _uiColor.backgroundPaletteTooltipMessages,
|
|
167
|
+
hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
|
|
168
|
+
}
|
|
169
|
+
}))),
|
|
170
|
+
'aria-expanded': (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
|
|
124
171
|
};
|
|
125
172
|
}
|
|
126
173
|
});
|
|
@@ -406,7 +453,8 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
406
453
|
selectionRect = _this$props10.selectionRect,
|
|
407
454
|
editorAnalyticsAPI = _this$props10.editorAnalyticsAPI,
|
|
408
455
|
getEditorContainerWidth = _this$props10.getEditorContainerWidth,
|
|
409
|
-
getEditorFeatureFlags = _this$props10.getEditorFeatureFlags
|
|
456
|
+
getEditorFeatureFlags = _this$props10.getEditorFeatureFlags,
|
|
457
|
+
isCellMenuOpenByKeyboard = _this$props10.isCellMenuOpenByKeyboard;
|
|
410
458
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
411
459
|
var state = editorView.state,
|
|
412
460
|
dispatch = editorView.dispatch;
|
|
@@ -419,6 +467,19 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
419
467
|
tableDuplicateCellColouring = _ref4$tableDuplicateC === void 0 ? false : _ref4$tableDuplicateC,
|
|
420
468
|
_ref4$tableWithFixedC = _ref4.tableWithFixedColumnWidthsOption,
|
|
421
469
|
tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
|
|
470
|
+
// context menu opened by keyboard and any item except 'background' activated
|
|
471
|
+
// or color has been chosen from color palette
|
|
472
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen)) {
|
|
473
|
+
var tr = state.tr;
|
|
474
|
+
tr.setMeta(_pluginKey.pluginKey, {
|
|
475
|
+
type: 'SET_CELL_MENU_OPEN',
|
|
476
|
+
data: {
|
|
477
|
+
isCellMenuOpenByKeyboard: false
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
dispatch(tr);
|
|
481
|
+
editorView.dom.focus(); // otherwise cursor disappears from cell
|
|
482
|
+
}
|
|
422
483
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
423
484
|
switch (item.value.name) {
|
|
424
485
|
case 'sort_column_desc':
|
|
@@ -469,6 +530,19 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
469
530
|
(0, _commandsWithAnalytics.deleteRowsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, selectionRect, !!isHeaderRowRequired)(state, dispatch);
|
|
470
531
|
_this.toggleOpen();
|
|
471
532
|
break;
|
|
533
|
+
case 'background':
|
|
534
|
+
{
|
|
535
|
+
// This is called twice.
|
|
536
|
+
// 1st time when user chooses the background color item.
|
|
537
|
+
// 2nd when color has been chosen from color palette.
|
|
538
|
+
// here we are handling the 1st call relying on the isSubmenuOpen state value
|
|
539
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !_this.state.isSubmenuOpen) {
|
|
540
|
+
_this.setState({
|
|
541
|
+
isSubmenuOpen: true
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
break;
|
|
545
|
+
}
|
|
472
546
|
}
|
|
473
547
|
});
|
|
474
548
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleOpen", function () {
|
|
@@ -484,22 +558,55 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
484
558
|
});
|
|
485
559
|
}
|
|
486
560
|
});
|
|
487
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOpenChange", function () {
|
|
488
|
-
var _this$props$editorVie = _this.props.editorView,
|
|
489
|
-
state = _this$props$editorVie.state,
|
|
490
|
-
dispatch = _this$props$editorVie.dispatch;
|
|
491
|
-
(0, _commands.toggleContextualMenu)()(state, dispatch);
|
|
492
|
-
_this.setState({
|
|
493
|
-
isSubmenuOpen: false
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (_ref5) {
|
|
497
|
-
var item = _ref5.item;
|
|
561
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOpenChange", function (payload) {
|
|
498
562
|
var _this$props12 = _this.props,
|
|
499
563
|
_this$props12$editorV = _this$props12.editorView,
|
|
500
564
|
state = _this$props12$editorV.state,
|
|
501
565
|
dispatch = _this$props12$editorV.dispatch,
|
|
502
|
-
|
|
566
|
+
dom = _this$props12$editorV.dom,
|
|
567
|
+
isCellMenuOpenByKeyboard = _this$props12.isCellMenuOpenByKeyboard;
|
|
568
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
569
|
+
if (payload) {
|
|
570
|
+
var event = payload.event;
|
|
571
|
+
if (event && event instanceof KeyboardEvent) {
|
|
572
|
+
if (!_this.state.isSubmenuOpen) {
|
|
573
|
+
if (arrowsList.has(event.key)) {
|
|
574
|
+
// preventing default behavior for avoiding cursor jump to next/previous table column
|
|
575
|
+
// when left/right arrow pressed.
|
|
576
|
+
event.preventDefault();
|
|
577
|
+
}
|
|
578
|
+
(0, _commands.toggleContextualMenu)()(state, dispatch);
|
|
579
|
+
_this.setState({
|
|
580
|
+
isSubmenuOpen: false
|
|
581
|
+
});
|
|
582
|
+
(0, _commands.setFocusToCellMenu)(false)(state, dispatch);
|
|
583
|
+
dom.focus();
|
|
584
|
+
}
|
|
585
|
+
} else {
|
|
586
|
+
// mouse click outside
|
|
587
|
+
(0, _commands.toggleContextualMenu)()(state, dispatch);
|
|
588
|
+
_this.setState({
|
|
589
|
+
isSubmenuOpen: false
|
|
590
|
+
});
|
|
591
|
+
if (isCellMenuOpenByKeyboard) {
|
|
592
|
+
(0, _commands.setFocusToCellMenu)(false)(state, dispatch);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
} else {
|
|
597
|
+
(0, _commands.toggleContextualMenu)()(state, dispatch);
|
|
598
|
+
_this.setState({
|
|
599
|
+
isSubmenuOpen: false
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
});
|
|
603
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseEnter", function (_ref5) {
|
|
604
|
+
var item = _ref5.item;
|
|
605
|
+
var _this$props13 = _this.props,
|
|
606
|
+
_this$props13$editorV = _this$props13.editorView,
|
|
607
|
+
state = _this$props13$editorV.state,
|
|
608
|
+
dispatch = _this$props13$editorV.dispatch,
|
|
609
|
+
selectionRect = _this$props13.selectionRect;
|
|
503
610
|
if (item.value.name === 'background') {
|
|
504
611
|
if (!_this.state.isSubmenuOpen) {
|
|
505
612
|
_this.setState({
|
|
@@ -519,9 +626,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
519
626
|
});
|
|
520
627
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleItemMouseLeave", function (_ref6) {
|
|
521
628
|
var item = _ref6.item;
|
|
522
|
-
var _this$props$
|
|
523
|
-
state = _this$props$
|
|
524
|
-
dispatch = _this$props$
|
|
629
|
+
var _this$props$editorVie = _this.props.editorView,
|
|
630
|
+
state = _this$props$editorVie.state,
|
|
631
|
+
dispatch = _this$props$editorVie.dispatch;
|
|
525
632
|
if (item.value.name === 'background') {
|
|
526
633
|
_this.closeSubmenu();
|
|
527
634
|
}
|
|
@@ -537,9 +644,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
537
644
|
}
|
|
538
645
|
});
|
|
539
646
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "setColor", function (color) {
|
|
540
|
-
var _this$
|
|
541
|
-
editorView = _this$
|
|
542
|
-
editorAnalyticsAPI = _this$
|
|
647
|
+
var _this$props14 = _this.props,
|
|
648
|
+
editorView = _this$props14.editorView,
|
|
649
|
+
editorAnalyticsAPI = _this$props14.editorAnalyticsAPI;
|
|
543
650
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
544
651
|
var _getPluginState13 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
545
652
|
targetCellPosition = _getPluginState13.targetCellPosition;
|
|
@@ -551,20 +658,44 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
551
658
|
return _this;
|
|
552
659
|
}
|
|
553
660
|
(0, _createClass2.default)(ContextualMenu, [{
|
|
661
|
+
key: "componentDidMount",
|
|
662
|
+
value: function componentDidMount() {
|
|
663
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
664
|
+
// ArrowKeyNavigationProvider in DropdownMenu expects that menu handle will stay focused
|
|
665
|
+
// until user pressed ArrowDown.
|
|
666
|
+
// Behavior above fails the A11Y requirement about first item in menu should be focused immediately.
|
|
667
|
+
// so here is triggering componentDidUpdate inside dropdown to set focus on first element
|
|
668
|
+
var isCellMenuOpenByKeyboard = this.props.isCellMenuOpenByKeyboard;
|
|
669
|
+
if (isCellMenuOpenByKeyboard) {
|
|
670
|
+
this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
|
|
671
|
+
isOpenAllowed: isCellMenuOpenByKeyboard
|
|
672
|
+
}));
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}, {
|
|
554
677
|
key: "render",
|
|
555
678
|
value: function render() {
|
|
556
|
-
var _this$
|
|
557
|
-
isOpen = _this$
|
|
558
|
-
mountPoint = _this$
|
|
559
|
-
offset = _this$
|
|
560
|
-
boundariesElement = _this$
|
|
561
|
-
editorView = _this$
|
|
679
|
+
var _this$props15 = this.props,
|
|
680
|
+
isOpen = _this$props15.isOpen,
|
|
681
|
+
mountPoint = _this$props15.mountPoint,
|
|
682
|
+
offset = _this$props15.offset,
|
|
683
|
+
boundariesElement = _this$props15.boundariesElement,
|
|
684
|
+
editorView = _this$props15.editorView,
|
|
685
|
+
isCellMenuOpenByKeyboard = _this$props15.isCellMenuOpenByKeyboard;
|
|
562
686
|
var _getPluginState14 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
563
687
|
isDragAndDropEnabled = _getPluginState14.isDragAndDropEnabled;
|
|
564
688
|
var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
|
|
689
|
+
var isOpenAllowed = false;
|
|
690
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
691
|
+
isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
|
|
692
|
+
} else {
|
|
693
|
+
isOpenAllowed = isOpen;
|
|
694
|
+
}
|
|
565
695
|
return (0, _react2.jsx)("div", {
|
|
566
696
|
"data-testid": "table-cell-contextual-menu",
|
|
567
|
-
onMouseLeave: this.closeSubmenu
|
|
697
|
+
onMouseLeave: this.closeSubmenu,
|
|
698
|
+
ref: this.dropdownMenuRef
|
|
568
699
|
}, (0, _react2.jsx)(_uiMenu.DropdownMenu, {
|
|
569
700
|
mountTo: mountPoint
|
|
570
701
|
//This needs be removed when the a11y is completely handled
|
|
@@ -572,21 +703,25 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
572
703
|
,
|
|
573
704
|
arrowKeyNavigationProviderOptions: {
|
|
574
705
|
type: _uiMenu.ArrowKeyNavigationType.MENU,
|
|
575
|
-
disableArrowKeyNavigation: true
|
|
706
|
+
disableArrowKeyNavigation: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen ? false : true
|
|
576
707
|
},
|
|
577
708
|
items: items,
|
|
578
|
-
isOpen:
|
|
709
|
+
isOpen: isOpenAllowed,
|
|
579
710
|
onOpenChange: this.handleOpenChange,
|
|
580
711
|
onItemActivated: this.onMenuItemActivated,
|
|
581
712
|
onMouseEnter: this.handleItemMouseEnter,
|
|
582
713
|
onMouseLeave: this.handleItemMouseLeave,
|
|
583
714
|
fitHeight: 188,
|
|
584
715
|
fitWidth: isDragAndDropEnabled ? _consts.contextualMenuDropdownWidthDnD : _consts.contextualMenuDropdownWidth,
|
|
716
|
+
shouldFocusFirstItem: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? function () {
|
|
717
|
+
return Boolean(isCellMenuOpenByKeyboard);
|
|
718
|
+
} : undefined,
|
|
585
719
|
boundariesElement: boundariesElement,
|
|
586
720
|
offset: offset,
|
|
587
721
|
section: isDragAndDropEnabled ? {
|
|
588
722
|
hasSeparator: true
|
|
589
|
-
} : undefined
|
|
723
|
+
} : undefined,
|
|
724
|
+
isAllowEnterDefaultBehavior: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
|
|
590
725
|
}));
|
|
591
726
|
}
|
|
592
727
|
}]);
|
|
@@ -26,7 +26,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
26
26
|
pluginConfig = _ref.pluginConfig,
|
|
27
27
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
28
28
|
getEditorContainerWidth = _ref.getEditorContainerWidth,
|
|
29
|
-
getEditorFeatureFlags = _ref.getEditorFeatureFlags
|
|
29
|
+
getEditorFeatureFlags = _ref.getEditorFeatureFlags,
|
|
30
|
+
isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard;
|
|
30
31
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
31
32
|
var _getPluginState = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
32
33
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
@@ -75,7 +76,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
75
76
|
boundariesElement: boundariesElement,
|
|
76
77
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
77
78
|
getEditorContainerWidth: getEditorContainerWidth,
|
|
78
|
-
getEditorFeatureFlags: getEditorFeatureFlags
|
|
79
|
+
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
80
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
79
81
|
})));
|
|
80
82
|
};
|
|
81
83
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -62,9 +62,6 @@ export const initiateKeyboardColumnResizing = ({
|
|
|
62
62
|
ariaNotify,
|
|
63
63
|
getIntl
|
|
64
64
|
}) => (state, dispatch, view) => {
|
|
65
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
65
|
const {
|
|
69
66
|
selection
|
|
70
67
|
} = state;
|
|
@@ -85,9 +82,6 @@ export const activateNextResizeArea = ({
|
|
|
85
82
|
ariaNotify,
|
|
86
83
|
getIntl
|
|
87
84
|
}) => (state, dispatch, view) => {
|
|
88
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
85
|
const {
|
|
92
86
|
resizeHandlePos
|
|
93
87
|
} = getTableResizingPluginState(state) || {};
|
|
@@ -162,9 +156,6 @@ export const changeColumnWidthByStep = ({
|
|
|
162
156
|
const fakeDispatch = tr => {
|
|
163
157
|
customTr = tr;
|
|
164
158
|
};
|
|
165
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
159
|
const {
|
|
169
160
|
resizeHandlePos
|
|
170
161
|
} = getTableResizingPluginState(state);
|
|
@@ -252,9 +243,6 @@ export const stopKeyboardColumnResizing = ({
|
|
|
252
243
|
getIntl,
|
|
253
244
|
originalTr
|
|
254
245
|
}) => (state, dispatch) => {
|
|
255
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
246
|
let customTr = originalTr || state.tr;
|
|
259
247
|
const fakeDispatch = tr => {
|
|
260
248
|
customTr = tr;
|
|
@@ -4,27 +4,24 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
6
|
import { goToNextCell as baseGotoNextCell, findTable } from '@atlaskit/editor-tables/utils';
|
|
7
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { insertRowWithAnalytics } from '../commands-with-analytics';
|
|
9
8
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
10
9
|
import { stopKeyboardColumnResizing } from './column-resize';
|
|
11
10
|
const TAB_FORWARD_DIRECTION = 1;
|
|
12
11
|
const TAB_BACKWARD_DIRECTION = -1;
|
|
13
12
|
export const goToNextCell = (editorAnalyticsAPI, ariaNotify, getIntl) => direction => (state, dispatch, view) => {
|
|
13
|
+
var _getPluginState;
|
|
14
14
|
const table = findTable(state.selection);
|
|
15
15
|
if (!table) {
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})(state, dispatch, view);
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
18
|
+
const isColumnResizing = (_getPluginState = getPluginState(state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.isKeyboardResize;
|
|
19
|
+
if (isColumnResizing) {
|
|
20
|
+
stopKeyboardColumnResizing({
|
|
21
|
+
ariaNotify: ariaNotify,
|
|
22
|
+
getIntl: getIntl
|
|
23
|
+
})(state, dispatch, view);
|
|
24
|
+
return true;
|
|
28
25
|
}
|
|
29
26
|
const map = TableMap.get(table.node);
|
|
30
27
|
const {
|
|
@@ -2,7 +2,7 @@ export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clear
|
|
|
2
2
|
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
3
|
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout } from './toggle';
|
|
4
4
|
export { clearMultipleCells } from './clear';
|
|
5
|
-
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest } from './misc';
|
|
5
|
+
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest, setFocusToCellMenu } from './misc';
|
|
6
6
|
export { sortByColumn } from './sort';
|
|
7
7
|
export { goToNextCell } from './go-to-next-cell';
|
|
8
8
|
export { removeDescendantNodes } from './referentiality';
|
|
@@ -589,4 +589,12 @@ export const setTableAlignmentWithTableContentWithPos = (newAlignment, tableNode
|
|
|
589
589
|
}
|
|
590
590
|
tr.setNodeMarkup(tableNodeWithPos.pos, undefined, nextTableAttrs).setMeta('scrollIntoView', false);
|
|
591
591
|
return tr;
|
|
592
|
-
};
|
|
592
|
+
};
|
|
593
|
+
export const setFocusToCellMenu = (isCellMenuOpenByKeyboard = true, originalTr) => createCommand(() => {
|
|
594
|
+
return {
|
|
595
|
+
type: 'SET_CELL_MENU_OPEN',
|
|
596
|
+
data: {
|
|
597
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
}, tr => (originalTr || tr).setMeta('addToHistory', false));
|
|
@@ -3,7 +3,6 @@ import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
4
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
5
|
import { findTable, isColumnSelected, isRowSelected, isTableSelected, selectedRect } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { selectColumn, selectRow } from '../commands/misc';
|
|
8
7
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
9
8
|
import { getClosestSelectionRect } from '../toolbar';
|
|
@@ -177,11 +176,8 @@ const arrowLeftFromText = editorSelectionAPI => selection => (state, dispatch) =
|
|
|
177
176
|
const {
|
|
178
177
|
$from
|
|
179
178
|
} = selection;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const columResizePluginState = getPluginState(state) || {};
|
|
183
|
-
isColumnResizing = Boolean(columResizePluginState === null || columResizePluginState === void 0 ? void 0 : columResizePluginState.isKeyboardResize);
|
|
184
|
-
}
|
|
179
|
+
const columResizePluginState = getPluginState(state) || {};
|
|
180
|
+
const isColumnResizing = Boolean(columResizePluginState === null || columResizePluginState === void 0 ? void 0 : columResizePluginState.isKeyboardResize);
|
|
185
181
|
if (isSelectionAtStartOfTable($from, selection) && $from.parent.type.name === 'paragraph' && $from.depth === table.depth + 3 &&
|
|
186
182
|
// + 3 for: row, cell & paragraph nodes
|
|
187
183
|
editorSelectionAPI && !isColumnResizing) {
|
|
@@ -209,11 +205,8 @@ const arrowRightFromText = editorSelectionAPI => selection => (state, dispatch)
|
|
|
209
205
|
const {
|
|
210
206
|
$to
|
|
211
207
|
} = selection;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const columResizePluginState = getPluginState(state) || {};
|
|
215
|
-
isColumnResizing = Boolean(columResizePluginState === null || columResizePluginState === void 0 ? void 0 : columResizePluginState.isKeyboardResize);
|
|
216
|
-
}
|
|
208
|
+
const columResizePluginState = getPluginState(state) || {};
|
|
209
|
+
const isColumnResizing = Boolean(columResizePluginState === null || columResizePluginState === void 0 ? void 0 : columResizePluginState.isKeyboardResize);
|
|
217
210
|
if (isSelectionAtEndOfTable($to, selection) && $to.parent.type.name === 'paragraph' && $to.depth === table.depth + 3 &&
|
|
218
211
|
// + 3 for: row, cell & paragraph nodes
|
|
219
212
|
!isColumnResizing) {
|
|
@@ -195,18 +195,14 @@ export const handleMouseOut = (view, mouseEvent) => {
|
|
|
195
195
|
state,
|
|
196
196
|
dispatch
|
|
197
197
|
} = view;
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
if
|
|
203
|
-
|
|
204
|
-
return false;
|
|
205
|
-
}
|
|
206
|
-
return hideResizeHandleLine()(state, dispatch);
|
|
207
|
-
} else {
|
|
208
|
-
return hideResizeHandleLine()(state, dispatch);
|
|
198
|
+
const {
|
|
199
|
+
isKeyboardResize
|
|
200
|
+
} = getPluginState(state);
|
|
201
|
+
if (isKeyboardResize) {
|
|
202
|
+
// no need to hide decoration if column resizing started by keyboard
|
|
203
|
+
return false;
|
|
209
204
|
}
|
|
205
|
+
return hideResizeHandleLine()(state, dispatch);
|
|
210
206
|
}
|
|
211
207
|
return false;
|
|
212
208
|
};
|
|
@@ -309,7 +305,7 @@ const handleMouseMoveDebounce = rafSchedule((view, event, offsetX) => {
|
|
|
309
305
|
resizeHandleColumnIndex,
|
|
310
306
|
resizeHandleRowIndex
|
|
311
307
|
} = getPluginState(state);
|
|
312
|
-
const isKeyboardResize =
|
|
308
|
+
const isKeyboardResize = getPluginState(state).isKeyboardResize;
|
|
313
309
|
const tableCell = closestElement(element, 'td, th');
|
|
314
310
|
const cellStartPosition = view.posAtDOM(tableCell, 0);
|
|
315
311
|
const rect = findCellRectClosestToPos(state.doc.resolve(cellStartPosition));
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -347,13 +347,14 @@ const tablesPlugin = ({
|
|
|
347
347
|
isHeaderColumnEnabled,
|
|
348
348
|
isHeaderRowEnabled,
|
|
349
349
|
isDragAndDropEnabled,
|
|
350
|
-
tableWrapperTarget
|
|
350
|
+
tableWrapperTarget,
|
|
351
|
+
isCellMenuOpenByKeyboard
|
|
351
352
|
} = tablePluginState;
|
|
352
353
|
const {
|
|
353
354
|
allowControls
|
|
354
355
|
} = pluginConfig;
|
|
355
356
|
const stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
|
|
356
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, targetCellPosition && tableRef && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/React.createElement(FloatingContextualButton, {
|
|
357
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, targetCellPosition && (tableRef || getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard) && !isResizing && options && options.allowContextualMenu && /*#__PURE__*/React.createElement(FloatingContextualButton, {
|
|
357
358
|
isNumberColumnEnabled: tableNode && tableNode.attrs.isNumberColumnEnabled,
|
|
358
359
|
editorView: editorView,
|
|
359
360
|
tableNode: tableNode,
|
|
@@ -363,7 +364,8 @@ const tablesPlugin = ({
|
|
|
363
364
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
364
365
|
isContextualMenuOpen: isContextualMenuOpen,
|
|
365
366
|
stickyHeader: stickyHeader,
|
|
366
|
-
tableWrapper: tableWrapperTarget
|
|
367
|
+
tableWrapper: tableWrapperTarget,
|
|
368
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
367
369
|
}), allowControls && /*#__PURE__*/React.createElement(FloatingInsertButton, {
|
|
368
370
|
tableNode: tableNode,
|
|
369
371
|
tableRef: tableRef,
|
|
@@ -391,7 +393,8 @@ const tablesPlugin = ({
|
|
|
391
393
|
pluginConfig: pluginConfig,
|
|
392
394
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
393
395
|
getEditorContainerWidth: defaultGetEditorContainerWidth,
|
|
394
|
-
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags
|
|
396
|
+
getEditorFeatureFlags: (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags,
|
|
397
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
395
398
|
}), isDragAndDropEnabled && /*#__PURE__*/React.createElement(FloatingDragMenu, {
|
|
396
399
|
editorView: editorView,
|
|
397
400
|
mountPoint: popupsMountPoint,
|