@atlaskit/smart-card 21.1.4 → 22.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 (105) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/cjs/extractors/block/index.js +3 -2
  3. package/dist/cjs/extractors/common/actions/extractPreviewAction.js +12 -2
  4. package/dist/cjs/state/actions/index.js +54 -10
  5. package/dist/cjs/state/analytics/types.js +5 -0
  6. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +386 -109
  7. package/dist/cjs/state/hooks-external/useSmartLinkActions.js +12 -2
  8. package/dist/cjs/utils/analytics/analytics.js +239 -72
  9. package/dist/cjs/utils/analytics/index.js +32 -5
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/cjs/view/BlockCard/actions/PreviewAction.js +1 -1
  12. package/dist/cjs/view/BlockCard/index.js +10 -0
  13. package/dist/cjs/view/CardWithUrl/component.js +26 -4
  14. package/dist/cjs/view/CardWithUrl/loader.js +6 -1
  15. package/dist/cjs/view/EmbedModal/components/size-experiment/index.js +41 -0
  16. package/dist/cjs/view/EmbedModal/components/size-experiment/types.js +5 -0
  17. package/dist/cjs/view/EmbedModal/index.js +7 -3
  18. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +17 -3
  19. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +5 -2
  20. package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +20 -8
  21. package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +4 -2
  22. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -2
  23. package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +5 -2
  24. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +9 -2
  25. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +36 -8
  26. package/dist/cjs/view/HoverCard/components/SnippetOrPreview.js +74 -0
  27. package/dist/cjs/view/HoverCard/index.js +6 -1
  28. package/dist/cjs/view/HoverCard/styled.js +11 -3
  29. package/dist/es2019/extractors/block/index.js +2 -1
  30. package/dist/es2019/extractors/common/actions/extractPreviewAction.js +12 -3
  31. package/dist/es2019/state/actions/index.js +54 -10
  32. package/dist/es2019/state/analytics/types.js +1 -0
  33. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +379 -39
  34. package/dist/es2019/state/hooks-external/useSmartLinkActions.js +11 -2
  35. package/dist/es2019/utils/analytics/analytics.js +253 -78
  36. package/dist/es2019/utils/analytics/index.js +32 -4
  37. package/dist/es2019/version.json +1 -1
  38. package/dist/es2019/view/BlockCard/actions/PreviewAction.js +1 -1
  39. package/dist/es2019/view/BlockCard/index.js +9 -0
  40. package/dist/es2019/view/CardWithUrl/component.js +26 -4
  41. package/dist/es2019/view/CardWithUrl/loader.js +6 -1
  42. package/dist/es2019/view/EmbedModal/components/size-experiment/index.js +28 -0
  43. package/dist/es2019/view/EmbedModal/components/size-experiment/types.js +1 -0
  44. package/dist/es2019/view/EmbedModal/index.js +5 -3
  45. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +17 -7
  46. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +4 -1
  47. package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +17 -6
  48. package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +4 -2
  49. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +2 -3
  50. package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +5 -2
  51. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +9 -2
  52. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +36 -10
  53. package/dist/es2019/view/HoverCard/components/SnippetOrPreview.js +42 -0
  54. package/dist/es2019/view/HoverCard/index.js +6 -1
  55. package/dist/es2019/view/HoverCard/styled.js +8 -0
  56. package/dist/esm/extractors/block/index.js +3 -2
  57. package/dist/esm/extractors/common/actions/extractPreviewAction.js +12 -2
  58. package/dist/esm/state/actions/index.js +54 -10
  59. package/dist/esm/state/analytics/types.js +1 -0
  60. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +383 -109
  61. package/dist/esm/state/hooks-external/useSmartLinkActions.js +11 -2
  62. package/dist/esm/utils/analytics/analytics.js +239 -72
  63. package/dist/esm/utils/analytics/index.js +31 -4
  64. package/dist/esm/version.json +1 -1
  65. package/dist/esm/view/BlockCard/actions/PreviewAction.js +1 -1
  66. package/dist/esm/view/BlockCard/index.js +9 -0
  67. package/dist/esm/view/CardWithUrl/component.js +26 -4
  68. package/dist/esm/view/CardWithUrl/loader.js +6 -1
  69. package/dist/esm/view/EmbedModal/components/size-experiment/index.js +28 -0
  70. package/dist/esm/view/EmbedModal/components/size-experiment/types.js +1 -0
  71. package/dist/esm/view/EmbedModal/index.js +6 -3
  72. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +11 -3
  73. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +5 -2
  74. package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +18 -8
  75. package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +4 -2
  76. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +1 -2
  77. package/dist/esm/view/FlexibleCard/components/elements/media/index.js +5 -2
  78. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +9 -2
  79. package/dist/esm/view/HoverCard/components/HoverCardContent.js +36 -10
  80. package/dist/esm/view/HoverCard/components/SnippetOrPreview.js +53 -0
  81. package/dist/esm/view/HoverCard/index.js +6 -1
  82. package/dist/esm/view/HoverCard/styled.js +6 -2
  83. package/dist/types/extractors/block/types.d.ts +2 -0
  84. package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +2 -1
  85. package/dist/types/state/analytics/types.d.ts +9 -0
  86. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +18 -23
  87. package/dist/types/state/hooks/useSmartLink.d.ts +17 -18
  88. package/dist/types/utils/analytics/analytics.d.ts +19 -21
  89. package/dist/types/utils/analytics/index.d.ts +2 -2
  90. package/dist/types/utils/analytics/types.d.ts +91 -0
  91. package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +4 -2
  92. package/dist/types/view/Card/index.d.ts +1 -1
  93. package/dist/types/view/EmbedModal/components/size-experiment/index.d.ts +6 -0
  94. package/dist/types/view/EmbedModal/components/size-experiment/types.d.ts +4 -0
  95. package/dist/types/view/EmbedModal/index.d.ts +1 -1
  96. package/dist/types/view/EmbedModal/types.d.ts +4 -0
  97. package/dist/types/view/FlexibleCard/components/blocks/preview-block/types.d.ts +7 -1
  98. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +15 -0
  99. package/dist/types/view/FlexibleCard/components/common/image-icon/types.d.ts +1 -0
  100. package/dist/types/view/FlexibleCard/components/elements/media/types.d.ts +5 -0
  101. package/dist/types/view/HoverCard/components/SnippetOrPreview.d.ts +4 -0
  102. package/dist/types/view/HoverCard/styled.d.ts +2 -0
  103. package/dist/types/view/HoverCard/types.d.ts +5 -0
  104. package/package.json +2 -2
  105. package/report.api.md +294 -110
