@atlaskit/editor-plugin-text-color 3.0.0 → 3.0.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 +15 -0
- package/dist/cjs/ui/FloatingToolbarComponent.js +15 -7
- package/dist/cjs/ui/PrimaryToolbarComponent.js +16 -8
- package/dist/es2019/ui/FloatingToolbarComponent.js +15 -6
- package/dist/es2019/ui/PrimaryToolbarComponent.js +16 -7
- package/dist/esm/ui/FloatingToolbarComponent.js +16 -8
- package/dist/esm/ui/PrimaryToolbarComponent.js +17 -9
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-color
|
|
2
2
|
|
|
3
|
+
## 3.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#183158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/183158)
|
|
8
|
+
[`d6096ec5c8ad9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6096ec5c8ad9) -
|
|
9
|
+
Migrate to useSharedPluginStateWithSelector
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.0.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 3.0.0
|
|
4
19
|
|
|
5
20
|
### Major Changes
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.FloatingToolbarComponent = FloatingToolbarComponent;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
11
10
|
var _types = require("../types");
|
|
12
11
|
var _ToolbarTextColor = _interopRequireDefault(require("./ToolbarTextColor"));
|
|
13
12
|
// Ignored via go/ees005
|
|
@@ -18,10 +17,19 @@ var FloatingToolbarSettings = {
|
|
|
18
17
|
isReducedSpacing: true
|
|
19
18
|
};
|
|
20
19
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textColor'], function (states) {
|
|
21
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
22
|
+
return {
|
|
23
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
24
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
25
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
26
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
27
|
+
};
|
|
28
|
+
}),
|
|
29
|
+
color = _useSharedPluginState.color,
|
|
30
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
31
|
+
palette = _useSharedPluginState.palette,
|
|
32
|
+
disabled = _useSharedPluginState.disabled;
|
|
25
33
|
return {
|
|
26
34
|
color: color,
|
|
27
35
|
defaultColor: defaultColor,
|
|
@@ -29,8 +37,8 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
29
37
|
disabled: disabled
|
|
30
38
|
};
|
|
31
39
|
}, function (api) {
|
|
32
|
-
var
|
|
33
|
-
textColorState =
|
|
40
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['textColor']),
|
|
41
|
+
textColorState = _useSharedPluginState2.textColorState;
|
|
34
42
|
return {
|
|
35
43
|
color: textColorState === null || textColorState === void 0 ? void 0 : textColorState.color,
|
|
36
44
|
defaultColor: textColorState === null || textColorState === void 0 ? void 0 : textColorState.defaultColor,
|
|
@@ -7,26 +7,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.PrimaryToolbarComponent = PrimaryToolbarComponent;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
11
10
|
var _types = require("../types");
|
|
12
11
|
var _ToolbarTextColor = _interopRequireDefault(require("./ToolbarTextColor"));
|
|
13
12
|
// Ignored via go/ees005
|
|
14
13
|
// eslint-disable-next-line import/no-named-as-default
|
|
15
14
|
|
|
16
15
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textColor'], function (states) {
|
|
17
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
18
|
+
return {
|
|
19
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
20
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
21
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
22
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
23
|
+
};
|
|
24
|
+
}),
|
|
25
|
+
color = _useSharedPluginState.color,
|
|
26
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
27
|
+
palette = _useSharedPluginState.palette,
|
|
28
|
+
disabled = _useSharedPluginState.disabled;
|
|
21
29
|
return {
|
|
22
30
|
color: color,
|
|
23
31
|
defaultColor: defaultColor,
|
|
24
32
|
palette: palette,
|
|
25
|
-
textColorDisabled:
|
|
33
|
+
textColorDisabled: disabled
|
|
26
34
|
};
|
|
27
35
|
}, function (api) {
|
|
28
|
-
var
|
|
29
|
-
textColorState =
|
|
36
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['textColor']),
|
|
37
|
+
textColorState = _useSharedPluginState2.textColorState;
|
|
30
38
|
return {
|
|
31
39
|
color: textColorState === null || textColorState === void 0 ? void 0 : textColorState.color,
|
|
32
40
|
defaultColor: textColorState === null || textColorState === void 0 ? void 0 : textColorState.defaultColor,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
2
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { ToolbarType } from '../types';
|
|
5
4
|
|
|
6
5
|
// Ignored via go/ees005
|
|
@@ -11,10 +10,20 @@ const FloatingToolbarSettings = {
|
|
|
11
10
|
isReducedSpacing: true
|
|
12
11
|
};
|
|
13
12
|
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const {
|
|
14
|
+
color,
|
|
15
|
+
defaultColor,
|
|
16
|
+
palette,
|
|
17
|
+
disabled
|
|
18
|
+
} = useSharedPluginStateWithSelector(api, ['textColor'], states => {
|
|
19
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
20
|
+
return {
|
|
21
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
22
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
23
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
24
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
25
|
+
};
|
|
26
|
+
});
|
|
18
27
|
return {
|
|
19
28
|
color,
|
|
20
29
|
defaultColor,
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
2
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { ToolbarType } from '../types';
|
|
5
4
|
|
|
6
5
|
// Ignored via go/ees005
|
|
7
6
|
// eslint-disable-next-line import/no-named-as-default
|
|
8
7
|
import ToolbarTextColor from './ToolbarTextColor';
|
|
9
8
|
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
const {
|
|
10
|
+
color,
|
|
11
|
+
defaultColor,
|
|
12
|
+
palette,
|
|
13
|
+
disabled
|
|
14
|
+
} = useSharedPluginStateWithSelector(api, ['textColor'], states => {
|
|
15
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
16
|
+
return {
|
|
17
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
18
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
19
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
20
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
21
|
+
};
|
|
22
|
+
});
|
|
14
23
|
return {
|
|
15
24
|
color,
|
|
16
25
|
defaultColor,
|
|
17
26
|
palette,
|
|
18
|
-
textColorDisabled
|
|
27
|
+
textColorDisabled: disabled
|
|
19
28
|
};
|
|
20
29
|
}, api => {
|
|
21
30
|
const {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
2
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { ToolbarType } from '../types';
|
|
5
4
|
|
|
6
5
|
// Ignored via go/ees005
|
|
@@ -11,10 +10,19 @@ var FloatingToolbarSettings = {
|
|
|
11
10
|
isReducedSpacing: true
|
|
12
11
|
};
|
|
13
12
|
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['textColor'], function (states) {
|
|
14
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
15
|
+
return {
|
|
16
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
17
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
18
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
19
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
20
|
+
};
|
|
21
|
+
}),
|
|
22
|
+
color = _useSharedPluginState.color,
|
|
23
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
24
|
+
palette = _useSharedPluginState.palette,
|
|
25
|
+
disabled = _useSharedPluginState.disabled;
|
|
18
26
|
return {
|
|
19
27
|
color: color,
|
|
20
28
|
defaultColor: defaultColor,
|
|
@@ -22,8 +30,8 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
|
22
30
|
disabled: disabled
|
|
23
31
|
};
|
|
24
32
|
}, function (api) {
|
|
25
|
-
var
|
|
26
|
-
textColorState =
|
|
33
|
+
var _useSharedPluginState2 = useSharedPluginState(api, ['textColor']),
|
|
34
|
+
textColorState = _useSharedPluginState2.textColorState;
|
|
27
35
|
return {
|
|
28
36
|
color: textColorState === null || textColorState === void 0 ? void 0 : textColorState.color,
|
|
29
37
|
defaultColor: textColorState === null || textColorState === void 0 ? void 0 : textColorState.defaultColor,
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
3
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
2
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
3
|
import { ToolbarType } from '../types';
|
|
5
4
|
|
|
6
5
|
// Ignored via go/ees005
|
|
7
6
|
// eslint-disable-next-line import/no-named-as-default
|
|
8
7
|
import ToolbarTextColor from './ToolbarTextColor';
|
|
9
8
|
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['textColor'], function (states) {
|
|
10
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
11
|
+
return {
|
|
12
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
13
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
14
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
15
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
16
|
+
};
|
|
17
|
+
}),
|
|
18
|
+
color = _useSharedPluginState.color,
|
|
19
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
20
|
+
palette = _useSharedPluginState.palette,
|
|
21
|
+
disabled = _useSharedPluginState.disabled;
|
|
14
22
|
return {
|
|
15
23
|
color: color,
|
|
16
24
|
defaultColor: defaultColor,
|
|
17
25
|
palette: palette,
|
|
18
|
-
textColorDisabled:
|
|
26
|
+
textColorDisabled: disabled
|
|
19
27
|
};
|
|
20
28
|
}, function (api) {
|
|
21
|
-
var
|
|
22
|
-
textColorState =
|
|
29
|
+
var _useSharedPluginState2 = useSharedPluginState(api, ['textColor']),
|
|
30
|
+
textColorState = _useSharedPluginState2.textColorState;
|
|
23
31
|
return {
|
|
24
32
|
color: textColorState === null || textColorState === void 0 ? void 0 : textColorState.color,
|
|
25
33
|
defaultColor: textColorState === null || textColorState === void 0 ? void 0 : textColorState.defaultColor,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Text color plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,16 +40,16 @@
|
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
42
42
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
43
|
-
"@atlaskit/icon": "^27.
|
|
43
|
+
"@atlaskit/icon": "^27.3.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
|
-
"@atlaskit/theme": "^
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/theme": "^19.0.0",
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^9.1.0",
|
|
47
47
|
"@atlaskit/tokens": "^5.4.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@emotion/react": "^11.7.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^107.
|
|
52
|
+
"@atlaskit/editor-common": "^107.7.0",
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-dom": "^18.2.0",
|
|
55
55
|
"react-intl-next": "npm:react-intl@^5.18.1"
|