@atlaskit/react-ufo 3.13.0 → 3.13.1

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/config/index.js +15 -20
  3. package/dist/cjs/create-payload/utils/get-vc-metrics.js +5 -44
  4. package/dist/cjs/vc/index.js +49 -101
  5. package/dist/cjs/vc/vc-observer/getVCRevisionsData.js +13 -67
  6. package/dist/cjs/vc/vc-observer/index.js +27 -107
  7. package/dist/es2019/config/index.js +18 -23
  8. package/dist/es2019/create-payload/utils/get-vc-metrics.js +12 -41
  9. package/dist/es2019/vc/index.js +44 -88
  10. package/dist/es2019/vc/vc-observer/getVCRevisionsData.js +15 -71
  11. package/dist/es2019/vc/vc-observer/index.js +5 -87
  12. package/dist/esm/config/index.js +15 -20
  13. package/dist/esm/create-payload/utils/get-vc-metrics.js +6 -45
  14. package/dist/esm/vc/index.js +49 -101
  15. package/dist/esm/vc/vc-observer/getVCRevisionsData.js +13 -67
  16. package/dist/esm/vc/vc-observer/index.js +27 -107
  17. package/dist/types/common/vc/types.d.ts +0 -2
  18. package/dist/types/create-post-interaction-log-payload/index.d.ts +1 -1
  19. package/dist/types/vc/vc-observer/getVCRevisionsData.d.ts +2 -17
  20. package/dist/types/vc/vc-observer/index.d.ts +0 -4
  21. package/dist/types-ts4.5/common/vc/types.d.ts +0 -2
  22. package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +1 -1
  23. package/dist/types-ts4.5/vc/vc-observer/getVCRevisionsData.d.ts +2 -17
  24. package/dist/types-ts4.5/vc/vc-observer/index.d.ts +0 -4
  25. package/package.json +1 -4
  26. package/dist/cjs/vc/vc-observer/heatmap/heatmap.js +0 -281
  27. package/dist/cjs/vc/vc-observer/revisions/ViewportUpdateClassifier.js +0 -68
  28. package/dist/cjs/vc/vc-observer/revisions/fy25_01.js +0 -76
  29. package/dist/cjs/vc/vc-observer/revisions/fy25_02.js +0 -59
  30. package/dist/cjs/vc/vc-observer/revisions/revisions.js +0 -24
  31. package/dist/cjs/vc/vc-observer/revisions/types.js +0 -5
  32. package/dist/es2019/vc/vc-observer/heatmap/heatmap.js +0 -247
  33. package/dist/es2019/vc/vc-observer/revisions/ViewportUpdateClassifier.js +0 -48
  34. package/dist/es2019/vc/vc-observer/revisions/fy25_01.js +0 -55
  35. package/dist/es2019/vc/vc-observer/revisions/fy25_02.js +0 -35
  36. package/dist/es2019/vc/vc-observer/revisions/revisions.js +0 -18
  37. package/dist/es2019/vc/vc-observer/revisions/types.js +0 -1
  38. package/dist/esm/vc/vc-observer/heatmap/heatmap.js +0 -274
  39. package/dist/esm/vc/vc-observer/revisions/ViewportUpdateClassifier.js +0 -61
  40. package/dist/esm/vc/vc-observer/revisions/fy25_01.js +0 -69
  41. package/dist/esm/vc/vc-observer/revisions/fy25_02.js +0 -52
  42. package/dist/esm/vc/vc-observer/revisions/revisions.js +0 -18
  43. package/dist/esm/vc/vc-observer/revisions/types.js +0 -1
  44. package/dist/types/vc/vc-observer/heatmap/heatmap.d.ts +0 -79
  45. package/dist/types/vc/vc-observer/revisions/ViewportUpdateClassifier.d.ts +0 -31
  46. package/dist/types/vc/vc-observer/revisions/fy25_01.d.ts +0 -13
  47. package/dist/types/vc/vc-observer/revisions/fy25_02.d.ts +0 -16
  48. package/dist/types/vc/vc-observer/revisions/revisions.d.ts +0 -2
  49. package/dist/types/vc/vc-observer/revisions/types.d.ts +0 -28
  50. package/dist/types-ts4.5/vc/vc-observer/heatmap/heatmap.d.ts +0 -79
  51. package/dist/types-ts4.5/vc/vc-observer/revisions/ViewportUpdateClassifier.d.ts +0 -31
  52. package/dist/types-ts4.5/vc/vc-observer/revisions/fy25_01.d.ts +0 -13
  53. package/dist/types-ts4.5/vc/vc-observer/revisions/fy25_02.d.ts +0 -16
  54. package/dist/types-ts4.5/vc/vc-observer/revisions/revisions.d.ts +0 -2
  55. package/dist/types-ts4.5/vc/vc-observer/revisions/types.d.ts +0 -28
