@atlaskit/react-ufo 5.5.0 → 5.5.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.
- package/AGENTS.md +0 -1
- package/CHANGELOG.md +9 -0
- package/dist/cjs/interaction-metrics/index.js +125 -204
- package/dist/cjs/interaction-metrics-init/index.js +2 -2
- package/dist/cjs/segment/third-party-segment.js +2 -9
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +1 -2
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +14 -16
- package/dist/es2019/interaction-metrics/index.js +128 -211
- package/dist/es2019/interaction-metrics-init/index.js +2 -2
- package/dist/es2019/segment/third-party-segment.js +2 -9
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +1 -2
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +14 -16
- package/dist/esm/interaction-metrics/index.js +125 -204
- package/dist/esm/interaction-metrics-init/index.js +2 -2
- package/dist/esm/segment/third-party-segment.js +2 -9
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +1 -2
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +14 -16
- package/package.json +1 -10
|
@@ -366,22 +366,20 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
366
366
|
}
|
|
367
367
|
};
|
|
368
368
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
};
|
|
384
|
-
}
|
|
369
|
+
var _ref0 = _this.enableThirdPartyTracking ? (0, _checkWithinComponent.default)(target, 'UFOThirdPartySegment', _this.mapIs3pResult) : {
|
|
370
|
+
isWithin: false
|
|
371
|
+
},
|
|
372
|
+
isWithinThirdPartySegment = _ref0.isWithin;
|
|
373
|
+
if (isWithinThirdPartySegment) {
|
|
374
|
+
return {
|
|
375
|
+
type: 'mutation:third-party-attribute',
|
|
376
|
+
mutationData: {
|
|
377
|
+
attributeName: attributeName,
|
|
378
|
+
oldValue: oldValue,
|
|
379
|
+
newValue: newValue,
|
|
380
|
+
timestamp: timestamp
|
|
381
|
+
}
|
|
382
|
+
};
|
|
385
383
|
}
|
|
386
384
|
if (_this.shouldCheckSmartAnswersMutations() && (0, _isContainedWithinSmartAnswers.isContainedWithinSmartAnswers)(target)) {
|
|
387
385
|
return {
|
|
@@ -331,37 +331,20 @@ export function addHold(interactionId, labelStack, name, experimental) {
|
|
|
331
331
|
name,
|
|
332
332
|
start
|
|
333
333
|
};
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (
|
|
337
|
-
|
|
338
|
-
interaction.hold3pActive = new Map();
|
|
339
|
-
}
|
|
340
|
-
interaction.hold3pActive.set(id, {
|
|
341
|
-
...holdActive,
|
|
342
|
-
start
|
|
343
|
-
});
|
|
344
|
-
} else {
|
|
345
|
-
interaction.holdActive.set(id, {
|
|
346
|
-
...holdActive,
|
|
347
|
-
start
|
|
348
|
-
});
|
|
349
|
-
addHoldCriterion(id, labelStack, name, start);
|
|
334
|
+
const is3pHold = labelStack.some(l => 'type' in l && l.type === 'third-party');
|
|
335
|
+
if (is3pHold) {
|
|
336
|
+
if (!interaction.hold3pActive) {
|
|
337
|
+
interaction.hold3pActive = new Map();
|
|
350
338
|
}
|
|
339
|
+
interaction.hold3pActive.set(id, {
|
|
340
|
+
...holdActive,
|
|
341
|
+
start
|
|
342
|
+
});
|
|
351
343
|
} else {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
start
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
if (!experimental) {
|
|
360
|
-
interaction.holdActive.set(id, {
|
|
361
|
-
...holdActive,
|
|
362
|
-
start
|
|
363
|
-
});
|
|
364
|
-
}
|
|
344
|
+
interaction.holdActive.set(id, {
|
|
345
|
+
...holdActive,
|
|
346
|
+
start
|
|
347
|
+
});
|
|
365
348
|
addHoldCriterion(id, labelStack, name, start);
|
|
366
349
|
}
|
|
367
350
|
return () => {
|
|
@@ -402,19 +385,17 @@ export function addHold(interactionId, labelStack, name, experimental) {
|
|
|
402
385
|
});
|
|
403
386
|
interaction.holdExpActive.delete(id);
|
|
404
387
|
}
|
|
405
|
-
if (
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
if (
|
|
409
|
-
|
|
410
|
-
currentInteraction.hold3pInfo = [];
|
|
411
|
-
}
|
|
412
|
-
currentInteraction.hold3pInfo.push({
|
|
413
|
-
...current3pHold,
|
|
414
|
-
end
|
|
415
|
-
});
|
|
416
|
-
interaction.hold3pActive.delete(id);
|
|
388
|
+
if (interaction.hold3pActive) {
|
|
389
|
+
const current3pHold = interaction.hold3pActive.get(id);
|
|
390
|
+
if (current3pHold != null) {
|
|
391
|
+
if (!currentInteraction.hold3pInfo) {
|
|
392
|
+
currentInteraction.hold3pInfo = [];
|
|
417
393
|
}
|
|
394
|
+
currentInteraction.hold3pInfo.push({
|
|
395
|
+
...current3pHold,
|
|
396
|
+
end
|
|
397
|
+
});
|
|
398
|
+
interaction.hold3pActive.delete(id);
|
|
418
399
|
}
|
|
419
400
|
}
|
|
420
401
|
}
|
|
@@ -426,27 +407,17 @@ export function addHoldByID(interactionId, labelStack, name, id, ignoreOnSubmit)
|
|
|
426
407
|
const interaction = interactions.get(interactionId);
|
|
427
408
|
if (interaction != null) {
|
|
428
409
|
const start = performance.now();
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
if (
|
|
432
|
-
|
|
433
|
-
interaction.hold3pActive = new Map();
|
|
434
|
-
}
|
|
435
|
-
interaction.hold3pActive.set(id, {
|
|
436
|
-
labelStack,
|
|
437
|
-
name,
|
|
438
|
-
start,
|
|
439
|
-
ignoreOnSubmit
|
|
440
|
-
});
|
|
441
|
-
} else {
|
|
442
|
-
interaction.holdActive.set(id, {
|
|
443
|
-
labelStack,
|
|
444
|
-
name,
|
|
445
|
-
start,
|
|
446
|
-
ignoreOnSubmit
|
|
447
|
-
});
|
|
448
|
-
addHoldCriterion(id, labelStack, name, start);
|
|
410
|
+
const is3pHold = labelStack.some(l => 'type' in l && l.type === 'third-party');
|
|
411
|
+
if (is3pHold) {
|
|
412
|
+
if (!interaction.hold3pActive) {
|
|
413
|
+
interaction.hold3pActive = new Map();
|
|
449
414
|
}
|
|
415
|
+
interaction.hold3pActive.set(id, {
|
|
416
|
+
labelStack,
|
|
417
|
+
name,
|
|
418
|
+
start,
|
|
419
|
+
ignoreOnSubmit
|
|
420
|
+
});
|
|
450
421
|
} else {
|
|
451
422
|
interaction.holdActive.set(id, {
|
|
452
423
|
labelStack,
|
|
@@ -473,19 +444,17 @@ export function removeHoldByID(interactionId, id) {
|
|
|
473
444
|
interaction.holdActive.delete(id);
|
|
474
445
|
removeHoldCriterion(id);
|
|
475
446
|
}
|
|
476
|
-
if (
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
if (currentInteraction
|
|
480
|
-
|
|
481
|
-
currentInteraction.hold3pInfo = [];
|
|
482
|
-
}
|
|
483
|
-
currentInteraction.hold3pInfo.push({
|
|
484
|
-
...current3pHold,
|
|
485
|
-
end
|
|
486
|
-
});
|
|
487
|
-
interaction.hold3pActive.delete(id);
|
|
447
|
+
if (interaction.hold3pActive) {
|
|
448
|
+
const current3pHold = interaction.hold3pActive.get(id);
|
|
449
|
+
if (currentInteraction != null && current3pHold != null) {
|
|
450
|
+
if (!currentInteraction.hold3pInfo) {
|
|
451
|
+
currentInteraction.hold3pInfo = [];
|
|
488
452
|
}
|
|
453
|
+
currentInteraction.hold3pInfo.push({
|
|
454
|
+
...current3pHold,
|
|
455
|
+
end
|
|
456
|
+
});
|
|
457
|
+
interaction.hold3pActive.delete(id);
|
|
489
458
|
}
|
|
490
459
|
}
|
|
491
460
|
}
|
|
@@ -561,7 +530,7 @@ export function addErrorToAll(name, labelStack, errorType, errorMessage, errorSt
|
|
|
561
530
|
});
|
|
562
531
|
}
|
|
563
532
|
export function addProfilerTimings(interactionId, labelStack, type, actualDuration, baseDuration, startTime, commitTime) {
|
|
564
|
-
var
|
|
533
|
+
var _getConfig2, _getConfig2$postInter;
|
|
565
534
|
if (isPerformanceTracingEnabled()) {
|
|
566
535
|
try {
|
|
567
536
|
// for Firefox 102 and older
|
|
@@ -589,7 +558,7 @@ export function addProfilerTimings(interactionId, labelStack, type, actualDurati
|
|
|
589
558
|
startTime,
|
|
590
559
|
commitTime
|
|
591
560
|
});
|
|
592
|
-
} else if ((
|
|
561
|
+
} else if ((_getConfig2 = getConfig()) !== null && _getConfig2 !== void 0 && (_getConfig2$postInter = _getConfig2.postInteractionLog) !== null && _getConfig2$postInter !== void 0 && _getConfig2$postInter.enabled) {
|
|
593
562
|
postInteractionLog.addProfilerTimings(labelStack, type, actualDuration, baseDuration, startTime, commitTime);
|
|
594
563
|
}
|
|
595
564
|
}
|
|
@@ -606,7 +575,7 @@ function callCleanUpCallbacks(interaction) {
|
|
|
606
575
|
});
|
|
607
576
|
}
|
|
608
577
|
function finishInteraction(id, data, endTime = performance.now()) {
|
|
609
|
-
var
|
|
578
|
+
var _getConfig3, _getConfig3$vc;
|
|
610
579
|
data.end = endTime;
|
|
611
580
|
try {
|
|
612
581
|
// for Firefox 102 and older
|
|
@@ -638,7 +607,7 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
638
607
|
clearActiveTrace();
|
|
639
608
|
callCleanUpCallbacks(data);
|
|
640
609
|
flushSsrRenderProfilerTraces();
|
|
641
|
-
if ((
|
|
610
|
+
if ((_getConfig3 = getConfig()) !== null && _getConfig3 !== void 0 && (_getConfig3$vc = _getConfig3.vc) !== null && _getConfig3$vc !== void 0 && _getConfig3$vc.stopVCAtInteractionFinish) {
|
|
642
611
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
643
612
|
const observer = data.vcObserver;
|
|
644
613
|
if (observer) {
|
|
@@ -654,19 +623,11 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
654
623
|
if (!coinflip(getPostInteractionRate(sanitisedUfoName, data.type))) {
|
|
655
624
|
postInteractionLog.stopVCObserver();
|
|
656
625
|
}
|
|
657
|
-
if (
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
var _getConfig5, _getConfig5$experimen;
|
|
663
|
-
if (!((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5$experimen = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5$experimen !== void 0 && _getConfig5$experimen.enabled)) {
|
|
664
|
-
remove(id);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
} else {
|
|
668
|
-
var _getConfig6, _getConfig6$experimen;
|
|
669
|
-
if (!((_getConfig6 = getConfig()) !== null && _getConfig6 !== void 0 && (_getConfig6$experimen = _getConfig6.experimentalInteractionMetrics) !== null && _getConfig6$experimen !== void 0 && _getConfig6$experimen.enabled)) {
|
|
626
|
+
if (!coinflip(getExtraInteractionRate(sanitisedUfoName, data.type))) {
|
|
627
|
+
interactionExtraMetrics.stopAll(id);
|
|
628
|
+
} else if (!data.hold3pActive || data.hold3pActive.size === 0) {
|
|
629
|
+
var _getConfig4, _getConfig4$experimen;
|
|
630
|
+
if (!((_getConfig4 = getConfig()) !== null && _getConfig4 !== void 0 && (_getConfig4$experimen = _getConfig4.experimentalInteractionMetrics) !== null && _getConfig4$experimen !== void 0 && _getConfig4$experimen.enabled)) {
|
|
670
631
|
remove(id);
|
|
671
632
|
}
|
|
672
633
|
}
|
|
@@ -678,13 +639,9 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
678
639
|
PreviousInteractionLog.name = data.ufoName || 'unknown';
|
|
679
640
|
PreviousInteractionLog.isAborted = data.abortReason != null;
|
|
680
641
|
if (data.ufoName) {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
// If this same interaction was not already handled, handle it
|
|
685
|
-
handleInteraction(id, data);
|
|
686
|
-
}
|
|
687
|
-
} else {
|
|
642
|
+
var _interactionExtraMetr;
|
|
643
|
+
if (((_interactionExtraMetr = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr === void 0 ? void 0 : _interactionExtraMetr.id) !== id) {
|
|
644
|
+
// If this same interaction was not already handled, handle it
|
|
688
645
|
handleInteraction(id, data);
|
|
689
646
|
}
|
|
690
647
|
}
|
|
@@ -751,16 +708,17 @@ let activeSubmitted = false;
|
|
|
751
708
|
export function tryComplete(interactionId, endTime) {
|
|
752
709
|
const interaction = interactions.get(interactionId);
|
|
753
710
|
if (interaction != null) {
|
|
711
|
+
var _interaction$hold3pAc;
|
|
754
712
|
const noMoreActiveHolds = interaction.holdActive.size === 0;
|
|
755
713
|
const noMoreExpHolds = interaction.holdExpActive.size === 0;
|
|
756
714
|
const shouldUseRawDataThirdParty = shouldUseRawDataThirdPartyBehavior(interaction.ufoName, interaction.type);
|
|
757
715
|
const postInteraction = async () => {
|
|
758
|
-
var
|
|
759
|
-
if ((
|
|
760
|
-
var
|
|
716
|
+
var _getConfig5, _getConfig5$postInter, _interactionExtraMetr2;
|
|
717
|
+
if ((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5$postInter = _getConfig5.postInteractionLog) !== null && _getConfig5$postInter !== void 0 && _getConfig5$postInter.enabled) {
|
|
718
|
+
var _getConfig6, _getConfig6$experimen;
|
|
761
719
|
let experimentalVC90;
|
|
762
720
|
let experimentalTTAI;
|
|
763
|
-
if ((
|
|
721
|
+
if ((_getConfig6 = getConfig()) !== null && _getConfig6 !== void 0 && (_getConfig6$experimen = _getConfig6.experimentalInteractionMetrics) !== null && _getConfig6$experimen !== void 0 && _getConfig6$experimen.enabled) {
|
|
764
722
|
var _await$getExperimenta;
|
|
765
723
|
experimentalVC90 = (_await$getExperimenta = await getExperimentalVCMetrics(interaction)) === null || _await$getExperimenta === void 0 ? void 0 : _await$getExperimenta['metric:experimental:vc90'];
|
|
766
724
|
const {
|
|
@@ -775,122 +733,93 @@ export function tryComplete(interactionId, endTime) {
|
|
|
775
733
|
experimentalVC90
|
|
776
734
|
});
|
|
777
735
|
}
|
|
778
|
-
if (
|
|
779
|
-
var
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
// If interactionExtraMetrics is not waiting for measuring this interaction
|
|
783
|
-
if ((_getConfig9 = getConfig()) !== null && _getConfig9 !== void 0 && (_getConfig9$experimen = _getConfig9.experimentalInteractionMetrics) !== null && _getConfig9$experimen !== void 0 && _getConfig9$experimen.enabled) {
|
|
784
|
-
remove(interactionId);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
} else {
|
|
788
|
-
var _getConfig0, _getConfig0$experimen;
|
|
789
|
-
if ((_getConfig0 = getConfig()) !== null && _getConfig0 !== void 0 && (_getConfig0$experimen = _getConfig0.experimentalInteractionMetrics) !== null && _getConfig0$experimen !== void 0 && _getConfig0$experimen.enabled) {
|
|
736
|
+
if (((_interactionExtraMetr2 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr2 === void 0 ? void 0 : _interactionExtraMetr2.id) !== interactionId) {
|
|
737
|
+
var _getConfig7, _getConfig7$experimen;
|
|
738
|
+
// If interactionExtraMetrics is not waiting for measuring this interaction
|
|
739
|
+
if ((_getConfig7 = getConfig()) !== null && _getConfig7 !== void 0 && (_getConfig7$experimen = _getConfig7.experimentalInteractionMetrics) !== null && _getConfig7$experimen !== void 0 && _getConfig7$experimen.enabled) {
|
|
790
740
|
remove(interactionId);
|
|
791
741
|
}
|
|
792
742
|
}
|
|
793
743
|
activeSubmitted = false;
|
|
794
744
|
};
|
|
795
|
-
|
|
796
|
-
var _interaction$hold3pAc;
|
|
797
|
-
const noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
|
|
745
|
+
const noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
|
|
798
746
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
}
|
|
808
|
-
// Wait for 3p holds to clear before finishing
|
|
809
|
-
return;
|
|
747
|
+
// If using raw data third party behavior, wait for 3p holds to clear
|
|
748
|
+
if (shouldUseRawDataThirdParty) {
|
|
749
|
+
// If there are no non-3p holds active, mark the interaction as successful
|
|
750
|
+
// but don't finish until 3p holds are cleared
|
|
751
|
+
if (noMoreActiveHolds && !noMoreActive3pHolds) {
|
|
752
|
+
// Mark interaction as successful by setting endTime, but don't finish yet
|
|
753
|
+
if (endTime !== undefined && interaction.end === 0) {
|
|
754
|
+
interaction.end = endTime;
|
|
810
755
|
}
|
|
756
|
+
// Wait for 3p holds to clear before finishing
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
811
759
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}
|
|
823
|
-
if ((_getConfig10 = getConfig()) !== null && _getConfig10 !== void 0 && (_getConfig10$extraSea = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10$extraSea !== void 0 && _getConfig10$extraSea.enabled && interaction.ufoName === ((_getConfig11 = getConfig()) === null || _getConfig11 === void 0 ? void 0 : (_getConfig11$extraSea = _getConfig11.extraSearchPageInteraction) === null || _getConfig11$extraSea === void 0 ? void 0 : _getConfig11$extraSea.searchPageMetricName)) {
|
|
824
|
-
onSearchPageInteractionComplete(interactionId, interaction);
|
|
825
|
-
}
|
|
826
|
-
activeSubmitted = true;
|
|
760
|
+
// If all holds (including 3p) are cleared, finish the interaction
|
|
761
|
+
if (noMoreActiveHolds && noMoreActive3pHolds) {
|
|
762
|
+
if (!activeSubmitted) {
|
|
763
|
+
var _getConfig8, _getConfig8$extraInte, _getConfig9, _getConfig9$extraSear, _getConfig0, _getConfig0$extraSear;
|
|
764
|
+
// Set end3p to current time when 3p holds cleared, but ensure it's at least interaction.end
|
|
765
|
+
const currentTime = endTime !== null && endTime !== void 0 ? endTime : performance.now();
|
|
766
|
+
interaction.end3p = interaction.end !== 0 && currentTime < interaction.end ? interaction.end : currentTime;
|
|
767
|
+
finishInteraction(interactionId, interaction, interaction.end !== 0 ? interaction.end : endTime);
|
|
768
|
+
if ((_getConfig8 = getConfig()) !== null && _getConfig8 !== void 0 && (_getConfig8$extraInte = _getConfig8.extraInteractionMetrics) !== null && _getConfig8$extraInte !== void 0 && _getConfig8$extraInte.enabled) {
|
|
769
|
+
interactionExtraMetrics.updateFinishedInteraction(interaction);
|
|
827
770
|
}
|
|
828
|
-
if (
|
|
829
|
-
|
|
830
|
-
if ((_getConfig12 = getConfig()) !== null && _getConfig12 !== void 0 && (_getConfig12$experime = _getConfig12.experimentalInteractionMetrics) !== null && _getConfig12$experime !== void 0 && _getConfig12$experime.enabled) {
|
|
831
|
-
onExperimentalInteractionComplete(interactionId, interaction, endTime || interaction.end);
|
|
832
|
-
}
|
|
833
|
-
postInteraction();
|
|
771
|
+
if ((_getConfig9 = getConfig()) !== null && _getConfig9 !== void 0 && (_getConfig9$extraSear = _getConfig9.extraSearchPageInteraction) !== null && _getConfig9$extraSear !== void 0 && _getConfig9$extraSear.enabled && interaction.ufoName === ((_getConfig0 = getConfig()) === null || _getConfig0 === void 0 ? void 0 : (_getConfig0$extraSear = _getConfig0.extraSearchPageInteraction) === null || _getConfig0$extraSear === void 0 ? void 0 : _getConfig0$extraSear.searchPageMetricName)) {
|
|
772
|
+
onSearchPageInteractionComplete(interactionId, interaction);
|
|
834
773
|
}
|
|
774
|
+
activeSubmitted = true;
|
|
835
775
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
end: endTime || interaction.end
|
|
841
|
-
};
|
|
842
|
-
interactionExtraMetrics.onInteractionComplete(interactionId, data);
|
|
843
|
-
}
|
|
844
|
-
} else {
|
|
845
|
-
var _interactionExtraMetr3;
|
|
846
|
-
// Original behavior when feature flag is not active
|
|
847
|
-
if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
|
|
848
|
-
// If it's not waiting for extra metrics to complete, finish the interaction as normal
|
|
849
|
-
if (!activeSubmitted) {
|
|
850
|
-
var _getConfig13, _getConfig13$extraInt, _getConfig14, _getConfig14$extraSea, _getConfig15, _getConfig15$extraSea;
|
|
851
|
-
finishInteraction(interactionId, interaction, endTime);
|
|
852
|
-
if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13$extraInt = _getConfig13.extraInteractionMetrics) !== null && _getConfig13$extraInt !== void 0 && _getConfig13$extraInt.enabled) {
|
|
853
|
-
interactionExtraMetrics.updateFinishedInteraction(interaction);
|
|
854
|
-
}
|
|
855
|
-
if ((_getConfig14 = getConfig()) !== null && _getConfig14 !== void 0 && (_getConfig14$extraSea = _getConfig14.extraSearchPageInteraction) !== null && _getConfig14$extraSea !== void 0 && _getConfig14$extraSea.enabled && interaction.ufoName === ((_getConfig15 = getConfig()) === null || _getConfig15 === void 0 ? void 0 : (_getConfig15$extraSea = _getConfig15.extraSearchPageInteraction) === null || _getConfig15$extraSea === void 0 ? void 0 : _getConfig15$extraSea.searchPageMetricName)) {
|
|
856
|
-
onSearchPageInteractionComplete(interactionId, interaction);
|
|
857
|
-
}
|
|
858
|
-
activeSubmitted = true;
|
|
859
|
-
}
|
|
860
|
-
if (noMoreExpHolds) {
|
|
861
|
-
var _getConfig16, _getConfig16$experime;
|
|
862
|
-
if ((_getConfig16 = getConfig()) !== null && _getConfig16 !== void 0 && (_getConfig16$experime = _getConfig16.experimentalInteractionMetrics) !== null && _getConfig16$experime !== void 0 && _getConfig16$experime.enabled) {
|
|
863
|
-
onExperimentalInteractionComplete(interactionId, interaction, endTime);
|
|
864
|
-
}
|
|
865
|
-
postInteraction();
|
|
776
|
+
if (noMoreExpHolds) {
|
|
777
|
+
var _getConfig1, _getConfig1$experimen;
|
|
778
|
+
if ((_getConfig1 = getConfig()) !== null && _getConfig1 !== void 0 && (_getConfig1$experimen = _getConfig1.experimentalInteractionMetrics) !== null && _getConfig1$experimen !== void 0 && _getConfig1$experimen.enabled) {
|
|
779
|
+
onExperimentalInteractionComplete(interactionId, interaction, endTime || interaction.end);
|
|
866
780
|
}
|
|
781
|
+
postInteraction();
|
|
867
782
|
}
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
}
|
|
783
|
+
}
|
|
784
|
+
// Send separated third-party event even when feature flag is active
|
|
785
|
+
if (noMoreActiveHolds && noMoreActive3pHolds) {
|
|
786
|
+
const data = {
|
|
787
|
+
...interaction,
|
|
788
|
+
end: endTime || interaction.end
|
|
789
|
+
};
|
|
790
|
+
interactionExtraMetrics.onInteractionComplete(interactionId, data);
|
|
875
791
|
}
|
|
876
792
|
} else {
|
|
877
|
-
|
|
793
|
+
var _interactionExtraMetr3;
|
|
794
|
+
// Original behavior when feature flag is not active
|
|
795
|
+
if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
|
|
796
|
+
// If it's not waiting for extra metrics to complete, finish the interaction as normal
|
|
878
797
|
if (!activeSubmitted) {
|
|
879
|
-
var
|
|
798
|
+
var _getConfig10, _getConfig10$extraInt, _getConfig11, _getConfig11$extraSea, _getConfig12, _getConfig12$extraSea;
|
|
880
799
|
finishInteraction(interactionId, interaction, endTime);
|
|
881
|
-
if ((
|
|
800
|
+
if ((_getConfig10 = getConfig()) !== null && _getConfig10 !== void 0 && (_getConfig10$extraInt = _getConfig10.extraInteractionMetrics) !== null && _getConfig10$extraInt !== void 0 && _getConfig10$extraInt.enabled) {
|
|
801
|
+
interactionExtraMetrics.updateFinishedInteraction(interaction);
|
|
802
|
+
}
|
|
803
|
+
if ((_getConfig11 = getConfig()) !== null && _getConfig11 !== void 0 && (_getConfig11$extraSea = _getConfig11.extraSearchPageInteraction) !== null && _getConfig11$extraSea !== void 0 && _getConfig11$extraSea.enabled && interaction.ufoName === ((_getConfig12 = getConfig()) === null || _getConfig12 === void 0 ? void 0 : (_getConfig12$extraSea = _getConfig12.extraSearchPageInteraction) === null || _getConfig12$extraSea === void 0 ? void 0 : _getConfig12$extraSea.searchPageMetricName)) {
|
|
882
804
|
onSearchPageInteractionComplete(interactionId, interaction);
|
|
883
805
|
}
|
|
884
806
|
activeSubmitted = true;
|
|
885
807
|
}
|
|
886
808
|
if (noMoreExpHolds) {
|
|
887
|
-
var
|
|
888
|
-
if ((
|
|
809
|
+
var _getConfig13, _getConfig13$experime;
|
|
810
|
+
if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13$experime = _getConfig13.experimentalInteractionMetrics) !== null && _getConfig13$experime !== void 0 && _getConfig13$experime.enabled) {
|
|
889
811
|
onExperimentalInteractionComplete(interactionId, interaction, endTime);
|
|
890
812
|
}
|
|
891
813
|
postInteraction();
|
|
892
814
|
}
|
|
893
815
|
}
|
|
816
|
+
if (noMoreActiveHolds && noMoreActive3pHolds) {
|
|
817
|
+
const data = {
|
|
818
|
+
...interaction,
|
|
819
|
+
end: endTime
|
|
820
|
+
};
|
|
821
|
+
interactionExtraMetrics.onInteractionComplete(interactionId, data);
|
|
822
|
+
}
|
|
894
823
|
}
|
|
895
824
|
}
|
|
896
825
|
}
|
|
@@ -913,9 +842,7 @@ export function abort(interactionId, abortReason) {
|
|
|
913
842
|
finishInteraction(interactionId, interaction, endTime);
|
|
914
843
|
postInteractionLog.reset();
|
|
915
844
|
postInteractionLog.stopVCObserver();
|
|
916
|
-
|
|
917
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
918
|
-
}
|
|
845
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
919
846
|
if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
|
|
920
847
|
onExperimentalInteractionComplete(interactionId, interaction, endTime);
|
|
921
848
|
remove(interactionId);
|
|
@@ -927,9 +854,7 @@ export function abort(interactionId, abortReason) {
|
|
|
927
854
|
finishInteraction(interactionId, interaction);
|
|
928
855
|
postInteractionLog.reset();
|
|
929
856
|
postInteractionLog.stopVCObserver();
|
|
930
|
-
|
|
931
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
932
|
-
}
|
|
857
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
933
858
|
if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
|
|
934
859
|
onExperimentalInteractionComplete(interactionId, interaction);
|
|
935
860
|
remove(interactionId);
|
|
@@ -951,9 +876,7 @@ export function abortByNewInteraction(interactionId, interactionName) {
|
|
|
951
876
|
finishInteraction(interactionId, interaction, endTime);
|
|
952
877
|
postInteractionLog.reset();
|
|
953
878
|
postInteractionLog.stopVCObserver();
|
|
954
|
-
|
|
955
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
956
|
-
}
|
|
879
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
957
880
|
if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
|
|
958
881
|
onExperimentalInteractionComplete(interactionId, interaction, endTime);
|
|
959
882
|
remove(interactionId);
|
|
@@ -966,9 +889,7 @@ export function abortByNewInteraction(interactionId, interactionName) {
|
|
|
966
889
|
finishInteraction(interactionId, interaction);
|
|
967
890
|
postInteractionLog.reset();
|
|
968
891
|
postInteractionLog.stopVCObserver();
|
|
969
|
-
|
|
970
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
971
|
-
}
|
|
892
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
972
893
|
if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
|
|
973
894
|
onExperimentalInteractionComplete(interactionId, interaction);
|
|
974
895
|
remove(interactionId);
|
|
@@ -1001,9 +922,7 @@ export function abortAll(abortReason, abortedByInteractionName) {
|
|
|
1001
922
|
finishInteraction(interactionId, interaction, endTime);
|
|
1002
923
|
postInteractionLog.reset();
|
|
1003
924
|
postInteractionLog.stopVCObserver();
|
|
1004
|
-
|
|
1005
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1006
|
-
}
|
|
925
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1007
926
|
if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
|
|
1008
927
|
onExperimentalInteractionComplete(interactionId, interaction, endTime);
|
|
1009
928
|
remove(interactionId);
|
|
@@ -1020,9 +939,7 @@ export function abortAll(abortReason, abortedByInteractionName) {
|
|
|
1020
939
|
finishInteraction(interactionId, interaction);
|
|
1021
940
|
postInteractionLog.reset();
|
|
1022
941
|
postInteractionLog.stopVCObserver();
|
|
1023
|
-
|
|
1024
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1025
|
-
}
|
|
942
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1026
943
|
if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
|
|
1027
944
|
onExperimentalInteractionComplete(interactionId, interaction);
|
|
1028
945
|
remove(interactionId);
|
|
@@ -1152,7 +1069,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
1152
1069
|
addHoldByID(interactionId, [], ufoName, ufoName, true);
|
|
1153
1070
|
}
|
|
1154
1071
|
if (type === 'transition' || type === 'page_load') {
|
|
1155
|
-
var
|
|
1072
|
+
var _getConfig14, _getConfig14$postInte, _config$extraInteract;
|
|
1156
1073
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
1157
1074
|
const observer = vcObserver;
|
|
1158
1075
|
if (observer) {
|
|
@@ -1163,7 +1080,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
1163
1080
|
}
|
|
1164
1081
|
// Start post interaction observer for all if config is enabled
|
|
1165
1082
|
// in case ufoName is updated at later time
|
|
1166
|
-
if ((
|
|
1083
|
+
if ((_getConfig14 = getConfig()) !== null && _getConfig14 !== void 0 && (_getConfig14$postInte = _getConfig14.postInteractionLog) !== null && _getConfig14$postInte !== void 0 && _getConfig14$postInte.enabled) {
|
|
1167
1084
|
postInteractionLog.startVCObserver({
|
|
1168
1085
|
startTime
|
|
1169
1086
|
});
|
|
@@ -1173,7 +1090,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
1173
1090
|
startTime
|
|
1174
1091
|
});
|
|
1175
1092
|
}
|
|
1176
|
-
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled
|
|
1093
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
1177
1094
|
interactionExtraMetrics.startVCObserver({
|
|
1178
1095
|
startTime
|
|
1179
1096
|
}, interactionId);
|
|
@@ -170,7 +170,7 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
170
170
|
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
171
171
|
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
172
172
|
}
|
|
173
|
-
if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled
|
|
173
|
+
if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled) {
|
|
174
174
|
sinkInteractionExtraMetrics(instance, createInteractionExtraMetricsPayloadPackage.default);
|
|
175
175
|
}
|
|
176
176
|
if (config !== null && config !== void 0 && (_config$extraSearchPa = config.extraSearchPageInteraction) !== null && _config$extraSearchPa !== void 0 && _config$extraSearchPa.enabled) {
|
|
@@ -189,7 +189,7 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
189
189
|
if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
|
|
190
190
|
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
191
191
|
}
|
|
192
|
-
if (config !== null && config !== void 0 && (_config$extraInteract3 = config.extraInteractionMetrics) !== null && _config$extraInteract3 !== void 0 && _config$extraInteract3.enabled
|
|
192
|
+
if (config !== null && config !== void 0 && (_config$extraInteract3 = config.extraInteractionMetrics) !== null && _config$extraInteract3 !== void 0 && _config$extraInteract3.enabled) {
|
|
193
193
|
sinkInteractionExtraMetrics(awc, createInteractionExtraMetricsPayloadPackage.default);
|
|
194
194
|
}
|
|
195
195
|
if (config !== null && config !== void 0 && (_config$extraSearchPa2 = config.extraSearchPageInteraction) !== null && _config$extraSearchPa2 !== void 0 && _config$extraSearchPa2.enabled) {
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
-
import UFOIgnoreHolds from '../ignore-holds';
|
|
5
3
|
import UFOSegment from './segment';
|
|
6
4
|
export const UFOThirdPartySegment = props => {
|
|
7
5
|
const {
|
|
8
6
|
children,
|
|
9
7
|
...otherProps
|
|
10
8
|
} = props;
|
|
11
|
-
return
|
|
9
|
+
return /*#__PURE__*/React.createElement(UFOSegment, _extends({
|
|
12
10
|
type: "third-party"
|
|
13
|
-
}, otherProps), children)
|
|
14
|
-
type: "third-party"
|
|
15
|
-
}, otherProps), /*#__PURE__*/React.createElement(UFOIgnoreHolds, {
|
|
16
|
-
ignore: fg('platform_ufo_exclude_3p_elements_from_ttai'),
|
|
17
|
-
reason: "third-party-element"
|
|
18
|
-
}, children));
|
|
11
|
+
}, otherProps), children);
|
|
19
12
|
};
|
|
20
13
|
UFOThirdPartySegment.displayName = 'UFOThirdPartySegment';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
3
2
|
import { detectLayoutShiftCause } from './utils/detect-layout-shift-cause';
|
|
4
3
|
import getViewportHeight from './utils/get-viewport-height';
|
|
@@ -162,7 +161,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
162
161
|
})) : [];
|
|
163
162
|
|
|
164
163
|
// If 3p metric enabled - calculate the debug details
|
|
165
|
-
const shouldCalculate3p = include3p
|
|
164
|
+
const shouldCalculate3p = include3p;
|
|
166
165
|
// Only calculate enhanced debug details if devtool callbacks exist
|
|
167
166
|
|
|
168
167
|
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');
|