@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
@@ -87,6 +87,7 @@ export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _
87
87
  type: optionItem
88
88
  }
89
89
  }];
90
+ var tableOptionsDropdownWidth = isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined;
90
91
  if (state.isDragAndDropEnabled) {
91
92
  return {
92
93
  id: 'editor.table.tableOptions',
@@ -98,7 +99,7 @@ export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _
98
99
  return option.hidden;
99
100
  }),
100
101
  options: options,
101
- dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
102
+ dropdownWidth: tableOptionsDropdownWidth
102
103
  };
103
104
  } else {
104
105
  return {
@@ -110,7 +111,7 @@ export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _
110
111
  return option.hidden;
111
112
  }),
112
113
  options: options,
113
- dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
114
+ dropdownWidth: tableOptionsDropdownWidth
114
115
  };
115
116
  }
116
117
  };
@@ -122,7 +123,9 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
122
123
  var _pluginState$pluginCo, _pluginState$pluginCo2;
123
124
  var formatMessage = _ref2.formatMessage;
124
125
  var isTableScalingEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
125
- var shouldUseIncreasedScalingPercent = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
126
+ var isCellBackgroundDuplicated = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
127
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
128
+ var shouldUseIncreasedScalingPercent = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
126
129
  var top = initialSelectionRect.top,
127
130
  bottom = initialSelectionRect.bottom,
128
131
  right = initialSelectionRect.right,
@@ -137,7 +140,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
137
140
  var selectionRect = getClosestSelectionRect(state);
138
141
  var index = selectionRect === null || selectionRect === void 0 ? void 0 : selectionRect.right;
139
142
  if (index) {
140
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
143
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
141
144
  }
142
145
  return true;
143
146
  },
@@ -173,7 +176,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
173
176
  onClick: function onClick(state, dispatch, view) {
174
177
  var selectionRect = getClosestSelectionRect(state);
175
178
  if (selectionRect) {
176
- deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
179
+ deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
177
180
  }
178
181
  return true;
179
182
  },
@@ -216,7 +219,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
216
219
  }];
217
220
  if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo = pluginState.pluginConfig) !== null && _pluginState$pluginCo !== void 0 && _pluginState$pluginCo.allowDistributeColumns) {
218
221
  var _newResizeStateWithAn;
219
- var newResizeStateWithAnalytics = editorView ? getNewResizeStateFromSelectedColumns(initialSelectionRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled) : undefined;
222
+ var newResizeStateWithAnalytics = editorView ? getNewResizeStateFromSelectedColumns(initialSelectionRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : undefined;
220
223
  var wouldChange = (_newResizeStateWithAn = newResizeStateWithAnalytics === null || newResizeStateWithAnalytics === void 0 ? void 0 : newResizeStateWithAnalytics.changed) !== null && _newResizeStateWithAn !== void 0 ? _newResizeStateWithAn : false;
221
224
  var distributeColumnWidths = function distributeColumnWidths(state, dispatch) {
222
225
  if (newResizeStateWithAnalytics) {
@@ -324,7 +327,7 @@ export var getClosestSelectionOrTableRect = function getClosestSelectionOrTableR
324
327
  return isSelectionType(selection, 'cell') ? getSelectionRect(selection) : tableRect;
325
328
  };
326
329
  export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options) {
327
- var isTableScalingWithFixedColumnWidthsOptionEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
330
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
328
331
  var shouldUseIncreasedScalingPercent = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
329
332
  return function (config) {
330
333
  return function (state, intl) {
@@ -332,13 +335,14 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
332
335
  var pluginState = getPluginState(state);
333
336
  var resizeState = tableResizingPluginKey.getState(state);
334
337
  var tableWidthState = tableWidthPluginKey.getState(state);
338
+ var isTableScalingEnabled = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) || false;
335
339
 
336
340
  // We don't want to show floating toolbar while resizing the table
337
341
  var isWidthResizing = tableWidthState === null || tableWidthState === void 0 ? void 0 : tableWidthState.resizing;
338
342
  if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
339
343
  var nodeType = state.schema.nodes.table;
340
344
  var isNested = pluginState.tablePos && isTableNested(state, pluginState.tablePos);
341
- var isTableScalingWithFixedColumnWidthsOptionShown = isTableScalingWithFixedColumnWidthsOptionEnabled && !isNested;
345
+ var isTableScalingWithFixedColumnWidthsOptionShown = isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && !isNested;
342
346
  var areTableColumWidthsFixed = tableObject.node.attrs.displayMode === 'fixed';
343
347
  var editorView = getEditorView();
344
348
  var getDomRef = function getDomRef(editorView) {
@@ -354,9 +358,10 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
354
358
  return element;
355
359
  };
356
360
  var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
357
- var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView) : [];
358
- var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, shouldUseIncreasedScalingPercent);
359
- var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) : [];
361
+ var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) : [];
362
+ var isCellBackgroundDuplicated = getEditorFeatureFlags().tableDuplicateCellColouring || false;
363
+ var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
364
+ var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled) : [];
360
365
  var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, getEditorView);
