@atlaskit/editor-core 211.2.7 → 211.2.8

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +0 -38
  3. package/dist/cjs/create-editor/create-editor.js +5 -0
  4. package/dist/cjs/create-editor/editorNativeAnchorSupportPlugin.js +34 -0
  5. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbarNext.compiled.css +2 -0
  6. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbarNext.js +2 -1
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/es2019/create-editor/ReactEditorView.js +1 -35
  9. package/dist/es2019/create-editor/create-editor.js +5 -0
  10. package/dist/es2019/create-editor/editorNativeAnchorSupportPlugin.js +26 -0
  11. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbarNext.compiled.css +2 -0
  12. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbarNext.js +2 -1
  13. package/dist/es2019/version-wrapper.js +1 -1
  14. package/dist/esm/create-editor/ReactEditorView.js +1 -39
  15. package/dist/esm/create-editor/create-editor.js +5 -0
  16. package/dist/esm/create-editor/editorNativeAnchorSupportPlugin.js +28 -0
  17. package/dist/esm/ui/Appearance/FullPage/FullPageToolbarNext.compiled.css +2 -0
  18. package/dist/esm/ui/Appearance/FullPage/FullPageToolbarNext.js +2 -1
  19. package/dist/esm/version-wrapper.js +1 -1
  20. package/dist/types/create-editor/create-editor.d.ts +1 -1
  21. package/dist/types/create-editor/create-universal-preset.d.ts +3 -0
  22. package/dist/types/create-editor/editorNativeAnchorSupportPlugin.d.ts +3 -0
  23. package/dist/types/presets/universal.d.ts +3 -0
  24. package/dist/types/presets/useUniversalPreset.d.ts +3 -0
  25. package/dist/types-ts4.5/create-editor/create-editor.d.ts +1 -1
  26. package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +3 -0
  27. package/dist/types-ts4.5/create-editor/editorNativeAnchorSupportPlugin.d.ts +3 -0
  28. package/dist/types-ts4.5/presets/universal.d.ts +3 -0
  29. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +3 -0
  30. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 211.2.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e834d11aee625`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e834d11aee625) -
8
+ Add z-index to new main primary toolbar, to fix stacking issues
9
+ - Updated dependencies
10
+
3
11
  ## 211.2.7
4
12
 
5
13
  ### 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
+ };
@@ -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) {
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "211.2.6";
8
+ var version = exports.version = "211.2.7";
@@ -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 { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
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
+ };
@@ -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 = ({
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "211.2.6";
2
+ export const version = "211.2.7";
@@ -18,12 +18,10 @@ import { measureRender } from '@atlaskit/editor-common/performance/measure-rende
18
18
  import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
19
19
  import { EditorPluginInjectionAPI } from '@atlaskit/editor-common/preset';
20
20
  import { processRawValue, processRawValueWithoutValidation } from '@atlaskit/editor-common/process-raw-value';
21
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
22
21
  import { ReactEditorViewContext } from '@atlaskit/editor-common/ui-react';
23
22
  import { analyticsEventKey, getAnalyticsEventSeverity } from '@atlaskit/editor-common/utils/analytics';
24
23
  import { isEmptyDocument } from '@atlaskit/editor-common/utils/document';
25
- import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
26
- import { EditorState, PluginKey, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
24
+ import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
27
25
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
28
26
  import { fg } from '@atlaskit/platform-feature-flags';
29
27
  import { abortAll, getActiveInteraction } from '@atlaskit/react-ufo/interaction-metrics';
@@ -46,39 +44,6 @@ import { handleEditorFocus } from './ReactEditorView/handleEditorFocus';
46
44
  import { useDispatchTransaction } from './ReactEditorView/useDispatchTransaction';
47
45
  import { useFireFullWidthEvent } from './ReactEditorView/useFireFullWidthEvent';
48
46
  var EDIT_AREA_ID = 'ak-editor-textarea';
49
- var injectNodeViewNodeTypeList = ['paragraph', 'heading'];
50
- var createNodeViewPlugin = function createNodeViewPlugin(schema) {
51
- var nodeViewEntries = [];
52
- schema.spec.nodes.forEach(function (nodeName, nodeSpec) {
53
- if (injectNodeViewNodeTypeList.includes(nodeName)) {
54
- if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
55
- var toDOM = nodeSpec.toDOM.bind(nodeSpec);
56
- nodeViewEntries.push([nodeName, function (node) {
57
- return DOMSerializer.renderSpec(document, toDOM(node));
58
- }]);
59
- }
60
- }
61
- });
62
- return {
63
- name: 'nodeViewInjectPlugin',
64
- plugin: function plugin() {
65
- return new SafePlugin({
66
- state: {
67
- init: function init() {
68
- return {};
69
- },
70
- apply: function apply(_tr, pluginState) {
71
- return pluginState;
72
- }
73
- },
74
- key: new PluginKey('nodeViewInjectPlugin'),
75
- props: {
76
- nodeViews: Object.fromEntries(nodeViewEntries)
77
- }
78
- });
79
- }
80
- };
81
- };
82
47
  export function ReactEditorView(props) {
83
48
  var _pluginInjectionAPI$c, _media, _linking, _document$querySelect, _props$render, _props$render2;
84
49
  var preset = props.preset,
@@ -174,9 +139,6 @@ export function ReactEditorView(props) {
174
139
  config.current = processPluginsList(createPluginsList(options.props.preset, props.editorProps, pluginInjectionAPI.current));
175
140
  schema = createSchema(config.current);
176
141
  setEditorAPI(pluginInjectionAPI.current.api());
177
- if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
178
- config.current.pmPlugins.push(createNodeViewPlugin(schema));
179
- }
180
142
  }
181
143
  var contentTransformerProvider = options.props.editorProps.contentTransformerProvider;
182
144
  var plugins = createPMPlugins({
@@ -1,6 +1,8 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
3
3
  import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
4
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
+ import { createEditorNativeAnchorSupportPlugin } from './editorNativeAnchorSupportPlugin';
4
6
  import { createEditorStateNotificationPlugin } from './editorStateNotificationPlugin';
5
7
  export function sortByRank(a, b) {
6
8
  return a.rank - b.rank;
@@ -103,6 +105,9 @@ export function createPMPlugins(config) {
103
105
  }).filter(function (plugin) {
104
106
  return typeof plugin !== 'undefined';
105
107
  });
108
+ if (expValEquals('platform_editor_native_anchor_support', 'isEnabled', true)) {
109
+ pmPlugins.push(createEditorNativeAnchorSupportPlugin(config.schema));
110
+ }
106
111
  if (config.onEditorStateUpdated !== undefined) {
107
112
  return [createEditorStateNotificationPlugin(config.onEditorStateUpdated, config.editorConfig.onEditorViewStateUpdatedCallbacks)].concat(_toConsumableArray(pmPlugins));
108
113
  }
@@ -0,0 +1,28 @@
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
+ var injectNodeViewNodeTypeList = ['paragraph', 'heading', 'bulletList', 'orderedList', 'blockquote', 'rule', 'decisionList', 'taskList', 'layoutColumn', 'hardBreak'];
5
+ var 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 var createEditorNativeAnchorSupportPlugin = function createEditorNativeAnchorSupportPlugin(schema) {
11
+ var nodeViewEntries = [];
12
+ schema.spec.nodes.forEach(function (nodeName, nodeSpec) {
13
+ if (injectNodeViewNodeTypeList.includes(nodeName)) {
14
+ if (nodeSpec.toDOM && typeof nodeSpec.toDOM === 'function') {
15
+ var toDOM = nodeSpec.toDOM.bind(nodeSpec);
16
+ nodeViewEntries.push([nodeName, function (node) {
17
+ return DOMSerializer.renderSpec(document, toDOM(node));
18
+ }]);
19
+ }
20
+ }
21
+ });
22
+ return new SafePlugin({
23
+ key: key,
24
+ props: {
25
+ nodeViews: Object.fromEntries(nodeViewEntries)
26
+ }
27
+ });
28
+ };
@@ -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 @@ var 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",
@@ -28,7 +29,7 @@ var MainToolbarWrapper = function MainToolbarWrapper(_ref) {
28
29
  showKeyline = _ref.showKeyline;
29
30
  return /*#__PURE__*/React.createElement("div", {
30
31
  "data-testid": testId,
31
- className: ax([styles.mainToolbarWrapper, showKeyline && styles.mainToolbarWithKeyline, expValEquals('platform_editor_toolbar_support_custom_components', 'isEnabled', true) && styles.mainToolbarNew])
32
+ 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])
32
33
  }, children);
33
34
  };
34
35
  var FirstChildWrapper = function FirstChildWrapper(_ref2) {
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "211.2.6";
2
+ export var version = "211.2.7";
@@ -1,5 +1,5 @@
1
- import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
2
1
  import type { ErrorReportingHandler } from '@atlaskit/editor-common/error-reporter';
2
+ import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
3
3
  import { type SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { EditorPlugin } from '@atlaskit/editor-common/types';
5
5
  import type { MarkSpec } from '@atlaskit/editor-prosemirror/model';
@@ -379,6 +379,9 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
379
379
  };
380
380
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/block-controls").BlockControlsPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/user-intent").UserIntentPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/selection").SelectionPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/decorations").DecorationsPlugin>];
381
381
  pluginConfiguration?: import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions;
382
+ sharedState: {
383
+ isFormatMenuHidden?: boolean;
384
+ } | undefined;
382
385
  }, import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
383
386
  actions: import("@atlaskit/editor-plugins/selection").EditorSelectionAPI;
384
387
  commands: {
@@ -0,0 +1,3 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
+ export declare const createEditorNativeAnchorSupportPlugin: (schema: Schema) => SafePlugin<any>;
@@ -437,6 +437,9 @@ export default function createUniversalPresetInternal({ appearance, props, featu
437
437
  };
438
438
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/block-controls").BlockControlsPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/user-intent").UserIntentPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/selection").SelectionPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/decorations").DecorationsPlugin>];
439
439
  pluginConfiguration?: import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions;
440
+ sharedState: {
441
+ isFormatMenuHidden?: boolean;
442
+ } | undefined;
440
443
  }, import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
441
444
  actions: import("@atlaskit/editor-plugins/selection").EditorSelectionAPI;
442
445
  commands: {
@@ -379,6 +379,9 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
379
379
  };
380
380
  dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/block-controls").BlockControlsPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/user-intent").UserIntentPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/selection").SelectionPlugin>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/decorations").DecorationsPlugin>];
381
381
  pluginConfiguration?: import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions;
382
+ sharedState: {
383
+ isFormatMenuHidden?: boolean;
384
+ } | undefined;
382
385
  }, import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions | undefined>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
383
386
  actions: import("@atlaskit/editor-plugins/selection").EditorSelectionAPI;
384
387
  commands: {
@@ -1,5 +1,5 @@
1
- import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
2
1
  import type { ErrorReportingHandler } from '@atlaskit/editor-common/error-reporter';
2
+ import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
3
3
  import { type SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { EditorPlugin } from '@atlaskit/editor-common/types';
5
5
  import type { MarkSpec } from '@atlaskit/editor-prosemirror/model';
@@ -538,6 +538,9 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
538
538
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/decorations").DecorationsPlugin>
539
539
  ];
540
540
  pluginConfiguration?: import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions;
541
+ sharedState: {
542
+ isFormatMenuHidden?: boolean;
543
+ } | undefined;
541
544
  }, import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions | undefined>>,
542
545
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
543
546
  actions: import("@atlaskit/editor-plugins/selection").EditorSelectionAPI;
@@ -0,0 +1,3 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
+ export declare const createEditorNativeAnchorSupportPlugin: (schema: Schema) => SafePlugin<any>;
@@ -596,6 +596,9 @@ export default function createUniversalPresetInternal({ appearance, props, featu
596
596
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/decorations").DecorationsPlugin>
597
597
  ];
598
598
  pluginConfiguration?: import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions;
599
+ sharedState: {
600
+ isFormatMenuHidden?: boolean;
601
+ } | undefined;
599
602
  }, import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions | undefined>>,
600
603
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
601
604
  actions: import("@atlaskit/editor-plugins/selection").EditorSelectionAPI;
@@ -538,6 +538,9 @@ export default function useUniversalPreset({ props, initialPluginConfiguration }
538
538
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-plugins/decorations").DecorationsPlugin>
539
539
  ];
540
540
  pluginConfiguration?: import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions;
541
+ sharedState: {
542
+ isFormatMenuHidden?: boolean;
543
+ } | undefined;
541
544
  }, import("@atlaskit/editor-plugins/block-menu").BlockMenuPluginOptions | undefined>>,
542
545
  import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
543
546
  actions: import("@atlaskit/editor-plugins/selection").EditorSelectionAPI;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "211.2.7",
3
+ "version": "211.2.8",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/editor-performance-metrics": "^2.1.0",
50
50
  "@atlaskit/editor-plugin-quick-insert": "^4.0.0",
51
51
  "@atlaskit/editor-plugin-user-preferences": "^2.0.0",
52
- "@atlaskit/editor-plugins": "^10.3.0",
52
+ "@atlaskit/editor-plugins": "^10.4.0",
53
53
  "@atlaskit/editor-prosemirror": "7.0.0",
54
54
  "@atlaskit/editor-shared-styles": "^3.6.0",
55
55
  "@atlaskit/editor-toolbar": "^0.8.0",
@@ -63,7 +63,7 @@
63
63
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
64
64
  "@atlaskit/react-ufo": "^4.5.0",
65
65
  "@atlaskit/task-decision": "^19.2.0",
66
- "@atlaskit/tmp-editor-statsig": "^12.6.0",
66
+ "@atlaskit/tmp-editor-statsig": "^12.7.0",
67
67
  "@atlaskit/tokens": "^6.3.0",
68
68
  "@atlaskit/tooltip": "^20.4.0",
69
69
  "@atlaskit/width-detector": "^5.0.0",
@@ -80,7 +80,7 @@
80
80
  "uuid": "^3.1.0"
81
81
  },
82
82
  "peerDependencies": {
83
- "@atlaskit/editor-common": "^108.5.0",
83
+ "@atlaskit/editor-common": "^108.6.0",
84
84
  "@atlaskit/link-provider": "^3.7.0",
85
85
  "@atlaskit/media-core": "^37.0.0",
86
86
  "react": "^18.2.0",
@@ -106,7 +106,7 @@
106
106
  "@atlaskit/primitives": "^14.14.0",
107
107
  "@atlaskit/renderer": "^121.3.0",
108
108
  "@atlaskit/section-message": "^8.7.0",
109
- "@atlaskit/smart-card": "^40.20.0",
109
+ "@atlaskit/smart-card": "^40.21.0",
110
110
  "@atlaskit/synchrony-test-helpers": "workspace:^",
111
111
  "@atlaskit/toggle": "^15.1.0",
112
112
  "@atlaskit/util-data-test": "^18.1.0",