@atlaskit/profilecard 20.2.0 → 20.4.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 +21 -0
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCard.js +5 -5
- package/dist/cjs/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/cjs/components/Agent/hooks/useAgentActions.js +3 -2
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCard.js +5 -5
- package/dist/es2019/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/es2019/components/Agent/hooks/useAgentActions.js +3 -2
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCard.js +5 -5
- package/dist/esm/components/Agent/AgentProfileCardResourced.js +2 -1
- package/dist/esm/components/Agent/hooks/useAgentActions.js +3 -2
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/components/Agent/hooks/useAgentActions.d.ts +1 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types-ts4.5/components/Agent/hooks/useAgentActions.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 20.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#144898](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/144898)
|
|
8
|
+
[`6fff66dce97ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fff66dce97ec) -
|
|
9
|
+
Pass agent id to full screen agent chat
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 20.3.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#147255](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147255)
|
|
20
|
+
[`c757a53e7cbf1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c757a53e7cbf1) -
|
|
21
|
+
Prioritise the usage of agent.external_config_references instead of age.t.named_id, because the
|
|
22
|
+
OOTB agent migration will change agent.named_id to uuid
|
|
23
|
+
|
|
3
24
|
## 20.2.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -57,7 +57,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
|
|
|
57
57
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
58
58
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
59
59
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
60
|
-
headers.append('atl-client-version', "20.
|
|
60
|
+
headers.append('atl-client-version', "20.4.0");
|
|
61
61
|
return headers;
|
|
62
62
|
};
|
|
63
63
|
function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -39,7 +39,7 @@ var cardContainerStyles = (0, _primitives.xcss)({
|
|
|
39
39
|
position: 'relative'
|
|
40
40
|
});
|
|
41
41
|
var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
42
|
-
var _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
42
|
+
var _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
43
43
|
var agent = _ref.agent,
|
|
44
44
|
isLoading = _ref.isLoading,
|
|
45
45
|
isCreatedByViewingUser = _ref.isCreatedByViewingUser,
|
|
@@ -58,7 +58,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
58
58
|
_onEditAgent = _useAgentUrlActions.onEditAgent,
|
|
59
59
|
_onCopyAgent = _useAgentUrlActions.onCopyAgent,
|
|
60
60
|
_onDuplicateAgent = _useAgentUrlActions.onDuplicateAgent,
|
|
61
|
-
|
|
61
|
+
onOpenChatFullScreen = _useAgentUrlActions.onOpenChat,
|
|
62
62
|
onConversationStarter = _useAgentUrlActions.onConversationStarter;
|
|
63
63
|
var _useState = (0, _react.useState)(false),
|
|
64
64
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -168,14 +168,14 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
168
168
|
xcss: cardContainerStyles
|
|
169
169
|
}, /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentBanner, {
|
|
170
170
|
agentId: agent.id,
|
|
171
|
-
agentNamedId: agent.named_id,
|
|
171
|
+
agentNamedId: (_agent$external_confi = agent.external_config_reference) !== null && _agent$external_confi !== void 0 ? _agent$external_confi : agent.named_id,
|
|
172
172
|
height: 96,
|
|
173
173
|
agentIdentityAccountId: agent.identity_account_id
|
|
174
174
|
}), /*#__PURE__*/_react.default.createElement(_primitives.Box, {
|
|
175
175
|
xcss: avatarStyles
|
|
176
176
|
}, /*#__PURE__*/_react.default.createElement(_rovoAgentComponents.AgentAvatar, {
|
|
177
177
|
agentId: agent.id,
|
|
178
|
-
agentNamedId: agent.named_id,
|
|
178
|
+
agentNamedId: (_agent$external_confi2 = agent.external_config_reference) !== null && _agent$external_confi2 !== void 0 ? _agent$external_confi2 : agent.named_id,
|
|
179
179
|
agentIdentityAccountId: agent.identity_account_id,
|
|
180
180
|
size: "xlarge",
|
|
181
181
|
isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY',
|
|
@@ -225,7 +225,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
225
225
|
},
|
|
226
226
|
onDeleteAgent: handleOnDelete,
|
|
227
227
|
onChatClick: function onChatClick() {
|
|
228
|
-
return _onChatClick ? _onChatClick() :
|
|
228
|
+
return _onChatClick ? _onChatClick() : onOpenChatFullScreen(agent.id);
|
|
229
229
|
}
|
|
230
230
|
})));
|
|
231
231
|
};
|
|
@@ -180,7 +180,8 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
|
|
|
180
180
|
onConversationStartersClick: props.onConversationStartersClick,
|
|
181
181
|
onChatClick: props.onChatClick,
|
|
182
182
|
addFlag: props.addFlag,
|
|
183
|
-
resourceClient: props.resourceClient
|
|
183
|
+
resourceClient: props.resourceClient,
|
|
184
|
+
cloudId: props.cloudId
|
|
184
185
|
});
|
|
185
186
|
}
|
|
186
187
|
return null;
|
|
@@ -65,12 +65,13 @@ var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlAction
|
|
|
65
65
|
})));
|
|
66
66
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
67
67
|
};
|
|
68
|
-
var onOpenChat = function onOpenChat() {
|
|
68
|
+
var onOpenChat = function onOpenChat(agentId) {
|
|
69
69
|
var baseUrl = "".concat((0, _atlassianContext.getATLContextUrl)('home'), "/chat");
|
|
70
70
|
var urlWithParams = (0, _url.encodeParamsToUrl)(baseUrl, _objectSpread({
|
|
71
71
|
cloudId: cloudId
|
|
72
72
|
}, createRovoParams({
|
|
73
|
-
cloudId: cloudId
|
|
73
|
+
cloudId: cloudId,
|
|
74
|
+
agentId: agentId
|
|
74
75
|
})));
|
|
75
76
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
76
77
|
};
|
|
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
45
45
|
actionSubjectId: actionSubjectId,
|
|
46
46
|
attributes: _objectSpread(_objectSpread({
|
|
47
47
|
packageName: "@atlaskit/profilecard",
|
|
48
|
-
packageVersion: "20.
|
|
48
|
+
packageVersion: "20.4.0"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -67,7 +67,7 @@ export const addHeaders = headers => {
|
|
|
67
67
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
68
68
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
69
69
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
70
|
-
headers.append('atl-client-version', "20.
|
|
70
|
+
headers.append('atl-client-version', "20.4.0");
|
|
71
71
|
return headers;
|
|
72
72
|
};
|
|
73
73
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -38,12 +38,12 @@ const AgentProfileCard = ({
|
|
|
38
38
|
resourceClient,
|
|
39
39
|
addFlag
|
|
40
40
|
}) => {
|
|
41
|
-
var _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
41
|
+
var _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
42
42
|
const {
|
|
43
43
|
onEditAgent,
|
|
44
44
|
onCopyAgent,
|
|
45
45
|
onDuplicateAgent,
|
|
46
|
-
onOpenChat:
|
|
46
|
+
onOpenChat: onOpenChatFullScreen,
|
|
47
47
|
onConversationStarter
|
|
48
48
|
} = useAgentUrlActions({
|
|
49
49
|
cloudId: cloudId || ''
|
|
@@ -121,14 +121,14 @@ const AgentProfileCard = ({
|
|
|
121
121
|
xcss: cardContainerStyles
|
|
122
122
|
}, /*#__PURE__*/React.createElement(AgentBanner, {
|
|
123
123
|
agentId: agent.id,
|
|
124
|
-
agentNamedId: agent.named_id,
|
|
124
|
+
agentNamedId: (_agent$external_confi = agent.external_config_reference) !== null && _agent$external_confi !== void 0 ? _agent$external_confi : agent.named_id,
|
|
125
125
|
height: 96,
|
|
126
126
|
agentIdentityAccountId: agent.identity_account_id
|
|
127
127
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
128
128
|
xcss: avatarStyles
|
|
129
129
|
}, /*#__PURE__*/React.createElement(AgentAvatar, {
|
|
130
130
|
agentId: agent.id,
|
|
131
|
-
agentNamedId: agent.named_id,
|
|
131
|
+
agentNamedId: (_agent$external_confi2 = agent.external_config_reference) !== null && _agent$external_confi2 !== void 0 ? _agent$external_confi2 : agent.named_id,
|
|
132
132
|
agentIdentityAccountId: agent.identity_account_id,
|
|
133
133
|
size: "xlarge",
|
|
134
134
|
isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY',
|
|
@@ -171,7 +171,7 @@ const AgentProfileCard = ({
|
|
|
171
171
|
onCopyAgent: () => onCopyAgent(agent.id),
|
|
172
172
|
onDuplicateAgent: () => onDuplicateAgent(agent.id),
|
|
173
173
|
onDeleteAgent: handleOnDelete,
|
|
174
|
-
onChatClick: () => onChatClick ? onChatClick() :
|
|
174
|
+
onChatClick: () => onChatClick ? onChatClick() : onOpenChatFullScreen(agent.id)
|
|
175
175
|
})));
|
|
176
176
|
};
|
|
177
177
|
export default AgentProfileCard;
|
|
@@ -98,7 +98,8 @@ export const AgentProfileCardResourced = props => {
|
|
|
98
98
|
onConversationStartersClick: props.onConversationStartersClick,
|
|
99
99
|
onChatClick: props.onChatClick,
|
|
100
100
|
addFlag: props.addFlag,
|
|
101
|
-
resourceClient: props.resourceClient
|
|
101
|
+
resourceClient: props.resourceClient,
|
|
102
|
+
cloudId: props.cloudId
|
|
102
103
|
});
|
|
103
104
|
}
|
|
104
105
|
return null;
|
|
@@ -54,12 +54,13 @@ export const useAgentUrlActions = ({
|
|
|
54
54
|
});
|
|
55
55
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
56
56
|
};
|
|
57
|
-
const onOpenChat =
|
|
57
|
+
const onOpenChat = agentId => {
|
|
58
58
|
const baseUrl = `${getATLContextUrl('home')}/chat`;
|
|
59
59
|
const urlWithParams = encodeParamsToUrl(baseUrl, {
|
|
60
60
|
cloudId,
|
|
61
61
|
...createRovoParams({
|
|
62
|
-
cloudId
|
|
62
|
+
cloudId,
|
|
63
|
+
agentId
|
|
63
64
|
})
|
|
64
65
|
});
|
|
65
66
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
32
32
|
actionSubjectId,
|
|
33
33
|
attributes: {
|
|
34
34
|
packageName: "@atlaskit/profilecard",
|
|
35
|
-
packageVersion: "20.
|
|
35
|
+
packageVersion: "20.4.0",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -48,7 +48,7 @@ export var addHeaders = function addHeaders(headers) {
|
|
|
48
48
|
headers.append('X-ExperimentalApi', 'teams-beta');
|
|
49
49
|
headers.append('X-ExperimentalApi', 'team-members-beta');
|
|
50
50
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
51
|
-
headers.append('atl-client-version', "20.
|
|
51
|
+
headers.append('atl-client-version', "20.4.0");
|
|
52
52
|
return headers;
|
|
53
53
|
};
|
|
54
54
|
export function getTeamFromAGG(_x, _x2, _x3) {
|
|
@@ -29,7 +29,7 @@ var cardContainerStyles = xcss({
|
|
|
29
29
|
position: 'relative'
|
|
30
30
|
});
|
|
31
31
|
var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
32
|
-
var _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
32
|
+
var _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
33
33
|
var agent = _ref.agent,
|
|
34
34
|
isLoading = _ref.isLoading,
|
|
35
35
|
isCreatedByViewingUser = _ref.isCreatedByViewingUser,
|
|
@@ -48,7 +48,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
48
48
|
_onEditAgent = _useAgentUrlActions.onEditAgent,
|
|
49
49
|
_onCopyAgent = _useAgentUrlActions.onCopyAgent,
|
|
50
50
|
_onDuplicateAgent = _useAgentUrlActions.onDuplicateAgent,
|
|
51
|
-
|
|
51
|
+
onOpenChatFullScreen = _useAgentUrlActions.onOpenChat,
|
|
52
52
|
onConversationStarter = _useAgentUrlActions.onConversationStarter;
|
|
53
53
|
var _useState = useState(false),
|
|
54
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -158,14 +158,14 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
158
158
|
xcss: cardContainerStyles
|
|
159
159
|
}, /*#__PURE__*/React.createElement(AgentBanner, {
|
|
160
160
|
agentId: agent.id,
|
|
161
|
-
agentNamedId: agent.named_id,
|
|
161
|
+
agentNamedId: (_agent$external_confi = agent.external_config_reference) !== null && _agent$external_confi !== void 0 ? _agent$external_confi : agent.named_id,
|
|
162
162
|
height: 96,
|
|
163
163
|
agentIdentityAccountId: agent.identity_account_id
|
|
164
164
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
165
165
|
xcss: avatarStyles
|
|
166
166
|
}, /*#__PURE__*/React.createElement(AgentAvatar, {
|
|
167
167
|
agentId: agent.id,
|
|
168
|
-
agentNamedId: agent.named_id,
|
|
168
|
+
agentNamedId: (_agent$external_confi2 = agent.external_config_reference) !== null && _agent$external_confi2 !== void 0 ? _agent$external_confi2 : agent.named_id,
|
|
169
169
|
agentIdentityAccountId: agent.identity_account_id,
|
|
170
170
|
size: "xlarge",
|
|
171
171
|
isForgeAgent: agent.creator_type === 'FORGE' || agent.creator_type === 'THIRD_PARTY',
|
|
@@ -215,7 +215,7 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
215
215
|
},
|
|
216
216
|
onDeleteAgent: handleOnDelete,
|
|
217
217
|
onChatClick: function onChatClick() {
|
|
218
|
-
return _onChatClick ? _onChatClick() :
|
|
218
|
+
return _onChatClick ? _onChatClick() : onOpenChatFullScreen(agent.id);
|
|
219
219
|
}
|
|
220
220
|
})));
|
|
221
221
|
};
|
|
@@ -170,7 +170,8 @@ export var AgentProfileCardResourced = function AgentProfileCardResourced(props)
|
|
|
170
170
|
onConversationStartersClick: props.onConversationStartersClick,
|
|
171
171
|
onChatClick: props.onChatClick,
|
|
172
172
|
addFlag: props.addFlag,
|
|
173
|
-
resourceClient: props.resourceClient
|
|
173
|
+
resourceClient: props.resourceClient,
|
|
174
|
+
cloudId: props.cloudId
|
|
174
175
|
});
|
|
175
176
|
}
|
|
176
177
|
return null;
|
|
@@ -58,12 +58,13 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
|
|
|
58
58
|
})));
|
|
59
59
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
60
60
|
};
|
|
61
|
-
var onOpenChat = function onOpenChat() {
|
|
61
|
+
var onOpenChat = function onOpenChat(agentId) {
|
|
62
62
|
var baseUrl = "".concat(getATLContextUrl('home'), "/chat");
|
|
63
63
|
var urlWithParams = encodeParamsToUrl(baseUrl, _objectSpread({
|
|
64
64
|
cloudId: cloudId
|
|
65
65
|
}, createRovoParams({
|
|
66
|
-
cloudId: cloudId
|
|
66
|
+
cloudId: cloudId,
|
|
67
|
+
agentId: agentId
|
|
67
68
|
})));
|
|
68
69
|
window.open(urlWithParams, '_blank', 'noopener, noreferrer');
|
|
69
70
|
};
|
|
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
39
39
|
actionSubjectId: actionSubjectId,
|
|
40
40
|
attributes: _objectSpread(_objectSpread({
|
|
41
41
|
packageName: "@atlaskit/profilecard",
|
|
42
|
-
packageVersion: "20.
|
|
42
|
+
packageVersion: "20.4.0"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
|
@@ -5,7 +5,7 @@ export declare const useAgentUrlActions: ({ cloudId }: {
|
|
|
5
5
|
onEditAgent: (agentId: string) => void;
|
|
6
6
|
onCopyAgent: (agentId: string) => void;
|
|
7
7
|
onDuplicateAgent: (agentId: string) => void;
|
|
8
|
-
onOpenChat: () => void;
|
|
8
|
+
onOpenChat: (agentId: string) => void;
|
|
9
9
|
onConversationStarter: ({ agentId, prompt }: {
|
|
10
10
|
agentId: string;
|
|
11
11
|
prompt: string;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const useAgentUrlActions: ({ cloudId }: {
|
|
|
5
5
|
onEditAgent: (agentId: string) => void;
|
|
6
6
|
onCopyAgent: (agentId: string) => void;
|
|
7
7
|
onDuplicateAgent: (agentId: string) => void;
|
|
8
|
-
onOpenChat: () => void;
|
|
8
|
+
onOpenChat: (agentId: string) => void;
|
|
9
9
|
onConversationStarter: ({ agentId, prompt }: {
|
|
10
10
|
agentId: string;
|
|
11
11
|
prompt: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.4.0",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@atlaskit/dropdown-menu": "^12.18.0",
|
|
58
58
|
"@atlaskit/empty-state": "^7.11.0",
|
|
59
59
|
"@atlaskit/focus-ring": "^1.6.0",
|
|
60
|
-
"@atlaskit/give-kudos": "^2.
|
|
61
|
-
"@atlaskit/icon": "^22.
|
|
60
|
+
"@atlaskit/give-kudos": "^2.2.0",
|
|
61
|
+
"@atlaskit/icon": "^22.20.0",
|
|
62
62
|
"@atlaskit/lozenge": "^11.11.0",
|
|
63
63
|
"@atlaskit/menu": "^2.12.0",
|
|
64
64
|
"@atlaskit/modal-dialog": "^12.17.0",
|