@atlaskit/editor-plugin-table 5.3.0 → 5.3.2

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 (186) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/plugins/table/commands/hover.js +17 -8
  3. package/dist/cjs/plugins/table/commands/index.js +6 -0
  4. package/dist/cjs/plugins/table/commands/misc.js +1 -7
  5. package/dist/cjs/plugins/table/event-handlers.js +29 -2
  6. package/dist/cjs/plugins/table/index.js +1 -1
  7. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +5 -3
  8. package/dist/cjs/plugins/table/nodeviews/table.js +4 -2
  9. package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +7 -3
  10. package/dist/cjs/plugins/table/pm-plugins/decorations/utils/column-controls.js +7 -2
  11. package/dist/cjs/plugins/table/pm-plugins/default-table-selection.js +14 -1
  12. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/commands.js +36 -7
  13. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/plugin.js +69 -7
  14. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/reducer.js +2 -0
  15. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/utils/index.js +12 -0
  16. package/dist/cjs/plugins/table/pm-plugins/drag-and-drop/utils/monitor.js +59 -0
  17. package/dist/cjs/plugins/table/pm-plugins/main.js +5 -5
  18. package/dist/cjs/plugins/table/reducer.js +2 -1
  19. package/dist/cjs/plugins/table/types.js +14 -1
  20. package/dist/cjs/plugins/table/ui/DragHandle/index.js +50 -0
  21. package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +53 -14
  22. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.js +114 -0
  23. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +53 -0
  24. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/index.js +11 -106
  25. package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +16 -6
  26. package/dist/cjs/plugins/table/ui/common-styles.js +9 -6
  27. package/dist/cjs/plugins/table/ui/consts.js +3 -1
  28. package/dist/cjs/plugins/table/ui/ui-styles.js +21 -9
  29. package/dist/cjs/plugins/table/utils/decoration.js +111 -19
  30. package/dist/cjs/plugins/table/utils/dom.js +7 -1
  31. package/dist/cjs/plugins/table/utils/index.js +38 -1
  32. package/dist/cjs/plugins/table/utils/merged-cells.js +66 -0
  33. package/dist/es2019/plugins/table/commands/hover.js +12 -8
  34. package/dist/es2019/plugins/table/commands/index.js +1 -1
  35. package/dist/es2019/plugins/table/commands/misc.js +1 -7
  36. package/dist/es2019/plugins/table/event-handlers.js +28 -2
  37. package/dist/es2019/plugins/table/index.js +1 -1
  38. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +5 -3
  39. package/dist/es2019/plugins/table/nodeviews/table.js +4 -2
  40. package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +8 -6
  41. package/dist/es2019/plugins/table/pm-plugins/decorations/utils/column-controls.js +7 -2
  42. package/dist/es2019/plugins/table/pm-plugins/default-table-selection.js +13 -0
  43. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/commands.js +35 -7
  44. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/plugin.js +69 -4
  45. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/reducer.js +2 -0
  46. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/utils/index.js +1 -0
  47. package/dist/es2019/plugins/table/pm-plugins/drag-and-drop/utils/monitor.js +56 -0
  48. package/dist/es2019/plugins/table/pm-plugins/main.js +6 -5
  49. package/dist/es2019/plugins/table/reducer.js +2 -1
  50. package/dist/es2019/plugins/table/types.js +14 -1
  51. package/dist/es2019/plugins/table/ui/DragHandle/index.js +41 -0
  52. package/dist/es2019/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +54 -10
  53. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.js +86 -0
  54. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +43 -0
  55. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/index.js +2 -88
  56. package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +17 -7
  57. package/dist/es2019/plugins/table/ui/common-styles.js +49 -13
  58. package/dist/es2019/plugins/table/ui/consts.js +2 -0
  59. package/dist/es2019/plugins/table/ui/ui-styles.js +171 -15
  60. package/dist/es2019/plugins/table/utils/decoration.js +106 -18
  61. package/dist/es2019/plugins/table/utils/dom.js +2 -0
  62. package/dist/es2019/plugins/table/utils/index.js +4 -3
  63. package/dist/es2019/plugins/table/utils/merged-cells.js +48 -0
  64. package/dist/esm/plugins/table/commands/hover.js +16 -8
  65. package/dist/esm/plugins/table/commands/index.js +1 -1
  66. package/dist/esm/plugins/table/commands/misc.js +1 -7
  67. package/dist/esm/plugins/table/event-handlers.js +29 -2
  68. package/dist/esm/plugins/table/index.js +1 -1
  69. package/dist/esm/plugins/table/nodeviews/TableComponent.js +5 -3
  70. package/dist/esm/plugins/table/nodeviews/table.js +4 -2
  71. package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +8 -6
  72. package/dist/esm/plugins/table/pm-plugins/decorations/utils/column-controls.js +7 -2
  73. package/dist/esm/plugins/table/pm-plugins/default-table-selection.js +13 -0
  74. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/commands.js +36 -7
  75. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/plugin.js +65 -4
  76. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/reducer.js +2 -0
  77. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/utils/index.js +1 -0
  78. package/dist/esm/plugins/table/pm-plugins/drag-and-drop/utils/monitor.js +53 -0
  79. package/dist/esm/plugins/table/pm-plugins/main.js +7 -7
  80. package/dist/esm/plugins/table/reducer.js +2 -1
  81. package/dist/esm/plugins/table/types.js +14 -1
  82. package/dist/esm/plugins/table/ui/DragHandle/index.js +41 -0
  83. package/dist/esm/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +54 -15
  84. package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.js +104 -0
  85. package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +46 -0
  86. package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/index.js +2 -104
  87. package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +17 -7
  88. package/dist/esm/plugins/table/ui/common-styles.js +11 -8
  89. package/dist/esm/plugins/table/ui/consts.js +2 -0
  90. package/dist/esm/plugins/table/ui/ui-styles.js +21 -9
  91. package/dist/esm/plugins/table/utils/decoration.js +110 -18
  92. package/dist/esm/plugins/table/utils/dom.js +6 -0
  93. package/dist/esm/plugins/table/utils/index.js +4 -3
  94. package/dist/esm/plugins/table/utils/merged-cells.js +60 -0
  95. package/dist/types/plugins/table/commands/hover.d.ts +2 -1
  96. package/dist/types/plugins/table/commands/index.d.ts +1 -1
  97. package/dist/types/plugins/table/event-handlers.d.ts +1 -0
  98. package/dist/types/plugins/table/nodeviews/types.d.ts +4 -3
  99. package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -1
  100. package/dist/types/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +1 -1
  101. package/dist/types/plugins/table/pm-plugins/default-table-selection.d.ts +12 -0
  102. package/dist/types/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +5 -1
  103. package/dist/types/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +6 -1
  104. package/dist/types/plugins/table/pm-plugins/drag-and-drop/utils/index.d.ts +1 -0
  105. package/dist/types/plugins/table/pm-plugins/drag-and-drop/utils/monitor.d.ts +3 -0
  106. package/dist/types/plugins/table/pm-plugins/main.d.ts +1 -1
  107. package/dist/types/plugins/table/types.d.ts +35 -2
  108. package/dist/types/plugins/table/ui/DragHandle/index.d.ts +11 -0
  109. package/dist/types/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +4 -1
  110. package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +17 -0
  111. package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +16 -0
  112. package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +2 -17
  113. package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +3 -2
  114. package/dist/types/plugins/table/ui/consts.d.ts +2 -0
  115. package/dist/types/plugins/table/ui/ui-styles.d.ts +1 -0
  116. package/dist/types/plugins/table/utils/decoration.d.ts +4 -2
  117. package/dist/types/plugins/table/utils/dom.d.ts +2 -0
  118. package/dist/types/plugins/table/utils/index.d.ts +3 -2
  119. package/dist/types/plugins/table/utils/merged-cells.d.ts +3 -0
  120. package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +2 -1
  121. package/dist/types-ts4.5/plugins/table/commands/index.d.ts +1 -1
  122. package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -0
  123. package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +4 -3
  124. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -1
  125. package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +1 -1
  126. package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +12 -0
  127. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/actions.d.ts +5 -1
  128. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/commands.d.ts +6 -1
  129. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/utils/index.d.ts +1 -0
  130. package/dist/types-ts4.5/plugins/table/pm-plugins/drag-and-drop/utils/monitor.d.ts +3 -0
  131. package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +1 -1
  132. package/dist/types-ts4.5/plugins/table/types.d.ts +35 -2
  133. package/dist/types-ts4.5/plugins/table/ui/DragHandle/index.d.ts +11 -0
  134. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +4 -1
  135. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +17 -0
  136. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +16 -0
  137. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +2 -17
  138. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +3 -2
  139. package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +2 -0
  140. package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +1 -0
  141. package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +4 -2
  142. package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +2 -0
  143. package/dist/types-ts4.5/plugins/table/utils/index.d.ts +3 -2
  144. package/dist/types-ts4.5/plugins/table/utils/merged-cells.d.ts +3 -0
  145. package/package.json +6 -2
  146. package/src/__tests__/unit/event-handlers.ts +74 -1
  147. package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +35 -15
  148. package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +146 -42
  149. package/src/__tests__/unit/ui/NumberColumn.tsx +148 -0
  150. package/src/__tests__/unit/ui/RowControls.tsx +4 -4
  151. package/src/__tests__/unit/ui/RowDragControls.tsx +118 -0
  152. package/src/__tests__/unit/ui/TableFloatingControls.tsx +9 -5
  153. package/src/plugins/table/commands/hover.ts +16 -7
  154. package/src/plugins/table/commands/index.ts +1 -0
  155. package/src/plugins/table/commands/misc.ts +0 -5
  156. package/src/plugins/table/event-handlers.ts +49 -2
  157. package/src/plugins/table/index.tsx +1 -1
  158. package/src/plugins/table/nodeviews/TableComponent.tsx +3 -2
  159. package/src/plugins/table/nodeviews/table.tsx +2 -0
  160. package/src/plugins/table/nodeviews/types.ts +4 -3
  161. package/src/plugins/table/pm-plugins/decorations/plugin.ts +13 -4
  162. package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +10 -5
  163. package/src/plugins/table/pm-plugins/default-table-selection.ts +10 -0
  164. package/src/plugins/table/pm-plugins/drag-and-drop/actions.ts +6 -1
  165. package/src/plugins/table/pm-plugins/drag-and-drop/commands.ts +58 -8
  166. package/src/plugins/table/pm-plugins/drag-and-drop/plugin.ts +77 -4
  167. package/src/plugins/table/pm-plugins/drag-and-drop/reducer.ts +2 -0
  168. package/src/plugins/table/pm-plugins/drag-and-drop/utils/index.ts +1 -0
  169. package/src/plugins/table/pm-plugins/drag-and-drop/utils/monitor.ts +72 -0
  170. package/src/plugins/table/pm-plugins/main.ts +9 -4
  171. package/src/plugins/table/reducer.ts +2 -1
  172. package/src/plugins/table/types.ts +37 -3
  173. package/src/plugins/table/ui/DragHandle/index.tsx +57 -0
  174. package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +68 -30
  175. package/src/plugins/table/ui/TableFloatingControls/RowControls/ClassicControls.tsx +129 -0
  176. package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +75 -0
  177. package/src/plugins/table/ui/TableFloatingControls/RowControls/index.tsx +2 -135
  178. package/src/plugins/table/ui/TableFloatingControls/index.tsx +43 -24
  179. package/src/plugins/table/ui/common-styles.ts +54 -11
  180. package/src/plugins/table/ui/consts.ts +2 -0
  181. package/src/plugins/table/ui/ui-styles.ts +173 -14
  182. package/src/plugins/table/utils/decoration.ts +176 -27
  183. package/src/plugins/table/utils/dom.ts +8 -0
  184. package/src/plugins/table/utils/index.ts +5 -0
  185. package/src/plugins/table/utils/merged-cells.ts +67 -0
  186. package/tsconfig.app.json +3 -0
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'react';
2
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  export interface Props {
4
4
  editorView: EditorView;
5
5
  tableRef: HTMLTableElement;
@@ -11,11 +11,14 @@ export interface Props {
11
11
  isInDanger?: boolean;
12
12
  isResizing?: boolean;
13
13
  stickyTop?: number;
14
+ isDragAndDropEnabled?: boolean;
14
15
  }
15
16
  export default class NumberColumn extends Component<Props, any> {
16
17
  render(): JSX.Element;
17
18
  private hoverRows;
18
19
  private selectRow;
19
20
  private clearHoverSelection;
21
+ private updateDragHandleLocation;
22
+ private getCellStyles;
20
23
  private getClassNames;
21
24
  }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ export interface Props {
5
+ editorView: EditorView;
6
+ tableRef: HTMLTableElement;
7
+ selectRow: (row: number, expand: boolean) => void;
8
+ hoverRows: (rows: number[], danger?: boolean) => void;
9
+ hoveredRows?: number[];
10
+ isInDanger?: boolean;
11
+ isResizing?: boolean;
12
+ insertRowButtonIndex?: number;
13
+ stickyTop?: number;
14
+ }
15
+ export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
17
+ };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { CellHoverCoordinates } from '../../../types';
5
+ type DragControlsProps = {
6
+ editorView: EditorView;
7
+ tableRef: HTMLTableElement;
8
+ tableActive?: boolean;
9
+ hoveredCell?: CellHoverCoordinates;
10
+ hoverRows?: (rows: number[], danger?: boolean) => void;
11
+ selectRow?: (row: number, expand: boolean) => void;
12
+ };
13
+ export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps<"intl">>> & {
14
+ WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps<"intl">>;
15
+ };
16
+ export {};
@@ -1,17 +1,2 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export interface Props {
5
- editorView: EditorView;
6
- tableRef: HTMLTableElement;
7
- selectRow: (row: number, expand: boolean) => void;
8
- hoverRows: (rows: number[], danger?: boolean) => void;
9
- hoveredRows?: number[];
10
- isInDanger?: boolean;
11
- isResizing?: boolean;
12
- insertRowButtonIndex?: number;
13
- stickyTop?: number;
14
- }
15
- export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
17
- };
1
+ export { RowControls } from './ClassicControls';
2
+ export { DragControls } from './DragControls';
@@ -1,12 +1,11 @@
1
1
  import { Component } from 'react';
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
5
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
6
+ import type { CellHoverCoordinates } from '../../types';
7
7
  export interface Props {
8
8
  editorView: EditorView;
9
- getEditorFeatureFlags: GetEditorFeatureFlags;
10
9
  selection?: Selection;
11
10
  tableRef?: HTMLTableElement;
12
11
  tableActive?: boolean;
@@ -15,9 +14,11 @@ export interface Props {
15
14
  isHeaderRowEnabled?: boolean;
16
15
  isHeaderColumnEnabled?: boolean;
17
16
  isNumberColumnEnabled?: boolean;
17
+ isDragAndDropEnabled?: boolean;
18
18
  hasHeaderRow?: boolean;
19
19
  headerRowHeight?: number;
20
20
  hoveredRows?: number[];
21
+ hoveredCell?: CellHoverCoordinates;
21
22
  ordering?: TableColumnOrdering;
22
23
  stickyHeader?: RowStickyState;
23
24
  }
@@ -33,7 +33,9 @@ export declare const lineMarkerSize = 4;
33
33
  export declare const columnControlsDecorationHeight = 25;
34
34
  export declare const columnControlsZIndex: number;
35
35
  export declare const columnControlsSelectedZIndex: number;
36
+ export declare const rowControlsZIndex: number;
36
37
  export declare const columnResizeHandleZIndex: number;
38
+ export declare const insertLineWidth = 3;
37
39
  export declare const resizeHandlerAreaWidth: number;
38
40
  export declare const resizeLineWidth = 2;
39
41
  export declare const resizeHandlerZIndex: number;
@@ -14,3 +14,4 @@ export declare const hoveredDeleteButton: (props: ThemeProps) => import("@emotio
14
14
  export declare const hoveredCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
15
15
  export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
16
16
  export declare const resizeHandle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
17
+ export declare const insertLine: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -3,14 +3,16 @@ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
5
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
- import type { Cell, CellColumnPositioning } from '../types';
6
+ import type { Cell, CellColumnPositioning, CellHoverCoordinates } from '../types';
7
7
  import { TableDecorations } from '../types';
8
8
  export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
9
9
  export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
10
10
  export declare const createCellHoverDecoration: (cells: Cell[]) => Decoration[];
11
11
  export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean, selected?: boolean) => Decoration[];
12
12
  export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
13
- export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
13
+ export declare const createColumnControlsDecoration: (selection: Selection, hoverLocation?: CellHoverCoordinates) => Decoration[];
14
14
  export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
15
15
  export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [Decoration[], Decoration[]];
16
16
  export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => Decoration[];
17
+ export declare const createColumnInsertLine: (columnIndex: number, selection: Selection) => Decoration[];
18
+ export declare const createRowInsertLine: (rowIndex: number, selection: Selection) => Decoration[];
@@ -4,7 +4,9 @@ export declare const isCornerButton: (node: HTMLElement | null) => boolean;
4
4
  export declare const isInsertRowButton: (node: HTMLElement | null) => boolean | HTMLElement | null;
5
5
  export declare const getColumnOrRowIndex: (target: HTMLElement) => [number, number];
6
6
  export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
7
+ export declare const isColumnDragControlsDecorations: (node: HTMLElement | null) => true | HTMLElement | null;
7
8
  export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
9
+ export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
8
10
  export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
9
11
  export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
10
12
  export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
@@ -1,11 +1,12 @@
1
1
  export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, isSelectionUpdated, } from './selection';
