@atlaskit/editor-plugin-text-color 6.3.9 → 6.3.10

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-text-color
2
2
 
3
+ ## 6.3.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e584fc1d47ba6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e584fc1d47ba6) -
8
+ [ux] ED-29650 Fix Text Highlight colour toolbar button to use ads colour token
9
+ - Updated dependencies
10
+
3
11
  ## 6.3.9
4
12
 
5
13
  ### Patch Changes
@@ -28,6 +28,12 @@ var getIconColor = function getIconColor(textColor, defaultColor, highlightColor
28
28
  }
29
29
  return (0, _editorPalette.hexToEditorTextPaletteColor)(textColor) || "var(--ds-text, #292A2E)";
30
30
  };
31
+ var getHighlightColorIcon = function getHighlightColorIcon(highlightColor) {
32
+ if (highlightColor) {
33
+ return (0, _editorPalette.hexToEditorTextBackgroundPaletteColor)(highlightColor);
34
+ }
35
+ return undefined;
36
+ };
31
37
  var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
32
38
  var _api$textColor2;
33
39
  var children = _ref.children,
@@ -76,7 +82,7 @@ var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColor
76
82
  setIsOpen: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? setIsPaletteOpen : undefined
77
83
  }, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
78
84
  iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarColorSwatch, {
79
- highlightColor: highlightColorIcon
85
+ highlightColor: (0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_patch_8') ? getHighlightColorIcon(highlightColor) : highlightColorIcon
80
86
  }, /*#__PURE__*/_react.default.createElement(_editorToolbar.TextColorIcon, {
81
87
  label: formatMessage(_messages.textColorMessages.textColorTooltip),
82
88
  iconColor: iconColor,
@@ -6,7 +6,7 @@ import { useIntl } from 'react-intl-next';
6
6
  import { toggleHighlightPalette, ToolTipContent } from '@atlaskit/editor-common/keymaps';
7
7
  import { textColorMessages as messages } from '@atlaskit/editor-common/messages';
8
8
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
9
- import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
9
+ import { hexToEditorTextPaletteColor, hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
10
10
  import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor, useToolbarUI } from '@atlaskit/editor-toolbar';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { Box } from '@atlaskit/primitives/compiled';
@@ -20,6 +20,12 @@ const getIconColor = (textColor, defaultColor, highlightColor) => {
20
20
  }
21
21
  return hexToEditorTextPaletteColor(textColor) || "var(--ds-text, #292A2E)";
22
22
  };
23
+ const getHighlightColorIcon = highlightColor => {
24
+ if (highlightColor) {
25
+ return hexToEditorTextBackgroundPaletteColor(highlightColor);
26
+ }
27
+ return undefined;
28
+ };
23
29
  export const TextColorHighlightMenu = ({
24
30
  children,
25
31
  api
@@ -72,7 +78,7 @@ export const TextColorHighlightMenu = ({
72
78
  setIsOpen: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? setIsPaletteOpen : undefined
73
79
  }, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
74
80
  iconBefore: /*#__PURE__*/React.createElement(ToolbarColorSwatch, {
75
- highlightColor: highlightColorIcon
81
+ highlightColor: fg('platform_editor_toolbar_aifc_patch_8') ? getHighlightColorIcon(highlightColor) : highlightColorIcon
76
82
  }, /*#__PURE__*/React.createElement(TextColorIcon, {
77
83
  label: formatMessage(messages.textColorTooltip),
78
84
  iconColor: iconColor,
@@ -6,7 +6,7 @@ import { useIntl } from 'react-intl-next';
6
6
  import { toggleHighlightPalette, ToolTipContent } from '@atlaskit/editor-common/keymaps';
7
7
  import { textColorMessages as messages } from '@atlaskit/editor-common/messages';
8
8
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
9
- import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
9
+ import { hexToEditorTextPaletteColor, hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
10
10
  import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor, useToolbarUI } from '@atlaskit/editor-toolbar';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { Box } from '@atlaskit/primitives/compiled';
@@ -20,6 +20,12 @@ var getIconColor = function getIconColor(textColor, defaultColor, highlightColor
20
20
  }
21
21
  return hexToEditorTextPaletteColor(textColor) || "var(--ds-text, #292A2E)";
22
22
  };
23
+ var getHighlightColorIcon = function getHighlightColorIcon(highlightColor) {
24
+ if (highlightColor) {
25
+ return hexToEditorTextBackgroundPaletteColor(highlightColor);
26
+ }
27
+ return undefined;
28
+ };
23
29
  export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
24
30
  var _api$textColor2;
25
31
  var children = _ref.children,
@@ -68,7 +74,7 @@ export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
68
74
  setIsOpen: expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? setIsPaletteOpen : undefined
69
75
  }, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
70
76
  iconBefore: /*#__PURE__*/React.createElement(ToolbarColorSwatch, {
71
- highlightColor: highlightColorIcon
77
+ highlightColor: fg('platform_editor_toolbar_aifc_patch_8') ? getHighlightColorIcon(highlightColor) : highlightColorIcon
72
78
  }, /*#__PURE__*/React.createElement(TextColorIcon, {
73
79
  label: formatMessage(messages.textColorTooltip),
74
80
  iconColor: iconColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-color",
3
- "version": "6.3.9",
3
+ "version": "6.3.10",
4
4
  "description": "Text color plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -110,6 +110,9 @@
110
110
  },
111
111
  "platform_editor_toolbar_aifc_patch_7": {
112
112
  "type": "boolean"
113
+ },
114
+ "platform_editor_toolbar_aifc_patch_8": {
115
+ "type": "boolean"
113
116
  }
114
117
  }
115
118
  }