@atlaskit/renderer 92.0.1 → 93.0.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 (87) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/analytics/enums.js +1 -0
  3. package/dist/cjs/react/marks/alignment.js +11 -12
  4. package/dist/cjs/react/marks/breakout.js +7 -9
  5. package/dist/cjs/react/marks/link.js +13 -6
  6. package/dist/cjs/react/nodes/codeBlock.js +1 -1
  7. package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
  8. package/dist/cjs/react/nodes/embedCard.js +25 -33
  9. package/dist/cjs/react/nodes/heading-anchor.js +7 -6
  10. package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
  11. package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
  12. package/dist/cjs/react/nodes/panel.js +26 -16
  13. package/dist/cjs/react/nodes/table/sticky.js +51 -54
  14. package/dist/cjs/react/nodes/table.js +2 -10
  15. package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
  16. package/dist/cjs/ui/Expand.js +40 -20
  17. package/dist/cjs/ui/MediaCard.js +4 -14
  18. package/dist/cjs/ui/Renderer/index.js +37 -48
  19. package/dist/cjs/ui/Renderer/style.js +58 -63
  20. package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
  21. package/dist/cjs/ui/SortingIcon.js +8 -9
  22. package/dist/cjs/ui/renderer-props.js +1 -3
  23. package/dist/cjs/version.json +1 -1
  24. package/dist/es2019/analytics/enums.js +1 -0
  25. package/dist/es2019/react/marks/alignment.js +15 -7
  26. package/dist/es2019/react/marks/breakout.js +6 -5
  27. package/dist/es2019/react/marks/link.js +8 -5
  28. package/dist/es2019/react/nodes/codeBlock.js +1 -1
  29. package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
  30. package/dist/es2019/react/nodes/embedCard.js +16 -16
  31. package/dist/es2019/react/nodes/heading-anchor.js +9 -6
  32. package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
  33. package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
  34. package/dist/es2019/react/nodes/panel.js +23 -16
  35. package/dist/es2019/react/nodes/table/sticky.js +48 -41
  36. package/dist/es2019/react/nodes/table.js +2 -5
  37. package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
  38. package/dist/es2019/ui/Expand.js +52 -28
  39. package/dist/es2019/ui/MediaCard.js +3 -6
  40. package/dist/es2019/ui/Renderer/index.js +37 -42
  41. package/dist/es2019/ui/Renderer/style.js +363 -336
  42. package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
  43. package/dist/es2019/ui/SortingIcon.js +9 -7
  44. package/dist/es2019/ui/renderer-props.js +1 -1
  45. package/dist/es2019/version.json +1 -1
  46. package/dist/esm/analytics/enums.js +1 -0
  47. package/dist/esm/react/marks/alignment.js +13 -6
  48. package/dist/esm/react/marks/breakout.js +6 -5
  49. package/dist/esm/react/marks/link.js +7 -5
  50. package/dist/esm/react/nodes/codeBlock.js +1 -1
  51. package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
  52. package/dist/esm/react/nodes/embedCard.js +19 -19
  53. package/dist/esm/react/nodes/heading-anchor.js +8 -6
  54. package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
  55. package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
  56. package/dist/esm/react/nodes/panel.js +27 -15
  57. package/dist/esm/react/nodes/table/sticky.js +53 -52
  58. package/dist/esm/react/nodes/table.js +2 -8
  59. package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
  60. package/dist/esm/ui/Expand.js +45 -21
  61. package/dist/esm/ui/MediaCard.js +3 -9
  62. package/dist/esm/ui/Renderer/index.js +38 -46
  63. package/dist/esm/ui/Renderer/style.js +55 -56
  64. package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
  65. package/dist/esm/ui/SortingIcon.js +9 -7
  66. package/dist/esm/ui/renderer-props.js +1 -1
  67. package/dist/esm/version.json +1 -1
  68. package/dist/types/analytics/enums.d.ts +1 -0
  69. package/dist/types/analytics/events.d.ts +7 -2
  70. package/dist/types/react/marks/alignment.d.ts +2 -2
  71. package/dist/types/react/marks/breakout.d.ts +4 -3
  72. package/dist/types/react/marks/link.d.ts +2 -2
  73. package/dist/types/react/nodes/embedCard.d.ts +3 -2
  74. package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
  75. package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
  76. package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
  77. package/dist/types/react/nodes/panel.d.ts +3 -1
  78. package/dist/types/react/nodes/table/sticky.d.ts +4 -2
  79. package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
  80. package/dist/types/ui/Expand.d.ts +2 -2
  81. package/dist/types/ui/MediaCard.d.ts +1 -3
  82. package/dist/types/ui/Renderer/index.d.ts +0 -25
  83. package/dist/types/ui/Renderer/style.d.ts +1 -4
  84. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
  85. package/dist/types/ui/SortingIcon.d.ts +3 -3
  86. package/dist/types/ui/renderer-props.d.ts +14 -2
  87. package/package.json +17 -19
