@atlaskit/profilecard 16.12.1 → 17.0.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/client/ProfileCardClient.js +2 -2
  3. package/dist/cjs/client/TeamProfileCardClient.js +13 -12
  4. package/dist/cjs/client/UserProfileCardClient.js +25 -2
  5. package/dist/cjs/client/errorUtils.js +25 -0
  6. package/dist/cjs/components/Error/ErrorMessage.js +40 -77
  7. package/dist/cjs/components/Team/TeamLoadingState.js +1 -1
  8. package/dist/cjs/components/Team/TeamProfileCard.js +4 -4
  9. package/dist/cjs/components/Team/TeamProfileCardTrigger.js +3 -3
  10. package/dist/cjs/components/User/OverflowProfileCardButtons.js +44 -10
  11. package/dist/cjs/components/User/ProfileCard.js +195 -362
  12. package/dist/cjs/components/User/ProfileCardDetails.js +142 -0
  13. package/dist/cjs/components/User/ProfileCardResourced.js +25 -20
  14. package/dist/cjs/components/User/ProfileCardTrigger.js +35 -7
  15. package/dist/cjs/components/User/ReportingLinesDetails.js +13 -13
  16. package/dist/cjs/components/User/UserLoadingState.js +14 -2
  17. package/dist/cjs/util/analytics.js +31 -16
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/es2019/client/ProfileCardClient.js +2 -2
  20. package/dist/es2019/client/TeamProfileCardClient.js +3 -9
  21. package/dist/es2019/client/UserProfileCardClient.js +23 -2
  22. package/dist/es2019/client/errorUtils.js +17 -0
  23. package/dist/es2019/components/Error/ErrorMessage.js +38 -42
  24. package/dist/es2019/components/Team/TeamLoadingState.js +2 -2
  25. package/dist/es2019/components/Team/TeamProfileCard.js +5 -5
  26. package/dist/es2019/components/Team/TeamProfileCardTrigger.js +4 -4
  27. package/dist/es2019/components/User/OverflowProfileCardButtons.js +30 -4
  28. package/dist/es2019/components/User/ProfileCard.js +161 -292
  29. package/dist/es2019/components/User/ProfileCardDetails.js +118 -0
  30. package/dist/es2019/components/User/ProfileCardResourced.js +21 -21
  31. package/dist/es2019/components/User/ProfileCardTrigger.js +32 -6
  32. package/dist/es2019/components/User/ReportingLinesDetails.js +10 -11
  33. package/dist/es2019/components/User/UserLoadingState.js +10 -2
  34. package/dist/es2019/util/analytics.js +13 -8
  35. package/dist/es2019/version.json +1 -1
  36. package/dist/esm/client/ProfileCardClient.js +2 -2
  37. package/dist/esm/client/TeamProfileCardClient.js +11 -12
  38. package/dist/esm/client/UserProfileCardClient.js +22 -2
  39. package/dist/esm/client/errorUtils.js +17 -0
  40. package/dist/esm/components/Error/ErrorMessage.js +35 -80
  41. package/dist/esm/components/Team/TeamLoadingState.js +2 -2
  42. package/dist/esm/components/Team/TeamProfileCard.js +5 -5
  43. package/dist/esm/components/Team/TeamProfileCardTrigger.js +4 -4
  44. package/dist/esm/components/User/OverflowProfileCardButtons.js +39 -9
  45. package/dist/esm/components/User/ProfileCard.js +180 -362
  46. package/dist/esm/components/User/ProfileCardDetails.js +120 -0
  47. package/dist/esm/components/User/ProfileCardResourced.js +17 -17
  48. package/dist/esm/components/User/ProfileCardTrigger.js +33 -7
  49. package/dist/esm/components/User/ReportingLinesDetails.js +12 -12
  50. package/dist/esm/components/User/UserLoadingState.js +7 -2
  51. package/dist/esm/util/analytics.js +21 -12
  52. package/dist/esm/version.json +1 -1
  53. package/dist/types/client/ProfileCardClient.d.ts +3 -2
  54. package/dist/types/client/TeamProfileCardClient.d.ts +2 -1
  55. package/dist/types/client/UserProfileCardClient.d.ts +2 -1
  56. package/dist/types/client/errorUtils.d.ts +6 -0
  57. package/dist/types/components/Error/ErrorMessage.d.ts +6 -15
  58. package/dist/types/components/Team/TeamProfileCardTrigger.d.ts +5 -11
  59. package/dist/types/components/User/OverflowProfileCardButtons.d.ts +4 -3
  60. package/dist/types/components/User/ProfileCard.d.ts +5 -29
  61. package/dist/types/components/User/ProfileCardDetails.d.ts +3 -0
  62. package/dist/types/components/User/ProfileCardResourced.d.ts +7 -3
  63. package/dist/types/components/User/ProfileCardTrigger.d.ts +3 -40
  64. package/dist/types/components/User/ReportingLinesDetails.d.ts +2 -4
  65. package/dist/types/components/User/UserLoadingState.d.ts +5 -1
  66. package/dist/types/components/User/lazyProfileCard.d.ts +1 -1
  67. package/dist/types/types.d.ts +11 -10
  68. package/dist/types/util/analytics.d.ts +22 -13
  69. package/package.json +8 -8
  70. package/report.api.md +71 -124
  71. package/dist/cjs/internal/analytics.js +0 -15
  72. package/dist/es2019/internal/analytics.js +0 -8
  73. package/dist/esm/internal/analytics.js +0 -8
  74. package/dist/types/internal/analytics.d.ts +0 -8
