@atlaskit/editor-plugin-table 12.3.0 → 12.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 (143) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/nodeviews/TableContainer.js +9 -7
  3. package/dist/cjs/nodeviews/table.js +5 -0
  4. package/dist/cjs/nodeviews/toDOM.js +5 -2
  5. package/dist/es2019/nodeviews/TableContainer.js +9 -7
  6. package/dist/es2019/nodeviews/table.js +5 -0
  7. package/dist/es2019/nodeviews/toDOM.js +5 -1
  8. package/dist/esm/nodeviews/TableContainer.js +9 -7
  9. package/dist/esm/nodeviews/table.js +5 -0
  10. package/dist/esm/nodeviews/toDOM.js +5 -2
  11. package/dist/types/nodeviews/ExternalDropTargets.d.ts +1 -1
  12. package/dist/types/nodeviews/TableComponent.d.ts +21 -21
  13. package/dist/types/nodeviews/TableComponentWithSharedState.d.ts +9 -9
  14. package/dist/types/nodeviews/TableContainer.d.ts +20 -20
  15. package/dist/types/nodeviews/TableResizer.d.ts +16 -16
  16. package/dist/types/nodeviews/TableRow.d.ts +1 -1
  17. package/dist/types/nodeviews/table-node-views.d.ts +4 -4
  18. package/dist/types/nodeviews/table.d.ts +2 -2
  19. package/dist/types/nodeviews/toDOM.d.ts +4 -4
  20. package/dist/types/nodeviews/types.d.ts +12 -12
  21. package/dist/types/pm-plugins/analytics/actions.d.ts +2 -2
  22. package/dist/types/pm-plugins/analytics/types.d.ts +2 -2
  23. package/dist/types/pm-plugins/commands/column-resize.d.ts +6 -6
  24. package/dist/types/pm-plugins/commands/insert.d.ts +7 -7
  25. package/dist/types/pm-plugins/drag-and-drop/actions.d.ts +4 -4
  26. package/dist/types/pm-plugins/drag-and-drop/types.d.ts +3 -3
  27. package/dist/types/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
  28. package/dist/types/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
  29. package/dist/types/pm-plugins/sticky-headers/types.d.ts +2 -2
  30. package/dist/types/pm-plugins/table-resizing/commands.d.ts +3 -3
  31. package/dist/types/pm-plugins/table-resizing/utils/column-state.d.ts +1 -1
  32. package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +3 -3
  33. package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +6 -6
  34. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +6 -6
  35. package/dist/types/pm-plugins/table-resizing/utils/types.d.ts +8 -8
  36. package/dist/types/pm-plugins/utils/analytics.d.ts +2 -2
  37. package/dist/types/pm-plugins/utils/collapse.d.ts +3 -3
  38. package/dist/types/pm-plugins/utils/column-controls.d.ts +1 -1
  39. package/dist/types/pm-plugins/utils/create.d.ts +8 -8
  40. package/dist/types/pm-plugins/utils/dom.d.ts +2 -2
  41. package/dist/types/pm-plugins/utils/drag-menu.d.ts +1 -1
  42. package/dist/types/pm-plugins/utils/row-controls.d.ts +2 -2
  43. package/dist/types/pm-plugins/utils/snapping.d.ts +1 -1
  44. package/dist/types/pm-plugins/view-mode-sort/index.d.ts +1 -1
  45. package/dist/types/pm-plugins/view-mode-sort/types.d.ts +2 -2
  46. package/dist/types/tablePluginType.d.ts +10 -10
  47. package/dist/types/types/index.d.ts +99 -99
  48. package/dist/types/ui/ColumnResizeWidget/index.d.ts +1 -1
  49. package/dist/types/ui/ContentComponent.d.ts +5 -5
  50. package/dist/types/ui/DragHandle/HandleIconComponent.d.ts +1 -1
  51. package/dist/types/ui/DragHandle/index.d.ts +11 -11
  52. package/dist/types/ui/DragPreview/index.d.ts +1 -1
  53. package/dist/types/ui/FloatingContextualButton/FixedButton.d.ts +2 -2
  54. package/dist/types/ui/FloatingContextualButton/index.d.ts +7 -7
  55. package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +10 -10
  56. package/dist/types/ui/FloatingContextualMenu/index.d.ts +8 -8
  57. package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
  58. package/dist/types/ui/FloatingDeleteButton/getPopUpOptions.d.ts +1 -1
  59. package/dist/types/ui/FloatingDeleteButton/index.d.ts +9 -9
  60. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +15 -15
  61. package/dist/types/ui/FloatingDragMenu/DropdownMenu.d.ts +14 -14
  62. package/dist/types/ui/FloatingDragMenu/index.d.ts +14 -14
  63. package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +3 -3
  64. package/dist/types/ui/FloatingInsertButton/index.d.ts +11 -11
  65. package/dist/types/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +4 -4
  66. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +10 -10
  67. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  68. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +4 -4
  69. package/dist/types/ui/TableFloatingColumnControls/index.d.ts +10 -10
  70. package/dist/types/ui/TableFloatingControls/CornerControls/types.d.ts +3 -3
  71. package/dist/types/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +7 -7
  72. package/dist/types/ui/TableFloatingControls/NumberColumn/index.d.ts +7 -7
  73. package/dist/types/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +5 -5
  74. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +8 -8
  75. package/dist/types/ui/TableFloatingControls/index.d.ts +14 -14
  76. package/dist/types/ui/global-styles.d.ts +1 -1
  77. package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +1 -1
  78. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +21 -21
  79. package/dist/types-ts4.5/nodeviews/TableComponentWithSharedState.d.ts +9 -9
  80. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +20 -20
  81. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +16 -16
  82. package/dist/types-ts4.5/nodeviews/TableRow.d.ts +1 -1
  83. package/dist/types-ts4.5/nodeviews/table-node-views.d.ts +4 -4
  84. package/dist/types-ts4.5/nodeviews/table.d.ts +2 -2
  85. package/dist/types-ts4.5/nodeviews/toDOM.d.ts +4 -4
  86. package/dist/types-ts4.5/nodeviews/types.d.ts +12 -12
  87. package/dist/types-ts4.5/pm-plugins/analytics/actions.d.ts +2 -2
  88. package/dist/types-ts4.5/pm-plugins/analytics/types.d.ts +2 -2
  89. package/dist/types-ts4.5/pm-plugins/commands/column-resize.d.ts +6 -6
  90. package/dist/types-ts4.5/pm-plugins/commands/insert.d.ts +7 -7
  91. package/dist/types-ts4.5/pm-plugins/drag-and-drop/actions.d.ts +4 -4
  92. package/dist/types-ts4.5/pm-plugins/drag-and-drop/types.d.ts +3 -3
  93. package/dist/types-ts4.5/pm-plugins/drag-and-drop/utils/autoscrollers.d.ts +1 -1
  94. package/dist/types-ts4.5/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
  95. package/dist/types-ts4.5/pm-plugins/sticky-headers/types.d.ts +2 -2
  96. package/dist/types-ts4.5/pm-plugins/table-resizing/commands.d.ts +3 -3
  97. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/column-state.d.ts +1 -1
  98. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +3 -3
  99. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +6 -6
  100. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +6 -6
  101. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/types.d.ts +8 -8
  102. package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +2 -2
  103. package/dist/types-ts4.5/pm-plugins/utils/collapse.d.ts +3 -3
  104. package/dist/types-ts4.5/pm-plugins/utils/column-controls.d.ts +1 -1
  105. package/dist/types-ts4.5/pm-plugins/utils/create.d.ts +8 -8
  106. package/dist/types-ts4.5/pm-plugins/utils/dom.d.ts +2 -2
  107. package/dist/types-ts4.5/pm-plugins/utils/drag-menu.d.ts +1 -1
  108. package/dist/types-ts4.5/pm-plugins/utils/row-controls.d.ts +2 -2
  109. package/dist/types-ts4.5/pm-plugins/utils/snapping.d.ts +1 -1
  110. package/dist/types-ts4.5/pm-plugins/view-mode-sort/index.d.ts +1 -1
  111. package/dist/types-ts4.5/pm-plugins/view-mode-sort/types.d.ts +2 -2
  112. package/dist/types-ts4.5/tablePluginType.d.ts +10 -10
  113. package/dist/types-ts4.5/types/index.d.ts +99 -99
  114. package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +1 -1
  115. package/dist/types-ts4.5/ui/ContentComponent.d.ts +5 -5
  116. package/dist/types-ts4.5/ui/DragHandle/HandleIconComponent.d.ts +1 -1
  117. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +11 -11
  118. package/dist/types-ts4.5/ui/DragPreview/index.d.ts +1 -1
  119. package/dist/types-ts4.5/ui/FloatingContextualButton/FixedButton.d.ts +2 -2
  120. package/dist/types-ts4.5/ui/FloatingContextualButton/index.d.ts +7 -7
  121. package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +10 -10
  122. package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +8 -8
  123. package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
  124. package/dist/types-ts4.5/ui/FloatingDeleteButton/getPopUpOptions.d.ts +1 -1
  125. package/dist/types-ts4.5/ui/FloatingDeleteButton/index.d.ts +9 -9
  126. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +15 -15
  127. package/dist/types-ts4.5/ui/FloatingDragMenu/DropdownMenu.d.ts +14 -14
  128. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +14 -14
  129. package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +3 -3
  130. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +11 -11
  131. package/dist/types-ts4.5/ui/FloatingToolbarLabel/FloatingToolbarLabel.d.ts +4 -4
  132. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +10 -10
  133. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  134. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +4 -4
  135. package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +10 -10
  136. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/types.d.ts +3 -3
  137. package/dist/types-ts4.5/ui/TableFloatingControls/FloatingControlsWithSelection.d.ts +7 -7
  138. package/dist/types-ts4.5/ui/TableFloatingControls/NumberColumn/index.d.ts +7 -7
  139. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +5 -5
  140. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +8 -8
  141. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +14 -14
  142. package/dist/types-ts4.5/ui/global-styles.d.ts +1 -1
  143. package/package.json +5 -5
