@atlaskit/editor-plugin-table 7.5.3 → 7.5.5

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 (229) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/commands/column-resize.js +3 -3
  3. package/dist/cjs/commands/delete.js +2 -2
  4. package/dist/cjs/commands/insert.js +15 -15
  5. package/dist/cjs/commands-with-analytics.js +7 -7
  6. package/dist/cjs/event-handlers.js +2 -2
  7. package/dist/cjs/nodeviews/TableComponent.js +46 -59
  8. package/dist/cjs/nodeviews/TableContainer.js +5 -5
  9. package/dist/cjs/nodeviews/TableResizer.js +12 -12
  10. package/dist/cjs/nodeviews/table.js +9 -9
  11. package/dist/cjs/plugin.js +58 -56
  12. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +13 -13
  13. package/dist/cjs/pm-plugins/keymap.js +6 -8
  14. package/dist/cjs/pm-plugins/main.js +4 -6
  15. package/dist/cjs/pm-plugins/sticky-headers/plugin.js +2 -3
  16. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +12 -12
  17. package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  18. package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +4 -2
  19. package/dist/cjs/pm-plugins/table-resizing/utils/index.js +2 -2
  20. package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +3 -3
  21. package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +3 -3
  22. package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +11 -12
  23. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +13 -13
  24. package/dist/cjs/pm-plugins/table-width.js +6 -2
  25. package/dist/cjs/toolbar.js +21 -21
  26. package/dist/cjs/transforms/column-width.js +4 -4
  27. package/dist/cjs/transforms/delete-columns.js +2 -2
  28. package/dist/cjs/ui/ColumnResizeWidget/index.js +4 -5
  29. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +53 -55
  30. package/dist/cjs/ui/FloatingContextualMenu/index.js +2 -4
  31. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
  32. package/dist/cjs/ui/FloatingDragMenu/index.js +6 -6
  33. package/dist/cjs/ui/FloatingInsertButton/index.js +6 -7
  34. package/dist/cjs/utils/create.js +2 -5
  35. package/dist/cjs/utils/drag-menu.js +4 -4
  36. package/dist/cjs/utils/guidelines.js +5 -2
  37. package/dist/cjs/utils/snapping.js +14 -1
  38. package/dist/es2019/commands/column-resize.js +3 -3
  39. package/dist/es2019/commands/delete.js +2 -2
  40. package/dist/es2019/commands/insert.js +12 -12
  41. package/dist/es2019/commands-with-analytics.js +6 -6
  42. package/dist/es2019/event-handlers.js +2 -2
  43. package/dist/es2019/nodeviews/TableComponent.js +25 -36
  44. package/dist/es2019/nodeviews/TableContainer.js +6 -6
  45. package/dist/es2019/nodeviews/TableResizer.js +14 -14
  46. package/dist/es2019/nodeviews/table.js +9 -9
  47. package/dist/es2019/plugin.js +17 -17
  48. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +6 -6
  49. package/dist/es2019/pm-plugins/keymap.js +5 -8
  50. package/dist/es2019/pm-plugins/main.js +3 -5
  51. package/dist/es2019/pm-plugins/sticky-headers/plugin.js +1 -1
  52. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +5 -5
  53. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  54. package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +3 -1
  55. package/dist/es2019/pm-plugins/table-resizing/utils/index.js +1 -1
  56. package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -2
  57. package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +3 -2
  58. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +12 -13
  59. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +13 -13
  60. package/dist/es2019/pm-plugins/table-width.js +6 -2
  61. package/dist/es2019/toolbar.js +15 -15
  62. package/dist/es2019/transforms/column-width.js +5 -5
  63. package/dist/es2019/transforms/delete-columns.js +2 -2
  64. package/dist/es2019/ui/ColumnResizeWidget/index.js +0 -1
  65. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +9 -12
  66. package/dist/es2019/ui/FloatingContextualMenu/index.js +2 -4
  67. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -2
  68. package/dist/es2019/ui/FloatingDragMenu/index.js +5 -5
  69. package/dist/es2019/ui/FloatingInsertButton/index.js +5 -6
  70. package/dist/es2019/utils/create.js +2 -5
  71. package/dist/es2019/utils/drag-menu.js +4 -4
  72. package/dist/es2019/utils/guidelines.js +3 -2
  73. package/dist/es2019/utils/snapping.js +12 -1
  74. package/dist/esm/commands/column-resize.js +3 -3
  75. package/dist/esm/commands/delete.js +2 -2
  76. package/dist/esm/commands/insert.js +15 -15
  77. package/dist/esm/commands-with-analytics.js +7 -7
  78. package/dist/esm/event-handlers.js +2 -2
  79. package/dist/esm/nodeviews/TableComponent.js +45 -58
  80. package/dist/esm/nodeviews/TableContainer.js +6 -6
  81. package/dist/esm/nodeviews/TableResizer.js +14 -14
  82. package/dist/esm/nodeviews/table.js +9 -9
  83. package/dist/esm/plugin.js +58 -56
  84. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +13 -13
  85. package/dist/esm/pm-plugins/keymap.js +6 -8
  86. package/dist/esm/pm-plugins/main.js +4 -6
  87. package/dist/esm/pm-plugins/sticky-headers/plugin.js +2 -3
  88. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +12 -12
  89. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  90. package/dist/esm/pm-plugins/table-resizing/utils/consts.js +3 -1
  91. package/dist/esm/pm-plugins/table-resizing/utils/index.js +1 -1
  92. package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -2
  93. package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +4 -3
  94. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +13 -14
  95. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +13 -13
  96. package/dist/esm/pm-plugins/table-width.js +6 -2
  97. package/dist/esm/toolbar.js +21 -21
  98. package/dist/esm/transforms/column-width.js +5 -5
  99. package/dist/esm/transforms/delete-columns.js +2 -2
  100. package/dist/esm/ui/ColumnResizeWidget/index.js +0 -1
  101. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +53 -55
  102. package/dist/esm/ui/FloatingContextualMenu/index.js +2 -4
  103. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -2
  104. package/dist/esm/ui/FloatingDragMenu/index.js +6 -6
  105. package/dist/esm/ui/FloatingInsertButton/index.js +6 -7
  106. package/dist/esm/utils/create.js +2 -5
  107. package/dist/esm/utils/drag-menu.js +4 -4
  108. package/dist/esm/utils/guidelines.js +5 -2
  109. package/dist/esm/utils/snapping.js +14 -1
  110. package/dist/types/commands/column-resize.d.ts +1 -1
  111. package/dist/types/commands/delete.d.ts +1 -1
  112. package/dist/types/commands/insert.d.ts +7 -7
  113. package/dist/types/commands-with-analytics.d.ts +3 -3
  114. package/dist/types/event-handlers.d.ts +1 -1
  115. package/dist/types/nodeviews/TableComponent.d.ts +2 -3
  116. package/dist/types/nodeviews/TableContainer.d.ts +4 -4
  117. package/dist/types/nodeviews/TableResizer.d.ts +2 -2
  118. package/dist/types/nodeviews/table.d.ts +1 -1
  119. package/dist/types/nodeviews/types.d.ts +1 -0
  120. package/dist/types/plugin.d.ts +1 -0
  121. package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -2
  122. package/dist/types/pm-plugins/keymap.d.ts +2 -2
  123. package/dist/types/pm-plugins/main.d.ts +1 -1
  124. package/dist/types/pm-plugins/sticky-headers/plugin.d.ts +2 -3
  125. package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
  126. package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  127. package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  128. package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
  129. package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -1
  130. package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +4 -4
  131. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +4 -4
  132. package/dist/types/pm-plugins/table-width.d.ts +1 -2
  133. package/dist/types/toolbar.d.ts +2 -2
  134. package/dist/types/transforms/column-width.d.ts +1 -1
  135. package/dist/types/transforms/delete-columns.d.ts +1 -1
  136. package/dist/types/types.d.ts +1 -0
  137. package/dist/types/ui/ColumnResizeWidget/index.d.ts +2 -2
  138. package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
  139. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  140. package/dist/types/ui/FloatingDragMenu/index.d.ts +2 -3
  141. package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -2
  142. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  143. package/dist/types/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
  144. package/dist/types/ui/TableFloatingColumnControls/index.d.ts +2 -2
  145. package/dist/types/utils/create.d.ts +1 -2
  146. package/dist/types/utils/drag-menu.d.ts +2 -2
  147. package/dist/types/utils/guidelines.d.ts +1 -0
  148. package/dist/types/utils/snapping.d.ts +2 -0
  149. package/dist/types-ts4.5/commands/column-resize.d.ts +1 -1
  150. package/dist/types-ts4.5/commands/delete.d.ts +1 -1
  151. package/dist/types-ts4.5/commands/insert.d.ts +7 -7
  152. package/dist/types-ts4.5/commands-with-analytics.d.ts +3 -3
  153. package/dist/types-ts4.5/event-handlers.d.ts +1 -1
  154. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +2 -3
  155. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -4
  156. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -2
  157. package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
  158. package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
  159. package/dist/types-ts4.5/plugin.d.ts +1 -0
  160. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -2
  161. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -2
  162. package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
  163. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin.d.ts +2 -3
  164. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
  165. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  166. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  167. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
  168. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -1
  169. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +4 -4
  170. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +4 -4
  171. package/dist/types-ts4.5/pm-plugins/table-width.d.ts +1 -2
  172. package/dist/types-ts4.5/toolbar.d.ts +2 -2
  173. package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
  174. package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
  175. package/dist/types-ts4.5/types.d.ts +1 -0
  176. package/dist/types-ts4.5/ui/ColumnResizeWidget/index.d.ts +2 -2
  177. package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
  178. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  179. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +2 -3
  180. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -2
  181. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.d.ts +2 -2
  182. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnDropTargets/index.d.ts +2 -2
  183. package/dist/types-ts4.5/ui/TableFloatingColumnControls/index.d.ts +2 -2
  184. package/dist/types-ts4.5/utils/create.d.ts +1 -2
  185. package/dist/types-ts4.5/utils/drag-menu.d.ts +2 -2
  186. package/dist/types-ts4.5/utils/guidelines.d.ts +1 -0
  187. package/dist/types-ts4.5/utils/snapping.d.ts +2 -0
  188. package/package.json +2 -2
  189. package/src/commands/column-resize.ts +4 -3
  190. package/src/commands/delete.ts +2 -2
  191. package/src/commands/insert.ts +15 -27
  192. package/src/commands-with-analytics.ts +6 -9
  193. package/src/event-handlers.ts +2 -2
  194. package/src/nodeviews/TableComponent.tsx +31 -46
  195. package/src/nodeviews/TableContainer.tsx +16 -7
  196. package/src/nodeviews/TableResizer.tsx +44 -24
  197. package/src/nodeviews/table.tsx +6 -5
  198. package/src/nodeviews/types.ts +1 -0
  199. package/src/plugin.tsx +12 -28
  200. package/src/pm-plugins/drag-and-drop/plugin.ts +10 -15
  201. package/src/pm-plugins/keymap.ts +6 -13
  202. package/src/pm-plugins/main.ts +3 -3
  203. package/src/pm-plugins/sticky-headers/plugin.ts +2 -11
  204. package/src/pm-plugins/table-resizing/event-handlers.ts +6 -4
  205. package/src/pm-plugins/table-resizing/utils/colgroup.ts +2 -2
  206. package/src/pm-plugins/table-resizing/utils/consts.ts +2 -0
  207. package/src/pm-plugins/table-resizing/utils/index.ts +1 -1
  208. package/src/pm-plugins/table-resizing/utils/misc.ts +2 -2
  209. package/src/pm-plugins/table-resizing/utils/resize-column.ts +5 -2
  210. package/src/pm-plugins/table-resizing/utils/resize-state.ts +18 -13
  211. package/src/pm-plugins/table-resizing/utils/scale-table.ts +14 -14
  212. package/src/pm-plugins/table-width.ts +4 -6
  213. package/src/toolbar.tsx +16 -19
  214. package/src/transforms/column-width.ts +7 -6
  215. package/src/transforms/delete-columns.ts +2 -2
  216. package/src/types.ts +1 -0
  217. package/src/ui/ColumnResizeWidget/index.tsx +2 -4
  218. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +11 -16
  219. package/src/ui/FloatingContextualMenu/index.tsx +0 -2
  220. package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -3
  221. package/src/ui/FloatingDragMenu/index.tsx +4 -8
  222. package/src/ui/FloatingInsertButton/index.tsx +11 -22
  223. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/ColumnDropTarget.tsx +2 -2
  224. package/src/ui/TableFloatingColumnControls/ColumnDropTargets/index.tsx +2 -2
  225. package/src/ui/TableFloatingColumnControls/index.tsx +2 -2
  226. package/src/utils/create.ts +2 -5
  227. package/src/utils/drag-menu.ts +8 -13
  228. package/src/utils/guidelines.ts +12 -1
  229. package/src/utils/snapping.ts +36 -0
