@atlaskit/renderer 108.11.4 → 108.11.5
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 +7 -0
- package/dist/cjs/react/nodes/table/colgroup.js +42 -26
- package/dist/cjs/react/nodes/table.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/table/colgroup.js +47 -29
- package/dist/es2019/react/nodes/table.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/table/colgroup.js +42 -26
- package/dist/esm/react/nodes/table.js +1 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/types/react/nodes/table/colgroup.d.ts +1 -1
- package/dist/types-ts4.5/react/nodes/table/colgroup.d.ts +1 -1
- package/package.json +6 -3
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 108.11.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`41e6188b408`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41e6188b408) - [ux] add scale down to undefined table in custom table width
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 108.11.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -43,7 +43,7 @@ var fixColumnWidth = function fixColumnWidth(columnWidth, _tableWidth, _layoutWi
|
|
|
43
43
|
return Math.max(Math.floor((1 - scaleDownPercent) * columnWidth), _styles.tableCellMinWidth);
|
|
44
44
|
}
|
|
45
45
|
return Math.max(
|
|
46
|
-
// We need to take tableCellBorderWidth, to avoid
|
|
46
|
+
// We need to take tableCellBorderWidth, to avoid unnecessary overflow.
|
|
47
47
|
columnWidth - _styles.tableCellBorderWidth, zeroWidthColumnsCount ? _editorSharedStyles.akEditorTableLegacyCellMinWidth : _styles.tableCellMinWidth);
|
|
48
48
|
};
|
|
49
49
|
var calcScalePercent = function calcScalePercent(_ref) {
|
|
@@ -54,48 +54,49 @@ var calcScalePercent = function calcScalePercent(_ref) {
|
|
|
54
54
|
return diffPercent < maxScale ? diffPercent : maxScale;
|
|
55
55
|
};
|
|
56
56
|
exports.calcScalePercent = calcScalePercent;
|
|
57
|
-
var
|
|
57
|
+
var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
58
58
|
var columnWidths = props.columnWidths,
|
|
59
59
|
layout = props.layout,
|
|
60
60
|
isNumberColumnEnabled = props.isNumberColumnEnabled,
|
|
61
61
|
renderWidth = props.renderWidth,
|
|
62
62
|
tableNode = props.tableNode,
|
|
63
63
|
rendererAppearance = props.rendererAppearance;
|
|
64
|
+
var tableContainerWidth;
|
|
64
65
|
if (!columnWidths) {
|
|
65
|
-
return
|
|
66
|
+
return [];
|
|
66
67
|
}
|
|
68
|
+
var columnAmount = columnWidths.length;
|
|
67
69
|
var tableResized = isTableResized(columnWidths);
|
|
70
|
+
var targetWidths;
|
|
68
71
|
if ((0, _table.isTableResizingEnabled)(rendererAppearance) && !tableResized) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
72
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width-scale-down-undefined-column')) {
|
|
73
|
+
// Code path executed when feature flag is on
|
|
74
|
+
var tableDefaultWidth = isNumberColumnEnabled ? _editorSharedStyles.akEditorDefaultLayoutWidth - _editorSharedStyles.akEditorTableNumberColumnWidth : _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
75
|
+
// take off 1 px for border incase column width wider than table width
|
|
76
|
+
var defaultColumnWidth = Math.floor((tableDefaultWidth - 1) / columnAmount);
|
|
77
|
+
targetWidths = new Array(columnAmount).fill(defaultColumnWidth);
|
|
78
|
+
} else {
|
|
79
|
+
return new Array(columnAmount).fill({
|
|
80
|
+
minWidth: "".concat(_styles.tableCellMinWidth, "px")
|
|
79
81
|
});
|
|
80
|
-
}
|
|
82
|
+
}
|
|
81
83
|
} else if (!tableResized) {
|
|
82
84
|
return null;
|
|
83
85
|
}
|
|
84
|
-
|
|
86
|
+
targetWidths = targetWidths || columnWidths;
|
|
85
87
|
if ((0, _table.isTableResizingEnabled)(rendererAppearance) && tableNode) {
|
|
86
88
|
tableContainerWidth = (0, _nodeWidth.getTableContainerWidth)(tableNode);
|
|
87
89
|
} else {
|
|
88
90
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
89
91
|
}
|
|
92
|
+
|
|
90
93
|
// @see ED-6056
|
|
91
94
|
var maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
|
|
92
|
-
|
|
93
|
-
renderWidth = Math.min(renderWidth, tableContainerWidth);
|
|
94
|
-
}
|
|
95
|
+
var targetWidth = !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.disable-default-width-table-scaling-renderer') && layout === 'default' ? Math.min(renderWidth, tableContainerWidth) : renderWidth;
|
|
95
96
|
var tableWidth = isNumberColumnEnabled ? _editorSharedStyles.akEditorTableNumberColumnWidth : 0;
|
|
96
97
|
var minTableWidth = tableWidth;
|
|
97
98
|
var zeroWidthColumnsCount = 0;
|
|
98
|
-
|
|
99
|
+
targetWidths.forEach(function (width) {
|
|
99
100
|
if (width) {
|
|
100
101
|
tableWidth += Math.ceil(width);
|
|
101
102
|
} else {
|
|
@@ -113,22 +114,37 @@ var Colgroup = function Colgroup(props) {
|
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
// scaling down
|
|
116
|
-
else if (
|
|
117
|
+
else if (targetWidth < tableWidth) {
|
|
117
118
|
scaleDownPercent = calcScalePercent({
|
|
118
|
-
renderWidth:
|
|
119
|
+
renderWidth: targetWidth,
|
|
119
120
|
tableWidth: tableWidth,
|
|
120
121
|
maxScale: MAX_SCALING_PERCENT
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
|
-
return
|
|
124
|
-
style: {
|
|
125
|
-
width: _editorSharedStyles.akEditorTableNumberColumnWidth
|
|
126
|
-
}
|
|
127
|
-
}), columnWidths.map(function (colWidth, idx) {
|
|
124
|
+
return targetWidths.map(function (colWidth) {
|
|
128
125
|
var width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
129
126
|
var style = width ? {
|
|
130
127
|
width: "".concat(width, "px")
|
|
131
128
|
} : {};
|
|
129
|
+
return style;
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
var Colgroup = function Colgroup(props) {
|
|
133
|
+
var columnWidths = props.columnWidths,
|
|
134
|
+
isNumberColumnEnabled = props.isNumberColumnEnabled;
|
|
135
|
+
if (!columnWidths) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
var colStyles = renderScaleDownColgroup(props);
|
|
139
|
+
if (!colStyles) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement("colgroup", null, isNumberColumnEnabled && /*#__PURE__*/_react.default.createElement("col", {
|
|
143
|
+
style: {
|
|
144
|
+
width: _editorSharedStyles.akEditorTableNumberColumnWidth
|
|
145
|
+
},
|
|
146
|
+
"data-test-id": 'num'
|
|
147
|
+
}), colStyles.map(function (style, idx) {
|
|
132
148
|
return /*#__PURE__*/_react.default.createElement("col", {
|
|
133
149
|
key: idx,
|
|
134
150
|
style: style
|
|
@@ -440,7 +440,7 @@ var TableWithWidth = function TableWithWidth(props) {
|
|
|
440
440
|
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
441
441
|
return total + val;
|
|
442
442
|
}, 0)) || 0;
|
|
443
|
-
if (colWidthsSum) {
|
|
443
|
+
if (colWidthsSum || (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width-scale-down-undefined-column') && isTableResizingEnabled(props.rendererAppearance)) {
|
|
444
444
|
return /*#__PURE__*/_react.default.createElement(TableWithShadows, (0, _extends2.default)({
|
|
445
445
|
renderWidth: renderWidth
|
|
446
446
|
}, props));
|
|
@@ -55,7 +55,7 @@ exports.NORMAL_SEVERITY_THRESHOLD = NORMAL_SEVERITY_THRESHOLD;
|
|
|
55
55
|
var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
exports.DEGRADED_SEVERITY_THRESHOLD = DEGRADED_SEVERITY_THRESHOLD;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "108.11.
|
|
58
|
+
var packageVersion = "108.11.5";
|
|
59
59
|
var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
|
@@ -35,7 +35,7 @@ const fixColumnWidth = (columnWidth, _tableWidth, _layoutWidth, zeroWidthColumns
|
|
|
35
35
|
return Math.max(Math.floor((1 - scaleDownPercent) * columnWidth), tableCellMinWidth);
|
|
36
36
|
}
|
|
37
37
|
return Math.max(
|
|
38
|
-
// We need to take tableCellBorderWidth, to avoid
|
|
38
|
+
// We need to take tableCellBorderWidth, to avoid unnecessary overflow.
|
|
39
39
|
columnWidth - tableCellBorderWidth, zeroWidthColumnsCount ? akEditorTableLegacyCellMinWidth : tableCellMinWidth);
|
|
40
40
|
};
|
|
41
41
|
export const calcScalePercent = ({
|
|
@@ -46,7 +46,7 @@ export const calcScalePercent = ({
|
|
|
46
46
|
const diffPercent = 1 - renderWidth / tableWidth;
|
|
47
47
|
return diffPercent < maxScale ? diffPercent : maxScale;
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
const renderScaleDownColgroup = props => {
|
|
50
50
|
let {
|
|
51
51
|
columnWidths,
|
|
52
52
|
layout,
|
|
@@ -55,39 +55,42 @@ export const Colgroup = props => {
|
|
|
55
55
|
tableNode,
|
|
56
56
|
rendererAppearance
|
|
57
57
|
} = props;
|
|
58
|
+
let tableContainerWidth;
|
|
58
59
|
if (!columnWidths) {
|
|
59
|
-
return
|
|
60
|
+
return [];
|
|
60
61
|
}
|
|
62
|
+
const columnAmount = columnWidths.length;
|
|
61
63
|
const tableResized = isTableResized(columnWidths);
|
|
64
|
+
let targetWidths;
|
|
62
65
|
if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
if (getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column')) {
|
|
67
|
+
// Code path executed when feature flag is on
|
|
68
|
+
const tableDefaultWidth = isNumberColumnEnabled ? akEditorDefaultLayoutWidth - akEditorTableNumberColumnWidth : akEditorDefaultLayoutWidth;
|
|
69
|
+
// take off 1 px for border incase column width wider than table width
|
|
70
|
+
const defaultColumnWidth = Math.floor((tableDefaultWidth - 1) / columnAmount);
|
|
71
|
+
targetWidths = new Array(columnAmount).fill(defaultColumnWidth);
|
|
72
|
+
} else {
|
|
73
|
+
return new Array(columnAmount).fill({
|
|
70
74
|
minWidth: `${tableCellMinWidth}px`
|
|
71
|
-
}
|
|
72
|
-
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
73
77
|
} else if (!tableResized) {
|
|
74
78
|
return null;
|
|
75
79
|
}
|
|
76
|
-
|
|
80
|
+
targetWidths = targetWidths || columnWidths;
|
|
77
81
|
if (isTableResizingEnabled(rendererAppearance) && tableNode) {
|
|
78
82
|
tableContainerWidth = getTableContainerWidth(tableNode);
|
|
79
83
|
} else {
|
|
80
84
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
81
85
|
}
|
|
86
|
+
|
|
82
87
|
// @see ED-6056
|
|
83
88
|
const maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
|
|
84
|
-
|
|
85
|
-
renderWidth = Math.min(renderWidth, tableContainerWidth);
|
|
86
|
-
}
|
|
89
|
+
const targetWidth = !getBooleanFF('platform.editor.disable-default-width-table-scaling-renderer') && layout === 'default' ? Math.min(renderWidth, tableContainerWidth) : renderWidth;
|
|
87
90
|
let tableWidth = isNumberColumnEnabled ? akEditorTableNumberColumnWidth : 0;
|
|
88
91
|
let minTableWidth = tableWidth;
|
|
89
92
|
let zeroWidthColumnsCount = 0;
|
|
90
|
-
|
|
93
|
+
targetWidths.forEach(width => {
|
|
91
94
|
if (width) {
|
|
92
95
|
tableWidth += Math.ceil(width);
|
|
93
96
|
} else {
|
|
@@ -105,25 +108,40 @@ export const Colgroup = props => {
|
|
|
105
108
|
}
|
|
106
109
|
}
|
|
107
110
|
// scaling down
|
|
108
|
-
else if (
|
|
111
|
+
else if (targetWidth < tableWidth) {
|
|
109
112
|
scaleDownPercent = calcScalePercent({
|
|
110
|
-
renderWidth,
|
|
113
|
+
renderWidth: targetWidth,
|
|
111
114
|
tableWidth,
|
|
112
115
|
maxScale: MAX_SCALING_PERCENT
|
|
113
116
|
});
|
|
114
117
|
}
|
|
115
|
-
return
|
|
116
|
-
style: {
|
|
117
|
-
width: akEditorTableNumberColumnWidth
|
|
118
|
-
}
|
|
119
|
-
}), columnWidths.map((colWidth, idx) => {
|
|
118
|
+
return targetWidths.map(colWidth => {
|
|
120
119
|
const width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
121
120
|
const style = width ? {
|
|
122
121
|
width: `${width}px`
|
|
123
122
|
} : {};
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
return style;
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
export const Colgroup = props => {
|
|
127
|
+
let {
|
|
128
|
+
columnWidths,
|
|
129
|
+
isNumberColumnEnabled
|
|
130
|
+
} = props;
|
|
131
|
+
if (!columnWidths) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
const colStyles = renderScaleDownColgroup(props);
|
|
135
|
+
if (!colStyles) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
return /*#__PURE__*/React.createElement("colgroup", null, isNumberColumnEnabled && /*#__PURE__*/React.createElement("col", {
|
|
139
|
+
style: {
|
|
140
|
+
width: akEditorTableNumberColumnWidth
|
|
141
|
+
},
|
|
142
|
+
"data-test-id": 'num'
|
|
143
|
+
}), colStyles.map((style, idx) => /*#__PURE__*/React.createElement("col", {
|
|
144
|
+
key: idx,
|
|
145
|
+
style: style
|
|
146
|
+
})));
|
|
129
147
|
};
|
|
@@ -376,7 +376,7 @@ const TableWithWidth = props => /*#__PURE__*/React.createElement(WidthConsumer,
|
|
|
376
376
|
var _props$columnWidths;
|
|
377
377
|
const renderWidth = props.rendererAppearance === 'full-page' ? width - FullPagePadding * 2 : width;
|
|
378
378
|
const colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce((total, val) => total + val, 0)) || 0;
|
|
379
|
-
if (colWidthsSum) {
|
|
379
|
+
if (colWidthsSum || getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column') && isTableResizingEnabled(props.rendererAppearance)) {
|
|
380
380
|
return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
|
|
381
381
|
renderWidth: renderWidth
|
|
382
382
|
}, props));
|
|
@@ -35,7 +35,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
35
35
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
36
36
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
37
37
|
const packageName = "@atlaskit/renderer";
|
|
38
|
-
const packageVersion = "108.11.
|
|
38
|
+
const packageVersion = "108.11.5";
|
|
39
39
|
export class Renderer extends PureComponent {
|
|
40
40
|
constructor(props) {
|
|
41
41
|
super(props);
|
|
@@ -37,7 +37,7 @@ var fixColumnWidth = function fixColumnWidth(columnWidth, _tableWidth, _layoutWi
|
|
|
37
37
|
return Math.max(Math.floor((1 - scaleDownPercent) * columnWidth), tableCellMinWidth);
|
|
38
38
|
}
|
|
39
39
|
return Math.max(
|
|
40
|
-
// We need to take tableCellBorderWidth, to avoid
|
|
40
|
+
// We need to take tableCellBorderWidth, to avoid unnecessary overflow.
|
|
41
41
|
columnWidth - tableCellBorderWidth, zeroWidthColumnsCount ? akEditorTableLegacyCellMinWidth : tableCellMinWidth);
|
|
42
42
|
};
|
|
43
43
|
export var calcScalePercent = function calcScalePercent(_ref) {
|
|
@@ -47,48 +47,49 @@ export var calcScalePercent = function calcScalePercent(_ref) {
|
|
|
47
47
|
var diffPercent = 1 - renderWidth / tableWidth;
|
|
48
48
|
return diffPercent < maxScale ? diffPercent : maxScale;
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
51
51
|
var columnWidths = props.columnWidths,
|
|
52
52
|
layout = props.layout,
|
|
53
53
|
isNumberColumnEnabled = props.isNumberColumnEnabled,
|
|
54
54
|
renderWidth = props.renderWidth,
|
|
55
55
|
tableNode = props.tableNode,
|
|
56
56
|
rendererAppearance = props.rendererAppearance;
|
|
57
|
+
var tableContainerWidth;
|
|
57
58
|
if (!columnWidths) {
|
|
58
|
-
return
|
|
59
|
+
return [];
|
|
59
60
|
}
|
|
61
|
+
var columnAmount = columnWidths.length;
|
|
60
62
|
var tableResized = isTableResized(columnWidths);
|
|
63
|
+
var targetWidths;
|
|
61
64
|
if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
65
|
+
if (getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column')) {
|
|
66
|
+
// Code path executed when feature flag is on
|
|
67
|
+
var tableDefaultWidth = isNumberColumnEnabled ? akEditorDefaultLayoutWidth - akEditorTableNumberColumnWidth : akEditorDefaultLayoutWidth;
|
|
68
|
+
// take off 1 px for border incase column width wider than table width
|
|
69
|
+
var defaultColumnWidth = Math.floor((tableDefaultWidth - 1) / columnAmount);
|
|
70
|
+
targetWidths = new Array(columnAmount).fill(defaultColumnWidth);
|
|
71
|
+
} else {
|
|
72
|
+
return new Array(columnAmount).fill({
|
|
73
|
+
minWidth: "".concat(tableCellMinWidth, "px")
|
|
72
74
|
});
|
|
73
|
-
}
|
|
75
|
+
}
|
|
74
76
|
} else if (!tableResized) {
|
|
75
77
|
return null;
|
|
76
78
|
}
|
|
77
|
-
|
|
79
|
+
targetWidths = targetWidths || columnWidths;
|
|
78
80
|
if (isTableResizingEnabled(rendererAppearance) && tableNode) {
|
|
79
81
|
tableContainerWidth = getTableContainerWidth(tableNode);
|
|
80
82
|
} else {
|
|
81
83
|
tableContainerWidth = getTableLayoutWidth(layout);
|
|
82
84
|
}
|
|
85
|
+
|
|
83
86
|
// @see ED-6056
|
|
84
87
|
var maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
|
|
85
|
-
|
|
86
|
-
renderWidth = Math.min(renderWidth, tableContainerWidth);
|
|
87
|
-
}
|
|
88
|
+
var targetWidth = !getBooleanFF('platform.editor.disable-default-width-table-scaling-renderer') && layout === 'default' ? Math.min(renderWidth, tableContainerWidth) : renderWidth;
|
|
88
89
|
var tableWidth = isNumberColumnEnabled ? akEditorTableNumberColumnWidth : 0;
|
|
89
90
|
var minTableWidth = tableWidth;
|
|
90
91
|
var zeroWidthColumnsCount = 0;
|
|
91
|
-
|
|
92
|
+
targetWidths.forEach(function (width) {
|
|
92
93
|
if (width) {
|
|
93
94
|
tableWidth += Math.ceil(width);
|
|
94
95
|
} else {
|
|
@@ -106,22 +107,37 @@ export var Colgroup = function Colgroup(props) {
|
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
// scaling down
|
|
109
|
-
else if (
|
|
110
|
+
else if (targetWidth < tableWidth) {
|
|
110
111
|
scaleDownPercent = calcScalePercent({
|
|
111
|
-
renderWidth:
|
|
112
|
+
renderWidth: targetWidth,
|
|
112
113
|
tableWidth: tableWidth,
|
|
113
114
|
maxScale: MAX_SCALING_PERCENT
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
|
-
return
|
|
117
|
-
style: {
|
|
118
|
-
width: akEditorTableNumberColumnWidth
|
|
119
|
-
}
|
|
120
|
-
}), columnWidths.map(function (colWidth, idx) {
|
|
117
|
+
return targetWidths.map(function (colWidth) {
|
|
121
118
|
var width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
122
119
|
var style = width ? {
|
|
123
120
|
width: "".concat(width, "px")
|
|
124
121
|
} : {};
|
|
122
|
+
return style;
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
export var Colgroup = function Colgroup(props) {
|
|
126
|
+
var columnWidths = props.columnWidths,
|
|
127
|
+
isNumberColumnEnabled = props.isNumberColumnEnabled;
|
|
128
|
+
if (!columnWidths) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
var colStyles = renderScaleDownColgroup(props);
|
|
132
|
+
if (!colStyles) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
return /*#__PURE__*/React.createElement("colgroup", null, isNumberColumnEnabled && /*#__PURE__*/React.createElement("col", {
|
|
136
|
+
style: {
|
|
137
|
+
width: akEditorTableNumberColumnWidth
|
|
138
|
+
},
|
|
139
|
+
"data-test-id": 'num'
|
|
140
|
+
}), colStyles.map(function (style, idx) {
|
|
125
141
|
return /*#__PURE__*/React.createElement("col", {
|
|
126
142
|
key: idx,
|
|
127
143
|
style: style
|
|
@@ -431,7 +431,7 @@ var TableWithWidth = function TableWithWidth(props) {
|
|
|
431
431
|
var colWidthsSum = ((_props$columnWidths = props.columnWidths) === null || _props$columnWidths === void 0 ? void 0 : _props$columnWidths.reduce(function (total, val) {
|
|
432
432
|
return total + val;
|
|
433
433
|
}, 0)) || 0;
|
|
434
|
-
if (colWidthsSum) {
|
|
434
|
+
if (colWidthsSum || getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column') && isTableResizingEnabled(props.rendererAppearance)) {
|
|
435
435
|
return /*#__PURE__*/React.createElement(TableWithShadows, _extends({
|
|
436
436
|
renderWidth: renderWidth
|
|
437
437
|
}, props));
|
|
@@ -45,7 +45,7 @@ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
|
|
|
45
45
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
46
46
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
47
47
|
var packageName = "@atlaskit/renderer";
|
|
48
|
-
var packageVersion = "108.11.
|
|
48
|
+
var packageVersion = "108.11.5";
|
|
49
49
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
50
50
|
_inherits(Renderer, _PureComponent);
|
|
51
51
|
var _super = _createSuper(Renderer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "108.11.
|
|
3
|
+
"version": "108.11.5",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
32
32
|
"@atlaskit/button": "^16.9.0",
|
|
33
33
|
"@atlaskit/code": "^14.6.0",
|
|
34
|
-
"@atlaskit/editor-common": "^74.
|
|
34
|
+
"@atlaskit/editor-common": "^74.47.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.1",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
@@ -118,6 +118,9 @@
|
|
|
118
118
|
},
|
|
119
119
|
"platform.editor.disable-default-width-table-scaling-renderer": {
|
|
120
120
|
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"platform.editor.custom-table-width-scale-down-undefined-column": {
|
|
123
|
+
"type": "boolean"
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
|
-
}
|
|
126
|
+
}
|
package/dist/cjs/version.json
DELETED
package/dist/es2019/version.json
DELETED