@atlaskit/editor-core 193.24.18 → 193.24.20

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 (41) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/create-editor-content-style/package.json +15 -0
  3. package/dist/cjs/create-editor/ReactEditorView.js +44 -27
  4. package/dist/cjs/index.js +7 -0
  5. package/dist/cjs/keymaps/index.js +24 -0
  6. package/dist/cjs/ui/Appearance/Comment/Comment.js +4 -8
  7. package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -5
  8. package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +12 -7
  9. package/dist/cjs/version-wrapper.js +1 -1
  10. package/dist/es2019/create-editor/ReactEditorView.js +44 -27
  11. package/dist/es2019/index.js +2 -1
  12. package/dist/es2019/keymaps/index.js +1 -1
  13. package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -8
  14. package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -5
  15. package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +12 -8
  16. package/dist/es2019/version-wrapper.js +1 -1
  17. package/dist/esm/create-editor/ReactEditorView.js +44 -27
  18. package/dist/esm/index.js +2 -1
  19. package/dist/esm/keymaps/index.js +1 -1
  20. package/dist/esm/ui/Appearance/Comment/Comment.js +4 -8
  21. package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -5
  22. package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +13 -8
  23. package/dist/esm/version-wrapper.js +1 -1
  24. package/dist/types/create-editor/ReactEditorView.d.ts +0 -1
  25. package/dist/types/create-editor/create-preset.d.ts +301 -111
  26. package/dist/types/index.d.ts +1 -0
  27. package/dist/types/keymaps/index.d.ts +1 -1
  28. package/dist/types/presets/default.d.ts +518 -84
  29. package/dist/types/presets/universal.d.ts +301 -111
  30. package/dist/types/presets/useUniversalPreset.d.ts +301 -111
  31. package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +0 -1
  32. package/dist/types-ts4.5/create-editor/create-preset.d.ts +351 -117
  33. package/dist/types-ts4.5/index.d.ts +1 -0
  34. package/dist/types-ts4.5/keymaps/index.d.ts +1 -1
  35. package/dist/types-ts4.5/presets/default.d.ts +1732 -1200
  36. package/dist/types-ts4.5/presets/universal.d.ts +351 -117
  37. package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +351 -117
  38. package/i18n-languages/package.json +15 -0
  39. package/package.json +23 -22
  40. package/tsconfig.json +2 -3
  41. package/use-preset-context/package.json +15 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 193.24.20
