@atlaskit/rovo-agent-components 0.2.0 → 0.3.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 +8 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/ui/agent-avatar/generated-avatars/assets/generic-avatar.js +33 -0
- package/dist/cjs/ui/agent-avatar/generated-avatars/assets/product-requirement.js +59 -0
- package/dist/cjs/ui/agent-avatar/generated-avatars/index.js +119 -39
- package/dist/cjs/ui/agent-avatar/index.js +10 -5
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/agent-avatar/generated-avatars/assets/generic-avatar.js +24 -0
- package/dist/es2019/ui/agent-avatar/generated-avatars/assets/product-requirement.js +50 -0
- package/dist/es2019/ui/agent-avatar/generated-avatars/index.js +113 -36
- package/dist/es2019/ui/agent-avatar/index.js +5 -2
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/agent-avatar/generated-avatars/assets/generic-avatar.js +25 -0
- package/dist/esm/ui/agent-avatar/generated-avatars/assets/product-requirement.js +51 -0
- package/dist/esm/ui/agent-avatar/generated-avatars/index.js +118 -38
- package/dist/esm/ui/agent-avatar/index.js +10 -5
- package/dist/types/index.d.ts +1 -0
- package/dist/types/ui/agent-avatar/generated-avatars/assets/generic-avatar.d.ts +3 -0
- package/dist/types/ui/agent-avatar/generated-avatars/assets/product-requirement.d.ts +3 -0
- package/dist/types/ui/agent-avatar/generated-avatars/index.d.ts +5 -2
- package/dist/types/ui/agent-avatar/index.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/agent-avatar/generated-avatars/assets/generic-avatar.d.ts +3 -0
- package/dist/types-ts4.5/ui/agent-avatar/generated-avatars/assets/product-requirement.d.ts +3 -0
- package/dist/types-ts4.5/ui/agent-avatar/generated-avatars/index.d.ts +5 -2
- package/dist/types-ts4.5/ui/agent-avatar/index.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/rovo-agent-components
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#129108](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/129108)
|
|
8
|
+
[`62b35c6098cf0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/62b35c6098cf0) -
|
|
9
|
+
Use generated agent avatar in browse-agent, view-agent and agent-selector
|
|
10
|
+
|
|
3
11
|
## 0.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "AgentAvatar", {
|
|
|
9
9
|
return _agentAvatar.AgentAvatar;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
+
Object.defineProperty(exports, "AgentBanner", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _generatedAvatars.AgentBanner;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "AgentConversationStarters", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function get() {
|
|
@@ -62,4 +68,5 @@ var _starIconButton = require("./common/ui/star-icon-button");
|
|
|
62
68
|
var _agentConversationStarters = require("./ui/agent-conversation-starters");
|
|
63
69
|
var _chatPill = require("./common/ui/chat-pill");
|
|
64
70
|
var _chatIcon = require("./common/ui/chat-icon");
|
|
65
|
-
var _agentAvatar = require("./ui/agent-avatar");
|
|
71
|
+
var _agentAvatar = require("./ui/agent-avatar");
|
|
72
|
+
var _generatedAvatars = require("./ui/agent-avatar/generated-avatars");
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.GenericAvatar = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
/* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
|
|
10
|
+
|
|
11
|
+
var GenericAvatar = exports.GenericAvatar = function GenericAvatar(_ref) {
|
|
12
|
+
var size = _ref.size,
|
|
13
|
+
primaryColor = _ref.primaryColor,
|
|
14
|
+
secondaryColor = _ref.secondaryColor;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
16
|
+
width: size,
|
|
17
|
+
height: size,
|
|
18
|
+
viewBox: "0 0 42 48",
|
|
19
|
+
fill: "none",
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
22
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
23
|
+
fill: primaryColor
|
|
24
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
25
|
+
d: "M29.2653 16.6133C30.0565 16.9889 31.0505 16.3475 31.5218 17.1391C30.9191 16.8907 30.9991 20.086 31.9931 19.3291C32.1131 18.8321 32.4015 18.8928 31.8931 18.7224C32.7472 18.7166 31.9531 18.1677 31.9817 18.0897C32.4472 18.0781 31.8388 17.8123 32.2816 17.9048C32.5386 17.8528 31.7874 17.1941 32.2959 17.3703C32.4587 16.6538 33.2527 16.6595 33.0756 16.2233C33.0842 16.5209 35.7235 16.5902 34.9922 15.4519C34.5295 15.475 34.5895 14.9492 34.5209 15.6339C34.381 14.7846 34.0696 15.6339 33.9954 15.6137C33.9268 15.137 33.7897 15.7957 33.8097 15.3306C33.7412 15.0792 33.2956 15.8824 33.3841 15.3566C31.8446 14.9492 33.1071 14.5101 32.2187 13.626C32.1302 13.2158 32.3473 11.8839 31.3961 12.0081C30.145 12.3722 31.6046 14.6459 30.862 15.0417C30.5306 15.3421 30.0593 15.7206 29.4338 15.4635C29.1253 15.4577 28.7283 16.7318 29.2624 16.6162L29.2653 16.6133Z",
|
|
26
|
+
fill: secondaryColor
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
clipRule: "evenodd",
|
|
30
|
+
d: "M28.7902 28.7278L27.201 27.1386C24.0002 29.572 21.081 32.2138 18.4782 35.0894C14.793 32.0629 11.4735 28.5422 8.47053 24.5922L21.0314 12.0314C24.0681 17.5482 28.2305 21.4951 33.1965 24.3214L28.7902 28.7278ZM19.6147 24.8358L19.6147 28.5444L19.6151 28.5444L21.5003 28.5444L21.5003 24.8358H24.9944L20.5575 20.3988L16.1206 24.8358L19.6147 24.8358ZM27.2009 27.1393L28.79 28.7284L20.698 36.8205C19.9435 36.2635 19.2038 35.6863 18.478 35.0901C21.0806 32.2146 23.9998 29.5729 27.2009 27.1393Z",
|
|
31
|
+
fill: "#CCE0FF"
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ProductRequirementAvatar = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
/* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
|
|
10
|
+
|
|
11
|
+
var ProductRequirementAvatar = exports.ProductRequirementAvatar = function ProductRequirementAvatar(_ref) {
|
|
12
|
+
var size = _ref.size,
|
|
13
|
+
primaryColor = _ref.primaryColor,
|
|
14
|
+
secondaryColor = _ref.secondaryColor;
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
16
|
+
width: size,
|
|
17
|
+
height: size,
|
|
18
|
+
viewBox: "0 0 42 48",
|
|
19
|
+
fill: "none",
|
|
20
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
22
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
23
|
+
fill: primaryColor
|
|
24
|
+
}), /*#__PURE__*/_react.default.createElement("mask", {
|
|
25
|
+
id: "mask0_602_29348",
|
|
26
|
+
style: {
|
|
27
|
+
maskType: 'alpha'
|
|
28
|
+
},
|
|
29
|
+
maskUnits: "userSpaceOnUse",
|
|
30
|
+
x: "0",
|
|
31
|
+
y: "0",
|
|
32
|
+
width: "42",
|
|
33
|
+
height: "48"
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
35
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
36
|
+
fill: primaryColor
|
|
37
|
+
})), /*#__PURE__*/_react.default.createElement("g", {
|
|
38
|
+
mask: "url(#mask0_602_29348)"
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
40
|
+
d: "M37 35.9716C35.7885 34.4863 32.8225 32.1398 31.2873 30.7577C31.3918 30.2472 27.5902 29.0198 29.0053 28.9476C27.4596 26.6424 24.1646 24.5486 21.1412 22.3774C22.3892 20.263 23.8827 17.6742 24.196 16.0652C25.021 15.467 34.3682 -0.721128 30.739 2.39891L30.6137 2.20294C29.0158 4.0337 27.538 7.0042 26.5301 9.51055C25.8252 9.25269 23.867 14.9771 23.6947 13.3835C21.9976 15.1111 20.4676 17.8289 18.9585 20.7324C16.2483 18.2002 15.6426 17.3596 12.9376 16.3488C12.9376 16.3488 11.4024 14.6316 10.3058 14.4975C8.82801 13.2649 8.21714 11.79 6.0814 11.2536C4.50962 11.3568 4.79155 12.2335 6.02913 13.399C7.38681 14.0901 8.03439 15.4979 9.23019 16.4159C9.45473 16.1426 9.44943 16.3488 9.27711 16.452C10.2954 16.8078 10.3737 17.6794 11.5016 17.767C11.5016 17.767 11.2614 17.8908 11.2562 17.8908C13.1622 19.3606 15.4807 21.3718 17.7626 23.0479C16.1073 26.2865 14.4311 29.4994 12.5565 31.619H12.6556C12.6086 31.6499 12.5774 31.7995 12.4677 31.7789C12.2275 33.3982 11.7314 34.2388 11.4286 35.4816C11.4286 35.4816 9.77328 37.8075 9.76806 39.0916L7.51741 42.7222C6.47304 44.2074 6.89075 48.3022 9.17792 44.2796C9.71055 42.5107 11.1309 41.2885 11.9455 39.6279C11.6322 39.4784 11.8359 39.401 11.9769 39.5609C12.2275 38.3026 13.1413 37.9157 13.1048 36.6213C14.9846 34.4863 17.6425 28.5712 19.4702 25.1417C19.2926 25.2139 19.794 24.4506 19.7679 24.4454C19.7679 24.4454 19.7731 24.4352 19.7783 24.43C19.794 24.4403 19.8097 24.4506 19.8254 24.4609C19.8254 24.4403 19.8305 24.4197 19.8514 24.4094C19.8514 24.3991 20.5668 24.8013 20.3579 24.7703C21.6372 26.1628 24.598 28.4422 26.2534 29.2003C26.3317 29.025 26.666 29.2467 26.5824 29.2776C26.1229 29.1796 37.8459 39.2876 36.8015 36.0799L37 35.9767V35.9716Z",
|
|
41
|
+
fill: secondaryColor
|
|
42
|
+
})), /*#__PURE__*/_react.default.createElement("path", {
|
|
43
|
+
d: "M9.41632 37H29.3148V11H19.2549L9.41632 20.6911V37Z",
|
|
44
|
+
fill: "white"
|
|
45
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
46
|
+
d: "M19.259 11V20.6624H9.44501L19.259 11Z",
|
|
47
|
+
fill: "#101214"
|
|
48
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
49
|
+
fillRule: "evenodd",
|
|
50
|
+
clipRule: "evenodd",
|
|
51
|
+
d: "M35 21.313L23.133 33.7411L16.9966 27.1391L19.6412 24.4436L23.1684 28.2389L32.3908 18.5804L35 21.313Z",
|
|
52
|
+
fill: "white"
|
|
53
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
54
|
+
fillRule: "evenodd",
|
|
55
|
+
clipRule: "evenodd",
|
|
56
|
+
d: "M29.3147 21.8019L23.1684 28.2389L19.6412 24.4436L16.9966 27.1391L23.133 33.7411L29.3147 27.2671V21.8019Z",
|
|
57
|
+
fill: "#101214"
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
@@ -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.TOTAL_AVATAR_COMBINATIONS = exports.GeneratedAvatar = void 0;
|
|
7
|
+
exports.TOTAL_AVATAR_COMBINATIONS = exports.GeneratedAvatar = exports.AgentBanner = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _avatar = require("@atlaskit/avatar");
|
|
10
10
|
var _primitives = require("@atlaskit/primitives");
|
|
@@ -17,31 +17,36 @@ var _culture = require("./assets/culture");
|
|
|
17
17
|
var _customerInsight = require("./assets/customer-insight");
|
|
18
18
|
var _decisionDirector = require("./assets/decision-director");
|
|
19
19
|
var _featureFlagAvatar = require("./assets/feature-flag-avatar");
|
|
20
|
+
var _genericAvatar = require("./assets/generic-avatar");
|
|
20
21
|
var _hireWriter = require("./assets/hire-writer");
|
|
21
22
|
var _marketingMessageMaestro = require("./assets/marketing-message-maestro");
|
|
22
23
|
var _myUserManual = require("./assets/my-user-manual");
|
|
23
24
|
var _okrOracle = require("./assets/okr-oracle");
|
|
24
25
|
var _opsAgent = require("./assets/ops-agent");
|
|
25
26
|
var _pitchPerfector = require("./assets/pitch-perfector");
|
|
27
|
+
var _productRequirement = require("./assets/product-requirement");
|
|
26
28
|
var _releaseNotes = require("./assets/release-notes");
|
|
27
29
|
var _researchScout = require("./assets/research-scout");
|
|
28
30
|
var _socialMediaScribe = require("./assets/social-media-scribe");
|
|
29
31
|
var _teamConnection = require("./assets/team-connection");
|
|
30
|
-
var
|
|
31
|
-
primary: '#357DE8',
|
|
32
|
-
secondary: '#669DF1'
|
|
33
|
-
};
|
|
34
|
-
var colorList = [{
|
|
32
|
+
var yellowColor = {
|
|
35
33
|
primary: '#FCA700',
|
|
36
34
|
secondary: '#FFC716'
|
|
37
|
-
}
|
|
35
|
+
};
|
|
36
|
+
var purpleColor = {
|
|
38
37
|
primary: '#BF63F3',
|
|
39
38
|
secondary: '#D8A0F7'
|
|
40
|
-
}
|
|
39
|
+
};
|
|
40
|
+
var greenColor = {
|
|
41
41
|
primary: '#82B536',
|
|
42
42
|
secondary: '#B3DF72'
|
|
43
|
-
}
|
|
44
|
-
var
|
|
43
|
+
};
|
|
44
|
+
var blueColor = {
|
|
45
|
+
primary: '#357DE8',
|
|
46
|
+
secondary: '#669DF1'
|
|
47
|
+
};
|
|
48
|
+
var colorList = [yellowColor, purpleColor, greenColor, blueColor];
|
|
49
|
+
var avatarList = [_customerInsight.CustomerInsightAvatar, _backlogBuddy.BacklogBuddyAvatar, _decisionDirector.DecisionDirectorAvatar, _commsCrafter.CommsCrafterAvatar, _autoDev.AutoDevAvatar, _okrOracle.OkrOracleAvatar, _culture.CultureAvatar, _socialMediaScribe.SocialMediaScribeAvatar, _teamConnection.TeamConnectionAvatar, _hireWriter.HireWriterAvatar, _opsAgent.OpsAgentAvatar, _researchScout.ResearchScoutAvatar, _releaseNotes.ReleaseNotesAvatar, _myUserManual.MyUserManualAvatar, _pitchPerfector.PitchPerfectorAvatar, _autoDev.AutoDevAvatar, _autoFix.AutoFixAvatar, _autoReview.AutoReviewAvatar, _marketingMessageMaestro.MarketingMessageMaestroAvatar, _featureFlagAvatar.FeatureFlagAvatar, _productRequirement.ProductRequirementAvatar];
|
|
45
50
|
var TOTAL_AVATAR_COMBINATIONS = exports.TOTAL_AVATAR_COMBINATIONS = avatarList.length * colorList.length;
|
|
46
51
|
var imageStyles = (0, _primitives.xcss)({
|
|
47
52
|
objectFit: 'cover',
|
|
@@ -51,43 +56,118 @@ var imageStyles = (0, _primitives.xcss)({
|
|
|
51
56
|
justifyContent: 'center',
|
|
52
57
|
alignItems: 'center'
|
|
53
58
|
});
|
|
54
|
-
var
|
|
59
|
+
var outOfTheBoxAgentAvatar = {
|
|
60
|
+
decision_director_agent: {
|
|
61
|
+
getRender: function getRender(size) {
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement(_decisionDirector.DecisionDirectorAvatar, {
|
|
63
|
+
size: _avatar.AVATAR_SIZES[size],
|
|
64
|
+
primaryColor: greenColor.primary,
|
|
65
|
+
secondaryColor: greenColor.secondary
|
|
66
|
+
});
|
|
67
|
+
},
|
|
68
|
+
color: greenColor
|
|
69
|
+
},
|
|
70
|
+
user_manual_writer_agent: {
|
|
71
|
+
getRender: function getRender(size) {
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement(_myUserManual.MyUserManualAvatar, {
|
|
73
|
+
size: _avatar.AVATAR_SIZES[size],
|
|
74
|
+
primaryColor: yellowColor.primary,
|
|
75
|
+
secondaryColor: yellowColor.secondary
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
color: yellowColor
|
|
79
|
+
},
|
|
80
|
+
product_requirements_expert_agent: {
|
|
81
|
+
getRender: function getRender(size) {
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_productRequirement.ProductRequirementAvatar, {
|
|
83
|
+
size: _avatar.AVATAR_SIZES[size],
|
|
84
|
+
primaryColor: yellowColor.primary,
|
|
85
|
+
secondaryColor: yellowColor.secondary
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
color: yellowColor
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var getAvatarRender = function getAvatarRender(_ref) {
|
|
55
92
|
var agentNamedId = _ref.agentNamedId,
|
|
56
93
|
agentId = _ref.agentId,
|
|
57
94
|
size = _ref.size;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var _color = colorList[colorIndex];
|
|
72
|
-
return {
|
|
73
|
-
render: /*#__PURE__*/_react.default.createElement(Avatar, {
|
|
74
|
-
size: _avatar.AVATAR_SIZES[size],
|
|
75
|
-
primaryColor: _color.primary,
|
|
76
|
-
secondaryColor: _color.secondary
|
|
77
|
-
}),
|
|
78
|
-
color: _color
|
|
79
|
-
};
|
|
95
|
+
if (typeof agentNamedId === 'string' && outOfTheBoxAgentAvatar[agentNamedId]) {
|
|
96
|
+
var ootbAvatarResult = outOfTheBoxAgentAvatar[agentNamedId];
|
|
97
|
+
return {
|
|
98
|
+
render: ootbAvatarResult.getRender(size),
|
|
99
|
+
color: ootbAvatarResult.color
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (agentId) {
|
|
103
|
+
// Take the last 8 characters of the agentId because JS can't handle 16 digit numbers
|
|
104
|
+
var agentIdSubset = agentId.slice(-8).replace(/-/g, '');
|
|
105
|
+
var agentIdNumber = parseInt(agentIdSubset, 16);
|
|
106
|
+
if (isNaN(agentIdNumber)) {
|
|
107
|
+
agentIdNumber = 0;
|
|
80
108
|
}
|
|
81
109
|
|
|
82
|
-
|
|
110
|
+
/**
|
|
111
|
+
* this create all possible combinations of avatars and colors
|
|
112
|
+
* e.g. [[avatar1, color1], [avatar1, color2], [avatar2, color1], [avatar2, color2]]
|
|
113
|
+
* then choose 1 based on agentId
|
|
114
|
+
*/
|
|
115
|
+
var totalCombinations = avatarList.length * colorList.length;
|
|
116
|
+
var combinationIndex = agentIdNumber % totalCombinations;
|
|
117
|
+
var avatarIndex = Math.floor(combinationIndex / colorList.length);
|
|
118
|
+
var colorIndex = combinationIndex % colorList.length;
|
|
119
|
+
var Avatar = avatarList[avatarIndex];
|
|
120
|
+
var color = colorList[colorIndex];
|
|
83
121
|
return {
|
|
84
|
-
render:
|
|
85
|
-
|
|
122
|
+
render: /*#__PURE__*/_react.default.createElement(Avatar, {
|
|
123
|
+
size: _avatar.AVATAR_SIZES[size],
|
|
124
|
+
primaryColor: color.primary,
|
|
125
|
+
secondaryColor: color.secondary
|
|
126
|
+
}),
|
|
127
|
+
color: color
|
|
86
128
|
};
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
render: /*#__PURE__*/_react.default.createElement(_genericAvatar.GenericAvatar, {
|
|
132
|
+
size: _avatar.AVATAR_SIZES[size],
|
|
133
|
+
primaryColor: blueColor.primary,
|
|
134
|
+
secondaryColor: blueColor.secondary
|
|
135
|
+
}),
|
|
136
|
+
color: blueColor
|
|
87
137
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
138
|
+
};
|
|
139
|
+
var bannerStyles = (0, _primitives.xcss)({
|
|
140
|
+
width: '100%'
|
|
141
|
+
});
|
|
142
|
+
var AgentBanner = exports.AgentBanner = function AgentBanner(_ref2) {
|
|
143
|
+
var agentNamedId = _ref2.agentNamedId,
|
|
144
|
+
agentId = _ref2.agentId,
|
|
145
|
+
height = _ref2.height;
|
|
146
|
+
var _getAvatarRender = getAvatarRender({
|
|
147
|
+
agentNamedId: agentNamedId,
|
|
148
|
+
agentId: agentId,
|
|
149
|
+
size: 'medium'
|
|
150
|
+
}),
|
|
151
|
+
color = _getAvatarRender.color;
|
|
152
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
153
|
+
xcss: bannerStyles,
|
|
154
|
+
style: {
|
|
155
|
+
backgroundColor: color.primary,
|
|
156
|
+
height: "".concat(height, "px")
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
var GeneratedAvatar = exports.GeneratedAvatar = function GeneratedAvatar(_ref3) {
|
|
161
|
+
var agentNamedId = _ref3.agentNamedId,
|
|
162
|
+
agentId = _ref3.agentId,
|
|
163
|
+
size = _ref3.size;
|
|
164
|
+
var _getAvatarRender2 = getAvatarRender({
|
|
165
|
+
agentNamedId: agentNamedId,
|
|
166
|
+
agentId: agentId,
|
|
167
|
+
size: size
|
|
168
|
+
}),
|
|
169
|
+
render = _getAvatarRender2.render,
|
|
170
|
+
color = _getAvatarRender2.color;
|
|
91
171
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
92
172
|
xcss: imageStyles,
|
|
93
173
|
style: {
|
|
@@ -5,10 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.AgentAvatar = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _avatar = require("@atlaskit/avatar");
|
|
10
11
|
var _primitives = require("@atlaskit/primitives");
|
|
11
12
|
var _generatedAvatars = require("./generated-avatars");
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
15
|
/**
|
|
13
16
|
* This solution has been derived from this codepen: https://codepen.io/anyen-ltovn/pen/qBYYzea
|
|
14
17
|
*/
|
|
@@ -42,18 +45,20 @@ var AgentAvatar = exports.AgentAvatar = function AgentAvatar(_ref) {
|
|
|
42
45
|
label = _ref.label,
|
|
43
46
|
name = _ref.name,
|
|
44
47
|
agentId = _ref.agentId,
|
|
45
|
-
agentNamedId = _ref.agentNamedId
|
|
48
|
+
agentNamedId = _ref.agentNamedId,
|
|
49
|
+
_ref$showBorder = _ref.showBorder,
|
|
50
|
+
showBorder = _ref$showBorder === void 0 ? true : _ref$showBorder;
|
|
46
51
|
return /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
47
52
|
"aria-label": label,
|
|
48
53
|
xcss: agentAvatarStyles,
|
|
49
|
-
style: {
|
|
54
|
+
style: _objectSpread({
|
|
50
55
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
51
56
|
height: _avatar.AVATAR_SIZES[size],
|
|
52
57
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
53
|
-
width: _avatar.AVATAR_SIZES[size]
|
|
54
|
-
|
|
58
|
+
width: _avatar.AVATAR_SIZES[size]
|
|
59
|
+
}, showBorder ? {
|
|
55
60
|
backgroundColor: '#fff'
|
|
56
|
-
}
|
|
61
|
+
} : {})
|
|
57
62
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
58
63
|
xcss: innerShapeStyles
|
|
59
64
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
package/dist/es2019/index.js
CHANGED
|
@@ -3,4 +3,5 @@ export { StarIconButton } from './common/ui/star-icon-button';
|
|
|
3
3
|
export { AgentConversationStarters, getConversationStarters } from './ui/agent-conversation-starters';
|
|
4
4
|
export { ChatPill } from './common/ui/chat-pill';
|
|
5
5
|
export { ChatPillIcon } from './common/ui/chat-icon';
|
|
6
|
-
export { AgentAvatar } from './ui/agent-avatar';
|
|
6
|
+
export { AgentAvatar } from './ui/agent-avatar';
|
|
7
|
+
export { AgentBanner } from './ui/agent-avatar/generated-avatars';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export const GenericAvatar = ({
|
|
4
|
+
size,
|
|
5
|
+
primaryColor,
|
|
6
|
+
secondaryColor
|
|
7
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
viewBox: "0 0 42 48",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
15
|
+
fill: primaryColor
|
|
16
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
d: "M29.2653 16.6133C30.0565 16.9889 31.0505 16.3475 31.5218 17.1391C30.9191 16.8907 30.9991 20.086 31.9931 19.3291C32.1131 18.8321 32.4015 18.8928 31.8931 18.7224C32.7472 18.7166 31.9531 18.1677 31.9817 18.0897C32.4472 18.0781 31.8388 17.8123 32.2816 17.9048C32.5386 17.8528 31.7874 17.1941 32.2959 17.3703C32.4587 16.6538 33.2527 16.6595 33.0756 16.2233C33.0842 16.5209 35.7235 16.5902 34.9922 15.4519C34.5295 15.475 34.5895 14.9492 34.5209 15.6339C34.381 14.7846 34.0696 15.6339 33.9954 15.6137C33.9268 15.137 33.7897 15.7957 33.8097 15.3306C33.7412 15.0792 33.2956 15.8824 33.3841 15.3566C31.8446 14.9492 33.1071 14.5101 32.2187 13.626C32.1302 13.2158 32.3473 11.8839 31.3961 12.0081C30.145 12.3722 31.6046 14.6459 30.862 15.0417C30.5306 15.3421 30.0593 15.7206 29.4338 15.4635C29.1253 15.4577 28.7283 16.7318 29.2624 16.6162L29.2653 16.6133Z",
|
|
18
|
+
fill: secondaryColor
|
|
19
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
clipRule: "evenodd",
|
|
22
|
+
d: "M28.7902 28.7278L27.201 27.1386C24.0002 29.572 21.081 32.2138 18.4782 35.0894C14.793 32.0629 11.4735 28.5422 8.47053 24.5922L21.0314 12.0314C24.0681 17.5482 28.2305 21.4951 33.1965 24.3214L28.7902 28.7278ZM19.6147 24.8358L19.6147 28.5444L19.6151 28.5444L21.5003 28.5444L21.5003 24.8358H24.9944L20.5575 20.3988L16.1206 24.8358L19.6147 24.8358ZM27.2009 27.1393L28.79 28.7284L20.698 36.8205C19.9435 36.2635 19.2038 35.6863 18.478 35.0901C21.0806 32.2146 23.9998 29.5729 27.2009 27.1393Z",
|
|
23
|
+
fill: "#CCE0FF"
|
|
24
|
+
}));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export const ProductRequirementAvatar = ({
|
|
4
|
+
size,
|
|
5
|
+
primaryColor,
|
|
6
|
+
secondaryColor
|
|
7
|
+
}) => /*#__PURE__*/React.createElement("svg", {
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
viewBox: "0 0 42 48",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
15
|
+
fill: primaryColor
|
|
16
|
+
}), /*#__PURE__*/React.createElement("mask", {
|
|
17
|
+
id: "mask0_602_29348",
|
|
18
|
+
style: {
|
|
19
|
+
maskType: 'alpha'
|
|
20
|
+
},
|
|
21
|
+
maskUnits: "userSpaceOnUse",
|
|
22
|
+
x: "0",
|
|
23
|
+
y: "0",
|
|
24
|
+
width: "42",
|
|
25
|
+
height: "48"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
28
|
+
fill: primaryColor
|
|
29
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
30
|
+
mask: "url(#mask0_602_29348)"
|
|
31
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
32
|
+
d: "M37 35.9716C35.7885 34.4863 32.8225 32.1398 31.2873 30.7577C31.3918 30.2472 27.5902 29.0198 29.0053 28.9476C27.4596 26.6424 24.1646 24.5486 21.1412 22.3774C22.3892 20.263 23.8827 17.6742 24.196 16.0652C25.021 15.467 34.3682 -0.721128 30.739 2.39891L30.6137 2.20294C29.0158 4.0337 27.538 7.0042 26.5301 9.51055C25.8252 9.25269 23.867 14.9771 23.6947 13.3835C21.9976 15.1111 20.4676 17.8289 18.9585 20.7324C16.2483 18.2002 15.6426 17.3596 12.9376 16.3488C12.9376 16.3488 11.4024 14.6316 10.3058 14.4975C8.82801 13.2649 8.21714 11.79 6.0814 11.2536C4.50962 11.3568 4.79155 12.2335 6.02913 13.399C7.38681 14.0901 8.03439 15.4979 9.23019 16.4159C9.45473 16.1426 9.44943 16.3488 9.27711 16.452C10.2954 16.8078 10.3737 17.6794 11.5016 17.767C11.5016 17.767 11.2614 17.8908 11.2562 17.8908C13.1622 19.3606 15.4807 21.3718 17.7626 23.0479C16.1073 26.2865 14.4311 29.4994 12.5565 31.619H12.6556C12.6086 31.6499 12.5774 31.7995 12.4677 31.7789C12.2275 33.3982 11.7314 34.2388 11.4286 35.4816C11.4286 35.4816 9.77328 37.8075 9.76806 39.0916L7.51741 42.7222C6.47304 44.2074 6.89075 48.3022 9.17792 44.2796C9.71055 42.5107 11.1309 41.2885 11.9455 39.6279C11.6322 39.4784 11.8359 39.401 11.9769 39.5609C12.2275 38.3026 13.1413 37.9157 13.1048 36.6213C14.9846 34.4863 17.6425 28.5712 19.4702 25.1417C19.2926 25.2139 19.794 24.4506 19.7679 24.4454C19.7679 24.4454 19.7731 24.4352 19.7783 24.43C19.794 24.4403 19.8097 24.4506 19.8254 24.4609C19.8254 24.4403 19.8305 24.4197 19.8514 24.4094C19.8514 24.3991 20.5668 24.8013 20.3579 24.7703C21.6372 26.1628 24.598 28.4422 26.2534 29.2003C26.3317 29.025 26.666 29.2467 26.5824 29.2776C26.1229 29.1796 37.8459 39.2876 36.8015 36.0799L37 35.9767V35.9716Z",
|
|
33
|
+
fill: secondaryColor
|
|
34
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
35
|
+
d: "M9.41632 37H29.3148V11H19.2549L9.41632 20.6911V37Z",
|
|
36
|
+
fill: "white"
|
|
37
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
38
|
+
d: "M19.259 11V20.6624H9.44501L19.259 11Z",
|
|
39
|
+
fill: "#101214"
|
|
40
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
41
|
+
fillRule: "evenodd",
|
|
42
|
+
clipRule: "evenodd",
|
|
43
|
+
d: "M35 21.313L23.133 33.7411L16.9966 27.1391L19.6412 24.4436L23.1684 28.2389L32.3908 18.5804L35 21.313Z",
|
|
44
|
+
fill: "white"
|
|
45
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
46
|
+
fillRule: "evenodd",
|
|
47
|
+
clipRule: "evenodd",
|
|
48
|
+
d: "M29.3147 21.8019L23.1684 28.2389L19.6412 24.4436L16.9966 27.1391L23.133 33.7411L29.3147 27.2671V21.8019Z",
|
|
49
|
+
fill: "#101214"
|
|
50
|
+
}));
|
|
@@ -10,31 +10,36 @@ import { CultureAvatar } from './assets/culture';
|
|
|
10
10
|
import { CustomerInsightAvatar } from './assets/customer-insight';
|
|
11
11
|
import { DecisionDirectorAvatar } from './assets/decision-director';
|
|
12
12
|
import { FeatureFlagAvatar } from './assets/feature-flag-avatar';
|
|
13
|
+
import { GenericAvatar } from './assets/generic-avatar';
|
|
13
14
|
import { HireWriterAvatar } from './assets/hire-writer';
|
|
14
15
|
import { MarketingMessageMaestroAvatar } from './assets/marketing-message-maestro';
|
|
15
16
|
import { MyUserManualAvatar } from './assets/my-user-manual';
|
|
16
17
|
import { OkrOracleAvatar } from './assets/okr-oracle';
|
|
17
18
|
import { OpsAgentAvatar } from './assets/ops-agent';
|
|
18
19
|
import { PitchPerfectorAvatar } from './assets/pitch-perfector';
|
|
20
|
+
import { ProductRequirementAvatar } from './assets/product-requirement';
|
|
19
21
|
import { ReleaseNotesAvatar } from './assets/release-notes';
|
|
20
22
|
import { ResearchScoutAvatar } from './assets/research-scout';
|
|
21
23
|
import { SocialMediaScribeAvatar } from './assets/social-media-scribe';
|
|
22
24
|
import { TeamConnectionAvatar } from './assets/team-connection';
|
|
23
|
-
const
|
|
24
|
-
primary: '#357DE8',
|
|
25
|
-
secondary: '#669DF1'
|
|
26
|
-
};
|
|
27
|
-
const colorList = [{
|
|
25
|
+
const yellowColor = {
|
|
28
26
|
primary: '#FCA700',
|
|
29
27
|
secondary: '#FFC716'
|
|
30
|
-
}
|
|
28
|
+
};
|
|
29
|
+
const purpleColor = {
|
|
31
30
|
primary: '#BF63F3',
|
|
32
31
|
secondary: '#D8A0F7'
|
|
33
|
-
}
|
|
32
|
+
};
|
|
33
|
+
const greenColor = {
|
|
34
34
|
primary: '#82B536',
|
|
35
35
|
secondary: '#B3DF72'
|
|
36
|
-
}
|
|
37
|
-
const
|
|
36
|
+
};
|
|
37
|
+
const blueColor = {
|
|
38
|
+
primary: '#357DE8',
|
|
39
|
+
secondary: '#669DF1'
|
|
40
|
+
};
|
|
41
|
+
const colorList = [yellowColor, purpleColor, greenColor, blueColor];
|
|
42
|
+
const avatarList = [CustomerInsightAvatar, BacklogBuddyAvatar, DecisionDirectorAvatar, CommsCrafterAvatar, AutoDevAvatar, OkrOracleAvatar, CultureAvatar, SocialMediaScribeAvatar, TeamConnectionAvatar, HireWriterAvatar, OpsAgentAvatar, ResearchScoutAvatar, ReleaseNotesAvatar, MyUserManualAvatar, PitchPerfectorAvatar, AutoDevAvatar, AutoFixAvatar, AutoReviewAvatar, MarketingMessageMaestroAvatar, FeatureFlagAvatar, ProductRequirementAvatar];
|
|
38
43
|
export const TOTAL_AVATAR_COMBINATIONS = avatarList.length * colorList.length;
|
|
39
44
|
const imageStyles = xcss({
|
|
40
45
|
objectFit: 'cover',
|
|
@@ -44,45 +49,117 @@ const imageStyles = xcss({
|
|
|
44
49
|
justifyContent: 'center',
|
|
45
50
|
alignItems: 'center'
|
|
46
51
|
});
|
|
47
|
-
|
|
52
|
+
const outOfTheBoxAgentAvatar = {
|
|
53
|
+
decision_director_agent: {
|
|
54
|
+
getRender: size => /*#__PURE__*/React.createElement(DecisionDirectorAvatar, {
|
|
55
|
+
size: AVATAR_SIZES[size],
|
|
56
|
+
primaryColor: greenColor.primary,
|
|
57
|
+
secondaryColor: greenColor.secondary
|
|
58
|
+
}),
|
|
59
|
+
color: greenColor
|
|
60
|
+
},
|
|
61
|
+
user_manual_writer_agent: {
|
|
62
|
+
getRender: size => /*#__PURE__*/React.createElement(MyUserManualAvatar, {
|
|
63
|
+
size: AVATAR_SIZES[size],
|
|
64
|
+
primaryColor: yellowColor.primary,
|
|
65
|
+
secondaryColor: yellowColor.secondary
|
|
66
|
+
}),
|
|
67
|
+
color: yellowColor
|
|
68
|
+
},
|
|
69
|
+
product_requirements_expert_agent: {
|
|
70
|
+
getRender: size => /*#__PURE__*/React.createElement(ProductRequirementAvatar, {
|
|
71
|
+
size: AVATAR_SIZES[size],
|
|
72
|
+
primaryColor: yellowColor.primary,
|
|
73
|
+
secondaryColor: yellowColor.secondary
|
|
74
|
+
}),
|
|
75
|
+
color: yellowColor
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
const getAvatarRender = ({
|
|
48
79
|
agentNamedId,
|
|
49
80
|
agentId,
|
|
50
81
|
size
|
|
51
82
|
}) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const color = colorList[colorIndex];
|
|
66
|
-
return {
|
|
67
|
-
render: /*#__PURE__*/React.createElement(Avatar, {
|
|
68
|
-
size: AVATAR_SIZES[size],
|
|
69
|
-
primaryColor: color.primary,
|
|
70
|
-
secondaryColor: color.secondary
|
|
71
|
-
}),
|
|
72
|
-
color
|
|
73
|
-
};
|
|
83
|
+
if (typeof agentNamedId === 'string' && outOfTheBoxAgentAvatar[agentNamedId]) {
|
|
84
|
+
const ootbAvatarResult = outOfTheBoxAgentAvatar[agentNamedId];
|
|
85
|
+
return {
|
|
86
|
+
render: ootbAvatarResult.getRender(size),
|
|
87
|
+
color: ootbAvatarResult.color
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (agentId) {
|
|
91
|
+
// Take the last 8 characters of the agentId because JS can't handle 16 digit numbers
|
|
92
|
+
const agentIdSubset = agentId.slice(-8).replace(/-/g, '');
|
|
93
|
+
let agentIdNumber = parseInt(agentIdSubset, 16);
|
|
94
|
+
if (isNaN(agentIdNumber)) {
|
|
95
|
+
agentIdNumber = 0;
|
|
74
96
|
}
|
|
75
97
|
|
|
76
|
-
|
|
98
|
+
/**
|
|
99
|
+
* this create all possible combinations of avatars and colors
|
|
100
|
+
* e.g. [[avatar1, color1], [avatar1, color2], [avatar2, color1], [avatar2, color2]]
|
|
101
|
+
* then choose 1 based on agentId
|
|
102
|
+
*/
|
|
103
|
+
const totalCombinations = avatarList.length * colorList.length;
|
|
104
|
+
const combinationIndex = agentIdNumber % totalCombinations;
|
|
105
|
+
const avatarIndex = Math.floor(combinationIndex / colorList.length);
|
|
106
|
+
const colorIndex = combinationIndex % colorList.length;
|
|
107
|
+
const Avatar = avatarList[avatarIndex];
|
|
108
|
+
const color = colorList[colorIndex];
|
|
77
109
|
return {
|
|
78
|
-
render:
|
|
79
|
-
|
|
110
|
+
render: /*#__PURE__*/React.createElement(Avatar, {
|
|
111
|
+
size: AVATAR_SIZES[size],
|
|
112
|
+
primaryColor: color.primary,
|
|
113
|
+
secondaryColor: color.secondary
|
|
114
|
+
}),
|
|
115
|
+
color
|
|
80
116
|
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
render: /*#__PURE__*/React.createElement(GenericAvatar, {
|
|
120
|
+
size: AVATAR_SIZES[size],
|
|
121
|
+
primaryColor: blueColor.primary,
|
|
122
|
+
secondaryColor: blueColor.secondary
|
|
123
|
+
}),
|
|
124
|
+
color: blueColor
|
|
81
125
|
};
|
|
126
|
+
};
|
|
127
|
+
const bannerStyles = xcss({
|
|
128
|
+
width: '100%'
|
|
129
|
+
});
|
|
130
|
+
export const AgentBanner = ({
|
|
131
|
+
agentNamedId,
|
|
132
|
+
agentId,
|
|
133
|
+
height
|
|
134
|
+
}) => {
|
|
135
|
+
const {
|
|
136
|
+
color
|
|
137
|
+
} = getAvatarRender({
|
|
138
|
+
agentNamedId,
|
|
139
|
+
agentId,
|
|
140
|
+
size: 'medium'
|
|
141
|
+
});
|
|
142
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
143
|
+
xcss: bannerStyles,
|
|
144
|
+
style: {
|
|
145
|
+
backgroundColor: color.primary,
|
|
146
|
+
height: `${height}px`
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
export const GeneratedAvatar = ({
|
|
151
|
+
agentNamedId,
|
|
152
|
+
agentId,
|
|
153
|
+
size
|
|
154
|
+
}) => {
|
|
82
155
|
const {
|
|
83
156
|
render,
|
|
84
157
|
color
|
|
85
|
-
} =
|
|
158
|
+
} = getAvatarRender({
|
|
159
|
+
agentNamedId,
|
|
160
|
+
agentId,
|
|
161
|
+
size
|
|
162
|
+
});
|
|
86
163
|
return /*#__PURE__*/React.createElement(Box, {
|
|
87
164
|
xcss: imageStyles,
|
|
88
165
|
style: {
|
|
@@ -35,7 +35,8 @@ export const AgentAvatar = ({
|
|
|
35
35
|
label,
|
|
36
36
|
name,
|
|
37
37
|
agentId,
|
|
38
|
-
agentNamedId
|
|
38
|
+
agentNamedId,
|
|
39
|
+
showBorder = true
|
|
39
40
|
}) => {
|
|
40
41
|
return /*#__PURE__*/React.createElement(Box, {
|
|
41
42
|
"aria-label": label,
|
|
@@ -46,7 +47,9 @@ export const AgentAvatar = ({
|
|
|
46
47
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
47
48
|
width: AVATAR_SIZES[size],
|
|
48
49
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/ensure-design-token-usage
|
|
49
|
-
|
|
50
|
+
...(showBorder ? {
|
|
51
|
+
backgroundColor: '#fff'
|
|
52
|
+
} : {})
|
|
50
53
|
}
|
|
51
54
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
52
55
|
xcss: innerShapeStyles
|
package/dist/esm/index.js
CHANGED
|
@@ -3,4 +3,5 @@ export { StarIconButton } from './common/ui/star-icon-button';
|
|
|
3
3
|
export { AgentConversationStarters, getConversationStarters } from './ui/agent-conversation-starters';
|
|
4
4
|
export { ChatPill } from './common/ui/chat-pill';
|
|
5
5
|
export { ChatPillIcon } from './common/ui/chat-icon';
|
|
6
|
-
export { AgentAvatar } from './ui/agent-avatar';
|
|
6
|
+
export { AgentAvatar } from './ui/agent-avatar';
|
|
7
|
+
export { AgentBanner } from './ui/agent-avatar/generated-avatars';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export var GenericAvatar = function GenericAvatar(_ref) {
|
|
4
|
+
var size = _ref.size,
|
|
5
|
+
primaryColor = _ref.primaryColor,
|
|
6
|
+
secondaryColor = _ref.secondaryColor;
|
|
7
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
viewBox: "0 0 42 48",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
15
|
+
fill: primaryColor
|
|
16
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
d: "M29.2653 16.6133C30.0565 16.9889 31.0505 16.3475 31.5218 17.1391C30.9191 16.8907 30.9991 20.086 31.9931 19.3291C32.1131 18.8321 32.4015 18.8928 31.8931 18.7224C32.7472 18.7166 31.9531 18.1677 31.9817 18.0897C32.4472 18.0781 31.8388 17.8123 32.2816 17.9048C32.5386 17.8528 31.7874 17.1941 32.2959 17.3703C32.4587 16.6538 33.2527 16.6595 33.0756 16.2233C33.0842 16.5209 35.7235 16.5902 34.9922 15.4519C34.5295 15.475 34.5895 14.9492 34.5209 15.6339C34.381 14.7846 34.0696 15.6339 33.9954 15.6137C33.9268 15.137 33.7897 15.7957 33.8097 15.3306C33.7412 15.0792 33.2956 15.8824 33.3841 15.3566C31.8446 14.9492 33.1071 14.5101 32.2187 13.626C32.1302 13.2158 32.3473 11.8839 31.3961 12.0081C30.145 12.3722 31.6046 14.6459 30.862 15.0417C30.5306 15.3421 30.0593 15.7206 29.4338 15.4635C29.1253 15.4577 28.7283 16.7318 29.2624 16.6162L29.2653 16.6133Z",
|
|
18
|
+
fill: secondaryColor
|
|
19
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
clipRule: "evenodd",
|
|
22
|
+
d: "M28.7902 28.7278L27.201 27.1386C24.0002 29.572 21.081 32.2138 18.4782 35.0894C14.793 32.0629 11.4735 28.5422 8.47053 24.5922L21.0314 12.0314C24.0681 17.5482 28.2305 21.4951 33.1965 24.3214L28.7902 28.7278ZM19.6147 24.8358L19.6147 28.5444L19.6151 28.5444L21.5003 28.5444L21.5003 24.8358H24.9944L20.5575 20.3988L16.1206 24.8358L19.6147 24.8358ZM27.2009 27.1393L28.79 28.7284L20.698 36.8205C19.9435 36.2635 19.2038 35.6863 18.478 35.0901C21.0806 32.2146 23.9998 29.5729 27.2009 27.1393Z",
|
|
23
|
+
fill: "#CCE0FF"
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export var ProductRequirementAvatar = function ProductRequirementAvatar(_ref) {
|
|
4
|
+
var size = _ref.size,
|
|
5
|
+
primaryColor = _ref.primaryColor,
|
|
6
|
+
secondaryColor = _ref.secondaryColor;
|
|
7
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
viewBox: "0 0 42 48",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
13
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
14
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
15
|
+
fill: primaryColor
|
|
16
|
+
}), /*#__PURE__*/React.createElement("mask", {
|
|
17
|
+
id: "mask0_602_29348",
|
|
18
|
+
style: {
|
|
19
|
+
maskType: 'alpha'
|
|
20
|
+
},
|
|
21
|
+
maskUnits: "userSpaceOnUse",
|
|
22
|
+
x: "0",
|
|
23
|
+
y: "0",
|
|
24
|
+
width: "42",
|
|
25
|
+
height: "48"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
d: "M19.0069 1.14541C20.241 0.436192 21.759 0.436193 22.9931 1.14541L39.9931 10.9152C41.2346 11.6287 42 12.9514 42 14.3833V33.891C42 35.3229 41.2346 36.6456 39.9931 37.3591L22.9931 47.1289C21.759 47.8381 20.241 47.8381 19.0069 47.1289L2.00691 37.3591C0.765414 36.6456 0 35.3229 0 33.891V14.3833C0 12.9514 0.765415 11.6287 2.00691 10.9152L19.0069 1.14541Z",
|
|
28
|
+
fill: primaryColor
|
|
29
|
+
})), /*#__PURE__*/React.createElement("g", {
|
|
30
|
+
mask: "url(#mask0_602_29348)"
|
|
31
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
32
|
+
d: "M37 35.9716C35.7885 34.4863 32.8225 32.1398 31.2873 30.7577C31.3918 30.2472 27.5902 29.0198 29.0053 28.9476C27.4596 26.6424 24.1646 24.5486 21.1412 22.3774C22.3892 20.263 23.8827 17.6742 24.196 16.0652C25.021 15.467 34.3682 -0.721128 30.739 2.39891L30.6137 2.20294C29.0158 4.0337 27.538 7.0042 26.5301 9.51055C25.8252 9.25269 23.867 14.9771 23.6947 13.3835C21.9976 15.1111 20.4676 17.8289 18.9585 20.7324C16.2483 18.2002 15.6426 17.3596 12.9376 16.3488C12.9376 16.3488 11.4024 14.6316 10.3058 14.4975C8.82801 13.2649 8.21714 11.79 6.0814 11.2536C4.50962 11.3568 4.79155 12.2335 6.02913 13.399C7.38681 14.0901 8.03439 15.4979 9.23019 16.4159C9.45473 16.1426 9.44943 16.3488 9.27711 16.452C10.2954 16.8078 10.3737 17.6794 11.5016 17.767C11.5016 17.767 11.2614 17.8908 11.2562 17.8908C13.1622 19.3606 15.4807 21.3718 17.7626 23.0479C16.1073 26.2865 14.4311 29.4994 12.5565 31.619H12.6556C12.6086 31.6499 12.5774 31.7995 12.4677 31.7789C12.2275 33.3982 11.7314 34.2388 11.4286 35.4816C11.4286 35.4816 9.77328 37.8075 9.76806 39.0916L7.51741 42.7222C6.47304 44.2074 6.89075 48.3022 9.17792 44.2796C9.71055 42.5107 11.1309 41.2885 11.9455 39.6279C11.6322 39.4784 11.8359 39.401 11.9769 39.5609C12.2275 38.3026 13.1413 37.9157 13.1048 36.6213C14.9846 34.4863 17.6425 28.5712 19.4702 25.1417C19.2926 25.2139 19.794 24.4506 19.7679 24.4454C19.7679 24.4454 19.7731 24.4352 19.7783 24.43C19.794 24.4403 19.8097 24.4506 19.8254 24.4609C19.8254 24.4403 19.8305 24.4197 19.8514 24.4094C19.8514 24.3991 20.5668 24.8013 20.3579 24.7703C21.6372 26.1628 24.598 28.4422 26.2534 29.2003C26.3317 29.025 26.666 29.2467 26.5824 29.2776C26.1229 29.1796 37.8459 39.2876 36.8015 36.0799L37 35.9767V35.9716Z",
|
|
33
|
+
fill: secondaryColor
|
|
34
|
+
})), /*#__PURE__*/React.createElement("path", {
|
|
35
|
+
d: "M9.41632 37H29.3148V11H19.2549L9.41632 20.6911V37Z",
|
|
36
|
+
fill: "white"
|
|
37
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
38
|
+
d: "M19.259 11V20.6624H9.44501L19.259 11Z",
|
|
39
|
+
fill: "#101214"
|
|
40
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
41
|
+
fillRule: "evenodd",
|
|
42
|
+
clipRule: "evenodd",
|
|
43
|
+
d: "M35 21.313L23.133 33.7411L16.9966 27.1391L19.6412 24.4436L23.1684 28.2389L32.3908 18.5804L35 21.313Z",
|
|
44
|
+
fill: "white"
|
|
45
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
46
|
+
fillRule: "evenodd",
|
|
47
|
+
clipRule: "evenodd",
|
|
48
|
+
d: "M29.3147 21.8019L23.1684 28.2389L19.6412 24.4436L16.9966 27.1391L23.133 33.7411L29.3147 27.2671V21.8019Z",
|
|
49
|
+
fill: "#101214"
|
|
50
|
+
}));
|
|
51
|
+
};
|
|
@@ -10,31 +10,36 @@ import { CultureAvatar } from './assets/culture';
|
|
|
10
10
|
import { CustomerInsightAvatar } from './assets/customer-insight';
|
|
11
11
|
import { DecisionDirectorAvatar } from './assets/decision-director';
|
|
12
12
|
import { FeatureFlagAvatar } from './assets/feature-flag-avatar';
|
|
13
|
+
import { GenericAvatar } from './assets/generic-avatar';
|
|
13
14
|
import { HireWriterAvatar } from './assets/hire-writer';
|
|
14
15
|
import { MarketingMessageMaestroAvatar } from './assets/marketing-message-maestro';
|
|
15
16
|
import { MyUserManualAvatar } from './assets/my-user-manual';
|
|
16
17
|
import { OkrOracleAvatar } from './assets/okr-oracle';
|
|
17
18
|
import { OpsAgentAvatar } from './assets/ops-agent';
|
|
18
19
|
import { PitchPerfectorAvatar } from './assets/pitch-perfector';
|
|
20
|
+
import { ProductRequirementAvatar } from './assets/product-requirement';
|
|
19
21
|
import { ReleaseNotesAvatar } from './assets/release-notes';
|
|
20
22
|
import { ResearchScoutAvatar } from './assets/research-scout';
|
|
21
23
|
import { SocialMediaScribeAvatar } from './assets/social-media-scribe';
|
|
22
24
|
import { TeamConnectionAvatar } from './assets/team-connection';
|
|
23
|
-
var
|
|
24
|
-
primary: '#357DE8',
|
|
25
|
-
secondary: '#669DF1'
|
|
26
|
-
};
|
|
27
|
-
var colorList = [{
|
|
25
|
+
var yellowColor = {
|
|
28
26
|
primary: '#FCA700',
|
|
29
27
|
secondary: '#FFC716'
|
|
30
|
-
}
|
|
28
|
+
};
|
|
29
|
+
var purpleColor = {
|
|
31
30
|
primary: '#BF63F3',
|
|
32
31
|
secondary: '#D8A0F7'
|
|
33
|
-
}
|
|
32
|
+
};
|
|
33
|
+
var greenColor = {
|
|
34
34
|
primary: '#82B536',
|
|
35
35
|
secondary: '#B3DF72'
|
|
36
|
-
}
|
|
37
|
-
var
|
|
36
|
+
};
|
|
37
|
+
var blueColor = {
|
|
38
|
+
primary: '#357DE8',
|
|
39
|
+
secondary: '#669DF1'
|
|
40
|
+
};
|
|
41
|
+
var colorList = [yellowColor, purpleColor, greenColor, blueColor];
|
|
42
|
+
var avatarList = [CustomerInsightAvatar, BacklogBuddyAvatar, DecisionDirectorAvatar, CommsCrafterAvatar, AutoDevAvatar, OkrOracleAvatar, CultureAvatar, SocialMediaScribeAvatar, TeamConnectionAvatar, HireWriterAvatar, OpsAgentAvatar, ResearchScoutAvatar, ReleaseNotesAvatar, MyUserManualAvatar, PitchPerfectorAvatar, AutoDevAvatar, AutoFixAvatar, AutoReviewAvatar, MarketingMessageMaestroAvatar, FeatureFlagAvatar, ProductRequirementAvatar];
|
|
38
43
|
export var TOTAL_AVATAR_COMBINATIONS = avatarList.length * colorList.length;
|
|
39
44
|
var imageStyles = xcss({
|
|
40
45
|
objectFit: 'cover',
|
|
@@ -44,43 +49,118 @@ var imageStyles = xcss({
|
|
|
44
49
|
justifyContent: 'center',
|
|
45
50
|
alignItems: 'center'
|
|
46
51
|
});
|
|
47
|
-
|
|
52
|
+
var outOfTheBoxAgentAvatar = {
|
|
53
|
+
decision_director_agent: {
|
|
54
|
+
getRender: function getRender(size) {
|
|
55
|
+
return /*#__PURE__*/React.createElement(DecisionDirectorAvatar, {
|
|
56
|
+
size: AVATAR_SIZES[size],
|
|
57
|
+
primaryColor: greenColor.primary,
|
|
58
|
+
secondaryColor: greenColor.secondary
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
color: greenColor
|
|
62
|
+
},
|
|
63
|
+
user_manual_writer_agent: {
|
|
64
|
+
getRender: function getRender(size) {
|
|
65
|
+
return /*#__PURE__*/React.createElement(MyUserManualAvatar, {
|
|
66
|
+
size: AVATAR_SIZES[size],
|
|
67
|
+
primaryColor: yellowColor.primary,
|
|
68
|
+
secondaryColor: yellowColor.secondary
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
color: yellowColor
|
|
72
|
+
},
|
|
73
|
+
product_requirements_expert_agent: {
|
|
74
|
+
getRender: function getRender(size) {
|
|
75
|
+
return /*#__PURE__*/React.createElement(ProductRequirementAvatar, {
|
|
76
|
+
size: AVATAR_SIZES[size],
|
|
77
|
+
primaryColor: yellowColor.primary,
|
|
78
|
+
secondaryColor: yellowColor.secondary
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
color: yellowColor
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
var getAvatarRender = function getAvatarRender(_ref) {
|
|
48
85
|
var agentNamedId = _ref.agentNamedId,
|
|
49
86
|
agentId = _ref.agentId,
|
|
50
87
|
size = _ref.size;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var _color = colorList[colorIndex];
|
|
65
|
-
return {
|
|
66
|
-
render: /*#__PURE__*/React.createElement(Avatar, {
|
|
67
|
-
size: AVATAR_SIZES[size],
|
|
68
|
-
primaryColor: _color.primary,
|
|
69
|
-
secondaryColor: _color.secondary
|
|
70
|
-
}),
|
|
71
|
-
color: _color
|
|
72
|
-
};
|
|
88
|
+
if (typeof agentNamedId === 'string' && outOfTheBoxAgentAvatar[agentNamedId]) {
|
|
89
|
+
var ootbAvatarResult = outOfTheBoxAgentAvatar[agentNamedId];
|
|
90
|
+
return {
|
|
91
|
+
render: ootbAvatarResult.getRender(size),
|
|
92
|
+
color: ootbAvatarResult.color
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
if (agentId) {
|
|
96
|
+
// Take the last 8 characters of the agentId because JS can't handle 16 digit numbers
|
|
97
|
+
var agentIdSubset = agentId.slice(-8).replace(/-/g, '');
|
|
98
|
+
var agentIdNumber = parseInt(agentIdSubset, 16);
|
|
99
|
+
if (isNaN(agentIdNumber)) {
|
|
100
|
+
agentIdNumber = 0;
|
|
73
101
|
}
|
|
74
102
|
|
|
75
|
-
|
|
103
|
+
/**
|
|
104
|
+
* this create all possible combinations of avatars and colors
|
|
105
|
+
* e.g. [[avatar1, color1], [avatar1, color2], [avatar2, color1], [avatar2, color2]]
|
|
106
|
+
* then choose 1 based on agentId
|
|
107
|
+
*/
|
|
108
|
+
var totalCombinations = avatarList.length * colorList.length;
|
|
109
|
+
var combinationIndex = agentIdNumber % totalCombinations;
|
|
110
|
+
var avatarIndex = Math.floor(combinationIndex / colorList.length);
|
|
111
|
+
var colorIndex = combinationIndex % colorList.length;
|
|
112
|
+
var Avatar = avatarList[avatarIndex];
|
|
113
|
+
var color = colorList[colorIndex];
|
|
76
114
|
return {
|
|
77
|
-
render:
|
|
78
|
-
|
|
115
|
+
render: /*#__PURE__*/React.createElement(Avatar, {
|
|
116
|
+
size: AVATAR_SIZES[size],
|
|
117
|
+
primaryColor: color.primary,
|
|
118
|
+
secondaryColor: color.secondary
|
|
119
|
+
}),
|
|
120
|
+
color: color
|
|
79
121
|
};
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
render: /*#__PURE__*/React.createElement(GenericAvatar, {
|
|
125
|
+
size: AVATAR_SIZES[size],
|
|
126
|
+
primaryColor: blueColor.primary,
|
|
127
|
+
secondaryColor: blueColor.secondary
|
|
128
|
+
}),
|
|
129
|
+
color: blueColor
|
|
80
130
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
131
|
+
};
|
|
132
|
+
var bannerStyles = xcss({
|
|
133
|
+
width: '100%'
|
|
134
|
+
});
|
|
135
|
+
export var AgentBanner = function AgentBanner(_ref2) {
|
|
136
|
+
var agentNamedId = _ref2.agentNamedId,
|
|
137
|
+
agentId = _ref2.agentId,
|
|
138
|
+
height = _ref2.height;
|
|
139
|
+
var _getAvatarRender = getAvatarRender({
|
|
140
|
+
agentNamedId: agentNamedId,
|
|
141
|
+
agentId: agentId,
|
|
142
|
+
size: 'medium'
|
|
143
|
+
}),
|
|
144
|
+
color = _getAvatarRender.color;
|
|
145
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
146
|
+
xcss: bannerStyles,
|
|
147
|
+
style: {
|
|
148
|
+
backgroundColor: color.primary,
|
|
149
|
+
height: "".concat(height, "px")
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
export var GeneratedAvatar = function GeneratedAvatar(_ref3) {
|
|
154
|
+
var agentNamedId = _ref3.agentNamedId,
|
|
155
|
+
agentId = _ref3.agentId,
|
|
156
|
+
size = _ref3.size;
|
|
157
|
+
var _getAvatarRender2 = getAvatarRender({
|
|
158
|
+
agentNamedId: agentNamedId,
|
|
159
|
+
agentId: agentId,
|
|
160
|
+
size: size
|
|
161
|
+
}),
|
|
162
|
+
render = _getAvatarRender2.render,
|
|
163
|
+
color = _getAvatarRender2.color;
|
|
84
164
|
return /*#__PURE__*/React.createElement(Box, {
|
|
85
165
|
xcss: imageStyles,
|
|
86
166
|
style: {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
import React from 'react';
|
|
2
5
|
import { AVATAR_SIZES } from '@atlaskit/avatar';
|
|
3
6
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
@@ -36,18 +39,20 @@ export var AgentAvatar = function AgentAvatar(_ref) {
|
|
|
36
39
|
label = _ref.label,
|
|
37
40
|
name = _ref.name,
|
|
38
41
|
agentId = _ref.agentId,
|
|
39
|
-
agentNamedId = _ref.agentNamedId
|
|
42
|
+
agentNamedId = _ref.agentNamedId,
|
|
43
|
+
_ref$showBorder = _ref.showBorder,
|
|
44
|
+
showBorder = _ref$showBorder === void 0 ? true : _ref$showBorder;
|
|
40
45
|
return /*#__PURE__*/React.createElement(Box, {
|
|
41
46
|
"aria-label": label,
|
|
42
47
|
xcss: agentAvatarStyles,
|
|
43
|
-
style: {
|
|
48
|
+
style: _objectSpread({
|
|
44
49
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
45
50
|
height: AVATAR_SIZES[size],
|
|
46
51
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
47
|
-
width: AVATAR_SIZES[size]
|
|
48
|
-
|
|
52
|
+
width: AVATAR_SIZES[size]
|
|
53
|
+
}, showBorder ? {
|
|
49
54
|
backgroundColor: '#fff'
|
|
50
|
-
}
|
|
55
|
+
} : {})
|
|
51
56
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
52
57
|
xcss: innerShapeStyles
|
|
53
58
|
}, /*#__PURE__*/React.createElement(Box, {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export { AgentConversationStarters, type AgentConversationStartersProps, getConv
|
|
|
4
4
|
export { ChatPill, type ChatPillProps } from './common/ui/chat-pill';
|
|
5
5
|
export { ChatPillIcon } from './common/ui/chat-icon';
|
|
6
6
|
export { AgentAvatar } from './ui/agent-avatar';
|
|
7
|
+
export { AgentBanner } from './ui/agent-avatar/generated-avatars';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type SizeType } from '@atlaskit/avatar';
|
|
3
3
|
export declare const TOTAL_AVATAR_COMBINATIONS: number;
|
|
4
|
-
type
|
|
4
|
+
type GeneratedAvatarProps = {
|
|
5
5
|
agentNamedId?: string;
|
|
6
6
|
agentId?: string;
|
|
7
7
|
size: SizeType;
|
|
8
8
|
};
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const AgentBanner: ({ agentNamedId, agentId, height, }: Pick<GeneratedAvatarProps, "agentNamedId" | "agentId"> & {
|
|
10
|
+
height: number;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
export declare const GeneratedAvatar: ({ agentNamedId, agentId, size }: GeneratedAvatarProps) => JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -7,6 +7,7 @@ type AgentAvatarProps = {
|
|
|
7
7
|
name?: string;
|
|
8
8
|
agentNamedId?: string;
|
|
9
9
|
agentId?: string;
|
|
10
|
+
showBorder?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const AgentAvatar: ({ imageUrl, size, label, name, agentId, agentNamedId, }: AgentAvatarProps) => JSX.Element;
|
|
12
|
+
export declare const AgentAvatar: ({ imageUrl, size, label, name, agentId, agentNamedId, showBorder, }: AgentAvatarProps) => JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -4,3 +4,4 @@ export { AgentConversationStarters, type AgentConversationStartersProps, getConv
|
|
|
4
4
|
export { ChatPill, type ChatPillProps } from './common/ui/chat-pill';
|
|
5
5
|
export { ChatPillIcon } from './common/ui/chat-icon';
|
|
6
6
|
export { AgentAvatar } from './ui/agent-avatar';
|
|
7
|
+
export { AgentBanner } from './ui/agent-avatar/generated-avatars';
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type SizeType } from '@atlaskit/avatar';
|
|
3
3
|
export declare const TOTAL_AVATAR_COMBINATIONS: number;
|
|
4
|
-
type
|
|
4
|
+
type GeneratedAvatarProps = {
|
|
5
5
|
agentNamedId?: string;
|
|
6
6
|
agentId?: string;
|
|
7
7
|
size: SizeType;
|
|
8
8
|
};
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const AgentBanner: ({ agentNamedId, agentId, height, }: Pick<GeneratedAvatarProps, "agentNamedId" | "agentId"> & {
|
|
10
|
+
height: number;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
export declare const GeneratedAvatar: ({ agentNamedId, agentId, size }: GeneratedAvatarProps) => JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -7,6 +7,7 @@ type AgentAvatarProps = {
|
|
|
7
7
|
name?: string;
|
|
8
8
|
agentNamedId?: string;
|
|
9
9
|
agentId?: string;
|
|
10
|
+
showBorder?: boolean;
|
|
10
11
|
};
|
|
11
|
-
export declare const AgentAvatar: ({ imageUrl, size, label, name, agentId, agentNamedId, }: AgentAvatarProps) => JSX.Element;
|
|
12
|
+
export declare const AgentAvatar: ({ imageUrl, size, label, name, agentId, agentNamedId, showBorder, }: AgentAvatarProps) => JSX.Element;
|
|
12
13
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rovo-agent-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.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",
|