@atlaskit/renderer 112.7.7 → 112.7.8

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,14 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 112.7.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#181016](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/181016)
8
+ [`fb9a503ee55c3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fb9a503ee55c3) -
9
+ Add new `getColumnWidths` function which will loop through each table row, looking for the max
10
+ number of table cells to use to render the table correctly when table resizing is enabled.
11
+
3
12
  ## 112.7.7
4
13
 
5
14
  ### Patch Changes
@@ -22,6 +22,7 @@ var _validator = require("@atlaskit/editor-common/validator");
22
22
  var _utils = require("@atlaskit/editor-common/utils");
23
23
  var _utils2 = require("../utils");
24
24
  var _utils3 = require("@atlaskit/editor-prosemirror/utils");
25
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
25
26
  var _rendererNode = require("./renderer-node");
26
27
  var _code = require("./marks/code");
27
28
  var _segmentText = require("./utils/segment-text");
@@ -367,7 +368,11 @@ var ReactSerializer = exports.default = /*#__PURE__*/function () {
367
368
  var isInsideMultiBodiedExtension = (0, _rendererNode.insideMultiBodiedExtension)(path, node.type.schema);
368
369
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
369
370
  allowColumnSorting: this.allowColumnSorting,
370
- columnWidths: (0, _utils.calcTableColumnWidths)(node),
371
+ columnWidths:
372
+ // When allowTableResizing is enabled, the number of columns is required to render
373
+ // the same scaling logic as editor. Some tables can have unequal rows, so the entire
374
+ // table needs to be scanned.
375
+ this.allowTableResizing && (0, _platformFeatureFlags.fg)('platform_editor_table_col_calculation_fix') ? (0, _utils.getColumnWidths)(node) : (0, _utils.calcTableColumnWidths)(node),
371
376
  tableNode: node,
372
377
  stickyHeaders: stickyHeaders,
373
378
  isInsideOfBlockNode: isInsideOfBlockNode,
@@ -64,7 +64,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
64
64
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
65
65
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
66
66
  var packageName = "@atlaskit/renderer";
67
- var packageVersion = "112.7.7";
67
+ var packageVersion = "112.7.8";
68
68
  var setAsQueryContainerStyles = (0, _react2.css)({
69
69
  containerName: 'ak-renderer-wrapper',
70
70
  containerType: 'inline-size',
@@ -8,9 +8,10 @@ import { Doc, DocWithSelectAllTrap, mergeTextNodes, isTextWrapper, isTextNode, t
8
8
  import TextWrapperComponent from './nodes/text-wrapper';
9
9
  import { toReact as markToReact, isAnnotationMark } from './marks';
10
10
  import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
11
- import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
11
+ import { calcTableColumnWidths, getColumnWidths } from '@atlaskit/editor-common/utils';
12
12
  import { getText } from '../utils';
13
13
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
14
+ import { fg } from '@atlaskit/platform-feature-flags';
14
15
  import { insideBlockNode, insideBreakoutLayout, insideMultiBodiedExtension } from './renderer-node';
15
16
  import { isCodeMark } from './marks/code';
16
17
  import { segmentText } from './utils/segment-text';
@@ -329,7 +330,11 @@ export default class ReactSerializer {
329
330
  return {
330
331
  ...this.getProps(node),
331
332
  allowColumnSorting: this.allowColumnSorting,
332
- columnWidths: calcTableColumnWidths(node),
333
+ columnWidths:
334
+ // When allowTableResizing is enabled, the number of columns is required to render
335
+ // the same scaling logic as editor. Some tables can have unequal rows, so the entire
336
+ // table needs to be scanned.
337
+ this.allowTableResizing && fg('platform_editor_table_col_calculation_fix') ? getColumnWidths(node) : calcTableColumnWidths(node),
333
338
  tableNode: node,
334
339
  stickyHeaders,
335
340
  isInsideOfBlockNode,
@@ -45,7 +45,7 @@ import { TruncatedWrapper } from './truncated-wrapper';
45
45
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
46
46
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
47
47
  const packageName = "@atlaskit/renderer";
48
- const packageVersion = "112.7.7";
48
+ const packageVersion = "112.7.8";
49
49
  const setAsQueryContainerStyles = css({
50
50
  containerName: 'ak-renderer-wrapper',
51
51
  containerType: 'inline-size',
@@ -15,9 +15,10 @@ import { Doc, DocWithSelectAllTrap, mergeTextNodes, isTextWrapper, isTextNode, t
15
15
  import TextWrapperComponent from './nodes/text-wrapper';
16
16
  import { toReact as markToReact, isAnnotationMark } from './marks';
17
17
  import { getMarksByOrder, isSameMark } from '@atlaskit/editor-common/validator';
18
- import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
18
+ import { calcTableColumnWidths, getColumnWidths } from '@atlaskit/editor-common/utils';
19
19
  import { getText } from '../utils';
20
20
  import { findChildrenByType } from '@atlaskit/editor-prosemirror/utils';
21
+ import { fg } from '@atlaskit/platform-feature-flags';
21
22
  import { insideBlockNode, insideBreakoutLayout, insideMultiBodiedExtension } from './renderer-node';
22
23
  import { isCodeMark } from './marks/code';
23
24
  import { segmentText } from './utils/segment-text';
@@ -360,7 +361,11 @@ var ReactSerializer = /*#__PURE__*/function () {
360
361
  var isInsideMultiBodiedExtension = insideMultiBodiedExtension(path, node.type.schema);
361
362
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
362
363
  allowColumnSorting: this.allowColumnSorting,
363
- columnWidths: calcTableColumnWidths(node),
364
+ columnWidths:
365
+ // When allowTableResizing is enabled, the number of columns is required to render
366
+ // the same scaling logic as editor. Some tables can have unequal rows, so the entire
367
+ // table needs to be scanned.
368
+ this.allowTableResizing && fg('platform_editor_table_col_calculation_fix') ? getColumnWidths(node) : calcTableColumnWidths(node),
364
369
  tableNode: node,
365
370
  stickyHeaders: stickyHeaders,
366
371
  isInsideOfBlockNode: isInsideOfBlockNode,
@@ -54,7 +54,7 @@ import { TruncatedWrapper } from './truncated-wrapper';
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 = "112.7.7";
57
+ var packageVersion = "112.7.8";
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": "112.7.7",
3
+ "version": "112.7.8",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/analytics-next": "^10.2.0",
30
30
  "@atlaskit/button": "^20.3.0",
31
31
  "@atlaskit/code": "^15.6.0",
32
- "@atlaskit/editor-common": "^96.5.0",
32
+ "@atlaskit/editor-common": "^96.6.0",
33
33
  "@atlaskit/editor-json-transformer": "^8.21.0",
34
34
  "@atlaskit/editor-palette": "1.6.3",
35
35
  "@atlaskit/editor-prosemirror": "6.2.1",
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/status": "^1.8.0",
51
51
  "@atlaskit/task-decision": "^17.11.0",
52
52
  "@atlaskit/theme": "^14.0.0",
53
- "@atlaskit/tmp-editor-statsig": "^2.27.0",
53
+ "@atlaskit/tmp-editor-statsig": "^2.28.0",
54
54
  "@atlaskit/tokens": "^2.5.0",
55
55
  "@atlaskit/tooltip": "^19.0.0",
56
56
  "@babel/runtime": "^7.0.0",
@@ -167,6 +167,13 @@
167
167
  },
168
168
  "confluence-frontend-comments-panel": {
169
169
  "type": "boolean"
170
+ },
171
+ "platform_editor_table_row_span_fix": {
172
+ "type": "boolean",
173
+ "referenceOnly": true
174
+ },
175
+ "platform_editor_table_col_calculation_fix": {
176
+ "type": "boolean"
170
177
  }
171
178
  },
172
179
  "af:exports": {