@atlaskit/editor-plugin-text-color 22.0.6 → 22.0.8
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
|
+
## 22.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 22.0.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`064f989853cf0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/064f989853cf0) -
|
|
14
|
+
Clean up experiment `platform_editor_default_toolbar_state`
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 22.0.6
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -7,15 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.TextColorHighlightMenu = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactIntl = require("react-intl");
|
|
10
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
10
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
12
|
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
14
13
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
15
14
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
16
15
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
17
|
-
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
18
|
-
var _conditionalHooksFactory = require("@atlaskit/platform-feature-flags-react/conditional-hooks-factory/conditional-hooks-factory");
|
|
19
16
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
17
|
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); }
|
|
21
18
|
var getIconColor = function getIconColor(textColor, defaultColor, highlightColor) {
|
|
@@ -36,20 +33,7 @@ var getHighlightColorIcon = function getHighlightColorIcon(highlightColor) {
|
|
|
36
33
|
}
|
|
37
34
|
return undefined;
|
|
38
35
|
};
|
|
39
|
-
var
|
|
40
|
-
return (0, _hooks.useSharedPluginStateWithSelector)(api, ['textColor', 'highlight', 'interaction'], function (states) {
|
|
41
|
-
var _states$interactionSt, _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4, _states$highlightStat;
|
|
42
|
-
var useDefaultToolbarState = ((_states$interactionSt = states.interactionState) === null || _states$interactionSt === void 0 ? void 0 : _states$interactionSt.interactionState) === 'hasNotHadInteraction';
|
|
43
|
-
return {
|
|
44
|
-
isTextColorDisabled: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.disabled,
|
|
45
|
-
textColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.color,
|
|
46
|
-
defaultColor: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.defaultColor,
|
|
47
|
-
isPaletteOpen: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.isPaletteOpen,
|
|
48
|
-
highlightColor: useDefaultToolbarState ? undefined : (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.activeColor
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
var useTextColorHighlightMenuStateOld = function useTextColorHighlightMenuStateOld(api) {
|
|
36
|
+
var useTextColorHighlightMenuState = function useTextColorHighlightMenuState(api) {
|
|
53
37
|
var isTextColorDisabled = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'textColor.disabled');
|
|
54
38
|
var textColor = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'textColor.color');
|
|
55
39
|
var defaultColor = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'textColor.defaultColor');
|
|
@@ -63,9 +47,6 @@ var useTextColorHighlightMenuStateOld = function useTextColorHighlightMenuStateO
|
|
|
63
47
|
highlightColor: highlightColor
|
|
64
48
|
};
|
|
65
49
|
};
|
|
66
|
-
var useTextColorHighlightMenuState = (0, _conditionalHooksFactory.conditionalHooksFactory)(function () {
|
|
67
|
-
return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_default_toolbar_state');
|
|
68
|
-
}, useTextColorHighlightMenuStateNew, useTextColorHighlightMenuStateOld);
|
|
69
50
|
var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
|
|
70
51
|
var _api$textColor2;
|
|
71
52
|
var children = _ref.children,
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { toggleHighlightPalette, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
5
4
|
import { textColorMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
5
|
import { SelectedTextColorProvider } from '@atlaskit/editor-common/ui-color';
|
|
7
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
8
7
|
import { hexToEditorTextPaletteColor, hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
9
8
|
import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
10
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
|
-
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react/conditional-hooks-factory/conditional-hooks-factory';
|
|
12
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
10
|
const getIconColor = (textColor, defaultColor, highlightColor) => {
|
|
14
11
|
if (expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
|
|
@@ -28,20 +25,7 @@ const getHighlightColorIcon = highlightColor => {
|
|
|
28
25
|
}
|
|
29
26
|
return undefined;
|
|
30
27
|
};
|
|
31
|
-
const
|
|
32
|
-
return useSharedPluginStateWithSelector(api, ['textColor', 'highlight', 'interaction'], states => {
|
|
33
|
-
var _states$interactionSt, _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4, _states$highlightStat;
|
|
34
|
-
const useDefaultToolbarState = ((_states$interactionSt = states.interactionState) === null || _states$interactionSt === void 0 ? void 0 : _states$interactionSt.interactionState) === 'hasNotHadInteraction';
|
|
35
|
-
return {
|
|
36
|
-
isTextColorDisabled: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.disabled,
|
|
37
|
-
textColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.color,
|
|
38
|
-
defaultColor: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.defaultColor,
|
|
39
|
-
isPaletteOpen: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.isPaletteOpen,
|
|
40
|
-
highlightColor: useDefaultToolbarState ? undefined : (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.activeColor
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const useTextColorHighlightMenuStateOld = api => {
|
|
28
|
+
const useTextColorHighlightMenuState = api => {
|
|
45
29
|
const isTextColorDisabled = useSharedPluginStateSelector(api, 'textColor.disabled');
|
|
46
30
|
const textColor = useSharedPluginStateSelector(api, 'textColor.color');
|
|
47
31
|
const defaultColor = useSharedPluginStateSelector(api, 'textColor.defaultColor');
|
|
@@ -55,7 +39,6 @@ const useTextColorHighlightMenuStateOld = api => {
|
|
|
55
39
|
highlightColor
|
|
56
40
|
};
|
|
57
41
|
};
|
|
58
|
-
const useTextColorHighlightMenuState = conditionalHooksFactory(() => isExperimentEnabled('platform_editor_default_toolbar_state'), useTextColorHighlightMenuStateNew, useTextColorHighlightMenuStateOld);
|
|
59
42
|
export const TextColorHighlightMenu = ({
|
|
60
43
|
children,
|
|
61
44
|
api
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
|
-
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { toggleHighlightPalette, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
5
4
|
import { textColorMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
5
|
import { SelectedTextColorProvider } from '@atlaskit/editor-common/ui-color';
|
|
7
6
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
8
7
|
import { hexToEditorTextPaletteColor, hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
9
8
|
import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
10
|
-
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
11
|
-
import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react/conditional-hooks-factory/conditional-hooks-factory';
|
|
12
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
10
|
var getIconColor = function getIconColor(textColor, defaultColor, highlightColor) {
|
|
14
11
|
if (expValEquals('platform_editor_lovability_text_bg_color', 'isEnabled', true)) {
|
|
@@ -28,20 +25,7 @@ var getHighlightColorIcon = function getHighlightColorIcon(highlightColor) {
|
|
|
28
25
|
}
|
|
29
26
|
return undefined;
|
|
30
27
|
};
|
|
31
|
-
var
|
|
32
|
-
return useSharedPluginStateWithSelector(api, ['textColor', 'highlight', 'interaction'], function (states) {
|
|
33
|
-
var _states$interactionSt, _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4, _states$highlightStat;
|
|
34
|
-
var useDefaultToolbarState = ((_states$interactionSt = states.interactionState) === null || _states$interactionSt === void 0 ? void 0 : _states$interactionSt.interactionState) === 'hasNotHadInteraction';
|
|
35
|
-
return {
|
|
36
|
-
isTextColorDisabled: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.disabled,
|
|
37
|
-
textColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.color,
|
|
38
|
-
defaultColor: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.defaultColor,
|
|
39
|
-
isPaletteOpen: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.isPaletteOpen,
|
|
40
|
-
highlightColor: useDefaultToolbarState ? undefined : (_states$highlightStat = states.highlightState) === null || _states$highlightStat === void 0 ? void 0 : _states$highlightStat.activeColor
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
var useTextColorHighlightMenuStateOld = function useTextColorHighlightMenuStateOld(api) {
|
|
28
|
+
var useTextColorHighlightMenuState = function useTextColorHighlightMenuState(api) {
|
|
45
29
|
var isTextColorDisabled = useSharedPluginStateSelector(api, 'textColor.disabled');
|
|
46
30
|
var textColor = useSharedPluginStateSelector(api, 'textColor.color');
|
|
47
31
|
var defaultColor = useSharedPluginStateSelector(api, 'textColor.defaultColor');
|
|
@@ -55,9 +39,6 @@ var useTextColorHighlightMenuStateOld = function useTextColorHighlightMenuStateO
|
|
|
55
39
|
highlightColor: highlightColor
|
|
56
40
|
};
|
|
57
41
|
};
|
|
58
|
-
var useTextColorHighlightMenuState = conditionalHooksFactory(function () {
|
|
59
|
-
return isExperimentEnabled('platform_editor_default_toolbar_state');
|
|
60
|
-
}, useTextColorHighlightMenuStateNew, useTextColorHighlightMenuStateOld);
|
|
61
42
|
export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
|
|
62
43
|
var _api$textColor2;
|
|
63
44
|
var children = _ref.children,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.8",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
49
49
|
"@atlaskit/primitives": "^22.5.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^216.0.0",
|
|
51
51
|
"@atlaskit/tokens": "^20.1.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@atlaskit/editor-common": "^126.
|
|
56
|
+
"@atlaskit/editor-common": "^126.4.0",
|
|
57
57
|
"react": "^18.2.0 || ^19.2.0",
|
|
58
58
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
59
59
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|