@atlaskit/editor-plugin-table 8.2.1 → 8.3.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 (33) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/cjs/commands/insert.js +97 -3
  3. package/dist/cjs/plugin.js +57 -38
  4. package/dist/cjs/pm-plugins/drag-and-drop/utils/autoscrollers.js +3 -3
  5. package/dist/cjs/pm-plugins/keymap.js +18 -1
  6. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -1
  7. package/dist/es2019/commands/insert.js +91 -2
  8. package/dist/es2019/plugin.js +58 -41
  9. package/dist/es2019/pm-plugins/drag-and-drop/utils/autoscrollers.js +3 -3
  10. package/dist/es2019/pm-plugins/keymap.js +20 -3
  11. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -1
  12. package/dist/esm/commands/insert.js +97 -2
  13. package/dist/esm/plugin.js +58 -39
  14. package/dist/esm/pm-plugins/drag-and-drop/utils/autoscrollers.js +3 -3
  15. package/dist/esm/pm-plugins/keymap.js +20 -3
  16. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -1
  17. package/dist/types/commands/insert.d.ts +41 -1
  18. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -2
  19. package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +2 -4
  20. package/dist/types/ui/TableFloatingControls/index.d.ts +1 -2
  21. package/dist/types/utils/drag-menu.d.ts +3 -3
  22. package/dist/types-ts4.5/commands/insert.d.ts +41 -1
  23. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -2
  24. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +2 -4
  25. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -2
  26. package/dist/types-ts4.5/utils/drag-menu.d.ts +3 -3
  27. package/package.json +8 -5
  28. package/src/commands/insert.ts +119 -3
  29. package/src/plugin.tsx +78 -54
  30. package/src/pm-plugins/drag-and-drop/utils/autoscrollers.ts +3 -3
  31. package/src/pm-plugins/keymap.ts +40 -10
  32. package/src/ui/FloatingDragMenu/DragMenu.tsx +2 -1
  33. package/src/utils/drag-menu.ts +3 -3
