@atlaskit/editor-core 216.7.13 → 216.7.15
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 +16 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -3
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbarNext.js +12 -0
- package/dist/cjs/ui/Toolbar/Toolbar.js +1 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -3
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +1 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbarNext.js +12 -0
- package/dist/es2019/ui/Toolbar/Toolbar.js +1 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -3
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +1 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbarNext.js +12 -0
- package/dist/esm/ui/Toolbar/Toolbar.js +1 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 216.7.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b17f23c9e3a68`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b17f23c9e3a68) -
|
|
8
|
+
Avoid rendering entire primary toolbar container when primary toolbar is not registered
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 216.7.14
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`653c0c803b286`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/653c0c803b286) -
|
|
16
|
+
EDITOR-4620 Clean up platform_editor_toolbar_aifc_patch_6
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 216.7.13
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -20,7 +20,6 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
20
20
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
21
21
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
22
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
24
23
|
var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
|
|
25
24
|
var _contentComponentWrapper = require("../../Addon/ClickAreaBlock/contentComponentWrapper");
|
|
26
25
|
var _EditorContentContainer = _interopRequireDefault(require("../../EditorContentContainer/EditorContentContainer"));
|
|
@@ -177,7 +176,6 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
177
176
|
var customToolbarSlot = (0, _react2.jsx)("div", {
|
|
178
177
|
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && (0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_responsive_improve') && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
179
178
|
}, customPrimaryToolbarComponents);
|
|
180
|
-
var patch6Enabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
181
179
|
return (0, _react2.jsx)(_WithFlash.default, {
|
|
182
180
|
animate: maxContentSizeReached
|
|
183
181
|
}, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
|
|
@@ -207,7 +205,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
207
205
|
editorAPI: editorAPI,
|
|
208
206
|
editorView: editorView,
|
|
209
207
|
editorAppearance: appearance,
|
|
210
|
-
disabled:
|
|
208
|
+
disabled: !!disabled,
|
|
211
209
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
212
210
|
popupsScrollableElement: popupsScrollableElement,
|
|
213
211
|
popupsMountPoint: popupsMountPoint
|
|
@@ -13,7 +13,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
17
|
/**
|
|
19
18
|
* @jsxRuntime classic
|
|
@@ -93,7 +92,6 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
93
92
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
94
93
|
top = _useState2[0],
|
|
95
94
|
setTop = _useState2[1];
|
|
96
|
-
var toolbarPatch6Enabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
97
95
|
|
|
98
96
|
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
99
97
|
// else if offsetTop is a number set top to offsetTop
|
|
@@ -109,7 +107,7 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
109
107
|
return (
|
|
110
108
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
111
109
|
(0, _react2.jsx)("div", {
|
|
112
|
-
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled &&
|
|
110
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding]
|
|
113
111
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
114
112
|
,
|
|
115
113
|
style: {
|
|
@@ -70,6 +70,9 @@ var ToolbarPlaceholder = function ToolbarPlaceholder() {
|
|
|
70
70
|
className: (0, _runtime.ax)([styles.toolbarPlaceholder])
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
+
var shouldShowToolbarContainer = function shouldShowToolbarContainer(toolbar, customPrimaryToolbarComponents) {
|
|
74
|
+
return !!toolbar || !!customPrimaryToolbarComponents;
|
|
75
|
+
};
|
|
73
76
|
var FullPageToolbarNext = exports.FullPageToolbarNext = function FullPageToolbarNext(_ref4) {
|
|
74
77
|
var _editorAPI$toolbar, _editorAPI$toolbar2, _useToolbarPortal;
|
|
75
78
|
var editorAPI = _ref4.editorAPI,
|
|
@@ -107,6 +110,15 @@ var FullPageToolbarNext = exports.FullPageToolbarNext = function FullPageToolbar
|
|
|
107
110
|
event.preventDefault();
|
|
108
111
|
event.stopPropagation();
|
|
109
112
|
}, [editorView]);
|
|
113
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_primary_toolbar_early_exit', 'isEnabled', true)) {
|
|
114
|
+
// Remove entire primary toolbar region if:
|
|
115
|
+
// - primary toolbar isn't registered
|
|
116
|
+
// - no custom primary toolbar components to render
|
|
117
|
+
// note: primary toolbar must render if toolbar docking preference is set to "controlled" to avoid SSR conflicts
|
|
118
|
+
if (!shouldShowToolbarContainer(toolbar, customPrimaryToolbarComponents)) {
|
|
119
|
+
return /*#__PURE__*/_react.default.createElement(ToolbarPortal, null, null);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
110
122
|
return /*#__PURE__*/_react.default.createElement(_contextPanel.ContextPanelConsumer, null, function (_ref6) {
|
|
111
123
|
var ContextPanelWidth = _ref6.width;
|
|
112
124
|
return /*#__PURE__*/_react.default.createElement(_ExcludeFromHydration.default, {
|
|
@@ -12,7 +12,6 @@ var _types = require("@atlaskit/editor-common/types");
|
|
|
12
12
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
13
13
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
14
14
|
var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _ToolbarInner = require("./ToolbarInner");
|
|
17
16
|
/**
|
|
18
17
|
* *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
|
|
@@ -70,7 +69,6 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
|
|
|
70
69
|
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
71
70
|
// remove offline check when patch6Enabled is cleaned up
|
|
72
71
|
var isOffline = (0, _editorPluginConnectivity.isOfflineMode)(connectivityStateMode);
|
|
73
|
-
var patch6Enabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
74
72
|
return /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarProvider, {
|
|
75
73
|
editorView: editorView !== null && editorView !== void 0 ? editorView : null,
|
|
76
74
|
editorAppearance: editorAppearance,
|
|
@@ -79,7 +77,7 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
|
|
|
79
77
|
isOffline: isOffline
|
|
80
78
|
}, /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarUIProvider, {
|
|
81
79
|
api: editorAPI,
|
|
82
|
-
isDisabled:
|
|
80
|
+
isDisabled: isDisabled,
|
|
83
81
|
popupsMountPoint: popupsMountPoint,
|
|
84
82
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
85
83
|
popupsScrollableElement: popupsScrollableElement,
|
|
@@ -16,7 +16,6 @@ import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
|
16
16
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
17
17
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
18
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
20
19
|
// Ignored via go/ees005
|
|
21
20
|
// eslint-disable-next-line import/no-named-as-default
|
|
22
21
|
import ClickAreaBlock from '../../Addon/ClickAreaBlock';
|
|
@@ -165,7 +164,6 @@ export const CommentEditorWithIntl = props => {
|
|
|
165
164
|
const customToolbarSlot = jsx("div", {
|
|
166
165
|
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && fg('platform_editor_toolbar_aifc_responsive_improve') && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
167
166
|
}, customPrimaryToolbarComponents);
|
|
168
|
-
const patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
169
167
|
return jsx(WithFlash, {
|
|
170
168
|
animate: maxContentSizeReached
|
|
171
169
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
@@ -195,7 +193,7 @@ export const CommentEditorWithIntl = props => {
|
|
|
195
193
|
editorAPI: editorAPI,
|
|
196
194
|
editorView: editorView,
|
|
197
195
|
editorAppearance: appearance,
|
|
198
|
-
disabled:
|
|
196
|
+
disabled: !!disabled,
|
|
199
197
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
200
198
|
popupsScrollableElement: popupsScrollableElement,
|
|
201
199
|
popupsMountPoint: popupsMountPoint
|
|
@@ -9,7 +9,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
12
|
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
14
13
|
const akEditorMenuZIndex = 500;
|
|
15
14
|
const akEditorToolbarKeylineHeight = 2;
|
|
@@ -87,7 +86,6 @@ const stickyToolbarWrapperStyleNew = css({
|
|
|
87
86
|
});
|
|
88
87
|
const StickyToolbar = props => {
|
|
89
88
|
const [top, setTop] = useState(0);
|
|
90
|
-
const toolbarPatch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
91
89
|
|
|
92
90
|
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
93
91
|
// else if offsetTop is a number set top to offsetTop
|
|
@@ -103,7 +101,7 @@ const StickyToolbar = props => {
|
|
|
103
101
|
return (
|
|
104
102
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
105
103
|
jsx("div", {
|
|
106
|
-
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled &&
|
|
104
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding]
|
|
107
105
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
108
106
|
,
|
|
109
107
|
style: {
|
|
@@ -64,6 +64,9 @@ const ToolbarPlaceholder = () => {
|
|
|
64
64
|
className: ax([styles.toolbarPlaceholder])
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
const shouldShowToolbarContainer = (toolbar, customPrimaryToolbarComponents) => {
|
|
68
|
+
return !!toolbar || !!customPrimaryToolbarComponents;
|
|
69
|
+
};
|
|
67
70
|
export const FullPageToolbarNext = ({
|
|
68
71
|
editorAPI,
|
|
69
72
|
beforeIcon,
|
|
@@ -101,6 +104,15 @@ export const FullPageToolbarNext = ({
|
|
|
101
104
|
event.preventDefault();
|
|
102
105
|
event.stopPropagation();
|
|
103
106
|
}, [editorView]);
|
|
107
|
+
if (expValEquals('platform_editor_primary_toolbar_early_exit', 'isEnabled', true)) {
|
|
108
|
+
// Remove entire primary toolbar region if:
|
|
109
|
+
// - primary toolbar isn't registered
|
|
110
|
+
// - no custom primary toolbar components to render
|
|
111
|
+
// note: primary toolbar must render if toolbar docking preference is set to "controlled" to avoid SSR conflicts
|
|
112
|
+
if (!shouldShowToolbarContainer(toolbar, customPrimaryToolbarComponents)) {
|
|
113
|
+
return /*#__PURE__*/React.createElement(ToolbarPortal, null, null);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
104
116
|
return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, ({
|
|
105
117
|
width: ContextPanelWidth
|
|
106
118
|
}) => /*#__PURE__*/React.createElement(ExcludeFromHydration, {
|
|
@@ -5,7 +5,6 @@ import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
6
6
|
import { ToolbarButtonGroup, ToolbarDropdownItemSection, ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
7
7
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
import { ToolbarInner } from './ToolbarInner';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -66,7 +65,6 @@ export const ToolbarNext = ({
|
|
|
66
65
|
} = usePluginState(editorAPI);
|
|
67
66
|
// remove offline check when patch6Enabled is cleaned up
|
|
68
67
|
const isOffline = isOfflineMode(connectivityStateMode);
|
|
69
|
-
const patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
70
68
|
return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
|
|
71
69
|
editorView: editorView !== null && editorView !== void 0 ? editorView : null,
|
|
72
70
|
editorAppearance: editorAppearance,
|
|
@@ -75,7 +73,7 @@ export const ToolbarNext = ({
|
|
|
75
73
|
isOffline: isOffline
|
|
76
74
|
}, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
|
|
77
75
|
api: editorAPI,
|
|
78
|
-
isDisabled:
|
|
76
|
+
isDisabled: isDisabled,
|
|
79
77
|
popupsMountPoint: popupsMountPoint,
|
|
80
78
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
81
79
|
popupsScrollableElement: popupsScrollableElement,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "216.7.
|
|
2
|
+
export const version = "216.7.14";
|
|
@@ -18,7 +18,6 @@ import { WidthConsumer, WidthProvider } from '@atlaskit/editor-common/ui';
|
|
|
18
18
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
19
19
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
20
20
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
22
21
|
// Ignored via go/ees005
|
|
23
22
|
// eslint-disable-next-line import/no-named-as-default
|
|
24
23
|
import ClickAreaBlock from '../../Addon/ClickAreaBlock';
|
|
@@ -166,7 +165,6 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
166
165
|
var customToolbarSlot = jsx("div", {
|
|
167
166
|
css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && fg('platform_editor_toolbar_aifc_responsive_improve') && mainToolbarCustomComponentsSlotStylePaddingOverride]
|
|
168
167
|
}, customPrimaryToolbarComponents);
|
|
169
|
-
var patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
170
168
|
return jsx(WithFlash, {
|
|
171
169
|
animate: maxContentSizeReached
|
|
172
170
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
@@ -196,7 +194,7 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
|
|
|
196
194
|
editorAPI: editorAPI,
|
|
197
195
|
editorView: editorView,
|
|
198
196
|
editorAppearance: appearance,
|
|
199
|
-
disabled:
|
|
197
|
+
disabled: !!disabled,
|
|
200
198
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
201
199
|
popupsScrollableElement: popupsScrollableElement,
|
|
202
200
|
popupsMountPoint: popupsMountPoint
|
|
@@ -12,7 +12,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
import { css, jsx } from '@emotion/react';
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
15
|
var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
17
16
|
var akEditorMenuZIndex = 500;
|
|
18
17
|
var akEditorToolbarKeylineHeight = 2;
|
|
@@ -84,7 +83,6 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
84
83
|
_useState2 = _slicedToArray(_useState, 2),
|
|
85
84
|
top = _useState2[0],
|
|
86
85
|
setTop = _useState2[1];
|
|
87
|
-
var toolbarPatch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
88
86
|
|
|
89
87
|
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
90
88
|
// else if offsetTop is a number set top to offsetTop
|
|
@@ -100,7 +98,7 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
100
98
|
return (
|
|
101
99
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
102
100
|
jsx("div", {
|
|
103
|
-
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled &&
|
|
101
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding]
|
|
104
102
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
105
103
|
,
|
|
106
104
|
style: {
|
|
@@ -61,6 +61,9 @@ var ToolbarPlaceholder = function ToolbarPlaceholder() {
|
|
|
61
61
|
className: ax([styles.toolbarPlaceholder])
|
|
62
62
|
});
|
|
63
63
|
};
|
|
64
|
+
var shouldShowToolbarContainer = function shouldShowToolbarContainer(toolbar, customPrimaryToolbarComponents) {
|
|
65
|
+
return !!toolbar || !!customPrimaryToolbarComponents;
|
|
66
|
+
};
|
|
64
67
|
export var FullPageToolbarNext = function FullPageToolbarNext(_ref4) {
|
|
65
68
|
var _editorAPI$toolbar, _editorAPI$toolbar2, _useToolbarPortal;
|
|
66
69
|
var editorAPI = _ref4.editorAPI,
|
|
@@ -98,6 +101,15 @@ export var FullPageToolbarNext = function FullPageToolbarNext(_ref4) {
|
|
|
98
101
|
event.preventDefault();
|
|
99
102
|
event.stopPropagation();
|
|
100
103
|
}, [editorView]);
|
|
104
|
+
if (expValEquals('platform_editor_primary_toolbar_early_exit', 'isEnabled', true)) {
|
|
105
|
+
// Remove entire primary toolbar region if:
|
|
106
|
+
// - primary toolbar isn't registered
|
|
107
|
+
// - no custom primary toolbar components to render
|
|
108
|
+
// note: primary toolbar must render if toolbar docking preference is set to "controlled" to avoid SSR conflicts
|
|
109
|
+
if (!shouldShowToolbarContainer(toolbar, customPrimaryToolbarComponents)) {
|
|
110
|
+
return /*#__PURE__*/React.createElement(ToolbarPortal, null, null);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
101
113
|
return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, function (_ref6) {
|
|
102
114
|
var ContextPanelWidth = _ref6.width;
|
|
103
115
|
return /*#__PURE__*/React.createElement(ExcludeFromHydration, {
|
|
@@ -5,7 +5,6 @@ import { ToolbarSize } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
6
6
|
import { ToolbarButtonGroup, ToolbarDropdownItemSection, ToolbarSection } from '@atlaskit/editor-toolbar';
|
|
7
7
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
8
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
8
|
import { ToolbarInner } from './ToolbarInner';
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -64,7 +63,6 @@ export var ToolbarNext = function ToolbarNext(_ref) {
|
|
|
64
63
|
editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
|
|
65
64
|
// remove offline check when patch6Enabled is cleaned up
|
|
66
65
|
var isOffline = isOfflineMode(connectivityStateMode);
|
|
67
|
-
var patch6Enabled = expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true);
|
|
68
66
|
return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
|
|
69
67
|
editorView: editorView !== null && editorView !== void 0 ? editorView : null,
|
|
70
68
|
editorAppearance: editorAppearance,
|
|
@@ -73,7 +71,7 @@ export var ToolbarNext = function ToolbarNext(_ref) {
|
|
|
73
71
|
isOffline: isOffline
|
|
74
72
|
}, /*#__PURE__*/React.createElement(EditorToolbarUIProvider, {
|
|
75
73
|
api: editorAPI,
|
|
76
|
-
isDisabled:
|
|
74
|
+
isDisabled: isDisabled,
|
|
77
75
|
popupsMountPoint: popupsMountPoint,
|
|
78
76
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
79
77
|
popupsScrollableElement: popupsScrollableElement,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "216.7.
|
|
2
|
+
export var version = "216.7.14";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "216.7.
|
|
3
|
+
"version": "216.7.15",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
67
67
|
"@atlaskit/react-ufo": "^5.0.0",
|
|
68
68
|
"@atlaskit/task-decision": "^19.2.0",
|
|
69
|
-
"@atlaskit/tmp-editor-statsig": "^17.
|
|
69
|
+
"@atlaskit/tmp-editor-statsig": "^17.2.0",
|
|
70
70
|
"@atlaskit/tokens": "^10.1.0",
|
|
71
71
|
"@atlaskit/tooltip": "^20.14.0",
|
|
72
72
|
"@atlaskit/width-detector": "^5.0.0",
|