@atlaskit/smart-card 44.10.0 → 44.11.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 (33) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/analytics.spec.yaml +12 -0
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/utils/click-helpers.js +14 -0
  5. package/dist/cjs/view/InlineCard/UnauthorisedView/index.compiled.css +8 -1
  6. package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +11 -3
  7. package/dist/cjs/view/InlineCard/common/action-button/index.js +5 -2
  8. package/dist/cjs/view/LinkUrl/HyperlinkResolver/index.js +37 -7
  9. package/dist/cjs/view/LinkUrl/index.js +1 -1
  10. package/dist/cjs/view/SmartLinkEvents/useSmartLinkEvents.js +8 -1
  11. package/dist/es2019/utils/analytics/analytics.js +1 -1
  12. package/dist/es2019/utils/click-helpers.js +8 -0
  13. package/dist/es2019/view/InlineCard/UnauthorisedView/index.compiled.css +8 -1
  14. package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +12 -4
  15. package/dist/es2019/view/InlineCard/common/action-button/index.js +6 -2
  16. package/dist/es2019/view/LinkUrl/HyperlinkResolver/index.js +38 -8
  17. package/dist/es2019/view/LinkUrl/index.js +1 -1
  18. package/dist/es2019/view/SmartLinkEvents/useSmartLinkEvents.js +7 -2
  19. package/dist/esm/utils/analytics/analytics.js +1 -1
  20. package/dist/esm/utils/click-helpers.js +8 -0
  21. package/dist/esm/view/InlineCard/UnauthorisedView/index.compiled.css +8 -1
  22. package/dist/esm/view/InlineCard/UnauthorisedView/index.js +12 -4
  23. package/dist/esm/view/InlineCard/common/action-button/index.js +6 -3
  24. package/dist/esm/view/LinkUrl/HyperlinkResolver/index.js +38 -8
  25. package/dist/esm/view/LinkUrl/index.js +1 -1
  26. package/dist/esm/view/SmartLinkEvents/useSmartLinkEvents.js +8 -1
  27. package/dist/types/common/analytics/generated/analytics.types.d.ts +2 -0
  28. package/dist/types/utils/click-helpers.d.ts +8 -0
  29. package/dist/types/view/SmartLinkEvents/useSmartLinkEvents.d.ts +7 -1
  30. package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +2 -0
  31. package/dist/types-ts4.5/utils/click-helpers.d.ts +8 -0
  32. package/dist/types-ts4.5/view/SmartLinkEvents/useSmartLinkEvents.d.ts +7 -1
  33. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 44.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a600b288d36ed`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a600b288d36ed) -
8
+ [ux] NAVX-4963 wrapping pre-auth social proof in `Pressable`
9
+
10
+ ## 44.11.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`38ea17de1355a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38ea17de1355a) -
15
+ Track middle- and right-clicks on third-party Smart Links rendered by `HyperlinkResolver`. Adds
16
+ optional `isAuxClick` / `isContextMenu` attributes to the `smartlinkClickAnalyticsWorkflows`
17
+ event, gated by the `linking_platform_track_non_primary_3p_clicks` experiment.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 44.10.0
4
24
 
5
25
  ### Minor Changes
@@ -906,3 +906,15 @@ events:
906
906
  required: true
907
907
  type: string
908
908
  description: The timestamp when the event was clicked
909
+ isAuxClick:
910
+ required: false
911
+ type: boolean
912
+ description:
913
+ True when the click was a middle-click (button === 1) captured via `onAuxClick`.
914
+ Behaviour is gated by the `linking_platform_track_non_primary_3p_clicks` Statsig experiment.
915
+ isContextMenu:
916
+ required: false
917
+ type: boolean
918
+ description:
919
+ True when the event was a right-click captured via `onContextMenu`. Behaviour is gated
920
+ by the `linking_platform_track_non_primary_3p_clicks` Statsig experiment.
@@ -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.9.11" || ''
14
+ packageVersion: "44.11.0" || ''
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAuxClick = void 0;
7
+ /**
8
+ * Returns true for genuine middle-clicks (button === 1).
9
+ * Filters out Windows right-clicks, which fire onAuxClick with button === 2
10
+ * in addition to onContextMenu, to prevent double-counting.
11
+ */
12
+ var isAuxClick = exports.isAuxClick = function isAuxClick(e) {
13
+ return e.button === 1;
14
+ };
@@ -1,6 +1,7 @@
1
1
 
2
2
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}._18m915vq{overflow-y:hidden}
3
3
  ._19bv12x7{padding-left:var(--ds-space-075,6px)}
4
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
4
5
  ._1bto1l2s{text-overflow:ellipsis}
5
6
  ._1e0c116y{display:inline-flex}
6
7
  ._1e0c1nu9{display:inline}
@@ -9,13 +10,19 @@
9
10
  ._2hwx1b66{margin-right:var(--ds-space-050,4px)}
10
11
  ._4cvr1h6o{align-items:center}
