@atlaskit/rovo-agent-selector 3.0.4 → 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,18 @@
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
+
10
+ ## 3.0.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 3.0.4
4
17
 
5
18
  ### Patch Changes
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  /**
8
- * @generated SignedSource<<282cabba73994c8491dd9402312ed2aa>>
8
+ * @generated SignedSource<<dd31ee89105da0e26204d969cfc805eb>>
9
9
  * @relayHash 10df1400fe5f08dbb71223dbeb55d5d0
10
10
  * @lightSyntaxTransform
11
11
  * @nogrep
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v2.0.0 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -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,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<282cabba73994c8491dd9402312ed2aa>>
2
+ * @generated SignedSource<<dd31ee89105da0e26204d969cfc805eb>>
3
3
  * @relayHash 10df1400fe5f08dbb71223dbeb55d5d0
4
4
  * @lightSyntaxTransform
5
5
  * @nogrep
@@ -1,15 +1,15 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v2.0.0 */
2
2
  import * as React from 'react';
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import _rovoAgentSelector_AtlaskitRovoAgentSelector from "./__generated__/rovoAgentSelector_AtlaskitRovoAgentSelector.graphql";
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,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<282cabba73994c8491dd9402312ed2aa>>
2
+ * @generated SignedSource<<dd31ee89105da0e26204d969cfc805eb>>
3
3
  * @relayHash 10df1400fe5f08dbb71223dbeb55d5d0
4
4
  * @lightSyntaxTransform
5
5
  * @nogrep
@@ -1,4 +1,4 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
1
+ /* index.tsx generated by @compiled/babel-plugin v2.0.0 */
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import * as React from 'react';
@@ -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,7 +4,7 @@ export declare const generateMockAgentEdges: (count: number) => {
4
4
  name: string;
5
5
  externalConfigReference: string;
6
6
  identityAccountId: string;
7
- creatorType: "CUSTOMER";
7
+ creatorType: 'CUSTOMER';
8
8
  };
9
9
  cursor: string;
10
10
  }[];
@@ -20,7 +20,7 @@ export type SuspenselessRefetchFunction<TVariables extends Variables> = (variabl
20
20
  *
21
21
  * See unit test.js for an example usage in a Relay context.
22
22
  */
23
- export declare const useSuspenselessRefetchStateless: <TQuery extends OperationType, TKey extends KeyType | null>(query: GraphQLTaggedNode, refetch: RefetchFnDynamic<TQuery, TKey>, { setIsLoading, setLastFetchError, fetchPolicy, networkCacheConfig, }?: SuspenselessRefetchHookStatelessOptions) => SuspenselessRefetchFunction<TQuery["variables"]>;
23
+ export declare const useSuspenselessRefetchStateless: <TQuery extends OperationType, TKey extends KeyType | null>(query: GraphQLTaggedNode, refetch: RefetchFnDynamic<TQuery, TKey>, { setIsLoading, setLastFetchError, fetchPolicy, networkCacheConfig, }?: SuspenselessRefetchHookStatelessOptions) => SuspenselessRefetchFunction<TQuery['variables']>;
24
24
  type SuspenselessRefetchHookOptions = {
25
25
  fetchPolicy?: FetchQueryFetchPolicy;
26
26
  networkCacheConfig?: CacheConfig;
@@ -41,5 +41,5 @@ export type SuspenselessRefetchHookReturn<TVariables extends Variables> = [
41
41
  *
42
42
  * @returns a tuple (array) containing: the new refetch function, and the aformentioned component state `isLoading` and `lastFetchError`
43
43
  */
44
- export declare const useSuspenselessRefetch: <TQuery extends OperationType, TKey extends KeyType | null>(query: GraphQLTaggedNode, refetch: RefetchFnDynamic<TQuery, TKey>, options?: SuspenselessRefetchHookOptions) => SuspenselessRefetchHookReturn<TQuery["variables"]>;
44
+ export declare const useSuspenselessRefetch: <TQuery extends OperationType, TKey extends KeyType | null>(query: GraphQLTaggedNode, refetch: RefetchFnDynamic<TQuery, TKey>, options?: SuspenselessRefetchHookOptions) => SuspenselessRefetchHookReturn<TQuery['variables']>;
45
45
  export {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @generated SignedSource<<282cabba73994c8491dd9402312ed2aa>>
2
+ * @generated SignedSource<<dd31ee89105da0e26204d969cfc805eb>>
3
3
  * @relayHash 10df1400fe5f08dbb71223dbeb55d5d0
4
4
  * @lightSyntaxTransform
5
5
  * @nogrep
@@ -9,11 +9,13 @@ import type { ConcreteRequest } from 'relay-runtime';
9
9
  import type { FragmentRefs } from "relay-runtime";
10
10
  export type AgentStudioAgentQueryInput = {
11
11
  includeDraftAgents?: boolean | null;
12
+ includeJiraCodingAgent?: boolean | null;
12
13
  name?: string | null;
13
14
  onlyEditableAgents?: boolean | null;
14
15
  onlyFavouriteAgents?: boolean | null;
15
16
  onlyMyAgents?: boolean | null;
16
17
  onlyPublishedEditableAgents?: boolean | null;
18
+ onlyPublishedEditableAgentsWithForge?: boolean | null;
17
19
  onlyTemplateAgents?: boolean | null;
18
20
  onlyUnpublishedAgents?: boolean | null;
19
21
  onlyVerifiedAgents?: boolean | null;
@@ -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": "^16.1.0",
21
- "@atlaskit/platform-feature-flags": "^2.0.0",
22
- "@atlaskit/primitives": "^22.0.0",
23
- "@atlaskit/rovo-agent-components": "^8.0.0",
24
- "@atlaskit/select": "^22.5.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": "^0.20.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.4",
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;