@atlaskit/smart-card 34.6.6 → 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.
Files changed (97) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/BlockCard/views/ResolvedView.js +2 -1
  4. package/dist/cjs/view/EmbedCard/components/ErrorFrame.compiled.css +28 -0
  5. package/dist/cjs/view/EmbedCard/components/ErrorFrame.js +59 -63
  6. package/dist/cjs/view/EmbedCard/components/ErrorFrameOld.js +100 -0
  7. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +24 -10
  8. package/dist/cjs/view/EmbedCard/components/ExpandedFrameOld.js +114 -0
  9. package/dist/cjs/view/EmbedCard/components/Frame.compiled.css +9 -0
  10. package/dist/cjs/view/EmbedCard/components/Frame.js +23 -23
  11. package/dist/cjs/view/EmbedCard/components/FrameOld.js +144 -0
  12. package/dist/cjs/view/EmbedCard/components/ImageIcon.js +20 -9
  13. package/dist/cjs/view/EmbedCard/components/styled.compiled.css +92 -0
  14. package/dist/cjs/view/EmbedCard/components/styled.js +197 -234
  15. package/dist/cjs/view/EmbedCard/components/styledOld.js +261 -0
  16. package/dist/cjs/view/EmbedCard/views/ErroredView.compiled.css +13 -0
  17. package/dist/cjs/view/EmbedCard/views/ErroredView.js +30 -38
  18. package/dist/cjs/view/EmbedCard/views/ErroredViewOld.js +69 -0
  19. package/dist/cjs/view/EmbedCard/views/ResolvedView.js +19 -13
  20. package/dist/cjs/view/EmbedCard/views/ResolvedViewOld.js +82 -0
  21. package/dist/cjs/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.js +129 -0
  22. package/dist/cjs/view/EmbedCard/views/unresolved-view/index.compiled.css +19 -0
  23. package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +36 -55
  24. package/dist/cjs/view/LinkUrl/index.js +1 -1
  25. package/dist/es2019/utils/analytics/analytics.js +1 -1
  26. package/dist/es2019/view/BlockCard/views/ResolvedView.js +2 -1
  27. package/dist/es2019/view/EmbedCard/components/ErrorFrame.compiled.css +28 -0
  28. package/dist/es2019/view/EmbedCard/components/ErrorFrame.js +48 -61
  29. package/dist/es2019/view/EmbedCard/components/ErrorFrameOld.js +91 -0
  30. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +48 -32
  31. package/dist/es2019/view/EmbedCard/components/ExpandedFrameOld.js +96 -0
  32. package/dist/es2019/view/EmbedCard/components/Frame.compiled.css +9 -0
  33. package/dist/es2019/view/EmbedCard/components/Frame.js +23 -22
  34. package/dist/es2019/view/EmbedCard/components/FrameOld.js +114 -0
  35. package/dist/es2019/view/EmbedCard/components/ImageIcon.js +20 -9
  36. package/dist/es2019/view/EmbedCard/components/styled.compiled.css +92 -0
  37. package/dist/es2019/view/EmbedCard/components/styled.js +192 -343
  38. package/dist/es2019/view/EmbedCard/components/styledOld.js +362 -0
  39. package/dist/es2019/view/EmbedCard/views/ErroredView.compiled.css +13 -0
  40. package/dist/es2019/view/EmbedCard/views/ErroredView.js +27 -37
  41. package/dist/es2019/view/EmbedCard/views/ErroredViewOld.js +58 -0
  42. package/dist/es2019/view/EmbedCard/views/ResolvedView.js +19 -12
  43. package/dist/es2019/view/EmbedCard/views/ResolvedViewOld.js +72 -0
  44. package/dist/es2019/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.js +119 -0
  45. package/dist/es2019/view/EmbedCard/views/unresolved-view/index.compiled.css +19 -0
  46. package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +35 -53
  47. package/dist/es2019/view/LinkUrl/index.js +1 -1
  48. package/dist/esm/utils/analytics/analytics.js +1 -1
  49. package/dist/esm/view/BlockCard/views/ResolvedView.js +2 -1
  50. package/dist/esm/view/EmbedCard/components/ErrorFrame.compiled.css +28 -0
  51. package/dist/esm/view/EmbedCard/components/ErrorFrame.js +59 -62
  52. package/dist/esm/view/EmbedCard/components/ErrorFrameOld.js +92 -0
  53. package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +13 -2
  54. package/dist/esm/view/EmbedCard/components/ExpandedFrameOld.js +104 -0
  55. package/dist/esm/view/EmbedCard/components/Frame.compiled.css +9 -0
  56. package/dist/esm/view/EmbedCard/components/Frame.js +23 -22
  57. package/dist/esm/view/EmbedCard/components/FrameOld.js +133 -0
  58. package/dist/esm/view/EmbedCard/components/ImageIcon.js +20 -9
  59. package/dist/esm/view/EmbedCard/components/styled.compiled.css +92 -0
  60. package/dist/esm/view/EmbedCard/components/styled.js +197 -234
  61. package/dist/esm/view/EmbedCard/components/styledOld.js +252 -0
  62. package/dist/esm/view/EmbedCard/views/ErroredView.compiled.css +13 -0
  63. package/dist/esm/view/EmbedCard/views/ErroredView.js +27 -37
  64. package/dist/esm/view/EmbedCard/views/ErroredViewOld.js +61 -0
  65. package/dist/esm/view/EmbedCard/views/ResolvedView.js +19 -12
  66. package/dist/esm/view/EmbedCard/views/ResolvedViewOld.js +74 -0
  67. package/dist/esm/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.js +118 -0
  68. package/dist/esm/view/EmbedCard/views/unresolved-view/index.compiled.css +19 -0
  69. package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +35 -53
  70. package/dist/esm/view/LinkUrl/index.js +1 -1
  71. package/dist/types/view/EmbedCard/components/ErrorFrame.d.ts +3 -4
  72. package/dist/types/view/EmbedCard/components/ErrorFrameOld.d.ts +19 -0
  73. package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +2 -2
  74. package/dist/types/view/EmbedCard/components/ExpandedFrameOld.d.ts +40 -0
  75. package/dist/types/view/EmbedCard/components/FrameOld.d.ts +14 -0
  76. package/dist/types/view/EmbedCard/components/styled.d.ts +15 -77
  77. package/dist/types/view/EmbedCard/components/styledOld.d.ts +109 -0
  78. package/dist/types/view/EmbedCard/views/ErroredView.d.ts +2 -2
  79. package/dist/types/view/EmbedCard/views/ErroredViewOld.d.ts +12 -0
  80. package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +0 -4
  81. package/dist/types/view/EmbedCard/views/ResolvedViewOld.d.ts +36 -0
  82. package/dist/types/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.d.ts +4 -0
  83. package/dist/types/view/EmbedCard/views/unresolved-view/index.d.ts +3 -3
  84. package/dist/types-ts4.5/view/EmbedCard/components/ErrorFrame.d.ts +3 -4
  85. package/dist/types-ts4.5/view/EmbedCard/components/ErrorFrameOld.d.ts +19 -0
  86. package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +2 -2
  87. package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrameOld.d.ts +40 -0
  88. package/dist/types-ts4.5/view/EmbedCard/components/FrameOld.d.ts +14 -0
  89. package/dist/types-ts4.5/view/EmbedCard/components/styled.d.ts +15 -77
  90. package/dist/types-ts4.5/view/EmbedCard/components/styledOld.d.ts +109 -0
  91. package/dist/types-ts4.5/view/EmbedCard/views/ErroredView.d.ts +2 -2
  92. package/dist/types-ts4.5/view/EmbedCard/views/ErroredViewOld.d.ts +12 -0
  93. package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +0 -4
  94. package/dist/types-ts4.5/view/EmbedCard/views/ResolvedViewOld.d.ts +36 -0
  95. package/dist/types-ts4.5/view/EmbedCard/views/unresolved-view/UnresolvedViewOld.d.ts +4 -0
  96. package/dist/types-ts4.5/view/EmbedCard/views/unresolved-view/index.d.ts +3 -3
  97. package/package.json +2 -2
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.maxAvatarCount = exports.embedHeaderHeight = exports.ellipsis = exports.csssize = exports.className = exports.borderRadius = exports.Wrapper = exports.UsersWrapper = exports.TooltipWrapper = exports.Title = exports.Thumbnail = exports.TextWrapper = exports.ResolvedViewIconWrapper = exports.LinkWrapper = exports.Image = exports.IconWrapper = exports.Header = exports.Description = exports.ContentWrapper = exports.Content = exports.Byline = exports.AlertWrapper = exports.ActionsWrapper = void 0;
9
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
+ var _styled = _interopRequireDefault(require("@emotion/styled"));
11
+ var _colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
12
+ var colors = _colors;
13
+ var _utils = require("../../common/utils");
14
+ var _templateObject, _templateObject2; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
15
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
+ var className = exports.className = 'media-card-frame';
18
+ var borderRadius = exports.borderRadius = "\n border-radius: ".concat("var(--ds-border-radius, 3px)", ";\n");
19
+ var wrapperBorderRadius = "\n border-radius: ".concat("var(--ds-border-radius-200, 8px)", ";\n");
20
+ var contentBorderRadius = "\n border-radius: ".concat("var(--ds-border-radius-100, 4px)", ";\n");
21
+ var ellipsis = exports.ellipsis = function ellipsis() {
22
+ var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
23
+ var unit = typeof maxWidth === 'number' ? 'px' : '';
24
+ return "\n max-width: ".concat(maxWidth).concat(unit, ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ");
25
+ };
26
+ var csssize = exports.csssize = function csssize() {
27
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
28
+ var unit = typeof value === 'number' ? 'px' : '';
29
+ return "\n width: ".concat(value).concat(unit, ";\n height: ").concat(value).concat(unit, ";\n ");
30
+ };
31
+ function minWidth(_ref) {
32
+ var minWidth = _ref.minWidth;
33
+ if (minWidth) {
34
+ return "min-width: ".concat(minWidth, "px;");
35
+ } else {
36
+ return '';
37
+ }
38
+ }
39
+ function maxWidth(_ref2) {
40
+ var maxWidth = _ref2.maxWidth;
41
+ if (maxWidth) {
42
+ return "max-width: ".concat(maxWidth, "px; margin: 0 auto;");
43
+ } else {
44
+ return 'margin: 0 auto;';
45
+ }
46
+ }
47
+ function getInteractiveStyles(_ref3) {
48
+ var isInteractive = _ref3.isInteractive,
49
+ frameStyle = _ref3.frameStyle;
50
+ return isInteractive ? "\n &:hover {\n ".concat(frameStyle !== 'hide' && visibleStyles, "\n\n }\n &:active {\n background-color: ", "var(--ds-background-selected, ".concat(colors.B50, ")"), ";\n }\n ") : '';
51
+ }
52
+ function selected(_ref4) {
53
+ var isSelected = _ref4.isSelected,
54
+ frameStyle = _ref4.frameStyle;
55
+ return isSelected && frameStyle !== 'hide' ? "\n ".concat(visibleStyles, "\n &::after {\n cursor: pointer;\n box-shadow: 0 0 0 3px ", "var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n content: '';\n border: none;\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n ").concat(wrapperBorderRadius, "\n }\n ") : isSelected && frameStyle === 'hide' ? contentBorderRadius : '';
56
+ }
57
+ var height = function height(_ref5) {
58
+ var inheritDimensions = _ref5.inheritDimensions;
59
+ return inheritDimensions ? 'height: 100%;' : "height: ".concat((0, _utils.gs)(54));
60
+ };
61
+ var wrapperStyles = function wrapperStyles(props) {
62
+ return "\n ".concat(wrapperBorderRadius, "\n ").concat(minWidth(props), "\n ").concat(maxWidth(props), "\n ").concat(getInteractiveStyles(props), "\n ").concat(visible(props), "\n display: inline-flex;\n flex-direction: column;\n box-sizing: border-box;\n font-family: ", "var(--ds-font-family-body, ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)", ";\n width: 100%;\n user-select: none;\n line-height: initial;\n transition: background 0.3s;\n position: relative;\n ").concat(height(props), ";\n ").concat(selected(props), "\n\n &:after {\n content: '';\n transition: background 0.3s, box-shadow 0.3s;\n position: absolute;\n height: calc(100% + ", "var(--ds-space-100, 8px)", ");\n ").concat(wrapperBorderRadius, "\n\n ").concat(wrapperSizing(props), "\n }\n");
63
+ };
64
+
65
+ // if frameStyle !== 'show' then set the width of the frame to be
66
+ // 100% of the content +16px and position it left -8px to make it appear
67
+ // outside the container
68
+ var wrapperSizing = function wrapperSizing(_ref6) {
69
+ var frameStyle = _ref6.frameStyle;
70
+ return frameStyle === 'show' ? "\n box-sizing: border-box;\n width: 100%;" : "\n width: calc(100% + ".concat("var(--ds-space-200, 16px)", ");\n left: ", "var(--ds-space-negative-100, -8px)", ";");
71
+ };
72
+ var visibleStyles = "\n &:after {\n border: 1px solid ".concat("var(--ds-border, ".concat(_colors.N40, ")"), ";\n background-color: ", "var(--ds-surface-raised, white)", ";\n }\n .embed-header {\n opacity: 1;\n }");
73
+ function visible(_ref7) {
74
+ var frameStyle = _ref7.frameStyle;
75
+ return frameStyle === 'show' ? visibleStyles : '';
76
+ }
77
+
78
+ // 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
79
+ var LinkWrapper = exports.LinkWrapper = _styled.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t", " &:hover {\n\t\ttext-decoration: none;\n\t}\n"])), function (props) {
80
+ return wrapperStyles(props);
81
+ });
82
+
83
+ // 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
84
+ var Wrapper = exports.Wrapper = _styled.default.div(function (props) {
85
+ return wrapperStyles(props);
86
+ }, {
87
+ // We are keeping this margin as a hardcoded variable as it is not a standard token size and needs
88
+ // to be thoroughly checked with a designer so that we do not miss an unintended visual change
89
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
90
+ marginTop: '10px'
91
+ });
92
+ var embedHeaderHeight = exports.embedHeaderHeight = 32;
93
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
94
+ var Header = exports.Header = _styled.default.div({
95
+ height: "".concat(embedHeaderHeight, "px"),
96
+ position: 'absolute',
97
+ zIndex: 1,
98
+ width: '100%',
99
+ display: 'flex',
100
+ alignItems: 'center',
101
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
102
+ color: "var(--ds-icon, ".concat(colors.N300, ")"),
103
+ opacity: 0,
104
+ transition: '300ms opacity cubic-bezier(0.15, 1, 0.3, 1)'
105
+ },
106
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
107
+ function (_ref8) {
108
+ var frameStyle = _ref8.frameStyle;
109
+ return frameStyle === 'show' ? "\n box-sizing: border-box;\n padding: 0 ".concat("var(--ds-space-100, 8px)", ";\n ") : '';
110
+ });
111
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
112
+ var IconWrapper = exports.IconWrapper = _styled.default.div(
113
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
114
+ borderRadius,
115
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
116
+ csssize(16),
117
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
118
+ function (_ref9) {
119
+ var isPlaceholder = _ref9.isPlaceholder;
120
+ if (isPlaceholder) {
121
+ return "\n\t\t\t".concat("\n background-color: ", "var(--ds-skeleton, ".concat(colors.N30, ")"), ";\n ");
122
+ } else {
123
+ return '';
124
+ }
125
+ }, {
126
+ marginRight: "var(--ds-space-050, 4px)"
127
+ });
128
+
129
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
130
+ var TextWrapper = exports.TextWrapper = _styled.default.div(
131
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-dynamic-styles -- Ignored via go/DSP-18766
132
+ function (_ref10) {
133
+ var isPlaceholder = _ref10.isPlaceholder;
134
+ if (isPlaceholder) {
135
+ return "\n ".concat(borderRadius, "\n width: 125px;\n height: 12px;\n", "\n background-color: ", "var(--ds-skeleton, ".concat(colors.N30, ")"), ";\n ");
136
+ } else {
137
+ return '';
138
+ }
139
+ }, {
140
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
141
+ color: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
142
+ 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)"
143
+ },
144
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
145
+ ellipsis('none'));
146
+
147
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
148
+ var TooltipWrapper = exports.TooltipWrapper = _styled.default.div({
149
+ overflow: 'hidden'
150
+ });
151
+ // NB: `overflow` is kept as `hidden` since
152
+ // the internal contents of the `iframe` should
153
+ // manage scrolling behaviour.
154
+ // 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
155
+ var Content = exports.Content = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t", ";\n\tborder: 1px solid ", ";\n\tbackground-color: ", ";\n\tposition: absolute;\n\tz-index: 1;\n\twidth: 100%;\n\ttransition: box-shadow 0.3s;\n\n\t> .calc-height > div > div {\n\t\tleft: unset !important;\n\t\twidth: unset !important;\n\t\theight: unset !important;\n\t\tposition: initial !important;\n\t\tpadding-bottom: unset !important;\n\t}\n\t> .embed-preview > div {\n\t\tmargin: 0 auto;\n\t}\n\n\t", "\n\n\t", "\n\n ", "\n"])), contentBorderRadius, "var(--ds-border, ".concat(_colors.N40, ")"), "var(--ds-surface-raised, white)", function (_ref11) {
156
+ var allowScrollBar = _ref11.allowScrollBar,
157
+ removeOverflow = _ref11.removeOverflow;
158
+ if (removeOverflow) {
159
+ return '';
160
+ }
161
+ return allowScrollBar ? 'overflow: auto;' : 'overflow: hidden;';
162
+ }, function (_ref12) {
163
+ var frameStyle = _ref12.frameStyle;
164
+ return frameStyle === 'show' ? "\n width: calc(100% - ".concat("var(--ds-space-200, 16px)", " - 2px);\n margin: 0 ", "var(--ds-space-100, 8px)", " ", "var(--ds-space-100, 8px)", ";\n ") : '';
165
+ }, function (_ref13) {
166
+ var frameStyle = _ref13.frameStyle;
167
+ return frameStyle === 'hide' ? 'height: 100%;' : "\n height: calc(100% - ".concat("var(--ds-space-400, 32px)", ");\n top: ", "var(--ds-space-400, 32px)", ";\n ");
168
+ });
169
+ // 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
170
+ var Image = exports.Image = _styled.default.img(function (_ref14) {
171
+ var size = _ref14.size;
172
+ return csssize(size);
173
+ }, borderRadius, {
174
+ overflow: 'hidden'
175
+ });
176
+ var maxAvatarCount = exports.maxAvatarCount = 6;
177
+
178
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
179
+ var ContentWrapper = exports.ContentWrapper = _styled.default.div({
180
+ display: 'flex',
181
+ flexDirection: 'row',
182
+ boxSizing: 'border-box',
183
+ padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-150, 12px)", " ", "var(--ds-space-150, 12px)", " ", "var(--ds-space-150, 12px)")
184
+ });
185
+
186
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
187
+ var Title = exports.Title = _styled.default.div({
188
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
189
+ color: "var(--ds-text, ".concat(colors.N900, ")"),
190
+ 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)",
191
+ maxHeight: "".concat(20 * 4, "px"),
192
+ overflow: 'hidden'
193
+ });
194
+
195
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
196
+ var Byline = exports.Byline = _styled.default.div({
197
+ marginTop: "var(--ds-space-050, 4px)",
198
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
199
+ color: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
200
+ 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)"
201
+ },
202
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
203
+ ellipsis('100%'));
204
+
205
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
206
+ var Description = exports.Description = _styled.default.div({
207
+ marginTop: "calc(".concat("var(--ds-space-100, 8px)", " - 1px)"),
208
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
209
+ color: "var(--ds-text, ".concat(colors.N800, ")"),
210
+ 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)",
211
+ maxHeight: "".concat(18 * 3, "px"),
212
+ overflow: 'hidden'
213
+ });
214
+
215
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
216
+ var ResolvedViewIconWrapper = exports.ResolvedViewIconWrapper = _styled.default.div({
217
+ marginTop: "var(--ds-space-050, 4px)"
218
+ });
219
+ // 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
220
+ var Thumbnail = exports.Thumbnail = _styled.default.div(borderRadius, csssize(48), function (props) {
221
+ return {
222
+ float: 'right',
223
+ margin: "var(--ds-space-050, 4px)".concat(" 0 ", "var(--ds-space-150, 12px)", " ", "var(--ds-space-150, 12px)"),
224
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
225
+ backgroundColor: "var(--ds-skeleton, ".concat(colors.N30, ")"),
226
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
227
+ backgroundImage: "url(".concat(props.src, ")"),
228
+ backgroundSize: 'cover'
229
+ };
230
+ });
231
+
232
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
233
+ var UsersWrapper = exports.UsersWrapper = _styled.default.div({
234
+ marginTop: "var(--ds-space-100, 8px)"
235
+ });
236
+
237
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
238
+ var ActionsWrapper = exports.ActionsWrapper = _styled.default.div({
239
+ marginTop: "var(--ds-space-100, 8px)",
240
+ textAlign: 'right',
241
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
242
+ '> *': {
243
+ marginTop: "var(--ds-space-050, 4px)"
244
+ },
245
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
246
+ '> * + *': {
247
+ marginLeft: "var(--ds-space-050, 4px)"
248
+ }
249
+ });
250
+
251
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
252
+ var AlertWrapper = exports.AlertWrapper = _styled.default.div({
253
+ position: 'absolute',
254
+ top: 0,
255
+ right: 0,
256
+ bottom: 0,
257
+ left: 0,
258
+ overflow: 'hidden',
259
+ pointerEvents: 'none',
260
+ zIndex: maxAvatarCount + 1
261
+ });
@@ -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,69 +1,61 @@
1
+ /* ErroredView.tsx generated by @compiled/babel-plugin v0.36.0 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
6
  Object.defineProperty(exports, "__esModule", {
5
7
  value: true
6
8
  });
7
9
  exports.EmbedCardErroredView = void 0;
8
- var _react = require("@emotion/react");
10
+ require("./ErroredView.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
9
13
  var _reactIntlNext = require("react-intl-next");
10
14
  var _button = _interopRequireDefault(require("@atlaskit/button"));
11
15
  var _error = _interopRequireDefault(require("@atlaskit/icon/core/migration/error"));
12
- var _primitives = require("@atlaskit/primitives");
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
+ var _compiled = require("@atlaskit/primitives/compiled");
13
18
  var _colors = require("@atlaskit/theme/colors");
14
19
  var _messages = require("../../../messages");
15
- var _utils = require("../../common/utils");
16
20
  var _ErrorFrame = require("../components/ErrorFrame");
17
- /**
18
- * @jsxRuntime classic
19
- * @jsx jsx
20
- */
21
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
-
23
- var messageStyles = (0, _react.css)({
24
- 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)",
25
- fontWeight: "var(--ds-font-weight-regular, 400)",
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
27
- marginLeft: (0, _utils.gs)(0.5),
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
- marginRight: (0, _utils.gs)(0.5),
30
- display: '-webkit-box',
31
- overflow: 'hidden',
32
- textOverflow: 'ellipsis',
33
- WebkitLineClamp: 1,
34
- WebkitBoxOrient: 'vertical',
35
- // Fallback options.
36
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
37
- maxHeight: (0, _utils.gs)(3)
38
- });
39
- var boxStyles = (0, _primitives.xcss)({
40
- paddingLeft: 'space.050',
41
- paddingRight: 'space.050'
42
- });
43
- var EmbedCardErroredView = exports.EmbedCardErroredView = function EmbedCardErroredView(_ref) {
21
+ var _ErroredViewOld = require("./ErroredViewOld");
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
+ var styles = {
25
+ messageStyles: "_11c81il0 _1reo15vq _18m915vq _k48pi7a9 _18u01b66 _2hwx1b66 _1e0ccj1k _1yyjkb7n _sudp1e54 _1bto1l2s _c71l183y",
26
+ boxStyles: "_19bv1b66 _u5f31b66"
27
+ };
28
+ var EmbedCardErroredViewNew = function EmbedCardErroredViewNew(_ref) {
44
29
  var onRetry = _ref.onRetry,
45
30
  _ref$isSelected = _ref.isSelected,
46
31
  isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
47
32
  _ref$testId = _ref.testId,
48
33
  testId = _ref$testId === void 0 ? 'embed-card-errored-view' : _ref$testId,
49
34
  inheritDimensions = _ref.inheritDimensions;
50
- return (0, _react.jsx)(_ErrorFrame.Frame, {
35
+ return /*#__PURE__*/React.createElement(_ErrorFrame.Frame, {
51
36
  inheritDimensions: inheritDimensions,
52
37
  compact: true,
53
38
  isSelected: isSelected,
54
39
  testId: testId
55
- }, (0, _react.jsx)(_error.default, {
40
+ }, /*#__PURE__*/React.createElement(_error.default, {
56
41
  LEGACY_size: "small",
57
42
  color: "var(--ds-icon-danger, ".concat(_colors.R300, ")"),
58
43
  label: "error-icon"
59
- }), (0, _react.jsx)(_primitives.Box, {
60
- xcss: boxStyles
61
- }, (0, _react.jsx)(_primitives.Inline, {
62
- xcss: messageStyles
63
- }, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.could_not_load_link))), (0, _react.jsx)(_button.default, {
44
+ }), /*#__PURE__*/React.createElement(_compiled.Box, {
45
+ xcss: styles.boxStyles
46
+ }, /*#__PURE__*/React.createElement(_compiled.Inline, {
47
+ xcss: styles.messageStyles
48
+ }, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, _messages.messages.could_not_load_link))), /*#__PURE__*/React.createElement(_button.default, {
64
49
  testId: "err-view-retry",
65
50
  appearance: "link",
66
51
  spacing: "none",
67
52
  onClick: onRetry
68
- }, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.try_again)));
53
+ }, /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, _messages.messages.try_again)));
54
+ };
55
+ var EmbedCardErroredView = exports.EmbedCardErroredView = function EmbedCardErroredView(props) {
56
+ if ((0, _platformFeatureFlags.fg)('bandicoots-compiled-migration-smartcard')) {
57
+ return /*#__PURE__*/React.createElement(EmbedCardErroredViewNew, props);
58
+ } else {
59
+ return /*#__PURE__*/React.createElement(_ErroredViewOld.EmbedCardErroredViewOld, props);
60
+ }
69
61
  };
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EmbedCardErroredViewOld = void 0;
8
+ var _react = require("@emotion/react");
9
+ var _reactIntlNext = require("react-intl-next");
10
+ var _button = _interopRequireDefault(require("@atlaskit/button"));
11
+ var _error = _interopRequireDefault(require("@atlaskit/icon/core/migration/error"));
12
+ var _primitives = require("@atlaskit/primitives");
13
+ var _colors = require("@atlaskit/theme/colors");
14
+ var _messages = require("../../../messages");
15
+ var _utils = require("../../common/utils");
16
+ var _ErrorFrame = require("../components/ErrorFrame");
17
+ /**
18
+ * @jsxRuntime classic
19
+ * @jsx jsx
20
+ */
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
+
23
+ var messageStyles = (0, _react.css)({
24
+ 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)",
25
+ fontWeight: "var(--ds-font-weight-regular, 400)",
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
27
+ marginLeft: (0, _utils.gs)(0.5),
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
+ marginRight: (0, _utils.gs)(0.5),
30
+ display: '-webkit-box',
31
+ overflow: 'hidden',
32
+ textOverflow: 'ellipsis',
33
+ WebkitLineClamp: 1,
34
+ WebkitBoxOrient: 'vertical',
35
+ // Fallback options.
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
37
+ maxHeight: (0, _utils.gs)(3)
38
+ });
39
+ var boxStyles = (0, _primitives.xcss)({
40
+ paddingLeft: 'space.050',
41
+ paddingRight: 'space.050'
42
+ });
43
+ var EmbedCardErroredViewOld = exports.EmbedCardErroredViewOld = function EmbedCardErroredViewOld(_ref) {
44
+ var onRetry = _ref.onRetry,
45
+ _ref$isSelected = _ref.isSelected,
46
+ isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected,
47
+ _ref$testId = _ref.testId,
48
+ testId = _ref$testId === void 0 ? 'embed-card-errored-view' : _ref$testId,
49
+ inheritDimensions = _ref.inheritDimensions;
50
+ return (0, _react.jsx)(_ErrorFrame.Frame, {
51
+ inheritDimensions: inheritDimensions,
52
+ compact: true,
53
+ isSelected: isSelected,
54
+ testId: testId
55
+ }, (0, _react.jsx)(_error.default, {
56
+ LEGACY_size: "small",
57
+ color: "var(--ds-icon-danger, ".concat(_colors.R300, ")"),
58
+ label: "error-icon"
59
+ }), (0, _react.jsx)(_primitives.Box, {
60
+ xcss: boxStyles
61
+ }, (0, _react.jsx)(_primitives.Inline, {
62
+ xcss: messageStyles
63
+ }, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.could_not_load_link))), (0, _react.jsx)(_button.default, {
64
+ testId: "err-view-retry",
65
+ appearance: "link",
66
+ spacing: "none",
67
+ onClick: onRetry
68
+ }, (0, _react.jsx)(_reactIntlNext.FormattedMessage, _messages.messages.try_again)));
69
+ };
@@ -5,22 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.EmbedCardResolvedView = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var _react = _interopRequireDefault(require("react"));
9
- var _react2 = require("@emotion/react");
10
10
  var _link = _interopRequireDefault(require("@atlaskit/icon/core/migration/link"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _tokens = require("@atlaskit/tokens");
12
13
  var _utils = require("../../../utils");
13
14
  var _ExpandedFrame = require("../components/ExpandedFrame");
14
15
  var _Frame = require("../components/Frame");
15
16
  var _ImageIcon = require("../components/ImageIcon");
16
- /**
17
- * @jsxRuntime classic
18
- * @jsx jsx
19
- */
20
-
21
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
-
23
- var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.default.forwardRef(function (_ref, embedIframeRef) {
17
+ var _ResolvedViewOld = require("./ResolvedViewOld");
18
+ var EmbedCardResolvedViewNew = /*#__PURE__*/_react.default.forwardRef(function (_ref, embedIframeRef) {
24
19
  var link = _ref.link,
25
20
  context = _ref.context,
26
21
  onClick = _ref.onClick,
@@ -39,7 +34,7 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
39
34
  var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
40
35
  var text = title || (context === null || context === void 0 ? void 0 : context.text);
41
36
  var linkGlyph = _react.default.useMemo(function () {
42
- return (0, _react2.jsx)(_link.default, {
37
+ return /*#__PURE__*/_react.default.createElement(_link.default, {
43
38
  label: "icon",
44
39
  LEGACY_size: "small",
45
40
  testId: "embed-card-fallback-icon",
@@ -50,7 +45,7 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
50
45
  if ( /*#__PURE__*/_react.default.isValidElement(iconFromContext)) {
51
46
  return iconFromContext;
52
47
  }
53
- return (0, _react2.jsx)(_ImageIcon.ImageIcon, {
48
+ return /*#__PURE__*/_react.default.createElement(_ImageIcon.ImageIcon, {
54
49
  src: src,
55
50
  default: linkGlyph
56
51
  });
@@ -60,7 +55,7 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
60
55
  if (previewUrl && isSupportTheming) {
61
56
  previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
62
57
  }
63
- return (0, _react2.jsx)(_ExpandedFrame.ExpandedFrame, {
58
+ return /*#__PURE__*/_react.default.createElement(_ExpandedFrame.ExpandedFrame, {
64
59
  isSelected: isSelected,
65
60
  frameStyle: frameStyle,
66
61
  href: link,
@@ -70,7 +65,7 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
70
65
  onClick: onClick,
71
66
  inheritDimensions: inheritDimensions,
72
67
  setOverflow: false
73
- }, (0, _react2.jsx)(_Frame.Frame, {
68
+ }, /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
74
69
  url: previewUrl,
75
70
  isTrusted: isTrusted,
76
71
  testId: testId,
@@ -79,4 +74,15 @@ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.
79
74
  onIframeFocus: onIframeFocus,
80
75
  title: text
81
76
  }));
77
+ });
78
+ var EmbedCardResolvedView = exports.EmbedCardResolvedView = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
79
+ if ((0, _platformFeatureFlags.fg)('bandicoots-compiled-migration-smartcard')) {
80
+ return /*#__PURE__*/_react.default.createElement(EmbedCardResolvedViewNew, (0, _extends2.default)({}, props, {
81
+ ref: ref
82
+ }));
83
+ } else {
84
+ return /*#__PURE__*/_react.default.createElement(_ResolvedViewOld.EmbedCardResolvedViewOld, (0, _extends2.default)({}, props, {
85
+ ref: ref
86
+ }));
87
+ }
82
88
  });
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.EmbedCardResolvedViewOld = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _react2 = require("@emotion/react");
10
+ var _link = _interopRequireDefault(require("@atlaskit/icon/core/migration/link"));
11
+ var _tokens = require("@atlaskit/tokens");
12
+ var _utils = require("../../../utils");
13
+ var _ExpandedFrame = require("../components/ExpandedFrame");
14
+ var _Frame = require("../components/Frame");
15
+ var _ImageIcon = require("../components/ImageIcon");
16
+ /**
17
+ * @jsxRuntime classic
18
+ * @jsx jsx
19
+ */
20
+
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
22
+
23
+ var EmbedCardResolvedViewOld = exports.EmbedCardResolvedViewOld = /*#__PURE__*/_react.default.forwardRef(function (_ref, embedIframeRef) {
24
+ var link = _ref.link,
25
+ context = _ref.context,
26
+ onClick = _ref.onClick,
27
+ isSelected = _ref.isSelected,
28
+ frameStyle = _ref.frameStyle,
29
+ preview = _ref.preview,
30
+ title = _ref.title,
31
+ isTrusted = _ref.isTrusted,
32
+ _ref$testId = _ref.testId,
33
+ testId = _ref$testId === void 0 ? 'embed-card-resolved-view' : _ref$testId,
34
+ inheritDimensions = _ref.inheritDimensions,
35
+ onIframeDwell = _ref.onIframeDwell,
36
+ onIframeFocus = _ref.onIframeFocus,
37
+ isSupportTheming = _ref.isSupportTheming;
38
+ var iconFromContext = context === null || context === void 0 ? void 0 : context.icon;
39
+ var src = typeof iconFromContext === 'string' ? iconFromContext : undefined;
40
+ var text = title || (context === null || context === void 0 ? void 0 : context.text);
41
+ var linkGlyph = _react.default.useMemo(function () {
42
+ return (0, _react2.jsx)(_link.default, {
43
+ label: "icon",
44
+ LEGACY_size: "small",
45
+ testId: "embed-card-fallback-icon",
46
+ color: "currentColor"
47
+ });
48
+ }, []);
49
+ var icon = _react.default.useMemo(function () {
50
+ if ( /*#__PURE__*/_react.default.isValidElement(iconFromContext)) {
51
+ return iconFromContext;
52
+ }
53
+ return (0, _react2.jsx)(_ImageIcon.ImageIcon, {
54
+ src: src,
55
+ default: linkGlyph
56
+ });
57
+ }, [src, linkGlyph, iconFromContext]);
58
+ var themeState = (0, _tokens.useThemeObserver)();
59
+ var previewUrl = preview === null || preview === void 0 ? void 0 : preview.src;
60
+ if (previewUrl && isSupportTheming) {
61
+ previewUrl = (0, _utils.getPreviewUrlWithTheme)(previewUrl, themeState);
62
+ }
63
+ return (0, _react2.jsx)(_ExpandedFrame.ExpandedFrame, {
64
+ isSelected: isSelected,
65
+ frameStyle: frameStyle,
66
+ href: link,
67
+ testId: testId,
68
+ icon: icon,
69
+ text: text,
70
+ onClick: onClick,
71
+ inheritDimensions: inheritDimensions,
72
+ setOverflow: false
73
+ }, (0, _react2.jsx)(_Frame.Frame, {
74
+ url: previewUrl,
75
+ isTrusted: isTrusted,
76
+ testId: testId,
77
+ ref: embedIframeRef,
78
+ onIframeDwell: onIframeDwell,
79
+ onIframeFocus: onIframeFocus,
80
+ title: text
81
+ }));
82
+ });