@atlaskit/editor-plugin-table 7.16.18 → 7.16.19

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 (134) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/commands/column-resize.js +4 -3
  3. package/dist/cjs/commands/delete.js +3 -2
  4. package/dist/cjs/commands/insert.js +12 -8
  5. package/dist/cjs/commands-with-analytics.js +10 -7
  6. package/dist/cjs/event-handlers.js +3 -2
  7. package/dist/cjs/nodeviews/TableComponent.js +32 -19
  8. package/dist/cjs/nodeviews/TableContainer.js +4 -0
  9. package/dist/cjs/nodeviews/TableResizer.js +3 -2
  10. package/dist/cjs/nodeviews/table.js +6 -4
  11. package/dist/cjs/plugin.js +9 -6
  12. package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +12 -13
  13. package/dist/cjs/pm-plugins/keymap.js +11 -9
  14. package/dist/cjs/pm-plugins/main.js +4 -1
  15. package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +10 -9
  16. package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +4 -3
  17. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -3
  18. package/dist/cjs/toolbar.js +29 -20
  19. package/dist/cjs/transforms/column-width.js +3 -3
  20. package/dist/cjs/transforms/delete-columns.js +3 -2
  21. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
  22. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +3 -2
  23. package/dist/cjs/ui/FloatingDragMenu/index.js +6 -3
  24. package/dist/cjs/ui/FloatingInsertButton/index.js +7 -8
  25. package/dist/cjs/utils/drag-menu.js +5 -4
  26. package/dist/es2019/commands/column-resize.js +4 -3
  27. package/dist/es2019/commands/delete.js +2 -2
  28. package/dist/es2019/commands/insert.js +8 -8
  29. package/dist/es2019/commands-with-analytics.js +9 -8
  30. package/dist/es2019/event-handlers.js +2 -2
  31. package/dist/es2019/nodeviews/TableComponent.js +28 -17
  32. package/dist/es2019/nodeviews/TableContainer.js +4 -0
  33. package/dist/es2019/nodeviews/TableResizer.js +3 -2
  34. package/dist/es2019/nodeviews/table.js +5 -4
  35. package/dist/es2019/plugin.js +9 -6
  36. package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +7 -10
  37. package/dist/es2019/pm-plugins/keymap.js +9 -9
  38. package/dist/es2019/pm-plugins/main.js +4 -1
  39. package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +10 -9
  40. package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +4 -4
  41. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -4
  42. package/dist/es2019/toolbar.js +25 -22
  43. package/dist/es2019/transforms/column-width.js +2 -3
  44. package/dist/es2019/transforms/delete-columns.js +2 -2
  45. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +12 -7
  46. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -2
  47. package/dist/es2019/ui/FloatingDragMenu/index.js +5 -3
  48. package/dist/es2019/ui/FloatingInsertButton/index.js +6 -8
  49. package/dist/es2019/utils/drag-menu.js +4 -4
  50. package/dist/esm/commands/column-resize.js +4 -3
  51. package/dist/esm/commands/delete.js +3 -2
  52. package/dist/esm/commands/insert.js +12 -8
  53. package/dist/esm/commands-with-analytics.js +10 -7
  54. package/dist/esm/event-handlers.js +3 -2
  55. package/dist/esm/nodeviews/TableComponent.js +32 -19
  56. package/dist/esm/nodeviews/TableContainer.js +4 -0
  57. package/dist/esm/nodeviews/TableResizer.js +3 -2
  58. package/dist/esm/nodeviews/table.js +6 -4
  59. package/dist/esm/plugin.js +9 -6
  60. package/dist/esm/pm-plugins/drag-and-drop/plugin.js +12 -13
  61. package/dist/esm/pm-plugins/keymap.js +11 -9
  62. package/dist/esm/pm-plugins/main.js +4 -1
  63. package/dist/esm/pm-plugins/table-resizing/event-handlers.js +10 -9
  64. package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +4 -3
  65. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +4 -3
  66. package/dist/esm/toolbar.js +29 -20
  67. package/dist/esm/transforms/column-width.js +3 -3
  68. package/dist/esm/transforms/delete-columns.js +3 -2
  69. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
  70. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +3 -2
  71. package/dist/esm/ui/FloatingDragMenu/index.js +6 -3
  72. package/dist/esm/ui/FloatingInsertButton/index.js +7 -8
  73. package/dist/esm/utils/drag-menu.js +5 -4
  74. package/dist/types/commands/column-resize.d.ts +2 -1
  75. package/dist/types/commands/delete.d.ts +1 -1
  76. package/dist/types/commands/insert.d.ts +4 -4
  77. package/dist/types/commands-with-analytics.d.ts +4 -4
  78. package/dist/types/event-handlers.d.ts +1 -1
  79. package/dist/types/nodeviews/TableContainer.d.ts +4 -2
  80. package/dist/types/nodeviews/TableResizer.d.ts +2 -1
  81. package/dist/types/nodeviews/table.d.ts +1 -0
  82. package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
  83. package/dist/types/pm-plugins/keymap.d.ts +1 -1
  84. package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  85. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  86. package/dist/types/toolbar.d.ts +5 -5
  87. package/dist/types/transforms/column-width.d.ts +1 -1
  88. package/dist/types/transforms/delete-columns.d.ts +1 -1
  89. package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
  90. package/dist/types/ui/FloatingInsertButton/index.d.ts +1 -0
  91. package/dist/types/utils/drag-menu.d.ts +1 -1
  92. package/dist/types-ts4.5/commands/column-resize.d.ts +2 -1
  93. package/dist/types-ts4.5/commands/delete.d.ts +1 -1
  94. package/dist/types-ts4.5/commands/insert.d.ts +4 -4
  95. package/dist/types-ts4.5/commands-with-analytics.d.ts +4 -4
  96. package/dist/types-ts4.5/event-handlers.d.ts +1 -1
  97. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -2
  98. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
  99. package/dist/types-ts4.5/nodeviews/table.d.ts +1 -0
  100. package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
  101. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
  102. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
  103. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  104. package/dist/types-ts4.5/toolbar.d.ts +5 -5
  105. package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
  106. package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
  107. package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
  108. package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +1 -0
  109. package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
  110. package/package.json +2 -5
  111. package/src/commands/column-resize.ts +6 -6
  112. package/src/commands/delete.ts +7 -1
  113. package/src/commands/insert.ts +33 -5
  114. package/src/commands-with-analytics.ts +14 -2
  115. package/src/event-handlers.ts +2 -0
  116. package/src/nodeviews/TableComponent.tsx +28 -28
  117. package/src/nodeviews/TableContainer.tsx +6 -0
  118. package/src/nodeviews/TableResizer.tsx +4 -0
  119. package/src/nodeviews/table.tsx +4 -2
  120. package/src/plugin.tsx +17 -7
  121. package/src/pm-plugins/drag-and-drop/plugin.ts +26 -13
  122. package/src/pm-plugins/keymap.ts +30 -4
  123. package/src/pm-plugins/main.ts +2 -0
  124. package/src/pm-plugins/table-resizing/event-handlers.ts +12 -14
  125. package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -5
  126. package/src/pm-plugins/table-resizing/utils/scale-table.ts +6 -4
  127. package/src/toolbar.tsx +46 -12
  128. package/src/transforms/column-width.ts +7 -3
  129. package/src/transforms/delete-columns.ts +6 -2
  130. package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +12 -4
  131. package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
  132. package/src/ui/FloatingDragMenu/index.tsx +4 -4
  133. package/src/ui/FloatingInsertButton/index.tsx +12 -9
  134. package/src/utils/drag-menu.ts +13 -4
