@atlaskit/editor-common 120.10.3 → 120.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/element-browser/ElementBrowser.js +2 -1
  3. package/dist/cjs/element-browser/components/ElementList/ElementList.js +2 -2
  4. package/dist/cjs/extensibility/MultiBodiedExtension/index.js +36 -18
  5. package/dist/cjs/extensions/buildMenuItem.js +8 -4
  6. package/dist/cjs/messages/syncBlock.js +5 -0
  7. package/dist/cjs/monitoring/error.js +1 -1
  8. package/dist/cjs/quick-insert/getActiveQuickInsertCategories.js +13 -0
  9. package/dist/cjs/quick-insert/getQuickInsertMenuItemParents.js +6 -4
  10. package/dist/cjs/quick-insert/rank.js +2 -2
  11. package/dist/cjs/ui/DropList/index.js +1 -1
  12. package/dist/es2019/element-browser/ElementBrowser.js +2 -1
  13. package/dist/es2019/element-browser/components/ElementList/ElementList.js +2 -2
  14. package/dist/es2019/extensibility/MultiBodiedExtension/index.js +36 -15
  15. package/dist/es2019/extensions/buildMenuItem.js +8 -2
  16. package/dist/es2019/messages/syncBlock.js +5 -0
  17. package/dist/es2019/monitoring/error.js +1 -1
  18. package/dist/es2019/quick-insert/getActiveQuickInsertCategories.js +6 -0
  19. package/dist/es2019/quick-insert/getQuickInsertMenuItemParents.js +5 -3
  20. package/dist/es2019/quick-insert/rank.js +2 -2
  21. package/dist/es2019/ui/DropList/index.js +1 -1
  22. package/dist/esm/element-browser/ElementBrowser.js +2 -1
  23. package/dist/esm/element-browser/components/ElementList/ElementList.js +2 -2
  24. package/dist/esm/extensibility/MultiBodiedExtension/index.js +36 -18
  25. package/dist/esm/extensions/buildMenuItem.js +8 -4
  26. package/dist/esm/messages/syncBlock.js +5 -0
  27. package/dist/esm/monitoring/error.js +1 -1
  28. package/dist/esm/quick-insert/getActiveQuickInsertCategories.js +8 -0
  29. package/dist/esm/quick-insert/getQuickInsertMenuItemParents.js +6 -4
  30. package/dist/esm/quick-insert/rank.js +2 -2
  31. package/dist/esm/ui/DropList/index.js +1 -1
  32. package/dist/types/extensions/types/extension-manifest.d.ts +10 -0
  33. package/dist/types/extensions/types/utils.d.ts +1 -0
  34. package/dist/types/messages/syncBlock.d.ts +5 -0
  35. package/dist/types/provider-factory/quick-insert-provider.d.ts +5 -0
  36. package/dist/types/quick-insert/getActiveQuickInsertCategories.d.ts +4 -0
  37. package/dist/types/quick-insert/getQuickInsertMenuItemParents.d.ts +3 -2
  38. package/package.json +3 -21
  39. package/quick-insert/get-active-quick-insert-categories/package.json +10 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 120.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`25ed290dcc443`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25ed290dcc443) -
8
+ Add Quick Insert category selection support for slash commands behind the
9
+ platform_editor_slash_command feature flag.
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8db4908d60862`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8db4908d60862) -
14
+ Clean up experiment platform_editor_plus_menu_aria_label
15
+ - [`167dc88b2c79c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/167dc88b2c79c) -
16
+ Show unpublished state in synced-block labels and open the publish tooltip from the whole label,
17
+ behind the `editor-synced-block-same-page-sync` experiment
18
+ - Updated dependencies
19
+
20
+ ## 120.10.4
21
+
22
+ ### Patch Changes
23
+
24
+ - [`38efae8b5d945`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38efae8b5d945) -
25
+ Scope MultiBodiedExtension active frame styles to the owning frames article to avoid showing
26
+ nested inactive tab bodies.
27
+
3
28
  ## 120.10.3
4
29
 
5
30
  ### Patch Changes
@@ -13,6 +13,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
13
13
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _react = _interopRequireWildcard(require("react"));
16
+ var _getActiveQuickInsertCategories = require("../quick-insert/getActiveQuickInsertCategories");
16
17
  var _StatelessElementBrowser = _interopRequireDefault(require("./components/StatelessElementBrowser"));
17
18
  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); }
18
19
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
@@ -48,7 +49,7 @@ var ElementBrowser = exports.default = /*#__PURE__*/function (_PureComponent) {
48
49
  }
49
50
  return categories.filter(function (category) {
50
51
  return category.name === 'all' || items.some(function (item) {
51
- return (item.categories || []).includes(category.name);
52
+ return (0, _getActiveQuickInsertCategories.getActiveQuickInsertCategories)(item.category, item.categories).includes(category.name);
52
53
  });
53
54
  });
54
55
  });
