@atlaskit/react-ufo 4.7.6 → 4.8.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.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/create-interaction-extra-metrics-payload/index.js +1 -1
- package/dist/cjs/vc/index.js +1 -1
- package/dist/cjs/vc/vc-observer-new/index.js +25 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +2 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/vcnext/index.js +41 -0
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +46 -26
- package/dist/es2019/create-interaction-extra-metrics-payload/index.js +1 -1
- package/dist/es2019/vc/index.js +1 -1
- package/dist/es2019/vc/vc-observer-new/index.js +17 -0
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +2 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/vcnext/index.js +21 -0
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +29 -14
- package/dist/esm/create-interaction-extra-metrics-payload/index.js +1 -1
- package/dist/esm/vc/index.js +1 -1
- package/dist/esm/vc/vc-observer-new/index.js +25 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +2 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/vcnext/index.js +36 -0
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +46 -26
- package/dist/types/config/index.d.ts +1 -1
- package/dist/types/create-interaction-extra-metrics-payload/index.d.ts +1 -1
- 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/vcnext/index.d.ts +6 -0
- package/dist/types/vc/vc-observer-new/types.d.ts +1 -1
- package/dist/types-ts4.5/config/index.d.ts +1 -1
- package/dist/types-ts4.5/create-interaction-extra-metrics-payload/index.d.ts +1 -1
- 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/vcnext/index.d.ts +6 -0
- package/dist/types-ts4.5/vc/vc-observer-new/types.d.ts +1 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`fed39716487e7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fed39716487e7) -
|
|
8
|
+
calculate VCNext (TTVC v4) metric behind FG
|
|
9
|
+
|
|
3
10
|
## 4.7.6
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -79,7 +79,7 @@ function _createInteractionExtraLogPayload() {
|
|
|
79
79
|
var revision = _ref.revision;
|
|
80
80
|
return revision === _config.DEFAULT_TTVC_REVISION;
|
|
81
81
|
});
|
|
82
|
-
if (!(!(effectiveVCRevisionPayload !== null && effectiveVCRevisionPayload !== void 0 && effectiveVCRevisionPayload.clean) || (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) === undefined)) {
|
|
82
|
+
if (!(!(effectiveVCRevisionPayload !== null && effectiveVCRevisionPayload !== void 0 && effectiveVCRevisionPayload.clean) || (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) === undefined || typeof (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) !== 'number' || extraTTAI === undefined || typeof extraTTAI !== 'number' || interaction.errors.length > 0)) {
|
|
83
83
|
_context.next = 23;
|
|
84
84
|
break;
|
|
85
85
|
}
|
package/dist/cjs/vc/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var VCObserverWrapper = exports.VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
35
35
|
this.ssrPlaceholderHandler = new _ssrPlaceholders.SSRPlaceholderHandlers({
|
|
36
36
|
enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
|
|
37
37
|
});
|
|
38
|
-
if ((0, _config.isVCRevisionEnabled)('fy25.03')) {
|
|
38
|
+
if ((0, _config.isVCRevisionEnabled)('fy25.03') || (0, _config.isVCRevisionEnabled)('next')) {
|
|
39
39
|
var _opts$ssrEnablePageLa2;
|
|
40
40
|
this.newVCObserver = new _vcObserverNew.default({
|
|
41
41
|
selectorConfig: opts.selectorConfig,
|
|
@@ -19,6 +19,7 @@ var _getElementName2 = _interopRequireDefault(require("./get-element-name"));
|
|
|
19
19
|
var _fy25_ = _interopRequireDefault(require("./metric-calculator/fy25_03"));
|
|
20
20
|
var _getViewportHeight = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-height"));
|
|
21
21
|
var _getViewportWidth = _interopRequireDefault(require("./metric-calculator/utils/get-viewport-width"));
|
|
22
|
+
var _vcnext = _interopRequireDefault(require("./metric-calculator/vcnext"));
|
|
22
23
|
var _viewportObserver = _interopRequireDefault(require("./viewport-observer"));
|
|
23
24
|
var _windowEventObserver = _interopRequireDefault(require("./window-event-observer"));
|
|
24
25
|
var SSRState = {
|
|
@@ -237,7 +238,7 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
237
238
|
key: "getVCResult",
|
|
238
239
|
value: function () {
|
|
239
240
|
var _getVCResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(param) {
|
|
240
|
-
var start, stop, interactionId, include3p, results, calculator_fy25_03, orderedEntries, fy25_03;
|
|
241
|
+
var start, stop, interactionId, include3p, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
241
242
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
242
243
|
while (1) switch (_context.prev = _context.next) {
|
|
243
244
|
case 0:
|
|
@@ -266,8 +267,30 @@ var VCObserverNew = exports.default = /*#__PURE__*/function () {
|
|
|
266
267
|
if (fy25_03) {
|
|
267
268
|
results.push(fy25_03);
|
|
268
269
|
}
|
|
270
|
+
|
|
271
|
+
// TODO on cleanup: put behind `enabledVCRevisions` config
|
|
272
|
+
if (!(0, _platformFeatureFlags.fg)('platform_ufo_vcnext_v4_enabled')) {
|
|
273
|
+
_context.next = 16;
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
calculator_next = new _vcnext.default();
|
|
277
|
+
_context.next = 14;
|
|
278
|
+
return calculator_next.calculate({
|
|
279
|
+
orderedEntries: orderedEntries,
|
|
280
|
+
startTime: start,
|
|
281
|
+
stopTime: stop,
|
|
282
|
+
interactionId: interactionId,
|
|
283
|
+
isPostInteraction: this.isPostInteraction,
|
|
284
|
+
include3p: include3p
|
|
285
|
+
});
|
|
286
|
+
case 14:
|
|
287
|
+
vcNext = _context.sent;
|
|
288
|
+
if (vcNext) {
|
|
289
|
+
results.push(vcNext);
|
|
290
|
+
}
|
|
291
|
+
case 16:
|
|
269
292
|
return _context.abrupt("return", results);
|
|
270
|
-
case
|
|
293
|
+
case 17:
|
|
271
294
|
case "end":
|
|
272
295
|
return _context.stop();
|
|
273
296
|
}
|
|
@@ -44,9 +44,9 @@ var THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = exports.THIRD_PARTY_BROWSER_EXTEN
|
|
|
44
44
|
// grammarly extensions
|
|
45
45
|
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
46
46
|
var VCCalculator_FY25_03 = exports.default = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
47
|
-
function VCCalculator_FY25_03() {
|
|
47
|
+
function VCCalculator_FY25_03(revisionNo) {
|
|
48
48
|
(0, _classCallCheck2.default)(this, VCCalculator_FY25_03);
|
|
49
|
-
return _callSuper(this, VCCalculator_FY25_03, [REVISION_NO]);
|
|
49
|
+
return _callSuper(this, VCCalculator_FY25_03, [revisionNo !== null && revisionNo !== void 0 ? revisionNo : REVISION_NO]);
|
|
50
50
|
}
|
|
51
51
|
(0, _inherits2.default)(VCCalculator_FY25_03, _AbstractVCCalculator);
|
|
52
52
|
return (0, _createClass2.default)(VCCalculator_FY25_03, [{
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
+
var _fy25_ = _interopRequireDefault(require("../fy25_03"));
|
|
15
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
|
+
function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
18
|
+
// NOTE: `next` to be renamed `fy26.04` once stable
|
|
19
|
+
var REVISION_NO = 'next';
|
|
20
|
+
var getConsideredEntryTypes = function getConsideredEntryTypes() {
|
|
21
|
+
return ['mutation:display-contents-children-element'];
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// NOTE: `VCNext` to be renamed `FY26_04` once stable
|
|
25
|
+
var VCNextCalculator = exports.default = /*#__PURE__*/function (_VCCalculator_FY25_) {
|
|
26
|
+
function VCNextCalculator() {
|
|
27
|
+
(0, _classCallCheck2.default)(this, VCNextCalculator);
|
|
28
|
+
return _callSuper(this, VCNextCalculator, [REVISION_NO]);
|
|
29
|
+
}
|
|
30
|
+
(0, _inherits2.default)(VCNextCalculator, _VCCalculator_FY25_);
|
|
31
|
+
return (0, _createClass2.default)(VCNextCalculator, [{
|
|
32
|
+
key: "isEntryIncluded",
|
|
33
|
+
value: function isEntryIncluded(entry, include3p) {
|
|
34
|
+
var isEntryIncludedInV3 = _superPropGet(VCNextCalculator, "isEntryIncluded", this, 3)([entry, include3p]);
|
|
35
|
+
if (isEntryIncludedInV3) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
return getConsideredEntryTypes().includes(entry.data.type);
|
|
39
|
+
}
|
|
40
|
+
}]);
|
|
41
|
+
}(_fy25_.default);
|
|
@@ -126,7 +126,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
126
126
|
_iterator = _createForOfIteratorHelper(addedNodes);
|
|
127
127
|
_context2.prev = 4;
|
|
128
128
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
129
|
-
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,
|
|
129
|
+
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, _window, _iterator2, _step2, child, _this$intersectionObs8, _this$intersectionObs9, validTargets, _iterator3, _step3, _this$intersectionObs0, validTarget, _this$intersectionObs1;
|
|
130
130
|
return _regenerator.default.wrap(function _loop$(_context) {
|
|
131
131
|
while (1) switch (_context.prev = _context.next) {
|
|
132
132
|
case 0:
|
|
@@ -238,25 +238,45 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
238
238
|
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
239
239
|
return _context.abrupt("return", 0);
|
|
240
240
|
case 45:
|
|
241
|
-
if ((0, _platformFeatureFlags.fg)('
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
241
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_vcnext_v4_enabled')) {
|
|
242
|
+
if (((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(addedNode)) === null || _window === void 0 ? void 0 : _window.display) === 'contents') {
|
|
243
|
+
_iterator2 = _createForOfIteratorHelper(addedNode.children);
|
|
244
|
+
try {
|
|
245
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
246
|
+
child = _step2.value;
|
|
247
|
+
if (child instanceof HTMLElement) {
|
|
248
|
+
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(child, 'mutation:display-contents-children-element');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
} catch (err) {
|
|
252
|
+
_iterator2.e(err);
|
|
253
|
+
} finally {
|
|
254
|
+
_iterator2.f();
|
|
249
255
|
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
} finally {
|
|
253
|
-
_iterator2.f();
|
|
256
|
+
} else {
|
|
257
|
+
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
254
258
|
}
|
|
255
259
|
} else {
|
|
256
|
-
if ((0, _platformFeatureFlags.fg)('
|
|
257
|
-
|
|
260
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_display_content_resolution_ttvc_v3')) {
|
|
261
|
+
// Check if the target has display:content css property, return array of valid targets
|
|
262
|
+
validTargets = (0, _checkDisplayContent.default)(addedNode);
|
|
263
|
+
_iterator3 = _createForOfIteratorHelper(validTargets);
|
|
264
|
+
try {
|
|
265
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
266
|
+
validTarget = _step3.value;
|
|
267
|
+
(_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
|
|
268
|
+
}
|
|
269
|
+
} catch (err) {
|
|
270
|
+
_iterator3.e(err);
|
|
271
|
+
} finally {
|
|
272
|
+
_iterator3.f();
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_display_content_track_occurrence')) {
|
|
276
|
+
(0, _trackDisplayContentOccurrence.default)(addedNode);
|
|
277
|
+
}
|
|
278
|
+
(_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
258
279
|
}
|
|
259
|
-
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
260
280
|
}
|
|
261
281
|
case 46:
|
|
262
282
|
case "end":
|
|
@@ -303,12 +323,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
303
323
|
};
|
|
304
324
|
}());
|
|
305
325
|
(0, _defineProperty2.default)(this, "handleAttributeMutation", function (_ref6) {
|
|
306
|
-
var _this$
|
|
326
|
+
var _this$intersectionObs10;
|
|
307
327
|
var target = _ref6.target,
|
|
308
328
|
attributeName = _ref6.attributeName,
|
|
309
329
|
oldValue = _ref6.oldValue,
|
|
310
330
|
newValue = _ref6.newValue;
|
|
311
|
-
(_this$
|
|
331
|
+
(_this$intersectionObs10 = _this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.watchAndTag(target, function (_ref7) {
|
|
312
332
|
var target = _ref7.target,
|
|
313
333
|
rect = _ref7.rect;
|
|
314
334
|
if ((0, _vcUtils.isContainedWithinMediaWrapper)(target)) {
|
|
@@ -386,11 +406,11 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
386
406
|
(0, _defineProperty2.default)(this, "handleLayoutShift", function (_ref8) {
|
|
387
407
|
var time = _ref8.time,
|
|
388
408
|
changedRects = _ref8.changedRects;
|
|
389
|
-
var
|
|
390
|
-
|
|
409
|
+
var _iterator4 = _createForOfIteratorHelper(changedRects),
|
|
410
|
+
_step4;
|
|
391
411
|
try {
|
|
392
|
-
for (
|
|
393
|
-
var changedRect =
|
|
412
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
413
|
+
var changedRect = _step4.value;
|
|
394
414
|
var target = changedRect.node;
|
|
395
415
|
if (target) {
|
|
396
416
|
_this.onChange({
|
|
@@ -404,9 +424,9 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
404
424
|
}
|
|
405
425
|
}
|
|
406
426
|
} catch (err) {
|
|
407
|
-
|
|
427
|
+
_iterator4.e(err);
|
|
408
428
|
} finally {
|
|
409
|
-
|
|
429
|
+
_iterator4.f();
|
|
410
430
|
}
|
|
411
431
|
});
|
|
412
432
|
this.mapVisibleNodeRects = new WeakMap();
|
|
@@ -463,12 +483,12 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
463
483
|
}, {
|
|
464
484
|
key: "stop",
|
|
465
485
|
value: function stop() {
|
|
466
|
-
var _this$mutationObserve2, _this$
|
|
486
|
+
var _this$mutationObserve2, _this$intersectionObs11, _this$performanceObse2;
|
|
467
487
|
if (!this.isStarted) {
|
|
468
488
|
return;
|
|
469
489
|
}
|
|
470
490
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
|
|
471
|
-
(_this$
|
|
491
|
+
(_this$intersectionObs11 = this.intersectionObserver) === null || _this$intersectionObs11 === void 0 || _this$intersectionObs11.disconnect();
|
|
472
492
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
|
|
473
493
|
this.isStarted = false;
|
|
474
494
|
// Clean up caches when stopping
|
|
@@ -57,7 +57,7 @@ async function createInteractionExtraLogPayload(interactionId, interaction) {
|
|
|
57
57
|
const effectiveVCRevisionPayload = vcRevisionPayload === null || vcRevisionPayload === void 0 ? void 0 : vcRevisionPayload.find(({
|
|
58
58
|
revision
|
|
59
59
|
}) => revision === DEFAULT_TTVC_REVISION);
|
|
60
|
-
if (!(effectiveVCRevisionPayload !== null && effectiveVCRevisionPayload !== void 0 && effectiveVCRevisionPayload.clean) || (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) === undefined) {
|
|
60
|
+
if (!(effectiveVCRevisionPayload !== null && effectiveVCRevisionPayload !== void 0 && effectiveVCRevisionPayload.clean) || (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) === undefined || typeof (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) !== 'number' || extraTTAI === undefined || typeof extraTTAI !== 'number' || interaction.errors.length > 0) {
|
|
61
61
|
return null;
|
|
62
62
|
}
|
|
63
63
|
|
package/dist/es2019/vc/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export class VCObserverWrapper {
|
|
|
15
15
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers({
|
|
16
16
|
enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
|
|
17
17
|
});
|
|
18
|
-
if (isVCRevisionEnabled('fy25.03')) {
|
|
18
|
+
if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled('next')) {
|
|
19
19
|
var _opts$ssrEnablePageLa2;
|
|
20
20
|
this.newVCObserver = new VCObserverNew({
|
|
21
21
|
selectorConfig: opts.selectorConfig,
|
|
@@ -6,6 +6,7 @@ import getElementName from './get-element-name';
|
|
|
6
6
|
import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
7
7
|
import getViewportHeight from './metric-calculator/utils/get-viewport-height';
|
|
8
8
|
import getViewportWidth from './metric-calculator/utils/get-viewport-width';
|
|
9
|
+
import VCNextCalculator from './metric-calculator/vcnext';
|
|
9
10
|
import ViewportObserver from './viewport-observer';
|
|
10
11
|
import WindowEventObserver from './window-event-observer';
|
|
11
12
|
const SSRState = {
|
|
@@ -218,6 +219,22 @@ export default class VCObserverNew {
|
|
|
218
219
|
if (fy25_03) {
|
|
219
220
|
results.push(fy25_03);
|
|
220
221
|
}
|
|
222
|
+
|
|
223
|
+
// TODO on cleanup: put behind `enabledVCRevisions` config
|
|
224
|
+
if (fg('platform_ufo_vcnext_v4_enabled')) {
|
|
225
|
+
const calculator_next = new VCNextCalculator();
|
|
226
|
+
const vcNext = await calculator_next.calculate({
|
|
227
|
+
orderedEntries,
|
|
228
|
+
startTime: start,
|
|
229
|
+
stopTime: stop,
|
|
230
|
+
interactionId,
|
|
231
|
+
isPostInteraction: this.isPostInteraction,
|
|
232
|
+
include3p
|
|
233
|
+
});
|
|
234
|
+
if (vcNext) {
|
|
235
|
+
results.push(vcNext);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
221
238
|
return results;
|
|
222
239
|
}
|
|
223
240
|
addStartEntry(startTime) {
|
|
@@ -30,8 +30,8 @@ export const THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz
|
|
|
30
30
|
// grammarly extensions
|
|
31
31
|
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
32
32
|
export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
33
|
-
constructor() {
|
|
34
|
-
super(REVISION_NO);
|
|
33
|
+
constructor(revisionNo) {
|
|
34
|
+
super(revisionNo !== null && revisionNo !== void 0 ? revisionNo : REVISION_NO);
|
|
35
35
|
}
|
|
36
36
|
isEntryIncluded(entry, include3p) {
|
|
37
37
|
if (!getConsideredEntryTypes(include3p).includes(entry.data.type)) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import VCCalculator_FY25_03 from '../fy25_03';
|
|
2
|
+
|
|
3
|
+
// NOTE: `next` to be renamed `fy26.04` once stable
|
|
4
|
+
const REVISION_NO = 'next';
|
|
5
|
+
const getConsideredEntryTypes = () => {
|
|
6
|
+
return ['mutation:display-contents-children-element'];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// NOTE: `VCNext` to be renamed `FY26_04` once stable
|
|
10
|
+
export default class VCNextCalculator extends VCCalculator_FY25_03 {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(REVISION_NO);
|
|
13
|
+
}
|
|
14
|
+
isEntryIncluded(entry, include3p) {
|
|
15
|
+
const isEntryIncludedInV3 = super.isEntryIncluded(entry, include3p);
|
|
16
|
+
if (isEntryIncludedInV3) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return getConsideredEntryTypes().includes(entry.data.type);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -187,19 +187,34 @@ export default class ViewportObserver {
|
|
|
187
187
|
(_this$intersectionObs7 = this.intersectionObserver) === null || _this$intersectionObs7 === void 0 ? void 0 : _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
188
188
|
continue;
|
|
189
189
|
}
|
|
190
|
-
if (fg('
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
if (fg('platform_ufo_vcnext_v4_enabled')) {
|
|
191
|
+
var _window, _window$getComputedSt;
|
|
192
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : (_window$getComputedSt = _window.getComputedStyle(addedNode)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.display) === 'contents') {
|
|
193
|
+
for (const child of addedNode.children) {
|
|
194
|
+
if (child instanceof HTMLElement) {
|
|
195
|
+
var _this$intersectionObs8;
|
|
196
|
+
(_this$intersectionObs8 = this.intersectionObserver) === null || _this$intersectionObs8 === void 0 ? void 0 : _this$intersectionObs8.watchAndTag(child, 'mutation:display-contents-children-element');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
var _this$intersectionObs9;
|
|
201
|
+
(_this$intersectionObs9 = this.intersectionObserver) === null || _this$intersectionObs9 === void 0 ? void 0 : _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
196
202
|
}
|
|
197
203
|
} else {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
204
|
+
if (fg('platform_ufo_display_content_resolution_ttvc_v3')) {
|
|
205
|
+
// Check if the target has display:content css property, return array of valid targets
|
|
206
|
+
const validTargets = checkCssProperty(addedNode);
|
|
207
|
+
for (const validTarget of validTargets) {
|
|
208
|
+
var _this$intersectionObs0;
|
|
209
|
+
(_this$intersectionObs0 = this.intersectionObserver) === null || _this$intersectionObs0 === void 0 ? void 0 : _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
var _this$intersectionObs1;
|
|
213
|
+
if (fg('platform_ufo_display_content_track_occurrence')) {
|
|
214
|
+
trackDisplayContentsOccurrence(addedNode);
|
|
215
|
+
}
|
|
216
|
+
(_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 ? void 0 : _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
201
217
|
}
|
|
202
|
-
(_this$intersectionObs9 = this.intersectionObserver) === null || _this$intersectionObs9 === void 0 ? void 0 : _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
203
218
|
}
|
|
204
219
|
}
|
|
205
220
|
});
|
|
@@ -209,8 +224,8 @@ export default class ViewportObserver {
|
|
|
209
224
|
oldValue,
|
|
210
225
|
newValue
|
|
211
226
|
}) => {
|
|
212
|
-
var _this$
|
|
213
|
-
(_this$
|
|
227
|
+
var _this$intersectionObs10;
|
|
228
|
+
(_this$intersectionObs10 = this.intersectionObserver) === null || _this$intersectionObs10 === void 0 ? void 0 : _this$intersectionObs10.watchAndTag(target, ({
|
|
214
229
|
target,
|
|
215
230
|
rect
|
|
216
231
|
}) => {
|
|
@@ -352,12 +367,12 @@ export default class ViewportObserver {
|
|
|
352
367
|
this.isStarted = true;
|
|
353
368
|
}
|
|
354
369
|
stop() {
|
|
355
|
-
var _this$mutationObserve2, _this$
|
|
370
|
+
var _this$mutationObserve2, _this$intersectionObs11, _this$performanceObse2;
|
|
356
371
|
if (!this.isStarted) {
|
|
357
372
|
return;
|
|
358
373
|
}
|
|
359
374
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 ? void 0 : _this$mutationObserve2.disconnect();
|
|
360
|
-
(_this$
|
|
375
|
+
(_this$intersectionObs11 = this.intersectionObserver) === null || _this$intersectionObs11 === void 0 ? void 0 : _this$intersectionObs11.disconnect();
|
|
361
376
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 ? void 0 : _this$performanceObse2.disconnect();
|
|
362
377
|
this.isStarted = false;
|
|
363
378
|
// Clean up caches when stopping
|
|
@@ -72,7 +72,7 @@ function _createInteractionExtraLogPayload() {
|
|
|
72
72
|
var revision = _ref.revision;
|
|
73
73
|
return revision === DEFAULT_TTVC_REVISION;
|
|
74
74
|
});
|
|
75
|
-
if (!(!(effectiveVCRevisionPayload !== null && effectiveVCRevisionPayload !== void 0 && effectiveVCRevisionPayload.clean) || (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) === undefined)) {
|
|
75
|
+
if (!(!(effectiveVCRevisionPayload !== null && effectiveVCRevisionPayload !== void 0 && effectiveVCRevisionPayload.clean) || (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) === undefined || typeof (effectiveVCRevisionPayload === null || effectiveVCRevisionPayload === void 0 ? void 0 : effectiveVCRevisionPayload['metric:vc90']) !== 'number' || extraTTAI === undefined || typeof extraTTAI !== 'number' || interaction.errors.length > 0)) {
|
|
76
76
|
_context.next = 23;
|
|
77
77
|
break;
|
|
78
78
|
}
|
package/dist/esm/vc/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export var VCObserverWrapper = /*#__PURE__*/function () {
|
|
|
25
25
|
this.ssrPlaceholderHandler = new SSRPlaceholderHandlers({
|
|
26
26
|
enablePageLayoutPlaceholder: (_opts$ssrEnablePageLa = opts.ssrEnablePageLayoutPlaceholder) !== null && _opts$ssrEnablePageLa !== void 0 ? _opts$ssrEnablePageLa : false
|
|
27
27
|
});
|
|
28
|
-
if (isVCRevisionEnabled('fy25.03')) {
|
|
28
|
+
if (isVCRevisionEnabled('fy25.03') || isVCRevisionEnabled('next')) {
|
|
29
29
|
var _opts$ssrEnablePageLa2;
|
|
30
30
|
this.newVCObserver = new VCObserverNew({
|
|
31
31
|
selectorConfig: opts.selectorConfig,
|
|
@@ -12,6 +12,7 @@ import _getElementName from './get-element-name';
|
|
|
12
12
|
import VCCalculator_FY25_03 from './metric-calculator/fy25_03';
|
|
13
13
|
import getViewportHeight from './metric-calculator/utils/get-viewport-height';
|
|
14
14
|
import getViewportWidth from './metric-calculator/utils/get-viewport-width';
|
|
15
|
+
import VCNextCalculator from './metric-calculator/vcnext';
|
|
15
16
|
import ViewportObserver from './viewport-observer';
|
|
16
17
|
import WindowEventObserver from './window-event-observer';
|
|
17
18
|
var SSRState = {
|
|
@@ -230,7 +231,7 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
230
231
|
key: "getVCResult",
|
|
231
232
|
value: function () {
|
|
232
233
|
var _getVCResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
|
|
233
|
-
var start, stop, interactionId, include3p, results, calculator_fy25_03, orderedEntries, fy25_03;
|
|
234
|
+
var start, stop, interactionId, include3p, results, calculator_fy25_03, orderedEntries, fy25_03, calculator_next, vcNext;
|
|
234
235
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
235
236
|
while (1) switch (_context.prev = _context.next) {
|
|
236
237
|
case 0:
|
|
@@ -259,8 +260,30 @@ var VCObserverNew = /*#__PURE__*/function () {
|
|
|
259
260
|
if (fy25_03) {
|
|
260
261
|
results.push(fy25_03);
|
|
261
262
|
}
|
|
263
|
+
|
|
264
|
+
// TODO on cleanup: put behind `enabledVCRevisions` config
|
|
265
|
+
if (!fg('platform_ufo_vcnext_v4_enabled')) {
|
|
266
|
+
_context.next = 16;
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
calculator_next = new VCNextCalculator();
|
|
270
|
+
_context.next = 14;
|
|
271
|
+
return calculator_next.calculate({
|
|
272
|
+
orderedEntries: orderedEntries,
|
|
273
|
+
startTime: start,
|
|
274
|
+
stopTime: stop,
|
|
275
|
+
interactionId: interactionId,
|
|
276
|
+
isPostInteraction: this.isPostInteraction,
|
|
277
|
+
include3p: include3p
|
|
278
|
+
});
|
|
279
|
+
case 14:
|
|
280
|
+
vcNext = _context.sent;
|
|
281
|
+
if (vcNext) {
|
|
282
|
+
results.push(vcNext);
|
|
283
|
+
}
|
|
284
|
+
case 16:
|
|
262
285
|
return _context.abrupt("return", results);
|
|
263
|
-
case
|
|
286
|
+
case 17:
|
|
264
287
|
case "end":
|
|
265
288
|
return _context.stop();
|
|
266
289
|
}
|
|
@@ -37,9 +37,9 @@ export var THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES = ['bis_skin_checked', 'cz-s
|
|
|
37
37
|
// grammarly extensions
|
|
38
38
|
'data-new-gr-c-s-loaded', 'data-gr-aaa-notch-connection-id', 'data-gr-aaa-loaded'];
|
|
39
39
|
var VCCalculator_FY25_03 = /*#__PURE__*/function (_AbstractVCCalculator) {
|
|
40
|
-
function VCCalculator_FY25_03() {
|
|
40
|
+
function VCCalculator_FY25_03(revisionNo) {
|
|
41
41
|
_classCallCheck(this, VCCalculator_FY25_03);
|
|
42
|
-
return _callSuper(this, VCCalculator_FY25_03, [REVISION_NO]);
|
|
42
|
+
return _callSuper(this, VCCalculator_FY25_03, [revisionNo !== null && revisionNo !== void 0 ? revisionNo : REVISION_NO]);
|
|
43
43
|
}
|
|
44
44
|
_inherits(VCCalculator_FY25_03, _AbstractVCCalculator);
|
|
45
45
|
return _createClass(VCCalculator_FY25_03, [{
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _get from "@babel/runtime/helpers/get";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
+
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
|
|
10
|
+
import VCCalculator_FY25_03 from '../fy25_03';
|
|
11
|
+
|
|
12
|
+
// NOTE: `next` to be renamed `fy26.04` once stable
|
|
13
|
+
var REVISION_NO = 'next';
|
|
14
|
+
var getConsideredEntryTypes = function getConsideredEntryTypes() {
|
|
15
|
+
return ['mutation:display-contents-children-element'];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// NOTE: `VCNext` to be renamed `FY26_04` once stable
|
|
19
|
+
var VCNextCalculator = /*#__PURE__*/function (_VCCalculator_FY25_) {
|
|
20
|
+
function VCNextCalculator() {
|
|
21
|
+
_classCallCheck(this, VCNextCalculator);
|
|
22
|
+
return _callSuper(this, VCNextCalculator, [REVISION_NO]);
|
|
23
|
+
}
|
|
24
|
+
_inherits(VCNextCalculator, _VCCalculator_FY25_);
|
|
25
|
+
return _createClass(VCNextCalculator, [{
|
|
26
|
+
key: "isEntryIncluded",
|
|
27
|
+
value: function isEntryIncluded(entry, include3p) {
|
|
28
|
+
var isEntryIncludedInV3 = _superPropGet(VCNextCalculator, "isEntryIncluded", this, 3)([entry, include3p]);
|
|
29
|
+
if (isEntryIncludedInV3) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
return getConsideredEntryTypes().includes(entry.data.type);
|
|
33
|
+
}
|
|
34
|
+
}]);
|
|
35
|
+
}(VCCalculator_FY25_03);
|
|
36
|
+
export { VCNextCalculator as default };
|
|
@@ -117,7 +117,7 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
117
117
|
_iterator = _createForOfIteratorHelper(addedNodes);
|
|
118
118
|
_context2.prev = 4;
|
|
119
119
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
120
|
-
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,
|
|
120
|
+
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, _window, _iterator2, _step2, child, _this$intersectionObs8, _this$intersectionObs9, validTargets, _iterator3, _step3, _this$intersectionObs0, validTarget, _this$intersectionObs1;
|
|
121
121
|
return _regeneratorRuntime.wrap(function _loop$(_context) {
|
|
122
122
|
while (1) switch (_context.prev = _context.next) {
|
|
123
123
|
case 0:
|
|
@@ -229,25 +229,45 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
229
229
|
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
230
230
|
return _context.abrupt("return", 0);
|
|
231
231
|
case 45:
|
|
232
|
-
if (fg('
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
232
|
+
if (fg('platform_ufo_vcnext_v4_enabled')) {
|
|
233
|
+
if (((_window = window) === null || _window === void 0 || (_window = _window.getComputedStyle(addedNode)) === null || _window === void 0 ? void 0 : _window.display) === 'contents') {
|
|
234
|
+
_iterator2 = _createForOfIteratorHelper(addedNode.children);
|
|
235
|
+
try {
|
|
236
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
237
|
+
child = _step2.value;
|
|
238
|
+
if (child instanceof HTMLElement) {
|
|
239
|
+
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(child, 'mutation:display-contents-children-element');
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
} catch (err) {
|
|
243
|
+
_iterator2.e(err);
|
|
244
|
+
} finally {
|
|
245
|
+
_iterator2.f();
|
|
240
246
|
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
} finally {
|
|
244
|
-
_iterator2.f();
|
|
247
|
+
} else {
|
|
248
|
+
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
245
249
|
}
|
|
246
250
|
} else {
|
|
247
|
-
if (fg('
|
|
248
|
-
|
|
251
|
+
if (fg('platform_ufo_display_content_resolution_ttvc_v3')) {
|
|
252
|
+
// Check if the target has display:content css property, return array of valid targets
|
|
253
|
+
validTargets = checkCssProperty(addedNode);
|
|
254
|
+
_iterator3 = _createForOfIteratorHelper(validTargets);
|
|
255
|
+
try {
|
|
256
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
257
|
+
validTarget = _step3.value;
|
|
258
|
+
(_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
|
|
259
|
+
}
|
|
260
|
+
} catch (err) {
|
|
261
|
+
_iterator3.e(err);
|
|
262
|
+
} finally {
|
|
263
|
+
_iterator3.f();
|
|
264
|
+
}
|
|
265
|
+
} else {
|
|
266
|
+
if (fg('platform_ufo_display_content_track_occurrence')) {
|
|
267
|
+
trackDisplayContentsOccurrence(addedNode);
|
|
268
|
+
}
|
|
269
|
+
(_this$intersectionObs1 = _this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
249
270
|
}
|
|
250
|
-
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
251
271
|
}
|
|
252
272
|
case 46:
|
|
253
273
|
case "end":
|
|
@@ -294,12 +314,12 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
294
314
|
};
|
|
295
315
|
}());
|
|
296
316
|
_defineProperty(this, "handleAttributeMutation", function (_ref6) {
|
|
297
|
-
var _this$
|
|
317
|
+
var _this$intersectionObs10;
|
|
298
318
|
var target = _ref6.target,
|
|
299
319
|
attributeName = _ref6.attributeName,
|
|
300
320
|
oldValue = _ref6.oldValue,
|
|
301
321
|
newValue = _ref6.newValue;
|
|
302
|
-
(_this$
|
|
322
|
+
(_this$intersectionObs10 = _this.intersectionObserver) === null || _this$intersectionObs10 === void 0 || _this$intersectionObs10.watchAndTag(target, function (_ref7) {
|
|
303
323
|
var target = _ref7.target,
|
|
304
324
|
rect = _ref7.rect;
|
|
305
325
|
if (isContainedWithinMediaWrapper(target)) {
|
|
@@ -377,11 +397,11 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
377
397
|
_defineProperty(this, "handleLayoutShift", function (_ref8) {
|
|
378
398
|
var time = _ref8.time,
|
|
379
399
|
changedRects = _ref8.changedRects;
|
|
380
|
-
var
|
|
381
|
-
|
|
400
|
+
var _iterator4 = _createForOfIteratorHelper(changedRects),
|
|
401
|
+
_step4;
|
|
382
402
|
try {
|
|
383
|
-
for (
|
|
384
|
-
var changedRect =
|
|
403
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
404
|
+
var changedRect = _step4.value;
|
|
385
405
|
var target = changedRect.node;
|
|
386
406
|
if (target) {
|
|
387
407
|
_this.onChange({
|
|
@@ -395,9 +415,9 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
395
415
|
}
|
|
396
416
|
}
|
|
397
417
|
} catch (err) {
|
|
398
|
-
|
|
418
|
+
_iterator4.e(err);
|
|
399
419
|
} finally {
|
|
400
|
-
|
|
420
|
+
_iterator4.f();
|
|
401
421
|
}
|
|
402
422
|
});
|
|
403
423
|
this.mapVisibleNodeRects = new WeakMap();
|
|
@@ -454,12 +474,12 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
454
474
|
}, {
|
|
455
475
|
key: "stop",
|
|
456
476
|
value: function stop() {
|
|
457
|
-
var _this$mutationObserve2, _this$
|
|
477
|
+
var _this$mutationObserve2, _this$intersectionObs11, _this$performanceObse2;
|
|
458
478
|
if (!this.isStarted) {
|
|
459
479
|
return;
|
|
460
480
|
}
|
|
461
481
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
|
|
462
|
-
(_this$
|
|
482
|
+
(_this$intersectionObs11 = this.intersectionObserver) === null || _this$intersectionObs11 === void 0 || _this$intersectionObs11.disconnect();
|
|
463
483
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
|
|
464
484
|
this.isStarted = false;
|
|
465
485
|
// Clean up caches when stopping
|
|
@@ -35,7 +35,7 @@ type SegmentThreshold = {
|
|
|
35
35
|
type Rates = {
|
|
36
36
|
readonly [key: string]: number;
|
|
37
37
|
};
|
|
38
|
-
export type TTVCRevision = 'fy25.01' | 'fy25.02' | 'fy25.03';
|
|
38
|
+
export type TTVCRevision = 'fy25.01' | 'fy25.02' | 'fy25.03' | 'next';
|
|
39
39
|
export declare const DEFAULT_TTVC_REVISION = "fy25.03";
|
|
40
40
|
export declare const UNKNOWN_INTERACTION_RATE = 1000;
|
|
41
41
|
export type ReactHydrationStats = {
|
|
@@ -91,7 +91,7 @@ declare function createInteractionExtraLogPayload(interactionId: string, interac
|
|
|
91
91
|
abortedByInteractionName: string | undefined;
|
|
92
92
|
end: number;
|
|
93
93
|
start: number;
|
|
94
|
-
'metric:ttai:3p': number
|
|
94
|
+
'metric:ttai:3p': number;
|
|
95
95
|
};
|
|
96
96
|
'vc:effective:revision': string;
|
|
97
97
|
};
|
|
@@ -4,7 +4,7 @@ export declare const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS: string[
|
|
|
4
4
|
export declare const NON_VISUAL_ARIA_ATTRIBUTES: string[];
|
|
5
5
|
export declare const THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES: string[];
|
|
6
6
|
export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
7
|
-
constructor();
|
|
7
|
+
constructor(revisionNo?: string);
|
|
8
8
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
|
|
9
9
|
protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
|
|
10
10
|
isVCClean: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VCObserverEntry } from '../../types';
|
|
2
|
+
import VCCalculator_FY25_03 from '../fy25_03';
|
|
3
|
+
export default class VCNextCalculator extends VCCalculator_FY25_03 {
|
|
4
|
+
constructor();
|
|
5
|
+
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
|
|
6
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ObservedWindowEvent } from './window-event-observer';
|
|
2
|
-
export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'window:event' | 'ssr-hydration' | 'unknown';
|
|
2
|
+
export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'window:event' | 'ssr-hydration' | 'unknown';
|
|
3
3
|
export type ViewportEntryData = {
|
|
4
4
|
readonly type: VCObserverEntryType;
|
|
5
5
|
readonly elementName: string;
|
|
@@ -35,7 +35,7 @@ type SegmentThreshold = {
|
|
|
35
35
|
type Rates = {
|
|
36
36
|
readonly [key: string]: number;
|
|
37
37
|
};
|
|
38
|
-
export type TTVCRevision = 'fy25.01' | 'fy25.02' | 'fy25.03';
|
|
38
|
+
export type TTVCRevision = 'fy25.01' | 'fy25.02' | 'fy25.03' | 'next';
|
|
39
39
|
export declare const DEFAULT_TTVC_REVISION = "fy25.03";
|
|
40
40
|
export declare const UNKNOWN_INTERACTION_RATE = 1000;
|
|
41
41
|
export type ReactHydrationStats = {
|
|
@@ -91,7 +91,7 @@ declare function createInteractionExtraLogPayload(interactionId: string, interac
|
|
|
91
91
|
abortedByInteractionName: string | undefined;
|
|
92
92
|
end: number;
|
|
93
93
|
start: number;
|
|
94
|
-
'metric:ttai:3p': number
|
|
94
|
+
'metric:ttai:3p': number;
|
|
95
95
|
};
|
|
96
96
|
'vc:effective:revision': string;
|
|
97
97
|
};
|
|
@@ -4,7 +4,7 @@ export declare const KNOWN_ATTRIBUTES_THAT_DOES_NOT_CAUSE_LAYOUT_SHIFTS: string[
|
|
|
4
4
|
export declare const NON_VISUAL_ARIA_ATTRIBUTES: string[];
|
|
5
5
|
export declare const THIRD_PARTY_BROWSER_EXTENSION_ATTRIBUTES: string[];
|
|
6
6
|
export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
7
|
-
constructor();
|
|
7
|
+
constructor(revisionNo?: string);
|
|
8
8
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
|
|
9
9
|
protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
|
|
10
10
|
isVCClean: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VCObserverEntry } from '../../types';
|
|
2
|
+
import VCCalculator_FY25_03 from '../fy25_03';
|
|
3
|
+
export default class VCNextCalculator extends VCCalculator_FY25_03 {
|
|
4
|
+
constructor();
|
|
5
|
+
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
|
|
6
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ObservedWindowEvent } from './window-event-observer';
|
|
2
|
-
export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'window:event' | 'ssr-hydration' | 'unknown';
|
|
2
|
+
export type VCObserverEntryType = 'mutation:child-element' | 'mutation:remount' | 'mutation:element' | 'mutation:element-replacement' | 'mutation:display-contents-children-element' | 'mutation:attribute:no-layout-shift' | 'mutation:attribute:non-visual-style' | 'mutation:attribute' | 'mutation:media' | 'mutation:rll-placeholder' | 'mutation:third-party-element' | 'mutation:ssr-placeholder' | 'layout-shift' | 'window:event' | 'ssr-hydration' | 'unknown';
|
|
3
3
|
export type ViewportEntryData = {
|
|
4
4
|
readonly type: VCObserverEntryType;
|
|
5
5
|
readonly elementName: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -84,6 +84,9 @@
|
|
|
84
84
|
"platform_ufo_canvas_heatmap_full_precision": {
|
|
85
85
|
"type": "boolean"
|
|
86
86
|
},
|
|
87
|
+
"platform_ufo_vcnext_v4_enabled": {
|
|
88
|
+
"type": "boolean"
|
|
89
|
+
},
|
|
87
90
|
"platform_ufo_enable_minor_interactions": {
|
|
88
91
|
"type": "boolean"
|
|
89
92
|
},
|