@atlaskit/editor-common 103.19.1 → 103.21.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 103.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#142736](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142736)
8
+ [`0ec12ef9f6524`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0ec12ef9f6524) -
9
+ [ux] scrollToPos function added to the core plugin. It can be accessed via
10
+ editorAPI.core.actions.scrollToPos().
11
+
12
+ ## 103.20.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#146198](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146198)
17
+ [`86a786e83342d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/86a786e83342d) -
18
+ ED-27730 update layout analytics to include layout column count
19
+
20
+ ### Patch Changes
21
+
22
+ - [#146359](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146359)
23
+ [`cb179949b078a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cb179949b078a) -
24
+ Migrate media to use useSharedPluginStateSelector
25
+ - [#147618](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147618)
26
+ [`3069d34098b9e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3069d34098b9e) -
27
+ Fix image size difference during SSR
28
+ - [#147467](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/147467)
29
+ [`cce4ef288b918`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cce4ef288b918) -
30
+ [EDITOR-633] Fire document failedToInsert event when media inline fails to be inserted
31
+
3
32
  ## 103.19.1
4
33
 
5
34
  ### Patch Changes
@@ -64,6 +64,7 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
64
64
  ACTION["ERRORED"] = "errored";
65
65
  ACTION["EXPOSED"] = "exposed";
66
66
  ACTION["FAILED_TO_UNMOUNT"] = "failedToUnmount";
67
+ ACTION["FAILED_TO_INSERT"] = "failedToInsert";
67
68
  ACTION["FIND_NEXT_PERFORMED"] = "findNextPerformed";
68
69
  ACTION["FIND_PERFORMED"] = "findPerformed";
69
70
  ACTION["FIND_PREV_PERFORMED"] = "findPrevPerformed";
@@ -116,7 +116,9 @@ function useSharedPluginStateSelector(api, plugin) {
116
116
  }
117
117
  function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState) {
118
118
  var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
119
- var _useState = (0, _react.useState)(initialState),
119
+ var _useState = (0, _react.useState)(function () {
120
+ return initialState;
121
+ }),
120
122
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
121
123
  selectedPluginState = _useState2[0],
122
124
  setSelectedPluginState = _useState2[1];
@@ -124,7 +126,9 @@ function useSharedPluginStateSelectorInternal(api, plugins, transformer, initial
124
126
  // `pluginStates`: This is the same type through inference - but typescript doesn't recognise them as they are computed slightly differently
125
127
  var transformedValue = transformer(pluginStates);
126
128
  if (!(0, _isEqual.default)(transformedValue, selectedPluginState)) {
127
- setSelectedPluginState(transformedValue);
129
+ setSelectedPluginState(function () {
130
+ return transformedValue;
131
+ });
128
132
  }
129
133
  }, options);
130
134
  return selectedPluginState;
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "103.19.1";
20
+ var packageVersion = "103.21.0";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // Ignored via go/ees007
@@ -54,6 +54,29 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
54
54
  editorView.dom.blur();
55
55
  return true;
56
56
  },
57
+ scrollToPos: function scrollToPos(pos, scrollOptions) {
58
+ var editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
59
+ if (!editorView) {
60
+ return false;
61
+ }
62
+ var tr = editorView.state.tr;
63
+ var isValidPos = typeof pos === 'number' && pos >= 0 && pos <= tr.doc.content.size;
64
+ if (!isValidPos) {
65
+ return false;
66
+ }
67
+ var dom = editorView.domAtPos(pos).node;
68
+ if (!(dom instanceof Element)) {
69
+ // If it's not an element (e.g. #text node), we'll try the parent.
70
+ // This is expected to cover most of the scenarios, if not, window.scrollTo is an alternative
71
+ if (dom.parentNode instanceof Element) {
72
+ dom.parentNode.scrollIntoView(scrollOptions);
73
+ return true;
74
+ }
75
+ return false;
76
+ }
77
+ dom.scrollIntoView(scrollOptions);
78
+ return true;
79
+ },
57
80
  replaceDocument: function replaceDocument(replaceValue, options) {
58
81
  var editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
59
82
  if (!editorView || replaceValue === undefined || replaceValue === null) {
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "103.19.1";
26
+ var packageVersion = "103.21.0";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  // Ignored via go/ees005
@@ -16,6 +16,7 @@ var _react = _interopRequireDefault(require("react"));
16
16
  var _react2 = require("@emotion/react");
17
17
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
18
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
+ var _isSsr = require("../../core-utils/is-ssr");
19
20
  var _utils = require("../../utils");
20
21
  var _breakout = require("../../utils/breakout");
21
22
  var _excluded = ["children"];
@@ -201,7 +202,7 @@ var MediaSingleDimensionHelper = exports.MediaSingleDimensionHelper = function M
201
202
  '@container view-page-content (min-width: 1px)': {
202
203
  maxWidth: '100cqw'
203
204
  }
204
- }) : '', calculatedMaxWidth, isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
205
+ }) : '', (0, _isSsr.isSSR)() && (0, _platformFeatureFlags.fg)('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(calculatedWidth, calculatedMaxWidth) : calculatedMaxWidth, isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : _utils.nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
205
206
  };
206
207
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
207
208
  var hasFallbackContainer = _ref2.hasFallbackContainer,
@@ -58,6 +58,7 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
58
58
  ACTION["ERRORED"] = "errored";
59
59
  ACTION["EXPOSED"] = "exposed";
60
60
  ACTION["FAILED_TO_UNMOUNT"] = "failedToUnmount";
61
+ ACTION["FAILED_TO_INSERT"] = "failedToInsert";
61
62
  ACTION["FIND_NEXT_PERFORMED"] = "findNextPerformed";
62
63
  ACTION["FIND_PERFORMED"] = "findPerformed";
63
64
  ACTION["FIND_PREV_PERFORMED"] = "findPrevPerformed";
@@ -100,12 +100,12 @@ export function useSharedPluginStateSelector(api, plugin, options = {}) {
100
100
  return useSharedPluginStateSelectorInternal(api, pluginNameArray, transformer, initialState, options);
101
101
  }
102
102
  function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState, options = {}) {
103
- const [selectedPluginState, setSelectedPluginState] = useState(initialState);
103
+ const [selectedPluginState, setSelectedPluginState] = useState(() => initialState);
104
104
  usePluginStateEffect(api, plugins, pluginStates => {
105
105
  // `pluginStates`: This is the same type through inference - but typescript doesn't recognise them as they are computed slightly differently
106
106
  const transformedValue = transformer(pluginStates);
107
107
  if (!isEqual(transformedValue, selectedPluginState)) {
108
- setSelectedPluginState(transformedValue);
108
+ setSelectedPluginState(() => transformedValue);
109
109
  }
110
110
  }, options);
111
111
  return selectedPluginState;
@@ -1,7 +1,7 @@
1
1
  import { isFedRamp } from './environment';
2
2
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
3
3
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
4
- const packageVersion = "103.19.1";
4
+ const packageVersion = "103.21.0";
5
5
  const sanitiseSentryEvents = (data, _hint) => {
6
6
  // Remove URL as it has UGC
7
7
  // Ignored via go/ees007
@@ -52,6 +52,29 @@ export const corePlugin = ({
52
52
  editorView.dom.blur();
53
53
  return true;
54
54
  },
55
+ scrollToPos(pos, scrollOptions) {
56
+ const editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
57
+ if (!editorView) {
58
+ return false;
59
+ }
60
+ const tr = editorView.state.tr;
61
+ const isValidPos = typeof pos === 'number' && pos >= 0 && pos <= tr.doc.content.size;
62
+ if (!isValidPos) {
63
+ return false;
64
+ }
65
+ const dom = editorView.domAtPos(pos).node;
66
+ if (!(dom instanceof Element)) {
67
+ // If it's not an element (e.g. #text node), we'll try the parent.
68
+ // This is expected to cover most of the scenarios, if not, window.scrollTo is an alternative
69
+ if (dom.parentNode instanceof Element) {
70
+ dom.parentNode.scrollIntoView(scrollOptions);
71
+ return true;
72
+ }
73
+ return false;
74
+ }
75
+ dom.scrollIntoView(scrollOptions);
76
+ return true;
77
+ },
55
78
  replaceDocument: (replaceValue, options) => {
56
79
  const editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
57
80
  if (!editorView || replaceValue === undefined || replaceValue === null) {
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
13
13
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import Layer from '../Layer';
15
15
  const packageName = "@atlaskit/editor-common";
16
- const packageVersion = "103.19.1";
16
+ const packageVersion = "103.21.0";
17
17
  const halfFocusRing = 1;
18
18
  const dropOffset = '0, 8';
19
19
  // Ignored via go/ees005
@@ -9,6 +9,7 @@ import React from 'react';
9
9
  import { css, jsx } from '@emotion/react';
10
10
  import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { isSSR } from '../../core-utils/is-ssr';
12
13
  import { nonWrappedLayouts } from '../../utils';
13
14
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
14
15
  function float(layout) {
@@ -192,7 +193,7 @@ export const MediaSingleDimensionHelper = ({
192
193
  }
193
194
  }) : ''}
194
195
  /* If container doesn't exists, it will fallback to this */
195
- max-width: ${calculatedMaxWidth};
196
+ max-width: ${isSSR() && fg('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(calculatedWidth, calculatedMaxWidth) : calculatedMaxWidth};
196
197
  ${isExtendedResizeExperienceOn && `&[class*='is-resizing'] {
197
198
  .new-file-experience-wrapper {
198
199
  box-shadow: none !important;
@@ -58,6 +58,7 @@ export var ACTION = /*#__PURE__*/function (ACTION) {
58
58
  ACTION["ERRORED"] = "errored";
59
59
  ACTION["EXPOSED"] = "exposed";
60
60
  ACTION["FAILED_TO_UNMOUNT"] = "failedToUnmount";
61
+ ACTION["FAILED_TO_INSERT"] = "failedToInsert";
61
62
  ACTION["FIND_NEXT_PERFORMED"] = "findNextPerformed";
62
63
  ACTION["FIND_PERFORMED"] = "findPerformed";
63
64
  ACTION["FIND_PREV_PERFORMED"] = "findPrevPerformed";
@@ -110,7 +110,9 @@ export function useSharedPluginStateSelector(api, plugin) {
110
110
  }
111
111
  function useSharedPluginStateSelectorInternal(api, plugins, transformer, initialState) {
112
112
  var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
113
- var _useState = useState(initialState),
113
+ var _useState = useState(function () {
114
+ return initialState;
115
+ }),
114
116
  _useState2 = _slicedToArray(_useState, 2),
115
117
  selectedPluginState = _useState2[0],
116
118
  setSelectedPluginState = _useState2[1];
@@ -118,7 +120,9 @@ function useSharedPluginStateSelectorInternal(api, plugins, transformer, initial
118
120
  // `pluginStates`: This is the same type through inference - but typescript doesn't recognise them as they are computed slightly differently
119
121
  var transformedValue = transformer(pluginStates);
120
122
  if (!isEqual(transformedValue, selectedPluginState)) {
121
- setSelectedPluginState(transformedValue);
123
+ setSelectedPluginState(function () {
124
+ return transformedValue;
125
+ });
122
126
  }
123
127
  }, options);
124
128
  return selectedPluginState;
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
7
7
  import { isFedRamp } from './environment';
8
8
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
9
9
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
10
- var packageVersion = "103.19.1";
10
+ var packageVersion = "103.21.0";
11
11
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
12
12
  // Remove URL as it has UGC
13
13
  // Ignored via go/ees007
@@ -49,6 +49,29 @@ export var corePlugin = function corePlugin(_ref) {
49
49
  editorView.dom.blur();
50
50
  return true;
51
51
  },
52
+ scrollToPos: function scrollToPos(pos, scrollOptions) {
53
+ var editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
54
+ if (!editorView) {
55
+ return false;
56
+ }
57
+ var tr = editorView.state.tr;
58
+ var isValidPos = typeof pos === 'number' && pos >= 0 && pos <= tr.doc.content.size;
59
+ if (!isValidPos) {
60
+ return false;
61
+ }
62
+ var dom = editorView.domAtPos(pos).node;
63
+ if (!(dom instanceof Element)) {
64
+ // If it's not an element (e.g. #text node), we'll try the parent.
65
+ // This is expected to cover most of the scenarios, if not, window.scrollTo is an alternative
66
+ if (dom.parentNode instanceof Element) {
67
+ dom.parentNode.scrollIntoView(scrollOptions);
68
+ return true;
69
+ }
70
+ return false;
71
+ }
72
+ dom.scrollIntoView(scrollOptions);
73
+ return true;
74
+ },
52
75
  replaceDocument: function replaceDocument(replaceValue, options) {
53
76
  var editorView = config === null || config === void 0 ? void 0 : config.getEditorView();
54
77
  if (!editorView || replaceValue === undefined || replaceValue === null) {
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
20
20
  import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import Layer from '../Layer';
22
22
  var packageName = "@atlaskit/editor-common";
23
- var packageVersion = "103.19.1";
23
+ var packageVersion = "103.21.0";
24
24
  var halfFocusRing = 1;
25
25
  var dropOffset = '0, 8';
26
26
  // Ignored via go/ees005
@@ -13,6 +13,7 @@ import React from 'react';
13
13
  import { css, jsx } from '@emotion/react';
14
14
  import { akEditorDefaultLayoutWidth, akEditorFullPageMaxWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
+ import { isSSR } from '../../core-utils/is-ssr';
16
17
  import { nonWrappedLayouts } from '../../utils';
17
18
  import { calcBreakoutWidth, calcWideWidth } from '../../utils/breakout';
18
19
  function float(layout) {
@@ -191,7 +192,7 @@ export var MediaSingleDimensionHelper = function MediaSingleDimensionHelper(_ref
191
192
  '@container view-page-content (min-width: 1px)': {
192
193
  maxWidth: '100cqw'
193
194
  }
194
- }) : '', calculatedMaxWidth, isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
195
+ }) : '', isSSR() && fg('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(calculatedWidth, calculatedMaxWidth) : calculatedMaxWidth, isExtendedResizeExperienceOn && "&[class*='is-resizing'] {\n .new-file-experience-wrapper {\n box-shadow: none !important;\n }\n\n ".concat(!isNestedNode && nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", "\n }"), float(layout), calcMargin(layout), isNestedNode ? /* Make nested node appear responsive when resizing table cell */"max-width: 100%;" : nonWrappedLayouts.includes(layout) && "margin-left: 50%;\n transform: translateX(-50%);", isImageAligned(layout));
195
196
  };
196
197
  var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
197
198
  var hasFallbackContainer = _ref2.hasFallbackContainer,
@@ -57,6 +57,7 @@ export declare enum ACTION {
57
57
  ERRORED = "errored",
58
58
  EXPOSED = "exposed",
59
59
  FAILED_TO_UNMOUNT = "failedToUnmount",
60
+ FAILED_TO_INSERT = "failedToInsert",
60
61
  FIND_NEXT_PERFORMED = "findNextPerformed",
61
62
  FIND_PERFORMED = "findPerformed",
62
63
  FIND_PREV_PERFORMED = "findPrevPerformed",
@@ -1,7 +1,7 @@
1
1
  import type { ExtensionLayout, PanelType } from '@atlaskit/adf-schema';
2
2
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, INSERT_MEDIA_VIA } from './enums';
3
3
  import type { InsertSmartLinkAEP } from './smart-links';
4
- import type { InsertAEP, TrackAEP } from './utils';
4
+ import type { InsertAEP, TrackAEP, OperationalAEP } from './utils';
5
5
  export declare enum USER_CONTEXT {
6
6
  EDIT = "edit",
7
7
  NEW = "new"
@@ -108,6 +108,7 @@ type InsertLayoutAEP = InsertAEP<ACTION_SUBJECT_ID.LAYOUT, {
108
108
  inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.DRAG_AND_DROP;
109
109
  nodeTypes?: string;
110
110
  hasSelectedMultipleNodes?: boolean;
111
+ columnCount?: number;
111
112
  }, undefined>;
112
113
  export type InsertDateAEP = InsertAEP<ACTION_SUBJECT_ID.DATE, {
113
114
  inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.INLINE_SUGGESTION_FLOATING_TB;
@@ -135,5 +136,11 @@ type InsertNodeViaExtensionAPIAEP = InsertAEP<undefined, {
135
136
  type InsertPlaceholderTextAEP = InsertAEP<ACTION_SUBJECT_ID.PLACEHOLDER_TEXT, {
136
137
  inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU;
137
138
  }, undefined>;
138
- export type InsertEventPayload = InsertDividerAEP | InsertLineBreakAEP | InsertPanelAEP | InsertCodeBlockAEP | InsertTableAEP | InsertExpandAEP | InsertActionDecisionAEP | InsertEmojiAEP | InsertStatusAEP | InsertMediaSingleAEP | InsertMediaGroupAEP | InsertMediaInlineAEP | InsertLinkAEP | InsertLinkPreviewAEP | InsertMediaLinkAEP | InsertSmartLinkAEP | InsertLayoutAEP | InsertExtensionAEP | InsertNodeViaExtensionAPIAEP | InsertDateAEP | InsertPlaceholderTextAEP;
139
+ type FailedToInsertMediaPayload = OperationalAEP<ACTION.FAILED_TO_INSERT, ACTION_SUBJECT.DOCUMENT, ACTION_SUBJECT_ID.MEDIA_INLINE | ACTION_SUBJECT_ID.MEDIA_SINGLE | ACTION_SUBJECT_ID.MEDIA_GROUP, {
140
+ inputMethod?: InputMethodInsertMedia;
141
+ fileExtension?: string;
142
+ insertMediaVia?: InsertMediaVia;
143
+ reason?: string;
144
+ }>;
145
+ export type InsertEventPayload = InsertDividerAEP | InsertLineBreakAEP | InsertPanelAEP | InsertCodeBlockAEP | InsertTableAEP | InsertExpandAEP | InsertActionDecisionAEP | InsertEmojiAEP | InsertStatusAEP | InsertMediaSingleAEP | InsertMediaGroupAEP | InsertMediaInlineAEP | InsertLinkAEP | InsertLinkPreviewAEP | InsertMediaLinkAEP | InsertSmartLinkAEP | InsertLayoutAEP | InsertExtensionAEP | InsertNodeViaExtensionAPIAEP | InsertDateAEP | InsertPlaceholderTextAEP | FailedToInsertMediaPayload;
139
146
  export {};
@@ -50,6 +50,14 @@ export type CorePlugin = NextEditorPlugin<'core', {
50
50
  * @returns (boolean) if the blur was successful
51
51
  */
52
52
  blur: () => boolean;
53
+ /**
54
+ * Scroll to a specific position in the editor using native Element.scrollIntoView
55
+ *
56
+ * @param pos - Position number scroll to
57
+ * @param scrollOptions - [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
58
+ * @returns (boolean) if scroll was successful
59
+ */
60
+ scrollToPos: (pos: number, scrollOptions?: boolean | ScrollIntoViewOptions) => boolean;
53
61
  /**
54
62
  * Replaces the current content of the editor with the provided raw value.
55
63
  *
@@ -57,6 +57,7 @@ export declare enum ACTION {
57
57
  ERRORED = "errored",
58
58
  EXPOSED = "exposed",
59
59
  FAILED_TO_UNMOUNT = "failedToUnmount",
60
+ FAILED_TO_INSERT = "failedToInsert",
60
61
  FIND_NEXT_PERFORMED = "findNextPerformed",
61
62
  FIND_PERFORMED = "findPerformed",
62
63
  FIND_PREV_PERFORMED = "findPrevPerformed",
@@ -1,7 +1,7 @@
1
1
  import type { ExtensionLayout, PanelType } from '@atlaskit/adf-schema';
2
2
  import type { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, INSERT_MEDIA_VIA } from './enums';
3
3
  import type { InsertSmartLinkAEP } from './smart-links';
4
- import type { InsertAEP, TrackAEP } from './utils';
4
+ import type { InsertAEP, TrackAEP, OperationalAEP } from './utils';
5
5
  export declare enum USER_CONTEXT {
6
6
  EDIT = "edit",
7
7
  NEW = "new"
@@ -108,6 +108,7 @@ type InsertLayoutAEP = InsertAEP<ACTION_SUBJECT_ID.LAYOUT, {
108
108
  inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.DRAG_AND_DROP;
109
109
  nodeTypes?: string;
110
110
  hasSelectedMultipleNodes?: boolean;
111
+ columnCount?: number;
111
112
  }, undefined>;
112
113
  export type InsertDateAEP = InsertAEP<ACTION_SUBJECT_ID.DATE, {
113
114
  inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.INLINE_SUGGESTION_FLOATING_TB;
@@ -135,5 +136,11 @@ type InsertNodeViaExtensionAPIAEP = InsertAEP<undefined, {
135
136
  type InsertPlaceholderTextAEP = InsertAEP<ACTION_SUBJECT_ID.PLACEHOLDER_TEXT, {
136
137
  inputMethod: INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU;
137
138
  }, undefined>;
138
- export type InsertEventPayload = InsertDividerAEP | InsertLineBreakAEP | InsertPanelAEP | InsertCodeBlockAEP | InsertTableAEP | InsertExpandAEP | InsertActionDecisionAEP | InsertEmojiAEP | InsertStatusAEP | InsertMediaSingleAEP | InsertMediaGroupAEP | InsertMediaInlineAEP | InsertLinkAEP | InsertLinkPreviewAEP | InsertMediaLinkAEP | InsertSmartLinkAEP | InsertLayoutAEP | InsertExtensionAEP | InsertNodeViaExtensionAPIAEP | InsertDateAEP | InsertPlaceholderTextAEP;
139
+ type FailedToInsertMediaPayload = OperationalAEP<ACTION.FAILED_TO_INSERT, ACTION_SUBJECT.DOCUMENT, ACTION_SUBJECT_ID.MEDIA_INLINE | ACTION_SUBJECT_ID.MEDIA_SINGLE | ACTION_SUBJECT_ID.MEDIA_GROUP, {
140
+ inputMethod?: InputMethodInsertMedia;
141
+ fileExtension?: string;
142
+ insertMediaVia?: InsertMediaVia;
143
+ reason?: string;
144
+ }>;
145
+ export type InsertEventPayload = InsertDividerAEP | InsertLineBreakAEP | InsertPanelAEP | InsertCodeBlockAEP | InsertTableAEP | InsertExpandAEP | InsertActionDecisionAEP | InsertEmojiAEP | InsertStatusAEP | InsertMediaSingleAEP | InsertMediaGroupAEP | InsertMediaInlineAEP | InsertLinkAEP | InsertLinkPreviewAEP | InsertMediaLinkAEP | InsertSmartLinkAEP | InsertLayoutAEP | InsertExtensionAEP | InsertNodeViaExtensionAPIAEP | InsertDateAEP | InsertPlaceholderTextAEP | FailedToInsertMediaPayload;
139
146
  export {};
@@ -50,6 +50,14 @@ export type CorePlugin = NextEditorPlugin<'core', {
50
50
  * @returns (boolean) if the blur was successful
51
51
  */
52
52
  blur: () => boolean;
53
+ /**
54
+ * Scroll to a specific position in the editor using native Element.scrollIntoView
55
+ *
56
+ * @param pos - Position number scroll to
57
+ * @param scrollOptions - [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
58
+ * @returns (boolean) if scroll was successful
59
+ */
60
+ scrollToPos: (pos: number, scrollOptions?: boolean | ScrollIntoViewOptions) => boolean;
53
61
  /**
54
62
  * Replaces the current content of the editor with the provided raw value.
55
63
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "103.19.1",
3
+ "version": "103.21.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -156,10 +156,10 @@
156
156
  "@atlaskit/platform-feature-flags": "^1.1.0",
157
157
  "@atlaskit/popper": "^7.0.0",
158
158
  "@atlaskit/primitives": "^14.4.0",
159
- "@atlaskit/profilecard": "^23.9.0",
159
+ "@atlaskit/profilecard": "^23.10.0",
160
160
  "@atlaskit/react-ufo": "^3.9.0",
161
161
  "@atlaskit/section-message": "^8.2.0",
162
- "@atlaskit/smart-card": "^36.11.0",
162
+ "@atlaskit/smart-card": "^36.12.0",
163
163
  "@atlaskit/smart-user-picker": "^8.0.0",
164
164
  "@atlaskit/spinner": "^18.0.0",
165
165
  "@atlaskit/task-decision": "^19.2.0",
@@ -351,6 +351,9 @@
351
351
  "platform_editor_controls_table_picker": {
352
352
  "type": "boolean"
353
353
  },
354
+ "platform_editor_fix_image_size_diff_during_ssr": {
355
+ "type": "boolean"
356
+ },
354
357
  "platform_editor_replace_document_shortcircuit": {
355
358
  "type": "boolean"
356
359
  },