4
+
5
+ ### Patch Changes
6
+
7
+ - [#105253](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105253)
8
+ [`a5f3cd26fbd6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a5f3cd26fbd6) -
9
+ Clean up platform.editor.enable-localid-for-paragraph-in-stage-0_cby7g FF
10
+ - [#108295](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108295)
11
+ [`965a0e6c1088`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/965a0e6c1088) -
12
+ NO-ISSUE Condition adding primary toolbar plugin components based on their presence instead of on
13
+ the feature flag to avoid it not rendering in examples
14
+ - [#106586](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106586)
15
+ [`861ecd061c72`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/861ecd061c72) -
16
+ Increase the editor page guttering for full page appearance to support block drag and drop
17
+ - [#105533](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105533)
18
+ [`ba448905afaf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ba448905afaf) -
19
+ ED-23459: Extracts example-helpers to editor-examples-helpers
20
+ - [#100714](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100714)
21
+ [`81849acfe13c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/81849acfe13c) -
22
+ ECA11Y-228: Added new shortcuts for insert column and row and added correct formatting for help
23
+ modal dialog
24
+ - Updated dependencies
25
+
26
+ ## 193.24.19
27
+
28
+ ### Patch Changes
29
+
30
+ - [#103607](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/103607)
31
+ [`104c7a82d1a7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104c7a82d1a7) -
32
+ [ux] ED-23363 If you load a live page in view mode, an empty selection will be set.
33
+
3
34
  ## 193.24.18
4
35
 
5
36
  ### Patch Changes
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/editor-core/create-editor-content-style",
3
+ "main": "../dist/cjs/ui/ContentStyles/index.js",
4
+ "module": "../dist/esm/ui/ContentStyles/index.js",
5
+ "module:es2019": "../dist/es2019/ui/ContentStyles/index.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/ui/ContentStyles/index.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.4": {
10
+ "*": [
11
+ "../dist/types-ts4.5/ui/ContentStyles/index.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
@@ -25,6 +25,7 @@ var _ui = require("@atlaskit/editor-common/ui");
25
25
  var _utils = require("@atlaskit/editor-common/utils");
26
26
  var _state2 = require("@atlaskit/editor-prosemirror/state");
27
27
  var _view = require("@atlaskit/editor-prosemirror/view");
28
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
28
29
  var _eventDispatcher = require("../event-dispatcher");
29
30
  var _document = require("../utils/document");
30
31
  var _isFullPage = require("../utils/is-full-page");
@@ -45,7 +46,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
45
46
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
46
47
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
47
48
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
48
- function handleEditorFocus(view, viewMode) {
49
+ function handleEditorFocus(view) {
49
50
  if (view.hasFocus()) {
50
51
  return;
51
52
  }
@@ -57,12 +58,6 @@ function handleEditorFocus(view, viewMode) {
57
58
  view.focus();
58
59
  return;
59
60
  }
60
- if (viewMode === 'view') {
61
- var emptySelection = new _state2.TextSelection(view.state.doc.resolve(0));
62
- var _tr = view.state.tr.setSelection(emptySelection);
63
- view.dispatch(_tr);
64
- return;
65
- }
66
61
  var domSelection = window.getSelection();
67
62
  if (!domSelection || domSelection.rangeCount === 0) {
68
63
  view.focus();
@@ -119,11 +114,6 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
119
114
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getEditorView", function () {
120
115
  return _this.view;
121
116
  });
122
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getViewMode", function () {
123
- var _editorApi$editorView;
124
- var editorApi = _this.pluginInjectionAPI.api();
125
- return (_editorApi$editorView = editorApi.editorViewMode) === null || _editorApi$editorView === void 0 ? void 0 : _editorApi$editorView.sharedState.currentState().mode;
126
- });
127
117
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "formatFullWidthAppearance", function (appearance) {
128
118
  if (appearance === 'full-width') {
129
119
  return _analytics.FULL_WIDTH_MODE.FULL_WIDTH;
@@ -176,6 +166,7 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
176
166
  });
177
167
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "editorPlugins", []);
178
168
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createEditorState", function (options) {
169
+ var _api$editorViewMode;
179
170
  var schema;
180
171
  if (_this.view) {
181
172
  if (options.resetting) {
@@ -226,18 +217,44 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
226
217
  if (options.doc) {
227
218
  doc = (0, _utils.processRawValue)(schema, options.doc, options.props.providerFactory, options.props.editorProps.sanitizePrivateContent, _this.contentTransformer, _this.dispatchAnalyticsEvent);
228
219
  }
220
+ var api = _this.pluginInjectionAPI.api();
221
+ var isViewMode = (api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState().mode) === 'view';
229
222
  var selection;
230
- if (doc) {
231
- selection = options.selectionAtStart ? _state2.Selection.atStart(doc) : _state2.Selection.atEnd(doc);
223
+ if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.live-view.no-editor-selection-in-view-mode')) {
224
+ if (doc) {
225
+ if (isViewMode) {
226
+ var emptySelection = new _state2.TextSelection(doc.resolve(0));
227
+ return _state2.EditorState.create({
228
+ schema: schema,
229
+ plugins: plugins,
230
+ doc: doc,
231
+ selection: emptySelection
232
+ });
233
+ } else {
234
+ selection = options.selectionAtStart ? _state2.Selection.atStart(doc) : _state2.Selection.atEnd(doc);
235
+ }
236
+ }
237
+ // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
238
+ var patchedSelection = selection ? _state2.Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
239
+ return _state2.EditorState.create({
240
+ schema: schema,
241
+ plugins: plugins,
242
+ doc: doc,
243
+ selection: patchedSelection
244
+ });
245
+ } else {
246
+ if (doc) {
247
+ selection = options.selectionAtStart ? _state2.Selection.atStart(doc) : _state2.Selection.atEnd(doc);
248
+ }
249
+ // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
250
+ var _patchedSelection = selection ? _state2.Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
251
+ return _state2.EditorState.create({
252
+ schema: schema,
253
+ plugins: plugins,
254
+ doc: doc,
255
+ selection: _patchedSelection
256
+ });
232
257
  }
233
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
234
- var patchedSelection = selection ? _state2.Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
235
- return _state2.EditorState.create({
236
- schema: schema,
237
- plugins: plugins,
238
- doc: doc,
239
- selection: patchedSelection
240
- });
241
258
  });
242
259
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onEditorViewStateUpdated", function (_ref2) {
243
260
  var originalTransaction = _ref2.originalTransaction,
@@ -462,7 +479,7 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
462
479
  transformer: _this.contentTransformer
463
480
  });
