@atlaskit/editor-core 189.2.0 → 189.3.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/composable-editor/editor-internal.js +2 -1
- package/dist/cjs/presets/universal.js +8 -4
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +17 -12
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +2 -1
- package/dist/es2019/presets/universal.js +8 -4
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +33 -30
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +2 -1
- package/dist/esm/presets/universal.js +8 -4
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +17 -12
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +1 -0
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -1
- package/dist/types-ts4.5/types/editor-appearance-component.d.ts +1 -0
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -1
- package/package.json +1 -4
- package/report.api.md +2 -0
- package/tmp/api-report-tmp.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#42535](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42535) [`39770b766f1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/39770b766f1) - [ux] MODES-3618 Use hideAvatarGroup instead of feature flag to determine whether avatar should be hidden
|
|
8
|
+
|
|
3
9
|
## 189.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -125,7 +125,8 @@ function EditorInternal(_ref) {
|
|
|
125
125
|
enableToolbarMinWidth: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.toolbarMinWidthOverflow) != null ? !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.toolbarMinWidthOverflow) : props.allowUndoRedoButtons,
|
|
126
126
|
useStickyToolbar: props.useStickyToolbar,
|
|
127
127
|
featureFlags: featureFlags,
|
|
128
|
-
pluginHooks: config.pluginHooks
|
|
128
|
+
pluginHooks: config.pluginHooks,
|
|
129
|
+
hideAvatarGroup: props.hideAvatarGroup
|
|
129
130
|
}));
|
|
130
131
|
}
|
|
131
132
|
}), (0, _react2.jsx)(_portalProvider.PortalRenderer, {
|
|
@@ -368,14 +368,18 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
368
368
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
369
369
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
370
370
|
}]).maybeAdd(_plugins.beforePrimaryToolbarPlugin, function (plugin, builder) {
|
|
371
|
-
if (
|
|
371
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
372
372
|
return builder.add([plugin, {
|
|
373
373
|
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
374
374
|
}]);
|
|
375
375
|
}
|
|
376
376
|
return builder;
|
|
377
377
|
}).maybeAdd(_plugins.avatarGroupPlugin, function (plugin, builder) {
|
|
378
|
-
if (!
|
|
378
|
+
if (!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
379
|
+
// Avatars are moved to Confluence codebase for Edit in Context
|
|
380
|
+
// When Edit in Context is enabled primaryToolbarComponents is undefined
|
|
381
|
+
// For more details please check
|
|
382
|
+
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
379
383
|
return builder.add([plugin, {
|
|
380
384
|
collabEdit: props.collabEdit,
|
|
381
385
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
@@ -385,8 +389,8 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
385
389
|
}).maybeAdd(_plugins.findReplacePlugin, function (plugin, builder) {
|
|
386
390
|
if (props.allowFindReplace) {
|
|
387
391
|
return builder.add([plugin, {
|
|
388
|
-
takeFullWidth: !
|
|
389
|
-
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
392
|
+
takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
393
|
+
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
390
394
|
}]);
|
|
391
395
|
}
|
|
392
396
|
return builder;
|
|
@@ -77,7 +77,8 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
77
77
|
primaryToolbarComponents: props.primaryToolbarComponents,
|
|
78
78
|
providerFactory: props.providerFactory,
|
|
79
79
|
showKeyline: showKeyline,
|
|
80
|
-
featureFlags: props.featureFlags
|
|
80
|
+
featureFlags: props.featureFlags,
|
|
81
|
+
hideAvatarGroup: props.hideAvatarGroup
|
|
81
82
|
}), (0, _react2.jsx)(_FullPageContentArea.FullPageContentArea, {
|
|
82
83
|
ref: scrollContentContainerRef,
|
|
83
84
|
appearance: props.appearance,
|
|
@@ -18,19 +18,21 @@ var _MainToolbar = require("./MainToolbar");
|
|
|
18
18
|
var _ui2 = require("@atlaskit/editor-common/ui");
|
|
19
19
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
20
20
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
21
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
21
|
var _context = require("../../../presets/context");
|
|
23
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
23
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
24
|
/** @jsx jsx */
|
|
26
25
|
|
|
27
26
|
var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
|
|
28
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$
|
|
27
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
|
|
29
28
|
var _useState = (0, _react.useState)(false),
|
|
30
29
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
31
30
|
shouldSplitToolbar = _useState2[0],
|
|
32
31
|
setShouldSplitToolbar = _useState2[1];
|
|
33
32
|
var editorAPI = (0, _context.usePresetContext)();
|
|
33
|
+
|
|
34
|
+
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
35
|
+
var twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
|
|
34
36
|
var nonCustomToolbar = (0, _react2.jsx)("div", {
|
|
35
37
|
css: _MainToolbar.nonCustomToolbarWrapperStyle
|
|
36
38
|
}, props.beforeIcon && (0, _react2.jsx)("div", {
|
|
@@ -49,20 +51,25 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
49
51
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
50
52
|
containerElement: props.containerElement,
|
|
51
53
|
hasMinWidth: props.hasMinWidth,
|
|
52
|
-
twoLineEditorToolbar:
|
|
54
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
53
55
|
}));
|
|
54
56
|
var customToolbar = (0, _react2.jsx)("div", {
|
|
55
57
|
css: _MainToolbar.customToolbarWrapperStyle
|
|
56
|
-
},
|
|
58
|
+
}, twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? (0, _react2.jsx)(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
|
|
57
59
|
beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
|
|
58
|
-
}) : null,
|
|
60
|
+
}) : null, props.hideAvatarGroup || (props === null || props === void 0 || (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null :
|
|
61
|
+
// Avatars are moved to Confluence codebase for Edit in Context
|
|
62
|
+
// When Edit in Context is enabled customPrimaryToolbarComponents is undefined
|
|
63
|
+
// For more details please check
|
|
64
|
+
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
65
|
+
(0, _react2.jsx)(_ui.default, {
|
|
59
66
|
editorView: props.editorView,
|
|
60
67
|
eventDispatcher: props.eventDispatcher,
|
|
61
68
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
62
69
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
63
70
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
64
71
|
featureFlags: props.featureFlags || {}
|
|
65
|
-
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace &&
|
|
72
|
+
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? (0, _react2.jsx)(_FindReplaceToolbarButtonWithState.default, {
|
|
66
73
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
67
74
|
popupsMountPoint: props.popupsMountPoint,
|
|
68
75
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
@@ -72,8 +79,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
72
79
|
featureFlags: props.featureFlags
|
|
73
80
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
74
81
|
(0, _react.useEffect)(function () {
|
|
75
|
-
|
|
76
|
-
if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
|
|
82
|
+
if (twoLineEditorToolbar) {
|
|
77
83
|
var updateOnResize = function updateOnResize() {
|
|
78
84
|
setShouldSplitToolbar(window.innerWidth <= _MainToolbar.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
|
|
79
85
|
};
|
|
@@ -98,7 +104,6 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
98
104
|
event.stopPropagation();
|
|
99
105
|
};
|
|
100
106
|
return (0, _react2.jsx)(_ui2.ContextPanelConsumer, null, function (_ref) {
|
|
101
|
-
var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
|
|
102
107
|
var contextPanelWidth = _ref.width;
|
|
103
108
|
return (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
104
109
|
editorView: props.editorView,
|
|
@@ -107,14 +112,14 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
107
112
|
handleEscape: handleEscape,
|
|
108
113
|
intl: props.intl
|
|
109
114
|
}, (0, _react2.jsx)("div", {
|
|
110
|
-
css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0,
|
|
115
|
+
css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, twoLineEditorToolbar),
|
|
111
116
|
"data-testid": "ak-editor-main-toolbar"
|
|
112
117
|
}, (0, _react2.jsx)("div", {
|
|
113
|
-
css: (0, _MainToolbar.mainToolbarFirstChildStyle)(
|
|
118
|
+
css: (0, _MainToolbar.mainToolbarFirstChildStyle)(twoLineEditorToolbar),
|
|
114
119
|
role: "toolbar",
|
|
115
120
|
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.toolbarLabel)
|
|
116
121
|
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), (0, _react2.jsx)("div", {
|
|
117
|
-
css: (0, _MainToolbar.mainToolbarSecondChildStyle)(
|
|
122
|
+
css: (0, _MainToolbar.mainToolbarSecondChildStyle)(twoLineEditorToolbar),
|
|
118
123
|
"data-testid": 'avatar-group-outside-plugin',
|
|
119
124
|
role: "region",
|
|
120
125
|
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.pageActionsLabel)
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "189.
|
|
8
|
+
var version = exports.version = "189.3.0";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -118,7 +118,8 @@ export function EditorInternal({
|
|
|
118
118
|
enableToolbarMinWidth: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.toolbarMinWidthOverflow) != null ? !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.toolbarMinWidthOverflow) : props.allowUndoRedoButtons,
|
|
119
119
|
useStickyToolbar: props.useStickyToolbar,
|
|
120
120
|
featureFlags: featureFlags,
|
|
121
|
-
pluginHooks: config.pluginHooks
|
|
121
|
+
pluginHooks: config.pluginHooks,
|
|
122
|
+
hideAvatarGroup: props.hideAvatarGroup
|
|
122
123
|
}));
|
|
123
124
|
}
|
|
124
125
|
}), jsx(PortalRenderer, {
|
|
@@ -365,14 +365,18 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
365
365
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
366
366
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
367
367
|
}]).maybeAdd(beforePrimaryToolbarPlugin, (plugin, builder) => {
|
|
368
|
-
if (
|
|
368
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
369
369
|
return builder.add([plugin, {
|
|
370
370
|
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
371
371
|
}]);
|
|
372
372
|
}
|
|
373
373
|
return builder;
|
|
374
374
|
}).maybeAdd(avatarGroupPlugin, (plugin, builder) => {
|
|
375
|
-
if (!
|
|
375
|
+
if (!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
376
|
+
// Avatars are moved to Confluence codebase for Edit in Context
|
|
377
|
+
// When Edit in Context is enabled primaryToolbarComponents is undefined
|
|
378
|
+
// For more details please check
|
|
379
|
+
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
376
380
|
return builder.add([plugin, {
|
|
377
381
|
collabEdit: props.collabEdit,
|
|
378
382
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
@@ -382,8 +386,8 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
382
386
|
}).maybeAdd(findReplacePlugin, (plugin, builder) => {
|
|
383
387
|
if (props.allowFindReplace) {
|
|
384
388
|
return builder.add([plugin, {
|
|
385
|
-
takeFullWidth: !
|
|
386
|
-
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
389
|
+
takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
390
|
+
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
387
391
|
}]);
|
|
388
392
|
}
|
|
389
393
|
return builder;
|
|
@@ -58,7 +58,8 @@ export const FullPageEditor = props => {
|
|
|
58
58
|
primaryToolbarComponents: props.primaryToolbarComponents,
|
|
59
59
|
providerFactory: props.providerFactory,
|
|
60
60
|
showKeyline: showKeyline,
|
|
61
|
-
featureFlags: props.featureFlags
|
|
61
|
+
featureFlags: props.featureFlags,
|
|
62
|
+
hideAvatarGroup: props.hideAvatarGroup
|
|
62
63
|
}), jsx(FullPageContentArea, {
|
|
63
64
|
ref: scrollContentContainerRef,
|
|
64
65
|
appearance: props.appearance,
|
|
@@ -11,12 +11,14 @@ import { mainToolbarStyle, mainToolbarIconBeforeStyle, mainToolbarFirstChildStyl
|
|
|
11
11
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
14
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { usePresetContext } from '../../../presets/context';
|
|
16
15
|
export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
17
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$
|
|
16
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
|
|
18
17
|
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
19
18
|
const editorAPI = usePresetContext();
|
|
19
|
+
|
|
20
|
+
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
21
|
+
const twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
|
|
20
22
|
const nonCustomToolbar = jsx("div", {
|
|
21
23
|
css: nonCustomToolbarWrapperStyle
|
|
22
24
|
}, props.beforeIcon && jsx("div", {
|
|
@@ -35,20 +37,25 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
35
37
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
36
38
|
containerElement: props.containerElement,
|
|
37
39
|
hasMinWidth: props.hasMinWidth,
|
|
38
|
-
twoLineEditorToolbar:
|
|
40
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
39
41
|
}));
|
|
40
42
|
const customToolbar = jsx("div", {
|
|
41
43
|
css: customToolbarWrapperStyle
|
|
42
|
-
},
|
|
44
|
+
}, twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? jsx(BeforePrimaryToolbarWrapper, {
|
|
43
45
|
beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
|
|
44
|
-
}) : null,
|
|
46
|
+
}) : null, props.hideAvatarGroup || (props === null || props === void 0 ? void 0 : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null :
|
|
47
|
+
// Avatars are moved to Confluence codebase for Edit in Context
|
|
48
|
+
// When Edit in Context is enabled customPrimaryToolbarComponents is undefined
|
|
49
|
+
// For more details please check
|
|
50
|
+
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
51
|
+
jsx(AvatarsWithPluginState, {
|
|
45
52
|
editorView: props.editorView,
|
|
46
53
|
eventDispatcher: props.eventDispatcher,
|
|
47
54
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
48
55
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
49
56
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
50
57
|
featureFlags: props.featureFlags || {}
|
|
51
|
-
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace &&
|
|
58
|
+
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? jsx(FindReplaceToolbarButtonWithState, {
|
|
52
59
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
53
60
|
popupsMountPoint: props.popupsMountPoint,
|
|
54
61
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
@@ -58,8 +65,7 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
58
65
|
featureFlags: props.featureFlags
|
|
59
66
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
60
67
|
useEffect(() => {
|
|
61
|
-
|
|
62
|
-
if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
|
|
68
|
+
if (twoLineEditorToolbar) {
|
|
63
69
|
const updateOnResize = () => {
|
|
64
70
|
setShouldSplitToolbar(window.innerWidth <= MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
|
|
65
71
|
};
|
|
@@ -83,27 +89,24 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
83
89
|
};
|
|
84
90
|
return jsx(ContextPanelConsumer, null, ({
|
|
85
91
|
width: contextPanelWidth
|
|
86
|
-
}) => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"aria-label": props.intl.formatMessage(messages.pageActionsLabel)
|
|
106
|
-
}, shouldSplitToolbar ? nonCustomToolbar : customToolbar)));
|
|
107
|
-
});
|
|
92
|
+
}) => jsx(ToolbarArrowKeyNavigationProvider, {
|
|
93
|
+
editorView: props.editorView,
|
|
94
|
+
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
95
|
+
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
96
|
+
handleEscape: handleEscape,
|
|
97
|
+
intl: props.intl
|
|
98
|
+
}, jsx("div", {
|
|
99
|
+
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, twoLineEditorToolbar),
|
|
100
|
+
"data-testid": "ak-editor-main-toolbar"
|
|
101
|
+
}, jsx("div", {
|
|
102
|
+
css: mainToolbarFirstChildStyle(twoLineEditorToolbar),
|
|
103
|
+
role: "toolbar",
|
|
104
|
+
"aria-label": props.intl.formatMessage(messages.toolbarLabel)
|
|
105
|
+
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), jsx("div", {
|
|
106
|
+
css: mainToolbarSecondChildStyle(twoLineEditorToolbar),
|
|
107
|
+
"data-testid": 'avatar-group-outside-plugin',
|
|
108
|
+
role: "region",
|
|
109
|
+
"aria-label": props.intl.formatMessage(messages.pageActionsLabel)
|
|
110
|
+
}, shouldSplitToolbar ? nonCustomToolbar : customToolbar))));
|
|
108
111
|
});
|
|
109
112
|
export const FullPageToolbar = injectIntl(EditorToolbar);
|
|
@@ -119,7 +119,8 @@ export function EditorInternal(_ref) {
|
|
|
119
119
|
enableToolbarMinWidth: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.toolbarMinWidthOverflow) != null ? !!((_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.toolbarMinWidthOverflow) : props.allowUndoRedoButtons,
|
|
120
120
|
useStickyToolbar: props.useStickyToolbar,
|
|
121
121
|
featureFlags: featureFlags,
|
|
122
|
-
pluginHooks: config.pluginHooks
|
|
122
|
+
pluginHooks: config.pluginHooks,
|
|
123
|
+
hideAvatarGroup: props.hideAvatarGroup
|
|
123
124
|
}));
|
|
124
125
|
}
|
|
125
126
|
}), jsx(PortalRenderer, {
|
|
@@ -361,14 +361,18 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
361
361
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
362
362
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
363
363
|
}]).maybeAdd(beforePrimaryToolbarPlugin, function (plugin, builder) {
|
|
364
|
-
if (
|
|
364
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
365
365
|
return builder.add([plugin, {
|
|
366
366
|
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
367
367
|
}]);
|
|
368
368
|
}
|
|
369
369
|
return builder;
|
|
370
370
|
}).maybeAdd(avatarGroupPlugin, function (plugin, builder) {
|
|
371
|
-
if (!
|
|
371
|
+
if (!props.hideAvatarGroup && featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
372
|
+
// Avatars are moved to Confluence codebase for Edit in Context
|
|
373
|
+
// When Edit in Context is enabled primaryToolbarComponents is undefined
|
|
374
|
+
// For more details please check
|
|
375
|
+
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
372
376
|
return builder.add([plugin, {
|
|
373
377
|
collabEdit: props.collabEdit,
|
|
374
378
|
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
@@ -378,8 +382,8 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
378
382
|
}).maybeAdd(findReplacePlugin, function (plugin, builder) {
|
|
379
383
|
if (props.allowFindReplace) {
|
|
380
384
|
return builder.add([plugin, {
|
|
381
|
-
takeFullWidth: !
|
|
382
|
-
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
385
|
+
takeFullWidth: !props.hideAvatarGroup && !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
386
|
+
twoLineEditorToolbar: !!props.primaryToolbarComponents && !!featureFlags.twoLineEditorToolbar
|
|
383
387
|
}]);
|
|
384
388
|
}
|
|
385
389
|
return builder;
|
|
@@ -66,7 +66,8 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
66
66
|
primaryToolbarComponents: props.primaryToolbarComponents,
|
|
67
67
|
providerFactory: props.providerFactory,
|
|
68
68
|
showKeyline: showKeyline,
|
|
69
|
-
featureFlags: props.featureFlags
|
|
69
|
+
featureFlags: props.featureFlags,
|
|
70
|
+
hideAvatarGroup: props.hideAvatarGroup
|
|
70
71
|
}), jsx(FullPageContentArea, {
|
|
71
72
|
ref: scrollContentContainerRef,
|
|
72
73
|
appearance: props.appearance,
|
|
@@ -12,15 +12,17 @@ import { mainToolbarStyle, mainToolbarIconBeforeStyle, mainToolbarFirstChildStyl
|
|
|
12
12
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
13
13
|
import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
|
|
14
14
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
15
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
import { usePresetContext } from '../../../presets/context';
|
|
17
16
|
export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
18
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$
|
|
17
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3;
|
|
19
18
|
var _useState = useState(false),
|
|
20
19
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21
20
|
shouldSplitToolbar = _useState2[0],
|
|
22
21
|
setShouldSplitToolbar = _useState2[1];
|
|
23
22
|
var editorAPI = usePresetContext();
|
|
23
|
+
|
|
24
|
+
// When primary toolbar components is undefined, do not show two line editor toolbar
|
|
25
|
+
var twoLineEditorToolbar = !!props.customPrimaryToolbarComponents && !!((_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar);
|
|
24
26
|
var nonCustomToolbar = jsx("div", {
|
|
25
27
|
css: nonCustomToolbarWrapperStyle
|
|
26
28
|
}, props.beforeIcon && jsx("div", {
|
|
@@ -39,20 +41,25 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
39
41
|
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
40
42
|
containerElement: props.containerElement,
|
|
41
43
|
hasMinWidth: props.hasMinWidth,
|
|
42
|
-
twoLineEditorToolbar:
|
|
44
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
43
45
|
}));
|
|
44
46
|
var customToolbar = jsx("div", {
|
|
45
47
|
css: customToolbarWrapperStyle
|
|
46
|
-
},
|
|
48
|
+
}, twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? jsx(BeforePrimaryToolbarWrapper, {
|
|
47
49
|
beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
|
|
48
|
-
}) : null,
|
|
50
|
+
}) : null, props.hideAvatarGroup || (props === null || props === void 0 || (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null :
|
|
51
|
+
// Avatars are moved to Confluence codebase for Edit in Context
|
|
52
|
+
// When Edit in Context is enabled customPrimaryToolbarComponents is undefined
|
|
53
|
+
// For more details please check
|
|
54
|
+
// https://hello.atlassian.net/wiki/spaces/PCG/pages/2851572180/Editor+toolbar+for+live+pages+and+edit+in+context+projects
|
|
55
|
+
jsx(AvatarsWithPluginState, {
|
|
49
56
|
editorView: props.editorView,
|
|
50
57
|
eventDispatcher: props.eventDispatcher,
|
|
51
58
|
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
52
59
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
53
60
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
54
61
|
featureFlags: props.featureFlags || {}
|
|
55
|
-
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace &&
|
|
62
|
+
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && twoLineEditorToolbar ? jsx(FindReplaceToolbarButtonWithState, {
|
|
56
63
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
57
64
|
popupsMountPoint: props.popupsMountPoint,
|
|
58
65
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
@@ -62,8 +69,7 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
62
69
|
featureFlags: props.featureFlags
|
|
63
70
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
64
71
|
useEffect(function () {
|
|
65
|
-
|
|
66
|
-
if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
|
|
72
|
+
if (twoLineEditorToolbar) {
|
|
67
73
|
var updateOnResize = function updateOnResize() {
|
|
68
74
|
setShouldSplitToolbar(window.innerWidth <= MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
|
|
69
75
|
};
|
|
@@ -88,7 +94,6 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
88
94
|
event.stopPropagation();
|
|
89
95
|
};
|
|
90
96
|
return jsx(ContextPanelConsumer, null, function (_ref) {
|
|
91
|
-
var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
|
|
92
97
|
var contextPanelWidth = _ref.width;
|
|
93
98
|
return jsx(ToolbarArrowKeyNavigationProvider, {
|
|
94
99
|
editorView: props.editorView,
|
|
@@ -97,14 +102,14 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
97
102
|
handleEscape: handleEscape,
|
|
98
103
|
intl: props.intl
|
|
99
104
|
}, jsx("div", {
|
|
100
|
-
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0,
|
|
105
|
+
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, twoLineEditorToolbar),
|
|
101
106
|
"data-testid": "ak-editor-main-toolbar"
|
|
102
107
|
}, jsx("div", {
|
|
103
|
-
css: mainToolbarFirstChildStyle(
|
|
108
|
+
css: mainToolbarFirstChildStyle(twoLineEditorToolbar),
|
|
104
109
|
role: "toolbar",
|
|
105
110
|
"aria-label": props.intl.formatMessage(messages.toolbarLabel)
|
|
106
111
|
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), jsx("div", {
|
|
107
|
-
css: mainToolbarSecondChildStyle(
|
|
112
|
+
css: mainToolbarSecondChildStyle(twoLineEditorToolbar),
|
|
108
113
|
"data-testid": 'avatar-group-outside-plugin',
|
|
109
114
|
role: "region",
|
|
110
115
|
"aria-label": props.intl.formatMessage(messages.pageActionsLabel)
|
|
@@ -149,6 +149,7 @@ export interface EditorSharedPropsWithPlugins {
|
|
|
149
149
|
* Configure and extend editor linking behaviour
|
|
150
150
|
*/
|
|
151
151
|
linking?: LinkingOptions;
|
|
152
|
+
hideAvatarGroup?: boolean;
|
|
152
153
|
}
|
|
153
154
|
export interface EditorProps extends EditorBaseProps, EditorPluginFeatureProps, EditorSharedPropsWithPlugins, EditorProviderProps {
|
|
154
155
|
/**
|
|
@@ -30,7 +30,8 @@ export interface FullPageToolbarProps {
|
|
|
30
30
|
containerElement: HTMLElement | null;
|
|
31
31
|
beforeIcon?: ReactElement;
|
|
32
32
|
hasMinWidth?: boolean;
|
|
33
|
-
featureFlags
|
|
33
|
+
featureFlags: FeatureFlags;
|
|
34
|
+
hideAvatarGroup?: boolean;
|
|
34
35
|
}
|
|
35
36
|
export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element>;
|
|
36
37
|
export declare const FullPageToolbar: React.FC<import("react-intl-next").WithIntlProps<FullPageToolbarProps & WrappedComponentProps<"intl">>> & {
|
|
@@ -149,6 +149,7 @@ export interface EditorSharedPropsWithPlugins {
|
|
|
149
149
|
* Configure and extend editor linking behaviour
|
|
150
150
|
*/
|
|
151
151
|
linking?: LinkingOptions;
|
|
152
|
+
hideAvatarGroup?: boolean;
|
|
152
153
|
}
|
|
153
154
|
export interface EditorProps extends EditorBaseProps, EditorPluginFeatureProps, EditorSharedPropsWithPlugins, EditorProviderProps {
|
|
154
155
|
/**
|
|
@@ -30,7 +30,8 @@ export interface FullPageToolbarProps {
|
|
|
30
30
|
containerElement: HTMLElement | null;
|
|
31
31
|
beforeIcon?: ReactElement;
|
|
32
32
|
hasMinWidth?: boolean;
|
|
33
|
-
featureFlags
|
|
33
|
+
featureFlags: FeatureFlags;
|
|
34
|
+
hideAvatarGroup?: boolean;
|
|
34
35
|
}
|
|
35
36
|
export declare const EditorToolbar: React.MemoExoticComponent<(props: FullPageToolbarProps & WrappedComponentProps) => jsx.JSX.Element>;
|
|
36
37
|
export declare const FullPageToolbar: React.FC<import("react-intl-next").WithIntlProps<FullPageToolbarProps & WrappedComponentProps<"intl">>> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "189.
|
|
3
|
+
"version": "189.3.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -237,9 +237,6 @@
|
|
|
237
237
|
"platform.editor.custom-table-width": {
|
|
238
238
|
"type": "boolean"
|
|
239
239
|
},
|
|
240
|
-
"platform.confluence.frontend.editor.no.platform.avatar.group": {
|
|
241
|
-
"type": "boolean"
|
|
242
|
-
},
|
|
243
240
|
"platform.linking-platform.editor.fix-link-insert-analytics": {
|
|
244
241
|
"type": "boolean"
|
|
245
242
|
},
|
package/report.api.md
CHANGED
|
@@ -541,6 +541,8 @@ interface EditorSharedPropsWithPlugins {
|
|
|
541
541
|
allowUndoRedoButtons?: boolean;
|
|
542
542
|
// (undocumented)
|
|
543
543
|
collabEdit?: CollabEditOptions;
|
|
544
|
+
// (undocumented)
|
|
545
|
+
hideAvatarGroup?: boolean;
|
|
544
546
|
linking?: LinkingOptions;
|
|
545
547
|
// (undocumented)
|
|
546
548
|
media?: MediaOptions;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -496,6 +496,8 @@ interface EditorSharedPropsWithPlugins {
|
|
|
496
496
|
allowUndoRedoButtons?: boolean;
|
|
497
497
|
// (undocumented)
|
|
498
498
|
collabEdit?: CollabEditOptions;
|
|
499
|
+
// (undocumented)
|
|
500
|
+
hideAvatarGroup?: boolean;
|
|
499
501
|
linking?: LinkingOptions;
|
|
500
502
|
// (undocumented)
|
|
501
503
|
media?: MediaOptions;
|