@atlaskit/editor-core 203.12.0 → 203.13.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 (29) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/actions/index.js +6 -0
  3. package/dist/cjs/create-editor/create-schema.js +2 -11
  4. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -0
  5. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +11 -5
  6. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +14 -6
  7. package/dist/cjs/ui/ContentStyles/index.js +13 -6
  8. package/dist/cjs/version-wrapper.js +1 -1
  9. package/dist/es2019/actions/index.js +6 -0
  10. package/dist/es2019/create-editor/create-schema.js +2 -11
  11. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -0
  12. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +12 -6
  13. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +13 -5
  14. package/dist/es2019/ui/ContentStyles/index.js +13 -6
  15. package/dist/es2019/version-wrapper.js +1 -1
  16. package/dist/esm/actions/index.js +6 -0
  17. package/dist/esm/create-editor/create-schema.js +2 -11
  18. package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -0
  19. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +12 -6
  20. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +13 -5
  21. package/dist/esm/ui/ContentStyles/index.js +13 -6
  22. package/dist/esm/version-wrapper.js +1 -1
  23. package/dist/types/actions/index.d.ts +6 -0
  24. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  25. package/dist/types/ui/ContentStyles/index.d.ts +1 -0
  26. package/dist/types-ts4.5/actions/index.d.ts +6 -0
  27. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  28. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +1 -0
  29. package/package.json +14 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 203.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#106964](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106964)
