@atlaskit/editor-core 207.8.0 → 207.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +11 -0
  3. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +4 -65
  4. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +1 -4
  5. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +6 -2
  6. package/dist/cjs/ui/EditorContentContainer/styles/blockMarksStyles.js +30 -0
  7. package/dist/cjs/ui/EditorContentContainer/styles/gridStyles.js +42 -0
  8. package/dist/cjs/ui/EditorContentContainer/styles/indentationStyles.js +45 -0
  9. package/dist/cjs/ui/EditorContentContainer/styles/whitespaceStyles.js +14 -0
  10. package/dist/cjs/version-wrapper.js +1 -1
  11. package/dist/es2019/create-editor/ReactEditorView.js +11 -0
  12. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +5 -66
  13. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +1 -4
  14. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +8 -4
  15. package/dist/es2019/ui/EditorContentContainer/styles/blockMarksStyles.js +23 -0
  16. package/dist/es2019/ui/EditorContentContainer/styles/gridStyles.js +35 -0
  17. package/dist/es2019/ui/EditorContentContainer/styles/indentationStyles.js +38 -0
  18. package/dist/es2019/ui/EditorContentContainer/styles/whitespaceStyles.js +7 -0
  19. package/dist/es2019/version-wrapper.js +1 -1
  20. package/dist/esm/create-editor/ReactEditorView.js +11 -0
  21. package/dist/esm/ui/Appearance/FullPage/FullPage.js +5 -66
  22. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +1 -4
  23. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +7 -3
  24. package/dist/esm/ui/EditorContentContainer/styles/blockMarksStyles.js +23 -0
  25. package/dist/esm/ui/EditorContentContainer/styles/gridStyles.js +35 -0
  26. package/dist/esm/ui/EditorContentContainer/styles/indentationStyles.js +38 -0
  27. package/dist/esm/ui/EditorContentContainer/styles/whitespaceStyles.js +7 -0
  28. package/dist/esm/version-wrapper.js +1 -1
  29. package/dist/types/create-editor/create-universal-preset.d.ts +0 -3
  30. package/dist/types/presets/universal.d.ts +0 -3
  31. package/dist/types/presets/useUniversalPreset.d.ts +0 -3
  32. package/dist/types/ui/EditorContentContainer/styles/blockMarksStyles.d.ts +1 -0
  33. package/dist/types/ui/EditorContentContainer/styles/gridStyles.d.ts +1 -0
  34. package/dist/types/ui/EditorContentContainer/styles/indentationStyles.d.ts +1 -0
  35. package/dist/types/ui/EditorContentContainer/styles/whitespaceStyles.d.ts +1 -0
  36. package/dist/types-ts4.5/create-editor/create-universal-preset.d.ts +0 -3
  37. package/dist/types-ts4.5/presets/universal.d.ts +0 -3
  38. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +0 -3
  39. package/dist/types-ts4.5/ui/EditorContentContainer/styles/blockMarksStyles.d.ts +1 -0
  40. package/dist/types-ts4.5/ui/EditorContentContainer/styles/gridStyles.d.ts +1 -0
  41. package/dist/types-ts4.5/ui/EditorContentContainer/styles/indentationStyles.d.ts +1 -0
  42. package/dist/types-ts4.5/ui/EditorContentContainer/styles/whitespaceStyles.d.ts +1 -0
  43. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 207.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#160567](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160567)
