@atlaskit/editor-plugin-text-color 5.4.0 → 5.4.2

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,19 @@
1
1
  # @atlaskit/editor-plugin-text-color
2
2
 
3
+ ## 5.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`23b126bae703a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/23b126bae703a) -
8
+ ED-29354 Text/highlight color toolbar item is not full disabled when cursor is in page title
9
+ - Updated dependencies
10
+
11
+ ## 5.4.1
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 5.4.0
4
18
 
5
19
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- /* RemoveColorMenuItem.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* RemoveColorMenuItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -30,6 +30,9 @@ var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColor
30
30
  api = _ref.api;
31
31
  var isHighlightPluginExisted = !!(api !== null && api !== void 0 && api.highlight);
32
32
  var isTextColorDisabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'textColor.disabled');
33
+ var _useToolbarUI = (0, _editorToolbar.useToolbarUI)(),
34
+ isToolbarDisabled = _useToolbarUI.isDisabled;
35
+ var isDisabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? Boolean(isToolbarDisabled || isTextColorDisabled) : isTextColorDisabled;
33
36
  var highlightColor = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'highlight.activeColor');
34
37
  var textColor = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'textColor.color');
35
38
  var _useIntl = (0, _reactIntlNext.useIntl)(),
@@ -47,10 +50,10 @@ var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColor
47
50
  iconColor: iconColor,
48
51
  shouldRecommendSmallIcon: true,
49
52
  size: 'small',
50
- isDisabled: isTextColorDisabled,
53
+ isDisabled: isDisabled,
51
54
  spacing: 'compact'
52
55
  })),
53
- isDisabled: isTextColorDisabled,
56
+ isDisabled: isDisabled,
54
57
  testId: "text-color-highlight-menu",
55
58
  hasSectionMargin: false
56
59
  }, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? children : /*#__PURE__*/_react.default.createElement(_compiled.Box, {
@@ -63,10 +66,10 @@ var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColor
63
66
  iconColor: iconColor,
64
67
  shouldRecommendSmallIcon: true,
65
68
  size: 'small',
66
- isDisabled: isTextColorDisabled,
69
+ isDisabled: isDisabled,
67
70
  spacing: 'compact'
68
71
  })),
69
- isDisabled: isTextColorDisabled,
72
+ isDisabled: isDisabled,
70
73
  testId: "text-color-highlight-menu",
71
74
  hasSectionMargin: false
