@atlaskit/smart-card 32.7.7 → 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 (82) hide show
  1. package/CHANGELOG.md +16 -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/actions/index.js +13 -38
  5. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +59 -306
  6. package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +2 -7
  7. package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +99 -6
  8. package/dist/cjs/utils/analytics/analytics.js +27 -301
  9. package/dist/cjs/utils/analytics/index.js +0 -66
  10. package/dist/cjs/view/CardWithUrl/component.js +7 -23
  11. package/dist/cjs/view/CardWithUrl/loader.js +14 -5
  12. package/dist/cjs/view/EmbedModal/components/analytics/index.js +88 -32
  13. package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  14. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  15. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  16. package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -2
  17. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +21 -53
  18. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +0 -1
  19. package/dist/cjs/view/HoverCard/index.js +15 -8
  20. package/dist/cjs/view/LinkUrl/index.js +1 -1
  21. package/dist/cjs/view/common/UnauthorisedViewContent.js +3 -9
  22. package/dist/es2019/extractors/action/extract-invoke-preview-action.js +8 -7
  23. package/dist/es2019/state/actions/index.js +13 -38
  24. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +7 -239
  25. package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +0 -3
  26. package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +97 -2
  27. package/dist/es2019/utils/analytics/analytics.js +2 -286
  28. package/dist/es2019/utils/analytics/index.js +1 -1
  29. package/dist/es2019/view/CardWithUrl/component.js +8 -24
  30. package/dist/es2019/view/CardWithUrl/loader.js +9 -1
  31. package/dist/es2019/view/EmbedModal/components/analytics/index.js +88 -32
  32. package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  33. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  34. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  35. package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -1
  36. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +21 -53
  37. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +0 -1
  38. package/dist/es2019/view/HoverCard/index.js +10 -2
  39. package/dist/es2019/view/LinkUrl/index.js +1 -1
  40. package/dist/es2019/view/common/UnauthorisedViewContent.js +3 -9
  41. package/dist/esm/extractors/action/extract-invoke-preview-action.js +8 -7
  42. package/dist/esm/state/actions/index.js +13 -38
  43. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +60 -307
  44. package/dist/esm/utils/analytics/LinkAnalyticsContext.js +2 -7
  45. package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +95 -5
  46. package/dist/esm/utils/analytics/analytics.js +26 -300
  47. package/dist/esm/utils/analytics/index.js +1 -1
  48. package/dist/esm/view/CardWithUrl/component.js +8 -24
  49. package/dist/esm/view/CardWithUrl/loader.js +14 -5
  50. package/dist/esm/view/EmbedModal/components/analytics/index.js +88 -32
  51. package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +4 -13
  52. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/index.js +4 -16
  53. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -5
  54. package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -1
  55. package/dist/esm/view/HoverCard/components/HoverCardContent.js +21 -53
  56. package/dist/esm/view/HoverCard/components/views/resolved/index.js +0 -1
  57. package/dist/esm/view/HoverCard/index.js +14 -4
  58. package/dist/esm/view/LinkUrl/index.js +1 -1
  59. package/dist/esm/view/common/UnauthorisedViewContent.js +3 -9
  60. package/dist/types/common/analytics/generated/analytics.types.d.ts +16 -2
  61. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
  62. package/dist/types/state/hooks/useSmartLink.d.ts +0 -12
  63. package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
  64. package/dist/types/utils/analytics/analytics.d.ts +1 -51
  65. package/dist/types/utils/analytics/index.d.ts +1 -1
  66. package/dist/types/utils/analytics/types.d.ts +0 -60
  67. package/dist/types/utils/mocks.d.ts +0 -12
  68. package/dist/types/view/EmbedModal/components/analytics/types.d.ts +1 -0
  69. package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
  70. package/dist/types/view/common/UnauthorisedViewContent.d.ts +1 -1
  71. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +16 -2
  72. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +6 -102
  73. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -12
  74. package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
  75. package/dist/types-ts4.5/utils/analytics/analytics.d.ts +1 -51
  76. package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
  77. package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -60
  78. package/dist/types-ts4.5/utils/mocks.d.ts +0 -12
  79. package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +1 -0
  80. package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
  81. package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +1 -1
  82. package/package.json +2 -5
@@ -1,9 +1,7 @@
1
1
  import { type ErrorInfo } from 'react';
2
2
  import { type APIError, type CardType } from '@atlaskit/linking-common';
3
- import { type SmartLinkActionType } from '@atlaskit/linking-types';
4
3
  import { type InvokeType } from '../../model/invoke-opts';
5
4
  import { type CardInnerAppearance } from '../../view/Card/types';
6
- import { type PreviewDisplay, type PreviewInvokeMethod } from '../../view/HoverCard/types';
7
5
  export type DestinationProduct = 'jira' | 'confluence' | 'bitbucket' | 'trello';
8
6
  export type DestinationSubproduct = 'core' | 'software' | 'servicedesk';
