@atlaskit/editor-plugin-table 5.3.12 → 5.3.14

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 (155) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/plugins/table/event-handlers.js +6 -3
  3. package/dist/cjs/plugins/table/index.js +16 -2
  4. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -1
  5. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +3 -7
  6. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
  7. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/actions.js +2 -1
  8. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +22 -1
  9. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +54 -7
  10. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/reducer.js +6 -0
  11. package/dist/cjs/plugins/table/types.js +9 -2
  12. package/dist/cjs/plugins/table/ui/DragHandle/index.js +2 -0
  13. package/dist/cjs/plugins/table/ui/FloatingDragMenu/DragMenu.js +80 -0
  14. package/dist/cjs/plugins/table/ui/FloatingDragMenu/index.js +62 -0
  15. package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +52 -4
  16. package/dist/cjs/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +10 -8
  17. package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +12 -3
  18. package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +44 -5
  19. package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +6 -4
  20. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +44 -20
  21. package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +4 -0
  22. package/dist/cjs/plugins/table/ui/common-styles.js +1 -1
  23. package/dist/cjs/plugins/table/ui/consts.js +3 -2
  24. package/dist/cjs/plugins/table/ui/ui-styles.js +27 -24
  25. package/dist/cjs/plugins/table/utils/dom.js +12 -4
  26. package/dist/cjs/plugins/table/utils/drag-menu.js +59 -0
  27. package/dist/cjs/plugins/table/utils/index.js +12 -0
  28. package/dist/es2019/plugins/table/event-handlers.js +5 -4
  29. package/dist/es2019/plugins/table/index.js +16 -2
  30. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -1
  31. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +3 -7
  32. package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
  33. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/actions.js +2 -1
  34. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +20 -0
  35. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +54 -3
  36. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/reducer.js +7 -0
  37. package/dist/es2019/plugins/table/types.js +9 -2
  38. package/dist/es2019/plugins/table/ui/DragHandle/index.js +2 -0
  39. package/dist/es2019/plugins/table/ui/FloatingDragMenu/DragMenu.js +77 -0
  40. package/dist/es2019/plugins/table/ui/FloatingDragMenu/index.js +56 -0
  41. package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +53 -2
  42. package/dist/es2019/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +10 -8
  43. package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +9 -3
  44. package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +46 -6
  45. package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +7 -5
  46. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +45 -22
  47. package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +4 -0
  48. package/dist/es2019/plugins/table/ui/common-styles.js +51 -3
  49. package/dist/es2019/plugins/table/ui/consts.js +2 -1
  50. package/dist/es2019/plugins/table/ui/ui-styles.js +23 -1
  51. package/dist/es2019/plugins/table/utils/dom.js +5 -1
  52. package/dist/es2019/plugins/table/utils/drag-menu.js +44 -0
  53. package/dist/es2019/plugins/table/utils/index.js +1 -1
  54. package/dist/esm/plugins/table/event-handlers.js +7 -4
  55. package/dist/esm/plugins/table/index.js +16 -2
  56. package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -1
  57. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +3 -7
  58. package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +1 -3
  59. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/actions.js +2 -1
  60. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +21 -0
  61. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +54 -7
  62. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/reducer.js +6 -0
  63. package/dist/esm/plugins/table/types.js +9 -2
  64. package/dist/esm/plugins/table/ui/DragHandle/index.js +2 -0
  65. package/dist/esm/plugins/table/ui/FloatingDragMenu/DragMenu.js +73 -0
  66. package/dist/esm/plugins/table/ui/FloatingDragMenu/index.js +55 -0
  67. package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +51 -3
  68. package/dist/esm/plugins/table/ui/FloatingInsertButton/getPopupOptions.js +10 -8
  69. package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +9 -3
  70. package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +45 -6
  71. package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +7 -5
  72. package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +46 -22
  73. package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +4 -0
  74. package/dist/esm/plugins/table/ui/common-styles.js +2 -2
  75. package/dist/esm/plugins/table/ui/consts.js +2 -1
  76. package/dist/esm/plugins/table/ui/ui-styles.js +26 -23
  77. package/dist/esm/plugins/table/utils/dom.js +11 -3
  78. package/dist/esm/plugins/table/utils/drag-menu.js +52 -0
  79. package/dist/esm/plugins/table/utils/index.js +1 -1
  80. package/dist/types/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +8 -1
  81. package/dist/types/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +2 -1
  82. package/dist/types/plugins/table/pm-plugins/drag-and-drop/types.d.ts +4 -0
  83. package/dist/types/plugins/table/types.d.ts +10 -2
  84. package/dist/types/plugins/table/ui/DragHandle/index.d.ts +4 -2
  85. package/dist/types/plugins/table/ui/DragPreview/index.d.ts +2 -1
  86. package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +2 -1
  87. package/dist/types/plugins/table/ui/FloatingDeleteButton/types.d.ts +2 -1
  88. package/dist/types/plugins/table/ui/FloatingDragMenu/DragMenu.d.ts +19 -0
  89. package/dist/types/plugins/table/ui/FloatingDragMenu/index.d.ts +21 -0
  90. package/dist/types/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +6 -1
  91. package/dist/types/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +2 -1
  92. package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +5 -5
  93. package/dist/types/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
  94. package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +4 -0
  95. package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +3 -0
  96. package/dist/types/plugins/table/ui/consts.d.ts +1 -0
  97. package/dist/types/plugins/table/ui/ui-styles.d.ts +1 -0
  98. package/dist/types/plugins/table/utils/dom.d.ts +4 -1
  99. package/dist/types/plugins/table/utils/drag-menu.d.ts +7 -0
  100. package/dist/types/plugins/table/utils/index.d.ts +1 -1
  101. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +8 -1
  102. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +2 -1
  103. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/types.d.ts +4 -0
  104. package/dist/types-ts4.5/plugins/table/types.d.ts +10 -2
  105. package/dist/types-ts4.5/plugins/table/ui/DragHandle/index.d.ts +4 -2
  106. package/dist/types-ts4.5/plugins/table/ui/DragPreview/index.d.ts +2 -1
  107. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +2 -1
  108. package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +2 -1
  109. package/dist/types-ts4.5/plugins/table/ui/FloatingDragMenu/DragMenu.d.ts +19 -0
  110. package/dist/types-ts4.5/plugins/table/ui/FloatingDragMenu/index.d.ts +21 -0
  111. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +6 -1
  112. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +2 -1
  113. package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +5 -5
  114. package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -1
  115. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +4 -0
  116. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +3 -0
  117. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +1 -0
  118. package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +1 -0
  119. package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +4 -1
  120. package/dist/types-ts4.5/plugins/table/utils/drag-menu.d.ts +7 -0
  121. package/dist/types-ts4.5/plugins/table/utils/index.d.ts +1 -1
  122. package/package.json +3 -2
  123. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +40 -194
  124. package/src/__tests__/unit/ui/RowDragControls.tsx +9 -11
  125. package/src/plugins/table/event-handlers.ts +15 -3
  126. package/src/plugins/table/index.tsx +18 -1
  127. package/src/plugins/table/nodeviews/TableComponent.tsx +2 -1
  128. package/src/plugins/table/pm-plugins/decorations/plugin.ts +2 -9
  129. package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +1 -3
  130. package/src/plugins/table/pm-plugins/drag-and-drop/actions.ts +14 -1
  131. package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +32 -1
  132. package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +50 -2
  133. package/src/plugins/table/pm-plugins/drag-and-drop/reducer.ts +7 -0
  134. package/src/plugins/table/pm-plugins/drag-and-drop/types.ts +5 -0
  135. package/src/plugins/table/types.ts +14 -2
  136. package/src/plugins/table/ui/DragHandle/index.tsx +5 -1
  137. package/src/plugins/table/ui/DragPreview/index.tsx +2 -1
  138. package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +2 -1
  139. package/src/plugins/table/ui/FloatingDeleteButton/types.ts +3 -1
  140. package/src/plugins/table/ui/FloatingDragMenu/DragMenu.tsx +99 -0
  141. package/src/plugins/table/ui/FloatingDragMenu/index.tsx +91 -0
  142. package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +79 -4
  143. package/src/plugins/table/ui/FloatingInsertButton/getPopupOptions.ts +31 -7
  144. package/src/plugins/table/ui/FloatingInsertButton/index.tsx +28 -13
  145. package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +47 -3
  146. package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +11 -4
  147. package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +65 -25
  148. package/src/plugins/table/ui/TableFloatingControls/index.tsx +7 -0
  149. package/src/plugins/table/ui/common-styles.ts +57 -2
  150. package/src/plugins/table/ui/consts.ts +2 -0
  151. package/src/plugins/table/ui/ui-styles.ts +27 -1
  152. package/src/plugins/table/utils/dom.ts +11 -4
  153. package/src/plugins/table/utils/drag-menu.ts +65 -0
  154. package/src/plugins/table/utils/index.ts +2 -0
  155. package/tsconfig.app.json +3 -0
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
2
2
  export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine } from './decoration';
