@atlaskit/editor-plugin-table 5.3.22 → 5.3.24
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 +12 -0
- package/dist/cjs/plugins/table/nodeviews/TableRow.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingDragMenu/DragMenu.js +24 -6
- package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -1
- package/dist/es2019/plugins/table/nodeviews/TableRow.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingDragMenu/DragMenu.js +18 -6
- package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -1
- package/dist/esm/plugins/table/nodeviews/TableRow.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingDragMenu/DragMenu.js +23 -6
- package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js +1 -1
- package/package.json +3 -3
- package/src/__tests__/unit/analytics.ts +2 -1
- package/src/__tests__/unit/collab.ts +2 -1
- package/src/__tests__/unit/commands/go-to-next-cell.ts +1 -0
- package/src/__tests__/unit/commands/insert.ts +1 -0
- package/src/__tests__/unit/commands/misc.ts +1 -0
- package/src/__tests__/unit/commands/sort.ts +2 -1
- package/src/__tests__/unit/commands.ts +1 -0
- package/src/__tests__/unit/copy-paste.ts +2 -1
- package/src/__tests__/unit/event-handlers/index.ts +2 -1
- package/src/__tests__/unit/event-handlers.ts +2 -1
- package/src/__tests__/unit/fix-tables.ts +2 -1
- package/src/__tests__/unit/get-toolbar-config.ts +1 -0
- package/src/__tests__/unit/handlers.ts +2 -1
- package/src/__tests__/unit/hover-selection.ts +2 -1
- package/src/__tests__/unit/index.ts +2 -1
- package/src/__tests__/unit/layout.ts +2 -1
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +1 -1
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +1 -1
- package/src/__tests__/unit/nodeviews/cell.ts +2 -1
- package/src/__tests__/unit/nodeviews/table.ts +1 -0
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +1 -0
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +1 -0
- package/src/__tests__/unit/pm-plugins/main.ts +1 -0
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -1
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +1 -0
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +1 -0
- package/src/__tests__/unit/pm-plugins/table-width.ts +2 -1
- package/src/__tests__/unit/sort-column.ts +2 -1
- package/src/__tests__/unit/toolbar.ts +1 -0
- package/src/__tests__/unit/transforms/delete-columns.ts +2 -1
- package/src/__tests__/unit/transforms/delete-rows.ts +2 -1
- package/src/__tests__/unit/transforms/merging.ts +2 -1
- package/src/__tests__/unit/ui/ContextualMenu.tsx +2 -1
- package/src/__tests__/unit/ui/CornerControls.tsx +2 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +2 -1
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +2 -1
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +1 -1
- package/src/__tests__/unit/ui/FloatingDragMenu.tsx +195 -0
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +1 -1
- package/src/__tests__/unit/ui/NumberColumn.tsx +2 -1
- package/src/__tests__/unit/ui/RowControls.tsx +2 -1
- package/src/__tests__/unit/ui/RowDragControls.tsx +2 -1
- package/src/__tests__/unit/ui/TableFloatingColumnControls.tsx +2 -1
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +2 -1
- package/src/__tests__/unit/undo-redo.ts +1 -0
- package/src/__tests__/unit/utils/collapse.ts +1 -0
- package/src/__tests__/unit/utils/nodes.ts +2 -1
- package/src/__tests__/unit/utils/row-controls.ts +2 -1
- package/src/__tests__/unit/utils.ts +1 -0
- package/src/plugins/table/nodeviews/TableRow.ts +1 -1
- package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +1 -1
- package/src/plugins/table/pm-plugins/drag-and-drop/utils/monitor.ts +1 -1
- package/src/plugins/table/pm-plugins/keymap.ts +4 -4
- package/src/plugins/table/ui/FloatingDragMenu/DragMenu.tsx +33 -7
- package/src/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.3.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 5.3.23
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#42746](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42746) [`ea352517252`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea352517252) - Update editor dropdown menu component to support section behind platform.editor.menu.group-items FF
|
|
14
|
+
|
|
3
15
|
## 5.3.22
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -16,8 +16,8 @@ var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
|
16
16
|
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
17
17
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
18
18
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
19
|
-
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
|
|
20
19
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
20
|
+
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
|
|
21
21
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
22
22
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
23
23
|
var _commands = require("../pm-plugins/sticky-headers/commands");
|
|
@@ -9,8 +9,8 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
10
10
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
11
11
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
12
|
-
var _pragmaticDragAndDropReactBeautifulDndAutoscroll = require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll");
|
|
13
12
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
13
|
+
var _pragmaticDragAndDropReactBeautifulDndAutoscroll = require("@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll");
|
|
14
14
|
var _mergedCells = require("../../utils/merged-cells");
|
|
15
15
|
var _pluginFactory = require("../plugin-factory");
|
|
16
16
|
var _actions = require("./actions");
|
|
@@ -10,8 +10,8 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
10
10
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
11
11
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
12
12
|
var _commands2 = require("../commands");
|
|
13
|
-
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
14
13
|
var _insert = require("../commands/insert");
|
|
14
|
+
var _commandsWithAnalytics = require("../commands-with-analytics");
|
|
15
15
|
var _analytics2 = require("../utils/analytics");
|
|
16
16
|
var createTableWithAnalytics = function createTableWithAnalytics(editorAnalyticsAPI) {
|
|
17
17
|
return (0, _analytics2.withEditorAnalyticsAPI)({
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.DragMenu = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
7
9
|
var _react = require("@emotion/react");
|
|
8
10
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
9
11
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
@@ -16,11 +18,20 @@ var _dragMenu = require("../../utils/drag-menu");
|
|
|
16
18
|
var _consts = require("../consts");
|
|
17
19
|
/** @jsx jsx */
|
|
18
20
|
|
|
21
|
+
var groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down'], ['sort_column_asc', 'sort_column_desc']];
|
|
19
22
|
var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig) {
|
|
20
|
-
var
|
|
23
|
+
var menuItemsArr = (0, _toConsumableArray2.default)(Array(groupedDragMenuConfig.length)).map(function () {
|
|
24
|
+
return [];
|
|
25
|
+
});
|
|
21
26
|
var menuCallback = {};
|
|
22
27
|
dragMenuConfig.forEach(function (item) {
|
|
23
|
-
|
|
28
|
+
var menuGroupIndex = groupedDragMenuConfig.findIndex(function (group) {
|
|
29
|
+
return group.includes(item.id);
|
|
30
|
+
});
|
|
31
|
+
if (menuGroupIndex === -1) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
menuItemsArr[menuGroupIndex].push({
|
|
24
35
|
key: item.id,
|
|
25
36
|
content: item.title,
|
|
26
37
|
value: {
|
|
@@ -41,6 +52,12 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig) {
|
|
|
41
52
|
});
|
|
42
53
|
item.onClick && (menuCallback[item.id] = item.onClick);
|
|
43
54
|
});
|
|
55
|
+
var menuItems = menuItemsArr.reduce(function (acc, curr) {
|
|
56
|
+
(curr === null || curr === void 0 ? void 0 : curr.length) > 0 && acc.push({
|
|
57
|
+
items: curr
|
|
58
|
+
});
|
|
59
|
+
return acc;
|
|
60
|
+
}, []);
|
|
44
61
|
return {
|
|
45
62
|
menuItems: menuItems,
|
|
46
63
|
menuCallback: menuCallback
|
|
@@ -104,15 +121,16 @@ var DragMenu = exports.DragMenu = function DragMenu(_ref) {
|
|
|
104
121
|
type: _uiMenu.ArrowKeyNavigationType.MENU,
|
|
105
122
|
disableArrowKeyNavigation: true
|
|
106
123
|
},
|
|
107
|
-
items:
|
|
108
|
-
items: menuItems
|
|
109
|
-
}],
|
|
124
|
+
items: menuItems,
|
|
110
125
|
isOpen: isOpen,
|
|
111
126
|
onOpenChange: closeMenu,
|
|
112
127
|
onItemActivated: handleMenuItemActivated,
|
|
113
128
|
onMouseEnter: handleItemMouseEnter,
|
|
114
129
|
onMouseLeave: handleItemMouseLeave,
|
|
115
130
|
fitWidth: _consts.dragMenuDropdownWidth,
|
|
116
|
-
boundariesElement: boundariesElement
|
|
131
|
+
boundariesElement: boundariesElement,
|
|
132
|
+
section: {
|
|
133
|
+
hasSeparator: true
|
|
134
|
+
}
|
|
117
135
|
});
|
|
118
136
|
};
|
package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js
CHANGED
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ColumnDropTarget = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
|
|
10
9
|
var _element = require("@atlaskit/pragmatic-drag-and-drop/adapter/element");
|
|
10
|
+
var _closestEdge = require("@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge");
|
|
11
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
13
|
var ColumnDropTarget = exports.ColumnDropTarget = function ColumnDropTarget(_ref) {
|
|
@@ -3,8 +3,8 @@ import debounce from 'lodash/debounce';
|
|
|
3
3
|
import throttle from 'lodash/throttle';
|
|
4
4
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
6
|
-
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
7
6
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
7
|
+
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
8
8
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
9
9
|
import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
|
|
10
10
|
import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import { getCellsInRow } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
|
|
5
4
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
5
|
+
import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
|
|
6
6
|
import { hasMergedCellsInColumn, hasMergedCellsInRow } from '../../utils/merged-cells';
|
|
7
7
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
8
8
|
import { DragAndDropActionType } from './actions';
|
|
@@ -3,8 +3,8 @@ import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, backspace,
|
|
|
3
3
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
4
4
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
5
|
import { createTable, goToNextCell, moveCursorBackward, triggerUnlessTableHeader } from '../commands';
|
|
6
|
-
import { addRowAroundSelection, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
7
6
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand } from '../commands/insert';
|
|
7
|
+
import { addRowAroundSelection, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
8
8
|
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
9
9
|
const createTableWithAnalytics = editorAnalyticsAPI => withEditorAnalyticsAPI({
|
|
10
10
|
action: ACTION.INSERTED,
|
|
@@ -9,11 +9,16 @@ import { toggleDragMenu } from '../../pm-plugins/drag-and-drop/commands';
|
|
|
9
9
|
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
|
|
10
10
|
import { getDragMenuConfig } from '../../utils/drag-menu';
|
|
11
11
|
import { dragMenuDropdownWidth } from '../consts';
|
|
12
|
+
const groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down'], ['sort_column_asc', 'sort_column_desc']];
|
|
12
13
|
const convertToDropdownItems = dragMenuConfig => {
|
|
13
|
-
let
|
|
14
|
+
let menuItemsArr = [...Array(groupedDragMenuConfig.length)].map(() => []);
|
|
14
15
|
let menuCallback = {};
|
|
15
16
|
dragMenuConfig.forEach(item => {
|
|
16
|
-
|
|
17
|
+
const menuGroupIndex = groupedDragMenuConfig.findIndex(group => group.includes(item.id));
|
|
18
|
+
if (menuGroupIndex === -1) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
menuItemsArr[menuGroupIndex].push({
|
|
17
22
|
key: item.id,
|
|
18
23
|
content: item.title,
|
|
19
24
|
value: {
|
|
@@ -34,6 +39,12 @@ const convertToDropdownItems = dragMenuConfig => {
|
|
|
34
39
|
});
|
|
35
40
|
item.onClick && (menuCallback[item.id] = item.onClick);
|
|
36
41
|
});
|
|
42
|
+
const menuItems = menuItemsArr.reduce((acc, curr) => {
|
|
43
|
+
(curr === null || curr === void 0 ? void 0 : curr.length) > 0 && acc.push({
|
|
44
|
+
items: curr
|
|
45
|
+
});
|
|
46
|
+
return acc;
|
|
47
|
+
}, []);
|
|
37
48
|
return {
|
|
38
49
|
menuItems,
|
|
39
50
|
menuCallback
|
|
@@ -107,15 +118,16 @@ export const DragMenu = ({
|
|
|
107
118
|
type: ArrowKeyNavigationType.MENU,
|
|
108
119
|
disableArrowKeyNavigation: true
|
|
109
120
|
},
|
|
110
|
-
items:
|
|
111
|
-
items: menuItems
|
|
112
|
-
}],
|
|
121
|
+
items: menuItems,
|
|
113
122
|
isOpen: isOpen,
|
|
114
123
|
onOpenChange: closeMenu,
|
|
115
124
|
onItemActivated: handleMenuItemActivated,
|
|
116
125
|
onMouseEnter: handleItemMouseEnter,
|
|
117
126
|
onMouseLeave: handleItemMouseLeave,
|
|
118
127
|
fitWidth: dragMenuDropdownWidth,
|
|
119
|
-
boundariesElement: boundariesElement
|
|
128
|
+
boundariesElement: boundariesElement,
|
|
129
|
+
section: {
|
|
130
|
+
hasSeparator: true
|
|
131
|
+
}
|
|
120
132
|
});
|
|
121
133
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
3
2
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
3
|
+
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
4
4
|
export const ColumnDropTarget = ({
|
|
5
5
|
index,
|
|
6
6
|
localId,
|
|
@@ -11,8 +11,8 @@ import debounce from 'lodash/debounce';
|
|
|
11
11
|
import throttle from 'lodash/throttle';
|
|
12
12
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
14
|
-
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
15
14
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
15
|
+
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
16
16
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
17
17
|
import { pluginKey as tablePluginKey } from '../pm-plugins/plugin-key';
|
|
18
18
|
import { updateStickyState } from '../pm-plugins/sticky-headers/commands';
|
|
@@ -2,8 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
import { getCellsInRow } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
|
|
6
5
|
import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
6
|
+
import { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';
|
|
7
7
|
import { hasMergedCellsInColumn, hasMergedCellsInRow } from '../../utils/merged-cells';
|
|
8
8
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
9
9
|
import { DragAndDropActionType } from './actions';
|
|
@@ -3,8 +3,8 @@ import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, backspace,
|
|
|
3
3
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
4
4
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
5
|
import { createTable, goToNextCell, moveCursorBackward, triggerUnlessTableHeader } from '../commands';
|
|
6
|
-
import { addRowAroundSelection, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
7
6
|
import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand } from '../commands/insert';
|
|
7
|
+
import { addRowAroundSelection, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
|
|
8
8
|
import { withEditorAnalyticsAPI } from '../utils/analytics';
|
|
9
9
|
var createTableWithAnalytics = function createTableWithAnalytics(editorAnalyticsAPI) {
|
|
10
10
|
return withEditorAnalyticsAPI({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
import { jsx } from '@emotion/react';
|
|
3
4
|
import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -9,11 +10,20 @@ import { toggleDragMenu } from '../../pm-plugins/drag-and-drop/commands';
|
|
|
9
10
|
import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
|
|
10
11
|
import { getDragMenuConfig } from '../../utils/drag-menu';
|
|
11
12
|
import { dragMenuDropdownWidth } from '../consts';
|
|
13
|
+
var groupedDragMenuConfig = [['add_row_above', 'add_row_below', 'add_column_left', 'add_column_right', 'distribute_columns', 'clear_cells', 'delete_row', 'delete_column'], ['move_column_left', 'move_column_right', 'move_row_up', 'move_row_down'], ['sort_column_asc', 'sort_column_desc']];
|
|
12
14
|
var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig) {
|
|
13
|
-
var
|
|
15
|
+
var menuItemsArr = _toConsumableArray(Array(groupedDragMenuConfig.length)).map(function () {
|
|
16
|
+
return [];
|
|
17
|
+
});
|
|
14
18
|
var menuCallback = {};
|
|
15
19
|
dragMenuConfig.forEach(function (item) {
|
|
16
|
-
|
|
20
|
+
var menuGroupIndex = groupedDragMenuConfig.findIndex(function (group) {
|
|
21
|
+
return group.includes(item.id);
|
|
22
|
+
});
|
|
23
|
+
if (menuGroupIndex === -1) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
menuItemsArr[menuGroupIndex].push({
|
|
17
27
|
key: item.id,
|
|
18
28
|
content: item.title,
|
|
19
29
|
value: {
|
|
@@ -34,6 +44,12 @@ var convertToDropdownItems = function convertToDropdownItems(dragMenuConfig) {
|
|
|
34
44
|
});
|
|
35
45
|
item.onClick && (menuCallback[item.id] = item.onClick);
|
|
36
46
|
});
|
|
47
|
+
var menuItems = menuItemsArr.reduce(function (acc, curr) {
|
|
48
|
+
(curr === null || curr === void 0 ? void 0 : curr.length) > 0 && acc.push({
|
|
49
|
+
items: curr
|
|
50
|
+
});
|
|
51
|
+
return acc;
|
|
52
|
+
}, []);
|
|
37
53
|
return {
|
|
38
54
|
menuItems: menuItems,
|
|
39
55
|
menuCallback: menuCallback
|
|
@@ -97,15 +113,16 @@ export var DragMenu = function DragMenu(_ref) {
|
|
|
97
113
|
type: ArrowKeyNavigationType.MENU,
|
|
98
114
|
disableArrowKeyNavigation: true
|
|
99
115
|
},
|
|
100
|
-
items:
|
|
101
|
-
items: menuItems
|
|
102
|
-
}],
|
|
116
|
+
items: menuItems,
|
|
103
117
|
isOpen: isOpen,
|
|
104
118
|
onOpenChange: closeMenu,
|
|
105
119
|
onItemActivated: handleMenuItemActivated,
|
|
106
120
|
onMouseEnter: handleItemMouseEnter,
|
|
107
121
|
onMouseLeave: handleItemMouseLeave,
|
|
108
122
|
fitWidth: dragMenuDropdownWidth,
|
|
109
|
-
boundariesElement: boundariesElement
|
|
123
|
+
boundariesElement: boundariesElement,
|
|
124
|
+
section: {
|
|
125
|
+
hasSeparator: true
|
|
126
|
+
}
|
|
110
127
|
});
|
|
111
128
|
};
|
package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
3
2
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
|
|
3
|
+
import { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
|
|
4
4
|
export var ColumnDropTarget = function ColumnDropTarget(_ref) {
|
|
5
5
|
var index = _ref.index,
|
|
6
6
|
localId = _ref.localId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.24",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
31
31
|
"@atlaskit/custom-steps": "^0.0.2",
|
|
32
32
|
"@atlaskit/editor-common": "^76.18.0",
|
|
33
|
-
"@atlaskit/editor-palette": "1.5.
|
|
33
|
+
"@atlaskit/editor-palette": "1.5.2",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
35
35
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-guideline": "^0.5.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/pragmatic-drag-and-drop": "^0.24.0",
|
|
45
45
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^0.12.0",
|
|
46
46
|
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll": "^0.6.4",
|
|
47
|
-
"@atlaskit/primitives": "^1.
|
|
47
|
+
"@atlaskit/primitives": "^1.10.0",
|
|
48
48
|
"@atlaskit/theme": "^12.6.0",
|
|
49
49
|
"@atlaskit/tokens": "^1.28.0",
|
|
50
50
|
"@atlaskit/tooltip": "^17.8.0",
|
|
@@ -9,6 +9,7 @@ import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
|
9
9
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
10
10
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
11
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
12
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
12
13
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
13
14
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
14
15
|
import {
|
|
@@ -30,7 +31,6 @@ import {
|
|
|
30
31
|
import sendKeyToPm from '@atlaskit/editor-test-helpers/send-key-to-pm';
|
|
31
32
|
import { B50 } from '@atlaskit/theme/colors';
|
|
32
33
|
|
|
33
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
34
34
|
import {
|
|
35
35
|
deleteColumnsWithAnalytics,
|
|
36
36
|
deleteRowsWithAnalytics,
|
|
@@ -51,6 +51,7 @@ import { handleCut } from '../../plugins/table/event-handlers';
|
|
|
51
51
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
52
52
|
import { replaceSelectedTable } from '../../plugins/table/transforms';
|
|
53
53
|
import type { PluginConfig } from '../../plugins/table/types';
|
|
54
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
54
55
|
|
|
55
56
|
const defaultTableDoc = doc(
|
|
56
57
|
table()(
|
|
@@ -7,6 +7,7 @@ import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
|
7
7
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
8
8
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
9
|
import { removeColumnAt } from '@atlaskit/editor-tables/utils';
|
|
10
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
11
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
11
12
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
12
13
|
import {
|
|
@@ -23,10 +24,10 @@ import {
|
|
|
23
24
|
tr,
|
|
24
25
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
25
26
|
|
|
26
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
27
27
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
28
28
|
import { setResizeHandlePos } from '../../plugins/table/pm-plugins/table-resizing/commands';
|
|
29
29
|
import type { PluginConfig } from '../../plugins/table/types';
|
|
30
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
30
31
|
|
|
31
32
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
32
33
|
|
|
@@ -8,6 +8,7 @@ import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
|
8
8
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
9
9
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
10
|
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
11
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
11
12
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
12
13
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
13
14
|
import {
|
|
@@ -10,6 +10,7 @@ import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
|
10
10
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
11
11
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
12
12
|
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
13
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
13
14
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
14
15
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
15
16
|
import {
|
|
@@ -9,6 +9,7 @@ import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
|
9
9
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
10
|
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
11
11
|
import { isColumnSelected } from '@atlaskit/editor-tables/utils';
|
|
12
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
12
13
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
13
14
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
14
15
|
import {
|
|
@@ -7,6 +7,7 @@ import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
|
7
7
|
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
8
8
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
9
9
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
11
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
11
12
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
12
13
|
import {
|
|
@@ -23,8 +24,8 @@ import {
|
|
|
23
24
|
tr,
|
|
24
25
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
25
26
|
|
|
26
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
27
27
|
import { sortByColumn } from '../../../plugins/table/commands/sort';
|
|
28
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
28
29
|
|
|
29
30
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
30
31
|
|
|
@@ -17,6 +17,7 @@ import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
|
17
17
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
18
18
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
19
19
|
import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
20
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
20
21
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
21
22
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
22
23
|
import {
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
selectColumn,
|
|
29
29
|
selectTable,
|
|
30
30
|
} from '@atlaskit/editor-tables/utils';
|
|
31
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
31
32
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
32
33
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
33
34
|
import {
|
|
@@ -52,7 +53,6 @@ import {
|
|
|
52
53
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
53
54
|
import defaultSchema from '@atlaskit/editor-test-helpers/schema';
|
|
54
55
|
|
|
55
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
56
56
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
57
57
|
import type { PluginConfig, TablePluginState } from '../../plugins/table/types';
|
|
58
58
|
import {
|
|
@@ -62,6 +62,7 @@ import {
|
|
|
62
62
|
transformSliceToRemoveOpenTable,
|
|
63
63
|
unwrapContentFromTable,
|
|
64
64
|
} from '../../plugins/table/utils/paste';
|
|
65
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
65
66
|
|
|
66
67
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
67
68
|
const array = (...args: any): Node[] => args.map((i: any) => i(defaultSchema));
|
|
@@ -7,6 +7,7 @@ import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
|
7
7
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
8
8
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
9
|
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
11
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
11
12
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
12
13
|
import {
|
|
@@ -22,11 +23,11 @@ import {
|
|
|
22
23
|
tr,
|
|
23
24
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
24
25
|
|
|
25
|
-
import tablePlugin from '../../../plugins/table-plugin';
|
|
26
26
|
import { whenTableInFocus } from '../../../plugins/table/event-handlers';
|
|
27
27
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
28
28
|
import { setDragging } from '../../../plugins/table/pm-plugins/table-resizing/commands';
|
|
29
29
|
import type { TablePluginState } from '../../../plugins/table/types';
|
|
30
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
30
31
|
|
|
31
32
|
describe('event-handlers', () => {
|
|
32
33
|
let editor: any;
|
|
@@ -9,6 +9,7 @@ import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
|
9
9
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
10
10
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
11
11
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
12
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
12
13
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
13
14
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
14
15
|
import {
|
|
@@ -27,7 +28,6 @@ import {
|
|
|
27
28
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
28
29
|
import { ffTest } from '@atlassian/feature-flags-test-utils';
|
|
29
30
|
|
|
30
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
31
31
|
import {
|
|
32
32
|
addResizeHandleDecorations,
|
|
33
33
|
showInsertColumnButton,
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
import { getPluginState } from '../../plugins/table/pm-plugins/plugin-factory';
|
|
43
43
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
44
44
|
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
45
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
45
46
|
|
|
46
47
|
describe('table plugin: decorations', () => {
|
|
47
48
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -6,6 +6,7 @@ import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
|
6
6
|
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
7
7
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
8
8
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
9
10
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
10
11
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
11
12
|
import {
|
|
@@ -22,9 +23,9 @@ import {
|
|
|
22
23
|
tr,
|
|
23
24
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
24
25
|
|
|
25
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
26
26
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
27
27
|
import type { PluginConfig } from '../../plugins/table/types';
|
|
28
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
28
29
|
|
|
29
30
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
30
31
|
|
|
@@ -14,6 +14,7 @@ import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
|
14
14
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
15
15
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
16
16
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
17
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
17
18
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
18
19
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
19
20
|
import {
|
|
@@ -7,6 +7,7 @@ import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
|
7
7
|
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
8
8
|
import type { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
9
9
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
10
11
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
11
12
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
12
13
|
import {
|
|
@@ -22,11 +23,11 @@ import {
|
|
|
22
23
|
tr,
|
|
23
24
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
24
25
|
|
|
25
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
26
26
|
import { handleDocOrSelectionChanged } from '../../plugins/table/handlers';
|
|
27
27
|
import { defaultTableSelection } from '../../plugins/table/pm-plugins/default-table-selection';
|
|
28
28
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
29
29
|
import type { TablePluginState } from '../../plugins/table/types';
|
|
30
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
30
31
|
|
|
31
32
|
describe('table action handlers', () => {
|
|
32
33
|
let editor: any;
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
getCellsInRow,
|
|
13
13
|
getCellsInTable,
|
|
14
14
|
} from '@atlaskit/editor-tables/utils';
|
|
15
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
15
16
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
16
17
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
17
18
|
import {
|
|
@@ -30,7 +31,6 @@ import {
|
|
|
30
31
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
31
32
|
import { selectColumns } from '@atlaskit/editor-test-helpers/table';
|
|
32
33
|
|
|
33
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
34
34
|
import {
|
|
35
35
|
clearHoverSelection,
|
|
36
36
|
hoverColumns,
|
|
@@ -41,6 +41,7 @@ import { getDecorations } from '../../plugins/table/pm-plugins/decorations/plugi
|
|
|
41
41
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
42
42
|
import type { TablePluginState } from '../../plugins/table/types';
|
|
43
43
|
import { TableDecorations } from '../../plugins/table/types';
|
|
44
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
44
45
|
|
|
45
46
|
describe('table hover selection plugin', () => {
|
|
46
47
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
selectRow,
|
|
21
21
|
selectTable,
|
|
22
22
|
} from '@atlaskit/editor-tables/utils';
|
|
23
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
23
24
|
import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
24
25
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
25
26
|
import {
|
|
@@ -44,7 +45,6 @@ import {
|
|
|
44
45
|
// eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
|
|
45
46
|
import sendKeyToPm from '@atlaskit/editor-test-helpers/send-key-to-pm';
|
|
46
47
|
|
|
47
|
-
import tablePlugin from '../../plugins/table-plugin';
|
|
48
48
|
import {
|
|
49
49
|
createTable,
|
|
50
50
|
insertColumn,
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
checkIfHeaderRowEnabled,
|
|
62
62
|
checkIfNumberColumnEnabled,
|
|
63
63
|
} from '../../plugins/table/utils';
|
|
64
|
+
import tablePlugin from '../../plugins/table-plugin';
|
|
64
65
|
|
|
65
66
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
66
67
|
|