@atlaskit/renderer 133.16.4 → 133.16.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 133.16.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2e067bdb34b2d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e067bdb34b2d) -
8
+ Fix a non-resized table inside an Excerpt macro shrinking to only its first columns when rendered
9
+ on a wide or full-width page. Inside a nested renderer (a macro body) a non-resized table's width
10
+ is a default layout cap (e.g. 760px/1800px, or a container-query length) taken from the outer
11
+ renderer's width context, which does not match the macro's own box. Promoting that value to inline
12
+ `!important` made the table ignore the available space and collapse. Under
13
+ `platform_nested_table_style_override_2` the renderer now re-asserts the parent stylesheet's
14
+ intent (`width: 100%`) for these non-resized tables. Explicitly resized tables (with a saved
15
+ width) are excluded and keep their author-chosen width, preserving the PGXT-10226 Include Page
16
+ fix; tables nested inside table cells (PGXT-10294) also remain untouched.
17
+
3
18
  ## 133.16.4
4
19
 
5
20
  ### Patch Changes
@@ -420,10 +420,27 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
420
420
  * Uses lastComputedStyle (populated during render) rather than reading from
421
421
  * element.style, because React may remove properties from the DOM when their
422
422
  * values transition to undefined between renders.
423
+ *
424
+ * `platform_nested_table_style_override_2` fixes a follow-up regression where a
425
+ * NON-resized table inside an Excerpt macro (not Excerpt Include) on a
426
+ * wide/full-width page shrinks to only show its first columns in the renderer.
427
+ * Inside a nested renderer (a macro body) a non-resized table's computed width
428
+ * is a default layout cap (760px/1800px, or a `cqw` length for full-page
429
+ * appearances) taken from the outer renderer's width context. That value does
430
+ * not match the macro's own box, so promoting it to inline `!important` makes
431
+ * the table collapse. Such tables have no author-chosen size to preserve, so
432
+ * under this gate we re-assert the parent stylesheet's intent (fill the box:
433
+ * `width: 100%; left: 0`) with inline `!important`.
434
+ *
435
+ * Explicitly resized tables (`tableNode.attrs.width` set) are excluded and keep
436
+ * the original PGXT-10226 behavior: their author-chosen width/left is promoted
437
+ * verbatim so the Include Page macro does not stretch or indent them. The
438
+ * table-cell short-circuit (PGXT-10294) above also still applies.
423
439
  */
