@atlaskit/editor-plugin-table 4.2.1 → 5.0.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/plugins/table/commands/selection.js +19 -22
  3. package/dist/cjs/plugins/table/index.js +1 -3
  4. package/dist/es2019/plugins/table/commands/selection.js +14 -20
  5. package/dist/es2019/plugins/table/index.js +1 -4
  6. package/dist/esm/plugins/table/commands/selection.js +19 -22
  7. package/dist/esm/plugins/table/index.js +1 -4
  8. package/dist/types/plugins/table/commands/selection.d.ts +4 -4
  9. package/dist/types/plugins/table/index.d.ts +3 -10
  10. package/dist/types/plugins/table/pm-plugins/table-selection-keymap.d.ts +4 -3
  11. package/package.json +3 -2
  12. package/src/__tests__/unit/analytics.ts +1 -1
  13. package/src/__tests__/unit/collab.ts +1 -1
  14. package/src/__tests__/unit/commands/go-to-next-cell.ts +1 -1
  15. package/src/__tests__/unit/commands/insert.ts +1 -1
  16. package/src/__tests__/unit/commands/misc.ts +1 -1
  17. package/src/__tests__/unit/commands/sort.ts +1 -1
  18. package/src/__tests__/unit/commands.ts +1 -1
  19. package/src/__tests__/unit/copy-paste.ts +1 -1
  20. package/src/__tests__/unit/event-handlers/index.ts +1 -1
  21. package/src/__tests__/unit/event-handlers.ts +1 -1
  22. package/src/__tests__/unit/fix-tables.ts +1 -1
  23. package/src/__tests__/unit/get-toolbar-config.ts +1 -1
  24. package/src/__tests__/unit/handlers.ts +1 -2
  25. package/src/__tests__/unit/hover-selection.ts +1 -2
  26. package/src/__tests__/unit/index.ts +1 -2
  27. package/src/__tests__/unit/layout.ts +1 -2
  28. package/src/__tests__/unit/nodeviews/cell.ts +1 -1
  29. package/src/__tests__/unit/nodeviews/table.ts +1 -1
  30. package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +1 -1
  31. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +1 -1
  32. package/src/__tests__/unit/pm-plugins/main.ts +1 -1
  33. package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +1 -1
  34. package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +1 -1
  35. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +1 -1
  36. package/src/__tests__/unit/pm-plugins/table-width.ts +1 -1
  37. package/src/__tests__/unit/sort-column.ts +1 -1
  38. package/src/__tests__/unit/toolbar.ts +1 -1
  39. package/src/__tests__/unit/transforms/delete-columns.ts +1 -1
  40. package/src/__tests__/unit/transforms/delete-rows.ts +1 -1
  41. package/src/__tests__/unit/transforms/merging.ts +1 -1
  42. package/src/__tests__/unit/ui/ContextualMenu.tsx +1 -1
  43. package/src/__tests__/unit/ui/CornerControls.tsx +1 -1
  44. package/src/__tests__/unit/ui/FloatingContextualButton.tsx +1 -1
  45. package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +1 -1
  46. package/src/__tests__/unit/ui/RowControls.tsx +1 -1
  47. package/src/__tests__/unit/ui/TableFloatingControls.tsx +1 -1
  48. package/src/__tests__/unit/undo-redo.ts +1 -1
  49. package/src/__tests__/unit/utils/collapse.ts +1 -1
  50. package/src/__tests__/unit/utils/nodes.ts +1 -1
  51. package/src/__tests__/unit/utils/row-controls.ts +1 -1
  52. package/src/__tests__/unit/utils.ts +1 -1
  53. package/src/plugins/table/commands/selection.ts +101 -33
  54. package/src/plugins/table/index.tsx +3 -17
  55. package/src/plugins/table/pm-plugins/table-selection-keymap.ts +6 -3
  56. package/tsconfig.app.json +3 -0
  57. package/tsconfig.dev.json +3 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#40750](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40750) [`fc19a7b9edd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc19a7b9edd) - [ED-19875] Extraction of Editor Core's Selection Plugin into independent package '@atlaskit/editor-plugin-selection'.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
3
13
  ## 4.2.1
4
14
 
5
15
  ### Patch Changes
