@atlaskit/smart-card 36.3.0 → 36.4.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 +13 -0
- package/dist/cjs/state/hooks/use-control-data-export-config/index.js +22 -0
- package/dist/cjs/state/hooks/use-control-data-export-config/types.js +5 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/should-data-export.js +12 -0
- package/dist/cjs/view/BlockCard/index.js +13 -0
- package/dist/cjs/view/EmbedCard/index.js +23 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/state/hooks/use-control-data-export-config/index.js +15 -0
- package/dist/es2019/state/hooks/use-control-data-export-config/types.js +1 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/should-data-export.js +4 -0
- package/dist/es2019/view/BlockCard/index.js +13 -0
- package/dist/es2019/view/EmbedCard/index.js +23 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/state/hooks/use-control-data-export-config/index.js +16 -0
- package/dist/esm/state/hooks/use-control-data-export-config/types.js +1 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/should-data-export.js +6 -0
- package/dist/esm/view/BlockCard/index.js +13 -0
- package/dist/esm/view/EmbedCard/index.js +23 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/hooks/use-control-data-export-config/index.d.ts +2 -0
- package/dist/types/state/hooks/use-control-data-export-config/types.d.ts +7 -0
- package/dist/types/utils/should-data-export.d.ts +2 -0
- package/dist/types-ts4.5/state/hooks/use-control-data-export-config/index.d.ts +2 -0
- package/dist/types-ts4.5/state/hooks/use-control-data-export-config/types.d.ts +7 -0
- package/dist/types-ts4.5/utils/should-data-export.d.ts +2 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 36.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#135983](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/135983)
|
|
8
|
+
[`7bc55a027722d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7bc55a027722d) -
|
|
9
|
+
Resolving a vulnerability that allowed data secure policy controlled content to be exposed in
|
|
10
|
+
smart card previews during export.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 36.3.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useControlDataExportConfig = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
9
|
+
var useControlDataExportConfig = exports.useControlDataExportConfig = function useControlDataExportConfig() {
|
|
10
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
11
|
+
connections = _useSmartLinkContext.connections,
|
|
12
|
+
product = _useSmartLinkContext.product,
|
|
13
|
+
shouldControlDataExport = _useSmartLinkContext.shouldControlDataExport;
|
|
14
|
+
return (0, _react.useMemo)(function () {
|
|
15
|
+
return {
|
|
16
|
+
baseUrl: connections.client.baseUrlOverride,
|
|
17
|
+
envKey: connections.client.envKey,
|
|
18
|
+
product: product,
|
|
19
|
+
shouldControlDataExport: shouldControlDataExport
|
|
20
|
+
};
|
|
21
|
+
}, [connections.client.baseUrlOverride, connections.client.envKey, product, shouldControlDataExport]);
|
|
22
|
+
};
|
|
@@ -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: "36.
|
|
14
|
+
packageVersion: "36.4.0"
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getIsDataExportEnabled = void 0;
|
|
7
|
+
var getIsDataExportEnabled = exports.getIsDataExportEnabled = function getIsDataExportEnabled() {
|
|
8
|
+
var _response$meta;
|
|
9
|
+
var shouldControlDataExport = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
10
|
+
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
11
|
+
return Boolean(shouldControlDataExport && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('ExportBlocked')));
|
|
12
|
+
};
|
|
@@ -7,6 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.BlockCard = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
|
+
var _useControlDataExportConfig = require("../../state/hooks/use-control-data-export-config");
|
|
12
|
+
var _shouldDataExport = require("../../utils/should-data-export");
|
|
10
13
|
var _utils = require("../common/utils");
|
|
11
14
|
var _LinkView = require("../LinkView");
|
|
12
15
|
var _ErroredView = _interopRequireDefault(require("./views/ErroredView"));
|
|
@@ -41,6 +44,9 @@ var BlockCard = exports.BlockCard = function BlockCard(_ref) {
|
|
|
41
44
|
renderers: renderers,
|
|
42
45
|
actionOptions: actionOptions
|
|
43
46
|
};
|
|
47
|
+
var _useControlDataExport = (0, _useControlDataExportConfig.useControlDataExportConfig)(),
|
|
48
|
+
_useControlDataExport2 = _useControlDataExport.shouldControlDataExport,
|
|
49
|
+
shouldControlDataExport = _useControlDataExport2 === void 0 ? false : _useControlDataExport2;
|
|
44
50
|
switch (status) {
|
|
45
51
|
case 'pending':
|
|
46
52
|
case 'resolving':
|
|
@@ -48,6 +54,13 @@ var BlockCard = exports.BlockCard = function BlockCard(_ref) {
|
|
|
48
54
|
testId: "smart-block-resolving-view"
|
|
49
55
|
}));
|
|
50
56
|
case 'resolved':
|
|
57
|
+
if ((0, _platformFeatureFlags.fg)('platform_smart_links_controlled_dsp_export_view')) {
|
|
58
|
+
if ((0, _shouldDataExport.getIsDataExportEnabled)(shouldControlDataExport, cardState.details)) {
|
|
59
|
+
return /*#__PURE__*/_react.default.createElement(_UnauthorisedView.default, (0, _extends2.default)({}, blockCardProps, {
|
|
60
|
+
onAuthorize: handleAuthorize
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
51
64
|
return /*#__PURE__*/_react.default.createElement(_ResolvedView.default, blockCardProps);
|
|
52
65
|
case 'unauthorized':
|
|
53
66
|
return /*#__PURE__*/_react.default.createElement(_UnauthorisedView.default, (0, _extends2.default)({}, blockCardProps, {
|
|
@@ -8,11 +8,14 @@ exports.EmbedCard = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _extractAccessContext = require("../../extractors/common/context/extractAccessContext");
|
|
12
13
|
var _embed = require("../../extractors/embed");
|
|
13
14
|
var _inline = require("../../extractors/inline");
|
|
14
15
|
var _helpers = require("../../state/helpers");
|
|
16
|
+
var _useControlDataExportConfig = require("../../state/hooks/use-control-data-export-config");
|
|
15
17
|
var _jsonld = require("../../utils/jsonld");
|
|
18
|
+
var _shouldDataExport = require("../../utils/should-data-export");
|
|
16
19
|
var _ResolvedView = _interopRequireDefault(require("../BlockCard/views/ResolvedView"));
|
|
17
20
|
var _ResolvedView2 = require("../InlineCard/ResolvedView");
|
|
18
21
|
var _ErroredView = require("./views/ErroredView");
|
|
@@ -47,6 +50,9 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
47
50
|
var meta = details && details.meta;
|
|
48
51
|
var extensionKey = (0, _helpers.getExtensionKey)(details);
|
|
49
52
|
var isProductIntegrationSupported = (0, _helpers.hasAuthScopeOverrides)(details);
|
|
53
|
+
var _useControlDataExport = (0, _useControlDataExportConfig.useControlDataExportConfig)(),
|
|
54
|
+
_useControlDataExport2 = _useControlDataExport.shouldControlDataExport,
|
|
55
|
+
shouldControlDataExport = _useControlDataExport2 === void 0 ? false : _useControlDataExport2;
|
|
50
56
|
switch (status) {
|
|
51
57
|
case 'pending':
|
|
52
58
|
case 'resolving':
|
|
@@ -70,6 +76,23 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/_react.default.forwardRef(funct
|
|
|
70
76
|
aspectRatio: (_resolvedViewProps$pr = resolvedViewProps.preview) === null || _resolvedViewProps$pr === void 0 ? void 0 : _resolvedViewProps$pr.aspectRatio
|
|
71
77
|
});
|
|
72
78
|
}
|
|
79
|
+
if ((0, _platformFeatureFlags.fg)('platform_smart_links_controlled_dsp_export_view')) {
|
|
80
|
+
if ((0, _shouldDataExport.getIsDataExportEnabled)(shouldControlDataExport, cardState.details)) {
|
|
81
|
+
var unauthViewProps = (0, _embed.extractEmbedProps)(data, meta, platform);
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_unauthorizedView.default, {
|
|
83
|
+
context: unauthViewProps.context,
|
|
84
|
+
extensionKey: extensionKey,
|
|
85
|
+
frameStyle: frameStyle,
|
|
86
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
87
|
+
inheritDimensions: inheritDimensions,
|
|
88
|
+
isSelected: isSelected,
|
|
89
|
+
onAuthorize: handleAuthorize,
|
|
90
|
+
onClick: handleFrameClick,
|
|
91
|
+
testId: testId,
|
|
92
|
+
url: unauthViewProps.link
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
73
96
|
if (resolvedViewProps.preview) {
|
|
74
97
|
return /*#__PURE__*/_react.default.createElement(_ResolvedView3.EmbedCardResolvedView, (0, _extends2.default)({}, resolvedViewProps, {
|
|
75
98
|
isSelected: isSelected,
|
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "36.
|
|
23
|
+
packageVersion: "36.4.0",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
3
|
+
export const useControlDataExportConfig = () => {
|
|
4
|
+
const {
|
|
5
|
+
connections,
|
|
6
|
+
product,
|
|
7
|
+
shouldControlDataExport
|
|
8
|
+
} = useSmartLinkContext();
|
|
9
|
+
return useMemo(() => ({
|
|
10
|
+
baseUrl: connections.client.baseUrlOverride,
|
|
11
|
+
envKey: connections.client.envKey,
|
|
12
|
+
product,
|
|
13
|
+
shouldControlDataExport
|
|
14
|
+
}), [connections.client.baseUrlOverride, connections.client.envKey, product, shouldControlDataExport]);
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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: "36.
|
|
5
|
+
packageVersion: "36.4.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const getIsDataExportEnabled = (shouldControlDataExport = false, response) => {
|
|
2
|
+
var _response$meta, _response$meta$suppor;
|
|
3
|
+
return Boolean(shouldControlDataExport && (response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeature) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('ExportBlocked')));
|
|
4
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { useControlDataExportConfig } from '../../state/hooks/use-control-data-export-config';
|
|
5
|
+
import { getIsDataExportEnabled } from '../../utils/should-data-export';
|
|
3
6
|
import { handleClickCommon } from '../common/utils';
|
|
4
7
|
import { CardLinkView } from '../LinkView';
|
|
5
8
|
import ErroredView from './views/ErroredView';
|
|
@@ -35,6 +38,9 @@ export const BlockCard = ({
|
|
|
35
38
|
renderers,
|
|
36
39
|
actionOptions
|
|
37
40
|
};
|
|
41
|
+
const {
|
|
42
|
+
shouldControlDataExport = false
|
|
43
|
+
} = useControlDataExportConfig();
|
|
38
44
|
switch (status) {
|
|
39
45
|
case 'pending':
|
|
40
46
|
case 'resolving':
|
|
@@ -42,6 +48,13 @@ export const BlockCard = ({
|
|
|
42
48
|
testId: "smart-block-resolving-view"
|
|
43
49
|
}));
|
|
44
50
|
case 'resolved':
|
|
51
|
+
if (fg('platform_smart_links_controlled_dsp_export_view')) {
|
|
52
|
+
if (getIsDataExportEnabled(shouldControlDataExport, cardState.details)) {
|
|
53
|
+
return /*#__PURE__*/React.createElement(UnauthorisedView, _extends({}, blockCardProps, {
|
|
54
|
+
onAuthorize: handleAuthorize
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
45
58
|
return /*#__PURE__*/React.createElement(ResolvedView, blockCardProps);
|
|
46
59
|
case 'unauthorized':
|
|
47
60
|
return /*#__PURE__*/React.createElement(UnauthorisedView, _extends({}, blockCardProps, {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context/extractAccessContext';
|
|
5
6
|
import { extractEmbedProps } from '../../extractors/embed';
|
|
6
7
|
import { extractInlineProps } from '../../extractors/inline';
|
|
7
8
|
import { getExtensionKey, hasAuthScopeOverrides } from '../../state/helpers';
|
|
9
|
+
import { useControlDataExportConfig } from '../../state/hooks/use-control-data-export-config';
|
|
8
10
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
11
|
+
import { getIsDataExportEnabled } from '../../utils/should-data-export';
|
|
9
12
|
import BlockCardResolvedView from '../BlockCard/views/ResolvedView';
|
|
10
13
|
import { InlineCardResolvedView } from '../InlineCard/ResolvedView';
|
|
11
14
|
import { EmbedCardErroredView } from './views/ErroredView';
|
|
@@ -44,6 +47,9 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
44
47
|
const meta = details && details.meta;
|
|
45
48
|
const extensionKey = getExtensionKey(details);
|
|
46
49
|
const isProductIntegrationSupported = hasAuthScopeOverrides(details);
|
|
50
|
+
const {
|
|
51
|
+
shouldControlDataExport = false
|
|
52
|
+
} = useControlDataExportConfig();
|
|
47
53
|
switch (status) {
|
|
48
54
|
case 'pending':
|
|
49
55
|
case 'resolving':
|
|
@@ -67,6 +73,23 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
|
|
|
67
73
|
aspectRatio: (_resolvedViewProps$pr = resolvedViewProps.preview) === null || _resolvedViewProps$pr === void 0 ? void 0 : _resolvedViewProps$pr.aspectRatio
|
|
68
74
|
});
|
|
69
75
|
}
|
|
76
|
+
if (fg('platform_smart_links_controlled_dsp_export_view')) {
|
|
77
|
+
if (getIsDataExportEnabled(shouldControlDataExport, cardState.details)) {
|
|
78
|
+
const unauthViewProps = extractEmbedProps(data, meta, platform);
|
|
79
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
80
|
+
context: unauthViewProps.context,
|
|
81
|
+
extensionKey: extensionKey,
|
|
82
|
+
frameStyle: frameStyle,
|
|
83
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
84
|
+
inheritDimensions: inheritDimensions,
|
|
85
|
+
isSelected: isSelected,
|
|
86
|
+
onAuthorize: handleAuthorize,
|
|
87
|
+
onClick: handleFrameClick,
|
|
88
|
+
testId: testId,
|
|
89
|
+
url: unauthViewProps.link
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
70
93
|
if (resolvedViewProps.preview) {
|
|
71
94
|
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
|
|
72
95
|
isSelected: isSelected,
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "36.
|
|
13
|
+
packageVersion: "36.4.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
3
|
+
export var useControlDataExportConfig = function useControlDataExportConfig() {
|
|
4
|
+
var _useSmartLinkContext = useSmartLinkContext(),
|
|
5
|
+
connections = _useSmartLinkContext.connections,
|
|
6
|
+
product = _useSmartLinkContext.product,
|
|
7
|
+
shouldControlDataExport = _useSmartLinkContext.shouldControlDataExport;
|
|
8
|
+
return useMemo(function () {
|
|
9
|
+
return {
|
|
10
|
+
baseUrl: connections.client.baseUrlOverride,
|
|
11
|
+
envKey: connections.client.envKey,
|
|
12
|
+
product: product,
|
|
13
|
+
shouldControlDataExport: shouldControlDataExport
|
|
14
|
+
};
|
|
15
|
+
}, [connections.client.baseUrlOverride, connections.client.envKey, product, shouldControlDataExport]);
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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: "36.
|
|
7
|
+
packageVersion: "36.4.0"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export var getIsDataExportEnabled = function getIsDataExportEnabled() {
|
|
2
|
+
var _response$meta;
|
|
3
|
+
var shouldControlDataExport = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
4
|
+
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
5
|
+
return Boolean(shouldControlDataExport && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('ExportBlocked')));
|
|
6
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { useControlDataExportConfig } from '../../state/hooks/use-control-data-export-config';
|
|
5
|
+
import { getIsDataExportEnabled } from '../../utils/should-data-export';
|
|
3
6
|
import { handleClickCommon } from '../common/utils';
|
|
4
7
|
import { CardLinkView } from '../LinkView';
|
|
5
8
|
import ErroredView from './views/ErroredView';
|
|
@@ -34,6 +37,9 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
34
37
|
renderers: renderers,
|
|
35
38
|
actionOptions: actionOptions
|
|
36
39
|
};
|
|
40
|
+
var _useControlDataExport = useControlDataExportConfig(),
|
|
41
|
+
_useControlDataExport2 = _useControlDataExport.shouldControlDataExport,
|
|
42
|
+
shouldControlDataExport = _useControlDataExport2 === void 0 ? false : _useControlDataExport2;
|
|
37
43
|
switch (status) {
|
|
38
44
|
case 'pending':
|
|
39
45
|
case 'resolving':
|
|
@@ -41,6 +47,13 @@ export var BlockCard = function BlockCard(_ref) {
|
|
|
41
47
|
testId: "smart-block-resolving-view"
|
|
42
48
|
}));
|
|
43
49
|
case 'resolved':
|
|
50
|
+
if (fg('platform_smart_links_controlled_dsp_export_view')) {
|
|
51
|
+
if (getIsDataExportEnabled(shouldControlDataExport, cardState.details)) {
|
|
52
|
+
return /*#__PURE__*/React.createElement(UnauthorisedView, _extends({}, blockCardProps, {
|
|
53
|
+
onAuthorize: handleAuthorize
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
44
57
|
return /*#__PURE__*/React.createElement(ResolvedView, blockCardProps);
|
|
45
58
|
case 'unauthorized':
|
|
46
59
|
return /*#__PURE__*/React.createElement(UnauthorisedView, _extends({}, blockCardProps, {
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { extractRequestAccessContextImproved } from '../../extractors/common/context/extractAccessContext';
|
|
5
6
|
import { extractEmbedProps } from '../../extractors/embed';
|
|
6
7
|
import { extractInlineProps } from '../../extractors/inline';
|
|
7
8
|
import { getExtensionKey, hasAuthScopeOverrides } from '../../state/helpers';
|
|
9
|
+
import { useControlDataExportConfig } from '../../state/hooks/use-control-data-export-config';
|
|
8
10
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
11
|
+
import { getIsDataExportEnabled } from '../../utils/should-data-export';
|
|
9
12
|
import BlockCardResolvedView from '../BlockCard/views/ResolvedView';
|
|
10
13
|
import { InlineCardResolvedView } from '../InlineCard/ResolvedView';
|
|
11
14
|
import { EmbedCardErroredView } from './views/ErroredView';
|
|
@@ -40,6 +43,9 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
40
43
|
var meta = details && details.meta;
|
|
41
44
|
var extensionKey = getExtensionKey(details);
|
|
42
45
|
var isProductIntegrationSupported = hasAuthScopeOverrides(details);
|
|
46
|
+
var _useControlDataExport = useControlDataExportConfig(),
|
|
47
|
+
_useControlDataExport2 = _useControlDataExport.shouldControlDataExport,
|
|
48
|
+
shouldControlDataExport = _useControlDataExport2 === void 0 ? false : _useControlDataExport2;
|
|
43
49
|
switch (status) {
|
|
44
50
|
case 'pending':
|
|
45
51
|
case 'resolving':
|
|
@@ -63,6 +69,23 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
|
|
|
63
69
|
aspectRatio: (_resolvedViewProps$pr = resolvedViewProps.preview) === null || _resolvedViewProps$pr === void 0 ? void 0 : _resolvedViewProps$pr.aspectRatio
|
|
64
70
|
});
|
|
65
71
|
}
|
|
72
|
+
if (fg('platform_smart_links_controlled_dsp_export_view')) {
|
|
73
|
+
if (getIsDataExportEnabled(shouldControlDataExport, cardState.details)) {
|
|
74
|
+
var unauthViewProps = extractEmbedProps(data, meta, platform);
|
|
75
|
+
return /*#__PURE__*/React.createElement(UnauthorizedView, {
|
|
76
|
+
context: unauthViewProps.context,
|
|
77
|
+
extensionKey: extensionKey,
|
|
78
|
+
frameStyle: frameStyle,
|
|
79
|
+
isProductIntegrationSupported: isProductIntegrationSupported,
|
|
80
|
+
inheritDimensions: inheritDimensions,
|
|
81
|
+
isSelected: isSelected,
|
|
82
|
+
onAuthorize: handleAuthorize,
|
|
83
|
+
onClick: handleFrameClick,
|
|
84
|
+
testId: testId,
|
|
85
|
+
url: unauthViewProps.link
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
66
89
|
if (resolvedViewProps.preview) {
|
|
67
90
|
return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
|
|
68
91
|
isSelected: isSelected,
|
|
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
13
13
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
14
14
|
var PACKAGE_DATA = {
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "36.
|
|
16
|
+
packageVersion: "36.4.0",
|
|
17
17
|
componentName: 'linkUrl'
|
|
18
18
|
};
|
|
19
19
|
var Anchor = withLinkClickedEvent('a');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "36.
|
|
3
|
+
"version": "36.4.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/dropdown-menu": "^14.0.0",
|
|
39
39
|
"@atlaskit/form": "^12.0.0",
|
|
40
40
|
"@atlaskit/frontend-utilities": "^3.0.0",
|
|
41
|
-
"@atlaskit/heading": "^5.
|
|
41
|
+
"@atlaskit/heading": "^5.2.0",
|
|
42
42
|
"@atlaskit/icon": "^25.5.0",
|
|
43
43
|
"@atlaskit/icon-file-type": "^7.0.0",
|
|
44
44
|
"@atlaskit/icon-lab": "^4.6.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
62
|
"@atlaskit/popup": "^4.0.0",
|
|
63
|
-
"@atlaskit/primitives": "^14.
|
|
63
|
+
"@atlaskit/primitives": "^14.4.0",
|
|
64
64
|
"@atlaskit/section-message": "^8.2.0",
|
|
65
65
|
"@atlaskit/select": "^20.2.0",
|
|
66
66
|
"@atlaskit/spinner": "^18.0.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"uuid": "^3.1.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/link-provider": "^2.
|
|
88
|
+
"@atlaskit/link-provider": "^2.1.0",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|
|
91
91
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -212,6 +212,9 @@
|
|
|
212
212
|
"fix_a11y_violation_in_hover_card_trigger": {
|
|
213
213
|
"type": "boolean"
|
|
214
214
|
},
|
|
215
|
+
"platform_smart_links_controlled_dsp_export_view": {
|
|
216
|
+
"type": "boolean"
|
|
217
|
+
},
|
|
215
218
|
"platform-linking-visual-refresh-v2": {
|
|
216
219
|
"type": "boolean"
|
|
217
220
|
}
|