@@ -192,7 +192,7 @@ var ElementListSingleColumn = function ElementListSingleColumn(props) {
192
192
  selectedItemIndex = props.selectedItemIndex;
193
193
  var _useIntl = (0, _reactIntl.useIntl)(),
194
194
  formatMessage = _useIntl.formatMessage;
195
- var elementListAriaLabel = (0, _expValEquals.expValEquals)('platform_editor_plus_menu_aria_label', 'isEnabled', true) ? formatMessage(_messages.default.elementListAriaLabel) : undefined;
195
+ var elementListAriaLabel = formatMessage(_messages.default.elementListAriaLabel);
196
196
  var rowRenderer = (0, _react.useMemo)(function () {
197
197
  return function (_ref4) {
198
198
  var index = _ref4.index,
@@ -281,7 +281,7 @@ var ElementListMultipleColumns = function ElementListMultipleColumns(props) {
281
281
  selectedItemIndex = props.selectedItemIndex;
282
282
  var _useIntl2 = (0, _reactIntl.useIntl)(),
283
283
  formatMessage = _useIntl2.formatMessage;
284
- var elementListAriaLabel = (0, _expValEquals.expValEquals)('platform_editor_plus_menu_aria_label', 'isEnabled', true) ? formatMessage(_messages.default.elementListAriaLabel) : undefined;
284
+ var elementListAriaLabel = formatMessage(_messages.default.elementListAriaLabel);
285
285
  var columnWidth = (containerWidth - _constants.ELEMENT_ITEM_PADDING * 2) / columnCount;
286
286
  var rowCount = Math.ceil(items.length / columnCount);
287
287
  var cellRenderer = (0, _react.useMemo)(function () {
@@ -37,8 +37,11 @@ var _excluded = ["url"];
37
37
  */
38
38
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
39
39
  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); }
40
- var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex, frameId, showMacroInteractionDesignUpdates) {
41
- var activeFrameSelector = (0, _fg.fg)('platform_editor_nested_mbe_frames') ? "[data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ")") : ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
40
+ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
41
+ if ((0, _fg.fg)('platform_editor_nested_mbe_frames')) {
42
+ return _MultiBodiedExtension.sharedMultiBodiedExtensionStyles.mbeExtensionContainer;
43
+ }
44
+ var activeFrameSelector = ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
42
45
 
43
46
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
44
47
  return (0, _react2.css)(_MultiBodiedExtension.sharedMultiBodiedExtensionStyles.mbeExtensionContainer, (0, _defineProperty2.default)({}, activeFrameSelector, (0, _react2.css)(
@@ -47,10 +50,21 @@ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activ
47
50
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
48
51
  showMacroInteractionDesignUpdates && _MultiBodiedExtension.removeMarginsAndBorder)));
49
52
  };
53
+ var getFramesActiveFrameStyles = function getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
54
+ if (!(0, _fg.fg)('platform_editor_nested_mbe_frames')) {
55
+ return undefined;
56
+ }
57
+ var activeFrameSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
58
+ return (0, _react2.css)((0, _defineProperty2.default)({}, activeFrameSelector, (0, _react2.css)(
59
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
60
+ _MultiBodiedExtension.sharedMultiBodiedExtensionStyles.extensionFrameContent,
61
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
62
+ showMacroInteractionDesignUpdates && _MultiBodiedExtension.removeMarginsAndBorder)));
63
+ };
50
64
 
51
65
  // Renders a visual placeholder when the active frame contains a single empty paragraph.
52
- var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, frameId, placeholderText) {
53
- var activeFramePlaceholderSelector = (0, _fg.fg)('platform_editor_nested_mbe_frames') ? "& [data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before") : "& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
66
+ var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, placeholderText) {
67
+ var activeFramePlaceholderSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
54
68
  return (0, _react2.css)((0, _defineProperty2.default)({}, activeFramePlaceholderSelector, {
55
69
  color: "var(--ds-text-subtlest, #6B6E76)",
56
70
  // JSON.stringify produces a quoted and escaped CSS string.
@@ -75,14 +89,19 @@ var hoverStylesOld = (0, _react2.css)({
75
89
  }
76
90
  });
77
91
  var MultiBodiedExtensionFrames = function MultiBodiedExtensionFrames(_ref) {
78
- var articleRef = _ref.articleRef,
79
- frameId = _ref.frameId;
92
+ var activeChildIndex = _ref.activeChildIndex,
93
+ articleRef = _ref.articleRef,
94
+ emptyFramePlaceholderText = _ref.emptyFramePlaceholderText,
95
+ shouldShowEmptyFramePlaceholder = _ref.shouldShowEmptyFramePlaceholder,
96
+ showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
80
97
  return (0, _react2.jsx)("article", {
81
98
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
82
99
  className: "multiBodiedExtension--frames",
100
+ css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
101
+ getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, emptyFramePlaceholderText)
102
+ /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
83
103
  "data-testid": "multiBodiedExtension--frames",
84
104
  "data-multibodiedextension-frames": true,
85
- "data-multibodiedextension-frames-id": frameId,
86
105
  ref: articleRef
87
106
  });
88
107
  };
@@ -212,10 +231,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
212
231
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
213
232
  activeChildIndex = _useState4[0],
214
233
  setActiveChildIndex = _useState4[1];
215
- // Used by the gated active-frame styles to scope selection to this MBE instance.
216
- // Editor frames sit under ProseMirror's contentDOM wrapper, so the id anchors the
217
- // selector at the owning MBE before it reaches that wrapper and its direct frames.
218
- var frameId = _react.default.useId();
219
234
  // Adding to avoid aliasing `this` for the callbacks
220
235
  var updateActiveChild = _react.default.useCallback(function (index) {
221
236
  if (typeof index !== 'number') {
@@ -228,12 +243,19 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
228
243
  var articleRef = _react.default.useCallback(function (node) {
229
244
  return handleContentDOMRef(node);
230
245
  }, [handleContentDOMRef]);
246
+ var shouldShowEmptyFramePlaceholder = (0, _isExperimentEnabled.isExperimentEnabled)('confluence_native_tabs_m15');
247
+ var emptyFramePlaceholderText = _react.default.useMemo(function () {
248
+ return JSON.stringify(formatMessage(_placeholderText.placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
249
+ }, [formatMessage]);
231
250
  var childrenContainer = _react.default.useMemo(function () {
232
251
  return (0, _react2.jsx)(MultiBodiedExtensionFrames, {
252
+ activeChildIndex: activeChildIndex,
233
253
  articleRef: articleRef,
234
- frameId: frameId
254
+ emptyFramePlaceholderText: emptyFramePlaceholderText,
255
+ shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
256
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
235
257
  });
236
- }, [articleRef, frameId]);
258
+ }, [activeChildIndex, articleRef, emptyFramePlaceholderText, shouldShowEmptyFramePlaceholder, showMacroInteractionDesignUpdates]);
237
259
  var actions = (0, _actionApi.useMultiBodiedExtensionActions)({
238
260
  updateActiveChild: updateActiveChild,
239
261
  editorView: editorView,
@@ -266,10 +288,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
266
288
  mbeWrapperStyles = breakoutStyles;
267
289
  }
268
290
  var shouldUseUpdatedChrome = (0, _expValEquals.expValEquals)('confluence_native_tabs_experiment', 'isEnabled', true);
269
- var shouldShowEmptyFramePlaceholder = (0, _isExperimentEnabled.isExperimentEnabled)('confluence_native_tabs_m15');
270
- var emptyFramePlaceholderText = _react.default.useMemo(function () {
271
- return JSON.stringify(formatMessage(_placeholderText.placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
272
- }, [formatMessage]);
273
291
  var isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseUpdatedChrome && !isLivePageViewMode);
274
292
  var isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
275
293
  var shouldShowChromeOnInteraction = isNodeHovered || isMultiBodiedExtensionActive;
@@ -345,7 +363,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
345
363
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
346
364
  className: containerClassNames,
347
365
  css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
348
- getContainerCssExtendedStyles(activeChildIndex, frameId, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, frameId, emptyFramePlaceholderText)
366
+ getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates)
349
367
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
350
368
  "data-testid": "multiBodiedExtension--container",
351
369
  "data-multiBodiedExtension-container": true,
@@ -11,14 +11,15 @@ var _manifestHelpers = require("./manifest-helpers");
11
11
  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; }
12
12
  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; }
13
13
  function buildMenuItem(manifest, extensionModule) {
14
- var _ref, _extensionModule$app;
14
+ var _extensionModule$cate, _ref, _extensionModule$app;
15
15
  var title = extensionModule.title || manifest.title;
16
16
  var key = "".concat(manifest.key, ":").concat(extensionModule.key);
17
17
  var node = (0, _manifestHelpers.buildAction)(extensionModule.action, manifest);
18
+ var category = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command') ? (_extensionModule$cate = extensionModule.category) !== null && _extensionModule$cate !== void 0 ? _extensionModule$cate : manifest.category : undefined;
18
19
  if (!node) {
19
20
  throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
20
21
  }
21
- return _objectSpread(_objectSpread(_objectSpread({}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_app_category_analytics') ? {
22
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_app_category_analytics') ? {
22
23
  app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
23
24
  key: manifest.key
24
25
  }
@@ -28,8 +29,11 @@ function buildMenuItem(manifest, extensionModule) {
28
29
  extensionType: manifest.type,
29
30
  extensionKey: manifest.key,
30
31
  keywords: extensionModule.keywords || manifest.keywords || [],
31
- featured: extensionModule.featured || false,
32
- categories: extensionModule.categories || manifest.categories || [],
32
+ featured: extensionModule.featured || false
33
+ }, category !== null && category !== void 0 && category.trim() ? {
34
+ category: category
35
+ } : {}), {}, {
36
+ categories: category !== null && category !== void 0 && category.trim() ? [category] : extensionModule.categories || manifest.categories || [],
33
37
  description: extensionModule.description || manifest.description,
34
38
  summary: manifest.summary,
35
39
  documentationUrl: manifest.documentationUrl,
@@ -301,6 +301,11 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntl.defineMessage
301
301
  defaultMessage: 'Synced content will display <link>when the page is published</link>',
302
302
  description: 'Error message which is shown over sync block when the source page is unpublished.'
303
303
  },
304
+ unpublishedInParentheses: {
305
+ id: 'editor-common.messages.syncBlock.unpublishedInParentheses',
306
+ defaultMessage: '(unpublished)',
307
+ description: 'Parenthetical appended to a synced-block label when the source document is unpublished'
308
+ },
304
309
  unpublishedErrorJiraWorkItem: {
305
310
  id: 'fabric.editor.error.description.reference.unpublished.jiraWorkItem',
306
311
  defaultMessage: "Synced content will display <link>when the item's description is saved</link>",
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
28
28
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
29
29
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
30
30
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
31
- var packageVersion = "120.10.2";
31
+ var packageVersion = "120.10.4";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getActiveQuickInsertCategories = void 0;
7
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
8
+ /**
9
+ * Returns the Quick Insert categories active for the current experiment state.
10
+ */
11
+ var getActiveQuickInsertCategories = exports.getActiveQuickInsertCategories = function getActiveQuickInsertCategories(category, legacyCategories) {
12
+ return (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command') && category !== null && category !== void 0 && category.trim() ? [category] : legacyCategories !== null && legacyCategories !== void 0 ? legacyCategories : [];
13
+ };
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.getQuickInsertMenuItemParents = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _keys = require("./keys");
10
+ var _getActiveQuickInsertCategories = require("./getActiveQuickInsertCategories");
10
11
  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; }
11
12
  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; }
12
13
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
@@ -33,15 +34,16 @@ var categorySections = {
33
34
  visuals: _keys.MEDIA_SECTION
34
35
  };
35
36
  var getQuickInsertMenuItemParents = exports.getQuickInsertMenuItemParents = function getQuickInsertMenuItemParents(_ref) {
36
- var categories = _ref.categories,
37
+ var category = _ref.category,
38
+ legacyCategories = _ref.legacyCategories,
37
39
  rank = _ref.rank;
38
40
  var sections = new Map();
39
- var _iterator = _createForOfIteratorHelper(categories !== null && categories !== void 0 ? categories : []),
41
+ var _iterator = _createForOfIteratorHelper((0, _getActiveQuickInsertCategories.getActiveQuickInsertCategories)(category, legacyCategories)),
40
42
  _step;
41
43
  try {
42
44
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
43
- var category = _step.value;
44
- var section = categorySections[category.trim().toLowerCase()];
45
+ var itemCategory = _step.value;
46
+ var section = categorySections[itemCategory.trim().toLowerCase()];
45
47
  if (section) {
46
48
  sections.set(section.key, section);
47
49
  }
@@ -10,8 +10,8 @@ var _keys = require("./keys");
10
10
  var _STRUCTURE_SECTION_RA;
11
11
  /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports */
12
12
  var QUICK_INSERT_MENU_RANK = exports.QUICK_INSERT_MENU_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.RECOMMENDED_SECTION.key, 0), _keys.STRUCTURE_SECTION.key, 1), _keys.MEDIA_SECTION.key, 2), _keys.EMBED_SECTION.key, 3), _keys.TEXT_FORMATTING_SECTION.key, 4), _keys.ROVO_SECTION.key, 5), _keys.DATA_AND_CHARTS_SECTION.key, 6), _keys.BLOCK_TEMPLATES_SECTION.key, 7), _keys.OTHER_SECTION.key, 8);
