@atlaskit/editor-plugin-table 17.0.0 → 17.1.0

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 (57) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/nodeviews/TableComponent.js +45 -47
  3. package/dist/cjs/nodeviews/TableComponentWithSharedState.js +3 -1
  4. package/dist/cjs/nodeviews/TableContainer.js +4 -4
  5. package/dist/cjs/nodeviews/TableResizer.js +3 -3
  6. package/dist/cjs/nodeviews/table-node-views.js +1 -1
  7. package/dist/cjs/nodeviews/table.js +15 -10
  8. package/dist/cjs/pm-plugins/commands/misc.js +10 -4
  9. package/dist/cjs/pm-plugins/main.js +3 -2
  10. package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +2 -2
  11. package/dist/cjs/tablePlugin.js +3 -3
  12. package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +2 -0
  13. package/dist/es2019/nodeviews/TableComponent.js +8 -10
  14. package/dist/es2019/nodeviews/TableComponentWithSharedState.js +3 -1
  15. package/dist/es2019/nodeviews/TableContainer.js +4 -4
  16. package/dist/es2019/nodeviews/TableResizer.js +3 -3
  17. package/dist/es2019/nodeviews/table-node-views.js +1 -1
  18. package/dist/es2019/nodeviews/table.js +13 -9
  19. package/dist/es2019/pm-plugins/commands/misc.js +10 -4
  20. package/dist/es2019/pm-plugins/main.js +3 -2
  21. package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +2 -2
  22. package/dist/es2019/tablePlugin.js +3 -3
  23. package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +2 -0
  24. package/dist/esm/nodeviews/TableComponent.js +45 -47
  25. package/dist/esm/nodeviews/TableComponentWithSharedState.js +3 -1
  26. package/dist/esm/nodeviews/TableContainer.js +4 -4
  27. package/dist/esm/nodeviews/TableResizer.js +3 -3
  28. package/dist/esm/nodeviews/table-node-views.js +1 -1
  29. package/dist/esm/nodeviews/table.js +15 -10
  30. package/dist/esm/pm-plugins/commands/misc.js +10 -4
  31. package/dist/esm/pm-plugins/main.js +3 -2
  32. package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +2 -2
  33. package/dist/esm/tablePlugin.js +3 -3
  34. package/dist/esm/ui/FloatingDragMenu/DragMenu.js +2 -0
  35. package/dist/types/nodeviews/TableComponent.d.ts +1 -0
  36. package/dist/types/nodeviews/TableComponentWithSharedState.d.ts +2 -1
  37. package/dist/types/nodeviews/TableContainer.d.ts +4 -4
  38. package/dist/types/nodeviews/TableResizer.d.ts +2 -2
  39. package/dist/types/nodeviews/table-node-views.d.ts +1 -0
  40. package/dist/types/nodeviews/table.d.ts +1 -1
  41. package/dist/types/nodeviews/types.d.ts +1 -0
  42. package/dist/types/pm-plugins/main.d.ts +1 -1
  43. package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  44. package/dist/types/tablePluginType.d.ts +6 -0
  45. package/dist/types/types/index.d.ts +1 -0
  46. package/dist/types-ts4.5/nodeviews/TableComponent.d.ts +1 -0
  47. package/dist/types-ts4.5/nodeviews/TableComponentWithSharedState.d.ts +2 -1
  48. package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -4
  49. package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -2
  50. package/dist/types-ts4.5/nodeviews/table-node-views.d.ts +1 -0
  51. package/dist/types-ts4.5/nodeviews/table.d.ts +1 -1
  52. package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
  53. package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
  54. package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
  55. package/dist/types-ts4.5/tablePluginType.d.ts +6 -0
  56. package/dist/types-ts4.5/types/index.d.ts +1 -0
  57. package/package.json +6 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 17.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a218bead9e6a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a218bead9e6a7) -
8
+ EDITOR-4542 Make isTableWithFixedColumnWidthsOptionEnabled an editor prop instead of using FG
9
+ value
10
+
11
+ ## 17.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`2bd7dcf49bbf2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bd7dcf49bbf2) -
16
+ [ux] [EDITOR-4452] remove the selection change after setting the background color on multiple
17
+ table cells behind platform_editor_table_cell_colour_change
18
+ - Updated dependencies
19
+
3
20
  ## 17.0.0
4
21
 
5
22
  ### Major Changes
@@ -24,6 +24,7 @@ var _nodeWidth = require("@atlaskit/editor-common/node-width");
24
24
  var _utils = require("@atlaskit/editor-common/utils");
25
25
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
26
26
  var _utils2 = require("@atlaskit/editor-tables/utils");
27
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
28
  var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
28
29
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
29
30
  var _commands = require("../pm-plugins/commands");
@@ -607,7 +608,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
607
608
  var isFullWidthModeAndLineLengthChanged = this.updateColGroupFromFullWidthChange && isLineLengthChanged;
608
609
  var maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth && !(options !== null && options !== void 0 && options.isCommentEditor) || isNumberColumnChanged || isNumberOfColumnsChanged || this.state.windowResized;
609
610
  if (force || maybeScale || isFullWidthModeAndLineLengthChanged) {
610
- var _this$containerWidth2, _this$props$options3, _this$props$options4, _this$props$options5;
611
+ var _this$containerWidth2, _this$props0, _getEditorFeatureFlag, _this$props$options3, _this$props$options4, _this$props$options5;
611
612
  var isWidthChanged = ((_this$containerWidth2 = this.containerWidth) === null || _this$containerWidth2 === void 0 ? void 0 : _this$containerWidth2.width) !== containerWidthValue;
612
613
  var wasTableResized = (0, _colgroup.hasTableBeenResized)(this.node);
613
614
  var isTableResized = (0, _colgroup.hasTableBeenResized)(tableNode);
@@ -625,9 +626,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
625
626
  isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged,
626
627
  isTableResized: isTableResized
627
628
  });