3
3
  export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow } from './nodes';
4
4
  export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell } from './paste';
5
- export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
5
+ export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler } from './dom';
6
6
  export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames } from './column-controls';
7
7
  export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow } from './row-controls';
8
8
  export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
@@ -1,4 +1,5 @@
1
1
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
2
+ import type { TableDirection } from '../../types';
2
3
  import type { DropTargetType } from './consts';
3
4
  export interface DragAndDropAction<T, D> {
4
5
  type: T;
@@ -7,6 +8,7 @@ export interface DragAndDropAction<T, D> {
7
8
  export declare const DragAndDropActionType: {
8
9
  readonly SET_DROP_TARGET: "SET_DROP_TARGET";
9
10
  readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
11
+ readonly TOGGLE_DRAG_MENU: "TOGGLE_DRAG_MENU";
10
12
  };
11
13
  export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
12
14
  type: DropTargetType;
@@ -16,4 +18,9 @@ export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDro
16
18
  export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, {
17
19
  decorationSet: DecorationSet;
18
20
  }>;
19
- export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction;
21
+ export type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDropActionType.TOGGLE_DRAG_MENU, {
22
+ isDragMenuOpen: boolean;
23
+ direction: TableDirection;
24
+ index: number;
25
+ }>;
26
+ export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
@@ -1,7 +1,7 @@
1
1
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { Decoration } from '@atlaskit/editor-prosemirror/view';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
- import type { DraggableType } from '../../types';
4
+ import type { DraggableType, TableDirection } from '../../types';
5
5
  import { TableDecorations } from '../../types';
6
6
  import { DropTargetType } from './consts';
7
7
  export declare const getDecorations: (state: EditorState) => DecorationSet;
@@ -9,3 +9,4 @@ export declare const updatePluginStateDecorations: (state: EditorState, decorati
9
9
  export declare const setDropTarget: (type: DropTargetType, index: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
10
10
  export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
11
11
  export declare const moveSource: (sourceType: DraggableType, sourceIndex: number, targetIndex: number) => import("@atlaskit/editor-common/types").Command;
12
+ export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number) => import("@atlaskit/editor-common/types").Command;
@@ -1,7 +1,11 @@
1
1
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
2
+ import type { TableDirection } from '../../types';
2
3
  import type { DropTargetType } from './consts';
3
4
  export interface DragAndDropPluginState {
4
5
  decorationSet: DecorationSet;
5
6
  dropTargetType: DropTargetType;
6
7
  dropTargetIndex: number;
8
+ isDragMenuOpen: boolean;
9
+ dragMenuDirection?: TableDirection;
10
+ dragMenuIndex: number;
7
11
  }
@@ -269,6 +269,9 @@ export declare const TableCssClassName: {
269
269
  CONTROLS_INSERT_LINE: string;
270
270
  CONTROLS_BUTTON_OVERLAY: string;
271
271
  LAYOUT_BUTTON: string;
272
+ DRAG_CONTROLS_INSERT_BUTTON: string;
273
+ DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
274
+ DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
272
275
  CONTROLS_INSERT_MARKER: string;
273
276
  CONTROLS_INSERT_COLUMN: string;
274
277
  CONTROLS_INSERT_ROW: string;
@@ -281,8 +284,12 @@ export declare const TableCssClassName: {
281
284
  CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
282
285
  CONTROLS_CORNER_BUTTON: string;
283
286
  /** Controls with drag handle */
284
- COLUMN_CONTROLS_WITH_DRAG: string;
285
- ROW_CONTROLS_WITH_DRAG: string;
287
+ DRAG_ROW_CONTROLS: string;
288
+ DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
289
+ DRAG_ROW_FLOATING_INSERT_DOT: string;
290
+ DRAG_COLUMN_CONTROLS: string;
291
+ DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
292
+ DRAG_COLUMN_FLOATING_INSERT_DOT: string;
286
293
  DRAG_HANDLE_BUTTON_CONTAINER: string;
287
294
  /** Other classes */
288
295
  NUMBERED_COLUMN: string;
@@ -373,6 +380,7 @@ export type InvalidNodeAttr = {
373
380
  spanValue: number;
374
381
  tableLocalId: string;
375
382
  };
383
+ export type TableDirection = 'row' | 'column';
376
384
  /**
377
385
  * Drag and Drop interfaces
378
386
  */
@@ -1,15 +1,17 @@
1
1
  import type { MouseEventHandler } from 'react';
2
+ import type { TableDirection } from '../../types';
2
3
  type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
3
4
  type DragHandleProps = {
4
5
  tableLocalId: string;
5
6
  indexes: number[];
6
7
  previewWidth?: number;
7
8
  previewHeight?: number;
8
- direction?: 'column' | 'row';
9
+ direction?: TableDirection;
9
10
  appearance?: DragHandleAppearance;
10
11
  onClick?: MouseEventHandler;
11
12
  onMouseOver?: MouseEventHandler;
12
13
  onMouseOut?: MouseEventHandler;
14
+ onMouseUp?: MouseEventHandler;
13
15
  };
14
- export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onClick, }: DragHandleProps) => JSX.Element;
16
+ export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onMouseUp, onClick, }: DragHandleProps) => JSX.Element;
15
17
  export {};
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import type { TableDirection } from '../../types';
2
3
  export declare const DragPreview: ({ direction, width, height, }: {
3
- direction: 'column' | 'row';
4
+ direction: TableDirection;
4
5
  width: number;
5
6
  height: number;
6
7
  }) => JSX.Element;
@@ -3,6 +3,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
6
+ import type { TableDirection } from '../../types';
6
7
  import type { CellSelectionType } from './types';
7
8
  export interface Props {
8
9
  editorView: EditorView;
@@ -23,7 +24,7 @@ export interface State {
23
24
  position?: string;
24
25
  scrollLeft: number;
25
26
  }
26
- export declare function getSelectionType(selection: Selection): 'column' | 'row' | undefined;
27
+ export declare function getSelectionType(selection: Selection): TableDirection | undefined;
27
28
  declare class FloatingDeleteButton extends Component<Props, State> {
28
29
  static displayName: string;
29
30
  wrapper: HTMLElement | null;
@@ -1 +1,2 @@
1
- export type CellSelectionType = 'column' | 'row' | undefined;
1
+ import type { TableDirection } from '../../types';
2
+ export type CellSelectionType = TableDirection | undefined;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { PluginConfig, TableDirection } from '../../types';
5
+ type DragMenuProps = {
6
+ direction?: TableDirection;
7
+ index?: number;
8
+ tableRef?: HTMLTableElement;
9
+ tableNode?: PmNode;
10
+ editorView: EditorView;
11
+ isOpen?: boolean;
12
+ targetCellPosition?: number;
13
+ mountPoint?: HTMLElement;
14
+ boundariesElement?: HTMLElement;
15
+ scrollableElement?: HTMLElement;
16
+ pluginConfig?: PluginConfig;
17
+ };
18
+ export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, }: DragMenuProps) => JSX.Element | null;
19
+ export {};
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { TableDirection } from '../../types';
5
+ export interface Props {
6
+ editorView: EditorView;
7
+ isOpen: boolean;
8
+ tableRef?: HTMLTableElement;
9
+ tableNode?: PmNode;
10
+ mountPoint?: HTMLElement;
11
+ boundariesElement?: HTMLElement;
12
+ scrollableElement?: HTMLElement;
13
+ direction?: TableDirection;
14
+ index?: number;
15
+ targetCellPosition?: number;
16
+ }
17
+ declare const FloatingDragMenu: {
18
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, }: Props): JSX.Element | null;
19
+ displayName: string;
20
+ };
21
+ export default FloatingDragMenu;
@@ -1,12 +1,17 @@
1
1
  import type { SyntheticEvent } from 'react';
