@atlaskit/react-ufo 4.11.3 → 4.11.5
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 +14 -0
- package/dist/cjs/interaction-metrics/index.js +0 -2
- package/dist/cjs/vc/index.js +8 -4
- package/dist/cjs/vc/vc-observer-new/index.js +4 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +46 -34
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +12 -33
- package/dist/es2019/interaction-metrics/index.js +0 -2
- package/dist/es2019/vc/index.js +7 -1
- package/dist/es2019/vc/vc-observer-new/index.js +3 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +17 -7
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +6 -20
- package/dist/esm/interaction-metrics/index.js +0 -2
- package/dist/esm/vc/index.js +8 -4
- package/dist/esm/vc/vc-observer-new/index.js +4 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +46 -34
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +12 -33
- package/dist/types/common/vc/types.d.ts +5 -1
- package/dist/types/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.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/types.d.ts +1 -0
- package/dist/types-ts4.5/common/vc/types.d.ts +5 -1
- package/dist/types-ts4.5/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.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/types.d.ts +1 -0
- package/package.json +4 -7
- package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/check-display-content.js +0 -32
- package/dist/cjs/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.js +0 -19
- package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/check-display-content.js +0 -14
- package/dist/es2019/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.js +0 -10
- package/dist/esm/vc/vc-observer-new/viewport-observer/utils/check-display-content.js +0 -26
- package/dist/esm/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.js +0 -10
- package/dist/types/vc/vc-observer-new/viewport-observer/utils/check-display-content.d.ts +0 -1
- package/dist/types/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.d.ts +0 -3
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/utils/check-display-content.d.ts +0 -1
- package/dist/types-ts4.5/vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.11.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c7f300b3eed72`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c7f300b3eed72) -
|
|
8
|
+
FG cleanup of display contents tracking flags
|
|
9
|
+
|
|
10
|
+
## 4.11.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`0e311a2eaf943`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0e311a2eaf943) -
|
|
15
|
+
Fixed reporting ssrRatio in v3
|
|
16
|
+
|
|
3
17
|
## 4.11.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -60,7 +60,6 @@ var _experienceTraceIdContext = require("../experience-trace-id-context");
|
|
|
60
60
|
var _featureFlagsAccessed = require("../feature-flags-accessed");
|
|
61
61
|
var _interactionIdContext = require("../interaction-id-context");
|
|
62
62
|
var _vc = require("../vc");
|
|
63
|
-
var _trackDisplayContentOccurrence = require("../vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence");
|
|
64
63
|
var _constants = require("./common/constants");
|
|
65
64
|
var _interactionExtraMetrics = _interopRequireDefault(require("./interaction-extra-metrics"));
|
|
66
65
|
var _postInteractionLog = _interopRequireDefault(require("./post-interaction-log"));
|
|
@@ -1010,7 +1009,6 @@ function addOnCancelCallback(id, cancelCallback) {
|
|
|
1010
1009
|
}
|
|
1011
1010
|
function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
|
|
1012
1011
|
var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
|
|
1013
|
-
(0, _trackDisplayContentOccurrence.resetCssIssueOccurrence)();
|
|
1014
1012
|
interactionExtraMetrics.reset();
|
|
1015
1013
|
postInteractionLog.reset();
|
|
1016
1014
|
var vcObserver;
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -122,11 +122,11 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
122
122
|
value: function () {
|
|
123
123
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
124
124
|
var _this$oldVCObserver4, _this$newVCObserver3, _ref2;
|
|
125
|
-
var experienceKey, include3p, excludeSmartAnswersInSearch, v1v2Result, v3Result;
|
|
125
|
+
var experienceKey, include3p, excludeSmartAnswersInSearch, includeSSRRatio, v1v2Result, v3Result, ssrRatio;
|
|
126
126
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
127
127
|
while (1) switch (_context.prev = _context.next) {
|
|
128
128
|
case 0:
|
|
129
|
-
experienceKey = param.experienceKey, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
129
|
+
experienceKey = param.experienceKey, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch, includeSSRRatio = param.includeSSRRatio;
|
|
130
130
|
if (!((0, _config.isVCRevisionEnabled)('fy25.01', experienceKey) || (0, _config.isVCRevisionEnabled)('fy25.02', experienceKey))) {
|
|
131
131
|
_context.next = 7;
|
|
132
132
|
break;
|
|
@@ -153,6 +153,7 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
153
153
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
154
154
|
include3p: include3p,
|
|
155
155
|
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
156
|
+
includeSSRRatio: includeSSRRatio,
|
|
156
157
|
interactionType: param.interactionType,
|
|
157
158
|
isPageVisible: param.isPageVisible,
|
|
158
159
|
interactionAbortReason: param.interactionAbortReason
|
|
@@ -171,10 +172,13 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
171
172
|
}
|
|
172
173
|
return _context.abrupt("return", v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {});
|
|
173
174
|
case 19:
|
|
174
|
-
|
|
175
|
+
ssrRatio = v3Result[0].ssrRatio;
|
|
176
|
+
return _context.abrupt("return", _objectSpread(_objectSpread(_objectSpread({}, includeSSRRatio && ssrRatio !== undefined ? {
|
|
177
|
+
'ufo:vc:ssrRatio': ssrRatio
|
|
178
|
+
} : {}), v1v2Result), {}, {
|
|
175
179
|
'ufo:vc:rev': [].concat((0, _toConsumableArray2.default)((_ref2 = v1v2Result === null || v1v2Result === void 0 ? void 0 : v1v2Result['ufo:vc:rev']) !== null && _ref2 !== void 0 ? _ref2 : []), (0, _toConsumableArray2.default)(v3Result !== null && v3Result !== void 0 ? v3Result : []))
|
|
176
180
|
}));
|
|
177
|
-
case
|
|
181
|
+
case 21:
|
|
178
182
|
case "end":
|
|
179
183
|
return _context.stop();
|
|
180
184
|
}
|
|
@@ -238,11 +238,11 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
238
238
|
key: "getVCResult",
|
|
239
239
|
value: function () {
|
|
240
240
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
241
|
-
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
241
|
+
var start, stop, interactionId, interactionType, interactionAbortReason, isPageVisible, include3p, includeSSRRatio, excludeSmartAnswersInSearch, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
242
242
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
243
243
|
while (1) switch (_context.prev = _context.next) {
|
|
244
244
|
case 0:
|
|
245
|
-
start = param.start, stop = param.stop, interactionId = param.interactionId, interactionType = param.interactionType, interactionAbortReason = param.interactionAbortReason, isPageVisible = param.isPageVisible, include3p = param.include3p, excludeSmartAnswersInSearch = param.excludeSmartAnswersInSearch;
|
|
245
|
+
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;
|
|
246
246
|
results = [];
|
|
247
247
|
this.addStartEntry(start);
|
|
248
248
|
calculator_fy25_03 = new _fy25_.default();
|
|
@@ -263,6 +263,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
263
263
|
isPostInteraction: this.isPostInteraction,
|
|
264
264
|
include3p: include3p,
|
|
265
265
|
excludeSmartAnswersInSearch: excludeSmartAnswersInSearch,
|
|
266
|
+
includeSSRRatio: includeSSRRatio,
|
|
266
267
|
isPageVisible: isPageVisible,
|
|
267
268
|
interactionAbortReason: interactionAbortReason
|
|
268
269
|
});
|
|
@@ -287,6 +288,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
287
288
|
interactionType: interactionType,
|
|
288
289
|
isPostInteraction: this.isPostInteraction,
|
|
289
290
|
include3p: include3p,
|
|
291
|
+
includeSSRRatio: includeSSRRatio,
|
|
290
292
|
isPageVisible: isPageVisible,
|
|
291
293
|
interactionAbortReason: interactionAbortReason
|
|
292
294
|
});
|
|
@@ -13,7 +13,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
13
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
14
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
-
var _trackDisplayContentOccurrence = require("../viewport-observer/utils/track-display-content-occurrence");
|
|
17
16
|
var _percentileCalc = require("./percentile-calc");
|
|
18
17
|
var _getViewportHeight = _interopRequireDefault(require("./utils/get-viewport-height"));
|
|
19
18
|
var _getViewportWidth = _interopRequireDefault(require("./utils/get-viewport-width"));
|
|
@@ -108,9 +107,9 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
108
107
|
}, {
|
|
109
108
|
key: "calculateWithDebugInfo",
|
|
110
109
|
value: function () {
|
|
111
|
-
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
110
|
+
var _calculateWithDebugInfo = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio) {
|
|
112
111
|
var _window, _window2, _window6, _window8;
|
|
113
|
-
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, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
112
|
+
var percentiles, viewportEntries, vcLogs, vcDetails, percentileIndex, entryDataBuffer, ssrRatio, _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, _window7, _window7$__ufo_devtoo, _window9, _window9$__on_ufo_vc_;
|
|
114
113
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
115
114
|
while (1) switch (_context.prev = _context.next) {
|
|
116
115
|
case 0:
|
|
@@ -131,26 +130,34 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
131
130
|
vcDetails = {};
|
|
132
131
|
percentileIndex = 0;
|
|
133
132
|
entryDataBuffer = new Set();
|
|
133
|
+
ssrRatio = -1;
|
|
134
134
|
if (!vcLogs) {
|
|
135
|
-
_context.next =
|
|
135
|
+
_context.next = 30;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
138
|
_iterator4 = _createForOfIteratorHelper(vcLogs);
|
|
139
|
-
_context.prev =
|
|
139
|
+
_context.prev = 11;
|
|
140
140
|
_iterator4.s();
|
|
141
|
-
case
|
|
141
|
+
case 13:
|
|
142
142
|
if ((_step4 = _iterator4.n()).done) {
|
|
143
|
-
_context.next =
|
|
143
|
+
_context.next = 22;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
_entry3 = _step4.value;
|
|
147
|
-
time = _entry3.time, viewportPercentage = _entry3.viewportPercentage, entries = _entry3.entries;
|
|
147
|
+
time = _entry3.time, viewportPercentage = _entry3.viewportPercentage, entries = _entry3.entries;
|
|
148
|
+
if (includeSSRRatio && ssrRatio === -1 && entries.some(function (e) {
|
|
149
|
+
return e.elementName === 'SSR';
|
|
150
|
+
}) && (0, _platformFeatureFlags.fg)('platform_report_ssr_ratio_in_v3')) {
|
|
151
|
+
ssrRatio = viewportPercentage / 100;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Only process entries if we haven't reached all percentiles
|
|
148
155
|
if (!(percentileIndex >= percentiles.length)) {
|
|
149
|
-
_context.next =
|
|
156
|
+
_context.next = 19;
|
|
150
157
|
break;
|
|
151
158
|
}
|
|
152
|
-
return _context.abrupt("break",
|
|
153
|
-
case
|
|
159
|
+
return _context.abrupt("break", 22);
|
|
160
|
+
case 19:
|
|
154
161
|
// Check if this entry matches any checkpoint percentiles
|
|
155
162
|
if (viewportPercentage >= percentiles[percentileIndex]) {
|
|
156
163
|
elementNames = entries.map(function (e) {
|
|
@@ -172,21 +179,21 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
172
179
|
return entryDataBuffer.add(e);
|
|
173
180
|
});
|
|
174
181
|
}
|
|
175
|
-
case 18:
|
|
176
|
-
_context.next = 12;
|
|
177
|
-
break;
|
|
178
182
|
case 20:
|
|
179
|
-
_context.next =
|
|
183
|
+
_context.next = 13;
|
|
180
184
|
break;
|
|
181
185
|
case 22:
|
|
182
|
-
_context.
|
|
183
|
-
|
|
186
|
+
_context.next = 27;
|
|
187
|
+
break;
|
|
188
|
+
case 24:
|
|
189
|
+
_context.prev = 24;
|
|
190
|
+
_context.t0 = _context["catch"](11);
|
|
184
191
|
_iterator4.e(_context.t0);
|
|
185
|
-
case
|
|
186
|
-
_context.prev =
|
|
192
|
+
case 27:
|
|
193
|
+
_context.prev = 27;
|
|
187
194
|
_iterator4.f();
|
|
188
|
-
return _context.finish(
|
|
189
|
-
case
|
|
195
|
+
return _context.finish(27);
|
|
196
|
+
case 30:
|
|
190
197
|
// Fill in any missing percentiles with the last known values
|
|
191
198
|
previousResult = {
|
|
192
199
|
t: 0,
|
|
@@ -347,14 +354,17 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
347
354
|
console.error('Error in 3pDebugData', e);
|
|
348
355
|
}
|
|
349
356
|
}
|
|
350
|
-
return _context.abrupt("return",
|
|
351
|
-
|
|
357
|
+
return _context.abrupt("return", {
|
|
358
|
+
vcDetails: vcDetails,
|
|
359
|
+
ssrRatio: ssrRatio
|
|
360
|
+
});
|
|
361
|
+
case 43:
|
|
352
362
|
case "end":
|
|
353
363
|
return _context.stop();
|
|
354
364
|
}
|
|
355
|
-
}, _callee, this, [[
|
|
365
|
+
}, _callee, this, [[11, 24, 27, 30]]);
|
|
356
366
|
}));
|
|
357
|
-
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11) {
|
|
367
|
+
function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x0, _x1, _x10, _x11, _x12) {
|
|
358
368
|
return _calculateWithDebugInfo.apply(this, arguments);
|
|
359
369
|
}
|
|
360
370
|
return calculateWithDebugInfo;
|
|
@@ -366,11 +376,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
366
376
|
var _this = this,
|
|
367
377
|
_vcDetails$90$t,
|
|
368
378
|
_vcDetails$;
|
|
369
|
-
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, interactionType, isPageVisible, interactionAbortReason, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, vcDetails, result;
|
|
379
|
+
var startTime, stopTime, orderedEntries, interactionId, isPostInteraction, include3p, excludeSmartAnswersInSearch, includeSSRRatio, interactionType, isPageVisible, interactionAbortReason, filteredEntries, isVCClean, dirtyReason, getVCCleanStatusResult, _yield$this$calculate, vcDetails, ssrRatio, result;
|
|
370
380
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
371
381
|
while (1) switch (_context2.prev = _context2.next) {
|
|
372
382
|
case 0:
|
|
373
|
-
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch, interactionType = _ref.interactionType, isPageVisible = _ref.isPageVisible, interactionAbortReason = _ref.interactionAbortReason;
|
|
383
|
+
startTime = _ref.startTime, stopTime = _ref.stopTime, orderedEntries = _ref.orderedEntries, interactionId = _ref.interactionId, isPostInteraction = _ref.isPostInteraction, include3p = _ref.include3p, excludeSmartAnswersInSearch = _ref.excludeSmartAnswersInSearch, includeSSRRatio = _ref.includeSSRRatio, interactionType = _ref.interactionType, isPageVisible = _ref.isPageVisible, interactionAbortReason = _ref.interactionAbortReason;
|
|
374
384
|
filteredEntries = orderedEntries.filter(function (entry) {
|
|
375
385
|
return _this.isEntryIncluded(entry, include3p, excludeSmartAnswersInSearch);
|
|
376
386
|
});
|
|
@@ -390,9 +400,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
390
400
|
});
|
|
391
401
|
case 7:
|
|
392
402
|
_context2.next = 9;
|
|
393
|
-
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason);
|
|
403
|
+
return this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio);
|
|
394
404
|
case 9:
|
|
395
|
-
|
|
405
|
+
_yield$this$calculate = _context2.sent;
|
|
406
|
+
vcDetails = _yield$this$calculate.vcDetails;
|
|
407
|
+
ssrRatio = _yield$this$calculate.ssrRatio;
|
|
396
408
|
result = {
|
|
397
409
|
revision: this.revisionNo,
|
|
398
410
|
clean: true,
|
|
@@ -400,20 +412,20 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
|
|
|
400
412
|
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
|
|
401
413
|
};
|
|
402
414
|
result.ratios = this.calculateRatios(filteredEntries);
|
|
415
|
+
if (ssrRatio !== -1) {
|
|
416
|
+
result.ssrRatio = ssrRatio;
|
|
417
|
+
}
|
|
403
418
|
if (isPostInteraction) {
|
|
404
419
|
result.labelStacks = this.getLabelStacks(filteredEntries);
|
|
405
420
|
}
|
|
406
|
-
if ((0, _platformFeatureFlags.fg)('platform_ufo_display_content_track_occurrence')) {
|
|
407
|
-
result.displayContentsOccurrence = _trackDisplayContentOccurrence.cssIssueOccurrence;
|
|
408
|
-
}
|
|
409
421
|
return _context2.abrupt("return", result);
|
|
410
|
-
case
|
|
422
|
+
case 17:
|
|
411
423
|
case "end":
|
|
412
424
|
return _context2.stop();
|
|
413
425
|
}
|
|
414
426
|
}, _callee2, this);
|
|
415
427
|
}));
|
|
416
|
-
function calculate(
|
|
428
|
+
function calculate(_x13) {
|
|
417
429
|
return _calculate.apply(this, arguments);
|
|
418
430
|
}
|
|
419
431
|
return calculate;
|
|
@@ -19,14 +19,12 @@ var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
|
|
|
19
19
|
var _intersectionObserver = require("./intersection-observer");
|
|
20
20
|
var _mutationObserver = _interopRequireDefault(require("./mutation-observer"));
|
|
21
21
|
var _performanceObserver = _interopRequireDefault(require("./performance-observer"));
|
|
22
|
-
var _checkDisplayContent = _interopRequireDefault(require("./utils/check-display-content"));
|
|
23
22
|
var _checkWithinComponent2 = _interopRequireWildcard(require("./utils/check-within-component"));
|
|
24
23
|
var _getMutatedElements = require("./utils/get-mutated-elements");
|
|
25
24
|
var _isElementVisible = require("./utils/is-element-visible");
|
|
26
25
|
var _isInVcIgnoreIfNoLayoutShiftMarker = _interopRequireDefault(require("./utils/is-in-vc-ignore-if-no-layout-shift-marker"));
|
|
27
26
|
var _isSameRectDimensions = require("./utils/is-same-rect-dimensions");
|
|
28
27
|
var _isSameRectSize = require("./utils/is-same-rect-size");
|
|
29
|
-
var _trackDisplayContentOccurrence = _interopRequireDefault(require("./utils/track-display-content-occurrence"));
|
|
30
28
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
29
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
32
30
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -101,7 +99,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
101
99
|
_iterator = _createForOfIteratorHelper(addedNodes);
|
|
102
100
|
_context2.prev = 4;
|
|
103
101
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
104
|
-
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7, _iterator2, _step2, _step2$value, isDisplayContentsElementChildren, element, _this$intersectionObs8, _this$intersectionObs9,
|
|
102
|
+
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7, _iterator2, _step2, _step2$value, isDisplayContentsElementChildren, element, _this$intersectionObs8, _this$intersectionObs9, _this$intersectionObs0;
|
|
105
103
|
return _regenerator.default.wrap(function _loop$(_context) {
|
|
106
104
|
while (1) switch (_context.prev = _context.next) {
|
|
107
105
|
case 0:
|
|
@@ -230,26 +228,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
230
228
|
_iterator2.f();
|
|
231
229
|
}
|
|
232
230
|
} else {
|
|
233
|
-
|
|
234
|
-
// Check if the target has display:content css property, return array of valid targets
|
|
235
|
-
validTargets = (0, _checkDisplayContent.default)(addedNode);
|
|
236
|
-
_iterator3 = _createForOfIteratorHelper(validTargets);
|
|
237
|
-
try {
|
|
238
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
239
|
-
validTarget = _step3.value;
|
|
240
|
-
(_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
|
|
241
|
-
}
|
|
242
|
-
} catch (err) {
|
|
243
|
-
_iterator3.e(err);
|
|
244
|
-
} finally {
|
|
245
|
-
_iterator3.f();
|
|
246
|
-
}
|
|
247
|
-
} else {
|
|
248
|
-
if ((0, _platformFeatureFlags.fg)('platform_ufo_display_content_track_occurrence')) {
|
|
249
|
-
(0, _trackDisplayContentOccurrence.default)(addedNode);
|
|
250
|
-
}
|
|
251
|
-
(_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
252
|
-
}
|
|
231
|
+
(_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
253
232
|
}
|
|
254
233
|
case 46:
|
|
255
234
|
case "end":
|
|
@@ -296,12 +275,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
296
275
|
};
|
|
297
276
|
}());
|
|
298
277
|
(0, _defineProperty2.default)(this, "handleAttributeMutation", function (_ref6) {
|
|
299
|
-
var _this$
|
|
278
|
+
var _this$intersectionObs1;
|
|
300
279
|
var target = _ref6.target,
|
|
301
280
|
attributeName = _ref6.attributeName,
|
|
302
281
|
oldValue = _ref6.oldValue,
|
|
303
282
|
newValue = _ref6.newValue;
|
|
304
|
-
(_this$
|
|
283
|
+
(_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(target, function (_ref7) {
|
|
305
284
|
var target = _ref7.target,
|
|
306
285
|
rect = _ref7.rect;
|
|
307
286
|
if ((0, _vcUtils.isContainedWithinMediaWrapper)(target)) {
|
|
@@ -378,11 +357,11 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
378
357
|
(0, _defineProperty2.default)(this, "handleLayoutShift", function (_ref8) {
|
|
379
358
|
var time = _ref8.time,
|
|
380
359
|
changedRects = _ref8.changedRects;
|
|
381
|
-
var
|
|
382
|
-
|
|
360
|
+
var _iterator3 = _createForOfIteratorHelper(changedRects),
|
|
361
|
+
_step3;
|
|
383
362
|
try {
|
|
384
|
-
for (
|
|
385
|
-
var changedRect =
|
|
363
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
364
|
+
var changedRect = _step3.value;
|
|
386
365
|
var target = changedRect.node;
|
|
387
366
|
if (target) {
|
|
388
367
|
if ((0, _platformFeatureFlags.fg)('platform_ufo_vc_next_filter_ls_entries_same_rect')) {
|
|
@@ -408,9 +387,9 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
408
387
|
}
|
|
409
388
|
}
|
|
410
389
|
} catch (err) {
|
|
411
|
-
|
|
390
|
+
_iterator3.e(err);
|
|
412
391
|
} finally {
|
|
413
|
-
|
|
392
|
+
_iterator3.f();
|
|
414
393
|
}
|
|
415
394
|
});
|
|
416
395
|
this.mapVisibleNodeRects = new WeakMap();
|
|
@@ -467,12 +446,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
467
446
|
}, {
|
|
468
447
|
key: "stop",
|
|
469
448
|
value: function stop() {
|
|
470
|
-
var _this$mutationObserve2, _this$
|
|
449
|
+
var _this$mutationObserve2, _this$intersectionObs10, _this$performanceObse2;
|
|
471
450
|
if (!this.isStarted) {
|
|
472
451
|
return;
|
|
473
452
|
}
|
|
474
453
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
|
|
475
|
-
(_this$
|
|
454
|
+
(_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.disconnect();
|
|
476
455
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
|
|
477
456
|
this.isStarted = false;
|
|
478
457
|
// Clean up caches when stopping
|
|
@@ -9,7 +9,6 @@ import { clearActiveTrace } from '../experience-trace-id-context';
|
|
|
9
9
|
import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
|
|
10
10
|
import { getInteractionId } from '../interaction-id-context';
|
|
11
11
|
import { newVCObserver } from '../vc';
|
|
12
|
-
import { resetCssIssueOccurrence } from '../vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence';
|
|
13
12
|
import { interactions } from './common/constants';
|
|
14
13
|
import InteractionExtraMetrics from './interaction-extra-metrics';
|
|
15
14
|
import PostInteractionLog from './post-interaction-log';
|
|
@@ -889,7 +888,6 @@ export function addOnCancelCallback(id, cancelCallback) {
|
|
|
889
888
|
interaction === null || interaction === void 0 ? void 0 : interaction.cancelCallbacks.push(cancelCallback);
|
|
890
889
|
}
|
|
891
890
|
export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName, trace = null) {
|
|
892
|
-
resetCssIssueOccurrence();
|
|
893
891
|
interactionExtraMetrics.reset();
|
|
894
892
|
postInteractionLog.reset();
|
|
895
893
|
let vcObserver;
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -96,7 +96,8 @@ export class VCObserverWrapper {
|
|
|
96
96
|
const {
|
|
97
97
|
experienceKey,
|
|
98
98
|
include3p,
|
|
99
|
-
excludeSmartAnswersInSearch
|
|
99
|
+
excludeSmartAnswersInSearch,
|
|
100
|
+
includeSSRRatio
|
|
100
101
|
} = param;
|
|
101
102
|
const v1v2Result = isVCRevisionEnabled('fy25.01', experienceKey) || isVCRevisionEnabled('fy25.02', experienceKey) ? await ((_this$oldVCObserver4 = this.oldVCObserver) === null || _this$oldVCObserver4 === void 0 ? void 0 : _this$oldVCObserver4.getVCResult(param)) : {};
|
|
102
103
|
const v3Result = isVCRevisionEnabled('fy25.03', experienceKey) ? await ((_this$newVCObserver3 = this.newVCObserver) === null || _this$newVCObserver3 === void 0 ? void 0 : _this$newVCObserver3.getVCResult({
|
|
@@ -106,6 +107,7 @@ export class VCObserverWrapper {
|
|
|
106
107
|
ssr: param.includeSSRInV3 ? param.ssr : undefined,
|
|
107
108
|
include3p,
|
|
108
109
|
excludeSmartAnswersInSearch,
|
|
110
|
+
includeSSRRatio,
|
|
109
111
|
interactionType: param.interactionType,
|
|
110
112
|
isPageVisible: param.isPageVisible,
|
|
111
113
|
interactionAbortReason: param.interactionAbortReason
|
|
@@ -113,7 +115,11 @@ export class VCObserverWrapper {
|
|
|
113
115
|
if (!v3Result) {
|
|
114
116
|
return v1v2Result !== null && v1v2Result !== void 0 ? v1v2Result : {};
|
|
115
117
|
}
|
|
118
|
+
const ssrRatio = v3Result[0].ssrRatio;
|
|
116
119
|
return {
|
|
120
|
+
...(includeSSRRatio && ssrRatio !== undefined ? {
|
|
121
|
+
'ufo:vc:ssrRatio': ssrRatio
|
|
122
|
+
} : {}),
|
|
117
123
|
...v1v2Result,
|
|
118
124
|
'ufo:vc:rev': [...((_ref = v1v2Result === null || v1v2Result === void 0 ? void 0 : v1v2Result['ufo:vc:rev']) !== null && _ref !== void 0 ? _ref : []), ...(v3Result !== null && v3Result !== void 0 ? v3Result : [])]
|
|
119
125
|
};
|
|
@@ -200,6 +200,7 @@ export default class VCObserverNew {
|
|
|
200
200
|
interactionAbortReason,
|
|
201
201
|
isPageVisible,
|
|
202
202
|
include3p,
|
|
203
|
+
includeSSRRatio,
|
|
203
204
|
excludeSmartAnswersInSearch
|
|
204
205
|
} = param;
|
|
205
206
|
const results = [];
|
|
@@ -221,6 +222,7 @@ export default class VCObserverNew {
|
|
|
221
222
|
isPostInteraction: this.isPostInteraction,
|
|
222
223
|
include3p,
|
|
223
224
|
excludeSmartAnswersInSearch,
|
|
225
|
+
includeSSRRatio,
|
|
224
226
|
isPageVisible,
|
|
225
227
|
interactionAbortReason
|
|
226
228
|
});
|
|
@@ -239,6 +241,7 @@ export default class VCObserverNew {
|
|
|
239
241
|
interactionType,
|
|
240
242
|
isPostInteraction: this.isPostInteraction,
|
|
241
243
|
include3p,
|
|
244
|
+
includeSSRRatio,
|
|
242
245
|
isPageVisible,
|
|
243
246
|
interactionAbortReason
|
|
244
247
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
|
-
import { cssIssueOccurrence } from '../viewport-observer/utils/track-display-content-occurrence';
|
|
3
2
|
import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
|
|
4
3
|
import getViewportHeight from './utils/get-viewport-height';
|
|
5
4
|
import getViewportWidth from './utils/get-viewport-width';
|
|
@@ -52,7 +51,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
52
51
|
}
|
|
53
52
|
return labelStacks;
|
|
54
53
|
}
|
|
55
|
-
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason) {
|
|
54
|
+
async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, allEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio) {
|
|
56
55
|
var _window, _window2, _window6, _window8;
|
|
57
56
|
const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99, 100];
|
|
58
57
|
const viewportEntries = this.filterViewportEntries(filteredEntries);
|
|
@@ -68,6 +67,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
68
67
|
const vcDetails = {};
|
|
69
68
|
let percentileIndex = 0;
|
|
70
69
|
const entryDataBuffer = new Set();
|
|
70
|
+
let ssrRatio = -1;
|
|
71
71
|
if (vcLogs) {
|
|
72
72
|
for (const entry of vcLogs) {
|
|
73
73
|
const {
|
|
@@ -75,6 +75,9 @@ export default class AbstractVCCalculatorBase {
|
|
|
75
75
|
viewportPercentage,
|
|
76
76
|
entries
|
|
77
77
|
} = entry;
|
|
78
|
+
if (includeSSRRatio && ssrRatio === -1 && entries.some(e => e.elementName === 'SSR') && fg('platform_report_ssr_ratio_in_v3')) {
|
|
79
|
+
ssrRatio = viewportPercentage / 100;
|
|
80
|
+
}
|
|
78
81
|
|
|
79
82
|
// Only process entries if we haven't reached all percentiles
|
|
80
83
|
if (percentileIndex >= percentiles.length) {
|
|
@@ -247,7 +250,10 @@ export default class AbstractVCCalculatorBase {
|
|
|
247
250
|
console.error('Error in 3pDebugData', e);
|
|
248
251
|
}
|
|
249
252
|
}
|
|
250
|
-
return
|
|
253
|
+
return {
|
|
254
|
+
vcDetails,
|
|
255
|
+
ssrRatio
|
|
256
|
+
};
|
|
251
257
|
}
|
|
252
258
|
async calculate({
|
|
253
259
|
startTime,
|
|
@@ -257,6 +263,7 @@ export default class AbstractVCCalculatorBase {
|
|
|
257
263
|
isPostInteraction,
|
|
258
264
|
include3p,
|
|
259
265
|
excludeSmartAnswersInSearch,
|
|
266
|
+
includeSSRRatio,
|
|
260
267
|
interactionType,
|
|
261
268
|
isPageVisible,
|
|
262
269
|
interactionAbortReason
|
|
@@ -279,7 +286,10 @@ export default class AbstractVCCalculatorBase {
|
|
|
279
286
|
abortTimestamp: getVCCleanStatusResult.abortTimestamp
|
|
280
287
|
};
|
|
281
288
|
}
|
|
282
|
-
const
|
|
289
|
+
const {
|
|
290
|
+
vcDetails,
|
|
291
|
+
ssrRatio
|
|
292
|
+
} = await this.calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionType, isPageVisible, interactionId, dirtyReason, orderedEntries, include3p, excludeSmartAnswersInSearch, interactionAbortReason, includeSSRRatio);
|
|
283
293
|
const result = {
|
|
284
294
|
revision: this.revisionNo,
|
|
285
295
|
clean: true,
|
|
@@ -287,12 +297,12 @@ export default class AbstractVCCalculatorBase {
|
|
|
287
297
|
vcDetails: vcDetails !== null && vcDetails !== void 0 ? vcDetails : undefined
|
|
288
298
|
};
|
|
289
299
|
result.ratios = this.calculateRatios(filteredEntries);
|
|
300
|
+
if (ssrRatio !== -1) {
|
|
301
|
+
result.ssrRatio = ssrRatio;
|
|
302
|
+
}
|
|
290
303
|
if (isPostInteraction) {
|
|
291
304
|
result.labelStacks = this.getLabelStacks(filteredEntries);
|
|
292
305
|
}
|
|
293
|
-
if (fg('platform_ufo_display_content_track_occurrence')) {
|
|
294
|
-
result.displayContentsOccurrence = cssIssueOccurrence;
|
|
295
|
-
}
|
|
296
306
|
return result;
|
|
297
307
|
}
|
|
298
308
|
}
|
|
@@ -7,14 +7,12 @@ import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placehol
|
|
|
7
7
|
import { createIntersectionObserver } from './intersection-observer';
|
|
8
8
|
import createMutationObserver from './mutation-observer';
|
|
9
9
|
import createPerformanceObserver from './performance-observer';
|
|
10
|
-
import checkCssProperty from './utils/check-display-content';
|
|
11
10
|
import checkWithinComponent, { cleanupCaches } from './utils/check-within-component';
|
|
12
11
|
import { getMutatedElements } from './utils/get-mutated-elements';
|
|
13
12
|
import { isElementVisible } from './utils/is-element-visible';
|
|
14
13
|
import isInVCIgnoreIfNoLayoutShiftMarker from './utils/is-in-vc-ignore-if-no-layout-shift-marker';
|
|
15
14
|
import { isSameRectDimensions } from './utils/is-same-rect-dimensions';
|
|
16
15
|
import { isSameRectSize } from './utils/is-same-rect-size';
|
|
17
|
-
import trackDisplayContentsOccurrence from './utils/track-display-content-occurrence';
|
|
18
16
|
const createElementMutationsWatcher = removedNodeRects => ({
|
|
19
17
|
target,
|
|
20
18
|
rect
|
|
@@ -176,20 +174,8 @@ export default class ViewportObserver {
|
|
|
176
174
|
}
|
|
177
175
|
}
|
|
178
176
|
} else {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const validTargets = checkCssProperty(addedNode);
|
|
182
|
-
for (const validTarget of validTargets) {
|
|
183
|
-
var _this$intersectionObs0;
|
|
184
|
-
(_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
|
|
185
|
-
}
|
|
186
|
-
} else {
|
|
187
|
-
var _this$intersectionObs1;
|
|
188
|
-
if (fg('platform_ufo_display_content_track_occurrence')) {
|
|
189
|
-
trackDisplayContentsOccurrence(addedNode);
|
|
190
|
-
}
|
|
191
|
-
(_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
192
|
-
}
|
|
177
|
+
var _this$intersectionObs0;
|
|
178
|
+
(_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
193
179
|
}
|
|
194
180
|
}
|
|
195
181
|
});
|
|
@@ -199,8 +185,8 @@ export default class ViewportObserver {
|
|
|
199
185
|
oldValue,
|
|
200
186
|
newValue
|
|
201
187
|
}) => {
|
|
202
|
-
var _this$
|
|
203
|
-
(_this$
|
|
188
|
+
var _this$intersectionObs1;
|
|
189
|
+
(_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.watchAndTag(target, ({
|
|
204
190
|
target,
|
|
205
191
|
rect
|
|
206
192
|
}) => {
|
|
@@ -353,12 +339,12 @@ export default class ViewportObserver {
|
|
|
353
339
|
this.isStarted = true;
|
|
354
340
|
}
|
|
355
341
|
stop() {
|
|
356
|
-
var _this$mutationObserve2, _this$
|
|
342
|
+
var _this$mutationObserve2, _this$intersectionObs10, _this$performanceObse2;
|
|
357
343
|
if (!this.isStarted) {
|
|
358
344
|
return;
|
|
359
345
|
}
|
|
360
346
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 ? void 0 : _this$mutationObserve2.disconnect();
|
|
361
|
-
(_this$
|
|
347
|
+
(_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 ? void 0 : _this$intersectionObs10.disconnect();
|
|
362
348
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 ? void 0 : _this$performanceObse2.disconnect();
|
|
363
349
|
this.isStarted = false;
|
|
364
350
|
// Clean up caches when stopping
|
|
@@ -19,7 +19,6 @@ import { clearActiveTrace } from '../experience-trace-id-context';
|
|
|
19
19
|
import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
|
|
20
20
|
import { getInteractionId } from '../interaction-id-context';
|
|
21
21
|
import { newVCObserver } from '../vc';
|
|
22
|
-
import { resetCssIssueOccurrence } from '../vc/vc-observer-new/viewport-observer/utils/track-display-content-occurrence';
|
|
23
22
|
import { interactions } from './common/constants';
|
|
24
23
|
import InteractionExtraMetrics from './interaction-extra-metrics';
|
|
25
24
|
import PostInteractionLog from './post-interaction-log';
|
|
@@ -964,7 +963,6 @@ export function addOnCancelCallback(id, cancelCallback) {
|
|
|
964
963
|
}
|
|
965
964
|
export function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelStack, routeName) {
|
|
966
965
|
var trace = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;
|
|
967
|
-
resetCssIssueOccurrence();
|
|
968
966
|
interactionExtraMetrics.reset();
|
|
969
967
|
postInteractionLog.reset();
|
|
970
968
|
var vcObserver;
|