628
- var _getEditorFeatureFlag = getEditorFeatureFlags(),
629
- _getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
630
- tableWithFixedColumnWidthsOption = _getEditorFeatureFlag2 === void 0 ? false : _getEditorFeatureFlag2;
629
+ var tableWithFixedColumnWidthsOption = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? (_this$props0 = this.props) === null || _this$props0 === void 0 ? void 0 : _this$props0.allowFixedColumnWidthOption : (_getEditorFeatureFlag = getEditorFeatureFlags()) === null || _getEditorFeatureFlag === void 0 ? void 0 : _getEditorFeatureFlag.tableWithFixedColumnWidthsOption) || false;
631
630
  var isTableScalingWithFixedColumnWidthsOptionEnabled = !!((_this$props$options3 = this.props.options) !== null && _this$props$options3 !== void 0 && _this$props$options3.isTableScalingEnabled) && tableWithFixedColumnWidthsOption;
632
631
  var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!((_this$props$options4 = this.props.options) !== null && _this$props$options4 !== void 0 && _this$props$options4.isTableScalingEnabled) && !!((_this$props$options5 = this.props.options) !== null && _this$props$options5 !== void 0 && _this$props$options5.isCommentEditor);
633
632
  if (force || !isResizing && shouldUpdateColgroup) {
@@ -692,22 +691,21 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
692
691
  }, {
693
692
  key: "componentDidUpdate",
694
693
  value: function componentDidUpdate(_, prevState) {
695
- var _this$props$options0, _this$props$options1;
696
- var _this$props0 = this.props,
697
- getNode = _this$props0.getNode,
698
- isMediaFullscreen = _this$props0.isMediaFullscreen,
699
- allowColumnResizing = _this$props0.allowColumnResizing,
700
- allowTableResizing = _this$props0.allowTableResizing,
701
- isResizing = _this$props0.isResizing,
702
- options = _this$props0.options,
703
- isTableScalingEnabled = _this$props0.isTableScalingEnabled,
704
- getPos = _this$props0.getPos,
705
- getEditorFeatureFlags = _this$props0.getEditorFeatureFlags;
694
+ var _getEditorFeatureFlag2, _this$props$options0, _this$props$options1;
695
+ var _this$props1 = this.props,
696
+ getNode = _this$props1.getNode,
697
+ isMediaFullscreen = _this$props1.isMediaFullscreen,
698
+ allowColumnResizing = _this$props1.allowColumnResizing,
699
+ allowTableResizing = _this$props1.allowTableResizing,
700
+ isResizing = _this$props1.isResizing,
701
+ options = _this$props1.options,
702
+ isTableScalingEnabled = _this$props1.isTableScalingEnabled,
703
+ getPos = _this$props1.getPos,
704
+ getEditorFeatureFlags = _this$props1.getEditorFeatureFlags,
705
+ allowFixedColumnWidthOption = _this$props1.allowFixedColumnWidthOption;
706
706
  var shouldScale = false;
707
707
  var shouldHandleColgroupUpdates = false;
708
- var _getEditorFeatureFlag3 = getEditorFeatureFlags(),
709
- _getEditorFeatureFlag4 = _getEditorFeatureFlag3.tableWithFixedColumnWidthsOption,
710
- tableWithFixedColumnWidthsOption = _getEditorFeatureFlag4 === void 0 ? false : _getEditorFeatureFlag4;
708
+ var tableWithFixedColumnWidthsOption = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? allowFixedColumnWidthOption : (_getEditorFeatureFlag2 = getEditorFeatureFlags()) === null || _getEditorFeatureFlag2 === void 0 ? void 0 : _getEditorFeatureFlag2.tableWithFixedColumnWidthsOption) || false;
711
709
  if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
712
710
  shouldScale = true;
713
711
  shouldHandleColgroupUpdates = true;
@@ -770,31 +768,31 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
770
768
  value: function render() {
771
769
  var _this5 = this,
772
770
  _this$props$options10;
773
- var _this$props1 = this.props,
774
- view = _this$props1.view,
775
- getNode = _this$props1.getNode,
776
- isResizing = _this$props1.isResizing,
777
- _this$props1$allowCon = _this$props1.allowControls,
778
- allowControls = _this$props1$allowCon === void 0 ? true : _this$props1$allowCon,
779
- isHeaderRowEnabled = _this$props1.isHeaderRowEnabled,
780
- ordering = _this$props1.ordering,
781
- isHeaderColumnEnabled = _this$props1.isHeaderColumnEnabled,
782
- tableActive = _this$props1.tableActive,
783
- containerWidth = _this$props1.containerWidth,
784
- options = _this$props1.options,
785
- getPos = _this$props1.getPos,
786
- pluginInjectionApi = _this$props1.pluginInjectionApi,
787
- isDragAndDropEnabled = _this$props1.isDragAndDropEnabled,
788
- getEditorFeatureFlags = _this$props1.getEditorFeatureFlags,
789
- isTableScalingEnabled = _this$props1.isTableScalingEnabled,
790
- allowTableResizing = _this$props1.allowTableResizing,
791
- allowTableAlignment = _this$props1.allowTableAlignment,
792
- selection = _this$props1.selection,
793
- isInDanger = _this$props1.isInDanger,
794
- hoveredRows = _this$props1.hoveredRows,
795
- hoveredCell = _this$props1.hoveredCell,
796
- isTableHovered = _this$props1.isTableHovered,
797
- isWholeTableInDanger = _this$props1.isWholeTableInDanger;
771
+ var _this$props10 = this.props,
772
+ view = _this$props10.view,
773
+ getNode = _this$props10.getNode,
774
+ isResizing = _this$props10.isResizing,
775
+ _this$props10$allowCo = _this$props10.allowControls,
776
+ allowControls = _this$props10$allowCo === void 0 ? true : _this$props10$allowCo,
777
+ isHeaderRowEnabled = _this$props10.isHeaderRowEnabled,
778
+ ordering = _this$props10.ordering,
779
+ isHeaderColumnEnabled = _this$props10.isHeaderColumnEnabled,
780
+ tableActive = _this$props10.tableActive,
781
+ containerWidth = _this$props10.containerWidth,
782
+ options = _this$props10.options,
783
+ getPos = _this$props10.getPos,
784
+ pluginInjectionApi = _this$props10.pluginInjectionApi,
785
+ isDragAndDropEnabled = _this$props10.isDragAndDropEnabled,
786
+ getEditorFeatureFlags = _this$props10.getEditorFeatureFlags,
787
+ isTableScalingEnabled = _this$props10.isTableScalingEnabled,
788
+ allowTableResizing = _this$props10.allowTableResizing,
789
+ allowTableAlignment = _this$props10.allowTableAlignment,
790
+ selection = _this$props10.selection,
791
+ isInDanger = _this$props10.isInDanger,
792
+ hoveredRows = _this$props10.hoveredRows,
793
+ hoveredCell = _this$props10.hoveredCell,
794
+ isTableHovered = _this$props10.isTableHovered,
795
+ isWholeTableInDanger = _this$props10.isWholeTableInDanger;
798
796
  var node = getNode();
799
797
  var tableRef = this.table || undefined;
800
798
  var headerRow = tableRef ? tableRef.querySelector('tr[data-header-row]') : undefined;
@@ -868,9 +866,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
868
866
  tablePos = undefined;
869
867
  }
870
868
  var isNested = (0, _nodes.isTableNested)(view.state, tablePos);
871
- var _getEditorFeatureFlag5 = getEditorFeatureFlags(),
872
- _getEditorFeatureFlag6 = _getEditorFeatureFlag5.tableWithFixedColumnWidthsOption,
873
- tableWithFixedColumnWidthsOption = _getEditorFeatureFlag6 === void 0 ? false : _getEditorFeatureFlag6;
869
+ var _getEditorFeatureFlag3 = getEditorFeatureFlags(),
870
+ _getEditorFeatureFlag4 = _getEditorFeatureFlag3.tableWithFixedColumnWidthsOption,
871
+ tableWithFixedColumnWidthsOption = _getEditorFeatureFlag4 === void 0 ? false : _getEditorFeatureFlag4;
874
872
  var shouldUseIncreasedScalingPercent = !!isTableScalingEnabled && (tableWithFixedColumnWidthsOption || !!((_this$props$options10 = this.props.options) !== null && _this$props$options10 !== void 0 && _this$props$options10.isCommentEditor));
875
873
  return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer
876
874
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -890,7 +888,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
890
888
  isTableResizingEnabled: allowTableResizing,
891
889
  isResizing: isResizing,
892
890
  isTableScalingEnabled: isTableScalingEnabled,
893
- isTableWithFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
891
+ allowFixedColumnWidthOption: tableWithFixedColumnWidthsOption,
894
892
  isWholeTableInDanger: isWholeTableInDanger,
895
893
  isTableAlignmentEnabled: allowTableAlignment,
896
894
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
@@ -28,7 +28,8 @@ var TableComponentWithSharedState = exports.TableComponentWithSharedState = func
28
28
  getPos = _ref.getPos,
29
29
  forwardRef = _ref.forwardRef,
30
30
  allowTableAlignment = _ref.allowTableAlignment,
31
- allowTableResizing = _ref.allowTableResizing;
31
+ allowTableResizing = _ref.allowTableResizing,
32
+ allowFixedColumnWidthOption = _ref.allowFixedColumnWidthOption;
32
33
  var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['table', 'width', 'media', 'selection', 'editorViewMode', 'interaction'], function (states) {
33
34
  var _states$tableState, _states$tableState2, _states$tableState3, _states$tableState4, _states$tableState5, _states$tableState6, _states$tableState7, _states$tableState8, _states$tableState9, _states$tableState0, _states$tableState1, _states$mediaState, _states$selectionStat, _states$editorViewMod, _states$widthState, _states$widthState2, _states$interactionSt;
34
35
  return {
@@ -104,6 +105,7 @@ var TableComponentWithSharedState = exports.TableComponentWithSharedState = func
104
105
  isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
105
106
  allowTableAlignment: allowTableAlignment,
106
107
  allowTableResizing: allowTableResizing,
108
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption,
107
109
  tableActive: tableActive && !isLivePageViewMode && interaction !== 'hasNotHadInteraction',
108
110
  ordering: ordering,
109
111
  isResizing: isResizing,
@@ -142,7 +142,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
142
142
  tableWrapperHeight = _ref4.tableWrapperHeight,
143
143
  isWholeTableInDanger = _ref4.isWholeTableInDanger,
144
144
  isTableScalingEnabled = _ref4.isTableScalingEnabled,
145
- isTableWithFixedColumnWidthsOptionEnabled = _ref4.isTableWithFixedColumnWidthsOptionEnabled,
145
+ allowFixedColumnWidthOption = _ref4.allowFixedColumnWidthOption,
146
146
  isTableAlignmentEnabled = _ref4.isTableAlignmentEnabled,
147
147
  shouldUseIncreasedScalingPercent = _ref4.shouldUseIncreasedScalingPercent,
148
148
  isCommentEditor = _ref4.isCommentEditor,
@@ -304,7 +304,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
304
304
  isTableAlignmentEnabled: isTableAlignmentEnabled,
305
305
  isFullWidthModeEnabled: isFullWidthModeEnabled,
306
306
  isTableScalingEnabled: isTableScalingEnabled,
307
- isTableWithFixedColumnWidthsOptionEnabled: isTableWithFixedColumnWidthsOptionEnabled,
307
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption,
308
308
  isWholeTableInDanger: isWholeTableInDanger,
309
309
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
310
310
  pluginInjectionApi: pluginInjectionApi,
@@ -357,7 +357,7 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref5) {
357
357
  isWholeTableInDanger = _ref5.isWholeTableInDanger,
358
358
  isTableResizingEnabled = _ref5.isTableResizingEnabled,
359
359
  isTableScalingEnabled = _ref5.isTableScalingEnabled,
360
- isTableWithFixedColumnWidthsOptionEnabled = _ref5.isTableWithFixedColumnWidthsOptionEnabled,
360
+ allowFixedColumnWidthOption = _ref5.allowFixedColumnWidthOption,
361
361
  isTableAlignmentEnabled = _ref5.isTableAlignmentEnabled,
362
362
  shouldUseIncreasedScalingPercent = _ref5.shouldUseIncreasedScalingPercent,
363
363
  isCommentEditor = _ref5.isCommentEditor,
@@ -383,7 +383,7 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref5) {
383
383
  isResizing: isResizing,
384
384
  pluginInjectionApi: pluginInjectionApi,
385
385
  isTableScalingEnabled: isTableScalingEnabled,
386
- isTableWithFixedColumnWidthsOptionEnabled: isTableWithFixedColumnWidthsOptionEnabled,
386
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption,
387
387
  isWholeTableInDanger: isWholeTableInDanger,
388
388
  isTableAlignmentEnabled: isTableAlignmentEnabled,
389
389
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
@@ -137,7 +137,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
137
137
  attachAnalyticsEvent = _ref.attachAnalyticsEvent,
138
138
  displayGapCursor = _ref.displayGapCursor,
139
139
  isTableScalingEnabled = _ref.isTableScalingEnabled,
140
- isTableWithFixedColumnWidthsOptionEnabled = _ref.isTableWithFixedColumnWidthsOptionEnabled,
140
+ allowFixedColumnWidthOption = _ref.allowFixedColumnWidthOption,
141
141
  isTableAlignmentEnabled = _ref.isTableAlignmentEnabled,
142
142
  isWholeTableInDanger = _ref.isWholeTableInDanger,
143
143
  shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
@@ -315,13 +315,13 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
315
315
  prevNode: node,
316
316
  start: pos + 1,
317
317
  parentWidth: previewParentWidth
318
- }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isCommentEditor);
318
+ }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, isCommentEditor);
319
319
  (0, _commands.chainCommands)(function (state, dispatch) {
320
320
  return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
321
321
  }, (0, _misc.updateWidthToWidest)((0, _defineProperty2.default)({}, currentTableNodeLocalId, shouldUpdateWidthToWidest)))(state, dispatch);
