@atlaskit/editor-plugin-table 9.1.3 → 9.2.1

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 (211) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/cjs/nodeviews/TableCell.js +0 -2
  3. package/dist/cjs/nodeviews/TableComponent.js +5 -5
  4. package/dist/cjs/nodeviews/TableComponentWithSharedState.js +6 -4
  5. package/dist/cjs/nodeviews/TableContainer.js +13 -2
  6. package/dist/cjs/nodeviews/TableNodeViewBase.js +0 -2
  7. package/dist/cjs/nodeviews/TableResizer.js +5 -10
  8. package/dist/cjs/nodeviews/TableRow.js +0 -2
  9. package/dist/cjs/nodeviews/lazy-node-views.js +4 -16
  10. package/dist/cjs/nodeviews/table.js +3 -10
  11. package/dist/cjs/pm-plugins/commands/column-resize.js +1 -4
  12. package/dist/cjs/pm-plugins/commands/commands-with-analytics.js +4 -16
  13. package/dist/cjs/pm-plugins/commands/insert.js +4 -19
  14. package/dist/cjs/pm-plugins/commands/misc.js +3 -12
  15. package/dist/cjs/pm-plugins/decorations/plugin.js +1 -6
  16. package/dist/cjs/pm-plugins/decorations/utils/column-resizing.js +1 -4
  17. package/dist/cjs/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -12
  18. package/dist/cjs/pm-plugins/drag-and-drop/commands.js +3 -12
  19. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +1 -4
  20. package/dist/cjs/pm-plugins/keymap.js +0 -2
  21. package/dist/cjs/pm-plugins/main.js +1 -6
  22. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +1 -4
  23. package/dist/cjs/pm-plugins/table-resizing/plugin.js +0 -2
  24. package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +1 -7
  25. package/dist/cjs/pm-plugins/table-resizing/utils/column-state.js +1 -4
  26. package/dist/cjs/pm-plugins/table-resizing/utils/content-width.js +0 -8
  27. package/dist/cjs/pm-plugins/table-resizing/utils/resize-logic.js +2 -10
  28. package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +1 -4
  29. package/dist/cjs/pm-plugins/table-width.js +1 -6
  30. package/dist/cjs/pm-plugins/transforms/column-width.js +1 -4
  31. package/dist/cjs/pm-plugins/transforms/fix-tables.js +3 -15
  32. package/dist/cjs/pm-plugins/transforms/replace-table.js +1 -4
  33. package/dist/cjs/pm-plugins/transforms/split.js +0 -2
  34. package/dist/cjs/pm-plugins/utils/alignment.js +1 -4
  35. package/dist/cjs/pm-plugins/utils/decoration.js +4 -16
  36. package/dist/cjs/pm-plugins/utils/drag-menu.js +1 -4
  37. package/dist/cjs/pm-plugins/utils/nodes.js +0 -3
  38. package/dist/cjs/pm-plugins/utils/paste.js +4 -0
  39. package/dist/cjs/pm-plugins/utils/row-controls.js +1 -4
  40. package/dist/cjs/tablePlugin.js +1 -0
  41. package/dist/cjs/ui/DragHandle/index.js +55 -6
  42. package/dist/cjs/ui/FloatingInsertButton/getPopupOptions.js +0 -6
  43. package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +18 -6
  44. package/dist/cjs/ui/TableFloatingColumnControls/index.js +1 -2
  45. package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +61 -11
  46. package/dist/cjs/ui/TableFloatingControls/index.js +25 -8
  47. package/dist/cjs/ui/toolbar.js +3 -12
  48. package/dist/es2019/nodeviews/TableCell.js +0 -2
  49. package/dist/es2019/nodeviews/TableComponent.js +5 -5
  50. package/dist/es2019/nodeviews/TableComponentWithSharedState.js +6 -4
  51. package/dist/es2019/nodeviews/TableContainer.js +13 -2
  52. package/dist/es2019/nodeviews/TableNodeViewBase.js +0 -2
  53. package/dist/es2019/nodeviews/TableResizer.js +5 -10
  54. package/dist/es2019/nodeviews/TableRow.js +0 -2
  55. package/dist/es2019/nodeviews/lazy-node-views.js +4 -16
  56. package/dist/es2019/nodeviews/table.js +3 -10
  57. package/dist/es2019/pm-plugins/commands/column-resize.js +1 -4
  58. package/dist/es2019/pm-plugins/commands/commands-with-analytics.js +6 -24
  59. package/dist/es2019/pm-plugins/commands/delete.js +1 -4
  60. package/dist/es2019/pm-plugins/commands/insert.js +5 -23
  61. package/dist/es2019/pm-plugins/commands/misc.js +3 -12
  62. package/dist/es2019/pm-plugins/decorations/plugin.js +1 -6
  63. package/dist/es2019/pm-plugins/decorations/utils/column-resizing.js +1 -4
  64. package/dist/es2019/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -12
  65. package/dist/es2019/pm-plugins/drag-and-drop/commands.js +4 -16
  66. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +2 -8
  67. package/dist/es2019/pm-plugins/keymap.js +0 -3
  68. package/dist/es2019/pm-plugins/main.js +1 -6
  69. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +1 -4
  70. package/dist/es2019/pm-plugins/table-resizing/plugin.js +0 -3
  71. package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +2 -11
  72. package/dist/es2019/pm-plugins/table-resizing/utils/column-state.js +1 -4
  73. package/dist/es2019/pm-plugins/table-resizing/utils/content-width.js +0 -8
  74. package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +1 -4
  75. package/dist/es2019/pm-plugins/table-resizing/utils/resize-logic.js +2 -10
  76. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +2 -8
  77. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -16
  78. package/dist/es2019/pm-plugins/table-width.js +1 -6
  79. package/dist/es2019/pm-plugins/transforms/column-width.js +2 -8
  80. package/dist/es2019/pm-plugins/transforms/delete-columns.js +1 -4
  81. package/dist/es2019/pm-plugins/transforms/fix-tables.js +3 -15
  82. package/dist/es2019/pm-plugins/transforms/replace-table.js +1 -4
  83. package/dist/es2019/pm-plugins/transforms/split.js +0 -2
  84. package/dist/es2019/pm-plugins/utils/alignment.js +1 -4
  85. package/dist/es2019/pm-plugins/utils/decoration.js +4 -16
  86. package/dist/es2019/pm-plugins/utils/drag-menu.js +2 -8
  87. package/dist/es2019/pm-plugins/utils/nodes.js +0 -3
  88. package/dist/es2019/pm-plugins/utils/paste.js +5 -4
  89. package/dist/es2019/pm-plugins/utils/row-controls.js +1 -4
  90. package/dist/es2019/pm-plugins/utils/snapping.js +1 -4
  91. package/dist/es2019/tablePlugin.js +1 -0
  92. package/dist/es2019/ui/DragHandle/index.js +57 -6
  93. package/dist/es2019/ui/FloatingInsertButton/getPopupOptions.js +0 -6
  94. package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +19 -7
  95. package/dist/es2019/ui/TableFloatingColumnControls/index.js +1 -2
  96. package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +63 -11
  97. package/dist/es2019/ui/TableFloatingControls/index.js +26 -10
  98. package/dist/es2019/ui/event-handlers.js +1 -4
  99. package/dist/es2019/ui/toolbar.js +9 -36
  100. package/dist/esm/nodeviews/TableCell.js +0 -2
  101. package/dist/esm/nodeviews/TableComponent.js +5 -5
  102. package/dist/esm/nodeviews/TableComponentWithSharedState.js +6 -4
  103. package/dist/esm/nodeviews/TableContainer.js +13 -2
  104. package/dist/esm/nodeviews/TableNodeViewBase.js +0 -2
  105. package/dist/esm/nodeviews/TableResizer.js +5 -10
  106. package/dist/esm/nodeviews/TableRow.js +0 -2
  107. package/dist/esm/nodeviews/lazy-node-views.js +4 -16
  108. package/dist/esm/nodeviews/table.js +3 -10
  109. package/dist/esm/pm-plugins/commands/column-resize.js +1 -4
  110. package/dist/esm/pm-plugins/commands/commands-with-analytics.js +4 -16
  111. package/dist/esm/pm-plugins/commands/insert.js +4 -19
  112. package/dist/esm/pm-plugins/commands/misc.js +3 -12
  113. package/dist/esm/pm-plugins/decorations/plugin.js +1 -6
  114. package/dist/esm/pm-plugins/decorations/utils/column-resizing.js +1 -4
  115. package/dist/esm/pm-plugins/drag-and-drop/commands-with-analytics.js +3 -12
  116. package/dist/esm/pm-plugins/drag-and-drop/commands.js +3 -12
  117. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +1 -4
  118. package/dist/esm/pm-plugins/keymap.js +0 -3
  119. package/dist/esm/pm-plugins/main.js +1 -6
  120. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +1 -4
  121. package/dist/esm/pm-plugins/table-resizing/plugin.js +0 -3
  122. package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +1 -7
  123. package/dist/esm/pm-plugins/table-resizing/utils/column-state.js +1 -4
  124. package/dist/esm/pm-plugins/table-resizing/utils/content-width.js +0 -8
  125. package/dist/esm/pm-plugins/table-resizing/utils/resize-logic.js +2 -10
  126. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +1 -4
  127. package/dist/esm/pm-plugins/table-width.js +1 -6
  128. package/dist/esm/pm-plugins/transforms/column-width.js +1 -4
  129. package/dist/esm/pm-plugins/transforms/fix-tables.js +3 -15
  130. package/dist/esm/pm-plugins/transforms/replace-table.js +1 -4
  131. package/dist/esm/pm-plugins/transforms/split.js +0 -2
  132. package/dist/esm/pm-plugins/utils/alignment.js +1 -4
  133. package/dist/esm/pm-plugins/utils/decoration.js +4 -16
  134. package/dist/esm/pm-plugins/utils/drag-menu.js +1 -4
  135. package/dist/esm/pm-plugins/utils/nodes.js +0 -3
  136. package/dist/esm/pm-plugins/utils/paste.js +4 -0
  137. package/dist/esm/pm-plugins/utils/row-controls.js +1 -4
  138. package/dist/esm/tablePlugin.js +1 -0
  139. package/dist/esm/ui/DragHandle/index.js +54 -5
  140. package/dist/esm/ui/FloatingInsertButton/getPopupOptions.js +0 -6
  141. package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +19 -7
  142. package/dist/esm/ui/TableFloatingColumnControls/index.js +1 -2
  143. package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +61 -11
  144. package/dist/esm/ui/TableFloatingControls/index.js +26 -9
  145. package/dist/esm/ui/toolbar.js +3 -12
  146. package/dist/types/nodeviews/TableComponent.d.ts +3 -1
  147. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  148. package/dist/types/types/index.d.ts +1 -1
  149. package/dist/types/ui/DragHandle/index.d.ts +21 -0
  150. package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -1
  151. package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +8 -5
  152. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +3 -1
  153. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  154. package/dist/types-ts4.5/types/index.d.ts +1 -1
  155. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +21 -0
  156. package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +1 -1
  157. package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +8 -5
  158. package/package.json +15 -6
  159. package/src/nodeviews/TableCell.ts +0 -2
  160. package/src/nodeviews/TableComponent.tsx +8 -6
  161. package/src/nodeviews/TableComponentWithSharedState.tsx +4 -2
  162. package/src/nodeviews/TableContainer.tsx +12 -1
  163. package/src/nodeviews/TableNodeViewBase.ts +0 -2
  164. package/src/nodeviews/TableResizer.tsx +9 -5
  165. package/src/nodeviews/TableRow.ts +0 -2
  166. package/src/nodeviews/lazy-node-views.ts +0 -8
  167. package/src/nodeviews/table.tsx +1 -6
  168. package/src/pm-plugins/commands/column-resize.ts +0 -2
  169. package/src/pm-plugins/commands/commands-with-analytics.ts +0 -12
  170. package/src/pm-plugins/commands/delete.ts +0 -2
  171. package/src/pm-plugins/commands/insert.ts +0 -12
  172. package/src/pm-plugins/commands/misc.ts +0 -6
  173. package/src/pm-plugins/decorations/plugin.ts +0 -4
  174. package/src/pm-plugins/decorations/utils/column-resizing.ts +0 -2
  175. package/src/pm-plugins/drag-and-drop/commands-with-analytics.ts +0 -6
  176. package/src/pm-plugins/drag-and-drop/commands.ts +0 -8
  177. package/src/pm-plugins/drag-and-drop/plugin.ts +0 -4
  178. package/src/pm-plugins/keymap.ts +0 -2
  179. package/src/pm-plugins/main.ts +0 -4
  180. package/src/pm-plugins/table-resizing/event-handlers.ts +0 -2
  181. package/src/pm-plugins/table-resizing/plugin.ts +0 -2
  182. package/src/pm-plugins/table-resizing/utils/colgroup.ts +0 -6
  183. package/src/pm-plugins/table-resizing/utils/column-state.ts +0 -2
  184. package/src/pm-plugins/table-resizing/utils/content-width.ts +0 -6
  185. package/src/pm-plugins/table-resizing/utils/resize-column.ts +0 -2
  186. package/src/pm-plugins/table-resizing/utils/resize-logic.ts +0 -6
  187. package/src/pm-plugins/table-resizing/utils/resize-state.ts +0 -4
  188. package/src/pm-plugins/table-resizing/utils/scale-table.ts +0 -8
  189. package/src/pm-plugins/table-width.ts +0 -4
  190. package/src/pm-plugins/transforms/column-width.ts +0 -4
  191. package/src/pm-plugins/transforms/delete-columns.ts +0 -2
  192. package/src/pm-plugins/transforms/fix-tables.ts +0 -8
  193. package/src/pm-plugins/transforms/replace-table.ts +0 -2
  194. package/src/pm-plugins/transforms/split.ts +0 -2
  195. package/src/pm-plugins/utils/alignment.ts +0 -2
  196. package/src/pm-plugins/utils/decoration.ts +0 -8
  197. package/src/pm-plugins/utils/drag-menu.ts +0 -4
  198. package/src/pm-plugins/utils/nodes.ts +0 -2
  199. package/src/pm-plugins/utils/paste.ts +4 -2
  200. package/src/pm-plugins/utils/row-controls.ts +0 -2
  201. package/src/pm-plugins/utils/snapping.ts +0 -2
  202. package/src/tablePlugin.tsx +1 -0
  203. package/src/types/index.ts +1 -0
  204. package/src/ui/DragHandle/index.tsx +67 -2
  205. package/src/ui/FloatingInsertButton/getPopupOptions.ts +0 -4
  206. package/src/ui/TableFloatingColumnControls/ColumnControls/index.tsx +37 -20
  207. package/src/ui/TableFloatingColumnControls/index.tsx +1 -4
  208. package/src/ui/TableFloatingControls/RowControls/DragControls.tsx +86 -27
  209. package/src/ui/TableFloatingControls/index.tsx +55 -32
  210. package/src/ui/event-handlers.ts +0 -2
  211. package/src/ui/toolbar.tsx +0 -18
