@atlaskit/smart-card 32.7.8 → 32.7.9

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 (49) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/analytics.spec.yaml +31 -5
  3. package/dist/cjs/extractors/action/extract-invoke-preview-action.js +7 -6
  4. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +5 -1
  5. package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +2 -7
  6. package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +99 -6
  7. package/dist/cjs/utils/analytics/analytics.js +1 -1
  8. package/dist/cjs/view/CardWithUrl/component.js +0 -1
  9. package/dist/cjs/view/CardWithUrl/loader.js +14 -5
  10. package/dist/cjs/view/EmbedModal/components/analytics/index.js +88 -32
  11. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -2
  12. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +0 -1
  13. package/dist/cjs/view/HoverCard/index.js +15 -8
  14. package/dist/cjs/view/LinkUrl/index.js +1 -1
  15. package/dist/es2019/extractors/action/extract-invoke-preview-action.js +8 -7
  16. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +5 -1
  17. package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +0 -3
  18. package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +97 -2
  19. package/dist/es2019/utils/analytics/analytics.js +1 -1
  20. package/dist/es2019/view/CardWithUrl/component.js +0 -1
  21. package/dist/es2019/view/CardWithUrl/loader.js +9 -1
  22. package/dist/es2019/view/EmbedModal/components/analytics/index.js +88 -32
  23. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -1
  24. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +0 -1
  25. package/dist/es2019/view/HoverCard/index.js +10 -2
  26. package/dist/es2019/view/LinkUrl/index.js +1 -1
  27. package/dist/esm/extractors/action/extract-invoke-preview-action.js +8 -7
  28. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +5 -1
  29. package/dist/esm/utils/analytics/LinkAnalyticsContext.js +2 -7
  30. package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +95 -5
  31. package/dist/esm/utils/analytics/analytics.js +1 -1
  32. package/dist/esm/view/CardWithUrl/component.js +0 -1
  33. package/dist/esm/view/CardWithUrl/loader.js +14 -5
  34. package/dist/esm/view/EmbedModal/components/analytics/index.js +88 -32
  35. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -1
  36. package/dist/esm/view/HoverCard/components/views/resolved/index.js +0 -1
  37. package/dist/esm/view/HoverCard/index.js +14 -4
  38. package/dist/esm/view/LinkUrl/index.js +1 -1
  39. package/dist/types/common/analytics/generated/analytics.types.d.ts +16 -2
  40. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
  41. package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
  42. package/dist/types/view/EmbedModal/components/analytics/types.d.ts +1 -0
  43. package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
  44. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +16 -2
  45. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
  46. package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
  47. package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +1 -0
  48. package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
  49. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::1e6835b50307a44a077c38d864a2c66e>>