@@ -2,10 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
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
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
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
5
  import { isVCRevisionEnabled } from '../../config';
7
6
  import { getPageVisibilityState } from '../../hidden-timing';
8
- import { getRevisions } from './revisions/revisions';
9
7
  var VCParts = ['25', '50', '75', '80', '85', '90', '95', '98', '99'];
10
8
  var READONLY_EMPTY_ARRAY = Array.from({
11
9
  length: 0
@@ -43,80 +41,28 @@ export function getVCRevisionsData(_ref) {
43
41
  interaction = _ref.interaction,
44
42
  isVCClean = _ref.isVCClean,
45
43
  isEventAborted = _ref.isEventAborted,
46
- multiHeatmap = _ref.multiHeatmap,
47
- ssr = _ref.ssr,
48
44
  calculatedVC = _ref.calculatedVC,
49
45
  calculatedVCNext = _ref.calculatedVCNext,
50
46
  experienceKey = _ref.experienceKey;
51
- var isTTVCv3Enabled = fg('platform_ufo_vc_enable_revisions_by_experience') ? isVCRevisionEnabled('fy25.03', experienceKey) : isVCRevisionEnabled('fy25.03');
52
-
53
- // As part of `platform_ufo_vc_enable_revisions_by_experience`, we are looking to turn off the `multiHeatmap` branch of code
54
- // for calculating TTVC, and instead rely on existing values already available, e.g. `calculatedVC` and `calculatedVCNext`
55
- if (!isTTVCv3Enabled && !fg('platform_ufo_vc_enable_revisions_by_experience')) {
56
- if (!multiHeatmap) {
57
- return null;
58
- }
59
- return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), multiHeatmap === null || multiHeatmap === void 0 ? void 0 : multiHeatmap.getPayloadShapedData({
60
- VCParts: VCParts.map(function (v) {
61
- return parseInt(v);
62
- }),
63
- VCCalculationMethods: getRevisions().map(function (_ref2) {
64
- var classifier = _ref2.classifier;
65
- return classifier.VCCalculationMethod;
66
- }),
67
- filterComponentsLog: getRevisions().map(function (_ref3) {
68
- var classifier = _ref3.classifier;
69
- return classifier.filterComponentsLog;
70
- }),
71
- isEventAborted: isEventAborted,
72
- interactionStart: interaction.start,
73
- ttai: interaction.end,
74
- ssr: ssr,
75
- clean: isVCClean
76
- }));
77
- }
78
47
  var pageVisibilityUpToTTAI = getPageVisibilityState(interaction.start, interaction.end);
79
48
  var isVisiblePageVisibleUpToTTAI = pageVisibilityUpToTTAI === 'visible';
80
49
  var shouldHaveVCmetric = isVCClean && !isEventAborted && isVisiblePageVisibleUpToTTAI;
81
- if (fg('platform_ufo_vc_enable_revisions_by_experience')) {
82
- var availableVCRevisionPayloads = [];
83
- if (isVCRevisionEnabled('fy25.01', experienceKey)) {
84
- availableVCRevisionPayloads.push({
85
- revision: 'fy25.01',
86
- clean: isVCClean,
87
- 'metric:vc90': shouldHaveVCmetric ? calculatedVC.VC['90'] : null,
88
- vcDetails: createVCDetails(calculatedVC, shouldHaveVCmetric)
89
- });
90
- }
91
- if (isVCRevisionEnabled('fy25.02', experienceKey)) {
92
- availableVCRevisionPayloads.push({
93
- revision: 'fy25.02',
94
- clean: isVCClean,
95
- 'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
96
- vcDetails: createVCDetails(calculatedVCNext, shouldHaveVCmetric)
97
- });
98
- }
99
- return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), availableVCRevisionPayloads);
100
- } else {
101
- // Create the V2 revision object which is always needed
102
- var ttvcV2Revision = {
103
- revision: 'fy25.02',
104
- clean: isVCClean,
105
- 'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
106
- vcDetails: createVCDetails(calculatedVCNext, shouldHaveVCmetric)
107
- };
108
- var isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01');
109
- if (isTTVCv1Disabled) {
110
- return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [ttvcV2Revision]);
111
- }
112
-
113
- // Only create ttvcV1Revision when we're actually going to use it
114
- var ttvcV1Revision = {
50
+ var availableVCRevisionPayloads = [];
51
+ if (isVCRevisionEnabled('fy25.01', experienceKey)) {
52
+ availableVCRevisionPayloads.push({
115
53
  revision: 'fy25.01',
116
54
  clean: isVCClean,
117
55
  'metric:vc90': shouldHaveVCmetric ? calculatedVC.VC['90'] : null,
118
56
  vcDetails: createVCDetails(calculatedVC, shouldHaveVCmetric)
119
- };
120
- return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), [ttvcV1Revision, ttvcV2Revision]);
57
+ });
58
+ }
59
+ if (isVCRevisionEnabled('fy25.02', experienceKey)) {
60
+ availableVCRevisionPayloads.push({
61
+ revision: 'fy25.02',
62
+ clean: isVCClean,
63
+ 'metric:vc90': shouldHaveVCmetric ? calculatedVCNext.VC['90'] : null,
64
+ vcDetails: createVCDetails(calculatedVCNext, shouldHaveVCmetric)
65
+ });
121
66
  }
