@atlaskit/react-ufo 4.15.18 → 4.16.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/config/index.js +7 -0
  3. package/dist/cjs/create-payload/index.js +5 -4
  4. package/dist/cjs/create-payload/utils/get-vc-metrics.js +2 -0
  5. package/dist/cjs/interaction-metrics/index.js +139 -28
  6. package/dist/cjs/vc/index.js +2 -1
  7. package/dist/cjs/vc/vc-observer-new/index.js +15 -10
  8. package/dist/es2019/config/index.js +6 -0
  9. package/dist/es2019/create-payload/index.js +5 -4
  10. package/dist/es2019/create-payload/utils/get-vc-metrics.js +2 -0
  11. package/dist/es2019/interaction-metrics/index.js +142 -30
  12. package/dist/es2019/vc/index.js +2 -1
  13. package/dist/es2019/vc/vc-observer-new/index.js +10 -3
  14. package/dist/esm/config/index.js +6 -0
  15. package/dist/esm/create-payload/index.js +6 -5
  16. package/dist/esm/create-payload/utils/get-vc-metrics.js +2 -0
  17. package/dist/esm/interaction-metrics/index.js +140 -29
  18. package/dist/esm/vc/index.js +2 -1
  19. package/dist/esm/vc/vc-observer-new/index.js +15 -10
  20. package/dist/types/common/common/types.d.ts +1 -0
  21. package/dist/types/common/react-ufo-payload-schema.d.ts +1 -0
  22. package/dist/types/config/index.d.ts +10 -0
  23. package/dist/types/vc/types.d.ts +1 -0
  24. package/dist/types/vc/vc-observer-new/types.d.ts +1 -0
  25. package/dist/types-ts4.5/common/common/types.d.ts +1 -0
  26. package/dist/types-ts4.5/common/react-ufo-payload-schema.d.ts +1 -0
  27. package/dist/types-ts4.5/config/index.d.ts +10 -0
  28. package/dist/types-ts4.5/vc/types.d.ts +1 -0
  29. package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -0
  30. package/package.json +4 -1
@@ -12,7 +12,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
12
12
  import { v4 as createUUID } from 'uuid';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
14
  import coinflip from '../coinflip';
15
- import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getFinishInteractionOnTransition, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
15
+ import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getFinishInteractionOnTransition, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats, shouldUseRawDataThirdPartyBehavior } from '../config';
16
16
  import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
17
17
  import { onSearchPageInteractionComplete } from '../create-extra-search-page-interaction-payload';
18
18
  import { sanitizeUfoName, stringifyLabelStackFully } from '../create-payload/common/utils';
