@atlaskit/smart-card 22.0.0 → 22.1.2
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 +22 -0
- package/dist/cjs/__tests_external__/index.js +53 -0
- package/dist/cjs/__tests_external__/page-objects/BaseCard.js +115 -0
- package/dist/cjs/__tests_external__/page-objects/BlockCard.js +43 -0
- package/dist/cjs/__tests_external__/page-objects/EmbedCard.js +43 -0
- package/dist/cjs/__tests_external__/page-objects/InlineCard.js +43 -0
- package/dist/cjs/__tests_external__/test-cases/card.js +27 -0
- package/dist/cjs/__tests_external__/test-cases/embed.js +27 -0
- package/dist/cjs/__tests_external__/test-cases/inline.js +27 -0
- package/dist/cjs/__tests_external__/test-cases/types.js +5 -0
- package/dist/cjs/extractors/block/index.js +6 -7
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +16 -27
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +43 -0
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +5 -3
- package/dist/cjs/utils/analytics/analytics.js +2 -2
- package/dist/cjs/utils/mocks.js +28 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/actions/PreviewAction.js +2 -2
- package/dist/cjs/view/BlockCard/index.js +6 -5
- package/dist/cjs/view/CardWithUrl/component.js +2 -2
- package/dist/cjs/view/EmbedCard/index.js +3 -2
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +100 -0
- package/dist/cjs/view/EmbedModal/components/analytics/types.js +5 -0
- package/dist/cjs/view/EmbedModal/components/size-experiment/index.js +5 -10
- package/dist/cjs/view/EmbedModal/index.js +54 -15
- package/dist/cjs/view/EmbedModal/types.js +9 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +2 -2
- package/dist/cjs/view/common/Modal.js +29 -4
- package/dist/cjs/view/common/ModalHeader.js +3 -2
- package/dist/es2019/__tests_external__/index.js +6 -0
- package/dist/es2019/__tests_external__/page-objects/BaseCard.js +61 -0
- package/dist/es2019/__tests_external__/page-objects/BlockCard.js +8 -0
- package/dist/es2019/__tests_external__/page-objects/EmbedCard.js +8 -0
- package/dist/es2019/__tests_external__/page-objects/InlineCard.js +8 -0
- package/dist/es2019/__tests_external__/test-cases/card.js +14 -0
- package/dist/es2019/__tests_external__/test-cases/embed.js +14 -0
- package/dist/es2019/__tests_external__/test-cases/inline.js +14 -0
- package/dist/es2019/__tests_external__/test-cases/types.js +1 -0
- package/dist/es2019/extractors/block/index.js +6 -7
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +16 -18
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +46 -3
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +5 -3
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/mocks.js +26 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/actions/PreviewAction.js +3 -3
- package/dist/es2019/view/BlockCard/index.js +5 -4
- package/dist/es2019/view/CardWithUrl/component.js +2 -2
- package/dist/es2019/view/EmbedCard/index.js +3 -2
- package/dist/es2019/view/EmbedModal/components/analytics/index.js +80 -0
- package/dist/es2019/view/EmbedModal/components/analytics/types.js +1 -0
- package/dist/es2019/view/EmbedModal/components/size-experiment/index.js +5 -9
- package/dist/es2019/view/EmbedModal/index.js +46 -13
- package/dist/es2019/view/EmbedModal/types.js +6 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +0 -2
- package/dist/es2019/view/common/Modal.js +27 -6
- package/dist/es2019/view/common/ModalHeader.js +3 -2
- package/dist/esm/__tests_external__/index.js +6 -0
- package/dist/esm/__tests_external__/page-objects/BaseCard.js +101 -0
- package/dist/esm/__tests_external__/page-objects/BlockCard.js +28 -0
- package/dist/esm/__tests_external__/page-objects/EmbedCard.js +28 -0
- package/dist/esm/__tests_external__/page-objects/InlineCard.js +28 -0
- package/dist/esm/__tests_external__/test-cases/card.js +16 -0
- package/dist/esm/__tests_external__/test-cases/embed.js +16 -0
- package/dist/esm/__tests_external__/test-cases/inline.js +16 -0
- package/dist/esm/__tests_external__/test-cases/types.js +1 -0
- package/dist/esm/extractors/block/index.js +6 -7
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +17 -27
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +45 -2
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +5 -3
- package/dist/esm/utils/analytics/analytics.js +2 -2
- package/dist/esm/utils/mocks.js +25 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +3 -3
- package/dist/esm/view/BlockCard/index.js +5 -4
- package/dist/esm/view/CardWithUrl/component.js +2 -2
- package/dist/esm/view/EmbedCard/index.js +3 -2
- package/dist/esm/view/EmbedModal/components/analytics/index.js +82 -0
- package/dist/esm/view/EmbedModal/components/analytics/types.js +1 -0
- package/dist/esm/view/EmbedModal/components/size-experiment/index.js +5 -10
- package/dist/esm/view/EmbedModal/index.js +52 -15
- package/dist/esm/view/EmbedModal/types.js +6 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +2 -1
- package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +2 -2
- package/dist/esm/view/common/Modal.js +28 -6
- package/dist/esm/view/common/ModalHeader.js +3 -2
- package/dist/types/extractors/block/types.d.ts +4 -2
- package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +7 -5
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +23 -1
- package/dist/types/state/hooks/useSmartLink.d.ts +9 -0
- package/dist/types/state/hooks-external/useSmartLinkActions.d.ts +6 -2
- package/dist/types/utils/mocks.d.ts +48 -0
- package/dist/types/utils/types.d.ts +3 -1
- package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +4 -0
- package/dist/types/view/BlockCard/index.d.ts +2 -2
- package/dist/types/view/BlockCard/types.d.ts +4 -4
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/EmbedCard/types.d.ts +2 -2
- package/dist/types/view/EmbedModal/components/analytics/index.d.ts +5 -0
- package/dist/types/view/EmbedModal/components/analytics/types.d.ts +6 -0
- package/dist/types/view/EmbedModal/components/size-experiment/index.d.ts +4 -3
- package/dist/types/view/EmbedModal/index.d.ts +3 -1
- package/dist/types/view/EmbedModal/types.d.ts +14 -4
- package/dist/types/view/HoverCard/index.d.ts +1 -1
- package/dist/types/view/common/Modal.d.ts +6 -8
- package/package.json +22 -22
- package/report.api.md +35 -3
|
@@ -5,7 +5,6 @@ import { extractBlockProps } from '../../extractors/block';
|
|
|
5
5
|
import { getEmptyJsonLd, getUnauthorizedJsonLd } from '../../utils/jsonld';
|
|
6
6
|
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
7
7
|
import { CardLinkView } from '../LinkView';
|
|
8
|
-
export { default as PreviewAction } from './actions/PreviewAction';
|
|
9
8
|
import { AuthorizeAction } from './actions/AuthorizeAction';
|
|
10
9
|
import { ForbiddenAction } from './actions/ForbiddenAction';
|
|
11
10
|
import { ResolvedView as BlockCardResolvedView } from './views/ResolvedView';
|
|
@@ -15,6 +14,7 @@ import { UnauthorizedView as BlockCardUnauthorisedView } from './views/Unauthori
|
|
|
15
14
|
import { ForbiddenView as BlockCardForbiddenView } from './views/ForbiddenView';
|
|
16
15
|
import { ErroredView as BlockCardErroredView } from './views/ErroredView';
|
|
17
16
|
import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
17
|
+
export { default as PreviewAction } from './actions/PreviewAction';
|
|
18
18
|
export { ForbiddenAction, AuthorizeAction, BlockCardResolvedView, BlockCardResolvingView, BlockCardUnauthorisedView, BlockCardForbiddenView, BlockCardErroredView, BlockCardNotFoundView };
|
|
19
19
|
export var BlockCard = function BlockCard(_ref) {
|
|
20
20
|
var _details$meta, _forbiddenViewProps$c;
|
|
@@ -27,7 +27,6 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
27
27
|
handleAuthorize = _ref.handleAuthorize,
|
|
28
28
|
handleErrorRetry = _ref.handleErrorRetry,
|
|
29
29
|
handleFrameClick = _ref.handleFrameClick,
|
|
30
|
-
handleAnalytics = _ref.handleAnalytics,
|
|
31
30
|
handleInvoke = _ref.handleInvoke,
|
|
32
31
|
renderers = _ref.renderers,
|
|
33
32
|
isSelected = _ref.isSelected,
|
|
@@ -35,7 +34,8 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
35
34
|
onError = _ref.onError,
|
|
36
35
|
testId = _ref.testId,
|
|
37
36
|
showActions = _ref.showActions,
|
|
38
|
-
platform = _ref.platform
|
|
37
|
+
platform = _ref.platform,
|
|
38
|
+
analytics = _ref.analytics;
|
|
39
39
|
// Actions do not have access to the react tree, so we need to obtain
|
|
40
40
|
// feature flags here where we still can access SmartLinkContext context
|
|
41
41
|
// and pass the flags down to the extractor. See PreviewAction.tsx for details.
|
|
@@ -46,8 +46,9 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
46
46
|
var data = details && details.data || getEmptyJsonLd();
|
|
47
47
|
var meta = details && details.meta;
|
|
48
48
|
var extractorOpts = {
|
|
49
|
+
analytics: analytics,
|
|
50
|
+
origin: 'smartLinkCard',
|
|
49
51
|
featureFlags: featureFlags,
|
|
50
|
-
handleAnalytics: handleAnalytics,
|
|
51
52
|
handleInvoke: handleInvoke,
|
|
52
53
|
extensionKey: getExtensionKey(details)
|
|
53
54
|
};
|
|
@@ -182,7 +182,7 @@ export function CardWithUrlContent(_ref) {
|
|
|
182
182
|
handleErrorRetry: handleRetry,
|
|
183
183
|
handleInvoke: handleInvoke,
|
|
184
184
|
handleFrameClick: handleClickWrapper,
|
|
185
|
-
|
|
185
|
+
analytics: analytics,
|
|
186
186
|
isSelected: isSelected,
|
|
187
187
|
onResolve: onResolve,
|
|
188
188
|
onError: onError,
|
|
@@ -200,7 +200,7 @@ export function CardWithUrlContent(_ref) {
|
|
|
200
200
|
handleErrorRetry: handleRetry,
|
|
201
201
|
handleFrameClick: handleClickWrapper,
|
|
202
202
|
handleInvoke: handleInvoke,
|
|
203
|
-
|
|
203
|
+
analytics: analytics,
|
|
204
204
|
isSelected: isSelected,
|
|
205
205
|
isFrameVisible: isFrameVisible,
|
|
206
206
|
platform: platform,
|
|
@@ -23,7 +23,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
23
23
|
handleAuthorize = _ref.handleAuthorize,
|
|
24
24
|
handleErrorRetry = _ref.handleErrorRetry,
|
|
25
25
|
handleFrameClick = _ref.handleFrameClick,
|
|
26
|
-
|
|
26
|
+
analytics = _ref.analytics,
|
|
27
27
|
handleInvoke = _ref.handleInvoke,
|
|
28
28
|
showActions = _ref.showActions,
|
|
29
29
|
isSelected = _ref.isSelected,
|
|
@@ -77,7 +77,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
var resolvedBlockViewProps = extractBlockProps(data, meta, {
|
|
80
|
-
|
|
80
|
+
analytics: analytics,
|
|
81
|
+
origin: 'smartLinkEmbed',
|
|
81
82
|
handleInvoke: handleInvoke,
|
|
82
83
|
extensionKey: getExtensionKey(details)
|
|
83
84
|
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { EmbedModalSize } from '../../types';
|
|
4
|
+
|
|
5
|
+
var getResizeFrom = function getResizeFrom(size) {
|
|
6
|
+
return size === EmbedModalSize.Small ? EmbedModalSize.Large : EmbedModalSize.Small;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
var withAnalytics = function withAnalytics(Component) {
|
|
10
|
+
return function (props) {
|
|
11
|
+
var analytics = props.analytics,
|
|
12
|
+
onClose = props.onClose,
|
|
13
|
+
onOpen = props.onOpen,
|
|
14
|
+
onOpenFailed = props.onOpenFailed,
|
|
15
|
+
onResize = props.onResize,
|
|
16
|
+
origin = props.origin;
|
|
17
|
+
var handleOnOpen = useCallback(function (context) {
|
|
18
|
+
analytics.screen.modalViewedEvent({
|
|
19
|
+
name: 'embedPreviewModal',
|
|
20
|
+
attributes: {
|
|
21
|
+
origin: origin,
|
|
22
|
+
size: context.size
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
analytics.ui.renderSuccessEvent({
|
|
26
|
+
status: 'resolved',
|
|
27
|
+
display: 'preview'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (onOpen) {
|
|
31
|
+
onOpen(context);
|
|
32
|
+
}
|
|
33
|
+
}, [analytics.screen, analytics.ui, onOpen, origin]);
|
|
34
|
+
var handleOnOpenFailed = useCallback(function (error, errorInfo) {
|
|
35
|
+
analytics.ui.renderFailedEvent({
|
|
36
|
+
display: 'preview',
|
|
37
|
+
error: error,
|
|
38
|
+
errorInfo: errorInfo
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (onOpenFailed) {
|
|
42
|
+
onOpenFailed(error, errorInfo);
|
|
43
|
+
}
|
|
44
|
+
}, [analytics.ui, onOpenFailed]);
|
|
45
|
+
var handleOnClose = useCallback(function (context) {
|
|
46
|
+
analytics.ui.modalClosedEvent({
|
|
47
|
+
actionSubjectId: 'embedPreview',
|
|
48
|
+
attributes: {
|
|
49
|
+
origin: origin,
|
|
50
|
+
previewTime: context.duration,
|
|
51
|
+
size: context.size
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
if (onClose) {
|
|
56
|
+
onClose(context);
|
|
57
|
+
}
|
|
58
|
+
}, [analytics.ui, onClose, origin]);
|
|
59
|
+
var handleOnResize = useCallback(function (context) {
|
|
60
|
+
analytics.ui.buttonClickedEvent({
|
|
61
|
+
actionSubjectId: 'embedPreviewResize',
|
|
62
|
+
attributes: {
|
|
63
|
+
newSize: context.size,
|
|
64
|
+
origin: origin,
|
|
65
|
+
previousSize: getResizeFrom(context.size)
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
if (onResize) {
|
|
70
|
+
onResize(context);
|
|
71
|
+
}
|
|
72
|
+
}, [analytics.ui, onResize, origin]);
|
|
73
|
+
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
74
|
+
onClose: handleOnClose,
|
|
75
|
+
onOpen: handleOnOpen,
|
|
76
|
+
onOpenFailed: handleOnOpenFailed,
|
|
77
|
+
onResize: handleOnResize
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default withAnalytics;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Modal from '../../../common/Modal';
|
|
4
|
-
import {
|
|
4
|
+
import { EmbedModalSize } from '../../types';
|
|
5
5
|
|
|
6
6
|
var withSizeExperiment = function withSizeExperiment(Component) {
|
|
7
7
|
return function (props) {
|
|
8
8
|
var _props$featureFlags = props.featureFlags,
|
|
9
|
-
featureFlags = _props$featureFlags === void 0 ? {} : _props$featureFlags
|
|
10
|
-
|
|
11
|
-
closeLabel = _props$closeLabel === void 0 ? 'Close Preview' : _props$closeLabel;
|
|
12
|
-
var embedModalSize = featureFlags.embedModalSize; // Experiment
|
|
9
|
+
featureFlags = _props$featureFlags === void 0 ? {} : _props$featureFlags;
|
|
10
|
+
var size = featureFlags.embedModalSize; // Experiment
|
|
13
11
|
|
|
14
|
-
if (
|
|
15
|
-
var size = embedModalSize === 'large' ? MAX_MODAL_SIZE : MIN_MODAL_SIZE;
|
|
12
|
+
if (size === EmbedModalSize.Large || size === EmbedModalSize.Small) {
|
|
16
13
|
return /*#__PURE__*/React.createElement(Component, _extends({}, props, {
|
|
17
14
|
size: size
|
|
18
15
|
}));
|
|
19
16
|
} // Control
|
|
20
17
|
|
|
21
18
|
|
|
22
|
-
return /*#__PURE__*/React.createElement(Modal,
|
|
23
|
-
closeLabel: closeLabel
|
|
24
|
-
}));
|
|
19
|
+
return /*#__PURE__*/React.createElement(Modal, props);
|
|
25
20
|
};
|
|
26
21
|
};
|
|
27
22
|
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
3
3
|
import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
|
|
4
4
|
import LinkInfo from './components/link-info';
|
|
5
5
|
import { MAX_MODAL_SIZE, MIN_MODAL_SIZE } from './constants';
|
|
6
6
|
import EmbedContent from './components/embed-content';
|
|
7
|
+
import { EmbedModalSize } from './types';
|
|
7
8
|
import withErrorBoundary from './components/error-boundary';
|
|
8
9
|
import withSizeExperiment from './components/size-experiment';
|
|
10
|
+
import withAnalytics from './components/analytics';
|
|
11
|
+
|
|
12
|
+
var toSize = function toSize(width) {
|
|
13
|
+
return width === MAX_MODAL_SIZE ? EmbedModalSize.Large : EmbedModalSize.Small;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var toWidth = function toWidth(size) {
|
|
17
|
+
return size === EmbedModalSize.Large ? MAX_MODAL_SIZE : MIN_MODAL_SIZE;
|
|
18
|
+
};
|
|
9
19
|
|
|
10
20
|
var EmbedModal = function EmbedModal(_ref) {
|
|
11
21
|
var downloadUrl = _ref.download,
|
|
@@ -16,49 +26,76 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
16
26
|
onClose = _ref.onClose,
|
|
17
27
|
onDownloadActionClick = _ref.onDownloadActionClick,
|
|
18
28
|
onOpen = _ref.onOpen,
|
|
29
|
+
onResize = _ref.onResize,
|
|
19
30
|
onViewActionClick = _ref.onViewActionClick,
|
|
20
31
|
providerName = _ref.providerName,
|
|
21
32
|
showModal = _ref.showModal,
|
|
22
33
|
_ref$size = _ref.size,
|
|
23
|
-
|
|
34
|
+
size = _ref$size === void 0 ? EmbedModalSize.Small : _ref$size,
|
|
24
35
|
src = _ref.src,
|
|
25
36
|
_ref$testId = _ref.testId,
|
|
26
37
|
testId = _ref$testId === void 0 ? 'smart-embed-preview-modal' : _ref$testId,
|
|
27
38
|
title = _ref.title,
|
|
28
39
|
url = _ref.url;
|
|
40
|
+
var defaultWidth = toWidth(size);
|
|
29
41
|
|
|
30
42
|
var _useState = useState(showModal),
|
|
31
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
32
44
|
isOpen = _useState2[0],
|
|
33
45
|
setIsOpen = _useState2[1];
|
|
34
46
|
|
|
35
|
-
var _useState3 = useState(
|
|
47
|
+
var _useState3 = useState(defaultWidth),
|
|
36
48
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
width = _useState4[0],
|
|
50
|
+
setWidth = _useState4[1];
|
|
51
|
+
|
|
52
|
+
var openAt = useRef();
|
|
53
|
+
var handleOnOpenComplete = useCallback(function () {
|
|
54
|
+
openAt.current = Date.now();
|
|
39
55
|
|
|
56
|
+
if (onOpen) {
|
|
57
|
+
onOpen({
|
|
58
|
+
size: size
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, [onOpen, size]);
|
|
40
62
|
var handleOnClose = useCallback(function () {
|
|
41
63
|
return setIsOpen(false);
|
|
42
64
|
}, []);
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
65
|
+
var handleOnCloseComplete = useCallback(function () {
|
|
66
|
+
if (onClose) {
|
|
67
|
+
var duration = openAt.current ? Date.now() - openAt.current : undefined;
|
|
68
|
+
onClose({
|
|
69
|
+
duration: duration,
|
|
70
|
+
size: toSize(width)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}, [onClose, width]);
|
|
74
|
+
var handleOnResizeClick = useCallback(function () {
|
|
75
|
+
var newWidth = width === MIN_MODAL_SIZE ? MAX_MODAL_SIZE : MIN_MODAL_SIZE;
|
|
76
|
+
setWidth(newWidth);
|
|
77
|
+
|
|
78
|
+
if (onResize) {
|
|
79
|
+
onResize({
|
|
80
|
+
size: toSize(newWidth)
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}, [onResize, width]);
|
|
47
84
|
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
48
85
|
height: "100%",
|
|
49
86
|
onClose: handleOnClose,
|
|
50
|
-
onCloseComplete:
|
|
51
|
-
onOpenComplete:
|
|
87
|
+
onCloseComplete: handleOnCloseComplete,
|
|
88
|
+
onOpenComplete: handleOnOpenComplete,
|
|
52
89
|
testId: testId,
|
|
53
|
-
width:
|
|
90
|
+
width: width
|
|
54
91
|
}, /*#__PURE__*/React.createElement(LinkInfo, {
|
|
55
92
|
downloadUrl: downloadUrl,
|
|
56
93
|
icon: icon,
|
|
57
94
|
providerName: providerName,
|
|
58
95
|
onViewButtonClick: onViewActionClick,
|
|
59
96
|
onDownloadButtonClick: onDownloadActionClick,
|
|
60
|
-
onResizeButtonClick:
|
|
61
|
-
size:
|
|
97
|
+
onResizeButtonClick: handleOnResizeClick,
|
|
98
|
+
size: width,
|
|
62
99
|
title: title,
|
|
63
100
|
testId: testId,
|
|
64
101
|
url: url
|
|
@@ -70,4 +107,4 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
70
107
|
}))));
|
|
71
108
|
};
|
|
72
109
|
|
|
73
|
-
export default withSizeExperiment(withErrorBoundary(EmbedModal));
|
|
110
|
+
export default withSizeExperiment(withAnalytics(withErrorBoundary(EmbedModal)));
|
|
@@ -98,7 +98,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
98
98
|
var linkActions = useSmartLinkActions({
|
|
99
99
|
url: url,
|
|
100
100
|
appearance: SMART_CARD_ANALYTICS_DISPLAY,
|
|
101
|
-
analyticsHandler: analyticsHandler
|
|
101
|
+
analyticsHandler: analyticsHandler,
|
|
102
|
+
origin: 'smartLinkPreviewHoverCard'
|
|
102
103
|
});
|
|
103
104
|
var onActionClick = useCallback(function (actionId) {
|
|
104
105
|
if (actionId === 'preview-content') {
|
|
@@ -21,9 +21,9 @@ export var EmojiWrapper = styled.span(_templateObject2 || (_templateObject2 = _t
|
|
|
21
21
|
|
|
22
22
|
export var IconTitleWrapper = styled.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n white-space: pre-wrap;\n word-break: break-all;\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
|
|
23
23
|
|
|
24
|
-
export var LozengeWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: 1px;\n & > span {\n margin-left: 4px;\n
|
|
24
|
+
export var LozengeWrapper = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: inline-block;\n vertical-align: 1px;\n & > span {\n margin-left: 4px;\n }\n"]))); // TODO: Replace overrides with proper AtlasKit solution.
|
|
25
25
|
|
|
26
|
-
export var LozengeBlockWrapper = styled.span(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & > span {\n margin-left: 4px;\n
|
|
26
|
+
export var LozengeBlockWrapper = styled.span(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n & > span {\n margin-left: 4px;\n }\n"])));
|
|
27
27
|
export var RightIconPositionWrapper = styled.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin-left: 2px;\n margin-right: 4px;\n position: relative;\n display: inline-block;\n"]))); // The following components are used to absolutely position icons in the vertical center.
|
|
28
28
|
// - IconPositionWrapper: the `relative` parent which has no height in itself.
|
|
29
29
|
// - IconEmptyWrapper: the child which forces `IconPositionWrapper` to have a height.
|
|
@@ -25,10 +25,12 @@ manually passed to your custom components.
|
|
|
25
25
|
|
|
26
26
|
For a complete guide on customization using the new compositional API, refer to the docs at
|
|
27
27
|
https://atlassian.design/components/modal-dialog/examples#customizing-modal-dialog. */
|
|
28
|
-
import React, { useState } from 'react';
|
|
29
|
-
import ModalDialog, {
|
|
28
|
+
import React, { useCallback, useRef, useState } from 'react';
|
|
29
|
+
import ModalDialog, { ModalBody, ModalTransition } from '@atlaskit/modal-dialog';
|
|
30
30
|
import { Header } from './ModalHeader';
|
|
31
31
|
import { getIframeSandboxAttribute } from '../../utils';
|
|
32
|
+
import withAnalytics from '../EmbedModal/components/analytics';
|
|
33
|
+
import { EmbedModalSize } from '../EmbedModal/types';
|
|
32
34
|
var iframeStyles = {
|
|
33
35
|
width: "100%",
|
|
34
36
|
height: 'calc(100vh - 248px)'
|
|
@@ -72,7 +74,8 @@ var Modal = function Modal(_ref) {
|
|
|
72
74
|
providerName = _ref.providerName,
|
|
73
75
|
metadata = _ref.metadata,
|
|
74
76
|
icon = _ref.icon,
|
|
75
|
-
closeLabel = _ref.closeLabel,
|
|
77
|
+
_ref$closeLabel = _ref.closeLabel,
|
|
78
|
+
closeLabel = _ref$closeLabel === void 0 ? 'Close Preview' : _ref$closeLabel,
|
|
76
79
|
iframeName = _ref.iframeName,
|
|
77
80
|
title = _ref.title,
|
|
78
81
|
url = _ref.url,
|
|
@@ -88,16 +91,35 @@ var Modal = function Modal(_ref) {
|
|
|
88
91
|
isOpen = _useState2[0],
|
|
89
92
|
setIsOpen = _useState2[1];
|
|
90
93
|
|
|
94
|
+
var openAt = useRef();
|
|
95
|
+
var handleOnOpenComplete = useCallback(function () {
|
|
96
|
+
openAt.current = Date.now();
|
|
97
|
+
|
|
98
|
+
if (onOpen) {
|
|
99
|
+
onOpen({
|
|
100
|
+
size: EmbedModalSize.Small
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}, [onOpen]);
|
|
104
|
+
var handleOnCloseComplete = useCallback(function () {
|
|
105
|
+
if (onClose) {
|
|
106
|
+
var duration = openAt.current ? Date.now() - openAt.current : undefined;
|
|
107
|
+
onClose({
|
|
108
|
+
duration: duration,
|
|
109
|
+
size: EmbedModalSize.Small
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}, [onClose]);
|
|
91
113
|
var sandbox = getIframeSandboxAttribute(isTrusted);
|
|
92
114
|
return /*#__PURE__*/React.createElement(ModalTransition, null, isOpen && /*#__PURE__*/React.createElement(ModalDialog, {
|
|
93
115
|
height: "100%",
|
|
94
116
|
width: "large",
|
|
95
117
|
testId: testId,
|
|
96
|
-
onOpenComplete:
|
|
118
|
+
onOpenComplete: handleOnOpenComplete,
|
|
97
119
|
onClose: function onClose() {
|
|
98
120
|
setIsOpen(false);
|
|
99
121
|
},
|
|
100
|
-
onCloseComplete:
|
|
122
|
+
onCloseComplete: handleOnCloseComplete
|
|
101
123
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
102
124
|
providerName: providerName,
|
|
103
125
|
icon: icon,
|
|
@@ -123,4 +145,4 @@ var Modal = function Modal(_ref) {
|
|
|
123
145
|
}))));
|
|
124
146
|
};
|
|
125
147
|
|
|
126
|
-
export default ModalWithErrorBoundary;
|
|
148
|
+
export default withAnalytics(ModalWithErrorBoundary);
|
|
@@ -75,7 +75,7 @@ export var Header = function Header(_ref) {
|
|
|
75
75
|
testId: "preview-view-action",
|
|
76
76
|
iconAfter: jsx(ShortcutIcon, {
|
|
77
77
|
size: "small",
|
|
78
|
-
label: "
|
|
78
|
+
label: ""
|
|
79
79
|
}),
|
|
80
80
|
onClick: onViewActionClick
|
|
81
81
|
}, providerName ? jsx(F, null, jsx(FormattedMessage, messages.viewIn), " ", providerName) : jsx(FormattedMessage, messages.viewOriginal)), jsx(Button, {
|
|
@@ -83,6 +83,7 @@ export var Header = function Header(_ref) {
|
|
|
83
83
|
iconBefore: jsx(EditorCloseIcon, {
|
|
84
84
|
label: label
|
|
85
85
|
}),
|
|
86
|
-
onClick: onClose
|
|
86
|
+
onClick: onClose,
|
|
87
|
+
testId: "preview-close-button"
|
|
87
88
|
}))));
|
|
88
89
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { LinkingPlatformFeatureFlags } from '@atlaskit/linking-common';
|
|
2
2
|
import { InvokeHandler } from '../../model/invoke-handler';
|
|
3
|
-
import {
|
|
3
|
+
import { AnalyticsFacade } from '../../state/analytics';
|
|
4
4
|
import { CardInnerAppearance } from '../../view/Card/types';
|
|
5
|
+
import { AnalyticsOrigin } from '../../utils/types';
|
|
5
6
|
export interface ExtractBlockOpts {
|
|
6
7
|
handleInvoke: InvokeHandler;
|
|
7
|
-
|
|
8
|
+
analytics: AnalyticsFacade;
|
|
9
|
+
origin?: AnalyticsOrigin;
|
|
8
10
|
extensionKey?: string;
|
|
9
11
|
featureFlags?: Partial<LinkingPlatformFeatureFlags>;
|
|
10
12
|
source?: CardInnerAppearance;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
-
import {
|
|
3
|
-
import { InvokeHandler } from '../../../model/invoke-handler';
|
|
4
|
-
import { CardInnerAppearance } from '../../../view/Card/types';
|
|
5
|
-
import { AnalyticsHandler } from '../../../utils/types';
|
|
2
|
+
import { CardPlatform } from '../../../view/Card/types';
|
|
6
3
|
import { BlockCardResolvedViewProps } from '../../../view/BlockCard';
|
|
7
|
-
|
|
4
|
+
import { ExtractBlockOpts } from '../../block/types';
|
|
5
|
+
export declare const extractPreviewAction: ({ extensionKey, viewProps, jsonLd, handleInvoke, testId, platform, origin, source, featureFlags, analytics, }: ExtractBlockOpts & {
|
|
6
|
+
viewProps: BlockCardResolvedViewProps;
|
|
7
|
+
jsonLd: JsonLd.Data.BaseData;
|
|
8
|
+
platform?: JsonLd.Primitives.Platforms | undefined;
|
|
9
|
+
}) => import("../../../view/BlockCard/components/Action").ActionProps | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnalyticsHandler } from '../../utils/types';
|
|
1
|
+
import { AnalyticsHandler, AnalyticsName, AnalyticsPayload } from '../../utils/types';
|
|
2
2
|
import { ConnectFailedEventProps, ConnectSucceededEventProps, InstrumentEventProps, InvokeFailedEventProps, InvokeSucceededEventProps, ScreenAuthPopupEventProps, TrackAppAccountConnectedProps, UiActionClickedEventProps, UiAuthAlternateAccountEventProps, UiAuthEventProps, UiCardClickedEventProps, UiClosedAuthEventProps, UiHoverCardDismissedEventProps, UiHoverCardOpenLinkClickedEventProps, UiHoverCardViewedEventProps, UiRenderFailedEventProps, UiRenderSuccessEventProps } from '../../utils/analytics/types';
|
|
3
3
|
/**
|
|
4
4
|
* This hook provides usage of Smart Link analytics outside of the Card component.
|
|
@@ -29,6 +29,14 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
|
|
|
29
29
|
* @returns
|
|
30
30
|
*/
|
|
31
31
|
authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiAuthAlternateAccountEventProps) => void;
|
|
32
|
+
/**
|
|
33
|
+
* This fires an event that represents when a user
|
|
34
|
+
* click a button.
|
|
35
|
+
* @param data A partial analytics event payload
|
|
36
|
+
*/
|
|
37
|
+
buttonClickedEvent: (data: Partial<AnalyticsPayload> & {
|
|
38
|
+
actionSubjectId: Required<string>;
|
|
39
|
+
}) => void;
|
|
32
40
|
/**
|
|
33
41
|
* This fires an event that represents when a user clicks on a Smart Link.
|
|
34
42
|
* @param id The unique ID for this Smart Link.
|
|
@@ -70,6 +78,13 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
|
|
|
70
78
|
* @returns
|
|
71
79
|
*/
|
|
72
80
|
closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiClosedAuthEventProps) => void;
|
|
81
|
+
/**
|
|
82
|
+
* This fires an event that represents when a user close a modal.
|
|
83
|
+
* @param data A partial analytics event payload
|
|
84
|
+
*/
|
|
85
|
+
modalClosedEvent: (data: Partial<AnalyticsPayload> & {
|
|
86
|
+
actionSubjectId: Required<string>;
|
|
87
|
+
}) => void;
|
|
73
88
|
/**
|
|
74
89
|
* This fires an event that represents when a Smart Link was rendered successfully.
|
|
75
90
|
* Note: this fires even if the Smart Link request errored out.
|
|
@@ -168,6 +183,13 @@ export declare const useSmartLinkAnalytics: (url: string, dispatchAnalytics: Ana
|
|
|
168
183
|
* @returns
|
|
169
184
|
*/
|
|
170
185
|
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: ScreenAuthPopupEventProps) => void;
|
|
186
|
+
/**
|
|
187
|
+
* This fires an event that represents when a user view a modal.
|
|
188
|
+
* @param data A partial analytics event payload
|
|
189
|
+
*/
|
|
190
|
+
modalViewedEvent: (data: Partial<AnalyticsPayload> & {
|
|
191
|
+
name: Extract<AnalyticsName, 'embedPreviewModal'>;
|
|
192
|
+
}) => void;
|
|
171
193
|
};
|
|
172
194
|
};
|
|
173
195
|
export declare type AnalyticsFacade = ReturnType<typeof useSmartLinkAnalytics>;
|
|
@@ -13,10 +13,16 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
|
|
|
13
13
|
ui: {
|
|
14
14
|
authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthEventProps) => void;
|
|
15
15
|
authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiAuthAlternateAccountEventProps) => void;
|
|
16
|
+
buttonClickedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
|
|
17
|
+
actionSubjectId: string;
|
|
18
|
+
}) => void;
|
|
16
19
|
cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
|
|
17
20
|
actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
|
|
18
21
|
hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
|
|
19
22
|
closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
|
|
23
|
+
modalClosedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
|
|
24
|
+
actionSubjectId: string;
|
|
25
|
+
}) => void;
|
|
20
26
|
renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderSuccessEventProps) => void;
|
|
21
27
|
renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiRenderFailedEventProps) => void;
|
|
22
28
|
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
|
|
@@ -34,6 +40,9 @@ export declare function useSmartLink(id: string, url: string, dispatchAnalytics:
|
|
|
34
40
|
};
|
|
35
41
|
screen: {
|
|
36
42
|
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").CommonEventProps) => void;
|
|
43
|
+
modalViewedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
|
|
44
|
+
name: "embedPreviewModal";
|
|
45
|
+
}) => void;
|
|
37
46
|
};
|
|
38
47
|
};
|
|
39
48
|
renderers: import("@atlaskit/link-provider").CardProviderRenderers | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { JsonLd } from 'json-ld-types';
|
|
3
|
-
import type { AnalyticsHandler } from '../../utils/types';
|
|
3
|
+
import type { AnalyticsHandler, AnalyticsOrigin } from '../../utils/types';
|
|
4
4
|
import type { CardInnerAppearance } from '../../view/Card/types';
|
|
5
5
|
export interface LinkAction {
|
|
6
6
|
/**
|
|
@@ -41,5 +41,9 @@ export interface UseSmartLinkActionsOpts {
|
|
|
41
41
|
* @default 'web'
|
|
42
42
|
*/
|
|
43
43
|
platform?: JsonLd.Primitives.Platforms;
|
|
44
|
+
/**
|
|
45
|
+
* Smart link origin that the action being invoked from.
|
|
46
|
+
*/
|
|
47
|
+
origin?: AnalyticsOrigin;
|
|
44
48
|
}
|
|
45
|
-
export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, }: UseSmartLinkActionsOpts): LinkAction[];
|
|
49
|
+
export declare function useSmartLinkActions({ url, appearance, analyticsHandler, platform, origin, }: UseSmartLinkActionsOpts): LinkAction[];
|
|
@@ -20,7 +20,55 @@ export declare const mocks: {
|
|
|
20
20
|
status: string;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
analytics: {
|
|
24
|
+
status: string;
|
|
25
|
+
details: {
|
|
26
|
+
meta: {
|
|
27
|
+
definitionId: string;
|
|
28
|
+
key: string;
|
|
29
|
+
resourceType: string;
|
|
30
|
+
subproduct: string;
|
|
31
|
+
product: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
23
35
|
};
|
|
24
36
|
export declare const fakeResponse: () => Promise<JsonLd.Response<JsonLd.Data.BaseData>>;
|
|
25
37
|
export declare const fakeFactory: any;
|
|
26
38
|
export declare const waitFor: (time?: number) => Promise<unknown>;
|
|
39
|
+
export declare const mockAnalytics: {
|
|
40
|
+
ui: {
|
|
41
|
+
authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiAuthEventProps) => void;
|
|
42
|
+
authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiAuthAlternateAccountEventProps) => void;
|
|
43
|
+
buttonClickedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
|
|
44
|
+
actionSubjectId: string;
|
|
45
|
+
}) => void;
|
|
46
|
+
cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("./analytics/types").UiCardClickedEventProps) => void;
|
|
47
|
+
actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiActionClickedEventProps) => void;
|
|
48
|
+
hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("./analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
|
|
49
|
+
closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiClosedAuthEventProps) => void;
|
|
50
|
+
modalClosedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
|
|
51
|
+
actionSubjectId: string;
|
|
52
|
+
}) => void;
|
|
53
|
+
renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiRenderSuccessEventProps) => void;
|
|
54
|
+
renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiRenderFailedEventProps) => void;
|
|
55
|
+
hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiHoverCardViewedEventProps) => void;
|
|
56
|
+
hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiHoverCardDismissedEventProps) => void;
|
|
57
|
+
};
|
|
58
|
+
operational: {
|
|
59
|
+
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
|
|
60
|
+
invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeFailedEventProps) => void;
|
|
61
|
+
connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectSucceededEventProps) => void;
|
|
62
|
+
connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectFailedEventProps) => void;
|
|
63
|
+
instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("./analytics/types").InstrumentEventProps) => void;
|
|
64
|
+
};
|
|
65
|
+
track: {
|
|
66
|
+
appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
|
|
67
|
+
};
|
|
68
|
+
screen: {
|
|
69
|
+
authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").CommonEventProps) => void;
|
|
70
|
+
modalViewedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
|
|
71
|
+
name: "embedPreviewModal";
|
|
72
|
+
}) => void;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { GasPayload } from '@atlaskit/analytics-gas-types';
|
|
2
2
|
import { CardInnerAppearance } from '../view/Card/types';
|
|
3
3
|
export declare type AnalyticsAction = 'resolved' | 'unresolved' | 'connectSucceeded' | 'connectFailed' | 'connected' | 'clicked' | 'closed' | 'renderFailed' | 'renderWithStatus' | 'renderSuccess' | 'inserted' | 'viewed' | 'dismissed' | 'created';
|
|
4
|
-
export declare type AnalyticsActionSubject = 'smartLink' | 'smartLinkAction' | 'applicationAccount' | 'button' | 'consentModal' | 'hoverCard';
|
|
4
|
+
export declare type AnalyticsActionSubject = 'smartLink' | 'smartLinkAction' | 'applicationAccount' | 'button' | 'consentModal' | 'hoverCard' | 'modal' | 'embedPreviewModal';
|
|
5
|
+
export declare type AnalyticsName = 'embedPreviewModal';
|
|
6
|
+
export declare type AnalyticsOrigin = 'smartLinkCard' | 'smartLinkEmbed' | 'smartLinkInline' | 'smartLinkPreviewHoverCard';
|
|
5
7
|
export declare type AnalyticsPayload = GasPayload & {
|
|
6
8
|
action?: AnalyticsAction;
|
|
7
9
|
actionSubject: AnalyticsActionSubject;
|