@tamagui/core 1.132.2 → 1.132.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/dist/native.js +52 -15
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +52 -15
- package/dist/test.native.js.map +1 -1
- package/package.json +10 -10
package/dist/native.js
CHANGED
|
@@ -12394,18 +12394,7 @@ var require_index_native12 = __commonJS({
|
|
|
12394
12394
|
}));
|
|
12395
12395
|
}
|
|
12396
12396
|
if (import_constants.isClient) if (rAF) {
|
|
12397
|
-
|
|
12398
|
-
if (strategy !== "off") {
|
|
12399
|
-
if (frameCount++ % RUN_EVERY_X_FRAMES !== 0) {
|
|
12400
|
-
rAF(layoutOnAnimationFrame);
|
|
12401
|
-
return;
|
|
12402
|
-
}
|
|
12403
|
-
frameCount === Number.MAX_SAFE_INTEGER && (frameCount = 0), Nodes.forEach(function(node) {
|
|
12404
|
-
updateLayoutIfChanged(node);
|
|
12405
|
-
});
|
|
12406
|
-
}
|
|
12407
|
-
rAF(layoutOnAnimationFrame);
|
|
12408
|
-
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body;
|
|
12397
|
+
supportsCheckVisibility = "checkVisibility" in document.body, BoundingRects = /* @__PURE__ */ new WeakMap();
|
|
12409
12398
|
async function updateLayoutIfChanged(node) {
|
|
12410
12399
|
if (IntersectionState.get(node) !== !1 && !(process.env.TAMAGUI_ONLAYOUT_VISIBILITY_CHECK === "1" && supportsCheckVisibility && !node.checkVisibility())) {
|
|
12411
12400
|
var onLayout = LayoutHandlers.get(node);
|
|
@@ -12415,8 +12404,8 @@ var require_index_native12 = __commonJS({
|
|
|
12415
12404
|
var nodeRect, parentRect;
|
|
12416
12405
|
if (strategy === "async") {
|
|
12417
12406
|
var [nr, pr] = await Promise.all([
|
|
12418
|
-
getBoundingClientRectAsync(node),
|
|
12419
|
-
getBoundingClientRectAsync(parentNode)
|
|
12407
|
+
BoundingRects.get(node) || getBoundingClientRectAsync(node),
|
|
12408
|
+
BoundingRects.get(parentNode) || getBoundingClientRectAsync(parentNode)
|
|
12420
12409
|
]);
|
|
12421
12410
|
if (nr === !1 || pr === !1) return;
|
|
12422
12411
|
nodeRect = nr, parentRect = pr;
|
|
@@ -12437,8 +12426,56 @@ var require_index_native12 = __commonJS({
|
|
|
12437
12426
|
}
|
|
12438
12427
|
}
|
|
12439
12428
|
rAF(layoutOnAnimationFrame), frameCount = 0, userSkipVal = process.env.TAMAGUI_LAYOUT_FRAME_SKIP, RUN_EVERY_X_FRAMES = userSkipVal ? +userSkipVal : 10;
|
|
12429
|
+
async function layoutOnAnimationFrame() {
|
|
12430
|
+
if (strategy !== "off") {
|
|
12431
|
+
if (!Nodes.size || frameCount++ % RUN_EVERY_X_FRAMES !== 0) {
|
|
12432
|
+
rAF(layoutOnAnimationFrame);
|
|
12433
|
+
return;
|
|
12434
|
+
}
|
|
12435
|
+
frameCount === Number.MAX_SAFE_INTEGER && (frameCount = 0), await new Promise(function(res) {
|
|
12436
|
+
var io = new IntersectionObserver(function(entries) {
|
|
12437
|
+
io.disconnect();
|
|
12438
|
+
var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
|
12439
|
+
try {
|
|
12440
|
+
for (var _iterator2 = entries[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
12441
|
+
var entry = _step2.value;
|
|
12442
|
+
BoundingRects.set(entry.target, entry.boundingClientRect);
|
|
12443
|
+
}
|
|
12444
|
+
} catch (err) {
|
|
12445
|
+
_didIteratorError2 = !0, _iteratorError2 = err;
|
|
12446
|
+
} finally {
|
|
12447
|
+
try {
|
|
12448
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
12449
|
+
} finally {
|
|
12450
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
12451
|
+
}
|
|
12452
|
+
}
|
|
12453
|
+
res();
|
|
12454
|
+
}, {
|
|
12455
|
+
threshold: 0
|
|
12456
|
+
}), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
12457
|
+
try {
|
|
12458
|
+
for (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
12459
|
+
var node = _step.value;
|
|
12460
|
+
node.parentElement instanceof HTMLElement && (io.observe(node), io.observe(node.parentElement));
|
|
12461
|
+
}
|
|
12462
|
+
} catch (err) {
|
|
12463
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
12464
|
+
} finally {
|
|
12465
|
+
try {
|
|
12466
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
12467
|
+
} finally {
|
|
12468
|
+
if (_didIteratorError) throw _iteratorError;
|
|
12469
|
+
}
|
|
12470
|
+
}
|
|
12471
|
+
}), Nodes.forEach(function(node) {
|
|
12472
|
+
updateLayoutIfChanged(node);
|
|
12473
|
+
});
|
|
12474
|
+
}
|
|
12475
|
+
rAF(layoutOnAnimationFrame);
|
|
12476
|
+
}
|
|
12440
12477
|
} else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
|
|
12441
|
-
var
|
|
12478
|
+
var supportsCheckVisibility, BoundingRects, frameCount, userSkipVal, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
12442
12479
|
return {
|
|
12443
12480
|
nativeEvent: {
|
|
12444
12481
|
layout: getRelativeDimensions(nodeRect, parentRect),
|