@atlaskit/editor-plugin-table 7.5.4 → 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 (202) hide show
  1. package/CHANGELOG.md +7 -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/FloatingContextualMenu/ContextualMenu.js +53 -55
  29. package/dist/cjs/ui/FloatingContextualMenu/index.js +2 -4
  30. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -2
  31. package/dist/cjs/ui/FloatingDragMenu/index.js +6 -6
  32. package/dist/cjs/ui/FloatingInsertButton/index.js +6 -7
  33. package/dist/cjs/utils/create.js +2 -5
  34. package/dist/cjs/utils/drag-menu.js +4 -4
  35. package/dist/es2019/commands/column-resize.js +3 -3
  36. package/dist/es2019/commands/delete.js +2 -2
  37. package/dist/es2019/commands/insert.js +12 -12
  38. package/dist/es2019/commands-with-analytics.js +6 -6
  39. package/dist/es2019/event-handlers.js +2 -2
  40. package/dist/es2019/nodeviews/TableComponent.js +25 -36
  41. package/dist/es2019/nodeviews/TableContainer.js +5 -5
  42. package/dist/es2019/nodeviews/TableResizer.js +12 -12
  43. package/dist/es2019/nodeviews/table.js +9 -9
  44. package/dist/es2019/plugin.js +17 -17
  45. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +6 -6
  46. package/dist/es2019/pm-plugins/keymap.js +5 -8
  47. package/dist/es2019/pm-plugins/main.js +3 -5
  48. package/dist/es2019/pm-plugins/sticky-headers/plugin.js +1 -1
  49. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +5 -5
  50. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  51. package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +3 -1
  52. package/dist/es2019/pm-plugins/table-resizing/utils/index.js +1 -1
  53. package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -2
  54. package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +3 -2
  55. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +12 -13
  56. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +13 -13
  57. package/dist/es2019/pm-plugins/table-width.js +6 -2
  58. package/dist/es2019/toolbar.js +15 -15
  59. package/dist/es2019/transforms/column-width.js +5 -5
  60. package/dist/es2019/transforms/delete-columns.js +2 -2
  61. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +9 -12
  62. package/dist/es2019/ui/FloatingContextualMenu/index.js +2 -4
  63. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -2
  64. package/dist/es2019/ui/FloatingDragMenu/index.js +5 -5
  65. package/dist/es2019/ui/FloatingInsertButton/index.js +5 -6
  66. package/dist/es2019/utils/create.js +2 -5
  67. package/dist/es2019/utils/drag-menu.js +4 -4
  68. package/dist/esm/commands/column-resize.js +3 -3
  69. package/dist/esm/commands/delete.js +2 -2
  70. package/dist/esm/commands/insert.js +15 -15
  71. package/dist/esm/commands-with-analytics.js +7 -7
  72. package/dist/esm/event-handlers.js +2 -2
  73. package/dist/esm/nodeviews/TableComponent.js +45 -58
  74. package/dist/esm/nodeviews/TableContainer.js +5 -5
  75. package/dist/esm/nodeviews/TableResizer.js +12 -12
  76. package/dist/esm/nodeviews/table.js +9 -9
  77. package/dist/esm/plugin.js +58 -56
  78. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +13 -13
  79. package/dist/esm/pm-plugins/keymap.js +6 -8
  80. package/dist/esm/pm-plugins/main.js +4 -6
  81. package/dist/esm/pm-plugins/sticky-headers/plugin.js +2 -3
  82. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +12 -12
  83. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  84. package/dist/esm/pm-plugins/table-resizing/utils/consts.js +3 -1
  85. package/dist/esm/pm-plugins/table-resizing/utils/index.js +1 -1
  86. package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -2
  87. package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +4 -3
  88. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +13 -14
  89. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +13 -13
  90. package/dist/esm/pm-plugins/table-width.js +6 -2
  91. package/dist/esm/toolbar.js +21 -21
  92. package/dist/esm/transforms/column-width.js +5 -5
  93. package/dist/esm/transforms/delete-columns.js +2 -2
  94. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +53 -55
  95. package/dist/esm/ui/FloatingContextualMenu/index.js +2 -4
  96. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -2
  97. package/dist/esm/ui/FloatingDragMenu/index.js +6 -6
  98. package/dist/esm/ui/FloatingInsertButton/index.js +6 -7
  99. package/dist/esm/utils/create.js +2 -5
  100. package/dist/esm/utils/drag-menu.js +4 -4
  101. package/dist/types/commands/column-resize.d.ts +1 -1
  102. package/dist/types/commands/delete.d.ts +1 -1
  103. package/dist/types/commands/insert.d.ts +7 -7
  104. package/dist/types/commands-with-analytics.d.ts +3 -3
  105. package/dist/types/event-handlers.d.ts +1 -1
  106. package/dist/types/nodeviews/TableComponent.d.ts +2 -3
  107. package/dist/types/nodeviews/TableContainer.d.ts +4 -4
  108. package/dist/types/nodeviews/TableResizer.d.ts +2 -2
  109. package/dist/types/nodeviews/table.d.ts +1 -1
  110. package/dist/types/nodeviews/types.d.ts +1 -0
  111. package/dist/types/plugin.d.ts +1 -0
  112. package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -2
  113. package/dist/types/pm-plugins/keymap.d.ts +2 -2
  114. package/dist/types/pm-plugins/main.d.ts +1 -1
  115. package/dist/types/pm-plugins/sticky-headers/plugin.d.ts +2 -3
  116. package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
  117. package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  118. package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  119. package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
  120. package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -1
  121. package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +4 -4
  122. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +4 -4
  123. package/dist/types/pm-plugins/table-width.d.ts +1 -2
  124. package/dist/types/toolbar.d.ts +2 -2
  125. package/dist/types/transforms/column-width.d.ts +1 -1
  126. package/dist/types/transforms/delete-columns.d.ts +1 -1
  127. package/dist/types/types.d.ts +1 -0
  128. package/dist/types/ui/FloatingContextualMenu/index.d.ts +1 -1
  129. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  130. package/dist/types/ui/FloatingDragMenu/index.d.ts +2 -3
  131. package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -2
  132. package/dist/types/utils/create.d.ts +1 -2
  133. package/dist/types/utils/drag-menu.d.ts +1 -1
  134. package/dist/types-ts4.5/commands/column-resize.d.ts +1 -1
  135. package/dist/types-ts4.5/commands/delete.d.ts +1 -1
  136. package/dist/types-ts4.5/commands/insert.d.ts +7 -7
  137. package/dist/types-ts4.5/commands-with-analytics.d.ts +3 -3
  138. package/dist/types-ts4.5/event-handlers.d.ts +1 -1
  139. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +2 -3
  140. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -4
  141. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -2
  142. package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
  143. package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
  144. package/dist/types-ts4.5/plugin.d.ts +1 -0
  145. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -2
  146. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +2 -2
  147. package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
  148. package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin.d.ts +2 -3
  149. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -1
  150. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
  151. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +1 -1
  152. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +1 -1
  153. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -1
  154. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +4 -4
  155. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +4 -4
  156. package/dist/types-ts4.5/pm-plugins/table-width.d.ts +1 -2
  157. package/dist/types-ts4.5/toolbar.d.ts +2 -2
  158. package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
  159. package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
  160. package/dist/types-ts4.5/types.d.ts +1 -0
  161. package/dist/types-ts4.5/ui/FloatingContextualMenu/index.d.ts +1 -1
  162. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
  163. package/dist/types-ts4.5/ui/FloatingDragMenu/index.d.ts +2 -3
  164. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -2
  165. package/dist/types-ts4.5/utils/create.d.ts +1 -2
  166. package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
  167. package/package.json +2 -2
  168. package/src/commands/column-resize.ts +4 -3
  169. package/src/commands/delete.ts +2 -2
  170. package/src/commands/insert.ts +15 -27
  171. package/src/commands-with-analytics.ts +6 -9
  172. package/src/event-handlers.ts +2 -2
  173. package/src/nodeviews/TableComponent.tsx +31 -46
  174. package/src/nodeviews/TableContainer.tsx +7 -7
  175. package/src/nodeviews/TableResizer.tsx +14 -14
  176. package/src/nodeviews/table.tsx +6 -5
  177. package/src/nodeviews/types.ts +1 -0
  178. package/src/plugin.tsx +12 -28
  179. package/src/pm-plugins/drag-and-drop/plugin.ts +10 -15
  180. package/src/pm-plugins/keymap.ts +6 -13
  181. package/src/pm-plugins/main.ts +3 -3
  182. package/src/pm-plugins/sticky-headers/plugin.ts +2 -11
  183. package/src/pm-plugins/table-resizing/event-handlers.ts +6 -4
  184. package/src/pm-plugins/table-resizing/utils/colgroup.ts +2 -2
  185. package/src/pm-plugins/table-resizing/utils/consts.ts +2 -0
  186. package/src/pm-plugins/table-resizing/utils/index.ts +1 -1
  187. package/src/pm-plugins/table-resizing/utils/misc.ts +2 -2
  188. package/src/pm-plugins/table-resizing/utils/resize-column.ts +5 -2
  189. package/src/pm-plugins/table-resizing/utils/resize-state.ts +18 -13
  190. package/src/pm-plugins/table-resizing/utils/scale-table.ts +14 -14
  191. package/src/pm-plugins/table-width.ts +4 -6
  192. package/src/toolbar.tsx +16 -19
  193. package/src/transforms/column-width.ts +7 -6
  194. package/src/transforms/delete-columns.ts +2 -2
  195. package/src/types.ts +1 -0
  196. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +11 -16
  197. package/src/ui/FloatingContextualMenu/index.tsx +0 -2
  198. package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -3
  199. package/src/ui/FloatingDragMenu/index.tsx +4 -8
  200. package/src/ui/FloatingInsertButton/index.tsx +11 -22
  201. package/src/utils/create.ts +2 -5
  202. package/src/utils/drag-menu.ts +7 -12
