@atlaskit/editor-plugin-text-formatting 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 +53 -26
- package/dist/cjs/ui/PrimaryToolbarComponent.js +53 -26
- package/dist/es2019/ui/FloatingToolbarComponent.js +53 -25
- package/dist/es2019/ui/PrimaryToolbarComponent.js +53 -25
- package/dist/esm/ui/FloatingToolbarComponent.js +54 -27
- package/dist/esm/ui/PrimaryToolbarComponent.js +54 -27
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-text-formatting
|
|
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
|
|
@@ -12,7 +12,6 @@ var _react2 = require("@emotion/react");
|
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
13
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
14
14
|
var _types = require("@atlaskit/editor-common/types");
|
|
15
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
16
15
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
17
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
@@ -41,29 +40,57 @@ var FloatingToolbarSettings = {
|
|
|
41
40
|
toolbarType: _types2.ToolbarType.FLOATING
|
|
42
41
|
};
|
|
43
42
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
43
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textFormatting'], function (states) {
|
|
44
|
+
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;
|
|
45
|
+
return {
|
|
46
|
+
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
47
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
48
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
49
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
50
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
51
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
52
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
53
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
54
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
55
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
56
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
57
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
58
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
59
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
60
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
61
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
62
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
63
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
64
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
65
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
66
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
67
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
68
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
69
|
+
};
|
|
70
|
+
}),
|
|
71
|
+
codeActive = _useSharedPluginState.codeActive,
|
|
72
|
+
codeDisabled = _useSharedPluginState.codeDisabled,
|
|
73
|
+
codeHidden = _useSharedPluginState.codeHidden,
|
|
74
|
+
emActive = _useSharedPluginState.emActive,
|
|
75
|
+
emDisabled = _useSharedPluginState.emDisabled,
|
|
76
|
+
emHidden = _useSharedPluginState.emHidden,
|
|
77
|
+
formattingIsPresent = _useSharedPluginState.formattingIsPresent,
|
|
78
|
+
isInitialised = _useSharedPluginState.isInitialised,
|
|
79
|
+
strikeActive = _useSharedPluginState.strikeActive,
|
|
80
|
+
strikeDisabled = _useSharedPluginState.strikeDisabled,
|
|
81
|
+
strikeHidden = _useSharedPluginState.strikeHidden,
|
|
82
|
+
strongActive = _useSharedPluginState.strongActive,
|
|
83
|
+
strongDisabled = _useSharedPluginState.strongDisabled,
|
|
84
|
+
strongHidden = _useSharedPluginState.strongHidden,
|
|
85
|
+
subscriptActive = _useSharedPluginState.subscriptActive,
|
|
86
|
+
subscriptDisabled = _useSharedPluginState.subscriptDisabled,
|
|
87
|
+
subscriptHidden = _useSharedPluginState.subscriptHidden,
|
|
88
|
+
superscriptActive = _useSharedPluginState.superscriptActive,
|
|
89
|
+
superscriptDisabled = _useSharedPluginState.superscriptDisabled,
|
|
90
|
+
superscriptHidden = _useSharedPluginState.superscriptHidden,
|
|
91
|
+
underlineActive = _useSharedPluginState.underlineActive,
|
|
92
|
+
underlineDisabled = _useSharedPluginState.underlineDisabled,
|
|
93
|
+
underlineHidden = _useSharedPluginState.underlineHidden;
|
|
67
94
|
return {
|
|
68
95
|
isInitialised: Boolean(isInitialised),
|
|
69
96
|
formattingIsPresent: formattingIsPresent,
|
|
@@ -90,8 +117,8 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
90
117
|
subscriptHidden: subscriptHidden
|
|
91
118
|
};
|
|
92
119
|
}, function (api) {
|
|
93
|
-
var
|
|
94
|
-
textFormattingState =
|
|
120
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['textFormatting']),
|
|
121
|
+
textFormattingState = _useSharedPluginState2.textFormattingState;
|
|
95
122
|
return {
|
|
96
123
|
isInitialised: Boolean(textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.isInitialised),
|
|
97
124
|
formattingIsPresent: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.formattingIsPresent,
|
|
@@ -8,33 +8,60 @@ exports.PrimaryToolbarComponent = PrimaryToolbarComponent;
|
|
|
8
8
|
exports.PrimaryToolbarComponentMemoized = void 0;
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
11
|
-
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
12
11
|
var _Toolbar = _interopRequireDefault(require("./Toolbar"));
|
|
13
12
|
var _types = require("./Toolbar/types");
|
|
14
13
|
var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (api) {
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['textFormatting'], function (states) {
|
|
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;
|
|
38
65
|
return {
|
|
39
66
|
isInitialised: Boolean(isInitialised),
|
|
40
67
|
formattingIsPresent: formattingIsPresent,
|
|
@@ -61,8 +88,8 @@ var useSharedState = (0, _hooks.sharedPluginStateHookMigratorFactory)(function (
|
|
|
61
88
|
subscriptHidden: subscriptHidden
|
|
62
89
|
};
|
|
63
90
|
}, function (api) {
|
|
64
|
-
var
|
|
65
|
-
textFormattingState =
|
|
91
|
+
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['textFormatting']),
|
|
92
|
+
textFormattingState = _useSharedPluginState2.textFormattingState;
|
|
66
93
|
return {
|
|
67
94
|
isInitialised: Boolean(textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.isInitialised),
|
|
68
95
|
formattingIsPresent: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.formattingIsPresent,
|
|
@@ -7,9 +7,8 @@ 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 { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
10
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
11
11
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
12
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
13
12
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
14
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -31,29 +30,58 @@ const FloatingToolbarSettings = {
|
|
|
31
30
|
toolbarType: ToolbarType.FLOATING
|
|
32
31
|
};
|
|
33
32
|
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
33
|
+
const {
|
|
34
|
+
codeActive,
|
|
35
|
+
codeDisabled,
|
|
36
|
+
codeHidden,
|
|
37
|
+
emActive,
|
|
38
|
+
emDisabled,
|
|
39
|
+
emHidden,
|
|
40
|
+
formattingIsPresent,
|
|
41
|
+
isInitialised,
|
|
42
|
+
strikeActive,
|
|
43
|
+
strikeDisabled,
|
|
44
|
+
strikeHidden,
|
|
45
|
+
strongActive,
|
|
46
|
+
strongDisabled,
|
|
47
|
+
strongHidden,
|
|
48
|
+
subscriptActive,
|
|
49
|
+
subscriptDisabled,
|
|
50
|
+
subscriptHidden,
|
|
51
|
+
superscriptActive,
|
|
52
|
+
superscriptDisabled,
|
|
53
|
+
superscriptHidden,
|
|
54
|
+
underlineActive,
|
|
55
|
+
underlineDisabled,
|
|
56
|
+
underlineHidden
|
|
57
|
+
} = useSharedPluginStateWithSelector(api, ['textFormatting'], states => {
|
|
58
|
+
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;
|
|
59
|
+
return {
|
|
60
|
+
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
61
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
62
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
63
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
64
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
65
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
66
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
67
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
68
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
69
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
70
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
71
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
72
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
73
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
74
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
75
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
76
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
77
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
78
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
79
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
80
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
81
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
82
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
83
|
+
};
|
|
84
|
+
});
|
|
57
85
|
return {
|
|
58
86
|
isInitialised: Boolean(isInitialised),
|
|
59
87
|
formattingIsPresent,
|
|
@@ -1,32 +1,60 @@
|
|
|
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 Toolbar from './Toolbar';
|
|
5
4
|
import { ToolbarType } from './Toolbar/types';
|
|
6
5
|
const useSharedState = sharedPluginStateHookMigratorFactory(api => {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
const {
|
|
7
|
+
codeActive,
|
|
8
|
+
codeDisabled,
|
|
9
|
+
codeHidden,
|
|
10
|
+
emActive,
|
|
11
|
+
emDisabled,
|
|
12
|
+
emHidden,
|
|
13
|
+
formattingIsPresent,
|
|
14
|
+
isInitialised,
|
|
15
|
+
strikeActive,
|
|
16
|
+
strikeDisabled,
|
|
17
|
+
strikeHidden,
|
|
18
|
+
strongActive,
|
|
19
|
+
strongDisabled,
|
|
20
|
+
strongHidden,
|
|
21
|
+
subscriptActive,
|
|
22
|
+
subscriptDisabled,
|
|
23
|
+
subscriptHidden,
|
|
24
|
+
superscriptActive,
|
|
25
|
+
superscriptDisabled,
|
|
26
|
+
superscriptHidden,
|
|
27
|
+
underlineActive,
|
|
28
|
+
underlineDisabled,
|
|
29
|
+
underlineHidden
|
|
30
|
+
} = useSharedPluginStateWithSelector(api, ['textFormatting'], states => {
|
|
31
|
+
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;
|
|
32
|
+
return {
|
|
33
|
+
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
34
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
35
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
36
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
37
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
38
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
39
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
40
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
41
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
42
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
43
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
44
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
45
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
46
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
47
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
48
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
49
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
50
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
51
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
52
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
53
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
54
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
55
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
56
|
+
};
|
|
57
|
+
});
|
|
30
58
|
return {
|
|
31
59
|
isInitialised: Boolean(isInitialised),
|
|
32
60
|
formattingIsPresent,
|
|
@@ -9,9 +9,8 @@ import React, { useMemo } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx } from '@emotion/react';
|
|
11
11
|
import { injectIntl } from 'react-intl-next';
|
|
12
|
-
import { useSharedPluginState, sharedPluginStateHookMigratorFactory } from '@atlaskit/editor-common/hooks';
|
|
12
|
+
import { useSharedPluginState, sharedPluginStateHookMigratorFactory, useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
13
13
|
import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
14
|
-
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
15
14
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
16
15
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -33,29 +32,57 @@ var FloatingToolbarSettings = {
|
|
|
33
32
|
toolbarType: ToolbarType.FLOATING
|
|
34
33
|
};
|
|
35
34
|
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['textFormatting'], function (states) {
|
|
36
|
+
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;
|
|
37
|
+
return {
|
|
38
|
+
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
39
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
40
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
41
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
42
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
43
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
44
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
45
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
46
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
47
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
48
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
49
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
50
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
51
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
52
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
53
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
54
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
55
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
56
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
57
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
58
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
59
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
60
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
61
|
+
};
|
|
62
|
+
}),
|
|
63
|
+
codeActive = _useSharedPluginState.codeActive,
|
|
64
|
+
codeDisabled = _useSharedPluginState.codeDisabled,
|
|
65
|
+
codeHidden = _useSharedPluginState.codeHidden,
|
|
66
|
+
emActive = _useSharedPluginState.emActive,
|
|
67
|
+
emDisabled = _useSharedPluginState.emDisabled,
|
|
68
|
+
emHidden = _useSharedPluginState.emHidden,
|
|
69
|
+
formattingIsPresent = _useSharedPluginState.formattingIsPresent,
|
|
70
|
+
isInitialised = _useSharedPluginState.isInitialised,
|
|
71
|
+
strikeActive = _useSharedPluginState.strikeActive,
|
|
72
|
+
strikeDisabled = _useSharedPluginState.strikeDisabled,
|
|
73
|
+
strikeHidden = _useSharedPluginState.strikeHidden,
|
|
74
|
+
strongActive = _useSharedPluginState.strongActive,
|
|
75
|
+
strongDisabled = _useSharedPluginState.strongDisabled,
|
|
76
|
+
strongHidden = _useSharedPluginState.strongHidden,
|
|
77
|
+
subscriptActive = _useSharedPluginState.subscriptActive,
|
|
78
|
+
subscriptDisabled = _useSharedPluginState.subscriptDisabled,
|
|
79
|
+
subscriptHidden = _useSharedPluginState.subscriptHidden,
|
|
80
|
+
superscriptActive = _useSharedPluginState.superscriptActive,
|
|
81
|
+
superscriptDisabled = _useSharedPluginState.superscriptDisabled,
|
|
82
|
+
superscriptHidden = _useSharedPluginState.superscriptHidden,
|
|
83
|
+
underlineActive = _useSharedPluginState.underlineActive,
|
|
84
|
+
underlineDisabled = _useSharedPluginState.underlineDisabled,
|
|
85
|
+
underlineHidden = _useSharedPluginState.underlineHidden;
|
|
59
86
|
return {
|
|
60
87
|
isInitialised: Boolean(isInitialised),
|
|
61
88
|
formattingIsPresent: formattingIsPresent,
|
|
@@ -82,8 +109,8 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
|
82
109
|
subscriptHidden: subscriptHidden
|
|
83
110
|
};
|
|
84
111
|
}, function (api) {
|
|
85
|
-
var
|
|
86
|
-
textFormattingState =
|
|
112
|
+
var _useSharedPluginState2 = useSharedPluginState(api, ['textFormatting']),
|
|
113
|
+
textFormattingState = _useSharedPluginState2.textFormattingState;
|
|
87
114
|
return {
|
|
88
115
|
isInitialised: Boolean(textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.isInitialised),
|
|
89
116
|
formattingIsPresent: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.formattingIsPresent,
|
|
@@ -1,32 +1,59 @@
|
|
|
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 Toolbar from './Toolbar';
|
|
5
4
|
import { ToolbarType } from './Toolbar/types';
|
|
6
5
|
var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['textFormatting'], function (states) {
|
|
7
|
+
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;
|
|
8
|
+
return {
|
|
9
|
+
isInitialised: (_states$textFormattin = states.textFormattingState) === null || _states$textFormattin === void 0 ? void 0 : _states$textFormattin.isInitialised,
|
|
10
|
+
formattingIsPresent: (_states$textFormattin2 = states.textFormattingState) === null || _states$textFormattin2 === void 0 ? void 0 : _states$textFormattin2.formattingIsPresent,
|
|
11
|
+
emActive: (_states$textFormattin3 = states.textFormattingState) === null || _states$textFormattin3 === void 0 ? void 0 : _states$textFormattin3.emActive,
|
|
12
|
+
emDisabled: (_states$textFormattin4 = states.textFormattingState) === null || _states$textFormattin4 === void 0 ? void 0 : _states$textFormattin4.emDisabled,
|
|
13
|
+
emHidden: (_states$textFormattin5 = states.textFormattingState) === null || _states$textFormattin5 === void 0 ? void 0 : _states$textFormattin5.emHidden,
|
|
14
|
+
codeActive: (_states$textFormattin6 = states.textFormattingState) === null || _states$textFormattin6 === void 0 ? void 0 : _states$textFormattin6.codeActive,
|
|
15
|
+
codeDisabled: (_states$textFormattin7 = states.textFormattingState) === null || _states$textFormattin7 === void 0 ? void 0 : _states$textFormattin7.codeDisabled,
|
|
16
|
+
codeHidden: (_states$textFormattin8 = states.textFormattingState) === null || _states$textFormattin8 === void 0 ? void 0 : _states$textFormattin8.codeHidden,
|
|
17
|
+
underlineActive: (_states$textFormattin9 = states.textFormattingState) === null || _states$textFormattin9 === void 0 ? void 0 : _states$textFormattin9.underlineActive,
|
|
18
|
+
underlineDisabled: (_states$textFormattin0 = states.textFormattingState) === null || _states$textFormattin0 === void 0 ? void 0 : _states$textFormattin0.underlineDisabled,
|
|
19
|
+
underlineHidden: (_states$textFormattin1 = states.textFormattingState) === null || _states$textFormattin1 === void 0 ? void 0 : _states$textFormattin1.underlineHidden,
|
|
20
|
+
strikeActive: (_states$textFormattin10 = states.textFormattingState) === null || _states$textFormattin10 === void 0 ? void 0 : _states$textFormattin10.strikeActive,
|
|
21
|
+
strikeDisabled: (_states$textFormattin11 = states.textFormattingState) === null || _states$textFormattin11 === void 0 ? void 0 : _states$textFormattin11.strikeDisabled,
|
|
22
|
+
strikeHidden: (_states$textFormattin12 = states.textFormattingState) === null || _states$textFormattin12 === void 0 ? void 0 : _states$textFormattin12.strikeHidden,
|
|
23
|
+
strongActive: (_states$textFormattin13 = states.textFormattingState) === null || _states$textFormattin13 === void 0 ? void 0 : _states$textFormattin13.strongActive,
|
|
24
|
+
strongDisabled: (_states$textFormattin14 = states.textFormattingState) === null || _states$textFormattin14 === void 0 ? void 0 : _states$textFormattin14.strongDisabled,
|
|
25
|
+
strongHidden: (_states$textFormattin15 = states.textFormattingState) === null || _states$textFormattin15 === void 0 ? void 0 : _states$textFormattin15.strongHidden,
|
|
26
|
+
superscriptActive: (_states$textFormattin16 = states.textFormattingState) === null || _states$textFormattin16 === void 0 ? void 0 : _states$textFormattin16.superscriptActive,
|
|
27
|
+
superscriptDisabled: (_states$textFormattin17 = states.textFormattingState) === null || _states$textFormattin17 === void 0 ? void 0 : _states$textFormattin17.superscriptDisabled,
|
|
28
|
+
superscriptHidden: (_states$textFormattin18 = states.textFormattingState) === null || _states$textFormattin18 === void 0 ? void 0 : _states$textFormattin18.superscriptHidden,
|
|
29
|
+
subscriptActive: (_states$textFormattin19 = states.textFormattingState) === null || _states$textFormattin19 === void 0 ? void 0 : _states$textFormattin19.subscriptActive,
|
|
30
|
+
subscriptDisabled: (_states$textFormattin20 = states.textFormattingState) === null || _states$textFormattin20 === void 0 ? void 0 : _states$textFormattin20.subscriptDisabled,
|
|
31
|
+
subscriptHidden: (_states$textFormattin21 = states.textFormattingState) === null || _states$textFormattin21 === void 0 ? void 0 : _states$textFormattin21.subscriptHidden
|
|
32
|
+
};
|
|
33
|
+
}),
|
|
34
|
+
codeActive = _useSharedPluginState.codeActive,
|
|
35
|
+
codeDisabled = _useSharedPluginState.codeDisabled,
|
|
36
|
+
codeHidden = _useSharedPluginState.codeHidden,
|
|
37
|
+
emActive = _useSharedPluginState.emActive,
|
|
38
|
+
emDisabled = _useSharedPluginState.emDisabled,
|
|
39
|
+
emHidden = _useSharedPluginState.emHidden,
|
|
40
|
+
formattingIsPresent = _useSharedPluginState.formattingIsPresent,
|
|
41
|
+
isInitialised = _useSharedPluginState.isInitialised,
|
|
42
|
+
strikeActive = _useSharedPluginState.strikeActive,
|
|
43
|
+
strikeDisabled = _useSharedPluginState.strikeDisabled,
|
|
44
|
+
strikeHidden = _useSharedPluginState.strikeHidden,
|
|
45
|
+
strongActive = _useSharedPluginState.strongActive,
|
|
46
|
+
strongDisabled = _useSharedPluginState.strongDisabled,
|
|
47
|
+
strongHidden = _useSharedPluginState.strongHidden,
|
|
48
|
+
subscriptActive = _useSharedPluginState.subscriptActive,
|
|
49
|
+
subscriptDisabled = _useSharedPluginState.subscriptDisabled,
|
|
50
|
+
subscriptHidden = _useSharedPluginState.subscriptHidden,
|
|
51
|
+
superscriptActive = _useSharedPluginState.superscriptActive,
|
|
52
|
+
superscriptDisabled = _useSharedPluginState.superscriptDisabled,
|
|
53
|
+
superscriptHidden = _useSharedPluginState.superscriptHidden,
|
|
54
|
+
underlineActive = _useSharedPluginState.underlineActive,
|
|
55
|
+
underlineDisabled = _useSharedPluginState.underlineDisabled,
|
|
56
|
+
underlineHidden = _useSharedPluginState.underlineHidden;
|
|
30
57
|
return {
|
|
31
58
|
isInitialised: Boolean(isInitialised),
|
|
32
59
|
formattingIsPresent: formattingIsPresent,
|
|
@@ -53,8 +80,8 @@ var useSharedState = sharedPluginStateHookMigratorFactory(function (api) {
|
|
|
53
80
|
subscriptHidden: subscriptHidden
|
|
54
81
|
};
|
|
55
82
|
}, function (api) {
|
|
56
|
-
var
|
|
57
|
-
textFormattingState =
|
|
83
|
+
var _useSharedPluginState2 = useSharedPluginState(api, ['textFormatting']),
|
|
84
|
+
textFormattingState = _useSharedPluginState2.textFormattingState;
|
|
58
85
|
return {
|
|
59
86
|
isInitialised: Boolean(textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.isInitialised),
|
|
60
87
|
formattingIsPresent: textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.formattingIsPresent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-formatting",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Text-formatting plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,17 +40,17 @@
|
|
|
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
45
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
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
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@atlaskit/editor-common": "^107.
|
|
53
|
+
"@atlaskit/editor-common": "^107.7.0",
|
|
54
54
|
"react": "^18.2.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|