@atlaskit/smart-card 32.7.8 → 32.7.10
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.
- package/CHANGELOG.md +16 -0
- package/analytics.spec.yaml +31 -5
- package/dist/cjs/extractors/action/extract-invoke-preview-action.js +7 -6
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +5 -1
- package/dist/cjs/utils/analytics/LinkAnalyticsContext.js +2 -7
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +99 -6
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +2 -3
- package/dist/cjs/view/CardWithUrl/loader.js +15 -6
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +88 -32
- package/dist/cjs/view/FlexibleCard/components/container/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/index.js +2 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/cjs/view/HoverCard/index.js +15 -8
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +4 -1
- package/dist/cjs/view/InlineCard/index.js +3 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/action/extract-invoke-preview-action.js +8 -7
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +5 -1
- package/dist/es2019/utils/analytics/LinkAnalyticsContext.js +0 -3
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +97 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -3
- package/dist/es2019/view/CardWithUrl/loader.js +10 -2
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +88 -32
- package/dist/es2019/view/FlexibleCard/components/container/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/index.js +2 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/es2019/view/HoverCard/index.js +10 -2
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +3 -1
- package/dist/es2019/view/InlineCard/index.js +3 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/action/extract-invoke-preview-action.js +8 -7
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +5 -1
- package/dist/esm/utils/analytics/LinkAnalyticsContext.js +2 -7
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +95 -5
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -3
- package/dist/esm/view/CardWithUrl/loader.js +15 -6
- package/dist/esm/view/EmbedModal/components/analytics/index.js +88 -32
- package/dist/esm/view/FlexibleCard/components/container/index.js +2 -1
- package/dist/esm/view/FlexibleCard/index.js +2 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +1 -1
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +0 -1
- package/dist/esm/view/HoverCard/index.js +14 -4
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +4 -1
- package/dist/esm/view/InlineCard/index.js +3 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +16 -2
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
- package/dist/types/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
- package/dist/types/view/Card/types.d.ts +1 -0
- package/dist/types/view/CardWithUrl/types.d.ts +3 -0
- package/dist/types/view/EmbedModal/components/analytics/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/types.d.ts +1 -0
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +7 -2
- package/dist/types/view/InlineCard/types.d.ts +3 -0
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +16 -2
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +5 -1
- package/dist/types-ts4.5/utils/analytics/SmartLinkAnalyticsContext.d.ts +14 -0
- package/dist/types-ts4.5/view/Card/types.d.ts +1 -0
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +3 -0
- package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -0
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -0
- package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +7 -2
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +3 -0
- package/package.json +4 -1
|
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
import React, { useEffect, useMemo } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
7
8
|
import { SmartLinkStatus } from '../../constants';
|
|
8
9
|
import { FlexibleUiAnalyticsContext, FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
@@ -108,7 +109,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
108
109
|
showHoverPreview: showHoverPreview,
|
|
109
110
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
110
111
|
actionOptions: actionOptions,
|
|
111
|
-
showAuthTooltip: showAuthTooltip,
|
|
112
|
+
showAuthTooltip: fg('platform_deprecate-showauthtooltip-smart-card') ? undefined : showAuthTooltip,
|
|
112
113
|
status: status
|
|
113
114
|
}), children))));
|
|
114
115
|
};
|
|
@@ -20,7 +20,7 @@ import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAna
|
|
|
20
20
|
import CustomPopupContainer from '../components/CustomPopupContainer';
|
|
21
21
|
import HoverCardContent from '../components/HoverCardContent';
|
|
22
22
|
import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
|
|
23
|
-
var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
23
|
+
export var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
24
24
|
var FADE_IN_DELAY = 500;
|
|
25
25
|
var FADE_OUT_DELAY = 300;
|
|
26
26
|
var RESOLVE_DELAY = 100;
|
|
@@ -42,7 +42,6 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
42
42
|
display: CardDisplay.HoverCardPreview
|
|
43
43
|
});
|
|
44
44
|
fireEvent('ui.smartLink.renderSuccess', {
|
|
45
|
-
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
|
|
46
45
|
display: CardDisplay.HoverCardPreview
|
|
47
46
|
});
|
|
48
47
|
} else {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
/**
|
|
2
5
|
* @jsxRuntime classic
|
|
3
6
|
* @jsx jsx
|
|
@@ -15,7 +18,8 @@ import { CardDisplay } from '../../constants';
|
|
|
15
18
|
import { useSmartLinkAnalytics } from '../../state';
|
|
16
19
|
import { failUfoExperience, startUfoExperience } from '../../state/analytics';
|
|
17
20
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
18
|
-
import {
|
|
21
|
+
import { useSmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
|
|
22
|
+
import { HOVER_CARD_SOURCE, HoverCardComponent } from './components/HoverCardComponent';
|
|
19
23
|
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
20
24
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
21
25
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
@@ -23,17 +27,23 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
23
27
|
id = props.id,
|
|
24
28
|
children = props.children;
|
|
25
29
|
var analytics = useSmartLinkAnalytics(url, id);
|
|
30
|
+
var analyticsContext = useSmartLinkAnalyticsContext({
|
|
31
|
+
display: CardDisplay.HoverCardPreview,
|
|
32
|
+
id: id,
|
|
33
|
+
source: HOVER_CARD_SOURCE,
|
|
34
|
+
url: url
|
|
35
|
+
});
|
|
26
36
|
var onError = useCallback(function (error, info) {
|
|
27
37
|
if (fg('platform-smart-card-migrate-embed-modal-analytics')) {
|
|
28
38
|
startUfoExperience('smart-link-rendered', id || 'NULL');
|
|
29
39
|
failUfoExperience('smart-link-rendered', id || 'NULL');
|
|
30
40
|
failUfoExperience('smart-link-authenticated', id || 'NULL');
|
|
31
|
-
fireEvent('ui.smartLink.renderFailed', {
|
|
41
|
+
fireEvent('ui.smartLink.renderFailed', _objectSpread(_objectSpread({}, analyticsContext === null || analyticsContext === void 0 ? void 0 : analyticsContext.attributes), {}, {
|
|
32
42
|
display: CardDisplay.HoverCardPreview,
|
|
33
43
|
id: id !== null && id !== void 0 ? id : null,
|
|
34
44
|
error: error,
|
|
35
45
|
errorInfo: info
|
|
36
|
-
});
|
|
46
|
+
}));
|
|
37
47
|
} else {
|
|
38
48
|
analytics.ui.renderFailedEvent({
|
|
39
49
|
display: CardDisplay.HoverCardPreview,
|
|
@@ -42,7 +52,7 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
42
52
|
errorInfo: info
|
|
43
53
|
});
|
|
44
54
|
}
|
|
45
|
-
}, [analytics.ui, id, fireEvent]);
|
|
55
|
+
}, [analytics.ui, analyticsContext, id, fireEvent]);
|
|
46
56
|
return jsx(ErrorBoundary, {
|
|
47
57
|
fallback: children,
|
|
48
58
|
onError: onError
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
4
|
import Button from '@atlaskit/button';
|
|
5
5
|
import LockIcon from '@atlaskit/icon/glyph/lock-filled';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { N500, R400 } from '@atlaskit/theme/colors';
|
|
7
8
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
8
9
|
import { messages } from '../../../messages';
|
|
@@ -28,6 +29,8 @@ export var InlineCardUnauthorizedView = function InlineCardUnauthorizedView(_ref
|
|
|
28
29
|
testId = _ref$testId === void 0 ? 'inline-card-unauthorized-view' : _ref$testId,
|
|
29
30
|
_ref$showAuthTooltip = _ref.showAuthTooltip,
|
|
30
31
|
showAuthTooltip = _ref$showAuthTooltip === void 0 ? false : _ref$showAuthTooltip,
|
|
32
|
+
_ref$showHoverPreview = _ref.showHoverPreview,
|
|
33
|
+
showHoverPreview = _ref$showHoverPreview === void 0 ? false : _ref$showHoverPreview,
|
|
31
34
|
truncateInline = _ref.truncateInline,
|
|
32
35
|
context = _ref.context;
|
|
33
36
|
var frameRef = React.useRef(null);
|
|
@@ -66,7 +69,7 @@ export var InlineCardUnauthorizedView = function InlineCardUnauthorizedView(_ref
|
|
|
66
69
|
onClick: onClick,
|
|
67
70
|
titleColor: "var(--ds-text-subtle, ".concat(N500, ")")
|
|
68
71
|
}), renderActionButton());
|
|
69
|
-
if (onAuthorise && showAuthTooltip) {
|
|
72
|
+
if (onAuthorise && (fg('platform_deprecate-showauthtooltip-smart-card') ? showHoverPreview : showAuthTooltip)) {
|
|
70
73
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
71
74
|
url: url,
|
|
72
75
|
id: id
|
|
@@ -3,6 +3,7 @@ import React, { useEffect } from 'react';
|
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import { extractProvider } from '@atlaskit/link-extractors';
|
|
5
5
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { SmartLinkStatus } from '../../constants';
|
|
7
8
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context/extractAccessContext';
|
|
8
9
|
import { extractInlineProps } from '../../extractors/inline';
|
|
@@ -106,7 +107,8 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
106
107
|
onClick: handleFrameClick,
|
|
107
108
|
onAuthorise: handleAuthorize,
|
|
108
109
|
testId: testIdWithStatus,
|
|
109
|
-
showAuthTooltip: showAuthTooltip,
|
|
110
|
+
showAuthTooltip: fg('platform_deprecate-showauthtooltip-smart-card') ? undefined : showAuthTooltip,
|
|
111
|
+
showHoverPreview: showHoverPreview,
|
|
110
112
|
id: id,
|
|
111
113
|
analytics: analytics,
|
|
112
114
|
extensionKey: extensionKey,
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "32.7.
|
|
16
|
+
packageVersion: "32.7.10",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
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
|
-
* @
|
|
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
|
|
@@ -50,6 +50,7 @@ interface HoverPreviewProps extends ActionProps {
|
|
|
50
50
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
51
51
|
/**
|
|
52
52
|
* Flag to display unresolved views on hover preview.
|
|
53
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
53
54
|
*/
|
|
54
55
|
showAuthTooltip?: boolean;
|
|
55
56
|
}
|
|
@@ -27,6 +27,9 @@ export type CardWithUrlContentProps = {
|
|
|
27
27
|
children?: React.ReactNode;
|
|
28
28
|
showHoverPreview?: boolean;
|
|
29
29
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
32
|
+
*/
|
|
30
33
|
showAuthTooltip?: boolean;
|
|
31
34
|
analyticsEvents?: AnalyticsFacade;
|
|
32
35
|
placeholder?: string;
|
|
@@ -96,6 +96,7 @@ export type FlexibleCardProps = {
|
|
|
96
96
|
/**
|
|
97
97
|
* Determines whether to show an unauthorised view of the hover card
|
|
98
98
|
* when a user hovers over a smartlink.
|
|
99
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
99
100
|
*/
|
|
100
101
|
showAuthTooltip?: boolean;
|
|
101
102
|
};
|
|
@@ -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;
|
|
@@ -15,8 +15,13 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
15
15
|
isSelected?: boolean;
|
|
16
16
|
/** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
|
|
17
17
|
testId?: string;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* A flag that determines is a tooltip should show up on hover over the unauthorised link
|
|
20
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
21
|
+
*/
|
|
19
22
|
showAuthTooltip?: boolean;
|
|
23
|
+
/** Enables showing a custom preview on hover of link */
|
|
24
|
+
showHoverPreview?: boolean;
|
|
20
25
|
/** A smart link id that may be used in analytics */
|
|
21
26
|
id?: string;
|
|
22
27
|
/** An AnalyticsFacade object used for calling analytics. */
|
|
@@ -26,4 +31,4 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
26
31
|
/** Truncates the card to one line */
|
|
27
32
|
truncateInline?: boolean;
|
|
28
33
|
}
|
|
29
|
-
export declare const InlineCardUnauthorizedView: ({ url, id, icon, onAuthorise, onClick, isSelected, testId, showAuthTooltip, truncateInline, context, }: InlineCardUnauthorizedViewProps) => JSX.Element;
|
|
34
|
+
export declare const InlineCardUnauthorizedView: ({ url, id, icon, onAuthorise, onClick, isSelected, testId, showAuthTooltip, showHoverPreview, truncateInline, context, }: InlineCardUnauthorizedViewProps) => JSX.Element;
|
|
@@ -23,6 +23,9 @@ export type InlineCardProps = {
|
|
|
23
23
|
renderers?: CardProviderRenderers;
|
|
24
24
|
showHoverPreview?: boolean;
|
|
25
25
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
28
|
+
*/
|
|
26
29
|
showAuthTooltip?: boolean;
|
|
27
30
|
actionOptions?: CardActionOptions;
|
|
28
31
|
analytics: AnalyticsFacade;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
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
|
-
* @
|
|
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
|
|
@@ -50,6 +50,7 @@ interface HoverPreviewProps extends ActionProps {
|
|
|
50
50
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
51
51
|
/**
|
|
52
52
|
* Flag to display unresolved views on hover preview.
|
|
53
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
53
54
|
*/
|
|
54
55
|
showAuthTooltip?: boolean;
|
|
55
56
|
}
|
|
@@ -27,6 +27,9 @@ export type CardWithUrlContentProps = {
|
|
|
27
27
|
children?: React.ReactNode;
|
|
28
28
|
showHoverPreview?: boolean;
|
|
29
29
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
32
|
+
*/
|
|
30
33
|
showAuthTooltip?: boolean;
|
|
31
34
|
analyticsEvents?: AnalyticsFacade;
|
|
32
35
|
placeholder?: string;
|
|
@@ -96,6 +96,7 @@ export type FlexibleCardProps = {
|
|
|
96
96
|
/**
|
|
97
97
|
* Determines whether to show an unauthorised view of the hover card
|
|
98
98
|
* when a user hovers over a smartlink.
|
|
99
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
99
100
|
*/
|
|
100
101
|
showAuthTooltip?: boolean;
|
|
101
102
|
};
|
|
@@ -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;
|
|
@@ -15,8 +15,13 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
15
15
|
isSelected?: boolean;
|
|
16
16
|
/** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
|
|
17
17
|
testId?: string;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* A flag that determines is a tooltip should show up on hover over the unauthorised link
|
|
20
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
21
|
+
*/
|
|
19
22
|
showAuthTooltip?: boolean;
|
|
23
|
+
/** Enables showing a custom preview on hover of link */
|
|
24
|
+
showHoverPreview?: boolean;
|
|
20
25
|
/** A smart link id that may be used in analytics */
|
|
21
26
|
id?: string;
|
|
22
27
|
/** An AnalyticsFacade object used for calling analytics. */
|
|
@@ -26,4 +31,4 @@ export interface InlineCardUnauthorizedViewProps {
|
|
|
26
31
|
/** Truncates the card to one line */
|
|
27
32
|
truncateInline?: boolean;
|
|
28
33
|
}
|
|
29
|
-
export declare const InlineCardUnauthorizedView: ({ url, id, icon, onAuthorise, onClick, isSelected, testId, showAuthTooltip, truncateInline, context, }: InlineCardUnauthorizedViewProps) => JSX.Element;
|
|
34
|
+
export declare const InlineCardUnauthorizedView: ({ url, id, icon, onAuthorise, onClick, isSelected, testId, showAuthTooltip, showHoverPreview, truncateInline, context, }: InlineCardUnauthorizedViewProps) => JSX.Element;
|
|
@@ -23,6 +23,9 @@ export type InlineCardProps = {
|
|
|
23
23
|
renderers?: CardProviderRenderers;
|
|
24
24
|
showHoverPreview?: boolean;
|
|
25
25
|
hoverPreviewOptions?: HoverPreviewOptions;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-23150 Internal documentation for deprecation (no external access)}
|
|
28
|
+
*/
|
|
26
29
|
showAuthTooltip?: boolean;
|
|
27
30
|
actionOptions?: CardActionOptions;
|
|
28
31
|
analytics: AnalyticsFacade;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "32.7.
|
|
3
|
+
"version": "32.7.10",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -171,6 +171,9 @@
|
|
|
171
171
|
"linking_platform_show_lozenge_atlassian_state": {
|
|
172
172
|
"type": "boolean"
|
|
173
173
|
},
|
|
174
|
+
"platform_deprecate-showauthtooltip-smart-card": {
|
|
175
|
+
"type": "boolean"
|
|
176
|
+
},
|
|
174
177
|
"smart_links_for_plans_platform": {
|
|
175
178
|
"type": "boolean"
|
|
176
179
|
},
|