@atlaskit/smart-card 45.20.3 → 45.20.5
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 +18 -0
- package/dist/cjs/extractors/common/context/index.js +0 -14
- package/dist/cjs/extractors/embed/extract-smart-link-context.js +39 -0
- package/dist/cjs/extractors/embed/index.js +2 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedCard/views/forbidden-view/index.js +4 -0
- package/dist/cjs/view/EmbedCard/views/not-found-view/index.js +4 -0
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +2 -0
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +13 -4
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/common/context/index.js +0 -13
- package/dist/es2019/extractors/embed/extract-smart-link-context.js +31 -0
- package/dist/es2019/extractors/embed/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedCard/views/forbidden-view/index.js +4 -0
- package/dist/es2019/view/EmbedCard/views/not-found-view/index.js +4 -0
- package/dist/es2019/view/EmbedCard/views/unauthorized-view/index.js +2 -0
- package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +13 -4
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/common/context/index.js +0 -13
- package/dist/esm/extractors/embed/extract-smart-link-context.js +33 -0
- package/dist/esm/extractors/embed/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedCard/views/forbidden-view/index.js +4 -0
- package/dist/esm/view/EmbedCard/views/not-found-view/index.js +4 -0
- package/dist/esm/view/EmbedCard/views/unauthorized-view/index.js +2 -0
- package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +13 -4
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/extractors/common/context/index.d.ts +0 -5
- package/dist/types/extractors/embed/extract-smart-link-context.d.ts +6 -0
- package/dist/types/view/EmbedCard/types.d.ts +4 -0
- package/dist/types/view/EmbedCard/views/unresolved-view/index.d.ts +1 -1
- package/dist/types/view/EmbedCard/views/unresolved-view/types.d.ts +7 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.20.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8d869cadd115d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8d869cadd115d) -
|
|
8
|
+
Restore generator icons for Smart Link provider badges when entity-specific icons are available.
|
|
9
|
+
Resolved embeds keep the entity icon next to the resource title. Unresolved embeds show the
|
|
10
|
+
provider icon next to the provider name. Gate OFF preserves current entity icons in provider
|
|
11
|
+
badges; gate ON uses generator icons for provider branding. All changes behind feature gate:
|
|
12
|
+
`platform_lp_use_generator_icon_for_provider`.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 45.20.4
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 45.20.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -10,15 +10,11 @@ Object.defineProperty(exports, "extractRequestAccessContextImproved", {
|
|
|
10
10
|
return _extractAccessContext.extractRequestAccessContextImproved;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
exports.extractSmartLinkContext = extractSmartLinkContext;
|
|
14
13
|
exports.generateContext = generateContext;
|
|
15
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _extractEntityProvider = require("@atlaskit/link-extractors/extract-entity-provider");
|
|
17
15
|
var _extractProvider = require("@atlaskit/link-extractors/extract-provider");
|
|
18
16
|
var _extractProviderIcon = require("@atlaskit/link-extractors/extract-provider-icon");
|
|
19
17
|
var _extractUrlFromIconJsonLd = require("@atlaskit/link-extractors/extract-url-from-icon-json-ld");
|
|
20
|
-
var _isEntityPresent = require("@atlaskit/link-extractors/is-entity-present");
|
|
21
|
-
var _jsonld = require("../../../utils/jsonld");
|
|
22
18
|
var _prioritiseIcon = require("../icon/prioritiseIcon");
|
|
23
19
|
var _extractAccessContext = require("./extractAccessContext");
|
|
24
20
|
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; }
|
|
@@ -44,14 +40,4 @@ function generateContext(jsonLd) {
|
|
|
44
40
|
return _objectSpread(_objectSpread({}, provider), {}, {
|
|
45
41
|
icon: icon ? icon : provider.icon
|
|
46
42
|
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Should be moved to link-extractors when jsonLd is deprecated
|
|
51
|
-
*/
|
|
52
|
-
function extractSmartLinkContext(response) {
|
|
53
|
-
if ((0, _isEntityPresent.isEntityPresent)(response)) {
|
|
54
|
-
return (0, _extractEntityProvider.extractEntityProvider)(response);
|
|
55
|
-
}
|
|
56
|
-
return generateContext((response === null || response === void 0 ? void 0 : response.data) || (0, _jsonld.getEmptyJsonLd)());
|
|
57
43
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.extractSmartLinkContext = extractSmartLinkContext;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _extractEntityIcon = require("@atlaskit/link-extractors/extract-entity-icon");
|
|
10
|
+
var _extractEntityProvider = require("@atlaskit/link-extractors/extract-entity-provider");
|
|
11
|
+
var _isEntityPresent = require("@atlaskit/link-extractors/is-entity-present");
|
|
12
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
|
+
var _jsonld = require("../../utils/jsonld");
|
|
14
|
+
var _context = require("../common/context");
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
/**
|
|
18
|
+
* Should be moved to link-extractors when jsonLd is deprecated
|
|
19
|
+
*/
|
|
20
|
+
function extractSmartLinkContext(response) {
|
|
21
|
+
if ((0, _isEntityPresent.isEntityPresent)(response)) {
|
|
22
|
+
if ((0, _fg.fg)('platform_lp_use_generator_icon_for_provider')) {
|
|
23
|
+
var _entityIcon$url, _entityIcon$label;
|
|
24
|
+
var entityProvider = (0, _extractEntityProvider.extractEntityProvider)(response);
|
|
25
|
+
if (!entityProvider) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
var entityIcon = (0, _extractEntityIcon.extractEntityIcon)(response);
|
|
29
|
+
return _objectSpread(_objectSpread({}, entityProvider), {}, {
|
|
30
|
+
icon: (_entityIcon$url = entityIcon === null || entityIcon === void 0 ? void 0 : entityIcon.url) !== null && _entityIcon$url !== void 0 ? _entityIcon$url : entityProvider.icon,
|
|
31
|
+
iconLabel: (_entityIcon$label = entityIcon === null || entityIcon === void 0 ? void 0 : entityIcon.label) !== null && _entityIcon$label !== void 0 ? _entityIcon$label : entityProvider.iconLabel,
|
|
32
|
+
providerIcon: entityProvider.icon,
|
|
33
|
+
providerIconLabel: entityProvider.iconLabel
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return (0, _extractEntityProvider.extractEntityProvider)(response);
|
|
37
|
+
}
|
|
38
|
+
return (0, _context.generateContext)((response === null || response === void 0 ? void 0 : response.data) || (0, _jsonld.getEmptyJsonLd)());
|
|
39
|
+
}
|
|
@@ -9,7 +9,7 @@ var _extractSmartLinkTitle = require("@atlaskit/link-extractors/extract-smart-li
|
|
|
9
9
|
var _extractSmartLinkUrl = require("@atlaskit/link-extractors/extract-smart-link-url");
|
|
10
10
|
var _extractType = require("@atlaskit/link-extractors/extract-type");
|
|
11
11
|
var _jsonld = require("../../utils/jsonld");
|
|
12
|
-
var
|
|
12
|
+
var _extractSmartLinkContext = require("./extract-smart-link-context");
|
|
13
13
|
var _extractIsSupportTheming = require("../common/meta/extractIsSupportTheming");
|
|
14
14
|
var _extractIsTrusted = require("../common/meta/extractIsTrusted");
|
|
15
15
|
var extractEmbedProps = exports.extractEmbedProps = function extractEmbedProps(response, _platform, iframeUrlType) {
|
|
@@ -18,7 +18,7 @@ var extractEmbedProps = exports.extractEmbedProps = function extractEmbedProps(r
|
|
|
18
18
|
return {
|
|
19
19
|
link: (0, _extractSmartLinkUrl.extractSmartLinkUrl)(response) || '',
|
|
20
20
|
title: (0, _extractSmartLinkTitle.extractSmartLinkTitle)(response),
|
|
21
|
-
context: (0,
|
|
21
|
+
context: (0, _extractSmartLinkContext.extractSmartLinkContext)(response),
|
|
22
22
|
preview: (0, _extractSmartLinkEmbed.extractSmartLinkEmbed)(response, iframeUrlType),
|
|
23
23
|
isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
|
|
24
24
|
isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta),
|
|
@@ -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.20.
|
|
14
|
+
packageVersion: "45.20.4" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -27,6 +27,8 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
27
27
|
var _ref2 = context !== null && context !== void 0 ? context : {},
|
|
28
28
|
icon = _ref2.icon,
|
|
29
29
|
image = _ref2.image,
|
|
30
|
+
providerIcon = _ref2.providerIcon,
|
|
31
|
+
providerIconLabel = _ref2.providerIconLabel,
|
|
30
32
|
_ref2$text = _ref2.text,
|
|
31
33
|
text = _ref2$text === void 0 ? '' : _ref2$text;
|
|
32
34
|
var _ref3 = accessContext !== null && accessContext !== void 0 ? accessContext : {},
|
|
@@ -68,6 +70,8 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
68
70
|
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorize, values]);
|
|
69
71
|
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, unresolvedViewProps, {
|
|
70
72
|
icon: icon,
|
|
73
|
+
providerIcon: providerIcon,
|
|
74
|
+
providerIconLabel: providerIconLabel,
|
|
71
75
|
image: image !== null && image !== void 0 ? image : /*#__PURE__*/_react.default.createElement(_forbiddenSvg.ForbiddenSVG, null),
|
|
72
76
|
testId: testId,
|
|
73
77
|
text: text,
|
|
@@ -25,6 +25,8 @@ var NotFoundView = function NotFoundView(_ref) {
|
|
|
25
25
|
var _ref2 = context !== null && context !== void 0 ? context : {},
|
|
26
26
|
icon = _ref2.icon,
|
|
27
27
|
image = _ref2.image,
|
|
28
|
+
providerIcon = _ref2.providerIcon,
|
|
29
|
+
providerIconLabel = _ref2.providerIconLabel,
|
|
28
30
|
_ref2$text = _ref2.text,
|
|
29
31
|
text = _ref2$text === void 0 ? '' : _ref2$text;
|
|
30
32
|
var _ref3 = accessContext !== null && accessContext !== void 0 ? accessContext : {},
|
|
@@ -37,6 +39,8 @@ var NotFoundView = function NotFoundView(_ref) {
|
|
|
37
39
|
}, [text]);
|
|
38
40
|
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, unresolvedViewProps, {
|
|
39
41
|
icon: icon,
|
|
42
|
+
providerIcon: providerIcon,
|
|
43
|
+
providerIconLabel: providerIconLabel,
|
|
40
44
|
image: image !== null && image !== void 0 ? image : /*#__PURE__*/_react.default.createElement(_notFoundSvg.NotFoundSVG, null),
|
|
41
45
|
testId: testId,
|
|
42
46
|
text: text,
|
|
@@ -93,6 +93,8 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
93
93
|
}, [context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorize, testId]);
|
|
94
94
|
return /*#__PURE__*/_react.default.createElement(_unresolvedView.default, (0, _extends2.default)({}, unresolvedViewProps, content, {
|
|
95
95
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
96
|
+
providerIcon: context === null || context === void 0 ? void 0 : context.providerIcon,
|
|
97
|
+
providerIconLabel: context === null || context === void 0 ? void 0 : context.providerIconLabel,
|
|
96
98
|
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : /*#__PURE__*/_react.default.createElement(_unauthorizedSvg.UnauthorizedSVG, null),
|
|
97
99
|
testId: testId,
|
|
98
100
|
text: context === null || context === void 0 ? void 0 : context.text
|
|
@@ -12,6 +12,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _heading = _interopRequireDefault(require("@atlaskit/heading/heading"));
|
|
14
14
|
var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
|
|
15
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
15
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
16
17
|
var _ExpandedFrame = require("../../components/ExpandedFrame");
|
|
17
18
|
var _ImageIcon = require("../../components/ImageIcon");
|
|
@@ -28,23 +29,31 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
28
29
|
inheritDimensions = _ref.inheritDimensions,
|
|
29
30
|
isSelected = _ref.isSelected,
|
|
30
31
|
onClick = _ref.onClick,
|
|
32
|
+
providerIcon = _ref.providerIcon,
|
|
33
|
+
providerIconLabel = _ref.providerIconLabel,
|
|
31
34
|
testId = _ref.testId,
|
|
32
35
|
text = _ref.text,
|
|
33
36
|
title = _ref.title,
|
|
34
37
|
url = _ref.url;
|
|
38
|
+
// Unresolved embeds have no entity title. The frame shows the provider name, so
|
|
39
|
+
// pair it with the provider/generator icon rather than the entity-type icon.
|
|
40
|
+
var shouldUseProviderIcon = providerIcon != null && (0, _fg.fg)('platform_lp_use_generator_icon_for_provider');
|
|
41
|
+
var frameIconUrlOrElement = shouldUseProviderIcon ? providerIcon : iconUrlOrElement;
|
|
42
|
+
var frameIconLabel = shouldUseProviderIcon ? providerIconLabel : undefined;
|
|
35
43
|
var icon = (0, _react.useMemo)(function () {
|
|
36
|
-
if ( /*#__PURE__*/_react.default.isValidElement(
|
|
37
|
-
return
|
|
44
|
+
if ( /*#__PURE__*/_react.default.isValidElement(frameIconUrlOrElement)) {
|
|
45
|
+
return frameIconUrlOrElement;
|
|
38
46
|
}
|
|
39
47
|
return /*#__PURE__*/_react.default.createElement(_ImageIcon.ImageIcon, {
|
|
40
|
-
src: typeof
|
|
48
|
+
src: typeof frameIconUrlOrElement === 'string' ? frameIconUrlOrElement : undefined,
|
|
49
|
+
alt: frameIconLabel,
|
|
41
50
|
default: /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
42
51
|
label: "icon",
|
|
43
52
|
testId: "embed-card-fallback-icon",
|
|
44
53
|
color: "currentColor"
|
|
45
54
|
})
|
|
46
55
|
});
|
|
47
|
-
}, [
|
|
56
|
+
}, [frameIconLabel, frameIconUrlOrElement]);
|
|
48
57
|
var image = (0, _react.useMemo)(function () {
|
|
49
58
|
if (!imageUrlOrElement) {
|
|
50
59
|
return null;
|
|
@@ -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.20.
|
|
22
|
+
packageVersion: "45.20.4",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { extractEntityProvider } from '@atlaskit/link-extractors/extract-entity-provider';
|
|
2
1
|
import { extractProvider } from '@atlaskit/link-extractors/extract-provider';
|
|
3
2
|
import { extractProviderIcon } from '@atlaskit/link-extractors/extract-provider-icon';
|
|
4
3
|
import { extractUrlFromIconJsonLd } from '@atlaskit/link-extractors/extract-url-from-icon-json-ld';
|
|
5
|
-
import { isEntityPresent } from '@atlaskit/link-extractors/is-entity-present';
|
|
6
|
-
import { getEmptyJsonLd } from '../../../utils/jsonld';
|
|
7
4
|
import { prioritiseIcon } from '../icon/prioritiseIcon';
|
|
8
5
|
export { extractRequestAccessContextImproved } from './extractAccessContext';
|
|
9
6
|
export function generateContext(jsonLd) {
|
|
@@ -28,14 +25,4 @@ export function generateContext(jsonLd) {
|
|
|
28
25
|
...provider,
|
|
29
26
|
icon: icon ? icon : provider.icon
|
|
30
27
|
};
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Should be moved to link-extractors when jsonLd is deprecated
|
|
35
|
-
*/
|
|
36
|
-
export function extractSmartLinkContext(response) {
|
|
37
|
-
if (isEntityPresent(response)) {
|
|
38
|
-
return extractEntityProvider(response);
|
|
39
|
-
}
|
|
40
|
-
return generateContext((response === null || response === void 0 ? void 0 : response.data) || getEmptyJsonLd());
|
|
41
28
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { extractEntityIcon } from '@atlaskit/link-extractors/extract-entity-icon';
|
|
2
|
+
import { extractEntityProvider } from '@atlaskit/link-extractors/extract-entity-provider';
|
|
3
|
+
import { isEntityPresent } from '@atlaskit/link-extractors/is-entity-present';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
5
|
+
import { getEmptyJsonLd } from '../../utils/jsonld';
|
|
6
|
+
import { generateContext } from '../common/context';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Should be moved to link-extractors when jsonLd is deprecated
|
|
10
|
+
*/
|
|
11
|
+
export function extractSmartLinkContext(response) {
|
|
12
|
+
if (isEntityPresent(response)) {
|
|
13
|
+
if (fg('platform_lp_use_generator_icon_for_provider')) {
|
|
14
|
+
var _entityIcon$url, _entityIcon$label;
|
|
15
|
+
const entityProvider = extractEntityProvider(response);
|
|
16
|
+
if (!entityProvider) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const entityIcon = extractEntityIcon(response);
|
|
20
|
+
return {
|
|
21
|
+
...entityProvider,
|
|
22
|
+
icon: (_entityIcon$url = entityIcon === null || entityIcon === void 0 ? void 0 : entityIcon.url) !== null && _entityIcon$url !== void 0 ? _entityIcon$url : entityProvider.icon,
|
|
23
|
+
iconLabel: (_entityIcon$label = entityIcon === null || entityIcon === void 0 ? void 0 : entityIcon.label) !== null && _entityIcon$label !== void 0 ? _entityIcon$label : entityProvider.iconLabel,
|
|
24
|
+
providerIcon: entityProvider.icon,
|
|
25
|
+
providerIconLabel: entityProvider.iconLabel
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return extractEntityProvider(response);
|
|
29
|
+
}
|
|
30
|
+
return generateContext((response === null || response === void 0 ? void 0 : response.data) || getEmptyJsonLd());
|
|
31
|
+
}
|
|
@@ -3,7 +3,7 @@ import { extractSmartLinkTitle } from '@atlaskit/link-extractors/extract-smart-l
|
|
|
3
3
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-link-url';
|
|
4
4
|
import { extractType } from '@atlaskit/link-extractors/extract-type';
|
|
5
5
|
import { getEmptyJsonLd } from '../../utils/jsonld';
|
|
6
|
-
import { extractSmartLinkContext } from '
|
|
6
|
+
import { extractSmartLinkContext } from './extract-smart-link-context';
|
|
7
7
|
import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
|
|
8
8
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
9
9
|
export const extractEmbedProps = (response, _platform, iframeUrlType) => {
|
|
@@ -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.20.
|
|
5
|
+
packageVersion: "45.20.4" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -16,6 +16,8 @@ const ForbiddenView = ({
|
|
|
16
16
|
const {
|
|
17
17
|
icon,
|
|
18
18
|
image,
|
|
19
|
+
providerIcon,
|
|
20
|
+
providerIconLabel,
|
|
19
21
|
text = ''
|
|
20
22
|
} = context !== null && context !== void 0 ? context : {};
|
|
21
23
|
const {
|
|
@@ -58,6 +60,8 @@ const ForbiddenView = ({
|
|
|
58
60
|
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorize, values]);
|
|
59
61
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
60
62
|
icon: icon,
|
|
63
|
+
providerIcon: providerIcon,
|
|
64
|
+
providerIconLabel: providerIconLabel,
|
|
61
65
|
image: image !== null && image !== void 0 ? image : /*#__PURE__*/React.createElement(ForbiddenSVG, null),
|
|
62
66
|
testId: testId,
|
|
63
67
|
text: text,
|
|
@@ -14,6 +14,8 @@ const NotFoundView = ({
|
|
|
14
14
|
const {
|
|
15
15
|
icon,
|
|
16
16
|
image,
|
|
17
|
+
providerIcon,
|
|
18
|
+
providerIconLabel,
|
|
17
19
|
text = ''
|
|
18
20
|
} = context !== null && context !== void 0 ? context : {};
|
|
19
21
|
const {
|
|
@@ -25,6 +27,8 @@ const NotFoundView = ({
|
|
|
25
27
|
}), [text]);
|
|
26
28
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
27
29
|
icon: icon,
|
|
30
|
+
providerIcon: providerIcon,
|
|
31
|
+
providerIconLabel: providerIconLabel,
|
|
28
32
|
image: image !== null && image !== void 0 ? image : /*#__PURE__*/React.createElement(NotFoundSVG, null),
|
|
29
33
|
testId: testId,
|
|
30
34
|
text: text,
|
|
@@ -83,6 +83,8 @@ const UnauthorizedView = ({
|
|
|
83
83
|
}, [context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorize, testId]);
|
|
84
84
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, content, {
|
|
85
85
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
86
|
+
providerIcon: context === null || context === void 0 ? void 0 : context.providerIcon,
|
|
87
|
+
providerIconLabel: context === null || context === void 0 ? void 0 : context.providerIconLabel,
|
|
86
88
|
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : /*#__PURE__*/React.createElement(UnauthorizedSVG, null),
|
|
87
89
|
testId: testId,
|
|
88
90
|
text: context === null || context === void 0 ? void 0 : context.text
|
|
@@ -4,6 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import Heading from '@atlaskit/heading/heading';
|
|
6
6
|
import LinkGlyph from '@atlaskit/icon/core/link';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
8
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
8
9
|
import { ExpandedFrame } from '../../components/ExpandedFrame';
|
|
9
10
|
import { ImageIcon } from '../../components/ImageIcon';
|
|
@@ -19,24 +20,32 @@ const UnresolvedView = ({
|
|
|
19
20
|
inheritDimensions,
|
|
20
21
|
isSelected,
|
|
21
22
|
onClick,
|
|
23
|
+
providerIcon,
|
|
24
|
+
providerIconLabel,
|
|
22
25
|
testId,
|
|
23
26
|
text,
|
|
24
27
|
title,
|
|
25
28
|
url
|
|
26
29
|
}) => {
|
|
30
|
+
// Unresolved embeds have no entity title. The frame shows the provider name, so
|
|
31
|
+
// pair it with the provider/generator icon rather than the entity-type icon.
|
|
32
|
+
const shouldUseProviderIcon = providerIcon != null && fg('platform_lp_use_generator_icon_for_provider');
|
|
33
|
+
const frameIconUrlOrElement = shouldUseProviderIcon ? providerIcon : iconUrlOrElement;
|
|
34
|
+
const frameIconLabel = shouldUseProviderIcon ? providerIconLabel : undefined;
|
|
27
35
|
const icon = useMemo(() => {
|
|
28
|
-
if ( /*#__PURE__*/React.isValidElement(
|
|
29
|
-
return
|
|
36
|
+
if ( /*#__PURE__*/React.isValidElement(frameIconUrlOrElement)) {
|
|
37
|
+
return frameIconUrlOrElement;
|
|
30
38
|
}
|
|
31
39
|
return /*#__PURE__*/React.createElement(ImageIcon, {
|
|
32
|
-
src: typeof
|
|
40
|
+
src: typeof frameIconUrlOrElement === 'string' ? frameIconUrlOrElement : undefined,
|
|
41
|
+
alt: frameIconLabel,
|
|
33
42
|
default: /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
34
43
|
label: "icon",
|
|
35
44
|
testId: "embed-card-fallback-icon",
|
|
36
45
|
color: "currentColor"
|
|
37
46
|
})
|
|
38
47
|
});
|
|
39
|
-
}, [
|
|
48
|
+
}, [frameIconLabel, frameIconUrlOrElement]);
|
|
40
49
|
const image = useMemo(() => {
|
|
41
50
|
if (!imageUrlOrElement) {
|
|
42
51
|
return null;
|
|
@@ -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.20.
|
|
12
|
+
packageVersion: "45.20.4",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
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
|
-
import { extractEntityProvider } from '@atlaskit/link-extractors/extract-entity-provider';
|
|
5
4
|
import { extractProvider } from '@atlaskit/link-extractors/extract-provider';
|
|
6
5
|
import { extractProviderIcon } from '@atlaskit/link-extractors/extract-provider-icon';
|
|
7
6
|
import { extractUrlFromIconJsonLd } from '@atlaskit/link-extractors/extract-url-from-icon-json-ld';
|
|
8
|
-
import { isEntityPresent } from '@atlaskit/link-extractors/is-entity-present';
|
|
9
|
-
import { getEmptyJsonLd } from '../../../utils/jsonld';
|
|
10
7
|
import { prioritiseIcon } from '../icon/prioritiseIcon';
|
|
11
8
|
export { extractRequestAccessContextImproved } from './extractAccessContext';
|
|
12
9
|
export function generateContext(jsonLd) {
|
|
@@ -30,14 +27,4 @@ export function generateContext(jsonLd) {
|
|
|
30
27
|
return _objectSpread(_objectSpread({}, provider), {}, {
|
|
31
28
|
icon: icon ? icon : provider.icon
|
|
32
29
|
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Should be moved to link-extractors when jsonLd is deprecated
|
|
37
|
-
*/
|
|
38
|
-
export function extractSmartLinkContext(response) {
|
|
39
|
-
if (isEntityPresent(response)) {
|
|
40
|
-
return extractEntityProvider(response);
|
|
41
|
-
}
|
|
42
|
-
return generateContext((response === null || response === void 0 ? void 0 : response.data) || getEmptyJsonLd());
|
|
43
30
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
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
|
+
import { extractEntityIcon } from '@atlaskit/link-extractors/extract-entity-icon';
|
|
5
|
+
import { extractEntityProvider } from '@atlaskit/link-extractors/extract-entity-provider';
|
|
6
|
+
import { isEntityPresent } from '@atlaskit/link-extractors/is-entity-present';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
|
+
import { getEmptyJsonLd } from '../../utils/jsonld';
|
|
9
|
+
import { generateContext } from '../common/context';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Should be moved to link-extractors when jsonLd is deprecated
|
|
13
|
+
*/
|
|
14
|
+
export function extractSmartLinkContext(response) {
|
|
15
|
+
if (isEntityPresent(response)) {
|
|
16
|
+
if (fg('platform_lp_use_generator_icon_for_provider')) {
|
|
17
|
+
var _entityIcon$url, _entityIcon$label;
|
|
18
|
+
var entityProvider = extractEntityProvider(response);
|
|
19
|
+
if (!entityProvider) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
var entityIcon = extractEntityIcon(response);
|
|
23
|
+
return _objectSpread(_objectSpread({}, entityProvider), {}, {
|
|
24
|
+
icon: (_entityIcon$url = entityIcon === null || entityIcon === void 0 ? void 0 : entityIcon.url) !== null && _entityIcon$url !== void 0 ? _entityIcon$url : entityProvider.icon,
|
|
25
|
+
iconLabel: (_entityIcon$label = entityIcon === null || entityIcon === void 0 ? void 0 : entityIcon.label) !== null && _entityIcon$label !== void 0 ? _entityIcon$label : entityProvider.iconLabel,
|
|
26
|
+
providerIcon: entityProvider.icon,
|
|
27
|
+
providerIconLabel: entityProvider.iconLabel
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return extractEntityProvider(response);
|
|
31
|
+
}
|
|
32
|
+
return generateContext((response === null || response === void 0 ? void 0 : response.data) || getEmptyJsonLd());
|
|
33
|
+
}
|
|
@@ -3,7 +3,7 @@ import { extractSmartLinkTitle } from '@atlaskit/link-extractors/extract-smart-l
|
|
|
3
3
|
import { extractSmartLinkUrl } from '@atlaskit/link-extractors/extract-smart-link-url';
|
|
4
4
|
import { extractType } from '@atlaskit/link-extractors/extract-type';
|
|
5
5
|
import { getEmptyJsonLd } from '../../utils/jsonld';
|
|
6
|
-
import { extractSmartLinkContext } from '
|
|
6
|
+
import { extractSmartLinkContext } from './extract-smart-link-context';
|
|
7
7
|
import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
|
|
8
8
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
9
9
|
export var extractEmbedProps = function extractEmbedProps(response, _platform, iframeUrlType) {
|
|
@@ -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.20.
|
|
7
|
+
packageVersion: "45.20.4" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -18,6 +18,8 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
18
18
|
var _ref2 = context !== null && context !== void 0 ? context : {},
|
|
19
19
|
icon = _ref2.icon,
|
|
20
20
|
image = _ref2.image,
|
|
21
|
+
providerIcon = _ref2.providerIcon,
|
|
22
|
+
providerIconLabel = _ref2.providerIconLabel,
|
|
21
23
|
_ref2$text = _ref2.text,
|
|
22
24
|
text = _ref2$text === void 0 ? '' : _ref2$text;
|
|
23
25
|
var _ref3 = accessContext !== null && accessContext !== void 0 ? accessContext : {},
|
|
@@ -59,6 +61,8 @@ var ForbiddenView = function ForbiddenView(_ref) {
|
|
|
59
61
|
}, [accessType, action === null || action === void 0 ? void 0 : action.id, action === null || action === void 0 ? void 0 : action.promise, callToActionMessageKey, onAuthorize, values]);
|
|
60
62
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
61
63
|
icon: icon,
|
|
64
|
+
providerIcon: providerIcon,
|
|
65
|
+
providerIconLabel: providerIconLabel,
|
|
62
66
|
image: image !== null && image !== void 0 ? image : /*#__PURE__*/React.createElement(ForbiddenSVG, null),
|
|
63
67
|
testId: testId,
|
|
64
68
|
text: text,
|
|
@@ -16,6 +16,8 @@ var NotFoundView = function NotFoundView(_ref) {
|
|
|
16
16
|
var _ref2 = context !== null && context !== void 0 ? context : {},
|
|
17
17
|
icon = _ref2.icon,
|
|
18
18
|
image = _ref2.image,
|
|
19
|
+
providerIcon = _ref2.providerIcon,
|
|
20
|
+
providerIconLabel = _ref2.providerIconLabel,
|
|
19
21
|
_ref2$text = _ref2.text,
|
|
20
22
|
text = _ref2$text === void 0 ? '' : _ref2$text;
|
|
21
23
|
var _ref3 = accessContext !== null && accessContext !== void 0 ? accessContext : {},
|
|
@@ -28,6 +30,8 @@ var NotFoundView = function NotFoundView(_ref) {
|
|
|
28
30
|
}, [text]);
|
|
29
31
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, {
|
|
30
32
|
icon: icon,
|
|
33
|
+
providerIcon: providerIcon,
|
|
34
|
+
providerIconLabel: providerIconLabel,
|
|
31
35
|
image: image !== null && image !== void 0 ? image : /*#__PURE__*/React.createElement(NotFoundSVG, null),
|
|
32
36
|
testId: testId,
|
|
33
37
|
text: text,
|
|
@@ -84,6 +84,8 @@ var UnauthorizedView = function UnauthorizedView(_ref) {
|
|
|
84
84
|
}, [context === null || context === void 0 ? void 0 : context.text, handleOnAuthorizeClick, isProductIntegrationSupported, onAuthorize, testId]);
|
|
85
85
|
return /*#__PURE__*/React.createElement(UnresolvedView, _extends({}, unresolvedViewProps, content, {
|
|
86
86
|
icon: context === null || context === void 0 ? void 0 : context.icon,
|
|
87
|
+
providerIcon: context === null || context === void 0 ? void 0 : context.providerIcon,
|
|
88
|
+
providerIconLabel: context === null || context === void 0 ? void 0 : context.providerIconLabel,
|
|
87
89
|
image: (_context$image = context === null || context === void 0 ? void 0 : context.image) !== null && _context$image !== void 0 ? _context$image : /*#__PURE__*/React.createElement(UnauthorizedSVG, null),
|
|
88
90
|
testId: testId,
|
|
89
91
|
text: context === null || context === void 0 ? void 0 : context.text
|
|
@@ -4,6 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
5
|
import Heading from '@atlaskit/heading/heading';
|
|
6
6
|
import LinkGlyph from '@atlaskit/icon/core/link';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
8
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
8
9
|
import { ExpandedFrame } from '../../components/ExpandedFrame';
|
|
9
10
|
import { ImageIcon } from '../../components/ImageIcon';
|
|
@@ -19,23 +20,31 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
19
20
|
inheritDimensions = _ref.inheritDimensions,
|
|
20
21
|
isSelected = _ref.isSelected,
|
|
21
22
|
onClick = _ref.onClick,
|
|
23
|
+
providerIcon = _ref.providerIcon,
|
|
24
|
+
providerIconLabel = _ref.providerIconLabel,
|
|
22
25
|
testId = _ref.testId,
|
|
23
26
|
text = _ref.text,
|
|
24
27
|
title = _ref.title,
|
|
25
28
|
url = _ref.url;
|
|
29
|
+
// Unresolved embeds have no entity title. The frame shows the provider name, so
|
|
30
|
+
// pair it with the provider/generator icon rather than the entity-type icon.
|
|
31
|
+
var shouldUseProviderIcon = providerIcon != null && fg('platform_lp_use_generator_icon_for_provider');
|
|
32
|
+
var frameIconUrlOrElement = shouldUseProviderIcon ? providerIcon : iconUrlOrElement;
|
|
33
|
+
var frameIconLabel = shouldUseProviderIcon ? providerIconLabel : undefined;
|
|
26
34
|
var icon = useMemo(function () {
|
|
27
|
-
if ( /*#__PURE__*/React.isValidElement(
|
|
28
|
-
return
|
|
35
|
+
if ( /*#__PURE__*/React.isValidElement(frameIconUrlOrElement)) {
|
|
36
|
+
return frameIconUrlOrElement;
|
|
29
37
|
}
|
|
30
38
|
return /*#__PURE__*/React.createElement(ImageIcon, {
|
|
31
|
-
src: typeof
|
|
39
|
+
src: typeof frameIconUrlOrElement === 'string' ? frameIconUrlOrElement : undefined,
|
|
40
|
+
alt: frameIconLabel,
|
|
32
41
|
default: /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
33
42
|
label: "icon",
|
|
34
43
|
testId: "embed-card-fallback-icon",
|
|
35
44
|
color: "currentColor"
|
|
36
45
|
})
|
|
37
46
|
});
|
|
38
|
-
}, [
|
|
47
|
+
}, [frameIconLabel, frameIconUrlOrElement]);
|
|
39
48
|
var image = useMemo(function () {
|
|
40
49
|
if (!imageUrlOrElement) {
|
|
41
50
|
return null;
|
|
@@ -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.20.
|
|
15
|
+
packageVersion: "45.20.4",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { JsonLd } from '@atlaskit/json-ld-types/jsonld';
|
|
2
2
|
import type { LinkProvider } from '@atlaskit/link-extractors/types';
|
|
3
|
-
import type { SmartLinkResponse } from '@atlaskit/linking-types/smart-link';
|
|
4
3
|
export { extractRequestAccessContextImproved } from './extractAccessContext';
|
|
5
4
|
export declare function generateContext(jsonLd: JsonLd.Data.BaseData): LinkProvider | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Should be moved to link-extractors when jsonLd is deprecated
|
|
8
|
-
*/
|
|
9
|
-
export declare function extractSmartLinkContext(response?: SmartLinkResponse): LinkProvider | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SmartLinkResponse } from '@atlaskit/linking-types/smart-link';
|
|
2
|
+
import type { ContextViewModel } from '../../view/EmbedCard/types';
|
|
3
|
+
/**
|
|
4
|
+
* Should be moved to link-extractors when jsonLd is deprecated
|
|
5
|
+
*/
|
|
6
|
+
export declare function extractSmartLinkContext(response?: SmartLinkResponse): ContextViewModel | undefined;
|
|
@@ -40,8 +40,12 @@ export interface WithShowControlMethodProp {
|
|
|
40
40
|
showControls?: () => void;
|
|
41
41
|
}
|
|
42
42
|
export interface ContextViewModel {
|
|
43
|
+
/** Entity-type icon for the resource (e.g. a Google Doc, Google Sheets). */
|
|
43
44
|
icon?: ReactNode;
|
|
44
45
|
iconLabel?: string;
|
|
46
|
+
/** Provider/generator icon (e.g. Google Drive). */
|
|
47
|
+
providerIcon?: ReactNode;
|
|
48
|
+
providerIconLabel?: string;
|
|
45
49
|
image?: string;
|
|
46
50
|
text: string;
|
|
47
51
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { UnresolvedViewProps } from './types';
|
|
2
|
-
declare const UnresolvedView: ({ button, description, frameStyle, icon: iconUrlOrElement, image: imageUrlOrElement, inheritDimensions, isSelected, onClick, testId, text, title, url, }: UnresolvedViewProps) => JSX.Element;
|
|
2
|
+
declare const UnresolvedView: ({ button, description, frameStyle, icon: iconUrlOrElement, image: imageUrlOrElement, inheritDimensions, isSelected, onClick, providerIcon, providerIconLabel, testId, text, title, url, }: UnresolvedViewProps) => JSX.Element;
|
|
3
3
|
export default UnresolvedView;
|
|
@@ -11,6 +11,13 @@ export type UnresolvedViewProps = UnresolvedViewCardProps & {
|
|
|
11
11
|
icon: string | ReactNode;
|
|
12
12
|
/** A provider or visual aids for the unresolved link */
|
|
13
13
|
image: string | ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Provider/generator icon. Unresolved frames show the provider name (no entity title),
|
|
16
|
+
* so this is preferred over the entity-type icon.
|
|
17
|
+
*/
|
|
18
|
+
providerIcon?: string | ReactNode;
|
|
19
|
+
/** Accessible label for the provider/generator icon. */
|
|
20
|
+
providerIconLabel?: string;
|
|
14
21
|
/** A link text displayed on embed frame */
|
|
15
22
|
text?: string;
|
|
16
23
|
/** A title for the unresolved link */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "45.20.
|
|
3
|
+
"version": "45.20.5",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"@atlaskit/primitives": "^22.5.0",
|
|
81
81
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
82
82
|
"@atlaskit/react-ufo": "^7.8.0",
|
|
83
|
-
"@atlaskit/rovo-triggers": "^10.
|
|
83
|
+
"@atlaskit/rovo-triggers": "^10.27.0",
|
|
84
84
|
"@atlaskit/section-message": "^10.2.0",
|
|
85
85
|
"@atlaskit/select": "^22.11.0",
|
|
86
86
|
"@atlaskit/spinner": "^20.4.0",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@atlaskit/textfield": "^10.2.0",
|
|
91
91
|
"@atlaskit/theme": "^28.2.0",
|
|
92
92
|
"@atlaskit/tile": "^4.1.0",
|
|
93
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
93
|
+
"@atlaskit/tmp-editor-statsig": "^177.0.0",
|
|
94
94
|
"@atlaskit/tokens": "^16.11.0",
|
|
95
95
|
"@atlaskit/tooltip": "^24.3.0",
|
|
96
96
|
"@atlaskit/ufo": "^1.2.0",
|
|
@@ -218,6 +218,9 @@
|
|
|
218
218
|
"platform_navx_jira_issue_type_icon_label_a11y": {
|
|
219
219
|
"type": "boolean"
|
|
220
220
|
},
|
|
221
|
+
"platform_lp_use_generator_icon_for_provider": {
|
|
222
|
+
"type": "boolean"
|
|
223
|
+
},
|
|
221
224
|
"billplat_a11y_icon_label_fix": {
|
|
222
225
|
"type": "boolean",
|
|
223
226
|
"referenceOnly": true
|