@atlaskit/renderer 92.0.0 → 93.0.1

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 (115) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/cjs/analytics/enums.js +1 -0
  3. package/dist/cjs/i18n/en.js +28 -0
  4. package/dist/cjs/i18n/en_GB.js +28 -0
  5. package/dist/cjs/i18n/pl.js +7 -1
  6. package/dist/cjs/i18n/pt_BR.js +1 -1
  7. package/dist/cjs/react/marks/alignment.js +11 -12
  8. package/dist/cjs/react/marks/breakout.js +7 -9
  9. package/dist/cjs/react/marks/link.js +13 -6
  10. package/dist/cjs/react/nodes/codeBlock.js +1 -1
  11. package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
  12. package/dist/cjs/react/nodes/embedCard.js +25 -33
  13. package/dist/cjs/react/nodes/heading-anchor.js +7 -6
  14. package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
  15. package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
  16. package/dist/cjs/react/nodes/panel.js +36 -20
  17. package/dist/cjs/react/nodes/table/sticky.js +51 -54
  18. package/dist/cjs/react/nodes/table.js +2 -10
  19. package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
  20. package/dist/cjs/render-document.js +2 -2
  21. package/dist/cjs/text/index.js +2 -2
  22. package/dist/cjs/ui/Expand.js +40 -20
  23. package/dist/cjs/ui/MediaCard.js +4 -14
  24. package/dist/cjs/ui/Renderer/click-to-edit.js +4 -4
  25. package/dist/cjs/ui/Renderer/index.js +39 -50
  26. package/dist/cjs/ui/Renderer/style.js +58 -63
  27. package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
  28. package/dist/cjs/ui/SortingIcon.js +8 -9
  29. package/dist/cjs/ui/renderer-props.js +1 -3
  30. package/dist/cjs/utils.js +2 -2
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/analytics/enums.js +1 -0
  33. package/dist/es2019/i18n/en.js +20 -0
  34. package/dist/es2019/i18n/en_GB.js +20 -0
  35. package/dist/es2019/i18n/pl.js +7 -1
  36. package/dist/es2019/i18n/pt_BR.js +1 -1
  37. package/dist/es2019/react/marks/alignment.js +15 -7
  38. package/dist/es2019/react/marks/breakout.js +6 -5
  39. package/dist/es2019/react/marks/link.js +8 -5
  40. package/dist/es2019/react/nodes/codeBlock.js +1 -1
  41. package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
  42. package/dist/es2019/react/nodes/embedCard.js +16 -16
  43. package/dist/es2019/react/nodes/heading-anchor.js +9 -6
  44. package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
  45. package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
  46. package/dist/es2019/react/nodes/panel.js +38 -18
  47. package/dist/es2019/react/nodes/table/sticky.js +48 -41
  48. package/dist/es2019/react/nodes/table.js +2 -5
  49. package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
  50. package/dist/es2019/render-document.js +1 -1
  51. package/dist/es2019/text/index.js +1 -1
  52. package/dist/es2019/ui/Expand.js +52 -28
  53. package/dist/es2019/ui/MediaCard.js +3 -6
  54. package/dist/es2019/ui/Renderer/click-to-edit.js +1 -1
  55. package/dist/es2019/ui/Renderer/index.js +38 -43
  56. package/dist/es2019/ui/Renderer/style.js +363 -337
  57. package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
  58. package/dist/es2019/ui/SortingIcon.js +9 -7
  59. package/dist/es2019/ui/renderer-props.js +1 -1
  60. package/dist/es2019/utils.js +1 -1
  61. package/dist/es2019/version.json +1 -1
  62. package/dist/esm/analytics/enums.js +1 -0
  63. package/dist/esm/i18n/en.js +20 -0
  64. package/dist/esm/i18n/en_GB.js +20 -0
  65. package/dist/esm/i18n/pl.js +7 -1
  66. package/dist/esm/i18n/pt_BR.js +1 -1
  67. package/dist/esm/react/marks/alignment.js +13 -6
  68. package/dist/esm/react/marks/breakout.js +6 -5
  69. package/dist/esm/react/marks/link.js +7 -5
  70. package/dist/esm/react/nodes/codeBlock.js +1 -1
  71. package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
  72. package/dist/esm/react/nodes/embedCard.js +19 -19
  73. package/dist/esm/react/nodes/heading-anchor.js +8 -6
  74. package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
  75. package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
  76. package/dist/esm/react/nodes/panel.js +34 -17
  77. package/dist/esm/react/nodes/table/sticky.js +53 -52
  78. package/dist/esm/react/nodes/table.js +2 -8
  79. package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
  80. package/dist/esm/render-document.js +1 -1
  81. package/dist/esm/text/index.js +1 -1
  82. package/dist/esm/ui/Expand.js +45 -21
  83. package/dist/esm/ui/MediaCard.js +3 -9
  84. package/dist/esm/ui/Renderer/click-to-edit.js +1 -1
  85. package/dist/esm/ui/Renderer/index.js +39 -47
  86. package/dist/esm/ui/Renderer/style.js +56 -57
  87. package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
  88. package/dist/esm/ui/SortingIcon.js +9 -7
  89. package/dist/esm/ui/renderer-props.js +1 -1
  90. package/dist/esm/utils.js +1 -1
  91. package/dist/esm/version.json +1 -1
  92. package/dist/types/analytics/enums.d.ts +1 -0
  93. package/dist/types/analytics/events.d.ts +7 -2
  94. package/dist/types/i18n/en.d.ts +20 -0
  95. package/dist/types/i18n/en_GB.d.ts +20 -0
  96. package/dist/types/i18n/pl.d.ts +6 -0
  97. package/dist/types/react/marks/alignment.d.ts +2 -2
  98. package/dist/types/react/marks/breakout.d.ts +4 -3
  99. package/dist/types/react/marks/link.d.ts +2 -2
  100. package/dist/types/react/nodes/embedCard.d.ts +3 -2
  101. package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
  102. package/dist/types/react/nodes/media.d.ts +1 -1
  103. package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
  104. package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
  105. package/dist/types/react/nodes/panel.d.ts +3 -1
  106. package/dist/types/react/nodes/table/sticky.d.ts +4 -2
  107. package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
  108. package/dist/types/ui/Expand.d.ts +2 -2
  109. package/dist/types/ui/MediaCard.d.ts +1 -3
  110. package/dist/types/ui/Renderer/index.d.ts +0 -25
  111. package/dist/types/ui/Renderer/style.d.ts +1 -4
  112. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
  113. package/dist/types/ui/SortingIcon.d.ts +3 -3
  114. package/dist/types/ui/renderer-props.d.ts +14 -2
  115. package/package.json +22 -24
