@atlaskit/rovo-agent-selector 3.0.5 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/rovo-agent-selector
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2b54f728c22c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2b54f728c22c4) -
8
+ [ux] Adds isDisabled prop to RovoAgentSelector (jsm_help_center_use_rovo_chat_default_agent gate)
9
+
3
10
  ## 3.0.5
4
11
 
5
12
  ### Patch Changes
@@ -16,11 +16,11 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
16
16
  var _rovoAgentSelector_AtlaskitRovoAgentSelector2 = _interopRequireDefault(require("./__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql"));
17
17
  var _reactIntl = require("react-intl");
18
18
  var _reactRelay = require("react-relay");
19
- var _form = require("@atlaskit/form");
20
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
+ var _default = require("@atlaskit/form/label/default");
20
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
21
21
  var _compiled = require("@atlaskit/primitives/compiled");
22
22
  var _AgentAvatar = require("@atlaskit/rovo-agent-components/ui/AgentAvatar");
23
- var _select = _interopRequireDefault(require("@atlaskit/select"));
23
+ var _default2 = _interopRequireDefault(require("@atlaskit/select/default"));
24
24
  var _useSuspenselessRefetch = require("../../common/utils/use-suspenseless-refetch");
25
25
  var _rovoAgentSelectorInternal_AtlaskitRovoAgentSelectorPaginationQuery = _interopRequireDefault(require("./__generated__/rovoAgentSelectorInternal_AtlaskitRovoAgentSelectorPaginationQuery.graphql"));
26
26
  var _messages = _interopRequireDefault(require("./messages"));
