@atlaskit/react-ufo 4.17.1 → 5.0.0

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,12 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f06d1289b0fbd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f06d1289b0fbd) -
8
+ Decouple fy26.04 and vcNext TTVC revisions, default revision to be fy26.04
9
+
3
10
  ## 4.17.1
4
11
 
5
12
  ### Patch Changes
@@ -14,7 +14,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
16
16
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
17
  var _config = require("../config");
19
18
  var _noOpVcObserver = require("./no-op-vc-observer");
20
19
  var _vcObserver = require("./vc-observer");
@@ -36,8 +35,7 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
36
35
  this.ssrPlaceholderHandler = new _ssrPlaceholders.SSRPlaceholderHandlers({
37
36
  enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
38
37
  });
39
- var ttvcV4RevisionName = (0, _platformFeatureFlags.fg)('platform_ufo_vcnext_to_fy26_04_revision_update') ? 'fy26.04' : 'next';
40
- if ((0, _config.isVCRevisionEnabled)('fy25.03') || (0, _config.isVCRevisionEnabled)(ttvcV4RevisionName)) {
38
+ if ((0, _config.isVCRevisionEnabled)('fy25.03') || (0, _config.isVCRevisionEnabled)('fy26.04')) {
41
39
  var _opts$ssrEnablePageLa2;
42
40
  this.newVCObserver = new _vcObserverNew.default({
43
41
  selectorConfig: opts.selectorConfig,
@@ -18,13 +18,16 @@ var _interactionMetrics = require("../../interaction-metrics");
18
18
  var _ssrPlaceholders = require("../vc-observer/observers/ssr-placeholders");
19
19
  var _entriesTimeline = _interopRequireDefault(require("./entries-timeline"));
20
20
  var _getElementName2 = _interopRequireDefault(require("./get-element-name"));
21
- var _fy25_2 = _interopRequireDefault(require("./metric-calculator/fy25_03"));
21
+ var _fy25_ = _interopRequireDefault(require("./metric-calculator/fy25_03"));
22
22
  var _fy26_ = _interopRequireDefault(require("./metric-calculator/fy26_04"));
23
23
  var _getViewportHeight = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-height"));
24
24
  var _getViewportWidth = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-width"));
25
+ var _vcNext2 = _interopRequireDefault(require("./metric-calculator/vc-next"));
25
26
  var _rawDataHandler = _interopRequireDefault(require("./raw-data-handler"));
26
27
  var _viewportObserver = _interopRequireDefault(require("./viewport-observer"));
27
28
  var _windowEventObserver = _interopRequireDefault(require("./window-event-observer"));
29
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
30
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28
31
  var SSRState = {
29
32
  normal: 1,
30
33
  waitingForFirstRender: 2,
@@ -250,7 +253,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
250
253
  key: "getVCResult",
251
254
  value: function () {
252
255
  var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
253
- var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, vcNext, _fy25_, calculator_next, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
256
+ var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, calculator_next, vcNext, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
254
257
  return _regenerator.default.wrap(function _callee$(_context) {
255
258
  while (1) switch (_context.prev = _context.next) {
256
259
  case 0:
@@ -258,7 +261,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
258
261
  results = [];
259
262
  this.addStartEntry(start);
260
263
  feVCCalculationStartTime = performance.now();
261
- calculator_fy25_03 = new _fy25_2.default();
264
+ calculator_fy25_03 = new _fy25_.default();
262
265
  if (param.includeSSRInV3 && param.ssr) {
263
266
  this.addSSR(param.ssr);
264
267
  }
@@ -266,15 +269,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
266
269
  start: start,
267
270
  stop: stop
268
271
  });
269
- if (!(0, _platformFeatureFlags.fg)('platform_ufo_vcnext_to_fy26_04_revision_update')) {
270
- _context.next = 30;
271
- break;
272
- }
273
272
  if (!(0, _config.isVCRevisionEnabled)('fy25.03')) {
274
- _context.next = 14;
273
+ _context.next = 13;
275
274
  break;
276
275
  }
277
- _context.next = 11;
276
+ _context.next = 10;
278
277
  return calculator_fy25_03.calculate({
279
278
  orderedEntries: orderedEntries,
280
279
  startTime: start,
@@ -288,13 +287,13 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
288
287
  isPageVisible: isPageVisible,
289
288
  interactionAbortReason: interactionAbortReason
290
289
  });
291
- case 11:
290
+ case 10:
292
291
  _context.t0 = _context.sent;
293
- _context.next = 15;
292
+ _context.next = 14;
294
293
  break;
295
- case 14:
294
+ case 13:
296
295
  _context.t0 = null;
297
- case 15:
296
+ case 14:
298
297
  fy25_03 = _context.t0;
299
298
  if (fy25_03) {
300
299
  results.push(fy25_03);
@@ -306,11 +305,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
306
305
  this.addSSR(param.ssr);
307
306
  }
308
307
  calculator_fy26_04 = new _fy26_.default();
309
- if (!((0, _config.isVCRevisionEnabled)('fy26.04') || (0, _config.isVCRevisionEnabled)('next'))) {
310
- _context.next = 25;
308
+ if (!(0, _config.isVCRevisionEnabled)('fy26.04')) {
309
+ _context.next = 24;
311
310
  break;
312
311
  }
313
- _context.next = 22;
312
+ _context.next = 21;
314
313
  return calculator_fy26_04.calculate({
315
314
  orderedEntries: orderedEntries,
316
315
  startTime: start,
@@ -324,53 +323,29 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
324
323
  isPageVisible: isPageVisible,
325
324
  interactionAbortReason: interactionAbortReason
326
325
  });
327
- case 22:
326
+ case 21:
328
327
  _context.t1 = _context.sent;
329
- _context.next = 26;
328
+ _context.next = 25;
330
329
  break;
331
- case 25:
330
+ case 24:
332
331
  _context.t1 = null;
333
- case 26:
332
+ case 25:
334
333
  fy26_04 = _context.t1;
335
- if (fy26_04) {
336
- vcNext = {
337
- revision: 'next',
338
- 'metric:vc90': fy26_04['metric:vc90'],
339
- clean: fy26_04['clean']
340
- };
341
- results.push(fy26_04);
342
- results.push(vcNext);
334
+ if (!fy26_04) {
335
+ _context.next = 43;
336
+ break;
343
337
  }
344
- _context.next = 40;
345
- break;
346
- case 30:
347
- _context.next = 32;
348
- return calculator_fy25_03.calculate({
349
- orderedEntries: orderedEntries,
350
- startTime: start,
351
- stopTime: stop,
352
- interactionId: interactionId,
353
- interactionType: interactionType,
354
- isPostInteraction: this.isPostInteraction,
355
- include3p: include3p,
356
- excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
357
- includeSSRRatio: includeSSRRatio,
358
- isPageVisible: isPageVisible,
359
- interactionAbortReason: interactionAbortReason
360
- });
361
- case 32:
362
- _fy25_ = _context.sent;
363
- if (_fy25_) {
364
- results.push(_fy25_);
338
+ results.push(fy26_04);
339
+ if (!(0, _platformFeatureFlags.fg)('platform_ufo_vcnext_for_ttvc_v5')) {
340
+ _context.next = 41;
341
+ break;
365
342
  }
366
-
367
- // From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
368
- // From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
369
- if (param.ssr && !param.includeSSRInV3 && (0, _platformFeatureFlags.fg)('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
370
- this.addSSR(param.ssr);
343
+ calculator_next = new _vcNext2.default();
344
+ if (!(0, _config.isVCRevisionEnabled)('next')) {
345
+ _context.next = 36;
346
+ break;
371
347
  }
372
- calculator_next = new _fy26_.default();
373
- _context.next = 38;
348
+ _context.next = 33;
374
349
  return calculator_next.calculate({
375
350
  orderedEntries: orderedEntries,
376
351
  startTime: start,
@@ -379,20 +354,33 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
379
354
  interactionType: interactionType,
380
355
  isPostInteraction: this.isPostInteraction,
381
356
  include3p: include3p,
357
+ excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
382
358
  includeSSRRatio: includeSSRRatio,
383
359
  isPageVisible: isPageVisible,
384
360
  interactionAbortReason: interactionAbortReason
385
361
  });
386
- case 38:
387
- _vcNext = _context.sent;
388
- if (_vcNext) {
389
- _vcNext.revision = 'next';
390
- results.push(_vcNext);
362
+ case 33:
363
+ _context.t2 = _context.sent;
364
+ _context.next = 37;
365
+ break;
366
+ case 36:
367
+ _context.t2 = null;
368
+ case 37:
369
+ vcNext = _context.t2;
370
+ if (vcNext) {
371
+ results.push(vcNext);
391
372
  }
392
- case 40:
373
+ _context.next = 43;
374
+ break;
375
+ case 41:
376
+ _vcNext = _objectSpread(_objectSpread({}, fy26_04), {}, {
377
+ revision: 'next'
378
+ });
379
+ results.push(_vcNext);
380
+ case 43:
393
381
  feVCCalculationEndTime = performance.now();
394
382
  if (!(includeRawData && (0, _platformFeatureFlags.fg)('platform_ufo_enable_vc_raw_data'))) {
395
- _context.next = 51;
383
+ _context.next = 54;
396
384
  break;
397
385
  }
398
386
  rawVCCalculationStartTime = performance.now();
@@ -402,14 +390,14 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
402
390
  start: start,
403
391
  stop: rawStopTime
404
392
  }) : orderedEntries;
405
- _context.next = 48;
393
+ _context.next = 51;
406
394
  return rawHandler.getRawData({
407
395
  entries: rawOrderedEntries,
408
396
  startTime: start,
409
397
  stopTime: rawStopTime,
410
398
  isPageVisible: isPageVisible
411
399
  });
412
- case 48:
400
+ case 51:
413
401
  raw = _context.sent;
414
402
  results.forEach(function (result) {
415
403
  delete result.vcDetails;
@@ -420,9 +408,9 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
420
408
  raw.feVCTime = Number((feVCCalculationEndTime - feVCCalculationStartTime).toFixed(2));
421
409
  results.push(raw);
422
410
  }
423
- case 51:
411
+ case 54:
424
412
  return _context.abrupt("return", results);
425
- case 52:
413
+ case 55:
426
414
  case "end":
427
415
  return _context.stop();
428
416
  }
@@ -33,8 +33,9 @@ var fy26_04_excluded_attributes = ['data-is-hovered' // non-visual attribute
33
33
  ];
34
34
  var VCCalculator_FY26_04 = exports.default = /*#__PURE__*/function (_VCCalculator_FY25_) {
35
35
  function VCCalculator_FY26_04() {
36
+ var revisionNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fy26.04';
36
37
  (0, _classCallCheck2.default)(this, VCCalculator_FY26_04);
37
- return _callSuper(this, VCCalculator_FY26_04, ['fy26.04']);
38
+ return _callSuper(this, VCCalculator_FY26_04, [revisionNo]);
38
39
  }
39
40
  (0, _inherits2.default)(VCCalculator_FY26_04, _VCCalculator_FY25_);
40
41
  return (0, _createClass2.default)(VCCalculator_FY26_04, [{
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
+ var _fy26_ = _interopRequireDefault(require("../fy26_04"));
15
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
16
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
17
+ function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
18
+ var getConsideredEntryTypes = function getConsideredEntryTypes() {
19
+ var consideredEntryTypes = [];
20
+ return consideredEntryTypes;
21
+ };
22
+ var getExcludedEntryTypes = function getExcludedEntryTypes() {
23
+ var excludedEntryTypes = [];
24
+ return excludedEntryTypes;
25
+ };
26
+ var VCCalculator_Next = exports.default = /*#__PURE__*/function (_VCCalculator_FY26_) {
27
+ function VCCalculator_Next() {
28
+ (0, _classCallCheck2.default)(this, VCCalculator_Next);
29
+ return _callSuper(this, VCCalculator_Next, ['next']);
30
+ }
31
+ (0, _inherits2.default)(VCCalculator_Next, _VCCalculator_FY26_);
32
+ return (0, _createClass2.default)(VCCalculator_Next, [{
33
+ key: "isEntryIncluded",
34
+ value: function isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
35
+ var isEntryIncludedInV4 = _superPropGet(VCCalculator_Next, "isEntryIncluded", this, 3)([entry, include3p, excludeSmartAnswersInSearch]);
36
+ if (isEntryIncludedInV4 && !getExcludedEntryTypes().includes(entry.data.type)) {
37
+ return true;
38
+ }
39
+ return getConsideredEntryTypes().includes(entry.data.type);
40
+ }
41
+ }]);
42
+ }(_fy26_.default);
@@ -1,5 +1,4 @@
1
1
  var _process, _process$env;
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { isVCRevisionEnabled } from '../config';
4
3
  import { VCObserverNOOP } from './no-op-vc-observer';
5
4
  import { VCObserver } from './vc-observer';
@@ -16,8 +15,7 @@ export class VCObserverWrapper {
16
15
  this.ssrPlaceholderHandler = new SSRPlaceholderHandlers({
17
16
  enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
18
17
  });
19
- const ttvcV4RevisionName = fg('platform_ufo_vcnext_to_fy26_04_revision_update') ? 'fy26.04' : 'next';
20
- if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled(ttvcV4RevisionName)) {
18
+ if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled('fy26.04')) {
21
19
  var _opts$ssrEnablePageLa2;
22
20
  this.newVCObserver = new VCObserverNew({
23
21
  selectorConfig: opts.selectorConfig,
@@ -9,6 +9,7 @@ import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
9
9
  import VCCalculator_FY26_04 from './metric-calculator/fy26_04';
10
10
  import getViewportHeight from './metric-calculator/utils/get-viewport-height';
11
11
  import getViewportWidth from './metric-calculator/utils/get-viewport-width';
12
+ import VCCalculator_Next from './metric-calculator/vc-next';
12
13
  import RawDataHandler from './raw-data-handler';
13
14
  import ViewportObserver from './viewport-observer';
14
15
  import WindowEventObserver from './window-event-observer';
@@ -228,90 +229,67 @@ export default class VCObserverNew {
228
229
  start,
229
230
  stop
230
231
  });
231
- if (fg('platform_ufo_vcnext_to_fy26_04_revision_update')) {
232
- const fy25_03 = isVCRevisionEnabled('fy25.03') ? await calculator_fy25_03.calculate({
233
- orderedEntries,
234
- startTime: start,
235
- stopTime: stop,
236
- interactionId,
237
- interactionType,
238
- isPostInteraction: this.isPostInteraction,
239
- include3p,
240
- excludeSmartAnswersInSearch,
241
- includeSSRRatio,
242
- isPageVisible,
243
- interactionAbortReason
244
- }) : null;
245
- if (fy25_03) {
246
- results.push(fy25_03);
247
- }
232
+ const fy25_03 = isVCRevisionEnabled('fy25.03') ? await calculator_fy25_03.calculate({
233
+ orderedEntries,
234
+ startTime: start,
235
+ stopTime: stop,
236
+ interactionId,
237
+ interactionType,
238
+ isPostInteraction: this.isPostInteraction,
239
+ include3p,
240
+ excludeSmartAnswersInSearch,
241
+ includeSSRRatio,
242
+ isPageVisible,
243
+ interactionAbortReason
244
+ }) : null;
245
+ if (fy25_03) {
246
+ results.push(fy25_03);
247
+ }
248
248
 
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')) {
252
- this.addSSR(param.ssr);
253
- }
254
- const calculator_fy26_04 = new VCCalculator_FY26_04();
255
- const fy26_04 = isVCRevisionEnabled('fy26.04') || isVCRevisionEnabled('next') ? await calculator_fy26_04.calculate({
256
- orderedEntries,
257
- startTime: start,
258
- stopTime: stop,
259
- interactionId,
260
- interactionType,
261
- isPostInteraction: this.isPostInteraction,
262
- include3p,
263
- excludeSmartAnswersInSearch,
264
- includeSSRRatio,
265
- isPageVisible,
266
- interactionAbortReason
267
- }) : null;
268
- if (fy26_04) {
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')) {
252
+ this.addSSR(param.ssr);
253
+ }
254
+ const calculator_fy26_04 = new VCCalculator_FY26_04();
255
+ const fy26_04 = isVCRevisionEnabled('fy26.04') ? await calculator_fy26_04.calculate({
256
+ orderedEntries,
257
+ startTime: start,
258
+ stopTime: stop,
259
+ interactionId,
260
+ interactionType,
261
+ isPostInteraction: this.isPostInteraction,
262
+ include3p,
263
+ excludeSmartAnswersInSearch,
264
+ includeSSRRatio,
265
+ isPageVisible,
266
+ interactionAbortReason
267
+ }) : null;
268
+ if (fy26_04) {
269
+ results.push(fy26_04);
270
+ if (fg('platform_ufo_vcnext_for_ttvc_v5')) {
271
+ const calculator_next = new VCCalculator_Next();
272
+ const vcNext = isVCRevisionEnabled('next') ? await calculator_next.calculate({
273
+ orderedEntries,
274
+ startTime: start,
275
+ stopTime: stop,
276
+ interactionId,
277
+ interactionType,
278
+ isPostInteraction: this.isPostInteraction,
279
+ include3p,
280
+ excludeSmartAnswersInSearch,
281
+ includeSSRRatio,
282
+ isPageVisible,
283
+ interactionAbortReason
284
+ }) : null;
285
+ if (vcNext) {
286
+ results.push(vcNext);
287
+ }
288
+ } else {
269
289
  const vcNext = {
270
- revision: 'next',
271
- 'metric:vc90': fy26_04['metric:vc90'],
272
- clean: fy26_04['clean']
290
+ ...fy26_04,
291
+ revision: 'next'
273
292
  };
274
- results.push(fy26_04);
275
- results.push(vcNext);
276
- }
277
- } else {
278
- const fy25_03 = await calculator_fy25_03.calculate({
279
- orderedEntries,
280
- startTime: start,
281
- stopTime: stop,
282
- interactionId,
283
- interactionType,
284
- isPostInteraction: this.isPostInteraction,
285
- include3p,
286
- excludeSmartAnswersInSearch,
287
- includeSSRRatio,
288
- isPageVisible,
289
- interactionAbortReason
290
- });
291
- if (fy25_03) {
292
- results.push(fy25_03);
293
- }
294
-
295
- // From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
296
- // From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
297
- if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
298
- this.addSSR(param.ssr);
299
- }
300
- const calculator_next = new VCCalculator_FY26_04();
301
- const vcNext = await calculator_next.calculate({
302
- orderedEntries,
303
- startTime: start,
304
- stopTime: stop,
305
- interactionId,
306
- interactionType,
307
- isPostInteraction: this.isPostInteraction,
308
- include3p,
309
- includeSSRRatio,
310
- isPageVisible,
311
- interactionAbortReason
312
- });
313
- if (vcNext) {
314
- vcNext.revision = 'next';
315
293
  results.push(vcNext);
316
294
  }
317
295
  }
@@ -16,8 +16,8 @@ const getExcludedEntryTypes = () => {
16
16
  const fy26_04_excluded_attributes = ['data-is-hovered' // non-visual attribute
17
17
  ];
18
18
  export default class VCCalculator_FY26_04 extends VCCalculator_FY25_03 {
19
- constructor() {
20
- super('fy26.04');
19
+ constructor(revisionNo = 'fy26.04') {
20
+ super(revisionNo);
21
21
  }
22
22
  isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
23
23
  const isEntryIncludedInV3 = super.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
@@ -0,0 +1,21 @@
1
+ import VCCalculator_FY26_04 from "../fy26_04";
2
+ const getConsideredEntryTypes = () => {
3
+ const consideredEntryTypes = [];
4
+ return consideredEntryTypes;
5
+ };
6
+ const getExcludedEntryTypes = () => {
7
+ const excludedEntryTypes = [];
8
+ return excludedEntryTypes;
9
+ };
10
+ export default class VCCalculator_Next extends VCCalculator_FY26_04 {
11
+ constructor() {
12
+ super('next');
13
+ }
14
+ isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
15
+ const isEntryIncludedInV4 = super.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
16
+ if (isEntryIncludedInV4 && !getExcludedEntryTypes().includes(entry.data.type)) {
17
+ return true;
18
+ }
19
+ return getConsideredEntryTypes().includes(entry.data.type);
20
+ }
21
+ }
@@ -7,7 +7,6 @@ var _process;
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { isVCRevisionEnabled } from '../config';
12
11
  import { VCObserverNOOP } from './no-op-vc-observer';
13
12
  import { VCObserver } from './vc-observer';
@@ -26,8 +25,7 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
26
25
  this.ssrPlaceholderHandler = new SSRPlaceholderHandlers({
27
26
  enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
28
27
  });
29
- var ttvcV4RevisionName = fg('platform_ufo_vcnext_to_fy26_04_revision_update') ? 'fy26.04' : 'next';
30
- if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled(ttvcV4RevisionName)) {
28
+ if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled('fy26.04')) {
31
29
  var _opts$ssrEnablePageLa2;
32
30
  this.newVCObserver = new VCObserverNew({
33
31
  selectorConfig: opts.selectorConfig,
@@ -5,6 +5,8 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  import _regeneratorRuntime from "@babel/runtime/regenerator";
8
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
10
  import { fg } from '@atlaskit/platform-feature-flags';
9
11
  import { isVCRevisionEnabled } from '../../config';
10
12
  import { getActiveInteraction } from '../../interaction-metrics';
@@ -15,6 +17,7 @@ import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
15
17
  import VCCalculator_FY26_04 from './metric-calculator/fy26_04';
16
18
  import getViewportHeight from './metric-calculator/utils/get-viewport-height';
17
19
  import getViewportWidth from './metric-calculator/utils/get-viewport-width';
20
+ import VCCalculator_Next from './metric-calculator/vc-next';
18
21
  import RawDataHandler from './raw-data-handler';
19
22
  import ViewportObserver from './viewport-observer';
20
23
  import WindowEventObserver from './window-event-observer';
@@ -243,7 +246,7 @@ var VCObserverNew = /*#__PURE__*/function () {
243
246
  key: "getVCResult",
244
247
  value: function () {
245
248
  var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
246
- var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, vcNext, _fy25_, calculator_next, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
249
+ var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, rawDataStopTime, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, calculator_next, vcNext, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, rawStopTime, rawOrderedEntries, raw;
247
250
  return _regeneratorRuntime.wrap(function _callee$(_context) {
248
251
  while (1) switch (_context.prev = _context.next) {
249
252
  case 0:
@@ -259,15 +262,11 @@ var VCObserverNew = /*#__PURE__*/function () {
259
262
  start: start,
260
263
  stop: stop
261
264
  });
262
- if (!fg('platform_ufo_vcnext_to_fy26_04_revision_update')) {
263
- _context.next = 30;
264
- break;
265
- }
266
265
  if (!isVCRevisionEnabled('fy25.03')) {
267
- _context.next = 14;
266
+ _context.next = 13;
268
267
  break;
269
268
  }
270
- _context.next = 11;
269
+ _context.next = 10;
271
270
  return calculator_fy25_03.calculate({
272
271
  orderedEntries: orderedEntries,
273
272
  startTime: start,
@@ -281,13 +280,13 @@ var VCObserverNew = /*#__PURE__*/function () {
281
280
  isPageVisible: isPageVisible,
282
281
  interactionAbortReason: interactionAbortReason
283
282
  });
284
- case 11:
283
+ case 10:
285
284
  _context.t0 = _context.sent;
286
- _context.next = 15;
285
+ _context.next = 14;
287
286
  break;
288
- case 14:
287
+ case 13:
289
288
  _context.t0 = null;
290
- case 15:
289
+ case 14:
291
290
  fy25_03 = _context.t0;
292
291
  if (fy25_03) {
293
292
  results.push(fy25_03);
@@ -299,11 +298,11 @@ var VCObserverNew = /*#__PURE__*/function () {
299
298
  this.addSSR(param.ssr);
300
299
  }
301
300
  calculator_fy26_04 = new VCCalculator_FY26_04();
302
- if (!(isVCRevisionEnabled('fy26.04') || isVCRevisionEnabled('next'))) {
303
- _context.next = 25;
301
+ if (!isVCRevisionEnabled('fy26.04')) {
302
+ _context.next = 24;
304
303
  break;
305
304
  }
306
- _context.next = 22;
305
+ _context.next = 21;
307
306
  return calculator_fy26_04.calculate({
308
307
  orderedEntries: orderedEntries,
309
308
  startTime: start,
@@ -317,53 +316,29 @@ var VCObserverNew = /*#__PURE__*/function () {
317
316
  isPageVisible: isPageVisible,
318
317
  interactionAbortReason: interactionAbortReason
319
318
  });
320
- case 22:
319
+ case 21:
321
320
  _context.t1 = _context.sent;
322
- _context.next = 26;
321
+ _context.next = 25;
323
322
  break;
324
- case 25:
323
+ case 24:
325
324
  _context.t1 = null;
326
- case 26:
325
+ case 25:
327
326
  fy26_04 = _context.t1;
328
- if (fy26_04) {
329
- vcNext = {
330
- revision: 'next',
331
- 'metric:vc90': fy26_04['metric:vc90'],
332
- clean: fy26_04['clean']
333
- };
334
- results.push(fy26_04);
335
- results.push(vcNext);
327
+ if (!fy26_04) {
328
+ _context.next = 43;
329
+ break;
336
330
  }
337
- _context.next = 40;
338
- break;
339
- case 30:
340
- _context.next = 32;
341
- return calculator_fy25_03.calculate({
342
- orderedEntries: orderedEntries,
343
- startTime: start,
344
- stopTime: stop,
345
- interactionId: interactionId,
346
- interactionType: interactionType,
347
- isPostInteraction: this.isPostInteraction,
348
- include3p: include3p,
349
- excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
350
- includeSSRRatio: includeSSRRatio,
351
- isPageVisible: isPageVisible,
352
- interactionAbortReason: interactionAbortReason
353
- });
354
- case 32:
355
- _fy25_ = _context.sent;
356
- if (_fy25_) {
357
- results.push(_fy25_);
331
+ results.push(fy26_04);
332
+ if (!fg('platform_ufo_vcnext_for_ttvc_v5')) {
333
+ _context.next = 41;
334
+ break;
358
335
  }
359
-
360
- // From TTVC v4 onwards, ensuring that SSR entry is always auto-added, whenever it is configured.
361
- // From the next major version release (where TTVC v4 becomes the default TTVC version), the config for `includeSSRInV3` will be deprecated
362
- if (param.ssr && !param.includeSSRInV3 && fg('platform_ufo_auto_add_ssr_entry_in_ttvc_v4')) {
363
- this.addSSR(param.ssr);
336
+ calculator_next = new VCCalculator_Next();
337
+ if (!isVCRevisionEnabled('next')) {
338
+ _context.next = 36;
339
+ break;
364
340
  }
365
- calculator_next = new VCCalculator_FY26_04();
366
- _context.next = 38;
341
+ _context.next = 33;
367
342
  return calculator_next.calculate({
368
343
  orderedEntries: orderedEntries,
369
344
  startTime: start,
@@ -372,20 +347,33 @@ var VCObserverNew = /*#__PURE__*/function () {
372
347
  interactionType: interactionType,
373
348
  isPostInteraction: this.isPostInteraction,
374
349
  include3p: include3p,
350
+ excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
375
351
  includeSSRRatio: includeSSRRatio,
376
352
  isPageVisible: isPageVisible,
377
353
  interactionAbortReason: interactionAbortReason
378
354
  });
379
- case 38:
380
- _vcNext = _context.sent;
381
- if (_vcNext) {
382
- _vcNext.revision = 'next';
383
- results.push(_vcNext);
355
+ case 33:
356
+ _context.t2 = _context.sent;
357
+ _context.next = 37;
358
+ break;
359
+ case 36:
360
+ _context.t2 = null;
361
+ case 37:
362
+ vcNext = _context.t2;
363
+ if (vcNext) {
364
+ results.push(vcNext);
384
365
  }
385
- case 40:
366
+ _context.next = 43;
367
+ break;
368
+ case 41:
369
+ _vcNext = _objectSpread(_objectSpread({}, fy26_04), {}, {
370
+ revision: 'next'
371
+ });
372
+ results.push(_vcNext);
373
+ case 43:
386
374
  feVCCalculationEndTime = performance.now();
387
375
  if (!(includeRawData && fg('platform_ufo_enable_vc_raw_data'))) {
388
- _context.next = 51;
376
+ _context.next = 54;
389
377
  break;
390
378
  }
391
379
  rawVCCalculationStartTime = performance.now();
@@ -395,14 +383,14 @@ var VCObserverNew = /*#__PURE__*/function () {
395
383
  start: start,
396
384
  stop: rawStopTime
397
385
  }) : orderedEntries;
398
- _context.next = 48;
386
+ _context.next = 51;
399
387
  return rawHandler.getRawData({
400
388
  entries: rawOrderedEntries,
401
389
  startTime: start,
402
390
  stopTime: rawStopTime,
403
391
  isPageVisible: isPageVisible
404
392
  });
405
- case 48:
393
+ case 51:
406
394
  raw = _context.sent;
407
395
  results.forEach(function (result) {
408
396
  delete result.vcDetails;
@@ -413,9 +401,9 @@ var VCObserverNew = /*#__PURE__*/function () {
413
401
  raw.feVCTime = Number((feVCCalculationEndTime - feVCCalculationStartTime).toFixed(2));
414
402
  results.push(raw);
415
403
  }
416
- case 51:
404
+ case 54:
417
405
  return _context.abrupt("return", results);
418
- case 52:
406
+ case 55:
419
407
  case "end":
420
408
  return _context.stop();
421
409
  }
@@ -26,8 +26,9 @@ var fy26_04_excluded_attributes = ['data-is-hovered' // non-visual attribute
26
26
  ];
27
27
  var VCCalculator_FY26_04 = /*#__PURE__*/function (_VCCalculator_FY25_) {
28
28
  function VCCalculator_FY26_04() {
29
+ var revisionNo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'fy26.04';
29
30
  _classCallCheck(this, VCCalculator_FY26_04);
30
- return _callSuper(this, VCCalculator_FY26_04, ['fy26.04']);
31
+ return _callSuper(this, VCCalculator_FY26_04, [revisionNo]);
31
32
  }
32
33
  _inherits(VCCalculator_FY26_04, _VCCalculator_FY25_);
33
34
  return _createClass(VCCalculator_FY26_04, [{
@@ -0,0 +1,36 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _get from "@babel/runtime/helpers/get";
6
+ import _inherits from "@babel/runtime/helpers/inherits";
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
+ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
10
+ import VCCalculator_FY26_04 from "../fy26_04";
11
+ var getConsideredEntryTypes = function getConsideredEntryTypes() {
12
+ var consideredEntryTypes = [];
13
+ return consideredEntryTypes;
14
+ };
15
+ var getExcludedEntryTypes = function getExcludedEntryTypes() {
16
+ var excludedEntryTypes = [];
17
+ return excludedEntryTypes;
18
+ };
19
+ var VCCalculator_Next = /*#__PURE__*/function (_VCCalculator_FY26_) {
20
+ function VCCalculator_Next() {
21
+ _classCallCheck(this, VCCalculator_Next);
22
+ return _callSuper(this, VCCalculator_Next, ['next']);
23
+ }
24
+ _inherits(VCCalculator_Next, _VCCalculator_FY26_);
25
+ return _createClass(VCCalculator_Next, [{
26
+ key: "isEntryIncluded",
27
+ value: function isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
28
+ var isEntryIncludedInV4 = _superPropGet(VCCalculator_Next, "isEntryIncluded", this, 3)([entry, include3p, excludeSmartAnswersInSearch]);
29
+ if (isEntryIncludedInV4 && !getExcludedEntryTypes().includes(entry.data.type)) {
30
+ return true;
31
+ }
32
+ return getConsideredEntryTypes().includes(entry.data.type);
33
+ }
34
+ }]);
35
+ }(VCCalculator_FY26_04);
36
+ export { VCCalculator_Next as default };
@@ -1,6 +1,6 @@
1
1
  import type { VCObserverEntry } from '../../types';
2
2
  import VCCalculator_FY25_03 from '../fy25_03';
3
3
  export default class VCCalculator_FY26_04 extends VCCalculator_FY25_03 {
4
- constructor();
4
+ constructor(revisionNo?: string);
5
5
  protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
6
6
  }
@@ -0,0 +1,6 @@
1
+ import type { VCObserverEntry } from "../../types";
2
+ import VCCalculator_FY26_04 from "../fy26_04";
3
+ export default class VCCalculator_Next extends VCCalculator_FY26_04 {
4
+ constructor();
5
+ protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
6
+ }
@@ -1,6 +1,6 @@
1
1
  import type { VCObserverEntry } from '../../types';
2
2
  import VCCalculator_FY25_03 from '../fy25_03';
3
3
  export default class VCCalculator_FY26_04 extends VCCalculator_FY25_03 {
4
- constructor();
4
+ constructor(revisionNo?: string);
5
5
  protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
6
6
  }
@@ -0,0 +1,6 @@
1
+ import type { VCObserverEntry } from "../../types";
2
+ import VCCalculator_FY26_04 from "../fy26_04";
3
+ export default class VCCalculator_Next extends VCCalculator_FY26_04 {
4
+ constructor();
5
+ protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean, excludeSmartAnswersInSearch?: boolean): boolean;
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.17.1",
3
+ "version": "5.0.0",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -129,7 +129,7 @@
129
129
  "platform_ufo_segment_critical_metrics": {
130
130
  "type": "boolean"
131
131
  },
132
- "platform_ufo_vcnext_to_fy26_04_revision_update": {
132
+ "platform_ufo_vcnext_for_ttvc_v5": {
133
133
  "type": "boolean"
134
134
  },
135
135
  "platform_ufo_v4_fix_nested_ssr_placeholder": {