@atlaskit/rovo-agent-components 8.12.3 → 8.13.1

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/common/ui/chat-pill/index.js +1 -1
  3. package/dist/cjs/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.compiled.css +4 -0
  4. package/dist/cjs/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js +53 -16
  5. package/dist/cjs/ui/agent-conversation-starters/ConversationStarters.js +1 -1
  6. package/dist/cjs/ui/agent-profile-info/index.js +1 -1
  7. package/dist/cjs/ui/agent-verified/agent-verified.stories.js +1 -1
  8. package/dist/es2019/common/ui/chat-pill/index.js +1 -1
  9. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/amplitude-agent.js +1 -0
  10. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/auto-dev.js +1 -0
  11. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/auto-fix.js +1 -0
  12. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/auto-review.js +1 -0
  13. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/backlog-buddy.js +1 -0
  14. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/box-agent.js +1 -0
  15. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/canva-agent.js +1 -0
  16. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/comms-crafter.js +1 -0
  17. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/culture.js +1 -0
  18. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/customer-insight.js +1 -0
  19. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/decision-director.js +1 -0
  20. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/document-writer.js +1 -0
  21. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/feature-flag-avatar.js +1 -0
  22. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/figma-agent.js +1 -0
  23. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/gamma-agent.js +1 -0
  24. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/generic-avatar.js +1 -0
  25. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/hire-writer.js +1 -0
  26. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/hubspot-agent.js +1 -0
  27. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/intercom-agent.js +1 -0
  28. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/jira-coding-agent.js +1 -0
  29. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/jira-task-planner-agent.js +1 -0
  30. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/jira-work-agent.js +1 -0
  31. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/lovable-agent.js +1 -0
  32. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/marketing-message-maestro.js +1 -0
  33. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/my-user-manual.js +1 -0
  34. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/okr-oracle.js +1 -0
  35. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/ops-agent.js +1 -0
  36. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/pitch-perfector.js +1 -0
  37. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/product-requirement.js +1 -0
  38. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/release-notes.js +1 -0
  39. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/replit-agent.js +1 -0
  40. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/research-scout.js +1 -0
  41. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/rovo-agent.js +1 -0
  42. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/social-media-scribe.js +1 -0
  43. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/team-connection.js +1 -0
  44. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/trial-guide.js +1 -0
  45. package/dist/es2019/ui/agent-avatar/generated-avatars/assets/workflow-builder.js +1 -0
  46. package/dist/es2019/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.compiled.css +4 -0
  47. package/dist/es2019/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js +54 -16
  48. package/dist/es2019/ui/agent-conversation-starters/ConversationStarters.js +1 -1
  49. package/dist/es2019/ui/agent-dropdown-menu/index.js +1 -0
  50. package/dist/es2019/ui/agent-profile-info/index.js +1 -1
  51. package/dist/es2019/ui/agent-verified/agent-verified.stories.js +1 -1
  52. package/dist/es2019/ui/agent-verified/index.js +1 -0
  53. package/dist/esm/common/ui/chat-pill/index.js +1 -1
  54. package/dist/esm/ui/agent-avatar/generated-avatars/assets/amplitude-agent.js +1 -0
  55. package/dist/esm/ui/agent-avatar/generated-avatars/assets/auto-dev.js +1 -0
  56. package/dist/esm/ui/agent-avatar/generated-avatars/assets/auto-fix.js +1 -0
  57. package/dist/esm/ui/agent-avatar/generated-avatars/assets/auto-review.js +1 -0
  58. package/dist/esm/ui/agent-avatar/generated-avatars/assets/backlog-buddy.js +1 -0
  59. package/dist/esm/ui/agent-avatar/generated-avatars/assets/box-agent.js +1 -0
  60. package/dist/esm/ui/agent-avatar/generated-avatars/assets/canva-agent.js +1 -0
  61. package/dist/esm/ui/agent-avatar/generated-avatars/assets/comms-crafter.js +1 -0
  62. package/dist/esm/ui/agent-avatar/generated-avatars/assets/culture.js +1 -0
  63. package/dist/esm/ui/agent-avatar/generated-avatars/assets/customer-insight.js +1 -0
  64. package/dist/esm/ui/agent-avatar/generated-avatars/assets/decision-director.js +1 -0
  65. package/dist/esm/ui/agent-avatar/generated-avatars/assets/document-writer.js +1 -0
  66. package/dist/esm/ui/agent-avatar/generated-avatars/assets/feature-flag-avatar.js +1 -0
  67. package/dist/esm/ui/agent-avatar/generated-avatars/assets/figma-agent.js +1 -0
  68. package/dist/esm/ui/agent-avatar/generated-avatars/assets/gamma-agent.js +1 -0
  69. package/dist/esm/ui/agent-avatar/generated-avatars/assets/generic-avatar.js +1 -0
  70. package/dist/esm/ui/agent-avatar/generated-avatars/assets/hire-writer.js +1 -0
  71. package/dist/esm/ui/agent-avatar/generated-avatars/assets/hubspot-agent.js +1 -0
  72. package/dist/esm/ui/agent-avatar/generated-avatars/assets/intercom-agent.js +1 -0
  73. package/dist/esm/ui/agent-avatar/generated-avatars/assets/jira-coding-agent.js +1 -0
  74. package/dist/esm/ui/agent-avatar/generated-avatars/assets/jira-task-planner-agent.js +1 -0
  75. package/dist/esm/ui/agent-avatar/generated-avatars/assets/jira-work-agent.js +1 -0
  76. package/dist/esm/ui/agent-avatar/generated-avatars/assets/lovable-agent.js +1 -0
  77. package/dist/esm/ui/agent-avatar/generated-avatars/assets/marketing-message-maestro.js +1 -0
  78. package/dist/esm/ui/agent-avatar/generated-avatars/assets/my-user-manual.js +1 -0
  79. package/dist/esm/ui/agent-avatar/generated-avatars/assets/okr-oracle.js +1 -0
  80. package/dist/esm/ui/agent-avatar/generated-avatars/assets/ops-agent.js +1 -0
  81. package/dist/esm/ui/agent-avatar/generated-avatars/assets/pitch-perfector.js +1 -0
  82. package/dist/esm/ui/agent-avatar/generated-avatars/assets/product-requirement.js +1 -0
  83. package/dist/esm/ui/agent-avatar/generated-avatars/assets/release-notes.js +1 -0
  84. package/dist/esm/ui/agent-avatar/generated-avatars/assets/replit-agent.js +1 -0
  85. package/dist/esm/ui/agent-avatar/generated-avatars/assets/research-scout.js +1 -0
  86. package/dist/esm/ui/agent-avatar/generated-avatars/assets/rovo-agent.js +1 -0
  87. package/dist/esm/ui/agent-avatar/generated-avatars/assets/social-media-scribe.js +1 -0
  88. package/dist/esm/ui/agent-avatar/generated-avatars/assets/team-connection.js +1 -0
  89. package/dist/esm/ui/agent-avatar/generated-avatars/assets/trial-guide.js +1 -0
  90. package/dist/esm/ui/agent-avatar/generated-avatars/assets/workflow-builder.js +1 -0
  91. package/dist/esm/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.compiled.css +4 -0
  92. package/dist/esm/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.js +54 -16
  93. package/dist/esm/ui/agent-conversation-starters/ConversationStarters.js +1 -1
  94. package/dist/esm/ui/agent-dropdown-menu/index.js +1 -0
  95. package/dist/esm/ui/agent-profile-info/index.js +1 -1
  96. package/dist/esm/ui/agent-verified/agent-verified.stories.js +1 -1
  97. package/dist/esm/ui/agent-verified/index.js +1 -0
  98. package/dist/types/ui/agent-avatar/resolved-agent-avatar/ResolvedAgentAvatar.d.ts +12 -6
  99. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/rovo-agent-components