@@ -1,11 +1,11 @@
1
1
  import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import type { Command, EditorCommand, GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
2
+ import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
3
3
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth, tablePreserveWidth?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
6
- export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth, tablePreserveWidth?: boolean) => Command;
7
- export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
8
- export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth, tablePreserveWidth?: boolean) => (column: number) => Command;
5
+ export declare function addColumnAt(isTableScalingEnabled?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
6
+ export declare const addColumnBefore: (isTableScalingEnabled?: boolean) => Command;
7
+ export declare const addColumnAfter: (isTableScalingEnabled?: boolean) => Command;
8
+ export declare const insertColumn: (isTableScalingEnabled?: boolean) => (column: number) => Command;
9
9
  export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
10
- export declare const createTable: (isFullWidthModeEnabled?: boolean, getEditorFeatureFlags?: GetEditorFeatureFlags) => Command;
11
- export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, getEditorFeatureFlags?: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
10
+ export declare const createTable: (isTableScalingEnabled?: boolean, isFullWidthModeEnabled?: boolean) => Command;
11
+ export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
@@ -11,10 +11,10 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
11
11
  export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, targetCellPosition?: number) => Command;
12
12
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
13
13
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
14
- export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, tablePreserveWidth: boolean, inputMethod: INPUT_METHOD.SHORTCUT) => Command;
15
- export declare const insertColumnWithAnalytics: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, tablePreserveWidth?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
14
+ export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT) => Command;
15
+ export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
16
16
  export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
