@atlaskit/smart-card 39.2.2 → 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 +19 -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/common/base-avatar-group-element/index.js +4 -2
- 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/common/base-avatar-group-element/index.js +6 -2
- 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/common/base-avatar-group-element/index.js +4 -2
- 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 +4 -7
|
@@ -1,5 +1,4 @@
|
|
|
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.
|
|
@@ -8,31 +7,11 @@ export var FlexibleCardContext = /*#__PURE__*/createContext(undefined);
|
|
|
8
7
|
export var useFlexibleCardContext = function useFlexibleCardContext() {
|
|
9
8
|
return useContext(FlexibleCardContext);
|
|
10
9
|
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
14
|
-
* underlying elements.
|
|
15
|
-
* @deprecated Remove on cleanup of platform-linking-flexible-card-context
|
|
16
|
-
*/
|
|
17
|
-
export var FlexibleUiContext = /*#__PURE__*/createContext(undefined);
|
|
18
10
|
export var useFlexibleUiContext = function useFlexibleUiContext() {
|
|
19
11
|
var _useFlexibleCardConte;
|
|
20
|
-
return
|
|
21
|
-
(_useFlexibleCardConte = useFlexibleCardContext()) === null || _useFlexibleCardConte === void 0 ? void 0 : _useFlexibleCardConte.data :
|
|
22
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
23
|
-
useContext(FlexibleUiContext);
|
|
12
|
+
return (_useFlexibleCardConte = useFlexibleCardContext()) === null || _useFlexibleCardConte === void 0 ? void 0 : _useFlexibleCardConte.data;
|
|
24
13
|
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* This provides the ui options that will be used by Smart Links Flexible UI
|
|
28
|
-
* to render its underlying elements.
|
|
29
|
-
* @deprecated Remove on cleanup of platform-linking-flexible-card-context
|
|
30
|
-
*/
|
|
31
|
-
export var FlexibleUiOptionContext = /*#__PURE__*/createContext(undefined);
|
|
32
14
|
export var useFlexibleUiOptionContext = function useFlexibleUiOptionContext() {
|
|
33
15
|
var _useFlexibleCardConte2;
|
|
34
|
-
return
|
|
35
|
-
(_useFlexibleCardConte2 = useFlexibleCardContext()) === null || _useFlexibleCardConte2 === void 0 ? void 0 : _useFlexibleCardConte2.ui :
|
|
36
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
37
|
-
useContext(FlexibleUiOptionContext);
|
|
16
|
+
return (_useFlexibleCardConte2 = useFlexibleCardContext()) === null || _useFlexibleCardConte2 === void 0 ? void 0 : _useFlexibleCardConte2.ui;
|
|
38
17
|
};
|
|
@@ -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: "39.
|
|
7
|
+
packageVersion: "39.3.0"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -7,10 +7,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
7
7
|
import { useEffect, useMemo, useState } from 'react';
|
|
8
8
|
import { browser } from '@atlaskit/linking-common/user-agent';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { ActionName, ElementName, SmartLinkPosition
|
|
10
|
+
import { ActionName, ElementName, SmartLinkPosition } from '../../../constants';
|
|
11
11
|
import FlexibleCard from '../../FlexibleCard';
|
|
12
12
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
13
|
-
import { FlexibleCardUiOptions,
|
|
13
|
+
import { FlexibleCardUiOptions, getSimulatedBetterMetadata, PreviewBlockOptions, titleBlockOptions } from './utils';
|
|
14
14
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
15
15
|
var titleBlockCss = null;
|
|
16
16
|
var footerBlockCss = null;
|
|
@@ -62,8 +62,7 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
62
62
|
hideIcon: true
|
|
63
63
|
}];
|
|
64
64
|
}, []);
|
|
65
|
-
var
|
|
66
|
-
var uiOptions = fg('platform-linking-flexible-card-context') ? FlexibleCardUiOptions : FlexibleCardUiOptionsOld;
|
|
65
|
+
var uiOptions = FlexibleCardUiOptions;
|
|
67
66
|
if (fg('cc-ai-linking-platform-snippet-renderer')) {
|
|
68
67
|
uiOptions.enableSnippetRenderer = true;
|
|
69
68
|
}
|
|
@@ -83,36 +82,24 @@ var ResolvedView = function ResolvedView(_ref) {
|
|
|
83
82
|
subtitle: [{
|
|
84
83
|
name: ElementName.Location
|
|
85
84
|
}],
|
|
86
|
-
metadataPosition: SmartLinkPosition.Top
|
|
87
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
88
|
-
status: status
|
|
89
|
-
}, {
|
|
85
|
+
metadataPosition: SmartLinkPosition.Top,
|
|
90
86
|
CompetitorPrompt: CompetitorPrompt,
|
|
91
87
|
url: url,
|
|
92
88
|
hideIconLoadingSkeleton: hideIconLoadingSkeleton,
|
|
93
89
|
className: ax(["_zulpu2gc _13mh1pd9 _2yhz14q2"])
|
|
94
|
-
})), /*#__PURE__*/React.createElement(MetadataBlock,
|
|
90
|
+
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
95
91
|
primary: topMetadata,
|
|
96
92
|
maxLines: 1
|
|
97
|
-
},
|
|
98
|
-
status: SmartLinkStatus.Resolved
|
|
99
|
-
})), /*#__PURE__*/React.createElement(SnippetBlock, null), /*#__PURE__*/React.createElement(MetadataBlock, _extends({
|
|
93
|
+
}), /*#__PURE__*/React.createElement(SnippetBlock, null), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
100
94
|
primary: bottomMetadata,
|
|
101
95
|
maxLines: 1
|
|
102
|
-
},
|
|
103
|
-
status: SmartLinkStatus.Resolved
|
|
104
|
-
})), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, _extends({}, PreviewBlockOptions, {
|
|
96
|
+
}), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, _extends({}, PreviewBlockOptions, {
|
|
105
97
|
onError: function onError() {
|
|
106
98
|
setIsPreviewBlockErrored(true);
|
|
107
99
|
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
})) : null, /*#__PURE__*/React.createElement(FooterBlock, _extends({
|
|
111
|
-
actions: footerActions
|
|
112
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
113
|
-
status: SmartLinkStatus.Resolved
|
|
114
|
-
}, {
|
|
100
|
+
})) : null, /*#__PURE__*/React.createElement(FooterBlock, {
|
|
101
|
+
actions: footerActions,
|
|
115
102
|
className: ax(["_4t3i1k8s _1e0c1txw _1bah1yb4 _4cvresu3 _1wpz1fhb", safari && fg('platform-linking-visual-refresh-v2') && "_4t3i1osq"])
|
|
116
|
-
}))
|
|
103
|
+
}));
|
|
117
104
|
};
|
|
118
105
|
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
|
var customBlockStyles = null;
|
|
13
13
|
var titleBlockCss = null;
|
|
14
14
|
var footerBlockCss = null;
|
|
@@ -40,28 +40,18 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
40
40
|
onError: onError,
|
|
41
41
|
origin: "smartLinkCard",
|
|
42
42
|
testId: testId,
|
|
43
|
-
ui:
|
|
43
|
+
ui: FlexibleCardUiOptions,
|
|
44
44
|
url: url
|
|
45
45
|
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
|
|
46
46
|
hideIcon: !!title,
|
|
47
|
-
text: title
|
|
48
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
49
|
-
status: cardState.status
|
|
50
|
-
}, {
|
|
47
|
+
text: title,
|
|
51
48
|
className: ax(["_zulpu2gc _13mh1pd9 _2yhz14q2"])
|
|
52
|
-
})), /*#__PURE__*/React.createElement(CustomBlock,
|
|
53
|
-
status: cardState.status
|
|
54
|
-
}, {
|
|
49
|
+
})), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
55
50
|
className: ax(["_zulp1b66 _1e0c1txw _4cvr1y6m _1wpz1fhb _7yjtidpf _ngc01fxt"])
|
|
56
|
-
}
|
|
57
|
-
status: cardState.status
|
|
58
|
-
})), /*#__PURE__*/React.createElement(InternalFooterBlock, _extends({
|
|
51
|
+
}, children), showPreview && /*#__PURE__*/React.createElement(PreviewBlock, PreviewBlockOptions), /*#__PURE__*/React.createElement(InternalFooterBlock, {
|
|
59
52
|
actions: actions,
|
|
60
|
-
testId: "smart-block-card-footer"
|
|
61
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
62
|
-
status: cardState.status
|
|
63
|
-
}, {
|
|
53
|
+
testId: "smart-block-card-footer",
|
|
64
54
|
className: ax(["_4t3i1k8s _1e0c1txw _1bah1yb4 _4cvresu3 _1wpz1fhb", safari && fg('platform-linking-visual-refresh-v2') && "_4t3i1osq"])
|
|
65
|
-
}))
|
|
55
|
+
}));
|
|
66
56
|
};
|
|
67
57
|
export default UnresolvedView;
|
|
@@ -28,7 +28,7 @@ var baseBottomMetaData = [{
|
|
|
28
28
|
name: ElementName.ChecklistProgress
|
|
29
29
|
}];
|
|
30
30
|
export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(cardDetails) {
|
|
31
|
-
var _getExtensionKey, _data$Type$includes, _data$Type
|
|
31
|
+
var _getExtensionKey, _data$Type$includes, _data$Type;
|
|
32
32
|
var extensionKey = (_getExtensionKey = getExtensionKey(cardDetails)) !== null && _getExtensionKey !== void 0 ? _getExtensionKey : '';
|
|
33
33
|
var data = cardDetails === null || cardDetails === void 0 ? void 0 : cardDetails.data;
|
|
34
34
|
var defaultTitleMetadata = [{
|
|
@@ -79,7 +79,7 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
79
79
|
};
|
|
80
80
|
case 'jira-object-provider':
|
|
81
81
|
var 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
|
-
var isJiraPlan =
|
|
82
|
+
var isJiraPlan = data['atlassian:ownedBy'] ? true : false;
|
|
83
83
|
var topMetadata = [{
|
|
84
84
|
name: ElementName.AuthorGroup
|
|
85
85
|
}, {
|
|
@@ -156,13 +156,6 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
|
-
/**
|
|
160
|
-
* @deprecated Remove on platform-linking-flexible-card-context cleanup
|
|
161
|
-
*/
|
|
162
|
-
export var FlexibleCardUiOptionsOld = {
|
|
163
|
-
hideElevation: true,
|
|
164
|
-
hideLegacyButton: true
|
|
165
|
-
};
|
|
166
159
|
export var FlexibleCardUiOptions = {
|
|
167
160
|
hideElevation: true,
|
|
168
161
|
hideLegacyButton: true,
|
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useMemo, useState } from 'react';
|
|
7
7
|
import { di } from 'react-magnetic-di';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
8
|
import { SmartLinkSize } from '../../../../../constants';
|
|
10
9
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
11
10
|
import * as Actions from '../../actions';
|
|
@@ -87,7 +86,7 @@ var ActionBlock = function ActionBlock(_ref) {
|
|
|
87
86
|
},
|
|
88
87
|
onError: onError,
|
|
89
88
|
onLoadingChange: onLoadingChange,
|
|
90
|
-
size:
|
|
89
|
+
size: size || (ui === null || ui === void 0 ? void 0 : ui.size)
|
|
91
90
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/no-unsafe-design-token-usage
|
|
92
91
|
,
|
|
93
92
|
style: padding && {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["testId"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
7
6
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
8
7
|
import AIFooterBlockResolvedView from './resolved';
|
|
@@ -14,25 +13,15 @@ import AIFooterBlockResolvedView from './resolved';
|
|
|
14
13
|
*/
|
|
15
14
|
var AIFooterBlock = function AIFooterBlock(_ref) {
|
|
16
15
|
var _props$size, _cardContext$ui;
|
|
17
|
-
var
|
|
18
|
-
_ref$testId = _ref.testId,
|
|
16
|
+
var _ref$testId = _ref.testId,
|
|
19
17
|
testId = _ref$testId === void 0 ? 'smart-ai-footer-block' : _ref$testId,
|
|
20
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
var cardContext =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
25
|
-
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
if (status !== SmartLinkStatus.Resolved) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
19
|
+
var cardContext = useFlexibleCardContext();
|
|
20
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
21
|
+
return null;
|
|
32
22
|
}
|
|
33
|
-
return /*#__PURE__*/React.createElement(AIFooterBlockResolvedView, _extends({}, props,
|
|
34
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
35
|
-
} : undefined, {
|
|
23
|
+
return /*#__PURE__*/React.createElement(AIFooterBlockResolvedView, _extends({}, props, {
|
|
24
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
36
25
|
testId: testId
|
|
37
26
|
}));
|
|
38
27
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["testId"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { InternalActionName, SmartLinkStatus } from '../../../../../constants';
|
|
7
6
|
import { useFlexibleCardContext, useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
7
|
import AISummaryBlockResolvedView from './resolved';
|
|
@@ -15,30 +14,20 @@ import AISummaryBlockResolvedView from './resolved';
|
|
|
15
14
|
*/
|
|
16
15
|
var AISummaryBlock = function AISummaryBlock(_ref) {
|
|
17
16
|
var _context$actions, _props$size, _cardContext$ui;
|
|
18
|
-
var
|
|
19
|
-
_ref$testId = _ref.testId,
|
|
17
|
+
var _ref$testId = _ref.testId,
|
|
20
18
|
testId = _ref$testId === void 0 ? 'smart-ai-summary-block' : _ref$testId,
|
|
21
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
var cardContext =
|
|
23
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
24
|
-
useFlexibleCardContext() : undefined;
|
|
20
|
+
var cardContext = useFlexibleCardContext();
|
|
25
21
|
var context = useFlexibleUiContext();
|
|
26
22
|
var actionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.AISummaryAction];
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
if (status !== SmartLinkStatus.Resolved) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
23
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
24
|
+
return null;
|
|
35
25
|
}
|
|
36
26
|
if (!(actionData !== null && actionData !== void 0 && actionData.url)) {
|
|
37
27
|
return null;
|
|
38
28
|
}
|
|
39
|
-
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedView, _extends({}, props,
|
|
40
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
41
|
-
} : undefined, {
|
|
29
|
+
return /*#__PURE__*/React.createElement(AISummaryBlockResolvedView, _extends({}, props, {
|
|
30
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
42
31
|
testId: testId,
|
|
43
32
|
url: actionData.url
|
|
44
33
|
}));
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["testId", "alwaysShow"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
7
6
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
8
7
|
import FooterBlockResolvedView from './resolved';
|
|
@@ -15,26 +14,16 @@ import FooterBlockResolvedView from './resolved';
|
|
|
15
14
|
*/
|
|
16
15
|
var FooterBlock = function FooterBlock(_ref) {
|
|
17
16
|
var _props$size, _cardContext$ui;
|
|
18
|
-
var
|
|
19
|
-
_ref$testId = _ref.testId,
|
|
17
|
+
var _ref$testId = _ref.testId,
|
|
20
18
|
testId = _ref$testId === void 0 ? 'smart-footer-block' : _ref$testId,
|
|
21
19
|
alwaysShow = _ref.alwaysShow,
|
|
22
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
var cardContext =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
27
|
-
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !alwaysShow) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
if (status !== SmartLinkStatus.Resolved && !alwaysShow) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
21
|
+
var cardContext = useFlexibleCardContext();
|
|
22
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !alwaysShow) {
|
|
23
|
+
return null;
|
|
34
24
|
}
|
|
35
|
-
return /*#__PURE__*/React.createElement(FooterBlockResolvedView, _extends({}, props,
|
|
36
|
-
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
37
|
-
} : undefined, {
|
|
25
|
+
return /*#__PURE__*/React.createElement(FooterBlockResolvedView, _extends({}, props, {
|
|
26
|
+
size: (_props$size = props.size) !== null && _props$size !== void 0 ? _props$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
38
27
|
testId: testId
|
|
39
28
|
}));
|
|
40
29
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/* index.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["maxLines", "
|
|
4
|
+
var _excluded = ["maxLines", "testId", "primary", "secondary"];
|
|
5
5
|
import "./index.compiled.css";
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { ax, ix } from "@compiled/react/runtime";
|
|
8
8
|
/* eslint-disable @atlaskit/design-system/use-tokens-typography */
|
|
9
9
|
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkStatus, SmartLinkWidth } from '../../../../../constants';
|
|
12
11
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
13
12
|
import Block from '../block';
|
|
@@ -64,11 +63,9 @@ var ElementItemRenderer = function ElementItemRenderer(_ref) {
|
|
|
64
63
|
* @see Block
|
|
65
64
|
*/
|
|
66
65
|
var MetadataBlock = function MetadataBlock(_ref2) {
|
|
67
|
-
var _ref3, _blockProps$
|
|
66
|
+
var _ref3, _blockProps$size, _cardContext$ui;
|
|
68
67
|
var _ref2$maxLines = _ref2.maxLines,
|
|
69
68
|
maxLines = _ref2$maxLines === void 0 ? DEFAULT_MAX_LINES : _ref2$maxLines,
|
|
70
|
-
_ref2$status = _ref2.status,
|
|
71
|
-
status = _ref2$status === void 0 ? SmartLinkStatus.Fallback : _ref2$status,
|
|
72
69
|
_ref2$testId = _ref2.testId,
|
|
73
70
|
testId = _ref2$testId === void 0 ? 'smart-block-metadata' : _ref2$testId,
|
|
74
71
|
_ref2$primary = _ref2.primary,
|
|
@@ -76,53 +73,24 @@ var MetadataBlock = function MetadataBlock(_ref2) {
|
|
|
76
73
|
_ref2$secondary = _ref2.secondary,
|
|
77
74
|
secondary = _ref2$secondary === void 0 ? [] : _ref2$secondary,
|
|
78
75
|
blockProps = _objectWithoutProperties(_ref2, _excluded);
|
|
79
|
-
var cardContext =
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
83
|
-
if (primary.length === 0 && secondary.length === 0 || (cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
} else {
|
|
87
|
-
if (primary.length === 0 && secondary.length === 0 || status !== SmartLinkStatus.Resolved) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
76
|
+
var cardContext = useFlexibleCardContext();
|
|
77
|
+
if (primary.length === 0 && secondary.length === 0 || (cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved) {
|
|
78
|
+
return null;
|
|
90
79
|
}
|
|
91
|
-
var _blockProps$size = blockProps.size
|
|
92
|
-
sizeProp = _blockProps$size === void 0 ? SmartLinkSize.Medium : _blockProps$size;
|
|
93
|
-
var size = fg('platform-linking-flexible-card-context') ? (_ref3 = (_blockProps$size2 = blockProps === null || blockProps === void 0 ? void 0 : blockProps.size) !== null && _blockProps$size2 !== void 0 ? _blockProps$size2 : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size) !== null && _ref3 !== void 0 ? _ref3 : SmartLinkSize.Medium : sizeProp;
|
|
80
|
+
var size = (_ref3 = (_blockProps$size = blockProps === null || blockProps === void 0 ? void 0 : blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size) !== null && _ref3 !== void 0 ? _ref3 : SmartLinkSize.Medium;
|
|
94
81
|
var maxLinesTotal = getMaxLines(maxLines);
|
|
95
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
96
|
-
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
97
|
-
size: size,
|
|
98
|
-
testId: "".concat(testId, "-resolved-view")
|
|
99
|
-
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
100
|
-
items: primary,
|
|
101
|
-
size: size,
|
|
102
|
-
maxLines: maxLinesTotal
|
|
103
|
-
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
104
|
-
align: SmartLinkAlignment.Right,
|
|
105
|
-
items: secondary,
|
|
106
|
-
size: size,
|
|
107
|
-
maxLines: maxLinesTotal
|
|
108
|
-
}));
|
|
109
|
-
}
|
|
110
|
-
var primaryElements = renderElementItems(primary);
|
|
111
|
-
var secondaryElements = renderElementItems(secondary);
|
|
112
82
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
83
|
+
size: size,
|
|
113
84
|
testId: "".concat(testId, "-resolved-view")
|
|
114
|
-
}),
|
|
115
|
-
|
|
116
|
-
direction: SmartLinkDirection.Horizontal,
|
|
117
|
-
width: SmartLinkWidth.Flexible,
|
|
85
|
+
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
86
|
+
items: primary,
|
|
118
87
|
size: size,
|
|
119
|
-
|
|
120
|
-
}
|
|
88
|
+
maxLines: maxLinesTotal
|
|
89
|
+
}), /*#__PURE__*/React.createElement(ElementItemRenderer, {
|
|
121
90
|
align: SmartLinkAlignment.Right,
|
|
122
|
-
|
|
123
|
-
width: SmartLinkWidth.Flexible,
|
|
91
|
+
items: secondary,
|
|
124
92
|
size: size,
|
|
125
|
-
|
|
126
|
-
}
|
|
93
|
+
maxLines: maxLinesTotal
|
|
94
|
+
}));
|
|
127
95
|
};
|
|
128
96
|
export default MetadataBlock;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["
|
|
3
|
+
var _excluded = ["testId", "overrideUrl"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { SmartLinkStatus } from '../../../../../constants';
|
|
7
5
|
import { useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
8
6
|
import PreviewBlockResolvedView from './resolved';
|
|
9
7
|
/**
|
|
@@ -14,18 +12,13 @@ import PreviewBlockResolvedView from './resolved';
|
|
|
14
12
|
*/
|
|
15
13
|
var PreviewBlock = function PreviewBlock(_ref) {
|
|
16
14
|
var _blockProps$size;
|
|
17
|
-
var _ref$
|
|
18
|
-
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
19
|
-
_ref$testId = _ref.testId,
|
|
15
|
+
var _ref$testId = _ref.testId,
|
|
20
16
|
testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
|
|
21
17
|
overrideUrl = _ref.overrideUrl,
|
|
22
18
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
var ui =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return /*#__PURE__*/React.createElement(PreviewBlockResolvedView, _extends({}, blockProps, fg('platform-linking-flexible-card-context') ? {
|
|
27
|
-
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : ui === null || ui === void 0 ? void 0 : ui.size
|
|
28
|
-
} : undefined, {
|
|
19
|
+
var ui = useFlexibleUiOptionContext();
|
|
20
|
+
return /*#__PURE__*/React.createElement(PreviewBlockResolvedView, _extends({}, blockProps, {
|
|
21
|
+
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : ui === null || ui === void 0 ? void 0 : ui.size,
|
|
29
22
|
testId: testId,
|
|
30
23
|
overrideUrl: overrideUrl
|
|
31
24
|
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["maxLines", "
|
|
3
|
+
var _excluded = ["maxLines", "testId", "text", "isHidden", "showFooter"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
@@ -23,8 +23,6 @@ var SnippetBlock = function SnippetBlock(_ref) {
|
|
|
23
23
|
var _useFlexibleUiOptionC, _blockProps$size2, _cardContext$ui2, _ref2, _context$meta$objectI, _context$meta, _context$meta$resourc, _context$meta2, _context$meta$tenantI, _context$meta3;
|
|
24
24
|
var _ref$maxLines = _ref.maxLines,
|
|
25
25
|
maxLines = _ref$maxLines === void 0 ? DEFAULT_MAX_LINES : _ref$maxLines,
|
|
26
|
-
_ref$status = _ref.status,
|
|
27
|
-
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
28
26
|
_ref$testId = _ref.testId,
|
|
29
27
|
testId = _ref$testId === void 0 ? 'smart-block-snippet' : _ref$testId,
|
|
30
28
|
text = _ref.text,
|
|
@@ -41,17 +39,9 @@ var SnippetBlock = function SnippetBlock(_ref) {
|
|
|
41
39
|
useSmartLinkRenderers() : undefined;
|
|
42
40
|
var enableSnippetRenderer = fg('cc-ai-linking-platform-snippet-renderer') ? // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
43
41
|
(_useFlexibleUiOptionC = useFlexibleUiOptionContext()) === null || _useFlexibleUiOptionC === void 0 ? void 0 : _useFlexibleUiOptionC.enableSnippetRenderer : undefined;
|
|
44
|
-
var cardContext =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (fg('platform-linking-flexible-card-context')) {
|
|
48
|
-
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !text) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
if (status !== SmartLinkStatus.Resolved && !text) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
42
|
+
var cardContext = useFlexibleCardContext();
|
|
43
|
+
if ((cardContext === null || cardContext === void 0 ? void 0 : cardContext.status) !== SmartLinkStatus.Resolved && !text) {
|
|
44
|
+
return null;
|
|
55
45
|
}
|
|
56
46
|
var snippetMaxLines = getMaxLines(maxLines, DEFAULT_MAX_LINES, MAXIMUM_MAX_LINES, MINIMUM_MAX_LINES);
|
|
57
47
|
var statusTestId = !text ? 'resolved' : 'non-resolved';
|
|
@@ -61,16 +51,14 @@ var SnippetBlock = function SnippetBlock(_ref) {
|
|
|
61
51
|
});
|
|
62
52
|
if (!fg('cc-ai-linking-platform-snippet-renderer') || !enableSnippetRenderer) {
|
|
63
53
|
var _blockProps$size, _cardContext$ui;
|
|
64
|
-
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps,
|
|
65
|
-
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size
|
|
66
|
-
} : undefined, {
|
|
54
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
55
|
+
size: (_blockProps$size = blockProps.size) !== null && _blockProps$size !== void 0 ? _blockProps$size : cardContext === null || cardContext === void 0 || (_cardContext$ui = cardContext.ui) === null || _cardContext$ui === void 0 ? void 0 : _cardContext$ui.size,
|
|
67
56
|
testId: "".concat(testId, "-").concat(statusTestId, "-view")
|
|
68
57
|
}), snippet);
|
|
69
58
|
}
|
|
70
59
|
var SnippetReplacement = renderers === null || renderers === void 0 ? void 0 : renderers.snippet;
|
|
71
|
-
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps,
|
|
72
|
-
size: (_blockProps$size2 = blockProps.size) !== null && _blockProps$size2 !== void 0 ? _blockProps$size2 : cardContext === null || cardContext === void 0 || (_cardContext$ui2 = cardContext.ui) === null || _cardContext$ui2 === void 0 ? void 0 : _cardContext$ui2.size
|
|
73
|
-
} : undefined, {
|
|
60
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
61
|
+
size: (_blockProps$size2 = blockProps.size) !== null && _blockProps$size2 !== void 0 ? _blockProps$size2 : cardContext === null || cardContext === void 0 || (_cardContext$ui2 = cardContext.ui) === null || _cardContext$ui2 === void 0 ? void 0 : _cardContext$ui2.size,
|
|
74
62
|
testId: "".concat(testId, "-").concat(statusTestId, "-view")
|
|
75
63
|
}), SnippetReplacement ? /*#__PURE__*/React.createElement(SnippetReplacement, {
|
|
76
64
|
fallbackText: (_ref2 = text || (context === null || context === void 0 ? void 0 : context.snippet)) !== null && _ref2 !== void 0 ? _ref2 : '',
|
|
@@ -2,10 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
|
-
import { InternalActionName, SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
|
|
5
|
+
import { InternalActionName, SmartLinkAlignment } from '../../../../../../constants';
|
|
9
6
|
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
10
7
|
import { UnresolvedAction } from '../../../actions';
|
|
11
8
|
import { LinkIcon } from '../../../elements';
|
|
@@ -29,15 +26,8 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
29
26
|
icon = _ref.icon,
|
|
30
27
|
hideIcon = _ref.hideIcon,
|
|
31
28
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
onClick = _ref2.onClick,
|
|
35
|
-
values = _ref2.values;
|
|
36
|
-
var hasAction = onClick !== undefined;
|
|
37
|
-
var context = fg('platform-linking-flexible-card-unresolved-action') ?
|
|
38
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
-
useFlexibleUiContext() : {};
|
|
40
|
-
var showRetry = fg('platform-linking-flexible-card-unresolved-action') ? !hideRetry && Boolean(context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]) : false;
|
|
29
|
+
var context = useFlexibleUiContext();
|
|
30
|
+
var showRetry = !hideRetry && Boolean(context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]);
|
|
41
31
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
42
32
|
testId: "".concat(testId, "-errored-view")
|
|
43
33
|
}), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
|
|
@@ -47,15 +37,6 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
|
|
|
47
37
|
align: SmartLinkAlignment.Right
|
|
48
38
|
}, /*#__PURE__*/React.createElement(UnresolvedAction, {
|
|
49
39
|
testId: testId
|
|
50
|
-
})),
|
|
51
|
-
direction: SmartLinkDirection.Horizontal,
|
|
52
|
-
align: SmartLinkAlignment.Right
|
|
53
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
54
|
-
onClick: onClick,
|
|
55
|
-
testId: "".concat(testId, "-errored-view-message"),
|
|
56
|
-
tabIndex: hasAction ? 0 : -1
|
|
57
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
|
|
58
|
-
values: values
|
|
59
|
-
})))), actionGroup);
|
|
40
|
+
})), actionGroup);
|
|
60
41
|
};
|
|
61
42
|
export default TitleBlockErroredView;
|