2
2
 
3
+ ## 8.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7ab7f5213c65b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ab7f5213c65b) -
8
+ Fixed `ResolvedAgentAvatar` drawing a white hexagon border around the fetched picture when
9
+ `showBorder` is false. `Avatar`'s hexagon appearance always paints a border ring from
10
+ `borderColor`, which defaults to `elevation.surface`, so the picture now passes
11
+ `borderColor="transparent"` in that case to match the borderless look callers expect.
12
+
13
+ ## 8.13.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [`241e671db5235`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/241e671db5235) -
18
+ `ResolvedAgentAvatar` now accepts either a bare account id or a full identity ARI for
19
+ `agentIdentityAccountId`, so callers that already have the bare id don't need to wrap it first.
20
+ `fallback` is now optional, defaulting to a generic hexagon `Avatar` built from `agentName` when a
21
+ caller has nothing more specific to show. The fetched picture now renders through `Avatar`
22
+ directly instead of the deprecated `AgentAvatar`.
23
+
3
24
  ## 8.12.3
4
25
 
5
26
  ### Patch Changes
@@ -16,8 +16,8 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
16
16
  var _reactIntl = require("react-intl");
17
17
  var _css = require("@atlaskit/css");
18
18
  var _aiAgent = _interopRequireDefault(require("@atlaskit/icon/core/ai-agent"));