17
- export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, tablePreserveWidth?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
17
+ export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
18
18
  export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
19
19
  export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
20
20
  export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
@@ -13,7 +13,7 @@ export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) =>
13
13
  export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
14
14
  export declare const handleMouseMove: (view: EditorView, event: Event, elementContentRects?: ElementContentRects) => boolean;
15
15
  export declare function handleTripleClick(view: EditorView, pos: number): boolean;
16
- export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, tablePreserveWidth?: boolean) => Transaction;
16
+ export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean) => Transaction;
17
17
  export declare const isTableInFocus: (view: EditorView) => boolean;
18
18
  export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
19
19
  export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event, elementContentRects?: ElementContentRects) => boolean, elementContentRects?: ElementContentRects) => (view: EditorView, mouseEvent: Event) => boolean;
@@ -23,13 +23,13 @@ export interface ComponentProps {
23
23
  isHeaderColumnEnabled: boolean;
24
24
  isMediaFullscreen?: boolean;
25
25
  isDragAndDropEnabled?: boolean;
26
+ isTableScalingEnabled?: boolean;
26
27
  tableActive: boolean;
27
28
  ordering: TableColumnOrdering;
28
29
  isResizing?: boolean;
29
30
  getEditorFeatureFlags: GetEditorFeatureFlags;
30
31
  dispatchAnalyticsEvent: DispatchAnalyticsEvent;
31
32
  pluginInjectionApi?: PluginInjectionAPI;
32
- tableRef?: HTMLElement | undefined;
33
33
  }
