@atlaskit/react-ufo 5.0.11 → 5.0.13

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,23 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 5.0.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3f0729c82ac47`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3f0729c82ac47) -
8
+ FG cleanup - platform_ufo_disable_vcnext_observations, remove getMutatedElements fn
9
+
10
+ ## 5.0.12
11
+
12
+ ### Patch Changes
13
+
14
+ - [`898be43686c8a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/898be43686c8a) -
15
+ FG cleanup - platform_ufo_fix_post_interaction_check_vc_debug
16
+ - [`36667747cf1b8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/36667747cf1b8) -
17
+ FG cleanup - platform_ufo_auto_add_ssr_entry_in_ttvc_v4
18
+ - [`18a9917b5d23d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/18a9917b5d23d) -
19
+ FG cleanup - platform_ufo_round_vc_ratios
20
+
3
21
  ## 5.0.11
4
22
 
5
23
  ### Patch Changes
@@ -349,9 +349,6 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
349
349
  }, {
350
350
  key: "getEffectiveBoundingRect",
351
351
  value: function getEffectiveBoundingRect(el) {
352
- if ((0, _platformFeatureFlags.fg)('platform_ufo_disable_vcnext_observations')) {
353
- return el.getBoundingClientRect();
354
- }
355
352
  var computedStyle = window.getComputedStyle(el);
356
353
 
357
354
  // If element has display: contents, collect bounding rect from children
@@ -298,8 +298,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
298
298
  }
299
299
 
300
300
  // From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
301
- // From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
302
- if (param.ssr && !param.includeSSRInV3 && (0, _platformFeatureFlags.fg)('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
301
+ if (param.ssr) {
303
302
  this.addSSR(param.ssr);
304
303
  }
305
304
  calculator_fy26_04 = new _fy26_.default();
@@ -79,11 +79,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
79
79
  elementName = _step2$value[0],
80
80
  rect = _step2$value[1];
81
81
  var elementArea = rect.width * rect.height;
82
- if ((0, _platformFeatureFlags.fg)('platform_ufo_round_vc_ratios')) {
83
- ratios[elementName] = roundDecimal(elementArea / totalViewportArea);
84
- } else {
85
- ratios[elementName] = elementArea / totalViewportArea;
86
- }
82
+ ratios[elementName] = roundDecimal(elementArea / totalViewportArea);
87
83
  }
88
84
  } catch (err) {
89
85
  _iterator2.e(err);
@@ -123,8 +119,8 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
123
119
  key: "calculateWithDebugInfo",
124
120
  value: function () {
125
121
  var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio) {
126
- var _window, _window2, _window6, _window8;
127
- var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, ssrRatio, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
122
+ var _window, _window2, _window3, _window4, _window6;
123
+ var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, ssrRatio, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window5, _window5$__ufo_devtoo, _window7, _window7$__on_ufo_vc_;
128
124
  return _regenerator.default.wrap(function _callee$(_context) {
129
125
  while (1) switch (_context.prev = _context.next) {
130
126
  case 0:
@@ -244,10 +240,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
244
240
  });
245
241
  }) : []; // If 3p metric enabled - calculate the debug details
246
242
  shouldCalculate3p = include3p && (0, _platformFeatureFlags.fg)('platform_ufo_enable_ttai_with_3p'); // Only calculate enhanced debug details if devtool callbacks exist
247
- shouldCalculateDebugDetails = (!isPostInteraction || shouldCalculate3p) && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function');
248
- if ((0, _platformFeatureFlags.fg)('platform_ufo_fix_post_interaction_check_vc_debug')) {
249
- shouldCalculateDebugDetails = !isPostInteraction && (typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.__on_ufo_vc_debug_data_ready) === 'function' || typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__ufo_devtool_vc_3p_debug_data) === 'function');
250
- }
243
+ shouldCalculateDebugDetails = !isPostInteraction && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function' || typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_vc_3p_debug_data) === 'function');
251
244
  if (shouldCalculateDebugDetails && allEntries && vcLogs) {
252
245
  // Pre-sort vcLogs by time for efficient lookups
253
246
  sortedVcLogs = (0, _toConsumableArray2.default)(vcLogs).sort(function (a, b) {
@@ -352,18 +345,18 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
352
345
  }
353
346
 
354
347
  // Handle devtool callback
355
- if (v3RevisionDebugDetails && typeof ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
348
+ if (v3RevisionDebugDetails && typeof ((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
356
349
  try {
357
- (_window7 = window) === null || _window7 === void 0 || (_window7$__ufo_devtoo = _window7.__ufo_devtool_onVCRevisionReady__) === null || _window7$__ufo_devtoo === void 0 || _window7$__ufo_devtoo.call(_window7, v3RevisionDebugDetails);
350
+ (_window5 = window) === null || _window5 === void 0 || (_window5$__ufo_devtoo = _window5.__ufo_devtool_onVCRevisionReady__) === null || _window5$__ufo_devtoo === void 0 || _window5$__ufo_devtoo.call(_window5, v3RevisionDebugDetails);
358
351
  } catch (e) {
359
352
  // if any error communicating with devtool, we don't want to break the app
360
353
  // eslint-disable-next-line no-console
361
354
  console.error('Error in onVCRevisionReady', e);
362
355
  }
363
356
  }
364
- if (v3RevisionDebugDetails && typeof ((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
357
+ if (v3RevisionDebugDetails && typeof ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
365
358
  try {
366
- (_window9 = window) === null || _window9 === void 0 || (_window9$__on_ufo_vc_ = _window9.__on_ufo_vc_debug_data_ready) === null || _window9$__on_ufo_vc_ === void 0 || _window9$__on_ufo_vc_.call(_window9, v3RevisionDebugDetails);
359
+ (_window7 = window) === null || _window7 === void 0 || (_window7$__on_ufo_vc_ = _window7.__on_ufo_vc_debug_data_ready) === null || _window7$__on_ufo_vc_ === void 0 || _window7$__on_ufo_vc_.call(_window7, v3RevisionDebugDetails);
367
360
  } catch (e) {
368
361
  // eslint-disable-next-line no-console
369
362
  console.error('Error in onVCRevisionReady', e);
@@ -382,7 +375,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
382
375
  vcDetails: vcDetails,
383
376
  ssrRatio: ssrRatio
384
377
  });
385
- case 43:
378
+ case 42:
386
379
  case "end":
387
380
  return _context.stop();
388
381
  }
@@ -296,9 +296,6 @@ export class SSRPlaceholderHandlers {
296
296
  * by collecting dimensions from their children instead
297
297
  */
298
298
  getEffectiveBoundingRect(el) {
299
- if (fg('platform_ufo_disable_vcnext_observations')) {
300
- return el.getBoundingClientRect();
301
- }
302
299
  const computedStyle = window.getComputedStyle(el);
303
300
 
304
301
  // If element has display: contents, collect bounding rect from children
@@ -247,8 +247,7 @@ export default class VCObserverNew {
247
247
  }
248
248
 
249
249
  // From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
250
- // From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
251
- if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
250
+ if (param.ssr) {
252
251
  this.addSSR(param.ssr);
253
252
  }
254
253
  const calculator_fy26_04 = new VCCalculator_FY26_04();
@@ -40,11 +40,7 @@ export default class AbstractVCCalculatorBase {
40
40
  }
41
41
  for (const [elementName, rect] of elementRects) {
42
42
  const elementArea = rect.width * rect.height;
43
- if (fg('platform_ufo_round_vc_ratios')) {
44
- ratios[elementName] = roundDecimal(elementArea / totalViewportArea);
45
- } else {
46
- ratios[elementName] = elementArea / totalViewportArea;
47
- }
43
+ ratios[elementName] = roundDecimal(elementArea / totalViewportArea);
48
44
  }
49
45
  return ratios;
50
46
  }
@@ -65,7 +61,7 @@ export default class AbstractVCCalculatorBase {
65
61
  return labelStacks;
66
62
  }
67
63
  async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio) {
68
- var _window, _window2, _window6, _window8;
64
+ var _window, _window2, _window3, _window4, _window6;
69
65
  const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99, 100];
70
66
  const viewportEntries = this.filterViewportEntries(filteredEntries);
71
67
  const vcLogs = await calculateTTVCPercentilesWithDebugInfo({
@@ -153,11 +149,8 @@ export default class AbstractVCCalculatorBase {
153
149
  // If 3p metric enabled - calculate the debug details
154
150
  const shouldCalculate3p = include3p && fg('platform_ufo_enable_ttai_with_3p');
155
151
  // Only calculate enhanced debug details if devtool callbacks exist
156
- let shouldCalculateDebugDetails = (!isPostInteraction || shouldCalculate3p) && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function');
157
- if (fg('platform_ufo_fix_post_interaction_check_vc_debug')) {
158
- var _window3, _window4, _window5;
159
- shouldCalculateDebugDetails = !isPostInteraction && (typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.__on_ufo_vc_debug_data_ready) === 'function' || typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__ufo_devtool_vc_3p_debug_data) === 'function');
160
- }
152
+
153
+ const shouldCalculateDebugDetails = !isPostInteraction && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function' || typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_vc_3p_debug_data) === 'function');
161
154
  if (shouldCalculateDebugDetails && allEntries && vcLogs) {
162
155
  // Pre-sort vcLogs by time for efficient lookups
163
156
  const sortedVcLogs = [...vcLogs].sort((a, b) => a.time - b.time);
@@ -240,20 +233,20 @@ export default class AbstractVCCalculatorBase {
240
233
  }
241
234
 
242
235
  // Handle devtool callback
243
- if (v3RevisionDebugDetails && typeof ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
236
+ if (v3RevisionDebugDetails && typeof ((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
244
237
  try {
245
- var _window7, _window7$__ufo_devtoo;
246
- (_window7 = window) === null || _window7 === void 0 ? void 0 : (_window7$__ufo_devtoo = _window7.__ufo_devtool_onVCRevisionReady__) === null || _window7$__ufo_devtoo === void 0 ? void 0 : _window7$__ufo_devtoo.call(_window7, v3RevisionDebugDetails);
238
+ var _window5, _window5$__ufo_devtoo;
239
+ (_window5 = window) === null || _window5 === void 0 ? void 0 : (_window5$__ufo_devtoo = _window5.__ufo_devtool_onVCRevisionReady__) === null || _window5$__ufo_devtoo === void 0 ? void 0 : _window5$__ufo_devtoo.call(_window5, v3RevisionDebugDetails);
247
240
  } catch (e) {
248
241
  // if any error communicating with devtool, we don't want to break the app
249
242
  // eslint-disable-next-line no-console
250
243
  console.error('Error in onVCRevisionReady', e);
251
244
  }
252
245
  }
253
- if (v3RevisionDebugDetails && typeof ((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
246
+ if (v3RevisionDebugDetails && typeof ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
254
247
  try {
255
- var _window9, _window9$__on_ufo_vc_;
256
- (_window9 = window) === null || _window9 === void 0 ? void 0 : (_window9$__on_ufo_vc_ = _window9.__on_ufo_vc_debug_data_ready) === null || _window9$__on_ufo_vc_ === void 0 ? void 0 : _window9$__on_ufo_vc_.call(_window9, v3RevisionDebugDetails);
248
+ var _window7, _window7$__on_ufo_vc_;
249
+ (_window7 = window) === null || _window7 === void 0 ? void 0 : (_window7$__on_ufo_vc_ = _window7.__on_ufo_vc_debug_data_ready) === null || _window7$__on_ufo_vc_ === void 0 ? void 0 : _window7$__on_ufo_vc_.call(_window7, v3RevisionDebugDetails);
257
250
  } catch (e) {
258
251
  // eslint-disable-next-line no-console
259
252
  console.error('Error in onVCRevisionReady', e);
@@ -342,9 +342,6 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
342
342
  }, {
343
343
  key: "getEffectiveBoundingRect",
344
344
  value: function getEffectiveBoundingRect(el) {
345
- if (fg('platform_ufo_disable_vcnext_observations')) {
346
- return el.getBoundingClientRect();
347
- }
348
345
  var computedStyle = window.getComputedStyle(el);
349
346
 
350
347
  // If element has display: contents, collect bounding rect from children
@@ -291,8 +291,7 @@ var VCObserverNew = /*#__PURE__*/function () {
291
291
  }
292
292
 
293
293
  // From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
294
- // From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
295
- if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
294
+ if (param.ssr) {
296
295
  this.addSSR(param.ssr);
297
296
  }
298
297
  calculator_fy26_04 = new VCCalculator_FY26_04();
@@ -73,11 +73,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
73
73
  elementName = _step2$value[0],
74
74
  rect = _step2$value[1];
75
75
  var elementArea = rect.width * rect.height;
76
- if (fg('platform_ufo_round_vc_ratios')) {
77
- ratios[elementName] = roundDecimal(elementArea / totalViewportArea);
78
- } else {
79
- ratios[elementName] = elementArea / totalViewportArea;
80
- }
76
+ ratios[elementName] = roundDecimal(elementArea / totalViewportArea);
81
77
  }
82
78
  } catch (err) {
83
79
  _iterator2.e(err);
@@ -117,8 +113,8 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
117
113
  key: "calculateWithDebugInfo",
118
114
  value: function () {
119
115
  var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio) {
120
- var _window, _window2, _window6, _window8;
121
- var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, ssrRatio, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
116
+ var _window, _window2, _window3, _window4, _window6;
117
+ var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, ssrRatio, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _window5, _window5$__ufo_devtoo, _window7, _window7$__on_ufo_vc_;
122
118
  return _regeneratorRuntime.wrap(function _callee$(_context) {
123
119
  while (1) switch (_context.prev = _context.next) {
124
120
  case 0:
@@ -238,10 +234,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
238
234
  });
239
235
  }) : []; // If 3p metric enabled - calculate the debug details
240
236
  shouldCalculate3p = include3p && fg('platform_ufo_enable_ttai_with_3p'); // Only calculate enhanced debug details if devtool callbacks exist
241
- shouldCalculateDebugDetails = (!isPostInteraction || shouldCalculate3p) && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function');
242
- if (fg('platform_ufo_fix_post_interaction_check_vc_debug')) {
243
- shouldCalculateDebugDetails = !isPostInteraction && (typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.__on_ufo_vc_debug_data_ready) === 'function' || typeof ((_window5 = window) === null || _window5 === void 0 ? void 0 : _window5.__ufo_devtool_vc_3p_debug_data) === 'function');
244
- }
237
+ shouldCalculateDebugDetails = !isPostInteraction && (typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.__ufo_devtool_onVCRevisionReady__) === 'function' || typeof ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.__on_ufo_vc_debug_data_ready) === 'function' || typeof ((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.__ufo_devtool_vc_3p_debug_data) === 'function');
245
238
  if (shouldCalculateDebugDetails && allEntries && vcLogs) {
246
239
  // Pre-sort vcLogs by time for efficient lookups
247
240
  sortedVcLogs = _toConsumableArray(vcLogs).sort(function (a, b) {
@@ -346,18 +339,18 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
346
339
  }
347
340
 
348
341
  // Handle devtool callback
349
- if (v3RevisionDebugDetails && typeof ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
342
+ if (v3RevisionDebugDetails && typeof ((_window4 = window) === null || _window4 === void 0 ? void 0 : _window4.__ufo_devtool_onVCRevisionReady__) === 'function' && !include3p) {
350
343
  try {
351
- (_window7 = window) === null || _window7 === void 0 || (_window7$__ufo_devtoo = _window7.__ufo_devtool_onVCRevisionReady__) === null || _window7$__ufo_devtoo === void 0 || _window7$__ufo_devtoo.call(_window7, v3RevisionDebugDetails);
344
+ (_window5 = window) === null || _window5 === void 0 || (_window5$__ufo_devtoo = _window5.__ufo_devtool_onVCRevisionReady__) === null || _window5$__ufo_devtoo === void 0 || _window5$__ufo_devtoo.call(_window5, v3RevisionDebugDetails);
352
345
  } catch (e) {
353
346
  // if any error communicating with devtool, we don't want to break the app
354
347
  // eslint-disable-next-line no-console
355
348
  console.error('Error in onVCRevisionReady', e);
356
349
  }
357
350
  }
358
- if (v3RevisionDebugDetails && typeof ((_window8 = window) === null || _window8 === void 0 ? void 0 : _window8.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
351
+ if (v3RevisionDebugDetails && typeof ((_window6 = window) === null || _window6 === void 0 ? void 0 : _window6.__on_ufo_vc_debug_data_ready) === 'function' && !include3p) {
359
352
  try {
360
- (_window9 = window) === null || _window9 === void 0 || (_window9$__on_ufo_vc_ = _window9.__on_ufo_vc_debug_data_ready) === null || _window9$__on_ufo_vc_ === void 0 || _window9$__on_ufo_vc_.call(_window9, v3RevisionDebugDetails);
353
+ (_window7 = window) === null || _window7 === void 0 || (_window7$__on_ufo_vc_ = _window7.__on_ufo_vc_debug_data_ready) === null || _window7$__on_ufo_vc_ === void 0 || _window7$__on_ufo_vc_.call(_window7, v3RevisionDebugDetails);
361
354
  } catch (e) {
362
355
  // eslint-disable-next-line no-console
363
356
  console.error('Error in onVCRevisionReady', e);
@@ -376,7 +369,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
376
369
  vcDetails: vcDetails,
377
370
  ssrRatio: ssrRatio
378
371
  });
379
- case 43:
372
+ case 42:
380
373
  case "end":
381
374
  return _context.stop();
382
375
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "5.0.11",
3
+ "version": "5.0.13",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -109,24 +109,15 @@
109
109
  "platform_ufo_assets_check_for_nan": {
110
110
  "type": "boolean"
111
111
  },
112
- "platform_ufo_fix_post_interaction_check_vc_debug": {
113
- "type": "boolean"
114
- },
115
112
  "platform_ufo_data-is-hovered-v4-exclusion": {
116
113
  "type": "boolean"
117
114
  },
118
115
  "platform_ufo_critical_metrics_payload": {
119
116
  "type": "boolean"
120
117
  },
121
- "platform_ufo_disable_vcnext_observations": {
122
- "type": "boolean"
123
- },
124
118
  "platform_ufo_exclude_3p_elements_from_ttai": {
125
119
  "type": "boolean"
126
120
  },
127
- "platform_ufo_round_vc_ratios": {
128
- "type": "boolean"
129
- },
130
121
  "platform_ufo_exclude_3p_elements_from_ttvc": {
131
122
  "type": "boolean"
132
123
  },
@@ -184,9 +175,6 @@
184
175
  "platform_ufo_exclude_3p_attribute_changes": {
185
176
  "type": "boolean"
186
177
  },
187
- "platform_ufo_auto_add_ssr_entry_in_ttvc_v4": {
188
- "type": "boolean"
189
- },
190
178
  "platform_ufo_use_native_page_visibility_api": {
191
179
  "type": "boolean"
192
180
  },
@@ -1,68 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getMutatedElements = getMutatedElements;
8
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
11
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
- function isElementStyledWithDisplayContents(element) {
14
- var _window2;
15
- // To minimise calling `getComputedStyle`, we are making an assumption that if an element is from the Entrypoints framework, then it will have `display: contents` styling
16
- // as per https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/e4ccf437262ef4c0fd3c651ffb7ad4770b15aed4/jira/src/packages/platform/entry-points/entry-point-placeholder/src/index.tsx#lines-136
17
- if ((0, _platformFeatureFlags.fg)('platform_ufo_detect_entrypoint_parent')) {
18
- var _window;
19
- if (element.hasAttribute('data-ep-placeholder-id')) {
20
- return true;
21
- }
22
- return ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(element)) === null || _window === void 0 ? void 0 : _window.display) === 'contents';
23
- }
24
- return ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.getComputedStyle(element)) === null || _window2 === void 0 ? void 0 : _window2.display) === 'contents';
25
- }
26
- var MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED = 3;
27
- function getMutatedElements(element) {
28
- var depthLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
29
- if ((0, _platformFeatureFlags.fg)('platform_ufo_disable_vcnext_observations')) {
30
- return [{
31
- element: element,
32
- isDisplayContentsElementChildren: false
33
- }];
34
- }
35
- if (isElementStyledWithDisplayContents(element)) {
36
- var mutatedElements = [];
37
- var nestedDisplayContentsElementChildren = [];
38
- var _iterator = _createForOfIteratorHelper(element.children),
39
- _step;
40
- try {
41
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
42
- var child = _step.value;
43
- if (isElementStyledWithDisplayContents(child)) {
44
- nestedDisplayContentsElementChildren.push(child);
45
- }
46
- mutatedElements.push({
47
- element: child,
48
- isDisplayContentsElementChildren: true
49
- });
50
- }
51
- } catch (err) {
52
- _iterator.e(err);
53
- } finally {
54
- _iterator.f();
55
- }
56
- if (depthLevel < MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED && nestedDisplayContentsElementChildren.length > 0) {
57
- return [].concat(mutatedElements, (0, _toConsumableArray2.default)(nestedDisplayContentsElementChildren.map(function (element) {
58
- return getMutatedElements(element, depthLevel + 1);
59
- }).flat()));
60
- }
61
- return mutatedElements;
62
- } else {
63
- return [{
64
- element: element,
65
- isDisplayContentsElementChildren: false
66
- }];
67
- }
68
- }
@@ -1,45 +0,0 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
- function isElementStyledWithDisplayContents(element) {
3
- var _window2, _window2$getComputedS;
4
- // To minimise calling `getComputedStyle`, we are making an assumption that if an element is from the Entrypoints framework, then it will have `display: contents` styling
5
- // as per https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/e4ccf437262ef4c0fd3c651ffb7ad4770b15aed4/jira/src/packages/platform/entry-points/entry-point-placeholder/src/index.tsx#lines-136
6
- if (fg('platform_ufo_detect_entrypoint_parent')) {
7
- var _window, _window$getComputedSt;
8
- if (element.hasAttribute('data-ep-placeholder-id')) {
9
- return true;
10
- }
11
- return ((_window = window) === null || _window === void 0 ? void 0 : (_window$getComputedSt = _window.getComputedStyle(element)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.display) === 'contents';
12
- }
13
- return ((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$getComputedS = _window2.getComputedStyle(element)) === null || _window2$getComputedS === void 0 ? void 0 : _window2$getComputedS.display) === 'contents';
14
- }
15
- const MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED = 3;
16
- export function getMutatedElements(element, depthLevel = 0) {
17
- if (fg('platform_ufo_disable_vcnext_observations')) {
18
- return [{
19
- element,
20
- isDisplayContentsElementChildren: false
21
- }];
22
- }
23
- if (isElementStyledWithDisplayContents(element)) {
24
- const mutatedElements = [];
25
- const nestedDisplayContentsElementChildren = [];
26
- for (const child of element.children) {
27
- if (isElementStyledWithDisplayContents(child)) {
28
- nestedDisplayContentsElementChildren.push(child);
29
- }
30
- mutatedElements.push({
31
- element: child,
32
- isDisplayContentsElementChildren: true
33
- });
34
- }
35
- if (depthLevel < MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED && nestedDisplayContentsElementChildren.length > 0) {
36
- return [...mutatedElements, ...nestedDisplayContentsElementChildren.map(element => getMutatedElements(element, depthLevel + 1)).flat()];
37
- }
38
- return mutatedElements;
39
- } else {
40
- return [{
41
- element,
42
- isDisplayContentsElementChildren: false
43
- }];
44
- }
45
- }
@@ -1,61 +0,0 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
3
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
- import { fg } from '@atlaskit/platform-feature-flags';
6
- function isElementStyledWithDisplayContents(element) {
7
- var _window2;
8
- // To minimise calling `getComputedStyle`, we are making an assumption that if an element is from the Entrypoints framework, then it will have `display: contents` styling
9
- // as per https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/e4ccf437262ef4c0fd3c651ffb7ad4770b15aed4/jira/src/packages/platform/entry-points/entry-point-placeholder/src/index.tsx#lines-136
10
- if (fg('platform_ufo_detect_entrypoint_parent')) {
11
- var _window;
12
- if (element.hasAttribute('data-ep-placeholder-id')) {
13
- return true;
14
- }
15
- return ((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(element)) === null || _window === void 0 ? void 0 : _window.display) === 'contents';
16
- }
17
- return ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.getComputedStyle(element)) === null || _window2 === void 0 ? void 0 : _window2.display) === 'contents';
18
- }
19
- var MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED = 3;
20
- export function getMutatedElements(element) {
21
- var depthLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
22
- if (fg('platform_ufo_disable_vcnext_observations')) {
23
- return [{
24
- element: element,
25
- isDisplayContentsElementChildren: false
26
- }];
27
- }
28
- if (isElementStyledWithDisplayContents(element)) {
29
- var mutatedElements = [];
30
- var nestedDisplayContentsElementChildren = [];
31
- var _iterator = _createForOfIteratorHelper(element.children),
32
- _step;
33
- try {
34
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
35
- var child = _step.value;
36
- if (isElementStyledWithDisplayContents(child)) {
37
- nestedDisplayContentsElementChildren.push(child);
38
- }
39
- mutatedElements.push({
40
- element: child,
41
- isDisplayContentsElementChildren: true
42
- });
43
- }
44
- } catch (err) {
45
- _iterator.e(err);
46
- } finally {
47
- _iterator.f();
48
- }
49
- if (depthLevel < MAX_NESTED_LEVELS_OF_DISPLAY_CONTENT_ELEMENTS_HANDLED && nestedDisplayContentsElementChildren.length > 0) {
50
- return [].concat(mutatedElements, _toConsumableArray(nestedDisplayContentsElementChildren.map(function (element) {
51
- return getMutatedElements(element, depthLevel + 1);
52
- }).flat()));
53
- }
54
- return mutatedElements;
55
- } else {
56
- return [{
57
- element: element,
58
- isDisplayContentsElementChildren: false
59
- }];
60
- }
61
- }
@@ -1,6 +0,0 @@
1
- type MutatedElement = {
2
- isDisplayContentsElementChildren: boolean;
3
- element: Element;
4
- };
5
- export declare function getMutatedElements(element: Element, depthLevel?: number): MutatedElement[];
6
- export {};
@@ -1,6 +0,0 @@
1
- type MutatedElement = {
2
- isDisplayContentsElementChildren: boolean;
3
- element: Element;
4
- };
5
- export declare function getMutatedElements(element: Element, depthLevel?: number): MutatedElement[];
6
- export {};