11
12
  ._bfhk1dpa{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
13
+ ._bfhk1j28{background-color:transparent}
12
14
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
15
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
13
16
  ._k48pwu06{font-weight:var(--ds-font-weight-bold,653)}
14
17
  ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
18
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
15
19
  ._o5721q9c{white-space:nowrap}
16
20
  ._p12f1osq{max-width:100%}
17
21
  ._s7n4t94y{vertical-align:1px}
18
22
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
19
23
  ._u5f312x7{padding-right:var(--ds-space-075,6px)}
24
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
20
25
  ._vchhusvi{box-sizing:border-box}
21
- ._y3gn18uv{text-align:initial}
26
+ ._y3gn18uv{text-align:initial}
27
+ ._irr3plhp:hover{background-color:var(--ds-background-neutral-hovered,#0b120e24)}
28
+ ._1di61gdz:active{background-color:var(--ds-background-neutral-pressed,#080f214a)}
@@ -39,8 +39,9 @@ var SOCIAL_PROOF_TRAIT_NAME = 'sl_3p_connected_providers_site_pct';
39
39
  var socialProofPillStyles = {
40
40
  strong: "_k48pwu06",
41
41
  inlineContainer: "_1e0c116y _4cvr1h6o",
42
- root: "_2rko12b0 _1e0c1nu9 _4cvr1h6o _vchhusvi _p12f1osq _bfhk1dpa _syazazsu _y3gn18uv _1wybtjj4 _s7n4t94y _ca0qv77o _n3tdv77o _u5f312x7 _19bv12x7 _2hwx1b66",
43
- label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c"
42
+ root: "_2rko12b0 _1e0c1nu9 _4cvr1h6o _vchhusvi _p12f1osq _bfhk1dpa _syazazsu _y3gn18uv _1wybtjj4 _s7n4t94y _ca0qv77o _n3tdv77o _u5f312x7 _19bv12x7 _2hwx1b66 _irr3plhp _1di61gdz",
43
+ label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c",
44
+ button: "_bfhk1j28 _u5f3ze3t _19bvze3t _ca0qze3t _n3tdze3t"
44
45
  };
45
46
 
46
47
  /**
@@ -103,7 +104,7 @@ var UnauthorisedConnectWithSocialProof = function UnauthorisedConnectWithSocialP
103
104
  /*#__PURE__*/
104
105
  // Unlikely case, but possible from TS standpoint.
105
106
  _react.default.createElement(_reactIntl.FormattedMessage, _messages.messages.social_proof_inline_cta_tag_low_no_context);
106
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showSocialProofPill ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
107
+ var buttonContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showSocialProofPill ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
107
108
  as: "span",
108
109
  xcss: socialProofPillStyles.root,
109
110
  testId: "".concat(testId, "-social-proof-tag")
@@ -120,6 +121,13 @@ var UnauthorisedConnectWithSocialProof = function UnauthorisedConnectWithSocialP
120
121
  context: context
121
122
  }
122
123
  }))));
124
+ return showSocialProofPill ? /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
125
+ onClick: onConnectClick,
126
+ style: {
127
+ font: "inherit"
128
+ },
129
+ xcss: socialProofPillStyles.button
130
+ }, buttonContent) : buttonContent;
123
131
  };
124
132
  var InlineCardUnauthorizedView = exports.InlineCardUnauthorizedView = function InlineCardUnauthorizedView(_ref2) {
125
133
  var url = _ref2.url,
@@ -15,7 +15,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
15
15
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
17
  var _compiled = require("@atlaskit/primitives/compiled");
18
- var _excluded = ["children", "isDisabled", "viewType", "isSlimDesign"];
18
+ var _excluded = ["children", "isDisabled", "viewType", "isSlimDesign"],
19
+ _excluded2 = ["onClick"];
19
20
  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); }
