@atlaskit/editor-plugin-table 24.5.0 → 24.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 24.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3b0816741523c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b0816741523c) -
8
+ Add lime, orange, and magenta colors to table cell background color palette
9
+ - Updated dependencies
10
+
3
11
  ## 24.5.0
4
12
 
5
13
  ### Minor Changes
@@ -6,12 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.wrapTableInExpandWithAnalytics = exports.toggleNumberColumnWithAnalytics = exports.toggleHeaderRowWithAnalytics = exports.toggleHeaderColumnWithAnalytics = exports.toggleFixedColumnWidthsOptionAnalytics = exports.splitCellWithAnalytics = exports.sortColumnWithAnalytics = exports.setTableAlignmentWithTableContentWithPosWithAnalytics = exports.setTableAlignmentWithAnalytics = exports.setColorWithAnalytics = exports.setCellVerticalAlignmentWithAnalytics = exports.mergeCellsWithAnalytics = exports.insertRowWithAnalytics = exports.insertColumnWithAnalytics = exports.emptyMultipleCellsWithAnalytics = exports.distributeColumnsWidthsWithAnalytics = exports.deleteTableWithAnalytics = exports.deleteTableIfSelectedWithAnalytics = exports.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = exports.deleteRowsWithAnalytics = exports.deleteColumnsWithAnalytics = exports.changeColumnWidthByStepWithAnalytics = exports.addRowAroundSelection = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _adfSchema = require("@atlaskit/adf-schema");
9
+ var _tableNodes = require("@atlaskit/adf-schema/tableNodes");
10
10
  var _analytics = require("@atlaskit/editor-common/analytics");
11
11
  var _preset = require("@atlaskit/editor-common/preset");
12
12
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
13
13
  var _tableMap = require("@atlaskit/editor-tables/table-map");
14
14
  var _utils = require("@atlaskit/editor-tables/utils");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
17
  var _pluginFactory = require("../plugin-factory");
16
18
  var _commands = require("../table-resizing/commands");
17
19
  var _deleteRows = require("../transforms/delete-rows");
@@ -134,7 +136,7 @@ var setColorWithAnalytics = exports.setColorWithAnalytics = function setColorWit
134
136
  actionSubjectId: null,
