@atlaskit/smart-card 26.42.6 → 26.42.7
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 +8 -0
- package/dist/cjs/extractors/hover/extractMetadata.js +1 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +8 -10
- package/dist/cjs/view/BlockCard/views/flexible/styled.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/unresolved-view/index.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/utils/index.js +4 -46
- package/dist/cjs/view/HoverCard/components/ImagePreview.js +4 -8
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +8 -18
- package/dist/cjs/view/HoverCard/components/views/resolved/styled.js +2 -3
- package/dist/cjs/view/HoverCard/components/views/resolving/styled.js +1 -2
- package/dist/cjs/view/HoverCard/styled.js +3 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RedesignedInlineCard/index.js +28 -32
- package/dist/es2019/extractors/hover/extractMetadata.js +1 -2
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +6 -8
- package/dist/es2019/view/BlockCard/views/flexible/styled.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/unresolved-view/index.js +2 -2
- package/dist/es2019/view/BlockCard/views/flexible/utils/index.js +4 -44
- package/dist/es2019/view/HoverCard/components/ImagePreview.js +4 -8
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +10 -20
- package/dist/es2019/view/HoverCard/components/views/resolved/styled.js +5 -5
- package/dist/es2019/view/HoverCard/components/views/resolving/styled.js +1 -2
- package/dist/es2019/view/HoverCard/styled.js +2 -7
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RedesignedInlineCard/index.js +25 -32
- package/dist/esm/extractors/hover/extractMetadata.js +1 -2
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +9 -11
- package/dist/esm/view/BlockCard/views/flexible/styled.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/unresolved-view/index.js +2 -2
- package/dist/esm/view/BlockCard/views/flexible/utils/index.js +3 -45
- package/dist/esm/view/HoverCard/components/ImagePreview.js +4 -8
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +10 -20
- package/dist/esm/view/HoverCard/components/views/resolved/styled.js +2 -3
- package/dist/esm/view/HoverCard/components/views/resolving/styled.js +1 -2
- package/dist/esm/view/HoverCard/styled.js +4 -10
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RedesignedInlineCard/index.js +25 -32
- package/dist/types/view/BlockCard/views/flexible/utils/index.d.ts +1 -2
- package/dist/types-ts4.5/view/BlockCard/views/flexible/utils/index.d.ts +1 -2
- package/package.json +5 -8
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
|
-
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; }
|
|
5
|
-
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; }
|
|
6
3
|
import { css } from '@emotion/react';
|
|
7
4
|
import { loadingPlaceholderClassName } from '../../index';
|
|
8
|
-
import { SmartLinkSize
|
|
5
|
+
import { SmartLinkSize } from '../../constants';
|
|
9
6
|
import { layers } from '@atlaskit/theme/constants';
|
|
10
7
|
import { themed } from '@atlaskit/theme/components';
|
|
11
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
9
|
|
|
13
10
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
14
11
|
export var HOVER_CARD_Z_INDEX = layers.modal();
|
|
15
|
-
export var flexibleUiOptions =
|
|
12
|
+
export var flexibleUiOptions = {
|
|
16
13
|
hideBackground: true,
|
|
17
14
|
hideElevation: true,
|
|
18
15
|
size: SmartLinkSize.Medium,
|
|
19
16
|
hideHoverCardPreviewButton: false,
|
|
20
17
|
zIndex: HOVER_CARD_Z_INDEX + 1
|
|
21
|
-
}
|
|
22
|
-
theme: SmartLinkTheme.Black,
|
|
23
|
-
hidePadding: true
|
|
24
|
-
});
|
|
18
|
+
};
|
|
25
19
|
export var CARD_WIDTH_REM = 24;
|
|
26
20
|
// gap between mouse cursor and hover card
|
|
27
21
|
export var CARD_GAP_PX = 10;
|
|
28
22
|
var blockGap = '0.5rem';
|
|
29
23
|
var elementGap = '0.5rem';
|
|
30
24
|
export var separatorCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n"])), elementGap);
|
|
31
|
-
export var HoverCardContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n
|
|
25
|
+
export var HoverCardContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n\n .", " {\n display: none;\n }\n"])), CARD_WIDTH_REM, loadingPlaceholderClassName);
|
|
32
26
|
export var titleBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: ", ";\n\n ", "\n\n // title and subtitle element group\n [data-smart-element-group] {\n // gap between title and subtitle\n gap: 0.06rem;\n display: flex;\n /* subtitle element group */\n > [data-smart-element-group] {\n > span {\n margin-right: ", ";\n }\n }\n }\n\n ", "\n"])), blockGap, separatorCss, elementGap, getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "[data-smart-element=\"Title\"] {\n font-weight: 600;\n }" : "");
|
|
33
27
|
export var getTransitionStyles = function getTransitionStyles(snippetHeight) {
|
|
34
28
|
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n transition: height 300ms ease-in-out;\n height: ", "px;\n"])), snippetHeight);
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.42.
|
|
13
|
+
packageVersion: "26.42.7",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
3
|
import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
|
|
4
4
|
import { extractInlineProps } from '../../extractors/inline';
|
|
5
5
|
import { extractRequestAccessContext } from '../../extractors/common/context';
|
|
@@ -15,6 +15,7 @@ import { useFeatureFlag } from '@atlaskit/link-provider';
|
|
|
15
15
|
import { getExtensionKey } from '../../state/helpers';
|
|
16
16
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
17
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
18
|
+
import { SmartLinkStatus } from '../../constants';
|
|
18
19
|
export { InlineCardResolvedView, InlineCardResolvingView, InlineCardErroredView, InlineCardForbiddenView, InlineCardUnauthorizedView };
|
|
19
20
|
export var InlineCard = function InlineCard(_ref) {
|
|
20
21
|
var _details$meta, _providerForbidden$te;
|
|
@@ -44,6 +45,29 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
44
45
|
if (showHoverPreview === undefined && showHoverPreviewFlag !== undefined) {
|
|
45
46
|
showHoverPreview = Boolean(showHoverPreviewFlag);
|
|
46
47
|
}
|
|
48
|
+
var resolvedProps = status === SmartLinkStatus.Resolved ? extractInlineProps(cardDetails, renderers) : {};
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
switch (status) {
|
|
51
|
+
case SmartLinkStatus.Resolved:
|
|
52
|
+
onResolve === null || onResolve === void 0 || onResolve({
|
|
53
|
+
url: url,
|
|
54
|
+
title: resolvedProps.title
|
|
55
|
+
});
|
|
56
|
+
break;
|
|
57
|
+
case SmartLinkStatus.Errored:
|
|
58
|
+
case SmartLinkStatus.Fallback:
|
|
59
|
+
case SmartLinkStatus.Forbidden:
|
|
60
|
+
case SmartLinkStatus.NotFound:
|
|
61
|
+
case SmartLinkStatus.Unauthorized:
|
|
62
|
+
if (onError) {
|
|
63
|
+
onError({
|
|
64
|
+
status: status,
|
|
65
|
+
url: url
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}, [onError, onResolve, status, url, resolvedProps.title]);
|
|
47
71
|
switch (status) {
|
|
48
72
|
case 'pending':
|
|
49
73
|
case 'resolving':
|
|
@@ -55,13 +79,6 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
55
79
|
inlinePreloaderStyle: inlinePreloaderStyle
|
|
56
80
|
});
|
|
57
81
|
case 'resolved':
|
|
58
|
-
var resolvedProps = extractInlineProps(cardDetails, renderers);
|
|
59
|
-
if (onResolve) {
|
|
60
|
-
onResolve({
|
|
61
|
-
url: url,
|
|
62
|
-
title: resolvedProps.title
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
82
|
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
|
|
66
83
|
id: id,
|
|
67
84
|
showHoverPreview: showHoverPreview,
|
|
@@ -72,12 +89,6 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
72
89
|
testId: testIdWithStatus
|
|
73
90
|
}));
|
|
74
91
|
case 'unauthorized':
|
|
75
|
-
if (onError) {
|
|
76
|
-
onError({
|
|
77
|
-
url: url,
|
|
78
|
-
status: status
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
92
|
var provider = extractProvider(cardDetails);
|
|
82
93
|
return /*#__PURE__*/React.createElement(InlineCardUnauthorizedView, {
|
|
83
94
|
icon: provider && provider.icon,
|
|
@@ -93,12 +104,6 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
93
104
|
extensionKey: extensionKey
|
|
94
105
|
});
|
|
95
106
|
case 'forbidden':
|
|
96
|
-
if (onError) {
|
|
97
|
-
onError({
|
|
98
|
-
url: url,
|
|
99
|
-
status: status
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
107
|
var providerForbidden = extractProvider(cardDetails);
|
|
103
108
|
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : getForbiddenJsonLd().meta;
|
|
104
109
|
var requestAccessContext = getBooleanFF('platform.linking-platform.smart-card.cross-join') ? extractRequestAccessContextImproved({
|
|
@@ -123,12 +128,6 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
123
128
|
showHoverPreview: showHoverPreview
|
|
124
129
|
});
|
|
125
130
|
case 'not_found':
|
|
126
|
-
if (onError) {
|
|
127
|
-
onError({
|
|
128
|
-
url: url,
|
|
129
|
-
status: status
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
131
|
var providerNotFound = extractProvider(cardDetails);
|
|
133
132
|
return /*#__PURE__*/React.createElement(InlineCardErroredView, {
|
|
134
133
|
url: url,
|
|
@@ -142,12 +141,6 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
142
141
|
case 'fallback':
|
|
143
142
|
case 'errored':
|
|
144
143
|
default:
|
|
145
|
-
if (onError) {
|
|
146
|
-
onError({
|
|
147
|
-
url: url,
|
|
148
|
-
status: status
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
144
|
return /*#__PURE__*/React.createElement(CardLinkView, {
|
|
152
145
|
link: url,
|
|
153
146
|
isSelected: isSelected,
|
|
@@ -5,7 +5,6 @@ import type { PreviewBlockProps } from '../../../../FlexibleCard/components/bloc
|
|
|
5
5
|
import type { TitleBlockProps } from '../../../../FlexibleCard/components/blocks/title-block/types';
|
|
6
6
|
import { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
7
7
|
export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
8
|
-
export declare const getSimulatedMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
9
8
|
type SimulatedMetadata = {
|
|
10
9
|
titleMetadata: ElementItem[];
|
|
11
10
|
topMetadata: ElementItem[];
|
|
@@ -14,5 +13,5 @@ type SimulatedMetadata = {
|
|
|
14
13
|
export declare const FlexibleCardUiOptions: FlexibleUiOptions;
|
|
15
14
|
export declare const getTitleBlockOptions: () => Partial<TitleBlockProps>;
|
|
16
15
|
export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
|
|
17
|
-
export declare const
|
|
16
|
+
export declare const FooterBlockOptions: Partial<FooterBlockProps>;
|
|
18
17
|
export {};
|
|
@@ -5,7 +5,6 @@ import type { PreviewBlockProps } from '../../../../FlexibleCard/components/bloc
|
|
|
5
5
|
import type { TitleBlockProps } from '../../../../FlexibleCard/components/blocks/title-block/types';
|
|
6
6
|
import { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
7
7
|
export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
8
|
-
export declare const getSimulatedMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
9
8
|
type SimulatedMetadata = {
|
|
10
9
|
titleMetadata: ElementItem[];
|
|
11
10
|
topMetadata: ElementItem[];
|
|
@@ -14,5 +13,5 @@ type SimulatedMetadata = {
|
|
|
14
13
|
export declare const FlexibleCardUiOptions: FlexibleUiOptions;
|
|
15
14
|
export declare const getTitleBlockOptions: () => Partial<TitleBlockProps>;
|
|
16
15
|
export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
|
|
17
|
-
export declare const
|
|
16
|
+
export declare const FooterBlockOptions: Partial<FooterBlockProps>;
|
|
18
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.42.
|
|
3
|
+
"version": "26.42.7",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@atlaskit/avatar": "^21.4.0",
|
|
28
28
|
"@atlaskit/avatar-group": "^9.4.0",
|
|
29
29
|
"@atlaskit/badge": "^15.1.0",
|
|
30
|
-
"@atlaskit/button": "^16.
|
|
30
|
+
"@atlaskit/button": "^16.17.0",
|
|
31
31
|
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
32
32
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
33
33
|
"@atlaskit/icon": "^22.0.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
39
39
|
"@atlaskit/link-client-extension": "^1.8.0",
|
|
40
40
|
"@atlaskit/link-extractors": "^1.2.0",
|
|
41
|
-
"@atlaskit/linking-common": "^4.
|
|
41
|
+
"@atlaskit/linking-common": "^4.20.0",
|
|
42
42
|
"@atlaskit/linking-types": "^8.5.0",
|
|
43
43
|
"@atlaskit/logo": "^13.14.0",
|
|
44
44
|
"@atlaskit/lozenge": "^11.4.0",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
48
48
|
"@atlaskit/popup": "^1.11.0",
|
|
49
|
-
"@atlaskit/primitives": "^1.
|
|
49
|
+
"@atlaskit/primitives": "^1.12.0",
|
|
50
50
|
"@atlaskit/spinner": "^16.0.0",
|
|
51
51
|
"@atlaskit/theme": "^12.6.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.29.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.0.0",
|
|
54
54
|
"@atlaskit/ufo": "^0.2.0",
|
|
55
55
|
"@babel/runtime": "^7.0.0",
|
|
@@ -144,9 +144,6 @@
|
|
|
144
144
|
"platform.linking-platform.smart-card.show-smart-links-refreshed-design": {
|
|
145
145
|
"type": "boolean"
|
|
146
146
|
},
|
|
147
|
-
"platform.linking-platform.smart-card.enable-better-metadata_iojwg": {
|
|
148
|
-
"type": "boolean"
|
|
149
|
-
},
|
|
150
147
|
"platform.linking-platform.smart-card.fix-is-trusted-pop": {
|
|
151
148
|
"type": "boolean"
|
|
152
149
|
},
|