@atlaskit/renderer 91.0.0 → 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 (113) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/cjs/analytics/enums.js +2 -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 +17 -16
  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/heading.js +4 -2
  11. package/dist/cjs/react/nodes/layoutColumn.js +7 -2
  12. package/dist/cjs/react/nodes/media.js +7 -6
  13. package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
  14. package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
  15. package/dist/cjs/react/nodes/panel.js +26 -16
  16. package/dist/cjs/react/nodes/table/sticky.js +63 -55
  17. package/dist/cjs/react/nodes/table.js +2 -10
  18. package/dist/cjs/react/utils/inject-props.js +33 -0
  19. package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
  20. package/dist/cjs/ui/Expand.js +52 -28
  21. package/dist/cjs/ui/MediaCard.js +4 -14
  22. package/dist/cjs/ui/Renderer/index.js +72 -64
  23. package/dist/cjs/ui/Renderer/style.js +62 -55
  24. package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
  25. package/dist/cjs/ui/SortingIcon.js +8 -9
  26. package/dist/cjs/ui/annotations/draft/component.js +22 -12
  27. package/dist/cjs/ui/annotations/element/mark.js +9 -5
  28. package/dist/cjs/ui/renderer-props.js +1 -3
  29. package/dist/cjs/version.json +1 -1
  30. package/dist/es2019/analytics/enums.js +2 -0
  31. package/dist/es2019/react/marks/alignment.js +15 -7
  32. package/dist/es2019/react/marks/breakout.js +6 -5
  33. package/dist/es2019/react/marks/link.js +8 -5
  34. package/dist/es2019/react/nodes/codeBlock.js +25 -23
  35. package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
  36. package/dist/es2019/react/nodes/embedCard.js +16 -16
  37. package/dist/es2019/react/nodes/heading-anchor.js +9 -6
  38. package/dist/es2019/react/nodes/heading.js +4 -2
  39. package/dist/es2019/react/nodes/layoutColumn.js +7 -3
  40. package/dist/es2019/react/nodes/media.js +9 -5
  41. package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
  42. package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
  43. package/dist/es2019/react/nodes/panel.js +23 -16
  44. package/dist/es2019/react/nodes/table/sticky.js +55 -37
  45. package/dist/es2019/react/nodes/table.js +2 -5
  46. package/dist/es2019/react/utils/inject-props.js +24 -0
  47. package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
  48. package/dist/es2019/ui/Expand.js +65 -36
  49. package/dist/es2019/ui/MediaCard.js +3 -6
  50. package/dist/es2019/ui/Renderer/index.js +72 -57
  51. package/dist/es2019/ui/Renderer/style.js +370 -327
  52. package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
  53. package/dist/es2019/ui/SortingIcon.js +9 -7
  54. package/dist/es2019/ui/annotations/draft/component.js +18 -12
  55. package/dist/es2019/ui/annotations/element/mark.js +12 -6
  56. package/dist/es2019/ui/renderer-props.js +1 -1
  57. package/dist/es2019/version.json +1 -1
  58. package/dist/esm/analytics/enums.js +2 -0
  59. package/dist/esm/react/marks/alignment.js +13 -6
  60. package/dist/esm/react/marks/breakout.js +6 -5
  61. package/dist/esm/react/marks/link.js +7 -5
  62. package/dist/esm/react/nodes/codeBlock.js +18 -14
  63. package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
  64. package/dist/esm/react/nodes/embedCard.js +19 -19
  65. package/dist/esm/react/nodes/heading-anchor.js +8 -6
  66. package/dist/esm/react/nodes/heading.js +4 -2
  67. package/dist/esm/react/nodes/layoutColumn.js +7 -3
  68. package/dist/esm/react/nodes/media.js +8 -5
  69. package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
  70. package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
  71. package/dist/esm/react/nodes/panel.js +27 -15
  72. package/dist/esm/react/nodes/table/sticky.js +64 -53
  73. package/dist/esm/react/nodes/table.js +2 -8
  74. package/dist/esm/react/utils/inject-props.js +24 -0
  75. package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
  76. package/dist/esm/ui/Expand.js +57 -29
  77. package/dist/esm/ui/MediaCard.js +3 -9
  78. package/dist/esm/ui/Renderer/index.js +74 -61
  79. package/dist/esm/ui/Renderer/style.js +58 -51
  80. package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
  81. package/dist/esm/ui/SortingIcon.js +9 -7
  82. package/dist/esm/ui/annotations/draft/component.js +18 -11
  83. package/dist/esm/ui/annotations/element/mark.js +11 -4
  84. package/dist/esm/ui/renderer-props.js +1 -1
  85. package/dist/esm/version.json +1 -1
  86. package/dist/types/analytics/enums.d.ts +2 -0
  87. package/dist/types/analytics/events.d.ts +12 -2
  88. package/dist/types/react/marks/alignment.d.ts +2 -2
  89. package/dist/types/react/marks/breakout.d.ts +4 -3
  90. package/dist/types/react/marks/link.d.ts +2 -2
  91. package/dist/types/react/nodes/codeBlock.d.ts +4 -14
  92. package/dist/types/react/nodes/embedCard.d.ts +3 -2
  93. package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
  94. package/dist/types/react/nodes/heading.d.ts +1 -0
  95. package/dist/types/react/nodes/index.d.ts +1 -13
  96. package/dist/types/react/nodes/layoutColumn.d.ts +3 -1
  97. package/dist/types/react/nodes/media.d.ts +3 -1
  98. package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
  99. package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
  100. package/dist/types/react/nodes/panel.d.ts +3 -1
  101. package/dist/types/react/nodes/table/sticky.d.ts +4 -2
  102. package/dist/types/react/utils/inject-props.d.ts +6 -0
  103. package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
  104. package/dist/types/ui/Expand.d.ts +3 -2
  105. package/dist/types/ui/MediaCard.d.ts +1 -3
  106. package/dist/types/ui/Renderer/index.d.ts +3 -26
  107. package/dist/types/ui/Renderer/style.d.ts +2 -3
  108. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
  109. package/dist/types/ui/SortingIcon.d.ts +3 -3
  110. package/dist/types/ui/annotations/draft/component.d.ts +1 -0
  111. package/dist/types/ui/annotations/element/mark.d.ts +1 -0
  112. package/dist/types/ui/renderer-props.d.ts +14 -2
  113. package/package.json +22 -23
