@lodev09/react-native-true-sheet 4.0.0-beta.0 → 4.0.0-beta.10
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 +62 -30
- package/RNTrueSheet.podspec +10 -2
- package/android/build.gradle +24 -2
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +189 -47
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerViewManager.kt +7 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +401 -19
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +18 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +145 -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/TrueSheetOverlayView.kt +106 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayViewManager.kt +45 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +6 -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 +63 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +564 -226
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +1399 -598
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +161 -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 +375 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +299 -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/TrueSheetOverlayRootView.kt +137 -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 +127 -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/TouchEventDeduper.kt +31 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +42 -0
- package/android/src/main/jni/CMakeLists.txt +63 -0
- package/android/src/main/jni/TrueSheetSpec.h +20 -0
- package/android/src/main/jni/TrueSheetStateUpdater.cpp +96 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +16 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +68 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +33 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +11 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +39 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h +24 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +63 -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/TrueSheetLayoutUtils.h +46 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewComponentDescriptor.h +21 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.cpp +17 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetOverlayViewShadowNode.h +36 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +28 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +30 -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 +88 -6
- package/ios/TrueSheetContainerView.mm +278 -21
- package/ios/TrueSheetContentView.h +54 -1
- package/ios/TrueSheetContentView.mm +371 -47
- package/ios/TrueSheetFooterView.h +33 -2
- package/ios/TrueSheetFooterView.mm +187 -35
- package/ios/{events/OnWillDismissEvent.h → TrueSheetHeaderView.h} +10 -7
- package/ios/TrueSheetHeaderView.mm +64 -0
- package/ios/TrueSheetModule.h +2 -7
- package/ios/TrueSheetModule.mm +98 -20
- package/ios/TrueSheetOverlayView.h +32 -0
- package/ios/TrueSheetOverlayView.mm +161 -0
- package/ios/TrueSheetPeekView.h +32 -0
- package/ios/TrueSheetPeekView.mm +99 -0
- package/ios/TrueSheetView.h +7 -15
- package/ios/TrueSheetView.mm +775 -215
- package/ios/TrueSheetViewController.h +94 -16
- package/ios/TrueSheetViewController.mm +1316 -331
- 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 +188 -0
- package/ios/core/TrueSheetKeyboardObserver.h +39 -0
- package/ios/core/TrueSheetKeyboardObserver.mm +112 -0
- package/ios/core/TrueSheetOverlayContainerView.h +31 -0
- package/ios/core/TrueSheetOverlayContainerView.mm +35 -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 +42 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +79 -0
- package/ios/events/TrueSheetStateEvents.h +35 -0
- package/ios/events/TrueSheetStateEvents.mm +49 -0
- package/ios/tvos/TrueSheetStubs.mm +166 -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/utils/UIView+ScrollEdgeInteraction.h +26 -0
- package/ios/utils/UIView+ScrollEdgeInteraction.mm +84 -0
- package/ios/utils/WindowUtil.mm +17 -1
- package/lib/module/TrueSheet.js +349 -74
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +1270 -0
- package/lib/module/TrueSheet.web.js.map +1 -0
- package/lib/module/TrueSheetOverlay.js +30 -0
- package/lib/module/TrueSheetOverlay.js.map +1 -0
- package/lib/module/TrueSheetOverlay.web.js +35 -0
- package/lib/module/TrueSheetOverlay.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/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/lib/module/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +110 -18
- package/lib/module/index.js +4 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/mocks/index.js +103 -0
- package/lib/module/mocks/index.js.map +1 -0
- package/lib/module/mocks/navigation.js +95 -0
- package/lib/module/mocks/navigation.js.map +1 -0
- package/lib/module/mocks/navigationExpoRouter.js +21 -0
- package/lib/module/mocks/navigationExpoRouter.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/TrueSheetNavigatorContent.js +73 -0
- package/lib/module/navigation/TrueSheetNavigatorContent.js.map +1 -0
- package/lib/module/navigation/actions.js +50 -0
- package/lib/module/navigation/actions.js.map +1 -0
- package/lib/module/navigation/base-types.js +2 -0
- package/lib/module/navigation/base-types.js.map +1 -0
- package/lib/module/navigation/createTrueSheetRouter.js +157 -0
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
- package/lib/module/navigation/expo-router/base-types.js +2 -0
- package/lib/module/navigation/expo-router/base-types.js.map +1 -0
- package/lib/module/navigation/expo-router/index.js +50 -0
- package/lib/module/navigation/expo-router/index.js.map +1 -0
- package/lib/module/navigation/expo-router/types.js +4 -0
- package/lib/module/navigation/expo-router/types.js.map +1 -0
- package/lib/module/navigation/index.js +47 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/navigator.js +10 -0
- package/lib/module/navigation/navigator.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 +69 -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/dom.js +10 -0
- package/lib/module/web/dom.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 +19 -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 +99 -0
- package/lib/module/web/vaul/helpers.js.map +1 -0
- package/lib/module/web/vaul/index.js +1342 -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 +57 -14
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +535 -55
- 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/TrueSheetOverlay.d.ts +8 -0
- package/lib/typescript/src/TrueSheetOverlay.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheetOverlay.web.d.ts +8 -0
- package/lib/typescript/src/TrueSheetOverlay.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/TrueSheetOverlayViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetOverlayViewNativeComponent.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 +71 -16
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mocks/index.d.ts +47 -0
- package/lib/typescript/src/mocks/index.d.ts.map +1 -0
- package/lib/typescript/src/mocks/navigation.d.ts +70 -0
- package/lib/typescript/src/mocks/navigation.d.ts.map +1 -0
- package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +22 -0
- package/lib/typescript/src/mocks/navigationExpoRouter.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/TrueSheetNavigatorContent.d.ts +5 -0
- package/lib/typescript/src/navigation/TrueSheetNavigatorContent.d.ts.map +1 -0
- package/lib/typescript/src/navigation/actions.d.ts +71 -0
- package/lib/typescript/src/navigation/actions.d.ts.map +1 -0
- package/lib/typescript/src/navigation/base-types.d.ts +9 -0
- package/lib/typescript/src/navigation/base-types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts +3 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/base-types.d.ts +8 -0
- package/lib/typescript/src/navigation/expo-router/base-types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts +37 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/types.d.ts +44 -0
- package/lib/typescript/src/navigation/expo-router/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/index.d.ts +45 -0
- package/lib/typescript/src/navigation/index.d.ts.map +1 -0
- package/lib/typescript/src/navigation/navigator.d.ts +7 -0
- package/lib/typescript/src/navigation/navigator.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 +14 -0
- package/lib/typescript/src/navigation/screen/types.d.ts.map +1 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +34 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -0
- package/lib/typescript/src/navigation/types.d.ts +213 -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/dom.d.ts +7 -0
- package/lib/typescript/src/web/dom.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 +14 -0
- package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/context.d.ts +54 -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 +234 -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 +104 -37
- package/react-native.config.js +10 -2
- package/src/TrueSheet.tsx +424 -70
- package/src/TrueSheet.types.ts +602 -72
- package/src/TrueSheet.web.tsx +1437 -0
- package/src/TrueSheetOverlay.tsx +24 -0
- package/src/TrueSheetOverlay.web.tsx +33 -0
- package/src/TrueSheetPeek.tsx +11 -0
- package/src/TrueSheetPeek.web.tsx +64 -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/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/src/fabric/TrueSheetPeekViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +110 -18
- package/src/index.ts +3 -2
- package/src/mocks/index.ts +96 -0
- package/src/mocks/navigation.ts +79 -0
- package/src/mocks/navigationExpoRouter.ts +41 -0
- package/src/mocks/reanimated.ts +100 -0
- package/src/navigation/TrueSheetNavigatorContent.tsx +106 -0
- package/src/navigation/actions.ts +78 -0
- package/src/navigation/base-types.ts +20 -0
- package/src/navigation/createTrueSheetRouter.ts +194 -0
- package/src/navigation/expo-router/base-types.ts +18 -0
- package/src/navigation/expo-router/index.ts +90 -0
- package/src/navigation/expo-router/types.ts +116 -0
- package/src/navigation/index.ts +80 -0
- package/src/navigation/navigator.ts +18 -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 +19 -0
- package/src/navigation/screen/useSheetScreenState.ts +102 -0
- package/src/navigation/types.ts +302 -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/dom.ts +9 -0
- package/src/web/vaul/README.md +9 -0
- package/src/web/vaul/browser.ts +38 -0
- package/src/web/vaul/constants.ts +24 -0
- package/src/web/vaul/context.ts +102 -0
- package/src/web/vaul/helpers.ts +131 -0
- package/src/web/vaul/index.tsx +1785 -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.h +0 -26
- 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
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
package com.lodev09.truesheet.events
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Arguments
|
|
4
|
-
import com.facebook.react.bridge.WritableMap
|
|
5
|
-
import com.facebook.react.uimanager.events.Event
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Fired before the sheet is dismissed
|
|
9
|
-
*/
|
|
10
|
-
class WillDismissEvent(surfaceId: Int, viewId: Int) : Event<WillDismissEvent>(surfaceId, viewId) {
|
|
11
|
-
|
|
12
|
-
override fun getEventName(): String = EVENT_NAME
|
|
13
|
-
|
|
14
|
-
override fun getEventData(): WritableMap = Arguments.createMap()
|
|
15
|
-
|
|
16
|
-
companion object {
|
|
17
|
-
const val EVENT_NAME = "topWillDismiss"
|
|
18
|
-
const val REGISTRATION_NAME = "onWillDismiss"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
package com.lodev09.truesheet.events
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Arguments
|
|
4
|
-
import com.facebook.react.bridge.WritableMap
|
|
5
|
-
import com.facebook.react.uimanager.events.Event
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Fired before the sheet is presented
|
|
9
|
-
* Payload: { index: number, position: number }
|
|
10
|
-
*/
|
|
11
|
-
class WillPresentEvent(surfaceId: Int, viewId: Int, private val index: Int, private val position: Float) :
|
|
12
|
-
Event<WillPresentEvent>(surfaceId, viewId) {
|
|
13
|
-
|
|
14
|
-
override fun getEventName(): String = EVENT_NAME
|
|
15
|
-
|
|
16
|
-
override fun getEventData(): WritableMap =
|
|
17
|
-
Arguments.createMap().apply {
|
|
18
|
-
putInt("index", index)
|
|
19
|
-
putDouble("position", position.toDouble())
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
companion object {
|
|
23
|
-
const val EVENT_NAME = "topWillPresent"
|
|
24
|
-
const val REGISTRATION_NAME = "onWillPresent"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<resources>
|
|
3
|
-
<!-- Custom BottomSheetDialog style with edge-to-edge enabled -->
|
|
4
|
-
<style name="TrueSheetEdgeToEdgeEnabledDialog" parent="Theme.Design.Light.BottomSheetDialog">
|
|
5
|
-
<item name="android:windowIsFloating">false</item>
|
|
6
|
-
<item name="enableEdgeToEdge">true</item>
|
|
7
|
-
</style>
|
|
8
|
-
</resources>
|
|
@@ -1,28 +0,0 @@
|
|
|
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 OnDetentChangeEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDetentChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDetentChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDetentChange event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDetentChange(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,26 +0,0 @@
|
|
|
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 OnDidDismissEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter;
|
|
21
|
-
|
|
22
|
-
@end
|
|
23
|
-
|
|
24
|
-
NS_ASSUME_NONNULL_END
|
|
25
|
-
|
|
26
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,25 +0,0 @@
|
|
|
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 "OnDidDismissEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDidDismissEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(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->onDidDismiss({});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 OnDidPresentEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDidPresentEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDidPresentEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDidPresent event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDidPresent(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 OnDragBeginEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDragBeginEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDragBeginEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDragBegin event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDragBegin(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 OnDragChangeEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDragChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDragChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDragChange event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDragChange(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 OnDragEndEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnDragEndEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnDragEndEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnDragEnd event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onDragEnd(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,25 +0,0 @@
|
|
|
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 "OnMountEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnMountEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(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
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,32 +0,0 @@
|
|
|
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 "OnPositionChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnPositionChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position
|
|
18
|
-
transitioning:(BOOL)transitioning {
|
|
19
|
-
if (!eventEmitter)
|
|
20
|
-
return;
|
|
21
|
-
|
|
22
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
23
|
-
TrueSheetViewEventEmitter::OnPositionChange event;
|
|
24
|
-
event.index = static_cast<int>(index);
|
|
25
|
-
event.position = static_cast<double>(position);
|
|
26
|
-
event.transitioning = static_cast<bool>(transitioning);
|
|
27
|
-
emitter->onPositionChange(event);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@end
|
|
31
|
-
|
|
32
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 OnSizeChangeEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
width:(CGFloat)width
|
|
22
|
-
height:(CGFloat)height;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnSizeChangeEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnSizeChangeEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
width:(CGFloat)width
|
|
17
|
-
height:(CGFloat)height {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnSizeChange event;
|
|
23
|
-
event.width = static_cast<double>(width);
|
|
24
|
-
event.height = static_cast<double>(height);
|
|
25
|
-
emitter->onSizeChange(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,25 +0,0 @@
|
|
|
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 "OnWillDismissEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnWillDismissEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(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->onWillDismiss({});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
@end
|
|
24
|
-
|
|
25
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,28 +0,0 @@
|
|
|
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 OnWillPresentEvent : NSObject
|
|
19
|
-
|
|
20
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
21
|
-
index:(NSInteger)index
|
|
22
|
-
position:(CGFloat)position;
|
|
23
|
-
|
|
24
|
-
@end
|
|
25
|
-
|
|
26
|
-
NS_ASSUME_NONNULL_END
|
|
27
|
-
|
|
28
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
|
@@ -1,30 +0,0 @@
|
|
|
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 "OnWillPresentEvent.h"
|
|
12
|
-
|
|
13
|
-
@implementation OnWillPresentEvent
|
|
14
|
-
|
|
15
|
-
+ (void)emit:(std::shared_ptr<const facebook::react::EventEmitter>)eventEmitter
|
|
16
|
-
index:(NSInteger)index
|
|
17
|
-
position:(CGFloat)position {
|
|
18
|
-
if (!eventEmitter)
|
|
19
|
-
return;
|
|
20
|
-
|
|
21
|
-
auto emitter = std::static_pointer_cast<TrueSheetViewEventEmitter const>(eventEmitter);
|
|
22
|
-
TrueSheetViewEventEmitter::OnWillPresent event;
|
|
23
|
-
event.index = static_cast<int>(index);
|
|
24
|
-
event.position = static_cast<double>(position);
|
|
25
|
-
emitter->onWillPresent(event);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
@end
|
|
29
|
-
|
|
30
|
-
#endif // RCT_NEW_ARCH_ENABLED
|
package/ios/utils/LayoutUtil.h
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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 <UIKit/UIKit.h>
|
|
12
|
-
|
|
13
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
-
|
|
15
|
-
@interface LayoutUtil : NSObject
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Pins a view to its parent view using Auto Layout constraints
|
|
19
|
-
* @param view The view to pin
|
|
20
|
-
* @param parentView The parent view to pin to
|
|
21
|
-
* @param edges The edges to pin (UIRectEdge flags)
|
|
22
|
-
*/
|
|
23
|
-
+ (void)pinView:(UIView *)view toParentView:(UIView *)parentView edges:(UIRectEdge)edges;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Pins a view to its parent view with a specific height constraint
|
|
27
|
-
* @param view The view to pin
|
|
28
|
-
* @param parentView The parent view to pin to
|
|
29
|
-
* @param edges The edges to pin (UIRectEdge flags)
|
|
30
|
-
* @param height The height constraint to apply (0 means no height constraint)
|
|
31
|
-
*/
|
|
32
|
-
+ (void)pinView:(UIView *)view toParentView:(UIView *)parentView edges:(UIRectEdge)edges height:(CGFloat)height;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Unpins a view by removing its constraints and re-enabling autoresizing mask translation
|
|
36
|
-
* @param view The view to unpin
|
|
37
|
-
*/
|
|
38
|
-
+ (void)unpinView:(UIView *)view;
|
|
39
|
-
|
|
40
|
-
@end
|
|
41
|
-
|
|
42
|
-
NS_ASSUME_NONNULL_END
|
|
43
|
-
|
|
44
|
-
#endif
|