tamagui 1.132.2 → 1.132.4
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 +89 -27
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +89 -27
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
package/dist/native.js
CHANGED
|
@@ -8745,7 +8745,8 @@ var require_createComponent_native = __commonJS({
|
|
|
8745
8745
|
}
|
|
8746
8746
|
var allGroupContexts = (0, import_react3.useMemo)(function() {
|
|
8747
8747
|
var _stateRef_current_group;
|
|
8748
|
-
if (!groupName || props.passThrough
|
|
8748
|
+
if (!groupName || props.passThrough || // avoids onLayout
|
|
8749
|
+
props.containerType === "normal") return groupContextParent;
|
|
8749
8750
|
(_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.listeners.clear();
|
|
8750
8751
|
var listeners = /* @__PURE__ */ new Set();
|
|
8751
8752
|
return stateRef.current.group = {
|
|
@@ -13518,18 +13519,7 @@ var require_index_native19 = __commonJS({
|
|
|
13518
13519
|
}));
|
|
13519
13520
|
}
|
|
13520
13521
|
if (import_constants4.isClient) if (rAF) {
|
|
13521
|
-
|
|
13522
|
-
if (strategy !== "off") {
|
|
13523
|
-
if (frameCount++ % RUN_EVERY_X_FRAMES !== 0) {
|
|
13524
|
-
rAF(layoutOnAnimationFrame);
|
|
13525
|
-
return;
|
|
13526
|
-
}
|
|
13527
|
-
frameCount === Number.MAX_SAFE_INTEGER && (frameCount = 0), Nodes.forEach(function(node) {
|
|
13528
|
-
updateLayoutIfChanged(node);
|
|
13529
|
-
});
|
|
13530
|
-
}
|
|
13531
|
-
rAF(layoutOnAnimationFrame);
|
|
13532
|
-
}, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body;
|
|
13522
|
+
supportsCheckVisibility = "checkVisibility" in document.body, BoundingRects = /* @__PURE__ */ new WeakMap();
|
|
13533
13523
|
async function updateLayoutIfChanged(node) {
|
|
13534
13524
|
if (IntersectionState.get(node) !== !1 && !(process.env.TAMAGUI_ONLAYOUT_VISIBILITY_CHECK === "1" && supportsCheckVisibility && !node.checkVisibility())) {
|
|
13535
13525
|
var onLayout = LayoutHandlers.get(node);
|
|
@@ -13539,8 +13529,8 @@ var require_index_native19 = __commonJS({
|
|
|
13539
13529
|
var nodeRect, parentRect;
|
|
13540
13530
|
if (strategy === "async") {
|
|
13541
13531
|
var [nr, pr] = await Promise.all([
|
|
13542
|
-
getBoundingClientRectAsync(node),
|
|
13543
|
-
getBoundingClientRectAsync(parentNode)
|
|
13532
|
+
BoundingRects.get(node) || getBoundingClientRectAsync(node),
|
|
13533
|
+
BoundingRects.get(parentNode) || getBoundingClientRectAsync(parentNode)
|
|
13544
13534
|
]);
|
|
13545
13535
|
if (nr === !1 || pr === !1) return;
|
|
13546
13536
|
nodeRect = nr, parentRect = pr;
|
|
@@ -13561,8 +13551,56 @@ var require_index_native19 = __commonJS({
|
|
|
13561
13551
|
}
|
|
13562
13552
|
}
|
|
13563
13553
|
rAF(layoutOnAnimationFrame), frameCount = 0, userSkipVal = process.env.TAMAGUI_LAYOUT_FRAME_SKIP, RUN_EVERY_X_FRAMES = userSkipVal ? +userSkipVal : 10;
|
|
13554
|
+
async function layoutOnAnimationFrame() {
|
|
13555
|
+
if (strategy !== "off") {
|
|
13556
|
+
if (!Nodes.size || frameCount++ % RUN_EVERY_X_FRAMES !== 0) {
|
|
13557
|
+
rAF(layoutOnAnimationFrame);
|
|
13558
|
+
return;
|
|
13559
|
+
}
|
|
13560
|
+
frameCount === Number.MAX_SAFE_INTEGER && (frameCount = 0), await new Promise(function(res) {
|
|
13561
|
+
var io = new IntersectionObserver(function(entries) {
|
|
13562
|
+
io.disconnect();
|
|
13563
|
+
var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
|
13564
|
+
try {
|
|
13565
|
+
for (var _iterator2 = entries[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
|
|
13566
|
+
var entry = _step2.value;
|
|
13567
|
+
BoundingRects.set(entry.target, entry.boundingClientRect);
|
|
13568
|
+
}
|
|
13569
|
+
} catch (err) {
|
|
13570
|
+
_didIteratorError2 = !0, _iteratorError2 = err;
|
|
13571
|
+
} finally {
|
|
13572
|
+
try {
|
|
13573
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
|
13574
|
+
} finally {
|
|
13575
|
+
if (_didIteratorError2) throw _iteratorError2;
|
|
13576
|
+
}
|
|
13577
|
+
}
|
|
13578
|
+
res();
|
|
13579
|
+
}, {
|
|
13580
|
+
threshold: 0
|
|
13581
|
+
}), _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
13582
|
+
try {
|
|
13583
|
+
for (var _iterator = Nodes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
13584
|
+
var node = _step.value;
|
|
13585
|
+
node.parentElement instanceof HTMLElement && (io.observe(node), io.observe(node.parentElement));
|
|
13586
|
+
}
|
|
13587
|
+
} catch (err) {
|
|
13588
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
13589
|
+
} finally {
|
|
13590
|
+
try {
|
|
13591
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
13592
|
+
} finally {
|
|
13593
|
+
if (_didIteratorError) throw _iteratorError;
|
|
13594
|
+
}
|
|
13595
|
+
}
|
|
13596
|
+
}), Nodes.forEach(function(node) {
|
|
13597
|
+
updateLayoutIfChanged(node);
|
|
13598
|
+
});
|
|
13599
|
+
}
|
|
13600
|
+
rAF(layoutOnAnimationFrame);
|
|
13601
|
+
}
|
|
13564
13602
|
} else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
|
|
13565
|
-
var
|
|
13603
|
+
var supportsCheckVisibility, BoundingRects, frameCount, userSkipVal, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
|
|
13566
13604
|
return {
|
|
13567
13605
|
nativeEvent: {
|
|
13568
13606
|
layout: getRelativeDimensions(nodeRect, parentRect),
|
|
@@ -24284,7 +24322,23 @@ var require_useFloating_native = __commonJS({
|
|
|
24284
24322
|
module2.exports = __toCommonJS2(useFloating_exports);
|
|
24285
24323
|
var import_react3 = __toESM2(require("react")), Floating = __toESM2(require_Floating_native()), FloatingOverrideContext2 = /* @__PURE__ */ import_react3.default.createContext(null), useFloating2 = function(props) {
|
|
24286
24324
|
var _this, context = import_react3.default.useContext(FloatingOverrideContext2);
|
|
24287
|
-
return (_this = context || Floating.useFloating) === null || _this === void 0 ? void 0 : _this(
|
|
24325
|
+
return (_this = context || Floating.useFloating) === null || _this === void 0 ? void 0 : _this({
|
|
24326
|
+
...props,
|
|
24327
|
+
middleware: [
|
|
24328
|
+
// @ts-ignore
|
|
24329
|
+
...props.middleware,
|
|
24330
|
+
{
|
|
24331
|
+
name: "rounded",
|
|
24332
|
+
fn(param) {
|
|
24333
|
+
var { x, y } = param;
|
|
24334
|
+
return {
|
|
24335
|
+
x: Math.round(x),
|
|
24336
|
+
y: Math.round(y)
|
|
24337
|
+
};
|
|
24338
|
+
}
|
|
24339
|
+
}
|
|
24340
|
+
]
|
|
24341
|
+
});
|
|
24288
24342
|
};
|
|
24289
24343
|
}
|
|
24290
24344
|
});
|
|
@@ -24521,7 +24575,7 @@ var require_Popper_native = __commonJS({
|
|
|
24521
24575
|
Object.assign(setupOptions, options);
|
|
24522
24576
|
}
|
|
24523
24577
|
function Popper(props) {
|
|
24524
|
-
var
|
|
24578
|
+
var { children, size: size2, strategy = "absolute", placement = "bottom", stayInFrame, allowFlip, offset: offset2, disableRTL, resize, passThrough, open, scope } = props, [arrowEl, setArrow] = React4.useState(null), [arrowSize, setArrowSize] = React4.useState(0), offsetOptions = offset2 ?? arrowSize, floatingStyle = React4.useRef({}), floating = (0, import_floating.useFloating)({
|
|
24525
24579
|
open: passThrough ? !1 : open || !0,
|
|
24526
24580
|
strategy,
|
|
24527
24581
|
placement,
|
|
@@ -24565,14 +24619,22 @@ var require_Popper_native = __commonJS({
|
|
|
24565
24619
|
dimensions,
|
|
24566
24620
|
keyboardOpen
|
|
24567
24621
|
]);
|
|
24568
|
-
var popperContext = {
|
|
24569
|
-
|
|
24570
|
-
|
|
24571
|
-
|
|
24572
|
-
|
|
24573
|
-
|
|
24574
|
-
|
|
24575
|
-
|
|
24622
|
+
var popperContext = React4.useMemo(function() {
|
|
24623
|
+
var _middlewareData_checkFloating;
|
|
24624
|
+
return {
|
|
24625
|
+
size: size2,
|
|
24626
|
+
arrowRef: setArrow,
|
|
24627
|
+
arrowStyle: middlewareData.arrow,
|
|
24628
|
+
onArrowSize: setArrowSize,
|
|
24629
|
+
hasFloating: (_middlewareData_checkFloating = middlewareData.checkFloating) === null || _middlewareData_checkFloating === void 0 ? void 0 : _middlewareData_checkFloating.hasFloating,
|
|
24630
|
+
...floating
|
|
24631
|
+
};
|
|
24632
|
+
}, [
|
|
24633
|
+
size2,
|
|
24634
|
+
floating.x,
|
|
24635
|
+
floating.y,
|
|
24636
|
+
floating.isPositioned
|
|
24637
|
+
]);
|
|
24576
24638
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopperProvider, {
|
|
24577
24639
|
scope,
|
|
24578
24640
|
...popperContext,
|
|
@@ -24661,13 +24723,13 @@ var require_Popper_native = __commonJS({
|
|
|
24661
24723
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
|
|
24662
24724
|
passThrough,
|
|
24663
24725
|
ref: contentRefs,
|
|
24726
|
+
contain: "layout style",
|
|
24664
24727
|
...passThrough ? null : floatingProps,
|
|
24665
24728
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopperContentFrame, {
|
|
24666
24729
|
passThrough,
|
|
24667
24730
|
...!passThrough && {
|
|
24668
24731
|
"data-placement": placement,
|
|
24669
24732
|
"data-strategy": strategy,
|
|
24670
|
-
contain: "layout",
|
|
24671
24733
|
size: size2,
|
|
24672
24734
|
...style,
|
|
24673
24735
|
...rest
|