@@ -30,17 +30,17 @@ export const autoScrollerFactory = ({
30
30
  return localId === (node === null || node === void 0 ? void 0 : node.attrs.localId) && type === 'table-column';
31
31
  },
32
32
  getOverflow: () => ({
33
- fromTopEdge: {
33
+ forTopEdge: {
34
34
  top: dropTargetExtendedWidth,
35
35
  right: dropTargetExtendedWidth,
36
36
  left: dropTargetExtendedWidth
37
37
  },
38
- fromRightEdge: {
38
+ forRightEdge: {
39
39
  right: dropTargetExtendedWidth,
40
40
  top: dropTargetExtendedWidth,
41
41
  bottom: dropTargetExtendedWidth
42
42
  },
43
- fromLeftEdge: {
43
+ forLeftEdge: {
44
44
  top: dropTargetExtendedWidth,
45
45
  left: dropTargetExtendedWidth,
46
46
  bottom: dropTargetExtendedWidth
@@ -1,11 +1,13 @@
1
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { addColumnAfter, addColumnAfterVO, addColumnBefore, addColumnBeforeVO, addRowAfter, addRowAfterVO, addRowBefore, addRowBeforeVO, backspace, bindKeymapWithCommand, decreaseMediaSize, deleteColumn, deleteRow, escape, focusToContextMenuTrigger, increaseMediaSize, moveColumnLeft, moveColumnRight, moveLeft, moveRight, moveRowDown, moveRowUp, nextCell, previousCell, startColumnResizing, toggleTable } from '@atlaskit/editor-common/keymaps';
3
+ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
3
4
  import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
4
5
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
5
7
  import { goToNextCell, moveCursorBackward, setFocusToCellMenu } from '../commands';
6
8
  import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
7
9
  import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from '../commands/column-resize';
8
- import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable } from '../commands/insert';
10
+ import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable, insertTableWithNestingSupport } from '../commands/insert';
9
11
  import { moveSourceWithAnalyticsViaShortcut } from '../pm-plugins/drag-and-drop/commands-with-analytics';
10
12
  export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled = false, isTableAlignmentEnabled = false, isFullWidthEnabled, pluginInjectionApi, getIntl, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
11
13
  var _pluginInjectionApi$a;
@@ -13,7 +15,22 @@ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProvide
13
15
  const ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
14
16
  bindKeymapWithCommand(nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
15
17
  bindKeymapWithCommand(previousCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
16
- bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
18
+ bindKeymapWithCommand(toggleTable.common, fg('platform_editor_use_nested_table_pm_nodes') ? editorCommandToPMCommand(insertTableWithNestingSupport({
19
+ isTableScalingEnabled,
20
+ isTableAlignmentEnabled,
21
+ isFullWidthModeEnabled: !!isFullWidthEnabled,
22
+ isCommentEditor: isCommentEditor,
23
+ isChromelessEditor: isChromelessEditor,
24
+ isTableResizingEnabled
25
+ }, api, {
26
+ action: ACTION.INSERTED,
27
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
28
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
29
+ attributes: {
30
+ inputMethod: INPUT_METHOD.SHORTCUT
31
+ },
32
+ eventType: EVENT_TYPE.TRACK
33
+ })) : createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
17
34
  bindKeymapWithCommand(backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
18
35
  bindKeymapWithCommand(backspace.common, moveCursorBackward, list);
19
36
 
@@ -21,6 +21,7 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
21
21
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
22
22
  import EditorBackgroundColorIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
23
23
  import PaintBucketIcon from '@atlaskit/icon/core/paint-bucket';
24
+ import { fg } from '@atlaskit/platform-feature-flags';
24
25
  import { Box, xcss } from '@atlaskit/primitives';
25
26
  import Toggle from '@atlaskit/toggle';
26
27
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
@@ -505,7 +506,7 @@ const DragMenu = /*#__PURE__*/React.memo(({
505
506
  fitHeight: fitHeight,
506
507
  fitWidth: fitWidth,
507
508
  direction: direction,
508
- mountPoint: mountPoint,
509
+ mountPoint: fg('platform_editor_table_drag_menu_mount_point_fix') ? undefined : mountPoint,
509
510
  boundariesElement: boundariesElement,
510
511
  scrollableElement: scrollableElement
511
512
  });
@@ -1,10 +1,16 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  // #region Imports
2
5
  import { AddColumnStep } from '@atlaskit/custom-steps';
3
6
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics';
4
- import { Selection } from '@atlaskit/editor-prosemirror/state';
5
- import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
7
+ import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
8
+ import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
9
+ import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
6
10
  import { TableMap } from '@atlaskit/editor-tables/table-map';
7
11
  import { addColumnAt as addColumnAtPMUtils, addRowAt, findTable, selectedRect } from '@atlaskit/editor-tables/utils';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
14
  import { updateRowOrColumnMovedTransform } from '../pm-plugins/analytics/commands';
9
15
  import { META_KEYS } from '../pm-plugins/table-analytics';
10
16
  import { rescaleColumns } from '../transforms/column-width';
@@ -141,6 +147,12 @@ export var insertRow = function insertRow(row, moveCursorToTheNewRow) {
141
147
  return true;
142
148
  };
143
149
  };
150
+
151
+ /**
152
+ * @private
153
+ * @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
154
+ * (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
155
+ */
144
156
  export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
145
157
  return function (state, dispatch) {
146
158
  var table = createTableWithWidth({
@@ -169,6 +181,12 @@ export var createTable = function createTable(isTableScalingEnabled, isTableAlig
169
181
  return true;
170
182
  };
171
183
  };
184
+
185
+ /**
186
+ * @private
187
+ * @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
188
+ * (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
189
+ */
172
190
  export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor) {
173
191
  return function (rowsCount, colsCount, inputMethod) {
174
192
  return function (_ref) {
@@ -201,4 +219,81 @@ export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEna
201
219
  return newTr;
202
220
  };
203
221
  };
222
+ };
223
+
224
+ /**
225
+ * Unified command to insert a new table into the editor.
226
+ *
227
+ * @param {Object} options - Configuration options for table insertion.
228
+ * @param {boolean} [options.isTableScalingEnabled=false] - Flag to enable table scaling.
229
+ * @param {boolean} [options.isTableAlignmentEnabled=false] - Flag to enable table alignment.
230
+ * @param {boolean} [options.isFullWidthModeEnabled=false] - Flag to enable full-width mode for the table.
231
+ * @param {boolean} [options.isCommentEditor=false] - Flag to indicate if the editor is in comment mode.
232
+ * @param {boolean} [options.isChromelessEditor=false] - Flag to indicate if the editor is chromeless.
233
+ * @param {boolean} [options.isTableResizingEnabled=false] - Flag to enable table resizing.
234
+ * @param {Object} [options.createTableProps={}] - Additional properties for table creation, including table size.
235
+ * @param {Object} api - PluginInjectinoApi object for content insertion commands.
236
+ * @param {Object} analyticsPayload - Payload for analytics tracking.
237
+ *
238
+ * @returns {Function} A function that takes a transaction and inserts a table.
239
+ */
240
+ export var insertTableWithNestingSupport = function insertTableWithNestingSupport(_ref2, api, analyticsPayload) {
241
+ var _ref2$isTableScalingE = _ref2.isTableScalingEnabled,
242
+ isTableScalingEnabled = _ref2$isTableScalingE === void 0 ? false : _ref2$isTableScalingE,
243
+ _ref2$isTableAlignmen = _ref2.isTableAlignmentEnabled,
244
+ isTableAlignmentEnabled = _ref2$isTableAlignmen === void 0 ? false : _ref2$isTableAlignmen,
245
+ _ref2$isFullWidthMode = _ref2.isFullWidthModeEnabled,
246
+ isFullWidthModeEnabled = _ref2$isFullWidthMode === void 0 ? false : _ref2$isFullWidthMode,
247
+ _ref2$isCommentEditor = _ref2.isCommentEditor,
248
+ isCommentEditor = _ref2$isCommentEditor === void 0 ? false : _ref2$isCommentEditor,
249
+ _ref2$isChromelessEdi = _ref2.isChromelessEditor,
250
+ isChromelessEditor = _ref2$isChromelessEdi === void 0 ? false : _ref2$isChromelessEdi,
251
+ _ref2$isTableResizing = _ref2.isTableResizingEnabled,
252
+ isTableResizingEnabled = _ref2$isTableResizing === void 0 ? false : _ref2$isTableResizing,
253
+ _ref2$createTableProp = _ref2.createTableProps,
254
+ createTableProps = _ref2$createTableProp === void 0 ? {} : _ref2$createTableProp;
255
+ return function (_ref3) {
256
+ var _api$contentInsertion;
257
+ var tr = _ref3.tr;
258
+ var schema = tr.doc.type.schema;
259
+ var node = createTableWithWidth({
260
+ isTableScalingEnabled: isTableScalingEnabled,
261
+ isTableAlignmentEnabled: isTableAlignmentEnabled,
262
+ isFullWidthModeEnabled: isFullWidthModeEnabled,
263
+ isCommentEditor: isCommentEditor,
264
+ isChromelessEditor: isChromelessEditor,
265
+ isTableResizingEnabled: isTableResizingEnabled,
266
+ createTableProps: createTableProps
267
+ })(schema);
268
+
269
+ // If the cursor is inside a table
270
+ var insertAt;
271
+ if (hasParentNodeOfType(schema.nodes.table)(tr.selection) && fg('platform_editor_use_nested_table_pm_nodes')) {
272
+ // If the experiment is disabled, or we're trying to nest deeper than one level, we insert the table after the top table
273
+ if (editorExperiment('nested-tables-in-tables', false, {
274
+ exposure: true
275
+ }) || getParentOfTypeCount(schema.nodes.table)(tr.selection) > 1) {
276
+ var positionAfterTopTable = getPositionAfterTopParentNodeOfType(schema.nodes.table)(tr.selection);
277
+ if (!positionAfterTopTable) {
278
+ return tr;
279
+ }
280
+ insertAt = TextSelection.create(tr.doc, positionAfterTopTable);
281
+ }
282
+ }
283
+ api === null || api === void 0 || (_api$contentInsertion = api.contentInsertion) === null || _api$contentInsertion === void 0 || (_api$contentInsertion = _api$contentInsertion.commands) === null || _api$contentInsertion === void 0 || _api$contentInsertion.insert({
284
+ node: node,
285
+ options: {
286
+ selectNodeInserted: false,
287
+ analyticsPayload: analyticsPayload ? _objectSpread(_objectSpread({}, analyticsPayload), {}, {
288
+ attributes: _objectSpread(_objectSpread({}, analyticsPayload.attributes), {}, {
289
+ localId: node.attrs.localId
290
+ })
291
+ }) : undefined,
292
+ insertAt: insertAt
293
+ }
294
+ })({
295
+ tr: tr
296
+ });
297
+ return tr;
298
+ };
204
299
  };
@@ -10,15 +10,15 @@ import { IconTable } from '@atlaskit/editor-common/icons';
10
10
  import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
11
11
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
12
12
  import { getParentOfTypeCount, getPositionAfterTopParentNodeOfType } from '@atlaskit/editor-common/nesting';
13
+ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
13
14
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
14
15
  import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
15
- import { TextSelection } from '@atlaskit/editor-prosemirror/state';
16
16
  import { hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
17
17
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
18
18
  import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
19
19
  import { fg } from '@atlaskit/platform-feature-flags';
20
20
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
- import { insertTableWithSize } from './commands/insert';
21
+ import { insertTableWithNestingSupport, insertTableWithSize } from './commands/insert';
22
22
  import { pluginConfig } from './create-plugin-config';
23
23
  import { createPlugin as createTableAnalyticsPlugin } from './pm-plugins/analytics/plugin';
24
24
  import { pluginKey as tableAnalyticsPluginKey } from './pm-plugins/analytics/plugin-key';
@@ -109,53 +109,72 @@ var tablesPlugin = function tablesPlugin(_ref) {
109
109
  actions: {
110
110
  insertTable: function insertTable(analyticsPayload) {
111
111
  return function (state, dispatch) {
112
- var _api$contentInsertion, _api$contentInsertion2;
113
- var node = createTableWithWidth({
114
- isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
115
- isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment,
116
- isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
117
- isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
118
- isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
119
- isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing
120
- })(state.schema);
121
-
122
- // If the cursor is inside a table
123
- var insertAt;
124
- if (hasParentNodeOfType(state.schema.nodes.table)(state.selection) && fg('platform_editor_use_nested_table_pm_nodes')) {
125
- // If the experiment is disabled, or we're trying to nest deeper than one level, we insert the table after the top table
126
- if (editorExperiment('nested-tables-in-tables', false, {
127
- exposure: true
128
- }) || getParentOfTypeCount(state.schema.nodes.table)(state.selection) > 1) {
129
- var positionAfterTopTable = getPositionAfterTopParentNodeOfType(state.schema.nodes.table)(state.selection);
130
- if (!positionAfterTopTable) {
131
- return false;
112
+ if (fg('platform_editor_use_nested_table_pm_nodes')) {
113
+ return editorCommandToPMCommand(insertTableWithNestingSupport({
114
+ isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
115
+ isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment,
116
+ isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
117
+ isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
118
+ isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
119
+ isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing
120
+ }, api, analyticsPayload))(state, dispatch);
121
+ } else {
122
+ var _api$contentInsertion, _api$contentInsertion2;
123
+ var node = createTableWithWidth({
124
+ isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
125
+ isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment,
126
+ isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
127
+ isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
128
+ isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
129
+ isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing
130
+ })(state.schema);
131
+ return (_api$contentInsertion = api === null || api === void 0 || (_api$contentInsertion2 = api.contentInsertion) === null || _api$contentInsertion2 === void 0 || (_api$contentInsertion2 = _api$contentInsertion2.actions) === null || _api$contentInsertion2 === void 0 ? void 0 : _api$contentInsertion2.insert({
132
+ state: state,
133
+ dispatch: dispatch,
134
+ node: node,
135
+ options: {
136
+ selectNodeInserted: false,
137
+ analyticsPayload: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
138
+ attributes: _objectSpread(_objectSpread({}, analyticsPayload.attributes), {}, {
139
+ localId: node.attrs.localId
140
+ })
141
+ })
132
142
  }
133
- insertAt = TextSelection.create(state.doc, positionAfterTopTable);
134
- }
143
+ })) !== null && _api$contentInsertion !== void 0 ? _api$contentInsertion : false;
135
144
  }
136
- return (_api$contentInsertion = api === null || api === void 0 || (_api$contentInsertion2 = api.contentInsertion) === null || _api$contentInsertion2 === void 0 || (_api$contentInsertion2 = _api$contentInsertion2.actions) === null || _api$contentInsertion2 === void 0 ? void 0 : _api$contentInsertion2.insert({
137
- state: state,
138
- dispatch: dispatch,
139
- node: node,
140
- options: {
141
- selectNodeInserted: false,
142
- analyticsPayload: _objectSpread(_objectSpread({}, analyticsPayload), {}, {
143
- attributes: _objectSpread(_objectSpread({}, analyticsPayload.attributes), {}, {
144
- localId: node.attrs.localId
145
- })
146
- }),
147
- insertAt: insertAt
148
- }
149
- })) !== null && _api$contentInsertion !== void 0 ? _api$contentInsertion : false;
150
145
  };
151
146
  }
152
147
  },
153
148
  commands: {
154
- insertTableWithSize: insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
149
+ insertTableWithSize: fg('platform_editor_use_nested_table_pm_nodes') ? function (rowsCount, colsCount, inputMethod) {
150
+ return insertTableWithNestingSupport({
151
+ isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
152
+ isTableAlignmentEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment,
153
+ isFullWidthModeEnabled: options === null || options === void 0 ? void 0 : options.fullWidthEnabled,
154
+ isCommentEditor: options === null || options === void 0 ? void 0 : options.isCommentEditor,
155
+ isChromelessEditor: options === null || options === void 0 ? void 0 : options.isChromelessEditor,
156
+ isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.tableOptions.allowTableResizing,
157
+ createTableProps: {
158
+ rowsCount: rowsCount,
159
+ colsCount: colsCount
160
+ }
161
+ }, api, {
162
+ action: ACTION.INSERTED,
163
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
164
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
165
+ attributes: {
166
+ inputMethod: inputMethod !== null && inputMethod !== void 0 ? inputMethod : INPUT_METHOD.PICKER,
167
+ totalRowCount: rowsCount,
168
+ totalColumnCount: colsCount
169
+ },
170
+ eventType: EVENT_TYPE.TRACK
171
+ });
172
+ } : insertTableWithSize(options === null || options === void 0 ? void 0 : options.fullWidthEnabled, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, options === null || options === void 0 ? void 0 : options.tableOptions.allowTableAlignment, api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 ? void 0 : _api$analytics2.actions, options === null || options === void 0 ? void 0 : options.isCommentEditor)
155
173
  },
156
174
  nodes: function nodes() {
157
175
  var _pluginConfig = pluginConfig(options === null || options === void 0 ? void 0 : options.tableOptions),
158
176
  allowColumnResizing = _pluginConfig.allowColumnResizing;
177
+ // TODO: ED-25901 - We need to move this into a plugin config option so we don't accidentally enable nested nodes in Jira
159
178
  var isNestingSupported = fg('platform_editor_use_nested_table_pm_nodes');
160
179
  return isNestingSupported ? [{
161
180
  name: 'table',
@@ -26,17 +26,17 @@ export var autoScrollerFactory = function autoScrollerFactory(_ref) {
26
26
  },
27
27
  getOverflow: function getOverflow() {
28
28
  return {
29
- fromTopEdge: {
29
+ forTopEdge: {
30
30
  top: dropTargetExtendedWidth,
31
31
  right: dropTargetExtendedWidth,
32
32
  left: dropTargetExtendedWidth
33
33
  },
34
- fromRightEdge: {
34
+ forRightEdge: {
35
35
  right: dropTargetExtendedWidth,
36
36
  top: dropTargetExtendedWidth,
37
37
  bottom: dropTargetExtendedWidth
38
38
  },
39
- fromLeftEdge: {
39
+ forLeftEdge: {
40
40
  top: dropTargetExtendedWidth,
41
41
  left: dropTargetExtendedWidth,
42
42
  bottom: dropTargetExtendedWidth
@@ -1,11 +1,13 @@
1
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
2
  import { addColumnAfter, addColumnAfterVO, addColumnBefore, addColumnBeforeVO, addRowAfter, addRowAfterVO, addRowBefore, addRowBeforeVO, backspace, bindKeymapWithCommand, decreaseMediaSize, deleteColumn, deleteRow, escape, focusToContextMenuTrigger, increaseMediaSize, moveColumnLeft, moveColumnRight, moveLeft, moveRight, moveRowDown, moveRowUp, nextCell, previousCell, startColumnResizing, toggleTable } from '@atlaskit/editor-common/keymaps';
3
+ import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
3
4
  import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
4
5
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
5
7
  import { goToNextCell, moveCursorBackward, setFocusToCellMenu } from '../commands';
6
8
  import { addRowAroundSelection, changeColumnWidthByStepWithAnalytics, deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut, deleteTableIfSelectedWithAnalytics, emptyMultipleCellsWithAnalytics } from '../commands-with-analytics';
7
9
  import { activateNextResizeArea, initiateKeyboardColumnResizing, stopKeyboardColumnResizing } from '../commands/column-resize';
8
- import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable } from '../commands/insert';
10
+ import { addColumnAfter as addColumnAfterCommand, addColumnBefore as addColumnBeforeCommand, createTable, insertTableWithNestingSupport } from '../commands/insert';
9
11
  import { moveSourceWithAnalyticsViaShortcut } from '../pm-plugins/drag-and-drop/commands-with-analytics';
10
12
  export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProviderAPI, editorAnalyticsAPI, dragAndDropEnabled) {
11
13
  var _pluginInjectionApi$a;
@@ -23,7 +25,22 @@ export function keymapPlugin(getEditorContainerWidth, api, nodeViewPortalProvide
23
25
  var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
24
26
  bindKeymapWithCommand(nextCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
25
27
  bindKeymapWithCommand(previousCell.common, goToNextCell(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(-1), list);
26
- bindKeymapWithCommand(toggleTable.common, createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
28
+ bindKeymapWithCommand(toggleTable.common, fg('platform_editor_use_nested_table_pm_nodes') ? editorCommandToPMCommand(insertTableWithNestingSupport({
29
+ isTableScalingEnabled: isTableScalingEnabled,
30
+ isTableAlignmentEnabled: isTableAlignmentEnabled,
31
+ isFullWidthModeEnabled: !!isFullWidthEnabled,
32
+ isCommentEditor: isCommentEditor,
33
+ isChromelessEditor: isChromelessEditor,
34
+ isTableResizingEnabled: isTableResizingEnabled
35
+ }, api, {
36
+ action: ACTION.INSERTED,
37
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
38
+ actionSubjectId: ACTION_SUBJECT_ID.TABLE,
39
+ attributes: {
40
+ inputMethod: INPUT_METHOD.SHORTCUT
41
+ },
42
+ eventType: EVENT_TYPE.TRACK
43
+ })) : createTable(isTableScalingEnabled, isTableAlignmentEnabled, !!isFullWidthEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled), list);
27
44
  bindKeymapWithCommand(backspace.common, chainCommands(deleteTableIfSelectedWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD), emptyMultipleCellsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.KEYBOARD)), list);
28
45
  bindKeymapWithCommand(backspace.common, moveCursorBackward, list);
29
46
 
@@ -23,6 +23,7 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
23
23
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
24
24
  import EditorBackgroundColorIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
25
25
  import PaintBucketIcon from '@atlaskit/icon/core/paint-bucket';
26
+ import { fg } from '@atlaskit/platform-feature-flags';
26
27
  import { Box, xcss } from '@atlaskit/primitives';
27
28
  import Toggle from '@atlaskit/toggle';
28
29
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
@@ -495,7 +496,7 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
495
496
  fitHeight: fitHeight,
496
497
  fitWidth: fitWidth,
497
498
  direction: direction,
498
- mountPoint: mountPoint,
499
+ mountPoint: fg('platform_editor_table_drag_menu_mount_point_fix') ? undefined : mountPoint,
499
500
  boundariesElement: boundariesElement,
500
501
  scrollableElement: scrollableElement
501
502
  });
@@ -1,13 +1,53 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
1
+ import type { AnalyticsEventPayload, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
4
4
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { PluginInjectionAPI } from '../types';
7
+ type InsertTableWithNestingSupportCommand = (options: {
8
+ isTableScalingEnabled?: boolean;
9
+ isTableAlignmentEnabled?: boolean;
10
+ isFullWidthModeEnabled?: boolean;
11
+ isCommentEditor?: boolean;
12
+ isChromelessEditor?: boolean;
13
+ isTableResizingEnabled?: boolean;
14
+ createTableProps?: {
15
+ rowsCount?: number;
16
+ colsCount?: number;
17
+ };
18
+ }, api: PluginInjectionAPI | undefined | null, analyticsPayload?: AnalyticsEventPayload) => EditorCommand;
7
19
  export declare function addColumnAt(api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
8
20
  export declare const addColumnBefore: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Command;
9
21
  export declare const addColumnAfter: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Command;
10
22
  export declare const insertColumn: (api: PluginInjectionAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => (column: number) => Command;
11
23
  export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
24
+ /**
25
+ * @private
26
+ * @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
27
+ * (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
28
+ */
12
29
  export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null, isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableResizingEnabled?: boolean) => Command;
30
+ /**
31
+ * @private
32
+ * @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
33
+ * (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
34
+ */
13
35
  export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, isCommentEditor?: boolean, isChromelessEditor?: boolean) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
36
+ /**
37
+ * Unified command to insert a new table into the editor.
38
+ *
39
+ * @param {Object} options - Configuration options for table insertion.
40
+ * @param {boolean} [options.isTableScalingEnabled=false] - Flag to enable table scaling.
41
+ * @param {boolean} [options.isTableAlignmentEnabled=false] - Flag to enable table alignment.
42
+ * @param {boolean} [options.isFullWidthModeEnabled=false] - Flag to enable full-width mode for the table.
43
+ * @param {boolean} [options.isCommentEditor=false] - Flag to indicate if the editor is in comment mode.
44
+ * @param {boolean} [options.isChromelessEditor=false] - Flag to indicate if the editor is chromeless.
45
+ * @param {boolean} [options.isTableResizingEnabled=false] - Flag to enable table resizing.
46
+ * @param {Object} [options.createTableProps={}] - Additional properties for table creation, including table size.
47
+ * @param {Object} api - PluginInjectinoApi object for content insertion commands.
48
+ * @param {Object} analyticsPayload - Payload for analytics tracking.
49
+ *
50
+ * @returns {Function} A function that takes a transaction and inserts a table.
51
+ */
52
+ export declare const insertTableWithNestingSupport: InsertTableWithNestingSupportCommand;
53
+ export {};
@@ -43,7 +43,6 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
43
43
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
44
44
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
45
45
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
46
- actions: import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI;
47
46
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
48
47
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
49
48
  sharedState: {
@@ -57,7 +56,7 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
57
56
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
58
57
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
59
58
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>];
60
- }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
59
+ } & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
61
60
  sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
62
61
  }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
63
62
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
@@ -24,7 +24,6 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
24
24
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
25
25
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
26
26
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
27
- actions: import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI;
28
27
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
29
28
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
30
29
  sharedState: {
@@ -38,7 +37,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
38
37
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
39
38
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
40
39
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>];
41
- }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
40
+ } & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
42
41
  sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
43
42
  }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
44
43
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
@@ -111,7 +110,6 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
111
110
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
112
111
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
113
112
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
114
- actions: import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI;
115
113
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
116
114
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
117
115
  sharedState: {
@@ -125,7 +123,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
125
123
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
126
124
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
127
125
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>];
128
- }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
126
+ } & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
129
127
  sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
130
128
  }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
131
129
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
@@ -53,7 +53,6 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
53
53
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
54
54
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
55
55
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"contentInsertion", {
56
- actions: import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI;
57
56
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"analytics", {
58
57
  pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
59
58
  sharedState: {
@@ -67,7 +66,7 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
67
66
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
68
67
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
69
68
  }, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>];
70
- }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
69
+ } & import("@atlaskit/editor-plugin-content-insertion").InsertNodeAPI, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
71
70
  sharedState: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
72
71
  }, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"guideline", {
73
72
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"width", {
@@ -5,15 +5,15 @@ import type { AriaLiveElementAttributes } from '@atlaskit/editor-plugin-accessib
5
5
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
6
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
7
  import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
8
- import type { UNSAFE_NewIconProps } from '@atlaskit/icon/types';
8
+ import type { NewIconProps } from '@atlaskit/icon/types';
9
9
  import type { DraggableData, DraggableType, PluginInjectionAPI, TableDirection } from '../types';
10
10
  export declare const getTargetIndex: (selectedIndexes: number[], direction: DraggableData['direction']) => number;
11
11
  export declare const canMove: (sourceType: DraggableType, direction: DraggableData['direction'], totalItemsOfSourceTypeCount: number, selection: Selection, selectionRect?: Rect) => boolean;
12
12
  export type DragMenuOptionIdType = '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';
13
13
  export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
14
14
  id: DragMenuOptionIdType;
15
- icon?: React.ComponentType<React.PropsWithChildren<UNSAFE_NewIconProps>>;
16
- iconFallback?: React.ComponentType<React.PropsWithChildren<UNSAFE_NewIconProps>>;
15
+ icon?: React.ComponentType<React.PropsWithChildren<NewIconProps>>;
16
+ iconFallback?: React.ComponentType<React.PropsWithChildren<NewIconProps>>;
17
17
  keymap?: string;
18
18
  }
19
19
  export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, isCommentEditor?: boolean) => DragMenuConfig[];