8
+ [`996f72bae4986`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/996f72bae4986) -
9
+ [No Issue] Introducing virtualization for inline nodes
10
+
11
+ ### Patch Changes
12
+
13
+ - [#108797](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108797)
14
+ [`9a3f165bc940b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9a3f165bc940b) -
15
+ tidy up feature flag confluence_frontend_editor_custom_presets
16
+ - Updated dependencies
17
+
18
+ ## 203.12.1
19
+
20
+ ### Patch Changes
21
+
22
+ - [#106923](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106923)
23
+ [`5f44122535833`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5f44122535833) -
24
+ ED-26253 Update table css selectors so they don't get applied to table elements not owned by the
25
+ editor and nested inside an editor table
26
+ - [#107631](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107631)
27
+ [`4dd152f2bd7cb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4dd152f2bd7cb) -
28
+ updated jsdoc to include example for new replaceDocument core action
29
+
3
30
  ## 203.12.0
4
31
 
5
32
  ### Minor Changes
@@ -329,6 +329,12 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
329
329
  /**
330
330
  * @deprecated - please use `replaceDocument` found in the core plugin actions instead
331
331
  * using this will reset your Editor State which could cause some things to break (like emojis)
332
+ * @example - use the `replaceDocument` from the core plugin actions instead
333
+ * ```ts
334
+ * const { editorApi, preset } = usePreset(...);
335
+ // where you need it
336
+ editorApi?.core.actions.replaceDocument(value);
337
+ return <ComposableEditor preset={preset} ... />
332
338
  */
333
339
  }, {
334
340
  key: "replaceDocument",
@@ -12,7 +12,6 @@ var _schema = require("@atlaskit/adf-schema/schema");
12
12
  var _legacyRankPlugins = require("@atlaskit/editor-common/legacy-rank-plugins");
13
13
  var _prosemirrorDomMetadata = require("@atlaskit/editor-common/prosemirror-dom-metadata");
14
14
  var _model = require("@atlaskit/editor-prosemirror/model");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _createEditor = require("./create-editor");
17
16
  /**
18
17
  * 🧱 Internal Helper Function: Editor FE Platform
@@ -96,19 +95,11 @@ var wrapNodeSpecProxy = exports.wrapNodeSpecProxy = function wrapNodeSpecProxy(s
96
95
  };
97
96
  function createSchema(editorConfig) {
98
97
  var marks = (0, _createEditor.fixExcludes)(editorConfig.marks.sort((0, _legacyRankPlugins.sortByOrder)('marks')).reduce(function (acc, mark) {
99
- if ((0, _platformFeatureFlags.fg)('platform_editor_breakout_use_css')) {
100
- acc[mark.name] = wrapNodeSpecProxy(mark.mark);
101
- } else {
102
- acc[mark.name] = mark.mark;
103
- }
98
+ acc[mark.name] = wrapNodeSpecProxy(mark.mark);
104
99
  return acc;
105
100
  }, {}));
106
101
  var nodes = (0, _schema.sanitizeNodes)(editorConfig.nodes.sort((0, _legacyRankPlugins.sortByOrder)('nodes')).reduce(function (acc, node) {
107
- if ((0, _platformFeatureFlags.fg)('platform_editor_breakout_use_css')) {
108
- acc[node.name] = wrapNodeSpecProxy(node.node);
109
- } else {
110
- acc[node.name] = node.node;
111
- }
102
+ acc[node.name] = wrapNodeSpecProxy(node.node);
112
103
  return acc;
113
104
  }, {}), marks);
114
105
  return new _model.Schema({
@@ -185,6 +185,7 @@ var hiddenStyle = (0, _react2.css)({
185
185
  transition: '200ms opacity, 200ms visibility, 200ms transform',
186
186
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
187
187
  '&[data-hidden="true"]': {
188
+ height: 0,
188
189
  visibility: 'hidden',
189
190
  opacity: 0
190
191
  // transition: '0ms opacity, 0ms visibility, 0ms transform',
@@ -10,7 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
10
10
  var _react2 = require("@emotion/react");
11
11
  var _reactIntlNext = require("react-intl-next");
12
12
  var _messages = require("@atlaskit/editor-common/messages");
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
14
14
  var _ClickAreaBlock = _interopRequireDefault(require("../../Addon/ClickAreaBlock"));
15
15
  var _ContextPanel = require("../../ContextPanel");
16
16
  var _PluginSlot = _interopRequireDefault(require("../../PluginSlot"));
@@ -53,23 +53,29 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
53
53
  css: [
54
54
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
55
55
  _StyledComponents.contentArea,
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
57
+ (0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden &&
56
58
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
57
- props.isEditorToolbarHidden && _StyledComponents.contentAreaHeightNoToolbar],
59
+ _StyledComponents.contentAreaHeightNoToolbar],
58
60
  "data-testid": CONTENT_AREA_TEST_ID,
59
61
  ref: containerRef
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
63
+ ,
64
+ className: !(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden ? 'ak-editor-content-area-no-toolbar' : undefined
60
65
  }, (0, _react2.jsx)("div", {
61
66
  css:
62
67
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
63
- (0, _platformFeatureFlags.fg)('platform_editor_breakout_use_css') ? _StyledComponents.contentAreaWrapper : _StyledComponents.contentAreaWrapperNoStyles,
68
+ _StyledComponents.contentAreaWrapper,
64
69
  "data-testid": EDITOR_CONTAINER,
65
- "data-editor-container": (0, _platformFeatureFlags.fg)('platform_editor_breakout_use_css') ? 'true' : 'false'
70
+ "data-editor-container": 'true'
66
71
  }, (0, _react2.jsx)(_StyledComponents.ScrollContainer
67
72
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
68
73
  , {
69
74
  className: "fabric-editor-popup-scroll-parent",
70
75
  featureFlags: props.featureFlags,
71
76
  ref: scrollContainerRef,
72
- viewMode: props === null || props === void 0 ? void 0 : props.viewMode
77
+ viewMode: props === null || props === void 0 ? void 0 : props.viewMode,
78
+ isScrollable: true
73
79
  }, (0, _react2.jsx)(_ClickAreaBlock.default, {
74
80
  editorView: props.editorView,
75
81
  editorDisabled: props.disabled
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.sidebarArea = exports.fullPageEditorWrapper = exports.editorContentGutterStyle = exports.editorContentAreaStyle = exports.editorContentAreaHideContainer = exports.contentAreaWrapperNoStyles = exports.contentAreaWrapper = exports.contentAreaHeightNoToolbar = exports.contentArea = exports.ScrollContainer = void 0;
7
+ exports.sidebarArea = exports.fullPageEditorWrapper = exports.editorContentGutterStyle = exports.editorContentAreaStyle = exports.editorContentAreaHideContainer = exports.contentAreaWrapper = exports.contentAreaHeightNoToolbar = exports.contentArea = exports.ScrollContainer = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _react = require("@emotion/react");
10
10
  var _adfSchema = require("@atlaskit/adf-schema");
@@ -54,6 +54,12 @@ var contentArea = exports.contentArea = function contentArea() {
54
54
  flexDirection: 'row',
55
55
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
56
56
  height: "calc(100% - ".concat(editorToolbarHeight, ")"),
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
58
+ '&.ak-editor-content-area-no-toolbar': {
59
+ // The editor toolbar height is 1px off (from the border) -- so we need to add 1px to the height
60
+ // to match the toolbar height
61
+ height: "calc(100% + 1px)"
62
+ },
57
63
  boxSizing: 'border-box',
58
64
  margin: 0,
59
65
  padding: 0,
@@ -75,11 +81,6 @@ var contentAreaWrapper = exports.contentAreaWrapper = (0, _react.css)({
75
81
  contain: 'layout style inline-size'
76
82
  });
77
83
 
78
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
79
- var contentAreaWrapperNoStyles = exports.contentAreaWrapperNoStyles = (0, _react.css)({
80
- display: 'contents'
81
- });
82
-
83
84
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
84
85
  var contentAreaHeightNoToolbar = exports.contentAreaHeightNoToolbar = (0, _react.css)({
85
86
  height: '100%'
@@ -151,6 +152,13 @@ var editorContentArea = (0, _react.css)({
151
152
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
152
153
  lineHeight: '24px',
153
154
  paddingTop: "var(--ds-space-600, 48px)",
155
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
156
+ '.ak-editor-content-area-no-toolbar &': {
157
+ // When the toolbar is hidden, we don't want content to jump up
158
+ // the extra 1px is to account for the border on the toolbar
159
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
160
+ paddingTop: "calc(".concat("var(--ds-space-600, 48px)", " + ", (0, _editorSharedStyles.FULL_PAGE_EDITOR_TOOLBAR_HEIGHT)(), " + 1px)")
161
+ },
154
162
  paddingBottom: "var(--ds-space-600, 48px)",
155
163
  height: 'calc( 100% - 105px )',
156
164
  width: '100%',
@@ -114,14 +114,21 @@ var createEditorContentStyle = exports.createEditorContentStyle = function creat
114
114
  typographyTheme: typography
115
115
  });
116
116
  }, [theme, colorMode, featureFlags, props.viewMode, typography]);
117
- return (
118
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
119
- (0, _react2.jsx)("div", {
117
+ if (props.isScrollable) {
118
+ return (0, _react2.jsx)("div", {
119
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
120
120
  className: className,
121
121
  ref: ref,
122
- css: [memoizedStyle, styles]
123
- }, children)
124
- );
122
+ css: [memoizedStyle, styles],
123
+ "data-editor-scroll-container": "true"
124
+ }, children);
125
+ }
126
+ return (0, _react2.jsx)("div", {
127
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
128
+ className: className,
129
+ ref: ref,
130
+ css: [memoizedStyle, styles]
131
+ }, children);
125
132
  });
126
133
  };
127
134
  var _default = exports.default = createEditorContentStyle();
@@ -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 = "203.12.0";
8
+ var version = exports.version = "203.13.0";
@@ -243,6 +243,12 @@ export default class EditorActions {
243
243
  /**
244
244
  * @deprecated - please use `replaceDocument` found in the core plugin actions instead
245
245
  * using this will reset your Editor State which could cause some things to break (like emojis)
246
+ * @example - use the `replaceDocument` from the core plugin actions instead
247
+ * ```ts
248
+ * const { editorApi, preset } = usePreset(...);
249
+ // where you need it
250
+ editorApi?.core.actions.replaceDocument(value);
251
+ return <ComposableEditor preset={preset} ... />
246
252
  */
247
253
  replaceDocument(
248
254
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2,7 +2,6 @@ import { sanitizeNodes } from '@atlaskit/adf-schema/schema';
2
2
  import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
3
3
  import { createProseMirrorMetadata } from '@atlaskit/editor-common/prosemirror-dom-metadata';
4
4
  import { Schema } from '@atlaskit/editor-prosemirror/model';
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
5
  import { fixExcludes } from './create-editor';
7
6
  /**
8
7
  * 🧱 Internal Helper Function: Editor FE Platform
@@ -87,19 +86,11 @@ export const wrapNodeSpecProxy = spec => {
87
86
  };
88
87
  export function createSchema(editorConfig) {
89
88
  const marks = fixExcludes(editorConfig.marks.sort(sortByOrder('marks')).reduce((acc, mark) => {
90
- if (fg('platform_editor_breakout_use_css')) {
91
- acc[mark.name] = wrapNodeSpecProxy(mark.mark);
92
- } else {
93
- acc[mark.name] = mark.mark;
94
- }
89
+ acc[mark.name] = wrapNodeSpecProxy(mark.mark);
95
90
  return acc;
96
91
  }, {}));
97
92
  const nodes = sanitizeNodes(editorConfig.nodes.sort(sortByOrder('nodes')).reduce((acc, node) => {
98
- if (fg('platform_editor_breakout_use_css')) {
99
- acc[node.name] = wrapNodeSpecProxy(node.node);
100
- } else {
101
- acc[node.name] = node.node;
102
- }
93
+ acc[node.name] = wrapNodeSpecProxy(node.node);
103
94
  return acc;
104
95
  }, {}), marks);
105
96
  return new Schema({
@@ -167,6 +167,7 @@ const hiddenStyle = css({
167
167
  transition: '200ms opacity, 200ms visibility, 200ms transform',
168
168
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
169
169
  '&[data-hidden="true"]': {
170
+ height: 0,
170
171
  visibility: 'hidden',
171
172
  opacity: 0
172
173
  // transition: '0ms opacity, 0ms visibility, 0ms transform',
@@ -9,13 +9,13 @@ import React, { useImperativeHandle, useRef } from 'react';
9
9
  import { jsx, useTheme } from '@emotion/react';
10
10
  import { injectIntl } from 'react-intl-next';
11
11
  import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
12
- import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
13
  // Ignored via go/ees005
14
14
  // eslint-disable-next-line import/no-named-as-default
15
15
  import ClickAreaBlock from '../../Addon/ClickAreaBlock';
16
16
  import { ContextPanel } from '../../ContextPanel';
17
17
  import PluginSlot from '../../PluginSlot';
18
- import { contentArea, contentAreaHeightNoToolbar, contentAreaWrapper, contentAreaWrapperNoStyles, editorContentAreaStyle, editorContentGutterStyle, ScrollContainer, sidebarArea } from './StyledComponents';
18
+ import { contentArea, contentAreaHeightNoToolbar, contentAreaWrapper, editorContentAreaStyle, editorContentGutterStyle, ScrollContainer, sidebarArea } from './StyledComponents';
19
19
  export const CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
20
20
  export const EDITOR_CONTAINER = 'ak-editor-container';
21
21
  const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
@@ -40,23 +40,29 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
40
40
  css: [
41
41
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
42
42
  contentArea,
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
44
+ editorExperiment('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden &&
43
45
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
44
- props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
46
+ contentAreaHeightNoToolbar],
45
47
  "data-testid": CONTENT_AREA_TEST_ID,
46
48
  ref: containerRef
49
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
50
+ ,
51
+ className: !editorExperiment('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden ? 'ak-editor-content-area-no-toolbar' : undefined
47
52
  }, jsx("div", {
48
53
  css:
49
54
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
50
- fg('platform_editor_breakout_use_css') ? contentAreaWrapper : contentAreaWrapperNoStyles,
55
+ contentAreaWrapper,
51
56
  "data-testid": EDITOR_CONTAINER,
52
- "data-editor-container": fg('platform_editor_breakout_use_css') ? 'true' : 'false'
57
+ "data-editor-container": 'true'
53
58
  }, jsx(ScrollContainer
54
59
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
55
60
  , {
56
61
  className: "fabric-editor-popup-scroll-parent",
57
62
  featureFlags: props.featureFlags,
58
63
  ref: scrollContainerRef,
59
- viewMode: props === null || props === void 0 ? void 0 : props.viewMode
64
+ viewMode: props === null || props === void 0 ? void 0 : props.viewMode,
65
+ isScrollable: true
60
66
  }, jsx(ClickAreaBlock, {
61
67
  editorView: props.editorView,
62
68
  editorDisabled: props.disabled
@@ -44,6 +44,12 @@ export const contentArea = () => {
44
44
  flexDirection: 'row',
45
45
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
46
46
  height: `calc(100% - ${editorToolbarHeight})`,
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
48
+ '&.ak-editor-content-area-no-toolbar': {
49
+ // The editor toolbar height is 1px off (from the border) -- so we need to add 1px to the height
50
+ // to match the toolbar height
51
+ height: `calc(100% + 1px)`
52
+ },
47
53
  boxSizing: 'border-box',
48
54
  margin: 0,
49
55
  padding: 0,
@@ -65,11 +71,6 @@ export const contentAreaWrapper = css({
65
71
  contain: 'layout style inline-size'
66
72
  });
67
73
 
68
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
69
- export const contentAreaWrapperNoStyles = css({
70
- display: 'contents'
71
- });
72
-
73
74
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
74
75
  export const contentAreaHeightNoToolbar = css({
75
76
  height: '100%'
@@ -136,6 +137,13 @@ const editorContentArea = css({
136
137
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
137
138
  lineHeight: '24px',
138
139
  paddingTop: "var(--ds-space-600, 48px)",
140
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
141
+ '.ak-editor-content-area-no-toolbar &': {
142
+ // When the toolbar is hidden, we don't want content to jump up
143
+ // the extra 1px is to account for the border on the toolbar
144
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
145
+ paddingTop: `calc(${"var(--ds-space-600, 48px)"} + ${FULL_PAGE_EDITOR_TOOLBAR_HEIGHT()} + 1px)`
146
+ },
139
147
  paddingBottom: "var(--ds-space-600, 48px)",
140
148
  height: 'calc( 100% - 105px )',
141
149
  width: '100%',
@@ -427,14 +427,21 @@ export const createEditorContentStyle = styles => {
427
427
  viewMode: props.viewMode,
428
428
  typographyTheme: typography
429
429
  }), [theme, colorMode, featureFlags, props.viewMode, typography]);
430
- return (
431
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
432
- jsx("div", {
430
+ if (props.isScrollable) {
431
+ return jsx("div", {
432
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
433
433
  className: className,
434
434
  ref: ref,
435
- css: [memoizedStyle, styles]
436
- }, children)
437
- );
435
+ css: [memoizedStyle, styles],
436
+ "data-editor-scroll-container": "true"
437
+ }, children);
438
+ }
439
+ return jsx("div", {
440
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
441
+ className: className,
442
+ ref: ref,
443
+ css: [memoizedStyle, styles]
444
+ }, children);
438
445
  });
439
446
  };
440
447
  export default createEditorContentStyle();
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "203.12.0";
2
+ export const version = "203.13.0";
@@ -323,6 +323,12 @@ var EditorActions = /*#__PURE__*/function () {
323
323
  /**
324
324
  * @deprecated - please use `replaceDocument` found in the core plugin actions instead
325
325
  * using this will reset your Editor State which could cause some things to break (like emojis)
326
+ * @example - use the `replaceDocument` from the core plugin actions instead
327
+ * ```ts
328
+ * const { editorApi, preset } = usePreset(...);
329
+ // where you need it
330
+ editorApi?.core.actions.replaceDocument(value);
331
+ return <ComposableEditor preset={preset} ... />
326
332
  */
327
333
  }, {
328
334
  key: "replaceDocument",
@@ -3,7 +3,6 @@ import { sanitizeNodes } from '@atlaskit/adf-schema/schema';
3
3
  import { sortByOrder } from '@atlaskit/editor-common/legacy-rank-plugins';
4
4
  import { createProseMirrorMetadata } from '@atlaskit/editor-common/prosemirror-dom-metadata';
5
5
  import { Schema } from '@atlaskit/editor-prosemirror/model';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { fixExcludes } from './create-editor';
8
7
  /**
9
8
  * 🧱 Internal Helper Function: Editor FE Platform
@@ -87,19 +86,11 @@ export var wrapNodeSpecProxy = function wrapNodeSpecProxy(spec) {
87
86
  };
88
87
  export function createSchema(editorConfig) {
89
88
  var marks = fixExcludes(editorConfig.marks.sort(sortByOrder('marks')).reduce(function (acc, mark) {
90
- if (fg('platform_editor_breakout_use_css')) {
91
- acc[mark.name] = wrapNodeSpecProxy(mark.mark);
92
- } else {
93
- acc[mark.name] = mark.mark;
94
- }
89
+ acc[mark.name] = wrapNodeSpecProxy(mark.mark);
95
90
  return acc;
96
91
  }, {}));
97
92
  var nodes = sanitizeNodes(editorConfig.nodes.sort(sortByOrder('nodes')).reduce(function (acc, node) {
98
- if (fg('platform_editor_breakout_use_css')) {
99
- acc[node.name] = wrapNodeSpecProxy(node.node);
100
- } else {
101
- acc[node.name] = node.node;
102
- }
93
+ acc[node.name] = wrapNodeSpecProxy(node.node);
103
94
  return acc;
104
95
  }, {}), marks);
105
96
  return new Schema({
@@ -174,6 +174,7 @@ var hiddenStyle = css({
174
174
  transition: '200ms opacity, 200ms visibility, 200ms transform',
175
175
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
176
176
  '&[data-hidden="true"]': {
177
+ height: 0,
177
178
  visibility: 'hidden',
178
179
  opacity: 0
179
180
  // transition: '0ms opacity, 0ms visibility, 0ms transform',
@@ -9,13 +9,13 @@ import React, { useImperativeHandle, useRef } from 'react';
9
9
  import { jsx, useTheme } from '@emotion/react';
10
10
  import { injectIntl } from 'react-intl-next';
11
11
  import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
12
- import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
13
  // Ignored via go/ees005
14
14
  // eslint-disable-next-line import/no-named-as-default
15
15
  import ClickAreaBlock from '../../Addon/ClickAreaBlock';
16
16
  import { ContextPanel } from '../../ContextPanel';
17
17
  import PluginSlot from '../../PluginSlot';
18
- import { contentArea, contentAreaHeightNoToolbar, contentAreaWrapper, contentAreaWrapperNoStyles, editorContentAreaStyle, editorContentGutterStyle, ScrollContainer, sidebarArea } from './StyledComponents';
18
+ import { contentArea, contentAreaHeightNoToolbar, contentAreaWrapper, editorContentAreaStyle, editorContentGutterStyle, ScrollContainer, sidebarArea } from './StyledComponents';
19
19
  export var CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
20
20
  export var EDITOR_CONTAINER = 'ak-editor-container';
21
21
  var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
@@ -42,23 +42,29 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
42
42
  css: [
43
43
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
44
44
  contentArea,
45
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
46
+ editorExperiment('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden &&
45
47
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
46
- props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
48
+ contentAreaHeightNoToolbar],
47
49
  "data-testid": CONTENT_AREA_TEST_ID,
48
50
  ref: containerRef
51
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
52
+ ,
53
+ className: !editorExperiment('live_pages_graceful_edit', 'control') && props.isEditorToolbarHidden ? 'ak-editor-content-area-no-toolbar' : undefined
49
54
  }, jsx("div", {
50
55
  css:
51
56
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
52
- fg('platform_editor_breakout_use_css') ? contentAreaWrapper : contentAreaWrapperNoStyles,
57
+ contentAreaWrapper,
53
58
  "data-testid": EDITOR_CONTAINER,
54
- "data-editor-container": fg('platform_editor_breakout_use_css') ? 'true' : 'false'
59
+ "data-editor-container": 'true'
55
60
  }, jsx(ScrollContainer
56
61
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
57
62
  , {
58
63
  className: "fabric-editor-popup-scroll-parent",
59
64
  featureFlags: props.featureFlags,
60
65
  ref: scrollContainerRef,
61
- viewMode: props === null || props === void 0 ? void 0 : props.viewMode
66
+ viewMode: props === null || props === void 0 ? void 0 : props.viewMode,
67
+ isScrollable: true
62
68
  }, jsx(ClickAreaBlock, {
63
69
  editorView: props.editorView,
64
70
  editorDisabled: props.disabled
@@ -47,6 +47,12 @@ export var contentArea = function contentArea() {
47
47
  flexDirection: 'row',
48
48
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
49
49
  height: "calc(100% - ".concat(editorToolbarHeight, ")"),
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values
51
+ '&.ak-editor-content-area-no-toolbar': {
52
+ // The editor toolbar height is 1px off (from the border) -- so we need to add 1px to the height
53
+ // to match the toolbar height
54
+ height: "calc(100% + 1px)"
55
+ },
50
56
  boxSizing: 'border-box',
51
57
  margin: 0,
52
58
  padding: 0,
@@ -68,11 +74,6 @@ export var contentAreaWrapper = css({
68
74
  contain: 'layout style inline-size'
69
75
  });
70
76
 
71
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles
72
- export var contentAreaWrapperNoStyles = css({
73
- display: 'contents'
74
- });
75
-
76
77
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
77
78
  export var contentAreaHeightNoToolbar = css({
78
79
  height: '100%'
@@ -144,6 +145,13 @@ var editorContentArea = css({
144
145
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
145
146
  lineHeight: '24px',
146
147
  paddingTop: "var(--ds-space-600, 48px)",
148
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
149
+ '.ak-editor-content-area-no-toolbar &': {
150
+ // When the toolbar is hidden, we don't want content to jump up
151
+ // the extra 1px is to account for the border on the toolbar
152
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
153
+ paddingTop: "calc(".concat("var(--ds-space-600, 48px)", " + ", FULL_PAGE_EDITOR_TOOLBAR_HEIGHT(), " + 1px)")
154
+ },
147
155
  paddingBottom: "var(--ds-space-600, 48px)",
148
156
  height: 'calc( 100% - 105px )',
149
157
  width: '100%',
@@ -106,14 +106,21 @@ export var createEditorContentStyle = function createEditorContentStyle(styles)
106
106
  typographyTheme: typography
107
107
  });
108
108
  }, [theme, colorMode, featureFlags, props.viewMode, typography]);
109
- return (
110
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
111
- jsx("div", {
109
+ if (props.isScrollable) {
110
+ return jsx("div", {
111
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
112
112
  className: className,
113
113
  ref: ref,
114
- css: [memoizedStyle, styles]
115
- }, children)
116
- );
114
+ css: [memoizedStyle, styles],
115
+ "data-editor-scroll-container": "true"
116
+ }, children);
117
+ }
118
+ return jsx("div", {
119
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
120
+ className: className,
121
+ ref: ref,
122
+ css: [memoizedStyle, styles]
123
+ }, children);
117
124
  });
118
125
  };
119
126
  export default createEditorContentStyle();
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "203.12.0";
2
+ export var version = "203.13.0";
@@ -43,6 +43,12 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
43
43
  /**
44
44
  * @deprecated - please use `replaceDocument` found in the core plugin actions instead
45
45
  * using this will reset your Editor State which could cause some things to break (like emojis)
46
+ * @example - use the `replaceDocument` from the core plugin actions instead
47
+ * ```ts
48
+ * const { editorApi, preset } = usePreset(...);
49
+ // where you need it
50
+ editorApi?.core.actions.replaceDocument(value);
51
+ return <ComposableEditor preset={preset} ... />
46
52
  */
47
53
  replaceDocument(rawValue: any, shouldScrollToBottom?: boolean,
48
54
  /** @deprecated [ED-14158] shouldAddToHistory is not being used in this function */
@@ -6,10 +6,10 @@ export declare const ScrollContainer: import("react").ForwardRefExoticComponent<
6
6
  featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
7
7
  viewMode?: "edit" | "view" | undefined;
8
8
  typographyTheme?: "typography" | "typography-adg3" | "typography-modernized" | "typography-refreshed" | undefined;
9
+ isScrollable?: boolean | undefined;
9
10
  } & import("react").HTMLProps<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
10
11
  export declare const contentArea: () => import("@emotion/react").SerializedStyles;
11
12
  export declare const contentAreaWrapper: import("@emotion/react").SerializedStyles;
12
- export declare const contentAreaWrapperNoStyles: import("@emotion/react").SerializedStyles;
13
13
  export declare const contentAreaHeightNoToolbar: import("@emotion/react").SerializedStyles;
14
14
  export declare const sidebarArea: import("@emotion/react").SerializedStyles;
15
15
  export declare const editorContentAreaHideContainer: import("@emotion/react").SerializedStyles;
@@ -13,6 +13,7 @@ type ContentStylesProps = {
13
13
  featureFlags?: FeatureFlags;
14
14
  viewMode?: 'view' | 'edit';
15
15
  typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed';
16
+ isScrollable?: boolean;
16
17
  };
17
18
  export declare const placeholderStyles: SerializedStyles;
18
19
  /**
@@ -43,6 +43,12 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
43
43
  /**
44
44
  * @deprecated - please use `replaceDocument` found in the core plugin actions instead
45
45
  * using this will reset your Editor State which could cause some things to break (like emojis)
46
+ * @example - use the `replaceDocument` from the core plugin actions instead
47
+ * ```ts
48
+ * const { editorApi, preset } = usePreset(...);
49
+ // where you need it
50
+ editorApi?.core.actions.replaceDocument(value);
51
+ return <ComposableEditor preset={preset} ... />
46
52
  */
47
53
  replaceDocument(rawValue: any, shouldScrollToBottom?: boolean,
48
54
  /** @deprecated [ED-14158] shouldAddToHistory is not being used in this function */
@@ -6,10 +6,10 @@ export declare const ScrollContainer: import("react").ForwardRefExoticComponent<
6
6
  featureFlags?: import("@atlaskit/editor-common/types").FeatureFlags | undefined;
7
7
  viewMode?: "edit" | "view" | undefined;
8
8
  typographyTheme?: "typography" | "typography-adg3" | "typography-modernized" | "typography-refreshed" | undefined;
9
+ isScrollable?: boolean | undefined;
9
10
  } & import("react").HTMLProps<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
10
11
  export declare const contentArea: () => import("@emotion/react").SerializedStyles;
11
12
  export declare const contentAreaWrapper: import("@emotion/react").SerializedStyles;
12
- export declare const contentAreaWrapperNoStyles: import("@emotion/react").SerializedStyles;
13
13
  export declare const contentAreaHeightNoToolbar: import("@emotion/react").SerializedStyles;
14
14
  export declare const sidebarArea: import("@emotion/react").SerializedStyles;
15
15
  export declare const editorContentAreaHideContainer: import("@emotion/react").SerializedStyles;
@@ -13,6 +13,7 @@ type ContentStylesProps = {
13
13
  featureFlags?: FeatureFlags;
14
14
  viewMode?: 'view' | 'edit';
15
15
  typographyTheme?: 'typography' | 'typography-adg3' | 'typography-modernized' | 'typography-refreshed';
16
+ isScrollable?: boolean;
16
17
  };
17
18
  export declare const placeholderStyles: SerializedStyles;
18
19
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "203.12.0",
3
+ "version": "203.13.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/analytics-next": "^10.3.0",
44
44
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
45
45
  "@atlaskit/button": "^20.4.0",
46
- "@atlaskit/editor-common": "^99.6.0",
46
+ "@atlaskit/editor-common": "^99.7.0",
47
47
  "@atlaskit/editor-json-transformer": "^8.22.0",
48
48
  "@atlaskit/editor-plugin-quick-insert": "1.9.0",
49
49
  "@atlaskit/editor-plugins": "^7.1.0",
@@ -196,9 +196,6 @@
196
196
  "type": "boolean",
197
197
  "referenceOnly": true
198
198
  },
199
- "platform_editor_breakout_use_css": {
200
- "type": "boolean"
201
- },
202
199
  "editor_request_to_edit_task": {
203
200
  "type": "boolean"
204
201
  },
@@ -230,6 +227,10 @@
230
227
  "type": "boolean",
231
228
  "referenceOnly": true
232
229
  },
230
+ "platform_editor_vs_code_block_paste": {
231
+ "type": "boolean",
232
+ "referenceOnly": true
233
+ },
233
234
  "platform_editor_react18_extension_component_v2": {
234
235
  "type": "boolean"
235
236
  },
@@ -404,12 +405,20 @@
404
405
  "type": "boolean",
405
406
  "referenceOnly": true
406
407
  },
408
+ "platform_editor_lego__inline_node_virtualization": {
409
+ "type": "boolean",
410
+ "referenceOnly": true
411
+ },
407
412
  "platform_editor_nested_tables_paste_dupe_fix": {
408
413
  "type": "boolean",
409
414
  "referenceOnly": true
410
415
  },
411
416
  "platform_editor_react_18_autofocus_fix": {
412
417
  "type": "boolean"
418
+ },
419
+ "platform_editor_renderer_table_header_styles": {
420
+ "type": "boolean",
421
+ "referenceOnly": true
413
422
  }
414
423
  },
415
424
  "stricter": {