@atlaskit/editor-common 120.10.4 → 120.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +38 -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/cjs/vanilla-tooltip/index.js +96 -25
  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/extensions/buildMenuItem.js +8 -2
  15. package/dist/es2019/messages/syncBlock.js +5 -0
  16. package/dist/es2019/monitoring/error.js +1 -1
  17. package/dist/es2019/quick-insert/getActiveQuickInsertCategories.js +6 -0
  18. package/dist/es2019/quick-insert/getQuickInsertMenuItemParents.js +5 -3
  19. package/dist/es2019/quick-insert/rank.js +2 -2
  20. package/dist/es2019/ui/DropList/index.js +1 -1
  21. package/dist/es2019/vanilla-tooltip/index.js +96 -27
  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/extensions/buildMenuItem.js +8 -4
  25. package/dist/esm/messages/syncBlock.js +5 -0
  26. package/dist/esm/monitoring/error.js +1 -1
  27. package/dist/esm/quick-insert/getActiveQuickInsertCategories.js +8 -0
  28. package/dist/esm/quick-insert/getQuickInsertMenuItemParents.js +6 -4
  29. package/dist/esm/quick-insert/rank.js +2 -2
  30. package/dist/esm/ui/DropList/index.js +1 -1
  31. package/dist/esm/vanilla-tooltip/index.js +96 -25
  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/dist/types/vanilla-tooltip/index.d.ts +9 -0
  39. package/package.json +3 -21
  40. package/quick-insert/get-active-quick-insert-categories/package.json +10 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 120.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3ae04490ac0f4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3ae04490ac0f4) -
