@atlaskit/rovo-agent-components 3.24.0 → 3.26.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,19 @@
1
1
  # @atlaskit/rovo-agent-components
2
2
 
3
+ ## 3.26.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d0e843139fc33`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d0e843139fc33) -
8
+ [ux] use agent verification dropdown item for view agent in browse agent
9
+
10
+ ## 3.25.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`7dcb34bc033ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7dcb34bc033ba) -
15
+ Created new component `AgentVerifiedIcon`
16
+
3
17
  ## 3.24.0
4
18
 
5
19
  ### Minor Changes
@@ -22,6 +22,7 @@ var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/sh
22
22
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
23
  var _compiled = require("@atlaskit/primitives/compiled");
24
24
  var _chatIcon = require("../../common/ui/chat-icon");
25
+ var _agentVerificationDropdownItem = require("../agent-verification-dropdown-item");
25
26
  var _messages = _interopRequireDefault(require("./messages"));
26
27
  var _excluded = ["triggerRef"];
27
28
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -55,6 +56,7 @@ var ChatToAgentButton = exports.ChatToAgentButton = function ChatToAgentButton(_
55
56
  };
56
57
  var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
57
58
  var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
59
+ agentId = _ref2.agentId,
58
60
  onEditAgent = _ref2.onEditAgent,
59
61
  onCopyAgent = _ref2.onCopyAgent,
60
62
  onDuplicateAgent = _ref2.onDuplicateAgent,
@@ -74,8 +76,8 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
74
76
  loadPermissionsOnMount = _ref2.loadPermissionsOnMount,
75
77
  shouldTriggerStopPropagation = _ref2.shouldTriggerStopPropagation,
76
78
  agentName = _ref2.agentName,
77
- isVerified = _ref2.isVerified,
78
- isAbleToGovernAgents = _ref2.isAbleToGovernAgents;
79
+ agentRef = _ref2.agentRef,
80
+ userPermissionsRef = _ref2.userPermissionsRef;
79
81
  var _useState = (0, _react.useState)(false),
80
82
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
81
83
  isLoading = _useState2[0],
@@ -195,7 +197,10 @@ var AgentDropdownMenu = exports.AgentDropdownMenu = function AgentDropdownMenu(_
195
197
  setHasBeenCopied(true);
196
198
  onCopyAgent === null || onCopyAgent === void 0 || onCopyAgent(e);
197
199
  }
