@atlaskit/renderer 108.11.10 → 108.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 108.11.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e0de9e09b5f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e0de9e09b5f) - Use table container width when calculating column widths to scale down, in renderer. Behind feature flag platform.editor.custom-table-width-scale-down-undefined-column_nkyvx
8
+ - Updated dependencies
9
+
3
10
  ## 108.11.10
4
11
 
5
12
  ### Patch Changes
@@ -61,22 +61,27 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
61
61
  renderWidth = props.renderWidth,
62
62
  tableNode = props.tableNode,
63
63
  rendererAppearance = props.rendererAppearance;
64
- var tableContainerWidth;
65
64
  if (!columnWidths) {
66
65
  return [];
67
66
  }
68
- var columnAmount = columnWidths.length;
67
+ var tableContainerWidth;
69
68
  var tableResized = isTableResized(columnWidths);
69
+ var noOfColumns = columnWidths.length;
70
70
  var targetWidths;
71
+ if ((0, _table.isTableResizingEnabled)(rendererAppearance) && tableNode) {
72
+ tableContainerWidth = (0, _nodeWidth.getTableContainerWidth)(tableNode);
73
+ } else {
74
+ tableContainerWidth = getTableLayoutWidth(layout);
75
+ }
71
76
  if ((0, _table.isTableResizingEnabled)(rendererAppearance) && !tableResized) {
72
77
  if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx')) {
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
+ // for tables with no column widths defined, assume that the real table width
79
+ // is defined by node.attrs.width
80
+ var _tableWidth2 = isNumberColumnEnabled ? tableContainerWidth - _editorSharedStyles.akEditorTableNumberColumnWidth : tableContainerWidth;
81
+ var defaultColumnWidth = Math.floor(_tableWidth2 / noOfColumns);
82
+ targetWidths = new Array(noOfColumns).fill(defaultColumnWidth);
78
83
  } else {
79
- return new Array(columnAmount).fill({
84
+ return new Array(noOfColumns).fill({
80
85
  minWidth: "".concat(_styles.tableCellMinWidth, "px")
81
86
  });
82
87
  }
@@ -84,11 +89,6 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
84
89
  return null;
85
90
  }
86
91
  targetWidths = targetWidths || columnWidths;
87
- if ((0, _table.isTableResizingEnabled)(rendererAppearance) && tableNode) {
88
- tableContainerWidth = (0, _nodeWidth.getTableContainerWidth)(tableNode);
89
- } else {
90
- tableContainerWidth = getTableLayoutWidth(layout);
91
- }
92
92
 
93
93
  // @see ED-6056
94
94
  var maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
@@ -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.10";
58
+ var packageVersion = "108.11.11";
59
59
  var Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -55,22 +55,27 @@ const renderScaleDownColgroup = props => {
55
55
  tableNode,
56
56
  rendererAppearance
57
57
  } = props;
58
- let tableContainerWidth;
59
58
  if (!columnWidths) {
60
59
  return [];
61
60
  }
62
- const columnAmount = columnWidths.length;
61
+ let tableContainerWidth;
63
62
  const tableResized = isTableResized(columnWidths);
63
+ const noOfColumns = columnWidths.length;
64
64
  let targetWidths;
65
+ if (isTableResizingEnabled(rendererAppearance) && tableNode) {
66
+ tableContainerWidth = getTableContainerWidth(tableNode);
67
+ } else {
68
+ tableContainerWidth = getTableLayoutWidth(layout);
69
+ }
65
70
  if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
66
71
  if (getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx')) {
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
+ // for tables with no column widths defined, assume that the real table width
73
+ // is defined by node.attrs.width
74
+ const tableWidth = isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth;
75
+ const defaultColumnWidth = Math.floor(tableWidth / noOfColumns);
76
+ targetWidths = new Array(noOfColumns).fill(defaultColumnWidth);
72
77
  } else {
73
- return new Array(columnAmount).fill({
78
+ return new Array(noOfColumns).fill({
74
79
  minWidth: `${tableCellMinWidth}px`
75
80
  });
76
81
  }
@@ -78,11 +83,6 @@ const renderScaleDownColgroup = props => {
78
83
  return null;
79
84
  }
80
85
  targetWidths = targetWidths || columnWidths;
81
- if (isTableResizingEnabled(rendererAppearance) && tableNode) {
82
- tableContainerWidth = getTableContainerWidth(tableNode);
83
- } else {
84
- tableContainerWidth = getTableLayoutWidth(layout);
85
- }
86
86
 
87
87
  // @see ED-6056
88
88
  const maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
@@ -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.10";
38
+ const packageVersion = "108.11.11";
39
39
  export class Renderer extends PureComponent {
40
40
  constructor(props) {
41
41
  super(props);
@@ -54,22 +54,27 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
54
54
  renderWidth = props.renderWidth,
55
55
  tableNode = props.tableNode,
56
56
  rendererAppearance = props.rendererAppearance;
57
- var tableContainerWidth;
58
57
  if (!columnWidths) {
59
58
  return [];
60
59
  }
61
- var columnAmount = columnWidths.length;
60
+ var tableContainerWidth;
62
61
  var tableResized = isTableResized(columnWidths);
62
+ var noOfColumns = columnWidths.length;
63
63
  var targetWidths;
64
+ if (isTableResizingEnabled(rendererAppearance) && tableNode) {
65
+ tableContainerWidth = getTableContainerWidth(tableNode);
66
+ } else {
67
+ tableContainerWidth = getTableLayoutWidth(layout);
68
+ }
64
69
  if (isTableResizingEnabled(rendererAppearance) && !tableResized) {
65
70
  if (getBooleanFF('platform.editor.custom-table-width-scale-down-undefined-column_nkyvx')) {
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
+ // for tables with no column widths defined, assume that the real table width
72
+ // is defined by node.attrs.width
73
+ var _tableWidth2 = isNumberColumnEnabled ? tableContainerWidth - akEditorTableNumberColumnWidth : tableContainerWidth;
74
+ var defaultColumnWidth = Math.floor(_tableWidth2 / noOfColumns);
75
+ targetWidths = new Array(noOfColumns).fill(defaultColumnWidth);
71
76
  } else {
72
- return new Array(columnAmount).fill({
77
+ return new Array(noOfColumns).fill({
73
78
  minWidth: "".concat(tableCellMinWidth, "px")
74
79
  });
75
80
  }
@@ -77,11 +82,6 @@ var renderScaleDownColgroup = function renderScaleDownColgroup(props) {
77
82
  return null;
78
83
  }
79
84
  targetWidths = targetWidths || columnWidths;
80
- if (isTableResizingEnabled(rendererAppearance) && tableNode) {
81
- tableContainerWidth = getTableContainerWidth(tableNode);
82
- } else {
83
- tableContainerWidth = getTableLayoutWidth(layout);
84
- }
85
85
 
86
86
  // @see ED-6056
87
87
  var maxTableWidth = renderWidth < tableContainerWidth ? renderWidth : tableContainerWidth;
@@ -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.10";
48
+ var packageVersion = "108.11.11";
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.10",
3
+ "version": "108.11.11",
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.55.0",
34
+ "@atlaskit/editor-common": "^74.56.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",
@@ -40,17 +40,17 @@
40
40
  "@atlaskit/icon": "^21.12.0",
41
41
  "@atlaskit/link-datasource": "^1.0.0",
42
42
  "@atlaskit/media-card": "^76.1.0",
43
- "@atlaskit/media-client": "^23.1.0",
44
- "@atlaskit/media-common": "^8.1.0",
43
+ "@atlaskit/media-client": "^23.2.0",
44
+ "@atlaskit/media-common": "^8.2.0",
45
45
  "@atlaskit/media-filmstrip": "^47.0.0",
46
46
  "@atlaskit/media-ui": "^24.0.0",
47
47
  "@atlaskit/media-viewer": "^48.0.0",
48
48
  "@atlaskit/platform-feature-flags": "^0.2.0",
49
- "@atlaskit/smart-card": "^26.19.0",
49
+ "@atlaskit/smart-card": "^26.20.0",
50
50
  "@atlaskit/status": "^1.3.0",
51
51
  "@atlaskit/task-decision": "^17.7.0",
52
- "@atlaskit/theme": "^12.5.0",
53
- "@atlaskit/tokens": "^1.18.0",
52
+ "@atlaskit/theme": "^12.6.0",
53
+ "@atlaskit/tokens": "^1.20.0",
54
54
  "@atlaskit/tooltip": "^17.8.0",
55
55
  "@babel/runtime": "^7.0.0",
56
56
  "@emotion/react": "^11.7.1",