@atlaskit/editor-plugin-text-formatting 3.0.25 → 3.0.27
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 +17 -0
- package/dist/cjs/ui/FloatingToolbarComponent.js +27 -105
- package/dist/cjs/ui/PrimaryToolbarComponent.js +30 -109
- package/dist/cjs/ui/Toolbar/components/Component.js +13 -1
- package/dist/cjs/ui/toolbar-components.js +12 -2
- package/dist/es2019/ui/FloatingToolbarComponent.js +28 -108
- package/dist/es2019/ui/PrimaryToolbarComponent.js +31 -111
- package/dist/es2019/ui/Toolbar/components/Component.js +13 -2
- package/dist/es2019/ui/toolbar-components.js +14 -4
- package/dist/esm/ui/FloatingToolbarComponent.js +28 -106
- package/dist/esm/ui/PrimaryToolbarComponent.js +30 -108
- package/dist/esm/ui/Toolbar/components/Component.js +14 -2
- package/dist/esm/ui/toolbar-components.js +14 -4
- package/dist/types/ui/PrimaryToolbarComponent.d.ts +2 -2
- package/dist/types/ui/Toolbar/components/Component.d.ts +6 -0
- package/dist/types-ts4.5/ui/PrimaryToolbarComponent.d.ts +2 -2
- package/dist/types-ts4.5/ui/Toolbar/components/Component.d.ts +6 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-formatting
|
|
2
2
|
|
|
3
|
+
## 3.0.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`51f3f2db61f6e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/51f3f2db61f6e) -
|
|
8
|
+
Update toolbar config across plugins
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 3.0.26
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`b9f4eca29e93a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b9f4eca29e93a) -
|
|
16
|
+
ED-29114 Tidy up FG platform_editor_usesharedpluginstatewithselector for text-color,
|
|
17
|
+
text-formatting
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 3.0.25
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -36,118 +36,40 @@ var FloatingToolbarSettings = {
|
|
|
36
36
|
moreButtonLabel: '',
|
|
37
37
|
toolbarType: _types2.ToolbarType.FLOATING
|
|
38
38
|
};
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var _states$textFormattin, _states$textFormattin2, _states$textFormattin3, _states$textFormattin4, _states$textFormattin5, _states$textFormattin6, _states$textFormattin7, _states$textFormattin8, _states$textFormattin9, _states$textFormattin0, _states$textFormattin1, _states$textFormattin10, _states$textFormattin11, _states$textFormattin12, _states$textFormattin13, _states$textFormattin14, _states$textFormattin15, _states$textFormattin16, _states$textFormattin17, _states$textFormattin18, _states$textFormattin19, _states$textFormattin20, _states$textFormattin21;
|
|
42
|
-
return {
|
|
43
|
-
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
44
|
-
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
45
|
-
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
46
|
-
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
47
|
-
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
48
|
-
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
49
|
-
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
50
|
-
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
51
|
-
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
52
|
-
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
53
|
-
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
54
|
-
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
55
|
-
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
56
|
-
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
57
|
-
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
58
|
-
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
59
|
-
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
60
|
-
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
61
|
-
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
62
|
-
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
63
|
-
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
64
|
-
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
65
|
-
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
66
|
-
};
|
|
67
|
-
}),
|
|
68
|
-
codeActive = _useSharedPluginState.codeActive,
|
|
69
|
-
codeDisabled = _useSharedPluginState.codeDisabled,
|
|
70
|
-
codeHidden = _useSharedPluginState.codeHidden,
|
|
71
|
-
emActive = _useSharedPluginState.emActive,
|
|
72
|
-
emDisabled = _useSharedPluginState.emDisabled,
|
|
73
|
-
emHidden = _useSharedPluginState.emHidden,
|
|
74
|
-
formattingIsPresent = _useSharedPluginState.formattingIsPresent,
|
|
75
|
-
isInitialised = _useSharedPluginState.isInitialised,
|
|
76
|
-
strikeActive = _useSharedPluginState.strikeActive,
|
|
77
|
-
strikeDisabled = _useSharedPluginState.strikeDisabled,
|
|
78
|
-
strikeHidden = _useSharedPluginState.strikeHidden,
|
|
79
|
-
strongActive = _useSharedPluginState.strongActive,
|
|
80
|
-
strongDisabled = _useSharedPluginState.strongDisabled,
|
|
81
|
-
strongHidden = _useSharedPluginState.strongHidden,
|
|
82
|
-
subscriptActive = _useSharedPluginState.subscriptActive,
|
|
83
|
-
subscriptDisabled = _useSharedPluginState.subscriptDisabled,
|
|
84
|
-
subscriptHidden = _useSharedPluginState.subscriptHidden,
|
|
85
|
-
superscriptActive = _useSharedPluginState.superscriptActive,
|
|
86
|
-
superscriptDisabled = _useSharedPluginState.superscriptDisabled,
|
|
87
|
-
superscriptHidden = _useSharedPluginState.superscriptHidden,
|
|
88
|
-
underlineActive = _useSharedPluginState.underlineActive,
|
|
89
|
-
underlineDisabled = _useSharedPluginState.underlineDisabled,
|
|
90
|
-
underlineHidden = _useSharedPluginState.underlineHidden;
|
|
91
|
-
return {
|
|
92
|
-
isInitialised: Boolean(isInitialised),
|
|
93
|
-
formattingIsPresent: formattingIsPresent,
|
|
94
|
-
emActive: emActive,
|
|
95
|
-
emDisabled: emDisabled,
|
|
96
|
-
emHidden: emHidden,
|
|
97
|
-
codeActive: codeActive,
|
|
98
|
-
codeDisabled: codeDisabled,
|
|
99
|
-
codeHidden: codeHidden,
|
|
100
|
-
underlineActive: underlineActive,
|
|
101
|
-
underlineDisabled: underlineDisabled,
|
|
102
|
-
underlineHidden: underlineHidden,
|
|
103
|
-
strikeActive: strikeActive,
|
|
104
|
-
strikeDisabled: strikeDisabled,
|
|
105
|
-
strikeHidden: strikeHidden,
|
|
106
|
-
strongActive: strongActive,
|
|
107
|
-
strongDisabled: strongDisabled,
|
|
108
|
-
strongHidden: strongHidden,
|
|
109
|
-
superscriptActive: superscriptActive,
|
|
110
|
-
superscriptDisabled: superscriptDisabled,
|
|
111
|
-
superscriptHidden: superscriptHidden,
|
|
112
|
-
subscriptActive: subscriptActive,
|
|
113
|
-
subscriptDisabled: subscriptDisabled,
|
|
114
|
-
subscriptHidden: subscriptHidden
|
|
115
|
-
};
|
|
116
|
-
}, function (api) {
|
|
117
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['textFormatting']),
|
|
118
|
-
textFormattingState = _useSharedPluginState2.textFormattingState;
|
|
39
|
+
var selector = function selector(states) {
|
|
40
|
+
var _states$textFormattin, _states$textFormattin2, _states$textFormattin3, _states$textFormattin4, _states$textFormattin5, _states$textFormattin6, _states$textFormattin7, _states$textFormattin8, _states$textFormattin9, _states$textFormattin0, _states$textFormattin1, _states$textFormattin10, _states$textFormattin11, _states$textFormattin12, _states$textFormattin13, _states$textFormattin14, _states$textFormattin15, _states$textFormattin16, _states$textFormattin17, _states$textFormattin18, _states$textFormattin19, _states$textFormattin20, _states$textFormattin21;
|
|
119
41
|
return {
|
|
120
|
-
isInitialised: Boolean(textFormattingState === null ||
|
|
121
|
-
formattingIsPresent: textFormattingState === null ||
|
|
122
|
-
emActive: textFormattingState === null ||
|
|
123
|
-
emDisabled: textFormattingState === null ||
|
|
124
|
-
emHidden: textFormattingState === null ||
|
|
125
|
-
codeActive: textFormattingState === null ||
|
|
126
|
-
codeDisabled: textFormattingState === null ||
|
|
127
|
-
codeHidden: textFormattingState === null ||
|
|
128
|
-
underlineActive: textFormattingState === null ||
|
|
129
|
-
underlineDisabled: textFormattingState === null ||
|
|
130
|
-
underlineHidden: textFormattingState === null ||
|
|
131
|
-
strikeActive: textFormattingState === null ||
|
|
132
|
-
strikeDisabled: textFormattingState === null ||
|
|
133
|
-
strikeHidden: textFormattingState === null ||
|
|
134
|
-
strongActive: textFormattingState === null ||
|
|
135
|
-
strongDisabled: textFormattingState === null ||
|
|
136
|
-
strongHidden: textFormattingState === null ||
|
|
137
|
-
superscriptActive: textFormattingState === null ||
|
|
138
|
-
superscriptDisabled: textFormattingState === null ||
|
|
139
|
-
superscriptHidden: textFormattingState === null ||
|
|
140
|
-
subscriptActive: textFormattingState === null ||
|
|
141
|
-
subscriptDisabled: textFormattingState === null ||
|
|
142
|
-
subscriptHidden: textFormattingState === null ||
|
|
42
|
+
isInitialised: Boolean((_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised),
|
|
43
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
44
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
45
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
46
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
47
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
48
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
49
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
50
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
51
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
52
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
53
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
54
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
55
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
56
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
57
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
58
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
59
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
60
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
61
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
62
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
63
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
64
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
143
65
|
};
|
|
144
|
-
}
|
|
66
|
+
};
|
|
145
67
|
var FloatingToolbarTextFormat = function FloatingToolbarTextFormat(_ref) {
|
|
146
68
|
var api = _ref.api,
|
|
147
69
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
148
70
|
editorView = _ref.editorView,
|
|
149
71
|
intl = _ref.intl;
|
|
150
|
-
var textFormattingState =
|
|
72
|
+
var textFormattingState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textFormatting'], selector);
|
|
151
73
|
var formattingIsPresent = textFormattingState.formattingIsPresent,
|
|
152
74
|
formattingIconState = (0, _objectWithoutProperties2.default)(textFormattingState, _excluded);
|
|
153
75
|
var defaultIcons = (0, _formattingIcons.useFormattingIcons)({
|
|
@@ -4,119 +4,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.PrimaryToolbarComponent =
|
|
8
|
-
exports.PrimaryToolbarComponentMemoized = void 0;
|
|
7
|
+
exports.PrimaryToolbarComponentMemoized = exports.PrimaryToolbarComponent = void 0;
|
|
9
8
|
var _react = _interopRequireDefault(require("react"));
|
|
10
9
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
10
|
var _Toolbar = _interopRequireDefault(require("./Toolbar"));
|
|
12
11
|
var _types = require("./Toolbar/types");
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var _states$textFormattin, _states$textFormattin2, _states$textFormattin3, _states$textFormattin4, _states$textFormattin5, _states$textFormattin6, _states$textFormattin7, _states$textFormattin8, _states$textFormattin9, _states$textFormattin0, _states$textFormattin1, _states$textFormattin10, _states$textFormattin11, _states$textFormattin12, _states$textFormattin13, _states$textFormattin14, _states$textFormattin15, _states$textFormattin16, _states$textFormattin17, _states$textFormattin18, _states$textFormattin19, _states$textFormattin20, _states$textFormattin21;
|
|
16
|
-
return {
|
|
17
|
-
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
18
|
-
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
19
|
-
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
20
|
-
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
21
|
-
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
22
|
-
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
23
|
-
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
24
|
-
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
25
|
-
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
26
|
-
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
27
|
-
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
28
|
-
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
29
|
-
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
30
|
-
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
31
|
-
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
32
|
-
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
33
|
-
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
34
|
-
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
35
|
-
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
36
|
-
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
37
|
-
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
38
|
-
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
39
|
-
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
40
|
-
};
|
|
41
|
-
}),
|
|
42
|
-
codeActive = _useSharedPluginState.codeActive,
|
|
43
|
-
codeDisabled = _useSharedPluginState.codeDisabled,
|
|
44
|
-
codeHidden = _useSharedPluginState.codeHidden,
|
|
45
|
-
emActive = _useSharedPluginState.emActive,
|
|
46
|
-
emDisabled = _useSharedPluginState.emDisabled,
|
|
47
|
-
emHidden = _useSharedPluginState.emHidden,
|
|
48
|
-
formattingIsPresent = _useSharedPluginState.formattingIsPresent,
|
|
49
|
-
isInitialised = _useSharedPluginState.isInitialised,
|
|
50
|
-
strikeActive = _useSharedPluginState.strikeActive,
|
|
51
|
-
strikeDisabled = _useSharedPluginState.strikeDisabled,
|
|
52
|
-
strikeHidden = _useSharedPluginState.strikeHidden,
|
|
53
|
-
strongActive = _useSharedPluginState.strongActive,
|
|
54
|
-
strongDisabled = _useSharedPluginState.strongDisabled,
|
|
55
|
-
strongHidden = _useSharedPluginState.strongHidden,
|
|
56
|
-
subscriptActive = _useSharedPluginState.subscriptActive,
|
|
57
|
-
subscriptDisabled = _useSharedPluginState.subscriptDisabled,
|
|
58
|
-
subscriptHidden = _useSharedPluginState.subscriptHidden,
|
|
59
|
-
superscriptActive = _useSharedPluginState.superscriptActive,
|
|
60
|
-
superscriptDisabled = _useSharedPluginState.superscriptDisabled,
|
|
61
|
-
superscriptHidden = _useSharedPluginState.superscriptHidden,
|
|
62
|
-
underlineActive = _useSharedPluginState.underlineActive,
|
|
63
|
-
underlineDisabled = _useSharedPluginState.underlineDisabled,
|
|
64
|
-
underlineHidden = _useSharedPluginState.underlineHidden;
|
|
12
|
+
var selector = function selector(states) {
|
|
13
|
+
var _states$textFormattin, _states$textFormattin2, _states$textFormattin3, _states$textFormattin4, _states$textFormattin5, _states$textFormattin6, _states$textFormattin7, _states$textFormattin8, _states$textFormattin9, _states$textFormattin0, _states$textFormattin1, _states$textFormattin10, _states$textFormattin11, _states$textFormattin12, _states$textFormattin13, _states$textFormattin14, _states$textFormattin15, _states$textFormattin16, _states$textFormattin17, _states$textFormattin18, _states$textFormattin19, _states$textFormattin20, _states$textFormattin21;
|
|
65
14
|
return {
|
|
66
|
-
isInitialised: Boolean(isInitialised),
|
|
67
|
-
formattingIsPresent: formattingIsPresent,
|
|
68
|
-
emActive: emActive,
|
|
69
|
-
emDisabled: emDisabled,
|
|
70
|
-
emHidden: emHidden,
|
|
71
|
-
codeActive: codeActive,
|
|
72
|
-
codeDisabled: codeDisabled,
|
|
73
|
-
codeHidden: codeHidden,
|
|
74
|
-
underlineActive: underlineActive,
|
|
75
|
-
underlineDisabled: underlineDisabled,
|
|
76
|
-
underlineHidden: underlineHidden,
|
|
77
|
-
strikeActive: strikeActive,
|
|
78
|
-
strikeDisabled: strikeDisabled,
|
|
79
|
-
strikeHidden: strikeHidden,
|
|
80
|
-
strongActive: strongActive,
|
|
81
|
-
strongDisabled: strongDisabled,
|
|
82
|
-
strongHidden: strongHidden,
|
|
83
|
-
superscriptActive: superscriptActive,
|
|
84
|
-
superscriptDisabled: superscriptDisabled,
|
|
85
|
-
superscriptHidden: superscriptHidden,
|
|
86
|
-
subscriptActive: subscriptActive,
|
|
87
|
-
subscriptDisabled: subscriptDisabled,
|
|
88
|
-
subscriptHidden: subscriptHidden
|
|
15
|
+
isInitialised: Boolean((_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised),
|
|
16
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
17
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
18
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
19
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
20
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
21
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
22
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
23
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
24
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
25
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
26
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
27
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
28
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
29
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
30
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
31
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
32
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
33
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
34
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
35
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
36
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
37
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
89
38
|
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
textFormattingState = _useSharedPluginState2.textFormattingState;
|
|
93
|
-
return {
|
|
94
|
-
isInitialised: Boolean(textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.isInitialised),
|
|
95
|
-
formattingIsPresent: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.formattingIsPresent,
|
|
96
|
-
emActive: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.emActive,
|
|
97
|
-
emDisabled: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.emDisabled,
|
|
98
|
-
emHidden: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.emHidden,
|
|
99
|
-
codeActive: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.codeActive,
|
|
100
|
-
codeDisabled: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.codeDisabled,
|
|
101
|
-
codeHidden: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.codeHidden,
|
|
102
|
-
underlineActive: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.underlineActive,
|
|
103
|
-
underlineDisabled: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.underlineDisabled,
|
|
104
|
-
underlineHidden: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.underlineHidden,
|
|
105
|
-
strikeActive: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.strikeActive,
|
|
106
|
-
strikeDisabled: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.strikeDisabled,
|
|
107
|
-
strikeHidden: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.strikeHidden,
|
|
108
|
-
strongActive: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.strongActive,
|
|
109
|
-
strongDisabled: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.strongDisabled,
|
|
110
|
-
strongHidden: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.strongHidden,
|
|
111
|
-
superscriptActive: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.superscriptActive,
|
|
112
|
-
superscriptDisabled: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.superscriptDisabled,
|
|
113
|
-
superscriptHidden: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.superscriptHidden,
|
|
114
|
-
subscriptActive: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.subscriptActive,
|
|
115
|
-
subscriptDisabled: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.subscriptDisabled,
|
|
116
|
-
subscriptHidden: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.subscriptHidden
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
function PrimaryToolbarComponent(_ref) {
|
|
39
|
+
};
|
|
40
|
+
var PrimaryToolbarComponent = exports.PrimaryToolbarComponent = function PrimaryToolbarComponent(_ref) {
|
|
120
41
|
var _api$analytics;
|
|
121
42
|
var api = _ref.api,
|
|
122
43
|
popupsMountPoint = _ref.popupsMountPoint,
|
|
@@ -126,7 +47,7 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
126
47
|
disabled = _ref.disabled,
|
|
127
48
|
isReducedSpacing = _ref.isReducedSpacing,
|
|
128
49
|
shouldUseResponsiveToolbar = _ref.shouldUseResponsiveToolbar;
|
|
129
|
-
var textFormattingState =
|
|
50
|
+
var textFormattingState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textFormatting'], selector);
|
|
130
51
|
return /*#__PURE__*/_react.default.createElement(_Toolbar.default, {
|
|
131
52
|
textFormattingState: textFormattingState,
|
|
132
53
|
popupsMountPoint: popupsMountPoint,
|
|
@@ -140,5 +61,5 @@ function PrimaryToolbarComponent(_ref) {
|
|
|
140
61
|
api: api,
|
|
141
62
|
toolbarType: _types.ToolbarType.PRIMARY
|
|
142
63
|
});
|
|
143
|
-
}
|
|
64
|
+
};
|
|
144
65
|
var PrimaryToolbarComponentMemoized = exports.PrimaryToolbarComponentMemoized = /*#__PURE__*/_react.default.memo(PrimaryToolbarComponent);
|
|
@@ -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.MoreFormattingMenu = exports.FormatMenuItem = exports.FormatButton = exports.ClearFormatMenuItem = void 0;
|
|
7
|
+
exports.MoreFormattingMenu = exports.MenuSection = exports.FormatMenuItem = exports.FormatButton = exports.ClearFormatMenuItem = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
@@ -140,4 +140,16 @@ var MoreFormattingMenu = exports.MoreFormattingMenu = function MoreFormattingMen
|
|
|
140
140
|
}),
|
|
141
141
|
label: content
|
|
142
142
|
}, children);
|
|
143
|
+
};
|
|
144
|
+
var MenuSection = exports.MenuSection = function MenuSection(_ref5) {
|
|
145
|
+
var children = _ref5.children,
|
|
146
|
+
title = _ref5.title,
|
|
147
|
+
parents = _ref5.parents;
|
|
148
|
+
var hasSeparator = parents.some(function (parent) {
|
|
149
|
+
return parent.key === _toolbar.TEXT_COLLAPSED_MENU.key;
|
|
150
|
+
});
|
|
151
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
|
|
152
|
+
hasSeparator: hasSeparator,
|
|
153
|
+
title: title
|
|
154
|
+
}, children);
|
|
143
155
|
};
|
|
@@ -10,6 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
12
12
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
13
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
13
14
|
var _Component = require("./Toolbar/components/Component");
|
|
14
15
|
var _utils = require("./Toolbar/components/utils");
|
|
15
16
|
var _types = require("./Toolbar/types");
|
|
@@ -100,7 +101,12 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
100
101
|
type: _toolbar.TEXT_FORMATTING_MENU.type,
|
|
101
102
|
key: _toolbar.TEXT_FORMATTING_MENU.key,
|
|
102
103
|
rank: _toolbar.TEXT_FORMAT_MENU_RANK[_toolbar.TEXT_FORMATTING_MENU_SECTION.key]
|
|
103
|
-
}]
|
|
104
|
+
}].concat((0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? [{
|
|
105
|
+
type: _toolbar.TEXT_COLLAPSED_MENU.type,
|
|
106
|
+
key: _toolbar.TEXT_COLLAPSED_MENU.key,
|
|
107
|
+
rank: _toolbar.TEXT_COLLAPSED_MENU_RANK[_toolbar.TEXT_FORMATTING_MENU_SECTION.key]
|
|
108
|
+
}] : [])),
|
|
109
|
+
component: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? _Component.MenuSection : undefined
|
|
104
110
|
}].concat((0, _toConsumableArray2.default)(getFormatMenuItems(api)), [{
|
|
105
111
|
type: _toolbar.CLEAR_FORMARTTING_MENU_SECTION.type,
|
|
106
112
|
key: _toolbar.CLEAR_FORMARTTING_MENU_SECTION.key,
|
|
@@ -108,7 +114,11 @@ var getToolbarComponents = exports.getToolbarComponents = function getToolbarCom
|
|
|
108
114
|
type: _toolbar.TEXT_FORMATTING_MENU.type,
|
|
109
115
|
key: _toolbar.TEXT_FORMATTING_MENU.key,
|
|
110
116
|
rank: _toolbar.TEXT_FORMAT_MENU_RANK[_toolbar.CLEAR_FORMARTTING_MENU_SECTION.key]
|
|
111
|
-
}],
|
|
117
|
+
}].concat((0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) ? [{
|
|
118
|
+
type: _toolbar.TEXT_COLLAPSED_MENU.type,
|
|
119
|
+
key: _toolbar.TEXT_COLLAPSED_MENU.key,
|
|
120
|
+
rank: _toolbar.TEXT_COLLAPSED_MENU_RANK[_toolbar.CLEAR_FORMARTTING_MENU_SECTION.key]
|
|
121
|
+
}] : [])),
|
|
112
122
|
component: function component(_ref6) {
|
|
113
123
|
var children = _ref6.children;
|
|
114
124
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItemSection, {
|
|
@@ -7,7 +7,7 @@ import React, { useMemo } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
|
-
import {
|
|
10
|
+
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
12
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
13
|
import { ToolbarButtonsStrong } from './Toolbar/constants';
|
|
@@ -26,121 +26,41 @@ const FloatingToolbarSettings = {
|
|
|
26
26
|
moreButtonLabel: '',
|
|
27
27
|
toolbarType: ToolbarType.FLOATING
|
|
28
28
|
};
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
codeActive,
|
|
32
|
-
codeDisabled,
|
|
33
|
-
codeHidden,
|
|
34
|
-
emActive,
|
|
35
|
-
emDisabled,
|
|
36
|
-
emHidden,
|
|
37
|
-
formattingIsPresent,
|
|
38
|
-
isInitialised,
|
|
39
|
-
strikeActive,
|
|
40
|
-
strikeDisabled,
|
|
41
|
-
strikeHidden,
|
|
42
|
-
strongActive,
|
|
43
|
-
strongDisabled,
|
|
44
|
-
strongHidden,
|
|
45
|
-
subscriptActive,
|
|
46
|
-
subscriptDisabled,
|
|
47
|
-
subscriptHidden,
|
|
48
|
-
superscriptActive,
|
|
49
|
-
superscriptDisabled,
|
|
50
|
-
superscriptHidden,
|
|
51
|
-
underlineActive,
|
|
52
|
-
underlineDisabled,
|
|
53
|
-
underlineHidden
|
|
54
|
-
} = useSharedPluginStateWithSelector(api, ['textFormatting'], states => {
|
|
55
|
-
var _states$textFormattin, _states$textFormattin2, _states$textFormattin3, _states$textFormattin4, _states$textFormattin5, _states$textFormattin6, _states$textFormattin7, _states$textFormattin8, _states$textFormattin9, _states$textFormattin0, _states$textFormattin1, _states$textFormattin10, _states$textFormattin11, _states$textFormattin12, _states$textFormattin13, _states$textFormattin14, _states$textFormattin15, _states$textFormattin16, _states$textFormattin17, _states$textFormattin18, _states$textFormattin19, _states$textFormattin20, _states$textFormattin21;
|
|
56
|
-
return {
|
|
57
|
-
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
58
|
-
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
59
|
-
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
60
|
-
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
61
|
-
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
62
|
-
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
63
|
-
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
64
|
-
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
65
|
-
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
66
|
-
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
67
|
-
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
68
|
-
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
69
|
-
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
70
|
-
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
71
|
-
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
72
|
-
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
73
|
-
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
74
|
-
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
75
|
-
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
76
|
-
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
77
|
-
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
78
|
-
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
79
|
-
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
return {
|
|
83
|
-
isInitialised: Boolean(isInitialised),
|
|
84
|
-
formattingIsPresent,
|
|
85
|
-
emActive,
|
|
86
|
-
emDisabled,
|
|
87
|
-
emHidden,
|
|
88
|
-
codeActive,
|
|
89
|
-
codeDisabled,
|
|
90
|
-
codeHidden,
|
|
91
|
-
underlineActive,
|
|
92
|
-
underlineDisabled,
|
|
93
|
-
underlineHidden,
|
|
94
|
-
strikeActive,
|
|
95
|
-
strikeDisabled,
|
|
96
|
-
strikeHidden,
|
|
97
|
-
strongActive,
|
|
98
|
-
strongDisabled,
|
|
99
|
-
strongHidden,
|
|
100
|
-
superscriptActive,
|
|
101
|
-
superscriptDisabled,
|
|
102
|
-
superscriptHidden,
|
|
103
|
-
subscriptActive,
|
|
104
|
-
subscriptDisabled,
|
|
105
|
-
subscriptHidden
|
|
106
|
-
};
|
|
107
|
-
}, api => {
|
|
108
|
-
const {
|
|
109
|
-
textFormattingState
|
|
110
|
-
} = useSharedPluginState(api, ['textFormatting']);
|
|
29
|
+
const selector = states => {
|
|
30
|
+
var _states$textFormattin, _states$textFormattin2, _states$textFormattin3, _states$textFormattin4, _states$textFormattin5, _states$textFormattin6, _states$textFormattin7, _states$textFormattin8, _states$textFormattin9, _states$textFormattin0, _states$textFormattin1, _states$textFormattin10, _states$textFormattin11, _states$textFormattin12, _states$textFormattin13, _states$textFormattin14, _states$textFormattin15, _states$textFormattin16, _states$textFormattin17, _states$textFormattin18, _states$textFormattin19, _states$textFormattin20, _states$textFormattin21;
|
|
111
31
|
return {
|
|
112
|
-
isInitialised: Boolean(textFormattingState === null ||
|
|
113
|
-
formattingIsPresent: textFormattingState === null ||
|
|
114
|
-
emActive: textFormattingState === null ||
|
|
115
|
-
emDisabled: textFormattingState === null ||
|
|
116
|
-
emHidden: textFormattingState === null ||
|
|
117
|
-
codeActive: textFormattingState === null ||
|
|
118
|
-
codeDisabled: textFormattingState === null ||
|
|
119
|
-
codeHidden: textFormattingState === null ||
|
|
120
|
-
underlineActive: textFormattingState === null ||
|
|
121
|
-
underlineDisabled: textFormattingState === null ||
|
|
122
|
-
underlineHidden: textFormattingState === null ||
|
|
123
|
-
strikeActive: textFormattingState === null ||
|
|
124
|
-
strikeDisabled: textFormattingState === null ||
|
|
125
|
-
strikeHidden: textFormattingState === null ||
|
|
126
|
-
strongActive: textFormattingState === null ||
|
|
127
|
-
strongDisabled: textFormattingState === null ||
|
|
128
|
-
strongHidden: textFormattingState === null ||
|
|
129
|
-
superscriptActive: textFormattingState === null ||
|
|
130
|
-
superscriptDisabled: textFormattingState === null ||
|
|
131
|
-
superscriptHidden: textFormattingState === null ||
|
|
132
|
-
subscriptActive: textFormattingState === null ||
|
|
133
|
-
subscriptDisabled: textFormattingState === null ||
|
|
134
|
-
subscriptHidden: textFormattingState === null ||
|
|
32
|
+
isInitialised: Boolean((_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised),
|
|
33
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
34
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
35
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
36
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
37
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
38
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
39
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
40
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
41
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
42
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
43
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
44
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
45
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
46
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
47
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
48
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
49
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
50
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
51
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
52
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
53
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
54
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
135
55
|
};
|
|
136
|
-
}
|
|
56
|
+
};
|
|
137
57
|
const FloatingToolbarTextFormat = ({
|
|
138
58
|
api,
|
|
139
59
|
editorAnalyticsAPI,
|
|
140
60
|
editorView,
|
|
141
61
|
intl
|
|
142
62
|
}) => {
|
|
143
|
-
const textFormattingState =
|
|
63
|
+
const textFormattingState = useSharedPluginStateWithSelector(api, ['textFormatting'], selector);
|
|
144
64
|
const {
|
|
145
65
|
formattingIsPresent,
|
|
146
66
|
...formattingIconState
|