@atlaskit/editor-plugin-table 12.1.14 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/afm-cc/tsconfig.json +6 -0
  3. package/afm-dev-agents/tsconfig.json +6 -0
  4. package/afm-jira/tsconfig.json +6 -0
  5. package/afm-passionfruit/tsconfig.json +120 -0
  6. package/afm-post-office/tsconfig.json +6 -0
  7. package/afm-rovo-extension/tsconfig.json +6 -0
  8. package/afm-townsquare/tsconfig.json +6 -0
  9. package/afm-volt/tsconfig.json +13 -4
  10. package/dist/cjs/nodeviews/TableComponent.js +77 -26
  11. package/dist/cjs/nodeviews/TableContainer.js +270 -10
  12. package/dist/cjs/nodeviews/TableResizer.js +9 -2
  13. package/dist/cjs/nodeviews/TableRow.js +24 -1
  14. package/dist/cjs/nodeviews/table-node-views.js +1 -1
  15. package/dist/cjs/nodeviews/table.js +22 -7
  16. package/dist/cjs/nodeviews/toDOM.js +23 -7
  17. package/dist/cjs/pm-plugins/main.js +57 -22
  18. package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +72 -1
  19. package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +70 -1
  20. package/dist/cjs/tablePlugin.js +17 -3
  21. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +2 -7
  22. package/dist/es2019/nodeviews/TableComponent.js +80 -26
  23. package/dist/es2019/nodeviews/TableContainer.js +256 -2
  24. package/dist/es2019/nodeviews/TableResizer.js +9 -2
  25. package/dist/es2019/nodeviews/TableRow.js +24 -1
  26. package/dist/es2019/nodeviews/table-node-views.js +1 -1
  27. package/dist/es2019/nodeviews/table.js +21 -6
  28. package/dist/es2019/nodeviews/toDOM.js +24 -8
  29. package/dist/es2019/pm-plugins/main.js +57 -22
  30. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +72 -3
  31. package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +70 -1
  32. package/dist/es2019/tablePlugin.js +17 -3
  33. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +5 -14
  34. package/dist/esm/nodeviews/TableComponent.js +77 -26
  35. package/dist/esm/nodeviews/TableContainer.js +270 -10
  36. package/dist/esm/nodeviews/TableResizer.js +9 -2
  37. package/dist/esm/nodeviews/TableRow.js +24 -1
  38. package/dist/esm/nodeviews/table-node-views.js +1 -1
  39. package/dist/esm/nodeviews/table.js +22 -7
  40. package/dist/esm/nodeviews/toDOM.js +24 -8
  41. package/dist/esm/pm-plugins/main.js +57 -22
  42. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +74 -3
  43. package/dist/esm/pm-plugins/table-resizing/utils/misc.js +70 -1
  44. package/dist/esm/tablePlugin.js +17 -3
  45. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +1 -6
  46. package/dist/types/nodeviews/ExternalDropTargets.d.ts +1 -1
  47. package/dist/types/nodeviews/TableComponent.d.ts +1 -0
  48. package/dist/types/nodeviews/TableContainer.d.ts +7 -2
  49. package/dist/types/nodeviews/TableResizer.d.ts +1 -1
  50. package/dist/types/nodeviews/TableRow.d.ts +3 -1
  51. package/dist/types/nodeviews/table.d.ts +1 -1
  52. package/dist/types/nodeviews/toDOM.d.ts +5 -0
  53. package/dist/types/nodeviews/types.d.ts +1 -0
  54. package/dist/types/pm-plugins/analytics/commands.d.ts +2 -2
  55. package/dist/types/pm-plugins/analytics/plugin-factory.d.ts +1 -1
  56. package/dist/types/pm-plugins/analytics/utils/moved-event.d.ts +1 -1
  57. package/dist/types/pm-plugins/commands/column-resize.d.ts +10 -10
  58. package/dist/types/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
  59. package/dist/types/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
  60. package/dist/types/pm-plugins/commands/misc.d.ts +2 -2
  61. package/dist/types/pm-plugins/commands/selection.d.ts +6 -6
  62. package/dist/types/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +3 -3
  63. package/dist/types/pm-plugins/drag-and-drop/commands.d.ts +1 -1
  64. package/dist/types/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
  65. package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
  66. package/dist/types/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
  67. package/dist/types/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
  68. package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
  69. package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
  70. package/dist/types/pm-plugins/utils/create.d.ts +10 -10
  71. package/dist/types/pm-plugins/utils/decoration.d.ts +3 -3
  72. package/dist/types/pm-plugins/utils/dom.d.ts +2 -2
  73. package/dist/types/pm-plugins/utils/drag-menu.d.ts +3 -3
  74. package/dist/types/pm-plugins/utils/merged-cells.d.ts +3 -2
  75. package/dist/types/tablePluginType.d.ts +2 -0
  76. package/dist/types/ui/DragHandle/index.d.ts +4 -14
  77. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -7
  78. package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -14
  79. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
  80. package/dist/types/ui/TableFloatingControls/index.d.ts +1 -7
  81. package/dist/types/ui/global-styles.d.ts +2 -8
  82. package/dist/types/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
  83. package/dist/types-ts4.5/nodeviews/ExternalDropTargets.d.ts +1 -1
  84. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -0
  85. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +7 -2
  86. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -1
  87. package/dist/types-ts4.5/nodeviews/TableRow.d.ts +3 -1
  88. package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
  89. package/dist/types-ts4.5/nodeviews/toDOM.d.ts +5 -0
  90. package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
  91. package/dist/types-ts4.5/pm-plugins/analytics/commands.d.ts +2 -2
  92. package/dist/types-ts4.5/pm-plugins/analytics/plugin-factory.d.ts +1 -1
  93. package/dist/types-ts4.5/pm-plugins/analytics/utils/moved-event.d.ts +1 -1
  94. package/dist/types-ts4.5/pm-plugins/commands/column-resize.d.ts +10 -10
  95. package/dist/types-ts4.5/pm-plugins/commands/commands-with-analytics.d.ts +1 -1
  96. package/dist/types-ts4.5/pm-plugins/commands/go-to-next-cell.d.ts +1 -1
  97. package/dist/types-ts4.5/pm-plugins/commands/misc.d.ts +2 -2
  98. package/dist/types-ts4.5/pm-plugins/commands/selection.d.ts +6 -6
  99. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands-with-analytics.d.ts +3 -3
  100. package/dist/types-ts4.5/pm-plugins/drag-and-drop/commands.d.ts +1 -1
  101. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
  102. package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
  103. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
  104. package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
  105. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
  106. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
  107. package/dist/types-ts4.5/pm-plugins/utils/create.d.ts +10 -10
  108. package/dist/types-ts4.5/pm-plugins/utils/decoration.d.ts +3 -3
  109. package/dist/types-ts4.5/pm-plugins/utils/dom.d.ts +2 -2
  110. package/dist/types-ts4.5/pm-plugins/utils/drag-menu.d.ts +3 -3
  111. package/dist/types-ts4.5/pm-plugins/utils/merged-cells.d.ts +3 -2
  112. package/dist/types-ts4.5/tablePluginType.d.ts +2 -0
  113. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +4 -14
  114. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -7
  115. package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -14
  116. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +1 -1
  117. package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +1 -7
  118. package/dist/types-ts4.5/ui/global-styles.d.ts +2 -8
  119. package/dist/types-ts4.5/ui/hooks/useInternalTablePluginStateSelector.d.ts +1 -1
  120. package/package.json +10 -11
  121. package/src/nodeviews/TableComponent.tsx +113 -23
  122. package/src/nodeviews/TableContainer.tsx +331 -2
  123. package/src/nodeviews/TableResizer.tsx +10 -5
  124. package/src/nodeviews/TableRow.ts +38 -1
  125. package/src/nodeviews/table-node-views.ts +1 -1
  126. package/src/nodeviews/table.tsx +23 -0
  127. package/src/nodeviews/toDOM.ts +75 -9
  128. package/src/nodeviews/types.ts +1 -0
  129. package/src/pm-plugins/main.ts +41 -18
  130. package/src/pm-plugins/table-resizing/utils/colgroup.ts +139 -6
  131. package/src/pm-plugins/table-resizing/utils/misc.ts +87 -0
  132. package/src/tablePlugin.tsx +21 -0
  133. package/src/tablePluginType.ts +2 -0
  134. package/src/ui/TableFloatingControls/NumberColumn/index.tsx +5 -14
  135. package/tsconfig.app.json +6 -0
  136. package/types/package.json +1 -1
  137. package/ui/common-styles/package.json +1 -1
