@atlaskit/rovo-agent-components 9.9.22 → 10.0.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,24 @@
1
1
  # @atlaskit/rovo-agent-components
2
2
 
3
+ ## 10.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`daad5d62bf7cb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/daad5d62bf7cb) -
8
+ Move `ResolvedAgentAvatar` into the Editor-owned shared AI package without changing its behavior.
9
+ Replace imports from `@atlaskit/rovo-agent-components/ui/agent-avatar/ResolvedAgentAvatar` with
10
+ `@atlassian/editor-ai-common/ResolvedAgentAvatar`.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 9.9.23
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
3
22
  ## 9.9.22
4
23
 
5
24
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-agent-components",
3
- "version": "9.9.22",
3
+ "version": "10.0.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
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-monorepo",
6
6
  "atlassian": {
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/afm-i18n-platform-ai-mate-rovo-agent-components": "2.271.0",
40
40
  "@atlaskit/analytics-next": "^12.6.0",
41
41
  "@atlaskit/avatar": "^30.0.0",
42
- "@atlaskit/button": "^25.4.0",
42
+ "@atlaskit/button": "^25.5.0",
43
43
  "@atlaskit/css": "^1.1.0",
44
44
  "@atlaskit/dropdown-menu": "^21.0.0",
45
45
  "@atlaskit/feature-gate-js-client": "^7.0.0",
@@ -54,13 +54,12 @@
54
54
  "@atlaskit/rovo-agent-analytics": "^6.6.0",
55
55
  "@atlaskit/skeleton": "^4.4.0",
56
56
  "@atlaskit/spinner": "^20.4.0",
57
- "@atlaskit/tmp-editor-statsig": "^241.0.0",
57
+ "@atlaskit/tmp-editor-statsig": "^243.0.0",
58
58
  "@atlaskit/tokens": "^20.6.0",
59
59
  "@atlaskit/tooltip": "^24.4.0",
60
60
  "@babel/runtime": "^7.0.0",
61
61
  "@compiled/react": "^1.0.2",
62
62
  "react-dom": "^18.2.0",
63
- "react-error-boundary": "^3.1.3",
64
63
  "react-magnetic-di": "^3.1.4",
65
64
  "react-relay": "^20.1.1"
66
65
  },
