@atlaskit/react-ufo 4.14.0 → 4.14.2
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 +2 -2
- package/dist/cjs/interaction-metrics-init/index.js +1 -1
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/index.js +27 -33
- package/dist/cjs/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +2 -12
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +131 -273
- package/dist/es2019/interaction-metrics/index.js +2 -2
- package/dist/es2019/interaction-metrics-init/index.js +1 -1
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/index.js +27 -33
- package/dist/es2019/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +2 -13
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +39 -132
- package/dist/esm/interaction-metrics/index.js +2 -2
- package/dist/esm/interaction-metrics-init/index.js +1 -1
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/index.js +27 -33
- package/dist/esm/vc/vc-observer/observers/ssr-placeholders/ssr-scripts/collectSSRPlaceholderDimensions.js +2 -13
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +129 -271
- package/package.json +1 -10
|
@@ -73,9 +73,9 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
73
73
|
});
|
|
74
74
|
_defineProperty(this, "handleChildListMutation", /*#__PURE__*/function () {
|
|
75
75
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref4) {
|
|
76
|
-
var target, addedNodes, removedNodes, timestamp, removedNodeRects, targetNode, _iterator, _step, _loop, _ret;
|
|
77
|
-
return _regeneratorRuntime.wrap(function _callee$(
|
|
78
|
-
while (1) switch (
|
|
76
|
+
var target, addedNodes, removedNodes, timestamp, removedNodeRects, targetNode, _iterator, _step, addedNodeRef, addedNode, _iterator2, _step2, _loop, _ret;
|
|
77
|
+
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
78
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
79
79
|
case 0:
|
|
80
80
|
target = _ref4.target, addedNodes = _ref4.addedNodes, removedNodes = _ref4.removedNodes, timestamp = _ref4.timestamp;
|
|
81
81
|
removedNodeRects = removedNodes.map(function (ref) {
|
|
@@ -87,179 +87,31 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
87
87
|
});
|
|
88
88
|
targetNode = target.deref();
|
|
89
89
|
_iterator = _createForOfIteratorHelper(addedNodes);
|
|
90
|
-
|
|
90
|
+
_context2.prev = 4;
|
|
91
|
+
_iterator.s();
|
|
92
|
+
case 6:
|
|
93
|
+
if ((_step = _iterator.n()).done) {
|
|
94
|
+
_context2.next = 32;
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
addedNodeRef = _step.value;
|
|
98
|
+
addedNode = addedNodeRef.deref();
|
|
99
|
+
if (addedNode) {
|
|
100
|
+
_context2.next = 11;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
return _context2.abrupt("continue", 30);
|
|
104
|
+
case 11:
|
|
105
|
+
_iterator2 = _createForOfIteratorHelper(getMutatedElements(addedNode));
|
|
106
|
+
_context2.prev = 12;
|
|
91
107
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
92
|
-
var
|
|
93
|
-
return _regeneratorRuntime.wrap(function _loop$(
|
|
94
|
-
while (1) switch (
|
|
108
|
+
var _step2$value, isDisplayContentsElementChildren, element, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _ref6, isWithinThirdPartySegment, _this$intersectionObs7, _this$intersectionObs8, _this$intersectionObs9;
|
|
109
|
+
return _regeneratorRuntime.wrap(function _loop$(_context) {
|
|
110
|
+
while (1) switch (_context.prev = _context.next) {
|
|
95
111
|
case 0:
|
|
96
|
-
|
|
97
|
-
addedNode = addedNodeRef.deref();
|
|
98
|
-
if (addedNode) {
|
|
99
|
-
_context2.next = 4;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
return _context2.abrupt("return", 0);
|
|
103
|
-
case 4:
|
|
104
|
-
if (!fg('platform_ufo_ssr_placeholders_for_display_contents')) {
|
|
105
|
-
_context2.next = 26;
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
_iterator2 = _createForOfIteratorHelper(getMutatedElements(addedNode));
|
|
109
|
-
_context2.prev = 6;
|
|
110
|
-
_loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
|
|
111
|
-
var _step2$value, isDisplayContentsElementChildren, element, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, _this$intersectionObs3, result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _ref6, isWithinThirdPartySegment, _this$intersectionObs7, _this$intersectionObs8, _this$intersectionObs9;
|
|
112
|
-
return _regeneratorRuntime.wrap(function _loop2$(_context) {
|
|
113
|
-
while (1) switch (_context.prev = _context.next) {
|
|
114
|
-
case 0:
|
|
115
|
-
_step2$value = _step2.value, isDisplayContentsElementChildren = _step2$value.isDisplayContentsElementChildren, element = _step2$value.element;
|
|
116
|
-
if (!_this.getSSRState) {
|
|
117
|
-
_context.next = 16;
|
|
118
|
-
break;
|
|
119
|
-
}
|
|
120
|
-
ssrState = _this.getSSRState();
|
|
121
|
-
SSRStateEnum = {
|
|
122
|
-
normal: 1,
|
|
123
|
-
waitingForFirstRender: 2,
|
|
124
|
-
ignoring: 3
|
|
125
|
-
};
|
|
126
|
-
if (!(ssrState.state === SSRStateEnum.waitingForFirstRender && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
|
|
127
|
-
_context.next = 9;
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
ssrState.state = SSRStateEnum.ignoring;
|
|
131
|
-
if (ssrState.renderStop === -1) {
|
|
132
|
-
// arbitrary 500ms DOM update window
|
|
133
|
-
ssrState.renderStop = timestamp + 500;
|
|
134
|
-
}
|
|
135
|
-
(_this$intersectionObs = _this.intersectionObserver) === null || _this$intersectionObs === void 0 || _this$intersectionObs.watchAndTag(element, 'ssr-hydration');
|
|
136
|
-
return _context.abrupt("return", 0);
|
|
137
|
-
case 9:
|
|
138
|
-
if (!(ssrState.state === SSRStateEnum.ignoring && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
|
|
139
|
-
_context.next = 16;
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
if (!(timestamp <= ssrState.renderStop)) {
|
|
143
|
-
_context.next = 15;
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
(_this$intersectionObs2 = _this.intersectionObserver) === null || _this$intersectionObs2 === void 0 || _this$intersectionObs2.watchAndTag(element, 'ssr-hydration');
|
|
147
|
-
return _context.abrupt("return", 0);
|
|
148
|
-
case 15:
|
|
149
|
-
ssrState.state = SSRStateEnum.normal;
|
|
150
|
-
case 16:
|
|
151
|
-
if (!_this.getSSRPlaceholderHandler) {
|
|
152
|
-
_context.next = 30;
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
ssrPlaceholderHandler = _this.getSSRPlaceholderHandler();
|
|
156
|
-
if (!ssrPlaceholderHandler) {
|
|
157
|
-
_context.next = 30;
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
if (!(ssrPlaceholderHandler.isPlaceholder(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
|
|
161
|
-
_context.next = 23;
|
|
162
|
-
break;
|
|
163
|
-
}
|
|
164
|
-
if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(element)) {
|
|
165
|
-
_context.next = 23;
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
(_this$intersectionObs3 = _this.intersectionObserver) === null || _this$intersectionObs3 === void 0 || _this$intersectionObs3.watchAndTag(element, 'mutation:ssr-placeholder');
|
|
169
|
-
return _context.abrupt("return", 0);
|
|
170
|
-
case 23:
|
|
171
|
-
if (!(ssrPlaceholderHandler.isPlaceholderReplacement(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
|
|
172
|
-
_context.next = 30;
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
_context.next = 26;
|
|
176
|
-
return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(element);
|
|
177
|
-
case 26:
|
|
178
|
-
result = _context.sent;
|
|
179
|
-
if (!(result !== false)) {
|
|
180
|
-
_context.next = 30;
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
(_this$intersectionObs4 = _this.intersectionObserver) === null || _this$intersectionObs4 === void 0 || _this$intersectionObs4.watchAndTag(element, 'mutation:ssr-placeholder');
|
|
184
|
-
return _context.abrupt("return", 0);
|
|
185
|
-
case 30:
|
|
186
|
-
sameDeletedNode = removedNodes.find(function (ref) {
|
|
187
|
-
var n = ref.deref();
|
|
188
|
-
if (!n || !element) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
return n.isEqualNode(element);
|
|
192
|
-
});
|
|
193
|
-
isInIgnoreLsMarker = element instanceof HTMLElement ? isInVCIgnoreIfNoLayoutShiftMarker(element) : false;
|
|
194
|
-
if (!(sameDeletedNode && isInIgnoreLsMarker)) {
|
|
195
|
-
_context.next = 35;
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
(_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(element, 'mutation:remount');
|
|
199
|
-
return _context.abrupt("return", 0);
|
|
200
|
-
case 35:
|
|
201
|
-
if (!isContainedWithinMediaWrapper(element)) {
|
|
202
|
-
_context.next = 38;
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
(_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(element, 'mutation:media');
|
|
206
|
-
return _context.abrupt("return", 0);
|
|
207
|
-
case 38:
|
|
208
|
-
_ref6 = element instanceof HTMLElement ? checkWithinComponent(element, 'UFOThirdPartySegment', _this.mapIs3pResult) : {
|
|
209
|
-
isWithin: false
|
|
210
|
-
}, isWithinThirdPartySegment = _ref6.isWithin;
|
|
211
|
-
if (!isWithinThirdPartySegment) {
|
|
212
|
-
_context.next = 42;
|
|
213
|
-
break;
|
|
214
|
-
}
|
|
215
|
-
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(element, 'mutation:third-party-element');
|
|
216
|
-
return _context.abrupt("return", 0);
|
|
217
|
-
case 42:
|
|
218
|
-
if (isDisplayContentsElementChildren) {
|
|
219
|
-
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(element, 'mutation:display-contents-children-element');
|
|
220
|
-
} else {
|
|
221
|
-
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(element, createElementMutationsWatcher(removedNodeRects));
|
|
222
|
-
}
|
|
223
|
-
case 43:
|
|
224
|
-
case "end":
|
|
225
|
-
return _context.stop();
|
|
226
|
-
}
|
|
227
|
-
}, _loop2);
|
|
228
|
-
});
|
|
229
|
-
_iterator2.s();
|
|
230
|
-
case 9:
|
|
231
|
-
if ((_step2 = _iterator2.n()).done) {
|
|
232
|
-
_context2.next = 16;
|
|
233
|
-
break;
|
|
234
|
-
}
|
|
235
|
-
return _context2.delegateYield(_loop2(), "t0", 11);
|
|
236
|
-
case 11:
|
|
237
|
-
_ret2 = _context2.t0;
|
|
238
|
-
if (!(_ret2 === 0)) {
|
|
239
|
-
_context2.next = 14;
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
return _context2.abrupt("continue", 14);
|
|
243
|
-
case 14:
|
|
244
|
-
_context2.next = 9;
|
|
245
|
-
break;
|
|
246
|
-
case 16:
|
|
247
|
-
_context2.next = 21;
|
|
248
|
-
break;
|
|
249
|
-
case 18:
|
|
250
|
-
_context2.prev = 18;
|
|
251
|
-
_context2.t1 = _context2["catch"](6);
|
|
252
|
-
_iterator2.e(_context2.t1);
|
|
253
|
-
case 21:
|
|
254
|
-
_context2.prev = 21;
|
|
255
|
-
_iterator2.f();
|
|
256
|
-
return _context2.finish(21);
|
|
257
|
-
case 24:
|
|
258
|
-
_context2.next = 69;
|
|
259
|
-
break;
|
|
260
|
-
case 26:
|
|
112
|
+
_step2$value = _step2.value, isDisplayContentsElementChildren = _step2$value.isDisplayContentsElementChildren, element = _step2$value.element;
|
|
261
113
|
if (!_this.getSSRState) {
|
|
262
|
-
|
|
114
|
+
_context.next = 16;
|
|
263
115
|
break;
|
|
264
116
|
}
|
|
265
117
|
ssrState = _this.getSSRState();
|
|
@@ -269,7 +121,7 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
269
121
|
ignoring: 3
|
|
270
122
|
};
|
|
271
123
|
if (!(ssrState.state === SSRStateEnum.waitingForFirstRender && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
|
|
272
|
-
|
|
124
|
+
_context.next = 9;
|
|
273
125
|
break;
|
|
274
126
|
}
|
|
275
127
|
ssrState.state = SSRStateEnum.ignoring;
|
|
@@ -277,153 +129,159 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
277
129
|
// arbitrary 500ms DOM update window
|
|
278
130
|
ssrState.renderStop = timestamp + 500;
|
|
279
131
|
}
|
|
280
|
-
(_this$
|
|
281
|
-
return
|
|
282
|
-
case
|
|
132
|
+
(_this$intersectionObs = _this.intersectionObserver) === null || _this$intersectionObs === void 0 || _this$intersectionObs.watchAndTag(element, 'ssr-hydration');
|
|
133
|
+
return _context.abrupt("return", 0);
|
|
134
|
+
case 9:
|
|
283
135
|
if (!(ssrState.state === SSRStateEnum.ignoring && timestamp > ssrState.renderStart && targetNode === ssrState.reactRootElement)) {
|
|
284
|
-
|
|
136
|
+
_context.next = 16;
|
|
285
137
|
break;
|
|
286
138
|
}
|
|
287
139
|
if (!(timestamp <= ssrState.renderStop)) {
|
|
288
|
-
|
|
140
|
+
_context.next = 15;
|
|
289
141
|
break;
|
|
290
142
|
}
|
|
291
|
-
(_this$
|
|
292
|
-
return
|
|
293
|
-
case
|
|
143
|
+
(_this$intersectionObs2 = _this.intersectionObserver) === null || _this$intersectionObs2 === void 0 || _this$intersectionObs2.watchAndTag(element, 'ssr-hydration');
|
|
144
|
+
return _context.abrupt("return", 0);
|
|
145
|
+
case 15:
|
|
294
146
|
ssrState.state = SSRStateEnum.normal;
|
|
295
|
-
case
|
|
147
|
+
case 16:
|
|
296
148
|
if (!_this.getSSRPlaceholderHandler) {
|
|
297
|
-
|
|
149
|
+
_context.next = 30;
|
|
298
150
|
break;
|
|
299
151
|
}
|
|
300
152
|
ssrPlaceholderHandler = _this.getSSRPlaceholderHandler();
|
|
301
153
|
if (!ssrPlaceholderHandler) {
|
|
302
|
-
|
|
154
|
+
_context.next = 30;
|
|
303
155
|
break;
|
|
304
156
|
}
|
|
305
|
-
if (!(ssrPlaceholderHandler.isPlaceholder(
|
|
306
|
-
|
|
157
|
+
if (!(ssrPlaceholderHandler.isPlaceholder(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
|
|
158
|
+
_context.next = 23;
|
|
307
159
|
break;
|
|
308
160
|
}
|
|
309
|
-
if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(
|
|
310
|
-
|
|
161
|
+
if (!ssrPlaceholderHandler.checkIfExistedAndSizeMatchingV3(element)) {
|
|
162
|
+
_context.next = 23;
|
|
311
163
|
break;
|
|
312
164
|
}
|
|
313
|
-
(_this$
|
|
314
|
-
return
|
|
315
|
-
case
|
|
316
|
-
if (!(ssrPlaceholderHandler.isPlaceholderReplacement(
|
|
317
|
-
|
|
165
|
+
(_this$intersectionObs3 = _this.intersectionObserver) === null || _this$intersectionObs3 === void 0 || _this$intersectionObs3.watchAndTag(element, 'mutation:ssr-placeholder');
|
|
166
|
+
return _context.abrupt("return", 0);
|
|
167
|
+
case 23:
|
|
168
|
+
if (!(ssrPlaceholderHandler.isPlaceholderReplacement(element) || ssrPlaceholderHandler.isPlaceholderIgnored(element))) {
|
|
169
|
+
_context.next = 30;
|
|
318
170
|
break;
|
|
319
171
|
}
|
|
320
|
-
|
|
321
|
-
return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(
|
|
322
|
-
case
|
|
323
|
-
result =
|
|
172
|
+
_context.next = 26;
|
|
173
|
+
return ssrPlaceholderHandler.validateReactComponentMatchToPlaceholder(element);
|
|
174
|
+
case 26:
|
|
175
|
+
result = _context.sent;
|
|
324
176
|
if (!(result !== false)) {
|
|
325
|
-
|
|
177
|
+
_context.next = 30;
|
|
326
178
|
break;
|
|
327
179
|
}
|
|
328
|
-
(_this$
|
|
329
|
-
return
|
|
330
|
-
case
|
|
180
|
+
(_this$intersectionObs4 = _this.intersectionObserver) === null || _this$intersectionObs4 === void 0 || _this$intersectionObs4.watchAndTag(element, 'mutation:ssr-placeholder');
|
|
181
|
+
return _context.abrupt("return", 0);
|
|
182
|
+
case 30:
|
|
331
183
|
sameDeletedNode = removedNodes.find(function (ref) {
|
|
332
184
|
var n = ref.deref();
|
|
333
|
-
if (!n || !
|
|
185
|
+
if (!n || !element) {
|
|
334
186
|
return false;
|
|
335
187
|
}
|
|
336
|
-
return n.isEqualNode(
|
|
188
|
+
return n.isEqualNode(element);
|
|
337
189
|
});
|
|
338
|
-
isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(
|
|
190
|
+
isInIgnoreLsMarker = element instanceof HTMLElement ? isInVCIgnoreIfNoLayoutShiftMarker(element) : false;
|
|
339
191
|
if (!(sameDeletedNode && isInIgnoreLsMarker)) {
|
|
340
|
-
|
|
192
|
+
_context.next = 35;
|
|
341
193
|
break;
|
|
342
194
|
}
|
|
343
|
-
(_this$
|
|
344
|
-
return
|
|
345
|
-
case
|
|
346
|
-
if (!isContainedWithinMediaWrapper(
|
|
347
|
-
|
|
195
|
+
(_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(element, 'mutation:remount');
|
|
196
|
+
return _context.abrupt("return", 0);
|
|
197
|
+
case 35:
|
|
198
|
+
if (!isContainedWithinMediaWrapper(element)) {
|
|
199
|
+
_context.next = 38;
|
|
348
200
|
break;
|
|
349
201
|
}
|
|
350
|
-
(_this$
|
|
351
|
-
return
|
|
352
|
-
case
|
|
353
|
-
|
|
202
|
+
(_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(element, 'mutation:media');
|
|
203
|
+
return _context.abrupt("return", 0);
|
|
204
|
+
case 38:
|
|
205
|
+
_ref6 = element instanceof HTMLElement ? checkWithinComponent(element, 'UFOThirdPartySegment', _this.mapIs3pResult) : {
|
|
206
|
+
isWithin: false
|
|
207
|
+
}, isWithinThirdPartySegment = _ref6.isWithin;
|
|
354
208
|
if (!isWithinThirdPartySegment) {
|
|
355
|
-
|
|
209
|
+
_context.next = 42;
|
|
356
210
|
break;
|
|
357
211
|
}
|
|
358
|
-
(_this$
|
|
359
|
-
return
|
|
360
|
-
case
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
if (isDisplayContentsElementChildren) {
|
|
366
|
-
(_this$intersectionObs15 = _this.intersectionObserver) === null || _this$intersectionObs15 === void 0 || _this$intersectionObs15.watchAndTag(element, 'mutation:display-contents-children-element');
|
|
367
|
-
} else {
|
|
368
|
-
(_this$intersectionObs16 = _this.intersectionObserver) === null || _this$intersectionObs16 === void 0 || _this$intersectionObs16.watchAndTag(element, createElementMutationsWatcher(removedNodeRects));
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
} catch (err) {
|
|
372
|
-
_iterator3.e(err);
|
|
373
|
-
} finally {
|
|
374
|
-
_iterator3.f();
|
|
212
|
+
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(element, 'mutation:third-party-element');
|
|
213
|
+
return _context.abrupt("return", 0);
|
|
214
|
+
case 42:
|
|
215
|
+
if (isDisplayContentsElementChildren) {
|
|
216
|
+
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(element, 'mutation:display-contents-children-element');
|
|
217
|
+
} else {
|
|
218
|
+
(_this$intersectionObs9 = _this.intersectionObserver) === null || _this$intersectionObs9 === void 0 || _this$intersectionObs9.watchAndTag(element, createElementMutationsWatcher(removedNodeRects));
|
|
375
219
|
}
|
|
376
|
-
case
|
|
220
|
+
case 43:
|
|
377
221
|
case "end":
|
|
378
|
-
return
|
|
222
|
+
return _context.stop();
|
|
379
223
|
}
|
|
380
|
-
}, _loop
|
|
224
|
+
}, _loop);
|
|
381
225
|
});
|
|
382
|
-
|
|
383
|
-
case
|
|
384
|
-
if ((
|
|
385
|
-
|
|
226
|
+
_iterator2.s();
|
|
227
|
+
case 15:
|
|
228
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
229
|
+
_context2.next = 22;
|
|
386
230
|
break;
|
|
387
231
|
}
|
|
388
|
-
return
|
|
389
|
-
case
|
|
390
|
-
_ret =
|
|
232
|
+
return _context2.delegateYield(_loop(), "t0", 17);
|
|
233
|
+
case 17:
|
|
234
|
+
_ret = _context2.t0;
|
|
391
235
|
if (!(_ret === 0)) {
|
|
392
|
-
|
|
236
|
+
_context2.next = 20;
|
|
393
237
|
break;
|
|
394
238
|
}
|
|
395
|
-
return
|
|
396
|
-
case
|
|
397
|
-
|
|
239
|
+
return _context2.abrupt("continue", 20);
|
|
240
|
+
case 20:
|
|
241
|
+
_context2.next = 15;
|
|
398
242
|
break;
|
|
399
|
-
case
|
|
400
|
-
|
|
243
|
+
case 22:
|
|
244
|
+
_context2.next = 27;
|
|
401
245
|
break;
|
|
402
|
-
case
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
case
|
|
407
|
-
|
|
246
|
+
case 24:
|
|
247
|
+
_context2.prev = 24;
|
|
248
|
+
_context2.t1 = _context2["catch"](12);
|
|
249
|
+
_iterator2.e(_context2.t1);
|
|
250
|
+
case 27:
|
|
251
|
+
_context2.prev = 27;
|
|
252
|
+
_iterator2.f();
|
|
253
|
+
return _context2.finish(27);
|
|
254
|
+
case 30:
|
|
255
|
+
_context2.next = 6;
|
|
256
|
+
break;
|
|
257
|
+
case 32:
|
|
258
|
+
_context2.next = 37;
|
|
259
|
+
break;
|
|
260
|
+
case 34:
|
|
261
|
+
_context2.prev = 34;
|
|
262
|
+
_context2.t2 = _context2["catch"](4);
|
|
263
|
+
_iterator.e(_context2.t2);
|
|
264
|
+
case 37:
|
|
265
|
+
_context2.prev = 37;
|
|
408
266
|
_iterator.f();
|
|
409
|
-
return
|
|
410
|
-
case
|
|
267
|
+
return _context2.finish(37);
|
|
268
|
+
case 40:
|
|
411
269
|
case "end":
|
|
412
|
-
return
|
|
270
|
+
return _context2.stop();
|
|
413
271
|
}
|
|
414
|
-
}, _callee, null, [[4,
|
|
272
|
+
}, _callee, null, [[4, 34, 37, 40], [12, 24, 27, 30]]);
|
|
415
273
|
}));
|
|
416
274
|
return function (_x) {
|
|
417
275
|
return _ref5.apply(this, arguments);
|
|
418
276
|
};
|
|
419
277
|
}());
|
|
420
278
|
_defineProperty(this, "handleAttributeMutation", function (_ref7) {
|
|
421
|
-
var _this$
|
|
279
|
+
var _this$intersectionObs0;
|
|
422
280
|
var target = _ref7.target,
|
|
423
281
|
attributeName = _ref7.attributeName,
|
|
424
282
|
oldValue = _ref7.oldValue,
|
|
425
283
|
newValue = _ref7.newValue;
|
|
426
|
-
(_this$
|
|
284
|
+
(_this$intersectionObs0 = _this.intersectionObserver) === null || _this$intersectionObs0 === void 0 || _this$intersectionObs0.watchAndTag(target, function (_ref8) {
|
|
427
285
|
var target = _ref8.target,
|
|
428
286
|
rect = _ref8.rect;
|
|
429
287
|
if (isContainedWithinMediaWrapper(target)) {
|
|
@@ -437,8 +295,8 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
437
295
|
};
|
|
438
296
|
}
|
|
439
297
|
if (fg('platform_ufo_exclude_3p_attribute_changes')) {
|
|
440
|
-
var
|
|
441
|
-
isWithinThirdPartySegment =
|
|
298
|
+
var _checkWithinComponent = checkWithinComponent(target, 'UFOThirdPartySegment', _this.mapIs3pResult),
|
|
299
|
+
isWithinThirdPartySegment = _checkWithinComponent.isWithin;
|
|
442
300
|
if (isWithinThirdPartySegment) {
|
|
443
301
|
return {
|
|
444
302
|
type: 'mutation:third-party-attribute',
|
|
@@ -499,11 +357,11 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
499
357
|
_defineProperty(this, "handleLayoutShift", function (_ref9) {
|
|
500
358
|
var time = _ref9.time,
|
|
501
359
|
changedRects = _ref9.changedRects;
|
|
502
|
-
var
|
|
503
|
-
|
|
360
|
+
var _iterator3 = _createForOfIteratorHelper(changedRects),
|
|
361
|
+
_step3;
|
|
504
362
|
try {
|
|
505
|
-
for (
|
|
506
|
-
var changedRect =
|
|
363
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
364
|
+
var changedRect = _step3.value;
|
|
507
365
|
var target = changedRect.node;
|
|
508
366
|
if (target) {
|
|
509
367
|
var isSameCurrentAndPreviousRects = isSameRectDimensions(changedRect.rect, changedRect.previousRect);
|
|
@@ -518,9 +376,9 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
518
376
|
}
|
|
519
377
|
}
|
|
520
378
|
} catch (err) {
|
|
521
|
-
|
|
379
|
+
_iterator3.e(err);
|
|
522
380
|
} finally {
|
|
523
|
-
|
|
381
|
+
_iterator3.f();
|
|
524
382
|
}
|
|
525
383
|
});
|
|
526
384
|
this.mapVisibleNodeRects = new WeakMap();
|
|
@@ -577,12 +435,12 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
577
435
|
}, {
|
|
578
436
|
key: "stop",
|
|
579
437
|
value: function stop() {
|
|
580
|
-
var _this$mutationObserve2, _this$
|
|
438
|
+
var _this$mutationObserve2, _this$intersectionObs1, _this$performanceObse2;
|
|
581
439
|
if (!this.isStarted) {
|
|
582
440
|
return;
|
|
583
441
|
}
|
|
584
442
|
(_this$mutationObserve2 = this.mutationObserver) === null || _this$mutationObserve2 === void 0 || _this$mutationObserve2.disconnect();
|
|
585
|
-
(_this$
|
|
443
|
+
(_this$intersectionObs1 = this.intersectionObserver) === null || _this$intersectionObs1 === void 0 || _this$intersectionObs1.disconnect();
|
|
586
444
|
(_this$performanceObse2 = this.performanceObserver) === null || _this$performanceObse2 === void 0 || _this$performanceObse2.disconnect();
|
|
587
445
|
this.isStarted = false;
|
|
588
446
|
// Clean up caches when stopping
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.2",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -89,9 +89,6 @@
|
|
|
89
89
|
"platform_ufo_enable_media_for_ttvc_v3": {
|
|
90
90
|
"type": "boolean"
|
|
91
91
|
},
|
|
92
|
-
"ufo_targeting_confluence_hello": {
|
|
93
|
-
"type": "boolean"
|
|
94
|
-
},
|
|
95
92
|
"platform_ufo_remove_deprecated_config_fields": {
|
|
96
93
|
"type": "boolean"
|
|
97
94
|
},
|
|
@@ -110,9 +107,6 @@
|
|
|
110
107
|
"platform_ufo_critical_metrics_payload": {
|
|
111
108
|
"type": "boolean"
|
|
112
109
|
},
|
|
113
|
-
"platform_ufo_ssr_placeholders_for_display_contents": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
110
|
"platform_ufo_enable_interactivity_jsm": {
|
|
117
111
|
"type": "boolean"
|
|
118
112
|
},
|
|
@@ -152,9 +146,6 @@
|
|
|
152
146
|
"platform_ufo_enable_finish_interaction_transition": {
|
|
153
147
|
"type": "boolean"
|
|
154
148
|
},
|
|
155
|
-
"react_ufo_unified_search_ignoring_sain_metric": {
|
|
156
|
-
"type": "boolean"
|
|
157
|
-
},
|
|
158
149
|
"platform_ufo_always_send_post_interaction_log": {
|
|
159
150
|
"type": "boolean"
|
|
160
151
|
},
|