67
+ return _defineProperty({}, "".concat(fullPrefix, "vc:rev"), availableVCRevisionPayloads);
122
68
  }
@@ -16,9 +16,7 @@ import { attachAbortListeners } from './attachAbortListeners';
16
16
  import { getVCRevisionDebugDetails } from './getVCRevisionDebugDetails';
17
17
  import { getVCRevisionsData } from './getVCRevisionsData';
18
18
  import { getViewportHeight, getViewportWidth } from './getViewport';
19
- import { MultiRevisionHeatmap } from './heatmap/heatmap';
20
19
  import { Observers } from './observers';
21
- import { getRevisions } from './revisions/revisions';
22
20
  var abortReason = {
23
21
  scroll: 'scroll',
24
22
  keypress: 'keypress',
@@ -56,7 +54,6 @@ export var VCObserver = /*#__PURE__*/function () {
56
54
  });
57
55
  /* heatmap */
58
56
  _defineProperty(this, "arraySize", 0);
59
- _defineProperty(this, "multiHeatmap", null);
60
57
  _defineProperty(this, "componentsLog", {});
61
58
  _defineProperty(this, "vcRatios", {});
62
59
  _defineProperty(this, "active", false);
@@ -88,7 +85,6 @@ export var VCObserver = /*#__PURE__*/function () {
88
85
  abortReason: _objectSpread({}, _this.abortReason),
89
86
  heatmap: _this.heatmap,
90
87
  heatmapNext: _this.heatmapNext,
91
- multiHeatmap: _this.multiHeatmap,
92
88
  outOfBoundaryInfo: _this.outOfBoundaryInfo,
93
89
  totalTime: Math.round(_this.totalTime + _this.observers.getTotalTime()),
94
90
  componentsLog: _objectSpread({}, _this.componentsLog),
@@ -100,7 +96,7 @@ export var VCObserver = /*#__PURE__*/function () {
100
96
  });