34
34
  interface TableState {
35
35
  scroll: number;
@@ -51,11 +51,10 @@ declare class TableComponent extends React.Component<ComponentProps, TableState>
51
51
  private isInitialOverflowSent;
52
52
  private initialOverflowCaptureTimerId?;
53
53
  private dragAndDropCleanupFn?;
54
- private tableColumnWidths?;
55
54
  constructor(props: ComponentProps);
56
55
  componentDidMount(): void;
57
56
  componentWillUnmount(): void;
58
- handleColgroupUpdates(): void;
57
+ handleColgroupUpdates(force?: boolean): void;
59
58
  componentDidUpdate(_: any, prevState: TableState): void;
60
59
  private updateShadowState;
61
60
  private createShadowSentinels;
@@ -24,9 +24,9 @@ type ResizableTableContainerProps = {
24
24
  tableRef: HTMLTableElement;
25
25
  isResizing?: boolean;
26
26
  pluginInjectionApi?: PluginInjectionAPI;
27
- tablePreserveWidth?: boolean;
27
+ isTableScalingEnabled?: boolean;
28
28
  };
29
- export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tablePreserveWidth, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
29
+ export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
30
30
  type TableContainerProps = {
31
31
  node: PMNode;
32
32
  className: string;
@@ -39,7 +39,7 @@ type TableContainerProps = {
39
39
  isNested: boolean;
40
40
  isResizing?: boolean;
41
41
  pluginInjectionApi?: PluginInjectionAPI;
42
- tablePreserveWidth?: boolean;
42
+ isTableScalingEnabled?: boolean;
43
43
  };
44
- export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, tablePreserveWidth, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
44
+ export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, isTableScalingEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
45
45
  export {};
@@ -16,11 +16,11 @@ interface TableResizerProps {
16
16
  displayGuideline: (guideline: GuidelineConfig[]) => boolean;
17
17
  attachAnalyticsEvent: (payload: TableEventPayload) => ((tr: Transaction) => boolean) | undefined;
18
18
  displayGapCursor: (toggle: boolean) => boolean;
19
- tablePreserveWidth?: boolean;
19
+ isTableScalingEnabled?: boolean;
20
20
  }
21
21
  export interface TableResizerImprovementProps extends TableResizerProps {
22
22
  onResizeStop?: () => void;
23
23
  onResizeStart?: () => void;
24
24
  }
25
- export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, tablePreserveWidth, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
25
+ export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
26
26
  export {};
@@ -14,7 +14,7 @@ export default class TableView extends ReactNodeView<Props> {
14
14
  private resizeObserver?;
15
15
  eventDispatcher?: EventDispatcher;
16
16
  getPos: getPosHandlerNode;
17
- getEditorFeatureFlags: GetEditorFeatureFlags;
17
+ options: import("./types").TableOptions | undefined;
18
18
  constructor(props: Props);
19
19
  getContentDOM(): {
20
20
  dom: HTMLElement;
@@ -11,6 +11,7 @@ export type TableOptions = {
11
11
  wasFullWidthModeEnabled?: boolean;
12
12
  isTableResizingEnabled?: boolean;
13
13
  isDragAndDropEnabled?: boolean;
14
+ isTableScalingEnabled?: boolean;
14
15
  };
15
16
  export interface Props {
16
17
  node: PmNode;
@@ -16,6 +16,7 @@ export interface TablePluginOptions {
16
16
  fullWidthEnabled?: boolean;
17
17
  wasFullWidthEnabled?: boolean;
18
18
  getEditorFeatureFlags?: GetEditorFeatureFlags;
19
+ isTableScalingEnabled?: boolean;
19
20
  }
20
21
  type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
21
22
  export type TablePlugin = NextEditorPlugin<'table', {
@@ -1,5 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
5
- export declare const createPlugin: (dispatch: Dispatch, getEditorFeatureFlags?: GetEditorFeatureFlags, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<import("./types").DragAndDropPluginState>;
4
+ export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<import("./types").DragAndDropPluginState>;
@@ -1,5 +1,5 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags?: GetEditorFeatureFlags, dragAndDropEnabled?: boolean): SafePlugin;
3
+ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
4
+ export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean): SafePlugin;
5
5
  export default keymapPlugin;
@@ -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, tableResizingEnabled?: boolean, fullWidthModeEnabled?: 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, isTableScalingEnabled?: boolean) => SafePlugin<import("../types").TablePluginState>;
@@ -1,4 +1,3 @@
1
- import type { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
1
+ import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
- export declare const createPlugin: (dispatch: Dispatch, eventDispatcher: EventDispatcher, initialState: (() => never[]) | undefined, getEditorFeatureFlags: GetEditorFeatureFlags) => SafePlugin<import("./types").StickyPluginState>;
3
+ export declare const createPlugin: (dispatch: Dispatch, initialState?: () => never[]) => SafePlugin<import("./types").StickyPluginState>;
@@ -10,7 +10,7 @@ type Col = Array<string | {
10
10
  */
11
11
  export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
12
12
  export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement) => Col[];
13
- export declare const insertColgroupFromNode: (tableRef: HTMLTableElement, table: PmNode, tablePreserveWidth?: boolean, shouldRemove?: boolean) => HTMLCollection;
13
+ export declare const insertColgroupFromNode: (tableRef: HTMLTableElement, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean) => HTMLCollection;
14
14
  export declare const hasTableBeenResized: (table: PmNode) => boolean;
15
15
  /**
16
16
  * Check if a table has all the column width set to tableCellMinWidth(48px) or null
@@ -2,3 +2,4 @@ export declare const COLUMN_MIN_WIDTH = 48;
2
2
  export declare const TABLE_DEFAULT_WIDTH = 760;
3
3
  export declare const TABLE_MAX_WIDTH = 1800;
4
4
  export declare const MAX_SCALING_PERCENT = 0.3;
5
+ export declare const TABLE_EDITOR_MARGIN = 76;
@@ -4,7 +4,7 @@ export { getColumnStateFromDOM, getFreeSpace, getCellsRefsInColumn, calculateCol
4
4
  export type { ColumnState } from './column-state';
5
5
  export { growColumn, shrinkColumn, reduceSpace } from './resize-logic';
6
6
  export { getResizeState, updateColgroup, getTotalWidth, evenAllColumnsWidths, bulkColumnsResize, areColumnsEven, adjustColumnsWidths, } from './resize-state';
7
- export { getLayoutSize, getDefaultLayoutMaxWidth, pointsAtCell, currentColWidth, domCellAround, getTableMaxWidth, getTableElementWidth, getTableContainerElement, } from './misc';
7
+ export { getLayoutSize, getDefaultLayoutMaxWidth, pointsAtCell, currentColWidth, domCellAround, getTableMaxWidth, getTableElementWidth, getTableContainerElementWidth, } from './misc';
8
8
  export { updateControls, isClickNear, getResizeCellPos } from './dom';
9
9
  export { scale, scaleWithParent, scaleTable, previewScaleTable, } from './scale-table';
10
10
  export type { ScaleOptions } from './scale-table';
@@ -23,5 +23,5 @@ export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getE
23
23
  * @returns calculated width of <table /> element derived from sum of colwidths on tableCell or tableHeader nodes or falls back to container width
24
24
  */
25
25
  export declare const getTableElementWidth: (table: PMNode) => number;
26
- export declare const getTableContainerElement: (table: PMNode) => number;
26
+ export declare const getTableContainerElementWidth: (table: PMNode) => number;
27
27
  export {};
@@ -1,2 +1,3 @@
1
+ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
1
2
  import type { ResizeState } from './types';
2
- export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement, selectedColumns?: number[], tablePreserveWidth?: boolean) => ResizeState;
3
+ export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean) => ResizeState;
@@ -4,7 +4,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { Rect } from '@atlaskit/editor-tables/table-map';
6
6
  import type { ResizeState, ResizeStateWithAnalytics } from './types';
7
- export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, tablePreserveWidth, }: {
7
+ export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, isTableScalingEnabled, }: {
8
8
  minWidth: number;
9
9
  maxSize: number;
10
10
  table: PMNode;
@@ -14,9 +14,9 @@ export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, star
14
14
  node: Node;
15
15
  offset: number;
16
16
  };
17
- tablePreserveWidth: boolean;
17
+ isTableScalingEnabled: boolean;
18
18
  }) => ResizeState;
