@atlaskit/smart-card 26.20.1 → 26.22.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/extractors/common/meta/extractIsTrusted.js +7 -0
  3. package/dist/cjs/state/actions/index.js +16 -52
  4. package/dist/cjs/state/analytics/useSmartLinkAnalytics.js +12 -11
  5. package/dist/cjs/state/hooks/use-invoke-client-action/index.js +78 -0
  6. package/dist/cjs/state/hooks/use-invoke-client-action/types.js +5 -0
  7. package/dist/cjs/utils/analytics/analytics.js +5 -9
  8. package/dist/cjs/utils/mocks.js +9 -4
  9. package/dist/cjs/view/BlockCard/actions/PreviewAction.js +6 -70
  10. package/dist/cjs/view/BlockCard/components/Action.js +1 -3
  11. package/dist/cjs/view/LinkUrl/index.js +1 -1
  12. package/dist/es2019/extractors/common/meta/extractIsTrusted.js +7 -0
  13. package/dist/es2019/state/actions/index.js +10 -38
  14. package/dist/es2019/state/analytics/useSmartLinkAnalytics.js +12 -11
  15. package/dist/es2019/state/hooks/use-invoke-client-action/index.js +52 -0
  16. package/dist/es2019/state/hooks/use-invoke-client-action/types.js +1 -0
  17. package/dist/es2019/utils/analytics/analytics.js +5 -9
  18. package/dist/es2019/utils/mocks.js +9 -4
  19. package/dist/es2019/view/BlockCard/actions/PreviewAction.js +3 -44
  20. package/dist/es2019/view/BlockCard/components/Action.js +1 -1
  21. package/dist/es2019/view/LinkUrl/index.js +1 -1
  22. package/dist/esm/extractors/common/meta/extractIsTrusted.js +7 -0
  23. package/dist/esm/state/actions/index.js +16 -49
  24. package/dist/esm/state/analytics/useSmartLinkAnalytics.js +12 -11
  25. package/dist/esm/state/hooks/use-invoke-client-action/index.js +67 -0
  26. package/dist/esm/state/hooks/use-invoke-client-action/types.js +1 -0
  27. package/dist/esm/utils/analytics/analytics.js +5 -9
  28. package/dist/esm/utils/mocks.js +9 -4
  29. package/dist/esm/view/BlockCard/actions/PreviewAction.js +8 -65
  30. package/dist/esm/view/BlockCard/components/Action.js +1 -3
  31. package/dist/esm/view/LinkUrl/index.js +1 -1
  32. package/dist/types/state/analytics/useSmartLinkAnalytics.d.ts +3 -3
  33. package/dist/types/state/flexible-ui-context/index.d.ts +6 -6
  34. package/dist/types/state/hooks/use-invoke-client-action/index.d.ts +6 -0
  35. package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +30 -0
  36. package/dist/types/state/hooks/useSmartLink.d.ts +3 -3
  37. package/dist/types/utils/analytics/types.d.ts +3 -3
  38. package/dist/types/utils/mocks.d.ts +3 -3
  39. package/dist/types/view/BlockCard/actions/PreviewAction.d.ts +0 -5
  40. package/dist/types/view/FlexibleCard/components/utils.d.ts +3 -3
  41. package/dist/types-ts4.5/state/analytics/useSmartLinkAnalytics.d.ts +3 -3
  42. package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +6 -6
  43. package/dist/types-ts4.5/state/hooks/use-invoke-client-action/index.d.ts +6 -0
  44. package/dist/types-ts4.5/state/hooks/use-invoke-client-action/types.d.ts +30 -0
  45. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +3 -3
  46. package/dist/types-ts4.5/utils/analytics/types.d.ts +3 -3
  47. package/dist/types-ts4.5/utils/mocks.d.ts +3 -3
  48. package/dist/types-ts4.5/view/BlockCard/actions/PreviewAction.d.ts +0 -5
  49. package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +3 -3
  50. package/package.json +9 -5
  51. package/report.api.md +7 -7
  52. package/tmp/api-report-tmp.d.ts +6 -6
@@ -1,85 +1,28 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
5
- var _excluded = ["popupMountPointId", "onClose"],
6
- _excluded2 = ["details"];
7
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ var _excluded = ["details"];
8
4
  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; }
9
5
  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; }
10
6
  import React from 'react';