424
440
  }, {
425
441
  key: "applyNestedRendererTableFix",
426
442
  value: function applyNestedRendererTableFix() {
443
+ var _this$props$tableNode;
427
444
  if (!this.containerRef || !(0, _platformFeatureFlags.fg)('platform_nested_table_style_override')) {
428
445
  return;
429
446
  }
@@ -435,6 +452,35 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
435
452
  left = _this$lastComputedSty.left,
436
453
  marginLeft = _this$lastComputedSty.marginLeft;
437
454
  var style = this.containerRef.style;
455
+
456
+ // A table is "explicitly resized" when the author set a width on the node.
457
+ // Non-resized tables instead take a default layout cap (e.g. 760px/1800px)
458
+ // derived from the outer renderer's appearance.
459
+ var isExplicitlyResized = Boolean((_this$props$tableNode = this.props.tableNode) === null || _this$props$tableNode === void 0 ? void 0 : _this$props$tableNode.attrs.width);
460
+ if (!isExplicitlyResized && (0, _platformFeatureFlags.fg)('platform_nested_table_style_override_2')) {
461
+ // PGXT-10421: For a NON-resized table inside a nested renderer (e.g. an
462
+ // Excerpt macro body), the computed width is a default layout cap
463
+ // (760px/1800px, or a `cqw` length for full-page appearances) taken from
464
+ // the *outer* renderer's width context. That value does not match the
465
+ // macro's own box, so promoting it to inline `!important` makes the table
466
+ // ignore the available space and collapse to its first columns.
467
+ //
468
+ // These tables have no author-chosen size to preserve, so re-assert the
469
+ // parent stylesheet's intent — fill the available box (`width: 100%`) —
470
+ // with inline `!important` priority so it survives React re-renders and
471
+ // wins over the stylesheet rule that leaks into nested renderers.
472
+ style.setProperty('width', '100%', 'important');
473
+ style.setProperty('max-width', '100%', 'important');
474
+ style.setProperty('left', '0', 'important');
475
+ style.setProperty('margin-left', '0', 'important');
476
+ return;
477
+ }
478
+
479
+ // PGXT-10226: An explicitly resized table inside a nested renderer (e.g.
480
+ // Include Page macro) must keep its author-chosen width and position. The
481
+ // parent stylesheet forces `width: 100% !important; left: 0 !important`,
482
+ // which would stretch and indent it, so we promote the component's own
483
+ // computed width/left with inline `!important` to win the cascade.
438
484
  style.setProperty('width', width || 'auto', 'important');
439
485
  style.setProperty('max-width', '100%', 'important');
440
486
  style.setProperty('left', left || 'auto', 'important');
@@ -73,7 +73,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
73
73
  var TABLE_INFO_TIMEOUT = 10000;
74
74
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
75
75
  var packageName = "@atlaskit/renderer";
76
- var packageVersion = "133.16.3";
76
+ var packageVersion = "133.16.4";
77
77
  var setAsQueryContainerStyles = (0, _react2.css)({
78
78
  containerName: 'ak-renderer-wrapper',
79
79
  containerType: 'inline-size'
@@ -370,8 +370,25 @@ export class TableContainer extends React.Component {
370
370
  * Uses lastComputedStyle (populated during render) rather than reading from
371
371
  * element.style, because React may remove properties from the DOM when their
372
372
  * values transition to undefined between renders.
373
+ *
374
+ * `platform_nested_table_style_override_2` fixes a follow-up regression where a
375
+ * NON-resized table inside an Excerpt macro (not Excerpt Include) on a
376
+ * wide/full-width page shrinks to only show its first columns in the renderer.
377
+ * Inside a nested renderer (a macro body) a non-resized table's computed width
378
+ * is a default layout cap (760px/1800px, or a `cqw` length for full-page
379
+ * appearances) taken from the outer renderer's width context. That value does
380
+ * not match the macro's own box, so promoting it to inline `!important` makes
381
+ * the table collapse. Such tables have no author-chosen size to preserve, so
382
+ * under this gate we re-assert the parent stylesheet's intent (fill the box:
383
+ * `width: 100%; left: 0`) with inline `!important`.
384
+ *
385
+ * Explicitly resized tables (`tableNode.attrs.width` set) are excluded and keep
386
+ * the original PGXT-10226 behavior: their author-chosen width/left is promoted
387
+ * verbatim so the Include Page macro does not stretch or indent them. The
388
+ * table-cell short-circuit (PGXT-10294) above also still applies.
373
389
  */
374
390
  applyNestedRendererTableFix() {
391
+ var _this$props$tableNode;
375
392
  if (!this.containerRef || !fg('platform_nested_table_style_override')) {
376
393
  return;
377
394
  }
@@ -384,6 +401,35 @@ export class TableContainer extends React.Component {
384
401
  marginLeft
385
402
  } = this.lastComputedStyle;
386
403
  const style = this.containerRef.style;
404
+
405
+ // A table is "explicitly resized" when the author set a width on the node.
406
+ // Non-resized tables instead take a default layout cap (e.g. 760px/1800px)
407
+ // derived from the outer renderer's appearance.
408
+ const isExplicitlyResized = Boolean((_this$props$tableNode = this.props.tableNode) === null || _this$props$tableNode === void 0 ? void 0 : _this$props$tableNode.attrs.width);
409
+ if (!isExplicitlyResized && fg('platform_nested_table_style_override_2')) {
410
+ // PGXT-10421: For a NON-resized table inside a nested renderer (e.g. an
411
+ // Excerpt macro body), the computed width is a default layout cap
412
+ // (760px/1800px, or a `cqw` length for full-page appearances) taken from
413
+ // the *outer* renderer's width context. That value does not match the
414
+ // macro's own box, so promoting it to inline `!important` makes the table
415
+ // ignore the available space and collapse to its first columns.
416
+ //
417
+ // These tables have no author-chosen size to preserve, so re-assert the
418
+ // parent stylesheet's intent — fill the available box (`width: 100%`) —
419
+ // with inline `!important` priority so it survives React re-renders and
420
+ // wins over the stylesheet rule that leaks into nested renderers.
421
+ style.setProperty('width', '100%', 'important');
422
+ style.setProperty('max-width', '100%', 'important');
423
+ style.setProperty('left', '0', 'important');
424
+ style.setProperty('margin-left', '0', 'important');
425
+ return;
426
+ }
427
+
428
+ // PGXT-10226: An explicitly resized table inside a nested renderer (e.g.
429
+ // Include Page macro) must keep its author-chosen width and position. The
430
+ // parent stylesheet forces `width: 100% !important; left: 0 !important`,
431
+ // which would stretch and indent it, so we promote the component's own
432
+ // computed width/left with inline `!important` to win the cascade.
387
433
  style.setProperty('width', width || 'auto', 'important');
388
434
  style.setProperty('max-width', '100%', 'important');
389
435
  style.setProperty('left', left || 'auto', 'important');
@@ -59,7 +59,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
59
59
  const TABLE_INFO_TIMEOUT = 10000;
60
60
  const RENDER_EVENT_SAMPLE_RATE = 0.1;
61
61
  const packageName = "@atlaskit/renderer";
62
- const packageVersion = "133.16.3";
62
+ const packageVersion = "133.16.4";
63
63
  const setAsQueryContainerStyles = css({
64
64
  containerName: 'ak-renderer-wrapper',
65
65
  containerType: 'inline-size'
@@ -414,10 +414,27 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
414
414
  * Uses lastComputedStyle (populated during render) rather than reading from
415
415
  * element.style, because React may remove properties from the DOM when their
416
416
  * values transition to undefined between renders.
417
+ *
418
+ * `platform_nested_table_style_override_2` fixes a follow-up regression where a
419
+ * NON-resized table inside an Excerpt macro (not Excerpt Include) on a
420
+ * wide/full-width page shrinks to only show its first columns in the renderer.
421
+ * Inside a nested renderer (a macro body) a non-resized table's computed width
422
+ * is a default layout cap (760px/1800px, or a `cqw` length for full-page
423
+ * appearances) taken from the outer renderer's width context. That value does
424
+ * not match the macro's own box, so promoting it to inline `!important` makes
425
+ * the table collapse. Such tables have no author-chosen size to preserve, so
426
+ * under this gate we re-assert the parent stylesheet's intent (fill the box:
427
+ * `width: 100%; left: 0`) with inline `!important`.
428
+ *
429
+ * Explicitly resized tables (`tableNode.attrs.width` set) are excluded and keep
430
+ * the original PGXT-10226 behavior: their author-chosen width/left is promoted
431
+ * verbatim so the Include Page macro does not stretch or indent them. The
432
+ * table-cell short-circuit (PGXT-10294) above also still applies.
417
433
  */
418
434
  }, {
419
435
  key: "applyNestedRendererTableFix",
420
436
  value: function applyNestedRendererTableFix() {
437
+ var _this$props$tableNode;
421
438
  if (!this.containerRef || !fg('platform_nested_table_style_override')) {
422
439
  return;
423
440
  }
@@ -429,6 +446,35 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
429
446
  left = _this$lastComputedSty.left,
430
447
  marginLeft = _this$lastComputedSty.marginLeft;
431
448
  var style = this.containerRef.style;
449
+
450
+ // A table is "explicitly resized" when the author set a width on the node.
451
+ // Non-resized tables instead take a default layout cap (e.g. 760px/1800px)
452
+ // derived from the outer renderer's appearance.
453
+ var isExplicitlyResized = Boolean((_this$props$tableNode = this.props.tableNode) === null || _this$props$tableNode === void 0 ? void 0 : _this$props$tableNode.attrs.width);
454
+ if (!isExplicitlyResized && fg('platform_nested_table_style_override_2')) {
455
+ // PGXT-10421: For a NON-resized table inside a nested renderer (e.g. an
456
+ // Excerpt macro body), the computed width is a default layout cap
457
+ // (760px/1800px, or a `cqw` length for full-page appearances) taken from
458
+ // the *outer* renderer's width context. That value does not match the
459
+ // macro's own box, so promoting it to inline `!important` makes the table
460
+ // ignore the available space and collapse to its first columns.
461
+ //
462
+ // These tables have no author-chosen size to preserve, so re-assert the
463
+ // parent stylesheet's intent — fill the available box (`width: 100%`) —
464
+ // with inline `!important` priority so it survives React re-renders and
465
+ // wins over the stylesheet rule that leaks into nested renderers.
466
+ style.setProperty('width', '100%', 'important');
467
+ style.setProperty('max-width', '100%', 'important');
468
+ style.setProperty('left', '0', 'important');
469
+ style.setProperty('margin-left', '0', 'important');
470
+ return;
471
+ }
472
+
473
+ // PGXT-10226: An explicitly resized table inside a nested renderer (e.g.
474
+ // Include Page macro) must keep its author-chosen width and position. The
475
+ // parent stylesheet forces `width: 100% !important; left: 0 !important`,
476
+ // which would stretch and indent it, so we promote the component's own
477
+ // computed width/left with inline `!important` to win the cascade.
432
478
  style.setProperty('width', width || 'auto', 'important');
433
479
  style.setProperty('max-width', '100%', 'important');
434
480
  style.setProperty('left', left || 'auto', 'important');
@@ -64,7 +64,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
64
64
  var TABLE_INFO_TIMEOUT = 10000;
65
65
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
66
66
  var packageName = "@atlaskit/renderer";
67
- var packageVersion = "133.16.3";
67
+ var packageVersion = "133.16.4";
68
68
  var setAsQueryContainerStyles = css({
69
69
  containerName: 'ak-renderer-wrapper',
70
70
  containerType: 'inline-size'
@@ -104,6 +104,22 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
104
104
  * Uses lastComputedStyle (populated during render) rather than reading from
105
105
  * element.style, because React may remove properties from the DOM when their
106
106
  * values transition to undefined between renders.
107
+ *
108
+ * `platform_nested_table_style_override_2` fixes a follow-up regression where a
109
+ * NON-resized table inside an Excerpt macro (not Excerpt Include) on a
110
+ * wide/full-width page shrinks to only show its first columns in the renderer.
111
+ * Inside a nested renderer (a macro body) a non-resized table's computed width
112
+ * is a default layout cap (760px/1800px, or a `cqw` length for full-page
113
+ * appearances) taken from the outer renderer's width context. That value does
114
+ * not match the macro's own box, so promoting it to inline `!important` makes
115
+ * the table collapse. Such tables have no author-chosen size to preserve, so
116
+ * under this gate we re-assert the parent stylesheet's intent (fill the box:
117
+ * `width: 100%; left: 0`) with inline `!important`.
118
+ *
119
+ * Explicitly resized tables (`tableNode.attrs.width` set) are excluded and keep
120
+ * the original PGXT-10226 behavior: their author-chosen width/left is promoted
121
+ * verbatim so the Include Page macro does not stretch or indent them. The
122
+ * table-cell short-circuit (PGXT-10294) above also still applies.
107
123
  */
108
124
  private applyNestedRendererTableFix;
109
125
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "133.16.4",
3
+ "version": "133.16.5",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -68,7 +68,7 @@
68
68
  "@atlaskit/status": "^5.7.0",
69
69
  "@atlaskit/task-decision": "^21.7.0",
70
70
  "@atlaskit/theme": "^26.1.0",
71
- "@atlaskit/tmp-editor-statsig": "^135.0.0",
71
+ "@atlaskit/tmp-editor-statsig": "^135.1.0",
72
72
  "@atlaskit/tokens": "^16.3.0",
73
73
  "@atlaskit/tooltip": "^23.2.0",
74
74
  "@atlaskit/visually-hidden": "^4.2.0",
@@ -83,7 +83,7 @@
83
83
  "uuid": "^3.1.0"
84
84
  },
85
85
  "peerDependencies": {
86
- "@atlaskit/editor-common": "^116.41.0",
86
+ "@atlaskit/editor-common": "^116.42.0",
87
87
  "@atlaskit/link-provider": "^5.2.0",
88
88
  "@atlaskit/media-core": "^38.0.0",
89
89
  "react": "^18.2.0",
@@ -265,6 +265,9 @@
265
265
  "platform_nested_table_style_override": {
266
266
  "type": "boolean"
267
267
  },
268
+ "platform_nested_table_style_override_2": {
269
+ "type": "boolean"
270
+ },
268
271
  "platform_editor_table_nested_renderer_fix": {
269
272
  "type": "boolean"
270
273
  },