@atlaskit/renderer 108.11.0 → 108.11.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 108.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`32f9d24dcdb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/32f9d24dcdb) - Improve table renderer resizing performance.
8
+
9
+ ## 108.11.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`39099193642`](https://bitbucket.org/atlassian/atlassian-frontend/commits/39099193642) - Cleanup breakout styling when table has fragment mark ff
14
+
3
15
  ## 108.11.0
4
16
 
5
17
  ### Minor Changes
@@ -17,6 +17,7 @@ var Table = /*#__PURE__*/_react.default.memo(function (_ref) {
17
17
  tableNode = _ref.tableNode,
18
18
  rendererAppearance = _ref.rendererAppearance;
19
19
  return /*#__PURE__*/_react.default.createElement("table", {
20
+ "data-testid": "renderer-table",
20
21
  "data-number-column": isNumberColumnEnabled,
21
22
  ref: innerRef
22
23
  }, /*#__PURE__*/_react.default.createElement(_colgroup.Colgroup, {
@@ -27,6 +27,9 @@ var _SmartCardStorage = require("../../ui/SmartCardStorage");
27
27
  var _sticky = require("./table/sticky");
28
28
  var _table = require("./table/table");
29
29
  var _appearance = require("../utils/appearance");
30
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
31
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
32
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
30
33
  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); }; }
31
34
  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; } }
32
35
  var isTableResizingEnabled = function isTableResizingEnabled(appearance) {
@@ -126,7 +129,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
126
129
  }
127
130
  _this = _super.call.apply(_super, [this].concat(args));
128
131
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
129
- stickyMode: 'none'
132
+ stickyMode: 'none',
133
+ wrapperWidth: 0,
134
+ headerRowHeight: 0
130
135
  });
131
136
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableRef", /*#__PURE__*/_react.default.createRef());
132
137
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "stickyHeaderRef", /*#__PURE__*/_react.default.createRef());
@@ -134,6 +139,33 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
134
139
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "stickyWrapperRef", /*#__PURE__*/_react.default.createRef());
135
140
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperRef", /*#__PURE__*/_react.default.createRef());
136
141
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "overflowParent", null);
142
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resizeObserver", null);
143
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "applyResizerChange", function (entries) {
144
+ var wrapperWidth = _this.state.wrapperWidth;
145
+ var headerRowHeight = _this.state.headerRowHeight;
146
+ var _iterator = _createForOfIteratorHelper(entries),
147
+ _step;
148
+ try {
149
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
150
+ var entry = _step.value;
151
+ if (entry.target === _this.wrapperRef.current) {
152
+ wrapperWidth = entry.contentRect.width;
153
+ } else if (entry.target === _this.stickyHeaderRef.current) {
154
+ headerRowHeight = Math.round(entry.contentRect.height);
155
+ }
156
+ }
157
+ } catch (err) {
158
+ _iterator.e(err);
159
+ } finally {
160
+ _iterator.f();
161
+ }
162
+ if (headerRowHeight !== _this.state.headerRowHeight || wrapperWidth !== _this.state.wrapperWidth) {
163
+ _this.setState({
164
+ wrapperWidth: wrapperWidth,
165
+ headerRowHeight: headerRowHeight
166
+ });
167
+ }
168
+ });
137
169
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentWillUnmount", function () {
138
170
  if (_this.overflowParent) {
139
171
  _this.overflowParent.removeEventListener('scroll', _this.onScroll);
@@ -141,6 +173,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
141
173
  if (_this.nextFrame) {
142
174
  cancelAnimationFrame(_this.nextFrame);
143
175
  }
176
+ if (_this.resizeObserver) {
177
+ _this.resizeObserver.disconnect();
178
+ }
144
179
  });
145
180
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getScrollTop", function () {
146
181
  var stickyHeaders = _this.props.stickyHeaders;
@@ -197,6 +232,13 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
197
232
  (0, _createClass2.default)(TableContainer, [{
198
233
  key: "componentDidMount",
199
234
  value: function componentDidMount() {
235
+ this.resizeObserver = new ResizeObserver(this.applyResizerChange);
236
+ if (this.wrapperRef.current) {
237
+ this.resizeObserver.observe(this.wrapperRef.current);
238
+ }
239
+ if (this.stickyHeaderRef.current) {
240
+ this.resizeObserver.observe(this.stickyHeaderRef.current);
241
+ }
200
242
  if (this.props.stickyHeaders) {
201
243
  this.overflowParent = _sticky.OverflowParent.fromElement(this.tableRef.current);
202
244
  this.overflowParent.addEventListener('scroll', this.onScroll);
@@ -243,11 +285,6 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
243
285
  return undefined;
244
286
  }
245
287
  }
246
- }, {
247
- key: "headerRowHeight",
248
- get: function get() {
249
- return this.stickyHeaderRef.current ? this.stickyHeaderRef.current.offsetHeight : 0;
250
- }
251
288
  }, {
252
289
  key: "render",
253
290
  value: function render() {
@@ -274,7 +311,6 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
274
311
  if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
275
312
  left = lineLength / 2 - tableWidth / 2;
276
313
  }
277
- var wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
278
314
  var children = _react.default.Children.toArray(this.props.children);
279
315
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/_react.default.createElement(_sticky.StickyTable, {
280
316
  isNumberColumnEnabled: isNumberColumnEnabled,
@@ -287,9 +323,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
287
323
  left: left,
288
324
  mode: stickyMode,
289
325
  innerRef: this.stickyWrapperRef,
290
- wrapperWidth: wrapperWidth,
326
+ wrapperWidth: this.state.wrapperWidth,
291
327
  columnWidths: columnWidths,
292
- rowHeight: this.headerRowHeight,
328
+ rowHeight: this.state.headerRowHeight,
293
329
  rendererAppearance: rendererAppearance
294
330
  }, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
295
331
  className: "".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
@@ -309,9 +345,9 @@ var TableContainer = /*#__PURE__*/function (_React$Component) {
309
345
  top: this.stickyTop,
310
346
  mode: stickyMode,
311
347
  innerRef: this.stickyWrapperRef,
312
- wrapperWidth: wrapperWidth,
348
+ wrapperWidth: this.state.wrapperWidth,
313
349
  columnWidths: columnWidths,
314
- rowHeight: this.headerRowHeight,
350
+ rowHeight: this.state.headerRowHeight,
315
351
  tableNode: tableNode,
316
352
  rendererAppearance: rendererAppearance
317
353
  }, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
55
55
  var DEGRADED_SEVERITY_THRESHOLD = 3000;
56
56
  exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "108.11.0";
58
+ var packageVersion = "108.11.2";
59
59
  var Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -351,7 +351,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
351
351
  }
352
352
  };
353
353
  try {
354
- var _featureFlags$feature, _featureFlags$feature2, _this$featureFlags2, _this$featureFlags2$f, _this$featureFlags2$f2;
354
+ var _featureFlags$feature, _this$featureFlags2, _this$featureFlags2$f, _this$featureFlags2$f2;
355
355
  var schema = this.getSchema(this.props.schema, this.props.adfStage);
356
356
  var _renderDocument = (0, _.renderDocument)(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
357
357
  result = _renderDocument.result,
@@ -378,8 +378,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
378
378
  allowWrapCodeBlock: allowWrapCodeBlock,
379
379
  allowCustomPanels: allowCustomPanels,
380
380
  allowPlaceholderText: allowPlaceholderText,
381
- useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
382
- useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
381
+ useBlockRenderForCodeBlock: (_featureFlags$feature = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
383
382
  innerRef: this.editorRef,
384
383
  onClick: handleWrapperOnClick,
385
384
  onMouseDown: this.onMouseDownEditView
@@ -402,7 +401,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
402
401
  });
403
402
  return (0, _react2.jsx)(_react.Fragment, null, reRenderTracking, rendererResult);
404
403
  } catch (e) {
405
- var _featureFlags$feature3, _featureFlags$feature4;
404
+ var _featureFlags$feature2;
406
405
  if (onError) {
407
406
  onError(e);
408
407
  }
@@ -413,8 +412,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
413
412
  allowPlaceholderText: allowPlaceholderText,
414
413
  allowColumnSorting: allowColumnSorting,
415
414
  allowNestedHeaderLinks: allowNestedHeaderLinks,
416
- useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature3 = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature3 !== void 0 ? _featureFlags$feature3 : true,
417
- useBlockRenderForCodeBlock: (_featureFlags$feature4 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature4 !== void 0 ? _featureFlags$feature4 : true,
415
+ useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
418
416
  onClick: handleWrapperOnClick
419
417
  }, (0, _react2.jsx)(_ui.UnsupportedBlock, null));
420
418
  }
@@ -468,7 +466,6 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
468
466
  children = props.children,
469
467
  onClick = props.onClick,
470
468
  onMouseDown = props.onMouseDown,
471
- useFragmentMarkBreakoutWidthStylingFix = props.useFragmentMarkBreakoutWidthStylingFix,
472
469
  useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock;
473
470
  return (0, _react2.jsx)(_ui.WidthProvider, {
474
471
  className: "ak-renderer-wrapper"
@@ -482,7 +479,6 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
482
479
  appearance: appearance,
483
480
  allowNestedHeaderLinks: allowNestedHeaderLinks,
484
481
  allowColumnSorting: !!allowColumnSorting,
485
- useFragmentMarkBreakoutWidthStylingFix: useFragmentMarkBreakoutWidthStylingFix,
486
482
  useBlockRenderForCodeBlock: useBlockRenderForCodeBlock
487
483
  })
488
484
  }, children)));
@@ -20,7 +20,7 @@ var _consts = require("../../consts");
20
20
  var _headingAnchor = require("../../react/nodes/heading-anchor");
21
21
  var _lightWeightCodeBlock = require("../../react/nodes/codeBlock/components/lightWeightCodeBlock");
22
22
  var _table = require("../../react/nodes/table");
23
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
23
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
24
24
  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); }
25
25
  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; }
26
26
  var FullPagePadding = 32;
@@ -89,11 +89,8 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
89
89
  }
90
90
  return (0, _react.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), _editorSharedStyles.akEditorFullWidthLayoutWidth, (0, _table.isTableResizingEnabled)(appearance) ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
91
91
  };
92
- var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
93
- if (useFragmentMarkBreakoutWidthStylingFix) {
94
- return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n *:not([data-mark-type='fragment'])\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n [data-mark-type='fragment']\n *\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_CONTAINER);
95
- }
96
- return (0, _react.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), _styles.TableSharedCssClassName.TABLE_CONTAINER);
92
+ var breakoutWidthStyle = function breakoutWidthStyle() {
93
+ return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n *:not([data-mark-type='fragment'])\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n [data-mark-type='fragment'] * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_CONTAINER);
97
94
  };
98
95
  var rendererStyles = function rendererStyles(wrapperProps) {
99
96
  return function (theme) {
@@ -102,7 +99,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
102
99
  theme: theme
103
100
  };
104
101
  var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock;
105
- return (0, _react.css)(_templateObject8 || (_templateObject8 = (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: ", ";\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: ", " 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\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: block;\n /* stylelint-enable */\n\n position: relative;\n border-radius: ", ";\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\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n\n ", "\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", ";\n & > div + div {\n margin-left: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
102
+ return (0, _react.css)(_templateObject7 || (_templateObject7 = (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: ", ";\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: ", " 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\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: block;\n /* stylelint-enable */\n\n position: relative;\n border-radius: ", ";\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\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n\n ", "\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", ";\n & > div + div {\n margin-left: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
106
103
  light: "var(--ds-text, ".concat(colors.N800, ")"),
107
104
  dark: "var(--ds-text, #B8C7E0)"
108
105
  })(themeProps), _consts.RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), (0, _components.themed)({
@@ -114,7 +111,7 @@ var rendererStyles = function rendererStyles(wrapperProps) {
114
111
  })(themeProps), "var(--ds-border-radius-100, 3px)", (0, _components.themed)({
115
112
  light: "var(--ds-text, ".concat(colors.N800, ")"),
116
113
  dark: "var(--ds-text, ".concat(colors.DN600, ")")
117
- })(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, breakoutWidthStyle(wrapperProps.useFragmentMarkBreakoutWidthStylingFix), _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)({
114
+ })(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, breakoutWidthStyle(), _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)({
118
115
  light: "var(--ds-background-neutral, ".concat(_editorSharedStyles.akEditorTableToolbar, ")"),
119
116
  dark: "var(--ds-background-neutral, ".concat(_editorSharedStyles.akEditorTableToolbarDark, ")")
120
117
  })(themeProps), (0, _components.themed)({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.11.0",
3
+ "version": "108.11.2",
4
4
  "sideEffects": false
5
5
  }
@@ -11,6 +11,7 @@ export const Table = /*#__PURE__*/React.memo(({
11
11
  rendererAppearance
12
12
  }) => {
13
13
  return /*#__PURE__*/React.createElement("table", {
14
+ "data-testid": "renderer-table",
14
15
  "data-number-column": isNumberColumnEnabled,
15
16
  ref: innerRef
16
17
  }, /*#__PURE__*/React.createElement(Colgroup, {
@@ -91,7 +91,9 @@ export class TableContainer extends React.Component {
91
91
  constructor(...args) {
92
92
  super(...args);
93
93
  _defineProperty(this, "state", {
94
- stickyMode: 'none'
94
+ stickyMode: 'none',
95
+ wrapperWidth: 0,
96
+ headerRowHeight: 0
95
97
  });
96
98
  _defineProperty(this, "tableRef", /*#__PURE__*/React.createRef());
97
99
  _defineProperty(this, "stickyHeaderRef", /*#__PURE__*/React.createRef());
@@ -99,6 +101,24 @@ export class TableContainer extends React.Component {
99
101
  _defineProperty(this, "stickyWrapperRef", /*#__PURE__*/React.createRef());
100
102
  _defineProperty(this, "wrapperRef", /*#__PURE__*/React.createRef());
101
103
  _defineProperty(this, "overflowParent", null);
104
+ _defineProperty(this, "resizeObserver", null);
105
+ _defineProperty(this, "applyResizerChange", entries => {
106
+ let wrapperWidth = this.state.wrapperWidth;
107
+ let headerRowHeight = this.state.headerRowHeight;
108
+ for (const entry of entries) {
109
+ if (entry.target === this.wrapperRef.current) {
110
+ wrapperWidth = entry.contentRect.width;
111
+ } else if (entry.target === this.stickyHeaderRef.current) {
112
+ headerRowHeight = Math.round(entry.contentRect.height);
113
+ }
114
+ }
115
+ if (headerRowHeight !== this.state.headerRowHeight || wrapperWidth !== this.state.wrapperWidth) {
116
+ this.setState({
117
+ wrapperWidth,
118
+ headerRowHeight
119
+ });
120
+ }
121
+ });
102
122
  _defineProperty(this, "componentWillUnmount", () => {
103
123
  if (this.overflowParent) {
104
124
  this.overflowParent.removeEventListener('scroll', this.onScroll);
@@ -106,6 +126,9 @@ export class TableContainer extends React.Component {
106
126
  if (this.nextFrame) {
107
127
  cancelAnimationFrame(this.nextFrame);
108
128
  }
129
+ if (this.resizeObserver) {
130
+ this.resizeObserver.disconnect();
131
+ }
109
132
  });
110
133
  _defineProperty(this, "getScrollTop", () => {
111
134
  const {
@@ -161,6 +184,13 @@ export class TableContainer extends React.Component {
161
184
  });
162
185
  }
163
186
  componentDidMount() {
187
+ this.resizeObserver = new ResizeObserver(this.applyResizerChange);
188
+ if (this.wrapperRef.current) {
189
+ this.resizeObserver.observe(this.wrapperRef.current);
190
+ }
191
+ if (this.stickyHeaderRef.current) {
192
+ this.resizeObserver.observe(this.stickyHeaderRef.current);
193
+ }
164
194
  if (this.props.stickyHeaders) {
165
195
  this.overflowParent = OverflowParent.fromElement(this.tableRef.current);
166
196
  this.overflowParent.addEventListener('scroll', this.onScroll);
@@ -201,9 +231,6 @@ export class TableContainer extends React.Component {
201
231
  return undefined;
202
232
  }
203
233
  }
204
- get headerRowHeight() {
205
- return this.stickyHeaderRef.current ? this.stickyHeaderRef.current.offsetHeight : 0;
206
- }
207
234
  render() {
208
235
  const {
209
236
  isNumberColumnEnabled,
@@ -231,7 +258,6 @@ export class TableContainer extends React.Component {
231
258
  if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
232
259
  left = lineLength / 2 - tableWidth / 2;
233
260
  }
234
- const wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
235
261
  const children = React.Children.toArray(this.props.children);
236
262
  return /*#__PURE__*/React.createElement(React.Fragment, null, !getBooleanFF('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
237
263
  isNumberColumnEnabled: isNumberColumnEnabled,
@@ -244,9 +270,9 @@ export class TableContainer extends React.Component {
244
270
  left: left,
245
271
  mode: stickyMode,
246
272
  innerRef: this.stickyWrapperRef,
247
- wrapperWidth: wrapperWidth,
273
+ wrapperWidth: this.state.wrapperWidth,
248
274
  columnWidths: columnWidths,
249
- rowHeight: this.headerRowHeight,
275
+ rowHeight: this.state.headerRowHeight,
250
276
  rendererAppearance: rendererAppearance
251
277
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
252
278
  className: `${TableSharedCssClassName.TABLE_CONTAINER} ${this.props.shadowClassNames || ''}`,
@@ -266,9 +292,9 @@ export class TableContainer extends React.Component {
266
292
  top: this.stickyTop,
267
293
  mode: stickyMode,
268
294
  innerRef: this.stickyWrapperRef,
269
- wrapperWidth: wrapperWidth,
295
+ wrapperWidth: this.state.wrapperWidth,
270
296
  columnWidths: columnWidths,
271
- rowHeight: this.headerRowHeight,
297
+ rowHeight: this.state.headerRowHeight,
272
298
  tableNode: tableNode,
273
299
  rendererAppearance: rendererAppearance
274
300
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
35
35
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
36
36
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
37
37
  const packageName = "@atlaskit/renderer";
38
- const packageVersion = "108.11.0";
38
+ const packageVersion = "108.11.2";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -327,7 +327,7 @@ export class Renderer extends PureComponent {
327
327
  }
328
328
  };
329
329
  try {
330
- var _featureFlags$feature, _featureFlags$feature2, _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
330
+ var _featureFlags$feature, _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
331
331
  const schema = this.getSchema(this.props.schema, this.props.adfStage);
332
332
  const {
333
333
  result,
@@ -353,8 +353,7 @@ export class Renderer extends PureComponent {
353
353
  allowWrapCodeBlock: allowWrapCodeBlock,
354
354
  allowCustomPanels: allowCustomPanels,
355
355
  allowPlaceholderText: allowPlaceholderText,
356
- useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
357
- useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
356
+ useBlockRenderForCodeBlock: (_featureFlags$feature = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
358
357
  innerRef: this.editorRef,
359
358
  onClick: handleWrapperOnClick,
360
359
  onMouseDown: this.onMouseDownEditView
@@ -377,7 +376,7 @@ export class Renderer extends PureComponent {
377
376
  });
378
377
  return jsx(Fragment, null, reRenderTracking, rendererResult);
379
378
  } catch (e) {
380
- var _featureFlags$feature3, _featureFlags$feature4;
379
+ var _featureFlags$feature2;
381
380
  if (onError) {
382
381
  onError(e);
383
382
  }
@@ -388,8 +387,7 @@ export class Renderer extends PureComponent {
388
387
  allowPlaceholderText: allowPlaceholderText,
389
388
  allowColumnSorting: allowColumnSorting,
390
389
  allowNestedHeaderLinks: allowNestedHeaderLinks,
391
- useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature3 = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature3 !== void 0 ? _featureFlags$feature3 : true,
392
- useBlockRenderForCodeBlock: (_featureFlags$feature4 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature4 !== void 0 ? _featureFlags$feature4 : true,
390
+ useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
393
391
  onClick: handleWrapperOnClick
394
392
  }, jsx(UnsupportedBlock, null));
395
393
  }
@@ -439,7 +437,6 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
439
437
  children,
440
438
  onClick,
441
439
  onMouseDown,
442
- useFragmentMarkBreakoutWidthStylingFix,
443
440
  useBlockRenderForCodeBlock
444
441
  } = props;
445
442
  return jsx(WidthProvider, {
@@ -454,7 +451,6 @@ const RendererWrapper = /*#__PURE__*/React.memo(props => {
454
451
  appearance,
455
452
  allowNestedHeaderLinks,
456
453
  allowColumnSorting: !!allowColumnSorting,
457
- useFragmentMarkBreakoutWidthStylingFix,
458
454
  useBlockRenderForCodeBlock
459
455
  })
460
456
  }, children)));
@@ -282,25 +282,15 @@ const fullWidthStyles = ({
282
282
  `}
