@atlaskit/editor-core 217.9.3 → 217.10.1

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 (48) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/composable-editor/editor-internal.js +5 -5
  3. package/dist/cjs/create-editor/ReactEditorView.js +32 -8
  4. package/dist/cjs/create-editor/create-schema.js +1 -1
  5. package/dist/cjs/ui/Appearance/Chromeless.js +9 -6
  6. package/dist/cjs/ui/Appearance/Comment/Comment.js +26 -14
  7. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +10 -7
  8. package/dist/cjs/ui/ContextPanel/index.js +9 -6
  9. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +1 -1
  10. package/dist/cjs/ui/EditorContentContainer/styles/expandStyles.js +2 -2
  11. package/dist/cjs/ui/EditorContentContainer/styles/list.js +12 -5
  12. package/dist/cjs/ui/Toolbar/Toolbar.js +26 -17
  13. package/dist/cjs/version-wrapper.js +1 -1
  14. package/dist/es2019/composable-editor/editor-internal.js +5 -5
  15. package/dist/es2019/create-editor/ReactEditorView.js +30 -8
  16. package/dist/es2019/create-editor/create-schema.js +1 -1
  17. package/dist/es2019/ui/Appearance/Chromeless.js +7 -4
  18. package/dist/es2019/ui/Appearance/Comment/Comment.js +24 -14
  19. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +1 -3
  20. package/dist/es2019/ui/ContextPanel/index.js +7 -4
  21. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +1 -1
  22. package/dist/es2019/ui/EditorContentContainer/styles/expandStyles.js +2 -2
  23. package/dist/es2019/ui/EditorContentContainer/styles/list.js +12 -5
  24. package/dist/es2019/ui/Toolbar/Toolbar.js +21 -16
  25. package/dist/es2019/version-wrapper.js +1 -1
  26. package/dist/esm/composable-editor/editor-internal.js +5 -5
  27. package/dist/esm/create-editor/ReactEditorView.js +32 -8
  28. package/dist/esm/create-editor/create-schema.js +1 -1
  29. package/dist/esm/ui/Appearance/Chromeless.js +9 -6
  30. package/dist/esm/ui/Appearance/Comment/Comment.js +26 -14
  31. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +3 -6
  32. package/dist/esm/ui/ContextPanel/index.js +9 -6
  33. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +1 -1
  34. package/dist/esm/ui/EditorContentContainer/styles/expandStyles.js +2 -2
  35. package/dist/esm/ui/EditorContentContainer/styles/list.js +12 -5
  36. package/dist/esm/ui/Toolbar/Toolbar.js +23 -16
  37. package/dist/esm/version-wrapper.js +1 -1
  38. package/dist/types/create-editor/create-schema.d.ts +1 -1
  39. package/dist/types/create-editor/create-universal-preset.d.ts +6 -0
  40. package/dist/types/presets/universal.d.ts +7 -4
  41. package/dist/types/presets/useUniversalPreset.d.ts +6 -0
  42. package/dist/types/ui/Appearance/Chromeless.d.ts +1 -0
  43. package/dist/types-ts4.5/create-editor/create-schema.d.ts +1 -1
  44. package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +6 -0
  45. package/dist/types-ts4.5/presets/universal.d.ts +7 -4
  46. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +6 -0
  47. package/dist/types-ts4.5/ui/Appearance/Chromeless.d.ts +1 -0
  48. package/package.json +4 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 217.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3e18e5bea1aa1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3e18e5bea1aa1) -
