@atlaskit/smart-card 34.6.5 → 34.7.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 +16 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/ResolvedView.js +2 -1
- package/dist/cjs/view/EmbedCard/components/ErrorFrame.compiled.css +28 -0
- package/dist/cjs/view/EmbedCard/components/ErrorFrame.js +59 -63
- package/dist/cjs/view/EmbedCard/components/ErrorFrameOld.js +100 -0
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +24 -10
- package/dist/cjs/view/EmbedCard/components/ExpandedFrameOld.js +114 -0
- package/dist/cjs/view/EmbedCard/components/Frame.compiled.css +9 -0
- package/dist/cjs/view/EmbedCard/components/Frame.js +23 -23
- package/dist/cjs/view/EmbedCard/components/FrameOld.js +144 -0
- package/dist/cjs/view/EmbedCard/components/ImageIcon.js +20 -9
- package/dist/cjs/view/EmbedCard/components/styled.compiled.css +92 -0
- package/dist/cjs/view/EmbedCard/components/styled.js +197 -234
- package/dist/cjs/view/EmbedCard/components/styledOld.js +261 -0
- package/dist/cjs/view/EmbedCard/views/ErroredView.compiled.css +13 -0
- package/dist/cjs/view/EmbedCard/views/ErroredView.js +30 -38
- package/dist/cjs/view/EmbedCard/views/ErroredViewOld.js +69 -0
- package/dist/cjs/view/EmbedCard/views/ResolvedView.js +19 -13
- package/dist/cjs/view/EmbedCard/views/ResolvedViewOld.js +82 -0
- package/dist/cjs/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.js +129 -0
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.compiled.css +19 -0
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +36 -55
- package/dist/cjs/view/FlexibleCard/components/container/index.compiled.css +5 -2
- package/dist/cjs/view/FlexibleCard/components/container/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.compiled.css +5 -2
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +1 -2
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.compiled.css +4 -1
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +1 -1
- package/dist/cjs/view/HoverCard/components/views/resolving/index.compiled.css +5 -2
- package/dist/cjs/view/HoverCard/components/views/resolving/index.js +1 -1
- package/dist/cjs/view/InlineCard/ErroredView/index.js +10 -3
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +31 -7
- package/dist/cjs/view/InlineCard/Frame/styled.compiled.css +3 -2
- package/dist/cjs/view/InlineCard/Frame/styled.js +7 -4
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.compiled.css +1 -0
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +162 -32
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/styled.js +24 -17
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/cjs/view/InlineCard/ResolvingView/index.js +10 -5
- package/dist/cjs/view/InlineCard/ResolvingView/styled.js +5 -4
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +16 -4
- package/dist/cjs/view/InlineCard/common/action-button/index.js +61 -0
- package/dist/cjs/view/InlineCard/styled.js +4 -3
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/ResolvedView.js +2 -1
- package/dist/es2019/view/EmbedCard/components/ErrorFrame.compiled.css +28 -0
- package/dist/es2019/view/EmbedCard/components/ErrorFrame.js +48 -61
- package/dist/es2019/view/EmbedCard/components/ErrorFrameOld.js +91 -0
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +48 -32
- package/dist/es2019/view/EmbedCard/components/ExpandedFrameOld.js +96 -0
- package/dist/es2019/view/EmbedCard/components/Frame.compiled.css +9 -0
- package/dist/es2019/view/EmbedCard/components/Frame.js +23 -22
- package/dist/es2019/view/EmbedCard/components/FrameOld.js +114 -0
- package/dist/es2019/view/EmbedCard/components/ImageIcon.js +20 -9
- package/dist/es2019/view/EmbedCard/components/styled.compiled.css +92 -0
- package/dist/es2019/view/EmbedCard/components/styled.js +192 -343
- package/dist/es2019/view/EmbedCard/components/styledOld.js +362 -0
- package/dist/es2019/view/EmbedCard/views/ErroredView.compiled.css +13 -0
- package/dist/es2019/view/EmbedCard/views/ErroredView.js +27 -37
- package/dist/es2019/view/EmbedCard/views/ErroredViewOld.js +58 -0
- package/dist/es2019/view/EmbedCard/views/ResolvedView.js +19 -12
- package/dist/es2019/view/EmbedCard/views/ResolvedViewOld.js +72 -0
- package/dist/es2019/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.js +119 -0
- package/dist/es2019/view/EmbedCard/views/unresolved-view/index.compiled.css +19 -0
- package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +35 -53
- package/dist/es2019/view/FlexibleCard/components/container/index.compiled.css +5 -2
- package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.compiled.css +5 -2
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.compiled.css +4 -1
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/resolving/index.compiled.css +5 -2
- package/dist/es2019/view/HoverCard/components/views/resolving/index.js +1 -1
- package/dist/es2019/view/InlineCard/ErroredView/index.js +12 -5
- package/dist/es2019/view/InlineCard/ForbiddenView/index.js +34 -10
- package/dist/es2019/view/InlineCard/Frame/styled.compiled.css +3 -2
- package/dist/es2019/view/InlineCard/Frame/styled.js +7 -4
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.compiled.css +1 -0
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +162 -32
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/styled.js +23 -16
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +4 -2
- package/dist/es2019/view/InlineCard/ResolvingView/index.js +13 -8
- package/dist/es2019/view/InlineCard/ResolvingView/styled.js +5 -4
- package/dist/es2019/view/InlineCard/UnauthorisedView/index.js +18 -6
- package/dist/es2019/view/InlineCard/common/action-button/index.js +50 -0
- package/dist/es2019/view/InlineCard/styled.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/ResolvedView.js +2 -1
- package/dist/esm/view/EmbedCard/components/ErrorFrame.compiled.css +28 -0
- package/dist/esm/view/EmbedCard/components/ErrorFrame.js +59 -62
- package/dist/esm/view/EmbedCard/components/ErrorFrameOld.js +92 -0
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +13 -2
- package/dist/esm/view/EmbedCard/components/ExpandedFrameOld.js +104 -0
- package/dist/esm/view/EmbedCard/components/Frame.compiled.css +9 -0
- package/dist/esm/view/EmbedCard/components/Frame.js +23 -22
- package/dist/esm/view/EmbedCard/components/FrameOld.js +133 -0
- package/dist/esm/view/EmbedCard/components/ImageIcon.js +20 -9
- package/dist/esm/view/EmbedCard/components/styled.compiled.css +92 -0
- package/dist/esm/view/EmbedCard/components/styled.js +197 -234
- package/dist/esm/view/EmbedCard/components/styledOld.js +252 -0
- package/dist/esm/view/EmbedCard/views/ErroredView.compiled.css +13 -0
- package/dist/esm/view/EmbedCard/views/ErroredView.js +27 -37
- package/dist/esm/view/EmbedCard/views/ErroredViewOld.js +61 -0
- package/dist/esm/view/EmbedCard/views/ResolvedView.js +19 -12
- package/dist/esm/view/EmbedCard/views/ResolvedViewOld.js +74 -0
- package/dist/esm/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.js +118 -0
- package/dist/esm/view/EmbedCard/views/unresolved-view/index.compiled.css +19 -0
- package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +35 -53
- package/dist/esm/view/FlexibleCard/components/container/index.compiled.css +5 -2
- package/dist/esm/view/FlexibleCard/components/container/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.compiled.css +5 -2
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-items-group/index.js +1 -2
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.compiled.css +4 -1
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-trigger/index.js +1 -1
- package/dist/esm/view/HoverCard/components/views/resolving/index.compiled.css +5 -2
- package/dist/esm/view/HoverCard/components/views/resolving/index.js +1 -1
- package/dist/esm/view/InlineCard/ErroredView/index.js +12 -5
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +34 -10
- package/dist/esm/view/InlineCard/Frame/styled.compiled.css +3 -2
- package/dist/esm/view/InlineCard/Frame/styled.js +7 -4
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.compiled.css +1 -0
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +162 -32
- package/dist/esm/view/InlineCard/IconAndTitleLayout/styled.js +23 -16
- package/dist/esm/view/InlineCard/ResolvedView/index.js +4 -2
- package/dist/esm/view/InlineCard/ResolvingView/index.js +13 -8
- package/dist/esm/view/InlineCard/ResolvingView/styled.js +5 -4
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +18 -6
- package/dist/esm/view/InlineCard/common/action-button/index.js +51 -0
- package/dist/esm/view/InlineCard/styled.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/EmbedCard/components/ErrorFrame.d.ts +3 -4
- package/dist/types/view/EmbedCard/components/ErrorFrameOld.d.ts +19 -0
- package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +2 -2
- package/dist/types/view/EmbedCard/components/ExpandedFrameOld.d.ts +40 -0
- package/dist/types/view/EmbedCard/components/FrameOld.d.ts +14 -0
- package/dist/types/view/EmbedCard/components/styled.d.ts +15 -77
- package/dist/types/view/EmbedCard/components/styledOld.d.ts +109 -0
- package/dist/types/view/EmbedCard/views/ErroredView.d.ts +2 -2
- package/dist/types/view/EmbedCard/views/ErroredViewOld.d.ts +12 -0
- package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +0 -4
- package/dist/types/view/EmbedCard/views/ResolvedViewOld.d.ts +36 -0
- package/dist/types/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.d.ts +4 -0
- package/dist/types/view/EmbedCard/views/unresolved-view/index.d.ts +3 -3
- package/dist/types/view/InlineCard/IconAndTitleLayout/index.d.ts +10 -2
- package/dist/types/view/InlineCard/IconAndTitleLayout/styled.d.ts +8 -8
- package/dist/types/view/InlineCard/ResolvingView/styled.d.ts +1 -1
- package/dist/types/view/InlineCard/common/action-button/index.d.ts +19 -0
- package/dist/types/view/InlineCard/styled.d.ts +1 -1
- package/dist/types-ts4.5/view/EmbedCard/components/ErrorFrame.d.ts +3 -4
- package/dist/types-ts4.5/view/EmbedCard/components/ErrorFrameOld.d.ts +19 -0
- package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +2 -2
- package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrameOld.d.ts +40 -0
- package/dist/types-ts4.5/view/EmbedCard/components/FrameOld.d.ts +14 -0
- package/dist/types-ts4.5/view/EmbedCard/components/styled.d.ts +15 -77
- package/dist/types-ts4.5/view/EmbedCard/components/styledOld.d.ts +109 -0
- package/dist/types-ts4.5/view/EmbedCard/views/ErroredView.d.ts +2 -2
- package/dist/types-ts4.5/view/EmbedCard/views/ErroredViewOld.d.ts +12 -0
- package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +0 -4
- package/dist/types-ts4.5/view/EmbedCard/views/ResolvedViewOld.d.ts +36 -0
- package/dist/types-ts4.5/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.d.ts +4 -0
- package/dist/types-ts4.5/view/EmbedCard/views/unresolved-view/index.d.ts +3 -3
- package/dist/types-ts4.5/view/InlineCard/IconAndTitleLayout/index.d.ts +10 -2
- package/dist/types-ts4.5/view/InlineCard/IconAndTitleLayout/styled.d.ts +8 -8
- package/dist/types-ts4.5/view/InlineCard/ResolvingView/styled.d.ts +1 -1
- package/dist/types-ts4.5/view/InlineCard/common/action-button/index.d.ts +19 -0
- package/dist/types-ts4.5/view/InlineCard/styled.d.ts +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import * as colors from '@atlaskit/theme/colors';
|
|
4
|
+
import { N40 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { gs as gridSize } from '../../common/utils';
|
|
6
|
+
export const className = 'media-card-frame';
|
|
7
|
+
export const borderRadius = `
|
|
8
|
+
border-radius: ${"var(--ds-border-radius, 3px)"};
|
|
9
|
+
`;
|
|
10
|
+
const wrapperBorderRadius = `
|
|
11
|
+
border-radius: ${"var(--ds-border-radius-200, 8px)"};
|
|
12
|
+
`;
|
|
13
|
+
const contentBorderRadius = `
|
|
14
|
+
border-radius: ${"var(--ds-border-radius-100, 4px)"};
|
|
15
|
+
`;
|
|
16
|
+
export const ellipsis = (maxWidth = '100%') => {
|
|
17
|
+
const unit = typeof maxWidth === 'number' ? 'px' : '';
|
|
18
|
+
return `
|
|
19
|
+
max-width: ${maxWidth}${unit};
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
export const csssize = (value = '100%') => {
|
|
26
|
+
const unit = typeof value === 'number' ? 'px' : '';
|
|
27
|
+
return `
|
|
28
|
+
width: ${value}${unit};
|
|
29
|
+
height: ${value}${unit};
|
|
30
|
+
`;
|
|
31
|
+
};
|
|
32
|
+
function minWidth({
|
|
33
|
+
minWidth
|
|
34
|
+
}) {
|
|
35
|
+
if (minWidth) {
|
|
36
|
+
return `min-width: ${minWidth}px;`;
|
|
37
|
+
} else {
|
|
38
|
+
return '';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function maxWidth({
|
|
42
|
+
maxWidth
|
|
43
|
+
}) {
|
|
44
|
+
if (maxWidth) {
|
|
45
|
+
return `max-width: ${maxWidth}px; margin: 0 auto;`;
|
|
46
|
+
} else {
|
|
47
|
+
return 'margin: 0 auto;';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function getInteractiveStyles({
|
|
51
|
+
isInteractive,
|
|
52
|
+
frameStyle
|
|
53
|
+
}) {
|
|
54
|
+
return isInteractive ? `
|
|
55
|
+
&:hover {
|
|
56
|
+
${frameStyle !== 'hide' && visibleStyles}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
&:active {
|
|
60
|
+
background-color: ${`var(--ds-background-selected, ${colors.B50})`};
|
|
61
|
+
}
|
|
62
|
+
` : '';
|
|
63
|
+
}
|
|
64
|
+
function selected({
|
|
65
|
+
isSelected,
|
|
66
|
+
frameStyle
|
|
67
|
+
}) {
|
|
68
|
+
return isSelected && frameStyle !== 'hide' ? `
|
|
69
|
+
${visibleStyles}
|
|
70
|
+
&::after {
|
|
71
|
+
cursor: pointer;
|
|
72
|
+
box-shadow: 0 0 0 3px ${`var(--ds-border-selected, ${colors.B100})`};
|
|
73
|
+
content: '';
|
|
74
|
+
border: none;
|
|
75
|
+
position: absolute;
|
|
76
|
+
height: 100%;
|
|
77
|
+
width: 100%;
|
|
78
|
+
left: 0;
|
|
79
|
+
${wrapperBorderRadius}
|
|
80
|
+
}
|
|
81
|
+
` : isSelected && frameStyle === 'hide' ? contentBorderRadius : '';
|
|
82
|
+
}
|
|
83
|
+
const height = ({
|
|
84
|
+
inheritDimensions
|
|
85
|
+
}) => inheritDimensions ? 'height: 100%;' : `height: ${gridSize(54)}`;
|
|
86
|
+
const wrapperStyles = props => `
|
|
87
|
+
${wrapperBorderRadius}
|
|
88
|
+
${minWidth(props)}
|
|
89
|
+
${maxWidth(props)}
|
|
90
|
+
${getInteractiveStyles(props)}
|
|
91
|
+
${visible(props)}
|
|
92
|
+
display: inline-flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
font-family: ${"var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"};
|
|
96
|
+
width: 100%;
|
|
97
|
+
user-select: none;
|
|
98
|
+
line-height: initial;
|
|
99
|
+
transition: background 0.3s;
|
|
100
|
+
position: relative;
|
|
101
|
+
${height(props)};
|
|
102
|
+
${selected(props)}
|
|
103
|
+
|
|
104
|
+
&:after {
|
|
105
|
+
content: '';
|
|
106
|
+
transition: background 0.3s, box-shadow 0.3s;
|
|
107
|
+
position: absolute;
|
|
108
|
+
height: calc(100% + ${"var(--ds-space-100, 8px)"});
|
|
109
|
+
${wrapperBorderRadius}
|
|
110
|
+
|
|
111
|
+
${wrapperSizing(props)}
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
|
|
115
|
+
// if frameStyle !== 'show' then set the width of the frame to be
|
|
116
|
+
// 100% of the content +16px and position it left -8px to make it appear
|
|
117
|
+
// outside the container
|
|
118
|
+
const wrapperSizing = ({
|
|
119
|
+
frameStyle
|
|
120
|
+
}) => frameStyle === 'show' ? `
|
|
121
|
+
box-sizing: border-box;
|
|
122
|
+
width: 100%;` : `
|
|
123
|
+
width: calc(100% + ${"var(--ds-space-200, 16px)"});
|
|
124
|
+
left: ${"var(--ds-space-negative-100, -8px)"};`;
|
|
125
|
+
const visibleStyles = `
|
|
126
|
+
&:after {
|
|
127
|
+
border: 1px solid ${`var(--ds-border, ${N40})`};
|
|
128
|
+
background-color: ${"var(--ds-surface-raised, white)"};
|
|
129
|
+
}
|
|
130
|
+
.embed-header {
|
|
131
|
+
opacity: 1;
|
|
132
|
+
}`;
|
|
133
|
+
function visible({
|
|
134
|
+
frameStyle
|
|
135
|
+
}) {
|
|
136
|
+
return frameStyle === 'show' ? visibleStyles : '';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
140
|
+
export const LinkWrapper = styled.div`
|
|
141
|
+
${props => wrapperStyles(props)} &:hover {
|
|
142
|
+
text-decoration: none;
|
|
143
|
+
}
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
147
|
+
export const Wrapper = styled.div(props => wrapperStyles(props), {
|
|
148
|
+
// We are keeping this margin as a hardcoded variable as it is not a standard token size and needs
|
|
149
|
+
// to be thoroughly checked with a designer so that we do not miss an unintended visual change
|
|
150
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
151
|
+
marginTop: '10px'
|
|
152
|
+
});
|
|
153
|
+
export const embedHeaderHeight = 32;
|
|
154
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
155
|
+
export const Header = styled.div({
|
|
156
|
+
height: `${embedHeaderHeight}px`,
|
|
157
|
+
position: 'absolute',
|
|
158
|
+
zIndex: 1,
|
|
159
|
+
width: '100%',
|
|
160
|
+
display: 'flex',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
163
|
+
color: `var(--ds-icon, ${colors.N300})`,
|
|
164
|
+
opacity: 0,
|
|
165
|
+
transition: '300ms opacity cubic-bezier(0.15, 1, 0.3, 1)'
|
|
166
|
+
},
|
|
167
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
168
|
+
({
|
|
169
|
+
frameStyle
|
|
170
|
+
}) => frameStyle === 'show' ? `
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
padding: 0 ${"var(--ds-space-100, 8px)"};
|
|
173
|
+
` : '');
|
|
174
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
175
|
+
export const IconWrapper = styled.div(
|
|
176
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
177
|
+
borderRadius,
|
|
178
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
179
|
+
csssize(16),
|
|
180
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
181
|
+
({
|
|
182
|
+
isPlaceholder
|
|
183
|
+
}) => {
|
|
184
|
+
if (isPlaceholder) {
|
|
185
|
+
return `
|
|
186
|
+
${/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 */''}
|
|
187
|
+
background-color: ${`var(--ds-skeleton, ${colors.N30})`};
|
|
188
|
+
`;
|
|
189
|
+
} else {
|
|
190
|
+
return '';
|
|
191
|
+
}
|
|
192
|
+
}, {
|
|
193
|
+
marginRight: "var(--ds-space-050, 4px)"
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
197
|
+
export const TextWrapper = styled.div(
|
|
198
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
199
|
+
({
|
|
200
|
+
isPlaceholder
|
|
201
|
+
}) => {
|
|
202
|
+
if (isPlaceholder) {
|
|
203
|
+
return `
|
|
204
|
+
${borderRadius}
|
|
205
|
+
width: 125px;
|
|
206
|
+
height: 12px;
|
|
207
|
+
${/* eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766 */''}
|
|
208
|
+
background-color: ${`var(--ds-skeleton, ${colors.N30})`};
|
|
209
|
+
`;
|
|
210
|
+
} else {
|
|
211
|
+
return '';
|
|
212
|
+
}
|
|
213
|
+
}, {
|
|
214
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
215
|
+
color: `var(--ds-text-subtlest, ${colors.N300})`,
|
|
216
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
217
|
+
},
|
|
218
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
219
|
+
ellipsis('none'));
|
|
220
|
+
|
|
221
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
222
|
+
export const TooltipWrapper = styled.div({
|
|
223
|
+
overflow: 'hidden'
|
|
224
|
+
});
|
|
225
|
+
// NB: `overflow` is kept as `hidden` since
|
|
226
|
+
// the internal contents of the `iframe` should
|
|
227
|
+
// manage scrolling behaviour.
|
|
228
|
+
// eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
229
|
+
export const Content = styled.div`
|
|
230
|
+
${contentBorderRadius};
|
|
231
|
+
border: 1px solid ${`var(--ds-border, ${N40})`};
|
|
232
|
+
background-color: ${"var(--ds-surface-raised, white)"};
|
|
233
|
+
position: absolute;
|
|
234
|
+
z-index: 1;
|
|
235
|
+
width: 100%;
|
|
236
|
+
transition: box-shadow 0.3s;
|
|
237
|
+
|
|
238
|
+
> .calc-height > div > div {
|
|
239
|
+
left: unset !important;
|
|
240
|
+
width: unset !important;
|
|
241
|
+
height: unset !important;
|
|
242
|
+
position: initial !important;
|
|
243
|
+
padding-bottom: unset !important;
|
|
244
|
+
}
|
|
245
|
+
> .embed-preview > div {
|
|
246
|
+
margin: 0 auto;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
${({
|
|
250
|
+
allowScrollBar,
|
|
251
|
+
removeOverflow
|
|
252
|
+
}) => {
|
|
253
|
+
if (removeOverflow) {
|
|
254
|
+
return '';
|
|
255
|
+
}
|
|
256
|
+
return allowScrollBar ? 'overflow: auto;' : 'overflow: hidden;';
|
|
257
|
+
}}
|
|
258
|
+
|
|
259
|
+
${({
|
|
260
|
+
frameStyle
|
|
261
|
+
}) => frameStyle === 'show' ? `
|
|
262
|
+
width: calc(100% - ${"var(--ds-space-200, 16px)"} - 2px);
|
|
263
|
+
margin: 0 ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"};
|
|
264
|
+
` : ''}
|
|
265
|
+
|
|
266
|
+
${({
|
|
267
|
+
frameStyle
|
|
268
|
+
}) => frameStyle === 'hide' ? 'height: 100%;' : `
|
|
269
|
+
height: calc(100% - ${"var(--ds-space-400, 32px)"});
|
|
270
|
+
top: ${"var(--ds-space-400, 32px)"};
|
|
271
|
+
`}
|
|
272
|
+
`;
|
|
273
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-dynamic-styles, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
274
|
+
export const Image = styled.img(({
|
|
275
|
+
size
|
|
276
|
+
}) => csssize(size), borderRadius, {
|
|
277
|
+
overflow: 'hidden'
|
|
278
|
+
});
|
|
279
|
+
export const maxAvatarCount = 6;
|
|
280
|
+
|
|
281
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
282
|
+
export const ContentWrapper = styled.div({
|
|
283
|
+
display: 'flex',
|
|
284
|
+
flexDirection: 'row',
|
|
285
|
+
boxSizing: 'border-box',
|
|
286
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-150, 12px)"} ${"var(--ds-space-150, 12px)"} ${"var(--ds-space-150, 12px)"}`
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
290
|
+
export const Title = styled.div({
|
|
291
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
292
|
+
color: `var(--ds-text, ${colors.N900})`,
|
|
293
|
+
font: "var(--ds-font-heading-small, normal 600 16px/20px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
294
|
+
maxHeight: `${20 * 4}px`,
|
|
295
|
+
overflow: 'hidden'
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
299
|
+
export const Byline = styled.div({
|
|
300
|
+
marginTop: "var(--ds-space-050, 4px)",
|
|
301
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
302
|
+
color: `var(--ds-text-subtlest, ${colors.N300})`,
|
|
303
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)"
|
|
304
|
+
},
|
|
305
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
306
|
+
ellipsis('100%'));
|
|
307
|
+
|
|
308
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
309
|
+
export const Description = styled.div({
|
|
310
|
+
marginTop: `calc(${"var(--ds-space-100, 8px)"} - 1px)`,
|
|
311
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
312
|
+
color: `var(--ds-text, ${colors.N800})`,
|
|
313
|
+
font: "var(--ds-font-body-UNSAFE_small, normal 400 12px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
314
|
+
maxHeight: `${18 * 3}px`,
|
|
315
|
+
overflow: 'hidden'
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
319
|
+
export const ResolvedViewIconWrapper = styled.div({
|
|
320
|
+
marginTop: "var(--ds-space-050, 4px)"
|
|
321
|
+
});
|
|
322
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
|
|
323
|
+
export const Thumbnail = styled.div(borderRadius, csssize(48), props => ({
|
|
324
|
+
float: 'right',
|
|
325
|
+
margin: `${"var(--ds-space-050, 4px)"} 0 ${"var(--ds-space-150, 12px)"} ${"var(--ds-space-150, 12px)"}`,
|
|
326
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
327
|
+
backgroundColor: `var(--ds-skeleton, ${colors.N30})`,
|
|
328
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
329
|
+
backgroundImage: `url(${props.src})`,
|
|
330
|
+
backgroundSize: 'cover'
|
|
331
|
+
}));
|
|
332
|
+
|
|
333
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
334
|
+
export const UsersWrapper = styled.div({
|
|
335
|
+
marginTop: "var(--ds-space-100, 8px)"
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
339
|
+
export const ActionsWrapper = styled.div({
|
|
340
|
+
marginTop: "var(--ds-space-100, 8px)",
|
|
341
|
+
textAlign: 'right',
|
|
342
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
343
|
+
'> *': {
|
|
344
|
+
marginTop: "var(--ds-space-050, 4px)"
|
|
345
|
+
},
|
|
346
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
347
|
+
'> * + *': {
|
|
348
|
+
marginLeft: "var(--ds-space-050, 4px)"
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
353
|
+
export const AlertWrapper = styled.div({
|
|
354
|
+
position: 'absolute',
|
|
355
|
+
top: 0,
|
|
356
|
+
right: 0,
|
|
357
|
+
bottom: 0,
|
|
358
|
+
left: 0,
|
|
359
|
+
overflow: 'hidden',
|
|
360
|
+
pointerEvents: 'none',
|
|
361
|
+
zIndex: maxAvatarCount + 1
|
|
362
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
._11c81il0{font:var(--ds-font-heading-xsmall,normal 600 14px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._18m915vq{overflow-y:hidden}
|
|
3
|
+
._18u01b66{margin-left:var(--ds-space-050,4px)}
|
|
4
|
+
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
5
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
6
|
+
._1e0ccj1k{display:-webkit-box}
|
|
7
|
+
._1reo15vq{overflow-x:hidden}
|
|
8
|
+
._1yyjkb7n{-webkit-line-clamp:1}
|
|
9
|
+
._2hwx1b66{margin-right:var(--ds-space-050,4px)}
|
|
10
|
+
._c71l183y{max-height:21px}
|
|
11
|
+
._k48pi7a9{font-weight:var(--ds-font-weight-regular,400)}
|
|
12
|
+
._sudp1e54{-webkit-box-orient:vertical}
|
|
13
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
@@ -1,58 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* ErroredView.tsx generated by @compiled/babel-plugin v0.36.0 */
|
|
2
|
+
import "./ErroredView.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
6
|
import Button from '@atlaskit/button';
|
|
9
7
|
import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
10
|
-
import {
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
11
10
|
import { R300 } from '@atlaskit/theme/colors';
|
|
12
11
|
import { messages } from '../../../messages';
|
|
13
|
-
import { gs } from '../../common/utils';
|
|
14
12
|
import { Frame } from '../components/ErrorFrame';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
marginRight: gs(0.5),
|
|
22
|
-
display: '-webkit-box',
|
|
23
|
-
overflow: 'hidden',
|
|
24
|
-
textOverflow: 'ellipsis',
|
|
25
|
-
WebkitLineClamp: 1,
|
|
26
|
-
WebkitBoxOrient: 'vertical',
|
|
27
|
-
// Fallback options.
|
|
28
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
29
|
-
maxHeight: gs(3)
|
|
30
|
-
});
|
|
31
|
-
const boxStyles = xcss({
|
|
32
|
-
paddingLeft: 'space.050',
|
|
33
|
-
paddingRight: 'space.050'
|
|
34
|
-
});
|
|
35
|
-
export const EmbedCardErroredView = ({
|
|
13
|
+
import { EmbedCardErroredViewOld } from './ErroredViewOld';
|
|
14
|
+
const styles = {
|
|
15
|
+
messageStyles: "_11c81il0 _1reo15vq _18m915vq _k48pi7a9 _18u01b66 _2hwx1b66 _1e0ccj1k _1yyjkb7n _sudp1e54 _1bto1l2s _c71l183y",
|
|
16
|
+
boxStyles: "_19bv1b66 _u5f31b66"
|
|
17
|
+
};
|
|
18
|
+
const EmbedCardErroredViewNew = ({
|
|
36
19
|
onRetry,
|
|
37
20
|
isSelected = false,
|
|
38
21
|
testId = 'embed-card-errored-view',
|
|
39
22
|
inheritDimensions
|
|
40
|
-
}) =>
|
|
23
|
+
}) => /*#__PURE__*/React.createElement(Frame, {
|
|
41
24
|
inheritDimensions: inheritDimensions,
|
|
42
25
|
compact: true,
|
|
43
26
|
isSelected: isSelected,
|
|
44
27
|
testId: testId
|
|
45
|
-
},
|
|
28
|
+
}, /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
46
29
|
LEGACY_size: "small",
|
|
47
30
|
color: `var(--ds-icon-danger, ${R300})`,
|
|
48
31
|
label: "error-icon"
|
|
49
|
-
}),
|
|
50
|
-
xcss: boxStyles
|
|
51
|
-
},
|
|
52
|
-
xcss: messageStyles
|
|
53
|
-
},
|
|
32
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
33
|
+
xcss: styles.boxStyles
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Inline, {
|
|
35
|
+
xcss: styles.messageStyles
|
|
36
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.could_not_load_link))), /*#__PURE__*/React.createElement(Button, {
|
|
54
37
|
testId: "err-view-retry",
|
|
55
38
|
appearance: "link",
|
|
56
39
|
spacing: "none",
|
|
57
40
|
onClick: onRetry
|
|
58
|
-
},
|
|
41
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.try_again)));
|
|
42
|
+
export const EmbedCardErroredView = props => {
|
|
43
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
44
|
+
return /*#__PURE__*/React.createElement(EmbedCardErroredViewNew, props);
|
|
45
|
+
} else {
|
|
46
|
+
return /*#__PURE__*/React.createElement(EmbedCardErroredViewOld, props);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
+
import Button from '@atlaskit/button';
|
|
9
|
+
import ErrorIcon from '@atlaskit/icon/core/migration/error';
|
|
10
|
+
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
11
|
+
import { R300 } from '@atlaskit/theme/colors';
|
|
12
|
+
import { messages } from '../../../messages';
|
|
13
|
+
import { gs } from '../../common/utils';
|
|
14
|
+
import { Frame } from '../components/ErrorFrame';
|
|
15
|
+
const messageStyles = css({
|
|
16
|
+
font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
|
|
17
|
+
fontWeight: "var(--ds-font-weight-regular, 400)",
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
19
|
+
marginLeft: gs(0.5),
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
21
|
+
marginRight: gs(0.5),
|
|
22
|
+
display: '-webkit-box',
|
|
23
|
+
overflow: 'hidden',
|
|
24
|
+
textOverflow: 'ellipsis',
|
|
25
|
+
WebkitLineClamp: 1,
|
|
26
|
+
WebkitBoxOrient: 'vertical',
|
|
27
|
+
// Fallback options.
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
29
|
+
maxHeight: gs(3)
|
|
30
|
+
});
|
|
31
|
+
const boxStyles = xcss({
|
|
32
|
+
paddingLeft: 'space.050',
|
|
33
|
+
paddingRight: 'space.050'
|
|
34
|
+
});
|
|
35
|
+
export const EmbedCardErroredViewOld = ({
|
|
36
|
+
onRetry,
|
|
37
|
+
isSelected = false,
|
|
38
|
+
testId = 'embed-card-errored-view',
|
|
39
|
+
inheritDimensions
|
|
40
|
+
}) => jsx(Frame, {
|
|
41
|
+
inheritDimensions: inheritDimensions,
|
|
42
|
+
compact: true,
|
|
43
|
+
isSelected: isSelected,
|
|
44
|
+
testId: testId
|
|
45
|
+
}, jsx(ErrorIcon, {
|
|
46
|
+
LEGACY_size: "small",
|
|
47
|
+
color: `var(--ds-icon-danger, ${R300})`,
|
|
48
|
+
label: "error-icon"
|
|
49
|
+
}), jsx(Box, {
|
|
50
|
+
xcss: boxStyles
|
|
51
|
+
}, jsx(Inline, {
|
|
52
|
+
xcss: messageStyles
|
|
53
|
+
}, jsx(FormattedMessage, messages.could_not_load_link))), jsx(Button, {
|
|
54
|
+
testId: "err-view-retry",
|
|
55
|
+
appearance: "link",
|
|
56
|
+
spacing: "none",
|
|
57
|
+
onClick: onRetry
|
|
58
|
+
}, jsx(FormattedMessage, messages.try_again)));
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
5
2
|
import React from 'react';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
9
3
|
import LinkGlyph from '@atlaskit/icon/core/migration/link';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
5
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
11
6
|
import { getPreviewUrlWithTheme } from '../../../utils';
|
|
12
7
|
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
13
8
|
import { Frame } from '../components/Frame';
|
|
14
9
|
import { ImageIcon } from '../components/ImageIcon';
|
|
15
|
-
|
|
10
|
+
import { EmbedCardResolvedViewOld } from './ResolvedViewOld';
|
|
11
|
+
const EmbedCardResolvedViewNew = /*#__PURE__*/React.forwardRef(({
|
|
16
12
|
link,
|
|
17
13
|
context,
|
|
18
14
|
onClick,
|
|
@@ -30,7 +26,7 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
30
26
|
const iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
31
27
|
const src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
32
28
|
const text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
33
|
-
const linkGlyph = React.useMemo(() =>
|
|
29
|
+
const linkGlyph = React.useMemo(() => /*#__PURE__*/React.createElement(LinkGlyph, {
|
|
34
30
|
label: "icon",
|
|
35
31
|
LEGACY_size: "small",
|
|
36
32
|
testId: "embed-card-fallback-icon",
|
|
@@ -40,7 +36,7 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
40
36
|
if ( /*#__PURE__*/React.isValidElement(iconFromContext)) {
|
|
41
37
|
return iconFromContext;
|
|
42
38
|
}
|
|
43
|
-
return
|
|
39
|
+
return /*#__PURE__*/React.createElement(ImageIcon, {
|
|
44
40
|
src: src,
|
|
45
41
|
default: linkGlyph
|
|
46
42
|
});
|
|
@@ -50,7 +46,7 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
50
46
|
if (previewUrl && isSupportTheming) {
|
|
51
47
|
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
52
48
|
}
|
|
53
|
-
return
|
|
49
|
+
return /*#__PURE__*/React.createElement(ExpandedFrame, {
|
|
54
50
|
isSelected: isSelected,
|
|
55
51
|
frameStyle: frameStyle,
|
|
56
52
|
href: link,
|
|
@@ -60,7 +56,7 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
60
56
|
onClick: onClick,
|
|
61
57
|
inheritDimensions: inheritDimensions,
|
|
62
58
|
setOverflow: false
|
|
63
|
-
},
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Frame, {
|
|
64
60
|
url: previewUrl,
|
|
65
61
|
isTrusted: isTrusted,
|
|
66
62
|
testId: testId,
|
|
@@ -69,4 +65,15 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
|
|
|
69
65
|
onIframeFocus: onIframeFocus,
|
|
70
66
|
title: text
|
|
71
67
|
}));
|
|
68
|
+
});
|
|
69
|
+
export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
70
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
71
|
+
return /*#__PURE__*/React.createElement(EmbedCardResolvedViewNew, _extends({}, props, {
|
|
72
|
+
ref: ref
|
|
73
|
+
}));
|
|
74
|
+
} else {
|
|
75
|
+
return /*#__PURE__*/React.createElement(EmbedCardResolvedViewOld, _extends({}, props, {
|
|
76
|
+
ref: ref
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
72
79
|
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
+
import { jsx } from '@emotion/react';
|
|
9
|
+
import LinkGlyph from '@atlaskit/icon/core/migration/link';
|
|
10
|
+
import { useThemeObserver } from '@atlaskit/tokens';
|
|
11
|
+
import { getPreviewUrlWithTheme } from '../../../utils';
|
|
12
|
+
import { ExpandedFrame } from '../components/ExpandedFrame';
|
|
13
|
+
import { Frame } from '../components/Frame';
|
|
14
|
+
import { ImageIcon } from '../components/ImageIcon';
|
|
15
|
+
export const EmbedCardResolvedViewOld = /*#__PURE__*/React.forwardRef(({
|
|
16
|
+
link,
|
|
17
|
+
context,
|
|
18
|
+
onClick,
|
|
19
|
+
isSelected,
|
|
20
|
+
frameStyle,
|
|
21
|
+
preview,
|
|
22
|
+
title,
|
|
23
|
+
isTrusted,
|
|
24
|
+
testId = 'embed-card-resolved-view',
|
|
25
|
+
inheritDimensions,
|
|
26
|
+
onIframeDwell,
|
|
27
|
+
onIframeFocus,
|
|
28
|
+
isSupportTheming
|
|
29
|
+
}, embedIframeRef) => {
|
|
30
|
+
const iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
|
|
31
|
+
const src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
|
|
32
|
+
const text = title || (context === null || context === void 0 ? void 0 : context.text);
|
|
33
|
+
const linkGlyph = React.useMemo(() => jsx(LinkGlyph, {
|
|
34
|
+
label: "icon",
|
|
35
|
+
LEGACY_size: "small",
|
|
36
|
+
testId: "embed-card-fallback-icon",
|
|
37
|
+
color: "currentColor"
|
|
38
|
+
}), []);
|
|
39
|
+
let icon = React.useMemo(() => {
|
|
40
|
+
if ( /*#__PURE__*/React.isValidElement(iconFromContext)) {
|
|
41
|
+
return iconFromContext;
|
|
42
|
+
}
|
|
43
|
+
return jsx(ImageIcon, {
|
|
44
|
+
src: src,
|
|
45
|
+
default: linkGlyph
|
|
46
|
+
});
|
|
47
|
+
}, [src, linkGlyph, iconFromContext]);
|
|
48
|
+
const themeState = useThemeObserver();
|
|
49
|
+
let previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
|
|
50
|
+
if (previewUrl && isSupportTheming) {
|
|
51
|
+
previewUrl = getPreviewUrlWithTheme(previewUrl, themeState);
|
|
52
|
+
}
|
|
53
|
+
return jsx(ExpandedFrame, {
|
|
54
|
+
isSelected: isSelected,
|
|
55
|
+
frameStyle: frameStyle,
|
|
56
|
+
href: link,
|
|
57
|
+
testId: testId,
|
|
58
|
+
icon: icon,
|
|
59
|
+
text: text,
|
|
60
|
+
onClick: onClick,
|
|
61
|
+
inheritDimensions: inheritDimensions,
|
|
62
|
+
setOverflow: false
|
|
63
|
+
}, jsx(Frame, {
|
|
64
|
+
url: previewUrl,
|
|
65
|
+
isTrusted: isTrusted,
|
|
66
|
+
testId: testId,
|
|
67
|
+
ref: embedIframeRef,
|
|
68
|
+
onIframeDwell: onIframeDwell,
|
|
69
|
+
onIframeFocus: onIframeFocus,
|
|
70
|
+
title: text
|
|
71
|
+
}));
|
|
72
|
+
});
|