464
481
  if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
465
- _this.focusTimeoutId = handleEditorFocus(view, _this.getViewMode());
482
+ _this.focusTimeoutId = handleEditorFocus(view);
466
483
  }
467
484
  if (_this.featureFlags.ufo) {
468
485
  _this.experienceStore = _ufo.ExperienceStore.getInstance(view);
@@ -548,11 +565,11 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
548
565
  getEditorState: _this.getEditorState,
549
566
  getEditorView: _this.getEditorView
550
567
  });
551
- var api = _this.pluginInjectionAPI.api();
552
- (_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 || _props$setEditorApi.call(props, api);
568
+ var _api = _this.pluginInjectionAPI.api();
569
+ (_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 || _props$setEditorApi.call(props, _api);
553
570
  if (props.editorProps.editorActions) {
554
571
  // @ts-expect-error
555
- props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
572
+ props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = _api;
556
573
  }
557
574
  _this.eventDispatcher = new _eventDispatcher.EventDispatcher();
558
575
  _this.dispatch = (0, _eventDispatcher.createDispatch)(_this.eventDispatcher);
@@ -642,7 +659,7 @@ var ReactEditorView = exports.ReactEditorView = /*#__PURE__*/function (_React$Co
642
659
  }
643
660
  });
644
661
  if (!nextProps.editorProps.disabled && nextProps.editorProps.shouldFocus) {
645
- this.focusTimeoutId = handleEditorFocus(this.view, this.getViewMode());
662
+ this.focusTimeoutId = handleEditorFocus(this.view);
646
663
  }
647
664
  }
648
665
  var appearance = this.props.editorProps.appearance;
package/dist/cjs/index.js CHANGED
@@ -130,6 +130,12 @@ Object.defineProperty(exports, "WithHelpTrigger", {
130
130
  return _WithHelpTrigger.default;
131
131
  }
132
132
  });
