@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
package/AGENTS.md
CHANGED
|
@@ -257,7 +257,6 @@ The package uses platform feature flags for gradual rollouts. Key flags are defi
|
|
|
257
257
|
|
|
258
258
|
| Flag | Purpose |
|
|
259
259
|
| --------------------------------------------------- | -------------------------------- |
|
|
260
|
-
| `platform_ufo_enable_ttai_with_3p` | Third-party segment timing |
|
|
261
260
|
| `platform_ufo_enable_vc_raw_data` | Raw VC data inclusion |
|
|
262
261
|
| `platform_ufo_segment_critical_metrics` | Segment-level metrics |
|
|
263
262
|
| `platform_ufo_enable_terminal_errors` | Terminal error tracking |
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 5.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d52302fe9ea1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d52302fe9ea1b) -
|
|
8
|
+
Clean up platform_ufo_exclude_3p_attribute_changes feature gate, assuming always true
|
|
9
|
+
- [`ac3d03af6d443`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac3d03af6d443) -
|
|
10
|
+
Clean up feature gate platform_ufo_exclude_3p_elements_from_ttai - gate always evaluates to true
|
|
11
|
+
|
|
3
12
|
## 5.5.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -419,35 +419,20 @@ function addHold(interactionId, labelStack, name, experimental) {
|
|
|
419
419
|
name: name,
|
|
420
420
|
start: start
|
|
421
421
|
};
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
if (
|
|
427
|
-
|
|
428
|
-
interaction.hold3pActive = new Map();
|
|
429
|
-
}
|
|
430
|
-
interaction.hold3pActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
|
|
431
|
-
start: start
|
|
432
|
-
}));
|
|
433
|
-
} else {
|
|
434
|
-
interaction.holdActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
|
|
435
|
-
start: start
|
|
436
|
-
}));
|
|
437
|
-
addHoldCriterion(id, labelStack, name, start);
|
|
422
|
+
var is3pHold = labelStack.some(function (l) {
|
|
423
|
+
return 'type' in l && l.type === 'third-party';
|
|
424
|
+
});
|
|
425
|
+
if (is3pHold) {
|
|
426
|
+
if (!interaction.hold3pActive) {
|
|
427
|
+
interaction.hold3pActive = new Map();
|
|
438
428
|
}
|
|
429
|
+
interaction.hold3pActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
|
|
430
|
+
start: start
|
|
431
|
+
}));
|
|
439
432
|
} else {
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
start: start
|
|
444
|
-
}));
|
|
445
|
-
}
|
|
446
|
-
if (!experimental) {
|
|
447
|
-
interaction.holdActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
|
|
448
|
-
start: start
|
|
449
|
-
}));
|
|
450
|
-
}
|
|
433
|
+
interaction.holdActive.set(id, _objectSpread(_objectSpread({}, holdActive), {}, {
|
|
434
|
+
start: start
|
|
435
|
+
}));
|
|
451
436
|
addHoldCriterion(id, labelStack, name, start);
|
|
452
437
|
}
|
|
453
438
|
return function () {
|
|
@@ -486,18 +471,16 @@ function addHold(interactionId, labelStack, name, experimental) {
|
|
|
486
471
|
}));
|
|
487
472
|
interaction.holdExpActive.delete(id);
|
|
488
473
|
}
|
|
489
|
-
if (
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
if (
|
|
493
|
-
|
|
494
|
-
currentInteraction.hold3pInfo = [];
|
|
495
|
-
}
|
|
496
|
-
currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
|
|
497
|
-
end: end
|
|
498
|
-
}));
|
|
499
|
-
interaction.hold3pActive.delete(id);
|
|
474
|
+
if (interaction.hold3pActive) {
|
|
475
|
+
var current3pHold = interaction.hold3pActive.get(id);
|
|
476
|
+
if (current3pHold != null) {
|
|
477
|
+
if (!currentInteraction.hold3pInfo) {
|
|
478
|
+
currentInteraction.hold3pInfo = [];
|
|
500
479
|
}
|
|
480
|
+
currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
|
|
481
|
+
end: end
|
|
482
|
+
}));
|
|
483
|
+
interaction.hold3pActive.delete(id);
|
|
501
484
|
}
|
|
502
485
|
}
|
|
503
486
|
}
|
|
@@ -509,29 +492,19 @@ function addHoldByID(interactionId, labelStack, name, id, ignoreOnSubmit) {
|
|
|
509
492
|
var interaction = _constants.interactions.get(interactionId);
|
|
510
493
|
if (interaction != null) {
|
|
511
494
|
var start = performance.now();
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
if (
|
|
517
|
-
|
|
518
|
-
interaction.hold3pActive = new Map();
|
|
519
|
-
}
|
|
520
|
-
interaction.hold3pActive.set(id, {
|
|
521
|
-
labelStack: labelStack,
|
|
522
|
-
name: name,
|
|
523
|
-
start: start,
|
|
524
|
-
ignoreOnSubmit: ignoreOnSubmit
|
|
525
|
-
});
|
|
526
|
-
} else {
|
|
527
|
-
interaction.holdActive.set(id, {
|
|
528
|
-
labelStack: labelStack,
|
|
529
|
-
name: name,
|
|
530
|
-
start: start,
|
|
531
|
-
ignoreOnSubmit: ignoreOnSubmit
|
|
532
|
-
});
|
|
533
|
-
addHoldCriterion(id, labelStack, name, start);
|
|
495
|
+
var is3pHold = labelStack.some(function (l) {
|
|
496
|
+
return 'type' in l && l.type === 'third-party';
|
|
497
|
+
});
|
|
498
|
+
if (is3pHold) {
|
|
499
|
+
if (!interaction.hold3pActive) {
|
|
500
|
+
interaction.hold3pActive = new Map();
|
|
534
501
|
}
|
|
502
|
+
interaction.hold3pActive.set(id, {
|
|
503
|
+
labelStack: labelStack,
|
|
504
|
+
name: name,
|
|
505
|
+
start: start,
|
|
506
|
+
ignoreOnSubmit: ignoreOnSubmit
|
|
507
|
+
});
|
|
535
508
|
} else {
|
|
536
509
|
interaction.holdActive.set(id, {
|
|
537
510
|
labelStack: labelStack,
|
|
@@ -557,18 +530,16 @@ function removeHoldByID(interactionId, id) {
|
|
|
557
530
|
interaction.holdActive.delete(id);
|
|
558
531
|
removeHoldCriterion(id);
|
|
559
532
|
}
|
|
560
|
-
if (
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (currentInteraction
|
|
564
|
-
|
|
565
|
-
currentInteraction.hold3pInfo = [];
|
|
566
|
-
}
|
|
567
|
-
currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
|
|
568
|
-
end: end
|
|
569
|
-
}));
|
|
570
|
-
interaction.hold3pActive.delete(id);
|
|
533
|
+
if (interaction.hold3pActive) {
|
|
534
|
+
var current3pHold = interaction.hold3pActive.get(id);
|
|
535
|
+
if (currentInteraction != null && current3pHold != null) {
|
|
536
|
+
if (!currentInteraction.hold3pInfo) {
|
|
537
|
+
currentInteraction.hold3pInfo = [];
|
|
571
538
|
}
|
|
539
|
+
currentInteraction.hold3pInfo.push(_objectSpread(_objectSpread({}, current3pHold), {}, {
|
|
540
|
+
end: end
|
|
541
|
+
}));
|
|
542
|
+
interaction.hold3pActive.delete(id);
|
|
572
543
|
}
|
|
573
544
|
}
|
|
574
545
|
}
|
|
@@ -644,7 +615,7 @@ function addErrorToAll(name, labelStack, errorType, errorMessage, errorStack, er
|
|
|
644
615
|
});
|
|
645
616
|
}
|
|
646
617
|
function addProfilerTimings(interactionId, labelStack, type, actualDuration, baseDuration, startTime, commitTime) {
|
|
647
|
-
var
|
|
618
|
+
var _getConfig2;
|
|
648
619
|
if (isPerformanceTracingEnabled()) {
|
|
649
620
|
try {
|
|
650
621
|
// for Firefox 102 and older
|
|
@@ -672,7 +643,7 @@ function addProfilerTimings(interactionId, labelStack, type, actualDuration, bas
|
|
|
672
643
|
startTime: startTime,
|
|
673
644
|
commitTime: commitTime
|
|
674
645
|
});
|
|
675
|
-
} else if ((
|
|
646
|
+
} else if ((_getConfig2 = (0, _config.getConfig)()) !== null && _getConfig2 !== void 0 && (_getConfig2 = _getConfig2.postInteractionLog) !== null && _getConfig2 !== void 0 && _getConfig2.enabled) {
|
|
676
647
|
postInteractionLog.addProfilerTimings(labelStack, type, actualDuration, baseDuration, startTime, commitTime);
|
|
677
648
|
}
|
|
678
649
|
}
|
|
@@ -689,7 +660,7 @@ function callCleanUpCallbacks(interaction) {
|
|
|
689
660
|
});
|
|
690
661
|
}
|
|
691
662
|
function finishInteraction(id, data) {
|
|
692
|
-
var
|
|
663
|
+
var _getConfig3;
|
|
693
664
|
var endTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : performance.now();
|
|
694
665
|
data.end = endTime;
|
|
695
666
|
try {
|
|
@@ -722,7 +693,7 @@ function finishInteraction(id, data) {
|
|
|
722
693
|
(0, _experienceTraceIdContext.clearActiveTrace)();
|
|
723
694
|
callCleanUpCallbacks(data);
|
|
724
695
|
(0, _ssrRenderProfiler.flushSsrRenderProfilerTraces)();
|
|
725
|
-
if ((
|
|
696
|
+
if ((_getConfig3 = (0, _config.getConfig)()) !== null && _getConfig3 !== void 0 && (_getConfig3 = _getConfig3.vc) !== null && _getConfig3 !== void 0 && _getConfig3.stopVCAtInteractionFinish) {
|
|
726
697
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
727
698
|
var observer = data.vcObserver;
|
|
728
699
|
if (observer) {
|
|
@@ -738,19 +709,11 @@ function finishInteraction(id, data) {
|
|
|
738
709
|
if (!(0, _coinflip.default)((0, _config.getPostInteractionRate)(sanitisedUfoName, data.type))) {
|
|
739
710
|
postInteractionLog.stopVCObserver();
|
|
740
711
|
}
|
|
741
|
-
if ((0,
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
var _getConfig5;
|
|
747
|
-
if (!((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
|
|
748
|
-
remove(id);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
} else {
|
|
752
|
-
var _getConfig6;
|
|
753
|
-
if (!((_getConfig6 = (0, _config.getConfig)()) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.experimentalInteractionMetrics) !== null && _getConfig6 !== void 0 && _getConfig6.enabled)) {
|
|
712
|
+
if (!(0, _coinflip.default)((0, _config.getExtraInteractionRate)(sanitisedUfoName, data.type))) {
|
|
713
|
+
interactionExtraMetrics.stopAll(id);
|
|
714
|
+
} else if (!data.hold3pActive || data.hold3pActive.size === 0) {
|
|
715
|
+
var _getConfig4;
|
|
716
|
+
if (!((_getConfig4 = (0, _config.getConfig)()) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.experimentalInteractionMetrics) !== null && _getConfig4 !== void 0 && _getConfig4.enabled)) {
|
|
754
717
|
remove(id);
|
|
755
718
|
}
|
|
756
719
|
}
|
|
@@ -762,13 +725,9 @@ function finishInteraction(id, data) {
|
|
|
762
725
|
PreviousInteractionLog.name = data.ufoName || 'unknown';
|
|
763
726
|
PreviousInteractionLog.isAborted = data.abortReason != null;
|
|
764
727
|
if (data.ufoName) {
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
// If this same interaction was not already handled, handle it
|
|
769
|
-
handleInteraction(id, data);
|
|
770
|
-
}
|
|
771
|
-
} else {
|
|
728
|
+
var _interactionExtraMetr;
|
|
729
|
+
if (((_interactionExtraMetr = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr === void 0 ? void 0 : _interactionExtraMetr.id) !== id) {
|
|
730
|
+
// If this same interaction was not already handled, handle it
|
|
772
731
|
handleInteraction(id, data);
|
|
773
732
|
}
|
|
774
733
|
}
|
|
@@ -844,21 +803,22 @@ var activeSubmitted = false;
|
|
|
844
803
|
function tryComplete(interactionId, endTime) {
|
|
845
804
|
var interaction = _constants.interactions.get(interactionId);
|
|
846
805
|
if (interaction != null) {
|
|
806
|
+
var _interaction$hold3pAc;
|
|
847
807
|
var noMoreActiveHolds = interaction.holdActive.size === 0;
|
|
848
808
|
var noMoreExpHolds = interaction.holdExpActive.size === 0;
|
|
849
809
|
var shouldUseRawDataThirdParty = (0, _config.shouldUseRawDataThirdPartyBehavior)(interaction.ufoName, interaction.type);
|
|
850
810
|
var postInteraction = /*#__PURE__*/function () {
|
|
851
811
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
852
|
-
var
|
|
853
|
-
var
|
|
812
|
+
var _getConfig5, _interactionExtraMetr2;
|
|
813
|
+
var _getConfig6, experimentalVC90, experimentalTTAI, _yield$getExperimenta, start, end, _getConfig7;
|
|
854
814
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
855
815
|
while (1) switch (_context.prev = _context.next) {
|
|
856
816
|
case 0:
|
|
857
|
-
if (!((
|
|
817
|
+
if (!((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.postInteractionLog) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
|
|
858
818
|
_context.next = 17;
|
|
859
819
|
break;
|
|
860
820
|
}
|
|
861
|
-
if (!((
|
|
821
|
+
if (!((_getConfig6 = (0, _config.getConfig)()) !== null && _getConfig6 !== void 0 && (_getConfig6 = _getConfig6.experimentalInteractionMetrics) !== null && _getConfig6 !== void 0 && _getConfig6.enabled)) {
|
|
862
822
|
_context.next = 16;
|
|
863
823
|
break;
|
|
864
824
|
}
|
|
@@ -892,15 +852,9 @@ function tryComplete(interactionId, endTime) {
|
|
|
892
852
|
experimentalVC90: experimentalVC90
|
|
893
853
|
}));
|
|
894
854
|
case 17:
|
|
895
|
-
if ((0
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
if ((_getConfig9 = (0, _config.getConfig)()) !== null && _getConfig9 !== void 0 && (_getConfig9 = _getConfig9.experimentalInteractionMetrics) !== null && _getConfig9 !== void 0 && _getConfig9.enabled) {
|
|
899
|
-
remove(interactionId);
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
} else {
|
|
903
|
-
if ((_getConfig0 = (0, _config.getConfig)()) !== null && _getConfig0 !== void 0 && (_getConfig0 = _getConfig0.experimentalInteractionMetrics) !== null && _getConfig0 !== void 0 && _getConfig0.enabled) {
|
|
855
|
+
if (((_interactionExtraMetr2 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr2 === void 0 ? void 0 : _interactionExtraMetr2.id) !== interactionId) {
|
|
856
|
+
// If interactionExtraMetrics is not waiting for measuring this interaction
|
|
857
|
+
if ((_getConfig7 = (0, _config.getConfig)()) !== null && _getConfig7 !== void 0 && (_getConfig7 = _getConfig7.experimentalInteractionMetrics) !== null && _getConfig7 !== void 0 && _getConfig7.enabled) {
|
|
904
858
|
remove(interactionId);
|
|
905
859
|
}
|
|
906
860
|
}
|
|
@@ -915,103 +869,82 @@ function tryComplete(interactionId, endTime) {
|
|
|
915
869
|
return _ref.apply(this, arguments);
|
|
916
870
|
};
|
|
917
871
|
}();
|
|
918
|
-
|
|
919
|
-
var _interaction$hold3pAc;
|
|
920
|
-
var noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
|
|
872
|
+
var noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
|
|
921
873
|
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}
|
|
931
|
-
// Wait for 3p holds to clear before finishing
|
|
932
|
-
return;
|
|
874
|
+
// If using raw data third party behavior, wait for 3p holds to clear
|
|
875
|
+
if (shouldUseRawDataThirdParty) {
|
|
876
|
+
// If there are no non-3p holds active, mark the interaction as successful
|
|
877
|
+
// but don't finish until 3p holds are cleared
|
|
878
|
+
if (noMoreActiveHolds && !noMoreActive3pHolds) {
|
|
879
|
+
// Mark interaction as successful by setting endTime, but don't finish yet
|
|
880
|
+
if (endTime !== undefined && interaction.end === 0) {
|
|
881
|
+
interaction.end = endTime;
|
|
933
882
|
}
|
|
883
|
+
// Wait for 3p holds to clear before finishing
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
934
886
|
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
if ((_getConfig10 = (0, _config.getConfig)()) !== null && _getConfig10 !== void 0 && (_getConfig10 = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10 !== void 0 && _getConfig10.enabled && interaction.ufoName === ((_getConfig11 = (0, _config.getConfig)()) === null || _getConfig11 === void 0 || (_getConfig11 = _getConfig11.extraSearchPageInteraction) === null || _getConfig11 === void 0 ? void 0 : _getConfig11.searchPageMetricName)) {
|
|
947
|
-
(0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
|
|
948
|
-
}
|
|
949
|
-
activeSubmitted = true;
|
|
887
|
+
// If all holds (including 3p) are cleared, finish the interaction
|
|
888
|
+
if (noMoreActiveHolds && noMoreActive3pHolds) {
|
|
889
|
+
if (!activeSubmitted) {
|
|
890
|
+
var _getConfig8, _getConfig9, _getConfig0;
|
|
891
|
+
// Set end3p to current time when 3p holds cleared, but ensure it's at least interaction.end
|
|
892
|
+
var currentTime = endTime !== null && endTime !== void 0 ? endTime : performance.now();
|
|
893
|
+
interaction.end3p = interaction.end !== 0 && currentTime < interaction.end ? interaction.end : currentTime;
|
|
894
|
+
finishInteraction(interactionId, interaction, interaction.end !== 0 ? interaction.end : endTime);
|
|
895
|
+
if ((_getConfig8 = (0, _config.getConfig)()) !== null && _getConfig8 !== void 0 && (_getConfig8 = _getConfig8.extraInteractionMetrics) !== null && _getConfig8 !== void 0 && _getConfig8.enabled) {
|
|
896
|
+
interactionExtraMetrics.updateFinishedInteraction(interaction);
|
|
950
897
|
}
|
|
951
|
-
if (
|
|
952
|
-
|
|
953
|
-
if ((_getConfig12 = (0, _config.getConfig)()) !== null && _getConfig12 !== void 0 && (_getConfig12 = _getConfig12.experimentalInteractionMetrics) !== null && _getConfig12 !== void 0 && _getConfig12.enabled) {
|
|
954
|
-
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime || interaction.end);
|
|
955
|
-
}
|
|
956
|
-
postInteraction();
|
|
898
|
+
if ((_getConfig9 = (0, _config.getConfig)()) !== null && _getConfig9 !== void 0 && (_getConfig9 = _getConfig9.extraSearchPageInteraction) !== null && _getConfig9 !== void 0 && _getConfig9.enabled && interaction.ufoName === ((_getConfig0 = (0, _config.getConfig)()) === null || _getConfig0 === void 0 || (_getConfig0 = _getConfig0.extraSearchPageInteraction) === null || _getConfig0 === void 0 ? void 0 : _getConfig0.searchPageMetricName)) {
|
|
899
|
+
(0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
|
|
957
900
|
}
|
|
901
|
+
activeSubmitted = true;
|
|
958
902
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
});
|
|
964
|
-
interactionExtraMetrics.onInteractionComplete(interactionId, data);
|
|
965
|
-
}
|
|
966
|
-
} else {
|
|
967
|
-
var _interactionExtraMetr3;
|
|
968
|
-
// Original behavior when feature flag is not active
|
|
969
|
-
if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
|
|
970
|
-
// If it's not waiting for extra metrics to complete, finish the interaction as normal
|
|
971
|
-
if (!activeSubmitted) {
|
|
972
|
-
var _getConfig13, _getConfig14, _getConfig15;
|
|
973
|
-
finishInteraction(interactionId, interaction, endTime);
|
|
974
|
-
if ((_getConfig13 = (0, _config.getConfig)()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.extraInteractionMetrics) !== null && _getConfig13 !== void 0 && _getConfig13.enabled) {
|
|
975
|
-
interactionExtraMetrics.updateFinishedInteraction(interaction);
|
|
976
|
-
}
|
|
977
|
-
if ((_getConfig14 = (0, _config.getConfig)()) !== null && _getConfig14 !== void 0 && (_getConfig14 = _getConfig14.extraSearchPageInteraction) !== null && _getConfig14 !== void 0 && _getConfig14.enabled && interaction.ufoName === ((_getConfig15 = (0, _config.getConfig)()) === null || _getConfig15 === void 0 || (_getConfig15 = _getConfig15.extraSearchPageInteraction) === null || _getConfig15 === void 0 ? void 0 : _getConfig15.searchPageMetricName)) {
|
|
978
|
-
(0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
|
|
979
|
-
}
|
|
980
|
-
activeSubmitted = true;
|
|
981
|
-
}
|
|
982
|
-
if (noMoreExpHolds) {
|
|
983
|
-
var _getConfig16;
|
|
984
|
-
if ((_getConfig16 = (0, _config.getConfig)()) !== null && _getConfig16 !== void 0 && (_getConfig16 = _getConfig16.experimentalInteractionMetrics) !== null && _getConfig16 !== void 0 && _getConfig16.enabled) {
|
|
985
|
-
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
|
|
986
|
-
}
|
|
987
|
-
postInteraction();
|
|
903
|
+
if (noMoreExpHolds) {
|
|
904
|
+
var _getConfig1;
|
|
905
|
+
if ((_getConfig1 = (0, _config.getConfig)()) !== null && _getConfig1 !== void 0 && (_getConfig1 = _getConfig1.experimentalInteractionMetrics) !== null && _getConfig1 !== void 0 && _getConfig1.enabled) {
|
|
906
|
+
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime || interaction.end);
|
|
988
907
|
}
|
|
908
|
+
postInteraction();
|
|
989
909
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
}
|
|
910
|
+
}
|
|
911
|
+
// Send separated third-party event even when feature flag is active
|
|
912
|
+
if (noMoreActiveHolds && noMoreActive3pHolds) {
|
|
913
|
+
var data = _objectSpread(_objectSpread({}, interaction), {}, {
|
|
914
|
+
end: endTime || interaction.end
|
|
915
|
+
});
|
|
916
|
+
interactionExtraMetrics.onInteractionComplete(interactionId, data);
|
|
996
917
|
}
|
|
997
918
|
} else {
|
|
998
|
-
|
|
919
|
+
var _interactionExtraMetr3;
|
|
920
|
+
// Original behavior when feature flag is not active
|
|
921
|
+
if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
|
|
922
|
+
// If it's not waiting for extra metrics to complete, finish the interaction as normal
|
|
999
923
|
if (!activeSubmitted) {
|
|
1000
|
-
var
|
|
924
|
+
var _getConfig10, _getConfig11, _getConfig12;
|
|
1001
925
|
finishInteraction(interactionId, interaction, endTime);
|
|
1002
|
-
if ((
|
|
926
|
+
if ((_getConfig10 = (0, _config.getConfig)()) !== null && _getConfig10 !== void 0 && (_getConfig10 = _getConfig10.extraInteractionMetrics) !== null && _getConfig10 !== void 0 && _getConfig10.enabled) {
|
|
927
|
+
interactionExtraMetrics.updateFinishedInteraction(interaction);
|
|
928
|
+
}
|
|
929
|
+
if ((_getConfig11 = (0, _config.getConfig)()) !== null && _getConfig11 !== void 0 && (_getConfig11 = _getConfig11.extraSearchPageInteraction) !== null && _getConfig11 !== void 0 && _getConfig11.enabled && interaction.ufoName === ((_getConfig12 = (0, _config.getConfig)()) === null || _getConfig12 === void 0 || (_getConfig12 = _getConfig12.extraSearchPageInteraction) === null || _getConfig12 === void 0 ? void 0 : _getConfig12.searchPageMetricName)) {
|
|
1003
930
|
(0, _createExtraSearchPageInteractionPayload.onSearchPageInteractionComplete)(interactionId, interaction);
|
|
1004
931
|
}
|
|
1005
932
|
activeSubmitted = true;
|
|
1006
933
|
}
|
|
1007
934
|
if (noMoreExpHolds) {
|
|
1008
|
-
var
|
|
1009
|
-
if ((
|
|
935
|
+
var _getConfig13;
|
|
936
|
+
if ((_getConfig13 = (0, _config.getConfig)()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.experimentalInteractionMetrics) !== null && _getConfig13 !== void 0 && _getConfig13.enabled) {
|
|
1010
937
|
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
|
|
1011
938
|
}
|
|
1012
939
|
postInteraction();
|
|
1013
940
|
}
|
|
1014
941
|
}
|
|
942
|
+
if (noMoreActiveHolds && noMoreActive3pHolds) {
|
|
943
|
+
var _data2 = _objectSpread(_objectSpread({}, interaction), {}, {
|
|
944
|
+
end: endTime
|
|
945
|
+
});
|
|
946
|
+
interactionExtraMetrics.onInteractionComplete(interactionId, _data2);
|
|
947
|
+
}
|
|
1015
948
|
}
|
|
1016
949
|
}
|
|
1017
950
|
}
|
|
@@ -1034,9 +967,7 @@ function abort(interactionId, abortReason) {
|
|
|
1034
967
|
finishInteraction(interactionId, interaction, endTime);
|
|
1035
968
|
postInteractionLog.reset();
|
|
1036
969
|
postInteractionLog.stopVCObserver();
|
|
1037
|
-
|
|
1038
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1039
|
-
}
|
|
970
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1040
971
|
if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
|
|
1041
972
|
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
|
|
1042
973
|
remove(interactionId);
|
|
@@ -1048,9 +979,7 @@ function abort(interactionId, abortReason) {
|
|
|
1048
979
|
finishInteraction(interactionId, interaction);
|
|
1049
980
|
postInteractionLog.reset();
|
|
1050
981
|
postInteractionLog.stopVCObserver();
|
|
1051
|
-
|
|
1052
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1053
|
-
}
|
|
982
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1054
983
|
if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
|
|
1055
984
|
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction);
|
|
1056
985
|
remove(interactionId);
|
|
@@ -1072,9 +1001,7 @@ function abortByNewInteraction(interactionId, interactionName) {
|
|
|
1072
1001
|
finishInteraction(interactionId, interaction, endTime);
|
|
1073
1002
|
postInteractionLog.reset();
|
|
1074
1003
|
postInteractionLog.stopVCObserver();
|
|
1075
|
-
|
|
1076
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1077
|
-
}
|
|
1004
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1078
1005
|
if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
|
|
1079
1006
|
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
|
|
1080
1007
|
remove(interactionId);
|
|
@@ -1087,9 +1014,7 @@ function abortByNewInteraction(interactionId, interactionName) {
|
|
|
1087
1014
|
finishInteraction(interactionId, interaction);
|
|
1088
1015
|
postInteractionLog.reset();
|
|
1089
1016
|
postInteractionLog.stopVCObserver();
|
|
1090
|
-
|
|
1091
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1092
|
-
}
|
|
1017
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1093
1018
|
if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
|
|
1094
1019
|
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction);
|
|
1095
1020
|
remove(interactionId);
|
|
@@ -1122,9 +1047,7 @@ function abortAll(abortReason, abortedByInteractionName) {
|
|
|
1122
1047
|
finishInteraction(interactionId, interaction, endTime);
|
|
1123
1048
|
postInteractionLog.reset();
|
|
1124
1049
|
postInteractionLog.stopVCObserver();
|
|
1125
|
-
|
|
1126
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1127
|
-
}
|
|
1050
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1128
1051
|
if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
|
|
1129
1052
|
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction, endTime);
|
|
1130
1053
|
remove(interactionId);
|
|
@@ -1141,9 +1064,7 @@ function abortAll(abortReason, abortedByInteractionName) {
|
|
|
1141
1064
|
finishInteraction(interactionId, interaction);
|
|
1142
1065
|
postInteractionLog.reset();
|
|
1143
1066
|
postInteractionLog.stopVCObserver();
|
|
1144
|
-
|
|
1145
|
-
interactionExtraMetrics.stopAll(interactionId);
|
|
1146
|
-
}
|
|
1067
|
+
interactionExtraMetrics.stopAll(interactionId);
|
|
1147
1068
|
if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(interaction.ufoName, interaction.type))) {
|
|
1148
1069
|
(0, _createExperimentalInteractionMetricsPayload.onExperimentalInteractionComplete)(interactionId, interaction);
|
|
1149
1070
|
remove(interactionId);
|
|
@@ -1274,7 +1195,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
|
|
|
1274
1195
|
addHoldByID(interactionId, [], ufoName, ufoName, true);
|
|
1275
1196
|
}
|
|
1276
1197
|
if (type === 'transition' || type === 'page_load') {
|
|
1277
|
-
var
|
|
1198
|
+
var _getConfig14, _config$extraInteract;
|
|
1278
1199
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
1279
1200
|
var observer = vcObserver;
|
|
1280
1201
|
if (observer) {
|
|
@@ -1285,7 +1206,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
|
|
|
1285
1206
|
}
|
|
1286
1207
|
// Start post interaction observer for all if config is enabled
|
|
1287
1208
|
// in case ufoName is updated at later time
|
|
1288
|
-
if ((
|
|
1209
|
+
if ((_getConfig14 = (0, _config.getConfig)()) !== null && _getConfig14 !== void 0 && (_getConfig14 = _getConfig14.postInteractionLog) !== null && _getConfig14 !== void 0 && _getConfig14.enabled) {
|
|
1289
1210
|
postInteractionLog.startVCObserver({
|
|
1290
1211
|
startTime: startTime
|
|
1291
1212
|
});
|
|
@@ -1295,7 +1216,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
|
|
|
1295
1216
|
startTime: startTime
|
|
1296
1217
|
});
|
|
1297
1218
|
}
|
|
1298
|
-
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled
|
|
1219
|
+
if (config !== null && config !== void 0 && (_config$extraInteract = config.extraInteractionMetrics) !== null && _config$extraInteract !== void 0 && _config$extraInteract.enabled) {
|
|
1299
1220
|
interactionExtraMetrics.startVCObserver({
|
|
1300
1221
|
startTime: startTime
|
|
1301
1222
|
}, interactionId);
|
|
@@ -208,7 +208,7 @@ function init(analyticsWebClientAsync, config) {
|
|
|
208
208
|
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
209
209
|
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
210
210
|
}
|
|
211
|
-
if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled
|
|
211
|
+
if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled) {
|
|
212
212
|
sinkInteractionExtraMetrics(instance, createInteractionExtraMetricsPayloadPackage.default);
|
|
213
213
|
}
|
|
214
214
|
if (config !== null && config !== void 0 && (_config$extraSearchPa = config.extraSearchPageInteraction) !== null && _config$extraSearchPa !== void 0 && _config$extraSearchPa.enabled) {
|
|
@@ -227,7 +227,7 @@ function init(analyticsWebClientAsync, config) {
|
|
|
227
227
|
if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
|
|
228
228
|
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
229
229
|
}
|
|
230
|
-
if (config !== null && config !== void 0 && (_config$extraInteract3 = config.extraInteractionMetrics) !== null && _config$extraInteract3 !== void 0 && _config$extraInteract3.enabled
|
|
230
|
+
if (config !== null && config !== void 0 && (_config$extraInteract3 = config.extraInteractionMetrics) !== null && _config$extraInteract3 !== void 0 && _config$extraInteract3.enabled) {
|
|
231
231
|
sinkInteractionExtraMetrics(awc, createInteractionExtraMetricsPayloadPackage.default);
|
|
232
232
|
}
|
|
233
233
|
if (config !== null && config !== void 0 && (_config$extraSearchPa2 = config.extraSearchPageInteraction) !== null && _config$extraSearchPa2 !== void 0 && _config$extraSearchPa2.enabled) {
|
|
@@ -8,20 +8,13 @@ exports.UFOThirdPartySegment = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
-
var _ignoreHolds = _interopRequireDefault(require("../ignore-holds"));
|
|
13
11
|
var _segment = _interopRequireDefault(require("./segment"));
|
|
14
12
|
var _excluded = ["children"];
|
|
15
13
|
var UFOThirdPartySegment = exports.UFOThirdPartySegment = function UFOThirdPartySegment(props) {
|
|
16
14
|
var children = props.children,
|
|
17
15
|
otherProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
18
|
-
return
|
|
16
|
+
return /*#__PURE__*/_react.default.createElement(_segment.default, (0, _extends2.default)({
|
|
19
17
|
type: "third-party"
|
|
20
|
-
}, otherProps), children)
|
|
21
|
-
type: "third-party"
|
|
22
|
-
}, otherProps), /*#__PURE__*/_react.default.createElement(_ignoreHolds.default, {
|
|
23
|
-
ignore: (0, _platformFeatureFlags.fg)('platform_ufo_exclude_3p_elements_from_ttai'),
|
|
24
|
-
reason: "third-party-element"
|
|
25
|
-
}, children));
|
|
18
|
+
}, otherProps), children);
|
|
26
19
|
};
|
|
27
20
|
UFOThirdPartySegment.displayName = 'UFOThirdPartySegment';
|
|
@@ -12,7 +12,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _percentileCalc = require("./percentile-calc");
|
|
17
16
|
var _detectLayoutShiftCause = require("./utils/detect-layout-shift-cause");
|
|
18
17
|
var _getViewportHeight = _interopRequireDefault(require("./utils/get-viewport-height"));
|
|
@@ -253,7 +252,7 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
253
252
|
viewportPercentage: log.viewportPercentage
|
|
254
253
|
});
|
|
255
254
|
}) : []; // If 3p metric enabled - calculate the debug details
|
|
256
|
-
shouldCalculate3p = include3p
|
|
255
|
+
shouldCalculate3p = include3p; // Only calculate enhanced debug details if devtool callbacks exist
|
|
257
256
|
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');
|
|
258
257
|
if (shouldCalculateDebugDetails && allEntries && vcLogs) {
|
|
259
258
|
// Pre-sort vcLogs by time for efficient lookups
|