@@ -1 +1 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;
@@ -1 +1 @@
1
- export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
1
+ export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
@@ -1,3 +1,3 @@
1
1
  import type { StickyPluginAction, StickyPluginState } from './types';
2
- declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
2
+ declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command;
3
3
  export { createPluginState, createCommand };
@@ -1,4 +1,4 @@
1
1
  import type { ColumnResizingPluginState } from '../../types';
2
- export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
2
+ export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: (tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) => import("@atlaskit/editor-common/types").Command;
3
3
  export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
4
4
  export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
@@ -9,6 +9,7 @@ type Col = Array<string | {
9
9
  * overflow.
10
10
  */
11
11
  export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
12
+ export declare const generateColgroupFromNode: (table: PmNode, isCommentEditor?: boolean, isChromelessEditor?: boolean, isNested?: boolean, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Col[];
12
13
  export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => Col[];
13
14
  export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean, isCommentEditor?: boolean) => HTMLCollection;
14
15
  export declare const hasTableBeenResized: (table: PmNode) => boolean;
@@ -22,6 +22,47 @@ export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getE
22
22
  */
23
23
  export declare const getTableElementWidth: (table: PMNode) => number;
24
24
  export declare const getTableContainerElementWidth: (table: PMNode) => number;
25
+ /**
26
+ * This function is used to set the max width for table resizer container.
27
+ * @param isCommentEditor Whether the editor is in comment mode.
28
+ * @param isChromelessEditor Whether the editor is chromeless.
29
+ * @param isTableScalingEnabled Whether table scaling is enabled.
30
+ * @returns The CSS max-width value
31
+ */
32
+ export declare const getTableResizerContainerMaxWidthInCSS: (isCommentEditor?: boolean, isChromelessEditor?: boolean, isTableScalingEnabled?: boolean) => string;
33
+ /**
34
+ * This function is used in NodeView for TableResizer to set the max width for table resizer container
35
+ * @param node The ProseMirror node representing the table.
36
+ * @param isCommentEditor Whether the editor is in comment mode.
37
+ * @param isChromelessEditor Whether the editor is chromeless.
38
+ * @returns The CSS max-width value for the table resizer container.
39
+ */
40
+ export declare const getTableResizerItemWidth: (node: PMNode, isCommentEditor?: boolean, isChromelessEditor?: boolean) => number | undefined;
41
+ /**
42
+ * This function is used to set the CSS width value for the table resizer-item.
43
+ * Because comment and chromeless editors don't have container-type: inline-size set,
44
+ * we need to calculate the width based on the table node width.
45
+ * If the table node width is not set, it will return 'auto'.
46
+ * This is used in table toDOM
47
+ * @param node The ProseMirror node representing the table.
48
+ * @param isCommentEditor Whether the editor is in comment mode.
49
+ * @param isChromelessEditor Whether the editor is chromeless.
50
+ * @returns The CSS width value for the table container.
51
+ */
52
+ export declare const getTableResizerItemWidthInCSS: (node: PMNode, isCommentEditor?: boolean, isChromelessEditor?: boolean) => string;
53
+ /**
54
+ * This function is used to set the table width --ak-editor-table-width CSS property for full page editor.
55
+ * Which is applied to the table resizer container.
56
+ * For Full page appearance, we don't need to use containerWidth from JS, as we can use cqw value.
57
+ * So we set dynamic containerWidth from JS to CSS property.
58
+ * @param node The ProseMirror node representing the table.
59
+ * @param isCommentEditor Whether the editor is in comment mode.
60
+ * @param isChromelessEditor Whether the editor is chromeless.
61
+ * @param isTableScalingEnabled Whether table scaling is enabled.
62
+ * @param tableWidthFromJS The width of the container element. In toDOM it'd be undefined, but will have a value from nodeView.
63
+ * @returns The CSS width value for the table.
64
+ */
65
+ export declare const getTableResizerContainerForFullPageWidthInCSS: (node: PMNode, isTableScalingEnabled?: boolean) => string;
25
66
  export declare const getTableScalingPercent: (table: PMNode, tableRef: HTMLElement | null, shouldUseIncreasedScalingPercent?: boolean) => number;
26
67
  export declare const getScalingPercentForTableWithoutWidth: (table: PMNode, tableRef: HTMLElement | null) => number;
27
68
  export declare const getStaticTableScalingPercent: (table: PMNode, tableRenderWidth: number, shouldUseIncreasedScalingPercent?: boolean) => 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 | undefined;
4
- isTableAlignmentEnabled?: boolean | undefined;
5
- isFullWidthModeEnabled?: boolean | undefined;
6
- isCommentEditor?: boolean | undefined;
7
- isChromelessEditor?: boolean | undefined;
8
- isTableResizingEnabled?: boolean | undefined;
9
- isNestedTable?: boolean | undefined;
3
+ isTableScalingEnabled?: boolean;
4
+ isTableAlignmentEnabled?: boolean;
5
+ isFullWidthModeEnabled?: boolean;
6
+ isCommentEditor?: boolean;
7
+ isChromelessEditor?: boolean;
8
+ isTableResizingEnabled?: boolean;
9
+ isNestedTable?: boolean;
10
10
  createTableProps?: {
11
- rowsCount?: number | undefined;
12
- colsCount?: number | undefined;
13
- } | undefined;
11
+ rowsCount?: number;
12
+ colsCount?: number;
13
+ };
14
14
  }) => (schema: Schema) => import("prosemirror-model").Node;