322
322
  updateWidth(shouldUpdateWidthToWidest ? tableMaxWidth : newWidth);
323
323
  return newWidth;
324
- }, [countFrames, isCommentEditor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
324
+ }, [countFrames, isCommentEditor, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
325
325
  var scheduleResize = (0, _react.useMemo)(function () {
326
326
  return (0, _rafSchd.default)(handleResize);
327
327
  }, [handleResize]);
@@ -15,7 +15,7 @@ var _TableRowNativeStickyWithFallback = _interopRequireDefault(require("./TableR
15
15
 
16
16
  var tableView = exports.tableView = function tableView(options) {
17
17
  return function (node, view, getPos) {
18
- return (0, _table.createTableView)(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor);
18
+ return (0, _table.createTableView)(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption);
19
19
  };
20
20
  };
21
21
  var tableCellView = exports.tableCellView = function tableCellView(options) {
@@ -19,6 +19,7 @@ var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/rea
19
19
  var _model = require("@atlaskit/editor-prosemirror/model");
20
20
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
21
  var _tableMap = require("@atlaskit/editor-tables/table-map");
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
23
  var _createPluginConfig = require("../pm-plugins/create-plugin-config");
23
24
  var _pluginFactory = require("../pm-plugins/plugin-factory");
24
25
  var _tableWidth = require("../pm-plugins/table-width");
@@ -97,11 +98,12 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
97
98
  }).toDOM(this.node);
98
99
  var rendered = _model.DOMSerializer.renderSpec(document, tableDOMStructure);
99
100
  if (rendered.dom) {
100
- var _this$options, _this$options2, _this$getEditorFeatur;
101
+ var _this$reactComponentP5, _this$getEditorFeatur, _this$options, _this$options2;
101
102
  var tableElement = rendered.dom.querySelector('table');
102
103
  this.table = tableElement ? tableElement : rendered.dom;
103
104
  this.renderedDOM = rendered.dom;
104
- if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && (_this$getEditorFeatur = this.getEditorFeatureFlags) !== null && _this$getEditorFeatur !== void 0 && _this$getEditorFeatur.call(this).tableWithFixedColumnWidthsOption && this.node.attrs.displayMode === 'fixed') {
105
+ var allowFixedColumnWidthOption = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? (_this$reactComponentP5 = this.reactComponentProps) === null || _this$reactComponentP5 === void 0 ? void 0 : _this$reactComponentP5.allowFixedColumnWidthOption : (_this$getEditorFeatur = this.getEditorFeatureFlags) === null || _this$getEditorFeatur === void 0 ? void 0 : _this$getEditorFeatur.call(this).tableWithFixedColumnWidthsOption) || false;
106
+ if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.isTableScalingEnabled) || (_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.isTableScalingEnabled && allowFixedColumnWidthOption && this.node.attrs.displayMode === 'fixed') {
105
107
  var tableInlineWidth = getInlineWidth(this.node, this.reactComponentProps.options, this.reactComponentProps.view.state, this.reactComponentProps.getPos(), this.reactComponentProps.allowTableResizing);
106
108
  if (tableInlineWidth) {
107
109
  handleInlineTableWidth(this.table, tableInlineWidth);
@@ -184,9 +186,10 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
184
186
  key: "setDomAttrs",
185
187
  value: function setDomAttrs(node) {
186
188
  var _this3 = this,
189
+ _this$reactComponentP6,
190
+ _this$getEditorFeatur2,
187
191
  _this$options3,
188
- _this$options4,
189
- _this$getEditorFeatur2;
192
+ _this$options4;
190
193
  if (!this.table) {
191
194
  return; // width / attribute application to actual table will happen later when table is set
192
195
  }
@@ -196,9 +199,9 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
196
199
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
197
200
  _this3.table.setAttribute(attr, attrs[attr]);
198
201
  });
199
-
202
+ var isTableFixedColumnWidthsOptionEnabled = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? (_this$reactComponentP6 = this.reactComponentProps) === null || _this$reactComponentP6 === void 0 ? void 0 : _this$reactComponentP6.allowFixedColumnWidthOption : (_this$getEditorFeatur2 = this.getEditorFeatureFlags) === null || _this$getEditorFeatur2 === void 0 ? void 0 : _this$getEditorFeatur2.call(this).tableWithFixedColumnWidthsOption) || false;
200
203
  // Preserve Table Width cannot have inline width set on the table
201
- if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && (_this$getEditorFeatur2 = this.getEditorFeatureFlags) !== null && _this$getEditorFeatur2 !== void 0 && _this$getEditorFeatur2.call(this).tableWithFixedColumnWidthsOption && node.attrs.displayMode === 'fixed') {
204
+ if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.isTableScalingEnabled) || (_this$options4 = this.options) !== null && _this$options4 !== void 0 && _this$options4.isTableScalingEnabled && isTableFixedColumnWidthsOptionEnabled && node.attrs.displayMode === 'fixed') {
202
205
  var _tableWidthPluginKey$;
203
206
  // handle inline style when table been resized
204
207
  var tableInlineWidth = getInlineWidth(node, this.reactComponentProps.options, this.view.state, this.getPos(), this.reactComponentProps.allowTableResizing);
@@ -224,7 +227,8 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
224
227
  allowControls: props.allowControls,
225
228
  getPos: props.getPos,
226
229
  getEditorFeatureFlags: props.getEditorFeatureFlags,
227
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
230
+ dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
231
+ allowFixedColumnWidthOption: props.allowFixedColumnWidthOption
228
232
  });