133
+ Object.defineProperty(exports, "createEditorContentStyle", {
134
+ enumerable: true,
135
+ get: function get() {
136
+ return _ContentStyles.createEditorContentStyle;
137
+ }
138
+ });
133
139
  Object.defineProperty(exports, "getNodesCount", {
134
140
  enumerable: true,
135
141
  get: function get() {
@@ -178,6 +184,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
178
184
  var _utils = require("./utils");
179
185
  var _actions = _interopRequireDefault(require("./actions"));
180
186
  var _portalProvider = require("@atlaskit/editor-common/portal-provider");
187
+ var _ContentStyles = require("./ui/ContentStyles");
181
188
  // [ED-22843] use FF in editor-core for sake of example
182
189
 
183
190
  // Used in products integration code
@@ -93,12 +93,24 @@ Object.defineProperty(exports, "addColumnAfter", {
93
93
  return _keymaps.addColumnAfter;
94
94
  }
95
95
  });
96
+ Object.defineProperty(exports, "addColumnAfterVO", {
97
+ enumerable: true,
98
+ get: function get() {
99
+ return _keymaps.addColumnAfterVO;
100
+ }
101
+ });
96
102
  Object.defineProperty(exports, "addColumnBefore", {
97
103
  enumerable: true,
98
104
  get: function get() {
99
105
  return _keymaps.addColumnBefore;
100
106
  }
101
107
  });
108
+ Object.defineProperty(exports, "addColumnBeforeVO", {
109
+ enumerable: true,
110
+ get: function get() {
111
+ return _keymaps.addColumnBeforeVO;
112
+ }
113
+ });
102
114
  Object.defineProperty(exports, "addInlineComment", {
103
115
  enumerable: true,
104
116
  get: function get() {
@@ -117,12 +129,24 @@ Object.defineProperty(exports, "addRowAfter", {
117
129
  return _keymaps.addRowAfter;
118
130
  }
119
131
  });
132
+ Object.defineProperty(exports, "addRowAfterVO", {
133
+ enumerable: true,
134
+ get: function get() {
135
+ return _keymaps.addRowAfterVO;
136
+ }
137
+ });
120
138
  Object.defineProperty(exports, "addRowBefore", {
121
139
  enumerable: true,
122
140
  get: function get() {
123
141
  return _keymaps.addRowBefore;
124
142
  }
125
143
  });
144
+ Object.defineProperty(exports, "addRowBeforeVO", {
145
+ enumerable: true,
146
+ get: function get() {
147
+ return _keymaps.addRowBeforeVO;
148
+ }
149
+ });
126
150
  Object.defineProperty(exports, "alignCenter", {
127
151
  enumerable: true,
128
152
  get: function get() {
@@ -145,10 +145,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
145
145
  event.stopPropagation();
146
146
  };
147
147
  var primaryToolbarComponents = primaryToolbarComponentsProp;
148
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.primary-toolbar-ordering')) {
149
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
150
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
151
- }
148
+ if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
149
+ primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
152
150
  }
153
151
  return (0, _react2.jsx)(_WithFlash.default, {
154
152
  animate: maxContentSizeReached
@@ -342,10 +340,8 @@ var EditorNext = function EditorNext(props) {
342
340
  event.stopPropagation();
343
341
  }, [editorView]);
344
342
  var primaryToolbarComponents = primaryToolbarComponentsProp;
345
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.primary-toolbar-ordering')) {
346
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
347
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
348
- }
343
+ if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
344
+ primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
349
345
  }
350
346
  return (0, _react2.jsx)(_WithFlash.default, {
351
347
  animate: maxContentSizeReached
@@ -12,7 +12,6 @@ var _react2 = require("@emotion/react");
12
12
  var _hooks = require("@atlaskit/editor-common/hooks");
13
13
  var _ui = require("@atlaskit/editor-common/ui");
14
14
  var _utils = require("@atlaskit/editor-common/utils");
15
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
15
  var _context = require("../../../presets/context");
17
16
  var _FullPageContentArea = require("./FullPageContentArea");
18
17
  var _FullPageToolbar = require("./FullPageToolbar");
@@ -62,10 +61,8 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
62
61
  editorViewModeState = _useSharedPluginState.editorViewModeState,
63
62
  primaryToolbarState = _useSharedPluginState.primaryToolbarState;
64
63
  var primaryToolbarComponents = props.primaryToolbarComponents;
65
- if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.primary-toolbar-ordering')) {
66
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
67
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
68
- }
64
+ if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
65
+ primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
69
66
  }
70
67
  var isEditorToolbarHidden = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
71
68
  return (0, _react2.jsx)(_ui.ContextPanelWidthProvider, null, (0, _react2.jsx)("div", {
@@ -11,11 +11,14 @@ var _adfSchema = require("@atlaskit/adf-schema");
11
11
  var _commonStyles = require("@atlaskit/editor-plugins/table/ui/common-styles");
12
12
  var _consts = require("@atlaskit/editor-plugins/table/ui/consts");
13
13
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _ContentStyles = require("../../ContentStyles");
15
16
  var _styles = require("../../styles");
16
17
  var _ProseMirror;
17
18
  var SWOOP_ANIMATION = "0.5s ".concat(_editorSharedStyles.akEditorSwoopCubicBezier);
18
- var TOTAL_PADDING = _editorSharedStyles.akEditorGutterPadding * 2;
19
+ var getTotalPadding = function getTotalPadding() {
20
+ return (0, _editorSharedStyles.akEditorGutterPaddingDynamic)() * 2;
21
+ };
19
22
  var fullPageEditorWrapper = exports.fullPageEditorWrapper = (0, _react.css)({
20
23
  minWidth: '340px',
21
24
  height: '100%',
@@ -83,7 +86,7 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle(c
83
86
  return (0, _react.css)({
84
87
  '.fabric-editor--full-width-mode': {
85
88
  '.code-block, .extension-container': {
86
- maxWidth: "".concat(containerWidth - TOTAL_PADDING - _consts.tableMarginFullWidthMode * 2, "px")
89
+ maxWidth: "".concat(containerWidth - getTotalPadding() - _consts.tableMarginFullWidthMode * 2, "px")
87
90
  },
88
91
  '.extension-container.inline': {
89
92
  maxWidth: '100%'
@@ -92,10 +95,10 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle(c
92
95
  maxWidth: 'inherit'
93
96
  },
94
97
  '.multiBodiedExtension--container': {
95
- maxWidth: "".concat(containerWidth - TOTAL_PADDING - _consts.tableMarginFullWidthMode * 2, "px")
98
+ maxWidth: "".concat(containerWidth - getTotalPadding() - _consts.tableMarginFullWidthMode * 2, "px")
96
99
  },
97
100
  '[data-layout-section]': {
98
- maxWidth: "".concat(containerWidth - TOTAL_PADDING + _editorSharedStyles.akLayoutGutterOffset * 2, "px")
101
+ maxWidth: "".concat(containerWidth - getTotalPadding() + _editorSharedStyles.akLayoutGutterOffset * 2, "px")
99
102
  }
100
103
  }
101
104
  });
@@ -108,7 +111,8 @@ var editorContentAreaStyle = exports.editorContentAreaStyle = function editorCon
108
111
  };
109
112
  var editorContentAreaWithLayoutWith = function editorContentAreaWithLayoutWith(layoutMaxWidth) {
110
113
  return (0, _react.css)({
111
- maxWidth: "".concat(layoutMaxWidth + TOTAL_PADDING, "px")
114
+ // this restricts max width
115
+ maxWidth: "".concat(layoutMaxWidth + getTotalPadding(), "px")
112
116
  });
113
117
  };
114
118
  var editorContentArea = (0, _react.css)({
@@ -120,7 +124,7 @@ var editorContentArea = (0, _react.css)({
120
124
  margin: 'auto',
121
125
  flexDirection: 'column',
122
126
  flexGrow: 1,
123
- maxWidth: "".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth + TOTAL_PADDING, "px"),
127
+ maxWidth: "".concat(_editorSharedStyles.akEditorFullWidthLayoutWidth + getTotalPadding(), "px"),
124
128
  transition: "max-width ".concat(SWOOP_ANIMATION),
125
129
  '& .ProseMirror': (_ProseMirror = {
126
130
  flexGrow: 1,
@@ -147,5 +151,6 @@ var editorContentArea = (0, _react.css)({
147
151
  });
148
152
  var editorContentGutterStyle = exports.editorContentGutterStyle = (0, _react.css)({
149
153
  boxSizing: 'border-box',
150
- padding: "0 ".concat("var(--ds-space-400, 32px)")
154
+ padding: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.core.increase-full-page-guttering') ? // there is no space token for 52px
155
+ "0 52px" : "0 ".concat("var(--ds-space-400, 32px)")
151
156
  });
@@ -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 = "193.24.18";
8
+ var version = exports.version = "193.24.20";
@@ -11,6 +11,7 @@ import { EDIT_AREA_ID } from '@atlaskit/editor-common/ui';
11
11
  import { analyticsEventKey, browser, countNodes, getAnalyticsEventSeverity, getResponseEndTime, measureRender, processRawValue, shouldForceTracking, startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
12
12
  import { EditorState, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
14
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
14
15
  import { createDispatch, EventDispatcher } from '../event-dispatcher';
15
16
  import { getNodesCount } from '../utils/document';
16
17
  import { isFullPage } from '../utils/is-full-page';
@@ -27,7 +28,7 @@ import { createSchema } from './create-schema';
27
28
  import { createFeatureFlagsFromProps } from './feature-flags-from-props';
28
29
  import { editorMessages } from './messages';
29
30
  import ReactEditorViewContext from './ReactEditorViewContext';
30
- function handleEditorFocus(view, viewMode) {
31
+ function handleEditorFocus(view) {
31
32
  if (view.hasFocus()) {
32
33
  return;
33
34
  }
@@ -39,12 +40,6 @@ function handleEditorFocus(view, viewMode) {
39
40
  view.focus();
40
41
  return;
41
42
  }
42
- if (viewMode === 'view') {
43
- const emptySelection = new TextSelection(view.state.doc.resolve(0));
44
- const tr = view.state.tr.setSelection(emptySelection);
45
- view.dispatch(tr);
46
- return;
47
- }
48
43
  const domSelection = window.getSelection();
49
44
  if (!domSelection || domSelection.rangeCount === 0) {
50
45
  view.focus();
@@ -114,11 +109,6 @@ export class ReactEditorView extends React.Component {
114
109
  return (_this$view = this.view) === null || _this$view === void 0 ? void 0 : _this$view.state;
115
110
  });
116
111
  _defineProperty(this, "getEditorView", () => this.view);
117
- _defineProperty(this, "getViewMode", () => {
118
- var _editorApi$editorView;
119
- const editorApi = this.pluginInjectionAPI.api();
120
- return (_editorApi$editorView = editorApi.editorViewMode) === null || _editorApi$editorView === void 0 ? void 0 : _editorApi$editorView.sharedState.currentState().mode;
121
- });
122
112
  _defineProperty(this, "formatFullWidthAppearance", appearance => {
123
113
  if (appearance === 'full-width') {
124
114
  return FULL_WIDTH_MODE.FULL_WIDTH;
@@ -172,6 +162,7 @@ export class ReactEditorView extends React.Component {
172
162
  });
173
163
  _defineProperty(this, "editorPlugins", []);
174
164
  _defineProperty(this, "createEditorState", options => {
165
+ var _api$editorViewMode;
175
166
  let schema;
176
167
  if (this.view) {
177
168
  if (options.resetting) {
@@ -220,18 +211,44 @@ export class ReactEditorView extends React.Component {
220
211
  if (options.doc) {
221
212
  doc = processRawValue(schema, options.doc, options.props.providerFactory, options.props.editorProps.sanitizePrivateContent, this.contentTransformer, this.dispatchAnalyticsEvent);
222
213
  }
214
+ const api = this.pluginInjectionAPI.api();
215
+ const isViewMode = (api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState().mode) === 'view';
223
216
  let selection;
224
- if (doc) {
225
- selection = options.selectionAtStart ? Selection.atStart(doc) : Selection.atEnd(doc);
217
+ if (getBooleanFF('platform.editor.live-view.no-editor-selection-in-view-mode')) {
218
+ if (doc) {
219
+ if (isViewMode) {
220
+ const emptySelection = new TextSelection(doc.resolve(0));
221
+ return EditorState.create({
222
+ schema,
223
+ plugins: plugins,
224
+ doc,
225
+ selection: emptySelection
226
+ });
227
+ } else {
228
+ selection = options.selectionAtStart ? Selection.atStart(doc) : Selection.atEnd(doc);
229
+ }
230
+ }
231
+ // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
232
+ const patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
233
+ return EditorState.create({
234
+ schema,
235
+ plugins: plugins,
236
+ doc,
237
+ selection: patchedSelection
238
+ });
239
+ } else {
240
+ if (doc) {
241
+ selection = options.selectionAtStart ? Selection.atStart(doc) : Selection.atEnd(doc);
242
+ }
243
+ // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
244
+ const patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
245
+ return EditorState.create({
246
+ schema,
247
+ plugins: plugins,
248
+ doc,
249
+ selection: patchedSelection
250
+ });
226
251
  }
227
- // Workaround for ED-3507: When media node is the last element, scrollIntoView throws an error
228
- const patchedSelection = selection ? Selection.findFrom(selection.$head, -1, true) || undefined : undefined;
229
- return EditorState.create({
230
- schema,
231
- plugins: plugins,
232
- doc,
233
- selection: patchedSelection
234
- });
235
252
  });
236
253
  _defineProperty(this, "onEditorViewStateUpdated", ({
237
254
  originalTransaction,
@@ -458,7 +475,7 @@ export class ReactEditorView extends React.Component {
458
475
  transformer: this.contentTransformer
459
476
  });
460
477
  if (this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
461
- this.focusTimeoutId = handleEditorFocus(view, this.getViewMode());
478
+ this.focusTimeoutId = handleEditorFocus(view);
462
479
  }
463
480
  if (this.featureFlags.ufo) {
464
481
  this.experienceStore = ExperienceStore.getInstance(view);
@@ -544,11 +561,11 @@ export class ReactEditorView extends React.Component {
544
561
  getEditorState: this.getEditorState,
545
562
  getEditorView: this.getEditorView
546
563
  });
547
- const api = this.pluginInjectionAPI.api();
548
- (_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 ? void 0 : _props$setEditorApi.call(props, api);
564
+ const _api = this.pluginInjectionAPI.api();
565
+ (_props$setEditorApi = props.setEditorApi) === null || _props$setEditorApi === void 0 ? void 0 : _props$setEditorApi.call(props, _api);
549
566
  if (props.editorProps.editorActions) {
550
567
  // @ts-expect-error
551
- props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = api;
568
+ props.editorProps.editorActions.__EDITOR_INTERNALS_DO_NOT_USE__API = _api;
552
569
  }
553
570
  this.eventDispatcher = new EventDispatcher();
554
571
  this.dispatch = createDispatch(this.eventDispatcher);
@@ -594,7 +611,7 @@ export class ReactEditorView extends React.Component {
594
611
  editable: _state => !nextProps.editorProps.disabled
595
612
  });
596
613
  if (!nextProps.editorProps.disabled && nextProps.editorProps.shouldFocus) {
597
- this.focusTimeoutId = handleEditorFocus(this.view, this.getViewMode());
614
+ this.focusTimeoutId = handleEditorFocus(this.view);
598
615
  }
599
616
  }
600
617
  const {
@@ -59,4 +59,5 @@ const ignoreFunction = () => {
59
59
  // eslint-disable-next-line @atlaskit/platform/no-invalid-feature-flag-usage, @atlaskit/platform/ensure-feature-flag-prefix
60
60
  getBooleanFF('__live-view-toggle');
61
61
  return;
62
- };
62
+ };
63
+ export { createEditorContentStyle } from './ui/ContentStyles';
@@ -1 +1 @@
1
- export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, deleteColumn, deleteRow, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, cut, copy, paste, altPaste, find, alignCenter, alignLeft, alignRight, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
1
+ export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, addRowBeforeVO, addRowAfterVO, addColumnAfterVO, addColumnBeforeVO, deleteColumn, deleteRow, moveColumnLeft, moveColumnRight, moveRowDown, moveRowUp, cut, copy, paste, altPaste, find, alignCenter, alignLeft, alignRight, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
@@ -124,10 +124,8 @@ class Editor extends React.Component {
124
124
  event.stopPropagation();
125
125
  };
126
126
  let primaryToolbarComponents = primaryToolbarComponentsProp;
127
- if (getBooleanFF('platform.editor.primary-toolbar-ordering')) {
128
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
129
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
130
- }
127
+ if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
128
+ primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
131
129
  }
132
130
  return jsx(WithFlash, {
133
131
  animate: maxContentSizeReached
@@ -312,10 +310,8 @@ const EditorNext = props => {
312
310
  event.stopPropagation();
313
311
  }, [editorView]);
314
312
  let primaryToolbarComponents = primaryToolbarComponentsProp;
315
- if (getBooleanFF('platform.editor.primary-toolbar-ordering')) {
316
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
317
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
318
- }
313
+ if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
314
+ primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
319
315
  }
320
316
  return jsx(WithFlash, {
321
317
  animate: maxContentSizeReached
@@ -4,7 +4,6 @@ import { jsx } from '@emotion/react';
4
4
  import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
5
5
  import { ContextPanelWidthProvider } from '@atlaskit/editor-common/ui';
6
6
  import { browser } from '@atlaskit/editor-common/utils';
7
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
7
  import { usePresetContext } from '../../../presets/context';
9
8
  import { FullPageContentArea } from './FullPageContentArea';
10
9
  import { FullPageToolbar } from './FullPageToolbar';
@@ -44,10 +43,8 @@ export const FullPageEditor = props => {
44
43
  primaryToolbarState
45
44
  } = useSharedPluginState(editorAPI, ['editorViewMode', 'primaryToolbar']);
46
45
  let primaryToolbarComponents = props.primaryToolbarComponents;
47
- if (getBooleanFF('platform.editor.primary-toolbar-ordering')) {
48
- if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
49
- primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
50
- }
46
+ if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
47
+ primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
51
48
  }
52
49
  const isEditorToolbarHidden = (editorViewModeState === null || editorViewModeState === void 0 ? void 0 : editorViewModeState.mode) === 'view';
53
50
  return jsx(ContextPanelWidthProvider, null, jsx("div", {