@atlaskit/renderer 117.0.0 → 117.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 117.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#154858](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154858)
8
+ [`bf96267428ccd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bf96267428ccd) -
9
+ Adds experiment to not render children of expand element until it gets expanded
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 117.0.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [#154154](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/154154)
20
+ [`ac64f10ddbadb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac64f10ddbadb) -
21
+ ED-27923: Added condition check in mediaSingle in common to fix embed width during SSR"
22
+ - Updated dependencies
23
+
3
24
  ## 117.0.0
4
25
 
5
26
  ### Patch Changes
@@ -407,11 +407,7 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
407
407
  var stickyHeaders = !isInsideOfTable && !(0, _rendererNode.insideBreakoutLayout)(path) ? this.stickyHeaders : undefined;
408
408
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
409
409
  allowColumnSorting: this.allowColumnSorting,
410
- columnWidths:
411
- // When allowTableResizing is enabled, the number of columns is required to render
412
- // the same scaling logic as editor. Some tables can have unequal rows, so the entire
413
- // table needs to be scanned.
414
- this.allowTableResizing && (0, _platformFeatureFlags.fg)('platform_editor_table_col_calculation_fix') ? (0, _utils.getColumnWidths)(node) : (0, _utils.calcTableColumnWidths)(node),
410
+ columnWidths: (0, _utils.getColumnWidths)(node),
415
411
  tableNode: node,
416
412
  stickyHeaders: stickyHeaders,
417
413
  isInsideOfBlockNode: isInsideOfBlockNode,
@@ -141,7 +141,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
141
141
  var padding = isFullPage ? _style.FullPagePadding * 2 : 0;
