@atlaskit/smart-card 42.0.4 → 42.1.1

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 (30) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/analytics.spec.yaml +17 -0
  3. package/dist/cjs/common/analytics/generated/create-event-payload.js +1 -1
  4. package/dist/cjs/common/analytics/generated/use-analytics-events.js +1 -1
  5. package/dist/cjs/extractors/action/extract-invoke-preview-action.js +25 -5
  6. package/dist/cjs/hooks/useConfluencePageData.js +5 -2
  7. package/dist/cjs/utils/analytics/analytics.js +1 -1
  8. package/dist/cjs/view/EmbedCard/components/IFrame.js +11 -3
  9. package/dist/cjs/view/LinkUrl/index.js +1 -1
  10. package/dist/es2019/common/analytics/generated/create-event-payload.js +1 -1
  11. package/dist/es2019/common/analytics/generated/use-analytics-events.js +1 -1
  12. package/dist/es2019/extractors/action/extract-invoke-preview-action.js +20 -0
  13. package/dist/es2019/hooks/useConfluencePageData.js +5 -2
  14. package/dist/es2019/utils/analytics/analytics.js +1 -1
  15. package/dist/es2019/view/EmbedCard/components/IFrame.js +11 -3
  16. package/dist/es2019/view/LinkUrl/index.js +1 -1
  17. package/dist/esm/common/analytics/generated/create-event-payload.js +1 -1
  18. package/dist/esm/common/analytics/generated/use-analytics-events.js +1 -1
  19. package/dist/esm/extractors/action/extract-invoke-preview-action.js +25 -5
  20. package/dist/esm/hooks/useConfluencePageData.js +5 -2
  21. package/dist/esm/utils/analytics/analytics.js +1 -1
  22. package/dist/esm/view/EmbedCard/components/IFrame.js +11 -3
  23. package/dist/esm/view/LinkUrl/index.js +1 -1
  24. package/dist/types/common/analytics/generated/analytics.types.d.ts +9 -1
  25. package/dist/types/common/analytics/generated/create-event-payload.d.ts +1 -1
  26. package/dist/types/hooks/useConfluencePageData.d.ts +4 -2
  27. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +9 -1
  28. package/dist/types-ts4.5/common/analytics/generated/create-event-payload.d.ts +1 -1
  29. package/dist/types-ts4.5/hooks/useConfluencePageData.d.ts +4 -2
  30. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 42.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 42.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`3f8d5676ea34c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3f8d5676ea34c) -
14
+ Maintain parity between Page and smart-card by passing relevant refs/callbacks
15
+
16
+ ### Patch Changes
17
+
18
+ - [`a4a837dc45834`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a4a837dc45834) -
19
+ Adds an analytic event to the hover card preview action as part of the preview panel experiment
20
+
3
21
  ## 42.0.4
4
22
 
5
23
  ### Patch Changes
@@ -558,6 +558,23 @@ events:
558
558
  required: false
559
559
  type: boolean
560
560
  description: Whether a modifier key was pressed when clicking the Smart Link.
561
+ - smartLink clicked (previewHoverCard):
562
+ type: ui
563
+ description: fires an event that represents when a user clicks on a Smart Link to open a preview panel.
564
+ attributes:
565
+ <<: [*PackageMetaDataContext, *CommonContext, *ResolvedContext]
566
+ id:
567
+ required: true
568
+ type: string
569
+ description: The unique ID for this Smart Link.
570
+ display:
571
+ required: true
572
+ type: ['inline', 'block', 'embed', 'embedPreview', 'flexible', 'hoverCardPreview']
573
+ description: Whether the card was an Inline, Block, Embed or Flexible UI
574
+ previewType:
575
+ required: true
576
+ type: ['modal', 'panel']
577
+ description: What format the preview is in.
561
578
  - hoverCard viewed:
562
579
  type: ui
563
580
  description: fires an event that represents a hover preview being opened.
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  *
12
12
  * Generates Typescript types for analytics events from analytics.spec.yaml
13
13
  *
14
- * @codegen <<SignedSource::eb8cd1263459fb798341024dc0c461ea>>
14
+ * @codegen <<SignedSource::f914fb83fac56e7154ef460866628f7d>>
15
15
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
16
16
  */
17
17
 
@@ -14,7 +14,7 @@ var _createEventPayload = _interopRequireDefault(require("./create-event-payload
14
14
  *
15
15
  * Generates Typescript types for analytics events from analytics.spec.yaml
16
16
  *
17
- * @codegen <<SignedSource::1f3587129789e7883af37adad3817cd2>>
17
+ * @codegen <<SignedSource::676f76a2e45920437adc8c35a9af8b37>>
18
18
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
19
19
  */
20
20
 
@@ -47,6 +47,19 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
47
47
  if (!(0, _canShowAction.canShowAction)(_index.CardAction.PreviewAction, actionOptions)) {
48
48
  return;
49
49
  }
50
+
51
+ /* Analytics UI event for preview action created to support tracking of preview actions as the experiment rolls out */
52
+ var firePreviewActionUIEvent = function firePreviewActionUIEvent(_ref) {
53
+ var previewType = _ref.previewType;
54
+ if (!(0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') || origin !== 'smartLinkPreviewHoverCard' || !fireEvent) {
55
+ return;
56
+ }
57
+ fireEvent('ui.smartLink.clicked.previewHoverCard', {
58
+ id: id || '',
59
+ display: 'hoverCardPreview',
60
+ previewType: previewType
61
+ });
62
+ };
50
63
  var src = (_extractPreviewData = (0, _linkExtractors.extractPreview)(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
51
64
  if (src) {
52
65
  var extensionKey = (0, _helpers.getExtensionKey)(response);
@@ -59,7 +72,7 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
59
72
  while (1) switch (_context.prev = _context.next) {
60
73
  case 0:
61
74
  if (!hasPreviewPanel) {
62
- _context.next = 6;
75
+ _context.next = 7;
63
76
  break;
64
77
  }
65
78
  resolvedUrl = url;
@@ -73,10 +86,13 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
73
86
  name: name,
74
87
  iconUrl: undefined
75
88
  });
76
- _context.next = 8;
89
+ (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') && firePreviewActionUIEvent({
90
+ previewType: 'panel'
91
+ });
92
+ _context.next = 10;
77
93
  break;
78
- case 6:
79
- _context.next = 8;
94
+ case 7:
95
+ _context.next = 9;
80
96
  return (0, _utils.openEmbedModal)(_objectSpread({
81
97
  fireEvent: fireEvent,
82
98
  extensionKey: extensionKey,
@@ -96,7 +112,11 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
96
112
  }, (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') && {
97
113
  isInPreviewPanel: isInPreviewPanel
98
114
  }));
99
- case 8:
115
+ case 9:
116
+ (0, _expValEquals.expValEquals)('platform_hover_card_preview_panel', 'cohort', 'test') && firePreviewActionUIEvent({
117
+ previewType: 'modal'
118
+ });
119
+ case 10:
100
120
  case "end":
101
121
  return _context.stop();
102
122
  }
@@ -73,13 +73,16 @@ var useConfluencePageData = exports.useConfluencePageData = function useConfluen
73
73
  colorMode: themeMode
74
74
  };
75
75
  }
76
+ var calculatedUserInfo = userId && userIdType ? {
77
+ userId: userId,
78
+ userIdType: userIdType
79
+ } : undefined;
76
80
  return {
77
81
  hostname: hostname,
78
82
  spaceKey: spaceKey,
79
83
  contentId: contentId,
80
84
  parentProduct: parentProduct,
81
- userId: userId,
82
- userIdType: userIdType,
85
+ userInfo: calculatedUserInfo,
83
86
  hash: hash || '',
84
87
  enableInlineComments: enableInlineComments,
85
88
  enablePageComments: enablePageComments,
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "0.0.0-development"
14
+ packageVersion: "42.1.0"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -20,9 +20,9 @@ var IFrame = exports.IFrame = function IFrame(_ref) {
20
20
  className = _ref.className,
21
21
  extensionKey = _ref.extensionKey,
22
22
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
23
- var confluencePageData = (0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed')
23
+ var confluencePageData = (0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed') ?
24
24
  // eslint-disable-next-line react-hooks/rules-of-hooks
25
- ? (0, _useConfluencePageData.useConfluencePageData)(props.src || '', extensionKey || '') : undefined;
25
+ (0, _useConfluencePageData.useConfluencePageData)(props.src || '', extensionKey || '') : undefined;
26
26
 
27
27
  // Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
28
28
  return confluencePageData && (0, _platformFeatureFlags.fg)('platform_deprecate_lp_cc_embed') ? /*#__PURE__*/_react.default.createElement(_embeddedConfluence.Page, {
@@ -32,7 +32,15 @@ var IFrame = exports.IFrame = function IFrame(_ref) {
32
32
  parentProduct: confluencePageData.parentProduct,
33
33
  hash: confluencePageData.hash,
34
34
  mode: confluencePageData.mode,
35
- locale: confluencePageData.locale
35
+ locale: confluencePageData.locale,
36
+ iframeRef: childRef,
37
+ onLoad: props.onLoad,
38
+ onMouseEnter: props.onMouseEnter,
39
+ onMouseLeave: props.onMouseLeave,
40
+ sandbox: props.sandbox,
41
+ allowedFeatures: confluencePageData.allowedFeatures,
42
+ themeState: confluencePageData.themeStateObject,
43
+ userInfo: confluencePageData.userInfo
36
44
  }) :
37
45
  /*#__PURE__*/
38
46
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -25,7 +25,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
25
25
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
26
26
  var PACKAGE_DATA = {
27
27
  packageName: "@atlaskit/smart-card",
28
- packageVersion: "0.0.0-development",
28
+ packageVersion: "42.1.0",
29
29
  componentName: 'linkUrl'
30
30
  };
31
31
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::eb8cd1263459fb798341024dc0c461ea>>
6
+ * @codegen <<SignedSource::f914fb83fac56e7154ef460866628f7d>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
 
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::1f3587129789e7883af37adad3817cd2>>
6
+ * @codegen <<SignedSource::676f76a2e45920437adc8c35a9af8b37>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  import { useCallback } from 'react';
@@ -37,6 +37,20 @@ export const extractInvokePreviewAction = param => {
37
37
  if (!canShowAction(CardAction.PreviewAction, actionOptions)) {
38
38
  return;
39
39
  }
40
+
41
+ /* Analytics UI event for preview action created to support tracking of preview actions as the experiment rolls out */
42
+ const firePreviewActionUIEvent = ({
43
+ previewType
44
+ }) => {
45
+ if (!expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') || origin !== 'smartLinkPreviewHoverCard' || !fireEvent) {
46
+ return;
47
+ }
48
+ fireEvent('ui.smartLink.clicked.previewHoverCard', {
49
+ id: id || '',
50
+ display: 'hoverCardPreview',
51
+ previewType
52
+ });
53
+ };
40
54
  const src = (_extractPreviewData = extractPreviewData(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
41
55
  if (src) {
42
56
  const extensionKey = getExtensionKey(response);
@@ -55,6 +69,9 @@ export const extractInvokePreviewAction = param => {
55
69
  name: name,
56
70
  iconUrl: undefined
57
71
  });
72
+ expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && firePreviewActionUIEvent({
73
+ previewType: 'panel'
74
+ });
58
75
  } else {
59
76
  var _extractSmartLinkProv, _extractSmartLinkEmbe, _actionOptions$previe;
60
77
  await openEmbedModal({
@@ -77,6 +94,9 @@ export const extractInvokePreviewAction = param => {
77
94
  isInPreviewPanel
78
95
  })
79
96
  });
97
+ expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && firePreviewActionUIEvent({
98
+ previewType: 'modal'
99
+ });
80
100
  }
81
101
  },
82
102
  actionSubjectId: 'invokePreviewScreen',
@@ -66,13 +66,16 @@ export const useConfluencePageData = (url, extensionKey) => {
66
66
  colorMode: themeMode
67
67
  };
68
68
  }
69
+ const calculatedUserInfo = userId && userIdType ? {
70
+ userId,
71
+ userIdType
72
+ } : undefined;
69
73
  return {
70
74
  hostname,
71
75
  spaceKey,
72
76
  contentId,
73
77
  parentProduct,
74
- userId,
75
- userIdType,
78
+ userInfo: calculatedUserInfo,
76
79
  hash: hash || '',
77
80
  enableInlineComments,
78
81
  enablePageComments,
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "0.0.0-development"
5
+ packageVersion: "42.1.0"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -12,9 +12,9 @@ export const IFrame = ({
12
12
  extensionKey,
13
13
  ...props
14
14
  }) => {
15
- const confluencePageData = fg('platform_deprecate_lp_cc_embed')
15
+ const confluencePageData = fg('platform_deprecate_lp_cc_embed') ?
16
16
  // eslint-disable-next-line react-hooks/rules-of-hooks
17
- ? useConfluencePageData(props.src || '', extensionKey || '') : undefined;
17
+ useConfluencePageData(props.src || '', extensionKey || '') : undefined;
18
18
 
19
19
  // Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
20
20
  return confluencePageData && fg('platform_deprecate_lp_cc_embed') ? /*#__PURE__*/React.createElement(Page, {
@@ -24,7 +24,15 @@ export const IFrame = ({
24
24
  parentProduct: confluencePageData.parentProduct,
25
25
  hash: confluencePageData.hash,
26
26
  mode: confluencePageData.mode,
27
- locale: confluencePageData.locale
27
+ locale: confluencePageData.locale,
28
+ iframeRef: childRef,
29
+ onLoad: props.onLoad,
30
+ onMouseEnter: props.onMouseEnter,
31
+ onMouseLeave: props.onMouseLeave,
32
+ sandbox: props.sandbox,
33
+ allowedFeatures: confluencePageData.allowedFeatures,
34
+ themeState: confluencePageData.themeStateObject,
35
+ userInfo: confluencePageData.userInfo
28
36
  }) :
29
37
  /*#__PURE__*/
30
38
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
13
13
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
14
14
  const PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/smart-card",
16
- packageVersion: "0.0.0-development",
16
+ packageVersion: "42.1.0",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  const Anchor = withLinkClickedEvent('a');
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  *
5
5
  * Generates Typescript types for analytics events from analytics.spec.yaml
6
6
  *
7
- * @codegen <<SignedSource::eb8cd1263459fb798341024dc0c461ea>>
7
+ * @codegen <<SignedSource::f914fb83fac56e7154ef460866628f7d>>
8
8
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
9
9
  */
10
10
 
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::1f3587129789e7883af37adad3817cd2>>
6
+ * @codegen <<SignedSource::676f76a2e45920437adc8c35a9af8b37>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  import { useCallback } from 'react';
@@ -40,6 +40,19 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
40
40
  if (!canShowAction(CardAction.PreviewAction, actionOptions)) {
41
41
  return;
42
42
  }
43
+
44
+ /* Analytics UI event for preview action created to support tracking of preview actions as the experiment rolls out */
45
+ var firePreviewActionUIEvent = function firePreviewActionUIEvent(_ref) {
46
+ var previewType = _ref.previewType;
47
+ if (!expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') || origin !== 'smartLinkPreviewHoverCard' || !fireEvent) {
48
+ return;
49
+ }
50
+ fireEvent('ui.smartLink.clicked.previewHoverCard', {
51
+ id: id || '',
52
+ display: 'hoverCardPreview',
53
+ previewType: previewType
54
+ });
55
+ };
43
56
  var src = (_extractPreviewData = extractPreviewData(data, 'web')) === null || _extractPreviewData === void 0 ? void 0 : _extractPreviewData.src;
44
57
  if (src) {
45
58
  var extensionKey = getExtensionKey(response);
@@ -52,7 +65,7 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
52
65
  while (1) switch (_context.prev = _context.next) {
53
66
  case 0:
54
67
  if (!hasPreviewPanel) {
55
- _context.next = 6;
68
+ _context.next = 7;
56
69
  break;
57
70
  }
58
71
  resolvedUrl = url;
@@ -66,10 +79,13 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
66
79
  name: name,
67
80
  iconUrl: undefined
68
81
  });
69
- _context.next = 8;
82
+ expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && firePreviewActionUIEvent({
83
+ previewType: 'panel'
84
+ });
85
+ _context.next = 10;
70
86
  break;
71
- case 6:
72
- _context.next = 8;
87
+ case 7:
88
+ _context.next = 9;
73
89
  return openEmbedModal(_objectSpread({
74
90
  fireEvent: fireEvent,
75
91
  extensionKey: extensionKey,
@@ -89,7 +105,11 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
89
105
  }, expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && {
90
106
  isInPreviewPanel: isInPreviewPanel
91
107
  }));
92
- case 8:
108
+ case 9:
109
+ expValEquals('platform_hover_card_preview_panel', 'cohort', 'test') && firePreviewActionUIEvent({
110
+ previewType: 'modal'
111
+ });
112
+ case 10:
93
113
  case "end":
94
114
  return _context.stop();
95
115
  }
@@ -67,13 +67,16 @@ export var useConfluencePageData = function useConfluencePageData(url, extension
67
67
  colorMode: themeMode
68
68
  };
69
69
  }
70
+ var calculatedUserInfo = userId && userIdType ? {
71
+ userId: userId,
72
+ userIdType: userIdType
73
+ } : undefined;
70
74
  return {
71
75
  hostname: hostname,
72
76
  spaceKey: spaceKey,
73
77
  contentId: contentId,
74
78
  parentProduct: parentProduct,
75
- userId: userId,
76
- userIdType: userIdType,
79
+ userInfo: calculatedUserInfo,
77
80
  hash: hash || '',
78
81
  enableInlineComments: enableInlineComments,
79
82
  enablePageComments: enablePageComments,
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "0.0.0-development"
7
+ packageVersion: "42.1.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -13,9 +13,9 @@ export var IFrame = function IFrame(_ref) {
13
13
  className = _ref.className,
14
14
  extensionKey = _ref.extensionKey,
15
15
  props = _objectWithoutProperties(_ref, _excluded);
16
- var confluencePageData = fg('platform_deprecate_lp_cc_embed')
16
+ var confluencePageData = fg('platform_deprecate_lp_cc_embed') ?
17
17
  // eslint-disable-next-line react-hooks/rules-of-hooks
18
- ? useConfluencePageData(props.src || '', extensionKey || '') : undefined;
18
+ useConfluencePageData(props.src || '', extensionKey || '') : undefined;
19
19
 
20
20
  // Conditional rendering: Page component for lp-cc-embed URLs, iframe for everything else
21
21
  return confluencePageData && fg('platform_deprecate_lp_cc_embed') ? /*#__PURE__*/React.createElement(Page, {
@@ -25,7 +25,15 @@ export var IFrame = function IFrame(_ref) {
25
25
  parentProduct: confluencePageData.parentProduct,
26
26
  hash: confluencePageData.hash,
27
27
  mode: confluencePageData.mode,
28
- locale: confluencePageData.locale
28
+ locale: confluencePageData.locale,
29
+ iframeRef: childRef,
30
+ onLoad: props.onLoad,
31
+ onMouseEnter: props.onMouseEnter,
32
+ onMouseLeave: props.onMouseLeave,
33
+ sandbox: props.sandbox,
34
+ allowedFeatures: confluencePageData.allowedFeatures,
35
+ themeState: confluencePageData.themeStateObject,
36
+ userInfo: confluencePageData.userInfo
29
37
  }) :
30
38
  /*#__PURE__*/
31
39
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -16,7 +16,7 @@ import LinkWarningModal from './LinkWarningModal';
16
16
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
17
17
  var PACKAGE_DATA = {
18
18
  packageName: "@atlaskit/smart-card",
19
- packageVersion: "0.0.0-development",
19
+ packageVersion: "42.1.0",
20
20
  componentName: 'linkUrl'
21
21
  };
22
22
  var Anchor = withLinkClickedEvent('a');
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::8ebf07690deae06cee97fcbba4bb8eb0>>
6
+ * @codegen <<SignedSource::932bd7921a1bd5e7a45d04e6fef57e12>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataContextType = {
@@ -194,6 +194,11 @@ export type HyperlinkUnresolvedAttributesType = {
194
194
  error: Record<string, unknown> | null;
195
195
  reason: string;
196
196
  };
197
+ export type SmartLinkClickedPreviewHoverCardAttributesType = {
198
+ id: string;
199
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
200
+ previewType: 'modal' | 'panel';
201
+ };
197
202
  export type HoverCardViewedAttributesType = {
198
203
  previewDisplay: 'card' | 'embed';
199
204
  previewInvokeMethod: 'keyboard' | 'mouse_hover' | 'mouse_click' | null;
@@ -364,6 +369,9 @@ export type AnalyticsEventAttributes = {
364
369
  /**
365
370
  * fires an event that represents when a user clicks on a Smart Link. */
366
371
  'ui.smartLink.clicked.titleGoToLink': SmartLinkClickedTitleGoToLinkAttributesType;
372
+ /**
373
+ * fires an event that represents when a user clicks on a Smart Link to open a preview panel. */
374
+ 'ui.smartLink.clicked.previewHoverCard': SmartLinkClickedPreviewHoverCardAttributesType;
367
375
  /**
368
376
  * fires an event that represents a hover preview being opened. */
369
377
  'ui.hoverCard.viewed': HoverCardViewedAttributesType;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::eb8cd1263459fb798341024dc0c461ea>>
6
+ * @codegen <<SignedSource::f914fb83fac56e7154ef460866628f7d>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  import type { AnalyticsEventAttributes, EventKey } from './analytics.types';
@@ -24,8 +24,10 @@ export declare const useConfluencePageData: (url: string, extensionKey: string)
24
24
  spaceKey: string;
25
25
  contentId: string;
26
26
  parentProduct: string;
27
- userId: string;
28
- userIdType: userType;
27
+ userInfo: {
28
+ userId: string;
29
+ userIdType: userType;
30
+ } | undefined;
29
31
  hash: string;
30
32
  enableInlineComments: boolean;
31
33
  enablePageComments: boolean;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::8ebf07690deae06cee97fcbba4bb8eb0>>
6
+ * @codegen <<SignedSource::932bd7921a1bd5e7a45d04e6fef57e12>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  export type PackageMetaDataContextType = {
@@ -194,6 +194,11 @@ export type HyperlinkUnresolvedAttributesType = {
194
194
  error: Record<string, unknown> | null;
195
195
  reason: string;
196
196
  };
197
+ export type SmartLinkClickedPreviewHoverCardAttributesType = {
198
+ id: string;
199
+ display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview';
200
+ previewType: 'modal' | 'panel';
201
+ };
197
202
  export type HoverCardViewedAttributesType = {
198
203
  previewDisplay: 'card' | 'embed';
199
204
  previewInvokeMethod: 'keyboard' | 'mouse_hover' | 'mouse_click' | null;
@@ -364,6 +369,9 @@ export type AnalyticsEventAttributes = {
364
369
  /**
365
370
  * fires an event that represents when a user clicks on a Smart Link. */
366
371
  'ui.smartLink.clicked.titleGoToLink': SmartLinkClickedTitleGoToLinkAttributesType;
372
+ /**
373
+ * fires an event that represents when a user clicks on a Smart Link to open a preview panel. */
374
+ 'ui.smartLink.clicked.previewHoverCard': SmartLinkClickedPreviewHoverCardAttributesType;
367
375
  /**
368
376
  * fires an event that represents a hover preview being opened. */
369
377
  'ui.hoverCard.viewed': HoverCardViewedAttributesType;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::eb8cd1263459fb798341024dc0c461ea>>
6
+ * @codegen <<SignedSource::f914fb83fac56e7154ef460866628f7d>>
7
7
  * @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
8
8
  */
9
9
  import type { AnalyticsEventAttributes, EventKey } from './analytics.types';
@@ -24,8 +24,10 @@ export declare const useConfluencePageData: (url: string, extensionKey: string)
24
24
  spaceKey: string;
25
25
  contentId: string;
26
26
  parentProduct: string;
27
- userId: string;
28
- userIdType: userType;
27
+ userInfo: {
28
+ userId: string;
29
+ userIdType: userType;
30
+ } | undefined;
29
31
  hash: string;
30
32
  enableInlineComments: boolean;
31
33
  enablePageComments: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "42.0.4",
3
+ "version": "42.1.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/dropdown-menu": "^16.3.0",
39
39
  "@atlaskit/embedded-confluence": "^4.2.0",
40
40
  "@atlaskit/feature-gate-js-client": "^5.5.0",
41
- "@atlaskit/form": "^13.0.0",
41
+ "@atlaskit/form": "^14.0.0",
42
42
  "@atlaskit/frontend-utilities": "^3.1.0",
43
43
  "@atlaskit/heading": "^5.2.0",
44
44
  "@atlaskit/icon": "^28.2.0",
@@ -70,7 +70,7 @@
70
70
  "@atlaskit/textarea": "^8.0.0",
71
71
  "@atlaskit/textfield": "^8.0.0",
72
72
  "@atlaskit/theme": "^21.0.0",
73
- "@atlaskit/tmp-editor-statsig": "^12.26.0",
73
+ "@atlaskit/tmp-editor-statsig": "^12.28.0",
74
74
  "@atlaskit/tokens": "^6.3.0",
75
75
  "@atlaskit/tooltip": "^20.4.0",
76
76
  "@atlaskit/ufo": "^0.4.0",
@@ -100,7 +100,7 @@
100
100
  "@atlaskit/analytics-listeners": "^9.0.0",
101
101
  "@atlaskit/css-reset": "^7.3.0",
102
102
  "@atlaskit/media-test-helpers": "^39.0.0",
103
- "@atlaskit/react-ufo": "^4.8.0",
103
+ "@atlaskit/react-ufo": "^4.9.0",
104
104
  "@atlaskit/ssr": "workspace:^",
105
105
  "@atlassian/analytics-tooling": "^0.5.0",
106
106
  "@atlassian/feature-flags-test-utils": "^0.3.0",