@atlaskit/editor-plugin-insert-block 27.0.5 → 27.0.6

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,31 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 27.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1c4db454a74a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c4db454a74a2) -
8
+ Registered menu hosts can override section and item ranks through getItemRank in the shared
9
+ ordering used by Quick Insert, type-ahead, and insert menus. Rovo editor presets group these
10
+ settings under quickInsertOptions. Typeahead handlers expose getRegisteredItemRank with a
11
+ RegisteredItemRankResolver that receives the registered component and its ranked parent. Skill
12
+ manifests and adapters accept visibility predicates that follow current chat state without
13
+ rebuilding registrations.
14
+
15
+ Under platform_editor_slash_command, main and inline Rovo chat show Rovo commands first and use
16
+ specialist placeholders. The chat skills layer receives selectedAgentId and respects the existing
17
+ enableSkillsInSpecialistPromptInput setting. Treatment keeps registrations and evaluates
18
+ visibility per item. Control keeps the legacy full-or-empty manifest and the same host opt-in.
19
+ Search mode and an existing prompt skill still prevent insertion.
20
+
21
+ Affected Jira, JSM, and Confluence skills require the signed-in user's product access at the site,
22
+ in addition to backend filtering of declared site entitlements. Skill Builder needs Studio and the
23
+ signed-in user's Rovo AI entitlement for that site. Eligibility requests follow site changes; user
24
+ identity remains stable during the signed-in session. Visibility reads committed React state and
25
+ supports server rendering.
26
+
27
+ - Updated dependencies
28
+
3
29
  ## 27.0.5
4
30
 
5
31
  ### Patch Changes
@@ -32,6 +32,7 @@ var styles = {
32
32
  var RegisteredInsertMenu = exports.RegisteredInsertMenu = function RegisteredInsertMenu(_ref) {
33
33
  var components = _ref.components,
34
34
  emptyStateHandler = _ref.emptyStateHandler,
35
+ getItemRank = _ref.getItemRank,
35
36
  editorView = _ref.editorView,
36
37
  isOffline = _ref.isOffline,
37
38
  _ref$maxHeight = _ref.maxHeight,
@@ -84,14 +85,15 @@ var RegisteredInsertMenu = exports.RegisteredInsertMenu = function RegisteredIns
84
85
  });
85
86
  }, [components]);