229
233
  }
230
234
  }, {
@@ -289,7 +293,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
289
293
  }
290
294
  }]);
291
295
  }(_reactNodeView.default);
292
- var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor) {
296
+ var createTableView = exports.createTableView = function createTableView(node, view, getPos, portalProviderAPI, eventDispatcher, getEditorContainerWidth, getEditorFeatureFlags, dispatchAnalyticsEvent, pluginInjectionApi, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) {
293
297
  var _pluginInjectionApi$t;
294
298
  var _getPluginState2 = (0, _pluginFactory.getPluginState)(view.state),
295
299
  pluginConfig = _getPluginState2.pluginConfig,
@@ -303,7 +307,7 @@ var createTableView = exports.createTableView = function createTableView(node, v
303
307
  allowControls = _getPluginConfig.allowControls,
304
308
  allowTableResizing = _getPluginConfig.allowTableResizing,
305
309
  allowTableAlignment = _getPluginConfig.allowTableAlignment;
306
- var isTableFixedColumnWidthsOptionEnabled = (getEditorFeatureFlags === null || getEditorFeatureFlags === void 0 ? void 0 : getEditorFeatureFlags().tableWithFixedColumnWidthsOption) || false;
310
+ var isTableFixedColumnWidthsOptionEnabled = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? allowFixedColumnWidthOption : getEditorFeatureFlags === null || getEditorFeatureFlags === void 0 ? void 0 : getEditorFeatureFlags().tableWithFixedColumnWidthsOption) || false;
307
311
  var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (isTableFixedColumnWidthsOptionEnabled || isCommentEditor);
308
312
  return new TableView({
309
313
  node: node,
@@ -328,6 +332,7 @@ var createTableView = exports.createTableView = function createTableView(node, v
328
332
  getEditorContainerWidth: getEditorContainerWidth,
329
333
  getEditorFeatureFlags: getEditorFeatureFlags,
330
334
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
331
- pluginInjectionApi: pluginInjectionApi
335
+ pluginInjectionApi: pluginInjectionApi,
336
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption
332
337
  }).init();
333
338
  };
@@ -14,6 +14,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
14
14
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
15
15
  var _tableMap = require("@atlaskit/editor-tables/table-map");
16
16
  var _utils2 = require("@atlaskit/editor-tables/utils");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
18
  var _types = require("../../types");
18
19
  var _plugin = require("../decorations/plugin");
19
20
  var _columnResizing = require("../decorations/utils/column-resizing");
@@ -224,7 +225,7 @@ var getTableElementMoveTypeBySlice = exports.getTableElementMoveTypeBySlice = fu
224
225
  var map = _tableMap.TableMap.get(currentTable.node);
225
226
  var slicedMap = _tableMap.TableMap.get(slice.content.firstChild);
226
227
  return map.width === slicedMap.width ? 'row' : map.height === slicedMap.height ? 'column' : undefined;
227
- } catch (e) {
228
+ } catch (_unused) {
228
229
  return undefined;
229
230
  }
230
231
  };
