@atlaskit/react-ufo 4.15.9 → 4.15.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.
@@ -120,7 +120,7 @@ export var VCObserver = /*#__PURE__*/function () {
120
120
  if (devToolsEnabled && !_this.isPostInteraction) {
121
121
  window.__vcNotAvailableReason = abortReasonInfo;
122
122
  }
123
- } catch (e) {}
123
+ } catch (_unused) {}
124
124
  vcAbortedResultWithRevisions = _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [{
125
125
  revision: 'fy25.02',
126
126
  clean: false,
@@ -268,7 +268,7 @@ export var VCObserver = /*#__PURE__*/function () {
268
268
  }
269
269
  }
270
270
  }
271
- } catch (e) {
271
+ } catch (_unused2) {
272
272
  /* do nothing */
273
273
  }
274
274
  isVCClean = !abortReasonInfo;
@@ -548,7 +548,7 @@ export var VCObserver = /*#__PURE__*/function () {
548
548
  if (localHeatmap[row] === undefined) {
549
549
  try {
550
550
  this.setAbortReason(abortReason.error, time, "index - ".concat(row));
551
- } catch (e) {
551
+ } catch (_unused3) {
552
552
  this.setAbortReason(abortReason.error, time, 'row error');
553
553
  }
554
554
  return;
@@ -235,6 +235,27 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
235
235
  }
236
236
  return element;
237
237
  }
238
+ }, {
239
+ key: "findNearestPlaceholderOrContainer",
240
+ value: function findNearestPlaceholderOrContainer(element) {
241
+ var ancestor = element;
242
+ if (this.isPlaceholderIgnored(element) && element.parentElement) {
243
+ ancestor = element.parentElement;
244
+ }
245
+ var i = 0;
246
+ while (ancestor && i < ANCESTOR_LOOKUP_LIMIT) {
247
+ if (this.isPlaceholder(ancestor) || this.isPlaceholderReplacement(ancestor)) {
248
+ return ancestor;
249
+ }
250
+ if (ancestor.parentElement) {
251
+ ancestor = ancestor.parentElement;
252
+ i++;
253
+ } else {
254
+ break;
255
+ }
256
+ }
257
+ return element;
258
+ }
238
259
 
239
260
  // Validates placeholder match using asynchronous observation and resolves with the result
240
261
  }, {
@@ -297,7 +318,7 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
297
318
  }, {
298
319
  key: "validateReactComponentMatchToPlaceholderV4",
299
320
  value: function validateReactComponentMatchToPlaceholderV4(el) {
300
- el = this.findNearestPlaceholderContainerIfIgnored(el);
321
+ el = fg('platform_ufo_v4_fix_nested_ssr_placeholder') ? this.findNearestPlaceholderOrContainer(el) : this.findNearestPlaceholderContainerIfIgnored(el);
301
322
  var id = this.getPlaceholderReplacementId(el);
302
323
  return this.staticPlaceholders.has(id);
303
324
  }
@@ -31,6 +31,7 @@ export declare class SSRPlaceholderHandlers {
31
31
  isPlaceholderV4(element: HTMLElement): boolean;
32
32
  isPlaceholderReplacementV4(element: HTMLElement): boolean;
33
33
  findNearestPlaceholderContainerIfIgnored(element: HTMLElement): HTMLElement;
34
+ findNearestPlaceholderOrContainer(element: HTMLElement): HTMLElement;
34
35
  checkIfExistedAndSizeMatching(el: HTMLElement): Promise<boolean>;
35
36
  checkIfExistedAndSizeMatchingV3(el: HTMLElement): boolean;
36
37
  getSize(el: HTMLElement): Promise<Rect>;
@@ -31,6 +31,7 @@ export declare class SSRPlaceholderHandlers {
31
31
  isPlaceholderV4(element: HTMLElement): boolean;
32
32
  isPlaceholderReplacementV4(element: HTMLElement): boolean;
33
33
  findNearestPlaceholderContainerIfIgnored(element: HTMLElement): HTMLElement;
34
+ findNearestPlaceholderOrContainer(element: HTMLElement): HTMLElement;
34
35
  checkIfExistedAndSizeMatching(el: HTMLElement): Promise<boolean>;
35
36
  checkIfExistedAndSizeMatchingV3(el: HTMLElement): boolean;
36
37
  getSize(el: HTMLElement): Promise<Rect>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.15.9",
3
+ "version": "4.15.11",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -116,9 +116,6 @@
116
116
  "platform_ufo_disable_vcnext_observations": {
117
117
  "type": "boolean"
118
118
  },
119
- "platform_ufo_default_ssr_edge_timings": {
120
- "type": "boolean"
121
- },
122
119
  "platform_ufo_remove_ssr_placeholder_in_ttvc_v4": {
123
120
  "type": "boolean"
124
121
  },
@@ -131,6 +128,9 @@
131
128
  "platform_ufo_segment_critical_metrics": {
132
129
  "type": "boolean"
133
130
  },
131
+ "platform_ufo_v4_fix_nested_ssr_placeholder": {
132
+ "type": "boolean"
133
+ },
134
134
  "platform_ufo_add_segments_count_threshold": {
135
135
  "type": "boolean"
136
136
  },