@atlaskit/editor-plugin-panel 14.2.0 → 14.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-plugin-panel
2
2
 
3
+ ## 14.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7a9ec6f1fa018`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7a9ec6f1fa018) -
8
+ [EDITOR-7592] Add a new panel background color palette with expanded colors behind the lovability
9
+ experiment and patch gate.
10
+ - Updated dependencies
11
+
3
12
  ## 14.2.0
4
13
 
5
14
  ### Minor Changes
@@ -26,6 +26,7 @@ var _statusDiscovery = _interopRequireDefault(require("@atlaskit/icon/core/statu
26
26
  var _statusInformation = _interopRequireDefault(require("@atlaskit/icon/core/status-information"));
27
27
  var _statusSuccess = _interopRequireDefault(require("@atlaskit/icon/core/status-success"));
28
28
  var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
29
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
29
30
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
30
31
  var _actions = require("../editor-actions/actions");
31
32
  var _utils2 = require("../pm-plugins/utils/utils");
@@ -199,7 +200,9 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
199
200
  };
200
201
  };
201
202
  var panelColor = activePanelType === _adfSchema.PanelType.CUSTOM ? activePanelColor || (0, _panel.getPanelTypeBackgroundNoTokens)(_adfSchema.PanelType.INFO) : (0, _panel.getPanelTypeBackgroundNoTokens)(activePanelType);