19
- export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement, tablePreserveWidth?: boolean) => void;
19
+ export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement, tableNode?: PMNode, isTableScalingEnabled?: boolean) => void;
20
20
  export declare const getTotalWidth: ({ cols }: ResizeState) => number;
21
21
  export declare const adjustColumnsWidths: (resizeState: ResizeState, maxSize: number) => ResizeState;
22
22
  export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeState;
@@ -27,4 +27,4 @@ export declare const normaliseTableLayout: (input: string | undefined | null) =>
27
27
  export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
28
28
  node: Node;
29
29
  offset: number;
30
- }, getEditorContainerWidth: GetEditorContainerWidth, tablePreserveWidth?: boolean) => ResizeStateWithAnalytics | undefined;
30
+ }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
@@ -14,8 +14,8 @@ export interface ScaleOptions {
14
14
  isFullWidthModeEnabled?: boolean;
15
15
  isTableResizingEnabled?: boolean;
16
16
  }
17
- export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, tablePreserveWidth?: boolean) => ResizeState | undefined;
18
- export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, tablePreserveWidth?: boolean) => ResizeState;
17
+ export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => ResizeState | undefined;
18
+ export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => ResizeState;
19
19
  export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
20
- export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, tablePreserveWidth?: boolean) => void;
21
- export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, tablePreserveWidth?: boolean) => (tr: Transaction) => Transaction;
20
+ export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => void;
21
+ export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => (tr: Transaction) => Transaction;
@@ -6,13 +6,12 @@
6
6
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
7
7
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
8
8
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
9
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
10
9
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
11
10
  type TableWidthPluginState = {
12
11
  resizing: boolean;
13
12
  };