13
- var STRUCTURE_SECTION_RANK = exports.STRUCTURE_SECTION_RANK = (_STRUCTURE_SECTION_RA = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_STRUCTURE_SECTION_RA, _keys.ACTION_MENU_ITEM.key, 100), _keys.TABLE_MENU_ITEM.key, 200), _keys.STATUS_MENU_ITEM.key, 300), _keys.DATE_MENU_ITEM.key, 400), _keys.MENTION_MENU_ITEM.key, 500), _keys.EXPAND_MENU_ITEM.key, 700), _keys.CODE_BLOCK_MENU_ITEM.key, 800), _keys.INFO_PANEL_MENU_ITEM.key, 900), _keys.NOTE_PANEL_MENU_ITEM.key, 1000), _keys.SUCCESS_PANEL_MENU_ITEM.key, 1100), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_STRUCTURE_SECTION_RA, _keys.WARNING_PANEL_MENU_ITEM.key, 1200), _keys.ERROR_PANEL_MENU_ITEM.key, 1300), _keys.CUSTOM_PANEL_MENU_ITEM.key, 1400), _keys.TWO_COLUMNS_LAYOUT_MENU_ITEM.key, 1500), _keys.THREE_COLUMNS_LAYOUT_MENU_ITEM.key, 1600), _keys.FOUR_COLUMNS_LAYOUT_MENU_ITEM.key, 1700), _keys.FIVE_COLUMNS_LAYOUT_MENU_ITEM.key, 1800), _keys.SYNCED_BLOCK_MENU_ITEM.key, 2300), _keys.RULE_MENU_ITEM.key, 2400), _keys.DECISION_MENU_ITEM.key, 2800));
14
- var MEDIA_SECTION_RANK = exports.MEDIA_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.MEDIA_INSERT_MENU_ITEM.key, 100), _keys.HYPERLINK_MENU_ITEM.key, 200), _keys.EMOJI_MENU_ITEM.key, 300), _keys.LOOM_MENU_ITEM.key, 400), _keys.AI_IMAGE_GENERATION_MENU_ITEM.key, 600);
13
+ var STRUCTURE_SECTION_RANK = exports.STRUCTURE_SECTION_RANK = (_STRUCTURE_SECTION_RA = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_STRUCTURE_SECTION_RA, _keys.ACTION_MENU_ITEM.key, 100), _keys.TABLE_MENU_ITEM.key, 200), _keys.STATUS_MENU_ITEM.key, 300), _keys.DATE_MENU_ITEM.key, 400), _keys.EXPAND_MENU_ITEM.key, 700), _keys.CODE_BLOCK_MENU_ITEM.key, 800), _keys.INFO_PANEL_MENU_ITEM.key, 900), _keys.NOTE_PANEL_MENU_ITEM.key, 1000), _keys.SUCCESS_PANEL_MENU_ITEM.key, 1100), _keys.WARNING_PANEL_MENU_ITEM.key, 1200), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_STRUCTURE_SECTION_RA, _keys.ERROR_PANEL_MENU_ITEM.key, 1300), _keys.CUSTOM_PANEL_MENU_ITEM.key, 1400), _keys.TWO_COLUMNS_LAYOUT_MENU_ITEM.key, 1500), _keys.THREE_COLUMNS_LAYOUT_MENU_ITEM.key, 1600), _keys.FOUR_COLUMNS_LAYOUT_MENU_ITEM.key, 1700), _keys.FIVE_COLUMNS_LAYOUT_MENU_ITEM.key, 1800), _keys.SYNCED_BLOCK_MENU_ITEM.key, 2300), _keys.RULE_MENU_ITEM.key, 2400), _keys.DECISION_MENU_ITEM.key, 2800));
14
+ var MEDIA_SECTION_RANK = exports.MEDIA_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.MEDIA_INSERT_MENU_ITEM.key, 100), _keys.HYPERLINK_MENU_ITEM.key, 200), _keys.EMOJI_MENU_ITEM.key, 300), _keys.LOOM_MENU_ITEM.key, 400), _keys.MENTION_MENU_ITEM.key, 1500), _keys.AI_IMAGE_GENERATION_MENU_ITEM.key, 1600);
15
15
  var TEXT_FORMATTING_SECTION_RANK = exports.TEXT_FORMATTING_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.HEADING_1_MENU_ITEM.key, 100), _keys.HEADING_2_MENU_ITEM.key, 200), _keys.HEADING_3_MENU_ITEM.key, 300), _keys.HEADING_4_MENU_ITEM.key, 400), _keys.HEADING_5_MENU_ITEM.key, 500), _keys.HEADING_6_MENU_ITEM.key, 600), _keys.BLOCKQUOTE_MENU_ITEM.key, 700), _keys.PLACEHOLDER_TEXT_MENU_ITEM.key, 900), _keys.UNORDERED_LIST_MENU_ITEM.key, 1100), _keys.ORDERED_LIST_MENU_ITEM.key, 1200);
16
16
  var ROVO_SECTION_RANK = exports.ROVO_SECTION_RANK = (0, _defineProperty2.default)({}, _keys.ASK_ROVO_MENU_ITEM.key, 100);
17
17
  var DATA_AND_CHARTS_SECTION_RANK = exports.DATA_AND_CHARTS_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.JIRA_WORK_ITEMS_MENU_ITEM.key, 300), _keys.ASSETS_MENU_ITEM.key, 500);
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "120.10.2";
27
+ var packageVersion = "120.10.4";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import React, { PureComponent } from 'react';
3
+ import { getActiveQuickInsertCategories } from '../quick-insert/getActiveQuickInsertCategories';
3
4
  import StatelessElementBrowser from './components/StatelessElementBrowser';