9
7
  export interface CommonEventProps {
@@ -36,46 +34,12 @@ export type InvokeFailedEventProps = CommonEventProps & {
36
34
  display?: CardInnerAppearance;
37
35
  reason: string;
38
36
  };
39
- /**
40
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
41
- */
42
- export type UiAuthEventProps = CommonEventProps & {
43
- display: CardInnerAppearance;
44
- };
45
- /**
46
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
47
- */
48
- export type UiAuthAlternateAccountEventProps = CommonEventProps & {
49
- display: CardInnerAppearance;
50
- };
51
- /**
52
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
53
- */
54
- export type UiCardClickedEventProps = CommonEventProps & {
55
- id: string;
56
- display: CardInnerAppearance;
57
- status: CardType;
58
- isModifierKeyPressed?: boolean;
59
- actionSubjectId?: string;
60
- };
61
37
  export type UiActionClickedEventProps = CommonEventProps & {
62
38
  id?: string;
63
39
  display?: CardInnerAppearance;
64
40
  actionType: string;
65
41
  invokeType?: InvokeType;
66
42
  };
67
- /**
68
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
69
- */
70
- export type UiServerActionClickedEventProps = CommonEventProps & {
71
- smartLinkActionType: SmartLinkActionType;
72
- };
73
- /**
74
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
75
- */
76
- export type UiClosedAuthEventProps = CommonEventProps & {
77
- display: CardInnerAppearance;
78
- };
79
43
  export type UiRenderSuccessEventProps = CommonEventProps & {
80
44
  display: CardInnerAppearance;
81
45
  status: CardType;
@@ -86,30 +50,6 @@ export type UiRenderFailedEventProps = CommonEventProps & {
86
50
  error: Error;
87
51
  errorInfo: ErrorInfo;
88
52
  };
89
- /**
90
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
91
- */
92
- export type UiHoverCardViewedEventProps = CommonEventProps & {
93
- previewDisplay: PreviewDisplay;
94
- previewInvokeMethod?: PreviewInvokeMethod;
95
- status: CardType;
96
- };
97
- /**
98
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
99
- */
100
- export type UiHoverCardDismissedEventProps = CommonEventProps & {
101
- previewDisplay: PreviewDisplay;
102
- hoverTime: number;
103
- previewInvokeMethod?: PreviewInvokeMethod;
104
- status: CardType;
105
- };
106
- /**
107
- * @deprecated consider removing when cleaning up FF platform_migrate-some-ui-events-smart-card
108
- */
109
- export type UiHoverCardOpenLinkClickedEventProps = CommonEventProps & {
110
- previewDisplay: PreviewDisplay;
111
- previewInvokeMethod?: PreviewInvokeMethod;
112
- };
113
53
  export type ClickType = 'left' | 'middle' | 'right' | 'keyboard' | 'none';
114
54
  export type ClickOutcome = 'prevented' | 'clickThrough' | 'clickThroughNewTabOrWindow' | 'contextMenu' | 'alt' | 'contentEditable' | 'unknown';
115
55
  export type UiLinkClickedEventProps = {
@@ -91,27 +91,15 @@ export declare const fakeFactory: any;
91
91
  export declare const waitFor: (time?: number) => Promise<unknown>;
92
92
  export declare const mockAnalytics: {
93
93
  ui: {
94
- authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiAuthEventProps) => void;
95
- authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiAuthAlternateAccountEventProps) => void;
96
94
  buttonClickedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
97
95
  actionSubjectId: string;
98
96
  }) => void;
99
- cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("./analytics/types").UiCardClickedEventProps) => void;
100
97
  actionClickedEvent: ({ id, actionType, display, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiActionClickedEventProps) => void;
101
- hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("./analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
102
- closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiClosedAuthEventProps) => void;
103
98
  modalClosedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
104
99
  actionSubjectId: string;
105
100
  }) => void;
106
101
  renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, canBeDatasource, }: import("./analytics/types").UiRenderSuccessEventProps) => void;
107
102
  renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiRenderFailedEventProps) => void;
108
- hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("./analytics/types").UiHoverCardViewedEventProps) => void;
109
- hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("./analytics/types").UiHoverCardDismissedEventProps) => void;
110
- learnMoreClickedEvent: () => void;
111
- smartLinkLozengeActionClickedEvent: () => void;
112
- smartLinkLozengeActionListItemClickedEvent: () => void;
113
- smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
114
- smartLinkServerActionClickedEvent: (props: import("./analytics/types").UiServerActionClickedEventProps) => void;
115
103
  };
116
104
  operational: {
117
105
  invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
@@ -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;
@@ -27,5 +27,5 @@ type UnauthorisedViewContentProps = {
27
27
  * This component is used in unauthorized views of a smart link.
28
28
  * It represents the main text that provides a user with information on how to connect their account
29
29
  */
30
- declare const UnauthorisedViewContent: ({ providerName, isProductIntegrationSupported, testId, analytics, }: UnauthorisedViewContentProps) => JSX.Element;
30
+ declare const UnauthorisedViewContent: ({ providerName, isProductIntegrationSupported, testId, }: UnauthorisedViewContentProps) => JSX.Element;
31
31
  export default UnauthorisedViewContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "32.7.7",
3
+ "version": "32.7.9",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/popup": "^1.30.0",
57
57
  "@atlaskit/primitives": "^13.3.0",
58
58
  "@atlaskit/section-message": "^6.8.0",
59
- "@atlaskit/select": "^18.8.0",
59
+ "@atlaskit/select": "^18.9.0",
60
60
  "@atlaskit/spinner": "^16.3.0",
61
61
  "@atlaskit/textarea": "^5.7.0",
62
62
  "@atlaskit/textfield": "^6.7.0",
@@ -165,9 +165,6 @@
165
165
  "send-smart-link-rendered-ufo-event-half-time": {
166
166
  "type": "boolean"
167
167
  },
168
- "platform_migrate-some-ui-events-smart-card": {
169
- "type": "boolean"
170
- },
171
168
  "platform-visual-refresh-icons": {
172
169
  "type": "boolean"
173
170
  },