@@ -2,8 +2,6 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
@@ -21,31 +19,31 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
21
19
 
22
20
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
23
21
 
24
- var _react = _interopRequireWildcard(require("react"));
22
+ var _react = require("@emotion/react");
25
23
 
26
- var _styledComponents = _interopRequireDefault(require("styled-components"));
24
+ var _react2 = require("react");
27
25
 
28
26
  var _templateObject;
29
27
 
30
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
31
-
32
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
-
34
28
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
35
29
 
36
30
  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; } }
37
31
 
38
- var FadeOut = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n /* Using 'rgba(255, 255, 255, 0)' because 'transparent' breaks the gradient in Safari 11 */\n background-image: ", ";\n }\n"])), function (_ref) {
39
- var height = _ref.height;
40
- return height;
41
- }, function (_ref2) {
42
- var height = _ref2.height,
43
- fadeHeight = _ref2.fadeHeight;
44
- return height - fadeHeight;
45
- }, function (_ref3) {
46
- var backgroundColor = _ref3.backgroundColor;
47
- return "linear-gradient(rgba(255, 255, 255, 0), ".concat(backgroundColor, ")");
48
- });
32
+ var fadeOutStyles = function fadeOutStyles(maxHeight, top, backgroundColor) {
33
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n background-image: linear-gradient(\n rgba(255, 255, 255, 0),\n ", "\n );\n }\n"])), maxHeight, top, backgroundColor);
34
+ };
35
+
36
+ var FadeOut = function FadeOut(props) {
37
+ var children = props.children,
38
+ backgroundColor = props.backgroundColor,
39
+ fadeHeight = props.fadeHeight,
40
+ height = props.height;
41
+ var top = height - fadeHeight;
42
+ var styles = fadeOutStyles(height, top, backgroundColor);
43
+ return (0, _react.jsx)("div", {
44
+ css: styles
45
+ }, children);
46
+ };
49
47
 