@@ -63,7 +63,7 @@ var defaultSelectionRect = {
63
63
  };
64
64
  export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorContainerWidth, canDrag, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired) {
65
65
  var _tableMap$height, _tableMap$height2, _tableMap$width, _tableMap$width2;
66
- var tablePreserveWidth = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
66
+ var isTableScalingEnabled = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
67
67
  var addOptions = direction === 'row' ? [{
68
68
  label: 'above',
69
69
  offset: 0,
@@ -148,7 +148,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
148
148
  moveCursorToInsertedRow: true
149
149
  })(state, dispatch);
150
150
  } else {
151
- insertColumnWithAnalytics(getEditorContainerWidth, editorAnalyticsAPI, tablePreserveWidth)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
151
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
152
152
  }
153
153
  return true;
154
154
  },
@@ -161,7 +161,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
161
161
  onClick: function onClick(state, dispatch) {
162
162
  var selectionRect = getClosestSelectionRect(state);
163
163
  if (selectionRect) {
164
- var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, tablePreserveWidth);
164
+ var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
165
165
  if (newResizeState) {
166
166
  distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, newResizeState)(state, dispatch);
167
167
  return true;
@@ -187,7 +187,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
187
187
  if (direction === 'row') {
188
188
  deleteRowsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect, !!isHeaderRowRequired)(state, dispatch);
189
189
  } else {
190
- deleteColumnsWithAnalytics(editorAnalyticsAPI, tablePreserveWidth)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
190
+ deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
191
191
  }