198
- }, formatMessage(hasBeenCopied ? _messages.default.linkedCopiedToProfile : _messages.default.copyLinkToProfile)), isAbleToGovernAgents && (0, _platformFeatureFlags.fg)('rovo_agents_agent_verification') && /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
199
- onClick: function onClick() {}
200
- }, formatMessage(isVerified ? _messages.default.unverifyAgent : _messages.default.verifyAgent))), renderEditDelete());
200
+ }, formatMessage(hasBeenCopied ? _messages.default.linkedCopiedToProfile : _messages.default.copyLinkToProfile)), agentRef && userPermissionsRef && (0, _platformFeatureFlags.fg)('rovo_agents_agent_verification') && /*#__PURE__*/_react.default.createElement(_agentVerificationDropdownItem.AgentVerificationDropdownItem, {
201
+ agentId: agentId,
202
+ agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
203
+ userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
204
+ testId: "agent-actions-menu-verification"
205
+ })), renderEditDelete());
201
206
  };
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.AgentVerified = void 0;
7
+ exports.AgentVerifiedIcon = exports.AgentVerified = void 0;
8
8
  var _agentVerified_AtlaskitRovoAgentComponents2 = _interopRequireDefault(require("./__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _reactIntlNext = require("react-intl-next");
@@ -16,12 +16,19 @@ var AgentVerified = exports.AgentVerified = function AgentVerified(_ref) {
16
16
  var agentRef = _ref.agentRef,
17
17
  _ref$size = _ref.size,
18
18
  size = _ref$size === void 0 ? 'small' : _ref$size;
19
- var _useIntl = (0, _reactIntlNext.useIntl)(),
20
- formatMessage = _useIntl.formatMessage;
21
19
  var data = (0, _reactRelay.useFragment)(_agentVerified_AtlaskitRovoAgentComponents2.default, agentRef);
22
20
  if (!(data !== null && data !== void 0 && data.isVerified)) {
23
21
  return null;
24
22
  }
23
+ return /*#__PURE__*/_react.default.createElement(AgentVerifiedIcon, {
24
+ size: size
25
+ });
26
+ };
27
+ var AgentVerifiedIcon = exports.AgentVerifiedIcon = function AgentVerifiedIcon(_ref2) {
28
+ var _ref2$size = _ref2.size,
29
+ size = _ref2$size === void 0 ? 'small' : _ref2$size;
30
+ var _useIntl = (0, _reactIntlNext.useIntl)(),
31
+ formatMessage = _useIntl.formatMessage;
25
32
  return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
26
33
  content: formatMessage(_messages.default.verifiedAgentTooltip)
27
34
  }, /*#__PURE__*/_react.default.createElement(_statusVerified.default, {
@@ -10,6 +10,7 @@ import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
11
  import { Box, Inline } from '@atlaskit/primitives/compiled';
12
12
  import { ChatPillIcon } from '../../common/ui/chat-icon';
13
+ import { AgentVerificationDropdownItem } from '../agent-verification-dropdown-item';
13
14
  import messages from './messages';
14
15
  const styles = {
15
16
  chatToAgentButtonContainer: "_1bsb1osq",
@@ -43,6 +44,7 @@ export const ChatToAgentButton = ({
43
44
  };
44
45
  export const AgentDropdownMenu = ({
45
46
  isAutodevTemplateAgent,
47
+ agentId,
46
48
  onEditAgent,
47
49
  onCopyAgent,
48
50
  onDuplicateAgent,
@@ -61,8 +63,8 @@ export const AgentDropdownMenu = ({
61
63
  loadPermissionsOnMount,
62
64
  shouldTriggerStopPropagation,
63
65
  agentName,
64
- isVerified,
65
- isAbleToGovernAgents
66
+ agentRef,
67
+ userPermissionsRef
66
68
  }) => {
67
69
  const [isLoading, setIsLoading] = useState(false);
68
70
  const {
@@ -155,7 +157,10 @@ export const AgentDropdownMenu = ({
155
157
  setHasBeenCopied(true);
156
158
  onCopyAgent === null || onCopyAgent === void 0 ? void 0 : onCopyAgent(e);
157
159
  }
158
- }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), isAbleToGovernAgents && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(DropdownItem, {
159
- onClick: () => {}
160
- }, formatMessage(isVerified ? messages.unverifyAgent : messages.verifyAgent))), renderEditDelete());
160
+ }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
161
+ agentId: agentId,
162
+ agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
163
+ userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
164
+ testId: "agent-actions-menu-verification"
165
+ })), renderEditDelete());
161
166
  };
@@ -9,13 +9,20 @@ export const AgentVerified = ({
9
9
  agentRef,
10
10
  size = 'small'
11
11
  }) => {
12
- const {
13
- formatMessage
14
- } = useIntl();
15
12
  const data = useFragment(_agentVerified_AtlaskitRovoAgentComponents, agentRef);
16
13
  if (!(data !== null && data !== void 0 && data.isVerified)) {
17
14
  return null;
18
15
  }
16
+ return /*#__PURE__*/React.createElement(AgentVerifiedIcon, {
17
+ size: size
18
+ });
19
+ };
20
+ export const AgentVerifiedIcon = ({
21
+ size = 'small'
22
+ }) => {
23
+ const {
24
+ formatMessage
25
+ } = useIntl();
19
26
  return /*#__PURE__*/React.createElement(Tooltip, {
20
27
  content: formatMessage(messages.verifiedAgentTooltip)
21
28
  }, /*#__PURE__*/React.createElement(VerifiedIcon, {
@@ -15,6 +15,7 @@ import MoreIcon from '@atlaskit/icon/core/show-more-horizontal';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
16
  import { Box, Inline } from '@atlaskit/primitives/compiled';
17
17
  import { ChatPillIcon } from '../../common/ui/chat-icon';
18
+ import { AgentVerificationDropdownItem } from '../agent-verification-dropdown-item';
18
19
  import messages from './messages';
19
20
  var styles = {
20
21
  chatToAgentButtonContainer: "_1bsb1osq",
@@ -46,6 +47,7 @@ export var ChatToAgentButton = function ChatToAgentButton(_ref) {
46
47
  };
47
48
  export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
48
49
  var isAutodevTemplateAgent = _ref2.isAutodevTemplateAgent,
50
+ agentId = _ref2.agentId,
49
51
  onEditAgent = _ref2.onEditAgent,
50
52
  onCopyAgent = _ref2.onCopyAgent,
51
53
  onDuplicateAgent = _ref2.onDuplicateAgent,
@@ -65,8 +67,8 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
65
67
  loadPermissionsOnMount = _ref2.loadPermissionsOnMount,
66
68
  shouldTriggerStopPropagation = _ref2.shouldTriggerStopPropagation,
67
69
  agentName = _ref2.agentName,
68
- isVerified = _ref2.isVerified,
69
- isAbleToGovernAgents = _ref2.isAbleToGovernAgents;
70
+ agentRef = _ref2.agentRef,
71
+ userPermissionsRef = _ref2.userPermissionsRef;
70
72
  var _useState = useState(false),
71
73
  _useState2 = _slicedToArray(_useState, 2),
72
74
  isLoading = _useState2[0],
@@ -186,7 +188,10 @@ export var AgentDropdownMenu = function AgentDropdownMenu(_ref2) {
186
188
  setHasBeenCopied(true);
187
189
  onCopyAgent === null || onCopyAgent === void 0 || onCopyAgent(e);
188
190
  }
189
- }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), isAbleToGovernAgents && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(DropdownItem, {
190
- onClick: function onClick() {}
191
- }, formatMessage(isVerified ? messages.unverifyAgent : messages.verifyAgent))), renderEditDelete());
191
+ }, formatMessage(hasBeenCopied ? messages.linkedCopiedToProfile : messages.copyLinkToProfile)), agentRef && userPermissionsRef && fg('rovo_agents_agent_verification') && /*#__PURE__*/React.createElement(AgentVerificationDropdownItem, {
192
+ agentId: agentId,
193
+ agentRef: agentRef !== null && agentRef !== void 0 ? agentRef : null,
194
+ userPermissionsRef: userPermissionsRef !== null && userPermissionsRef !== void 0 ? userPermissionsRef : null,
195
+ testId: "agent-actions-menu-verification"
196
+ })), renderEditDelete());
192
197
  };