@@ -2,8 +2,8 @@ import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { TableDirection } from '../../types';
3
3
  import type { DropTargetType } from './consts';
4
4
  interface DragAndDropAction<T, D> {
5
- type: T;
6
5
  data: D;
6
+ type: T;
7
7
  }
8
8
  export declare const DragAndDropActionType: {
9
9
  readonly SET_DROP_TARGET: "SET_DROP_TARGET";
@@ -11,17 +11,17 @@ export declare const DragAndDropActionType: {
11
11
  readonly TOGGLE_DRAG_MENU: "TOGGLE_DRAG_MENU";
12
12
  };
13
13
  type DragAndDropSetDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.SET_DROP_TARGET, {
14
- type: DropTargetType;
15
- index: number;
16
14
  decorationSet: DecorationSet;
15
+ index: number;
16
+ type: DropTargetType;
17
17
  }>;
18
18
  type DragAndDropClearDropTargetAction = DragAndDropAction<typeof DragAndDropActionType.CLEAR_DROP_TARGET, {
19
19
  decorationSet: DecorationSet;
20
20
  }>;
21
21
  type DragAndDropToggleDragMenuAction = DragAndDropAction<typeof DragAndDropActionType.TOGGLE_DRAG_MENU, {
22
- isDragMenuOpen: boolean;
23
22
  direction: TableDirection;
24
23
  index: number;
24
+ isDragMenuOpen: boolean;
25
25
  isKeyboardModeActive: boolean;
26
26
  }>;
27
27
  export type DragAndDropPluginAction = DragAndDropSetDropTargetAction | DragAndDropClearDropTargetAction | DragAndDropToggleDragMenuAction;
@@ -3,12 +3,12 @@ import type { TableDirection } from '../../types';
3
3
  import type { DropTargetType } from './consts';
4
4
  export interface DragAndDropPluginState {
5
5
  decorationSet: DecorationSet;
6
- dropTargetType: DropTargetType;
7
- dropTargetIndex: number;
8
- isDragMenuOpen: boolean;
9
6
  dragMenuDirection?: TableDirection;
10
7
  dragMenuIndex: number;
8
+ dropTargetIndex: number;
9
+ dropTargetType: DropTargetType;
11
10
  isDragging: boolean;
11
+ isDragMenuOpen: boolean;
12
12
  isKeyboardModeActive: boolean;
13
13
  }
14
14
  export type TriggerType = 'mouse' | 'keyboard';
@@ -1,7 +1,7 @@
1
1
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
2
2
  type AutoScrollerFactory = {
3
- tableWrapper: HTMLElement;
4
3
  getNode: () => PmNode;
4
+ tableWrapper: HTMLElement;
5
5
  };
6
6
  export declare const autoScrollerFactory: ({ tableWrapper, getNode }: AutoScrollerFactory) => import("@atlaskit/pragmatic-drag-and-drop/types").CleanupFn[];
7
7
  export {};
@@ -6,8 +6,8 @@
6
6
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
7
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
8
8
  interface SafariDeleteCompositionTextIssueWorkaroundPluginState {
9
- renderSpan: boolean;
10
9
  decorations: DecorationSet;
10
+ renderSpan: boolean;
11
11
  }
12
12
  export declare const createPlugin: () => SafePlugin<SafariDeleteCompositionTextIssueWorkaroundPluginState>;
13
13
  export {};
@@ -1,8 +1,8 @@
1
1
  export type RowStickyState = {
2
- pos: number;
3
- top: number;
4
2
  padding: number;
3
+ pos: number;
5
4
  sticky: boolean;
5
+ top: number;
6
6
  };
7
7
  export type StickyPluginState = RowStickyState[];
8
8
  type UpdateSticky = {
@@ -6,15 +6,15 @@ import type { PluginInjectionAPI } from '../../types';
6
6
  import type { ResizeState } from './utils/types';
7
7
  export declare const evenColumns: ({ resizeState, table, start, event, api, }: {
8
8
  api: PluginInjectionAPI | undefined | null;
9
+ event: MouseEvent;
9
10
  resizeState: ResizeState;
10
- table: PMNode;
11
11
  start: number;
12
- event: MouseEvent;
12
+ table: PMNode;
13
13
  }) => Command;
14
14
  export declare const distributeColumnsWidths: (newResizeState: ResizeState, table: ContentNodeWithPos, api: PluginInjectionAPI | undefined | null) => Command;
15
15
  export declare const setResizeHandlePos: (resizeHandlePos: number | null) => Command;
16
16
  export declare const stopResizing: (tr?: Transaction) => Command;
17
17
  export declare const setDragging: (dragging: {
18
- startX: number;
19
18
  startWidth: number;
19
+ startX: number;
20
20
  } | null, tr?: Transaction) => Command;
@@ -1,8 +1,8 @@
1
1
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  export interface ColumnState {
3
3
  index: number;
4
- width: number;
5
4
  minWidth: number;
5
+ width: number;
6
6
  }
7
7
  export declare const getColumnStateFromDOM: (cells: HTMLElement[], index: number, minWidth: number) => ColumnState;
8
8
  export declare const getFreeSpace: (state: ColumnState) => number;
@@ -8,11 +8,11 @@ export declare function getLayoutSize(tableLayout: 'default' | 'wide' | 'full-wi
8
8
  export declare function pointsAtCell($pos: ResolvedPos): false | PMNode | null;
9
9
  export declare function currentColWidth(view: EditorView, cellPos: number, { colspan, colwidth }: CellAttributes): number;
10
10
  interface getTableMaxWidthProps {
11
+ getEditorContainerWidth: GetEditorContainerWidth;
12
+ layout: 'default' | 'wide' | 'full-width';
13
+ state: EditorState;
11
14
  table: PMNode;
12
15
  tableStart: number;
13
- state: EditorState;
14
- layout: 'default' | 'wide' | 'full-width';
15
- getEditorContainerWidth: GetEditorContainerWidth;
16
16
  }
17
17
  export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getEditorContainerWidth, }: getTableMaxWidthProps) => number;
18
18
  /**
@@ -4,18 +4,18 @@ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { Rect } from '@atlaskit/editor-tables/table-map';
5
5
  import type { ResizeState, ResizeStateWithAnalytics } from './types';
6
6
  export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, }: {
7
- minWidth: number;
8
- maxSize: number;
9
- table: PMNode;
10
- tableRef: HTMLTableElement | null;
11
- start: number;
12
7
  domAtPos: (pos: number) => {
13
8
  node: Node;
14
9
  offset: number;
15
10
  };
11
+ isCommentEditor: boolean;
16
12
  isTableScalingEnabled: boolean;
13
+ maxSize: number;
14
+ minWidth: number;
17
15
  shouldUseIncreasedScalingPercent: boolean;
18
- isCommentEditor: boolean;
16
+ start: number;
17
+ table: PMNode;
18
+ tableRef: HTMLTableElement | null;
19
19
  }) => ResizeState;
20
20
  export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement | null, tableNode?: PMNode, isTableScalingEnabled?: boolean, scalePercent?: number) => void;
21
21
  export declare const getTotalWidth: ({ cols }: ResizeState) => number;
@@ -4,15 +4,15 @@ import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
4
4
  import type { PluginInjectionAPI } from '../../../types';
5
5
  import type { ResizeState } from '../utils/types';
6
6
  interface ScaleOptions {
7
- node: PMNode;
8
- prevNode: PMNode;
9
- start: number;
10
7
  containerWidth?: number;
11
- previousContainerWidth?: number;
12
- parentWidth?: number;
13
- layoutChanged?: boolean;
14
8
  isFullWidthModeEnabled?: boolean;
15
9
  isTableResizingEnabled?: boolean;
10
+ layoutChanged?: boolean;
11
+ node: PMNode;
12
+ parentWidth?: number;
13
+ previousContainerWidth?: number;
14
+ prevNode: PMNode;
15
+ start: number;
16
16
  }
17
17
  export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
18
18
  export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean, isCommentEditor?: boolean) => void;
@@ -2,22 +2,22 @@ import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
2
2
  import type { ColumnState } from './column-state';
3
3
  export interface ResizeState {
4
4
  cols: ColumnState[];
5
- widths: number[];
5
+ isScaled?: boolean;
6
6
  maxSize: number;
7
7
  overflow: boolean;
8
8
  tableWidth: number;
9
- isScaled?: boolean;
9
+ widths: number[];
10
10
  }
11
11
  export interface ResizeStateWithAnalytics {
12
- resizeState: ResizeState;
13
- table: ContentNodeWithPos;
14
- changed: boolean;
15
12
  attributes: {
16
- position: number;
17
13
  count: number;
18
- totalRowCount: number;
14
+ position: number;
19
15
  totalColumnCount: number;
20
- widthsBefore: number[];
16
+ totalRowCount: number;
21
17
  widthsAfter: number[];
18
+ widthsBefore: number[];
22
19
  };
20
+ changed: boolean;
21
+ resizeState: ResizeState;
22
+ table: ContentNodeWithPos;
23
23
  }
@@ -5,10 +5,10 @@ import type { Selection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { TableMap } from '@atlaskit/editor-tables/table-map';
6
6
  import { findTable } from '@atlaskit/editor-tables/utils';
7
7
  export declare function getSelectedTableInfo(selection: Selection): {
8
- table: ReturnType<typeof findTable> | undefined;
9
8
  map: TableMap | undefined;
10
- totalRowCount: number;
9
+ table: ReturnType<typeof findTable> | undefined;
11
10
  totalColumnCount: number;
11
+ totalRowCount: number;
12
12
  };
13
13
  export declare function getSelectedCellInfo(selection: Selection): {
14
14
  totalRowCount: number;
@@ -2,15 +2,15 @@ import type { NodeType } from '@atlaskit/editor-prosemirror/model';
2
2
  import { NodeRange } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { ReadonlyTransaction, Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  interface IsTableCollapsibleResult {
5
- tableIsCollapsible: boolean;
6
- range?: NodeRange;
7
5
  findWrappingRes?: // Ignored via go/ees005
8
6
  Array<{
9
- type: NodeType;
10
7
  attrs?: {
11
8
  [key: string]: any;
12
9
  } | null;
10
+ type: NodeType;
13
11
  }> | null | undefined;
12
+ range?: NodeRange;
13
+ tableIsCollapsible: boolean;
14
14
  }
15
15
  /**
16
16
  * Checks whether we can wrap the selected table into an expand via
@@ -3,8 +3,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import { TableMap } from '@atlaskit/editor-tables/table-map';
4
4
  export declare const getColumnsWidths: (view: EditorView) => Array<number | undefined>;
5
5
  export declare const getColumnDeleteButtonParams: (columnsWidths: Array<number | undefined>, selection: Selection) => {
6
- left: number;
7
6
  indexes: number[];
7
+ left: number;
8
8
  } | null;
9
9
  export declare const colWidthsForRow: (tr: HTMLTableRowElement) => string;
10
10
  export declare const convertHTMLCellIndexToColumnIndex: (htmlColIndex: number, htmlRowIndex: number, tableMap: TableMap) => number;
@@ -1,14 +1,14 @@
1
1
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  export declare const createTableWithWidth: ({ isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, isCommentEditor, isChromelessEditor, isTableResizingEnabled, isNestedTable, createTableProps, }: {
3
- isTableScalingEnabled?: boolean;
4
- isTableAlignmentEnabled?: boolean;
5
- isFullWidthModeEnabled?: boolean;
6
- isCommentEditor?: boolean;
7
- isChromelessEditor?: boolean;
8
- isTableResizingEnabled?: boolean;
9
- isNestedTable?: boolean;
10
3
  createTableProps?: {
11
- rowsCount?: number;
12
4
  colsCount?: number;
5
+ rowsCount?: number;
13
6
  };
7
+ isChromelessEditor?: boolean;
8
+ isCommentEditor?: boolean;
9
+ isFullWidthModeEnabled?: boolean;
10
+ isNestedTable?: boolean;
11
+ isTableAlignmentEnabled?: boolean;
12
+ isTableResizingEnabled?: boolean;
13
+ isTableScalingEnabled?: boolean;
14
14
  }) => (schema: Schema) => import("prosemirror-model").Node;
@@ -27,12 +27,12 @@ export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
27
27
  target: HTMLElement;
28
28
  }) => boolean;
29
29
  export type TableDOMElements = {
30
- wrapper: HTMLDivElement;
31
30
  table: HTMLTableElement;
31
+ wrapper: HTMLDivElement;
32
32
  };
33
33
  export declare const getTree: (tr: HTMLTableRowElement) => TableDOMElements | null;
34
34
  export declare const getTop: (element: HTMLElement | Window | undefined) => number;
35
35
  export declare const findNearestCellIndexToPoint: (x: number, y: number) => {
36
- row: number;
37
36
  col: number;
37
+ row: number;
38
38
  } | undefined;
@@ -11,9 +11,9 @@ export declare const getTargetIndex: (selectedIndexes: number[], direction: Drag
11
11
  export declare const canMove: (sourceType: DraggableType, direction: DraggableData["direction"], totalItemsOfSourceTypeCount: number, selection: Selection, selectionRect?: Rect) => boolean;
12
12
  export type DragMenuOptionIdType = 'add_row_above' | 'add_row_below' | 'add_column_left' | 'add_column_right' | 'distribute_columns' | 'clear_cells' | 'delete_row' | 'delete_column' | 'move_column_left' | 'move_column_right' | 'move_row_up' | 'move_row_down' | 'sort_column_asc' | 'sort_column_desc';
13
13
  export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
14
- id: DragMenuOptionIdType;
15
14
  icon?: React.ComponentType<React.PropsWithChildren<NewIconProps>>;
16
15
  iconFallback?: React.ComponentType<React.PropsWithChildren<NewIconProps>>;
16
+ id: DragMenuOptionIdType;
17
17
  keymap?: string;
18
18
  }
19
19
  export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: (message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void, isCommentEditor?: boolean) => DragMenuConfig[];
@@ -1,14 +1,14 @@
1
1
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Selection, Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  export interface RowParams {
4
- startIndex: number;
5
4
  endIndex: number;
6
5
  height: number;
6
+ startIndex: number;
7
7
  }
8
8
  export declare const getRowHeights: (tableRef: HTMLTableElement) => number[];
9
9
  export declare const getRowDeleteButtonParams: (rowsHeights: Array<number | undefined>, selection: Selection, offsetTop?: number) => {
10
- top: number;
11
10
  indexes: number[];
11
+ top: number;
12
12
  } | null;
13
13
  export declare const getRowsParams: (rowsHeights: Array<number | undefined>) => RowParams[];
14
14
  export declare const getRowClassNames: (index: number, selection: Selection, hoveredRows?: number[], isInDanger?: boolean, isResizing?: boolean) => string;
@@ -1,8 +1,8 @@
1
1
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
3
3
  export type GuidelineExcludeConfig = {
4
- innerGuidelines: boolean;
5
4
  breakoutPoints: boolean;
5
+ innerGuidelines: boolean;
6
6
  };
7
7
  export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number, exclude?: GuidelineExcludeConfig) => number[];
8
8
  export declare const defaultSnappingWidths: number[];
@@ -10,6 +10,6 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
10
10
  import type tablePlugin from '../../tablePlugin';
11
11
  export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<{
12
12
  decorations: DecorationSet;
13
- sort: import("./types").TableSortMeta;
14
13
  allTables: [string, import("prosemirror-model").Node, number][];
14
+ sort: import("./types").TableSortMeta;
15
15
  }>;
@@ -2,17 +2,17 @@ import type { SortOrder } from '@atlaskit/editor-common/types';
2
2
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
4
4
  export type TableSortMeta = Record<string, {
5
+ direction: SortOrder;
5
6
  index: number;
6
7
  order: {
7
8
  index: number;
8
9
  value: number;
9
10
  }[];
10
- direction: SortOrder;
11
11
  }>;
12
12
  export interface ViewModeSortPluginState {
13
+ allTables: HoverTableMeta[];
13
14
  decorations: DecorationSet;
14
15
  sort: TableSortMeta;
15
- allTables: HoverTableMeta[];
16
16
  }
17
17
  type HoverTableMeta = [string, PMNode, number];
18
18
  export {};
@@ -15,23 +15,23 @@ import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
15
15
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
16
16
  import type { PluginConfig, TableSharedState } from './types';
17
17
  export interface TablePluginOptions {
18
- tableOptions: PluginConfig;
19
- dragAndDropEnabled?: boolean;
20
- isTableScalingEnabled?: boolean;
21
18
  allowContextualMenu?: boolean;
19
+ dragAndDropEnabled?: boolean;
22
20
  fullWidthEnabled?: boolean;
23
- wasFullWidthEnabled?: boolean;
24
21
  getEditorFeatureFlags?: GetEditorFeatureFlags;
25
- isCommentEditor?: boolean;
26
22
  isChromelessEditor?: boolean;
23
+ isCommentEditor?: boolean;
24
+ isTableScalingEnabled?: boolean;
25
+ tableOptions: PluginConfig;
26
+ wasFullWidthEnabled?: boolean;
27
27
  }
28
28
  type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
29
29
  type MediaPlugin = NextEditorPlugin<'media', {
30
- pluginConfiguration: any;
31
- dependencies: any;
32
- sharedState: any;
33
30
  actions: any;
34
31
  commands: any;
32
+ dependencies: any;
33
+ pluginConfiguration: any;
34
+ sharedState: any;
35
35
  }>;
36
36
  export type TablePluginActions = {
37
37
  insertTable: InsertTableAction;
@@ -56,10 +56,10 @@ export type TablePluginDependencies = [
56
56
  OptionalPlugin<UserIntentPlugin>
57
57
  ];
58
58
  export type TablePlugin = NextEditorPlugin<'table', {
59
- pluginConfiguration: TablePluginOptions | undefined;
60
59
  actions: TablePluginActions;
61
- sharedState?: TableSharedState;
62
60
  commands: TablePluginCommands;
63
61
  dependencies: TablePluginDependencies;
62
+ pluginConfiguration: TablePluginOptions | undefined;
63
+ sharedState?: TableSharedState;
64
64
  }>;
65
65
  export {};