2
- export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnLineResize, } from './decoration';
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, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
5
+ export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isColumnDragControlsDecorations, isRowDragControlsButton, isRowControlsButton, 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';
9
9
  export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
10
10
  export { getMergedCellsPositions } from './table';
11
11
  export { updatePluginStateDecorations } from './update-plugin-state-decorations';
12
+ export { hasMergedCellsInColumn, hasMergedCellsInRow } from './merged-cells';
@@ -0,0 +1,3 @@
1
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
2
+ export declare const hasMergedCellsInColumn: (columnIndexes: number | number[]) => (selection: Selection) => boolean;
3
+ export declare const hasMergedCellsInRow: (rowIndexes: number | number[]) => (selection: Selection) => boolean;
@@ -1,4 +1,4 @@
1
- import { CellColumnPositioning } from '../types';
1
+ import type { CellColumnPositioning } from '../types';
2
2
  export declare const hoverMergedCells: () => import("@atlaskit/editor-common/types").Command;
3
3
  export declare const hoverColumns: (hoveredColumns: number[], isInDanger?: boolean) => import("@atlaskit/editor-common/types").Command;
4
4
  export declare const hoverRows: (hoveredRows: number[], isInDanger?: boolean) => import("@atlaskit/editor-common/types").Command;
@@ -6,3 +6,4 @@ export declare const hoverTable: (isInDanger?: boolean, isSelected?: boolean) =>
6
6
  export declare const clearHoverSelection: () => import("@atlaskit/editor-common/types").Command;
