@atlaskit/editor-core 189.1.15 → 189.2.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 +12 -0
- package/dist/cjs/composable-editor/editor-internal.js +22 -1
- package/dist/cjs/create-editor/feature-flags-from-props.js +4 -5
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/universal.js +3 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +10 -8
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/composable-editor/editor-internal.js +25 -2
- package/dist/es2019/create-editor/feature-flags-from-props.js +4 -5
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/universal.js +3 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +10 -8
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/composable-editor/editor-internal.js +23 -2
- package/dist/esm/create-editor/feature-flags-from-props.js +4 -5
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/universal.js +3 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +10 -8
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/get-ui-component.d.ts +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/get-ui-component.d.ts +1 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
- package/package.json +5 -4
- package/report.api.md +1 -8
- package/tmp/api-report-tmp.d.ts +1 -8
- package/dist/cjs/plugins/panel/actions.js +0 -125
- package/dist/cjs/plugins/panel/index.js +0 -215
- package/dist/cjs/plugins/panel/message.js +0 -44
- package/dist/cjs/plugins/panel/nodeviews/panel.js +0 -94
- package/dist/cjs/plugins/panel/pm-plugins/keymaps.js +0 -81
- package/dist/cjs/plugins/panel/pm-plugins/main.js +0 -28
- package/dist/cjs/plugins/panel/toolbar.js +0 -293
- package/dist/cjs/plugins/panel/types.js +0 -8
- package/dist/cjs/plugins/panel/utils.js +0 -53
- package/dist/es2019/plugins/panel/actions.js +0 -116
- package/dist/es2019/plugins/panel/index.js +0 -192
- package/dist/es2019/plugins/panel/message.js +0 -38
- package/dist/es2019/plugins/panel/nodeviews/panel.js +0 -82
- package/dist/es2019/plugins/panel/pm-plugins/keymaps.js +0 -82
- package/dist/es2019/plugins/panel/pm-plugins/main.js +0 -21
- package/dist/es2019/plugins/panel/toolbar.js +0 -279
- package/dist/es2019/plugins/panel/types.js +0 -2
- package/dist/es2019/plugins/panel/utils.js +0 -48
- package/dist/esm/plugins/panel/actions.js +0 -116
- package/dist/esm/plugins/panel/index.js +0 -209
- package/dist/esm/plugins/panel/message.js +0 -38
- package/dist/esm/plugins/panel/nodeviews/panel.js +0 -87
- package/dist/esm/plugins/panel/pm-plugins/keymaps.js +0 -74
- package/dist/esm/plugins/panel/pm-plugins/main.js +0 -22
- package/dist/esm/plugins/panel/toolbar.js +0 -286
- package/dist/esm/plugins/panel/types.js +0 -2
- package/dist/esm/plugins/panel/utils.js +0 -46
- package/dist/types/plugins/panel/actions.d.ts +0 -12
- package/dist/types/plugins/panel/index.d.ts +0 -17
- package/dist/types/plugins/panel/message.d.ts +0 -37
- package/dist/types/plugins/panel/nodeviews/panel.d.ts +0 -36
- package/dist/types/plugins/panel/pm-plugins/keymaps.d.ts +0 -3
- package/dist/types/plugins/panel/pm-plugins/main.d.ts +0 -11
- package/dist/types/plugins/panel/toolbar.d.ts +0 -15
- package/dist/types/plugins/panel/types.d.ts +0 -21
- package/dist/types/plugins/panel/utils.d.ts +0 -5
- package/dist/types-ts4.5/plugins/panel/actions.d.ts +0 -12
- package/dist/types-ts4.5/plugins/panel/index.d.ts +0 -17
- package/dist/types-ts4.5/plugins/panel/message.d.ts +0 -37
- package/dist/types-ts4.5/plugins/panel/nodeviews/panel.d.ts +0 -36
- package/dist/types-ts4.5/plugins/panel/pm-plugins/keymaps.d.ts +0 -3
- package/dist/types-ts4.5/plugins/panel/pm-plugins/main.d.ts +0 -11
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +0 -15
- package/dist/types-ts4.5/plugins/panel/types.d.ts +0 -21
- package/dist/types-ts4.5/plugins/panel/utils.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#42452](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42452) [`bdbe13c80c9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bdbe13c80c9) - ED-19900 Removing indentationButtonsInTheToolbar FF fallback from showIndentationButtons editor prop.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#42352](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42352) [`965649a4121`](https://bitbucket.org/atlassian/atlassian-frontend/commits/965649a4121) - Decouple find replace prop from the full page toolbar.
|
|
12
|
+
- [#42604](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42604) [`182627d0f5e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/182627d0f5e) - Extracted panel plugin from editor-core as @atlaskit/editor-plugin-panel
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 189.1.15
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.EditorInternal = EditorInternal;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _react = require("react");
|
|
10
11
|
var _react2 = require("@emotion/react");
|
|
@@ -74,7 +75,7 @@ function EditorInternal(_ref) {
|
|
|
74
75
|
onAnalyticsEvent: handleAnalyticsEvent,
|
|
75
76
|
useAnalyticsContext: props.UNSAFE_useAnalyticsContext,
|
|
76
77
|
render: function render(portalProviderAPI) {
|
|
77
|
-
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(
|
|
78
|
+
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(ReactEditorViewContextWrapper, {
|
|
78
79
|
editorProps: overriddenEditorProps,
|
|
79
80
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
80
81
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -132,4 +133,24 @@ function EditorInternal(_ref) {
|
|
|
132
133
|
}));
|
|
133
134
|
}
|
|
134
135
|
}))))));
|
|
136
|
+
}
|
|
137
|
+
function ReactEditorViewContextWrapper(props) {
|
|
138
|
+
var setInternalEditorAPI = (0, _context.useSetPresetContext)();
|
|
139
|
+
var setExternalEditorAPI = props.setEditorApi;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* We use the context to retrieve the editorAPI
|
|
143
|
+
* externally for consumers via `usePreset`.
|
|
144
|
+
*
|
|
145
|
+
* However we also may need to retrieve this value internally via context
|
|
146
|
+
* so we should also set the value for the `EditorContext` that is used in
|
|
147
|
+
* `EditorInternal`.
|
|
148
|
+
*/
|
|
149
|
+
var setEditorAPI = (0, _react.useCallback)(function (api) {
|
|
150
|
+
setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
|
|
151
|
+
setExternalEditorAPI === null || setExternalEditorAPI === void 0 || setExternalEditorAPI(api);
|
|
152
|
+
}, [setInternalEditorAPI, setExternalEditorAPI]);
|
|
153
|
+
return (0, _react2.jsx)(_ReactEditorView.default, (0, _extends2.default)({}, props, {
|
|
154
|
+
setEditorApi: setEditorAPI
|
|
155
|
+
}));
|
|
135
156
|
}
|
|
@@ -32,7 +32,7 @@ function getSpellCheck(featureFlags) {
|
|
|
32
32
|
* which is used by both current and archv3 editors.
|
|
33
33
|
*/
|
|
34
34
|
function createFeatureFlagsFromProps(props) {
|
|
35
|
-
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20
|
|
35
|
+
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20;
|
|
36
36
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
37
37
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
38
38
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
@@ -54,13 +54,12 @@ function createFeatureFlagsFromProps(props) {
|
|
|
54
54
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
55
55
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
56
56
|
showHoverPreview: Boolean(typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.showHoverPreview) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.showHoverPreview) : false),
|
|
57
|
-
|
|
58
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
57
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
59
58
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
60
59
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
61
60
|
// are included (they are not kebab cased)
|
|
62
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
61
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.restartNumberedLists) === true,
|
|
63
62
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
64
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
63
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags20 = props.featureFlags) !== null && _props$featureFlags20 !== void 0 && _props$featureFlags20['prevent-popup-overflow']) : false)
|
|
65
64
|
});
|
|
66
65
|
}
|
|
@@ -149,12 +149,6 @@ Object.defineProperty(exports, "mobileSelectionPlugin", {
|
|
|
149
149
|
return _mobileSelection.default;
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
|
-
Object.defineProperty(exports, "panelPlugin", {
|
|
153
|
-
enumerable: true,
|
|
154
|
-
get: function get() {
|
|
155
|
-
return _panel.default;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
152
|
Object.defineProperty(exports, "pastePlugin", {
|
|
159
153
|
enumerable: true,
|
|
160
154
|
get: function get() {
|
|
@@ -194,7 +188,6 @@ var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
|
194
188
|
var _toolbarListsIndentation = _interopRequireDefault(require("./toolbar-lists-indentation"));
|
|
195
189
|
var _macro = _interopRequireDefault(require("./macro"));
|
|
196
190
|
var _maxContentSize = _interopRequireDefault(require("./max-content-size"));
|
|
197
|
-
var _panel = _interopRequireDefault(require("./panel"));
|
|
198
191
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
199
192
|
var _tasksAndDecisions = _interopRequireDefault(require("./tasks-and-decisions"));
|
|
200
193
|
var _breakout = _interopRequireDefault(require("./breakout"));
|
|
@@ -8,6 +8,7 @@ exports.default = createUniversalPreset;
|
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _plugins = require("../plugins");
|
|
11
|
+
var _editorPluginPanel = require("@atlaskit/editor-plugin-panel");
|
|
11
12
|
var _editorPluginTextColor = require("@atlaskit/editor-plugin-text-color");
|
|
12
13
|
var _editorPluginHistory = require("@atlaskit/editor-plugin-history");
|
|
13
14
|
var _editorPluginStatus = require("@atlaskit/editor-plugin-status");
|
|
@@ -243,7 +244,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
243
244
|
return builder.add(plugin);
|
|
244
245
|
}
|
|
245
246
|
return builder;
|
|
246
|
-
}).maybeAdd(
|
|
247
|
+
}).maybeAdd(_editorPluginPanel.panelPlugin, function (plugin, builder) {
|
|
247
248
|
if (props.allowPanel) {
|
|
248
249
|
var allowPanel = (0, _typeof2.default)(props.allowPanel) === 'object' ? props.allowPanel : {};
|
|
249
250
|
return builder.add([plugin, {
|
|
@@ -356,7 +357,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
356
357
|
}
|
|
357
358
|
return builder;
|
|
358
359
|
}).add([_plugins.toolbarListsIndentationPlugin, {
|
|
359
|
-
showIndentationButtons: !!
|
|
360
|
+
showIndentationButtons: !!props.showIndentationButtons,
|
|
360
361
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
361
362
|
}]).add([_plugins.insertBlockPlugin, {
|
|
362
363
|
allowTables: !!props.allowTables,
|
|
@@ -19,16 +19,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
21
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
|
+
var _context = require("../../../presets/context");
|
|
22
23
|
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); }
|
|
23
24
|
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; }
|
|
24
25
|
/** @jsx jsx */
|
|
25
26
|
|
|
26
27
|
var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(function (props) {
|
|
27
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5
|
|
28
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5;
|
|
28
29
|
var _useState = (0, _react.useState)(false),
|
|
29
30
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
30
31
|
shouldSplitToolbar = _useState2[0],
|
|
31
32
|
setShouldSplitToolbar = _useState2[1];
|
|
33
|
+
var editorAPI = (0, _context.usePresetContext)();
|
|
32
34
|
var nonCustomToolbar = (0, _react2.jsx)("div", {
|
|
33
35
|
css: _MainToolbar.nonCustomToolbarWrapperStyle
|
|
34
36
|
}, props.beforeIcon && (0, _react2.jsx)("div", {
|
|
@@ -60,7 +62,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
60
62
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
61
63
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
62
64
|
featureFlags: props.featureFlags || {}
|
|
63
|
-
}),
|
|
65
|
+
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.twoLineEditorToolbar ? (0, _react2.jsx)(_FindReplaceToolbarButtonWithState.default, {
|
|
64
66
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
65
67
|
popupsMountPoint: props.popupsMountPoint,
|
|
66
68
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
@@ -70,8 +72,8 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
70
72
|
featureFlags: props.featureFlags
|
|
71
73
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
72
74
|
(0, _react.useEffect)(function () {
|
|
73
|
-
var _props$
|
|
74
|
-
if ((_props$
|
|
75
|
+
var _props$featureFlags6;
|
|
76
|
+
if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
|
|
75
77
|
var updateOnResize = function updateOnResize() {
|
|
76
78
|
setShouldSplitToolbar(window.innerWidth <= _MainToolbar.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
|
|
77
79
|
};
|
|
@@ -96,7 +98,7 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
96
98
|
event.stopPropagation();
|
|
97
99
|
};
|
|
98
100
|
return (0, _react2.jsx)(_ui2.ContextPanelConsumer, null, function (_ref) {
|
|
99
|
-
var _props$
|
|
101
|
+
var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
|
|
100
102
|
var contextPanelWidth = _ref.width;
|
|
101
103
|
return (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
102
104
|
editorView: props.editorView,
|
|
@@ -105,14 +107,14 @@ var EditorToolbar = exports.EditorToolbar = /*#__PURE__*/_react.default.memo(fun
|
|
|
105
107
|
handleEscape: handleEscape,
|
|
106
108
|
intl: props.intl
|
|
107
109
|
}, (0, _react2.jsx)("div", {
|
|
108
|
-
css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, !!((_props$
|
|
110
|
+
css: (0, _MainToolbar.mainToolbarStyle)(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.twoLineEditorToolbar)),
|
|
109
111
|
"data-testid": "ak-editor-main-toolbar"
|
|
110
112
|
}, (0, _react2.jsx)("div", {
|
|
111
|
-
css: (0, _MainToolbar.mainToolbarFirstChildStyle)(!!((_props$
|
|
113
|
+
css: (0, _MainToolbar.mainToolbarFirstChildStyle)(!!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
|
|
112
114
|
role: "toolbar",
|
|
113
115
|
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.toolbarLabel)
|
|
114
116
|
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), (0, _react2.jsx)("div", {
|
|
115
|
-
css: (0, _MainToolbar.mainToolbarSecondChildStyle)(!!((_props$
|
|
117
|
+
css: (0, _MainToolbar.mainToolbarSecondChildStyle)(!!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.twoLineEditorToolbar)),
|
|
116
118
|
"data-testid": 'avatar-group-outside-plugin',
|
|
117
119
|
role: "region",
|
|
118
120
|
"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.2.0";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/** @jsx jsx */
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
+
import { Fragment, useCallback } from 'react';
|
|
3
4
|
import { css, jsx } from '@emotion/react';
|
|
4
5
|
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
import { PortalProviderWithThemeProviders, PortalRenderer } from '@atlaskit/editor-common/portal-provider';
|
|
@@ -66,7 +67,7 @@ export function EditorInternal({
|
|
|
66
67
|
}, jsx(ContextAdapter, null, jsx(PortalProviderWithThemeProviders, {
|
|
67
68
|
onAnalyticsEvent: handleAnalyticsEvent,
|
|
68
69
|
useAnalyticsContext: props.UNSAFE_useAnalyticsContext,
|
|
69
|
-
render: portalProviderAPI => jsx(Fragment, null, jsx(
|
|
70
|
+
render: portalProviderAPI => jsx(Fragment, null, jsx(ReactEditorViewContextWrapper, {
|
|
70
71
|
editorProps: overriddenEditorProps,
|
|
71
72
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
72
73
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -124,4 +125,26 @@ export function EditorInternal({
|
|
|
124
125
|
portalProviderAPI: portalProviderAPI
|
|
125
126
|
}))
|
|
126
127
|
}))))));
|
|
128
|
+
}
|
|
129
|
+
function ReactEditorViewContextWrapper(props) {
|
|
130
|
+
const setInternalEditorAPI = useSetPresetContext();
|
|
131
|
+
const {
|
|
132
|
+
setEditorApi: setExternalEditorAPI
|
|
133
|
+
} = props;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* We use the context to retrieve the editorAPI
|
|
137
|
+
* externally for consumers via `usePreset`.
|
|
138
|
+
*
|
|
139
|
+
* However we also may need to retrieve this value internally via context
|
|
140
|
+
* so we should also set the value for the `EditorContext` that is used in
|
|
141
|
+
* `EditorInternal`.
|
|
142
|
+
*/
|
|
143
|
+
const setEditorAPI = useCallback(api => {
|
|
144
|
+
setInternalEditorAPI === null || setInternalEditorAPI === void 0 ? void 0 : setInternalEditorAPI(api);
|
|
145
|
+
setExternalEditorAPI === null || setExternalEditorAPI === void 0 ? void 0 : setExternalEditorAPI(api);
|
|
146
|
+
}, [setInternalEditorAPI, setExternalEditorAPI]);
|
|
147
|
+
return jsx(ReactEditorView, _extends({}, props, {
|
|
148
|
+
setEditorApi: setEditorAPI
|
|
149
|
+
}));
|
|
127
150
|
}
|
|
@@ -21,7 +21,7 @@ function getSpellCheck(featureFlags) {
|
|
|
21
21
|
* which is used by both current and archv3 editors.
|
|
22
22
|
*/
|
|
23
23
|
export function createFeatureFlagsFromProps(props) {
|
|
24
|
-
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20
|
|
24
|
+
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20;
|
|
25
25
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
26
26
|
return {
|
|
27
27
|
...normalizedFeatureFlags,
|
|
@@ -44,13 +44,12 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
44
44
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
45
45
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
46
46
|
showHoverPreview: Boolean(typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.showHoverPreview) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.showHoverPreview) : false),
|
|
47
|
-
|
|
48
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
47
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
49
48
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
50
49
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
51
50
|
// are included (they are not kebab cased)
|
|
52
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
51
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.restartNumberedLists) === true,
|
|
53
52
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
54
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
53
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags20 = props.featureFlags) !== null && _props$featureFlags20 !== void 0 && _props$featureFlags20['prevent-popup-overflow']) : false)
|
|
55
54
|
};
|
|
56
55
|
}
|
|
@@ -7,7 +7,6 @@ export { default as jiraIssuePlugin } from './jira-issue';
|
|
|
7
7
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
8
8
|
export { default as macroPlugin } from './macro';
|
|
9
9
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
10
|
-
export { default as panelPlugin } from './panel';
|
|
11
10
|
export { default as pastePlugin } from './paste';
|
|
12
11
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
13
12
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin,
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, tasksAndDecisionsPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, expandPlugin, isExpandInsertionEnabled, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
2
|
+
import { panelPlugin } from '@atlaskit/editor-plugin-panel';
|
|
2
3
|
import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
|
|
3
4
|
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
4
5
|
import { statusPlugin } from '@atlaskit/editor-plugin-status';
|
|
@@ -353,7 +354,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
353
354
|
}
|
|
354
355
|
return builder;
|
|
355
356
|
}).add([toolbarListsIndentationPlugin, {
|
|
356
|
-
showIndentationButtons: !!
|
|
357
|
+
showIndentationButtons: !!props.showIndentationButtons,
|
|
357
358
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
358
359
|
}]).add([insertBlockPlugin, {
|
|
359
360
|
allowTables: !!props.allowTables,
|
|
@@ -12,9 +12,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
14
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
15
|
+
import { usePresetContext } from '../../../presets/context';
|
|
15
16
|
export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
16
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5
|
|
17
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5;
|
|
17
18
|
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
19
|
+
const editorAPI = usePresetContext();
|
|
18
20
|
const nonCustomToolbar = jsx("div", {
|
|
19
21
|
css: nonCustomToolbarWrapperStyle
|
|
20
22
|
}, props.beforeIcon && jsx("div", {
|
|
@@ -46,7 +48,7 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
46
48
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
47
49
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
48
50
|
featureFlags: props.featureFlags || {}
|
|
49
|
-
}),
|
|
51
|
+
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.twoLineEditorToolbar ? jsx(FindReplaceToolbarButtonWithState, {
|
|
50
52
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
51
53
|
popupsMountPoint: props.popupsMountPoint,
|
|
52
54
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
@@ -56,8 +58,8 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
56
58
|
featureFlags: props.featureFlags
|
|
57
59
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
58
60
|
useEffect(() => {
|
|
59
|
-
var _props$
|
|
60
|
-
if ((_props$
|
|
61
|
+
var _props$featureFlags6;
|
|
62
|
+
if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
|
|
61
63
|
const updateOnResize = () => {
|
|
62
64
|
setShouldSplitToolbar(window.innerWidth <= MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
|
|
63
65
|
};
|
|
@@ -82,7 +84,7 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
82
84
|
return jsx(ContextPanelConsumer, null, ({
|
|
83
85
|
width: contextPanelWidth
|
|
84
86
|
}) => {
|
|
85
|
-
var _props$
|
|
87
|
+
var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
|
|
86
88
|
return jsx(ToolbarArrowKeyNavigationProvider, {
|
|
87
89
|
editorView: props.editorView,
|
|
88
90
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
@@ -90,14 +92,14 @@ export const EditorToolbar = /*#__PURE__*/React.memo(props => {
|
|
|
90
92
|
handleEscape: handleEscape,
|
|
91
93
|
intl: props.intl
|
|
92
94
|
}, jsx("div", {
|
|
93
|
-
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, !!((_props$
|
|
95
|
+
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.twoLineEditorToolbar)),
|
|
94
96
|
"data-testid": "ak-editor-main-toolbar"
|
|
95
97
|
}, jsx("div", {
|
|
96
|
-
css: mainToolbarFirstChildStyle(!!((_props$
|
|
98
|
+
css: mainToolbarFirstChildStyle(!!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
|
|
97
99
|
role: "toolbar",
|
|
98
100
|
"aria-label": props.intl.formatMessage(messages.toolbarLabel)
|
|
99
101
|
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), jsx("div", {
|
|
100
|
-
css: mainToolbarSecondChildStyle(!!((_props$
|
|
102
|
+
css: mainToolbarSecondChildStyle(!!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.twoLineEditorToolbar)),
|
|
101
103
|
"data-testid": 'avatar-group-outside-plugin',
|
|
102
104
|
role: "region",
|
|
103
105
|
"aria-label": props.intl.formatMessage(messages.pageActionsLabel)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
/** @jsx jsx */
|
|
5
|
-
import { Fragment } from 'react';
|
|
6
|
+
import { Fragment, useCallback } from 'react';
|
|
6
7
|
import { css, jsx } from '@emotion/react';
|
|
7
8
|
import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
8
9
|
import { PortalProviderWithThemeProviders, PortalRenderer } from '@atlaskit/editor-common/portal-provider';
|
|
@@ -68,7 +69,7 @@ export function EditorInternal(_ref) {
|
|
|
68
69
|
onAnalyticsEvent: handleAnalyticsEvent,
|
|
69
70
|
useAnalyticsContext: props.UNSAFE_useAnalyticsContext,
|
|
70
71
|
render: function render(portalProviderAPI) {
|
|
71
|
-
return jsx(Fragment, null, jsx(
|
|
72
|
+
return jsx(Fragment, null, jsx(ReactEditorViewContextWrapper, {
|
|
72
73
|
editorProps: overriddenEditorProps,
|
|
73
74
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
74
75
|
portalProviderAPI: portalProviderAPI,
|
|
@@ -126,4 +127,24 @@ export function EditorInternal(_ref) {
|
|
|
126
127
|
}));
|
|
127
128
|
}
|
|
128
129
|
}))))));
|
|
130
|
+
}
|
|
131
|
+
function ReactEditorViewContextWrapper(props) {
|
|
132
|
+
var setInternalEditorAPI = useSetPresetContext();
|
|
133
|
+
var setExternalEditorAPI = props.setEditorApi;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* We use the context to retrieve the editorAPI
|
|
137
|
+
* externally for consumers via `usePreset`.
|
|
138
|
+
*
|
|
139
|
+
* However we also may need to retrieve this value internally via context
|
|
140
|
+
* so we should also set the value for the `EditorContext` that is used in
|
|
141
|
+
* `EditorInternal`.
|
|
142
|
+
*/
|
|
143
|
+
var setEditorAPI = useCallback(function (api) {
|
|
144
|
+
setInternalEditorAPI === null || setInternalEditorAPI === void 0 || setInternalEditorAPI(api);
|
|
145
|
+
setExternalEditorAPI === null || setExternalEditorAPI === void 0 || setExternalEditorAPI(api);
|
|
146
|
+
}, [setInternalEditorAPI, setExternalEditorAPI]);
|
|
147
|
+
return jsx(ReactEditorView, _extends({}, props, {
|
|
148
|
+
setEditorApi: setEditorAPI
|
|
149
|
+
}));
|
|
129
150
|
}
|
|
@@ -25,7 +25,7 @@ function getSpellCheck(featureFlags) {
|
|
|
25
25
|
* which is used by both current and archv3 editors.
|
|
26
26
|
*/
|
|
27
27
|
export function createFeatureFlagsFromProps(props) {
|
|
28
|
-
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20
|
|
28
|
+
var _props$allowLayouts, _props$performanceTra, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$collabEdit, _props$collabEdit2, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20;
|
|
29
29
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
30
30
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
31
31
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
@@ -47,13 +47,12 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
47
47
|
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags13 = props.featureFlags) === null || _props$featureFlags13 === void 0 ? void 0 : _props$featureFlags13.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags14 = props.featureFlags) !== null && _props$featureFlags14 !== void 0 && _props$featureFlags14.twoLineEditorToolbar) : false),
|
|
48
48
|
useNativeCollabPlugin: Boolean(typeof ((_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.useNativePlugin) === 'boolean' ? !!((_props$collabEdit2 = props.collabEdit) !== null && _props$collabEdit2 !== void 0 && _props$collabEdit2.useNativePlugin) : false),
|
|
49
49
|
showHoverPreview: Boolean(typeof ((_props$featureFlags15 = props.featureFlags) === null || _props$featureFlags15 === void 0 ? void 0 : _props$featureFlags15.showHoverPreview) === 'boolean' ? !!((_props$featureFlags16 = props.featureFlags) !== null && _props$featureFlags16 !== void 0 && _props$featureFlags16.showHoverPreview) : false),
|
|
50
|
-
|
|
51
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
50
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags17 = props.featureFlags) === null || _props$featureFlags17 === void 0 ? void 0 : _props$featureFlags17['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
52
51
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
53
52
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
54
53
|
// are included (they are not kebab cased)
|
|
55
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
54
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.restartNumberedLists) === true,
|
|
56
55
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
57
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
56
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags20 = props.featureFlags) !== null && _props$featureFlags20 !== void 0 && _props$featureFlags20['prevent-popup-overflow']) : false)
|
|
58
57
|
});
|
|
59
58
|
}
|
|
@@ -7,7 +7,6 @@ export { default as jiraIssuePlugin } from './jira-issue';
|
|
|
7
7
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
8
8
|
export { default as macroPlugin } from './macro';
|
|
9
9
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
10
|
-
export { default as panelPlugin } from './panel';
|
|
11
10
|
export { default as pastePlugin } from './paste';
|
|
12
11
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
13
12
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -2,7 +2,8 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin,
|
|
5
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, insertBlockPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, tasksAndDecisionsPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, expandPlugin, isExpandInsertionEnabled, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
6
|
+
import { panelPlugin } from '@atlaskit/editor-plugin-panel';
|
|
6
7
|
import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
|
|
7
8
|
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
8
9
|
import { statusPlugin } from '@atlaskit/editor-plugin-status';
|
|
@@ -349,7 +350,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
349
350
|
}
|
|
350
351
|
return builder;
|
|
351
352
|
}).add([toolbarListsIndentationPlugin, {
|
|
352
|
-
showIndentationButtons: !!
|
|
353
|
+
showIndentationButtons: !!props.showIndentationButtons,
|
|
353
354
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
354
355
|
}]).add([insertBlockPlugin, {
|
|
355
356
|
allowTables: !!props.allowTables,
|
|
@@ -13,12 +13,14 @@ 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
15
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
16
|
+
import { usePresetContext } from '../../../presets/context';
|
|
16
17
|
export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
17
|
-
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5
|
|
18
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags5;
|
|
18
19
|
var _useState = useState(false),
|
|
19
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
20
21
|
shouldSplitToolbar = _useState2[0],
|
|
21
22
|
setShouldSplitToolbar = _useState2[1];
|
|
23
|
+
var editorAPI = usePresetContext();
|
|
22
24
|
var nonCustomToolbar = jsx("div", {
|
|
23
25
|
css: nonCustomToolbarWrapperStyle
|
|
24
26
|
}, props.beforeIcon && jsx("div", {
|
|
@@ -50,7 +52,7 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
50
52
|
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
51
53
|
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected,
|
|
52
54
|
featureFlags: props.featureFlags || {}
|
|
53
|
-
}),
|
|
55
|
+
}), editorAPI !== null && editorAPI !== void 0 && editorAPI.findReplace && (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.twoLineEditorToolbar ? jsx(FindReplaceToolbarButtonWithState, {
|
|
54
56
|
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
55
57
|
popupsMountPoint: props.popupsMountPoint,
|
|
56
58
|
popupsScrollableElement: props.popupsScrollableElement,
|
|
@@ -60,8 +62,8 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
60
62
|
featureFlags: props.featureFlags
|
|
61
63
|
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
62
64
|
useEffect(function () {
|
|
63
|
-
var _props$
|
|
64
|
-
if ((_props$
|
|
65
|
+
var _props$featureFlags6;
|
|
66
|
+
if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
|
|
65
67
|
var updateOnResize = function updateOnResize() {
|
|
66
68
|
setShouldSplitToolbar(window.innerWidth <= MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
|
|
67
69
|
};
|
|
@@ -86,7 +88,7 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
86
88
|
event.stopPropagation();
|
|
87
89
|
};
|
|
88
90
|
return jsx(ContextPanelConsumer, null, function (_ref) {
|
|
89
|
-
var _props$
|
|
91
|
+
var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
|
|
90
92
|
var contextPanelWidth = _ref.width;
|
|
91
93
|
return jsx(ToolbarArrowKeyNavigationProvider, {
|
|
92
94
|
editorView: props.editorView,
|
|
@@ -95,14 +97,14 @@ export var EditorToolbar = /*#__PURE__*/React.memo(function (props) {
|
|
|
95
97
|
handleEscape: handleEscape,
|
|
96
98
|
intl: props.intl
|
|
97
99
|
}, jsx("div", {
|
|
98
|
-
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, !!((_props$
|
|
100
|
+
css: mainToolbarStyle(props.showKeyline || contextPanelWidth > 0, !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.twoLineEditorToolbar)),
|
|
99
101
|
"data-testid": "ak-editor-main-toolbar"
|
|
100
102
|
}, jsx("div", {
|
|
101
|
-
css: mainToolbarFirstChildStyle(!!((_props$
|
|
103
|
+
css: mainToolbarFirstChildStyle(!!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)),
|
|
102
104
|
role: "toolbar",
|
|
103
105
|
"aria-label": props.intl.formatMessage(messages.toolbarLabel)
|
|
104
106
|
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), jsx("div", {
|
|
105
|
-
css: mainToolbarSecondChildStyle(!!((_props$
|
|
107
|
+
css: mainToolbarSecondChildStyle(!!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.twoLineEditorToolbar)),
|
|
106
108
|
"data-testid": 'avatar-group-outside-plugin',
|
|
107
109
|
role: "region",
|
|
108
110
|
"aria-label": props.intl.formatMessage(messages.pageActionsLabel)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EditorAppearance, EditorAppearanceComponentProps } from '../types';
|
|
2
|
+
import type { EditorAppearance, EditorAppearanceComponentProps } from '../types';
|
|
3
3
|
export default function getUiComponent(appearance: EditorAppearance): React.ComponentClass<EditorAppearanceComponentProps> | React.FunctionComponent<EditorAppearanceComponentProps>;
|
|
@@ -7,7 +7,6 @@ export { default as jiraIssuePlugin } from './jira-issue';
|
|
|
7
7
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
8
8
|
export { default as macroPlugin } from './macro';
|
|
9
9
|
export { default as maxContentSizePlugin } from './max-content-size';
|
|
10
|
-
export { default as panelPlugin } from './panel';
|
|
11
10
|
export { default as pastePlugin } from './paste';
|
|
12
11
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
13
12
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -9,7 +9,7 @@ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
9
9
|
import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
10
10
|
import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
|
|
11
11
|
import type { CodeBlockPlugin } from '../code-block';
|
|
12
|
-
import type { PanelPlugin } from '
|
|
12
|
+
import type { PanelPlugin } from '@atlaskit/editor-plugin-panel';
|
|
13
13
|
import type { LayoutPlugin } from '@atlaskit/editor-plugin-layout';
|
|
14
14
|
import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
|
|
15
15
|
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|