@atlaskit/editor-core 205.3.2 → 205.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 205.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#142098](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142098)
8
+ [`e84b542ba2d44`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e84b542ba2d44) -
9
+ [ED-27614] Put quick insert placeholder behind a separate
10
+ FGplatform_editor_quick_insert_placeholder
11
+ - Updated dependencies
12
+
13
+ ## 205.4.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#141575](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141575)
18
+ [`53faa261e39a6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/53faa261e39a6) -
19
+ Adds support for overriding language names in the code block language list.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 205.3.2
4
26
 
5
27
  ### Patch Changes
@@ -17,6 +17,7 @@ var _analytics2 = require("@atlaskit/editor-common/utils/analytics");
17
17
  var _model = require("@atlaskit/editor-prosemirror/model");
18
18
  var _state = require("@atlaskit/editor-prosemirror/state");
19
19
  var _utils = require("@atlaskit/editor-prosemirror/utils");
20
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
21
  var _action = require("../utils/action");
21
22
  var _deprecationWarnings = _interopRequireDefault(require("../utils/deprecation-warnings"));
22
23
  var _nodesByLocalIds = require("../utils/nodes-by-localIds");
@@ -188,11 +189,21 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
188
189
  }, {
189
190
  key: "focus",
190
191
  value: function focus() {
192
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
193
+ scrollIntoView: true
194
+ },
195
+ scrollIntoView = _ref2.scrollIntoView;
191
196
  if (!this.editorView || this.editorView.hasFocus()) {
192
197
  return false;
193
198
  }
194
199
  this.editorView.focus();
195
- this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
200
+ if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
201
+ if (scrollIntoView !== null && scrollIntoView !== void 0 ? scrollIntoView : true) {
202
+ this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
203
+ }
204
+ } else {
205
+ this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
206
+ }
196
207
  return true;
197
208
  }
198
209
  }, {
@@ -55,7 +55,7 @@ var focusElementOutsideEditor = function focusElementOutsideEditor() {
55
55
  }
56
56
  };
57
57
  function ReactEditorView(props) {
58
- var _pluginInjectionAPI$c, _media, _linking, _props$render, _props$render2;
58
+ var _pluginInjectionAPI$c, _media, _linking, _document$querySelect, _props$render, _props$render2;
59
59
  var preset = props.preset,
60
60
  _props$editorProps = props.editorProps,
61
61
  nextAppearance = _props$editorProps.appearance,
@@ -497,20 +497,46 @@ function ReactEditorView(props) {
497
497
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
498
498
  editorView = _useState4[0],
499
499
  setEditorView = _useState4[1];
500
+ var originalScrollToRestore = _react.default.useRef((0, _isFullPage.isFullPage)(props.editorProps.appearance) && (0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start') ? (_document$querySelect = document.querySelector('[data-editor-scroll-container]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.scrollTop : undefined);
501
+ var mitigateScrollJump =
502
+ // The feature gate here is being used to avoid potential bugs with the scroll restoration code
503
+ // moving it to the end of the expression negates the point of the feature gate
504
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
505
+ (0, _isFullPage.isFullPage)(props.editorProps.appearance) && (0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start') && originalScrollToRestore.current && originalScrollToRestore.current !== 0;
500
506
  (0, _react.useLayoutEffect)(function () {
501
507
  var _editorView$props$edi, _editorView$props;
502
508
  if (shouldFocus && editorView !== null && editorView !== void 0 && (_editorView$props$edi = (_editorView$props = editorView.props).editable) !== null && _editorView$props$edi !== void 0 && _editorView$props$edi.call(_editorView$props, editorView.state) && (0, _platformFeatureFlags.fg)('platform_editor_react_18_autofocus_fix')) {
503
- var liveDocWithContent = __livePage && !(0, _document.isEmptyDocument)(editorView.state.doc);
504
- if (liveDocWithContent && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init')) {
505
- focusElementOutsideEditor();
509
+ if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
510
+ if (!mitigateScrollJump) {
511
+ var liveDocWithContent = __livePage && !(0, _document.isEmptyDocument)(editorView.state.doc);
512
+ if (liveDocWithContent && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init')) {
513
+ focusElementOutsideEditor();
514
+ } else {
515
+ focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(editorView);
516
+ }
517
+ }
506
518
  } else {
507
- focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(editorView);
519
+ var _liveDocWithContent = __livePage && !(0, _document.isEmptyDocument)(editorView.state.doc);
520
+ if (_liveDocWithContent && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init')) {
521
+ focusElementOutsideEditor();
522
+ } else {
523
+ focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(editorView);
524
+ }
508
525
  }
509
526
  }
510
- }, [editorView, shouldFocus, __livePage]);
527
+ }, [editorView, shouldFocus, __livePage, mitigateScrollJump]);
511
528
  var handleEditorViewRef = (0, _react.useCallback)(function (node) {
512
529
  if (!viewRef.current && node) {
513
530
  var view = createEditorView(node);
531
+ if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
532
+ if (mitigateScrollJump) {
533
+ var scrollElement = document.querySelector('[data-editor-scroll-container]');
534
+ scrollElement === null || scrollElement === void 0 || scrollElement.scrollTo({
535
+ top: originalScrollToRestore.current,
536
+ behavior: 'instant'
537
+ });
538
+ }
539
+ }
514
540
  onEditorCreated({
515
541
  view: view,
516
542
  config: config.current,
@@ -532,9 +558,20 @@ function ReactEditorView(props) {
532
558
  setEditorView(view);
533
559
  });
534
560
  } else {
535
- var isLivePageWithContent = __livePage && !(0, _document.isEmptyDocument)(view.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
536
- if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
537
- focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(view);
561
+ if (shouldFocus && view.props.editable && view.props.editable(view.state)) {
562
+ if ((0, _platformFeatureFlags.fg)('platform_editor_reduce_scroll_jump_on_editor_start')) {
563
+ if (!mitigateScrollJump) {
564
+ var isLivePageWithContent = __livePage && !(0, _document.isEmptyDocument)(view.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
565
+ if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
566
+ focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(view);
567
+ }
568
+ }
569
+ } else {
570
+ var _isLivePageWithContent = __livePage && !(0, _document.isEmptyDocument)(view.state.doc) && (0, _platformFeatureFlags.fg)('platform_editor_no_cursor_on_live_doc_init');
571
+ if (!_isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
572
+ focusTimeoutId.current = (0, _handleEditorFocus.handleEditorFocus)(view);
573
+ }
574
+ }
538
575
  }
539
576
 
540
577
  // Force React to re-render so consumers get a reference to the editor view
@@ -562,7 +599,7 @@ function ReactEditorView(props) {
562
599
  }
563
600
  viewRef.current = undefined;
564
601
  }
565
- }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent]);
602
+ }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent, mitigateScrollJump]);
566
603
  var createEditor = (0, _react.useCallback)(function (assistiveLabel, assistiveDescribedBy) {
567
604
  return /*#__PURE__*/_react.default.createElement("div", {
568
605
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -156,7 +156,7 @@ var akEditorBreakpointForSmallDevice = "1266px";
156
156
  var contentStyles = function contentStyles(props) {
157
157
  return (0, _react2.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t", "\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\t", "\n\t", "\n\t", "\n\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), _editorSharedStyles.akEditorGutterPadding, (0, _editorSharedStyles.akEditorGutterPaddingDynamic)(), _editorSharedStyles.akEditorDefaultLayoutWidth, _editorSharedStyles.akEditorFullWidthLayoutWidth, _editorSharedStyles.akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, _editorSharedStyles.akEditorCalculatedWideLayoutWidth, (0, _editorSharedStyles.editorFontSize)({
158
158
  theme: props.theme
159
- }), _styles.whitespaceSharedStyles, (0, _styles.paragraphSharedStyles)(props.typographyTheme), _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('editor_request_to_edit_task') ? null : (0, _react2.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_3') ? placeholderWrapStyles : null, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(props.typographyTheme), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), (0, _media.mediaStyles)(), (0, _layout.layoutStyles)(props.viewMode), _collab.telepointerStyle, _selection.gapCursorStyles, (0, _panel2.panelStyles)(), mentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
159
+ }), _styles.whitespaceSharedStyles, (0, _styles.paragraphSharedStyles)(props.typographyTheme), _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, (0, _platformFeatureFlags.fg)('editor_request_to_edit_task') ? null : (0, _react2.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), (0, _platformFeatureFlags.fg)('platform_editor_hide_cursor_when_pm_hideselection') ? (0, _react2.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, (0, _experiments.editorExperiment)('platform_editor_advanced_code_blocks', true) ? (0, _react2.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(props.typographyTheme), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), (0, _media.mediaStyles)(), (0, _layout.layoutStyles)(props.viewMode), _collab.telepointerStyle, _selection.gapCursorStyles, (0, _panel2.panelStyles)(), mentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
160
160
  exposure: false
161
161
  }) && vanillaMentionsStyles, (0, _experiments.editorExperiment)('platform_editor_vanilla_dom', true, {
162
162
  exposure: false
@@ -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 = "205.3.2";
8
+ var version = exports.version = "205.4.1";
@@ -6,6 +6,7 @@ import { analyticsEventKey } from '@atlaskit/editor-common/utils/analytics';
6
6
  import { Node } from '@atlaskit/editor-prosemirror/model';
7
7
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { findParentNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { getEditorValueWithMedia } from '../utils/action';
10
11
  import deprecationWarnings from '../utils/deprecation-warnings';
11
12
  import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
@@ -130,12 +131,22 @@ export default class EditorActions {
130
131
  }
131
132
  //#endregion
132
133
 
133
- focus() {
134
+ focus({
135
+ scrollIntoView
136
+ } = {
137
+ scrollIntoView: true
138
+ }) {
134
139
  if (!this.editorView || this.editorView.hasFocus()) {
135
140
  return false;
136
141
  }
137
142
  this.editorView.focus();
138
- this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
143
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
144
+ if (scrollIntoView !== null && scrollIntoView !== void 0 ? scrollIntoView : true) {
145
+ this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
146
+ }
147
+ } else {
148
+ this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
149
+ }
139
150
  return true;
140
151
  }
141
152
  blur() {
@@ -40,7 +40,7 @@ const focusElementOutsideEditor = () => {
40
40
  }
41
41
  };
42
42
  export function ReactEditorView(props) {
43
- var _pluginInjectionAPI$c, _pluginInjectionAPI$c2, _pluginInjectionAPI$c3, _media, _linking, _linking$smartLinks, _props$render, _props$render2;
43
+ var _pluginInjectionAPI$c, _pluginInjectionAPI$c2, _pluginInjectionAPI$c3, _media, _linking, _linking$smartLinks, _document$querySelect, _props$render, _props$render2;
44
44
  const {
45
45
  preset,
46
46
  editorProps: {
@@ -467,20 +467,46 @@ export function ReactEditorView(props) {
467
467
  return view;
468
468
  }, [getDirectEditorProps, dispatchAnalyticsEvent]);
469
469
  const [editorView, setEditorView] = useState(undefined);
470
+ const originalScrollToRestore = React.useRef(isFullPage(props.editorProps.appearance) && fg('platform_editor_reduce_scroll_jump_on_editor_start') ? (_document$querySelect = document.querySelector('[data-editor-scroll-container]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.scrollTop : undefined);
471
+ const mitigateScrollJump =
472
+ // The feature gate here is being used to avoid potential bugs with the scroll restoration code
473
+ // moving it to the end of the expression negates the point of the feature gate
474
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
475
+ isFullPage(props.editorProps.appearance) && fg('platform_editor_reduce_scroll_jump_on_editor_start') && originalScrollToRestore.current && originalScrollToRestore.current !== 0;
470
476
  useLayoutEffect(() => {
471
477
  var _editorView$props$edi, _editorView$props;
472
478
  if (shouldFocus && editorView !== null && editorView !== void 0 && (_editorView$props$edi = (_editorView$props = editorView.props).editable) !== null && _editorView$props$edi !== void 0 && _editorView$props$edi.call(_editorView$props, editorView.state) && fg('platform_editor_react_18_autofocus_fix')) {
473
- const liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
474
- if (liveDocWithContent && fg('platform_editor_no_cursor_on_live_doc_init')) {
475
- focusElementOutsideEditor();
479
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
480
+ if (!mitigateScrollJump) {
481
+ const liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
482
+ if (liveDocWithContent && fg('platform_editor_no_cursor_on_live_doc_init')) {
483
+ focusElementOutsideEditor();
484
+ } else {
485
+ focusTimeoutId.current = handleEditorFocus(editorView);
486
+ }
487
+ }
476
488
  } else {
477
- focusTimeoutId.current = handleEditorFocus(editorView);
489
+ const liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
490
+ if (liveDocWithContent && fg('platform_editor_no_cursor_on_live_doc_init')) {
491
+ focusElementOutsideEditor();
492
+ } else {
493
+ focusTimeoutId.current = handleEditorFocus(editorView);
494
+ }
478
495
  }
479
496
  }
480
- }, [editorView, shouldFocus, __livePage]);
497
+ }, [editorView, shouldFocus, __livePage, mitigateScrollJump]);
481
498
  const handleEditorViewRef = useCallback(node => {
482
499
  if (!viewRef.current && node) {
483
500
  const view = createEditorView(node);
501
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
502
+ if (mitigateScrollJump) {
503
+ const scrollElement = document.querySelector('[data-editor-scroll-container]');
504
+ scrollElement === null || scrollElement === void 0 ? void 0 : scrollElement.scrollTo({
505
+ top: originalScrollToRestore.current,
506
+ behavior: 'instant'
507
+ });
508
+ }
509
+ }
484
510
  onEditorCreated({
485
511
  view,
486
512
  config: config.current,
@@ -500,9 +526,20 @@ export function ReactEditorView(props) {
500
526
  setEditorView(view);
501
527
  });
502
528
  } else {
503
- const isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
504
- if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
505
- focusTimeoutId.current = handleEditorFocus(view);
529
+ if (shouldFocus && view.props.editable && view.props.editable(view.state)) {
530
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
531
+ if (!mitigateScrollJump) {
532
+ const isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
533
+ if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
534
+ focusTimeoutId.current = handleEditorFocus(view);
535
+ }
536
+ }
537
+ } else {
538
+ const isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
539
+ if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
540
+ focusTimeoutId.current = handleEditorFocus(view);
541
+ }
542
+ }
506
543
  }
507
544
 
508
545
  // Force React to re-render so consumers get a reference to the editor view
@@ -530,7 +567,7 @@ export function ReactEditorView(props) {
530
567
  }
531
568
  viewRef.current = undefined;
532
569
  }
533
- }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent]);
570
+ }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent, mitigateScrollJump]);
534
571
  const createEditor = useCallback((assistiveLabel, assistiveDescribedBy) => {
535
572
  return /*#__PURE__*/React.createElement("div", {
536
573
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -407,7 +407,7 @@ const contentStyles = props => css`
407
407
  ${placeholderTextStyles}
408
408
  ${placeholderStyles}
409
409
  ${editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null}
410
- ${editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3') ? placeholderWrapStyles : null}
410
+ ${editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null}
411
411
 
412
412
  ${codeBlockStyles()}
413
413
 
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "205.3.2";
2
+ export const version = "205.4.1";
@@ -10,6 +10,7 @@ import { analyticsEventKey } from '@atlaskit/editor-common/utils/analytics';
10
10
  import { Node } from '@atlaskit/editor-prosemirror/model';
11
11
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { findParentNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
13
+ import { fg } from '@atlaskit/platform-feature-flags';
13
14
  import { getEditorValueWithMedia } from '../utils/action';
14
15
  import deprecationWarnings from '../utils/deprecation-warnings';
15
16
  import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
@@ -182,11 +183,21 @@ var EditorActions = /*#__PURE__*/function () {
182
183
  }, {
183
184
  key: "focus",
184
185
  value: function focus() {
186
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
187
+ scrollIntoView: true
188
+ },
189
+ scrollIntoView = _ref2.scrollIntoView;
185
190
  if (!this.editorView || this.editorView.hasFocus()) {
186
191
  return false;
187
192
  }
188
193
  this.editorView.focus();
189
- this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
194
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
195
+ if (scrollIntoView !== null && scrollIntoView !== void 0 ? scrollIntoView : true) {
196
+ this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
197
+ }
198
+ } else {
199
+ this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
200
+ }
190
201
  return true;
191
202
  }
192
203
  }, {
@@ -44,7 +44,7 @@ var focusElementOutsideEditor = function focusElementOutsideEditor() {
44
44
  }
45
45
  };
46
46
  export function ReactEditorView(props) {
47
- var _pluginInjectionAPI$c, _media, _linking, _props$render, _props$render2;
47
+ var _pluginInjectionAPI$c, _media, _linking, _document$querySelect, _props$render, _props$render2;
48
48
  var preset = props.preset,
49
49
  _props$editorProps = props.editorProps,
50
50
  nextAppearance = _props$editorProps.appearance,
@@ -486,20 +486,46 @@ export function ReactEditorView(props) {
486
486
  _useState4 = _slicedToArray(_useState3, 2),
487
487
  editorView = _useState4[0],
488
488
  setEditorView = _useState4[1];
489
+ var originalScrollToRestore = React.useRef(isFullPage(props.editorProps.appearance) && fg('platform_editor_reduce_scroll_jump_on_editor_start') ? (_document$querySelect = document.querySelector('[data-editor-scroll-container]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.scrollTop : undefined);
490
+ var mitigateScrollJump =
491
+ // The feature gate here is being used to avoid potential bugs with the scroll restoration code
492
+ // moving it to the end of the expression negates the point of the feature gate
493
+ // eslint-disable-next-line @atlaskit/platform/no-preconditioning
494
+ isFullPage(props.editorProps.appearance) && fg('platform_editor_reduce_scroll_jump_on_editor_start') && originalScrollToRestore.current && originalScrollToRestore.current !== 0;
489
495
  useLayoutEffect(function () {
490
496
  var _editorView$props$edi, _editorView$props;
491
497
  if (shouldFocus && editorView !== null && editorView !== void 0 && (_editorView$props$edi = (_editorView$props = editorView.props).editable) !== null && _editorView$props$edi !== void 0 && _editorView$props$edi.call(_editorView$props, editorView.state) && fg('platform_editor_react_18_autofocus_fix')) {
492
- var liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
493
- if (liveDocWithContent && fg('platform_editor_no_cursor_on_live_doc_init')) {
494
- focusElementOutsideEditor();
498
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
499
+ if (!mitigateScrollJump) {
500
+ var liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
501
+ if (liveDocWithContent && fg('platform_editor_no_cursor_on_live_doc_init')) {
502
+ focusElementOutsideEditor();
503
+ } else {
504
+ focusTimeoutId.current = handleEditorFocus(editorView);
505
+ }
506
+ }
495
507
  } else {
496
- focusTimeoutId.current = handleEditorFocus(editorView);
508
+ var _liveDocWithContent = __livePage && !isEmptyDocument(editorView.state.doc);
509
+ if (_liveDocWithContent && fg('platform_editor_no_cursor_on_live_doc_init')) {
510
+ focusElementOutsideEditor();
511
+ } else {
512
+ focusTimeoutId.current = handleEditorFocus(editorView);
513
+ }
497
514
  }
498
515
  }
499
- }, [editorView, shouldFocus, __livePage]);
516
+ }, [editorView, shouldFocus, __livePage, mitigateScrollJump]);
500
517
  var handleEditorViewRef = useCallback(function (node) {
501
518
  if (!viewRef.current && node) {
502
519
  var view = createEditorView(node);
520
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
521
+ if (mitigateScrollJump) {
522
+ var scrollElement = document.querySelector('[data-editor-scroll-container]');
523
+ scrollElement === null || scrollElement === void 0 || scrollElement.scrollTo({
524
+ top: originalScrollToRestore.current,
525
+ behavior: 'instant'
526
+ });
527
+ }
528
+ }
503
529
  onEditorCreated({
504
530
  view: view,
505
531
  config: config.current,
@@ -521,9 +547,20 @@ export function ReactEditorView(props) {
521
547
  setEditorView(view);
522
548
  });
523
549
  } else {
524
- var isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
525
- if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
526
- focusTimeoutId.current = handleEditorFocus(view);
550
+ if (shouldFocus && view.props.editable && view.props.editable(view.state)) {
551
+ if (fg('platform_editor_reduce_scroll_jump_on_editor_start')) {
552
+ if (!mitigateScrollJump) {
553
+ var isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
554
+ if (!isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
555
+ focusTimeoutId.current = handleEditorFocus(view);
556
+ }
557
+ }
558
+ } else {
559
+ var _isLivePageWithContent = __livePage && !isEmptyDocument(view.state.doc) && fg('platform_editor_no_cursor_on_live_doc_init');
560
+ if (!_isLivePageWithContent && shouldFocus && view.props.editable && view.props.editable(view.state)) {
561
+ focusTimeoutId.current = handleEditorFocus(view);
562
+ }
563
+ }
527
564
  }
528
565
 
529
566
  // Force React to re-render so consumers get a reference to the editor view
@@ -551,7 +588,7 @@ export function ReactEditorView(props) {
551
588
  }
552
589
  viewRef.current = undefined;
553
590
  }
554
- }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent]);
591
+ }, [createEditorView, onEditorCreated, eventDispatcher, shouldFocus, __livePage, onEditorDestroyed, handleAnalyticsEvent, mitigateScrollJump]);
555
592
  var createEditor = useCallback(function (assistiveLabel, assistiveDescribedBy) {
556
593
  return /*#__PURE__*/React.createElement("div", {
557
594
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -148,7 +148,7 @@ var akEditorBreakpointForSmallDevice = "1266px";
148
148
  var contentStyles = function contentStyles(props) {
149
149
  return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n\t--ak-editor--default-gutter-padding: ", "px;\n\t/* 52 is from akEditorGutterPaddingDynamic via editor-shared-styles */\n\t--ak-editor--large-gutter-padding: ", "px;\n\t--ak-editor--default-layout-width: ", "px;\n\t--ak-editor--full-width-layout-width: ", "px;\n\t/* calculate editor line length, 100cqw is the editor container width */\n\t--ak-editor--line-length: min(\n\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\tvar(--ak-editor--default-layout-width)\n\t);\n\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t--ak-editor--breakout-full-page-guttering-padding: calc(\n\t\tvar(--ak-editor--large-gutter-padding) * 2 + var(--ak-editor--default-gutter-padding)\n\t);\n\n\t.fabric-editor--full-width-mode {\n\t\t--ak-editor--line-length: min(\n\t\t\tcalc(100cqw - var(--ak-editor--large-gutter-padding) * 2),\n\t\t\tvar(--ak-editor--full-width-layout-width)\n\t\t);\n\t}\n\n\t.ProseMirror {\n\t\t--ak-editor-max-container-width: calc(100cqw - var(--ak-editor--large-gutter-padding));\n\t}\n\n\t/* We can't allow nodes that are inside other nodes to bleed from the parent container */\n\t.ProseMirror > div[data-prosemirror-node-block] [data-prosemirror-node-block] {\n\t\t--ak-editor-max-container-width: 100%;\n\t}\n\n\t/* container editor-area is defined in platform/packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts */\n\t@container editor-area (width >= ", ") {\n\t\t.ProseMirror {\n\t\t\t--ak-editor--breakout-wide-layout-width: ", "px;\n\t\t}\n\t}\n\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t", "\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t/**\n\t * This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24\n\t *\n\t * 1. Merge and Release platform_editor_hide_cursor_when_pm_hideselection\n\t * 2. Cleanup duplicated style from platform_editor_advanced_code_blocks\n\t * https://product-fabric.atlassian.net/browse/ED-26331\n\t */\n\t", "\n\n\t/* This prosemirror css style: https://github.com/ProseMirror/prosemirror-view/blob/f37ebb29befdbde3cd194fe13fe17b78e743d2f2/style/prosemirror.css#L24 */\n\t", "\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t.ProseMirror.ProseMirror-focused:has(.ProseMirror-mark-boundary-cursor) {\n\t\tcaret-color: transparent;\n\t}\n\t.ProseMirror:not(.ProseMirror-focused) .ProseMirror-mark-boundary-cursor {\n\t\tdisplay: none;\n\t}\n\n\t", "\n\t", "\n\t", "\n\t", "\n\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n\t", "\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n // Switch between the two icons based on the visual refresh feature gate\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Legacy Link icon in the Atlaskit package\n is bigger than the others, new ADS icon does not have this issue\n */\n\t", "\n"])), akEditorGutterPadding, akEditorGutterPaddingDynamic(), akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorCalculatedWideLayoutWidthSmallViewport, akEditorBreakpointForSmallDevice, akEditorCalculatedWideLayoutWidth, editorFontSize({
150
150
  theme: props.theme
151
- }), whitespaceSharedStyles, paragraphSharedStyles(props.typographyTheme), listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, fg('editor_request_to_edit_task') ? null : css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, editorExperiment('platform_editor_advanced_code_blocks', true) ? css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_3') ? placeholderWrapStyles : null, codeBlockStyles(), blocktypeStyles(props.typographyTheme), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles(), listsStyles, ruleStyles(), mediaStyles(), layoutStyles(props.viewMode), telepointerStyle, gapCursorStyles, panelStyles(), mentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
151
+ }), whitespaceSharedStyles, paragraphSharedStyles(props.typographyTheme), listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, fg('editor_request_to_edit_task') ? null : css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\topacity: 0.7;\n\t\t\t\t}\n\t\t\t"]))), fg('platform_editor_hide_cursor_when_pm_hideselection') ? css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, editorExperiment('platform_editor_advanced_code_blocks', true) ? css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n\t\t\t\t.ProseMirror-hideselection {\n\t\t\t\t\tcaret-color: transparent;\n\t\t\t\t}\n\t\t\t"]))) : null, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, editorExperiment('platform_editor_controls', 'variant1') ? placeholderOverflowStyles : null, editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_quick_insert_placeholder') ? placeholderWrapStyles : null, codeBlockStyles(), blocktypeStyles(props.typographyTheme), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles(), listsStyles, ruleStyles(), mediaStyles(), layoutStyles(props.viewMode), telepointerStyle, gapCursorStyles, panelStyles(), mentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
152
152
  exposure: false