361
366
 
362
367
  // Check if we need to show confirm dialog for delete button
@@ -445,24 +450,27 @@ var separator = function separator(hidden) {
445
450
  var getCellItems = function getCellItems(state, view, _ref3, getEditorContainerWidth, editorAnalyticsAPI) {
446
451
  var formatMessage = _ref3.formatMessage;
447
452
  var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
448
- var shouldUseIncreasedScalingPercent = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
453
+ var isCellBackgroundDuplicated = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
454
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
455
+ var shouldUseIncreasedScalingPercent = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : false;
449
456
  var initialSelectionRect = getClosestSelectionRect(state);
450
457
  if (initialSelectionRect) {
451
458
  var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
452
459
  formatMessage: formatMessage
453
- }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent);
460
+ }, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isCellBackgroundDuplicated, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
454
461
  return [cellOptions, separator(cellOptions.hidden)];
455
462
  }
456
463
  return [];
457
464
  };
458
465
  export var getDistributeConfig = function getDistributeConfig(getEditorContainerWidth, editorAnalyticsAPI) {
459
466
  var isTableScalingEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
467
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
460
468
  return function (state, dispatch, editorView) {
461
469
  var selectionOrTableRect = getClosestSelectionOrTableRect(state);
462
470
  if (!editorView || !selectionOrTableRect) {
463
471
  return false;
464
472
  }
465
- var newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
473
+ var newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled);
466
474
  if (newResizeStateWithAnalytics) {
467
475
  distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, newResizeStateWithAnalytics)(state, dispatch);
468
476
  return true;
@@ -477,12 +485,13 @@ var getColumnSettingItems = function getColumnSettingItems(editorState, editorVi
477
485
  var _newResizeStateWithAn2, _pluginState$pluginCo3;
478
486
  var formatMessage = _ref4.formatMessage;
479
487
  var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
488
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
480
489
  var pluginState = getPluginState(editorState);
481
490
  var selectionOrTableRect = getClosestSelectionOrTableRect(editorState);
482
491
  if (!selectionOrTableRect || !editorView) {
483
492
  return [];
484
493
  }
485
- var newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
494
+ var newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled);
486
495
  var wouldChange = (_newResizeStateWithAn2 = newResizeStateWithAnalytics === null || newResizeStateWithAnalytics === void 0 ? void 0 : newResizeStateWithAnalytics.changed) !== null && _newResizeStateWithAn2 !== void 0 ? _newResizeStateWithAn2 : false;
487
496
  var items = [];
488
497
  if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo3 = pluginState.pluginConfig) !== null && _pluginState$pluginCo3 !== void 0 && _pluginState$pluginCo3.allowDistributeColumns && pluginState.isDragAndDropEnabled) {
@@ -492,7 +501,7 @@ var getColumnSettingItems = function getColumnSettingItems(editorState, editorVi
492
501
  title: formatMessage(messages.distributeColumns),
493
502
  icon: DistributeColumnIcon,
494
503
  onClick: function onClick(state, dispatch, view) {
495
- return getDistributeConfig(getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled)(state, dispatch, view);
504
+ return getDistributeConfig(getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled)(state, dispatch, view);
496
505
  },
497
506
  disabled: !wouldChange
498
507
  });
