@atlaskit/editor-common 120.10.4 → 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 (36) hide show
  1. package/CHANGELOG.md +17 -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/extensions/buildMenuItem.js +8 -4
  5. package/dist/cjs/messages/syncBlock.js +5 -0
  6. package/dist/cjs/monitoring/error.js +1 -1
  7. package/dist/cjs/quick-insert/getActiveQuickInsertCategories.js +13 -0
  8. package/dist/cjs/quick-insert/getQuickInsertMenuItemParents.js +6 -4
  9. package/dist/cjs/quick-insert/rank.js +2 -2
  10. package/dist/cjs/ui/DropList/index.js +1 -1
  11. package/dist/es2019/element-browser/ElementBrowser.js +2 -1
  12. package/dist/es2019/element-browser/components/ElementList/ElementList.js +2 -2
  13. package/dist/es2019/extensions/buildMenuItem.js +8 -2
  14. package/dist/es2019/messages/syncBlock.js +5 -0
  15. package/dist/es2019/monitoring/error.js +1 -1
  16. package/dist/es2019/quick-insert/getActiveQuickInsertCategories.js +6 -0
  17. package/dist/es2019/quick-insert/getQuickInsertMenuItemParents.js +5 -3
  18. package/dist/es2019/quick-insert/rank.js +2 -2
  19. package/dist/es2019/ui/DropList/index.js +1 -1
  20. package/dist/esm/element-browser/ElementBrowser.js +2 -1
  21. package/dist/esm/element-browser/components/ElementList/ElementList.js +2 -2
  22. package/dist/esm/extensions/buildMenuItem.js +8 -4
  23. package/dist/esm/messages/syncBlock.js +5 -0
  24. package/dist/esm/monitoring/error.js +1 -1
  25. package/dist/esm/quick-insert/getActiveQuickInsertCategories.js +8 -0
  26. package/dist/esm/quick-insert/getQuickInsertMenuItemParents.js +6 -4
  27. package/dist/esm/quick-insert/rank.js +2 -2
  28. package/dist/esm/ui/DropList/index.js +1 -1
  29. package/dist/types/extensions/types/extension-manifest.d.ts +10 -0
  30. package/dist/types/extensions/types/utils.d.ts +1 -0
  31. package/dist/types/messages/syncBlock.d.ts +5 -0
  32. package/dist/types/provider-factory/quick-insert-provider.d.ts +5 -0
  33. package/dist/types/quick-insert/getActiveQuickInsertCategories.d.ts +4 -0
  34. package/dist/types/quick-insert/getQuickInsertMenuItemParents.d.ts +3 -2
  35. package/package.json +3 -21
  36. package/quick-insert/get-active-quick-insert-categories/package.json +10 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
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
+
3
20
  ## 120.10.4
4
21
 
5
22
  ### 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 () {
@@ -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.3";
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.3";
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(() => ({
@@ -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.3";
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.3";
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 () {
@@ -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.3";
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.3";
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.4",
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
+ }