@atlaskit/renderer 95.0.1 → 96.0.2

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 (78) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/dist/cjs/react/index.js +0 -2
  3. package/dist/cjs/react/nodes/embedCard.js +2 -5
  4. package/dist/cjs/react/nodes/inlineCard.js +5 -1
  5. package/dist/cjs/react/nodes/mediaInline.js +41 -4
  6. package/dist/cjs/react/nodes/mediaSingle/index.js +3 -7
  7. package/dist/cjs/react/nodes/panel.js +7 -5
  8. package/dist/cjs/react/nodes/table/colgroup.js +6 -12
  9. package/dist/cjs/react/nodes/table/sticky.js +28 -17
  10. package/dist/cjs/react/nodes/table/table.js +1 -3
  11. package/dist/cjs/react/nodes/table.js +20 -9
  12. package/dist/cjs/react/nodes/tableCell.js +5 -3
  13. package/dist/cjs/render-document.js +2 -2
  14. package/dist/cjs/ui/MediaCard.js +2 -2
  15. package/dist/cjs/ui/Renderer/breakout-ssr.js +6 -8
  16. package/dist/cjs/ui/Renderer/index.js +4 -12
  17. package/dist/cjs/ui/Renderer/style.js +3 -3
  18. package/dist/cjs/ui/annotations/hooks/use-events.js +4 -2
  19. package/dist/cjs/utils.js +0 -24
  20. package/dist/cjs/version.json +1 -1
  21. package/dist/es2019/react/index.js +0 -2
  22. package/dist/es2019/react/nodes/embedCard.js +4 -7
  23. package/dist/es2019/react/nodes/inlineCard.js +4 -1
  24. package/dist/es2019/react/nodes/mediaInline.js +36 -4
  25. package/dist/es2019/react/nodes/mediaSingle/index.js +5 -9
  26. package/dist/es2019/react/nodes/panel.js +19 -16
  27. package/dist/es2019/react/nodes/table/colgroup.js +2 -8
  28. package/dist/es2019/react/nodes/table/sticky.js +26 -10
  29. package/dist/es2019/react/nodes/table/table.js +1 -3
  30. package/dist/es2019/react/nodes/table.js +18 -9
  31. package/dist/es2019/react/nodes/tableCell.js +4 -1
  32. package/dist/es2019/render-document.js +1 -1
  33. package/dist/es2019/ui/MediaCard.js +1 -1
  34. package/dist/es2019/ui/Renderer/breakout-ssr.js +6 -8
  35. package/dist/es2019/ui/Renderer/index.js +3 -11
  36. package/dist/es2019/ui/Renderer/style.js +16 -3
  37. package/dist/es2019/ui/annotations/hooks/use-events.js +2 -2
  38. package/dist/es2019/utils.js +0 -22
  39. package/dist/es2019/version.json +1 -1
  40. package/dist/esm/react/index.js +0 -2
  41. package/dist/esm/react/nodes/embedCard.js +4 -7
  42. package/dist/esm/react/nodes/heading-anchor.js +1 -1
  43. package/dist/esm/react/nodes/inlineCard.js +4 -1
  44. package/dist/esm/react/nodes/mediaInline.js +37 -5
  45. package/dist/esm/react/nodes/mediaSingle/index.js +5 -9
  46. package/dist/esm/react/nodes/panel.js +7 -5
  47. package/dist/esm/react/nodes/table/colgroup.js +6 -12
  48. package/dist/esm/react/nodes/table/sticky.js +26 -8
  49. package/dist/esm/react/nodes/table/table.js +1 -3
  50. package/dist/esm/react/nodes/table.js +20 -9
  51. package/dist/esm/react/nodes/tableCell.js +5 -3
  52. package/dist/esm/react/nodes/task-item-with-providers.js +1 -1
  53. package/dist/esm/render-document.js +1 -1
  54. package/dist/esm/ui/MediaCard.js +3 -2
  55. package/dist/esm/ui/Renderer/breakout-ssr.js +6 -8
  56. package/dist/esm/ui/Renderer/index.js +3 -11
  57. package/dist/esm/ui/Renderer/style.js +4 -3
  58. package/dist/esm/ui/annotations/hooks/use-events.js +4 -2
  59. package/dist/esm/utils.js +0 -22
  60. package/dist/esm/version.json +1 -1
  61. package/dist/types/react/index.d.ts +0 -2
  62. package/dist/types/react/nodes/embedCard.d.ts +0 -1
  63. package/dist/types/react/nodes/extension.d.ts +6 -0
  64. package/dist/types/react/nodes/index.d.ts +1 -2
  65. package/dist/types/react/nodes/media.d.ts +0 -1
  66. package/dist/types/react/nodes/mediaInline.d.ts +6 -3
  67. package/dist/types/react/nodes/mediaSingle/index.d.ts +0 -1
  68. package/dist/types/react/nodes/table/sticky.d.ts +1 -2
  69. package/dist/types/react/nodes/table/table.d.ts +1 -1
  70. package/dist/types/react/nodes/table/types.d.ts +0 -1
  71. package/dist/types/react/types.d.ts +0 -1
  72. package/dist/types/renderer-context.d.ts +1 -0
  73. package/dist/types/ui/MediaCard.d.ts +1 -1
  74. package/dist/types/ui/Renderer/breakout-ssr.d.ts +2 -4
  75. package/dist/types/ui/renderer-props.d.ts +1 -0
  76. package/dist/types/utils.d.ts +4 -8
  77. package/package.json +20 -18
  78. package/report.api.md +225 -0