153
153
  }) && vanillaMentionsStyles, editorExperiment('platform_editor_vanilla_dom', true, {
154
154
  exposure: false
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "205.3.2";
2
+ export var version = "205.4.1";
@@ -26,7 +26,9 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
26
26
  _privateUnregisterEditor(): void;
27
27
  _privateSubscribe(cb: ContextUpdateHandler): void;
28
28
  _privateUnsubscribe(cb: ContextUpdateHandler): void;
29
- focus(): boolean;
29
+ focus({ scrollIntoView }?: {
30
+ scrollIntoView: boolean;
31
+ }): boolean;
30
32
  blur(): boolean;
31
33
  clear(): boolean;
32
34
  /**
@@ -610,11 +610,31 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
610
610
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
611
611
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
612
612
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
613
- }, import("@atlaskit/editor-plugins/analytics").AnalyticsPluginOptions>>];
613
+ }, import("@atlaskit/editor-plugins/analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"blockControls", {
614
+ dependencies: import("packages/editor/editor-plugin-block-controls/dist/types/blockControlsPluginType").BlockControlsPluginDependencies;
615
+ sharedState: import("@atlaskit/editor-plugins/block-controls").BlockControlsSharedState;
616
+ commands: {
617
+ moveToLayout: (start: number, to: number, options?: {
618
+ moveToEnd?: boolean | undefined;
619
+ selectMovedNode?: boolean | undefined;
620
+ moveNodeAtCursorPos?: boolean | undefined;
621
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
622
+ moveNode: import("packages/editor/editor-plugin-block-controls/dist/types/blockControlsPluginType").MoveNode;
623
+ showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: import("@atlaskit/editor-plugins/block-controls").HandleOptions, rootPos?: number | undefined, rootAnchorName?: string | undefined, rootNodeType?: string | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
624
+ toggleBlockMenu: (options?: {
625
+ closeMenu?: boolean | undefined;
626
+ anchorName?: string | undefined;
627
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
628
+ setNodeDragged: (getPos: () => number | undefined, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
629
+ setMultiSelectPositions: (anchor?: number | undefined, head?: number | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
630
+ setSelectedViaDragHandle: (isSelectedViaDragHandle?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
631
+ };
632
+ }, undefined>>];
614
633
  actions?: {
615
634
  suppressToolbar?: (() => boolean) | undefined;
616
635
  unsuppressToolbar?: (() => boolean) | undefined;
617
636
  setToolbarDocking?: ((toolbarDocking: import("packages/editor/editor-plugin-selection-toolbar/dist/types/types").ToolbarDocking) => boolean) | undefined;
637
+ refreshToolbarDocking?: (() => boolean) | undefined;
618
638
  } | undefined;
619
639
  }, import("packages/editor/editor-plugin-selection-toolbar/dist/types").SelectionToolbarPluginOptions>>];
620
640
  commands: {
@@ -671,11 +691,31 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
671
691
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
672
692
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
673
693
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
674
- }, import("@atlaskit/editor-plugins/analytics").AnalyticsPluginOptions>>];
694
+ }, import("@atlaskit/editor-plugins/analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"blockControls", {
695
+ dependencies: import("packages/editor/editor-plugin-block-controls/dist/types/blockControlsPluginType").BlockControlsPluginDependencies;
696
+ sharedState: import("@atlaskit/editor-plugins/block-controls").BlockControlsSharedState;
697
+ commands: {
698
+ moveToLayout: (start: number, to: number, options?: {
699
+ moveToEnd?: boolean | undefined;
700
+ selectMovedNode?: boolean | undefined;
701
+ moveNodeAtCursorPos?: boolean | undefined;
702
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
703
+ moveNode: import("packages/editor/editor-plugin-block-controls/dist/types/blockControlsPluginType").MoveNode;
704
+ showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: import("@atlaskit/editor-plugins/block-controls").HandleOptions, rootPos?: number | undefined, rootAnchorName?: string | undefined, rootNodeType?: string | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
705
+ toggleBlockMenu: (options?: {
706
+ closeMenu?: boolean | undefined;
707
+ anchorName?: string | undefined;
708
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
709
+ setNodeDragged: (getPos: () => number | undefined, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
710
+ setMultiSelectPositions: (anchor?: number | undefined, head?: number | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
711
+ setSelectedViaDragHandle: (isSelectedViaDragHandle?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
712
+ };
713
+ }, undefined>>];
675
714
  actions?: {
676
715
  suppressToolbar?: (() => boolean) | undefined;
677
716
  unsuppressToolbar?: (() => boolean) | undefined;
678
717
  setToolbarDocking?: ((toolbarDocking: import("packages/editor/editor-plugin-selection-toolbar/dist/types/types").ToolbarDocking) => boolean) | undefined;
718
+ refreshToolbarDocking?: (() => boolean) | undefined;
679
719
  } | undefined;
680
720
  }, import("packages/editor/editor-plugin-selection-toolbar/dist/types").SelectionToolbarPluginOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"clearMarksOnEmptyDoc", {}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"blockType", {
681
721
  pluginConfiguration: import("@atlaskit/editor-plugins/block-type").BlockTypePluginOptions | undefined;
@@ -734,11 +774,31 @@ export declare function createUniversalPreset({ props, prevProps, initialPluginC
734
774
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
735
775
  }, import("@atlaskit/editor-common/types").FeatureFlags>>];
736
776
  actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
737
- }, import("@atlaskit/editor-plugins/analytics").AnalyticsPluginOptions>>];
777
+ }, import("@atlaskit/editor-plugins/analytics").AnalyticsPluginOptions>>, import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"blockControls", {
778
+ dependencies: import("packages/editor/editor-plugin-block-controls/dist/types/blockControlsPluginType").BlockControlsPluginDependencies;
779
+ sharedState: import("@atlaskit/editor-plugins/block-controls").BlockControlsSharedState;
780
+ commands: {
781
+ moveToLayout: (start: number, to: number, options?: {
782
+ moveToEnd?: boolean | undefined;
783
+ selectMovedNode?: boolean | undefined;
784
+ moveNodeAtCursorPos?: boolean | undefined;
785
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
786
+ moveNode: import("packages/editor/editor-plugin-block-controls/dist/types/blockControlsPluginType").MoveNode;
787
+ showDragHandleAt: (pos: number, anchorName: string, nodeType: string, handleOptions?: import("@atlaskit/editor-plugins/block-controls").HandleOptions, rootPos?: number | undefined, rootAnchorName?: string | undefined, rootNodeType?: string | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
788
+ toggleBlockMenu: (options?: {
789
+ closeMenu?: boolean | undefined;
790
+ anchorName?: string | undefined;
791
+ } | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
792
+ setNodeDragged: (getPos: () => number | undefined, anchorName: string, nodeType: string) => import("@atlaskit/editor-common/types").EditorCommand;
793
+ setMultiSelectPositions: (anchor?: number | undefined, head?: number | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
794
+ setSelectedViaDragHandle: (isSelectedViaDragHandle?: boolean | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
795
+ };
796
+ }, undefined>>];
738
797
  actions?: {
739
798
  suppressToolbar?: (() => boolean) | undefined;
740
799
  unsuppressToolbar?: (() => boolean) | undefined;
741
800
  setToolbarDocking?: ((toolbarDocking: import("packages/editor/editor-plugin-selection-toolbar/dist/types/types").ToolbarDocking) => boolean) | undefined;
801
+ refreshToolbarDocking?: (() => boolean) | undefined;
742
802
  } | undefined;
743
803
  }, import("packages/editor/editor-plugin-selection-toolbar/dist/types").SelectionToolbarPluginOptions>>];
744
804
  sharedState: import("@atlaskit/editor-plugins/block-type").BlockTypeState | undefined;