8
+ Fixed cursor placement when pressing Enter at the start of a nested task item. Fixed extra spacing
9
+ on nested task lists when flexible list indentation is enabled.
10
+ - Updated dependencies
11
+
12
+ ## 217.10.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [`22cc6940b4250`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22cc6940b4250) -
17
+ Add gated editor-core perf lint cleanup experiment support
18
+
19
+ ### Patch Changes
20
+
21
+ - [`d3fdb52a809c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3fdb52a809c9) -
22
+ clean up feature flag platform_editor_max_width_mode_resize_fix
23
+ - Updated dependencies
24
+
3
25
  ## 217.9.3
4
26
 
5
27
  ### Patch Changes
@@ -32,6 +32,7 @@ var editorContainerStyles = (0, _react2.css)({
32
32
  width: '100%',
33
33
  height: '100%'
34
34
  });
35
+ var DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
35
36
 
36
37
  /**
37
38
  * EditorInternalComponent is used to capture the common component
@@ -67,14 +68,13 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
67
68
  _usePortalProvider4 = (0, _slicedToArray2.default)(_usePortalProvider3, 2),
68
69
  nodeViewPortalProviderAPI = _usePortalProvider4[0],
69
70
  NodeViewPortalRenderer = _usePortalProvider4[1];
71
+ var propsToIgnore = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
70
72
  return (0, _react2.jsx)(_react.Fragment, null, renderTrackingEnabled && (0, _react2.jsx)(_RenderTracking.RenderTracking, {
71
73
  componentProps: props,
72
74
  action: _analytics.ACTION.RE_RENDERED,
73
75
  actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
74
- handleAnalyticsEvent: handleAnalyticsEvent
75
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
76
- ,
77
- propsToIgnore: ['defaultValue'],
76
+ handleAnalyticsEvent: handleAnalyticsEvent,
77
+ propsToIgnore: propsToIgnore,
78
78
  useShallow: useShallow
79
79
  }), (0, _react2.jsx)(_ErrorBoundary.default, {
80
80
  errorTracking: true,
@@ -102,7 +102,7 @@ var EditorInternal = exports.EditorInternal = /*#__PURE__*/(0, _react.memo)(func
102
102
  onEditorDestroyed: onEditorDestroyed,
103
103
  disabled: props.disabled,
104
104
  preset: preset
105
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
105
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017: this callback closes over the full props object and derived featureFlags; memoization is ineffective because ReactEditorViewNext is not memo()'d and deps (props, featureFlags) change every render
106
106
  ,
107
107
  render: function render(_ref2) {
108
108
  var _props$featureFlags, _props$featureFlags2;
@@ -868,6 +868,35 @@ function ReactEditorView(props) {
868
868
  var _props$editorProps3 = props.editorProps,
869
869
  assistiveLabel = _props$editorProps3.assistiveLabel,
870
870
  assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
871
+ var handleSsrEditorStateChanged = (0, _react.useCallback)(function (state) {
872
+ ssrEditorStateRef.current = state;
873
+ // Notify listeners about the initial SSR state
874
+ pluginInjectionAPI.current.onEditorViewUpdated({
875
+ newEditorState: state,
876
+ oldEditorState: undefined
877
+ });
878
+ }, [pluginInjectionAPI]);
879
+ var memoizedReactEditorViewContext = (0, _react.useMemo)(function () {
880
+ return {
881
+ editorRef: editorRef,
882
+ // Use a getter so that consumers always read the live viewRef.current at access
883
+ // time, not a stale snapshot captured when this memo was created.
884
+ get editorView() {
885
+ return viewRef.current;
886
+ },
887
+ popupsMountPoint: props.editorProps.popupsMountPoint
888
+ };
889
+ },
890
+ // viewRef is intentionally omitted from the deps array — it's a stable ref object; the getter reads
891
+ // .current lazily so there's no stale-closure risk.
892
+ // eslint-disable-next-line react-hooks/exhaustive-deps
893
+ [editorRef, props.editorProps.popupsMountPoint]);
894
+ // eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017
895
+ var reactEditorViewContext = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedReactEditorViewContext : {
896
+ editorRef: editorRef,
897
+ editorView: viewRef.current,
898
+ popupsMountPoint: props.editorProps.popupsMountPoint
899
+ };
871
900
  var ssrEditor = (0, _react.useMemo)(function () {
872
901
  if (!ssrDeps) {
873
902
  return null;
@@ -890,7 +919,7 @@ function ReactEditorView(props) {
890
919
  onSSRMeasure: onSSRMeasure
891
920
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
892
921
  ,
893
- onEditorStateChanged: function onEditorStateChanged(state) {
922
+ onEditorStateChanged: (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? handleSsrEditorStateChanged : function (state) {
894
923
  ssrEditorStateRef.current = state;
895
924
  // Notify listeners about the initial SSR state
896
925
  pluginInjectionAPI.current.onEditorViewUpdated({
@@ -899,7 +928,7 @@ function ReactEditorView(props) {
899
928
  });
900
929
  }
901
930
  });
902
- }, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure]);
931
+ }, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure, handleSsrEditorStateChanged]);
903
932
  var editor = (0, _react.useMemo)(function () {
904
933
  // SSR editor will be available only in SSR environment,
905
934
  // in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
@@ -921,12 +950,7 @@ function ReactEditorView(props) {
921
950
  startTimestampRef: firstRenderStartTimestampRef,
922
951
  onSSRMeasure: onSSRMeasure
923
952
  }, /*#__PURE__*/_react.default.createElement(_uiReact.ReactEditorViewContext.Provider, {
924
- // eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
925
- value: {
926
- editorRef: editorRef,
927
- editorView: viewRef.current,
928
- popupsMountPoint: props.editorProps.popupsMountPoint
929
- }
953
+ value: reactEditorViewContext
930
954
  }, renderTrackingEnabled && /*#__PURE__*/_react.default.createElement(_RenderTracking.RenderTracking, {
931
955
  componentProps: props,
932
956
  action: _analytics.ACTION.RE_RENDERED,
@@ -19,7 +19,7 @@ var _createEditor = require("./create-editor");
19
19
  * Adds generic metadata attributes to a DOMOutputSpec array based on the provided node or mark.
20
20
  * This function ensures that the DOMOutputSpec is annotated with ProseMirror-specific metadata.
21
21
  *
22
- * @param {Object} params - Parameters object.
22
+ * @param {object} params - Parameters object.
23
23
  * @param {PMNode | PMMark} params.nodeOrMark - The ProseMirror node or mark to extract metadata from.
24
24
  * @param {DOMOutputSpec} params.domSpec - The DOMOutputSpec to which attributes will be added.
25
25
  * @returns {DOMOutputSpec} The modified DOMOutputSpec with additional metadata.
@@ -16,6 +16,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
16
16
  var _react = _interopRequireWildcard(require("react"));
17
17
  var _react2 = require("@emotion/react");
18
18
  var _hooks = require("@atlaskit/editor-common/hooks");
19
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
19
20
  var _EditorContentContainer = _interopRequireDefault(require("../EditorContentContainer/EditorContentContainer"));
20
21
  var _PluginSlot = _interopRequireDefault(require("../PluginSlot"));
21
22
  var _WithFlash = _interopRequireDefault(require("../WithFlash"));
@@ -89,6 +90,9 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
89
90
  _this = _callSuper(this, Editor, [].concat(args));
90
91
  (0, _defineProperty2.default)(_this, "appearance", 'chromeless');
91
92
  (0, _defineProperty2.default)(_this, "containerElement", null);
93
+ (0, _defineProperty2.default)(_this, "setContainerElement", function (ref) {
94
+ _this.containerElement = ref;
95
+ });
92
96
  (0, _defineProperty2.default)(_this, "renderChrome", function (_ref) {
93
97
  var maxContentSize = _ref.maxContentSize;
94
98
  var _this$props = _this.props,
@@ -114,16 +118,15 @@ var Editor = exports.default = /*#__PURE__*/function (_React$Component) {
114
118
  var _states$editorViewMod;
115
119
  return states === null || states === void 0 || (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode;
116
120
  });
121
+ var containerRef = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.setContainerElement : function (ref) {
122
+ return _this.containerElement = ref;
123
+ };
117
124
  return (0, _react2.jsx)(_WithFlash.default, {
118
125
  animate: maxContentSizeReached
119
126
  }, (0, _react2.jsx)(ChromelessEditorContainer, {
120
127
  maxHeight: maxHeight,
121
- minHeight: minHeight
122
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
123
- ,
124
- containerRef: function containerRef(ref) {
125
- return _this.containerElement = ref;
126
- }
128
+ minHeight: minHeight,
129
+ containerRef: containerRef
127
130
  }, (0, _react2.jsx)(_EditorContentContainer.default
128
131
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
129
132
  , {
@@ -197,6 +197,30 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
197
197
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
198
198
  }
199
199
  var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
200
+ var memoizedContentAreaStyles = (0, _react.useMemo)(function () {
201
+ return [maxHeight ?
202
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
203
+ (0, _react2.css)({
204
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
205
+ maxHeight: "".concat(maxHeight, "px"),
206
+ // When maxHeight is set, content area should have overflow-y explicitly set as auto
207
+ // As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
208
+ // This will cause the content area to have content overflowing the container
209
+ // so need to set overflow-y as auto to make sure the content area is scrollable
210
+ overflowY: 'auto'
211
+ }) : null];
212
+ }, [maxHeight]);
213
+ var contentAreaStyles = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
214
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
215
+ (0, _react2.css)({
216
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
217
+ maxHeight: "".concat(maxHeight, "px"),
218
+ // When maxHeight is set, content area should have overflow-y explicitly set as auto
219
+ // As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
220
+ // This will cause the content area to have content overflowing the container
221
+ // so need to set overflow-y as auto to make sure the content area is scrollable
222
+ overflowY: 'auto'
223
+ }) : null];
200
224
  var customToolbarSlot = (0, _react2.jsx)("div", {
201
225
  css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
202
226
  }, customPrimaryToolbarComponents);
@@ -270,20 +294,8 @@ var CommentEditorWithIntl = exports.CommentEditorWithIntl = function CommentEdit
270
294
  }, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref) {
271
295
  var width = _ref.width;
272
296
  return (0, _react2.jsx)(_EditorContentContainer.default, {
273
- ref: containerElement
274
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
275
- ,
276
- css: [maxHeight ?
277
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
278
- (0, _react2.css)({
279
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
280
- maxHeight: "".concat(maxHeight, "px"),
281
- // When maxHeight is set, content area should have overflow-y explicitly set as auto
282
- // As we have overflow-x: clip for the content area, and when maxHeight prop is set, overflow-y will be computed as visible by default.
283
- // This will cause the content area to have content overflowing the container
284
- // so need to set overflow-y as auto to make sure the content area is scrollable
285
- overflowY: 'auto'
286
- }) : null],
297
+ ref: containerElement,
298
+ css: contentAreaStyles,
287
299
  isScrollable: maxHeight ? true : undefined
288
300
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
289
301
  ,
@@ -25,12 +25,16 @@ var _EditorContentContainer = _interopRequireDefault(require("../../EditorConten
25
25
  var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
26
26
  var _StyledComponents = require("./StyledComponents");
27
27
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
28
- 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; }
29
- 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; } /**
28
+ /**
30
29
  * @jsxRuntime classic
31
30
  * @jsx jsx
32
- */ /* eslint-disable @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */ // Ignored via go/ees005
31
+ */
32
+
33
+ /* eslint-disable @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
34
+
35
+ // Ignored via go/ees005
33
36
  // eslint-disable-next-line import/no-named-as-default
37
+
34
38
  var akEditorFullWidthLayoutWidth = 1800;
35
39
  var akEditorUltraWideLayoutWidth = 4000;
36
40
  var akEditorSwoopCubicBezier = "cubic-bezier(0.15, 1, 0.3, 1)";
@@ -281,11 +285,10 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
281
285
  }) && editorContentReducedGutterStyles]
282
286
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
283
287
  ,
284
- className: (0, _classnames.default)('ak-editor-content-area', 'appearance-full-page', _objectSpread({
285
- 'fabric-editor--full-width-mode': fullWidthMode
286
- }, (0, _platformFeatureFlags.fg)('platform_editor_max_width_mode_resize_fix') && {
288
+ className: (0, _classnames.default)('ak-editor-content-area', 'appearance-full-page', {
289
+ 'fabric-editor--full-width-mode': fullWidthMode,
287
290
  'fabric-editor--max-width-mode': Boolean(maxWidthMode)
288
- })),
291
+ }),
289
292
  ref: contentAreaRef
290
293
  }, !!props.customContentComponents && 'before' in props.customContentComponents ? (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents.before) : (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents), (0, _react2.jsx)(_PluginSlot.default, {
291
294
  editorView: props.editorView,
@@ -22,6 +22,7 @@ var _hooks = require("@atlaskit/editor-common/hooks");
22
22
  var _messages = require("@atlaskit/editor-common/messages");
23
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
24
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
25
26
  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; }
26
27
  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; }
27
28
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
@@ -75,6 +76,9 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
75
76
  mounted: false,
76
77
  currentPluginContent: undefined
77
78
  });
79
+ (0, _defineProperty2.default)(_this, "handleTransitionExited", function () {
80
+ _this.unsetPluginContent();
81
+ });
78
82
  (0, _defineProperty2.default)(_this, "focusEditor", function () {
79
83
  var _editorAPI$core;
80
84
  var editorAPI = _this.props.editorAPI;
@@ -89,16 +93,15 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
89
93
  return;
90
94
  }
91
95
  var animSpeedMs = (0, _platformFeatureFlags.fg)('platform_editor_disable_context_panel_animation') ? 0 : ANIM_SPEED_MS;
96
+ var onExited = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.handleTransitionExited : function () {
97
+ return _this.unsetPluginContent();
98
+ };
92
99
  return (0, _react2.jsx)(_Transition.default, {
93
100
  timeout: _this.state.mounted ? animSpeedMs : 0,
94
101
  in: !!pluginContent,
95
102
  mountOnEnter: true,
96
- unmountOnExit: true
97
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
98
- ,
99
- onExited: function onExited() {
100
- return _this.unsetPluginContent();
101
- }
103
+ unmountOnExit: true,
104
+ onExited: onExited
102
105
  }, currentPluginContent);
103
106
  });
104
107
  (0, _defineProperty2.default)(_this, "showProvidedContent", function (isVisible) {
@@ -150,7 +150,7 @@ var EditorContentContainer = /*#__PURE__*/_react.default.forwardRef(function (pr
150
150
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
151
151
  _baseStyles.baseStyles,
152
152
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
153
- (0, _platformFeatureFlags.fg)('platform_editor_max_width_mode_resize_fix') && _baseStyles.maxModeReizeFixStyles, (0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true) &&
153
+ _baseStyles.maxModeReizeFixStyles, (0, _expValEquals.expValEquals)('platform_editor_media_vc_fixes', 'isEnabled', true) &&
154
154
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
155
155
  _baseStyles.baseStylesMaxContainerWidthFixes,
156
156
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
@@ -94,8 +94,8 @@ var expandStylesBase = exports.expandStylesBase = (0, _react.css)({
94
94
  marginLeft: "var(--ds-space-050, 4px)",
95
95
  display: 'flow-root',
96
96
  /* The follow rules inside @supports block are added as a part of ED-8893
97
- The fix is targeting mobile bridge on iOS 12 or below,
98
- We should consider remove this fix when we no longer support iOS 12 */
97
+ The fix is targeting mobile bridge on iOS 12 or below,
98
+ We should consider remove this fix when we no longer support iOS 12 */
99
99
  '@supports not (display: flow-root)': {
100
100
  width: '100%',
101
101
  boxSizing: 'border-box'
@@ -227,12 +227,19 @@ var listItemHiddenMarkerStyles = exports.listItemHiddenMarkerStyles = (0, _react
227
227
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
228
228
  marginTop: '0 !important'
229
229
  },
230
- // Collapse wrapper task items (empty task items followed by a sibling nested task list)
231
- // Only hides empty task items that are actual wrappers, not regular empty task items being edited
232
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
233
- '[data-prosemirror-node-name="taskItem"]:has([data-empty="true"]):has(+ [data-node-type="actionList"])': {
230
+ // Remove top margin from nested taskLists not preceded by a sibling taskItem.
231
+ // The base rule (tasksAndDecisionsStyles) sets margin-top on all nested taskLists,
232
+ // but with flexible indentation a taskList can be the first child with no taskItem above.
233
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
234
+ 'div[data-task-list-local-id] > div[data-task-list-local-id]': {
235
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
236
+ marginTop: '0 !important'
237
+ },
238
+ // Restore margin when a nested taskList follows a taskItem
239
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
240
+ 'div[data-task-local-id] + div[data-task-list-local-id]': {
234
241
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
235
- display: 'none !important'
242
+ marginTop: "var(--ds-space-050, 4px)".concat(" !important")
236
243
  }
237
244
  }
238
245
  });
@@ -1,18 +1,26 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.ToolbarNext = exports.Toolbar = void 0;
8
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
9
  var _hooks = require("@atlaskit/editor-common/hooks");
10
10
  var _toolbar = require("@atlaskit/editor-common/toolbar");
11
11
  var _types = require("@atlaskit/editor-common/types");
12
12
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
13
13
  var _editorToolbar = require("@atlaskit/editor-toolbar");
14
14
  var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
16
  var _ToolbarInner = require("./ToolbarInner");
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
18
+ var TOOLBAR_FALLBACKS = {
19
+ group: _editorToolbar.ToolbarButtonGroup,
20
+ section: _editorToolbar.ToolbarSection,
21
+ menuSection: _editorToolbar.ToolbarDropdownItemSection
22
+ };
23
+
16
24
  /**
17
25
  * *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
18
26
  *
@@ -69,6 +77,18 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
69
77
  editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
70
78
  // remove offline check when patch6Enabled is cleaned up
71
79
  var isOffline = (0, _editorPluginConnectivity.isOfflineMode)(connectivityStateMode);
80
+ var memoizedFireAnalyticsEvent = (0, _react.useCallback)(function (payload) {
81
+ var _editorAPI$analytics;
82
+ editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 || _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
83
+ }, [editorAPI]);
84
+ var fireAnalyticsEvent = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedFireAnalyticsEvent : function (payload) {
85
+ return memoizedFireAnalyticsEvent(payload);
86
+ };
87
+ var fallbacks = (0, _expValEquals.expValEquals)('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? TOOLBAR_FALLBACKS : {
88
+ group: _editorToolbar.ToolbarButtonGroup,
89
+ section: _editorToolbar.ToolbarSection,
90
+ menuSection: _editorToolbar.ToolbarDropdownItemSection
91
+ };
72
92
  return /*#__PURE__*/_react.default.createElement(_toolbar.EditorToolbarProvider, {
73
93
  editorView: editorView !== null && editorView !== void 0 ? editorView : null,
74
94
  editorAppearance: editorAppearance,
@@ -80,22 +100,11 @@ var ToolbarNext = exports.ToolbarNext = function ToolbarNext(_ref) {
80
100
  isDisabled: isDisabled,
81
101
  popupsMountPoint: popupsMountPoint,
82
102
  popupsBoundariesElement: popupsBoundariesElement,
83
- popupsScrollableElement: popupsScrollableElement
84
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
85
- ,
86
- fireAnalyticsEvent: function fireAnalyticsEvent(payload) {
87
- var _editorAPI$analytics;
88
- editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 || _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
89
- }
103
+ popupsScrollableElement: popupsScrollableElement,
104
+ fireAnalyticsEvent: fireAnalyticsEvent
90
105
  }, /*#__PURE__*/_react.default.createElement(_editorToolbarModel.ToolbarModelRenderer, {
91
106
  toolbar: toolbar,
92
- components: components
93
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
94
- ,
95
- fallbacks: {
96
- group: _editorToolbar.ToolbarButtonGroup,
97
- section: _editorToolbar.ToolbarSection,
98
- menuSection: _editorToolbar.ToolbarDropdownItemSection
99
- }
107
+ components: components,
108
+ fallbacks: fallbacks
100
109
  })));
101
110
  };
@@ -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 = "217.9.2";
8
+ var version = exports.version = "0.0.0-development";
@@ -23,6 +23,7 @@ const editorContainerStyles = css({
23
23
  width: '100%',
24
24
  height: '100%'
25
25
  });
26
+ const DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
26
27
 
27
28
  /**
28
29
  * EditorInternalComponent is used to capture the common component
@@ -54,14 +55,13 @@ export const EditorInternal = /*#__PURE__*/memo(({
54
55
  const useShallow = false;
55
56
  const [portalProviderAPI, PortalRenderer] = usePortalProvider();
56
57
  const [nodeViewPortalProviderAPI, NodeViewPortalRenderer] = usePortalProvider();
58
+ const propsToIgnore = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
57
59
  return jsx(Fragment, null, renderTrackingEnabled && jsx(RenderTracking, {
58
60
  componentProps: props,
59
61
  action: ACTION.RE_RENDERED,
60
62
  actionSubject: ACTION_SUBJECT.EDITOR,
61
- handleAnalyticsEvent: handleAnalyticsEvent
62
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
63
- ,
64
- propsToIgnore: ['defaultValue'],
63
+ handleAnalyticsEvent: handleAnalyticsEvent,
64
+ propsToIgnore: propsToIgnore,
65
65
  useShallow: useShallow
66
66
  }), jsx(ErrorBoundary, {
67
67
  errorTracking: true,
@@ -89,7 +89,7 @@ export const EditorInternal = /*#__PURE__*/memo(({
89
89
  onEditorDestroyed: onEditorDestroyed,
90
90
  disabled: props.disabled,
91
91
  preset: preset
92
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
92
+ // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017: this callback closes over the full props object and derived featureFlags; memoization is ineffective because ReactEditorViewNext is not memo()'d and deps (props, featureFlags) change every render
93
93
  ,
94
94
  render: ({
95
95
  editor,
@@ -814,6 +814,33 @@ export function ReactEditorView(props) {
814
814
  assistiveLabel,
815
815
  assistiveDescribedBy
816
816
  } = props.editorProps;
817
+ const handleSsrEditorStateChanged = useCallback(state => {
818
+ ssrEditorStateRef.current = state;
819
+ // Notify listeners about the initial SSR state
820
+ pluginInjectionAPI.current.onEditorViewUpdated({
821
+ newEditorState: state,
822
+ oldEditorState: undefined
823
+ });
824
+ }, [pluginInjectionAPI]);
825
+ const memoizedReactEditorViewContext = useMemo(() => ({
826
+ editorRef,
827
+ // Use a getter so that consumers always read the live viewRef.current at access
828
+ // time, not a stale snapshot captured when this memo was created.
829
+ get editorView() {
830
+ return viewRef.current;
831
+ },
832
+ popupsMountPoint: props.editorProps.popupsMountPoint
833
+ }),
834
+ // viewRef is intentionally omitted from the deps array — it's a stable ref object; the getter reads
835
+ // .current lazily so there's no stale-closure risk.
836
+ // eslint-disable-next-line react-hooks/exhaustive-deps
837
+ [editorRef, props.editorProps.popupsMountPoint]);
838
+ // eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017
839
+ const reactEditorViewContext = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedReactEditorViewContext : {
840
+ editorRef,
841
+ editorView: viewRef.current,
842
+ popupsMountPoint: props.editorProps.popupsMountPoint
843
+ };
817
844
  const ssrEditor = useMemo(() => {
818
845
  if (!ssrDeps) {
819
846
  return null;
@@ -836,7 +863,7 @@ export function ReactEditorView(props) {
836
863
  onSSRMeasure: onSSRMeasure
837
864
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
838
865
  ,
839
- onEditorStateChanged: state => {
866
+ onEditorStateChanged: expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? handleSsrEditorStateChanged : state => {
840
867
  ssrEditorStateRef.current = state;
841
868
  // Notify listeners about the initial SSR state
842
869
  pluginInjectionAPI.current.onEditorViewUpdated({
@@ -845,7 +872,7 @@ export function ReactEditorView(props) {
845
872
  });
846
873
  }
847
874
  });
848
- }, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure]);
875
+ }, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure, handleSsrEditorStateChanged]);
849
876
  const editor = useMemo(() => {
850
877
  // SSR editor will be available only in SSR environment,
851
878
  // in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
@@ -867,12 +894,7 @@ export function ReactEditorView(props) {
867
894
  startTimestampRef: firstRenderStartTimestampRef,
868
895
  onSSRMeasure: onSSRMeasure
869
896
  }, /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
870
- // eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
871
- value: {
872
- editorRef: editorRef,
873
- editorView: viewRef.current,
874
- popupsMountPoint: props.editorProps.popupsMountPoint
875
- }
897
+ value: reactEditorViewContext
876
898
  }, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
877
899
  componentProps: props,
878
900
  action: ACTION.RE_RENDERED,
@@ -9,7 +9,7 @@ import { fixExcludes } from './create-editor';
9
9
  * Adds generic metadata attributes to a DOMOutputSpec array based on the provided node or mark.
10
10
  * This function ensures that the DOMOutputSpec is annotated with ProseMirror-specific metadata.
11
11
  *
12
- * @param {Object} params - Parameters object.
12
+ * @param {object} params - Parameters object.
13
13
  * @param {PMNode | PMMark} params.nodeOrMark - The ProseMirror node or mark to extract metadata from.
14
14
  * @param {DOMOutputSpec} params.domSpec - The DOMOutputSpec to which attributes will be added.
15
15
  * @returns {DOMOutputSpec} The modified DOMOutputSpec with additional metadata.
@@ -8,6 +8,7 @@ import React, { Fragment } from 'react';
8
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
11
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  import EditorContentContainer from '../EditorContentContainer/EditorContentContainer';
12
13
  import PluginSlot from '../PluginSlot';
13
14
  import WithFlash from '../WithFlash';
@@ -70,6 +71,9 @@ export default class Editor extends React.Component {
70
71
  super(...args);
71
72
  _defineProperty(this, "appearance", 'chromeless');
72
73
  _defineProperty(this, "containerElement", null);
74
+ _defineProperty(this, "setContainerElement", ref => {
75
+ this.containerElement = ref;
76
+ });
73
77
  _defineProperty(this, "renderChrome", ({
74
78
  maxContentSize
75
79
  }) => {
@@ -96,14 +100,13 @@ export default class Editor extends React.Component {
96
100
  var _states$editorViewMod;
97
101
  return states === null || states === void 0 ? void 0 : (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode;
98
102
  });
103
+ const containerRef = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? this.setContainerElement : ref => this.containerElement = ref;
99
104
  return jsx(WithFlash, {
100
105
  animate: maxContentSizeReached
101
106
  }, jsx(ChromelessEditorContainer, {
102
107
  maxHeight: maxHeight,
103
- minHeight: minHeight
104
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
105
- ,
106
- containerRef: ref => this.containerElement = ref
108
+ minHeight: minHeight,
109
+ containerRef: containerRef
107
110
  }, jsx(EditorContentContainer
108
111
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
109
112
  , {