@atlaskit/profilecard 25.9.10 → 25.9.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/agent/package.json +1 -8
  3. package/agent-profile-card/package.json +1 -8
  4. package/agent-profile-card-resourced/package.json +1 -8
  5. package/agent-profile-card-trigger/package.json +1 -8
  6. package/caching-client/package.json +1 -8
  7. package/client/package.json +1 -8
  8. package/config/package.json +1 -8
  9. package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
  10. package/dist/cjs/client/getTeamFromAGG.js +1 -1
  11. package/dist/cjs/util/analytics.js +2 -2
  12. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  13. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  14. package/dist/es2019/util/analytics.js +2 -2
  15. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
  16. package/dist/esm/client/getTeamFromAGG.js +1 -1
  17. package/dist/esm/util/analytics.js +2 -2
  18. package/i18n/package.json +1 -8
  19. package/lazy-profile-card/package.json +1 -8
  20. package/messages/package.json +1 -8
  21. package/mock-profile-client/package.json +1 -8
  22. package/mock-team-client/package.json +1 -8
  23. package/mocks/package.json +1 -8
  24. package/package.json +2 -2
  25. package/profile-card/package.json +1 -8
  26. package/profile-card-trigger/package.json +1 -8
  27. package/profile-data/package.json +1 -8
  28. package/simple-mock-clients/package.json +1 -8
  29. package/team/package.json +1 -8
  30. package/team-profile-card/package.json +1 -8
  31. package/team-profile-card-client/package.json +1 -8
  32. package/team-profile-card-trigger/package.json +1 -8
  33. package/types/package.json +1 -8
  34. package/user/package.json +1 -8
  35. package/user-profile-card-client/package.json +1 -8
  36. package/with-outer-listeners/package.json +1 -8
  37. package/dist/types-ts4.5/client/CachingClient.d.ts +0 -18
  38. package/dist/types-ts4.5/client/ProfileCardClient.d.ts +0 -28
  39. package/dist/types-ts4.5/client/RovoAgentCardClient.d.ts +0 -23
  40. package/dist/types-ts4.5/client/TeamCentralCardClient.d.ts +0 -50
  41. package/dist/types-ts4.5/client/TeamProfileCardClient.d.ts +0 -9
  42. package/dist/types-ts4.5/client/UserProfileCardClient.d.ts +0 -24
  43. package/dist/types-ts4.5/client/errorUtils.d.ts +0 -5
  44. package/dist/types-ts4.5/client/getOrgIdForCloudIdFromAGG.d.ts +0 -1
  45. package/dist/types-ts4.5/client/getTeamFromAGG.d.ts +0 -38
  46. package/dist/types-ts4.5/client/graphqlUtils.d.ts +0 -31
  47. package/dist/types-ts4.5/client/index.d.ts +0 -6
  48. package/dist/types-ts4.5/client/types.d.ts +0 -13
  49. package/dist/types-ts4.5/components/Agent/Actions.d.ts +0 -15
  50. package/dist/types-ts4.5/components/Agent/AgentDeleteConfirmationModal.d.ts +0 -10
  51. package/dist/types-ts4.5/components/Agent/AgentProfileCard.d.ts +0 -4
  52. package/dist/types-ts4.5/components/Agent/AgentProfileCardResourced.d.ts +0 -22
  53. package/dist/types-ts4.5/components/Agent/AgentProfileCardTrigger.d.ts +0 -4
  54. package/dist/types-ts4.5/components/Agent/AgentProfileCardWrapper.d.ts +0 -4
  55. package/dist/types-ts4.5/components/Agent/ConversationStarters.d.ts +0 -3
  56. package/dist/types-ts4.5/components/Agent/hooks/duplicateFetch.d.ts +0 -24
  57. package/dist/types-ts4.5/components/Agent/hooks/useAgentActions.d.ts +0 -16
  58. package/dist/types-ts4.5/components/Agent/index.d.ts +0 -2
  59. package/dist/types-ts4.5/components/Agent/lazyAgentProfileCard.d.ts +0 -3
  60. package/dist/types-ts4.5/components/Agent/messages.d.ts +0 -27
  61. package/dist/types-ts4.5/components/Agent/utils/index.d.ts +0 -4
  62. package/dist/types-ts4.5/components/Error/AccessLockSVG.d.ts +0 -3
  63. package/dist/types-ts4.5/components/Error/ErrorBoundary.d.ts +0 -10
  64. package/dist/types-ts4.5/components/Error/ErrorIllustration.d.ts +0 -2
  65. package/dist/types-ts4.5/components/Error/ErrorMessage.d.ts +0 -10
  66. package/dist/types-ts4.5/components/Error/index.d.ts +0 -3
  67. package/dist/types-ts4.5/components/Icon/IconLabel.d.ts +0 -13
  68. package/dist/types-ts4.5/components/Icon/index.d.ts +0 -1
  69. package/dist/types-ts4.5/components/Team/TeamForbiddenErrorState.d.ts +0 -6
  70. package/dist/types-ts4.5/components/Team/TeamLoadingState.d.ts +0 -6
  71. package/dist/types-ts4.5/components/Team/TeamProfileCard.d.ts +0 -7
  72. package/dist/types-ts4.5/components/Team/TeamProfileCardTrigger.d.ts +0 -65
  73. package/dist/types-ts4.5/components/Team/index.d.ts +0 -4
  74. package/dist/types-ts4.5/components/Team/lazyTeamProfileCard.d.ts +0 -3
  75. package/dist/types-ts4.5/components/User/OverflowProfileCardButtons.d.ts +0 -10
  76. package/dist/types-ts4.5/components/User/ProfileCard.d.ts +0 -5
  77. package/dist/types-ts4.5/components/User/ProfileCardDetails.d.ts +0 -3
  78. package/dist/types-ts4.5/components/User/ProfileCardResourced.d.ts +0 -22
  79. package/dist/types-ts4.5/components/User/ProfileCardTrigger.d.ts +0 -3
  80. package/dist/types-ts4.5/components/User/ReportingLinesDetails.d.ts +0 -5
  81. package/dist/types-ts4.5/components/User/UserLoadingState.d.ts +0 -7
  82. package/dist/types-ts4.5/components/User/index.d.ts +0 -4
  83. package/dist/types-ts4.5/components/User/lazyProfileCard.d.ts +0 -3
  84. package/dist/types-ts4.5/components/common/LoadingState.d.ts +0 -9
  85. package/dist/types-ts4.5/components/common/PopupTrigger.d.ts +0 -7
  86. package/dist/types-ts4.5/components/common/ProfileCardTrigger.d.ts +0 -9
  87. package/dist/types-ts4.5/components/common/ProfileCardWrapper.d.ts +0 -5
  88. package/dist/types-ts4.5/components/common/types.d.ts +0 -17
  89. package/dist/types-ts4.5/components/team-profile-card/index.d.ts +0 -1
  90. package/dist/types-ts4.5/components/team-profile-card/main.d.ts +0 -17
  91. package/dist/types-ts4.5/components/team-profile-card/mocks.d.ts +0 -16
  92. package/dist/types-ts4.5/components/team-profile-card/team-actions/index.d.ts +0 -21
  93. package/dist/types-ts4.5/components/team-profile-card/team-actions/messages.d.ts +0 -7
  94. package/dist/types-ts4.5/components/team-profile-card/team-actions/more-actions/index.d.ts +0 -11
  95. package/dist/types-ts4.5/components/team-profile-card/team-actions/more-actions/messages.d.ts +0 -7
  96. package/dist/types-ts4.5/components/team-profile-card/team-connections/main.d.ts +0 -3
  97. package/dist/types-ts4.5/components/team-profile-card/team-containers-skeleton/index.d.ts +0 -3
  98. package/dist/types-ts4.5/components/team-profile-card/team-containers-skeleton/linked-container-card-skeleton/index.d.ts +0 -2
  99. package/dist/types-ts4.5/i18n/cs.d.ts +0 -8
  100. package/dist/types-ts4.5/i18n/da.d.ts +0 -8
  101. package/dist/types-ts4.5/i18n/de.d.ts +0 -8
  102. package/dist/types-ts4.5/i18n/en.d.ts +0 -8
  103. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -8
  104. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -8
  105. package/dist/types-ts4.5/i18n/es.d.ts +0 -8
  106. package/dist/types-ts4.5/i18n/et.d.ts +0 -27
  107. package/dist/types-ts4.5/i18n/fi.d.ts +0 -8
  108. package/dist/types-ts4.5/i18n/fr.d.ts +0 -8
  109. package/dist/types-ts4.5/i18n/hr.d.ts +0 -8
  110. package/dist/types-ts4.5/i18n/hu.d.ts +0 -8
  111. package/dist/types-ts4.5/i18n/index.d.ts +0 -36
  112. package/dist/types-ts4.5/i18n/is.d.ts +0 -27
  113. package/dist/types-ts4.5/i18n/it.d.ts +0 -8
  114. package/dist/types-ts4.5/i18n/ja.d.ts +0 -8
  115. package/dist/types-ts4.5/i18n/ko.d.ts +0 -8
  116. package/dist/types-ts4.5/i18n/languages.d.ts +0 -34
  117. package/dist/types-ts4.5/i18n/nb.d.ts +0 -8
  118. package/dist/types-ts4.5/i18n/nl.d.ts +0 -8
  119. package/dist/types-ts4.5/i18n/pl.d.ts +0 -8
  120. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -8
  121. package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -27
  122. package/dist/types-ts4.5/i18n/ro.d.ts +0 -27
  123. package/dist/types-ts4.5/i18n/ru.d.ts +0 -8
  124. package/dist/types-ts4.5/i18n/sk.d.ts +0 -27
  125. package/dist/types-ts4.5/i18n/sl.d.ts +0 -8
  126. package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -8
  127. package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -8
  128. package/dist/types-ts4.5/i18n/sv.d.ts +0 -8
  129. package/dist/types-ts4.5/i18n/th.d.ts +0 -8
  130. package/dist/types-ts4.5/i18n/tr.d.ts +0 -8
  131. package/dist/types-ts4.5/i18n/uk.d.ts +0 -8
  132. package/dist/types-ts4.5/i18n/vi.d.ts +0 -8
  133. package/dist/types-ts4.5/i18n/zh.d.ts +0 -8
  134. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -8
  135. package/dist/types-ts4.5/index.d.ts +0 -24
  136. package/dist/types-ts4.5/internal/filterActions.d.ts +0 -3
  137. package/dist/types-ts4.5/internal/getLabelMessage.d.ts +0 -3
  138. package/dist/types-ts4.5/internal/relative-date.d.ts +0 -3
  139. package/dist/types-ts4.5/messages.d.ts +0 -233
  140. package/dist/types-ts4.5/mocks/agent-data.d.ts +0 -4
  141. package/dist/types-ts4.5/mocks/index.d.ts +0 -4
  142. package/dist/types-ts4.5/mocks/mock-profile-client.d.ts +0 -1
  143. package/dist/types-ts4.5/mocks/mock-team-client.d.ts +0 -8
  144. package/dist/types-ts4.5/mocks/profile-data.d.ts +0 -45
  145. package/dist/types-ts4.5/mocks/reporting-lines-data.d.ts +0 -2
  146. package/dist/types-ts4.5/mocks/simple-mock-clients.d.ts +0 -19
  147. package/dist/types-ts4.5/mocks/team-data.d.ts +0 -15
  148. package/dist/types-ts4.5/mocks/util.d.ts +0 -6
  149. package/dist/types-ts4.5/styled/Card.d.ts +0 -59
  150. package/dist/types-ts4.5/styled/CoverImage.d.ts +0 -11
  151. package/dist/types-ts4.5/styled/Error.d.ts +0 -11
  152. package/dist/types-ts4.5/styled/ReportingLines.d.ts +0 -13
  153. package/dist/types-ts4.5/styled/TeamCard.d.ts +0 -35
  154. package/dist/types-ts4.5/styled/TeamTrigger.d.ts +0 -19
  155. package/dist/types-ts4.5/styled/UserTrigger.d.ts +0 -12
  156. package/dist/types-ts4.5/types.d.ts +0 -592
  157. package/dist/types-ts4.5/util/analytics.d.ts +0 -101
  158. package/dist/types-ts4.5/util/click.d.ts +0 -4
  159. package/dist/types-ts4.5/util/config.d.ts +0 -2
  160. package/dist/types-ts4.5/util/date.d.ts +0 -1
  161. package/dist/types-ts4.5/util/errors.d.ts +0 -43
  162. package/dist/types-ts4.5/util/performance.d.ts +0 -1
  163. package/dist/types-ts4.5/util/rovoAgentUtils.d.ts +0 -2
  164. package/dist/types-ts4.5/util/url.d.ts +0 -1
  165. package/dist/types-ts4.5/util/useProfileInfo.d.ts +0 -8
  166. package/dist/types-ts4.5/util/withOuterListeners.d.ts +0 -6