14
13
  export declare const pluginKey: PluginKey<TableWidthPluginState>;
15
- declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean, getEditorFeatureFlags?: GetEditorFeatureFlags) => SafePlugin<{
14
+ declare const createPlugin: (dispatch: Dispatch, dispatchAnalyticsEvent: DispatchAnalyticsEvent, fullWidthEnabled: boolean) => SafePlugin<{
16
15
  resizing: boolean;
17
16
  }>;
18
17
  export { createPlugin };
@@ -5,8 +5,8 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import { Rect } from '@atlaskit/editor-tables/table-map';
6
6
  import type { PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
7
7
  export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
8
- export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, tablePreserveWidth?: boolean) => FloatingToolbarDropdown<Command>;
8
+ export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => FloatingToolbarDropdown<Command>;
9
9
  export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
10
10
  export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
11
11
  export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null) => (config: PluginConfig) => FloatingToolbarHandler;
12
- export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, tablePreserveWidth?: boolean) => Command;
12
+ export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
@@ -21,4 +21,4 @@ export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNod
21
21
  * @param view
22
22
  * @returns Updated transaction with rescaled columns for a given table
23
23
  */
24
- export declare const rescaleColumns: (tablePreserveWidth?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
24
+ export declare const rescaleColumns: (isTableScalingEnabled?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
@@ -1,4 +1,4 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Rect } from '@atlaskit/editor-tables/table-map';
4
- export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, tablePreserveWidth?: boolean) => (tr: Transaction) => Transaction;
4
+ export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean) => (tr: Transaction) => Transaction;
@@ -89,6 +89,7 @@ export interface TablePluginState {
89
89
  isTableResizingEnabled?: boolean;
90
90
  isDragAndDropEnabled?: boolean;
91
91
  isTableHovered?: boolean;
92
+ isTableScalingEnabled?: boolean;
92
93
  }