8
+ Render the disabled mention chip tooltip without React. Behind the
9
+ `platform_editor_use_vanilla_components` experiment, with no visual change.
10
+ - Disabled mention chips no longer mount a React tooltip, its portal, and the DOM-to-React event
11
+ bridge that fed it.
12
+ - Tooltips release their positioning instance when they close, rather than keeping one alive per
13
+ hovered chip.
14
+ - Tooltips remove their own element and attributes when destroyed, so mention and emoji chips no
15
+ longer leave orphaned popovers behind.
16
+ - Re-hovering a tooltip while it is closing keeps it open, matching `@atlaskit/tooltip`.
17
+ Previously the pending hide still landed and the tooltip disappeared under the pointer.
18
+ - Tooltips close when they hide, instead of waiting on a transition that nothing declares.
19
+ Required by the change above: releasing the positioning instance while the popover was still
20
+ open left it behind as an invisible hit target over the content.
21
+
22
+ - Updated dependencies
23
+
24
+ ## 120.11.0
25
+
26
+ ### Minor Changes
27
+
28
+ - [`25ed290dcc443`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/25ed290dcc443) -
29
+ Add Quick Insert category selection support for slash commands behind the
30
+ platform_editor_slash_command feature flag.
31
+
32
+ ### Patch Changes
33
+
34
+ - [`8db4908d60862`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8db4908d60862) -
35
+ Clean up experiment platform_editor_plus_menu_aria_label
36
+ - [`167dc88b2c79c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/167dc88b2c79c) -
37
+ Show unpublished state in synced-block labels and open the publish tooltip from the whole label,
38
+ behind the `editor-synced-block-same-page-sync` experiment
39
+ - Updated dependencies
40
+
3
41
  ## 120.10.4
4
42
 
5
43
  ### 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.11.0";
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.11.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -164,14 +164,37 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
164
164
  }));
165
165
  }
166
166
 
167
- // Hide the tooltip if the hide transition has completed
168
- this.tooltip.ontransitionend = function () {
169
- if (_this.shouldHidePopover) {
170
- _this.tooltip.hidePopover();
171
- }
172
- };
167
+ // Hide the tooltip if the hide transition has completed.
168
+ //
169
+ // Only reachable in the control arm: no consumer declares a transition on the tooltip, so
170
+ // this never fires today, and the experiment closes the popover in `hide()` regardless.
171
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
172
+ this.tooltip.ontransitionend = function () {
173
+ if (_this.shouldHidePopover) {
174
+ _this.tooltip.hidePopover();
175
+ }
176
+ };
177
+ }
173
178
  }
179
+
180
+ /**
181
+ * Closes the popover, tolerating it already being closed.
182
+ *
183
+ * `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
184
+ * routine state rather than an exceptional one: showing any other `hint` or `auto` popover
185
+ * light-dismisses this one without notifying us, so the caller cannot know whether it is
186
+ * still open.
187
+ */
174
188
  return (0, _createClass2.default)(VanillaTooltip, [{
189
+ key: "closePopover",
190
+ value: function closePopover() {
191
+ try {
192
+ this.tooltip.hidePopover();
193
+ } catch (_error) {
194
+ // Already closed — nothing to do.
195
+ }
196
+ }
197
+ }, {
175
198
  key: "createPopperInstance",
176
199
  value: function createPopperInstance() {
177
200
  this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
@@ -192,6 +215,18 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
192
215
  this.listeners.forEach(function (listener) {
193
216
  listener();
194
217
  });
218
+
219
+ // Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
220
+ // callers are moving off, whose unmount took its DOM with it.
221
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
222
+ this.tooltip.remove();
223
+ if (this.trigger.getAttribute('aria-describedby') === this.tooltip.id) {
224
+ this.trigger.removeAttribute('aria-describedby');
225
+ }
226
+ if (this.trigger.getAttribute('popovertarget') === this.tooltip.id) {
227
+ this.trigger.removeAttribute('popovertarget');
228
+ }
229
+ }
195
230
  }
196
231
 
197
232
  /**
@@ -243,20 +278,48 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
243
278
  this.shouldHidePopover = true;
244
279
  // Disable the event listeners
245
280
  this.currentTimeoutId = setTimeout(function () {
246
- var _this3$popperInstance;
247
- (_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.setOptions(function (options) {
248
- return _objectSpread(_objectSpread({}, options), {}, {
249
- modifiers: [startingOffset, {
250
- name: 'eventListeners',
251
- enabled: false
252
- }]
281
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
282
+ var _this3$popperInstance;
283
+ // Released rather than reconfigured. The instance was previously kept for the
284
+ // trigger's whole lifetime, so every element the pointer passed over retained
285
+ // one — and under `platform-dst-popper-consolidation` an instance owns a
286
+ // detached React root, so that was a retained root per hovered trigger.
287
+ //
288
+ // Destroying is also the only way to release that root's capture-phase
289
+ // `scroll`/`resize` listeners on the consolidated path, where the
290
+ // `eventListeners: false` reconfiguration in the control arm is accepted but
291
+ // does nothing.
292
+ (_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.destroy();
293
+ _this3.popperInstance = undefined;
294
+ _this3.tooltip.style.opacity = '0';
295
+ _this3.isDisplayed = false;
296
+
297
+ // Closed here rather than from `ontransitionend`. No consumer declares a
298
+ // transition on the tooltip and none sets one inline, so that event never
299
+ // fires and the popover stayed open in the top layer for good: an invisible
300
+ // hit target over the content, and — because `showPopover()` throws
301
+ // `InvalidStateError` on an already-showing popover — an uncaught error out of
302
+ // the next `mouseenter`, after which the tooltip never appeared again.
303
+ _this3.closePopover();
304
+ // Paired with the `visibility` that `show()` sets, so a popover left open by
305
+ // a failed close cannot intercept pointer events over the content.
306
+ _this3.tooltip.style.visibility = 'hidden';
307
+ } else {
308
+ var _this3$popperInstance2;
309
+ (_this3$popperInstance2 = _this3.popperInstance) === null || _this3$popperInstance2 === void 0 || _this3$popperInstance2.setOptions(function (options) {
310
+ return _objectSpread(_objectSpread({}, options), {}, {
311
+ modifiers: [startingOffset, {
312
+ name: 'eventListeners',
313
+ enabled: false
314
+ }]
315
+ });
253
316
  });
254
- });
255
- _this3.tooltip.style.opacity = '0';
256
- _this3.isDisplayed = false;
257
- // If transition animations are disabled immediately hide the popover
258
- if (_this3.tooltip.style.transition === 'none') {
259
- _this3.tooltip.hidePopover();
317
+ _this3.tooltip.style.opacity = '0';
318
+ _this3.isDisplayed = false;
319
+ // If transition animations are disabled immediately hide the popover
320
+ if (_this3.tooltip.style.transition === 'none') {
321
+ _this3.tooltip.hidePopover();
322
+ }
260
323
  }
261
324
  }, immediate ? 0 : this.timeout);
262
325
  }
@@ -264,18 +327,26 @@ var VanillaTooltip = exports.VanillaTooltip = /*#__PURE__*/function () {
264
327
  key: "show",
265
328
  value: function show() {
266
329
  var _this4 = this;
267
- // Bound before the open delay so Escape can dismiss during it, and before the
268
- // `isDisplayed` guard so re-hovering a tooltip whose hide is still pending (`hide()`
269
- // unbinds synchronously, but the tooltip stays on screen until its timeout) restores
270
- // Escape rather than leaving the visible tooltip undismissable.
330
+ // Ahead of the `isDisplayed` guard, unlike the equivalent below: `hide()` takes effect
331
+ // synchronously but leaves the tooltip on screen until its timeout, so a pointer
332
+ // returning in that window finds `isDisplayed` still true and returns early. Cancelling
333
+ // first keeps the tooltip up and stops it being left undismissable with a hide pending.
271
334
  if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
272
335
  this.bindEscapeListener();
336
+ clearTimeout(this.currentTimeoutId);
337
+ this.shouldHidePopover = false;
273
338
  }
274
339
  if (this.isDisplayed) {
275
340
  return;
276
341
  }
277
- clearTimeout(this.currentTimeoutId);
278
- this.shouldHidePopover = false;
342
+
343
+ // Control only: the experiment cancels above, ahead of the guard. Kept gated rather than
344
+ // left unconditional — despite being a no-op once the block above has run — so that
345
+ // experiment cleanup can delete it outright instead of having to reason about it.
346
+ if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
347
+ clearTimeout(this.currentTimeoutId);
348
+ this.shouldHidePopover = false;
349
+ }
279
350
 
280
351
  // Make the tooltip visible - but hide until
281
352
  this.tooltip.style.visibility = 'hidden';
@@ -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.11.0";
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.11.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -142,12 +142,33 @@ export class VanillaTooltip {
142
142
  }));
143
143
  }