@@ -48,15 +48,14 @@ var arrowLeftFromCellSelection = function arrowLeftFromCellSelection(editorSelec
48
48
  return function (selection) {
49
49
  return function (state, dispatch) {
50
50
  if ((0, _utils.isTableSelected)(state.selection) && editorSelectionAPI) {
51
- var _editorSelectionAPI$g = editorSelectionAPI.getSelectionPluginState(state),
52
- selectionRelativeToNode = _editorSelectionAPI$g.selectionRelativeToNode;
53
- if (selectionRelativeToNode === _selection.RelativeSelectionPos.Start) {
51
+ var selectionState = editorSelectionAPI.sharedState.currentState() || {};
52
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === _selection.RelativeSelectionPos.Start) {
54
53
  // we have full table cell selection and want to set gap cursor selection before table
55
54
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
56
- } else if (selectionRelativeToNode === _selection.RelativeSelectionPos.End) {
55
+ } else if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === _selection.RelativeSelectionPos.End) {
57
56
  // we have full table cell selection and want to set selection at end of last cell
58
57
  return setSelectionAtEndOfLastCell(editorSelectionAPI)(selection)(state, dispatch);
59
- } else if (selectionRelativeToNode === undefined) {
58
+ } else if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === undefined) {
60
59
  // we have full table cell selection and want to set selection at start of first cell
61
60
  return setSelectionAtStartOfFirstCell(editorSelectionAPI)(selection, _selection.RelativeSelectionPos.Before)(state, dispatch);
62
61
  }
@@ -69,8 +68,8 @@ var arrowRightFromCellSelection = function arrowRightFromCellSelection(editorSel
69
68
  return function (selection) {
70
69
  return function (state, dispatch) {
71
70
  if ((0, _utils.isTableSelected)(state.selection) && editorSelectionAPI) {
72
- var _editorSelectionAPI$g2 = editorSelectionAPI.getSelectionPluginState(state),
73
- selectionRelativeToNode = _editorSelectionAPI$g2.selectionRelativeToNode;
71
+ var _ref = editorSelectionAPI.sharedState.currentState() || {},
72
+ selectionRelativeToNode = _ref.selectionRelativeToNode;
74
73
  if (selectionRelativeToNode === _selection.RelativeSelectionPos.Start) {
75
74
  // we have full table cell selection and want to set selection at start of first cell
76
75
  return setSelectionAtStartOfFirstCell(editorSelectionAPI)(selection)(state, dispatch);
@@ -102,9 +101,8 @@ var arrowLeftFromGapCursor = function arrowLeftFromGapCursor(editorSelectionAPI)
102
101
  } else if (side === _selection.Side.LEFT) {
103
102
  var table = (0, _utils.findTable)(selection);
104
103
  if (table && isSelectionAtStartOfTable($from, selection) && editorSelectionAPI) {
105
- var _editorSelectionAPI$g3 = editorSelectionAPI.getSelectionPluginState(state),
106
- selectionRelativeToNode = _editorSelectionAPI$g3.selectionRelativeToNode;
107
- if (selectionRelativeToNode === _selection.RelativeSelectionPos.Before) {
104
+ var selectionState = editorSelectionAPI.sharedState.currentState() || {};
105
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === _selection.RelativeSelectionPos.Before) {
108
106
  // we have a gap cursor at start of first table cell and want to set a gap cursor selection before table
109
107
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
110
108
  } else {
@@ -161,9 +159,8 @@ var arrowLeftFromText = function arrowLeftFromText(editorSelectionAPI) {
161
159
  if (isSelectionAtStartOfTable($from, selection) && $from.parent.type.name === 'paragraph' && $from.depth === table.depth + 3 &&
162
160
  // + 3 for: row, cell & paragraph nodes
163
161
  editorSelectionAPI) {
164
- var _editorSelectionAPI$g4 = editorSelectionAPI.getSelectionPluginState(state),
165
- selectionRelativeToNode = _editorSelectionAPI$g4.selectionRelativeToNode;
166
- if (selectionRelativeToNode === _selection.RelativeSelectionPos.Before) {
162
+ var selectionState = editorSelectionAPI.sharedState.currentState() || {};
163
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === _selection.RelativeSelectionPos.Before) {
167
164
  // we have a text selection at start of first table cell, directly inside a top level paragraph,
168
165
  // and want to set gap cursor selection before table
169
166
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
@@ -211,10 +208,10 @@ var arrowRightFromText = function arrowRightFromText(editorSelectionAPI) {
211
208
  * pos in the selection plugin
212
209
  */
213
210
  var selectFullTable = function selectFullTable(editorSelectionAPI) {
214
- return function (_ref) {
215
- var node = _ref.node,
216
- startPos = _ref.startPos,
217
- dir = _ref.dir;
211
+ return function (_ref2) {
212
+ var node = _ref2.node,
213
+ startPos = _ref2.startPos,
214
+ dir = _ref2.dir;
218
215
  return function (state, dispatch) {
219
216
  var doc = state.doc;
220
217
  var _TableMap$get = _tableMap.TableMap.get(node),
@@ -231,7 +228,7 @@ var selectFullTable = function selectFullTable(editorSelectionAPI) {
231
228
  selectionRelativeToNode = _selection.RelativeSelectionPos.Start;
232
229
  }
233
230
  if (editorSelectionAPI) {
234
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
231
+ var tr = editorSelectionAPI.actions.selectNearNode({
235
232
  selectionRelativeToNode: selectionRelativeToNode,
236
233
  selection: fullTableSelection
237
234
  })(state);
@@ -255,7 +252,7 @@ var setSelectionAtStartOfFirstCell = function setSelectionAtStartOfFirstCell(edi
255
252
  // check if first pos should have a gap cursor, otherwise find closest text selection
256
253
  var selectionAtStartOfCell = _selection.GapCursorSelection.valid($firstPosInsideCell) ? new _selection.GapCursorSelection($firstPosInsideCell, _selection.Side.LEFT) : _state.Selection.findFrom($firstPosInsideCell, 1);
257
254
  if (editorSelectionAPI) {
258
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
255
+ var tr = editorSelectionAPI.actions.selectNearNode({
259
256
  selectionRelativeToNode: selectionRelativeToNode,
260
257
  selection: selectionAtStartOfCell
261
258
  })(state);
@@ -280,7 +277,7 @@ var setSelectionAtEndOfLastCell = function setSelectionAtEndOfLastCell(editorSel
280
277
  // check if last pos should have a gap cursor, otherwise find closest text selection
281
278
  var selectionAtEndOfCell = _selection.GapCursorSelection.valid($lastPosInsideCell) ? new _selection.GapCursorSelection($lastPosInsideCell, _selection.Side.RIGHT) : _state.Selection.findFrom($lastPosInsideCell, -1);
282
279
  if (editorSelectionAPI) {
283
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
280
+ var tr = editorSelectionAPI.actions.selectNearNode({
284
281
  selectionRelativeToNode: selectionRelativeToNode,
285
282
  selection: selectionAtEndOfCell
286
283
  })(state);
@@ -302,7 +299,7 @@ var setGapCursorBeforeTable = function setGapCursorBeforeTable(editorSelectionAP
302
299
  if (_selection.GapCursorSelection.valid($beforeTablePos)) {
303
300
  var selectionBeforeTable = new _selection.GapCursorSelection($beforeTablePos, _selection.Side.LEFT);
304
301
  if (editorSelectionAPI) {
305
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
302
+ var tr = editorSelectionAPI.actions.selectNearNode({
306
303
  selectionRelativeToNode: undefined,
307
304
  selection: selectionBeforeTable
308
305
  })(state);
@@ -326,7 +323,7 @@ var setGapCursorAfterTable = function setGapCursorAfterTable(editorSelectionAPI)
326
323
  if (_selection.GapCursorSelection.valid($afterTablePos)) {
327
324
  var selectionAfterTable = new _selection.GapCursorSelection($afterTablePos, _selection.Side.RIGHT);
328
325
  if (editorSelectionAPI) {
329
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
326
+ var tr = editorSelectionAPI.actions.selectNearNode({
330
327
  selectionRelativeToNode: undefined,
331
328
  selection: selectionAfterTable
332
329
  })(state);
@@ -37,8 +37,6 @@ var _FloatingDeleteButton = _interopRequireDefault(require("./ui/FloatingDeleteB
37
37
  var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertButton"));
38
38
  var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
39
39
  var _utils3 = require("./utils");
40
- // TODO: duplicated SelectionPlugin type as it's still in editor-core, doing this avoid
41
- // circular dependencies
42
40
  var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
43
41
  return {};
44
42
  };
@@ -146,7 +144,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
146
144
  }, {
147
145
  name: 'tableSelectionKeymap',
148
146
  plugin: function plugin() {
149
- return (0, _tableSelectionKeymap.tableSelectionKeymapPlugin)(options === null || options === void 0 ? void 0 : options.editorSelectionAPI);
147
+ return (0, _tableSelectionKeymap.tableSelectionKeymapPlugin)(api === null || api === void 0 ? void 0 : api.selection);
150
148
  }
151
149
  }, {
152
150
  name: 'tableEditing',
@@ -36,16 +36,14 @@ export const arrowRightFromTable = editorSelectionAPI => () => (state, dispatch)
36
36
  };
37
37
  const arrowLeftFromCellSelection = editorSelectionAPI => selection => (state, dispatch) => {
38
38
  if (isTableSelected(state.selection) && editorSelectionAPI) {
39
- const {
40
- selectionRelativeToNode
41
- } = editorSelectionAPI.getSelectionPluginState(state);
42
- if (selectionRelativeToNode === RelativeSelectionPos.Start) {
39
+ const selectionState = editorSelectionAPI.sharedState.currentState() || {};
40
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.Start) {
43
41
  // we have full table cell selection and want to set gap cursor selection before table
44
42
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
45
- } else if (selectionRelativeToNode === RelativeSelectionPos.End) {
43
+ } else if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.End) {
46
44
  // we have full table cell selection and want to set selection at end of last cell
47
45
  return setSelectionAtEndOfLastCell(editorSelectionAPI)(selection)(state, dispatch);
48
- } else if (selectionRelativeToNode === undefined) {
46
+ } else if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === undefined) {
49
47
  // we have full table cell selection and want to set selection at start of first cell
50
48
  return setSelectionAtStartOfFirstCell(editorSelectionAPI)(selection, RelativeSelectionPos.Before)(state, dispatch);
51
49
  }
@@ -56,7 +54,7 @@ const arrowRightFromCellSelection = editorSelectionAPI => selection => (state, d
56
54
  if (isTableSelected(state.selection) && editorSelectionAPI) {
57
55
  const {
58
56
  selectionRelativeToNode
59
- } = editorSelectionAPI.getSelectionPluginState(state);
57
+ } = editorSelectionAPI.sharedState.currentState() || {};
60
58
  if (selectionRelativeToNode === RelativeSelectionPos.Start) {
61
59
  // we have full table cell selection and want to set selection at start of first cell
62
60
  return setSelectionAtStartOfFirstCell(editorSelectionAPI)(selection)(state, dispatch);
@@ -88,10 +86,8 @@ const arrowLeftFromGapCursor = editorSelectionAPI => selection => (state, dispat
88
86
  } else if (side === Side.LEFT) {
89
87
  const table = findTable(selection);
90
88
  if (table && isSelectionAtStartOfTable($from, selection) && editorSelectionAPI) {
91
- const {
92
- selectionRelativeToNode
93
- } = editorSelectionAPI.getSelectionPluginState(state);
94
- if (selectionRelativeToNode === RelativeSelectionPos.Before) {
89
+ const selectionState = editorSelectionAPI.sharedState.currentState() || {};
90
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.Before) {
95
91
  // we have a gap cursor at start of first table cell and want to set a gap cursor selection before table
96
92
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
97
93
  } else {
@@ -144,10 +140,8 @@ const arrowLeftFromText = editorSelectionAPI => selection => (state, dispatch) =
144
140
  if (isSelectionAtStartOfTable($from, selection) && $from.parent.type.name === 'paragraph' && $from.depth === table.depth + 3 &&
145
141
  // + 3 for: row, cell & paragraph nodes
146
142
  editorSelectionAPI) {
147
- const {
148
- selectionRelativeToNode
149
- } = editorSelectionAPI.getSelectionPluginState(state);
150
- if (selectionRelativeToNode === RelativeSelectionPos.Before) {
143
+ const selectionState = editorSelectionAPI.sharedState.currentState() || {};
144
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.Before) {
151
145
  // we have a text selection at start of first table cell, directly inside a top level paragraph,
152
146
  // and want to set gap cursor selection before table
153
147
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
@@ -213,7 +207,7 @@ const selectFullTable = editorSelectionAPI => ({
213
207
  selectionRelativeToNode = RelativeSelectionPos.Start;
214
208
  }
215
209
  if (editorSelectionAPI) {
216
- const tr = editorSelectionAPI.setSelectionRelativeToNode({
210
+ const tr = editorSelectionAPI.actions.selectNearNode({
217
211
  selectionRelativeToNode,
218
212
  selection: fullTableSelection
219
213
  })(state);
@@ -235,7 +229,7 @@ const setSelectionAtStartOfFirstCell = editorSelectionAPI => (selection, selecti
235
229
  // check if first pos should have a gap cursor, otherwise find closest text selection
236
230
  const selectionAtStartOfCell = GapCursorSelection.valid($firstPosInsideCell) ? new GapCursorSelection($firstPosInsideCell, Side.LEFT) : Selection.findFrom($firstPosInsideCell, 1);
237
231
  if (editorSelectionAPI) {
238
- const tr = editorSelectionAPI.setSelectionRelativeToNode({
232
+ const tr = editorSelectionAPI.actions.selectNearNode({
239
233
  selectionRelativeToNode,
240
234
  selection: selectionAtStartOfCell
241
235
  })(state);
@@ -258,7 +252,7 @@ const setSelectionAtEndOfLastCell = editorSelectionAPI => (selection, selectionR
258
252
  // check if last pos should have a gap cursor, otherwise find closest text selection
259
253
  const selectionAtEndOfCell = GapCursorSelection.valid($lastPosInsideCell) ? new GapCursorSelection($lastPosInsideCell, Side.RIGHT) : Selection.findFrom($lastPosInsideCell, -1);
260
254
  if (editorSelectionAPI) {
261
- const tr = editorSelectionAPI.setSelectionRelativeToNode({
255
+ const tr = editorSelectionAPI.actions.selectNearNode({
262
256
  selectionRelativeToNode,
263
257
  selection: selectionAtEndOfCell
264
258
  })(state);
@@ -276,7 +270,7 @@ const setGapCursorBeforeTable = editorSelectionAPI => () => (state, dispatch) =>
276
270
  if (GapCursorSelection.valid($beforeTablePos)) {
277
271
  const selectionBeforeTable = new GapCursorSelection($beforeTablePos, Side.LEFT);
278
272
  if (editorSelectionAPI) {
279
- const tr = editorSelectionAPI.setSelectionRelativeToNode({
273
+ const tr = editorSelectionAPI.actions.selectNearNode({
280
274
  selectionRelativeToNode: undefined,
281
275
  selection: selectionBeforeTable
282
276
  })(state);
@@ -296,7 +290,7 @@ const setGapCursorAfterTable = editorSelectionAPI => () => (state, dispatch) =>
296
290
  if (GapCursorSelection.valid($afterTablePos)) {
297
291
  const selectionAfterTable = new GapCursorSelection($afterTablePos, Side.RIGHT);
298
292
  if (editorSelectionAPI) {
299
- const tr = editorSelectionAPI.setSelectionRelativeToNode({
293
+ const tr = editorSelectionAPI.actions.selectNearNode({
300
294
  selectionRelativeToNode: undefined,
301
295
  selection: selectionAfterTable
302
296
  })(state);
@@ -30,9 +30,6 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
30
30
  import FloatingInsertButton from './ui/FloatingInsertButton';
31
31
  import LayoutButton from './ui/LayoutButton';
32
32
  import { isLayoutSupported } from './utils';
33
-
34
- // TODO: duplicated SelectionPlugin type as it's still in editor-core, doing this avoid
35
- // circular dependencies
36
33
  const defaultGetEditorFeatureFlags = () => ({});
37
34
  /**
38
35
  * Table plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
@@ -137,7 +134,7 @@ const tablesPlugin = ({
137
134
  plugin: () => keymapPlugin(defaultGetEditorContainerWidth, editorAnalyticsAPI)
138
135
  }, {
139
136
  name: 'tableSelectionKeymap',
140
- plugin: () => tableSelectionKeymapPlugin(options === null || options === void 0 ? void 0 : options.editorSelectionAPI)
137
+ plugin: () => tableSelectionKeymapPlugin(api === null || api === void 0 ? void 0 : api.selection)
141
138
  }, {
142
139
  name: 'tableEditing',
143
140
  plugin: () => tableEditing({
@@ -42,15 +42,14 @@ var arrowLeftFromCellSelection = function arrowLeftFromCellSelection(editorSelec
42
42
  return function (selection) {
43
43
  return function (state, dispatch) {
44
44
  if (isTableSelected(state.selection) && editorSelectionAPI) {
45
- var _editorSelectionAPI$g = editorSelectionAPI.getSelectionPluginState(state),
46
- selectionRelativeToNode = _editorSelectionAPI$g.selectionRelativeToNode;
47
- if (selectionRelativeToNode === RelativeSelectionPos.Start) {
45
+ var selectionState = editorSelectionAPI.sharedState.currentState() || {};
46
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.Start) {
48
47
  // we have full table cell selection and want to set gap cursor selection before table
49
48
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
50
- } else if (selectionRelativeToNode === RelativeSelectionPos.End) {
49
+ } else if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.End) {
51
50
  // we have full table cell selection and want to set selection at end of last cell
52
51
  return setSelectionAtEndOfLastCell(editorSelectionAPI)(selection)(state, dispatch);
53
- } else if (selectionRelativeToNode === undefined) {
52
+ } else if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === undefined) {
54
53
  // we have full table cell selection and want to set selection at start of first cell
55
54
  return setSelectionAtStartOfFirstCell(editorSelectionAPI)(selection, RelativeSelectionPos.Before)(state, dispatch);
56
55
  }
@@ -63,8 +62,8 @@ var arrowRightFromCellSelection = function arrowRightFromCellSelection(editorSel
63
62
  return function (selection) {
64
63
  return function (state, dispatch) {
65
64
  if (isTableSelected(state.selection) && editorSelectionAPI) {
66
- var _editorSelectionAPI$g2 = editorSelectionAPI.getSelectionPluginState(state),
67
- selectionRelativeToNode = _editorSelectionAPI$g2.selectionRelativeToNode;
65
+ var _ref = editorSelectionAPI.sharedState.currentState() || {},
66
+ selectionRelativeToNode = _ref.selectionRelativeToNode;
68
67
  if (selectionRelativeToNode === RelativeSelectionPos.Start) {
69
68
  // we have full table cell selection and want to set selection at start of first cell
70
69
  return setSelectionAtStartOfFirstCell(editorSelectionAPI)(selection)(state, dispatch);
@@ -96,9 +95,8 @@ var arrowLeftFromGapCursor = function arrowLeftFromGapCursor(editorSelectionAPI)
96
95
  } else if (side === Side.LEFT) {
97
96
  var table = findTable(selection);
98
97
  if (table && isSelectionAtStartOfTable($from, selection) && editorSelectionAPI) {
99
- var _editorSelectionAPI$g3 = editorSelectionAPI.getSelectionPluginState(state),
100
- selectionRelativeToNode = _editorSelectionAPI$g3.selectionRelativeToNode;
101
- if (selectionRelativeToNode === RelativeSelectionPos.Before) {
98
+ var selectionState = editorSelectionAPI.sharedState.currentState() || {};
99
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.Before) {
102
100
  // we have a gap cursor at start of first table cell and want to set a gap cursor selection before table
103
101
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
104
102
  } else {
@@ -155,9 +153,8 @@ var arrowLeftFromText = function arrowLeftFromText(editorSelectionAPI) {
155
153
  if (isSelectionAtStartOfTable($from, selection) && $from.parent.type.name === 'paragraph' && $from.depth === table.depth + 3 &&
156
154
  // + 3 for: row, cell & paragraph nodes
157
155
  editorSelectionAPI) {
158
- var _editorSelectionAPI$g4 = editorSelectionAPI.getSelectionPluginState(state),
159
- selectionRelativeToNode = _editorSelectionAPI$g4.selectionRelativeToNode;
160
- if (selectionRelativeToNode === RelativeSelectionPos.Before) {
156
+ var selectionState = editorSelectionAPI.sharedState.currentState() || {};
157
+ if ((selectionState === null || selectionState === void 0 ? void 0 : selectionState.selectionRelativeToNode) === RelativeSelectionPos.Before) {
161
158
  // we have a text selection at start of first table cell, directly inside a top level paragraph,
162
159
  // and want to set gap cursor selection before table
163
160
  return setGapCursorBeforeTable(editorSelectionAPI)()(state, dispatch);
@@ -205,10 +202,10 @@ var arrowRightFromText = function arrowRightFromText(editorSelectionAPI) {
205
202
  * pos in the selection plugin
206
203
  */
207
204
  var selectFullTable = function selectFullTable(editorSelectionAPI) {
208
- return function (_ref) {
209
- var node = _ref.node,
210
- startPos = _ref.startPos,
211
- dir = _ref.dir;
205
+ return function (_ref2) {
206
+ var node = _ref2.node,
207
+ startPos = _ref2.startPos,
208
+ dir = _ref2.dir;
212
209
  return function (state, dispatch) {
213
210
  var doc = state.doc;
214
211
  var _TableMap$get = TableMap.get(node),
@@ -225,7 +222,7 @@ var selectFullTable = function selectFullTable(editorSelectionAPI) {
225
222
  selectionRelativeToNode = RelativeSelectionPos.Start;
226
223
  }
227
224
  if (editorSelectionAPI) {
228
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
225
+ var tr = editorSelectionAPI.actions.selectNearNode({
229
226
  selectionRelativeToNode: selectionRelativeToNode,
230
227
  selection: fullTableSelection
231
228
  })(state);
@@ -249,7 +246,7 @@ var setSelectionAtStartOfFirstCell = function setSelectionAtStartOfFirstCell(edi
249
246
  // check if first pos should have a gap cursor, otherwise find closest text selection
250
247
  var selectionAtStartOfCell = GapCursorSelection.valid($firstPosInsideCell) ? new GapCursorSelection($firstPosInsideCell, Side.LEFT) : Selection.findFrom($firstPosInsideCell, 1);
251
248
  if (editorSelectionAPI) {
252
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
249
+ var tr = editorSelectionAPI.actions.selectNearNode({
253
250
  selectionRelativeToNode: selectionRelativeToNode,
254
251
  selection: selectionAtStartOfCell
255
252
  })(state);
@@ -274,7 +271,7 @@ var setSelectionAtEndOfLastCell = function setSelectionAtEndOfLastCell(editorSel
274
271
  // check if last pos should have a gap cursor, otherwise find closest text selection
275
272
  var selectionAtEndOfCell = GapCursorSelection.valid($lastPosInsideCell) ? new GapCursorSelection($lastPosInsideCell, Side.RIGHT) : Selection.findFrom($lastPosInsideCell, -1);
276
273
  if (editorSelectionAPI) {
277
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
274
+ var tr = editorSelectionAPI.actions.selectNearNode({
278
275
  selectionRelativeToNode: selectionRelativeToNode,
279
276
  selection: selectionAtEndOfCell
280
277
  })(state);
@@ -296,7 +293,7 @@ var setGapCursorBeforeTable = function setGapCursorBeforeTable(editorSelectionAP
296
293
  if (GapCursorSelection.valid($beforeTablePos)) {
297
294
  var selectionBeforeTable = new GapCursorSelection($beforeTablePos, Side.LEFT);
298
295
  if (editorSelectionAPI) {
299
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
296
+ var tr = editorSelectionAPI.actions.selectNearNode({
300
297
  selectionRelativeToNode: undefined,
301
298
  selection: selectionBeforeTable
302
299
  })(state);
@@ -320,7 +317,7 @@ var setGapCursorAfterTable = function setGapCursorAfterTable(editorSelectionAPI)
320
317
  if (GapCursorSelection.valid($afterTablePos)) {
321
318
  var selectionAfterTable = new GapCursorSelection($afterTablePos, Side.RIGHT);
322
319
  if (editorSelectionAPI) {
323
- var tr = editorSelectionAPI.setSelectionRelativeToNode({
320
+ var tr = editorSelectionAPI.actions.selectNearNode({
324
321
  selectionRelativeToNode: undefined,
325
322
  selection: selectionAfterTable
326
323
  })(state);
@@ -30,9 +30,6 @@ import FloatingDeleteButton from './ui/FloatingDeleteButton';
30
30
  import FloatingInsertButton from './ui/FloatingInsertButton';
31
31
  import LayoutButton from './ui/LayoutButton';
32
32
  import { isLayoutSupported } from './utils';
33
-
34
- // TODO: duplicated SelectionPlugin type as it's still in editor-core, doing this avoid
35
- // circular dependencies
36
33
  var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
37
34
  return {};
38
35
  };
@@ -140,7 +137,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
140
137
  }, {
141
138
  name: 'tableSelectionKeymap',
142
139
  plugin: function plugin() {
143
- return tableSelectionKeymapPlugin(options === null || options === void 0 ? void 0 : options.editorSelectionAPI);
140
+ return tableSelectionKeymapPlugin(api === null || api === void 0 ? void 0 : api.selection);
144
141
  }
145
142
  }, {
146
143
  name: 'tableEditing',
@@ -1,8 +1,8 @@
1
- import { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
2
- import type { Command } from '@atlaskit/editor-common/types';
1
+ import type { Command, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import type tablePlugin from '../index';
3
3
  export declare enum TableSelectionDirection {
4
4
  TopToBottom = "TopToBottom",
5
5
  BottomToTop = "BottomToTop"
6
6
  }
7
- export declare const arrowLeftFromTable: (editorSelectionAPI: EditorSelectionAPI | undefined | null) => () => Command;
8
- export declare const arrowRightFromTable: (editorSelectionAPI: EditorSelectionAPI | undefined | null) => () => Command;
7
+ export declare const arrowLeftFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
8
+ export declare const arrowRightFromTable: (editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined) => () => Command;
@@ -1,9 +1,9 @@
1
1
  import type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
2
- import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
3
- import type { Command, EditorCommand, GetEditorFeatureFlags, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { Command, GetEditorFeatureFlags, NextEditorPlugin } from '@atlaskit/editor-common/types';
4
3
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
4
  import type { ContentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
6
5
  import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
6
+ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
7
7
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
8
8
  import type { PluginConfig } from './types';
9
9
  interface TablePluginOptions {
@@ -14,16 +14,9 @@ interface TablePluginOptions {
14
14
  allowContextualMenu?: boolean;
15
15
  fullWidthEnabled?: boolean;
16
16
  wasFullWidthEnabled?: boolean;
17
- editorSelectionAPI?: EditorSelectionAPI;
18
17
  getEditorFeatureFlags?: GetEditorFeatureFlags;
19
18
  }
20
19
  type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
21
- type SelectionPlugin = NextEditorPlugin<'selection', {
22
- pluginConfiguration: unknown;
23
- commands: {
24
- displayGapCursor: (toggle: boolean) => EditorCommand;
25
- };
26
- }>;
27
20
  export type TablePlugin = NextEditorPlugin<'table', {
28
21
  pluginConfiguration: TablePluginOptions | undefined;
29
22
  actions: {
@@ -34,7 +27,7 @@ export type TablePlugin = NextEditorPlugin<'table', {
34
27
  ContentInsertionPlugin,
35
28
  WidthPlugin,
36
29
  GuidelinePlugin,
37
- OptionalPlugin<SelectionPlugin>
30
+ SelectionPlugin
38
31
  ];
39
32
  }>;
40
33
  /**
@@ -1,4 +1,5 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
3
- export declare function tableSelectionKeymapPlugin(editorSelectionAPI: EditorSelectionAPI | undefined | null): SafePlugin;
1
+ import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type tablePlugin from '../index';
4
+ export declare function tableSelectionKeymapPlugin(editorSelectionAPI: ExtractInjectionAPI<typeof tablePlugin>['selection'] | undefined): SafePlugin;
4
5
  export default tableSelectionKeymapPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "4.2.1",
3
+ "version": "5.0.0",
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
  "dependencies": {
30
30
  "@atlaskit/adf-schema": "^32.0.0",
31
31
  "@atlaskit/custom-steps": "^0.0.2",
32
- "@atlaskit/editor-common": "^76.7.0",
32
+ "@atlaskit/editor-common": "^76.8.0",
33
33
  "@atlaskit/editor-palette": "1.5.1",
34
34
  "@atlaskit/editor-plugin-analytics": "^0.2.0",
35
35
  "@atlaskit/editor-plugin-content-insertion": "^0.1.0",
@@ -61,6 +61,7 @@
61
61
  "@atlaskit/editor-plugin-grid": "^0.3.0",
62
62
  "@atlaskit/editor-plugin-guideline": "^0.5.0",
63
63
  "@atlaskit/editor-plugin-hyperlink": "^0.5.0",
64
+ "@atlaskit/editor-plugin-selection": "^0.1.0",
64
65
  "@atlaskit/editor-plugin-width": "^0.2.0",
65
66
  "@atlaskit/visual-regression": "*",
66
67
  "@atlaskit/webdriver-runner": "*",
@@ -2,11 +2,11 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { DocBuilder } from '@atlaskit/editor-common/types';
4
4
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
5
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
6
5
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
6
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
8
7
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
9
8
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
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
12
  import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
@@ -1,10 +1,10 @@
1
1
  import type { DocBuilder } from '@atlaskit/editor-common/types';
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
3
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
4
3
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
4
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
6
5
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
7
6
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
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
10
  import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
@@ -1,11 +1,11 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { DocBuilder } from '@atlaskit/editor-common/types';
3
3
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
4
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
5
4
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
5
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
7
6
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
8
7
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
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
11
  import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
@@ -3,11 +3,11 @@ import type {
3
3
  GetEditorContainerWidth,
4
4
  } from '@atlaskit/editor-common/types';
5
5
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
6
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
7
6
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
7
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
9
8
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
10
9
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
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
13
  import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
@@ -1,11 +1,11 @@
1
1
  import type { DocBuilder } from '@atlaskit/editor-common/types';
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
3
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
4
3
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
4
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
6
5
  import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
7
6
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
8
7
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
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
11
  import { isColumnSelected } from '@atlaskit/editor-tables/utils';
@@ -1,11 +1,11 @@
1
1
  import { uuid } from '@atlaskit/adf-schema';
2
2
  import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
3
3
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
4
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
5
4
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
5
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
7
6
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
8
7
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
8
+ import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
9
9
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
10
10
  import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
11
11
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
@@ -3,13 +3,13 @@ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
3
3
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  import type { DocBuilder } from '@atlaskit/editor-common/types';
5
5
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
6
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
7
6
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
7
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
9
8
  import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
10
9
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
11
10
  import { gridPlugin } from '@atlaskit/editor-plugin-grid';
12
11
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
12
+ import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
13
13
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
14
14
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
15
15
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
@@ -4,11 +4,11 @@ import { uuid } from '@atlaskit/adf-schema';
4
4
  import { transformSliceToRemoveOpenExpand } from '@atlaskit/editor-common/transforms';
5
5
  import type { DocBuilder } from '@atlaskit/editor-common/types';
6
6
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
7
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
8
7
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
9
8
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
10
9
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
11
10
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
11
+ import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
12
12
  import { widthPlugin } from '@atlaskit/editor-plugin-width';
13
13
  import type {
14
14
  Node as ProsemirrorNode,
@@ -1,10 +1,10 @@
1
1
  import type { DocBuilder } from '@atlaskit/editor-common/types';
2
2
  // eslint-disable-next-line import/no-extraneous-dependencies -- Removed import for fixing circular dependencies
3
- import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
4
3
  import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
4
  import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
6
5
  import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
7
6
  import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
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
10
  import type { LightEditorPlugin } from '@atlaskit/editor-test-helpers/create-prosemirror-editor';