@@ -44,10 +44,7 @@ import { TableCssClassName } from '../types';
44
44
  import { FloatingAlignmentButtons } from './FloatingAlignmentButtons/FloatingAlignmentButtons';
45
45
  export const getToolbarMenuConfig = (config, state, {
46
46
  formatMessage
47
- }, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown = false, areTableColumnWidthsFixed = false
48
- // Ignored via go/ees005
49
- // eslint-disable-next-line @typescript-eslint/max-params
50
- ) => {
47
+ }, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown = false, areTableColumnWidthsFixed = false) => {
51
48
  const optionItem = 'item-checkbox';
52
49
  const options = [{
53
50
  id: 'editor.table.lockColumnWidths',
@@ -129,10 +126,7 @@ export const getToolbarMenuConfig = (config, state, {
129
126
  // with native widgets. It's enabled via a plugin config.
130
127
  export const getToolbarCellOptionsConfig = (editorState, editorView, initialSelectionRect, {
131
128
  formatMessage
132
- }, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
133
- // Ignored via go/ees005
134
- // eslint-disable-next-line @typescript-eslint/max-params
135
- ) => {
129
+ }, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false) => {
136
130
  var _pluginState$pluginCo, _pluginState$pluginCo2;
137
131
  const {
138
132
  top,
@@ -349,10 +343,7 @@ const getClosestSelectionOrTableRect = state => {
349
343
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
350
344
  return isSelectionType(selection, 'cell') ? getSelectionRect(selection) : tableRect;
351
345
  };
352
- export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false
353
- // Ignored via go/ees005
354
- // eslint-disable-next-line @typescript-eslint/max-params
355
- ) => config => (state, intl) => {
346
+ export const getToolbarConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => config => (state, intl) => {
356
347
  const tableObject = findTable(state.selection);
357
348
  const pluginState = getPluginState(state);
358
349
  const resizeState = tableResizingPluginKey.getState(state);
@@ -461,10 +452,7 @@ const separator = hidden => {
461
452
  };
462
453
  const getCellItems = (state, view, {
463
454
  formatMessage
464
- }, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false
465
- // Ignored via go/ees005
466
- // eslint-disable-next-line @typescript-eslint/max-params
467
- ) => {
455
+ }, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false, isCommentEditor = false) => {
468
456
  const initialSelectionRect = getClosestSelectionRect(state);
469
457
  if (initialSelectionRect) {
470
458
  const cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
@@ -476,10 +464,7 @@ const getCellItems = (state, view, {
476
464
  }
477
465
  return [];
478
466
  };
479
- const getDistributeConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false
480
- // Ignored via go/ees005
481
- // eslint-disable-next-line @typescript-eslint/max-params
482
- ) => (state, dispatch, editorView) => {
467
+ const getDistributeConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false) => (state, dispatch, editorView) => {
483
468
  const selectionOrTableRect = getClosestSelectionOrTableRect(state);
484
469
  if (!editorView || !selectionOrTableRect) {
485
470
  return false;
@@ -496,10 +481,7 @@ const getDistributeConfig = (getEditorContainerWidth, api, editorAnalyticsAPI, i
496
481
  // fixed column button should be in this function call in the future
497
482
  const getColumnSettingItems = (editorState, editorView, {
498
483
  formatMessage
499
- }, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false
500
- // Ignored via go/ees005
501
- // eslint-disable-next-line @typescript-eslint/max-params
502
- ) => {
484
+ }, getEditorContainerWidth, api, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, isCommentEditor = false) => {
503
485
  var _newResizeStateWithAn2, _pluginState$pluginCo3;
504
486
  const pluginState = getPluginState(editorState);
505
487
  const selectionOrTableRect = getClosestSelectionOrTableRect(editorState);
@@ -529,10 +511,7 @@ const getColumnSettingItems = (editorState, editorView, {
529
511
  };
530
512
  const getColorPicker = (state, menu, {
531
513
  formatMessage
532
- }, editorAnalyticsAPI, getEditorView
533
- // Ignored via go/ees005
534
- // eslint-disable-next-line @typescript-eslint/max-params
535
- ) => {
514
+ }, editorAnalyticsAPI, getEditorView) => {
536
515
  var _node$attrs;
537
516
  const {
538
517
  targetCellPosition,
@@ -591,10 +570,7 @@ const highlightColumnsHandler = (state, dispatch) => {
591
570
  };
592
571
  const getAlignmentOptionsConfig = (editorState, {
593
572
  formatMessage
594
- }, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor, isCommentEditor
595
- // Ignored via go/ees005
596
- // eslint-disable-next-line @typescript-eslint/max-params
597
- ) => {
573
+ }, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor, isCommentEditor) => {
598
574
  const tableObject = findTable(editorState.selection);
599
575
  if (!tableObject) {
600
576
  return [];
@@ -669,10 +645,7 @@ const getSelectedAlignmentIcon = (alignmentIcons, selectedNode) => {
669
645
  const selectedAlignment = selectedNode.attrs.layout;
670
646
  return alignmentIcons.find(icon => icon.value === normaliseAlignment(selectedAlignment));
671
647
  };
672
- const isLayoutOptionDisabled = (selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor
673
- // Ignored via go/ees005
674
- // eslint-disable-next-line @typescript-eslint/max-params
675
- ) => {
648
+ const isLayoutOptionDisabled = (selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent, isFullWidthEditor) => {
676
649
  const {
677
650
  lineLength
678
651
  } = getEditorContainerWidth();
@@ -38,8 +38,6 @@ function delayUntilIdle(cb) {
38
38
  // eslint-disable-next-line require-unicode-regexp
39
39
  var cssVariablePattern = /^VAR\(--.*\)$/;
40
40
  var TableCell = /*#__PURE__*/function (_TableNodeView) {
41
- // Ignored via go/ees005
42
- // eslint-disable-next-line @typescript-eslint/max-params
43
41
  function TableCell(node, view, getPos, eventDispatcher, editorAnalyticsAPI) {
44
42
  var _this;
45
43
  _classCallCheck(this, TableCell);
@@ -26,7 +26,6 @@ import { akEditorTableNumberColumnWidth, akEditorTableToolbarSize as tableToolba
26
26
  import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
27
27
  import { fg } from '@atlaskit/platform-feature-flags';
28
28
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
29
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
30
29
  import { autoSizeTable, clearHoverSelection } from '../pm-plugins/commands';
31
30
  import { autoScrollerFactory } from '../pm-plugins/drag-and-drop/utils/autoscrollers';
32
31
  import { getPluginState } from '../pm-plugins/plugin-factory';
@@ -693,7 +692,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
693
692
  getEditorFeatureFlags = _this$props11.getEditorFeatureFlags;
694
693
  var isInDanger = this.props.isInDanger;
695
694
  var table = findTable(view.state.selection);
696
- if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
695
+ if (!fg('platform_editor_table_use_shared_state_hook_fg')) {
697
696
  var pluginState = getPluginState(view.state);
698
697
  isInDanger = pluginState.isInDanger;
699
698
  }
@@ -829,7 +828,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
829
828
  getEditorFeatureFlags = _this$props12.getEditorFeatureFlags,
830
829
  isTableScalingEnabled = _this$props12.isTableScalingEnabled,
831
830
  allowTableResizing = _this$props12.allowTableResizing,
832
- allowTableAlignment = _this$props12.allowTableAlignment;
831
+ allowTableAlignment = _this$props12.allowTableAlignment,
832
+ selection = _this$props12.selection;
833
833
  var _this$props13 = this.props,
834
834
  isInDanger = _this$props13.isInDanger,
835
835
  hoveredRows = _this$props13.hoveredRows,
@@ -840,7 +840,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
840
840
  showBeforeShadow = _this$state3.showBeforeShadow,
841
841
  showAfterShadow = _this$state3.showAfterShadow;
842
842
  var node = getNode();
843
- if (editorExperiment('platform_editor_table_use_shared_state_hook', false)) {
843
+ if (!fg('platform_editor_table_use_shared_state_hook_fg')) {
844
844
  var pluginState = getPluginState(view.state);
845
845
  isInDanger = pluginState.isInDanger;
846
846
  hoveredRows = pluginState.hoveredRows;
@@ -934,7 +934,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
934
934
  return /*#__PURE__*/React.createElement(TableContainer
935
935
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
936
936
  , {
937
- className: classnames(ClassName.TABLE_CONTAINER, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ClassName.WITH_CONTROLS, allowControls && tableActive), ClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), ClassName.HOVERED_DELETE_BUTTON, isInDanger), ClassName.TABLE_SELECTED, isTableSelected(view.state.selection))),
937
+ className: classnames(ClassName.TABLE_CONTAINER, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ClassName.WITH_CONTROLS, allowControls && tableActive), ClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), ClassName.HOVERED_DELETE_BUTTON, isInDanger), ClassName.TABLE_SELECTED, isTableSelected(selection !== null && selection !== void 0 ? selection : view.state.selection))),
938
938
  editorView: view,
939
939
  getPos: getPos,
940
940
  node: node
@@ -23,10 +23,11 @@ export var TableComponentWithSharedState = function TableComponentWithSharedStat
23
23
  forwardRef = _ref.forwardRef,
24
24
  allowTableAlignment = _ref.allowTableAlignment,
25
25
  allowTableResizing = _ref.allowTableResizing;
26
- var _useSharedPluginState = useSharedPluginState(api, ['width', 'table', 'media']),
26
+ var _useSharedPluginState = useSharedPluginState(api, ['width', 'table', 'media', 'selection']),
27
27
  widthState = _useSharedPluginState.widthState,
28
28
  tableState = _useSharedPluginState.tableState,
29
- mediaState = _useSharedPluginState.mediaState;
29
+ mediaState = _useSharedPluginState.mediaState,
30
+ selectionState = _useSharedPluginState.selectionState;
30
31
  if (!tableState) {
31
32
  return null;
32
33
  }
@@ -63,7 +64,7 @@ export var TableComponentWithSharedState = function TableComponentWithSharedStat
63
64
  getPos: getPos,
64
65
  isMediaFullscreen: mediaState === null || mediaState === void 0 ? void 0 : mediaState.isFullscreen,
65
66
  options: options,
66
- allowControls: !!allowControls,
67
+ allowControls: allowControls,
67
68
  isHeaderRowEnabled: isHeaderRowEnabled,
68
69
  isHeaderColumnEnabled: isHeaderColumnEnabled,
69
70
  isDragAndDropEnabled: options === null || options === void 0 ? void 0 : options.isDragAndDropEnabled,
@@ -86,6 +87,7 @@ export var TableComponentWithSharedState = function TableComponentWithSharedStat
86
87
  hoveredRows: hoveredRows,
87
88
  hoveredCell: hoveredCell,
88
89
  isTableHovered: isTableHovered,
89
- isWholeTableInDanger: isWholeTableInDanger
90
+ isWholeTableInDanger: isWholeTableInDanger,
91
+ selection: selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection
90
92
  });
91
93
  };
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
4
  import classNames from 'classnames';
@@ -5,6 +6,7 @@ import { CHANGE_ALIGNMENT_REASON, INPUT_METHOD } from '@atlaskit/editor-common/a
5
6
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
6
7
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
7
8
  import { akEditorDefaultLayoutWidth, akEditorGutterPaddingDynamic, akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
8
10
  import { setTableAlignmentWithTableContentWithPosWithAnalytics } from '../pm-plugins/commands/commands-with-analytics';
9
11
  import { getPluginState } from '../pm-plugins/plugin-factory';
10
12
  import { TABLE_MAX_WIDTH, TABLE_OFFSET_IN_COMMENT_EDITOR } from '../pm-plugins/table-resizing/utils/consts';
@@ -246,7 +248,7 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
246
248
  ,
247
249
  className: ClassName.TABLE_RESIZER_CONTAINER,
248
250
  ref: containerRef
249
- }, isLivePageViewMode ? /*#__PURE__*/React.createElement(InnerContainer
251
+ }, fg('platform_editor_live_page_prevent_table_recreation') ? null : isLivePageViewMode ? /*#__PURE__*/React.createElement(InnerContainer
250
252
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
251
253
  , {
252
254
  className: className,
@@ -263,7 +265,16 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref4) {
263
265
  React.createElement(TableResizer, tableResizerProps, /*#__PURE__*/React.createElement(InnerContainer, {
264
266
  className: className,
265
267
  node: node
266
- }, children))));
268
+ }, children)), fg('platform_editor_live_page_prevent_table_recreation') ?
269
+ /*#__PURE__*/
270
+ // Ignored via go/ees005
271
+ // eslint-disable-next-line react/jsx-props-no-spreading
272
+ React.createElement(TableResizer, _extends({}, tableResizerProps, {
273
+ disabled: isLivePageViewMode
274
+ }), /*#__PURE__*/React.createElement(InnerContainer, {
275
+ className: className,
276
+ node: node
277
+ }, children)) : null));
267
278
  });
268
279
  export var TableContainer = function TableContainer(_ref6) {
269
280
  var children = _ref6.children,
@@ -5,8 +5,6 @@ var TableNodeView = /*#__PURE__*/_createClass(
5
5
  /**
6
6
  * @constructor
7
7
  */
8
- // Ignored via go/ees005
9
- // eslint-disable-next-line @typescript-eslint/max-params
10
8
  function TableNodeView(node, view, getPos, eventDispatcher) {
11
9
  _classCallCheck(this, TableNodeView);
12
10
  this.node = node;
@@ -76,10 +76,7 @@ var getResizerMinWidth = function getResizerMinWidth(node) {
76
76
  * @param isTableScalingEnabled
77
77
  * @param isFullWidthModeEnabled
78
78
  */
79
- var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWidth, lineLength, isTableScalingEnabled, isFullWidthModeEnabled
80
- // Ignored via go/ees005
81
- // eslint-disable-next-line @typescript-eslint/max-params
82
- ) {
79
+ var getVisibleGuidelines = function getVisibleGuidelines(guidelines, containerWidth, lineLength, isTableScalingEnabled, isFullWidthModeEnabled) {
83
80
  var guidelineVisibleAdjustment = TABLE_GUIDELINE_VISIBLE_ADJUSTMENT;
84
81
  if (isTableScalingEnabled) {
85
82
  // Notes:
@@ -121,7 +118,8 @@ export var TableResizer = function TableResizer(_ref) {
121
118
  shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
122
119
  pluginInjectionApi = _ref.pluginInjectionApi,
123
120
  isFullWidthModeEnabled = _ref.isFullWidthModeEnabled,
124
- isCommentEditor = _ref.isCommentEditor;
121
+ isCommentEditor = _ref.isCommentEditor,
122
+ disabled = _ref.disabled;
125
123
  var currentGap = useRef(0);
126
124
  // track resizing state - use ref over state to avoid re-render
127
125
  var isResizing = useRef(false);
@@ -191,10 +189,7 @@ export var TableResizer = function TableResizer(_ref) {
191
189
  isFullWidthModeEnabled ? lineLength + 2 * akEditorGutterPaddingDynamic() : containerWidth, excludeGuidelineConfig) : defaultSnappingWidths
192
190
  } : undefined;
193
191
  }, [snappingEnabled, isTableScalingEnabled, excludeGuidelineConfig, containerWidth, lineLength, isFullWidthModeEnabled]);
194
- var switchToCenterAlignment = useCallback(function (pos, node, newWidth, state, dispatch
195
- // Ignored via go/ees005
196
- // eslint-disable-next-line @typescript-eslint/max-params
197
- ) {
192
+ var switchToCenterAlignment = useCallback(function (pos, node, newWidth, state, dispatch) {
198
193
  if (shouldChangeAlignmentToCenterResized(isTableAlignmentEnabled, node, lineLength, newWidth) && isResizing.current) {
199
194
  var _pluginInjectionApi$a;
200
195
  var tableNodeWithPos = {
@@ -470,7 +465,7 @@ export var TableResizer = function TableResizer(_ref) {
470
465
  var resizeRatio = !isTableAlignmentEnabled || isTableAlignmentEnabled && normaliseAlignment(node.attrs.layout) === ALIGN_CENTER ? 2 : 1;
471
466
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ResizerNext, {
472
467
  ref: resizerRef,
473
- enable: handles,
468
+ enable: fg('platform_editor_live_page_prevent_table_recreation') ? disabled ? {} : handles : handles,
474
469
  width: width,
475
470
  handleAlignmentMethod: "sticky",
476
471
  handleSize: handleSize,
@@ -26,8 +26,6 @@ var HEADER_ROW_SCROLL_THROTTLE_TIMEOUT = 200;
26
26
  // if too short it would trigger too many dom updates.
27
27
  var HEADER_ROW_SCROLL_RESET_DEBOUNCE_TIMEOUT = 400;
28
28
  var TableRow = /*#__PURE__*/function (_TableNodeView) {
29
- // Ignored via go/ees005
30
- // eslint-disable-next-line @typescript-eslint/max-params
31
29
  function TableRow(node, view, getPos, eventDispatcher) {
32
30
  var _this;
33
31
  _classCallCheck(this, TableRow);
@@ -14,10 +14,7 @@ export var lazyTableView = function lazyTableView(options) {
14
14
  var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
15
15
  './table').then(function (_ref) {
16
16
  var createTableView = _ref.createTableView;
17
- return function (node, view, getPos, decorations, getNodeViewOptions
18
- // Ignored via go/ees005
19
- // eslint-disable-next-line @typescript-eslint/max-params
20
- ) {
17
+ return function (node, view, getPos, decorations, getNodeViewOptions) {
21
18
  var _getNodeViewOptions = getNodeViewOptions(),
22
19
  portalProviderAPI = _getNodeViewOptions.portalProviderAPI,
23
20
  eventDispatcher = _getNodeViewOptions.eventDispatcher,
@@ -51,10 +48,7 @@ export var lazyTableCellView = function lazyTableCellView(options) {
51
48
  var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table_nodeview" */
52
49
  './TableCell').then(function (_ref2) {
53
50
  var TableCell = _ref2.default;
54
- return function (node, view, getPos, decorations, getNodeViewOptions
55
- // Ignored via go/ees005
56
- // eslint-disable-next-line @typescript-eslint/max-params
57
- ) {
51
+ return function (node, view, getPos, decorations, getNodeViewOptions) {
58
52
  var _pluginInjectionApi$a;
59
53
  var _getNodeViewOptions2 = getNodeViewOptions(),
60
54
  eventDispatcher = _getNodeViewOptions2.eventDispatcher,
@@ -83,10 +77,7 @@ export var lazyTableHeaderView = function lazyTableHeaderView(options) {
83
77
  var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-cell_nodeview" */
84
78
  './TableCell').then(function (_ref3) {
85
79
  var TableCell = _ref3.default;
86
- return function (node, view, getPos, decorations, getNodeViewOptions
87
- // Ignored via go/ees005
88
- // eslint-disable-next-line @typescript-eslint/max-params
89
- ) {
80
+ return function (node, view, getPos, decorations, getNodeViewOptions) {
90
81
  var _pluginInjectionApi$a2;
91
82
  var _getNodeViewOptions3 = getNodeViewOptions(),
92
83
  eventDispatcher = _getNodeViewOptions3.eventDispatcher,
@@ -114,10 +105,7 @@ export var lazyTableRowView = function lazyTableRowView(options) {
114
105
  var result = import( /* webpackChunkName: "@atlaskit-internal_editor-plugin-table-row_nodeview" */
115
106
  './TableRow').then(function (_ref4) {
116
107
  var TableRow = _ref4.default;
117
- return function (node, view, getPos, decorations, getNodeViewOptions
118
- // Ignored via go/ees005
119
- // eslint-disable-next-line @typescript-eslint/max-params
120
- ) {
108
+ return function (node, view, getPos, decorations, getNodeViewOptions) {
121
109
  var _getNodeViewOptions4 = getNodeViewOptions(),
122
110
  eventDispatcher = _getNodeViewOptions4.eventDispatcher;
123
111
  return new TableRow(node, view, getPos, eventDispatcher);
@@ -18,7 +18,6 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
18
18
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
19
19
  import { TableMap } from '@atlaskit/editor-tables/table-map';
20
20
  import { fg } from '@atlaskit/platform-feature-flags';
21
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
21
  import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
23
22
  import { pluginKey as tableDragAndDropPluginKey } from '../pm-plugins/drag-and-drop/plugin-key';
24
23
  import { getPluginState } from '../pm-plugins/plugin-factory';
@@ -39,10 +38,7 @@ var tableAttributes = function tableAttributes(node) {
39
38
  'data-table-display-mode': node.attrs.displayMode
40
39
  };
41
40
  };
42
- var getInlineWidth = function getInlineWidth(node, options, state, pos, allowTableResizing
43
- // Ignored via go/ees005
44
- // eslint-disable-next-line @typescript-eslint/max-params
45
- ) {
41
+ var getInlineWidth = function getInlineWidth(node, options, state, pos, allowTableResizing) {
46
42
  if (!node.attrs.width && options !== null && options !== void 0 && options.isCommentEditor && allowTableResizing) {
47
43
  return;
48
44
  }
@@ -134,7 +130,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
134
130
  key: "render",
135
131
  value: function render(props, forwardRef) {
136
132
  var _this3 = this;
137
- if (editorExperiment('platform_editor_table_use_shared_state_hook', true)) {
133
+ if (fg('platform_editor_table_use_shared_state_hook_fg')) {
138
134
  return /*#__PURE__*/React.createElement(TableComponentWithSharedState, {
139
135
  forwardRef: forwardRef,
140
136
  getNode: this.getNode,
@@ -321,10 +317,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
321
317
  }]);
322
318
  }(ReactNodeView);
323
319
  export { TableView as default };
324
- export var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor
325
- // Ignored via go/ees005
326
- // eslint-disable-next-line @typescript-eslint/max-params
327
- ) {
320
+ export var createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor) {
328
321
  var _pluginInjectionApi$t;
329
322
  var _getPluginState2 = getPluginState(view.state),
330
323
  pluginConfig = _getPluginState2.pluginConfig,
@@ -22,10 +22,7 @@ var getTablePluginCommand = function getTablePluginCommand(actionPayload, origin
22
22
  return (originalTr || tr).setMeta('addToHistory', false);
23
23
  });
24
24
  };
25
- var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI
26
- // Ignored via go/ees005
27
- // eslint-disable-next-line @typescript-eslint/max-params
28
- ) {
25
+ var updateResizeHandleAndStatePosition = function updateResizeHandleAndStatePosition(rowIndex, columnIndex, nextResizeHandlePos, nodeViewPortalProviderAPI) {
29
26
  return function (state, dispatch) {
30
27
  var customTr = state.tr;
31
28
  var _getPluginState = getPluginState(state),
@@ -183,10 +183,7 @@ export var insertRowWithAnalytics = function insertRowWithAnalytics(editorAnalyt
183
183
  };
184
184
  };
185
185
  export var changeColumnWidthByStepWithAnalytics = function changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI, api) {
186
- return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl
187
- // Ignored via go/ees005
188
- // eslint-disable-next-line @typescript-eslint/max-params
189
- ) {
186
+ return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, isCommentEditor, inputMethod, ariaNotify, getIntl) {
190
187
  return withEditorAnalyticsAPI(function (state) {
191
188
  var _getSelectedTableInfo2 = getSelectedTableInfo(state.selection),
192
189
  table = _getSelectedTableInfo2.table,
@@ -300,10 +297,7 @@ export var deleteColumnsWithAnalytics = function deleteColumnsWithAnalytics(edit
300
297
  })(editorAnalyticsAPI)(deleteColumnsCommand(rect, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor));
301
298
  };
302
299
  };
303
- export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent
304
- // Ignored via go/ees005
305
- // eslint-disable-next-line @typescript-eslint/max-params
306
- ) {
300
+ export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent) {
307
301
  return function (state, dispatch) {
308
302
  var selection = state.selection;
309
303
  var isCellSelection = selection instanceof CellSelection;
@@ -514,10 +508,7 @@ export var toggleFixedColumnWidthsOptionAnalytics = function toggleFixedColumnWi
514
508
  })(editorAnalyticsAPI)(editorCommandToPMCommand(setTableDisplayMode));
515
509
  };
516
510
  export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalytics(editorAnalyticsAPI, isCommentEditor) {
517
- return function (newAlignment, previousAlignment, inputMethod, reason
518
- // Ignored via go/ees005
519
- // eslint-disable-next-line @typescript-eslint/max-params
520
- ) {
511
+ return function (newAlignment, previousAlignment, inputMethod, reason) {
521
512
  return withEditorAnalyticsAPI(function (state) {
522
513
  var _getSelectedTableInfo13 = getSelectedTableInfo(state.selection),
523
514
  table = _getSelectedTableInfo13.table,
@@ -542,10 +533,7 @@ export var setTableAlignmentWithAnalytics = function setTableAlignmentWithAnalyt
542
533
  };
543
534
  };
544
535
  export var setTableAlignmentWithTableContentWithPosWithAnalytics = function setTableAlignmentWithTableContentWithPosWithAnalytics(editorAnalyticsAPI) {
545
- return function (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason
546
- // Ignored via go/ees005
547
- // eslint-disable-next-line @typescript-eslint/max-params
548
- ) {
536
+ return function (newAlignment, previousAlignment, tableNodeWithPos, inputMethod, reason) {
549
537
  return withEditorAnalyticsAPI(function () {
550
538
  var map = TableMap.get(tableNodeWithPos.node);
551
539
  var totalRowCount = map.height;
@@ -27,9 +27,6 @@ function addColumnAtCustomStep(column) {
27
27
  return tr;
28
28
  };
29
29
  }
30
-
31
- // Ignored via go/ees005
32
- // eslint-disable-next-line @typescript-eslint/max-params
33
30
  export function addColumnAt(api) {
34
31
  var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
35
32
  var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
@@ -85,10 +82,7 @@ export var addColumnBefore = function addColumnBefore(api) {
85
82
 
86
83
  // :: (EditorState, dispatch: ?(tr: Transaction)) → bool
87
84
  // Command to add a column after the column with the selection.
88
- export var addColumnAfter = function addColumnAfter(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor
89
- // Ignored via go/ees005
90
- // eslint-disable-next-line @typescript-eslint/max-params
91
- ) {
85
+ export var addColumnAfter = function addColumnAfter(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor) {
92
86
  return function (state, dispatch, view) {
93
87
  var table = findTable(state.selection);
94
88
  if (!table) {
@@ -105,10 +99,7 @@ export var insertColumn = function insertColumn(api) {
105
99
  var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
106
100
  var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
107
101
  var shouldUseIncreasedScalingPercent = arguments.length > 3 ? arguments[3] : undefined;
108
- var isCommentEditor
109
- // Ignored via go/ees005
110
- // eslint-disable-next-line @typescript-eslint/max-params
111
- = arguments.length > 4 ? arguments[4] : undefined;
102
+ var isCommentEditor = arguments.length > 4 ? arguments[4] : undefined;
112
103
  return function (column) {
113
104
  return function (state, dispatch, view) {
114
105
  var tr = addColumnAt(api, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent, isCommentEditor)(column, getAllowAddColumnCustomStep(state), view)(state.tr);
@@ -164,10 +155,7 @@ export var insertRow = function insertRow(row, moveCursorToTheNewRow) {
164
155
  * @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
165
156
  * (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
166
157
  */
167
- export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled
168
- // Ignored via go/ees005
169
- // eslint-disable-next-line @typescript-eslint/max-params
170
- ) {
158
+ export var createTable = function createTable(isTableScalingEnabled, isTableAlignmentEnabled, isFullWidthModeEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor, isTableResizingEnabled) {
171
159
  return function (state, dispatch) {
172
160
  var table = createTableWithWidth({
173
161
  isTableScalingEnabled: isTableScalingEnabled,
@@ -201,10 +189,7 @@ export var createTable = function createTable(isTableScalingEnabled, isTableAlig
201
189
  * @deprecated This function is deprecated - please use insertTableWithNestingSupport instead.
202
190
  * (To be removed with feature gate: `platform_editor_use_nested_table_pm_nodes`)
203
191
  */
204
- export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor
205
- // Ignored via go/ees005
206
- // eslint-disable-next-line @typescript-eslint/max-params
207
- ) {
192
+ export var insertTableWithSize = function insertTableWithSize(isFullWidthModeEnabled, isTableScalingEnabled, isTableAlignmentEnabled, editorAnalyticsAPI, isCommentEditor, isChromelessEditor) {
208
193
  return function (rowsCount, colsCount, inputMethod) {
209
194
  return function (_ref) {
210
195
  var tr = _ref.tr;
@@ -473,10 +473,7 @@ export var hideInsertColumnOrRowButton = function hideInsertColumnOrRowButton()
473
473
  return tr.setMeta('addToHistory', false);
474
474
  });
475
475
  };
476
- export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize
477
- // Ignored via go/ees005
478
- // eslint-disable-next-line @typescript-eslint/max-params
479
- ) {
476
+ export var addResizeHandleDecorations = function addResizeHandleDecorations(rowIndex, columnIndex, includeTooltip, nodeViewPortalProviderAPI, isKeyboardResize) {
480
477
  return createCommand(function (state) {
481
478
  var tableNode = findTable(state.selection);
482
479
  var _getPluginState3 = getPluginState(state),
@@ -502,10 +499,7 @@ export var addResizeHandleDecorations = function addResizeHandleDecorations(rowI
502
499
  return tr.setMeta('addToHistory', false);
503
500
  });
504
501
  };
505
- export var updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip
506
- // Ignored via go/ees005
507
- // eslint-disable-next-line @typescript-eslint/max-params
508
- ) {
502
+ export var updateResizeHandleDecorations = function updateResizeHandleDecorations(nodeViewPortalProviderAPI, rowIndex, columnIndex, includeTooltip) {
509
503
  return createCommand(function (state) {
510
504
  var tableNode = findTable(state.selection);
511
505
  var _getPluginState4 = getPluginState(state),
@@ -554,10 +548,7 @@ export var removeResizeHandleDecorations = function removeResizeHandleDecoration
554
548
  return tr.setMeta('addToHistory', false);
555
549
  });
556
550
  };
557
- export var autoSizeTable = function autoSizeTable(view, node, table, basePos, opts
558
- // Ignored via go/ees005
559
- // eslint-disable-next-line @typescript-eslint/max-params
560
- ) {
551
+ export var autoSizeTable = function autoSizeTable(view, node, table, basePos, opts) {
561
552
  if (typeof basePos !== 'number') {
562
553
  return false;
563
554
  }
@@ -9,10 +9,7 @@ export var pluginKey = new PluginKey('tableDecorationsPlugin');
9
9
  export var getDecorations = function getDecorations(state) {
10
10
  return pluginKey.getState(state);
11
11
  };
12
- export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState
13
- // Ignored via go/ees005
14
- // eslint-disable-next-line @typescript-eslint/max-params
15
- ) {
12
+ export var handleDocOrSelectionChanged = function handleDocOrSelectionChanged(tr, decorationSet, oldState, newState) {
16
13
  var _tableWidthPluginKey$, _tableWidthPluginKey$2;
17
14
  var isResizing = (_tableWidthPluginKey$ = tableWidthPluginKey.getState(newState)) === null || _tableWidthPluginKey$ === void 0 ? void 0 : _tableWidthPluginKey$.resizing;
18
15
  var wasResizing = (_tableWidthPluginKey$2 = tableWidthPluginKey.getState(oldState)) === null || _tableWidthPluginKey$2 === void 0 ? void 0 : _tableWidthPluginKey$2.resizing;
@@ -49,8 +46,6 @@ export var createPlugin = function createPlugin() {
49
46
  init: function init() {
50
47
  return DecorationSet.empty;
51
48
  },
52
- // Ignored via go/ees005
53
- // eslint-disable-next-line @typescript-eslint/max-params
54
49
  apply: function apply(tr, decorationSet, oldState, newState) {
55
50
  var pluginState = decorationSet;
56
51
  // main table plugin --->
@@ -17,10 +17,7 @@ var updateLastCellElement = function updateLastCellElement(lastCellElementsDecor
17
17
  return updateDecorations(tr.doc, decorationSet, lastCellElementsDecorations, TableDecorations.LAST_CELL_ELEMENT);
18
18
  };
19
19
  };
20
- export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI
21
- // Ignored via go/ees005
22
- // eslint-disable-next-line @typescript-eslint/max-params
23
- ) {
20
+ export var buildColumnResizingDecorations = function buildColumnResizingDecorations(rowEndIndex, columnEndIndex, includeTooltip, getIntl, nodeViewPortalProviderAPI) {
24
21
  return function (_ref3) {
25
22
  var tr = _ref3.tr,
26
23
  decorationSet = _ref3.decorationSet;
@@ -8,10 +8,7 @@ import { canMove, getTargetIndex } from '../utils/drag-menu';
8
8
  import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../utils/selection';
9
9
  import { clearDropTarget, cloneSource, moveSource } from './commands';
10
10
  export var clearDropTargetWithAnalytics = function clearDropTargetWithAnalytics(editorAnalyticsAPI) {
11
- return function (inputMethod, sourceType, sourceIndexes, status, tr
12
- // Ignored via go/ees005
13
- // eslint-disable-next-line @typescript-eslint/max-params
14
- ) {
11
+ return function (inputMethod, sourceType, sourceIndexes, status, tr) {
15
12
  return withEditorAnalyticsAPI(function (_ref) {
16
13
  var _sourceIndexes$length;
17
14
  var selection = _ref.selection;
@@ -41,10 +38,7 @@ export var clearDropTargetWithAnalytics = function clearDropTargetWithAnalytics(
41
38
  };
42
39
  };
43
40
  export var moveSourceWithAnalytics = function moveSourceWithAnalytics(editorAnalyticsAPI, ariaNotify, getIntl) {
44
- return function (inputMethod, sourceType, sourceIndexes, targetIndex, tr
45
- // Ignored via go/ees005
46
- // eslint-disable-next-line @typescript-eslint/max-params
47
- ) {
41
+ return function (inputMethod, sourceType, sourceIndexes, targetIndex, tr) {
48
42
  return withEditorAnalyticsAPI(function (_ref2) {
49
43
  var selection = _ref2.selection;
50
44
  var direction = sourceIndexes[0] > targetIndex ? -1 : 1;
@@ -117,10 +111,7 @@ export var moveSourceWithAnalyticsViaShortcut = function moveSourceWithAnalytics
117
111
  };
118
112
  };
119
113
  export var cloneSourceWithAnalytics = function cloneSourceWithAnalytics(editorAnalyticsAPI) {
120
- return function (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr
121
- // Ignored via go/ees005
122
- // eslint-disable-next-line @typescript-eslint/max-params
123
- ) {
114
+ return function (inputMethod, sourceType, sourceIndexes, targetIndex, targetDirection, tr) {
124
115
  return withEditorAnalyticsAPI(function (_ref3) {
125
116
  var selection = _ref3.selection;
126
117
  var direction = sourceIndexes[0] > targetIndex ? -1 : 1;