135
137
  attributes: {
136
138
  inputMethod: inputMethod,
137
- cellColor: (_adfSchema.tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
139
+ cellColor: (((0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_lovability_text_bg_color_patch_2') ? _tableNodes.tableBackgroundColorPaletteNew : _tableNodes.tableBackgroundColorPalette).get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
138
140
  horizontalCells: horizontalCells,
139
141
  verticalCells: verticalCells,
140
142
  totalCells: totalCells,
@@ -38,6 +38,7 @@ var _tableColumnDelete = _interopRequireDefault(require("@atlaskit/icon/core/tab
38
38
  var _tableColumnsDistribute = _interopRequireDefault(require("@atlaskit/icon/core/table-columns-distribute"));
39
39
  var _tableRowAddBelow = _interopRequireDefault(require("@atlaskit/icon/core/table-row-add-below"));
40
40
  var _tableRowDelete = _interopRequireDefault(require("@atlaskit/icon/core/table-row-delete"));
41
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
41
42
  var _primitives = require("@atlaskit/primitives");
42
43
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
43
44
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
@@ -133,10 +134,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
133
134
  var _node$attrs, _node$attrs2;
134
135
  var node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
135
136
  var background = (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
136
- var selectedRowAndColumnFromPalette = (0, _uiColor.getSelectedRowAndColumnFromPalette)(_uiColor.cellBackgroundColorPalette,
137
+ var isMoreColorsEnabled = (0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_lovability_text_bg_color_patch_2');
138
+ var activePalette = isMoreColorsEnabled ? _uiColor.cellBackgroundColorPaletteNew : _uiColor.cellBackgroundColorPalette;
139
+ var activeCols = isMoreColorsEnabled ? _consts.colorPaletteColumns : _consts.colorPaletteColumnsOld;
140
+ var selectedRowAndColumnFromPalette = (0, _uiColor.getSelectedRowAndColumnFromPalette)(activePalette,
137
141
  // Ignored via go/ees005
138
142
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
139
- background, _consts.colorPalletteColumns);
143
+ background, activeCols);
140
144
  var selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
141
145
  var selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
142
146
  return {
@@ -188,13 +192,13 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
188
192
  ,
189
193
  isOpenedByKeyboard: isCellMenuOpenByKeyboard
190
194
  }, (0, _react2.jsx)(_uiColor.ColorPalette, {
191
- cols: 7,
195
+ cols: activeCols,
192
196
  onClick: _this.setColor,
193
197
  selectedColor: (node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.background) || '#ffffff'
194
198
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
195
199
  ,
196
200
  paletteOptions: {
197
- palette: _uiColor.cellBackgroundColorPalette,
201
+ palette: activePalette,
198
202
  paletteColorTooltipMessages: _uiColor.backgroundPaletteTooltipMessages,
199
203
  hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
200
204
  }
@@ -23,7 +23,9 @@ var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
23
23
  var _tableMap = require("@atlaskit/editor-tables/table-map");
24
24
  var _utils2 = require("@atlaskit/editor-tables/utils");
25
25
  var _paintBucket = _interopRequireDefault(require("@atlaskit/icon/core/paint-bucket"));
26
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
27
  var _primitives = require("@atlaskit/primitives");
28
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
27
29
  var _toggle = _interopRequireDefault(require("@atlaskit/toggle"));
28
30
  var _commands = require("../../pm-plugins/commands");
29
31
  var _commandsWithAnalytics = require("../../pm-plugins/commands/commands-with-analytics");
@@ -282,7 +284,10 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
282
284
  targetCellPosition = _getTablePluginState.targetCellPosition;
283
285
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
284
286
  var background = (0, _editorPalette.hexToEditorBackgroundPaletteColor)((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
285
- var _getSelectedRowAndCol = (0, _uiColor.getSelectedRowAndColumnFromPalette)(_uiColor.cellBackgroundColorPalette, background, _consts.colorPalletteColumns),
287
+ var isMoreColorsEnabled = (0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_lovability_text_bg_color_patch_2');
288
+ var activePalette = isMoreColorsEnabled ? _uiColor.cellBackgroundColorPaletteNew : _uiColor.cellBackgroundColorPalette;
289
+ var activeCols = isMoreColorsEnabled ? _consts.colorPaletteColumns : _consts.colorPaletteColumnsOld;
290
+ var _getSelectedRowAndCol = (0, _uiColor.getSelectedRowAndColumnFromPalette)(activePalette, background, activeCols),
286
291
  selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
287
292
  selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
288
293
  return {
@@ -335,7 +340,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
335
340
  isPopupPositioned: true,
336
341
  isOpenedByKeyboard: isKeyboardModeActive
337
342
  }, (0, _react2.jsx)(_uiColor.ColorPalette, {
338
- cols: _consts.colorPalletteColumns
343
+ cols: activeCols
339
344
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
340
345
  ,
341
346
  onClick: function onClick(color) {
@@ -345,7 +350,7 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
345
350
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
346
351
  ,
347
352
  paletteOptions: {
348
- palette: _uiColor.cellBackgroundColorPalette,
353
+ palette: activePalette,
349
354
  paletteColorTooltipMessages: _uiColor.backgroundPaletteTooltipMessages,
350
355
  hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
351
356
  }
@@ -15,13 +15,15 @@ var _messages = require("@atlaskit/editor-common/messages");
15
15
  var _uiColor = require("@atlaskit/editor-common/ui-color");
16
16
  var _editorPalette = require("@atlaskit/editor-palette");
17
17
  var _editorToolbar = require("@atlaskit/editor-toolbar");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _compiled = require("@atlaskit/primitives/compiled");
20
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
21
  var _commands = require("../../../../pm-plugins/commands");
20
22
  var _commandsWithAnalytics = require("../../../../pm-plugins/commands/commands-with-analytics");
21
23
  var _pluginFactory = require("../../../../pm-plugins/plugin-factory");
24
+ var _consts = require("../../../../ui/consts");
22
25
  var _TableMenuContext = require("../TableMenuContext");
23
26
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
24
- var colorPaletteColumns = 7;
25
27
  var colorPaletteStyles = {
26
28
  container: "_1rjcu2gc",
27
29
  elemAfter: "_zulp1b66 _1e0c1txw _4cvr1h6o",
@@ -59,13 +61,16 @@ var BackgroundColorItem = exports.BackgroundColorItem = function BackgroundColor
59
61
  backgroundColor: selectedColor
60
62
  };
61
63
  }, [selectedColor]);
64
+ var isMoreColorsEnabled = (0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_lovability_text_bg_color_patch_2');
65
+ var activePalette = isMoreColorsEnabled ? _uiColor.cellBackgroundColorPaletteNew : _uiColor.cellBackgroundColorPalette;
66
+ var activeCols = isMoreColorsEnabled ? _consts.colorPaletteColumns : _consts.colorPaletteColumnsOld;
62
67
  var paletteOptions = (0, _react.useMemo)(function () {
63
68
  return {
64
- palette: _uiColor.cellBackgroundColorPalette,
69
+ palette: activePalette,
65
70
  paletteColorTooltipMessages: _uiColor.backgroundPaletteTooltipMessages,
66
71
  hexToPaletteColor: _editorPalette.hexToEditorBackgroundPaletteColor
67
72
  };
68
- }, []);
73
+ }, [activePalette]);
69
74
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarNestedDropdownMenu, {
70
75
  elemBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.PaintBucketIcon, {
71
76
  color: "currentColor",
@@ -85,7 +90,7 @@ var BackgroundColorItem = exports.BackgroundColorItem = function BackgroundColor
85
90
  }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
86
91
  xcss: colorPaletteStyles.container
87
92
  }, /*#__PURE__*/_react.default.createElement(_uiColor.ColorPalette, {
88
- cols: colorPaletteColumns,
93
+ cols: activeCols,
89
94
  onClick: onClick,
90
95
  selectedColor: colorPreviewStyle.backgroundColor,
91
96
  paletteOptions: paletteOptions
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tableResizerWidth = exports.tablePopupMenuFitHeight = exports.tablePadding = exports.tableOverflowShadowWidthWide = exports.tableOverflowShadowWidth = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableHeaderCellSelectedColor = exports.tableHeaderCellBackgroundColor = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableColumnControlsHeight = exports.tableCellSelectedDeleteIconColor = exports.tableCellSelectedDeleteIconBackground = exports.tableCellSelectedColor = exports.tableCellHoverDeleteIconColor = exports.tableCellHoverDeleteIconBackground = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.rowControlsZIndex = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.nativeStickyHeaderZIndex = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.insertLineWidth = exports.dropTargetsZIndex = exports.dropTargetExtendedWidth = exports.dragTableInsertColumnButtonSize = exports.dragRowControlsWidth = exports.dragMenuDropdownWidth = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidthDnD = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.colorPalletteColumns = exports.belowNativeStickyHeaderZIndex = exports.aboveNativeStickyHeaderZIndex = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_GAP = exports.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = exports.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT = exports.TABLE_DRAG_MENU_PADDING_TOP = exports.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT = exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = void 0;
6
+ exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tableResizerWidth = exports.tablePopupMenuFitHeight = exports.tablePadding = exports.tableOverflowShadowWidthWide = exports.tableOverflowShadowWidth = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableHeaderCellSelectedColor = exports.tableHeaderCellBackgroundColor = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableColumnControlsHeight = exports.tableCellSelectedDeleteIconColor = exports.tableCellSelectedDeleteIconBackground = exports.tableCellSelectedColor = exports.tableCellHoverDeleteIconColor = exports.tableCellHoverDeleteIconBackground = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.rowControlsZIndex = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.nativeStickyHeaderZIndex = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.insertLineWidth = exports.dropTargetsZIndex = exports.dropTargetExtendedWidth = exports.dragTableInsertColumnButtonSize = exports.dragRowControlsWidth = exports.dragMenuDropdownWidth = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidthDnD = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.colorPaletteColumnsOld = exports.colorPaletteColumns = exports.belowNativeStickyHeaderZIndex = exports.aboveNativeStickyHeaderZIndex = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_TOLERANCE = exports.TABLE_HIGHLIGHT_GAP = exports.TABLE_GUIDELINE_VISIBLE_ADJUSTMENT = exports.TABLE_DRAG_MENU_SORT_GROUP_HEIGHT = exports.TABLE_DRAG_MENU_PADDING_TOP = exports.TABLE_DRAG_MENU_MENU_GROUP_BEFORE_HEIGHT = exports.STICKY_HEADER_TOGGLE_TOLERANCE_MS = void 0;
7
7
  var _styles = require("@atlaskit/editor-common/styles");
8
8
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
9
9
  var _types = require("../types");
@@ -85,5 +85,6 @@ var dragMenuDropdownWidth = exports.dragMenuDropdownWidth = 250;
85
85
  var dragTableInsertColumnButtonSize = exports.dragTableInsertColumnButtonSize = 16;
86
86
  var dropTargetExtendedWidth = exports.dropTargetExtendedWidth = 150;
87
87
  var dragRowControlsWidth = exports.dragRowControlsWidth = 14;
88
- var colorPalletteColumns = exports.colorPalletteColumns = 7;
88
+ var colorPaletteColumnsOld = exports.colorPaletteColumnsOld = 7;
89
+ var colorPaletteColumns = exports.colorPaletteColumns = 10;
89
90
  var tableResizerWidth = exports.tableResizerWidth = 8;
@@ -35,6 +35,7 @@ var _customize = _interopRequireDefault(require("@atlaskit/icon/core/customize")
35
35
  var _delete = _interopRequireDefault(require("@atlaskit/icon/core/delete"));
36
36
  var _shrinkHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/shrink-horizontal"));
37
37
  var _tableColumnsDistribute = _interopRequireDefault(require("@atlaskit/icon/core/table-columns-distribute"));
38
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
38
39
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
39
40
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
40
41
  var _commands = require("../pm-plugins/commands");
@@ -53,6 +54,7 @@ var _table = require("../pm-plugins/utils/table");
53
54
  var _applyMeasuredWidthToSelectedTable = require("../pm-plugins/utils/tableMode/apply-measured-width-to-selected-table");
54
55
  var _isContentModeSupported = require("../pm-plugins/utils/tableMode/is-content-mode-supported");
55
56
  var _types = require("../types");
57
+ var _consts = require("./consts");
56
58
  var _FloatingAlignmentButtons = require("./FloatingAlignmentButtons/FloatingAlignmentButtons");
57
59
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
58
60
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -669,7 +671,9 @@ var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalytics
669
671
  }
670
672
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
671
673
  var currentBackground = (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
672
- var defaultPalette = _uiColor.cellBackgroundColorPalette.find(function (item) {
674
+ var isMoreColorsEnabled = (0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_lovability_text_bg_color_patch_2');
675
+ var activePalette = isMoreColorsEnabled ? _uiColor.cellBackgroundColorPaletteNew : _uiColor.cellBackgroundColorPalette;
676
+ var defaultPalette = activePalette.find(function (item) {
673
677
  return item.value === currentBackground;
674
678
  }) || {
675
679
  // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
@@ -683,8 +687,9 @@ var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalytics
683
687
  type: 'select',
684
688
  isAriaExpanded: true,
685
689
  selectType: 'color',
690
+ cols: isMoreColorsEnabled ? _consts.colorPaletteColumns : _consts.colorPaletteColumnsOld,
686
691
  defaultValue: defaultPalette,
687
- options: _uiColor.cellBackgroundColorPalette,
692
+ options: activePalette,
688
693
  returnEscToButton: true,
689
694
  // Ignored via go/ees005
690
695
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,9 +1,11 @@
1
- import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
1
+ import { tableBackgroundColorPalette, tableBackgroundColorPaletteNew } from '@atlaskit/adf-schema/tableNodes';
2
2
  import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_DISPLAY_MODE } from '@atlaskit/editor-common/analytics';
3
3
  import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
4
4
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
5
5
  import { TableMap } from '@atlaskit/editor-tables/table-map';
6
6
  import { findCellClosestToPos, findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
9
  import { getPluginState } from '../plugin-factory';
8
10
  import { distributeColumnsWidths } from '../table-resizing/commands';
9
11
  import { deleteRows } from '../transforms/delete-rows';
@@ -119,7 +121,7 @@ export const setColorWithAnalytics = editorAnalyticsAPI => (inputMethod, cellCol
119
121
  actionSubjectId: null,
120
122
  attributes: {
121
123
  inputMethod,
122
- cellColor: (tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
124
+ cellColor: ((expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2') ? tableBackgroundColorPaletteNew : tableBackgroundColorPalette).get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
123
125
  horizontalCells,
124
126
  verticalCells,
125
127
  totalCells,
@@ -16,7 +16,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
16
16
  import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
17
17
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
18
18
  import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
19
- import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
19
+ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, cellBackgroundColorPaletteNew, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
20
20
  import { ArrowKeyNavigationProvider, ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
21
21
  import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
22
22
  import { closestElement } from '@atlaskit/editor-common/utils';
@@ -32,6 +32,7 @@ import TableColumnDeleteIcon from '@atlaskit/icon/core/table-column-delete';
32
32
  import TableColumnsDistributeIcon from '@atlaskit/icon/core/table-columns-distribute';
33
33
  import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
34
34
  import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
35
+ import { fg } from '@atlaskit/platform-feature-flags';
35
36
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
36
37
  import { Box, xcss } from '@atlaskit/primitives';
37
38
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -45,7 +46,7 @@ import { canMergeCells } from '../../pm-plugins/transforms/merge';
45
46
  import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
46
47
  import { getMergedCellsPositions } from '../../pm-plugins/utils/table';
47
48
  import { TableCssClassName as ClassName } from '../../types';
48
- import { colorPalletteColumns, contextualMenuDropdownWidthDnD } from '../consts';
49
+ import { colorPaletteColumns, colorPaletteColumnsOld, contextualMenuDropdownWidthDnD } from '../consts';
49
50
  import { cellColourPreviewStyles } from './styles';
50
51
  const dropdownMenuSection = {
51
52
  hasSeparator: true
@@ -121,10 +122,13 @@ export class ContextualMenu extends Component {
121
122
  var _node$attrs, _node$attrs2;
122
123
  const node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
123
124
  const background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
124
- const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette,
125
+ const isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
126
+ const activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
127
+ const activeCols = isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld;
128
+ const selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(activePalette,
125
129
  // Ignored via go/ees005
126
130
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
127
- background, colorPalletteColumns);
131
+ background, activeCols);
128
132
  const selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
129
133
  const selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
130
134
  return {
@@ -176,13 +180,13 @@ export class ContextualMenu extends Component {
176
180
  ,
177
181
  isOpenedByKeyboard: isCellMenuOpenByKeyboard
178
182
  }, jsx(ColorPalette, {
179
- cols: 7,
183
+ cols: activeCols,
180
184
  onClick: this.setColor,
181
185
  selectedColor: (node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.background) || '#ffffff'
182
186
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
183
187
  ,
184
188
  paletteOptions: {
185
- palette: cellBackgroundColorPalette,
189
+ palette: activePalette,
186
190
  paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
187
191
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
188
192
  }
@@ -12,7 +12,7 @@ import { injectIntl } from 'react-intl';
12
12
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
13
13
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
14
14
  import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
15
- import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
15
+ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, cellBackgroundColorPaletteNew, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
16
16
  import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
17
17
  import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
18
18
  import { closestElement } from '@atlaskit/editor-common/utils';
@@ -21,8 +21,10 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
21
21
  import { TableMap } from '@atlaskit/editor-tables/table-map';
22
22
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
23
23
  import PaintBucketIcon from '@atlaskit/icon/core/paint-bucket';
24
+ import { fg } from '@atlaskit/platform-feature-flags';
24
25
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
25
26
  import { Box, xcss } from '@atlaskit/primitives';
27
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
26
28
  import Toggle from '@atlaskit/toggle';
27
29
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
28
30
  import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
@@ -33,7 +35,7 @@ import { getDragMenuConfig } from '../../pm-plugins/utils/drag-menu';
33
35
  import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
34
36
  import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
35
37
  import { TableCssClassName as ClassName } from '../../types';
36
- import { colorPalletteColumns } from '../consts';
38
+ import { colorPaletteColumns, colorPaletteColumnsOld } from '../consts';
37
39
  import { DropdownMenu } from './DropdownMenu';
38
40
  import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, toggleStyles } from './styles';
39
41
  const MapDragMenuOptionIdToMessage = {
@@ -275,10 +277,13 @@ const DragMenu = /*#__PURE__*/React.memo(({
275
277
  } = getTablePluginState(editorView.state);
276
278
  const node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
277
279
  const background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
280
+ const isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
281
+ const activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
282
+ const activeCols = isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld;
278
283
  const {
279
284
  selectedRowIndex,
280
285
  selectedColumnIndex
281
- } = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette, background, colorPalletteColumns);
286
+ } = getSelectedRowAndColumnFromPalette(activePalette, background, activeCols);
282
287
  return {
283
288
  key: 'background',
284
289
  content: formatMessage(messages.backgroundColor),
@@ -329,7 +334,7 @@ const DragMenu = /*#__PURE__*/React.memo(({
329
334
  isPopupPositioned: true,
330
335
  isOpenedByKeyboard: isKeyboardModeActive
331
336
  }, jsx(ColorPalette, {
332
- cols: colorPalletteColumns
337
+ cols: activeCols
333
338
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
334
339
  ,
335
340
  onClick: color => {
@@ -339,7 +344,7 @@ const DragMenu = /*#__PURE__*/React.memo(({
339
344
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
340
345
  ,
341
346
  paletteOptions: {
342
- palette: cellBackgroundColorPalette,
347
+ palette: activePalette,
343
348
  paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
344
349
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
345
350
  }
@@ -5,15 +5,17 @@ import React, { useCallback, useMemo } from 'react';
5
5
  import { useIntl } from 'react-intl';
6
6
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
7
7
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
8
- import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette } from '@atlaskit/editor-common/ui-color';
8
+ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, cellBackgroundColorPaletteNew, ColorPalette } from '@atlaskit/editor-common/ui-color';
9
9
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
10
10
  import { NestedDropdownRightIcon, PaintBucketIcon, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Box } from '@atlaskit/primitives/compiled';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
14
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
13
15
  import { setColorWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
14
16
  import { getPluginState } from '../../../../pm-plugins/plugin-factory';
17
+ import { colorPaletteColumns, colorPaletteColumnsOld } from '../../../../ui/consts';
15
18
  import { useTableMenuContext } from '../TableMenuContext';
16
- const colorPaletteColumns = 7;
17
19
  const colorPaletteStyles = {
18
20
  container: "_1rjcu2gc",
19
21
  elemAfter: "_zulp1b66 _1e0c1txw _4cvr1h6o",
@@ -53,13 +55,16 @@ export const BackgroundColorItem = ({
53
55
  const colorPreviewStyle = useMemo(() => ({
54
56
  backgroundColor: selectedColor
55
57
  }), [selectedColor]);
58
+ const isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
59
+ const activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
60
+ const activeCols = isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld;
56
61
  const paletteOptions = useMemo(() => {
57
62
  return {
58
- palette: cellBackgroundColorPalette,
63
+ palette: activePalette,
59
64
  paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
60
65
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
61
66
  };
62
- }, []);
67
+ }, [activePalette]);
63
68
  return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
64
69
  elemBefore: /*#__PURE__*/React.createElement(PaintBucketIcon, {
65
70
  color: "currentColor",
@@ -79,7 +84,7 @@ export const BackgroundColorItem = ({
79
84
  }, /*#__PURE__*/React.createElement(Box, {
80
85
  xcss: colorPaletteStyles.container
81
86
  }, /*#__PURE__*/React.createElement(ColorPalette, {
82
- cols: colorPaletteColumns,
87
+ cols: activeCols,
83
88
  onClick: onClick,
84
89
  selectedColor: colorPreviewStyle.backgroundColor,
85
90
  paletteOptions: paletteOptions
@@ -80,5 +80,6 @@ export const dragMenuDropdownWidth = 250;
80
80
  export const dragTableInsertColumnButtonSize = 16;
81
81
  export const dropTargetExtendedWidth = 150;
82
82
  export const dragRowControlsWidth = 14;
83
- export const colorPalletteColumns = 7;
83
+ export const colorPaletteColumnsOld = 7;
84
+ export const colorPaletteColumns = 10;
84
85
  export const tableResizerWidth = 8;
@@ -15,7 +15,7 @@ import commonMessages, { tableMessages as messages } from '@atlaskit/editor-comm
15
15
  import { isNestedTablesSupported, isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
16
16
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
17
17
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
18
- import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
18
+ import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette, cellBackgroundColorPaletteNew } from '@atlaskit/editor-common/ui-color';
19
19
  import { closestElement, getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
20
20
  import { findParentDomRefOfType } from '@atlaskit/editor-prosemirror/utils';
21
21
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
@@ -29,6 +29,7 @@ import CustomizeIcon from '@atlaskit/icon/core/customize';
29
29
  import DeleteIcon from '@atlaskit/icon/core/delete';
30
30
  import ShrinkHorizontalIcon from '@atlaskit/icon/core/shrink-horizontal';
31
31
  import TableColumnsDistributeIcon from '@atlaskit/icon/core/table-columns-distribute';
32
+ import { fg } from '@atlaskit/platform-feature-flags';
32
33
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
33
34
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
34
35
  import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from '../pm-plugins/commands';
@@ -47,6 +48,7 @@ import { getMergedCellsPositions } from '../pm-plugins/utils/table';
47
48
  import { applyMeasuredWidthToSelectedTable } from '../pm-plugins/utils/tableMode/apply-measured-width-to-selected-table';
48
49
  import { isContentModeSupported } from '../pm-plugins/utils/tableMode/is-content-mode-supported';
49
50
  import { TableCssClassName } from '../types';
51
+ import { colorPaletteColumns, colorPaletteColumnsOld } from './consts';
50
52
  import { FloatingAlignmentButtons } from './FloatingAlignmentButtons/FloatingAlignmentButtons';
51
53
  export const getToolbarMenuConfig = (config, state, {
52
54
  formatMessage
@@ -625,7 +627,9 @@ const getColorPicker = (state, menu, {
625
627
  }
626
628
  const node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
627
629
  const currentBackground = (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
628
- const defaultPalette = cellBackgroundColorPalette.find(item => item.value === currentBackground) || {
630
+ const isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
631
+ const activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
632
+ const defaultPalette = activePalette.find(item => item.value === currentBackground) || {
629
633
  // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
630
634
  label: 'Custom',
631
635
  value: currentBackground,
@@ -637,8 +641,9 @@ const getColorPicker = (state, menu, {
637
641
  type: 'select',
638
642
  isAriaExpanded: true,
639
643
  selectType: 'color',
644
+ cols: isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld,
640
645
  defaultValue: defaultPalette,
641
- options: cellBackgroundColorPalette,
646
+ options: activePalette,
642
647
  returnEscToButton: true,
643
648
  // Ignored via go/ees005
644
649
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1,12 +1,14 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  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; }
3
3
  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) { _defineProperty(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; }
4
- import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
4
+ import { tableBackgroundColorPalette, tableBackgroundColorPaletteNew } from '@atlaskit/adf-schema/tableNodes';
5
5
  import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_DISPLAY_MODE } from '@atlaskit/editor-common/analytics';
6
6
  import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
7
7
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
8
8
  import { TableMap } from '@atlaskit/editor-tables/table-map';
9
9
  import { findCellClosestToPos, findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
11
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
10
12
  import { getPluginState } from '../plugin-factory';
11
13
  import { distributeColumnsWidths } from '../table-resizing/commands';
12
14
  import { deleteRows } from '../transforms/delete-rows';
@@ -127,7 +129,7 @@ export var setColorWithAnalytics = function setColorWithAnalytics(editorAnalytic
127
129
  actionSubjectId: null,
128
130
  attributes: {
129
131
  inputMethod: inputMethod,
130
- cellColor: (tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
132
+ cellColor: ((expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2') ? tableBackgroundColorPaletteNew : tableBackgroundColorPalette).get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
131
133
  horizontalCells: horizontalCells,
132
134
  verticalCells: verticalCells,
133
135
  totalCells: totalCells,
@@ -26,7 +26,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
26
26
  import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
27
27
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
28
28
  import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
29
- import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
29
+ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, cellBackgroundColorPaletteNew, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
30
30
  import { ArrowKeyNavigationProvider, ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
31
31
  import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
32
32
  import { closestElement } from '@atlaskit/editor-common/utils';
@@ -42,6 +42,7 @@ import TableColumnDeleteIcon from '@atlaskit/icon/core/table-column-delete';
42
42
  import TableColumnsDistributeIcon from '@atlaskit/icon/core/table-columns-distribute';
43
43
  import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
44
44
  import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
45
+ import { fg } from '@atlaskit/platform-feature-flags';
45
46
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
46
47
  import { Box, xcss } from '@atlaskit/primitives';
47
48
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -55,7 +56,7 @@ import { canMergeCells } from '../../pm-plugins/transforms/merge';
55
56
  import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
56
57
  import { getMergedCellsPositions } from '../../pm-plugins/utils/table';
57
58
  import { TableCssClassName as ClassName } from '../../types';
58
- import { colorPalletteColumns, contextualMenuDropdownWidthDnD } from '../consts';
59
+ import { colorPaletteColumns, colorPaletteColumnsOld, contextualMenuDropdownWidthDnD } from '../consts';
59
60
  import { cellColourPreviewStyles } from './styles';
60
61
  var dropdownMenuSection = {
61
62
  hasSeparator: true
@@ -130,10 +131,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
130
131
  var _node$attrs, _node$attrs2;
131
132
  var node = isOpen && targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
132
133
  var background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
133
- var selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette,
134
+ var isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
135
+ var activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
136
+ var activeCols = isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld;
137
+ var selectedRowAndColumnFromPalette = getSelectedRowAndColumnFromPalette(activePalette,
134
138
  // Ignored via go/ees005
135
139
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
136
- background, colorPalletteColumns);
140
+ background, activeCols);
137
141
  var selectedRowIndex = selectedRowAndColumnFromPalette.selectedRowIndex;
138
142
  var selectedColumnIndex = selectedRowAndColumnFromPalette.selectedColumnIndex;
139
143
  return {
@@ -185,13 +189,13 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
185
189
  ,
186
190
  isOpenedByKeyboard: isCellMenuOpenByKeyboard
187
191
  }, jsx(ColorPalette, {
188
- cols: 7,
192
+ cols: activeCols,
189
193
  onClick: _this.setColor,
190
194
  selectedColor: (node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.background) || '#ffffff'
191
195
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
192
196
  ,
193
197
  paletteOptions: {
194
- palette: cellBackgroundColorPalette,
198
+ palette: activePalette,
195
199
  paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
196
200
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
197
201
  }
@@ -14,7 +14,7 @@ import { injectIntl } from 'react-intl';
14
14
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
15
15
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
16
16
  import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
17
- import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
17
+ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, cellBackgroundColorPaletteNew, ColorPalette, getSelectedRowAndColumnFromPalette } from '@atlaskit/editor-common/ui-color';
18
18
  import { ArrowKeyNavigationProvider, ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu';
19
19
  import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
20
20
  import { closestElement } from '@atlaskit/editor-common/utils';
@@ -23,8 +23,10 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
23
23
  import { TableMap } from '@atlaskit/editor-tables/table-map';
24
24
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
25
25
  import PaintBucketIcon from '@atlaskit/icon/core/paint-bucket';
26
+ import { fg } from '@atlaskit/platform-feature-flags';
26
27
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
27
28
  import { Box, xcss } from '@atlaskit/primitives';
29
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
28
30
  import Toggle from '@atlaskit/toggle';
29
31
  import { clearHoverSelection, hoverColumns, hoverRows } from '../../pm-plugins/commands';
30
32
  import { setColorWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
@@ -35,7 +37,7 @@ import { getDragMenuConfig } from '../../pm-plugins/utils/drag-menu';
35
37
  import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled } from '../../pm-plugins/utils/nodes';
36
38
  import { getSelectedColumnIndexes, getSelectedRowIndexes } from '../../pm-plugins/utils/selection';
37
39
  import { TableCssClassName as ClassName } from '../../types';
38
- import { colorPalletteColumns } from '../consts';
40
+ import { colorPaletteColumns, colorPaletteColumnsOld } from '../consts';
39
41
  import { DropdownMenu } from './DropdownMenu';
40
42
  import { cellColourPreviewStyles, dragMenuBackgroundColorStyles, toggleStyles } from './styles';
41
43
  var MapDragMenuOptionIdToMessage = {
@@ -271,7 +273,10 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
271
273
  targetCellPosition = _getTablePluginState.targetCellPosition;
272
274
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : null;
273
275
  var background = hexToEditorBackgroundPaletteColor((node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff');
274
- var _getSelectedRowAndCol = getSelectedRowAndColumnFromPalette(cellBackgroundColorPalette, background, colorPalletteColumns),
276
+ var isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
277
+ var activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
278
+ var activeCols = isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld;
279
+ var _getSelectedRowAndCol = getSelectedRowAndColumnFromPalette(activePalette, background, activeCols),
275
280
  selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
276
281
  selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
277
282
  return {
@@ -324,7 +329,7 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
324
329
  isPopupPositioned: true,
325
330
  isOpenedByKeyboard: isKeyboardModeActive
326
331
  }, jsx(ColorPalette, {
327
- cols: colorPalletteColumns
332
+ cols: activeCols
328
333
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
329
334
  ,
330
335
  onClick: function onClick(color) {
@@ -334,7 +339,7 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
334
339
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
335
340
  ,
336
341
  paletteOptions: {
337
- palette: cellBackgroundColorPalette,
342
+ palette: activePalette,
338
343
  paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
339
344
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
340
345
  }
@@ -5,15 +5,17 @@ import React, { useCallback, useMemo } from 'react';
5
5
  import { useIntl } from 'react-intl';
6
6
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
7
7
  import { tableMessages as messages } from '@atlaskit/editor-common/messages';
8
- import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette } from '@atlaskit/editor-common/ui-color';
8
+ import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, cellBackgroundColorPaletteNew, ColorPalette } from '@atlaskit/editor-common/ui-color';
9
9
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
10
10
  import { NestedDropdownRightIcon, PaintBucketIcon, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Box } from '@atlaskit/primitives/compiled';
13
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
14
  import { closeActiveTableMenu } from '../../../../pm-plugins/commands';
13
15
  import { setColorWithAnalytics } from '../../../../pm-plugins/commands/commands-with-analytics';
14
16
  import { getPluginState } from '../../../../pm-plugins/plugin-factory';
17
+ import { colorPaletteColumns, colorPaletteColumnsOld } from '../../../../ui/consts';
15
18
  import { useTableMenuContext } from '../TableMenuContext';
16
- var colorPaletteColumns = 7;
17
19
  var colorPaletteStyles = {
18
20
  container: "_1rjcu2gc",
19
21
  elemAfter: "_zulp1b66 _1e0c1txw _4cvr1h6o",
@@ -51,13 +53,16 @@ export var BackgroundColorItem = function BackgroundColorItem(_ref) {
51
53
  backgroundColor: selectedColor
52
54
  };
53
55
  }, [selectedColor]);
56
+ var isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
57
+ var activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
58
+ var activeCols = isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld;
54
59
  var paletteOptions = useMemo(function () {
55
60
  return {
56
- palette: cellBackgroundColorPalette,
61
+ palette: activePalette,
57
62
  paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
58
63
  hexToPaletteColor: hexToEditorBackgroundPaletteColor
59
64
  };
60
- }, []);
65
+ }, [activePalette]);
61
66
  return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
62
67
  elemBefore: /*#__PURE__*/React.createElement(PaintBucketIcon, {
63
68
  color: "currentColor",
@@ -77,7 +82,7 @@ export var BackgroundColorItem = function BackgroundColorItem(_ref) {
77
82
  }, /*#__PURE__*/React.createElement(Box, {
78
83
  xcss: colorPaletteStyles.container
79
84
  }, /*#__PURE__*/React.createElement(ColorPalette, {
80
- cols: colorPaletteColumns,
85
+ cols: activeCols,
81
86
  onClick: onClick,
82
87
  selectedColor: colorPreviewStyle.backgroundColor,
83
88
  paletteOptions: paletteOptions
@@ -80,5 +80,6 @@ export var dragMenuDropdownWidth = 250;
80
80
  export var dragTableInsertColumnButtonSize = 16;
81
81
  export var dropTargetExtendedWidth = 150;
82
82
  export var dragRowControlsWidth = 14;
83
- export var colorPalletteColumns = 7;
83
+ export var colorPaletteColumnsOld = 7;
84
+ export var colorPaletteColumns = 10;
84
85
  export var tableResizerWidth = 8;
@@ -21,7 +21,7 @@ import commonMessages, { tableMessages as messages } from '@atlaskit/editor-comm
21
21
  import { isNestedTablesSupported, isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
22
22
  import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
23
23
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
24
- import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
24
+ import { DEFAULT_BORDER_COLOR, cellBackgroundColorPalette, cellBackgroundColorPaletteNew } from '@atlaskit/editor-common/ui-color';
25
25
  import { closestElement, getChildrenInfo as _getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
26
26
  import { findParentDomRefOfType } from '@atlaskit/editor-prosemirror/utils';
27
27
  import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
@@ -35,6 +35,7 @@ import CustomizeIcon from '@atlaskit/icon/core/customize';
35
35
  import DeleteIcon from '@atlaskit/icon/core/delete';
36
36
  import ShrinkHorizontalIcon from '@atlaskit/icon/core/shrink-horizontal';
37
37
  import TableColumnsDistributeIcon from '@atlaskit/icon/core/table-columns-distribute';
38
+ import { fg } from '@atlaskit/platform-feature-flags';
38
39
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
39
40
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
40
41
  import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from '../pm-plugins/commands';
@@ -53,6 +54,7 @@ import { getMergedCellsPositions } from '../pm-plugins/utils/table';
53
54
  import { applyMeasuredWidthToSelectedTable } from '../pm-plugins/utils/tableMode/apply-measured-width-to-selected-table';
54
55
  import { isContentModeSupported } from '../pm-plugins/utils/tableMode/is-content-mode-supported';
55
56
  import { TableCssClassName } from '../types';
57
+ import { colorPaletteColumns, colorPaletteColumnsOld } from './consts';
56
58
  import { FloatingAlignmentButtons } from './FloatingAlignmentButtons/FloatingAlignmentButtons';
57
59
  export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
58
60
  var formatMessage = _ref.formatMessage;
@@ -662,7 +664,9 @@ var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalytics
662
664
  }
663
665
  var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
664
666
  var currentBackground = (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
665
- var defaultPalette = cellBackgroundColorPalette.find(function (item) {
667
+ var isMoreColorsEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
668
+ var activePalette = isMoreColorsEnabled ? cellBackgroundColorPaletteNew : cellBackgroundColorPalette;
669
+ var defaultPalette = activePalette.find(function (item) {
666
670
  return item.value === currentBackground;
667
671
  }) || {
668
672
  // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
@@ -676,8 +680,9 @@ var getColorPicker = function getColorPicker(state, menu, _ref4, editorAnalytics
676
680
  type: 'select',
677
681
  isAriaExpanded: true,
678
682
  selectType: 'color',
683
+ cols: isMoreColorsEnabled ? colorPaletteColumns : colorPaletteColumnsOld,
679
684
  defaultValue: defaultPalette,
680
- options: cellBackgroundColorPalette,
685
+ options: activePalette,
681
686
  returnEscToButton: true,
682
687
  // Ignored via go/ees005
683
688
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -65,5 +65,6 @@ export declare const dragMenuDropdownWidth = 250;
65
65
  export declare const dragTableInsertColumnButtonSize = 16;
66
66
  export declare const dropTargetExtendedWidth = 150;
67
67
  export declare const dragRowControlsWidth = 14;
68
- export declare const colorPalletteColumns = 7;
68
+ export declare const colorPaletteColumnsOld = 7;
69
+ export declare const colorPaletteColumns = 10;
69
70
  export declare const tableResizerWidth = 8;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "24.5.0",
3
+ "version": "24.5.1",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -20,10 +20,10 @@
20
20
  "singleton": true
21
21
  },
22
22
  "dependencies": {
23
- "@atlaskit/adf-schema": "^56.2.0",
23
+ "@atlaskit/adf-schema": "^56.3.0",
24
24
  "@atlaskit/button": "^24.3.0",
25
25
  "@atlaskit/custom-steps": "^1.0.0",
26
- "@atlaskit/editor-palette": "^3.2.0",
26
+ "@atlaskit/editor-palette": "^3.3.0",
27
27
  "@atlaskit/editor-plugin-accessibility-utils": "^12.1.0",
28
28
  "@atlaskit/editor-plugin-analytics": "^12.1.0",
29
29
  "@atlaskit/editor-plugin-batch-attribute-updates": "^12.1.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^2.0.0",
54
54
  "@atlaskit/primitives": "^22.2.0",
55
- "@atlaskit/tmp-editor-statsig": "^135.7.0",
55
+ "@atlaskit/tmp-editor-statsig": "^135.8.0",
56
56
  "@atlaskit/toggle": "^17.1.0",
57
57
  "@atlaskit/tokens": "^16.3.0",
58
58
  "@atlaskit/tooltip": "^24.0.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^116.45.0",
70
+ "@atlaskit/editor-common": "^116.46.0",
71
71
  "react": "^18.2.0 || ^19.2.0",
72
72
  "react-dom": "^18.2.0 || ^19.2.0",
73
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -162,6 +162,9 @@
162
162
  },
163
163
  "platform_editor_table_flicker_issue": {
164
164
  "type": "boolean"
165
+ },
166
+ "platform_editor_lovability_text_bg_color_patch_2": {
167
+ "type": "boolean"
165
168
  }
166
169
  },
167
170
  "devDependencies": {