@atlaskit/renderer 120.2.7 → 120.3.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 +13 -0
- package/dist/cjs/react/nodes/table/colgroup.js +30 -0
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/react/nodes/table/colgroup.js +29 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/react/nodes/table/colgroup.js +31 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 120.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#190691](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/190691)
|
|
8
|
+
[`e4343163813c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e4343163813c4) -
|
|
9
|
+
[ux] [JRACLOUD-95277] When numbered column is on, use percentage scaling for colWidths if the
|
|
10
|
+
tableWidth is less than the maxWidth and the column width is greater than the min colWidth
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 120.2.7
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -14,6 +14,7 @@ var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
|
14
14
|
var _useFeatureFlags = require("../../../use-feature-flags");
|
|
15
15
|
var _rendererContext = require("../../../renderer-context");
|
|
16
16
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
18
|
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; }
|
|
18
19
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
20
|
// we allow scaling down column widths by no more than 30%
|
|
@@ -174,6 +175,35 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
174
175
|
isNumberColumnEnabled: isNumberColumnEnabled
|
|
175
176
|
});
|
|
176
177
|
}
|
|
178
|
+
if (isNumberColumnEnabled && (tableWidth < maxTableWidth || maxTableWidth === 0) && (0, _expValEquals.expValEquals)('editor_prevent_numbered_column_too_big_jira', 'isEnabled', true)) {
|
|
179
|
+
var fixedColWidths = targetWidths.map(function (width) {
|
|
180
|
+
return fixColumnWidth(width, tableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
181
|
+
});
|
|
182
|
+
var sumFixedColumnWidths = colWidthSum(fixedColWidths);
|
|
183
|
+
return fixedColWidths.map(function (colWidth) {
|
|
184
|
+
var width = Math.max(colWidth, cellMinWidth);
|
|
185
|
+
if (colWidth > _editorSharedStyles.akEditorTableCellMinWidth) {
|
|
186
|
+
// To make sure the numbered column isn't scaled, use
|
|
187
|
+
// percentages for the other columns.
|
|
188
|
+
// Calculate the percentage based on the sum of the fixed column widths
|
|
189
|
+
return {
|
|
190
|
+
width: "".concat(width / sumFixedColumnWidths * 100, "%")
|
|
191
|
+
};
|
|
192
|
+
} else {
|
|
193
|
+
// If the column is equal to or less than the minimum cell width, we need to return a fixed pixel width.
|
|
194
|
+
// This is to prevent columns being scaled below the minimum cell width.
|
|
195
|
+
var style = width ? {
|
|
196
|
+
width: "".concat(width, "px")
|
|
197
|
+
} : {};
|
|
198
|
+
return style;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* When cleaning up editor_prevent_numbered_column_too_big_jira experiment,
|
|
205
|
+
* resuse the fixedColWidths const to avoid code duplication.
|
|
206
|
+
*/
|
|
177
207
|
return targetWidths.map(function (colWidth) {
|
|
178
208
|
var width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
179
209
|
var style = width ? {
|
|
@@ -63,7 +63,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
63
63
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
64
64
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
65
65
|
var packageName = "@atlaskit/renderer";
|
|
66
|
-
var packageVersion = "120.2.
|
|
66
|
+
var packageVersion = "120.2.7";
|
|
67
67
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
68
68
|
containerName: 'ak-renderer-wrapper',
|
|
69
69
|
containerType: 'inline-size'
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
|
-
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
3
|
+
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
5
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
6
6
|
import { useFeatureFlags } from '../../../use-feature-flags';
|
|
7
7
|
import { useRendererContext } from '../../../renderer-context';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
|
|
10
11
|
// we allow scaling down column widths by no more than 30%
|
|
11
12
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -160,6 +161,33 @@ const renderScaleDownColgroup = props => {
|
|
|
160
161
|
isNumberColumnEnabled: isNumberColumnEnabled
|
|
161
162
|
});
|
|
162
163
|
}
|
|
164
|
+
if (isNumberColumnEnabled && (tableWidth < maxTableWidth || maxTableWidth === 0) && expValEquals('editor_prevent_numbered_column_too_big_jira', 'isEnabled', true)) {
|
|
165
|
+
const fixedColWidths = targetWidths.map(width => fixColumnWidth(width, tableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth);
|
|
166
|
+
const sumFixedColumnWidths = colWidthSum(fixedColWidths);
|
|
167
|
+
return fixedColWidths.map(colWidth => {
|
|
168
|
+
const width = Math.max(colWidth, cellMinWidth);
|
|
169
|
+
if (colWidth > akEditorTableCellMinWidth) {
|
|
170
|
+
// To make sure the numbered column isn't scaled, use
|
|
171
|
+
// percentages for the other columns.
|
|
172
|
+
// Calculate the percentage based on the sum of the fixed column widths
|
|
173
|
+
return {
|
|
174
|
+
width: `${width / sumFixedColumnWidths * 100}%`
|
|
175
|
+
};
|
|
176
|
+
} else {
|
|
177
|
+
// If the column is equal to or less than the minimum cell width, we need to return a fixed pixel width.
|
|
178
|
+
// This is to prevent columns being scaled below the minimum cell width.
|
|
179
|
+
const style = width ? {
|
|
180
|
+
width: `${width}px`
|
|
181
|
+
} : {};
|
|
182
|
+
return style;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* When cleaning up editor_prevent_numbered_column_too_big_jira experiment,
|
|
189
|
+
* resuse the fixedColWidths const to avoid code duplication.
|
|
190
|
+
*/
|
|
163
191
|
return targetWidths.map(colWidth => {
|
|
164
192
|
const width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
165
193
|
const style = width ? {
|
|
@@ -49,7 +49,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
49
49
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
50
50
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
51
51
|
const packageName = "@atlaskit/renderer";
|
|
52
|
-
const packageVersion = "120.2.
|
|
52
|
+
const packageVersion = "120.2.7";
|
|
53
53
|
const setAsQueryContainerStyles = css({
|
|
54
54
|
containerName: 'ak-renderer-wrapper',
|
|
55
55
|
containerType: 'inline-size'
|
|
@@ -3,12 +3,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
6
|
-
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { akEditorTableNumberColumnWidth, akEditorTableLegacyCellMinWidth, akEditorTableCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
8
8
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
9
9
|
import { useFeatureFlags } from '../../../use-feature-flags';
|
|
10
10
|
import { useRendererContext } from '../../../renderer-context';
|
|
11
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
13
|
|
|
13
14
|
// we allow scaling down column widths by no more than 30%
|
|
14
15
|
// this intends to reduce unwanted scrolling in the Renderer in these scenarios:
|
|
@@ -168,6 +169,35 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
|
|
|
168
169
|
isNumberColumnEnabled: isNumberColumnEnabled
|
|
169
170
|
});
|
|
170
171
|
}
|
|
172
|
+
if (isNumberColumnEnabled && (tableWidth < maxTableWidth || maxTableWidth === 0) && expValEquals('editor_prevent_numbered_column_too_big_jira', 'isEnabled', true)) {
|
|
173
|
+
var fixedColWidths = targetWidths.map(function (width) {
|
|
174
|
+
return fixColumnWidth(width, tableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
175
|
+
});
|
|
176
|
+
var sumFixedColumnWidths = colWidthSum(fixedColWidths);
|
|
177
|
+
return fixedColWidths.map(function (colWidth) {
|
|
178
|
+
var width = Math.max(colWidth, cellMinWidth);
|
|
179
|
+
if (colWidth > akEditorTableCellMinWidth) {
|
|
180
|
+
// To make sure the numbered column isn't scaled, use
|
|
181
|
+
// percentages for the other columns.
|
|
182
|
+
// Calculate the percentage based on the sum of the fixed column widths
|
|
183
|
+
return {
|
|
184
|
+
width: "".concat(width / sumFixedColumnWidths * 100, "%")
|
|
185
|
+
};
|
|
186
|
+
} else {
|
|
187
|
+
// If the column is equal to or less than the minimum cell width, we need to return a fixed pixel width.
|
|
188
|
+
// This is to prevent columns being scaled below the minimum cell width.
|
|
189
|
+
var style = width ? {
|
|
190
|
+
width: "".concat(width, "px")
|
|
191
|
+
} : {};
|
|
192
|
+
return style;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* When cleaning up editor_prevent_numbered_column_too_big_jira experiment,
|
|
199
|
+
* resuse the fixedColWidths const to avoid code duplication.
|
|
200
|
+
*/
|
|
171
201
|
return targetWidths.map(function (colWidth) {
|
|
172
202
|
var width = fixColumnWidth(colWidth, minTableWidth, maxTableWidth, zeroWidthColumnsCount, scaleDownPercent) || cellMinWidth;
|
|
173
203
|
var style = width ? {
|
|
@@ -54,7 +54,7 @@ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equ
|
|
|
54
54
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
55
55
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
56
56
|
var packageName = "@atlaskit/renderer";
|
|
57
|
-
var packageVersion = "120.2.
|
|
57
|
+
var packageVersion = "120.2.7";
|
|
58
58
|
var setAsQueryContainerStyles = css({
|
|
59
59
|
containerName: 'ak-renderer-wrapper',
|
|
60
60
|
containerType: 'inline-size'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "120.
|
|
3
|
+
"version": "120.3.0",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@atlaskit/analytics-listeners": "^9.0.0",
|
|
29
29
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
30
30
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
31
|
-
"@atlaskit/button": "^23.
|
|
31
|
+
"@atlaskit/button": "^23.3.0",
|
|
32
32
|
"@atlaskit/code": "^17.2.0",
|
|
33
33
|
"@atlaskit/editor-json-transformer": "^8.24.0",
|
|
34
34
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/status": "^3.0.0",
|
|
55
55
|
"@atlaskit/task-decision": "^19.2.0",
|
|
56
56
|
"@atlaskit/theme": "^19.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^9.15.0",
|
|
58
58
|
"@atlaskit/tokens": "^5.6.0",
|
|
59
59
|
"@atlaskit/tooltip": "^20.3.0",
|
|
60
60
|
"@atlaskit/visually-hidden": "^3.0.0",
|