@@ -565,7 +574,7 @@ var highlightColumnsHandler = function highlightColumnsHandler(state, dispatch)
565
574
  }
566
575
  return false;
567
576
  };
568
- export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView) {
577
+ export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) {
569
578
  var formatMessage = _ref6.formatMessage;
570
579
  var tableObject = findTable(editorState.selection);
571
580
  if (!tableObject) {
@@ -598,7 +607,7 @@ export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editor
598
607
  title: formatMessage(layoutToMessages[value]),
599
608
  selected: normaliseAlignment(currentLayout) === value,
600
609
  onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED)
601
- }, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView) && {
610
+ }, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) && {
602
611
  disabled: value !== 'center'
603
612
  });
604
613
  });
@@ -628,7 +637,7 @@ export var getSelectedAlignmentIcon = function getSelectedAlignmentIcon(alignmen
628
637
  return icon.value === normaliseAlignment(selectedAlignment);
629
638
  });
630
639
  };
631
- export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth, getDomRef, editorView) {
640
+ export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth, getDomRef, editorView, shouldUseIncreasedScalingPercent) {
632
641
  var _getEditorContainerWi = getEditorContainerWidth(),
633
642
  lineLength = _getEditorContainerWi.lineLength;
634
643
  var tableContainerWidth = getTableContainerWidth(selectedNode);
@@ -637,7 +646,7 @@ export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode
637
646
  if (editorView) {
638
647
  var tableWrapper = getDomRef(editorView);
639
648
  var tableWrapperWidth = (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.clientWidth) || tableContainerWidth;
640
- var scalePercent = getStaticTableScalingPercent(selectedNode, tableWrapperWidth);
649
+ var scalePercent = getStaticTableScalingPercent(selectedNode, tableWrapperWidth, shouldUseIncreasedScalingPercent);
641
650
  tableContainerWidth = tableContainerWidth * scalePercent;
642
651
  }
643
652
  if (selectedNode && lineLength && tableContainerWidth > lineLength) {
@@ -92,7 +92,8 @@ export var updateColumnWidths = function updateColumnWidths(resizeState, table,
92
92
  */
93
93
  export var rescaleColumns = function rescaleColumns() {
94
94
  var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
95
- var shouldUseIncreasedScalingPercent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
95
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
96
+ var shouldUseIncreasedScalingPercent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
96
97
  return function (table, view) {
97
98
  return function (tr) {
98
99
  if (!view) {
@@ -114,7 +115,7 @@ export var rescaleColumns = function rescaleColumns() {
114
115
  };
115
116
  var tableDepth = view.state.doc.resolve(table.pos).depth;
116
117
  var shouldScale = isTableScalingEnabled && tableDepth === 0;
117
- if (shouldScale && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button')) {
118
+ if (shouldScale && isTableFixedColumnWidthsOptionEnabled) {
118
119
  shouldScale = newTable.attrs.displayMode !== 'fixed';
119
120
  }
120
121
  if (shouldScale) {
@@ -181,7 +182,6 @@ export var rescaleColumns = function rescaleColumns() {
181
182
  isTableScalingEnabled: shouldScale,
182
183
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
183
184
  });
184
-
185
185
  // Two scenarios that require scaling:
186
186
  // 1. If the new table width will result in the table going into overflow
187
187
  // we resize the cells to avoid it (e.g. adding a column)
@@ -206,7 +206,8 @@ function fixRowSpans(table) {
206
206
  }
207
207
  export var deleteColumns = function deleteColumns(rect, allowCustomStep, view) {
208
208
  var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
209
- var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
209
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
210
+ var shouldUseIncreasedScalingPercent = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
210
211
  return function (tr) {
211
212
  var updatedTr = tr;
212
213
  updatedTr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
@@ -219,7 +220,7 @@ export var deleteColumns = function deleteColumns(rect, allowCustomStep, view) {
219
220
  }
220
221
  var table = findTable(updatedTr.selection);
221
222
  if (table) {
222
- updatedTr = rescaleColumns(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
223
+ updatedTr = rescaleColumns(isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
223
224
  }
224
225
  return updatedTr;
225
226
  };
@@ -274,7 +274,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
274
274
  selectionRect = _this$props8.selectionRect,
275
275
  formatMessage = _this$props8.intl.formatMessage,
276
276
  editorView = _this$props8.editorView,
277
- getEditorContainerWidth = _this$props8.getEditorContainerWidth;
277
+ getEditorContainerWidth = _this$props8.getEditorContainerWidth,
278
+ getEditorFeatureFlags = _this$props8.getEditorFeatureFlags;
278
279
  var _getPluginState8 = getPluginState(editorView.state),
279
280
  isDragAndDropEnabled = _getPluginState8.isDragAndDropEnabled,
280
281
  allowDistributeColumns = _getPluginState8.pluginConfig.allowDistributeColumns;
@@ -283,7 +284,10 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
283
284
  var _getPluginState9 = getPluginState(editorView.state),
284
285
  _getPluginState9$isTa = _getPluginState9.isTableScalingEnabled,
285
286
  isTableScalingEnabled = _getPluginState9$isTa === void 0 ? false : _getPluginState9$isTa;
286
- var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, editorView.state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
287
+ var _ref = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
288
+ _ref$tableWithFixedCo = _ref.tableWithFixedColumnWidthsOption,
289
+ tableWithFixedColumnWidthsOption = _ref$tableWithFixedCo === void 0 ? false : _ref$tableWithFixedCo;
290
+ var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, editorView.state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, tableWithFixedColumnWidthsOption);
287
291
  var wouldChange = (_newResizeState$chang = newResizeState === null || newResizeState === void 0 ? void 0 : newResizeState.changed) !== null && _newResizeState$chang !== void 0 ? _newResizeState$chang : false;
288
292
  return {
289
293
  content: formatMessage(messages.distributeColumns),
@@ -365,8 +369,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
365
369
  items[1].items.push(deleteRowItem);
366
370
  return items;
367
371
  });
368
- _defineProperty(_assertThisInitialized(_this), "onMenuItemActivated", function (_ref) {
369
- var item = _ref.item;
372
+ _defineProperty(_assertThisInitialized(_this), "onMenuItemActivated", function (_ref2) {
373
+ var item = _ref2.item;
370
374
  var _this$props10 = _this.props,
371
375
  editorView = _this$props10.editorView,
372
376
  selectionRect = _this$props10.selectionRect,
@@ -380,10 +384,12 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
380
384
  targetCellPosition = _getPluginState11.targetCellPosition,
381
385
  _getPluginState11$isT = _getPluginState11.isTableScalingEnabled,
382
386
  isTableScalingEnabled = _getPluginState11$isT === void 0 ? false : _getPluginState11$isT;
383
- var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
384
- _ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
385
- tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC;
386
- var shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
387
+ var _ref3 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
388
+ _ref3$tableDuplicateC = _ref3.tableDuplicateCellColouring,
389
+ tableDuplicateCellColouring = _ref3$tableDuplicateC === void 0 ? false : _ref3$tableDuplicateC,
390
+ _ref3$tableWithFixedC = _ref3.tableWithFixedColumnWidthsOption,
391
+ tableWithFixedColumnWidthsOption = _ref3$tableWithFixedC === void 0 ? false : _ref3$tableWithFixedC;
392
+ var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
387
393
  switch (item.value.name) {
388
394
  case 'sort_column_desc':
389
395
  sortColumnWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect.left, SortOrder.DESC)(state, dispatch);
@@ -402,7 +408,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
402
408
  _this.toggleOpen();
403
409
  break;
404
410
  case 'distribute_columns':
405
- var newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
411
+ var newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, tableWithFixedColumnWidthsOption);
406
412
  if (newResizeStateWithAnalytics) {
407
413
  distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, newResizeStateWithAnalytics)(state, dispatch);
408
414
  _this.toggleOpen();
@@ -413,7 +419,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
413
419
  _this.toggleOpen();
414
420
  break;
415
421
  case 'insert_column':
416
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
422
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
417
423
  _this.toggleOpen();
418
424
  break;
419
425
  case 'insert_row':
@@ -424,7 +430,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
424
430
  _this.toggleOpen();
425
431
  break;
426
432
  case 'delete_column':
427
- deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
433
+ deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
428
434
  _this.toggleOpen();
429
435
  break;
430
436
  case 'delete_row':
@@ -457,8 +463,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
457
463
  isSubmenuOpen: false
458
464
  });
459
465
  });
460
- _defineProperty(_assertThisInitialized(_this), "handleItemMouseEnter", function (_ref3) {
461
- var item = _ref3.item;
466
+ _defineProperty(_assertThisInitialized(_this), "handleItemMouseEnter", function (_ref4) {
467
+ var item = _ref4.item;
462
468
  var _this$props12 = _this.props,
463
469
  _this$props12$editorV = _this$props12.editorView,
464
470
  state = _this$props12$editorV.state,
@@ -481,8 +487,8 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
481
487
  hoverMergedCells()(state, dispatch);
482
488
  }
483
489
  });
484
- _defineProperty(_assertThisInitialized(_this), "handleItemMouseLeave", function (_ref4) {
485
- var item = _ref4.item;
490
+ _defineProperty(_assertThisInitialized(_this), "handleItemMouseLeave", function (_ref5) {
491
+ var item = _ref5.item;
486
492
  var _this$props$editorVie2 = _this.props.editorView,
487
493
  state = _this$props$editorVie2.state,
488
494
  dispatch = _this$props$editorVie2.dispatch;
@@ -182,7 +182,8 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
182
182
  boundariesElement = _ref.boundariesElement,
183
183
  isTableScalingEnabled = _ref.isTableScalingEnabled,
184
184
  tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
185
- shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent;
185
+ shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
186
+ isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled;
186
187
  var state = editorView.state,
187
188
  dispatch = editorView.dispatch;
188
189
  var selection = state.selection;
@@ -206,7 +207,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
206
207
  hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
207
208
  }
208
209
  var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
209
- var 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
+ var 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
  var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
211
212
  menuItems = _convertToDropdownIte.menuItems,
212
213
  menuCallback = _convertToDropdownIte.menuCallback;
@@ -32,8 +32,10 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
32
32
  }
33
33
  var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
34
34
  _ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
35
- tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC;
36
- var shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
35
+ tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
36
+ _ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
37
+ tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC;
38
+ var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
37
39
  return /*#__PURE__*/React.createElement(Popup, {
38
40
  alignX: direction === 'row' ? 'right' : undefined,
39
41
  alignY: direction === 'row' ? 'start' : undefined,
@@ -69,7 +71,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
69
71
  scrollableElement: scrollableElement,
70
72
  isTableScalingEnabled: isTableScalingEnabled,
71
73
  tableDuplicateCellColouring: tableDuplicateCellColouring,
72
- shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
74
+ shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
75
+ isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption
73
76
  }));
74
77
  };
75
78
  FloatingDragMenu.displayName = 'FloatingDragMenu';
@@ -20,7 +20,6 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
20
20
  import { findTable } from '@atlaskit/editor-tables/utils';
21
21
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
22
22
  import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
23
- import { getPluginState } from '../../pm-plugins/plugin-factory';
24
23
  import { TableCssClassName as ClassName } from '../../types';
25
24
  import { checkIfNumberColumnEnabled } from '../../utils';
26
25
  import getPopupOptions from './getPopupOptions';
@@ -190,19 +189,19 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
190
189
  editorView = _this$props4.editorView,
191
190
  insertColumnButtonIndex = _this$props4.insertColumnButtonIndex,
192
191
  editorAnalyticsAPI = _this$props4.editorAnalyticsAPI,
193
- getEditorFeatureFlags = _this$props4.getEditorFeatureFlags;
192
+ getEditorFeatureFlags = _this$props4.getEditorFeatureFlags,
193
+ isTableScalingEnabled = _this$props4.isTableScalingEnabled;
194
194
  if (typeof insertColumnButtonIndex !== 'undefined') {
195
195
  event.preventDefault();
196
- var _getPluginState = getPluginState(editorView.state),
197
- _getPluginState$isTab = _getPluginState.isTableScalingEnabled,
198
- isTableScalingEnabled = _getPluginState$isTab === void 0 ? false : _getPluginState$isTab;
199
- var shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
200
196
  var _ref = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
201
197
  _ref$tableDuplicateCe = _ref.tableDuplicateCellColouring,
202
- tableDuplicateCellColouring = _ref$tableDuplicateCe === void 0 ? false : _ref$tableDuplicateCe;
198
+ tableDuplicateCellColouring = _ref$tableDuplicateCe === void 0 ? false : _ref$tableDuplicateCe,
199
+ _ref$tableWithFixedCo = _ref.tableWithFixedColumnWidthsOption,
200
+ tableWithFixedColumnWidthsOption = _ref$tableWithFixedCo === void 0 ? false : _ref$tableWithFixedCo;
201
+ var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
203
202
  var state = editorView.state,
204
203
  dispatch = editorView.dispatch;
205
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
204
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
206
205
  }
207
206
  }
208
207
  }]);
@@ -72,7 +72,8 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
72
72
  var _tableMap$height, _tableMap$height2, _tableMap$width, _tableMap$width2;
73
73
  var isTableScalingEnabled = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
74
74
  var tableDuplicateCellColouring = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
75
- var shouldUseIncreasedScalingPercent = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
75
+ var isTableFixedColumnWidthsOptionEnabled = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
76
+ var shouldUseIncreasedScalingPercent = arguments.length > 14 && arguments[14] !== undefined ? arguments[14] : false;
76
77
  var addOptions = direction === 'row' ? [{
77
78
  label: 'above',
78
79
  offset: 0,
@@ -157,7 +158,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
157
158
  moveCursorToInsertedRow: true
158
159
  })(state, dispatch);
159
160
  } else {
160
- insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
161
+ insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
161
162
  }
162
163
  return true;
163
164
  },
@@ -170,7 +171,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
170
171
  onClick: function onClick(state, dispatch) {
171
172
  var selectionRect = getClosestSelectionRect(state);
172
173
  if (selectionRect) {
173
- var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
174
+ var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled);
174
175
  if (newResizeState) {
175
176
  distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, newResizeState)(state, dispatch);
176
177
  return true;
@@ -196,7 +197,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
196
197
  if (direction === 'row') {
197
198
  deleteRowsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect, !!isHeaderRowRequired)(state, dispatch);
198
199
  } else {
199
- deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
200
+ deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
200
201
  }
201
202
  return true;
202
203
  },
@@ -12,10 +12,11 @@ export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl,
12
12
  ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
13
13
  getIntl?: (() => IntlShape) | undefined;
14
14
  }) => Command;
