@atlaskit/editor-plugin-text-color 6.3.4 → 6.3.6
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,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-color
|
|
2
2
|
|
|
3
|
+
## 6.3.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`351b338797ae4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/351b338797ae4) -
|
|
8
|
+
ED-29460 Clean up platform_editor_toolbar_aifc_fix_editor_view
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 6.3.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`21fe79119fe74`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21fe79119fe74) -
|
|
16
|
+
EDITOR-2447 Bump adf-schema to 51.3.2
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 6.3.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -19,7 +19,6 @@ var _editorPalette = require("@atlaskit/editor-palette");
|
|
|
19
19
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
20
20
|
var _heading = _interopRequireDefault(require("@atlaskit/heading"));
|
|
21
21
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
22
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
23
22
|
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); }
|
|
24
23
|
var styles = {
|
|
25
24
|
container: "_zulp12x7"
|
|
@@ -40,36 +39,18 @@ function TextColorMenuItem(_ref) {
|
|
|
40
39
|
palette = _useSharedPluginState.palette;
|
|
41
40
|
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
|
|
42
41
|
editorView = _useEditorToolbar.editorView;
|
|
43
|
-
// Warning! Do not destructure editorView, it will become stale
|
|
44
|
-
var _ref2 = editorView !== null && editorView !== void 0 ? editorView : {
|
|
45
|
-
state: null,
|
|
46
|
-
dispatch: null
|
|
47
|
-
},
|
|
48
|
-
state = _ref2.state,
|
|
49
|
-
dispatch = _ref2.dispatch;
|
|
50
42
|
var context = (0, _editorToolbar.useToolbarDropdownMenu)();
|
|
51
43
|
var closeMenu = context === null || context === void 0 ? void 0 : context.closeMenu;
|
|
52
44
|
var handleTextColorChange = (0, _react.useCallback)(function (color) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
closeMenu === null || closeMenu === void 0 || closeMenu();
|
|
61
|
-
}
|
|
62
|
-
} else {
|
|
63
|
-
var _api$textColor2;
|
|
64
|
-
if (!state || !dispatch) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (api !== null && api !== void 0 && (_api$textColor2 = api.textColor) !== null && _api$textColor2 !== void 0 && (_api$textColor2 = _api$textColor2.actions) !== null && _api$textColor2 !== void 0 && _api$textColor2.changeColor) {
|
|
68
|
-
api.textColor.actions.changeColor(color, (0, _toolbar.getInputMethodFromParentKeys)(parents))(state, dispatch);
|
|
69
|
-
closeMenu === null || closeMenu === void 0 || closeMenu();
|
|
70
|
-
}
|
|
45
|
+
var _api$textColor;
|
|
46
|
+
if (!(editorView !== null && editorView !== void 0 && editorView.state) || !(editorView !== null && editorView !== void 0 && editorView.dispatch)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (api !== null && api !== void 0 && (_api$textColor = api.textColor) !== null && _api$textColor !== void 0 && (_api$textColor = _api$textColor.actions) !== null && _api$textColor !== void 0 && _api$textColor.changeColor) {
|
|
50
|
+
api.textColor.actions.changeColor(color, (0, _toolbar.getInputMethodFromParentKeys)(parents))(editorView.state, editorView.dispatch);
|
|
51
|
+
closeMenu === null || closeMenu === void 0 || closeMenu();
|
|
71
52
|
}
|
|
72
|
-
}, [editorView === null || editorView === void 0 ? void 0 : editorView.state, editorView === null || editorView === void 0 ? void 0 : editorView.dispatch, api === null || api === void 0 ? void 0 : api.textColor.actions, parents, closeMenu
|
|
53
|
+
}, [editorView === null || editorView === void 0 ? void 0 : editorView.state, editorView === null || editorView === void 0 ? void 0 : editorView.dispatch, api === null || api === void 0 ? void 0 : api.textColor.actions, parents, closeMenu]);
|
|
73
54
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
74
55
|
formatMessage = _useIntl.formatMessage;
|
|
75
56
|
return /*#__PURE__*/_react.default.createElement(_compiled.Stack, {
|
|
@@ -11,7 +11,6 @@ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
|
11
11
|
import { ColorPalette, useToolbarDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
12
12
|
import Heading from '@atlaskit/heading';
|
|
13
13
|
import { Stack } from '@atlaskit/primitives/compiled';
|
|
14
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
14
|
const styles = {
|
|
16
15
|
container: "_zulp12x7"
|
|
17
16
|
};
|
|
@@ -34,37 +33,18 @@ export function TextColorMenuItem({
|
|
|
34
33
|
const {
|
|
35
34
|
editorView
|
|
36
35
|
} = useEditorToolbar();
|
|
37
|
-
// Warning! Do not destructure editorView, it will become stale
|
|
38
|
-
const {
|
|
39
|
-
state,
|
|
40
|
-
dispatch
|
|
41
|
-
} = editorView !== null && editorView !== void 0 ? editorView : {
|
|
42
|
-
state: null,
|
|
43
|
-
dispatch: null
|
|
44
|
-
};
|
|
45
36
|
const context = useToolbarDropdownMenu();
|
|
46
37
|
const closeMenu = context === null || context === void 0 ? void 0 : context.closeMenu;
|
|
47
38
|
const handleTextColorChange = useCallback(color => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
closeMenu === null || closeMenu === void 0 ? void 0 : closeMenu();
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
var _api$textColor2, _api$textColor2$actio;
|
|
59
|
-
if (!state || !dispatch) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (api !== null && api !== void 0 && (_api$textColor2 = api.textColor) !== null && _api$textColor2 !== void 0 && (_api$textColor2$actio = _api$textColor2.actions) !== null && _api$textColor2$actio !== void 0 && _api$textColor2$actio.changeColor) {
|
|
63
|
-
api.textColor.actions.changeColor(color, getInputMethodFromParentKeys(parents))(state, dispatch);
|
|
64
|
-
closeMenu === null || closeMenu === void 0 ? void 0 : closeMenu();
|
|
65
|
-
}
|
|
39
|
+
var _api$textColor, _api$textColor$action;
|
|
40
|
+
if (!(editorView !== null && editorView !== void 0 && editorView.state) || !(editorView !== null && editorView !== void 0 && editorView.dispatch)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (api !== null && api !== void 0 && (_api$textColor = api.textColor) !== null && _api$textColor !== void 0 && (_api$textColor$action = _api$textColor.actions) !== null && _api$textColor$action !== void 0 && _api$textColor$action.changeColor) {
|
|
44
|
+
api.textColor.actions.changeColor(color, getInputMethodFromParentKeys(parents))(editorView.state, editorView.dispatch);
|
|
45
|
+
closeMenu === null || closeMenu === void 0 ? void 0 : closeMenu();
|
|
66
46
|
}
|
|
67
|
-
}, [editorView === null || editorView === void 0 ? void 0 : editorView.state, editorView === null || editorView === void 0 ? void 0 : editorView.dispatch, api === null || api === void 0 ? void 0 : api.textColor.actions, parents, closeMenu
|
|
47
|
+
}, [editorView === null || editorView === void 0 ? void 0 : editorView.state, editorView === null || editorView === void 0 ? void 0 : editorView.dispatch, api === null || api === void 0 ? void 0 : api.textColor.actions, parents, closeMenu]);
|
|
68
48
|
const {
|
|
69
49
|
formatMessage
|
|
70
50
|
} = useIntl();
|
|
@@ -11,7 +11,6 @@ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
|
11
11
|
import { ColorPalette, useToolbarDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
12
12
|
import Heading from '@atlaskit/heading';
|
|
13
13
|
import { Stack } from '@atlaskit/primitives/compiled';
|
|
14
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
14
|
var styles = {
|
|
16
15
|
container: "_zulp12x7"
|
|
17
16
|
};
|
|
@@ -31,36 +30,18 @@ export function TextColorMenuItem(_ref) {
|
|
|
31
30
|
palette = _useSharedPluginState.palette;
|
|
32
31
|
var _useEditorToolbar = useEditorToolbar(),
|
|
33
32
|
editorView = _useEditorToolbar.editorView;
|
|
34
|
-
// Warning! Do not destructure editorView, it will become stale
|
|
35
|
-
var _ref2 = editorView !== null && editorView !== void 0 ? editorView : {
|
|
36
|
-
state: null,
|
|
37
|
-
dispatch: null
|
|
38
|
-
},
|
|
39
|
-
state = _ref2.state,
|
|
40
|
-
dispatch = _ref2.dispatch;
|
|
41
33
|
var context = useToolbarDropdownMenu();
|
|
42
34
|
var closeMenu = context === null || context === void 0 ? void 0 : context.closeMenu;
|
|
43
35
|
var handleTextColorChange = useCallback(function (color) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
closeMenu === null || closeMenu === void 0 || closeMenu();
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
var _api$textColor2;
|
|
55
|
-
if (!state || !dispatch) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (api !== null && api !== void 0 && (_api$textColor2 = api.textColor) !== null && _api$textColor2 !== void 0 && (_api$textColor2 = _api$textColor2.actions) !== null && _api$textColor2 !== void 0 && _api$textColor2.changeColor) {
|
|
59
|
-
api.textColor.actions.changeColor(color, getInputMethodFromParentKeys(parents))(state, dispatch);
|
|
60
|
-
closeMenu === null || closeMenu === void 0 || closeMenu();
|
|
61
|
-
}
|
|
36
|
+
var _api$textColor;
|
|
37
|
+
if (!(editorView !== null && editorView !== void 0 && editorView.state) || !(editorView !== null && editorView !== void 0 && editorView.dispatch)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (api !== null && api !== void 0 && (_api$textColor = api.textColor) !== null && _api$textColor !== void 0 && (_api$textColor = _api$textColor.actions) !== null && _api$textColor !== void 0 && _api$textColor.changeColor) {
|
|
41
|
+
api.textColor.actions.changeColor(color, getInputMethodFromParentKeys(parents))(editorView.state, editorView.dispatch);
|
|
42
|
+
closeMenu === null || closeMenu === void 0 || closeMenu();
|
|
62
43
|
}
|
|
63
|
-
}, [editorView === null || editorView === void 0 ? void 0 : editorView.state, editorView === null || editorView === void 0 ? void 0 : editorView.dispatch, api === null || api === void 0 ? void 0 : api.textColor.actions, parents, closeMenu
|
|
44
|
+
}, [editorView === null || editorView === void 0 ? void 0 : editorView.state, editorView === null || editorView === void 0 ? void 0 : editorView.dispatch, api === null || api === void 0 ? void 0 : api.textColor.actions, parents, closeMenu]);
|
|
64
45
|
var _useIntl = useIntl(),
|
|
65
46
|
formatMessage = _useIntl.formatMessage;
|
|
66
47
|
return /*#__PURE__*/React.createElement(Stack, {
|
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.6",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^51.3.
|
|
32
|
+
"@atlaskit/adf-schema": "^51.3.2",
|
|
33
33
|
"@atlaskit/button": "^23.5.0",
|
|
34
34
|
"@atlaskit/css": "^0.15.0",
|
|
35
35
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"@atlaskit/heading": "^5.2.0",
|
|
47
47
|
"@atlaskit/icon": "^28.5.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
|
-
"@atlaskit/primitives": "^16.
|
|
49
|
+
"@atlaskit/primitives": "^16.1.0",
|
|
50
50
|
"@atlaskit/theme": "^21.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^13.22.0",
|
|
52
52
|
"@atlaskit/tokens": "^7.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@atlaskit/editor-common": "^110.
|
|
57
|
+
"@atlaskit/editor-common": "^110.19.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"
|