@atlaskit/smart-card 43.2.0 → 43.2.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.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/utils/analytics/SmartLinkAnalyticsContext.js +6 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/LinkUrl/HyperlinkResolver/index.js +5 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/SmartLinkAnalyticsContext.js +6 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/LinkUrl/HyperlinkResolver/index.js +5 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/SmartLinkAnalyticsContext.js +6 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/LinkUrl/HyperlinkResolver/index.js +5 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 43.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8e09fe6bb6c78`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e09fe6bb6c78) -
|
|
8
|
+
Add SmartLinkAnalyticsContext to the HyperlinkResolver logic so that the hyperlink analytics
|
|
9
|
+
events contains additional attributes about the resolution
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 43.2.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -9,6 +9,7 @@ exports.useSmartLinkAnalyticsContext = exports.SmartLinkAnalyticsContext = void
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
|
+
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
12
13
|
var _resolvedAttributes = require("@atlaskit/link-analytics/resolved-attributes");
|
|
13
14
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
14
15
|
var _linkingCommon = require("@atlaskit/linking-common");
|
|
@@ -33,7 +34,11 @@ var getSmartLinkAnalyticsContext = function getSmartLinkAnalyticsContext(_ref) {
|
|
|
33
34
|
status = _ref.status,
|
|
34
35
|
url = _ref.url,
|
|
35
36
|
error = _ref.error;
|
|
36
|
-
var
|
|
37
|
+
var isHyperlinkConnectExperimentEnabled = _featureGateJsClient.default.getExperimentValue('platform_linking_bluelink_connect_confluence', 'isEnabled', false) || _featureGateJsClient.default.getExperimentValue('platform_linking_bluelink_connect_jira', 'isEnabled', false);
|
|
38
|
+
var resolvedAttributes = isHyperlinkConnectExperimentEnabled ? getExtendedResolvedAttributes({
|
|
39
|
+
url: url,
|
|
40
|
+
displayCategory: display === 'url' ? 'link' : 'smartLink'
|
|
41
|
+
}, response, status, error) : getExtendedResolvedAttributes({
|
|
37
42
|
url: url
|
|
38
43
|
}, response, status, error);
|
|
39
44
|
return {
|
|
@@ -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: "43.
|
|
14
|
+
packageVersion: "43.2.0"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -17,6 +17,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
17
17
|
var _helpers = require("../../../state/helpers");
|
|
18
18
|
var _useResolveHyperlink2 = _interopRequireDefault(require("../../../state/hooks/use-resolve-hyperlink"));
|
|
19
19
|
var _useResolveHyperlinkValidator = _interopRequireDefault(require("../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator"));
|
|
20
|
+
var _SmartLinkAnalyticsContext = require("../../../utils/analytics/SmartLinkAnalyticsContext");
|
|
20
21
|
var _intlProvider = _interopRequireDefault(require("../../common/intl-provider"));
|
|
21
22
|
var _useSmartLinkEvents = require("../../SmartLinkEvents/useSmartLinkEvents");
|
|
22
23
|
var _Hyperlink = _interopRequireDefault(require("../Hyperlink"));
|
|
@@ -29,7 +30,10 @@ var HyperlinkFallbackComponent = function HyperlinkFallbackComponent() {
|
|
|
29
30
|
var withValidator = function withValidator(Component, DefaultComponent) {
|
|
30
31
|
return function (props) {
|
|
31
32
|
var shouldResolveHyperlink = (0, _useResolveHyperlinkValidator.default)(props === null || props === void 0 ? void 0 : props.href);
|
|
32
|
-
return shouldResolveHyperlink
|
|
33
|
+
return shouldResolveHyperlink && props.href ? /*#__PURE__*/_react.default.createElement(_SmartLinkAnalyticsContext.SmartLinkAnalyticsContext, {
|
|
34
|
+
url: props.href,
|
|
35
|
+
display: "url"
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement(Component, props)) : /*#__PURE__*/_react.default.createElement(DefaultComponent, props);
|
|
33
37
|
};
|
|
34
38
|
};
|
|
35
39
|
var HyperlinkWithSmartLinkResolverInner = function HyperlinkWithSmartLinkResolverInner(_ref) {
|
|
@@ -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: "43.
|
|
25
|
+
packageVersion: "43.2.0",
|
|
26
26
|
componentName: 'linkUrl'
|
|
27
27
|
};
|
|
28
28
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
3
4
|
import { getResolvedAttributes } from '@atlaskit/link-analytics/resolved-attributes';
|
|
4
5
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
5
6
|
import { getUrl } from '@atlaskit/linking-common';
|
|
@@ -23,7 +24,11 @@ const getSmartLinkAnalyticsContext = ({
|
|
|
23
24
|
url,
|
|
24
25
|
error
|
|
25
26
|
}) => {
|
|
26
|
-
const
|
|
27
|
+
const isHyperlinkConnectExperimentEnabled = FeatureGates.getExperimentValue('platform_linking_bluelink_connect_confluence', 'isEnabled', false) || FeatureGates.getExperimentValue('platform_linking_bluelink_connect_jira', 'isEnabled', false);
|
|
28
|
+
const resolvedAttributes = isHyperlinkConnectExperimentEnabled ? getExtendedResolvedAttributes({
|
|
29
|
+
url,
|
|
30
|
+
displayCategory: display === 'url' ? 'link' : 'smartLink'
|
|
31
|
+
}, response, status, error) : getExtendedResolvedAttributes({
|
|
27
32
|
url
|
|
28
33
|
}, response, status, error);
|
|
29
34
|
return {
|
|
@@ -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: "43.
|
|
5
|
+
packageVersion: "43.2.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -8,6 +8,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import { getFirstPartyIdentifier, getServices, getThirdPartyARI } from '../../../state/helpers';
|
|
9
9
|
import useResolveHyperlink from '../../../state/hooks/use-resolve-hyperlink';
|
|
10
10
|
import useResolveHyperlinkValidator from '../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator';
|
|
11
|
+
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
11
12
|
import withIntlProvider from '../../common/intl-provider';
|
|
12
13
|
import { useFire3PWorkflowsClickEvent } from '../../SmartLinkEvents/useSmartLinkEvents';
|
|
13
14
|
import Hyperlink from '../Hyperlink';
|
|
@@ -15,7 +16,10 @@ import HyperlinkUnauthorizedView from './unauthorize-view';
|
|
|
15
16
|
const HyperlinkFallbackComponent = () => null;
|
|
16
17
|
const withValidator = (Component, DefaultComponent) => props => {
|
|
17
18
|
const shouldResolveHyperlink = useResolveHyperlinkValidator(props === null || props === void 0 ? void 0 : props.href);
|
|
18
|
-
return shouldResolveHyperlink
|
|
19
|
+
return shouldResolveHyperlink && props.href ? /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
20
|
+
url: props.href,
|
|
21
|
+
display: "url"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Component, props)) : /*#__PURE__*/React.createElement(DefaultComponent, props);
|
|
19
23
|
};
|
|
20
24
|
const HyperlinkWithSmartLinkResolverInner = ({
|
|
21
25
|
onClick: onClickCallback,
|
|
@@ -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: "43.
|
|
15
|
+
packageVersion: "43.2.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
6
|
+
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
6
7
|
import { getResolvedAttributes } from '@atlaskit/link-analytics/resolved-attributes';
|
|
7
8
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
8
9
|
import { getUrl } from '@atlaskit/linking-common';
|
|
@@ -24,7 +25,11 @@ var getSmartLinkAnalyticsContext = function getSmartLinkAnalyticsContext(_ref) {
|
|
|
24
25
|
status = _ref.status,
|
|
25
26
|
url = _ref.url,
|
|
26
27
|
error = _ref.error;
|
|
27
|
-
var
|
|
28
|
+
var isHyperlinkConnectExperimentEnabled = FeatureGates.getExperimentValue('platform_linking_bluelink_connect_confluence', 'isEnabled', false) || FeatureGates.getExperimentValue('platform_linking_bluelink_connect_jira', 'isEnabled', false);
|
|
29
|
+
var resolvedAttributes = isHyperlinkConnectExperimentEnabled ? getExtendedResolvedAttributes({
|
|
30
|
+
url: url,
|
|
31
|
+
displayCategory: display === 'url' ? 'link' : 'smartLink'
|
|
32
|
+
}, response, status, error) : getExtendedResolvedAttributes({
|
|
28
33
|
url: url
|
|
29
34
|
}, response, status, error);
|
|
30
35
|
return {
|
|
@@ -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: "43.
|
|
7
|
+
packageVersion: "43.2.0"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -10,6 +10,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
10
10
|
import { getFirstPartyIdentifier, getServices, getThirdPartyARI } from '../../../state/helpers';
|
|
11
11
|
import useResolveHyperlink from '../../../state/hooks/use-resolve-hyperlink';
|
|
12
12
|
import useResolveHyperlinkValidator from '../../../state/hooks/use-resolve-hyperlink/useResolveHyperlinkValidator';
|
|
13
|
+
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
13
14
|
import withIntlProvider from '../../common/intl-provider';
|
|
14
15
|
import { useFire3PWorkflowsClickEvent } from '../../SmartLinkEvents/useSmartLinkEvents';
|
|
15
16
|
import Hyperlink from '../Hyperlink';
|
|
@@ -20,7 +21,10 @@ var HyperlinkFallbackComponent = function HyperlinkFallbackComponent() {
|
|
|
20
21
|
var withValidator = function withValidator(Component, DefaultComponent) {
|
|
21
22
|
return function (props) {
|
|
22
23
|
var shouldResolveHyperlink = useResolveHyperlinkValidator(props === null || props === void 0 ? void 0 : props.href);
|
|
23
|
-
return shouldResolveHyperlink
|
|
24
|
+
return shouldResolveHyperlink && props.href ? /*#__PURE__*/React.createElement(SmartLinkAnalyticsContext, {
|
|
25
|
+
url: props.href,
|
|
26
|
+
display: "url"
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Component, props)) : /*#__PURE__*/React.createElement(DefaultComponent, props);
|
|
24
28
|
};
|
|
25
29
|
};
|
|
26
30
|
var HyperlinkWithSmartLinkResolverInner = function HyperlinkWithSmartLinkResolverInner(_ref) {
|
|
@@ -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: "43.
|
|
18
|
+
packageVersion: "43.2.0",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.2.
|
|
3
|
+
"version": "43.2.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@atlaskit/theme": "^21.0.0",
|
|
73
73
|
"@atlaskit/tmp-editor-statsig": "^13.13.0",
|
|
74
74
|
"@atlaskit/tokens": "^7.0.0",
|
|
75
|
-
"@atlaskit/tooltip": "^20.
|
|
75
|
+
"@atlaskit/tooltip": "^20.6.0",
|
|
76
76
|
"@atlaskit/ufo": "^0.4.0",
|
|
77
77
|
"@babel/runtime": "^7.0.0",
|
|
78
78
|
"@compiled/react": "^0.18.6",
|