@@ -1,29 +1,46 @@
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
- import { PanelSharedCssClassName } from '@atlaskit/editor-common/styles';
11
+ import { getPanelBackgroundDarkModeColors, panelSharedStylesWithoutPrefix, PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
10
12
  import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
11
13
  import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions below
12
14
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
13
15
 
14
16
  import { themed } from '@atlaskit/theme';
15
- import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common/styles';
16
17
  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
18
 
19
+ var PanelStyled = function PanelStyled(props) {
20
+ var styles = function styles(theme) {
21
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
22
+ theme: theme
23
+ }));
24
+ };
25
+
26
+ if (props['data-panel-type'] === PanelType.CUSTOM && props.backgroundColor) {
27
+ styles = function styles(theme) {
28
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n\n &[data-panel-type=", "] {\n background-color: ", ";\n ", ";\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
29
+ theme: theme
30
+ }), PanelType.CUSTOM, props.backgroundColor, themed({
31
+ dark: getPanelBackgroundDarkModeColors
32
+ })({
33
+ theme: theme
34
+ }));
35
+ };
36
+ }
37
+
38
+ return jsx("div", _extends({
39
+ css: styles
40
+ }, props), props.children);
41
+ };
22
42
 
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
- });
43
+ PanelStyled.displayName = 'PanelStyled';
27
44
  var panelIcons = {
28
45
  info: PanelInfoIcon,
29
46
  success: PanelSuccessIcon,
@@ -50,7 +67,7 @@ var Panel = function Panel(props) {
50
67
  var getIcon = function getIcon() {
51
68
  if (panelType === PanelType.CUSTOM) {
52
69
  if (panelIcon && providers) {
53
- return /*#__PURE__*/React.createElement(EmojiItem, {
70
+ return jsx(EmojiItem, {
54
71
  id: panelIconId,
55
72
  text: panelIconText,
56
73
  shortName: panelIcon,
@@ -62,7 +79,7 @@ var Panel = function Panel(props) {
62
79
  }
63
80
 
64
81
  var Icon = panelIcons[panelType];
65
- return /*#__PURE__*/React.createElement(Icon, {
82
+ return jsx(Icon, {
66
83
  label: "Panel ".concat(panelType)
67
84
  });
68
85
  };
@@ -71,13 +88,13 @@ var Panel = function Panel(props) {
71
88
  var icon = getIcon();
72
89
 
73
90
  if (icon) {
74
- return /*#__PURE__*/React.createElement("div", {
91
+ return jsx("div", {
75
92
  className: PanelSharedCssClassName.icon
76
93
  }, icon);
77
94
  }
78
95
  };
79
96
 
80
- return /*#__PURE__*/React.createElement(PanelStyled, {
97
+ return jsx(PanelStyled, {
81
98
  className: PanelSharedCssClassName.prefix,
82
99
  "data-panel-type": panelType,
83
100
  "data-panel-color": panelColor,
@@ -85,7 +102,7 @@ var Panel = function Panel(props) {
85
102
  "data-panel-icon-id": panelIconId,
86
103
  "data-panel-icon-text": panelIconText,
87
104
  backgroundColor: panelColor
88
- }, renderIcon(), /*#__PURE__*/React.createElement("div", {
105
+ }, renderIcon(), jsx("div", {
89
106
  className: PanelSharedCssClassName.content
90
107
  }, children));
91
108
  };
@@ -4,8 +4,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
4
4
 
5
5
  var _templateObject, _templateObject2, _templateObject3;
6
6
 
7
+ /** @jsx jsx */
7
8
  import React from 'react';
8
- import styled from 'styled-components';
9
+ import { css, jsx } from '@emotion/react';
9
10
  import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
10
11
  import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
11
12
  import * as colors from '@atlaskit/theme/colors';
@@ -14,70 +15,70 @@ import { findHorizontalOverflowScrollParent } from '../../../utils';
14
15
  import { Table } from './table';
15
16
  import { recursivelyInjectProps } from '../../utils/inject-props';
16
17
  export var tableStickyPadding = 8;
17
- // creates a new stacking context and places the div in the same
18
- // position as the table
19
- var RelativeTableDiv = styled.div.attrs({
20
- style: function style(_ref) {
21
- var left = _ref.left,
22
- top = _ref.top;
23
- return {
24
- left: left && left < 0 ? left : undefined,
25
- top: top
26
- };
27
- }
28
- })(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
29
- export var FixedTableDiv = styled.div.attrs({
30
- style: function style(_ref2) {
31
- var top = _ref2.top,
32
- wrapperWidth = _ref2.wrapperWidth;
33
- return {
34
- top: top,
35
- width: wrapperWidth
36
- };
18
+ var fixedTableDivModeToPosition = {
19
+ stick: 'fixed',
20
+ 'pin-bottom': 'absolute'
21
+ };
22
+
23
+ var getModeSpecificStyles = function getModeSpecificStyles(mode) {
24
+ if (mode === 'none') {
25
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n "])));
26
+ } else {
27
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: ", ";\n "])), fixedTableDivModeToPosition[mode]);
37
28
  }
38
- })(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n ", ";\n ", ";\n\n z-index: ", ";\n\n // Fix this when move we move this to use emotion\n &&&\n .", ",\n &&&\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n border-top: ", "px solid white;\n background: white;\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &&&\n .", ".right-shadow::after,\n &&&\n .", ".left-shadow::before {\n top: 0px;\n height: 100%;\n }\n"])), function (props) {
39
- return props.mode === 'stick' ? 'position: fixed' : '';
40
- }, function (props) {
41
- return props.mode === 'pin-bottom' ? 'position: absolute' : '';
42
- }, function (props) {
43
- return props.mode === 'none' ? 'display: none' : '';
44
- }, akEditorStickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableStickyPadding, N40A, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
45
- var StyledDiv = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral([""])));
46
- export var StickyTable = function StickyTable(_ref3) {
47
- var top = _ref3.top,
48
- left = _ref3.left,
49
- mode = _ref3.mode,
50
- shadowClassNames = _ref3.shadowClassNames,
51
- innerRef = _ref3.innerRef,
52
- wrapperWidth = _ref3.wrapperWidth,
53
- tableWidth = _ref3.tableWidth,
54
- isNumberColumnEnabled = _ref3.isNumberColumnEnabled,
55
- layout = _ref3.layout,
56
- children = _ref3.children,
57
- columnWidths = _ref3.columnWidths,
58
- renderWidth = _ref3.renderWidth,
59
- allowDynamicTextSizing = _ref3.allowDynamicTextSizing,
60
- rowHeight = _ref3.rowHeight;
61
- return /*#__PURE__*/React.createElement(RelativeTableDiv, {
62
- left: left,
63
- top: mode === 'pin-bottom' ? top : undefined
64
- }, /*#__PURE__*/React.createElement(FixedTableDiv, {
29
+ };
30
+
31
+ var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width) {
32
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n border-top: ", "px solid white;\n background: white;\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".right-shadow::after,\n &\n .", ".left-shadow::before {\n top: 0px;\n height: 100%;\n }\n"])), top, width, akEditorStickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableStickyPadding, N40A, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
33
+ };
34
+
35
+ export var FixedTableDiv = function FixedTableDiv(props) {
36
+ var top = props.top,
37
+ wrapperWidth = props.wrapperWidth,
38
+ mode = props.mode;
39
+ var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), getModeSpecificStyles(mode)];
40
+ return jsx("div", {
41
+ css: fixedTableCss
42
+ }, props.children);
43
+ };
44
+ export var StickyTable = function StickyTable(_ref) {
45
+ var top = _ref.top,
46
+ left = _ref.left,
47
+ mode = _ref.mode,
48
+ shadowClassNames = _ref.shadowClassNames,
49
+ innerRef = _ref.innerRef,
50
+ wrapperWidth = _ref.wrapperWidth,
51
+ tableWidth = _ref.tableWidth,
52
+ isNumberColumnEnabled = _ref.isNumberColumnEnabled,
53
+ layout = _ref.layout,
54
+ children = _ref.children,
55
+ columnWidths = _ref.columnWidths,
56
+ renderWidth = _ref.renderWidth,
57
+ allowDynamicTextSizing = _ref.allowDynamicTextSizing,
58
+ rowHeight = _ref.rowHeight;
59
+ return jsx("div", {
60
+ css: {
61
+ left: left && left < 0 ? left : undefined,
62
+ top: mode === 'pin-bottom' ? top : undefined,
63
+ position: 'relative'
64
+ }
65
+ }, jsx(FixedTableDiv, {
65
66
  top: mode === 'stick' ? top : undefined,
66
67
  mode: rowHeight > 300 ? 'none' : mode,
67
68
  wrapperWidth: wrapperWidth
68
- }, /*#__PURE__*/React.createElement(StyledDiv, {
69
+ }, jsx("div", {
69
70
  className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(shadowClassNames),
70
71
  "data-layout": layout,
71
72
  style: {
72
73
  width: tableWidth
73
74
  }
74
- }, /*#__PURE__*/React.createElement(StyledDiv, {
75
- innerRef: innerRef,
75
+ }, jsx("div", {
76
+ ref: innerRef,
76
77
  className: "".concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER),
77
78
  style: {
78
79
  overflow: 'hidden'
79
80
  }
80
- }, /*#__PURE__*/React.createElement(Table, {
81
+ }, jsx(Table, {
81
82
  columnWidths: columnWidths,
82
83
  layout: layout,
83
84
  isNumberColumnEnabled: isNumberColumnEnabled,
@@ -6,16 +6,12 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
6
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
10
-
11
- var _templateObject;
12
9
 
13
10
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
11
 
15
12
  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; } }
16
13
 
17
14
  import React from 'react';
18
- import styled from 'styled-components';
19
15
  import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlaskit/editor-common/styles';
20
16
  import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
21
17
  import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
@@ -124,8 +120,6 @@ var tableCanBeSticky = function tableCanBeSticky(node, children) {
124
120
  return isHeaderRowEnabled(children) && node && node.firstChild && !hasRowspan(node.firstChild);
125
121
  };
126
122
 
127
- var MainTableContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
128
-
129
123
  var canUseLinelength = function canUseLinelength(appearance) {
130
124
  return appearance === 'full-page' || appearance === 'mobile';
131
125
  };
@@ -330,10 +324,10 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
330
324
  columnWidths: columnWidths,
331
325
  rowHeight: this.headerRowHeight,
332
326
  allowDynamicTextSizing: allowDynamicTextSizing
333
- }, [children && children[0]]), /*#__PURE__*/React.createElement(MainTableContainer, {
327
+ }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
334
328
  className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames),
335
329
  "data-layout": layout,
336
- innerRef: this.props.handleRef,
330
+ ref: this.props.handleRef,
337
331
  style: {
338
332
  width: tableWidth,
339
333
  left: left && left < 0 ? left : undefined
@@ -0,0 +1,39 @@
1
+ import { useMemo } from 'react';
2
+ import debounce from 'lodash/debounce';
3
+ import { useComponentRenderTracking } from '@atlaskit/editor-common/utils';
4
+ import { EVENT_TYPE } from '../../../analytics/enums';
5
+ export function RenderTracking(props) {
6
+ var debouncedHandleAnalyticsEvent = useMemo(function () {
7
+ return debounce(props.handleAnalyticsEvent, 500);
8
+ }, [props.handleAnalyticsEvent]);
9
+ useComponentRenderTracking({
10
+ onRender: function onRender(_ref) {
11
+ var renderCount = _ref.renderCount,
12
+ propsDifference = _ref.propsDifference,
13
+ componentId = _ref.componentId;
14
+
15
+ if (!renderCount) {
16
+ return;
17
+ }
18
+
19
+ debouncedHandleAnalyticsEvent({
20
+ action: props.action,
21
+ actionSubject: props.actionSubject,
22
+ attributes: {
23
+ count: renderCount,
24
+ propsDifference: propsDifference,
25
+ componentId: componentId
26
+ },
27
+ eventType: EVENT_TYPE.OPERATIONAL
28
+ });
29
+ },
30
+ propsDiffingOptions: {
31
+ enabled: true,
32
+ props: props.componentProps,
33
+ propsToIgnore: props.propsToIgnore,
34
+ useShallow: props.useShallow
35
+ },
36
+ zeroBasedCount: true
37
+ });
38
+ return null;
39
+ }
@@ -1,4 +1,4 @@
1
- import { defaultSchema } from '@atlaskit/adf-schema';
1
+ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
2
2
  import { getValidDocument } from '@atlaskit/editor-common/validator';
3
3
  import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
4
4
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
@@ -1,6 +1,6 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import { defaultSchema } from '@atlaskit/adf-schema';
3
+ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
4
4
  import { reduce } from './nodes';
5
5
 
6
6
  var TextSerializer = /*#__PURE__*/function () {
@@ -5,36 +5,59 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
5
5
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
6
6
 
7
7
  /** @jsx jsx */
8
- import React, { forwardRef, useRef, useCallback } from 'react';
9
- import { jsx } from '@emotion/react';
10
- import styled from 'styled-components';
8
+ import React, { useRef, useCallback } from 'react';
9
+ import { css, jsx } from '@emotion/react';
11
10
  import { gridSize, fontSize } from '@atlaskit/theme/constants';
12
11
  import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
13
12
  import Tooltip from '@atlaskit/tooltip';
14
- import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, ExpandLayoutWrapper, clearNextSiblingMarginTopStyle } from '@atlaskit/editor-common/ui';
13
+ import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, clearNextSiblingMarginTopStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
15
14
  import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
16
15
  import { PLATFORM, MODE } from '../analytics/events';
17
16
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
18
17
  import { injectIntl } from 'react-intl-next';
19
18
  import { ActiveHeaderIdConsumer } from './active-header-id-provider';
20
19
  import _uniqueId from 'lodash/uniqueId';
21
- var Title = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", "px;\n text-align: left;\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, gridSize() / 2);
22
- var Container = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n padding-bottom: ", "px;\n"])), sharedExpandStyles.ContainerStyles, function (props) {
23
- return props.expanded ? gridSize() : 0;
24
- });
25
- var TitleContainer = styled.button(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", "px;\n padding-bottom: ", "px;\n"])), sharedExpandStyles.TitleContainerStyles, gridSize(), function (props) {
26
- return !props.expanded ? gridSize() : 0;
27
- });
20
+ var titleStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", "px;\n text-align: left;\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, gridSize() / 2);
21
+
22
+ var Container = function Container(props) {
23
+ var paddingBottom = "".concat(props.expanded ? gridSize() : 0, "px");
24
+ var sharedContainerStyles = sharedExpandStyles.containerStyles(props);
25
+
26
+ var styles = function styles(themeProps) {
27
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles(themeProps), paddingBottom);
28
+ };
29
+
30
+ return jsx("div", _extends({
31
+ css: styles
32
+ }, props), props.children);
33
+ };
34
+
35
+ var TitleContainer = function TitleContainer(props) {
36
+ var paddingBottom = "".concat(!props.expanded ? gridSize() : 0, "px");
37
+
38
+ var styles = function styles(themeProps) {
39
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", "px;\n padding-bottom: ", ";\n "])), sharedExpandStyles.titleContainerStyles(themeProps), gridSize(), paddingBottom);
40
+ };
41
+
42
+ return jsx("button", _extends({
43
+ css: styles
44
+ }, props), props.children);
45
+ };
46
+
28
47
  TitleContainer.displayName = 'TitleContainerButton';
29
- var ContentContainer = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", "px;\n padding-left: ", "px;\n visibility: ", ";\n"])), sharedExpandStyles.ContentStyles, gridSize() * 2, gridSize() * 5 - gridSize() / 2, function (props) {
30
- return props.expanded ? 'visible' : 'hidden';
31
- });
32
- var ExpandLayoutWrapperWithRef = /*#__PURE__*/forwardRef(function WithRef(props, ref) {
33
- // @ts-ignore: incorrect innerRef typing
34
- return jsx(ExpandLayoutWrapper, _extends({}, props, {
35
- innerRef: ref
36
- }));
37
- });
48
+
49
+ var ContentContainer = function ContentContainer(props) {
50
+ var sharedContentStyles = sharedExpandStyles.contentStyles(props);
51
+ var visibility = props.expanded ? 'visible' : 'hidden';
52
+
53
+ var styles = function styles(themeProps) {
54
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", "px;\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles(themeProps), gridSize() * 2, gridSize() * 5 - gridSize() / 2, visibility);
55
+ };
56
+
57
+ return jsx("div", _extends({
58
+ css: styles
59
+ }, props), props.children);
60
+ };
38
61
 
39
62
  function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
40
63
  if (!fireAnalyticsEvent) {
@@ -116,7 +139,8 @@ function Expand(_ref) {
116
139
  expanded: expanded
117
140
  }, jsx(ChevronRightIcon, {
118
141
  label: label
119
- }))), jsx(Title, {
142
+ }))), jsx("span", {
143
+ css: titleStyles,
120
144
  id: id
121
145
  }, title || intl.formatMessage(expandMessages.expandDefaultTitle))), jsx(ContentContainer, {
122
146
  expanded: expanded
@@ -1,4 +1,3 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
1
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -9,8 +8,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
9
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
10
 
12
- var _templateObject;
13
-
14
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
12
 
16
13
  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) { _defineProperty(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; }
@@ -19,13 +16,11 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
19
16
 
20
17
  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
18
 
22
- import React from 'react';
23
- import { Component } from 'react';
19
+ import React, { Component } from 'react';
24
20
  import { filter } from '@atlaskit/adf-utils';
25
21
  import { Card, CardLoading, CardError } from '@atlaskit/media-card';
26
22
  import { getMediaClient } from '@atlaskit/media-client';
27
23
  import { withImageLoader } from '@atlaskit/editor-common/utils';
28
- import styled from 'styled-components';
29
24
  var mediaIdentifierMap = new Map();
30
25
  export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
31
26
  if (!doc) {
@@ -355,7 +350,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
355
350
  collectionName: collection,
356
351
  occurrenceKey: occurrenceKey
357
352
  };
358
- return /*#__PURE__*/React.createElement(CardWrapper, getClipboardAttrs({
353
+ return /*#__PURE__*/React.createElement("div", getClipboardAttrs({
359
354
  id: id,
360
355
  alt: alt,
361
356
  collection: collection,
@@ -386,8 +381,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
386
381
  }]);
387
382
 
388
383
  return MediaCardInternal;
389
- }(Component);
390
- export var CardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral([""]))); // Needed for copy & paste
384
+ }(Component); // Needed for copy & paste
391
385
 
392
386
  export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
393
387
  var id = _ref2.id,
@@ -1,4 +1,4 @@
1
- import { fileCardImageViewSelector } from '@atlaskit/media-card';
1
+ import { fileCardImageViewSelector } from '@atlaskit/media-card/classnames';
2
2
  import { mediaViewerPopupClass } from '@atlaskit/media-viewer/classnames';
3
3
  /**
4
4
  * Check if an element is interactive (or otherwise if clicking on it shouldn't transition the