@atlaskit/editor-plugin-text-color 6.3.2 → 6.3.3
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.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2d7e0bee11270`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2d7e0bee11270) -
|
|
8
|
+
[ux] ED-29586 Colour picker remains open after toolbar is dismissed and reopened
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 6.3.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -15,6 +15,7 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
15
15
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
16
|
var _editorPalette = require("@atlaskit/editor-palette");
|
|
17
17
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
20
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
21
|
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); }
|
|
@@ -54,6 +55,15 @@ var TextColorHighlightMenu = exports.TextColorHighlightMenu = function TextColor
|
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
}, [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]);
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
return function () {
|
|
60
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_patch_7')) {
|
|
61
|
+
if (isPaletteOpen) {
|
|
62
|
+
setIsPaletteOpen(false);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}, [setIsPaletteOpen, isPaletteOpen]);
|
|
57
67
|
var iconColor = getIconColor(textColor, defaultColor, highlightColor);
|
|
58
68
|
var highlightColorIcon = highlightColor ? highlightColor : (0, _editorToolbar.getContrastingBackgroundColor)(iconColor);
|
|
59
69
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarTooltip, {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./TextColorHighlightMenu.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { useCallback } from 'react';
|
|
4
|
+
import React, { useCallback, useEffect } from 'react';
|
|
5
5
|
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
9
|
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
10
10
|
import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
12
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
const styles = {
|
|
@@ -50,6 +51,15 @@ export const TextColorHighlightMenu = ({
|
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
}, [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]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
return () => {
|
|
56
|
+
if (expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && fg('platform_editor_toolbar_aifc_patch_7')) {
|
|
57
|
+
if (isPaletteOpen) {
|
|
58
|
+
setIsPaletteOpen(false);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, [setIsPaletteOpen, isPaletteOpen]);
|
|
53
63
|
const iconColor = getIconColor(textColor, defaultColor, highlightColor);
|
|
54
64
|
const highlightColorIcon = highlightColor ? highlightColor : getContrastingBackgroundColor(iconColor);
|
|
55
65
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/* TextColorHighlightMenu.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import "./TextColorHighlightMenu.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { useCallback } from 'react';
|
|
4
|
+
import React, { useCallback, useEffect } from 'react';
|
|
5
5
|
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
9
|
import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
10
10
|
import { TextColorIcon, ToolbarColorSwatch, ToolbarDropdownMenu, ToolbarDropdownMenuProvider, ToolbarTooltip, getContrastingBackgroundColor, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
12
13
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
14
|
var styles = {
|
|
@@ -46,6 +47,15 @@ export var TextColorHighlightMenu = function TextColorHighlightMenu(_ref) {
|
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
}, [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]);
|
|
50
|
+
useEffect(function () {
|
|
51
|
+
return function () {
|
|
52
|
+
if (expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && fg('platform_editor_toolbar_aifc_patch_7')) {
|
|
53
|
+
if (isPaletteOpen) {
|
|
54
|
+
setIsPaletteOpen(false);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}, [setIsPaletteOpen, isPaletteOpen]);
|
|
49
59
|
var iconColor = getIconColor(textColor, defaultColor, highlightColor);
|
|
50
60
|
var highlightColorIcon = highlightColor ? highlightColor : getContrastingBackgroundColor(iconColor);
|
|
51
61
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.3",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -107,6 +107,9 @@
|
|
|
107
107
|
},
|
|
108
108
|
"platform-visual-refresh-icons": {
|
|
109
109
|
"type": "boolean"
|
|
110
|
+
},
|
|
111
|
+
"platform_editor_toolbar_aifc_patch_7": {
|
|
112
|
+
"type": "boolean"
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
}
|