202
- var defaultPalette = _uiColor.panelBackgroundPalette.find(function (item) {
203
+ var isNewPanelPaletteEnabled = (0, _expValEquals.expValEquals)('platform_editor_lovability_text_bg_color', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_lovability_text_bg_color_patch_2');
204
+ var colorPalette = isNewPanelPaletteEnabled ? _uiColor.panelBackgroundPaletteNew : _uiColor.panelBackgroundPalette;
205
+ var defaultPalette = colorPalette.find(function (item) {
203
206
  return item.value === panelColor;
204
207
  }) || {
205
208
  // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
@@ -215,7 +218,8 @@ var getToolbarItems = exports.getToolbarItems = function getToolbarItems(formatM
215
218
  type: 'select',
216
219
  selectType: 'color',
217
220
  defaultValue: defaultPalette,
218
- options: _uiColor.panelBackgroundPalette,
221
+ options: colorPalette,
222
+ cols: isNewPanelPaletteEnabled ? 10 : undefined,
219
223
  onChange: function onChange(option) {
220
224
  return changeColor(option.value);
221
225
  }
@@ -5,7 +5,7 @@ import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
5
5
  import commonMessages, { panelMessages as messages } from '@atlaskit/editor-common/messages';
6
6
  import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
7
7
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
8
- import { DEFAULT_BORDER_COLOR, panelBackgroundPalette } from '@atlaskit/editor-common/ui-color';
8
+ import { DEFAULT_BORDER_COLOR, panelBackgroundPalette, panelBackgroundPaletteNew } from '@atlaskit/editor-common/ui-color';
9
9
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
10
10
  import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
11
11
  import CopyIcon from '@atlaskit/icon/core/copy';
@@ -16,6 +16,7 @@ import StatusDiscoveryIcon from '@atlaskit/icon/core/status-discovery';
16
16
  import InformationIcon from '@atlaskit/icon/core/status-information';
17
17
  import SuccessIcon from '@atlaskit/icon/core/status-success';
18
18
  import WarningIcon from '@atlaskit/icon/core/status-warning';
19
+ import { fg } from '@atlaskit/platform-feature-flags';
19
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
20
21
  import { changePanelType, removePanel } from '../editor-actions/actions';
21
22
  import { findPanel } from '../pm-plugins/utils/utils';
@@ -189,7 +190,9 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
189
190
  return false;
190
191
  };
191
192
  const panelColor = activePanelType === PanelType.CUSTOM ? activePanelColor || getPanelTypeBackgroundNoTokens(PanelType.INFO) : getPanelTypeBackgroundNoTokens(activePanelType);
192
- const defaultPalette = panelBackgroundPalette.find(item => item.value === panelColor) || {
193
+ const isNewPanelPaletteEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
194
+ const colorPalette = isNewPanelPaletteEnabled ? panelBackgroundPaletteNew : panelBackgroundPalette;
195
+ const defaultPalette = colorPalette.find(item => item.value === panelColor) || {
193
196
  // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
194
197
  label: 'Custom',
195
198
  value: panelColor,
@@ -203,7 +206,8 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
203
206
  type: 'select',
204
207
  selectType: 'color',
205
208
  defaultValue: defaultPalette,
206
- options: panelBackgroundPalette,
209
+ options: colorPalette,
210
+ cols: isNewPanelPaletteEnabled ? 10 : undefined,
207
211
  onChange: option => changeColor(option.value)
208
212
  };
209
213
  const emojiPicker = {
@@ -9,7 +9,7 @@ import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
9
9
  import commonMessages, { panelMessages as messages } from '@atlaskit/editor-common/messages';
10
10
  import { getPanelTypeBackgroundNoTokens } from '@atlaskit/editor-common/panel';
11
11
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
12
- import { DEFAULT_BORDER_COLOR, panelBackgroundPalette } from '@atlaskit/editor-common/ui-color';
12
+ import { DEFAULT_BORDER_COLOR, panelBackgroundPalette, panelBackgroundPaletteNew } from '@atlaskit/editor-common/ui-color';
13
13
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
14
14
  import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
15
15
  import CopyIcon from '@atlaskit/icon/core/copy';
@@ -20,6 +20,7 @@ import StatusDiscoveryIcon from '@atlaskit/icon/core/status-discovery';
20
20
  import InformationIcon from '@atlaskit/icon/core/status-information';
21
21
  import SuccessIcon from '@atlaskit/icon/core/status-success';
22
22
  import WarningIcon from '@atlaskit/icon/core/status-warning';
23
+ import { fg } from '@atlaskit/platform-feature-flags';
23
24
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
24
25
  import { changePanelType, removePanel } from '../editor-actions/actions';
25
26
  import { findPanel } from '../pm-plugins/utils/utils';
@@ -190,7 +191,9 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
190
191
  };
191
192
  };
192
193
  var panelColor = activePanelType === PanelType.CUSTOM ? activePanelColor || getPanelTypeBackgroundNoTokens(PanelType.INFO) : getPanelTypeBackgroundNoTokens(activePanelType);
193
- var defaultPalette = panelBackgroundPalette.find(function (item) {
194
+ var isNewPanelPaletteEnabled = expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true) && fg('platform_editor_lovability_text_bg_color_patch_2');
195
+ var colorPalette = isNewPanelPaletteEnabled ? panelBackgroundPaletteNew : panelBackgroundPalette;
196
+ var defaultPalette = colorPalette.find(function (item) {
194
197
  return item.value === panelColor;
195
198
  }) || {
196
199
  // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
@@ -206,7 +209,8 @@ export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeTy
206
209
  type: 'select',
207
210
  selectType: 'color',
208
211
  defaultValue: defaultPalette,
209
- options: panelBackgroundPalette,
212
+ options: colorPalette,
213
+ cols: isNewPanelPaletteEnabled ? 10 : undefined,
210
214
  onChange: function onChange(option) {
211
215
  return changeColor(option.value);
212
216
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-panel",
3
- "version": "14.2.0",
3
+ "version": "14.2.1",
4
4
  "description": "Panel plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -19,8 +19,8 @@
19
19
  "sideEffects": false,
20
20
  "atlaskit:src": "src/index.ts",
21
21
  "dependencies": {
22
- "@atlaskit/adf-schema": "^56.2.0",
23
- "@atlaskit/editor-palette": "^3.2.0",
22
+ "@atlaskit/adf-schema": "^56.3.0",
23
+ "@atlaskit/editor-palette": "^3.3.0",
24
24
  "@atlaskit/editor-plugin-analytics": "^12.1.0",
25
25
  "@atlaskit/editor-plugin-block-menu": "^11.2.0",
26
26
  "@atlaskit/editor-plugin-decorations": "^12.1.0",
@@ -33,13 +33,13 @@
33
33
  "@atlaskit/emoji": "^71.15.0",
34
34
  "@atlaskit/icon": "^37.2.0",
35
35
  "@atlaskit/platform-feature-flags": "^2.1.0",
36
- "@atlaskit/tmp-editor-statsig": "^135.7.0",
36
+ "@atlaskit/tmp-editor-statsig": "^135.10.0",
37
37
  "@atlaskit/tokens": "^16.3.0",
38
38
  "@babel/runtime": "^7.0.0",
39
39
  "uuid": "^3.1.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "@atlaskit/editor-common": "^116.45.0",
42
+ "@atlaskit/editor-common": "^116.47.0",
43
43
  "react": "^18.2.0 || ^19.2.0",
44
44
  "react-dom": "^18.2.0 || ^19.2.0",
45
45
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -90,6 +90,9 @@
90
90
  "platform_editor_adf_with_localid": {
91
91
  "type": "boolean"
92
92
  },
93
+ "platform_editor_lovability_text_bg_color_patch_2": {
94
+ "type": "boolean"
95
+ },
93
96
  "platform_editor_block_menu_v2_patch_3": {
94
97
  "type": "boolean"
95
98
  }