@atlaskit/editor-plugin-table 12.1.15 → 12.2.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 +12 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-dev-agents/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-passionfruit/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/afm-rovo-extension/tsconfig.json +3 -0
- package/afm-townsquare/tsconfig.json +3 -0
- package/dist/cjs/nodeviews/TableComponent.js +73 -22
- package/dist/cjs/nodeviews/TableContainer.js +270 -10
- package/dist/cjs/nodeviews/TableResizer.js +9 -2
- package/dist/cjs/nodeviews/table.js +12 -2
- package/dist/cjs/nodeviews/toDOM.js +23 -7
- package/dist/cjs/pm-plugins/main.js +57 -23
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +72 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/cjs/tablePlugin.js +17 -3
- package/dist/es2019/nodeviews/TableComponent.js +76 -22
- package/dist/es2019/nodeviews/TableContainer.js +256 -2
- package/dist/es2019/nodeviews/TableResizer.js +9 -2
- package/dist/es2019/nodeviews/table.js +12 -2
- package/dist/es2019/nodeviews/toDOM.js +24 -8
- package/dist/es2019/pm-plugins/main.js +57 -23
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +72 -3
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/es2019/tablePlugin.js +17 -3
- package/dist/esm/nodeviews/TableComponent.js +73 -22
- package/dist/esm/nodeviews/TableContainer.js +270 -10
- package/dist/esm/nodeviews/TableResizer.js +9 -2
- package/dist/esm/nodeviews/table.js +12 -2
- package/dist/esm/nodeviews/toDOM.js +24 -8
- package/dist/esm/pm-plugins/main.js +57 -23
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +74 -3
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +70 -1
- package/dist/esm/tablePlugin.js +17 -3
- package/dist/types/nodeviews/TableContainer.d.ts +7 -2
- package/dist/types/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/nodeviews/toDOM.d.ts +5 -0
- package/dist/types/nodeviews/types.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +7 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/nodeviews/toDOM.d.ts +5 -0
- package/dist/types-ts4.5/nodeviews/types.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +41 -0
- package/package.json +8 -7
- package/src/nodeviews/TableComponent.tsx +105 -19
- package/src/nodeviews/TableContainer.tsx +331 -2
- package/src/nodeviews/TableResizer.tsx +10 -5
- package/src/nodeviews/table.tsx +14 -0
- package/src/nodeviews/toDOM.ts +75 -9
- package/src/nodeviews/types.ts +1 -0
- package/src/pm-plugins/main.ts +41 -18
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +139 -6
- package/src/pm-plugins/table-resizing/utils/misc.ts +87 -0
- package/src/tablePlugin.tsx +21 -0
- package/tsconfig.app.json +3 -0
- package/types/package.json +1 -1
- package/ui/common-styles/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 12.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`021fd485e1f83`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/021fd485e1f83) -
|
|
8
|
+
fix table flicking issue on page load by improving table scailing and table resizer with css
|
|
9
|
+
instead of js
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 12.1.15
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -80,6 +80,9 @@
|
|
|
80
80
|
{
|
|
81
81
|
"path": "../../../platform/feature-flags/afm-dev-agents/tsconfig.json"
|
|
82
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"path": "../../../platform/feature-flags-react/afm-dev-agents/tsconfig.json"
|
|
85
|
+
},
|
|
83
86
|
{
|
|
84
87
|
"path": "../../../pragmatic-drag-and-drop/core/afm-dev-agents/tsconfig.json"
|
|
85
88
|
},
|
package/afm-jira/tsconfig.json
CHANGED
|
@@ -80,6 +80,9 @@
|
|
|
80
80
|
{
|
|
81
81
|
"path": "../../../platform/feature-flags/afm-passionfruit/tsconfig.json"
|
|
82
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"path": "../../../platform/feature-flags-react/afm-passionfruit/tsconfig.json"
|
|
85
|
+
},
|
|
83
86
|
{
|
|
84
87
|
"path": "../../../pragmatic-drag-and-drop/core/afm-passionfruit/tsconfig.json"
|
|
85
88
|
},
|
|
@@ -80,6 +80,9 @@
|
|
|
80
80
|
{
|
|
81
81
|
"path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
|
|
82
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"path": "../../../platform/feature-flags-react/afm-post-office/tsconfig.json"
|
|
85
|
+
},
|
|
83
86
|
{
|
|
84
87
|
"path": "../../../pragmatic-drag-and-drop/core/afm-post-office/tsconfig.json"
|
|
85
88
|
},
|
|
@@ -80,6 +80,9 @@
|
|
|
80
80
|
{
|
|
81
81
|
"path": "../../../platform/feature-flags/afm-rovo-extension/tsconfig.json"
|
|
82
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"path": "../../../platform/feature-flags-react/afm-rovo-extension/tsconfig.json"
|
|
85
|
+
},
|
|
83
86
|
{
|
|
84
87
|
"path": "../../../pragmatic-drag-and-drop/core/afm-rovo-extension/tsconfig.json"
|
|
85
88
|
},
|
|
@@ -80,6 +80,9 @@
|
|
|
80
80
|
{
|
|
81
81
|
"path": "../../../platform/feature-flags/afm-townsquare/tsconfig.json"
|
|
82
82
|
},
|
|
83
|
+
{
|
|
84
|
+
"path": "../../../platform/feature-flags-react/afm-townsquare/tsconfig.json"
|
|
85
|
+
},
|
|
83
86
|
{
|
|
84
87
|
"path": "../../../pragmatic-drag-and-drop/core/afm-townsquare/tsconfig.json"
|
|
85
88
|
},
|
|
@@ -94,10 +94,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
94
94
|
var _this;
|
|
95
95
|
(0, _classCallCheck2.default)(this, TableComponent);
|
|
96
96
|
_this = _callSuper(this, TableComponent, [props]);
|
|
97
|
-
(0, _defineProperty3.default)(_this, "state", (0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)({
|
|
97
|
+
(0, _defineProperty3.default)(_this, "state", (0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)((0, _defineProperty3.default)({
|
|
98
98
|
scroll: 0,
|
|
99
99
|
parentWidth: undefined
|
|
100
|
-
}, _types.ShadowEvent.SHOW_BEFORE_SHADOW, false), _types.ShadowEvent.SHOW_AFTER_SHADOW, false), "tableWrapperWidth", undefined), "tableWrapperHeight", undefined));
|
|
100
|
+
}, _types.ShadowEvent.SHOW_BEFORE_SHADOW, false), _types.ShadowEvent.SHOW_AFTER_SHADOW, false), "tableWrapperWidth", undefined), "tableWrapperHeight", undefined), "windowResized", false));
|
|
101
101
|
(0, _defineProperty3.default)(_this, "holdCompleted", false);
|
|
102
102
|
(0, _defineProperty3.default)(_this, "dispatchEventName", "tableResized-".concat(generateUniqueTableId()));
|
|
103
103
|
(0, _defineProperty3.default)(_this, "handleMouseOut", function (event) {
|
|
@@ -334,6 +334,16 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
334
334
|
parentWidth: parentWidth
|
|
335
335
|
});
|
|
336
336
|
});
|
|
337
|
+
// This is a new handler for window resize events that sets the windowResized state immediately
|
|
338
|
+
// This is needed to update colgroup on window resize, to enforce the table scaling
|
|
339
|
+
(0, _defineProperty3.default)(_this, "handleWindowResizeNew", function () {
|
|
340
|
+
// Set resizing to true immediately
|
|
341
|
+
if (!_this.state.windowResized) {
|
|
342
|
+
_this.setState({
|
|
343
|
+
windowResized: true
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
});
|
|
337
347
|
(0, _defineProperty3.default)(_this, "getParentNodeWidth", function () {
|
|
338
348
|
var _this$props6 = _this.props,
|
|
339
349
|
getPos = _this$props6.getPos,
|
|
@@ -355,11 +365,29 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
355
365
|
(0, _defineProperty3.default)(_this, "tableNodeLayoutSize", function (node, containerWidth, options) {
|
|
356
366
|
return (0, _misc.getLayoutSize)(node.attrs.layout, containerWidth || _this.props.containerWidth.width, options || _this.props.options || {});
|
|
357
367
|
});
|
|
368
|
+
(0, _defineProperty3.default)(_this, "shouldUpdateColgroup", function (params) {
|
|
369
|
+
var _this$props$options, _this$props$options2;
|
|
370
|
+
var isWindowResized = params.isWindowResized,
|
|
371
|
+
isWidthChanged = params.isWidthChanged,
|
|
372
|
+
isTableWidthChanged = params.isTableWidthChanged,
|
|
373
|
+
isColumnsDistributed = params.isColumnsDistributed,
|
|
374
|
+
isTableResizedFullWidth = params.isTableResizedFullWidth,
|
|
375
|
+
isTableDisplayModeChanged = params.isTableDisplayModeChanged,
|
|
376
|
+
isNumberColumnChanged = params.isNumberColumnChanged,
|
|
377
|
+
isNumberOfColumnsChanged = params.isNumberOfColumnsChanged,
|
|
378
|
+
isFullWidthModeAndLineLengthChanged = params.isFullWidthModeAndLineLengthChanged;
|
|
379
|
+
var isFullPageEditor = !((_this$props$options = _this.props.options) !== null && _this$props$options !== void 0 && _this$props$options.isCommentEditor) && !((_this$props$options2 = _this.props.options) !== null && _this$props$options2 !== void 0 && _this$props$options2.isChromelessEditor);
|
|
380
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) && isFullPageEditor) {
|
|
381
|
+
return !!isWindowResized || isColumnsDistributed || !!isTableResizedFullWidth || isTableDisplayModeChanged || isNumberColumnChanged || isNumberOfColumnsChanged || !!isFullWidthModeAndLineLengthChanged;
|
|
382
|
+
}
|
|
383
|
+
return isWidthChanged || isTableWidthChanged || isColumnsDistributed || !!isTableResizedFullWidth || isTableDisplayModeChanged || isNumberColumnChanged || isNumberOfColumnsChanged || !!isFullWidthModeAndLineLengthChanged;
|
|
384
|
+
});
|
|
358
385
|
(0, _defineProperty3.default)(_this, "scaleTableDebounced", (0, _rafSchd.default)(_this.scaleTable));
|
|
359
386
|
(0, _defineProperty3.default)(_this, "handleTableResizingDebounced", (0, _rafSchd.default)(_this.handleTableResizing));
|
|
360
387
|
(0, _defineProperty3.default)(_this, "handleScrollDebounced", (0, _rafSchd.default)(_this.handleScroll));
|
|
361
388
|
(0, _defineProperty3.default)(_this, "handleAutoSizeDebounced", (0, _rafSchd.default)(_this.handleAutoSize));
|
|
362
389
|
(0, _defineProperty3.default)(_this, "handleWindowResizeDebounced", (0, _rafSchd.default)(_this.handleWindowResize));
|
|
390
|
+
(0, _defineProperty3.default)(_this, "handleWindowResizeNewDebounced", (0, _rafSchd.default)(_this.handleWindowResizeNew));
|
|
363
391
|
(0, _defineProperty3.default)(_this, "updateShadowStateDebounced", (0, _rafSchd.default)(_this.updateShadowState));
|
|
364
392
|
var _options = props.options,
|
|
365
393
|
_containerWidth = props.containerWidth,
|
|
@@ -465,11 +493,13 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
465
493
|
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
466
494
|
_getEditorFeatureFlag2 = _getEditorFeatureFlag.tableWithFixedColumnWidthsOption,
|
|
467
495
|
tableWithFixedColumnWidthsOption = _getEditorFeatureFlag2 === void 0 ? false : _getEditorFeatureFlag2;
|
|
468
|
-
if (
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
496
|
+
if (!(0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true)) {
|
|
497
|
+
if (isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
498
|
+
this.handleColgroupUpdates(true);
|
|
499
|
+
}
|
|
500
|
+
if (isTableScalingEnabled && tableWithFixedColumnWidthsOption && getNode().attrs.displayMode !== 'fixed') {
|
|
501
|
+
this.handleColgroupUpdates(true);
|
|
502
|
+
}
|
|
473
503
|
}
|
|
474
504
|
if (this.wrapper) {
|
|
475
505
|
this.wrapperReisizeObserver = new ResizeObserver(function (entries) {
|
|
@@ -521,6 +551,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
521
551
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
522
552
|
window.addEventListener('resize', this.handleWindowResizeDebounced);
|
|
523
553
|
}
|
|
554
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
555
|
+
window.addEventListener('resize', this.handleWindowResizeNewDebounced);
|
|
524
556
|
this.handleTableResizingDebounced();
|
|
525
557
|
}
|
|
526
558
|
var currentStickyState = _pluginKey.pluginKey.getState(this.props.view.state);
|
|
@@ -568,11 +600,16 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
568
600
|
if (!allowTableResizing) {
|
|
569
601
|
this.handleWindowResizeDebounced.cancel();
|
|
570
602
|
}
|
|
603
|
+
this.handleWindowResizeNewDebounced.cancel();
|
|
571
604
|
if (!allowTableResizing && allowColumnResizing) {
|
|
572
605
|
// Ignored via go/ees005
|
|
573
606
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
574
607
|
window.removeEventListener('resize', this.handleWindowResizeDebounced);
|
|
575
608
|
}
|
|
609
|
+
if (allowColumnResizing) {
|
|
610
|
+
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
611
|
+
window.removeEventListener('resize', this.handleWindowResizeNewDebounced);
|
|
612
|
+
}
|
|
576
613
|
|
|
577
614
|
// Ignored via go/ees005
|
|
578
615
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -662,22 +699,32 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
662
699
|
containerLineLength = containerWidth.lineLength;
|
|
663
700
|
var isLineLengthChanged = ((_this$containerWidth = this.containerWidth) === null || _this$containerWidth === void 0 ? void 0 : _this$containerWidth.lineLength) !== containerLineLength;
|
|
664
701
|
var isFullWidthModeAndLineLengthChanged = this.updateColGroupFromFullWidthChange && isLineLengthChanged && (0, _platformFeatureFlags.fg)('platform_editor_table_overflow_in_full_width_fix');
|
|
665
|
-
var maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth && !(options !== null && options !== void 0 && options.isCommentEditor) || isNumberColumnChanged || isNumberOfColumnsChanged;
|
|
702
|
+
var maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth && !(options !== null && options !== void 0 && options.isCommentEditor) || isNumberColumnChanged || isNumberOfColumnsChanged || (0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) && this.state.windowResized;
|
|
666
703
|
if (force || maybeScale || isFullWidthModeAndLineLengthChanged) {
|
|
667
|
-
var _this$containerWidth2, _this$props$
|
|
704
|
+
var _this$containerWidth2, _this$props$options3, _this$props$options4, _this$props$options5;
|
|
668
705
|
var isWidthChanged = ((_this$containerWidth2 = this.containerWidth) === null || _this$containerWidth2 === void 0 ? void 0 : _this$containerWidth2.width) !== containerWidthValue;
|
|
669
706
|
var wasTableResized = (0, _colgroup.hasTableBeenResized)(this.node);
|
|
670
707
|
var isTableResized = (0, _colgroup.hasTableBeenResized)(tableNode);
|
|
671
708
|
var isColumnsDistributed = wasTableResized && !isTableResized;
|
|
672
709
|
var isTableDisplayModeChanged = this.node.attrs.displayMode !== tableNode.attrs.displayMode;
|
|
673
|
-
var shouldUpdateColgroup =
|
|
710
|
+
var shouldUpdateColgroup = this.shouldUpdateColgroup({
|
|
711
|
+
isWindowResized: this.state.windowResized,
|
|
712
|
+
isWidthChanged: isWidthChanged,
|
|
713
|
+
isTableWidthChanged: isTableWidthChanged,
|
|
714
|
+
isColumnsDistributed: isColumnsDistributed,
|
|
715
|
+
isTableResizedFullWidth: isTableResizedFullWidth,
|
|
716
|
+
isTableDisplayModeChanged: isTableDisplayModeChanged,
|
|
717
|
+
isNumberColumnChanged: isNumberColumnChanged,
|
|
718
|
+
isNumberOfColumnsChanged: isNumberOfColumnsChanged,
|
|
719
|
+
isFullWidthModeAndLineLengthChanged: isFullWidthModeAndLineLengthChanged
|
|
720
|
+
});
|
|
674
721
|
var _getEditorFeatureFlag3 = getEditorFeatureFlags(),
|
|
675
722
|
_getEditorFeatureFlag4 = _getEditorFeatureFlag3.tableWithFixedColumnWidthsOption,
|
|
676
723
|
tableWithFixedColumnWidthsOption = _getEditorFeatureFlag4 === void 0 ? false : _getEditorFeatureFlag4;
|
|
677
|
-
var isTableScalingWithFixedColumnWidthsOptionEnabled = !!((_this$props$
|
|
678
|
-
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!((_this$props$
|
|
724
|
+
var isTableScalingWithFixedColumnWidthsOptionEnabled = !!((_this$props$options3 = this.props.options) !== null && _this$props$options3 !== void 0 && _this$props$options3.isTableScalingEnabled) && tableWithFixedColumnWidthsOption;
|
|
725
|
+
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!((_this$props$options4 = this.props.options) !== null && _this$props$options4 !== void 0 && _this$props$options4.isTableScalingEnabled) && !!((_this$props$options5 = this.props.options) !== null && _this$props$options5 !== void 0 && _this$props$options5.isCommentEditor);
|
|
679
726
|
if (force || !isResizing && shouldUpdateColgroup) {
|
|
680
|
-
var _this$props$
|
|
727
|
+
var _this$props$options6, _this$props$options7, _this$props$options8, _this$props$options9;
|
|
681
728
|
var resizeState = (0, _resizeState.getResizeState)({
|
|
682
729
|
minWidth: _consts.COLUMN_MIN_WIDTH,
|
|
683
730
|
// When numbered column enabled, we need to subtract the width of the numbered column
|
|
@@ -688,16 +735,16 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
688
735
|
domAtPos: view.domAtPos.bind(view),
|
|
689
736
|
isTableScalingEnabled: true,
|
|
690
737
|
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
691
|
-
isCommentEditor: !!((_this$props$
|
|
738
|
+
isCommentEditor: !!((_this$props$options6 = this.props.options) !== null && _this$props$options6 !== void 0 && _this$props$options6.isCommentEditor)
|
|
692
739
|
});
|
|
693
740
|
var shouldScaleOnColgroupUpdate = false;
|
|
694
|
-
if ((_this$props$
|
|
741
|
+
if ((_this$props$options7 = this.props.options) !== null && _this$props$options7 !== void 0 && _this$props$options7.isTableScalingEnabled && !tableWithFixedColumnWidthsOption) {
|
|
695
742
|
shouldScaleOnColgroupUpdate = true;
|
|
696
743
|
}
|
|
697
744
|
if (isTableScalingWithFixedColumnWidthsOptionEnabled && tableNode.attrs.displayMode !== 'fixed') {
|
|
698
745
|
shouldScaleOnColgroupUpdate = true;
|
|
699
746
|
}
|
|
700
|
-
if ((_this$props$
|
|
747
|
+
if ((_this$props$options8 = this.props.options) !== null && _this$props$options8 !== void 0 && _this$props$options8.isTableScalingEnabled && (_this$props$options9 = this.props.options) !== null && _this$props$options9 !== void 0 && _this$props$options9.isCommentEditor) {
|
|
701
748
|
shouldScaleOnColgroupUpdate = true;
|
|
702
749
|
}
|
|
703
750
|
var scalePercent = 1;
|
|
@@ -746,8 +793,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
746
793
|
}, {
|
|
747
794
|
key: "componentDidUpdate",
|
|
748
795
|
value: function componentDidUpdate(_, prevState) {
|
|
749
|
-
var _this$props$
|
|
750
|
-
_this$props$
|
|
796
|
+
var _this$props$options0,
|
|
797
|
+
_this$props$options1,
|
|
751
798
|
_this$wrapper,
|
|
752
799
|
_this5 = this;
|
|
753
800
|
var _this$props1 = this.props,
|
|
@@ -777,18 +824,21 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
777
824
|
shouldHandleColgroupUpdates = true;
|
|
778
825
|
}
|
|
779
826
|
var isTableScalingWithFixedColumnWidthsOptionEnabled = !!isTableScalingEnabled && tableWithFixedColumnWidthsOption;
|
|
780
|
-
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!isTableScalingEnabled && !!((_this$props$
|
|
827
|
+
var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled || !!isTableScalingEnabled && !!((_this$props$options0 = this.props.options) !== null && _this$props$options0 !== void 0 && _this$props$options0.isCommentEditor);
|
|
781
828
|
if (isTableScalingWithFixedColumnWidthsOptionEnabled && getNode().attrs.displayMode !== 'fixed') {
|
|
782
829
|
shouldScale = true;
|
|
783
830
|
shouldHandleColgroupUpdates = true;
|
|
784
831
|
}
|
|
832
|
+
if ((0, _expValEquals.expValEquals)('platform_editor_tables_scaling_css', 'isEnabled', true) && this.state.windowResized) {
|
|
833
|
+
shouldHandleColgroupUpdates = true;
|
|
834
|
+
}
|
|
785
835
|
if (shouldHandleColgroupUpdates) {
|
|
786
836
|
this.handleColgroupUpdates();
|
|
787
837
|
}
|
|
788
838
|
if (isInDanger && !table) {
|
|
789
839
|
(0, _commands.clearHoverSelection)()(view.state, view.dispatch);
|
|
790
840
|
}
|
|
791
|
-
if ((_this$props$
|
|
841
|
+
if ((_this$props$options1 = this.props.options) !== null && _this$props$options1 !== void 0 && _this$props$options1.isCommentEditor && allowTableResizing && !(options !== null && options !== void 0 && options.isTableScalingEnabled)) {
|
|
792
842
|
this.removeInlineTableWidth();
|
|
793
843
|
}
|
|
794
844
|
if ((_this$wrapper = this.wrapper) !== null && _this$wrapper !== void 0 && _this$wrapper.parentElement && this.table && !this.overflowShadowsObserver) {
|
|
@@ -878,7 +928,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
878
928
|
key: "render",
|
|
879
929
|
value: function render() {
|
|
880
930
|
var _this6 = this,
|
|
881
|
-
_this$props$
|
|
931
|
+
_this$props$options10;
|
|
882
932
|
var _this$props10 = this.props,
|
|
883
933
|
view = _this$props10.view,
|
|
884
934
|
getNode = _this$props10.getNode,
|
|
@@ -999,7 +1049,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
999
1049
|
var _getEditorFeatureFlag7 = getEditorFeatureFlags(),
|
|
1000
1050
|
_getEditorFeatureFlag8 = _getEditorFeatureFlag7.tableWithFixedColumnWidthsOption,
|
|
1001
1051
|
tableWithFixedColumnWidthsOption = _getEditorFeatureFlag8 === void 0 ? false : _getEditorFeatureFlag8;
|
|
1002
|
-
var shouldUseIncreasedScalingPercent = !!isTableScalingEnabled && (tableWithFixedColumnWidthsOption || !!((_this$props$
|
|
1052
|
+
var shouldUseIncreasedScalingPercent = !!isTableScalingEnabled && (tableWithFixedColumnWidthsOption || !!((_this$props$options10 = this.props.options) !== null && _this$props$options10 !== void 0 && _this$props$options10.isCommentEditor));
|
|
1003
1053
|
return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer
|
|
1004
1054
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1005
1055
|
, {
|
|
@@ -1017,6 +1067,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1017
1067
|
tableWrapperHeight: this.state.tableWrapperHeight,
|
|
1018
1068
|
isTableResizingEnabled: allowTableResizing,
|
|
1019
1069
|
isResizing: isResizing,
|
|
1070
|
+
isWindowResized: this.state.windowResized,
|
|
1020
1071
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
1021
1072
|
isTableWithFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption,
|
|
1022
1073
|
isWholeTableInDanger: isWholeTableInDanger,
|