19
- var _compiled = require("@atlaskit/primitives/compiled");
20
19
  var _fg = require("@atlaskit/platform-feature-flags/fg");
20
+ var _compiled = require("@atlaskit/primitives/compiled");
21
21
  var _chatIcon = require("../chat-icon");
22
22
  var _messages = _interopRequireDefault(require("./messages"));
23
23
  var _excluded = ["children", "whiteSpacePreWrap", "renderIcon"];
@@ -0,0 +1,4 @@
1
+ ._1bah1h6o{justify-content:center}
2
+ ._1e0c1txw{display:flex}
3
+ ._4cvr1h6o{align-items:center}
4
+ ._bfhkvuon{background-color:var(--ds-surface,#fff)}
@@ -1,3 +1,4 @@
1
+ /* ResolvedAgentAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -6,25 +7,37 @@ Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.ResolvedAgentAvatar = void 0;
10
+ require("./ResolvedAgentAvatar.compiled.css");
11
+ var _runtime = require("@compiled/react/runtime");
9
12
  var _ResolvedAgentAvatarQuery2 = _interopRequireDefault(require("./__generated__/ResolvedAgentAvatarQuery.graphql"));
10
13
  var _react = _interopRequireWildcard(require("react"));
11
14
  var _reactErrorBoundary = require("react-error-boundary");
12
15
  var _reactRelay = require("react-relay");
16
+ var _avatar = _interopRequireDefault(require("@atlaskit/avatar/avatar"));
17
+ var _avatarSizes = require("@atlaskit/avatar/avatar-sizes");
13
18
  var _Skeleton = _interopRequireDefault(require("@atlaskit/avatar/Skeleton"));
14
- var _index = require("../index");
19
+ var _box = require("@atlaskit/primitives/compiled/box");
15
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); }
16
- // A relative import, not the package's own public subpath: a package can't resolve its own
17
- // name from within itself when building its published type declarations in isolation.
21
+ var styles = {
22
+ showBorder: "_1e0c1txw _4cvr1h6o _1bah1h6o _bfhkvuon"
23
+ };
18
24
 
19
25
  // The fixed partition/resource-owner/resource-type segments of an identity user ARI — only the
20
26
  // account id itself varies. Matched by prefix rather than via `@atlassian/ari` (an internal
21
27
  // package this public package can't depend on).
22
28
  var IDENTITY_USER_ARI_PREFIX = 'ari:cloud:identity::user/';
23
29
 
24
- /** Parses the account id needed for the picture fetch from the identity ARI a caller carries. */
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
+ */
25
35
  var parseIdentityAccountId = function parseIdentityAccountId(value) {
26
36
  var trimmed = value === null || value === void 0 ? void 0 : value.trim();
27
- return trimmed !== null && trimmed !== void 0 && trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : undefined;
37
+ if (!trimmed) {
38
+ return undefined;
39
+ }
40
+ return trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : trimmed;
28
41
  };
29
42
  var FetchedAgentAvatar = function FetchedAgentAvatar(_ref) {
30
43
  var _data$user, _data$user2;
@@ -43,21 +56,40 @@ var FetchedAgentAvatar = function FetchedAgentAvatar(_ref) {
43
56
  return fallback;
44
57
  }
45
58
  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;
46
- return /*#__PURE__*/_react.default.createElement(_index.AgentAvatar, {
47
- imageUrl: picture,
59
+ if (!showBorder) {
60
+ return /*#__PURE__*/_react.default.createElement(_avatar.default, {
61
+ appearance: "hexagon",
62
+ src: picture,
63
+ name: name,
64
+ label: name,
65
+ size: size,
66
+ borderColor: "transparent"
67
+ });
68
+ }
69
+ return /*#__PURE__*/_react.default.createElement(_box.Box, {
70
+ testId: "resolved-agent-avatar-border",
71
+ xcss: styles.showBorder,
72
+ style: {
73
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
74
+ height: _avatarSizes.AVATAR_SIZES[size],
75
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
76
+ width: _avatarSizes.AVATAR_SIZES[size]
77
+ }
78
+ }, /*#__PURE__*/_react.default.createElement(_avatar.default, {
79
+ appearance: "hexagon",
80
+ src: picture,
48
81
  name: name,
49
82
  label: name,
50
- showBorder: showBorder,
51
83
  size: size
52
- });
84
+ }));
53
85
  };
54
86
 
55
87
  /**
56
88
  * The best avatar available for an agent identity: the real account picture when one can be
57
- * fetched, otherwise the caller-supplied `fallback`. Works for any identity with an
58
- * `agentIdentityAccountId` — including the default Rovo agent, now that Rovo is provisioned its
59
- * own identity account. A `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a
60
- * failed or unavailable fetch from ever breaking the caller — it just renders `fallback`.
89
+ * fetched, otherwise `fallback`. Works for any identity with an `agentIdentityAccountId` —
90
+ * including the default Rovo agent, now that Rovo is provisioned its own identity account. A
91
+ * `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a failed or unavailable
92
+ * fetch from ever breaking the caller — it just renders `fallback`.
61
93
  */
62
94
  var ResolvedAgentAvatar = exports.ResolvedAgentAvatar = function ResolvedAgentAvatar(_ref2) {
63
95
  var agentIdentityAccountId = _ref2.agentIdentityAccountId,
@@ -67,12 +99,17 @@ var ResolvedAgentAvatar = exports.ResolvedAgentAvatar = function ResolvedAgentAv
67
99
  showBorder = _ref2$showBorder === void 0 ? false : _ref2$showBorder,
68
100
  _ref2$size = _ref2.size,
69
101
  size = _ref2$size === void 0 ? 'medium' : _ref2$size;
102
+ var resolvedFallback = fallback !== null && fallback !== void 0 ? fallback : /*#__PURE__*/_react.default.createElement(_avatar.default, {
103
+ appearance: "hexagon",
104
+ name: agentName,
105
+ size: size
106
+ });
70
107
  var accountId = parseIdentityAccountId(agentIdentityAccountId);
71
108
  if (!accountId) {
72
- return fallback;
109
+ return resolvedFallback;
73
110
  }
74
111
  return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, {
75
- fallback: fallback
112
+ fallback: resolvedFallback
76
113
  }, /*#__PURE__*/_react.default.createElement(_react.Suspense, {
77
114
  fallback: /*#__PURE__*/_react.default.createElement(_Skeleton.default, {
78
115
  appearance: "hexagon",
@@ -81,7 +118,7 @@ var ResolvedAgentAvatar = exports.ResolvedAgentAvatar = function ResolvedAgentAv
81
118
  }, /*#__PURE__*/_react.default.createElement(FetchedAgentAvatar, {
82
119
  accountId: accountId,
83
120
  agentName: agentName,
84
- fallback: fallback,
121
+ fallback: resolvedFallback,
85
122
  showBorder: showBorder,
86
123
  size: size
87
124
  })));
@@ -12,8 +12,8 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
13
13
  var _css = require("@atlaskit/css");
14
14
  var _retry = _interopRequireDefault(require("@atlaskit/icon/core/retry"));
15
- var _compiled = require("@atlaskit/primitives/compiled");
16
15
  var _fg = require("@atlaskit/platform-feature-flags/fg");
16
+ var _compiled = require("@atlaskit/primitives/compiled");
17
17
  var _agentChatIcon = require("../../common/ui/agent-chat-icon");
18
18
  var _chatPill = require("../../common/ui/chat-pill");
19
19
  var styles = {
@@ -13,8 +13,8 @@ var _reactIntl = require("react-intl");
13
13
  var _featureGates = _interopRequireDefault(require("@atlaskit/feature-gate-js-client/feature-gates"));
14
14
  var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
15
15
  var _link = _interopRequireDefault(require("@atlaskit/link/link"));
16
- var _atlassianIcon = require("@atlaskit/logo/atlassian-icon");
17
16
  var _logo = require("@atlaskit/logo");
17
+ var _atlassianIcon = require("@atlaskit/logo/atlassian-icon");
18
18
  var _fg = require("@atlaskit/platform-feature-flags/fg");
19
19
  var _compiled = require("@atlaskit/primitives/compiled");
20
20
  var _skeleton = _interopRequireDefault(require("@atlaskit/skeleton"));
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.TextLarge = exports.HeadingMedium = exports.HeadingLarge = exports.Default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _storybookDecorators = require("@atlassian/agent-studio-test-utils/storybook-decorators");
10
9
  var _reactMagneticDi = require("react-magnetic-di");
11
10
  var _reactRelay = require("react-relay");
11
+ var _storybookDecorators = require("@atlassian/agent-studio-test-utils/storybook-decorators");
12
12
  var _agentVerified = require("./agent-verified");
13
13
  var commonDeps = [(0, _reactMagneticDi.injectable)(_reactRelay.useFragment, function () {
14
14
  return {
@@ -7,8 +7,8 @@ import { forwardRef } from 'react';
7
7
  import { useIntl } from 'react-intl';
8
8
  import { cx } from '@atlaskit/css';
9
9
  import AgentIcon from '@atlaskit/icon/core/ai-agent';
10
- import { Box, Inline, Pressable } from '@atlaskit/primitives/compiled';
11
10
  import { fg } from '@atlaskit/platform-feature-flags/fg';
11
+ import { Box, Inline, Pressable } from '@atlaskit/primitives/compiled';
12
12
  import { ChatPillIcon } from '../chat-icon';
13
13
  import messages from './messages';
14
14
  const stylesCompiled = {
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
2
+
2
3
  import React from 'react';
3
4
  export default (({
4
5
  size,
@@ -0,0 +1,4 @@
1
+ ._1bah1h6o{justify-content:center}
2
+ ._1e0c1txw{display:flex}
3
+ ._4cvr1h6o{align-items:center}
4
+ ._bfhkvuon{background-color:var(--ds-surface,#fff)}
@@ -1,20 +1,34 @@
1
+ /* ResolvedAgentAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
2
+ import "./ResolvedAgentAvatar.compiled.css";
3
+ import { ax, ix } from "@compiled/react/runtime";
1
4
  import _ResolvedAgentAvatarQuery from "./__generated__/ResolvedAgentAvatarQuery.graphql";
2
5
  import React, { Suspense } from 'react';
3
6
  import { ErrorBoundary } from 'react-error-boundary';
4
7
  import { graphql, useLazyLoadQuery } from 'react-relay';
8
+ import Avatar from '@atlaskit/avatar/avatar';
9
+ import { AVATAR_SIZES } from '@atlaskit/avatar/avatar-sizes';
5
10
  import AvatarSkeleton from '@atlaskit/avatar/Skeleton';
6
- // A relative import, not the package's own public subpath: a package can't resolve its own
7
- // name from within itself when building its published type declarations in isolation.
8
- import { AgentAvatar } from '../index';
11
+ import { Box } from '@atlaskit/primitives/compiled/box';
12
+ const styles = {
13
+ showBorder: "_1e0c1txw _4cvr1h6o _1bah1h6o _bfhkvuon"
14
+ };
15
+
9
16
  // The fixed partition/resource-owner/resource-type segments of an identity user ARI — only the
10
17
  // account id itself varies. Matched by prefix rather than via `@atlassian/ari` (an internal
11
18
  // package this public package can't depend on).
12
19
  const IDENTITY_USER_ARI_PREFIX = 'ari:cloud:identity::user/';
13
20
 
14
- /** Parses the account id needed for the picture fetch from the identity ARI a caller carries. */
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
+ */
15
26
  const parseIdentityAccountId = value => {
16
27
  const trimmed = value === null || value === void 0 ? void 0 : value.trim();
17
- return trimmed !== null && trimmed !== void 0 && trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : undefined;
28
+ if (!trimmed) {
29
+ return undefined;
30
+ }
31
+ return trimmed.startsWith(IDENTITY_USER_ARI_PREFIX) ? trimmed.slice(IDENTITY_USER_ARI_PREFIX.length) : trimmed;
18
32
  };
19
33
  const FetchedAgentAvatar = ({
20
34
  accountId,
@@ -34,21 +48,40 @@ const FetchedAgentAvatar = ({
34
48
  return fallback;
35
49
  }
36
50
  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;
37
- return /*#__PURE__*/React.createElement(AgentAvatar, {
38
- imageUrl: picture,
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
+ });
60
+ }
61
+ return /*#__PURE__*/React.createElement(Box, {
62
+ testId: "resolved-agent-avatar-border",
63
+ xcss: styles.showBorder,
64
+ style: {
65
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
66
+ height: AVATAR_SIZES[size],
67
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
68
+ width: AVATAR_SIZES[size]
69
+ }
70
+ }, /*#__PURE__*/React.createElement(Avatar, {
71
+ appearance: "hexagon",
72
+ src: picture,
39
73
  name: name,
40
74
  label: name,
41
- showBorder: showBorder,
42
75
  size: size
43
- });
76
+ }));
44
77
  };
45
78
 
46
79
  /**
47
80
  * The best avatar available for an agent identity: the real account picture when one can be
48
- * fetched, otherwise the caller-supplied `fallback`. Works for any identity with an
49
- * `agentIdentityAccountId` — including the default Rovo agent, now that Rovo is provisioned its
50
- * own identity account. A `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a
51
- * failed or unavailable fetch from ever breaking the caller — it just renders `fallback`.
81
+ * fetched, otherwise `fallback`. Works for any identity with an `agentIdentityAccountId` —
82
+ * including the default Rovo agent, now that Rovo is provisioned its own identity account. A
83
+ * `Suspense` skeleton bridges the fetch, and an `ErrorBoundary` keeps a failed or unavailable
84
+ * fetch from ever breaking the caller — it just renders `fallback`.
52
85
  */
53
86
  export const ResolvedAgentAvatar = ({
54
87
  agentIdentityAccountId,
@@ -57,12 +90,17 @@ export const ResolvedAgentAvatar = ({
57
90
  showBorder = false,
58
91
  size = 'medium'
59
92
  }) => {
93
+ const resolvedFallback = fallback !== null && fallback !== void 0 ? fallback : /*#__PURE__*/React.createElement(Avatar, {
94
+ appearance: "hexagon",
95
+ name: agentName,
96
+ size: size
97
+ });
60
98
  const accountId = parseIdentityAccountId(agentIdentityAccountId);
61
99
  if (!accountId) {
62
- return fallback;
100
+ return resolvedFallback;
63
101
  }
64
102
  return /*#__PURE__*/React.createElement(ErrorBoundary, {
65
- fallback: fallback
103
+ fallback: resolvedFallback
66
104
  }, /*#__PURE__*/React.createElement(Suspense, {
67
105
  fallback: /*#__PURE__*/React.createElement(AvatarSkeleton, {
68
106
  appearance: "hexagon",
@@ -71,7 +109,7 @@ export const ResolvedAgentAvatar = ({
71
109
  }, /*#__PURE__*/React.createElement(FetchedAgentAvatar, {
72
110
  accountId: accountId,
73
111
  agentName: agentName,
74
- fallback: fallback,
112
+ fallback: resolvedFallback,
75
113
  showBorder: showBorder,
76
114
  size: size
77
115
  })));
@@ -5,8 +5,8 @@ import React from 'react';
5
5
  import IconButton from '@atlaskit/button/icon/button';
6
6
  import { cx } from '@atlaskit/css';
7
7
  import RetryIcon from '@atlaskit/icon/core/retry';
8
- import { Box, Inline, Pressable, Stack } from '@atlaskit/primitives/compiled';
9
8
  import { fg } from '@atlaskit/platform-feature-flags/fg';
9
+ import { Box, Inline, Pressable, Stack } from '@atlaskit/primitives/compiled';
10
10
  import { AgentChatIcon } from '../../common/ui/agent-chat-icon';
11
11
  import { BrowseAgentsPill } from '../../common/ui/chat-pill';
12
12
  const styles = {
@@ -8,6 +8,7 @@
8
8
  /**
9
9
  * @deprecated Use `import { ChatToAgentButton } from '@atlaskit/rovo-agent-components/ui/AgentDropdownMenu'` instead.
10
10
  */
11
+
11
12
  export { ChatToAgentButton } from './ChatToAgentButton';
12
13
  /**
13
14
  * @deprecated Use `import { AgentDropdownMenu } from '@atlaskit/rovo-agent-components'` instead.