20
21
  var styles = {
21
22
  button: "_1e0c1bgi",
@@ -41,7 +42,9 @@ var ActionButton = exports.ActionButton = /*#__PURE__*/(0, _react.forwardRef)(fu
41
42
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
42
43
  var shouldUseUnauthorisedSlimStyle = viewType === 'unauthorised' && isSlimDesign && (0, _platformFeatureFlags.fg)('platform_sl_3p_preauth_soc_proof_inline_killswitch');
43
44
  if (shouldUseUnauthorisedSlimStyle && !isDisabled) {
44
- return /*#__PURE__*/React.createElement(_compiled.Pressable, (0, _extends2.default)({}, props, {
45
+ var onClick = props.onClick,
46
+ boxProps = (0, _objectWithoutProperties2.default)(props, _excluded2);
47
+ return /*#__PURE__*/React.createElement(_compiled.Box, (0, _extends2.default)({}, boxProps, {
45
48
  ref: ref,
46
49
  style: {
47
50
  font: "inherit"
@@ -12,15 +12,19 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var _reactErrorBoundary = require("react-error-boundary");
13
13
  var _reactIntl = require("react-intl");
14
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
16
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
15
17
  var _helpers = require("../../../state/helpers");
16
18
  var _useResolveHyperlink2 = _interopRequireDefault(require("../../../state/hooks/use-resolve-hyperlink"));
17
19
  var _useResolveHyperlinkValidator = _interopRequireDefault(require("../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator"));
18
20
  var _SmartLinkAnalyticsContext = require("../../../utils/analytics/SmartLinkAnalyticsContext");
21
+ var _clickHelpers = require("../../../utils/click-helpers");
19
22
  var _intlProvider = _interopRequireDefault(require("../../common/intl-provider"));
20
23
  var _useSmartLinkEvents = require("../../SmartLinkEvents/useSmartLinkEvents");
21
24
  var _Hyperlink = _interopRequireDefault(require("../Hyperlink"));
22
25
  var _excluded = ["onClick"];
23
26
  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); }
27
+ var TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
24
28
  var HyperlinkFallbackComponent = function HyperlinkFallbackComponent() {
25
29
  return null;
26
30
  };
@@ -45,17 +49,43 @@ var HyperlinkWithSmartLinkResolverInner = function HyperlinkWithSmartLinkResolve
45
49
  var fire3PClickEvent = (0, _platformFeatureFlags.fg)('platform_smartlink_3pclick_analytics') ?
46
50
  // eslint-disable-next-line react-hooks/rules-of-hooks
47
51
  (0, _useSmartLinkEvents.useFire3PWorkflowsClickEvent)(firstPartyIdentifier, thirdPartyARI) : undefined;
52
+
53
+ // Shared scope guard for all 3P-click handlers.
54
+ var shouldFire3PClickEvent = (state === null || state === void 0 ? void 0 : state.status) === 'resolved' && fire3PClickEvent && (0, _platformFeatureFlags.fg)('platform_smartlink_3pclick_analytics');
48
55
  var onClick = (0, _react.useCallback)(function (e) {
49
- // Only fire the event if the feature flag is on and other conditions are met
50
- if ((state === null || state === void 0 ? void 0 : state.status) === 'resolved' && (e === null || e === void 0 ? void 0 : e.button) === 0 && fire3PClickEvent && (0, _platformFeatureFlags.fg)('platform_smartlink_3pclick_analytics')) {
51
- // 0 taken from button state representation -
52
- // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
53
- fire3PClickEvent();
56
+ // button === 0 is left-click, see
57
+ // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
58
+ if (shouldFire3PClickEvent && (e === null || e === void 0 ? void 0 : e.button) === 0) {
59
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent();
54
60
  }
55
61
  onClickCallback === null || onClickCallback === void 0 || onClickCallback(e);
56
- }, [onClickCallback, fire3PClickEvent, state === null || state === void 0 ? void 0 : state.status]);
62
+ }, [onClickCallback, fire3PClickEvent, shouldFire3PClickEvent]);
63
+
64
+ // Fire experiment exposure once per surface mount, not on every re-render.
65
+ (0, _react.useEffect)(function () {
66
+ if (shouldFire3PClickEvent) {
67
+ (0, _expValEquals.expValEquals)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
68
+ }
69
+ }, [shouldFire3PClickEvent]);
70
+ var onAuxClick = (0, _react.useCallback)(function (e) {
71
+ // isAuxClick guards against Windows right-clicks firing onAuxClick with button === 2.
72
+ if ((0, _clickHelpers.isAuxClick)(e) && shouldFire3PClickEvent && (0, _expValEqualsNoExposure.expValEqualsNoExposure)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
73
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
74
+ isAuxClick: true
75
+ });
76
+ }
77
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
78
+ var onContextMenu = (0, _react.useCallback)(function (_e) {
79
+ if (shouldFire3PClickEvent && (0, _expValEqualsNoExposure.expValEqualsNoExposure)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
80
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
81
+ isContextMenu: true
82
+ });
83
+ }
84
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
57
85
  return /*#__PURE__*/_react.default.createElement(_Hyperlink.default, (0, _extends2.default)({}, props, {
58
- onClick: onClick
86
+ onClick: onClick,
87
+ onAuxClick: onAuxClick,
88
+ onContextMenu: onContextMenu
59
89
  }));
60
90
  };
61
91
  var HyperlinkWithSmartLinkResolver = exports.HyperlinkWithSmartLinkResolver = (0, _reactErrorBoundary.withErrorBoundary)(withValidator((0, _reactIntl.injectIntl)((0, _intlProvider.default)(HyperlinkWithSmartLinkResolverInner), {
@@ -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.9.11",
25
+ packageVersion: "44.11.0",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -22,6 +22,11 @@ function useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) {
22
22
  var _useAnalyticsEventsNe = (0, _analyticsNext.useAnalyticsEvents)(),
23
23
  createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
24
24
  return function () {
25
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
26
+ _ref$isAuxClick = _ref.isAuxClick,
27
+ isAuxClick = _ref$isAuxClick === void 0 ? false : _ref$isAuxClick,
28
+ _ref$isContextMenu = _ref.isContextMenu,
29
+ isContextMenu = _ref$isContextMenu === void 0 ? false : _ref$isContextMenu;
25
30
  var smartlinkClickAnalyticsEvent = createAnalyticsEvent({
26
31
  action: 'clicked',
27
32
  actionSubject: 'smartLink',
@@ -29,7 +34,9 @@ function useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) {
29
34
  eventType: 'ui',
30
35
  attributes: {
31
36
  eventName: 'smartLinkClickAnalyticsThirdPartyWorkflows',
32
- firstPartyIdentifier: firstPartyIdentifier
37
+ firstPartyIdentifier: firstPartyIdentifier,
38
+ isAuxClick: isAuxClick,
39
+ isContextMenu: isContextMenu
33
40
  },
34
41
  nonPrivacySafeAttributes: {
35
42
  thirdPartyARI: thirdPartyARI
@@ -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.9.11" || ''
5
+ packageVersion: "44.11.0" || ''
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns true for genuine middle-clicks (button === 1).
3
+ * Filters out Windows right-clicks, which fire onAuxClick with button === 2
4
+ * in addition to onContextMenu, to prevent double-counting.
5
+ */
6
+ export const isAuxClick = e => {
7
+ return e.button === 1;
8
+ };
@@ -1,6 +1,7 @@
1
1
 
2
2
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}._18m915vq{overflow-y:hidden}
3
3
  ._19bv12x7{padding-left:var(--ds-space-075,6px)}
4
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
4
5
  ._1bto1l2s{text-overflow:ellipsis}
5
6
  ._1e0c116y{display:inline-flex}
6
7
  ._1e0c1nu9{display:inline}
@@ -9,13 +10,19 @@
9
10
  ._2hwx1b66{margin-right:var(--ds-space-050,4px)}
10
11
  ._4cvr1h6o{align-items:center}
11
12
  ._bfhk1dpa{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
13
+ ._bfhk1j28{background-color:transparent}
12
14
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
15
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
13
16
  ._k48pwu06{font-weight:var(--ds-font-weight-bold,653)}
14
17
  ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
18
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
15
19
  ._o5721q9c{white-space:nowrap}
16
20
  ._p12f1osq{max-width:100%}
17
21
  ._s7n4t94y{vertical-align:1px}
18
22
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
19
23
  ._u5f312x7{padding-right:var(--ds-space-075,6px)}
24
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
20
25
  ._vchhusvi{box-sizing:border-box}
21
- ._y3gn18uv{text-align:initial}
26
+ ._y3gn18uv{text-align:initial}
27
+ ._irr3plhp:hover{background-color:var(--ds-background-neutral-hovered,#0b120e24)}
28
+ ._1di61gdz:active{background-color:var(--ds-background-neutral-pressed,#080f214a)}
@@ -7,7 +7,7 @@ import { FormattedMessage } from 'react-intl';
7
7
  import { di } from 'react-magnetic-di';
8
8
  import LockLockedIcon from '@atlaskit/icon/core/lock-locked';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Box } from '@atlaskit/primitives/compiled';
10
+ import { Box, Pressable } from '@atlaskit/primitives/compiled';
11
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
12
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
13
13
  import { messages } from '../../../messages';
@@ -32,8 +32,9 @@ const SOCIAL_PROOF_TRAIT_NAME = 'sl_3p_connected_providers_site_pct';
32
32
  const socialProofPillStyles = {
33
33
  strong: "_k48pwu06",
34
34
  inlineContainer: "_1e0c116y _4cvr1h6o",
35
- root: "_2rko12b0 _1e0c1nu9 _4cvr1h6o _vchhusvi _p12f1osq _bfhk1dpa _syazazsu _y3gn18uv _1wybtjj4 _s7n4t94y _ca0qv77o _n3tdv77o _u5f312x7 _19bv12x7 _2hwx1b66",
36
- label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c"
35
+ root: "_2rko12b0 _1e0c1nu9 _4cvr1h6o _vchhusvi _p12f1osq _bfhk1dpa _syazazsu _y3gn18uv _1wybtjj4 _s7n4t94y _ca0qv77o _n3tdv77o _u5f312x7 _19bv12x7 _2hwx1b66 _irr3plhp _1di61gdz",
36
+ label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c",
37
+ button: "_bfhk1j28 _u5f3ze3t _19bvze3t _ca0qze3t _n3tdze3t"
37
38
  };
38
39
 
39
40
  /**
@@ -95,7 +96,7 @@ const UnauthorisedConnectWithSocialProof = ({
95
96
  /*#__PURE__*/
96
97
  // Unlikely case, but possible from TS standpoint.
97
98
  React.createElement(FormattedMessage, messages.social_proof_inline_cta_tag_low_no_context);
98
- return /*#__PURE__*/React.createElement(React.Fragment, null, showSocialProofPill ? /*#__PURE__*/React.createElement(Box, {
99
+ const buttonContent = /*#__PURE__*/React.createElement(React.Fragment, null, showSocialProofPill ? /*#__PURE__*/React.createElement(Box, {
99
100
  as: "span",
100
101
  xcss: socialProofPillStyles.root,
101
102
  testId: `${testId}-social-proof-tag`
@@ -112,6 +113,13 @@ const UnauthorisedConnectWithSocialProof = ({
112
113
  context
113
114
  }
114
115
  }))));
116
+ return showSocialProofPill ? /*#__PURE__*/React.createElement(Pressable, {
117
+ onClick: onConnectClick,
118
+ style: {
119
+ font: `inherit`
120
+ },
121
+ xcss: socialProofPillStyles.button
122
+ }, buttonContent) : buttonContent;
115
123
  };
116
124
  export const InlineCardUnauthorizedView = ({
117
125
  url,
@@ -5,7 +5,7 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { forwardRef } from 'react';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
- import { Pressable } from '@atlaskit/primitives/compiled';
8
+ import { Pressable, Box } from '@atlaskit/primitives/compiled';
9
9
  const styles = {
10
10
  button: "_1e0c1bgi",
11
11
  innerContainer: "_1e0c1nu9 _1y1m1u8q _16d9qvcn _k48p1wq8 _19bv12x7 _ca0qv77o _n3tdv77o _u5f312x7 _y3gn18uv _o5721btx _1nmz9jpi",
@@ -29,7 +29,11 @@ export const ActionButton = /*#__PURE__*/forwardRef(({
29
29
  }, ref) => {
30
30
  const shouldUseUnauthorisedSlimStyle = viewType === 'unauthorised' && isSlimDesign && fg('platform_sl_3p_preauth_soc_proof_inline_killswitch');
31
31
  if (shouldUseUnauthorisedSlimStyle && !isDisabled) {
32
- return /*#__PURE__*/React.createElement(Pressable, _extends({}, props, {
32
+ const {
33
+ onClick,
34
+ ...boxProps
35
+ } = props;
36
+ return /*#__PURE__*/React.createElement(Box, _extends({}, boxProps, {
33
37
  ref: ref,
34
38
  style: {
35
39
  font: `inherit`
@@ -1,15 +1,19 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useCallback } from 'react';
2
+ import React, { useCallback, useEffect } from 'react';
3
3
  import { withErrorBoundary as withReactErrorBoundary } from 'react-error-boundary';
4
4
  import { injectIntl } from 'react-intl';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
7
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
6
8
  import { getFirstPartyIdentifier, getThirdPartyARI } from '../../../state/helpers';
7
9
  import useResolveHyperlink from '../../../state/hooks/use-resolve-hyperlink';
8
10
  import useResolveHyperlinkValidator from '../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator';
9
11
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
12
+ import { isAuxClick } from '../../../utils/click-helpers';
10
13
  import withIntlProvider from '../../common/intl-provider';
11
14
  import { useFire3PWorkflowsClickEvent } from '../../SmartLinkEvents/useSmartLinkEvents';
12
15
  import Hyperlink from '../Hyperlink';
16
+ const TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
13
17
  const HyperlinkFallbackComponent = () => null;
14
18
  const withValidator = (Component, DefaultComponent) => props => {
15
19
  const shouldResolveHyperlink = useResolveHyperlinkValidator(props === null || props === void 0 ? void 0 : props.href);
@@ -32,17 +36,43 @@ const HyperlinkWithSmartLinkResolverInner = ({
32
36
  const fire3PClickEvent = fg('platform_smartlink_3pclick_analytics') ?
33
37
  // eslint-disable-next-line react-hooks/rules-of-hooks
34
38
  useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
39
+
40
+ // Shared scope guard for all 3P-click handlers.
41
+ const shouldFire3PClickEvent = (state === null || state === void 0 ? void 0 : state.status) === 'resolved' && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics');
35
42
  const onClick = useCallback(e => {
36
- // Only fire the event if the feature flag is on and other conditions are met
37
- if ((state === null || state === void 0 ? void 0 : state.status) === 'resolved' && (e === null || e === void 0 ? void 0 : e.button) === 0 && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics')) {
38
- // 0 taken from button state representation -
39
- // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
40
- fire3PClickEvent();
43
+ // button === 0 is left-click, see
44
+ // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
45
+ if (shouldFire3PClickEvent && (e === null || e === void 0 ? void 0 : e.button) === 0) {
46
+ fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent();
41
47
  }
42
48
  onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback(e);
43
- }, [onClickCallback, fire3PClickEvent, state === null || state === void 0 ? void 0 : state.status]);
49
+ }, [onClickCallback, fire3PClickEvent, shouldFire3PClickEvent]);
50
+
51
+ // Fire experiment exposure once per surface mount, not on every re-render.
52
+ useEffect(() => {
53
+ if (shouldFire3PClickEvent) {
54
+ expValEquals(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
55
+ }
56
+ }, [shouldFire3PClickEvent]);
57
+ const onAuxClick = useCallback(e => {
58
+ // isAuxClick guards against Windows right-clicks firing onAuxClick with button === 2.
59
+ if (isAuxClick(e) && shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
60
+ fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
61
+ isAuxClick: true
62
+ });
63
+ }
64
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
65
+ const onContextMenu = useCallback(_e => {
66
+ if (shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
67
+ fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
68
+ isContextMenu: true
69
+ });
70
+ }
71
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
44
72
  return /*#__PURE__*/React.createElement(Hyperlink, _extends({}, props, {
45
- onClick: onClick
73
+ onClick: onClick,
74
+ onAuxClick: onAuxClick,
75
+ onContextMenu: onContextMenu
46
76
  }));
47
77
  };
48
78
  export const HyperlinkWithSmartLinkResolver = withReactErrorBoundary(withValidator(injectIntl(withIntlProvider(HyperlinkWithSmartLinkResolverInner), {
@@ -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.9.11",
15
+ packageVersion: "44.11.0",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -13,7 +13,10 @@ export function useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI
13
13
  const {
14
14
  createAnalyticsEvent
15
15
  } = useAnalyticsEventsNext();
16
- return () => {
16
+ return ({
17
+ isAuxClick = false,
18
+ isContextMenu = false
19
+ } = {}) => {
17
20
  const smartlinkClickAnalyticsEvent = createAnalyticsEvent({
18
21
  action: 'clicked',
19
22
  actionSubject: 'smartLink',
@@ -21,7 +24,9 @@ export function useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI
21
24
  eventType: 'ui',
22
25
  attributes: {
23
26
  eventName: 'smartLinkClickAnalyticsThirdPartyWorkflows',
24
- firstPartyIdentifier: firstPartyIdentifier
27
+ firstPartyIdentifier: firstPartyIdentifier,
28
+ isAuxClick,
29
+ isContextMenu
25
30
  },
26
31
  nonPrivacySafeAttributes: {
27
32
  thirdPartyARI: thirdPartyARI
@@ -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.9.11" || ''
7
+ packageVersion: "44.11.0" || ''
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns true for genuine middle-clicks (button === 1).
3
+ * Filters out Windows right-clicks, which fire onAuxClick with button === 2
4
+ * in addition to onContextMenu, to prevent double-counting.
5
+ */
6
+ export var isAuxClick = function isAuxClick(e) {
7
+ return e.button === 1;
8
+ };
@@ -1,6 +1,7 @@
1
1
 
2
2
  ._2rko12b0{border-radius:var(--ds-radius-small,4px)}._18m915vq{overflow-y:hidden}
3
3
  ._19bv12x7{padding-left:var(--ds-space-075,6px)}
4
+ ._19bvze3t{padding-left:var(--ds-space-0,0)}
4
5
  ._1bto1l2s{text-overflow:ellipsis}
5
6
  ._1e0c116y{display:inline-flex}
6
7
  ._1e0c1nu9{display:inline}
@@ -9,13 +10,19 @@
9
10
  ._2hwx1b66{margin-right:var(--ds-space-050,4px)}
10
11
  ._4cvr1h6o{align-items:center}
11
12
  ._bfhk1dpa{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
13
+ ._bfhk1j28{background-color:transparent}
12
14
  ._ca0qv77o{padding-top:var(--ds-space-025,2px)}
15
+ ._ca0qze3t{padding-top:var(--ds-space-0,0)}
13
16
  ._k48pwu06{font-weight:var(--ds-font-weight-bold,653)}
14
17
  ._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
18
+ ._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
15
19
  ._o5721q9c{white-space:nowrap}
16
20
  ._p12f1osq{max-width:100%}
17
21
  ._s7n4t94y{vertical-align:1px}
18
22
  ._syazazsu{color:var(--ds-text-subtle,#505258)}
19
23
  ._u5f312x7{padding-right:var(--ds-space-075,6px)}
24
+ ._u5f3ze3t{padding-right:var(--ds-space-0,0)}
20
25
  ._vchhusvi{box-sizing:border-box}
21
- ._y3gn18uv{text-align:initial}
26
+ ._y3gn18uv{text-align:initial}
27
+ ._irr3plhp:hover{background-color:var(--ds-background-neutral-hovered,#0b120e24)}
28
+ ._1di61gdz:active{background-color:var(--ds-background-neutral-pressed,#080f214a)}
@@ -7,7 +7,7 @@ import { FormattedMessage } from 'react-intl';
7
7
  import { di } from 'react-magnetic-di';
8
8
  import LockLockedIcon from '@atlaskit/icon/core/lock-locked';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Box } from '@atlaskit/primitives/compiled';
10
+ import { Box, Pressable } from '@atlaskit/primitives/compiled';
11
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
12
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
13
13
  import { messages } from '../../../messages';
@@ -32,8 +32,9 @@ var SOCIAL_PROOF_TRAIT_NAME = 'sl_3p_connected_providers_site_pct';
32
32
  var socialProofPillStyles = {
33
33
  strong: "_k48pwu06",
34
34
  inlineContainer: "_1e0c116y _4cvr1h6o",
35
- root: "_2rko12b0 _1e0c1nu9 _4cvr1h6o _vchhusvi _p12f1osq _bfhk1dpa _syazazsu _y3gn18uv _1wybtjj4 _s7n4t94y _ca0qv77o _n3tdv77o _u5f312x7 _19bv12x7 _2hwx1b66",
36
- label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c"
35
+ root: "_2rko12b0 _1e0c1nu9 _4cvr1h6o _vchhusvi _p12f1osq _bfhk1dpa _syazazsu _y3gn18uv _1wybtjj4 _s7n4t94y _ca0qv77o _n3tdv77o _u5f312x7 _19bv12x7 _2hwx1b66 _irr3plhp _1di61gdz",
36
+ label: "_1reo15vq _18m915vq _1bto1l2s _o5721q9c",
37
+ button: "_bfhk1j28 _u5f3ze3t _19bvze3t _ca0qze3t _n3tdze3t"
37
38
  };
38
39
 
39
40
  /**
@@ -96,7 +97,7 @@ var UnauthorisedConnectWithSocialProof = function UnauthorisedConnectWithSocialP
96
97
  /*#__PURE__*/
97
98
  // Unlikely case, but possible from TS standpoint.
98
99
  React.createElement(FormattedMessage, messages.social_proof_inline_cta_tag_low_no_context);
99
- return /*#__PURE__*/React.createElement(React.Fragment, null, showSocialProofPill ? /*#__PURE__*/React.createElement(Box, {
100
+ var buttonContent = /*#__PURE__*/React.createElement(React.Fragment, null, showSocialProofPill ? /*#__PURE__*/React.createElement(Box, {
100
101
  as: "span",
101
102
  xcss: socialProofPillStyles.root,
102
103
  testId: "".concat(testId, "-social-proof-tag")
@@ -113,6 +114,13 @@ var UnauthorisedConnectWithSocialProof = function UnauthorisedConnectWithSocialP
113
114
  context: context
114
115
  }
115
116
  }))));
117
+ return showSocialProofPill ? /*#__PURE__*/React.createElement(Pressable, {
118
+ onClick: onConnectClick,
119
+ style: {
120
+ font: "inherit"
121
+ },
122
+ xcss: socialProofPillStyles.button
123
+ }, buttonContent) : buttonContent;
116
124
  };
117
125
  export var InlineCardUnauthorizedView = function InlineCardUnauthorizedView(_ref2) {
118
126
  var url = _ref2.url,
@@ -1,13 +1,14 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "isDisabled", "viewType", "isSlimDesign"];
4
+ var _excluded = ["children", "isDisabled", "viewType", "isSlimDesign"],
5
+ _excluded2 = ["onClick"];
5
6
  import "./index.compiled.css";
6
7
  import * as React from 'react';
7
8
  import { ax, ix } from "@compiled/react/runtime";
8
9
  import { forwardRef } from 'react';
9
10
  import { fg } from '@atlaskit/platform-feature-flags';
10
- import { Pressable } from '@atlaskit/primitives/compiled';
11
+ import { Pressable, Box } from '@atlaskit/primitives/compiled';
11
12
  var styles = {
12
13
  button: "_1e0c1bgi",
13
14
  innerContainer: "_1e0c1nu9 _1y1m1u8q _16d9qvcn _k48p1wq8 _19bv12x7 _ca0qv77o _n3tdv77o _u5f312x7 _y3gn18uv _o5721btx _1nmz9jpi",
@@ -32,7 +33,9 @@ export var ActionButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
32
33
  props = _objectWithoutProperties(_ref, _excluded);
33
34
  var shouldUseUnauthorisedSlimStyle = viewType === 'unauthorised' && isSlimDesign && fg('platform_sl_3p_preauth_soc_proof_inline_killswitch');
34
35
  if (shouldUseUnauthorisedSlimStyle && !isDisabled) {
35
- return /*#__PURE__*/React.createElement(Pressable, _extends({}, props, {
36
+ var onClick = props.onClick,
37
+ boxProps = _objectWithoutProperties(props, _excluded2);
38
+ return /*#__PURE__*/React.createElement(Box, _extends({}, boxProps, {
36
39
  ref: ref,
37
40
  style: {
38
41
  font: "inherit"
@@ -1,17 +1,21 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  var _excluded = ["onClick"];
4
- import React, { useCallback } from 'react';
4
+ import React, { useCallback, useEffect } from 'react';
5
5
  import { withErrorBoundary as withReactErrorBoundary } from 'react-error-boundary';
6
6
  import { injectIntl } from 'react-intl';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
8
10
  import { getFirstPartyIdentifier, getThirdPartyARI } from '../../../state/helpers';
9
11
  import useResolveHyperlink from '../../../state/hooks/use-resolve-hyperlink';
10
12
  import useResolveHyperlinkValidator from '../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator';
11
13
  import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
14
+ import { isAuxClick } from '../../../utils/click-helpers';
12
15
  import withIntlProvider from '../../common/intl-provider';
13
16
  import { useFire3PWorkflowsClickEvent } from '../../SmartLinkEvents/useSmartLinkEvents';
14
17
  import Hyperlink from '../Hyperlink';
18
+ var TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
15
19
  var HyperlinkFallbackComponent = function HyperlinkFallbackComponent() {
16
20
  return null;
17
21
  };
@@ -36,17 +40,43 @@ var HyperlinkWithSmartLinkResolverInner = function HyperlinkWithSmartLinkResolve
36
40
  var fire3PClickEvent = fg('platform_smartlink_3pclick_analytics') ?
37
41
  // eslint-disable-next-line react-hooks/rules-of-hooks
38
42
  useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI) : undefined;
43
+
44
+ // Shared scope guard for all 3P-click handlers.
45
+ var shouldFire3PClickEvent = (state === null || state === void 0 ? void 0 : state.status) === 'resolved' && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics');
39
46
  var onClick = useCallback(function (e) {
40
- // Only fire the event if the feature flag is on and other conditions are met
41
- if ((state === null || state === void 0 ? void 0 : state.status) === 'resolved' && (e === null || e === void 0 ? void 0 : e.button) === 0 && fire3PClickEvent && fg('platform_smartlink_3pclick_analytics')) {
42
- // 0 taken from button state representation -
43
- // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
44
- fire3PClickEvent();
47
+ // button === 0 is left-click, see
48
+ // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
49
+ if (shouldFire3PClickEvent && (e === null || e === void 0 ? void 0 : e.button) === 0) {
50
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent();
45
51
  }
46
52
  onClickCallback === null || onClickCallback === void 0 || onClickCallback(e);
47
- }, [onClickCallback, fire3PClickEvent, state === null || state === void 0 ? void 0 : state.status]);
53
+ }, [onClickCallback, fire3PClickEvent, shouldFire3PClickEvent]);
54
+
55
+ // Fire experiment exposure once per surface mount, not on every re-render.
56
+ useEffect(function () {
57
+ if (shouldFire3PClickEvent) {
58
+ expValEquals(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
59
+ }
60
+ }, [shouldFire3PClickEvent]);
61
+ var onAuxClick = useCallback(function (e) {
62
+ // isAuxClick guards against Windows right-clicks firing onAuxClick with button === 2.
63
+ if (isAuxClick(e) && shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
64
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
65
+ isAuxClick: true
66
+ });
67
+ }
68
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
69
+ var onContextMenu = useCallback(function (_e) {
70
+ if (shouldFire3PClickEvent && expValEqualsNoExposure(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true)) {
71
+ fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
72
+ isContextMenu: true
73
+ });
74
+ }
75
+ }, [fire3PClickEvent, shouldFire3PClickEvent]);
48
76
  return /*#__PURE__*/React.createElement(Hyperlink, _extends({}, props, {
49
- onClick: onClick
77
+ onClick: onClick,
78
+ onAuxClick: onAuxClick,
79
+ onContextMenu: onContextMenu
50
80
  }));
51
81
  };
52
82
  export var HyperlinkWithSmartLinkResolver = withReactErrorBoundary(withValidator(injectIntl(withIntlProvider(HyperlinkWithSmartLinkResolverInner), {
@@ -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.9.11",
18
+ packageVersion: "44.11.0",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -15,6 +15,11 @@ export function useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI
15
15
  var _useAnalyticsEventsNe = useAnalyticsEventsNext(),
16
16
  createAnalyticsEvent = _useAnalyticsEventsNe.createAnalyticsEvent;
17
17
  return function () {
18
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
19
+ _ref$isAuxClick = _ref.isAuxClick,
20
+ isAuxClick = _ref$isAuxClick === void 0 ? false : _ref$isAuxClick,
21
+ _ref$isContextMenu = _ref.isContextMenu,
22
+ isContextMenu = _ref$isContextMenu === void 0 ? false : _ref$isContextMenu;
18
23
  var smartlinkClickAnalyticsEvent = createAnalyticsEvent({
19
24
  action: 'clicked',
20
25
  actionSubject: 'smartLink',
@@ -22,7 +27,9 @@ export function useFire3PWorkflowsClickEvent(firstPartyIdentifier, thirdPartyARI
22
27
  eventType: 'ui',
23
28
  attributes: {
24
29
  eventName: 'smartLinkClickAnalyticsThirdPartyWorkflows',
25
- firstPartyIdentifier: firstPartyIdentifier
30
+ firstPartyIdentifier: firstPartyIdentifier,
31
+ isAuxClick: isAuxClick,
32
+ isContextMenu: isContextMenu
26
33
  },
27
34
  nonPrivacySafeAttributes: {
28
35
  thirdPartyARI: thirdPartyARI
@@ -276,6 +276,8 @@ export type SmartLinkClickedSmartlinkClickAnalyticsWorkflowsAttributesType = {
276
276
  eventName: string;
277
277
  firstPartyIdentifier?: string | null;
278
278
  clickedAt: string;
279
+ isAuxClick?: boolean;
280
+ isContextMenu?: boolean;
279
281
  };
280
282
  export type AnalyticsEventAttributes = {
281
283
  /**
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns true for genuine middle-clicks (button === 1).
3
+ * Filters out Windows right-clicks, which fire onAuxClick with button === 2
4
+ * in addition to onContextMenu, to prevent double-counting.
5
+ */
6
+ export declare const isAuxClick: (e: {
7
+ button: number;
8
+ }) => boolean;
@@ -1,3 +1,9 @@
1
1
  import { SmartLinkEvents } from '../../utils/analytics/analytics';
2
2
  export declare function useSmartLinkEvents(): SmartLinkEvents;
3
- export declare function useFire3PWorkflowsClickEvent(firstPartyIdentifier: string | undefined, thirdPartyARI: string | undefined): () => void;
3
+ export type Fire3PWorkflowsClickEventOptions = {
4
+ /** True for middle-clicks (button === 1) captured via `onAuxClick`. */
5
+ isAuxClick?: boolean;
6
+ /** True for right-clicks captured via `onContextMenu`. */
7
+ isContextMenu?: boolean;
8
+ };
9
+ export declare function useFire3PWorkflowsClickEvent(firstPartyIdentifier: string | undefined, thirdPartyARI: string | undefined): ({ isAuxClick, isContextMenu, }?: Fire3PWorkflowsClickEventOptions) => void;
@@ -276,6 +276,8 @@ export type SmartLinkClickedSmartlinkClickAnalyticsWorkflowsAttributesType = {
276
276
  eventName: string;
277
277
  firstPartyIdentifier?: string | null;
278
278
  clickedAt: string;
279
+ isAuxClick?: boolean;
280
+ isContextMenu?: boolean;
279
281
  };
280
282
  export type AnalyticsEventAttributes = {
281
283
  /**
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Returns true for genuine middle-clicks (button === 1).
3
+ * Filters out Windows right-clicks, which fire onAuxClick with button === 2
4
+ * in addition to onContextMenu, to prevent double-counting.
5
+ */
6
+ export declare const isAuxClick: (e: {
7
+ button: number;
8
+ }) => boolean;
@@ -1,3 +1,9 @@
1
1
  import { SmartLinkEvents } from '../../utils/analytics/analytics';
2
2
  export declare function useSmartLinkEvents(): SmartLinkEvents;
3
- export declare function useFire3PWorkflowsClickEvent(firstPartyIdentifier: string | undefined, thirdPartyARI: string | undefined): () => void;
3
+ export type Fire3PWorkflowsClickEventOptions = {
4
+ /** True for middle-clicks (button === 1) captured via `onAuxClick`. */
5
+ isAuxClick?: boolean;
6
+ /** True for right-clicks captured via `onContextMenu`. */
7
+ isContextMenu?: boolean;
8
+ };
9
+ export declare function useFire3PWorkflowsClickEvent(firstPartyIdentifier: string | undefined, thirdPartyARI: string | undefined): ({ isAuxClick, isContextMenu, }?: Fire3PWorkflowsClickEventOptions) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "44.10.0",
3
+ "version": "44.11.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -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": "^80.1.0",
89
+ "@atlaskit/tmp-editor-statsig": "^80.3.0",
90
90
  "@atlaskit/tokens": "^13.0.0",
91
91
  "@atlaskit/tooltip": "^22.2.0",
92
92
  "@atlaskit/ufo": "^0.5.0",