@atlaskit/react-ufo 4.7.1 → 4.7.3
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 +20 -0
- package/dist/cjs/create-interaction-extra-metrics-payload/index.js +21 -10
- package/dist/cjs/interaction-metrics/index.js +0 -31
- package/dist/cjs/vc/vc-observer/index.js +6 -27
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
- package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +7 -10
- package/dist/cjs/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -10
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +30 -48
- package/dist/es2019/create-interaction-extra-metrics-payload/index.js +12 -4
- package/dist/es2019/interaction-metrics/index.js +0 -31
- package/dist/es2019/vc/vc-observer/index.js +18 -42
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
- package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +10 -16
- package/dist/es2019/vc/vc-observer-new/metric-calculator/fy25_03/index.js +2 -6
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +20 -29
- package/dist/esm/create-interaction-extra-metrics-payload/index.js +22 -11
- package/dist/esm/interaction-metrics/index.js +0 -31
- package/dist/esm/vc/vc-observer/index.js +6 -27
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +2 -2
- package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +7 -10
- package/dist/esm/vc/vc-observer-new/metric-calculator/fy25_03/index.js +4 -10
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +30 -48
- 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 +3 -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 +3 -1
- package/package.json +1 -11
|
@@ -116,7 +116,7 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
116
116
|
_iterator = _createForOfIteratorHelper(addedNodes);
|
|
117
117
|
_context2.prev = 4;
|
|
118
118
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
119
|
-
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4,
|
|
119
|
+
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, validTargets, _iterator2, _step2, _this$intersectionObs8, validTarget, _this$intersectionObs9;
|
|
120
120
|
return _regeneratorRuntime.wrap(function _loop$(_context) {
|
|
121
121
|
while (1) switch (_context.prev = _context.next) {
|
|
122
122
|
case 0:
|
|
@@ -164,58 +164,40 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
164
164
|
ssrState.state = SSRStateEnum.normal;
|
|
165
165
|
case 19:
|
|
166
166
|
if (!_this.getSSRPlaceholderHandler) {
|
|
167
|
-
_context.next =
|
|
167
|
+
_context.next = 33;
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
170
|
ssrPlaceholderHandler = _this.getSSRPlaceholderHandler();
|
|
171
171
|
if (!ssrPlaceholderHandler) {
|
|
172
|
-
_context.next =
|
|
172
|
+
_context.next = 33;
|
|
173
173
|
break;
|
|
174
174
|
}
|
|
175
175
|
if (!(ssrPlaceholderHandler.isPlaceholder(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode))) {
|
|
176
|
-
_context.next =
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
if (!fg('platform_ufo_ssr_placeholder_resolution_ttvc_v3')) {
|
|
180
|
-
_context.next = 29;
|
|
176
|
+
_context.next = 26;
|
|
181
177
|
break;
|
|
182
178
|
}
|
|
183
179
|
if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(addedNode)) {
|
|
184
|
-
_context.next =
|
|
180
|
+
_context.next = 26;
|
|
185
181
|
break;
|
|
186
182
|
}
|
|
187
183
|
(_this$intersectionObs3 = _this.intersectionObserver) === null || _this$intersectionObs3 === void 0 || _this$intersectionObs3.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
188
184
|
return _context.abrupt("return", 0);
|
|
189
|
-
case
|
|
190
|
-
_context.next = 35;
|
|
191
|
-
break;
|
|
192
|
-
case 29:
|
|
193
|
-
_context.next = 31;
|
|
194
|
-
return ssrPlaceholderHandler.checkIfExistedAndSizeMatching(addedNode);
|
|
195
|
-
case 31:
|
|
196
|
-
result = _context.sent;
|
|
197
|
-
if (!(result !== false)) {
|
|
198
|
-
_context.next = 35;
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
(_this$intersectionObs4 = _this.intersectionObserver) === null || _this$intersectionObs4 === void 0 || _this$intersectionObs4.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
202
|
-
return _context.abrupt("return", 0);
|
|
203
|
-
case 35:
|
|
185
|
+
case 26:
|
|
204
186
|
if (!(ssrPlaceholderHandler.isPlaceholderReplacement(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode))) {
|
|
205
|
-
_context.next =
|
|
187
|
+
_context.next = 33;
|
|
206
188
|
break;
|
|
207
189
|
}
|
|
208
|
-
_context.next =
|
|
190
|
+
_context.next = 29;
|
|
209
191
|
return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(addedNode);
|
|
210
|
-
case
|
|
211
|
-
|
|
212
|
-
if (!(
|
|
213
|
-
_context.next =
|
|
192
|
+
case 29:
|
|
193
|
+
result = _context.sent;
|
|
194
|
+
if (!(result !== false)) {
|
|
195
|
+
_context.next = 33;
|
|
214
196
|
break;
|
|
215
197
|
}
|
|
216
|
-
(_this$
|
|
198
|
+
(_this$intersectionObs4 = _this.intersectionObserver) === null || _this$intersectionObs4 === void 0 || _this$intersectionObs4.watchAndTag(addedNode, 'mutation:ssr-placeholder');
|
|
217
199
|
return _context.abrupt("return", 0);
|
|
218
|
-
case
|
|
200
|
+
case 33:
|
|
219
201
|
sameDeletedNode = removedNodes.find(function (ref) {
|
|
220
202
|
var n = ref.deref();
|
|
221
203
|
if (!n || !addedNode) {
|
|
@@ -225,27 +207,27 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
225
207
|
});
|
|
226
208
|
isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(addedNode);
|
|
227
209
|
if (!(sameDeletedNode && isInIgnoreLsMarker)) {
|
|
228
|
-
_context.next =
|
|
210
|
+
_context.next = 38;
|
|
229
211
|
break;
|
|
230
212
|
}
|
|
231
|
-
(_this$
|
|
213
|
+
(_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
|
|
232
214
|
return _context.abrupt("return", 0);
|
|
233
|
-
case
|
|
215
|
+
case 38:
|
|
234
216
|
if (!isContainedWithinMediaWrapper(addedNode)) {
|
|
235
|
-
_context.next =
|
|
217
|
+
_context.next = 41;
|
|
236
218
|
break;
|
|
237
219
|
}
|
|
238
|
-
(_this$
|
|
220
|
+
(_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(addedNode, 'mutation:media');
|
|
239
221
|
return _context.abrupt("return", 0);
|
|
240
|
-
case
|
|
222
|
+
case 41:
|
|
241
223
|
_checkWithinComponent = checkWithinComponent(addedNode, 'UFOThirdPartySegment', _this.mapIs3pResult), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
|
|
242
224
|
if (!isWithinThirdPartySegment) {
|
|
243
|
-
_context.next =
|
|
225
|
+
_context.next = 45;
|
|
244
226
|
break;
|
|
245
227
|
}
|
|
246
|
-
(_this$
|
|
228
|
+
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
247
229
|
return _context.abrupt("return", 0);
|
|
248
|
-
case
|
|
230
|
+
case 45:
|
|
249
231
|
if (fg('platform_ufo_display_content_resolution_ttvc_v3')) {
|
|
250
232
|
// Check if the target has display:content css property, return array of valid targets
|
|
251
233
|
validTargets = checkCssProperty(addedNode);
|
|
@@ -253,7 +235,7 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
253
235
|
try {
|
|
254
236
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
255
237
|
validTarget = _step2.value;
|
|
256
|
-
(_this$
|
|
238
|
+
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(validTarget, createElementMutationsWatcher(removedNodeRects));
|
|
257
239
|
}
|
|
258
240
|
} catch (err) {
|
|
259
241
|
_iterator2.e(err);
|
|
@@ -264,9 +246,9 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
264
246
|
if (fg('platform_ufo_display_content_track_occurrence')) {
|
|
265
247
|
trackDisplayContentsOccurrence(addedNode);
|
|
266
248
|
}
|
|
267
|
-
(_this$
|
|
249
|
+
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
268
250
|
}
|
|
269
|
-
case
|
|
251
|
+
case 46:
|
|
270
252
|
case "end":
|
|
271
253
|
return _context.stop();
|
|
272
254
|
}
|
|
@@ -311,12 +293,12 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
311
293
|
};
|
|
312
294
|
}());
|
|
313
295
|
_defineProperty(this, "handleAttributeMutation", function (_ref6) {
|
|
314
|
-
var _this$
|
|
296
|
+
var _this$intersectionObs0;
|
|
315
297
|
var target = _ref6.target,
|
|
316
298
|
attributeName = _ref6.attributeName,
|
|
317
299
|
oldValue = _ref6.oldValue,
|
|
318
300
|
newValue = _ref6.newValue;
|
|
319
|
-
(_this$
|
|
301
|
+
(_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(target, function (_ref7) {
|
|
320
302
|
var target = _ref7.target,
|
|
321
303
|
rect = _ref7.rect;
|
|
322
304
|
if (isContainedWithinMediaWrapper(target)) {
|
|
@@ -456,12 +438,12 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
456
438
|
}, {
|
|
457
439
|
key: "stop",
|
|
458
440
|
value: function stop() {
|
|
459
|
-
var _this$mutationObserve2, _this$
|
|
441
|
+
var _this$mutationObserve2, _this$intersectionObs1, _this$performanceObse2;
|
|
460
442
|
if (!this.isStarted) {
|
|
461
443
|
return;
|
|
462
444
|
}
|
|
463
445
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
|
|
464
|
-
(_this$
|
|
446
|
+
(_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.disconnect();
|
|
465
447
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
|
|
466
448
|
this.isStarted = false;
|
|
467
449
|
// Clean up caches when stopping
|
|
@@ -93,7 +93,7 @@ declare function createInteractionExtraLogPayload(interactionId: string, interac
|
|
|
93
93
|
start: number;
|
|
94
94
|
'metric:ttai:3p': number | undefined;
|
|
95
95
|
};
|
|
96
|
-
'vc:effective:revision':
|
|
96
|
+
'vc:effective:revision': string;
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
} | null>;
|
|
@@ -7,10 +7,12 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
|
7
7
|
constructor();
|
|
8
8
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
|
|
9
9
|
protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
|
|
10
|
-
abortTimestamp?: number | undefined;
|
|
11
10
|
isVCClean: boolean;
|
|
12
11
|
dirtyReason: never;
|
|
12
|
+
abortTimestamp: number;
|
|
13
13
|
} | {
|
|
14
14
|
isVCClean: boolean;
|
|
15
|
+
dirtyReason?: undefined;
|
|
16
|
+
abortTimestamp?: undefined;
|
|
15
17
|
};
|
|
16
18
|
}
|
|
@@ -93,7 +93,7 @@ declare function createInteractionExtraLogPayload(interactionId: string, interac
|
|
|
93
93
|
start: number;
|
|
94
94
|
'metric:ttai:3p': number | undefined;
|
|
95
95
|
};
|
|
96
|
-
'vc:effective:revision':
|
|
96
|
+
'vc:effective:revision': string;
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
} | null>;
|
|
@@ -7,10 +7,12 @@ export default class VCCalculator_FY25_03 extends AbstractVCCalculatorBase {
|
|
|
7
7
|
constructor();
|
|
8
8
|
protected isEntryIncluded(entry: VCObserverEntry, include3p?: boolean): boolean;
|
|
9
9
|
protected getVCCleanStatus(filteredEntries: readonly VCObserverEntry[]): {
|
|
10
|
-
abortTimestamp?: number | undefined;
|
|
11
10
|
isVCClean: boolean;
|
|
12
11
|
dirtyReason: never;
|
|
12
|
+
abortTimestamp: number;
|
|
13
13
|
} | {
|
|
14
14
|
isVCClean: boolean;
|
|
15
|
+
dirtyReason?: undefined;
|
|
16
|
+
abortTimestamp?: undefined;
|
|
15
17
|
};
|
|
16
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.3",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"atlaskit:src": "src/index.ts",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@atlaskit/browser-apis": "^0.0.1",
|
|
30
|
-
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
31
30
|
"@atlaskit/interaction-context": "^3.0.0",
|
|
32
31
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
33
32
|
"@babel/runtime": "^7.0.0",
|
|
@@ -99,15 +98,9 @@
|
|
|
99
98
|
"enable_ufo_devtools_api_for_extra_events": {
|
|
100
99
|
"type": "boolean"
|
|
101
100
|
},
|
|
102
|
-
"platform_ufo_abort_timestamp_by_revision": {
|
|
103
|
-
"type": "boolean"
|
|
104
|
-
},
|
|
105
101
|
"ufo_payload_use_idle_callback": {
|
|
106
102
|
"type": "boolean"
|
|
107
103
|
},
|
|
108
|
-
"platform_ufo_serialise_ttvc_v3_debug_data": {
|
|
109
|
-
"type": "boolean"
|
|
110
|
-
},
|
|
111
104
|
"platform_ufo_assets_check_for_nan": {
|
|
112
105
|
"type": "boolean"
|
|
113
106
|
},
|
|
@@ -138,9 +131,6 @@
|
|
|
138
131
|
"platform_ufo_add_segments_count_threshold": {
|
|
139
132
|
"type": "boolean"
|
|
140
133
|
},
|
|
141
|
-
"platform_ufo_ssr_placeholder_resolution_ttvc_v3": {
|
|
142
|
-
"type": "boolean"
|
|
143
|
-
},
|
|
144
134
|
"platform_ufo_display_content_resolution_ttvc_v3": {
|
|
145
135
|
"type": "boolean"
|
|
146
136
|
},
|