8
+ [`2088abf31e988`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2088abf31e988) -
9
+ [https://product-fabric.atlassian.net/browse/ED-27746](ED-27746) - rewrite editor block marks CSS
10
+ in static emotion
11
+ - [#156919](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/156919)
12
+ [`379f5c27f4939`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/379f5c27f4939) -
13
+ delay table sticky headers until table is in viewport
14
+ - [#160638](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/160638)
15
+ [`73485f1de1b41`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73485f1de1b41) -
16
+ [https://product-fabric.atlassian.net/browse/ED-27746](ED-27746) - rewrite editor grid,
17
+ indentation, whitespace CSS in static emotion
18
+
19
+ ### Patch Changes
20
+
21
+ - [#159655](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159655)
22
+ [`24f8c627d50f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24f8c627d50f2) - ##
23
+ WHAT? Remove experimental graceful edit mode from view mode plugin and associated props.
24
+
25
+ ## WHY?
26
+
27
+ This experiment is being cleaned up and we are no longer proceeding in this direction.
28
+
29
+ ## HOW to adjust?
30
+
31
+ This experiment was only enabled for Confluence and should not have been enabled in other places.
32
+ If for some reason any of the following props/state/methdos were used please remove them:
33
+
34
+ - isConsumption
35
+ - contentMode
36
+ - initialContentMode
37
+ - updateContentMode
38
+
39
+ - Updated dependencies
40
+
3
41
  ## 207.8.0
4
42
 
5
43
  ### Minor Changes
@@ -15,6 +15,7 @@ var _v = _interopRequireDefault(require("uuid/v4"));
15
15
  var _analytics = require("@atlaskit/editor-common/analytics");
16
16
  var _eventDispatcher = require("@atlaskit/editor-common/event-dispatcher");
17
17
  var _hooks = require("@atlaskit/editor-common/hooks");
18
+ var _nodeVisibility = require("@atlaskit/editor-common/node-visibility");
18
19
  var _normalizeFeatureFlags = require("@atlaskit/editor-common/normalize-feature-flags");
19
20
  var _measureRender = require("@atlaskit/editor-common/performance/measure-render");
20
21
  var _navigation = require("@atlaskit/editor-common/performance/navigation");
@@ -26,6 +27,7 @@ var _document = require("@atlaskit/editor-common/utils/document");
26
27
  var _state2 = require("@atlaskit/editor-prosemirror/state");
27
28
  var _view = require("@atlaskit/editor-prosemirror/view");
28
29
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
30
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
29
31
  var _useProviders = require("../composable-editor/hooks/useProviders");
30
32
  var _featureFlagsFromProps = require("../utils/feature-flags-from-props");
31
33
  var _getNodesCount = require("../utils/getNodesCount");
@@ -492,6 +494,12 @@ function ReactEditorView(props) {
492
494
  }, [editorView, shouldFocus, __livePage, mitigateScrollJump]);
493
495
  var handleEditorViewRef = (0, _react.useCallback)(function (node) {
494
496
  if (!viewRef.current && node) {
497
+ // make sure this doesn't expose the experiment
498
+ if ((0, _experiments.editorExperiment)('platform_editor_nodevisibility', true, {
499
+ exposure: false
500
+ })) {
501
+ (0, _nodeVisibility.nodeVisibilityManager)(node).initialiseNodeObserver();
502
+ }
495
503
  var view = createEditorView(node);
496
504
  if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
497
505
  if (mitigateScrollJump) {
@@ -562,6 +570,9 @@ function ReactEditorView(props) {
562
570
  } else {
563
571
  viewRef.current.destroy(); // Destroys the dom node & all node views
564
572
  }
573
+ if ((0, _experiments.editorExperiment)('platform_editor_nodevisibility', true)) {
574
+ (0, _nodeVisibility.nodeVisibilityManager)(viewRef.current.dom).disconnect();
575
+ }
565
576
  viewRef.current = undefined;
566
577
  }
567
578
  }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent, mitigateScrollJump]);
@@ -71,7 +71,6 @@ var useFullPageEditorPluginsStates = (0, _hooks.sharedPluginStateHookMigratorFac
71
71
  }, function (pluginInjectionApi) {
72
72
  var primaryToolbarComponents = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'primaryToolbar.components');
73
73
  var editorViewMode = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode.mode');
74
- var showTopToolbar = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'editorViewMode._showTopToolbar');
75
74
  var hasHadInteraction = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'interaction.hasHadInteraction');
76
75
  var interactionState = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(pluginInjectionApi, 'interaction.interactionState');
77
76
  return {
@@ -79,8 +78,7 @@ var useFullPageEditorPluginsStates = (0, _hooks.sharedPluginStateHookMigratorFac
79
78
  components: primaryToolbarComponents
80
79
  },
81
80
  editorViewModeState: !editorViewMode ? undefined : {
82
- mode: editorViewMode,
83
- _showTopToolbar: showTopToolbar
81
+ mode: editorViewMode
84
82
  },
85
83
  interactionState: hasHadInteraction === undefined || interactionState === undefined ? undefined : {
86
84
  hasHadInteraction: hasHadInteraction,
@@ -89,7 +87,7 @@ var useFullPageEditorPluginsStates = (0, _hooks.sharedPluginStateHookMigratorFac
89
87
  };
90
88
  });
91
89
  var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
92
- var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _scrollContentContain4, _scrollContentContain5, _wrapperElementRef$cu;
90
+ var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _wrapperElementRef$cu;
93
91
  var wrapperElementRef = (0, _react.useMemo)(function () {
94
92
  return props.innerRef;
95
93
  }, [props.innerRef]);
@@ -128,23 +126,6 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
128
126
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
129
127
  }
130
128
  var isEditorToolbarHidden = (0, _platformFeatureFlags.fg)('platform_editor_sync_editor_view_mode_state') ? viewMode === 'view' : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
131
- if (props.__livePage && !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
132
- // the custom toolbar logic should only be applied when the experiment cohort is not control,
133
- // and the editor is in live page mode.
134
- if (!editorViewModeState) {
135
- // when first loading the editor, the toolbar should be hidden for all content modes
136
- // the editorViewMode plugin state is not able to be relied as it will not be setup when
137
- // the appearance component is being rendered.
138
- // In this case we set the toolbar to be hidden by default.
139
- isEditorToolbarHidden = true;
140
- } else {
141
- if ((0, _experiments.editorExperiment)('live_pages_graceful_edit', 'initially-hide-toolbar')) {
142
- // for the initially-hide-toolbar variant, the toolbar should be hidden based on
143
- // a separate flag in the editorViewMode plugin state.
144
- isEditorToolbarHidden = !editorViewModeState._showTopToolbar || false;
145
- }
146
- }
147
- }
148
129
  var customPrimaryToolbarComponents = props.customPrimaryToolbarComponents;
149
130
  if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
150
131
  exposure: true
@@ -174,10 +155,7 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
174
155
  ,
175
156
  className: "akEditor",
176
157
  ref: wrapperElementRef
177
- }, !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') && (0, _react2.jsx)("div", {
178
- css: hiddenStyle,
179
- "data-hidden": isEditorToolbarHidden
180
- }, (0, _react2.jsx)(_FullPageToolbar.FullPageToolbar, {
158
+ }, !isEditorToolbarHidden && (0, _react2.jsx)(_FullPageToolbar.FullPageToolbar, {
181
159
  appearance: props.appearance,
182
160
  editorAPI: editorAPI,
183
161
  beforeIcon: props.primaryToolbarIconBefore,
@@ -204,33 +182,6 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
204
182
  providerFactory: props.providerFactory,
205
183
  showKeyline: showKeyline,
206
184
  featureFlags: props.featureFlags
207
- })), (0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') && !isEditorToolbarHidden && (0, _react2.jsx)(_FullPageToolbar.FullPageToolbar, {
208
- appearance: props.appearance,
209
- editorAPI: editorAPI,
210
- beforeIcon: props.primaryToolbarIconBefore,
211
- collabEdit: props.collabEdit,
212
- containerElement: (_scrollContentContain4 = (_scrollContentContain5 = scrollContentContainerRef.current) === null || _scrollContentContain5 === void 0 ? void 0 : _scrollContentContain5.scrollContainer) !== null && _scrollContentContain4 !== void 0 ? _scrollContentContain4 : null,
213
- customPrimaryToolbarComponents: props.customPrimaryToolbarComponents,
214
- disabled: !!props.disabled,
215
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
216
- editorActions: props.editorActions,
217
- editorDOMElement: props.editorDOMElement
218
- // Ignored via go/ees005
219
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
220
- ,
221
- editorView: props.editorView
222
- // Ignored via go/ees005
223
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
224
- ,
225
- eventDispatcher: props.eventDispatcher,
226
- hasMinWidth: props.enableToolbarMinWidth,
227
- popupsBoundariesElement: props.popupsBoundariesElement,
228
- popupsMountPoint: props.popupsMountPoint,
229
- popupsScrollableElement: props.popupsScrollableElement,
230
- primaryToolbarComponents: primaryToolbarComponents,
231
- providerFactory: props.providerFactory,
232
- showKeyline: showKeyline,
233
- featureFlags: props.featureFlags
234
185
  }), (0, _react2.jsx)(_FullPageContentArea.FullPageContentArea, {
235
186
  editorAPI: editorAPI,
236
187
  ref: scrollContentContainerRef,
@@ -258,16 +209,4 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
258
209
  viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
259
210
  hasHadInteraction: hasHadInteraction
260
211
  })));
261
- };
262
- var hiddenStyle = (0, _react2.css)({
263
- visibility: 'visible',
264
- opacity: 1,
265
- transition: '200ms opacity, 200ms visibility, 200ms transform',
266
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
267
- '&[data-hidden="true"]': {
268
- height: 0,
269
- visibility: 'hidden',
270
- opacity: 0
271
- // transition: '0ms opacity, 0ms visibility, 0ms transform',
272
- }
273
- });
212
+ };
@@ -102,14 +102,11 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
102
102
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
103
103
  _StyledComponents.contentArea,
104
104
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
105
- (0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden &&
105
+ props.isEditorToolbarHidden &&
106
106
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
107
107
  _StyledComponents.contentAreaHeightNoToolbar],
108
108
  "data-testid": CONTENT_AREA_TEST_ID,
109
109
  ref: containerRef
110
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
111
- ,
112
- className: !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden ? 'ak-editor-content-area-no-toolbar' : undefined
113
110
  }, (0, _react2.jsx)("div", {
114
111
  css:
115
112
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
@@ -33,10 +33,13 @@ var _tasksAndDecisions = require("../ContentStyles/tasks-and-decisions");
33
33
  var _aiPanel = require("./styles/ai-panel");
34
34
  var _annotationStyles = require("./styles/annotationStyles");
35
35
  var _backgroundColorStyles = require("./styles/backgroundColorStyles");
36
+ var _blockMarksStyles = require("./styles/blockMarksStyles");
36
37
  var _codeBlockStyles = require("./styles/codeBlockStyles");
37
38
  var _codeMarkStyles = require("./styles/codeMarkStyles");
38
39
  var _embedCardStyles = require("./styles/embedCardStyles");
39
40
  var _firstBlockNodeStyles = require("./styles/firstBlockNodeStyles");
41
+ var _gridStyles = require("./styles/gridStyles");
42
+ var _indentationStyles = require("./styles/indentationStyles");
40
43
  var _layout = require("./styles/layout");
41
44
  var _link = require("./styles/link");
42
45
  var _mediaStyles = require("./styles/mediaStyles");
@@ -44,6 +47,7 @@ var _paragraphStyles = require("./styles/paragraphStyles");
44
47
  var _resizerStyles = require("./styles/resizerStyles");
45
48
  var _rule = require("./styles/rule");
46
49
  var _tasksAndDecisionsStyles = require("./styles/tasksAndDecisionsStyles");
50
+ var _whitespaceStyles = require("./styles/whitespaceStyles");
47
51
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
48
52
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
49
53
  /* eslint-disable react-hooks/rules-of-hooks */
@@ -142,13 +146,13 @@ var akEditorBreakpointForSmallDevice = "1266px";
142
146
 
143
147
  // jest warning: JSDOM version (22) doesn't support the new @container CSS rule
144
148
  var contentStyles = function contentStyles() {
145
- return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: var(--ak-editor-base-font-size);\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\t}\n\n\t", "\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n ", ";\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n\t is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), _editorSharedStyles.akEditorGutterPadding, (0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), _editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth, _editorSharedStyles.akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, _editorSharedStyles.akEditorCalculatedWideLayoutWidth, _styles.whitespaceSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('editor_request_to_edit_task') ? null : (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, _codeBlockStyles.codeBlockStyles, (0, _styles2.blocktypeStyles)(), _codeMarkStyles.codeMarkStyles, _styles.textColorStyles, _backgroundColorStyles.backgroundColorStyles, listsStyles, _rule.ruleStyles, _mediaStyles.mediaStyles, (0, _platformFeatureFlags.fg)('confluence_team_presence_scroll_to_pointer') ? _collab.telepointerStyle : _collab.telepointerStyleWithInitialOnly, _selection.gapCursorStyles, (0, _panel.panelStyles)(), mentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
149
+ return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: var(--ak-editor-base-font-size);\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\n\t\t", ";\n\t}\n\n\t", "\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\n\t", "\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n ", ";\n\n\t", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n\t", "\n\n ", "\n\n ", "\n\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n\t is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), _editorSharedStyles.akEditorGutterPadding, (0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), _editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth, _editorSharedStyles.akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, _editorSharedStyles.akEditorCalculatedWideLayoutWidth, _whitespaceStyles.whitespaceStyles, _styles.listsSharedStyles, _indentationStyles.indentationStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('editor_request_to_edit_task') ? null : (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, _codeBlockStyles.codeBlockStyles, (0, _styles2.blocktypeStyles)(), _codeMarkStyles.codeMarkStyles, _styles.textColorStyles, _backgroundColorStyles.backgroundColorStyles, listsStyles, _rule.ruleStyles, _mediaStyles.mediaStyles, (0, _platformFeatureFlags.fg)('confluence_team_presence_scroll_to_pointer') ? _collab.telepointerStyle : _collab.telepointerStyleWithInitialOnly, _selection.gapCursorStyles, (0, _panel.panelStyles)(), mentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
146
150
  exposure: false
147
151
  }) && vanillaMentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
148
152
  exposure: false
149
153
  }) && vanillaSelectionStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
150
154
  exposure: false
151
- }) ? emojiStyles : reactEmojiStyles, emojiStyles, _tasksAndDecisionsStyles.tasksAndDecisionsStyles, _styles.gridStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
155
+ }) ? emojiStyles : reactEmojiStyles, emojiStyles, _tasksAndDecisionsStyles.tasksAndDecisionsStyles, _gridStyles.gridStyles, _blockMarksStyles.blockMarksStyles, _styles.dateSharedStyle, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
152
156
  exposure: false
153
157
  }) && _tasksAndDecisions.vanillaTaskItemStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
154
158
  exposure: false
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.blockMarksStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
9
+
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
11
+ var blockMarksStyles = exports.blockMarksStyles = (0, _react.css)({
12
+ // We need to remove margin-top from first item
13
+ // inside doc, tableCell, tableHeader, blockquote, etc.
14
+ //
15
+ // - For nested block marks apart from those with indentation mark.
16
+ // - Do not remove the margin top for nodes inside indentation marks.
17
+ // - Do not remove the margin top for nodes inside alignment marks.
18
+ //- If first element inside a block node has alignment mark, then remove the margin-top.
19
+ //- If first document element has indentation mark remove margin-top.
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
21
+ '*:not(.fabric-editor-block-mark) >, *:not(.fabric-editor-block-mark) > div.fabric-editor-block-mark:first-of-type:not(.fabric-editor-indentation-mark):not(.fabric-editor-alignment), .fabric-editor-alignment:first-of-type:first-child, .ProseMirror .fabric-editor-indentation-mark:first-of-type:first-child': {
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
23
+ 'p, h1, h2, h3, h4, h5, h6, .heading-wrapper': {
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors,@atlaskit/ui-styling-standard/no-unsafe-selectors
25
+ '&:first-child:not(style), style:first-child + *': {
26
+ marginTop: 0
27
+ }
28
+ }
29
+ }
30
+ });
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gridStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
9
+
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
11
+ var gridStyles = exports.gridStyles = (0, _react.css)({
12
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
13
+ '.gridParent': {
14
+ width: "calc(100% + 24px)",
15
+ marginLeft: "var(--ds-space-negative-150, -12px)",
16
+ marginRight: "var(--ds-space-negative-150, -12px)",
17
+ transform: 'scale(1)',
18
+ zIndex: 2
19
+ },
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
+ '.gridContainer': {
22
+ position: 'fixed',
23
+ height: '100vh',
24
+ width: '100%',
25
+ pointerEvents: 'none'
26
+ },
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
28
+ '.gridLine': {
29
+ borderLeft: "1px solid ".concat("var(--ds-border, #091E4224)"),
30
+ display: 'inline-block',
31
+ boxSizing: 'border-box',
32
+ height: '100%',
33
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
34
+ marginLeft: '-1px',
35
+ transition: 'border-color 0.15s linear',
36
+ zIndex: 0
37
+ },
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
39
+ '.highlight': {
40
+ borderLeft: "1px solid ".concat("var(--ds-border-focused, #388BFF)")
41
+ }
42
+ });
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.indentationStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
9
+
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
11
+ var indentationStyles = exports.indentationStyles = (0, _react.css)({
12
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
13
+ '.fabric-editor-indentation-mark': {
14
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
15
+ "&[data-level='1']": {
16
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
17
+ marginLeft: 30
18
+ },
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
20
+ "&[data-level='2']": {
21
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
22
+ marginLeft: 60
23
+ },
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
25
+ "&[data-level='3']": {
26
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
27
+ marginLeft: 90
28
+ },
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
30
+ "&[data-level='4']": {
31
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
32
+ marginLeft: 120
33
+ },
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
35
+ "&[data-level='5']": {
36
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
37
+ marginLeft: 150
38
+ },
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
40
+ "&[data-level='6']": {
41
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
42
+ marginLeft: 180
43
+ }
44
+ }
45
+ });
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.whitespaceStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ // eslint-disable-line @atlaskit/ui-styling-standard/use-compiled
9
+
10
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
11
+ var whitespaceStyles = exports.whitespaceStyles = (0, _react.css)({
12
+ wordWrap: 'break-word',
13
+ whiteSpace: 'pre-wrap'
14
+ });
@@ -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 = "207.8.0";
8
+ var version = exports.version = "207.9.0";
@@ -4,6 +4,7 @@ import uuid from 'uuid/v4';
4
4
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent, PLATFORMS } from '@atlaskit/editor-common/analytics';
5
5
  import { createDispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
6
6
  import { useConstructor, usePreviousState } from '@atlaskit/editor-common/hooks';
7
+ import { nodeVisibilityManager } from '@atlaskit/editor-common/node-visibility';
7
8
  import { getEnabledFeatureFlagKeys } from '@atlaskit/editor-common/normalize-feature-flags';
8
9
  import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
9
10
  import { getResponseEndTime } from '@atlaskit/editor-common/performance/navigation';
@@ -15,6 +16,7 @@ import { isEmptyDocument } from '@atlaskit/editor-common/utils/document';
15
16
  import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
16
17
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
17
18
  import { fg } from '@atlaskit/platform-feature-flags';
19
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
20
  import { useProviders } from '../composable-editor/hooks/useProviders';
19
21
  import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
20
22
  import { getNodesCount } from '../utils/getNodesCount';
@@ -462,6 +464,12 @@ export function ReactEditorView(props) {
462
464
  }, [editorView, shouldFocus, __livePage, mitigateScrollJump]);
463
465
  const handleEditorViewRef = useCallback(node => {
464
466
  if (!viewRef.current && node) {
467
+ // make sure this doesn't expose the experiment
468
+ if (editorExperiment('platform_editor_nodevisibility', true, {
469
+ exposure: false
470
+ })) {
471
+ nodeVisibilityManager(node).initialiseNodeObserver();
472
+ }
465
473
  const view = createEditorView(node);
466
474
  if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
467
475
  if (mitigateScrollJump) {
@@ -530,6 +538,9 @@ export function ReactEditorView(props) {
530
538
  } else {
531
539
  viewRef.current.destroy(); // Destroys the dom node & all node views
532
540
  }
541
+ if (editorExperiment('platform_editor_nodevisibility', true)) {
542
+ nodeVisibilityManager(viewRef.current.dom).disconnect();
543
+ }
533
544
  viewRef.current = undefined;
534
545
  }
535
546
  }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent, mitigateScrollJump]);
@@ -5,7 +5,7 @@
5
5
  import React, { useEffect, useMemo, useRef, useState } from 'react';
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
8
+ import { jsx } from '@emotion/react';
9
9
  import { browser } from '@atlaskit/editor-common/browser';
10
10
  import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
11
11
  import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
@@ -54,7 +54,6 @@ const useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(plug
54
54
  }, pluginInjectionApi => {
55
55
  const primaryToolbarComponents = useSharedPluginStateSelector(pluginInjectionApi, 'primaryToolbar.components');
56
56
  const editorViewMode = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode.mode');
57
- const showTopToolbar = useSharedPluginStateSelector(pluginInjectionApi, 'editorViewMode._showTopToolbar');
58
57
  const hasHadInteraction = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.hasHadInteraction');
59
58
  const interactionState = useSharedPluginStateSelector(pluginInjectionApi, 'interaction.interactionState');
60
59
  return {
@@ -62,8 +61,7 @@ const useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(plug
62
61
  components: primaryToolbarComponents
63
62
  },
64
63
  editorViewModeState: !editorViewMode ? undefined : {
65
- mode: editorViewMode,
66
- _showTopToolbar: showTopToolbar
64
+ mode: editorViewMode
67
65
  },
68
66
  interactionState: hasHadInteraction === undefined || interactionState === undefined ? undefined : {
69
67
  hasHadInteraction,
@@ -72,7 +70,7 @@ const useFullPageEditorPluginsStates = sharedPluginStateHookMigratorFactory(plug
72
70
  };
73
71
  });
74
72
  export const FullPageEditor = props => {
75
- var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _scrollContentContain4, _scrollContentContain5, _wrapperElementRef$cu;
73
+ var _scrollContentContain, _scrollContentContain2, _scrollContentContain3, _wrapperElementRef$cu;
76
74
  const wrapperElementRef = useMemo(() => props.innerRef, [props.innerRef]);
77
75
  const scrollContentContainerRef = useRef(null);
78
76
  const showKeyline = useShowKeyline(scrollContentContainerRef);
@@ -110,23 +108,6 @@ export const FullPageEditor = props => {
110
108
  primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
111
109
  }
112
110
  let isEditorToolbarHidden = fg('platform_editor_sync_editor_view_mode_state') ? viewMode === 'view' : (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
113
- if (props.__livePage && !editorExperiment('live_pages_graceful_edit', 'control')) {
114
- // the custom toolbar logic should only be applied when the experiment cohort is not control,
115
- // and the editor is in live page mode.
116
- if (!editorViewModeState) {
117
- // when first loading the editor, the toolbar should be hidden for all content modes
118
- // the editorViewMode plugin state is not able to be relied as it will not be setup when
119
- // the appearance component is being rendered.
120
- // In this case we set the toolbar to be hidden by default.
121
- isEditorToolbarHidden = true;
122
- } else {
123
- if (editorExperiment('live_pages_graceful_edit', 'initially-hide-toolbar')) {
124
- // for the initially-hide-toolbar variant, the toolbar should be hidden based on
125
- // a separate flag in the editorViewMode plugin state.
126
- isEditorToolbarHidden = !editorViewModeState._showTopToolbar || false;
127
- }
128
- }
129
- }
130
111
  const {
131
112
  customPrimaryToolbarComponents
132
113
  } = props;
@@ -158,10 +139,7 @@ export const FullPageEditor = props => {
158
139
  ,
159
140
  className: "akEditor",
160
141
  ref: wrapperElementRef
161
- }, !editorExperiment('live_pages_graceful_edit', 'control') && jsx("div", {
162
- css: hiddenStyle,
163
- "data-hidden": isEditorToolbarHidden
164
- }, jsx(FullPageToolbar, {
142
+ }, !isEditorToolbarHidden && jsx(FullPageToolbar, {
165
143
  appearance: props.appearance,
166
144
  editorAPI: editorAPI,
167
145
  beforeIcon: props.primaryToolbarIconBefore,
@@ -188,33 +166,6 @@ export const FullPageEditor = props => {
188
166
  providerFactory: props.providerFactory,
189
167
  showKeyline: showKeyline,
190
168
  featureFlags: props.featureFlags
191
- })), editorExperiment('live_pages_graceful_edit', 'control') && !isEditorToolbarHidden && jsx(FullPageToolbar, {
192
- appearance: props.appearance,
193
- editorAPI: editorAPI,
194
- beforeIcon: props.primaryToolbarIconBefore,
195
- collabEdit: props.collabEdit,
196
- containerElement: (_scrollContentContain4 = (_scrollContentContain5 = scrollContentContainerRef.current) === null || _scrollContentContain5 === void 0 ? void 0 : _scrollContentContain5.scrollContainer) !== null && _scrollContentContain4 !== void 0 ? _scrollContentContain4 : null,
197
- customPrimaryToolbarComponents: props.customPrimaryToolbarComponents,
198
- disabled: !!props.disabled,
199
- dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
200
- editorActions: props.editorActions,
201
- editorDOMElement: props.editorDOMElement
202
- // Ignored via go/ees005
203
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
204
- ,
205
- editorView: props.editorView
206
- // Ignored via go/ees005
207
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
208
- ,
209
- eventDispatcher: props.eventDispatcher,
210
- hasMinWidth: props.enableToolbarMinWidth,
211
- popupsBoundariesElement: props.popupsBoundariesElement,
212
- popupsMountPoint: props.popupsMountPoint,
213
- popupsScrollableElement: props.popupsScrollableElement,
214
- primaryToolbarComponents: primaryToolbarComponents,
215
- providerFactory: props.providerFactory,
216
- showKeyline: showKeyline,
217
- featureFlags: props.featureFlags
218
169
  }), jsx(FullPageContentArea, {
219
170
  editorAPI: editorAPI,
220
171
  ref: scrollContentContainerRef,
@@ -242,16 +193,4 @@ export const FullPageEditor = props => {
242
193
  viewMode: editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode,
243
194
  hasHadInteraction: hasHadInteraction
244
195
  })));
245
- };
246
- const hiddenStyle = css({
247
- visibility: 'visible',
248
- opacity: 1,
249
- transition: '200ms opacity, 200ms visibility, 200ms transform',
250
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
251
- '&[data-hidden="true"]': {
252
- height: 0,
253
- visibility: 'hidden',
254
- opacity: 0
255
- // transition: '0ms opacity, 0ms visibility, 0ms transform',
256
- }
257
- });
196
+ };
@@ -86,14 +86,11 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
86
86
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
87
87
  contentArea,
88
88
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
89
- editorExperiment('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden &&
89
+ props.isEditorToolbarHidden &&
90
90
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
91
91
  contentAreaHeightNoToolbar],
92
92
  "data-testid": CONTENT_AREA_TEST_ID,
93
93
  ref: containerRef
94
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
95
- ,
96
- className: !editorExperiment('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden ? 'ak-editor-content-area-no-toolbar' : undefined
97
94
  }, jsx("div", {
98
95
  css:
99
96
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values