@atlaskit/smart-card 45.16.6 → 45.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/analytics.spec.yaml +1 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +4 -13
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/index.js +2 -12
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +4 -13
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/index.js +3 -13
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +4 -13
- package/dist/esm/view/LinkUrl/HyperlinkResolver/index.js +3 -13
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2b3a50789456f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2b3a50789456f) -
|
|
8
|
+
Clean up linking_platform_track_non_primary_3p_clicks experiment. Non-primary (middle/right-click)
|
|
9
|
+
3P click tracking is now permanent.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 45.16.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/analytics.spec.yaml
CHANGED
|
@@ -954,10 +954,8 @@ events:
|
|
|
954
954
|
type: boolean
|
|
955
955
|
description:
|
|
956
956
|
True when the click was a middle-click (button === 1) captured via `onAuxClick`.
|
|
957
|
-
Behaviour is gated by the `linking_platform_track_non_primary_3p_clicks` Statsig experiment.
|
|
958
957
|
isContextMenu:
|
|
959
958
|
required: false
|
|
960
959
|
type: boolean
|
|
961
960
|
description:
|
|
962
|
-
True when the event was a right-click captured via `onContextMenu`.
|
|
963
|
-
by the `linking_platform_track_non_primary_3p_clicks` Statsig experiment.
|
|
961
|
+
True when the event was a right-click captured via `onContextMenu`.
|
|
@@ -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: "45.16.
|
|
14
|
+
packageVersion: "45.16.6" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,7 +12,6 @@ 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");
|
|
16
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
17
16
|
var _useAnalyticsEvents2 = require("../../common/analytics/generated/use-analytics-events");
|
|
18
17
|
var _constants = require("../../constants");
|
|
@@ -39,7 +38,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
39
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; }
|
|
40
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; }
|
|
41
40
|
var thirdPartyARIPrefix = 'ari:third-party';
|
|
42
|
-
var TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
|
|
43
41
|
function Component(_ref) {
|
|
44
42
|
var id = _ref.id,
|
|
45
43
|
url = _ref.url,
|
|
@@ -250,15 +248,8 @@ function Component(_ref) {
|
|
|
250
248
|
}
|
|
251
249
|
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
252
250
|
|
|
253
|
-
// Exposure fires once per eligible mount; click-time reads use no-exposure variant.
|
|
254
|
-
(0, _react.useEffect)(function () {
|
|
255
|
-
if (shouldFire3PClickEvent) {
|
|
256
|
-
(0, _expValEquals.expValEquals)(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
|
|
257
|
-
}
|
|
258
|
-
}, [shouldFire3PClickEvent]);
|
|
259
|
-
|
|
260
251
|
// Middle-click handler to trigger fire3PClickEvent on middle-clicks.
|
|
261
|
-
// Scope is limited to 3P click analytics
|
|
252
|
+
// Scope is limited to 3P click analytics.
|
|
262
253
|
var handleFrameAuxClick = (0, _react.useCallback)(function (event) {
|
|
263
254
|
if ((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping')) {
|
|
264
255
|
var destinationUrl = getDestinationUrl();
|
|
@@ -266,7 +257,7 @@ function Component(_ref) {
|
|
|
266
257
|
}
|
|
267
258
|
|
|
268
259
|
// isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
|
|
269
|
-
if ((0, _clickHelpers.isAuxClick)(event) && shouldFire3PClickEvent
|
|
260
|
+
if ((0, _clickHelpers.isAuxClick)(event) && shouldFire3PClickEvent) {
|
|
270
261
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
271
262
|
isAuxClick: true
|
|
272
263
|
});
|
|
@@ -274,13 +265,13 @@ function Component(_ref) {
|
|
|
274
265
|
}, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
|
|
275
266
|
|
|
276
267
|
// Right-click handler to trigger fire3PClickEvent on right-clicks.
|
|
277
|
-
// Scope is limited to 3P click analytics
|
|
268
|
+
// Scope is limited to 3P click analytics.
|
|
278
269
|
var handleFrameContextMenu = (0, _react.useCallback)(function (event) {
|
|
279
270
|
if ((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping')) {
|
|
280
271
|
var destinationUrl = getDestinationUrl();
|
|
281
272
|
(0, _clickHelpers.updateAnchorHref)(event, destinationUrl);
|
|
282
273
|
}
|
|
283
|
-
if (shouldFire3PClickEvent
|
|
274
|
+
if (shouldFire3PClickEvent) {
|
|
284
275
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
285
276
|
isContextMenu: true
|
|
286
277
|
});
|
|
@@ -12,8 +12,6 @@ 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");
|
|
17
15
|
var _helpers = require("../../../state/helpers");
|
|
18
16
|
var _useResolveHyperlink2 = _interopRequireDefault(require("../../../state/hooks/use-resolve-hyperlink"));
|
|
19
17
|
var _useResolveHyperlinkValidator = _interopRequireDefault(require("../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator"));
|
|
@@ -24,7 +22,6 @@ var _useSmartLinkEvents = require("../../SmartLinkEvents/useSmartLinkEvents");
|
|
|
24
22
|
var _Hyperlink = _interopRequireDefault(require("../Hyperlink"));
|
|
25
23
|
var _excluded = ["onClick"];
|
|
26
24
|
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';
|
|
28
25
|
var HyperlinkFallbackComponent = function HyperlinkFallbackComponent() {
|
|
29
26
|
return null;
|
|
30
27
|
};
|
|
@@ -60,23 +57,16 @@ var HyperlinkWithSmartLinkResolverInner = function HyperlinkWithSmartLinkResolve
|
|
|
60
57
|
}
|
|
61
58
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback(e);
|
|
62
59
|
}, [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
60
|
var onAuxClick = (0, _react.useCallback)(function (e) {
|
|
71
61
|
// isAuxClick guards against Windows right-clicks firing onAuxClick with button === 2.
|
|
72
|
-
if ((0, _clickHelpers.isAuxClick)(e) && shouldFire3PClickEvent
|
|
62
|
+
if ((0, _clickHelpers.isAuxClick)(e) && shouldFire3PClickEvent) {
|
|
73
63
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
74
64
|
isAuxClick: true
|
|
75
65
|
});
|
|
76
66
|
}
|
|
77
67
|
}, [fire3PClickEvent, shouldFire3PClickEvent]);
|
|
78
68
|
var onContextMenu = (0, _react.useCallback)(function (_e) {
|
|
79
|
-
if (shouldFire3PClickEvent
|
|
69
|
+
if (shouldFire3PClickEvent) {
|
|
80
70
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
81
71
|
isContextMenu: true
|
|
82
72
|
});
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "45.16.
|
|
22
|
+
packageVersion: "45.16.6",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -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: "45.16.
|
|
5
|
+
packageVersion: "45.16.6" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -3,7 +3,6 @@ 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';
|
|
7
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
7
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
9
8
|
import { CardDisplay } from '../../constants';
|
|
@@ -27,7 +26,6 @@ import { useFire3PWorkflowsClickEvent } from '../SmartLinkEvents/useSmartLinkEve
|
|
|
27
26
|
import withCardIntersectionObserver from './card-intersection-observer';
|
|
28
27
|
import useExperimentMetaEventAttributes from './experiment-meta-event-attributes';
|
|
29
28
|
const thirdPartyARIPrefix = 'ari:third-party';
|
|
30
|
-
const TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
|
|
31
29
|
function Component({
|
|
32
30
|
id,
|
|
33
31
|
url,
|
|
@@ -241,15 +239,8 @@ function Component({
|
|
|
241
239
|
}
|
|
242
240
|
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
243
241
|
|
|
244
|
-
// Exposure fires once per eligible mount; click-time reads use no-exposure variant.
|
|
245
|
-
useEffect(() => {
|
|
246
|
-
if (shouldFire3PClickEvent) {
|
|
247
|
-
expValEquals(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
|
|
248
|
-
}
|
|
249
|
-
}, [shouldFire3PClickEvent]);
|
|
250
|
-
|
|
251
242
|
// Middle-click handler to trigger fire3PClickEvent on middle-clicks.
|
|
252
|
-
// Scope is limited to 3P click analytics
|
|
243
|
+
// Scope is limited to 3P click analytics.
|
|
253
244
|
const handleFrameAuxClick = useCallback(event => {
|
|
254
245
|
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
255
246
|
const destinationUrl = getDestinationUrl();
|
|
@@ -257,7 +248,7 @@ function Component({
|
|
|
257
248
|
}
|
|
258
249
|
|
|
259
250
|
// isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
|
|
260
|
-
if (isAuxClick(event) && shouldFire3PClickEvent
|
|
251
|
+
if (isAuxClick(event) && shouldFire3PClickEvent) {
|
|
261
252
|
fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
|
|
262
253
|
isAuxClick: true
|
|
263
254
|
});
|
|
@@ -265,13 +256,13 @@ function Component({
|
|
|
265
256
|
}, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
|
|
266
257
|
|
|
267
258
|
// Right-click handler to trigger fire3PClickEvent on right-clicks.
|
|
268
|
-
// Scope is limited to 3P click analytics
|
|
259
|
+
// Scope is limited to 3P click analytics.
|
|
269
260
|
const handleFrameContextMenu = useCallback(event => {
|
|
270
261
|
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
271
262
|
const destinationUrl = getDestinationUrl();
|
|
272
263
|
updateAnchorHref(event, destinationUrl);
|
|
273
264
|
}
|
|
274
|
-
if (shouldFire3PClickEvent
|
|
265
|
+
if (shouldFire3PClickEvent) {
|
|
275
266
|
fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
|
|
276
267
|
isContextMenu: true
|
|
277
268
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useCallback
|
|
2
|
+
import React, { useCallback } 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';
|
|
8
6
|
import { getFirstPartyIdentifier, getThirdPartyARI } from '../../../state/helpers';
|
|
9
7
|
import useResolveHyperlink from '../../../state/hooks/use-resolve-hyperlink';
|
|
10
8
|
import useResolveHyperlinkValidator from '../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator';
|
|
@@ -13,7 +11,6 @@ import { isAuxClick } from '../../../utils/click-helpers';
|
|
|
13
11
|
import withIntlProvider from '../../common/intl-provider';
|
|
14
12
|
import { useFire3PWorkflowsClickEvent } from '../../SmartLinkEvents/useSmartLinkEvents';
|
|
15
13
|
import Hyperlink from '../Hyperlink';
|
|
16
|
-
const TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
|
|
17
14
|
const HyperlinkFallbackComponent = () => null;
|
|
18
15
|
const withValidator = (Component, DefaultComponent) => props => {
|
|
19
16
|
const shouldResolveHyperlink = useResolveHyperlinkValidator(props === null || props === void 0 ? void 0 : props.href);
|
|
@@ -47,23 +44,16 @@ const HyperlinkWithSmartLinkResolverInner = ({
|
|
|
47
44
|
}
|
|
48
45
|
onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback(e);
|
|
49
46
|
}, [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
47
|
const onAuxClick = useCallback(e => {
|
|
58
48
|
// isAuxClick guards against Windows right-clicks firing onAuxClick with button === 2.
|
|
59
|
-
if (isAuxClick(e) && shouldFire3PClickEvent
|
|
49
|
+
if (isAuxClick(e) && shouldFire3PClickEvent) {
|
|
60
50
|
fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
|
|
61
51
|
isAuxClick: true
|
|
62
52
|
});
|
|
63
53
|
}
|
|
64
54
|
}, [fire3PClickEvent, shouldFire3PClickEvent]);
|
|
65
55
|
const onContextMenu = useCallback(_e => {
|
|
66
|
-
if (shouldFire3PClickEvent
|
|
56
|
+
if (shouldFire3PClickEvent) {
|
|
67
57
|
fire3PClickEvent === null || fire3PClickEvent === void 0 ? void 0 : fire3PClickEvent({
|
|
68
58
|
isContextMenu: true
|
|
69
59
|
});
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "45.16.
|
|
12
|
+
packageVersion: "45.16.6",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -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: "45.16.
|
|
7
|
+
packageVersion: "45.16.6" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -6,7 +6,6 @@ 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';
|
|
10
9
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
10
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
12
11
|
import { CardDisplay } from '../../constants';
|
|
@@ -30,7 +29,6 @@ import { useFire3PWorkflowsClickEvent } from '../SmartLinkEvents/useSmartLinkEve
|
|
|
30
29
|
import withCardIntersectionObserver from './card-intersection-observer';
|
|
31
30
|
import useExperimentMetaEventAttributes from './experiment-meta-event-attributes';
|
|
32
31
|
var thirdPartyARIPrefix = 'ari:third-party';
|
|
33
|
-
var TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
|
|
34
32
|
function Component(_ref) {
|
|
35
33
|
var id = _ref.id,
|
|
36
34
|
url = _ref.url,
|
|
@@ -241,15 +239,8 @@ function Component(_ref) {
|
|
|
241
239
|
}
|
|
242
240
|
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, getDestinationUrl, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
243
241
|
|
|
244
|
-
// Exposure fires once per eligible mount; click-time reads use no-exposure variant.
|
|
245
|
-
useEffect(function () {
|
|
246
|
-
if (shouldFire3PClickEvent) {
|
|
247
|
-
expValEquals(TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT, 'isEnabled', true);
|
|
248
|
-
}
|
|
249
|
-
}, [shouldFire3PClickEvent]);
|
|
250
|
-
|
|
251
242
|
// Middle-click handler to trigger fire3PClickEvent on middle-clicks.
|
|
252
|
-
// Scope is limited to 3P click analytics
|
|
243
|
+
// Scope is limited to 3P click analytics.
|
|
253
244
|
var handleFrameAuxClick = useCallback(function (event) {
|
|
254
245
|
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
255
246
|
var destinationUrl = getDestinationUrl();
|
|
@@ -257,7 +248,7 @@ function Component(_ref) {
|
|
|
257
248
|
}
|
|
258
249
|
|
|
259
250
|
// isAuxClick filters Windows right-clicks (button === 2) that also fire onAuxClick.
|
|
260
|
-
if (isAuxClick(event) && shouldFire3PClickEvent
|
|
251
|
+
if (isAuxClick(event) && shouldFire3PClickEvent) {
|
|
261
252
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
262
253
|
isAuxClick: true
|
|
263
254
|
});
|
|
@@ -265,13 +256,13 @@ function Component(_ref) {
|
|
|
265
256
|
}, [fire3PClickEvent, getDestinationUrl, shouldFire3PClickEvent]);
|
|
266
257
|
|
|
267
258
|
// Right-click handler to trigger fire3PClickEvent on right-clicks.
|
|
268
|
-
// Scope is limited to 3P click analytics
|
|
259
|
+
// Scope is limited to 3P click analytics.
|
|
269
260
|
var handleFrameContextMenu = useCallback(function (event) {
|
|
270
261
|
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
271
262
|
var destinationUrl = getDestinationUrl();
|
|
272
263
|
updateAnchorHref(event, destinationUrl);
|
|
273
264
|
}
|
|
274
|
-
if (shouldFire3PClickEvent
|
|
265
|
+
if (shouldFire3PClickEvent) {
|
|
275
266
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
276
267
|
isContextMenu: true
|
|
277
268
|
});
|
|
@@ -1,12 +1,10 @@
|
|
|
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
|
|
4
|
+
import React, { useCallback } 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';
|
|
10
8
|
import { getFirstPartyIdentifier, getThirdPartyARI } from '../../../state/helpers';
|
|
11
9
|
import useResolveHyperlink from '../../../state/hooks/use-resolve-hyperlink';
|
|
12
10
|
import useResolveHyperlinkValidator from '../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator';
|
|
@@ -15,7 +13,6 @@ import { isAuxClick } from '../../../utils/click-helpers';
|
|
|
15
13
|
import withIntlProvider from '../../common/intl-provider';
|
|
16
14
|
import { useFire3PWorkflowsClickEvent } from '../../SmartLinkEvents/useSmartLinkEvents';
|
|
17
15
|
import Hyperlink from '../Hyperlink';
|
|
18
|
-
var TRACK_NON_PRIMARY_3P_CLICKS_EXPERIMENT = 'linking_platform_track_non_primary_3p_clicks';
|
|
19
16
|
var HyperlinkFallbackComponent = function HyperlinkFallbackComponent() {
|
|
20
17
|
return null;
|
|
21
18
|
};
|
|
@@ -51,23 +48,16 @@ var HyperlinkWithSmartLinkResolverInner = function HyperlinkWithSmartLinkResolve
|
|
|
51
48
|
}
|
|
52
49
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback(e);
|
|
53
50
|
}, [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
51
|
var onAuxClick = useCallback(function (e) {
|
|
62
52
|
// isAuxClick guards against Windows right-clicks firing onAuxClick with button === 2.
|
|
63
|
-
if (isAuxClick(e) && shouldFire3PClickEvent
|
|
53
|
+
if (isAuxClick(e) && shouldFire3PClickEvent) {
|
|
64
54
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
65
55
|
isAuxClick: true
|
|
66
56
|
});
|
|
67
57
|
}
|
|
68
58
|
}, [fire3PClickEvent, shouldFire3PClickEvent]);
|
|
69
59
|
var onContextMenu = useCallback(function (_e) {
|
|
70
|
-
if (shouldFire3PClickEvent
|
|
60
|
+
if (shouldFire3PClickEvent) {
|
|
71
61
|
fire3PClickEvent === null || fire3PClickEvent === void 0 || fire3PClickEvent({
|
|
72
62
|
isContextMenu: true
|
|
73
63
|
});
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "45.16.
|
|
15
|
+
packageVersion: "45.16.6",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "45.
|
|
3
|
+
"version": "45.17.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@atlaskit/textfield": "^9.1.0",
|
|
89
89
|
"@atlaskit/theme": "^26.1.0",
|
|
90
90
|
"@atlaskit/tile": "^3.0.0",
|
|
91
|
-
"@atlaskit/tmp-editor-statsig": "^138.
|
|
91
|
+
"@atlaskit/tmp-editor-statsig": "^138.1.0",
|
|
92
92
|
"@atlaskit/tokens": "^16.3.0",
|
|
93
93
|
"@atlaskit/tooltip": "^24.0.0",
|
|
94
94
|
"@atlaskit/ufo": "^1.0.0",
|