@atlaskit/editor-plugin-table 38.0.1 → 38.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/pm-plugins/handlers.js +1 -2
- package/dist/cjs/ui/DragHandle/index.js +2 -3
- package/dist/cjs/ui/FloatingTableMenu/index.js +1 -2
- package/dist/cjs/ui/TableMenu/column/items/DeleteColumnItem.js +1 -2
- package/dist/cjs/ui/TableMenu/row/items/DeleteRowItem.js +1 -2
- package/dist/cjs/ui/TableMenu/shared/items/ClearCellsItem.js +1 -2
- package/dist/es2019/pm-plugins/handlers.js +1 -2
- package/dist/es2019/ui/DragHandle/index.js +2 -3
- package/dist/es2019/ui/FloatingTableMenu/index.js +1 -2
- package/dist/es2019/ui/TableMenu/column/items/DeleteColumnItem.js +1 -2
- package/dist/es2019/ui/TableMenu/row/items/DeleteRowItem.js +1 -2
- package/dist/es2019/ui/TableMenu/shared/items/ClearCellsItem.js +1 -2
- package/dist/esm/pm-plugins/handlers.js +1 -2
- package/dist/esm/ui/DragHandle/index.js +2 -3
- package/dist/esm/ui/FloatingTableMenu/index.js +1 -2
- package/dist/esm/ui/TableMenu/column/items/DeleteColumnItem.js +1 -2
- package/dist/esm/ui/TableMenu/row/items/DeleteRowItem.js +1 -2
- package/dist/esm/ui/TableMenu/shared/items/ClearCellsItem.js +1 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 38.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a200f8344ae7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a200f8344ae7f) -
|
|
8
|
+
Clean up experiment `platform_editor_table_menu_updates_patch_4`
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 38.0.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`a43e85621e87c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a43e85621e87c) -
|
|
16
|
+
Lower sticky table headers, masks, and dependent controls below the agent control under the
|
|
17
|
+
platform_editor_sticky_headers_zindex experiment.
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 38.0.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
11
11
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
12
12
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
13
13
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
14
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
15
14
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _defaultTableSelection = require("./default-table-selection");
|
|
17
16
|
var _pluginKey = require("./table-resizing/plugin-key");
|
|
@@ -55,7 +54,7 @@ var updateTargetCellPosition = function updateTargetCellPosition(_ref2) {
|
|
|
55
54
|
var hasTargetCellChanged = pluginState.targetCellPosition !== _targetCellPosition;
|
|
56
55
|
var hasActiveTableMenu = pluginState.activeTableMenu != null && pluginState.activeTableMenu.type !== 'none';
|
|
57
56
|
var isActiveDragMenu = ((_pluginState$activeTa = pluginState.activeTableMenu) === null || _pluginState$activeTa === void 0 ? void 0 : _pluginState$activeTa.type) === 'row' || ((_pluginState$activeTa2 = pluginState.activeTableMenu) === null || _pluginState$activeTa2 === void 0 ? void 0 : _pluginState$activeTa2.type) === 'column';
|
|
58
|
-
var shouldPreserveActiveDragMenu =
|
|
57
|
+
var shouldPreserveActiveDragMenu = isActiveDragMenu && tr.selection instanceof _cellSelection.CellSelection;
|
|
59
58
|
var shouldCloseMenu = hasActiveTableMenu && tr.selectionSet && (!tableNode || !(tr.selection instanceof _cellSelection.CellSelection) || hasTargetCellChanged && !shouldPreserveActiveDragMenu);
|
|
60
59
|
if (!hasTargetCellChanged && !shouldCloseMenu) {
|
|
61
60
|
return pluginState;
|
|
@@ -16,7 +16,6 @@ var _browser = require("@atlaskit/editor-common/browser");
|
|
|
16
16
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
17
17
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
18
18
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
19
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
20
19
|
var _elementAdapter = require("@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter");
|
|
21
20
|
var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview");
|
|
22
21
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
@@ -208,7 +207,7 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
208
207
|
}, [api]);
|
|
209
208
|
var keepActiveDragMenuOrHideToolbar = (0, _react.useCallback)(function () {
|
|
210
209
|
var _api$table2, _api$core2;
|
|
211
|
-
if (!
|
|
210
|
+
if (!api) {
|
|
212
211
|
return;
|
|
213
212
|
}
|
|
214
213
|
var activeTableMenu = (_api$table2 = api.table) === null || _api$table2 === void 0 || (_api$table2 = _api$table2.sharedState.currentState()) === null || _api$table2 === void 0 ? void 0 : _api$table2.activeTableMenu;
|
|
@@ -285,7 +284,7 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
285
284
|
// return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
|
|
286
285
|
// -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
|
|
287
286
|
editorView.focus();
|
|
288
|
-
if (
|
|
287
|
+
if (e.shiftKey) {
|
|
289
288
|
keepActiveDragMenuOrHideToolbar();
|
|
290
289
|
return;
|
|
291
290
|
}
|
|
@@ -13,7 +13,6 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
13
13
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
14
14
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
15
15
|
var _toolbarKeyboardNavigationProvider = require("@atlaskit/editor-toolbar/toolbar-keyboard-navigation-provider");
|
|
16
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
17
16
|
var _commands = require("../../pm-plugins/commands");
|
|
18
17
|
var _types = require("../../types");
|
|
19
18
|
var _consts = require("../consts");
|
|
@@ -130,7 +129,7 @@ var FloatingTableMenu = function FloatingTableMenu(_ref) {
|
|
|
130
129
|
}
|
|
131
130
|
api === null || api === void 0 || api.core.actions.execute((0, _commands.closeActiveTableMenu)(api));
|
|
132
131
|
}, [api]);
|
|
133
|
-
if (!isDragMenuOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition || (0,
|
|
132
|
+
if (!isDragMenuOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition || (0, _utils.isTableSelected)(editorView.state.selection)) {
|
|
134
133
|
return null;
|
|
135
134
|
}
|
|
136
135
|
var inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(_types.TableCssClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW));
|
|
@@ -12,7 +12,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
12
12
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
16
15
|
var _commands = require("../../../../pm-plugins/commands");
|
|
17
16
|
var _commandsWithAnalytics = require("../../../../pm-plugins/commands/commands-with-analytics");
|
|
18
17
|
var _selection = require("../../../../pm-plugins/utils/selection");
|
|
@@ -26,7 +25,7 @@ var DeleteColumnItem = exports.DeleteColumnItem = function DeleteColumnItem(_ref
|
|
|
26
25
|
var _ref2 = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
27
26
|
editorView = _ref2.editorView;
|
|
28
27
|
var selectedColumnCount = (_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedColumnCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1;
|
|
29
|
-
var shouldShowShortcut =
|
|
28
|
+
var shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== _keys.CELL_MENU.key;
|
|
30
29
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
31
30
|
formatMessage = _useIntl.formatMessage;
|
|
32
31
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
@@ -12,7 +12,6 @@ var _hooks = require("@atlaskit/editor-common/hooks");
|
|
|
12
12
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
16
15
|
var _commands = require("../../../../pm-plugins/commands");
|
|
17
16
|
var _commandsWithAnalytics = require("../../../../pm-plugins/commands/commands-with-analytics");
|
|
18
17
|
var _selection = require("../../../../pm-plugins/utils/selection");
|
|
@@ -33,7 +32,7 @@ var DeleteRowItem = exports.DeleteRowItem = function DeleteRowItem(props) {
|
|
|
33
32
|
}),
|
|
34
33
|
isHeaderRowRequired = _useSharedPluginState.isHeaderRowRequired;
|
|
35
34
|
var selectedRowCount = (_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedRowCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1;
|
|
36
|
-
var shouldShowShortcut =
|
|
35
|
+
var shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== _keys.CELL_MENU.key;
|
|
37
36
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
38
37
|
formatMessage = _useIntl.formatMessage;
|
|
39
38
|
var handleMouseEnter = function handleMouseEnter() {
|
|
@@ -11,7 +11,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
11
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
14
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
15
14
|
var _commands = require("../../../../pm-plugins/commands");
|
|
16
15
|
var _commandsWithAnalytics = require("../../../../pm-plugins/commands/commands-with-analytics");
|
|
17
16
|
var _pluginFactory = require("../../../../pm-plugins/plugin-factory");
|
|
@@ -26,7 +25,7 @@ var ClearCellsItem = exports.ClearCellsItem = function ClearCellsItem(_ref) {
|
|
|
26
25
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
27
26
|
formatMessage = _useIntl.formatMessage;
|
|
28
27
|
var selectedCellCount = Math.max((_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedColumnCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1, (_tableMenuContext$sel2 = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedRowCount) !== null && _tableMenuContext$sel2 !== void 0 ? _tableMenuContext$sel2 : 1);
|
|
29
|
-
var shouldShowShortcut =
|
|
28
|
+
var shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== _keys.CELL_MENU.key || selectedCellCount > 1;
|
|
30
29
|
var handleClick = function handleClick() {
|
|
31
30
|
var _api$analytics;
|
|
32
31
|
if (!editorView) {
|
|
@@ -4,7 +4,6 @@ import { isTextInput } from '@atlaskit/editor-common/utils';
|
|
|
4
4
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
5
5
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
6
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
7
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
import { defaultTableSelection } from './default-table-selection';
|
|
10
9
|
import { pluginKey as tableResizingPluginKey } from './table-resizing/plugin-key';
|
|
@@ -44,7 +43,7 @@ const updateTargetCellPosition = ({
|
|
|
44
43
|
const hasTargetCellChanged = pluginState.targetCellPosition !== targetCellPosition;
|
|
45
44
|
const hasActiveTableMenu = pluginState.activeTableMenu != null && pluginState.activeTableMenu.type !== 'none';
|
|
46
45
|
const isActiveDragMenu = ((_pluginState$activeTa = pluginState.activeTableMenu) === null || _pluginState$activeTa === void 0 ? void 0 : _pluginState$activeTa.type) === 'row' || ((_pluginState$activeTa2 = pluginState.activeTableMenu) === null || _pluginState$activeTa2 === void 0 ? void 0 : _pluginState$activeTa2.type) === 'column';
|
|
47
|
-
const shouldPreserveActiveDragMenu =
|
|
46
|
+
const shouldPreserveActiveDragMenu = isActiveDragMenu && tr.selection instanceof CellSelection;
|
|
48
47
|
const shouldCloseMenu = hasActiveTableMenu && tr.selectionSet && (!tableNode || !(tr.selection instanceof CellSelection) || hasTargetCellChanged && !shouldPreserveActiveDragMenu);
|
|
49
48
|
if (!hasTargetCellChanged && !shouldCloseMenu) {
|
|
50
49
|
return pluginState;
|
|
@@ -8,7 +8,6 @@ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
|
8
8
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
9
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { findTable, TableMap } from '@atlaskit/editor-tables';
|
|
11
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
12
11
|
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';
|
|
13
12
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview';
|
|
14
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -197,7 +196,7 @@ const DragHandleComponent = ({
|
|
|
197
196
|
}, [api]);
|
|
198
197
|
const keepActiveDragMenuOrHideToolbar = useCallback(() => {
|
|
199
198
|
var _api$table2, _api$table2$sharedSta, _api$core2;
|
|
200
|
-
if (!
|
|
199
|
+
if (!api) {
|
|
201
200
|
return;
|
|
202
201
|
}
|
|
203
202
|
const activeTableMenu = (_api$table2 = api.table) === null || _api$table2 === void 0 ? void 0 : (_api$table2$sharedSta = _api$table2.sharedState.currentState()) === null || _api$table2$sharedSta === void 0 ? void 0 : _api$table2$sharedSta.activeTableMenu;
|
|
@@ -279,7 +278,7 @@ const DragHandleComponent = ({
|
|
|
279
278
|
// return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
|
|
280
279
|
// -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
|
|
281
280
|
editorView.focus();
|
|
282
|
-
if (
|
|
281
|
+
if (e.shiftKey) {
|
|
283
282
|
keepActiveDragMenuOrHideToolbar();
|
|
284
283
|
return;
|
|
285
284
|
}
|
|
@@ -6,7 +6,6 @@ import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from
|
|
|
6
6
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
7
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { ToolbarKeyboardNavigationProvider } from '@atlaskit/editor-toolbar/toolbar-keyboard-navigation-provider';
|
|
9
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
10
9
|
import { closeActiveTableMenu } from '../../pm-plugins/commands';
|
|
11
10
|
import { TableCssClassName as ClassName } from '../../types';
|
|
12
11
|
import { dragTableInsertColumnButtonSize, tablePopupMenuFitHeight } from '../consts';
|
|
@@ -120,7 +119,7 @@ const FloatingTableMenu = ({
|
|
|
120
119
|
}
|
|
121
120
|
api === null || api === void 0 ? void 0 : api.core.actions.execute(closeActiveTableMenu(api));
|
|
122
121
|
}, [api]);
|
|
123
|
-
if (!isDragMenuOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition ||
|
|
122
|
+
if (!isDragMenuOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition || isTableSelected(editorView.state.selection)) {
|
|
124
123
|
return null;
|
|
125
124
|
}
|
|
126
125
|
const inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW));
|
|
@@ -5,7 +5,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
5
5
|
import { deleteColumn, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
8
|
import { clearHoverSelection, closeActiveTableMenu, hoverColumns } from '../../../../pm-plugins/commands';
|
|
10
9
|
import { deleteColumnsWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
11
10
|
import { getSelectedColumnIndexes } from '../../../../pm-plugins/utils/selection';
|
|
@@ -21,7 +20,7 @@ export const DeleteColumnItem = ({
|
|
|
21
20
|
editorView
|
|
22
21
|
} = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {};
|
|
23
22
|
const selectedColumnCount = (_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedColumnCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1;
|
|
24
|
-
const shouldShowShortcut =
|
|
23
|
+
const shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== CELL_MENU.key;
|
|
25
24
|
const {
|
|
26
25
|
formatMessage
|
|
27
26
|
} = useIntl();
|
|
@@ -5,7 +5,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
5
5
|
import { deleteRow, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
8
|
import { clearHoverSelection, closeActiveTableMenu, hoverRows } from '../../../../pm-plugins/commands';
|
|
10
9
|
import { deleteRowsWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
11
10
|
import { getSelectedRowIndexes } from '../../../../pm-plugins/utils/selection';
|
|
@@ -30,7 +29,7 @@ export const DeleteRowItem = props => {
|
|
|
30
29
|
};
|
|
31
30
|
});
|
|
32
31
|
const selectedRowCount = (_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedRowCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1;
|
|
33
|
-
const shouldShowShortcut =
|
|
32
|
+
const shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== CELL_MENU.key;
|
|
34
33
|
const {
|
|
35
34
|
formatMessage
|
|
36
35
|
} = useIntl();
|
|
@@ -4,7 +4,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { CrossIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
7
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
7
|
import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
|
|
9
8
|
import { emptyMultipleCellsWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
10
9
|
import { getPluginState } from '../../../../pm-plugins/plugin-factory';
|
|
@@ -22,7 +21,7 @@ export const ClearCellsItem = ({
|
|
|
22
21
|
formatMessage
|
|
23
22
|
} = useIntl();
|
|
24
23
|
const selectedCellCount = Math.max((_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedColumnCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1, (_tableMenuContext$sel2 = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedRowCount) !== null && _tableMenuContext$sel2 !== void 0 ? _tableMenuContext$sel2 : 1);
|
|
25
|
-
const shouldShowShortcut =
|
|
24
|
+
const shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== CELL_MENU.key || selectedCellCount > 1;
|
|
26
25
|
const handleClick = () => {
|
|
27
26
|
var _api$analytics;
|
|
28
27
|
if (!editorView) {
|
|
@@ -7,7 +7,6 @@ import { isTextInput } from '@atlaskit/editor-common/utils';
|
|
|
7
7
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
9
9
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
10
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
11
|
import { defaultTableSelection } from './default-table-selection';
|
|
13
12
|
import { pluginKey as tableResizingPluginKey } from './table-resizing/plugin-key';
|
|
@@ -49,7 +48,7 @@ var updateTargetCellPosition = function updateTargetCellPosition(_ref2) {
|
|
|
49
48
|
var hasTargetCellChanged = pluginState.targetCellPosition !== _targetCellPosition;
|
|
50
49
|
var hasActiveTableMenu = pluginState.activeTableMenu != null && pluginState.activeTableMenu.type !== 'none';
|
|
51
50
|
var isActiveDragMenu = ((_pluginState$activeTa = pluginState.activeTableMenu) === null || _pluginState$activeTa === void 0 ? void 0 : _pluginState$activeTa.type) === 'row' || ((_pluginState$activeTa2 = pluginState.activeTableMenu) === null || _pluginState$activeTa2 === void 0 ? void 0 : _pluginState$activeTa2.type) === 'column';
|
|
52
|
-
var shouldPreserveActiveDragMenu =
|
|
51
|
+
var shouldPreserveActiveDragMenu = isActiveDragMenu && tr.selection instanceof CellSelection;
|
|
53
52
|
var shouldCloseMenu = hasActiveTableMenu && tr.selectionSet && (!tableNode || !(tr.selection instanceof CellSelection) || hasTargetCellChanged && !shouldPreserveActiveDragMenu);
|
|
54
53
|
if (!hasTargetCellChanged && !shouldCloseMenu) {
|
|
55
54
|
return pluginState;
|
|
@@ -10,7 +10,6 @@ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
|
10
10
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
12
|
import { findTable, TableMap } from '@atlaskit/editor-tables';
|
|
13
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
14
13
|
import { draggable } from '@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter';
|
|
15
14
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/utils/set-custom-native-drag-preview';
|
|
16
15
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
@@ -199,7 +198,7 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
199
198
|
}, [api]);
|
|
200
199
|
var keepActiveDragMenuOrHideToolbar = useCallback(function () {
|
|
201
200
|
var _api$table2, _api$core2;
|
|
202
|
-
if (!
|
|
201
|
+
if (!api) {
|
|
203
202
|
return;
|
|
204
203
|
}
|
|
205
204
|
var activeTableMenu = (_api$table2 = api.table) === null || _api$table2 === void 0 || (_api$table2 = _api$table2.sharedState.currentState()) === null || _api$table2 === void 0 ? void 0 : _api$table2.activeTableMenu;
|
|
@@ -276,7 +275,7 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
276
275
|
// return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
|
|
277
276
|
// -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
|
|
278
277
|
editorView.focus();
|
|
279
|
-
if (
|
|
278
|
+
if (e.shiftKey) {
|
|
280
279
|
keepActiveDragMenuOrHideToolbar();
|
|
281
280
|
return;
|
|
282
281
|
}
|
|
@@ -6,7 +6,6 @@ import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from
|
|
|
6
6
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
7
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { ToolbarKeyboardNavigationProvider } from '@atlaskit/editor-toolbar/toolbar-keyboard-navigation-provider';
|
|
9
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
10
9
|
import { closeActiveTableMenu } from '../../pm-plugins/commands';
|
|
11
10
|
import { TableCssClassName as ClassName } from '../../types';
|
|
12
11
|
import { dragTableInsertColumnButtonSize, tablePopupMenuFitHeight } from '../consts';
|
|
@@ -122,7 +121,7 @@ var FloatingTableMenu = function FloatingTableMenu(_ref) {
|
|
|
122
121
|
}
|
|
123
122
|
api === null || api === void 0 || api.core.actions.execute(closeActiveTableMenu(api));
|
|
124
123
|
}, [api]);
|
|
125
|
-
if (!isDragMenuOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition ||
|
|
124
|
+
if (!isDragMenuOpen || !targetCellPosition || editorView.state.doc.nodeSize <= targetCellPosition || isTableSelected(editorView.state.selection)) {
|
|
126
125
|
return null;
|
|
127
126
|
}
|
|
128
127
|
var inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW));
|
|
@@ -5,7 +5,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
5
5
|
import { deleteColumn, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
8
|
import { clearHoverSelection, closeActiveTableMenu, hoverColumns } from '../../../../pm-plugins/commands';
|
|
10
9
|
import { deleteColumnsWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
11
10
|
import { getSelectedColumnIndexes } from '../../../../pm-plugins/utils/selection';
|
|
@@ -19,7 +18,7 @@ export var DeleteColumnItem = function DeleteColumnItem(_ref) {
|
|
|
19
18
|
var _ref2 = tableMenuContext !== null && tableMenuContext !== void 0 ? tableMenuContext : {},
|
|
20
19
|
editorView = _ref2.editorView;
|
|
21
20
|
var selectedColumnCount = (_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedColumnCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1;
|
|
22
|
-
var shouldShowShortcut =
|
|
21
|
+
var shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== CELL_MENU.key;
|
|
23
22
|
var _useIntl = useIntl(),
|
|
24
23
|
formatMessage = _useIntl.formatMessage;
|
|
25
24
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api !== null && api !== void 0 ? api : undefined, ['table'], function (states) {
|
|
@@ -5,7 +5,6 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
5
5
|
import { deleteRow, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
6
6
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { DeleteIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
9
8
|
import { clearHoverSelection, closeActiveTableMenu, hoverRows } from '../../../../pm-plugins/commands';
|
|
10
9
|
import { deleteRowsWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
11
10
|
import { getSelectedRowIndexes } from '../../../../pm-plugins/utils/selection';
|
|
@@ -26,7 +25,7 @@ export var DeleteRowItem = function DeleteRowItem(props) {
|
|
|
26
25
|
}),
|
|
27
26
|
isHeaderRowRequired = _useSharedPluginState.isHeaderRowRequired;
|
|
28
27
|
var selectedRowCount = (_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedRowCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1;
|
|
29
|
-
var shouldShowShortcut =
|
|
28
|
+
var shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== CELL_MENU.key;
|
|
30
29
|
var _useIntl = useIntl(),
|
|
31
30
|
formatMessage = _useIntl.formatMessage;
|
|
32
31
|
var handleMouseEnter = function handleMouseEnter() {
|
|
@@ -4,7 +4,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { CrossIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
7
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
8
7
|
import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
|
|
9
8
|
import { emptyMultipleCellsWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
|
|
10
9
|
import { getPluginState } from '../../../../pm-plugins/plugin-factory';
|
|
@@ -19,7 +18,7 @@ export var ClearCellsItem = function ClearCellsItem(_ref) {
|
|
|
19
18
|
var _useIntl = useIntl(),
|
|
20
19
|
formatMessage = _useIntl.formatMessage;
|
|
21
20
|
var selectedCellCount = Math.max((_tableMenuContext$sel = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedColumnCount) !== null && _tableMenuContext$sel !== void 0 ? _tableMenuContext$sel : 1, (_tableMenuContext$sel2 = tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.selectedRowCount) !== null && _tableMenuContext$sel2 !== void 0 ? _tableMenuContext$sel2 : 1);
|
|
22
|
-
var shouldShowShortcut =
|
|
21
|
+
var shouldShowShortcut = (tableMenuContext === null || tableMenuContext === void 0 ? void 0 : tableMenuContext.surface.key) !== CELL_MENU.key || selectedCellCount > 1;
|
|
23
22
|
var handleClick = function handleClick() {
|
|
24
23
|
var _api$analytics;
|
|
25
24
|
if (!editorView) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "38.0.
|
|
3
|
+
"version": "38.0.3",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^26.0.0",
|
|
30
30
|
"@atlaskit/editor-plugin-content-insertion": "^26.0.0",
|
|
31
31
|
"@atlaskit/editor-plugin-editor-viewmode": "^28.0.0",
|
|
32
|
-
"@atlaskit/editor-plugin-extension": "29.0.
|
|
32
|
+
"@atlaskit/editor-plugin-extension": "29.0.2",
|
|
33
33
|
"@atlaskit/editor-plugin-guideline": "^26.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-interaction": "^40.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-limited-mode": "^23.0.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/editor-plugin-user-intent": "^24.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-width": "^27.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
42
|
-
"@atlaskit/editor-shared-styles": "^4.
|
|
42
|
+
"@atlaskit/editor-shared-styles": "^4.4.0",
|
|
43
43
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
44
44
|
"@atlaskit/editor-toolbar": "^2.8.0",
|
|
45
45
|
"@atlaskit/editor-ui-control-model": "^2.10.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
54
54
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^3.0.0",
|
|
55
55
|
"@atlaskit/primitives": "^22.5.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^229.0.0",
|
|
57
57
|
"@atlaskit/toggle": "^17.3.0",
|
|
58
58
|
"@atlaskit/tokens": "^20.4.0",
|
|
59
59
|
"@atlaskit/tooltip": "^24.4.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"uuid": "^11.1.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@atlaskit/editor-common": "^130.
|
|
71
|
+
"@atlaskit/editor-common": "^130.3.0",
|
|
72
72
|
"react": "^18.2.0 || ^19.2.0",
|
|
73
73
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
74
74
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|