11
- import ReactDOM from 'react-dom';
12
- import { FormattedMessage, IntlProvider } from 'react-intl-next';
7
+ import { FormattedMessage } from 'react-intl-next';
13
8
  import { messages } from '../../../messages';
14
- /*
15
- Explanatory note:
16
- Actions don't have access to the react tree of whatever is rendered them
17
- (and this concept is fraught inside editor anyway) so we want to ensure
18
- it is mounting to a new unique place. This function manages that, including
19
- creating an element if it doesn't exist, as well as tidying up the react tree
20
- (but not the element) upon closing the modal.
21
-
22
- This may strike you as really uncomfortable as you read it, so I wanted to note
23
- that a) this was discussed and agreed upon, and b) it's definitely odd, and if
24
- you find an elegant solution around this, you should definitely feel free to
25
- refactor it.
26
- */
27
- export function previewFunction(_x) {
28
- return _previewFunction.apply(this, arguments);
29
- }
9
+ import { openEmbedModal } from '../../EmbedModal/utils';
30
10
 
31
11
  /*
32
12
  Most of these are optional as we are being fault-tolerant
33
13
  However src, details, icon, title, and providerName are STRONGLY encouraged
34
14
  */
35
- function _previewFunction() {
36
- _previewFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
37
- var popupMountPointId, _onClose, rest, popupMountPoint, Modal;
38
- return _regeneratorRuntime.wrap(function _callee$(_context) {
39
- while (1) switch (_context.prev = _context.next) {
40
- case 0:
41
- popupMountPointId = _ref.popupMountPointId, _onClose = _ref.onClose, rest = _objectWithoutProperties(_ref, _excluded);
42
- popupMountPoint = document.getElementById(popupMountPointId);
43
- if (!popupMountPoint) {
44
- popupMountPoint = document.createElement('div');
45
- popupMountPoint.id = popupMountPointId;
46
- popupMountPoint.setAttribute('data-testid', 'preview-modal');
47
- document.body.appendChild(popupMountPoint);
48
- }
49
- _context.next = 5;
50
- return import('../../EmbedModal');
51
- case 5:
52
- Modal = _context.sent;
53
- ReactDOM.render( /*#__PURE__*/React.createElement(IntlProvider, {
54
- locale: "en"
55
- }, /*#__PURE__*/React.createElement(Modal.default, _extends({}, rest, {
56
- onClose: function onClose(context) {
57
- if (popupMountPoint) {
58
- _onClose(context);
59
- ReactDOM.unmountComponentAtNode(popupMountPoint);
60
- }
61
- }
62
- }))), popupMountPoint);
63
- case 7:
64
- case "end":
65
- return _context.stop();
66
- }
67
- }, _callee);
68
- }));
69
- return _previewFunction.apply(this, arguments);
70
- }
71
- export default (function (_ref2) {
72
- var details = _ref2.details,
73
- rest = _objectWithoutProperties(_ref2, _excluded2);
15
+
16
+ export default (function (_ref) {
17
+ var details = _ref.details,
18
+ rest = _objectWithoutProperties(_ref, _excluded);
74
19
  return {
75
20
  id: 'preview-content',
76
21
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_improved),
77
22
  promise: function promise() {
78
- return previewFunction(_objectSpread({
79
- popupMountPointId: 'twp-editor-preview-iframe',
23
+ return openEmbedModal(_objectSpread({
80
24
  providerName: 'Preview',
81
25
  showModal: true,
82
- iframeName: 'twp-editor-preview-iframe',
83
26
  onClose: function onClose() {}
84
27
  }, rest));
85
28
  }
@@ -27,11 +27,9 @@ export var Action = function Action(_ref) {
27
27
  setState('loading');
28
28
  promise().then(function () {
29
29
  setState('success');
30
- setTimeout(function () {
31
- return setState('init');
32
- }, spinnerDelay);
33
30
  }).catch(function () {
34
31
  setState('failure');
32
+ }).finally(function () {
35
33
  setTimeout(function () {
36
34
  return setState('init');
37
35
  }, spinnerDelay);
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
11
11
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
12
12
  var PACKAGE_DATA = {
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "26.20.1",
14
+ packageVersion: "26.22.0",
15
15
  componentName: 'linkUrl'
16
16
  };
17
17
  var Link = withLinkClickedEvent('a');
@@ -93,7 +93,7 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
93
93
  * @param invokeType Whether the action invoked made a call to a server.
94
94
  * @returns
95
95
  */
96
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
96
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
97
97
  /**
98
98
  * This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
99
99
  * https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
@@ -181,7 +181,7 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
181
181
  * @param actionType The type of action invoked, e.g. PreviewAction
182
182
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
183
183
  */
184
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => void;
184
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => void;
185
185
  /**
186
186
  * This fires an event that represents an action being unsuccessfully invoked.
187
187
  * @param id The unique ID for this Smart Link.
@@ -190,7 +190,7 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
190
190
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
191
191
  * @param reason The reason the invocation failed.
192
192
  */
193
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => void;
193
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => void;
194
194
  /**
195
195
  * This fires an event that represents an account successfully being connected via a Smart Link.
196
196
  * @param id The unique ID for this Smart Link.
@@ -21,7 +21,7 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
21
21
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
22
22
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../utils/analytics/types").UiIframeDwelledEventProps) => void;
23
23
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../utils/analytics/types").UiIframeFocusedEventProps) => void;
24
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
24
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
25
25
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
26
26
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
27
27
  modalClosedEvent: (data: Partial<import("../..").AnalyticsPayload> & {
@@ -37,8 +37,8 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
37
37
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
38
38
  };
39
39
  operational: {
40
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
41
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
40
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
41
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
42
42
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
43
43
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
44
44
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
@@ -80,7 +80,7 @@ export declare const useFlexibleUiAnalyticsContext: () => {
80
80
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
81
81
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../utils/analytics/types").UiIframeDwelledEventProps) => void;
82
82
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../utils/analytics/types").UiIframeFocusedEventProps) => void;
83
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
83
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
84
84
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
85
85
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
86
86
  modalClosedEvent: (data: Partial<import("../..").AnalyticsPayload> & {
@@ -96,8 +96,8 @@ export declare const useFlexibleUiAnalyticsContext: () => {
96
96
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
97
97
  };
98
98
  operational: {
99
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
100
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
99
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
100
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
101
101
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
102
102
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
103
103
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
@@ -0,0 +1,6 @@
1
+ import type { InvokeClientActionProps, UseInvokeClientActionProps } from './types';
2
+ /**
3
+ * Invoke client action such as preview, download and open link
4
+ */
5
+ declare const useInvokeClientAction: ({ analytics }: UseInvokeClientActionProps) => ({ actionType, actionFn, extensionKey, display, }: InvokeClientActionProps) => Promise<void>;
6
+ export default useInvokeClientAction;
@@ -0,0 +1,30 @@
1
+ import type { AnalyticsFacade } from '../../analytics';
2
+ import type { CardInnerAppearance } from '../../../view/Card/types';
3
+ export type UseInvokeClientActionProps = {
4
+ /**
5
+ * Analytics object
6
+ */
7
+ analytics?: AnalyticsFacade;
8
+ };
9
+ export type InvokeClientActionProps = {
10
+ /**
11
+ * Invoke action to execute.
12
+ */
13
+ actionFn: () => Promise<void>;
14
+ /**
15
+ * Invoke action type for analytics purposes.
16
+ */
17
+ actionType: string;
18
+ /**
19
+ * Smart card display type
20
+ * This value should already be set in analytics context.
21
+ * However, we still need to set this value for ufo experience.
22
+ */
23
+ display?: CardInnerAppearance;
24
+ /**
25
+ * Link provider extension key
26
+ * This value should have already been set in analytics object through
27
+ * useSmartLinkAnalytics() and/or into the analytic context.
28
+ */
29
+ extensionKey?: string;
30
+ };
@@ -24,7 +24,7 @@ dispatchAnalytics?: AnalyticsHandler): {
24
24
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
25
25
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../utils/analytics/types").UiIframeDwelledEventProps) => void;
26
26
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../utils/analytics/types").UiIframeFocusedEventProps) => void;
27
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
27
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
28
28
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
29
29
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
30
30
  modalClosedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
@@ -40,8 +40,8 @@ dispatchAnalytics?: AnalyticsHandler): {
40
40
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
41
41
  };
42
42
  operational: {
43
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
44
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
43
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
44
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
45
45
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
46
46
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
47
47
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
@@ -27,12 +27,12 @@ export type UnresolvedEventProps = CommonEventProps & {
27
27
  export type InvokeSucceededEventProps = CommonEventProps & {
28
28
  id: string;
29
29
  actionType: string;
30
- display: CardInnerAppearance;
30
+ display?: CardInnerAppearance;
31
31
  };
32
32
  export type InvokeFailedEventProps = CommonEventProps & {
33
33
  id: string;
34
34
  actionType: string;
35
- display: CardInnerAppearance;
35
+ display?: CardInnerAppearance;
36
36
  reason: string;
37
37
  };
38
38
  export type ConnectSucceededEventProps = CommonEventProps & {
@@ -70,7 +70,7 @@ export type UiIframeFocusedEventProps = CommonEventProps & {
70
70
  };
71
71
  export type UiActionClickedEventProps = CommonEventProps & {
72
72
  id: string;
73
- display: CardInnerAppearance;
73
+ display?: CardInnerAppearance;
74
74
  actionType: string;
75
75
  invokeType?: InvokeType;
76
76
  };
@@ -49,7 +49,7 @@ export declare const mockAnalytics: {
49
49
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("./analytics/types").UiCardClickedEventProps) => void;
50
50
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("./analytics/types").UiIframeDwelledEventProps) => void;
51
51
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("./analytics/types").UiIframeFocusedEventProps) => void;
52
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiActionClickedEventProps) => void;
52
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiActionClickedEventProps) => void;
53
53
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("./analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
54
54
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiClosedAuthEventProps) => void;
55
55
  modalClosedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
@@ -65,8 +65,8 @@ export declare const mockAnalytics: {
65
65
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
66
66
  };
67
67
  operational: {
68
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
69
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeFailedEventProps) => void;
68
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
69
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeFailedEventProps) => void;
70
70
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectSucceededEventProps) => void;
71
71
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectFailedEventProps) => void;
72
72
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("./analytics/types").InstrumentEventProps) => void;
@@ -1,14 +1,9 @@
1
1
  import React, { ErrorInfo } from 'react';
2
2
  import { AnalyticsFacade } from '../../../state/analytics';
3
- import { EmbedModalProps } from '../../EmbedModal/types';
4
3
  import { ActionProps } from '../components/Action';
5
4
  import { IconProps } from '../../common/Icon';
6
5
  import { MetadataProps } from '../../common/Metadata';
7
6
  import { AnalyticsOrigin } from '../../../utils/types';
8
- export interface PreviewFunctionArg extends EmbedModalProps {
9
- popupMountPointId: string;
10
- }
11
- export declare function previewFunction({ popupMountPointId, onClose, ...rest }: PreviewFunctionArg): Promise<void>;
12
7
  type PreviewInfo = {
13
8
  src?: string;
14
9
  testId?: string;
@@ -28,7 +28,7 @@ export declare const openEmbedModalWithFlexibleUiIcon: ({ analytics, downloadUrl
28
28
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../../utils/analytics/types").UiCardClickedEventProps) => void;
29
29
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../../utils/analytics/types").UiIframeDwelledEventProps) => void;
30
30
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../../utils/analytics/types").UiIframeFocusedEventProps) => void;
31
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiActionClickedEventProps) => void;
31
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiActionClickedEventProps) => void;
32
32
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
33
33
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiClosedAuthEventProps) => void;
34
34
  modalClosedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
@@ -44,8 +44,8 @@ export declare const openEmbedModalWithFlexibleUiIcon: ({ analytics, downloadUrl
44
44
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
45
45
  };
46
46
  operational: {
47
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeSucceededEventProps) => void;
48
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeFailedEventProps) => void;
47
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeSucceededEventProps) => void;
48
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeFailedEventProps) => void;
49
49
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectSucceededEventProps) => void;
50
50
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectFailedEventProps) => void;
51
51
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../../utils/analytics/types").InstrumentEventProps) => void;
@@ -93,7 +93,7 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
93
93
  * @param invokeType Whether the action invoked made a call to a server.