2
2
  import React from 'react';
3
3
  import type { WrappedComponentProps } from 'react-intl-next';
4
+ import type { TableDirection } from '../../types';
4
5
  export interface ButtonProps {
5
- type: 'row' | 'column';
6
+ type: TableDirection;
6
7
  tableRef: HTMLElement;
7
8
  onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
8
9
  hasStickyHeaders: boolean;
9
10
  }
11
+ export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
12
+ export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
13
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
14
+ };
10
15
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
11
16
  WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
12
17
  };
@@ -1,3 +1,4 @@
1
1
  import type { PopupProps } from '@atlaskit/editor-common/ui';
2
- declare function getPopupOptions(type: 'column' | 'row', index: number, hasNumberedColumns: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
2
+ import type { TableDirection } from '../../types';
3
+ declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, isDragAndDropEnabled: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
3
4
  export default getPopupOptions;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { WrappedComponentProps } from 'react-intl-next';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
4
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
6
- import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
7
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
6
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
7
  export interface Props {
9
8
  editorView: EditorView;
10
9
  getEditorContainerWidth: GetEditorContainerWidth;
@@ -14,6 +13,7 @@ export interface Props {
14
13
  insertRowButtonIndex?: number;
15
14
  isHeaderColumnEnabled?: boolean;
16
15
  isHeaderRowEnabled?: boolean;
16
+ isDragAndDropEnabled?: boolean;
17
17
  mountPoint?: HTMLElement;
18
18
  boundariesElement?: HTMLElement;
19
19
  scrollableElement?: HTMLElement;
@@ -12,6 +12,7 @@ export interface ColumnControlsProps {
12
12
  localId?: string;
13
13
  rowHeights?: number[];
14
14
  colWidths?: (number | undefined)[];
15
+ hasHeaderColumn?: boolean;
15
16
  }
16
- export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
17
+ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, }: ColumnControlsProps) => JSX.Element;
17
18
  export default ColumnControls;
@@ -1,13 +1,17 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
5
  import type { CellHoverMeta } from '../../../types';
5
6
  type DragControlsProps = {
6
7
  editorView: EditorView;
7
8
  tableRef: HTMLTableElement;
9
+ tableNode?: PmNode;
8
10
  tableActive?: boolean;
9
11
  hoveredCell?: CellHoverMeta;
10
12
  isInDanger?: boolean;
13
+ isResizing?: boolean;
14
+ hasHeaderRow?: boolean;
11
15
  hoverRows: (rows: number[], danger?: boolean) => void;
12
16
  selectRow: (row: number, expand: boolean) => void;
13
17
  updateCellHoverLocation: (rowIndex: number) => void;
@@ -1,5 +1,6 @@
1
1
  import { Component } from 'react';
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
4
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
6
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
@@ -8,6 +9,7 @@ export interface Props {
8
9
  editorView: EditorView;
9
10
  selection?: Selection;
10
11
  tableRef?: HTMLTableElement;
12
+ tableNode?: PmNode;
11
13
  tableActive?: boolean;
12
14
  isInDanger?: boolean;
13
15
  isResizing?: boolean;
@@ -21,6 +23,7 @@ export interface Props {
21
23
  hoveredCell?: CellHoverMeta;
22
24
  ordering?: TableColumnOrdering;
23
25
  stickyHeader?: RowStickyState;
26
+ insertRowButtonIndex?: number;
24
27
  }
25
28
  interface State {
26
29
  tableHeight: number;
@@ -50,3 +50,4 @@ export declare const TABLE_SNAP_GAP = 9;
50
50
  export declare const TABLE_HIGHLIGHT_GAP = 10;
51
51
  export declare const TABLE_HIGHLIGHT_TOLERANCE = 2;
52
52
  export declare const STICKY_HEADER_TOGGLE_TOLERANCE_MS = 5;
53
+ export declare const dragMenuDropdownWidth = 240;
@@ -3,6 +3,7 @@ export declare const InsertMarker: (props: ThemeProps, cssString?: string) => im
3
3
  export declare const HeaderButton: (props: ThemeProps, cssString?: string) => import("@emotion/react").SerializedStyles;
4
4
  export declare const HeaderButtonHover: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
5
5
  export declare const HeaderButtonDanger: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
6
+ export declare const dragInsertButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
6
7
  export declare const insertColumnButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
7
8
  export declare const insertRowButtonWrapper: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
8
9
  export declare const columnControlsLineMarker: () => import("@emotion/react").SerializedStyles;
@@ -5,10 +5,13 @@ export declare const isInsertRowButton: (node: HTMLElement | null) => boolean |
5
5
  export declare const getColumnOrRowIndex: (target: HTMLElement) => [number, number];
6
6
  export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
7
7
  export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
8
- export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
9
8
  export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
10
9
  export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
11
10
  export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
11
+ /** drag-and-drop classes */
12
+ export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
13
+ export declare const isDragRowFloatingInsertDot: (node: HTMLElement | null) => boolean;
14
+ export declare const isDragColumnFloatingInsertDot: (node: HTMLElement | null) => boolean;
12
15
  export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, elementContentRects?: ElementContentRects, gapInPixels?: number) => 'left' | 'right' | null;
13
16
  export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
14
17
  export declare const updateResizeHandles: (tableRef?: HTMLElement) => void;
@@ -0,0 +1,7 @@
1
+ import type { Command, DropdownOptionT } from '@atlaskit/editor-common/types';
2
+ import type { TableMap } from '@atlaskit/editor-tables/table-map';
3
+ import type { TableDirection } from '../types';
4
+ export interface DragMenuConfig extends DropdownOptionT<Command> {
5
+ id: string;
6
+ }
7
+ export declare const getDragMenuConfig: (direction: TableDirection, tableMap?: TableMap, index?: number) => DragMenuConfig[];
@@ -2,7 +2,7 @@ export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, is
2
2
  export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnInsertLine, createColumnLineResize, createRowInsertLine, } from './decoration';
3
3
  export { isIsolating, containsHeaderColumn, containsHeaderRow, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isLayoutSupported, getTableWidth, tablesHaveDifferentColumnWidths, tablesHaveDifferentNoOfColumns, isTableNested, anyChildCellMergedAcrossRow, supportedHeaderRow, } from './nodes';
4
4
  export { unwrapContentFromTable, removeTableFromFirstChild, removeTableFromLastChild, transformSliceToRemoveOpenTable, transformSliceToCorrectEmptyTableCells, transformSliceToFixHardBreakProblemOnCopyFromCell, } from './paste';
5
- export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
5
+ export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isRowDragControlsButton, isRowControlsButton, isDragColumnFloatingInsertDot, isDragRowFloatingInsertDot, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
6
6
  export { getColumnsWidths, isColumnDeleteButtonVisible, getColumnDeleteButtonParams, getColumnClassNames, } from './column-controls';
7
7
  export { getRowHeights, isRowDeleteButtonVisible, getRowDeleteButtonParams, getRowsParams, getRowClassNames, copyPreviousRow, } from './row-controls';
8
8
  export type { RowParams } from './row-controls';
@@ -1,4 +1,5 @@
1
1
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
2
+ import type { TableDirection } from '../../types';
2
3
  import type { DropTargetType } from './consts';
3
4
  export interface DragAndDropAction<T, D> {
4
5
  type: T;
@@ -7,6 +8,7 @@ export interface DragAndDropAction<T, D> {
7
8
  export declare const DragAndDropActionType: {
8
9
  readonly SET_DROP_TARGET: "SET_DROP_TARGET";
9
10
  readonly CLEAR_DROP_TARGET: "CLEAR_DROP_TARGET";
11
+ readonly TOGGLE_DRAG_MENU: "TOGGLE_DRAG_MENU";
10
12
  };
11
13
  export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
12
14
  type: DropTargetType;
@@ -16,4 +18,9 @@ export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDro
16
18
  export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, {
17
19
  decorationSet: DecorationSet;
18
20
  }>;
19
- export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction;
21
+ export type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDropActionType.TOGGLE_DRAG_MENU, {
22
+ isDragMenuOpen: boolean;
23
+ direction: TableDirection;
24
+ index: number;
25
+ }>;
26
+ export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
@@ -1,7 +1,7 @@
1
1
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { Decoration } from '@atlaskit/editor-prosemirror/view';
3
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
- import type { DraggableType } from '../../types';
4
+ import type { DraggableType, TableDirection } from '../../types';
5
5
  import { TableDecorations } from '../../types';
6
6
  import { DropTargetType } from './consts';
7
7
  export declare const getDecorations: (state: EditorState) => DecorationSet;
@@ -9,3 +9,4 @@ export declare const updatePluginStateDecorations: (state: EditorState, decorati
9
9
  export declare const setDropTarget: (type: DropTargetType, index: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
10
10
  export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
11
11
  export declare const moveSource: (sourceType: DraggableType, sourceIndex: number, targetIndex: number) => import("@atlaskit/editor-common/types").Command;
12
+ export declare const toggleDragMenu: (isDragMenuOpen: boolean | undefined, direction?: TableDirection, index?: number) => import("@atlaskit/editor-common/types").Command;
@@ -1,7 +1,11 @@
1
1
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
2
+ import type { TableDirection } from '../../types';
2
3
  import type { DropTargetType } from './consts';
3
4
  export interface DragAndDropPluginState {
4
5
  decorationSet: DecorationSet;
5
6
  dropTargetType: DropTargetType;
6
7
  dropTargetIndex: number;
8
+ isDragMenuOpen: boolean;
9
+ dragMenuDirection?: TableDirection;
10
+ dragMenuIndex: number;
7
11
  }
@@ -269,6 +269,9 @@ export declare const TableCssClassName: {
269
269
  CONTROLS_INSERT_LINE: string;
270
270
  CONTROLS_BUTTON_OVERLAY: string;
271
271
  LAYOUT_BUTTON: string;
272
+ DRAG_CONTROLS_INSERT_BUTTON: string;
273
+ DRAG_CONTROLS_INSERT_BUTTON_INNER: string;
274
+ DRAG_CONTROLS_INSERT_BUTTON_WRAP: string;
272
275
  CONTROLS_INSERT_MARKER: string;
273
276
  CONTROLS_INSERT_COLUMN: string;
274
277
  CONTROLS_INSERT_ROW: string;
@@ -281,8 +284,12 @@ export declare const TableCssClassName: {
281
284
  CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
282
285
  CONTROLS_CORNER_BUTTON: string;
283
286
  /** Controls with drag handle */
284
- COLUMN_CONTROLS_WITH_DRAG: string;
285
- ROW_CONTROLS_WITH_DRAG: string;
287
+ DRAG_ROW_CONTROLS: string;
288
+ DRAG_ROW_FLOATING_INSERT_DOT_WRAPPER: string;
289
+ DRAG_ROW_FLOATING_INSERT_DOT: string;
290
+ DRAG_COLUMN_CONTROLS: string;
291
+ DRAG_COLUMN_FLOATING_INSERT_DOT_WRAPPER: string;
292
+ DRAG_COLUMN_FLOATING_INSERT_DOT: string;
286
293
  DRAG_HANDLE_BUTTON_CONTAINER: string;
287
294
  /** Other classes */
288
295
  NUMBERED_COLUMN: string;
@@ -373,6 +380,7 @@ export type InvalidNodeAttr = {
373
380
  spanValue: number;
374
381
  tableLocalId: string;
375
382
  };
383
+ export type TableDirection = 'row' | 'column';
376
384
  /**
377
385
  * Drag and Drop interfaces
378
386
  */
@@ -1,15 +1,17 @@
1
1
  import type { MouseEventHandler } from 'react';
2
+ import type { TableDirection } from '../../types';
2
3
  type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
3
4
  type DragHandleProps = {
4
5
  tableLocalId: string;
5
6
  indexes: number[];
6
7
  previewWidth?: number;
7
8
  previewHeight?: number;
8
- direction?: 'column' | 'row';
9
+ direction?: TableDirection;
9
10
  appearance?: DragHandleAppearance;
10
11
  onClick?: MouseEventHandler;
11
12
  onMouseOver?: MouseEventHandler;
12
13
  onMouseOut?: MouseEventHandler;
14
+ onMouseUp?: MouseEventHandler;
13
15
  };
14
- export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onClick, }: DragHandleProps) => JSX.Element;
16
+ export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onMouseUp, onClick, }: DragHandleProps) => JSX.Element;
15
17
  export {};
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import type { TableDirection } from '../../types';
2
3
  export declare const DragPreview: ({ direction, width, height, }: {
3
- direction: 'column' | 'row';
4
+ direction: TableDirection;
4
5
  width: number;
5
6
  height: number;
6
7
  }) => JSX.Element;
@@ -3,6 +3,7 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
6
+ import type { TableDirection } from '../../types';
6
7
  import type { CellSelectionType } from './types';
7
8
  export interface Props {
8
9
  editorView: EditorView;
@@ -23,7 +24,7 @@ export interface State {
23
24
  position?: string;
24
25
  scrollLeft: number;
25
26
  }
26
- export declare function getSelectionType(selection: Selection): 'column' | 'row' | undefined;
27
+ export declare function getSelectionType(selection: Selection): TableDirection | undefined;
27
28
  declare class FloatingDeleteButton extends Component<Props, State> {
28
29
  static displayName: string;
29
30
  wrapper: HTMLElement | null;
@@ -1 +1,2 @@
1
- export type CellSelectionType = 'column' | 'row' | undefined;
1
+ import type { TableDirection } from '../../types';
2
+ export type CellSelectionType = TableDirection | undefined;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { PluginConfig, TableDirection } from '../../types';
5
+ type DragMenuProps = {
6
+ direction?: TableDirection;
7
+ index?: number;
8
+ tableRef?: HTMLTableElement;
9
+ tableNode?: PmNode;
10
+ editorView: EditorView;
11
+ isOpen?: boolean;
12
+ targetCellPosition?: number;
13
+ mountPoint?: HTMLElement;
14
+ boundariesElement?: HTMLElement;
15
+ scrollableElement?: HTMLElement;
16
+ pluginConfig?: PluginConfig;
17
+ };
18
+ export declare const DragMenu: ({ direction, index, isOpen, editorView, tableNode, mountPoint, boundariesElement, scrollableElement, }: DragMenuProps) => JSX.Element | null;
19
+ export {};
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { TableDirection } from '../../types';
5
+ export interface Props {
6
+ editorView: EditorView;
7
+ isOpen: boolean;
8
+ tableRef?: HTMLTableElement;
9
+ tableNode?: PmNode;
10
+ mountPoint?: HTMLElement;
11
+ boundariesElement?: HTMLElement;
12
+ scrollableElement?: HTMLElement;
13
+ direction?: TableDirection;
14
+ index?: number;
15
+ targetCellPosition?: number;
16
+ }
17
+ declare const FloatingDragMenu: {
18
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableRef, tableNode, direction, index, targetCellPosition, }: Props): JSX.Element | null;
19
+ displayName: string;
20
+ };
21
+ export default FloatingDragMenu;
@@ -1,12 +1,17 @@
1
1
  import type { SyntheticEvent } from 'react';
2
2
  import React from 'react';
3
3
  import type { WrappedComponentProps } from 'react-intl-next';
4
+ import type { TableDirection } from '../../types';
4
5
  export interface ButtonProps {
5
- type: 'row' | 'column';
6
+ type: TableDirection;
6
7
  tableRef: HTMLElement;
7
8
  onMouseDown: (event: SyntheticEvent<HTMLButtonElement>) => void;
8
9
  hasStickyHeaders: boolean;
9
10
  }
11
+ export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
12
+ export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
13
+ WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
14
+ };
10
15
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps<"intl">>> & {
11
16
  WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps<"intl">>;
12
17
  };
@@ -1,3 +1,4 @@
1
1
  import type { PopupProps } from '@atlaskit/editor-common/ui';
2
- declare function getPopupOptions(type: 'column' | 'row', index: number, hasNumberedColumns: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
2
+ import type { TableDirection } from '../../types';
3
+ declare function getPopupOptions(direction: TableDirection, index: number, hasNumberedColumns: boolean, isDragAndDropEnabled: boolean, tableContainer: HTMLElement | null): Partial<PopupProps>;
3
4
  export default getPopupOptions;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { WrappedComponentProps } from 'react-intl-next';
3
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
4
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
6
- import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
7
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
6
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
7
  export interface Props {
9
8
  editorView: EditorView;
10
9
  getEditorContainerWidth: GetEditorContainerWidth;
@@ -14,6 +13,7 @@ export interface Props {
14
13
  insertRowButtonIndex?: number;
15
14
  isHeaderColumnEnabled?: boolean;
16
15
  isHeaderRowEnabled?: boolean;
16
+ isDragAndDropEnabled?: boolean;
17
17
  mountPoint?: HTMLElement;
18
18
  boundariesElement?: HTMLElement;
19
19
  scrollableElement?: HTMLElement;
@@ -12,6 +12,7 @@ export interface ColumnControlsProps {
12
12
  localId?: string;
13
13
  rowHeights?: number[];
14
14
  colWidths?: (number | undefined)[];
15
+ hasHeaderColumn?: boolean;
15
16
  }
16
- export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
17
+ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, hasHeaderColumn, }: ColumnControlsProps) => JSX.Element;
17
18
  export default ColumnControls;
@@ -1,13 +1,17 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
5
  import type { CellHoverMeta } from '../../../types';
5
6
  type DragControlsProps = {
6
7
  editorView: EditorView;
7
8
  tableRef: HTMLTableElement;
9
+ tableNode?: PmNode;
8
10
  tableActive?: boolean;
9
11
  hoveredCell?: CellHoverMeta;
10
12
  isInDanger?: boolean;
13
+ isResizing?: boolean;
14
+ hasHeaderRow?: boolean;
11
15
  hoverRows: (rows: number[], danger?: boolean) => void;
12
16
  selectRow: (row: number, expand: boolean) => void;
13
17
  updateCellHoverLocation: (rowIndex: number) => void;