@@ -789,6 +789,7 @@ export function tryComplete(interactionId, endTime) {
789
789
  if (interaction != null) {
790
790
  var noMoreActiveHolds = interaction.holdActive.size === 0;
791
791
  var noMoreExpHolds = interaction.holdExpActive.size === 0;
792
+ var shouldUseRawDataThirdParty = shouldUseRawDataThirdPartyBehavior(interaction.ufoName, interaction.type);
792
793
  var postInteraction = /*#__PURE__*/function () {
793
794
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
794
795
  var _getConfig7;
@@ -858,48 +859,97 @@ export function tryComplete(interactionId, endTime) {
858
859
  };
859
860
  }();
860
861
  if (fg('platform_ufo_enable_ttai_with_3p')) {
861
- var _interaction$hold3pAc, _interactionExtraMetr3;
862
+ var _interaction$hold3pAc;
862
863
  var noMoreActive3pHolds = ((_interaction$hold3pAc = interaction.hold3pActive) === null || _interaction$hold3pAc === void 0 ? void 0 : _interaction$hold3pAc.size) === 0 || interaction.hold3pActive === undefined;
863
- if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
864
- // If it's not waiting for extra metrics to complete, finish the interaction as normal
865
- if (!activeSubmitted) {
866
- var _getConfig1, _getConfig10, _getConfig11;
867
- finishInteraction(interactionId, interaction, endTime);
868
- if ((_getConfig1 = getConfig()) !== null && _getConfig1 !== void 0 && (_getConfig1 = _getConfig1.extraInteractionMetrics) !== null && _getConfig1 !== void 0 && _getConfig1.enabled) {
869
- interactionExtraMetrics.updateFinishedInteraction(interaction);
864
+
865
+ // If using raw data third party behavior, wait for 3p holds to clear
866
+ if (shouldUseRawDataThirdParty) {
867
+ // If there are no non-3p holds active, mark the interaction as successful
868
+ // but don't finish until 3p holds are cleared
869
+ if (noMoreActiveHolds && !noMoreActive3pHolds) {
870
+ // Mark interaction as successful by setting endTime, but don't finish yet
871
+ if (endTime !== undefined && interaction.end === 0) {
872
+ interaction.end = endTime;
870
873
  }
871
- if ((_getConfig10 = getConfig()) !== null && _getConfig10 !== void 0 && (_getConfig10 = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10 !== void 0 && _getConfig10.enabled && interaction.ufoName === ((_getConfig11 = getConfig()) === null || _getConfig11 === void 0 || (_getConfig11 = _getConfig11.extraSearchPageInteraction) === null || _getConfig11 === void 0 ? void 0 : _getConfig11.searchPageMetricName)) {
872
- onSearchPageInteractionComplete(interactionId, interaction);
874
+ // Wait for 3p holds to clear before finishing
875
+ return;
876
+ }
877
+
878
+ // If all holds (including 3p) are cleared, finish the interaction
879
+ if (noMoreActiveHolds && noMoreActive3pHolds) {
880
+ if (!activeSubmitted) {
881
+ var _getConfig1, _getConfig10, _getConfig11;
882
+ // Set end3p to current time when 3p holds cleared, but ensure it's at least interaction.end
883
+ var currentTime = endTime !== null && endTime !== void 0 ? endTime : performance.now();
884
+ interaction.end3p = interaction.end !== 0 && currentTime < interaction.end ? interaction.end : currentTime;
885
+ finishInteraction(interactionId, interaction, interaction.end !== 0 ? interaction.end : endTime);
886
+ if ((_getConfig1 = getConfig()) !== null && _getConfig1 !== void 0 && (_getConfig1 = _getConfig1.extraInteractionMetrics) !== null && _getConfig1 !== void 0 && _getConfig1.enabled) {
887
+ interactionExtraMetrics.updateFinishedInteraction(interaction);
888
+ }
889
+ if ((_getConfig10 = getConfig()) !== null && _getConfig10 !== void 0 && (_getConfig10 = _getConfig10.extraSearchPageInteraction) !== null && _getConfig10 !== void 0 && _getConfig10.enabled && interaction.ufoName === ((_getConfig11 = getConfig()) === null || _getConfig11 === void 0 || (_getConfig11 = _getConfig11.extraSearchPageInteraction) === null || _getConfig11 === void 0 ? void 0 : _getConfig11.searchPageMetricName)) {
890
+ onSearchPageInteractionComplete(interactionId, interaction);
891
+ }
892
+ activeSubmitted = true;
893
+ }
894
+ if (noMoreExpHolds) {
895
+ var _getConfig12;
896
+ if ((_getConfig12 = getConfig()) !== null && _getConfig12 !== void 0 && (_getConfig12 = _getConfig12.experimentalInteractionMetrics) !== null && _getConfig12 !== void 0 && _getConfig12.enabled) {
897
+ onExperimentalInteractionComplete(interactionId, interaction, endTime || interaction.end);
898
+ }
899
+ postInteraction();
873
900
  }
874
- activeSubmitted = true;
875
901
  }
876
- if (noMoreExpHolds) {
877
- var _getConfig12;
878
- if ((_getConfig12 = getConfig()) !== null && _getConfig12 !== void 0 && (_getConfig12 = _getConfig12.experimentalInteractionMetrics) !== null && _getConfig12 !== void 0 && _getConfig12.enabled) {
879
- onExperimentalInteractionComplete(interactionId, interaction, endTime);
902
+ // Send separated third-party event even when feature flag is active
903
+ if (noMoreActiveHolds && noMoreActive3pHolds) {
904
+ var data = _objectSpread(_objectSpread({}, interaction), {}, {
905
+ end: endTime || interaction.end
906
+ });
907
+ interactionExtraMetrics.onInteractionComplete(interactionId, data);
908
+ }
909
+ } else {
910
+ var _interactionExtraMetr3;
911
+ // Original behavior when feature flag is not active
912
+ if (noMoreActiveHolds && ((_interactionExtraMetr3 = interactionExtraMetrics.finishedInteraction) === null || _interactionExtraMetr3 === void 0 ? void 0 : _interactionExtraMetr3.id) !== interactionId) {
913
+ // If it's not waiting for extra metrics to complete, finish the interaction as normal
914
+ if (!activeSubmitted) {
915
+ var _getConfig13, _getConfig14, _getConfig15;
916
+ finishInteraction(interactionId, interaction, endTime);
917
+ if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.extraInteractionMetrics) !== null && _getConfig13 !== void 0 && _getConfig13.enabled) {
918
+ interactionExtraMetrics.updateFinishedInteraction(interaction);
919
+ }
920
+ if ((_getConfig14 = getConfig()) !== null && _getConfig14 !== void 0 && (_getConfig14 = _getConfig14.extraSearchPageInteraction) !== null && _getConfig14 !== void 0 && _getConfig14.enabled && interaction.ufoName === ((_getConfig15 = getConfig()) === null || _getConfig15 === void 0 || (_getConfig15 = _getConfig15.extraSearchPageInteraction) === null || _getConfig15 === void 0 ? void 0 : _getConfig15.searchPageMetricName)) {
921
+ onSearchPageInteractionComplete(interactionId, interaction);
922
+ }
923
+ activeSubmitted = true;
924
+ }
925
+ if (noMoreExpHolds) {
926
+ var _getConfig16;
927
+ if ((_getConfig16 = getConfig()) !== null && _getConfig16 !== void 0 && (_getConfig16 = _getConfig16.experimentalInteractionMetrics) !== null && _getConfig16 !== void 0 && _getConfig16.enabled) {
928
+ onExperimentalInteractionComplete(interactionId, interaction, endTime);
929
+ }
930
+ postInteraction();
880
931
  }
881
- postInteraction();
882
932
  }
883
- }
884
- if (noMoreActiveHolds && noMoreActive3pHolds) {
885
- var data = _objectSpread(_objectSpread({}, interaction), {}, {
886
- end: endTime
887
- });
888
- interactionExtraMetrics.onInteractionComplete(interactionId, data);
933
+ if (noMoreActiveHolds && noMoreActive3pHolds) {
934
+ var _data2 = _objectSpread(_objectSpread({}, interaction), {}, {
935
+ end: endTime
936
+ });
937
+ interactionExtraMetrics.onInteractionComplete(interactionId, _data2);
938
+ }
889
939
  }
890
940
  } else {
891
941
  if (noMoreActiveHolds) {
892
942
  if (!activeSubmitted) {
893
- var _getConfig13, _getConfig14;
943
+ var _getConfig17, _getConfig18;
894
944
  finishInteraction(interactionId, interaction, endTime);
895
- if ((_getConfig13 = getConfig()) !== null && _getConfig13 !== void 0 && (_getConfig13 = _getConfig13.extraSearchPageInteraction) !== null && _getConfig13 !== void 0 && _getConfig13.enabled && interaction.ufoName === ((_getConfig14 = getConfig()) === null || _getConfig14 === void 0 || (_getConfig14 = _getConfig14.extraSearchPageInteraction) === null || _getConfig14 === void 0 ? void 0 : _getConfig14.searchPageMetricName)) {
945
+ if ((_getConfig17 = getConfig()) !== null && _getConfig17 !== void 0 && (_getConfig17 = _getConfig17.extraSearchPageInteraction) !== null && _getConfig17 !== void 0 && _getConfig17.enabled && interaction.ufoName === ((_getConfig18 = getConfig()) === null || _getConfig18 === void 0 || (_getConfig18 = _getConfig18.extraSearchPageInteraction) === null || _getConfig18 === void 0 ? void 0 : _getConfig18.searchPageMetricName)) {
896
946
  onSearchPageInteractionComplete(interactionId, interaction);
897
947
  }
898
948
  activeSubmitted = true;
899
949
  }
900
950
  if (noMoreExpHolds) {
901
- var _getConfig15;
902
- if ((_getConfig15 = getConfig()) !== null && _getConfig15 !== void 0 && (_getConfig15 = _getConfig15.experimentalInteractionMetrics) !== null && _getConfig15 !== void 0 && _getConfig15.enabled) {
951
+ var _getConfig19;
952
+ if ((_getConfig19 = getConfig()) !== null && _getConfig19 !== void 0 && (_getConfig19 = _getConfig19.experimentalInteractionMetrics) !== null && _getConfig19 !== void 0 && _getConfig19.enabled) {
903
953
  onExperimentalInteractionComplete(interactionId, interaction, endTime);
904
954
  }
905
955
  postInteraction();
@@ -916,6 +966,26 @@ function callCancelCallbacks(interaction) {
916
966
  export function abort(interactionId, abortReason) {
917
967
  var interaction = interactions.get(interactionId);
918
968
  if (interaction != null) {
969
+ var shouldUseRawDataThirdParty = shouldUseRawDataThirdPartyBehavior(interaction.ufoName, interaction.type);
970
+ var noMoreActiveHolds = interaction.holdActive.size === 0;
971
+ var has3pHoldsActive = interaction.hold3pActive && interaction.hold3pActive.size > 0;
972
+
973
+ // If only third-party holds are active, finish as successful instead of aborting
974
+ if (shouldUseRawDataThirdParty && noMoreActiveHolds && has3pHoldsActive) {
975
+ var endTime = interaction.end !== 0 ? interaction.end : performance.now();
976
+ interaction.end3p = performance.now();
977
+ finishInteraction(interactionId, interaction, endTime);
978
+ postInteractionLog.reset();
979
+ postInteractionLog.stopVCObserver();
980
+ if (fg('platform_ufo_enable_ttai_with_3p')) {
981
+ interactionExtraMetrics.stopAll(interactionId);
982
+ }
983
+ if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
984
+ onExperimentalInteractionComplete(interactionId, interaction, endTime);
985
+ remove(interactionId);
986
+ }
987
+ return;
988
+ }
919
989
  callCancelCallbacks(interaction);
920
990
  interaction.abortReason = abortReason;
921
991
  finishInteraction(interactionId, interaction);
@@ -933,6 +1003,27 @@ export function abort(interactionId, abortReason) {
933
1003
  export function abortByNewInteraction(interactionId, interactionName) {
934
1004
  var interaction = interactions.get(interactionId);
935
1005
  if (interaction != null) {
1006
+ var shouldUseRawDataThirdParty = shouldUseRawDataThirdPartyBehavior(interaction.ufoName, interaction.type);
1007
+ var noMoreActiveHolds = interaction.holdActive.size === 0;
1008
+ var has3pHoldsActive = interaction.hold3pActive && interaction.hold3pActive.size > 0;
1009
+
1010
+ // If only third-party holds are active, finish as successful instead of aborting
1011
+ if (shouldUseRawDataThirdParty && noMoreActiveHolds && has3pHoldsActive) {
1012
+ var endTime = interaction.end !== 0 ? interaction.end : performance.now();
1013
+ // Set end3p to current time, but ensure it's at least interaction.end
1014
+ interaction.end3p = performance.now();
1015
+ finishInteraction(interactionId, interaction, endTime);
1016
+ postInteractionLog.reset();
1017
+ postInteractionLog.stopVCObserver();
1018
+ if (fg('platform_ufo_enable_ttai_with_3p')) {
1019
+ interactionExtraMetrics.stopAll(interactionId);
1020
+ }
1021
+ if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
1022
+ onExperimentalInteractionComplete(interactionId, interaction, endTime);
1023
+ remove(interactionId);
1024
+ }
1025
+ return;
1026
+ }
936
1027
  callCancelCallbacks(interaction);
937
1028
  interaction.abortReason = 'new_interaction';
938
1029
  interaction.abortedByInteractionName = interactionName;
@@ -957,6 +1048,26 @@ export function abortAll(abortReason, abortedByInteractionName) {
957
1048
  if (isActiveInteraction && abortReason === 'transition' && interaction.type === 'press' && finishInteractions !== null && finishInteractions !== void 0 && finishInteractions.includes(interaction.ufoName) && fg('platform_ufo_enable_finish_interaction_transition')) {
958
1049
  hasFinished = true;
959
1050
  }
1051
+ var shouldUseRawDataThirdParty = shouldUseRawDataThirdPartyBehavior(interaction.ufoName, interaction.type);
1052
+ var noMoreActiveHolds = interaction.holdActive.size === 0;
1053
+ var has3pHoldsActive = interaction.hold3pActive && interaction.hold3pActive.size > 0;
1054
+
1055
+ // If only third-party holds are active, finish as successful instead of aborting
1056
+ if (shouldUseRawDataThirdParty && noMoreActiveHolds && has3pHoldsActive) {
1057
+ var endTime = interaction.end !== 0 ? interaction.end : performance.now();
1058
+ interaction.end3p = performance.now();
1059
+ finishInteraction(interactionId, interaction, endTime);
1060
+ postInteractionLog.reset();
1061
+ postInteractionLog.stopVCObserver();
1062
+ if (fg('platform_ufo_enable_ttai_with_3p')) {
1063
+ interactionExtraMetrics.stopAll(interactionId);
1064
+ }
1065
+ if (coinflip(getExperimentalInteractionRate(interaction.ufoName, interaction.type))) {
1066
+ onExperimentalInteractionComplete(interactionId, interaction, endTime);
1067
+ remove(interactionId);
1068
+ }
1069
+ return;
1070
+ }
960
1071
  if (!hasFinished) {
961
1072
  callCancelCallbacks(interaction);
962
1073
  interaction.abortReason = abortReason;
@@ -1093,7 +1204,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1093
1204
  addHoldByID(interactionId, [], ufoName, ufoName, true);
1094
1205
  }
1095
1206
  if (type === 'transition' || type === 'page_load') {
1096
- var _getConfig16, _config$extraInteract;
1207
+ var _getConfig20, _config$extraInteract;
1097
1208
  // Use per-interaction VC observer if available, otherwise fall back to global
1098
1209
  var observer = vcObserver;
1099
1210
  if (observer) {
@@ -1104,7 +1215,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
1104
1215
  }
1105
1216
  // Start post interaction observer for all if config is enabled
1106
1217
  // in case ufoName is updated at later time
1107
- if ((_getConfig16 = getConfig()) !== null && _getConfig16 !== void 0 && (_getConfig16 = _getConfig16.postInteractionLog) !== null && _getConfig16 !== void 0 && _getConfig16.enabled) {
1218
+ if ((_getConfig20 = getConfig()) !== null && _getConfig20 !== void 0 && (_getConfig20 = _getConfig20.postInteractionLog) !== null && _getConfig20 !== void 0 && _getConfig20.enabled) {
1108
1219
  postInteractionLog.startVCObserver({
1109
1220
  startTime: startTime
1110
1221
  });
@@ -150,7 +150,8 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
150
150
  isPageVisible: param.isPageVisible,
151
151
  interactionAbortReason: param.interactionAbortReason,
152
152
  includeRawData: includeRawData,
153
- includeSSRInV3: param.includeSSRInV3
153
+ includeSSRInV3: param.includeSSRInV3,
154
+ rawDataStopTime: param.rawDataStopTime
154
155
  });
155
156
  case 12:
156
157
  _context.t1 = _context.sent;
@@ -242,11 +242,11 @@ var VCObserverNew = /*#__PURE__*/function () {
242
242
  key: "getVCResult",
243
243
  value: function () {
244
244
  var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
245
- var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, includeRawData, results, feVCCalculationStartTime, calculator_fy25_03, orderedEntries, fy25_03, calculator_fy26_04, fy26_04, vcNext, _fy25_, calculator_next, _vcNext, feVCCalculationEndTime, rawVCCalculationStartTime, rawHandler, raw;
245
+ 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;
246
246
  return _regeneratorRuntime.wrap(function _callee$(_context) {
247
247
  while (1) switch (_context.prev = _context.next) {
248
248
  case 0:
249
- start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, includeSSRRatio = param.includeSSRRatio, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch, includeRawData = param.includeRawData;
249
+ start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, includeSSRRatio = param.includeSSRRatio, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch, includeRawData = param.includeRawData, rawDataStopTime = param.rawDataStopTime;
250
250
  results = [];
251
251
  this.addStartEntry(start);
252
252
  feVCCalculationStartTime = performance.now();
@@ -383,19 +383,24 @@ var VCObserverNew = /*#__PURE__*/function () {
383
383
  case 40:
384
384
  feVCCalculationEndTime = performance.now();
385
385
  if (!(includeRawData && fg('platform_ufo_enable_vc_raw_data'))) {
386
- _context.next = 49;
386
+ _context.next = 51;
387
387
  break;
388
388
  }
389
389
  rawVCCalculationStartTime = performance.now();
390
- rawHandler = new RawDataHandler();
391
- _context.next = 46;
390
+ rawHandler = new RawDataHandler(); // Use rawDataStopTime (end3p) when available to capture observations during 3p holds
391
+ rawStopTime = rawDataStopTime !== null && rawDataStopTime !== void 0 ? rawDataStopTime : stop;
392
+ rawOrderedEntries = rawDataStopTime ? this.entriesTimeline.getOrderedEntries({
393
+ start: start,
394
+ stop: rawStopTime
395
+ }) : orderedEntries;
396
+ _context.next = 48;
392
397
  return rawHandler.getRawData({
393
- entries: orderedEntries,
398
+ entries: rawOrderedEntries,
394
399
  startTime: start,
395
- stopTime: stop,
400
+ stopTime: rawStopTime,
396
401
  isPageVisible: isPageVisible
397
402
  });
398
- case 46:
403
+ case 48:
399
404
  raw = _context.sent;
400
405
  results.forEach(function (result) {
401
406
  delete result.vcDetails;
@@ -406,9 +411,9 @@ var VCObserverNew = /*#__PURE__*/function () {
406
411
  raw.feVCTime = Number((feVCCalculationEndTime - feVCCalculationStartTime).toFixed(2));
407
412
  results.push(raw);
408
413
  }
409
- case 49:
414
+ case 51:
410
415
  return _context.abrupt("return", results);
411
- case 50:
416
+ case 52:
412
417
  case "end":
413
418
  return _context.stop();
414
419
  }
@@ -100,6 +100,7 @@ export interface InteractionMetrics {
100
100
  id: string;
101
101
  start: number;
102
102
  end: number;
103
+ end3p?: number;
103
104
  ufoName: string;
104
105
  previousInteractionName?: string;
105
106
  isPreviousInteractionAborted: boolean;
@@ -65,6 +65,7 @@ export type ReactUFOPayload = {
65
65
  properties: ReactUFOAttributesProperties & {
66
66
  'event:hostname': string;
67
67
  'event:product': string;
68
+ 'event:population': string;
68
69
  'event:schema': '1.0.0';
69
70
  'event:sizeInKb': number;
70
71
  'event:source': {
@@ -93,6 +93,15 @@ export type Config = {
93
93
  readonly allowedResourcesParams?: Array<string>;
94
94
  readonly autoGeneratedRate?: number;
95
95
  readonly product: string;
96
+ /**
97
+ * The Event Population is intended for segmenting traffic based on
98
+ * overrides/segments used in Statsig for targeting.
99
+ * ie. "customer-test", "internal-test", "release-tracks", "experiment-population"
100
+ *
101
+ * See https://console.statsig.com/LqivKg6ADZZaGczRfBKfX/dynamic_configs/cc_ufo_group
102
+ * for an example dynamic config powering the Confluence population.
103
+ */
104
+ readonly population?: string;
96
105
  readonly region: string;
97
106
  readonly additionalPayloadData?: (interaction: InteractionMetrics) => AdditionalData;
98
107
  readonly ssr?: {
@@ -180,6 +189,7 @@ export declare function getReactHydrationStats(): ReactHydrationStats | undefine
180
189
  export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
181
190
  export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
182
191
  export declare function getVCRawDataInteractionRate(name: string, interactionType: InteractionType): number;
192
+ export declare function shouldUseRawDataThirdPartyBehavior(name: string, interactionType: InteractionType): boolean;
183
193
  export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
184
194
  export declare function getCapabilityRate(capability: Capability): number;
185
195
  export declare function getExtraInteractionRate(name: string, interactionType: InteractionType): number;
@@ -18,6 +18,7 @@ export type GetVCResultType = {
18
18
  isPageVisible: boolean;
19
19
  interactionAbortReason?: AbortReasonType;
20
20
  includeRawData?: boolean;
21
+ rawDataStopTime?: number;
21
22
  };
22
23
  export type SelectorConfig = {
23
24
  id: boolean;
@@ -38,4 +38,5 @@ export type VCObserverGetVCResultParam = {
38
38
  interactionAbortReason?: AbortReasonType;
39
39
  includeRawData?: boolean;
40
40
  includeSSRInV3?: boolean;
41
+ rawDataStopTime?: number;
41
42
  };
@@ -100,6 +100,7 @@ export interface InteractionMetrics {
100
100
  id: string;
101
101
  start: number;
102
102
  end: number;
103
+ end3p?: number;
103
104
  ufoName: string;
104
105
  previousInteractionName?: string;
105
106
  isPreviousInteractionAborted: boolean;
@@ -67,6 +67,7 @@ export type ReactUFOPayload = {
67
67
  properties: ReactUFOAttributesProperties & {
68
68
  'event:hostname': string;
69
69
  'event:product': string;
70
+ 'event:population': string;
70
71
  'event:schema': '1.0.0';
71
72
  'event:sizeInKb': number;
72
73
  'event:source': {
@@ -93,6 +93,15 @@ export type Config = {
93
93
  readonly allowedResourcesParams?: Array<string>;
94
94
  readonly autoGeneratedRate?: number;
95
95
  readonly product: string;
96
+ /**
97
+ * The Event Population is intended for segmenting traffic based on
98
+ * overrides/segments used in Statsig for targeting.
99
+ * ie. "customer-test", "internal-test", "release-tracks", "experiment-population"
100
+ *
101
+ * See https://console.statsig.com/LqivKg6ADZZaGczRfBKfX/dynamic_configs/cc_ufo_group
102
+ * for an example dynamic config powering the Confluence population.
103
+ */
104
+ readonly population?: string;
96
105
  readonly region: string;
97
106
  readonly additionalPayloadData?: (interaction: InteractionMetrics) => AdditionalData;
98
107
  readonly ssr?: {
@@ -180,6 +189,7 @@ export declare function getReactHydrationStats(): ReactHydrationStats | undefine
180
189
  export declare function getInteractionRate(name: string, interactionKind: InteractionKind): number;
181
190
  export declare function getExperimentalInteractionRate(name: string, interactionType: InteractionType): number;
182
191
  export declare function getVCRawDataInteractionRate(name: string, interactionType: InteractionType): number;
192
+ export declare function shouldUseRawDataThirdPartyBehavior(name: string, interactionType: InteractionType): boolean;
183
193
  export declare function getPostInteractionRate(name: string, interactionType: InteractionType): number;
184
194
  export declare function getCapabilityRate(capability: Capability): number;
185
195
  export declare function getExtraInteractionRate(name: string, interactionType: InteractionType): number;
@@ -18,6 +18,7 @@ export type GetVCResultType = {
18
18
  isPageVisible: boolean;
19
19
  interactionAbortReason?: AbortReasonType;
20
20
  includeRawData?: boolean;
21
+ rawDataStopTime?: number;
21
22
  };
22
23
  export type SelectorConfig = {
23
24
  id: boolean;
@@ -38,4 +38,5 @@ export type VCObserverGetVCResultParam = {
38
38
  interactionAbortReason?: AbortReasonType;
39
39
  includeRawData?: boolean;
40
40
  includeSSRInV3?: boolean;
41
+ rawDataStopTime?: number;
41
42
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "4.15.18",
3
+ "version": "4.16.0",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -202,6 +202,9 @@
202
202
  },
203
203
  "platform_ufo_keypress_interaction_abort": {
204
204
  "type": "boolean"
205
+ },
206
+ "platform_ufo_raw_data_thirdparty": {
207
+ "type": "boolean"
205
208
  }
206
209
  }
207
210
  }