@atlaskit/renderer 132.0.2 → 132.0.4

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,19 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 132.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d5787d7affb08`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d5787d7affb08) -
8
+ Avoid applying nested renderer table style overrides to tables that are already constrained by a
9
+ table context.
10
+
11
+ ## 132.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 132.0.2
4
18
 
5
19
  ### Patch Changes
@@ -31,6 +31,10 @@ var useMultiBodiedExtensionActions = exports.useMultiBodiedExtensionActions = fu
31
31
  return false;
32
32
  },
33
33
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
34
+ reorderChildren: function reorderChildren(_fromIndex, _toIndex) {
35
+ return false;
36
+ },
37
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
34
38
  updateParameters: function updateParameters(_parameters) {
35
39
  return false;
36
40
  },
@@ -224,6 +224,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
224
224
  (0, _defineProperty2.default)(_this, "updatedLayout", 'custom');
225
225
  (0, _defineProperty2.default)(_this, "containerRef", null);
226
226
  (0, _defineProperty2.default)(_this, "_isInsideNestedRenderer", null);
227
+ (0, _defineProperty2.default)(_this, "_isInsideTableCell", null);
227
228
  // Stores the last computed style values from render() for use by applyNestedRendererTableFix().
228
229
  // This avoids reading from the DOM which can be stale when React removes properties between renders.
229
230
  (0, _defineProperty2.default)(_this, "lastComputedStyle", {});
@@ -259,6 +260,10 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
259
260
  * to the handleRef prop from the overflow shadow HOC.
260
261
  */
261
262
  (0, _defineProperty2.default)(_this, "setContainerRef", function (el) {
263
+ if (_this.containerRef !== el) {
264
+ _this._isInsideNestedRenderer = null;
265
+ _this._isInsideTableCell = null;
266
+ }
262
267
  _this.containerRef = el;
263
268
  var handleRef = _this.props.handleRef;
264
269
  if (typeof handleRef === 'function') {
@@ -374,6 +379,28 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
374
379
  return false;
375
380
  }
376
381
 
382
+ /**
383
+ * Checks if this table is inside a table cell in the DOM. The result is cached
384
+ * since a table's position in the DOM tree is stable after mount.
385
+ */
386
+ }, {
387
+ key: "isInsideTableCell",
388
+ value: function isInsideTableCell() {
389
+ if (this._isInsideTableCell !== null) {
390
+ return this._isInsideTableCell;
391
+ }
392
+ if (!this.containerRef) {
393
+ return false;
394
+ }
395
+ this._isInsideTableCell = Boolean(this.containerRef.closest('td, th'));
396
+ return this._isInsideTableCell;
397
+ }
398
+ }, {
399
+ key: "isInsideTableContext",
400
+ value: function isInsideTableContext() {
401
+ return Boolean(this.props.isInsideOfTable || this.isInsideTableCell());
402
+ }
403
+
377
404
  /**
378
405
  * For tables inside nested renderers (e.g. Include Page macro), the parent
379
406
  * renderer's CSS override forces width:100%!important and left:0!important
@@ -381,6 +408,15 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
381
408
  * style.setProperty with 'important' priority on inline styles beats
382
409
  * stylesheet !important rules per the CSS cascade.
383
410
  *
411
+ * Tables that are nested inside another table need to remain constrained by
412
+ * their table-cell context. Do not promote their width to inline !important,
413
+ * otherwise nested tables rendered through macros such as Excerpt Include can
414
+ * overflow and overlap adjacent cells.
415
+ *
416
+ * Top-level tables in nested renderers still preserve their saved width, but
417
+ * are capped to their containing block so wide tables do not escape constrained
418
+ * macro bodies such as Excerpt Include panels.
419
+ *
384
420
  * Uses lastComputedStyle (populated during render) rather than reading from
385
421
  * element.style, because React may remove properties from the DOM when their
386
422
  * values transition to undefined between renders.
@@ -391,7 +427,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
391
427
  if (!this.containerRef || !(0, _platformFeatureFlags.fg)('platform_nested_table_style_override')) {
392
428
  return;
393
429
  }
394
- if (!this.isInsideNestedRenderer()) {
430
+ if (!this.isInsideNestedRenderer() || this.isInsideTableContext()) {
395
431
  return;
396
432
  }
397
433
  var _this$lastComputedSty = this.lastComputedStyle,
@@ -400,6 +436,7 @@ var TableContainer = exports.TableContainer = /*#__PURE__*/function (_React$Comp
400
436
  marginLeft = _this$lastComputedSty.marginLeft;
401
437
  var style = this.containerRef.style;
402
438
  style.setProperty('width', width || 'auto', 'important');
439
+ style.setProperty('max-width', '100%', 'important');
403
440
  style.setProperty('left', left || 'auto', 'important');
404
441
  style.setProperty('margin-left', marginLeft || '0', 'important');
405
442
  }
@@ -72,7 +72,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
72
72
  var TABLE_INFO_TIMEOUT = 10000;
73
73
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
74
74
  var packageName = "@atlaskit/renderer";
75
- var packageVersion = "132.0.1";
75
+ var packageVersion = "132.0.3";
76
76
  var setAsQueryContainerStyles = (0, _react2.css)({
77
77
  containerName: 'ak-renderer-wrapper',
78
78
  containerType: 'inline-size'
@@ -25,6 +25,10 @@ export const useMultiBodiedExtensionActions = ({
25
25
  return false;
26
26
  },
27
27
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
+ reorderChildren(_fromIndex, _toIndex) {
29
+ return false;
30
+ },
31
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
32
  updateParameters(_parameters) {
29
33
  return false;
30
34
  },
@@ -188,6 +188,7 @@ export class TableContainer extends React.Component {
188
188
  _defineProperty(this, "updatedLayout", 'custom');
189
189
  _defineProperty(this, "containerRef", null);
190
190
  _defineProperty(this, "_isInsideNestedRenderer", null);
191
+ _defineProperty(this, "_isInsideTableCell", null);
191
192
  // Stores the last computed style values from render() for use by applyNestedRendererTableFix().
192
193
  // This avoids reading from the DOM which can be stale when React removes properties between renders.
193
194
  _defineProperty(this, "lastComputedStyle", {});
@@ -214,6 +215,10 @@ export class TableContainer extends React.Component {
214
215
  * to the handleRef prop from the overflow shadow HOC.
215
216
  */
216
217
  _defineProperty(this, "setContainerRef", el => {
218
+ if (this.containerRef !== el) {
219
+ this._isInsideNestedRenderer = null;
220
+ this._isInsideTableCell = null;
221
+ }
217
222
  this.containerRef = el;
218
223
  const {
219
224
  handleRef
@@ -328,6 +333,24 @@ export class TableContainer extends React.Component {
328
333
  return false;
329
334
  }
330
335
 
336
+ /**
337
+ * Checks if this table is inside a table cell in the DOM. The result is cached
338
+ * since a table's position in the DOM tree is stable after mount.
339
+ */
340
+ isInsideTableCell() {
341
+ if (this._isInsideTableCell !== null) {
342
+ return this._isInsideTableCell;
343
+ }
344
+ if (!this.containerRef) {
345
+ return false;
346
+ }
347
+ this._isInsideTableCell = Boolean(this.containerRef.closest('td, th'));
348
+ return this._isInsideTableCell;
349
+ }
350
+ isInsideTableContext() {
351
+ return Boolean(this.props.isInsideOfTable || this.isInsideTableCell());
352
+ }
353
+
331
354
  /**
332
355
  * For tables inside nested renderers (e.g. Include Page macro), the parent
333
356
  * renderer's CSS override forces width:100%!important and left:0!important
@@ -335,6 +358,15 @@ export class TableContainer extends React.Component {
335
358
  * style.setProperty with 'important' priority on inline styles beats
336
359
  * stylesheet !important rules per the CSS cascade.
337
360
  *
361
+ * Tables that are nested inside another table need to remain constrained by
362
+ * their table-cell context. Do not promote their width to inline !important,
363
+ * otherwise nested tables rendered through macros such as Excerpt Include can
364
+ * overflow and overlap adjacent cells.
365
+ *
366
+ * Top-level tables in nested renderers still preserve their saved width, but
367
+ * are capped to their containing block so wide tables do not escape constrained
368
+ * macro bodies such as Excerpt Include panels.
369
+ *
338
370
  * Uses lastComputedStyle (populated during render) rather than reading from
339
371
  * element.style, because React may remove properties from the DOM when their
340
372
  * values transition to undefined between renders.
@@ -343,7 +375,7 @@ export class TableContainer extends React.Component {
343
375
  if (!this.containerRef || !fg('platform_nested_table_style_override')) {
344
376
  return;
345
377
  }
346
- if (!this.isInsideNestedRenderer()) {
378
+ if (!this.isInsideNestedRenderer() || this.isInsideTableContext()) {
347
379
  return;
348
380
  }
349
381
  const {
@@ -353,6 +385,7 @@ export class TableContainer extends React.Component {
353
385
  } = this.lastComputedStyle;
354
386
  const style = this.containerRef.style;
355
387
  style.setProperty('width', width || 'auto', 'important');
388
+ style.setProperty('max-width', '100%', 'important');
356
389
  style.setProperty('left', left || 'auto', 'important');
357
390
  style.setProperty('margin-left', marginLeft || '0', 'important');
358
391
  }
@@ -58,7 +58,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
58
58
  const TABLE_INFO_TIMEOUT = 10000;
59
59
  const RENDER_EVENT_SAMPLE_RATE = 0.2;
60
60
  const packageName = "@atlaskit/renderer";
61
- const packageVersion = "132.0.1";
61
+ const packageVersion = "132.0.3";
62
62
  const setAsQueryContainerStyles = css({
63
63
  containerName: 'ak-renderer-wrapper',
64
64
  containerType: 'inline-size'
@@ -24,6 +24,10 @@ export var useMultiBodiedExtensionActions = function useMultiBodiedExtensionActi
24
24
  return false;
25
25
  },
26
26
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
27
+ reorderChildren: function reorderChildren(_fromIndex, _toIndex) {
28
+ return false;
29
+ },
30
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
27
31
  updateParameters: function updateParameters(_parameters) {
28
32
  return false;
29
33
  },
@@ -218,6 +218,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
218
218
  _defineProperty(_this, "updatedLayout", 'custom');
219
219
  _defineProperty(_this, "containerRef", null);
220
220
  _defineProperty(_this, "_isInsideNestedRenderer", null);
221
+ _defineProperty(_this, "_isInsideTableCell", null);
221
222
  // Stores the last computed style values from render() for use by applyNestedRendererTableFix().
222
223
  // This avoids reading from the DOM which can be stale when React removes properties between renders.
223
224
  _defineProperty(_this, "lastComputedStyle", {});
@@ -253,6 +254,10 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
253
254
  * to the handleRef prop from the overflow shadow HOC.
254
255
  */
255
256
  _defineProperty(_this, "setContainerRef", function (el) {
257
+ if (_this.containerRef !== el) {
258
+ _this._isInsideNestedRenderer = null;
259
+ _this._isInsideTableCell = null;
260
+ }
256
261
  _this.containerRef = el;
257
262
  var handleRef = _this.props.handleRef;
258
263
  if (typeof handleRef === 'function') {
@@ -368,6 +373,28 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
368
373
  return false;
369
374
  }
370
375
 
376
+ /**
377
+ * Checks if this table is inside a table cell in the DOM. The result is cached
378
+ * since a table's position in the DOM tree is stable after mount.
379
+ */
380
+ }, {
381
+ key: "isInsideTableCell",
382
+ value: function isInsideTableCell() {
383
+ if (this._isInsideTableCell !== null) {
384
+ return this._isInsideTableCell;
385
+ }
386
+ if (!this.containerRef) {
387
+ return false;
388
+ }
389
+ this._isInsideTableCell = Boolean(this.containerRef.closest('td, th'));
390
+ return this._isInsideTableCell;
391
+ }
392
+ }, {
393
+ key: "isInsideTableContext",
394
+ value: function isInsideTableContext() {
395
+ return Boolean(this.props.isInsideOfTable || this.isInsideTableCell());
396
+ }
397
+
371
398
  /**
372
399
  * For tables inside nested renderers (e.g. Include Page macro), the parent
373
400
  * renderer's CSS override forces width:100%!important and left:0!important
@@ -375,6 +402,15 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
375
402
  * style.setProperty with 'important' priority on inline styles beats
376
403
  * stylesheet !important rules per the CSS cascade.
377
404
  *
405
+ * Tables that are nested inside another table need to remain constrained by
406
+ * their table-cell context. Do not promote their width to inline !important,
407
+ * otherwise nested tables rendered through macros such as Excerpt Include can
408
+ * overflow and overlap adjacent cells.
409
+ *
410
+ * Top-level tables in nested renderers still preserve their saved width, but
411
+ * are capped to their containing block so wide tables do not escape constrained
412
+ * macro bodies such as Excerpt Include panels.
413
+ *
378
414
  * Uses lastComputedStyle (populated during render) rather than reading from
379
415
  * element.style, because React may remove properties from the DOM when their
380
416
  * values transition to undefined between renders.
@@ -385,7 +421,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
385
421
  if (!this.containerRef || !fg('platform_nested_table_style_override')) {
386
422
  return;
387
423
  }
388
- if (!this.isInsideNestedRenderer()) {
424
+ if (!this.isInsideNestedRenderer() || this.isInsideTableContext()) {
389
425
  return;
390
426
  }
391
427
  var _this$lastComputedSty = this.lastComputedStyle,
@@ -394,6 +430,7 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
394
430
  marginLeft = _this$lastComputedSty.marginLeft;
395
431
  var style = this.containerRef.style;
396
432
  style.setProperty('width', width || 'auto', 'important');
433
+ style.setProperty('max-width', '100%', 'important');
397
434
  style.setProperty('left', left || 'auto', 'important');
398
435
  style.setProperty('margin-left', marginLeft || '0', 'important');
399
436
  }
@@ -63,7 +63,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
63
63
  var TABLE_INFO_TIMEOUT = 10000;
64
64
  var RENDER_EVENT_SAMPLE_RATE = 0.2;
65
65
  var packageName = "@atlaskit/renderer";
66
- var packageVersion = "132.0.1";
66
+ var packageVersion = "132.0.3";
67
67
  var setAsQueryContainerStyles = css({
68
68
  containerName: 'ak-renderer-wrapper',
69
69
  containerType: 'inline-size'
@@ -69,6 +69,7 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
69
69
  updatedLayout: TableLayout | 'custom';
70
70
  private containerRef;
71
71
  private _isInsideNestedRenderer;
72
+ private _isInsideTableCell;
72
73
  private lastComputedStyle;
73
74
  private resizeObserver;
74
75
  private applyResizerChange;
@@ -78,6 +79,12 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
78
79
  * The result is cached since a table's position in the DOM tree is stable after mount.
79
80
  */
80
81
  private isInsideNestedRenderer;
82
+ /**
83
+ * Checks if this table is inside a table cell in the DOM. The result is cached
84
+ * since a table's position in the DOM tree is stable after mount.
85
+ */
86
+ private isInsideTableCell;
87
+ private isInsideTableContext;
81
88
  /**
82
89
  * For tables inside nested renderers (e.g. Include Page macro), the parent
83
90
  * renderer's CSS override forces width:100%!important and left:0!important
@@ -85,6 +92,15 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
85
92
  * style.setProperty with 'important' priority on inline styles beats
86
93
  * stylesheet !important rules per the CSS cascade.
87
94
  *
95
+ * Tables that are nested inside another table need to remain constrained by
96
+ * their table-cell context. Do not promote their width to inline !important,
97
+ * otherwise nested tables rendered through macros such as Excerpt Include can
98
+ * overflow and overlap adjacent cells.
99
+ *
100
+ * Top-level tables in nested renderers still preserve their saved width, but
101
+ * are capped to their containing block so wide tables do not escape constrained
102
+ * macro bodies such as Excerpt Include panels.
103
+ *
88
104
  * Uses lastComputedStyle (populated during render) rather than reading from
89
105
  * element.style, because React may remove properties from the DOM when their
90
106
  * values transition to undefined between renders.
@@ -69,6 +69,7 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
69
69
  updatedLayout: TableLayout | 'custom';
70
70
  private containerRef;
71
71
  private _isInsideNestedRenderer;
72
+ private _isInsideTableCell;
72
73
  private lastComputedStyle;
73
74
  private resizeObserver;
74
75
  private applyResizerChange;
@@ -78,6 +79,12 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
78
79
  * The result is cached since a table's position in the DOM tree is stable after mount.
79
80
  */
80
81
  private isInsideNestedRenderer;
82
+ /**
83
+ * Checks if this table is inside a table cell in the DOM. The result is cached
84
+ * since a table's position in the DOM tree is stable after mount.
85
+ */
86
+ private isInsideTableCell;
87
+ private isInsideTableContext;
81
88
  /**
82
89
  * For tables inside nested renderers (e.g. Include Page macro), the parent
83
90
  * renderer's CSS override forces width:100%!important and left:0!important
@@ -85,6 +92,15 @@ export declare class TableContainer extends React.Component<TableProps & Overflo
85
92
  * style.setProperty with 'important' priority on inline styles beats
86
93
  * stylesheet !important rules per the CSS cascade.
87
94
  *
95
+ * Tables that are nested inside another table need to remain constrained by
96
+ * their table-cell context. Do not promote their width to inline !important,
97
+ * otherwise nested tables rendered through macros such as Excerpt Include can
98
+ * overflow and overlap adjacent cells.
99
+ *
100
+ * Top-level tables in nested renderers still preserve their saved width, but
101
+ * are capped to their containing block so wide tables do not escape constrained
102
+ * macro bodies such as Excerpt Include panels.
103
+ *
88
104
  * Uses lastComputedStyle (populated during render) rather than reading from
89
105
  * element.style, because React may remove properties from the DOM when their
90
106
  * values transition to undefined between renders.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "132.0.2",
3
+ "version": "132.0.4",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -44,14 +44,14 @@
44
44
  "@atlaskit/editor-prosemirror": "^7.3.0",
45
45
  "@atlaskit/editor-shared-styles": "^3.11.0",
46
46
  "@atlaskit/editor-smart-link-draggable": "^0.5.0",
47
- "@atlaskit/emoji": "^70.15.0",
47
+ "@atlaskit/emoji": "^70.16.0",
48
48
  "@atlaskit/feature-gate-js-client": "^5.7.0",
49
49
  "@atlaskit/icon": "^35.4.0",
50
50
  "@atlaskit/link": "^3.4.0",
51
51
  "@atlaskit/link-datasource": "^5.6.0",
52
52
  "@atlaskit/link-extractors": "^2.7.0",
53
53
  "@atlaskit/linking-common": "^9.13.0",
54
- "@atlaskit/media-card": "^80.7.0",
54
+ "@atlaskit/media-card": "^80.8.0",
55
55
  "@atlaskit/media-client": "^36.3.0",
56
56
  "@atlaskit/media-client-react": "^5.2.0",
57
57
  "@atlaskit/media-common": "^13.3.0",
@@ -61,17 +61,17 @@
61
61
  "@atlaskit/platform-feature-flags": "^1.1.0",
62
62
  "@atlaskit/platform-feature-flags-react": "^0.5.0",
63
63
  "@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
64
- "@atlaskit/react-ufo": "^6.6.0",
64
+ "@atlaskit/react-ufo": "^6.7.0",
65
65
  "@atlaskit/smart-card": "^44.23.0",
66
66
  "@atlaskit/status": "^4.1.0",
67
67
  "@atlaskit/task-decision": "^20.1.0",
68
68
  "@atlaskit/theme": "^25.0.0",
69
- "@atlaskit/tmp-editor-statsig": "^89.0.0",
70
- "@atlaskit/tokens": "^13.1.0",
69
+ "@atlaskit/tmp-editor-statsig": "^90.1.0",
70
+ "@atlaskit/tokens": "^13.3.0",
71
71
  "@atlaskit/tooltip": "^22.6.0",
72
72
  "@atlaskit/visually-hidden": "^3.1.0",
73
73
  "@babel/runtime": "^7.0.0",
74
- "@compiled/react": "^0.20.0",
74
+ "@compiled/react": "patch:@compiled/react@npm%3A0.20.0#~/.yarn/patches/@compiled-react-npm-0.20.0-a771aa67a6.patch",
75
75
  "@emotion/react": "^11.7.1",
76
76
  "lodash": "^4.17.21",
77
77
  "memoize-one": "^6.0.0",
@@ -80,7 +80,7 @@
80
80
  "uuid": "^3.1.0"
81
81
  },
82
82
  "peerDependencies": {
83
- "@atlaskit/editor-common": "^115.4.0",
83
+ "@atlaskit/editor-common": "^115.7.0",
84
84
  "@atlaskit/link-provider": "^4.6.0",
85
85
  "@atlaskit/media-core": "^37.1.0",
86
86
  "react": "^18.2.0",
@@ -98,13 +98,13 @@
98
98
  "@atlaskit/media-core": "^37.1.0",
99
99
  "@atlaskit/media-integration-test-helpers": "workspace:^",
100
100
  "@atlaskit/media-test-helpers": "^41.2.0",
101
- "@atlaskit/mention": "^26.1.0",
101
+ "@atlaskit/mention": "^26.2.0",
102
102
  "@atlaskit/modal-dialog": "^15.2.0",
103
103
  "@atlaskit/navigation-system": "^9.4.0",
104
104
  "@atlaskit/profilecard": "^25.8.0",
105
105
  "@atlaskit/side-nav-items": "^1.13.0",
106
106
  "@atlaskit/util-data-test": "^18.6.0",
107
- "@atlassian/a11y-jest-testing": "^0.11.0",
107
+ "@atlassian/a11y-jest-testing": "^0.12.0",
108
108
  "@atlassian/a11y-playwright-testing": "^0.10.0",
109
109
  "@atlassian/feature-flags-test-utils": "^1.1.0",
110
110
  "@atlassian/react-compiler-gating": "workspace:^",