@@ -1,13 +1,14 @@
1
1
  import React from 'react';
2
- import { ProfileCardAction, ProfileCardClientData, ProfileCardResourcedProps, ProfileCardResourcedState, TeamCentralReportingLinesData } from '../../types';
3
- export default class ProfileCardResourced extends React.PureComponent<ProfileCardResourcedProps, ProfileCardResourcedState> {
2
+ import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
3
+ import { AnalyticsProps, ProfileCardAction, ProfileCardClientData, ProfileCardResourcedProps, ProfileCardResourcedState, TeamCentralReportingLinesData } from '../../types';
4
+ declare class ProfileCardResourced extends React.PureComponent<ProfileCardResourcedProps & AnalyticsProps, ProfileCardResourcedState> {
4
5
  static defaultProps: Partial<ProfileCardResourcedProps>;
5
6
  _isMounted: boolean;
6
7
  state: ProfileCardResourcedState;
8
+ fireAnalytics: (payload: AnalyticsEventPayload) => void;
7
9
  componentDidMount(): void;
8
10
  componentDidUpdate(prevProps: ProfileCardResourcedProps, prevState: ProfileCardResourcedState): void;
9
11
  componentWillUnmount(): void;
10
- private callAnalytics;
11
12
  clientFetchProfile: () => void;
12
13
  handleClientSuccess(profileData: ProfileCardClientData, reportingLinesData: TeamCentralReportingLinesData, shouldShowGiveKudos: boolean): void;
13
14
  handleClientError(err: any): void;
@@ -16,3 +17,6 @@ export default class ProfileCardResourced extends React.PureComponent<ProfileCar
16
17
  closeKudosDrawer: () => void;
17
18
  render(): React.ReactNode;
18
19
  }
20
+ export declare const ProfileCardResourcedInternal: typeof ProfileCardResourced;
21
+ declare const _default: React.ForwardRefExoticComponent<Pick<Omit<ProfileCardResourcedProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<ProfileCardResourcedProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, keyof ProfileCardResourcedProps>> & Partial<Pick<Partial<ProfileCardResourcedProps>, never>> & React.RefAttributes<any>>;
22
+ export default _default;
@@ -1,41 +1,4 @@
1
1
  import React from 'react';
2
- import { ProfileCardAction, ProfileCardClientData, ProfileCardTriggerProps, ProfileCardTriggerState, TeamCentralReportingLinesData } from '../../types';
3
- declare class ProfilecardTrigger extends React.PureComponent<ProfileCardTriggerProps, ProfileCardTriggerState> {
4
- static defaultProps: Partial<ProfileCardTriggerProps>;
5
- _isMounted: boolean;
6
- showDelay: number;
7
- hideDelay: number;
8
- showTimer: number;
9
- hideTimer: number;
10
- hideProfilecard: () => void;
11
- showProfilecard: () => void;
12
- onClick: (event: React.MouseEvent) => void;
13
- containerListeners: {
14
- onMouseEnter: () => void;
15
- onMouseLeave: () => void;
16
- onClick?: undefined;
17
- } | {
18
- onClick: (event: React.MouseEvent) => void;
19
- onMouseEnter?: undefined;
20
- onMouseLeave?: undefined;
21
- };
22
- layerListeners: {
23
- handleClickOutside: () => void;
24
- handleEscapeKeydown: () => void;
25
- };
26
- state: ProfileCardTriggerState;
27
- componentDidMount(): void;
28
- componentDidUpdate(prevProps: ProfileCardTriggerProps): void;
29
- componentWillUnmount(): void;
30
- clientFetchProfile: () => void;
31
- handleClientSuccess(profileData: ProfileCardClientData, reportingLinesData: TeamCentralReportingLinesData, shouldShowGiveKudos: boolean): void;
32
- handleClientError(err: any): void;
33
- filterActions(): ProfileCardAction[];
34
- renderProfileCard(): JSX.Element;
35
- openKudosDrawer: () => void;
36
- closeKudosDrawer: () => void;
37
- renderCard: () => JSX.Element;
38
- renderWithTrigger(): JSX.Element;
39
- render(): JSX.Element;
40
- }
41
- export default ProfilecardTrigger;
2
+ import { AnalyticsProps, ProfileCardTriggerProps } from '../../types';
3
+ declare const _default: React.ForwardRefExoticComponent<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, never> & Partial<Pick<Omit<ProfileCardTriggerProps & AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps>, keyof ProfileCardTriggerProps>> & Partial<Pick<Partial<ProfileCardTriggerProps>, never>> & React.RefAttributes<any>>;
4
+ export default _default;
@@ -1,7 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ProfilecardProps } from '../../types';
3
- export declare type ReportingLinesDetailsProps = Pick<ProfilecardProps, 'reportingLines' | 'reportingLinesProfileUrl' | 'onReportingLinesClick' | 'analytics'> & {
4
- getDuration: () => number | null;
5
- };
2
+ import { AnalyticsWithDurationProps, ProfilecardProps } from '../../types';
3
+ export declare type ReportingLinesDetailsProps = Pick<ProfilecardProps, 'reportingLines' | 'reportingLinesProfileUrl' | 'onReportingLinesClick'> & AnalyticsWithDurationProps;
6
4
  declare const ReportingLinesDetails: (props: ReportingLinesDetailsProps) => JSX.Element;