@@ -31,7 +31,7 @@ var _react2 = require("@emotion/react");
31
31
 
32
32
  var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
33
33
 
34
- var _adfUtils = require("@atlaskit/adf-utils");
34
+ var _traverse = require("@atlaskit/adf-utils/traverse");
35
35
 
36
36
  var _providerFactory = require("@atlaskit/editor-common/provider-factory");
37
37
 
@@ -224,7 +224,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
224
224
  platform: _events.PLATFORM.WEB,
225
225
  duration: duration,
226
226
  ttfb: (0, _utils.getResponseEndTime)(),
227
- nodes: (0, _adfUtils.reduce)(_this2.props.document, function (acc, node) {
227
+ nodes: (0, _traverse.reduce)(_this2.props.document, function (acc, node) {
228
228
  acc[node.type] = (acc[node.type] || 0) + 1;
229
229
  return acc;
230
230
  }, {}),
@@ -266,7 +266,6 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
266
266
  appearance: props.appearance,
267
267
  disableHeadingIDs: props.disableHeadingIDs,
268
268
  disableActions: props.disableActions,
269
- allowDynamicTextSizing: props.allowDynamicTextSizing,
270
269
  allowHeadingAnchorLinks: props.allowHeadingAnchorLinks,
271
270
  allowColumnSorting: props.allowColumnSorting,
272
271
  fireAnalyticsEvent: this.fireAnalyticsEvent,
@@ -295,7 +294,6 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
295
294
  onError = _this$props.onError,
296
295
  appearance = _this$props.appearance,
297
296
  adfStage = _this$props.adfStage,
298
- allowDynamicTextSizing = _this$props.allowDynamicTextSizing,
299
297
  truncated = _this$props.truncated,
300
298
  maxHeight = _this$props.maxHeight,
301
299
  fadeOutHeight = _this$props.fadeOutHeight,
@@ -377,7 +375,6 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
377
375
  }
378
376
  }, (0, _react2.jsx)(_SmartCardStorage.Provider, null, (0, _react2.jsx)(RendererWrapper, {
379
377
  appearance: appearance,
380
- dynamicTextSizing: !!allowDynamicTextSizing,
381
378
  allowNestedHeaderLinks: allowNestedHeaderLinks,
382
379
  allowColumnSorting: allowColumnSorting,
383
380
  allowCopyToClipboard: allowCopyToClipboard,
@@ -386,9 +383,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
386
383
  innerRef: this.editorRef,
387
384
  onClick: handleWrapperOnClick,
388
385
  onMouseDown: this.onMouseDownEditView
389
- }, enableSsrInlineScripts ? (0, _react2.jsx)(_breakoutSsr.BreakoutSSRInlineScript, {
390
- allowDynamicTextSizing: !!allowDynamicTextSizing
391
- }) : null, (0, _react2.jsx)(RendererActionsInternalUpdater, {
386
+ }, enableSsrInlineScripts ? (0, _react2.jsx)(_breakoutSsr.BreakoutSSRInlineScript, null) : null, (0, _react2.jsx)(RendererActionsInternalUpdater, {
392
387
  doc: pmDoc,
393
388
  schema: schema,
394
389
  onAnalyticsEvent: this.fireAnalyticsEvent
@@ -413,7 +408,6 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
413
408
 
414
409
  return (0, _react2.jsx)(RendererWrapper, {
415
410
  appearance: appearance,
416
- dynamicTextSizing: !!allowDynamicTextSizing,
417
411
  allowCopyToClipboard: allowCopyToClipboard,
418
412
  allowPlaceholderText: allowPlaceholderText,
419
413
  allowColumnSorting: allowColumnSorting,
@@ -469,7 +463,6 @@ var RendererWithAnalytics = /*#__PURE__*/_react.default.memo(function (props) {
469
463
 
470
464
  var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
471
465
  var allowColumnSorting = props.allowColumnSorting,
472
- dynamicTextSizing = props.dynamicTextSizing,
473
466
  allowNestedHeaderLinks = props.allowNestedHeaderLinks,
474
467
  innerRef = props.innerRef,
475
468
  appearance = props.appearance,
@@ -479,8 +472,7 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
479
472
  return (0, _react2.jsx)(_ui.WidthProvider, {
480
473
  className: "ak-renderer-wrapper"
481
474
  }, (0, _react2.jsx)(_ui.BaseTheme, {
482
- dynamicTextSizing: dynamicTextSizing,
483
- baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined
475
+ baseFontSize: appearance && appearance !== 'comment' ? _editorSharedStyles.akEditorFullPageDefaultFontSize : undefined
484
476
  }, (0, _react2.jsx)("div", {
485
477
  ref: innerRef,
486
478
  onClick: onClick,
@@ -96,7 +96,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
96
96
  headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(_headingAnchor.HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
97
97
  }
98
98
 
99
- return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), _consts.RendererCssClassName.SORTABLE_COLUMN, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _styles.tableCellPadding, (0, _tokens.token)('color.border.focused', colors.B300), headingsCss, _consts.RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
99
+ return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-of-type + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-of-type + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), _consts.RendererCssClassName.SORTABLE_COLUMN, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _styles.tableCellPadding, (0, _tokens.token)('color.border.focused', colors.B300), headingsCss, _consts.RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
100
100
  };
101
101
 
102
102
  var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
@@ -126,7 +126,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
126
126
  var themeProps = {
127
127
  theme: theme
128
128
  };
129
- return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
129
+ return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n .", "\n .", " {\n display: flex;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n &\n .", ",\n &\n .", " {\n height: calc(100% - ", "px);\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-of-type {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
130
130
  light: (0, _tokens.token)('color.text', colors.N800),
131
131
  dark: (0, _tokens.token)('color.text', '#B8C7E0')
132
132
  })(themeProps), _consts.RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), (0, _tokens.token)('color.link', colors.B400), (0, _tokens.token)('color.link', colors.B300), (0, _tokens.token)('color.link.pressed', colors.B500), colors.placeholderText(themeProps), _styles.whitespaceSharedStyles, _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(themeProps), (0, _styles.ruleSharedStyles)(themeProps), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(themeProps), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
@@ -135,7 +135,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
135
135
  })(themeProps), (0, _constants.borderRadius)(), (0, _components.themed)({
136
136
  light: (0, _tokens.token)('color.text', colors.N800),
137
137
  dark: (0, _tokens.token)('color.text', colors.DN600)
138
- })(themeProps), (0, _tokens.token)('color.background.danger', colors.R50), (0, _tokens.token)('color.text.danger', colors.R500), (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
138
+ })(themeProps), (0, _tokens.token)('color.background.danger', colors.R50), (0, _tokens.token)('color.text.danger', colors.R500), (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, _ui.shadowObserverClassNames.SHADOW_CONTAINER, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, _ui.shadowObserverClassNames.SENTINEL_LEFT, _ui.shadowObserverClassNames.SENTINEL_RIGHT, _styles.tableMarginTop, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
139
139
  light: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbar),
140
140
  dark: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbarDark)
141
141
  })(themeProps), (0, _components.themed)({
@@ -45,7 +45,7 @@ var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref)
45
45
  }
46
46
 
47
47
  var nextStates = Object.values(payload).reduce(function (acc, curr) {
48
- if (curr.annotationType === type) {
48
+ if (curr.id && curr.annotationType === type) {
49
49
  // Check for empty state to prevent additional renders
50
50
  var isEmpty = curr.state === null || curr.state === undefined;
51
51
  return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
@@ -116,7 +116,9 @@ var useAnnotationClickEvent = function useAnnotationClickEvent(props) {
116
116
  var cb = function cb(_ref3) {
117
117
  var annotationIds = _ref3.annotationIds,
118
118
  eventTarget = _ref3.eventTarget;
119
- var annotationsByType = annotationIds.map(function (id) {
119
+ var annotationsByType = annotationIds.filter(function (id) {
120
+ return !!id;
121
+ }).map(function (id) {
120
122
  return {
121
123
  id: id,
122
124
  type: _adfSchema.AnnotationTypes.INLINE_COMMENT
package/dist/cjs/utils.js CHANGED
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.ADFEncoder = void 0;
9
- exports.findHorizontalOverflowScrollParent = findHorizontalOverflowScrollParent;
10
9
  exports.findInTree = findInTree;
11
10
  exports.getText = exports.getPlatform = exports.getEventHandler = void 0;
12
11
 
@@ -41,32 +40,9 @@ var getEventHandler = function getEventHandler(eventHandlers, type) {
41
40
  var eventName = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'onClick';
42
41
  return eventHandlers && type && eventHandlers[type] && eventHandlers[type][eventName];
43
42
  };
44
- /**
45
- * Traverse DOM Tree upwards looking for table parents with "overflow: scroll".
46
- */
47
-
48
43
 
49
44
  exports.getEventHandler = getEventHandler;
50
45
 
51
- function findHorizontalOverflowScrollParent(table) {
52
- var parent = table;
53
-
54
- if (!parent) {
55
- return null;
56
- }
57
-
58
- while (parent = parent.parentElement) {
59
- // IE11 on Window 8 doesn't show styles from CSS when accessing through element.style property.
60
- var style = window.getComputedStyle(parent);
61
-
62
- if (style.overflow === 'scroll' || style.overflowY === 'scroll') {
63
- return parent;
64
- }
65
- }
66
-
67
- return null;
68
- }
69
-
70
46
  var getPlatform = function getPlatform(rendererAppearance) {
71
47
  if (rendererAppearance === 'mobile') {
72
48
  return 'mobile';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "95.0.1",
3
+ "version": "96.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -162,7 +162,6 @@ export default class ReactSerializer {
162
162
  this.appearance = init.appearance;
163
163
  this.disableHeadingIDs = init.disableHeadingIDs;
164
164
  this.disableActions = init.disableActions;
165
- this.allowDynamicTextSizing = init.allowDynamicTextSizing;
166
165
  this.allowHeadingAnchorLinks = init.allowHeadingAnchorLinks;
167
166
  this.allowCopyToClipboard = init.allowCopyToClipboard;
168
167
  this.allowPlaceholderText = init.allowPlaceholderText;
@@ -482,7 +481,6 @@ export default class ReactSerializer {
482
481
  rendererContext: this.rendererContext,
483
482
  serializer: this,
484
483
  content: node.content ? node.content.toJSON() : undefined,
485
- allowDynamicTextSizing: this.allowDynamicTextSizing,
486
484
  allowHeadingAnchorLinks: this.allowHeadingAnchorLinks,
487
485
  allowCopyToClipboard: this.allowCopyToClipboard,
488
486
  allowPlaceholderText: this.allowPlaceholderText,
@@ -4,8 +4,8 @@ import _extends from "@babel/runtime/helpers/extends";
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { useMemo, useContext, useState, useRef } from 'react';
6
6
  import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
7
- import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
8
- import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, getAkEditorFullPageMaxWidth } from '@atlaskit/editor-shared-styles';
7
+ import { WidthConsumer, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
8
+ import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
9
9
  import { getPlatform } from '../../utils';
10
10
  import { CardErrorBoundary } from './fallback';
11
11
  import { FullPagePadding } from '../../ui/Renderer/style';
@@ -37,7 +37,6 @@ export default function EmbedCard(props) {
37
37
  layout,
38
38
  width,
39
39
  isInsideOfBlockNode,
40
- allowDynamicTextSizing,
41
40
  rendererAppearance
42
41
  } = props;
43
42
  const embedIframeRef = useRef(null);
@@ -103,10 +102,8 @@ export default function EmbedCard(props) {
103
102
  if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
104
103
  const isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= akEditorDefaultLayoutWidth;
105
104
 
106
- if (isContainerSizeGreaterThanMaxFullPageWidth && allowDynamicTextSizing) {
107
- nonFullWidthSize = mapBreakpointToLayoutMaxWidth(breakpoint);
108
- } else if (isContainerSizeGreaterThanMaxFullPageWidth) {
109
- nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
105
+ if (isContainerSizeGreaterThanMaxFullPageWidth) {
106
+ nonFullWidthSize = akEditorDefaultLayoutWidth;
110
107
  } else {
111
108
  nonFullWidthSize = containerWidth - padding;
112
109
  }
@@ -6,6 +6,7 @@ import { UnsupportedInline } from '@atlaskit/editor-common/ui';
6
6
  import { CardErrorBoundary } from './fallback';
7
7
  import { withSmartCardStorage } from '../../ui/SmartCardStorage';
8
8
  import { getCardClickHandler } from '../utils/getCardClickHandler';
9
+ import { useFeatureFlags } from '../../use-feature-flags';
9
10
 
10
11
  const InlineCard = props => {
11
12
  const {
@@ -22,6 +23,7 @@ const InlineCard = props => {
22
23
  onClick,
23
24
  container: portal
24
25
  };
26
+ const featureFlags = useFeatureFlags();
25
27
 
26
28
  if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url) {
27
29
  return /*#__PURE__*/React.createElement(CardSSR, {
@@ -37,7 +39,8 @@ const InlineCard = props => {
37
39
  }, /*#__PURE__*/React.createElement(CardErrorBoundary, _extends({
38
40
  unsupportedComponent: UnsupportedInline
39
41
  }, cardProps), /*#__PURE__*/React.createElement(Card, _extends({
40
- appearance: "inline"
42
+ appearance: "inline",
43
+ showHoverPreview: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.showHoverPreview
41
44
  }, cardProps, {
42
45
  onResolve: data => {
43
46
  if (!data.url || !data.title) {
@@ -1,11 +1,15 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React, { useEffect, useState } from 'react';
2
3
  import { MediaInlineCard } from '@atlaskit/media-card';
4
+ import { MediaInlineCardErroredView, MediaInlineCardLoadingView, messages } from '@atlaskit/media-ui';
3
5
  import { WithProviders } from '@atlaskit/editor-common/provider-factory';
6
+ import { getClipboardAttrs } from '../../ui/MediaCard';
7
+ import { createIntl, injectIntl } from 'react-intl-next';
4
8
  export const RenderMediaInline = props => {
5
9
  const {
6
10
  mediaProvider
7
11
  } = props;
8
- const [viewMediaClientConfigState, setViewMediaClientConfigState] = useState({});
12
+ const [viewMediaClientConfigState, setViewMediaClientConfigState] = useState();
9
13
  useEffect(() => {
10
14
  updateViewMediaClientConfigState(mediaProvider);
11
15
  }, [mediaProvider]);
@@ -16,6 +20,18 @@ export const RenderMediaInline = props => {
16
20
  setViewMediaClientConfigState(mediaClientConfig.viewMediaClientConfig);
17
21
  }
18
22
  };
23
+ /*
24
+ * Only show the loading view if the media provider is not ready
25
+ * prevents calling the media API before the provider is ready
26
+ */
27
+
28
+
29
+ if (!viewMediaClientConfigState) {
30
+ return /*#__PURE__*/React.createElement(MediaInlineCardLoadingView, {
31
+ message: "",
32
+ isSelected: false
33
+ });
34
+ }
19
35
 
20
36
  return /*#__PURE__*/React.createElement(MediaInlineCard, {
21
37
  identifier: props.identifier,
@@ -28,20 +44,36 @@ const MediaInline = props => {
28
44
  const {
29
45
  collection,
30
46
  id,
31
- providers
47
+ providers,
48
+ intl
32
49
  } = props;
33
50
  const identifier = {
34
51
  id,
35
52
  mediaItemType: 'file',
36
53
  collectionName: collection
37
54
  };
38
- return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(WithProviders, {
55
+ const defaultIntl = createIntl({
56
+ locale: 'en'
57
+ });
58
+ return /*#__PURE__*/React.createElement("span", _extends({}, getClipboardAttrs({
59
+ id,
60
+ collection
61
+ }), {
62
+ "data-node-type": "mediaInline"
63
+ }), /*#__PURE__*/React.createElement(WithProviders, {
39
64
  providers: ['mediaProvider'],
40
65
  providerFactory: providers,
41
66
  renderNode: providers => {
42
67
  const {
43
68
  mediaProvider
44
69
  } = providers;
70
+
71
+ if (!mediaProvider) {
72
+ return /*#__PURE__*/React.createElement(MediaInlineCardErroredView, {
73
+ message: (intl || defaultIntl).formatMessage(messages.couldnt_load_file)
74
+ });
75
+ }
76
+
45
77
  return /*#__PURE__*/React.createElement(RenderMediaInline, {
46
78
  identifier: identifier,
47
79
  mediaProvider: mediaProvider
@@ -50,4 +82,4 @@ const MediaInline = props => {
50
82
  }));
51
83
  };
52
84
 
53
- export default MediaInline;
85
+ export default injectIntl(MediaInline);
@@ -3,8 +3,8 @@ import { default as React, Fragment } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import { injectIntl } from 'react-intl-next';
5
5
  import { getMediaFeatureFlag } from '@atlaskit/media-common';
6
- import { mapBreakpointToLayoutMaxWidth, getBreakpoint, MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
7
- import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
6
+ import { MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
7
+ import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
8
8
  import { FullPagePadding } from '../../../ui/Renderer/style';
9
9
  import { useObservedWidth } from '../../hooks/use-observed-width';
10
10
  import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
@@ -48,7 +48,6 @@ const MediaSingle = props => {
48
48
  rendererAppearance,
49
49
  featureFlags,
50
50
  isInsideOfBlockNode,
51
- allowDynamicTextSizing,
52
51
  layout,
53
52
  children,
54
53
  width: pctWidth
@@ -119,7 +118,6 @@ const MediaSingle = props => {
119
118
 
120
119
  const calcDimensions = (mediaContainerWidth, mediaBreakpoint) => {
121
120
  const containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
122
- const breakpoint = mediaBreakpoint || getBreakpoint(containerWidth);
123
121
  const maxWidth = containerWidth;
124
122
  const maxHeight = height / width * maxWidth;
125
123
  const cardDimensions = {
@@ -129,12 +127,10 @@ const MediaSingle = props => {
129
127
  let nonFullWidthSize = containerWidth;
130
128
 
131
129
  if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
132
- const isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
130
+ const isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= akEditorDefaultLayoutWidth;
133
131
 
134
- if (isContainerSizeGreaterThanMaxFullPageWidth && allowDynamicTextSizing) {
135
- nonFullWidthSize = mapBreakpointToLayoutMaxWidth(breakpoint);
136
- } else if (isContainerSizeGreaterThanMaxFullPageWidth) {
137
- nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
132
+ if (isContainerSizeGreaterThanMaxFullPageWidth) {
133
+ nonFullWidthSize = akEditorDefaultLayoutWidth;
138
134
  } else {
139
135
  nonFullWidthSize = containerWidth - padding;
140
136
  }
@@ -23,22 +23,25 @@ const PanelStyled = props => {
23
23
  `;
24
24
 
25
25
  if (props['data-panel-type'] === PanelType.CUSTOM && props.backgroundColor) {
26
- styles = theme => css`
27
- &.${PanelSharedCssClassName.prefix} {
28
- ${panelSharedStylesWithoutPrefix({
29
- theme
30
- })}
31
- }
32
-
33
- &[data-panel-type=${PanelType.CUSTOM}] {
34
- background-color: ${props.backgroundColor};
35
- ${themed({
36
- dark: getPanelBackgroundDarkModeColors
37
- })({
38
- theme
39
- })};
40
- }
41
- `;
26
+ styles = theme => {
27
+ const customStyle = themed({
28
+ dark: getPanelBackgroundDarkModeColors,
29
+ light: `background-color: ${props.backgroundColor};`
30
+ })({
31
+ theme
32
+ });
33
+ return css`
34
+ &.${PanelSharedCssClassName.prefix} {
35
+ ${panelSharedStylesWithoutPrefix({
36
+ theme
37
+ })}
38
+ }
39
+
40
+ &[data-panel-type=${PanelType.CUSTOM}] {
41
+ ${customStyle};
42
+ }
43
+ `;
44
+ };
42
45
  }
43
46
 
44
47
  return jsx("div", _extends({
@@ -14,11 +14,7 @@ const getTableLayoutWidth = (layout, opts) => {
14
14
  return akEditorWideLayoutWidth;
15
15
 
16
16
  default:
17
- const {
18
- containerWidth,
19
- isDynamicTextSizingEnabled
20
- } = opts || {};
21
- return calcLineLength(containerWidth, isDynamicTextSizingEnabled);
17
+ return calcLineLength();
22
18
  }
23
19
  };
24
20
 
@@ -55,8 +51,7 @@ export const Colgroup = props => {
55
51
  columnWidths,
56
52
  layout,
57
53
  isNumberColumnEnabled,
58
- renderWidth,
59
- allowDynamicTextSizing
54
+ renderWidth
60
55
  } = props;
61
56
 
62
57
  if (!columnWidths || !isTableResized(columnWidths)) {
@@ -65,7 +60,6 @@ export const Colgroup = props => {
65
60
 
66
61
 
67
62
  const layoutWidth = getTableLayoutWidth(layout, {
68
- isDynamicTextSizingEnabled: allowDynamicTextSizing,
69
63
  containerWidth: renderWidth
70
64
  });
71
65
  const maxTableWidth = renderWidth < layoutWidth ? renderWidth : layoutWidth; // If table has a layout of default, it is confined by the defined column width.
@@ -5,13 +5,8 @@ import React from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
7
7
  import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
8
- import * as colors from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
9
-
10
- const {
11
- N40A
12
- } = colors;
8
+ import { N40A } from '@atlaskit/theme/colors';
13
9
  import { token } from '@atlaskit/tokens';
14
- import { findHorizontalOverflowScrollParent } from '../../../utils';
15
10
  import { Table } from './table';
16
11
  import { recursivelyInjectProps } from '../../utils/inject-props';
17
12
  export const tableStickyPadding = 8;
@@ -86,7 +81,6 @@ export const StickyTable = ({
86
81
  children,
87
82
  columnWidths,
88
83
  renderWidth,
89
- allowDynamicTextSizing,
90
84
  rowHeight
91
85
  }) => {
92
86
  return jsx("div", {
@@ -100,7 +94,7 @@ export const StickyTable = ({
100
94
  mode: rowHeight > 300 ? 'none' : mode,
101
95
  wrapperWidth: wrapperWidth
102
96
  }, jsx("div", {
103
- className: `${TableSharedCssClassName.TABLE_CONTAINER} ${shadowClassNames}`,
97
+ className: `${TableSharedCssClassName.TABLE_CONTAINER} ${shadowClassNames || ''}`,
104
98
  "data-layout": layout,
105
99
  style: {
106
100
  width: tableWidth
@@ -115,8 +109,7 @@ export const StickyTable = ({
115
109
  columnWidths: columnWidths,
116
110
  layout: layout,
117
111
  isNumberColumnEnabled: isNumberColumnEnabled,
118
- renderWidth: renderWidth,
119
- allowDynamicTextSizing: allowDynamicTextSizing
112
+ renderWidth: renderWidth
120
113
  },
121
114
  /**
122
115
  * @see https://product-fabric.atlassian.net/browse/ED-10235
@@ -128,6 +121,29 @@ export const StickyTable = ({
128
121
  invisible: true
129
122
  }))))));
130
123
  };
124
+ /**
125
+ * Traverse DOM Tree upwards looking for table parents with "overflow: scroll".
126
+ */
127
+
128
+ function findHorizontalOverflowScrollParent(table) {
129
+ let parent = table;
130
+
131
+ if (!parent) {
132
+ return null;
133
+ }
134
+
135
+ while (parent = parent.parentElement) {
136
+ // IE11 on Window 8 doesn't show styles from CSS when accessing through element.style property.
137
+ const style = window.getComputedStyle(parent);
138
+
139
+ if (style.overflow === 'scroll' || style.overflowY === 'scroll') {
140
+ return parent;
141
+ }
142
+ }
143
+
144
+ return null;
145
+ }
146
+
131
147
  export class OverflowParent {
132
148
  constructor(ref) {
133
149
  this.ref = ref;
@@ -6,7 +6,6 @@ export const Table = /*#__PURE__*/React.memo(({
6
6
  columnWidths,
7
7
  layout,
8
8
  renderWidth,
9
- allowDynamicTextSizing,
10
9
  children
11
10
  }) => {
12
11
  return /*#__PURE__*/React.createElement("table", {
@@ -16,7 +15,6 @@ export const Table = /*#__PURE__*/React.memo(({
16
15
  columnWidths: columnWidths,
17
16
  layout: layout,
18
17
  isNumberColumnEnabled: isNumberColumnEnabled,
19
- renderWidth: renderWidth,
20
- allowDynamicTextSizing: allowDynamicTextSizing
18
+ renderWidth: renderWidth
21
19
  }), /*#__PURE__*/React.createElement("tbody", null, children));
22
20
  });
@@ -253,7 +253,6 @@ export class TableContainer extends React.Component {
253
253
  isNumberColumnEnabled,
254
254
  layout,
255
255
  renderWidth,
256
- allowDynamicTextSizing,
257
256
  columnWidths,
258
257
  stickyHeaders,
259
258
  tableNode
@@ -262,7 +261,7 @@ export class TableContainer extends React.Component {
262
261
  stickyMode
263
262
  } = this.state;
264
263
  let tableWidth = calcTableWidth(layout, renderWidth, false);
265
- const lineLength = calcLineLength(renderWidth, allowDynamicTextSizing);
264
+ const lineLength = calcLineLength();
266
265
  let left;
267
266
 
268
267
  if (canUseLinelength(this.props.rendererAppearance) && tableWidth !== 'inherit') {
@@ -285,10 +284,9 @@ export class TableContainer extends React.Component {
285
284
  innerRef: this.stickyWrapperRef,
286
285
  wrapperWidth: wrapperWidth,
287
286
  columnWidths: columnWidths,
288
- rowHeight: this.headerRowHeight,
289
- allowDynamicTextSizing: allowDynamicTextSizing
287
+ rowHeight: this.headerRowHeight
290
288
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
291
- className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames}`,
289
+ className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames || ''}`,
292
290
  "data-layout": layout,
293
291
  ref: this.props.handleRef,
294
292
  style: {
@@ -304,8 +302,7 @@ export class TableContainer extends React.Component {
304
302
  columnWidths: columnWidths,
305
303
  layout: layout,
306
304
  isNumberColumnEnabled: isNumberColumnEnabled,
307
- renderWidth: renderWidth,
308
- allowDynamicTextSizing: allowDynamicTextSizing
305
+ renderWidth: renderWidth
309
306
  }, this.grabFirstRowRef(children)))));
310
307
  }
311
308
 
@@ -375,14 +372,26 @@ export class TableProcessor extends React.Component {
375
372
 
376
373
  }
377
374
  const TableWithShadows = overflowShadow(TableProcessor, {
378
- overflowSelector: `.${TableSharedCssClassName.TABLE_NODE_WRAPPER}`
375
+ overflowSelector: `.${TableSharedCssClassName.TABLE_NODE_WRAPPER}`,
376
+ useShadowObserver: true
379
377
  });
380
378
 
381
379
  const TableWithWidth = props => /*#__PURE__*/React.createElement(WidthConsumer, null, ({
382
380
  width
383
381
  }) => {
382
+ var _props$columnWidths;
383
+
384
384
  const renderWidth = props.rendererAppearance === 'full-page' ? width - FullPagePadding * 2 : width;
385
- return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
385
+ const colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce((total, val) => total + val, 0)) || 0;
386
+
387
+ if (colWidthsSum) {
388
+ return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
389
+ renderWidth: renderWidth
390
+ }, props));
391
+ } // there should not be a case when colWidthsSum is 0 and table is in overflow state - so no need to render shadows in this case
392
+
393
+
394
+ return /*#__PURE__*/React.createElement(TableProcessor, _extends({
386
395
  renderWidth: renderWidth
387
396
  }, props));
388
397
  });