@atlaskit/smart-card 34.1.0 → 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.
Files changed (90) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/EmbedCard/components/IFrame.js +6 -3
  4. package/dist/cjs/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
  5. package/dist/cjs/view/EmbedModal/components/embed-content/index.js +23 -14
  6. package/dist/cjs/view/EmbedModal/components/embed-content/indexOld.js +37 -0
  7. package/dist/cjs/view/EmbedModal/components/link-info/index.compiled.css +35 -0
  8. package/dist/cjs/view/EmbedModal/components/link-info/index.js +58 -49
  9. package/dist/cjs/view/EmbedModal/components/link-info/indexOld.js +131 -0
  10. package/dist/cjs/view/FlexibleCard/components/common/image-icon/index.js +9 -11
  11. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.js +52 -0
  12. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +15 -0
  13. package/dist/cjs/view/FlexibleCard/components/common/loading-skeleton/index.js +27 -38
  14. package/dist/cjs/view/FlexibleCard/components/container/index.compiled.css +38 -0
  15. package/dist/cjs/view/FlexibleCard/components/container/index.js +94 -87
  16. package/dist/cjs/view/FlexibleCard/components/container/indexOld.js +226 -0
  17. package/dist/cjs/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +75 -0
  18. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
  19. package/dist/cjs/view/FlexibleCard/components/container/layered-link/index.js +20 -46
  20. package/dist/cjs/view/LinkUrl/index.js +1 -1
  21. package/dist/es2019/utils/analytics/analytics.js +1 -1
  22. package/dist/es2019/view/EmbedCard/components/IFrame.js +5 -2
  23. package/dist/es2019/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
  24. package/dist/es2019/view/EmbedModal/components/embed-content/index.js +19 -13
  25. package/dist/es2019/view/EmbedModal/components/embed-content/indexOld.js +31 -0
  26. package/dist/es2019/view/EmbedModal/components/link-info/index.compiled.css +35 -0
  27. package/dist/es2019/view/EmbedModal/components/link-info/index.js +59 -49
  28. package/dist/es2019/view/EmbedModal/components/link-info/indexOld.js +122 -0
  29. package/dist/es2019/view/FlexibleCard/components/common/image-icon/index.js +6 -10
  30. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.js +46 -0
  31. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +15 -0
  32. package/dist/es2019/view/FlexibleCard/components/common/loading-skeleton/index.js +22 -37
  33. package/dist/es2019/view/FlexibleCard/components/container/index.compiled.css +38 -0
  34. package/dist/es2019/view/FlexibleCard/components/container/index.js +88 -105
  35. package/dist/es2019/view/FlexibleCard/components/container/indexOld.js +229 -0
  36. package/dist/es2019/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +69 -0
  37. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
  38. package/dist/es2019/view/FlexibleCard/components/container/layered-link/index.js +16 -45
  39. package/dist/es2019/view/LinkUrl/index.js +1 -1
  40. package/dist/esm/utils/analytics/analytics.js +1 -1
  41. package/dist/esm/view/EmbedCard/components/IFrame.js +6 -3
  42. package/dist/esm/view/EmbedModal/components/embed-content/index.compiled.css +2 -0
  43. package/dist/esm/view/EmbedModal/components/embed-content/index.js +19 -13
  44. package/dist/esm/view/EmbedModal/components/embed-content/indexOld.js +30 -0
  45. package/dist/esm/view/EmbedModal/components/link-info/index.compiled.css +35 -0
  46. package/dist/esm/view/EmbedModal/components/link-info/index.js +59 -49
  47. package/dist/esm/view/EmbedModal/components/link-info/indexOld.js +120 -0
  48. package/dist/esm/view/FlexibleCard/components/common/image-icon/index.js +6 -10
  49. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.js +45 -0
  50. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.compiled.css +15 -0
  51. package/dist/esm/view/FlexibleCard/components/common/loading-skeleton/index.js +23 -37
  52. package/dist/esm/view/FlexibleCard/components/container/index.compiled.css +38 -0
  53. package/dist/esm/view/FlexibleCard/components/container/index.js +88 -87
  54. package/dist/esm/view/FlexibleCard/components/container/indexOld.js +217 -0
  55. package/dist/esm/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.js +68 -0
  56. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.compiled.css +11 -0
  57. package/dist/esm/view/FlexibleCard/components/container/layered-link/index.js +16 -45
  58. package/dist/esm/view/LinkUrl/index.js +1 -1
  59. package/dist/types/view/EmbedCard/components/IFrame.d.ts +2 -1
  60. package/dist/types/view/EmbedModal/components/embed-content/index.d.ts +3 -7
  61. package/dist/types/view/EmbedModal/components/embed-content/indexOld.d.ts +8 -0
  62. package/dist/types/view/EmbedModal/components/link-info/index.d.ts +3 -3
  63. package/dist/types/view/EmbedModal/components/link-info/indexOld.d.ts +4 -0
  64. package/dist/types/view/FlexibleCard/components/common/image-icon/index.d.ts +2 -6
  65. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.d.ts +8 -0
  66. package/dist/types/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +2 -6
  67. package/dist/types/view/FlexibleCard/components/container/index.d.ts +10 -10
  68. package/dist/types/view/FlexibleCard/components/container/indexOld.d.ts +24 -0
  69. package/dist/types/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.d.ts +13 -0
  70. package/dist/types/view/FlexibleCard/components/container/layered-link/index.d.ts +2 -11
  71. package/dist/types/view/HoverCard/components/CustomPopupContainer.d.ts +1 -1
  72. package/dist/types-ts4.5/view/EmbedCard/components/IFrame.d.ts +2 -1
  73. package/dist/types-ts4.5/view/EmbedModal/components/embed-content/index.d.ts +3 -7
  74. package/dist/types-ts4.5/view/EmbedModal/components/embed-content/indexOld.d.ts +8 -0
  75. package/dist/types-ts4.5/view/EmbedModal/components/link-info/index.d.ts +3 -3
  76. package/dist/types-ts4.5/view/EmbedModal/components/link-info/indexOld.d.ts +4 -0
  77. package/dist/types-ts4.5/view/FlexibleCard/components/common/image-icon/index.d.ts +2 -6
  78. package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/LoadingSkeletonOld.d.ts +8 -0
  79. package/dist/types-ts4.5/view/FlexibleCard/components/common/loading-skeleton/index.d.ts +2 -6
  80. package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +10 -10
  81. package/dist/types-ts4.5/view/FlexibleCard/components/container/indexOld.d.ts +24 -0
  82. package/dist/types-ts4.5/view/FlexibleCard/components/container/layered-link/LayeredLinkOld.d.ts +13 -0
  83. package/dist/types-ts4.5/view/FlexibleCard/components/container/layered-link/index.d.ts +2 -11
  84. package/dist/types-ts4.5/view/HoverCard/components/CustomPopupContainer.d.ts +1 -1
  85. package/package.json +1 -1
  86. /package/dist/cjs/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
  87. /package/dist/es2019/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
  88. /package/dist/esm/view/EmbedModal/components/link-info/{styled.js → styledOld.js} +0 -0
  89. /package/dist/types/view/EmbedModal/components/link-info/{styled.d.ts → styledOld.d.ts} +0 -0
  90. /package/dist/types-ts4.5/view/EmbedModal/components/link-info/{styled.d.ts → styledOld.d.ts} +0 -0
