@atlaskit/editor-plugin-type-ahead 27.0.5 → 27.0.8

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,46 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 27.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b9d888e2cb530`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b9d888e2cb530) -
8
+ Remove aria-current from selected typeahead options, behind the
9
+ `platform_editor_a11y_quick_insert_aria_current` feature gate
10
+ - Updated dependencies
11
+
12
+ ## 27.0.7
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
18
+ ## 27.0.6
19
+
20
+ ### Patch Changes
21
+
22
+ - [`1c4db454a74a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c4db454a74a2) -
23
+ Registered menu hosts can override section and item ranks through getItemRank in the shared
24
+ ordering used by Quick Insert, type-ahead, and insert menus. Rovo editor presets group these
25
+ settings under quickInsertOptions. Typeahead handlers expose getRegisteredItemRank with a
26
+ RegisteredItemRankResolver that receives the registered component and its ranked parent. Skill
27
+ manifests and adapters accept visibility predicates that follow current chat state without
28
+ rebuilding registrations.
29
+
30
+ Under platform_editor_slash_command, main and inline Rovo chat show Rovo commands first and use
31
+ specialist placeholders. The chat skills layer receives selectedAgentId and respects the existing
32
+ enableSkillsInSpecialistPromptInput setting. Treatment keeps registrations and evaluates
33
+ visibility per item. Control keeps the legacy full-or-empty manifest and the same host opt-in.
34
+ Search mode and an existing prompt skill still prevent insertion.
35
+
36
+ Affected Jira, JSM, and Confluence skills require the signed-in user's product access at the site,
37
+ in addition to backend filtering of declared site entitlements. Skill Builder needs Studio and the
38
+ signed-in user's Rovo AI entitlement for that site. Eligibility requests follow site changes; user
39
+ identity remains stable during the signed-in session. Visibility reads committed React state and
40
+ supports server rendering.
41
+
42
+ - Updated dependencies
43
+
3
44
  ## 27.0.5
4
45
 
5
46
  ### Patch Changes
@@ -20,6 +20,7 @@ var _constants = require("@atlaskit/editor-shared-styles/constants");
20
20
  var _main = require("@atlaskit/editor-shared-styles/shortcut/main");
21
21
  var _buttonItem = _interopRequireDefault(require("@atlaskit/menu/button-item"));
22
22
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
23
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
23
24
  var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden/visually-hidden"));
24
25
  var _SkillTagLabel = require("./SkillTagLabel");
25
26
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
@@ -268,7 +269,12 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
268
269
  }, descriptionText, " ", shortcutText), (0, _react2.jsx)(_buttonItem.default, {
269
270
  onClick: insertSelectedItem,
270
271
  iconBefore: elementIcon,
271
- isSelected: isSelected,
272
+ isSelected: isSelected
273
+ // `aria-selected` already conveys which option is selected, so `aria-current` is
274
+ // inappropriate here (A11Y-32552). When the gate is off we fall back to the
275
+ // `aria-current="true"` that ButtonItem applies for selected items.
276
+ ,
277
+ "aria-current": !(0, _fg.fg)('platform_editor_a11y_quick_insert_aria_current') && isSelected ? 'true' : undefined,
272
278
  "aria-selected": isSelected,
273
279
  "aria-label": (_skillTag$name = skillTag === null || skillTag === void 0 ? void 0 : skillTag.name) !== null && _skillTag$name !== void 0 ? _skillTag$name : title,
274
280
  "aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
@@ -97,14 +97,15 @@ var RegisteredTypeAheadMenu = exports.RegisteredTypeAheadMenu = function Registe
97
97
  });
98
98
  }, [components]);
