@atlaskit/editor-plugin-quick-insert 26.0.5 → 26.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # @atlaskit/editor-plugin-quick-insert
2
2
 
3
+ ## 26.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 26.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 26.1.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`1c4db454a74a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c4db454a74a2) -
20
+ Registered menu hosts can override section and item ranks through getItemRank in the shared
21
+ ordering used by Quick Insert, type-ahead, and insert menus. Rovo editor presets group these
22
+ settings under quickInsertOptions. Typeahead handlers expose getRegisteredItemRank with a
23
+ RegisteredItemRankResolver that receives the registered component and its ranked parent. Skill
24
+ manifests and adapters accept visibility predicates that follow current chat state without
25
+ rebuilding registrations.
26
+
27
+ Under platform_editor_slash_command, main and inline Rovo chat show Rovo commands first and use
28
+ specialist placeholders. The chat skills layer receives selectedAgentId and respects the existing
29
+ enableSkillsInSpecialistPromptInput setting. Treatment keeps registrations and evaluates
30
+ visibility per item. Control keeps the legacy full-or-empty manifest and the same host opt-in.
31
+ Search mode and an existing prompt skill still prevent insertion.
32
+
33
+ Affected Jira, JSM, and Confluence skills require the signed-in user's product access at the site,
34
+ in addition to backend filtering of declared site entitlements. Skill Builder needs Studio and the
35
+ signed-in user's Rovo AI entitlement for that site. Eligibility requests follow site changes; user
36
+ identity remains stable during the signed-in session. Visibility reads committed React state and
37
+ supports server rendering.
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies
42
+
3
43
  ## 26.0.5
4
44
 
5
45
  ### Patch Changes
@@ -13,6 +13,7 @@ var _react = _interopRequireDefault(require("react"));
13
13
  var _reactIntl = require("react-intl");
14
14
  var _isSsr = require("@atlaskit/editor-common/is-ssr");
15
15
  var _insertBlock = require("@atlaskit/editor-common/messages/insert-block");
16
+ var _quickInsertRank = require("@atlaskit/editor-common/quick-insert/quick-insert-rank");
16
17
  var _utils = require("@atlaskit/editor-common/quick-insert/utils");
17
18
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
18
19
  var _typeAhead = require("@atlaskit/editor-common/type-ahead");
@@ -40,8 +41,10 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
40
41
  options === null || options === void 0 || (_options$onInsert = options.onInsert) === null || _options$onInsert === void 0 || _options$onInsert.call(options, item);
41
42
  };
42
43
  var typeAheadPrioritySortingFn = (0, _search.withLayoutQuickInsertPrioritySorting)(options === null || options === void 0 ? void 0 : options.prioritySortingFn);
44
+ var getItemRank = (0, _quickInsertRank.createQuickInsertRankResolver)(options === null || options === void 0 ? void 0 : options.getItemRank);
43
45
  var typeAhead = {
44
46
  id: _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT,
47
+ getRegisteredItemRank: getItemRank,
45
48
  trigger: '/',
46
49
  // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
47
50
  customRegex: '[//]',
@@ -193,6 +196,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
193
196
  }
