@lodev09/react-native-true-sheet 4.0.0-beta.0 → 4.0.0-beta.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/LICENSE +1 -1
- package/README.md +42 -31
- package/RNTrueSheet.podspec +10 -2
- package/android/build.gradle +2 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +174 -49
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerViewManager.kt +7 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +371 -18
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +14 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +150 -21
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterViewManager.kt +14 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetHeaderView.kt +38 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetHeaderViewManager.kt +28 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +84 -24
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +5 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekView.kt +72 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPeekViewManager.kt +33 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetStateUpdater.kt +45 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +526 -231
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +1217 -603
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +136 -29
- package/android/src/main/java/com/lodev09/truesheet/core/RNScreensEventObserver.kt +63 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetBehavior.kt +36 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetView.kt +255 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetCoordinatorLayout.kt +303 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +277 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDimView.kt +162 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetGrabberView.kt +180 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetKeyboardObserver.kt +207 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetStackManager.kt +220 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetDragEvents.kt +71 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetFocusEvents.kt +65 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +112 -0
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetStateEvents.kt +56 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/KeyboardUtils.kt +84 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +93 -67
- package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +30 -0
- package/android/src/main/jni/CMakeLists.txt +63 -0
- package/android/src/main/jni/TrueSheetSpec.h +19 -0
- package/android/src/main/jni/TrueSheetStateUpdater.cpp +96 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +24 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +43 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +11 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +37 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h +24 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +56 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.cpp +11 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.h +41 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.cpp +18 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.h +16 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +61 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.h +45 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.cpp +23 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.h +52 -0
- package/ios/TrueSheetContainerView.h +81 -6
- package/ios/TrueSheetContainerView.mm +275 -21
- package/ios/TrueSheetContentView.h +38 -1
- package/ios/TrueSheetContentView.mm +413 -43
- package/ios/TrueSheetFooterView.h +27 -2
- package/ios/TrueSheetFooterView.mm +141 -35
- package/ios/{events/OnDidDismissEvent.h → TrueSheetHeaderView.h} +10 -7
- package/ios/TrueSheetHeaderView.mm +64 -0
- package/ios/TrueSheetModule.mm +92 -5
- package/ios/TrueSheetPeekView.h +32 -0
- package/ios/TrueSheetPeekView.mm +99 -0
- package/ios/TrueSheetView.h +7 -15
- package/ios/TrueSheetView.mm +633 -215
- package/ios/TrueSheetViewController.h +84 -16
- package/ios/TrueSheetViewController.mm +1136 -333
- package/ios/core/RNScreensEventObserver.h +46 -0
- package/ios/core/RNScreensEventObserver.mm +280 -0
- package/ios/core/TrueSheetBlurView.h +27 -0
- package/ios/core/TrueSheetBlurView.mm +82 -0
- package/ios/core/TrueSheetDetentCalculator.h +107 -0
- package/ios/core/TrueSheetDetentCalculator.mm +197 -0
- package/ios/core/TrueSheetGrabberView.h +72 -0
- package/ios/core/TrueSheetGrabberView.mm +178 -0
- package/ios/core/TrueSheetKeyboardObserver.h +39 -0
- package/ios/core/TrueSheetKeyboardObserver.mm +112 -0
- package/ios/events/TrueSheetDragEvents.h +39 -0
- package/ios/events/TrueSheetDragEvents.mm +62 -0
- package/ios/events/{OnPositionChangeEvent.h → TrueSheetFocusEvents.h} +8 -5
- package/ios/events/TrueSheetFocusEvents.mm +49 -0
- package/ios/events/TrueSheetLifecycleEvents.h +40 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +71 -0
- package/ios/events/TrueSheetStateEvents.h +35 -0
- package/ios/events/TrueSheetStateEvents.mm +49 -0
- package/ios/tvos/TrueSheetStubs.mm +154 -0
- package/ios/{events/OnMountEvent.h → utils/BlurUtil.h} +5 -7
- package/ios/utils/BlurUtil.mm +69 -0
- package/ios/utils/GestureUtil.h +7 -0
- package/ios/utils/GestureUtil.mm +12 -0
- package/ios/utils/PlatformUtil.h +15 -0
- package/ios/utils/UIView+FirstResponder.h +15 -0
- package/ios/utils/UIView+FirstResponder.mm +26 -0
- package/ios/{events/OnWillDismissEvent.h → utils/UIView+ScrollEdgeInteraction.h} +6 -7
- package/ios/utils/UIView+ScrollEdgeInteraction.mm +62 -0
- package/ios/utils/WindowUtil.mm +17 -1
- package/lib/module/TrueSheet.js +224 -64
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +1201 -0
- package/lib/module/TrueSheet.web.js.map +1 -0
- package/lib/module/TrueSheetPeek.js +15 -0
- package/lib/module/TrueSheetPeek.js.map +1 -0
- package/lib/module/TrueSheetPeek.web.js +55 -0
- package/lib/module/TrueSheetPeek.web.js.map +1 -0
- package/lib/module/TrueSheetProvider.js +28 -0
- package/lib/module/TrueSheetProvider.js.map +1 -0
- package/lib/module/TrueSheetProvider.web.js +157 -0
- package/lib/module/TrueSheetProvider.web.js.map +1 -0
- package/lib/module/fabric/TrueSheetContainerViewNativeComponent.ts +1 -1
- package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +5 -1
- package/lib/module/fabric/TrueSheetFooterViewNativeComponent.ts +10 -2
- package/lib/module/fabric/TrueSheetHeaderViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +105 -18
- package/lib/module/index.js +3 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/mocks/index.js +93 -0
- package/lib/module/mocks/index.js.map +1 -0
- package/lib/module/mocks/navigation.js +85 -0
- package/lib/module/mocks/navigation.js.map +1 -0
- package/lib/module/mocks/reanimated.js +91 -0
- package/lib/module/mocks/reanimated.js.map +1 -0
- package/lib/module/navigation/TrueSheetRouter.js +170 -0
- package/lib/module/navigation/TrueSheetRouter.js.map +1 -0
- package/lib/module/navigation/TrueSheetView.js +71 -0
- package/lib/module/navigation/TrueSheetView.js.map +1 -0
- package/lib/module/navigation/createTrueSheetNavigator.js +63 -0
- package/lib/module/navigation/createTrueSheetNavigator.js.map +1 -0
- package/lib/module/navigation/index.js +6 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js +56 -0
- package/lib/module/navigation/screen/ReanimatedTrueSheetScreen.js.map +1 -0
- package/lib/module/navigation/screen/TrueSheetScreen.js +49 -0
- package/lib/module/navigation/screen/TrueSheetScreen.js.map +1 -0
- package/lib/module/navigation/screen/index.js +5 -0
- package/lib/module/navigation/screen/index.js.map +1 -0
- package/lib/module/navigation/screen/types.js +4 -0
- package/lib/module/navigation/screen/types.js.map +1 -0
- package/lib/module/navigation/screen/useSheetScreenState.js +68 -0
- package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -0
- package/lib/module/navigation/types.js +4 -0
- package/lib/module/navigation/types.js.map +1 -0
- package/lib/module/navigation/useTrueSheetNavigation.js +24 -0
- package/lib/module/navigation/useTrueSheetNavigation.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTrueSheet.js +15 -9
- package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheet.web.js +81 -0
- package/lib/module/reanimated/ReanimatedTrueSheet.web.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +4 -2
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -1
- package/lib/module/reanimated/index.js +2 -2
- package/lib/module/reanimated/index.js.map +1 -1
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.web.js +20 -0
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.web.js.map +1 -0
- package/lib/module/specs/NativeTrueSheetModule.js.map +1 -1
- package/lib/module/web/constants.js +16 -0
- package/lib/module/web/constants.js.map +1 -0
- package/lib/module/web/vaul/README.md +9 -0
- package/lib/module/web/vaul/browser.js +30 -0
- package/lib/module/web/vaul/browser.js.map +1 -0
- package/lib/module/web/vaul/constants.js +15 -0
- package/lib/module/web/vaul/constants.js.map +1 -0
- package/lib/module/web/vaul/context.js +59 -0
- package/lib/module/web/vaul/context.js.map +1 -0
- package/lib/module/web/vaul/helpers.js +93 -0
- package/lib/module/web/vaul/helpers.js.map +1 -0
- package/lib/module/web/vaul/index.js +1309 -0
- package/lib/module/web/vaul/index.js.map +1 -0
- package/lib/module/web/vaul/style.css +287 -0
- package/lib/module/web/vaul/style.css.d.js +2 -0
- package/lib/module/web/vaul/style.css.d.js.map +1 -0
- package/lib/module/web/vaul/types.js +2 -0
- package/lib/module/web/vaul/types.js.map +1 -0
- package/lib/module/web/vaul/use-composed-refs.js +34 -0
- package/lib/module/web/vaul/use-composed-refs.js.map +1 -0
- package/lib/module/web/vaul/use-controllable-state.js +54 -0
- package/lib/module/web/vaul/use-controllable-state.js.map +1 -0
- package/lib/module/web/vaul/use-position-fixed.js +123 -0
- package/lib/module/web/vaul/use-position-fixed.js.map +1 -0
- package/lib/module/web/vaul/use-prevent-scroll.js +258 -0
- package/lib/module/web/vaul/use-prevent-scroll.js.map +1 -0
- package/lib/module/web/vaul/use-scale-background.js +57 -0
- package/lib/module/web/vaul/use-scale-background.js.map +1 -0
- package/lib/module/web/vaul/use-snap-points.js +305 -0
- package/lib/module/web/vaul/use-snap-points.js.map +1 -0
- package/lib/typescript/src/TrueSheet.d.ts +51 -14
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +463 -54
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.web.d.ts +5 -0
- package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetPeek.d.ts +9 -0
- package/lib/typescript/src/TrueSheetPeek.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetPeek.web.d.ts +28 -0
- package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetProvider.d.ts +18 -0
- package/lib/typescript/src/TrueSheetProvider.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetProvider.web.d.ts +27 -0
- package/lib/typescript/src/TrueSheetProvider.web.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetContainerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetContentViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts +2 -0
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/TrueSheetHeaderViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetHeaderViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetPeekViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +67 -16
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mocks/index.d.ts +43 -0
- package/lib/typescript/src/mocks/index.d.ts.map +1 -0
- package/lib/typescript/src/mocks/navigation.d.ts +66 -0
- package/lib/typescript/src/mocks/navigation.d.ts.map +1 -0
- package/lib/typescript/src/mocks/reanimated.d.ts +48 -0
- package/lib/typescript/src/mocks/reanimated.d.ts.map +1 -0
- package/lib/typescript/src/navigation/TrueSheetRouter.d.ts +57 -0
- package/lib/typescript/src/navigation/TrueSheetRouter.d.ts.map +1 -0
- package/lib/typescript/src/navigation/TrueSheetView.d.ts +10 -0
- package/lib/typescript/src/navigation/TrueSheetView.d.ts.map +1 -0
- package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts +35 -0
- package/lib/typescript/src/navigation/createTrueSheetNavigator.d.ts.map +1 -0
- package/lib/typescript/src/navigation/index.d.ts +6 -0
- package/lib/typescript/src/navigation/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts +3 -0
- package/lib/typescript/src/navigation/screen/ReanimatedTrueSheetScreen.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts +3 -0
- package/lib/typescript/src/navigation/screen/TrueSheetScreen.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/index.d.ts +4 -0
- package/lib/typescript/src/navigation/screen/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/types.d.ts +15 -0
- package/lib/typescript/src/navigation/screen/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +35 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -0
- package/lib/typescript/src/navigation/types.d.ts +153 -0
- package/lib/typescript/src/navigation/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts +23 -0
- package/lib/typescript/src/navigation/useTrueSheetNavigation.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.web.d.ts +41 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.web.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +8 -2
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -1
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.web.d.ts +15 -0
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.web.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts +25 -3
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts.map +1 -1
- package/lib/typescript/src/web/constants.d.ts +14 -0
- package/lib/typescript/src/web/constants.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/browser.d.ts +8 -0
- package/lib/typescript/src/web/vaul/browser.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/constants.d.ts +13 -0
- package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/context.d.ts +53 -0
- package/lib/typescript/src/web/vaul/context.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/helpers.d.ts +17 -0
- package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/index.d.ts +228 -0
- package/lib/typescript/src/web/vaul/index.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/types.d.ts +7 -0
- package/lib/typescript/src/web/vaul/types.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-composed-refs.d.ts +14 -0
- package/lib/typescript/src/web/vaul/use-composed-refs.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-controllable-state.d.ts +9 -0
- package/lib/typescript/src/web/vaul/use-controllable-state.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-position-fixed.d.ts +19 -0
- package/lib/typescript/src/web/vaul/use-position-fixed.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-prevent-scroll.d.ts +18 -0
- package/lib/typescript/src/web/vaul/use-prevent-scroll.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-scale-background.d.ts +2 -0
- package/lib/typescript/src/web/vaul/use-scale-background.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/use-snap-points.d.ts +38 -0
- package/lib/typescript/src/web/vaul/use-snap-points.d.ts.map +1 -0
- package/package.json +78 -34
- package/react-native.config.js +9 -2
- package/src/TrueSheet.tsx +276 -60
- package/src/TrueSheet.types.ts +525 -71
- package/src/TrueSheet.web.tsx +1366 -0
- package/src/TrueSheetPeek.tsx +11 -0
- package/src/TrueSheetPeek.web.tsx +63 -0
- package/src/TrueSheetProvider.tsx +33 -0
- package/src/TrueSheetProvider.web.tsx +220 -0
- package/src/fabric/TrueSheetContainerViewNativeComponent.ts +1 -1
- package/src/fabric/TrueSheetContentViewNativeComponent.ts +5 -1
- package/src/fabric/TrueSheetFooterViewNativeComponent.ts +10 -2
- package/src/fabric/TrueSheetHeaderViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +105 -18
- package/src/index.ts +2 -2
- package/src/mocks/index.ts +89 -0
- package/src/mocks/navigation.ts +72 -0
- package/src/mocks/reanimated.ts +101 -0
- package/src/navigation/TrueSheetRouter.ts +234 -0
- package/src/navigation/TrueSheetView.tsx +99 -0
- package/src/navigation/createTrueSheetNavigator.tsx +93 -0
- package/src/navigation/index.ts +14 -0
- package/src/navigation/screen/ReanimatedTrueSheetScreen.tsx +61 -0
- package/src/navigation/screen/TrueSheetScreen.tsx +54 -0
- package/src/navigation/screen/index.ts +3 -0
- package/src/navigation/screen/types.ts +21 -0
- package/src/navigation/screen/useSheetScreenState.ts +107 -0
- package/src/navigation/types.ts +219 -0
- package/src/navigation/useTrueSheetNavigation.ts +26 -0
- package/src/reanimated/ReanimatedTrueSheet.tsx +12 -7
- package/src/reanimated/ReanimatedTrueSheet.web.tsx +75 -0
- package/src/reanimated/ReanimatedTrueSheetProvider.tsx +12 -8
- package/src/reanimated/useReanimatedPositionChangeHandler.web.ts +31 -0
- package/src/specs/NativeTrueSheetModule.ts +28 -3
- package/src/web/constants.ts +13 -0
- package/src/web/vaul/README.md +9 -0
- package/src/web/vaul/browser.ts +38 -0
- package/src/web/vaul/constants.ts +20 -0
- package/src/web/vaul/context.ts +101 -0
- package/src/web/vaul/helpers.ts +124 -0
- package/src/web/vaul/index.tsx +1740 -0
- package/src/web/vaul/style.css +287 -0
- package/src/web/vaul/style.css.d.ts +1 -0
- package/src/web/vaul/types.ts +7 -0
- package/src/web/vaul/use-composed-refs.ts +35 -0
- package/src/web/vaul/use-controllable-state.ts +66 -0
- package/src/web/vaul/use-position-fixed.ts +147 -0
- package/src/web/vaul/use-prevent-scroll.ts +309 -0
- package/src/web/vaul/use-scale-background.ts +64 -0
- package/src/web/vaul/use-snap-points.ts +455 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +0 -26
- package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +0 -32
- package/android/src/main/java/com/lodev09/truesheet/events/SizeChangeEvent.kt +0 -27
- package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +0 -20
- package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +0 -26
- package/android/src/main/res/values/styles.xml +0 -8
- package/ios/events/OnDetentChangeEvent.h +0 -28
- package/ios/events/OnDetentChangeEvent.mm +0 -30
- package/ios/events/OnDidDismissEvent.mm +0 -25
- package/ios/events/OnDidPresentEvent.h +0 -28
- package/ios/events/OnDidPresentEvent.mm +0 -30
- package/ios/events/OnDragBeginEvent.h +0 -28
- package/ios/events/OnDragBeginEvent.mm +0 -30
- package/ios/events/OnDragChangeEvent.h +0 -28
- package/ios/events/OnDragChangeEvent.mm +0 -30
- package/ios/events/OnDragEndEvent.h +0 -28
- package/ios/events/OnDragEndEvent.mm +0 -30
- package/ios/events/OnMountEvent.mm +0 -25
- package/ios/events/OnPositionChangeEvent.mm +0 -32
- package/ios/events/OnSizeChangeEvent.h +0 -28
- package/ios/events/OnSizeChangeEvent.mm +0 -30
- package/ios/events/OnWillDismissEvent.mm +0 -25
- package/ios/events/OnWillPresentEvent.h +0 -28
- package/ios/events/OnWillPresentEvent.mm +0 -30
- package/ios/utils/LayoutUtil.h +0 -44
- package/ios/utils/LayoutUtil.mm +0 -50
- package/lib/module/TrueSheetGrabber.js +0 -51
- package/lib/module/TrueSheetGrabber.js.map +0 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts +0 -39
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +0 -1
- package/src/TrueSheetGrabber.tsx +0 -82
- package/src/__mocks__/index.js +0 -67
|
@@ -15,12 +15,15 @@ using namespace facebook::react;
|
|
|
15
15
|
|
|
16
16
|
NS_ASSUME_NONNULL_BEGIN
|
|
17
17
|
|
|
18
|
-
@interface
|
|
18
|
+
@interface TrueSheetFocusEvents : NSObject
|
|
19
19
|
|
|
20
|
-
+ (void)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
+ (void)emitWillFocus:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
21
|
+
|
|
22
|
+
+ (void)emitDidFocus:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
23
|
+
|
|
24
|
+
+ (void)emitWillBlur:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
25
|
+
|
|
26
|
+
+ (void)emitDidBlur:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
24
27
|
|
|
25
28
|
@end
|
|
26
29
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import "TrueSheetFocusEvents.h"
|
|
12
|
+
|
|
13
|
+
@implementation TrueSheetFocusEvents
|
|
14
|
+
|
|
15
|
+
+ (void)emitWillFocus:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
16
|
+
if (!eventEmitter)
|
|
17
|
+
return;
|
|
18
|
+
|
|
19
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
20
|
+
emitter->onWillFocus({});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
+ (void)emitDidFocus:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
24
|
+
if (!eventEmitter)
|
|
25
|
+
return;
|
|
26
|
+
|
|
27
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
28
|
+
emitter->onDidFocus({});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
+ (void)emitWillBlur:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
32
|
+
if (!eventEmitter)
|
|
33
|
+
return;
|
|
34
|
+
|
|
35
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
36
|
+
emitter->onWillBlur({});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
+ (void)emitDidBlur:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
40
|
+
if (!eventEmitter)
|
|
41
|
+
return;
|
|
42
|
+
|
|
43
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
44
|
+
emitter->onDidBlur({});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@end
|
|
48
|
+
|
|
49
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import <Foundation/Foundation.h>
|
|
12
|
+
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
|
|
18
|
+
@interface TrueSheetLifecycleEvents : NSObject
|
|
19
|
+
|
|
20
|
+
+ (void)emitMount:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
21
|
+
|
|
22
|
+
+ (void)emitWillPresent:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
23
|
+
index:(NSInteger)index
|
|
24
|
+
position:(CGFloat)position
|
|
25
|
+
detent:(CGFloat)detent;
|
|
26
|
+
|
|
27
|
+
+ (void)emitDidPresent:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
28
|
+
index:(NSInteger)index
|
|
29
|
+
position:(CGFloat)position
|
|
30
|
+
detent:(CGFloat)detent;
|
|
31
|
+
|
|
32
|
+
+ (void)emitWillDismiss:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
33
|
+
|
|
34
|
+
+ (void)emitDidDismiss:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
35
|
+
|
|
36
|
+
@end
|
|
37
|
+
|
|
38
|
+
NS_ASSUME_NONNULL_END
|
|
39
|
+
|
|
40
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import "TrueSheetLifecycleEvents.h"
|
|
12
|
+
|
|
13
|
+
@implementation TrueSheetLifecycleEvents
|
|
14
|
+
|
|
15
|
+
+ (void)emitMount:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
16
|
+
if (!eventEmitter)
|
|
17
|
+
return;
|
|
18
|
+
|
|
19
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
20
|
+
emitter->onMount({});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
+ (void)emitWillPresent:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
24
|
+
index:(NSInteger)index
|
|
25
|
+
position:(CGFloat)position
|
|
26
|
+
detent:(CGFloat)detent {
|
|
27
|
+
if (!eventEmitter)
|
|
28
|
+
return;
|
|
29
|
+
|
|
30
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
31
|
+
TrueSheetViewEventEmitter::OnWillPresent event;
|
|
32
|
+
event.index = static_cast<int>(index);
|
|
33
|
+
event.position = static_cast<double>(position);
|
|
34
|
+
event.detent = static_cast<double>(detent);
|
|
35
|
+
emitter->onWillPresent(event);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
+ (void)emitDidPresent:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
39
|
+
index:(NSInteger)index
|
|
40
|
+
position:(CGFloat)position
|
|
41
|
+
detent:(CGFloat)detent {
|
|
42
|
+
if (!eventEmitter)
|
|
43
|
+
return;
|
|
44
|
+
|
|
45
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
46
|
+
TrueSheetViewEventEmitter::OnDidPresent event;
|
|
47
|
+
event.index = static_cast<int>(index);
|
|
48
|
+
event.position = static_cast<double>(position);
|
|
49
|
+
event.detent = static_cast<double>(detent);
|
|
50
|
+
emitter->onDidPresent(event);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
+ (void)emitWillDismiss:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
54
|
+
if (!eventEmitter)
|
|
55
|
+
return;
|
|
56
|
+
|
|
57
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
58
|
+
emitter->onWillDismiss({});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
+ (void)emitDidDismiss:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter {
|
|
62
|
+
if (!eventEmitter)
|
|
63
|
+
return;
|
|
64
|
+
|
|
65
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
66
|
+
emitter->onDidDismiss({});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@end
|
|
70
|
+
|
|
71
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import <Foundation/Foundation.h>
|
|
12
|
+
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
+
|
|
14
|
+
using namespace facebook::react;
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
|
|
18
|
+
@interface TrueSheetStateEvents : NSObject
|
|
19
|
+
|
|
20
|
+
+ (void)emitDetentChange:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
+
index:(NSInteger)index
|
|
22
|
+
position:(CGFloat)position
|
|
23
|
+
detent:(CGFloat)detent;
|
|
24
|
+
|
|
25
|
+
+ (void)emitPositionChange:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
26
|
+
index:(CGFloat)index
|
|
27
|
+
position:(CGFloat)position
|
|
28
|
+
detent:(CGFloat)detent
|
|
29
|
+
realtime:(BOOL)realtime;
|
|
30
|
+
|
|
31
|
+
@end
|
|
32
|
+
|
|
33
|
+
NS_ASSUME_NONNULL_END
|
|
34
|
+
|
|
35
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import "TrueSheetStateEvents.h"
|
|
12
|
+
|
|
13
|
+
@implementation TrueSheetStateEvents
|
|
14
|
+
|
|
15
|
+
+ (void)emitDetentChange:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
+
index:(NSInteger)index
|
|
17
|
+
position:(CGFloat)position
|
|
18
|
+
detent:(CGFloat)detent {
|
|
19
|
+
if (!eventEmitter)
|
|
20
|
+
return;
|
|
21
|
+
|
|
22
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
23
|
+
TrueSheetViewEventEmitter::OnDetentChange event;
|
|
24
|
+
event.index = static_cast<int>(index);
|
|
25
|
+
event.position = static_cast<double>(position);
|
|
26
|
+
event.detent = static_cast<double>(detent);
|
|
27
|
+
emitter->onDetentChange(event);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
+ (void)emitPositionChange:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
31
|
+
index:(CGFloat)index
|
|
32
|
+
position:(CGFloat)position
|
|
33
|
+
detent:(CGFloat)detent
|
|
34
|
+
realtime:(BOOL)realtime {
|
|
35
|
+
if (!eventEmitter)
|
|
36
|
+
return;
|
|
37
|
+
|
|
38
|
+
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
39
|
+
TrueSheetViewEventEmitter::OnPositionChange event;
|
|
40
|
+
event.index = static_cast<double>(index);
|
|
41
|
+
event.position = static_cast<double>(position);
|
|
42
|
+
event.detent = static_cast<double>(detent);
|
|
43
|
+
event.realtime = static_cast<bool>(realtime);
|
|
44
|
+
emitter->onPositionChange(event);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@end
|
|
48
|
+
|
|
49
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
// tvOS stubs. Codegen registers TrueSheet components and looks them up via
|
|
10
|
+
// NSClassFromString on all Apple platforms, so the classes must exist on tvOS
|
|
11
|
+
// even though sheets are not supported there.
|
|
12
|
+
|
|
13
|
+
#import <TargetConditionals.h>
|
|
14
|
+
|
|
15
|
+
#if TARGET_OS_TV && defined(RCT_NEW_ARCH_ENABLED)
|
|
16
|
+
|
|
17
|
+
#import <React/RCTBridgeModule.h>
|
|
18
|
+
#import <React/RCTViewComponentView.h>
|
|
19
|
+
|
|
20
|
+
#import <react/renderer/components/TrueSheetSpec/ComponentDescriptors.h>
|
|
21
|
+
#import <react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h>
|
|
22
|
+
#import <react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h>
|
|
23
|
+
#import <react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h>
|
|
24
|
+
|
|
25
|
+
#import <TrueSheetSpec/TrueSheetSpec.h>
|
|
26
|
+
|
|
27
|
+
using namespace facebook::react;
|
|
28
|
+
|
|
29
|
+
#pragma mark - Component Views
|
|
30
|
+
|
|
31
|
+
@interface TrueSheetView : RCTViewComponentView
|
|
32
|
+
@end
|
|
33
|
+
|
|
34
|
+
@implementation TrueSheetView
|
|
35
|
+
|
|
36
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
37
|
+
return concreteComponentDescriptorProvider<TrueSheetViewComponentDescriptor>();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
@interface TrueSheetContainerView : RCTViewComponentView
|
|
43
|
+
@end
|
|
44
|
+
|
|
45
|
+
@implementation TrueSheetContainerView
|
|
46
|
+
|
|
47
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
48
|
+
return concreteComponentDescriptorProvider<TrueSheetContainerViewComponentDescriptor>();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@end
|
|
52
|
+
|
|
53
|
+
@interface TrueSheetContentView : RCTViewComponentView
|
|
54
|
+
@end
|
|
55
|
+
|
|
56
|
+
@implementation TrueSheetContentView
|
|
57
|
+
|
|
58
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
59
|
+
return concreteComponentDescriptorProvider<TrueSheetContentViewComponentDescriptor>();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@end
|
|
63
|
+
|
|
64
|
+
@interface TrueSheetHeaderView : RCTViewComponentView
|
|
65
|
+
@end
|
|
66
|
+
|
|
67
|
+
@implementation TrueSheetHeaderView
|
|
68
|
+
|
|
69
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
70
|
+
return concreteComponentDescriptorProvider<TrueSheetHeaderViewComponentDescriptor>();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@end
|
|
74
|
+
|
|
75
|
+
@interface TrueSheetFooterView : RCTViewComponentView
|
|
76
|
+
@end
|
|
77
|
+
|
|
78
|
+
@implementation TrueSheetFooterView
|
|
79
|
+
|
|
80
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
81
|
+
return concreteComponentDescriptorProvider<TrueSheetFooterViewComponentDescriptor>();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@end
|
|
85
|
+
|
|
86
|
+
@interface TrueSheetPeekView : RCTViewComponentView
|
|
87
|
+
@end
|
|
88
|
+
|
|
89
|
+
@implementation TrueSheetPeekView
|
|
90
|
+
|
|
91
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
92
|
+
return concreteComponentDescriptorProvider<TrueSheetPeekViewComponentDescriptor>();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@end
|
|
96
|
+
|
|
97
|
+
#pragma mark - Module
|
|
98
|
+
|
|
99
|
+
@interface TrueSheetModule : NSObject <RCTBridgeModule, NativeTrueSheetModuleSpec>
|
|
100
|
+
@end
|
|
101
|
+
|
|
102
|
+
@implementation TrueSheetModule
|
|
103
|
+
|
|
104
|
+
RCT_EXPORT_MODULE(TrueSheetModule)
|
|
105
|
+
|
|
106
|
+
+ (BOOL)requiresMainQueueSetup {
|
|
107
|
+
return NO;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
111
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
112
|
+
return std::make_shared<facebook::react::NativeTrueSheetModuleSpecJSI>(params);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
- (void)presentByRef:(double)viewTag
|
|
116
|
+
index:(double)index
|
|
117
|
+
animated:(BOOL)animated
|
|
118
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
119
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
120
|
+
reject(@"PRESENT_FAILED", @"TrueSheet is not supported on tvOS", nil);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
- (void)dismissByRef:(double)viewTag
|
|
124
|
+
animated:(BOOL)animated
|
|
125
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
126
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
127
|
+
resolve(nil);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
- (void)dismissStackByRef:(double)viewTag
|
|
131
|
+
animated:(BOOL)animated
|
|
132
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
133
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
134
|
+
resolve(nil);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
- (void)resizeByRef:(double)viewTag
|
|
138
|
+
index:(double)index
|
|
139
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
140
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
141
|
+
resolve(nil);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
- (void)handleBackPress:(double)viewTag resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
145
|
+
resolve(nil);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
- (void)dismissAll:(BOOL)animated resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
|
|
149
|
+
resolve(nil);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@end
|
|
153
|
+
|
|
154
|
+
#endif // TARGET_OS_TV && RCT_NEW_ARCH_ENABLED
|
|
@@ -8,19 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
10
|
|
|
11
|
-
#import <
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
11
|
+
#import <UIKit/UIKit.h>
|
|
12
|
+
#import <react/renderer/components/TrueSheetSpec/Props.h>
|
|
15
13
|
|
|
16
14
|
NS_ASSUME_NONNULL_BEGIN
|
|
17
15
|
|
|
18
|
-
@interface
|
|
16
|
+
@interface BlurUtil : NSObject
|
|
19
17
|
|
|
20
|
-
+ (
|
|
18
|
+
+ (UIBlurEffectStyle)blurEffectStyleFromEnum:(facebook::react::TrueSheetViewBackgroundBlur)blur;
|
|
21
19
|
|
|
22
20
|
@end
|
|
23
21
|
|
|
24
22
|
NS_ASSUME_NONNULL_END
|
|
25
23
|
|
|
26
|
-
#endif
|
|
24
|
+
#endif
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
|
+
|
|
11
|
+
#import "BlurUtil.h"
|
|
12
|
+
|
|
13
|
+
#import <react/renderer/components/TrueSheetSpec/Props.h>
|
|
14
|
+
|
|
15
|
+
using namespace facebook::react;
|
|
16
|
+
|
|
17
|
+
@implementation BlurUtil
|
|
18
|
+
|
|
19
|
+
+ (UIBlurEffectStyle)blurEffectStyleFromEnum:(TrueSheetViewBackgroundBlur)blur {
|
|
20
|
+
switch (blur) {
|
|
21
|
+
case TrueSheetViewBackgroundBlur::Dark:
|
|
22
|
+
return UIBlurEffectStyleDark;
|
|
23
|
+
case TrueSheetViewBackgroundBlur::ExtraLight:
|
|
24
|
+
return UIBlurEffectStyleExtraLight;
|
|
25
|
+
case TrueSheetViewBackgroundBlur::Regular:
|
|
26
|
+
return UIBlurEffectStyleRegular;
|
|
27
|
+
case TrueSheetViewBackgroundBlur::Prominent:
|
|
28
|
+
return UIBlurEffectStyleProminent;
|
|
29
|
+
case TrueSheetViewBackgroundBlur::SystemUltraThinMaterial:
|
|
30
|
+
return UIBlurEffectStyleSystemUltraThinMaterial;
|
|
31
|
+
case TrueSheetViewBackgroundBlur::SystemThinMaterial:
|
|
32
|
+
return UIBlurEffectStyleSystemThinMaterial;
|
|
33
|
+
case TrueSheetViewBackgroundBlur::SystemMaterial:
|
|
34
|
+
return UIBlurEffectStyleSystemMaterial;
|
|
35
|
+
case TrueSheetViewBackgroundBlur::SystemThickMaterial:
|
|
36
|
+
return UIBlurEffectStyleSystemThickMaterial;
|
|
37
|
+
case TrueSheetViewBackgroundBlur::SystemChromeMaterial:
|
|
38
|
+
return UIBlurEffectStyleSystemChromeMaterial;
|
|
39
|
+
case TrueSheetViewBackgroundBlur::SystemUltraThinMaterialLight:
|
|
40
|
+
return UIBlurEffectStyleSystemUltraThinMaterialLight;
|
|
41
|
+
case TrueSheetViewBackgroundBlur::SystemThinMaterialLight:
|
|
42
|
+
return UIBlurEffectStyleSystemThinMaterialLight;
|
|
43
|
+
case TrueSheetViewBackgroundBlur::SystemMaterialLight:
|
|
44
|
+
return UIBlurEffectStyleSystemMaterialLight;
|
|
45
|
+
case TrueSheetViewBackgroundBlur::SystemThickMaterialLight:
|
|
46
|
+
return UIBlurEffectStyleSystemThickMaterialLight;
|
|
47
|
+
case TrueSheetViewBackgroundBlur::SystemChromeMaterialLight:
|
|
48
|
+
return UIBlurEffectStyleSystemChromeMaterialLight;
|
|
49
|
+
case TrueSheetViewBackgroundBlur::SystemUltraThinMaterialDark:
|
|
50
|
+
return UIBlurEffectStyleSystemUltraThinMaterialDark;
|
|
51
|
+
case TrueSheetViewBackgroundBlur::SystemThinMaterialDark:
|
|
52
|
+
return UIBlurEffectStyleSystemThinMaterialDark;
|
|
53
|
+
case TrueSheetViewBackgroundBlur::SystemMaterialDark:
|
|
54
|
+
return UIBlurEffectStyleSystemMaterialDark;
|
|
55
|
+
case TrueSheetViewBackgroundBlur::SystemThickMaterialDark:
|
|
56
|
+
return UIBlurEffectStyleSystemThickMaterialDark;
|
|
57
|
+
case TrueSheetViewBackgroundBlur::SystemChromeMaterialDark:
|
|
58
|
+
return UIBlurEffectStyleSystemChromeMaterialDark;
|
|
59
|
+
case TrueSheetViewBackgroundBlur::Default:
|
|
60
|
+
case TrueSheetViewBackgroundBlur::Light:
|
|
61
|
+
case TrueSheetViewBackgroundBlur::None:
|
|
62
|
+
default:
|
|
63
|
+
return UIBlurEffectStyleLight;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@end
|
|
68
|
+
|
|
69
|
+
#endif
|
package/ios/utils/GestureUtil.h
CHANGED
|
@@ -20,6 +20,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
20
20
|
*/
|
|
21
21
|
+ (void)attachPanGestureHandler:(UIView *)view target:(id)target selector:(SEL)selector;
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Enables or disables all pan gesture recognizers on a view
|
|
25
|
+
* @param view The view whose pan gesture recognizers to enable/disable
|
|
26
|
+
* @param enabled Whether the pan gestures should be enabled
|
|
27
|
+
*/
|
|
28
|
+
+ (void)setPanGesturesEnabled:(BOOL)enabled forView:(UIView *)view;
|
|
29
|
+
|
|
23
30
|
@end
|
|
24
31
|
|
|
25
32
|
NS_ASSUME_NONNULL_END
|
package/ios/utils/GestureUtil.mm
CHANGED
|
@@ -23,4 +23,16 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
+ (void)setPanGesturesEnabled:(BOOL)enabled forView:(UIView *)view {
|
|
27
|
+
if (!view) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (UIGestureRecognizer *recognizer in view.gestureRecognizers ?: @[]) {
|
|
32
|
+
if ([recognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
|
|
33
|
+
recognizer.enabled = enabled;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
26
38
|
@end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#ifndef PlatformUtil_h
|
|
10
|
+
#define PlatformUtil_h
|
|
11
|
+
|
|
12
|
+
#define RNTS_IPHONE_OS_VERSION_AVAILABLE(v) \
|
|
13
|
+
(defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_##v) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_##v)
|
|
14
|
+
|
|
15
|
+
#endif /* PlatformUtil_h */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <UIKit/UIKit.h>
|
|
10
|
+
|
|
11
|
+
@interface UIView (FirstResponder)
|
|
12
|
+
|
|
13
|
+
- (UIView *)findFirstResponder;
|
|
14
|
+
|
|
15
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Jovanni Lo (@lodev09)
|
|
3
|
+
// Copyright (c) 2024-present. All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This source code is licensed under the MIT license found in the
|
|
6
|
+
// LICENSE file in the root directory of this source tree.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "UIView+FirstResponder.h"
|
|
10
|
+
|
|
11
|
+
@implementation UIView (FirstResponder)
|
|
12
|
+
|
|
13
|
+
- (UIView *)findFirstResponder {
|
|
14
|
+
if (self.isFirstResponder) {
|
|
15
|
+
return self;
|
|
16
|
+
}
|
|
17
|
+
for (UIView *subview in self.subviews) {
|
|
18
|
+
UIView *firstResponder = [subview findFirstResponder];
|
|
19
|
+
if (firstResponder) {
|
|
20
|
+
return firstResponder;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return nil;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@end
|
|
@@ -8,19 +8,18 @@
|
|
|
8
8
|
|
|
9
9
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
10
10
|
|
|
11
|
-
#import <
|
|
12
|
-
#import <react/renderer/components/TrueSheetSpec/EventEmitters.h>
|
|
13
|
-
|
|
14
|
-
using namespace facebook::react;
|
|
11
|
+
#import <UIKit/UIKit.h>
|
|
15
12
|
|
|
16
13
|
NS_ASSUME_NONNULL_BEGIN
|
|
17
14
|
|
|
18
|
-
@interface
|
|
15
|
+
@interface UIView (ScrollEdgeInteraction)
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
- (void)setupEdgeInteractionWithScrollView:(nullable UIScrollView *)scrollView
|
|
18
|
+
edge:(UIRectEdge)edge API_AVAILABLE(ios(26.0));
|
|
19
|
+
- (void)cleanupEdgeInteraction API_AVAILABLE(ios(26.0));
|
|
21
20
|
|
|
22
21
|
@end
|
|
23
22
|
|
|
24
23
|
NS_ASSUME_NONNULL_END
|
|
25
24
|
|
|
26
|
-
#endif
|
|
25
|
+
#endif
|