99
99
  var menuModel = (0, _react.useMemo)(function () {
100
- return query === '' ? (0, _registeredMenuModel.buildQuickInsertMenuModel)(components, surface.root, hasSectionOverflowItems && isSlashCommandEnabled ? _registeredMenuModel.selectQuickInsertCategoryItems : undefined, surfaceContext) : (0, _registeredMenuModel.getMatchingQuickInsertComponents)({
100
+ return query === '' ? (0, _registeredMenuModel.buildQuickInsertMenuModel)(components, surface.root, hasSectionOverflowItems && isSlashCommandEnabled ? _registeredMenuModel.selectQuickInsertCategoryItems : undefined, surfaceContext, triggerHandler.getRegisteredItemRank) : (0, _registeredMenuModel.getMatchingQuickInsertComponents)({
101
101
  components: components,
102
102
  rootComponent: surface.root,
103
103
  query: query,
104
104
  formatMessage: formatMessage,
105
- surfaceContext: surfaceContext
105
+ surfaceContext: surfaceContext,
106
+ getItemRank: triggerHandler.getRegisteredItemRank
106
107
  });
107
- }, [components, formatMessage, hasSectionOverflowItems, isSlashCommandEnabled, query, surfaceContext, surface.root]);
108
+ }, [components, formatMessage, hasSectionOverflowItems, isSlashCommandEnabled, query, surfaceContext, surface.root, triggerHandler.getRegisteredItemRank]);
108
109
  var rows = (0, _react.useMemo)(function () {
109
110
  return (0, _registeredMenuModel.getQuickInsertMenuRows)(menuModel);
110
111
  }, [menuModel]);
@@ -17,6 +17,7 @@ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles/constan
17
17
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut/main';
18
18
  import ButtonItem from '@atlaskit/menu/button-item';
19
19
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
20
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
20
21
  import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
21
22
  import { parseSkillTagTitle, SkillTagLabel } from './SkillTagLabel';
22
23
 