194
197
  return {
195
198
  typeAheadHandler: typeAhead,
199
+ getItemRank: getItemRank,
196
200
  lazyDefaultItems: quickInsertState.lazyDefaultItems,
197
201
  emptyStateHandler: quickInsertState.emptyStateHandler,
198
202
  providedItems: quickInsertState.providedItems,
@@ -81,6 +81,7 @@ var getComponentsFromLegacyItems = function getComponentsFromLegacyItems(items,
81
81
  legacyCategories: item.categories,
82
82
  rank: (_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index
83
83
  }),
84
+ isHidden: item.isHidden,
84
85
  component: function component() {
85
86
  return /*#__PURE__*/_react.default.createElement(LegacyQuickInsertProviderMenuItem, {
86
87
  item: item,
@@ -118,6 +119,10 @@ var getLegacyCompatibleComponents = exports.getLegacyCompatibleComponents = func
118
119
  return getItemIdentity(candidate, index) === component.key;
119
120
  });
120
121
  return _objectSpread(_objectSpread({}, component), {}, {
122
+ isHidden: item !== null && item !== void 0 && item.isHidden ? function (options) {
123
+ var _component$isHidden, _item$isHidden;
124
+ return ((_component$isHidden = component.isHidden) === null || _component$isHidden === void 0 ? void 0 : _component$isHidden.call(component, options)) === true || ((_item$isHidden = item.isHidden) === null || _item$isHidden === void 0 ? void 0 : _item$isHidden.call(item)) === true;
125
+ } : component.isHidden,
121
126
  key: (0, _getProviderMenuItemKey.getQuickInsertProviderMenuItemKey)(component.key, item === null || item === void 0 ? void 0 : item.app),
122
127
  component: item ? function (props) {
123
128
  return component.component(_objectSpread(_objectSpread({}, props), {}, {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { useIntl } from 'react-intl';
3
3
  import { isSSR } from '@atlaskit/editor-common/is-ssr';
4
4
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
5
+ import { createQuickInsertRankResolver } from '@atlaskit/editor-common/quick-insert/quick-insert-rank';
5
6
  import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-insert/utils';
6
7
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
7
8
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
@@ -28,8 +29,10 @@ export const quickInsertPlugin = ({
28
29
  options === null || options === void 0 ? void 0 : (_options$onInsert = options.onInsert) === null || _options$onInsert === void 0 ? void 0 : _options$onInsert.call(options, item);
29
30
  };
30
31
  const typeAheadPrioritySortingFn = withLayoutQuickInsertPrioritySorting(options === null || options === void 0 ? void 0 : options.prioritySortingFn);
32
+ const getItemRank = createQuickInsertRankResolver(options === null || options === void 0 ? void 0 : options.getItemRank);
31
33
  const typeAhead = {
32
34
  id: TypeAheadAvailableNodes.QUICK_INSERT,
35
+ getRegisteredItemRank: getItemRank,
33
36
  trigger: '/',
34
37
  // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
35
38
  customRegex: '[//]',
@@ -174,6 +177,7 @@ export const quickInsertPlugin = ({
174
177
  }
175
178
  return {
176
179
  typeAheadHandler: typeAhead,
180
+ getItemRank,
177
181
  lazyDefaultItems: quickInsertState.lazyDefaultItems,
178
182
  emptyStateHandler: quickInsertState.emptyStateHandler,
179
183
  providedItems: quickInsertState.providedItems,
@@ -71,6 +71,7 @@ const getComponentsFromLegacyItems = (items, onInsert) => items.map((item, index
71
71
  legacyCategories: item.categories,
72
72
  rank: (_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index
73
73
  }),
74
+ isHidden: item.isHidden,
74
75
  component: () => /*#__PURE__*/React.createElement(LegacyQuickInsertProviderMenuItem, {
75
76
  item: item,
76
77
  onInsert: onInsert
@@ -97,6 +98,10 @@ export const getLegacyCompatibleComponents = ({
97
98
  const item = filteredItems.find((candidate, index) => getItemIdentity(candidate, index) === component.key);
98
99
  return {
99
100
  ...component,
101
+ isHidden: item !== null && item !== void 0 && item.isHidden ? options => {
102
+ var _component$isHidden, _item$isHidden;
103
+ return ((_component$isHidden = component.isHidden) === null || _component$isHidden === void 0 ? void 0 : _component$isHidden.call(component, options)) === true || ((_item$isHidden = item.isHidden) === null || _item$isHidden === void 0 ? void 0 : _item$isHidden.call(item)) === true;
104
+ } : component.isHidden,
100
105
  key: getQuickInsertProviderMenuItemKey(component.key, item === null || item === void 0 ? void 0 : item.app),
101
106
  component: item ? props => component.component({
102
107
  ...props,
@@ -8,6 +8,7 @@ import React from 'react';
8
8
  import { useIntl } from 'react-intl';
9
9
  import { isSSR } from '@atlaskit/editor-common/is-ssr';
10
10
  import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages/insert-block';
11
+ import { createQuickInsertRankResolver } from '@atlaskit/editor-common/quick-insert/quick-insert-rank';
11
12
  import { memoProcessQuickInsertItems } from '@atlaskit/editor-common/quick-insert/utils';
12
13
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
13
14
  import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
@@ -33,8 +34,10 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
33
34
  options === null || options === void 0 || (_options$onInsert = options.onInsert) === null || _options$onInsert === void 0 || _options$onInsert.call(options, item);
34
35
  };
35
36
  var typeAheadPrioritySortingFn = withLayoutQuickInsertPrioritySorting(options === null || options === void 0 ? void 0 : options.prioritySortingFn);
37
+ var getItemRank = createQuickInsertRankResolver(options === null || options === void 0 ? void 0 : options.getItemRank);
36
38
  var typeAhead = {
37
39
  id: TypeAheadAvailableNodes.QUICK_INSERT,
40
+ getRegisteredItemRank: getItemRank,
38
41
  trigger: '/',
39
42
  // Support fullwidth slash (U+FF0F) used by Japanese/CJK keyboards (e.g. typing / on a Japanese keyboard layout)
40
43
  customRegex: '[//]',
@@ -186,6 +189,7 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
186
189
  }
187
190
  return {
188
191
  typeAheadHandler: typeAhead,
192
+ getItemRank: getItemRank,
189
193
  lazyDefaultItems: quickInsertState.lazyDefaultItems,
190
194
  emptyStateHandler: quickInsertState.emptyStateHandler,
191
195
  providedItems: quickInsertState.providedItems,
@@ -72,6 +72,7 @@ var getComponentsFromLegacyItems = function getComponentsFromLegacyItems(items,
72
72
  legacyCategories: item.categories,
73
73
  rank: (_item$priority = item.priority) !== null && _item$priority !== void 0 ? _item$priority : index
74
74
  }),
75
+ isHidden: item.isHidden,
75
76
  component: function component() {
76
77
  return /*#__PURE__*/React.createElement(LegacyQuickInsertProviderMenuItem, {
77
78
  item: item,
@@ -109,6 +110,10 @@ export var getLegacyCompatibleComponents = function getLegacyCompatibleComponent
109
110
  return getItemIdentity(candidate, index) === component.key;
110
111
  });
111
112
  return _objectSpread(_objectSpread({}, component), {}, {
113
+ isHidden: item !== null && item !== void 0 && item.isHidden ? function (options) {
114
+ var _component$isHidden, _item$isHidden;
115
+ return ((_component$isHidden = component.isHidden) === null || _component$isHidden === void 0 ? void 0 : _component$isHidden.call(component, options)) === true || ((_item$isHidden = item.isHidden) === null || _item$isHidden === void 0 ? void 0 : _item$isHidden.call(item)) === true;
116
+ } : component.isHidden,
112
117
  key: getQuickInsertProviderMenuItemKey(component.key, item === null || item === void 0 ? void 0 : item.app),
113
118
  component: item ? function (props) {
114
119
  return component.component(_objectSpread(_objectSpread({}, props), {}, {
@@ -1,6 +1,7 @@
1
1
  import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics/types/enums';
2
2
  import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory/quick-insert-provider';
3
3
  import type { IsRecommendedItem } from '@atlaskit/editor-common/quick-insert/is-recommended-item';
4
+ import type { RegisteredItemRankResolver } from '@atlaskit/editor-common/type-ahead/item-rank';
4
5
  import type { Command } from '@atlaskit/editor-common/types/command';
5
6
  import type { EditorCommand } from '@atlaskit/editor-common/types/editor-command';
6
7
  import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types/next-editor-plugin';
@@ -14,6 +15,7 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead/type-ah
14
15
  import type { TypeAheadInputMethod } from '@atlaskit/editor-plugin-type-ahead/types';
15
16
  import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry/ui-control-registry-plugin-type';
16
17
  export type QuickInsertSharedState = CommonQuickInsertSharedState & {
18
+ getItemRank?: RegisteredItemRankResolver;
17
19
  typeAheadHandler: TypeAheadHandler;
18
20
  };
19
21
  export type QuickInsertPluginOptions = CommonQuickInsertPluginOptions & {
@@ -24,6 +26,8 @@ export type QuickInsertPluginOptions = CommonQuickInsertPluginOptions & {
24
26
  * and is only available when `platform_editor_block_control_migration` experiment is enabled.
25
27
  */
26
28
  blockControlButtonEnabled?: boolean;
29
+ /** Resolves per-editor category and item ranks for registered Quick Insert menus. */
30
+ getItemRank?: RegisteredItemRankResolver;
27
31
  /**
28
32
  * Selects and ranks the items shown in the Recommended section of the `/` menu.
29
33
  * Items that are not registered or are hidden are skipped, so lower-ranked items act as fallbacks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-quick-insert",
3
- "version": "26.0.5",
3
+ "version": "26.1.2",
4
4
  "description": "Quick insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -44,7 +44,7 @@
44
44
  "@atlaskit/platform-feature-flags": "^2.2.0",
45
45
  "@atlaskit/primitives": "^22.5.0",
46
46
  "@atlaskit/textfield": "^10.2.0",
47
- "@atlaskit/tmp-editor-statsig": "^232.0.0",
47
+ "@atlaskit/tmp-editor-statsig": "^234.0.0",
48
48
  "@atlaskit/tokens": "^20.4.0",
49
49
  "@atlaskit/tooltip": "^24.4.0",
50
50
  "@babel/runtime": "^7.0.0",
@@ -52,7 +52,7 @@
52
52
  "@emotion/react": "^11.7.1"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^130.3.0",
55
+ "@atlaskit/editor-common": "^130.5.0",
56
56
  "react": "^18.2.0 || ^19.2.0",
57
57
  "react-dom": "^18.2.0 || ^19.2.0",
58
58
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"