101
97
  _defineProperty(this, "getVCResult", /*#__PURE__*/function () {
102
98
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
103
- var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, multiHeatmap, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, _ufo_devtool_onVCRev2, _ref10, _ufo_devtool_onVCRev, _ref9, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
99
+ var start, stop, tti, prefix, ssr, vc, isEventAborted, experienceKey, interactionId, startTime, fullPrefix, rawData, abortReason, abortReasonInfo, heatmap, heatmapNext, outOfBoundaryInfo, totalTime, componentsLog, viewport, devToolsEnabled, ratios, isTTVCv1Disabled, vcAbortedResultWithRevisions, ttvcV1Result, VC, VCBox, VCEntries, totalPainted, _componentsLog, vcNext, outOfBoundary, stopTime, ttvcV1DevToolInfo, ttvcV2DevToolInfo, _ufo_devtool_onVCRev2, _ref10, _ufo_devtool_onVCRev, _ref9, isVCClean, revisionsData, speedIndex, isTTVCv3Enabled;
104
100
  return _regeneratorRuntime.wrap(function _callee$(_context) {
105
101
  while (1) switch (_context.prev = _context.next) {
106
102
  case 0:
@@ -114,8 +110,8 @@ export var VCObserver = /*#__PURE__*/function () {
114
110
  }
115
111
  return _context.abrupt("return", {});
116
112
  case 6:
117
- abortReason = rawData.abortReason, abortReasonInfo = rawData.abortReasonInfo, heatmap = rawData.heatmap, heatmapNext = rawData.heatmapNext, outOfBoundaryInfo = rawData.outOfBoundaryInfo, totalTime = rawData.totalTime, componentsLog = rawData.componentsLog, viewport = rawData.viewport, devToolsEnabled = rawData.devToolsEnabled, ratios = rawData.ratios, multiHeatmap = rawData.multiHeatmap;
118
- isTTVCv1Disabled = fg('platform_ufo_vc_enable_revisions_by_experience') ? !isVCRevisionEnabled('fy25.01', experienceKey) : !isVCRevisionEnabled('fy25.01'); // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
113
+ abortReason = rawData.abortReason, abortReasonInfo = rawData.abortReasonInfo, heatmap = rawData.heatmap, heatmapNext = rawData.heatmapNext, outOfBoundaryInfo = rawData.outOfBoundaryInfo, totalTime = rawData.totalTime, componentsLog = rawData.componentsLog, viewport = rawData.viewport, devToolsEnabled = rawData.devToolsEnabled, ratios = rawData.ratios;
114
+ isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', experienceKey); // NOTE: as part of platform_ufo_add_vc_abort_reason_by_revisions feature,
119
115
  // we want to report abort by scroll events the same way as other abort reasons
120
116
  // i.e. not have the concept of `abortReason.blocking` anymore
121
117
  if (!(abortReasonInfo !== null && fg('platform_ufo_add_vc_abort_reason_by_revisions'))) {
@@ -318,8 +314,6 @@ export var VCObserver = /*#__PURE__*/function () {
318
314
  end: stop
319
315
  },
320
316
  isVCClean: isVCClean,
321
- multiHeatmap: multiHeatmap,
322
- ssr: ssr,
323
317
  calculatedVC: {
324
318
  VC: VC,
325
319
  VCBox: VCBox
@@ -338,7 +332,7 @@ export var VCObserver = /*#__PURE__*/function () {
338
332
  }
339
333
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty({}, "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
340
334
  case 32:
341
- isTTVCv3Enabled = fg('platform_ufo_vc_enable_revisions_by_experience') ? isVCRevisionEnabled('fy25.03', experienceKey) : isVCRevisionEnabled('fy25.03');
335
+ isTTVCv3Enabled = isVCRevisionEnabled('fy25.03', experienceKey);
342
336
  return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
343
337
  'metrics:vc': VC
344
338
  }, "".concat(fullPrefix, "vc:state"), true), "".concat(fullPrefix, "vc:clean"), isVCClean), "".concat(fullPrefix, "vc:dom"), VCBox), "".concat(fullPrefix, "vc:updates"), isTTVCv3Enabled ? undefined : VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:size"), viewport), "".concat(fullPrefix, "vc:time"), Math.round(totalTime + (stopTime - startTime))), "".concat(fullPrefix, "vc:total"), totalPainted), "".concat(fullPrefix, "vc:ratios"), ratios), outOfBoundary), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(fullPrefix, "vc:next"), vcNext.VC), "".concat(fullPrefix, "vc:next:updates"), isTTVCv3Enabled ? undefined : vcNext.VCEntries.rel.slice(0, 50)), "".concat(fullPrefix, "vc:next:dom"), vcNext.VCBox), "".concat(fullPrefix, "vc:ignored"), _this.getIgnoredElements(componentsLog)), revisionsData), speedIndex));
@@ -353,29 +347,6 @@ export var VCObserver = /*#__PURE__*/function () {
353
347
  };
354
348
  }());
355
349
  _defineProperty(this, "handleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
356
- _this.measureStart();
357
- _this.legacyHandleUpdate(rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue);
358
- var isTTVCv3Disabled = !isVCRevisionEnabled('fy25.03');
359
- if (fg('platform_ufo_vc_enable_revisions_by_experience')) {
360
- var interaction = getActiveInteraction();
361
- isTTVCv3Disabled = !isVCRevisionEnabled('fy25.03', interaction === null || interaction === void 0 ? void 0 : interaction.ufoName);
362
- }
363
- if (isTTVCv3Disabled) {
364
- _this.onViewportChangeDetected({
365
- timestamp: rawTime,
366
- intersectionRect: intersectionRect,
367
- targetName: targetName,
368
- element: element,
369
- type: type,
370
- ignoreReason: ignoreReason,
371
- attributeName: attributeName,
372
- oldValue: oldValue,
373
- newValue: newValue
374
- });
375
- }
376
- _this.measureStop();
377
- });
378
- _defineProperty(this, "legacyHandleUpdate", function (rawTime, intersectionRect, targetName, element, type, ignoreReason, attributeName, oldValue, newValue) {
379
350
  if (_this.abortReason.reason === null || _this.abortReason.blocking === false) {
380
351
  var time = Math.round(rawTime - _this.startTime);
381
352
  var mappedValues = _this.mapPixelsToHeatmap(intersectionRect.left, intersectionRect.top, intersectionRect.width, intersectionRect.height);
@@ -383,11 +354,8 @@ export var VCObserver = /*#__PURE__*/function () {
383
354
  if (!ignoreReason) {
384
355
  _this.applyChangesToHeatMap(mappedValues, time, _this.heatmapNext);
385
356
  }
386
- var isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01');
387
- if (fg('platform_ufo_vc_enable_revisions_by_experience')) {
388
- var interaction = getActiveInteraction();
389
- isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', interaction === null || interaction === void 0 ? void 0 : interaction.ufoName);
390
- }
357
+ var interaction = getActiveInteraction();
358
+ var isTTVCv1Disabled = !isVCRevisionEnabled('fy25.01', interaction === null || interaction === void 0 ? void 0 : interaction.ufoName);
391
359
  if (!isTTVCv1Disabled && (!ignoreReason || ignoreReason === 'not-visible') && type !== 'attr') {
392
360
  _this.applyChangesToHeatMap(mappedValues, time, _this.heatmap);
393
361
  }
@@ -406,44 +374,6 @@ export var VCObserver = /*#__PURE__*/function () {
406
374
  });
407
375
  }
408
376
  });
409
- _defineProperty(this, "onViewportChangeDetected", function (_ref11) {
410
- var element = _ref11.element,
411
- type = _ref11.type,
412
- ignoreReason = _ref11.ignoreReason,
413
- timestamp = _ref11.timestamp,
414
- targetName = _ref11.targetName,
415
- intersectionRect = _ref11.intersectionRect,
416
- attributeName = _ref11.attributeName,
417
- oldValue = _ref11.oldValue,
418
- newValue = _ref11.newValue;
419
- if (_this.multiHeatmap === null) {
420
- return;
421
- }
422
- // @todo add abort reason handling
423
- var time = Math.round(timestamp - _this.startTime);
424
- var revisions = getRevisions();
425
- var revisionsClassification = revisions.map(function (revision) {
426
- return revision.classifier.classifyUpdate({
427
- element: element,
428
- type: type,
429
- ignoreReason: ignoreReason
430
- });
431
- }, []);
432
- _this.multiHeatmap.handleUpdate({
433
- time: time,
434
- targetName: targetName,
435
- intersectionRect: intersectionRect,
436
- type: type,
437
- element: element,
438
- classification: revisionsClassification,
439
- onError: function onError(error) {
440
- _this.setAbortReason(abortReason.error, error.time, error.error);
441
- },
442
- attributeName: attributeName,
443
- oldValue: oldValue,
444
- newValue: newValue
445
- });
446
- });
447
377
  _defineProperty(this, "mapPixelsToHeatmap", function (left, top, width, height) {
448
378
  var _this$viewport = _this.viewport,
449
379
  w = _this$viewport.w,
@@ -500,10 +430,10 @@ export var VCObserver = /*#__PURE__*/function () {
500
430
  var unbinds = attachAbortListeners(window, _this.viewport, _this.abortReasonCallback);
501
431
  if ((_window = window) !== null && _window !== void 0 && _window.__SSR_ABORT_LISTENERS__) {
502
432
  var _window2;
503
- Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref12) {
504
- var _ref13 = _slicedToArray(_ref12, 2),
505
- key = _ref13[0],
506
- time = _ref13[1];
433
+ Object.entries(window.__SSR_ABORT_LISTENERS__.aborts).forEach(function (_ref11) {
434
+ var _ref12 = _slicedToArray(_ref11, 2),
435
+ key = _ref12[0],
436
+ time = _ref12[1];
507
437
  if (time) {
508
438
  _this.abortReasonCallback(key, time);
509
439
  }
@@ -531,17 +461,12 @@ export var VCObserver = /*#__PURE__*/function () {
531
461
  });
532
462
  this.heatmap = !isVCRevisionEnabled('fy25.01') ? [] : this.getCleanHeatmap();
533
463
  this.heatmapNext = this.getCleanHeatmap();
534
- this.multiHeatmap = new MultiRevisionHeatmap({
535
- viewport: this.viewport,
536
- revisions: getRevisions(),
537
- devToolsEnabled: this.devToolsEnabled
538
- });
539
464
  this.isPostInteraction = options.isPostInteraction || false;
540
465
  }
541
466
  return _createClass(VCObserver, [{
542
467
  key: "start",
543
- value: function start(_ref14) {
544
- var startTime = _ref14.startTime;
468
+ value: function start(_ref13) {
469
+ var startTime = _ref13.startTime;
545
470
  this.active = true;
546
471
  if (this.observers.isBrowserSupported()) {
547
472
  this.setViewportSize();
@@ -563,12 +488,12 @@ export var VCObserver = /*#__PURE__*/function () {
563
488
  }, {
564
489
  key: "getIgnoredElements",
565
490
  value: function getIgnoredElements(componentsLog) {
566
- return Object.values(componentsLog).flat().filter(function (_ref15) {
567
- var ignoreReason = _ref15.ignoreReason;
491
+ return Object.values(componentsLog).flat().filter(function (_ref14) {
492
+ var ignoreReason = _ref14.ignoreReason;
568
493
  return Boolean(ignoreReason);
569
- }).map(function (_ref16) {
570
- var targetName = _ref16.targetName,
571
- ignoreReason = _ref16.ignoreReason;
494
+ }).map(function (_ref15) {
495
+ var targetName = _ref15.targetName,
496
+ ignoreReason = _ref15.ignoreReason;
572
497
  return {
573
498
  targetName: targetName,
574
499
  ignoreReason: ignoreReason
@@ -618,11 +543,6 @@ export var VCObserver = /*#__PURE__*/function () {
618
543
  this.detachAbortListeners();
619
544
  this.heatmap = !isVCRevisionEnabled('fy25.01') ? [] : this.getCleanHeatmap();
620
545
  this.heatmapNext = this.getCleanHeatmap();
621
- this.multiHeatmap = new MultiRevisionHeatmap({
622
- viewport: this.viewport,
623
- revisions: getRevisions(),
624
- devToolsEnabled: this.devToolsEnabled
625
- });
626
546
  this.totalTime = 0;
627
547
  this.componentsLog = {};
628
548
  this.vcRatios = {};
@@ -691,12 +611,12 @@ export var VCObserver = /*#__PURE__*/function () {
691
611
  }
692
612
  }], [{
693
613
  key: "calculateVC",
694
- value: function calculateVC(_ref17) {
695
- var heatmap = _ref17.heatmap,
696
- _ref17$ssr = _ref17.ssr,
697
- ssr = _ref17$ssr === void 0 ? UNUSED_SECTOR : _ref17$ssr,
698
- componentsLog = _ref17.componentsLog,
699
- viewport = _ref17.viewport;
614
+ value: function calculateVC(_ref16) {
615
+ var heatmap = _ref16.heatmap,
616
+ _ref16$ssr = _ref16.ssr,
617
+ ssr = _ref16$ssr === void 0 ? UNUSED_SECTOR : _ref16$ssr,
618
+ componentsLog = _ref16.componentsLog,
619
+ viewport = _ref16.viewport;
700
620
  var lastUpdate = {};
701
621
  var totalPainted = 0;
702
622
  if (ssr !== UNUSED_SECTOR) {
@@ -762,11 +682,11 @@ export var VCObserver = /*#__PURE__*/function () {
762
682
  });
763
683
  return VCRatio;
764
684
  }, 0);
765
- var VCEntries = entries.reduce(function (acc, _ref18, i) {
685
+ var VCEntries = entries.reduce(function (acc, _ref17, i) {
766
686
  var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
767
- var _ref19 = _slicedToArray(_ref18, 2),
768
- timestamp = _ref19[0],
769
- entryPainted = _ref19[1];
687
+ var _ref18 = _slicedToArray(_ref17, 2),
688
+ timestamp = _ref18[0],
689
+ entryPainted = _ref18[1];
770
690
  var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
771
691
  var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
772
692
  var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
@@ -1,5 +1,4 @@
1
1
  import type { UnbindFn } from 'bind-event-listener';
2
- import { MultiRevisionHeatmap } from '../../vc/vc-observer/heatmap/heatmap';
3
2
  export declare const AbortEvent: {
4
3
  readonly wheel: "wheel";
5
4
  readonly keydown: "keydown";
@@ -30,7 +29,6 @@ export type VCRawDataType = {
30
29
  oldDomUpdatesEnabled: boolean;
31
30
  devToolsEnabled: boolean;
32
31
  ratios: VCRatioType;
33
- multiHeatmap: MultiRevisionHeatmap | null;
34
32
  };
35
33
  export type VCEntryType = {
36
34
  time: number;
@@ -26,8 +26,8 @@ declare function createPostInteractionLogPayload({ lastInteractionFinish, reactP
26
26
  vc90: number | null;
27
27
  vcClean: boolean;
28
28
  type: import("../common").InteractionType;
29
- abortReason?: import("../common").AbortReasonType | undefined;
30
29
  id: string;
30
+ abortReason?: import("../common").AbortReasonType | undefined;
31
31
  abortedByInteractionName?: string | undefined;
32
32
  routeName: string | null;
33
33
  experimentalVC90?: number | undefined;
@@ -1,6 +1,5 @@
1
1
  import type { InteractionMetrics } from '../../common/common/types';
2
2
  import type { RevisionPayload } from '../../common/vc/types';
3
- import type { MultiRevisionHeatmap } from './heatmap/heatmap';
4
3
  type CalculatedVC = {
5
4
  VC: {
6
5
  [key: string]: number | null;
@@ -9,29 +8,15 @@ type CalculatedVC = {
9
8
  [key: string]: string[] | null;
10
9
  };
11
10
  };
12
- export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, multiHeatmap, ssr, calculatedVC, calculatedVCNext, experienceKey, }: {
11
+ export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, calculatedVC, calculatedVCNext, experienceKey, }: {
13
12
  fullPrefix?: string;
14
13
  interaction: Pick<InteractionMetrics, 'start' | 'end'>;
15
14
  isVCClean: boolean;
16
15
  isEventAborted: boolean;
17
- multiHeatmap: MultiRevisionHeatmap | null;
18
16
  calculatedVC: CalculatedVC;
19
17
  calculatedVCNext: CalculatedVC;
20
18
  experienceKey: string;
21
- ssr?: number;
22
19
  }): {
23
20
  [x: string]: RevisionPayload;
24
- } | {
25
- [x: string]: {
26
- revision: string;
27
- clean: boolean;
28
- 'metric:vc90': number | null;
29
- vcDetails: {
30
- [key: string]: {
31
- t: number;
32
- e: string[];
33
- };
34
- };
35
- }[];
36
- } | null;
21
+ };
37
22
  export {};
@@ -1,7 +1,6 @@
1
1
  import { type UnbindFn } from 'bind-event-listener';
2
2
  import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
3
3
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
4
- import { MultiRevisionHeatmap } from './heatmap/heatmap';
5
4
  import { Observers } from './observers';
6
5
  export declare class VCObserver implements VCObserverInterface {
7
6
  abortReason: VCAbortReasonType;
@@ -15,7 +14,6 @@ export declare class VCObserver implements VCObserverInterface {
15
14
  arraySize: number;
16
15
  heatmap: number[][];
17
16
  heatmapNext: number[][];
18
- multiHeatmap: MultiRevisionHeatmap | null;
19
17
  componentsLog: ComponentsLogType;
20
18
  vcRatios: VCRatioType;
21
19
  active: boolean;
@@ -68,8 +66,6 @@ export declare class VCObserver implements VCObserverInterface {
68
66
  setReactRootRenderStart(startTime?: number): void;
69
67
  setReactRootRenderStop(stopTime?: number): void;
70
68
  private handleUpdate;
71
- private legacyHandleUpdate;
72
- private onViewportChangeDetected;
73
69
  private setAbortReason;
74
70
  private resetState;
75
71
  private getCleanHeatmap;
@@ -1,5 +1,4 @@
1
1
  import type { UnbindFn } from 'bind-event-listener';
2
- import { MultiRevisionHeatmap } from '../../vc/vc-observer/heatmap/heatmap';
3
2
  export declare const AbortEvent: {
4
3
  readonly wheel: "wheel";
5
4
  readonly keydown: "keydown";
@@ -30,7 +29,6 @@ export type VCRawDataType = {
30
29
  oldDomUpdatesEnabled: boolean;
31
30
  devToolsEnabled: boolean;
32
31
  ratios: VCRatioType;
33
- multiHeatmap: MultiRevisionHeatmap | null;
34
32
  };
35
33
  export type VCEntryType = {
36
34
  time: number;
@@ -26,8 +26,8 @@ declare function createPostInteractionLogPayload({ lastInteractionFinish, reactP
26
26
  vc90: number | null;
27
27
  vcClean: boolean;
28
28
  type: import("../common").InteractionType;
29
- abortReason?: import("../common").AbortReasonType | undefined;
30
29
  id: string;
30
+ abortReason?: import("../common").AbortReasonType | undefined;
31
31
  abortedByInteractionName?: string | undefined;
32
32
  routeName: string | null;
33
33
  experimentalVC90?: number | undefined;
@@ -1,6 +1,5 @@
1
1
  import type { InteractionMetrics } from '../../common/common/types';
2
2
  import type { RevisionPayload } from '../../common/vc/types';
3
- import type { MultiRevisionHeatmap } from './heatmap/heatmap';
4
3
  type CalculatedVC = {
5
4
  VC: {
6
5
  [key: string]: number | null;
@@ -9,29 +8,15 @@ type CalculatedVC = {
9
8
  [key: string]: string[] | null;
10
9
  };
11
10
  };
12
- export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, multiHeatmap, ssr, calculatedVC, calculatedVCNext, experienceKey, }: {
11
+ export declare function getVCRevisionsData({ fullPrefix, interaction, isVCClean, isEventAborted, calculatedVC, calculatedVCNext, experienceKey, }: {
13
12
  fullPrefix?: string;
14
13
  interaction: Pick<InteractionMetrics, 'start' | 'end'>;
15
14
  isVCClean: boolean;
16
15
  isEventAborted: boolean;
17
- multiHeatmap: MultiRevisionHeatmap | null;
18
16
  calculatedVC: CalculatedVC;
19
17
  calculatedVCNext: CalculatedVC;
20
18
  experienceKey: string;
21
- ssr?: number;
22
19
  }): {
23
20
  [x: string]: RevisionPayload;
24
- } | {
25
- [x: string]: {
26
- revision: string;
27
- clean: boolean;
28
- 'metric:vc90': number | null;
29
- vcDetails: {
30
- [key: string]: {
31
- t: number;
32
- e: string[];
33
- };
34
- };
35
- }[];
36
- } | null;
21
+ };
37
22
  export {};
@@ -1,7 +1,6 @@
1
1
  import { type UnbindFn } from 'bind-event-listener';
2
2
  import type { ComponentsLogType, VCAbortReasonType, VCEntryType, VCIgnoreReason, VCRatioType, VCRawDataType, VCResult } from '../../common/vc/types';
3
3
  import type { GetVCResultType, VCObserverInterface, VCObserverOptions } from '../types';
4
- import { MultiRevisionHeatmap } from './heatmap/heatmap';
5
4
  import { Observers } from './observers';
6
5
  export declare class VCObserver implements VCObserverInterface {
7
6
  abortReason: VCAbortReasonType;
@@ -25,7 +24,6 @@ export declare class VCObserver implements VCObserverInterface {
25
24
  arraySize: number;
26
25
  heatmap: number[][];
27
26
  heatmapNext: number[][];
28
- multiHeatmap: MultiRevisionHeatmap | null;
29
27
  componentsLog: ComponentsLogType;
30
28
  vcRatios: VCRatioType;
31
29
  active: boolean;
@@ -78,8 +76,6 @@ export declare class VCObserver implements VCObserverInterface {
78
76
  setReactRootRenderStart(startTime?: number): void;
79
77
  setReactRootRenderStop(stopTime?: number): void;
80
78
  private handleUpdate;
81
- private legacyHandleUpdate;
82
- private onViewportChangeDetected;
83
79
  private setAbortReason;
84
80
  private resetState;
85
81
  private getCleanHeatmap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "3.13.0",
3
+ "version": "3.13.1",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -136,9 +136,6 @@
136
136
  "platform_ufo_report_cpu_usage": {
137
137
  "type": "boolean"
138
138
  },
139
- "platform_ufo_vc_enable_revisions_by_experience": {
140
- "type": "boolean"
141
- },
142
139
  "ufo_return_relative_request_start": {
143
140
  "type": "boolean"
144
141
  },