@@ -1,592 +0,0 @@
1
- import type React from 'react';
2
- import { type IntlShape } from 'react-intl';
3
- import { type ConversationStarter } from '@atlaskit/rovo-agent-components/ui/AgentConversationStarters';
4
- import type { AnalyticsEventAttributes, FireEventType, useAnalyticsEvents } from '@atlaskit/teams-app-internal-analytics';
5
- import { type TeamCentralScopes } from './client/ProfileCardClient';
6
- import type RovoAgentCardClient from './client/RovoAgentCardClient';
7
- import { type default as TeamCentralCardClient, type TeamCentralCardClientOptions } from './client/TeamCentralCardClient';
8
- import type TeamProfileCardClient from './client/TeamProfileCardClient';
9
- import type UserProfileCardClient from './client/UserProfileCardClient';
10
- export interface ApiClientResponse {
11
- User: {
12
- id: string;
13
- accountType: string;
14
- isBot: boolean;
15
- isCurrentUser: boolean;
16
- avatarUrl: string | null;
17
- email: string | null;
18
- fullName: string | null;
19
- location: string | null;
20
- meta: string | null;
21
- nickname: string | null;
22
- companyName: string | null;
23
- remoteTimeString: string | null;
24
- remoteWeekdayIndex: string | null;
25
- remoteWeekdayString: string | null;
26
- status: StatusType;
27
- statusModifiedDate: number | null;
28
- };
29
- }
30
- type FlagAppearance = 'error' | 'info' | 'normal' | 'success' | 'warning';
31
- export interface Flag {
32
- id: number | string;
33
- title?: string | React.ReactNode;
34
- description?: string | React.ReactNode;
35
- type?: FlagAppearance;
36
- appearance?: FlagAppearance;
37
- actions?: {
38
- content: React.ReactNode;
39
- onClick?: () => void;
40
- href?: string;
41
- target?: string;
42
- }[];
43
- icon?: JSX.Element;
44
- }
45
- export interface Team {
46
- largeAvatarImageUrl?: string;
47
- smallAvatarImageUrl?: string;
48
- largeHeaderImageUrl?: string;
49
- smallHeaderImageUrl?: string;
50
- id: string;
51
- displayName: string;
52
- description: string;
53
- organizationId?: string;
54
- members?: {
55
- id: string;
56
- fullName: string;
57
- avatarUrl: string;
58
- }[];
59
- isVerified?: boolean;
60
- state?: 'ACTIVE' | 'DISBANDED';
61
- }
62
- export interface RovoAgent {
63
- id: string;
64
- identity_account_id?: string | null;
65
- named_id: string;
66
- name: string;
67
- description: string | null;
68
- system_prompt_template?: string | null;
69
- creator_type: 'SYSTEM' | 'CUSTOMER' | 'THIRD_PARTY' | 'FORGE' | 'REMOTE_A2A' | 'ROVO_DEV';
70
- creator?: string | null;
71
- visibility?: 'PUBLIC' | 'PRIVATE' | null;
72
- is_default: boolean;
73
- actor_type: 'AGENT';
74
- follow_up_prompt_template?: string | null;
75
- plugin_routing_type?: 'DEFAULT' | 'SKIP' | null;
76
- user_defined_conversation_starters: string[] | null;
77
- favourite: boolean;
78
- favourite_count: number;
79
- deactivated?: boolean;
80
- icon?: string | null;
81
- external_config_reference?: string;
82
- }
83
- export type RovoAgentAgg = {
84
- authoringTeam: {
85
- displayName: string | null | undefined;
86
- profileUrl: string | null | undefined;
87
- } | null | undefined;
88
- };
89
- export type RovoAgentCardClientResult = {
90
- restData: RovoAgent;
91
- aggData: RovoAgentAgg | null | undefined;
92
- };
93
- export interface RovoAgentCreatorInfo {
94
- type: 'CUSTOMER' | 'SYSTEM' | 'THIRD_PARTY' | 'FORGE' | 'OOTB' | 'REMOTE_A2A';
95
- name?: string;
96
- profileLink?: string;
97
- id?: string;
98
- }
99
- export interface RovoAgentProfileCardInfo extends RovoAgent {
100
- creatorInfo: RovoAgentCreatorInfo | undefined;
101
- }
102
- export interface ProfileCardClientData {
103
- isBot: boolean;
104
- /**
105
- * Mark it as optional as part of the migration from cloud user to AGG user
106
- * This field will be calculated based on the user id and the principal user id props
107
- * This will be removed once the migration is complete
108
- */
109
- isCurrentUser?: boolean;
110
- avatarUrl?: string;
111
- email?: string;
112
- fullName?: string;
113
- location?: string;
114
- meta?: string;
115
- nickname?: string;
116
- companyName?: string;
117
- timestring?: string;
118
- status: StatusType;
119
- statusModifiedDate?: number | null;
120
- customLozenges?: LozengeProps[];
121
- accountType?: string;
122
- isAgent?: boolean;
123
- isServiceAccount?: boolean;
124
- }
125
- export interface ReportingLinesUserPII {
126
- name: string;
127
- picture?: string;
128
- }
129
- export interface ReportingLinesUser {
130
- accountIdentifier: string;
131
- identifierType: 'ATLASSIAN_ID' | 'BASE64_HASH' | 'UNKNOWN';
132
- pii?: ReportingLinesUserPII;
133
- }
134
- export interface TeamCentralReportingLinesData {
135
- managers?: ReportingLinesUser[];
136
- reports?: ReportingLinesUser[];
137
- }
138
- export interface ProfileCardResourcedProps {
139
- userId: string;
140
- cloudId: string;
141
- resourceClient: ProfileClient;
142
- actions?: ProfileCardAction[];
143
- reportingLinesProfileUrl?: string;
144
- onReportingLinesClick?: (user: ReportingLinesUser) => void;
145
- position?: ProfilecardTriggerPosition;
146
- trigger?: TriggerType;
147
- children?: React.ReactNode;
148
- addFlag?: (flag: any) => void;
149
- /** When true (and feature-gated), skip fetching and hide the reporting lines section */
150
- hideReportingLines?: boolean;
151
- }
152
- export interface ProfileCardResourcedState {
153
- visible?: boolean;
154
- isLoading?: boolean;
155
- hasError: boolean;
156
- error?: ProfileCardErrorType;
157
- data: ProfileCardClientData | null;
158
- reportingLinesData?: TeamCentralReportingLinesData;
159
- isKudosEnabled?: boolean;
160
- kudosDrawerOpen: boolean;
161
- teamCentralBaseUrl?: string;
162
- }
163
- export interface ProfileCardTriggerProps {
164
- userId: string;
165
- /**
166
- A cloudId can be provided, and we'll verify that the target userId is an
167
- actual user in the specified site.
168
-
169
- Instead you can omit the cloudId and we won't do such a check.
170
-
171
- If you have a cloudId and only want to show users who are in that site
172
- then please provide it. If you're a site-less product or don't care about
173
- verifying that the shown user is in a particular site, don't provide a
174
- cloudId.
175
- */
176
- cloudId?: string;
177
- autoFocus?: boolean;
178
- resourceClient: ProfileClient;
179
- actions?: ProfileCardAction[];
180
- reportingLinesProfileUrl?: string;
181
- onReportingLinesClick?: (user: ReportingLinesUser) => void;
182
- position?: ProfilecardTriggerPosition;
183
- trigger?: TriggerType;
184
- children: React.ReactNode;
185
- testId?: string;
186
- addFlag?: (flag: any) => void;
187
- ariaLabel?: string;
188
- ariaLabelledBy?: string;
189
- prepopulatedData?: PrepopulatedData;
190
- disabledAriaAttributes?: boolean;
191
- onVisibilityChange?: (isVisible: boolean) => void;
192
- isVisible?: boolean;
193
- /**
194
- * Indicates whether the profile card is rendered in a portal.
195
- *
196
- * If true, the profile card will auto-focus the name element when opened for better accessibility,
197
- * keeping the user's focus in the tab trap.
198
- */
199
- isRenderedInPortal?: boolean;
200
- offset?: [
201
- number,
202
- number
203
- ];
204
- product?: string;
205
- viewingUserId?: string;
206
- agentActions?: AgentActionsType;
207
- ariaHideProfileTrigger?: boolean;
208
- ssrPlaceholderId?: string;
209
- /**
210
- * The delay in milliseconds before the profile card is shown.
211
- * PS: This is ignored when the isVisible is true or the trigger is clicked.
212
- */
213
- showDelay?: number;
214
- /**
215
- * The delay in milliseconds before the profile card is hidden.
216
- * PS: This is ignored when the isVisible is false or the trigger is clicked.
217
- */
218
- hideDelay?: number;
219
- hideAgentMoreActions?: boolean;
220
- hideAiDisclaimer?: boolean;
221
- /** Hide the conversation starters. Defaults to false (conversation starters are shown by default). */
222
- hideAgentConversationStarters?: boolean;
223
- /**
224
- * When true, skip fetching Townsquare's reporting lines data and hide the reporting lines section
225
- * currentky only working when the flag jira_ai_profilecard_hide_reportinglines is enabled
226
- * */
227
- hideReportingLines?: boolean;
228
- }
229
- export interface ProfileCardTriggerState {
230
- visible?: boolean;
231
- isLoading?: boolean;
232
- hasError: boolean;
233
- error?: ProfileCardErrorType;
234
- data: ProfileCardClientData | null;
235
- reportingLinesData?: TeamCentralReportingLinesData;
236
- shouldShowGiveKudos?: boolean;
237
- teamCentralBaseUrl?: string;
238
- kudosDrawerOpen: boolean;
239
- }
240
- export interface TeamProfileCardTriggerState {
241
- visible?: boolean;
242
- isLoading?: boolean;
243
- hasError: boolean;
244
- error?: any;
245
- data: Team | null;
246
- renderError?: boolean;
247
- shouldShowGiveKudos?: boolean;
248
- teamCentralBaseUrl?: string;
249
- kudosDrawerOpen: boolean;
250
- isTriggeredByKeyboard?: boolean;
251
- }
252
- export interface TeamProfilecardCoreProps {
253
- /**
254
- The id of the user viewing the profile card.
255
-
256
- This is used to determine whether to say that the member count is
257
- "including you" or not.
258
- */
259
- viewingUserId?: string;
260
- /**
261
- A list of extra buttons to be displayed at the bottom of the card.
262
- View Profile is always included by default.
263
- */
264
- actions?: ProfileCardAction[];
265
- /**
266
- A function allowing products to provide an href for the user avatars in the
267
- profilecard, e.g. so they can link to user's profile pages.
268
- */
269
- generateUserLink?: (userId: string) => string;
270
- /**
271
- A function allowing products to provide an onClick handler for when the
272
- user clicks on a user's avatar or avatar group item.
273
- */
274
- onUserClick?: (userId: string, event: React.MouseEvent<Element>) => void;
275
- /**
276
- This should be a link to the team's profile page. This will be used for:
277
-
278
- - Wrapping the trigger in a link to the team profile page (unless
279
- triggerLinkType is `none`).
280
-
281
- - Providing the link for the View Profile action button on the card.
282
- */
283
- viewProfileLink: string;
284
- /**
285
- An onClick action that navigates to the team's profile page. Something you
286
- may want, e.g. for an SPA site or tracking analytics of navigation. This
287
- is optional, just the viewProfileLink will suffice. Will be used for:
288
-
289
- - Adding an onClick to the trigger if the triggerLinkType is
290
- `clickable-link`.
291
-
292
- - Providing an onClick for the View Profile action button on the card.
293
- */
294
- viewProfileOnClick?: (event?: React.MouseEvent<Element>) => void;
295
- }
296
- export interface TeamProfileCardTriggerProps extends TeamProfilecardCoreProps {
297
- /** The id of the team. */
298
- teamId: string;
299
- /**
300
- Optional orgId. The id of the organization that the team belongs to.
301
- Not in use.
302
- */
303
- orgId?: string;
304
- /** An instance of ProfileClient. */
305
- resourceClient: ProfileClient;
306
- /**
307
- The position relative to the trigger that the card should be displayed in.
308
- */
309
- position?: ProfilecardTriggerPosition;
310
- /**
311
- The interaction method used to trigger the team profile card to appear.
312
-
313
- - Click is generally recommended, but your needs may vary.
314
-
315
- - Hover works for mouse users, but does not support those who use a
316
- keyboard or screen reader, avoid using this if it's possible or makes
317
- sense.
318
-
319
- - Hover-click is usable for scenarios like inline-edits, where mouse users
320
- cannot click on the trigger without causing side effects, but keyboard
321
- users are still able to navigate into and trigger the profile card.
322
-
323
- Look at the "Team Profilecard Trigger" or "Trigger Link Types" examples to
324
- see how they behave, or ask in #help-people-and-teams-xpc on Slack for our
325
- recommendations.
326
- */
327
- trigger?: 'hover' | 'click' | 'hover-click';
328
- /**
329
- We generally prefer to wrap the trigger in a link to the team profile
330
- page. This prop determines how that link behaves.
331
-
332
- - Link is generally the recommended prop (especially in combination with
333
- click or hover-click for the trigger prop above). It wraps the trigger in
334
- an anchor tag with the team profile link (that users can interact with
335
- via middle-click, etc.), but left clicking on the link is suppressed.
336
-
337
- - None does not wrap the trigger in a link at all. This makes it difficult
338
- for keyboard or screen reader users to know how to trigger the profile
339
- card. Generally avoid this.
340
-
341
- - Clickable-link wraps the trigger in a link with no special behaviour.
342
- This is suitable for places where you want the trigger to serve primarily
343
- as a link, and optionally allow hovering to preview the team first.
344
-
345
- Look at the example on "Trigger Link Types" for more in-depth analysis, or
346
- ask in #help-people-and-teams-xpc on Slack for our recommendations.
347
-
348
- @deprecated
349
- Consumers should always pass it as "none" from now on.
350
- Consumers should be responsible to implement wrapper of our profilecard trigger, for example a link
351
- We are keeping the original comments longer for existing exps
352
- */
353
- triggerLinkType?: 'none' | 'link' | 'clickable-link';
354
- /**
355
- This is the component that will cause a team profile card to appear when
356
- interacted with according to the method specified by the trigger prop.
357
- */
358
- children?: React.ReactNode;
359
- /**
360
- * Used by the card to show Flags.
361
- */
362
- addFlag?: (flag: any) => void;
363
- /**
364
- * Mandatory cloudId. Used to fetch team.
365
- */
366
- cloudId?: string;
367
- /**
368
- * Whether the popup should have the parent as its root.
369
- */
370
- shouldRenderToParent?: boolean;
371
- }
372
- export interface AgentActionsType {
373
- onChatClick?: (event: React.MouseEvent) => void;
374
- onConversationStartersClick?: (starter: ConversationStarter) => void;
375
- }
376
- export interface AgentProfileCardTriggerProps extends AgentActionsType {
377
- agentId: string;
378
- agentIdType?: 'agent' | 'identity';
379
- cloudId?: string;
380
- email?: string;
381
- autoFocus?: boolean;
382
- resourceClient: ProfileClient;
383
- actions?: ProfileCardAction[];
384
- position?: ProfilecardTriggerPosition;
385
- trigger?: TriggerType;
386
- children: React.ReactNode;
387
- testId?: string;
388
- addFlag?: (flag: Flag) => void;
389
- ariaLabel?: string;
390
- ariaLabelledBy?: string;
391
- prepopulatedData?: PrepopulatedData;
392
- disabledAriaAttributes?: boolean;
393
- isVisible?: boolean;
394
- offset?: [
395
- number,
396
- number
397
- ];
398
- product?: string;
399
- viewingUserId?: string;
400
- onDeleteAgent?: (agentId: string) => {
401
- restore: () => void;
402
- };
403
- }
404
- export type AgentProfileCardProps = {
405
- resourceClient: ProfileClient;
406
- agent?: RovoAgentProfileCardInfo;
407
- isLoading?: boolean;
408
- hasError?: boolean;
409
- cloudId?: string;
410
- email?: string;
411
- errorType?: ProfileCardErrorType;
412
- addFlag?: (flag: Flag) => void;
413
- onDeleteAgent?: (agentId: string) => {
414
- restore: () => void;
415
- };
416
- /** Hide the Agent more actions dropdown when true, is also hidden when hideAgentActions is true */
417
- hideMoreActions?: boolean;
418
- /** Hide the AI disclaimer. Defaults to false (disclaimer is shown by default). */
419
- hideAiDisclaimer?: boolean;
420
- /** Hide the conversation starters. Defaults to false (conversation starters are shown by default). */
421
- hideConversationStarters?: boolean;
422
- /** Hide the agent actions (chat button and dropdown menu). Defaults to false (agent actions are shown by default). */
423
- hideAgentActions?: boolean;
424
- } & AgentActionsType;
425
- export type StatusType = 'active' | 'inactive' | 'closed';
426
- export type TriggerType = 'hover' | 'click';
427
- export type ProfileType = 'user' | 'team' | 'agent';
428
- export type StatusModifiedDateType = 'noDate' | 'thisWeek' | 'thisMonth' | 'lastMonth' | 'aFewMonths' | 'severalMonths' | 'moreThanAYear';
429
- export interface ProfileCardAction {
430
- callback?: (...args: any[]) => any;
431
- shouldRender?: (data: any) => boolean;
432
- id?: string;
433
- label: React.ReactNode;
434
- link?: string;
435
- target?: string;
436
- }
437
- export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
438
- export interface LozengeProps {
439
- text: React.ReactNode;
440
- appearance?: LozengeColor;
441
- isBold?: boolean;
442
- }
443
- export interface ProfilecardProps {
444
- isLoading?: boolean;
445
- hasError?: boolean;
446
- errorType?: ProfileCardErrorType;
447
- accountType?: string;
448
- status?: StatusType;
449
- isBot?: boolean;
450
- isServiceAccount?: boolean;
451
- avatarUrl?: string;
452
- fullName?: string;
453
- meta?: string;
454
- userId?: string;
455
- isCurrentUser?: boolean;
456
- nickname?: string;
457
- email?: string;
458
- location?: string;
459
- companyName?: string;
460
- timestring?: string;
461
- actions?: ProfileCardAction[];
462
- clientFetchProfile?: () => void;
463
- statusModifiedDate?: number | null;
464
- withoutElevation?: boolean;
465
- /** Show manager and direct reports section on profile hover card, if available */
466
- reportingLines?: TeamCentralReportingLinesData;
467
- /** Base URL to populate href value for manager's and direct reports' user avatar */
468
- reportingLinesProfileUrl?: string;
469
- /** Click handler when user clicks on manager's and direct reports' user avatar, un-clickable otherwise.
470
- * Returning false will prevent the default behavior of opening the reporting lines page. */
471
- onReportingLinesClick?: (user: ReportingLinesUser) => void | false;
472
- isKudosEnabled?: boolean;
473
- teamCentralBaseUrl?: string;
474
- addFlag?: (flag: any) => void;
475
- cloudId?: string;
476
- /**
477
- * Indicates whether the profile card is rendered in a portal.
478
- *
479
- * If true, the profile card will auto-focus the name element when opened for better accessibility,
480
- * keeping the user's focus in the tab trap.
481
- */
482
- isRenderedInPortal?: boolean;
483
- disabledAccountMessage?: React.ReactNode;
484
- hasDisabledAccountLozenge?: boolean;
485
- customLozenges?: LozengeProps[];
486
- openKudosDrawer?: () => void;
487
- isTriggeredUsingKeyboard?: boolean;
488
- disabledAriaAttributes?: boolean;
489
- agentActions?: AgentActionsType;
490
- /** When true (and feature-gated), hide the reporting lines section */
491
- hideReportingLines?: boolean;
492
- /** When true (and feature-gated), hide the agent conversation starters section */
493
- hideAgentConversationStarters?: boolean;
494
- }
495
- export type AnalyticsFromDuration = <K extends keyof AnalyticsEventAttributes>(eventKey: K, duration: number) => {
496
- attributes: AnalyticsEventAttributes[K];
497
- };
498
- export type AnalyticsFunction = <K extends keyof AnalyticsEventAttributes>(eventKey: K, generator: (duration: number) => AnalyticsEventAttributes[K]) => void;
499
- export interface AnalyticsProps {
500
- fireEvent?: ReturnType<typeof useAnalyticsEvents>['fireEvent'];
501
- }
502
- export interface AnalyticsWithDurationProps {
503
- fireAnalyticsWithDuration: AnalyticsFunction;
504
- }
505
- export interface TeamProfilecardProps extends TeamProfilecardCoreProps {
506
- /** Indicates whether the team's details are still loading. */
507
- isLoading?: boolean;
508
- /** Indicates whether an error occurred whilst fetching team details. */
509
- hasError?: boolean;
510
- /** Describes the type of error that occurred, if any. */
511
- errorType?: TeamProfileCardErrorType;
512
- /** The details of the team to be shown. */
513
- team?: Team;
514
- /** A callback that will try to re-fetch data in case an error occurred. */
515
- clientFetchProfile?: () => void;
516
- /** Details relevant to passing around analytics with @atlaskit/teams-app-internal-analytics. */
517
- analytics: AnalyticsFunction;
518
- /** Set auto focus for actionable items */
519
- isTriggeredByKeyboard?: boolean;
520
- }
521
- export interface MessageIntlProviderProps {
522
- children: React.ReactNode;
523
- intl: IntlShape;
524
- }
525
- export type RelativeDateKeyType = 'ThisWeek' | 'ThisMonth' | 'LastMonth' | 'AFewMonths' | 'SeveralMonths' | 'MoreThanAYear' | null;
526
- export type AgentIdType = {
527
- type: 'agent' | 'identity';
528
- value: string;
529
- };
530
- type AgentPermissionName = 'AGENT_CREATE' | 'AGENT_UPDATE' | 'AGENT_DEACTIVATE';
531
- export type AgentPermissions = {
532
- permissions: Record<AgentPermissionName, {
533
- permitted: boolean;
534
- }>;
535
- };
536
- export interface ProfileClient {
537
- flushCache: () => void;
538
- getProfile: (cloudId: string, userId: string, analytics?: FireEventType) => Promise<ProfileCardClientData>;
539
- getTeamProfile: (teamId: string, orgId?: string, fireAnalytics?: FireEventType) => Promise<Team>;
540
- getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
541
- shouldShowGiveKudos: () => Promise<boolean>;
542
- getTeamCentralBaseUrl: (teamCentralScopes?: TeamCentralScopes) => Promise<string | undefined>;
543
- getRovoAgentProfile: (id: AgentIdType, fireAnalytics?: FireEventType) => Promise<RovoAgentCardClientResult>;
544
- getRovoAgentPermissions: (id: string, fireAnalytics?: FireEventType) => Promise<AgentPermissions>;
545
- deleteAgent: (id: string, fireAnalytics?: FireEventType) => Promise<void>;
546
- setFavouriteAgent: (id: string, isFavourite: boolean, fireAnalytics?: FireEventType) => Promise<void>;
547
- }
548
- export type ProfilecardTriggerPosition = 'auto' | 'auto-start' | 'auto-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'top-end' | 'top' | 'top-start' | 'right-end' | 'right' | 'right-start';
549
- export type ProfileCardErrorType = {
550
- reason: 'default' | 'NotFound';
551
- } | null;
552
- export type TeamProfileCardErrorType = {
553
- reason: 'default' | 'NotFound' | 'TEAMS_FORBIDDEN';
554
- } | null;
555
- export interface ProfileClientOptions extends Omit<TeamCentralCardClientOptions, 'gatewayGraphqlUrl'> {
556
- gatewayGraphqlUrl?: string;
557
- url?: string;
558
- cacheSize?: number;
559
- cacheMaxAge?: number;
560
- /** Name of integrating product e.g. jira, atlas, confluence **/
561
- productIdentifier?: string;
562
- cloudId?: string;
563
- }
564
- export interface ClientOverrides {
565
- userClient?: UserProfileCardClient;
566
- teamClient?: TeamProfileCardClient;
567
- teamCentralClient?: TeamCentralCardClient;
568
- rovoAgentClient?: RovoAgentCardClient;
569
- }
570
- /** This interface represents the data that is prepopulated in the profile card. **/
571
- export interface PrepopulatedData {
572
- fullName?: string;
573
- }
574
- export type TeamsUserQueryResponse = {
575
- id: string;
576
- name: string;
577
- picture: string;
578
- accountStatus: StatusType;
579
- __typename: 'AppUser' | string;
580
- email?: string;
581
- nickname?: string;
582
- zoneinfo?: string;
583
- extendedProfile?: {
584
- jobTitle?: string;
585
- organization?: string;
586
- location?: string;
587
- closedDate?: number;
588
- inactiveDate?: number;
589
- };
590
- appType?: string;
591
- };
592
- export {};
@@ -1,101 +0,0 @@
1
- import { type ProfileType } from '../types';
2
- type AnalyticsEventPayload = Record<string, any>;
3
- export declare const PACKAGE_META_DATA: {
4
- packageName: string;
5
- packageVersion: string;
6
- };
7
- type GenericAttributes = Record<string, string | number | boolean | undefined | string[]>;
8
- export declare const getActionSubject: (type: string) => "user" | "teamProfileCard" | "profilecard" | "rovoAgentProfilecard";
9
- /**
10
- * @private
11
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
12
- */
13
- export declare const cardTriggered: (type: ProfileType, method: "hover" | "click", teamId?: string) => AnalyticsEventPayload;
14
- /**
15
- * @private
16
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
17
- */
18
- export declare const teamRequestAnalytics: (action: "triggered" | "succeeded" | "failed", attributes?: {
19
- duration: number;
20
- } & GenericAttributes) => AnalyticsEventPayload;
21
- /**
22
- * @private
23
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
24
- */
25
- export declare const userRequestAnalytics: (action: "triggered" | "succeeded" | "failed", attributes?: {
26
- duration: number;
27
- } & GenericAttributes) => AnalyticsEventPayload;
28
- /**
29
- * @private
30
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
31
- */
32
- export declare const profileCardRendered: (type: ProfileType, actionSubjectId: "spinner" | "content" | "error" | "errorBoundary", attributes?: {
33
- duration?: number;
34
- errorType?: "default" | "NotFound";
35
- hasRetry?: boolean;
36
- numActions?: number;
37
- memberCount?: number;
38
- includingYou?: boolean;
39
- descriptionLength?: number;
40
- titleLength?: number;
41
- }) => AnalyticsEventPayload;
42
- /**
43
- * @private
44
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
45
- */
46
- export declare const actionClicked: (type: ProfileType, attributes: {
47
- duration: number;
48
- hasHref: boolean;
49
- hasOnClick: boolean;
50
- index: number;
51
- actionId: string;
52
- }) => AnalyticsEventPayload;
53
- /**
54
- * @private
55
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
56
- */
57
- export declare const reportingLinesClicked: (attributes: {
58
- userType: "manager" | "direct-report";
59
- duration: number;
60
- }) => AnalyticsEventPayload;
61
- /**
62
- * @private
63
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
64
- */
65
- export declare const moreActionsClicked: (type: ProfileType, attributes: {
66
- duration: number;
67
- numActions: number;
68
- }) => AnalyticsEventPayload;
69
- /**
70
- * @private
71
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
72
- */
73
- export declare const teamAvatarClicked: (attributes: {
74
- duration: number;
75
- hasHref: boolean;
76
- hasOnClick: boolean;
77
- index: number;
78
- }) => AnalyticsEventPayload;
79
- /**
80
- * @private
81
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
82
- */
83
- export declare const moreMembersClicked: (attributes: {
84
- duration: number;
85
- memberCount: number;
86
- }) => AnalyticsEventPayload;
87
- /**
88
- * @private
89
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
90
- */
91
- export declare const errorRetryClicked: (attributes: {
92
- duration: number;
93
- }) => AnalyticsEventPayload;
94
- /**
95
- * @private
96
- * @deprecated Analytics events should be fired using the `@atlaskit/teams-app-internal-analytics` package.
97
- */
98
- export declare const agentRequestAnalytics: (action: "triggered" | "succeeded" | "failed", actionSubjectId?: string, attributes?: {
99
- duration: number;
100
- } & GenericAttributes) => AnalyticsEventPayload;
101
- export {};
@@ -1,4 +0,0 @@
1
- import type React from 'react';
2
- type Event = React.MouseEvent | React.KeyboardEvent;
3
- export declare const isBasicClick: (event: Event) => boolean;
4
- export {};
@@ -1,2 +0,0 @@
1
- export declare const DELAY_MS_SHOW = 800;
2
- export declare const DELAY_MS_HIDE = 200;