@atlaskit/editor-plugin-text-color 3.2.0 → 3.2.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 +19 -0
- package/dist/cjs/ui/FloatingToolbarComponent.js +15 -36
- package/dist/cjs/ui/PrimaryToolbarComponent.js +15 -36
- package/dist/cjs/ui/TextColorMenuItem.compiled.css +1 -1
- package/dist/cjs/ui/TextColorMenuItem.js +1 -1
- package/dist/es2019/ui/FloatingToolbarComponent.js +12 -35
- package/dist/es2019/ui/PrimaryToolbarComponent.js +13 -36
- package/dist/es2019/ui/TextColorMenuItem.compiled.css +1 -1
- package/dist/es2019/ui/TextColorMenuItem.js +1 -1
- package/dist/esm/ui/FloatingToolbarComponent.js +15 -36
- package/dist/esm/ui/PrimaryToolbarComponent.js +15 -36
- package/dist/esm/ui/TextColorMenuItem.compiled.css +1 -1
- package/dist/esm/ui/TextColorMenuItem.js +1 -1
- package/dist/types/ui/FloatingToolbarComponent.d.ts +1 -1
- package/dist/types/ui/PrimaryToolbarComponent.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingToolbarComponent.d.ts +1 -1
- package/dist/types-ts4.5/ui/PrimaryToolbarComponent.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-color
|
|
2
2
|
|
|
3
|
+
## 3.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b9f4eca29e93a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b9f4eca29e93a) -
|
|
8
|
+
ED-29114 Tidy up FG platform_editor_usesharedpluginstatewithselector for text-color,
|
|
9
|
+
text-formatting
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.2.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`bf3ab0c552ba7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf3ab0c552ba7) -
|
|
17
|
+
[ux] ED-29000 Add keyboard navigation to colour palette and minor UI fixes
|
|
18
|
+
- [`a2cd8c46a3e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2cd8c46a3e94) -
|
|
19
|
+
EDITOR-1442 Bump adf-schema
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 3.2.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.FloatingToolbarComponent =
|
|
7
|
+
exports.FloatingToolbarComponent = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
10
|
var _types = require("../types");
|
|
@@ -16,45 +16,24 @@ var FloatingToolbarSettings = {
|
|
|
16
16
|
disabled: false,
|
|
17
17
|
isReducedSpacing: true
|
|
18
18
|
};
|
|
19
|
-
var
|
|
20
|
-
var
|
|
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;
|
|
33
|
-
return {
|
|
34
|
-
color: color,
|
|
35
|
-
defaultColor: defaultColor,
|
|
36
|
-
palette: palette,
|
|
37
|
-
disabled: disabled
|
|
38
|
-
};
|
|
39
|
-
}, function (api) {
|
|
40
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['textColor']),
|
|
41
|
-
textColorState = _useSharedPluginState2.textColorState;
|
|
19
|
+
var selector = function selector(states) {
|
|
20
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
42
21
|
return {
|
|
43
|
-
color: textColorState === null ||
|
|
44
|
-
defaultColor: textColorState === null ||
|
|
45
|
-
palette: textColorState === null ||
|
|
46
|
-
disabled: textColorState === null ||
|
|
22
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
23
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
24
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
25
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
47
26
|
};
|
|
48
|
-
}
|
|
49
|
-
function FloatingToolbarComponent(_ref) {
|
|
27
|
+
};
|
|
28
|
+
var FloatingToolbarComponent = exports.FloatingToolbarComponent = function FloatingToolbarComponent(_ref) {
|
|
50
29
|
var api = _ref.api,
|
|
51
30
|
editorView = _ref.editorView,
|
|
52
31
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
53
|
-
var
|
|
54
|
-
color =
|
|
55
|
-
defaultColor =
|
|
56
|
-
palette =
|
|
57
|
-
disabled =
|
|
32
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textColor'], selector),
|
|
33
|
+
color = _useSharedPluginState.color,
|
|
34
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
35
|
+
palette = _useSharedPluginState.palette,
|
|
36
|
+
disabled = _useSharedPluginState.disabled;
|
|
58
37
|
if (color === undefined || defaultColor === undefined || palette === undefined) {
|
|
59
38
|
return null;
|
|
60
39
|
}
|
|
@@ -72,4 +51,4 @@ function FloatingToolbarComponent(_ref) {
|
|
|
72
51
|
pluginInjectionApi: api,
|
|
73
52
|
toolbarType: _types.ToolbarType.FLOATING
|
|
74
53
|
});
|
|
75
|
-
}
|
|
54
|
+
};
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.PrimaryToolbarComponent =
|
|
7
|
+
exports.PrimaryToolbarComponent = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
10
10
|
var _types = require("../types");
|
|
@@ -12,37 +12,16 @@ var _ToolbarTextColor = _interopRequireDefault(require("./ToolbarTextColor"));
|
|
|
12
12
|
// Ignored via go/ees005
|
|
13
13
|
// eslint-disable-next-line import/no-named-as-default
|
|
14
14
|
|
|
15
|
-
var
|
|
16
|
-
var
|
|
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;
|
|
29
|
-
return {
|
|
30
|
-
color: color,
|
|
31
|
-
defaultColor: defaultColor,
|
|
32
|
-
palette: palette,
|
|
33
|
-
textColorDisabled: disabled
|
|
34
|
-
};
|
|
35
|
-
}, function (api) {
|
|
36
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['textColor']),
|
|
37
|
-
textColorState = _useSharedPluginState2.textColorState;
|
|
15
|
+
var selector = function selector(states) {
|
|
16
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
38
17
|
return {
|
|
39
|
-
color: textColorState === null ||
|
|
40
|
-
defaultColor: textColorState === null ||
|
|
41
|
-
palette: textColorState === null ||
|
|
42
|
-
|
|
18
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
19
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
20
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
21
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
43
22
|
};
|
|
44
|
-
}
|
|
45
|
-
function PrimaryToolbarComponent(_ref) {
|
|
23
|
+
};
|
|
24
|
+
var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
|
|
46
25
|
var api = _ref.api,
|
|
47
26
|
isReducedSpacing = _ref.isReducedSpacing,
|
|
48
27
|
editorView = _ref.editorView,
|
|
@@ -51,11 +30,11 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
51
30
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
52
31
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
53
32
|
disabled = _ref.disabled;
|
|
54
|
-
var
|
|
55
|
-
color =
|
|
56
|
-
defaultColor =
|
|
57
|
-
palette =
|
|
58
|
-
textColorDisabled =
|
|
33
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textColor'], selector),
|
|
34
|
+
color = _useSharedPluginState.color,
|
|
35
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
36
|
+
palette = _useSharedPluginState.palette,
|
|
37
|
+
textColorDisabled = _useSharedPluginState.disabled;
|
|
59
38
|
if (color === undefined || defaultColor === undefined || palette === undefined) {
|
|
60
39
|
return null;
|
|
61
40
|
}
|
|
@@ -76,4 +55,4 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
76
55
|
pluginInjectionApi: api,
|
|
77
56
|
toolbarType: _types.ToolbarType.PRIMARY
|
|
78
57
|
});
|
|
79
|
-
}
|
|
58
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._zulp12x7{gap:var(--ds-space-075,6px)}
|
|
@@ -19,7 +19,7 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
|
19
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
20
20
|
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
21
|
var styles = {
|
|
22
|
-
container: "
|
|
22
|
+
container: "_zulp12x7"
|
|
23
23
|
};
|
|
24
24
|
function TextColorMenuItem(_ref) {
|
|
25
25
|
var api = _ref.api,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { ToolbarType } from '../types';
|
|
4
4
|
|
|
5
5
|
// Ignored via go/ees005
|
|
@@ -9,49 +9,26 @@ const FloatingToolbarSettings = {
|
|
|
9
9
|
disabled: false,
|
|
10
10
|
isReducedSpacing: true
|
|
11
11
|
};
|
|
12
|
-
const
|
|
13
|
-
|
|
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
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
color,
|
|
29
|
-
defaultColor,
|
|
30
|
-
palette,
|
|
31
|
-
disabled
|
|
32
|
-
};
|
|
33
|
-
}, api => {
|
|
34
|
-
const {
|
|
35
|
-
textColorState
|
|
36
|
-
} = useSharedPluginState(api, ['textColor']);
|
|
12
|
+
const selector = states => {
|
|
13
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
37
14
|
return {
|
|
38
|
-
color: textColorState === null ||
|
|
39
|
-
defaultColor: textColorState === null ||
|
|
40
|
-
palette: textColorState === null ||
|
|
41
|
-
disabled: textColorState === null ||
|
|
15
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
16
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
17
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
18
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
42
19
|
};
|
|
43
|
-
}
|
|
44
|
-
export
|
|
20
|
+
};
|
|
21
|
+
export const FloatingToolbarComponent = ({
|
|
45
22
|
api,
|
|
46
23
|
editorView,
|
|
47
24
|
dispatchAnalyticsEvent
|
|
48
|
-
}) {
|
|
25
|
+
}) => {
|
|
49
26
|
const {
|
|
50
27
|
color,
|
|
51
28
|
defaultColor,
|
|
52
29
|
palette,
|
|
53
30
|
disabled
|
|
54
|
-
} =
|
|
31
|
+
} = useSharedPluginStateWithSelector(api, ['textColor'], selector);
|
|
55
32
|
if (color === undefined || defaultColor === undefined || palette === undefined) {
|
|
56
33
|
return null;
|
|
57
34
|
}
|
|
@@ -69,4 +46,4 @@ export function FloatingToolbarComponent({
|
|
|
69
46
|
pluginInjectionApi: api,
|
|
70
47
|
toolbarType: ToolbarType.FLOATING
|
|
71
48
|
});
|
|
72
|
-
}
|
|
49
|
+
};
|
|
@@ -1,43 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { ToolbarType } from '../types';
|
|
4
4
|
|
|
5
5
|
// Ignored via go/ees005
|
|
6
6
|
// eslint-disable-next-line import/no-named-as-default
|
|
7
7
|
import ToolbarTextColor from './ToolbarTextColor';
|
|
8
|
-
const
|
|
9
|
-
|
|
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
|
-
});
|
|
23
|
-
return {
|
|
24
|
-
color,
|
|
25
|
-
defaultColor,
|
|
26
|
-
palette,
|
|
27
|
-
textColorDisabled: disabled
|
|
28
|
-
};
|
|
29
|
-
}, api => {
|
|
30
|
-
const {
|
|
31
|
-
textColorState
|
|
32
|
-
} = useSharedPluginState(api, ['textColor']);
|
|
8
|
+
const selector = states => {
|
|
9
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
33
10
|
return {
|
|
34
|
-
color: textColorState === null ||
|
|
35
|
-
defaultColor: textColorState === null ||
|
|
36
|
-
palette: textColorState === null ||
|
|
37
|
-
|
|
11
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
12
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
13
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
14
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
38
15
|
};
|
|
39
|
-
}
|
|
40
|
-
export
|
|
16
|
+
};
|
|
17
|
+
export const PrimaryToolbarComponent = ({
|
|
41
18
|
api,
|
|
42
19
|
isReducedSpacing,
|
|
43
20
|
editorView,
|
|
@@ -46,13 +23,13 @@ export function PrimaryToolbarComponent({
|
|
|
46
23
|
popupsBoundariesElement,
|
|
47
24
|
dispatchAnalyticsEvent,
|
|
48
25
|
disabled
|
|
49
|
-
}) {
|
|
26
|
+
}) => {
|
|
50
27
|
const {
|
|
51
28
|
color,
|
|
52
29
|
defaultColor,
|
|
53
30
|
palette,
|
|
54
|
-
textColorDisabled
|
|
55
|
-
} =
|
|
31
|
+
disabled: textColorDisabled
|
|
32
|
+
} = useSharedPluginStateWithSelector(api, ['textColor'], selector);
|
|
56
33
|
if (color === undefined || defaultColor === undefined || palette === undefined) {
|
|
57
34
|
return null;
|
|
58
35
|
}
|
|
@@ -73,4 +50,4 @@ export function PrimaryToolbarComponent({
|
|
|
73
50
|
pluginInjectionApi: api,
|
|
74
51
|
toolbarType: ToolbarType.PRIMARY
|
|
75
52
|
});
|
|
76
|
-
}
|
|
53
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._zulp12x7{gap:var(--ds-space-075,6px)}
|
|
@@ -11,7 +11,7 @@ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
|
11
11
|
import { ColorPalette, useToolbarDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
12
12
|
import { Stack, Text } from '@atlaskit/primitives/compiled';
|
|
13
13
|
const styles = {
|
|
14
|
-
container: "
|
|
14
|
+
container: "_zulp12x7"
|
|
15
15
|
};
|
|
16
16
|
export function TextColorMenuItem({
|
|
17
17
|
api,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { ToolbarType } from '../types';
|
|
4
4
|
|
|
5
5
|
// Ignored via go/ees005
|
|
@@ -9,45 +9,24 @@ var FloatingToolbarSettings = {
|
|
|
9
9
|
disabled: false,
|
|
10
10
|
isReducedSpacing: true
|
|
11
11
|
};
|
|
12
|
-
var
|
|
13
|
-
var
|
|
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;
|
|
26
|
-
return {
|
|
27
|
-
color: color,
|
|
28
|
-
defaultColor: defaultColor,
|
|
29
|
-
palette: palette,
|
|
30
|
-
disabled: disabled
|
|
31
|
-
};
|
|
32
|
-
}, function (api) {
|
|
33
|
-
var _useSharedPluginState2 = useSharedPluginState(api, ['textColor']),
|
|
34
|
-
textColorState = _useSharedPluginState2.textColorState;
|
|
12
|
+
var selector = function selector(states) {
|
|
13
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
35
14
|
return {
|
|
36
|
-
color: textColorState === null ||
|
|
37
|
-
defaultColor: textColorState === null ||
|
|
38
|
-
palette: textColorState === null ||
|
|
39
|
-
disabled: textColorState === null ||
|
|
15
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
16
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
17
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
18
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
40
19
|
};
|
|
41
|
-
}
|
|
42
|
-
export function FloatingToolbarComponent(_ref) {
|
|
20
|
+
};
|
|
21
|
+
export var FloatingToolbarComponent = function FloatingToolbarComponent(_ref) {
|
|
43
22
|
var api = _ref.api,
|
|
44
23
|
editorView = _ref.editorView,
|
|
45
24
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
46
|
-
var
|
|
47
|
-
color =
|
|
48
|
-
defaultColor =
|
|
49
|
-
palette =
|
|
50
|
-
disabled =
|
|
25
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['textColor'], selector),
|
|
26
|
+
color = _useSharedPluginState.color,
|
|
27
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
28
|
+
palette = _useSharedPluginState.palette,
|
|
29
|
+
disabled = _useSharedPluginState.disabled;
|
|
51
30
|
if (color === undefined || defaultColor === undefined || palette === undefined) {
|
|
52
31
|
return null;
|
|
53
32
|
}
|
|
@@ -65,4 +44,4 @@ export function FloatingToolbarComponent(_ref) {
|
|
|
65
44
|
pluginInjectionApi: api,
|
|
66
45
|
toolbarType: ToolbarType.FLOATING
|
|
67
46
|
});
|
|
68
|
-
}
|
|
47
|
+
};
|
|
@@ -1,41 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { ToolbarType } from '../types';
|
|
4
4
|
|
|
5
5
|
// Ignored via go/ees005
|
|
6
6
|
// eslint-disable-next-line import/no-named-as-default
|
|
7
7
|
import ToolbarTextColor from './ToolbarTextColor';
|
|
8
|
-
var
|
|
9
|
-
var
|
|
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;
|
|
22
|
-
return {
|
|
23
|
-
color: color,
|
|
24
|
-
defaultColor: defaultColor,
|
|
25
|
-
palette: palette,
|
|
26
|
-
textColorDisabled: disabled
|
|
27
|
-
};
|
|
28
|
-
}, function (api) {
|
|
29
|
-
var _useSharedPluginState2 = useSharedPluginState(api, ['textColor']),
|
|
30
|
-
textColorState = _useSharedPluginState2.textColorState;
|
|
8
|
+
var selector = function selector(states) {
|
|
9
|
+
var _states$textColorStat, _states$textColorStat2, _states$textColorStat3, _states$textColorStat4;
|
|
31
10
|
return {
|
|
32
|
-
color: textColorState === null ||
|
|
33
|
-
defaultColor: textColorState === null ||
|
|
34
|
-
palette: textColorState === null ||
|
|
35
|
-
|
|
11
|
+
color: (_states$textColorStat = states.textColorState) === null || _states$textColorStat === void 0 ? void 0 : _states$textColorStat.color,
|
|
12
|
+
defaultColor: (_states$textColorStat2 = states.textColorState) === null || _states$textColorStat2 === void 0 ? void 0 : _states$textColorStat2.defaultColor,
|
|
13
|
+
palette: (_states$textColorStat3 = states.textColorState) === null || _states$textColorStat3 === void 0 ? void 0 : _states$textColorStat3.palette,
|
|
14
|
+
disabled: (_states$textColorStat4 = states.textColorState) === null || _states$textColorStat4 === void 0 ? void 0 : _states$textColorStat4.disabled
|
|
36
15
|
};
|
|
37
|
-
}
|
|
38
|
-
export function PrimaryToolbarComponent(_ref) {
|
|
16
|
+
};
|
|
17
|
+
export var PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
|
|
39
18
|
var api = _ref.api,
|
|
40
19
|
isReducedSpacing = _ref.isReducedSpacing,
|
|
41
20
|
editorView = _ref.editorView,
|
|
@@ -44,11 +23,11 @@ export function PrimaryToolbarComponent(_ref) {
|
|
|
44
23
|
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
45
24
|
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
46
25
|
disabled = _ref.disabled;
|
|
47
|
-
var
|
|
48
|
-
color =
|
|
49
|
-
defaultColor =
|
|
50
|
-
palette =
|
|
51
|
-
textColorDisabled =
|
|
26
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['textColor'], selector),
|
|
27
|
+
color = _useSharedPluginState.color,
|
|
28
|
+
defaultColor = _useSharedPluginState.defaultColor,
|
|
29
|
+
palette = _useSharedPluginState.palette,
|
|
30
|
+
textColorDisabled = _useSharedPluginState.disabled;
|
|
52
31
|
if (color === undefined || defaultColor === undefined || palette === undefined) {
|
|
53
32
|
return null;
|
|
54
33
|
}
|
|
@@ -69,4 +48,4 @@ export function PrimaryToolbarComponent(_ref) {
|
|
|
69
48
|
pluginInjectionApi: api,
|
|
70
49
|
toolbarType: ToolbarType.PRIMARY
|
|
71
50
|
});
|
|
72
|
-
}
|
|
51
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._zulp12x7{gap:var(--ds-space-075,6px)}
|
|
@@ -11,7 +11,7 @@ import { hexToEditorTextPaletteColor } from '@atlaskit/editor-palette';
|
|
|
11
11
|
import { ColorPalette, useToolbarDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
12
12
|
import { Stack, Text } from '@atlaskit/primitives/compiled';
|
|
13
13
|
var styles = {
|
|
14
|
-
container: "
|
|
14
|
+
container: "_zulp12x7"
|
|
15
15
|
};
|
|
16
16
|
export function TextColorMenuItem(_ref) {
|
|
17
17
|
var api = _ref.api,
|
|
@@ -8,5 +8,5 @@ interface FloatingToolbarComponentProps {
|
|
|
8
8
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
9
9
|
editorView: EditorView;
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
11
|
+
export declare const FloatingToolbarComponent: ({ api, editorView, dispatchAnalyticsEvent, }: FloatingToolbarComponentProps) => React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -13,5 +13,5 @@ interface PrimaryToolbarComponentProps {
|
|
|
13
13
|
popupsMountPoint?: HTMLElement;
|
|
14
14
|
popupsScrollableElement?: HTMLElement;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
16
|
+
export declare const PrimaryToolbarComponent: ({ api, isReducedSpacing, editorView, popupsMountPoint, popupsScrollableElement, popupsBoundariesElement, dispatchAnalyticsEvent, disabled, }: PrimaryToolbarComponentProps) => React.JSX.Element | null;
|
|
17
17
|
export {};
|
|
@@ -8,5 +8,5 @@ interface FloatingToolbarComponentProps {
|
|
|
8
8
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
9
9
|
editorView: EditorView;
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
11
|
+
export declare const FloatingToolbarComponent: ({ api, editorView, dispatchAnalyticsEvent, }: FloatingToolbarComponentProps) => React.JSX.Element | null;
|
|
12
12
|
export {};
|
|
@@ -13,5 +13,5 @@ interface PrimaryToolbarComponentProps {
|
|
|
13
13
|
popupsMountPoint?: HTMLElement;
|
|
14
14
|
popupsScrollableElement?: HTMLElement;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
16
|
+
export declare const PrimaryToolbarComponent: ({ api, isReducedSpacing, editorView, popupsMountPoint, popupsScrollableElement, popupsBoundariesElement, dispatchAnalyticsEvent, disabled, }: PrimaryToolbarComponentProps) => React.JSX.Element | null;
|
|
17
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-color",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
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": "^50.2.
|
|
32
|
+
"@atlaskit/adf-schema": "^50.2.3",
|
|
33
33
|
"@atlaskit/css": "^0.12.0",
|
|
34
34
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
@@ -40,19 +40,19 @@
|
|
|
40
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
42
42
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
43
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
43
|
+
"@atlaskit/editor-toolbar": "^0.5.0",
|
|
44
44
|
"@atlaskit/editor-toolbar-model": "^0.1.0",
|
|
45
45
|
"@atlaskit/icon": "^28.1.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/primitives": "^14.12.0",
|
|
48
48
|
"@atlaskit/theme": "^20.0.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^11.
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^11.9.0",
|
|
50
50
|
"@atlaskit/tokens": "^6.1.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@emotion/react": "^11.7.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@atlaskit/editor-common": "^107.
|
|
55
|
+
"@atlaskit/editor-common": "^107.33.0",
|
|
56
56
|
"react": "^18.2.0",
|
|
57
57
|
"react-dom": "^18.2.0",
|
|
58
58
|
"react-intl-next": "npm:react-intl@^5.18.1"
|