@atlaskit/renderer 153.5.0 → 153.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/react/nodes/table/colgroup.js +36 -16
- package/dist/cjs/react/nodes/table/table.js +16 -1
- package/dist/cjs/react/nodes/table.js +83 -18
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/table/colgroup.js +34 -17
- package/dist/es2019/react/nodes/table/table.js +17 -2
- package/dist/es2019/react/nodes/table.js +70 -10
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/table/colgroup.js +36 -16
- package/dist/esm/react/nodes/table/table.js +17 -2
- package/dist/esm/react/nodes/table.js +79 -14
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/table/types.d.ts +3 -0
- package/dist/types/react/nodes/table.d.ts +2 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 153.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2828e9853e1d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2828e9853e1d1) -
|
|
8
|
+
Disable table sticky headers, overflow shadow tracking, and automatic table scaling when
|
|
9
|
+
Confluence View Page Performance Mode is active, controlled by
|
|
10
|
+
`confluence_view_page_performance_mode`. Preserve authored widths, horizontal scrolling, and
|
|
11
|
+
existing behavior outside Performance Mode. Share saved-width column normalization between full
|
|
12
|
+
and light tables, including number-column space, and preserve fit-to-content sizing in light
|
|
13
|
+
tables. Preserve inherited comment table sizing when no numeric table width is available.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 153.5.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -10,6 +10,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
12
12
|
var _table = require("@atlaskit/editor-common/styles/table");
|
|
13
|
+
var _normalizeColumnWidths = require("@atlaskit/editor-common/table/normalize-column-widths");
|
|
13
14
|
var _WidthProvider = require("@atlaskit/editor-common/WidthProvider");
|
|
14
15
|
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
15
16
|
var _rendererContext = require("../../../renderer-context");
|
|
@@ -337,10 +338,12 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
337
338
|
});
|
|
338
339
|
};
|
|
339
340
|
var Colgroup = exports.Colgroup = function Colgroup(props) {
|
|
340
|
-
var _props$allowFixedColu
|
|
341
|
+
var _props$allowFixedColu;
|
|
341
342
|
var _useRendererContext = (0, _rendererContext.useRendererContext)(),
|
|
342
343
|
isTopLevelRenderer = _useRendererContext.isTopLevelRenderer,
|
|
343
|
-
nestedRendererType = _useRendererContext.nestedRendererType
|
|
344
|
+
nestedRendererType = _useRendererContext.nestedRendererType,
|
|
345
|
+
_useRendererContext$i = _useRendererContext.isPerformanceModeActive,
|
|
346
|
+
isPerformanceModeActive = _useRendererContext$i === void 0 ? false : _useRendererContext$i;
|
|
344
347
|
var columnWidths = props.columnWidths,
|
|
345
348
|
isNumberColumnEnabled = props.isNumberColumnEnabled;
|
|
346
349
|
var _useContext = (0, _react.useContext)(_WidthProvider.WidthContext),
|
|
@@ -357,20 +360,37 @@ var Colgroup = exports.Colgroup = function Colgroup(props) {
|
|
|
357
360
|
|
|
358
361
|
// renderSyncBlockColgroup returns null when not applicable (flag off, SSR, not a sync block),
|
|
359
362
|
// in which case ?? falls back to the standard renderScaleDownColgroup path.
|
|
360
|
-
var colStyles
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
363
|
+
var colStyles;
|
|
364
|
+
if (isPerformanceModeActive) {
|
|
365
|
+
var _props$tableWidth;
|
|
366
|
+
// Keep authored widths without viewport-driven scaling, including sync blocks.
|
|
367
|
+
colStyles = (0, _normalizeColumnWidths.normalizeTableColumnWidths)({
|
|
368
|
+
columnWidths: columnWidths,
|
|
369
|
+
isNumberColumnEnabled: !!isNumberColumnEnabled,
|
|
370
|
+
skipMinWidth: !!(props.isInsideOfTable && isInsideOfSyncBlock),
|
|
371
|
+
tableWidth: (_props$tableWidth = props.tableWidth) !== null && _props$tableWidth !== void 0 ? _props$tableWidth : (0, _nodeWidth.getTableContainerWidth)(props.tableNode)
|
|
372
|
+
}).map(function (width) {
|
|
373
|
+
return {
|
|
374
|
+
width: "".concat(width, "px")
|
|
375
|
+
};
|
|
376
|
+
});
|
|
377
|
+
} else {
|
|
378
|
+
var _renderSyncBlockColgr;
|
|
379
|
+
colStyles = (_renderSyncBlockColgr = renderSyncBlockColgroup({
|
|
380
|
+
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
381
|
+
isInsideOfTable: !!props.isInsideOfTable,
|
|
382
|
+
tableNode: props.tableNode,
|
|
383
|
+
columnWidths: columnWidths,
|
|
384
|
+
isNumberColumnEnabled: !!isNumberColumnEnabled,
|
|
385
|
+
renderWidth: props.renderWidth,
|
|
386
|
+
contextWidth: contextWidth
|
|
387
|
+
})) !== null && _renderSyncBlockColgr !== void 0 ? _renderSyncBlockColgr : renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
|
|
388
|
+
isTopLevelRenderer: isTopLevelRenderer,
|
|
389
|
+
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
390
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' || props.rendererAppearance === 'comment',
|
|
391
|
+
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max')
|
|
392
|
+
}));
|
|
393
|
+
}
|
|
374
394
|
if (!colStyles) {
|
|
375
395
|
return null;
|
|
376
396
|
}
|
|
@@ -11,6 +11,7 @@ var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
|
11
11
|
var _contentMode = require("@atlaskit/editor-common/table/content-mode");
|
|
12
12
|
var _constants = require("@atlaskit/editor-shared-styles/constants");
|
|
13
13
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
14
|
+
var _rendererContext = require("../../../renderer-context");
|
|
14
15
|
var _colgroup = require("./colgroup");
|
|
15
16
|
var _contentMode2 = require("./content-mode");
|
|
16
17
|
var Table = exports.Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
@@ -33,7 +34,17 @@ var Table = exports.Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
33
34
|
fixTableSSRResizing = _ref$fixTableSSRResiz === void 0 ? false : _ref$fixTableSSRResiz,
|
|
34
35
|
_ref$allowFixedColumn = _ref.allowFixedColumnWidthOption,
|
|
35
36
|
allowFixedColumnWidthOption = _ref$allowFixedColumn === void 0 ? false : _ref$allowFixedColumn;
|
|
37
|
+
var _useRendererContext = (0, _rendererContext.useRendererContext)(),
|
|
38
|
+
_useRendererContext$i = _useRendererContext.isPerformanceModeActive,
|
|
39
|
+
isPerformanceModeActive = _useRendererContext$i === void 0 ? false : _useRendererContext$i;
|
|
36
40
|
var tableWidth = tableNode ? (0, _nodeWidth.getTableContainerWidth)(tableNode) : _constants.akEditorDefaultLayoutWidth;
|
|
41
|
+
if (isPerformanceModeActive && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
42
|
+
if (rendererAppearance === 'full-width') {
|
|
43
|
+
tableWidth = _constants.akEditorFullWidthLayoutWidth;
|
|
44
|
+
} else if (rendererAppearance === 'max') {
|
|
45
|
+
tableWidth = _constants.akEditorMaxWidthLayoutWidth;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
37
48
|
var tableColumnWidths = columnWidths;
|
|
38
49
|
if (rendererAppearance === 'comment' && allowTableResizing && tableNode && !((_tableNode$attrs = tableNode.attrs) !== null && _tableNode$attrs !== void 0 && _tableNode$attrs.width)) {
|
|
39
50
|
tableWidth = 'inherit';
|
|
@@ -64,9 +75,13 @@ var Table = exports.Table = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
64
75
|
"data-initial-width-mode": isContentMode ? 'content' : undefined,
|
|
65
76
|
ref: innerRef,
|
|
66
77
|
style: {
|
|
67
|
-
marginTop: fixTableSSRResizing ? '0px' : ''
|
|
78
|
+
marginTop: fixTableSSRResizing ? '0px' : '',
|
|
79
|
+
// Keep the table's saved width while its outer viewport can still shrink and scroll.
|
|
80
|
+
minWidth: isPerformanceModeActive && !isContentMode && typeof tableWidth === 'number' ? tableWidth : undefined,
|
|
81
|
+
width: isPerformanceModeActive && !isContentMode && typeof tableWidth === 'number' ? tableWidth : undefined
|
|
68
82
|
}
|
|
69
83
|
}), /*#__PURE__*/_react.default.createElement(_colgroup.Colgroup, {
|
|
84
|
+
tableWidth: isPerformanceModeActive && typeof tableWidth === 'number' ? tableWidth : undefined,
|
|
70
85
|
columnWidths: tableColumnWidths,
|
|
71
86
|
layout: layout,
|
|
72
87
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -14,10 +14,12 @@ 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 _reactIntl = require("react-intl");
|
|
18
|
+
var _table = require("@atlaskit/editor-common/messages/table");
|
|
17
19
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
18
20
|
var _OverflowShadow = _interopRequireDefault(require("@atlaskit/editor-common/OverflowShadow"));
|
|
19
21
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
20
|
-
var
|
|
22
|
+
var _table2 = require("@atlaskit/editor-common/styles/table");
|
|
21
23
|
var _contentMode = require("@atlaskit/editor-common/table/content-mode");
|
|
22
24
|
var _types = require("@atlaskit/editor-common/types");
|
|
23
25
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -35,7 +37,7 @@ var _appearance = require("../utils/appearance");
|
|
|
35
37
|
var _cachedCellEdges = require("./table/cached-cell-edges");
|
|
36
38
|
var _contentMode2 = require("./table/content-mode");
|
|
37
39
|
var _sticky = require("./table/sticky");
|
|
38
|
-
var
|
|
40
|
+
var _table3 = require("./table/table");
|
|
39
41
|
var _tableCell = require("./tableCell");
|
|
40
42
|
var _TableStickyScrollbar = require("./TableStickyScrollbar");
|
|
41
43
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -227,6 +229,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
227
229
|
(0, _defineProperty2.default)(_this, "lastComputedStyle", {});
|
|
228
230
|
(0, _defineProperty2.default)(_this, "resizeObserver", null);
|
|
229
231
|
(0, _defineProperty2.default)(_this, "applyResizerChange", function (entries) {
|
|
232
|
+
if (_this.props.isPerformanceModeActive) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
230
235
|
var wrapperWidth = _this.state.wrapperWidth;
|
|
231
236
|
var headerRowHeight = _this.state.headerRowHeight;
|
|
232
237
|
var _iterator = _createForOfIteratorHelper(entries),
|
|
@@ -293,6 +298,9 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
293
298
|
return (_this.overflowParent ? _this.overflowParent.top : 0) + offsetTop;
|
|
294
299
|
});
|
|
295
300
|
(0, _defineProperty2.default)(_this, "updateSticky", function () {
|
|
301
|
+
if (_this.props.isPerformanceModeActive) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
296
304
|
var tableElem = _this.tableRef.current;
|
|
297
305
|
var refElem = _this.stickyHeaderRef.current;
|
|
298
306
|
if (!tableElem || !refElem) {
|
|
@@ -322,6 +330,12 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
322
330
|
}
|
|
323
331
|
});
|
|
324
332
|
(0, _defineProperty2.default)(_this, "onWrapperScrolled", function () {
|
|
333
|
+
if (_this.props.isPerformanceModeActive) {
|
|
334
|
+
if (_this.wrapperRef.current && _this.stickyScrollbarRef.current) {
|
|
335
|
+
_this.stickyScrollbarRef.current.scrollLeft = _this.wrapperRef.current.scrollLeft;
|
|
336
|
+
}
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
325
339
|
if (!_this.wrapperRef.current || !_this.stickyWrapperRef.current) {
|
|
326
340
|
return;
|
|
327
341
|
}
|
|
@@ -459,17 +473,12 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
459
473
|
* @example
|
|
460
474
|
*/
|
|
461
475
|
function componentDidMount() {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
this.resizeObserver.observe(this.wrapperRef.current);
|
|
465
|
-
}
|
|
466
|
-
if (this.stickyHeaderRef.current) {
|
|
467
|
-
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
476
|
+
if (!this.props.isPerformanceModeActive) {
|
|
477
|
+
this.observeDimensions();
|
|
468
478
|
}
|
|
469
479
|
if (this.props.stickyHeaders) {
|
|
470
480
|
var _this$props$stickyHea;
|
|
471
481
|
this.overflowParent = _sticky.OverflowParent.fromElement(this.tableRef.current, (_this$props$stickyHea = this.props.stickyHeaders) === null || _this$props$stickyHea === void 0 ? void 0 : _this$props$stickyHea.defaultScrollRootId_DO_NOT_USE);
|
|
472
|
-
// Ignored via go/ees005
|
|
473
482
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
474
483
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
475
484
|
}
|
|
@@ -478,7 +487,20 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
478
487
|
}
|
|
479
488
|
this.applyNestedRendererTableFix();
|
|
480
489
|
}
|
|
481
|
-
|
|
490
|
+
}, {
|
|
491
|
+
key: "observeDimensions",
|
|
492
|
+
value: function observeDimensions() {
|
|
493
|
+
this.resizeObserver = new ResizeObserver(this.applyResizerChange);
|
|
494
|
+
if (this.wrapperRef.current) {
|
|
495
|
+
this.resizeObserver.observe(this.wrapperRef.current);
|
|
496
|
+
}
|
|
497
|
+
if (this.stickyHeaderRef.current) {
|
|
498
|
+
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}, {
|
|
502
|
+
key: "componentDidUpdate",
|
|
503
|
+
value:
|
|
482
504
|
/**
|
|
483
505
|
* Updates sticky header wiring and scroll synchronization after prop or state changes.
|
|
484
506
|
*
|
|
@@ -486,13 +508,28 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
486
508
|
* @param prevState
|
|
487
509
|
* @example
|
|
488
510
|
*/
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
511
|
+
function componentDidUpdate(prevProps, prevState) {
|
|
512
|
+
if (this.props.isPerformanceModeActive !== prevProps.isPerformanceModeActive) {
|
|
513
|
+
if (this.props.isPerformanceModeActive) {
|
|
514
|
+
var _this$resizeObserver;
|
|
515
|
+
(_this$resizeObserver = this.resizeObserver) === null || _this$resizeObserver === void 0 || _this$resizeObserver.disconnect();
|
|
516
|
+
this.resizeObserver = null;
|
|
517
|
+
if (this.nextFrame) {
|
|
518
|
+
cancelAnimationFrame(this.nextFrame);
|
|
519
|
+
this.nextFrame = undefined;
|
|
520
|
+
}
|
|
521
|
+
} else if (prevProps.isPerformanceModeActive) {
|
|
522
|
+
this.observeDimensions();
|
|
523
|
+
}
|
|
524
|
+
}
|
|
492
525
|
// toggling sticky headers visiblity
|
|
493
526
|
if (this.props.stickyHeaders && !this.overflowParent) {
|
|
494
527
|
var _this$props$stickyHea2;
|
|
495
528
|
this.overflowParent = _sticky.OverflowParent.fromElement(this.tableRef.current, (_this$props$stickyHea2 = this.props.stickyHeaders) === null || _this$props$stickyHea2 === void 0 ? void 0 : _this$props$stickyHea2.defaultScrollRootId_DO_NOT_USE);
|
|
529
|
+
if (prevProps.isPerformanceModeActive) {
|
|
530
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
531
|
+
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
532
|
+
}
|
|
496
533
|
} else if (!this.props.stickyHeaders && this.overflowParent) {
|
|
497
534
|
// Ignored via go/ees005
|
|
498
535
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -524,7 +561,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
524
561
|
if (!this.tableRef.current || !this.stickyHeaderRef.current) {
|
|
525
562
|
return;
|
|
526
563
|
}
|
|
527
|
-
return this.tableRef.current.offsetHeight - this.stickyHeaderRef.current.offsetHeight +
|
|
564
|
+
return this.tableRef.current.offsetHeight - this.stickyHeaderRef.current.offsetHeight + _table2.tableMarginTop - _sticky.tableStickyPadding;
|
|
528
565
|
}
|
|
529
566
|
|
|
530
567
|
/**
|
|
@@ -725,8 +762,11 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
725
762
|
"data-table-local-id": tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId,
|
|
726
763
|
"data-table-width": tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width,
|
|
727
764
|
"data-vc": "table-node-wrapper",
|
|
728
|
-
|
|
729
|
-
|
|
765
|
+
tabIndex: this.props.isPerformanceModeActive ? 0 : undefined,
|
|
766
|
+
role: this.props.isPerformanceModeActive ? 'region' : undefined,
|
|
767
|
+
"aria-label": this.props.isPerformanceModeActive ? this.props.scrollRegionLabel : undefined,
|
|
768
|
+
onScroll: (this.props.isPerformanceModeActive || this.props.stickyHeaders) && this.onWrapperScrolled
|
|
769
|
+
}, /*#__PURE__*/_react.default.createElement(_table3.Table, {
|
|
730
770
|
innerRef: this.tableRef,
|
|
731
771
|
columnWidths: columnWidths,
|
|
732
772
|
layout: layout,
|
|
@@ -761,6 +801,16 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
|
|
|
761
801
|
isNumberColumnEnabled: isNumberColumnEnabled
|
|
762
802
|
})));
|
|
763
803
|
}
|
|
804
|
+
}], [{
|
|
805
|
+
key: "getDerivedStateFromProps",
|
|
806
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
807
|
+
if (props.isPerformanceModeActive && state.stickyMode !== 'none') {
|
|
808
|
+
return {
|
|
809
|
+
stickyMode: 'none'
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
return null;
|
|
813
|
+
}
|
|
764
814
|
}]);
|
|
765
815
|
}(_react.default.Component);
|
|
766
816
|
var getCellEdgePropsByCellOffset = function getCellEdgePropsByCellOffset(tableNode, isNumberColumnEnabled) {
|
|
@@ -953,6 +1003,8 @@ var TableProcessorWithContainerStyles = exports.TableProcessorWithContainerStyle
|
|
|
953
1003
|
isNumberColumnEnabled = _this$props2.isNumberColumnEnabled,
|
|
954
1004
|
isPresentational = _this$props2.isPresentational,
|
|
955
1005
|
layout = _this$props2.layout,
|
|
1006
|
+
isPerformanceModeActive = _this$props2.isPerformanceModeActive,
|
|
1007
|
+
scrollRegionLabel = _this$props2.scrollRegionLabel,
|
|
956
1008
|
rendererAppearance = _this$props2.rendererAppearance,
|
|
957
1009
|
renderWidth = _this$props2.renderWidth,
|
|
958
1010
|
shadowClassNames = _this$props2.shadowClassNames,
|
|
@@ -982,6 +1034,8 @@ var TableProcessorWithContainerStyles = exports.TableProcessorWithContainerStyle
|
|
|
982
1034
|
isInsideOfTable: isInsideOfTable,
|
|
983
1035
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
984
1036
|
isPresentational: isPresentational,
|
|
1037
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1038
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
985
1039
|
layout: layout,
|
|
986
1040
|
rendererAppearance: rendererAppearance,
|
|
987
1041
|
renderWidth: renderWidth,
|
|
@@ -1004,10 +1058,14 @@ var TableWithShadowsAndContainerStyles = (0, _OverflowShadow.default)(TableProce
|
|
|
1004
1058
|
useShadowObserver: true
|
|
1005
1059
|
});
|
|
1006
1060
|
var TableWithWidth = function TableWithWidth(props) {
|
|
1007
|
-
var _props$columnWidths;
|
|
1061
|
+
var _intl$formatMessage, _props$columnWidths;
|
|
1008
1062
|
var _useRendererContext2 = (0, _rendererContext.useRendererContext)(),
|
|
1009
|
-
isTopLevelRenderer = _useRendererContext2.isTopLevelRenderer
|
|
1063
|
+
isTopLevelRenderer = _useRendererContext2.isTopLevelRenderer,
|
|
1064
|
+
_useRendererContext2$ = _useRendererContext2.isPerformanceModeActive,
|
|
1065
|
+
isPerformanceModeActive = _useRendererContext2$ === void 0 ? false : _useRendererContext2$;
|
|
1066
|
+
var intl = _react.default.useContext(_reactIntl.IntlContext);
|
|
1010
1067
|
var isInsideOfNestedRenderer = isTopLevelRenderer === false;
|
|
1068
|
+
var scrollRegionLabel = isPerformanceModeActive ? (_intl$formatMessage = intl === null || intl === void 0 ? void 0 : intl.formatMessage(_table.messages.tableScrollRegion)) !== null && _intl$formatMessage !== void 0 ? _intl$formatMessage : _table.messages.tableScrollRegion.defaultMessage : undefined;
|
|
1011
1069
|
var colWidthsSum =
|
|
1012
1070
|
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
1013
1071
|
((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
@@ -1018,6 +1076,10 @@ var TableWithWidth = function TableWithWidth(props) {
|
|
|
1018
1076
|
// Ignored via go/ees005
|
|
1019
1077
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
1020
1078
|
, (0, _extends2.default)({}, props, {
|
|
1079
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1080
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
1081
|
+
stickyHeaders: isPerformanceModeActive ? undefined : props.stickyHeaders,
|
|
1082
|
+
disableShadowTracking: isPerformanceModeActive,
|
|
1021
1083
|
isInsideOfNestedRenderer: isInsideOfNestedRenderer
|
|
1022
1084
|
}));
|
|
1023
1085
|
}
|
|
@@ -1025,6 +1087,9 @@ var TableWithWidth = function TableWithWidth(props) {
|
|
|
1025
1087
|
// Ignored via go/ees005
|
|
1026
1088
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
1027
1089
|
, (0, _extends2.default)({}, props, {
|
|
1090
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1091
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
1092
|
+
stickyHeaders: isPerformanceModeActive ? undefined : props.stickyHeaders,
|
|
1028
1093
|
isInsideOfNestedRenderer: isInsideOfNestedRenderer
|
|
1029
1094
|
}));
|
|
1030
1095
|
};
|
|
@@ -79,7 +79,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
79
79
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
80
80
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
81
81
|
var packageName = "@atlaskit/renderer";
|
|
82
|
-
var packageVersion = "153.
|
|
82
|
+
var packageVersion = "153.5.0";
|
|
83
83
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
84
84
|
containerName: 'ak-renderer-wrapper',
|
|
85
85
|
containerType: 'inline-size'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
3
3
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles/table';
|
|
4
|
+
import { normalizeTableColumnWidths } from '@atlaskit/editor-common/table/normalize-column-widths';
|
|
4
5
|
import { WidthContext } from '@atlaskit/editor-common/WidthProvider';
|
|
5
6
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
6
7
|
import { useRendererContext } from '../../../renderer-context';
|
|
@@ -304,10 +305,11 @@ const renderScaleDownColgroup = props => {
|
|
|
304
305
|
});
|
|
305
306
|
};
|
|
306
307
|
export const Colgroup = props => {
|
|
307
|
-
var _props$allowFixedColu
|
|
308
|
+
var _props$allowFixedColu;
|
|
308
309
|
const {
|
|
309
310
|
isTopLevelRenderer,
|
|
310
|
-
nestedRendererType
|
|
311
|
+
nestedRendererType,
|
|
312
|
+
isPerformanceModeActive = false
|
|
311
313
|
} = useRendererContext();
|
|
312
314
|
const {
|
|
313
315
|
columnWidths,
|
|
@@ -328,21 +330,36 @@ export const Colgroup = props => {
|
|
|
328
330
|
|
|
329
331
|
// renderSyncBlockColgroup returns null when not applicable (flag off, SSR, not a sync block),
|
|
330
332
|
// in which case ?? falls back to the standard renderScaleDownColgroup path.
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
333
|
+
let colStyles;
|
|
334
|
+
if (isPerformanceModeActive) {
|
|
335
|
+
var _props$tableWidth;
|
|
336
|
+
// Keep authored widths without viewport-driven scaling, including sync blocks.
|
|
337
|
+
colStyles = normalizeTableColumnWidths({
|
|
338
|
+
columnWidths,
|
|
339
|
+
isNumberColumnEnabled: !!isNumberColumnEnabled,
|
|
340
|
+
skipMinWidth: !!(props.isInsideOfTable && isInsideOfSyncBlock),
|
|
341
|
+
tableWidth: (_props$tableWidth = props.tableWidth) !== null && _props$tableWidth !== void 0 ? _props$tableWidth : getTableContainerWidth(props.tableNode)
|
|
342
|
+
}).map(width => ({
|
|
343
|
+
width: `${width}px`
|
|
344
|
+
}));
|
|
345
|
+
} else {
|
|
346
|
+
var _renderSyncBlockColgr;
|
|
347
|
+
colStyles = (_renderSyncBlockColgr = renderSyncBlockColgroup({
|
|
348
|
+
isInsideOfSyncBlock,
|
|
349
|
+
isInsideOfTable: !!props.isInsideOfTable,
|
|
350
|
+
tableNode: props.tableNode,
|
|
351
|
+
columnWidths,
|
|
352
|
+
isNumberColumnEnabled: !!isNumberColumnEnabled,
|
|
353
|
+
renderWidth: props.renderWidth,
|
|
354
|
+
contextWidth
|
|
355
|
+
})) !== null && _renderSyncBlockColgr !== void 0 ? _renderSyncBlockColgr : renderScaleDownColgroup({
|
|
356
|
+
...props,
|
|
357
|
+
isTopLevelRenderer,
|
|
358
|
+
isInsideOfSyncBlock,
|
|
359
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' || props.rendererAppearance === 'comment',
|
|
360
|
+
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max')
|
|
361
|
+
});
|
|
362
|
+
}
|
|
346
363
|
if (!colStyles) {
|
|
347
364
|
return null;
|
|
348
365
|
}
|
|
@@ -2,8 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
4
4
|
import { isTableInContentMode } from '@atlaskit/editor-common/table/content-mode';
|
|
5
|
-
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
5
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorMaxWidthLayoutWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
|
+
import { useRendererContext } from '../../../renderer-context';
|
|
7
8
|
import { Colgroup, colWidthSum } from './colgroup';
|
|
8
9
|
import { isContentModeSupported } from './content-mode';
|
|
9
10
|
export const Table = /*#__PURE__*/React.memo(({
|
|
@@ -25,7 +26,17 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
25
26
|
allowFixedColumnWidthOption = false
|
|
26
27
|
}) => {
|
|
27
28
|
var _tableNode$attrs;
|
|
29
|
+
const {
|
|
30
|
+
isPerformanceModeActive = false
|
|
31
|
+
} = useRendererContext();
|
|
28
32
|
let tableWidth = tableNode ? getTableContainerWidth(tableNode) : akEditorDefaultLayoutWidth;
|
|
33
|
+
if (isPerformanceModeActive && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
34
|
+
if (rendererAppearance === 'full-width') {
|
|
35
|
+
tableWidth = akEditorFullWidthLayoutWidth;
|
|
36
|
+
} else if (rendererAppearance === 'max') {
|
|
37
|
+
tableWidth = akEditorMaxWidthLayoutWidth;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
29
40
|
let tableColumnWidths = columnWidths;
|
|
30
41
|
if (rendererAppearance === 'comment' && allowTableResizing && tableNode && !((_tableNode$attrs = tableNode.attrs) !== null && _tableNode$attrs !== void 0 && _tableNode$attrs.width)) {
|
|
31
42
|
tableWidth = 'inherit';
|
|
@@ -56,9 +67,13 @@ export const Table = /*#__PURE__*/React.memo(({
|
|
|
56
67
|
"data-initial-width-mode": isContentMode ? 'content' : undefined,
|
|
57
68
|
ref: innerRef,
|
|
58
69
|
style: {
|
|
59
|
-
marginTop: fixTableSSRResizing ? '0px' : ''
|
|
70
|
+
marginTop: fixTableSSRResizing ? '0px' : '',
|
|
71
|
+
// Keep the table's saved width while its outer viewport can still shrink and scroll.
|
|
72
|
+
minWidth: isPerformanceModeActive && !isContentMode && typeof tableWidth === 'number' ? tableWidth : undefined,
|
|
73
|
+
width: isPerformanceModeActive && !isContentMode && typeof tableWidth === 'number' ? tableWidth : undefined
|
|
60
74
|
}
|
|
61
75
|
}), /*#__PURE__*/React.createElement(Colgroup, {
|
|
76
|
+
tableWidth: isPerformanceModeActive && typeof tableWidth === 'number' ? tableWidth : undefined,
|
|
62
77
|
columnWidths: tableColumnWidths,
|
|
63
78
|
layout: layout,
|
|
64
79
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -3,6 +3,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
3
3
|
/* eslint-disable @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/enforce-style-prop, @repo/internal/react/no-class-components */
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { IntlContext } from 'react-intl';
|
|
7
|
+
import { messages } from '@atlaskit/editor-common/messages/table';
|
|
6
8
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
7
9
|
import overflowShadow from '@atlaskit/editor-common/OverflowShadow';
|
|
8
10
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -192,6 +194,9 @@ export class TableContainer extends React.Component {
|
|
|
192
194
|
_defineProperty(this, "lastComputedStyle", {});
|
|
193
195
|
_defineProperty(this, "resizeObserver", null);
|
|
194
196
|
_defineProperty(this, "applyResizerChange", entries => {
|
|
197
|
+
if (this.props.isPerformanceModeActive) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
195
200
|
let wrapperWidth = this.state.wrapperWidth;
|
|
196
201
|
let headerRowHeight = this.state.headerRowHeight;
|
|
197
202
|
for (const entry of entries) {
|
|
@@ -253,6 +258,9 @@ export class TableContainer extends React.Component {
|
|
|
253
258
|
return (this.overflowParent ? this.overflowParent.top : 0) + offsetTop;
|
|
254
259
|
});
|
|
255
260
|
_defineProperty(this, "updateSticky", () => {
|
|
261
|
+
if (this.props.isPerformanceModeActive) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
256
264
|
const tableElem = this.tableRef.current;
|
|
257
265
|
const refElem = this.stickyHeaderRef.current;
|
|
258
266
|
if (!tableElem || !refElem) {
|
|
@@ -282,6 +290,12 @@ export class TableContainer extends React.Component {
|
|
|
282
290
|
}
|
|
283
291
|
});
|
|
284
292
|
_defineProperty(this, "onWrapperScrolled", () => {
|
|
293
|
+
if (this.props.isPerformanceModeActive) {
|
|
294
|
+
if (this.wrapperRef.current && this.stickyScrollbarRef.current) {
|
|
295
|
+
this.stickyScrollbarRef.current.scrollLeft = this.wrapperRef.current.scrollLeft;
|
|
296
|
+
}
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
285
299
|
if (!this.wrapperRef.current || !this.stickyWrapperRef.current) {
|
|
286
300
|
return;
|
|
287
301
|
}
|
|
@@ -406,17 +420,12 @@ export class TableContainer extends React.Component {
|
|
|
406
420
|
* @example
|
|
407
421
|
*/
|
|
408
422
|
componentDidMount() {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
this.resizeObserver.observe(this.wrapperRef.current);
|
|
412
|
-
}
|
|
413
|
-
if (this.stickyHeaderRef.current) {
|
|
414
|
-
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
423
|
+
if (!this.props.isPerformanceModeActive) {
|
|
424
|
+
this.observeDimensions();
|
|
415
425
|
}
|
|
416
426
|
if (this.props.stickyHeaders) {
|
|
417
427
|
var _this$props$stickyHea;
|
|
418
428
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current, (_this$props$stickyHea = this.props.stickyHeaders) === null || _this$props$stickyHea === void 0 ? void 0 : _this$props$stickyHea.defaultScrollRootId_DO_NOT_USE);
|
|
419
|
-
// Ignored via go/ees005
|
|
420
429
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
421
430
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
422
431
|
}
|
|
@@ -425,6 +434,23 @@ export class TableContainer extends React.Component {
|
|
|
425
434
|
}
|
|
426
435
|
this.applyNestedRendererTableFix();
|
|
427
436
|
}
|
|
437
|
+
observeDimensions() {
|
|
438
|
+
this.resizeObserver = new ResizeObserver(this.applyResizerChange);
|
|
439
|
+
if (this.wrapperRef.current) {
|
|
440
|
+
this.resizeObserver.observe(this.wrapperRef.current);
|
|
441
|
+
}
|
|
442
|
+
if (this.stickyHeaderRef.current) {
|
|
443
|
+
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
static getDerivedStateFromProps(props, state) {
|
|
447
|
+
if (props.isPerformanceModeActive && state.stickyMode !== 'none') {
|
|
448
|
+
return {
|
|
449
|
+
stickyMode: 'none'
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
return null;
|
|
453
|
+
}
|
|
428
454
|
|
|
429
455
|
/**
|
|
430
456
|
* Updates sticky header wiring and scroll synchronization after prop or state changes.
|
|
@@ -434,10 +460,27 @@ export class TableContainer extends React.Component {
|
|
|
434
460
|
* @example
|
|
435
461
|
*/
|
|
436
462
|
componentDidUpdate(prevProps, prevState) {
|
|
463
|
+
if (this.props.isPerformanceModeActive !== prevProps.isPerformanceModeActive) {
|
|
464
|
+
if (this.props.isPerformanceModeActive) {
|
|
465
|
+
var _this$resizeObserver;
|
|
466
|
+
(_this$resizeObserver = this.resizeObserver) === null || _this$resizeObserver === void 0 ? void 0 : _this$resizeObserver.disconnect();
|
|
467
|
+
this.resizeObserver = null;
|
|
468
|
+
if (this.nextFrame) {
|
|
469
|
+
cancelAnimationFrame(this.nextFrame);
|
|
470
|
+
this.nextFrame = undefined;
|
|
471
|
+
}
|
|
472
|
+
} else if (prevProps.isPerformanceModeActive) {
|
|
473
|
+
this.observeDimensions();
|
|
474
|
+
}
|
|
475
|
+
}
|
|
437
476
|
// toggling sticky headers visiblity
|
|
438
477
|
if (this.props.stickyHeaders && !this.overflowParent) {
|
|
439
478
|
var _this$props$stickyHea2;
|
|
440
479
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current, (_this$props$stickyHea2 = this.props.stickyHeaders) === null || _this$props$stickyHea2 === void 0 ? void 0 : _this$props$stickyHea2.defaultScrollRootId_DO_NOT_USE);
|
|
480
|
+
if (prevProps.isPerformanceModeActive) {
|
|
481
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
482
|
+
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
483
|
+
}
|
|
441
484
|
} else if (!this.props.stickyHeaders && this.overflowParent) {
|
|
442
485
|
// Ignored via go/ees005
|
|
443
486
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -665,7 +708,10 @@ export class TableContainer extends React.Component {
|
|
|
665
708
|
"data-table-local-id": tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId,
|
|
666
709
|
"data-table-width": tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width,
|
|
667
710
|
"data-vc": "table-node-wrapper",
|
|
668
|
-
|
|
711
|
+
tabIndex: this.props.isPerformanceModeActive ? 0 : undefined,
|
|
712
|
+
role: this.props.isPerformanceModeActive ? 'region' : undefined,
|
|
713
|
+
"aria-label": this.props.isPerformanceModeActive ? this.props.scrollRegionLabel : undefined,
|
|
714
|
+
onScroll: (this.props.isPerformanceModeActive || this.props.stickyHeaders) && this.onWrapperScrolled
|
|
669
715
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
670
716
|
innerRef: this.tableRef,
|
|
671
717
|
columnWidths: columnWidths,
|
|
@@ -887,6 +933,8 @@ export class TableProcessorWithContainerStyles extends React.Component {
|
|
|
887
933
|
isNumberColumnEnabled,
|
|
888
934
|
isPresentational,
|
|
889
935
|
layout,
|
|
936
|
+
isPerformanceModeActive,
|
|
937
|
+
scrollRegionLabel,
|
|
890
938
|
rendererAppearance,
|
|
891
939
|
renderWidth,
|
|
892
940
|
shadowClassNames,
|
|
@@ -917,6 +965,8 @@ export class TableProcessorWithContainerStyles extends React.Component {
|
|
|
917
965
|
isInsideOfTable: isInsideOfTable,
|
|
918
966
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
919
967
|
isPresentational: isPresentational,
|
|
968
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
969
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
920
970
|
layout: layout,
|
|
921
971
|
rendererAppearance: rendererAppearance,
|
|
922
972
|
renderWidth: renderWidth,
|
|
@@ -940,11 +990,14 @@ const TableWithShadowsAndContainerStyles = overflowShadow(TableProcessorWithCont
|
|
|
940
990
|
useShadowObserver: true
|
|
941
991
|
});
|
|
942
992
|
const TableWithWidth = props => {
|
|
943
|
-
var _props$columnWidths;
|
|
993
|
+
var _intl$formatMessage, _props$columnWidths;
|
|
944
994
|
const {
|
|
945
|
-
isTopLevelRenderer
|
|
995
|
+
isTopLevelRenderer,
|
|
996
|
+
isPerformanceModeActive = false
|
|
946
997
|
} = useRendererContext();
|
|
998
|
+
const intl = React.useContext(IntlContext);
|
|
947
999
|
const isInsideOfNestedRenderer = isTopLevelRenderer === false;
|
|
1000
|
+
const scrollRegionLabel = isPerformanceModeActive ? (_intl$formatMessage = intl === null || intl === void 0 ? void 0 : intl.formatMessage(messages.tableScrollRegion)) !== null && _intl$formatMessage !== void 0 ? _intl$formatMessage : messages.tableScrollRegion.defaultMessage : undefined;
|
|
948
1001
|
const colWidthsSum =
|
|
949
1002
|
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
950
1003
|
((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce((total, val) => total + val, 0)) || 0;
|
|
@@ -953,6 +1006,10 @@ const TableWithWidth = props => {
|
|
|
953
1006
|
// Ignored via go/ees005
|
|
954
1007
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
955
1008
|
, _extends({}, props, {
|
|
1009
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1010
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
1011
|
+
stickyHeaders: isPerformanceModeActive ? undefined : props.stickyHeaders,
|
|
1012
|
+
disableShadowTracking: isPerformanceModeActive,
|
|
956
1013
|
isInsideOfNestedRenderer: isInsideOfNestedRenderer
|
|
957
1014
|
}));
|
|
958
1015
|
}
|
|
@@ -960,6 +1017,9 @@ const TableWithWidth = props => {
|
|
|
960
1017
|
// Ignored via go/ees005
|
|
961
1018
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
962
1019
|
, _extends({}, props, {
|
|
1020
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1021
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
1022
|
+
stickyHeaders: isPerformanceModeActive ? undefined : props.stickyHeaders,
|
|
963
1023
|
isInsideOfNestedRenderer: isInsideOfNestedRenderer
|
|
964
1024
|
}));
|
|
965
1025
|
};
|
|
@@ -64,7 +64,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
64
64
|
const TABLE_INFO_TIMEOUT = 10000;
|
|
65
65
|
const RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
66
66
|
const packageName = "@atlaskit/renderer";
|
|
67
|
-
const packageVersion = "153.
|
|
67
|
+
const packageVersion = "153.5.0";
|
|
68
68
|
const setAsQueryContainerStyles = css({
|
|
69
69
|
containerName: 'ak-renderer-wrapper',
|
|
70
70
|
containerType: 'inline-size'
|
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
5
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
6
6
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles/table';
|
|
7
|
+
import { normalizeTableColumnWidths } from '@atlaskit/editor-common/table/normalize-column-widths';
|
|
7
8
|
import { WidthContext } from '@atlaskit/editor-common/WidthProvider';
|
|
8
9
|
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
9
10
|
import { useRendererContext } from '../../../renderer-context';
|
|
@@ -328,10 +329,12 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
328
329
|
});
|
|
329
330
|
};
|
|
330
331
|
export var Colgroup = function Colgroup(props) {
|
|
331
|
-
var _props$allowFixedColu
|
|
332
|
+
var _props$allowFixedColu;
|
|
332
333
|
var _useRendererContext = useRendererContext(),
|
|
333
334
|
isTopLevelRenderer = _useRendererContext.isTopLevelRenderer,
|
|
334
|
-
nestedRendererType = _useRendererContext.nestedRendererType
|
|
335
|
+
nestedRendererType = _useRendererContext.nestedRendererType,
|
|
336
|
+
_useRendererContext$i = _useRendererContext.isPerformanceModeActive,
|
|
337
|
+
isPerformanceModeActive = _useRendererContext$i === void 0 ? false : _useRendererContext$i;
|
|
335
338
|
var columnWidths = props.columnWidths,
|
|
336
339
|
isNumberColumnEnabled = props.isNumberColumnEnabled;
|
|
337
340
|
var _useContext = useContext(WidthContext),
|
|
@@ -348,20 +351,37 @@ export var Colgroup = function Colgroup(props) {
|
|
|
348
351
|
|
|
349
352
|
// renderSyncBlockColgroup returns null when not applicable (flag off, SSR, not a sync block),
|
|
350
353
|
// in which case ?? falls back to the standard renderScaleDownColgroup path.
|
|
351
|
-
var colStyles
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
354
|
+
var colStyles;
|
|
355
|
+
if (isPerformanceModeActive) {
|
|
356
|
+
var _props$tableWidth;
|
|
357
|
+
// Keep authored widths without viewport-driven scaling, including sync blocks.
|
|
358
|
+
colStyles = normalizeTableColumnWidths({
|
|
359
|
+
columnWidths: columnWidths,
|
|
360
|
+
isNumberColumnEnabled: !!isNumberColumnEnabled,
|
|
361
|
+
skipMinWidth: !!(props.isInsideOfTable && isInsideOfSyncBlock),
|
|
362
|
+
tableWidth: (_props$tableWidth = props.tableWidth) !== null && _props$tableWidth !== void 0 ? _props$tableWidth : getTableContainerWidth(props.tableNode)
|
|
363
|
+
}).map(function (width) {
|
|
364
|
+
return {
|
|
365
|
+
width: "".concat(width, "px")
|
|
366
|
+
};
|
|
367
|
+
});
|
|
368
|
+
} else {
|
|
369
|
+
var _renderSyncBlockColgr;
|
|
370
|
+
colStyles = (_renderSyncBlockColgr = renderSyncBlockColgroup({
|
|
371
|
+
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
372
|
+
isInsideOfTable: !!props.isInsideOfTable,
|
|
373
|
+
tableNode: props.tableNode,
|
|
374
|
+
columnWidths: columnWidths,
|
|
375
|
+
isNumberColumnEnabled: !!isNumberColumnEnabled,
|
|
376
|
+
renderWidth: props.renderWidth,
|
|
377
|
+
contextWidth: contextWidth
|
|
378
|
+
})) !== null && _renderSyncBlockColgr !== void 0 ? _renderSyncBlockColgr : renderScaleDownColgroup(_objectSpread(_objectSpread({}, props), {}, {
|
|
379
|
+
isTopLevelRenderer: isTopLevelRenderer,
|
|
380
|
+
isInsideOfSyncBlock: isInsideOfSyncBlock,
|
|
381
|
+
isTableScalingEnabled: props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max' || props.rendererAppearance === 'comment',
|
|
382
|
+
isTableFixedColumnWidthsOptionEnabled: isTableFixedColumnWidthsOptionEnabled && (props.rendererAppearance === 'full-page' || props.rendererAppearance === 'full-width' || props.rendererAppearance === 'max')
|
|
383
|
+
}));
|
|
384
|
+
}
|
|
365
385
|
if (!colStyles) {
|
|
366
386
|
return null;
|
|
367
387
|
}
|
|
@@ -2,8 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
4
4
|
import { isTableInContentMode } from '@atlaskit/editor-common/table/content-mode';
|
|
5
|
-
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
5
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorMaxWidthLayoutWidth } from '@atlaskit/editor-shared-styles/constants';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
|
+
import { useRendererContext } from '../../../renderer-context';
|
|
7
8
|
import { Colgroup, colWidthSum } from './colgroup';
|
|
8
9
|
import { isContentModeSupported } from './content-mode';
|
|
9
10
|
export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
@@ -26,7 +27,17 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
26
27
|
fixTableSSRResizing = _ref$fixTableSSRResiz === void 0 ? false : _ref$fixTableSSRResiz,
|
|
27
28
|
_ref$allowFixedColumn = _ref.allowFixedColumnWidthOption,
|
|
28
29
|
allowFixedColumnWidthOption = _ref$allowFixedColumn === void 0 ? false : _ref$allowFixedColumn;
|
|
30
|
+
var _useRendererContext = useRendererContext(),
|
|
31
|
+
_useRendererContext$i = _useRendererContext.isPerformanceModeActive,
|
|
32
|
+
isPerformanceModeActive = _useRendererContext$i === void 0 ? false : _useRendererContext$i;
|
|
29
33
|
var tableWidth = tableNode ? getTableContainerWidth(tableNode) : akEditorDefaultLayoutWidth;
|
|
34
|
+
if (isPerformanceModeActive && !(tableNode !== null && tableNode !== void 0 && tableNode.attrs.width)) {
|
|
35
|
+
if (rendererAppearance === 'full-width') {
|
|
36
|
+
tableWidth = akEditorFullWidthLayoutWidth;
|
|
37
|
+
} else if (rendererAppearance === 'max') {
|
|
38
|
+
tableWidth = akEditorMaxWidthLayoutWidth;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
30
41
|
var tableColumnWidths = columnWidths;
|
|
31
42
|
if (rendererAppearance === 'comment' && allowTableResizing && tableNode && !((_tableNode$attrs = tableNode.attrs) !== null && _tableNode$attrs !== void 0 && _tableNode$attrs.width)) {
|
|
32
43
|
tableWidth = 'inherit';
|
|
@@ -57,9 +68,13 @@ export var Table = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
57
68
|
"data-initial-width-mode": isContentMode ? 'content' : undefined,
|
|
58
69
|
ref: innerRef,
|
|
59
70
|
style: {
|
|
60
|
-
marginTop: fixTableSSRResizing ? '0px' : ''
|
|
71
|
+
marginTop: fixTableSSRResizing ? '0px' : '',
|
|
72
|
+
// Keep the table's saved width while its outer viewport can still shrink and scroll.
|
|
73
|
+
minWidth: isPerformanceModeActive && !isContentMode && typeof tableWidth === 'number' ? tableWidth : undefined,
|
|
74
|
+
width: isPerformanceModeActive && !isContentMode && typeof tableWidth === 'number' ? tableWidth : undefined
|
|
61
75
|
}
|
|
62
76
|
}), /*#__PURE__*/React.createElement(Colgroup, {
|
|
77
|
+
tableWidth: isPerformanceModeActive && typeof tableWidth === 'number' ? tableWidth : undefined,
|
|
63
78
|
columnWidths: tableColumnWidths,
|
|
64
79
|
layout: layout,
|
|
65
80
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -16,6 +16,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
16
16
|
/* eslint-disable @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/ui-styling-standard/enforce-style-prop, @repo/internal/react/no-class-components */
|
|
17
17
|
|
|
18
18
|
import React from 'react';
|
|
19
|
+
import { IntlContext } from 'react-intl';
|
|
20
|
+
import { messages } from '@atlaskit/editor-common/messages/table';
|
|
19
21
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
20
22
|
import overflowShadow from '@atlaskit/editor-common/OverflowShadow';
|
|
21
23
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -222,6 +224,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
222
224
|
_defineProperty(_this, "lastComputedStyle", {});
|
|
223
225
|
_defineProperty(_this, "resizeObserver", null);
|
|
224
226
|
_defineProperty(_this, "applyResizerChange", function (entries) {
|
|
227
|
+
if (_this.props.isPerformanceModeActive) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
225
230
|
var wrapperWidth = _this.state.wrapperWidth;
|
|
226
231
|
var headerRowHeight = _this.state.headerRowHeight;
|
|
227
232
|
var _iterator = _createForOfIteratorHelper(entries),
|
|
@@ -288,6 +293,9 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
288
293
|
return (_this.overflowParent ? _this.overflowParent.top : 0) + offsetTop;
|
|
289
294
|
});
|
|
290
295
|
_defineProperty(_this, "updateSticky", function () {
|
|
296
|
+
if (_this.props.isPerformanceModeActive) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
291
299
|
var tableElem = _this.tableRef.current;
|
|
292
300
|
var refElem = _this.stickyHeaderRef.current;
|
|
293
301
|
if (!tableElem || !refElem) {
|
|
@@ -317,6 +325,12 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
317
325
|
}
|
|
318
326
|
});
|
|
319
327
|
_defineProperty(_this, "onWrapperScrolled", function () {
|
|
328
|
+
if (_this.props.isPerformanceModeActive) {
|
|
329
|
+
if (_this.wrapperRef.current && _this.stickyScrollbarRef.current) {
|
|
330
|
+
_this.stickyScrollbarRef.current.scrollLeft = _this.wrapperRef.current.scrollLeft;
|
|
331
|
+
}
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
320
334
|
if (!_this.wrapperRef.current || !_this.stickyWrapperRef.current) {
|
|
321
335
|
return;
|
|
322
336
|
}
|
|
@@ -454,17 +468,12 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
454
468
|
* @example
|
|
455
469
|
*/
|
|
456
470
|
function componentDidMount() {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
this.resizeObserver.observe(this.wrapperRef.current);
|
|
460
|
-
}
|
|
461
|
-
if (this.stickyHeaderRef.current) {
|
|
462
|
-
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
471
|
+
if (!this.props.isPerformanceModeActive) {
|
|
472
|
+
this.observeDimensions();
|
|
463
473
|
}
|
|
464
474
|
if (this.props.stickyHeaders) {
|
|
465
475
|
var _this$props$stickyHea;
|
|
466
476
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current, (_this$props$stickyHea = this.props.stickyHeaders) === null || _this$props$stickyHea === void 0 ? void 0 : _this$props$stickyHea.defaultScrollRootId_DO_NOT_USE);
|
|
467
|
-
// Ignored via go/ees005
|
|
468
477
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
469
478
|
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
470
479
|
}
|
|
@@ -473,7 +482,20 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
473
482
|
}
|
|
474
483
|
this.applyNestedRendererTableFix();
|
|
475
484
|
}
|
|
476
|
-
|
|
485
|
+
}, {
|
|
486
|
+
key: "observeDimensions",
|
|
487
|
+
value: function observeDimensions() {
|
|
488
|
+
this.resizeObserver = new ResizeObserver(this.applyResizerChange);
|
|
489
|
+
if (this.wrapperRef.current) {
|
|
490
|
+
this.resizeObserver.observe(this.wrapperRef.current);
|
|
491
|
+
}
|
|
492
|
+
if (this.stickyHeaderRef.current) {
|
|
493
|
+
this.resizeObserver.observe(this.stickyHeaderRef.current);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}, {
|
|
497
|
+
key: "componentDidUpdate",
|
|
498
|
+
value:
|
|
477
499
|
/**
|
|
478
500
|
* Updates sticky header wiring and scroll synchronization after prop or state changes.
|
|
479
501
|
*
|
|
@@ -481,13 +503,28 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
481
503
|
* @param prevState
|
|
482
504
|
* @example
|
|
483
505
|
*/
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
506
|
+
function componentDidUpdate(prevProps, prevState) {
|
|
507
|
+
if (this.props.isPerformanceModeActive !== prevProps.isPerformanceModeActive) {
|
|
508
|
+
if (this.props.isPerformanceModeActive) {
|
|
509
|
+
var _this$resizeObserver;
|
|
510
|
+
(_this$resizeObserver = this.resizeObserver) === null || _this$resizeObserver === void 0 || _this$resizeObserver.disconnect();
|
|
511
|
+
this.resizeObserver = null;
|
|
512
|
+
if (this.nextFrame) {
|
|
513
|
+
cancelAnimationFrame(this.nextFrame);
|
|
514
|
+
this.nextFrame = undefined;
|
|
515
|
+
}
|
|
516
|
+
} else if (prevProps.isPerformanceModeActive) {
|
|
517
|
+
this.observeDimensions();
|
|
518
|
+
}
|
|
519
|
+
}
|
|
487
520
|
// toggling sticky headers visiblity
|
|
488
521
|
if (this.props.stickyHeaders && !this.overflowParent) {
|
|
489
522
|
var _this$props$stickyHea2;
|
|
490
523
|
this.overflowParent = OverflowParent.fromElement(this.tableRef.current, (_this$props$stickyHea2 = this.props.stickyHeaders) === null || _this$props$stickyHea2 === void 0 ? void 0 : _this$props$stickyHea2.defaultScrollRootId_DO_NOT_USE);
|
|
524
|
+
if (prevProps.isPerformanceModeActive) {
|
|
525
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
526
|
+
this.overflowParent.addEventListener('scroll', this.onScroll);
|
|
527
|
+
}
|
|
491
528
|
} else if (!this.props.stickyHeaders && this.overflowParent) {
|
|
492
529
|
// Ignored via go/ees005
|
|
493
530
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -720,7 +757,10 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
720
757
|
"data-table-local-id": tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.localId,
|
|
721
758
|
"data-table-width": tableNode === null || tableNode === void 0 ? void 0 : tableNode.attrs.width,
|
|
722
759
|
"data-vc": "table-node-wrapper",
|
|
723
|
-
|
|
760
|
+
tabIndex: this.props.isPerformanceModeActive ? 0 : undefined,
|
|
761
|
+
role: this.props.isPerformanceModeActive ? 'region' : undefined,
|
|
762
|
+
"aria-label": this.props.isPerformanceModeActive ? this.props.scrollRegionLabel : undefined,
|
|
763
|
+
onScroll: (this.props.isPerformanceModeActive || this.props.stickyHeaders) && this.onWrapperScrolled
|
|
724
764
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
725
765
|
innerRef: this.tableRef,
|
|
726
766
|
columnWidths: columnWidths,
|
|
@@ -756,6 +796,16 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
756
796
|
isNumberColumnEnabled: isNumberColumnEnabled
|
|
757
797
|
})));
|
|
758
798
|
}
|
|
799
|
+
}], [{
|
|
800
|
+
key: "getDerivedStateFromProps",
|
|
801
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
802
|
+
if (props.isPerformanceModeActive && state.stickyMode !== 'none') {
|
|
803
|
+
return {
|
|
804
|
+
stickyMode: 'none'
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
return null;
|
|
808
|
+
}
|
|
759
809
|
}]);
|
|
760
810
|
}(React.Component);
|
|
761
811
|
var getCellEdgePropsByCellOffset = function getCellEdgePropsByCellOffset(tableNode, isNumberColumnEnabled) {
|
|
@@ -948,6 +998,8 @@ export var TableProcessorWithContainerStyles = /*#__PURE__*/function (_React$Com
|
|
|
948
998
|
isNumberColumnEnabled = _this$props2.isNumberColumnEnabled,
|
|
949
999
|
isPresentational = _this$props2.isPresentational,
|
|
950
1000
|
layout = _this$props2.layout,
|
|
1001
|
+
isPerformanceModeActive = _this$props2.isPerformanceModeActive,
|
|
1002
|
+
scrollRegionLabel = _this$props2.scrollRegionLabel,
|
|
951
1003
|
rendererAppearance = _this$props2.rendererAppearance,
|
|
952
1004
|
renderWidth = _this$props2.renderWidth,
|
|
953
1005
|
shadowClassNames = _this$props2.shadowClassNames,
|
|
@@ -977,6 +1029,8 @@ export var TableProcessorWithContainerStyles = /*#__PURE__*/function (_React$Com
|
|
|
977
1029
|
isInsideOfTable: isInsideOfTable,
|
|
978
1030
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
979
1031
|
isPresentational: isPresentational,
|
|
1032
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1033
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
980
1034
|
layout: layout,
|
|
981
1035
|
rendererAppearance: rendererAppearance,
|
|
982
1036
|
renderWidth: renderWidth,
|
|
@@ -1001,10 +1055,14 @@ var TableWithShadowsAndContainerStyles = overflowShadow(TableProcessorWithContai
|
|
|
1001
1055
|
useShadowObserver: true
|
|
1002
1056
|
});
|
|
1003
1057
|
var TableWithWidth = function TableWithWidth(props) {
|
|
1004
|
-
var _props$columnWidths;
|
|
1058
|
+
var _intl$formatMessage, _props$columnWidths;
|
|
1005
1059
|
var _useRendererContext2 = useRendererContext(),
|
|
1006
|
-
isTopLevelRenderer = _useRendererContext2.isTopLevelRenderer
|
|
1060
|
+
isTopLevelRenderer = _useRendererContext2.isTopLevelRenderer,
|
|
1061
|
+
_useRendererContext2$ = _useRendererContext2.isPerformanceModeActive,
|
|
1062
|
+
isPerformanceModeActive = _useRendererContext2$ === void 0 ? false : _useRendererContext2$;
|
|
1063
|
+
var intl = React.useContext(IntlContext);
|
|
1007
1064
|
var isInsideOfNestedRenderer = isTopLevelRenderer === false;
|
|
1065
|
+
var scrollRegionLabel = isPerformanceModeActive ? (_intl$formatMessage = intl === null || intl === void 0 ? void 0 : intl.formatMessage(messages.tableScrollRegion)) !== null && _intl$formatMessage !== void 0 ? _intl$formatMessage : messages.tableScrollRegion.defaultMessage : undefined;
|
|
1008
1066
|
var colWidthsSum =
|
|
1009
1067
|
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
1010
1068
|
((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
@@ -1015,6 +1073,10 @@ var TableWithWidth = function TableWithWidth(props) {
|
|
|
1015
1073
|
// Ignored via go/ees005
|
|
1016
1074
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
1017
1075
|
, _extends({}, props, {
|
|
1076
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1077
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
1078
|
+
stickyHeaders: isPerformanceModeActive ? undefined : props.stickyHeaders,
|
|
1079
|
+
disableShadowTracking: isPerformanceModeActive,
|
|
1018
1080
|
isInsideOfNestedRenderer: isInsideOfNestedRenderer
|
|
1019
1081
|
}));
|
|
1020
1082
|
}
|
|
@@ -1022,6 +1084,9 @@ var TableWithWidth = function TableWithWidth(props) {
|
|
|
1022
1084
|
// Ignored via go/ees005
|
|
1023
1085
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
1024
1086
|
, _extends({}, props, {
|
|
1087
|
+
isPerformanceModeActive: isPerformanceModeActive,
|
|
1088
|
+
scrollRegionLabel: scrollRegionLabel,
|
|
1089
|
+
stickyHeaders: isPerformanceModeActive ? undefined : props.stickyHeaders,
|
|
1025
1090
|
isInsideOfNestedRenderer: isInsideOfNestedRenderer
|
|
1026
1091
|
}));
|
|
1027
1092
|
};
|
|
@@ -69,7 +69,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
|
69
69
|
var TABLE_INFO_TIMEOUT = 10000;
|
|
70
70
|
var RENDER_EVENT_SAMPLE_RATE = 0.1;
|
|
71
71
|
var packageName = "@atlaskit/renderer";
|
|
72
|
-
var packageVersion = "153.
|
|
72
|
+
var packageVersion = "153.5.0";
|
|
73
73
|
var setAsQueryContainerStyles = css({
|
|
74
74
|
containerName: 'ak-renderer-wrapper',
|
|
75
75
|
containerType: 'inline-size'
|
|
@@ -10,8 +10,11 @@ export type SharedTableProps = {
|
|
|
10
10
|
isInsideOfNestedRenderer?: boolean;
|
|
11
11
|
isInsideOfTable?: boolean;
|
|
12
12
|
isNumberColumnEnabled: boolean;
|
|
13
|
+
isPerformanceModeActive?: boolean;
|
|
13
14
|
layout: TableLayout;
|
|
14
15
|
rendererAppearance: RendererAppearance;
|
|
15
16
|
renderWidth: number;
|
|
17
|
+
scrollRegionLabel?: string;
|
|
16
18
|
tableNode?: PMNode;
|
|
19
|
+
tableWidth?: number;
|
|
17
20
|
};
|
|
@@ -93,6 +93,8 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
|
|
|
93
93
|
* @example
|
|
94
94
|
*/
|
|
95
95
|
componentDidMount(): void;
|
|
96
|
+
private observeDimensions;
|
|
97
|
+
static getDerivedStateFromProps(props: TableProps, state: TableState): Partial<TableState> | null;
|
|
96
98
|
/**
|
|
97
99
|
* Updates sticky header wiring and scroll synchronization after prop or state changes.
|
|
98
100
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "153.5.
|
|
3
|
+
"version": "153.5.1",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/smart-card": "^46.14.0",
|
|
72
72
|
"@atlaskit/status": "^5.17.0",
|
|
73
73
|
"@atlaskit/task-decision": "^21.16.0",
|
|
74
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
74
|
+
"@atlaskit/tmp-editor-statsig": "^263.0.0",
|
|
75
75
|
"@atlaskit/tokens": "^20.12.0",
|
|
76
76
|
"@atlaskit/tooltip": "^24.4.0",
|
|
77
77
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"uuid": "^11.1.1"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@atlaskit/editor-common": "^134.
|
|
89
|
+
"@atlaskit/editor-common": "^134.20.0",
|
|
90
90
|
"@atlaskit/link-provider": "^6.1.0",
|
|
91
91
|
"@atlaskit/media-core": "^39.0.0",
|
|
92
92
|
"react": "^18.2.0 || ^19.2.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@af/visual-regression": "workspace:^",
|
|
99
99
|
"@atlaskit/analytics-gas-types": "^6.2.0",
|
|
100
100
|
"@atlaskit/checkbox": "^19.3.0",
|
|
101
|
-
"@atlaskit/editor-common": "^134.
|
|
101
|
+
"@atlaskit/editor-common": "^134.20.0",
|
|
102
102
|
"@atlaskit/editor-plugin-media": "^32.4.0",
|
|
103
103
|
"@atlaskit/editor-test-helpers": "workspace:^",
|
|
104
104
|
"@atlaskit/inline-edit": "^16.5.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
111
111
|
"@atlaskit/media-state": "^4.0.0",
|
|
112
112
|
"@atlaskit/media-test-helpers": "^43.0.0",
|
|
113
|
-
"@atlaskit/mention": "^30.
|
|
113
|
+
"@atlaskit/mention": "^30.10.0",
|
|
114
114
|
"@atlaskit/modal-dialog": "^17.2.0",
|
|
115
115
|
"@atlaskit/navigation-system": "^11.7.0",
|
|
116
116
|
"@atlaskit/primitives": "^22.7.0",
|