@tamagui/sheet 2.7.7 → 3.0.0-beta.1093.1
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/cjs/GestureSheetContext.cjs +28 -37
- package/dist/cjs/GestureSheetContext.native.cjs +48 -0
- package/dist/cjs/GestureSheetContext.native.js +29 -37
- package/dist/cjs/GestureSheetContext.native.js.map +1 -1
- package/dist/cjs/Sheet.cjs +220 -99
- package/dist/cjs/Sheet.native.cjs +245 -0
- package/dist/cjs/Sheet.native.js +223 -98
- package/dist/cjs/Sheet.native.js.map +1 -1
- package/dist/cjs/SheetContext.cjs +43 -22
- package/dist/cjs/SheetContext.native.cjs +57 -0
- package/dist/cjs/SheetContext.native.js +44 -22
- package/dist/cjs/SheetContext.native.js.map +1 -1
- package/dist/cjs/SheetController.cjs +49 -56
- package/dist/cjs/SheetController.native.cjs +71 -0
- package/dist/cjs/SheetController.native.js +52 -58
- package/dist/cjs/SheetController.native.js.map +1 -1
- package/dist/cjs/SheetDragSurface.cjs +50 -0
- package/dist/cjs/SheetDragSurface.native.cjs +61 -0
- package/dist/cjs/SheetDragSurface.native.js +63 -0
- package/dist/cjs/SheetDragSurface.native.js.map +1 -0
- package/dist/cjs/SheetImplementationCustom.cjs +664 -610
- package/dist/cjs/SheetImplementationCustom.native.cjs +748 -0
- package/dist/cjs/SheetImplementationCustom.native.js +704 -649
- package/dist/cjs/SheetImplementationCustom.native.js.map +1 -1
- package/dist/cjs/SheetScrollView.cjs +291 -312
- package/dist/cjs/SheetScrollView.native.cjs +326 -0
- package/dist/cjs/SheetScrollView.native.js +299 -319
- package/dist/cjs/SheetScrollView.native.js.map +1 -1
- package/dist/cjs/constants.cjs +21 -21
- package/dist/cjs/constants.native.cjs +36 -0
- package/dist/cjs/constants.native.js +21 -20
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/contexts.cjs +19 -28
- package/dist/cjs/contexts.native.cjs +37 -0
- package/dist/cjs/contexts.native.js +19 -27
- package/dist/cjs/contexts.native.js.map +1 -1
- package/dist/cjs/controller.cjs +16 -18
- package/dist/cjs/controller.native.cjs +31 -0
- package/dist/cjs/controller.native.js +16 -17
- package/dist/cjs/controller.native.js.map +1 -1
- package/dist/cjs/gestureState.cjs +28 -30
- package/dist/cjs/gestureState.native.cjs +53 -0
- package/dist/cjs/gestureState.native.js +29 -30
- package/dist/cjs/gestureState.native.js.map +1 -1
- package/dist/cjs/helpers.cjs +20 -24
- package/dist/cjs/helpers.native.cjs +34 -0
- package/dist/cjs/helpers.native.js +21 -24
- package/dist/cjs/helpers.native.js.map +1 -1
- package/dist/cjs/index.cjs +14 -21
- package/dist/cjs/index.native.cjs +36 -0
- package/dist/cjs/index.native.js +15 -21
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/keyboardAvoidance.cjs +55 -79
- package/dist/cjs/keyboardAvoidance.native.cjs +74 -0
- package/dist/cjs/keyboardAvoidance.native.js +55 -78
- package/dist/cjs/keyboardAvoidance.native.js.map +1 -1
- package/dist/cjs/nativeSheet.cjs +17 -86
- package/dist/cjs/nativeSheet.native.cjs +94 -0
- package/dist/cjs/nativeSheet.native.js +73 -86
- package/dist/cjs/nativeSheet.native.js.map +1 -1
- package/dist/cjs/stableViewportHeight.cjs +27 -0
- package/dist/cjs/stableViewportHeight.native.cjs +29 -0
- package/dist/cjs/stableViewportHeight.native.js +31 -0
- package/dist/cjs/stableViewportHeight.native.js.map +1 -0
- package/dist/cjs/types.cjs +9 -11
- package/dist/cjs/types.native.cjs +18 -0
- package/dist/cjs/types.native.js +9 -10
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/useGestureHandlerPan.cjs +244 -257
- package/dist/cjs/useGestureHandlerPan.native.cjs +272 -0
- package/dist/cjs/useGestureHandlerPan.native.js +253 -265
- package/dist/cjs/useGestureHandlerPan.native.js.map +1 -1
- package/dist/cjs/useKeyboardControllerSheet.cjs +82 -88
- package/dist/cjs/useKeyboardControllerSheet.native.cjs +92 -0
- package/dist/cjs/useKeyboardControllerSheet.native.js +73 -111
- package/dist/cjs/useKeyboardControllerSheet.native.js.map +1 -1
- package/dist/cjs/useSafeAreaInsets.cjs +19 -26
- package/dist/cjs/useSafeAreaInsets.native.cjs +50 -0
- package/dist/cjs/useSafeAreaInsets.native.js +29 -25
- package/dist/cjs/useSafeAreaInsets.native.js.map +1 -1
- package/dist/cjs/useSheetController.cjs +26 -39
- package/dist/cjs/useSheetController.native.cjs +41 -0
- package/dist/cjs/useSheetController.native.js +27 -39
- package/dist/cjs/useSheetController.native.js.map +1 -1
- package/dist/cjs/useSheetOffscreenSize.cjs +43 -53
- package/dist/cjs/useSheetOffscreenSize.native.cjs +59 -0
- package/dist/cjs/useSheetOffscreenSize.native.js +47 -56
- package/dist/cjs/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/cjs/useSheetOpenState.cjs +68 -40
- package/dist/cjs/useSheetOpenState.native.cjs +87 -0
- package/dist/cjs/useSheetOpenState.native.js +73 -42
- package/dist/cjs/useSheetOpenState.native.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.cjs +145 -164
- package/dist/cjs/useSheetProviderProps.native.cjs +175 -0
- package/dist/cjs/useSheetProviderProps.native.js +155 -174
- package/dist/cjs/useSheetProviderProps.native.js.map +1 -1
- package/dist/cjs/useSheetScrollViewGestures.cjs +171 -180
- package/dist/cjs/useSheetScrollViewGestures.native.cjs +149 -0
- package/dist/cjs/useSheetScrollViewGestures.native.js +135 -147
- package/dist/cjs/useSheetScrollViewGestures.native.js.map +1 -1
- package/dist/cjs/webViewport.cjs +46 -48
- package/dist/cjs/webViewport.native.cjs +78 -0
- package/dist/cjs/webViewport.native.js +49 -50
- package/dist/cjs/webViewport.native.js.map +1 -1
- package/dist/esm/GestureSheetContext.mjs +15 -20
- package/dist/esm/GestureSheetContext.mjs.map +1 -1
- package/dist/esm/GestureSheetContext.native.js +17 -22
- package/dist/esm/GestureSheetContext.native.js.map +1 -1
- package/dist/esm/Sheet.mjs +207 -83
- package/dist/esm/Sheet.mjs.map +1 -1
- package/dist/esm/Sheet.native.js +210 -83
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetContext.mjs +21 -5
- package/dist/esm/SheetContext.mjs.map +1 -1
- package/dist/esm/SheetContext.native.js +21 -5
- package/dist/esm/SheetContext.native.js.map +1 -1
- package/dist/esm/SheetController.mjs +34 -30
- package/dist/esm/SheetController.mjs.map +1 -1
- package/dist/esm/SheetController.native.js +38 -34
- package/dist/esm/SheetController.native.js.map +1 -1
- package/dist/esm/SheetDragSurface.mjs +25 -0
- package/dist/esm/SheetDragSurface.mjs.map +1 -0
- package/dist/esm/SheetDragSurface.native.js +34 -0
- package/dist/esm/SheetDragSurface.native.js.map +1 -0
- package/dist/esm/SheetImplementationCustom.mjs +647 -586
- package/dist/esm/SheetImplementationCustom.mjs.map +1 -1
- package/dist/esm/SheetImplementationCustom.native.js +684 -618
- package/dist/esm/SheetImplementationCustom.native.js.map +1 -1
- package/dist/esm/SheetScrollView.mjs +278 -288
- package/dist/esm/SheetScrollView.mjs.map +1 -1
- package/dist/esm/SheetScrollView.native.js +287 -297
- package/dist/esm/SheetScrollView.native.js.map +1 -1
- package/dist/esm/constants.mjs +5 -3
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +5 -3
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/contexts.mjs +3 -3
- package/dist/esm/contexts.mjs.map +1 -1
- package/dist/esm/contexts.native.js +3 -3
- package/dist/esm/contexts.native.js.map +1 -1
- package/dist/esm/controller.mjs +2 -2
- package/dist/esm/controller.native.js +2 -2
- package/dist/esm/gestureState.mjs +13 -11
- package/dist/esm/gestureState.mjs.map +1 -1
- package/dist/esm/gestureState.native.js +14 -12
- package/dist/esm/gestureState.native.js.map +1 -1
- package/dist/esm/helpers.mjs +7 -6
- package/dist/esm/helpers.mjs.map +1 -1
- package/dist/esm/helpers.native.js +8 -7
- package/dist/esm/helpers.native.js.map +1 -1
- package/dist/esm/index.js +21 -14
- package/dist/esm/index.mjs +21 -14
- package/dist/esm/index.native.js +21 -14
- package/dist/esm/keyboardAvoidance.mjs +40 -61
- package/dist/esm/keyboardAvoidance.mjs.map +1 -1
- package/dist/esm/keyboardAvoidance.native.js +40 -61
- package/dist/esm/keyboardAvoidance.native.js.map +1 -1
- package/dist/esm/nativeSheet.mjs +4 -70
- package/dist/esm/nativeSheet.mjs.map +1 -1
- package/dist/esm/nativeSheet.native.js +60 -70
- package/dist/esm/nativeSheet.native.js.map +1 -1
- package/dist/esm/stableViewportHeight.mjs +8 -0
- package/dist/esm/stableViewportHeight.mjs.map +1 -0
- package/dist/esm/stableViewportHeight.native.js +8 -0
- package/dist/esm/stableViewportHeight.native.js.map +1 -0
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.native.js +0 -2
- package/dist/esm/useGestureHandlerPan.mjs +232 -239
- package/dist/esm/useGestureHandlerPan.mjs.map +1 -1
- package/dist/esm/useGestureHandlerPan.native.js +241 -248
- package/dist/esm/useGestureHandlerPan.native.js.map +1 -1
- package/dist/esm/useKeyboardControllerSheet.mjs +71 -71
- package/dist/esm/useKeyboardControllerSheet.mjs.map +1 -1
- package/dist/esm/useKeyboardControllerSheet.native.js +66 -94
- package/dist/esm/useKeyboardControllerSheet.native.js.map +1 -1
- package/dist/esm/useSafeAreaInsets.mjs +3 -1
- package/dist/esm/useSafeAreaInsets.mjs.map +1 -1
- package/dist/esm/useSafeAreaInsets.native.js +15 -3
- package/dist/esm/useSafeAreaInsets.native.js.map +1 -1
- package/dist/esm/useSheetController.mjs +14 -12
- package/dist/esm/useSheetController.mjs.map +1 -1
- package/dist/esm/useSheetController.native.js +14 -12
- package/dist/esm/useSheetController.native.js.map +1 -1
- package/dist/esm/useSheetOffscreenSize.mjs +30 -35
- package/dist/esm/useSheetOffscreenSize.mjs.map +1 -1
- package/dist/esm/useSheetOffscreenSize.native.js +34 -39
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/esm/useSheetOpenState.mjs +50 -22
- package/dist/esm/useSheetOpenState.mjs.map +1 -1
- package/dist/esm/useSheetOpenState.native.js +55 -25
- package/dist/esm/useSheetOpenState.native.js.map +1 -1
- package/dist/esm/useSheetProviderProps.mjs +130 -138
- package/dist/esm/useSheetProviderProps.mjs.map +1 -1
- package/dist/esm/useSheetProviderProps.native.js +140 -149
- package/dist/esm/useSheetProviderProps.native.js.map +1 -1
- package/dist/esm/useSheetScrollViewGestures.mjs +159 -162
- package/dist/esm/useSheetScrollViewGestures.mjs.map +1 -1
- package/dist/esm/useSheetScrollViewGestures.native.js +123 -130
- package/dist/esm/useSheetScrollViewGestures.native.js.map +1 -1
- package/dist/esm/webViewport.mjs +26 -25
- package/dist/esm/webViewport.mjs.map +1 -1
- package/dist/esm/webViewport.native.js +29 -28
- package/dist/esm/webViewport.native.js.map +1 -1
- package/dist/jsx/GestureSheetContext.mjs +15 -20
- package/dist/jsx/GestureSheetContext.mjs.map +1 -1
- package/dist/jsx/GestureSheetContext.native.cjs +48 -0
- package/dist/jsx/GestureSheetContext.native.js +29 -37
- package/dist/jsx/GestureSheetContext.native.js.map +1 -1
- package/dist/jsx/Sheet.mjs +207 -83
- package/dist/jsx/Sheet.mjs.map +1 -1
- package/dist/jsx/Sheet.native.cjs +245 -0
- package/dist/jsx/Sheet.native.js +223 -98
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetContext.mjs +21 -5
- package/dist/jsx/SheetContext.mjs.map +1 -1
- package/dist/jsx/SheetContext.native.cjs +57 -0
- package/dist/jsx/SheetContext.native.js +44 -22
- package/dist/jsx/SheetContext.native.js.map +1 -1
- package/dist/jsx/SheetController.mjs +34 -30
- package/dist/jsx/SheetController.mjs.map +1 -1
- package/dist/jsx/SheetController.native.cjs +71 -0
- package/dist/jsx/SheetController.native.js +52 -58
- package/dist/jsx/SheetController.native.js.map +1 -1
- package/dist/jsx/SheetDragSurface.mjs +25 -0
- package/dist/jsx/SheetDragSurface.mjs.map +1 -0
- package/dist/jsx/SheetDragSurface.native.cjs +61 -0
- package/dist/jsx/SheetDragSurface.native.js +63 -0
- package/dist/jsx/SheetDragSurface.native.js.map +1 -0
- package/dist/jsx/SheetImplementationCustom.mjs +647 -586
- package/dist/jsx/SheetImplementationCustom.mjs.map +1 -1
- package/dist/jsx/SheetImplementationCustom.native.cjs +748 -0
- package/dist/jsx/SheetImplementationCustom.native.js +704 -649
- package/dist/jsx/SheetImplementationCustom.native.js.map +1 -1
- package/dist/jsx/SheetScrollView.mjs +278 -288
- package/dist/jsx/SheetScrollView.mjs.map +1 -1
- package/dist/jsx/SheetScrollView.native.cjs +326 -0
- package/dist/jsx/SheetScrollView.native.js +299 -319
- package/dist/jsx/SheetScrollView.native.js.map +1 -1
- package/dist/jsx/constants.mjs +5 -3
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/constants.native.cjs +36 -0
- package/dist/jsx/constants.native.js +21 -20
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/contexts.mjs +3 -3
- package/dist/jsx/contexts.mjs.map +1 -1
- package/dist/jsx/contexts.native.cjs +37 -0
- package/dist/jsx/contexts.native.js +19 -27
- package/dist/jsx/contexts.native.js.map +1 -1
- package/dist/jsx/controller.mjs +2 -2
- package/dist/jsx/controller.native.cjs +31 -0
- package/dist/jsx/controller.native.js +16 -17
- package/dist/jsx/controller.native.js.map +1 -1
- package/dist/jsx/gestureState.mjs +13 -11
- package/dist/jsx/gestureState.mjs.map +1 -1
- package/dist/jsx/gestureState.native.cjs +53 -0
- package/dist/jsx/gestureState.native.js +29 -30
- package/dist/jsx/gestureState.native.js.map +1 -1
- package/dist/jsx/helpers.mjs +7 -6
- package/dist/jsx/helpers.mjs.map +1 -1
- package/dist/jsx/helpers.native.cjs +34 -0
- package/dist/jsx/helpers.native.js +21 -24
- package/dist/jsx/helpers.native.js.map +1 -1
- package/dist/jsx/index.js +21 -14
- package/dist/jsx/index.mjs +21 -14
- package/dist/jsx/index.native.cjs +36 -0
- package/dist/jsx/index.native.js +15 -21
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/keyboardAvoidance.mjs +40 -61
- package/dist/jsx/keyboardAvoidance.mjs.map +1 -1
- package/dist/jsx/keyboardAvoidance.native.cjs +74 -0
- package/dist/jsx/keyboardAvoidance.native.js +55 -78
- package/dist/jsx/keyboardAvoidance.native.js.map +1 -1
- package/dist/jsx/nativeSheet.mjs +4 -70
- package/dist/jsx/nativeSheet.mjs.map +1 -1
- package/dist/jsx/nativeSheet.native.cjs +94 -0
- package/dist/jsx/nativeSheet.native.js +73 -86
- package/dist/jsx/nativeSheet.native.js.map +1 -1
- package/dist/jsx/stableViewportHeight.mjs +8 -0
- package/dist/jsx/stableViewportHeight.mjs.map +1 -0
- package/dist/jsx/stableViewportHeight.native.cjs +29 -0
- package/dist/jsx/stableViewportHeight.native.js +31 -0
- package/dist/jsx/stableViewportHeight.native.js.map +1 -0
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.native.cjs +18 -0
- package/dist/jsx/types.native.js +9 -10
- package/dist/jsx/types.native.js.map +1 -1
- package/dist/jsx/useGestureHandlerPan.mjs +232 -239
- package/dist/jsx/useGestureHandlerPan.mjs.map +1 -1
- package/dist/jsx/useGestureHandlerPan.native.cjs +272 -0
- package/dist/jsx/useGestureHandlerPan.native.js +253 -265
- package/dist/jsx/useGestureHandlerPan.native.js.map +1 -1
- package/dist/jsx/useKeyboardControllerSheet.mjs +71 -71
- package/dist/jsx/useKeyboardControllerSheet.mjs.map +1 -1
- package/dist/jsx/useKeyboardControllerSheet.native.cjs +92 -0
- package/dist/jsx/useKeyboardControllerSheet.native.js +73 -111
- package/dist/jsx/useKeyboardControllerSheet.native.js.map +1 -1
- package/dist/jsx/useSafeAreaInsets.mjs +3 -1
- package/dist/jsx/useSafeAreaInsets.mjs.map +1 -1
- package/dist/jsx/useSafeAreaInsets.native.cjs +50 -0
- package/dist/jsx/useSafeAreaInsets.native.js +29 -25
- package/dist/jsx/useSafeAreaInsets.native.js.map +1 -1
- package/dist/jsx/useSheetController.mjs +14 -12
- package/dist/jsx/useSheetController.mjs.map +1 -1
- package/dist/jsx/useSheetController.native.cjs +41 -0
- package/dist/jsx/useSheetController.native.js +27 -39
- package/dist/jsx/useSheetController.native.js.map +1 -1
- package/dist/jsx/useSheetOffscreenSize.mjs +30 -35
- package/dist/jsx/useSheetOffscreenSize.mjs.map +1 -1
- package/dist/jsx/useSheetOffscreenSize.native.cjs +59 -0
- package/dist/jsx/useSheetOffscreenSize.native.js +47 -56
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/jsx/useSheetOpenState.mjs +50 -22
- package/dist/jsx/useSheetOpenState.mjs.map +1 -1
- package/dist/jsx/useSheetOpenState.native.cjs +87 -0
- package/dist/jsx/useSheetOpenState.native.js +73 -42
- package/dist/jsx/useSheetOpenState.native.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.mjs +130 -138
- package/dist/jsx/useSheetProviderProps.mjs.map +1 -1
- package/dist/jsx/useSheetProviderProps.native.cjs +175 -0
- package/dist/jsx/useSheetProviderProps.native.js +155 -174
- package/dist/jsx/useSheetProviderProps.native.js.map +1 -1
- package/dist/jsx/useSheetScrollViewGestures.mjs +159 -162
- package/dist/jsx/useSheetScrollViewGestures.mjs.map +1 -1
- package/dist/jsx/useSheetScrollViewGestures.native.cjs +149 -0
- package/dist/jsx/useSheetScrollViewGestures.native.js +135 -147
- package/dist/jsx/useSheetScrollViewGestures.native.js.map +1 -1
- package/dist/jsx/webViewport.mjs +26 -25
- package/dist/jsx/webViewport.mjs.map +1 -1
- package/dist/jsx/webViewport.native.cjs +78 -0
- package/dist/jsx/webViewport.native.js +49 -50
- package/dist/jsx/webViewport.native.js.map +1 -1
- package/package.json +38 -40
- package/src/Sheet.tsx +314 -77
- package/src/SheetContext.tsx +57 -7
- package/src/SheetController.tsx +7 -6
- package/src/SheetDragSurface.native.tsx +42 -0
- package/src/SheetDragSurface.tsx +40 -0
- package/src/SheetImplementationCustom.tsx +364 -181
- package/src/SheetScrollView.tsx +36 -20
- package/src/constants.tsx +3 -3
- package/src/helpers.tsx +0 -14
- package/src/index.ts +3 -6
- package/src/{nativeSheet.tsx → nativeSheet.native.tsx} +9 -20
- package/src/nativeSheet.ts +19 -0
- package/src/stableViewportHeight.native.ts +9 -0
- package/src/stableViewportHeight.ts +15 -0
- package/src/types.tsx +122 -92
- package/src/useKeyboardControllerSheet.native.ts +10 -39
- package/src/useSafeAreaInsets.native.ts +20 -13
- package/src/useSheetController.tsx +15 -7
- package/src/useSheetOpenState.tsx +50 -4
- package/src/useSheetProviderProps.tsx +4 -27
- package/src/useSheetScrollViewGestures.ts +2 -2
- package/types/GestureSheetContext.d.ts +1 -1
- package/types/GestureSheetContext.d.ts.map +1 -1
- package/types/Sheet.d.ts +247 -151
- package/types/Sheet.d.ts.map +1 -1
- package/types/SheetContext.d.ts +28 -42
- package/types/SheetContext.d.ts.map +1 -1
- package/types/SheetController.d.ts +4 -2
- package/types/SheetController.d.ts.map +1 -1
- package/types/SheetDragSurface.d.ts +11 -0
- package/types/SheetDragSurface.d.ts.map +1 -0
- package/types/SheetDragSurface.native.d.ts +11 -0
- package/types/SheetDragSurface.native.d.ts.map +1 -0
- package/types/SheetImplementationCustom.d.ts +4 -36
- package/types/SheetImplementationCustom.d.ts.map +1 -1
- package/types/SheetScrollView.d.ts +21 -38
- package/types/SheetScrollView.d.ts.map +1 -1
- package/types/constants.d.ts +3 -2
- package/types/constants.d.ts.map +1 -1
- package/types/index.d.ts +1 -3
- package/types/index.d.ts.map +1 -1
- package/types/nativeSheet.d.ts +8 -8
- package/types/nativeSheet.d.ts.map +1 -1
- package/types/nativeSheet.native.d.ts +5 -0
- package/types/nativeSheet.native.d.ts.map +1 -0
- package/types/stableViewportHeight.d.ts +12 -0
- package/types/stableViewportHeight.d.ts.map +1 -0
- package/types/stableViewportHeight.native.d.ts +6 -0
- package/types/stableViewportHeight.native.d.ts.map +1 -0
- package/types/types.d.ts +43 -17
- package/types/types.d.ts.map +1 -1
- package/types/useKeyboardControllerSheet.native.d.ts +6 -6
- package/types/useKeyboardControllerSheet.native.d.ts.map +1 -1
- package/types/useSafeAreaInsets.native.d.ts +4 -12
- package/types/useSafeAreaInsets.native.d.ts.map +1 -1
- package/types/useSheetController.d.ts +6 -6
- package/types/useSheetController.d.ts.map +1 -1
- package/types/useSheetOffscreenSize.d.ts.map +1 -1
- package/types/useSheetOpenState.d.ts +3 -2
- package/types/useSheetOpenState.d.ts.map +1 -1
- package/types/useSheetProviderProps.d.ts +5 -8
- package/types/useSheetProviderProps.d.ts.map +1 -1
- package/types/useSheetScrollViewGestures.d.ts +2 -2
- package/types/useSheetScrollViewGestures.d.ts.map +1 -1
- package/.turbo/turbo-build.log +0 -2
- package/controller/index.cjs +0 -2
- package/controller/index.d.ts +0 -5
- package/controller/index.js +0 -2
- package/controller/index.native.cjs +0 -2
- package/controller/index.native.js +0 -2
- package/dist/cjs/GestureDetectorWrapper.cjs +0 -54
- package/dist/cjs/GestureDetectorWrapper.native.js +0 -58
- package/dist/cjs/GestureDetectorWrapper.native.js.map +0 -1
- package/dist/cjs/createSheet.cjs +0 -194
- package/dist/cjs/createSheet.native.js +0 -204
- package/dist/cjs/createSheet.native.js.map +0 -1
- package/dist/cjs/setupGestureHandler.cjs +0 -55
- package/dist/cjs/setupGestureHandler.native.js +0 -60
- package/dist/cjs/setupGestureHandler.native.js.map +0 -1
- package/dist/cjs/useSheet.cjs +0 -29
- package/dist/cjs/useSheet.native.js +0 -34
- package/dist/cjs/useSheet.native.js.map +0 -1
- package/dist/esm/GestureDetectorWrapper.mjs +0 -29
- package/dist/esm/GestureDetectorWrapper.mjs.map +0 -1
- package/dist/esm/GestureDetectorWrapper.native.js +0 -30
- package/dist/esm/GestureDetectorWrapper.native.js.map +0 -1
- package/dist/esm/controller.mjs.map +0 -1
- package/dist/esm/controller.native.js.map +0 -1
- package/dist/esm/createSheet.mjs +0 -168
- package/dist/esm/createSheet.mjs.map +0 -1
- package/dist/esm/createSheet.native.js +0 -176
- package/dist/esm/createSheet.native.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js.map +0 -1
- package/dist/esm/setupGestureHandler.mjs +0 -29
- package/dist/esm/setupGestureHandler.mjs.map +0 -1
- package/dist/esm/setupGestureHandler.native.js +0 -31
- package/dist/esm/setupGestureHandler.native.js.map +0 -1
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js.map +0 -1
- package/dist/esm/useSheet.mjs +0 -4
- package/dist/esm/useSheet.mjs.map +0 -1
- package/dist/esm/useSheet.native.js +0 -6
- package/dist/esm/useSheet.native.js.map +0 -1
- package/dist/jsx/GestureDetectorWrapper.mjs +0 -29
- package/dist/jsx/GestureDetectorWrapper.mjs.map +0 -1
- package/dist/jsx/GestureDetectorWrapper.native.js +0 -58
- package/dist/jsx/GestureDetectorWrapper.native.js.map +0 -1
- package/dist/jsx/controller.mjs.map +0 -1
- package/dist/jsx/createSheet.mjs +0 -168
- package/dist/jsx/createSheet.mjs.map +0 -1
- package/dist/jsx/createSheet.native.js +0 -204
- package/dist/jsx/createSheet.native.js.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/setupGestureHandler.mjs +0 -29
- package/dist/jsx/setupGestureHandler.mjs.map +0 -1
- package/dist/jsx/setupGestureHandler.native.js +0 -60
- package/dist/jsx/setupGestureHandler.native.js.map +0 -1
- package/dist/jsx/types.mjs.map +0 -1
- package/dist/jsx/useSheet.mjs +0 -4
- package/dist/jsx/useSheet.mjs.map +0 -1
- package/dist/jsx/useSheet.native.js +0 -34
- package/dist/jsx/useSheet.native.js.map +0 -1
- package/next.md +0 -78
- package/setup-gesture-handler/index.cjs +0 -2
- package/setup-gesture-handler/index.js +0 -2
- package/setup-gesture-handler/index.native.cjs +0 -2
- package/setup-gesture-handler/index.native.js +0 -2
- package/setup-gesture-handler.cjs +0 -1
- package/src/GestureDetectorWrapper.tsx +0 -38
- package/src/createSheet.tsx +0 -309
- package/src/setupGestureHandler.ts +0 -43
- package/src/useSheet.tsx +0 -3
- package/test/keyboardAvoidance.test.ts +0 -269
- package/tsconfig.json +0 -57
- package/types/GestureDetectorWrapper.d.ts +0 -14
- package/types/GestureDetectorWrapper.d.ts.map +0 -1
- package/types/createSheet.d.ts +0 -195
- package/types/createSheet.d.ts.map +0 -1
- package/types/setupGestureHandler.d.ts +0 -11
- package/types/setupGestureHandler.d.ts.map +0 -1
- package/types/useSheet.d.ts +0 -2
- package/types/useSheet.d.ts.map +0 -1
package/dist/esm/Sheet.native.js
CHANGED
|
@@ -1,89 +1,216 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from "@tamagui/adapt";
|
|
3
|
+
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
4
|
+
import { isWeb } from "@tamagui/constants";
|
|
5
|
+
import { View, createRefComponent, createStyledHOC, styled } from "@tamagui/core";
|
|
6
|
+
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
7
|
+
import { resolveViewZIndex } from "@tamagui/portal";
|
|
8
|
+
import { RemoveScroll } from "@tamagui/remove-scroll";
|
|
2
9
|
import { XStack, YStack } from "@tamagui/stacks";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
borderRadius: 100,
|
|
24
|
-
backgroundColor: "$background",
|
|
25
|
-
zIndex: 10,
|
|
26
|
-
marginHorizontal: "35%",
|
|
27
|
-
marginBottom: "$2",
|
|
28
|
-
opacity: 0.5,
|
|
29
|
-
hoverStyle: {
|
|
30
|
-
opacity: 0.7
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: {
|
|
36
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
37
|
-
}
|
|
10
|
+
import { useDidFinishSSR } from "@tamagui/use-did-finish-ssr";
|
|
11
|
+
import { StackZIndexContext } from "@tamagui/z-index-stack";
|
|
12
|
+
import { useContext, useEffect, useMemo, useRef } from "react";
|
|
13
|
+
import { SHEET_BACKGROUND_NAME, SHEET_CONTAINER_NAME, SHEET_HANDLE_NAME, SHEET_OVERLAY_MARKER, SHEET_OVERLAY_NAME } from "./constants.native.js";
|
|
14
|
+
import { getNativeSheet } from "./nativeSheet.native.js";
|
|
15
|
+
import { SheetOverlayLayerContext, useAnimatedPosition, useSheetContext } from "./SheetContext.native.js";
|
|
16
|
+
import { SheetImplementationCustom } from "./SheetImplementationCustom.native.js";
|
|
17
|
+
import { SheetScrollView } from "./SheetScrollView.native.js";
|
|
18
|
+
import { useSheetController } from "./useSheetController.native.js";
|
|
19
|
+
import { useSheetOffscreenSize } from "./useSheetOffscreenSize.native.js";
|
|
20
|
+
import { getMaxViewportHeight } from "./webViewport.native.js";
|
|
21
|
+
|
|
22
|
+
export * from "./types.native.js"
|
|
23
|
+
|
|
24
|
+
var SheetHandleFrame = styled(XStack, {
|
|
25
|
+
displayName: SHEET_HANDLE_NAME,
|
|
26
|
+
variants: { open: {
|
|
27
|
+
true: { pointerEvents: "auto" },
|
|
28
|
+
false: { pointerEvents: "none" }
|
|
29
|
+
} }
|
|
38
30
|
});
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
unstyled: {
|
|
51
|
-
false: {
|
|
52
|
-
fullscreen: true,
|
|
53
|
-
position: "absolute",
|
|
54
|
-
backgroundColor: "$background",
|
|
55
|
-
zIndex: 1e5 - 1,
|
|
56
|
-
pointerEvents: "auto"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
defaultVariants: {
|
|
61
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
62
|
-
}
|
|
31
|
+
var SheetOverlayFrame = styled(YStack, {
|
|
32
|
+
displayName: SHEET_OVERLAY_NAME,
|
|
33
|
+
inset: 0,
|
|
34
|
+
position: "absolute",
|
|
35
|
+
zIndex: 1e5 - 1,
|
|
36
|
+
pointerEvents: "auto",
|
|
37
|
+
variants: { open: {
|
|
38
|
+
true: { pointerEvents: "auto" },
|
|
39
|
+
false: { pointerEvents: "none" }
|
|
40
|
+
} }
|
|
63
41
|
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
borderTopRightRadius: "$true",
|
|
73
|
-
width: "100%",
|
|
74
|
-
maxHeight: "100%",
|
|
75
|
-
overflow: "hidden"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
defaultVariants: {
|
|
80
|
-
unstyled: process.env.TAMAGUI_HEADLESS === "1"
|
|
81
|
-
}
|
|
42
|
+
Object.assign(SheetOverlayFrame.staticConfig, { [SHEET_OVERLAY_MARKER]: true });
|
|
43
|
+
var SheetContainerFrame = styled(YStack, {
|
|
44
|
+
displayName: SHEET_CONTAINER_NAME,
|
|
45
|
+
flex: 1,
|
|
46
|
+
position: "relative",
|
|
47
|
+
zIndex: 0,
|
|
48
|
+
width: "100%",
|
|
49
|
+
maxHeight: "100%"
|
|
82
50
|
});
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
51
|
+
var SheetBackgroundFrame = styled(YStack, {
|
|
52
|
+
displayName: SHEET_BACKGROUND_NAME,
|
|
53
|
+
position: "absolute",
|
|
54
|
+
top: 0,
|
|
55
|
+
left: 0,
|
|
56
|
+
right: 0,
|
|
57
|
+
zIndex: -1,
|
|
58
|
+
pointerEvents: "none"
|
|
87
59
|
});
|
|
88
|
-
|
|
60
|
+
var SheetHandle = createStyledHOC(SheetHandleFrame, function(param, forwardedRef) {
|
|
61
|
+
var { scope, ...props } = param;
|
|
62
|
+
var context = useSheetContext(scope);
|
|
63
|
+
var composedRef = useComposedRefs(context.handleRef, forwardedRef);
|
|
64
|
+
var wasDraggingRef = useRef(false);
|
|
65
|
+
useEffect(function() {
|
|
66
|
+
if (!context.scrollBridge) return;
|
|
67
|
+
return context.scrollBridge.onParentDragging(function(isDragging) {
|
|
68
|
+
if (isDragging) {
|
|
69
|
+
wasDraggingRef.current = true;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}, [context.scrollBridge]);
|
|
73
|
+
if (context.onlyShowContainer) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
return /* @__PURE__ */ jsx(SheetHandleFrame, {
|
|
77
|
+
ref: composedRef,
|
|
78
|
+
onPressIn: function() {
|
|
79
|
+
wasDraggingRef.current = false;
|
|
80
|
+
},
|
|
81
|
+
onPress: function() {
|
|
82
|
+
if (wasDraggingRef.current) {
|
|
83
|
+
wasDraggingRef.current = false;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);
|
|
87
|
+
var nextPos = (context.position + 1) % max;
|
|
88
|
+
context.setPosition(nextPos);
|
|
89
|
+
},
|
|
90
|
+
open: context.open,
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
var SheetOverlay = createStyledHOC(SheetOverlayFrame, function(propsIn, ref) {
|
|
95
|
+
var { scope, ...props } = propsIn;
|
|
96
|
+
var context = useSheetContext(scope);
|
|
97
|
+
var isInOverlayLayer = useContext(SheetOverlayLayerContext);
|
|
98
|
+
var didWarn = useRef(false);
|
|
99
|
+
if (context.onlyShowContainer) {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
if (!isInOverlayLayer) {
|
|
103
|
+
if (process.env.NODE_ENV === "development" && !didWarn.current) {
|
|
104
|
+
didWarn.current = true;
|
|
105
|
+
console.error("Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.");
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
return /* @__PURE__ */ jsx(SheetOverlayFrame, {
|
|
110
|
+
...props,
|
|
111
|
+
ref,
|
|
112
|
+
onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? function() {
|
|
113
|
+
context.setOpen(false);
|
|
114
|
+
} : void 0)
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
var SheetContainer = createStyledHOC(SheetContainerFrame, function(param, forwardedRef) {
|
|
118
|
+
var { scope, adjustPaddingForOffscreenContent, children, ...props } = param;
|
|
119
|
+
var context = useSheetContext(scope);
|
|
120
|
+
var { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;
|
|
121
|
+
var composedContentRef = useComposedRefs(forwardedRef, contentRef);
|
|
122
|
+
var offscreenSize = useSheetOffscreenSize(context);
|
|
123
|
+
var stableFrameSize = useRef(frameSize);
|
|
124
|
+
useEffect(function() {
|
|
125
|
+
if (open && frameSize) {
|
|
126
|
+
stableFrameSize.current = frameSize;
|
|
127
|
+
}
|
|
128
|
+
}, [open, frameSize]);
|
|
129
|
+
var sheetContents = useMemo(function() {
|
|
130
|
+
var shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;
|
|
131
|
+
return /* @__PURE__ */ jsxs(SheetContainerFrame, {
|
|
132
|
+
ref: composedContentRef,
|
|
133
|
+
flex: hasFit && open ? 0 : 1,
|
|
134
|
+
flexBasis: hasFit ? "auto" : void 0,
|
|
135
|
+
height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,
|
|
136
|
+
pointerEvents: open ? "auto" : "none",
|
|
137
|
+
"data-state": open ? "open" : "closed",
|
|
138
|
+
...props,
|
|
139
|
+
children: [/* @__PURE__ */ jsx(StackZIndexContext, {
|
|
140
|
+
zIndex: resolveViewZIndex(props.zIndex),
|
|
141
|
+
children
|
|
142
|
+
}), adjustPaddingForOffscreenContent && /* @__PURE__ */ jsx(View, {
|
|
143
|
+
"data-sheet-offscreen-pad": true,
|
|
144
|
+
height: offscreenSize,
|
|
145
|
+
width: "100%"
|
|
146
|
+
})]
|
|
147
|
+
});
|
|
148
|
+
}, [
|
|
149
|
+
open,
|
|
150
|
+
props,
|
|
151
|
+
frameSize,
|
|
152
|
+
offscreenSize,
|
|
153
|
+
adjustPaddingForOffscreenContent,
|
|
154
|
+
hasFit
|
|
155
|
+
]);
|
|
156
|
+
return /* @__PURE__ */ jsx(RemoveScroll, {
|
|
157
|
+
enabled: !disableRemoveScroll && context.open,
|
|
158
|
+
children: sheetContents
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
var SheetBackground = createStyledHOC(SheetBackgroundFrame, function(param, forwardedRef) {
|
|
162
|
+
var { scope, disableHideBottomOverflow, ...props } = param;
|
|
163
|
+
var context = useSheetContext(scope);
|
|
164
|
+
var bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;
|
|
165
|
+
return /* @__PURE__ */ jsx(SheetBackgroundFrame, {
|
|
166
|
+
ref: forwardedRef,
|
|
167
|
+
"data-sheet-background": "",
|
|
168
|
+
bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,
|
|
169
|
+
...props
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
var SheetRoot = createRefComponent(function SheetRoot2(props, ref) {
|
|
173
|
+
var hydrated = useDidFinishSSR();
|
|
174
|
+
var isAdapted = useAdaptIsActive();
|
|
175
|
+
var adaptContext = useAdaptContext();
|
|
176
|
+
var { isShowingNonSheet } = useSheetController(props.scope);
|
|
177
|
+
var shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);
|
|
178
|
+
var isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;
|
|
179
|
+
var SheetImplementation = SheetImplementationCustom;
|
|
180
|
+
if (props.native) {
|
|
181
|
+
var impl = getNativeSheet("ios");
|
|
182
|
+
if (impl) {
|
|
183
|
+
SheetImplementation = impl;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
var implementation = /* @__PURE__ */ jsx(SheetImplementation, {
|
|
190
|
+
ref,
|
|
191
|
+
...props
|
|
192
|
+
});
|
|
193
|
+
return isAdapted ? /* @__PURE__ */ jsx(AdaptCapabilities, {
|
|
194
|
+
scroll: true,
|
|
195
|
+
overlay: true,
|
|
196
|
+
dismiss: true,
|
|
197
|
+
children: implementation
|
|
198
|
+
}) : implementation;
|
|
199
|
+
});
|
|
200
|
+
var sheetParts = {
|
|
201
|
+
Container: SheetContainer,
|
|
202
|
+
Background: SheetBackground,
|
|
203
|
+
Overlay: SheetOverlay,
|
|
204
|
+
Handle: SheetHandle,
|
|
205
|
+
ScrollView: SheetScrollView
|
|
206
|
+
};
|
|
207
|
+
var SheetControlled = withStaticProperties(SheetRoot, sheetParts);
|
|
208
|
+
var Sheet = withStaticProperties(SheetRoot, {
|
|
209
|
+
Root: SheetRoot,
|
|
210
|
+
Controlled: SheetControlled,
|
|
211
|
+
useAnimatedPosition,
|
|
212
|
+
...sheetParts
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
export { Sheet, SheetBackground, SheetContainer, SheetControlled, SheetHandle, SheetOverlay, SheetRoot };
|
|
89
216
|
//# sourceMappingURL=Sheet.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styled","XStack","YStack","SHEET_HANDLE_NAME","SHEET_NAME","SHEET_OVERLAY_NAME","createSheet","createSheetScope","Handle","name","variants","open","true","opacity","pointerEvents","false","unstyled","height","borderRadius","backgroundColor","zIndex","marginHorizontal","marginBottom","hoverStyle","defaultVariants","process","env","TAMAGUI_HEADLESS","Overlay","fullscreen","position","Frame","flex","borderTopLeftRadius","borderTopRightRadius","width","maxHeight","overflow","Sheet"],"sources":["../../src/Sheet.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,MAAA,QAAc;AACvB,SAASC,MAAA,EAAQC,MAAA,QAAc;AAE/B,SAASC,iBAAA,EAAmBC,UAAA,EAAYC,kBAAA,QAA0B;AAClE,SAASC,WAAA,QAAmB;AAE5B,SAASC,gBAAA,QAAwB;AACjC,cAAc;AAMP,IAAAC,MAAM,GAAAR,MAAS,CAAAC,MAAO;EAC3BQ,IAAA,EAAMN,iBAAA;EAENO,QAAA,EAAU;IACRC,IAAA,EAAM;MACJC,IAAA,EAAM;QACJC,OAAA,EAAS;QACTC,aAAA,EAAe;MACjB;MACAC,KAAA,EAAO;QACLF,OAAA,EAAS;QACTC,aAAA,EAAe;MACjB;IACF;IAEAE,QAAA,EAAU;MACRD,KAAA,EAAO;QACLE,MAAA,EAAQ;QACRC,YAAA,EAAc;QACdC,eAAA,EAAiB;QACjBC,MAAA,EAAQ;QACRC,gBAAA,EAAkB;QAClBC,YAAA,EAAc;QACdT,OAAA,EAAS;QAETU,UAAA,EAAY;UACVV,OAAA,EAAS;QACX;MACF;IACF;EACF;EAEAW,eAAA,EAAiB;IACfR,QAAA,EAAUS,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,CAAC;AAMM,IAAAC,OAAM,GAAA5B,MAAU,CAAAE,MAAO;EAC5BO,IAAA,EAAMJ,kBAAA;EAENK,QAAA,EAAU;IACRC,IAAA,EAAM;MACJC,IAAA,EAAM;QACJE,aAAA,EAAe;MACjB;MACAC,KAAA,EAAO;QACLD,aAAA,EAAe;MACjB;IACF;IAEAE,QAAA,EAAU;MACRD,KAAA,EAAO;QACLc,UAAA,EAAY;QACZC,QAAA,EAAU;QACVX,eAAA,EAAiB;QACjBC,MAAA,EAAQ,MAAU;QAClBN,aAAA,EAAe;MACjB;IACF;EACF;EAEAU,eAAA,EAAiB;IACfR,QAAA,EAAUS,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,CAAC;AAMM,IAAAI,KAAM,GAAA/B,MAAQ,CAAAE,MAAO;EAC1BO,IAAA,EAAML,UAAA;EAENM,QAAA,EAAU;IACRM,QAAA,EAAU;MACRD,KAAA,EAAO;QACLiB,IAAA,EAAM;QACNb,eAAA,EAAiB;QACjBc,mBAAA,EAAqB;QACrBC,oBAAA,EAAsB;QACtBC,KAAA,EAAO;QACPC,SAAA,EAAW;QACXC,QAAA,EAAU;MACZ;IACF;EACF;EAEAb,eAAA,EAAiB;IACfR,QAAA,EAAUS,OAAA,CAAQC,GAAA,CAAIC,gBAAA,KAAqB;EAC7C;AACF,CAAC;AAEM,IAAAW,KAAM,GAAAhC,WAAQ;EACnByB,KAAA;EACAvB,MAAA;EACAoB;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Sheet.native.js","names":[],"sources":["esm/Sheet.native.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { AdaptCapabilities, useAdaptContext, useAdaptIsActive } from \"@tamagui/adapt\";\nimport { useComposedRefs } from \"@tamagui/compose-refs\";\nimport { isWeb } from \"@tamagui/constants\";\nimport { createRefComponent, createStyledHOC, styled, View } from \"@tamagui/core\";\nimport { composeEventHandlers, withStaticProperties } from \"@tamagui/helpers\";\nimport { resolveViewZIndex } from \"@tamagui/portal\";\nimport { RemoveScroll } from \"@tamagui/remove-scroll\";\nimport { XStack, YStack } from \"@tamagui/stacks\";\nimport { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { StackZIndexContext } from \"@tamagui/z-index-stack\";\nimport { useContext, useEffect, useMemo, useRef } from \"react\";\nimport { SHEET_BACKGROUND_NAME, SHEET_CONTAINER_NAME, SHEET_HANDLE_NAME, SHEET_OVERLAY_MARKER, SHEET_OVERLAY_NAME } from \"./constants\";\nimport { getNativeSheet } from \"./nativeSheet\";\nimport { SheetOverlayLayerContext, useAnimatedPosition, useSheetContext } from \"./SheetContext\";\nimport { SheetImplementationCustom } from \"./SheetImplementationCustom\";\nimport { SheetScrollView } from \"./SheetScrollView\";\nimport { useSheetController } from \"./useSheetController\";\nimport { useSheetOffscreenSize } from \"./useSheetOffscreenSize\";\nimport { getMaxViewportHeight } from \"./webViewport\";\nexport * from \"./types\";\nvar SheetHandleFrame = styled(XStack, {\n displayName: SHEET_HANDLE_NAME,\n // the behavior Handle ships no opacity rules; open/close aesthetics (fade in\n // when open, dim when idle) live in the copied skin. see the canonical skin.\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nvar SheetOverlayFrame = styled(YStack, {\n displayName: SHEET_OVERLAY_NAME,\n inset: 0,\n position: \"absolute\",\n zIndex: 1e5 - 1,\n pointerEvents: \"auto\",\n variants: {\n open: {\n true: {\n pointerEvents: \"auto\"\n },\n false: {\n pointerEvents: \"none\"\n }\n }\n }\n});\nObject.assign(SheetOverlayFrame.staticConfig, {\n [SHEET_OVERLAY_MARKER]: true\n});\nvar SheetContainerFrame = styled(YStack, {\n displayName: SHEET_CONTAINER_NAME,\n flex: 1,\n position: \"relative\",\n zIndex: 0,\n width: \"100%\",\n maxHeight: \"100%\"\n});\nvar SheetBackgroundFrame = styled(YStack, {\n displayName: SHEET_BACKGROUND_NAME,\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n zIndex: -1,\n pointerEvents: \"none\"\n});\nvar SheetHandle = createStyledHOC(SheetHandleFrame, function(param, forwardedRef) {\n var { scope, ...props } = param;\n var context = useSheetContext(scope);\n var composedRef = useComposedRefs(context.handleRef, forwardedRef);\n var wasDraggingRef = useRef(false);\n useEffect(function() {\n if (!context.scrollBridge) return;\n return context.scrollBridge.onParentDragging(function(isDragging) {\n if (isDragging) {\n wasDraggingRef.current = true;\n }\n });\n }, [\n context.scrollBridge\n ]);\n if (context.onlyShowContainer) {\n return null;\n }\n return /* @__PURE__ */ _jsx(SheetHandleFrame, {\n ref: composedRef,\n onPressIn: function() {\n wasDraggingRef.current = false;\n },\n onPress: function() {\n if (wasDraggingRef.current) {\n wasDraggingRef.current = false;\n return;\n }\n var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);\n var nextPos = (context.position + 1) % max;\n context.setPosition(nextPos);\n },\n open: context.open,\n ...props\n });\n});\nvar SheetOverlay = createStyledHOC(SheetOverlayFrame, function(propsIn, ref) {\n var { scope, ...props } = propsIn;\n var context = useSheetContext(scope);\n var isInOverlayLayer = useContext(SheetOverlayLayerContext);\n var didWarn = useRef(false);\n if (context.onlyShowContainer) {\n return null;\n }\n if (!isInOverlayLayer) {\n if (process.env.NODE_ENV === \"development\" && !didWarn.current) {\n didWarn.current = true;\n console.error(\"Sheet.Overlay must be a direct child of Sheet. Move it next to Sheet.Handle and Sheet.Container.\");\n }\n return null;\n }\n return /* @__PURE__ */ _jsx(SheetOverlayFrame, {\n ...props,\n ref,\n onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? function() {\n context.setOpen(false);\n } : void 0)\n });\n});\nvar SheetContainer = createStyledHOC(SheetContainerFrame, function(param, forwardedRef) {\n var { scope, adjustPaddingForOffscreenContent, children, ...props } = param;\n var context = useSheetContext(scope);\n var { hasFit, disableRemoveScroll, frameSize, contentRef, open } = context;\n var composedContentRef = useComposedRefs(forwardedRef, contentRef);\n var offscreenSize = useSheetOffscreenSize(context);\n var stableFrameSize = useRef(frameSize);\n useEffect(function() {\n if (open && frameSize) {\n stableFrameSize.current = frameSize;\n }\n }, [\n open,\n frameSize\n ]);\n var sheetContents = useMemo(function() {\n var shouldUseFixedHeight = hasFit && !open && stableFrameSize.current;\n return /* @__PURE__ */ _jsxs(SheetContainerFrame, {\n ref: composedContentRef,\n flex: hasFit && open ? 0 : 1,\n flexBasis: hasFit ? \"auto\" : void 0,\n height: shouldUseFixedHeight ? stableFrameSize.current : hasFit ? void 0 : frameSize,\n pointerEvents: open ? \"auto\" : \"none\",\n \"data-state\": open ? \"open\" : \"closed\",\n ...props,\n children: [\n /* @__PURE__ */ _jsx(StackZIndexContext, {\n zIndex: resolveViewZIndex(props.zIndex),\n children\n }),\n adjustPaddingForOffscreenContent && /* @__PURE__ */ _jsx(View, {\n \"data-sheet-offscreen-pad\": true,\n height: offscreenSize,\n width: \"100%\"\n })\n ]\n });\n }, [\n open,\n props,\n frameSize,\n offscreenSize,\n adjustPaddingForOffscreenContent,\n hasFit\n ]);\n return /* @__PURE__ */ _jsx(RemoveScroll, {\n enabled: !disableRemoveScroll && context.open,\n children: sheetContents\n });\n});\nvar SheetBackground = createStyledHOC(SheetBackgroundFrame, function(param, forwardedRef) {\n var { scope, disableHideBottomOverflow, ...props } = param;\n var context = useSheetContext(scope);\n var bottomOverflow = isWeb ? Math.max(context.frameSize, getMaxViewportHeight()) : context.frameSize;\n return /* @__PURE__ */ _jsx(SheetBackgroundFrame, {\n ref: forwardedRef,\n \"data-sheet-background\": \"\",\n bottom: disableHideBottomOverflow ? 0 : -bottomOverflow,\n ...props\n });\n});\nvar SheetRoot = createRefComponent(function SheetRoot2(props, ref) {\n var hydrated = useDidFinishSSR();\n var isAdapted = useAdaptIsActive();\n var adaptContext = useAdaptContext();\n var { isShowingNonSheet } = useSheetController(props.scope);\n var shouldUseAdapt = Boolean(adaptContext.open !== void 0 || adaptContext.onOpenChange);\n var isShowingAdaptNonSheet = shouldUseAdapt && !adaptContext.active && adaptContext.open;\n var SheetImplementation = SheetImplementationCustom;\n if (props.native) {\n var impl = getNativeSheet(\"ios\");\n if (impl) {\n SheetImplementation = impl;\n }\n }\n if (isShowingAdaptNonSheet || isShowingNonSheet || !hydrated) {\n return null;\n }\n var implementation = /* @__PURE__ */ _jsx(SheetImplementation, {\n ref,\n ...props\n });\n return isAdapted ? /* @__PURE__ */ _jsx(AdaptCapabilities, {\n scroll: true,\n overlay: true,\n dismiss: true,\n children: implementation\n }) : implementation;\n});\nvar sheetParts = {\n Container: SheetContainer,\n Background: SheetBackground,\n Overlay: SheetOverlay,\n Handle: SheetHandle,\n ScrollView: SheetScrollView\n};\nvar SheetControlled = withStaticProperties(SheetRoot, sheetParts);\nvar Sheet = withStaticProperties(SheetRoot, {\n Root: SheetRoot,\n Controlled: SheetControlled,\n useAnimatedPosition,\n ...sheetParts\n});\nexport {\n Sheet,\n SheetBackground,\n SheetContainer,\n SheetControlled,\n SheetHandle,\n SheetOverlay,\n SheetRoot\n};\n//# sourceMappingURL=Sheet.js.map\n"],"mappings":"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"}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { createStyledContext } from "@tamagui/core";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
const SheetContext = createStyledContext({}, "Sheet__");
|
|
5
|
+
const { Provider: SheetProvider, useStyledContext: useSheetContext } = SheetContext;
|
|
6
|
+
const SheetOverlayLayerContext = React.createContext(false);
|
|
7
|
+
const SheetNativeSystemContext = React.createContext(false);
|
|
8
|
+
const SheetAnimatedPositionContext = React.createContext(null);
|
|
9
|
+
function useAnimatedPosition() {
|
|
10
|
+
const context = React.useContext(SheetAnimatedPositionContext);
|
|
11
|
+
const isNativeSystemSheet = React.useContext(SheetNativeSystemContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
if (isNativeSystemSheet) {
|
|
14
|
+
throw new Error("Sheet.useAnimatedPosition() is unavailable when Sheet uses the native iOS system sheet because UIKit does not expose its continuous position. Remove the `native` prop to use Tamagui's custom Sheet and animated position hooks.");
|
|
15
|
+
}
|
|
16
|
+
throw new Error("Sheet.useAnimatedPosition() must be used inside a <Sheet>. Render the component that calls it as a child of Sheet.");
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { SheetAnimatedPositionContext, SheetContext, SheetNativeSystemContext, SheetOverlayLayerContext, SheetProvider, useAnimatedPosition, useSheetContext };
|
|
6
22
|
//# sourceMappingURL=SheetContext.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"SheetContext.js","names":[],"sources":["esm/SheetContext.js"],"sourcesContent":["import { createStyledContext } from \"@tamagui/core\";\nimport React from \"react\";\nconst SheetContext = createStyledContext({}, \"Sheet__\");\nconst { Provider: SheetProvider, useStyledContext: useSheetContext } = SheetContext;\nconst SheetOverlayLayerContext = React.createContext(false);\nconst SheetNativeSystemContext = React.createContext(false);\nconst SheetAnimatedPositionContext = React.createContext(null);\nfunction useAnimatedPosition() {\n const context = React.useContext(SheetAnimatedPositionContext);\n const isNativeSystemSheet = React.useContext(SheetNativeSystemContext);\n if (!context) {\n if (isNativeSystemSheet) {\n throw new Error(\n \"Sheet.useAnimatedPosition() is unavailable when Sheet uses the native iOS system sheet because UIKit does not expose its continuous position. Remove the `native` prop to use Tamagui's custom Sheet and animated position hooks.\"\n );\n }\n throw new Error(\n \"Sheet.useAnimatedPosition() must be used inside a <Sheet>. Render the component that calls it as a child of Sheet.\"\n );\n }\n return context;\n}\nexport {\n SheetAnimatedPositionContext,\n SheetContext,\n SheetNativeSystemContext,\n SheetOverlayLayerContext,\n SheetProvider,\n useAnimatedPosition,\n useSheetContext\n};\n//# sourceMappingURL=SheetContext.js.map\n"],"mappings":";;;;AAEA,MAAM,eAAe,oBAAoB,CAAC,GAAG,SAAS;AACtD,MAAM,EAAE,UAAU,eAAe,kBAAkB,oBAAoB;AACvE,MAAM,2BAA2B,MAAM,cAAc,KAAK;AAC1D,MAAM,2BAA2B,MAAM,cAAc,KAAK;AAC1D,MAAM,+BAA+B,MAAM,cAAc,IAAI;AAC7D,SAAS,sBAAsB;CAC7B,MAAM,UAAU,MAAM,WAAW,4BAA4B;CAC7D,MAAM,sBAAsB,MAAM,WAAW,wBAAwB;CACrE,IAAI,CAAC,SAAS;EACZ,IAAI,qBAAqB;GACvB,MAAM,IAAI,MACR,mOACF;EACF;EACA,MAAM,IAAI,MACR,oHACF;CACF;CACA,OAAO;AACT"}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
import { createStyledContext } from "@tamagui/core";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
var SheetContext = createStyledContext({}, "Sheet__");
|
|
5
|
+
var { Provider: SheetProvider, useStyledContext: useSheetContext } = SheetContext;
|
|
6
|
+
var SheetOverlayLayerContext = /* @__PURE__ */ React.createContext(false);
|
|
7
|
+
var SheetNativeSystemContext = /* @__PURE__ */ React.createContext(false);
|
|
8
|
+
var SheetAnimatedPositionContext = /* @__PURE__ */ React.createContext(null);
|
|
9
|
+
function useAnimatedPosition() {
|
|
10
|
+
var context = React.useContext(SheetAnimatedPositionContext);
|
|
11
|
+
var isNativeSystemSheet = React.useContext(SheetNativeSystemContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
if (isNativeSystemSheet) {
|
|
14
|
+
throw new Error("Sheet.useAnimatedPosition() is unavailable when Sheet uses the native iOS system sheet because UIKit does not expose its continuous position. Remove the `native` prop to use Tamagui's custom Sheet and animated position hooks.");
|
|
15
|
+
}
|
|
16
|
+
throw new Error("Sheet.useAnimatedPosition() must be used inside a <Sheet>. Render the component that calls it as a child of Sheet.");
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { SheetAnimatedPositionContext, SheetContext, SheetNativeSystemContext, SheetOverlayLayerContext, SheetProvider, useAnimatedPosition, useSheetContext };
|
|
6
22
|
//# sourceMappingURL=SheetContext.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"SheetContext.native.js","names":[],"sources":["esm/SheetContext.native.js"],"sourcesContent":["import { createStyledContext } from \"@tamagui/core\";\nimport React from \"react\";\nvar SheetContext = createStyledContext({}, \"Sheet__\");\nvar { Provider: SheetProvider, useStyledContext: useSheetContext } = SheetContext;\nvar SheetOverlayLayerContext = /* @__PURE__ */ React.createContext(false);\nvar SheetNativeSystemContext = /* @__PURE__ */ React.createContext(false);\nvar SheetAnimatedPositionContext = /* @__PURE__ */ React.createContext(null);\nfunction useAnimatedPosition() {\n var context = React.useContext(SheetAnimatedPositionContext);\n var isNativeSystemSheet = React.useContext(SheetNativeSystemContext);\n if (!context) {\n if (isNativeSystemSheet) {\n throw new Error(\"Sheet.useAnimatedPosition() is unavailable when Sheet uses the native iOS system sheet because UIKit does not expose its continuous position. Remove the `native` prop to use Tamagui's custom Sheet and animated position hooks.\");\n }\n throw new Error(\"Sheet.useAnimatedPosition() must be used inside a <Sheet>. Render the component that calls it as a child of Sheet.\");\n }\n return context;\n}\nexport {\n SheetAnimatedPositionContext,\n SheetContext,\n SheetNativeSystemContext,\n SheetOverlayLayerContext,\n SheetProvider,\n useAnimatedPosition,\n useSheetContext\n};\n//# sourceMappingURL=SheetContext.js.map\n"],"mappings":";;;;AAEA,IAAI,eAAe,oBAAoB,CAAC,GAAG,SAAS;AACpD,IAAI,EAAE,UAAU,eAAe,kBAAkB,oBAAoB;AACrE,IAAI,2BAA2C,sBAAM,cAAc,KAAK;AACxE,IAAI,2BAA2C,sBAAM,cAAc,KAAK;AACxE,IAAI,+BAA+C,sBAAM,cAAc,IAAI;AAC3E,SAAS,sBAAsB;CAC7B,IAAI,UAAU,MAAM,WAAW,4BAA4B;CAC3D,IAAI,sBAAsB,MAAM,WAAW,wBAAwB;CACnE,IAAI,CAAC,SAAS;EACZ,IAAI,qBAAqB;GACvB,MAAM,IAAI,MAAM,mOAAmO;EACrP;EACA,MAAM,IAAI,MAAM,oHAAoH;CACtI;CACA,OAAO;AACT"}
|
|
@@ -2,36 +2,40 @@ import React, { useId, useRef } from "react";
|
|
|
2
2
|
import { useEvent } from "@tamagui/core";
|
|
3
3
|
import { SheetControllerContext } from "./useSheetController.mjs";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
5
|
+
|
|
6
|
+
const SheetController = ({ children, onOpenChange: onOpenChangeProp, onTransition: onTransitionProp, open, hidden, disableDrag, scope = "" }) => {
|
|
7
|
+
const onOpenChange = useEvent(onOpenChangeProp);
|
|
8
|
+
const onTransition = useEvent(onTransitionProp);
|
|
9
|
+
const id = useId();
|
|
10
|
+
const wasHiddenRef = useRef(hidden);
|
|
11
|
+
let skipNextAnimation = false;
|
|
12
|
+
if (wasHiddenRef.current && !hidden && open) {
|
|
13
|
+
skipNextAnimation = true;
|
|
14
|
+
}
|
|
15
|
+
wasHiddenRef.current = hidden;
|
|
16
|
+
const memoValue = React.useMemo(() => ({
|
|
17
|
+
id,
|
|
18
|
+
open,
|
|
19
|
+
hidden,
|
|
20
|
+
disableDrag,
|
|
21
|
+
onOpenChange,
|
|
22
|
+
onTransition,
|
|
23
|
+
skipNextAnimation
|
|
24
|
+
}), [
|
|
25
|
+
id,
|
|
26
|
+
onOpenChange,
|
|
27
|
+
onTransition,
|
|
28
|
+
open,
|
|
29
|
+
hidden,
|
|
30
|
+
disableDrag,
|
|
31
|
+
skipNextAnimation
|
|
32
|
+
]);
|
|
33
|
+
return /* @__PURE__ */ jsx(SheetControllerContext.Provider, {
|
|
34
|
+
scope,
|
|
35
|
+
...memoValue,
|
|
36
|
+
children
|
|
37
|
+
});
|
|
35
38
|
};
|
|
39
|
+
|
|
36
40
|
export { SheetController };
|
|
37
41
|
//# sourceMappingURL=SheetController.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"SheetController.js","names":[],"sources":["esm/SheetController.js"],"sourcesContent":["import React, { useId, useRef } from \"react\";\nimport { useEvent } from \"@tamagui/core\";\nimport { SheetControllerContext } from \"./useSheetController\";\nimport { jsx } from \"react/jsx-runtime\";\nconst SheetController = ({\n children,\n onOpenChange: onOpenChangeProp,\n onTransition: onTransitionProp,\n open,\n hidden,\n disableDrag,\n scope = \"\"\n}) => {\n const onOpenChange = useEvent(onOpenChangeProp);\n const onTransition = useEvent(onTransitionProp);\n const id = useId();\n const wasHiddenRef = useRef(hidden);\n let skipNextAnimation = false;\n if (wasHiddenRef.current && !hidden && open) {\n skipNextAnimation = true;\n }\n wasHiddenRef.current = hidden;\n const memoValue = React.useMemo(\n () => ({\n id,\n open,\n hidden,\n disableDrag,\n onOpenChange,\n onTransition,\n skipNextAnimation\n }),\n [id, onOpenChange, onTransition, open, hidden, disableDrag, skipNextAnimation]\n );\n return /* @__PURE__ */ jsx(SheetControllerContext.Provider, { scope, ...memoValue, children });\n};\nexport {\n SheetController\n};\n//# sourceMappingURL=SheetController.js.map\n"],"mappings":";;;;;;AAIA,MAAM,mBAAmB,EACvB,UACA,cAAc,kBACd,cAAc,kBACd,MACA,QACA,aACA,QAAQ,SACJ;CACJ,MAAM,eAAe,SAAS,gBAAgB;CAC9C,MAAM,eAAe,SAAS,gBAAgB;CAC9C,MAAM,KAAK,MAAM;CACjB,MAAM,eAAe,OAAO,MAAM;CAClC,IAAI,oBAAoB;CACxB,IAAI,aAAa,WAAW,CAAC,UAAU,MAAM;EAC3C,oBAAoB;CACtB;CACA,aAAa,UAAU;CACvB,MAAM,YAAY,MAAM,eACf;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAI;EAAc;EAAc;EAAM;EAAQ;EAAa;CAAiB,CAC/E;CACA,OAAuB,oBAAI,uBAAuB,UAAU;EAAE;EAAO,GAAG;EAAW;CAAS,CAAC;AAC/F"}
|
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useId, useRef } from "react";
|
|
3
3
|
import { useEvent } from "@tamagui/core";
|
|
4
4
|
import { SheetControllerContext } from "./useSheetController.native.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
5
|
+
|
|
6
|
+
var SheetController = function(param) {
|
|
7
|
+
var { children, onOpenChange: onOpenChangeProp, onTransition: onTransitionProp, open, hidden, disableDrag, scope = "" } = param;
|
|
8
|
+
var onOpenChange = useEvent(onOpenChangeProp);
|
|
9
|
+
var onTransition = useEvent(onTransitionProp);
|
|
10
|
+
var id = useId();
|
|
11
|
+
var wasHiddenRef = useRef(hidden);
|
|
12
|
+
var skipNextAnimation = false;
|
|
13
|
+
if (wasHiddenRef.current && !hidden && open) {
|
|
14
|
+
skipNextAnimation = true;
|
|
15
|
+
}
|
|
16
|
+
wasHiddenRef.current = hidden;
|
|
17
|
+
var memoValue = React.useMemo(function() {
|
|
18
|
+
return {
|
|
19
|
+
id,
|
|
20
|
+
open,
|
|
21
|
+
hidden,
|
|
22
|
+
disableDrag,
|
|
23
|
+
onOpenChange,
|
|
24
|
+
onTransition,
|
|
25
|
+
skipNextAnimation
|
|
26
|
+
};
|
|
27
|
+
}, [
|
|
28
|
+
id,
|
|
29
|
+
onOpenChange,
|
|
30
|
+
onTransition,
|
|
31
|
+
open,
|
|
32
|
+
hidden,
|
|
33
|
+
disableDrag,
|
|
34
|
+
skipNextAnimation
|
|
35
|
+
]);
|
|
36
|
+
return /* @__PURE__ */ jsx(SheetControllerContext.Provider, {
|
|
37
|
+
scope,
|
|
38
|
+
...memoValue,
|
|
39
|
+
children
|
|
40
|
+
});
|
|
38
41
|
};
|
|
42
|
+
|
|
39
43
|
export { SheetController };
|
|
40
44
|
//# sourceMappingURL=SheetController.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"file":"SheetController.native.js","names":[],"sources":["esm/SheetController.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React, { useId, useRef } from \"react\";\nimport { useEvent } from \"@tamagui/core\";\nimport { SheetControllerContext } from \"./useSheetController\";\nvar SheetController = function(param) {\n var { children, onOpenChange: onOpenChangeProp, onTransition: onTransitionProp, open, hidden, disableDrag, scope = \"\" } = param;\n var onOpenChange = useEvent(onOpenChangeProp);\n var onTransition = useEvent(onTransitionProp);\n var id = useId();\n var wasHiddenRef = useRef(hidden);\n var skipNextAnimation = false;\n if (wasHiddenRef.current && !hidden && open) {\n skipNextAnimation = true;\n }\n wasHiddenRef.current = hidden;\n var memoValue = React.useMemo(function() {\n return {\n id,\n open,\n hidden,\n disableDrag,\n onOpenChange,\n onTransition,\n skipNextAnimation\n };\n }, [\n id,\n onOpenChange,\n onTransition,\n open,\n hidden,\n disableDrag,\n skipNextAnimation\n ]);\n return /* @__PURE__ */ _jsx(SheetControllerContext.Provider, {\n scope,\n ...memoValue,\n children\n });\n};\nexport {\n SheetController\n};\n//# sourceMappingURL=SheetController.js.map\n"],"mappings":";;;;;;AAIA,IAAI,kBAAkB,SAAS,OAAO;CACpC,IAAI,EAAE,UAAU,cAAc,kBAAkB,cAAc,kBAAkB,MAAM,QAAQ,aAAa,QAAQ,OAAO;CAC1H,IAAI,eAAe,SAAS,gBAAgB;CAC5C,IAAI,eAAe,SAAS,gBAAgB;CAC5C,IAAI,KAAK,MAAM;CACf,IAAI,eAAe,OAAO,MAAM;CAChC,IAAI,oBAAoB;CACxB,IAAI,aAAa,WAAW,CAAC,UAAU,MAAM;EAC3C,oBAAoB;CACtB;CACA,aAAa,UAAU;CACvB,IAAI,YAAY,MAAM,QAAQ,WAAW;EACvC,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF,GAAG;EACD;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,OAAuB,oBAAK,uBAAuB,UAAU;EAC3D;EACA,GAAG;EACH;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { View } from "@tamagui/core";
|
|
2
|
+
import { PanResponder } from "@tamagui/react-native-pan-responder";
|
|
3
|
+
import { useResponderEvents } from "@tamagui/react-native-use-responder-events";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
function SheetDragSurface({ panConfig, children }) {
|
|
8
|
+
const ref = React.useRef(null);
|
|
9
|
+
const panHandlers = React.useMemo(() => panConfig ? PanResponder.create(panConfig).panHandlers : void 0, [panConfig]);
|
|
10
|
+
const { onClickCapture, ...responderHandlers } = panHandlers ?? {};
|
|
11
|
+
useResponderEvents(ref, responderHandlers);
|
|
12
|
+
const domProps = { onClickCapture };
|
|
13
|
+
return /* @__PURE__ */ jsx(View, {
|
|
14
|
+
ref,
|
|
15
|
+
...domProps,
|
|
16
|
+
flex: 1,
|
|
17
|
+
flexBasis: "auto",
|
|
18
|
+
width: "100%",
|
|
19
|
+
height: "100%",
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { SheetDragSurface };
|
|
25
|
+
//# sourceMappingURL=SheetDragSurface.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetDragSurface.js","names":[],"sources":["esm/SheetDragSurface.js"],"sourcesContent":["import { View } from \"@tamagui/core\";\nimport { PanResponder } from \"@tamagui/react-native-pan-responder\";\nimport { useResponderEvents } from \"@tamagui/react-native-use-responder-events\";\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction SheetDragSurface({ panConfig, children }) {\n const ref = React.useRef(null);\n const panHandlers = React.useMemo(\n () => panConfig ? PanResponder.create(panConfig).panHandlers : void 0,\n [panConfig]\n );\n const { onClickCapture, ...responderHandlers } = panHandlers ?? {};\n useResponderEvents(ref, responderHandlers);\n const domProps = { onClickCapture };\n return (\n // flexBasis auto, like the container frame: under the web style compat\n // `flex={1}` means a basis of 0, which collapses this surface inside the\n // animated wrapper (that wrapper has no height of its own in fit mode), and\n // a collapsed surface leaves the frame unmeasured and parked off-screen\n /* @__PURE__ */ jsx(View, { ref, ...domProps, flex: 1, flexBasis: \"auto\", width: \"100%\", height: \"100%\", children })\n );\n}\nexport {\n SheetDragSurface\n};\n//# sourceMappingURL=SheetDragSurface.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,iBAAiB,EAAE,WAAW,YAAY;CACjD,MAAM,MAAM,MAAM,OAAO,IAAI;CAC7B,MAAM,cAAc,MAAM,cAClB,YAAY,aAAa,OAAO,SAAS,CAAC,CAAC,cAAc,KAAK,GACpE,CAAC,SAAS,CACZ;CACA,MAAM,EAAE,gBAAgB,GAAG,sBAAsB,eAAe,CAAC;CACjE,mBAAmB,KAAK,iBAAiB;CACzC,MAAM,WAAW,EAAE,eAAe;CAClC,OAKkB,oBAAI,MAAM;EAAE;EAAK,GAAG;EAAU,MAAM;EAAG,WAAW;EAAQ,OAAO;EAAQ,QAAQ;EAAQ;CAAS,CAAC;AAEvH"}
|