@atlaskit/profilecard 20.7.0 → 20.8.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 +12 -0
- package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/cjs/client/getTeamFromAGG.js +1 -1
- package/dist/cjs/components/Agent/AgentProfileCard.js +9 -3
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/es2019/client/getTeamFromAGG.js +1 -1
- package/dist/es2019/components/Agent/AgentProfileCard.js +9 -3
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
- package/dist/esm/client/getTeamFromAGG.js +1 -1
- package/dist/esm/components/Agent/AgentProfileCard.js +9 -3
- package/dist/esm/util/analytics.js +1 -1
- package/dist/types/types.d.ts +2 -1
- package/dist/types-ts4.5/types.d.ts +2 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 20.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#154365](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/154365)
|
|
8
|
+
[`6daa73332cbc2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6daa73332cbc2) -
|
|
9
|
+
Added type to conversation starters
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 20.7.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
|
|
|
11
11
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
12
12
|
var addHeaders = function addHeaders(headers) {
|
|
13
13
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
14
|
-
headers.append('atl-client-version', "20.
|
|
14
|
+
headers.append('atl-client-version', "20.8.0");
|
|
15
15
|
return headers;
|
|
16
16
|
};
|
|
17
17
|
function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -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.8.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$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
42
|
+
var _agent$user_defined_c, _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,
|
|
@@ -70,6 +70,12 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
70
70
|
setStarCount = _useState4[1];
|
|
71
71
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
72
72
|
formatMessage = _useIntl.formatMessage;
|
|
73
|
+
var userDefinedConversationStarters = agent === null || agent === void 0 || (_agent$user_defined_c = agent.user_defined_conversation_starters) === null || _agent$user_defined_c === void 0 ? void 0 : _agent$user_defined_c.map(function (starter) {
|
|
74
|
+
return {
|
|
75
|
+
message: starter,
|
|
76
|
+
type: 'user-defined'
|
|
77
|
+
};
|
|
78
|
+
});
|
|
73
79
|
(0, _react.useEffect)(function () {
|
|
74
80
|
setIsStarred(!!(agent !== null && agent !== void 0 && agent.favourite));
|
|
75
81
|
setStarCount(agent === null || agent === void 0 ? void 0 : agent.favourite_count);
|
|
@@ -204,11 +210,11 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
204
210
|
agentDescription: agent.description
|
|
205
211
|
}), /*#__PURE__*/_react.default.createElement(_ConversationStarters.ConversationStarters, {
|
|
206
212
|
isAgentDefault: agent.is_default,
|
|
207
|
-
userDefinedConversationStarters:
|
|
213
|
+
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
208
214
|
onConversationStarterClick: function onConversationStarterClick(conversationStarter) {
|
|
209
215
|
onConversationStartersClick ? onConversationStartersClick(conversationStarter) : onConversationStarter({
|
|
210
216
|
agentId: agent.id,
|
|
211
|
-
prompt: conversationStarter
|
|
217
|
+
prompt: conversationStarter.message
|
|
212
218
|
});
|
|
213
219
|
}
|
|
214
220
|
})), /*#__PURE__*/_react.default.createElement(_Actions.AgentActions, {
|
|
@@ -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.8.0"
|
|
49
49
|
}, attributes), {}, {
|
|
50
50
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
51
51
|
})
|
|
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
|
|
|
6
6
|
}`;
|
|
7
7
|
const addHeaders = headers => {
|
|
8
8
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
9
|
-
headers.append('atl-client-version', "20.
|
|
9
|
+
headers.append('atl-client-version', "20.8.0");
|
|
10
10
|
return headers;
|
|
11
11
|
};
|
|
12
12
|
export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
|
|
@@ -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.8.0");
|
|
71
71
|
return headers;
|
|
72
72
|
};
|
|
73
73
|
export async function getTeamFromAGG(url, teamId, siteId) {
|
|
@@ -38,7 +38,7 @@ const AgentProfileCard = ({
|
|
|
38
38
|
resourceClient,
|
|
39
39
|
addFlag
|
|
40
40
|
}) => {
|
|
41
|
-
var _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
41
|
+
var _agent$user_defined_c, _agent$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
42
42
|
const {
|
|
43
43
|
onEditAgent,
|
|
44
44
|
onCopyAgent,
|
|
@@ -53,6 +53,12 @@ const AgentProfileCard = ({
|
|
|
53
53
|
const {
|
|
54
54
|
formatMessage
|
|
55
55
|
} = useIntl();
|
|
56
|
+
const userDefinedConversationStarters = agent === null || agent === void 0 ? void 0 : (_agent$user_defined_c = agent.user_defined_conversation_starters) === null || _agent$user_defined_c === void 0 ? void 0 : _agent$user_defined_c.map(starter => {
|
|
57
|
+
return {
|
|
58
|
+
message: starter,
|
|
59
|
+
type: 'user-defined'
|
|
60
|
+
};
|
|
61
|
+
});
|
|
56
62
|
useEffect(() => {
|
|
57
63
|
setIsStarred(!!(agent !== null && agent !== void 0 && agent.favourite));
|
|
58
64
|
setStarCount(agent === null || agent === void 0 ? void 0 : agent.favourite_count);
|
|
@@ -157,11 +163,11 @@ const AgentProfileCard = ({
|
|
|
157
163
|
agentDescription: agent.description
|
|
158
164
|
}), /*#__PURE__*/React.createElement(ConversationStarters, {
|
|
159
165
|
isAgentDefault: agent.is_default,
|
|
160
|
-
userDefinedConversationStarters:
|
|
166
|
+
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
161
167
|
onConversationStarterClick: conversationStarter => {
|
|
162
168
|
onConversationStartersClick ? onConversationStartersClick(conversationStarter) : onConversationStarter({
|
|
163
169
|
agentId: agent.id,
|
|
164
|
-
prompt: conversationStarter
|
|
170
|
+
prompt: conversationStarter.message
|
|
165
171
|
});
|
|
166
172
|
}
|
|
167
173
|
})), /*#__PURE__*/React.createElement(AgentActions, {
|
|
@@ -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.8.0",
|
|
36
36
|
...attributes,
|
|
37
37
|
firedAt: Math.round(getPageTime())
|
|
38
38
|
}
|
|
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
|
|
|
4
4
|
var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
|
|
5
5
|
var addHeaders = function addHeaders(headers) {
|
|
6
6
|
headers.append('atl-client-name', "@atlaskit/profilecard");
|
|
7
|
-
headers.append('atl-client-version', "20.
|
|
7
|
+
headers.append('atl-client-version', "20.8.0");
|
|
8
8
|
return headers;
|
|
9
9
|
};
|
|
10
10
|
export function getOrgIdForCloudIdFromAGG(_x, _x2) {
|
|
@@ -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.8.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$external_confi, _agent$external_confi2, _agent$creatorInfo, _agent$creatorInfo2, _agent$creatorInfo3, _agent$creatorInfo4;
|
|
32
|
+
var _agent$user_defined_c, _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,
|
|
@@ -60,6 +60,12 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
60
60
|
setStarCount = _useState4[1];
|
|
61
61
|
var _useIntl = useIntl(),
|
|
62
62
|
formatMessage = _useIntl.formatMessage;
|
|
63
|
+
var userDefinedConversationStarters = agent === null || agent === void 0 || (_agent$user_defined_c = agent.user_defined_conversation_starters) === null || _agent$user_defined_c === void 0 ? void 0 : _agent$user_defined_c.map(function (starter) {
|
|
64
|
+
return {
|
|
65
|
+
message: starter,
|
|
66
|
+
type: 'user-defined'
|
|
67
|
+
};
|
|
68
|
+
});
|
|
63
69
|
useEffect(function () {
|
|
64
70
|
setIsStarred(!!(agent !== null && agent !== void 0 && agent.favourite));
|
|
65
71
|
setStarCount(agent === null || agent === void 0 ? void 0 : agent.favourite_count);
|
|
@@ -194,11 +200,11 @@ var AgentProfileCard = function AgentProfileCard(_ref) {
|
|
|
194
200
|
agentDescription: agent.description
|
|
195
201
|
}), /*#__PURE__*/React.createElement(ConversationStarters, {
|
|
196
202
|
isAgentDefault: agent.is_default,
|
|
197
|
-
userDefinedConversationStarters:
|
|
203
|
+
userDefinedConversationStarters: userDefinedConversationStarters,
|
|
198
204
|
onConversationStarterClick: function onConversationStarterClick(conversationStarter) {
|
|
199
205
|
onConversationStartersClick ? onConversationStartersClick(conversationStarter) : onConversationStarter({
|
|
200
206
|
agentId: agent.id,
|
|
201
|
-
prompt: conversationStarter
|
|
207
|
+
prompt: conversationStarter.message
|
|
202
208
|
});
|
|
203
209
|
}
|
|
204
210
|
})), /*#__PURE__*/React.createElement(AgentActions, {
|
|
@@ -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.8.0"
|
|
43
43
|
}, attributes), {}, {
|
|
44
44
|
firedAt: Math.round(getPageTime())
|
|
45
45
|
})
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type IntlShape } from 'react-intl-next';
|
|
3
3
|
import { type AnalyticsEventPayload, type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { type ConversationStarter } from '@atlaskit/rovo-agent-components';
|
|
4
5
|
import { type TeamCentralScopes } from './client/ProfileCardClient';
|
|
5
6
|
import type RovoAgentCardClient from './client/RovoAgentCardClient';
|
|
6
7
|
import { type default as TeamCentralCardClient, type TeamCentralCardClientOptions } from './client/TeamCentralCardClient';
|
|
@@ -314,7 +315,7 @@ export interface TeamProfileCardTriggerProps extends TeamProfilecardCoreProps {
|
|
|
314
315
|
}
|
|
315
316
|
export interface AgentActionsType {
|
|
316
317
|
onChatClick?: () => void;
|
|
317
|
-
onConversationStartersClick?: (starter:
|
|
318
|
+
onConversationStartersClick?: (starter: ConversationStarter) => void;
|
|
318
319
|
}
|
|
319
320
|
export interface AgentProfileCardTriggerProps extends AgentActionsType {
|
|
320
321
|
agentId: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import { type IntlShape } from 'react-intl-next';
|
|
3
3
|
import { type AnalyticsEventPayload, type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { type ConversationStarter } from '@atlaskit/rovo-agent-components';
|
|
4
5
|
import { type TeamCentralScopes } from './client/ProfileCardClient';
|
|
5
6
|
import type RovoAgentCardClient from './client/RovoAgentCardClient';
|
|
6
7
|
import { type default as TeamCentralCardClient, type TeamCentralCardClientOptions } from './client/TeamCentralCardClient';
|
|
@@ -317,7 +318,7 @@ export interface TeamProfileCardTriggerProps extends TeamProfilecardCoreProps {
|
|
|
317
318
|
}
|
|
318
319
|
export interface AgentActionsType {
|
|
319
320
|
onChatClick?: () => void;
|
|
320
|
-
onConversationStartersClick?: (starter:
|
|
321
|
+
onConversationStartersClick?: (starter: ConversationStarter) => void;
|
|
321
322
|
}
|
|
322
323
|
export interface AgentProfileCardTriggerProps extends AgentActionsType {
|
|
323
324
|
agentId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.8.0",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,21 +52,21 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
54
54
|
"@atlaskit/atlassian-context": "^0.0.2",
|
|
55
|
-
"@atlaskit/avatar": "^21.
|
|
55
|
+
"@atlaskit/avatar": "^21.16.0",
|
|
56
56
|
"@atlaskit/avatar-group": "^10.0.0",
|
|
57
57
|
"@atlaskit/button": "^20.3.0",
|
|
58
58
|
"@atlaskit/dropdown-menu": "^12.21.0",
|
|
59
59
|
"@atlaskit/empty-state": "^7.12.0",
|
|
60
60
|
"@atlaskit/focus-ring": "^1.6.0",
|
|
61
61
|
"@atlaskit/give-kudos": "^2.2.0",
|
|
62
|
-
"@atlaskit/icon": "^22.
|
|
62
|
+
"@atlaskit/icon": "^22.24.0",
|
|
63
63
|
"@atlaskit/lozenge": "^11.12.0",
|
|
64
64
|
"@atlaskit/menu": "^2.13.0",
|
|
65
65
|
"@atlaskit/modal-dialog": "^12.17.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
67
67
|
"@atlaskit/popup": "^1.29.0",
|
|
68
68
|
"@atlaskit/primitives": "^12.2.0",
|
|
69
|
-
"@atlaskit/rovo-agent-components": "^1.
|
|
69
|
+
"@atlaskit/rovo-agent-components": "^1.7.0",
|
|
70
70
|
"@atlaskit/spinner": "^16.3.0",
|
|
71
71
|
"@atlaskit/theme": "^14.0.0",
|
|
72
72
|
"@atlaskit/tokens": "^2.0.0",
|