@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
|
@@ -12,8 +12,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
14
14
|
/** @jsx jsx */
|
|
15
|
-
import { Component } from 'react';
|
|
16
|
-
|
|
15
|
+
import React, { Component } from 'react';
|
|
17
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
17
|
import { jsx } from '@emotion/react';
|
|
19
18
|
import { injectIntl } from 'react-intl-next';
|
|
@@ -22,8 +21,8 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
22
21
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
23
22
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
24
23
|
import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
25
|
-
import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
26
|
-
import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
24
|
+
import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
|
|
25
|
+
import { ArrowKeyNavigationProvider, ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
27
26
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
28
27
|
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
29
28
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
@@ -32,16 +31,18 @@ import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
|
32
31
|
import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
|
|
33
32
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
34
33
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
35
|
-
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, toggleContextualMenu } from '../../commands';
|
|
34
|
+
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../commands';
|
|
36
35
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../commands-with-analytics';
|
|
37
36
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
37
|
+
import { pluginKey as tablePluginKey } from '../../pm-plugins/plugin-key';
|
|
38
38
|
import { getNewResizeStateFromSelectedColumns } from '../../pm-plugins/table-resizing/utils/resize-state';
|
|
39
39
|
import { canMergeCells } from '../../transforms';
|
|
40
40
|
import { TableCssClassName as ClassName } from '../../types';
|
|
41
41
|
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
|
|
42
|
-
import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD } from '../consts';
|
|
42
|
+
import { colorPalletteColumns, contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD } from '../consts';
|
|
43
43
|
import { AddColRightIcon, AddRowBelowIcon, MergeCellsIcon, SplitCellIcon } from '../icons';
|
|
44
44
|
import { cellColourPreviewStyles, elementBeforeIconStyles } from './styles';
|
|
45
|
+
var arrowsList = new Set(['ArrowRight', 'ArrowLeft']);
|
|
45
46
|
export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
46
47
|
_inherits(ContextualMenu, _Component);
|
|
47
48
|
var _super = _createSuper(ContextualMenu);
|
|
@@ -53,8 +54,10 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
53
54
|
}
|
|
54
55
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
55
56
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
56
|
-
isSubmenuOpen: false
|
|
57
|
+
isSubmenuOpen: false,
|
|
58
|
+
isOpenAllowed: false
|
|
57
59
|
});
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "dropdownMenuRef", /*#__PURE__*/React.createRef());
|
|
58
61
|
_defineProperty(_assertThisInitialized(_this), "handleSubMenuRef", function (ref) {
|
|
59
62
|
var parent = closestElement(_this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
|
|
60
63
|
if (!(parent && ref)) {
|
|
@@ -72,15 +75,23 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
72
75
|
state = _this$props.editorView.state,
|
|
73
76
|
isOpen = _this$props.isOpen,
|
|
74
77
|
formatMessage = _this$props.intl.formatMessage,
|
|
75
|
-
editorView = _this$props.editorView
|
|
78
|
+
editorView = _this$props.editorView,
|
|
79
|
+
isCellMenuOpenByKeyboard = _this$props.isCellMenuOpenByKeyboard;
|
|
76
80
|
var isSubmenuOpen = _this.state.isSubmenuOpen;
|
|
77
81
|
var _getPluginState = getPluginState(editorView.state),
|
|
78
82
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
79
83
|
isDragAndDropEnabled = _getPluginState.isDragAndDropEnabled;
|
|
80
84
|
if (allowBackgroundColor) {
|
|
81
|
-
var _node$attrs, _node$attrs2;
|
|
85
|
+
var _node$attrs, _node$attrs2, _node$attrs3;
|
|
82
86
|
var node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
|
|
83
87
|
var background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
|
|
88
|
+
var selectedRowIndex;
|
|
89
|
+
var selectedColumnIndex;
|
|
90
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
91
|
+
var selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette, background, colorPalletteColumns);
|
|
92
|
+
selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
|
|
93
|
+
selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
|
|
94
|
+
}
|
|
84
95
|
return {
|
|
85
96
|
content: isDragAndDropEnabled ? formatMessage(messages.backgroundColor) : formatMessage(messages.cellBackground),
|
|
86
97
|
value: {
|
|
@@ -104,10 +115,27 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
104
115
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
105
116
|
,
|
|
106
117
|
className: isDragAndDropEnabled ? ClassName.CONTEXTUAL_MENU_ICON_SMALL : ClassName.CONTEXTUAL_MENU_ICON
|
|
107
|
-
}), isSubmenuOpen && jsx("div", {
|
|
118
|
+
}), getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen && jsx("div", {
|
|
108
119
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
109
120
|
className: ClassName.CONTEXTUAL_SUBMENU,
|
|
110
121
|
ref: _this.handleSubMenuRef
|
|
122
|
+
}, jsx(ArrowKeyNavigationProvider, {
|
|
123
|
+
type: ArrowKeyNavigationType.COLOR,
|
|
124
|
+
selectedRowIndex: selectedRowIndex || 0,
|
|
125
|
+
selectedColumnIndex: selectedColumnIndex || 0,
|
|
126
|
+
handleClose: function handleClose() {
|
|
127
|
+
_this.setState({
|
|
128
|
+
isSubmenuOpen: false
|
|
129
|
+
});
|
|
130
|
+
if (_this.dropdownMenuRef && _this.dropdownMenuRef.current) {
|
|
131
|
+
var focusableItems = _this.dropdownMenuRef.current.querySelectorAll('div[tabindex="-1"]:not([disabled])');
|
|
132
|
+
if (focusableItems && focusableItems.length) {
|
|
133
|
+
focusableItems[0].focus();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
isPopupPositioned: true,
|
|
138
|
+
isOpenedByKeyboard: isCellMenuOpenByKeyboard
|
|
111
139
|
}, jsx(ColorPalette, {
|
|
112
140
|
cols: 7,
|
|
113
141
|
onClick: _this.setColor,
|
|
@@ -117,7 +145,22 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
117
145
|
paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
|
|
118
146
|
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
119
147
|
}
|
|
120
|
-
})))
|
|
148
|
+
}))) : isSubmenuOpen &&
|
|
149
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
150
|
+
jsx("div", {
|
|
151
|
+
className: ClassName.CONTEXTUAL_SUBMENU,
|
|
152
|
+
ref: _this.handleSubMenuRef
|
|
153
|
+
}, jsx(ColorPalette, {
|
|
154
|
+
cols: 7,
|
|
155
|
+
onClick: _this.setColor,
|
|
156
|
+
selectedColor: (node === null || node === void 0 || (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.background) || '#ffffff',
|
|
157
|
+
paletteOptions: {
|
|
158
|
+
palette: cellBackgroundColorPalette,
|
|
159
|
+
paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
|
|
160
|
+
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
161
|
+
}
|
|
162
|
+
}))),
|
|
163
|
+
'aria-expanded': getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? isSubmenuOpen : undefined
|
|
121
164
|
};
|
|
122
165
|
}
|
|
123
166
|
});
|
|
@@ -403,7 +446,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
403
446
|
selectionRect = _this$props10.selectionRect,
|
|
404
447
|
editorAnalyticsAPI = _this$props10.editorAnalyticsAPI,
|
|
405
448
|
getEditorContainerWidth = _this$props10.getEditorContainerWidth,
|
|
406
|
-
getEditorFeatureFlags = _this$props10.getEditorFeatureFlags
|
|
449
|
+
getEditorFeatureFlags = _this$props10.getEditorFeatureFlags,
|
|
450
|
+
isCellMenuOpenByKeyboard = _this$props10.isCellMenuOpenByKeyboard;
|
|
407
451
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
408
452
|
var state = editorView.state,
|
|
409
453
|
dispatch = editorView.dispatch;
|
|
@@ -416,6 +460,19 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
416
460
|
tableDuplicateCellColouring = _ref4$tableDuplicateC === void 0 ? false : _ref4$tableDuplicateC,
|
|
417
461
|
_ref4$tableWithFixedC = _ref4.tableWithFixedColumnWidthsOption,
|
|
418
462
|
tableWithFixedColumnWidthsOption = _ref4$tableWithFixedC === void 0 ? false : _ref4$tableWithFixedC;
|
|
463
|
+
// context menu opened by keyboard and any item except 'background' activated
|
|
464
|
+
// or color has been chosen from color palette
|
|
465
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && (item.value.name !== 'background' || item.value.name === 'background' && _this.state.isSubmenuOpen)) {
|
|
466
|
+
var tr = state.tr;
|
|
467
|
+
tr.setMeta(tablePluginKey, {
|
|
468
|
+
type: 'SET_CELL_MENU_OPEN',
|
|
469
|
+
data: {
|
|
470
|
+
isCellMenuOpenByKeyboard: false
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
dispatch(tr);
|
|
474
|
+
editorView.dom.focus(); // otherwise cursor disappears from cell
|
|
475
|
+
}
|
|
419
476
|
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
420
477
|
switch (item.value.name) {
|
|
421
478
|
case 'sort_column_desc':
|
|
@@ -466,6 +523,19 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
466
523
|
deleteRowsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect, !!isHeaderRowRequired)(state, dispatch);
|
|
467
524
|
_this.toggleOpen();
|
|
468
525
|
break;
|
|
526
|
+
case 'background':
|
|
527
|
+
{
|
|
528
|
+
// This is called twice.
|
|
529
|
+
// 1st time when user chooses the background color item.
|
|
530
|
+
// 2nd when color has been chosen from color palette.
|
|
531
|
+
// here we are handling the 1st call relying on the isSubmenuOpen state value
|
|
532
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !_this.state.isSubmenuOpen) {
|
|
533
|
+
_this.setState({
|
|
534
|
+
isSubmenuOpen: true
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
469
539
|
}
|
|
470
540
|
});
|
|
471
541
|
_defineProperty(_assertThisInitialized(_this), "toggleOpen", function () {
|
|
@@ -481,22 +551,55 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
481
551
|
});
|
|
482
552
|
}
|
|
483
553
|
});
|
|
484
|
-
_defineProperty(_assertThisInitialized(_this), "handleOpenChange", function () {
|
|
485
|
-
var _this$props$editorVie = _this.props.editorView,
|
|
486
|
-
state = _this$props$editorVie.state,
|
|
487
|
-
dispatch = _this$props$editorVie.dispatch;
|
|
488
|
-
toggleContextualMenu()(state, dispatch);
|
|
489
|
-
_this.setState({
|
|
490
|
-
isSubmenuOpen: false
|
|
491
|
-
});
|
|
492
|
-
});
|
|
493
|
-
_defineProperty(_assertThisInitialized(_this), "handleItemMouseEnter", function (_ref5) {
|
|
494
|
-
var item = _ref5.item;
|
|
554
|
+
_defineProperty(_assertThisInitialized(_this), "handleOpenChange", function (payload) {
|
|
495
555
|
var _this$props12 = _this.props,
|
|
496
556
|
_this$props12$editorV = _this$props12.editorView,
|
|
497
557
|
state = _this$props12$editorV.state,
|
|
498
558
|
dispatch = _this$props12$editorV.dispatch,
|
|
499
|
-
|
|
559
|
+
dom = _this$props12$editorV.dom,
|
|
560
|
+
isCellMenuOpenByKeyboard = _this$props12.isCellMenuOpenByKeyboard;
|
|
561
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
562
|
+
if (payload) {
|
|
563
|
+
var event = payload.event;
|
|
564
|
+
if (event && event instanceof KeyboardEvent) {
|
|
565
|
+
if (!_this.state.isSubmenuOpen) {
|
|
566
|
+
if (arrowsList.has(event.key)) {
|
|
567
|
+
// preventing default behavior for avoiding cursor jump to next/previous table column
|
|
568
|
+
// when left/right arrow pressed.
|
|
569
|
+
event.preventDefault();
|
|
570
|
+
}
|
|
571
|
+
toggleContextualMenu()(state, dispatch);
|
|
572
|
+
_this.setState({
|
|
573
|
+
isSubmenuOpen: false
|
|
574
|
+
});
|
|
575
|
+
setFocusToCellMenu(false)(state, dispatch);
|
|
576
|
+
dom.focus();
|
|
577
|
+
}
|
|
578
|
+
} else {
|
|
579
|
+
// mouse click outside
|
|
580
|
+
toggleContextualMenu()(state, dispatch);
|
|
581
|
+
_this.setState({
|
|
582
|
+
isSubmenuOpen: false
|
|
583
|
+
});
|
|
584
|
+
if (isCellMenuOpenByKeyboard) {
|
|
585
|
+
setFocusToCellMenu(false)(state, dispatch);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
} else {
|
|
590
|
+
toggleContextualMenu()(state, dispatch);
|
|
591
|
+
_this.setState({
|
|
592
|
+
isSubmenuOpen: false
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
_defineProperty(_assertThisInitialized(_this), "handleItemMouseEnter", function (_ref5) {
|
|
597
|
+
var item = _ref5.item;
|
|
598
|
+
var _this$props13 = _this.props,
|
|
599
|
+
_this$props13$editorV = _this$props13.editorView,
|
|
600
|
+
state = _this$props13$editorV.state,
|
|
601
|
+
dispatch = _this$props13$editorV.dispatch,
|
|
602
|
+
selectionRect = _this$props13.selectionRect;
|
|
500
603
|
if (item.value.name === 'background') {
|
|
501
604
|
if (!_this.state.isSubmenuOpen) {
|
|
502
605
|
_this.setState({
|
|
@@ -516,9 +619,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
516
619
|
});
|
|
517
620
|
_defineProperty(_assertThisInitialized(_this), "handleItemMouseLeave", function (_ref6) {
|
|
518
621
|
var item = _ref6.item;
|
|
519
|
-
var _this$props$
|
|
520
|
-
state = _this$props$
|
|
521
|
-
dispatch = _this$props$
|
|
622
|
+
var _this$props$editorVie = _this.props.editorView,
|
|
623
|
+
state = _this$props$editorVie.state,
|
|
624
|
+
dispatch = _this$props$editorVie.dispatch;
|
|
522
625
|
if (item.value.name === 'background') {
|
|
523
626
|
_this.closeSubmenu();
|
|
524
627
|
}
|
|
@@ -534,9 +637,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
534
637
|
}
|
|
535
638
|
});
|
|
536
639
|
_defineProperty(_assertThisInitialized(_this), "setColor", function (color) {
|
|
537
|
-
var _this$
|
|
538
|
-
editorView = _this$
|
|
539
|
-
editorAnalyticsAPI = _this$
|
|
640
|
+
var _this$props14 = _this.props,
|
|
641
|
+
editorView = _this$props14.editorView,
|
|
642
|
+
editorAnalyticsAPI = _this$props14.editorAnalyticsAPI;
|
|
540
643
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
541
644
|
var _getPluginState13 = getPluginState(editorView.state),
|
|
542
645
|
targetCellPosition = _getPluginState13.targetCellPosition;
|
|
@@ -548,20 +651,44 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
548
651
|
return _this;
|
|
549
652
|
}
|
|
550
653
|
_createClass(ContextualMenu, [{
|
|
654
|
+
key: "componentDidMount",
|
|
655
|
+
value: function componentDidMount() {
|
|
656
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
657
|
+
// ArrowKeyNavigationProvider in DropdownMenu expects that menu handle will stay focused
|
|
658
|
+
// until user pressed ArrowDown.
|
|
659
|
+
// Behavior above fails the A11Y requirement about first item in menu should be focused immediately.
|
|
660
|
+
// so here is triggering componentDidUpdate inside dropdown to set focus on first element
|
|
661
|
+
var isCellMenuOpenByKeyboard = this.props.isCellMenuOpenByKeyboard;
|
|
662
|
+
if (isCellMenuOpenByKeyboard) {
|
|
663
|
+
this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
|
|
664
|
+
isOpenAllowed: isCellMenuOpenByKeyboard
|
|
665
|
+
}));
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}, {
|
|
551
670
|
key: "render",
|
|
552
671
|
value: function render() {
|
|
553
|
-
var _this$
|
|
554
|
-
isOpen = _this$
|
|
555
|
-
mountPoint = _this$
|
|
556
|
-
offset = _this$
|
|
557
|
-
boundariesElement = _this$
|
|
558
|
-
editorView = _this$
|
|
672
|
+
var _this$props15 = this.props,
|
|
673
|
+
isOpen = _this$props15.isOpen,
|
|
674
|
+
mountPoint = _this$props15.mountPoint,
|
|
675
|
+
offset = _this$props15.offset,
|
|
676
|
+
boundariesElement = _this$props15.boundariesElement,
|
|
677
|
+
editorView = _this$props15.editorView,
|
|
678
|
+
isCellMenuOpenByKeyboard = _this$props15.isCellMenuOpenByKeyboard;
|
|
559
679
|
var _getPluginState14 = getPluginState(editorView.state),
|
|
560
680
|
isDragAndDropEnabled = _getPluginState14.isDragAndDropEnabled;
|
|
561
681
|
var items = isDragAndDropEnabled ? this.createNewContextMenuItems() : this.createOriginalContextMenuItems();
|
|
682
|
+
var isOpenAllowed = false;
|
|
683
|
+
if (getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c')) {
|
|
684
|
+
isOpenAllowed = isCellMenuOpenByKeyboard ? this.state.isOpenAllowed : isOpen;
|
|
685
|
+
} else {
|
|
686
|
+
isOpenAllowed = isOpen;
|
|
687
|
+
}
|
|
562
688
|
return jsx("div", {
|
|
563
689
|
"data-testid": "table-cell-contextual-menu",
|
|
564
|
-
onMouseLeave: this.closeSubmenu
|
|
690
|
+
onMouseLeave: this.closeSubmenu,
|
|
691
|
+
ref: this.dropdownMenuRef
|
|
565
692
|
}, jsx(DropdownMenu, {
|
|
566
693
|
mountTo: mountPoint
|
|
567
694
|
//This needs be removed when the a11y is completely handled
|
|
@@ -569,21 +696,25 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
569
696
|
,
|
|
570
697
|
arrowKeyNavigationProviderOptions: {
|
|
571
698
|
type: ArrowKeyNavigationType.MENU,
|
|
572
|
-
disableArrowKeyNavigation: true
|
|
699
|
+
disableArrowKeyNavigation: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') && isCellMenuOpenByKeyboard && !this.state.isSubmenuOpen ? false : true
|
|
573
700
|
},
|
|
574
701
|
items: items,
|
|
575
|
-
isOpen:
|
|
702
|
+
isOpen: isOpenAllowed,
|
|
576
703
|
onOpenChange: this.handleOpenChange,
|
|
577
704
|
onItemActivated: this.onMenuItemActivated,
|
|
578
705
|
onMouseEnter: this.handleItemMouseEnter,
|
|
579
706
|
onMouseLeave: this.handleItemMouseLeave,
|
|
580
707
|
fitHeight: 188,
|
|
581
708
|
fitWidth: isDragAndDropEnabled ? contextualMenuDropdownWidthDnD : contextualMenuDropdownWidth,
|
|
709
|
+
shouldFocusFirstItem: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? function () {
|
|
710
|
+
return Boolean(isCellMenuOpenByKeyboard);
|
|
711
|
+
} : undefined,
|
|
582
712
|
boundariesElement: boundariesElement,
|
|
583
713
|
offset: offset,
|
|
584
714
|
section: isDragAndDropEnabled ? {
|
|
585
715
|
hasSeparator: true
|
|
586
|
-
} : undefined
|
|
716
|
+
} : undefined,
|
|
717
|
+
isAllowEnterDefaultBehavior: getBooleanFF('platform.editor.a11y-table-context-menu_y4c9c') ? this.state.isSubmenuOpen : false
|
|
587
718
|
}));
|
|
588
719
|
}
|
|
589
720
|
}]);
|
|
@@ -18,7 +18,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
18
18
|
pluginConfig = _ref.pluginConfig,
|
|
19
19
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
20
20
|
getEditorContainerWidth = _ref.getEditorContainerWidth,
|
|
21
|
-
getEditorFeatureFlags = _ref.getEditorFeatureFlags
|
|
21
|
+
getEditorFeatureFlags = _ref.getEditorFeatureFlags,
|
|
22
|
+
isCellMenuOpenByKeyboard = _ref.isCellMenuOpenByKeyboard;
|
|
22
23
|
// TargetCellPosition could be outdated: https://product-fabric.atlassian.net/browse/ED-8129
|
|
23
24
|
var _getPluginState = getPluginState(editorView.state),
|
|
24
25
|
targetCellPosition = _getPluginState.targetCellPosition,
|
|
@@ -67,7 +68,8 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
|
|
|
67
68
|
boundariesElement: boundariesElement,
|
|
68
69
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
69
70
|
getEditorContainerWidth: getEditorContainerWidth,
|
|
70
|
-
getEditorFeatureFlags: getEditorFeatureFlags
|
|
71
|
+
getEditorFeatureFlags: getEditorFeatureFlags,
|
|
72
|
+
isCellMenuOpenByKeyboard: isCellMenuOpenByKeyboard
|
|
71
73
|
})));
|
|
72
74
|
};
|
|
73
75
|
FloatingContextualMenu.displayName = 'FloatingContextualMenu';
|
|
@@ -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';
|
|
@@ -38,3 +38,4 @@ export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWit
|
|
|
38
38
|
export declare const updateWidthToWidest: (widthToWidest: WidthToWidest) => Command;
|
|
39
39
|
export declare const setTableAlignment: (newAlignment: TableLayout) => EditorCommand;
|
|
40
40
|
export declare const setTableAlignmentWithTableContentWithPos: (newAlignment: TableLayout, tableNodeWithPos: NodeWithPos) => EditorCommand;
|
|
41
|
+
export declare const setFocusToCellMenu: (isCellMenuOpenByKeyboard?: boolean, originalTr?: Transaction) => Command;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export interface TablePluginState {
|
|
|
106
106
|
isDragAndDropEnabled?: boolean;
|
|
107
107
|
isTableHovered?: boolean;
|
|
108
108
|
isTableScalingEnabled?: boolean;
|
|
109
|
+
isCellMenuOpenByKeyboard?: boolean;
|
|
109
110
|
}
|
|
110
111
|
export type TablePluginAction = {
|
|
111
112
|
type: 'SET_EDITOR_FOCUS';
|
|
@@ -248,6 +249,11 @@ export type TablePluginAction = {
|
|
|
248
249
|
type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON';
|
|
249
250
|
} | {
|
|
250
251
|
type: 'TOGGLE_CONTEXTUAL_MENU';
|
|
252
|
+
} | {
|
|
253
|
+
type: 'SET_CELL_MENU_OPEN';
|
|
254
|
+
data: {
|
|
255
|
+
isCellMenuOpenByKeyboard: boolean;
|
|
256
|
+
};
|
|
251
257
|
};
|
|
252
258
|
export type ColumnResizingPluginAction = {
|
|
253
259
|
type: 'SET_RESIZE_HANDLE_POSITION';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { Component } from 'react';
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
@@ -20,15 +20,19 @@ export interface Props {
|
|
|
20
20
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
21
21
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
22
22
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
23
|
+
isCellMenuOpenByKeyboard?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export interface State {
|
|
25
26
|
isSubmenuOpen: boolean;
|
|
27
|
+
isOpenAllowed: boolean;
|
|
26
28
|
}
|
|
27
29
|
export declare class ContextualMenu extends Component<Props & WrappedComponentProps, State> {
|
|
28
30
|
state: State;
|
|
29
31
|
static defaultProps: {
|
|
30
32
|
boundariesElement: HTMLElement | undefined;
|
|
31
33
|
};
|
|
34
|
+
private dropdownMenuRef;
|
|
35
|
+
componentDidMount(): void;
|
|
32
36
|
render(): jsx.JSX.Element;
|
|
33
37
|
private handleSubMenuRef;
|
|
34
38
|
private createBackgroundColorItem;
|
|
@@ -50,7 +54,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
|
|
|
50
54
|
private closeSubmenu;
|
|
51
55
|
private setColor;
|
|
52
56
|
}
|
|
53
|
-
declare const _default:
|
|
54
|
-
WrappedComponent:
|
|
57
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
58
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
55
59
|
};
|
|
56
60
|
export default _default;
|
|
@@ -15,9 +15,10 @@ export interface Props {
|
|
|
15
15
|
scrollableElement?: HTMLElement;
|
|
16
16
|
pluginConfig?: PluginConfig;
|
|
17
17
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
18
|
+
isCellMenuOpenByKeyboard?: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare const FloatingContextualMenu: {
|
|
20
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, }: Props): jsx.JSX.Element | null;
|
|
21
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, }: Props): jsx.JSX.Element | null;
|
|
21
22
|
displayName: string;
|
|
22
23
|
};
|
|
23
24
|
export default FloatingContextualMenu;
|
|
@@ -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';
|
|
@@ -38,3 +38,4 @@ export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWit
|
|
|
38
38
|
export declare const updateWidthToWidest: (widthToWidest: WidthToWidest) => Command;
|
|
39
39
|
export declare const setTableAlignment: (newAlignment: TableLayout) => EditorCommand;
|
|
40
40
|
export declare const setTableAlignmentWithTableContentWithPos: (newAlignment: TableLayout, tableNodeWithPos: NodeWithPos) => EditorCommand;
|
|
41
|
+
export declare const setFocusToCellMenu: (isCellMenuOpenByKeyboard?: boolean, originalTr?: Transaction) => Command;
|
|
@@ -106,6 +106,7 @@ export interface TablePluginState {
|
|
|
106
106
|
isDragAndDropEnabled?: boolean;
|
|
107
107
|
isTableHovered?: boolean;
|
|
108
108
|
isTableScalingEnabled?: boolean;
|
|
109
|
+
isCellMenuOpenByKeyboard?: boolean;
|
|
109
110
|
}
|
|
110
111
|
export type TablePluginAction = {
|
|
111
112
|
type: 'SET_EDITOR_FOCUS';
|
|
@@ -248,6 +249,11 @@ export type TablePluginAction = {
|
|
|
248
249
|
type: 'HIDE_INSERT_COLUMN_OR_ROW_BUTTON';
|
|
249
250
|
} | {
|
|
250
251
|
type: 'TOGGLE_CONTEXTUAL_MENU';
|
|
252
|
+
} | {
|
|
253
|
+
type: 'SET_CELL_MENU_OPEN';
|
|
254
|
+
data: {
|
|
255
|
+
isCellMenuOpenByKeyboard: boolean;
|
|
256
|
+
};
|
|
251
257
|
};
|
|
252
258
|
export type ColumnResizingPluginAction = {
|
|
253
259
|
type: 'SET_RESIZE_HANDLE_POSITION';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import { Component } from 'react';
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
@@ -20,15 +20,19 @@ export interface Props {
|
|
|
20
20
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
21
21
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
22
22
|
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
23
|
+
isCellMenuOpenByKeyboard?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export interface State {
|
|
25
26
|
isSubmenuOpen: boolean;
|
|
27
|
+
isOpenAllowed: boolean;
|
|
26
28
|
}
|
|
27
29
|
export declare class ContextualMenu extends Component<Props & WrappedComponentProps, State> {
|
|
28
30
|
state: State;
|
|
29
31
|
static defaultProps: {
|
|
30
32
|
boundariesElement: HTMLElement | undefined;
|
|
31
33
|
};
|
|
34
|
+
private dropdownMenuRef;
|
|
35
|
+
componentDidMount(): void;
|
|
32
36
|
render(): jsx.JSX.Element;
|
|
33
37
|
private handleSubMenuRef;
|
|
34
38
|
private createBackgroundColorItem;
|
|
@@ -50,7 +54,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
|
|
|
50
54
|
private closeSubmenu;
|
|
51
55
|
private setColor;
|
|
52
56
|
}
|
|
53
|
-
declare const _default:
|
|
54
|
-
WrappedComponent:
|
|
57
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
58
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
55
59
|
};
|
|
56
60
|
export default _default;
|
|
@@ -15,9 +15,10 @@ export interface Props {
|
|
|
15
15
|
scrollableElement?: HTMLElement;
|
|
16
16
|
pluginConfig?: PluginConfig;
|
|
17
17
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
18
|
+
isCellMenuOpenByKeyboard?: boolean;
|
|
18
19
|
}
|
|
19
20
|
declare const FloatingContextualMenu: {
|
|
20
|
-
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, }: Props): jsx.JSX.Element | null;
|
|
21
|
+
({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, isCellMenuOpenByKeyboard, }: Props): jsx.JSX.Element | null;
|
|
21
22
|
displayName: string;
|
|
22
23
|
};
|
|
23
24
|
export default FloatingContextualMenu;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.18.
|
|
3
|
+
"version": "7.18.4",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -111,9 +111,6 @@
|
|
|
111
111
|
"platform.editor.a11y-table-resizing_uapcv": {
|
|
112
112
|
"type": "boolean"
|
|
113
113
|
},
|
|
114
|
-
"platform.editor.a11y-column-resizing_emcvz": {
|
|
115
|
-
"type": "boolean"
|
|
116
|
-
},
|
|
117
114
|
"platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg": {
|
|
118
115
|
"type": "boolean"
|
|
119
116
|
},
|
|
@@ -134,6 +131,9 @@
|
|
|
134
131
|
},
|
|
135
132
|
"platform.editor.table.editor-num-col-style-changes": {
|
|
136
133
|
"type": "boolean"
|
|
134
|
+
},
|
|
135
|
+
"platform.editor.a11y-table-context-menu_y4c9c": {
|
|
136
|
+
"type": "boolean"
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
@@ -123,10 +123,6 @@ export const initiateKeyboardColumnResizing =
|
|
|
123
123
|
getIntl?: () => IntlShape;
|
|
124
124
|
}): Command =>
|
|
125
125
|
(state, dispatch, view) => {
|
|
126
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
126
|
const { selection } = state;
|
|
131
127
|
const selectionRect = isSelectionType(selection, 'cell')
|
|
132
128
|
? getSelectionRect(selection)!
|
|
@@ -160,10 +156,6 @@ export const activateNextResizeArea =
|
|
|
160
156
|
getIntl?: () => IntlShape;
|
|
161
157
|
}): Command =>
|
|
162
158
|
(state, dispatch, view) => {
|
|
163
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
159
|
const { resizeHandlePos } = getTableResizingPluginState(state) || {};
|
|
168
160
|
// If No resizing has initiated, skip to regular handler
|
|
169
161
|
if (!resizeHandlePos) {
|
|
@@ -274,9 +266,6 @@ export const changeColumnWidthByStep =
|
|
|
274
266
|
const fakeDispatch = (tr: Transaction) => {
|
|
275
267
|
customTr = tr;
|
|
276
268
|
};
|
|
277
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
280
269
|
const { resizeHandlePos } = getTableResizingPluginState(state);
|
|
281
270
|
const cell = findCellClosestToPos(state.selection.$from);
|
|
282
271
|
if (!view || !resizeHandlePos || !cell) {
|
|
@@ -403,9 +392,6 @@ export const stopKeyboardColumnResizing =
|
|
|
403
392
|
originalTr?: Transaction;
|
|
404
393
|
}): Command =>
|
|
405
394
|
(state, dispatch) => {
|
|
406
|
-
if (!getBooleanFF('platform.editor.a11y-column-resizing_emcvz')) {
|
|
407
|
-
return false;
|
|
408
|
-
}
|
|
409
395
|
let customTr = originalTr || state.tr;
|
|
410
396
|
const fakeDispatch = (tr: Transaction) => {
|
|
411
397
|
customTr = tr;
|