4
5
  // Ignored via go/ees005
5
6
  // eslint-disable-next-line @repo/internal/react/no-class-components
@@ -22,7 +23,7 @@ export default class ElementBrowser extends PureComponent {
22
23
  if (!showCategories) {
23
24
  return [];
24
25
  }
25
- return categories.filter(category => category.name === 'all' || items.some(item => (item.categories || []).includes(category.name)));
26
+ return categories.filter(category => category.name === 'all' || items.some(item => getActiveQuickInsertCategories(item.category, item.categories).includes(category.name)));
26
27
  });
27
28
  _defineProperty(this, "fetchItems", (query, category) => {
28
29
  return this.props.getItems(query, category);
@@ -181,7 +181,7 @@ const ElementListSingleColumn = props => {
181
181
  const {
182
182
  formatMessage
183
183
  } = useIntl();
184
- const elementListAriaLabel = expValEquals('platform_editor_plus_menu_aria_label', 'isEnabled', true) ? formatMessage(commonMessages.elementListAriaLabel) : undefined;
184
+ const elementListAriaLabel = formatMessage(commonMessages.elementListAriaLabel);
185
185
  const rowRenderer = useMemo(() => ({
186
186
  index,
187
187
  key,
@@ -272,7 +272,7 @@ const ElementListMultipleColumns = props => {
272
272
  const {
273
273
  formatMessage
274
274
  } = useIntl();
275
- const elementListAriaLabel = expValEquals('platform_editor_plus_menu_aria_label', 'isEnabled', true) ? formatMessage(commonMessages.elementListAriaLabel) : undefined;
275
+ const elementListAriaLabel = formatMessage(commonMessages.elementListAriaLabel);
276
276
  const columnWidth = (containerWidth - ELEMENT_ITEM_PADDING * 2) / columnCount;
277
277
  const rowCount = Math.ceil(items.length / columnCount);
278
278
  const cellRenderer = useMemo(() => ({
@@ -25,8 +25,11 @@ import { ExtensionFloatingLabel } from '../Extension/Lozenge/ExtensionFloatingLa
25
25
  import { shouldExtensionBreakout } from '../utils/should-extension-breakout';
26
26
  import { useMultiBodiedExtensionActions } from './action-api';
27
27
  import { mbeExtensionWrapperCSSStyles, mbeExtensionWrapperCSSStylesOld, overlayStyles, overlayStylesOld } from './styles';
28
- const getContainerCssExtendedStyles = (activeChildIndex, frameId, showMacroInteractionDesignUpdates) => {
29
- const activeFrameSelector = fg('platform_editor_nested_mbe_frames') ? `[data-multibodiedextension-frames-id='${frameId}'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})` : `.multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})`;
28
+ const getContainerCssExtendedStyles = (activeChildIndex, showMacroInteractionDesignUpdates) => {
29
+ if (fg('platform_editor_nested_mbe_frames')) {
30
+ return sharedMultiBodiedExtensionStyles.mbeExtensionContainer;
31
+ }
32
+ const activeFrameSelector = `.multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})`;
30
33
 
31
34
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
32
35
  return css(sharedMultiBodiedExtensionStyles.mbeExtensionContainer, {
@@ -38,10 +41,24 @@ const getContainerCssExtendedStyles = (activeChildIndex, frameId, showMacroInter
38
41
  showMacroInteractionDesignUpdates && removeMarginsAndBorder)
39
42
  });
40
43
  };
44
+ const getFramesActiveFrameStyles = (activeChildIndex, showMacroInteractionDesignUpdates) => {
45
+ if (!fg('platform_editor_nested_mbe_frames')) {
46
+ return undefined;
47
+ }
48
+ const activeFrameSelector = `& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})`;
49
+ return css({
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
51
+ [activeFrameSelector]: css(
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
53
+ sharedMultiBodiedExtensionStyles.extensionFrameContent,
54
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
55
+ showMacroInteractionDesignUpdates && removeMarginsAndBorder)
56
+ });
57
+ };
41
58
 
42
59
  // Renders a visual placeholder when the active frame contains a single empty paragraph.
43
- const getEmptyFramePlaceholderStyles = (activeChildIndex, frameId, placeholderText) => {
44
- const activeFramePlaceholderSelector = fg('platform_editor_nested_mbe_frames') ? `& [data-multibodiedextension-frames-id='${frameId}'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before` : `& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before`;
60
+ const getEmptyFramePlaceholderStyles = (activeChildIndex, placeholderText) => {
61
+ const activeFramePlaceholderSelector = `& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before`;
45
62
  return css({
46
63
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
47
64
  [activeFramePlaceholderSelector]: {
@@ -69,15 +86,20 @@ const hoverStylesOld = css({
69
86
  }
70
87
  });
71
88
  const MultiBodiedExtensionFrames = ({
89
+ activeChildIndex,
72
90
  articleRef,
73
- frameId
91
+ emptyFramePlaceholderText,
92
+ shouldShowEmptyFramePlaceholder,
93
+ showMacroInteractionDesignUpdates
74
94
  }) => {
75
95
  return jsx("article", {
76
96
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
77
97
  className: "multiBodiedExtension--frames",
98
+ css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
99
+ getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, emptyFramePlaceholderText)
100
+ /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
78
101
  "data-testid": "multiBodiedExtension--frames",
79
102
  "data-multibodiedextension-frames": true,
80
- "data-multibodiedextension-frames-id": frameId,
81
103
  ref: articleRef
82
104
  });
83
105
  };
@@ -204,10 +226,6 @@ const MultiBodiedExtensionWithWidth = ({
204
226
  formatMessage
205
227
  } = useIntl();
206
228
  const [activeChildIndex, setActiveChildIndex] = useState(0);
207
- // Used by the gated active-frame styles to scope selection to this MBE instance.
208
- // Editor frames sit under ProseMirror's contentDOM wrapper, so the id anchors the
209
- // selector at the owning MBE before it reaches that wrapper and its direct frames.
210
- const frameId = React.useId();
211
229
  // Adding to avoid aliasing `this` for the callbacks
212
230
  const updateActiveChild = React.useCallback(index => {
213
231
  if (typeof index !== 'number') {
@@ -220,12 +238,17 @@ const MultiBodiedExtensionWithWidth = ({
220
238
  const articleRef = React.useCallback(node => {
221
239
  return handleContentDOMRef(node);
222
240
  }, [handleContentDOMRef]);
241
+ const shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
242
+ const emptyFramePlaceholderText = React.useMemo(() => JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText)), [formatMessage]);
223
243
  const childrenContainer = React.useMemo(() => {
224
244
  return jsx(MultiBodiedExtensionFrames, {
245
+ activeChildIndex: activeChildIndex,
225
246
  articleRef: articleRef,
226
- frameId: frameId
247
+ emptyFramePlaceholderText: emptyFramePlaceholderText,
248
+ shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
249
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
227
250
  });
228
- }, [articleRef, frameId]);
251
+ }, [activeChildIndex, articleRef, emptyFramePlaceholderText, shouldShowEmptyFramePlaceholder, showMacroInteractionDesignUpdates]);
229
252
  const actions = useMultiBodiedExtensionActions({
230
253
  updateActiveChild,
231
254
  editorView,
@@ -259,8 +282,6 @@ const MultiBodiedExtensionWithWidth = ({
259
282
  mbeWrapperStyles = breakoutStyles;
260
283
  }
261
284
  const shouldUseUpdatedChrome = expValEquals('confluence_native_tabs_experiment', 'isEnabled', true);
262
- const shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
263
- const emptyFramePlaceholderText = React.useMemo(() => JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText)), [formatMessage]);
264
285
  const isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseUpdatedChrome && !isLivePageViewMode);
265
286
  const isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
266
287
  const shouldShowChromeOnInteraction = isNodeHovered || isMultiBodiedExtensionActive;
@@ -332,7 +353,7 @@ const MultiBodiedExtensionWithWidth = ({
332
353
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
333
354
  className: containerClassNames,
334
355
  css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
335
- getContainerCssExtendedStyles(activeChildIndex, frameId, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, frameId, emptyFramePlaceholderText)
356
+ getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates)
336
357
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
337
358
  "data-testid": "multiBodiedExtension--container",
338
359
  "data-multiBodiedExtension-container": true,
@@ -1,10 +1,11 @@
1
1
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
2
  import { buildAction } from './manifest-helpers';
3
3
  export function buildMenuItem(manifest, extensionModule) {
4
- var _ref, _extensionModule$app;
4
+ var _extensionModule$cate, _ref, _extensionModule$app;
5
5
  const title = extensionModule.title || manifest.title;
6
6
  const key = `${manifest.key}:${extensionModule.key}`;
7
7
  const node = buildAction(extensionModule.action, manifest);
8
+ const category = isExperimentEnabled('platform_editor_slash_command') ? (_extensionModule$cate = extensionModule.category) !== null && _extensionModule$cate !== void 0 ? _extensionModule$cate : manifest.category : undefined;
8
9
  if (!node) {
9
10
  throw new Error(`Couldn't find any action for ${title} (${key})`);
10
11
  }
@@ -20,7 +21,12 @@ export function buildMenuItem(manifest, extensionModule) {
20
21
  extensionKey: manifest.key,
21
22
  keywords: extensionModule.keywords || manifest.keywords || [],
22
23
  featured: extensionModule.featured || false,
23
- categories: extensionModule.categories || manifest.categories || [],
24
+ // Keep `categories` populated for legacy Quick Insert consumers while
25
+ // the singular category field is introduced.
26
+ ...(category !== null && category !== void 0 && category.trim() ? {
27
+ category
28
+ } : {}),
29
+ categories: category !== null && category !== void 0 && category.trim() ? [category] : extensionModule.categories || manifest.categories || [],
24
30
  description: extensionModule.description || manifest.description,
25
31
  summary: manifest.summary,
26
32
  documentationUrl: manifest.documentationUrl,
@@ -295,6 +295,11 @@ export const syncBlockMessages = defineMessages({
295
295
  defaultMessage: 'Synced content will display <link>when the page is published</link>',
296
296
  description: 'Error message which is shown over sync block when the source page is unpublished.'
297
297
  },
298
+ unpublishedInParentheses: {
299
+ id: 'editor-common.messages.syncBlock.unpublishedInParentheses',
300
+ defaultMessage: '(unpublished)',
301
+ description: 'Parenthetical appended to a synced-block label when the source document is unpublished'
302
+ },
298
303
  unpublishedErrorJiraWorkItem: {
299
304
  id: 'fabric.editor.error.description.reference.unpublished.jiraWorkItem',
300
305
  defaultMessage: "Synced content will display <link>when the item's description is saved</link>",
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
14
14
  const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
15
15
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
16
16
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
17
- const packageVersion = "120.10.2";
17
+ const packageVersion = "120.10.4";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -0,0 +1,6 @@
1
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
+
3
+ /**
4
+ * Returns the Quick Insert categories active for the current experiment state.
5
+ */
6
+ export const getActiveQuickInsertCategories = (category, legacyCategories) => isExperimentEnabled('platform_editor_slash_command') && category !== null && category !== void 0 && category.trim() ? [category] : legacyCategories !== null && legacyCategories !== void 0 ? legacyCategories : [];
@@ -1,4 +1,5 @@
1
1
  import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from './keys';
2
+ import { getActiveQuickInsertCategories } from './getActiveQuickInsertCategories';
2
3
  const categorySections = {
3
4
  admin: STRUCTURE_SECTION,
4
5
  ai: ROVO_SECTION,
@@ -20,12 +21,13 @@ const categorySections = {
20
21
  visuals: MEDIA_SECTION
21
22
  };
22
23
  export const getQuickInsertMenuItemParents = ({
23
- categories,
24
+ category,
25
+ legacyCategories,
24
26
  rank
25
27
  }) => {
26
28
  const sections = new Map();
27
- for (const category of categories !== null && categories !== void 0 ? categories : []) {
28
- const section = categorySections[category.trim().toLowerCase()];
29
+ for (const itemCategory of getActiveQuickInsertCategories(category, legacyCategories)) {
30
+ const section = categorySections[itemCategory.trim().toLowerCase()];
29
31
  if (section) {
30
32
  sections.set(section.key, section);
31
33
  }
@@ -16,7 +16,6 @@ export const STRUCTURE_SECTION_RANK = {
16
16
  [TABLE_MENU_ITEM.key]: 200,
17
17
  [STATUS_MENU_ITEM.key]: 300,
18
18
  [DATE_MENU_ITEM.key]: 400,
19
- [MENTION_MENU_ITEM.key]: 500,
20
19
  [EXPAND_MENU_ITEM.key]: 700,
21
20
  [CODE_BLOCK_MENU_ITEM.key]: 800,
22
21
  [INFO_PANEL_MENU_ITEM.key]: 900,
@@ -38,7 +37,8 @@ export const MEDIA_SECTION_RANK = {
38
37
  [HYPERLINK_MENU_ITEM.key]: 200,
39
38
  [EMOJI_MENU_ITEM.key]: 300,
40
39
  [LOOM_MENU_ITEM.key]: 400,
41
- [AI_IMAGE_GENERATION_MENU_ITEM.key]: 600
40
+ [MENTION_MENU_ITEM.key]: 1500,
41
+ [AI_IMAGE_GENERATION_MENU_ITEM.key]: 1600
42
42
  };
43
43
  export const TEXT_FORMATTING_SECTION_RANK = {
44
44
  [HEADING_1_MENU_ITEM.key]: 100,
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags/fg';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "120.10.2";
17
+ const packageVersion = "120.10.4";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -7,6 +7,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
9
  import React, { PureComponent } from 'react';
10
+ import { getActiveQuickInsertCategories } from '../quick-insert/getActiveQuickInsertCategories';
10
11
  import StatelessElementBrowser from './components/StatelessElementBrowser';
11
12
  // Ignored via go/ees005
12
13
  // eslint-disable-next-line @repo/internal/react/no-class-components
@@ -39,7 +40,7 @@ var ElementBrowser = /*#__PURE__*/function (_PureComponent) {
39
40
  }
40
41
  return categories.filter(function (category) {
41
42
  return category.name === 'all' || items.some(function (item) {
42
- return (item.categories || []).includes(category.name);
43
+ return getActiveQuickInsertCategories(item.category, item.categories).includes(category.name);
43
44
  });
44
45
  });
45
46
  });
@@ -181,7 +181,7 @@ var ElementListSingleColumn = function ElementListSingleColumn(props) {
181
181
  selectedItemIndex = props.selectedItemIndex;
182
182
  var _useIntl = useIntl(),
183
183
  formatMessage = _useIntl.formatMessage;
184
- var elementListAriaLabel = expValEquals('platform_editor_plus_menu_aria_label', 'isEnabled', true) ? formatMessage(commonMessages.elementListAriaLabel) : undefined;
184
+ var elementListAriaLabel = formatMessage(commonMessages.elementListAriaLabel);
185
185
  var rowRenderer = useMemo(function () {
186
186
  return function (_ref4) {
187
187
  var index = _ref4.index,
@@ -270,7 +270,7 @@ var ElementListMultipleColumns = function ElementListMultipleColumns(props) {
270
270
  selectedItemIndex = props.selectedItemIndex;
271
271
  var _useIntl2 = useIntl(),
272
272
  formatMessage = _useIntl2.formatMessage;
273
- var elementListAriaLabel = expValEquals('platform_editor_plus_menu_aria_label', 'isEnabled', true) ? formatMessage(commonMessages.elementListAriaLabel) : undefined;
273
+ var elementListAriaLabel = formatMessage(commonMessages.elementListAriaLabel);
274
274
  var columnWidth = (containerWidth - ELEMENT_ITEM_PADDING * 2) / columnCount;
275
275
  var rowCount = Math.ceil(items.length / columnCount);
276
276
  var cellRenderer = useMemo(function () {
@@ -30,8 +30,11 @@ import { ExtensionFloatingLabel } from '../Extension/Lozenge/ExtensionFloatingLa
30
30
  import { shouldExtensionBreakout } from '../utils/should-extension-breakout';
31
31
  import { useMultiBodiedExtensionActions } from './action-api';
32
32
  import { mbeExtensionWrapperCSSStyles, mbeExtensionWrapperCSSStylesOld, overlayStyles, overlayStylesOld } from './styles';
33
- var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex, frameId, showMacroInteractionDesignUpdates) {
34
- var activeFrameSelector = fg('platform_editor_nested_mbe_frames') ? "[data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ")") : ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
33
+ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
34
+ if (fg('platform_editor_nested_mbe_frames')) {
35
+ return sharedMultiBodiedExtensionStyles.mbeExtensionContainer;
36
+ }
37
+ var activeFrameSelector = ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
35
38
 
36
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
37
40
  return css(sharedMultiBodiedExtensionStyles.mbeExtensionContainer, _defineProperty({}, activeFrameSelector, css(
@@ -40,10 +43,21 @@ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activ
40
43
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
41
44
  showMacroInteractionDesignUpdates && removeMarginsAndBorder)));
42
45
  };
46
+ var getFramesActiveFrameStyles = function getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
47
+ if (!fg('platform_editor_nested_mbe_frames')) {
48
+ return undefined;
49
+ }
50
+ var activeFrameSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
51
+ return css(_defineProperty({}, activeFrameSelector, css(
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
53
+ sharedMultiBodiedExtensionStyles.extensionFrameContent,
54
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
55
+ showMacroInteractionDesignUpdates && removeMarginsAndBorder)));
56
+ };
43
57
 
44
58
  // Renders a visual placeholder when the active frame contains a single empty paragraph.
45
- var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, frameId, placeholderText) {
46
- var activeFramePlaceholderSelector = fg('platform_editor_nested_mbe_frames') ? "& [data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before") : "& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
59
+ var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, placeholderText) {
60
+ var activeFramePlaceholderSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
47
61
  return css(_defineProperty({}, activeFramePlaceholderSelector, {
48
62
  color: "var(--ds-text-subtlest, #6B6E76)",
49
63
  // JSON.stringify produces a quoted and escaped CSS string.
@@ -68,14 +82,19 @@ var hoverStylesOld = css({
68
82
  }
69
83
  });
70
84
  var MultiBodiedExtensionFrames = function MultiBodiedExtensionFrames(_ref) {
71
- var articleRef = _ref.articleRef,
72
- frameId = _ref.frameId;
85
+ var activeChildIndex = _ref.activeChildIndex,
86
+ articleRef = _ref.articleRef,
87
+ emptyFramePlaceholderText = _ref.emptyFramePlaceholderText,
88
+ shouldShowEmptyFramePlaceholder = _ref.shouldShowEmptyFramePlaceholder,
89
+ showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
73
90
  return jsx("article", {
74
91
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
75
92
  className: "multiBodiedExtension--frames",
93
+ css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
94
+ getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, emptyFramePlaceholderText)
95
+ /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
76
96
  "data-testid": "multiBodiedExtension--frames",
77
97
  "data-multibodiedextension-frames": true,
78
- "data-multibodiedextension-frames-id": frameId,
79
98
  ref: articleRef
80
99
  });
81
100
  };
@@ -205,10 +224,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
205
224
  _useState4 = _slicedToArray(_useState3, 2),
206
225
  activeChildIndex = _useState4[0],
207
226
  setActiveChildIndex = _useState4[1];
208
- // Used by the gated active-frame styles to scope selection to this MBE instance.
209
- // Editor frames sit under ProseMirror's contentDOM wrapper, so the id anchors the
210
- // selector at the owning MBE before it reaches that wrapper and its direct frames.
211
- var frameId = React.useId();
212
227
  // Adding to avoid aliasing `this` for the callbacks
213
228
  var updateActiveChild = React.useCallback(function (index) {
214
229
  if (typeof index !== 'number') {
@@ -221,12 +236,19 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
221
236
  var articleRef = React.useCallback(function (node) {
222
237
  return handleContentDOMRef(node);
223
238
  }, [handleContentDOMRef]);
239
+ var shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
240
+ var emptyFramePlaceholderText = React.useMemo(function () {
241
+ return JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
242
+ }, [formatMessage]);
224
243
  var childrenContainer = React.useMemo(function () {
225
244
  return jsx(MultiBodiedExtensionFrames, {
245
+ activeChildIndex: activeChildIndex,
226
246
  articleRef: articleRef,
227
- frameId: frameId
247
+ emptyFramePlaceholderText: emptyFramePlaceholderText,
248
+ shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
249
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
228
250
  });
229
- }, [articleRef, frameId]);
251
+ }, [activeChildIndex, articleRef, emptyFramePlaceholderText, shouldShowEmptyFramePlaceholder, showMacroInteractionDesignUpdates]);
230
252
  var actions = useMultiBodiedExtensionActions({
231
253
  updateActiveChild: updateActiveChild,
232
254
  editorView: editorView,
@@ -259,10 +281,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
259
281
  mbeWrapperStyles = breakoutStyles;
260
282
  }
261
283
  var shouldUseUpdatedChrome = expValEquals('confluence_native_tabs_experiment', 'isEnabled', true);
262
- var shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
263
- var emptyFramePlaceholderText = React.useMemo(function () {
264
- return JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
265
- }, [formatMessage]);
266
284
  var isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseUpdatedChrome && !isLivePageViewMode);
267
285
  var isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
268
286
  var shouldShowChromeOnInteraction = isNodeHovered || isMultiBodiedExtensionActive;
@@ -338,7 +356,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
338
356
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
339
357
  className: containerClassNames,
340
358
  css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
341
- getContainerCssExtendedStyles(activeChildIndex, frameId, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, frameId, emptyFramePlaceholderText)
359
+ getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates)
342
360
  /* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
343
361
  "data-testid": "multiBodiedExtension--container",
344
362
  "data-multiBodiedExtension-container": true,
@@ -4,14 +4,15 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
5
5
  import { buildAction } from './manifest-helpers';
6
6
  export function buildMenuItem(manifest, extensionModule) {
7
- var _ref, _extensionModule$app;
7
+ var _extensionModule$cate, _ref, _extensionModule$app;
8
8
  var title = extensionModule.title || manifest.title;
9
9
  var key = "".concat(manifest.key, ":").concat(extensionModule.key);
10
10
  var node = buildAction(extensionModule.action, manifest);
11
+ var category = isExperimentEnabled('platform_editor_slash_command') ? (_extensionModule$cate = extensionModule.category) !== null && _extensionModule$cate !== void 0 ? _extensionModule$cate : manifest.category : undefined;
11
12
  if (!node) {
12
13
  throw new Error("Couldn't find any action for ".concat(title, " (").concat(key, ")"));
13
14
  }
14
- return _objectSpread(_objectSpread(_objectSpread({}, isExperimentEnabled('platform_editor_slash_app_category_analytics') ? {
15
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, isExperimentEnabled('platform_editor_slash_app_category_analytics') ? {
15
16
  app: (_ref = (_extensionModule$app = extensionModule.app) !== null && _extensionModule$app !== void 0 ? _extensionModule$app : manifest.app) !== null && _ref !== void 0 ? _ref : {
16
17
  key: manifest.key
17
18
  }
@@ -21,8 +22,11 @@ export function buildMenuItem(manifest, extensionModule) {
21
22
  extensionType: manifest.type,
22
23
  extensionKey: manifest.key,
23
24
  keywords: extensionModule.keywords || manifest.keywords || [],
24
- featured: extensionModule.featured || false,
25
- categories: extensionModule.categories || manifest.categories || [],
25
+ featured: extensionModule.featured || false
26
+ }, category !== null && category !== void 0 && category.trim() ? {
27
+ category: category
28
+ } : {}), {}, {
29
+ categories: category !== null && category !== void 0 && category.trim() ? [category] : extensionModule.categories || manifest.categories || [],
26
30
  description: extensionModule.description || manifest.description,
27
31
  summary: manifest.summary,
28
32
  documentationUrl: manifest.documentationUrl,
@@ -295,6 +295,11 @@ export var syncBlockMessages = defineMessages({
295
295
  defaultMessage: 'Synced content will display <link>when the page is published</link>',
296
296
  description: 'Error message which is shown over sync block when the source page is unpublished.'
297
297
  },
298
+ unpublishedInParentheses: {
299
+ id: 'editor-common.messages.syncBlock.unpublishedInParentheses',
300
+ defaultMessage: '(unpublished)',
301
+ description: 'Parenthetical appended to a synced-block label when the source document is unpublished'
302
+ },
298
303
  unpublishedErrorJiraWorkItem: {
299
304
  id: 'fabric.editor.error.description.reference.unpublished.jiraWorkItem',
300
305
  defaultMessage: "Synced content will display <link>when the item's description is saved</link>",
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
20
20
  var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
21
21
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
22
22
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
23
- var packageVersion = "120.10.2";
23
+ var packageVersion = "120.10.4";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -0,0 +1,8 @@
1
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
+
3
+ /**
4
+ * Returns the Quick Insert categories active for the current experiment state.
5
+ */
6
+ export var getActiveQuickInsertCategories = function getActiveQuickInsertCategories(category, legacyCategories) {
7
+ return isExperimentEnabled('platform_editor_slash_command') && category !== null && category !== void 0 && category.trim() ? [category] : legacyCategories !== null && legacyCategories !== void 0 ? legacyCategories : [];
8
+ };
@@ -5,6 +5,7 @@ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol
5
5
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
6
6
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
7
  import { BLOCK_TEMPLATES_SECTION, DATA_AND_CHARTS_SECTION, EMBED_SECTION, MEDIA_SECTION, OTHER_SECTION, ROVO_SECTION, STRUCTURE_SECTION, TEXT_FORMATTING_SECTION } from './keys';
8
+ import { getActiveQuickInsertCategories } from './getActiveQuickInsertCategories';
8
9
  var categorySections = {
9
10
  admin: STRUCTURE_SECTION,
10
11
  ai: ROVO_SECTION,
@@ -26,15 +27,16 @@ var categorySections = {
26
27
  visuals: MEDIA_SECTION
27
28
  };
28
29
  export var getQuickInsertMenuItemParents = function getQuickInsertMenuItemParents(_ref) {
29
- var categories = _ref.categories,
30
+ var category = _ref.category,
31
+ legacyCategories = _ref.legacyCategories,
30
32
  rank = _ref.rank;
31
33
  var sections = new Map();
32
- var _iterator = _createForOfIteratorHelper(categories !== null && categories !== void 0 ? categories : []),
34
+ var _iterator = _createForOfIteratorHelper(getActiveQuickInsertCategories(category, legacyCategories)),
33
35
  _step;
34
36
  try {
35
37
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
36
- var category = _step.value;
37
- var section = categorySections[category.trim().toLowerCase()];
38
+ var itemCategory = _step.value;
39
+ var section = categorySections[itemCategory.trim().toLowerCase()];
38
40
  if (section) {
39
41
  sections.set(section.key, section);
40
42
  }
@@ -3,8 +3,8 @@ var _STRUCTURE_SECTION_RA;
3
3
  /* eslint-disable @atlaskit/volt-strict-mode/no-multiple-exports */
4
4
  import { ACTION_MENU_ITEM, AI_IMAGE_GENERATION_MENU_ITEM, ASK_ROVO_MENU_ITEM, ASSETS_MENU_ITEM, BLOCKQUOTE_MENU_ITEM, BLOCK_TEMPLATES_SECTION, CODE_BLOCK_MENU_ITEM, CUSTOM_PANEL_MENU_ITEM, DATE_MENU_ITEM, DATA_AND_CHARTS_SECTION, DECISION_MENU_ITEM, EMBED_SECTION, EMOJI_MENU_ITEM, ERROR_PANEL_MENU_ITEM, EXPAND_MENU_ITEM, FIVE_COLUMNS_LAYOUT_MENU_ITEM, FOUR_COLUMNS_LAYOUT_MENU_ITEM, HEADING_1_MENU_ITEM, HEADING_2_MENU_ITEM, HEADING_3_MENU_ITEM, HEADING_4_MENU_ITEM, HEADING_5_MENU_ITEM, HEADING_6_MENU_ITEM, HELP_DIALOG_MENU_ITEM, HYPERLINK_MENU_ITEM, INFO_PANEL_MENU_ITEM, JIRA_WORK_ITEMS_MENU_ITEM, LOOM_MENU_ITEM, MEDIA_INSERT_MENU_ITEM, MEDIA_SECTION, MENTION_MENU_ITEM, NOTE_PANEL_MENU_ITEM, ORDERED_LIST_MENU_ITEM, OTHER_SECTION, PLACEHOLDER_TEXT_MENU_ITEM, RECOMMENDED_SECTION, ROVO_SECTION, RULE_MENU_ITEM, STATUS_MENU_ITEM, STRUCTURE_SECTION, SUCCESS_PANEL_MENU_ITEM, SYNCED_BLOCK_MENU_ITEM, TABLE_MENU_ITEM, TEXT_FORMATTING_SECTION, THREE_COLUMNS_LAYOUT_MENU_ITEM, TWO_COLUMNS_LAYOUT_MENU_ITEM, UNORDERED_LIST_MENU_ITEM, WARNING_PANEL_MENU_ITEM } from './keys';
5
5
  export var QUICK_INSERT_MENU_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, RECOMMENDED_SECTION.key, 0), STRUCTURE_SECTION.key, 1), MEDIA_SECTION.key, 2), EMBED_SECTION.key, 3), TEXT_FORMATTING_SECTION.key, 4), ROVO_SECTION.key, 5), DATA_AND_CHARTS_SECTION.key, 6), BLOCK_TEMPLATES_SECTION.key, 7), OTHER_SECTION.key, 8);
6
- export var STRUCTURE_SECTION_RANK = (_STRUCTURE_SECTION_RA = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_STRUCTURE_SECTION_RA, ACTION_MENU_ITEM.key, 100), TABLE_MENU_ITEM.key, 200), STATUS_MENU_ITEM.key, 300), DATE_MENU_ITEM.key, 400), MENTION_MENU_ITEM.key, 500), EXPAND_MENU_ITEM.key, 700), CODE_BLOCK_MENU_ITEM.key, 800), INFO_PANEL_MENU_ITEM.key, 900), NOTE_PANEL_MENU_ITEM.key, 1000), SUCCESS_PANEL_MENU_ITEM.key, 1100), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_STRUCTURE_SECTION_RA, WARNING_PANEL_MENU_ITEM.key, 1200), ERROR_PANEL_MENU_ITEM.key, 1300), CUSTOM_PANEL_MENU_ITEM.key, 1400), TWO_COLUMNS_LAYOUT_MENU_ITEM.key, 1500), THREE_COLUMNS_LAYOUT_MENU_ITEM.key, 1600), FOUR_COLUMNS_LAYOUT_MENU_ITEM.key, 1700), FIVE_COLUMNS_LAYOUT_MENU_ITEM.key, 1800), SYNCED_BLOCK_MENU_ITEM.key, 2300), RULE_MENU_ITEM.key, 2400), DECISION_MENU_ITEM.key, 2800));
7
- export var MEDIA_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, MEDIA_INSERT_MENU_ITEM.key, 100), HYPERLINK_MENU_ITEM.key, 200), EMOJI_MENU_ITEM.key, 300), LOOM_MENU_ITEM.key, 400), AI_IMAGE_GENERATION_MENU_ITEM.key, 600);
6
+ export var STRUCTURE_SECTION_RANK = (_STRUCTURE_SECTION_RA = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_STRUCTURE_SECTION_RA, ACTION_MENU_ITEM.key, 100), TABLE_MENU_ITEM.key, 200), STATUS_MENU_ITEM.key, 300), DATE_MENU_ITEM.key, 400), EXPAND_MENU_ITEM.key, 700), CODE_BLOCK_MENU_ITEM.key, 800), INFO_PANEL_MENU_ITEM.key, 900), NOTE_PANEL_MENU_ITEM.key, 1000), SUCCESS_PANEL_MENU_ITEM.key, 1100), WARNING_PANEL_MENU_ITEM.key, 1200), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_STRUCTURE_SECTION_RA, ERROR_PANEL_MENU_ITEM.key, 1300), CUSTOM_PANEL_MENU_ITEM.key, 1400), TWO_COLUMNS_LAYOUT_MENU_ITEM.key, 1500), THREE_COLUMNS_LAYOUT_MENU_ITEM.key, 1600), FOUR_COLUMNS_LAYOUT_MENU_ITEM.key, 1700), FIVE_COLUMNS_LAYOUT_MENU_ITEM.key, 1800), SYNCED_BLOCK_MENU_ITEM.key, 2300), RULE_MENU_ITEM.key, 2400), DECISION_MENU_ITEM.key, 2800));
7
+ export var MEDIA_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, MEDIA_INSERT_MENU_ITEM.key, 100), HYPERLINK_MENU_ITEM.key, 200), EMOJI_MENU_ITEM.key, 300), LOOM_MENU_ITEM.key, 400), MENTION_MENU_ITEM.key, 1500), AI_IMAGE_GENERATION_MENU_ITEM.key, 1600);
8
8
  export var TEXT_FORMATTING_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, HEADING_1_MENU_ITEM.key, 100), HEADING_2_MENU_ITEM.key, 200), HEADING_3_MENU_ITEM.key, 300), HEADING_4_MENU_ITEM.key, 400), HEADING_5_MENU_ITEM.key, 500), HEADING_6_MENU_ITEM.key, 600), BLOCKQUOTE_MENU_ITEM.key, 700), PLACEHOLDER_TEXT_MENU_ITEM.key, 900), UNORDERED_LIST_MENU_ITEM.key, 1100), ORDERED_LIST_MENU_ITEM.key, 1200);
