@atlaskit/editor-core 191.4.10 → 191.5.0
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 +6 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +9 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +10 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +9 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbar.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 191.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#68916](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/68916) [`32c9759874ea`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/32c9759874ea) - [ux] Wrapped the FullPageToolbar with the viewMode so that it will not render if the page is in a viewMode
|
|
8
|
+
|
|
3
9
|
## 191.4.10
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -10,6 +10,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
15
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
16
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
@@ -28,6 +29,11 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
28
29
|
shouldSplitToolbar = _useState2[0],
|
|
29
30
|
setShouldSplitToolbar = _useState2[1];
|
|
30
31
|
var editorAPI = (0, _context.usePresetContext)();
|
|
32
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(editorAPI, ['editorViewMode']),
|
|
33
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
34
|
+
|
|
35
|
+
// To check if the page is in viewMode
|
|
36
|
+
var isInViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
31
37
|
|
|
32
38
|
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
33
39
|
var twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
|
|
@@ -97,6 +103,9 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
97
103
|
event.preventDefault();
|
|
98
104
|
event.stopPropagation();
|
|
99
105
|
};
|
|
106
|
+
if (isInViewMode) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
100
109
|
return (0, _react2.jsx)(_ui.ContextPanelConsumer, null, function (_ref) {
|
|
101
110
|
var contextPanelWidth = _ref.width;
|
|
102
111
|
return (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { injectIntl } from 'react-intl-next';
|
|
6
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
6
7
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
8
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
8
9
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -14,6 +15,12 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
14
15
|
var _props$featureFlags, _props$customPrimaryT, _props$featureFlags2, _props$featureFlags3, _editorAPI$avatarGrou, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
|
|
15
16
|
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
16
17
|
const editorAPI = usePresetContext();
|
|
18
|
+
const {
|
|
19
|
+
editorViewModeState
|
|
20
|
+
} = useSharedPluginState(editorAPI, ['editorViewMode']);
|
|
21
|
+
|
|
22
|
+
// To check if the page is in viewMode
|
|
23
|
+
const isInViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
17
24
|
|
|
18
25
|
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
19
26
|
const twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
|
|
@@ -81,6 +88,9 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
81
88
|
event.preventDefault();
|
|
82
89
|
event.stopPropagation();
|
|
83
90
|
};
|
|
91
|
+
if (isInViewMode) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
84
94
|
return jsx(ContextPanelConsumer, null, ({
|
|
85
95
|
width: contextPanelWidth
|
|
86
96
|
}) => jsx(ToolbarArrowKeyNavigationProvider, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "191.
|
|
2
|
+
export const version = "191.5.0";
|
|
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
|
+
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
7
8
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
8
9
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
9
10
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -18,6 +19,11 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
18
19
|
shouldSplitToolbar = _useState2[0],
|
|
19
20
|
setShouldSplitToolbar = _useState2[1];
|
|
20
21
|
var editorAPI = usePresetContext();
|
|
22
|
+
var _useSharedPluginState = useSharedPluginState(editorAPI, ['editorViewMode']),
|
|
23
|
+
editorViewModeState = _useSharedPluginState.editorViewModeState;
|
|
24
|
+
|
|
25
|
+
// To check if the page is in viewMode
|
|
26
|
+
var isInViewMode = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
|
|
21
27
|
|
|
22
28
|
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
23
29
|
var twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
|
|
@@ -87,6 +93,9 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
87
93
|
event.preventDefault();
|
|
88
94
|
event.stopPropagation();
|
|
89
95
|
};
|
|
96
|
+
if (isInViewMode) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
90
99
|
return jsx(ContextPanelConsumer, null, function (_ref) {
|
|
91
100
|
var contextPanelWidth = _ref.width;
|
|
92
101
|
return jsx(ToolbarArrowKeyNavigationProvider, {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "191.
|
|
2
|
+
export var version = "191.5.0";
|
|
@@ -33,7 +33,7 @@ export interface FullPageToolbarProps {
|
|
|
33
33
|
featureFlags: FeatureFlags;
|
|
34
34
|
hideAvatarGroup?: boolean;
|
|
35
35
|
}
|
|
36
|
-
export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element>;
|
|
36
|
+
export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
37
37
|
export declare const FullPageToolbar: React.FC<import("react-intl-next").WithIntlProps<FullPageToolbarProps & WrappedComponentProps<"intl">>> & {
|
|
38
38
|
WrappedComponent: React.ComponentType<FullPageToolbarProps & WrappedComponentProps<"intl">>;
|
|
39
39
|
};
|
|
@@ -33,7 +33,7 @@ export interface FullPageToolbarProps {
|
|
|
33
33
|
featureFlags: FeatureFlags;
|
|
34
34
|
hideAvatarGroup?: boolean;
|
|
35
35
|
}
|
|
36
|
-
export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element>;
|
|
36
|
+
export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
37
37
|
export declare const FullPageToolbar: React.FC<import("react-intl-next").WithIntlProps<FullPageToolbarProps & WrappedComponentProps<"intl">>> & {
|
|
38
38
|
WrappedComponent: React.ComponentType<FullPageToolbarProps & WrappedComponentProps<"intl">>;
|
|
39
39
|
};
|