@atlaskit/react-ufo 4.8.0 → 4.9.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/CHANGELOG.md +15 -0
- package/dist/cjs/additional-payload/utils/lighthouse-metrics/cls/index.js +17 -2
- package/dist/cjs/create-extra-search-page-interaction-payload/index.js +50 -0
- package/dist/cjs/create-payload/index.js +63 -0
- package/dist/cjs/create-payload/utils/get-vc-metrics.js +15 -12
- package/dist/cjs/create-post-interaction-log-payload/index.js +1 -1
- package/dist/cjs/interaction-metrics/index.js +15 -7
- package/dist/cjs/interaction-metrics/post-interaction-log.js +2 -1
- package/dist/cjs/interaction-metrics-init/index.js +29 -2
- package/dist/cjs/vc/index.js +4 -3
- package/dist/cjs/vc/vc-observer-new/index.js +4 -3
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +8 -8
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +5 -1
- package/dist/cjs/vc/vc-observer-new/metric-calculator/utils/is-entry-smart-answers-in-search.js +27 -0
- package/dist/es2019/additional-payload/utils/lighthouse-metrics/cls/index.js +17 -1
- package/dist/es2019/create-extra-search-page-interaction-payload/index.js +32 -0
- package/dist/es2019/create-payload/index.js +49 -0
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +3 -2
- package/dist/es2019/create-post-interaction-log-payload/index.js +1 -1
- package/dist/es2019/interaction-metrics/index.js +15 -7
- package/dist/es2019/interaction-metrics/post-interaction-log.js +2 -1
- package/dist/es2019/interaction-metrics-init/index.js +29 -2
- package/dist/es2019/vc/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/index.js +4 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +6 -5
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +5 -1
- package/dist/es2019/vc/vc-observer-new/metric-calculator/utils/is-entry-smart-answers-in-search.js +22 -0
- package/dist/esm/additional-payload/utils/lighthouse-metrics/cls/index.js +17 -2
- package/dist/esm/create-extra-search-page-interaction-payload/index.js +43 -0
- package/dist/esm/create-payload/index.js +62 -0
- package/dist/esm/create-payload/utils/get-vc-metrics.js +15 -12
- package/dist/esm/create-post-interaction-log-payload/index.js +1 -1
- package/dist/esm/interaction-metrics/index.js +15 -7
- package/dist/esm/interaction-metrics/post-interaction-log.js +2 -1
- package/dist/esm/interaction-metrics-init/index.js +29 -2
- package/dist/esm/vc/index.js +4 -3
- package/dist/esm/vc/vc-observer-new/index.js +4 -3
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +8 -8
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +5 -1
- package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-entry-smart-answers-in-search.js +21 -0
- package/dist/types/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +7 -0
- package/dist/types/config/index.d.ts +7 -0
- package/dist/types/create-extra-search-page-interaction-payload/index.d.ts +3 -0
- package/dist/types/create-payload/index.d.ts +25434 -0
- package/dist/types/create-payload/utils/get-vc-metrics.d.ts +1 -1
- package/dist/types/vc/types.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +2 -2
- package/dist/types/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +1 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/types.d.ts +1 -0
- package/dist/types/vc/vc-observer-new/metric-calculator/utils/is-entry-smart-answers-in-search.d.ts +2 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +1 -0
- package/dist/types-ts4.5/additional-payload/utils/lighthouse-metrics/cls/types.d.ts +7 -0
- package/dist/types-ts4.5/config/index.d.ts +7 -0
- package/dist/types-ts4.5/create-extra-search-page-interaction-payload/index.d.ts +3 -0
- package/dist/types-ts4.5/create-payload/index.d.ts +25434 -0
- package/dist/types-ts4.5/create-payload/utils/get-vc-metrics.d.ts +1 -1
- package/dist/types-ts4.5/vc/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.d.ts +2 -2
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/fy25_03/index.d.ts +1 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/types.d.ts +1 -0
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/utils/is-entry-smart-answers-in-search.d.ts +2 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -0
- package/package.json +10 -1
|
@@ -13,6 +13,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
13
13
|
import coinflip from '../coinflip';
|
|
14
14
|
import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getExtraInteractionRate, getFinishInteractionOnTransition, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
|
|
15
15
|
import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
|
|
16
|
+
import { onSearchPageInteractionComplete } from '../create-extra-search-page-interaction-payload';
|
|
16
17
|
import { sanitizeUfoName, stringifyLabelStackFully } from '../create-payload/common/utils';
|
|
17
18
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
18
19
|
import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
|
|
@@ -835,16 +836,19 @@ export function tryComplete(interactionId, endTime) {
|
|
|
835
836
|
if (noMoreActiveHolds && interactionExtraMetrics.finishedInteractionId !== interactionId) {
|
|
836
837
|
// If it's not waiting for extra metrics to complete, finish the interaction as normal
|
|
837
838
|
if (!activeSubmitted) {
|
|
838
|
-
var _getConfig1;
|
|
839
|
+
var _getConfig1, _getConfig10, _getConfig11;
|
|
839
840
|
finishInteraction(interactionId, interaction, endTime);
|
|
840
841
|
if ((_getConfig1 = getConfig()) !== null && _getConfig1 !== void 0 && (_getConfig1 = _getConfig1.extraInteractionMetrics) !== null && _getConfig1 !== void 0 && _getConfig1.enabled) {
|
|
841
842
|
interactionExtraMetrics.updateFinishedInteractionId(interactionId);
|
|
842
843
|
}
|
|
844
|
+
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) && fg('react_ufo_unified_search_ignoring_sain_metric')) {
|
|
845
|
+
onSearchPageInteractionComplete(interactionId, interaction);
|
|
846
|
+
}
|
|
843
847
|
activeSubmitted = true;
|
|
844
848
|
}
|
|
845
849
|
if (noMoreExpHolds) {
|
|
846
|
-
var
|
|
847
|
-
if ((
|
|
850
|
+
var _getConfig12;
|
|
851
|
+
if ((_getConfig12 = getConfig()) !== null && _getConfig12 !== void 0 && (_getConfig12 = _getConfig12.experimentalInteractionMetrics) !== null && _getConfig12 !== void 0 && _getConfig12.enabled) {
|
|
848
852
|
onExperimentalInteractionComplete(interactionId, interaction, endTime);
|
|
849
853
|
}
|
|
850
854
|
postInteraction();
|
|
@@ -859,12 +863,16 @@ export function tryComplete(interactionId, endTime) {
|
|
|
859
863
|
} else {
|
|
860
864
|
if (noMoreActiveHolds) {
|
|
861
865
|
if (!activeSubmitted) {
|
|
866
|
+
var _getConfig13, _getConfig14;
|
|
862
867
|
finishInteraction(interactionId, interaction, endTime);
|
|
868
|
+
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) && fg('react_ufo_unified_search_ignoring_sain_metric')) {
|
|
869
|
+
onSearchPageInteractionComplete(interactionId, interaction);
|
|
870
|
+
}
|
|
863
871
|
activeSubmitted = true;
|
|
864
872
|
}
|
|
865
873
|
if (noMoreExpHolds) {
|
|
866
|
-
var
|
|
867
|
-
if ((
|
|
874
|
+
var _getConfig15;
|
|
875
|
+
if ((_getConfig15 = getConfig()) !== null && _getConfig15 !== void 0 && (_getConfig15 = _getConfig15.experimentalInteractionMetrics) !== null && _getConfig15 !== void 0 && _getConfig15.enabled) {
|
|
868
876
|
onExperimentalInteractionComplete(interactionId, interaction, endTime);
|
|
869
877
|
}
|
|
870
878
|
postInteraction();
|
|
@@ -1061,7 +1069,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
1061
1069
|
addHoldByID(interactionId, [], ufoName, ufoName, true);
|
|
1062
1070
|
}
|
|
1063
1071
|
if (type === 'transition' || type === 'page_load') {
|
|
1064
|
-
var
|
|
1072
|
+
var _getConfig16, _config$extraInteract;
|
|
1065
1073
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
1066
1074
|
var observer = vcObserver;
|
|
1067
1075
|
if (observer) {
|
|
@@ -1072,7 +1080,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
1072
1080
|
}
|
|
1073
1081
|
// Start post interaction observer for all if config is enabled
|
|
1074
1082
|
// in case ufoName is updated at later time
|
|
1075
|
-
if ((
|
|
1083
|
+
if ((_getConfig16 = getConfig()) !== null && _getConfig16 !== void 0 && (_getConfig16 = _getConfig16.postInteractionLog) !== null && _getConfig16 !== void 0 && _getConfig16.enabled) {
|
|
1076
1084
|
postInteractionLog.startVCObserver({
|
|
1077
1085
|
startTime: startTime
|
|
1078
1086
|
});
|
|
@@ -5,6 +5,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { getConfig } from '../config';
|
|
9
10
|
import { VCObserverWrapper } from '../vc';
|
|
10
11
|
var POST_INTERACTION_LOG_SEND_DEFAULT_TIMEOUT = 3000;
|
|
@@ -118,7 +119,7 @@ var PostInteractionLog = /*#__PURE__*/function () {
|
|
|
118
119
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
119
120
|
while (1) switch (_context.prev = _context.next) {
|
|
120
121
|
case 0:
|
|
121
|
-
if (!(!this.
|
|
122
|
+
if (!(!this.lastInteractionFinish || !this.sinkHandlerFn || !this.hasData() && !fg('platform_ufo_always_send_post_interaction_log'))) {
|
|
122
123
|
_context.next = 4;
|
|
123
124
|
break;
|
|
124
125
|
}
|
|
@@ -5,6 +5,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
5
5
|
import { startLighthouseObserver } from '../additional-payload';
|
|
6
6
|
import { setUFOConfig } from '../config';
|
|
7
7
|
import { experimentalVC, sinkExperimentalHandler } from '../create-experimental-interaction-metrics-payload';
|
|
8
|
+
import { sinkExtraSearchPageInteractionHandler } from '../create-extra-search-page-interaction-payload';
|
|
8
9
|
import { setupHiddenTimingCapture } from '../hidden-timing';
|
|
9
10
|
import { interactionExtraMetrics, postInteractionLog, sinkInteractionHandler, sinkPostInteractionLogHandler } from '../interaction-metrics';
|
|
10
11
|
import { getPerformanceObserver } from '../interactions-performance-observer';
|
|
@@ -101,6 +102,26 @@ function sinkInteractionExtraMetrics(instance, createInteractionExtraLogPayload)
|
|
|
101
102
|
})));
|
|
102
103
|
});
|
|
103
104
|
}
|
|
105
|
+
function sinkExtraSearchPageInteraction(instance, payloadPackage) {
|
|
106
|
+
function sinkFn(interactionId, interaction) {
|
|
107
|
+
function onIdle() {
|
|
108
|
+
payloadPackage.createExtraSearchPageInteractionPayload(interactionId, interaction).then(function (payloads) {
|
|
109
|
+
// NOTE: This API is used by the UFO DevTool Chrome Extension and Criterion
|
|
110
|
+
var devToolObserver = globalThis.__ufo_devtool_onUfoPayload;
|
|
111
|
+
payloads === null || payloads === void 0 || payloads.forEach(function (payload) {
|
|
112
|
+
if (typeof devToolObserver === 'function') {
|
|
113
|
+
devToolObserver === null || devToolObserver === void 0 || devToolObserver(payload);
|
|
114
|
+
}
|
|
115
|
+
instance.sendOperationalEvent(payload);
|
|
116
|
+
});
|
|
117
|
+
}).catch(function (error) {
|
|
118
|
+
throw error;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
scheduleIdleCallback(onIdle);
|
|
122
|
+
}
|
|
123
|
+
sinkExtraSearchPageInteractionHandler(sinkFn);
|
|
124
|
+
}
|
|
104
125
|
export function init(analyticsWebClientAsync, config) {
|
|
105
126
|
var _config$vc;
|
|
106
127
|
if (initialized) {
|
|
@@ -149,7 +170,7 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
149
170
|
createInteractionExtraMetricsPayloadPackage = _ref3[3];
|
|
150
171
|
if (awc.getAnalyticsWebClientPromise) {
|
|
151
172
|
awc.getAnalyticsWebClientPromise().then(function (client) {
|
|
152
|
-
var _config$experimentalI2, _config$postInteracti, _config$extraInteract2;
|
|
173
|
+
var _config$experimentalI2, _config$postInteracti, _config$extraInteract2, _config$extraSearchPa;
|
|
153
174
|
var instance = client.getInstance();
|
|
154
175
|
sinkInteraction(instance, payloadPackage);
|
|
155
176
|
if (config !== null && config !== void 0 && (_config$experimentalI2 = config.experimentalInteractionMetrics) !== null && _config$experimentalI2 !== void 0 && _config$experimentalI2.enabled) {
|
|
@@ -161,9 +182,12 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
161
182
|
if (config !== null && config !== void 0 && (_config$extraInteract2 = config.extraInteractionMetrics) !== null && _config$extraInteract2 !== void 0 && _config$extraInteract2.enabled && fg('platform_ufo_enable_ttai_with_3p')) {
|
|
162
183
|
sinkInteractionExtraMetrics(instance, createInteractionExtraMetricsPayloadPackage.default);
|
|
163
184
|
}
|
|
185
|
+
if (config !== null && config !== void 0 && (_config$extraSearchPa = config.extraSearchPageInteraction) !== null && _config$extraSearchPa !== void 0 && _config$extraSearchPa.enabled && fg('react_ufo_unified_search_ignoring_sain_metric')) {
|
|
186
|
+
sinkExtraSearchPageInteraction(instance, payloadPackage);
|
|
187
|
+
}
|
|
164
188
|
});
|
|
165
189
|
} else if (awc.sendOperationalEvent) {
|
|
166
|
-
var _config$experimentalI3, _config$postInteracti2, _config$extraInteract3;
|
|
190
|
+
var _config$experimentalI3, _config$postInteracti2, _config$extraInteract3, _config$extraSearchPa2;
|
|
167
191
|
sinkInteraction(awc, payloadPackage);
|
|
168
192
|
if (config !== null && config !== void 0 && (_config$experimentalI3 = config.experimentalInteractionMetrics) !== null && _config$experimentalI3 !== void 0 && _config$experimentalI3.enabled) {
|
|
169
193
|
sinkExperimentalInteractionMetrics(awc, payloadPackage);
|
|
@@ -174,6 +198,9 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
174
198
|
if (config !== null && config !== void 0 && (_config$extraInteract3 = config.extraInteractionMetrics) !== null && _config$extraInteract3 !== void 0 && _config$extraInteract3.enabled && fg('platform_ufo_enable_ttai_with_3p')) {
|
|
175
199
|
sinkInteractionExtraMetrics(awc, createInteractionExtraMetricsPayloadPackage.default);
|
|
176
200
|
}
|
|
201
|
+
if (config !== null && config !== void 0 && (_config$extraSearchPa2 = config.extraSearchPageInteraction) !== null && _config$extraSearchPa2 !== void 0 && _config$extraSearchPa2.enabled) {
|
|
202
|
+
sinkExtraSearchPageInteraction(awc, payloadPackage);
|
|
203
|
+
}
|
|
177
204
|
}
|
|
178
205
|
});
|
|
179
206
|
}
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -112,11 +112,11 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
112
112
|
value: function () {
|
|
113
113
|
var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
|
|
114
114
|
var _this$oldVCObserver4, _this$newVCObserver3, _ref2;
|
|
115
|
-
var experienceKey, include3p, v1v2Result, v3Result;
|
|
115
|
+
var experienceKey, include3p, excludeSmartAnswersInSearch, v1v2Result, v3Result;
|
|
116
116
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
117
117
|
while (1) switch (_context.prev = _context.next) {
|
|
118
118
|
case 0:
|
|
119
|
-
experienceKey = param.experienceKey, include3p = param.include3p;
|
|
119
|
+
experienceKey = param.experienceKey, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
120
120
|
if (!(isVCRevisionEnabled('fy25.01', experienceKey) || isVCRevisionEnabled('fy25.02', experienceKey))) {
|
|
121
121
|
_context.next = 7;
|
|
122
122
|
break;
|
|
@@ -141,7 +141,8 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
141
141
|
stop: param.stop,
|
|
142
142
|
interactionId: param.interactionId,
|
|
143
143
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
144
|
-
include3p: include3p
|
|
144
|
+
include3p: include3p,
|
|
145
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
145
146
|
});
|
|
146
147
|
case 12:
|
|
147
148
|
_context.t1 = _context.sent;
|
|
@@ -231,11 +231,11 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
231
231
|
key: "getVCResult",
|
|
232
232
|
value: function () {
|
|
233
233
|
var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
|
|
234
|
-
var start, stop, interactionId, include3p, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
234
|
+
var start, stop, interactionId, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
235
235
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
236
236
|
while (1) switch (_context.prev = _context.next) {
|
|
237
237
|
case 0:
|
|
238
|
-
start = param.start, stop = param.stop, interactionId = param.interactionId, include3p = param.include3p;
|
|
238
|
+
start = param.start, stop = param.stop, interactionId = param.interactionId, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
239
239
|
results = [];
|
|
240
240
|
this.addStartEntry(start);
|
|
241
241
|
calculator_fy25_03 = new VCCalculator_FY25_03();
|
|
@@ -253,7 +253,8 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
253
253
|
stopTime: stop,
|
|
254
254
|
interactionId: interactionId,
|
|
255
255
|
isPostInteraction: this.isPostInteraction,
|
|
256
|
-
include3p: include3p
|
|
256
|
+
include3p: include3p,
|
|
257
|
+
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch
|
|
257
258
|
});
|
|
258
259
|
case 8:
|
|
259
260
|
fy25_03 = _context.sent;
|
|
@@ -105,7 +105,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
105
105
|
}, {
|
|
106
106
|
key: "calculateWithDebugInfo",
|
|
107
107
|
value: function () {
|
|
108
|
-
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p) {
|
|
108
|
+
var _calculateWithDebugInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch) {
|
|
109
109
|
var _window, _window2, _window6, _window8;
|
|
110
110
|
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, _iterator4, _step4, _entry3, time, viewportPercentage, entries, elementNames, previousResult, i, percentile, enhancedVcLogs, shouldCalculate3p, shouldCalculateDebugDetails, _window3, _window4, _window5, sortedVcLogs, maxViewportPercentageAtTime, maxSoFar, _iterator5, _step5, log, getBiggestPreviousViewportPercentage, ignoredEntriesByTime, _iterator6, _step6, _entry4, _ignoredEntriesByTime, _viewportData$rect, _viewportData$previou, viewportData, timestamp, additionalVcLogs, _iterator7, _step7, _step7$value, _timestamp, ignoredEntries, _viewportPercentage, v3RevisionDebugDetails, _activeInteractionId$, activeInteractionId, activeInteraction, pageVisibilityUpToTTAI, isBackgrounded, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
111
111
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -258,7 +258,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
258
258
|
try {
|
|
259
259
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
260
260
|
_entry4 = _step6.value;
|
|
261
|
-
if ('rect' in _entry4.data && !this.isEntryIncluded(_entry4, include3p)) {
|
|
261
|
+
if ('rect' in _entry4.data && !this.isEntryIncluded(_entry4, include3p, excludeSmartAnswersInSearch)) {
|
|
262
262
|
viewportData = _entry4.data;
|
|
263
263
|
timestamp = Math.round(_entry4.time);
|
|
264
264
|
if (!ignoredEntriesByTime.has(timestamp)) {
|
|
@@ -365,7 +365,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
365
365
|
}
|
|
366
366
|
}, _callee, this, [[10, 22, 25, 28]]);
|
|
367
367
|
}));
|
|
368
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9) {
|
|
368
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0) {
|
|
369
369
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
370
370
|
}
|
|
371
371
|
return calculateWithDebugInfo;
|
|
@@ -377,13 +377,13 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
377
377
|
var _this = this,
|
|
378
378
|
_vcDetails$90$t,
|
|
379
379
|
_vcDetails$;
|
|
380
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
380
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
381
381
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
382
382
|
while (1) switch (_context2.prev = _context2.next) {
|
|
383
383
|
case 0:
|
|
384
|
-
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p;
|
|
384
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch;
|
|
385
385
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
386
|
-
return _this.isEntryIncluded(entry, include3p);
|
|
386
|
+
return _this.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
387
387
|
});
|
|
388
388
|
getVCCleanStatusResult = this.getVCCleanStatus(filteredEntries);
|
|
389
389
|
isVCClean = getVCCleanStatusResult.isVCClean;
|
|
@@ -401,7 +401,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
401
401
|
});
|
|
402
402
|
case 7:
|
|
403
403
|
_context2.next = 9;
|
|
404
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p);
|
|
404
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch);
|
|
405
405
|
case 9:
|
|
406
406
|
vcDetails = _context2.sent;
|
|
407
407
|
result = {
|
|
@@ -424,7 +424,7 @@ var AbstractVCCalculatorBase = /*#__PURE__*/function () {
|
|
|
424
424
|
}
|
|
425
425
|
}, _callee2, this);
|
|
426
426
|
}));
|
|
427
|
-
function calculate(
|
|
427
|
+
function calculate(_x1) {
|
|
428
428
|
return _calculate.apply(this, arguments);
|
|
429
429
|
}
|
|
430
430
|
return calculate;
|
|
@@ -7,6 +7,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
7
7
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
import AbstractVCCalculatorBase from '../abstract-base-vc-calculator';
|
|
10
|
+
import { isEntrySmartAnswersInSearch } from '../utils/is-entry-smart-answers-in-search';
|
|
10
11
|
import isViewportEntryData from '../utils/is-viewport-entry-data';
|
|
11
12
|
var ABORTING_WINDOW_EVENT = ['wheel', 'scroll', 'keydown', 'resize'];
|
|
12
13
|
var REVISION_NO = 'fy25.03';
|
|
@@ -44,10 +45,13 @@ var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
|
44
45
|
_inherits(VCCalculator_FY25_03, _AbstractVCCalculator);
|
|
45
46
|
return _createClass(VCCalculator_FY25_03, [{
|
|
46
47
|
key: "isEntryIncluded",
|
|
47
|
-
value: function isEntryIncluded(entry, include3p) {
|
|
48
|
+
value: function isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch) {
|
|
48
49
|
if (!getConsideredEntryTypes(include3p).includes(entry.data.type)) {
|
|
49
50
|
return false;
|
|
50
51
|
}
|
|
52
|
+
if (excludeSmartAnswersInSearch && isEntrySmartAnswersInSearch(entry)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
51
55
|
if (entry.data.type === 'mutation:attribute') {
|
|
52
56
|
var entryData = entry.data;
|
|
53
57
|
var attributeName = entryData.attributeName;
|
package/dist/esm/vc/vc-observer-new/metric-calculator/utils/is-entry-smart-answers-in-search.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getDocument } from '@atlaskit/browser-apis';
|
|
2
|
+
export function isEntrySmartAnswersInSearch(entry) {
|
|
3
|
+
var _ref = entry.data,
|
|
4
|
+
elementName = _ref.elementName;
|
|
5
|
+
if (!elementName || elementName === 'START') {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
var doc = getDocument();
|
|
9
|
+
if (!doc) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
var smartAnswersElement = doc.getElementById('search-page-smart-answers');
|
|
13
|
+
if (!smartAnswersElement) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
var entryDOMElement = doc.querySelector(elementName);
|
|
17
|
+
if (!entryDOMElement) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return smartAnswersElement.contains(entryDOMElement);
|
|
21
|
+
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export interface LayoutShiftAttribution {
|
|
2
|
+
readonly node: Node;
|
|
3
|
+
readonly previousRect: DOMRectReadOnly;
|
|
4
|
+
readonly currentRect: DOMRectReadOnly;
|
|
5
|
+
readonly toJSON: () => object;
|
|
6
|
+
}
|
|
1
7
|
export interface LayoutShiftPerformanceEntry extends PerformanceEntry {
|
|
2
8
|
value: number;
|
|
9
|
+
sources: LayoutShiftAttribution[];
|
|
3
10
|
}
|
|
@@ -150,6 +150,13 @@ export type Config = {
|
|
|
150
150
|
* Whether ttvc with 3p measurement is enabled and sent new event for experiences with sample rates
|
|
151
151
|
*/
|
|
152
152
|
readonly extraInteractionMetrics?: InteractionMetricsConfig;
|
|
153
|
+
/**
|
|
154
|
+
* Option to enable an additional metric to track search page load times with SAIN ignored
|
|
155
|
+
*/
|
|
156
|
+
readonly extraSearchPageInteraction?: {
|
|
157
|
+
readonly enabled: boolean;
|
|
158
|
+
readonly searchPageMetricName: string;
|
|
159
|
+
};
|
|
153
160
|
};
|
|
154
161
|
export declare function setUFOConfig(newConfig: Config): void;
|
|
155
162
|
export declare function getConfig(): Config | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { InteractionMetrics } from '../common';
|
|
2
|
+
export declare function sinkExtraSearchPageInteractionHandler(sinkFn: (interactionId: string, interaction: InteractionMetrics) => void | Promise<void>): void;
|
|
3
|
+
export declare function onSearchPageInteractionComplete(interactionId: string, data: InteractionMetrics): void;
|