283
283
  `;
284
284
  };
285
- const breakoutWidthStyle = useFragmentMarkBreakoutWidthStylingFix => {
286
- if (useFragmentMarkBreakoutWidthStylingFix) {
287
- return css`
288
- *:not([data-mark-type='fragment'])
289
- .${TableSharedCssClassName.TABLE_CONTAINER} {
290
- width: 100% !important;
291
- left: 0 !important;
292
- }
293
-
294
- [data-mark-type='fragment']
295
- *
296
- .${TableSharedCssClassName.TABLE_CONTAINER} {
297
- width: 100% !important;
298
- left: 0 !important;
299
- }
300
- `;
301
- }
285
+ const breakoutWidthStyle = () => {
302
286
  return css`
303
- * .${TableSharedCssClassName.TABLE_CONTAINER} {
287
+ *:not([data-mark-type='fragment'])
288
+ .${TableSharedCssClassName.TABLE_CONTAINER} {
289
+ width: 100% !important;
290
+ left: 0 !important;
291
+ }
292
+
293
+ [data-mark-type='fragment'] * .${TableSharedCssClassName.TABLE_CONTAINER} {
304
294
  width: 100% !important;
305
295
  left: 0 !important;
306
296
  }
@@ -474,7 +464,7 @@ export const rendererStyles = wrapperProps => theme => {
474
464
 
475
465
  /* Breakout for tables and extensions */
476
466
  .${RendererCssClassName.DOCUMENT} > {
477
- ${breakoutWidthStyle(wrapperProps.useFragmentMarkBreakoutWidthStylingFix)}
467
+ ${breakoutWidthStyle()}
478
468
 
479
469
  * .${RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER} {
480
470
  overflow-x: auto;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.11.0",
3
+ "version": "108.11.2",
4
4
  "sideEffects": false
5
5
  }
@@ -10,6 +10,7 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
10
10
  tableNode = _ref.tableNode,
11
11
  rendererAppearance = _ref.rendererAppearance;
12
12
  return /*#__PURE__*/React.createElement("table", {
13
+ "data-testid": "renderer-table",
13
14
  "data-number-column": isNumberColumnEnabled,
14
15
  ref: innerRef
15
16
  }, /*#__PURE__*/React.createElement(Colgroup, {
@@ -6,6 +6,9 @@ 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
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
12
  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); }; }
10
13
  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; } }
11
14
  import React from 'react';
@@ -119,7 +122,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
119
122
  }