@@ -1,10 +1,5 @@
1
- import { ErrorInfo } from 'react';
2
- import { CardType, APIError } from '@atlaskit/linking-common';
3
1
  import { AnalyticsHandler } from '../../utils/types';
4
- import { CardInnerAppearance } from '../../view/Card/types';
5
- import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
6
- import { InvokeType } from '../../model/invoke-opts';
7
- import { DestinationProduct, DestinationSubproduct } from '../../utils/analytics/types';
2
+ import { ConnectFailedEventProps, ConnectSucceededEventProps, InstrumentEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps } from '../../utils/analytics/types';
8
3
  /**
9
4
  * This hook provides usage of Smart Link analytics outside of the Card component.
10
5
  * Can be provided to Card via the analyticsEvents prop to change the analytics events.
@@ -24,7 +19,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
24
19
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
25
20
  * @returns
26
21
  */
27
- authEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
22
+ authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiAuthEventProps) => void;
28
23
  /**
29
24
  * This fires an event that represents when a user clicks on the authentication
30
25
  * call to action with a forbidden authenticated account. (i.e. Try another account).
@@ -33,7 +28,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
33
28
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
34
29
  * @returns
35
30
  */
36
- authAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
31
+ authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiAuthAlternateAccountEventProps) => void;
37
32
  /**
38
33
  * This fires an event that represents when a user clicks on a Smart Link.
39
34
  * @param id The unique ID for this Smart Link.
@@ -46,7 +41,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
46
41
  * @param destinationProduct The product the Smart Link is linked to.
47
42
  * @returns
48
43
  */
49
- cardClickedEvent: (id: string | undefined, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: DestinationProduct | string | undefined, destinationSubproduct?: DestinationSubproduct | string | undefined, actionSubjectId?: string | undefined) => void;
44
+ cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => void;
50
45
  /**
51
46
  * This fires an event that represents when a user clicks on a Smart Link action.
52
47
  * Note: This also starts the UFO smart-link-action-invocation experience.
@@ -57,7 +52,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
57
52
  * @param invokeType Whether the action invoked made a call to a server.
58
53
  * @returns
59
54
  */
60
- actionClickedEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: CardInnerAppearance, invokeType: InvokeType) => void;
55
+ actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
61
56
  /**
62
57
  * This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
63
58
  * https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
@@ -66,7 +61,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
66
61
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
67
62
  * @param previewInvokeMethod How the preview was triggered.
68
63
  */
