@atlaskit/smart-card 44.28.1 → 44.28.3

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 (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/utils/click-helpers.js +7 -1
  4. package/dist/cjs/view/CardWithUrl/component.js +7 -16
  5. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +33 -11
  6. package/dist/cjs/view/LinkUrl/index.js +1 -1
  7. package/dist/es2019/state/hooks/use-inline-tailored-action-experiment/index.js +1 -1
  8. package/dist/es2019/utils/analytics/analytics.js +1 -1
  9. package/dist/es2019/utils/click-helpers.js +6 -0
  10. package/dist/es2019/view/CardWithUrl/component.js +5 -14
  11. package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -1
  12. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +29 -9
  13. package/dist/es2019/view/InlineCard/common/rovo-actions-cta/index.js +9 -9
  14. package/dist/es2019/view/LinkUrl/index.js +1 -1
  15. package/dist/es2019/view/common/rovo-chat-utils/index.js +8 -8
  16. package/dist/esm/state/hooks/use-inline-tailored-action-experiment/index.js +1 -1
  17. package/dist/esm/utils/analytics/analytics.js +1 -1
  18. package/dist/esm/utils/click-helpers.js +6 -0
  19. package/dist/esm/view/CardWithUrl/component.js +5 -14
  20. package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +1 -1
  21. package/dist/esm/view/HoverCard/components/HoverCardContent.js +35 -13
  22. package/dist/esm/view/InlineCard/common/rovo-actions-cta/index.js +9 -9
  23. package/dist/esm/view/LinkUrl/index.js +1 -1
  24. package/dist/esm/view/common/rovo-chat-utils/index.js +8 -8
  25. package/dist/types/utils/click-helpers.d.ts +1 -0
  26. package/dist/types/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +1 -1
  27. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +1 -1
  28. package/dist/types/view/InlineCard/common/rovo-actions-cta/index.d.ts +2 -2
  29. package/dist/types/view/common/rovo-chat-utils/index.d.ts +6 -6
  30. package/dist/types-ts4.5/utils/click-helpers.d.ts +1 -0
  31. package/dist/types-ts4.5/view/FlexibleCard/components/actions/rovo-chat-action/index.d.ts +1 -1
  32. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +1 -1
  33. package/dist/types-ts4.5/view/InlineCard/common/rovo-actions-cta/index.d.ts +2 -2
  34. package/dist/types-ts4.5/view/common/rovo-chat-utils/index.d.ts +6 -6
  35. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 44.28.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 44.28.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`85a6df19d005b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/85a6df19d005b) -
14
+ Update anchor href with cross-product analytics params on middle-click and context menu for
15
+ HoverCard.
16
+
3
17
  ## 44.28.1
4
18
 
5
19
  ### Patch Changes
@@ -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: "44.28.0" || ''
14
+ packageVersion: "44.28.2" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isAuxClick = exports.getAnchorAttributesFromEvent = void 0;
6
+ exports.updateAnchorHref = exports.isAuxClick = exports.getAnchorAttributesFromEvent = void 0;
7
7
  /**
8
8
  * Returns true for genuine middle-clicks (button === 1).
9
9
  * Filters out Windows right-clicks, which fire onAuxClick with button === 2
@@ -40,4 +40,10 @@ var getAnchorAttributesFromEvent = exports.getAnchorAttributesFromEvent = functi
40
40
  href: currentTarget.href,
41
41
  target: currentTarget.target || '_self'
42
42
  };
43
+ };
44
+ var updateAnchorHref = exports.updateAnchorHref = function updateAnchorHref(event, href) {
45
+ if (!(event.currentTarget instanceof HTMLAnchorElement)) {
46
+ return;
47
+ }
48
+ event.currentTarget.href = href;
43
49
  };
@@ -114,19 +114,10 @@ function Component(_ref) {
114
114
  var shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && (0, _helpers.getClickUrl)(url, state.details) === url && fire3PClickEvent && (0, _platformFeatureFlags.fg)('platform_smartlink_3pclick_analytics');
115
115
  var getDestinationUrl = (0, _react.useCallback)(function () {
116
116
  var _getClickUrl, _appendCrossProductAn;
117
+ // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
117
118
  var preferredUrl = (_getClickUrl = (0, _helpers.getClickUrl)(url, state.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
118
119
  return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
119
120
  }, [appendCrossProductAnalyticsParams, state.details, url]);
120
- var updateAnchorHref = (0, _react.useCallback)(function (event, destinationUrl) {
121
- if (!(event.currentTarget instanceof HTMLAnchorElement)) {
122
- return;
123
- }
124
-
125
- // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
126
- // href is only defined when currentTarget is an anchor element.
127
- // Update the anchor href so the browser context menu uses the decorated URL.
128
- event.currentTarget.href = destinationUrl;
129
- }, []);
130
121
 
131
122
  // Setup UI handlers.
132
123
  var handleClickWrapper = (0, _react.useCallback)(function (event) {
@@ -178,7 +169,7 @@ function Component(_ref) {
178
169
  return;
179
170
  }
180
171
  var destinationUrl = getDestinationUrl();
181
- updateAnchorHref(event, destinationUrl);
172
+ (0, _clickHelpers.updateAnchorHref)(event, destinationUrl);
182
173
 
183
174
  // For FlexibleCard, read target from the clicked anchor element (e.g. _blank for links
184
175
  // rendered with explicit target). For classic cards, default to _self
@@ -256,7 +247,7 @@ function Component(_ref) {
256
247
  (0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
257
248
  }
258
249
  }
259
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, updateAnchorHref, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
250
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
260
251
 
261
252
  // Exposure fires once per eligible mount; click-time reads use no-exposure variant.
262
253
  (0, _react.useEffect)(function () {
@@ -270,7 +261,7 @@ function Component(_ref) {
270
261
  var handleFrameAuxClick = (0, _react.useCallback)(function (event) {
271
262
  if ((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping')) {
272
263
  var destinationUrl = getDestinationUrl();
273
- updateAnchorHref(event, destinationUrl);
264
+ (0, _clickHelpers.updateAnchorHref)(event, destinationUrl);
274
265
  }
275
266
 
276
267
  // isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
@@ -279,21 +270,21 @@ function Component(_ref) {
279
270
  isAuxClick: true
280
271
  });
281
272
  }
282
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, updateAnchorHref]);
273
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
283
274
 
284
275
  // Right-click handler to trigger fire3PClickEvent on right-clicks.
285
276
  // Scope is limited to 3P click analytics to keep the experiment focused.
286
277
  var handleFrameContextMenu = (0, _react.useCallback)(function (event) {
287
278
  if ((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping')) {
288
279
  var destinationUrl = getDestinationUrl();
289
- updateAnchorHref(event, destinationUrl);
280
+ (0, _clickHelpers.updateAnchorHref)(event, destinationUrl);
290
281
  }
291
282
  if (shouldFire3PClickEvent && (0, _expValEqualsNoExposure.expValEqualsNoExposure)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
292
283
  fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
293
284
  isContextMenu: true
294
285
  });
295
286
  }
296
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, updateAnchorHref]);
287
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
297
288
  var reload = actions.reload;
298
289
  var handleAuthorize = (0, _react.useCallback)(function () {
299
290
  return actions.authorize(appearance);
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.hoverCardClassName = exports.default = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
11
  var _react = _interopRequireWildcard(require("react"));
11
12
  var _analyticsNext = require("@atlaskit/analytics-next");
12
13
  var _linkProvider = require("@atlaskit/link-provider");
@@ -34,6 +35,8 @@ var _resolving = _interopRequireDefault(require("./views/resolving"));
34
35
  var _unauthorised = _interopRequireDefault(require("./views/unauthorised"));
35
36
  var _RovoUnauthorisedView = _interopRequireDefault(require("./views/unauthorised/RovoUnauthorisedView"));
36
37
  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); }
38
+ 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; }
39
+ 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) { (0, _defineProperty2.default)(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; }
37
40
  var hoverCardClassName = exports.hoverCardClassName = 'smart-links-hover-preview';
38
41
  var useIsResolvedView = function useIsResolvedView(_ref) {
39
42
  var _hoverPreviewOptions$;
@@ -137,23 +140,38 @@ var HoverCardContent = function HoverCardContent(_ref4) {
137
140
  });
138
141
  };
139
142
  }, []);
143
+ var getDestinationUrl = (0, _react.useCallback)(function () {
144
+ var _getClickUrl, _appendCrossProductAn;
145
+ // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
146
+ var preferredUrl = (_getClickUrl = (0, _helpers.getClickUrl)(url, linkState.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
147
+ return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
148
+ }, [appendCrossProductAnalyticsParams, linkState.details, url]);
149
+
150
+ // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
151
+ // Scope is limited to 3P click analytics to keep the experiment focused.
152
+ var onAuxClick = (0, _react.useCallback)(function (event) {
153
+ var destinationUrl = getDestinationUrl();
154
+ (0, _clickHelpers.updateAnchorHref)(event, destinationUrl);
155
+ }, [getDestinationUrl]);
156
+
157
+ // Right-click handler to trigger fire3PClickEvent on right-clicks.
158
+ // Scope is limited to 3P click analytics to keep the experiment focused.
159
+ var onContextMenu = (0, _react.useCallback)(function (event) {
160
+ var destinationUrl = getDestinationUrl();
161
+ (0, _clickHelpers.updateAnchorHref)(event, destinationUrl);
162
+ }, [getDestinationUrl]);
140
163
  var onClick = (0, _react.useCallback)(function (event) {
141
164
  if ((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping')) {
142
165
  // Prevent the anchor's native navigation so we can open the destination URL
143
166
  // with cross-product analytics query parameters appended.
144
- // The href is read from the anchor element at click time rather than at render
145
- // time because the URL for the anchor may be different from original URL.
146
- // The component may use the URL from the resolved response which can be a redirect URL
147
- // or other preferred URL based on link extractor.
148
167
  // The cross-product params are client-only and cannot be rendered
149
168
  // server-side. Falls back to the original `url` prop if the event target is
150
169
  // not an anchor element.
151
170
  event.preventDefault();
152
171
  var _getAnchorAttributesF = (0, _clickHelpers.getAnchorAttributesFromEvent)(event),
153
- _getAnchorAttributesF2 = _getAnchorAttributesF.href,
154
- href = _getAnchorAttributesF2 === void 0 ? url : _getAnchorAttributesF2,
155
172
  target = _getAnchorAttributesF.target;
156
- var destinationUrl = appendCrossProductAnalyticsParams(href);
173
+ var destinationUrl = getDestinationUrl();
174
+ (0, _clickHelpers.updateAnchorHref)(event, destinationUrl);
157
175
  window.open(destinationUrl, target);
158
176
  }
159
177
  var isModifierKeyPressed = (0, _utils.isSpecialEvent)(event);
@@ -164,7 +182,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
164
182
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
165
183
  });
166
184
  (0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
167
- }, [createAnalyticsEvent, appendCrossProductAnalyticsParams, id, fireEvent, definitionId, url]);
185
+ }, [createAnalyticsEvent, getDestinationUrl, id, fireEvent, definitionId]);
168
186
  var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
169
187
  var _getMetadata = (0, _utils2.getMetadata)(extensionKey, data),
170
188
  subtitle = _getMetadata.subtitle;
@@ -178,10 +196,14 @@ var HoverCardContent = function HoverCardContent(_ref4) {
178
196
  };
179
197
  var uiOptions = _styled.flexibleUiOptions;
180
198
  uiOptions.enableSnippetRenderer = true;
181
- var flexibleCardProps = {
199
+ var flexibleCardProps = _objectSpread(_objectSpread({
182
200
  appearance: _constants.CardDisplay.HoverCardPreview,
183
201
  cardState: cardState,
184
- onClick: onClick,
202
+ onClick: onClick
203
+ }, (0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping') ? {
204
+ onAuxClick: onAuxClick,
205
+ onContextMenu: onContextMenu
206
+ } : undefined), {}, {
185
207
  onResolve: onResolve,
186
208
  origin: 'smartLinkPreviewHoverCard',
187
209
  renderers: renderers,
@@ -189,7 +211,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
189
211
  ui: uiOptions,
190
212
  url: url,
191
213
  children: null
192
- };
214
+ });
193
215
  var onClickStopPropagation = (0, _react.useCallback)(function (e) {
194
216
  return e.stopPropagation();
195
217
  }, []);
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
19
19
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
20
20
  var PACKAGE_DATA = {
21
21
  packageName: "@atlaskit/smart-card",
22
- packageVersion: "44.28.0",
22
+ packageVersion: "44.28.2",
23
23
  componentName: 'linkUrl'
24
24
  };
25
25
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import { fg } from "@atlaskit/platform-feature-flags";
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
4
  import { getIsRovoChatEnabled } from '../../../utils/rovo';
5
5
  import { getExtensionKey } from '../../helpers';
@@ -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: "44.28.0" || ''
5
+ packageVersion: "44.28.2" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -34,4 +34,10 @@ export const getAnchorAttributesFromEvent = event => {
34
34
  href: currentTarget.href,
35
35
  target: currentTarget.target || '_self'
36
36
  };
37
+ };
38
+ export const updateAnchorHref = (event, href) => {
39
+ if (!(event.currentTarget instanceof HTMLAnchorElement)) {
40
+ return;
41
+ }
42
+ event.currentTarget.href = href;
37
43
  };
@@ -16,7 +16,7 @@ import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
16
16
  import { combineActionOptions } from '../../utils/actions/combine-action-options';
17
17
  import { fireLinkClickedEvent } from '../../utils/analytics/click';
18
18
  import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
19
- import { getAnchorAttributesFromEvent, isAuxClick } from '../../utils/click-helpers';
19
+ import { getAnchorAttributesFromEvent, isAuxClick, updateAnchorHref } from '../../utils/click-helpers';
20
20
  import { isFlexibleUiCard } from '../../utils/flexible';
21
21
  import * as measure from '../../utils/performance';
22
22
  import { BlockCard } from '../BlockCard';
@@ -104,19 +104,10 @@ function Component({
104
104
  const shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && getClickUrl(url, state.details) === url && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics');
105
105
  const getDestinationUrl = useCallback(() => {
106
106
  var _getClickUrl, _appendCrossProductAn;
107
+ // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
107
108
  const preferredUrl = (_getClickUrl = getClickUrl(url, state.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
108
109
  return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
109
110
  }, [appendCrossProductAnalyticsParams, state.details, url]);
110
- const updateAnchorHref = useCallback((event, destinationUrl) => {
111
- if (!(event.currentTarget instanceof HTMLAnchorElement)) {
112
- return;
113
- }
114
-
115
- // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
116
- // href is only defined when currentTarget is an anchor element.
117
- // Update the anchor href so the browser context menu uses the decorated URL.
118
- event.currentTarget.href = destinationUrl;
119
- }, []);
120
111
 
121
112
  // Setup UI handlers.
122
113
  const handleClickWrapper = useCallback(event => {
@@ -247,7 +238,7 @@ function Component({
247
238
  fireLinkClickedEvent(createAnalyticsEvent)(event);
248
239
  }
249
240
  }
250
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, updateAnchorHref, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
241
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
251
242
 
252
243
  // Exposure fires once per eligible mount; click-time reads use no-exposure variant.
253
244
  useEffect(() => {
@@ -270,7 +261,7 @@ function Component({
270
261
  isAuxClick: true
271
262
  });
272
263
  }
273
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, updateAnchorHref]);
264
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
274
265
 
275
266
  // Right-click handler to trigger fire3PClickEvent on right-clicks.
276
267
  // Scope is limited to 3P click analytics to keep the experiment focused.
@@ -284,7 +275,7 @@ function Component({
284
275
  isContextMenu: true
285
276
  });
286
277
  }
287
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, updateAnchorHref]);
278
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
288
279
  const {
289
280
  reload
290
281
  } = actions;
@@ -5,7 +5,7 @@ import { ActionName } from '../../../../../constants';
5
5
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
6
6
  import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
7
7
  import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
8
- import { getPromptAction, RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
8
+ import { getPromptAction, RovoChatPromptKey } from '../../../../common/rovo-chat-utils';
9
9
  import Action from '../action';
10
10
  const GOOGLE_PROMPTS = [RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, RovoChatPromptKey.SHOW_OTHER_MENTIONS, RovoChatPromptKey.SUGGEST_IMPROVEMENT];
11
11
  const DEFAULT_PROMPTS = GOOGLE_PROMPTS;
@@ -9,14 +9,14 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
9
9
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
10
10
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
11
11
  import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
12
- import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
12
+ import { getClickUrl, getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
13
13
  import useRovoConfig from '../../../state/hooks/use-rovo-config';
14
14
  import { useSmartLinkCrossProductUrlWrapperGated } from '../../../state/hooks/use-smart-link-cross-product-url-wrapper';
15
15
  import { useSmartCardState } from '../../../state/store';
16
16
  import { isSpecialEvent } from '../../../utils';
17
17
  import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
18
18
  import { fireLinkClickedEvent } from '../../../utils/analytics/click';
19
- import { getAnchorAttributesFromEvent } from '../../../utils/click-helpers';
19
+ import { getAnchorAttributesFromEvent, updateAnchorHref } from '../../../utils/click-helpers';
20
20
  import { flexibleUiOptions } from '../styled';
21
21
  import { getMetadata } from '../utils';
22
22
  import ContentContainer from './ContentContainer';
@@ -131,23 +131,39 @@ const HoverCardContent = ({
131
131
  });
132
132
  };
133
133
  }, []);
134
+ const getDestinationUrl = useCallback(() => {
135
+ var _getClickUrl, _appendCrossProductAn;
136
+ // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
137
+ const preferredUrl = (_getClickUrl = getClickUrl(url, linkState.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
138
+ return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
139
+ }, [appendCrossProductAnalyticsParams, linkState.details, url]);
140
+
141
+ // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
142
+ // Scope is limited to 3P click analytics to keep the experiment focused.
143
+ const onAuxClick = useCallback(event => {
144
+ const destinationUrl = getDestinationUrl();
145
+ updateAnchorHref(event, destinationUrl);
146
+ }, [getDestinationUrl]);
147
+
148
+ // Right-click handler to trigger fire3PClickEvent on right-clicks.
149
+ // Scope is limited to 3P click analytics to keep the experiment focused.
150
+ const onContextMenu = useCallback(event => {
151
+ const destinationUrl = getDestinationUrl();
152
+ updateAnchorHref(event, destinationUrl);
153
+ }, [getDestinationUrl]);
134
154
  const onClick = useCallback(event => {
135
155
  if (fg('platform_smartlink_xpc_url_wrapping')) {
136
156
  // Prevent the anchor's native navigation so we can open the destination URL
137
157
  // with cross-product analytics query parameters appended.
138
- // The href is read from the anchor element at click time rather than at render
139
- // time because the URL for the anchor may be different from original URL.
140
- // The component may use the URL from the resolved response which can be a redirect URL
141
- // or other preferred URL based on link extractor.
142
158
  // The cross-product params are client-only and cannot be rendered
143
159
  // server-side. Falls back to the original `url` prop if the event target is
144
160
  // not an anchor element.
145
161
  event.preventDefault();
146
162
  const {
147
- href = url,
148
163
  target
149
164
  } = getAnchorAttributesFromEvent(event);
150
- const destinationUrl = appendCrossProductAnalyticsParams(href);
165
+ const destinationUrl = getDestinationUrl();
166
+ updateAnchorHref(event, destinationUrl);
151
167
  window.open(destinationUrl, target);
152
168
  }
153
169
  const isModifierKeyPressed = isSpecialEvent(event);
@@ -158,7 +174,7 @@ const HoverCardContent = ({
158
174
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
159
175
  });
160
176
  fireLinkClickedEvent(createAnalyticsEvent)(event);
161
- }, [createAnalyticsEvent, appendCrossProductAnalyticsParams, id, fireEvent, definitionId, url]);
177
+ }, [createAnalyticsEvent, getDestinationUrl, id, fireEvent, definitionId]);
162
178
  const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
163
179
  const {
164
180
  subtitle
@@ -177,6 +193,10 @@ const HoverCardContent = ({
177
193
  appearance: CardDisplay.HoverCardPreview,
178
194
  cardState: cardState,
179
195
  onClick: onClick,
196
+ ...(fg('platform_smartlink_xpc_url_wrapping') ? {
197
+ onAuxClick,
198
+ onContextMenu
199
+ } : undefined),
180
200
  onResolve: onResolve,
181
201
  origin: 'smartLinkPreviewHoverCard',
182
202
  renderers: renderers,
@@ -2,19 +2,19 @@
2
2
  import "./index.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback, useMemo } from 'react';
5
- import { useIntl } from "react-intl";
5
+ import { useIntl } from 'react-intl';
6
6
  import { cx } from '@atlaskit/css';
7
7
  import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
8
8
  import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
9
9
  import { Box, Text } from '@atlaskit/primitives/compiled';
10
- import extractRovoChatAction from "../../../../extractors/flexible/actions/extract-rovo-chat-action";
11
- import { getExtensionKey } from "../../../../state/helpers";
12
- import useInvokeClientAction from "../../../../state/hooks/use-invoke-client-action";
13
- import useRovoChat from "../../../../state/hooks/use-rovo-chat";
14
- import useRovoConfig from "../../../../state/hooks/use-rovo-config";
15
- import { useSmartCardState } from "../../../../state/store";
16
- import { getPromptAction, RovoChatPromptKey } from "../../../common/rovo-chat-utils";
17
- import { ActionButton } from "../action-button";
10
+ import extractRovoChatAction from '../../../../extractors/flexible/actions/extract-rovo-chat-action';
11
+ import { getExtensionKey } from '../../../../state/helpers';
12
+ import useInvokeClientAction from '../../../../state/hooks/use-invoke-client-action';
13
+ import useRovoChat from '../../../../state/hooks/use-rovo-chat';
14
+ import useRovoConfig from '../../../../state/hooks/use-rovo-config';
15
+ import { useSmartCardState } from '../../../../state/store';
16
+ import { getPromptAction, RovoChatPromptKey } from '../../../common/rovo-chat-utils';
17
+ import { ActionButton } from '../action-button';
18
18
  const styles = {
19
19
  innerContainer: "_1e0c1nu9 _1y1m1u8q _16d9qvcn _19bv12x7 _u5f312x7",
20
20
  rovoIcon: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _ca0qv77o _n3tdv77o",
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
9
9
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
10
10
  const PACKAGE_DATA = {
11
11
  packageName: "@atlaskit/smart-card",
12
- packageVersion: "44.28.0",
12
+ packageVersion: "44.28.2",
13
13
  componentName: 'linkUrl'
14
14
  };
15
15
  const LinkUrl = ({
@@ -1,16 +1,16 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  import AiSearchIcon from '@atlaskit/icon-lab/core/ai-search';
3
3
  import AiChatIcon from '@atlaskit/icon/core/ai-chat';
4
4
  import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
5
5
  import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
6
6
  import { RovoIcon } from '@atlaskit/logo';
7
- import { CardDisplay } from "../../../constants";
8
- import { messages } from "../../../messages";
9
- import { isBlockCardRovoActionExperimentEnabled } from "../../../state/hooks/use-block-card-rovo-action-experiment";
10
- import AiChapterIcon from "../../FlexibleCard/assets/ai-chapter-icon";
11
- import AIEditIcon from "../../FlexibleCard/assets/ai-edit-icon";
12
- import AISearchIcon from "../../FlexibleCard/assets/ai-search-icon";
13
- import htmlToAdf from "../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf";
7
+ import { CardDisplay } from '../../../constants';
8
+ import { messages } from '../../../messages';
9
+ import { isBlockCardRovoActionExperimentEnabled } from '../../../state/hooks/use-block-card-rovo-action-experiment';
10
+ import AiChapterIcon from '../../FlexibleCard/assets/ai-chapter-icon';
11
+ import AIEditIcon from '../../FlexibleCard/assets/ai-edit-icon';
12
+ import AISearchIcon from '../../FlexibleCard/assets/ai-search-icon';
13
+ import htmlToAdf from '../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf';
14
14
  export let RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
15
15
  RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
16
16
  RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import { fg } from "@atlaskit/platform-feature-flags";
2
+ import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
4
  import { getIsRovoChatEnabled } from '../../../utils/rovo';
5
5
  import { getExtensionKey } from '../../helpers';
@@ -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: "44.28.0" || ''
7
+ packageVersion: "44.28.2" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -34,4 +34,10 @@ export var getAnchorAttributesFromEvent = function getAnchorAttributesFromEvent(
34
34
  href: currentTarget.href,
35
35
  target: currentTarget.target || '_self'
36
36
  };
37
+ };
38
+ export var updateAnchorHref = function updateAnchorHref(event, href) {
39
+ if (!(event.currentTarget instanceof HTMLAnchorElement)) {
40
+ return;
41
+ }
42
+ event.currentTarget.href = href;
37
43
  };
@@ -19,7 +19,7 @@ import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
19
19
  import { combineActionOptions } from '../../utils/actions/combine-action-options';
20
20
  import { fireLinkClickedEvent } from '../../utils/analytics/click';
21
21
  import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
22
- import { getAnchorAttributesFromEvent, isAuxClick } from '../../utils/click-helpers';
22
+ import { getAnchorAttributesFromEvent, isAuxClick, updateAnchorHref } from '../../utils/click-helpers';
23
23
  import { isFlexibleUiCard } from '../../utils/flexible';
24
24
  import * as measure from '../../utils/performance';
25
25
  import { BlockCard } from '../BlockCard';
@@ -105,19 +105,10 @@ function Component(_ref) {
105
105
  var shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && getClickUrl(url, state.details) === url && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics');
106
106
  var getDestinationUrl = useCallback(function () {
107
107
  var _getClickUrl, _appendCrossProductAn;
108
+ // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
108
109
  var preferredUrl = (_getClickUrl = getClickUrl(url, state.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
109
110
  return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
110
111
  }, [appendCrossProductAnalyticsParams, state.details, url]);
111
- var updateAnchorHref = useCallback(function (event, destinationUrl) {
112
- if (!(event.currentTarget instanceof HTMLAnchorElement)) {
113
- return;
114
- }
115
-
116
- // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
117
- // href is only defined when currentTarget is an anchor element.
118
- // Update the anchor href so the browser context menu uses the decorated URL.
119
- event.currentTarget.href = destinationUrl;
120
- }, []);
121
112
 
122
113
  // Setup UI handlers.
123
114
  var handleClickWrapper = useCallback(function (event) {
@@ -247,7 +238,7 @@ function Component(_ref) {
247
238
  fireLinkClickedEvent(createAnalyticsEvent)(event);
248
239
  }
249
240
  }
250
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, updateAnchorHref, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
241
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
251
242
 
252
243
  // Exposure fires once per eligible mount; click-time reads use no-exposure variant.
253
244
  useEffect(function () {
@@ -270,7 +261,7 @@ function Component(_ref) {
270
261
  isAuxClick: true
271
262
  });
272
263
  }
273
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, updateAnchorHref]);
264
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
274
265
 
275
266
  // Right-click handler to trigger fire3PClickEvent on right-clicks.
276
267
  // Scope is limited to 3P click analytics to keep the experiment focused.
@@ -284,7 +275,7 @@ function Component(_ref) {
284
275
  isContextMenu: true
285
276
  });
286
277
  }
287
- }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent, updateAnchorHref]);
278
+ }, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
288
279
  var reload = actions.reload;
289
280
  var handleAuthorize = useCallback(function () {
290
281
  return actions.authorize(appearance);
@@ -12,7 +12,7 @@ import { ActionName } from '../../../../../constants';
12
12
  import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
13
13
  import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
14
14
  import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
15
- import { getPromptAction, RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
15
+ import { getPromptAction, RovoChatPromptKey } from '../../../../common/rovo-chat-utils';
16
16
  import Action from '../action';
17
17
  var GOOGLE_PROMPTS = [RovoChatPromptKey.RECOMMEND_OTHER_SOURCES, RovoChatPromptKey.SHOW_OTHER_MENTIONS, RovoChatPromptKey.SUGGEST_IMPROVEMENT];
18
18
  var DEFAULT_PROMPTS = GOOGLE_PROMPTS;
@@ -1,4 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2
5
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
3
6
  import { AnalyticsContext, useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
4
7
  import { useSmartLinkContext } from '@atlaskit/link-provider';
@@ -9,14 +12,14 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
9
12
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
10
13
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
11
14
  import extractRovoChatAction from '../../../extractors/flexible/actions/extract-rovo-chat-action';
12
- import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
15
+ import { getClickUrl, getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
13
16
  import useRovoConfig from '../../../state/hooks/use-rovo-config';
14
17
  import { useSmartLinkCrossProductUrlWrapperGated } from '../../../state/hooks/use-smart-link-cross-product-url-wrapper';
15
18
  import { useSmartCardState } from '../../../state/store';
16
19
  import { isSpecialEvent } from '../../../utils';
17
20
  import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
18
21
  import { fireLinkClickedEvent } from '../../../utils/analytics/click';
19
- import { getAnchorAttributesFromEvent } from '../../../utils/click-helpers';
22
+ import { getAnchorAttributesFromEvent, updateAnchorHref } from '../../../utils/click-helpers';
20
23
  import { flexibleUiOptions } from '../styled';
21
24
  import { getMetadata } from '../utils';
22
25
  import ContentContainer from './ContentContainer';
@@ -128,23 +131,38 @@ var HoverCardContent = function HoverCardContent(_ref4) {
128
131
  });
129
132
  };
130
133
  }, []);
134
+ var getDestinationUrl = useCallback(function () {
135
+ var _getClickUrl, _appendCrossProductAn;
136
+ // FIXME: destinationUrl should be rendered in the DOM anchor href instead of derived at click time
137
+ var preferredUrl = (_getClickUrl = getClickUrl(url, linkState.details)) !== null && _getClickUrl !== void 0 ? _getClickUrl : url;
138
+ return (_appendCrossProductAn = appendCrossProductAnalyticsParams(preferredUrl)) !== null && _appendCrossProductAn !== void 0 ? _appendCrossProductAn : preferredUrl;
139
+ }, [appendCrossProductAnalyticsParams, linkState.details, url]);
140
+
141
+ // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
142
+ // Scope is limited to 3P click analytics to keep the experiment focused.
143
+ var onAuxClick = useCallback(function (event) {
144
+ var destinationUrl = getDestinationUrl();
145
+ updateAnchorHref(event, destinationUrl);
146
+ }, [getDestinationUrl]);
147
+
148
+ // Right-click handler to trigger fire3PClickEvent on right-clicks.
149
+ // Scope is limited to 3P click analytics to keep the experiment focused.
150
+ var onContextMenu = useCallback(function (event) {
151
+ var destinationUrl = getDestinationUrl();
152
+ updateAnchorHref(event, destinationUrl);
153
+ }, [getDestinationUrl]);
131
154
  var onClick = useCallback(function (event) {
132
155
  if (fg('platform_smartlink_xpc_url_wrapping')) {
133
156
  // Prevent the anchor's native navigation so we can open the destination URL
134
157
  // with cross-product analytics query parameters appended.
135
- // The href is read from the anchor element at click time rather than at render
136
- // time because the URL for the anchor may be different from original URL.
137
- // The component may use the URL from the resolved response which can be a redirect URL
138
- // or other preferred URL based on link extractor.
139
158
  // The cross-product params are client-only and cannot be rendered
140
159
  // server-side. Falls back to the original `url` prop if the event target is
141
160
  // not an anchor element.
142
161
  event.preventDefault();
143
162
  var _getAnchorAttributesF = getAnchorAttributesFromEvent(event),
144
- _getAnchorAttributesF2 = _getAnchorAttributesF.href,
145
- href = _getAnchorAttributesF2 === void 0 ? url : _getAnchorAttributesF2,
146
163
  target = _getAnchorAttributesF.target;
147
- var destinationUrl = appendCrossProductAnalyticsParams(href);
164
+ var destinationUrl = getDestinationUrl();
165
+ updateAnchorHref(event, destinationUrl);
148
166
  window.open(destinationUrl, target);
149
167
  }
150
168
  var isModifierKeyPressed = isSpecialEvent(event);
@@ -155,7 +173,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
155
173
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
156
174
  });
157
175
  fireLinkClickedEvent(createAnalyticsEvent)(event);
158
- }, [createAnalyticsEvent, appendCrossProductAnalyticsParams, id, fireEvent, definitionId, url]);
176
+ }, [createAnalyticsEvent, getDestinationUrl, id, fireEvent, definitionId]);
159
177
  var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
160
178
  var _getMetadata = getMetadata(extensionKey, data),
161
179
  subtitle = _getMetadata.subtitle;
@@ -169,10 +187,14 @@ var HoverCardContent = function HoverCardContent(_ref4) {
169
187
  };
170
188
  var uiOptions = flexibleUiOptions;
171
189
  uiOptions.enableSnippetRenderer = true;
172
- var flexibleCardProps = {
190
+ var flexibleCardProps = _objectSpread(_objectSpread({
173
191
  appearance: CardDisplay.HoverCardPreview,
174
192
  cardState: cardState,
175
- onClick: onClick,
193
+ onClick: onClick
194
+ }, fg('platform_smartlink_xpc_url_wrapping') ? {
195
+ onAuxClick: onAuxClick,
196
+ onContextMenu: onContextMenu
197
+ } : undefined), {}, {
176
198
  onResolve: onResolve,
177
199
  origin: 'smartLinkPreviewHoverCard',
178
200
  renderers: renderers,
@@ -180,7 +202,7 @@ var HoverCardContent = function HoverCardContent(_ref4) {
180
202
  ui: uiOptions,
181
203
  url: url,
182
204
  children: null
183
- };
205
+ });
184
206
  var onClickStopPropagation = useCallback(function (e) {
185
207
  return e.stopPropagation();
186
208
  }, []);
@@ -7,19 +7,19 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  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; }
8
8
  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; }
9
9
  import React, { useCallback, useMemo } from 'react';
10
- import { useIntl } from "react-intl";
10
+ import { useIntl } from 'react-intl';
11
11
  import { cx } from '@atlaskit/css';
12
12
  import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
13
13
  import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
14
14
  import { Box, Text } from '@atlaskit/primitives/compiled';
15
- import extractRovoChatAction from "../../../../extractors/flexible/actions/extract-rovo-chat-action";
16
- import { getExtensionKey } from "../../../../state/helpers";
17
- import useInvokeClientAction from "../../../../state/hooks/use-invoke-client-action";
18
- import useRovoChat from "../../../../state/hooks/use-rovo-chat";
19
- import useRovoConfig from "../../../../state/hooks/use-rovo-config";
20
- import { useSmartCardState } from "../../../../state/store";
21
- import { getPromptAction, RovoChatPromptKey } from "../../../common/rovo-chat-utils";
22
- import { ActionButton } from "../action-button";
15
+ import extractRovoChatAction from '../../../../extractors/flexible/actions/extract-rovo-chat-action';
16
+ import { getExtensionKey } from '../../../../state/helpers';
17
+ import useInvokeClientAction from '../../../../state/hooks/use-invoke-client-action';
18
+ import useRovoChat from '../../../../state/hooks/use-rovo-chat';
19
+ import useRovoConfig from '../../../../state/hooks/use-rovo-config';
20
+ import { useSmartCardState } from '../../../../state/store';
21
+ import { getPromptAction, RovoChatPromptKey } from '../../../common/rovo-chat-utils';
22
+ import { ActionButton } from '../action-button';
23
23
  var styles = {
24
24
  innerContainer: "_1e0c1nu9 _1y1m1u8q _16d9qvcn _19bv12x7 _u5f312x7",
25
25
  rovoIcon: "_syaz15cr _80omtlke _bfhkjmqp _qrwqlb4i _1o0zlb4i _ca0qv77o _n3tdv77o",
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  var PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "44.28.0",
15
+ packageVersion: "44.28.2",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  var LinkUrl = function LinkUrl(_ref) {
@@ -1,16 +1,16 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  import AiSearchIcon from '@atlaskit/icon-lab/core/ai-search';
3
3
  import AiChatIcon from '@atlaskit/icon/core/ai-chat';
4
4
  import AiGenerativeTextSummaryIcon from '@atlaskit/icon/core/ai-generative-text-summary';
5
5
  import RovoChatIcon from '@atlaskit/icon/core/rovo-chat';
6
6
  import { RovoIcon } from '@atlaskit/logo';
7
- import { CardDisplay } from "../../../constants";
8
- import { messages } from "../../../messages";
9
- import { isBlockCardRovoActionExperimentEnabled } from "../../../state/hooks/use-block-card-rovo-action-experiment";
10
- import AiChapterIcon from "../../FlexibleCard/assets/ai-chapter-icon";
11
- import AIEditIcon from "../../FlexibleCard/assets/ai-edit-icon";
12
- import AISearchIcon from "../../FlexibleCard/assets/ai-search-icon";
13
- import htmlToAdf from "../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf";
7
+ import { CardDisplay } from '../../../constants';
8
+ import { messages } from '../../../messages';
9
+ import { isBlockCardRovoActionExperimentEnabled } from '../../../state/hooks/use-block-card-rovo-action-experiment';
10
+ import AiChapterIcon from '../../FlexibleCard/assets/ai-chapter-icon';
11
+ import AIEditIcon from '../../FlexibleCard/assets/ai-edit-icon';
12
+ import AISearchIcon from '../../FlexibleCard/assets/ai-search-icon';
13
+ import htmlToAdf from '../../FlexibleCard/components/actions/rovo-chat-action/html-to-adf';
14
14
  export var RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
15
15
  RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
16
16
  RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
@@ -26,3 +26,4 @@ export declare const getAnchorAttributesFromEvent: (event: MouseEvent | Keyboard
26
26
  href?: string;
27
27
  target: string;
28
28
  };
29
+ export declare const updateAnchorHref: (event: MouseEvent | KeyboardEvent, href: string) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
2
+ import { RovoChatPromptKey } from '../../../../common/rovo-chat-utils';
3
3
  import { type LinkActionProps } from '../types';
4
4
  type RovoChatActionProps = LinkActionProps & {
5
5
  prompts?: RovoChatPromptKey[];
@@ -7,7 +7,7 @@ export type AISummaryBlockProps = {
7
7
  aiSummaryMinHeight?: number;
8
8
  /**
9
9
  * Whether the platform_sl_3p_auth_rovo_action experiment value is ON for current runtime
10
- */
10
+ */
11
11
  isAny3pRovoActionsExperimentOn?: boolean;
12
12
  /**
13
13
  * Placeholder to show when summary is not available
@@ -1,8 +1,8 @@
1
- import type { InternalCardActionOptions as CardActionOptions } from "../../../Card/types";
1
+ import type { InternalCardActionOptions as CardActionOptions } from '../../../Card/types';
2
2
  export declare const RovoActionsCta: ({ testId }: {
3
3
  testId?: string;
4
4
  }) => JSX.Element;
5
- export declare const InlineRovoActionButton: ({ testId, url, actionOptions }: {
5
+ export declare const InlineRovoActionButton: ({ testId, url, actionOptions, }: {
6
6
  actionOptions?: CardActionOptions;
7
7
  testId?: string;
8
8
  url?: string;
@@ -1,10 +1,10 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  import { type IntlShape } from 'react-intl';
3
3
  import type { ProductType } from '@atlaskit/linking-common';
4
- import { CardDisplay } from "../../../constants";
5
- import type { SendPromptMessageData } from "../../../state/hooks/use-rovo-chat";
6
- import type Action from "../../FlexibleCard/components/actions/action";
7
- import type { ActionProps } from "../../FlexibleCard/components/actions/action/types";
4
+ import { CardDisplay } from '../../../constants';
5
+ import type { SendPromptMessageData } from '../../../state/hooks/use-rovo-chat';
6
+ import type Action from '../../FlexibleCard/components/actions/action';
7
+ import type { ActionProps } from '../../FlexibleCard/components/actions/action/types';
8
8
  export declare enum RovoChatPromptKey {
9
9
  RECOMMEND_OTHER_SOURCES = "recommend-other-sources",
10
10
  SHOW_OTHER_MENTIONS = "show-other-mentions",
@@ -34,7 +34,7 @@ type PromptActionProps = {
34
34
  provider?: string;
35
35
  url?: string;
36
36
  };
37
- export declare const getPromptAction: ({ promptKey, intl, url, product, iconSize, cardAppearance, provider }: PromptActionProps) => (Pick<React.ComponentProps<typeof Action>, "content" | "icon" | "tooltipMessage"> & {
37
+ export declare const getPromptAction: ({ promptKey, intl, url, product, iconSize, cardAppearance, provider, }: PromptActionProps) => (Pick<React.ComponentProps<typeof Action>, "content" | "icon" | "tooltipMessage"> & {
38
38
  data: SendPromptMessageData;
39
39
  }) | undefined;
40
40
  export {};
@@ -26,3 +26,4 @@ export declare const getAnchorAttributesFromEvent: (event: MouseEvent | Keyboard
26
26
  href?: string;
27
27
  target: string;
28
28
  };
29
+ export declare const updateAnchorHref: (event: MouseEvent | KeyboardEvent, href: string) => void;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { RovoChatPromptKey } from "../../../../common/rovo-chat-utils";
2
+ import { RovoChatPromptKey } from '../../../../common/rovo-chat-utils';
3
3
  import { type LinkActionProps } from '../types';
4
4
  type RovoChatActionProps = LinkActionProps & {
5
5
  prompts?: RovoChatPromptKey[];
@@ -7,7 +7,7 @@ export type AISummaryBlockProps = {
7
7
  aiSummaryMinHeight?: number;
8
8
  /**
9
9
  * Whether the platform_sl_3p_auth_rovo_action experiment value is ON for current runtime
10
- */
10
+ */
11
11
  isAny3pRovoActionsExperimentOn?: boolean;
12
12
  /**
13
13
  * Placeholder to show when summary is not available
@@ -1,8 +1,8 @@
1
- import type { InternalCardActionOptions as CardActionOptions } from "../../../Card/types";
1
+ import type { InternalCardActionOptions as CardActionOptions } from '../../../Card/types';
2
2
  export declare const RovoActionsCta: ({ testId }: {
3
3
  testId?: string;
4
4
  }) => JSX.Element;
5
- export declare const InlineRovoActionButton: ({ testId, url, actionOptions }: {
5
+ export declare const InlineRovoActionButton: ({ testId, url, actionOptions, }: {
6
6
  actionOptions?: CardActionOptions;
7
7
  testId?: string;
8
8
  url?: string;
@@ -1,10 +1,10 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  import { type IntlShape } from 'react-intl';
3
3
  import type { ProductType } from '@atlaskit/linking-common';
4
- import { CardDisplay } from "../../../constants";
5
- import type { SendPromptMessageData } from "../../../state/hooks/use-rovo-chat";
6
- import type Action from "../../FlexibleCard/components/actions/action";
7
- import type { ActionProps } from "../../FlexibleCard/components/actions/action/types";
4
+ import { CardDisplay } from '../../../constants';
5
+ import type { SendPromptMessageData } from '../../../state/hooks/use-rovo-chat';
6
+ import type Action from '../../FlexibleCard/components/actions/action';
7
+ import type { ActionProps } from '../../FlexibleCard/components/actions/action/types';
8
8
  export declare enum RovoChatPromptKey {
9
9
  RECOMMEND_OTHER_SOURCES = "recommend-other-sources",
10
10
  SHOW_OTHER_MENTIONS = "show-other-mentions",
@@ -34,7 +34,7 @@ type PromptActionProps = {
34
34
  provider?: string;
35
35
  url?: string;
36
36
  };
37
- export declare const getPromptAction: ({ promptKey, intl, url, product, iconSize, cardAppearance, provider }: PromptActionProps) => (Pick<React.ComponentProps<typeof Action>, "content" | "icon" | "tooltipMessage"> & {
37
+ export declare const getPromptAction: ({ promptKey, intl, url, product, iconSize, cardAppearance, provider, }: PromptActionProps) => (Pick<React.ComponentProps<typeof Action>, "content" | "icon" | "tooltipMessage"> & {
38
38
  data: SendPromptMessageData;
39
39
  }) | undefined;
40
40
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "44.28.1",
3
+ "version": "44.28.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/icon": "^35.4.0",
58
58
  "@atlaskit/icon-file-type": "^7.0.0",
59
59
  "@atlaskit/icon-lab": "^6.13.0",
60
- "@atlaskit/image": "^3.0.0",
60
+ "@atlaskit/image": "^3.1.0",
61
61
  "@atlaskit/json-ld-types": "^1.5.0",
62
62
  "@atlaskit/link": "^3.4.0",
63
63
  "@atlaskit/link-analytics": "^11.1.0",
@@ -78,7 +78,7 @@
78
78
  "@atlaskit/popup": "^4.24.0",
79
79
  "@atlaskit/primitives": "^19.0.0",
80
80
  "@atlaskit/react-ufo": "^6.7.0",
81
- "@atlaskit/rovo-triggers": "^7.5.0",
81
+ "@atlaskit/rovo-triggers": "^7.6.0",
82
82
  "@atlaskit/section-message": "^8.13.0",
83
83
  "@atlaskit/select": "^21.12.0",
84
84
  "@atlaskit/spinner": "^19.1.0",
@@ -87,8 +87,8 @@
87
87
  "@atlaskit/textfield": "^8.3.0",
88
88
  "@atlaskit/theme": "^25.0.0",
89
89
  "@atlaskit/tile": "^1.1.0",
90
- "@atlaskit/tmp-editor-statsig": "^99.0.0",
91
- "@atlaskit/tokens": "^13.3.0",
90
+ "@atlaskit/tmp-editor-statsig": "^100.0.0",
91
+ "@atlaskit/tokens": "^13.4.0",
92
92
  "@atlaskit/tooltip": "^22.6.0",
93
93
  "@atlaskit/ufo": "^0.5.0",
94
94
  "@atlaskit/width-detector": "^5.1.0",