120
123
  _this = _super.call.apply(_super, [this].concat(args));
121
124
  _defineProperty(_assertThisInitialized(_this), "state", {
122
- stickyMode: 'none'
125
+ stickyMode: 'none',
126
+ wrapperWidth: 0,
127
+ headerRowHeight: 0
123
128
  });
124
129
  _defineProperty(_assertThisInitialized(_this), "tableRef", /*#__PURE__*/React.createRef());
125
130
  _defineProperty(_assertThisInitialized(_this), "stickyHeaderRef", /*#__PURE__*/React.createRef());
@@ -127,6 +132,33 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
127
132
  _defineProperty(_assertThisInitialized(_this), "stickyWrapperRef", /*#__PURE__*/React.createRef());
128
133
  _defineProperty(_assertThisInitialized(_this), "wrapperRef", /*#__PURE__*/React.createRef());
129
134
  _defineProperty(_assertThisInitialized(_this), "overflowParent", null);
135
+ _defineProperty(_assertThisInitialized(_this), "resizeObserver", null);
136
+ _defineProperty(_assertThisInitialized(_this), "applyResizerChange", function (entries) {
137
+ var wrapperWidth = _this.state.wrapperWidth;
138
+ var headerRowHeight = _this.state.headerRowHeight;
139
+ var _iterator = _createForOfIteratorHelper(entries),
140
+ _step;
141
+ try {
142
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
143
+ var entry = _step.value;
144
+ if (entry.target === _this.wrapperRef.current) {
145
+ wrapperWidth = entry.contentRect.width;
146
+ } else if (entry.target === _this.stickyHeaderRef.current) {
147
+ headerRowHeight = Math.round(entry.contentRect.height);
148
+ }
149
+ }
150
+ } catch (err) {
151
+ _iterator.e(err);
152
+ } finally {
153
+ _iterator.f();
154
+ }
155
+ if (headerRowHeight !== _this.state.headerRowHeight || wrapperWidth !== _this.state.wrapperWidth) {
156
+ _this.setState({
157
+ wrapperWidth: wrapperWidth,
158
+ headerRowHeight: headerRowHeight
159
+ });
160
+ }
161
+ });
130
162
  _defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