142
142
  var calcDimensions = (0, _react.useCallback)(function (mediaContainerWidth) {
143
143
  var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
144
- var maxWidth = (0, _coreUtils.isSSR)() && widthAttr && typeof widthAttr === 'number' && widthType === 'pixel' && (0, _platformFeatureFlags.fg)('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(widthAttr, containerWidth) : containerWidth;
144
+ var maxWidth = (0, _coreUtils.isSSR)() && widthAttr && typeof widthAttr === 'number' && (0, _platformFeatureFlags.fg)('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(widthAttr, containerWidth) : containerWidth;
145
145
  var maxHeight = height / width * maxWidth;
146
146
  var cardDimensions = {
147
147
  width: "".concat(maxWidth, "px"),
@@ -162,7 +162,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
162
162
  cardDimensions: cardDimensions,
163
163
  lineLength: lineLength
164
164
  };
165
- }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr, widthType]);
165
+ }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr]);
166
166
  var originalDimensions = (0, _react.useMemo)(function () {
167
167
  return {
168
168
  width: width,
@@ -102,7 +102,9 @@ var StickyTable = exports.StickyTable = function StickyTable(_ref) {
102
102
  rowHeight = _ref.rowHeight,
103
103
  tableNode = _ref.tableNode,
104
104
  rendererAppearance = _ref.rendererAppearance,
105
- allowTableResizing = _ref.allowTableResizing;
105
+ allowTableResizing = _ref.allowTableResizing,
106
+ _ref$fixTableSSRResiz = _ref.fixTableSSRResizing,
107
+ fixTableSSRResizing = _ref$fixTableSSRResiz === void 0 ? false : _ref$fixTableSSRResiz;
106
108
  var styles;
107
109
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
108
110
  if (allowTableResizing) {
@@ -135,7 +137,9 @@ var StickyTable = exports.StickyTable = function StickyTable(_ref) {
135
137
  className: "".concat(_styles.TableSharedCssClassName.TABLE_CONTAINER, " is-sticky ").concat(shadowClassNames || ''),
136
138
  "data-layout": layout,
137
139
  style: {
138
- width: tableWidth
140
+ width: tableWidth,
141
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
142
+ marginBottom: fixTableSSRResizing ? 0 : ''
139
143
  }
140
144
  }, (0, _react2.jsx)("div", {
141
145
  ref: innerRef
@@ -168,6 +172,9 @@ var StickyTable = exports.StickyTable = function StickyTable(_ref) {
168
172
 
169
173
  /**
170
174
  * Traverse DOM Tree upwards looking for table parents with "overflow: scroll".
175
+ * @param table
176
+ * @param defaultScrollRootId
177
+ * @example
171
178
  */
172
179
  function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
173
180
  var parent = table;
@@ -191,17 +198,36 @@ function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
191
198
  }
192
199
  return null;
193
200
  }
201
+
202
+ /**
203
+ *
204
+ */
194
205
  var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
195
206
  function OverflowParent(ref) {
196
207
  (0, _classCallCheck2.default)(this, OverflowParent);
197
208
  this.ref = ref;
198
209
  this.ref = ref;
199
210
  }
211
+
212
+ /**
213
+ *
214
+ * @param el
215
+ * @param defaultScrollRootId
216
+ * @example
217
+ */
200
218
  return (0, _createClass2.default)(OverflowParent, [{
201
219
  key: "isElement",
202
- get: function get() {
220
+ get:
221
+ /**
222
+ *
223
+ */
224
+ function get() {
203
225
  return this.ref instanceof HTMLElement;
204
226
  }
227
+
228
+ /**
229
+ *
230
+ */
205
231
  }, {
206
232
  key: "id",
207
233
  get: function get() {
@@ -210,6 +236,10 @@ var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
210
236
  }
211
237
  return '';
212
238
  }
239
+
240
+ /**
241
+ *
242
+ */
213
243
  }, {
214
244
  key: "top",
215
245
  get: function get() {
@@ -219,6 +249,13 @@ var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
219
249
  return 0;
220
250
  }
221
251
 
252
+ /**
253
+ *
254
+ * @param type
255
+ * @param cb
256
+ * @param {...any} args
257
+ * @example
258
+ */
222
259
  // Ignored via go/ees005
223
260
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
224
261
  }, {
@@ -233,6 +270,13 @@ var OverflowParent = exports.OverflowParent = /*#__PURE__*/function () {
233
270
  (_this$ref = this.ref).addEventListener.apply(_this$ref, [type, cb].concat(args));
234
271
  }
235
272
 
273
+ /**
274
+ *
275
+ * @param type
276
+ * @param cb
277
+ * @param {...any} args
278
+ * @example
279
+ */
236
280
  // Ignored via go/ees005
237
281
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
238
282
  }, {
@@ -14,7 +14,6 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
14
14
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _react = _interopRequireDefault(require("react"));
17
- var _browser = require("@atlaskit/editor-common/browser");
18
17
  var _styles = require("@atlaskit/editor-common/styles");
19
18
  var _ui = require("@atlaskit/editor-common/ui");
20
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -30,7 +29,6 @@ var _sticky = require("./table/sticky");
30
29
  var _table = require("./table/table");
31
30
  var _appearance = require("../utils/appearance");
32
31
  var _TableStickyScrollbar = require("./TableStickyScrollbar");
33
- var _tableNew = require("./tableNew");
34
32
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
35
33
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
36
34
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
@@ -127,6 +125,9 @@ var isHeaderRowEnabled = exports.isHeaderRowEnabled = function isHeaderRowEnable
127
125
  var tableCanBeSticky = exports.tableCanBeSticky = function tableCanBeSticky(node, children) {
128
126
  return isHeaderRowEnabled(children) && node && node.firstChild && !hasRowspan(node.firstChild);
129
127
  };
128
+ /**
129
+ * Class for Tables in Renderer
130
+ */
130
131
  // Ignored via go/ees005
131
132
  // eslint-disable-next-line @repo/internal/react/no-class-components
132
133
  var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Component) {
@@ -252,7 +253,12 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
252
253
  (0, _inherits2.default)(TableContainer, _React$Component);
253
254
  return (0, _createClass2.default)(TableContainer, [{
254
255
  key: "componentDidMount",
255
- value: function componentDidMount() {
256
+ value:
257
+ /**
258
+ *
259
+ * @example
260
+ */
261
+ function componentDidMount() {
256
262
  this.resizeObserver = new ResizeObserver(this.applyResizerChange);
257
263
  if (this.wrapperRef.current) {
258
264
  this.resizeObserver.observe(this.wrapperRef.current);
@@ -271,6 +277,13 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
271
277
  this.stickyScrollbar = new _TableStickyScrollbar.TableStickyScrollbar(this.wrapperRef.current);
272
278
  }
273
279
  }
280
+
281
+ /**
282
+ *
283
+ * @param prevProps
284
+ * @param prevState
285
+ * @example
286
+ */
274
287
  }, {
275
288
  key: "componentDidUpdate",
276
289
  value: function componentDidUpdate(prevProps, prevState) {
@@ -297,12 +310,20 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
297
310
  }
298
311
  }, {
299
312
  key: "pinTop",
300
- get: function get() {
313
+ get:
314
+ /**
315
+ *
316
+ */
317
+ function get() {
301
318
  if (!this.tableRef.current || !this.stickyHeaderRef.current) {
302
319
  return;
303
320
  }
304
321
  return this.tableRef.current.offsetHeight - this.stickyHeaderRef.current.offsetHeight + _styles.tableMarginTop - _sticky.tableStickyPadding;
305
322
  }
323
+
324
+ /**
325
+ *
326
+ */
306
327
  }, {
307
328
  key: "shouldAddOverflowParentOffsetTop_DO_NOT_USE",
308
329
  get: function get() {
@@ -312,6 +333,10 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
312
333
  // THEN we should add the OverflowParent offset top (RETURN TRUE)
313
334
  return this.props.stickyHeaders && !!this.props.stickyHeaders.shouldAddDefaultScrollRootOffsetTop_DO_NOT_USE && !!this.props.stickyHeaders.defaultScrollRootId_DO_NOT_USE && this.overflowParent && this.overflowParent.id === this.props.stickyHeaders.defaultScrollRootId_DO_NOT_USE;
314
335
  }
336
+
337
+ /**
338
+ *
339
+ */
315
340
  }, {
316
341
  key: "stickyTop",
317
342
  get: function get() {
@@ -330,6 +355,11 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
330
355
  return undefined;
331
356
  }
332
357
  }
358
+
359
+ /**
360
+ *
361
+ * @example
362
+ */
333
363
  }, {
334
364
  key: "render",
335
365
  value: function render() {
@@ -383,7 +413,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
383
413
  var isCommentAppearanceAndTableAlignmentEnabled = (0, _appearance.isCommentAppearance)(rendererAppearance) && allowTableAlignment;
384
414
  var lineLength = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLength : isCommentAppearanceAndTableAlignmentEnabled ? commentLineLength : lineLengthFixedWidth;
385
415
  var lineLengthCSS = (0, _appearance.isFullWidthAppearance)(rendererAppearance) ? fullWidthLineLengthCSS : isCommentAppearanceAndTableAlignmentEnabled ? renderWidthCSS : "".concat(lineLengthFixedWidth, "px");
386
- var fixTableSSRResizing = (0, _platformFeatureFlags.fg)('platform-fix-table-ssr-resizing');
416
+ var fixTableSSRResizing = (0, _platformFeatureFlags.fg)('platform-ssr-table-resize');
387
417
  var tableWidthNew = fixTableSSRResizing ? (0, _nodeWidth.getTableContainerWidth)(tableNode) : tableWidth;
388
418
  var shouldCalculateLeftForAlignment = !isInsideOfBlockNode && !isInsideOfTable && isTableAlignStart && ((0, _appearance.isFullPageAppearance)(rendererAppearance) && tableWidthNew <= lineLengthFixedWidth || (0, _appearance.isFullWidthAppearance)(rendererAppearance) || isCommentAppearanceAndTableAlignmentEnabled);
389
419
  var leftCSS;
@@ -481,7 +511,8 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
481
511
  rowHeight: this.state.headerRowHeight,
482
512
  tableNode: tableNode,
483
513
  rendererAppearance: rendererAppearance,
484
- allowTableResizing: allowTableResizing
514
+ allowTableResizing: allowTableResizing,
515
+ fixTableSSRResizing: fixTableSSRResizing
485
516
  }, [children && children[0]]), /*#__PURE__*/_react.default.createElement("div", {
486
517
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
487
518
  className: _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER,
@@ -529,6 +560,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
529
560
  }
530
561
  }]);
531
562
  }(_react.default.Component);
563
+ /**
564
+ *
565
+ */
532
566
  // Ignored via go/ees005
533
567
  // eslint-disable-next-line @repo/internal/react/no-class-components
534
568
  var TableProcessor = exports.TableProcessor = /*#__PURE__*/function (_React$Component2) {
@@ -579,7 +613,12 @@ var TableProcessor = exports.TableProcessor = /*#__PURE__*/function (_React$Comp
579
613
  (0, _inherits2.default)(TableProcessor, _React$Component2);
580
614
  return (0, _createClass2.default)(TableProcessor, [{
581
615
  key: "render",
582
- value: function render() {
616
+ value:
617
+ /**
618
+ *
619
+ * @example
620
+ */
621
+ function render() {
583
622
  var children = this.props.children;
584
623
  if (!children) {
585
624
  return null;
@@ -595,17 +634,6 @@ var TableProcessor = exports.TableProcessor = /*#__PURE__*/function (_React$Comp
595
634
  }
596
635
  }]);
597
636
  }(_react.default.Component); // eslint-disable-next-line @typescript-eslint/no-explicit-any
598
- var TableWithShadowsAndContainerStyles = (0, _ui.overflowShadow)(_tableNew.TableProcessorWithContainerStyles, {
599
- /**
600
- * The :scope is in reference to table container and we are selecting only
601
- * direct children that match the table node wrapper selector, not their
602
- * descendants.
603
- */
604
- overflowSelector: ":scope > .".concat(_styles.TableSharedCssClassName.TABLE_NODE_WRAPPER),
605
- useShadowObserver: true
606
- });
607
-
608
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
609
637
  var TableWithShadows = (0, _ui.overflowShadow)(TableProcessor, {
610
638
  /**
611
639
  * The :scope is in reference to table container and we are selecting only
@@ -615,60 +643,27 @@ var TableWithShadows = (0, _ui.overflowShadow)(TableProcessor, {
615
643
  overflowSelector: ":scope > .".concat(_styles.TableSharedCssClassName.TABLE_NODE_WRAPPER),
616
644
  useShadowObserver: true
617
645
  });
618
-
619
- // Legacy tables have only one of the three layouts and do not have a width attribute
620
- var isLegacyTable = function isLegacyTable(layout) {
621
- return Boolean(['default', 'wide', 'full-width'].includes(layout));
622
- };
623
- var shouldRenderTableWithCSSWidth = function shouldRenderTableWithCSSWidth(layout, width) {
624
- // The CSS width optimization is currently only in place when the table node
625
- // has a defined width and is not a legacy table
626
-
627
- // the optimization is also skipped for Safari due to browser limitations with container styles
628
- if (_browser.browser.safari || !width || isLegacyTable(layout)) {
629
- return false;
630
- }
631
- return true;
632
- };
633
646
  var TableWithWidth = function TableWithWidth(props) {
634
- var _props$tableNode$attr, _props$tableNode, _props$tableNode2;
635
- // eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
636
- if ((shouldRenderTableWithCSSWidth((_props$tableNode$attr = (_props$tableNode = props.tableNode) === null || _props$tableNode === void 0 || (_props$tableNode = _props$tableNode.attrs) === null || _props$tableNode === void 0 ? void 0 : _props$tableNode.layout) !== null && _props$tableNode$attr !== void 0 ? _props$tableNode$attr : '', (_props$tableNode2 = props.tableNode) === null || _props$tableNode2 === void 0 || (_props$tableNode2 = _props$tableNode2.attrs) === null || _props$tableNode2 === void 0 ? void 0 : _props$tableNode2.width) || props.rendererAppearance === 'comment') && (0, _platformFeatureFlags.fg)('platform-ssr-table-resize')) {
647
+ return /*#__PURE__*/_react.default.createElement(_ui.WidthConsumer, null, function (_ref2) {
637
648
  var _props$columnWidths;
649
+ var width = _ref2.width;
650
+ var renderWidth = props.rendererAppearance === 'full-page' ? width - _style.FullPagePadding * 2 : width;
638
651
  var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
639
652
  return total + val;
640
653
  }, 0)) || 0;
641
654
  if (colWidthsSum || props.allowTableResizing) {
642
655
  // Ignored via go/ees005
643
656
  // eslint-disable-next-line react/jsx-props-no-spreading
644
- return /*#__PURE__*/_react.default.createElement(TableWithShadowsAndContainerStyles, props);
645
- }
646
- return /*#__PURE__*/_react.default.createElement(_tableNew.TableProcessorWithContainerStyles
647
- // Ignored via go/ees005
648
- // eslint-disable-next-line react/jsx-props-no-spreading
649
- , props);
650
- } else {
651
- return /*#__PURE__*/_react.default.createElement(_ui.WidthConsumer, null, function (_ref2) {
652
- var _props$columnWidths2;
653
- var width = _ref2.width;
654
- var renderWidth = props.rendererAppearance === 'full-page' ? width - _style.FullPagePadding * 2 : width;
655
- var colWidthsSum = ((_props$columnWidths2 = props.columnWidths) === null || _props$columnWidths2 === void 0 ? void 0 : _props$columnWidths2.reduce(function (total, val) {
656
- return total + val;
657
- }, 0)) || 0;
658
- if (colWidthsSum || props.allowTableResizing) {
659
- // Ignored via go/ees005
660
- // eslint-disable-next-line react/jsx-props-no-spreading
661
- return /*#__PURE__*/_react.default.createElement(TableWithShadows, (0, _extends2.default)({
662
- renderWidth: renderWidth
663
- }, props));
664
- }
665
- // 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
666
- return /*#__PURE__*/_react.default.createElement(TableProcessor, (0, _extends2.default)({
657
+ return /*#__PURE__*/_react.default.createElement(TableWithShadows, (0, _extends2.default)({
667
658
  renderWidth: renderWidth
668
- // Ignored via go/ees005
669
- // eslint-disable-next-line react/jsx-props-no-spreading
670
659
  }, props));
671
- });
672
- }
660
+ }
661
+ // 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
662
+ return /*#__PURE__*/_react.default.createElement(TableProcessor, (0, _extends2.default)({
663
+ renderWidth: renderWidth
664
+ // Ignored via go/ees005
665
+ // eslint-disable-next-line react/jsx-props-no-spreading
666
+ }, props));
667
+ });
673
668
  };
674
669
  var _default = exports.default = (0, _SmartCardStorage.withSmartCardStorage)(TableWithWidth);
@@ -17,6 +17,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
17
17
  var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right"));
18
18
  var _chevronRight2 = _interopRequireDefault(require("@atlaskit/icon/utility/chevron-right"));
19
19
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
20
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
20
21
  var _uniqueId2 = _interopRequireDefault(require("lodash/uniqueId"));
21
22
  var _reactIntlNext = require("react-intl-next");
22
23
  var _events = require("../analytics/events");
@@ -261,6 +262,8 @@ function Expand(_ref) {
261
262
  className: "".concat(nodeType, "-content-wrapper")
262
263
  }, (0, _react.jsx)(_ui.WidthProvider, null, (0, _react.jsx)("div", {
263
264
  css: clearNextSiblingMarginTopStyle
264
- }), children))));
265
+ }), (0, _experiments.editorExperiment)('confluence_p2m_style_recalc_and_expand_joint_exp', true, {
266
+ exposure: true
267
+ }) ? expanded && children : children))));
265
268
  }
266
269
  var _default = exports.default = (0, _reactIntlNext.injectIntl)(Expand);
@@ -63,7 +63,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
63
63
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
64
64
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
65
65
  var packageName = "@atlaskit/renderer";
66
- var packageVersion = "117.0.0";
66
+ var packageVersion = "117.1.0";
67
67
  var setAsQueryContainerStyles = (0, _react2.css)({
68
68
  containerName: 'ak-renderer-wrapper',
69
69
  containerType: 'inline-size'
@@ -131,6 +131,9 @@ var handleMouseTripleClickInTables = function handleMouseTripleClickInTables(eve
131
131
  * link, call the onUnhandledClick eventHandler (which in Jira for example, may switch the
132
132
  * renderer out for the editor).
133
133
  * @param event Click event anywhere inside renderer
134
+ * @param props
135
+ * @param mouseDownSelection
136
+ * @example
134
137
  */
135
138
  var handleWrapperOnClick = function handleWrapperOnClick(event, props, mouseDownSelection) {
136
139
  var _props$eventHandlers;
@@ -479,6 +482,12 @@ var getRendererComponent = function getRendererComponent(nodeComponents) {
479
482
  }
480
483
  return RendererFunctionalComponent;
481
484
  };
485
+
486
+ /**
487
+ *
488
+ * @param props
489
+ * @example
490
+ */
482
491
  function Renderer(props) {
483
492
  var _React$useContext = _react.default.useContext(_annotations.AnnotationsPositionContext),
484
493
  startPos = _React$useContext.startPos;
@@ -624,7 +633,7 @@ var RendererWrapper = /*#__PURE__*/_react.default.memo(function (props) {
624
633
  // Only apply container-type = inline-size when having a known width in full-page/full-width/comment mode.
625
634
  // Otherwise when appearance is unspecified the renderer size is decided by the content.
626
635
  // In this case we can't set the container-type = inline-size as it will collapse width to 0.
627
- return appearance === 'comment' &&
636
+ return (appearance === 'full-page' || appearance === 'full-width' || appearance === 'comment') &&
628
637
  // In case of having excerpt-include on page there are multiple renderers nested.
629
638
  // Make sure only the root renderer is set to be query container.
630
639
  isTopLevelRenderer && (0, _platformFeatureFlags.fg)('platform-ssr-table-resize') ? (0, _react2.jsx)("div", {
@@ -8,7 +8,7 @@ import { Doc, DocWithSelectAllTrap, mergeTextNodes, isTextWrapper, isTextNode, t
8
8
  import TextWrapperComponent from './nodes/text-wrapper';
9
9
  import { toReact as markToReact, isAnnotationMark } from './marks';
10
10
  import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
11
- import { calcTableColumnWidths, getColumnWidths } from '@atlaskit/editor-common/utils';
11
+ import { getColumnWidths } from '@atlaskit/editor-common/utils';
12
12
  import { getText } from '../utils';
13
13
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -375,11 +375,7 @@ export default class ReactSerializer {
375
375
  return {
376
376
  ...this.getProps(node),
377
377
  allowColumnSorting: this.allowColumnSorting,
378
- columnWidths:
379
- // When allowTableResizing is enabled, the number of columns is required to render
380
- // the same scaling logic as editor. Some tables can have unequal rows, so the entire
381
- // table needs to be scanned.
382
- this.allowTableResizing && fg('platform_editor_table_col_calculation_fix') ? getColumnWidths(node) : calcTableColumnWidths(node),
378
+ columnWidths: getColumnWidths(node),
383
379
  tableNode: node,
384
380
  stickyHeaders,
385
381
  isInsideOfBlockNode,
@@ -127,7 +127,7 @@ const MediaSingleWithChildren = props => {
127
127
  const padding = isFullPage ? FullPagePadding * 2 : 0;
128
128
  const calcDimensions = useCallback(mediaContainerWidth => {
129
129
  const containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
130
- const maxWidth = isSSR() && widthAttr && typeof widthAttr === 'number' && widthType === 'pixel' && fg('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(widthAttr, containerWidth) : containerWidth;
130
+ const maxWidth = isSSR() && widthAttr && typeof widthAttr === 'number' && fg('platform_editor_fix_image_size_diff_during_ssr') ? Math.max(widthAttr, containerWidth) : containerWidth;
131
131
  const maxHeight = height / width * maxWidth;
132
132
  const cardDimensions = {
133
133
  width: `${maxWidth}px`,
@@ -148,7 +148,7 @@ const MediaSingleWithChildren = props => {
148
148
  cardDimensions,
149
149
  lineLength
150
150
  };
151
- }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr, widthType]);
151
+ }, [height, isFullWidth, isInsideOfBlockNode, layout, padding, rendererAppearance, width, widthAttr]);
152
152
  const originalDimensions = useMemo(() => ({
153
153
  width,
154
154
  height
@@ -103,7 +103,8 @@ export const StickyTable = ({
103
103
  rowHeight,
104
104
  tableNode,
105
105
  rendererAppearance,
106
- allowTableResizing
106
+ allowTableResizing,
107
+ fixTableSSRResizing = false
107
108
  }) => {
108
109
  let styles;
109
110
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
@@ -137,7 +138,9 @@ export const StickyTable = ({
137
138
  className: `${TableSharedCssClassName.TABLE_CONTAINER} is-sticky ${shadowClassNames || ''}`,
138
139
  "data-layout": layout,
139
140
  style: {
140
- width: tableWidth
141
+ width: tableWidth,
142
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
143
+ marginBottom: fixTableSSRResizing ? 0 : ''
141
144
  }
142
145
  }, jsx("div", {
143
146
  ref: innerRef
@@ -170,6 +173,9 @@ export const StickyTable = ({
170
173
 
171
174
  /**
172
175
  * Traverse DOM Tree upwards looking for table parents with "overflow: scroll".
176
+ * @param table
177
+ * @param defaultScrollRootId
178
+ * @example
173
179
  */
174
180
  function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
175
181
  let parent = table;
@@ -193,23 +199,46 @@ function findHorizontalOverflowScrollParent(table, defaultScrollRootId) {
193
199
  }
194
200
  return null;
195
201
  }
202
+
203
+ /**
204
+ *
205
+ */
196
206
  export class OverflowParent {
197
207
  constructor(ref) {
198
208
  this.ref = ref;
199
209
  this.ref = ref;
200
210
  }
211
+
212
+ /**
213
+ *
214
+ * @param el
215
+ * @param defaultScrollRootId
216
+ * @example
217
+ */
201
218
  static fromElement(el, defaultScrollRootId) {
202
219
  return new OverflowParent(findHorizontalOverflowScrollParent(el, defaultScrollRootId) || window);
203
220
  }
221
+
222
+ /**
223
+ *
224
+ */
204
225
  get isElement() {
205
226
  return this.ref instanceof HTMLElement;
206
227
  }
228
+
229
+ /**
230
+ *
231
+ */
207
232
  get id() {
208
233
  if (this.ref instanceof HTMLElement) {
209
234
  return this.ref.id;
210
235
  }
211
236
  return '';
212
237
  }
238
+
239
+ /**
240
+ *
241
+ */
213
242
  get top() {
214
243
  if (this.ref instanceof HTMLElement) {
215
244
  return this.ref.getBoundingClientRect().top;
@@ -217,6 +246,13 @@ export class OverflowParent {
217
246
  return 0;
218
247
  }
219
248
 
249
+ /**
250
+ *
251
+ * @param type
252
+ * @param cb
253
+ * @param {...any} args
254
+ * @example
255
+ */
220
256
  // Ignored via go/ees005
221
257
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
222
258
  addEventListener(type, cb, ...args) {
@@ -225,6 +261,13 @@ export class OverflowParent {
225
261
  this.ref.addEventListener(type, cb, ...args);
226
262
  }
227
263
 
264
+ /**
265
+ *
266
+ * @param type
267
+ * @param cb
268
+ * @param {...any} args
269
+ * @example
270
+ */
228
271
  // Ignored via go/ees005
229
272
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
230
273
  removeEventListener(type, cb, ...args) {