@@ -9,14 +9,14 @@ import { TableDecorations } from '../../types';
9
9
  export declare const findColumnControlSelectedDecoration: (decorationSet: DecorationSet) => Decoration[];
10
10
  export declare const findControlsHoverDecoration: (decorationSet: DecorationSet) => Decoration[];
11
11
  export declare const createCellHoverDecoration: (cells: Cell[]) => Decoration[];
12
- export declare const createControlsHoverDecoration: (cells: Cell[], type: 'row' | 'column' | 'table', tr: Transaction | ReadonlyTransaction, isDragAndDropEnable: boolean | undefined, hoveredIndexes: number[], danger?: boolean, selected?: boolean) => Decoration[];
12
+ export declare const createControlsHoverDecoration: (cells: Cell[], type: "row" | "column" | "table", tr: Transaction | ReadonlyTransaction, isDragAndDropEnable: boolean | undefined, hoveredIndexes: number[], danger?: boolean, selected?: boolean) => Decoration[];
13
13
  export declare const createColumnSelectedDecoration: (tr: Transaction | ReadonlyTransaction) => Decoration[];
14
14
  export declare const createColumnControlsDecoration: (selection: Selection) => Decoration[];
15
15
  export declare const updateDecorations: (node: PmNode, decorationSet: DecorationSet, decorations: Decoration[], key: TableDecorations) => DecorationSet;