@@ -1,28 +1,39 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
2
3
  import { Component } from 'react';
3
- import styled from 'styled-components';
4
- const FadeOut = styled.div`
4
+
5
+ const fadeOutStyles = (maxHeight, top, backgroundColor) => css`
5
6
  position: relative;
6
7
  overflow-y: hidden;
7
- max-height: ${({
8
- height
9
- }) => height}px;
8
+ max-height: ${maxHeight}px;
10
9
  &::after {
11
10
  content: '';
12
11
  position: absolute;
13
- top: ${({
14
- height,
15
- fadeHeight
16
- }) => height - fadeHeight}px;
12
+ top: ${top}px;
17
13
  bottom: 0;
18
14
  left: 0;
19
15
  right: 0;
20
- /* Using 'rgba(255, 255, 255, 0)' because 'transparent' breaks the gradient in Safari 11 */
21
- background-image: ${({
22
- backgroundColor
23
- }) => `linear-gradient(rgba(255, 255, 255, 0), ${backgroundColor})`};
16
+ background-image: linear-gradient(
17
+ rgba(255, 255, 255, 0),
18
+ ${backgroundColor}
19
+ );
24
20
  }
25
21
  `;
22
+
23
+ const FadeOut = props => {
24
+ const {
25
+ children,
26
+ backgroundColor,
27
+ fadeHeight,
28
+ height
29
+ } = props;
30
+ const top = height - fadeHeight;
31
+ const styles = fadeOutStyles(height, top, backgroundColor);
32
+ return jsx("div", {
33
+ css: styles
34
+ }, children);
35
+ };
36
+
26
37
  export class TruncatedWrapper extends Component {
27
38
  constructor(props) {
28
39
  super(props);
@@ -35,7 +46,7 @@ export class TruncatedWrapper extends Component {
35
46
  backgroundColor = 'white',
36
47
  children
37
48
  } = this.props;
38
- return /*#__PURE__*/React.createElement(FadeOut, {
49
+ return jsx(FadeOut, {
39
50
  height: height,
40
51
  fadeHeight: fadeHeight,
41
52
  backgroundColor: backgroundColor
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
3
  import Tooltip from '@atlaskit/tooltip';
4
4
  import { gridSize } from '@atlaskit/theme/constants';
5
5
  import { N20, N30 } from '@atlaskit/theme/colors';
@@ -20,7 +20,7 @@ export let StatusClassNames;
20
20
  StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
21
21
  })(StatusClassNames || (StatusClassNames = {}));
22
22
 
23
- const Wrapper = styled.figure`
23
+ const wrapperStyles = css`
24
24
  position: absolute;
25
25
  display: flex;
26
26
  height: 28px;
@@ -42,7 +42,7 @@ const Wrapper = styled.figure`
42
42
  cursor: not-allowed;
43
43
  }
