@atlaskit/smart-card 44.18.0 → 44.19.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 +11 -0
- package/dist/cjs/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +48 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +11 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +40 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +11 -2
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/hooks/use-smart-link-cross-product-url-wrapper/index.js +42 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +11 -2
- package/dist/esm/view/EmbedModal/components/link-info/index.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-smart-link-cross-product-url-wrapper/index.d.ts +8 -0
- package/dist/types-ts4.5/state/hooks/use-smart-link-cross-product-url-wrapper/index.d.ts +8 -0
- package/package.json +7 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 44.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2918b4d7371d7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2918b4d7371d7) -
|
|
8
|
+
Add XPC query parameter to smart links.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 44.18.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSmartLinkCrossProductUrlWrapperGated = exports.getIsFirstPartyLink = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useCrossProductUrlWrapper = require("@atlaskit/analytics-cross-product/useCrossProductUrlWrapper");
|
|
9
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
10
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
11
|
+
var SMART_LINKS_XPC_BRIDGE = 'smartLinks';
|
|
12
|
+
var XPC_QUERY_PARAM = 'xpis';
|
|
13
|
+
var getIsFirstPartyLink = exports.getIsFirstPartyLink = function getIsFirstPartyLink(details) {
|
|
14
|
+
var _is1PLink, _details$meta;
|
|
15
|
+
return ((_is1PLink = details === null || details === void 0 || (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.is1PLink) !== null && _is1PLink !== void 0 ? _is1PLink : false) === true;
|
|
16
|
+
};
|
|
17
|
+
var identityUrlWrapper = function identityUrlWrapper(url) {
|
|
18
|
+
return url;
|
|
19
|
+
};
|
|
20
|
+
var useSmartLinkCrossProductUrlWrapperFallback = function useSmartLinkCrossProductUrlWrapperFallback(_args) {
|
|
21
|
+
return identityUrlWrapper;
|
|
22
|
+
};
|
|
23
|
+
var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWrapper(_ref) {
|
|
24
|
+
var _product$toLowerCase;
|
|
25
|
+
var details = _ref.details;
|
|
26
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
27
|
+
product = _useSmartLinkContext.product;
|
|
28
|
+
var wrapUrl = (0, _useCrossProductUrlWrapper.useCrossProductUrlWrapper)({
|
|
29
|
+
bridge: SMART_LINKS_XPC_BRIDGE,
|
|
30
|
+
product: (_product$toLowerCase = product === null || product === void 0 ? void 0 : product.toLowerCase()) !== null && _product$toLowerCase !== void 0 ? _product$toLowerCase : 'unknown'
|
|
31
|
+
});
|
|
32
|
+
return (0, _react.useCallback)(function (url) {
|
|
33
|
+
if (!getIsFirstPartyLink(details) || !product) {
|
|
34
|
+
return url;
|
|
35
|
+
}
|
|
36
|
+
var parsedUrl;
|
|
37
|
+
try {
|
|
38
|
+
parsedUrl = new URL(url);
|
|
39
|
+
} catch (_unused) {
|
|
40
|
+
return url;
|
|
41
|
+
}
|
|
42
|
+
if (parsedUrl.searchParams.has(XPC_QUERY_PARAM)) {
|
|
43
|
+
return url;
|
|
44
|
+
}
|
|
45
|
+
return wrapUrl(url);
|
|
46
|
+
}, [details, product, wrapUrl]);
|
|
47
|
+
};
|
|
48
|
+
var useSmartLinkCrossProductUrlWrapperGated = exports.useSmartLinkCrossProductUrlWrapperGated = (0, _platformFeatureFlagsReact.functionWithFG)('platform_smartlink_xpc_url_wrapping', useSmartLinkCrossProductUrlWrapper, useSmartLinkCrossProductUrlWrapperFallback);
|
|
@@ -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.
|
|
14
|
+
packageVersion: "44.18.0" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -20,6 +20,7 @@ var _state = require("../../state");
|
|
|
20
20
|
var _analytics = require("../../state/analytics");
|
|
21
21
|
var _helpers = require("../../state/helpers");
|
|
22
22
|
var _useInlineActionNudgeExperiment = _interopRequireDefault(require("../../state/hooks/use-inline-action-nudge-experiment"));
|
|
23
|
+
var _useSmartLinkCrossProductUrlWrapper = require("../../state/hooks/use-smart-link-cross-product-url-wrapper");
|
|
23
24
|
var _modal = require("../../state/modal");
|
|
24
25
|
var _utils = require("../../utils");
|
|
25
26
|
var _combineActionOptions = require("../../utils/actions/combine-action-options");
|
|
@@ -93,6 +94,9 @@ function Component(_ref) {
|
|
|
93
94
|
var services = (0, _helpers.getServices)(state.details);
|
|
94
95
|
var thirdPartyARI = (0, _helpers.getThirdPartyARI)(state.details);
|
|
95
96
|
var firstPartyIdentifier = (0, _helpers.getFirstPartyIdentifier)();
|
|
97
|
+
var wrapUrlWithCrossProductAnalytics = (0, _useSmartLinkCrossProductUrlWrapper.useSmartLinkCrossProductUrlWrapperGated)({
|
|
98
|
+
details: state.details
|
|
99
|
+
});
|
|
96
100
|
var actionOptions = (0, _combineActionOptions.combineActionOptions)({
|
|
97
101
|
actionOptions: actionOptionsProp,
|
|
98
102
|
platform: platform
|
|
@@ -155,7 +159,12 @@ function Component(_ref) {
|
|
|
155
159
|
// event by smart card internally
|
|
156
160
|
// If it has been called then only then can `isSpecialEvent` be true.
|
|
157
161
|
var target = (0, _utils.isSpecialEvent)(event) ? '_blank' : '_self';
|
|
158
|
-
|
|
162
|
+
if ((0, _platformFeatureFlags.fg)('platform_smartlink_xpc_url_wrapping')) {
|
|
163
|
+
var wrappedUrl = wrapUrlWithCrossProductAnalytics(clickUrl);
|
|
164
|
+
window.open(wrappedUrl, target);
|
|
165
|
+
} else {
|
|
166
|
+
window.open(clickUrl, target);
|
|
167
|
+
}
|
|
159
168
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event, {
|
|
160
169
|
attributes: {
|
|
161
170
|
clickOutcome: target === '_blank' ? 'clickThroughNewTabOrWindow' : 'clickThrough'
|
|
@@ -167,7 +176,7 @@ function Component(_ref) {
|
|
|
167
176
|
}
|
|
168
177
|
(0, _click.fireLinkClickedEvent)(createAnalyticsEvent)(event);
|
|
169
178
|
}
|
|
170
|
-
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
179
|
+
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, wrapUrlWithCrossProductAnalytics, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
171
180
|
|
|
172
181
|
// Exposure fires once per eligible mount; click-time reads use no-exposure variant.
|
|
173
182
|
(0, _react.useEffect)(function () {
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "44.
|
|
22
|
+
packageVersion: "44.18.0",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useCrossProductUrlWrapper } from '@atlaskit/analytics-cross-product/useCrossProductUrlWrapper';
|
|
3
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
4
|
+
import { functionWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
5
|
+
const SMART_LINKS_XPC_BRIDGE = 'smartLinks';
|
|
6
|
+
const XPC_QUERY_PARAM = 'xpis';
|
|
7
|
+
export const getIsFirstPartyLink = details => {
|
|
8
|
+
var _is1PLink, _details$meta;
|
|
9
|
+
return ((_is1PLink = details === null || details === void 0 ? void 0 : (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.is1PLink) !== null && _is1PLink !== void 0 ? _is1PLink : false) === true;
|
|
10
|
+
};
|
|
11
|
+
const identityUrlWrapper = url => url;
|
|
12
|
+
const useSmartLinkCrossProductUrlWrapperFallback = _args => identityUrlWrapper;
|
|
13
|
+
const useSmartLinkCrossProductUrlWrapper = ({
|
|
14
|
+
details
|
|
15
|
+
}) => {
|
|
16
|
+
var _product$toLowerCase;
|
|
17
|
+
const {
|
|
18
|
+
product
|
|
19
|
+
} = useSmartLinkContext();
|
|
20
|
+
const wrapUrl = useCrossProductUrlWrapper({
|
|
21
|
+
bridge: SMART_LINKS_XPC_BRIDGE,
|
|
22
|
+
product: (_product$toLowerCase = product === null || product === void 0 ? void 0 : product.toLowerCase()) !== null && _product$toLowerCase !== void 0 ? _product$toLowerCase : 'unknown'
|
|
23
|
+
});
|
|
24
|
+
return useCallback(url => {
|
|
25
|
+
if (!getIsFirstPartyLink(details) || !product) {
|
|
26
|
+
return url;
|
|
27
|
+
}
|
|
28
|
+
let parsedUrl;
|
|
29
|
+
try {
|
|
30
|
+
parsedUrl = new URL(url);
|
|
31
|
+
} catch {
|
|
32
|
+
return url;
|
|
33
|
+
}
|
|
34
|
+
if (parsedUrl.searchParams.has(XPC_QUERY_PARAM)) {
|
|
35
|
+
return url;
|
|
36
|
+
}
|
|
37
|
+
return wrapUrl(url);
|
|
38
|
+
}, [details, product, wrapUrl]);
|
|
39
|
+
};
|
|
40
|
+
export const useSmartLinkCrossProductUrlWrapperGated = functionWithFG('platform_smartlink_xpc_url_wrapping', useSmartLinkCrossProductUrlWrapper, useSmartLinkCrossProductUrlWrapperFallback);
|
|
@@ -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.
|
|
5
|
+
packageVersion: "44.18.0" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -11,6 +11,7 @@ import { useSmartLink } from '../../state';
|
|
|
11
11
|
import { succeedUfoExperience } from '../../state/analytics';
|
|
12
12
|
import { getClickUrl, getDefinitionId, getExtensionKey, getFirstPartyIdentifier, getObjectAri, getObjectIconUrl, getObjectName, getResourceType, getServices, getThirdPartyARI, isFinalState } from '../../state/helpers';
|
|
13
13
|
import useInlineActionNudgeExperiment from '../../state/hooks/use-inline-action-nudge-experiment';
|
|
14
|
+
import { useSmartLinkCrossProductUrlWrapperGated } from '../../state/hooks/use-smart-link-cross-product-url-wrapper';
|
|
14
15
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
15
16
|
import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
|
|
16
17
|
import { combineActionOptions } from '../../utils/actions/combine-action-options';
|
|
@@ -83,6 +84,9 @@ function Component({
|
|
|
83
84
|
const services = getServices(state.details);
|
|
84
85
|
const thirdPartyARI = getThirdPartyARI(state.details);
|
|
85
86
|
const firstPartyIdentifier = getFirstPartyIdentifier();
|
|
87
|
+
const wrapUrlWithCrossProductAnalytics = useSmartLinkCrossProductUrlWrapperGated({
|
|
88
|
+
details: state.details
|
|
89
|
+
});
|
|
86
90
|
const actionOptions = combineActionOptions({
|
|
87
91
|
actionOptions: actionOptionsProp,
|
|
88
92
|
platform
|
|
@@ -146,7 +150,12 @@ function Component({
|
|
|
146
150
|
// event by smart card internally
|
|
147
151
|
// If it has been called then only then can `isSpecialEvent` be true.
|
|
148
152
|
const target = isSpecialEvent(event) ? '_blank' : '_self';
|
|
149
|
-
|
|
153
|
+
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
154
|
+
const wrappedUrl = wrapUrlWithCrossProductAnalytics(clickUrl);
|
|
155
|
+
window.open(wrappedUrl, target);
|
|
156
|
+
} else {
|
|
157
|
+
window.open(clickUrl, target);
|
|
158
|
+
}
|
|
150
159
|
fireLinkClickedEvent(createAnalyticsEvent)(event, {
|
|
151
160
|
attributes: {
|
|
152
161
|
clickOutcome: target === '_blank' ? 'clickThroughNewTabOrWindow' : 'clickThrough'
|
|
@@ -158,7 +167,7 @@ function Component({
|
|
|
158
167
|
}
|
|
159
168
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
160
169
|
}
|
|
161
|
-
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
170
|
+
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, wrapUrlWithCrossProductAnalytics, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
162
171
|
|
|
163
172
|
// Exposure fires once per eligible mount; click-time reads use no-exposure variant.
|
|
164
173
|
useEffect(() => {
|
|
@@ -9,7 +9,7 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
|
|
|
9
9
|
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
10
10
|
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
11
11
|
import { CloseButton, useModal } from '@atlaskit/modal-dialog';
|
|
12
|
-
import { fg } from
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
14
|
import { messages } from '../../../../messages';
|
|
15
15
|
import { Icon } from '../../../common/Icon';
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "44.
|
|
12
|
+
packageVersion: "44.18.0",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useCrossProductUrlWrapper } from '@atlaskit/analytics-cross-product/useCrossProductUrlWrapper';
|
|
3
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
4
|
+
import { functionWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
5
|
+
var SMART_LINKS_XPC_BRIDGE = 'smartLinks';
|
|
6
|
+
var XPC_QUERY_PARAM = 'xpis';
|
|
7
|
+
export var getIsFirstPartyLink = function getIsFirstPartyLink(details) {
|
|
8
|
+
var _is1PLink, _details$meta;
|
|
9
|
+
return ((_is1PLink = details === null || details === void 0 || (_details$meta = details.meta) === null || _details$meta === void 0 ? void 0 : _details$meta.is1PLink) !== null && _is1PLink !== void 0 ? _is1PLink : false) === true;
|
|
10
|
+
};
|
|
11
|
+
var identityUrlWrapper = function identityUrlWrapper(url) {
|
|
12
|
+
return url;
|
|
13
|
+
};
|
|
14
|
+
var useSmartLinkCrossProductUrlWrapperFallback = function useSmartLinkCrossProductUrlWrapperFallback(_args) {
|
|
15
|
+
return identityUrlWrapper;
|
|
16
|
+
};
|
|
17
|
+
var useSmartLinkCrossProductUrlWrapper = function useSmartLinkCrossProductUrlWrapper(_ref) {
|
|
18
|
+
var _product$toLowerCase;
|
|
19
|
+
var details = _ref.details;
|
|
20
|
+
var _useSmartLinkContext = useSmartLinkContext(),
|
|
21
|
+
product = _useSmartLinkContext.product;
|
|
22
|
+
var wrapUrl = useCrossProductUrlWrapper({
|
|
23
|
+
bridge: SMART_LINKS_XPC_BRIDGE,
|
|
24
|
+
product: (_product$toLowerCase = product === null || product === void 0 ? void 0 : product.toLowerCase()) !== null && _product$toLowerCase !== void 0 ? _product$toLowerCase : 'unknown'
|
|
25
|
+
});
|
|
26
|
+
return useCallback(function (url) {
|
|
27
|
+
if (!getIsFirstPartyLink(details) || !product) {
|
|
28
|
+
return url;
|
|
29
|
+
}
|
|
30
|
+
var parsedUrl;
|
|
31
|
+
try {
|
|
32
|
+
parsedUrl = new URL(url);
|
|
33
|
+
} catch (_unused) {
|
|
34
|
+
return url;
|
|
35
|
+
}
|
|
36
|
+
if (parsedUrl.searchParams.has(XPC_QUERY_PARAM)) {
|
|
37
|
+
return url;
|
|
38
|
+
}
|
|
39
|
+
return wrapUrl(url);
|
|
40
|
+
}, [details, product, wrapUrl]);
|
|
41
|
+
};
|
|
42
|
+
export var useSmartLinkCrossProductUrlWrapperGated = functionWithFG('platform_smartlink_xpc_url_wrapping', useSmartLinkCrossProductUrlWrapper, useSmartLinkCrossProductUrlWrapperFallback);
|
|
@@ -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.
|
|
7
|
+
packageVersion: "44.18.0" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -14,6 +14,7 @@ import { useSmartLink } from '../../state';
|
|
|
14
14
|
import { succeedUfoExperience } from '../../state/analytics';
|
|
15
15
|
import { getClickUrl, getDefinitionId, getExtensionKey, getFirstPartyIdentifier, getObjectAri, getObjectIconUrl, getObjectName, getResourceType, getServices, getThirdPartyARI, isFinalState } from '../../state/helpers';
|
|
16
16
|
import useInlineActionNudgeExperiment from '../../state/hooks/use-inline-action-nudge-experiment';
|
|
17
|
+
import { useSmartLinkCrossProductUrlWrapperGated } from '../../state/hooks/use-smart-link-cross-product-url-wrapper';
|
|
17
18
|
import { SmartLinkModalProvider } from '../../state/modal';
|
|
18
19
|
import { isSpecialClick, isSpecialEvent, isSpecialKey } from '../../utils';
|
|
19
20
|
import { combineActionOptions } from '../../utils/actions/combine-action-options';
|
|
@@ -84,6 +85,9 @@ function Component(_ref) {
|
|
|
84
85
|
var services = getServices(state.details);
|
|
85
86
|
var thirdPartyARI = getThirdPartyARI(state.details);
|
|
86
87
|
var firstPartyIdentifier = getFirstPartyIdentifier();
|
|
88
|
+
var wrapUrlWithCrossProductAnalytics = useSmartLinkCrossProductUrlWrapperGated({
|
|
89
|
+
details: state.details
|
|
90
|
+
});
|
|
87
91
|
var actionOptions = combineActionOptions({
|
|
88
92
|
actionOptions: actionOptionsProp,
|
|
89
93
|
platform: platform
|
|
@@ -146,7 +150,12 @@ function Component(_ref) {
|
|
|
146
150
|
// event by smart card internally
|
|
147
151
|
// If it has been called then only then can `isSpecialEvent` be true.
|
|
148
152
|
var target = isSpecialEvent(event) ? '_blank' : '_self';
|
|
149
|
-
|
|
153
|
+
if (fg('platform_smartlink_xpc_url_wrapping')) {
|
|
154
|
+
var wrappedUrl = wrapUrlWithCrossProductAnalytics(clickUrl);
|
|
155
|
+
window.open(wrappedUrl, target);
|
|
156
|
+
} else {
|
|
157
|
+
window.open(clickUrl, target);
|
|
158
|
+
}
|
|
150
159
|
fireLinkClickedEvent(createAnalyticsEvent)(event, {
|
|
151
160
|
attributes: {
|
|
152
161
|
clickOutcome: target === '_blank' ? 'clickThroughNewTabOrWindow' : 'clickThrough'
|
|
@@ -158,7 +167,7 @@ function Component(_ref) {
|
|
|
158
167
|
}
|
|
159
168
|
fireLinkClickedEvent(createAnalyticsEvent)(event);
|
|
160
169
|
}
|
|
161
|
-
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
170
|
+
}, [fireEvent, id, isFlexibleUi, appearance, definitionId, onClick, url, wrapUrlWithCrossProductAnalytics, state.details, ari, name, fire3PClickEvent, shouldFire3PClickEvent, isPreviewPanelAvailable, openPreviewPanel, createAnalyticsEvent, disablePreviewPanel]);
|
|
162
171
|
|
|
163
172
|
// Exposure fires once per eligible mount; click-time reads use no-exposure variant.
|
|
164
173
|
useEffect(function () {
|
|
@@ -9,7 +9,7 @@ import VidFullScreenOnIcon from '@atlaskit/icon/core/fullscreen-enter';
|
|
|
9
9
|
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
10
10
|
import ShortcutIcon from '@atlaskit/icon/core/link-external';
|
|
11
11
|
import { CloseButton, useModal } from '@atlaskit/modal-dialog';
|
|
12
|
-
import { fg } from
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
14
|
import { messages } from '../../../../messages';
|
|
15
15
|
import { Icon } from '../../../common/Icon';
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "44.
|
|
15
|
+
packageVersion: "44.18.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SmartLinkResponse } from '@atlaskit/linking-types';
|
|
2
|
+
export declare const getIsFirstPartyLink: (details?: SmartLinkResponse) => boolean;
|
|
3
|
+
type UseSmartLinkCrossProductUrlWrapperArgs = {
|
|
4
|
+
details?: SmartLinkResponse;
|
|
5
|
+
};
|
|
6
|
+
declare const useSmartLinkCrossProductUrlWrapper: ({ details, }: UseSmartLinkCrossProductUrlWrapperArgs) => ((url: string) => string);
|
|
7
|
+
export declare const useSmartLinkCrossProductUrlWrapperGated: typeof useSmartLinkCrossProductUrlWrapper;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SmartLinkResponse } from '@atlaskit/linking-types';
|
|
2
|
+
export declare const getIsFirstPartyLink: (details?: SmartLinkResponse) => boolean;
|
|
3
|
+
type UseSmartLinkCrossProductUrlWrapperArgs = {
|
|
4
|
+
details?: SmartLinkResponse;
|
|
5
|
+
};
|
|
6
|
+
declare const useSmartLinkCrossProductUrlWrapper: ({ details, }: UseSmartLinkCrossProductUrlWrapperArgs) => ((url: string) => string);
|
|
7
|
+
export declare const useSmartLinkCrossProductUrlWrapperGated: typeof useSmartLinkCrossProductUrlWrapper;
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.19.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/adf-utils": "^19.32.0",
|
|
39
39
|
"@atlaskit/afm-i18n-platform-linking-platform-smart-card": "2.6.0",
|
|
40
|
+
"@atlaskit/analytics-cross-product": "^1.2.0",
|
|
40
41
|
"@atlaskit/analytics-gas-types": "^5.1.0",
|
|
41
42
|
"@atlaskit/analytics-next": "^11.2.0",
|
|
42
43
|
"@atlaskit/avatar": "^25.15.0",
|
|
@@ -76,12 +77,12 @@
|
|
|
76
77
|
"@atlaskit/platform-feature-flags-react": "^0.5.0",
|
|
77
78
|
"@atlaskit/popup": "^4.23.0",
|
|
78
79
|
"@atlaskit/primitives": "^19.0.0",
|
|
79
|
-
"@atlaskit/react-ufo": "^6.
|
|
80
|
+
"@atlaskit/react-ufo": "^6.5.0",
|
|
80
81
|
"@atlaskit/rovo-triggers": "^6.5.0",
|
|
81
82
|
"@atlaskit/section-message": "^8.13.0",
|
|
82
83
|
"@atlaskit/select": "^21.12.0",
|
|
83
84
|
"@atlaskit/spinner": "^19.1.0",
|
|
84
|
-
"@atlaskit/tag": "^14.
|
|
85
|
+
"@atlaskit/tag": "^14.15.0",
|
|
85
86
|
"@atlaskit/textarea": "^8.3.0",
|
|
86
87
|
"@atlaskit/textfield": "^8.3.0",
|
|
87
88
|
"@atlaskit/theme": "^25.0.0",
|
|
@@ -204,6 +205,9 @@
|
|
|
204
205
|
"platform_smartlink_3pclick_analytics": {
|
|
205
206
|
"type": "boolean"
|
|
206
207
|
},
|
|
208
|
+
"platform_smartlink_xpc_url_wrapping": {
|
|
209
|
+
"type": "boolean"
|
|
210
|
+
},
|
|
207
211
|
"navx-1895-new-logo-design": {
|
|
208
212
|
"type": "boolean"
|
|
209
213
|
},
|