192
192
  return true;
193
193
  },
@@ -3,5 +3,5 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Direction } from '@atlaskit/editor-tables/types';
4
4
  export declare const initiateKeyboardColumnResizing: Command;
5
5
  export declare const activateNextResizeArea: (direction: Direction) => Command;
6
- export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, tablePreserveWidth?: boolean) => Command;
6
+ export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => Command;
7
7
  export declare const stopKeyboardColumnResizing: (originalTr?: Transaction) => Command;
@@ -1,3 +1,3 @@
1
1
  import type { Command } from '@atlaskit/editor-common/types';
2
2
  import type { Rect } from '@atlaskit/editor-tables/table-map';
3
- export declare const deleteColumnsCommand: (rect: Rect, tablePreserveWidth?: boolean) => Command;
3
+ export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean) => Command;
@@ -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';
@@ -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,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;
@@ -13,4 +13,4 @@ export interface DragMenuConfig extends DropdownOptionT<Command> {
13
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[];
@@ -3,5 +3,5 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { Direction } from '@atlaskit/editor-tables/types';
4
4
  export declare const initiateKeyboardColumnResizing: Command;
5
5
  export declare const activateNextResizeArea: (direction: Direction) => Command;
6
- export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, tablePreserveWidth?: boolean) => Command;
6
+ export declare const changeColumnWidthByStep: (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => Command;
7
7
  export declare const stopKeyboardColumnResizing: (originalTr?: Transaction) => Command;
@@ -1,3 +1,3 @@
1
1
  import type { Command } from '@atlaskit/editor-common/types';
2
2
  import type { Rect } from '@atlaskit/editor-tables/table-map';
3
- export declare const deleteColumnsCommand: (rect: Rect, tablePreserveWidth?: boolean) => Command;
3
+ export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean) => Command;
@@ -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 {};