15
- export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, ariaNotify, getIntl, }: {
15
+ export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, ariaNotify, getIntl, }: {
16
16
  stepSize: number;
17
17
  getEditorContainerWidth: GetEditorContainerWidth;
18
18
  isTableScalingEnabled: boolean;
19
+ isTableFixedColumnWidthsOptionEnabled: boolean;
19
20
  ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
20
21
  getIntl?: (() => IntlShape) | undefined;
21
22
  originalTr?: Transaction | undefined;
@@ -1,3 +1,3 @@
1
1
  import type { Command } from '@atlaskit/editor-common/types';
2
2
  import type { Rect } from '@atlaskit/editor-tables/table-map';
3
- export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
3
+ export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
@@ -3,10 +3,10 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
3
3
  import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
4
4
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
7
- export declare const addColumnBefore: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
8
- export declare const addColumnAfter: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
9
- export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
6
+ export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
7
+ export declare const addColumnBefore: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
8
+ export declare const addColumnAfter: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
9
+ export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
10
10
  export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
11
11
  export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null) => Command;
12
12
  export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
@@ -16,11 +16,11 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
16
16
  export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, targetCellPosition?: number, editorView?: EditorView | null) => Command;
17
17
  export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
18
18
  export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
19
- export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
20
- export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
19
+ export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
20
+ export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
21
21
  export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
