@atlaskit/smart-card 34.2.2 → 34.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 +23 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/index.js +201 -263
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +8 -13
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/index.js +5 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.compiled.css +34 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +33 -18
- package/dist/cjs/view/FlexibleCard/components/blocks/block/indexOld.js +56 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.js +115 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.compiled.css +46 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/element-group/index.js +58 -81
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +12 -8
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/indexOld.js +37 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.compiled.css +15 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +18 -52
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.js +104 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.js +135 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.js +108 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +10 -57
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.compiled.css +2 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +38 -37
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.js +58 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +1 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolved/index.js +24 -16
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +48 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +55 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/resolving/index.js +23 -19
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +14 -9
- package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +4 -9
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/cjs/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +63 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +61 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-link-item/index.js +20 -19
- package/dist/cjs/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +51 -0
- package/dist/cjs/view/RelatedLinksModal/components/related-links-list/index.js +24 -24
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +66 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/cjs/view/RelatedLinksModal/views/errored/error-svg/index.js +31 -25
- package/dist/cjs/view/RelatedLinksModal/views/resolved/ResolvedOld.js +45 -0
- package/dist/cjs/view/RelatedLinksModal/views/resolved/index.js +16 -14
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +141 -0
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/cjs/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +56 -50
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/index.js +69 -55
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +1 -3
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/index.js +1 -4
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.compiled.css +34 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +32 -35
- package/dist/es2019/view/FlexibleCard/components/blocks/block/indexOld.js +62 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.js +113 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.compiled.css +46 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/element-group/index.js +60 -95
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +12 -8
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/indexOld.js +28 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.compiled.css +15 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +14 -62
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.js +106 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.js +118 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.js +102 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +11 -57
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.compiled.css +2 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +35 -36
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.js +50 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolved/index.js +15 -11
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +42 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +55 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/title-block/resolving/index.js +20 -18
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +9 -2
- package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +1 -3
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/es2019/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +55 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +55 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-link-item/index.js +19 -18
- package/dist/es2019/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +42 -0
- package/dist/es2019/view/RelatedLinksModal/components/related-links-list/index.js +23 -22
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +58 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/es2019/view/RelatedLinksModal/views/errored/error-svg/index.js +28 -24
- package/dist/es2019/view/RelatedLinksModal/views/resolved/ResolvedOld.js +36 -0
- package/dist/es2019/view/RelatedLinksModal/views/resolved/index.js +16 -13
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +133 -0
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/es2019/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +53 -49
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/index.js +116 -162
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +1 -3
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/index.js +1 -4
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.compiled.css +34 -0
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +31 -20
- package/dist/esm/view/FlexibleCard/components/blocks/block/indexOld.js +50 -0
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.js +108 -0
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.compiled.css +46 -0
- package/dist/esm/view/FlexibleCard/components/blocks/element-group/index.js +54 -79
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +12 -8
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/indexOld.js +30 -0
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.compiled.css +15 -0
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +15 -53
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.js +98 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.js +127 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.js +101 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +11 -56
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.compiled.css +2 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +36 -37
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.js +53 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.compiled.css +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolved/index.js +15 -11
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.js +42 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.compiled.css +55 -0
- package/dist/esm/view/FlexibleCard/components/blocks/title-block/resolving/index.js +20 -18
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +14 -9
- package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +1 -3
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModal.js +15 -14
- package/dist/esm/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.js +53 -0
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.js +54 -0
- package/dist/esm/view/RelatedLinksModal/components/related-link-item/index.js +19 -18
- package/dist/esm/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.js +43 -0
- package/dist/esm/view/RelatedLinksModal/components/related-links-list/index.js +24 -23
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.js +58 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.compiled.css +6 -0
- package/dist/esm/view/RelatedLinksModal/views/errored/error-svg/index.js +28 -24
- package/dist/esm/view/RelatedLinksModal/views/resolved/ResolvedOld.js +37 -0
- package/dist/esm/view/RelatedLinksModal/views/resolved/index.js +16 -13
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.js +133 -0
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.compiled.css +6 -0
- package/dist/esm/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.js +53 -49
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +3 -10
- package/dist/types/view/FlexibleCard/components/blocks/block/indexOld.d.ts +11 -0
- package/dist/types/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.d.ts +17 -0
- package/dist/types/view/FlexibleCard/components/blocks/element-group/index.d.ts +5 -9
- package/dist/types/view/FlexibleCard/components/blocks/element-group/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +3 -13
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/indexOld.d.ts +14 -0
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/resolved/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.d.ts +10 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.d.ts +16 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.d.ts +15 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +5 -7
- package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -13
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.d.ts +9 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +8 -2
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.d.ts +14 -0
- package/dist/types/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +5 -3
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +2 -0
- package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-link-item/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/components/related-links-list/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.d.ts +6 -0
- package/dist/types/view/RelatedLinksModal/views/errored/error-svg/index.d.ts +2 -6
- package/dist/types/view/RelatedLinksModal/views/resolved/ResolvedOld.d.ts +8 -0
- package/dist/types/view/RelatedLinksModal/views/resolved/index.d.ts +3 -7
- package/dist/types/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.d.ts +6 -0
- package/dist/types/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.d.ts +2 -6
- package/dist/types-ts4.5/utils/index.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/block/index.d.ts +3 -10
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/block/indexOld.d.ts +11 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/ElementGroupOld.d.ts +17 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/index.d.ts +5 -9
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/element-group/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/index.d.ts +3 -13
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/indexOld.d.ts +14 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/resolved/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/resolved/indexOld.d.ts +10 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/TitleBlockOld.d.ts +16 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/TitleBlockErroredViewOld.d.ts +15 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +5 -7
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -13
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/TitleBlockResolvedViewOld.d.ts +9 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolved/index.d.ts +8 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolving/TitleBlockResolvingViewOld.d.ts +14 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/resolving/index.d.ts +5 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +2 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModal.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/components/RelatedLinksBaseModalOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/RelatedLinkItemOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-link-item/index.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/RelatedLinksListOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/components/related-links-list/index.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/views/errored/error-svg/ErrorSvgOld.d.ts +6 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/errored/error-svg/index.d.ts +2 -6
- package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/ResolvedOld.d.ts +8 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/resolved/index.d.ts +3 -7
- package/dist/types-ts4.5/view/RelatedLinksModal/views/unavailable/unavailable-svg/UnavailableSvgOld.d.ts +6 -0
- package/dist/types-ts4.5/view/RelatedLinksModal/views/unavailable/unavailable-svg/index.d.ts +2 -6
- package/package.json +4 -4
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
3
|
+
/**
|
|
4
|
+
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
6
|
+
*/
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
9
|
+
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkWidth } from '../../../../../constants';
|
|
10
|
+
import { getMaxLineHeight, getTruncateStyles } from '../../utils';
|
|
11
|
+
import { getBaseStyles, getGapSize, renderChildren } from '../utils';
|
|
12
|
+
var getAlignmentStyles = function getAlignmentStyles(align) {
|
|
13
|
+
switch (align) {
|
|
14
|
+
case SmartLinkAlignment.Right:
|
|
15
|
+
return css({
|
|
16
|
+
WebkitBoxAlign: 'end',
|
|
17
|
+
MsFlexAlign: 'end',
|
|
18
|
+
justifyContent: 'flex-end',
|
|
19
|
+
textAlign: 'right'
|
|
20
|
+
});
|
|
21
|
+
case SmartLinkAlignment.Left:
|
|
22
|
+
default:
|
|
23
|
+
return css({
|
|
24
|
+
WebkitBoxAlign: 'start',
|
|
25
|
+
MsFlexAlign: 'start',
|
|
26
|
+
justifyContent: 'flex-start',
|
|
27
|
+
textAlign: 'left'
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var getGapStyles = function getGapStyles(size, align) {
|
|
32
|
+
var gap = getGapSize(size);
|
|
33
|
+
if (align === SmartLinkAlignment.Right) {
|
|
34
|
+
return css({
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
36
|
+
'> span': {
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
38
|
+
marginLeft: "".concat(gap, "rem")
|
|
39
|
+
},
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
41
|
+
'> span:first-child': {
|
|
42
|
+
marginLeft: 'initial'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return css({
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
48
|
+
'> span': {
|
|
49
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
50
|
+
marginRight: "".concat(gap, "rem"),
|
|
51
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
52
|
+
'&:last-child': {
|
|
53
|
+
marginRight: 'initial'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
var getHorizontalDirectionStyles = function getHorizontalDirectionStyles(size, align) {
|
|
59
|
+
var lineHeight = getMaxLineHeight(size);
|
|
60
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
61
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\tdisplay: block;\n\t\tvertical-align: middle;\n\t\t", "\n\n\t\t> span, > div {\n\t\t\tvertical-align: middle;\n\n\t\t\t&[data-smart-element-date-time],\n\t\t\t&[data-smart-element-text] {\n\t\t\t\t// Show all/wrapped/truncated\n\t\t\t\tdisplay: inline;\n\t\t\t}\n\t\t}\n\n\t\t", "\n\t"])), getTruncateStyles(1, lineHeight + 'rem'), getGapStyles(size, align));
|
|
62
|
+
};
|
|
63
|
+
export var getElementGroupStyles = function getElementGroupStyles(direction, size, align, width, position) {
|
|
64
|
+
return css(
|
|
65
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
66
|
+
getBaseStyles(direction, size),
|
|
67
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
68
|
+
getAlignmentStyles(align), {
|
|
69
|
+
minWidth: '10%'
|
|
70
|
+
},
|
|
71
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
72
|
+
width === SmartLinkWidth.Flexible ? "flex: 1 3;" : '',
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
74
|
+
direction === SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : '',
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
76
|
+
position === SmartLinkPosition.Top ? 'align-self: flex-start;' : '');
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Creates a group of Action components. Accepts an array of Actions, in addition to some styling
|
|
81
|
+
* preferences.
|
|
82
|
+
* @internal
|
|
83
|
+
* @param {ActionGroupProps} ActionGroupProps
|
|
84
|
+
* @see Action
|
|
85
|
+
*/
|
|
86
|
+
var ElementGroup = function ElementGroup(_ref) {
|
|
87
|
+
var _ref$align = _ref.align,
|
|
88
|
+
align = _ref$align === void 0 ? SmartLinkAlignment.Left : _ref$align,
|
|
89
|
+
children = _ref.children,
|
|
90
|
+
overrideCss = _ref.overrideCss,
|
|
91
|
+
_ref$direction = _ref.direction,
|
|
92
|
+
direction = _ref$direction === void 0 ? SmartLinkDirection.Horizontal : _ref$direction,
|
|
93
|
+
_ref$size = _ref.size,
|
|
94
|
+
size = _ref$size === void 0 ? SmartLinkSize.Medium : _ref$size,
|
|
95
|
+
_ref$testId = _ref.testId,
|
|
96
|
+
testId = _ref$testId === void 0 ? 'smart-element-group' : _ref$testId,
|
|
97
|
+
_ref$width = _ref.width,
|
|
98
|
+
width = _ref$width === void 0 ? SmartLinkWidth.FitToContent : _ref$width,
|
|
99
|
+
_ref$position = _ref.position,
|
|
100
|
+
position = _ref$position === void 0 ? SmartLinkPosition.Center : _ref$position;
|
|
101
|
+
return jsx("div", {
|
|
102
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
103
|
+
css: [getElementGroupStyles(direction, size, align, width, position), overrideCss],
|
|
104
|
+
"data-smart-element-group": true,
|
|
105
|
+
"data-testid": testId
|
|
106
|
+
}, renderChildren(children, size));
|
|
107
|
+
};
|
|
108
|
+
export default ElementGroup;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
._zulp147b{gap:var(--ds-space-250,1.25rem)}
|
|
3
|
+
._zulp1e9d{gap:var(--ds-space-200,1rem)}
|
|
4
|
+
._zulpcxkx{gap:var(--ds-space-100,.5rem)}
|
|
5
|
+
._zulppdf9{gap:var(--ds-space-050,.25rem)}._16jlkb7n{flex-grow:1}
|
|
6
|
+
._18m915vq{overflow-y:hidden}
|
|
7
|
+
._1aaynkob >div, ._15tynkob >span{vertical-align:middle}
|
|
8
|
+
._1bah1y6m{justify-content:flex-start}
|
|
9
|
+
._1bahesu3{justify-content:flex-end}
|
|
10
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
11
|
+
._1dthh9n0{-webkit-box-align:end}
|
|
12
|
+
._1dthv2br{-webkit-box-align:start}
|
|
13
|
+
._1e0c1txw{display:flex}
|
|
14
|
+
._1e0c1ule{display:block}
|
|
15
|
+
._1iu61nu9 >div[data-smart-element-date-time], ._166k1nu9 >div[data-smart-element-text], ._1div1nu9 >span[data-smart-element-date-time], ._bmfb1nu9 >span[data-smart-element-text]{display:inline}
|
|
16
|
+
._1nmz1hna{word-break:break-word}
|
|
17
|
+
._1o9z11wp{flex-shrink:3}
|
|
18
|
+
._1ouwidpf>*{min-width:0}
|
|
19
|
+
._1reo15vq{overflow-x:hidden}
|
|
20
|
+
._1ul99by0{min-width:10%}
|
|
21
|
+
._1ul9idpf{min-width:0}
|
|
22
|
+
._1wpz1y6m{align-self:flex-start}
|
|
23
|
+
._1yyjkb7n{-webkit-line-clamp:1}
|
|
24
|
+
._24rc147b >span{margin-left:var(--ds-space-250,1.25rem)}
|
|
25
|
+
._24rc1e9d >span{margin-left:var(--ds-space-200,1rem)}
|
|
26
|
+
._24rccxkx >span{margin-left:var(--ds-space-100,.5rem)}
|
|
27
|
+
._24rcpdf9 >span{margin-left:var(--ds-space-050,.25rem)}
|
|
28
|
+
._2lx21bp4{flex-direction:column}
|
|
29
|
+
._2lx2vrvc{flex-direction:row}
|
|
30
|
+
._3dveidpf >span:first-of-type{margin-left:0}
|
|
31
|
+
._4cvr1h6o{align-items:center}
|
|
32
|
+
._4cvr1y6m{align-items:flex-start}
|
|
33
|
+
._7yhb147b >span{margin-right:var(--ds-space-250,1.25rem)}
|
|
34
|
+
._7yhb1e9d >span{margin-right:var(--ds-space-200,1rem)}
|
|
35
|
+
._7yhbcxkx >span{margin-right:var(--ds-space-100,.5rem)}
|
|
36
|
+
._7yhbpdf9 >span{margin-right:var(--ds-space-050,.25rem)}
|
|
37
|
+
._f6ju1ns9>[data-fit-to-content]{min-width:-moz-fit-content;min-width:fit-content}
|
|
38
|
+
._fiawglyw:empty{display:none}
|
|
39
|
+
._i0dlf1ug{flex-basis:0%}
|
|
40
|
+
._m6ukidpf >span:last-child{margin-right:0}
|
|
41
|
+
._r291h9n0{-ms-flex-align:end}
|
|
42
|
+
._r291v2br{-ms-flex-align:start}
|
|
43
|
+
._s7n4nkob{vertical-align:middle}
|
|
44
|
+
._sudp1e54{-webkit-box-orient:vertical}
|
|
45
|
+
._y3gn1e5h{text-align:left}
|
|
46
|
+
._y3gnusic{text-align:right}
|
|
@@ -1,79 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* @jsx jsx
|
|
6
|
-
*/
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
5
|
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkWidth } from '../../../../../constants';
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
import { renderChildren } from '../utils';
|
|
7
|
+
import ElementGroupOld from './ElementGroupOld';
|
|
8
|
+
var alignmentStyleMap = {
|
|
9
|
+
right: "_1dthh9n0 _r291h9n0 _1bahesu3 _y3gnusic",
|
|
10
|
+
left: "_1dthv2br _r291v2br _1bah1y6m _y3gn1e5h"
|
|
11
|
+
};
|
|
12
|
+
var baseStyleBySize = {
|
|
13
|
+
xlarge: "_zulp147b _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
14
|
+
large: "_zulp1e9d _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
15
|
+
medium: "_zulpcxkx _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf",
|
|
16
|
+
small: "_zulppdf9 _1reo15vq _18m915vq _4cvr1h6o _1e0c1txw _1ul9idpf"
|
|
17
|
+
};
|
|
18
|
+
var baseStyleByDirection = {
|
|
19
|
+
horizontal: "_2lx2vrvc _4cvr1h6o",
|
|
20
|
+
vertical: "_2lx21bp4 _4cvr1y6m"
|
|
21
|
+
};
|
|
22
|
+
var baseStyle = null;
|
|
23
|
+
var widthStyle = {
|
|
24
|
+
flexible: "_16jlkb7n _1o9z11wp _i0dlf1ug",
|
|
25
|
+
'fit-to-content': ""
|
|
26
|
+
};
|
|
27
|
+
var positionStyle = {
|
|
28
|
+
top: "_1wpz1y6m",
|
|
29
|
+
center: ""
|
|
30
30
|
};
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
38
|
-
marginLeft: "".concat(gap, "rem")
|
|
39
|
-
},
|
|
40
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
41
|
-
'> span:first-child': {
|
|
42
|
-
marginLeft: 'initial'
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return css({
|
|
47
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
48
|
-
'> span': {
|
|
49
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
50
|
-
marginRight: "".concat(gap, "rem"),
|
|
51
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
52
|
-
'&:last-child': {
|
|
53
|
-
marginRight: 'initial'
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
31
|
+
var horizontalStyleBase = null;
|
|
32
|
+
var horizontalStyleByHeight = {
|
|
33
|
+
'xlarge': "_1e0ccj1k _102k1m1q",
|
|
34
|
+
'large': "_1e0ccj1k _102k1m1q",
|
|
35
|
+
'medium': "_1e0ccj1k _102k1k8s",
|
|
36
|
+
'small': "_1e0ccj1k _102k1k8s"
|
|
57
37
|
};
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
38
|
+
var gapStylesLeft = {
|
|
39
|
+
'xlarge': "_7yhb147b _m6ukidpf",
|
|
40
|
+
'large': "_7yhb1e9d _m6ukidpf",
|
|
41
|
+
'medium': "_7yhbcxkx _m6ukidpf",
|
|
42
|
+
'small': "_7yhbpdf9 _m6ukidpf"
|
|
62
43
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
getAlignmentStyles(align), {
|
|
69
|
-
minWidth: '10%'
|
|
70
|
-
},
|
|
71
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
72
|
-
width === SmartLinkWidth.Flexible ? "flex: 1 3;" : '',
|
|
73
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
74
|
-
direction === SmartLinkDirection.Horizontal ? getHorizontalDirectionStyles(size, align) : '',
|
|
75
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
76
|
-
position === SmartLinkPosition.Top ? 'align-self: flex-start;' : '');
|
|
44
|
+
var gapStylesRight = {
|
|
45
|
+
'xlarge': "_24rc147b _3dveidpf",
|
|
46
|
+
'large': "_24rc1e9d _3dveidpf",
|
|
47
|
+
'medium': "_24rccxkx _3dveidpf",
|
|
48
|
+
'small': "_24rcpdf9 _3dveidpf"
|
|
77
49
|
};
|
|
78
50
|
|
|
79
51
|
/**
|
|
@@ -83,11 +55,10 @@ export var getElementGroupStyles = function getElementGroupStyles(direction, siz
|
|
|
83
55
|
* @param {ActionGroupProps} ActionGroupProps
|
|
84
56
|
* @see Action
|
|
85
57
|
*/
|
|
86
|
-
var
|
|
58
|
+
var ElementGroupNew = function ElementGroupNew(_ref) {
|
|
87
59
|
var _ref$align = _ref.align,
|
|
88
60
|
align = _ref$align === void 0 ? SmartLinkAlignment.Left : _ref$align,
|
|
89
61
|
children = _ref.children,
|
|
90
|
-
overrideCss = _ref.overrideCss,
|
|
91
62
|
_ref$direction = _ref.direction,
|
|
92
63
|
direction = _ref$direction === void 0 ? SmartLinkDirection.Horizontal : _ref$direction,
|
|
93
64
|
_ref$size = _ref.size,
|
|
@@ -97,12 +68,16 @@ var ElementGroup = function ElementGroup(_ref) {
|
|
|
97
68
|
_ref$width = _ref.width,
|
|
98
69
|
width = _ref$width === void 0 ? SmartLinkWidth.FitToContent : _ref$width,
|
|
99
70
|
_ref$position = _ref.position,
|
|
100
|
-
position = _ref$position === void 0 ? SmartLinkPosition.Center : _ref$position
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
71
|
+
position = _ref$position === void 0 ? SmartLinkPosition.Center : _ref$position,
|
|
72
|
+
className = _ref.className;
|
|
73
|
+
var totalCss = [baseStyleBySize[size], baseStyleByDirection[direction], baseStyle, alignmentStyleMap[align], null, widthStyle[width], direction === SmartLinkDirection.Horizontal ? horizontalStyleBase : {}, direction === SmartLinkDirection.Horizontal ? horizontalStyleByHeight[size] : {}, direction === SmartLinkDirection.Horizontal ? SmartLinkAlignment.Left ? gapStylesLeft[size] : gapStylesRight[size] : {}, positionStyle[position]];
|
|
74
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
104
75
|
"data-smart-element-group": true,
|
|
105
76
|
"data-testid": testId
|
|
77
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
|
|
78
|
+
,
|
|
79
|
+
className: ax([baseStyleBySize[size], baseStyleByDirection[direction], "_fiawglyw _1ouwidpf _f6ju1ns9", alignmentStyleMap[align], "_1ul99by0", widthStyle[width], direction === SmartLinkDirection.Horizontal && "_1reo15vq _18m915vq _1e0c1ule _s7n4nkob _1bto1l2s _1nmz1hna _1yyjkb7n _sudp1e54 _1aaynkob _15tynkob _1iu61nu9 _166k1nu9 _1div1nu9 _bmfb1nu9", direction === SmartLinkDirection.Horizontal && "", SmartLinkAlignment.Left ? gapStylesLeft[size] : gapStylesRight[size], positionStyle[position], className])
|
|
106
80
|
}, renderChildren(children, size));
|
|
107
81
|
};
|
|
108
|
-
export default
|
|
82
|
+
export default ElementGroupOld;
|
|
83
|
+
export { ElementGroupNew };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["status", "testId", "overrideUrl"];
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @jsx jsx
|
|
7
|
-
*/
|
|
8
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
6
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
7
|
+
import PreviewBlockOld from './indexOld';
|
|
11
8
|
import PreviewBlockResolvedView from './resolved';
|
|
12
9
|
/**
|
|
13
10
|
* Represents a PreviewBlock, which typically contains media or other large format content.
|
|
@@ -22,9 +19,16 @@ var PreviewBlock = function PreviewBlock(_ref) {
|
|
|
22
19
|
testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
|
|
23
20
|
overrideUrl = _ref.overrideUrl,
|
|
24
21
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
return
|
|
22
|
+
return /*#__PURE__*/React.createElement(PreviewBlockResolvedView, _extends({}, blockProps, {
|
|
26
23
|
testId: testId,
|
|
27
24
|
overrideUrl: overrideUrl
|
|
28
25
|
}));
|
|
29
26
|
};
|
|
30
|
-
|
|
27
|
+
var Exported = function Exported(props) {
|
|
28
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
29
|
+
return /*#__PURE__*/React.createElement(PreviewBlock, props);
|
|
30
|
+
} else {
|
|
31
|
+
return /*#__PURE__*/React.createElement(PreviewBlockOld, props);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export default Exported;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["status", "testId", "overrideUrl"];
|
|
4
|
+
/**
|
|
5
|
+
* @jsxRuntime classic
|
|
6
|
+
* @jsx jsx
|
|
7
|
+
*/
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
+
import { jsx } from '@emotion/react';
|
|
10
|
+
import { SmartLinkStatus } from '../../../../../constants';
|
|
11
|
+
import PreviewBlockResolvedView from './resolved/indexOld';
|
|
12
|
+
/**
|
|
13
|
+
* Represents a PreviewBlock, which typically contains media or other large format content.
|
|
14
|
+
* @public
|
|
15
|
+
* @param {PreviewBlockProps} PreviewBlock
|
|
16
|
+
* @see Block
|
|
17
|
+
*/
|
|
18
|
+
var PreviewBlock = function PreviewBlock(_ref) {
|
|
19
|
+
var _ref$status = _ref.status,
|
|
20
|
+
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
21
|
+
_ref$testId = _ref.testId,
|
|
22
|
+
testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
|
|
23
|
+
overrideUrl = _ref.overrideUrl,
|
|
24
|
+
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
return jsx(PreviewBlockResolvedView, _extends({}, blockProps, {
|
|
26
|
+
testId: testId,
|
|
27
|
+
overrideUrl: overrideUrl
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
export default PreviewBlock;
|
package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.compiled.css
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
._10aa1osq [data-smart-element-media=image]{width:100%}
|
|
2
|
+
._154iidpf{top:0}
|
|
3
|
+
._18u01ivi{margin-left:calc(var(--container-gap-left)*-1)}
|
|
4
|
+
._1bsb795p{width:calc(var(--preview-block-width))}
|
|
5
|
+
._1ltvidpf{left:0}
|
|
6
|
+
._1t26n7od [data-smart-element-media=image]{aspect-ratio:unset}
|
|
7
|
+
._1xi2idpf{right:0}
|
|
8
|
+
._2hwxc10g{margin-right:calc(var(--container-gap-right)*-1)}
|
|
9
|
+
._94n5idpf{bottom:0}
|
|
10
|
+
._dmhj1ya9:last-of-type{margin-bottom:calc(var(--container-padding)*-1)}
|
|
11
|
+
._e0oi1ya9:first-of-type{margin-top:calc(var(--container-padding)*-1)}
|
|
12
|
+
._kqswstnw{position:absolute}
|
|
13
|
+
._mr051dfr [data-smart-element-media=image]{object-fit:cover}
|
|
14
|
+
._rjuj1osq [data-smart-element-media=image]{height:100%}
|
|
15
|
+
._ze72n7od [data-smart-element-media=image]{padding-top:unset}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* @jsx jsx
|
|
10
|
-
*/
|
|
11
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
|
-
import { css, jsx } from '@emotion/react';
|
|
15
|
-
import { MediaPlacement } from '../../../../../../constants';
|
|
4
|
+
var _excluded = ["ignoreContainerPadding", "onError", "className", "placement", "testId", "overrideUrl"];
|
|
5
|
+
import "./index.compiled.css";
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
8
|
+
import { useCallback } from 'react';
|
|
16
9
|
import { Preview } from '../../../elements';
|
|
17
10
|
import Block from '../../block';
|
|
18
11
|
/**
|
|
@@ -30,26 +23,10 @@ import Block from '../../block';
|
|
|
30
23
|
* @param placement
|
|
31
24
|
* @param ignoreContainerPadding
|
|
32
25
|
*/
|
|
33
|
-
var
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\tposition: absolute;\n\t\t\ttop: ", ";\n\t\t\tbottom: ", ";\n\t\t\twidth: calc(var(--preview-block-width) - ", ");\n\n\t\t\t", "\n\t\t\t", "\n\n [data-smart-element-media='image'] {\n\t\t\t\taspect-ratio: unset;\n\t\t\t\tpadding-top: unset;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tobject-fit: cover;\n\t\t\t}\n\t\t"])), containerPadding, containerPadding, containerPadding, placement === MediaPlacement.Left ? "left: ".concat(containerPadding, ";") : '', placement === MediaPlacement.Right ? "right: ".concat(containerPadding, ";") : '');
|
|
38
|
-
}
|
|
39
|
-
if (ignoreContainerPadding) {
|
|
40
|
-
return css({
|
|
41
|
-
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
42
|
-
marginRight: 'calc(var(--container-gap-right) * -1)',
|
|
43
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
44
|
-
'&:first-of-type': {
|
|
45
|
-
marginTop: 'calc(var(--container-padding) * -1)'
|
|
46
|
-
},
|
|
47
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
48
|
-
'&:last-of-type': {
|
|
49
|
-
marginBottom: 'calc(var(--container-padding) * -1)'
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
26
|
+
var previewBlockStyles = {
|
|
27
|
+
left: "_kqswstnw _154iidpf _94n5idpf _1bsb795p _1ltvidpf _1t26n7od _ze72n7od _10aa1osq _rjuj1osq _mr051dfr",
|
|
28
|
+
right: "_kqswstnw _154iidpf _94n5idpf _1bsb795p _1xi2idpf _1t26n7od _ze72n7od _10aa1osq _rjuj1osq _mr051dfr",
|
|
29
|
+
ignoreContainerPadding: "_18u01ivi _2hwxc10g _e0oi1ya9 _dmhj1ya9"
|
|
53
30
|
};
|
|
54
31
|
|
|
55
32
|
/**
|
|
@@ -62,36 +39,21 @@ var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
|
62
39
|
var _ref$ignoreContainerP = _ref.ignoreContainerPadding,
|
|
63
40
|
ignoreContainerPadding = _ref$ignoreContainerP === void 0 ? false : _ref$ignoreContainerP,
|
|
64
41
|
onError = _ref.onError,
|
|
65
|
-
|
|
42
|
+
className = _ref.className,
|
|
66
43
|
placement = _ref.placement,
|
|
67
44
|
testId = _ref.testId,
|
|
68
45
|
overrideUrl = _ref.overrideUrl,
|
|
69
46
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
70
|
-
var _useState = useState(overrideCss),
|
|
71
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
-
styles = _useState2[0],
|
|
73
|
-
setStyles = _useState2[1];
|
|
74
|
-
var updateStyles = useCallback(function () {
|
|
75
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
76
|
-
setStyles(css(getPreviewBlockStyles(placement, ignoreContainerPadding), overrideCss));
|
|
77
|
-
}, [ignoreContainerPadding, overrideCss, placement]);
|
|
78
|
-
useEffect(function () {
|
|
79
|
-
updateStyles();
|
|
80
|
-
}, [ignoreContainerPadding, overrideCss, placement, updateStyles]);
|
|
81
|
-
var handleOnLoad = useCallback(function () {
|
|
82
|
-
updateStyles();
|
|
83
|
-
}, [updateStyles]);
|
|
84
47
|
var handleOnError = useCallback(function () {
|
|
85
48
|
if (onError) {
|
|
86
49
|
onError();
|
|
87
50
|
}
|
|
88
51
|
}, [onError]);
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}),
|
|
52
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
53
|
+
testId: "".concat(testId, "-resolved-view"),
|
|
54
|
+
className: ax([placement && previewBlockStyles[placement], !placement && ignoreContainerPadding && previewBlockStyles.ignoreContainerPadding])
|
|
55
|
+
}), /*#__PURE__*/React.createElement(Preview, {
|
|
93
56
|
onError: handleOnError,
|
|
94
|
-
onLoad: handleOnLoad,
|
|
95
57
|
overrideUrl: overrideUrl
|
|
96
58
|
}));
|
|
97
59
|
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
|
+
var _excluded = ["ignoreContainerPadding", "onError", "overrideCss", "placement", "testId", "overrideUrl"];
|
|
6
|
+
var _templateObject;
|
|
7
|
+
/**
|
|
8
|
+
* @jsxRuntime classic
|
|
9
|
+
* @jsx jsx
|
|
10
|
+
*/
|
|
11
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
12
|
+
|
|
13
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
|
+
import { css, jsx } from '@emotion/react';
|
|
15
|
+
import { MediaPlacement } from '../../../../../../constants';
|
|
16
|
+
import { Preview } from '../../../elements';
|
|
17
|
+
import Block from '../../block';
|
|
18
|
+
/**
|
|
19
|
+
* Due to its placement on the left/right and ignoreContainerPadding prop
|
|
20
|
+
* rely on its parent container styling, css variables are declared in
|
|
21
|
+
* <Container /> to preset the base values for the preview block styling.
|
|
22
|
+
*
|
|
23
|
+
* `--container-padding` is the padding of the Container. This value is based
|
|
24
|
+
* on size and hidePadding.
|
|
25
|
+
* `--container-gap-left` and `--container-gap-right` are the gap or padding of
|
|
26
|
+
* the Container depending on whether the container has other preview blocks
|
|
27
|
+
* with left/right positioning.
|
|
28
|
+
* `--preview-block-width` is the size of the preview image in relation to
|
|
29
|
+
* the Container width when the placement is left/right.
|
|
30
|
+
* @param placement
|
|
31
|
+
* @param ignoreContainerPadding
|
|
32
|
+
*/
|
|
33
|
+
var getPreviewBlockStyles = function getPreviewBlockStyles(placement, ignoreContainerPadding) {
|
|
34
|
+
if (placement === MediaPlacement.Left || placement === MediaPlacement.Right) {
|
|
35
|
+
var containerPadding = ignoreContainerPadding ? '0rem' : 'var(--container-padding)';
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
37
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\tposition: absolute;\n\t\t\ttop: ", ";\n\t\t\tbottom: ", ";\n\t\t\twidth: calc(var(--preview-block-width) - ", ");\n\n\t\t\t", "\n\t\t\t", "\n\n [data-smart-element-media='image'] {\n\t\t\t\taspect-ratio: unset;\n\t\t\t\tpadding-top: unset;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tobject-fit: cover;\n\t\t\t}\n\t\t"])), containerPadding, containerPadding, containerPadding, placement === MediaPlacement.Left ? "left: ".concat(containerPadding, ";") : '', placement === MediaPlacement.Right ? "right: ".concat(containerPadding, ";") : '');
|
|
38
|
+
}
|
|
39
|
+
if (ignoreContainerPadding) {
|
|
40
|
+
return css({
|
|
41
|
+
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
42
|
+
marginRight: 'calc(var(--container-gap-right) * -1)',
|
|
43
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
44
|
+
'&:first-of-type': {
|
|
45
|
+
marginTop: 'calc(var(--container-padding) * -1)'
|
|
46
|
+
},
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
48
|
+
'&:last-of-type': {
|
|
49
|
+
marginBottom: 'calc(var(--container-padding) * -1)'
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Represents a resolved PreviewBlock, which typically contains media or other large format content.
|
|
57
|
+
* @public
|
|
58
|
+
* @param {PreviewBlock} PreviewBlock
|
|
59
|
+
* @see Block
|
|
60
|
+
*/
|
|
61
|
+
var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
62
|
+
var _ref$ignoreContainerP = _ref.ignoreContainerPadding,
|
|
63
|
+
ignoreContainerPadding = _ref$ignoreContainerP === void 0 ? false : _ref$ignoreContainerP,
|
|
64
|
+
onError = _ref.onError,
|
|
65
|
+
overrideCss = _ref.overrideCss,
|
|
66
|
+
placement = _ref.placement,
|
|
67
|
+
testId = _ref.testId,
|
|
68
|
+
overrideUrl = _ref.overrideUrl,
|
|
69
|
+
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
70
|
+
var _useState = useState(overrideCss),
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
+
styles = _useState2[0],
|
|
73
|
+
setStyles = _useState2[1];
|
|
74
|
+
var updateStyles = useCallback(function () {
|
|
75
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
76
|
+
setStyles(css(getPreviewBlockStyles(placement, ignoreContainerPadding), overrideCss));
|
|
77
|
+
}, [ignoreContainerPadding, overrideCss, placement]);
|
|
78
|
+
useEffect(function () {
|
|
79
|
+
updateStyles();
|
|
80
|
+
}, [ignoreContainerPadding, overrideCss, placement, updateStyles]);
|
|
81
|
+
var handleOnLoad = useCallback(function () {
|
|
82
|
+
updateStyles();
|
|
83
|
+
}, [updateStyles]);
|
|
84
|
+
var handleOnError = useCallback(function () {
|
|
85
|
+
if (onError) {
|
|
86
|
+
onError();
|
|
87
|
+
}
|
|
88
|
+
}, [onError]);
|
|
89
|
+
return jsx(Block, _extends({}, blockProps, {
|
|
90
|
+
overrideCss: styles,
|
|
91
|
+
testId: "".concat(testId, "-resolved-view")
|
|
92
|
+
}), jsx(Preview, {
|
|
93
|
+
onError: handleOnError,
|
|
94
|
+
onLoad: handleOnLoad,
|
|
95
|
+
overrideUrl: overrideUrl
|
|
96
|
+
}));
|
|
97
|
+
};
|
|
98
|
+
export default PreviewBlockResolvedView;
|