69
- hoverCardOpenLinkClickedEvent: (previewDisplay: PreviewDisplay, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => void;
64
+ hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardOpenLinkClickedEventProps) => void;
70
65
  /**
71
66
  * This fires an event that represents when a user closed the authentication window without authenticating after opening it.
72
67
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -74,7 +69,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
74
69
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
75
70
  * @returns
76
71
  */
77
- closedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
72
+ closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => void;
78
73
  /**
79
74
  * This fires an event that represents when a Smart Link was rendered successfully.
80
75
  * Note: this fires even if the Smart Link request errored out.
@@ -83,7 +78,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
83
78
  * @param definitionId The definitionId of the Smart Link resolver invoked.
84
79
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
85
80
  */
86
- renderSuccessEvent: (display: CardInnerAppearance, status: CardType, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
81
+ renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderSuccessEventProps) => void;
87
82
  /**
88
83
  * This fires an event that represents when a Smart Link renders unsuccessfuly.
89
84
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
@@ -91,7 +86,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
91
86
  * @param error: An error representing why the Smart Link render failed.
92
87
  * @param errorInfo: Additional details about the error including the stack trace.
93
88
  */
94
- renderFailedEvent: (display: CardInnerAppearance, id: string | undefined, error: Error, errorInfo: ErrorInfo) => void;
89
+ renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => void;
95
90
  /**
96
91
  * This fires an event that represents a hover preview being opened.
97
92
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -100,7 +95,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
100
95
  * @param previewInvokeMethod How the preview was triggered.
101
96
  * @returns
102
97
  */
103
- hoverCardViewedEvent: (previewDisplay: PreviewDisplay, previewInvokeMethod?: PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
98
+ hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiHoverCardViewedEventProps) => void;
104
99
  /**
105
100
  * This fires an event that represents a hover preview being dismissed.
106
101
  * @param hoverDisplay Whether the hover preview was displayed as a card or embed.
@@ -110,7 +105,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
110
105
  * @param previewInvokeMethod How the preview was triggered.
111
106
  * @returns
112
107
  */
113
- hoverCardDismissedEvent: (previewDisplay: PreviewDisplay, hoverTime: number, previewInvokeMethod?: PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
108
+ hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiHoverCardDismissedEventProps) => void;
114
109
  };
115
110
  operational: {
116
111
  /**
@@ -120,7 +115,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
120
115
  * @param actionType The type of action invoked, e.g. PreviewAction
121
116
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
122
117
  */
123
- invokeSucceededEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: CardInnerAppearance) => void;
118
+ invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => void;
124
119
  /**
125
120
  * This fires an event that represents an action being unsuccessfully invoked.
126
121
  * @param id The unique ID for this Smart Link.
@@ -129,14 +124,14 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
129
124
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
130
125
  * @param reason The reason the invocation failed.
131
126
  */
132
- invokeFailedEvent: (id: string | undefined, providerKey: string | undefined, actionType: string, display: CardInnerAppearance, reason: string) => void;
127
+ invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => void;
133
128
  /**
134
129
  * This fires an event that represents an account successfully being connected via a Smart Link.
135
130
  * @param id The unique ID for this Smart Link.
136
131
  * @param definitionId The definitionId of the Smart Link resolver invoked.
137
132
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
138
133
  */
139
- connectSucceededEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
134
+ connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => void;
140
135
  /**
141
136
  * This fires an event that represents an account unsuccessfully being connected.
142
137
  * @param id The unique ID for this Smart Link.
@@ -144,7 +139,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
144
139
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
145
140
  * @param reason The reason why the Smart Link connect account failed.
146
141
  */
147
- connectFailedEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined, reason?: string | undefined) => void;
142
+ connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ConnectFailedEventProps) => void;
148
143
  /**
149
144
  * This fires an event which represents a Smart Link request succeeding or failing based on the status.
150
145
  * @param id The unique ID for this Smart Link.
@@ -154,7 +149,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
154
149
  * @param resourceType The type of resource that was invoked. This is provider specific (e.g. File, PullRequest).
155
150
  * @param error An error representing why the Smart Link request failed.
156
151
  */
157
- instrument: (id: string | undefined, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => void;
152
+ instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => void;
158
153
  };
159
154
  track: {
160
155
  /**
@@ -163,7 +158,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
163
158
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
164
159
  * @returns
165
160
  */
166
- appAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
161
+ appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => void;
167
162
  };