@@ -1,4 +0,0 @@
1
- ._1bah1h6o{justify-content:center}
2
- ._1e0c1txw{display:flex}
3
- ._4cvr1h6o{align-items:center}
4
- ._bfhkvuon{background-color:var(--ds-surface,#fff)}
@@ -1,131 +0,0 @@
1
- /* ResolvedAgentAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
2
- "use strict";
3
-
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
- Object.defineProperty(exports, "__esModule", {
7
- value: true
8
- });
9
- exports.ResolvedAgentAvatar = void 0;
10
- require("./ResolvedAgentAvatar.compiled.css");
11
- var _runtime = require("@compiled/react/runtime");
12
- var _ResolvedAgentAvatarQuery2 = _interopRequireDefault(require("./__generated__/ResolvedAgentAvatarQuery.graphql"));
13
- var _react = _interopRequireWildcard(require("react"));
14
- var _reactErrorBoundary = require("react-error-boundary");
15
- var _reactRelay = require("react-relay");
16
- var _avatar = _interopRequireDefault(require("@atlaskit/avatar/avatar"));
17
- var _avatarSizes = require("@atlaskit/avatar/avatar-sizes");
18
- var _Skeleton = _interopRequireDefault(require("@atlaskit/avatar/Skeleton"));
19
- var _box = require("@atlaskit/primitives/compiled/box");
20
- 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); }
21
- var styles = {
22
- showBorder: "_1e0c1txw _4cvr1h6o _1bah1h6o _bfhkvuon"
23
- };
24
-
25
- // The fixed partition/resource-owner/resource-type segments of an identity user ARI — only the
26
- // account id itself varies. Matched by prefix rather than via `@atlassian/ari` (an internal
27
- // package this public package can't depend on).
28
- var IDENTITY_USER_ARI_PREFIX = 'ari:cloud:identity::user/';
29
-
30
- /**
31
- * Parses the account id needed for the picture fetch from whatever identity a caller carries —
32
- * either the bare account id, or the full identity ARI (callers that already have one on hand
33
- * don't need to strip it first).
34
- */
35
- var parseIdentityAccountId = function parseIdentityAccountId(value) {
36
- var trimmed = value === null || value === void 0 ? void 0 : value.trim();
37
- if (!trimmed) {
38
- return undefined;
39
- }
40
- return trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : trimmed;
41
- };
42
- var FetchedAgentAvatar = function FetchedAgentAvatar(_ref) {
43
- var _data$user, _data$user2;
44
- var accountId = _ref.accountId,
45
- agentName = _ref.agentName,
46
- fallback = _ref.fallback,
47
- showBorder = _ref.showBorder,
48
- size = _ref.size,
49
- UNSAFE_isUpdatedGeometry = _ref.UNSAFE_isUpdatedGeometry;
50
- var data = (0, _reactRelay.useLazyLoadQuery)(_ResolvedAgentAvatarQuery2.default, {
51
- accountId: accountId
52
- }, {
53
- fetchPolicy: 'store-or-network'
54
- });
55
- var picture = (_data$user = data.user) === null || _data$user === void 0 || (_data$user = _data$user.picture) === null || _data$user === void 0 ? void 0 : _data$user.trim();
56
- if (!picture) {
57
- return fallback;
58
- }
59
- var name = ((_data$user2 = data.user) === null || _data$user2 === void 0 || (_data$user2 = _data$user2.name) === null || _data$user2 === void 0 ? void 0 : _data$user2.trim()) || agentName;
60
- if (!showBorder) {
61
- return /*#__PURE__*/_react.default.createElement(_avatar.default, {
62
- appearance: "hexagon",
63
- src: picture,
64
- name: name,
65
- label: name,
66
- size: size,
67
- borderColor: "transparent",
68
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
69
- });
70
- }
71
- return /*#__PURE__*/_react.default.createElement(_box.Box, {
72
- testId: "resolved-agent-avatar-border",
73
- xcss: styles.showBorder,
74
- style: {
75
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
76
- height: _avatarSizes.AVATAR_SIZES[size],
77
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
78
- width: _avatarSizes.AVATAR_SIZES[size]
79
- }
80
- }, /*#__PURE__*/_react.default.createElement(_avatar.default, {
81
- appearance: "hexagon",
82
- src: picture,
83
- name: name,
84
- label: name,
85
- size: size,
86
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
87
- }));
88
- };
89
-
90
- /**
91
- * The best avatar available for an agent identity: the real account picture when one can be
92
- * fetched, otherwise `fallback`. Works for any identity with an `agentIdentityAccountId` —
93
- * including the default Rovo agent, now that Rovo is provisioned its own identity account. A
94
- * `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a failed or unavailable
95
- * fetch from ever breaking the caller — it just renders `fallback`.
96
- */
97
- var ResolvedAgentAvatar = exports.ResolvedAgentAvatar = function ResolvedAgentAvatar(_ref2) {
98
- var agentIdentityAccountId = _ref2.agentIdentityAccountId,
99
- agentName = _ref2.agentName,
100
- fallback = _ref2.fallback,
101
- _ref2$showBorder = _ref2.showBorder,
102
- showBorder = _ref2$showBorder === void 0 ? false : _ref2$showBorder,
103
- _ref2$size = _ref2.size,
104
- size = _ref2$size === void 0 ? 'medium' : _ref2$size,
105
- UNSAFE_isUpdatedGeometry = _ref2.UNSAFE_isUpdatedGeometry;
106
- var resolvedFallback = fallback !== null && fallback !== void 0 ? fallback : /*#__PURE__*/_react.default.createElement(_avatar.default, {
107
- appearance: "hexagon",
108
- name: agentName,
109
- size: size,
110
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
111
- });
112
- var accountId = parseIdentityAccountId(agentIdentityAccountId);
113
- if (!accountId) {
114
- return resolvedFallback;
115
- }
116
- return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
117
- fallback: resolvedFallback
118
- }, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
119
- fallback: /*#__PURE__*/_react.default.createElement(_Skeleton.default, {
120
- appearance: "hexagon",
121
- size: size
122
- })
123
- }, /*#__PURE__*/_react.default.createElement(FetchedAgentAvatar, {
124
- accountId: accountId,
125
- agentName: agentName,
126
- fallback: resolvedFallback,
127
- showBorder: showBorder,
128
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry,
129
- size: size
130
- })));
131
- };
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /**
8
- * @generated SignedSource<<765322731b31afdb0584c134ed53e12a>>
9
- * @relayHash 07c2f9612a7a8401a21c6ad1a0936b2d
10
- * @lightSyntaxTransform
11
- * @nogrep
12
- * @codegen-command: yarn relay
13
- */
14
-
15
- /* tslint:disable */
16
- /* eslint-disable */
17
- // @ts-nocheck
18
-
19
- // @relayRequestID aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5
20
-
21
- var node = function () {
22
- var v0 = [{
23
- "defaultValue": null,
24
- "kind": "LocalArgument",
25
- "name": "accountId"
26
- }],
27
- v1 = [{
28
- "kind": "Variable",
29
- "name": "accountId",
30
- "variableName": "accountId"
31
- }],
32
- v2 = {
33
- "kind": "ScalarField",
34
- "name": "name"
35
- },
36
- v3 = {
37
- "kind": "ScalarField",
38
- "name": "picture"
39
- };
40
- return {
41
- "fragment": {
42
- "argumentDefinitions": v0 /*: any*/,
43
- "kind": "Fragment",
44
- "name": "ResolvedAgentAvatarQuery",
45
- "selections": [{
46
- "args": v1 /*: any*/,
47
- "kind": "LinkedField",
48
- "name": "user",
49
- "plural": false,
50
- "selections": [v2 /*: any*/, v3 /*: any*/]
51
- }],
52
- "type": "Query"
53
- },
54
- "kind": "Request",
55
- "operation": {
56
- "argumentDefinitions": v0 /*: any*/,
57
- "kind": "Operation",
58
- "name": "ResolvedAgentAvatarQuery",
59
- "selections": [{
60
- "args": v1 /*: any*/,
61
- "kind": "LinkedField",
62
- "name": "user",
63
- "plural": false,
64
- "selections": [{
65
- "kind": "ScalarField",
66
- "name": "__typename"
67
- }, v2 /*: any*/, v3 /*: any*/, {
68
- "kind": "ScalarField",
69
- "name": "id"
70
- }]
71
- }]
72
- },
73
- "params": {
74
- "id": "aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5",
75
- "metadata": {},
76
- "name": "ResolvedAgentAvatarQuery",
77
- "operationKind": "query",
78
- "text": null
79
- }
80
- };
81
- }();
82
- node.hash = "a2c97e7ac7feca789629a3b50c6150aa";
83
- var _default = exports.default = node;
@@ -1,4 +0,0 @@
1
- ._1bah1h6o{justify-content:center}
2
- ._1e0c1txw{display:flex}
3
- ._4cvr1h6o{align-items:center}
4
- ._bfhkvuon{background-color:var(--ds-surface,#fff)}
@@ -1,122 +0,0 @@
1
- /* ResolvedAgentAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
2
- import "./ResolvedAgentAvatar.compiled.css";
3
- import { ax, ix } from "@compiled/react/runtime";
4
- import _ResolvedAgentAvatarQuery from "./__generated__/ResolvedAgentAvatarQuery.graphql";
5
- import React, { Suspense } from 'react';
6
- import { ErrorBoundary } from 'react-error-boundary';
7
- import { graphql, useLazyLoadQuery } from 'react-relay';
8
- import Avatar from '@atlaskit/avatar/avatar';
9
- import { AVATAR_SIZES } from '@atlaskit/avatar/avatar-sizes';
10
- import AvatarSkeleton from '@atlaskit/avatar/Skeleton';
11
- import { Box } from '@atlaskit/primitives/compiled/box';
12
- const styles = {
13
- showBorder: "_1e0c1txw _4cvr1h6o _1bah1h6o _bfhkvuon"
14
- };
15
-
16
- // The fixed partition/resource-owner/resource-type segments of an identity user ARI — only the
17
- // account id itself varies. Matched by prefix rather than via `@atlassian/ari` (an internal
18
- // package this public package can't depend on).
19
- const IDENTITY_USER_ARI_PREFIX = 'ari:cloud:identity::user/';
20
-
21
- /**
22
- * Parses the account id needed for the picture fetch from whatever identity a caller carries —
23
- * either the bare account id, or the full identity ARI (callers that already have one on hand
24
- * don't need to strip it first).
25
- */
26
- const parseIdentityAccountId = value => {
27
- const trimmed = value === null || value === void 0 ? void 0 : value.trim();
28
- if (!trimmed) {
29
- return undefined;
30
- }
31
- return trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : trimmed;
32
- };
33
- const FetchedAgentAvatar = ({
34
- accountId,
35
- agentName,
36
- fallback,
37
- showBorder,
38
- size,
39
- UNSAFE_isUpdatedGeometry
40
- }) => {
41
- var _data$user, _data$user$picture, _data$user2, _data$user2$name;
42
- const data = useLazyLoadQuery(_ResolvedAgentAvatarQuery, {
43
- accountId
44
- }, {
45
- fetchPolicy: 'store-or-network'
46
- });
47
- const picture = (_data$user = data.user) === null || _data$user === void 0 ? void 0 : (_data$user$picture = _data$user.picture) === null || _data$user$picture === void 0 ? void 0 : _data$user$picture.trim();
48
- if (!picture) {
49
- return fallback;
50
- }
51
- const name = ((_data$user2 = data.user) === null || _data$user2 === void 0 ? void 0 : (_data$user2$name = _data$user2.name) === null || _data$user2$name === void 0 ? void 0 : _data$user2$name.trim()) || agentName;
52
- if (!showBorder) {
53
- return /*#__PURE__*/React.createElement(Avatar, {
54
- appearance: "hexagon",
55
- src: picture,
56
- name: name,
57
- label: name,
58
- size: size,
59
- borderColor: "transparent",
60
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
61
- });
62
- }
63
- return /*#__PURE__*/React.createElement(Box, {
64
- testId: "resolved-agent-avatar-border",
65
- xcss: styles.showBorder,
66
- style: {
67
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
68
- height: AVATAR_SIZES[size],
69
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
70
- width: AVATAR_SIZES[size]
71
- }
72
- }, /*#__PURE__*/React.createElement(Avatar, {
73
- appearance: "hexagon",
74
- src: picture,
75
- name: name,
76
- label: name,
77
- size: size,
78
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
79
- }));
80
- };
81
-
82
- /**
83
- * The best avatar available for an agent identity: the real account picture when one can be
84
- * fetched, otherwise `fallback`. Works for any identity with an `agentIdentityAccountId` —
85
- * including the default Rovo agent, now that Rovo is provisioned its own identity account. A
86
- * `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a failed or unavailable
87
- * fetch from ever breaking the caller — it just renders `fallback`.
88
- */
89
- export const ResolvedAgentAvatar = ({
90
- agentIdentityAccountId,
91
- agentName,
92
- fallback,
93
- showBorder = false,
94
- size = 'medium',
95
- UNSAFE_isUpdatedGeometry
96
- }) => {
97
- const resolvedFallback = fallback !== null && fallback !== void 0 ? fallback : /*#__PURE__*/React.createElement(Avatar, {
98
- appearance: "hexagon",
99
- name: agentName,
100
- size: size,
101
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
102
- });
103
- const accountId = parseIdentityAccountId(agentIdentityAccountId);
104
- if (!accountId) {
105
- return resolvedFallback;
106
- }
107
- return /*#__PURE__*/React.createElement(ErrorBoundary, {
108
- fallback: resolvedFallback
109
- }, /*#__PURE__*/React.createElement(Suspense, {
110
- fallback: /*#__PURE__*/React.createElement(AvatarSkeleton, {
111
- appearance: "hexagon",
112
- size: size
113
- })
114
- }, /*#__PURE__*/React.createElement(FetchedAgentAvatar, {
115
- accountId: accountId,
116
- agentName: agentName,
117
- fallback: resolvedFallback,
118
- showBorder: showBorder,
119
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry,
120
- size: size
121
- })));
122
- };
@@ -1,77 +0,0 @@
1
- /**
2
- * @generated SignedSource<<765322731b31afdb0584c134ed53e12a>>
3
- * @relayHash 07c2f9612a7a8401a21c6ad1a0936b2d
4
- * @lightSyntaxTransform
5
- * @nogrep
6
- * @codegen-command: yarn relay
7
- */
8
-
9
- /* tslint:disable */
10
- /* eslint-disable */
11
- // @ts-nocheck
12
-
13
- // @relayRequestID aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5
14
-
15
- const node = function () {
16
- var v0 = [{
17
- "defaultValue": null,
18
- "kind": "LocalArgument",
19
- "name": "accountId"
20
- }],
21
- v1 = [{
22
- "kind": "Variable",
23
- "name": "accountId",
24
- "variableName": "accountId"
25
- }],
26
- v2 = {
27
- "kind": "ScalarField",
28
- "name": "name"
29
- },
30
- v3 = {
31
- "kind": "ScalarField",
32
- "name": "picture"
33
- };
34
- return {
35
- "fragment": {
36
- "argumentDefinitions": v0 /*: any*/,
37
- "kind": "Fragment",
38
- "name": "ResolvedAgentAvatarQuery",
39
- "selections": [{
40
- "args": v1 /*: any*/,
41
- "kind": "LinkedField",
42
- "name": "user",
43
- "plural": false,
44
- "selections": [v2 /*: any*/, v3 /*: any*/]
45
- }],
46
- "type": "Query"
47
- },
48
- "kind": "Request",
49
- "operation": {
50
- "argumentDefinitions": v0 /*: any*/,
51
- "kind": "Operation",
52
- "name": "ResolvedAgentAvatarQuery",
53
- "selections": [{
54
- "args": v1 /*: any*/,
55
- "kind": "LinkedField",
56
- "name": "user",
57
- "plural": false,
58
- "selections": [{
59
- "kind": "ScalarField",
60
- "name": "__typename"
61
- }, v2 /*: any*/, v3 /*: any*/, {
62
- "kind": "ScalarField",
63
- "name": "id"
64
- }]
65
- }]
66
- },
67
- "params": {
68
- "id": "aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5",
69
- "metadata": {},
70
- "name": "ResolvedAgentAvatarQuery",
71
- "operationKind": "query",
72
- "text": null
73
- }
74
- };
75
- }();
76
- node.hash = "a2c97e7ac7feca789629a3b50c6150aa";
77
- export default node;
@@ -1,4 +0,0 @@
1
- ._1bah1h6o{justify-content:center}
2
- ._1e0c1txw{display:flex}
3
- ._4cvr1h6o{align-items:center}
4
- ._bfhkvuon{background-color:var(--ds-surface,#fff)}
@@ -1,122 +0,0 @@
1
- /* ResolvedAgentAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
2
- import "./ResolvedAgentAvatar.compiled.css";
3
- import { ax, ix } from "@compiled/react/runtime";
4
- import _ResolvedAgentAvatarQuery from "./__generated__/ResolvedAgentAvatarQuery.graphql";
5
- import React, { Suspense } from 'react';
6
- import { ErrorBoundary } from 'react-error-boundary';
7
- import { graphql, useLazyLoadQuery } from 'react-relay';
8
- import Avatar from '@atlaskit/avatar/avatar';
9
- import { AVATAR_SIZES } from '@atlaskit/avatar/avatar-sizes';
10
- import AvatarSkeleton from '@atlaskit/avatar/Skeleton';
11
- import { Box } from '@atlaskit/primitives/compiled/box';
12
- var styles = {
13
- showBorder: "_1e0c1txw _4cvr1h6o _1bah1h6o _bfhkvuon"
14
- };
15
-
16
- // The fixed partition/resource-owner/resource-type segments of an identity user ARI — only the
17
- // account id itself varies. Matched by prefix rather than via `@atlassian/ari` (an internal
18
- // package this public package can't depend on).
19
- var IDENTITY_USER_ARI_PREFIX = 'ari:cloud:identity::user/';
20
-
21
- /**
22
- * Parses the account id needed for the picture fetch from whatever identity a caller carries —
23
- * either the bare account id, or the full identity ARI (callers that already have one on hand
24
- * don't need to strip it first).
25
- */
26
- var parseIdentityAccountId = function parseIdentityAccountId(value) {
27
- var trimmed = value === null || value === void 0 ? void 0 : value.trim();
28
- if (!trimmed) {
29
- return undefined;
30
- }
31
- return trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : trimmed;
32
- };
33
- var FetchedAgentAvatar = function FetchedAgentAvatar(_ref) {
34
- var _data$user, _data$user2;
35
- var accountId = _ref.accountId,
36
- agentName = _ref.agentName,
37
- fallback = _ref.fallback,
38
- showBorder = _ref.showBorder,
39
- size = _ref.size,
40
- UNSAFE_isUpdatedGeometry = _ref.UNSAFE_isUpdatedGeometry;
41
- var data = useLazyLoadQuery(_ResolvedAgentAvatarQuery, {
42
- accountId: accountId
43
- }, {
44
- fetchPolicy: 'store-or-network'
45
- });
46
- var picture = (_data$user = data.user) === null || _data$user === void 0 || (_data$user = _data$user.picture) === null || _data$user === void 0 ? void 0 : _data$user.trim();
47
- if (!picture) {
48
- return fallback;
49
- }
50
- var name = ((_data$user2 = data.user) === null || _data$user2 === void 0 || (_data$user2 = _data$user2.name) === null || _data$user2 === void 0 ? void 0 : _data$user2.trim()) || agentName;
51
- if (!showBorder) {
52
- return /*#__PURE__*/React.createElement(Avatar, {
53
- appearance: "hexagon",
54
- src: picture,
55
- name: name,
56
- label: name,
57
- size: size,
58
- borderColor: "transparent",
59
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
60
- });
61
- }
62
- return /*#__PURE__*/React.createElement(Box, {
63
- testId: "resolved-agent-avatar-border",
64
- xcss: styles.showBorder,
65
- style: {
66
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
67
- height: AVATAR_SIZES[size],
68
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
69
- width: AVATAR_SIZES[size]
70
- }
71
- }, /*#__PURE__*/React.createElement(Avatar, {
72
- appearance: "hexagon",
73
- src: picture,
74
- name: name,
75
- label: name,
76
- size: size,
77
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
78
- }));
79
- };
80
-
81
- /**
82
- * The best avatar available for an agent identity: the real account picture when one can be
83
- * fetched, otherwise `fallback`. Works for any identity with an `agentIdentityAccountId` —
84
- * including the default Rovo agent, now that Rovo is provisioned its own identity account. A
85
- * `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a failed or unavailable
86
- * fetch from ever breaking the caller — it just renders `fallback`.
87
- */
88
- export var ResolvedAgentAvatar = function ResolvedAgentAvatar(_ref2) {
89
- var agentIdentityAccountId = _ref2.agentIdentityAccountId,
90
- agentName = _ref2.agentName,
91
- fallback = _ref2.fallback,
92
- _ref2$showBorder = _ref2.showBorder,
93
- showBorder = _ref2$showBorder === void 0 ? false : _ref2$showBorder,
94
- _ref2$size = _ref2.size,
95
- size = _ref2$size === void 0 ? 'medium' : _ref2$size,
96
- UNSAFE_isUpdatedGeometry = _ref2.UNSAFE_isUpdatedGeometry;
97
- var resolvedFallback = fallback !== null && fallback !== void 0 ? fallback : /*#__PURE__*/React.createElement(Avatar, {
98
- appearance: "hexagon",
99
- name: agentName,
100
- size: size,
101
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry
102
- });
103
- var accountId = parseIdentityAccountId(agentIdentityAccountId);
104
- if (!accountId) {
105
- return resolvedFallback;
106
- }
107
- return /*#__PURE__*/React.createElement(ErrorBoundary, {
108
- fallback: resolvedFallback
109
- }, /*#__PURE__*/React.createElement(Suspense, {
110
- fallback: /*#__PURE__*/React.createElement(AvatarSkeleton, {
111
- appearance: "hexagon",
112
- size: size
113
- })
114
- }, /*#__PURE__*/React.createElement(FetchedAgentAvatar, {
115
- accountId: accountId,
116
- agentName: agentName,
117
- fallback: resolvedFallback,
118
- showBorder: showBorder,
119
- UNSAFE_isUpdatedGeometry: UNSAFE_isUpdatedGeometry,
120
- size: size
121
- })));
122
- };
@@ -1,77 +0,0 @@
1
- /**
2
- * @generated SignedSource<<765322731b31afdb0584c134ed53e12a>>
3
- * @relayHash 07c2f9612a7a8401a21c6ad1a0936b2d
4
- * @lightSyntaxTransform
5
- * @nogrep
6
- * @codegen-command: yarn relay
7
- */
8
-
9
- /* tslint:disable */
10
- /* eslint-disable */
11
- // @ts-nocheck
12
-
13
- // @relayRequestID aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5
14
-
15
- var node = function () {
16
- var v0 = [{
17
- "defaultValue": null,
18
- "kind": "LocalArgument",
19
- "name": "accountId"
20
- }],
21
- v1 = [{
22
- "kind": "Variable",
23
- "name": "accountId",
24
- "variableName": "accountId"
25
- }],
26
- v2 = {
27
- "kind": "ScalarField",
28
- "name": "name"
29
- },
30
- v3 = {
31
- "kind": "ScalarField",
32
- "name": "picture"
33
- };
34
- return {
35
- "fragment": {
36
- "argumentDefinitions": v0 /*: any*/,
37
- "kind": "Fragment",
38
- "name": "ResolvedAgentAvatarQuery",
39
- "selections": [{
40
- "args": v1 /*: any*/,
41
- "kind": "LinkedField",
42
- "name": "user",
43
- "plural": false,
44
- "selections": [v2 /*: any*/, v3 /*: any*/]
45
- }],
46
- "type": "Query"
47
- },
48
- "kind": "Request",
49
- "operation": {
50
- "argumentDefinitions": v0 /*: any*/,
51
- "kind": "Operation",
52
- "name": "ResolvedAgentAvatarQuery",
53
- "selections": [{
54
- "args": v1 /*: any*/,
55
- "kind": "LinkedField",
56
- "name": "user",
57
- "plural": false,
58
- "selections": [{
59
- "kind": "ScalarField",
60
- "name": "__typename"
61
- }, v2 /*: any*/, v3 /*: any*/, {
62
- "kind": "ScalarField",
63
- "name": "id"
64
- }]
65
- }]
66
- },
67
- "params": {
68
- "id": "aa69c7a83a201b1f2a5cdca116d15f149410a79d7ce49e3fafb7ce1e4a4e38d5",
69
- "metadata": {},
70
- "name": "ResolvedAgentAvatarQuery",
71
- "operationKind": "query",
72
- "text": null
73
- }
74
- };
75
- }();
76
- node.hash = "a2c97e7ac7feca789629a3b50c6150aa";
77
- export default node;
@@ -1,25 +0,0 @@
1
- import React from 'react';
2
- import type { SizeType } from '@atlaskit/avatar/types';
3
- /**
4
- * The best avatar available for an agent identity: the real account picture when one can be
5
- * fetched, otherwise `fallback`. Works for any identity with an `agentIdentityAccountId` —
6
- * including the default Rovo agent, now that Rovo is provisioned its own identity account. A
7
- * `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a failed or unavailable
8
- * fetch from ever breaking the caller — it just renders `fallback`.
9
- */
10
- export declare const ResolvedAgentAvatar: ({ agentIdentityAccountId, agentName, fallback, showBorder, size, UNSAFE_isUpdatedGeometry, }: {
11
- /** Either the bare account id or the full identity ARI — whichever the caller already has. */
12
- agentIdentityAccountId?: string | null;
13
- agentName?: string;
14
- /**
15
- * Rendered when there's no account id, no picture on file, or the fetch fails. Defaults to a
16
- * generic hexagon `Avatar` (renders its own agent icon with no `src`) — pass an explicit
17
- * `fallback` only when the caller has something more specific to show (e.g. its own
18
- * already-known picture, or an `agentNamedId` for a generated illustration).
19
- */
20
- fallback?: React.JSX.Element;
21
- /** Border/background treatment for the fetched picture, matching `AgentAvatar`'s own prop. */
22
- showBorder?: boolean;
23
- size?: SizeType;
24
- UNSAFE_isUpdatedGeometry?: boolean;
25
- }) => React.JSX.Element;
@@ -1,23 +0,0 @@
1
- /**
2
- * @generated SignedSource<<765322731b31afdb0584c134ed53e12a>>
3
- * @relayHash 07c2f9612a7a8401a21c6ad1a0936b2d
4
- * @lightSyntaxTransform
5
- * @nogrep
6
- * @codegen-command: yarn relay
7
- */
8
- import type { ConcreteRequest } from 'relay-runtime';
9
- export type ResolvedAgentAvatarQuery$variables = {
10
- accountId: string;
11
- };
12
- export type ResolvedAgentAvatarQuery$data = {
13
- readonly user: {
14
- readonly name: string;
15
- readonly picture: AGG$URL;
16
- } | null;
17
- };
18
- export type ResolvedAgentAvatarQuery = {
19
- response: ResolvedAgentAvatarQuery$data;
20
- variables: ResolvedAgentAvatarQuery$variables;
21
- };
22
- declare const node: ConcreteRequest;
23
- export default node;
@@ -1,10 +0,0 @@
1
- {
2
- "name": "@atlaskit/rovo-agent-components/ui/agent-avatar/ResolvedAgentAvatar",
3
- "main": "../../../dist/cjs/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js",
4
- "module": "../../../dist/esm/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js",
5
- "module:es2019": "../../../dist/es2019/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js",
6
- "sideEffects": [
7
- "*.compiled.css"
8
- ],
9
- "types": "../../../dist/types/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.d.ts"
10
- }