9
9
  export var ROVO_SECTION_RANK = _defineProperty({}, ASK_ROVO_MENU_ITEM.key, 100);
10
10
  export var DATA_AND_CHARTS_SECTION_RANK = _defineProperty(_defineProperty({}, JIRA_WORK_ITEMS_MENU_ITEM.key, 300), ASSETS_MENU_ITEM.key, 500);
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags/fg';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "120.10.2";
24
+ var packageVersion = "120.10.4";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -37,6 +37,11 @@ export type ExtensionModule<T extends Parameters = Parameters> = {
37
37
  action: ExtensionModuleAction<T>;
38
38
  app?: ExtensionApp;
39
39
  categories?: string[];
40
+ /**
41
+ * The Quick Insert category for this module. Takes precedence over the
42
+ * legacy `categories` field while both are supported.
43
+ */
44
+ category?: string;
40
45
  description?: string;
41
46
  featured?: boolean;
42
47
  icon?: () => ExtensionIconModule;
@@ -116,6 +121,11 @@ export type ExtensionManifest<T extends Parameters = Parameters> = {
116
121
  matchers: Array<AutoConvertMatches>;
117
122
  };
118
123
  categories?: string[];
124
+ /**
125
+ * The Quick Insert category for modules that do not provide one. Takes
126
+ * precedence over the legacy `categories` field while both are supported.
127
+ */
128
+ category?: string;
119
129
  deprecation?: ExtensionDeprecationStatus;
120
130
  description?: string;
121
131
  documentationUrl?: string;
@@ -4,6 +4,7 @@ import type { ExtensionApp, ExtensionKey, ExtensionModuleActionHandler, Extensio
4
4
  export type MenuItem = {
5
5
  app?: ExtensionApp;
6
6
  categories: string[];
7
+ category?: string;
7
8
  description?: string;
8
9
  documentationUrl?: string;
9
10
  extensionKey: ExtensionKey;
@@ -484,6 +484,11 @@ export declare const syncBlockMessages: {
484
484
  description: string;
485
485
  id: string;
486
486
  };
487
+ unpublishedInParentheses: {
488
+ defaultMessage: string;
489
+ description: string;
490
+ id: string;
491
+ };
487
492
  unpublishedLocalReferenceAvailabilityTooltip: {
488
493
  defaultMessage: string;
489
494
  description: string;
@@ -21,6 +21,11 @@ export type QuickInsertItem = TypeAheadItem & {
21
21
  app?: ExtensionApp;
22
22
  /** categories where to find the item */
23
23
  categories?: Array<string>;
24
+ /**
25
+ * The Quick Insert category for this item. Takes precedence over the
26
+ * legacy `categories` field while both are supported.
27
+ */
28
+ category?: string;
24
29
  /** indicates if the item will be highlighted where appropriate (plus menu for now) */
25
30
  featured?: boolean;
26
31
  /** optional identifier */
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Returns the Quick Insert categories active for the current experiment state.
3
+ */
4
+ export declare const getActiveQuickInsertCategories: (category?: string, legacyCategories?: string[]) => string[];
@@ -2,8 +2,9 @@ type MenuSection = {
2
2
  key: string;
3
3
  type: 'menu-section';
4
4
  };
5
- export declare const getQuickInsertMenuItemParents: ({ categories, rank, }: {
6
- categories?: string[];
5
+ export declare const getQuickInsertMenuItemParents: ({ category, legacyCategories, rank, }: {
6
+ category?: string;
7
+ legacyCategories?: string[];
7
8
  rank: number;
8
9
  }) => Array<MenuSection & {
9
10
  rank: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "120.10.3",
3
+ "version": "120.11.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/"
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/feature-gate-js-client": "^6.0.0",
55
55
  "@atlaskit/icon": "^37.6.0",
56
56
  "@atlaskit/link": "^5.1.0",
57
- "@atlaskit/link-datasource": "^6.8.0",
57
+ "@atlaskit/link-datasource": "^6.9.0",
58
58
  "@atlaskit/link-picker": "^6.6.0",
59
59
  "@atlaskit/media-card": "^81.9.0",
60
60
  "@atlaskit/media-client": "^37.6.0",
@@ -84,7 +84,7 @@
84
84
  "@atlaskit/task-decision": "^21.9.0",
85
85
  "@atlaskit/teams-app-config": "^3.0.0",
86
86
  "@atlaskit/textfield": "^10.2.0",
87
- "@atlaskit/tmp-editor-statsig": "^171.0.0",
87
+ "@atlaskit/tmp-editor-statsig": "^172.0.0",
88
88
  "@atlaskit/tokens": "^16.11.0",
89
89
  "@atlaskit/tooltip": "^24.3.0",
90
90
  "@atlaskit/width-detector": "^7.2.0",
@@ -145,24 +145,6 @@
145
145
  "react-test-renderer": "^18.2.0",
146
146
  "sinon": "^2.2.0"
147
147
  },
148
- "techstack": {
149
- "@atlassian/frontend": {
150
- "circular-dependencies": [
151
- "file-level"
152
- ],
153
- "import-structure": "atlassian-conventions"
154
- },
155
- "@repo/internal": {
156
- "deprecation": "no-deprecated-imports",
157
- "design-tokens": [
158
- "color"
159
- ],
160
- "styling": [
161
- "emotion",
162
- "compiled"
163
- ]
164
- }
165
- },
166
148
  "platform-feature-flags": {
167
149
  "platform_editor_blocks_patch_7": {
168
150
  "type": "boolean",
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/quick-insert/get-active-quick-insert-categories",
3
+ "main": "../../dist/cjs/quick-insert/getActiveQuickInsertCategories.js",
4
+ "module": "../../dist/esm/quick-insert/getActiveQuickInsertCategories.js",
5
+ "module:es2019": "../../dist/es2019/quick-insert/getActiveQuickInsertCategories.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../../dist/types/quick-insert/getActiveQuickInsertCategories.d.ts"
10
+ }