@atlaskit/smart-card 39.3.0 → 40.0.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 +36 -0
- package/dist/cjs/extractors/flexible/index.js +3 -7
- package/dist/cjs/index.js +6 -0
- 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/actions/action/action-button/index.js +0 -12
- package/dist/cjs/view/FlexibleCard/components/actions/custom-unresolved-action/index.compiled.css +3 -0
- package/dist/cjs/view/FlexibleCard/components/actions/custom-unresolved-action/index.js +79 -0
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
- 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 +2 -1
- package/dist/cjs/view/FlexibleCard/components/elements/custom-by-access-type-element/index.js +15 -12
- package/dist/cjs/view/FlexibleCard/components/elements/title-element/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/external.js +6 -0
- 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/index.js +1 -1
- 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/actions/action/action-button/index.js +0 -12
- package/dist/es2019/view/FlexibleCard/components/actions/custom-unresolved-action/index.compiled.css +3 -0
- package/dist/es2019/view/FlexibleCard/components/actions/custom-unresolved-action/index.js +73 -0
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
- 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 +2 -1
- package/dist/es2019/view/FlexibleCard/components/elements/custom-by-access-type-element/index.js +15 -12
- package/dist/es2019/view/FlexibleCard/components/elements/title-element/index.js +2 -3
- package/dist/es2019/view/FlexibleCard/external.js +1 -0
- 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/index.js +1 -1
- 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/actions/action/action-button/index.js +0 -12
- package/dist/esm/view/FlexibleCard/components/actions/custom-unresolved-action/index.compiled.css +3 -0
- package/dist/esm/view/FlexibleCard/components/actions/custom-unresolved-action/index.js +72 -0
- package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
- 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 +2 -1
- package/dist/esm/view/FlexibleCard/components/elements/custom-by-access-type-element/index.js +15 -12
- package/dist/esm/view/FlexibleCard/components/elements/title-element/index.js +2 -3
- package/dist/esm/view/FlexibleCard/external.js +1 -0
- 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/index.d.ts +1 -1
- 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/actions/custom-unresolved-action/index.d.ts +16 -0
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- 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 +3 -8
- package/dist/types/view/FlexibleCard/components/container/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/custom-by-access-type-element/index.d.ts +2 -1
- package/dist/types/view/FlexibleCard/external.d.ts +2 -1
- package/dist/types/view/HoverCard/styled.d.ts +0 -4
- package/dist/types-ts4.5/index.d.ts +1 -1
- 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/actions/custom-unresolved-action/index.d.ts +16 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
- 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 +3 -8
- package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/custom-by-access-type-element/index.d.ts +2 -1
- package/dist/types-ts4.5/view/FlexibleCard/external.d.ts +2 -1
- package/dist/types-ts4.5/view/HoverCard/styled.d.ts +0 -4
- package/package.json +5 -8
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
4
4
|
import "./index.compiled.css";
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
import React
|
|
6
|
+
import React from 'react';
|
|
7
7
|
import { di } from 'react-magnetic-di';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { FlexibleUiContext, useFlexibleUiContext } from '../../../../state/flexible-ui-context';
|
|
8
|
+
import { MediaPlacement, SmartLinkSize } from '../../../../constants';
|
|
9
|
+
import { useFlexibleUiContext } from '../../../../state/flexible-ui-context';
|
|
11
10
|
import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
|
|
12
|
-
import { isFlexibleUiBlock, isFlexibleUiPreviewBlock,
|
|
11
|
+
import { isFlexibleUiBlock, isFlexibleUiPreviewBlock, isStyleCacheProvider } from '../../../../utils/flexible';
|
|
13
12
|
import { TitleBlock } from '../blocks';
|
|
14
13
|
import HoverCardControl from './hover-card-control';
|
|
15
14
|
import LayeredLink from './layered-link';
|
|
@@ -40,91 +39,6 @@ const filterChildren = (children, removeBlockRestriction) => {
|
|
|
40
39
|
}
|
|
41
40
|
return React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child) ? child : undefined);
|
|
42
41
|
};
|
|
43
|
-
const renderChildren = (children, containerSize, containerTheme, status, retry, onClick, removeBlockRestriction) => {
|
|
44
|
-
return React.Children.map(children, child => {
|
|
45
|
-
if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child)) {
|
|
46
|
-
if (isFlexibleUiTitleBlock(child)) {
|
|
47
|
-
if (isStyleCacheProvider(child)) {
|
|
48
|
-
return updateChildrenTitleBlock(child, {
|
|
49
|
-
onClick,
|
|
50
|
-
retry,
|
|
51
|
-
containerSize,
|
|
52
|
-
status,
|
|
53
|
-
theme: containerTheme
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
const {
|
|
57
|
-
size: blockSize
|
|
58
|
-
} = child.props;
|
|
59
|
-
const size = blockSize || containerSize;
|
|
60
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
61
|
-
// @ts-expect-error
|
|
62
|
-
onClick,
|
|
63
|
-
size,
|
|
64
|
-
status,
|
|
65
|
-
theme: containerTheme,
|
|
66
|
-
...(fg('platform-linking-flexible-card-unresolved-action') ? undefined : {
|
|
67
|
-
retry
|
|
68
|
-
})
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const {
|
|
73
|
-
size: blockSize
|
|
74
|
-
} = child.props;
|
|
75
|
-
const size = blockSize || containerSize;
|
|
76
|
-
if (isStyleCacheProvider(child)) {
|
|
77
|
-
return updateChildrenBlock(child, size, status);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// @ts-expect-error
|
|
81
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
82
|
-
size,
|
|
83
|
-
status
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (removeBlockRestriction) {
|
|
87
|
-
return child;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
const updateChildrenBlock = (node, size, status) => {
|
|
92
|
-
const updatedChildren = React.Children.map(node.props.children, child => {
|
|
93
|
-
if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiBlock(child)) {
|
|
94
|
-
// @ts-expect-error
|
|
95
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
96
|
-
size,
|
|
97
|
-
status
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
return child;
|
|
101
|
-
});
|
|
102
|
-
return /*#__PURE__*/React.cloneElement(node, {
|
|
103
|
-
children: updatedChildren
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
const updateChildrenTitleBlock = (node, {
|
|
107
|
-
containerSize,
|
|
108
|
-
...props
|
|
109
|
-
}) => {
|
|
110
|
-
const updatedChildren = React.Children.map(node.props.children, child => {
|
|
111
|
-
if ( /*#__PURE__*/React.isValidElement(child) && isFlexibleUiTitleBlock(child)) {
|
|
112
|
-
const {
|
|
113
|
-
size: blockSize
|
|
114
|
-
} = child.props;
|
|
115
|
-
const size = blockSize || containerSize;
|
|
116
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
117
|
-
...props,
|
|
118
|
-
size
|
|
119
|
-
});
|
|
120
|
-
} else {
|
|
121
|
-
return child;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
return /*#__PURE__*/React.cloneElement(node, {
|
|
125
|
-
children: updatedChildren
|
|
126
|
-
});
|
|
127
|
-
};
|
|
128
42
|
|
|
129
43
|
/**
|
|
130
44
|
* Note: This function is only necessary for CompiledCSS within Jest tests due to the way it handles Styles.
|
|
@@ -161,7 +75,6 @@ const getTitleBlockProps = children => {
|
|
|
161
75
|
const getLayeredLink = (testId, context, children, onClick) => {
|
|
162
76
|
const {
|
|
163
77
|
linkTitle,
|
|
164
|
-
title,
|
|
165
78
|
url = ''
|
|
166
79
|
} = context || {};
|
|
167
80
|
const {
|
|
@@ -172,7 +85,7 @@ const getLayeredLink = (testId, context, children, onClick) => {
|
|
|
172
85
|
onClick: onClick,
|
|
173
86
|
target: target,
|
|
174
87
|
testId: testId,
|
|
175
|
-
text: text ||
|
|
88
|
+
text: text || (linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text),
|
|
176
89
|
url: url
|
|
177
90
|
});
|
|
178
91
|
};
|
|
@@ -253,16 +166,11 @@ const Container = ({
|
|
|
253
166
|
removeBlockRestriction = false,
|
|
254
167
|
size = SmartLinkSize.Medium,
|
|
255
168
|
status,
|
|
256
|
-
testId = 'smart-links-container'
|
|
257
|
-
theme = SmartLinkTheme.Link
|
|
169
|
+
testId = 'smart-links-container'
|
|
258
170
|
}) => {
|
|
259
171
|
const padding = hidePadding ? '0px' : getPadding(size);
|
|
260
172
|
const gap = getGap(size);
|
|
261
|
-
const context =
|
|
262
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
263
|
-
useFlexibleUiContext() :
|
|
264
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
265
|
-
useContext(FlexibleUiContext);
|
|
173
|
+
const context = useFlexibleUiContext();
|
|
266
174
|
const {
|
|
267
175
|
previewOnLeft,
|
|
268
176
|
previewOnRight
|
|
@@ -281,7 +189,7 @@ const Container = ({
|
|
|
281
189
|
"--_73mooq": ix(previewOnLeft ? gap : padding),
|
|
282
190
|
"--_12k13bg": ix(previewOnRight ? gap : padding)
|
|
283
191
|
}
|
|
284
|
-
}, clickableContainer ? getLayeredLink(testId, context, children, onClick) : null,
|
|
192
|
+
}, clickableContainer ? getLayeredLink(testId, context, children, onClick) : null, filterChildren(children, removeBlockRestriction));
|
|
285
193
|
if (context !== null && context !== void 0 && context.url && (canShowHoverPreview || canShowAuthTooltip)) {
|
|
286
194
|
return /*#__PURE__*/React.createElement(HoverCardControl, {
|
|
287
195
|
isHoverPreview: canShowHoverPreview,
|
package/dist/es2019/view/FlexibleCard/components/elements/common/base-avatar-group-element/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
10
10
|
import { ElementName, SmartLinkSize } from '../../../../../../constants';
|
|
11
11
|
import { messages } from '../../../../../../messages';
|
|
12
12
|
import { getFormattedMessageAsString } from '../../../utils';
|
|
13
|
+
const stylesOld = null;
|
|
13
14
|
const styles = null;
|
|
14
15
|
const stylesMap = {
|
|
15
16
|
xlarge: "_1e0c116y _1kvxu2gc _102oidpf",
|
|
@@ -81,7 +82,7 @@ const BaseAvatarGroup = ({
|
|
|
81
82
|
"data-testid": testId
|
|
82
83
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
83
84
|
,
|
|
84
|
-
className: ax([stylesMap[size], "_1ul91ns9", className])
|
|
85
|
+
className: ax([!fg('platform-linking-fix-smart-card-avatar-overrides') && stylesMap[size], fg('platform-linking-fix-smart-card-avatar-overrides') ? "_1ul91ns9 _1e0c116y _1kvxu2gc _102oidpf" : "_1ul91ns9", className])
|
|
85
86
|
}), /*#__PURE__*/React.createElement(AtlaskitAvatarGroup, {
|
|
86
87
|
maxCount: maxCount,
|
|
87
88
|
appearance: "stack",
|
package/dist/es2019/view/FlexibleCard/components/elements/custom-by-access-type-element/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { InternalActionName } from '../../../../../constants';
|
|
3
4
|
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
|
|
4
5
|
import { BaseTextElement } from '../common';
|
|
5
6
|
const CustomElementByAccessType = ({
|
|
@@ -7,22 +8,24 @@ const CustomElementByAccessType = ({
|
|
|
7
8
|
testId = 'custom-by-access-type-element',
|
|
8
9
|
...props
|
|
9
10
|
}) => {
|
|
10
|
-
var _context$data, _context$data$meta, _props;
|
|
11
|
+
var _context$data, _context$data$meta, _props, _context$data2, _context$data2$action, _context$data2$action2;
|
|
11
12
|
const context = useFlexibleCardContext();
|
|
12
13
|
const accessType = context === null || context === void 0 ? void 0 : (_context$data = context.data) === null || _context$data === void 0 ? void 0 : (_context$data$meta = _context$data.meta) === null || _context$data$meta === void 0 ? void 0 : _context$data$meta.accessType;
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
14
|
+
const descriptor = (_props = props[accessType]) !== null && _props !== void 0 ? _props : props.fallback;
|
|
15
|
+
if (!descriptor) {
|
|
15
16
|
return null;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const values = context === null || context === void 0 ? void 0 : (_context$data2 = context.data) === null || _context$data2 === void 0 ? void 0 : (_context$data2$action = _context$data2.actions) === null || _context$data2$action === void 0 ? void 0 : (_context$data2$action2 = _context$data2$action[InternalActionName.UnresolvedAction]) === null || _context$data2$action2 === void 0 ? void 0 : _context$data2$action2.values;
|
|
19
|
+
return /*#__PURE__*/React.createElement(BaseTextElement, _extends({}, props, {
|
|
20
|
+
message: {
|
|
21
|
+
descriptor,
|
|
22
|
+
values
|
|
23
|
+
}
|
|
19
24
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}))
|
|
26
|
-
);
|
|
25
|
+
,
|
|
26
|
+
className: className,
|
|
27
|
+
testId: testId,
|
|
28
|
+
hideFormat: true
|
|
29
|
+
}));
|
|
27
30
|
};
|
|
28
31
|
export default CustomElementByAccessType;
|
|
@@ -1,12 +1,11 @@
|
|
|
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 { ElementName } from '../../../../../constants';
|
|
5
4
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
6
|
-
import { BaseLinkElement
|
|
5
|
+
import { BaseLinkElement } from '../common';
|
|
7
6
|
const TitleElement = props => {
|
|
8
7
|
const context = useFlexibleUiContext();
|
|
9
|
-
const data = context ?
|
|
8
|
+
const data = context ? context === null || context === void 0 ? void 0 : context.linkTitle : null;
|
|
10
9
|
return data ? /*#__PURE__*/React.createElement(BaseLinkElement, _extends({}, data, props, {
|
|
11
10
|
name: ElementName.Title
|
|
12
11
|
})) : null;
|
|
@@ -140,4 +140,5 @@ export const DownloadAction = props => /*#__PURE__*/React.createElement(Download
|
|
|
140
140
|
export const FollowAction = props => /*#__PURE__*/React.createElement(FollowActionComponent, toActionProps(props));
|
|
141
141
|
export const PreviewAction = props => /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
|
|
142
142
|
export const UnresolvedAction = () => /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
|
|
143
|
+
export { CustomUnresolvedAction } from './components/actions';
|
|
143
144
|
export { CustomByAccessTypeElement, CustomByStatusElement } from './components/elements';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useEffect, useMemo } from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
5
|
-
import { SmartLinkStatus } from '../../constants';
|
|
6
|
-
import { FlexibleCardContext
|
|
4
|
+
import { InternalActionName, SmartLinkStatus } from '../../constants';
|
|
5
|
+
import { FlexibleCardContext } from '../../state/flexible-ui-context';
|
|
7
6
|
import { useAISummaryConfig } from '../../state/hooks/use-ai-summary-config';
|
|
8
7
|
import useResolve from '../../state/hooks/use-resolve';
|
|
9
8
|
import Container from './components/container';
|
|
10
|
-
import { getContextByStatus
|
|
9
|
+
import { getContextByStatus } from './utils';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* This represents a Flexible Card: a link represented by a card with metadata.
|
|
@@ -33,6 +32,7 @@ const FlexibleCard = ({
|
|
|
33
32
|
ui,
|
|
34
33
|
url
|
|
35
34
|
}) => {
|
|
35
|
+
var _flexibleCardContext$, _flexibleCardContext$2;
|
|
36
36
|
const aiSummaryConfig = useAISummaryConfig();
|
|
37
37
|
const resolve = useResolve();
|
|
38
38
|
const {
|
|
@@ -58,19 +58,15 @@ const FlexibleCard = ({
|
|
|
58
58
|
status,
|
|
59
59
|
url
|
|
60
60
|
}), [aiSummaryConfig, appearance, fireEvent, details, id, onAuthorize, onClick, origin, renderers, resolve, actionOptions, status, url]);
|
|
61
|
-
const flexibleCardContext =
|
|
62
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
63
|
-
useMemo(() => ({
|
|
61
|
+
const flexibleCardContext = useMemo(() => ({
|
|
64
62
|
data: context,
|
|
65
63
|
status,
|
|
66
64
|
ui
|
|
67
|
-
}), [context, status, ui])
|
|
68
|
-
const retry = fg('platform-linking-flexible-card-unresolved-action') ? undefined : getRetryOptions(url, status, details, onAuthorize);
|
|
65
|
+
}), [context, status, ui]);
|
|
69
66
|
const {
|
|
70
|
-
linkTitle
|
|
71
|
-
title: titleOld
|
|
67
|
+
linkTitle
|
|
72
68
|
} = context || {};
|
|
73
|
-
const title =
|
|
69
|
+
const title = linkTitle === null || linkTitle === void 0 ? void 0 : linkTitle.text;
|
|
74
70
|
useEffect(() => {
|
|
75
71
|
switch (status) {
|
|
76
72
|
case SmartLinkStatus.Resolved:
|
|
@@ -95,33 +91,18 @@ const FlexibleCard = ({
|
|
|
95
91
|
break;
|
|
96
92
|
}
|
|
97
93
|
}, [onError, onResolve, status, title, url]);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, /*#__PURE__*/React.createElement(Container, _extends({
|
|
102
|
-
testId: testId
|
|
103
|
-
}, ui, {
|
|
104
|
-
onClick: onClick,
|
|
105
|
-
retry: retry,
|
|
106
|
-
showHoverPreview: showHoverPreview,
|
|
107
|
-
hoverPreviewOptions: hoverPreviewOptions,
|
|
108
|
-
actionOptions: actionOptions,
|
|
109
|
-
status: status
|
|
110
|
-
}), children));
|
|
111
|
-
}
|
|
112
|
-
return /*#__PURE__*/React.createElement(FlexibleUiOptionContext.Provider, {
|
|
113
|
-
value: ui
|
|
114
|
-
}, /*#__PURE__*/React.createElement(FlexibleUiContext.Provider, {
|
|
115
|
-
value: context
|
|
94
|
+
const retry = (_flexibleCardContext$ = flexibleCardContext.data) === null || _flexibleCardContext$ === void 0 ? void 0 : (_flexibleCardContext$2 = _flexibleCardContext$.actions) === null || _flexibleCardContext$2 === void 0 ? void 0 : _flexibleCardContext$2[InternalActionName.UnresolvedAction];
|
|
95
|
+
return /*#__PURE__*/React.createElement(FlexibleCardContext.Provider, {
|
|
96
|
+
value: flexibleCardContext
|
|
116
97
|
}, /*#__PURE__*/React.createElement(Container, _extends({
|
|
117
98
|
testId: testId
|
|
118
99
|
}, ui, {
|
|
119
100
|
onClick: onClick,
|
|
120
|
-
retry: retry,
|
|
121
101
|
showHoverPreview: showHoverPreview,
|
|
122
102
|
hoverPreviewOptions: hoverPreviewOptions,
|
|
123
103
|
actionOptions: actionOptions,
|
|
124
|
-
status: status
|
|
125
|
-
|
|
104
|
+
status: status,
|
|
105
|
+
retry: retry
|
|
106
|
+
}), children));
|
|
126
107
|
};
|
|
127
108
|
export default FlexibleCard;
|
|
@@ -21,12 +21,9 @@ export const getContextByStatus = params => {
|
|
|
21
21
|
switch (status) {
|
|
22
22
|
case SmartLinkStatus.Pending:
|
|
23
23
|
case SmartLinkStatus.Resolving:
|
|
24
|
-
return
|
|
24
|
+
return {
|
|
25
25
|
linkTitle: extractLinkTitle(status, url, response, onClick),
|
|
26
26
|
url
|
|
27
|
-
} : {
|
|
28
|
-
title: url,
|
|
29
|
-
url
|
|
30
27
|
};
|
|
31
28
|
case SmartLinkStatus.Resolved:
|
|
32
29
|
return extractFlexibleUiContext(params);
|
|
@@ -38,14 +35,13 @@ export const getContextByStatus = params => {
|
|
|
38
35
|
default:
|
|
39
36
|
return {
|
|
40
37
|
url,
|
|
41
|
-
title: fg('platform-linking-flexible-card-context') ? undefined : url,
|
|
42
38
|
linkIcon: extractErrorIcon(response, status),
|
|
43
|
-
linkTitle:
|
|
39
|
+
linkTitle: extractLinkTitle(status, url, response, onClick),
|
|
44
40
|
preview: extractSmartLinkPreviewImage(response),
|
|
45
41
|
provider: extractSmartLinkProviderIcon(response),
|
|
46
|
-
actions:
|
|
42
|
+
actions: {
|
|
47
43
|
[InternalActionName.UnresolvedAction]: getRetryOptions(url, status, response, params.onAuthorize)
|
|
48
|
-
}
|
|
44
|
+
},
|
|
49
45
|
...(fg('bandicoots-smart-card-teamwork-context') ? {
|
|
50
46
|
meta: {
|
|
51
47
|
accessType: response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$reques = _response$meta.requestAccess) === null || _response$meta$reques === void 0 ? void 0 : _response$meta$reques.accessType
|
|
@@ -9,7 +9,7 @@ import { useSmartCardState } from '../../../state/store';
|
|
|
9
9
|
import { isSpecialEvent } from '../../../utils';
|
|
10
10
|
import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
|
|
11
11
|
import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
12
|
-
import { flexibleUiOptions
|
|
12
|
+
import { flexibleUiOptions } from '../styled';
|
|
13
13
|
import { getMetadata } from '../utils';
|
|
14
14
|
import ContentContainer from './ContentContainer';
|
|
15
15
|
import HoverCardForbiddenView from './views/forbidden';
|
|
@@ -105,7 +105,7 @@ const HoverCardContent = ({
|
|
|
105
105
|
position: SmartLinkPosition.Center,
|
|
106
106
|
subtitle: subtitle
|
|
107
107
|
};
|
|
108
|
-
const uiOptions =
|
|
108
|
+
const uiOptions = flexibleUiOptions;
|
|
109
109
|
if (fg('cc-ai-linking-platform-snippet-renderer')) {
|
|
110
110
|
uiOptions.enableSnippetRenderer = true;
|
|
111
111
|
}
|
|
@@ -9,7 +9,6 @@ import ButtonOld from '@atlaskit/button';
|
|
|
9
9
|
import Button from '@atlaskit/button/new';
|
|
10
10
|
import { extractSmartLinkProvider } from '@atlaskit/link-extractors';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
-
import { SmartLinkStatus } from '../../../../../constants';
|
|
13
12
|
import { extractRequestAccessContextImproved } from '../../../../../extractors/common/context/extractAccessContext';
|
|
14
13
|
import extractHostname from '../../../../../extractors/common/hostname/extractHostname';
|
|
15
14
|
import { messages } from '../../../../../messages';
|
|
@@ -51,39 +50,28 @@ const HoverCardForbiddenView = ({
|
|
|
51
50
|
const ButtonComponent = fg('platform-smart-card-remove-legacy-button') ? Button : ButtonOld;
|
|
52
51
|
return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
|
|
53
52
|
testId: testId
|
|
54
|
-
}), /*#__PURE__*/React.createElement(PreviewBlock,
|
|
53
|
+
}), /*#__PURE__*/React.createElement(PreviewBlock, {
|
|
55
54
|
ignoreContainerPadding: true,
|
|
56
|
-
testId: testId
|
|
57
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
58
|
-
status: SmartLinkStatus.Forbidden
|
|
59
|
-
}, {
|
|
55
|
+
testId: testId,
|
|
60
56
|
className: ax(["_13lipd34 _qrwqpd34 _otyru2gc"])
|
|
61
|
-
})
|
|
62
|
-
testId: `${testId}-title
|
|
63
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
64
|
-
status: SmartLinkStatus.Forbidden
|
|
65
|
-
}, {
|
|
57
|
+
}), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
58
|
+
testId: `${testId}-title`,
|
|
66
59
|
className: ax(["_1bah1h6o _k48p1pd9 _19pku2gc"])
|
|
67
|
-
}
|
|
60
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[titleMessageKey], {
|
|
68
61
|
values: {
|
|
69
62
|
product
|
|
70
63
|
}
|
|
71
|
-
}))), /*#__PURE__*/React.createElement(CustomBlock,
|
|
72
|
-
testId: `${testId}-content
|
|
73
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
74
|
-
status: SmartLinkStatus.Forbidden
|
|
75
|
-
}, {
|
|
64
|
+
}))), /*#__PURE__*/React.createElement(CustomBlock, {
|
|
65
|
+
testId: `${testId}-content`,
|
|
76
66
|
className: ax(["_11c8dcr7 _1e0c1nu9 _1bah1h6o _19pkze3t _y3gn1h6o"])
|
|
77
|
-
}
|
|
67
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
|
|
78
68
|
values: {
|
|
79
69
|
product,
|
|
80
70
|
hostname
|
|
81
71
|
}
|
|
82
|
-
}))), action && /*#__PURE__*/React.createElement(CustomBlock,
|
|
83
|
-
status: SmartLinkStatus.Forbidden
|
|
84
|
-
}, {
|
|
72
|
+
}))), action && /*#__PURE__*/React.createElement(CustomBlock, {
|
|
85
73
|
className: ax(["_1bah1h6o _19pku2gc"])
|
|
86
|
-
}
|
|
74
|
+
}, /*#__PURE__*/React.createElement(ButtonComponent, {
|
|
87
75
|
testId: `${testId}-button`,
|
|
88
76
|
onClick: action === null || action === void 0 ? void 0 : action.promise,
|
|
89
77
|
appearance: "primary",
|
|
@@ -3,9 +3,8 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./index.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
|
-
import { CardDisplay, SmartLinkPosition, SmartLinkSize
|
|
7
|
+
import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
9
8
|
import { succeedUfoExperience } from '../../../../../state/analytics';
|
|
10
9
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
11
10
|
import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
@@ -61,40 +60,28 @@ const HoverCardResolvedView = ({
|
|
|
61
60
|
fallbackElementHeight: snippetHeight.current,
|
|
62
61
|
response: cardState.details
|
|
63
62
|
});
|
|
64
|
-
const snippet = imagePreview ? null : /*#__PURE__*/React.createElement(SnippetBlock,
|
|
65
|
-
status: SmartLinkStatus.Resolved
|
|
66
|
-
}, {
|
|
63
|
+
const snippet = imagePreview ? null : /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
67
64
|
className: ax(["_ca0q1b66"])
|
|
68
|
-
})
|
|
65
|
+
});
|
|
69
66
|
const aiSummaryMinHeight = snippet ? snippetHeight.current : 0;
|
|
70
67
|
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
71
|
-
metadataPosition: SmartLinkPosition.Top
|
|
72
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
73
|
-
status: SmartLinkStatus.Resolved
|
|
74
|
-
}, {
|
|
68
|
+
metadataPosition: SmartLinkPosition.Top,
|
|
75
69
|
className: ax(["_zulpu2gc _quenze3t _oebj1txw _13mh1pd9"])
|
|
76
|
-
})), /*#__PURE__*/React.createElement(MetadataBlock,
|
|
70
|
+
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
77
71
|
primary: primary,
|
|
78
72
|
secondary: secondary,
|
|
79
73
|
maxLines: 1,
|
|
80
74
|
size: SmartLinkSize.Medium
|
|
81
|
-
},
|
|
82
|
-
status: SmartLinkStatus.Resolved
|
|
83
|
-
})), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, _extends({
|
|
75
|
+
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
84
76
|
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
85
77
|
placeholder: snippet
|
|
86
|
-
}
|
|
87
|
-
status: SmartLinkStatus.Resolved
|
|
88
|
-
})) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, _extends({
|
|
78
|
+
}) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
89
79
|
testId: "hidden-snippet",
|
|
90
80
|
onRender: onSnippetRender,
|
|
91
|
-
blockRef: snippetBlockRef
|
|
92
|
-
}, fg('platform-linking-flexible-card-context') ? undefined : {
|
|
93
|
-
status: SmartLinkStatus.Resolved
|
|
94
|
-
}, {
|
|
81
|
+
blockRef: snippetBlockRef,
|
|
95
82
|
isHidden: true,
|
|
96
83
|
className: ax(["_3um015vq _kqswstnw"])
|
|
97
|
-
})
|
|
84
|
+
}), /*#__PURE__*/React.createElement(ActionBlock, {
|
|
98
85
|
onClick: onActionClick,
|
|
99
86
|
spaceInline: "space.100",
|
|
100
87
|
className: ax(["_n3td1b66"])
|
|
@@ -2,17 +2,6 @@ import { layers } from '@atlaskit/theme/constants';
|
|
|
2
2
|
import { SmartLinkSize } from '../../constants';
|
|
3
3
|
// Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
4
4
|
export const HOVER_CARD_Z_INDEX = layers.modal();
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Remove on platform-linking-flexible-card-context cleanup
|
|
8
|
-
*/
|
|
9
|
-
export const flexibleUiOptionsOld = {
|
|
10
|
-
hideBackground: true,
|
|
11
|
-
hideElevation: true,
|
|
12
|
-
hideLegacyButton: true,
|
|
13
|
-
size: SmartLinkSize.Medium,
|
|
14
|
-
zIndex: HOVER_CARD_Z_INDEX + 1
|
|
15
|
-
};
|
|
16
5
|
export const flexibleUiOptions = {
|
|
17
6
|
hideBackground: true,
|
|
18
7
|
hideElevation: true,
|
|
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
10
10
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
11
11
|
const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "39.
|
|
13
|
+
packageVersion: "39.4.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
const Anchor = withLinkClickedEvent('a');
|
|
@@ -3,7 +3,6 @@ import "./index.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { SmartLinkStatus } from '../../../../constants';
|
|
7
6
|
import { Card, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, TitleBlock } from '../../../../index';
|
|
8
7
|
const hoverStyleOld = null;
|
|
9
8
|
const hoverStyle = null;
|
|
@@ -43,8 +42,6 @@ const RelatedLinkItem = ({
|
|
|
43
42
|
subtitle: subtitle,
|
|
44
43
|
anchorTarget: "_blank",
|
|
45
44
|
size: ui.size,
|
|
46
|
-
theme: ui.theme,
|
|
47
|
-
status: SmartLinkStatus.Resolved,
|
|
48
45
|
className: ax(["_zulputpp _11c81o8v _ca0qu2gc _n3tdu2gc"])
|
|
49
46
|
})));
|
|
50
47
|
};
|
|
@@ -3,7 +3,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
|
|
|
3
3
|
var _excluded = ["appearance", "fireEvent", "id", "onClick", "origin", "renderers", "resolve", "actionOptions", "response", "status", "aiSummaryConfig"];
|
|
4
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
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
|
-
import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn,
|
|
6
|
+
import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
import { extractSmartLinkSummary } from '../common/primitives/extractSummary';
|
|
9
9
|
import { extractFlexibleCardActions } from './actions';
|
|
@@ -36,7 +36,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
36
36
|
var data = response.data;
|
|
37
37
|
var meta = response.meta;
|
|
38
38
|
var url = extractSmartLinkUrl(response);
|
|
39
|
-
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(
|
|
39
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
40
40
|
actions: extractFlexibleCardActions({
|
|
41
41
|
actionOptions: actionOptions,
|
|
42
42
|
aiSummaryConfig: aiSummaryConfig,
|
|
@@ -64,10 +64,8 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
64
64
|
createdOn: extractSmartLinkCreatedOn(response),
|
|
65
65
|
dueOn: extractDueOn(data),
|
|
66
66
|
latestCommit: extractLatestCommit(data),
|
|
67
|
-
linkIcon: extractSmartLinkIcon(response)
|
|
68
|
-
|
|
69
|
-
linkTitle: extractLinkTitle(status, props.url, response, onClick)
|
|
70
|
-
}), {}, {
|
|
67
|
+
linkIcon: extractSmartLinkIcon(response),
|
|
68
|
+
linkTitle: extractLinkTitle(status, props.url, response, onClick),
|
|
71
69
|
location: extractLocation(data),
|
|
72
70
|
modifiedBy: extractSmartLinkModifiedBy(response),
|
|
73
71
|
modifiedOn: extractSmartLinkModifiedOn(response),
|
|
@@ -87,8 +85,6 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
87
85
|
targetBranch: extractTargetBranch(data)
|
|
88
86
|
}, fg('platform-linking-user-attributes-component') && {
|
|
89
87
|
userAttributes: extractUserAttributes(data)
|
|
90
|
-
}), fg('platform-linking-flexible-card-context') ? undefined : {
|
|
91
|
-
title: extractSmartLinkTitle(response) || url
|
|
92
88
|
}), fg('platform-linking-team-member-count-component') && {
|
|
93
89
|
teamMemberCount: extractTeamMemberCount(data)
|
|
94
90
|
}), {}, {
|
package/dist/esm/index.js
CHANGED
|
@@ -15,6 +15,6 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
|
|
|
15
15
|
export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
|
|
16
16
|
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock } from './view/FlexibleCard/components/blocks';
|
|
17
17
|
export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, CustomByAccessTypeElement, CustomByStatusElement } from './view/FlexibleCard/external';
|
|
18
|
-
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction } from './view/FlexibleCard/external';
|
|
18
|
+
export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, CustomUnresolvedAction } from './view/FlexibleCard/external';
|
|
19
19
|
/** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
|
|
20
20
|
export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider';
|
|
@@ -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.4.0"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|