7
5
  export default ReportingLinesDetails;
@@ -1,3 +1,7 @@
1
1
  /// <reference types="react" />
2
- declare const UserLoadingState: () => JSX.Element;
2
+ import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
3
+ interface AnalyticsProps {
4
+ fireAnalytics: (payload: AnalyticsEventPayload) => void;
5
+ }
6
+ declare const UserLoadingState: ({ fireAnalytics }: AnalyticsProps) => JSX.Element;
3
7
  export default UserLoadingState;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const ProfileCardLazy: import("react").LazyExoticComponent<typeof import("./ProfileCard").default>;
2
+ export declare const ProfileCardLazy: import("react").LazyExoticComponent<import("react").ForwardRefExoticComponent<Omit<import("../..").ProfilecardProps & import("../../types").AnalyticsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>>>;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { IntlShape } from 'react-intl-next';
3
+ import { AnalyticsEventPayload, CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
3
4
  import TeamCentralCardClient from './client/TeamCentralCardClient';
4
5
  import TeamProfileCardClient from './client/TeamProfileCardClient';
5
6
  import UserProfileCardClient from './client/UserProfileCardClient';
@@ -8,7 +9,6 @@ export interface ApiClientResponse {
8
9
  id: string;
9
10
  isBot: boolean;
10
11
  isCurrentUser: boolean;
11
- isNotMentionable: boolean;
12
12
  avatarUrl: string | null;
13
13
  email: string | null;
14
14
  fullName: string | null;
@@ -41,7 +41,6 @@ export interface Team {
41
41
  export interface ProfileCardClientData {
42
42
  isBot: boolean;
43
43
  isCurrentUser: boolean;
44
- isNotMentionable: boolean;
45
44
  avatarUrl?: string;
46
45
  email?: string;
47
46
  fullName?: string;
@@ -74,7 +73,6 @@ export interface ProfileCardResourcedProps {
74
73
  actions?: ProfileCardAction[];
75
74
  reportingLinesProfileUrl?: string;
76
75
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
77
- analytics?: any;
78
76
  position?: ProfilecardTriggerPosition;
79
77
  trigger?: TriggerType;
80
78
  children?: React.ReactNode;
@@ -108,7 +106,6 @@ export interface ProfileCardTriggerProps {
108
106
  actions?: ProfileCardAction[];
109
107
  reportingLinesProfileUrl?: string;
110
108
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
111
- analytics?: any;
112
109
  position?: ProfilecardTriggerPosition;
113
110
  trigger?: TriggerType;
114
111
  children?: React.ReactNode;
@@ -270,7 +267,6 @@ export interface ProfilecardProps {
270
267
  errorType?: ProfileCardErrorType;
271
268
  status?: StatusType;
272
269
  isBot?: boolean;
273
- isNotMentionable?: boolean;
274
270
  avatarUrl?: string;
275
271
  fullName?: string;
276
272
  meta?: string;
@@ -282,8 +278,7 @@ export interface ProfilecardProps {
282
278
  companyName?: string;
283
279
  timestring?: string;
284
280
  actions?: ProfileCardAction[];
285
- clientFetchProfile?: any;
286
- analytics?: any;
281
+ clientFetchProfile?: () => void;
287
282
  statusModifiedDate?: number | null;
288
283
  withoutElevation?: boolean;
289
284
  /** Show manager and direct reports section on profile hover card, if available */
@@ -301,8 +296,14 @@ export interface ProfilecardProps {
301
296
  customLozenges?: LozengeProps[];
302
297
  openKudosDrawer?: () => void;
303
298
  }
304
- export declare type AnalyticsFromDuration = (duration: number) => Record<string, any>;
299
+ export declare type AnalyticsFromDuration = (duration: number) => AnalyticsEventPayload;
305
300
  export declare type AnalyticsFunction = (generator: AnalyticsFromDuration) => void;
301
+ export interface AnalyticsProps {
302
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
303
+ }
304
+ export interface AnalyticsWithDurationProps {
305
+ fireAnalyticsWithDuration: AnalyticsFunction;
306
+ }
306
307
  export interface TeamProfilecardProps extends TeamProfilecardCoreProps {
307
308
  /** Indicates whether the team's details are still loading. */
308
309
  isLoading?: boolean;
@@ -324,8 +325,8 @@ export interface MessageIntlProviderProps {
324
325
  export declare type RelativeDateKeyType = 'ThisWeek' | 'ThisMonth' | 'LastMonth' | 'AFewMonths' | 'SeveralMonths' | 'MoreThanAYear' | null;
325
326
  export interface ProfileClient {
326
327
  flushCache: () => void;
327
- getProfile: (cloudId: string, userId: string) => Promise<ProfileCardClientData>;
328
- getTeamProfile: (teamId: string, orgId?: string, fireAnalytics?: (event: Record<string, any>) => void) => Promise<Team>;
328
+ getProfile: (cloudId: string, userId: string, analytics?: (event: AnalyticsEventPayload) => void) => Promise<ProfileCardClientData>;
329
+ getTeamProfile: (teamId: string, orgId?: string, fireAnalytics?: (event: AnalyticsEventPayload) => void) => Promise<Team>;
329
330
  getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
330
331
  shouldShowGiveKudos: () => Promise<boolean>;
331
332
  getTeamCentralBaseUrl: () => string | undefined;
@@ -1,35 +1,44 @@
1
1
  import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
2
2
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
3
+ declare type GenericAttributes = Record<string, string | number | boolean | undefined>;
3
4
  interface AnalyticsEvent {
4
5
  action?: string;
5
6
  actionSubject?: string;
6
7
  actionSubjectId?: string;
7
- attributes?: Record<string, string | number | boolean | undefined>;
8
+ attributes?: GenericAttributes;
8
9
  name?: string;
9
10
  source?: string;
10
11
  }
11
12
  export declare const fireEvent: (createAnalyticsEvent: CreateUIAnalyticsEvent | undefined, body: AnalyticsEvent) => void;
12
- export declare const teamCardTriggered: (method: 'hover' | 'click') => AnalyticsEventPayload;
13
+ export declare const cardTriggered: (type: 'user' | 'team', method: 'hover' | 'click') => AnalyticsEventPayload;
13
14
  export declare const teamRequestAnalytics: (action: 'triggered' | 'succeeded' | 'failed', attributes?: ({
14
15
  duration: number;
15
- } & Record<string, string | number | boolean | undefined>) | undefined) => AnalyticsEventPayload;
16
- export declare const teamProfileCardRendered: (actionSubjectId: 'spinner' | 'content' | 'error' | 'errorBoundary', attributes: {
16
+ } & GenericAttributes) | undefined) => AnalyticsEventPayload;
17
+ export declare const userRequestAnalytics: (action: 'triggered' | 'succeeded' | 'failed', attributes?: ({
17
18
  duration: number;
18
- hasRetry?: boolean;
19
- numActions?: number;
20
- memberCount?: number;
21
- includingYou?: boolean;
22
- descriptionLength?: number;
23
- titleLength?: number;
24
- }) => AnalyticsEventPayload;
25
- export declare const teamActionClicked: (attributes: {
19
+ } & GenericAttributes) | undefined) => AnalyticsEventPayload;
20
+ export declare const profileCardRendered: (type: 'user' | 'team', actionSubjectId: 'spinner' | 'content' | 'error' | 'errorBoundary', attributes?: {
21
+ duration?: number | undefined;
22
+ errorType?: "default" | "NotFound" | undefined;
23
+ hasRetry?: boolean | undefined;
24
+ numActions?: number | undefined;
25
+ memberCount?: number | undefined;
26
+ includingYou?: boolean | undefined;
27
+ descriptionLength?: number | undefined;
28
+ titleLength?: number | undefined;
29
+ } | undefined) => AnalyticsEventPayload;
30
+ export declare const actionClicked: (type: 'user' | 'team', attributes: {
26
31
  duration: number;
27
32
  hasHref: boolean;
28
33
  hasOnClick: boolean;
29
34
  index: number;
30
35
  actionId: string;
31
36
  }) => AnalyticsEventPayload;
32
- export declare const moreActionsClicked: (attributes: {
37
+ export declare const reportingLinesClicked: (attributes: {
38
+ userType: 'manager' | 'direct-report';
39
+ duration: number;
40
+ }) => AnalyticsEventPayload;
41
+ export declare const moreActionsClicked: (type: 'user' | 'team', attributes: {
33
42
  duration: number;
34
43
  numActions: number;
35
44
  }) => AnalyticsEventPayload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.12.1",
3
+ "version": "17.0.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,14 +42,14 @@
42
42
  "@atlaskit/avatar": "^21.0.0",
43
43
  "@atlaskit/avatar-group": "^9.0.0",
44
44
  "@atlaskit/button": "^16.3.0",
45
- "@atlaskit/dropdown-menu": "^11.3.0",
45
+ "@atlaskit/dropdown-menu": "^11.4.0",
46
46
  "@atlaskit/give-kudos": "^0.6.0",
47
47
  "@atlaskit/icon": "^21.10.0",
48
- "@atlaskit/lozenge": "^11.0.0",
48
+ "@atlaskit/lozenge": "^11.2.0",
49
49
  "@atlaskit/menu": "^1.3.0",
50
50
  "@atlaskit/popup": "^1.4.0",
51
51
  "@atlaskit/spinner": "^15.0.0",
52
- "@atlaskit/theme": "^12.1.0",
52
+ "@atlaskit/theme": "^12.2.0",
53
53
  "@atlaskit/tokens": "^0.10.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "date-fns": "^2.17.0",
@@ -64,10 +64,10 @@
64
64
  },
65
65
  "devDependencies": {
66
66
  "@atlaskit/docs": "*",
67
- "@atlaskit/dynamic-table": "^14.7.0",
68
- "@atlaskit/flag": "^14.5.0",
69
- "@atlaskit/inline-edit": "^12.0.0",
70
- "@atlaskit/select": "^15.6.0",
67
+ "@atlaskit/dynamic-table": "^14.8.0",
68
+ "@atlaskit/flag": "^14.7.0",
69
+ "@atlaskit/inline-edit": "^12.2.0",
70
+ "@atlaskit/select": "^15.7.0",
71
71
  "@atlaskit/util-data-test": "^17.5.0",
72
72
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
73
73
  "@testing-library/react": "^8.0.1",
package/report.api.md CHANGED
@@ -7,24 +7,29 @@
7
7
  ```ts
8
8
  /// <reference types="react" />
9
9
 
10
+ import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
10
11
  import { ComponentType } from 'react';
11
12
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
12
13
  import { IntlShape } from 'react-intl-next';
13
14
  import { LRUCache } from 'lru-fast';
14
15
  import { default as React_2 } from 'react';
15
- import { ReactElement } from 'react';
16
16
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
17
17
 
18
- declare type AnalyticsFromDuration = (duration: number) => Record<string, any>;
18
+ declare type AnalyticsFromDuration = (
19
+ duration: number,
20
+ ) => AnalyticsEventPayload;
19
21
 
20
22
  declare type AnalyticsFunction = (generator: AnalyticsFromDuration) => void;
21
23
 
24
+ declare interface AnalyticsProps {
25
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
26
+ }
27
+
22
28
  export declare interface ApiClientResponse {
23
29
  User: {
24
30
  id: string;
25
31
  isBot: boolean;
26
32
  isCurrentUser: boolean;
27
- isNotMentionable: boolean;
28
33
  avatarUrl: string | null;
29
34
  email: string | null;
30
35
  fullName: string | null;
@@ -65,6 +70,28 @@ declare interface ClientOverrides {
65
70
  teamCentralClient?: TeamCentralCardClient;
66
71
  }
67
72
 
73
+ declare const _default: React_2.ForwardRefExoticComponent<
74
+ Pick<
75
+ Omit<
76
+ ProfileCardResourcedProps & AnalyticsProps,
77
+ keyof WithAnalyticsEventsProps
78
+ >,
79
+ never
80
+ > &
81
+ Partial<
82
+ Pick<
83
+ Omit<
84
+ ProfileCardResourcedProps & AnalyticsProps,
85
+ keyof WithAnalyticsEventsProps
86
+ >,
87
+ keyof ProfileCardResourcedProps
88
+ >
89
+ > &
90
+ Partial<Pick<Partial<ProfileCardResourcedProps>, never>> &
91
+ React_2.RefAttributes<any>
92
+ >;
93
+ export default _default;
94
+
68
95
  export declare const DELAY_MS_HIDE = 200;
69
96
 
70
97
  export declare const DELAY_MS_SHOW = 800;
@@ -105,35 +132,10 @@ export declare const modifyResponse: (
105
132
  response: ApiClientResponse,
106
133
  ) => ProfileCardClientData;
107
134
 
108
- export declare class ProfileCard extends React_2.PureComponent<
109
- ProfilecardProps
110
- > {
111
- static defaultProps: ProfilecardProps;
112
- GIVE_KUDOS_ACTION_ID: string;
113
- private timeOpen;
114
- clientFetchProfile: () => void;
115
- constructor(props: ProfilecardProps);
116
- private durationSince;
117
- callClientFetchProfile: (...args: any) => void;
118
- callAnalytics: (id: string, options: any) => void;
119
- componentDidMount(): void;
120
- renderErrorMessage(): JSX.Element;
121
- kudosUrl: () => string;
122
- kudosButtonCallback: () => void;
123
- getActions(): ProfileCardAction[];
124
- renderButton: (action: ProfileCardAction, idx: number) => ReactElement;
125
- renderActionsButtons(): JSX.Element | null;
126
- private onActionClick;
127
- renderCardDetailsDefault(): JSX.Element;
128
- renderCardDetailsForDisabledAccount(): JSX.Element;
129
- getDisabledAccountName(): string | JSX.Element | null | undefined;
130
- getDisabledAccountDesc(): {};
131
- private renderFullNameAndPublicName;
132
- renderCustomLozenges(lozenges: LozengeProps[]): JSX.Element | null;
133
- renderCardDetailsApp(): JSX.Element;
134
- renderCardDetails(): JSX.Element;
135
- render(): JSX.Element;
136
- }
135
+ export declare const ProfileCard: React_2.ForwardRefExoticComponent<
136
+ Omit<ProfilecardProps & AnalyticsProps, keyof WithAnalyticsEventsProps> &
137
+ React_2.RefAttributes<any>
138
+ >;
137
139
 
138
140
  export declare interface ProfileCardAction {
139
141
  callback?: (...args: any[]) => any;
@@ -146,7 +148,6 @@ export declare interface ProfileCardAction {
146
148
  export declare interface ProfileCardClientData {
147
149
  isBot: boolean;
148
150
  isCurrentUser: boolean;
149
- isNotMentionable: boolean;
150
151
  avatarUrl?: string;
151
152
  email?: string;
152
153
  fullName?: string;
@@ -170,7 +171,6 @@ export declare interface ProfilecardProps {
170
171
  errorType?: ProfileCardErrorType;
171
172
  status?: StatusType;
172
173
  isBot?: boolean;
173
- isNotMentionable?: boolean;
174
174
  avatarUrl?: string;
175
175
  fullName?: string;
176
176
  meta?: string;
@@ -182,8 +182,7 @@ export declare interface ProfilecardProps {
182
182
  companyName?: string;
183
183
  timestring?: string;
184
184
  actions?: ProfileCardAction[];
185
- clientFetchProfile?: any;
186
- analytics?: any;
185
+ clientFetchProfile?: () => void;
187
186
  statusModifiedDate?: number | null;
188
187
  withoutElevation?: boolean;
189
188
  /** Show manager and direct reports section on profile hover card, if available */
@@ -202,34 +201,6 @@ export declare interface ProfilecardProps {
202
201
  openKudosDrawer?: () => void;
203
202
  }
204
203
 
205
- declare class ProfileCardResourced extends React_2.PureComponent<
206
- ProfileCardResourcedProps,
207
- ProfileCardResourcedState
208
- > {
209
- static defaultProps: Partial<ProfileCardResourcedProps>;
210
- _isMounted: boolean;
211
- state: ProfileCardResourcedState;
212
- componentDidMount(): void;
213
- componentDidUpdate(
214
- prevProps: ProfileCardResourcedProps,
215
- prevState: ProfileCardResourcedState,
216
- ): void;
217
- componentWillUnmount(): void;
218
- private callAnalytics;
219
- clientFetchProfile: () => void;
220
- handleClientSuccess(
221
- profileData: ProfileCardClientData,
222
- reportingLinesData: TeamCentralReportingLinesData,
223
- shouldShowGiveKudos: boolean,
224
- ): void;
225
- handleClientError(err: any): void;
226
- filterActions: () => ProfileCardAction[];
227
- openKudosDrawer: () => void;
228
- closeKudosDrawer: () => void;
229
- render(): React_2.ReactNode;
230
- }
231
- export default ProfileCardResourced;
232
-
233
204
  export declare interface ProfileCardResourcedProps {
234
205
  userId: string;
235
206
  cloudId: string;
@@ -237,7 +208,6 @@ export declare interface ProfileCardResourcedProps {
237
208
  actions?: ProfileCardAction[];
238
209
  reportingLinesProfileUrl?: string;
239
210
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
240
- analytics?: any;
241
211
  position?: ProfilecardTriggerPosition;
242
212
  trigger?: TriggerType;
243
213
  children?: React_2.ReactNode;
@@ -255,53 +225,26 @@ export declare interface ProfileCardResourcedState {
255
225
  kudosDrawerOpen: boolean;
256
226
  }
257
227
 
258
- export declare class ProfileCardTrigger extends React_2.PureComponent<
259
- ProfileCardTriggerProps,
260
- ProfileCardTriggerState
261
- > {
262
- static defaultProps: Partial<ProfileCardTriggerProps>;
263
- _isMounted: boolean;
264
- showDelay: number;
265
- hideDelay: number;
266
- showTimer: number;
267
- hideTimer: number;
268
- hideProfilecard: () => void;
269
- showProfilecard: () => void;
270
- onClick: (event: React_2.MouseEvent) => void;
271
- containerListeners:
272
- | {
273
- onMouseEnter: () => void;
274
- onMouseLeave: () => void;
275
- onClick?: undefined;
276
- }
277
- | {
278
- onClick: (event: React_2.MouseEvent) => void;
279
- onMouseEnter?: undefined;
280
- onMouseLeave?: undefined;
281
- };
282
- layerListeners: {
283
- handleClickOutside: () => void;
284
- handleEscapeKeydown: () => void;
285
- };
286
- state: ProfileCardTriggerState;
287
- componentDidMount(): void;
288
- componentDidUpdate(prevProps: ProfileCardTriggerProps): void;
289
- componentWillUnmount(): void;
290
- clientFetchProfile: () => void;
291
- handleClientSuccess(
292
- profileData: ProfileCardClientData,
293
- reportingLinesData: TeamCentralReportingLinesData,
294
- shouldShowGiveKudos: boolean,
295
- ): void;
296
- handleClientError(err: any): void;
297
- filterActions(): ProfileCardAction[];
298
- renderProfileCard(): JSX.Element;
299
- openKudosDrawer: () => void;
300
- closeKudosDrawer: () => void;
301
- renderCard: () => JSX.Element;
302
- renderWithTrigger(): JSX.Element;
303
- render(): JSX.Element;
304
- }
228
+ export declare const ProfileCardTrigger: React_2.ForwardRefExoticComponent<
229
+ Pick<
230
+ Omit<
231
+ ProfileCardTriggerProps & AnalyticsProps,
232
+ keyof WithAnalyticsEventsProps
233
+ >,
234
+ never
235
+ > &
236
+ Partial<
237
+ Pick<
238
+ Omit<
239
+ ProfileCardTriggerProps & AnalyticsProps,
240
+ keyof WithAnalyticsEventsProps
241
+ >,
242
+ keyof ProfileCardTriggerProps
243
+ >
244
+ > &
245
+ Partial<Pick<Partial<ProfileCardTriggerProps>, never>> &
246
+ React_2.RefAttributes<any>
247
+ >;
305
248
 
306
249
  export declare type ProfilecardTriggerPosition =
307
250
  | 'bottom-start'
@@ -335,7 +278,6 @@ export declare interface ProfileCardTriggerProps {
335
278
  actions?: ProfileCardAction[];
336
279
  reportingLinesProfileUrl?: string;
337
280
  onReportingLinesClick?: (user: ReportingLinesUser) => void;
338
- analytics?: any;
339
281
  position?: ProfilecardTriggerPosition;
340
282
  trigger?: TriggerType;
341
283
  children?: React_2.ReactNode;
@@ -361,11 +303,15 @@ export declare class ProfileClient {
361
303
  tcClient?: TeamCentralCardClient;
362
304
  constructor(config: ProfileClientOptions, clients?: ClientOverrides);
363
305
  flushCache(): void;
364
- getProfile(cloudId: string, userId: string): Promise<any>;
306
+ getProfile(
307
+ cloudId: string,
308
+ userId: string,
309
+ analytics?: (event: AnalyticsEventPayload) => void,
310
+ ): Promise<any>;
365
311
  getTeamProfile(
366
312
  teamId: string,
367
313
  orgId?: string,
368
- analytics?: (event: Record<string, any>) => void,
314
+ analytics?: (event: AnalyticsEventPayload) => void,
369
315
  ): Promise<Team>;
370
316
  getReportingLines(userId: string): Promise<TeamCentralReportingLinesData>;
371
317
  getTeamCentralBaseUrl(): string | undefined;
@@ -377,11 +323,12 @@ declare interface ProfileClient_2 {
377
323
  getProfile: (
378
324
  cloudId: string,
379
325
  userId: string,
326
+ analytics?: (event: AnalyticsEventPayload) => void,
380
327
  ) => Promise<ProfileCardClientData>;
381
328
  getTeamProfile: (
382
329
  teamId: string,
383
330
  orgId?: string,
384
- fireAnalytics?: (event: Record<string, any>) => void,
331
+ fireAnalytics?: (event: AnalyticsEventPayload) => void,
385
332
  ) => Promise<Team>;
386
333
  getReportingLines: (userId: string) => Promise<TeamCentralReportingLinesData>;
387
334
  shouldShowGiveKudos: () => Promise<boolean>;
@@ -552,9 +499,7 @@ declare interface TeamProfilecardProps extends TeamProfilecardCoreProps {
552
499
  export declare const TeamProfileCardTrigger: React_2.ForwardRefExoticComponent<
553
500
  Pick<
554
501
  Omit<
555
- TeamProfileCardTriggerProps & {
556
- createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined;
557
- },
502
+ TeamProfileCardTriggerProps & AnalyticsProps,
558
503
  keyof WithAnalyticsEventsProps
559
504
  >,
560
505
  never
@@ -562,9 +507,7 @@ export declare const TeamProfileCardTrigger: React_2.ForwardRefExoticComponent<
562
507
  Partial<
563
508
  Pick<
564
509
  Omit<
565
- TeamProfileCardTriggerProps & {
566
- createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined;
567
- },
510
+ TeamProfileCardTriggerProps & AnalyticsProps,
568
511
  keyof WithAnalyticsEventsProps
569
512
  >,
570
513
  keyof TeamProfileCardTriggerProps
@@ -653,7 +596,7 @@ export declare class TeamProfileClient extends CachingClient<Team> {
653
596
  getProfile(
654
597
  teamId: string,
655
598
  orgId: string | undefined,
656
- analytics?: (event: Record<string, any>) => void,
599
+ analytics?: (event: AnalyticsEventPayload) => void,
657
600
  ): Promise<Team>;
658
601
  }
659
602
 
@@ -663,7 +606,11 @@ export declare class UserProfileClient extends CachingClient<any> {
663
606
  options: ProfileClientOptions;
664
607
  constructor(options: ProfileClientOptions);
665
608
  makeRequest(cloudId: string, userId: string): Promise<ProfileCardClientData>;
666
- getProfile(cloudId: string, userId: string): Promise<any>;
609
+ getProfile(
610
+ cloudId: string,
611
+ userId: string,
612
+ analytics?: (event: AnalyticsEventPayload) => void,
613
+ ): Promise<any>;
667
614
  }
668
615
 
669
616
  export declare function withOuterListeners<P>(
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.AnalyticsName = void 0;
7
- var AnalyticsName = {
8
- PROFILE_CARD_CLICK: 'profile-card.click',
9
- PROFILE_CARD_VIEW: 'profile-card.view',
10
- PROFILE_CARD_LOADED: 'profile-card.loaded',
11
- PROFILE_CARD_RELOAD: 'profile-card.reload',
12
- PROFILE_CARD_ERROR: 'profile-card.error',
13
- PROFILE_CARD_RESOURCED_ERROR: 'profile-card-resourced.error'
14
- };
15
- exports.AnalyticsName = AnalyticsName;
@@ -1,8 +0,0 @@
1
- export const AnalyticsName = {
2
- PROFILE_CARD_CLICK: 'profile-card.click',
3
- PROFILE_CARD_VIEW: 'profile-card.view',
4
- PROFILE_CARD_LOADED: 'profile-card.loaded',
5
- PROFILE_CARD_RELOAD: 'profile-card.reload',
6
- PROFILE_CARD_ERROR: 'profile-card.error',
7
- PROFILE_CARD_RESOURCED_ERROR: 'profile-card-resourced.error'
8
- };
@@ -1,8 +0,0 @@
1
- export var AnalyticsName = {
2
- PROFILE_CARD_CLICK: 'profile-card.click',
3
- PROFILE_CARD_VIEW: 'profile-card.view',
4
- PROFILE_CARD_LOADED: 'profile-card.loaded',
5
- PROFILE_CARD_RELOAD: 'profile-card.reload',
6
- PROFILE_CARD_ERROR: 'profile-card.error',
7
- PROFILE_CARD_RESOURCED_ERROR: 'profile-card-resourced.error'
8
- };
@@ -1,8 +0,0 @@
1
- export declare const AnalyticsName: {
2
- PROFILE_CARD_CLICK: string;
3
- PROFILE_CARD_VIEW: string;
4
- PROFILE_CARD_LOADED: string;
5
- PROFILE_CARD_RELOAD: string;
6
- PROFILE_CARD_ERROR: string;
7
- PROFILE_CARD_RESOURCED_ERROR: string;
8
- };