@@ -9,12 +9,19 @@ export var AgentVerified = function AgentVerified(_ref) {
9
9
  var agentRef = _ref.agentRef,
10
10
  _ref$size = _ref.size,
11
11
  size = _ref$size === void 0 ? 'small' : _ref$size;
12
- var _useIntl = useIntl(),
13
- formatMessage = _useIntl.formatMessage;
14
12
  var data = useFragment(_agentVerified_AtlaskitRovoAgentComponents, agentRef);
15
13
  if (!(data !== null && data !== void 0 && data.isVerified)) {
16
14
  return null;
17
15
  }
16
+ return /*#__PURE__*/React.createElement(AgentVerifiedIcon, {
17
+ size: size
18
+ });
19
+ };
20
+ export var AgentVerifiedIcon = function AgentVerifiedIcon(_ref2) {
21
+ var _ref2$size = _ref2.size,
22
+ size = _ref2$size === void 0 ? 'small' : _ref2$size;
23
+ var _useIntl = useIntl(),
24
+ formatMessage = _useIntl.formatMessage;
18
25
  return /*#__PURE__*/React.createElement(Tooltip, {
19
26
  content: formatMessage(messages.verifiedAgentTooltip)
20
27
  }, /*#__PURE__*/React.createElement(VerifiedIcon, {
@@ -6,6 +6,7 @@ import React from 'react';
6
6
  import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
7
7
  import { type ButtonProps, IconButton } from '@atlaskit/button/new';
8
8
  import DropdownMenu, { DropdownItem } from '@atlaskit/dropdown-menu';
9
+ import { type AgentVerificationDropdownItemProps } from '../agent-verification-dropdown-item';
9
10
  type ChatToAgentButtonProps = {
10
11
  onClick: ButtonProps['onClick'];
11
12
  };
@@ -45,8 +46,6 @@ type AgentDropdownMenuProps = {
45
46
  isEditEnabled: boolean;
46
47
  isDeleteEnabled: boolean;
47
48
  }>;
48
- isVerified?: boolean | null;
49
- isAbleToGovernAgents?: boolean | null;
50
- } & ViewAgentOptionProps & ViewAgentFullProfileProps;
51
- export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, isVerified, isAbleToGovernAgents, }: AgentDropdownMenuProps) => JSX.Element;
49
+ } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef'>>;
50
+ export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, agentId, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, }: AgentDropdownMenuProps) => JSX.Element;
52
51
  export {};