@@ -98,7 +98,7 @@ export function scaleTableTo(state, maxSize) {
98
98
  }
99
99
  return adjustColumnsWidths(newState, maxSize);
100
100
  }
101
- export const previewScaleTable = (tableRef, options, domAtPos, isTableScalingEnabled = false) => {
101
+ export const previewScaleTable = (tableRef, options, domAtPos, isTableScalingEnabled = false, isTableWithFixedColumnWidthsOptionEnabled = false) => {
102
102
  const {
103
103
  node,
104
104
  start,
@@ -113,8 +113,8 @@ export const previewScaleTable = (tableRef, options, domAtPos, isTableScalingEna
113
113
  tableRef.style.width = `${width}px`;
114
114
  }
115
115
  let isTableScalingEnabledOnCurrentTable = isTableScalingEnabled;
116
- const isTableScalingEnabledWithLockButton = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button');
117
- if (isTableScalingEnabledWithLockButton) {
116
+ const isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableWithFixedColumnWidthsOptionEnabled;
117
+ if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
118
118
  isTableScalingEnabledOnCurrentTable = isTableScalingEnabled && node.attrs.displayMode !== 'fixed';
119
119
  }
120
120
  // If the table hasn't been resize, the colgroup 48px width values will gracefully scale down.
@@ -123,7 +123,7 @@ export const previewScaleTable = (tableRef, options, domAtPos, isTableScalingEna
123
123
  syncStickyRowToTable(tableRef);
124
124
  return;
125
125
  }
126
- const shouldUseIncreasedScalingPercent = isTableScalingEnabledWithLockButton && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
126
+ const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
127
127
  const resizeState = parentWidth ? scaleWithParent(tableRef, parentWidth, node, start, domAtPos, false,
128
128
  // Here isTableScalingEnabled = false
129
129
  shouldUseIncreasedScalingPercent) : scale(tableRef, options, domAtPos, false, shouldUseIncreasedScalingPercent);
@@ -82,6 +82,7 @@ export const getToolbarMenuConfig = (config, state, {
82
82
  type: optionItem
83
83
  }
84
84
  }];
85
+ const tableOptionsDropdownWidth = isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined;
85
86
  if (state.isDragAndDropEnabled) {
86
87
  return {
87
88
  id: 'editor.table.tableOptions',
@@ -91,7 +92,7 @@ export const getToolbarMenuConfig = (config, state, {
91
92
  title: formatMessage(messages.tableOptions),
92
93
  hidden: options.every(option => option.hidden),
93
94
  options,
94
- dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
95
+ dropdownWidth: tableOptionsDropdownWidth
95
96
  };
96
97
  } else {
97
98
  return {
@@ -101,7 +102,7 @@ export const getToolbarMenuConfig = (config, state, {
101
102
  title: formatMessage(messages.tableOptions),
102
103
  hidden: options.every(option => option.hidden),
103
104
  options,
104
- dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
105
+ dropdownWidth: tableOptionsDropdownWidth
105
106
  };
106
107
  }
107
108
  };
@@ -111,7 +112,7 @@ export const getToolbarMenuConfig = (config, state, {
111
112
  // with native widgets. It's enabled via a plugin config.
112
113
  export const getToolbarCellOptionsConfig = (editorState, editorView, initialSelectionRect, {
113
114
  formatMessage
114
- }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false, shouldUseIncreasedScalingPercent = false) => {
115
+ }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false, isCellBackgroundDuplicated = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => {
115
116
  var _pluginState$pluginCo, _pluginState$pluginCo2;
116
117
  const {
117
118
  top,
@@ -129,7 +130,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
129
130
  const selectionRect = getClosestSelectionRect(state);
130
131
  const index = selectionRect === null || selectionRect === void 0 ? void 0 : selectionRect.right;
131
132
  if (index) {
132
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
133
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
133
134
  }
134
135
  return true;
135
136
  },
@@ -165,7 +166,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
165
166
  onClick: (state, dispatch, view) => {
166
167
  const selectionRect = getClosestSelectionRect(state);
167
168
  if (selectionRect) {
168
- deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
169
+ deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
169
170
  }
170
171
  return true;
171
172
  },
@@ -208,7 +209,7 @@ export const getToolbarCellOptionsConfig = (editorState, editorView, initialSele
208
209
  }];
209
210
  if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo = pluginState.pluginConfig) !== null && _pluginState$pluginCo !== void 0 && _pluginState$pluginCo.allowDistributeColumns) {
210
211
  var _newResizeStateWithAn;
211
- const newResizeStateWithAnalytics = editorView ? getNewResizeStateFromSelectedColumns(initialSelectionRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled) : undefined;
212
+ const newResizeStateWithAnalytics = editorView ? getNewResizeStateFromSelectedColumns(initialSelectionRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : undefined;
212
213
  const wouldChange = (_newResizeStateWithAn = newResizeStateWithAnalytics === null || newResizeStateWithAnalytics === void 0 ? void 0 : newResizeStateWithAnalytics.changed) !== null && _newResizeStateWithAn !== void 0 ? _newResizeStateWithAn : false;
213
214
  const distributeColumnWidths = (state, dispatch) => {
214
215
  if (newResizeStateWithAnalytics) {
@@ -316,18 +317,19 @@ export const getClosestSelectionOrTableRect = state => {
316
317
  const tableRect = new Rect(0, 0, map.width, map.height);
317
318
  return isSelectionType(selection, 'cell') ? getSelectionRect(selection) : tableRect;
318
319
  };
319
- export const getToolbarConfig = (getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options, isTableScalingWithFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => config => (state, intl) => {
320
+ export const getToolbarConfig = (getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => config => (state, intl) => {
320
321
  const tableObject = findTable(state.selection);
321
322
  const pluginState = getPluginState(state);
322
323
  const resizeState = tableResizingPluginKey.getState(state);
323
324
  const tableWidthState = tableWidthPluginKey.getState(state);
325
+ const isTableScalingEnabled = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || false;
324
326
 
325
327
  // We don't want to show floating toolbar while resizing the table
326
328
  const isWidthResizing = tableWidthState === null || tableWidthState === void 0 ? void 0 : tableWidthState.resizing;
327
329
  if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
328
330
  const nodeType = state.schema.nodes.table;
329
331
  const isNested = pluginState.tablePos && isTableNested(state, pluginState.tablePos);
330
- const isTableScalingWithFixedColumnWidthsOptionShown = isTableScalingWithFixedColumnWidthsOptionEnabled && !isNested;
332
+ const isTableScalingWithFixedColumnWidthsOptionShown = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && !isNested;
331
333
  const areTableColumWidthsFixed = tableObject.node.attrs.displayMode === 'fixed';
332
334
  const editorView = getEditorView();
333
335
  const getDomRef = editorView => {
@@ -343,9 +345,10 @@ export const getToolbarConfig = (getEditorContainerWidth, editorAnalyticsAPI, ge
343
345
  return element;
344
346
  };
345
347
  const menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
346
- const alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView) : [];
347
- const cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, shouldUseIncreasedScalingPercent);
348
- const columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) : [];
348
+ const alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) : [];
349
+ const isCellBackgroundDuplicated = getEditorFeatureFlags().tableDuplicateCellColouring || false;
350
+ const cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
351
+ const columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : [];
349
352
  const colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, getEditorView);
350
353
 
351
354
  // Check if we need to show confirm dialog for delete button
@@ -425,22 +428,22 @@ const separator = hidden => {
425
428
  };
426
429
  const getCellItems = (state, view, {
427
430
  formatMessage
428
- }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false, shouldUseIncreasedScalingPercent = false) => {
431
+ }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false, isCellBackgroundDuplicated = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => {
429
432
  const initialSelectionRect = getClosestSelectionRect(state);
430
433
  if (initialSelectionRect) {
431
434
  const cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
432
435
  formatMessage
433
- }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent);
436
+ }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
434
437
  return [cellOptions, separator(cellOptions.hidden)];
435
438
  }
436
439
  return [];
437
440
  };
438
- export const getDistributeConfig = (getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false) => (state, dispatch, editorView) => {
441
+ export const getDistributeConfig = (getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false) => (state, dispatch, editorView) => {
439
442
  const selectionOrTableRect = getClosestSelectionOrTableRect(state);
440
443
  if (!editorView || !selectionOrTableRect) {
441
444
  return false;
442
445
  }
443
- const newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
446
+ const newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled);
444
447
  if (newResizeStateWithAnalytics) {
445
448
  distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, newResizeStateWithAnalytics)(state, dispatch);
446
449
  return true;
@@ -452,14 +455,14 @@ export const getDistributeConfig = (getEditorContainerWidth, editorAnalyticsAPI,
452
455
  // fixed column button should be in this function call in the future
453
456
  const getColumnSettingItems = (editorState, editorView, {
454
457
  formatMessage
455
- }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false) => {
458
+ }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false) => {
456
459
  var _newResizeStateWithAn2, _pluginState$pluginCo3;
457
460
  const pluginState = getPluginState(editorState);
458
461
  const selectionOrTableRect = getClosestSelectionOrTableRect(editorState);
459
462
  if (!selectionOrTableRect || !editorView) {
460
463
  return [];
461
464
  }
462
- const newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
465
+ const newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled);
463
466
  const wouldChange = (_newResizeStateWithAn2 = newResizeStateWithAnalytics === null || newResizeStateWithAnalytics === void 0 ? void 0 : newResizeStateWithAnalytics.changed) !== null && _newResizeStateWithAn2 !== void 0 ? _newResizeStateWithAn2 : false;
464
467
  const items = [];
465
468
  if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo3 = pluginState.pluginConfig) !== null && _pluginState$pluginCo3 !== void 0 && _pluginState$pluginCo3.allowDistributeColumns && pluginState.isDragAndDropEnabled) {
@@ -468,7 +471,7 @@ const getColumnSettingItems = (editorState, editorView, {
468
471
  type: 'button',
469
472
  title: formatMessage(messages.distributeColumns),
470
473
  icon: DistributeColumnIcon,
471
- onClick: (state, dispatch, view) => getDistributeConfig(getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled)(state, dispatch, view),
474
+ onClick: (state, dispatch, view) => getDistributeConfig(getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled)(state, dispatch, view),
472
475
  disabled: !wouldChange
473
476
  });
474
477
  }
@@ -538,7 +541,7 @@ const highlightColumnsHandler = (state, dispatch) => {
538
541
  };
539
542
  export const getAlignmentOptionsConfig = (editorState, {
540
543
  formatMessage
541
- }, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView) => {
544
+ }, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) => {
542
545
  const tableObject = findTable(editorState.selection);
543
546
  if (!tableObject) {
544
547
  return [];
@@ -572,7 +575,7 @@ export const getAlignmentOptionsConfig = (editorState, {
572
575
  title: formatMessage(layoutToMessages[value]),
573
576
  selected: normaliseAlignment(currentLayout) === value,
574
577
  onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED),
575
- ...(isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView) && {
578
+ ...(isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) && {
576
579
  disabled: value !== 'center'
577
580
  })
578
581
  };
@@ -601,7 +604,7 @@ export const getSelectedAlignmentIcon = (alignmentIcons, selectedNode) => {
601
604
  const selectedAlignment = selectedNode.attrs.layout;
602
605
  return alignmentIcons.find(icon => icon.value === normaliseAlignment(selectedAlignment));
603
606
  };
604
- export const isLayoutOptionDisabled = (selectedNode, getEditorContainerWidth, getDomRef, editorView) => {
607
+ export const isLayoutOptionDisabled = (selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) => {
605
608
  const {
606
609
  lineLength
607
610
  } = getEditorContainerWidth();
@@ -611,7 +614,7 @@ export const isLayoutOptionDisabled = (selectedNode, getEditorContainerWidth, ge
611
614
  if (editorView) {
612
615
  const tableWrapper = getDomRef(editorView);
613
616
  const tableWrapperWidth = (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.clientWidth) || tableContainerWidth;
614
- const scalePercent = getStaticTableScalingPercent(selectedNode, tableWrapperWidth);
617
+ const scalePercent = getStaticTableScalingPercent(selectedNode, tableWrapperWidth, shouldUseIncreasedScalingPercent);
615
618
  tableContainerWidth = tableContainerWidth * scalePercent;
616
619
  }
617
620
  if (selectedNode && lineLength && tableContainerWidth > lineLength) {
@@ -88,7 +88,7 @@ export const updateColumnWidths = (resizeState, table, start) => tr => {
88
88
  * @param view
89
89
  * @returns Updated transaction with rescaled columns for a given table
90
90
  */
91
- export const rescaleColumns = (isTableScalingEnabled = false, shouldUseIncreasedScalingPercent = false) => (table, view) => tr => {
91
+ export const rescaleColumns = (isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => (table, view) => tr => {
92
92
  if (!view) {
93
93
  return tr;
94
94
  }
@@ -108,7 +108,7 @@ export const rescaleColumns = (isTableScalingEnabled = false, shouldUseIncreased
108
108
  };
109
109
  const tableDepth = view.state.doc.resolve(table.pos).depth;
110
110
  let shouldScale = isTableScalingEnabled && tableDepth === 0;
111
- if (shouldScale && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button')) {
111
+ if (shouldScale && isTableFixedColumnWidthsOptionEnabled) {
112
112
  shouldScale = newTable.attrs.displayMode !== 'fixed';
113
113
  }
114
114
  if (shouldScale) {
@@ -173,7 +173,6 @@ export const rescaleColumns = (isTableScalingEnabled = false, shouldUseIncreased
173
173
  isTableScalingEnabled: shouldScale,
174
174
  shouldUseIncreasedScalingPercent
175
175
  });
176
-
177
176
  // Two scenarios that require scaling:
178
177
  // 1. If the new table width will result in the table going into overflow
179
178
  // we resize the cells to avoid it (e.g. adding a column)
@@ -192,7 +192,7 @@ function fixRowSpans(table) {
192
192
  }
193
193
  return table.type.createChecked(table.attrs, rows, table.marks);
194
194
  }
195
- export const deleteColumns = (rect, allowCustomStep, view, isTableScalingEnabled = false, shouldUseIncreasedScalingPercent = false) => tr => {
195
+ export const deleteColumns = (rect, allowCustomStep, view, isTableScalingEnabled = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => tr => {
196
196
  let updatedTr = tr;
197
197
  updatedTr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
198
198
  name: TABLE_OVERFLOW_CHANGE_TRIGGER.DELETED_COLUMN
@@ -204,7 +204,7 @@ export const deleteColumns = (rect, allowCustomStep, view, isTableScalingEnabled
204
204
  }
205
205
  const table = findTable(updatedTr.selection);
206
206
  if (table) {
207
- updatedTr = rescaleColumns(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
207
+ updatedTr = rescaleColumns(isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
208
208
  }
209
209
  return updatedTr;
210
210
  };
@@ -298,7 +298,8 @@ export class ContextualMenu extends Component {
298
298
  formatMessage
299
299
  },
300
300
  editorView,
301
- getEditorContainerWidth
301
+ getEditorContainerWidth,
302
+ getEditorFeatureFlags
302
303
  } = this.props;
303
304
  const {
304
305
  isDragAndDropEnabled,
@@ -311,7 +312,10 @@ export class ContextualMenu extends Component {
311
312
  const {
312
313
  isTableScalingEnabled = false
313
314
  } = getPluginState(editorView.state);
314
- const newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, editorView.state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
315
+ const {
316
+ tableWithFixedColumnWidthsOption = false
317
+ } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
318
+ const newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, editorView.state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, tableWithFixedColumnWidthsOption);
315
319
  const wouldChange = (_newResizeState$chang = newResizeState === null || newResizeState === void 0 ? void 0 : newResizeState.changed) !== null && _newResizeState$chang !== void 0 ? _newResizeState$chang : false;
316
320
  return {
317
321
  content: formatMessage(messages.distributeColumns),
@@ -418,9 +422,10 @@ export class ContextualMenu extends Component {
418
422
  isTableScalingEnabled = false
419
423
  } = getPluginState(state);
420
424
  const {
421
- tableDuplicateCellColouring = false
425
+ tableDuplicateCellColouring = false,
426
+ tableWithFixedColumnWidthsOption = false
422
427
  } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
423
- const shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
428
+ const shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
424
429
  switch (item.value.name) {
425
430
  case 'sort_column_desc':
426
431
  sortColumnWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect.left, SortOrder.DESC)(state, dispatch);
@@ -439,7 +444,7 @@ export class ContextualMenu extends Component {
439
444
  this.toggleOpen();
440
445
  break;
441
446
  case 'distribute_columns':
442
- const newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
447
+ const newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, tableWithFixedColumnWidthsOption);
443
448
  if (newResizeStateWithAnalytics) {
444
449
  distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, newResizeStateWithAnalytics)(state, dispatch);
445
450
  this.toggleOpen();
@@ -450,7 +455,7 @@ export class ContextualMenu extends Component {
450
455
  this.toggleOpen();
451
456
  break;
452
457
  case 'insert_column':
453
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
458
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
454
459
  this.toggleOpen();
455
460
  break;
456
461
  case 'insert_row':
@@ -461,7 +466,7 @@ export class ContextualMenu extends Component {
461
466
  this.toggleOpen();
462
467
  break;
463
468
  case 'delete_column':
464
- deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
469
+ deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
465
470
  this.toggleOpen();
466
471
  break;
467
472
  case 'delete_row':
@@ -178,7 +178,8 @@ export const DragMenu = /*#__PURE__*/React.memo(({
178
178
  boundariesElement,
179
179
  isTableScalingEnabled,
180
180
  tableDuplicateCellColouring,
181
- shouldUseIncreasedScalingPercent
181
+ shouldUseIncreasedScalingPercent,
182
+ isTableFixedColumnWidthsOptionEnabled
182
183
  }) => {
183
184
  var _pluginConfig$allowBa;
184
185
  const {
@@ -206,7 +207,7 @@ export const DragMenu = /*#__PURE__*/React.memo(({
206
207
  hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
207
208
  }
208
209
  const allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
209
- const dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent);
210
+ const dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
210
211
  const {
211
212
  menuItems,
212
213
  menuCallback
@@ -32,9 +32,10 @@ const FloatingDragMenu = ({
32
32
  return null;
33
33
  }
34
34
  const {
35
- tableDuplicateCellColouring = false
35
+ tableDuplicateCellColouring = false,
36
+ tableWithFixedColumnWidthsOption = false
36
37
  } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
37
- const shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
38
+ const shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
38
39
  return /*#__PURE__*/React.createElement(Popup, {
39
40
  alignX: direction === 'row' ? 'right' : undefined,
40
41
  alignY: direction === 'row' ? 'start' : undefined,
@@ -70,7 +71,8 @@ const FloatingDragMenu = ({
70
71
  scrollableElement: scrollableElement,
71
72
  isTableScalingEnabled: isTableScalingEnabled,
72
73
  tableDuplicateCellColouring: tableDuplicateCellColouring,
73
- shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
74
+ shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
75
+ isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption
74
76
  }));
75
77
  };
76
78
  FloatingDragMenu.displayName = 'FloatingDragMenu';
@@ -12,7 +12,6 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
12
12
  import { findTable } from '@atlaskit/editor-tables/utils';
13
13
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
14
  import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
15
- import { getPluginState } from '../../pm-plugins/plugin-factory';
16
15
  import { TableCssClassName as ClassName } from '../../types';
17
16
  import { checkIfNumberColumnEnabled } from '../../utils';
18
17
  import getPopupOptions from './getPopupOptions';
@@ -178,22 +177,21 @@ export class FloatingInsertButton extends React.Component {
178
177
  editorView,
179
178
  insertColumnButtonIndex,
180
179
  editorAnalyticsAPI,
181
- getEditorFeatureFlags
180
+ getEditorFeatureFlags,
181
+ isTableScalingEnabled
182
182
  } = this.props;
183
183
  if (typeof insertColumnButtonIndex !== 'undefined') {
184
184
  event.preventDefault();
185
185
  const {
186
- isTableScalingEnabled = false
187
- } = getPluginState(editorView.state);
188
- const shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
189
- const {
190
- tableDuplicateCellColouring = false
186
+ tableDuplicateCellColouring = false,
187
+ tableWithFixedColumnWidthsOption = false
191
188
  } = getEditorFeatureFlags ? getEditorFeatureFlags() : {};
189
+ const shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
192
190
  const {
193
191
  state,
194
192
  dispatch
195
193
  } = editorView;
196
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
194
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
197
195
  }
198
196
  }
199
197
  }
@@ -65,7 +65,7 @@ const defaultSelectionRect = {
65
65
  right: 0,
66
66
  bottom: 0
67
67
  };
68
- export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired, isTableScalingEnabled = false, tableDuplicateCellColouring = false, shouldUseIncreasedScalingPercent = false) => {
68
+ export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, isHeaderRowRequired, isTableScalingEnabled = false, tableDuplicateCellColouring = false, isTableFixedColumnWidthsOptionEnabled = false, shouldUseIncreasedScalingPercent = false) => {
69
69
  var _tableMap$height, _tableMap$height2, _tableMap$width, _tableMap$width2;
70
70
  const addOptions = direction === 'row' ? [{
71
71
  label: 'above',
@@ -145,7 +145,7 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, h
145
145
  moveCursorToInsertedRow: true
146
146
  })(state, dispatch);
147
147
  } else {
148
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
148
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
149
149
  }
150
150
  return true;
151
151
  },
@@ -157,7 +157,7 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, h
157
157
  onClick: (state, dispatch) => {
158
158
  const selectionRect = getClosestSelectionRect(state);
159
159
  if (selectionRect) {
160
- const newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
160
+ const newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled);
161
161
  if (newResizeState) {
162
162
  distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, newResizeState)(state, dispatch);
163
163
  return true;
@@ -183,7 +183,7 @@ export const getDragMenuConfig = (direction, getEditorContainerWidth, canDrag, h
183
183
  if (direction === 'row') {
184
184
  deleteRowsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect, !!isHeaderRowRequired)(state, dispatch);
185
185
  } else {
186
- deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
186
+ deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
187
187
  }
188
188
  return true;
189
189
  },
@@ -154,6 +154,7 @@ export var changeColumnWidthByStep = function changeColumnWidthByStep(_ref4) {
154
154
  var stepSize = _ref4.stepSize,
155
155
  getEditorContainerWidth = _ref4.getEditorContainerWidth,
156
156
  isTableScalingEnabled = _ref4.isTableScalingEnabled,
157
+ isTableFixedColumnWidthsOptionEnabled = _ref4.isTableFixedColumnWidthsOptionEnabled,
157
158
  ariaNotify = _ref4.ariaNotify,
158
159
  getIntl = _ref4.getIntl;
159
160
  return function (state, dispatch, view) {
@@ -205,11 +206,11 @@ export var changeColumnWidthByStep = function changeColumnWidthByStep(_ref4) {
205
206
  getEditorContainerWidth: getEditorContainerWidth
206
207
  });
207
208
  var isTableScalingEnabledOnCurrentTable = isTableScalingEnabled;
208
- var isTableScalingEnabledWithLockButton = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button');
209
- if (isTableScalingEnabledWithLockButton) {
209
+ var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled;
210
+ if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
210
211
  isTableScalingEnabledOnCurrentTable = originalTable.attrs.displayMode !== 'fixed';
211
212
  }
212
- var shouldUseIncreasedScalingPercent = isTableScalingEnabledWithLockButton && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
213
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
213
214
  var initialResizeState = getResizeState({
214
215
  minWidth: tableCellMinWidth,
215
216
  maxSize: maxSize,
@@ -2,9 +2,10 @@ import { deleteColumns } from '../transforms/delete-columns';
2
2
  import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
3
3
  export var deleteColumnsCommand = function deleteColumnsCommand(rect) {
4
4
  var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5
- var shouldUseIncreasedScalingPercent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
5
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
6
+ var shouldUseIncreasedScalingPercent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
6
7
  return function (state, dispatch, view) {
7
- var tr = deleteColumns(rect, getAllowAddColumnCustomStep(state), view, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(state.tr);
8
+ var tr = deleteColumns(rect, getAllowAddColumnCustomStep(state), view, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(state.tr);
8
9
  if (dispatch) {
9
10
  dispatch(tr);
10
11
  return true;
@@ -22,7 +22,8 @@ function addColumnAtCustomStep(column) {
22
22
  export function addColumnAt() {
23
23
  var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
24
24
  var isCellBackgroundDuplicated = arguments.length > 1 ? arguments[1] : undefined;
25
- var shouldUseIncreasedScalingPercent = arguments.length > 2 ? arguments[2] : undefined;
25
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
26
+ var shouldUseIncreasedScalingPercent = arguments.length > 3 ? arguments[3] : undefined;
26
27
  return function (column) {
27
28
  var allowAddColumnCustomStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
28
29
  var view = arguments.length > 2 ? arguments[2] : undefined;
@@ -36,7 +37,7 @@ export function addColumnAt() {
36
37
  var table = findTable(updatedTr.selection);
37
38
  if (table) {
38
39
  // [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
39
- updatedTr = rescaleColumns(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
40
+ updatedTr = rescaleColumns(isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
40
41
  }
41
42
  if (view) {
42
43
  updatedTr = updateRowOrColumnMovedTransform({
@@ -55,7 +56,9 @@ export function addColumnAt() {
55
56
  // Command to add a column before the column with the selection.
56
57
  export var addColumnBefore = function addColumnBefore() {
57
58
  var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
58
- var shouldUseIncreasedScalingPercent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
59
+ var isCellBackgroundDuplicated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
60
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
61
+ var shouldUseIncreasedScalingPercent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
59
62
  return function (state, dispatch, view) {
60
63
  var table = findTable(state.selection);
61
64
  if (!table) {
@@ -63,7 +66,7 @@ export var addColumnBefore = function addColumnBefore() {
63
66
  }
64
67
  if (dispatch) {
65
68
  var rect = selectedRect(state);
66
- dispatch(addColumnAt(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(rect.left, getAllowAddColumnCustomStep(state), view)(state.tr));
69
+ dispatch(addColumnAt(isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(rect.left, getAllowAddColumnCustomStep(state), view)(state.tr));
67
70
  }
68
71
  return true;
69
72
  };
@@ -71,7 +74,7 @@ export var addColumnBefore = function addColumnBefore() {
71
74
 
72
75
  // :: (EditorState, dispatch: ?(tr: Transaction)) → bool
73
76
  // Command to add a column after the column with the selection.
74
- export var addColumnAfter = function addColumnAfter(isTableScalingEnabled, shouldUseIncreasedScalingPercent) {
77
+ export var addColumnAfter = function addColumnAfter(isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent) {
75
78
  return function (state, dispatch, view) {
76
79
  var table = findTable(state.selection);
77
80
  if (!table) {
@@ -79,7 +82,7 @@ export var addColumnAfter = function addColumnAfter(isTableScalingEnabled, shoul
79
82
  }
80
83
  if (dispatch) {
81
84
  var rect = selectedRect(state);
82
- dispatch(addColumnAt(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(rect.right, getAllowAddColumnCustomStep(state), view)(state.tr));
85
+ dispatch(addColumnAt(isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(rect.right, getAllowAddColumnCustomStep(state), view)(state.tr));
83
86
  }
84
87
  return true;
85
88
  };
@@ -87,10 +90,11 @@ export var addColumnAfter = function addColumnAfter(isTableScalingEnabled, shoul
87
90
  export var insertColumn = function insertColumn() {
88
91
  var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
89
92
  var isCellBackgroundDuplicated = arguments.length > 1 ? arguments[1] : undefined;
90
- var shouldUseIncreasedScalingPercent = arguments.length > 2 ? arguments[2] : undefined;
93
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 ? arguments[2] : undefined;
94
+ var shouldUseIncreasedScalingPercent = arguments.length > 3 ? arguments[3] : undefined;
91
95
  return function (column) {
92
96
  return function (state, dispatch, view) {
93
- var tr = addColumnAt(isTableScalingEnabled, isCellBackgroundDuplicated, shouldUseIncreasedScalingPercent)(column, getAllowAddColumnCustomStep(state), view)(state.tr);
97
+ var tr = addColumnAt(isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(column, getAllowAddColumnCustomStep(state), view)(state.tr);
94
98
  var table = findTable(tr.selection);
95
99
  if (!table) {
96
100
  return false;
@@ -188,7 +188,7 @@ export var insertRowWithAnalytics = function insertRowWithAnalytics(editorAnalyt
188
188
  };
189
189
  };
190
190
  export var changeColumnWidthByStepWithAnalytics = function changeColumnWidthByStepWithAnalytics(editorAnalyticsAPI) {
191
- return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, inputMethod, ariaNotify, getIntl) {
191
+ return function (stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, inputMethod, ariaNotify, getIntl) {
192
192
  return withEditorAnalyticsAPI(function (state) {
193
193
  var _getSelectedTableInfo2 = getSelectedTableInfo(state.selection),
194
194
  table = _getSelectedTableInfo2.table,
@@ -214,6 +214,7 @@ export var changeColumnWidthByStepWithAnalytics = function changeColumnWidthBySt
214
214
  stepSize: stepSize,
215
215
  getEditorContainerWidth: getEditorContainerWidth,
216
216
  isTableScalingEnabled: isTableScalingEnabled,
217
+ isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled,
217
218
  ariaNotify: ariaNotify,
218
219
  getIntl: getIntl
219
220
  }));
@@ -222,7 +223,8 @@ export var changeColumnWidthByStepWithAnalytics = function changeColumnWidthBySt
222
223
  export var insertColumnWithAnalytics = function insertColumnWithAnalytics(editorAnalyticsAPI) {
223
224
  var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
224
225
  var isCellbackgroundDuplicated = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
225
- var shouldUseIncreasedScalingPercent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
226
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
227
+ var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
226
228
  return function (inputMethod, position) {
227
229
  return withEditorAnalyticsAPI(function (state) {
228
230
  var _getSelectedTableInfo3 = getSelectedTableInfo(state.selection),
@@ -240,7 +242,7 @@ export var insertColumnWithAnalytics = function insertColumnWithAnalytics(editor
240
242
  },
241
243
  eventType: EVENT_TYPE.TRACK
242
244
  };
243
- })(editorAnalyticsAPI)(insertColumn(isTableScalingEnabled, isCellbackgroundDuplicated, shouldUseIncreasedScalingPercent)(position));
245
+ })(editorAnalyticsAPI)(insertColumn(isTableScalingEnabled, isCellbackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(position));
244
246
  };
245
247
  };
246
248
  export var deleteRowsWithAnalytics = function deleteRowsWithAnalytics(editorAnalyticsAPI) {
@@ -273,7 +275,8 @@ export var deleteRowsWithAnalytics = function deleteRowsWithAnalytics(editorAnal
273
275
  };
274
276
  export var deleteColumnsWithAnalytics = function deleteColumnsWithAnalytics(editorAnalyticsAPI) {
275
277
  var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
276
- var shouldUseIncreasedScalingPercent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
278
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
279
+ var shouldUseIncreasedScalingPercent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
277
280
  return function (inputMethod, rect) {
278
281
  return withEditorAnalyticsAPI(function (_ref6) {
279
282
  var selection = _ref6.selection;
@@ -293,10 +296,10 @@ export var deleteColumnsWithAnalytics = function deleteColumnsWithAnalytics(edit
293
296
  },
294
297
  eventType: EVENT_TYPE.TRACK
295
298
  };
296
- })(editorAnalyticsAPI)(deleteColumnsCommand(rect, isTableScalingEnabled, shouldUseIncreasedScalingPercent));
299
+ })(editorAnalyticsAPI)(deleteColumnsCommand(rect, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent));
297
300
  };
298
301
  };
299
- export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent) {
302
+ export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent) {
300
303
  return function (state, dispatch) {
301
304
  var selection = state.selection;
302
305
  var isCellSelection = selection instanceof CellSelection;
@@ -314,7 +317,7 @@ export var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function delete
314
317
  var isHeaderRowRequired = pluginConfig.isHeaderRowRequired || false;
315
318
  return deleteRowsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.SHORTCUT, rect, isHeaderRowRequired)(state, dispatch);
316
319
  } else if (selectionType === 'column') {
317
- return deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.SHORTCUT, rect)(state, dispatch);
320
+ return deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.SHORTCUT, rect)(state, dispatch);
318
321
  } else {
319
322
  return false;
320
323
  }