@atlaskit/editor-core 219.9.1 → 219.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 219.9.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b4b10071d5c4a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b4b10071d5c4a) -
8
+ Delay browser-persisted markdown view-mode evaluation until after hydration when
9
+ `platform_editor_delay_markdown_view_mode_eval` is enabled.
10
+
11
+ Scope the markdown-mode ProseMirror hide style under an explicit data attribute when the same gate
12
+ is enabled.
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 219.9.1
4
17
 
5
18
  ### Patch Changes
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -67,6 +67,12 @@ var hideEditorContentAreaProsemirrorStyle = (0, _react2.css)({
67
67
  display: 'none'
68
68
  }
69
69
  });
70
+ var hideEditorContentAreaProsemirrorWithAttributeStyle = (0, _react2.css)({
71
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
72
+ '&[data-markdown-mode-hide-prosemirror="true"] .ProseMirror': {
73
+ display: 'none'
74
+ }
75
+ });
70
76
  var fullWidthNonChromelessBreakoutBlockTableStyle = (0, _react2.css)({
71
77
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-1
72
78
  '.fabric-editor--full-width-mode:not(:has(#chromeless-editor))': {
@@ -253,6 +259,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
253
259
  var _states$markdownModeS2;
254
260
  return (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.isMarkdownMode;
255
261
  });
262
+ var shouldHideProseMirrorForMarkdownMode = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc-markdown-mode', 'isEnabled', true) && markdownPluginCurrentView !== 'wysiwyg' && markdownPluginCurrentIsMarkdownMode;
256
263
  return (0, _react2.jsx)("div", {
257
264
  css: [contentAreaNew, props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
258
265
  "data-testid": CONTENT_AREA_TEST_ID,
@@ -278,10 +285,11 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
278
285
  editorView: props.editorView,
279
286
  editorDisabled: props.disabled
280
287
  }, (0, _react2.jsx)("div", {
288
+ "data-markdown-mode-hide-prosemirror": shouldHideProseMirrorForMarkdownMode && (0, _platformFeatureFlags.fg)('platform_editor_delay_markdown_view_mode_eval') ? 'true' : undefined,
281
289
  css: [editorContentAreaNew, editorContentAreaProsemirrorStyle,
282
290
  // EDITOR-6558: hide ProseMirror when the markdown-mode plugin
283
291
  // reports a non-WYSIWYG view.
284
- (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc-markdown-mode', 'isEnabled', true) && markdownPluginCurrentView !== 'wysiwyg' && markdownPluginCurrentIsMarkdownMode && hideEditorContentAreaProsemirrorStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
292
+ shouldHideProseMirrorForMarkdownMode && ((0, _platformFeatureFlags.fg)('platform_editor_delay_markdown_view_mode_eval') ? hideEditorContentAreaProsemirrorWithAttributeStyle : hideEditorContentAreaProsemirrorStyle), tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
285
293
  // for breakout resizing, there's no need to restrict the width of codeblocks as they're always wrapped in a breakout mark
286
294
  (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_breakout_resizing', 'isEnabled', true) ? editorContentAreaContainerStyleExcludeCodeBlockNew : editorContentAreaContainerStyleNew, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') && editorContentAreaContainerNestedDndStyle, !(0, _platformFeatureFlags.fg)('platform_editor_controls_no_toolbar_space') && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && contentAreaReducedHeaderSpace, !(0, _platformFeatureFlags.fg)('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && contentAreaReservedPrimaryToolbarSpace],
287
295
  style: {
@@ -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 = "219.9.0";
8
+ var version = exports.version = "0.0.0-development";
@@ -0,0 +1 @@
1
+ export {};
@@ -12,7 +12,7 @@ import { injectIntl } from 'react-intl';
12
12
  import { decisionListSelector, taskListSelector } from '@atlaskit/adf-schema';
13
13
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
14
14
  import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
15
- import { akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
15
+ import { akEditorFullPageNarrowBreakout, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced } from '@atlaskit/editor-shared-styles';
16
16
  import FeatureGates from '@atlaskit/feature-gate-js-client';
17
17
  import { fg } from '@atlaskit/platform-feature-flags';
18
18
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -58,6 +58,12 @@ const hideEditorContentAreaProsemirrorStyle = css({
58
58
  display: 'none'
59
59
  }
60
60
  });
61
+ const hideEditorContentAreaProsemirrorWithAttributeStyle = css({
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
63
+ '&[data-markdown-mode-hide-prosemirror="true"] .ProseMirror': {
64
+ display: 'none'
65
+ }
66
+ });
61
67
  const fullWidthNonChromelessBreakoutBlockTableStyle = css({
62
68
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-1
63
69
  '.fabric-editor--full-width-mode:not(:has(#chromeless-editor))': {
@@ -245,6 +251,7 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
245
251
  var _states$markdownModeS2;
246
252
  return (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.isMarkdownMode;
247
253
  });
254
+ const shouldHideProseMirrorForMarkdownMode = expValEqualsNoExposure('cc-markdown-mode', 'isEnabled', true) && markdownPluginCurrentView !== 'wysiwyg' && markdownPluginCurrentIsMarkdownMode;
248
255
  return jsx("div", {
249
256
  css: [contentAreaNew, props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
250
257
  "data-testid": CONTENT_AREA_TEST_ID,
@@ -270,10 +277,11 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
270
277
  editorView: props.editorView,
271
278
  editorDisabled: props.disabled
272
279
  }, jsx("div", {
280
+ "data-markdown-mode-hide-prosemirror": shouldHideProseMirrorForMarkdownMode && fg('platform_editor_delay_markdown_view_mode_eval') ? 'true' : undefined,
273
281
  css: [editorContentAreaNew, editorContentAreaProsemirrorStyle,
274
282
  // EDITOR-6558: hide ProseMirror when the markdown-mode plugin
275
283
  // reports a non-WYSIWYG view.
276
- expValEqualsNoExposure('cc-markdown-mode', 'isEnabled', true) && markdownPluginCurrentView !== 'wysiwyg' && markdownPluginCurrentIsMarkdownMode && hideEditorContentAreaProsemirrorStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
284
+ shouldHideProseMirrorForMarkdownMode && (fg('platform_editor_delay_markdown_view_mode_eval') ? hideEditorContentAreaProsemirrorWithAttributeStyle : hideEditorContentAreaProsemirrorStyle), tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
277
285
  // for breakout resizing, there's no need to restrict the width of codeblocks as they're always wrapped in a breakout mark
278
286
  expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true) ? editorContentAreaContainerStyleExcludeCodeBlockNew : editorContentAreaContainerStyleNew, fg('platform_editor_nested_dnd_styles_changes') && editorContentAreaContainerNestedDndStyle, !fg('platform_editor_controls_no_toolbar_space') && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReducedHeaderSpace, !fg('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReservedPrimaryToolbarSpace],
279
287
  style: {
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "219.9.0";
2
+ export const version = "0.0.0-development";
@@ -0,0 +1 @@
1
+ export {};
@@ -13,7 +13,7 @@ import { injectIntl } from 'react-intl';
13
13
  import { decisionListSelector, taskListSelector } from '@atlaskit/adf-schema';
14
14
  import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
15
15
  import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
16
- import { akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced, akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
16
+ import { akEditorFullPageNarrowBreakout, akEditorGutterPaddingDynamic, akEditorGutterPaddingReduced } from '@atlaskit/editor-shared-styles';
17
17
  import FeatureGates from '@atlaskit/feature-gate-js-client';
18
18
  import { fg } from '@atlaskit/platform-feature-flags';
19
19
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
@@ -57,6 +57,12 @@ var hideEditorContentAreaProsemirrorStyle = css({
57
57
  display: 'none'
58
58
  }
59
59
  });
60
+ var hideEditorContentAreaProsemirrorWithAttributeStyle = css({
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
62
+ '&[data-markdown-mode-hide-prosemirror="true"] .ProseMirror': {
63
+ display: 'none'
64
+ }
65
+ });
60
66
  var fullWidthNonChromelessBreakoutBlockTableStyle = css({
61
67
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-1
62
68
  '.fabric-editor--full-width-mode:not(:has(#chromeless-editor))': {
@@ -243,6 +249,7 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
243
249
  var _states$markdownModeS2;
244
250
  return (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.isMarkdownMode;
245
251
  });
252
+ var shouldHideProseMirrorForMarkdownMode = expValEqualsNoExposure('cc-markdown-mode', 'isEnabled', true) && markdownPluginCurrentView !== 'wysiwyg' && markdownPluginCurrentIsMarkdownMode;
246
253
  return jsx("div", {
247
254
  css: [contentAreaNew, props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
248
255
  "data-testid": CONTENT_AREA_TEST_ID,
@@ -268,10 +275,11 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
268
275
  editorView: props.editorView,
269
276
  editorDisabled: props.disabled
270
277
  }, jsx("div", {
278
+ "data-markdown-mode-hide-prosemirror": shouldHideProseMirrorForMarkdownMode && fg('platform_editor_delay_markdown_view_mode_eval') ? 'true' : undefined,
271
279
  css: [editorContentAreaNew, editorContentAreaProsemirrorStyle,
272
280
  // EDITOR-6558: hide ProseMirror when the markdown-mode plugin
273
281
  // reports a non-WYSIWYG view.
274
- expValEqualsNoExposure('cc-markdown-mode', 'isEnabled', true) && markdownPluginCurrentView !== 'wysiwyg' && markdownPluginCurrentIsMarkdownMode && hideEditorContentAreaProsemirrorStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
282
+ shouldHideProseMirrorForMarkdownMode && (fg('platform_editor_delay_markdown_view_mode_eval') ? hideEditorContentAreaProsemirrorWithAttributeStyle : hideEditorContentAreaProsemirrorStyle), tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
275
283
  // for breakout resizing, there's no need to restrict the width of codeblocks as they're always wrapped in a breakout mark
276
284
  expValEqualsNoExposure('platform_editor_breakout_resizing', 'isEnabled', true) ? editorContentAreaContainerStyleExcludeCodeBlockNew : editorContentAreaContainerStyleNew, fg('platform_editor_nested_dnd_styles_changes') && editorContentAreaContainerNestedDndStyle, !fg('platform_editor_controls_no_toolbar_space') && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReducedHeaderSpace, !fg('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') && contentAreaReservedPrimaryToolbarSpace],
277
285
  style: {
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "219.9.0";
2
+ export var version = "0.0.0-development";
@@ -0,0 +1,11 @@
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ export type MarkdownModeView = 'syntax' | 'wysiwyg' | 'preview';
3
+ export type MarkdownModePlugin = NextEditorPlugin<'markdownMode', {
4
+ actions: {
5
+ setView: (view: MarkdownModeView) => void;
6
+ };
7
+ sharedState: {
8
+ isMarkdownMode: boolean;
9
+ view: MarkdownModeView;
10
+ };
11
+ }>;
@@ -14,9 +14,9 @@ import type { BlockMenuPlugin } from '@atlaskit/editor-plugins/block-menu';
14
14
  import type { ContextPanelPlugin } from '@atlaskit/editor-plugins/context-panel';
15
15
  import type { ViewMode } from '@atlaskit/editor-plugins/editor-viewmode';
16
16
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
17
- import type { MarkdownModePlugin } from '@atlassian/editor-plugin-markdown-mode';
18
17
  import type EditorActions from '../../../actions';
19
18
  import type { ContentComponents, ReactComponents } from '../../../types';
19
+ import type { MarkdownModePlugin } from '../../../types/markdown-mode';
20
20
  import type { ScrollContainerRefs } from './types';
21
21
  type EditorAPI = PublicPluginAPI<[
22
22
  OptionalPlugin<ContextPanelPlugin>,
@@ -7,8 +7,8 @@ import React from 'react';
7
7
  import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
8
8
  import type { ToolbarPlugin } from '@atlaskit/editor-plugins/toolbar';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
- import type { MarkdownModePlugin } from '@atlassian/editor-plugin-markdown-mode';
11
10
  import type { PrimaryToolbarComponents } from '../../../types';
11
+ import type { MarkdownModePlugin } from '../../../types/markdown-mode';
12
12
  type FullPageToolbarNextProps = {
13
13
  beforeIcon?: React.ReactNode;
14
14
  customPrimaryToolbarComponents?: PrimaryToolbarComponents;
@@ -5,7 +5,7 @@ import type { ToolbarPlugin } from '@atlaskit/editor-plugins/toolbar';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { ToolbarUIContextType } from '@atlaskit/editor-toolbar';
7
7
  import type { RegisterComponent, RegisterToolbar } from '@atlaskit/editor-toolbar-model';
8
- import type { MarkdownModePlugin } from '@atlassian/editor-plugin-markdown-mode';
8
+ import type { MarkdownModePlugin } from '../../types/markdown-mode';
9
9
  import type { ToolbarProps } from './toolbar-types';
10
10
  /**
11
11
  * *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
@@ -0,0 +1,11 @@
1
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
+ export type MarkdownModeView = 'syntax' | 'wysiwyg' | 'preview';
3
+ export type MarkdownModePlugin = NextEditorPlugin<'markdownMode', {
4
+ actions: {
5
+ setView: (view: MarkdownModeView) => void;
6
+ };
7
+ sharedState: {
8
+ isMarkdownMode: boolean;
9
+ view: MarkdownModeView;
10
+ };
11
+ }>;
@@ -14,9 +14,9 @@ import type { BlockMenuPlugin } from '@atlaskit/editor-plugins/block-menu';
14
14
  import type { ContextPanelPlugin } from '@atlaskit/editor-plugins/context-panel';
15
15
  import type { ViewMode } from '@atlaskit/editor-plugins/editor-viewmode';
16
16
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
17
- import type { MarkdownModePlugin } from '@atlassian/editor-plugin-markdown-mode';
18
17
  import type EditorActions from '../../../actions';
19
18
  import type { ContentComponents, ReactComponents } from '../../../types';
19
+ import type { MarkdownModePlugin } from '../../../types/markdown-mode';
20
20
  import type { ScrollContainerRefs } from './types';
21
21
  type EditorAPI = PublicPluginAPI<[
22
22
  OptionalPlugin<ContextPanelPlugin>,
@@ -7,8 +7,8 @@ import React from 'react';
7
7
  import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
8
8
  import type { ToolbarPlugin } from '@atlaskit/editor-plugins/toolbar';
9
9
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
- import type { MarkdownModePlugin } from '@atlassian/editor-plugin-markdown-mode';
11
10
  import type { PrimaryToolbarComponents } from '../../../types';
11
+ import type { MarkdownModePlugin } from '../../../types/markdown-mode';
12
12
  type FullPageToolbarNextProps = {
13
13
  beforeIcon?: React.ReactNode;
14
14
  customPrimaryToolbarComponents?: PrimaryToolbarComponents;
@@ -5,7 +5,7 @@ import type { ToolbarPlugin } from '@atlaskit/editor-plugins/toolbar';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
6
  import type { ToolbarUIContextType } from '@atlaskit/editor-toolbar';
7
7
  import type { RegisterComponent, RegisterToolbar } from '@atlaskit/editor-toolbar-model';
8
- import type { MarkdownModePlugin } from '@atlassian/editor-plugin-markdown-mode';
8
+ import type { MarkdownModePlugin } from '../../types/markdown-mode';
9
9
  import type { ToolbarProps } from './toolbar-types';
10
10
  /**
11
11
  * *Warning:* With `platform_editor_toolbar_aifc` enabled this component is no longer used and is replaced with `<ToolbarNext />`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "219.9.1",
3
+ "version": "219.9.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -74,7 +74,7 @@
74
74
  "@atlaskit/platform-feature-flags-react": "^0.5.0",
75
75
  "@atlaskit/react-ufo": "^5.21.0",
76
76
  "@atlaskit/task-decision": "^20.1.0",
77
- "@atlaskit/tmp-editor-statsig": "^81.1.0",
77
+ "@atlaskit/tmp-editor-statsig": "^81.2.0",
78
78
  "@atlaskit/tokens": "^13.0.0",
79
79
  "@atlaskit/tooltip": "^22.2.0",
80
80
  "@atlaskit/width-detector": "^5.1.0",
@@ -92,7 +92,7 @@
92
92
  "uuid": "^3.1.0"
93
93
  },
94
94
  "peerDependencies": {
95
- "@atlaskit/editor-common": "^114.35.0",
95
+ "@atlaskit/editor-common": "^114.36.0",
96
96
  "@atlaskit/link-provider": "^4.4.0",
97
97
  "@atlaskit/media-core": "^37.1.0",
98
98
  "react": "^18.2.0",
@@ -103,7 +103,7 @@
103
103
  "@af/editor-libra": "workspace:^",
104
104
  "@af/suppress-react-warnings": "workspace:^",
105
105
  "@af/visual-regression": "workspace:^",
106
- "@atlaskit/adf-utils": "^19.29.0",
106
+ "@atlaskit/adf-utils": "^19.30.0",
107
107
  "@atlaskit/analytics-listeners": "^10.1.0",
108
108
  "@atlaskit/code": "^17.5.0",
109
109
  "@atlaskit/collab-provider": "^19.0.0",
@@ -335,6 +335,9 @@
335
335
  },
336
336
  "platform_editor_chromeless_akeditor_class": {
337
337
  "type": "boolean"
338
+ },
339
+ "platform_editor_delay_markdown_view_mode_eval": {
340
+ "type": "boolean"
338
341
  }
339
342
  },
340
343
  "stricter": {