@@ -361,11 +362,16 @@ var setMultipleCellAttrs = exports.setMultipleCellAttrs = function setMultipleCe
361
362
  }
362
363
  if (tr.docChanged && cursorPos !== undefined) {
363
364
  if (dispatch) {
364
- if (cursorPos !== undefined) {
365
+ if ((0, _expValEquals.expValEquals)('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
365
366
  editorView === null || editorView === void 0 || editorView.focus();
366
- tr.setSelection(new _state.TextSelection(tr.doc.resolve(cursorPos)));
367
+ dispatch(tr);
368
+ } else {
369
+ if (cursorPos !== undefined) {
370
+ editorView === null || editorView === void 0 || editorView.focus();
371
+ tr.setSelection(new _state.TextSelection(tr.doc.resolve(cursorPos)));
372
+ }
373
+ dispatch(tr);
367
374
  }
368
- dispatch(tr);
369
375
  }
370
376
  return true;
371
377
  }
@@ -34,7 +34,7 @@ var _decoration = require("./utils/decoration");
34
34
  var _paste = require("./utils/paste");
35
35
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
36
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
37
- var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor) {
37
+ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, allowFixedColumnWidthOption) {
38
38
  var _accessibilityUtils;
39
39
  var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread(_objectSpread({
40
40
  pluginConfig: pluginConfig,
@@ -72,7 +72,8 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
72
72
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
73
73
  pluginInjectionApi: pluginInjectionApi,
74
74
  isCommentEditor: isCommentEditor,
75
- isChromelessEditor: isChromelessEditor
75
+ isChromelessEditor: isChromelessEditor,
76
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption
76
77
  }),
77
78
  tableRow: (0, _tableNodeViews.tableRowView)({
78
79
  eventDispatcher: eventDispatcher,
@@ -112,7 +112,7 @@ function scaleTableTo(state, maxSize) {
112
112
  }
113
113
  var previewScaleTable = exports.previewScaleTable = function previewScaleTable(tableRef, options, domAtPos) {
114
114
  var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
115
- var isTableWithFixedColumnWidthsOptionEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
115
+ var allowFixedColumnWidthOption = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
116
116
  var isCommentEditor = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
117
117
  var node = options.node,
118
118
  start = options.start,
@@ -126,7 +126,7 @@ var previewScaleTable = exports.previewScaleTable = function previewScaleTable(t
126
126
  tableRef.style.width = "".concat(width, "px");
127
127
  }
128
128
  var isTableScalingEnabledOnCurrentTable = isTableScalingEnabled;
129
- var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && isTableWithFixedColumnWidthsOptionEnabled;
129
+ var isTableScalingWithFixedColumnWidthsOptionEnabled = isTableScalingEnabled && allowFixedColumnWidthOption;
130
130
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
131
131
  isTableScalingEnabledOnCurrentTable = isTableScalingEnabled && node.attrs.displayMode !== 'fixed';
132
132
  }
@@ -85,7 +85,7 @@ var tablePlugin = function tablePlugin(_ref) {
85
85
  };
86
86
  };
87
87
  var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
88
- var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
88
+ var isTableFixedColumnWidthsOptionEnabled = (0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption : (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
89
89
  var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && (isTableFixedColumnWidthsOptionEnabled || ( // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
90
90
  options === null || options === void 0 ? void 0 : options.isCommentEditor));
91
91
  var isTableSelectorEnabled =
@@ -227,7 +227,7 @@ var tablePlugin = function tablePlugin(_ref) {
227
227
  allowColumnResizing = _pluginConfig.allowColumnResizing;
228
228
  // TODO: ED-25901 - We need to move this into a plugin config option so we don't accidentally enable nested nodes in Jira
229
229
  var isNestingSupported = Boolean(options === null || options === void 0 || (_options$tableOptions2 = options.tableOptions) === null || _options$tableOptions2 === void 0 ? void 0 : _options$tableOptions2.allowNestedTables);
230
- var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea3 = options.getEditorFeatureFlags) === null || _options$getEditorFea3 === void 0 ? void 0 : _options$getEditorFea3.call(options).tableWithFixedColumnWidthsOption) || false;
230
+ var isTableFixedColumnWidthsOptionEnabled = ((0, _platformFeatureFlags.fg)('platform_editor_table_fixed_column_width_prop') ? options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption : options === null || options === void 0 || (_options$getEditorFea3 = options.getEditorFeatureFlags) === null || _options$getEditorFea3 === void 0 ? void 0 : _options$getEditorFea3.call(options).tableWithFixedColumnWidthsOption) || false;
231
231
  var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && (isTableFixedColumnWidthsOptionEnabled || ( // When in comment editor, we need the scaling percent to be 40% while tableWithFixedColumnWidthsOption is not visible
232
232
  options === null || options === void 0 ? void 0 : options.isCommentEditor));
233
233
  var isTableScalingEnabled = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
@@ -296,7 +296,7 @@ var tablePlugin = function tablePlugin(_ref) {
296
296
  isTableScalingEnabled = _ref3.isTableScalingEnabled,
297
297
  isCommentEditor = _ref3.isCommentEditor,
298
298
  isChromelessEditor = _ref3.isChromelessEditor;
299
- return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor);
299
+ return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, nodeViewPortalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, shouldUseIncreasedScalingPercent, isCommentEditor, isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption);
300
300
  }
301
301
  }, {
302
302
  name: 'tablePMColResizing',
@@ -472,6 +472,8 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
472
472
  if (shouldCloseMenu(state)) {
473
473
  if (target && focusTarget === 'handle') {
474
474
  target === null || target === void 0 || target.focus();
475
+ } else if ((0, _expValEquals.expValEquals)('platform_editor_table_cell_colour_change', 'isEnabled', true)) {
476
+ editorView.focus();
475
477
  } else {
476
478
  editorView.dom.focus();
477
479
  }
@@ -11,6 +11,7 @@ import { getParentNodeWidth, getTableContainerWidth } from '@atlaskit/editor-com
11
11
  import { isValidPosition } from '@atlaskit/editor-common/utils';
12
12
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
13
13
  import { isTableSelected } from '@atlaskit/editor-tables/utils';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
15
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
17
  import { autoSizeTable, clearHoverSelection, setTableRef } from '../pm-plugins/commands';
@@ -568,7 +569,7 @@ class TableComponent extends React.Component {
568
569
  const isFullWidthModeAndLineLengthChanged = this.updateColGroupFromFullWidthChange && isLineLengthChanged;
569
570
  const maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth && !(options !== null && options !== void 0 && options.isCommentEditor) || isNumberColumnChanged || isNumberOfColumnsChanged || this.state.windowResized;
570
571
  if (force || maybeScale || isFullWidthModeAndLineLengthChanged) {
571
- var _this$containerWidth2, _this$props$options3, _this$props$options4, _this$props$options5;
572
+ var _this$containerWidth2, _this$props, _getEditorFeatureFlag, _this$props$options3, _this$props$options4, _this$props$options5;
572
573
  const isWidthChanged = ((_this$containerWidth2 = this.containerWidth) === null || _this$containerWidth2 === void 0 ? void 0 : _this$containerWidth2.width) !== containerWidthValue;
573
574
  const wasTableResized = hasTableBeenResized(this.node);
574
575
  const isTableResized = hasTableBeenResized(tableNode);
@@ -586,9 +587,7 @@ class TableComponent extends React.Component {
586
587
  isFullWidthModeAndLineLengthChanged,
587
588
  isTableResized
588
589
  });
589
- const {
590
- tableWithFixedColumnWidthsOption = false
591
- } = getEditorFeatureFlags();
590
+ const tableWithFixedColumnWidthsOption = (fg('platform_editor_table_fixed_column_width_prop') ? (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.allowFixedColumnWidthOption : (_getEditorFeatureFlag = getEditorFeatureFlags()) === null || _getEditorFeatureFlag === void 0 ? void 0 : _getEditorFeatureFlag.tableWithFixedColumnWidthsOption) || false;
592
591
  const isTableScalingWithFixedColumnWidthsOptionEnabled = !!((_this$props$options3 = this.props.options) !== null && _this$props$options3 !== void 0 && _this$props$options3.isTableScalingEnabled) && tableWithFixedColumnWidthsOption;
593
592
  const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!((_this$props$options4 = this.props.options) !== null && _this$props$options4 !== void 0 && _this$props$options4.isTableScalingEnabled) && !!((_this$props$options5 = this.props.options) !== null && _this$props$options5 !== void 0 && _this$props$options5.isCommentEditor);
594
593
  if (force || !isResizing && shouldUpdateColgroup) {
@@ -651,7 +650,7 @@ class TableComponent extends React.Component {
651
650
  // Ignored via go/ees005
652
651
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
653
652
  componentDidUpdate(_, prevState) {
654
- var _this$props$options10, _this$props$options11;
653
+ var _getEditorFeatureFlag2, _this$props$options10, _this$props$options11;
655
654
  const {
656
655
  getNode,
657
656
  isMediaFullscreen,
@@ -662,13 +661,12 @@ class TableComponent extends React.Component {
662
661
  isTableScalingEnabled,
663
662
  // we could use options.isTableScalingEnabled here
664
663
  getPos,
665
- getEditorFeatureFlags
664
+ getEditorFeatureFlags,
665
+ allowFixedColumnWidthOption
666
666
  } = this.props;
667
667
  let shouldScale = false;
668
668
  let shouldHandleColgroupUpdates = false;
669
- const {
670
- tableWithFixedColumnWidthsOption = false
671
- } = getEditorFeatureFlags();
669
+ const tableWithFixedColumnWidthsOption = (fg('platform_editor_table_fixed_column_width_prop') ? allowFixedColumnWidthOption : (_getEditorFeatureFlag2 = getEditorFeatureFlags()) === null || _getEditorFeatureFlag2 === void 0 ? void 0 : _getEditorFeatureFlag2.tableWithFixedColumnWidthsOption) || false;
672
670
  if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
673
671
  shouldScale = true;
674
672
  shouldHandleColgroupUpdates = true;
@@ -855,7 +853,7 @@ class TableComponent extends React.Component {
855
853
  isTableResizingEnabled: allowTableResizing,
856
854
  isResizing: isResizing,
857
855
  isTableScalingEnabled: isTableScalingEnabled,
858
- isTableWithFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
856
+ allowFixedColumnWidthOption: tableWithFixedColumnWidthsOption,
859
857
  isWholeTableInDanger: isWholeTableInDanger,
860
858
  isTableAlignmentEnabled: allowTableAlignment,
861
859
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
@@ -22,7 +22,8 @@ export const TableComponentWithSharedState = ({
22
22
  getPos,
23
23
  forwardRef,
24
24
  allowTableAlignment,
25
- allowTableResizing
25
+ allowTableResizing,
26
+ allowFixedColumnWidthOption
26
27
  }) => {
27
28
  const {
28
29
  isTableResizing,
@@ -100,6 +101,7 @@ export const TableComponentWithSharedState = ({
100
101
  isTableScalingEnabled: options === null || options === void 0 ? void 0 : options.isTableScalingEnabled,
101
102
  allowTableAlignment: allowTableAlignment,
102
103
  allowTableResizing: allowTableResizing,
104
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption,
103
105
  tableActive: tableActive && !isLivePageViewMode && interaction !== 'hasNotHadInteraction',
104
106
  ordering: ordering,
105
107
  isResizing: isResizing,
@@ -136,7 +136,7 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
136
136
  tableWrapperHeight,
137
137
  isWholeTableInDanger,
138
138
  isTableScalingEnabled,
139
- isTableWithFixedColumnWidthsOptionEnabled,
139
+ allowFixedColumnWidthOption,
140
140
  isTableAlignmentEnabled,
141
141
  shouldUseIncreasedScalingPercent,
142
142
  isCommentEditor,
@@ -298,7 +298,7 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
298
298
  isTableAlignmentEnabled,
299
299
  isFullWidthModeEnabled,
300
300
  isTableScalingEnabled,
301
- isTableWithFixedColumnWidthsOptionEnabled,
301
+ allowFixedColumnWidthOption,
302
302
  isWholeTableInDanger,
303
303
  shouldUseIncreasedScalingPercent,
304
304
  pluginInjectionApi,
@@ -352,7 +352,7 @@ export const TableContainer = ({
352
352
  isWholeTableInDanger,
353
353
  isTableResizingEnabled,
354
354
  isTableScalingEnabled,
355
- isTableWithFixedColumnWidthsOptionEnabled,
355
+ allowFixedColumnWidthOption,
356
356
  isTableAlignmentEnabled,
357
357
  shouldUseIncreasedScalingPercent,
358
358
  isCommentEditor,
@@ -379,7 +379,7 @@ export const TableContainer = ({
379
379
  isResizing: isResizing,
380
380
  pluginInjectionApi: pluginInjectionApi,
381
381
  isTableScalingEnabled: isTableScalingEnabled,
382
- isTableWithFixedColumnWidthsOptionEnabled: isTableWithFixedColumnWidthsOptionEnabled,
382
+ allowFixedColumnWidthOption: allowFixedColumnWidthOption,
383
383
  isWholeTableInDanger: isWholeTableInDanger,
384
384
  isTableAlignmentEnabled: isTableAlignmentEnabled,
385
385
  shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
@@ -123,7 +123,7 @@ export const TableResizer = ({
123
123
  attachAnalyticsEvent,
124
124
  displayGapCursor,
125
125
  isTableScalingEnabled,
126
- isTableWithFixedColumnWidthsOptionEnabled,
126
+ allowFixedColumnWidthOption,
127
127
  isTableAlignmentEnabled,
128
128
  isWholeTableInDanger,
129
129
  shouldUseIncreasedScalingPercent,
@@ -308,7 +308,7 @@ export const TableResizer = ({
308
308
  prevNode: node,
309
309
  start: pos + 1,
310
310
  parentWidth: previewParentWidth
311
- }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isCommentEditor);
311
+ }, editorView.domAtPos.bind(editorView), isTableScalingEnabled, allowFixedColumnWidthOption, isCommentEditor);
312
312
  chainCommands((state, dispatch) => {
313
313
  return switchToCenterAlignment(pos, node, newWidth, state, dispatch);
314
314
  }, updateWidthToWidest({
@@ -316,7 +316,7 @@ export const TableResizer = ({
316
316
  }))(state, dispatch);
317
317
  updateWidth(shouldUpdateWidthToWidest ? tableMaxWidth : newWidth);
318
318
  return newWidth;
319
- }, [countFrames, isCommentEditor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
319
+ }, [countFrames, isCommentEditor, isTableScalingEnabled, allowFixedColumnWidthOption, isFullWidthModeEnabled, excludeGuidelineConfig, tableRef, node, editorView, updateActiveGuidelines, containerWidth, lineLength, updateWidth, getPos, switchToCenterAlignment]);
320
320
  const scheduleResize = useMemo(() => rafSchd(handleResize), [handleResize]);
321
321
  const handleResizeStop = useCallback((originalState, delta) => {
322
322
  var _node$attrs$localId2, _node$attrs2;
@@ -7,7 +7,7 @@ import TableRow from './TableRow';
7
7
  import TableRowNativeStickyWithFallback from './TableRowNativeStickyWithFallback';
8
8
  export const tableView = options => {
9
9
  return (node, view, getPos) => {
10
- return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor);
10
+ return createTableView(node, view, getPos, options.portalProviderAPI, options.eventDispatcher, options.getEditorContainerWidth, options.getEditorFeatureFlags, options.dispatchAnalyticsEvent, options.pluginInjectionApi, options.isCommentEditor, options.isChromelessEditor, options === null || options === void 0 ? void 0 : options.allowFixedColumnWidthOption);
11
11
  };
12
12
  };
13
13
  export const tableCellView = options => {