@atlaskit/smart-card 34.1.1 → 34.2.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 +8 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedCard/components/IFrame.js +6 -3
- package/dist/cjs/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
- package/dist/cjs/view/EmbedModal/components/embed-content/index.js +23 -14
- package/dist/cjs/view/EmbedModal/components/embed-content/indexOld.js +37 -0
- package/dist/cjs/view/EmbedModal/components/link-info/index.compiled.css +35 -0
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +58 -49
- package/dist/cjs/view/EmbedModal/components/link-info/indexOld.js +131 -0
- package/dist/cjs/view/FlexibleCard/components/container/index.compiled.css +38 -0
- package/dist/cjs/view/FlexibleCard/components/container/index.js +94 -87
- package/dist/cjs/view/FlexibleCard/components/container/indexOld.js +226 -0
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +75 -0
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
- package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +20 -46
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedCard/components/IFrame.js +5 -2
- package/dist/es2019/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
- package/dist/es2019/view/EmbedModal/components/embed-content/index.js +19 -13
- package/dist/es2019/view/EmbedModal/components/embed-content/indexOld.js +31 -0
- package/dist/es2019/view/EmbedModal/components/link-info/index.compiled.css +35 -0
- package/dist/es2019/view/EmbedModal/components/link-info/index.js +59 -49
- package/dist/es2019/view/EmbedModal/components/link-info/indexOld.js +122 -0
- package/dist/es2019/view/FlexibleCard/components/container/index.compiled.css +38 -0
- package/dist/es2019/view/FlexibleCard/components/container/index.js +88 -105
- package/dist/es2019/view/FlexibleCard/components/container/indexOld.js +229 -0
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +69 -0
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
- package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +16 -45
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedCard/components/IFrame.js +6 -3
- package/dist/esm/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
- package/dist/esm/view/EmbedModal/components/embed-content/index.js +19 -13
- package/dist/esm/view/EmbedModal/components/embed-content/indexOld.js +30 -0
- package/dist/esm/view/EmbedModal/components/link-info/index.compiled.css +35 -0
- package/dist/esm/view/EmbedModal/components/link-info/index.js +59 -49
- package/dist/esm/view/EmbedModal/components/link-info/indexOld.js +120 -0
- package/dist/esm/view/FlexibleCard/components/container/index.compiled.css +38 -0
- package/dist/esm/view/FlexibleCard/components/container/index.js +88 -87
- package/dist/esm/view/FlexibleCard/components/container/indexOld.js +217 -0
- package/dist/esm/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +68 -0
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
- package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +16 -45
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/EmbedCard/components/IFrame.d.ts +2 -1
- package/dist/types/view/EmbedModal/components/embed-content/index.d.ts +3 -7
- package/dist/types/view/EmbedModal/components/embed-content/indexOld.d.ts +8 -0
- package/dist/types/view/EmbedModal/components/link-info/index.d.ts +3 -3
- package/dist/types/view/EmbedModal/components/link-info/indexOld.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/container/index.d.ts +10 -10
- package/dist/types/view/FlexibleCard/components/container/indexOld.d.ts +24 -0
- package/dist/types/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.d.ts +13 -0
- package/dist/types/view/FlexibleCard/components/container/layered-link/index.d.ts +2 -11
- package/dist/types-ts4.5/view/EmbedCard/components/IFrame.d.ts +2 -1
- package/dist/types-ts4.5/view/EmbedModal/components/embed-content/index.d.ts +3 -7
- package/dist/types-ts4.5/view/EmbedModal/components/embed-content/indexOld.d.ts +8 -0
- package/dist/types-ts4.5/view/EmbedModal/components/link-info/index.d.ts +3 -3
- package/dist/types-ts4.5/view/EmbedModal/components/link-info/indexOld.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +10 -10
- package/dist/types-ts4.5/view/FlexibleCard/components/container/indexOld.d.ts +24 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.d.ts +13 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/container/layered-link/index.d.ts +2 -11
- package/package.json +1 -1
- /package/dist/cjs/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
- /package/dist/es2019/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
- /package/dist/esm/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
- /package/dist/types/view/EmbedModal/components/link-info/{styled.d.ts → styledOld.d.ts} +0 -0
- /package/dist/types-ts4.5/view/EmbedModal/components/link-info/{styled.d.ts → styledOld.d.ts} +0 -0
|
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
20
20
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
21
21
|
var PACKAGE_DATA = {
|
|
22
22
|
packageName: "@atlaskit/smart-card",
|
|
23
|
-
packageVersion: "34.
|
|
23
|
+
packageVersion: "34.2.0",
|
|
24
24
|
componentName: 'linkUrl'
|
|
25
25
|
};
|
|
26
26
|
var Anchor = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card",
|
|
5
|
-
packageVersion: "34.
|
|
5
|
+
packageVersion: "34.2.0"
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,10 +5,13 @@ import React from 'react';
|
|
|
5
5
|
*/
|
|
6
6
|
export const IFrame = ({
|
|
7
7
|
childRef,
|
|
8
|
+
className,
|
|
8
9
|
...props
|
|
9
10
|
}) => {
|
|
10
|
-
// eslint-disable-next-line jsx-a11y/iframe-has-title
|
|
11
|
-
return /*#__PURE__*/React.createElement("iframe", _extends({
|
|
11
|
+
// eslint-disable-next-line jsx-a11y/iframe-has-title,@atlaskit/ui-styling-standard/no-classname-prop
|
|
12
|
+
return /*#__PURE__*/React.createElement("iframe", _extends({
|
|
13
|
+
className: className
|
|
14
|
+
}, props, {
|
|
12
15
|
ref: childRef
|
|
13
16
|
}));
|
|
14
17
|
};
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { css, jsx } from '@emotion/react';
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./index.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
7
6
|
import { di } from 'react-magnetic-di';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
import { getIframeSandboxAttribute } from '../../../../utils';
|
|
9
9
|
import { IFrame } from '../../../EmbedCard/components/IFrame';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
height: 'calc(100vh - 208px)'
|
|
13
|
-
});
|
|
10
|
+
import EmbedContentOld from './indexOld';
|
|
11
|
+
const iframeCss = null;
|
|
14
12
|
const EmbedContent = ({
|
|
15
13
|
isTrusted,
|
|
16
14
|
name,
|
|
@@ -19,13 +17,21 @@ const EmbedContent = ({
|
|
|
19
17
|
}) => {
|
|
20
18
|
const sandbox = getIframeSandboxAttribute(isTrusted);
|
|
21
19
|
const props = {
|
|
22
|
-
css: iframeCss,
|
|
23
20
|
frameBorder: 0,
|
|
24
21
|
name,
|
|
25
22
|
sandbox,
|
|
26
23
|
src,
|
|
27
24
|
'data-testid': `${testId}-embed`
|
|
28
25
|
};
|
|
29
|
-
return
|
|
26
|
+
return /*#__PURE__*/React.createElement(IFrame, _extends({}, props, {
|
|
27
|
+
className: ax(["_1bsb1osq _4t3i815d"])
|
|
28
|
+
}));
|
|
30
29
|
};
|
|
31
|
-
|
|
30
|
+
const Exported = props => {
|
|
31
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
32
|
+
return /*#__PURE__*/React.createElement(EmbedContent, props);
|
|
33
|
+
} else {
|
|
34
|
+
return /*#__PURE__*/React.createElement(EmbedContentOld, props);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
export default Exported;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { di } from 'react-magnetic-di';
|
|
8
|
+
import { getIframeSandboxAttribute } from '../../../../utils';
|
|
9
|
+
import { IFrame } from '../../../EmbedCard/components/IFrame';
|
|
10
|
+
const iframeCss = css({
|
|
11
|
+
width: '100%',
|
|
12
|
+
height: 'calc(100vh - 208px)'
|
|
13
|
+
});
|
|
14
|
+
const EmbedContent = ({
|
|
15
|
+
isTrusted,
|
|
16
|
+
name,
|
|
17
|
+
src,
|
|
18
|
+
testId
|
|
19
|
+
}) => {
|
|
20
|
+
const sandbox = getIframeSandboxAttribute(isTrusted);
|
|
21
|
+
const props = {
|
|
22
|
+
css: iframeCss,
|
|
23
|
+
frameBorder: 0,
|
|
24
|
+
name,
|
|
25
|
+
sandbox,
|
|
26
|
+
src,
|
|
27
|
+
'data-testid': `${testId}-embed`
|
|
28
|
+
};
|
|
29
|
+
return jsx(IFrame, props);
|
|
30
|
+
};
|
|
31
|
+
export default EmbedContent;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
._1umo1bk4 h3{font:var(--ds-font-heading-small,normal 600 1pc/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,system-ui,"Helvetica Neue",sans-serif)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
|
+
._zulpu2gc{gap:var(--ds-space-100,8px)}._101p15vq h3{overflow-x:hidden}
|
|
5
|
+
._12bo15vq h3{overflow-y:hidden}
|
|
6
|
+
._16jlidpf{flex-grow:0}
|
|
7
|
+
._16jlkb7n{flex-grow:1}
|
|
8
|
+
._19bv1ejb{padding-left:var(--ds-space-300,24px)}
|
|
9
|
+
._1bah1yb4{justify-content:space-between}
|
|
10
|
+
._1bsb1tcg, ._1xyl1tcg [data-smart-element-icon] img, ._1h1b1tcg [data-smart-element-icon] span, ._prfw1tcg [data-smart-element-icon] svg, ._mezj1tcg img, ._e2oo1tcg span, ._w8l51tcg svg{width:24px}
|
|
11
|
+
._1e0c1txw{display:flex}
|
|
12
|
+
._1flvcj1k h3{display:-webkit-box}
|
|
13
|
+
._1o9zidpf{flex-shrink:0}
|
|
14
|
+
._1o9zkb7n{flex-shrink:1}
|
|
15
|
+
._1r7d1hna h3{word-break:break-word}
|
|
16
|
+
._1tke1tcg, ._x9xj1tcg [data-smart-element-icon] img, ._v5981tcg [data-smart-element-icon] span, ._z15s1tcg [data-smart-element-icon] svg, ._qci81tcg img, ._15iz1tcg span, ._erub1tcg svg{min-height:24px}
|
|
17
|
+
._1ul91tcg, ._1ekg1tcg [data-smart-element-icon] img, ._jbhf1tcg [data-smart-element-icon] span, ._11hh1tcg [data-smart-element-icon] svg, ._1rg21tcg img, ._q7cv1tcg span, ._xwbj1tcg svg{min-width:24px}
|
|
18
|
+
._1wkfkb7n h3{flex-shrink:1}
|
|
19
|
+
._4cvr1h6o{align-items:center}
|
|
20
|
+
._4t3i1tcg, ._gire1tcg [data-smart-element-icon] img, ._yrry1tcg [data-smart-element-icon] span, ._1bnm1tcg [data-smart-element-icon] svg, ._bna71tcg img, ._1xjx1tcg span, ._17521tcg svg{height:24px}
|
|
21
|
+
._4wztidpf h3{margin-bottom:0}
|
|
22
|
+
._923e1wug h3{flex-basis:auto}
|
|
23
|
+
._c71l1tcg, ._1q121tcg [data-smart-element-icon] img, ._2s1x1tcg [data-smart-element-icon] span, ._1rh41tcg [data-smart-element-icon] svg, ._19l31tcg img, ._1pr21tcg span, ._1u5t1tcg svg{max-height:24px}
|
|
24
|
+
._c7bk1l2s h3{text-overflow:ellipsis}
|
|
25
|
+
._ca0q1ejb{padding-top:var(--ds-space-300,24px)}
|
|
26
|
+
._i0dl1wug{flex-basis:auto}
|
|
27
|
+
._n3tddlk8{padding-bottom:14px}
|
|
28
|
+
._p12f1tcg, ._1mj01tcg [data-smart-element-icon] img, ._1r9c1tcg [data-smart-element-icon] span, ._1xch1tcg [data-smart-element-icon] svg, ._rtys1tcg img, ._b8nk1tcg span, ._4x201tcg svg{max-width:24px}
|
|
29
|
+
._r8nti7a9 h3{font-weight:var(--ds-font-weight-regular,400)}
|
|
30
|
+
._shpw1e54 h3{-webkit-box-orient:vertical}
|
|
31
|
+
._u5f31ejb{padding-right:var(--ds-space-300,24px)}
|
|
32
|
+
._uepwkb7n h3{-webkit-line-clamp:1}
|
|
33
|
+
._yrj2kb7n h3{flex-grow:1}
|
|
34
|
+
@media only screen and (max-width:980px){._3kllglyw .smart-link-resize-button{display:none}}
|
|
35
|
+
@supports not (-webkit-line-clamp:1){._130wgktf h3{max-height:20px}}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
1
|
+
/* index.tsx generated by @compiled/babel-plugin v0.35.0 */
|
|
2
|
+
import "./index.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
4
|
import React, { useMemo } 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
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
6
|
import Heading from '@atlaskit/heading';
|
|
11
7
|
import DownloadIcon from '@atlaskit/icon/core/download';
|
|
@@ -16,11 +12,22 @@ import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut'
|
|
|
16
12
|
import DownloadIconLegacy from '@atlaskit/icon/glyph/download';
|
|
17
13
|
import VidFullScreenOffIcon from '@atlaskit/icon/glyph/vid-full-screen-off';
|
|
18
14
|
import { useModal } from '@atlaskit/modal-dialog';
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
16
|
import { messages } from '../../../../messages';
|
|
20
17
|
import { Icon } from '../../../common/Icon';
|
|
21
18
|
import { MAX_MODAL_SIZE } from '../../constants';
|
|
19
|
+
import LinkInfoOld from './indexOld';
|
|
22
20
|
import LinkInfoButton from './link-info-button';
|
|
23
|
-
|
|
21
|
+
const containerStyles = null;
|
|
22
|
+
const iconSize = '24px';
|
|
23
|
+
|
|
24
|
+
// EDM-7328: CSS Specificity
|
|
25
|
+
// An embed modal icon css for img, span, svg has specificity weight of 0-1-1.
|
|
26
|
+
// Specify flex ui icon selector to increase specificity weight to 0-2-1.
|
|
27
|
+
const iconCss = null;
|
|
28
|
+
const height = '20px';
|
|
29
|
+
const titleCss = null;
|
|
30
|
+
const actionCss = null;
|
|
24
31
|
const LinkInfo = ({
|
|
25
32
|
icon,
|
|
26
33
|
providerName,
|
|
@@ -36,9 +43,9 @@ const LinkInfo = ({
|
|
|
36
43
|
} = useModal();
|
|
37
44
|
const downloadButton = useMemo(() => {
|
|
38
45
|
if (onDownloadButtonClick) {
|
|
39
|
-
return
|
|
40
|
-
content:
|
|
41
|
-
icon:
|
|
46
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
47
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
|
|
48
|
+
icon: /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
42
49
|
label: messages.download.defaultMessage,
|
|
43
50
|
LEGACY_fallbackIcon: DownloadIconLegacy,
|
|
44
51
|
spacing: "spacious",
|
|
@@ -51,10 +58,10 @@ const LinkInfo = ({
|
|
|
51
58
|
}, [onDownloadButtonClick, testId]);
|
|
52
59
|
const urlButton = useMemo(() => {
|
|
53
60
|
if (onViewButtonClick) {
|
|
54
|
-
const content = providerName ?
|
|
55
|
-
return
|
|
61
|
+
const content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
|
|
62
|
+
return /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
56
63
|
content: content,
|
|
57
|
-
icon:
|
|
64
|
+
icon: /*#__PURE__*/React.createElement(ShortcutIcon, {
|
|
58
65
|
label: messages.viewOriginal.defaultMessage,
|
|
59
66
|
spacing: "spacious",
|
|
60
67
|
color: "currentColor"
|
|
@@ -67,56 +74,59 @@ const LinkInfo = ({
|
|
|
67
74
|
const sizeButton = useMemo(() => {
|
|
68
75
|
const isFullScreen = size === MAX_MODAL_SIZE;
|
|
69
76
|
const message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
|
|
70
|
-
const icon = isFullScreen ?
|
|
77
|
+
const icon = isFullScreen ? /*#__PURE__*/React.createElement(FullscreenExitIcon, {
|
|
71
78
|
LEGACY_fallbackIcon: VidFullScreenOffIcon,
|
|
72
79
|
label: message.defaultMessage,
|
|
73
80
|
spacing: "spacious",
|
|
74
81
|
color: "currentColor"
|
|
75
|
-
}) :
|
|
82
|
+
}) : /*#__PURE__*/React.createElement(VidFullScreenOnIcon, {
|
|
76
83
|
label: message.defaultMessage,
|
|
77
84
|
spacing: "spacious",
|
|
78
85
|
color: "currentColor"
|
|
79
86
|
});
|
|
80
87
|
return (
|
|
88
|
+
/*#__PURE__*/
|
|
81
89
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
82
|
-
|
|
90
|
+
React.createElement("span", {
|
|
83
91
|
className: "smart-link-resize-button"
|
|
84
|
-
},
|
|
85
|
-
content:
|
|
92
|
+
}, /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
93
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, message),
|
|
86
94
|
icon: icon,
|
|
87
95
|
onClick: onResizeButtonClick,
|
|
88
96
|
testId: `${testId}-resize`
|
|
89
97
|
}))
|
|
90
98
|
);
|
|
91
99
|
}, [onResizeButtonClick, size, testId]);
|
|
92
|
-
return (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
100
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
className: ax(["_zulpu2gc _4cvr1h6o _1e0c1txw _1bah1yb4 _ca0q1ejb _u5f31ejb _n3tddlk8 _19bv1ejb"])
|
|
102
|
+
}, icon && /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
"data-testid": `${testId}-icon`,
|
|
104
|
+
className: ax(["_4t3i1tcg _gire1tcg _yrry1tcg _1bnm1tcg _bna71tcg _1xjx1tcg _17521tcg _1tke1tcg _x9xj1tcg _v5981tcg _z15s1tcg _qci81tcg _15iz1tcg _erub1tcg _c71l1tcg _1q121tcg _2s1x1tcg _1rh41tcg _19l31tcg _1pr21tcg _1u5t1tcg _1bsb1tcg _1xyl1tcg _1h1b1tcg _prfw1tcg _mezj1tcg _e2oo1tcg _w8l51tcg _1ul91tcg _1ekg1tcg _jbhf1tcg _11hh1tcg _1rg21tcg _q7cv1tcg _xwbj1tcg _p12f1tcg _1mj01tcg _1r9c1tcg _1xch1tcg _rtys1tcg _b8nk1tcg _4x201tcg"])
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Icon, icon)), /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: ax(["_16jlkb7n _1o9zkb7n _i0dl1wug _yrj2kb7n _1wkfkb7n _923e1wug _1umo1bk4 _101p15vq _12bo15vq _r8nti7a9 _1flvcj1k _4wztidpf _c7bk1l2s _1r7d1hna _uepwkb7n _shpw1e54 _130wgktf"])
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Heading, {
|
|
108
|
+
size: "medium",
|
|
109
|
+
testId: `${testId}-title`
|
|
110
|
+
}, title), /*#__PURE__*/React.createElement("span", {
|
|
111
|
+
tabIndex: 0
|
|
112
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _1e0c1txw _3kllglyw"])
|
|
114
|
+
}, downloadButton, urlButton, sizeButton, /*#__PURE__*/React.createElement(LinkInfoButton, {
|
|
115
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
|
|
116
|
+
icon: /*#__PURE__*/React.createElement(CrossIcon, {
|
|
117
|
+
label: messages.preview_close.defaultMessage,
|
|
118
|
+
color: "currentColor",
|
|
119
|
+
spacing: "spacious"
|
|
120
|
+
}),
|
|
121
|
+
onClick: onClose,
|
|
122
|
+
testId: `${testId}-close`
|
|
123
|
+
})));
|
|
124
|
+
};
|
|
125
|
+
const Exported = props => {
|
|
126
|
+
if (fg('bandicoots-compiled-migration-smartcard')) {
|
|
127
|
+
return /*#__PURE__*/React.createElement(LinkInfo, props);
|
|
128
|
+
} else {
|
|
129
|
+
return /*#__PURE__*/React.createElement(LinkInfoOld, props);
|
|
130
|
+
}
|
|
121
131
|
};
|
|
122
|
-
export default
|
|
132
|
+
export default Exported;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
import React, { useMemo } 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 { FormattedMessage } from 'react-intl-next';
|
|
10
|
+
import Heading from '@atlaskit/heading';
|
|
11
|
+
import DownloadIcon from '@atlaskit/icon/core/download';
|
|
12
|
+
import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
|
|
13
|
+
import CrossIcon from '@atlaskit/icon/core/migration/close--cross';
|
|
14
|
+
import VidFullScreenOnIcon from '@atlaskit/icon/core/migration/fullscreen-enter--vid-full-screen-on';
|
|
15
|
+
import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
|
|
16
|
+
import DownloadIconLegacy from '@atlaskit/icon/glyph/download';
|
|
17
|
+
import VidFullScreenOffIcon from '@atlaskit/icon/glyph/vid-full-screen-off';
|
|
18
|
+
import { useModal } from '@atlaskit/modal-dialog';
|
|
19
|
+
import { messages } from '../../../../messages';
|
|
20
|
+
import { Icon } from '../../../common/Icon';
|
|
21
|
+
import { MAX_MODAL_SIZE } from '../../constants';
|
|
22
|
+
import LinkInfoButton from './link-info-button';
|
|
23
|
+
import { actionCss, containerStyles, iconCss, titleCss } from './styledOld';
|
|
24
|
+
const LinkInfo = ({
|
|
25
|
+
icon,
|
|
26
|
+
providerName,
|
|
27
|
+
onDownloadButtonClick,
|
|
28
|
+
onResizeButtonClick,
|
|
29
|
+
onViewButtonClick,
|
|
30
|
+
size,
|
|
31
|
+
testId,
|
|
32
|
+
title
|
|
33
|
+
}) => {
|
|
34
|
+
const {
|
|
35
|
+
onClose
|
|
36
|
+
} = useModal();
|
|
37
|
+
const downloadButton = useMemo(() => {
|
|
38
|
+
if (onDownloadButtonClick) {
|
|
39
|
+
return jsx(LinkInfoButton, {
|
|
40
|
+
content: jsx(FormattedMessage, messages.download),
|
|
41
|
+
icon: jsx(DownloadIcon, {
|
|
42
|
+
label: messages.download.defaultMessage,
|
|
43
|
+
LEGACY_fallbackIcon: DownloadIconLegacy,
|
|
44
|
+
spacing: "spacious",
|
|
45
|
+
color: "currentColor"
|
|
46
|
+
}),
|
|
47
|
+
onClick: onDownloadButtonClick,
|
|
48
|
+
testId: `${testId}-download`
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}, [onDownloadButtonClick, testId]);
|
|
52
|
+
const urlButton = useMemo(() => {
|
|
53
|
+
if (onViewButtonClick) {
|
|
54
|
+
const content = providerName ? jsx(React.Fragment, null, jsx(FormattedMessage, messages.viewIn), " ", providerName) : jsx(FormattedMessage, messages.viewOriginal);
|
|
55
|
+
return jsx(LinkInfoButton, {
|
|
56
|
+
content: content,
|
|
57
|
+
icon: jsx(ShortcutIcon, {
|
|
58
|
+
label: messages.viewOriginal.defaultMessage,
|
|
59
|
+
spacing: "spacious",
|
|
60
|
+
color: "currentColor"
|
|
61
|
+
}),
|
|
62
|
+
onClick: onViewButtonClick,
|
|
63
|
+
testId: `${testId}-url`
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}, [onViewButtonClick, providerName, testId]);
|
|
67
|
+
const sizeButton = useMemo(() => {
|
|
68
|
+
const isFullScreen = size === MAX_MODAL_SIZE;
|
|
69
|
+
const message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
|
|
70
|
+
const icon = isFullScreen ? jsx(FullscreenExitIcon, {
|
|
71
|
+
LEGACY_fallbackIcon: VidFullScreenOffIcon,
|
|
72
|
+
label: message.defaultMessage,
|
|
73
|
+
spacing: "spacious",
|
|
74
|
+
color: "currentColor"
|
|
75
|
+
}) : jsx(VidFullScreenOnIcon, {
|
|
76
|
+
label: message.defaultMessage,
|
|
77
|
+
spacing: "spacious",
|
|
78
|
+
color: "currentColor"
|
|
79
|
+
});
|
|
80
|
+
return (
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
82
|
+
jsx("span", {
|
|
83
|
+
className: "smart-link-resize-button"
|
|
84
|
+
}, jsx(LinkInfoButton, {
|
|
85
|
+
content: jsx(FormattedMessage, message),
|
|
86
|
+
icon: icon,
|
|
87
|
+
onClick: onResizeButtonClick,
|
|
88
|
+
testId: `${testId}-resize`
|
|
89
|
+
}))
|
|
90
|
+
);
|
|
91
|
+
}, [onResizeButtonClick, size, testId]);
|
|
92
|
+
return (
|
|
93
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
94
|
+
jsx("div", {
|
|
95
|
+
css: containerStyles
|
|
96
|
+
}, icon &&
|
|
97
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
98
|
+
jsx("div", {
|
|
99
|
+
css: iconCss,
|
|
100
|
+
"data-testid": `${testId}-icon`
|
|
101
|
+
}, jsx(Icon, icon)), jsx("div", {
|
|
102
|
+
css: titleCss
|
|
103
|
+
}, jsx(Heading, {
|
|
104
|
+
size: "medium",
|
|
105
|
+
testId: `${testId}-title`
|
|
106
|
+
}, title), jsx("span", {
|
|
107
|
+
tabIndex: 0
|
|
108
|
+
})), jsx("div", {
|
|
109
|
+
css: actionCss
|
|
110
|
+
}, downloadButton, urlButton, sizeButton, jsx(LinkInfoButton, {
|
|
111
|
+
content: jsx(FormattedMessage, messages.preview_close),
|
|
112
|
+
icon: jsx(CrossIcon, {
|
|
113
|
+
label: messages.preview_close.defaultMessage,
|
|
114
|
+
color: "currentColor",
|
|
115
|
+
spacing: "spacious"
|
|
116
|
+
}),
|
|
117
|
+
onClick: onClose,
|
|
118
|
+
testId: `${testId}-close`
|
|
119
|
+
})))
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
export default LinkInfo;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
._18s8v77o{margin:var(--ds-space-025,2px)}
|
|
2
|
+
._19ith6cr{border:1px solid var(--ds-border,#dfe1e6)}
|
|
3
|
+
._1yt418y6{padding:var(--_1xumd0e)}
|
|
4
|
+
._2rkopd34{border-radius:var(--ds-border-radius-200,8px)}
|
|
5
|
+
._zulp1jvo{gap:1.25rem 0}
|
|
6
|
+
._zulp1qos{gap:.5rem 0}
|
|
7
|
+
._zulpfzsm{gap:.25rem 0}
|
|
8
|
+
._zulph3jc{gap:1rem 0}
|
|
9
|
+
._19bv15sf{padding-left:calc(var(--preview-block-width) + 1.25rem)}
|
|
10
|
+
._19bv1ltm{padding-left:calc(var(--preview-block-width) + .25rem)}
|
|
11
|
+
._19bvf557{padding-left:calc(var(--preview-block-width) + 1rem)}
|
|
12
|
+
._19bvqox2{padding-left:calc(var(--preview-block-width) + .5rem)}
|
|
13
|
+
._1e0c1txw{display:flex}
|
|
14
|
+
._1pcmkb7n:hover~.actions-button-group{opacity:1}
|
|
15
|
+
._1reo15vq{overflow-x:hidden}
|
|
16
|
+
._1t4ckb7n .has-action, ._1nxdkb7n a, ._xnbykb7n button{z-index:1}
|
|
17
|
+
._1ul9idpf{min-width:0}
|
|
18
|
+
._1yob1j6v{--container-gap-right:1rem}
|
|
19
|
+
._1yob1k92{--container-gap-right:1.25rem}
|
|
20
|
+
._1yob1kwk{--container-gap-right:.5rem}
|
|
21
|
+
._1yob1wow{--container-gap-right:var(--_12k13bg)}
|
|
22
|
+
._1yob6mu8{--container-gap-right:.25rem}
|
|
23
|
+
._2lx21bp4{flex-direction:column}
|
|
24
|
+
._bfhkhp5a{background-color:var(--ds-surface-raised,#fff)}
|
|
25
|
+
._jb7v18y6{--container-padding:var(--_1xumd0e)}
|
|
26
|
+
._kqswh2mm{position:relative}
|
|
27
|
+
._nqwih2mm .has-action, ._18ywh2mm a, ._1nq3h2mm button{position:relative}
|
|
28
|
+
._r37x1r5k{--preview-block-width:30%}
|
|
29
|
+
._u5f315sf{padding-right:calc(var(--preview-block-width) + 1.25rem)}
|
|
30
|
+
._u5f31ltm{padding-right:calc(var(--preview-block-width) + .25rem)}
|
|
31
|
+
._u5f3f557{padding-right:calc(var(--preview-block-width) + 1rem)}
|
|
32
|
+
._u5f3qox2{padding-right:calc(var(--preview-block-width) + .5rem)}
|
|
33
|
+
._y5vk167t{--container-gap-left:var(--_73mooq)}
|
|
34
|
+
._y5vk1j6v{--container-gap-left:1rem}
|
|
35
|
+
._y5vk1k92{--container-gap-left:1.25rem}
|
|
36
|
+
._y5vk1kwk{--container-gap-left:.5rem}
|
|
37
|
+
._y5vk6mu8{--container-gap-left:.25rem}
|
|
38
|
+
._1v7y1i6y .has-action:focus, ._ufn21i6y a:focus{outline-offset:var(--ds-space-negative-025,-2px)}
|