93
94
  export type TablePluginAction = {
94
95
  type: 'SET_EDITOR_FOCUS';
@@ -1,9 +1,9 @@
1
1
  /** @jsx jsx */
2
- import React from 'react';
2
+ import { jsx } from '@emotion/react';
3
3
  type Props = {
4
4
  startIndex: number;
5
5
  endIndex: number;
6
6
  includeTooltip?: boolean;
7
7
  };
8
- export declare const ColumnResizeWidget: React.FC<Props>;
8
+ export declare const ColumnResizeWidget: ({ startIndex, endIndex, includeTooltip, }: Props) => jsx.JSX.Element;
9
9
  export {};
@@ -17,7 +17,7 @@ export interface Props {
17
17
  editorAnalyticsAPI?: EditorAnalyticsAPI;
18
18
  }
19
19
  declare const FloatingContextualMenu: {
20
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, getEditorFeatureFlags, }: Props): jsx.JSX.Element | null;
20
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, pluginConfig, editorAnalyticsAPI, getEditorContainerWidth, }: Props): jsx.JSX.Element | null;
21
21
  displayName: string;
22
22
  };
23
23
  export default FloatingContextualMenu;
@@ -24,9 +24,9 @@ type DragMenuProps = {
24
24
  mountPoint?: HTMLElement;
25
25
  boundariesElement?: HTMLElement;
26
26
  scrollableElement?: HTMLElement;
27
- tablePreserveWidth?: boolean;
27
+ isTableScalingEnabled?: boolean;
28
28
  };
29
- export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, tablePreserveWidth, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
29
+ export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
30
30
  declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps<"intl">>> & {
31
31
  WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps<"intl">>;
32
32
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
3
+ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
4
4
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
@@ -20,10 +20,9 @@ export interface Props {
20
20
  editorAnalyticsAPI?: EditorAnalyticsAPI;
21
21
  stickyHeaders?: RowStickyState;
22
22
  pluginConfig?: PluginConfig;
23
- getEditorFeatureFlags: GetEditorFeatureFlags;
24
23
  }
25
24
  declare const FloatingDragMenu: {
26
- ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, getEditorFeatureFlags, }: Props): JSX.Element | null;
25
+ ({ mountPoint, boundariesElement, scrollableElement, editorView, isOpen, tableNode, direction, index, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, stickyHeaders, pluginConfig, }: Props): JSX.Element | null;
27
26
  displayName: string;
28
27
  };
29
28
  export default FloatingDragMenu;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { WrappedComponentProps } from 'react-intl-next';