94
94
  * @returns
95
95
  */
96
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
96
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: UiActionClickedEventProps) => void;
97
97
  /**
98
98
  * This fires an event that represents when a user clicks on a hover preview's "navigate to link" button.
99
99
  * https://product-fabric.atlassian.net/wiki/spaces/EM/pages/3206743323/Analytics+Metrics+-+Hover+Previews
@@ -181,7 +181,7 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
181
181
  * @param actionType The type of action invoked, e.g. PreviewAction
182
182
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
183
183
  */
184
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => void;
184
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeSucceededEventProps) => void;
185
185
  /**
186
186
  * This fires an event that represents an action being unsuccessfully invoked.
187
187
  * @param id The unique ID for this Smart Link.
@@ -190,7 +190,7 @@ export declare const useSmartLinkAnalytics: (url: string, _dispatchAnalytics?: A
190
190
  * @param display Whether the card was an Inline, Block, Embed or Flexible UI.
191
191
  * @param reason The reason the invocation failed.
192
192
  */
193
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => void;
193
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: InvokeFailedEventProps) => void;
194
194
  /**
195
195
  * This fires an event that represents an account successfully being connected via a Smart Link.
196
196
  * @param id The unique ID for this Smart Link.
@@ -21,7 +21,7 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
21
21
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
22
22
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../utils/analytics/types").UiIframeDwelledEventProps) => void;
23
23
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../utils/analytics/types").UiIframeFocusedEventProps) => void;
24
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
24
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
25
25
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
26
26
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
27
27
  modalClosedEvent: (data: Partial<import("../..").AnalyticsPayload> & {
@@ -37,8 +37,8 @@ export declare const FlexibleUiAnalyticsContext: import("react").Context<{
37
37
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
38
38
  };
39
39
  operational: {
40
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
41
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
40
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
41
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
42
42
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
43
43
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
44
44
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
@@ -80,7 +80,7 @@ export declare const useFlexibleUiAnalyticsContext: () => {
80
80
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
81
81
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../utils/analytics/types").UiIframeDwelledEventProps) => void;
82
82
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../utils/analytics/types").UiIframeFocusedEventProps) => void;
83
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
83
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
84
84
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
85
85
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
86
86
  modalClosedEvent: (data: Partial<import("../..").AnalyticsPayload> & {
@@ -96,8 +96,8 @@ export declare const useFlexibleUiAnalyticsContext: () => {
96
96
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
97
97
  };
98
98
  operational: {
99
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
100
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
99
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
100
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
101
101
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
102
102
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
103
103
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
@@ -0,0 +1,6 @@
1
+ import type { InvokeClientActionProps, UseInvokeClientActionProps } from './types';
2
+ /**
3
+ * Invoke client action such as preview, download and open link
4
+ */
5
+ declare const useInvokeClientAction: ({ analytics }: UseInvokeClientActionProps) => ({ actionType, actionFn, extensionKey, display, }: InvokeClientActionProps) => Promise<void>;
6
+ export default useInvokeClientAction;
@@ -0,0 +1,30 @@
1
+ import type { AnalyticsFacade } from '../../analytics';
2
+ import type { CardInnerAppearance } from '../../../view/Card/types';
3
+ export type UseInvokeClientActionProps = {
4
+ /**
5
+ * Analytics object
6
+ */
7
+ analytics?: AnalyticsFacade;
8
+ };
9
+ export type InvokeClientActionProps = {
10
+ /**
11
+ * Invoke action to execute.
12
+ */
13
+ actionFn: () => Promise<void>;
14
+ /**
15
+ * Invoke action type for analytics purposes.
16
+ */
17
+ actionType: string;
18
+ /**
19
+ * Smart card display type
20
+ * This value should already be set in analytics context.
21
+ * However, we still need to set this value for ufo experience.
22
+ */
23
+ display?: CardInnerAppearance;
24
+ /**
25
+ * Link provider extension key
26
+ * This value should have already been set in analytics object through
27
+ * useSmartLinkAnalytics() and/or into the analytic context.
28
+ */
29
+ extensionKey?: string;
30
+ };
@@ -24,7 +24,7 @@ dispatchAnalytics?: AnalyticsHandler): {
24
24
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../utils/analytics/types").UiCardClickedEventProps) => void;
25
25
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../utils/analytics/types").UiIframeDwelledEventProps) => void;
26
26
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../utils/analytics/types").UiIframeFocusedEventProps) => void;
27
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
27
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiActionClickedEventProps) => void;
28
28
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
29
29
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").UiClosedAuthEventProps) => void;
30
30
  modalClosedEvent: (data: Partial<import("../../utils/types").AnalyticsPayload> & {
@@ -40,8 +40,8 @@ dispatchAnalytics?: AnalyticsHandler): {
40
40
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
41
41
  };
42
42
  operational: {
43
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
44
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
43
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeSucceededEventProps) => void;
44
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").InvokeFailedEventProps) => void;
45
45
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectSucceededEventProps) => void;
46
46
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../utils/analytics/types").ConnectFailedEventProps) => void;
47
47
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../utils/analytics/types").InstrumentEventProps) => void;
@@ -27,12 +27,12 @@ export type UnresolvedEventProps = CommonEventProps & {
27
27
  export type InvokeSucceededEventProps = CommonEventProps & {
28
28
  id: string;
29
29
  actionType: string;
30
- display: CardInnerAppearance;
30
+ display?: CardInnerAppearance;
31
31
  };
32
32
  export type InvokeFailedEventProps = CommonEventProps & {
33
33
  id: string;
34
34
  actionType: string;
35
- display: CardInnerAppearance;
35
+ display?: CardInnerAppearance;
36
36
  reason: string;
37
37
  };
38
38
  export type ConnectSucceededEventProps = CommonEventProps & {
@@ -70,7 +70,7 @@ export type UiIframeFocusedEventProps = CommonEventProps & {
70
70
  };
71
71
  export type UiActionClickedEventProps = CommonEventProps & {
72
72
  id: string;
73
- display: CardInnerAppearance;
73
+ display?: CardInnerAppearance;
74
74
  actionType: string;
75
75
  invokeType?: InvokeType;
76
76
  };
@@ -49,7 +49,7 @@ export declare const mockAnalytics: {
49
49
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("./analytics/types").UiCardClickedEventProps) => void;
50
50
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("./analytics/types").UiIframeDwelledEventProps) => void;
51
51
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("./analytics/types").UiIframeFocusedEventProps) => void;
52
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiActionClickedEventProps) => void;
52
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiActionClickedEventProps) => void;
53
53
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("./analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
54
54
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").UiClosedAuthEventProps) => void;
55
55
  modalClosedEvent: (data: Partial<import("./types").AnalyticsPayload> & {
@@ -65,8 +65,8 @@ export declare const mockAnalytics: {
65
65
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
66
66
  };
67
67
  operational: {
68
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
69
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeFailedEventProps) => void;
68
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeSucceededEventProps) => void;
69
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").InvokeFailedEventProps) => void;
70
70
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectSucceededEventProps) => void;
71
71
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("./analytics/types").ConnectFailedEventProps) => void;
72
72
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("./analytics/types").InstrumentEventProps) => void;
@@ -1,14 +1,9 @@
1
1
  import React, { ErrorInfo } from 'react';