7
7
  export declare const showResizeHandleLine: (cellColumnPositioning: CellColumnPositioning) => import("@atlaskit/editor-common/types").Command;
8
8
  export declare const hideResizeHandleLine: () => import("@atlaskit/editor-common/types").Command;
9
+ export declare const hoverCell: (rowIndex?: number, colIndex?: number) => import("@atlaskit/editor-common/types").Command;
@@ -1,4 +1,4 @@
1
- export { hoverColumns, hoverRows, hoverTable, hoverMergedCells, clearHoverSelection, showResizeHandleLine, hideResizeHandleLine, } from './hover';
1
+ export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clearHoverSelection, showResizeHandleLine, hideResizeHandleLine, } from './hover';
2
2
  export { insertColumn, insertRow, createTable } from './insert';
3
3
  export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
4
4
  export { clearMultipleCells } from './clear';
@@ -13,3 +13,4 @@ export declare const handleMouseMove: (view: EditorView, event: Event, elementCo
13
13
  export declare function handleTripleClick(view: EditorView, pos: number): boolean;
14
14
  export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView) => Transaction;
15
15
  export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
16
+ export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
@@ -1,14 +1,15 @@
1
- import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
1
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
2
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
3
3
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- import { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { PluginInjectionAPI } from '../types';
7
7
  export type TableOptions = {
8
8
  isBreakoutEnabled?: boolean;
9
9
  isFullWidthModeEnabled?: boolean;
10
10
  wasFullWidthModeEnabled?: boolean;
11
11
  isTableResizingEnabled?: boolean;
12
+ isDragAndDropEnabled?: boolean;
12
13
  };
13
14
  export interface Props {
14
15
  node: PmNode;
@@ -1,5 +1,6 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { EditorState, PluginKey, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { EditorState, ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
3
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
4
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
5
  export declare const pluginKey: PluginKey<any>;
5
6
  export declare const getDecorations: (state: EditorState) => DecorationSet;
@@ -1,3 +1,3 @@
1
- import { DecorationTransformer } from './types';
1
+ import type { DecorationTransformer } from './types';
2
2
  export declare const maybeUpdateColumnControlsSelectedDecoration: DecorationTransformer;
3
3
  export declare const buildColumnControlsDecorations: DecorationTransformer;
@@ -2,3 +2,15 @@ export declare const defaultTableSelection: {
2
2
  hoveredColumns: never[];
3
3
  hoveredRows: never[];
4
4
  };
5
+ /**
6
+ * Creating a separate object for hoveredCell so it doesn't get defaulted when `handleDocOrSelectionChanged` runs.
7
+ *
8
+ * It is safe to persist this value as it gets removed when the mouse cursor leaves the table, so no need to remove it
9
+ * when doc changes.
10
+ */
11
+ export declare const defaultHoveredCell: {
12
+ hoveredCell: {
13
+ rowIndex: undefined;
14
+ colIndex: undefined;
15
+ };
16
+ };
@@ -1,3 +1,4 @@
1
+ import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
1
2
  import type { DropTargetType } from './consts';
2
3
  export interface DragAndDropAction<T, D> {
3
4
  type: T;
@@ -10,6 +11,9 @@ export declare const DragAndDropActionType: {
10
11
  export type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
11
12
  type: DropTargetType;
12
13
  index: number;
14
+ decorationSet: DecorationSet;
15
+ }>;
16
+ export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, {
17
+ decorationSet: DecorationSet;
13
18
  }>;
14
- export type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, undefined>;
15
19
  export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction;
@@ -1,4 +1,9 @@
1
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
1
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
2
+ import type { Decoration } from '@atlaskit/editor-prosemirror/view';
3
+ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
+ import { TableDecorations } from '../../types';
2
5
  import type { DropTargetType } from './consts';
6
+ export declare const getDecorations: (state: EditorState) => DecorationSet;
7
+ export declare const updatePluginStateDecorations: (state: EditorState, decorations: Decoration[], key: TableDecorations) => DecorationSet;
3
8
  export declare const setDropTarget: (type: DropTargetType, index: number, tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
4
9
  export declare const clearDropTarget: (tr?: Transaction) => import("@atlaskit/editor-common/types").Command;
@@ -0,0 +1 @@
1
+ export { getDraggableDataFromEvent } from './monitor';
@@ -0,0 +1,3 @@
1
+ import type { ElementEventBasePayload } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';
2
+ import type { DraggableData } from '../../../types';
3
+ export declare const getDraggableDataFromEvent: ({ location, source, }: ElementEventBasePayload) => DraggableData | undefined;
@@ -5,4 +5,4 @@ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider'
5
5
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
6
  import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
7
7
  import type { PluginConfig, PluginInjectionAPI } from '../types';
8
- export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, fullWidthModeEnabled?: boolean, tableResizingEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
8
+ export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, breakoutEnabled?: boolean, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI) => SafePlugin<import("../types").TablePluginState>;
@@ -7,6 +7,7 @@ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
8
8
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
9
9
  import type { Rect } from '@atlaskit/editor-tables/table-map';
10
+ import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge';
10
11
  import type tablePlugin from './index';
11
12
  export declare const RESIZE_HANDLE_AREA_DECORATION_GAP = 30;
12
13
  export type RowInsertPosition = 'TOP' | 'BOTTOM';
@@ -43,10 +44,15 @@ export interface PluginConfig {
43
44
  }
44
45
  export type { ColumnResizingPluginState } from '@atlaskit/editor-common/types';
45
46
  export type CellColumnPositioning = Pick<Rect, 'right' | 'left'>;
47
+ export type CellHoverCoordinates = {
48
+ colIndex?: number;
49
+ rowIndex?: number;
50
+ };
46
51
  export interface TablePluginState {
47
52
  editorHasFocus?: boolean;
48
53
  hoveredColumns: number[];
49
54
  hoveredRows: number[];
55
+ hoveredCell: CellHoverCoordinates;
50
56
  pluginConfig: PluginConfig;
51
57
  isHeaderColumnEnabled: boolean;
52
58
  isHeaderRowEnabled: boolean;
@@ -107,7 +113,7 @@ export type TablePluginAction = {
107
113
  isInDanger?: boolean;
108
114
  };
109
115
  } | {
110
- type: 'HOVER_CELLS';
116
+ type: 'HOVER_MERGED_CELLS';
111
117
  data: {
112
118
  decorationSet: DecorationSet;
113
119
  };
@@ -162,6 +168,9 @@ export type TablePluginAction = {
162
168
  data: {
163
169
  decorationSet: DecorationSet;
164
170
  };
171
+ } | {
172
+ type: 'HOVER_CELL';
173
+ data: CellHoverCoordinates;
165
174
  } | {
166
175
  type: 'SET_TARGET_CELL_POSITION';
167
176
  data: {
@@ -219,6 +228,7 @@ export type ColumnResizingPluginAction = {
219
228
  };
220
229
  };
221
230
  export declare enum TableDecorations {
231
+ /** Classic controls */
222
232
  ALL_CONTROLS_HOVER = "CONTROLS_HOVER",
223
233
  ROW_CONTROLS_HOVER = "ROW_CONTROLS_HOVER",
224
234
  COLUMN_CONTROLS_HOVER = "COLUMN_CONTROLS_HOVER",
@@ -230,9 +240,12 @@ export declare enum TableDecorations {
230
240
  COLUMN_RESIZING_HANDLE = "COLUMN_RESIZING_HANDLE",
231
241
  COLUMN_RESIZING_HANDLE_WIDGET = "COLUMN_RESIZING_HANDLE_WIDGET",
232
242
  COLUMN_RESIZING_HANDLE_LINE = "COLUMN_RESIZING_HANDLE_LINE",
243
+ COLUMN_INSERT_LINE = "COLUMN_INSERT_LINE",
244
+ ROW_INSERT_LINE = "ROW_INSERT_LINE",
233
245
  LAST_CELL_ELEMENT = "LAST_CELL_ELEMENT"
234
246
  }
235
247
  export declare const TableCssClassName: {
248
+ /** Classic controls */
236
249
  COLUMN_CONTROLS: string;
237
250
  COLUMN_CONTROLS_DECORATIONS: string;
238
251
  COLUMN_SELECTED: string;
@@ -263,8 +276,13 @@ export declare const TableCssClassName: {
263
276
  CORNER_CONTROLS_INSERT_ROW_MARKER: string;
264
277
  CORNER_CONTROLS_INSERT_COLUMN_MARKER: string;
265
278
  CONTROLS_CORNER_BUTTON: string;
279
+ /** Controls with drag handle */
280
+ COLUMN_CONTROLS_DECORATIONS_WITH_DRAG: string;
281
+ ROW_CONTROLS_WITH_DRAG: string;
282
+ /** Other classes */
266
283
  NUMBERED_COLUMN: string;
267
284
  NUMBERED_COLUMN_BUTTON: string;
285
+ NUMBERED_COLUMN_BUTTON_DISABLED: string;
268
286
  HOVERED_COLUMN: string;
269
287
  HOVERED_ROW: string;
270
288
  HOVERED_TABLE: string;
@@ -292,8 +310,13 @@ export declare const TableCssClassName: {
292
310
  TABLE_STICKY: string;
293
311
  TOP_LEFT_CELL: string;
294
312
  LAST_ITEM_IN_CELL: string;
313
+ WITH_COLUMN_INSERT_LINE: string;
314
+ WITH_FIRST_COLUMN_INSERT_LINE: string;
315
+ WITH_LAST_COLUMN_INSERT_LINE: string;
295
316
  WITH_RESIZE_LINE: string;
296
317
  WITH_RESIZE_LINE_LAST_COLUMN: string;
318
+ WITH_ROW_INSERT_LINE: string;
319
+ WITH_LAST_ROW_INSERT_LINE: string;
297
320
  TABLE_CONTAINER: string;
298
321
  TABLE_NODE_WRAPPER: string;
299
322
  TABLE_LEFT_SHADOW: string;
@@ -354,8 +377,18 @@ export interface DraggableSourceData extends Record<string, unknown> {
354
377
  localId: string;
355
378
  indexes: number[];
356
379
  }
357
- export interface DraggableTargetData extends Record<string, unknown> {
380
+ export interface DraggableTargetData extends Record<string | symbol, unknown> {
358
381
  type: DraggableType;
359
382
  localId: string;
360
383
  targetIndex: number;
361
384
  }
385
+ export interface DraggableData {
386
+ sourceType: DraggableType;
387
+ sourceLocalId: string;
388
+ sourceIndexes: number[];
389
+ targetType: DraggableType;
390
+ targetLocalId: string;
391
+ targetIndex: number;
392
+ targetAdjustedIndex: number;
393
+ targetClosestEdge: Edge;
394
+ }
@@ -0,0 +1,11 @@
1
+ import type { MouseEventHandler } from 'react';
2
+ type DragHandleProps = {
3
+ tableLocalId: string;
4
+ indexes: number[];
5
+ direction?: 'column' | 'row';
6
+ onClick?: MouseEventHandler;
7
+ onMouseOver?: MouseEventHandler;
8
+ onMouseOut?: MouseEventHandler;
9
+ };
10
+ export declare const DragHandle: ({ tableLocalId, direction, indexes, onClick, onMouseOver, onMouseOut, }: DragHandleProps) => JSX.Element;
11
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'react';
2
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  export interface Props {
4
4
  editorView: EditorView;
5
5
  tableRef: HTMLTableElement;
@@ -11,11 +11,14 @@ export interface Props {
11
11
  isInDanger?: boolean;
12
12
  isResizing?: boolean;
13
13
  stickyTop?: number;
14
+ isDragAndDropEnabled?: boolean;
14
15
  }
15
16
  export default class NumberColumn extends Component<Props, any> {
16
17
  render(): JSX.Element;
17
18
  private hoverRows;
18
19
  private selectRow;
19
20
  private clearHoverSelection;
21
+ private updateDragHandleLocation;
22
+ private getCellStyles;
20
23
  private getClassNames;
21
24
  }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ export interface Props {
5
+ editorView: EditorView;
6
+ tableRef: HTMLTableElement;
7
+ selectRow: (row: number, expand: boolean) => void;
8
+ hoverRows: (rows: number[], danger?: boolean) => void;
9
+ hoveredRows?: number[];
10
+ isInDanger?: boolean;
11
+ isResizing?: boolean;
12
+ insertRowButtonIndex?: number;
13
+ stickyTop?: number;
14
+ }
15
+ export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
17
+ };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { CellHoverCoordinates } from '../../../types';
5
+ type DragControlsProps = {
6
+ editorView: EditorView;
7
+ tableRef: HTMLTableElement;
8
+ tableActive?: boolean;
9
+ hoveredCell?: CellHoverCoordinates;
10
+ hoverRows?: (rows: number[], danger?: boolean) => void;
11
+ selectRow?: (row: number, expand: boolean) => void;
12
+ };
13
+ export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps<"intl">>> & {
14
+ WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps<"intl">>;
15
+ };
16
+ export {};
@@ -1,17 +1,2 @@
1
- import React from 'react';
2
- import type { WrappedComponentProps } from 'react-intl-next';
3
- import { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- export interface Props {
5
- editorView: EditorView;
6
- tableRef: HTMLTableElement;
7
- selectRow: (row: number, expand: boolean) => void;
8
- hoverRows: (rows: number[], danger?: boolean) => void;
9
- hoveredRows?: number[];
10
- isInDanger?: boolean;
11
- isResizing?: boolean;
12
- insertRowButtonIndex?: number;
13
- stickyTop?: number;
14
- }
15
- export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
16
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
17
- };
1
+ export { RowControls } from './ClassicControls';
2
+ export { DragControls } from './DragControls';
@@ -1,12 +1,11 @@
1
1
  import { Component } from 'react';
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
3
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
5
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
6
+ import type { CellHoverCoordinates } from '../../types';
7
7
  export interface Props {
8
8
  editorView: EditorView;
9
- getEditorFeatureFlags: GetEditorFeatureFlags;
10
9
  selection?: Selection;
11
10
  tableRef?: HTMLTableElement;
12
11
  tableActive?: boolean;
@@ -15,9 +14,11 @@ export interface Props {
15
14
  isHeaderRowEnabled?: boolean;
16
15
  isHeaderColumnEnabled?: boolean;
17
16
  isNumberColumnEnabled?: boolean;
17
+ isDragAndDropEnabled?: boolean;
18
18
  hasHeaderRow?: boolean;
19
19
  headerRowHeight?: number;
20
20
  hoveredRows?: number[];
21
+ hoveredCell?: CellHoverCoordinates;
21
22
  ordering?: TableColumnOrdering;
22
23
  stickyHeader?: RowStickyState;
23
24
  }
@@ -33,7 +33,9 @@ export declare const lineMarkerSize = 4;
33
33
  export declare const columnControlsDecorationHeight = 25;
34
34
  export declare const columnControlsZIndex: number;
35
35
  export declare const columnControlsSelectedZIndex: number;
36
+ export declare const rowControlsZIndex: number;
36
37
  export declare const columnResizeHandleZIndex: number;
38
+ export declare const insertLineWidth = 3;
37
39
  export declare const resizeHandlerAreaWidth: number;
38
40
  export declare const resizeLineWidth = 2;
39
41
  export declare const resizeHandlerZIndex: number;
@@ -14,3 +14,4 @@ export declare const hoveredDeleteButton: (props: ThemeProps) => import("@emotio
14
14
  export declare const hoveredCell: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
15
15
  export declare const hoveredWarningCell: import("@emotion/react").SerializedStyles;
16
16
  export declare const resizeHandle: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
17
+ export declare const insertLine: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -3,17 +3,19 @@ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { ReadonlyTransaction, Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
5
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
6
- import type { Cell, CellColumnPositioning } from '../types';
6
+ import type { Cell, CellColumnPositioning, CellHoverCoordinates } from '../types';
7
7
  import { TableDecorations } from '../types';
8
8
  export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
9
9
  export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
10
10
  export declare const createCellHoverDecoration: (cells: Cell[]) => Decoration[];
11
11
  export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, danger?: boolean, selected?: boolean) => Decoration[];
12
12
  export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
13
- export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
13
+ export declare const createColumnControlsDecoration: (selection: Selection, hoverLocation?: CellHoverCoordinates) => Decoration[];
14
14
  export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
15
15
  export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape) => [
16
16
  Decoration[],
17
17
  Decoration[]
18
18
  ];
19
19
  export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>) => Decoration[];
20
+ export declare const createColumnInsertLine: (columnIndex: number, selection: Selection) => Decoration[];
21
+ export declare const createRowInsertLine: (rowIndex: number, selection: Selection) => Decoration[];
@@ -7,7 +7,9 @@ export declare const getColumnOrRowIndex: (target: HTMLElement) => [
7
7
  number
8
8
  ];
9
9
  export declare const isColumnControlsDecorations: (node: HTMLElement | null) => boolean;
10
+ export declare const isColumnDragControlsDecorations: (node: HTMLElement | null) => true | HTMLElement | null;
10
11
  export declare const isRowControlsButton: (node: HTMLElement | null) => boolean;
12
+ export declare const isRowDragControlsButton: (node: HTMLElement | null) => true | HTMLElement | null;
11
13
  export declare const isResizeHandleDecoration: (node: HTMLElement | null) => boolean;
12
14
  export declare const isTableControlsButton: (node: HTMLElement | null) => boolean;
13
15
  export declare const isTableContainerOrWrapper: (node: HTMLElement | null) => boolean;
@@ -1,11 +1,12 @@
1
1
  export { getSelectedColumnIndexes, getSelectedRowIndexes, normalizeSelection, isSelectionUpdated, } from './selection';
2
- export { findControlsHoverDecoration, createControlsHoverDecoration, createColumnControlsDecoration, createColumnSelectedDecoration, createCellHoverDecoration, updateDecorations, createResizeHandleDecoration, createColumnLineResize, } from './decoration';
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, isRowControlsButton, getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, updateResizeHandles, isResizeHandleDecoration, hasResizeHandler, } from './dom';
5
+ export { isCell, isCornerButton, isInsertRowButton, isColumnControlsDecorations, isTableControlsButton, isTableContainerOrWrapper, isColumnDragControlsDecorations, isRowDragControlsButton, isRowControlsButton, 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';
9
9
  export { getSelectedTableInfo, getSelectedCellInfo } from './analytics';
10
10
  export { getMergedCellsPositions } from './table';
11
11
  export { updatePluginStateDecorations } from './update-plugin-state-decorations';
12
+ export { hasMergedCellsInColumn, hasMergedCellsInRow } from './merged-cells';
@@ -0,0 +1,3 @@
1
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
2
+ export declare const hasMergedCellsInColumn: (columnIndexes: number | number[]) => (selection: Selection) => boolean;
3
+ export declare const hasMergedCellsInRow: (rowIndexes: number | number[]) => (selection: Selection) => boolean;