131
163
  if (_this.overflowParent) {
132
164
  _this.overflowParent.removeEventListener('scroll', _this.onScroll);
@@ -134,6 +166,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
134
166
  if (_this.nextFrame) {
135
167
  cancelAnimationFrame(_this.nextFrame);
136
168
  }
169
+ if (_this.resizeObserver) {
170
+ _this.resizeObserver.disconnect();
171
+ }
137
172
  });
138
173
  _defineProperty(_assertThisInitialized(_this), "getScrollTop", function () {
139
174
  var stickyHeaders = _this.props.stickyHeaders;
@@ -190,6 +225,13 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
190
225
  _createClass(TableContainer, [{
191
226
  key: "componentDidMount",
192
227
  value: function componentDidMount() {
228
+ this.resizeObserver = new ResizeObserver(this.applyResizerChange);
229
+ if (this.wrapperRef.current) {
230
+ this.resizeObserver.observe(this.wrapperRef.current);
231
+ }
232
+ if (this.stickyHeaderRef.current) {
233
+ this.resizeObserver.observe(this.stickyHeaderRef.current);
234
+ }
193
235
  if (this.props.stickyHeaders) {
194
236
  this.overflowParent = OverflowParent.fromElement(this.tableRef.current);
195
237
  this.overflowParent.addEventListener('scroll', this.onScroll);
@@ -236,11 +278,6 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
236
278
  return undefined;
237
279
  }
238
280
  }
239
- }, {
240
- key: "headerRowHeight",
241
- get: function get() {
242
- return this.stickyHeaderRef.current ? this.stickyHeaderRef.current.offsetHeight : 0;
243
- }
244
281
  }, {
245
282
  key: "render",
246
283
  value: function render() {
@@ -267,7 +304,6 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
267
304
  if (canUseLinelength(rendererAppearance) && tableWidth !== 'inherit' && tableWidth > lineLength) {
268
305
  left = lineLength / 2 - tableWidth / 2;
269
306
  }
270
- var wrapperWidth = this.wrapperRef.current ? this.wrapperRef.current.clientWidth : 0;
271
307
  var children = React.Children.toArray(this.props.children);
272
308
  return /*#__PURE__*/React.createElement(React.Fragment, null, !getBooleanFF('platform.editor.custom-table-width') && stickyHeaders && tableCanBeSticky(tableNode, children) && /*#__PURE__*/React.createElement(StickyTable, {
273
309
  isNumberColumnEnabled: isNumberColumnEnabled,
@@ -280,9 +316,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
280
316
  left: left,
281
317
  mode: stickyMode,
282
318
  innerRef: this.stickyWrapperRef,
283
- wrapperWidth: wrapperWidth,
319
+ wrapperWidth: this.state.wrapperWidth,
284
320
  columnWidths: columnWidths,
285
- rowHeight: this.headerRowHeight,
321
+ rowHeight: this.state.headerRowHeight,
286
322
  rendererAppearance: rendererAppearance
287
323
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
288
324
  className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames || ''),
@@ -302,9 +338,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
302
338
  top: this.stickyTop,
303
339
  mode: stickyMode,
304
340
  innerRef: this.stickyWrapperRef,
305
- wrapperWidth: wrapperWidth,
341
+ wrapperWidth: this.state.wrapperWidth,
306
342
  columnWidths: columnWidths,
307
- rowHeight: this.headerRowHeight,
343
+ rowHeight: this.state.headerRowHeight,
308
344
  tableNode: tableNode,
309
345
  rendererAppearance: rendererAppearance
310
346
  }, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
45
45
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  var packageName = "@atlaskit/renderer";
48
- var packageVersion = "108.11.0";
48
+ var packageVersion = "108.11.2";
49
49
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
50
50
  _inherits(Renderer, _PureComponent);
51
51
  var _super = _createSuper(Renderer);
@@ -341,7 +341,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
341
341
  }
342
342
  };
343
343
  try {
344
- var _featureFlags$feature, _featureFlags$feature2, _this$featureFlags2, _this$featureFlags2$f, _this$featureFlags2$f2;
344
+ var _featureFlags$feature, _this$featureFlags2, _this$featureFlags2$f, _this$featureFlags2$f2;
345
345
  var schema = this.getSchema(this.props.schema, this.props.adfStage);
346
346
  var _renderDocument = renderDocument(adfDocument, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
347
347
  result = _renderDocument.result,
@@ -368,8 +368,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
368
368
  allowWrapCodeBlock: allowWrapCodeBlock,
369
369
  allowCustomPanels: allowCustomPanels,
370
370
  allowPlaceholderText: allowPlaceholderText,
371
- useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
372
- useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
371
+ useBlockRenderForCodeBlock: (_featureFlags$feature = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature !== void 0 ? _featureFlags$feature : true,
373
372
  innerRef: this.editorRef,
374
373
  onClick: handleWrapperOnClick,
375
374
  onMouseDown: this.onMouseDownEditView
@@ -392,7 +391,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
392
391
  });
393
392
  return jsx(Fragment, null, reRenderTracking, rendererResult);
394
393
  } catch (e) {
395
- var _featureFlags$feature3, _featureFlags$feature4;
394
+ var _featureFlags$feature2;
396
395
  if (onError) {
397
396
  onError(e);
398
397
  }
@@ -403,8 +402,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
403
402
  allowPlaceholderText: allowPlaceholderText,
404
403
  allowColumnSorting: allowColumnSorting,
405
404
  allowNestedHeaderLinks: allowNestedHeaderLinks,
406
- useFragmentMarkBreakoutWidthStylingFix: (_featureFlags$feature3 = featureFlags.featureFlags.useFragmentMarkBreakoutWidthStylingFix) !== null && _featureFlags$feature3 !== void 0 ? _featureFlags$feature3 : true,
407
- useBlockRenderForCodeBlock: (_featureFlags$feature4 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature4 !== void 0 ? _featureFlags$feature4 : true,
405
+ useBlockRenderForCodeBlock: (_featureFlags$feature2 = featureFlags.featureFlags.useBlockRenderForCodeBlock) !== null && _featureFlags$feature2 !== void 0 ? _featureFlags$feature2 : true,
408
406
  onClick: handleWrapperOnClick
409
407
  }, jsx(UnsupportedBlock, null));
410
408
  }
@@ -457,7 +455,6 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
457
455
  children = props.children,
458
456
  onClick = props.onClick,
459
457
  onMouseDown = props.onMouseDown,
460
- useFragmentMarkBreakoutWidthStylingFix = props.useFragmentMarkBreakoutWidthStylingFix,
461
458
  useBlockRenderForCodeBlock = props.useBlockRenderForCodeBlock;
462
459
  return jsx(WidthProvider, {
463
460
  className: "ak-renderer-wrapper"
@@ -471,7 +468,6 @@ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
471
468
  appearance: appearance,
472
469
  allowNestedHeaderLinks: allowNestedHeaderLinks,
473
470
  allowColumnSorting: !!allowColumnSorting,
474
- useFragmentMarkBreakoutWidthStylingFix: useFragmentMarkBreakoutWidthStylingFix,
475
471
  useBlockRenderForCodeBlock: useBlockRenderForCodeBlock
476
472
  })
477
473
  }, children)));