86
87
  var model = (0, _react.useMemo)(function () {
87
- return query === '' ? (0, _registeredMenuModel.buildQuickInsertMenuModel)(components, _keys.MENU, hasSectionOverflowItems ? _registeredMenuModel.selectQuickInsertCategoryItems : undefined, surfaceContext) : (0, _registeredMenuModel.getMatchingQuickInsertComponents)({
88
+ return query === '' ? (0, _registeredMenuModel.buildQuickInsertMenuModel)(components, _keys.MENU, hasSectionOverflowItems ? _registeredMenuModel.selectQuickInsertCategoryItems : undefined, surfaceContext, getItemRank) : (0, _registeredMenuModel.getMatchingQuickInsertComponents)({
88
89
  components: components,
89
90
  formatMessage: formatMessage,
90
91
  query: query,
91
92
  rootComponent: _keys.MENU,
92
- surfaceContext: surfaceContext
93
+ surfaceContext: surfaceContext,
94
+ getItemRank: getItemRank
93
95
  });
94
- }, [components, formatMessage, hasSectionOverflowItems, query, surfaceContext]);
96
+ }, [components, formatMessage, getItemRank, hasSectionOverflowItems, query, surfaceContext]);
95
97
  var selectableItems = (0, _react.useMemo)(function () {
96
98
  return (0, _registeredMenuModel.getQuickInsertMenuRows)(model).filter(function (row) {
97
99
  return row.type === 'menu-item';
@@ -22,7 +22,7 @@ var RegisteredInsertMenuContainer = function RegisteredInsertMenuContainer(_ref)
22
22
  };
23
23
  var RegisteredInsertMenuWithListeners = (0, _withOuterListeners.default)(RegisteredInsertMenuContainer);
24
24
  var RegisteredInsertMenuContent = exports.RegisteredInsertMenuContent = function RegisteredInsertMenuContent(_ref2) {
25
- var _api$quickInsert;
25
+ var _api$quickInsert, _api$quickInsert2;
26
26
  var api = _ref2.api,
27
27
  editorView = _ref2.editorView,
28
28
  isOffline = _ref2.isOffline,
@@ -50,6 +50,7 @@ var RegisteredInsertMenuContent = exports.RegisteredInsertMenuContent = function
50
50
  components: components,
51
51
  editorView: editorView,
52
52
  emptyStateHandler: api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 || (_api$quickInsert = _api$quickInsert.sharedState.currentState()) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.emptyStateHandler,
53
+ getItemRank: api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 || (_api$quickInsert2 = _api$quickInsert2.sharedState.currentState()) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.getItemRank,
53
54
  isOffline: isOffline,
54
55
  maxHeight: maxHeight,
55
56
  onClose: onClose,
@@ -21,6 +21,7 @@ const styles = {
21
21
  export const RegisteredInsertMenu = ({
22
22
  components,
23
23
  emptyStateHandler,
24
+ getItemRank,
24
25
  editorView,
25
26
  isOffline,
26
27
  maxHeight = DEFAULT_MENU_MAX_HEIGHT,
@@ -55,13 +56,14 @@ export const RegisteredInsertMenu = ({
55
56
  const hasSectionOverflowItems = useMemo(() => components.some(({
56
57
  key
57
58
  }) => isSectionOverflowItemKey(key)), [components]);
58
- const model = useMemo(() => query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext) : getMatchingQuickInsertComponents({
59
+ const model = useMemo(() => query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext, getItemRank) : getMatchingQuickInsertComponents({
59
60
  components,
60
61
  formatMessage,
61
62
  query,
62
63
  rootComponent: MENU,
63
- surfaceContext
64
- }), [components, formatMessage, hasSectionOverflowItems, query, surfaceContext]);
64
+ surfaceContext,
65
+ getItemRank
66
+ }), [components, formatMessage, getItemRank, hasSectionOverflowItems, query, surfaceContext]);
65
67
  const selectableItems = useMemo(() => getQuickInsertMenuRows(model).filter(row => row.type === 'menu-item'), [model]);
66
68
  const itemCount = selectableItems.length + (model.footer ? 1 : 0);
67
69
  const selectableItemKeys = useMemo(() => [...selectableItems, ...(model.footer ? [model.footer] : [])].map(({
@@ -22,7 +22,7 @@ export const RegisteredInsertMenuContent = ({
22
22
  onSelect,
23
23
  target
24
24
  }) => {
25
- var _api$quickInsert, _api$quickInsert$shar;
25
+ var _api$quickInsert, _api$quickInsert$shar, _api$quickInsert2, _api$quickInsert2$sha;
26
26
  // Keep registrations stable while the open menu is searched or navigated.
27
27
  const [components] = useState(() => {
28
28
  var _api$uiControlRegistr, _api$uiControlRegistr2;
@@ -40,6 +40,7 @@ export const RegisteredInsertMenuContent = ({
40
40
  components: components,
41
41
  editorView: editorView,
42
42
  emptyStateHandler: api === null || api === void 0 ? void 0 : (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : (_api$quickInsert$shar = _api$quickInsert.sharedState.currentState()) === null || _api$quickInsert$shar === void 0 ? void 0 : _api$quickInsert$shar.emptyStateHandler,
43
+ getItemRank: api === null || api === void 0 ? void 0 : (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : (_api$quickInsert2$sha = _api$quickInsert2.sharedState.currentState()) === null || _api$quickInsert2$sha === void 0 ? void 0 : _api$quickInsert2$sha.getItemRank,
43
44
  isOffline: isOffline,
44
45
  maxHeight: maxHeight,
45
46
  onClose: onClose,
@@ -23,6 +23,7 @@ var styles = {
23
23
  export var RegisteredInsertMenu = function RegisteredInsertMenu(_ref) {
24
24
  var components = _ref.components,
25
25
  emptyStateHandler = _ref.emptyStateHandler,
26
+ getItemRank = _ref.getItemRank,
26
27
  editorView = _ref.editorView,
27
28
  isOffline = _ref.isOffline,
28
29
  _ref$maxHeight = _ref.maxHeight,
@@ -75,14 +76,15 @@ export var RegisteredInsertMenu = function RegisteredInsertMenu(_ref) {
75
76
  });
76
77
  }, [components]);
77
78
  var model = useMemo(function () {
78
- return query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext) : getMatchingQuickInsertComponents({
79
+ return query === '' ? buildQuickInsertMenuModel(components, MENU, hasSectionOverflowItems ? selectQuickInsertCategoryItems : undefined, surfaceContext, getItemRank) : getMatchingQuickInsertComponents({
79
80
  components: components,
80
81
  formatMessage: formatMessage,
81
82
  query: query,
82
83
  rootComponent: MENU,
83
- surfaceContext: surfaceContext
84
+ surfaceContext: surfaceContext,
85
+ getItemRank: getItemRank
84
86
  });
85
- }, [components, formatMessage, hasSectionOverflowItems, query, surfaceContext]);
87
+ }, [components, formatMessage, getItemRank, hasSectionOverflowItems, query, surfaceContext]);
86
88
  var selectableItems = useMemo(function () {
87
89
  return getQuickInsertMenuRows(model).filter(function (row) {
88
90
  return row.type === 'menu-item';
@@ -13,7 +13,7 @@ var RegisteredInsertMenuContainer = function RegisteredInsertMenuContainer(_ref)
13
13
  };
14
14
  var RegisteredInsertMenuWithListeners = withOuterListeners(RegisteredInsertMenuContainer);
15
15
  export var RegisteredInsertMenuContent = function RegisteredInsertMenuContent(_ref2) {
16
- var _api$quickInsert;
16
+ var _api$quickInsert, _api$quickInsert2;
17
17
  var api = _ref2.api,
18
18
  editorView = _ref2.editorView,
19
19
  isOffline = _ref2.isOffline,
@@ -41,6 +41,7 @@ export var RegisteredInsertMenuContent = function RegisteredInsertMenuContent(_r
41
41
  components: components,
42
42
  editorView: editorView,
43
43
  emptyStateHandler: api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 || (_api$quickInsert = _api$quickInsert.sharedState.currentState()) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.emptyStateHandler,
44
+ getItemRank: api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 || (_api$quickInsert2 = _api$quickInsert2.sharedState.currentState()) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.getItemRank,
44
45
  isOffline: isOffline,
45
46
  maxHeight: maxHeight,
46
47
  onClose: onClose,
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { RegisteredItemRankResolver } from '@atlaskit/editor-common/type-ahead/item-rank';
2
3
  import type { EmptyStateHandler } from '@atlaskit/editor-common/types';
3
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
5
  import type { RegisterComponent } from '@atlaskit/editor-ui-control-model/types';
@@ -6,10 +7,11 @@ type Props = {
6
7
  components: RegisterComponent[];
7
8
  editorView: EditorView;
8
9
  emptyStateHandler?: EmptyStateHandler;
10
+ getItemRank?: RegisteredItemRankResolver;
9
11
  isOffline: boolean;
10
12
  maxHeight?: number;
11
13
  onClose: () => void;
12
14
  onSelect: () => void;
13
15
  };
14
- export declare const RegisteredInsertMenu: ({ components, emptyStateHandler, editorView, isOffline, maxHeight, onClose, onSelect, }: Props) => React.JSX.Element;
16
+ export declare const RegisteredInsertMenu: ({ components, emptyStateHandler, getItemRank, editorView, isOffline, maxHeight, onClose, onSelect, }: Props) => React.JSX.Element;
15
17
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "27.0.5",
3
+ "version": "27.0.6",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/editor-plugin-panel": "^28.0.0",
43
43
  "@atlaskit/editor-plugin-placeholder-text": "^27.0.0",
44
44
  "@atlaskit/editor-plugin-primary-toolbar": "^27.0.0",
45
- "@atlaskit/editor-plugin-quick-insert": "^26.0.0",
45
+ "@atlaskit/editor-plugin-quick-insert": "^26.1.0",
46
46
  "@atlaskit/editor-plugin-rule": "^26.0.0",
47
47
  "@atlaskit/editor-plugin-status": "^27.0.0",
48
48
  "@atlaskit/editor-plugin-table": "^38.0.0",
@@ -72,7 +72,7 @@
72
72
  "react-virtualized": "^9.22.6"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^130.3.0",
75
+ "@atlaskit/editor-common": "^130.4.0",
76
76
  "react": "^18.2.0 || ^19.2.0",
77
77
  "react-dom": "^18.2.0 || ^19.2.0",
78
78
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"