@atlaskit/editor-core 234.1.0 → 234.2.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/create-editor/ReactEditorView.js +1 -1
  3. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer-compiled.js +2 -6
  4. package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +1 -3
  5. package/dist/cjs/ui/EditorContentContainer/styles/extensionBreakoutStyles.js +1 -1
  6. package/dist/cjs/ui/quick-insert/ExtensionQuickInsertIcon.js +14 -8
  7. package/dist/cjs/ui/quick-insert/QuickInsertSkillMenuItem.js +72 -0
  8. package/dist/cjs/ui/quick-insert/getExtensionQuickInsertComponents.js +3 -1
  9. package/dist/cjs/version-wrapper.js +1 -1
  10. package/dist/es2019/create-editor/ReactEditorView.js +1 -1
  11. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer-compiled.js +2 -6
  12. package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +1 -3
  13. package/dist/es2019/ui/EditorContentContainer/styles/extensionBreakoutStyles.js +1 -1
  14. package/dist/es2019/ui/quick-insert/ExtensionQuickInsertIcon.js +12 -5
  15. package/dist/es2019/ui/quick-insert/QuickInsertSkillMenuItem.js +67 -0
  16. package/dist/es2019/ui/quick-insert/getExtensionQuickInsertComponents.js +3 -1
  17. package/dist/es2019/version-wrapper.js +1 -1
  18. package/dist/esm/create-editor/ReactEditorView.js +1 -1
  19. package/dist/esm/ui/EditorContentContainer/EditorContentContainer-compiled.js +2 -6
  20. package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +1 -3
  21. package/dist/esm/ui/EditorContentContainer/styles/extensionBreakoutStyles.js +1 -1
  22. package/dist/esm/ui/quick-insert/ExtensionQuickInsertIcon.js +14 -8
  23. package/dist/esm/ui/quick-insert/QuickInsertSkillMenuItem.js +64 -0
  24. package/dist/esm/ui/quick-insert/getExtensionQuickInsertComponents.js +3 -1
  25. package/dist/esm/version-wrapper.js +1 -1
  26. package/dist/types/ui/EditorContentContainer/EditorContentContainer-compiled.d.ts +0 -1
  27. package/dist/types/ui/EditorContentContainer/EditorContentContainer.d.ts +1 -3
  28. package/dist/types/ui/EditorContentContainer/styles/extensionBreakoutStyles.d.ts +1 -1
  29. package/dist/types/ui/quick-insert/ExtensionQuickInsertIcon.d.ts +2 -1
  30. package/dist/types/ui/quick-insert/QuickInsertSkillMenuItem.d.ts +13 -0
  31. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 234.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9474d3d4a1282`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9474d3d4a1282) -
8
+ Disable Editor scroll restoration behind `platform_editor_reduce_forced_layout`.
9
+ - Updated dependencies
10
+
11
+ ## 234.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`ef6d325af58d6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef6d325af58d6) -
16
+ Update i18n NPM package versions for editor,editor-extensions,activity-platform,media,elements
17
+ (Group 3)
18
+ - [`375d0ca074591`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/375d0ca074591) -
19
+ Unify Rovo Skill quick-insert construction across product Editors and AI Chat behind
20
+ `platform_editor_slash_command`. Add shared menu title and preview presentation options, and reuse
21
+ existing extension metadata for Skill icons, descriptions, attribution and Beta labels. Export the
22
+ shared Editor SkillTag for reuse across menus. Preserve shared insertion and Chat-specific
23
+ behavior.
24
+
25
+ ### Patch Changes
26
+
27
+ - [`bf2f598c788f8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf2f598c788f8) -
28
+ clean up feature flag platform_editor_core_static_css
29
+ - Updated dependencies
30
+
3
31
  ## 234.1.0
4
32
 
5
33
  ### Minor Changes
@@ -800,7 +800,7 @@ function ReactEditorView(props) {
800
800
 
801
801
  // Preconditioned on the affected population - full page, non nested editors - so that experiment
802
802
  // exposure is not diluted by editors which never run the scroll restoration code below.
803
- var scrollRestorePerfEnabled = !isNestedEditor.current && (0, _isFullPage.isFullPage)(props.editorProps.appearance) && (0, _isExperimentEnabled.isExperimentEnabled)('cc_editor_scroll_restore_perf_improvements');
803
+ var scrollRestorePerfEnabled = !isNestedEditor.current && (0, _isFullPage.isFullPage)(props.editorProps.appearance) || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_forced_layout');
804
804
  var originalScrollToRestore = _react.default.useRef(
805
805
  // Reading scrollTop forces a synchronous layout, and this expression is re-evaluated on every
806
806
  // render. Products restore scroll themselves after the document has rendered.
@@ -150,12 +150,8 @@ var borderSelectionStyles = null;
150
150
  var overflowShadowStyles = null;
151
151
 
152
152
  /**
153
- * editorContentStyles migrated styles from EditorContentContainer/styles,
154
- * the styles migration is under `platform_editor_core_static_css`,
155
- * this FF has a global tests override atm, while waiting for some fixes from compiled and atlaspack,
156
- * if you are making changes, please do VR/Integration test locally and individually by temporarily removing FF overrides from
157
- * packages/editor/editor-test-overrides/src/gemini-platform-feature-gate-overrides.ts, and
158
- * packages/editor/tmp-editor-statsig/src/exp-test-overrides.ts.
153
+ * editorContentStyles contains the Compiled CSS styles migrated from EditorContentContainer/styles.
154
+ * Validate style changes with local VR and integration tests.
159
155
  *
160
156
  * If you are not sure, please contact #proj-cc-editor-full-compiled-css-migration
161
157
  */
@@ -6,9 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _EditorContentContainerCompiled = require("./EditorContentContainer-compiled");
8
8
  /**
9
- * The emotion implementation has been removed as part of the
10
- * platform_editor_core_static_css cleanup — the compiled implementation is now
11
- * the only one. This module stays as the entry point so consumers keep
9
+ * This module exposes the Compiled implementation as the entry point so consumers keep
12
10
  * importing from `./EditorContentContainer`.
13
11
  */
14
12
  var EditorContentContainer = _EditorContentContainerCompiled.EditorContentContainerCompiled;
@@ -13,7 +13,7 @@ var _react = require("@emotion/react");
13
13
  var blockNodesVerticalMargin = '0.75rem';
14
14
 
15
15
  /**
16
- * @deprecated This style has been migrated to Compiled CSS, under experiment platform_editor_core_static_css
16
+ * @deprecated This style has been migrated to Compiled CSS.
17
17
  * If you need to make changes here, also update the corresponding style in
18
18
  * packages/editor/editor-core/src/ui/EditorContentContainer/EditorContentContainer-compiled.tsx
19
19
  * See EDITOR-7600 for more details: https://hello.jira.atlassian.cloud/jira/browse/EDITOR-7600
@@ -73,22 +73,27 @@ var createLazyExtensionIcon = function createLazyExtensionIcon(getIcon) {
73
73
  });
74
74
  });
75
75
  LazyIcon.displayName = 'lazy(ExtensionIcon)';
76
- var Icon = function Icon(props) {
76
+ var Icon = function Icon(_ref2) {
77
+ var label = _ref2.label,
78
+ size = _ref2.size;
77
79
  return /*#__PURE__*/_react.default.createElement(_react.default.Suspense, {
78
80
  fallback: /*#__PURE__*/_react.default.createElement(_apps.default, {
79
- label: props.label
81
+ label: label,
82
+ size: size
80
83
  })
81
84
  }, /*#__PURE__*/_react.default.createElement(LazyIcon, {
82
- label: props.label
85
+ label: label,
86
+ size: size
83
87
  }));
84
88
  };
85
89
  lazyExtensionIconCache.set(getIcon, Icon);
86
90
  return Icon;
87
91
  };
88
- var ExtensionQuickInsertIcon = exports.ExtensionQuickInsertIcon = function ExtensionQuickInsertIcon(_ref2) {
89
- var getIcon = _ref2.getIcon,
90
- itemKey = _ref2.itemKey,
91
- label = _ref2.label;
92
+ var ExtensionQuickInsertIcon = exports.ExtensionQuickInsertIcon = function ExtensionQuickInsertIcon(_ref3) {
93
+ var getIcon = _ref3.getIcon,
94
+ itemKey = _ref3.itemKey,
95
+ label = _ref3.label,
96
+ size = _ref3.size;
92
97
  var Icon = _react.default.useMemo(function () {
93
98
  var quickInsertItemIcon = quickInsertItemIcons[itemKey];
94
99
  if (quickInsertItemIcon) {
@@ -100,6 +105,7 @@ var ExtensionQuickInsertIcon = exports.ExtensionQuickInsertIcon = function Exten
100
105
  return getIcon ? createLazyExtensionIcon(getIcon) : _apps.default;
101
106
  }, [getIcon, itemKey]);
102
107
  return /*#__PURE__*/_react.default.createElement(Icon, {
103
- label: label
108
+ label: label,
109
+ size: size
104
110
  });
105
111
  };
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.QuickInsertSkillMenuItem = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _menuItem = require("@atlaskit/editor-common/quick-insert/menu-item");
10
+ var _skillTag = require("@atlaskit/editor-common/quick-insert/skill-tag");
11
+ var _useQuickInsertContext = require("@atlaskit/editor-common/quick-insert/use-quick-insert-context");
12
+ var _inline = require("@atlaskit/primitives/compiled/inline");
13
+ var _text = require("@atlaskit/primitives/compiled/text");
14
+ var _executeExtensionQuickInsertItem = require("./executeExtensionQuickInsertItem");
15
+ var _ExtensionQuickInsertIcon = require("./ExtensionQuickInsertIcon");
16
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
+ var QuickInsertSkillMenuItem = exports.QuickInsertSkillMenuItem = function QuickInsertSkillMenuItem(_ref) {
18
+ var apiRef = _ref.apiRef,
19
+ createAnalyticsEvent = _ref.createAnalyticsEvent,
20
+ editorActions = _ref.editorActions,
21
+ item = _ref.item,
22
+ onInsert = _ref.onInsert;
23
+ var _useQuickInsertContex = (0, _useQuickInsertContext.useQuickInsertContext)(),
24
+ editorView = _useQuickInsertContex.editorView,
25
+ isOffline = _useQuickInsertContex.isOffline;
26
+ var onSelect = (0, _react.useCallback)(function (_ref2) {
27
+ var insert = _ref2.insert,
28
+ source = _ref2.source;
29
+ var result = (0, _executeExtensionQuickInsertItem.executeExtensionQuickInsertItem)({
30
+ apiRef: apiRef,
31
+ createAnalyticsEvent: createAnalyticsEvent,
32
+ editorActions: editorActions,
33
+ insert: insert,
34
+ item: item,
35
+ source: source,
36
+ state: editorView.state
37
+ });
38
+ if (result) {
39
+ onInsert === null || onInsert === void 0 || onInsert();
40
+ }
41
+ return result;
42
+ }, [apiRef, createAnalyticsEvent, editorActions, editorView.state, item, onInsert]);
43
+ return /*#__PURE__*/_react.default.createElement(_menuItem.QuickInsertMenuItem, {
44
+ ariaLabel: item.title,
45
+ description: item.description,
46
+ iconBefore: /*#__PURE__*/_react.default.createElement(_ExtensionQuickInsertIcon.ExtensionQuickInsertIcon, {
47
+ getIcon: item.icon,
48
+ itemKey: item.key,
49
+ label: ""
50
+ }),
51
+ isDisabled: isOffline,
52
+ onSelect: onSelect,
53
+ preview: item.preview,
54
+ previewIcon: /*#__PURE__*/_react.default.createElement(_ExtensionQuickInsertIcon.ExtensionQuickInsertIcon, {
55
+ getIcon: item.icon,
56
+ itemKey: item.key,
57
+ label: "",
58
+ size: "small"
59
+ }),
60
+ shouldClampPreview: false,
61
+ title: item.title,
62
+ titleContent: /*#__PURE__*/_react.default.createElement(_inline.Inline, {
63
+ alignBlock: "center",
64
+ space: "space.100"
65
+ }, item.moduleKey ? /*#__PURE__*/_react.default.createElement(_skillTag.SkillTag, {
66
+ isDisabled: isOffline,
67
+ slug: item.moduleKey
68
+ }) : /*#__PURE__*/_react.default.createElement(_text.Text, {
69
+ color: isOffline ? 'color.text.disabled' : 'color.text'
70
+ }, item.title), item.lozenge)
71
+ });
72
+ };
@@ -14,6 +14,7 @@ var _getMenuItemParents = require("@atlaskit/editor-common/quick-insert/get-menu
14
14
  var _keys = require("@atlaskit/editor-common/quick-insert/keys");
15
15
  var _rank = require("@atlaskit/editor-common/quick-insert/rank");
16
16
  var _ExtensionQuickInsertMenuItem = require("./ExtensionQuickInsertMenuItem");
17
+ var _QuickInsertSkillMenuItem = require("./QuickInsertSkillMenuItem");
17
18
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
19
  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; }
19
20
  var structureExtensionItemKeyRanks = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
@@ -118,7 +119,8 @@ var getExtensionQuickInsertComponents = exports.getExtensionQuickInsertComponent
118
119
  };
119
120
  }),
120
121
  component: function component(props) {
121
- return /*#__PURE__*/_react.default.createElement(_ExtensionQuickInsertMenuItem.ExtensionQuickInsertMenuItem, {
122
+ var Component = item.extensionType === 'com.atlassian.rovo.skill' ? _QuickInsertSkillMenuItem.QuickInsertSkillMenuItem : _ExtensionQuickInsertMenuItem.ExtensionQuickInsertMenuItem;
123
+ return /*#__PURE__*/_react.default.createElement(Component, {
122
124
  apiRef: apiRef,
123
125
  createAnalyticsEvent: createAnalyticsEvent,
124
126
  editorActions: editorActions,
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
8
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
9
- var version = exports.version = "234.0.1";
9
+ var version = exports.version = "234.2.0";
@@ -748,7 +748,7 @@ export function ReactEditorView(props) {
748
748
 
749
749
  // Preconditioned on the affected population - full page, non nested editors - so that experiment
750
750
  // exposure is not diluted by editors which never run the scroll restoration code below.
751
- const scrollRestorePerfEnabled = !isNestedEditor.current && isFullPage(props.editorProps.appearance) && isExperimentEnabled('cc_editor_scroll_restore_perf_improvements');
751
+ const scrollRestorePerfEnabled = !isNestedEditor.current && isFullPage(props.editorProps.appearance) || isExperimentEnabled('platform_editor_reduce_forced_layout');
752
752
  const originalScrollToRestore = React.useRef(
753
753
  // Reading scrollTop forces a synchronous layout, and this expression is re-evaluated on every
754
754
  // render. Products restore scroll themselves after the document has rendered.
@@ -201,12 +201,8 @@ const borderSelectionStyles = null;
201
201
  const overflowShadowStyles = null;
202
202
 
203
203
  /**
204
- * editorContentStyles migrated styles from EditorContentContainer/styles,
205
- * the styles migration is under `platform_editor_core_static_css`,
206
- * this FF has a global tests override atm, while waiting for some fixes from compiled and atlaspack,
207
- * if you are making changes, please do VR/Integration test locally and individually by temporarily removing FF overrides from
208
- * packages/editor/editor-test-overrides/src/gemini-platform-feature-gate-overrides.ts, and
209
- * packages/editor/tmp-editor-statsig/src/exp-test-overrides.ts.
204
+ * editorContentStyles contains the Compiled CSS styles migrated from EditorContentContainer/styles.
205
+ * Validate style changes with local VR and integration tests.
210
206
  *
211
207
  * If you are not sure, please contact #proj-cc-editor-full-compiled-css-migration
212
208
  */
@@ -1,9 +1,7 @@
1
1
  import { EditorContentContainerCompiled } from './EditorContentContainer-compiled';
2
2
 
3
3
  /**
4
- * The emotion implementation has been removed as part of the
5
- * platform_editor_core_static_css cleanup — the compiled implementation is now
6
- * the only one. This module stays as the entry point so consumers keep
4
+ * This module exposes the Compiled implementation as the entry point so consumers keep
7
5
  * importing from `./EditorContentContainer`.
8
6
  */
9
7
  const EditorContentContainer = EditorContentContainerCompiled;
@@ -7,7 +7,7 @@ import { css } from '@emotion/react';
7
7
  const blockNodesVerticalMargin = '0.75rem';
8
8
 
9
9
  /**
10
- * @deprecated This style has been migrated to Compiled CSS, under experiment platform_editor_core_static_css
10
+ * @deprecated This style has been migrated to Compiled CSS.
11
11
  * If you need to make changes here, also update the corresponding style in
12
12
  * packages/editor/editor-core/src/ui/EditorContentContainer/EditorContentContainer-compiled.tsx
13
13
  * See EDITOR-7600 for more details: https://hello.jira.atlassian.cloud/jira/browse/EDITOR-7600
@@ -37,12 +37,17 @@ const createLazyExtensionIcon = getIcon => {
37
37
  default: Icon
38
38
  })));
39
39
  LazyIcon.displayName = 'lazy(ExtensionIcon)';
40
- const Icon = props => /*#__PURE__*/React.createElement(React.Suspense, {
40
+ const Icon = ({
41
+ label,
42
+ size
43
+ }) => /*#__PURE__*/React.createElement(React.Suspense, {
41
44
  fallback: /*#__PURE__*/React.createElement(AppsIcon, {
42
- label: props.label
45
+ label: label,
46
+ size: size
43
47
  })
44
48
  }, /*#__PURE__*/React.createElement(LazyIcon, {
45
- label: props.label
49
+ label: label,
50
+ size: size
46
51
  }));
47
52
  lazyExtensionIconCache.set(getIcon, Icon);
48
53
  return Icon;
@@ -50,7 +55,8 @@ const createLazyExtensionIcon = getIcon => {
50
55
  export const ExtensionQuickInsertIcon = ({
51
56
  getIcon,
52
57
  itemKey,
53
- label
58
+ label,
59
+ size
54
60
  }) => {
55
61
  const Icon = React.useMemo(() => {
56
62
  const quickInsertItemIcon = quickInsertItemIcons[itemKey];
@@ -63,6 +69,7 @@ export const ExtensionQuickInsertIcon = ({
63
69
  return getIcon ? createLazyExtensionIcon(getIcon) : AppsIcon;
64
70
  }, [getIcon, itemKey]);
65
71
  return /*#__PURE__*/React.createElement(Icon, {
66
- label: label
72
+ label: label,
73
+ size: size
67
74
  });
68
75
  };
@@ -0,0 +1,67 @@
1
+ import React, { useCallback } from 'react';
2
+ import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
3
+ import { SkillTag } from '@atlaskit/editor-common/quick-insert/skill-tag';
4
+ import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
5
+ import { Inline } from '@atlaskit/primitives/compiled/inline';
6
+ import { Text } from '@atlaskit/primitives/compiled/text';
7
+ import { executeExtensionQuickInsertItem } from './executeExtensionQuickInsertItem';
8
+ import { ExtensionQuickInsertIcon } from './ExtensionQuickInsertIcon';
9
+ export const QuickInsertSkillMenuItem = ({
10
+ apiRef,
11
+ createAnalyticsEvent,
12
+ editorActions,
13
+ item,
14
+ onInsert
15
+ }) => {
16
+ const {
17
+ editorView,
18
+ isOffline
19
+ } = useQuickInsertContext();
20
+ const onSelect = useCallback(({
21
+ insert,
22
+ source
23
+ }) => {
24
+ const result = executeExtensionQuickInsertItem({
25
+ apiRef,
26
+ createAnalyticsEvent,
27
+ editorActions,
28
+ insert,
29
+ item,
30
+ source,
31
+ state: editorView.state
32
+ });
33
+ if (result) {
34
+ onInsert === null || onInsert === void 0 ? void 0 : onInsert();
35
+ }
36
+ return result;
37
+ }, [apiRef, createAnalyticsEvent, editorActions, editorView.state, item, onInsert]);
38
+ return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
39
+ ariaLabel: item.title,
40
+ description: item.description,
41
+ iconBefore: /*#__PURE__*/React.createElement(ExtensionQuickInsertIcon, {
42
+ getIcon: item.icon,
43
+ itemKey: item.key,
44
+ label: ""
45
+ }),
46
+ isDisabled: isOffline,
47
+ onSelect: onSelect,
48
+ preview: item.preview,
49
+ previewIcon: /*#__PURE__*/React.createElement(ExtensionQuickInsertIcon, {
50
+ getIcon: item.icon,
51
+ itemKey: item.key,
52
+ label: "",
53
+ size: "small"
54
+ }),
55
+ shouldClampPreview: false,
56
+ title: item.title,
57
+ titleContent: /*#__PURE__*/React.createElement(Inline, {
58
+ alignBlock: "center",
59
+ space: "space.100"
60
+ }, item.moduleKey ? /*#__PURE__*/React.createElement(SkillTag, {
61
+ isDisabled: isOffline,
62
+ slug: item.moduleKey
63
+ }) : /*#__PURE__*/React.createElement(Text, {
64
+ color: isOffline ? 'color.text.disabled' : 'color.text'
65
+ }, item.title), item.lozenge)
66
+ });
67
+ };
@@ -4,6 +4,7 @@ import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-ins
4
4
  import { DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, STRUCTURE_SECTION, TABS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
5
5
  import { CREATE_SECTION_RANK, EXTENSION_ITEM_RANK, MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
6
6
  import { ExtensionQuickInsertMenuItem } from './ExtensionQuickInsertMenuItem';
7
+ import { QuickInsertSkillMenuItem } from './QuickInsertSkillMenuItem';
7
8
  const structureExtensionItemKeyRanks = {
8
9
  'toc:toc': 600,
9
10
  [TABS_MENU_ITEM.key]: 1900,
@@ -85,7 +86,8 @@ export const getExtensionQuickInsertComponents = ({
85
86
  title: item.title
86
87
  })),
87
88
  component: props => {
88
- return /*#__PURE__*/React.createElement(ExtensionQuickInsertMenuItem, {
89
+ const Component = item.extensionType === 'com.atlassian.rovo.skill' ? QuickInsertSkillMenuItem : ExtensionQuickInsertMenuItem;
90
+ return /*#__PURE__*/React.createElement(Component, {
89
91
  apiRef: apiRef,
90
92
  createAnalyticsEvent: createAnalyticsEvent,
91
93
  editorActions: editorActions,
@@ -1,3 +1,3 @@
1
1
  export const name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export const version = "234.0.1";
3
+ export const version = "234.2.0";
@@ -791,7 +791,7 @@ export function ReactEditorView(props) {
791
791
 
792
792
  // Preconditioned on the affected population - full page, non nested editors - so that experiment
793
793
  // exposure is not diluted by editors which never run the scroll restoration code below.
794
- var scrollRestorePerfEnabled = !isNestedEditor.current && isFullPage(props.editorProps.appearance) && isExperimentEnabled('cc_editor_scroll_restore_perf_improvements');
794
+ var scrollRestorePerfEnabled = !isNestedEditor.current && isFullPage(props.editorProps.appearance) || isExperimentEnabled('platform_editor_reduce_forced_layout');
795
795
  var originalScrollToRestore = React.useRef(
796
796
  // Reading scrollTop forces a synchronous layout, and this expression is re-evaluated on every
797
797
  // render. Products restore scroll themselves after the document has rendered.
@@ -149,12 +149,8 @@ var borderSelectionStyles = null;
149
149
  var overflowShadowStyles = null;
150
150
 
151
151
  /**
152
- * editorContentStyles migrated styles from EditorContentContainer/styles,
153
- * the styles migration is under `platform_editor_core_static_css`,
154
- * this FF has a global tests override atm, while waiting for some fixes from compiled and atlaspack,
155
- * if you are making changes, please do VR/Integration test locally and individually by temporarily removing FF overrides from
156
- * packages/editor/editor-test-overrides/src/gemini-platform-feature-gate-overrides.ts, and
157
- * packages/editor/tmp-editor-statsig/src/exp-test-overrides.ts.
152
+ * editorContentStyles contains the Compiled CSS styles migrated from EditorContentContainer/styles.
153
+ * Validate style changes with local VR and integration tests.
158
154
  *
159
155
  * If you are not sure, please contact #proj-cc-editor-full-compiled-css-migration
160
156
  */
@@ -1,9 +1,7 @@
1
1
  import { EditorContentContainerCompiled } from './EditorContentContainer-compiled';
2
2
 
3
3
  /**
4
- * The emotion implementation has been removed as part of the
5
- * platform_editor_core_static_css cleanup — the compiled implementation is now
6
- * the only one. This module stays as the entry point so consumers keep
4
+ * This module exposes the Compiled implementation as the entry point so consumers keep
7
5
  * importing from `./EditorContentContainer`.
8
6
  */
9
7
  var EditorContentContainer = EditorContentContainerCompiled;
@@ -7,7 +7,7 @@ import { css } from '@emotion/react';
7
7
  var blockNodesVerticalMargin = '0.75rem';
8
8
 
9
9
  /**
10
- * @deprecated This style has been migrated to Compiled CSS, under experiment platform_editor_core_static_css
10
+ * @deprecated This style has been migrated to Compiled CSS.
11
11
  * If you need to make changes here, also update the corresponding style in
12
12
  * packages/editor/editor-core/src/ui/EditorContentContainer/EditorContentContainer-compiled.tsx
13
13
  * See EDITOR-7600 for more details: https://hello.jira.atlassian.cloud/jira/browse/EDITOR-7600
@@ -66,22 +66,27 @@ var createLazyExtensionIcon = function createLazyExtensionIcon(getIcon) {
66
66
  });
67
67
  });
68
68
  LazyIcon.displayName = 'lazy(ExtensionIcon)';
69
- var Icon = function Icon(props) {
69
+ var Icon = function Icon(_ref2) {
70
+ var label = _ref2.label,
71
+ size = _ref2.size;
70
72
  return /*#__PURE__*/React.createElement(React.Suspense, {
71
73
  fallback: /*#__PURE__*/React.createElement(AppsIcon, {
72
- label: props.label
74
+ label: label,
75
+ size: size
73
76
  })
74
77
  }, /*#__PURE__*/React.createElement(LazyIcon, {
75
- label: props.label
78
+ label: label,
79
+ size: size
76
80
  }));
77
81
  };
78
82
  lazyExtensionIconCache.set(getIcon, Icon);
79
83
  return Icon;
80
84
  };
81
- export var ExtensionQuickInsertIcon = function ExtensionQuickInsertIcon(_ref2) {
82
- var getIcon = _ref2.getIcon,
83
- itemKey = _ref2.itemKey,
84
- label = _ref2.label;
85
+ export var ExtensionQuickInsertIcon = function ExtensionQuickInsertIcon(_ref3) {
86
+ var getIcon = _ref3.getIcon,
87
+ itemKey = _ref3.itemKey,
88
+ label = _ref3.label,
89
+ size = _ref3.size;
85
90
  var Icon = React.useMemo(function () {
86
91
  var quickInsertItemIcon = quickInsertItemIcons[itemKey];
87
92
  if (quickInsertItemIcon) {
@@ -93,6 +98,7 @@ export var ExtensionQuickInsertIcon = function ExtensionQuickInsertIcon(_ref2) {
93
98
  return getIcon ? createLazyExtensionIcon(getIcon) : AppsIcon;
94
99
  }, [getIcon, itemKey]);
95
100
  return /*#__PURE__*/React.createElement(Icon, {
96
- label: label
101
+ label: label,
102
+ size: size
97
103
  });
98
104
  };
@@ -0,0 +1,64 @@
1
+ import React, { useCallback } from 'react';
2
+ import { QuickInsertMenuItem } from '@atlaskit/editor-common/quick-insert/menu-item';
3
+ import { SkillTag } from '@atlaskit/editor-common/quick-insert/skill-tag';
4
+ import { useQuickInsertContext } from '@atlaskit/editor-common/quick-insert/use-quick-insert-context';
5
+ import { Inline } from '@atlaskit/primitives/compiled/inline';
6
+ import { Text } from '@atlaskit/primitives/compiled/text';
7
+ import { executeExtensionQuickInsertItem } from './executeExtensionQuickInsertItem';
8
+ import { ExtensionQuickInsertIcon } from './ExtensionQuickInsertIcon';
9
+ export var QuickInsertSkillMenuItem = function QuickInsertSkillMenuItem(_ref) {
10
+ var apiRef = _ref.apiRef,
11
+ createAnalyticsEvent = _ref.createAnalyticsEvent,
12
+ editorActions = _ref.editorActions,
13
+ item = _ref.item,
14
+ onInsert = _ref.onInsert;
15
+ var _useQuickInsertContex = useQuickInsertContext(),
16
+ editorView = _useQuickInsertContex.editorView,
17
+ isOffline = _useQuickInsertContex.isOffline;
18
+ var onSelect = useCallback(function (_ref2) {
19
+ var insert = _ref2.insert,
20
+ source = _ref2.source;
21
+ var result = executeExtensionQuickInsertItem({
22
+ apiRef: apiRef,
23
+ createAnalyticsEvent: createAnalyticsEvent,
24
+ editorActions: editorActions,
25
+ insert: insert,
26
+ item: item,
27
+ source: source,
28
+ state: editorView.state
29
+ });
30
+ if (result) {
31
+ onInsert === null || onInsert === void 0 || onInsert();
32
+ }
33
+ return result;
34
+ }, [apiRef, createAnalyticsEvent, editorActions, editorView.state, item, onInsert]);
35
+ return /*#__PURE__*/React.createElement(QuickInsertMenuItem, {
36
+ ariaLabel: item.title,
37
+ description: item.description,
38
+ iconBefore: /*#__PURE__*/React.createElement(ExtensionQuickInsertIcon, {
39
+ getIcon: item.icon,
40
+ itemKey: item.key,
41
+ label: ""
42
+ }),
43
+ isDisabled: isOffline,
44
+ onSelect: onSelect,
45
+ preview: item.preview,
46
+ previewIcon: /*#__PURE__*/React.createElement(ExtensionQuickInsertIcon, {
47
+ getIcon: item.icon,
48
+ itemKey: item.key,
49
+ label: "",
50
+ size: "small"
51
+ }),
52
+ shouldClampPreview: false,
53
+ title: item.title,
54
+ titleContent: /*#__PURE__*/React.createElement(Inline, {
55
+ alignBlock: "center",
56
+ space: "space.100"
57
+ }, item.moduleKey ? /*#__PURE__*/React.createElement(SkillTag, {
58
+ isDisabled: isOffline,
59
+ slug: item.moduleKey
60
+ }) : /*#__PURE__*/React.createElement(Text, {
61
+ color: isOffline ? 'color.text.disabled' : 'color.text'
62
+ }, item.title), item.lozenge)
63
+ });
64
+ };
@@ -9,6 +9,7 @@ import { getQuickInsertMenuItemParents } from '@atlaskit/editor-common/quick-ins
9
9
  import { DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, STRUCTURE_SECTION, TABS_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys';
10
10
  import { CREATE_SECTION_RANK, EXTENSION_ITEM_RANK, MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
11
11
  import { ExtensionQuickInsertMenuItem } from './ExtensionQuickInsertMenuItem';
12
+ import { QuickInsertSkillMenuItem } from './QuickInsertSkillMenuItem';
12
13
  var structureExtensionItemKeyRanks = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
13
14
  'toc:toc': 600
14
15
  }, TABS_MENU_ITEM.key, 1900), 'cards:quick-insert', 2000), 'carousel:quick-insert', 2100), 'spotlight:quick-insert', 2200), 'create-from-template:create-from-template', 2700), 'anchor:anchor', 2900), 'smart-button:quick-insert', 3000);
@@ -111,7 +112,8 @@ export var getExtensionQuickInsertComponents = function getExtensionQuickInsertC
111
112
  };
112
113
  }),
113
114
  component: function component(props) {
114
- return /*#__PURE__*/React.createElement(ExtensionQuickInsertMenuItem, {
115
+ var Component = item.extensionType === 'com.atlassian.rovo.skill' ? QuickInsertSkillMenuItem : ExtensionQuickInsertMenuItem;
116
+ return /*#__PURE__*/React.createElement(Component, {
115
117
  apiRef: apiRef,
116
118
  createAnalyticsEvent: createAnalyticsEvent,
117
119
  editorActions: editorActions,
@@ -1,3 +1,3 @@
1
1
  export var name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export var version = "234.0.1";
3
+ export var version = "234.2.0";
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
- * Compiled migration: platform_editor_core_static_css
5
4
  */
6
5
  import React from 'react';
7
6
  import type { EditorAppearance, EditorContentMode, FeatureFlags } from '@atlaskit/editor-common/types';
@@ -1,9 +1,7 @@
1
1
  import type React from 'react';
2
2
  import { type EditorContentContainerProps } from './EditorContentContainer-compiled';
3
3
  /**
4
- * The emotion implementation has been removed as part of the
5
- * platform_editor_core_static_css cleanup — the compiled implementation is now
6
- * the only one. This module stays as the entry point so consumers keep
4
+ * This module exposes the Compiled implementation as the entry point so consumers keep
7
5
  * importing from `./EditorContentContainer`.
8
6
  */
9
7
  declare const EditorContentContainer: React.ForwardRefExoticComponent<EditorContentContainerProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,6 +1,6 @@
1
1
  import type { SerializedStyles } from '@emotion/react';
2
2
  /**
3
- * @deprecated This style has been migrated to Compiled CSS, under experiment platform_editor_core_static_css
3
+ * @deprecated This style has been migrated to Compiled CSS.
4
4
  * If you need to make changes here, also update the corresponding style in
5
5
  * packages/editor/editor-core/src/ui/EditorContentContainer/EditorContentContainer-compiled.tsx
6
6
  * See EDITOR-7600 for more details: https://hello.jira.atlassian.cloud/jira/browse/EDITOR-7600
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { MenuItem } from '@atlaskit/editor-common/extensions';
3
- export declare const ExtensionQuickInsertIcon: ({ getIcon, itemKey, label, }: {
3
+ export declare const ExtensionQuickInsertIcon: ({ getIcon, itemKey, label, size, }: {
4
4
  getIcon?: MenuItem['icon'];
5
5
  itemKey: string;
6
6
  label: string;
7
+ size?: 'small' | 'medium';
7
8
  }) => React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
3
+ import type { MenuItem } from '@atlaskit/editor-common/extensions';
4
+ import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
5
+ import type { ExtensionPlugin } from '@atlaskit/editor-plugins/extension';
6
+ import type EditorActions from '../../actions';
7
+ export declare const QuickInsertSkillMenuItem: ({ apiRef, createAnalyticsEvent, editorActions, item, onInsert, }: {
8
+ apiRef: React.MutableRefObject<PublicPluginAPI<[ExtensionPlugin]> | undefined>;
9
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
10
+ editorActions: EditorActions;
11
+ item: MenuItem;
12
+ onInsert?: () => void;
13
+ }) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "234.1.0",
3
+ "version": "234.2.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@atlaskit/activity-provider": "^3.1.0",
44
44
  "@atlaskit/adf-schema": "^57.6.0",
45
- "@atlaskit/afm-i18n-platform-editor-editor-core": "2.249.0",
45
+ "@atlaskit/afm-i18n-platform-editor-editor-core": "2.270.0",
46
46
  "@atlaskit/analytics-namespaced-context": "^8.2.0",
47
47
  "@atlaskit/analytics-next": "^12.5.0",
48
48
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
@@ -61,14 +61,14 @@
61
61
  "@atlaskit/editor-ssr-renderer": "^19.0.0",
62
62
  "@atlaskit/editor-toolbar": "^2.8.0",
63
63
  "@atlaskit/editor-toolbar-model": "^1.2.0",
64
- "@atlaskit/emoji": "^72.4.0",
64
+ "@atlaskit/emoji": "^72.5.0",
65
65
  "@atlaskit/feature-gate-js-client": "^7.0.0",
66
66
  "@atlaskit/heading": "^8.0.0",
67
67
  "@atlaskit/icon": "^38.0.0",
68
68
  "@atlaskit/icon-lab": "^7.11.0",
69
69
  "@atlaskit/link": "^5.1.0",
70
70
  "@atlaskit/media-card": "^82.1.0",
71
- "@atlaskit/mention": "^30.0.0",
71
+ "@atlaskit/mention": "^30.1.0",
72
72
  "@atlaskit/platform-feature-experiments": "^0.3.0",
73
73
  "@atlaskit/platform-feature-flags": "^2.2.0",
74
74
  "@atlaskit/platform-feature-flags-react": "^1.2.0",
@@ -76,9 +76,9 @@
76
76
  "@atlaskit/primitives": "^22.5.0",
77
77
  "@atlaskit/react-compiler-gating": "^0.2.0",
78
78
  "@atlaskit/react-ufo": "^8.0.0",
79
- "@atlaskit/task-decision": "^21.11.0",
80
- "@atlaskit/tmp-editor-statsig": "^221.0.0",
81
- "@atlaskit/tokens": "^20.1.0",
79
+ "@atlaskit/task-decision": "^21.12.0",
80
+ "@atlaskit/tmp-editor-statsig": "^222.0.0",
81
+ "@atlaskit/tokens": "^20.3.0",
82
82
  "@atlaskit/tooltip": "^24.4.0",
83
83
  "@atlaskit/width-detector": "^7.2.0",
84
84
  "@babel/runtime": "^7.0.0",
@@ -96,7 +96,7 @@
96
96
  "uuid": "^11.1.1"
97
97
  },
98
98
  "peerDependencies": {
99
- "@atlaskit/editor-common": "^128.1.0",
99
+ "@atlaskit/editor-common": "^128.3.0",
100
100
  "@atlaskit/link-provider": "^6.0.0",
101
101
  "@atlaskit/media-core": "^39.0.0",
102
102
  "react": "^18.2.0 || ^19.2.0",
@@ -144,7 +144,7 @@
144
144
  "@atlaskit/editor-synced-block-provider": "^20.0.0",
145
145
  "@atlaskit/editor-synced-block-renderer": "^22.0.0",
146
146
  "@atlaskit/editor-test-helpers": "workspace:^",
147
- "@atlaskit/form": "^18.0.0",
147
+ "@atlaskit/form": "^18.1.0",
148
148
  "@atlaskit/link-provider": "^6.0.0",
149
149
  "@atlaskit/linking-common": "^13.0.0",
150
150
  "@atlaskit/logo": "^23.3.0",
@@ -152,14 +152,14 @@
152
152
  "@atlaskit/media-integration-test-helpers": "workspace:^",
153
153
  "@atlaskit/media-picker": "^73.0.0",
154
154
  "@atlaskit/media-test-helpers": "^43.0.0",
155
- "@atlaskit/media-ui": "^31.0.0",
155
+ "@atlaskit/media-ui": "^31.2.0",
156
156
  "@atlaskit/modal-dialog": "^17.0.0",
157
157
  "@atlaskit/navigation-system": "^11.1.0",
158
158
  "@atlaskit/popper": "^9.4.0",
159
159
  "@atlaskit/portal": "^7.0.0",
160
160
  "@atlaskit/profilecard": "^27.1.0",
161
161
  "@atlaskit/radio": "^10.2.0",
162
- "@atlaskit/renderer": "^147.0.0",
162
+ "@atlaskit/renderer": "^147.1.0",
163
163
  "@atlaskit/section-message": "^10.2.0",
164
164
  "@atlaskit/spinner": "^20.4.0",
165
165
  "@atlaskit/synchrony-test-helpers": "workspace:^",