@atlaskit/smart-card 33.2.0 → 33.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/state/actions/index.js +2 -4
- package/dist/cjs/state/analytics/index.js +1 -8
- package/dist/cjs/state/flexible-ui-context/index.js +1 -10
- package/dist/cjs/state/hooks/useSmartLink.js +1 -4
- package/dist/cjs/state/hooks-external/useSmartLinkActions.js +1 -3
- package/dist/cjs/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/cjs/state/index.js +1 -8
- package/dist/cjs/utils/analytics/analytics.js +2 -144
- package/dist/cjs/utils/analytics/index.js +0 -30
- package/dist/cjs/utils/analytics/types.js +1 -5
- package/dist/cjs/utils/mocks.js +1 -23
- package/dist/cjs/view/BlockCard/index.js +1 -3
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +1 -3
- package/dist/cjs/view/BlockCard/views/UnauthorisedView.js +2 -4
- package/dist/cjs/view/CardWithUrl/component.js +1 -8
- package/dist/cjs/view/EmbedCard/index.js +0 -4
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +3 -5
- package/dist/cjs/view/EmbedModal/index.js +1 -3
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/components/actions/download-action/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +1 -4
- package/dist/cjs/view/FlexibleCard/index.js +3 -17
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +9 -5
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +3 -5
- package/dist/cjs/view/InlineCard/index.js +1 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/actions/index.js +2 -4
- package/dist/es2019/state/analytics/index.js +1 -2
- package/dist/es2019/state/flexible-ui-context/index.js +0 -7
- package/dist/es2019/state/hooks/useSmartLink.js +1 -4
- package/dist/es2019/state/hooks-external/useSmartLinkActions.js +1 -3
- package/dist/es2019/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/es2019/state/index.js +1 -2
- package/dist/es2019/utils/analytics/analytics.js +2 -145
- package/dist/es2019/utils/analytics/index.js +1 -1
- package/dist/es2019/utils/analytics/types.js +0 -1
- package/dist/es2019/utils/mocks.js +1 -23
- package/dist/es2019/view/BlockCard/index.js +1 -3
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +1 -3
- package/dist/es2019/view/BlockCard/views/UnauthorisedView.js +1 -3
- package/dist/es2019/view/CardWithUrl/component.js +1 -8
- package/dist/es2019/view/EmbedCard/index.js +0 -4
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +1 -3
- package/dist/es2019/view/EmbedModal/index.js +0 -2
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/components/actions/download-action/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -5
- package/dist/es2019/view/FlexibleCard/index.js +3 -15
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +9 -5
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +2 -4
- package/dist/es2019/view/InlineCard/index.js +0 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/actions/index.js +2 -4
- package/dist/esm/state/analytics/index.js +1 -2
- package/dist/esm/state/flexible-ui-context/index.js +0 -9
- package/dist/esm/state/hooks/useSmartLink.js +1 -4
- package/dist/esm/state/hooks-external/useSmartLinkActions.js +1 -3
- package/dist/esm/state/hooks-external/useSmartLinkReload.js +1 -3
- package/dist/esm/state/index.js +1 -2
- package/dist/esm/utils/analytics/analytics.js +1 -143
- package/dist/esm/utils/analytics/index.js +1 -1
- package/dist/esm/utils/analytics/types.js +0 -1
- package/dist/esm/utils/mocks.js +0 -22
- package/dist/esm/view/BlockCard/index.js +1 -3
- package/dist/esm/view/BlockCard/views/ResolvedView.js +1 -3
- package/dist/esm/view/BlockCard/views/UnauthorisedView.js +2 -4
- package/dist/esm/view/CardWithUrl/component.js +1 -8
- package/dist/esm/view/EmbedCard/index.js +0 -4
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +3 -5
- package/dist/esm/view/EmbedModal/index.js +1 -3
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -5
- package/dist/esm/view/FlexibleCard/components/actions/download-action/index.js +2 -5
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -5
- package/dist/esm/view/FlexibleCard/index.js +4 -18
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +9 -5
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +1 -8
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +3 -5
- package/dist/esm/view/InlineCard/index.js +1 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/common/actions/types.d.ts +0 -2
- package/dist/types/state/actions/index.d.ts +1 -2
- package/dist/types/state/analytics/index.d.ts +0 -2
- package/dist/types/state/flexible-ui-context/index.d.ts +1 -7
- package/dist/types/state/flexible-ui-context/types.d.ts +0 -6
- package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +0 -6
- package/dist/types/state/hooks/useSmartLink.d.ts +0 -7
- package/dist/types/state/index.d.ts +0 -1
- package/dist/types/utils/analytics/analytics.d.ts +0 -6
- package/dist/types/utils/analytics/index.d.ts +1 -1
- package/dist/types/utils/analytics/types.d.ts +0 -42
- package/dist/types/utils/mocks.d.ts +0 -7
- package/dist/types/view/BlockCard/index.d.ts +1 -1
- package/dist/types/view/BlockCard/types.d.ts +0 -2
- package/dist/types/view/BlockCard/views/types.d.ts +1 -1
- package/dist/types/view/CardWithUrl/types.d.ts +0 -2
- package/dist/types/view/EmbedCard/types.d.ts +0 -2
- package/dist/types/view/EmbedCard/views/unauthorized-view/index.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +0 -2
- package/dist/types/view/EmbedModal/components/analytics/types.d.ts +0 -2
- package/dist/types/view/FlexibleCard/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/types.d.ts +0 -6
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types/view/HoverCard/components/HoverCardContent.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +0 -2
- package/dist/types/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/views/unauthorised/types.d.ts +0 -5
- package/dist/types/view/HoverCard/types.d.ts +15 -3
- package/dist/types/view/InlineCard/UnauthorisedView/index.d.ts +0 -3
- package/dist/types/view/InlineCard/index.d.ts +1 -1
- package/dist/types/view/InlineCard/types.d.ts +0 -2
- package/dist/types/view/common/UnauthorisedViewContent.d.ts +0 -6
- package/dist/types-ts4.5/extractors/common/actions/types.d.ts +0 -2
- package/dist/types-ts4.5/state/actions/index.d.ts +1 -2
- package/dist/types-ts4.5/state/analytics/index.d.ts +0 -2
- package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +1 -7
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +0 -6
- package/dist/types-ts4.5/state/hooks/use-invoke-client-action/types.d.ts +0 -6
- package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +0 -7
- package/dist/types-ts4.5/state/index.d.ts +0 -1
- package/dist/types-ts4.5/utils/analytics/analytics.d.ts +0 -6
- package/dist/types-ts4.5/utils/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics/types.d.ts +0 -42
- package/dist/types-ts4.5/utils/mocks.d.ts +0 -7
- package/dist/types-ts4.5/view/BlockCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/BlockCard/types.d.ts +0 -2
- package/dist/types-ts4.5/view/BlockCard/views/types.d.ts +1 -1
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedCard/types.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/index.d.ts +1 -1
- package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +0 -2
- package/dist/types-ts4.5/view/EmbedModal/components/analytics/types.d.ts +0 -2
- package/dist/types-ts4.5/view/FlexibleCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +0 -6
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardContent.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +0 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/index.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/views/unauthorised/types.d.ts +0 -5
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +15 -3
- package/dist/types-ts4.5/view/InlineCard/UnauthorisedView/index.d.ts +0 -3
- package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +0 -2
- package/dist/types-ts4.5/view/common/UnauthorisedViewContent.d.ts +0 -6
- package/package.json +1 -1
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +0 -139
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +0 -126
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +0 -132
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +0 -33
- package/dist/types/utils/analytics/__mocks__/analytics.d.ts +0 -2
- package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +0 -33
- package/dist/types-ts4.5/utils/analytics/__mocks__/analytics.d.ts +0 -2
|
@@ -36,8 +36,7 @@ var UnauthorisedView = function UnauthorisedView(_ref) {
|
|
|
36
36
|
var _ref$testId = _ref.testId,
|
|
37
37
|
testId = _ref$testId === void 0 ? 'smart-block-unauthorized-view' : _ref$testId,
|
|
38
38
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
39
|
-
var
|
|
40
|
-
cardState = props.cardState,
|
|
39
|
+
var cardState = props.cardState,
|
|
41
40
|
onAuthorize = props.onAuthorize;
|
|
42
41
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
43
42
|
var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
@@ -54,14 +53,13 @@ var UnauthorisedView = function UnauthorisedView(_ref) {
|
|
|
54
53
|
return onAuthorize ? jsx(UnauthorisedViewContent, {
|
|
55
54
|
providerName: providerName,
|
|
56
55
|
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
57
|
-
analytics: analytics,
|
|
58
56
|
testId: testId
|
|
59
57
|
}) : jsx(FormattedMessage, _extends({}, messages[providerName ? 'unauthorised_account_description' : 'unauthorised_account_description_no_provider'], {
|
|
60
58
|
values: {
|
|
61
59
|
context: providerName
|
|
62
60
|
}
|
|
63
61
|
}));
|
|
64
|
-
}, [
|
|
62
|
+
}, [isProductIntegrationSupported, onAuthorize, providerName, testId]);
|
|
65
63
|
var actions = useMemo(function () {
|
|
66
64
|
return onAuthorize ? [AuthorizeAction(handleAuthorize, providerName)] : [];
|
|
67
65
|
}, [handleAuthorize, onAuthorize, providerName]);
|
|
@@ -37,7 +37,6 @@ function Component(_ref) {
|
|
|
37
37
|
children = _ref.children,
|
|
38
38
|
showHoverPreview = _ref.showHoverPreview,
|
|
39
39
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
40
|
-
analyticsEvents = _ref.analyticsEvents,
|
|
41
40
|
removeTextHighlightingFromTitle = _ref.removeTextHighlightingFromTitle,
|
|
42
41
|
resolvingPlaceholder = _ref.resolvingPlaceholder,
|
|
43
42
|
truncateInline = _ref.truncateInline;
|
|
@@ -50,11 +49,9 @@ function Component(_ref) {
|
|
|
50
49
|
var _useSmartLink = useSmartLink(id, url),
|
|
51
50
|
state = _useSmartLink.state,
|
|
52
51
|
actions = _useSmartLink.actions,
|
|
53
|
-
defaultAnalytics = _useSmartLink.analytics,
|
|
54
52
|
config = _useSmartLink.config,
|
|
55
53
|
renderers = _useSmartLink.renderers,
|
|
56
54
|
error = _useSmartLink.error;
|
|
57
|
-
var analytics = analyticsEvents || defaultAnalytics;
|
|
58
55
|
var definitionId = getDefinitionId(state.details);
|
|
59
56
|
var extensionKey = getExtensionKey(state.details);
|
|
60
57
|
var resourceType = getResourceType(state.details);
|
|
@@ -194,8 +191,7 @@ function Component(_ref) {
|
|
|
194
191
|
url: url,
|
|
195
192
|
testId: testId,
|
|
196
193
|
onResolve: onResolve,
|
|
197
|
-
onError: onError
|
|
198
|
-
analytics: analytics
|
|
194
|
+
onError: onError
|
|
199
195
|
}, children);
|
|
200
196
|
}
|
|
201
197
|
|
|
@@ -206,7 +202,6 @@ function Component(_ref) {
|
|
|
206
202
|
switch (appearance) {
|
|
207
203
|
case 'inline':
|
|
208
204
|
return /*#__PURE__*/React.createElement(InlineCard, {
|
|
209
|
-
analytics: analytics,
|
|
210
205
|
id: id,
|
|
211
206
|
url: url,
|
|
212
207
|
renderers: renderers,
|
|
@@ -235,7 +230,6 @@ function Component(_ref) {
|
|
|
235
230
|
cardState: state,
|
|
236
231
|
handleAuthorize: services.length && handleAuthorize || undefined,
|
|
237
232
|
handleFrameClick: handleClickWrapper,
|
|
238
|
-
analytics: analytics,
|
|
239
233
|
isSelected: isSelected,
|
|
240
234
|
onResolve: onResolve,
|
|
241
235
|
onError: onError,
|
|
@@ -253,7 +247,6 @@ function Component(_ref) {
|
|
|
253
247
|
handleErrorRetry: handleRetry,
|
|
254
248
|
handleFrameClick: handleClickWrapper,
|
|
255
249
|
handleInvoke: handleInvoke,
|
|
256
|
-
analytics: analytics,
|
|
257
250
|
isSelected: isSelected,
|
|
258
251
|
frameStyle: frameStyle,
|
|
259
252
|
platform: platform,
|
|
@@ -20,7 +20,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
20
20
|
handleAuthorize = _ref.handleAuthorize,
|
|
21
21
|
handleErrorRetry = _ref.handleErrorRetry,
|
|
22
22
|
handleFrameClick = _ref.handleFrameClick,
|
|
23
|
-
analytics = _ref.analytics,
|
|
24
23
|
isSelected = _ref.isSelected,
|
|
25
24
|
frameStyle = _ref.frameStyle,
|
|
26
25
|
platform = _ref.platform,
|
|
@@ -52,7 +51,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
52
51
|
onResolve: onResolve,
|
|
53
52
|
renderers: renderers,
|
|
54
53
|
actionOptions: actionOptions,
|
|
55
|
-
analytics: analytics,
|
|
56
54
|
testId: testId ? "".concat(testId, "-resolving-view") : 'embed-card-resolving-view'
|
|
57
55
|
});
|
|
58
56
|
case 'resolved':
|
|
@@ -93,7 +91,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
93
91
|
onResolve: onResolve,
|
|
94
92
|
renderers: renderers,
|
|
95
93
|
actionOptions: actionOptions,
|
|
96
|
-
analytics: analytics,
|
|
97
94
|
testId: testId
|
|
98
95
|
});
|
|
99
96
|
}
|
|
@@ -106,7 +103,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
106
103
|
}
|
|
107
104
|
var unauthorisedViewProps = extractEmbedProps(data, meta, platform);
|
|
108
105
|
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
109
|
-
analytics: analytics,
|
|
110
106
|
context: unauthorisedViewProps.context,
|
|
111
107
|
extensionKey: extensionKey,
|
|
112
108
|
frameStyle: frameStyle,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["context", "extensionKey", "isProductIntegrationSupported", "onAuthorize", "testId"];
|
|
4
4
|
import React, { useCallback, useMemo } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import Button from '@atlaskit/button';
|
|
@@ -11,8 +11,7 @@ import UnresolvedView from '../unresolved-view';
|
|
|
11
11
|
import { UnauthorizedSVG } from './unauthorized-svg';
|
|
12
12
|
var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
13
13
|
var _context$image;
|
|
14
|
-
var
|
|
15
|
-
context = _ref.context,
|
|
14
|
+
var context = _ref.context,
|
|
16
15
|
extensionKey = _ref.extensionKey,
|
|
17
16
|
isProductIntegrationSupported = _ref.isProductIntegrationSupported,
|
|
18
17
|
onAuthorize = _ref.onAuthorize,
|
|
@@ -44,7 +43,6 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
44
43
|
values: _values
|
|
45
44
|
})),
|
|
46
45
|
description: /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
47
|
-
analytics: analytics,
|
|
48
46
|
providerName: context === null || context === void 0 ? void 0 : context.text,
|
|
49
47
|
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
50
48
|
testId: testId
|
|
@@ -81,7 +79,7 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
81
79
|
title: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_name_no_provider),
|
|
82
80
|
description: /*#__PURE__*/React.createElement(FormattedMessage, messages.unauthorised_account_description_no_provider)
|
|
83
81
|
};
|
|
84
|
-
}, [
|
|
82
|
+
}, [context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorize, testId]);
|
|
85
83
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, content, {
|
|
86
84
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
87
85
|
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : /*#__PURE__*/React.createElement(UnauthorizedSVG, null),
|
|
@@ -20,8 +20,7 @@ var toWidth = function toWidth(size) {
|
|
|
20
20
|
return size === EmbedModalSize.Large ? MAX_MODAL_SIZE : MIN_MODAL_SIZE;
|
|
21
21
|
};
|
|
22
22
|
var EmbedModal = function EmbedModal(_ref) {
|
|
23
|
-
var
|
|
24
|
-
invokeDownloadAction = _ref.invokeDownloadAction,
|
|
23
|
+
var invokeDownloadAction = _ref.invokeDownloadAction,
|
|
25
24
|
fireEvent = _ref.fireEvent,
|
|
26
25
|
iframeName = _ref.iframeName,
|
|
27
26
|
isSupportTheming = _ref.isSupportTheming,
|
|
@@ -51,7 +50,6 @@ var EmbedModal = function EmbedModal(_ref) {
|
|
|
51
50
|
setWidth = _useState4[1];
|
|
52
51
|
var openAt = useRef();
|
|
53
52
|
var invoke = useInvokeClientAction({
|
|
54
|
-
analytics: analytics,
|
|
55
53
|
fireEvent: fireEvent
|
|
56
54
|
});
|
|
57
55
|
var handleOnOpenComplete = useCallback(function () {
|
|
@@ -12,7 +12,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
12
12
|
import LinkIcon from '@atlaskit/icon/core/migration/link';
|
|
13
13
|
import { ActionName } from '../../../../../constants';
|
|
14
14
|
import { messages } from '../../../../../messages';
|
|
15
|
-
import {
|
|
15
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
16
16
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
17
17
|
import Action from '../action';
|
|
18
18
|
var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
@@ -20,10 +20,7 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
|
20
20
|
var onClickCallback = _ref.onClick,
|
|
21
21
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
22
|
var context = useFlexibleUiContext();
|
|
23
|
-
var
|
|
24
|
-
var invoke = useInvokeClientAction({
|
|
25
|
-
analytics: analytics
|
|
26
|
-
});
|
|
23
|
+
var invoke = useInvokeClientAction({});
|
|
27
24
|
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.CopyLinkAction];
|
|
28
25
|
var _useState = useState(messages.copy_url_to_clipboard),
|
|
29
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
6
6
|
import DownloadIcon from '@atlaskit/icon/core/migration/download';
|
|
7
7
|
import { ActionName } from '../../../../../constants';
|
|
8
8
|
import { messages } from '../../../../../messages';
|
|
9
|
-
import {
|
|
9
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
10
10
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
11
11
|
import Action from '../action';
|
|
12
12
|
var DownloadAction = function DownloadAction(_ref) {
|
|
@@ -14,10 +14,7 @@ var DownloadAction = function DownloadAction(_ref) {
|
|
|
14
14
|
var onClickCallback = _ref.onClick,
|
|
15
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
16
|
var context = useFlexibleUiContext();
|
|
17
|
-
var
|
|
18
|
-
var invoke = useInvokeClientAction({
|
|
19
|
-
analytics: analytics
|
|
20
|
-
});
|
|
17
|
+
var invoke = useInvokeClientAction({});
|
|
21
18
|
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.DownloadAction];
|
|
22
19
|
var onClick = useCallback(function () {
|
|
23
20
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
@@ -6,7 +6,7 @@ import { FormattedMessage } from 'react-intl-next';
|
|
|
6
6
|
import MediaServicesActualSizeIcon from '@atlaskit/icon/core/migration/grow-diagonal--media-services-actual-size';
|
|
7
7
|
import { ActionName } from '../../../../../constants';
|
|
8
8
|
import { messages } from '../../../../../messages';
|
|
9
|
-
import {
|
|
9
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
10
10
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
11
11
|
import Action from '../action';
|
|
12
12
|
var PreviewAction = function PreviewAction(_ref) {
|
|
@@ -14,10 +14,7 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
14
14
|
var onClickCallback = _ref.onClick,
|
|
15
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
16
|
var context = useFlexibleUiContext();
|
|
17
|
-
var
|
|
18
|
-
var invoke = useInvokeClientAction({
|
|
19
|
-
analytics: analytics
|
|
20
|
-
});
|
|
17
|
+
var invoke = useInvokeClientAction({});
|
|
21
18
|
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.PreviewAction];
|
|
22
19
|
var onClick = useCallback(function () {
|
|
23
20
|
if (data !== null && data !== void 0 && data.invokeAction) {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
-
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
2
|
import React, { useEffect, useMemo } from 'react';
|
|
6
3
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
7
4
|
import { SmartLinkStatus } from '../../constants';
|
|
8
|
-
import {
|
|
5
|
+
import { FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
9
6
|
import { useAISummaryConfig } from '../../state/hooks/use-ai-summary-config';
|
|
10
7
|
import useResolve from '../../state/hooks/use-resolve';
|
|
11
8
|
import Container from './components/container';
|
|
@@ -18,9 +15,7 @@ import { getContextByStatus, getRetryOptions } from './utils';
|
|
|
18
15
|
* @see Container
|
|
19
16
|
*/
|
|
20
17
|
var FlexibleCard = function FlexibleCard(_ref) {
|
|
21
|
-
var
|
|
22
|
-
var analytics = _ref.analytics,
|
|
23
|
-
_ref$appearance = _ref.appearance,
|
|
18
|
+
var _ref$appearance = _ref.appearance,
|
|
24
19
|
appearance = _ref$appearance === void 0 ? 'flexible' : _ref$appearance,
|
|
25
20
|
cardState = _ref.cardState,
|
|
26
21
|
children = _ref.children,
|
|
@@ -62,13 +57,6 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
62
57
|
var retry = getRetryOptions(url, status, details, onAuthorize);
|
|
63
58
|
var _ref2 = context || {},
|
|
64
59
|
title = _ref2.title;
|
|
65
|
-
var analyticsContext = useMemo(function () {
|
|
66
|
-
var _details$meta;
|
|
67
|
-
return analytics ? _objectSpread(_objectSpread({}, analytics), {}, {
|
|
68
|
-
display: appearance,
|
|
69
|
-
extensionKey: details === null || details === void 0 || (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.key
|
|
70
|
-
}) : undefined;
|
|
71
|
-
}, [analytics, appearance, details === null || details === void 0 || (_details$meta2 = details.meta) === null || _details$meta2 === void 0 ? void 0 : _details$meta2.key]);
|
|
72
60
|
useEffect(function () {
|
|
73
61
|
switch (status) {
|
|
74
62
|
case SmartLinkStatus.Resolved:
|
|
@@ -93,9 +81,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
93
81
|
break;
|
|
94
82
|
}
|
|
95
83
|
}, [onError, onResolve, status, title, url]);
|
|
96
|
-
return /*#__PURE__*/React.createElement(
|
|
97
|
-
value: analyticsContext
|
|
98
|
-
}, /*#__PURE__*/React.createElement(FlexibleUiOptionContext.Provider, {
|
|
84
|
+
return /*#__PURE__*/React.createElement(FlexibleUiOptionContext.Provider, {
|
|
99
85
|
value: ui
|
|
100
86
|
}, /*#__PURE__*/React.createElement(FlexibleUiContext.Provider, {
|
|
101
87
|
value: context
|
|
@@ -108,6 +94,6 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
108
94
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
109
95
|
actionOptions: actionOptions,
|
|
110
96
|
status: status
|
|
111
|
-
}), children)))
|
|
97
|
+
}), children)));
|
|
112
98
|
};
|
|
113
99
|
export default FlexibleCard;
|
|
@@ -13,7 +13,6 @@ import { jsx } from '@emotion/react';
|
|
|
13
13
|
import Popup from '@atlaskit/popup';
|
|
14
14
|
import { ActionName, CardDisplay } from '../../../constants';
|
|
15
15
|
import { useSmartCardActions } from '../../../state/actions';
|
|
16
|
-
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
17
16
|
import { useSmartLinkRenderers } from '../../../state/renderers';
|
|
18
17
|
import { useSmartCardState as useLinkState } from '../../../state/store';
|
|
19
18
|
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
@@ -41,7 +40,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
41
40
|
zIndex = _ref$zIndex === void 0 ? HOVER_CARD_Z_INDEX : _ref$zIndex,
|
|
42
41
|
_ref$noFadeDelay = _ref.noFadeDelay,
|
|
43
42
|
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay,
|
|
44
|
-
hoverPreviewOptions = _ref.hoverPreviewOptions
|
|
43
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
44
|
+
role = _ref.role,
|
|
45
|
+
label = _ref.label,
|
|
46
|
+
titleId = _ref.titleId;
|
|
45
47
|
var fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
46
48
|
var _React$useState = React.useState(false),
|
|
47
49
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -55,8 +57,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
55
57
|
var parentSpan = useRef(null);
|
|
56
58
|
var renderers = useSmartLinkRenderers();
|
|
57
59
|
var linkState = useLinkState(url);
|
|
58
|
-
var
|
|
59
|
-
var _useSmartCardActions = useSmartCardActions(id, url, analytics),
|
|
60
|
+
var _useSmartCardActions = useSmartCardActions(id, url),
|
|
60
61
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
61
62
|
var setMousePosition = useCallback(function (event) {
|
|
62
63
|
if (isOpen && canOpen) {
|
|
@@ -221,7 +222,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
221
222
|
autoFocus: false,
|
|
222
223
|
content: content,
|
|
223
224
|
trigger: trigger,
|
|
224
|
-
zIndex: zIndex
|
|
225
|
+
zIndex: zIndex,
|
|
226
|
+
role: role,
|
|
227
|
+
titleId: titleId,
|
|
228
|
+
label: label
|
|
225
229
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
226
230
|
,
|
|
227
231
|
popupComponent: CustomPopupContainer
|
|
@@ -10,7 +10,6 @@ import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytic
|
|
|
10
10
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
11
11
|
import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
|
|
12
12
|
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
13
|
-
import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
14
13
|
import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
|
|
15
14
|
import { useSmartCardState } from '../../../state/store';
|
|
16
15
|
import { isSpecialEvent } from '../../../utils';
|
|
@@ -28,7 +27,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
28
27
|
var _linkState$status, _cardState$details;
|
|
29
28
|
var _ref$id = _ref.id,
|
|
30
29
|
id = _ref$id === void 0 ? '' : _ref$id,
|
|
31
|
-
_analytics = _ref.analytics,
|
|
32
30
|
cardState = _ref.cardState,
|
|
33
31
|
onActionClick = _ref.onActionClick,
|
|
34
32
|
onResolve = _ref.onResolve,
|
|
@@ -41,8 +39,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
41
39
|
createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
|
|
42
40
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
43
41
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
44
|
-
var defaultAnalytics = useSmartLinkAnalytics(url, id);
|
|
45
|
-
var analytics = _analytics !== null && _analytics !== void 0 ? _analytics : defaultAnalytics;
|
|
46
42
|
var extensionKey = useMemo(function () {
|
|
47
43
|
return getExtensionKey(cardState.details);
|
|
48
44
|
}, [cardState.details]);
|
|
@@ -126,8 +122,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
126
122
|
actionOptions: actionOptions,
|
|
127
123
|
ui: flexibleUiOptions,
|
|
128
124
|
url: url,
|
|
129
|
-
children: null
|
|
130
|
-
analytics: analytics
|
|
125
|
+
children: null
|
|
131
126
|
};
|
|
132
127
|
var onClickStopPropagation = useCallback(function (e) {
|
|
133
128
|
return e.stopPropagation();
|
|
@@ -141,7 +136,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
141
136
|
}
|
|
142
137
|
if (cardState.status === 'unauthorized' && services !== null && services !== void 0 && services.length) {
|
|
143
138
|
return jsx(HoverCardUnauthorisedView, {
|
|
144
|
-
analytics: analytics,
|
|
145
139
|
extensionKey: extensionKey,
|
|
146
140
|
id: id,
|
|
147
141
|
flexibleCardProps: flexibleCardProps,
|
|
@@ -155,7 +149,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
155
149
|
}
|
|
156
150
|
if (cardState.status === 'resolved') {
|
|
157
151
|
return jsx(HoverCardResolvedView, {
|
|
158
|
-
analytics: analytics,
|
|
159
152
|
cardState: cardState,
|
|
160
153
|
extensionKey: extensionKey,
|
|
161
154
|
flexibleCardProps: flexibleCardProps,
|
|
@@ -15,8 +15,7 @@ import { LinkIcon } from '../../../../FlexibleCard/components/elements';
|
|
|
15
15
|
import { connectButtonStyles, mainTextStyles, titleBlockStyles } from './styled';
|
|
16
16
|
var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
17
17
|
var _cardState$details, _extractProvider;
|
|
18
|
-
var
|
|
19
|
-
_ref$id = _ref.id,
|
|
18
|
+
var _ref$id = _ref.id,
|
|
20
19
|
id = _ref$id === void 0 ? '' : _ref$id,
|
|
21
20
|
flexibleCardProps = _ref.flexibleCardProps,
|
|
22
21
|
_ref$testId = _ref.testId,
|
|
@@ -26,7 +25,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
26
25
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
27
26
|
var providerName = (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
28
27
|
var isProductIntegrationSupported = hasAuthScopeOverrides(cardState.details);
|
|
29
|
-
var _useSmartCardActions = useSmartCardActions(id, url
|
|
28
|
+
var _useSmartCardActions = useSmartCardActions(id, url),
|
|
30
29
|
authorize = _useSmartCardActions.authorize;
|
|
31
30
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
32
31
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
@@ -61,8 +60,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
61
60
|
testId: "".concat(testId, "-content")
|
|
62
61
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(UnauthorisedViewContent, {
|
|
63
62
|
providerName: providerName,
|
|
64
|
-
isProductIntegrationSupported: isProductIntegrationSupported
|
|
65
|
-
analytics: analytics
|
|
63
|
+
isProductIntegrationSupported: isProductIntegrationSupported
|
|
66
64
|
}))), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
67
65
|
overrideCss: connectButtonStyles,
|
|
68
66
|
testId: "".concat(testId, "-button")
|
|
@@ -17,8 +17,7 @@ import { InlineCardUnauthorizedView } from './UnauthorisedView';
|
|
|
17
17
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
18
18
|
export var InlineCard = function InlineCard(_ref) {
|
|
19
19
|
var _details$meta, _providerForbidden$te;
|
|
20
|
-
var
|
|
21
|
-
id = _ref.id,
|
|
20
|
+
var id = _ref.id,
|
|
22
21
|
url = _ref.url,
|
|
23
22
|
cardState = _ref.cardState,
|
|
24
23
|
handleAuthorize = _ref.handleAuthorize,
|
|
@@ -107,7 +106,6 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
107
106
|
testId: testIdWithStatus,
|
|
108
107
|
showHoverPreview: showHoverPreview,
|
|
109
108
|
id: id,
|
|
110
|
-
analytics: analytics,
|
|
111
109
|
extensionKey: extensionKey,
|
|
112
110
|
truncateInline: truncateInline
|
|
113
111
|
});
|
|
@@ -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: "33.
|
|
16
|
+
packageVersion: "33.4.0",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
|
-
import { type AnalyticsFacade } from '../../../state/analytics';
|
|
3
2
|
import { type AnalyticsOrigin } from '../../../utils/types';
|
|
4
3
|
import { type CardActionOptions, type CardInnerAppearance } from '../../../view/Card/types';
|
|
5
4
|
export type ExtractActionsProps = {
|
|
6
5
|
response: JsonLd.Response;
|
|
7
|
-
analytics: AnalyticsFacade;
|
|
8
6
|
actionOptions?: CardActionOptions;
|
|
9
7
|
extensionKey?: string;
|
|
10
8
|
source?: CardInnerAppearance;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type JsonLd } from 'json-ld-types';
|
|
2
2
|
import { type InvokeClientOpts, type InvokeServerOpts } from '../../model/invoke-opts';
|
|
3
3
|
import { type CardInnerAppearance } from '../../view/Card/types';
|
|
4
|
-
|
|
5
|
-
export declare const useSmartCardActions: (id: string, url: string, analytics: AnalyticsFacade) => {
|
|
4
|
+
export declare const useSmartCardActions: (id: string, url: string) => {
|
|
6
5
|
register: () => Promise<void>;
|
|
7
6
|
reload: () => void;
|
|
8
7
|
authorize: (appearance: CardInnerAppearance) => void;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type FlexibleUiOptions } from '../../view/FlexibleCard/types';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FlexibleUiDataContext } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
6
6
|
* underlying elements.
|
|
7
7
|
*/
|
|
8
8
|
export declare const FlexibleUiContext: import("react").Context<FlexibleUiDataContext | undefined>;
|
|
9
9
|
export declare const useFlexibleUiContext: () => FlexibleUiDataContext | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
12
|
-
* underlying elements.
|
|
13
|
-
*/
|
|
14
|
-
export declare const FlexibleUiAnalyticsContext: import("react").Context<FlexibleAnalyticsContextType | undefined>;
|
|
15
|
-
export declare const useFlexibleUiAnalyticsContext: () => FlexibleAnalyticsContextType | undefined;
|
|
16
10
|
/**
|
|
17
11
|
* This provides the ui options that will be used by Smart Links Flexible UI
|
|
18
12
|
* to render its underlying elements.
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { type LinkPerson } from '@atlaskit/link-extractors';
|
|
2
2
|
import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
|
|
3
3
|
import { type LinkLozenge } from '../../extractors/common/lozenge/types';
|
|
4
|
-
import { type CardInnerAppearance } from '../../view/Card/types';
|
|
5
|
-
import { type AnalyticsFacade } from '../analytics';
|
|
6
4
|
import { type InvokeClientActionProps } from '../hooks/use-invoke-client-action/types';
|
|
7
5
|
import { type InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
|
|
8
6
|
/**
|
|
@@ -275,10 +273,6 @@ export type AutomationActionData = {
|
|
|
275
273
|
export type ViewRelatedLinksActionData = {
|
|
276
274
|
ari: string;
|
|
277
275
|
};
|
|
278
|
-
export type FlexibleAnalyticsContextType = AnalyticsFacade & {
|
|
279
|
-
display?: CardInnerAppearance;
|
|
280
|
-
extensionKey?: string;
|
|
281
|
-
};
|
|
282
276
|
export type ServerActionProp<TValue> = {
|
|
283
277
|
action: InvokeRequestWithCardDetails;
|
|
284
278
|
value?: TValue;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { type FireEventFunction } from '../../../common/analytics/types';
|
|
2
2
|
import { type CardInnerAppearance } from '../../../view/Card/types';
|
|
3
|
-
import { type AnalyticsFacade } from '../../analytics';
|
|
4
3
|
export type UseInvokeClientActionProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Analytics object
|
|
7
|
-
*/
|
|
8
|
-
analytics?: AnalyticsFacade;
|
|
9
4
|
/**
|
|
10
5
|
* A function to dispatch analytics events.
|
|
11
6
|
*/
|
|
@@ -38,7 +33,6 @@ export type InvokeClientActionProps = {
|
|
|
38
33
|
/**
|
|
39
34
|
* Link provider extension key
|
|
40
35
|
* This value should have already been set in analytics object through
|
|
41
|
-
* useSmartLinkAnalytics() and/or into the analytic context.
|
|
42
36
|
*/
|
|
43
37
|
extensionKey?: string;
|
|
44
38
|
/**
|
|
@@ -8,13 +8,6 @@ export declare function useSmartLink(id: string, url: string): {
|
|
|
8
8
|
loadMetadata: () => Promise<void> | undefined;
|
|
9
9
|
};
|
|
10
10
|
config: (import("@atlaskit/link-provider").CardProviderCacheOpts & import("@atlaskit/link-provider").CardAuthFlowOpts) | undefined;
|
|
11
|
-
analytics: {
|
|
12
|
-
operational: {
|
|
13
|
-
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
|
|
14
|
-
invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
|
|
15
|
-
};
|
|
16
|
-
screen: Screen;
|
|
17
|
-
};
|
|
18
11
|
renderers: import("@atlaskit/link-provider").CardProviderRenderers | undefined;
|
|
19
12
|
error: Error | null;
|
|
20
13
|
};
|
|
@@ -2,4 +2,3 @@ export { SmartCardContext, SmartCardProvider, useSmartLinkContext } from '@atlas
|
|
|
2
2
|
export type { CardContext, ProviderProps } from '@atlaskit/link-provider';
|
|
3
3
|
export type { CardType } from '@atlaskit/linking-common';
|
|
4
4
|
export { useSmartLink, usePrefetch } from './hooks';
|
|
5
|
-
export { useSmartLinkAnalytics } from './analytics';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import { type CardInnerAppearance } from '../../view/Card/types';
|
|
3
3
|
import { type AnalyticsPayload } from '../types';
|
|
4
|
-
import { type InvokeFailedEventProps, type InvokeSucceededEventProps, type UiActionClickedEventProps, type UiRenderFailedEventProps, type UiRenderSuccessEventProps } from './types';
|
|
5
4
|
export declare const ANALYTICS_CHANNEL = "media";
|
|
6
5
|
export declare const context: {
|
|
7
6
|
componentName: string;
|
|
@@ -20,8 +19,3 @@ export declare class SmartLinkEvents {
|
|
|
20
19
|
insertSmartLink(url: string, type: CardInnerAppearance, createAnalyticsEvent?: CreateUIAnalyticsEvent): void;
|
|
21
20
|
}
|
|
22
21
|
export declare const fireSmartLinkEvent: (payload: AnalyticsPayload, createAnalyticsEvent?: CreateUIAnalyticsEvent) => void;
|
|
23
|
-
export declare const invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => AnalyticsPayload;
|
|
24
|
-
export declare const invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => AnalyticsPayload;
|
|
25
|
-
export declare const uiActionClickedEvent: ({ id, actionType, extensionKey, display, definitionId, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => AnalyticsPayload;
|
|
26
|
-
export declare const uiRenderSuccessEvent: ({ display, status, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, canBeDatasource, }: UiRenderSuccessEventProps) => AnalyticsPayload;
|
|
27
|
-
export declare const uiRenderFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, destinationProduct, destinationSubproduct, location, }: UiRenderFailedEventProps) => AnalyticsPayload;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent
|
|
1
|
+
export { ANALYTICS_CHANNEL, context, fireSmartLinkEvent } from './analytics';
|
|
@@ -1,47 +1,5 @@
|
|
|
1
|
-
import { type ErrorInfo } from 'react';
|
|
2
|
-
import { type CardType } from '@atlaskit/linking-common';
|
|
3
|
-
import { type InvokeType } from '../../model/invoke-opts';
|
|
4
|
-
import { type CardInnerAppearance } from '../../view/Card/types';
|
|
5
1
|
export type DestinationProduct = 'jira' | 'confluence' | 'bitbucket' | 'trello';
|
|
6
2
|
export type DestinationSubproduct = 'core' | 'software' | 'servicedesk';
|
|
7
|
-
export interface CommonEventProps {
|
|
8
|
-
id?: string;
|
|
9
|
-
definitionId?: string;
|
|
10
|
-
extensionKey?: string;
|
|
11
|
-
resourceType?: string;
|
|
12
|
-
destinatinoObjectType?: string;
|
|
13
|
-
destinationSubproduct?: DestinationSubproduct | string;
|
|
14
|
-
destinationProduct?: DestinationProduct | string;
|
|
15
|
-
location?: string;
|
|
16
|
-
statusDetails?: string;
|
|
17
|
-
}
|
|
18
|
-
export type InvokeSucceededEventProps = CommonEventProps & {
|
|
19
|
-
id?: string;
|
|
20
|
-
actionType: string;
|
|
21
|
-
display?: CardInnerAppearance;
|
|
22
|
-
};
|
|
23
|
-
export type InvokeFailedEventProps = CommonEventProps & {
|
|
24
|
-
id?: string;
|
|
25
|
-
actionType: string;
|
|
26
|
-
display?: CardInnerAppearance;
|
|
27
|
-
reason: string;
|
|
28
|
-
};
|
|
29
|
-
export type UiActionClickedEventProps = CommonEventProps & {
|
|
30
|
-
id?: string;
|
|
31
|
-
display?: CardInnerAppearance;
|
|
32
|
-
actionType: string;
|
|
33
|
-
invokeType?: InvokeType;
|
|
34
|
-
};
|
|
35
|
-
export type UiRenderSuccessEventProps = CommonEventProps & {
|
|
36
|
-
display: CardInnerAppearance;
|
|
37
|
-
status: CardType;
|
|
38
|
-
canBeDatasource?: boolean;
|
|
39
|
-
};
|
|
40
|
-
export type UiRenderFailedEventProps = CommonEventProps & {
|
|
41
|
-
display: CardInnerAppearance;
|
|
42
|
-
error: Error;
|
|
43
|
-
errorInfo: ErrorInfo;
|
|
44
|
-
};
|
|
45
3
|
export type ClickType = 'left' | 'middle' | 'right' | 'keyboard' | 'none';
|
|
46
4
|
export type ClickOutcome = 'prevented' | 'clickThrough' | 'clickThroughNewTabOrWindow' | 'contextMenu' | 'alt' | 'contentEditable' | 'unknown';
|
|
47
5
|
export type UiLinkClickedEventProps = {
|
|
@@ -89,10 +89,3 @@ export declare const mocks: {
|
|
|
89
89
|
export declare const fakeResponse: () => Promise<JsonLd.Response<JsonLd.Data.BaseData>>;
|
|
90
90
|
export declare const fakeFactory: any;
|
|
91
91
|
export declare const waitFor: (time?: number) => Promise<unknown>;
|
|
92
|
-
export declare const mockAnalytics: {
|
|
93
|
-
operational: {
|
|
94
|
-
invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
|
|
95
|
-
invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeFailedEventProps) => void;
|
|
96
|
-
};
|
|
97
|
-
screen: Screen;
|
|
98
|
-
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type BlockCardProps } from './types';
|
|
3
|
-
export declare const BlockCard: ({ id, url, cardState, authFlow, handleAuthorize, handleFrameClick, renderers, isSelected, onResolve, onError, testId,
|
|
3
|
+
export declare const BlockCard: ({ id, url, cardState, authFlow, handleAuthorize, handleFrameClick, renderers, isSelected, onResolve, onError, testId, actionOptions, }: BlockCardProps) => JSX.Element;
|