@@ -56,10 +56,12 @@ function RovoAgentSelector(_ref) {
56
56
  cloudId = _ref.cloudId,
57
57
  selectedAgent = _ref.selectedAgent,
58
58
  onChange = _ref.onChange,
59
- isLoadingOverride = _ref.isLoading;
59
+ isLoadingOverride = _ref.isLoading,
60
+ _ref$isDisabled = _ref.isDisabled,
61
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
60
62
  var _useIntl = (0, _reactIntl.useIntl)(),
61
63
  formatMessage = _useIntl.formatMessage;
62
- var isFeatureEnabled = isFeatureEnabledOverride !== null && isFeatureEnabledOverride !== void 0 ? isFeatureEnabledOverride : (0, _platformFeatureFlags.fg)('jsm_help_center_one-click_rovo_agent');
64
+ var isFeatureEnabled = isFeatureEnabledOverride !== null && isFeatureEnabledOverride !== void 0 ? isFeatureEnabledOverride : (0, _fg.fg)('jsm_help_center_one-click_rovo_agent');
63
65
  var _useState = (0, _react.useState)(null),
64
66
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
65
67
  setSearchInput = _useState2[1];
@@ -82,7 +84,7 @@ function RovoAgentSelector(_ref) {
82
84
  value: (_agent$id = agent === null || agent === void 0 ? void 0 : agent.id) !== null && _agent$id !== void 0 ? _agent$id : '',
83
85
  externalConfigReference: (_agent$externalConfig = agent === null || agent === void 0 ? void 0 : agent.externalConfigReference) !== null && _agent$externalConfig !== void 0 ? _agent$externalConfig : undefined,
84
86
  identityAccountId: (_agent$identityAccoun = agent === null || agent === void 0 ? void 0 : agent.identityAccountId) !== null && _agent$identityAccoun !== void 0 ? _agent$identityAccoun : undefined,
85
- isForgeAgent: (0, _platformFeatureFlags.fg)('rovo_agent_support_a2a_avatar') ? (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'THIRD_PARTY' || (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'FORGE' || (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'REMOTE_A2A' : (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'FORGE'
87
+ isForgeAgent: (0, _fg.fg)('rovo_agent_support_a2a_avatar') ? (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'THIRD_PARTY' || (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'FORGE' || (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'REMOTE_A2A' : (agent === null || agent === void 0 ? void 0 : agent.creatorType) === 'FORGE'
86
88
  };
87
89
  }).filter(function (option) {
88
90
  return option.label;
@@ -123,11 +125,11 @@ function RovoAgentSelector(_ref) {
123
125
  testId: testId
124
126
  }, /*#__PURE__*/React.createElement(_compiled.Stack, {
125
127
  space: "space.050"
126
- }, /*#__PURE__*/React.createElement(_form.Label, {
128
+ }, /*#__PURE__*/React.createElement(_default.Label, {
127
129
  htmlFor: AGENT_SELECT_ID
128
130
  }, /*#__PURE__*/React.createElement(_compiled.Text, {
129
131
  weight: "semibold"
130
- }, formatMessage(_messages.default.selectorLabel))), /*#__PURE__*/React.createElement(_select.default, {
132
+ }, formatMessage(_messages.default.selectorLabel))), /*#__PURE__*/React.createElement(_default2.default, {
131
133
  inputId: AGENT_SELECT_ID,
132
134
  placeholder: formatMessage(_messages.default.rovoAgentPlaceholder),
133
135
  options: agentOptions,
@@ -143,6 +145,7 @@ function RovoAgentSelector(_ref) {
143
145
  } // Disabled filtering in component since options are cached and filtered in relay store
144
146
  ,
145
147
  isLoading: isLoading,
148
+ isDisabled: isDisabled,
146
149
  onMenuScrollToBottom: handleMenuScrollToBottom,
147
150
  formatOptionLabel: function formatOptionLabel(_ref2) {
148
151
  var label = _ref2.label,
@@ -5,11 +5,11 @@ import _rovoAgentSelector_AtlaskitRovoAgentSelector from "./__generated__/rovoAg
5
5
  import { useCallback, useMemo, useRef, useState } from 'react';
6
6
  import { useIntl } from 'react-intl';
7
7
  import { graphql, usePaginationFragment } from 'react-relay';
8
- import { Label } from '@atlaskit/form';
9
- import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { Label } from '@atlaskit/form/label/default';
9
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
10
10
  import { Box, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
11
11
  import { AgentAvatar } from '@atlaskit/rovo-agent-components/ui/AgentAvatar';
12
- import Select from '@atlaskit/select';
12
+ import Select from '@atlaskit/select/default';
13
13
  import { useSuspenselessRefetch } from '../../common/utils/use-suspenseless-refetch';
14
14
  import rovoAgentSelectorInternal_AtlaskitRovoAgentSelectorPaginationQueryNode from './__generated__/rovoAgentSelectorInternal_AtlaskitRovoAgentSelectorPaginationQuery.graphql';
15
15
  import messages from './messages';
@@ -38,7 +38,8 @@ export function RovoAgentSelector({
38
38
  cloudId,
39
39
  selectedAgent,
40
40
  onChange,
41
- isLoading: isLoadingOverride
41
+ isLoading: isLoadingOverride,
42
+ isDisabled = false
42
43
  }) {
43
44
  var _data$agentStudio_get4;
44
45
  const {
@@ -115,6 +116,7 @@ export function RovoAgentSelector({
115
116
  filterOption: () => true // Disabled filtering in component since options are cached and filtered in relay store
116
117
  ,
117
118
  isLoading: isLoading,
119
+ isDisabled: isDisabled,
118
120
  onMenuScrollToBottom: handleMenuScrollToBottom,
119
121
  formatOptionLabel: ({
120
122
  label,
@@ -9,11 +9,11 @@ import _rovoAgentSelector_AtlaskitRovoAgentSelector from "./__generated__/rovoAg
9
9
  import { useCallback, useMemo, useRef, useState } from 'react';
10
10
  import { useIntl } from 'react-intl';
11
11
  import { graphql, usePaginationFragment } from 'react-relay';
12
- import { Label } from '@atlaskit/form';
13
- import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { Label } from '@atlaskit/form/label/default';
13
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
14
14
  import { Box, Inline, Stack, Text } from '@atlaskit/primitives/compiled';
15
15
  import { AgentAvatar } from '@atlaskit/rovo-agent-components/ui/AgentAvatar';
16
- import Select from '@atlaskit/select';
16
+ import Select from '@atlaskit/select/default';
17
17
  import { useSuspenselessRefetch } from '../../common/utils/use-suspenseless-refetch';
18
18
  import rovoAgentSelectorInternal_AtlaskitRovoAgentSelectorPaginationQueryNode from './__generated__/rovoAgentSelectorInternal_AtlaskitRovoAgentSelectorPaginationQuery.graphql';
19
19
  import messages from './messages';
@@ -46,7 +46,9 @@ export function RovoAgentSelector(_ref) {
46
46
  cloudId = _ref.cloudId,
47
47
  selectedAgent = _ref.selectedAgent,
48
48
  onChange = _ref.onChange,
49
- isLoadingOverride = _ref.isLoading;
49
+ isLoadingOverride = _ref.isLoading,
50
+ _ref$isDisabled = _ref.isDisabled,
51
+ isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled;
50
52
  var _useIntl = useIntl(),
51
53
  formatMessage = _useIntl.formatMessage;
52
54
  var isFeatureEnabled = isFeatureEnabledOverride !== null && isFeatureEnabledOverride !== void 0 ? isFeatureEnabledOverride : fg('jsm_help_center_one-click_rovo_agent');
@@ -133,6 +135,7 @@ export function RovoAgentSelector(_ref) {
133
135
  } // Disabled filtering in component since options are cached and filtered in relay store
134
136
  ,
135
137
  isLoading: isLoading,
138
+ isDisabled: isDisabled,
136
139
  onMenuScrollToBottom: handleMenuScrollToBottom,
137
140
  formatOptionLabel: function formatOptionLabel(_ref2) {
138
141
  var label = _ref2.label,
@@ -4,4 +4,4 @@
4
4
  */
5
5
  import type { RovoAgentSelectorProps } from './types';
6
6
  export declare const AGENT_SELECT_ID = "rovo-agent-select";
7
- export declare function RovoAgentSelector({ testId, isFeatureEnabled: isFeatureEnabledOverride, fragmentReference, cloudId, selectedAgent, onChange, isLoading: isLoadingOverride, }: RovoAgentSelectorProps): JSX.Element | null;
7
+ export declare function RovoAgentSelector({ testId, isFeatureEnabled: isFeatureEnabledOverride, fragmentReference, cloudId, selectedAgent, onChange, isLoading: isLoadingOverride, isDisabled, }: RovoAgentSelectorProps): JSX.Element | null;
@@ -38,4 +38,10 @@ export interface RovoAgentSelectorProps {
38
38
  * Whether the selector is in a loading state
39
39
  */
40
40
  isLoading?: boolean;
41
+ /**
42
+ * Whether the selector is disabled. The current selection stays visible but
43
+ * cannot be changed, and the control is removed from the tab order. Use this
44
+ * when another setting temporarily takes precedence over the selected agent.
45
+ */
46
+ isDisabled?: boolean;
41
47
  }
package/package.json CHANGED
@@ -16,14 +16,14 @@
16
16
  ],
17
17
  "atlaskit:src": "src/index.ts",
18
18
  "dependencies": {
19
- "@atlaskit/css": "^1.0.0",
20
- "@atlaskit/form": "^17.0.0",
21
- "@atlaskit/platform-feature-flags": "^2.1.0",
22
- "@atlaskit/primitives": "^22.2.0",
23
- "@atlaskit/rovo-agent-components": "^8.3.0",
24
- "@atlaskit/select": "^22.6.0",
19
+ "@atlaskit/css": "^1.1.0",
20
+ "@atlaskit/form": "^17.2.0",
21
+ "@atlaskit/platform-feature-flags": "^2.2.0",
22
+ "@atlaskit/primitives": "^22.5.0",
23
+ "@atlaskit/rovo-agent-components": "^8.9.0",
24
+ "@atlaskit/select": "^22.11.0",
25
25
  "@babel/runtime": "^7.0.0",
26
- "@compiled/react": "^1.0.0",
26
+ "@compiled/react": "^1.0.2",
27
27
  "react-relay": "^20.1.1",
28
28
  "relay-runtime": "^20.1.1"
29
29
  },
@@ -82,7 +82,7 @@
82
82
  }
83
83
  },
84
84
  "name": "@atlaskit/rovo-agent-selector",
85
- "version": "3.0.5",
85
+ "version": "3.1.0",
86
86
  "description": "rovo agent selector",
87
87
  "author": "Atlassian Pty Ltd",
88
88
  "license": "Apache-2.0",
@@ -1,39 +0,0 @@
1
- import path from 'path';
2
-
3
- import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
4
-
5
- import packageJson from './package.json';
6
-
7
- const packagePath = path.resolve(__dirname);
8
-
9
- const documentation: StructuredContentSource = {
10
- components: [
11
- {
12
- name: 'RovoAgentSelector',
13
- description: 'A component that allows users to select a Rovo agent from a list.',
14
- status: 'general-availability',
15
- import: {
16
- name: 'RovoAgentSelector',
17
- package: '@atlaskit/rovo-agent-selector',
18
- type: 'named',
19
- packagePath,
20
- packageJson,
21
- },
22
- usageGuidelines: [
23
- 'Use RovoAgentSelector to allow users to choose which Rovo agent to interact with.',
24
- 'Typically used in chat or assistance contexts.',
25
- ],
26
- examples: [
27
- {
28
- name: 'Basic',
29
- description: 'Standard Rovo agent selector display.',
30
- source: path.resolve(packagePath, './examples/basic.tsx'),
31
- },
32
- ],
33
- keywords: ['rovo', 'agent', 'selector', 'ai', 'assistance'],
34
- categories: ['interaction'],
35
- },
36
- ],
37
- };
38
-
39
- export default documentation;