tamagui 2.0.0 → 2.1.0
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/.turbo/turbo-build.log +2 -2
- package/dist/native.cjs +107 -29
- package/dist/test.cjs +107 -29
- package/package.json +65 -65
package/.turbo/turbo-build.log
CHANGED
package/dist/native.cjs
CHANGED
|
@@ -26554,6 +26554,7 @@ var closeLastOpenedPopover = function() {
|
|
|
26554
26554
|
};
|
|
26555
26555
|
var PopoverContext = createStyledContext({}, "Popover__");
|
|
26556
26556
|
var PopoverZIndexContext = /* @__PURE__ */ react$1.createContext(void 0);
|
|
26557
|
+
var PopoverAdaptHiddenContext = /* @__PURE__ */ react$1.createContext(true);
|
|
26557
26558
|
var PopoverTriggerContext = createStyledContext({}, "PopoverTrigger__");
|
|
26558
26559
|
var usePopoverContext = PopoverContext.useStyledContext;
|
|
26559
26560
|
var usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;
|
|
@@ -26729,8 +26730,11 @@ var PopoverContent = PopperContentFrame.styleable(function PopoverContent2(props
|
|
|
26729
26730
|
useIsomorphicLayoutEffect(function() {
|
|
26730
26731
|
if (open && isFullyHidden) setIsFullyHidden(false);
|
|
26731
26732
|
}, [open, isFullyHidden]);
|
|
26733
|
+
var isAdaptFullyHidden = react$1.useContext(PopoverAdaptHiddenContext);
|
|
26732
26734
|
if (!context.keepChildrenMounted) {
|
|
26733
|
-
if (
|
|
26735
|
+
if (context.breakpointActive) {
|
|
26736
|
+
if (!open && isAdaptFullyHidden) return null;
|
|
26737
|
+
} else if (isFullyHidden && !open) return null;
|
|
26734
26738
|
}
|
|
26735
26739
|
var _contentImplProps_pointerEvents;
|
|
26736
26740
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverPortal, {
|
|
@@ -27015,6 +27019,8 @@ var PopoverSheetController = function(param) {
|
|
|
27015
27019
|
var showSheet = useShowPopoverSheet(context, open);
|
|
27016
27020
|
var breakpointActive = context === null || context === void 0 ? void 0 : context.breakpointActive;
|
|
27017
27021
|
var getShowSheet = useGet(showSheet);
|
|
27022
|
+
var [isAdaptFullyHidden, setIsAdaptFullyHidden] = react$1.useState(!open);
|
|
27023
|
+
if (open && isAdaptFullyHidden) setIsAdaptFullyHidden(false);
|
|
27018
27024
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SheetController, {
|
|
27019
27025
|
onOpenChange: function(val) {
|
|
27020
27026
|
if (getShowSheet()) {
|
|
@@ -27022,9 +27028,16 @@ var PopoverSheetController = function(param) {
|
|
|
27022
27028
|
(_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 || _props_onOpenChange.call(props, val);
|
|
27023
27029
|
}
|
|
27024
27030
|
},
|
|
27031
|
+
onAnimationComplete: react$1.useCallback(function(param2) {
|
|
27032
|
+
var { open: isOpen } = param2;
|
|
27033
|
+
if (!isOpen) setIsAdaptFullyHidden(true);
|
|
27034
|
+
}, []),
|
|
27025
27035
|
open,
|
|
27026
27036
|
hidden: !breakpointActive,
|
|
27027
|
-
children:
|
|
27037
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverAdaptHiddenContext.Provider, {
|
|
27038
|
+
value: isAdaptFullyHidden,
|
|
27039
|
+
children: props.children
|
|
27040
|
+
})
|
|
27028
27041
|
});
|
|
27029
27042
|
};
|
|
27030
27043
|
var useShowPopoverSheet = function(context, open) {
|
|
@@ -28366,7 +28379,10 @@ function setupNativeSheet(platform, RNIOSModal) {
|
|
|
28366
28379
|
}
|
|
28367
28380
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SheetProvider, _objectSpread2(_objectSpread2({
|
|
28368
28381
|
setHasScrollView: emptyFn,
|
|
28369
|
-
keyboardOccludedHeight: 0
|
|
28382
|
+
keyboardOccludedHeight: 0,
|
|
28383
|
+
isKeyboardVisible: false,
|
|
28384
|
+
keyboardStableFrameHeight: 0,
|
|
28385
|
+
isKeyboardSeeding: false
|
|
28370
28386
|
}, providerProps), {}, {
|
|
28371
28387
|
onlyShowFrame: true,
|
|
28372
28388
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetView, {
|
|
@@ -28713,6 +28729,9 @@ function getSafeAreaTopInset() {
|
|
|
28713
28729
|
return _cachedSafeAreaTop;
|
|
28714
28730
|
}
|
|
28715
28731
|
var relativeDimensionTo = "screen";
|
|
28732
|
+
function getStableViewportHeight() {
|
|
28733
|
+
return Dimensions.get(relativeDimensionTo).height;
|
|
28734
|
+
}
|
|
28716
28735
|
var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(function SheetImplementationCustom2(props, forwardedRef) {
|
|
28717
28736
|
var parentSheet = react$1.default.useContext(ParentSheetContext);
|
|
28718
28737
|
var { transition, transitionConfig: transitionConfigProp, modal = false, zIndex = parentSheet.zIndex + 1, moveOnKeyboardChange = false, unmountChildrenWhenHidden = false, portalProps, containerComponent: ContainerComponent = react$1.default.Fragment, onAnimationComplete } = props;
|
|
@@ -28740,22 +28759,37 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28740
28759
|
var onInnerSheet = react$1.default.useCallback(function(hasChild) {
|
|
28741
28760
|
setIsShowingInnerSheet(hasChild);
|
|
28742
28761
|
}, []);
|
|
28762
|
+
var { keyboardHeight, isKeyboardVisible, dismissKeyboard, pauseKeyboardHandler, flushPendingHide } = useKeyboardControllerSheet({ enabled: Boolean(moveOnKeyboardChange) });
|
|
28743
28763
|
var stableFrameSize = react$1.default.useRef(frameSize);
|
|
28744
28764
|
react$1.default.useEffect(function() {
|
|
28745
28765
|
if (open && frameSize) stableFrameSize.current = frameSize;
|
|
28746
28766
|
}, [open, frameSize]);
|
|
28747
|
-
var
|
|
28767
|
+
var isWebKbSheet = false;
|
|
28768
|
+
var hasCleanKbBaseline = react$1.default.useRef(false);
|
|
28769
|
+
var seedSettled = react$1.default.useRef(false);
|
|
28770
|
+
var stableKbGeom = react$1.default.useRef({
|
|
28771
|
+
frame: 0,
|
|
28772
|
+
screen: 0
|
|
28773
|
+
});
|
|
28774
|
+
if (frameSize > 0 && screenSize > 0) {
|
|
28775
|
+
stableKbGeom.current.frame = frameSize;
|
|
28776
|
+
stableKbGeom.current.screen = screenSize;
|
|
28777
|
+
hasCleanKbBaseline.current = true;
|
|
28778
|
+
} else if (isWebKbSheet && isKeyboardVisible && !hasCleanKbBaseline.current && screenSize > 0) stableKbGeom.current.screen = Math.max(stableKbGeom.current.screen, screenSize);
|
|
28779
|
+
var seedingKbBaseline = isWebKbSheet && isKeyboardVisible && !hasCleanKbBaseline.current && !seedSettled.current;
|
|
28780
|
+
var freezeForKb = isWebKbSheet && isKeyboardVisible && stableKbGeom.current.frame > 0;
|
|
28781
|
+
var effScreenSize = freezeForKb ? stableKbGeom.current.screen : screenSize;
|
|
28782
|
+
var effectiveFrameSize = freezeForKb ? stableKbGeom.current.frame : open ? frameSize : stableFrameSize.current || frameSize;
|
|
28748
28783
|
var positions = react$1.default.useMemo(function() {
|
|
28749
28784
|
return snapPoints.map(function(point) {
|
|
28750
|
-
return getYPositions(snapPointsMode, point,
|
|
28785
|
+
return getYPositions(snapPointsMode, point, effScreenSize, effectiveFrameSize);
|
|
28751
28786
|
});
|
|
28752
28787
|
}, [
|
|
28753
|
-
|
|
28788
|
+
effScreenSize,
|
|
28754
28789
|
effectiveFrameSize,
|
|
28755
28790
|
snapPoints,
|
|
28756
28791
|
snapPointsMode
|
|
28757
28792
|
]);
|
|
28758
|
-
var { keyboardHeight, isKeyboardVisible, dismissKeyboard, pauseKeyboardHandler, flushPendingHide } = useKeyboardControllerSheet({ enabled: Boolean(moveOnKeyboardChange) });
|
|
28759
28793
|
var [isDragging, setIsDragging_] = react$1.default.useState(false);
|
|
28760
28794
|
var isDraggingRef = react$1.default.useRef(false);
|
|
28761
28795
|
var setIsDragging = react$1.default.useCallback(function(val) {
|
|
@@ -28785,13 +28819,14 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28785
28819
|
screenSize,
|
|
28786
28820
|
isDragging
|
|
28787
28821
|
]);
|
|
28788
|
-
var keyboardOccludedHeight = getKeyboardOccludedHeight({
|
|
28789
|
-
frameSize,
|
|
28822
|
+
var keyboardOccludedHeight = seedingKbBaseline ? 0 : getKeyboardOccludedHeight({
|
|
28823
|
+
frameSize: effectiveFrameSize,
|
|
28790
28824
|
isKeyboardVisible,
|
|
28791
28825
|
keyboardHeight,
|
|
28792
|
-
screenSize,
|
|
28826
|
+
screenSize: effScreenSize,
|
|
28793
28827
|
sheetY: position >= 0 ? activePositions[position] : void 0
|
|
28794
28828
|
});
|
|
28829
|
+
var keyboardStableFrameHeight = !isWebKbSheet ? 0 : seedingKbBaseline ? stableKbGeom.current.screen || screenSize : stableKbGeom.current.frame > 0 ? stableKbGeom.current.frame : 0;
|
|
28795
28830
|
var { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver;
|
|
28796
28831
|
var _animationDriver_View;
|
|
28797
28832
|
var AnimatedView = (_animationDriver_View = animationDriver.View) !== null && _animationDriver_View !== void 0 ? _animationDriver_View : View;
|
|
@@ -28850,7 +28885,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28850
28885
|
}
|
|
28851
28886
|
var animateTo = useEvent(function(position2, animationOverride) {
|
|
28852
28887
|
if (frameSize === 0) return;
|
|
28853
|
-
var toValue = isHidden || position2 === -1 ?
|
|
28888
|
+
var toValue = isHidden || position2 === -1 ? effScreenSize : activePositions[position2];
|
|
28854
28889
|
if (at.current === toValue) return;
|
|
28855
28890
|
at.current = toValue;
|
|
28856
28891
|
stopSpring();
|
|
@@ -28897,6 +28932,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28897
28932
|
return;
|
|
28898
28933
|
}
|
|
28899
28934
|
if (disableAnimation) return;
|
|
28935
|
+
if (isDraggingRef.current) return;
|
|
28900
28936
|
if (!frameSize || !screenSize || isHidden || hasntMeasured && !open) return;
|
|
28901
28937
|
animateTo(position);
|
|
28902
28938
|
if (position === -1) {
|
|
@@ -28933,7 +28969,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28933
28969
|
if (disableDrag) return;
|
|
28934
28970
|
if (!frameSize) return;
|
|
28935
28971
|
if (isShowingInnerSheet) return;
|
|
28936
|
-
var minY =
|
|
28972
|
+
var minY = activePositions[0];
|
|
28937
28973
|
scrollBridge.paneMinY = minY;
|
|
28938
28974
|
var startY = at.current;
|
|
28939
28975
|
function setPanning(val) {
|
|
@@ -28949,8 +28985,8 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28949
28985
|
var end = at.current + frameSize * vy * .2;
|
|
28950
28986
|
var closestPoint = 0;
|
|
28951
28987
|
var dist = Number.POSITIVE_INFINITY;
|
|
28952
|
-
for (var i = 0; i <
|
|
28953
|
-
var position2 =
|
|
28988
|
+
for (var i = 0; i < activePositions.length; i++) {
|
|
28989
|
+
var position2 = activePositions[i];
|
|
28954
28990
|
var curDist = end > position2 ? end - position2 : position2 - end;
|
|
28955
28991
|
if (curDist < dist) {
|
|
28956
28992
|
dist = curDist;
|
|
@@ -28971,6 +29007,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28971
29007
|
var { dy } = param;
|
|
28972
29008
|
function getShouldSet() {
|
|
28973
29009
|
if (e.target === providerProps.handleRef.current) return true;
|
|
29010
|
+
if (scrollBridge.scrollNodeTouched) return false;
|
|
28974
29011
|
if (scrollBridge.hasScrollableContent === true) {
|
|
28975
29012
|
if (scrollBridge.scrollLock) return false;
|
|
28976
29013
|
var isScrolled = scrollBridge.y !== 0;
|
|
@@ -28993,6 +29030,10 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28993
29030
|
startY = at.current;
|
|
28994
29031
|
};
|
|
28995
29032
|
var isExternalDrag = false;
|
|
29033
|
+
scrollBridge.startPanDrag = function() {
|
|
29034
|
+
isExternalDrag = true;
|
|
29035
|
+
grant();
|
|
29036
|
+
};
|
|
28996
29037
|
scrollBridge.drag = function(dy) {
|
|
28997
29038
|
if (!isExternalDrag) {
|
|
28998
29039
|
isExternalDrag = true;
|
|
@@ -29027,7 +29068,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29027
29068
|
isShowingInnerSheet,
|
|
29028
29069
|
animateTo,
|
|
29029
29070
|
frameSize,
|
|
29030
|
-
|
|
29071
|
+
activePositions,
|
|
29031
29072
|
setPosition
|
|
29032
29073
|
]);
|
|
29033
29074
|
react$1.default.useEffect(function() {
|
|
@@ -29050,7 +29091,11 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29050
29091
|
animateTo(position);
|
|
29051
29092
|
}, [isDragging]);
|
|
29052
29093
|
react$1.default.useEffect(function() {
|
|
29053
|
-
if (!open && isKeyboardVisible)
|
|
29094
|
+
if (!open && isKeyboardVisible) {
|
|
29095
|
+
dismissKeyboard();
|
|
29096
|
+
pauseKeyboardHandler.current = false;
|
|
29097
|
+
flushPendingHide();
|
|
29098
|
+
}
|
|
29054
29099
|
}, [open]);
|
|
29055
29100
|
var { panGesture, panGestureRef, gestureHandlerEnabled } = useGestureHandlerPan({
|
|
29056
29101
|
positions: activePositions,
|
|
@@ -29072,20 +29117,41 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29072
29117
|
},
|
|
29073
29118
|
pauseKeyboardHandler
|
|
29074
29119
|
});
|
|
29120
|
+
var ignoreLayoutForKeyboard = useEvent(function() {
|
|
29121
|
+
return false;
|
|
29122
|
+
});
|
|
29123
|
+
var shouldSeedKbFrame = useEvent(function() {
|
|
29124
|
+
return isWebKbSheet && !hasCleanKbBaseline.current && !seedSettled.current && ignoreLayoutForKeyboard();
|
|
29125
|
+
});
|
|
29126
|
+
var shouldSeedKbScreen = useEvent(function() {
|
|
29127
|
+
return isWebKbSheet && !hasCleanKbBaseline.current && ignoreLayoutForKeyboard();
|
|
29128
|
+
});
|
|
29075
29129
|
var handleAnimationViewLayout = useEvent(function(e) {
|
|
29076
29130
|
var _e_nativeEvent;
|
|
29077
29131
|
if (!open && stableFrameSize.current !== 0) return;
|
|
29132
|
+
var seeding = shouldSeedKbFrame();
|
|
29133
|
+
if (!seeding && ignoreLayoutForKeyboard()) return;
|
|
29078
29134
|
var layoutHeight = (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height;
|
|
29079
|
-
var next = modal ? Math.min(layoutHeight,
|
|
29135
|
+
var next = modal || seeding ? Math.min(layoutHeight, getStableViewportHeight()) : layoutHeight;
|
|
29080
29136
|
if (!next) return;
|
|
29081
|
-
|
|
29137
|
+
var rounded = Math.round(next);
|
|
29138
|
+
if (seeding) {
|
|
29139
|
+
if (rounded > stableKbGeom.current.frame) stableKbGeom.current.frame = rounded;
|
|
29140
|
+
else if (stableKbGeom.current.frame > 0) seedSettled.current = true;
|
|
29141
|
+
}
|
|
29142
|
+
setFrameSize(rounded);
|
|
29082
29143
|
});
|
|
29083
29144
|
var handleMaxContentViewLayout = react$1.default.useCallback(function(e) {
|
|
29084
29145
|
var _e_nativeEvent;
|
|
29085
|
-
|
|
29146
|
+
if (shouldSeedKbScreen()) {
|
|
29147
|
+
setMaxContentSize(Math.round(getStableViewportHeight()));
|
|
29148
|
+
return;
|
|
29149
|
+
}
|
|
29150
|
+
if (ignoreLayoutForKeyboard()) return;
|
|
29151
|
+
var next = Math.min((_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, getStableViewportHeight());
|
|
29086
29152
|
if (!next) return;
|
|
29087
|
-
setMaxContentSize(next);
|
|
29088
|
-
}, []);
|
|
29153
|
+
setMaxContentSize(Math.round(next));
|
|
29154
|
+
}, [ignoreLayoutForKeyboard, shouldSeedKbScreen]);
|
|
29089
29155
|
var animatedStyle = useAnimatedNumberStyle(animatedNumber, react$1.default.useCallback(function(val) {
|
|
29090
29156
|
"worklet";
|
|
29091
29157
|
return { transform: [{ translateY: frameSize === 0 ? hiddenSize : val }] };
|
|
@@ -29108,6 +29174,9 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29108
29174
|
value: nextParentContext,
|
|
29109
29175
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SheetProvider, _objectSpread2(_objectSpread2({}, providerProps), {}, {
|
|
29110
29176
|
keyboardOccludedHeight,
|
|
29177
|
+
isKeyboardVisible,
|
|
29178
|
+
keyboardStableFrameHeight,
|
|
29179
|
+
isKeyboardSeeding: seedingKbBaseline,
|
|
29111
29180
|
setHasScrollView,
|
|
29112
29181
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(GestureSheetProvider, {
|
|
29113
29182
|
isDragging,
|
|
@@ -29338,6 +29407,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29338
29407
|
var gestureContext = useGestureSheetContext();
|
|
29339
29408
|
var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
|
|
29340
29409
|
var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);
|
|
29410
|
+
var isKeyboardVisible = context.isKeyboardVisible === true || false;
|
|
29341
29411
|
var [scrollEnabled] = useControllableState({
|
|
29342
29412
|
prop: scrollEnabledProp,
|
|
29343
29413
|
defaultProp: true
|
|
@@ -29346,12 +29416,17 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29346
29416
|
var [hasScrollableContent, setHasScrollableContent] = (0, react$1.useState)(true);
|
|
29347
29417
|
var parentHeight = (0, react$1.useRef)(0);
|
|
29348
29418
|
var contentHeight = (0, react$1.useRef)(0);
|
|
29349
|
-
var
|
|
29419
|
+
var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);
|
|
29350
29420
|
var fitSizingStyle = hasFit ? {
|
|
29351
29421
|
flex: void 0,
|
|
29352
|
-
height:
|
|
29422
|
+
height: void 0,
|
|
29353
29423
|
maxHeight: screenSize || void 0
|
|
29354
29424
|
} : { flex: 1 };
|
|
29425
|
+
var isKeyboardSeeding = context.isKeyboardSeeding === true;
|
|
29426
|
+
var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? isKeyboardSeeding ? { maxHeight: frozenFrameHeight } : {
|
|
29427
|
+
height: frozenFrameHeight,
|
|
29428
|
+
maxHeight: frozenFrameHeight
|
|
29429
|
+
} : null;
|
|
29355
29430
|
var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;
|
|
29356
29431
|
var { ScrollView: RNGHScrollView } = getGestureHandlerState();
|
|
29357
29432
|
var useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;
|
|
@@ -29396,6 +29471,9 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29396
29471
|
var updateScrollable = function() {
|
|
29397
29472
|
if (parentHeight.current && contentHeight.current) setHasScrollableContent(contentHeight.current > parentHeight.current);
|
|
29398
29473
|
};
|
|
29474
|
+
var recordFitHeight = function(height) {
|
|
29475
|
+
parentHeight.current = height;
|
|
29476
|
+
};
|
|
29399
29477
|
(0, react$1.useEffect)(function() {
|
|
29400
29478
|
scrollBridge.hasScrollableContent = hasScrollableContent;
|
|
29401
29479
|
}, [hasScrollableContent]);
|
|
@@ -29420,14 +29498,14 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29420
29498
|
width: "100%"
|
|
29421
29499
|
})]
|
|
29422
29500
|
});
|
|
29423
|
-
if (useRNGHScrollView && RNGHScrollView && panGestureRef) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RNGHScrollView, _objectSpread2(_objectSpread2({
|
|
29501
|
+
if (useRNGHScrollView && RNGHScrollView && panGestureRef) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RNGHScrollView, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
29424
29502
|
ref: composeRefs(scrollRef, ref),
|
|
29425
29503
|
style: fitSizingStyle,
|
|
29426
29504
|
scrollEventThrottle: 1,
|
|
29427
29505
|
scrollEnabled,
|
|
29428
29506
|
simultaneousHandlers: [panGestureRef],
|
|
29429
29507
|
onLayout: function(e) {
|
|
29430
|
-
|
|
29508
|
+
recordFitHeight(Math.ceil(e.nativeEvent.layout.height));
|
|
29431
29509
|
updateScrollable();
|
|
29432
29510
|
},
|
|
29433
29511
|
onScroll: function(e) {
|
|
@@ -29454,10 +29532,10 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29454
29532
|
bounces: false,
|
|
29455
29533
|
keyboardShouldPersistTaps: "always",
|
|
29456
29534
|
keyboardDismissMode: "none"
|
|
29457
|
-
}, props), {}, { children: contentWrapper }));
|
|
29458
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollView, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
29535
|
+
}, props), keyboardFrozenOverride), {}, { children: contentWrapper }));
|
|
29536
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollView, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
29459
29537
|
onLayout: function(e) {
|
|
29460
|
-
|
|
29538
|
+
recordFitHeight(Math.ceil(e.nativeEvent.layout.height));
|
|
29461
29539
|
updateScrollable();
|
|
29462
29540
|
},
|
|
29463
29541
|
ref: composeRefs(scrollRef, ref)
|
|
@@ -29472,7 +29550,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29472
29550
|
onScroll === null || onScroll === void 0 || onScroll(e);
|
|
29473
29551
|
},
|
|
29474
29552
|
contentContainerStyle: { minHeight: "100%" }
|
|
29475
|
-
}, gestureProps), props), {}, { children: contentWrapper }));
|
|
29553
|
+
}, gestureProps), props), keyboardFrozenOverride), {}, { children: contentWrapper }));
|
|
29476
29554
|
});
|
|
29477
29555
|
//#endregion
|
|
29478
29556
|
//#region ../sheet/dist/esm/useSheetOffscreenSize.native.js
|
package/dist/test.cjs
CHANGED
|
@@ -26620,6 +26620,7 @@ var closeLastOpenedPopover = function() {
|
|
|
26620
26620
|
};
|
|
26621
26621
|
var PopoverContext = createStyledContext({}, "Popover__");
|
|
26622
26622
|
var PopoverZIndexContext = /* @__PURE__ */ react$1.createContext(void 0);
|
|
26623
|
+
var PopoverAdaptHiddenContext = /* @__PURE__ */ react$1.createContext(true);
|
|
26623
26624
|
var PopoverTriggerContext = createStyledContext({}, "PopoverTrigger__");
|
|
26624
26625
|
var usePopoverContext = PopoverContext.useStyledContext;
|
|
26625
26626
|
var usePopoverTriggerContext = PopoverTriggerContext.useStyledContext;
|
|
@@ -26795,8 +26796,11 @@ var PopoverContent = PopperContentFrame.styleable(function PopoverContent2(props
|
|
|
26795
26796
|
useIsomorphicLayoutEffect(function() {
|
|
26796
26797
|
if (open && isFullyHidden) setIsFullyHidden(false);
|
|
26797
26798
|
}, [open, isFullyHidden]);
|
|
26799
|
+
var isAdaptFullyHidden = react$1.useContext(PopoverAdaptHiddenContext);
|
|
26798
26800
|
if (!context.keepChildrenMounted) {
|
|
26799
|
-
if (
|
|
26801
|
+
if (context.breakpointActive) {
|
|
26802
|
+
if (!open && isAdaptFullyHidden) return null;
|
|
26803
|
+
} else if (isFullyHidden && !open) return null;
|
|
26800
26804
|
}
|
|
26801
26805
|
var _contentImplProps_pointerEvents;
|
|
26802
26806
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverPortal, {
|
|
@@ -27081,6 +27085,8 @@ var PopoverSheetController = function(param) {
|
|
|
27081
27085
|
var showSheet = useShowPopoverSheet(context, open);
|
|
27082
27086
|
var breakpointActive = context === null || context === void 0 ? void 0 : context.breakpointActive;
|
|
27083
27087
|
var getShowSheet = useGet(showSheet);
|
|
27088
|
+
var [isAdaptFullyHidden, setIsAdaptFullyHidden] = react$1.useState(!open);
|
|
27089
|
+
if (open && isAdaptFullyHidden) setIsAdaptFullyHidden(false);
|
|
27084
27090
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SheetController, {
|
|
27085
27091
|
onOpenChange: function(val) {
|
|
27086
27092
|
if (getShowSheet()) {
|
|
@@ -27088,9 +27094,16 @@ var PopoverSheetController = function(param) {
|
|
|
27088
27094
|
(_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 || _props_onOpenChange.call(props, val);
|
|
27089
27095
|
}
|
|
27090
27096
|
},
|
|
27097
|
+
onAnimationComplete: react$1.useCallback(function(param2) {
|
|
27098
|
+
var { open: isOpen } = param2;
|
|
27099
|
+
if (!isOpen) setIsAdaptFullyHidden(true);
|
|
27100
|
+
}, []),
|
|
27091
27101
|
open,
|
|
27092
27102
|
hidden: !breakpointActive,
|
|
27093
|
-
children:
|
|
27103
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverAdaptHiddenContext.Provider, {
|
|
27104
|
+
value: isAdaptFullyHidden,
|
|
27105
|
+
children: props.children
|
|
27106
|
+
})
|
|
27094
27107
|
});
|
|
27095
27108
|
};
|
|
27096
27109
|
var useShowPopoverSheet = function(context, open) {
|
|
@@ -28432,7 +28445,10 @@ function setupNativeSheet(platform, RNIOSModal) {
|
|
|
28432
28445
|
}
|
|
28433
28446
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SheetProvider, _objectSpread2(_objectSpread2({
|
|
28434
28447
|
setHasScrollView: emptyFn,
|
|
28435
|
-
keyboardOccludedHeight: 0
|
|
28448
|
+
keyboardOccludedHeight: 0,
|
|
28449
|
+
isKeyboardVisible: false,
|
|
28450
|
+
keyboardStableFrameHeight: 0,
|
|
28451
|
+
isKeyboardSeeding: false
|
|
28436
28452
|
}, providerProps), {}, {
|
|
28437
28453
|
onlyShowFrame: true,
|
|
28438
28454
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetView, {
|
|
@@ -28779,6 +28795,9 @@ function getSafeAreaTopInset() {
|
|
|
28779
28795
|
return _cachedSafeAreaTop;
|
|
28780
28796
|
}
|
|
28781
28797
|
var relativeDimensionTo = "screen";
|
|
28798
|
+
function getStableViewportHeight() {
|
|
28799
|
+
return Dimensions.get(relativeDimensionTo).height;
|
|
28800
|
+
}
|
|
28782
28801
|
var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(function SheetImplementationCustom2(props, forwardedRef) {
|
|
28783
28802
|
var parentSheet = react$1.default.useContext(ParentSheetContext);
|
|
28784
28803
|
var { transition, transitionConfig: transitionConfigProp, modal = false, zIndex = parentSheet.zIndex + 1, moveOnKeyboardChange = false, unmountChildrenWhenHidden = false, portalProps, containerComponent: ContainerComponent = react$1.default.Fragment, onAnimationComplete } = props;
|
|
@@ -28806,22 +28825,37 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28806
28825
|
var onInnerSheet = react$1.default.useCallback(function(hasChild) {
|
|
28807
28826
|
setIsShowingInnerSheet(hasChild);
|
|
28808
28827
|
}, []);
|
|
28828
|
+
var { keyboardHeight, isKeyboardVisible, dismissKeyboard, pauseKeyboardHandler, flushPendingHide } = useKeyboardControllerSheet({ enabled: Boolean(moveOnKeyboardChange) });
|
|
28809
28829
|
var stableFrameSize = react$1.default.useRef(frameSize);
|
|
28810
28830
|
react$1.default.useEffect(function() {
|
|
28811
28831
|
if (open && frameSize) stableFrameSize.current = frameSize;
|
|
28812
28832
|
}, [open, frameSize]);
|
|
28813
|
-
var
|
|
28833
|
+
var isWebKbSheet = false;
|
|
28834
|
+
var hasCleanKbBaseline = react$1.default.useRef(false);
|
|
28835
|
+
var seedSettled = react$1.default.useRef(false);
|
|
28836
|
+
var stableKbGeom = react$1.default.useRef({
|
|
28837
|
+
frame: 0,
|
|
28838
|
+
screen: 0
|
|
28839
|
+
});
|
|
28840
|
+
if (frameSize > 0 && screenSize > 0) {
|
|
28841
|
+
stableKbGeom.current.frame = frameSize;
|
|
28842
|
+
stableKbGeom.current.screen = screenSize;
|
|
28843
|
+
hasCleanKbBaseline.current = true;
|
|
28844
|
+
} else if (isWebKbSheet && isKeyboardVisible && !hasCleanKbBaseline.current && screenSize > 0) stableKbGeom.current.screen = Math.max(stableKbGeom.current.screen, screenSize);
|
|
28845
|
+
var seedingKbBaseline = isWebKbSheet && isKeyboardVisible && !hasCleanKbBaseline.current && !seedSettled.current;
|
|
28846
|
+
var freezeForKb = isWebKbSheet && isKeyboardVisible && stableKbGeom.current.frame > 0;
|
|
28847
|
+
var effScreenSize = freezeForKb ? stableKbGeom.current.screen : screenSize;
|
|
28848
|
+
var effectiveFrameSize = freezeForKb ? stableKbGeom.current.frame : open ? frameSize : stableFrameSize.current || frameSize;
|
|
28814
28849
|
var positions = react$1.default.useMemo(function() {
|
|
28815
28850
|
return snapPoints.map(function(point) {
|
|
28816
|
-
return getYPositions(snapPointsMode, point,
|
|
28851
|
+
return getYPositions(snapPointsMode, point, effScreenSize, effectiveFrameSize);
|
|
28817
28852
|
});
|
|
28818
28853
|
}, [
|
|
28819
|
-
|
|
28854
|
+
effScreenSize,
|
|
28820
28855
|
effectiveFrameSize,
|
|
28821
28856
|
snapPoints,
|
|
28822
28857
|
snapPointsMode
|
|
28823
28858
|
]);
|
|
28824
|
-
var { keyboardHeight, isKeyboardVisible, dismissKeyboard, pauseKeyboardHandler, flushPendingHide } = useKeyboardControllerSheet({ enabled: Boolean(moveOnKeyboardChange) });
|
|
28825
28859
|
var [isDragging, setIsDragging_] = react$1.default.useState(false);
|
|
28826
28860
|
var isDraggingRef = react$1.default.useRef(false);
|
|
28827
28861
|
var setIsDragging = react$1.default.useCallback(function(val) {
|
|
@@ -28851,13 +28885,14 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28851
28885
|
screenSize,
|
|
28852
28886
|
isDragging
|
|
28853
28887
|
]);
|
|
28854
|
-
var keyboardOccludedHeight = getKeyboardOccludedHeight({
|
|
28855
|
-
frameSize,
|
|
28888
|
+
var keyboardOccludedHeight = seedingKbBaseline ? 0 : getKeyboardOccludedHeight({
|
|
28889
|
+
frameSize: effectiveFrameSize,
|
|
28856
28890
|
isKeyboardVisible,
|
|
28857
28891
|
keyboardHeight,
|
|
28858
|
-
screenSize,
|
|
28892
|
+
screenSize: effScreenSize,
|
|
28859
28893
|
sheetY: position >= 0 ? activePositions[position] : void 0
|
|
28860
28894
|
});
|
|
28895
|
+
var keyboardStableFrameHeight = !isWebKbSheet ? 0 : seedingKbBaseline ? stableKbGeom.current.screen || screenSize : stableKbGeom.current.frame > 0 ? stableKbGeom.current.frame : 0;
|
|
28861
28896
|
var { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver;
|
|
28862
28897
|
var _animationDriver_View;
|
|
28863
28898
|
var AnimatedView = (_animationDriver_View = animationDriver.View) !== null && _animationDriver_View !== void 0 ? _animationDriver_View : View;
|
|
@@ -28916,7 +28951,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28916
28951
|
}
|
|
28917
28952
|
var animateTo = useEvent(function(position2, animationOverride) {
|
|
28918
28953
|
if (frameSize === 0) return;
|
|
28919
|
-
var toValue = isHidden || position2 === -1 ?
|
|
28954
|
+
var toValue = isHidden || position2 === -1 ? effScreenSize : activePositions[position2];
|
|
28920
28955
|
if (at.current === toValue) return;
|
|
28921
28956
|
at.current = toValue;
|
|
28922
28957
|
stopSpring();
|
|
@@ -28963,6 +28998,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28963
28998
|
return;
|
|
28964
28999
|
}
|
|
28965
29000
|
if (disableAnimation) return;
|
|
29001
|
+
if (isDraggingRef.current) return;
|
|
28966
29002
|
if (!frameSize || !screenSize || isHidden || hasntMeasured && !open) return;
|
|
28967
29003
|
animateTo(position);
|
|
28968
29004
|
if (position === -1) {
|
|
@@ -28999,7 +29035,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
28999
29035
|
if (disableDrag) return;
|
|
29000
29036
|
if (!frameSize) return;
|
|
29001
29037
|
if (isShowingInnerSheet) return;
|
|
29002
|
-
var minY =
|
|
29038
|
+
var minY = activePositions[0];
|
|
29003
29039
|
scrollBridge.paneMinY = minY;
|
|
29004
29040
|
var startY = at.current;
|
|
29005
29041
|
function setPanning(val) {
|
|
@@ -29015,8 +29051,8 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29015
29051
|
var end = at.current + frameSize * vy * .2;
|
|
29016
29052
|
var closestPoint = 0;
|
|
29017
29053
|
var dist = Number.POSITIVE_INFINITY;
|
|
29018
|
-
for (var i = 0; i <
|
|
29019
|
-
var position2 =
|
|
29054
|
+
for (var i = 0; i < activePositions.length; i++) {
|
|
29055
|
+
var position2 = activePositions[i];
|
|
29020
29056
|
var curDist = end > position2 ? end - position2 : position2 - end;
|
|
29021
29057
|
if (curDist < dist) {
|
|
29022
29058
|
dist = curDist;
|
|
@@ -29037,6 +29073,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29037
29073
|
var { dy } = param;
|
|
29038
29074
|
function getShouldSet() {
|
|
29039
29075
|
if (e.target === providerProps.handleRef.current) return true;
|
|
29076
|
+
if (scrollBridge.scrollNodeTouched) return false;
|
|
29040
29077
|
if (scrollBridge.hasScrollableContent === true) {
|
|
29041
29078
|
if (scrollBridge.scrollLock) return false;
|
|
29042
29079
|
var isScrolled = scrollBridge.y !== 0;
|
|
@@ -29059,6 +29096,10 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29059
29096
|
startY = at.current;
|
|
29060
29097
|
};
|
|
29061
29098
|
var isExternalDrag = false;
|
|
29099
|
+
scrollBridge.startPanDrag = function() {
|
|
29100
|
+
isExternalDrag = true;
|
|
29101
|
+
grant();
|
|
29102
|
+
};
|
|
29062
29103
|
scrollBridge.drag = function(dy) {
|
|
29063
29104
|
if (!isExternalDrag) {
|
|
29064
29105
|
isExternalDrag = true;
|
|
@@ -29093,7 +29134,7 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29093
29134
|
isShowingInnerSheet,
|
|
29094
29135
|
animateTo,
|
|
29095
29136
|
frameSize,
|
|
29096
|
-
|
|
29137
|
+
activePositions,
|
|
29097
29138
|
setPosition
|
|
29098
29139
|
]);
|
|
29099
29140
|
react$1.default.useEffect(function() {
|
|
@@ -29116,7 +29157,11 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29116
29157
|
animateTo(position);
|
|
29117
29158
|
}, [isDragging]);
|
|
29118
29159
|
react$1.default.useEffect(function() {
|
|
29119
|
-
if (!open && isKeyboardVisible)
|
|
29160
|
+
if (!open && isKeyboardVisible) {
|
|
29161
|
+
dismissKeyboard();
|
|
29162
|
+
pauseKeyboardHandler.current = false;
|
|
29163
|
+
flushPendingHide();
|
|
29164
|
+
}
|
|
29120
29165
|
}, [open]);
|
|
29121
29166
|
var { panGesture, panGestureRef, gestureHandlerEnabled } = useGestureHandlerPan({
|
|
29122
29167
|
positions: activePositions,
|
|
@@ -29138,20 +29183,41 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29138
29183
|
},
|
|
29139
29184
|
pauseKeyboardHandler
|
|
29140
29185
|
});
|
|
29186
|
+
var ignoreLayoutForKeyboard = useEvent(function() {
|
|
29187
|
+
return false;
|
|
29188
|
+
});
|
|
29189
|
+
var shouldSeedKbFrame = useEvent(function() {
|
|
29190
|
+
return isWebKbSheet && !hasCleanKbBaseline.current && !seedSettled.current && ignoreLayoutForKeyboard();
|
|
29191
|
+
});
|
|
29192
|
+
var shouldSeedKbScreen = useEvent(function() {
|
|
29193
|
+
return isWebKbSheet && !hasCleanKbBaseline.current && ignoreLayoutForKeyboard();
|
|
29194
|
+
});
|
|
29141
29195
|
var handleAnimationViewLayout = useEvent(function(e) {
|
|
29142
29196
|
var _e_nativeEvent;
|
|
29143
29197
|
if (!open && stableFrameSize.current !== 0) return;
|
|
29198
|
+
var seeding = shouldSeedKbFrame();
|
|
29199
|
+
if (!seeding && ignoreLayoutForKeyboard()) return;
|
|
29144
29200
|
var layoutHeight = (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height;
|
|
29145
|
-
var next = modal ? Math.min(layoutHeight,
|
|
29201
|
+
var next = modal || seeding ? Math.min(layoutHeight, getStableViewportHeight()) : layoutHeight;
|
|
29146
29202
|
if (!next) return;
|
|
29147
|
-
|
|
29203
|
+
var rounded = Math.round(next);
|
|
29204
|
+
if (seeding) {
|
|
29205
|
+
if (rounded > stableKbGeom.current.frame) stableKbGeom.current.frame = rounded;
|
|
29206
|
+
else if (stableKbGeom.current.frame > 0) seedSettled.current = true;
|
|
29207
|
+
}
|
|
29208
|
+
setFrameSize(rounded);
|
|
29148
29209
|
});
|
|
29149
29210
|
var handleMaxContentViewLayout = react$1.default.useCallback(function(e) {
|
|
29150
29211
|
var _e_nativeEvent;
|
|
29151
|
-
|
|
29212
|
+
if (shouldSeedKbScreen()) {
|
|
29213
|
+
setMaxContentSize(Math.round(getStableViewportHeight()));
|
|
29214
|
+
return;
|
|
29215
|
+
}
|
|
29216
|
+
if (ignoreLayoutForKeyboard()) return;
|
|
29217
|
+
var next = Math.min((_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, getStableViewportHeight());
|
|
29152
29218
|
if (!next) return;
|
|
29153
|
-
setMaxContentSize(next);
|
|
29154
|
-
}, []);
|
|
29219
|
+
setMaxContentSize(Math.round(next));
|
|
29220
|
+
}, [ignoreLayoutForKeyboard, shouldSeedKbScreen]);
|
|
29155
29221
|
var animatedStyle = useAnimatedNumberStyle(animatedNumber, react$1.default.useCallback(function(val) {
|
|
29156
29222
|
"worklet";
|
|
29157
29223
|
return { transform: [{ translateY: frameSize === 0 ? hiddenSize : val }] };
|
|
@@ -29174,6 +29240,9 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
|
|
|
29174
29240
|
value: nextParentContext,
|
|
29175
29241
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SheetProvider, _objectSpread2(_objectSpread2({}, providerProps), {}, {
|
|
29176
29242
|
keyboardOccludedHeight,
|
|
29243
|
+
isKeyboardVisible,
|
|
29244
|
+
keyboardStableFrameHeight,
|
|
29245
|
+
isKeyboardSeeding: seedingKbBaseline,
|
|
29177
29246
|
setHasScrollView,
|
|
29178
29247
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(GestureSheetProvider, {
|
|
29179
29248
|
isDragging,
|
|
@@ -29404,6 +29473,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29404
29473
|
var gestureContext = useGestureSheetContext();
|
|
29405
29474
|
var { scrollBridge, setHasScrollView, hasFit, screenSize } = context;
|
|
29406
29475
|
var keyboardOccludedHeight = Math.max(0, context.keyboardOccludedHeight || 0);
|
|
29476
|
+
var isKeyboardVisible = context.isKeyboardVisible === true || false;
|
|
29407
29477
|
var [scrollEnabled] = useControllableState({
|
|
29408
29478
|
prop: scrollEnabledProp,
|
|
29409
29479
|
defaultProp: true
|
|
@@ -29412,12 +29482,17 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29412
29482
|
var [hasScrollableContent, setHasScrollableContent] = (0, react$1.useState)(true);
|
|
29413
29483
|
var parentHeight = (0, react$1.useRef)(0);
|
|
29414
29484
|
var contentHeight = (0, react$1.useRef)(0);
|
|
29415
|
-
var
|
|
29485
|
+
var frozenFrameHeight = Math.max(0, context.keyboardStableFrameHeight || 0);
|
|
29416
29486
|
var fitSizingStyle = hasFit ? {
|
|
29417
29487
|
flex: void 0,
|
|
29418
|
-
height:
|
|
29488
|
+
height: void 0,
|
|
29419
29489
|
maxHeight: screenSize || void 0
|
|
29420
29490
|
} : { flex: 1 };
|
|
29491
|
+
var isKeyboardSeeding = context.isKeyboardSeeding === true;
|
|
29492
|
+
var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? isKeyboardSeeding ? { maxHeight: frozenFrameHeight } : {
|
|
29493
|
+
height: frozenFrameHeight,
|
|
29494
|
+
maxHeight: frozenFrameHeight
|
|
29495
|
+
} : null;
|
|
29421
29496
|
var panGestureRef = gestureContext === null || gestureContext === void 0 ? void 0 : gestureContext.panGestureRef;
|
|
29422
29497
|
var { ScrollView: RNGHScrollView } = getGestureHandlerState();
|
|
29423
29498
|
var useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;
|
|
@@ -29462,6 +29537,9 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29462
29537
|
var updateScrollable = function() {
|
|
29463
29538
|
if (parentHeight.current && contentHeight.current) setHasScrollableContent(contentHeight.current > parentHeight.current);
|
|
29464
29539
|
};
|
|
29540
|
+
var recordFitHeight = function(height) {
|
|
29541
|
+
parentHeight.current = height;
|
|
29542
|
+
};
|
|
29465
29543
|
(0, react$1.useEffect)(function() {
|
|
29466
29544
|
scrollBridge.hasScrollableContent = hasScrollableContent;
|
|
29467
29545
|
}, [hasScrollableContent]);
|
|
@@ -29486,14 +29564,14 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29486
29564
|
width: "100%"
|
|
29487
29565
|
})]
|
|
29488
29566
|
});
|
|
29489
|
-
if (useRNGHScrollView && RNGHScrollView && panGestureRef) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RNGHScrollView, _objectSpread2(_objectSpread2({
|
|
29567
|
+
if (useRNGHScrollView && RNGHScrollView && panGestureRef) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RNGHScrollView, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
29490
29568
|
ref: composeRefs(scrollRef, ref),
|
|
29491
29569
|
style: fitSizingStyle,
|
|
29492
29570
|
scrollEventThrottle: 1,
|
|
29493
29571
|
scrollEnabled,
|
|
29494
29572
|
simultaneousHandlers: [panGestureRef],
|
|
29495
29573
|
onLayout: function(e) {
|
|
29496
|
-
|
|
29574
|
+
recordFitHeight(Math.ceil(e.nativeEvent.layout.height));
|
|
29497
29575
|
updateScrollable();
|
|
29498
29576
|
},
|
|
29499
29577
|
onScroll: function(e) {
|
|
@@ -29520,10 +29598,10 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29520
29598
|
bounces: false,
|
|
29521
29599
|
keyboardShouldPersistTaps: "always",
|
|
29522
29600
|
keyboardDismissMode: "none"
|
|
29523
|
-
}, props), {}, { children: contentWrapper }));
|
|
29524
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollView, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
29601
|
+
}, props), keyboardFrozenOverride), {}, { children: contentWrapper }));
|
|
29602
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScrollView, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
29525
29603
|
onLayout: function(e) {
|
|
29526
|
-
|
|
29604
|
+
recordFitHeight(Math.ceil(e.nativeEvent.layout.height));
|
|
29527
29605
|
updateScrollable();
|
|
29528
29606
|
},
|
|
29529
29607
|
ref: composeRefs(scrollRef, ref)
|
|
@@ -29538,7 +29616,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
|
|
|
29538
29616
|
onScroll === null || onScroll === void 0 || onScroll(e);
|
|
29539
29617
|
},
|
|
29540
29618
|
contentContainerStyle: { minHeight: "100%" }
|
|
29541
|
-
}, gestureProps), props), {}, { children: contentWrapper }));
|
|
29619
|
+
}, gestureProps), props), keyboardFrozenOverride), {}, { children: contentWrapper }));
|
|
29542
29620
|
});
|
|
29543
29621
|
//#endregion
|
|
29544
29622
|
//#region ../sheet/dist/esm/useSheetOffscreenSize.native.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tamagui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
|
|
5
5
|
"description": "Style and UI for React (web and native) meet an optimizing compiler",
|
|
6
6
|
"repository": {
|
|
@@ -77,72 +77,72 @@
|
|
|
77
77
|
"check-circular-deps": "npx madge --circular ./src/index.ts"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@tamagui/accordion": "2.
|
|
81
|
-
"@tamagui/adapt": "2.
|
|
82
|
-
"@tamagui/alert-dialog": "2.
|
|
83
|
-
"@tamagui/animate": "2.
|
|
84
|
-
"@tamagui/animate-presence": "2.
|
|
85
|
-
"@tamagui/avatar": "2.
|
|
86
|
-
"@tamagui/button": "2.
|
|
87
|
-
"@tamagui/card": "2.
|
|
88
|
-
"@tamagui/checkbox": "2.
|
|
89
|
-
"@tamagui/collapsible": "2.
|
|
90
|
-
"@tamagui/compose-refs": "2.
|
|
91
|
-
"@tamagui/constants": "2.
|
|
92
|
-
"@tamagui/context-menu": "2.
|
|
93
|
-
"@tamagui/core": "2.
|
|
94
|
-
"@tamagui/create-context": "2.
|
|
95
|
-
"@tamagui/create-menu": "2.
|
|
96
|
-
"@tamagui/dialog": "2.
|
|
97
|
-
"@tamagui/element": "2.
|
|
98
|
-
"@tamagui/elements": "2.
|
|
99
|
-
"@tamagui/fake-react-native": "2.
|
|
100
|
-
"@tamagui/focusable": "2.
|
|
101
|
-
"@tamagui/form": "2.
|
|
102
|
-
"@tamagui/get-button-sized": "2.
|
|
103
|
-
"@tamagui/get-font-sized": "2.
|
|
104
|
-
"@tamagui/get-token": "2.
|
|
105
|
-
"@tamagui/group": "2.
|
|
106
|
-
"@tamagui/helpers-tamagui": "2.
|
|
107
|
-
"@tamagui/image": "2.
|
|
108
|
-
"@tamagui/input": "2.
|
|
109
|
-
"@tamagui/label": "2.
|
|
110
|
-
"@tamagui/linear-gradient": "2.
|
|
111
|
-
"@tamagui/list-item": "2.
|
|
112
|
-
"@tamagui/menu": "2.
|
|
113
|
-
"@tamagui/polyfill-dev": "2.
|
|
114
|
-
"@tamagui/popover": "2.
|
|
115
|
-
"@tamagui/popper": "2.
|
|
116
|
-
"@tamagui/portal": "2.
|
|
117
|
-
"@tamagui/progress": "2.
|
|
118
|
-
"@tamagui/radio-group": "2.
|
|
119
|
-
"@tamagui/react-native-media-driver": "2.
|
|
120
|
-
"@tamagui/scroll-view": "2.
|
|
121
|
-
"@tamagui/select": "2.
|
|
122
|
-
"@tamagui/separator": "2.
|
|
123
|
-
"@tamagui/shapes": "2.
|
|
124
|
-
"@tamagui/sheet": "2.
|
|
125
|
-
"@tamagui/slider": "2.
|
|
126
|
-
"@tamagui/spacer": "2.
|
|
127
|
-
"@tamagui/spinner": "2.
|
|
128
|
-
"@tamagui/stacks": "2.
|
|
129
|
-
"@tamagui/switch": "2.
|
|
130
|
-
"@tamagui/tabs": "2.
|
|
131
|
-
"@tamagui/text": "2.
|
|
132
|
-
"@tamagui/theme": "2.
|
|
133
|
-
"@tamagui/toast": "2.
|
|
134
|
-
"@tamagui/toggle-group": "2.
|
|
135
|
-
"@tamagui/tooltip": "2.
|
|
136
|
-
"@tamagui/use-controllable-state": "2.
|
|
137
|
-
"@tamagui/use-debounce": "2.
|
|
138
|
-
"@tamagui/use-force-update": "2.
|
|
139
|
-
"@tamagui/use-window-dimensions": "2.
|
|
140
|
-
"@tamagui/visually-hidden": "2.
|
|
141
|
-
"@tamagui/font-size": "2.
|
|
142
|
-
"@tamagui/z-index-stack": "2.
|
|
80
|
+
"@tamagui/accordion": "2.1.0",
|
|
81
|
+
"@tamagui/adapt": "2.1.0",
|
|
82
|
+
"@tamagui/alert-dialog": "2.1.0",
|
|
83
|
+
"@tamagui/animate": "2.1.0",
|
|
84
|
+
"@tamagui/animate-presence": "2.1.0",
|
|
85
|
+
"@tamagui/avatar": "2.1.0",
|
|
86
|
+
"@tamagui/button": "2.1.0",
|
|
87
|
+
"@tamagui/card": "2.1.0",
|
|
88
|
+
"@tamagui/checkbox": "2.1.0",
|
|
89
|
+
"@tamagui/collapsible": "2.1.0",
|
|
90
|
+
"@tamagui/compose-refs": "2.1.0",
|
|
91
|
+
"@tamagui/constants": "2.1.0",
|
|
92
|
+
"@tamagui/context-menu": "2.1.0",
|
|
93
|
+
"@tamagui/core": "2.1.0",
|
|
94
|
+
"@tamagui/create-context": "2.1.0",
|
|
95
|
+
"@tamagui/create-menu": "2.1.0",
|
|
96
|
+
"@tamagui/dialog": "2.1.0",
|
|
97
|
+
"@tamagui/element": "2.1.0",
|
|
98
|
+
"@tamagui/elements": "2.1.0",
|
|
99
|
+
"@tamagui/fake-react-native": "2.1.0",
|
|
100
|
+
"@tamagui/focusable": "2.1.0",
|
|
101
|
+
"@tamagui/form": "2.1.0",
|
|
102
|
+
"@tamagui/get-button-sized": "2.1.0",
|
|
103
|
+
"@tamagui/get-font-sized": "2.1.0",
|
|
104
|
+
"@tamagui/get-token": "2.1.0",
|
|
105
|
+
"@tamagui/group": "2.1.0",
|
|
106
|
+
"@tamagui/helpers-tamagui": "2.1.0",
|
|
107
|
+
"@tamagui/image": "2.1.0",
|
|
108
|
+
"@tamagui/input": "2.1.0",
|
|
109
|
+
"@tamagui/label": "2.1.0",
|
|
110
|
+
"@tamagui/linear-gradient": "2.1.0",
|
|
111
|
+
"@tamagui/list-item": "2.1.0",
|
|
112
|
+
"@tamagui/menu": "2.1.0",
|
|
113
|
+
"@tamagui/polyfill-dev": "2.1.0",
|
|
114
|
+
"@tamagui/popover": "2.1.0",
|
|
115
|
+
"@tamagui/popper": "2.1.0",
|
|
116
|
+
"@tamagui/portal": "2.1.0",
|
|
117
|
+
"@tamagui/progress": "2.1.0",
|
|
118
|
+
"@tamagui/radio-group": "2.1.0",
|
|
119
|
+
"@tamagui/react-native-media-driver": "2.1.0",
|
|
120
|
+
"@tamagui/scroll-view": "2.1.0",
|
|
121
|
+
"@tamagui/select": "2.1.0",
|
|
122
|
+
"@tamagui/separator": "2.1.0",
|
|
123
|
+
"@tamagui/shapes": "2.1.0",
|
|
124
|
+
"@tamagui/sheet": "2.1.0",
|
|
125
|
+
"@tamagui/slider": "2.1.0",
|
|
126
|
+
"@tamagui/spacer": "2.1.0",
|
|
127
|
+
"@tamagui/spinner": "2.1.0",
|
|
128
|
+
"@tamagui/stacks": "2.1.0",
|
|
129
|
+
"@tamagui/switch": "2.1.0",
|
|
130
|
+
"@tamagui/tabs": "2.1.0",
|
|
131
|
+
"@tamagui/text": "2.1.0",
|
|
132
|
+
"@tamagui/theme": "2.1.0",
|
|
133
|
+
"@tamagui/toast": "2.1.0",
|
|
134
|
+
"@tamagui/toggle-group": "2.1.0",
|
|
135
|
+
"@tamagui/tooltip": "2.1.0",
|
|
136
|
+
"@tamagui/use-controllable-state": "2.1.0",
|
|
137
|
+
"@tamagui/use-debounce": "2.1.0",
|
|
138
|
+
"@tamagui/use-force-update": "2.1.0",
|
|
139
|
+
"@tamagui/use-window-dimensions": "2.1.0",
|
|
140
|
+
"@tamagui/visually-hidden": "2.1.0",
|
|
141
|
+
"@tamagui/font-size": "2.1.0",
|
|
142
|
+
"@tamagui/z-index-stack": "2.1.0"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
|
-
"@tamagui/build": "2.
|
|
145
|
+
"@tamagui/build": "2.1.0",
|
|
146
146
|
"react": ">=19",
|
|
147
147
|
"react-native": "0.83.2",
|
|
148
148
|
"react-native-web": "^0.21.0"
|