22
- export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
23
- export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
22
+ export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
23
+ export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
24
24
  export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
25
25
  export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
26
26
  export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
@@ -12,7 +12,7 @@ export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) =>
12
12
  export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
13
13
  export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
14
14
  export declare function handleTripleClick(view: EditorView, pos: number): boolean;
15
- export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
15
+ export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
16
16
  export declare const isTableInFocus: (view: EditorView) => boolean;
17
17
  export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
18
18
  export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
@@ -28,10 +28,11 @@ type ResizableTableContainerProps = {
28
28
  tableWrapperHeight?: number;
29
29
  isWholeTableInDanger?: boolean;
30
30
  isTableScalingEnabled?: boolean;
31
+ isTableWithFixedColumnWidthsOptionEnabled?: boolean;
31
32
  isTableAlignmentEnabled?: boolean;
32
33
  shouldUseIncreasedScalingPercent?: boolean;
33
34
  };
34
- export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
35
+ export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
35
36
  type TableContainerProps = {
36
37
  node: PMNode;
37
38
  className: string;
@@ -46,8 +47,9 @@ type TableContainerProps = {
46
47
  isWholeTableInDanger?: boolean;
47
48
  isTableResizingEnabled: boolean | undefined;
48
49
  isTableScalingEnabled?: boolean;
50
+ isTableWithFixedColumnWidthsOptionEnabled?: boolean;
49
51
  isTableAlignmentEnabled?: boolean;
50
52
  shouldUseIncreasedScalingPercent?: boolean;
51
53
  };
52
- export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
54
+ export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
53
55
  export {};
@@ -20,6 +20,7 @@ interface TableResizerProps {
20
20
  displayGapCursor: (toggle: boolean) => boolean;
21
21
  pluginInjectionApi?: PluginInjectionAPI;
22
22
  isTableScalingEnabled?: boolean;
23
+ isTableWithFixedColumnWidthsOptionEnabled?: boolean;
23
24
  isTableAlignmentEnabled?: boolean;
24
25
  isWholeTableInDanger?: boolean;
25
26
  isFullWidthModeEnabled?: boolean;
@@ -29,5 +30,5 @@ export interface TableResizerImprovementProps extends TableResizerProps {
29
30
  onResizeStop?: () => void;
30
31
  onResizeStart?: () => void;
31
32
  }
32
- export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
33
+ export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
33
34
  export {};
@@ -16,6 +16,7 @@ export default class TableView extends ReactNodeView<Props> {
16
16
  eventDispatcher?: EventDispatcher;
17
17
  getPos: getPosHandlerNode;
18
18
  options: import("./types").TableOptions | undefined;
19
+ getEditorFeatureFlags: GetEditorFeatureFlags;
19
20
  constructor(props: Props);
20
21
  getContentDOM(): {
21
22
  dom: HTMLElement;
@@ -1,4 +1,4 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<import("./types").DragAndDropPluginState>;
4
+ export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
@@ -3,5 +3,5 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
3
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
5
5
  import type { PluginInjectionAPIWithA11y } from '../types';
6
- export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
6
+ export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
7
7
  export default keymapPlugin;
@@ -27,4 +27,4 @@ export declare const normaliseTableLayout: (input: string | undefined | null) =>
27
27
  export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
28
28
  node: Node;
29
29
  offset: number;
30
- }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
30
+ }, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => ResizeStateWithAnalytics | undefined;