@@ -280,7 +281,12 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
280
281
  }, descriptionText, " ", shortcutText), jsx(ButtonItem, {
281
282
  onClick: insertSelectedItem,
282
283
  iconBefore: elementIcon,
283
- isSelected: isSelected,
284
+ isSelected: isSelected
285
+ // `aria-selected` already conveys which option is selected, so `aria-current` is
286
+ // inappropriate here (A11Y-32552). When the gate is off we fall back to the
287
+ // `aria-current="true"` that ButtonItem applies for selected items.
288
+ ,
289
+ "aria-current": !fg('platform_editor_a11y_quick_insert_aria_current') && isSelected ? 'true' : undefined,
284
290
  "aria-selected": isSelected,
285
291
  "aria-label": (_skillTag$name = skillTag === null || skillTag === void 0 ? void 0 : skillTag.name) !== null && _skillTag$name !== void 0 ? _skillTag$name : title,
286
292
  "aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
@@ -73,13 +73,14 @@ export const RegisteredTypeAheadMenu = ({
73
73
  const hasSectionOverflowItems = useMemo(() => components.some(({
74
74
  key
75
75
  }) => isSectionOverflowItemKey(key)), [components]);
76
- const menuModel = useMemo(() => query === '' ? buildQuickInsertMenuModel(components, surface.root, hasSectionOverflowItems && isSlashCommandEnabled ? selectQuickInsertCategoryItems : undefined, surfaceContext) : getMatchingQuickInsertComponents({
76
+ const menuModel = useMemo(() => query === '' ? buildQuickInsertMenuModel(components, surface.root, hasSectionOverflowItems && isSlashCommandEnabled ? selectQuickInsertCategoryItems : undefined, surfaceContext, triggerHandler.getRegisteredItemRank) : getMatchingQuickInsertComponents({
77
77
  components,
78
78
  rootComponent: surface.root,
79
79
  query,
80
80
  formatMessage,
81
- surfaceContext
82
- }), [components, formatMessage, hasSectionOverflowItems, isSlashCommandEnabled, query, surfaceContext, surface.root]);
81
+ surfaceContext,
82
+ getItemRank: triggerHandler.getRegisteredItemRank
83
+ }), [components, formatMessage, hasSectionOverflowItems, isSlashCommandEnabled, query, surfaceContext, surface.root, triggerHandler.getRegisteredItemRank]);
83
84
  const rows = useMemo(() => getQuickInsertMenuRows(menuModel), [menuModel]);
84
85
  const [previewActivation, setPreviewActivation] = useState();
85
86
  const activePreviewItemKey = (previewActivation === null || previewActivation === void 0 ? void 0 : previewActivation.menuModel) === menuModel ? previewActivation.itemKey : undefined;
@@ -19,6 +19,7 @@ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles/constan
19
19
  import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut/main';
20
20
  import ButtonItem from '@atlaskit/menu/button-item';
21
21
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
22
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
22
23
  import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
23
24
  import { parseSkillTagTitle, SkillTagLabel } from './SkillTagLabel';
24
25
 
@@ -261,7 +262,12 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref) {
261
262
  }, descriptionText, " ", shortcutText), jsx(ButtonItem, {
262
263
  onClick: insertSelectedItem,
263
264
  iconBefore: elementIcon,
264
- isSelected: isSelected,
265
+ isSelected: isSelected
266
+ // `aria-selected` already conveys which option is selected, so `aria-current` is
267
+ // inappropriate here (A11Y-32552). When the gate is off we fall back to the
268
+ // `aria-current="true"` that ButtonItem applies for selected items.
269
+ ,
270
+ "aria-current": !fg('platform_editor_a11y_quick_insert_aria_current') && isSelected ? 'true' : undefined,
265
271
  "aria-selected": isSelected,
266
272
  "aria-label": (_skillTag$name = skillTag === null || skillTag === void 0 ? void 0 : skillTag.name) !== null && _skillTag$name !== void 0 ? _skillTag$name : title,
267
273
  "aria-describedby": descriptionText || shortcutText ? descriptionId : undefined,
@@ -88,14 +88,15 @@ export var RegisteredTypeAheadMenu = function RegisteredTypeAheadMenu(_ref) {
88
88
  });
89
89
  }, [components]);
90
90
  var menuModel = useMemo(function () {
91
- return query === '' ? buildQuickInsertMenuModel(components, surface.root, hasSectionOverflowItems && isSlashCommandEnabled ? selectQuickInsertCategoryItems : undefined, surfaceContext) : getMatchingQuickInsertComponents({
91
+ return query === '' ? buildQuickInsertMenuModel(components, surface.root, hasSectionOverflowItems && isSlashCommandEnabled ? selectQuickInsertCategoryItems : undefined, surfaceContext, triggerHandler.getRegisteredItemRank) : getMatchingQuickInsertComponents({
92
92
  components: components,
93
93
  rootComponent: surface.root,
94
94
  query: query,
95
95
  formatMessage: formatMessage,
96
- surfaceContext: surfaceContext
96
+ surfaceContext: surfaceContext,
97
+ getItemRank: triggerHandler.getRegisteredItemRank
97
98
  });
98
- }, [components, formatMessage, hasSectionOverflowItems, isSlashCommandEnabled, query, surfaceContext, surface.root]);
99
+ }, [components, formatMessage, hasSectionOverflowItems, isSlashCommandEnabled, query, surfaceContext, surface.root, triggerHandler.getRegisteredItemRank]);
99
100
  var rows = useMemo(function () {
100
101
  return getQuickInsertMenuRows(menuModel);
101
102
  }, [menuModel]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "27.0.5",
3
+ "version": "27.0.8",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,14 +35,14 @@
35
35
  "@atlaskit/heading": "^8.0.0",
36
36
  "@atlaskit/icon": "^38.0.0",
37
37
  "@atlaskit/insm": "^3.0.0",
38
- "@atlaskit/mention": "^30.1.0",
38
+ "@atlaskit/mention": "^30.2.0",
39
39
  "@atlaskit/menu": "^11.0.0",
40
40
  "@atlaskit/platform-feature-experiments": "^0.3.0",
41
41
  "@atlaskit/platform-feature-flags": "^2.2.0",
42
42
  "@atlaskit/primitives": "^22.5.0",
43
43
  "@atlaskit/prosemirror-history": "^1.3.0",
44
44
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
45
- "@atlaskit/tmp-editor-statsig": "^232.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^234.0.0",
46
46
  "@atlaskit/tokens": "^20.4.0",
47
47
  "@atlaskit/visually-hidden": "^4.4.0",
48
48
  "@babel/runtime": "^7.0.0",
@@ -54,7 +54,7 @@
54
54
  "w3c-keyname": "^2.1.8"
55
55
  },
56
56
  "peerDependencies": {
57
- "@atlaskit/editor-common": "^130.3.0",
57
+ "@atlaskit/editor-common": "^130.5.0",
58
58
  "react": "^18.2.0 || ^19.2.0",
59
59
  "react-dom": "^18.2.0 || ^19.2.0",
60
60
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -82,6 +82,9 @@
82
82
  "platform_editor_mention_typeahead_profilecard": {
83
83
  "type": "boolean"
84
84
  },
85
+ "platform_editor_a11y_quick_insert_aria_current": {
86
+ "type": "boolean"
87
+ },
85
88
  "rovo_skill_tag_slanted_background_killswitch": {
86
89
  "type": "boolean",
87
90
  "referenceOnly": true