@atlaskit/smart-card 39.3.0 → 39.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 +11 -0
- package/dist/cjs/extractors/flexible/index.js +3 -7
- package/dist/cjs/state/flexible-ui-context/index.js +3 -24
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +8 -21
- package/dist/cjs/view/BlockCard/views/unresolved-view/index.js +6 -16
- package/dist/cjs/view/BlockCard/views/utils/index.js +3 -10
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/index.js +7 -18
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +7 -18
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +7 -18
- package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +14 -46
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +5 -12
- package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +8 -20
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -22
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +8 -28
- package/dist/cjs/view/FlexibleCard/components/container/index.js +36 -126
- package/dist/cjs/view/FlexibleCard/components/elements/title-element/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/index.js +11 -30
- package/dist/cjs/view/FlexibleCard/utils.js +3 -7
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/forbidden/index.js +10 -22
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +8 -21
- package/dist/cjs/view/HoverCard/styled.js +1 -12
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +0 -3
- package/dist/es2019/extractors/flexible/index.js +2 -7
- package/dist/es2019/state/flexible-ui-context/index.js +2 -23
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +10 -23
- package/dist/es2019/view/BlockCard/views/unresolved-view/index.js +7 -17
- package/dist/es2019/view/BlockCard/views/utils/index.js +2 -9
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +1 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/index.js +5 -16
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +5 -16
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +5 -16
- package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +12 -44
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +3 -10
- package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +7 -18
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +4 -24
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +7 -26
- package/dist/es2019/view/FlexibleCard/components/container/index.js +8 -100
- package/dist/es2019/view/FlexibleCard/components/elements/title-element/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/index.js +14 -33
- package/dist/es2019/view/FlexibleCard/utils.js +4 -8
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +2 -2
- package/dist/es2019/view/HoverCard/components/views/forbidden/index.js +10 -22
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +9 -22
- package/dist/es2019/view/HoverCard/styled.js +0 -11
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +0 -3
- package/dist/esm/extractors/flexible/index.js +4 -8
- package/dist/esm/state/flexible-ui-context/index.js +2 -23
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +10 -23
- package/dist/esm/view/BlockCard/views/unresolved-view/index.js +7 -17
- package/dist/esm/view/BlockCard/views/utils/index.js +2 -9
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/index.js +7 -18
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +7 -18
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +7 -18
- package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +14 -46
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +5 -12
- package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +8 -20
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +4 -23
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +8 -28
- package/dist/esm/view/FlexibleCard/components/container/index.js +39 -130
- package/dist/esm/view/FlexibleCard/components/elements/title-element/index.js +2 -3
- package/dist/esm/view/FlexibleCard/index.js +14 -33
- package/dist/esm/view/FlexibleCard/utils.js +3 -7
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -2
- package/dist/esm/view/HoverCard/components/views/forbidden/index.js +10 -22
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +9 -22
- package/dist/esm/view/HoverCard/styled.js +0 -11
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +0 -3
- package/dist/types/state/flexible-ui-context/index.d.ts +0 -12
- package/dist/types/state/flexible-ui-context/types.d.ts +0 -7
- package/dist/types/view/BlockCard/views/utils/index.d.ts +0 -4
- package/dist/types/view/FlexibleCard/components/blocks/ai-footer-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/snippet-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +1 -13
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +1 -8
- package/dist/types/view/FlexibleCard/components/container/index.d.ts +1 -1
- package/dist/types/view/HoverCard/styled.d.ts +0 -4
- package/dist/types-ts4.5/state/flexible-ui-context/index.d.ts +0 -12
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +0 -7
- package/dist/types-ts4.5/view/BlockCard/views/utils/index.d.ts +0 -4
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-footer-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/footer-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/metadata-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/snippet-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +1 -13
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +1 -8
- package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/styled.d.ts +0 -4
- package/package.json +1 -7
|
@@ -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: "39.
|
|
23
|
+
packageVersion: "39.3.0",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -10,7 +10,6 @@ require("./index.compiled.css");
|
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
var _constants = require("../../../../constants");
|
|
14
13
|
var _index = require("../../../../index");
|
|
15
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
16
15
|
var hoverStyleOld = null;
|
|
@@ -53,8 +52,6 @@ var RelatedLinkItem = function RelatedLinkItem(_ref) {
|
|
|
53
52
|
subtitle: subtitle,
|
|
54
53
|
anchorTarget: "_blank",
|
|
55
54
|
size: ui.size,
|
|
56
|
-
theme: ui.theme,
|
|
57
|
-
status: _constants.SmartLinkStatus.Resolved,
|
|
58
55
|
className: (0, _runtime.ax)(["_zulputpp _11c81o8v _ca0qu2gc _n3tdu2gc"])
|
|
59
56
|
})));
|
|
60
57
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn,
|
|
1
|
+
import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
|
|
2
2
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
import { extractSmartLinkSummary } from '../common/primitives/extractSummary';
|
|
4
4
|
import { extractFlexibleCardActions } from './actions';
|
|
@@ -60,9 +60,7 @@ const extractFlexibleUiContext = ({
|
|
|
60
60
|
dueOn: extractDueOn(data),
|
|
61
61
|
latestCommit: extractLatestCommit(data),
|
|
62
62
|
linkIcon: extractSmartLinkIcon(response),
|
|
63
|
-
|
|
64
|
-
linkTitle: extractLinkTitle(status, props.url, response, onClick)
|
|
65
|
-
}),
|
|
63
|
+
linkTitle: extractLinkTitle(status, props.url, response, onClick),
|
|
66
64
|
location: extractLocation(data),
|
|
67
65
|
modifiedBy: extractSmartLinkModifiedBy(response),
|
|
68
66
|
modifiedOn: extractSmartLinkModifiedOn(response),
|
|
@@ -83,9 +81,6 @@ const extractFlexibleUiContext = ({
|
|
|
83
81
|
...(fg('platform-linking-user-attributes-component') && {
|
|
84
82
|
userAttributes: extractUserAttributes(data)
|
|
85
83
|
}),
|
|
86
|
-
...(fg('platform-linking-flexible-card-context') ? undefined : {
|
|
87
|
-
title: extractSmartLinkTitle(response) || url
|
|
88
|
-
}),
|
|
89
84
|
...(fg('platform-linking-team-member-count-component') && {
|
|
90
85
|
teamMemberCount: extractTeamMemberCount(data)
|
|
91
86
|
}),
|
|
@@ -1,36 +1,15 @@
|
|
|
1
1
|
import { createContext, useContext } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
/**
|
|
4
3
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
5
4
|
* underlying elements.
|
|
6
5
|
*/
|
|
7
6
|
export const FlexibleCardContext = /*#__PURE__*/createContext(undefined);
|
|
8
7
|
export const useFlexibleCardContext = () => useContext(FlexibleCardContext);
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
12
|
-
* underlying elements.
|
|
13
|
-
* @deprecated Remove on cleanup of platform-linking-flexible-card-context
|
|
14
|
-
*/
|
|
15
|
-
export const FlexibleUiContext = /*#__PURE__*/createContext(undefined);
|
|
16
8
|
export const useFlexibleUiContext = () => {
|
|
17
9
|
var _useFlexibleCardConte;
|
|
18
|
-
return
|
|
19
|
-
(_useFlexibleCardConte = useFlexibleCardContext()) === null || _useFlexibleCardConte === void 0 ? void 0 : _useFlexibleCardConte.data :
|
|
20
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
21
|
-
useContext(FlexibleUiContext);
|
|
10
|
+
return (_useFlexibleCardConte = useFlexibleCardContext()) === null || _useFlexibleCardConte === void 0 ? void 0 : _useFlexibleCardConte.data;
|
|
22
11
|
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* This provides the ui options that will be used by Smart Links Flexible UI
|
|
26
|
-
* to render its underlying elements.
|
|
27
|
-
* @deprecated Remove on cleanup of platform-linking-flexible-card-context
|
|
28
|
-
*/
|
|
29
|
-
export const FlexibleUiOptionContext = /*#__PURE__*/createContext(undefined);
|
|
30
12
|
export const useFlexibleUiOptionContext = () => {
|
|
31
13
|
var _useFlexibleCardConte2;
|
|
32
|
-
return
|
|
33
|
-
(_useFlexibleCardConte2 = useFlexibleCardContext()) === null || _useFlexibleCardConte2 === void 0 ? void 0 : _useFlexibleCardConte2.ui :
|
|
34
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
35
|
-
useContext(FlexibleUiOptionContext);
|
|
14
|
+
return (_useFlexibleCardConte2 = useFlexibleCardContext()) === null || _useFlexibleCardConte2 === void 0 ? void 0 : _useFlexibleCardConte2.ui;
|
|
36
15
|
};
|
|
@@ -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: "39.
|
|
5
|
+
packageVersion: "39.3.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -6,10 +6,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { ActionName, ElementName, SmartLinkPosition
|
|
9
|
+
import { ActionName, ElementName, SmartLinkPosition } from '../../../constants';
|
|
10
10
|
import FlexibleCard from '../../FlexibleCard';
|
|
11
11
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
12
|
-
import { FlexibleCardUiOptions,
|
|
12
|
+
import { FlexibleCardUiOptions, getSimulatedBetterMetadata, PreviewBlockOptions, titleBlockOptions } from './utils';
|
|
13
13
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
14
14
|
const titleBlockCss = null;
|
|
15
15
|
const footerBlockCss = null;
|
|
@@ -55,8 +55,7 @@ const ResolvedView = ({
|
|
|
55
55
|
name: ActionName.DownloadAction,
|
|
56
56
|
hideIcon: true
|
|
57
57
|
}], []);
|
|
58
|
-
const
|
|
59
|
-
const uiOptions = fg('platform-linking-flexible-card-context') ? FlexibleCardUiOptions : FlexibleCardUiOptionsOld;
|
|
58
|
+
const uiOptions = FlexibleCardUiOptions;
|
|
60
59
|
if (fg('cc-ai-linking-platform-snippet-renderer')) {
|
|
61
60
|
uiOptions.enableSnippetRenderer = true;
|
|
62
61
|
}
|
|
@@ -76,36 +75,24 @@ const ResolvedView = ({
|
|
|
76
75
|
subtitle: [{
|
|
77
76
|
name: ElementName.Location
|
|
78
77
|
}],
|
|
79
|
-
metadataPosition: SmartLinkPosition.Top
|
|
80
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
81
|
-
status
|
|
82
|
-
}, {
|
|
78
|
+
metadataPosition: SmartLinkPosition.Top,
|
|
83
79
|
CompetitorPrompt: CompetitorPrompt,
|
|
84
80
|
url: url,
|
|
85
81
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton,
|
|
86
82
|
className: ax(["_zulpu2gc _13mh1pd9 _2yhz14q2"])
|
|
87
|
-
})), /*#__PURE__*/React.createElement(MetadataBlock,
|
|
83
|
+
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
88
84
|
primary: topMetadata,
|
|
89
85
|
maxLines: 1
|
|
90
|
-
},
|
|
91
|
-
status: SmartLinkStatus.Resolved
|
|
92
|
-
})), /*#__PURE__*/React.createElement(SnippetBlock, null), /*#__PURE__*/React.createElement(MetadataBlock, _extends({
|
|
86
|
+
}), /*#__PURE__*/React.createElement(SnippetBlock, null), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
93
87
|
primary: bottomMetadata,
|
|
94
88
|
maxLines: 1
|
|
95
|
-
},
|
|
96
|
-
status: SmartLinkStatus.Resolved
|
|
97
|
-
})), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, _extends({}, PreviewBlockOptions, {
|
|
89
|
+
}), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, _extends({}, PreviewBlockOptions, {
|
|
98
90
|
onError: () => {
|
|
99
91
|
setIsPreviewBlockErrored(true);
|
|
100
92
|
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
})) : null, /*#__PURE__*/React.createElement(FooterBlock, _extends({
|
|
104
|
-
actions: footerActions
|
|
105
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
106
|
-
status: SmartLinkStatus.Resolved
|
|
107
|
-
}, {
|
|
93
|
+
})) : null, /*#__PURE__*/React.createElement(FooterBlock, {
|
|
94
|
+
actions: footerActions,
|
|
108
95
|
className: ax(["_4t3i1k8s _1e0c1txw _1bah1yb4 _4cvresu3 _1wpz1fhb", safari && fg('platform-linking-visual-refresh-v2') && "_4t3i1osq"])
|
|
109
|
-
}))
|
|
96
|
+
}));
|
|
110
97
|
};
|
|
111
98
|
export default withFlexibleUIBlockCardStyle(ResolvedView);
|
|
@@ -8,7 +8,7 @@ import { browser } from '@atlaskit/linking-common/user-agent';
|
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import FlexibleCard from '../../../FlexibleCard';
|
|
10
10
|
import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
11
|
-
import { FlexibleCardUiOptions,
|
|
11
|
+
import { FlexibleCardUiOptions, PreviewBlockOptions, titleBlockOptions } from '../utils';
|
|
12
12
|
const customBlockStyles = null;
|
|
13
13
|
const titleBlockCss = null;
|
|
14
14
|
const footerBlockCss = null;
|
|
@@ -38,28 +38,18 @@ const UnresolvedView = ({
|
|
|
38
38
|
onError: onError,
|
|
39
39
|
origin: "smartLinkCard",
|
|
40
40
|
testId: testId,
|
|
41
|
-
ui:
|
|
41
|
+
ui: FlexibleCardUiOptions,
|
|
42
42
|
url: url
|
|
43
43
|
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
|
|
44
44
|
hideIcon: !!title,
|
|
45
|
-
text: title
|
|
46
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
47
|
-
status: cardState.status
|
|
48
|
-
}, {
|
|
45
|
+
text: title,
|
|
49
46
|
className: ax(["_zulpu2gc _13mh1pd9 _2yhz14q2"])
|
|
50
|
-
})), /*#__PURE__*/React.createElement(CustomBlock,
|
|
51
|
-
status: cardState.status
|
|
52
|
-
}, {
|
|
47
|
+
})), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
53
48
|
className: ax(["_zulp1b66 _1e0c1txw _4cvr1y6m _1wpz1fhb _7yjtidpf _ngc01fxt"])
|
|
54
|
-
}
|
|
55
|
-
status: cardState.status
|
|
56
|
-
})), /*#__PURE__*/React.createElement(InternalFooterBlock, _extends({
|
|
49
|
+
}, children), showPreview && /*#__PURE__*/React.createElement(PreviewBlock, PreviewBlockOptions), /*#__PURE__*/React.createElement(InternalFooterBlock, {
|
|
57
50
|
actions: actions,
|
|
58
|
-
testId: "smart-block-card-footer"
|
|
59
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
60
|
-
status: cardState.status
|
|
61
|
-
}, {
|
|
51
|
+
testId: "smart-block-card-footer",
|
|
62
52
|
className: ax(["_4t3i1k8s _1e0c1txw _1bah1yb4 _4cvresu3 _1wpz1fhb", safari && fg('platform-linking-visual-refresh-v2') && "_4t3i1osq"])
|
|
63
|
-
}))
|
|
53
|
+
}));
|
|
64
54
|
};
|
|
65
55
|
export default UnresolvedView;
|
|
@@ -28,7 +28,7 @@ const baseBottomMetaData = [{
|
|
|
28
28
|
name: ElementName.ChecklistProgress
|
|
29
29
|
}];
|
|
30
30
|
export const getSimulatedBetterMetadata = cardDetails => {
|
|
31
|
-
var _getExtensionKey, _data$Type$includes, _data$Type
|
|
31
|
+
var _getExtensionKey, _data$Type$includes, _data$Type;
|
|
32
32
|
const extensionKey = (_getExtensionKey = getExtensionKey(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
|
|
33
33
|
const data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
|
|
34
34
|
const defaultTitleMetadata = [{
|
|
@@ -79,7 +79,7 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
79
79
|
};
|
|
80
80
|
case 'jira-object-provider':
|
|
81
81
|
const isJiraTask = (_data$Type$includes = (_data$Type = data['@type']) === null || _data$Type === void 0 ? void 0 : _data$Type.includes('atlassian:Task')) !== null && _data$Type$includes !== void 0 ? _data$Type$includes : false;
|
|
82
|
-
const isJiraPlan =
|
|
82
|
+
const isJiraPlan = data['atlassian:ownedBy'] ? true : false;
|
|
83
83
|
let topMetadata = [{
|
|
84
84
|
name: ElementName.AuthorGroup
|
|
85
85
|
}, {
|
|
@@ -156,13 +156,6 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
|
-
/**
|
|
160
|
-
* @deprecated Remove on platform-linking-flexible-card-context cleanup
|
|
161
|
-
*/
|
|
162
|
-
export const FlexibleCardUiOptionsOld = {
|
|
163
|
-
hideElevation: true,
|
|
164
|
-
hideLegacyButton: true
|
|
165
|
-
};
|
|
166
159
|
export const FlexibleCardUiOptions = {
|
|
167
160
|
hideElevation: true,
|
|
168
161
|
hideLegacyButton: true,
|
|
@@ -4,7 +4,6 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { SmartLinkSize } from '../../../../../constants';
|
|
9
8
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
10
9
|
import * as Actions from '../../actions';
|
|
@@ -78,7 +77,7 @@ const ActionBlock = ({
|
|
|
78
77
|
onClick: () => onClick(name),
|
|
79
78
|
onError: onError,
|
|
80
79
|
onLoadingChange: onLoadingChange,
|
|
81
|
-
size:
|
|
80
|
+
size: size || (ui === null || ui === void 0 ? void 0 : ui.size)
|
|
82
81
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/no-unsafe-design-token-usage
|
|
83
82
|
,
|
|
84
83
|
style: padding && {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
5
4
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
6
5
|
import AIFooterBlockResolvedView from './resolved';
|
|
@@ -11,26 +10,16 @@ import AIFooterBlockResolvedView from './resolved';
|
|
|
11
10
|
* @see Block
|
|
12
11
|
*/
|
|
13
12
|
const AIFooterBlock = ({
|
|
14
|
-
status,
|
|
15
13
|
testId = 'smart-ai-footer-block',
|
|
16
14
|
...props
|
|
17
15
|
}) => {
|
|
18
16
|
var _props$size, _cardContext$ui;
|
|
19
|
-
const cardContext =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
23
|
-
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
} else {
|
|
27
|
-
if (status !== SmartLinkStatus.Resolved) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
17
|
+
const cardContext = useFlexibleCardContext();
|
|
18
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
19
|
+
return null;
|
|
30
20
|
}
|
|
31
|
-
return /*#__PURE__*/React.createElement(AIFooterBlockResolvedView, _extends({}, props,
|
|
32
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
33
|
-
} : undefined, {
|
|
21
|
+
return /*#__PURE__*/React.createElement(AIFooterBlockResolvedView, _extends({}, props, {
|
|
22
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
34
23
|
testId: testId
|
|
35
24
|
}));
|
|
36
25
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
|
|
5
4
|
import { useFlexibleCardContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
6
5
|
import AISummaryBlockResolvedView from './resolved';
|
|
@@ -12,31 +11,21 @@ import AISummaryBlockResolvedView from './resolved';
|
|
|
12
11
|
* @see Block
|
|
13
12
|
*/
|
|
14
13
|
const AISummaryBlock = ({
|
|
15
|
-
status,
|
|
16
14
|
testId = 'smart-ai-summary-block',
|
|
17
15
|
...props
|
|
18
16
|
}) => {
|
|
19
17
|
var _context$actions, _props$size, _cardContext$ui;
|
|
20
|
-
const cardContext =
|
|
21
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
22
|
-
useFlexibleCardContext() : undefined;
|
|
18
|
+
const cardContext = useFlexibleCardContext();
|
|
23
19
|
const context = useFlexibleUiContext();
|
|
24
20
|
const actionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.AISummaryAction];
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
} else {
|
|
30
|
-
if (status !== SmartLinkStatus.Resolved) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
21
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
22
|
+
return null;
|
|
33
23
|
}
|
|
34
24
|
if (!(actionData !== null && actionData !== void 0 && actionData.url)) {
|
|
35
25
|
return null;
|
|
36
26
|
}
|
|
37
|
-
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedView, _extends({}, props,
|
|
38
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
39
|
-
} : undefined, {
|
|
27
|
+
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedView, _extends({}, props, {
|
|
28
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
40
29
|
testId: testId,
|
|
41
30
|
url: actionData.url
|
|
42
31
|
}));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
5
4
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
6
5
|
import FooterBlockResolvedView from './resolved';
|
|
@@ -12,27 +11,17 @@ import FooterBlockResolvedView from './resolved';
|
|
|
12
11
|
* @see Block
|
|
13
12
|
*/
|
|
14
13
|
const FooterBlock = ({
|
|
15
|
-
status,
|
|
16
14
|
testId = 'smart-footer-block',
|
|
17
15
|
alwaysShow,
|
|
18
16
|
...props
|
|
19
17
|
}) => {
|
|
20
18
|
var _props$size, _cardContext$ui;
|
|
21
|
-
const cardContext =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
25
|
-
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !alwaysShow) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
if (status !== SmartLinkStatus.Resolved && !alwaysShow) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
19
|
+
const cardContext = useFlexibleCardContext();
|
|
20
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !alwaysShow) {
|
|
21
|
+
return null;
|
|
32
22
|
}
|
|
33
|
-
return /*#__PURE__*/React.createElement(FooterBlockResolvedView, _extends({}, props,
|
|
34
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
35
|
-
} : undefined, {
|
|
23
|
+
return /*#__PURE__*/React.createElement(FooterBlockResolvedView, _extends({}, props, {
|
|
24
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
36
25
|
testId: testId
|
|
37
26
|
}));
|
|
38
27
|
};
|
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
/* eslint-disable @atlaskit/design-system/use-tokens-typography */
|
|
7
7
|
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkStatus, SmartLinkWidth } from '../../../../../constants';
|
|
10
9
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
11
10
|
import Block from '../block';
|
|
@@ -59,61 +58,30 @@ const ElementItemRenderer = ({
|
|
|
59
58
|
*/
|
|
60
59
|
const MetadataBlock = ({
|
|
61
60
|
maxLines = DEFAULT_MAX_LINES,
|
|
62
|
-
status = SmartLinkStatus.Fallback,
|
|
63
61
|
testId = 'smart-block-metadata',
|
|
64
62
|
primary = [],
|
|
65
63
|
secondary = [],
|
|
66
64
|
...blockProps
|
|
67
65
|
}) => {
|
|
68
66
|
var _ref, _blockProps$size, _cardContext$ui;
|
|
69
|
-
const cardContext =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
73
|
-
if (primary.length === 0 && secondary.length === 0 || (cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
if (primary.length === 0 && secondary.length === 0 || status !== SmartLinkStatus.Resolved) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
67
|
+
const cardContext = useFlexibleCardContext();
|
|
68
|
+
if (primary.length === 0 && secondary.length === 0 || (cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
69
|
+
return null;
|
|
80
70
|
}
|
|
81
|
-
const
|
|
82
|
-
size: sizeProp = SmartLinkSize.Medium
|
|
83
|
-
} = blockProps;
|
|
84
|
-
const size = fg('platform-linking-flexible-card-context') ? (_ref = (_blockProps$size = blockProps === null || blockProps === void 0 ? void 0 : blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size) !== null && _ref !== void 0 ? _ref : SmartLinkSize.Medium : sizeProp;
|
|
71
|
+
const size = (_ref = (_blockProps$size = blockProps === null || blockProps === void 0 ? void 0 : blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size) !== null && _ref !== void 0 ? _ref : SmartLinkSize.Medium;
|
|
85
72
|
const maxLinesTotal = getMaxLines(maxLines);
|
|
86
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
87
|
-
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
88
|
-
size: size,
|
|
89
|
-
testId: `${testId}-resolved-view`
|
|
90
|
-
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
91
|
-
items: primary,
|
|
92
|
-
size: size,
|
|
93
|
-
maxLines: maxLinesTotal
|
|
94
|
-
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
95
|
-
align: SmartLinkAlignment.Right,
|
|
96
|
-
items: secondary,
|
|
97
|
-
size: size,
|
|
98
|
-
maxLines: maxLinesTotal
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
const primaryElements = renderElementItems(primary);
|
|
102
|
-
const secondaryElements = renderElementItems(secondary);
|
|
103
73
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
74
|
+
size: size,
|
|
104
75
|
testId: `${testId}-resolved-view`
|
|
105
|
-
}),
|
|
106
|
-
|
|
107
|
-
direction: SmartLinkDirection.Horizontal,
|
|
108
|
-
width: SmartLinkWidth.Flexible,
|
|
76
|
+
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
77
|
+
items: primary,
|
|
109
78
|
size: size,
|
|
110
|
-
|
|
111
|
-
}
|
|
79
|
+
maxLines: maxLinesTotal
|
|
80
|
+
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
112
81
|
align: SmartLinkAlignment.Right,
|
|
113
|
-
|
|
114
|
-
width: SmartLinkWidth.Flexible,
|
|
82
|
+
items: secondary,
|
|
115
83
|
size: size,
|
|
116
|
-
|
|
117
|
-
}
|
|
84
|
+
maxLines: maxLinesTotal
|
|
85
|
+
}));
|
|
118
86
|
};
|
|
119
87
|
export default MetadataBlock;
|
|
@@ -1,7 +1,5 @@
|
|
|
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 { SmartLinkStatus } from '../../../../../constants';
|
|
5
3
|
import { useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
6
4
|
import PreviewBlockResolvedView from './resolved';
|
|
7
5
|
/**
|
|
@@ -11,19 +9,14 @@ import PreviewBlockResolvedView from './resolved';
|
|
|
11
9
|
* @see Block
|
|
12
10
|
*/
|
|
13
11
|
const PreviewBlock = ({
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
-
status = SmartLinkStatus.Fallback,
|
|
16
12
|
testId = 'smart-block-preview',
|
|
17
13
|
overrideUrl,
|
|
18
14
|
...blockProps
|
|
19
15
|
}) => {
|
|
20
16
|
var _blockProps$size;
|
|
21
|
-
const ui =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return /*#__PURE__*/React.createElement(PreviewBlockResolvedView, _extends({}, blockProps, fg('platform-linking-flexible-card-context') ? {
|
|
25
|
-
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : ui === null || ui === void 0 ? void 0 : ui.size
|
|
26
|
-
} : undefined, {
|
|
17
|
+
const ui = useFlexibleUiOptionContext();
|
|
18
|
+
return /*#__PURE__*/React.createElement(PreviewBlockResolvedView, _extends({}, blockProps, {
|
|
19
|
+
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : ui === null || ui === void 0 ? void 0 : ui.size,
|
|
27
20
|
testId: testId,
|
|
28
21
|
overrideUrl: overrideUrl
|
|
29
22
|
}));
|
|
@@ -19,7 +19,6 @@ const MINIMUM_MAX_LINES = 1;
|
|
|
19
19
|
*/
|
|
20
20
|
const SnippetBlock = ({
|
|
21
21
|
maxLines = DEFAULT_MAX_LINES,
|
|
22
|
-
status = SmartLinkStatus.Fallback,
|
|
23
22
|
testId = 'smart-block-snippet',
|
|
24
23
|
text,
|
|
25
24
|
isHidden = false,
|
|
@@ -35,17 +34,9 @@ const SnippetBlock = ({
|
|
|
35
34
|
useSmartLinkRenderers() : undefined;
|
|
36
35
|
const enableSnippetRenderer = fg('cc-ai-linking-platform-snippet-renderer') ? // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
37
36
|
(_useFlexibleUiOptionC = useFlexibleUiOptionContext()) === null || _useFlexibleUiOptionC === void 0 ? void 0 : _useFlexibleUiOptionC.enableSnippetRenderer : undefined;
|
|
38
|
-
const cardContext =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
42
|
-
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !text) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
} else {
|
|
46
|
-
if (status !== SmartLinkStatus.Resolved && !text) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
37
|
+
const cardContext = useFlexibleCardContext();
|
|
38
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !text) {
|
|
39
|
+
return null;
|
|
49
40
|
}
|
|
50
41
|
const snippetMaxLines = getMaxLines(maxLines, DEFAULT_MAX_LINES, MAXIMUM_MAX_LINES, MINIMUM_MAX_LINES);
|
|
51
42
|
const statusTestId = !text ? 'resolved' : 'non-resolved';
|
|
@@ -55,16 +46,14 @@ const SnippetBlock = ({
|
|
|
55
46
|
});
|
|
56
47
|
if (!fg('cc-ai-linking-platform-snippet-renderer') || !enableSnippetRenderer) {
|
|
57
48
|
var _blockProps$size, _cardContext$ui;
|
|
58
|
-
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps,
|
|
59
|
-
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
60
|
-
} : undefined, {
|
|
49
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
50
|
+
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
61
51
|
testId: `${testId}-${statusTestId}-view`
|
|
62
52
|
}), snippet);
|
|
63
53
|
}
|
|
64
54
|
const SnippetReplacement = renderers === null || renderers === void 0 ? void 0 : renderers.snippet;
|
|
65
|
-
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps,
|
|
66
|
-
size: (_blockProps$size2 = blockProps.size) !== null && _blockProps$size2 !== void 0 ? _blockProps$size2 : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui2 = cardContext.ui) === null || _cardContext$ui2 === void 0 ? void 0 : _cardContext$ui2.size
|
|
67
|
-
} : undefined, {
|
|
55
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
56
|
+
size: (_blockProps$size2 = blockProps.size) !== null && _blockProps$size2 !== void 0 ? _blockProps$size2 : cardContext === null || cardContext === void 0 ? void 0 : (_cardContext$ui2 = cardContext.ui) === null || _cardContext$ui2 === void 0 ? void 0 : _cardContext$ui2.size,
|
|
68
57
|
testId: `${testId}-${statusTestId}-view`
|
|
69
58
|
}), SnippetReplacement ? /*#__PURE__*/React.createElement(SnippetReplacement, {
|
|
70
59
|
fallbackText: (_ref = text || (context === null || context === void 0 ? void 0 : context.snippet)) !== null && _ref !== void 0 ? _ref : '',
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
6
|
-
import { InternalActionName, SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
3
|
+
import { InternalActionName, SmartLinkAlignment } from '../../../../../../constants';
|
|
7
4
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
8
5
|
import { UnresolvedAction } from '../../../actions';
|
|
9
6
|
import { LinkIcon } from '../../../elements';
|
|
@@ -28,16 +25,8 @@ const TitleBlockErroredView = ({
|
|
|
28
25
|
...blockProps
|
|
29
26
|
}) => {
|
|
30
27
|
var _context$actions;
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
onClick,
|
|
34
|
-
values
|
|
35
|
-
} = retry || {};
|
|
36
|
-
const hasAction = onClick !== undefined;
|
|
37
|
-
const context = fg('platform-linking-flexible-card-unresolved-action') ?
|
|
38
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
-
useFlexibleUiContext() : {};
|
|
40
|
-
const showRetry = fg('platform-linking-flexible-card-unresolved-action') ? !hideRetry && Boolean(context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]) : false;
|
|
28
|
+
const context = useFlexibleUiContext();
|
|
29
|
+
const showRetry = !hideRetry && Boolean(context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]);
|
|
41
30
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
42
31
|
testId: `${testId}-errored-view`
|
|
43
32
|
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
@@ -47,15 +36,6 @@ const TitleBlockErroredView = ({
|
|
|
47
36
|
align: SmartLinkAlignment.Right
|
|
48
37
|
}, /*#__PURE__*/React.createElement(UnresolvedAction, {
|
|
49
38
|
testId: testId
|
|
50
|
-
})),
|
|
51
|
-
direction: SmartLinkDirection.Horizontal,
|
|
52
|
-
align: SmartLinkAlignment.Right
|
|
53
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
54
|
-
onClick: onClick,
|
|
55
|
-
testId: `${testId}-errored-view-message`,
|
|
56
|
-
tabIndex: hasAction ? 0 : -1
|
|
57
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
|
|
58
|
-
values: values
|
|
59
|
-
})))), actionGroup);
|
|
39
|
+
})), actionGroup);
|
|
60
40
|
};
|
|
61
41
|
export default TitleBlockErroredView;
|