72
75
  }, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? children : /*#__PURE__*/_react.default.createElement(_compiled.Box, {
@@ -1,4 +1,4 @@
1
- /* TextColorMenuItem.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextColorMenuItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* TextMenuSection.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextMenuSection.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* RemoveColorMenuItem.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* RemoveColorMenuItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./RemoveColorMenuItem.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./TextColorHighlightMenu.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -6,7 +6,7 @@ import { useIntl } from 'react-intl-next';
6
6
  import { textColorMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
8
8
  import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
9
- import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor } from '@atlaskit/editor-toolbar';
9
+ import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor, useToolbarUI } from '@atlaskit/editor-toolbar';
10
10
  import { Box } from '@atlaskit/primitives/compiled';
11
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
12
  const styles = {
@@ -24,6 +24,10 @@ export const TextColorHighlightMenu = ({
24
24
  }) => {
25
25
  const isHighlightPluginExisted = !!(api !== null && api !== void 0 && api.highlight);
26
26
  const isTextColorDisabled = useSharedPluginStateSelector(api, 'textColor.disabled');
27
+ const {
28
+ isDisabled: isToolbarDisabled
29
+ } = useToolbarUI();
30
+ const isDisabled = expValEquals('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? Boolean(isToolbarDisabled || isTextColorDisabled) : isTextColorDisabled;
27
31
  const highlightColor = useSharedPluginStateSelector(api, 'highlight.activeColor');
28
32
  const textColor = useSharedPluginStateSelector(api, 'textColor.color');
29
33
  const {
@@ -42,10 +46,10 @@ export const TextColorHighlightMenu = ({
42
46
  iconColor: iconColor,
43
47
  shouldRecommendSmallIcon: true,
44
48
  size: 'small',
45
- isDisabled: isTextColorDisabled,
49
+ isDisabled: isDisabled,
46
50
  spacing: 'compact'
47
51
  })),
48
- isDisabled: isTextColorDisabled,
52
+ isDisabled: isDisabled,
49
53
  testId: "text-color-highlight-menu",
50
54
  hasSectionMargin: false
51
55
  }, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? children : /*#__PURE__*/React.createElement(Box, {
@@ -58,10 +62,10 @@ export const TextColorHighlightMenu = ({
58
62
  iconColor: iconColor,
59
63
  shouldRecommendSmallIcon: true,
60
64
  size: 'small',
61
- isDisabled: isTextColorDisabled,
65
+ isDisabled: isDisabled,
62
66
  spacing: 'compact'
63
67
  })),
64
- isDisabled: isTextColorDisabled,
68
+ isDisabled: isDisabled,
65
69
  testId: "text-color-highlight-menu",
66
70
  hasSectionMargin: false
67
71
  }, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? children : /*#__PURE__*/React.createElement(Box, {
@@ -1,4 +1,4 @@
1
- /* TextColorMenuItem.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextColorMenuItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./TextColorMenuItem.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback } from 'react';
@@ -1,4 +1,4 @@
1
- /* TextMenuSection.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextMenuSection.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./TextMenuSection.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* RemoveColorMenuItem.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* RemoveColorMenuItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./RemoveColorMenuItem.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./TextColorHighlightMenu.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -6,7 +6,7 @@ import { useIntl } from 'react-intl-next';
6
6
  import { textColorMessages as messages } from '@atlaskit/editor-common/messages';
7
7
  import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
8
8
  import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
9
- import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor } from '@atlaskit/editor-toolbar';
9
+ import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor, useToolbarUI } from '@atlaskit/editor-toolbar';
10
10
  import { Box } from '@atlaskit/primitives/compiled';
11
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
12
  var styles = {
@@ -23,6 +23,9 @@ export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
23
23
  api = _ref.api;
24
24
  var isHighlightPluginExisted = !!(api !== null && api !== void 0 && api.highlight);
25
25
  var isTextColorDisabled = useSharedPluginStateSelector(api, 'textColor.disabled');
26
+ var _useToolbarUI = useToolbarUI(),
27
+ isToolbarDisabled = _useToolbarUI.isDisabled;
28
+ var isDisabled = expValEquals('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? Boolean(isToolbarDisabled || isTextColorDisabled) : isTextColorDisabled;
26
29
  var highlightColor = useSharedPluginStateSelector(api, 'highlight.activeColor');
27
30
  var textColor = useSharedPluginStateSelector(api, 'textColor.color');
28
31
  var _useIntl = useIntl(),
@@ -40,10 +43,10 @@ export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
40
43
  iconColor: iconColor,
41
44
  shouldRecommendSmallIcon: true,
42
45
  size: 'small',
43
- isDisabled: isTextColorDisabled,
46
+ isDisabled: isDisabled,
44
47
  spacing: 'compact'
45
48
  })),
46
- isDisabled: isTextColorDisabled,
49
+ isDisabled: isDisabled,
47
50
  testId: "text-color-highlight-menu",
48
51
  hasSectionMargin: false
49
52
  }, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? children : /*#__PURE__*/React.createElement(Box, {
@@ -56,10 +59,10 @@ export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
56
59
  iconColor: iconColor,
57
60
  shouldRecommendSmallIcon: true,
58
61
  size: 'small',
59
- isDisabled: isTextColorDisabled,
62
+ isDisabled: isDisabled,
60
63
  spacing: 'compact'
61
64
  })),
62
- isDisabled: isTextColorDisabled,
65
+ isDisabled: isDisabled,
63
66
  testId: "text-color-highlight-menu",
64
67
  hasSectionMargin: false
65
68
  }, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? children : /*#__PURE__*/React.createElement(Box, {
@@ -1,4 +1,4 @@
1
- /* TextColorMenuItem.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextColorMenuItem.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./TextColorMenuItem.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback } from 'react';
@@ -1,4 +1,4 @@
1
- /* TextMenuSection.tsx generated by @compiled/babel-plugin v0.38.1 */
1
+ /* TextMenuSection.tsx generated by @compiled/babel-plugin v0.36.1 */
2
2
  import "./TextMenuSection.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-text-color",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "description": "Text color plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,20 +41,20 @@
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
42
  "@atlaskit/editor-shared-styles": "^3.6.0",
43
43
  "@atlaskit/editor-tables": "^2.9.0",
44
- "@atlaskit/editor-toolbar": "^0.8.0",
44
+ "@atlaskit/editor-toolbar": "^0.9.0",
45
45
  "@atlaskit/editor-toolbar-model": "^0.2.0",
46
46
  "@atlaskit/heading": "^5.2.0",
47
- "@atlaskit/icon": "^28.1.0",
47
+ "@atlaskit/icon": "^28.2.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
49
  "@atlaskit/primitives": "^14.14.0",
50
50
  "@atlaskit/theme": "^21.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^12.18.0",
51
+ "@atlaskit/tmp-editor-statsig": "^12.25.0",
52
52
  "@atlaskit/tokens": "^6.3.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "@emotion/react": "^11.7.1"
55
55
  },
56
56
  "peerDependencies": {
57
- "@atlaskit/editor-common": "^109.5.0",
57
+ "@atlaskit/editor-common": "^109.10.0",
58
58
  "react": "^18.2.0",
59
59
  "react-dom": "^18.2.0",
60
60
  "react-intl-next": "npm:react-intl@^5.18.1"