3
3
  import type { DispatchAnalyticsEvent, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
- import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
+ import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
5
5
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
6
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
7
  export interface Props {
@@ -20,7 +20,6 @@ export interface Props {
20
20
  hasStickyHeaders?: boolean;
21
21
  dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
22
22
  editorAnalyticsAPI?: EditorAnalyticsAPI;
23
- getEditorFeatureFlags?: GetEditorFeatureFlags;
24
23
  }
25
24
  export declare class FloatingInsertButton extends React.Component<Props & WrappedComponentProps, any> {
26
25
  static displayName: string;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export interface Props {
3
3
  index: number;
4
4
  localId?: string;
@@ -6,4 +6,4 @@ export interface Props {
6
6
  height?: number;
7
7
  marginTop?: number;
8
8
  }
9
- export declare const ColumnDropTarget: React.FC<Props>;
9
+ export declare const ColumnDropTarget: ({ index, localId, width, height, marginTop, }: Props) => JSX.Element;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export interface Props {
3
3
  tableRef: HTMLTableElement;
4
4
  tableHeight?: number;
@@ -7,4 +7,4 @@ export interface Props {
7
7
  isHeaderSticky?: boolean;
8
8
  getScrollOffset?: () => number;
9
9
  }
10
- export declare const ColumnDropTargets: React.FC<Props>;
10
+ export declare const ColumnDropTargets: ({ tableRef, tableHeight, localId, colWidths, isHeaderSticky, getScrollOffset, }: Props) => JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import type { TableColumnOrdering } from '@atlaskit/custom-steps';
3
3
  import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
4
4
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
@@ -26,5 +26,5 @@ export interface Props {
26
26
  isNumberColumnEnabled?: boolean;
27
27
  getScrollOffset?: () => number;
28
28
  }
29
- export declare const TableFloatingColumnControls: React.FC<Props>;
29
+ export declare const TableFloatingColumnControls: ({ editorView, tableRef, getNode, tableActive, hasHeaderRow, hoveredCell, isResizing, stickyHeader, selection, isInDanger, isTableHovered, tableContainerWidth, isNumberColumnEnabled, getScrollOffset, }: Props) => JSX.Element | null;
30
30
  export default TableFloatingColumnControls;
@@ -1,6 +1,5 @@
1
- import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
2
1
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- export declare const createTableWithWidth: (isFullWidthModeEnabled?: boolean, getEditorFeatureFlags?: GetEditorFeatureFlags, createTableProps?: {
2
+ export declare const createTableWithWidth: (isTableScalingEnabled?: boolean, isFullWidthModeEnabled?: boolean, createTableProps?: {
4
3
  rowsCount?: number;
5
4
  colsCount?: number;
6
5
  }) => (schema: Schema) => import("prosemirror-model").Node;
@@ -10,7 +10,7 @@ export declare const canMove: (sourceType: DraggableType, direction: DraggableDa
10
10
  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';
11
11
  export interface DragMenuConfig extends DropdownOptionT<Command> {
12
12
  id: DragMenuOptionIdType;
13
- icon?: React.ComponentType<IconProps>;
13
+ icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
14
14
  keymap?: string;
15
15
  }
16
- export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, tablePreserveWidth?: boolean) => DragMenuConfig[];
16
+ export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean) => DragMenuConfig[];
@@ -1,2 +1,3 @@
1
1
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  export declare const defaultGuidelines: GuidelineConfig[];
3
+ export declare const defaultGuidelinesForPreserveTable: (editorContainerWidth: number) => GuidelineConfig[];
@@ -1,6 +1,8 @@
1
1
  import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
2
2
  export declare const calculateDefaultSnappings: (lengthOffset?: number) => number[];
3
+ export declare const calculateDefaultTablePreserveSnappings: (lengthOffset?: number, editorContainerWith?: number) => number[];
3
4
  export declare const defaultSnappingWidths: number[];
5
+ export declare const defaultTablePreserveSnappingWidths: (editorContainerWidth: number) => number[];
4
6
  /**
5
7
  * Returns keys of guidelines that are closest to the table and withthin the snapGap
6
8
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.5.3",
3
+ "version": "7.5.5",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/primitives": "^4.0.0",
50
50
  "@atlaskit/theme": "^12.6.0",
51
51
  "@atlaskit/toggle": "^13.0.0",
52
- "@atlaskit/tokens": "^1.39.0",
52
+ "@atlaskit/tokens": "^1.40.0",
53
53
  "@atlaskit/tooltip": "^18.1.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
@@ -228,7 +228,7 @@ export const changeColumnWidthByStep =
228
228
  (
229
229
  stepSize: number,
230
230
  getEditorContainerWidth: GetEditorContainerWidth,
231
- tablePreserveWidth = false,
231
+ isTableScalingEnabled = false,
232
232
  ): Command =>
233
233
  (state, dispatch, view) => {
234
234
  let customTr = state.tr;
@@ -290,7 +290,7 @@ export const changeColumnWidthByStep =
290
290
  tableRef: dom,
291
291
  start: tableStartPosition,
292
292
  domAtPos,
293
- tablePreserveWidth,
293
+ isTableScalingEnabled,
294
294
  });
295
295
 
296
296
  updateControls()(state);
@@ -308,8 +308,9 @@ export const changeColumnWidthByStep =
308
308
  colIndex,
309
309
  stepSize,
310
310
  dom,
311
+ originalTable,
311
312
  resizingSelectedColumns ? selectedColumns : undefined,
312
- tablePreserveWidth,
313
+ isTableScalingEnabled,
313
314
  );
314
315
 
315
316
  customTr = updateColumnWidths(
@@ -5,13 +5,13 @@ import { deleteColumns } from '../transforms/delete-columns';
5
5
  import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
6
6
 
7
7
  export const deleteColumnsCommand =
8
- (rect: Rect, tablePreserveWidth = false): Command =>
8
+ (rect: Rect, isTableScalingEnabled = false): Command =>
9
9
  (state, dispatch, view) => {
10
10
  const tr = deleteColumns(
11
11
  rect,
12
12
  getAllowAddColumnCustomStep(state),
13
13
  view,
14
- tablePreserveWidth,
14
+ isTableScalingEnabled,
15
15
  )(state.tr);
16
16
  if (dispatch) {
17
17
  dispatch(tr);