168
163
  screen: {
169
164
  /**
@@ -172,7 +167,7 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
172
167
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
173
168
  * @returns
174
169
  */
175
- authPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
170
+ authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => void;
176
171
  };
177
172
  };
178
173
  export declare type AnalyticsFacade = ReturnType<typeof useSmartLinkAnalytics>;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { AnalyticsHandler } from '../../utils/types';
3
2
  export declare function useSmartLink(id: string, url: string, dispatchAnalytics: AnalyticsHandler): {
4
3
  state: import("@atlaskit/linking-common").CardState;
@@ -12,29 +11,29 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
12
11
  config: (import("@atlaskit/link-provider").CardProviderCacheOpts & import("@atlaskit/link-provider").CardAuthFlowOpts) | undefined;
13
12
  analytics: {
14
13
  ui: {
15
- authEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
16
- authAlternateAccountEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
17
- cardClickedEvent: (id: string | undefined, display: import("../../view/Card/types").CardInnerAppearance, status: import("@atlaskit/linking-common/types").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined, actionSubjectId?: string | undefined) => void;
18
- actionClickedEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: import("../../view/Card/types").CardInnerAppearance, invokeType: import("../../model/invoke-opts").InvokeType) => void;
19
- hoverCardOpenLinkClickedEvent: (previewDisplay: import("../../view/HoverCard/types").PreviewDisplay, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: import("../../view/HoverCard/types").PreviewInvokeMethod | undefined) => void;
20
- closedAuthEvent: (display: import("../../view/Card/types").CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
21
- renderSuccessEvent: (display: import("../../view/Card/types").CardInnerAppearance, status: import("@atlaskit/linking-common/types").CardType, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
22
- renderFailedEvent: (display: import("../../view/Card/types").CardInnerAppearance, id: string | undefined, error: Error, errorInfo: import("react").ErrorInfo) => void;
23
- hoverCardViewedEvent: (previewDisplay: import("../../view/HoverCard/types").PreviewDisplay, previewInvokeMethod?: import("../../view/HoverCard/types").PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
24
- hoverCardDismissedEvent: (previewDisplay: import("../../view/HoverCard/types").PreviewDisplay, hoverTime: number, previewInvokeMethod?: import("../../view/HoverCard/types").PreviewInvokeMethod | undefined, id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
14
+ authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthEventProps) => void;
15
+ authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthAlternateAccountEventProps) => void;
16
+ cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
17
+ actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
18
+ hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
19
+ closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
20
+ renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderSuccessEventProps) => void;
21
+ renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderFailedEventProps) => void;
22
+ hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
23
+ hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
25
24
  };
26
25
  operational: {
27
- invokeSucceededEvent: (id: string | undefined, extensionKey: string | undefined, actionType: string, display: import("../../view/Card/types").CardInnerAppearance) => void;
28
- invokeFailedEvent: (id: string | undefined, providerKey: string | undefined, actionType: string, display: import("../../view/Card/types").CardInnerAppearance, reason: string) => void;
29
- connectSucceededEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
30
- connectFailedEvent: (id?: string, definitionId?: string | undefined, extensionKey?: string | undefined, reason?: string | undefined) => void;
31
- instrument: (id: string | undefined, status: import("@atlaskit/linking-common/types").CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: import("@atlaskit/linking-common").APIError | undefined) => void;
26
+ invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
27
+ invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
28
+ connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
29
+ connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
30
+ instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
32
31
  };
33
32
  track: {
34
- appAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
33
+ appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
35
34
  };
36
35
  screen: {
37
- authPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
36
+ authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
38
37
  };
39
38
  };
40
39
  renderers: import("@atlaskit/link-provider").CardProviderRenderers | undefined;
@@ -1,9 +1,7 @@
1
1
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
- import { APIError, CardType } from '@atlaskit/linking-common';
3
2
  import { AnalyticsPayload } from '../types';
4
- import { ErrorInfo } from 'react';
5
3
  import { CardInnerAppearance } from '../../view/Card/types';
6
- import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
4
+ import { ConnectFailedEventProps, ConnectSucceededEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ResolvedEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps, UnresolvedEventProps } from './types';
7
5
  export declare const ANALYTICS_CHANNEL = "media";