16
- export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, 'left'>, includeTooltip: boolean | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => [
16
+ export declare const createResizeHandleDecoration: (tr: Transaction | ReadonlyTransaction, rowIndexTarget: number, columnEndIndexTarget: Omit<CellColumnPositioning, "left">, includeTooltip: boolean | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI) => [
17
17
  Decoration[],
18
18
  Decoration[]
19
19
  ];
20
- export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, 'left'>, isDragAndDropEnabled?: boolean) => Decoration[];
20
+ export declare const createColumnLineResize: (selection: Selection, cellColumnPositioning: Omit<CellColumnPositioning, "left">, isDragAndDropEnabled?: boolean) => Decoration[];
21
21
  export declare const createColumnInsertLine: (columnIndex: number, selection: Selection, hasMergedCells: boolean) => Decoration[];
22
22
  export declare const createRowInsertLine: (rowIndex: number, selection: Selection, hasMergedCells: boolean) => Decoration[];
@@ -23,8 +23,8 @@ export declare const isDragCornerButton: (node: HTMLElement | null) => boolean;
23
23
  * @param gapInPixels
24
24
  * @returns
25
25
  */
26
- export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) => 'left' | 'right' | null;
27
- export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => 'top' | 'bottom' | null;
26
+ export declare const getMousePositionHorizontalRelativeByElement: (mouseEvent: MouseEvent, offsetX: number, gapInPixels?: number) => "left" | "right" | null;
27
+ export declare const getMousePositionVerticalRelativeByElement: (mouseEvent: MouseEvent) => "top" | "bottom" | null;
28
28
  export declare const hasResizeHandler: ({ columnEndIndexTarget, target, }: {
29
29
  columnEndIndexTarget: number;
30
30
  target: HTMLElement;
@@ -7,8 +7,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
7
  import type { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
8
8
  import type { NewIconProps } from '@atlaskit/icon/types';
9
9
  import type { DraggableData, DraggableType, PluginInjectionAPI, TableDirection } from '../../types';
10
- export declare const getTargetIndex: (selectedIndexes: number[], direction: DraggableData['direction']) => number;
11
- export declare const canMove: (sourceType: DraggableType, direction: DraggableData['direction'], totalItemsOfSourceTypeCount: number, selection: Selection, selectionRect?: Rect) => boolean;
10
+ export declare const getTargetIndex: (selectedIndexes: number[], direction: DraggableData["direction"]) => number;
11
+ export declare const canMove: (sourceType: DraggableType, direction: DraggableData["direction"], totalItemsOfSourceTypeCount: number, selection: Selection, selectionRect?: Rect) => boolean;
12
12
  export type DragMenuOptionIdType = 'add_row_above' | 'add_row_below' | 'add_column_left' | 'add_column_right' | 'distribute_columns' | 'clear_cells' | 'delete_row' | 'delete_column' | 'move_column_left' | 'move_column_right' | 'move_row_up' | 'move_row_down' | 'sort_column_asc' | 'sort_column_desc';
13
13
  export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
14
14
  id: DragMenuOptionIdType;
@@ -16,4 +16,4 @@ export interface DragMenuConfig extends Omit<DropdownOptionT<Command>, 'icon'> {
16
16
  iconFallback?: React.ComponentType<React.PropsWithChildren<NewIconProps>>;
17
17
  keymap?: string;
18
18
  }
19
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, hasMergedCellsInTable: boolean, editorView: EditorView, api: PluginInjectionAPI | undefined | null, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean, ariaNotifyPlugin?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined, isCommentEditor?: boolean) => DragMenuConfig[];
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[];
@@ -3,7 +3,8 @@ import { TableMap } from '@atlaskit/editor-tables';
3
3
  type MergeType = 'row' | 'column';
4
4
  export declare const hasMergedCellsInBetween: (indexes: number[], type: MergeType) => (selection: Selection) => boolean;
5
5
  export declare const hasMergedCellsWithColumnNextToColumnIndex: (colIndex: number, selection: Selection) => boolean;
6
- export declare const hasMergedCellsWithRowNextToRowIndex: (rowIndex: number, selection: Selection) => boolean;
6
+ export declare const hasMergedCellsWithRowNextToRowIndex: (rowIndex: number, // logical row index in the table. It starts at 0 and goes up to tableMap.height - 1.
7
+ selection: Selection) => boolean;
7
8
  export declare const hasMergedCellsInSelection: (indexes: number[], type: MergeType) => (selection: Selection) => boolean;
8
9
  /**
9
10
  * this check the selection has merged cells with previous/next col or row.
@@ -13,7 +14,7 @@ export declare const hasMergedCellsInSelection: (indexes: number[], type: MergeT
13
14
  * @param direction - check selection is selected by row or column
14
15
  * @returns boolean
15
16
  */
16
- export declare const checkEdgeHasMergedCells: (indexes: number[], tableMap: TableMap, direction: 'row' | 'column') => boolean;
17
+ export declare const checkEdgeHasMergedCells: (indexes: number[], tableMap: TableMap, direction: "row" | "column") => boolean;
17
18
  /**
18
19
  * this function will find the duplicate position in the array(table map position array).
19
20
  *
@@ -9,6 +9,7 @@ import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
9
9
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
10
10
  import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
11
11
  import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
12
+ import type { LimitedModePlugin } from '@atlaskit/editor-plugin-limited-mode';
12
13
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
13
14
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
14
15
  import type { PluginConfig, TableSharedState } from './types';
@@ -42,6 +43,7 @@ export type TablePluginDependencies = [
42
43
  ContentInsertionPlugin,
43
44
  WidthPlugin,
44
45
  SelectionPlugin,
46
+ OptionalPlugin<LimitedModePlugin>,
45
47
  OptionalPlugin<GuidelinePlugin>,
46
48
  OptionalPlugin<BatchAttributeUpdatesPlugin>,
47
49
  OptionalPlugin<AccessibilityUtilsPlugin>,
@@ -1,8 +1,10 @@
1
1
  import type { MouseEventHandler } from 'react';
2
2
  import React from 'react';
3
3
  import type { WrappedComponentProps } from 'react-intl-next';
4
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
6
  import type { TriggerType } from '../../pm-plugins/drag-and-drop/types';
7
+ import type { TablePlugin } from '../../tablePluginType';
6
8
  import type { CellHoverMeta, TableDirection } from '../../types';
7
9
  export type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger' | 'placeholder';
8
10
  type DragHandleProps = {
@@ -27,22 +29,10 @@ export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProp
27
29
  WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps>;
28
30
  };
29
31
  export declare const DragHandleWithSharedState: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & {
30
- api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
31
- pluginConfiguration: import("../../tablePluginType").TablePluginOptions | undefined;
32
- actions: import("../../tablePluginType").TablePluginActions;
33
- sharedState?: import("../../types").TableSharedState | undefined;
34
- commands: import("../../tablePluginType").TablePluginCommands;
35
- dependencies: import("../../tablePluginType").TablePluginDependencies;
36
- }> | undefined;
32
+ api?: ExtractInjectionAPI<TablePlugin>;
37
33
  } & WrappedComponentProps>> & {
38
34
  WrappedComponent: React.ComponentType<DragHandleProps & {
39
- api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
40
- pluginConfiguration: import("../../tablePluginType").TablePluginOptions | undefined;
41
- actions: import("../../tablePluginType").TablePluginActions;
42
- sharedState?: import("../../types").TableSharedState | undefined;
43
- commands: import("../../tablePluginType").TablePluginCommands;
44
- dependencies: import("../../tablePluginType").TablePluginDependencies;
45
- }> | undefined;
35
+ api?: ExtractInjectionAPI<TablePlugin>;
46
36
  } & WrappedComponentProps>;
47
37
  };
48
38
  export {};
@@ -21,12 +21,6 @@ interface ColumnControlsProps {
21
21
  getScrollOffset?: () => number;
22
22
  }
23
23
  export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, stickyTop, localId, isInDanger, rowHeights, colWidths, isTableHovered, tableContainerWidth, isNumberColumnEnabled, isDragging, getScrollOffset, api, }: ColumnControlsProps & {
24
- api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
25
- pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
26
- actions: import("../../../tablePluginType").TablePluginActions;
27
- sharedState?: import("../../../types").TableSharedState | undefined;
28
- commands: import("../../../tablePluginType").TablePluginCommands;
29
- dependencies: import("../../../tablePluginType").TablePluginDependencies;
30
- }> | undefined;
24
+ api?: ExtractInjectionAPI<TablePlugin>;
31
25
  }) => React.JSX.Element;
32
26
  export {};
@@ -1,23 +1,13 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
+ import type { TablePlugin } from '../../../tablePluginType';
3
5
  import type { CornerControlProps } from './types';
4
6
  export declare const DragCornerControlsWithSelection: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps & {
5
- api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
6
- pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
7
- actions: import("../../../tablePluginType").TablePluginActions;
8
- sharedState?: import("../../../types").TableSharedState | undefined;
9
- commands: import("../../../tablePluginType").TablePluginCommands;
10
- dependencies: import("../../../tablePluginType").TablePluginDependencies;
11
- }> | undefined;
7
+ api?: ExtractInjectionAPI<TablePlugin>;
12
8
  }>> & {
13
9
  WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps & {
14
- api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
15
- pluginConfiguration: import("../../../tablePluginType").TablePluginOptions | undefined;
16
- actions: import("../../../tablePluginType").TablePluginActions;
17
- sharedState?: import("../../../types").TableSharedState | undefined;
18
- commands: import("../../../tablePluginType").TablePluginCommands;
19
- dependencies: import("../../../tablePluginType").TablePluginDependencies;
20
- }> | undefined;
10
+ api?: ExtractInjectionAPI<TablePlugin>;
21
11
  }>;
22
12
  };
23
13
  export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
@@ -23,5 +23,5 @@ type DragControlsProps = {
23
23
  selection?: Selection;
24
24
  };
25
25
  export declare const DragControls: ({ tableRef, tableNode, tableWidth, hoveredCell, tableActive, editorView, isInDanger, isResizing, isTableHovered, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, selection, }: DragControlsProps) => React.JSX.Element | null;
26
- export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, 'selection'>) => React.JSX.Element;
26
+ export declare const DragControlsWithSelection: ({ editorView, tableRef, tableNode, tableWidth, tableActive, hoveredCell, isInDanger, isTableHovered, isResizing, hoverRows, selectRow, selectRows, updateCellHoverLocation, api, }: Exclude<DragControlsProps, "selection">) => React.JSX.Element;
27
27
  export {};
@@ -31,12 +31,6 @@ interface TableFloatingControlsProps {
31
31
  isChromelessEditor?: boolean;
32
32
  }
33
33
  export declare const TableFloatingControls: ({ editorView, tableRef, tableNode, isInDanger, isResizing, isNumberColumnEnabled, isHeaderRowEnabled, isHeaderColumnEnabled, tableActive, hasHeaderRow, hoveredRows, stickyHeader, isDragAndDropEnabled, hoveredCell, isTableHovered, tableWrapperWidth, api, isChromelessEditor, }: TableFloatingControlsProps & {
34
- api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
35
- pluginConfiguration: import("../../tablePluginType").TablePluginOptions | undefined;
36
- actions: import("../../tablePluginType").TablePluginActions;
37
- sharedState?: import("../../types").TableSharedState | undefined;
38
- commands: import("../../tablePluginType").TablePluginCommands;
39
- dependencies: import("../../tablePluginType").TablePluginDependencies;
40
- }> | undefined;
34
+ api?: ExtractInjectionAPI<TablePlugin>;
41
35
  }) => React.JSX.Element | null;
42
36
  export default TableFloatingControls;
@@ -7,12 +7,6 @@ import type { FeatureFlags } from '@atlaskit/editor-common/types';
7
7
  import type { PluginInjectionAPI } from '../types';
8
8
  export declare const GlobalStylesWrapper: ({ featureFlags, isDragAndDropEnabledOption, api, }: {
9
9
  featureFlags: FeatureFlags | undefined;
10
- isDragAndDropEnabledOption?: boolean | undefined;
11
- api?: import("@atlaskit/editor-common/types").EditorInjectionAPI<"table", {
12
- pluginConfiguration: import("..").TablePluginOptions | undefined;
13
- actions: import("..").TablePluginActions;
14
- sharedState?: import("../types").TableSharedState | undefined;
15
- commands: import("..").TablePluginCommands;
16
- dependencies: import("..").TablePluginDependencies;
17
- }> | undefined;
10
+ isDragAndDropEnabledOption?: boolean;
11
+ api?: PluginInjectionAPI;
18
12
  }) => jsx.JSX.Element;
@@ -18,5 +18,5 @@ type Options = {
18
18
  * @returns
19
19
  * @example
20
20
  */
21
- export declare const useInternalTablePluginStateSelector: <K extends "isFullWidthModeEnabled" | "wasFullWidthModeEnabled" | "isHeaderRowEnabled" | "isHeaderColumnEnabled" | "ordering" | "isInDanger" | "hoveredRows" | "hoveredColumns" | "hoveredCell" | "isTableHovered" | "tableNode" | "widthToWidest" | "tableRef" | "tablePos" | "targetCellPosition" | "isContextualMenuOpen" | "pluginConfig" | "insertColumnButtonIndex" | "insertRowButtonIndex" | "isDragAndDropEnabled" | "tableWrapperTarget" | "isCellMenuOpenByKeyboard" | "isWholeTableInDanger" | "isDragMenuOpen" | "dragMenuDirection" | "dragMenuIndex" | "isResizing" | "stickyHeader" | "isTableResizing" | "resizingTableLocalId" | "resizingTableRef" | "isSizeSelectorOpen" | "sizeSelectorTargetRef">(api: ExtractInjectionAPI<TablePlugin> | undefined, key: K, options?: Options) => TableSharedStateInternal[K] | undefined;
21
+ export declare const useInternalTablePluginStateSelector: <K extends keyof TableSharedStateInternal>(api: ExtractInjectionAPI<TablePlugin> | undefined, key: K, options?: Options) => TableSharedStateInternal[K] | undefined;
22
22
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "12.1.14",
3
+ "version": "12.2.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^50.2.0",
32
- "@atlaskit/button": "^23.3.0",
32
+ "@atlaskit/button": "^23.4.0",
33
33
  "@atlaskit/custom-steps": "^0.11.0",
34
34
  "@atlaskit/editor-palette": "^2.1.0",
35
35
  "@atlaskit/editor-plugin-accessibility-utils": "^3.0.0",
@@ -37,24 +37,26 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^3.0.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^3.1.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
40
- "@atlaskit/editor-plugin-extension": "6.1.6",
40
+ "@atlaskit/editor-plugin-extension": "6.1.7",
41
41
  "@atlaskit/editor-plugin-guideline": "^3.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^5.0.0",
43
+ "@atlaskit/editor-plugin-limited-mode": "^0.0.1",
43
44
  "@atlaskit/editor-plugin-selection": "^3.0.0",
44
45
  "@atlaskit/editor-plugin-width": "^4.0.0",
45
46
  "@atlaskit/editor-prosemirror": "7.0.0",
46
47
  "@atlaskit/editor-shared-styles": "^3.6.0",
47
48
  "@atlaskit/editor-tables": "^2.9.0",
48
- "@atlaskit/icon": "^27.10.0",
49
- "@atlaskit/menu": "^8.1.0",
49
+ "@atlaskit/icon": "^27.12.0",
50
+ "@atlaskit/menu": "^8.3.0",
50
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
52
+ "@atlaskit/platform-feature-flags-react": "^0.2.0",
51
53
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
52
54
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
53
55
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
54
56
  "@atlaskit/primitives": "^14.11.0",
55
- "@atlaskit/react-ufo": "^4.2.0",
57
+ "@atlaskit/react-ufo": "^4.3.0",
56
58
  "@atlaskit/theme": "^19.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^9.26.0",
59
+ "@atlaskit/tmp-editor-statsig": "^10.0.0",
58
60
  "@atlaskit/toggle": "^15.1.0",
59
61
  "@atlaskit/tokens": "^6.0.0",
60
62
  "@atlaskit/tooltip": "^20.4.0",
@@ -67,7 +69,7 @@
67
69
  "uuid": "^3.1.0"
68
70
  },
69
71
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^107.20.0",
72
+ "@atlaskit/editor-common": "^107.25.0",
71
73
  "react": "^18.2.0",
72
74
  "react-dom": "^18.2.0",
73
75
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -133,9 +135,6 @@
133
135
  "platform_editor_nested_tables_view_mode_sort": {
134
136
  "type": "boolean"
135
137
  },
136
- "platform_editor_nested_tables_number_column_fixes": {
137
- "type": "boolean"
138
- },
139
138
  "disable-sticky-scrollbar-for-nested-tables": {
140
139
  "type": "boolean"
141
140
  },