@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
@@ -185,6 +185,28 @@ export const CommentEditorWithIntl = props => {
185
185
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
186
186
  }
187
187
  const isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
188
+ const memoizedContentAreaStyles = useMemo(() => [maxHeight ?
189
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
190
+ css({
191
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
192
+ maxHeight: `${maxHeight}px`,
193
+ // When maxHeight is set, content area should have overflow-y explicitly set as auto
194
+ // 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.
195
+ // This will cause the content area to have content overflowing the container
196
+ // so need to set overflow-y as auto to make sure the content area is scrollable
197
+ overflowY: 'auto'
198
+ }) : null], [maxHeight]);
199
+ const contentAreaStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
200
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
201
+ css({
202
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
203
+ maxHeight: `${maxHeight}px`,
204
+ // When maxHeight is set, content area should have overflow-y explicitly set as auto
205
+ // 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.
206
+ // This will cause the content area to have content overflowing the container
207
+ // so need to set overflow-y as auto to make sure the content area is scrollable
208
+ overflowY: 'auto'
209
+ }) : null];
188
210
  const customToolbarSlot = jsx("div", {
189
211
  css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
190
212
  }, customPrimaryToolbarComponents);
@@ -259,20 +281,8 @@ export const CommentEditorWithIntl = props => {
259
281
  width
260
282
  }) => {
261
283
  return jsx(EditorContentContainer, {
262
- ref: containerElement
263
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
264
- ,
265
- css: [maxHeight ?
266
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
267
- css({
268
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
269
- maxHeight: `${maxHeight}px`,
270
- // When maxHeight is set, content area should have overflow-y explicitly set as auto
271
- // 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.
272
- // This will cause the content area to have content overflowing the container
273
- // so need to set overflow-y as auto to make sure the content area is scrollable
274
- overflowY: 'auto'
275
- }) : null],
284
+ ref: containerElement,
285
+ css: contentAreaStyles,
276
286
  isScrollable: maxHeight ? true : undefined
277
287
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
278
288
  ,
@@ -279,9 +279,7 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
279
279
  ,
280
280
  className: classnames('ak-editor-content-area', 'appearance-full-page', {
281
281
  'fabric-editor--full-width-mode': fullWidthMode,
282
- ...(fg('platform_editor_max_width_mode_resize_fix') && {
283
- 'fabric-editor--max-width-mode': Boolean(maxWidthMode)
284
- })
282
+ 'fabric-editor--max-width-mode': Boolean(maxWidthMode)
285
283
  }),
286
284
  ref: contentAreaRef
287
285
  }, !!props.customContentComponents && 'before' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.before) : contentComponentClickWrapper(props.customContentComponents), jsx(PluginSlot, {
@@ -16,6 +16,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
16
16
  import { contextPanelMessages } from '@atlaskit/editor-common/messages';
17
17
  import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
18
18
  import { fg } from '@atlaskit/platform-feature-flags';
19
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
19
20
  const ANIM_SPEED_MS = 500;
20
21
  const panelHidden = css({
21
22
  width: 0
@@ -57,6 +58,9 @@ class SwappableContentAreaInner extends React.PureComponent {
57
58
  mounted: false,
58
59
  currentPluginContent: undefined
59
60
  });
61
+ _defineProperty(this, "handleTransitionExited", () => {
62
+ this.unsetPluginContent();
63
+ });
60
64
  _defineProperty(this, "focusEditor", () => {
61
65
  var _editorAPI$core;
62
66
  const {
@@ -77,14 +81,13 @@ class SwappableContentAreaInner extends React.PureComponent {
77
81
  return;
78
82
  }
79
83
  const animSpeedMs = fg('platform_editor_disable_context_panel_animation') ? 0 : ANIM_SPEED_MS;
84
+ const onExited = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? this.handleTransitionExited : () => this.unsetPluginContent();
80
85
  return jsx(Transition, {
81
86
  timeout: this.state.mounted ? animSpeedMs : 0,
82
87
  in: !!pluginContent,
83
88
  mountOnEnter: true,
84
- unmountOnExit: true
85
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
86
- ,
87
- onExited: () => this.unsetPluginContent()
89
+ unmountOnExit: true,
90
+ onExited: onExited
88
91
  }, currentPluginContent);
89
92
  });
90
93
  _defineProperty(this, "showProvidedContent", isVisible => {
@@ -146,7 +146,7 @@ const EditorContentContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
146
146
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
147
147
  baseStyles,
148
148
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
149
- fg('platform_editor_max_width_mode_resize_fix') && maxModeReizeFixStyles, expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) &&
149
+ maxModeReizeFixStyles, expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) &&
150
150
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
151
151
  baseStylesMaxContainerWidthFixes,
152
152
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
@@ -87,8 +87,8 @@ export const expandStylesBase = css({
87
87
  marginLeft: "var(--ds-space-050, 4px)",
88
88
  display: 'flow-root',
89
89
  /* The follow rules inside @supports block are added as a part of ED-8893
90
- The fix is targeting mobile bridge on iOS 12 or below,
91
- We should consider remove this fix when we no longer support iOS 12 */
90
+ The fix is targeting mobile bridge on iOS 12 or below,
91
+ We should consider remove this fix when we no longer support iOS 12 */
92
92
  '@supports not (display: flow-root)': {
93
93
  width: '100%',
94
94
  boxSizing: 'border-box'
@@ -223,12 +223,19 @@ export const listItemHiddenMarkerStyles = css({
223
223
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
224
224
  marginTop: '0 !important'
225
225
  },
226
- // Collapse wrapper task items (empty task items followed by a sibling nested task list)
227
- // Only hides empty task items that are actual wrappers, not regular empty task items being edited
228
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
229
- '[data-prosemirror-node-name="taskItem"]:has([data-empty="true"]):has(+ [data-node-type="actionList"])': {
226
+ // Remove top margin from nested taskLists not preceded by a sibling taskItem.
227
+ // The base rule (tasksAndDecisionsStyles) sets margin-top on all nested taskLists,
228
+ // but with flexible indentation a taskList can be the first child with no taskItem above.
229
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
230
+ 'div[data-task-list-local-id] > div[data-task-list-local-id]': {
231
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
232
+ marginTop: '0 !important'
233
+ },
234
+ // Restore margin when a nested taskList follows a taskItem
235
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
236
+ 'div[data-task-local-id] + div[data-task-list-local-id]': {
230
237
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
231
- display: 'none !important'
238
+ marginTop: `${"var(--ds-space-050, 4px)"} !important`
232
239
  }
233
240
  }
234
241
  });
@@ -1,11 +1,17 @@
1
- import React from 'react';
1
+ import React, { useCallback } from 'react';
2
2
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { EditorToolbarProvider, EditorToolbarUIProvider } from '@atlaskit/editor-common/toolbar';
4
4
  import { ToolbarSize } from '@atlaskit/editor-common/types';
5
5
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
6
6
  import { ToolbarButtonGroup, ToolbarDropdownItemSection, ToolbarSection } from '@atlaskit/editor-toolbar';
7
7
  import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  import { ToolbarInner } from './ToolbarInner';
10
+ const TOOLBAR_FALLBACKS = {
11
+ group: ToolbarButtonGroup,
12
+ section: ToolbarSection,
13
+ menuSection: ToolbarDropdownItemSection
14
+ };
9
15
 
10
16
  /**
11
17
  * *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
@@ -65,6 +71,16 @@ export const ToolbarNext = ({
65
71
  } = usePluginState(editorAPI);
66
72
  // remove offline check when patch6Enabled is cleaned up
67
73
  const isOffline = isOfflineMode(connectivityStateMode);
74
+ const memoizedFireAnalyticsEvent = useCallback(payload => {
75
+ var _editorAPI$analytics;
76
+ editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
77
+ }, [editorAPI]);
78
+ const fireAnalyticsEvent = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedFireAnalyticsEvent : payload => memoizedFireAnalyticsEvent(payload);
79
+ const fallbacks = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? TOOLBAR_FALLBACKS : {
80
+ group: ToolbarButtonGroup,
81
+ section: ToolbarSection,
82
+ menuSection: ToolbarDropdownItemSection
83
+ };
68
84
  return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
69
85
  editorView: editorView !== null && editorView !== void 0 ? editorView : null,
70
86
  editorAppearance: editorAppearance,
@@ -76,22 +92,11 @@ export const ToolbarNext = ({
76
92
  isDisabled: isDisabled,
77
93
  popupsMountPoint: popupsMountPoint,
78
94
  popupsBoundariesElement: popupsBoundariesElement,
79
- popupsScrollableElement: popupsScrollableElement
80
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
81
- ,
82
- fireAnalyticsEvent: payload => {
83
- var _editorAPI$analytics;
84
- editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 ? void 0 : _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
85
- }
95
+ popupsScrollableElement: popupsScrollableElement,
96
+ fireAnalyticsEvent: fireAnalyticsEvent
86
97
  }, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
87
98
  toolbar: toolbar,
88
- components: components
89
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
90
- ,
91
- fallbacks: {
92
- group: ToolbarButtonGroup,
93
- section: ToolbarSection,
94
- menuSection: ToolbarDropdownItemSection
95
- }
99
+ components: components,
100
+ fallbacks: fallbacks
96
101
  })));
97
102
  };
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "217.9.2";
2
+ export const version = "0.0.0-development";
@@ -27,6 +27,7 @@ var editorContainerStyles = css({
27
27
  width: '100%',
28
28
  height: '100%'
29
29
  });
30
+ var DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
30
31
 
31
32
  /**
32
33
  * EditorInternalComponent is used to capture the common component
@@ -62,14 +63,13 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
62
63
  _usePortalProvider4 = _slicedToArray(_usePortalProvider3, 2),
63
64
  nodeViewPortalProviderAPI = _usePortalProvider4[0],
64
65
  NodeViewPortalRenderer = _usePortalProvider4[1];
66
+ var propsToIgnore = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
65
67
  return jsx(Fragment, null, renderTrackingEnabled && jsx(RenderTracking, {
66
68
  componentProps: props,
67
69
  action: ACTION.RE_RENDERED,
68
70
  actionSubject: ACTION_SUBJECT.EDITOR,
69
- handleAnalyticsEvent: handleAnalyticsEvent
70
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
71
- ,
72
- propsToIgnore: ['defaultValue'],
71
+ handleAnalyticsEvent: handleAnalyticsEvent,
72
+ propsToIgnore: propsToIgnore,
73
73
  useShallow: useShallow
74
74
  }), jsx(ErrorBoundary, {
75
75
  errorTracking: true,
@@ -97,7 +97,7 @@ export var EditorInternal = /*#__PURE__*/memo(function (_ref) {
97
97
  onEditorDestroyed: onEditorDestroyed,
98
98
  disabled: props.disabled,
99
99
  preset: preset
100
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
100
+ // 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
101
101
  ,
102
102
  render: function render(_ref2) {
103
103
  var _props$featureFlags, _props$featureFlags2;
@@ -859,6 +859,35 @@ export function ReactEditorView(props) {
859
859
  var _props$editorProps3 = props.editorProps,
860
860
  assistiveLabel = _props$editorProps3.assistiveLabel,
861
861
  assistiveDescribedBy = _props$editorProps3.assistiveDescribedBy;
862
+ var handleSsrEditorStateChanged = useCallback(function (state) {
863
+ ssrEditorStateRef.current = state;
864
+ // Notify listeners about the initial SSR state
865
+ pluginInjectionAPI.current.onEditorViewUpdated({
866
+ newEditorState: state,
867
+ oldEditorState: undefined
868
+ });
869
+ }, [pluginInjectionAPI]);
870
+ var memoizedReactEditorViewContext = useMemo(function () {
871
+ return {
872
+ editorRef: editorRef,
873
+ // Use a getter so that consumers always read the live viewRef.current at access
874
+ // time, not a stale snapshot captured when this memo was created.
875
+ get editorView() {
876
+ return viewRef.current;
877
+ },
878
+ popupsMountPoint: props.editorProps.popupsMountPoint
879
+ };
880
+ },
881
+ // viewRef is intentionally omitted from the deps array — it's a stable ref object; the getter reads
882
+ // .current lazily so there's no stale-closure risk.
883
+ // eslint-disable-next-line react-hooks/exhaustive-deps
884
+ [editorRef, props.editorProps.popupsMountPoint]);
885
+ // eslint-disable-next-line @atlassian/perf-linting/no-inline-context-value, @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017
886
+ var reactEditorViewContext = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedReactEditorViewContext : {
887
+ editorRef: editorRef,
888
+ editorView: viewRef.current,
889
+ popupsMountPoint: props.editorProps.popupsMountPoint
890
+ };
862
891
  var ssrEditor = useMemo(function () {
863
892
  if (!ssrDeps) {
864
893
  return null;
@@ -881,7 +910,7 @@ export function ReactEditorView(props) {
881
910
  onSSRMeasure: onSSRMeasure
882
911
  // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
883
912
  ,
884
- onEditorStateChanged: function onEditorStateChanged(state) {
913
+ onEditorStateChanged: expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? handleSsrEditorStateChanged : function (state) {
885
914
  ssrEditorStateRef.current = state;
886
915
  // Notify listeners about the initial SSR state
887
916
  pluginInjectionAPI.current.onEditorViewUpdated({
@@ -890,7 +919,7 @@ export function ReactEditorView(props) {
890
919
  });
891
920
  }
892
921
  });
893
- }, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure]);
922
+ }, [ssrDeps, props.intl, props.portalProviderAPI, assistiveLabel, isPageAppearance, assistiveDescribedBy, onSSRMeasure, handleSsrEditorStateChanged]);
894
923
  var editor = useMemo(function () {
895
924
  // SSR editor will be available only in SSR environment,
896
925
  // in a browser `ssrEditor` will be `null`, and we will render a normal one ProseMirror.
@@ -912,12 +941,7 @@ export function ReactEditorView(props) {
912
941
  startTimestampRef: firstRenderStartTimestampRef,
913
942
  onSSRMeasure: onSSRMeasure
914
943
  }, /*#__PURE__*/React.createElement(ReactEditorViewContext.Provider, {
915
- // 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)
916
- value: {
917
- editorRef: editorRef,
918
- editorView: viewRef.current,
919
- popupsMountPoint: props.editorProps.popupsMountPoint
920
- }
944
+ value: reactEditorViewContext
921
945
  }, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
922
946
  componentProps: props,
923
947
  action: ACTION.RE_RENDERED,
@@ -10,7 +10,7 @@ import { fixExcludes } from './create-editor';
10
10
  * Adds generic metadata attributes to a DOMOutputSpec array based on the provided node or mark.
11
11
  * This function ensures that the DOMOutputSpec is annotated with ProseMirror-specific metadata.
12
12
  *
13
- * @param {Object} params - Parameters object.
13
+ * @param {object} params - Parameters object.
14
14
  * @param {PMNode | PMMark} params.nodeOrMark - The ProseMirror node or mark to extract metadata from.
15
15
  * @param {DOMOutputSpec} params.domSpec - The DOMOutputSpec to which attributes will be added.
16
16
  * @returns {DOMOutputSpec} The modified DOMOutputSpec with additional metadata.
@@ -15,6 +15,7 @@ import React, { Fragment } from 'react';
15
15
  // 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
16
16
  import { css, jsx } from '@emotion/react';
17
17
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
18
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
18
19
  import EditorContentContainer from '../EditorContentContainer/EditorContentContainer';
19
20
  import PluginSlot from '../PluginSlot';
20
21
  import WithFlash from '../WithFlash';
@@ -82,6 +83,9 @@ var Editor = /*#__PURE__*/function (_React$Component) {
82
83
  _this = _callSuper(this, Editor, [].concat(args));
83
84
  _defineProperty(_this, "appearance", 'chromeless');
84
85
  _defineProperty(_this, "containerElement", null);
86
+ _defineProperty(_this, "setContainerElement", function (ref) {
87
+ _this.containerElement = ref;
88
+ });
85
89
  _defineProperty(_this, "renderChrome", function (_ref) {
86
90
  var maxContentSize = _ref.maxContentSize;
87
91
  var _this$props = _this.props,
@@ -107,16 +111,15 @@ var Editor = /*#__PURE__*/function (_React$Component) {
107
111
  var _states$editorViewMod;
108
112
  return states === null || states === void 0 || (_states$editorViewMod = states.editorViewModeState) === null || _states$editorViewMod === void 0 ? void 0 : _states$editorViewMod.mode;
109
113
  });
114
+ var containerRef = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.setContainerElement : function (ref) {
115
+ return _this.containerElement = ref;
116
+ };
110
117
  return jsx(WithFlash, {
111
118
  animate: maxContentSizeReached
112
119
  }, jsx(ChromelessEditorContainer, {
113
120
  maxHeight: maxHeight,
114
- minHeight: minHeight
115
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
116
- ,
117
- containerRef: function containerRef(ref) {
118
- return _this.containerElement = ref;
119
- }
121
+ minHeight: minHeight,
122
+ containerRef: containerRef
120
123
  }, jsx(EditorContentContainer
121
124
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
122
125
  , {
@@ -186,6 +186,30 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
186
186
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
187
187
  }
188
188
  var isToolbarAIFCEnabled = Boolean(editorAPI === null || editorAPI === void 0 ? void 0 : editorAPI.toolbar);
189
+ var memoizedContentAreaStyles = useMemo(function () {
190
+ return [maxHeight ?
191
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
192
+ css({
193
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
194
+ maxHeight: "".concat(maxHeight, "px"),
195
+ // When maxHeight is set, content area should have overflow-y explicitly set as auto
196
+ // 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.
197
+ // This will cause the content area to have content overflowing the container
198
+ // so need to set overflow-y as auto to make sure the content area is scrollable
199
+ overflowY: 'auto'
200
+ }) : null];
201
+ }, [maxHeight]);
202
+ var contentAreaStyles = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedContentAreaStyles : [maxHeight ?
203
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
204
+ css({
205
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
206
+ maxHeight: "".concat(maxHeight, "px"),
207
+ // When maxHeight is set, content area should have overflow-y explicitly set as auto
208
+ // 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.
209
+ // This will cause the content area to have content overflowing the container
210
+ // so need to set overflow-y as auto to make sure the content area is scrollable
211
+ overflowY: 'auto'
212
+ }) : null];
189
213
  var customToolbarSlot = jsx("div", {
190
214
  css: [mainToolbarCustomComponentsSlotStyleNew, isTwoLineToolbarEnabled && mainToolbarCustomComponentsSlotStyleTwoLineToolbarNew, isToolbarAIFCEnabled && mainToolbarCustomComponentsSlotStylePaddingOverride]
191
215
  }, customPrimaryToolbarComponents);
@@ -259,20 +283,8 @@ export var CommentEditorWithIntl = function CommentEditorWithIntl(props) {
259
283
  }, jsx(WidthConsumer, null, function (_ref) {
260
284
  var width = _ref.width;
261
285
  return jsx(EditorContentContainer, {
262
- ref: containerElement
263
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
264
- ,
265
- css: [maxHeight ?
266
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
267
- css({
268
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
269
- maxHeight: "".concat(maxHeight, "px"),
270
- // When maxHeight is set, content area should have overflow-y explicitly set as auto
271
- // 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.
272
- // This will cause the content area to have content overflowing the container
273
- // so need to set overflow-y as auto to make sure the content area is scrollable
274
- overflowY: 'auto'
275
- }) : null],
286
+ ref: containerElement,
287
+ css: contentAreaStyles,
276
288
  isScrollable: maxHeight ? true : undefined
277
289
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
278
290
  ,
@@ -1,6 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
2
  /**
5
3
  * @jsxRuntime classic
6
4
  * @jsx jsx
@@ -277,11 +275,10 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
277
275
  }) && editorContentReducedGutterStyles]
278
276
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
279
277
  ,
280
- className: classnames('ak-editor-content-area', 'appearance-full-page', _objectSpread({
281
- 'fabric-editor--full-width-mode': fullWidthMode
282
- }, fg('platform_editor_max_width_mode_resize_fix') && {
278
+ className: classnames('ak-editor-content-area', 'appearance-full-page', {
279
+ 'fabric-editor--full-width-mode': fullWidthMode,
283
280
  'fabric-editor--max-width-mode': Boolean(maxWidthMode)
284
- })),
281
+ }),
285
282
  ref: contentAreaRef
286
283
  }, !!props.customContentComponents && 'before' in props.customContentComponents ? contentComponentClickWrapper(props.customContentComponents.before) : contentComponentClickWrapper(props.customContentComponents), jsx(PluginSlot, {
287
284
  editorView: props.editorView,
@@ -25,6 +25,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
25
25
  import { contextPanelMessages } from '@atlaskit/editor-common/messages';
26
26
  import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
27
27
  import { fg } from '@atlaskit/platform-feature-flags';
28
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
28
29
  var ANIM_SPEED_MS = 500;
29
30
  var panelHidden = css({
30
31
  width: 0
@@ -71,6 +72,9 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
71
72
  mounted: false,
72
73
  currentPluginContent: undefined
73
74
  });
75
+ _defineProperty(_this, "handleTransitionExited", function () {
76
+ _this.unsetPluginContent();
77
+ });
74
78
  _defineProperty(_this, "focusEditor", function () {
75
79
  var _editorAPI$core;
76
80
  var editorAPI = _this.props.editorAPI;
@@ -85,16 +89,15 @@ var SwappableContentAreaInner = /*#__PURE__*/function (_React$PureComponent) {
85
89
  return;
86
90
  }
87
91
  var animSpeedMs = fg('platform_editor_disable_context_panel_animation') ? 0 : ANIM_SPEED_MS;
92
+ var onExited = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? _this.handleTransitionExited : function () {
93
+ return _this.unsetPluginContent();
94
+ };
88
95
  return jsx(Transition, {
89
96
  timeout: _this.state.mounted ? animSpeedMs : 0,
90
97
  in: !!pluginContent,
91
98
  mountOnEnter: true,
92
- unmountOnExit: true
93
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
94
- ,
95
- onExited: function onExited() {
96
- return _this.unsetPluginContent();
97
- }
99
+ unmountOnExit: true,
100
+ onExited: onExited
98
101
  }, currentPluginContent);
99
102
  });
100
103
  _defineProperty(_this, "showProvidedContent", function (isVisible) {
@@ -142,7 +142,7 @@ var EditorContentContainer = /*#__PURE__*/React.forwardRef(function (props, ref)
142
142
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
143
143
  baseStyles,
144
144
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
145
- fg('platform_editor_max_width_mode_resize_fix') && maxModeReizeFixStyles, expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) &&
145
+ maxModeReizeFixStyles, expValEquals('platform_editor_media_vc_fixes', 'isEnabled', true) &&
146
146
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
147
147
  baseStylesMaxContainerWidthFixes,
148
148
  // eslint-disable-next-line @atlaskit/platform/no-preconditioning
@@ -87,8 +87,8 @@ export var expandStylesBase = css({
87
87
  marginLeft: "var(--ds-space-050, 4px)",
88
88
  display: 'flow-root',
89
89
  /* The follow rules inside @supports block are added as a part of ED-8893
90
- The fix is targeting mobile bridge on iOS 12 or below,
91
- We should consider remove this fix when we no longer support iOS 12 */
90
+ The fix is targeting mobile bridge on iOS 12 or below,
91
+ We should consider remove this fix when we no longer support iOS 12 */
92
92
  '@supports not (display: flow-root)': {
93
93
  width: '100%',
94
94
  boxSizing: 'border-box'
@@ -219,12 +219,19 @@ export var listItemHiddenMarkerStyles = css({
219
219
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
220
220
  marginTop: '0 !important'
221
221
  },
222
- // Collapse wrapper task items (empty task items followed by a sibling nested task list)
223
- // Only hides empty task items that are actual wrappers, not regular empty task items being edited
224
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
225
- '[data-prosemirror-node-name="taskItem"]:has([data-empty="true"]):has(+ [data-node-type="actionList"])': {
222
+ // Remove top margin from nested taskLists not preceded by a sibling taskItem.
223
+ // The base rule (tasksAndDecisionsStyles) sets margin-top on all nested taskLists,
224
+ // but with flexible indentation a taskList can be the first child with no taskItem above.
225
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
226
+ 'div[data-task-list-local-id] > div[data-task-list-local-id]': {
227
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
228
+ marginTop: '0 !important'
229
+ },
230
+ // Restore margin when a nested taskList follows a taskItem
231
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
232
+ 'div[data-task-local-id] + div[data-task-list-local-id]': {
226
233
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
227
- display: 'none !important'
234
+ marginTop: "var(--ds-space-050, 4px)".concat(" !important")
228
235
  }
229
236
  }
230
237
  });
@@ -1,11 +1,17 @@
1
- import React from 'react';
1
+ import React, { useCallback } from 'react';
2
2
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
3
3
  import { EditorToolbarProvider, EditorToolbarUIProvider } from '@atlaskit/editor-common/toolbar';
4
4
  import { ToolbarSize } from '@atlaskit/editor-common/types';
5
5
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
6
6
  import { ToolbarButtonGroup, ToolbarDropdownItemSection, ToolbarSection } from '@atlaskit/editor-toolbar';
7
7
  import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
9
  import { ToolbarInner } from './ToolbarInner';
10
+ var TOOLBAR_FALLBACKS = {
11
+ group: ToolbarButtonGroup,
12
+ section: ToolbarSection,
13
+ menuSection: ToolbarDropdownItemSection
14
+ };
9
15
 
10
16
  /**
11
17
  * *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
@@ -63,6 +69,18 @@ export var ToolbarNext = function ToolbarNext(_ref) {
63
69
  editorToolbarDockingPreference = _usePluginState.editorToolbarDockingPreference;
64
70
  // remove offline check when patch6Enabled is cleaned up
65
71
  var isOffline = isOfflineMode(connectivityStateMode);
72
+ var memoizedFireAnalyticsEvent = useCallback(function (payload) {
73
+ var _editorAPI$analytics;
74
+ editorAPI === null || editorAPI === void 0 || (_editorAPI$analytics = editorAPI.analytics) === null || _editorAPI$analytics === void 0 || _editorAPI$analytics.actions.fireAnalyticsEvent(payload);
75
+ }, [editorAPI]);
76
+ var fireAnalyticsEvent = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? memoizedFireAnalyticsEvent : function (payload) {
77
+ return memoizedFireAnalyticsEvent(payload);
78
+ };
79
+ var fallbacks = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? TOOLBAR_FALLBACKS : {
80
+ group: ToolbarButtonGroup,
81
+ section: ToolbarSection,
82
+ menuSection: ToolbarDropdownItemSection
83
+ };
66
84
  return /*#__PURE__*/React.createElement(EditorToolbarProvider, {
67
85
  editorView: editorView !== null && editorView !== void 0 ? editorView : null,
68
86
  editorAppearance: editorAppearance,
@@ -74,22 +92,11 @@ export var ToolbarNext = function ToolbarNext(_ref) {
74
92
  isDisabled: isDisabled,
75
93
  popupsMountPoint: popupsMountPoint,
76
94
  popupsBoundariesElement: popupsBoundariesElement,
77
- popupsScrollableElement: popupsScrollableElement
78
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
79
- ,
80
- fireAnalyticsEvent: function fireAnalyticsEvent(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
- }
95
+ popupsScrollableElement: popupsScrollableElement,
96
+ fireAnalyticsEvent: fireAnalyticsEvent
84
97
  }, /*#__PURE__*/React.createElement(ToolbarModelRenderer, {
85
98
  toolbar: toolbar,
86
- components: components
87
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
88
- ,
89
- fallbacks: {
90
- group: ToolbarButtonGroup,
91
- section: ToolbarSection,
92
- menuSection: ToolbarDropdownItemSection
93
- }
99
+ components: components,
100
+ fallbacks: fallbacks
94
101
  })));
95
102
  };
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "217.9.2";
2
+ export var version = "0.0.0-development";
@@ -8,7 +8,7 @@ type toDOMType = (node: PMNode | PMMark) => DOMOutputSpec;
8
8
  * Adds generic metadata attributes to a DOMOutputSpec array based on the provided node or mark.
9
9
  * This function ensures that the DOMOutputSpec is annotated with ProseMirror-specific metadata.
10
10
  *
11
- * @param {Object} params - Parameters object.
11
+ * @param {object} params - Parameters object.
12
12
  * @param {PMNode | PMMark} params.nodeOrMark - The ProseMirror node or mark to extract metadata from.
13
13
  * @param {DOMOutputSpec} params.domSpec - The DOMOutputSpec to which attributes will be added.
14
14
  * @returns {DOMOutputSpec} The modified DOMOutputSpec with additional metadata.