@@ -0,0 +1,69 @@
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 { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
8
+ const styles = css({
9
+ // Stretch the invisible link over the whole of the post.
10
+ // Hide the link’s text.
11
+ top: 0,
12
+ right: 0,
13
+ bottom: 0,
14
+ left: 0,
15
+ overflow: 'hidden',
16
+ textIndent: '100%',
17
+ whiteSpace: 'nowrap',
18
+ // Needs a heightened specificity to trump other anchor.
19
+ // Stack it under all other links in the post text.
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
+ 'a&.layered-link': {
22
+ position: 'absolute',
23
+ zIndex: 0
24
+ },
25
+ // When hovering over the layered link, any hidden action buttons inside
26
+ // the Container should become visible.
27
+ // As actions resides inside blocks and layered link is expected to be
28
+ // on the same level of blocks. That makes the blocks, e.g. TitleBlock,
29
+ // its sibling. Using general sibling combinator here to apply styling to
30
+ // all the siblings of layered link.
31
+ // The general sibling combinator (~) separates two selectors and matches all
32
+ // iterations of the second element, that are following the first element
33
+ // (though not necessarily immediately), and are children of the same parent
34
+ // element.
35
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
36
+ '&:hover ~ *': {
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
38
+ '.actions-button-group': {
39
+ opacity: 1
40
+ }
41
+ }
42
+ });
43
+
44
+ /**
45
+ * An anchor component to cover the entire container creating a clickable area.
46
+ * @internal
47
+ * @see `clickableContainer`
48
+ */
49
+ const LayeredLinkOld = ({
50
+ onClick,
51
+ target,
52
+ testId,
53
+ text,
54
+ url
55
+ }) => {
56
+ const onMouseDown = useMouseDownEvent();
57
+ return jsx("a", {
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
59
+ className: "layered-link",
60
+ css: styles,
61
+ "data-testid": `${testId}-layered-link`,
62
+ href: url,
63
+ onClick: onClick,
64
+ onMouseDown: onMouseDown,
65
+ target: target,
66
+ tabIndex: -1 // Hide tab index and let the title link be the link.
67
+ }, text);
68
+ };
69
+ export default LayeredLinkOld;
@@ -0,0 +1,11 @@
1
+ ._154iidpf{top:0}
2
+ ._18m915vq{overflow-y:hidden}
3
+ ._1ltvidpf{left:0}
4
+ ._1reo15vq{overflow-x:hidden}
5
+ ._1xi2idpf{right:0}
6
+ ._94n5idpf{bottom:0}
7
+ ._a52dkb7n:hover~* .actions-button-group{opacity:1}
8
+ ._azhw1osq{text-indent:100%}
9
+ ._o5721q9c{white-space:nowrap}
10
+ a._hboxstnw.layered-link{position:absolute}
11
+ a._obkmidpf.layered-link{z-index:0}
@@ -1,52 +1,18 @@
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';
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import "./index.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
8
- const styles = css({
9
- // Stretch the invisible link over the whole of the post.
10
- // Hide the link’s text.
11
- top: 0,
12
- right: 0,
13
- bottom: 0,
14
- left: 0,
15
- overflow: 'hidden',
16
- textIndent: '100%',
17
- whiteSpace: 'nowrap',
18
- // Needs a heightened specificity to trump other anchor.
19
- // Stack it under all other links in the post text.
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
- 'a&.layered-link': {
22
- position: 'absolute',
23
- zIndex: 0
24
- },
25
- // When hovering over the layered link, any hidden action buttons inside
26
- // the Container should become visible.
27
- // As actions resides inside blocks and layered link is expected to be
28
- // on the same level of blocks. That makes the blocks, e.g. TitleBlock,
29
- // its sibling. Using general sibling combinator here to apply styling to
30
- // all the siblings of layered link.
31
- // The general sibling combinator (~) separates two selectors and matches all
32
- // iterations of the second element, that are following the first element
33
- // (though not necessarily immediately), and are children of the same parent
34
- // element.
35
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
36
- '&:hover ~ *': {
37
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
38
- '.actions-button-group': {
39
- opacity: 1
40
- }
41
- }
42
- });
7
+ import LayeredLinkOld from './LayeredLinkOld';
8
+ const styles = null;
43
9
 
44
10
  /**
45
11
  * An anchor component to cover the entire container creating a clickable area.
46
12
  * @internal
47
13
  * @see `clickableContainer`
48
14
  */
49
- const LayeredLink = ({
15
+ const LayeredLinkNew = ({
50
16
  onClick,
51
17
  target,
52
18
  testId,
@@ -54,10 +20,9 @@ const LayeredLink = ({
54
20
  url
55
21
  }) => {
56
22
  const onMouseDown = useMouseDownEvent();
57
- return jsx("a", {
23
+ return /*#__PURE__*/React.createElement("a", {
58
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
59
- className: "layered-link",
60
- css: styles,
25
+ className: ax(["_1reo15vq _18m915vq _154iidpf _1xi2idpf _94n5idpf _1ltvidpf _azhw1osq _o5721q9c _hboxstnw _obkmidpf _a52dkb7n", "layered-link"]),
61
26
  "data-testid": `${testId}-layered-link`,
62
27
  href: url,
63
28
  onClick: onClick,
@@ -66,4 +31,10 @@ const LayeredLink = ({
66
31
  tabIndex: -1 // Hide tab index and let the title link be the link.
67
32
  }, text);
68
33
  };
34
+ const LayeredLink = props => {
35
+ if (fg('bandicoots-compiled-migration-smartcard')) {
36
+ return /*#__PURE__*/React.createElement(LayeredLinkNew, props);
37
+ }
38
+ return /*#__PURE__*/React.createElement(LayeredLinkOld, props);
39
+ };
69
40
  export default LayeredLink;
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "34.1.0",
13
+ packageVersion: "34.2.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "34.1.0"
7
+ packageVersion: "34.2.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -1,15 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["childRef"];
3
+ var _excluded = ["childRef", "className"];
4
4
  import React from 'react';
5
5
  /**
6
6
  * Iframe element isolated for DI purposes
7
7
  */
8
8
  export var IFrame = function IFrame(_ref) {
9
9
  var childRef = _ref.childRef,
10
+ className = _ref.className,
10
11
  props = _objectWithoutProperties(_ref, _excluded);
11
- // eslint-disable-next-line jsx-a11y/iframe-has-title
12
- return /*#__PURE__*/React.createElement("iframe", _extends({}, props, {
12
+ // eslint-disable-next-line jsx-a11y/iframe-has-title,@atlaskit/ui-styling-standard/no-classname-prop
13
+ return /*#__PURE__*/React.createElement("iframe", _extends({
14
+ className: className
15
+ }, props, {
13
16
  ref: childRef
14
17
  }));
15
18
  };
@@ -0,0 +1,2 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._4t3i815d{height:calc(100vh - 13pc)}
@@ -1,16 +1,14 @@
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';
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
- var iframeCss = css({
11
- width: '100%',
12
- height: 'calc(100vh - 208px)'
13
- });
10
+ import EmbedContentOld from './indexOld';
11
+ var iframeCss = null;
14
12
  var EmbedContent = function EmbedContent(_ref) {
15
13
  var isTrusted = _ref.isTrusted,
16
14
  name = _ref.name,
@@ -18,13 +16,21 @@ var EmbedContent = function EmbedContent(_ref) {
18
16
  testId = _ref.testId;
19
17
  var sandbox = getIframeSandboxAttribute(isTrusted);
20
18
  var props = {
21
- css: iframeCss,
22
19
  frameBorder: 0,
23
20
  name: name,
24
21
  sandbox: sandbox,
25
22
  src: src,
26
23
  'data-testid': "".concat(testId, "-embed")
27
24
  };
28
- return jsx(IFrame, props);
25
+ return /*#__PURE__*/React.createElement(IFrame, _extends({}, props, {
26
+ className: ax(["_1bsb1osq _4t3i815d"])
27
+ }));
29
28
  };
30
- export default EmbedContent;
29
+ var Exported = function Exported(props) {
30
+ if (fg('bandicoots-compiled-migration-smartcard')) {
31
+ return /*#__PURE__*/React.createElement(EmbedContent, props);
32
+ } else {
33
+ return /*#__PURE__*/React.createElement(EmbedContentOld, props);
34
+ }
35
+ };
36
+ export default Exported;
@@ -0,0 +1,30 @@
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
+ var iframeCss = css({
11
+ width: '100%',
12
+ height: 'calc(100vh - 208px)'
13
+ });
14
+ var EmbedContent = function EmbedContent(_ref) {
15
+ var isTrusted = _ref.isTrusted,
16
+ name = _ref.name,
17
+ src = _ref.src,
18
+ testId = _ref.testId;
19
+ var sandbox = getIframeSandboxAttribute(isTrusted);
20
+ var props = {
21
+ css: iframeCss,
22
+ frameBorder: 0,
23
+ name: name,
24
+ sandbox: sandbox,
25
+ src: src,
26
+ 'data-testid': "".concat(testId, "-embed")
27
+ };
28
+ return jsx(IFrame, props);
29
+ };
30
+ 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
- * @jsxRuntime classic
3
- * @jsx jsx
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
- import { actionCss, containerStyles, iconCss, titleCss } from './styled';
21
+ var containerStyles = null;
22
+ var 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
+ var iconCss = null;
28
+ var height = '20px';
29
+ var titleCss = null;
30
+ var actionCss = null;
24
31
  var LinkInfo = function LinkInfo(_ref) {
25
32
  var icon = _ref.icon,
26
33
  providerName = _ref.providerName,
@@ -34,9 +41,9 @@ var LinkInfo = function LinkInfo(_ref) {
34
41
  onClose = _useModal.onClose;
35
42
  var downloadButton = useMemo(function () {
36
43
  if (onDownloadButtonClick) {
37
- return jsx(LinkInfoButton, {
38
- content: jsx(FormattedMessage, messages.download),
39
- icon: jsx(DownloadIcon, {
44
+ return /*#__PURE__*/React.createElement(LinkInfoButton, {
45
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.download),
46
+ icon: /*#__PURE__*/React.createElement(DownloadIcon, {
40
47
  label: messages.download.defaultMessage,
41
48
  LEGACY_fallbackIcon: DownloadIconLegacy,
42
49
  spacing: "spacious",
@@ -49,10 +56,10 @@ var LinkInfo = function LinkInfo(_ref) {
49
56
  }, [onDownloadButtonClick, testId]);
50
57
  var urlButton = useMemo(function () {
51
58
  if (onViewButtonClick) {
52
- var content = providerName ? jsx(React.Fragment, null, jsx(FormattedMessage, messages.viewIn), " ", providerName) : jsx(FormattedMessage, messages.viewOriginal);
53
- return jsx(LinkInfoButton, {
59
+ var content = providerName ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.viewIn), " ", providerName) : /*#__PURE__*/React.createElement(FormattedMessage, messages.viewOriginal);
60
+ return /*#__PURE__*/React.createElement(LinkInfoButton, {
54
61
  content: content,
55
- icon: jsx(ShortcutIcon, {
62
+ icon: /*#__PURE__*/React.createElement(ShortcutIcon, {
56
63
  label: messages.viewOriginal.defaultMessage,
57
64
  spacing: "spacious",
58
65
  color: "currentColor"
@@ -65,56 +72,59 @@ var LinkInfo = function LinkInfo(_ref) {
65
72
  var sizeButton = useMemo(function () {
66
73
  var isFullScreen = size === MAX_MODAL_SIZE;
67
74
  var message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
68
- var icon = isFullScreen ? jsx(FullscreenExitIcon, {
75
+ var icon = isFullScreen ? /*#__PURE__*/React.createElement(FullscreenExitIcon, {
69
76
  LEGACY_fallbackIcon: VidFullScreenOffIcon,
70
77
  label: message.defaultMessage,
71
78
  spacing: "spacious",
72
79
  color: "currentColor"
73
- }) : jsx(VidFullScreenOnIcon, {
80
+ }) : /*#__PURE__*/React.createElement(VidFullScreenOnIcon, {
74
81
  label: message.defaultMessage,
75
82
  spacing: "spacious",
76
83
  color: "currentColor"
77
84
  });
78
85
  return (
86
+ /*#__PURE__*/
79
87
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
80
- jsx("span", {
88
+ React.createElement("span", {
81
89
  className: "smart-link-resize-button"
82
- }, jsx(LinkInfoButton, {
83
- content: jsx(FormattedMessage, message),
90
+ }, /*#__PURE__*/React.createElement(LinkInfoButton, {
91
+ content: /*#__PURE__*/React.createElement(FormattedMessage, message),
84
92
  icon: icon,
85
93
  onClick: onResizeButtonClick,
86
94
  testId: "".concat(testId, "-resize")
87
95
  }))
88
96
  );
89
97
  }, [onResizeButtonClick, size, testId]);
90
- return (
91
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
92
- jsx("div", {
93
- css: containerStyles
94
- }, icon &&
95
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
96
- jsx("div", {
97
- css: iconCss,
98
- "data-testid": "".concat(testId, "-icon")
99
- }, jsx(Icon, icon)), jsx("div", {
100
- css: titleCss
101
- }, jsx(Heading, {
102
- size: "medium",
103
- testId: "".concat(testId, "-title")
104
- }, title), jsx("span", {
105
- tabIndex: 0
106
- })), jsx("div", {
107
- css: actionCss
108
- }, downloadButton, urlButton, sizeButton, jsx(LinkInfoButton, {
109
- content: jsx(FormattedMessage, messages.preview_close),
110
- icon: jsx(CrossIcon, {
111
- label: messages.preview_close.defaultMessage,
112
- color: "currentColor",
113
- spacing: "spacious"
114
- }),
115
- onClick: onClose,
116
- testId: "".concat(testId, "-close")
117
- })))
118
- );
98
+ return /*#__PURE__*/React.createElement("div", {
99
+ className: ax(["_zulpu2gc _4cvr1h6o _1e0c1txw _1bah1yb4 _ca0q1ejb _u5f31ejb _n3tddlk8 _19bv1ejb"])
100
+ }, icon && /*#__PURE__*/React.createElement("div", {
101
+ "data-testid": "".concat(testId, "-icon"),
102
+ 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"])
103
+ }, /*#__PURE__*/React.createElement(Icon, icon)), /*#__PURE__*/React.createElement("div", {
104
+ className: ax(["_16jlkb7n _1o9zkb7n _i0dl1wug _yrj2kb7n _1wkfkb7n _923e1wug _1umo1bk4 _101p15vq _12bo15vq _r8nti7a9 _1flvcj1k _4wztidpf _c7bk1l2s _1r7d1hna _uepwkb7n _shpw1e54 _130wgktf"])
105
+ }, /*#__PURE__*/React.createElement(Heading, {
106
+ size: "medium",
107
+ testId: "".concat(testId, "-title")
108
+ }, title), /*#__PURE__*/React.createElement("span", {
109
+ tabIndex: 0
110
+ })), /*#__PURE__*/React.createElement("div", {
111
+ className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _1e0c1txw _3kllglyw"])
112
+ }, downloadButton, urlButton, sizeButton, /*#__PURE__*/React.createElement(LinkInfoButton, {
113
+ content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
114
+ icon: /*#__PURE__*/React.createElement(CrossIcon, {
115
+ label: messages.preview_close.defaultMessage,
116
+ color: "currentColor",
117
+ spacing: "spacious"
118
+ }),
119
+ onClick: onClose,
120
+ testId: "".concat(testId, "-close")
121
+ })));
122
+ };
123
+ var Exported = function Exported(props) {
124
+ if (fg('bandicoots-compiled-migration-smartcard')) {
125
+ return /*#__PURE__*/React.createElement(LinkInfo, props);
126
+ } else {
127
+ return /*#__PURE__*/React.createElement(LinkInfoOld, props);
128
+ }
119
129
  };
120
- export default LinkInfo;
130
+ export default Exported;
@@ -0,0 +1,120 @@
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
+ var LinkInfo = function LinkInfo(_ref) {
25
+ var icon = _ref.icon,
26
+ providerName = _ref.providerName,
27
+ onDownloadButtonClick = _ref.onDownloadButtonClick,
28
+ onResizeButtonClick = _ref.onResizeButtonClick,
29
+ onViewButtonClick = _ref.onViewButtonClick,
30
+ size = _ref.size,
31
+ testId = _ref.testId,
32
+ title = _ref.title;
33
+ var _useModal = useModal(),
34
+ onClose = _useModal.onClose;
35
+ var downloadButton = useMemo(function () {
36
+ if (onDownloadButtonClick) {
37
+ return jsx(LinkInfoButton, {
38
+ content: jsx(FormattedMessage, messages.download),
39
+ icon: jsx(DownloadIcon, {
40
+ label: messages.download.defaultMessage,
41
+ LEGACY_fallbackIcon: DownloadIconLegacy,
42
+ spacing: "spacious",
43
+ color: "currentColor"
44
+ }),
45
+ onClick: onDownloadButtonClick,
46
+ testId: "".concat(testId, "-download")
47
+ });
48
+ }
49
+ }, [onDownloadButtonClick, testId]);
50
+ var urlButton = useMemo(function () {
51
+ if (onViewButtonClick) {
52
+ var content = providerName ? jsx(React.Fragment, null, jsx(FormattedMessage, messages.viewIn), " ", providerName) : jsx(FormattedMessage, messages.viewOriginal);
53
+ return jsx(LinkInfoButton, {
54
+ content: content,
55
+ icon: jsx(ShortcutIcon, {
56
+ label: messages.viewOriginal.defaultMessage,
57
+ spacing: "spacious",
58
+ color: "currentColor"
59
+ }),
60
+ onClick: onViewButtonClick,
61
+ testId: "".concat(testId, "-url")
62
+ });
63
+ }
64
+ }, [onViewButtonClick, providerName, testId]);
65
+ var sizeButton = useMemo(function () {
66
+ var isFullScreen = size === MAX_MODAL_SIZE;
67
+ var message = isFullScreen ? messages.preview_min_size : messages.preview_max_size;
68
+ var icon = isFullScreen ? jsx(FullscreenExitIcon, {
69
+ LEGACY_fallbackIcon: VidFullScreenOffIcon,
70
+ label: message.defaultMessage,
71
+ spacing: "spacious",
72
+ color: "currentColor"
73
+ }) : jsx(VidFullScreenOnIcon, {
74
+ label: message.defaultMessage,
75
+ spacing: "spacious",
76
+ color: "currentColor"
77
+ });
78
+ return (
79
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
80
+ jsx("span", {
81
+ className: "smart-link-resize-button"
82
+ }, jsx(LinkInfoButton, {
83
+ content: jsx(FormattedMessage, message),
84
+ icon: icon,
85
+ onClick: onResizeButtonClick,
86
+ testId: "".concat(testId, "-resize")
87
+ }))
88
+ );
89
+ }, [onResizeButtonClick, size, testId]);
90
+ return (
91
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
92
+ jsx("div", {
93
+ css: containerStyles
94
+ }, icon &&
95
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
96
+ jsx("div", {
97
+ css: iconCss,
98
+ "data-testid": "".concat(testId, "-icon")
99
+ }, jsx(Icon, icon)), jsx("div", {
100
+ css: titleCss
101
+ }, jsx(Heading, {
102
+ size: "medium",
103
+ testId: "".concat(testId, "-title")
104
+ }, title), jsx("span", {
105
+ tabIndex: 0
106
+ })), jsx("div", {
107
+ css: actionCss
108
+ }, downloadButton, urlButton, sizeButton, jsx(LinkInfoButton, {
109
+ content: jsx(FormattedMessage, messages.preview_close),
110
+ icon: jsx(CrossIcon, {
111
+ label: messages.preview_close.defaultMessage,
112
+ color: "currentColor",
113
+ spacing: "spacious"
114
+ }),
115
+ onClick: onClose,
116
+ testId: "".concat(testId, "-close")
117
+ })))
118
+ );
119
+ };
120
+ export default LinkInfo;
@@ -1,10 +1,6 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { jsx } from '@emotion/react';
1
+ /* index.tsx generated by @compiled/babel-plugin v0.35.0 */
2
+ import * as React from 'react';
3
+ import { ax, ix } from "@compiled/react/runtime";
8
4
  import ImageLoader from 'react-render-image';
9
5
  import LoadingSkeleton from '../loading-skeleton';
10
6
  var ImageIcon = function ImageIcon(_ref) {
@@ -13,14 +9,14 @@ var ImageIcon = function ImageIcon(_ref) {
13
9
  url = _ref.url,
14
10
  onError = _ref.onError,
15
11
  onLoad = _ref.onLoad;
16
- return jsx(ImageLoader, {
12
+ return /*#__PURE__*/React.createElement(ImageLoader, {
17
13
  src: url,
18
- loading: jsx(LoadingSkeleton, {
14
+ loading: /*#__PURE__*/React.createElement(LoadingSkeleton, {
19
15
  testId: "".concat(testId, "-loading")
20
16
  })
21
17
  // eslint-disable-next-line jsx-a11y/alt-text
22
18
  ,
23
- loaded: jsx("img", {
19
+ loaded: /*#__PURE__*/React.createElement("img", {
24
20
  src: url,
25
21
  "data-testid": "".concat(testId, "-image")
26
22
  }),