@@ -1,7 +1,12 @@
1
1
  import React from 'react';
2
2
  import type { IconSize } from '@atlaskit/icon';
3
3
  import type { agentVerified_AtlaskitRovoAgentComponents$key } from './__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql';
4
- export declare const AgentVerified: ({ agentRef, size, }: {
4
+ export type AgentVerifiedProps = {
5
5
  agentRef: agentVerified_AtlaskitRovoAgentComponents$key | null;
6
6
  size?: IconSize;
7
- }) => React.JSX.Element | null;
7
+ };
8
+ export declare const AgentVerified: ({ agentRef, size, }: AgentVerifiedProps) => React.JSX.Element | null;
9
+ export type AgentVerifiedIconProps = {
10
+ size?: IconSize;
11
+ };
12
+ export declare const AgentVerifiedIcon: ({ size }: AgentVerifiedIconProps) => React.JSX.Element;
@@ -6,6 +6,7 @@ import React from 'react';
6
6
  import { type UIAnalyticsEvent } from '@atlaskit/analytics-next';
7
7
  import { type ButtonProps, IconButton } from '@atlaskit/button/new';
8
8
  import DropdownMenu, { DropdownItem } from '@atlaskit/dropdown-menu';
9
+ import { type AgentVerificationDropdownItemProps } from '../agent-verification-dropdown-item';
9
10
  type ChatToAgentButtonProps = {
10
11
  onClick: ButtonProps['onClick'];
11
12
  };
@@ -45,8 +46,6 @@ type AgentDropdownMenuProps = {
45
46
  isEditEnabled: boolean;
46
47
  isDeleteEnabled: boolean;
47
48
  }>;
48
- isVerified?: boolean | null;
49
- isAbleToGovernAgents?: boolean | null;
50
- } & ViewAgentOptionProps & ViewAgentFullProfileProps;
51
- export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, isVerified, isAbleToGovernAgents, }: AgentDropdownMenuProps) => JSX.Element;
49
+ } & ViewAgentOptionProps & ViewAgentFullProfileProps & Partial<Pick<AgentVerificationDropdownItemProps, 'agentRef' | 'userPermissionsRef'>>;
50
+ export declare const AgentDropdownMenu: ({ isAutodevTemplateAgent, agentId, onEditAgent, onCopyAgent, onDuplicateAgent, onDeleteAgent, onViewAgentFullProfileClick, onOpenChange, isForgeAgent, showViewAgentOption, onViewAgentClick, onDropdownTriggerClick, spacing, appearance, dropdownMenuTestId, doesAgentHaveIdentityAccountId, loadAgentPermissions, loadPermissionsOnMount, shouldTriggerStopPropagation, agentName, agentRef, userPermissionsRef, }: AgentDropdownMenuProps) => JSX.Element;
52
51
  export {};
@@ -1,7 +1,12 @@
1
1
  import React from 'react';
2
2
  import type { IconSize } from '@atlaskit/icon';
3
3
  import type { agentVerified_AtlaskitRovoAgentComponents$key } from './__generated__/agentVerified_AtlaskitRovoAgentComponents.graphql';
4
- export declare const AgentVerified: ({ agentRef, size, }: {
4
+ export type AgentVerifiedProps = {
5
5
  agentRef: agentVerified_AtlaskitRovoAgentComponents$key | null;
6
6
  size?: IconSize;
7
- }) => React.JSX.Element | null;
7
+ };
8
+ export declare const AgentVerified: ({ agentRef, size, }: AgentVerifiedProps) => React.JSX.Element | null;
9
+ export type AgentVerifiedIconProps = {
10
+ size?: IconSize;
11
+ };
12
+ export declare const AgentVerifiedIcon: ({ size }: AgentVerifiedIconProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-agent-components",
3
- "version": "3.24.0",
3
+ "version": "3.26.0",
4
4
  "description": "This package host public components related to rovo agents, the components here are needed for other public atlaskit packages",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -74,9 +74,6 @@
74
74
  },
75
75
  "techstack": {
76
76
  "@atlassian/frontend": {
77
- "code-structure": [
78
- "tangerine-next"
79
- ],
80
77
  "import-structure": [
81
78
  "atlassian-conventions"
82
79
  ],