50
48
  var TruncatedWrapper = /*#__PURE__*/function (_Component) {
51
49
  (0, _inherits2.default)(TruncatedWrapper, _Component);
@@ -68,7 +66,7 @@ var TruncatedWrapper = /*#__PURE__*/function (_Component) {
68
66
  _this$props$backgroun = _this$props.backgroundColor,
69
67
  backgroundColor = _this$props$backgroun === void 0 ? 'white' : _this$props$backgroun,
70
68
  children = _this$props.children;
71
- return /*#__PURE__*/_react.default.createElement(FadeOut, {
69
+ return (0, _react.jsx)(FadeOut, {
72
70
  height: height,
73
71
  fadeHeight: fadeHeight,
74
72
  backgroundColor: backgroundColor
@@ -76,6 +74,6 @@ var TruncatedWrapper = /*#__PURE__*/function (_Component) {
76
74
  }
77
75
  }]);
78
76
  return TruncatedWrapper;
79
- }(_react.Component);
77
+ }(_react2.Component);
80
78
 
81
79
  exports.TruncatedWrapper = TruncatedWrapper;
@@ -9,9 +9,7 @@ exports.default = exports.TableSortIconDataUrl = exports.StatusClassNames = void
9
9
 
10
10
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
11
 
12
- var _react = _interopRequireDefault(require("react"));
13
-
14
- var _styledComponents = _interopRequireDefault(require("styled-components"));
12
+ var _react = require("@emotion/react");
15
13
 
16
14
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
17
15
 
@@ -43,9 +41,8 @@ exports.StatusClassNames = StatusClassNames;
43
41
  StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
44
42
  })(StatusClassNames || (exports.StatusClassNames = StatusClassNames = {}));
45
43
 
