@atlaskit/editor-core 211.2.7 → 211.2.9
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 +21 -0
- package/dist/cjs/create-editor/ReactEditorView.js +0 -38
- package/dist/cjs/create-editor/create-editor.js +5 -0
- package/dist/cjs/create-editor/editorNativeAnchorSupportPlugin.js +34 -0
- package/dist/cjs/presets/default.js +4 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +10 -8
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbarNext.compiled.css +2 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbarNext.js +4 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +1 -35
- package/dist/es2019/create-editor/create-editor.js +5 -0
- package/dist/es2019/create-editor/editorNativeAnchorSupportPlugin.js +26 -0
- package/dist/es2019/presets/default.js +4 -4
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +10 -8
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbarNext.compiled.css +2 -0
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbarNext.js +4 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +1 -39
- package/dist/esm/create-editor/create-editor.js +5 -0
- package/dist/esm/create-editor/editorNativeAnchorSupportPlugin.js +28 -0
- package/dist/esm/presets/default.js +4 -4
- package/dist/esm/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +10 -8
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbarNext.compiled.css +2 -0
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbarNext.js +4 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-editor.d.ts +1 -1
- package/dist/types/create-editor/create-universal-preset.d.ts +14 -1
- package/dist/types/create-editor/editorNativeAnchorSupportPlugin.d.ts +3 -0
- package/dist/types/presets/universal.d.ts +15 -1
- package/dist/types/presets/useUniversalPreset.d.ts +14 -1
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +2 -1
- package/dist/types-ts4.5/create-editor/create-editor.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +21 -1
- package/dist/types-ts4.5/create-editor/editorNativeAnchorSupportPlugin.d.ts +3 -0
- package/dist/types-ts4.5/presets/universal.d.ts +22 -1
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +21 -1
- package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +2 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 211.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0eac5a71c3834`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0eac5a71c3834) -
|
|
8
|
+
[ED-29037] Fix dynamic buttons (e.g. text style) in full page primary toolbar flickers during the
|
|
9
|
+
initial load
|
|
10
|
+
- [`c0113eeccb2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0113eeccb2df) -
|
|
11
|
+
[ux] ED-29120 add a new config option for default editor preset
|
|
12
|
+
(`toolbar.enableNewToolbarExperience`) which allows the new toolbar to be disabled. This is needed
|
|
13
|
+
for editors that can't be excluded at the experiment level.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 211.2.8
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`e834d11aee625`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e834d11aee625) -
|
|
21
|
+
Add z-index to new main primary toolbar, to fix stacking issues
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 211.2.7
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -22,11 +22,9 @@ var _measureRender = require("@atlaskit/editor-common/performance/measure-render
|
|
|
22
22
|
var _navigation = require("@atlaskit/editor-common/performance/navigation");
|
|
23
23
|
var _preset = require("@atlaskit/editor-common/preset");
|
|
24
24
|
var _processRawValue = require("@atlaskit/editor-common/process-raw-value");
|
|
25
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
26
25
|
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
27
26
|
var _analytics2 = require("@atlaskit/editor-common/utils/analytics");
|
|
28
27
|
var _document = require("@atlaskit/editor-common/utils/document");
|
|
29
|
-
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
30
28
|
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
31
29
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
32
30
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
@@ -56,39 +54,6 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
56
54
|
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; }
|
|
57
55
|
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) { (0, _defineProperty2.default)(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; }
|
|
58
56
|
var EDIT_AREA_ID = 'ak-editor-textarea';
|
|
59
|
-
var injectNodeViewNodeTypeList = ['paragraph', 'heading'];
|
|
60
|
-
var createNodeViewPlugin = function createNodeViewPlugin(schema) {
|
|
61
|
-
var nodeViewEntries = [];
|
|
62
|
-
schema.spec.nodes.forEach(function (nodeName, nodeSpec) {
|
|
63
|
-
if (injectNodeViewNodeTypeList.includes(nodeName)) {
|
|
64
|
-
if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
|
|
65
|
-
var toDOM = nodeSpec.toDOM.bind(nodeSpec);
|
|
66
|
-
nodeViewEntries.push([nodeName, function (node) {
|
|
67
|
-
return _model.DOMSerializer.renderSpec(document, toDOM(node));
|
|
68
|
-
}]);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
return {
|
|
73
|
-
name: 'nodeViewInjectPlugin',
|
|
74
|
-
plugin: function plugin() {
|
|
75
|
-
return new _safePlugin.SafePlugin({
|
|
76
|
-
state: {
|
|
77
|
-
init: function init() {
|
|
78
|
-
return {};
|
|
79
|
-
},
|
|
80
|
-
apply: function apply(_tr, pluginState) {
|
|
81
|
-
return pluginState;
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
key: new _state2.PluginKey('nodeViewInjectPlugin'),
|
|
85
|
-
props: {
|
|
86
|
-
nodeViews: Object.fromEntries(nodeViewEntries)
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
57
|
function ReactEditorView(props) {
|
|
93
58
|
var _pluginInjectionAPI$c, _media, _linking, _document$querySelect, _props$render, _props$render2;
|
|
94
59
|
var preset = props.preset,
|
|
@@ -184,9 +149,6 @@ function ReactEditorView(props) {
|
|
|
184
149
|
config.current = (0, _createEditor.processPluginsList)((0, _createPluginsList.default)(options.props.preset, props.editorProps, pluginInjectionAPI.current));
|
|
185
150
|
schema = (0, _createSchema.createSchema)(config.current);
|
|
186
151
|
setEditorAPI(pluginInjectionAPI.current.api());
|
|
187
|
-
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
188
|
-
config.current.pmPlugins.push(createNodeViewPlugin(schema));
|
|
189
|
-
}
|
|
190
152
|
}
|
|
191
153
|
var contentTransformerProvider = options.props.editorProps.contentTransformerProvider;
|
|
192
154
|
var plugins = (0, _createEditor.createPMPlugins)({
|
|
@@ -12,6 +12,8 @@ exports.sortByRank = sortByRank;
|
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
13
|
var _errorReporter = require("@atlaskit/editor-common/error-reporter");
|
|
14
14
|
var _legacyRankPlugins = require("@atlaskit/editor-common/legacy-rank-plugins");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
|
+
var _editorNativeAnchorSupportPlugin = require("./editorNativeAnchorSupportPlugin");
|
|
15
17
|
var _editorStateNotificationPlugin = require("./editorStateNotificationPlugin");
|
|
16
18
|
function sortByRank(a, b) {
|
|
17
19
|
return a.rank - b.rank;
|
|
@@ -114,6 +116,9 @@ function createPMPlugins(config) {
|
|
|
114
116
|
}).filter(function (plugin) {
|
|
115
117
|
return typeof plugin !== 'undefined';
|
|
116
118
|
});
|
|
119
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
120
|
+
pmPlugins.push((0, _editorNativeAnchorSupportPlugin.createEditorNativeAnchorSupportPlugin)(config.schema));
|
|
121
|
+
}
|
|
117
122
|
if (config.onEditorStateUpdated !== undefined) {
|
|
118
123
|
return [(0, _editorStateNotificationPlugin.createEditorStateNotificationPlugin)(config.onEditorStateUpdated, config.editorConfig.onEditorViewStateUpdatedCallbacks)].concat((0, _toConsumableArray2.default)(pmPlugins));
|
|
119
124
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createEditorNativeAnchorSupportPlugin = void 0;
|
|
7
|
+
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
10
|
+
var injectNodeViewNodeTypeList = ['paragraph', 'heading', 'bulletList', 'orderedList', 'blockquote', 'rule', 'decisionList', 'taskList', 'layoutColumn', 'hardBreak'];
|
|
11
|
+
var key = new _state.PluginKey('editorNativeAnchorSupportPlugin');
|
|
12
|
+
|
|
13
|
+
// Internal plugin to enable native anchor support in the editor.
|
|
14
|
+
// This plugin injects node views for specific node types (e.g., 'paragraph', 'heading')
|
|
15
|
+
// that do not already have a nodeView, allowing them to be rendered with native anchors when needed.
|
|
16
|
+
var createEditorNativeAnchorSupportPlugin = exports.createEditorNativeAnchorSupportPlugin = function createEditorNativeAnchorSupportPlugin(schema) {
|
|
17
|
+
var nodeViewEntries = [];
|
|
18
|
+
schema.spec.nodes.forEach(function (nodeName, nodeSpec) {
|
|
19
|
+
if (injectNodeViewNodeTypeList.includes(nodeName)) {
|
|
20
|
+
if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
|
|
21
|
+
var toDOM = nodeSpec.toDOM.bind(nodeSpec);
|
|
22
|
+
nodeViewEntries.push([nodeName, function (node) {
|
|
23
|
+
return _model.DOMSerializer.renderSpec(document, toDOM(node));
|
|
24
|
+
}]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return new _safePlugin.SafePlugin({
|
|
29
|
+
key: key,
|
|
30
|
+
props: {
|
|
31
|
+
nodeViews: Object.fromEntries(nodeViewEntries)
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
|
@@ -55,7 +55,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
55
55
|
* @example
|
|
56
56
|
*/
|
|
57
57
|
function createDefaultPreset(options) {
|
|
58
|
-
var _options$featureFlags, _options$featureFlags2;
|
|
58
|
+
var _options$toolbar, _options$featureFlags, _options$featureFlags2;
|
|
59
59
|
var isFullPage = (0, _isFullPage.isFullPage)(options.appearance);
|
|
60
60
|
var preset = new _preset.EditorPresetBuilder().add([_featureFlags.featureFlagsPlugin, options.featureFlags || {}]).maybeAdd([_analytics.analyticsPlugin, {
|
|
61
61
|
createAnalyticsEvent: options.createAnalyticsEvent,
|
|
@@ -70,9 +70,9 @@ function createDefaultPreset(options) {
|
|
|
70
70
|
return (0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin');
|
|
71
71
|
}).maybeAdd(_interaction.interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) || (0, _expValEquals.expValEquals)('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(_composition.compositionPlugin).add([_contextIdentifier.contextIdentifierPlugin, {
|
|
72
72
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
73
|
-
}]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(options.allowUndoRedoButtons)).maybeAdd([_toolbar.toolbarPlugin, options.toolbar || {}],
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
}]).add([_base.basePlugin, options.base]).add(_decorations.decorationsPlugin).add([_typeAhead.typeAheadPlugin, options.typeAhead]).maybeAdd(_history.historyPlugin, Boolean(options.allowUndoRedoButtons)).maybeAdd([_toolbar.toolbarPlugin, options.toolbar || {}],
|
|
74
|
+
// if explicitly set to false, don't enable. If undefined treat as truthy and allow plugin to be enabled under experiment
|
|
75
|
+
Boolean((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_exp_code_toggle', 'isEnabled', true) ? ((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience) !== false && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) : (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true))).add([_primaryToolbar.primaryToolbarPlugin, {
|
|
76
76
|
contextualFormattingEnabled: isFullPage
|
|
77
77
|
}]).maybeAdd(_undoRedo.undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([_blockType.blockTypePlugin, _objectSpread(_objectSpread({}, options.blockType), {}, {
|
|
78
78
|
includeBlockQuoteAsTextstyleOption: isFullPage
|
|
@@ -210,6 +210,7 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
210
210
|
css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew] : /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
211
211
|
mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
|
|
212
212
|
}, customPrimaryToolbarComponents);
|
|
213
|
+
var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc', 'isEnabled', true);
|
|
213
214
|
return (0, _react2.jsx)(_WithFlash.default, {
|
|
214
215
|
animate: maxContentSizeReached
|
|
215
216
|
}, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
|
|
@@ -225,8 +226,9 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
|
|
|
225
226
|
ref: wrapperElementRef
|
|
226
227
|
}, (0, _react2.jsx)(_Toolbar.MainToolbar, {
|
|
227
228
|
useStickyToolbar: useStickyToolbar,
|
|
228
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
229
|
-
|
|
229
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled,
|
|
230
|
+
isNewToolbarEnabled: isToolbarAIFCEnabled
|
|
231
|
+
}, isToolbarAIFCEnabled ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_CommentToolbar.CommentToolbar, {
|
|
230
232
|
editorAPI: editorAPI,
|
|
231
233
|
editorView: editorView,
|
|
232
234
|
editorAppearance: appearance
|
|
@@ -15,7 +15,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
17
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
18
|
var _templateObject, _templateObject2;
|
|
20
19
|
/**
|
|
21
20
|
* @jsxRuntime classic
|
|
@@ -113,11 +112,11 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
113
112
|
return (
|
|
114
113
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
115
114
|
(0, _react2.jsx)("div", {
|
|
116
|
-
css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew,
|
|
115
|
+
css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding] : [
|
|
117
116
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
118
117
|
mainToolbarWrapperStyle(props.twoLineEditorToolbar,
|
|
119
118
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
120
|
-
|
|
119
|
+
props.isNewToolbarEnabled), stickyToolbarWrapperStyle]
|
|
121
120
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
122
121
|
,
|
|
123
122
|
style: {
|
|
@@ -134,11 +133,11 @@ var FixedToolbar = function FixedToolbar(props) {
|
|
|
134
133
|
return (
|
|
135
134
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
136
135
|
(0, _react2.jsx)("div", {
|
|
137
|
-
css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh,
|
|
136
|
+
css: (0, _expValEquals.expValEquals)('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, (0, _platformFeatureFlags.fg)('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding] :
|
|
138
137
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
139
138
|
mainToolbarWrapperStyle(props.twoLineEditorToolbar,
|
|
140
139
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
141
|
-
|
|
140
|
+
props.isNewToolbarEnabled),
|
|
142
141
|
"data-testid": "ak-editor-main-toolbar"
|
|
143
142
|
}, props.children)
|
|
144
143
|
);
|
|
@@ -174,16 +173,19 @@ var getStickyParameters = function getStickyParameters(configuration) {
|
|
|
174
173
|
var MainToolbar = exports.MainToolbar = function MainToolbar(_ref) {
|
|
175
174
|
var useStickyToolbar = _ref.useStickyToolbar,
|
|
176
175
|
twoLineEditorToolbar = _ref.twoLineEditorToolbar,
|
|
177
|
-
children = _ref.children
|
|
176
|
+
children = _ref.children,
|
|
177
|
+
isNewToolbarEnabled = _ref.isNewToolbarEnabled;
|
|
178
178
|
if (useStickyToolbar) {
|
|
179
179
|
return (0, _react2.jsx)(StickyToolbar
|
|
180
180
|
// Ignored via go/ees005
|
|
181
181
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
182
182
|
, (0, _extends2.default)({}, getStickyParameters(useStickyToolbar), {
|
|
183
|
-
twoLineEditorToolbar: twoLineEditorToolbar
|
|
183
|
+
twoLineEditorToolbar: twoLineEditorToolbar,
|
|
184
|
+
isNewToolbarEnabled: isNewToolbarEnabled
|
|
184
185
|
}), children);
|
|
185
186
|
}
|
|
186
187
|
return (0, _react2.jsx)(FixedToolbar, {
|
|
187
|
-
twoLineEditorToolbar: twoLineEditorToolbar
|
|
188
|
+
twoLineEditorToolbar: twoLineEditorToolbar,
|
|
189
|
+
isNewToolbarEnabled: isNewToolbarEnabled
|
|
188
190
|
}, children);
|
|
189
191
|
};
|
|
@@ -153,7 +153,7 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
153
153
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
154
154
|
'--ak-editor-fullpage-toolbar-height': (0, _editorSharedStyles.FULL_PAGE_EDITOR_TOOLBAR_HEIGHT)()
|
|
155
155
|
}
|
|
156
|
-
}, !isEditorToolbarHidden && ((0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) ? (0, _react2.jsx)(_reactIntlNext.IntlProvider, {
|
|
156
|
+
}, !isEditorToolbarHidden && (Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) ? (0, _react2.jsx)(_reactIntlNext.IntlProvider, {
|
|
157
157
|
locale: "en"
|
|
158
158
|
}, (0, _react2.jsx)(_FullPageToolbarNext.FullPageToolbarNext, {
|
|
159
159
|
toolbarDockingPosition: toolbarDockingPosition !== null && toolbarDockingPosition !== void 0 ? toolbarDockingPosition : toolbarDocking,
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
._19pkpxbi{margin-top:var(--ds-space-200,1pc)}
|
|
7
7
|
._1bahesu3{justify-content:flex-end}
|
|
8
8
|
._1e0c1txw{display:flex}
|
|
9
|
+
._1pby16oo{z-index:510}
|
|
9
10
|
._1ul91ns9{min-width:-moz-fit-content;min-width:fit-content}
|
|
10
11
|
._2hwxpxbi{margin-right:var(--ds-space-200,1pc)}
|
|
11
12
|
._4cvr1h6o{align-items:center}
|
|
12
13
|
._4t3izwfg{height:2pc}
|
|
14
|
+
._kqswh2mm{position:relative}
|
|
13
15
|
._otyrpxbi{margin-bottom:var(--ds-space-200,1pc)}
|
|
@@ -24,6 +24,7 @@ var styles = {
|
|
|
24
24
|
mainToolbarIconBeforeNew: "_4cvr1h6o _1e0c1txw",
|
|
25
25
|
mainToolbarWrapper: "_1rjc12x7 _18zrutpp _n7zl7r9e",
|
|
26
26
|
mainToolbarNew: "_1e0c1txw _4t3izwfg",
|
|
27
|
+
mainToolbarZIndex: "_1pby16oo _kqswh2mm",
|
|
27
28
|
mainToolbarWithKeyline: "_16qs9g9j",
|
|
28
29
|
customToolbarWrapperStyle: "_4cvr1h6o _1e0c1txw",
|
|
29
30
|
firstChildWrapperOneLine: "_1e0c1txw _16jlkb7n",
|
|
@@ -36,7 +37,7 @@ var MainToolbarWrapper = function MainToolbarWrapper(_ref) {
|
|
|
36
37
|
showKeyline = _ref.showKeyline;
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
39
|
"data-testid": testId,
|
|
39
|
-
className: (0, _runtime.ax)([styles.mainToolbarWrapper, showKeyline && styles.mainToolbarWithKeyline, (0, _expValEquals.expValEquals)('platform_editor_toolbar_support_custom_components', 'isEnabled', true) && styles.mainToolbarNew])
|
|
40
|
+
className: (0, _runtime.ax)([styles.mainToolbarWrapper, showKeyline && styles.mainToolbarWithKeyline, (0, _expValEquals.expValEquals)('platform_editor_toolbar_support_custom_components', 'isEnabled', true) && styles.mainToolbarNew, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) && styles.mainToolbarZIndex])
|
|
40
41
|
}, children);
|
|
41
42
|
};
|
|
42
43
|
var FirstChildWrapper = function FirstChildWrapper(_ref2) {
|
|
@@ -110,7 +111,7 @@ var FullPageToolbarNext = exports.FullPageToolbarNext = function FullPageToolbar
|
|
|
110
111
|
showKeyline: showKeyline || ContextPanelWidth > 0
|
|
111
112
|
}, beforeIcon && /*#__PURE__*/_react.default.createElement("div", {
|
|
112
113
|
className: (0, _runtime.ax)([styles.mainToolbarIconBefore, (0, _expValEquals.expValEquals)('platform_editor_toolbar_support_custom_components', 'isEnabled', true) && styles.mainToolbarIconBeforeNew])
|
|
113
|
-
}, beforeIcon), (0, _expValEquals.expValEquals)('platform_editor_toolbar_support_custom_components', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FirstChildWrapper, null, toolbarDockingPosition !== 'none' && components && (0, _toolbar2.isToolbar)(toolbar) && /*#__PURE__*/_react.default.createElement(_Toolbar.ToolbarNext, {
|
|
114
|
+
}, beforeIcon), (0, _expValEquals.expValEquals)('platform_editor_toolbar_support_custom_components', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FirstChildWrapper, null, toolbarDockingPosition !== 'none' && components && (0, _toolbar2.isToolbar)(toolbar) && (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) || editorView) && /*#__PURE__*/_react.default.createElement(_Toolbar.ToolbarNext, {
|
|
114
115
|
toolbar: toolbar,
|
|
115
116
|
components: components,
|
|
116
117
|
editorView: editorView,
|
|
@@ -122,7 +123,7 @@ var FullPageToolbarNext = exports.FullPageToolbarNext = function FullPageToolbar
|
|
|
122
123
|
}, !!customPrimaryToolbarComponents && 'before' in customPrimaryToolbarComponents && /*#__PURE__*/_react.default.createElement("div", {
|
|
123
124
|
"data-testid": 'before-primary-toolbar-components-plugin',
|
|
124
125
|
className: (0, _runtime.ax)([styles.beforePrimaryToolbarComponents])
|
|
125
|
-
}, customPrimaryToolbarComponents.before), !!customPrimaryToolbarComponents && 'after' in customPrimaryToolbarComponents ? customPrimaryToolbarComponents.after : customPrimaryToolbarComponents))) : toolbarDockingPosition !== 'none' && components && (0, _toolbar2.isToolbar)(toolbar) && /*#__PURE__*/_react.default.createElement(_Toolbar.ToolbarNext, {
|
|
126
|
+
}, customPrimaryToolbarComponents.before), !!customPrimaryToolbarComponents && 'after' in customPrimaryToolbarComponents ? customPrimaryToolbarComponents.after : customPrimaryToolbarComponents))) : toolbarDockingPosition !== 'none' && components && (0, _toolbar2.isToolbar)(toolbar) && (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) || editorView) && /*#__PURE__*/_react.default.createElement(_Toolbar.ToolbarNext, {
|
|
126
127
|
toolbar: toolbar,
|
|
127
128
|
components: components,
|
|
128
129
|
editorView: editorView,
|
|
@@ -10,12 +10,10 @@ import { measureRender } from '@atlaskit/editor-common/performance/measure-rende
|
|
|
10
10
|
import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
|
|
11
11
|
import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
|
|
12
12
|
import { processRawValue, processRawValueWithoutValidation } from '@atlaskit/editor-common/process-raw-value';
|
|
13
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
14
13
|
import { ReactEditorViewContext } from '@atlaskit/editor-common/ui-react';
|
|
15
14
|
import { analyticsEventKey, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
|
|
16
15
|
import { isEmptyDocument } from '@atlaskit/editor-common/utils/document';
|
|
17
|
-
import {
|
|
18
|
-
import { EditorState, PluginKey, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
16
|
+
import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
19
17
|
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
20
18
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
19
|
import { abortAll, getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
|
|
@@ -38,35 +36,6 @@ import { handleEditorFocus } from './ReactEditorView/handleEditorFocus';
|
|
|
38
36
|
import { useDispatchTransaction } from './ReactEditorView/useDispatchTransaction';
|
|
39
37
|
import { useFireFullWidthEvent } from './ReactEditorView/useFireFullWidthEvent';
|
|
40
38
|
const EDIT_AREA_ID = 'ak-editor-textarea';
|
|
41
|
-
const injectNodeViewNodeTypeList = ['paragraph', 'heading'];
|
|
42
|
-
const createNodeViewPlugin = schema => {
|
|
43
|
-
const nodeViewEntries = [];
|
|
44
|
-
schema.spec.nodes.forEach((nodeName, nodeSpec) => {
|
|
45
|
-
if (injectNodeViewNodeTypeList.includes(nodeName)) {
|
|
46
|
-
if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
|
|
47
|
-
const toDOM = nodeSpec.toDOM.bind(nodeSpec);
|
|
48
|
-
nodeViewEntries.push([nodeName, node => DOMSerializer.renderSpec(document, toDOM(node))]);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return {
|
|
53
|
-
name: 'nodeViewInjectPlugin',
|
|
54
|
-
plugin: () => new SafePlugin({
|
|
55
|
-
state: {
|
|
56
|
-
init() {
|
|
57
|
-
return {};
|
|
58
|
-
},
|
|
59
|
-
apply(_tr, pluginState) {
|
|
60
|
-
return pluginState;
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
key: new PluginKey('nodeViewInjectPlugin'),
|
|
64
|
-
props: {
|
|
65
|
-
nodeViews: Object.fromEntries(nodeViewEntries)
|
|
66
|
-
}
|
|
67
|
-
})
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
39
|
export function ReactEditorView(props) {
|
|
71
40
|
var _pluginInjectionAPI$c, _pluginInjectionAPI$c2, _pluginInjectionAPI$c3, _media, _linking, _linking$smartLinks, _document$querySelect, _props$render, _props$render2;
|
|
72
41
|
const {
|
|
@@ -152,9 +121,6 @@ export function ReactEditorView(props) {
|
|
|
152
121
|
config.current = processPluginsList(createPluginsList(options.props.preset, props.editorProps, pluginInjectionAPI.current));
|
|
153
122
|
schema = createSchema(config.current);
|
|
154
123
|
setEditorAPI(pluginInjectionAPI.current.api());
|
|
155
|
-
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
156
|
-
config.current.pmPlugins.push(createNodeViewPlugin(schema));
|
|
157
|
-
}
|
|
158
124
|
}
|
|
159
125
|
const {
|
|
160
126
|
contentTransformerProvider
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
|
|
2
2
|
import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
4
|
+
import { createEditorNativeAnchorSupportPlugin } from './editorNativeAnchorSupportPlugin';
|
|
3
5
|
import { createEditorStateNotificationPlugin } from './editorStateNotificationPlugin';
|
|
4
6
|
export function sortByRank(a, b) {
|
|
5
7
|
return a.rank - b.rank;
|
|
@@ -94,6 +96,9 @@ export function createPMPlugins(config) {
|
|
|
94
96
|
featureFlags: config.featureFlags || {},
|
|
95
97
|
getIntl: config.getIntl
|
|
96
98
|
})).filter(plugin => typeof plugin !== 'undefined');
|
|
99
|
+
if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
|
|
100
|
+
pmPlugins.push(createEditorNativeAnchorSupportPlugin(config.schema));
|
|
101
|
+
}
|
|
97
102
|
if (config.onEditorStateUpdated !== undefined) {
|
|
98
103
|
return [createEditorStateNotificationPlugin(config.onEditorStateUpdated, config.editorConfig.onEditorViewStateUpdatedCallbacks), ...pmPlugins];
|
|
99
104
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
const injectNodeViewNodeTypeList = ['paragraph', 'heading', 'bulletList', 'orderedList', 'blockquote', 'rule', 'decisionList', 'taskList', 'layoutColumn', 'hardBreak'];
|
|
5
|
+
const key = new PluginKey('editorNativeAnchorSupportPlugin');
|
|
6
|
+
|
|
7
|
+
// Internal plugin to enable native anchor support in the editor.
|
|
8
|
+
// This plugin injects node views for specific node types (e.g., 'paragraph', 'heading')
|
|
9
|
+
// that do not already have a nodeView, allowing them to be rendered with native anchors when needed.
|
|
10
|
+
export const createEditorNativeAnchorSupportPlugin = schema => {
|
|
11
|
+
const nodeViewEntries = [];
|
|
12
|
+
schema.spec.nodes.forEach((nodeName, nodeSpec) => {
|
|
13
|
+
if (injectNodeViewNodeTypeList.includes(nodeName)) {
|
|
14
|
+
if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
|
|
15
|
+
const toDOM = nodeSpec.toDOM.bind(nodeSpec);
|
|
16
|
+
nodeViewEntries.push([nodeName, node => DOMSerializer.renderSpec(document, toDOM(node))]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
return new SafePlugin({
|
|
21
|
+
key,
|
|
22
|
+
props: {
|
|
23
|
+
nodeViews: Object.fromEntries(nodeViewEntries)
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -47,7 +47,7 @@ import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
|
47
47
|
* @example
|
|
48
48
|
*/
|
|
49
49
|
export function createDefaultPreset(options) {
|
|
50
|
-
var _options$featureFlags, _options$featureFlags2;
|
|
50
|
+
var _options$toolbar, _options$featureFlags, _options$featureFlags2;
|
|
51
51
|
const isFullPage = fullPageCheck(options.appearance);
|
|
52
52
|
const preset = new EditorPresetBuilder().add([featureFlagsPlugin, options.featureFlags || {}]).maybeAdd([analyticsPlugin, {
|
|
53
53
|
createAnalyticsEvent: options.createAnalyticsEvent,
|
|
@@ -61,9 +61,9 @@ export function createDefaultPreset(options) {
|
|
|
61
61
|
}
|
|
62
62
|
}], () => fg('platform_editor_use_preferences_plugin')).maybeAdd(interactionPlugin, Boolean(options === null || options === void 0 ? void 0 : options.__livePage) || expValEquals('platform_editor_no_cursor_on_edit_page_init', 'isEnabled', true)).add(compositionPlugin).add([contextIdentifierPlugin, {
|
|
63
63
|
contextIdentifierProvider: options.contextIdentifierProvider
|
|
64
|
-
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).maybeAdd([toolbarPlugin, options.toolbar || {}],
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
}]).add([basePlugin, options.base]).add(decorationsPlugin).add([typeAheadPlugin, options.typeAhead]).maybeAdd(historyPlugin, Boolean(options.allowUndoRedoButtons)).maybeAdd([toolbarPlugin, options.toolbar || {}],
|
|
65
|
+
// if explicitly set to false, don't enable. If undefined treat as truthy and allow plugin to be enabled under experiment
|
|
66
|
+
Boolean(expValEquals('platform_editor_toolbar_aifc_exp_code_toggle', 'isEnabled', true) ? ((_options$toolbar = options.toolbar) === null || _options$toolbar === void 0 ? void 0 : _options$toolbar.enableNewToolbarExperience) !== false && editorExperiment('platform_editor_toolbar_aifc', true) : editorExperiment('platform_editor_toolbar_aifc', true))).add([primaryToolbarPlugin, {
|
|
67
67
|
contextualFormattingEnabled: isFullPage
|
|
68
68
|
}]).maybeAdd(undoRedoPlugin, Boolean((_options$featureFlags = (_options$featureFlags2 = options.featureFlags) === null || _options$featureFlags2 === void 0 ? void 0 : _options$featureFlags2.undoRedoButtons) !== null && _options$featureFlags !== void 0 ? _options$featureFlags : options.allowUndoRedoButtons)).add([blockTypePlugin, {
|
|
69
69
|
...options.blockType,
|
|
@@ -211,6 +211,7 @@ export const CommentEditorWithIntl = props => {
|
|
|
211
211
|
css: expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew] : /* eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
212
212
|
mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
|
|
213
213
|
}, customPrimaryToolbarComponents);
|
|
214
|
+
const isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true);
|
|
214
215
|
return jsx(WithFlash, {
|
|
215
216
|
animate: maxContentSizeReached
|
|
216
217
|
}, jsx(WidthProvider, null, jsx("div", {
|
|
@@ -226,8 +227,9 @@ export const CommentEditorWithIntl = props => {
|
|
|
226
227
|
ref: wrapperElementRef
|
|
227
228
|
}, jsx(MainToolbar, {
|
|
228
229
|
useStickyToolbar: useStickyToolbar,
|
|
229
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
230
|
-
|
|
230
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled,
|
|
231
|
+
isNewToolbarEnabled: isToolbarAIFCEnabled
|
|
232
|
+
}, isToolbarAIFCEnabled ? jsx(React.Fragment, null, jsx(CommentToolbar, {
|
|
231
233
|
editorAPI: editorAPI,
|
|
232
234
|
editorView: editorView,
|
|
233
235
|
editorAppearance: appearance
|
|
@@ -10,7 +10,6 @@ import React, { useEffect, useState } from 'react';
|
|
|
10
10
|
import { css, jsx } from '@emotion/react';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
13
|
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
15
14
|
const akEditorMenuZIndex = 500;
|
|
16
15
|
const akEditorToolbarKeylineHeight = 2;
|
|
@@ -158,11 +157,11 @@ const StickyToolbar = props => {
|
|
|
158
157
|
return (
|
|
159
158
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
160
159
|
jsx("div", {
|
|
161
|
-
css: expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, fg('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew,
|
|
160
|
+
css: expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, fg('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding] : [
|
|
162
161
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
163
162
|
mainToolbarWrapperStyle(props.twoLineEditorToolbar,
|
|
164
163
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
165
|
-
|
|
164
|
+
props.isNewToolbarEnabled), stickyToolbarWrapperStyle]
|
|
166
165
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
167
166
|
,
|
|
168
167
|
style: {
|
|
@@ -178,11 +177,11 @@ const StickyToolbar = props => {
|
|
|
178
177
|
const FixedToolbar = props =>
|
|
179
178
|
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
180
179
|
jsx("div", {
|
|
181
|
-
css: expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, fg('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh,
|
|
180
|
+
css: expValEquals('platform_editor_core_static_emotion_non_central', 'isEnabled', true) ? [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, fg('platform-visual-refresh-icons') && mainToolbarWrapperStylesVisualRefresh, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding] :
|
|
182
181
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
183
182
|
mainToolbarWrapperStyle(props.twoLineEditorToolbar,
|
|
184
183
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
185
|
-
|
|
184
|
+
props.isNewToolbarEnabled),
|
|
186
185
|
"data-testid": "ak-editor-main-toolbar"
|
|
187
186
|
}, props.children);
|
|
188
187
|
|
|
@@ -216,17 +215,20 @@ const getStickyParameters = configuration => {
|
|
|
216
215
|
export const MainToolbar = ({
|
|
217
216
|
useStickyToolbar,
|
|
218
217
|
twoLineEditorToolbar,
|
|
219
|
-
children
|
|
218
|
+
children,
|
|
219
|
+
isNewToolbarEnabled
|
|
220
220
|
}) => {
|
|
221
221
|
if (useStickyToolbar) {
|
|
222
222
|
return jsx(StickyToolbar
|
|
223
223
|
// Ignored via go/ees005
|
|
224
224
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
225
225
|
, _extends({}, getStickyParameters(useStickyToolbar), {
|
|
226
|
-
twoLineEditorToolbar: twoLineEditorToolbar
|
|
226
|
+
twoLineEditorToolbar: twoLineEditorToolbar,
|
|
227
|
+
isNewToolbarEnabled: isNewToolbarEnabled
|
|
227
228
|
}), children);
|
|
228
229
|
}
|
|
229
230
|
return jsx(FixedToolbar, {
|
|
230
|
-
twoLineEditorToolbar: twoLineEditorToolbar
|
|
231
|
+
twoLineEditorToolbar: twoLineEditorToolbar,
|
|
232
|
+
isNewToolbarEnabled: isNewToolbarEnabled
|
|
231
233
|
}, children);
|
|
232
234
|
};
|
|
@@ -138,7 +138,7 @@ export const FullPageEditor = props => {
|
|
|
138
138
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
|
|
139
139
|
'--ak-editor-fullpage-toolbar-height': FULL_PAGE_EDITOR_TOOLBAR_HEIGHT()
|
|
140
140
|
}
|
|
141
|
-
}, !isEditorToolbarHidden && (editorExperiment('platform_editor_toolbar_aifc', true) ? jsx(IntlProvider, {
|
|
141
|
+
}, !isEditorToolbarHidden && (Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true) ? jsx(IntlProvider, {
|
|
142
142
|
locale: "en"
|
|
143
143
|
}, jsx(FullPageToolbarNext, {
|
|
144
144
|
toolbarDockingPosition: (_toolbarDockingPositi = toolbarDockingPosition) !== null && _toolbarDockingPositi !== void 0 ? _toolbarDockingPositi : toolbarDocking,
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
._19pkpxbi{margin-top:var(--ds-space-200,1pc)}
|
|
7
7
|
._1bahesu3{justify-content:flex-end}
|
|
8
8
|
._1e0c1txw{display:flex}
|
|
9
|
+
._1pby16oo{z-index:510}
|
|
9
10
|
._1ul91ns9{min-width:-moz-fit-content;min-width:fit-content}
|
|
10
11
|
._2hwxpxbi{margin-right:var(--ds-space-200,1pc)}
|
|
11
12
|
._4cvr1h6o{align-items:center}
|
|
12
13
|
._4t3izwfg{height:2pc}
|
|
14
|
+
._kqswh2mm{position:relative}
|
|
13
15
|
._otyrpxbi{margin-bottom:var(--ds-space-200,1pc)}
|
|
@@ -16,6 +16,7 @@ const styles = {
|
|
|
16
16
|
mainToolbarIconBeforeNew: "_4cvr1h6o _1e0c1txw",
|
|
17
17
|
mainToolbarWrapper: "_1rjc12x7 _18zrutpp _n7zl7r9e",
|
|
18
18
|
mainToolbarNew: "_1e0c1txw _4t3izwfg",
|
|
19
|
+
mainToolbarZIndex: "_1pby16oo _kqswh2mm",
|
|
19
20
|
mainToolbarWithKeyline: "_16qs9g9j",
|
|
20
21
|
customToolbarWrapperStyle: "_4cvr1h6o _1e0c1txw",
|
|
21
22
|
firstChildWrapperOneLine: "_1e0c1txw _16jlkb7n",
|
|
@@ -29,7 +30,7 @@ const MainToolbarWrapper = ({
|
|
|
29
30
|
}) => {
|
|
30
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
31
32
|
"data-testid": testId,
|
|
32
|
-
className: ax([styles.mainToolbarWrapper, showKeyline && styles.mainToolbarWithKeyline, expValEquals('platform_editor_toolbar_support_custom_components', 'isEnabled', true) && styles.mainToolbarNew])
|
|
33
|
+
className: ax([styles.mainToolbarWrapper, showKeyline && styles.mainToolbarWithKeyline, expValEquals('platform_editor_toolbar_support_custom_components', 'isEnabled', true) && styles.mainToolbarNew, expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) && styles.mainToolbarZIndex])
|
|
33
34
|
}, children);
|
|
34
35
|
};
|
|
35
36
|
const FirstChildWrapper = ({
|
|
@@ -105,7 +106,7 @@ export const FullPageToolbarNext = ({
|
|
|
105
106
|
showKeyline: showKeyline || ContextPanelWidth > 0
|
|
106
107
|
}, beforeIcon && /*#__PURE__*/React.createElement("div", {
|
|
107
108
|
className: ax([styles.mainToolbarIconBefore, expValEquals('platform_editor_toolbar_support_custom_components', 'isEnabled', true) && styles.mainToolbarIconBeforeNew])
|
|
108
|
-
}, beforeIcon), expValEquals('platform_editor_toolbar_support_custom_components', 'isEnabled', true) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FirstChildWrapper, null, toolbarDockingPosition !== 'none' && components && isToolbar(toolbar) && /*#__PURE__*/React.createElement(ToolbarNext, {
|
|
109
|
+
}, beforeIcon), expValEquals('platform_editor_toolbar_support_custom_components', 'isEnabled', true) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FirstChildWrapper, null, toolbarDockingPosition !== 'none' && components && isToolbar(toolbar) && (!expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) || editorView) && /*#__PURE__*/React.createElement(ToolbarNext, {
|
|
109
110
|
toolbar: toolbar,
|
|
110
111
|
components: components,
|
|
111
112
|
editorView: editorView,
|
|
@@ -117,7 +118,7 @@ export const FullPageToolbarNext = ({
|
|
|
117
118
|
}, !!customPrimaryToolbarComponents && 'before' in customPrimaryToolbarComponents && /*#__PURE__*/React.createElement("div", {
|
|
118
119
|
"data-testid": 'before-primary-toolbar-components-plugin',
|
|
119
120
|
className: ax([styles.beforePrimaryToolbarComponents])
|
|
120
|
-
}, customPrimaryToolbarComponents.before), !!customPrimaryToolbarComponents && 'after' in customPrimaryToolbarComponents ? customPrimaryToolbarComponents.after : customPrimaryToolbarComponents))) : toolbarDockingPosition !== 'none' && components && isToolbar(toolbar) && /*#__PURE__*/React.createElement(ToolbarNext, {
|
|
121
|
+
}, customPrimaryToolbarComponents.before), !!customPrimaryToolbarComponents && 'after' in customPrimaryToolbarComponents ? customPrimaryToolbarComponents.after : customPrimaryToolbarComponents))) : toolbarDockingPosition !== 'none' && components && isToolbar(toolbar) && (!expValEquals('platform_editor_toolbar_aifc_patch_3', 'isEnabled', true) || editorView) && /*#__PURE__*/React.createElement(ToolbarNext, {
|
|
121
122
|
toolbar: toolbar,
|
|
122
123
|
components: components,
|
|
123
124
|
editorView: editorView,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "211.2.
|
|
2
|
+
export const version = "211.2.8";
|