@@ -1,5 +1,5 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
3
3
  import { css } from '@emotion/react';
4
4
  import { themed } from '@atlaskit/theme/components';
5
5
  import { fontFamily, fontSize } from '@atlaskit/theme/constants';
@@ -78,11 +78,8 @@ var fullWidthStyles = function fullWidthStyles(_ref5) {
78
78
  }
79
79
  return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .ak-renderer-extension {\n width: 100% !important;\n }\n\n ", "\n "])), akEditorFullWidthLayoutWidth, isTableResizingEnabled(appearance) ? '' : "\n .pm-table-container {\n width: 100% !important;\n }\n ");
80
80
  };
81
- var breakoutWidthStyle = function breakoutWidthStyle(useFragmentMarkBreakoutWidthStylingFix) {
82
- if (useFragmentMarkBreakoutWidthStylingFix) {
83
- return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n *:not([data-mark-type='fragment'])\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n [data-mark-type='fragment']\n *\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
84
- }
85
- return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), TableSharedCssClassName.TABLE_CONTAINER);
81
+ var breakoutWidthStyle = function breakoutWidthStyle() {
82
+ return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n *:not([data-mark-type='fragment'])\n .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n [data-mark-type='fragment'] * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n "])), TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
86
83
  };
87
84
  export var rendererStyles = function rendererStyles(wrapperProps) {
88
85
  return function (theme) {
@@ -91,7 +88,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
91
88
  theme: theme
92
89
  };
93
90
  var useBlockRenderForCodeBlock = wrapperProps.useBlockRenderForCodeBlock;
94
- return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\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: ", ";\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: ", " 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\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: block;\n /* stylelint-enable */\n\n position: relative;\n border-radius: ", ";\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\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n\n ", "\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", ";\n & > div + div {\n margin-left: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n "])), editorFontSize(themeProps), themed({
91
+ return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\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: ", ";\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: ", " 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\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: block;\n /* stylelint-enable */\n\n position: relative;\n border-radius: ", ";\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\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n\n ", "\n\n ", "\n\n ", ";\n & [data-layout-section] {\n margin-top: ", ";\n & > div + div {\n margin-left: ", ";\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n }\n }\n\n & li {\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n & :not([data-node-type='decisionList']) > li {\n ", "\n }\n "])), editorFontSize(themeProps), themed({
95
92
  light: "var(--ds-text, ".concat(colors.N800, ")"),
96
93
  dark: "var(--ds-text, #B8C7E0)"
97
94
  })(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), "var(--ds-link, ".concat(colors.B400, ")"), "var(--ds-link, ".concat(colors.B300, ")"), "var(--ds-link-pressed, ".concat(colors.B500, ")"), themed({
@@ -103,7 +100,7 @@ export var rendererStyles = function rendererStyles(wrapperProps) {
103
100
  })(themeProps), "var(--ds-border-radius-100, 3px)", themed({
104
101
  light: "var(--ds-text, ".concat(colors.N800, ")"),
105
102
  dark: "var(--ds-text, ".concat(colors.DN600, ")")
106
- })(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(wrapperProps.useFragmentMarkBreakoutWidthStylingFix), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
103
+ })(themeProps), "var(--ds-background-danger, ".concat(colors.R50, ")"), "var(--ds-text-danger, ".concat(colors.R500, ")"), "var(--ds-space-300, 24px)", richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, breakoutWidthStyle(), RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, shadowObserverClassNames.SHADOW_CONTAINER, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, shadowObserverClassNames.SENTINEL_LEFT, shadowObserverClassNames.SENTINEL_RIGHT, tableMarginTop, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
107
104
  light: "var(--ds-background-neutral, ".concat(akEditorTableToolbar, ")"),
108
105
  dark: "var(--ds-background-neutral, ".concat(akEditorTableToolbarDark, ")")
109
106
  })(themeProps), themed({
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.11.0",
3
+ "version": "108.11.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,10 +1,10 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
5
  import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
6
- import { TableLayout } from '@atlaskit/adf-schema';
7
- import { RendererAppearance } from '../../../ui/Renderer/types';
6
+ import type { TableLayout } from '@atlaskit/adf-schema';
7
+ import type { RendererAppearance } from '../../../ui/Renderer/types';
8
8
  export type StickyMode = 'none' | 'stick' | 'pin-bottom';
9
9
  export declare const tableStickyPadding = 8;
10
10
  interface FixedProps {
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
4
4
  import { SortOrder } from '@atlaskit/editor-common/types';
5
- import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
6
- import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
7
- import { StickyMode, OverflowParent } from './table/sticky';
8
- import { SharedTableProps } from './table/types';
5
+ import type { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
6
+ import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
7
+ import type { StickyMode } from './table/sticky';
8
+ import { OverflowParent } from './table/sticky';
9
+ import type { SharedTableProps } from './table/types';
9
10
  export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
10
11
  export type TableProps = SharedTableProps & {
11
12
  children: React.ReactElement<any> | Array<React.ReactElement<any>>;
@@ -20,6 +21,8 @@ interface TableOrderStatus {
20
21
  }
21
22
  interface TableState {
22
23
  stickyMode: StickyMode;
24
+ wrapperWidth: number;
25
+ headerRowHeight: number;
23
26
  }
24
27
  export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
25
28
  state: TableState;
@@ -29,6 +32,8 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
29
32
  wrapperRef: React.RefObject<HTMLDivElement>;
30
33
  nextFrame: number | undefined;
31
34
  overflowParent: OverflowParent | null;
35
+ private resizeObserver;
36
+ private applyResizerChange;
32
37
  componentDidMount(): void;
33
38
  componentDidUpdate(prevProps: TableProps, prevState: TableState): void;
34
39
  componentWillUnmount: () => void;
@@ -38,7 +43,6 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
38
43
  onWrapperScrolled: () => void;
39
44
  get pinTop(): number | undefined;
40
45
  get stickyTop(): number | undefined;
41
- get headerRowHeight(): number;
42
46
  render(): JSX.Element;
43
47
  private grabFirstRowRef;
44
48
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { PureComponent } from 'react';
3
- import { RendererProps } from '../renderer-props';
3
+ import type { RendererProps } from '../renderer-props';
4
4
  export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
5
5
  export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
6
6
  export interface Extension<T> {
@@ -5,7 +5,6 @@ export type RendererWrapperProps = {
5
5
  appearance?: RendererAppearance;
6
6
  allowNestedHeaderLinks: boolean;
7
7
  allowColumnSorting: boolean;
8
- useFragmentMarkBreakoutWidthStylingFix: boolean;
9
8
  useBlockRenderForCodeBlock: boolean;
10
9
  };
11
10
  export declare const headingSizes: {
@@ -1,10 +1,10 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { jsx } from '@emotion/react';
4
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
5
  import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
6
- import { TableLayout } from '@atlaskit/adf-schema';
7
- import { RendererAppearance } from '../../../ui/Renderer/types';
6
+ import type { TableLayout } from '@atlaskit/adf-schema';
7
+ import type { RendererAppearance } from '../../../ui/Renderer/types';
8
8
  export type StickyMode = 'none' | 'stick' | 'pin-bottom';
9
9
  export declare const tableStickyPadding = 8;
10
10
  interface FixedProps {
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
- import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
3
  import type { OverflowShadowProps } from '@atlaskit/editor-common/ui';
4
4
  import { SortOrder } from '@atlaskit/editor-common/types';
5
- import { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
6
- import { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
7
- import { StickyMode, OverflowParent } from './table/sticky';
8
- import { SharedTableProps } from './table/types';
5
+ import type { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types';
6
+ import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
7
+ import type { StickyMode } from './table/sticky';
8
+ import { OverflowParent } from './table/sticky';
9
+ import type { SharedTableProps } from './table/types';
9
10
  export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean;
10
11
  export type TableProps = SharedTableProps & {
11
12
  children: React.ReactElement<any> | Array<React.ReactElement<any>>;
@@ -20,6 +21,8 @@ interface TableOrderStatus {
20
21
  }
21
22
  interface TableState {
22
23
  stickyMode: StickyMode;
24
+ wrapperWidth: number;
25
+ headerRowHeight: number;
23
26
  }
24
27
  export declare class TableContainer extends React.Component<TableProps & OverflowShadowProps & WithSmartCardStorageProps, TableState> {
25
28
  state: TableState;
@@ -29,6 +32,8 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
29
32
  wrapperRef: React.RefObject<HTMLDivElement>;
30
33
  nextFrame: number | undefined;
31
34
  overflowParent: OverflowParent | null;
35
+ private resizeObserver;
36
+ private applyResizerChange;
32
37
  componentDidMount(): void;
33
38
  componentDidUpdate(prevProps: TableProps, prevState: TableState): void;
34
39
  componentWillUnmount: () => void;
@@ -38,7 +43,6 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
38
43
  onWrapperScrolled: () => void;
39
44
  get pinTop(): number | undefined;
40
45
  get stickyTop(): number | undefined;
41
- get headerRowHeight(): number;
42
46
  render(): JSX.Element;
43
47
  private grabFirstRowRef;
44
48
  }
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { PureComponent } from 'react';
3
- import { RendererProps } from '../renderer-props';
3
+ import type { RendererProps } from '../renderer-props';
4
4
  export declare const NORMAL_SEVERITY_THRESHOLD = 2000;
5
5
  export declare const DEGRADED_SEVERITY_THRESHOLD = 3000;
6
6
  export interface Extension<T> {
@@ -5,7 +5,6 @@ export type RendererWrapperProps = {
5
5
  appearance?: RendererAppearance;
6
6
  allowNestedHeaderLinks: boolean;
7
7
  allowColumnSorting: boolean;
8
- useFragmentMarkBreakoutWidthStylingFix: boolean;
9
8
  useBlockRenderForCodeBlock: boolean;
10
9
  };
11
10
  export declare const headingSizes: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "108.11.0",
3
+ "version": "108.11.2",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,14 +24,14 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/adf-schema": "^28.0.0",
27
+ "@atlaskit/adf-schema": "^28.1.0",
28
28
  "@atlaskit/adf-utils": "^19.0.0",
29
29
  "@atlaskit/analytics-listeners": "^8.7.0",
30
30
  "@atlaskit/analytics-namespaced-context": "^6.7.0",
31
31
  "@atlaskit/analytics-next": "^9.1.0",
32
- "@atlaskit/button": "^16.8.0",
32
+ "@atlaskit/button": "^16.9.0",
33
33
  "@atlaskit/code": "^14.6.0",
34
- "@atlaskit/editor-common": "^74.37.0",
34
+ "@atlaskit/editor-common": "^74.42.0",
35
35
  "@atlaskit/editor-json-transformer": "^8.10.0",
36
36
  "@atlaskit/editor-palette": "1.5.1",
37
37
  "@atlaskit/editor-prosemirror": "1.0.2",