@atlaskit/smart-card 15.5.0 → 16.2.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 +78 -0
- package/dist/cjs/client/index.js +30 -30
- package/dist/cjs/client/utils/environments.js +1 -1
- package/dist/cjs/extractors/block/index.js +4 -4
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +4 -3
- package/dist/cjs/in-product.js +43 -0
- package/dist/cjs/index.js +66 -4
- package/dist/cjs/providers/editor/index.js +113 -78
- package/dist/cjs/providers/editor/transformer.js +1 -1
- package/dist/cjs/state/actions/constants.js +1 -5
- package/dist/cjs/state/actions/helpers.js +1 -3
- package/dist/cjs/state/actions/index.js +16 -13
- package/dist/cjs/state/analytics/index.js +32 -84
- package/dist/cjs/state/analytics/ufoExperiences.js +60 -0
- package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +106 -0
- package/dist/cjs/state/context/provider.js +3 -16
- package/dist/cjs/state/helpers.js +1 -2
- package/dist/cjs/state/hooks/useSmartLink.js +6 -6
- package/dist/cjs/state/reducers/index.js +3 -8
- package/dist/cjs/utils/analytics/analytics.js +31 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/index.js +3 -2
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyFallback.js +6 -2
- package/dist/cjs/view/CardWithUrl/component-lazy/index.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +10 -4
- package/dist/cjs/view/CardWithUrl/loader.js +110 -133
- package/dist/cjs/view/EmbedCard/{IframelyResizeMessageListener.js → EmbedResizeMessageListener.js} +11 -19
- package/dist/cjs/view/SmartLinkEvents/useSmartLinkEvents.js +21 -0
- package/dist/es2019/client/index.js +47 -43
- package/dist/es2019/client/utils/environments.js +1 -1
- package/dist/es2019/extractors/block/index.js +4 -4
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +4 -4
- package/dist/es2019/in-product.js +1 -0
- package/dist/es2019/index.js +7 -2
- package/dist/es2019/providers/editor/index.js +18 -6
- package/dist/es2019/providers/editor/transformer.js +1 -1
- package/dist/es2019/state/actions/constants.js +0 -2
- package/dist/es2019/state/actions/helpers.js +1 -3
- package/dist/es2019/state/actions/index.js +12 -11
- package/dist/es2019/state/analytics/index.js +2 -40
- package/dist/es2019/state/analytics/ufoExperiences.js +40 -0
- package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +62 -0
- package/dist/es2019/state/context/provider.js +2 -8
- package/dist/es2019/state/helpers.js +1 -2
- package/dist/es2019/state/hooks/useSmartLink.js +4 -5
- package/dist/es2019/state/reducers/index.js +3 -8
- package/dist/es2019/utils/analytics/analytics.js +16 -0
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/index.js +3 -2
- package/dist/es2019/view/CardWithUrl/component-lazy/LazyFallback.js +3 -1
- package/dist/es2019/view/CardWithUrl/component-lazy/index.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +10 -4
- package/dist/es2019/view/CardWithUrl/loader.js +87 -89
- package/dist/es2019/view/EmbedCard/{IframelyResizeMessageListener.js → EmbedResizeMessageListener.js} +3 -10
- package/dist/es2019/view/SmartLinkEvents/useSmartLinkEvents.js +10 -0
- package/dist/esm/client/index.js +30 -31
- package/dist/esm/client/utils/environments.js +1 -1
- package/dist/esm/extractors/block/index.js +4 -4
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +4 -3
- package/dist/esm/in-product.js +1 -0
- package/dist/esm/index.js +7 -2
- package/dist/esm/providers/editor/index.js +110 -78
- package/dist/esm/providers/editor/transformer.js +1 -1
- package/dist/esm/state/actions/constants.js +0 -2
- package/dist/esm/state/actions/helpers.js +1 -3
- package/dist/esm/state/actions/index.js +15 -13
- package/dist/esm/state/analytics/index.js +2 -80
- package/dist/esm/state/analytics/ufoExperiences.js +40 -0
- package/dist/esm/state/analytics/useSmartLinkAnalytics.js +94 -0
- package/dist/esm/state/context/provider.js +3 -15
- package/dist/esm/state/helpers.js +1 -2
- package/dist/esm/state/hooks/useSmartLink.js +6 -6
- package/dist/esm/state/reducers/index.js +3 -8
- package/dist/esm/utils/analytics/analytics.js +26 -0
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/index.js +3 -2
- package/dist/esm/view/CardWithUrl/component-lazy/LazyFallback.js +3 -1
- package/dist/esm/view/CardWithUrl/component-lazy/index.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +10 -4
- package/dist/esm/view/CardWithUrl/loader.js +103 -127
- package/dist/esm/view/EmbedCard/{IframelyResizeMessageListener.js → EmbedResizeMessageListener.js} +9 -16
- package/dist/esm/view/SmartLinkEvents/useSmartLinkEvents.js +12 -0
- package/dist/types/__tests_external__/index.d.ts +6 -0
- package/dist/types/__tests_external__/page-objects/BaseCard.d.ts +18 -0
- package/dist/types/__tests_external__/page-objects/BlockCard.d.ts +6 -0
- package/dist/types/__tests_external__/page-objects/EmbedCard.d.ts +6 -0
- package/dist/types/__tests_external__/page-objects/InlineCard.d.ts +6 -0
- package/dist/types/__tests_external__/test-cases/card.d.ts +3 -0
- package/dist/types/__tests_external__/test-cases/embed.d.ts +3 -0
- package/dist/types/__tests_external__/test-cases/inline.d.ts +3 -0
- package/dist/types/__tests_external__/test-cases/types.d.ts +5 -0
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/extractors/block/index.d.ts +2 -2
- package/dist/types/extractors/common/__mocks__/jsonld.d.ts +61 -0
- package/dist/types/extractors/common/actions/extractPreviewAction.d.ts +1 -1
- package/dist/types/in-product.d.ts +1 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types/providers/editor/index.d.ts +3 -0
- package/dist/types/state/actions/constants.d.ts +0 -2
- package/dist/types/state/actions/types.d.ts +0 -2
- package/dist/types/state/analytics/index.d.ts +3 -32
- package/dist/types/state/analytics/ufoExperiences.d.ts +7 -0
- package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +30 -0
- package/dist/types/state/context/provider.d.ts +1 -1
- package/dist/types/state/context/types.d.ts +4 -2
- package/dist/types/state/hooks/useSmartLink.d.ts +4 -5
- package/dist/types/state/store/types.d.ts +2 -1
- package/dist/types/utils/analytics/analytics.d.ts +3 -0
- package/dist/types/utils/types.d.ts +1 -1
- package/dist/types/view/BlockCard/types.d.ts +2 -1
- package/dist/types/view/CardWithUrl/component-lazy/LazyFallback.d.ts +1 -0
- package/dist/types/view/CardWithUrl/component-lazy/index.d.ts +1 -1
- package/dist/types/view/CardWithUrl/loader.d.ts +1 -15
- package/dist/types/view/EmbedCard/{IframelyResizeMessageListener.d.ts → EmbedResizeMessageListener.d.ts} +1 -1
- package/dist/types/view/SmartLinkEvents/useSmartLinkEvents.d.ts +2 -0
- package/in-product/package.json +7 -0
- package/package.json +25 -20
|
@@ -1,141 +1,117 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
|
-
import React from 'react';
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { lazy, useEffect, useState, Suspense } from 'react';
|
|
14
3
|
import uuid from 'uuid';
|
|
15
4
|
import { CardLinkView } from '@atlaskit/media-ui';
|
|
16
5
|
import { uiRenderFailedEvent, fireSmartLinkEvent } from '../../utils/analytics';
|
|
17
6
|
import { clearMarks, clearMeasures } from '../../utils/performance';
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
fireSmartLinkEvent(analyticsPayload, createAnalyticsEvent);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
_this.state = {
|
|
47
|
-
id: uuid()
|
|
48
|
-
};
|
|
49
|
-
return _this;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
_createClass(CardWithURLRenderer, [{
|
|
53
|
-
key: "componentDidMount",
|
|
54
|
-
value: function componentDidMount() {
|
|
55
|
-
if (CardWithURLRenderer.CardContent === null) {
|
|
56
|
-
(this.props.importer || CardWithURLRenderer.moduleImporter)(this);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}, {
|
|
60
|
-
key: "componentWillUnmount",
|
|
61
|
-
value: function componentWillUnmount() {
|
|
62
|
-
var id = this.state.id;
|
|
7
|
+
import { ErrorBoundary } from 'react-error-boundary';
|
|
8
|
+
import { failUfoExperience, startUfoExperience } from '../../state/analytics/ufoExperiences';
|
|
9
|
+
var LazyCardWithUrlContent = /*#__PURE__*/lazy(function () {
|
|
10
|
+
return import(
|
|
11
|
+
/* webpackChunkName: "@atlaskit-internal_smartcard-urlcardcontent" */
|
|
12
|
+
'./component-lazy/index');
|
|
13
|
+
});
|
|
14
|
+
export function CardWithURLRenderer(props) {
|
|
15
|
+
var _useState = useState(function () {
|
|
16
|
+
return uuid();
|
|
17
|
+
}),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
19
|
+
id = _useState2[0]; // Equivalent to ComponentWillMount
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
useState(function () {
|
|
23
|
+
// We want to start timing of render event only once and right at the start
|
|
24
|
+
startUfoExperience('smart-link-rendered', id);
|
|
25
|
+
});
|
|
26
|
+
useEffect(function () {
|
|
27
|
+
// ComponentWillUnmount
|
|
28
|
+
return function () {
|
|
63
29
|
clearMarks(id);
|
|
64
30
|
clearMeasures(id);
|
|
31
|
+
};
|
|
32
|
+
}, [id]);
|
|
33
|
+
|
|
34
|
+
var logError = function logError(error, info) {
|
|
35
|
+
var componentStack = info.componentStack; // NB: APIErrors are thrown in response to Object Resolver Service.
|
|
36
|
+
// In these cases, control is handed back to the Editor. We do not
|
|
37
|
+
// fire an event for these, as they do not cover failed UI render events.
|
|
38
|
+
|
|
39
|
+
if (error.name === 'APIError') {
|
|
40
|
+
throw error;
|
|
41
|
+
} // NB: the rest of the errors caught here are unexpected, and correlate
|
|
42
|
+
// to the reliability of the smart-card front-end components. We instrument
|
|
43
|
+
// these in order to measure our front-end reliability.
|
|
44
|
+
else {
|
|
45
|
+
var errorInfo = {
|
|
46
|
+
componentStack: componentStack
|
|
47
|
+
};
|
|
48
|
+
failUfoExperience('smart-link-rendered', id);
|
|
49
|
+
failUfoExperience('smart-link-authenticated', id);
|
|
50
|
+
dispatchAnalytics(uiRenderFailedEvent(appearance, error, errorInfo));
|
|
65
51
|
}
|
|
66
|
-
}
|
|
67
|
-
key: "componentDidCatch",
|
|
68
|
-
value: function componentDidCatch(error, errorInfo) {
|
|
69
|
-
var appearance = this.props.appearance; // NB: APIErrors are thrown in response to Object Resolver Service.
|
|
70
|
-
// In these cases, control is handed back to the Editor. We do not
|
|
71
|
-
// fire an event for these, as they do not cover failed UI render events.
|
|
52
|
+
}; // Wrapper around analytics.
|
|
72
53
|
|
|
73
|
-
if (error.name === 'APIError') {
|
|
74
|
-
throw error;
|
|
75
|
-
} // NB: the rest of the errors caught here are unexpected, and correlate
|
|
76
|
-
// to the reliability of the smart-card front-end components. We instrument
|
|
77
|
-
// these in order to measure our front-end reliability.
|
|
78
|
-
else {
|
|
79
|
-
this.dispatchAnalytics(uiRenderFailedEvent(appearance, error, errorInfo));
|
|
80
|
-
}
|
|
81
|
-
} // Wrapper around analytics.
|
|
82
54
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
var _this$props2 = this.props,
|
|
87
|
-
url = _this$props2.url,
|
|
88
|
-
appearance = _this$props2.appearance,
|
|
89
|
-
isSelected = _this$props2.isSelected,
|
|
90
|
-
isFrameVisible = _this$props2.isFrameVisible,
|
|
91
|
-
onClick = _this$props2.onClick,
|
|
92
|
-
container = _this$props2.container,
|
|
93
|
-
onResolve = _this$props2.onResolve,
|
|
94
|
-
testId = _this$props2.testId,
|
|
95
|
-
showActions = _this$props2.showActions,
|
|
96
|
-
inheritDimensions = _this$props2.inheritDimensions,
|
|
97
|
-
platform = _this$props2.platform,
|
|
98
|
-
embedIframeRef = _this$props2.embedIframeRef,
|
|
99
|
-
inlinePreloaderStyle = _this$props2.inlinePreloaderStyle;
|
|
55
|
+
var dispatchAnalytics = function dispatchAnalytics(analyticsPayload) {
|
|
56
|
+
var appearance = props.appearance,
|
|
57
|
+
createAnalyticsEvent = props.createAnalyticsEvent;
|
|
100
58
|
|
|
101
|
-
|
|
102
|
-
|
|
59
|
+
if (analyticsPayload && analyticsPayload.attributes) {
|
|
60
|
+
// Update if we haven't already set the display - possible
|
|
61
|
+
// in the case of `preview` which is rendered differently.
|
|
62
|
+
if (!analyticsPayload.attributes.display) {
|
|
63
|
+
analyticsPayload.attributes.display = appearance;
|
|
103
64
|
}
|
|
104
|
-
|
|
105
|
-
return CardWithURLRenderer.CardContent !== null ? /*#__PURE__*/React.createElement(CardWithURLRenderer.CardContent, {
|
|
106
|
-
id: this.state.id,
|
|
107
|
-
url: url,
|
|
108
|
-
appearance: appearance,
|
|
109
|
-
onClick: onClick,
|
|
110
|
-
isSelected: isSelected,
|
|
111
|
-
isFrameVisible: isFrameVisible,
|
|
112
|
-
dispatchAnalytics: this.dispatchAnalytics,
|
|
113
|
-
container: container,
|
|
114
|
-
onResolve: onResolve,
|
|
115
|
-
testId: testId,
|
|
116
|
-
showActions: showActions,
|
|
117
|
-
inheritDimensions: inheritDimensions,
|
|
118
|
-
platform: platform,
|
|
119
|
-
embedIframeRef: embedIframeRef,
|
|
120
|
-
inlinePreloaderStyle: inlinePreloaderStyle
|
|
121
|
-
}) : /*#__PURE__*/React.createElement(CardLinkView, {
|
|
122
|
-
key: 'chunk-placeholder',
|
|
123
|
-
link: url
|
|
124
|
-
});
|
|
125
65
|
}
|
|
126
|
-
}], [{
|
|
127
|
-
key: "moduleImporter",
|
|
128
|
-
value: function moduleImporter(target) {
|
|
129
|
-
import(
|
|
130
|
-
/* webpackChunkName: "@atlaskit-internal_smartcard-urlcardcontent" */
|
|
131
|
-
'./component-lazy/index').then(function (module) {
|
|
132
|
-
CardWithURLRenderer.CardContent = module.LazyCardWithUrlContent;
|
|
133
|
-
target.forceUpdate();
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}]);
|
|
137
66
|
|
|
138
|
-
|
|
139
|
-
}
|
|
67
|
+
fireSmartLinkEvent(analyticsPayload, createAnalyticsEvent);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var url = props.url,
|
|
71
|
+
appearance = props.appearance,
|
|
72
|
+
isSelected = props.isSelected,
|
|
73
|
+
isFrameVisible = props.isFrameVisible,
|
|
74
|
+
onClick = props.onClick,
|
|
75
|
+
container = props.container,
|
|
76
|
+
onResolve = props.onResolve,
|
|
77
|
+
testId = props.testId,
|
|
78
|
+
showActions = props.showActions,
|
|
79
|
+
inheritDimensions = props.inheritDimensions,
|
|
80
|
+
platform = props.platform,
|
|
81
|
+
embedIframeRef = props.embedIframeRef,
|
|
82
|
+
inlinePreloaderStyle = props.inlinePreloaderStyle;
|
|
83
|
+
|
|
84
|
+
if (!url) {
|
|
85
|
+
throw new Error('@atlaskit/smart-card: url property is missing.');
|
|
86
|
+
}
|
|
140
87
|
|
|
141
|
-
|
|
88
|
+
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
89
|
+
FallbackComponent: ErrorFallback,
|
|
90
|
+
onError: logError
|
|
91
|
+
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
92
|
+
fallback: /*#__PURE__*/React.createElement(CardLinkView, {
|
|
93
|
+
key: 'chunk-placeholder',
|
|
94
|
+
link: url
|
|
95
|
+
})
|
|
96
|
+
}, /*#__PURE__*/React.createElement(LazyCardWithUrlContent, {
|
|
97
|
+
id: id,
|
|
98
|
+
url: url,
|
|
99
|
+
appearance: appearance,
|
|
100
|
+
onClick: onClick,
|
|
101
|
+
isSelected: isSelected,
|
|
102
|
+
isFrameVisible: isFrameVisible,
|
|
103
|
+
dispatchAnalytics: dispatchAnalytics,
|
|
104
|
+
container: container,
|
|
105
|
+
onResolve: onResolve,
|
|
106
|
+
testId: testId,
|
|
107
|
+
showActions: showActions,
|
|
108
|
+
inheritDimensions: inheritDimensions,
|
|
109
|
+
platform: platform,
|
|
110
|
+
embedIframeRef: embedIframeRef,
|
|
111
|
+
inlinePreloaderStyle: inlinePreloaderStyle
|
|
112
|
+
})));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
var ErrorFallback = function ErrorFallback() {
|
|
116
|
+
return /*#__PURE__*/React.createElement("span", null);
|
|
117
|
+
};
|
package/dist/esm/view/EmbedCard/{IframelyResizeMessageListener.js → EmbedResizeMessageListener.js}
RENAMED
|
@@ -12,17 +12,15 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { embedHeaderHeight } from '@atlaskit/media-ui/embeds';
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
export var IframelyResizeMessageListener = /*#__PURE__*/function (_React$Component) {
|
|
18
|
-
_inherits(IframelyResizeMessageListener, _React$Component);
|
|
15
|
+
export var EmbedResizeMessageListener = /*#__PURE__*/function (_React$Component) {
|
|
16
|
+
_inherits(EmbedResizeMessageListener, _React$Component);
|
|
19
17
|
|
|
20
|
-
var _super = _createSuper(
|
|
18
|
+
var _super = _createSuper(EmbedResizeMessageListener);
|
|
21
19
|
|
|
22
|
-
function
|
|
20
|
+
function EmbedResizeMessageListener() {
|
|
23
21
|
var _this;
|
|
24
22
|
|
|
25
|
-
_classCallCheck(this,
|
|
23
|
+
_classCallCheck(this, EmbedResizeMessageListener);
|
|
26
24
|
|
|
27
25
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
26
|
args[_key] = arguments[_key];
|
|
@@ -31,16 +29,11 @@ export var IframelyResizeMessageListener = /*#__PURE__*/function (_React$Compone
|
|
|
31
29
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
30
|
|
|
33
31
|
_defineProperty(_assertThisInitialized(_this), "messageCallback", function (event) {
|
|
34
|
-
var embedIframeRef = _this.props.embedIframeRef;
|
|
35
|
-
// See https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage.
|
|
36
|
-
|
|
37
|
-
var isFromAllowedDomain = EMBED_ALLOWED_DOMAINS.includes(event.origin); // This is needed for WD/VR tests to work properly, where we load example as iframe src
|
|
38
|
-
|
|
39
|
-
var isFromSameDomain = event.origin === window.origin;
|
|
32
|
+
var embedIframeRef = _this.props.embedIframeRef;
|
|
40
33
|
var isFromExpectedIframe = embedIframeRef.current && event.source === embedIframeRef.current.contentWindow;
|
|
41
34
|
var isStringData = typeof event.data === 'string';
|
|
42
35
|
|
|
43
|
-
if (
|
|
36
|
+
if (isFromExpectedIframe && isStringData) {
|
|
44
37
|
try {
|
|
45
38
|
var data = JSON.parse(event.data);
|
|
46
39
|
|
|
@@ -62,7 +55,7 @@ export var IframelyResizeMessageListener = /*#__PURE__*/function (_React$Compone
|
|
|
62
55
|
return _this;
|
|
63
56
|
}
|
|
64
57
|
|
|
65
|
-
_createClass(
|
|
58
|
+
_createClass(EmbedResizeMessageListener, [{
|
|
66
59
|
key: "componentDidMount",
|
|
67
60
|
value: function componentDidMount() {
|
|
68
61
|
window.addEventListener('message', this.messageCallback);
|
|
@@ -79,5 +72,5 @@ export var IframelyResizeMessageListener = /*#__PURE__*/function (_React$Compone
|
|
|
79
72
|
}
|
|
80
73
|
}]);
|
|
81
74
|
|
|
82
|
-
return
|
|
75
|
+
return EmbedResizeMessageListener;
|
|
83
76
|
}(React.Component);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { SmartLinkEvents } from '../../utils/analytics/analytics';
|
|
3
|
+
export function useSmartLinkEvents() {
|
|
4
|
+
/**
|
|
5
|
+
* this utility maybe extended in the future to include
|
|
6
|
+
* more contextual info about SLs
|
|
7
|
+
*/
|
|
8
|
+
var events = useMemo(function () {
|
|
9
|
+
return new SmartLinkEvents();
|
|
10
|
+
}, []);
|
|
11
|
+
return events;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { InlineCardPageObject } from './page-objects/InlineCard';
|
|
2
|
+
export { BlockCardPageObject } from './page-objects/BlockCard';
|
|
3
|
+
export { EmbedCardPageObject } from './page-objects/EmbedCard';
|
|
4
|
+
export { inlineSmartLinkRendersTestCase } from './test-cases/inline';
|
|
5
|
+
export { blockSmartLinkRendersTestCase } from './test-cases/card';
|
|
6
|
+
export { embedSmartLinkRendersTestCase } from './test-cases/embed';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
/// <reference types="jquery" />
|
|
3
|
+
import { InProductTestPageObject, CypressType } from '@atlaskit/in-product-testing';
|
|
4
|
+
import { CardType } from '../../state/store/types';
|
|
5
|
+
import { CardAppearance } from '../../view/Card';
|
|
6
|
+
export declare class BaseCardPageObject extends InProductTestPageObject {
|
|
7
|
+
protected cy: CypressType;
|
|
8
|
+
protected appearance: CardAppearance;
|
|
9
|
+
protected constructor(cy: CypressType, appearance: CardAppearance);
|
|
10
|
+
private static CARD_TIMEOUT;
|
|
11
|
+
private _toSelector;
|
|
12
|
+
expectCardReady(numOfCards?: number, status?: CardType): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
13
|
+
expectCardNotExists(status?: CardType): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
14
|
+
findCardNth(nth?: number, status?: CardType): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
15
|
+
assertHrefRendered(url: string): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
16
|
+
assertHrefNotRendered(url: string): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
17
|
+
click(status?: CardType): Cypress.Chainable<JQuery<HTMLElement>>;
|
|
18
|
+
}
|
|
@@ -3,6 +3,6 @@ import { BlockCardResolvedViewProps, ActionProps } from '@atlaskit/media-ui';
|
|
|
3
3
|
import { LinkPerson } from '../common/person/types';
|
|
4
4
|
import { ExtractBlockOpts } from './types';
|
|
5
5
|
import { CardProviderRenderers } from '../../state/context/types';
|
|
6
|
-
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts | undefined) => ActionProps[];
|
|
6
|
+
export declare const extractBlockActions: (props: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, opts?: ExtractBlockOpts | undefined, platform?: "web" | "mobile" | undefined) => ActionProps[];
|
|
7
7
|
export declare const extractBlockUsers: (jsonLd: JsonLd.Data.BaseData) => LinkPerson[] | undefined;
|
|
8
|
-
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta | undefined, opts?: ExtractBlockOpts | undefined, renderers?: CardProviderRenderers | undefined) => BlockCardResolvedViewProps;
|
|
8
|
+
export declare const extractBlockProps: (jsonLd: JsonLd.Data.BaseData, meta?: JsonLd.Meta.BaseMeta | undefined, opts?: ExtractBlockOpts | undefined, renderers?: CardProviderRenderers | undefined, platform?: "web" | "mobile" | undefined) => BlockCardResolvedViewProps;
|
|
@@ -85,3 +85,64 @@ export declare const TEST_DOCUMENT_WITH_ACTIONS: {
|
|
|
85
85
|
summaryMap?: Record<string, string> | undefined;
|
|
86
86
|
updated?: string | undefined;
|
|
87
87
|
};
|
|
88
|
+
export declare const PREVIEW: JsonLd.Data.BaseData['preview'];
|
|
89
|
+
export declare const TEST_DOCUMENT_WITH_PREVIEW: {
|
|
90
|
+
preview: JsonLd.Primitives.LinkModel & JsonLd.Primitives.PreviewExtension;
|
|
91
|
+
'@type': "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink" | ("Object" | "Document")[] | ("Object" | "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink")[] | ("Document" | "schema:DigitalDocument")[];
|
|
92
|
+
'schema:fileFormat'?: string | undefined;
|
|
93
|
+
'atlassian:fileSize'?: number | undefined;
|
|
94
|
+
'schema:dateCreated'?: string | undefined;
|
|
95
|
+
'atlassian:updatedBy'?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Person<any> | undefined;
|
|
96
|
+
'schema:commentCount'?: number | undefined;
|
|
97
|
+
'atlassian:isDeleted'?: boolean | undefined;
|
|
98
|
+
'schema:potentialAction'?: import("schema-dts").DeleteAction | import("schema-dts").ViewAction | import("schema-dts").DownloadAction | import("schema-dts").WatchAction | import("schema-dts").CommentAction | import("schema-dts").ShareAction | JsonLd.Data.DocumentAction[] | undefined;
|
|
99
|
+
'atlassian:state'?: string | undefined;
|
|
100
|
+
'@context': JsonLd.Primitives.Context;
|
|
101
|
+
'atlassian:downloadUrl'?: string | undefined;
|
|
102
|
+
'atlassian:visitUrl'?: string | undefined;
|
|
103
|
+
'atlassian:titlePrefix'?: JsonLd.Data.TitlePrefix | undefined;
|
|
104
|
+
'@id'?: string | undefined;
|
|
105
|
+
attachment?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
106
|
+
attributedTo?: (string & {
|
|
107
|
+
actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
108
|
+
}) | (JsonLd.Primitives.Object<any> & {
|
|
109
|
+
actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
110
|
+
}) | (JsonLd.Primitives.LinkModel & {
|
|
111
|
+
actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
112
|
+
}) | ((string & {
|
|
113
|
+
actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
114
|
+
}) | (JsonLd.Primitives.Object<any> & {
|
|
115
|
+
actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
116
|
+
}) | (JsonLd.Primitives.LinkModel & {
|
|
117
|
+
actor?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
118
|
+
}))[] | undefined;
|
|
119
|
+
audience?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
120
|
+
bcc?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
121
|
+
bto?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
122
|
+
cc?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
123
|
+
context?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
|
|
124
|
+
generator?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
|
|
125
|
+
icon?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Image | undefined;
|
|
126
|
+
image?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Image | undefined;
|
|
127
|
+
inReplyTo?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
128
|
+
location?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
129
|
+
oneOf?: (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
130
|
+
anyOf?: (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
131
|
+
closed?: string | boolean | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | undefined;
|
|
132
|
+
replies?: JsonLd.Primitives.Collection<any> | undefined;
|
|
133
|
+
tag?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
134
|
+
to?: string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel | (string | JsonLd.Primitives.Object<any> | JsonLd.Primitives.LinkModel)[] | undefined;
|
|
135
|
+
url?: string | JsonLd.Primitives.LinkModel | JsonLd.Primitives.Link[] | undefined;
|
|
136
|
+
content?: string | undefined;
|
|
137
|
+
contentMap?: Record<string, string> | undefined;
|
|
138
|
+
name?: string | undefined;
|
|
139
|
+
nameMap?: Record<string, string> | undefined;
|
|
140
|
+
duration?: string | undefined;
|
|
141
|
+
mediaType?: string | undefined;
|
|
142
|
+
endTime?: string | undefined;
|
|
143
|
+
published?: string | undefined;
|
|
144
|
+
startTime?: string | undefined;
|
|
145
|
+
summary?: string | undefined;
|
|
146
|
+
summaryMap?: Record<string, string> | undefined;
|
|
147
|
+
updated?: string | undefined;
|
|
148
|
+
};
|
|
@@ -2,4 +2,4 @@ import { BlockCardResolvedViewProps } from '@atlaskit/media-ui';
|
|
|
2
2
|
import { JsonLd } from 'json-ld-types';
|
|
3
3
|
import { InvokeHandler } from '../../../model/invoke-handler';
|
|
4
4
|
import { AnalyticsHandler } from '../../../utils/types';
|
|
5
|
-
export declare const extractPreviewAction: (definitionId: string | undefined, viewProps: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, handleInvoke: InvokeHandler, handleAnalytics: AnalyticsHandler, testId?: string | undefined) => import("@atlaskit/media-ui").ActionProps | undefined;
|
|
5
|
+
export declare const extractPreviewAction: (definitionId: string | undefined, viewProps: BlockCardResolvedViewProps, jsonLd: JsonLd.Data.BaseData, handleInvoke: InvokeHandler, handleAnalytics: AnalyticsHandler, testId?: string | undefined, platform?: "web" | "mobile" | undefined) => import("@atlaskit/media-ui").ActionProps | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InlineCardPageObject, BlockCardPageObject, EmbedCardPageObject, inlineSmartLinkRendersTestCase, blockSmartLinkRendersTestCase, embedSmartLinkRendersTestCase, } from './__tests_external__';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,5 +10,9 @@ export { Card } from './view/Card';
|
|
|
10
10
|
export type { CardProps, CardAppearance, CardPlatform } from './view/Card';
|
|
11
11
|
export { default as Context } from './state/context';
|
|
12
12
|
export type { CardContext } from './state/context';
|
|
13
|
-
export {
|
|
13
|
+
export { EmbedResizeMessageListener } from './view/EmbedCard/EmbedResizeMessageListener';
|
|
14
14
|
export { embedHeaderHeight } from '@atlaskit/media-ui/embeds';
|
|
15
|
+
export { SmartLinkEvents } from './utils/analytics/analytics';
|
|
16
|
+
export { useSmartLinkEvents } from './view/SmartLinkEvents/useSmartLinkEvents';
|
|
17
|
+
export { contentFooterClassName, metadataListClassName, blockCardResolvingViewClassName, blockCardResolvedViewClassName, blockCardForbiddenViewClassName, blockCardIconImageClassName, } from '@atlaskit/media-ui/classNames';
|
|
18
|
+
export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/LazyFallback';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'setimmediate';
|
|
1
2
|
import { CardProvider, CardAdf } from './types';
|
|
2
3
|
import { CardAppearance } from '../../view/Card';
|
|
3
4
|
import { EnvironmentsKeys } from '../../client/types';
|
|
@@ -7,7 +8,9 @@ export declare class EditorCardProvider implements CardProvider {
|
|
|
7
8
|
private patterns?;
|
|
8
9
|
private requestHeaders;
|
|
9
10
|
private transformer;
|
|
11
|
+
private patternLoader;
|
|
10
12
|
constructor(envKey?: EnvironmentsKeys);
|
|
13
|
+
private batchPatterns;
|
|
11
14
|
private check;
|
|
12
15
|
private fetchPatterns;
|
|
13
16
|
findPattern(url: string): Promise<boolean>;
|
|
@@ -7,7 +7,5 @@ export declare const ACTION_PRELOAD = "preload";
|
|
|
7
7
|
export declare const ANALYTICS_RESOLVING = "resolving";
|
|
8
8
|
export declare const ANALYTICS_ERROR = "errored";
|
|
9
9
|
export declare const ANALYTICS_FALLBACK = "fallback";
|
|
10
|
-
export declare const MAX_LOADING_DELAY = 1200;
|
|
11
|
-
export declare const MAX_RELOAD_DELAY: number;
|
|
12
10
|
export declare const ERROR_MESSAGE_OAUTH = "Provider.authFlow is not set to OAuth2.";
|
|
13
11
|
export declare const ERROR_MESSAGE_FATAL = "Fatal error resolving URL";
|
|
@@ -5,11 +5,9 @@ export declare type CardActionType = 'pending' | 'resolving' | 'resolved' | 'err
|
|
|
5
5
|
export interface CardAction<T = JsonLd.Response> extends AnyAction {
|
|
6
6
|
type: CardActionType;
|
|
7
7
|
url: string;
|
|
8
|
-
hasExpired?: boolean;
|
|
9
8
|
payload?: T;
|
|
10
9
|
}
|
|
11
10
|
export declare type CardActionParams = {
|
|
12
11
|
url: string;
|
|
13
|
-
hasExpired?: boolean;
|
|
14
12
|
};
|
|
15
13
|
export declare type CardBaseActionCreator<T = JsonLd.Response> = (type: CardActionType, params: CardActionParams, payload?: T, error?: APIError) => CardAction<T>;
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { CardType } from '../store/types';
|
|
5
|
-
import { APIError } from '../../client/errors';
|
|
6
|
-
export declare const useSmartLinkAnalytics: (dispatchAnalytics: AnalyticsHandler) => {
|
|
7
|
-
ui: {
|
|
8
|
-
authEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
9
|
-
authAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
10
|
-
cardClickedEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
11
|
-
actionClickedEvent: (providerKey: string, actionType: string, display?: "inline" | "block" | "embed" | "preview" | undefined) => void;
|
|
12
|
-
closedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
13
|
-
renderSuccessEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
14
|
-
renderFailedEvent: (display: CardInnerAppearance, error: Error, errorInfo: ErrorInfo) => void;
|
|
15
|
-
};
|
|
16
|
-
operational: {
|
|
17
|
-
resolvedEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined) => void;
|
|
18
|
-
unresolvedEvent: (id: string, status: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined) => void;
|
|
19
|
-
invokeSucceededEvent: (id: string, providerKey: string, actionType: string, display: CardInnerAppearance) => void;
|
|
20
|
-
invokeFailedEvent: (id: string, providerKey: string, actionType: string, display: CardInnerAppearance, reason: string) => void;
|
|
21
|
-
connectSucceededEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
22
|
-
connectFailedEvent: (definitionId?: string | undefined, extensionKey?: string | undefined, reason?: string | undefined) => void;
|
|
23
|
-
instrument: (id: string, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => void;
|
|
24
|
-
};
|
|
25
|
-
track: {
|
|
26
|
-
appAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
27
|
-
};
|
|
28
|
-
screen: {
|
|
29
|
-
authPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export declare type AnalyticsFacade = ReturnType<typeof useSmartLinkAnalytics>;
|
|
1
|
+
export { startUfoExperience, succeedUfoExperience, failUfoExperience, addMetadataToExperience, } from './ufoExperiences';
|
|
2
|
+
export { useSmartLinkAnalytics } from './useSmartLinkAnalytics';
|
|
3
|
+
export type { AnalyticsFacade } from './useSmartLinkAnalytics';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CustomData } from '@atlaskit/ufo';
|
|
2
|
+
declare type UfoExperienceName = 'smart-link-rendered' | 'smart-link-authenticated';
|
|
3
|
+
export declare const startUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData | undefined) => void;
|
|
4
|
+
export declare const succeedUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData | undefined) => void;
|
|
5
|
+
export declare const failUfoExperience: (experienceName: UfoExperienceName, id: string, properties?: CustomData | undefined) => void;
|
|
6
|
+
export declare const addMetadataToExperience: (experienceName: UfoExperienceName, id: string, properties: CustomData) => void;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AnalyticsHandler } from '../../utils/types';
|
|
2
|
+
import { CardInnerAppearance } from '../../view/Card/types';
|
|
3
|
+
import { CardType } from '../store/types';
|
|
4
|
+
import { APIError } from '../../client/errors';
|
|
5
|
+
export declare const useSmartLinkAnalytics: (dispatchAnalytics: AnalyticsHandler) => {
|
|
6
|
+
ui: {
|
|
7
|
+
authEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
8
|
+
authAlternateAccountEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
9
|
+
cardClickedEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
10
|
+
actionClickedEvent: (providerKey: string, actionType: string, display?: "inline" | "block" | "embed" | "preview" | undefined) => void;
|
|
11
|
+
closedAuthEvent: (display: CardInnerAppearance, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
12
|
+
renderSuccessEvent: (display: CardInnerAppearance, id: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
13
|
+
};
|
|
14
|
+
operational: {
|
|
15
|
+
resolvedEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined) => void;
|
|
16
|
+
unresolvedEvent: (id: string, status: string, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined) => void;
|
|
17
|
+
invokeSucceededEvent: (id: string, providerKey: string, actionType: string, display: CardInnerAppearance) => void;
|
|
18
|
+
invokeFailedEvent: (id: string, providerKey: string, actionType: string, display: CardInnerAppearance, reason: string) => void;
|
|
19
|
+
connectSucceededEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
20
|
+
connectFailedEvent: (id: string, definitionId?: string | undefined, extensionKey?: string | undefined, status?: string | undefined) => void;
|
|
21
|
+
instrument: (id: string, status: CardType, definitionId?: string | undefined, extensionKey?: string | undefined, resourceType?: string | undefined, error?: APIError | undefined) => void;
|
|
22
|
+
};
|
|
23
|
+
track: {
|
|
24
|
+
appAccountConnected: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
25
|
+
};
|
|
26
|
+
screen: {
|
|
27
|
+
authPopupEvent: (definitionId?: string | undefined, extensionKey?: string | undefined) => void;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare type AnalyticsFacade = ReturnType<typeof useSmartLinkAnalytics>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CardProviderProps } from './types';
|
|
2
|
-
export declare function SmartCardProvider({ storeOptions, client: customClient,
|
|
2
|
+
export declare function SmartCardProvider({ storeOptions, client: customClient, authFlow: customAuthFlow, children, renderers, }: CardProviderProps): JSX.Element;
|
|
3
3
|
export type { CardProviderProps as ProviderProps };
|
|
4
4
|
export default SmartCardProvider;
|