6
+ * @codegen <<SignedSource::84c7074821df29c52dd13557dab19219>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataContextType = {
@@ -126,6 +126,10 @@ export type SmartLinkQuickActionFailedAttributesType = {
126
126
  export type ConsentModalViewedAttributesType = {
127
127
  definitionId: string | null;
128
128
  };
129
+ export type EmbedPreviewModalViewedAttributesType = {
130
+ origin: 'smartLinkCard' | 'smartLinkEmbed' | 'smartLinkInline' | 'smartLinkPreviewHoverCard' | null;
131
+ size: 'large' | 'small' | null;
132
+ };
129
133
  export type SmartLinkConnectSucceededAttributesType = {
130
134
  definitionId: string | null;
131
135
  };
@@ -200,6 +204,11 @@ export type ConsentModalClosedAttributesType = {
200
204
  display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
201
205
  definitionId: string | null;
202
206
  };
207
+ export type ModalClosedEmbedPreviewAttributesType = {
208
+ origin: 'smartLinkCard' | 'smartLinkEmbed' | 'smartLinkInline' | 'smartLinkPreviewHoverCard' | null;
209
+ previewTime: number | null;
210
+ size: 'large' | 'small' | null;
211
+ };
203
212
  export type ButtonClickedLearnMoreAttributesType = {};
204
213
  export type ButtonClickedSmartLinkStatusLozengeAttributesType = {};
205
214
  export type ButtonClickedSmartLinkStatusListItemAttributesType = {};
@@ -214,7 +223,6 @@ export type ButtonClickedEmbedPreviewResizeAttributesType = {
214
223
  };
215
224
  export type SmartLinkRenderSuccessAttributesType = {
216
225
  display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
217
- definitionId: string | null;
218
226
  };
219
227
  export type SmartLinkRenderFailedAttributesType = {
220
228
  display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
@@ -301,6 +309,9 @@ export type AnalyticsEventAttributes = {
301
309
  /**
302
310
  * fires an event which represents the connect account page being opened. */
303
311
  'screen.consentModal.viewed': ConsentModalViewedAttributesType;
312
+ /**
313
+ * Fires an event that represents when a user view a modal. */
314
+ 'screen.embedPreviewModal.viewed': EmbedPreviewModalViewedAttributesType;
304
315
  /**
305
316
  * fires an event that represents an account successfully being connected via a Smart Link. */
306
317
  'operational.smartLink.connectSucceeded': SmartLinkConnectSucceededAttributesType;
@@ -343,6 +354,9 @@ export type AnalyticsEventAttributes = {
343
354
  /**
344
355
  * fires an event that represents when a user closed the authentication window without authenticating after opening it. */
345
356
  'ui.consentModal.closed': ConsentModalClosedAttributesType;
357
+ /**
358
+ * Fires an event that represents when a user close a modal. */
359
+ 'ui.modal.closed.embedPreview': ModalClosedEmbedPreviewAttributesType;
346
360
  /**
347
361
  * fires an event that signifies that a "Learn More" link was clicked on an unauthenticated card */
348
362
  'ui.button.clicked.learnMore': ButtonClickedLearnMoreAttributesType;
@@ -15,6 +15,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
15
15
  * This fires an event that represents when a user
16
16
  * click a button.
17
17
  * @param data A partial analytics event payload
18
+ * @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
18
19
  */
19
20
  buttonClickedEvent: (data: Partial<AnalyticsPayload> & {
20
21
  actionSubjectId: Required<string>;
@@ -32,6 +33,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
32
33
  /**
33
34
  * This fires an event that represents when a user close a modal.
34
35
  * @param data A partial analytics event payload
36
+ * @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
35
37
  */
36
38
  modalClosedEvent: (data: Partial<AnalyticsPayload> & {
37
39
  actionSubjectId: Required<string>;
@@ -44,6 +46,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
44
46
  * @param definitionId The definitionId of the Smart Link resolver invoked.
45
47
  * @param extensionKey The extensionKey of the Smart Link resovler invoked.
46
48
  * @param canBeDatasource An indicator that shows that a smart link can be converted to a datasource
49
+ * @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
47
50
  */
48
51
  renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, canBeDatasource, }: UiRenderSuccessEventProps) => void;
49
52
  /**
@@ -52,6 +55,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
52
55
  * @param id The unique ID for this Smart Link.
53
56
  * @param error: An error representing why the Smart Link render failed.
54
57
  * @param errorInfo: Additional details about the error including the stack trace.
58
+ * @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
55
59
  */
56
60
  renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => void;
57
61
  };
@@ -77,7 +81,7 @@ export declare const useSmartLinkAnalytics: (url: string, id?: string, defaultLo
77
81
  screen: {
78
82
  /**
79
83
  * This fires an event that represents when a user view a modal.
80
- * @param data A partial analytics event payload
84
+ * @deprecated consider removing when cleaning up FF platform-smart-card-migrate-embed-modal-analytics
81
85
  */
82
86
  modalViewedEvent: (data: Partial<AnalyticsPayload> & {
83
87
  name: Extract<AnalyticsName, 'embedPreviewModal'>;
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
+ import { getResolvedAttributes } from '@atlaskit/link-analytics/resolved-attributes';
3
+ import { context } from './analytics';
2
4
  type SmartLinkAnalyticsContextProps = {
3
5
  url: string;
4
6
  display?: string;
@@ -6,6 +8,18 @@ type SmartLinkAnalyticsContextProps = {
6
8
  source?: string;
7
9
  children?: React.ReactNode;
8
10
  };
11
+ type SmartLinkAnalyticsContextType = {
12
+ source?: string;
13
+ attributes?: typeof context & ReturnType<typeof getResolvedAttributes> & {
14
+ display?: string;
15
+ id?: string;
16
+ };
17
+ };
18
+ /**
19
+ * Provides an analytics context data to supply attributes to events based on a URL
20
+ * and the link state in the store
21
+ */
22
+ export declare const useSmartLinkAnalyticsContext: ({ display, id, source, url, }: Exclude<SmartLinkAnalyticsContextProps, 'children'>) => SmartLinkAnalyticsContextType | undefined;
9
23
  /**
10
24
  * Provides an analytics context to supply attributes to events based on a URL
11
25
  * and the link state in the store
@@ -3,5 +3,6 @@ import { type AnalyticsOrigin } from '../../../../utils/types';
3
3
  export type WithAnalytics = {
4
4
  analytics?: AnalyticsFacade;
5
5
  extensionKey?: string;
6
+ id?: string;
6
7
  origin?: AnalyticsOrigin;
7
8
  };
@@ -1,3 +1,4 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { type HoverCardComponentProps } from '../types';
3
+ export declare const HOVER_CARD_SOURCE = "smartLinkPreviewHoverCard";
3
4
  export declare const HoverCardComponent: ({ children, url, id, canOpen, closeOnChildClick, actionOptions, allowEventPropagation, zIndex, noFadeDelay, hoverPreviewOptions, }: HoverCardComponentProps) => jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "32.7.8",
3
+ "version": "32.7.9",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"