2
2
  import { AnalyticsFacade } from '../../../state/analytics';
3
- import { EmbedModalProps } from '../../EmbedModal/types';
4
3
  import { ActionProps } from '../components/Action';
5
4
  import { IconProps } from '../../common/Icon';
6
5
  import { MetadataProps } from '../../common/Metadata';
7
6
  import { AnalyticsOrigin } from '../../../utils/types';
8
- export interface PreviewFunctionArg extends EmbedModalProps {
9
- popupMountPointId: string;
10
- }
11
- export declare function previewFunction({ popupMountPointId, onClose, ...rest }: PreviewFunctionArg): Promise<void>;
12
7
  type PreviewInfo = {
13
8
  src?: string;
14
9
  testId?: string;
@@ -28,7 +28,7 @@ export declare const openEmbedModalWithFlexibleUiIcon: ({ analytics, downloadUrl
28
28
  cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../../utils/analytics/types").UiCardClickedEventProps) => void;
29
29
  iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../../utils/analytics/types").UiIframeDwelledEventProps) => void;
30
30
  iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../../utils/analytics/types").UiIframeFocusedEventProps) => void;
31
- actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiActionClickedEventProps) => void;
31
+ actionClickedEvent: ({ id: experienceId, actionType, display, invokeType, extensionKey: overrideExtensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiActionClickedEventProps) => void;
32
32
  hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
33
33
  closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiClosedAuthEventProps) => void;
34
34
  modalClosedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
@@ -44,8 +44,8 @@ export declare const openEmbedModalWithFlexibleUiIcon: ({ analytics, downloadUrl
44
44
  smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
45
45
  };
46
46
  operational: {
47
- invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeSucceededEventProps) => void;
48
- invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeFailedEventProps) => void;
47
+ invokeSucceededEvent: ({ id: experienceId, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeSucceededEventProps) => void;
48
+ invokeFailedEvent: ({ id: experienceId, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeFailedEventProps) => void;
49
49
  connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectSucceededEventProps) => void;
50
50
  connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectFailedEventProps) => void;
51
51
  instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../../utils/analytics/types").InstrumentEventProps) => void;