144
144
 
145
- // Hide the tooltip if the hide transition has completed
146
- this.tooltip.ontransitionend = () => {
147
- if (this.shouldHidePopover) {
148
- this.tooltip.hidePopover();
149
- }
150
- };
145
+ // Hide the tooltip if the hide transition has completed.
146
+ //
147
+ // Only reachable in the control arm: no consumer declares a transition on the tooltip, so
148
+ // this never fires today, and the experiment closes the popover in `hide()` regardless.
149
+ if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
150
+ this.tooltip.ontransitionend = () => {
151
+ if (this.shouldHidePopover) {
152
+ this.tooltip.hidePopover();
153
+ }
154
+ };
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Closes the popover, tolerating it already being closed.
160
+ *
161
+ * `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
162
+ * routine state rather than an exceptional one: showing any other `hint` or `auto` popover
163
+ * light-dismisses this one without notifying us, so the caller cannot know whether it is
164
+ * still open.
165
+ */
166
+ closePopover() {
167
+ try {
168
+ this.tooltip.hidePopover();
169
+ } catch (_error) {
170
+ // Already closed — nothing to do.
171
+ }
151
172
  }
152
173
  createPopperInstance() {
153
174
  this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
@@ -166,6 +187,18 @@ export class VanillaTooltip {
166
187
  this.listeners.forEach(listener => {
167
188
  listener();
168
189
  });
190
+
191
+ // Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
192
+ // callers are moving off, whose unmount took its DOM with it.
193
+ if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
194
+ this.tooltip.remove();
195
+ if (this.trigger.getAttribute('aria-describedby') === this.tooltip.id) {
196
+ this.trigger.removeAttribute('aria-describedby');
197
+ }
198
+ if (this.trigger.getAttribute('popovertarget') === this.tooltip.id) {
199
+ this.trigger.removeAttribute('popovertarget');
200
+ }
201
+ }
169
202
  }
170
203
 
171
204
  /**
@@ -208,35 +241,71 @@ export class VanillaTooltip {
208
241
  this.shouldHidePopover = true;
209
242
  // Disable the event listeners
210
243
  this.currentTimeoutId = setTimeout(() => {
211
- var _this$popperInstance2;
212
- (_this$popperInstance2 = this.popperInstance) === null || _this$popperInstance2 === void 0 ? void 0 : _this$popperInstance2.setOptions(options => ({
213
- ...options,
214
- modifiers: [startingOffset, {
215
- name: 'eventListeners',
216
- enabled: false
217
- }]
218
- }));
219
- this.tooltip.style.opacity = '0';
220
- this.isDisplayed = false;
221
- // If transition animations are disabled immediately hide the popover
222
- if (this.tooltip.style.transition === 'none') {
223
- this.tooltip.hidePopover();
244
+ if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
245
+ var _this$popperInstance2;
246
+ // Released rather than reconfigured. The instance was previously kept for the
247
+ // trigger's whole lifetime, so every element the pointer passed over retained
248
+ // one — and under `platform-dst-popper-consolidation` an instance owns a
249
+ // detached React root, so that was a retained root per hovered trigger.
250
+ //
251
+ // Destroying is also the only way to release that root's capture-phase
252
+ // `scroll`/`resize` listeners on the consolidated path, where the
253
+ // `eventListeners: false` reconfiguration in the control arm is accepted but
254
+ // does nothing.
255
+ (_this$popperInstance2 = this.popperInstance) === null || _this$popperInstance2 === void 0 ? void 0 : _this$popperInstance2.destroy();
256
+ this.popperInstance = undefined;
257
+ this.tooltip.style.opacity = '0';
258
+ this.isDisplayed = false;
259
+
260
+ // Closed here rather than from `ontransitionend`. No consumer declares a
261
+ // transition on the tooltip and none sets one inline, so that event never
262
+ // fires and the popover stayed open in the top layer for good: an invisible
263
+ // hit target over the content, and — because `showPopover()` throws
264
+ // `InvalidStateError` on an already-showing popover — an uncaught error out of
265
+ // the next `mouseenter`, after which the tooltip never appeared again.
266
+ this.closePopover();
267
+ // Paired with the `visibility` that `show()` sets, so a popover left open by
268
+ // a failed close cannot intercept pointer events over the content.
269
+ this.tooltip.style.visibility = 'hidden';
270
+ } else {
271
+ var _this$popperInstance3;
272
+ (_this$popperInstance3 = this.popperInstance) === null || _this$popperInstance3 === void 0 ? void 0 : _this$popperInstance3.setOptions(options => ({
273
+ ...options,
274
+ modifiers: [startingOffset, {
275
+ name: 'eventListeners',
276
+ enabled: false
277
+ }]
278
+ }));
279
+ this.tooltip.style.opacity = '0';
280
+ this.isDisplayed = false;
281
+ // If transition animations are disabled immediately hide the popover
282
+ if (this.tooltip.style.transition === 'none') {
283
+ this.tooltip.hidePopover();
284
+ }
224
285
  }
225
286
  }, immediate ? 0 : this.timeout);
226
287
  }
227
288
  show() {
228
- // Bound before the open delay so Escape can dismiss during it, and before the
229
- // `isDisplayed` guard so re-hovering a tooltip whose hide is still pending (`hide()`
230
- // unbinds synchronously, but the tooltip stays on screen until its timeout) restores
231
- // Escape rather than leaving the visible tooltip undismissable.
289
+ // Ahead of the `isDisplayed` guard, unlike the equivalent below: `hide()` takes effect
290
+ // synchronously but leaves the tooltip on screen until its timeout, so a pointer
291
+ // returning in that window finds `isDisplayed` still true and returns early. Cancelling
292
+ // first keeps the tooltip up and stops it being left undismissable with a hide pending.
232
293
  if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
233
294
  this.bindEscapeListener();
295
+ clearTimeout(this.currentTimeoutId);
296
+ this.shouldHidePopover = false;
234
297
  }
235
298
  if (this.isDisplayed) {
236
299
  return;
237
300
  }
238
- clearTimeout(this.currentTimeoutId);
239
- this.shouldHidePopover = false;
301
+
302
+ // Control only: the experiment cancels above, ahead of the guard. Kept gated rather than
303
+ // left unconditional — despite being a no-op once the block above has run — so that
304
+ // experiment cleanup can delete it outright instead of having to reason about it.
305
+ if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
306
+ clearTimeout(this.currentTimeoutId);
307
+ this.shouldHidePopover = false;
308
+ }
240
309
 
241
310
  // Make the tooltip visible - but hide until
242
311
  this.tooltip.style.visibility = 'hidden';
@@ -251,10 +320,10 @@ export class VanillaTooltip {
251
320
 
252
321
  // Enable the event listeners
253
322
  this.currentTimeoutId = setTimeout(() => {
254
- var _this$popperInstance3, _this$onShow;
323
+ var _this$popperInstance4, _this$onShow;
255
324
  this.tooltip.style.opacity = '1';
256
325
  this.tooltip.style.visibility = 'visible';
257
- (_this$popperInstance3 = this.popperInstance) === null || _this$popperInstance3 === void 0 ? void 0 : _this$popperInstance3.setOptions(options => ({
326
+ (_this$popperInstance4 = this.popperInstance) === null || _this$popperInstance4 === void 0 ? void 0 : _this$popperInstance4.setOptions(options => ({
258
327
  ...options,
259
328
  modifiers: [endingOffset, {
260
329
  name: 'eventListeners',
@@ -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.11.0";
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.11.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -157,14 +157,37 @@ export var VanillaTooltip = /*#__PURE__*/function () {
157
157
  }));
158
158
  }
159
159
 
160
- // Hide the tooltip if the hide transition has completed
161
- this.tooltip.ontransitionend = function () {
162
- if (_this.shouldHidePopover) {
163
- _this.tooltip.hidePopover();
164
- }
165
- };
160
+ // Hide the tooltip if the hide transition has completed.
161
+ //
162
+ // Only reachable in the control arm: no consumer declares a transition on the tooltip, so
163
+ // this never fires today, and the experiment closes the popover in `hide()` regardless.
164
+ if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
165
+ this.tooltip.ontransitionend = function () {
166
+ if (_this.shouldHidePopover) {
167
+ _this.tooltip.hidePopover();
168
+ }
169
+ };
170
+ }
166
171
  }
172
+
173
+ /**
174
+ * Closes the popover, tolerating it already being closed.
175
+ *
176
+ * `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
177
+ * routine state rather than an exceptional one: showing any other `hint` or `auto` popover
178
+ * light-dismisses this one without notifying us, so the caller cannot know whether it is
179
+ * still open.
180
+ */
167
181
  return _createClass(VanillaTooltip, [{
182
+ key: "closePopover",
183
+ value: function closePopover() {
184
+ try {
185
+ this.tooltip.hidePopover();
186
+ } catch (_error) {
187
+ // Already closed — nothing to do.
188
+ }
189
+ }
190
+ }, {
168
191
  key: "createPopperInstance",
169
192
  value: function createPopperInstance() {
170
193
  this.popperInstance = getCreatePopper()(this.trigger, this.tooltip, {
@@ -185,6 +208,18 @@ export var VanillaTooltip = /*#__PURE__*/function () {
185
208
  this.listeners.forEach(function (listener) {
186
209
  listener();
187
210
  });
211
+
212
+ // Undoes what the constructor added to the trigger, matching the React `@atlaskit/tooltip`
213
+ // callers are moving off, whose unmount took its DOM with it.
214
+ if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
215
+ this.tooltip.remove();
216
+ if (this.trigger.getAttribute('aria-describedby') === this.tooltip.id) {
217
+ this.trigger.removeAttribute('aria-describedby');
218
+ }
219
+ if (this.trigger.getAttribute('popovertarget') === this.tooltip.id) {
220
+ this.trigger.removeAttribute('popovertarget');
221
+ }
222
+ }
188
223
  }
189
224
 
190
225
  /**
@@ -236,20 +271,48 @@ export var VanillaTooltip = /*#__PURE__*/function () {
236
271
  this.shouldHidePopover = true;
237
272
  // Disable the event listeners
238
273
  this.currentTimeoutId = setTimeout(function () {
239
- var _this3$popperInstance;
240
- (_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.setOptions(function (options) {
241
- return _objectSpread(_objectSpread({}, options), {}, {
242
- modifiers: [startingOffset, {
243
- name: 'eventListeners',
244
- enabled: false
245
- }]
274
+ if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
275
+ var _this3$popperInstance;
276
+ // Released rather than reconfigured. The instance was previously kept for the
277
+ // trigger's whole lifetime, so every element the pointer passed over retained
278
+ // one — and under `platform-dst-popper-consolidation` an instance owns a
279
+ // detached React root, so that was a retained root per hovered trigger.
280
+ //
281
+ // Destroying is also the only way to release that root's capture-phase
282
+ // `scroll`/`resize` listeners on the consolidated path, where the
283
+ // `eventListeners: false` reconfiguration in the control arm is accepted but
284
+ // does nothing.
285
+ (_this3$popperInstance = _this3.popperInstance) === null || _this3$popperInstance === void 0 || _this3$popperInstance.destroy();
286
+ _this3.popperInstance = undefined;
287
+ _this3.tooltip.style.opacity = '0';
288
+ _this3.isDisplayed = false;
289
+
290
+ // Closed here rather than from `ontransitionend`. No consumer declares a
291
+ // transition on the tooltip and none sets one inline, so that event never
292
+ // fires and the popover stayed open in the top layer for good: an invisible
293
+ // hit target over the content, and — because `showPopover()` throws
294
+ // `InvalidStateError` on an already-showing popover — an uncaught error out of
295
+ // the next `mouseenter`, after which the tooltip never appeared again.
296
+ _this3.closePopover();
297
+ // Paired with the `visibility` that `show()` sets, so a popover left open by
298
+ // a failed close cannot intercept pointer events over the content.
299
+ _this3.tooltip.style.visibility = 'hidden';
300
+ } else {
301
+ var _this3$popperInstance2;
302
+ (_this3$popperInstance2 = _this3.popperInstance) === null || _this3$popperInstance2 === void 0 || _this3$popperInstance2.setOptions(function (options) {
303
+ return _objectSpread(_objectSpread({}, options), {}, {
304
+ modifiers: [startingOffset, {
305
+ name: 'eventListeners',
306
+ enabled: false
307
+ }]
308
+ });
246
309
  });
247
- });
248
- _this3.tooltip.style.opacity = '0';
249
- _this3.isDisplayed = false;
250
- // If transition animations are disabled immediately hide the popover
251
- if (_this3.tooltip.style.transition === 'none') {
252
- _this3.tooltip.hidePopover();
310
+ _this3.tooltip.style.opacity = '0';
311
+ _this3.isDisplayed = false;
312
+ // If transition animations are disabled immediately hide the popover
313
+ if (_this3.tooltip.style.transition === 'none') {
314
+ _this3.tooltip.hidePopover();
315
+ }
253
316
  }
254
317
  }, immediate ? 0 : this.timeout);
255
318
  }
@@ -257,18 +320,26 @@ export var VanillaTooltip = /*#__PURE__*/function () {
257
320
  key: "show",
258
321
  value: function show() {
259
322
  var _this4 = this;
260
- // Bound before the open delay so Escape can dismiss during it, and before the
261
- // `isDisplayed` guard so re-hovering a tooltip whose hide is still pending (`hide()`
262
- // unbinds synchronously, but the tooltip stays on screen until its timeout) restores
263
- // Escape rather than leaving the visible tooltip undismissable.
323
+ // Ahead of the `isDisplayed` guard, unlike the equivalent below: `hide()` takes effect
324
+ // synchronously but leaves the tooltip on screen until its timeout, so a pointer
325
+ // returning in that window finds `isDisplayed` still true and returns early. Cancelling
326
+ // first keeps the tooltip up and stops it being left undismissable with a hide pending.
264
327
  if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
265
328
  this.bindEscapeListener();
329
+ clearTimeout(this.currentTimeoutId);
330
+ this.shouldHidePopover = false;
266
331
  }
267
332
  if (this.isDisplayed) {
268
333
  return;
269
334
  }
270
- clearTimeout(this.currentTimeoutId);
271
- this.shouldHidePopover = false;
335
+
336
+ // Control only: the experiment cancels above, ahead of the guard. Kept gated rather than
337
+ // left unconditional — despite being a no-op once the block above has run — so that
338
+ // experiment cleanup can delete it outright instead of having to reason about it.
339
+ if (!isExperimentEnabled('platform_editor_use_vanilla_components')) {
340
+ clearTimeout(this.currentTimeoutId);
341
+ this.shouldHidePopover = false;
342
+ }
272
343
 
273
344
  // Make the tooltip visible - but hide until
274
345
  this.tooltip.style.visibility = 'hidden';
@@ -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;
@@ -76,6 +76,15 @@ export declare class VanillaTooltip {
76
76
  * the `onShow` semantics of "@atlaskit/tooltip".
77
77
  */
78
78
  onShow?: (() => void) | undefined);
79
+ /**
80
+ * Closes the popover, tolerating it already being closed.
81
+ *
82
+ * `hidePopover()` throws `InvalidStateError` when the popover is not showing, and that is a
83
+ * routine state rather than an exceptional one: showing any other `hint` or `auto` popover
84
+ * light-dismisses this one without notifying us, so the caller cannot know whether it is
85
+ * still open.
86
+ */
87
+ private closePopover;
79
88
  private createPopperInstance;
80
89
  destroy(): void;
81
90
  /**
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.1",
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.10.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
+ }