@atlaskit/smart-card 44.11.4 → 44.12.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 (35) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/CardWithUrl/component.js +41 -10
  4. package/dist/cjs/view/InlineCard/Frame/index.js +4 -0
  5. package/dist/cjs/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +8 -0
  6. package/dist/cjs/view/InlineCard/ResolvedView/index.js +4 -0
  7. package/dist/cjs/view/InlineCard/index.js +9 -1
  8. package/dist/cjs/view/LinkUrl/index.js +1 -1
  9. package/dist/es2019/utils/analytics/analytics.js +1 -1
  10. package/dist/es2019/view/CardWithUrl/component.js +41 -10
  11. package/dist/es2019/view/InlineCard/Frame/index.js +4 -0
  12. package/dist/es2019/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +8 -0
  13. package/dist/es2019/view/InlineCard/ResolvedView/index.js +4 -0
  14. package/dist/es2019/view/InlineCard/index.js +9 -1
  15. package/dist/es2019/view/LinkUrl/index.js +1 -1
  16. package/dist/esm/utils/analytics/analytics.js +1 -1
  17. package/dist/esm/view/CardWithUrl/component.js +41 -10
  18. package/dist/esm/view/InlineCard/Frame/index.js +4 -0
  19. package/dist/esm/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.js +8 -0
  20. package/dist/esm/view/InlineCard/ResolvedView/index.js +4 -0
  21. package/dist/esm/view/InlineCard/index.js +9 -1
  22. package/dist/esm/view/LinkUrl/index.js +1 -1
  23. package/dist/types/view/InlineCard/Frame/index.d.ts +4 -0
  24. package/dist/types/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.d.ts +2 -2
  25. package/dist/types/view/InlineCard/ResolvedView/index.d.ts +4 -0
  26. package/dist/types/view/InlineCard/ResolvedView/types.d.ts +4 -0
  27. package/dist/types/view/InlineCard/index.d.ts +1 -1
  28. package/dist/types/view/InlineCard/types.d.ts +4 -0
  29. package/dist/types-ts4.5/view/InlineCard/Frame/index.d.ts +4 -0
  30. package/dist/types-ts4.5/view/InlineCard/ResolvedView/InlineCardResolvedViewFunctional.d.ts +2 -2
  31. package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +4 -0
  32. package/dist/types-ts4.5/view/InlineCard/ResolvedView/types.d.ts +4 -0
  33. package/dist/types-ts4.5/view/InlineCard/index.d.ts +1 -1
  34. package/dist/types-ts4.5/view/InlineCard/types.d.ts +4 -0
  35. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 44.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 44.12.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [`dd59463db49fa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dd59463db49fa) -
14
+ Track middle- and right-clicks from InlineCard (via CardWithUrl) to fire fire3PClickEvent, gated
15
+ by the linking_platform_track_non_primary_3p_clicks experiment
16
+
3
17
  ## 44.11.4
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.11.3" || ''
14
+ packageVersion: "44.12.0" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -12,6 +12,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
12
12
  var _linkExtractors = require("@atlaskit/link-extractors");
13
13
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
14
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
15
16
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
16
17
  var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
17
18
  var _constants = require("../../constants");
@@ -24,6 +25,7 @@ var _utils = require("../../utils");
24
25
  var _combineActionOptions = require("../../utils/actions/combine-action-options");
25
26
  var _click = require("../../utils/analytics/click");
26
27
  var _SmartLinkAnalyticsContext = require("../../utils/analytics/SmartLinkAnalyticsContext");
28
+ var _clickHelpers = require("../../utils/click-helpers");
27
29
  var _flexible = require("../../utils/flexible");
28
30
  var measure = _interopRequireWildcard(require("../../utils/performance"));
29
31
  var _BlockCard = require("../BlockCard");
@@ -36,6 +38,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
36
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; }
37
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; }
38
40
  var thirdPartyARIPrefix = 'ari:third-party';
41
+ var TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
39
42
  function Component(_ref) {
40
43
  var id = _ref.id,
41
44
  url = _ref.url,
@@ -99,6 +102,9 @@ function Component(_ref) {
99
102
  // eslint-disable-next-line react-hooks/rules-of-hooks
100
103
  (0, _useSmartLinkEvents.useFire3PWorkflowsClickEvent)(firstPartyIdentifier, thirdPartyARI) : undefined;
101
104
 
105
+ // Shared scope guard for all 3P-click handlers.
106
+ var shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && (0, _helpers.getClickUrl)(url, state.details) === url && fire3PClickEvent && (0, _platformFeatureFlags.fg)('platform_smartlink_3pclick_analytics');
107
+
102
108
  // Setup UI handlers.
103
109
  var handleClickWrapper = (0, _react.useCallback)(function (event) {
104
110
  var isModifierKeyPressed = (0, _utils.isSpecialKey)(event) || (0, _utils.isSpecialClick)(event);
@@ -108,15 +114,10 @@ function Component(_ref) {
108
114
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
109
115
  isModifierKeyPressed: isModifierKeyPressed
110
116
  });
111
- if ((0, _platformFeatureFlags.fg)('platform_smartlink_3pclick_analytics')) {
112
- if (thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix)) {
113
- var clickURL = (0, _helpers.getClickUrl)(url, state.details);
114
- if (clickURL === url && fire3PClickEvent) {
115
- // For questions or concerns about this event,
116
- // please reach out to the 3P Workflows Team via Slack in #help-3p-connector-workflow
117
- fire3PClickEvent();
118
- }
119
- }
117
+ if (shouldFire3PClickEvent) {
118
+ // For questions or concerns about this event,
119
+ // please reach out to the 3P Workflows Team via Slack in #help-3p-connector-workflow
120
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent();
120
121
  }
121
122
  var isDisablePreviewPanel = disablePreviewPanel && (0, _experiments.editorExperiment)('platform_editor_preview_panel_linking_exp', true, {
122
123
  exposure: true
@@ -165,7 +166,35 @@ function Component(_ref) {
165
166
  }
166
167
  (0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
167
168
  }
168
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, disablePreviewPanel]);
169
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
170
+
171
+ // Exposure fires once per eligible mount; click-time reads use no-exposure variant.
172
+ (0, _react.useEffect)(function () {
173
+ if (shouldFire3PClickEvent) {
174
+ (0, _expValEquals.expValEquals)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
175
+ }
176
+ }, [shouldFire3PClickEvent]);
177
+
178
+ // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
179
+ // Scope is limited to 3P click analytics to keep the experiment focused.
180
+ var handleFrameAuxClick = (0, _react.useCallback)(function (event) {
181
+ // isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
182
+ if ((0, _clickHelpers.isAuxClick)(event) && shouldFire3PClickEvent && (0, _expValEqualsNoExposure.expValEqualsNoExposure)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
183
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
184
+ isAuxClick: true
185
+ });
186
+ }
187
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
188
+
189
+ // Right-click handler to trigger fire3PClickEvent on right-clicks.
190
+ // Scope is limited to 3P click analytics to keep the experiment focused.
191
+ var handleFrameContextMenu = (0, _react.useCallback)(function (_event) {
192
+ if (shouldFire3PClickEvent && (0, _expValEqualsNoExposure.expValEqualsNoExposure)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
193
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
194
+ isContextMenu: true
195
+ });
196
+ }
197
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
169
198
  var handleAuthorize = (0, _react.useCallback)(function () {
170
199
  return actions.authorize(appearance);
171
200
  }, [actions, appearance]);
@@ -301,6 +330,8 @@ function Component(_ref) {
301
330
  cardState: state,
302
331
  handleAuthorize: services.length && handleAuthorize || undefined,
303
332
  handleFrameClick: handleClickWrapper,
333
+ handleFrameAuxClick: handleFrameAuxClick,
334
+ handleFrameContextMenu: handleFrameContextMenu,
304
335
  isSelected: isSelected,
305
336
  isHovered: isHovered,
306
337
  onResolve: onResolve,
@@ -14,6 +14,8 @@ var Frame = exports.Frame = /*#__PURE__*/(0, _react.forwardRef)(function (props,
14
14
  var isSelected = props.isSelected,
15
15
  children = props.children,
16
16
  onClick = props.onClick,
17
+ onAuxClick = props.onAuxClick,
18
+ onContextMenu = props.onContextMenu,
17
19
  link = props.link,
18
20
  viewType = props.viewType,
19
21
  withoutBackground = props.withoutBackground,
@@ -52,6 +54,8 @@ var Frame = exports.Frame = /*#__PURE__*/(0, _react.forwardRef)(function (props,
52
54
  tabIndex: isInteractive && ((0, _platformFeatureFlags.fg)('navx-3611-inline-card-a11y-role-fix') ? !link : true) ? 0 : undefined,
53
55
  role: isInteractive && ((0, _platformFeatureFlags.fg)('navx-3611-inline-card-a11y-role-fix') ? !link : true) ? 'button' : undefined,
54
56
  onClick: handleClick,
57
+ onAuxClick: onAuxClick,
58
+ onContextMenu: onContextMenu,
55
59
  onMouseDown: handleMouseDown,
56
60
  onKeyPress: handleKeyPress,
57
61
  "data-testid": testId
@@ -22,6 +22,8 @@ function InlineCardResolvedViewBase(_ref) {
22
22
  isSelected = _ref.isSelected,
23
23
  isHovered = _ref.isHovered,
24
24
  onClick = _ref.onClick,
25
+ onAuxClick = _ref.onAuxClick,
26
+ onContextMenu = _ref.onContextMenu,
25
27
  icon = _ref.icon,
26
28
  link = _ref.link,
27
29
  _ref$testId = _ref.testId,
@@ -42,6 +44,8 @@ function InlineCardResolvedViewBase(_ref) {
42
44
  isSelected: isSelected,
43
45
  isHovered: isHovered,
44
46
  onClick: onClick,
47
+ onAuxClick: onAuxClick,
48
+ onContextMenu: onContextMenu,
45
49
  truncateInline: truncateInline
46
50
  }, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
47
51
  emoji: titlePrefix,
@@ -68,6 +72,8 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
68
72
  isSelected = _ref2.isSelected,
69
73
  isHovered = _ref2.isHovered,
70
74
  onClick = _ref2.onClick,
75
+ onAuxClick = _ref2.onAuxClick,
76
+ onContextMenu = _ref2.onContextMenu,
71
77
  icon = _ref2.icon,
72
78
  link = _ref2.link,
73
79
  _ref2$testId = _ref2.testId,
@@ -92,6 +98,8 @@ function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
92
98
  isSelected: isSelected,
93
99
  isHovered: isHovered,
94
100
  onClick: onClick,
101
+ onAuxClick: onAuxClick,
102
+ onContextMenu: onContextMenu,
95
103
  truncateInline: truncateInline
96
104
  }, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
97
105
  emoji: titlePrefix,
@@ -75,6 +75,8 @@ var InlineCardResolvedViewClass = /*#__PURE__*/function (_React$Component) {
75
75
  isSelected = _this$props.isSelected,
76
76
  isHovered = _this$props.isHovered,
77
77
  onClick = _this$props.onClick,
78
+ onAuxClick = _this$props.onAuxClick,
79
+ onContextMenu = _this$props.onContextMenu,
78
80
  icon = _this$props.icon,
79
81
  link = _this$props.link,
80
82
  _this$props$testId = _this$props.testId,
@@ -94,6 +96,8 @@ var InlineCardResolvedViewClass = /*#__PURE__*/function (_React$Component) {
94
96
  isSelected: isSelected,
95
97
  isHovered: isHovered,
96
98
  onClick: onClick,
99
+ onAuxClick: onAuxClick,
100
+ onContextMenu: onContextMenu,
97
101
  truncateInline: truncateInline
98
102
  }, /*#__PURE__*/_react.default.createElement(_IconAndTitleLayout.IconAndTitleLayout, {
99
103
  emoji: titlePrefix,
@@ -66,6 +66,8 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref2) {
66
66
  cardState = _ref2.cardState,
67
67
  handleAuthorize = _ref2.handleAuthorize,
68
68
  handleFrameClick = _ref2.handleFrameClick,
69
+ handleFrameAuxClick = _ref2.handleFrameAuxClick,
70
+ handleFrameContextMenu = _ref2.handleFrameContextMenu,
69
71
  isSelected = _ref2.isSelected,
70
72
  isHovered = _ref2.isHovered,
71
73
  renderers = _ref2.renderers,
@@ -132,7 +134,13 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref2) {
132
134
  link: url,
133
135
  isSelected: isSelected,
134
136
  isHovered: isHovered,
135
- onClick: handleFrameClick,
137
+ onClick: handleFrameClick
138
+
139
+ // Support middle-/right-clicks for "resolved" only — the vast majority of clicks happen here.
140
+ // Other states (e.g. "resolving") could be added later for completeness.
141
+ ,
142
+ onAuxClick: handleFrameAuxClick,
143
+ onContextMenu: handleFrameContextMenu,
136
144
  testId: testIdWithStatus,
137
145
  truncateInline: truncateInline,
138
146
  hideIconLoadingSkeleton: hideIconLoadingSkeleton
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
22
22
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
23
23
  var PACKAGE_DATA = {
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "44.11.3",
25
+ packageVersion: "44.12.0",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -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.11.3" || ''
5
+ packageVersion: "44.12.0" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -3,6 +3,7 @@ import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytic
3
3
  import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
4
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
6
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
6
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
8
9
  import { CardDisplay } from '../../constants';
@@ -15,6 +16,7 @@ import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
15
16
  import { combineActionOptions } from '../../utils/actions/combine-action-options';
16
17
  import { fireLinkClickedEvent } from '../../utils/analytics/click';
17
18
  import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
19
+ import { isAuxClick } from '../../utils/click-helpers';
18
20
  import { isFlexibleUiCard } from '../../utils/flexible';
19
21
  import * as measure from '../../utils/performance';
20
22
  import { BlockCard } from '../BlockCard';
@@ -24,6 +26,7 @@ import { InlineCard } from '../InlineCard';
24
26
  import { useFire3PWorkflowsClickEvent } from '../SmartLinkEvents/useSmartLinkEvents';
25
27
  import withCardIntersectionObserver from './card-intersection-observer';
26
28
  const thirdPartyARIPrefix = 'ari:third-party';
29
+ const TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
27
30
  function Component({
28
31
  id,
29
32
  url,
@@ -90,6 +93,9 @@ function Component({
90
93
  // eslint-disable-next-line react-hooks/rules-of-hooks
91
94
  useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
92
95
 
96
+ // Shared scope guard for all 3P-click handlers.
97
+ const shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && getClickUrl(url, state.details) === url && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics');
98
+
93
99
  // Setup UI handlers.
94
100
  const handleClickWrapper = useCallback(event => {
95
101
  const isModifierKeyPressed = isSpecialKey(event) || isSpecialClick(event);
@@ -99,15 +105,10 @@ function Component({
99
105
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
100
106
  isModifierKeyPressed
101
107
  });
102
- if (fg('platform_smartlink_3pclick_analytics')) {
103
- if (thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix)) {
104
- const clickURL = getClickUrl(url, state.details);
105
- if (clickURL === url && fire3PClickEvent) {
106
- // For questions or concerns about this event,
107
- // please reach out to the 3P Workflows Team via Slack in #help-3p-connector-workflow
108
- fire3PClickEvent();
109
- }
110
- }
108
+ if (shouldFire3PClickEvent) {
109
+ // For questions or concerns about this event,
110
+ // please reach out to the 3P Workflows Team via Slack in #help-3p-connector-workflow
111
+ fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent();
111
112
  }
112
113
  const isDisablePreviewPanel = disablePreviewPanel && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
113
114
  exposure: true
@@ -156,7 +157,35 @@ function Component({
156
157
  }
157
158
  fireLinkClickedEvent(createAnalyticsEvent)(event);
158
159
  }
159
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, disablePreviewPanel]);
160
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
161
+
162
+ // Exposure fires once per eligible mount; click-time reads use no-exposure variant.
163
+ useEffect(() => {
164
+ if (shouldFire3PClickEvent) {
165
+ expValEquals(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
166
+ }
167
+ }, [shouldFire3PClickEvent]);
168
+
169
+ // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
170
+ // Scope is limited to 3P click analytics to keep the experiment focused.
171
+ const handleFrameAuxClick = useCallback(event => {
172
+ // isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
173
+ if (isAuxClick(event) && shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
174
+ fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
175
+ isAuxClick: true
176
+ });
177
+ }
178
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
179
+
180
+ // Right-click handler to trigger fire3PClickEvent on right-clicks.
181
+ // Scope is limited to 3P click analytics to keep the experiment focused.
182
+ const handleFrameContextMenu = useCallback(_event => {
183
+ if (shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
184
+ fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
185
+ isContextMenu: true
186
+ });
187
+ }
188
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
160
189
  const handleAuthorize = useCallback(() => actions.authorize(appearance), [actions, appearance]);
161
190
  const handleRetry = useCallback(() => {
162
191
  actions.reload();
@@ -289,6 +318,8 @@ function Component({
289
318
  cardState: state,
290
319
  handleAuthorize: services.length && handleAuthorize || undefined,
291
320
  handleFrameClick: handleClickWrapper,
321
+ handleFrameAuxClick: handleFrameAuxClick,
322
+ handleFrameContextMenu: handleFrameContextMenu,
292
323
  isSelected: isSelected,
293
324
  isHovered: isHovered,
294
325
  onResolve: onResolve,
@@ -7,6 +7,8 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
7
7
  isSelected,
8
8
  children,
9
9
  onClick,
10
+ onAuxClick,
11
+ onContextMenu,
10
12
  link,
11
13
  viewType,
12
14
  withoutBackground,
@@ -46,6 +48,8 @@ export const Frame = /*#__PURE__*/forwardRef((props, ref) => {
46
48
  tabIndex: isInteractive && (fg('navx-3611-inline-card-a11y-role-fix') ? !link : true) ? 0 : undefined,
47
49
  role: isInteractive && (fg('navx-3611-inline-card-a11y-role-fix') ? !link : true) ? 'button' : undefined,
48
50
  onClick: handleClick,
51
+ onAuxClick: onAuxClick,
52
+ onContextMenu: onContextMenu,
49
53
  onMouseDown: handleMouseDown,
50
54
  onKeyPress: handleKeyPress,
51
55
  "data-testid": testId
@@ -12,6 +12,8 @@ export function InlineCardResolvedViewBase({
12
12
  isSelected,
13
13
  isHovered,
14
14
  onClick,
15
+ onAuxClick,
16
+ onContextMenu,
15
17
  icon,
16
18
  link,
17
19
  testId = 'inline-card-resolved-view',
@@ -31,6 +33,8 @@ export function InlineCardResolvedViewBase({
31
33
  isSelected: isSelected,
32
34
  isHovered: isHovered,
33
35
  onClick: onClick,
36
+ onAuxClick: onAuxClick,
37
+ onContextMenu: onContextMenu,
34
38
  truncateInline: truncateInline
35
39
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
36
40
  emoji: titlePrefix,
@@ -56,6 +60,8 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
56
60
  isSelected,
57
61
  isHovered,
58
62
  onClick,
63
+ onAuxClick,
64
+ onContextMenu,
59
65
  icon,
60
66
  link,
61
67
  testId = 'inline-card-resolved-view',
@@ -80,6 +86,8 @@ export function InlineCardResolvedViewFunctionalWithRovoActions({
80
86
  isSelected: isSelected,
81
87
  isHovered: isHovered,
82
88
  onClick: onClick,
89
+ onAuxClick: onAuxClick,
90
+ onContextMenu: onContextMenu,
83
91
  truncateInline: truncateInline
84
92
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
85
93
  emoji: titlePrefix,
@@ -50,6 +50,8 @@ class InlineCardResolvedViewClass extends React.Component {
50
50
  isSelected,
51
51
  isHovered,
52
52
  onClick,
53
+ onAuxClick,
54
+ onContextMenu,
53
55
  icon,
54
56
  link,
55
57
  testId = 'inline-card-resolved-view',
@@ -68,6 +70,8 @@ class InlineCardResolvedViewClass extends React.Component {
68
70
  isSelected: isSelected,
69
71
  isHovered: isHovered,
70
72
  onClick: onClick,
73
+ onAuxClick: onAuxClick,
74
+ onContextMenu: onContextMenu,
71
75
  truncateInline: truncateInline
72
76
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
73
77
  emoji: titlePrefix,
@@ -26,6 +26,8 @@ export const InlineCard = ({
26
26
  cardState,
27
27
  handleAuthorize,
28
28
  handleFrameClick,
29
+ handleFrameAuxClick,
30
+ handleFrameContextMenu,
29
31
  isSelected,
30
32
  isHovered,
31
33
  renderers,
@@ -97,7 +99,13 @@ export const InlineCard = ({
97
99
  link: url,
98
100
  isSelected: isSelected,
99
101
  isHovered: isHovered,
100
- onClick: handleFrameClick,
102
+ onClick: handleFrameClick
103
+
104
+ // Support middle-/right-clicks for "resolved" only — the vast majority of clicks happen here.
105
+ // Other states (e.g. "resolving") could be added later for completeness.
106
+ ,
107
+ onAuxClick: handleFrameAuxClick,
108
+ onContextMenu: handleFrameContextMenu,
101
109
  testId: testIdWithStatus,
102
110
  truncateInline: truncateInline,
103
111
  hideIconLoadingSkeleton: hideIconLoadingSkeleton
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "44.11.3",
15
+ packageVersion: "44.12.0",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -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.11.3" || ''
7
+ packageVersion: "44.12.0" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -6,6 +6,7 @@ import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytic
6
6
  import { extractSmartLinkEmbed } from '@atlaskit/link-extractors';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
11
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
11
12
  import { CardDisplay } from '../../constants';
@@ -18,6 +19,7 @@ import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
18
19
  import { combineActionOptions } from '../../utils/actions/combine-action-options';
19
20
  import { fireLinkClickedEvent } from '../../utils/analytics/click';
20
21
  import { SmartLinkAnalyticsContext } from '../../utils/analytics/SmartLinkAnalyticsContext';
22
+ import { isAuxClick } from '../../utils/click-helpers';
21
23
  import { isFlexibleUiCard } from '../../utils/flexible';
22
24
  import * as measure from '../../utils/performance';
23
25
  import { BlockCard } from '../BlockCard';
@@ -27,6 +29,7 @@ import { InlineCard } from '../InlineCard';
27
29
  import { useFire3PWorkflowsClickEvent } from '../SmartLinkEvents/useSmartLinkEvents';
28
30
  import withCardIntersectionObserver from './card-intersection-observer';
29
31
  var thirdPartyARIPrefix = 'ari:third-party';
32
+ var TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
30
33
  function Component(_ref) {
31
34
  var id = _ref.id,
32
35
  url = _ref.url,
@@ -90,6 +93,9 @@ function Component(_ref) {
90
93
  // eslint-disable-next-line react-hooks/rules-of-hooks
91
94
  useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
92
95
 
96
+ // Shared scope guard for all 3P-click handlers.
97
+ var shouldFire3PClickEvent = thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix) && getClickUrl(url, state.details) === url && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics');
98
+
93
99
  // Setup UI handlers.
94
100
  var handleClickWrapper = useCallback(function (event) {
95
101
  var isModifierKeyPressed = isSpecialKey(event) || isSpecialClick(event);
@@ -99,15 +105,10 @@ function Component(_ref) {
99
105
  definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null,
100
106
  isModifierKeyPressed: isModifierKeyPressed
101
107
  });
102
- if (fg('platform_smartlink_3pclick_analytics')) {
103
- if (thirdPartyARI && thirdPartyARI.startsWith(thirdPartyARIPrefix)) {
104
- var clickURL = getClickUrl(url, state.details);
105
- if (clickURL === url && fire3PClickEvent) {
106
- // For questions or concerns about this event,
107
- // please reach out to the 3P Workflows Team via Slack in #help-3p-connector-workflow
108
- fire3PClickEvent();
109
- }
110
- }
108
+ if (shouldFire3PClickEvent) {
109
+ // For questions or concerns about this event,
110
+ // please reach out to the 3P Workflows Team via Slack in #help-3p-connector-workflow
111
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent();
111
112
  }
112
113
  var isDisablePreviewPanel = disablePreviewPanel && editorExperiment('platform_editor_preview_panel_linking_exp', true, {
113
114
  exposure: true
@@ -156,7 +157,35 @@ function Component(_ref) {
156
157
  }
157
158
  fireLinkClickedEvent(createAnalyticsEvent)(event);
158
159
  }
159
- }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, thirdPartyARI, disablePreviewPanel]);
160
+ }, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
161
+
162
+ // Exposure fires once per eligible mount; click-time reads use no-exposure variant.
163
+ useEffect(function () {
164
+ if (shouldFire3PClickEvent) {
165
+ expValEquals(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
166
+ }
167
+ }, [shouldFire3PClickEvent]);
168
+
169
+ // Middle-click handler to trigger fire3PClickEvent on middle-clicks.
170
+ // Scope is limited to 3P click analytics to keep the experiment focused.
171
+ var handleFrameAuxClick = useCallback(function (event) {
172
+ // isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
173
+ if (isAuxClick(event) && shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
174
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
175
+ isAuxClick: true
176
+ });
177
+ }
178
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
179
+
180
+ // Right-click handler to trigger fire3PClickEvent on right-clicks.
181
+ // Scope is limited to 3P click analytics to keep the experiment focused.
182
+ var handleFrameContextMenu = useCallback(function (_event) {
183
+ if (shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
184
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
185
+ isContextMenu: true
186
+ });
187
+ }
188
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
160
189
  var handleAuthorize = useCallback(function () {
161
190
  return actions.authorize(appearance);
162
191
  }, [actions, appearance]);
@@ -292,6 +321,8 @@ function Component(_ref) {
292
321
  cardState: state,
293
322
  handleAuthorize: services.length && handleAuthorize || undefined,
294
323
  handleFrameClick: handleClickWrapper,
324
+ handleFrameAuxClick: handleFrameAuxClick,
325
+ handleFrameContextMenu: handleFrameContextMenu,
295
326
  isSelected: isSelected,
296
327
  isHovered: isHovered,
297
328
  onResolve: onResolve,
@@ -6,6 +6,8 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
6
6
  var isSelected = props.isSelected,
7
7
  children = props.children,
8
8
  onClick = props.onClick,
9
+ onAuxClick = props.onAuxClick,
10
+ onContextMenu = props.onContextMenu,
9
11
  link = props.link,
10
12
  viewType = props.viewType,
11
13
  withoutBackground = props.withoutBackground,
@@ -44,6 +46,8 @@ export var Frame = /*#__PURE__*/forwardRef(function (props, ref) {
44
46
  tabIndex: isInteractive && (fg('navx-3611-inline-card-a11y-role-fix') ? !link : true) ? 0 : undefined,
45
47
  role: isInteractive && (fg('navx-3611-inline-card-a11y-role-fix') ? !link : true) ? 'button' : undefined,
46
48
  onClick: handleClick,
49
+ onAuxClick: onAuxClick,
50
+ onContextMenu: onContextMenu,
47
51
  onMouseDown: handleMouseDown,
48
52
  onKeyPress: handleKeyPress,
49
53
  "data-testid": testId
@@ -13,6 +13,8 @@ export function InlineCardResolvedViewBase(_ref) {
13
13
  isSelected = _ref.isSelected,
14
14
  isHovered = _ref.isHovered,
15
15
  onClick = _ref.onClick,
16
+ onAuxClick = _ref.onAuxClick,
17
+ onContextMenu = _ref.onContextMenu,
16
18
  icon = _ref.icon,
17
19
  link = _ref.link,
18
20
  _ref$testId = _ref.testId,
@@ -33,6 +35,8 @@ export function InlineCardResolvedViewBase(_ref) {
33
35
  isSelected: isSelected,
34
36
  isHovered: isHovered,
35
37
  onClick: onClick,
38
+ onAuxClick: onAuxClick,
39
+ onContextMenu: onContextMenu,
36
40
  truncateInline: truncateInline
37
41
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
38
42
  emoji: titlePrefix,
@@ -59,6 +63,8 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
59
63
  isSelected = _ref2.isSelected,
60
64
  isHovered = _ref2.isHovered,
61
65
  onClick = _ref2.onClick,
66
+ onAuxClick = _ref2.onAuxClick,
67
+ onContextMenu = _ref2.onContextMenu,
62
68
  icon = _ref2.icon,
63
69
  link = _ref2.link,
64
70
  _ref2$testId = _ref2.testId,
@@ -83,6 +89,8 @@ export function InlineCardResolvedViewFunctionalWithRovoActions(_ref2) {
83
89
  isSelected: isSelected,
84
90
  isHovered: isHovered,
85
91
  onClick: onClick,
92
+ onAuxClick: onAuxClick,
93
+ onContextMenu: onContextMenu,
86
94
  truncateInline: truncateInline
87
95
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
88
96
  emoji: titlePrefix,
@@ -68,6 +68,8 @@ var InlineCardResolvedViewClass = /*#__PURE__*/function (_React$Component) {
68
68
  isSelected = _this$props.isSelected,
69
69
  isHovered = _this$props.isHovered,
70
70
  onClick = _this$props.onClick,
71
+ onAuxClick = _this$props.onAuxClick,
72
+ onContextMenu = _this$props.onContextMenu,
71
73
  icon = _this$props.icon,
72
74
  link = _this$props.link,
73
75
  _this$props$testId = _this$props.testId,
@@ -87,6 +89,8 @@ var InlineCardResolvedViewClass = /*#__PURE__*/function (_React$Component) {
87
89
  isSelected: isSelected,
88
90
  isHovered: isHovered,
89
91
  onClick: onClick,
92
+ onAuxClick: onAuxClick,
93
+ onContextMenu: onContextMenu,
90
94
  truncateInline: truncateInline
91
95
  }, /*#__PURE__*/React.createElement(IconAndTitleLayout, {
92
96
  emoji: titlePrefix,
@@ -28,6 +28,8 @@ export var InlineCard = function InlineCard(_ref2) {
28
28
  cardState = _ref2.cardState,
29
29
  handleAuthorize = _ref2.handleAuthorize,
30
30
  handleFrameClick = _ref2.handleFrameClick,
31
+ handleFrameAuxClick = _ref2.handleFrameAuxClick,
32
+ handleFrameContextMenu = _ref2.handleFrameContextMenu,
31
33
  isSelected = _ref2.isSelected,
32
34
  isHovered = _ref2.isHovered,
33
35
  renderers = _ref2.renderers,
@@ -94,7 +96,13 @@ export var InlineCard = function InlineCard(_ref2) {
94
96
  link: url,
95
97
  isSelected: isSelected,
96
98
  isHovered: isHovered,
97
- onClick: handleFrameClick,
99
+ onClick: handleFrameClick
100
+
101
+ // Support middle-/right-clicks for "resolved" only — the vast majority of clicks happen here.
102
+ // Other states (e.g. "resolving") could be added later for completeness.
103
+ ,
104
+ onAuxClick: handleFrameAuxClick,
105
+ onContextMenu: handleFrameContextMenu,
98
106
  testId: testIdWithStatus,
99
107
  truncateInline: truncateInline,
100
108
  hideIconLoadingSkeleton: hideIconLoadingSkeleton
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
15
15
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
16
16
  var PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "44.11.3",
18
+ packageVersion: "44.12.0",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -8,8 +8,12 @@ export interface FrameViewProps {
8
8
  /** A flag that determines whether the card is selected in edit mode. */
9
9
  isSelected?: boolean;
10
10
  link?: string;
11
+ /** Optional middle-click handler. */
12
+ onAuxClick?: React.EventHandler<React.MouseEvent>;
11
13
  /** The optional click handler */
12
14
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
15
+ /** Optional right-click handler. */
16
+ onContextMenu?: React.EventHandler<React.MouseEvent>;
13
17
  /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
14
18
  testId?: string;
15
19
  /** A flag that determines whether a card is truncated to 1 line */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type InlineCardResolvedViewFunctionalProps } from './types';
3
- export declare function InlineCardResolvedViewBase({ id, title, isSelected, isHovered, onClick, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
4
- export declare function InlineCardResolvedViewFunctionalWithRovoActions({ id, title, isSelected, isHovered, onClick, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
3
+ export declare function InlineCardResolvedViewBase({ id, title, isSelected, isHovered, onClick, onAuxClick, onContextMenu, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
4
+ export declare function InlineCardResolvedViewFunctionalWithRovoActions({ id, title, isSelected, isHovered, onClick, onAuxClick, onContextMenu, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
5
5
  export declare const InlineCardResolvedViewFunctional: React.FC<InlineCardResolvedViewFunctionalProps>;
@@ -24,8 +24,12 @@ export interface InlineCardResolvedViewProps {
24
24
  link?: string;
25
25
  /** The the optional lozenge that might represent the statux of the resource */
26
26
  lozenge?: LozengeProps;
27
+ /** Optional middle-click handler. */
28
+ onAuxClick?: React.EventHandler<React.MouseEvent>;
27
29
  /** The optional click handler */
28
30
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
31
+ /** Optional right-click handler. */
32
+ onContextMenu?: React.EventHandler<React.MouseEvent>;
29
33
  /** Enables showing a custom preview on hover of link */
30
34
  showHoverPreview?: boolean;
31
35
  /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
@@ -23,8 +23,12 @@ export interface InlineCardResolvedViewFunctionalProps {
23
23
  link?: string;
24
24
  /** The the optional lozenge that might represent the statux of the resource */
25
25
  lozenge?: LozengeProps;
26
+ /** Optional middle-click handler. */
27
+ onAuxClick?: React.EventHandler<React.MouseEvent>;
26
28
  /** The optional click handler */
27
29
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
30
+ /** Optional right-click handler. */
31
+ onContextMenu?: React.EventHandler<React.MouseEvent>;
28
32
  /** Enables showing a custom preview on hover of link */
29
33
  showHoverPreview?: boolean;
30
34
  /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
@@ -6,4 +6,4 @@ import { InlineCardResolvingView } from './ResolvingView';
6
6
  import { type InlineCardProps } from './types';
7
7
  import { InlineCardUnauthorizedView } from './UnauthorisedView';
8
8
  export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView, };
9
- export declare const InlineCard: ({ id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, truncateInline, hideIconLoadingSkeleton, }: InlineCardProps) => React.JSX.Element;
9
+ export declare const InlineCard: ({ id, url, cardState, handleAuthorize, handleFrameClick, handleFrameAuxClick, handleFrameContextMenu, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, truncateInline, hideIconLoadingSkeleton, }: InlineCardProps) => React.JSX.Element;
@@ -8,7 +8,11 @@ export type InlineCardProps = {
8
8
  actionOptions?: CardActionOptions;
9
9
  cardState: CardState;
10
10
  handleAuthorize: (() => void) | undefined;
11
+ /** Optional middle-click handler. */
12
+ handleFrameAuxClick?: EventHandler<MouseEvent>;
11
13
  handleFrameClick: EventHandler<MouseEvent | KeyboardEvent>;
14
+ /** Optional right-click handler. */
15
+ handleFrameContextMenu?: EventHandler<MouseEvent>;
12
16
  hideIconLoadingSkeleton?: boolean;
13
17
  hoverPreviewOptions?: HoverPreviewOptions;
14
18
  id: string;
@@ -8,8 +8,12 @@ export interface FrameViewProps {
8
8
  /** A flag that determines whether the card is selected in edit mode. */
9
9
  isSelected?: boolean;
10
10
  link?: string;
11
+ /** Optional middle-click handler. */
12
+ onAuxClick?: React.EventHandler<React.MouseEvent>;
11
13
  /** The optional click handler */
12
14
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
15
+ /** Optional right-click handler. */
16
+ onContextMenu?: React.EventHandler<React.MouseEvent>;
13
17
  /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
14
18
  testId?: string;
15
19
  /** A flag that determines whether a card is truncated to 1 line */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type InlineCardResolvedViewFunctionalProps } from './types';
3
- export declare function InlineCardResolvedViewBase({ id, title, isSelected, isHovered, onClick, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
4
- export declare function InlineCardResolvedViewFunctionalWithRovoActions({ id, title, isSelected, isHovered, onClick, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
3
+ export declare function InlineCardResolvedViewBase({ id, title, isSelected, isHovered, onClick, onAuxClick, onContextMenu, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
4
+ export declare function InlineCardResolvedViewFunctionalWithRovoActions({ id, title, isSelected, isHovered, onClick, onAuxClick, onContextMenu, icon, link, testId, titleTextColor, titlePrefix, showHoverPreview, hoverPreviewOptions, actionOptions, truncateInline, type, hideIconLoadingSkeleton, lozenge, }: InlineCardResolvedViewFunctionalProps): React.JSX.Element;
5
5
  export declare const InlineCardResolvedViewFunctional: React.FC<InlineCardResolvedViewFunctionalProps>;
@@ -24,8 +24,12 @@ export interface InlineCardResolvedViewProps {
24
24
  link?: string;
25
25
  /** The the optional lozenge that might represent the statux of the resource */
26
26
  lozenge?: LozengeProps;
27
+ /** Optional middle-click handler. */
28
+ onAuxClick?: React.EventHandler<React.MouseEvent>;
27
29
  /** The optional click handler */
28
30
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
31
+ /** Optional right-click handler. */
32
+ onContextMenu?: React.EventHandler<React.MouseEvent>;
29
33
  /** Enables showing a custom preview on hover of link */
30
34
  showHoverPreview?: boolean;
31
35
  /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
@@ -23,8 +23,12 @@ export interface InlineCardResolvedViewFunctionalProps {
23
23
  link?: string;
24
24
  /** The the optional lozenge that might represent the statux of the resource */
25
25
  lozenge?: LozengeProps;
26
+ /** Optional middle-click handler. */
27
+ onAuxClick?: React.EventHandler<React.MouseEvent>;
26
28
  /** The optional click handler */
27
29
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
30
+ /** Optional right-click handler. */
31
+ onContextMenu?: React.EventHandler<React.MouseEvent>;
28
32
  /** Enables showing a custom preview on hover of link */
29
33
  showHoverPreview?: boolean;
30
34
  /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
@@ -6,4 +6,4 @@ import { InlineCardResolvingView } from './ResolvingView';
6
6
  import { type InlineCardProps } from './types';
7
7
  import { InlineCardUnauthorizedView } from './UnauthorisedView';
8
8
  export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView, };
9
- export declare const InlineCard: ({ id, url, cardState, handleAuthorize, handleFrameClick, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, truncateInline, hideIconLoadingSkeleton, }: InlineCardProps) => React.JSX.Element;
9
+ export declare const InlineCard: ({ id, url, cardState, handleAuthorize, handleFrameClick, handleFrameAuxClick, handleFrameContextMenu, isSelected, isHovered, renderers, onResolve, onError, testId, inlinePreloaderStyle, showHoverPreview, hoverPreviewOptions, actionOptions, removeTextHighlightingFromTitle, resolvingPlaceholder, truncateInline, hideIconLoadingSkeleton, }: InlineCardProps) => React.JSX.Element;
@@ -8,7 +8,11 @@ export type InlineCardProps = {
8
8
  actionOptions?: CardActionOptions;
9
9
  cardState: CardState;
10
10
  handleAuthorize: (() => void) | undefined;
11
+ /** Optional middle-click handler. */
12
+ handleFrameAuxClick?: EventHandler<MouseEvent>;
11
13
  handleFrameClick: EventHandler<MouseEvent | KeyboardEvent>;
14
+ /** Optional right-click handler. */
15
+ handleFrameContextMenu?: EventHandler<MouseEvent>;
12
16
  hideIconLoadingSkeleton?: boolean;
13
17
  hoverPreviewOptions?: HoverPreviewOptions;
14
18
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "44.11.4",
3
+ "version": "44.12.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,12 +48,12 @@
48
48
  "@atlaskit/css": "^0.19.0",
49
49
  "@atlaskit/dropdown-menu": "^16.8.0",
50
50
  "@atlaskit/embedded-confluence": "^5.0.0",
51
- "@atlaskit/feature-gate-js-client": "^5.6.0",
51
+ "@atlaskit/feature-gate-js-client": "^5.7.0",
52
52
  "@atlaskit/flag": "^17.11.0",
53
53
  "@atlaskit/form": "^15.5.0",
54
54
  "@atlaskit/frontend-utilities": "^3.3.0",
55
55
  "@atlaskit/heading": "^5.4.0",
56
- "@atlaskit/icon": "^34.6.0",
56
+ "@atlaskit/icon": "^35.0.0",
57
57
  "@atlaskit/icon-file-type": "^7.0.0",
58
58
  "@atlaskit/icon-lab": "^6.9.0",
59
59
  "@atlaskit/image": "^3.0.0",
@@ -77,7 +77,7 @@
77
77
  "@atlaskit/popup": "^4.19.0",
78
78
  "@atlaskit/primitives": "^19.0.0",
79
79
  "@atlaskit/react-ufo": "^5.21.0",
80
- "@atlaskit/rovo-triggers": "^6.1.0",
80
+ "@atlaskit/rovo-triggers": "^6.2.0",
81
81
  "@atlaskit/section-message": "^8.12.0",
82
82
  "@atlaskit/select": "^21.12.0",
83
83
  "@atlaskit/spinner": "^19.1.0",
@@ -86,7 +86,7 @@
86
86
  "@atlaskit/textfield": "^8.3.0",
87
87
  "@atlaskit/theme": "^23.2.0",
88
88
  "@atlaskit/tile": "^1.1.0",
89
- "@atlaskit/tmp-editor-statsig": "^81.0.0",
89
+ "@atlaskit/tmp-editor-statsig": "^81.1.0",
90
90
  "@atlaskit/tokens": "^13.0.0",
91
91
  "@atlaskit/tooltip": "^22.2.0",
92
92
  "@atlaskit/ufo": "^0.5.0",
@@ -116,7 +116,7 @@
116
116
  "@af/visual-regression": "workspace:^",
117
117
  "@atlaskit/analytics-listeners": "^10.1.0",
118
118
  "@atlaskit/css-reset": "^7.4.0",
119
- "@atlaskit/media-test-helpers": "^41.0.0",
119
+ "@atlaskit/media-test-helpers": "^41.1.0",
120
120
  "@atlaskit/ssr": "workspace:^",
121
121
  "@atlassian/a11y-jest-testing": "^0.11.0",
122
122
  "@atlassian/analytics-tooling": "workspace:^",