@atlaskit/editor-plugin-text-color 7.2.5 → 7.2.7
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 +14 -0
- package/dist/cjs/textColorPlugin.js +1 -2
- package/dist/cjs/ui/TextColorHighlightMenu.js +4 -7
- package/dist/es2019/textColorPlugin.js +1 -2
- package/dist/es2019/ui/TextColorHighlightMenu.js +4 -7
- package/dist/esm/textColorPlugin.js +1 -2
- package/dist/esm/ui/TextColorHighlightMenu.js +4 -7
- package/dist/types/ui/TextColorHighlightMenu.d.ts +1 -1
- package/dist/types-ts4.5/ui/TextColorHighlightMenu.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-color
|
|
2
2
|
|
|
3
|
+
## 7.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`653c0c803b286`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/653c0c803b286) -
|
|
8
|
+
EDITOR-4620 Clean up platform_editor_toolbar_aifc_patch_6
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.2.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 7.2.5
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -8,7 +8,6 @@ exports.textColorPlugin = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
12
|
var _changeColor2 = require("./editor-commands/change-color");
|
|
14
13
|
var _palette = require("./editor-commands/palette");
|
|
@@ -81,7 +80,7 @@ var textColorPlugin = exports.textColorPlugin = function textColorPlugin(_ref) {
|
|
|
81
80
|
}];
|
|
82
81
|
},
|
|
83
82
|
pmPlugins: function pmPlugins() {
|
|
84
|
-
return isToolbarAIFCEnabled
|
|
83
|
+
return isToolbarAIFCEnabled ? [{
|
|
85
84
|
name: 'textColor',
|
|
86
85
|
plugin: function plugin(_ref3) {
|
|
87
86
|
var dispatch = _ref3.dispatch;
|
|
@@ -12,7 +12,6 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
12
12
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
13
13
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
14
14
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
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); }
|
|
17
16
|
var getIconColor = function getIconColor(textColor, defaultColor, highlightColor) {
|
|
18
17
|
if (highlightColor || !textColor || textColor === defaultColor && defaultColor) {
|
|
@@ -55,10 +54,8 @@ var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColor
|
|
|
55
54
|
}, [api === null || api === void 0 || (_api$textColor2 = api.textColor) === null || _api$textColor2 === void 0 ? void 0 : _api$textColor2.commands, api === null || api === void 0 ? void 0 : api.core.actions]);
|
|
56
55
|
(0, _react.useEffect)(function () {
|
|
57
56
|
return function () {
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
setIsPaletteOpen(false);
|
|
61
|
-
}
|
|
57
|
+
if (isPaletteOpen) {
|
|
58
|
+
setIsPaletteOpen(false);
|
|
62
59
|
}
|
|
63
60
|
};
|
|
64
61
|
}, [setIsPaletteOpen, isPaletteOpen]);
|
|
@@ -69,8 +66,8 @@ var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColor
|
|
|
69
66
|
keymap: _keymaps.toggleHighlightPalette
|
|
70
67
|
})
|
|
71
68
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenuProvider, {
|
|
72
|
-
isOpen:
|
|
73
|
-
setIsOpen:
|
|
69
|
+
isOpen: isPaletteOpen,
|
|
70
|
+
setIsOpen: setIsPaletteOpen
|
|
74
71
|
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownMenu, {
|
|
75
72
|
iconBefore: /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarColorSwatch, {
|
|
76
73
|
highlightColor: getHighlightColorIcon(highlightColor)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { textColor } from '@atlaskit/adf-schema';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { changeColor as changeColorCommand } from './editor-commands/change-color';
|
|
7
6
|
import { setPalette } from './editor-commands/palette';
|
|
@@ -76,7 +75,7 @@ export const textColorPlugin = ({
|
|
|
76
75
|
}];
|
|
77
76
|
},
|
|
78
77
|
pmPlugins() {
|
|
79
|
-
return isToolbarAIFCEnabled
|
|
78
|
+
return isToolbarAIFCEnabled ? [{
|
|
80
79
|
name: 'textColor',
|
|
81
80
|
plugin: ({
|
|
82
81
|
dispatch
|
|
@@ -5,7 +5,6 @@ import { textColorMessages as messages } from '@atlaskit/editor-common/messages'
|
|
|
5
5
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
6
6
|
import { hexToEditorTextPaletteColor, hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
7
7
|
import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
const getIconColor = (textColor, defaultColor, highlightColor) => {
|
|
10
9
|
if (highlightColor || !textColor || textColor === defaultColor && defaultColor) {
|
|
11
10
|
return "var(--ds-text, #292A2E)";
|
|
@@ -51,10 +50,8 @@ export const TextColorHighlightMenu = ({
|
|
|
51
50
|
}, [api === null || api === void 0 ? void 0 : (_api$textColor2 = api.textColor) === null || _api$textColor2 === void 0 ? void 0 : _api$textColor2.commands, api === null || api === void 0 ? void 0 : api.core.actions]);
|
|
52
51
|
useEffect(() => {
|
|
53
52
|
return () => {
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
setIsPaletteOpen(false);
|
|
57
|
-
}
|
|
53
|
+
if (isPaletteOpen) {
|
|
54
|
+
setIsPaletteOpen(false);
|
|
58
55
|
}
|
|
59
56
|
};
|
|
60
57
|
}, [setIsPaletteOpen, isPaletteOpen]);
|
|
@@ -65,8 +62,8 @@ export const TextColorHighlightMenu = ({
|
|
|
65
62
|
keymap: toggleHighlightPalette
|
|
66
63
|
})
|
|
67
64
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenuProvider, {
|
|
68
|
-
isOpen:
|
|
69
|
-
setIsOpen:
|
|
65
|
+
isOpen: isPaletteOpen,
|
|
66
|
+
setIsOpen: setIsPaletteOpen
|
|
70
67
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
|
|
71
68
|
iconBefore: /*#__PURE__*/React.createElement(ToolbarColorSwatch, {
|
|
72
69
|
highlightColor: getHighlightColorIcon(highlightColor)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { textColor } from '@atlaskit/adf-schema';
|
|
3
3
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { changeColor as changeColorCommand } from './editor-commands/change-color';
|
|
7
6
|
import { setPalette as _setPalette } from './editor-commands/palette';
|
|
@@ -74,7 +73,7 @@ export var textColorPlugin = function textColorPlugin(_ref) {
|
|
|
74
73
|
}];
|
|
75
74
|
},
|
|
76
75
|
pmPlugins: function pmPlugins() {
|
|
77
|
-
return isToolbarAIFCEnabled
|
|
76
|
+
return isToolbarAIFCEnabled ? [{
|
|
78
77
|
name: 'textColor',
|
|
79
78
|
plugin: function plugin(_ref3) {
|
|
80
79
|
var dispatch = _ref3.dispatch;
|
|
@@ -5,7 +5,6 @@ import { textColorMessages as messages } from '@atlaskit/editor-common/messages'
|
|
|
5
5
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
6
6
|
import { hexToEditorTextPaletteColor, hexToEditorTextBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
7
7
|
import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
var getIconColor = function getIconColor(textColor, defaultColor, highlightColor) {
|
|
10
9
|
if (highlightColor || !textColor || textColor === defaultColor && defaultColor) {
|
|
11
10
|
return "var(--ds-text, #292A2E)";
|
|
@@ -47,10 +46,8 @@ export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
|
|
|
47
46
|
}, [api === null || api === void 0 || (_api$textColor2 = api.textColor) === null || _api$textColor2 === void 0 ? void 0 : _api$textColor2.commands, api === null || api === void 0 ? void 0 : api.core.actions]);
|
|
48
47
|
useEffect(function () {
|
|
49
48
|
return function () {
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
setIsPaletteOpen(false);
|
|
53
|
-
}
|
|
49
|
+
if (isPaletteOpen) {
|
|
50
|
+
setIsPaletteOpen(false);
|
|
54
51
|
}
|
|
55
52
|
};
|
|
56
53
|
}, [setIsPaletteOpen, isPaletteOpen]);
|
|
@@ -61,8 +58,8 @@ export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
|
|
|
61
58
|
keymap: toggleHighlightPalette
|
|
62
59
|
})
|
|
63
60
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenuProvider, {
|
|
64
|
-
isOpen:
|
|
65
|
-
setIsOpen:
|
|
61
|
+
isOpen: isPaletteOpen,
|
|
62
|
+
setIsOpen: setIsPaletteOpen
|
|
66
63
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenu, {
|
|
67
64
|
iconBefore: /*#__PURE__*/React.createElement(ToolbarColorSwatch, {
|
|
68
65
|
highlightColor: getHighlightColorIcon(highlightColor)
|
|
@@ -5,5 +5,5 @@ interface TextColorHighlightMenuProps {
|
|
|
5
5
|
api: ExtractInjectionAPI<TextColorPlugin> | undefined;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const TextColorHighlightMenu: ({ children, api }: TextColorHighlightMenuProps) => React.JSX.Element;
|
|
8
|
+
export declare const TextColorHighlightMenu: ({ children, api, }: TextColorHighlightMenuProps) => React.JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -5,5 +5,5 @@ interface TextColorHighlightMenuProps {
|
|
|
5
5
|
api: ExtractInjectionAPI<TextColorPlugin> | undefined;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const TextColorHighlightMenu: ({ children, api }: TextColorHighlightMenuProps) => React.JSX.Element;
|
|
8
|
+
export declare const TextColorHighlightMenu: ({ children, api, }: TextColorHighlightMenuProps) => React.JSX.Element;
|
|
9
9
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.7",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
48
|
"@atlaskit/primitives": "^17.1.0",
|
|
49
49
|
"@atlaskit/theme": "^21.0.0",
|
|
50
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
50
|
+
"@atlaskit/tmp-editor-statsig": "^17.1.0",
|
|
51
51
|
"@atlaskit/tokens": "^10.1.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1"
|