44
44
  `;
45
- const TableSortingIcon = styled.div`
45
+ const tableSortingIconStyles = css`
46
46
  width: 8px;
47
47
  height: 12px;
48
48
  transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);
@@ -105,13 +105,15 @@ const SortingIcon = ({
105
105
  const activated = sortOrdered !== SortOrder.NO_ORDER;
106
106
  const wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
107
107
  const content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
108
- return /*#__PURE__*/React.createElement(Tooltip, {
108
+ return jsx(Tooltip, {
109
109
  delay: 0,
110
110
  content: content,
111
111
  position: "top"
112
- }, /*#__PURE__*/React.createElement(Wrapper, {
112
+ }, jsx("figure", {
113
+ css: wrapperStyles,
113
114
  className: wrapperClassName
114
- }, /*#__PURE__*/React.createElement(TableSortingIcon, {
115
+ }, jsx("div", {
116
+ css: tableSortingIconStyles,
115
117
  className: `${getClassName(sortOrdered)} ${TABLE_SORTING_ICON_CLASS}-${activated ? 'active' : 'inactive'}`
116
118
  })));
117
119
  };
@@ -1 +1 @@
1
- export {};
1
+ import { ACTION_SUBJECT } from '../analytics/enums';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "92.0.1",
3
+ "version": "93.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -12,6 +12,7 @@ export var ACTION;
12
12
  (function (ACTION) {
13
13
  ACTION["STARTED"] = "started";
14
14
  ACTION["RENDERED"] = "rendered";
15
+ ACTION["RE_RENDERED"] = "reRendered";
15
16
  ACTION["RENDERER_TTI"] = "tti";
16
17
  ACTION["CRASHED"] = "unhandledErrorCaught";
17
18
  ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
@@ -1,15 +1,22 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
3
 
3
- var _templateObject, _templateObject2;
4
+ var _templateObject;
4
5
 
6
+ /** @jsx jsx */
5
7
  import React from 'react';
6
- import styled, { css } from 'styled-components';
8
+ import { css, jsx } from '@emotion/react';
7
9
  import { alignmentPositionMap } from '@atlaskit/adf-schema';
8
- var MarkWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", ";\n"])), function (props) {
9
- return props['data-align'] && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-align: ", ";\n "])), alignmentPositionMap[props['data-align']]);
10
- });
10
+
11
+ var MarkWrapper = function MarkWrapper(props) {
12
+ var styles = props['data-align'] ? css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n text-align: ", ";\n "])), alignmentPositionMap[props['data-align']]) : '';
13
+ return jsx("div", _extends({
14
+ css: styles
15
+ }, props), props.children);
16
+ };
17
+
11
18
  export default function Alignment(props) {
12
- return /*#__PURE__*/React.createElement(MarkWrapper, {
19
+ return jsx(MarkWrapper, {
13
20
  className: "fabric-editor-block-mark",
14
21
  "data-align": props.align
15
22
  }, props.children);
@@ -2,16 +2,17 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject;
4
4
 
5
- import React from 'react';
6
- import styled from 'styled-components';
5
+ /** @jsx jsx */
6
+ import { css, jsx } from '@emotion/react';
7
7
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
8
8
  import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
9
9
  import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
10
- export var Wrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: ", " 0;\n margin-left: 50%;\n transform: translateX(-50%);\n"])), blockNodesVerticalMargin);
10
+ export var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: ", " 0;\n margin-left: 50%;\n transform: translateX(-50%);\n"])), blockNodesVerticalMargin);
11
11
  export default function Breakout(props) {
12
- return /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref) {
12
+ return jsx(WidthConsumer, null, function (_ref) {
13
13
  var width = _ref.width;
14
- return /*#__PURE__*/React.createElement(Wrapper, {
14
+ return jsx("div", {
15
+ css: wrapperStyles,
15
16
  "data-mode": props.mode,
16
17
  style: {
17
18
  width: calcBreakoutWidth(props.mode, width)
@@ -3,13 +3,14 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
3
3
 
4
4
  var _templateObject;
5
5
 
6
- import React from 'react';
6
+ /** @jsx jsx */
7
+ import React, { Fragment } from 'react';
8
+ import { css, jsx } from '@emotion/react';
7
9
  import { B400, B300 } from '@atlaskit/theme/colors';
8
- import styled from 'styled-components';
9
10
  import { getEventHandler } from '../../utils';
10
11
  import { PLATFORM, MODE } from '../../analytics/events';
11
12
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
12
- var StyledAnchor = styled.a(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), B400, B300);
13
+ var anchorStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), B400, B300);
13
14
  export default function Link(props) {
14
15
  var href = props.href,
15
16
  target = props.target,
@@ -30,10 +31,11 @@ export default function Link(props) {
30
31
  var handler = getEventHandler(eventHandlers, 'link');
31
32
 
32
33
  if (isMediaLink) {
33
- return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
34
+ return jsx(Fragment, null, props.children);
34
35
  }
35
36
 
36
- return /*#__PURE__*/React.createElement(StyledAnchor, _extends({
37
+ return jsx("a", _extends({
38
+ css: anchorStyles,
37
39
  onClick: function onClick(e) {
38
40
  if (fireAnalyticsEvent) {
39
41
  fireAnalyticsEvent({
@@ -15,7 +15,7 @@ import { useFeatureFlags } from '../../use-feature-flags';
15
15
  import CopyButton from './codeBlockCopyButton';
16
16
 
17
17
  var codeBlockStyle = function codeBlockStyle(props) {
18
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n\n "])), relativeFontSizeToBase16(fontSize()), overflowShadow({
18
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n }\n "])), relativeFontSizeToBase16(fontSize()), overflowShadow({
19
19
  background: themed({
20
20
  light: N20,
21
21
  dark: DN50
@@ -3,16 +3,17 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
3
3
 
4
4
  var _templateObject;
5
5
 
6
+ /** @jsx jsx */
7
+ import { css, jsx } from '@emotion/react';
6
8
  import React, { useState } from 'react';
7
9
  import { injectIntl } from 'react-intl-next';
8
- import styled from 'styled-components';
9
10
  import Tooltip from '@atlaskit/tooltip';
10
11
  import Button from '@atlaskit/button/custom-theme-button';
11
12
  import CopyIcon from '@atlaskit/icon/glyph/copy';
12
13
  import { N20, N30, N700 } from '@atlaskit/theme/colors';
13
14
  import { CopyTextConsumer } from './copy-text-provider';
14
15
  import { codeBlockCopyButtonMessages } from '../../messages';
15
- var CopyButtonWrapper = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: sticky;\n justify-content: flex-end;\n top: 0;\n\n button {\n position: absolute;\n display: flex;\n justify-content: center;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n border: 2px solid #ffffff;\n border-radius: 4px;\n background-color: ", ";\n color: rgb(66, 82, 110);\n }\n\n button:hover {\n background-color: ", ";\n }\n\n button.clicked {\n background-color: ", ";\n color: #ffffff !important;\n }\n"])), N20, N30, N700);
16
+ var copyButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: sticky;\n justify-content: flex-end;\n top: 0;\n\n button {\n position: absolute;\n display: flex;\n justify-content: center;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n border: 2px solid #fff;\n border-radius: 4px;\n background-color: ", ";\n color: rgb(66, 82, 110);\n }\n\n button:hover {\n background-color: ", ";\n }\n\n button.clicked {\n background-color: ", ";\n color: #fff !important;\n }\n"])), N20, N30, N700);
16
17
 
17
18
  var CopyButton = function CopyButton(_ref) {
18
19
  var content = _ref.content,
@@ -33,21 +34,23 @@ var CopyButton = function CopyButton(_ref) {
33
34
  setClassName('copy-to-clipboard');
34
35
  };
35
36
 
36
- return /*#__PURE__*/React.createElement(CopyTextConsumer, null, function (_ref2) {
37
+ return jsx(CopyTextConsumer, null, function (_ref2) {
37
38
  var copyTextToClipboard = _ref2.copyTextToClipboard;
38
- return /*#__PURE__*/React.createElement(CopyButtonWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
39
+ return jsx("span", {
40
+ css: copyButtonWrapperStyles
41
+ }, jsx(Tooltip, {
39
42
  content: tooltip,
40
43
  hideTooltipOnClick: false,
41
44
  position: "top"
42
- }, /*#__PURE__*/React.createElement("div", {
45
+ }, jsx("div", {
43
46
  onMouseLeave: onMouseLeave
44
- }, /*#__PURE__*/React.createElement(Button, {
47
+ }, jsx(Button, {
45
48
  className: className,
46
49
  "aria-label": tooltip,
47
50
  spacing: "compact",
48
51
  appearance: "subtle",
49
52
  "aria-haspopup": true,
50
- iconBefore: /*#__PURE__*/React.createElement(CopyIcon, {
53
+ iconBefore: jsx(CopyIcon, {
51
54
  label: tooltip
52
55
  }),
53
56
  onClick: function onClick() {
@@ -4,22 +4,18 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
4
4
 
5
5
  var _templateObject, _templateObject2;
6
6
 
7
- import React, { useMemo, useContext, useState, useRef } from 'react';
7
+ /** @jsx jsx */
8
+ import { css, jsx } from '@emotion/react';
9
+ import { useMemo, useContext, useState, useRef } from 'react';
8
10
  import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
9
11
  import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
10
12
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, getAkEditorFullPageMaxWidth } from '@atlaskit/editor-shared-styles';
11
13
  import { getPlatform } from '../../utils';
12
14
  import { CardErrorBoundary } from './fallback';
13
- import styled from 'styled-components';
14
15
  import { FullPagePadding } from '../../ui/Renderer/style';
15
16
  import { getCardClickHandler } from '../utils/getCardClickHandler';
16
- var EmbedCardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n > div {\n height: 100%;\n }\n\n .loader-wrapper {\n height: 100%;\n }\n\n margin: 0 auto;\n"])));
17
- EmbedCardWrapper.displayName = 'EmbedCardWrapper';
18
- var ExtendedEmbedCard = styled(UIMediaSingle)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n"])), function (_ref) {
19
- var layout = _ref.layout;
20
- return layout === 'full-width' || layout === 'wide' ? "\n margin-left: 50%;\n transform: translateX(-50%);\n " : "";
21
- });
22
- ExtendedEmbedCard.displayName = 'ExtendedEmbedCard';
17
+ var embedCardWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n\n > div {\n height: 100%;\n }\n\n .loader-wrapper {\n height: 100%;\n }\n\n margin: 0 auto;\n"])));
18
+ var uIMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
23
19
  export default function EmbedCard(props) {
24
20
  var url = props.url,
25
21
  data = props.data,
@@ -87,8 +83,8 @@ export default function EmbedCard(props) {
87
83
 
88
84
  var cardContext = useContext(CardContext);
89
85
 
90
- var onResolve = function onResolve(_ref2) {
91
- var resolvedAspectRatio = _ref2.aspectRatio;
86
+ var onResolve = function onResolve(_ref) {
87
+ var resolvedAspectRatio = _ref.aspectRatio;
92
88
  var hasPreviewOnResolve = !!(cardContext && url && cardContext.extractors.getPreview(url, platform));
93
89
 
94
90
  if (!hasPreviewOnResolve) {
@@ -98,9 +94,9 @@ export default function EmbedCard(props) {
98
94
  setAspectRatio(resolvedAspectRatio);
99
95
  };
100
96
 
101
- return /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref3) {
102
- var containerWidth = _ref3.width,
103
- breakpoint = _ref3.breakpoint;
97
+ return jsx(WidthConsumer, null, function (_ref2) {
98
+ var containerWidth = _ref2.width,
99
+ breakpoint = _ref2.breakpoint;
104
100
  var nonFullWidthSize = containerWidth;
105
101
  var isFullWidth = rendererAppearance === 'full-width';
106
102
 
@@ -117,12 +113,14 @@ export default function EmbedCard(props) {
117
113
  }
118
114
 
119
115
  var lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
120
- return /*#__PURE__*/React.createElement(CardErrorBoundary, _extends({
116
+ var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? uIMediaSingleLayoutStyles : '';
117
+ return jsx(CardErrorBoundary, _extends({
121
118
  unsupportedComponent: UnsupportedBlock
122
- }, cardProps), /*#__PURE__*/React.createElement(EmbedResizeMessageListener, {
119
+ }, cardProps), jsx(EmbedResizeMessageListener, {
123
120
  embedIframeRef: embedIframeRef,
124
121
  onHeightUpdate: setLiveHeight
125
- }, /*#__PURE__*/React.createElement(ExtendedEmbedCard, {
122
+ }, jsx(UIMediaSingle, {
123
+ css: uiMediaSingleStyles,
126
124
  layout: layout,
127
125
  width: originalWidth,
128
126
  containerWidth: containerWidth,
@@ -132,7 +130,9 @@ export default function EmbedCard(props) {
132
130
  nodeType: "embedCard",
133
131
  lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
134
132
  hasFallbackContainer: hasPreview
135
- }, /*#__PURE__*/React.createElement(EmbedCardWrapper, null, /*#__PURE__*/React.createElement("div", {
133
+ }, jsx("div", {
134
+ css: embedCardWrapperStyles
135
+ }, jsx("div", {
136
136
  className: "embedCardView-content-wrap",
137
137
  "data-embed-card": true,
138
138
  "data-layout": layout,
@@ -140,7 +140,7 @@ export default function EmbedCard(props) {
140
140
  "data-card-data": data ? JSON.stringify(data) : undefined,
141
141
  "data-card-url": url,
142
142
  "data-card-original-height": originalHeight
143
- }, /*#__PURE__*/React.createElement(Card, _extends({
143
+ }, jsx(Card, _extends({
144
144
  appearance: "embed"
145
145
  }, cardProps, {
146
146
  onResolve: onResolve,
@@ -19,8 +19,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
19
19
 
20
20
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
21
21
 
22
+ /** @jsx jsx */
22
23
  import React from 'react';
23
- import styled from 'styled-components';
24
+ import { css, jsx } from '@emotion/react';
24
25
  import { N200, N500, B400 } from '@atlaskit/theme/colors';
25
26
  import LinkIcon from '@atlaskit/icon/glyph/link';
26
27
  import Tooltip from '@atlaskit/tooltip';
@@ -31,12 +32,12 @@ var CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef(function (props, re
31
32
  var children = props.children,
32
33
  rest = _objectWithoutProperties(props, _excluded);
33
34
 
34
- return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
35
+ return jsx("span", _extends({}, rest, {
35
36
  className: HeadingAnchorWrapperClassName,
36
37
  ref: ref
37
38
  }), children);
38
39
  });
39
- var CopyAnchorButton = styled.button(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline;\n outline: none;\n background-color: transparent;\n border: none;\n color: ", ";\n cursor: pointer;\n right: 0;\n"])), N500);
40
+ var copyAnchorButtonStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline;\n outline: none;\n background-color: transparent;\n border: none;\n color: ", ";\n cursor: pointer;\n right: 0;\n"])), N500);
40
41
 
41
42
  var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
42
43
  _inherits(HeadingAnchor, _React$PureComponent);
@@ -117,11 +118,12 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
117
118
  });
118
119
 
119
120
  _defineProperty(_assertThisInitialized(_this), "renderAnchorButton", function () {
120
- return /*#__PURE__*/React.createElement(CopyAnchorButton, {
121
+ return jsx("button", {
122
+ css: copyAnchorButtonStyles,
121
123
  onMouseLeave: _this.resetMessage,
122
124
  onClick: _this.copyToClipboard,
123
125
  "aria-label": _this.state.tooltipMessage
124
- }, /*#__PURE__*/React.createElement(LinkIcon, {
126
+ }, jsx(LinkIcon, {
125
127
  label: _this.getCopyAriaLabel(),
126
128
  size: _this.props.level > 3 ? 'small' : 'medium',
127
129
  primaryColor: _this.state.isClicked ? B400 : N200
@@ -145,7 +147,7 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
145
147
  // We set the key to the message to ensure it remounts when the message
146
148
  // changes, so that it correctly repositions.
147
149
  // @see https://ecosystem.atlassian.net/projects/AK/queues/issue/AK-6548
148
- return /*#__PURE__*/React.createElement(Tooltip, {
150
+ return jsx(Tooltip, {
149
151
  tag: CopyAnchorWrapperWithRef,
150
152
  content: tooltipMessage,
151
153
  position: "top",
@@ -1,12 +1,15 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import { default as React } from 'react';
2
+
3
+ /** @jsx jsx */
4
+ import { default as React, Fragment } from 'react';
5
+ import { jsx } from '@emotion/react';
3
6
  import { injectIntl } from 'react-intl-next';
4
7
  import { getMediaFeatureFlag } from '@atlaskit/media-common';
5
- import { mapBreakpointToLayoutMaxWidth, getBreakpoint, WidthConsumer } from '@atlaskit/editor-common/ui';
8
+ import { mapBreakpointToLayoutMaxWidth, getBreakpoint, MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
6
9
  import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
7
10
  import { FullPagePadding } from '../../../ui/Renderer/style';
8
11
  import { useObservedWidth } from '../../hooks/use-observed-width';
9
- import { ExtendedUIMediaSingle } from './styles';
12
+ import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
10
13
  var DEFAULT_WIDTH = 250;
11
14
  var DEFAULT_HEIGHT = 200;
12
15
 
@@ -175,7 +178,9 @@ var MediaSingle = function MediaSingle(props) {
175
178
  disableOverlay: true,
176
179
  featureFlags: featureFlags
177
180
  });
178
- return /*#__PURE__*/React.createElement(ExtendedUIMediaSingle, {
181
+ var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? [uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles] : [uiMediaSingleBaseStyles];
182
+ return jsx(UIMediaSingle, {
183
+ css: uiMediaSingleStyles,
179
184
  handleMediaSingleRef: ref,
180
185
  layout: layout,
181
186
  width: width,
@@ -184,10 +189,10 @@ var MediaSingle = function MediaSingle(props) {
184
189
  containerWidth: containerWidth,
185
190
  pctWidth: pctWidth,
186
191
  fullWidthMode: isFullWidth
187
- }, /*#__PURE__*/React.createElement(React.Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
192
+ }, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
188
193
  };
189
194
 
190
- return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref3) {
195
+ return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : jsx(WidthConsumer, null, function (_ref3) {
191
196
  var width = _ref3.width,
192
197
  breakpoint = _ref3.breakpoint;
193
198
  return renderMediaSingle(width, breakpoint);
@@ -1,10 +1,8 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject;
3
+ var _templateObject, _templateObject2;
4
4
 
5
- import styled from 'styled-components';
6
- import { MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
7
- export var ExtendedUIMediaSingle = styled(UIMediaSingle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", " transition: all 0.1s linear;\n"])), function (_ref) {
8
- var layout = _ref.layout;
9
- return layout === 'full-width' || layout === 'wide' ? "\n margin-left: 50%;\n transform: translateX(-50%);\n " : "";
10
- });
5
+ /** @jsx jsx */
6
+ import { css } from '@emotion/react';
7
+ export var uiMediaSingleBaseStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: all 0.1s linear;\n"])));
8
+ export var uiMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
@@ -1,9 +1,11 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
3
 
3
- var _templateObject;
4
+ var _templateObject, _templateObject2;
4
5
 
6
+ /** @jsx jsx */
5
7
  import React from 'react';
6
- import styled from 'styled-components';
8
+ import { css, jsx } from '@emotion/react';
7
9
  import TipIcon from '@atlaskit/icon/glyph/editor/hint';
8
10
  import { PanelType } from '@atlaskit/adf-schema';
9
11
  import { PanelSharedCssClassName } from '@atlaskit/editor-common/styles';
@@ -14,16 +16,26 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
14
16
  import { themed } from '@atlaskit/theme';
15
17
  import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common/styles';
16
18
  import { PanelInfoIcon, PanelSuccessIcon, PanelNoteIcon, PanelWarningIcon, PanelErrorIcon } from '@atlaskit/editor-common/icons';
17
- var PanelStyled = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
18
- if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
19
- return '';
20
- } // Similar to mainDynamicStyles()
21
19
 
20
+ var PanelStyled = function PanelStyled(props) {
21
+ var styles = function styles(themeProps) {
22
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
23
+ };
24
+
25
+ if (props['data-panel-type'] === PanelType.CUSTOM && props.backgroundColor) {
26
+ styles = function styles(themeProps) {
27
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &[data-panel-type=", "] {\n background-color: ", ";\n ", ";\n }\n "])), PanelType.CUSTOM, props.backgroundColor, themed({
28
+ dark: getPanelBackgroundDarkModeColors
29
+ })(themeProps));
30
+ };
31
+ }
32
+
33
+ return jsx("div", _extends({
34
+ css: styles
35
+ }, props), props.children);
36
+ };
22
37
 
23
- return "\n &[data-panel-type=".concat(PanelType.CUSTOM, "] {\n background-color: ").concat(props.backgroundColor, ";\n ").concat(themed({
24
- dark: getPanelBackgroundDarkModeColors
25
- }), ";\n }\n ");
26
- });
38
+ PanelStyled.displayName = 'PanelStyled';
27
39
  var panelIcons = {
28
40
  info: PanelInfoIcon,
29
41
  success: PanelSuccessIcon,
@@ -50,7 +62,7 @@ var Panel = function Panel(props) {
50
62
  var getIcon = function getIcon() {
51
63
  if (panelType === PanelType.CUSTOM) {
52
64
  if (panelIcon && providers) {
53
- return /*#__PURE__*/React.createElement(EmojiItem, {
65
+ return jsx(EmojiItem, {
54
66
  id: panelIconId,
55
67
  text: panelIconText,
56
68
  shortName: panelIcon,
@@ -62,7 +74,7 @@ var Panel = function Panel(props) {
62
74
  }
63
75
 
64
76
  var Icon = panelIcons[panelType];
65
- return /*#__PURE__*/React.createElement(Icon, {
77
+ return jsx(Icon, {
66
78
  label: "Panel ".concat(panelType)
67
79
  });
68
80
  };
@@ -71,13 +83,13 @@ var Panel = function Panel(props) {
71
83
  var icon = getIcon();
72
84
 
73
85
  if (icon) {
74
- return /*#__PURE__*/React.createElement("div", {
86
+ return jsx("div", {
75
87
  className: PanelSharedCssClassName.icon
76
88
  }, icon);
77
89
  }
78
90
  };
79
91
 
80
- return /*#__PURE__*/React.createElement(PanelStyled, {
92
+ return jsx(PanelStyled, {
81
93
  className: PanelSharedCssClassName.prefix,
82
94
  "data-panel-type": panelType,
83
95
  "data-panel-color": panelColor,
@@ -85,7 +97,7 @@ var Panel = function Panel(props) {
85
97
  "data-panel-icon-id": panelIconId,
86
98
  "data-panel-icon-text": panelIconText,
87
99
  backgroundColor: panelColor
88
- }, renderIcon(), /*#__PURE__*/React.createElement("div", {
100
+ }, renderIcon(), jsx("div", {
89
101
  className: PanelSharedCssClassName.content
90
102
  }, children));
91
103
  };