@atlaskit/editor-plugin-text-formatting 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/pm-plugins/keymap.js +52 -1
- package/dist/cjs/pm-plugins/main.js +3 -1
- package/dist/cjs/textFormattingPlugin.js +4 -2
- package/dist/cjs/ui/FloatingToolbarComponent.js +90 -8
- package/dist/cjs/ui/PrimaryToolbarComponent.js +80 -2
- package/dist/cjs/ui/Toolbar/hooks/clear-formatting-icon.js +4 -3
- package/dist/cjs/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/cjs/ui/Toolbar/index.js +7 -4
- package/dist/es2019/pm-plugins/keymap.js +52 -1
- package/dist/es2019/pm-plugins/main.js +3 -1
- package/dist/es2019/textFormattingPlugin.js +4 -2
- package/dist/es2019/ui/FloatingToolbarComponent.js +88 -5
- package/dist/es2019/ui/PrimaryToolbarComponent.js +82 -4
- package/dist/es2019/ui/Toolbar/hooks/clear-formatting-icon.js +4 -3
- package/dist/es2019/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/es2019/ui/Toolbar/index.js +7 -2
- package/dist/esm/pm-plugins/keymap.js +52 -1
- package/dist/esm/pm-plugins/main.js +3 -1
- package/dist/esm/textFormattingPlugin.js +4 -2
- package/dist/esm/ui/FloatingToolbarComponent.js +88 -5
- package/dist/esm/ui/PrimaryToolbarComponent.js +81 -3
- package/dist/esm/ui/Toolbar/hooks/clear-formatting-icon.js +4 -3
- package/dist/esm/ui/Toolbar/hooks/formatting-icons.js +2 -2
- package/dist/esm/ui/Toolbar/index.js +7 -2
- package/dist/types/ui/Toolbar/hooks/clear-formatting-icon.d.ts +3 -3
- package/dist/types/ui/Toolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Toolbar/hooks/clear-formatting-icon.d.ts +3 -3
- package/dist/types-ts4.5/ui/Toolbar/index.d.ts +1 -1
- package/package.json +5 -5
|
@@ -168,7 +168,7 @@ var buildMenuIconState = function buildMenuIconState(iconMark) {
|
|
|
168
168
|
return function (_ref2) {
|
|
169
169
|
var schema = _ref2.schema,
|
|
170
170
|
textFormattingState = _ref2.textFormattingState;
|
|
171
|
-
var hasPluginState = Boolean(
|
|
171
|
+
var hasPluginState = Boolean(textFormattingState === null || textFormattingState === void 0 ? void 0 : textFormattingState.isInitialised);
|
|
172
172
|
var markSchema = IconsMarkSchema[iconMark];
|
|
173
173
|
var hasSchemaMark = Boolean(schema.marks[markSchema]);
|
|
174
174
|
if (!hasPluginState) {
|
|
@@ -258,7 +258,7 @@ export var useHasFormattingActived = function useHasFormattingActived(_ref5) {
|
|
|
258
258
|
var iconTypeList = _ref5.iconTypeList,
|
|
259
259
|
textFormattingState = _ref5.textFormattingState;
|
|
260
260
|
var hasActiveFormatting = useMemo(function () {
|
|
261
|
-
if (!textFormattingState) {
|
|
261
|
+
if (!(textFormattingState !== null && textFormattingState !== void 0 && textFormattingState.isInitialised)) {
|
|
262
262
|
return false;
|
|
263
263
|
}
|
|
264
264
|
return iconTypeList.some(function (iconType) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
var _excluded = ["formattingIsPresent"];
|
|
3
5
|
/**
|
|
4
6
|
* @jsxRuntime classic
|
|
5
7
|
* @jsx jsx
|
|
@@ -41,16 +43,19 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
41
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
42
44
|
message = _useState2[0],
|
|
43
45
|
setMessage = _useState2[1];
|
|
46
|
+
var formattingIsPresent = textFormattingState.formattingIsPresent,
|
|
47
|
+
formattingIconState = _objectWithoutProperties(textFormattingState, _excluded);
|
|
44
48
|
var defaultIcons = useFormattingIcons({
|
|
45
49
|
schema: editorView.state.schema,
|
|
46
50
|
intl: intl,
|
|
47
51
|
isToolbarDisabled: isToolbarDisabled,
|
|
48
52
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
49
|
-
textFormattingState:
|
|
53
|
+
textFormattingState: formattingIconState,
|
|
50
54
|
toolbarType: toolbarType
|
|
51
55
|
});
|
|
52
56
|
var clearIcon = useClearIcon({
|
|
53
|
-
|
|
57
|
+
formattingPluginInitialised: textFormattingState.isInitialised,
|
|
58
|
+
formattingIsPresent: formattingIsPresent,
|
|
54
59
|
intl: intl,
|
|
55
60
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
56
61
|
toolbarType: toolbarType
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { TextFormattingState } from '@atlaskit/editor-common/types';
|
|
3
2
|
import type { IconHookProps, MenuIconItem, ToolbarType } from '../types';
|
|
4
3
|
interface ClearIconHookProps extends IconHookProps {
|
|
5
4
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
|
|
6
|
-
|
|
5
|
+
formattingPluginInitialised: boolean | undefined;
|
|
6
|
+
formattingIsPresent: boolean | undefined;
|
|
7
7
|
toolbarType: ToolbarType;
|
|
8
8
|
}
|
|
9
|
-
export declare const useClearIcon: ({ intl,
|
|
9
|
+
export declare const useClearIcon: ({ intl, formattingPluginInitialised, formattingIsPresent: formattingPresent, editorAnalyticsAPI, toolbarType, }: ClearIconHookProps) => MenuIconItem | null;
|
|
10
10
|
export {};
|
|
@@ -15,7 +15,7 @@ export type ToolbarFormattingProps = {
|
|
|
15
15
|
popupsBoundariesElement?: HTMLElement;
|
|
16
16
|
popupsScrollableElement?: HTMLElement;
|
|
17
17
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
18
|
-
textFormattingState: TextFormattingState
|
|
18
|
+
textFormattingState: TextFormattingState;
|
|
19
19
|
api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
|
|
20
20
|
toolbarType: ToolbarType;
|
|
21
21
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { TextFormattingState } from '@atlaskit/editor-common/types';
|
|
3
2
|
import type { IconHookProps, MenuIconItem, ToolbarType } from '../types';
|
|
4
3
|
interface ClearIconHookProps extends IconHookProps {
|
|
5
4
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
|
|
6
|
-
|
|
5
|
+
formattingPluginInitialised: boolean | undefined;
|
|
6
|
+
formattingIsPresent: boolean | undefined;
|
|
7
7
|
toolbarType: ToolbarType;
|
|
8
8
|
}
|
|
9
|
-
export declare const useClearIcon: ({ intl,
|
|
9
|
+
export declare const useClearIcon: ({ intl, formattingPluginInitialised, formattingIsPresent: formattingPresent, editorAnalyticsAPI, toolbarType, }: ClearIconHookProps) => MenuIconItem | null;
|
|
10
10
|
export {};
|
|
@@ -15,7 +15,7 @@ export type ToolbarFormattingProps = {
|
|
|
15
15
|
popupsBoundariesElement?: HTMLElement;
|
|
16
16
|
popupsScrollableElement?: HTMLElement;
|
|
17
17
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
18
|
-
textFormattingState: TextFormattingState
|
|
18
|
+
textFormattingState: TextFormattingState;
|
|
19
19
|
api: ExtractInjectionAPI<TextFormattingPlugin> | undefined;
|
|
20
20
|
toolbarType: ToolbarType;
|
|
21
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-text-formatting",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "Text-formatting plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
|
-
"@atlaskit/editor-common": "^
|
|
38
|
-
"@atlaskit/editor-plugin-analytics": "^2.
|
|
39
|
-
"@atlaskit/editor-plugin-base": "^
|
|
37
|
+
"@atlaskit/editor-common": "^105.2.0",
|
|
38
|
+
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
|
+
"@atlaskit/editor-plugin-base": "^3.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
|
|
41
41
|
"@atlaskit/editor-plugin-selection-toolbar": "^3.6.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/icon": "^26.0.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/prosemirror-input-rules": "^3.3.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^4.21.0",
|
|
49
49
|
"@atlaskit/tokens": "^4.8.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1",
|