8
6
  export declare const context: {
9
7
  componentName: string;
@@ -14,21 +12,21 @@ export declare class SmartLinkEvents {
14
12
  insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
15
13
  }
16
14
  export declare const fireSmartLinkEvent: (payload: AnalyticsPayload, createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined) => void;
17
- export declare const resolvedEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined) => AnalyticsPayload;
18
- export declare const unresolvedEvent: (id: string, status: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => AnalyticsPayload;
19
- export declare const invokeSucceededEvent: (id: string, actionType: string, display: CardInnerAppearance, extensionKey?: string | undefined) => AnalyticsPayload;
20
- export declare const invokeFailedEvent: (id: string, actionType: string, display: CardInnerAppearance, reason: string, extensionKey?: string | undefined) => AnalyticsPayload;
21
- export declare const connectSucceededEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
22
- export declare const connectFailedEvent: (definitionId?: string | undefined, extensionKey?: string | undefined, reason?: string | undefined) => AnalyticsPayload;
23
- export declare const trackAppAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
24
- export declare const uiAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
25
- export declare const uiAuthAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
26
- export declare const uiCardClickedEvent: (id: string, display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, isModifierKeyPressed?: boolean | undefined, location?: string | undefined, destinationProduct?: string | undefined, destinationSubproduct?: string | undefined, actionSubjectId?: string | undefined) => AnalyticsPayload;
27
- export declare const uiActionClickedEvent: (id: string, actionType: string, extensionKey?: string | undefined, display?: CardInnerAppearance | undefined) => AnalyticsPayload;
28
- export declare const uiClosedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
29
- export declare const screenAuthPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
30
- export declare const uiRenderSuccessEvent: (display: CardInnerAppearance, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined) => AnalyticsPayload;
31
- export declare const uiRenderFailedEvent: (display: CardInnerAppearance, error: Error, errorInfo: ErrorInfo) => AnalyticsPayload;
32
- export declare const uiHoverCardViewedEvent: (id: string, previewDisplay: PreviewDisplay, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => AnalyticsPayload;
33
- export declare const uiHoverCardDismissedEvent: (id: string, previewDisplay: PreviewDisplay, hoverTime: number, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => AnalyticsPayload;
34
- export declare const uiHoverCardOpenLinkClickedEvent: (id: string, previewDisplay: string, definitionId?: string | undefined, extensionKey?: string | undefined, previewInvokeMethod?: PreviewInvokeMethod | undefined) => AnalyticsPayload;
15
+ export declare const resolvedEvent: (props: ResolvedEventProps) => AnalyticsPayload;
16
+ export declare const unresolvedEvent: ({ id, definitionId, extensionKey, resourceType, destinationSubproduct, destinationProduct, error, status, location, }: UnresolvedEventProps) => AnalyticsPayload;
17
+ export declare const invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => AnalyticsPayload;
18
+ export declare const invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => AnalyticsPayload;
19
+ export declare const connectSucceededEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: ConnectSucceededEventProps) => AnalyticsPayload;
20
+ export declare const connectFailedEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, reason, }: ConnectFailedEventProps) => AnalyticsPayload;
21
+ export declare const trackAppAccountConnected: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, }: TrackAppAccountConnectedProps) => AnalyticsPayload;
22
+ export declare const uiAuthEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthEventProps) => AnalyticsPayload;
23
+ export declare const uiAuthAlternateAccountEvent: ({ definitionId, extensionKey, destinationProduct, destinationSubproduct, location, display, }: UiAuthAlternateAccountEventProps) => AnalyticsPayload;
24
+ export declare const uiCardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: UiCardClickedEventProps) => AnalyticsPayload;
25
+ export declare const uiActionClickedEvent: ({ id, actionType, extensionKey, display, definitionId, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => AnalyticsPayload;
26
+ export declare const uiClosedAuthEvent: ({ display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => AnalyticsPayload;
27
+ export declare const screenAuthPopupEvent: ({ extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => AnalyticsPayload;
28
+ export declare const uiRenderSuccessEvent: ({ display, status, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderSuccessEventProps) => AnalyticsPayload;
29
+ export declare const uiRenderFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => AnalyticsPayload;
30
+ export declare const uiHoverCardViewedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardViewedEventProps) => AnalyticsPayload;
31
+ export declare const uiHoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardDismissedEventProps) => AnalyticsPayload;
32
+ export declare const uiHoverCardOpenLinkClickedEvent: ({ id, previewDisplay, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: UiHoverCardOpenLinkClickedEventProps) => AnalyticsPayload;
@@ -1,4 +1,4 @@
1
- import { APIError, CardType } from '@atlaskit/linking-common';
2
1
  import { AnalyticsPayload } from '../types';
2
+ import { InstrumentEventProps } from './types';
3
3
  export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent, resolvedEvent, unresolvedEvent, invokeSucceededEvent, invokeFailedEvent, connectSucceededEvent, connectFailedEvent, trackAppAccountConnected, uiAuthEvent, uiAuthAlternateAccountEvent, uiCardClickedEvent, uiActionClickedEvent, uiClosedAuthEvent, screenAuthPopupEvent, uiRenderSuccessEvent, uiRenderFailedEvent, uiHoverCardViewedEvent, uiHoverCardDismissedEvent, uiHoverCardOpenLinkClickedEvent, } from './analytics';
4
- export declare const instrumentEvent: (id: string, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => AnalyticsPayload | undefined;
4
+ export declare const instrumentEvent: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: InstrumentEventProps) => AnalyticsPayload | undefined;
@@ -1,2 +1,93 @@
1
+ import { APIError, CardType } from '@atlaskit/linking-common';
2
+ import { PreviewDisplay, PreviewInvokeMethod } from '../../view/HoverCard/types';
3
+ import { ErrorInfo } from 'react';
4
+ import { CardInnerAppearance } from '../../view/Card/types';
5
+ import { InvokeType } from '../../model/invoke-opts';
1
6
  export declare type DestinationProduct = 'jira' | 'confluence' | 'bitbucket' | 'trello';
2
7
  export declare type DestinationSubproduct = 'core' | 'software' | 'servicedesk';
8
+ export interface CommonEventProps {
9
+ id?: string;
10
+ definitionId?: string;
11
+ extensionKey?: string;
12
+ resourceType?: string;
13
+ destinationSubproduct?: DestinationSubproduct | string;
14
+ destinationProduct?: DestinationProduct | string;
15
+ location?: string;
16
+ }
17
+ export declare type ResolvedEventProps = CommonEventProps & {
18
+ id: string;
19
+ };
20
+ export declare type UnresolvedEventProps = CommonEventProps & {
21
+ id: string;
22
+ status: string;
23
+ error?: APIError;
24
+ };
25
+ export declare type InvokeSucceededEventProps = CommonEventProps & {
26
+ id: string;
27
+ actionType: string;
28
+ display: CardInnerAppearance;
29
+ };
30
+ export declare type InvokeFailedEventProps = CommonEventProps & {
31
+ id: string;
32
+ actionType: string;
33
+ display: CardInnerAppearance;
34
+ reason: string;
35
+ };
36
+ export declare type ConnectSucceededEventProps = CommonEventProps & {
37
+ id?: string;
38
+ };
39
+ export declare type ConnectFailedEventProps = CommonEventProps & {
40
+ id?: string;
41
+ reason?: string;
42
+ };
43
+ export declare type TrackAppAccountConnectedProps = CommonEventProps;
44
+ export declare type UiAuthEventProps = CommonEventProps & {
45
+ display: CardInnerAppearance;
46
+ };
47
+ export declare type UiAuthAlternateAccountEventProps = CommonEventProps & {
48
+ display: CardInnerAppearance;
49
+ };
50
+ export declare type UiCardClickedEventProps = CommonEventProps & {
51
+ id: string;
52
+ display: CardInnerAppearance;
53
+ status: CardType;
54
+ isModifierKeyPressed?: boolean;
55
+ actionSubjectId?: string;
56
+ };
57
+ export declare type UiActionClickedEventProps = CommonEventProps & {
58
+ id: string;
59
+ display: CardInnerAppearance;
60
+ actionType: string;
61
+ invokeType?: InvokeType;
62
+ };
63
+ export declare type ScreenAuthPopupEventProps = CommonEventProps;
64
+ export declare type UiClosedAuthEventProps = CommonEventProps & {
65
+ display: CardInnerAppearance;
66
+ };
67
+ export declare type UiRenderSuccessEventProps = CommonEventProps & {
68
+ display: CardInnerAppearance;
69
+ status: CardType;
70
+ };
71
+ export declare type UiRenderFailedEventProps = CommonEventProps & {
72
+ display: CardInnerAppearance;
73
+ error: Error;
74
+ errorInfo: ErrorInfo;
75
+ };
76
+ export declare type UiHoverCardViewedEventProps = CommonEventProps & {
77
+ previewDisplay: PreviewDisplay;
78
+ previewInvokeMethod?: PreviewInvokeMethod;
79
+ };
80
+ export declare type UiHoverCardDismissedEventProps = CommonEventProps & {
81
+ previewDisplay: PreviewDisplay;
82
+ hoverTime: number;
83
+ previewInvokeMethod?: PreviewInvokeMethod;
84
+ };
85
+ export declare type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
86
+ previewDisplay: PreviewDisplay;
87
+ previewInvokeMethod?: PreviewInvokeMethod;
88
+ };
89
+ export declare type InstrumentEventProps = CommonEventProps & {
90
+ error?: APIError;
91
+ status: CardType;
92
+ id: string;
93
+ };
@@ -1,9 +1,10 @@
1
1
  import React, { ErrorInfo } from 'react';
2
- import { ModalProps } from '../../common/Modal';
2
+ import { LinkingPlatformFeatureFlags } from '@atlaskit/linking-common';
3
+ import { EmbedModalWithExperimentProps } from '../../EmbedModal/types';
3
4
  import { ActionProps } from '../components/Action';
4
5
  import { IconProps } from '../../common/Icon';
5
6
  import { MetadataProps } from '../../common/Metadata';
6
- export interface PreviewFunctionArg extends ModalProps {
7
+ export interface PreviewFunctionArg extends EmbedModalWithExperimentProps {
7
8
  popupMountPointId: string;
8
9
  }
9
10
  export declare function previewFunction({ popupMountPointId, onClose, ...rest }: PreviewFunctionArg): Promise<void>;
@@ -21,6 +22,7 @@ declare type PreviewInfo = {
21
22
  onDownloadActionClick?: () => void;
22
23
  onOpen?: () => void;
23
24
  onOpenFailed?: (error: Error, errorInfo: ErrorInfo) => void;
25
+ featureFlags?: Partial<LinkingPlatformFeatureFlags>;
24
26
  };
25
27
  declare const _default: ({ details, ...rest }: PreviewInfo) => ActionProps;
26
28
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { CardAppearance, CardPlatform, CardProps } from './types';
3
3
  import { WrappedComponentProps } from 'react-intl-next';
4
- export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "id" | "placeholder" | "onError" | "onClick" | "analyticsContext" | "key" | "url" | "ui" | "showActions" | "onResolve" | "platform" | "isFrameVisible" | "embedIframeRef" | "showHoverPreview" | "inlinePreloaderStyle" | "importer" | "container" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
4
+ export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<React.PropsWithChildren<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps<"intl">>>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "data" | "appearance" | "testId" | "isSelected" | "inheritDimensions" | "id" | "placeholder" | "onError" | "onClick" | "analyticsContext" | "key" | "url" | "ui" | "showHoverPreview" | "showActions" | "onResolve" | "platform" | "isFrameVisible" | "embedIframeRef" | "inlinePreloaderStyle" | "importer" | "container" | "analyticsEvents" | "forwardedRef"> & React.RefAttributes<any>>;
5
5
  export type { CardAppearance, CardProps, CardPlatform };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { ModalProps } from '../../../common/Modal';
3
+ import { EmbedModalProps } from '../../types';
4
+ import { WithSizeExperimentProps } from './types';
5
+ declare const withSizeExperiment: (Component: React.ComponentType<EmbedModalProps>) => React.FC<(EmbedModalProps | ModalProps) & WithSizeExperimentProps>;
6
+ export default withSizeExperiment;
@@ -0,0 +1,4 @@
1
+ import { LinkingPlatformFeatureFlags } from '@atlaskit/linking-common';
2
+ export declare type WithSizeExperimentProps = {
3
+ featureFlags?: Partial<LinkingPlatformFeatureFlags>;
4
+ };
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import { EmbedModalProps } from './types';
3
- declare const _default: React.FC<EmbedModalProps>;
3
+ declare const _default: React.FC<(import("../common/Modal").ModalProps | EmbedModalProps) & import("./components/size-experiment/types").WithSizeExperimentProps>;
4
4
  export default _default;
@@ -1,5 +1,7 @@
1
1
  import { ErrorInfo } from 'react';
2
2
  import { IconProps } from '../common/Icon';
3
+ import { WithSizeExperimentProps } from './components/size-experiment/types';
4
+ import { ModalProps } from '../common/Modal';
3
5
  export declare type EmbedModalProps = {
4
6
  closeLabel?: string;
5
7
  download?: string;
@@ -13,8 +15,10 @@ export declare type EmbedModalProps = {
13
15
  onViewActionClick?: () => void;
14
16
  providerName?: string;
15
17
  showModal?: boolean;
18
+ size?: string;
16
19
  src?: string;
17
20
  testId?: string;
18
21
  title?: string;
19
22
  url?: string;
20
23
  };
24
+ export declare type EmbedModalWithExperimentProps = EmbedModalProps & ModalProps & WithSizeExperimentProps;
@@ -1,2 +1,8 @@
1
1
  import { BlockProps } from '../types';
2
- export declare type PreviewBlockProps = BlockProps;
2
+ export declare type PreviewBlockProps = {
3
+ /**
4
+ * Function to be called on error loading media.
5
+ * @internal
6
+ */
7
+ onError?: () => void;
8
+ } & BlockProps;
@@ -1,6 +1,7 @@
1
1
  import { ActionName, ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkStatus } from '../../../../constants';
2
2
  import { SerializedStyles } from '@emotion/core';
3
3
  import { ActionProps } from '../actions/action/types';
4
+ import { Ref } from 'react';
4
5
  export declare type BlockProps = {
5
6
  /**
6
7
  * The direction that the block should arrange it's elements. Can be vertical
@@ -29,6 +30,20 @@ export declare type BlockProps = {
29
30
  * serving as a hook for automated tests
30
31
  */
31
32
  testId?: string;
33
+ /**
34
+ * Ref to block wrapper div.
35
+ */
36
+ blockRef?: Ref<HTMLDivElement>;
37
+ /**
38
+ * Function to be called on render of block.
39
+ * @internal
40
+ */
41
+ onRender?: () => void;
42
+ /**
43
+ * Function to be called on transition end of block.
44
+ * @internal
45
+ */
46
+ onTransitionEnd?: () => void;
32
47
  };
33
48
  /**
34
49
  * Used to represent a metadata element to be rendered.
@@ -3,4 +3,5 @@ export declare type ImageIconProps = {
3
3
  defaultIcon?: React.ReactNode;
4
4
  testId?: string;
5
5
  url: string;
6
+ onError?: () => void;
6
7
  };
@@ -9,4 +9,9 @@ export declare type MediaProps = ElementProps & {
9
9
  * The URL of the associated media to display.
10
10
  */
11
11
  url?: string;
12
+ /**
13
+ * Function to be called on error loading media.
14
+ * @internal
15
+ */
16
+ onError?: () => void;
12
17
  };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { SnippetOrPreviewProps } from '../types';
3
+ declare const SnippetOrPreview: React.FC<SnippetOrPreviewProps>;
4
+ export default SnippetOrPreview;
@@ -8,3 +8,5 @@ export declare const metadataBlockCss: import("@emotion/utils").SerializedStyles
8
8
  export declare const footerBlockCss: import("@emotion/utils").SerializedStyles;
9
9
  export declare const loadingViewContainer: import("@emotion/utils").SerializedStyles;
10
10
  export declare const skeletonContainer: import("@emotion/utils").SerializedStyles;
11
+ export declare const hiddenSnippetStyles: import("@emotion/utils").SerializedStyles;
12
+ export declare const getTransitionStyles: (snippetHeight: number) => import("@emotion/utils").SerializedStyles;
@@ -8,6 +8,7 @@ import { AnalyticsHandler } from '../../utils/types';
8
8
  import { ReactElement } from 'react';
9
9
  import { TitleBlockProps } from '../FlexibleCard/components/blocks/title-block/types';
10
10
  import { FlexibleCardProps } from '../FlexibleCard/types';
11
+ import { JsonLd } from 'json-ld-types';
11
12
  export interface HoverCardProps extends WithAnalyticsEventsProps {
12
13
  id?: string;
13
14
  url: string;
@@ -38,3 +39,7 @@ export declare type HoverCardLoadingViewProps = {
38
39
  flexibleCardProps: FlexibleCardProps;
39
40
  titleBlockProps: TitleBlockProps;
40
41
  };
42
+ export declare type SnippetOrPreviewProps = {
43
+ data: JsonLd.Data.BaseData;
44
+ snippetHeight: number;
45
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "21.1.4",
3
+ "version": "22.0.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,7 +33,7 @@
33
33
  "@atlaskit/icon-object": "^6.2.0",
34
34
  "@atlaskit/icon-priority": "^6.3.0",
35
35
  "@atlaskit/in-product-testing": "^0.1.0",
36
- "@atlaskit/linking-common": "^1.5.0",
36
+ "@atlaskit/linking-common": "^1.6.0",
37
37
  "@atlaskit/logo": "^13.8.0",
38
38
  "@atlaskit/lozenge": "^11.1.0",
39
39
  "@atlaskit/media-common": "^2.16.0",