tamagui 1.125.25 → 1.125.27
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 -36
- package/dist/native.js.map +2 -2
- package/dist/test.native.js +48 -32
- package/dist/test.native.js.map +2 -2
- package/package.json +55 -55
- package/types/views/TamaguiProvider.d.ts.map +1 -1
package/dist/test.native.js
CHANGED
|
@@ -12749,6 +12749,8 @@ var require_getBaseViews_native = __commonJS({
|
|
|
12749
12749
|
module2.exports = __toCommonJS2(getBaseViews_native_exports);
|
|
12750
12750
|
function getBaseViews() {
|
|
12751
12751
|
var native = require("react-native"), View2, TextAncestor;
|
|
12752
|
+
if (0)
|
|
12753
|
+
var TextAncestorModule, _TextAncestorModule_default;
|
|
12752
12754
|
return View2 || (View2 = native.View || native.default.View), {
|
|
12753
12755
|
View: View2,
|
|
12754
12756
|
Text: native.Text || native.default.Text,
|
|
@@ -15967,12 +15969,14 @@ var require_Portal_native = __commonJS({
|
|
|
15967
15969
|
module2.exports = __toCommonJS2(Portal_native_exports);
|
|
15968
15970
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_stacks3 = require_index_native22(), import_z_index_stack2 = require_index_native27(), React4 = __toESM2(require("react")), import_react_native4 = require("react-native"), import_constants4 = require_constants_native3(), import_GorhomPortalItem = require_GorhomPortalItem_native(), import_helpers = require_helpers_native(), createPortal = function() {
|
|
15969
15971
|
if (import_constants4.IS_FABRIC) try {
|
|
15970
|
-
|
|
15972
|
+
var _ReactFabricShimModule_default, ReactFabricShimModule = require("react-native/Libraries/Renderer/shims/ReactFabric"), _ReactFabricShimModule_default_createPortal;
|
|
15973
|
+
return (_ReactFabricShimModule_default_createPortal = (_ReactFabricShimModule_default = ReactFabricShimModule.default) === null || _ReactFabricShimModule_default === void 0 ? void 0 : _ReactFabricShimModule_default.createPortal) !== null && _ReactFabricShimModule_default_createPortal !== void 0 ? _ReactFabricShimModule_default_createPortal : ReactFabricShimModule.createPortal;
|
|
15971
15974
|
} catch (err) {
|
|
15972
15975
|
return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
|
|
15973
15976
|
}
|
|
15974
15977
|
try {
|
|
15975
|
-
|
|
15978
|
+
var _ReactNativeShimModule_default, ReactNativeShimModule = require("react-native/Libraries/Renderer/shims/ReactNative").createPortal, _ReactNativeShimModule_default_createPortal;
|
|
15979
|
+
return (_ReactNativeShimModule_default_createPortal = (_ReactNativeShimModule_default = ReactNativeShimModule.default) === null || _ReactNativeShimModule_default === void 0 ? void 0 : _ReactNativeShimModule_default.createPortal) !== null && _ReactNativeShimModule_default_createPortal !== void 0 ? _ReactNativeShimModule_default_createPortal : ReactNativeShimModule.createPortal;
|
|
15976
15980
|
} catch (err) {
|
|
15977
15981
|
return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
|
|
15978
15982
|
}
|
|
@@ -17355,6 +17359,8 @@ var require_nativeSheet_native = __commonJS({
|
|
|
17355
17359
|
}
|
|
17356
17360
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
|
|
17357
17361
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
|
|
17362
|
+
scrollEnabled: !0,
|
|
17363
|
+
setHasScrollView: emptyFn,
|
|
17358
17364
|
...providerProps,
|
|
17359
17365
|
onlyShowFrame: !0,
|
|
17360
17366
|
children: [
|
|
@@ -17387,6 +17393,8 @@ var require_nativeSheet_native = __commonJS({
|
|
|
17387
17393
|
});
|
|
17388
17394
|
});
|
|
17389
17395
|
}
|
|
17396
|
+
var emptyFn = function() {
|
|
17397
|
+
};
|
|
17390
17398
|
}
|
|
17391
17399
|
});
|
|
17392
17400
|
|
|
@@ -17499,11 +17507,9 @@ var require_helpers_native2 = __commonJS({
|
|
|
17499
17507
|
module2.exports = __toCommonJS2(helpers_exports);
|
|
17500
17508
|
function resisted(y, minY) {
|
|
17501
17509
|
var maxOverflow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 25;
|
|
17502
|
-
if (y
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
}
|
|
17506
|
-
return y;
|
|
17510
|
+
if (y >= minY) return y;
|
|
17511
|
+
var pastBoundary = minY - y, resistedDistance = Math.sqrt(pastBoundary) * 2;
|
|
17512
|
+
return minY - resistedDistance;
|
|
17507
17513
|
}
|
|
17508
17514
|
}
|
|
17509
17515
|
});
|
|
@@ -17602,7 +17608,7 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
17602
17608
|
};
|
|
17603
17609
|
}, [
|
|
17604
17610
|
zIndex
|
|
17605
|
-
]), isMounted = (0, import_core12.useDidFinishSSR)(), startPosition = isMounted && screenSize ? screenSize : hiddenSize, animatedNumber = useAnimatedNumber(startPosition), at = import_react3.default.useRef(startPosition), hasntMeasured = at.current === hiddenSize, [disableAnimation, setDisableAnimation] = (0, import_react3.useState)(hasntMeasured);
|
|
17611
|
+
]), isMounted = (0, import_core12.useDidFinishSSR)(), startPosition = isMounted && screenSize ? screenSize : hiddenSize, animatedNumber = useAnimatedNumber(startPosition), at = import_react3.default.useRef(startPosition), hasntMeasured = at.current === hiddenSize, [disableAnimation, setDisableAnimation] = (0, import_react3.useState)(hasntMeasured), hasScrollView = import_react3.default.useRef(!1);
|
|
17606
17612
|
useAnimatedNumberReaction({
|
|
17607
17613
|
value: animatedNumber,
|
|
17608
17614
|
hostRef: sheetRef
|
|
@@ -17645,7 +17651,9 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
17645
17651
|
open,
|
|
17646
17652
|
position
|
|
17647
17653
|
]);
|
|
17648
|
-
var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1),
|
|
17654
|
+
var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1), scrollEnabled = (0, import_react3.useRef)(!0), setScrollEnabled = import_react3.default.useCallback(function(val) {
|
|
17655
|
+
scrollEnabled.current = val;
|
|
17656
|
+
}, []), panResponder = import_react3.default.useMemo(function() {
|
|
17649
17657
|
if (disableDrag || !frameSize || isShowingInnerSheet) return;
|
|
17650
17658
|
var minY = positions[0];
|
|
17651
17659
|
scrollBridge.paneMinY = minY;
|
|
@@ -17660,7 +17668,7 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
17660
17668
|
var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
17661
17669
|
curDist < dist && (dist = curDist, closestPoint = i);
|
|
17662
17670
|
}
|
|
17663
|
-
setPosition(closestPoint), animateTo(closestPoint);
|
|
17671
|
+
setPosition(closestPoint), animateTo(closestPoint), setScrollEnabled(closestPoint === 0 && dragAt <= 0);
|
|
17664
17672
|
}, finish = function(_e, state2) {
|
|
17665
17673
|
release({
|
|
17666
17674
|
vy: state2.vy,
|
|
@@ -17668,11 +17676,11 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
17668
17676
|
});
|
|
17669
17677
|
}, previouslyScrolling = !1, onMoveShouldSet = function(e, param) {
|
|
17670
17678
|
var { dy } = param;
|
|
17671
|
-
if (e.target === providerProps.handleRef.current) return !0;
|
|
17679
|
+
if (e.target === providerProps.handleRef.current || !scrollEnabled.current || !hasScrollView.current) return !0;
|
|
17672
17680
|
var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
17673
|
-
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop &&
|
|
17681
|
+
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && scrollEnabled.current && isDraggingUp ? !1 : Math.abs(dy) > 5;
|
|
17674
17682
|
}, grant = function() {
|
|
17675
|
-
setPanning(!0), stopSpring(), startY = at.current;
|
|
17683
|
+
setScrollEnabled(!1), setPanning(!0), stopSpring(), startY = at.current;
|
|
17676
17684
|
}, isExternalDrag = !1;
|
|
17677
17685
|
return scrollBridge.drag = function(dy) {
|
|
17678
17686
|
isExternalDrag || (isExternalDrag = !0, grant());
|
|
@@ -17753,10 +17761,14 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
17753
17761
|
}, [
|
|
17754
17762
|
open
|
|
17755
17763
|
]);
|
|
17756
|
-
var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${import_constants4.isWeb ? "dvh" : "%"}` : maxSnapPoint,
|
|
17764
|
+
var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${import_constants4.isWeb ? "dvh" : "%"}` : maxSnapPoint, setHasScrollView = import_react3.default.useCallback(function(val) {
|
|
17765
|
+
hasScrollView.current = val;
|
|
17766
|
+
}, []), contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_contexts.ParentSheetContext.Provider, {
|
|
17757
17767
|
value: nextParentContext,
|
|
17758
17768
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
|
|
17759
17769
|
...providerProps,
|
|
17770
|
+
scrollEnabled: scrollEnabled.current,
|
|
17771
|
+
setHasScrollView,
|
|
17760
17772
|
children: [
|
|
17761
17773
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
|
|
17762
17774
|
custom: {
|
|
@@ -18013,14 +18025,20 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18013
18025
|
});
|
|
18014
18026
|
module2.exports = __toCommonJS2(SheetScrollView_exports);
|
|
18015
18027
|
var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_compose_refs = require_index_native11(), import_scroll_view = require_index_native35(), import_SheetContext = require_SheetContext_native(), SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ */ import_react3.default.forwardRef(function(param, ref) {
|
|
18016
|
-
var { __scopeSheet, children, onScroll, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge } = context, scrollRef = import_react3.default.useRef(null), state = import_react3.default.useRef({
|
|
18028
|
+
var { __scopeSheet, children, onScroll, scrollEnabled, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge, scrollEnabled: scrollEnabled_, setHasScrollView } = context, scrollRef = import_react3.default.useRef(null), state = import_react3.default.useRef({
|
|
18017
18029
|
lastPageY: 0,
|
|
18018
18030
|
dragAt: 0,
|
|
18019
18031
|
dys: [],
|
|
18020
18032
|
// store a few recent dys to get velocity on release
|
|
18021
18033
|
isScrolling: !1,
|
|
18022
18034
|
isDragging: !1
|
|
18023
|
-
})
|
|
18035
|
+
});
|
|
18036
|
+
(0, import_react3.useEffect)(function() {
|
|
18037
|
+
return setHasScrollView(!0), function() {
|
|
18038
|
+
setHasScrollView(!1);
|
|
18039
|
+
};
|
|
18040
|
+
}, []);
|
|
18041
|
+
var release = function() {
|
|
18024
18042
|
if (state.current.isDragging) {
|
|
18025
18043
|
state.current.isDragging = !1, scrollBridge.scrollStartY = -1, state.current.isScrolling = !1;
|
|
18026
18044
|
var vy = 0;
|
|
@@ -18035,14 +18053,17 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18035
18053
|
vy
|
|
18036
18054
|
});
|
|
18037
18055
|
}
|
|
18038
|
-
};
|
|
18056
|
+
}, scrollable = scrollEnabled ?? scrollEnabled_;
|
|
18039
18057
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
|
|
18040
18058
|
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
18041
18059
|
flex: 1,
|
|
18042
18060
|
scrollEventThrottle: 8,
|
|
18043
18061
|
onResponderRelease: release,
|
|
18044
18062
|
className: "_ovs-contain",
|
|
18045
|
-
|
|
18063
|
+
scrollEnabled: scrollable,
|
|
18064
|
+
// {...(Platform.OS === 'android' && {
|
|
18065
|
+
// pointerEvents: scrollable ? undefined : 'none',
|
|
18066
|
+
// })}
|
|
18046
18067
|
onScroll: function(e) {
|
|
18047
18068
|
var { y } = e.nativeEvent.contentOffset;
|
|
18048
18069
|
scrollBridge.y = y, y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
|
|
@@ -18054,11 +18075,11 @@ var require_SheetScrollView_native = __commonJS({
|
|
|
18054
18075
|
// renderScrollComponent={Sheet.ScrollView}
|
|
18055
18076
|
// ```
|
|
18056
18077
|
onStartShouldSetResponder: function() {
|
|
18057
|
-
return scrollBridge.scrollStartY = -1, state.current.isDragging = !0,
|
|
18078
|
+
return scrollBridge.scrollStartY = -1, state.current.isDragging = !0, scrollable;
|
|
18058
18079
|
},
|
|
18059
18080
|
// setting to false while onResponderMove is disabled
|
|
18060
18081
|
onMoveShouldSetResponder: function() {
|
|
18061
|
-
return
|
|
18082
|
+
return scrollable;
|
|
18062
18083
|
},
|
|
18063
18084
|
// somehow disabling works better, regression, no more nice drag continue scroll
|
|
18064
18085
|
// onResponderMove={(e) => {
|
|
@@ -22391,9 +22412,7 @@ var require_Group_native = __commonJS({
|
|
|
22391
22412
|
disable: disablePassBorderRadius
|
|
22392
22413
|
}), _$props = {
|
|
22393
22414
|
disabled,
|
|
22394
|
-
...
|
|
22395
|
-
style: radiusStyles
|
|
22396
|
-
}
|
|
22415
|
+
...radiusStyles
|
|
22397
22416
|
};
|
|
22398
22417
|
return cloneElementWithPropOrder(child, _$props);
|
|
22399
22418
|
}), indexedChildren = (0, import_useIndexedChildren.useIndexedChildren)((0, import_core12.spacedChildren)({
|
|
@@ -22436,15 +22455,10 @@ var require_Group_native = __commonJS({
|
|
|
22436
22455
|
});
|
|
22437
22456
|
}
|
|
22438
22457
|
var GroupItem = /* @__PURE__ */ import_react3.default.forwardRef(function(props, _ref) {
|
|
22439
|
-
var
|
|
22458
|
+
var { __scopeGroup, children, forcePlacement } = props, groupItemProps = useGroupItem({
|
|
22440
22459
|
disabled: /* @__PURE__ */ import_react3.default.isValidElement(children) ? children.props.disabled : void 0
|
|
22441
22460
|
}, forcePlacement, __scopeGroup);
|
|
22442
|
-
return !/* @__PURE__ */ import_react3.default.isValidElement(children) || children.type === import_react3.default.Fragment ? children :
|
|
22443
|
-
style: {
|
|
22444
|
-
...(_children_props = children.props) === null || _children_props === void 0 ? void 0 : _children_props.style,
|
|
22445
|
-
...groupItemProps
|
|
22446
|
-
}
|
|
22447
|
-
});
|
|
22461
|
+
return !/* @__PURE__ */ import_react3.default.isValidElement(children) || children.type === import_react3.default.Fragment ? children : /* @__PURE__ */ import_react3.default.cloneElement(children, groupItemProps);
|
|
22448
22462
|
}), useGroupItem = function(childrenProps, forcePlacement, __scopeGroup) {
|
|
22449
22463
|
var treeIndex = (0, import_useIndexedChildren.useIndex)(), context = useGroupContext("GroupItem", __scopeGroup);
|
|
22450
22464
|
if (import_react3.default.useEffect(function() {
|
|
@@ -22490,11 +22504,13 @@ var require_Group_native = __commonJS({
|
|
|
22490
22504
|
borderBottomRightRadius: isLast && disable !== "bottom" && disable !== "end" ? radius : 0
|
|
22491
22505
|
};
|
|
22492
22506
|
}, cloneElementWithPropOrder = function(child, props) {
|
|
22493
|
-
var next = (0, import_core12.mergeProps)(child.props, props, (0, import_core12.getConfig)().shorthands);
|
|
22494
22507
|
return /* @__PURE__ */ import_react3.default.cloneElement({
|
|
22495
22508
|
...child,
|
|
22496
22509
|
props: null
|
|
22497
|
-
},
|
|
22510
|
+
}, {
|
|
22511
|
+
...child.props,
|
|
22512
|
+
...props
|
|
22513
|
+
});
|
|
22498
22514
|
};
|
|
22499
22515
|
}
|
|
22500
22516
|
});
|