46
- var Wrapper = _styledComponents.default.figure(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid #fff;\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), (0, _constants.gridSize)() / 2, _colors.N20, _colors.N30, StatusClassNames.SORTING_NOT_ALLOWED);
47
-
48
- var TableSortingIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
44
+ var wrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid #fff;\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), (0, _constants.gridSize)() / 2, _colors.N20, _colors.N30, StatusClassNames.SORTING_NOT_ALLOWED);
45
+ var tableSortingIconStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
49
46
 
50
47
  var getClassName = function getClassName(status) {
51
48
  switch (status) {
@@ -91,13 +88,15 @@ var SortingIcon = function SortingIcon(_ref) {
91
88
  var activated = sortOrdered !== _types.SortOrder.NO_ORDER;
92
89
  var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
93
90
  var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
94
- return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
91
+ return (0, _react.jsx)(_tooltip.default, {
95
92
  delay: 0,
96
93
  content: content,
97
94
  position: "top"
98
- }, /*#__PURE__*/_react.default.createElement(Wrapper, {
95
+ }, (0, _react.jsx)("figure", {
96
+ css: wrapperStyles,
99
97
  className: wrapperClassName
100
- }, /*#__PURE__*/_react.default.createElement(TableSortingIcon, {
98
+ }, (0, _react.jsx)("div", {
99
+ css: tableSortingIconStyles,
101
100
  className: "".concat(getClassName(sortOrdered), " ").concat(TABLE_SORTING_ICON_CLASS, "-").concat(activated ? 'active' : 'inactive')
102
101
  })));
103
102
  };
@@ -2,6 +2,8 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
@@ -11,7 +13,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
13
 
12
14
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
13
15
 
14
- var _react = _interopRequireDefault(require("react"));
16
+ var _react = _interopRequireWildcard(require("react"));
17
+
18
+ var _react2 = require("@emotion/react");
15
19
 
16
20
  var _types = require("../types");
17
21
 
@@ -23,20 +27,26 @@ var _position = require("./position");
23
27
 
24
28
  var _dom = require("./dom");
25
29
 
26
- var _styledComponents = _interopRequireDefault(require("styled-components"));
27
-
28
30
  var _styles = require("@atlaskit/editor-common/styles");
29
31
 
30
32
  var _templateObject;
31
33
 
32
- var DraftAnnotation = _styledComponents.default.mark(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n ", ";\n"])), _styles.AnnotationSharedCSSByState.focus);
34
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
+
36
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
+
38
+ var markStyles = function markStyles(props) {
39
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n ", ";\n"])), (0, _styles.AnnotationSharedCSSByState)(props).focus);
40
+ };
33
41
 
34
42
  var AnnotationDraft = function AnnotationDraft(_ref) {
35
43
  var draftPosition = _ref.draftPosition,
36
44
  children = _ref.children;
37
- return /*#__PURE__*/_react.default.createElement(DraftAnnotation, (0, _extends2.default)({
45
+ return (0, _react2.jsx)("mark", (0, _extends2.default)({
38
46
  "data-renderer-mark": true
39
- }, (0, _dom.dataAttributes)(draftPosition)), children);
47
+ }, (0, _dom.dataAttributes)(draftPosition), {
48
+ css: markStyles
49
+ }), children);
40
50
  };
41
51
 
42
52
  exports.AnnotationDraft = AnnotationDraft;
@@ -66,13 +76,13 @@ var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
66
76
  var annotateIndex = getAnnotationIndex(shouldApplyAnnotationAt, texts.length);
67
77
  return texts.map(function (value, index) {
68
78
  if (annotateIndex === index) {
69
- return /*#__PURE__*/_react.default.createElement(AnnotationDraft, {
79
+ return (0, _react2.jsx)(AnnotationDraft, {
70
80
  key: index,
71
81
  draftPosition: draftPosition
72
82
  }, value);
73
83
  }
74
84
 
75
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, {
85
+ return (0, _react2.jsx)(_react.default.Fragment, {
76
86
  key: index
77
87
  }, value);
78
88
  });
@@ -103,11 +113,11 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
103
113
  }, [nextDraftPosition, textPosition]);
104
114
 
105
115
  if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
106
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
116
+ return (0, _react2.jsx)(_react.Fragment, null, children);
107
117
  }
108
118
 
109
119
  if (shouldApplyAnnotationAt === _types.InsertDraftPosition.AROUND_TEXT) {
110
- return /*#__PURE__*/_react.default.createElement(AnnotationDraft, {
120
+ return (0, _react2.jsx)(AnnotationDraft, {
111
121
  key: 0,
112
122
  draftPosition: nextDraftPosition
113
123
  }, children);
@@ -117,7 +127,7 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
117
127
  var texts = (0, _text.splitText)(children, offsets);
118
128
 
119
129
  if (!texts) {
120
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
130
+ return (0, _react2.jsx)(_react.Fragment, null, children);
121
131
  }
122
132
 
123
133
  var components = applyAnnotationOnText({
@@ -125,7 +135,7 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
125
135
  shouldApplyAnnotationAt: shouldApplyAnnotationAt,
126
136
  draftPosition: nextDraftPosition
127
137
  });
128
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, components);
138
+ return (0, _react2.jsx)(_react.Fragment, null, components);
129
139
  };
130
140
 
131
141
  exports.TextWithAnnotationDraft = TextWithAnnotationDraft;
@@ -19,12 +19,12 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
19
19
 
20
20
  var _react = _interopRequireWildcard(require("react"));
21
21
 
22
+ var _react2 = require("@emotion/react");
23
+
22
24
  var _styles = require("@atlaskit/editor-common/styles");
23
25
 
24
26
  var _adfSchema = require("@atlaskit/adf-schema");
25
27
 
26
- var _styledComponents = _interopRequireDefault(require("styled-components"));
27
-
28
28
  var _templateObject;
29
29
 
30
30
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -35,7 +35,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
35
35
 
36
36
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
37
37
 
38
- var MarkStyled = _styledComponents.default.mark(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), _adfSchema.AnnotationMarkStates.ACTIVE, _styles.AnnotationSharedCSSByState.blur, _styles.AnnotationSharedCSSByState.focus);
38
+ var markStyles = function markStyles(props) {
39
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), _adfSchema.AnnotationMarkStates.ACTIVE, (0, _styles.AnnotationSharedCSSByState)(props).blur, (0, _styles.AnnotationSharedCSSByState)(props).focus);
40
+ };
39
41
 
40
42
  var MarkComponent = function MarkComponent(_ref) {
41
43
  var annotationParentIds = _ref.annotationParentIds,
@@ -70,10 +72,12 @@ var MarkComponent = function MarkComponent(_ref) {
70
72
  } : {
71
73
  'aria-details': annotationIds.join(', ')
72
74
  };
73
- return /*#__PURE__*/_react.default.createElement(MarkStyled, (0, _extends2.default)({
75
+ return (0, _react2.jsx)("mark", (0, _extends2.default)({
74
76
  id: id,
75
77
  onClick: onMarkClick
76
- }, accessibility, overriddenData), children);
78
+ }, accessibility, overriddenData, {
79
+ css: markStyles
80
+ }), children);
77
81
  };
78
82
 
79
83
  exports.MarkComponent = MarkComponent;
@@ -1,5 +1,3 @@
1
1
  "use strict";
2
2
 
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
3
+ var _enums = require("../analytics/enums");
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "91.0.0",
3
+ "version": "93.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -12,6 +12,8 @@ export let ACTION;
12
12
  (function (ACTION) {
13
13
  ACTION["STARTED"] = "started";
14
14
  ACTION["RENDERED"] = "rendered";
15
+ ACTION["RE_RENDERED"] = "reRendered";
16
+ ACTION["RENDERER_TTI"] = "tti";
15
17
  ACTION["CRASHED"] = "unhandledErrorCaught";
16
18
  ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
17
19
  ACTION["SELECT_ALL_CAUGHT"] = "selectAllCaught";
@@ -1,13 +1,21 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+
3
+ /** @jsx jsx */
1
4
  import React from 'react';
2
- import styled, { css } from 'styled-components';
5
+ import { css, jsx } from '@emotion/react';
3
6
  import { alignmentPositionMap } from '@atlaskit/adf-schema';
4
- const MarkWrapper = styled.div`
5
- ${props => props['data-align'] && css`
6
- text-align: ${alignmentPositionMap[props['data-align']]};
7
- `};
8
- `;
7
+
8
+ const MarkWrapper = props => {
9
+ const styles = props['data-align'] ? css`
10
+ text-align: ${alignmentPositionMap[props['data-align']]};
11
+ ` : '';
12
+ return jsx("div", _extends({
13
+ css: styles
14
+ }, props), props.children);
15
+ };
16
+
9
17
  export default function Alignment(props) {
10
- return /*#__PURE__*/React.createElement(MarkWrapper, {
18
+ return jsx(MarkWrapper, {
11
19
  className: "fabric-editor-block-mark",
12
20
  "data-align": props.align
13
21
  }, props.children);
@@ -1,17 +1,18 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
3
  import { WidthConsumer } from '@atlaskit/editor-common/ui';
4
4
  import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
5
5
  import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
6
- export const Wrapper = styled.div`
6
+ export const wrapperStyles = css`
7
7
  margin: ${blockNodesVerticalMargin} 0;
8
8
  margin-left: 50%;
9
9
  transform: translateX(-50%);
10
10
  `;
11
11
  export default function Breakout(props) {
12
- return /*#__PURE__*/React.createElement(WidthConsumer, null, ({
12
+ return jsx(WidthConsumer, null, ({
13
13
  width
14
- }) => /*#__PURE__*/React.createElement(Wrapper, {
14
+ }) => jsx("div", {
15
+ css: wrapperStyles,
15
16
  "data-mode": props.mode,
16
17
  style: {
17
18
  width: calcBreakoutWidth(props.mode, width)
@@ -1,11 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
2
+
3
+ /** @jsx jsx */
4
+ import React, { Fragment } from 'react';
5
+ import { css, jsx } from '@emotion/react';
3
6
  import { B400, B300 } from '@atlaskit/theme/colors';
4
- import styled from 'styled-components';
5
7
  import { getEventHandler } from '../../utils';
6
8
  import { PLATFORM, MODE } from '../../analytics/events';
7
9
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
8
- const StyledAnchor = styled.a`
10
+ const anchorStyles = css`
9
11
  color: ${B400};
10
12
 
11
13
  &:hover {
@@ -35,10 +37,11 @@ export default function Link(props) {
35
37
  const handler = getEventHandler(eventHandlers, 'link');
36
38
 
37
39
  if (isMediaLink) {
38
- return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
40
+ return jsx(Fragment, null, props.children);
39
41
  }
40
42
 
41
- return /*#__PURE__*/React.createElement(StyledAnchor, _extends({
43
+ return jsx("a", _extends({
44
+ css: anchorStyles,
42
45
  onClick: e => {
43
46
  if (fireAnalyticsEvent) {
44
47
  fireAnalyticsEvent({
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ /** @jsx jsx */
2
+ import { jsx, css } from '@emotion/react';
2
3
  import { injectIntl } from 'react-intl-next';
3
- import styled from 'styled-components';
4
4
  import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
5
5
  import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
6
6
  import { N20, DN50 } from '@atlaskit/theme/colors';
@@ -10,6 +10,23 @@ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
10
10
  import { useFeatureFlags } from '../../use-feature-flags';
11
11
  import CopyButton from './codeBlockCopyButton';
12
12
 
13
+ const codeBlockStyle = props => css`
14
+ tab-size: 4;
15
+ [data-ds--code--code-block] {
16
+ font-size: ${relativeFontSizeToBase16(fontSize())};
17
+ line-height: 1.5rem;
18
+ background-image: ${overflowShadow({
19
+ background: themed({
20
+ light: N20,
21
+ dark: DN50
22
+ })(props),
23
+ width: `${gridSize()}px`
24
+ })};
25
+ background-attachment: local, scroll, scroll;
26
+ background-position: 100% 0, 100% 0, 0 0;
27
+ }
28
+ `;
29
+
13
30
  function CodeBlock(props) {
14
31
  const {
15
32
  text,
@@ -20,11 +37,12 @@ function CodeBlock(props) {
20
37
  const featureFlags = useFeatureFlags();
21
38
  const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
22
39
  const className = ['code-block', props.className].join(' ');
23
- return /*#__PURE__*/React.createElement("div", {
24
- className: className
25
- }, allowCopyToClipboard ? /*#__PURE__*/React.createElement(CopyButton, {
40
+ return jsx("div", {
41
+ className: className,
42
+ css: codeBlockStyle
43
+ }, allowCopyToClipboard ? jsx(CopyButton, {
26
44
  content: text
27
- }) : null, /*#__PURE__*/React.createElement(AkCodeBlock, {
45
+ }) : null, jsx(AkCodeBlock, {
28
46
  language: language,
29
47
  text: text,
30
48
  codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
@@ -33,20 +51,4 @@ function CodeBlock(props) {
33
51
  }));
34
52
  }
35
53
 
36
- const IntlCodeBlock = injectIntl(CodeBlock);
37
- export default styled(IntlCodeBlock)`
38
- tab-size: 4;
39
- [data-ds--code--code-block] {
40
- font-size: ${relativeFontSizeToBase16(fontSize())};
41
- line-height: 1.5rem;
42
- background-image: ${overflowShadow({
43
- background: themed({
44
- light: N20,
45
- dark: DN50
46
- }),
47
- width: `${gridSize()}px`
48
- })};
49
- background-attachment: local, scroll, scroll;
50
- background-position: 100% 0, 100% 0, 0 0;
51
- }
52
- `;
54
+ export default injectIntl(CodeBlock);
@@ -1,13 +1,14 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
1
3
  import React, { useState } from 'react';
2
4
  import { injectIntl } from 'react-intl-next';
3
- import styled from 'styled-components';
4
5
  import Tooltip from '@atlaskit/tooltip';
5
6
  import Button from '@atlaskit/button/custom-theme-button';
6
7
  import CopyIcon from '@atlaskit/icon/glyph/copy';
7
8
  import { N20, N30, N700 } from '@atlaskit/theme/colors';
8
9
  import { CopyTextConsumer } from './copy-text-provider';
9
10
  import { codeBlockCopyButtonMessages } from '../../messages';
10
- const CopyButtonWrapper = styled.span`
11
+ const copyButtonWrapperStyles = css`
11
12
  display: flex;
12
13
  position: sticky;
13
14
  justify-content: flex-end;
@@ -24,7 +25,7 @@ const CopyButtonWrapper = styled.span`
24
25
  padding: 2px;
25
26
  opacity: 0;
26
27
  transition: opacity 0.2s ease 0s;
27
- border: 2px solid #ffffff;
28
+ border: 2px solid #fff;
28
29
  border-radius: 4px;
29
30
  background-color: ${N20};
30
31
  color: rgb(66, 82, 110);
@@ -36,7 +37,7 @@ const CopyButtonWrapper = styled.span`
36
37
 
37
38
  button.clicked {
38
39
  background-color: ${N700};
39
- color: #ffffff !important;
40
+ color: #fff !important;
40
41
  }
41
42
  `;
42
43
 
@@ -52,22 +53,24 @@ const CopyButton = ({
52
53
  setClassName('copy-to-clipboard');
53
54
  };
54
55
 
55
- return /*#__PURE__*/React.createElement(CopyTextConsumer, null, ({
56
+ return jsx(CopyTextConsumer, null, ({
56
57
  copyTextToClipboard
57
58
  }) => {
58
- return /*#__PURE__*/React.createElement(CopyButtonWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
59
+ return jsx("span", {
60
+ css: copyButtonWrapperStyles
61
+ }, jsx(Tooltip, {
59
62
  content: tooltip,
60
63
  hideTooltipOnClick: false,
61
64
  position: "top"
62
- }, /*#__PURE__*/React.createElement("div", {
65
+ }, jsx("div", {
63
66
  onMouseLeave: onMouseLeave
64
- }, /*#__PURE__*/React.createElement(Button, {
67
+ }, jsx(Button, {
65
68
  className: className,
66
69
  "aria-label": tooltip,
67
70
  spacing: "compact",
68
71
  appearance: "subtle",
69
72
  "aria-haspopup": true,
70
- iconBefore: /*#__PURE__*/React.createElement(CopyIcon, {
73
+ iconBefore: jsx(CopyIcon, {
71
74
  label: tooltip
72
75
  }),
73
76
  onClick: () => {
@@ -1,14 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React, { useMemo, useContext, useState, useRef } from 'react';
2
+
3
+ /** @jsx jsx */
4
+ import { css, jsx } from '@emotion/react';
5
+ import { useMemo, useContext, useState, useRef } from 'react';
3
6
  import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
4
7
  import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
5
8
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, getAkEditorFullPageMaxWidth } from '@atlaskit/editor-shared-styles';
6
9
  import { getPlatform } from '../../utils';
7
10
  import { CardErrorBoundary } from './fallback';
8
- import styled from 'styled-components';
9
11
  import { FullPagePadding } from '../../ui/Renderer/style';
10
12
  import { getCardClickHandler } from '../utils/getCardClickHandler';
11
- const EmbedCardWrapper = styled.div`
13
+ const embedCardWrapperStyles = css`
12
14
  width: 100%;
13
15
  height: 100%;
14
16
 
@@ -22,16 +24,10 @@ const EmbedCardWrapper = styled.div`
22
24
 
23
25
  margin: 0 auto;
24
26
  `;
25
- EmbedCardWrapper.displayName = 'EmbedCardWrapper';
26
- const ExtendedEmbedCard = styled(UIMediaSingle)`
27
- ${({
28
- layout
29
- }) => layout === 'full-width' || layout === 'wide' ? `
27
+ const uIMediaSingleLayoutStyles = css`
30
28
  margin-left: 50%;
31
29
  transform: translateX(-50%);
32
- ` : ``}
33
30
  `;
34
- ExtendedEmbedCard.displayName = 'ExtendedEmbedCard';
35
31
  export default function EmbedCard(props) {
36
32
  const {
37
33
  url,
@@ -97,7 +93,7 @@ export default function EmbedCard(props) {
97
93
  setAspectRatio(resolvedAspectRatio);
98
94
  };
99
95
 
100
- return /*#__PURE__*/React.createElement(WidthConsumer, null, ({
96
+ return jsx(WidthConsumer, null, ({
101
97
  width: containerWidth,
102
98
  breakpoint
103
99
  }) => {
@@ -117,12 +113,14 @@ export default function EmbedCard(props) {
117
113
  }
118
114
 
119
115
  const lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
120
- return /*#__PURE__*/React.createElement(CardErrorBoundary, _extends({
116
+ const 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,
@@ -1,7 +1,9 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+
4
+ /** @jsx jsx */
3
5
  import React from 'react';
4
- import styled from 'styled-components';
6
+ import { css, jsx } from '@emotion/react';
5
7
  import { N200, N500, B400 } from '@atlaskit/theme/colors';
6
8
  import LinkIcon from '@atlaskit/icon/glyph/link';
7
9
  import Tooltip from '@atlaskit/tooltip';
@@ -13,12 +15,12 @@ const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
13
15
  children,
14
16
  ...rest
15
17
  } = props;
16
- return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
18
+ return jsx("span", _extends({}, rest, {
17
19
  className: HeadingAnchorWrapperClassName,
18
20
  ref: ref
19
21
  }), children);
20
22
  });
21
- const CopyAnchorButton = styled.button`
23
+ const copyAnchorButtonStyles = css`
22
24
  display: inline;
23
25
  outline: none;
24
26
  background-color: transparent;
@@ -72,11 +74,12 @@ class HeadingAnchor extends React.PureComponent {
72
74
  });
73
75
 
74
76
  _defineProperty(this, "renderAnchorButton", () => {
75
- return /*#__PURE__*/React.createElement(CopyAnchorButton, {
77
+ return jsx("button", {
78
+ css: copyAnchorButtonStyles,
76
79
  onMouseLeave: this.resetMessage,
77
80
  onClick: this.copyToClipboard,
78
81
  "aria-label": this.state.tooltipMessage
79
- }, /*#__PURE__*/React.createElement(LinkIcon, {
82
+ }, jsx(LinkIcon, {
80
83
  label: this.getCopyAriaLabel(),
81
84
  size: this.props.level > 3 ? 'small' : 'medium',
82
85
  primaryColor: this.state.isClicked ? B400 : N200
@@ -97,7 +100,7 @@ class HeadingAnchor extends React.PureComponent {
97
100
  // We set the key to the message to ensure it remounts when the message
98
101
  // changes, so that it correctly repositions.
99
102
  // @see https://ecosystem.atlassian.net/projects/AK/queues/issue/AK-6548
100
- return /*#__PURE__*/React.createElement(Tooltip, {
103
+ return jsx(Tooltip, {
101
104
  tag: CopyAnchorWrapperWithRef,
102
105
  content: tooltipMessage,
103
106
  position: "top",