@lodev09/react-native-true-sheet 4.0.0-beta.0 → 4.0.0-beta.2
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 +156 -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 +1224 -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/TouchEventDeduper.kt +31 -0
- 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 +1133 -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 +230 -64
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +1203 -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 +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/createTrueSheetRouter.js +166 -0
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -0
- package/lib/module/navigation/expo-router/index.js +48 -0
- package/lib/module/navigation/expo-router/index.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 +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/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 +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 +99 -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 +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/createTrueSheetRouter.d.ts +14 -0
- package/lib/typescript/src/navigation/createTrueSheetRouter.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/index.d.ts +46 -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 +33 -0
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -0
- package/lib/typescript/src/navigation/types.d.ts +177 -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 +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 +95 -36
- package/react-native.config.js +9 -2
- package/src/TrueSheet.tsx +281 -62
- package/src/TrueSheet.types.ts +525 -71
- package/src/TrueSheet.web.tsx +1362 -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/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 +79 -0
- package/src/mocks/navigationExpoRouter.ts +40 -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/createTrueSheetRouter.ts +222 -0
- package/src/navigation/expo-router/index.ts +89 -0
- package/src/navigation/index.ts +81 -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 +100 -0
- package/src/navigation/types.ts +251 -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 +20 -0
- package/src/web/vaul/context.ts +101 -0
- package/src/web/vaul/helpers.ts +131 -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
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# vaul
|
|
2
|
+
|
|
3
|
+
Originally forked from [vaul](https://github.com/emilkowalski/vaul) by Emil Kowalski at `v1.1.2`. Upstream is unmaintained; maintained here as part of truesheet's web renderer.
|
|
4
|
+
|
|
5
|
+
Only external runtime dep: `@radix-ui/react-dialog`.
|
|
6
|
+
|
|
7
|
+
## License
|
|
8
|
+
|
|
9
|
+
vaul is MIT-licensed. See the [upstream LICENSE](https://github.com/emilkowalski/vaul/blob/main/LICENSE.md). Original copyright remains with Emil Kowalski.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function isMobileFirefox() {
|
|
4
|
+
const userAgent = navigator.userAgent;
|
|
5
|
+
return typeof window !== 'undefined' && (/Firefox/.test(userAgent) && /Mobile/.test(userAgent) ||
|
|
6
|
+
// Android Firefox
|
|
7
|
+
/FxiOS/.test(userAgent)) // iOS Firefox
|
|
8
|
+
;
|
|
9
|
+
}
|
|
10
|
+
export function isMac() {
|
|
11
|
+
return testPlatform(/^Mac/);
|
|
12
|
+
}
|
|
13
|
+
export function isIPhone() {
|
|
14
|
+
return testPlatform(/^iPhone/);
|
|
15
|
+
}
|
|
16
|
+
export function isSafari() {
|
|
17
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
18
|
+
}
|
|
19
|
+
export function isIPad() {
|
|
20
|
+
return testPlatform(/^iPad/) ||
|
|
21
|
+
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
22
|
+
isMac() && navigator.maxTouchPoints > 1;
|
|
23
|
+
}
|
|
24
|
+
export function isIOS() {
|
|
25
|
+
return isIPhone() || isIPad();
|
|
26
|
+
}
|
|
27
|
+
export function testPlatform(re) {
|
|
28
|
+
return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.platform) : undefined;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isMobileFirefox","userAgent","navigator","window","test","isMac","testPlatform","isIPhone","isSafari","isIPad","maxTouchPoints","isIOS","re","platform","undefined"],"sourceRoot":"../../../../src","sources":["web/vaul/browser.ts"],"mappings":";;AAAA,OAAO,SAASA,eAAeA,CAAA,EAAwB;EACrD,MAAMC,SAAS,GAAGC,SAAS,CAACD,SAAS;EACrC,OACE,OAAOE,MAAM,KAAK,WAAW,KAC3B,SAAS,CAACC,IAAI,CAACH,SAAS,CAAC,IAAI,QAAQ,CAACG,IAAI,CAACH,SAAS,CAAC;EAAK;EAC1D,OAAO,CAACG,IAAI,CAACH,SAAS,CAAC,CAAC,CAAC;AAAA;AAE/B;AAEA,OAAO,SAASI,KAAKA,CAAA,EAAwB;EAC3C,OAAOC,YAAY,CAAC,MAAM,CAAC;AAC7B;AAEA,OAAO,SAASC,QAAQA,CAAA,EAAwB;EAC9C,OAAOD,YAAY,CAAC,SAAS,CAAC;AAChC;AAEA,OAAO,SAASE,QAAQA,CAAA,EAAwB;EAC9C,OAAO,gCAAgC,CAACJ,IAAI,CAACF,SAAS,CAACD,SAAS,CAAC;AACnE;AAEA,OAAO,SAASQ,MAAMA,CAAA,EAAwB;EAC5C,OACEH,YAAY,CAAC,OAAO,CAAC;EACrB;EACCD,KAAK,CAAC,CAAC,IAAIH,SAAS,CAACQ,cAAc,GAAG,CAAE;AAE7C;AAEA,OAAO,SAASC,KAAKA,CAAA,EAAwB;EAC3C,OAAOJ,QAAQ,CAAC,CAAC,IAAIE,MAAM,CAAC,CAAC;AAC/B;AAEA,OAAO,SAASH,YAAYA,CAACM,EAAU,EAAuB;EAC5D,OAAO,OAAOT,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACD,SAAS,IAAI,IAAI,GAC5DU,EAAE,CAACR,IAAI,CAACD,MAAM,CAACD,SAAS,CAACW,QAAQ,CAAC,GAClCC,SAAS;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const TRANSITIONS = {
|
|
4
|
+
DURATION: 0.5,
|
|
5
|
+
EASE: [0.32, 0.72, 0, 1]
|
|
6
|
+
};
|
|
7
|
+
export const VELOCITY_THRESHOLD = 0.4;
|
|
8
|
+
export const DEFAULT_PEEK_HEIGHT = 150;
|
|
9
|
+
export const CLOSE_THRESHOLD = 0.25;
|
|
10
|
+
export const SCROLL_LOCK_TIMEOUT = 100;
|
|
11
|
+
export const BORDER_RADIUS = 8;
|
|
12
|
+
export const NESTED_DISPLACEMENT = 16;
|
|
13
|
+
export const WINDOW_TOP_OFFSET = 26;
|
|
14
|
+
export const DRAG_CLASS = 'vaul-dragging';
|
|
15
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TRANSITIONS","DURATION","EASE","VELOCITY_THRESHOLD","DEFAULT_PEEK_HEIGHT","CLOSE_THRESHOLD","SCROLL_LOCK_TIMEOUT","BORDER_RADIUS","NESTED_DISPLACEMENT","WINDOW_TOP_OFFSET","DRAG_CLASS"],"sourceRoot":"../../../../src","sources":["web/vaul/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,WAAW,GAAG;EACzBC,QAAQ,EAAE,GAAG;EACbC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AACzB,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG,GAAG;AAErC,OAAO,MAAMC,mBAAmB,GAAG,GAAG;AAEtC,OAAO,MAAMC,eAAe,GAAG,IAAI;AAEnC,OAAO,MAAMC,mBAAmB,GAAG,GAAG;AAEtC,OAAO,MAAMC,aAAa,GAAG,CAAC;AAE9B,OAAO,MAAMC,mBAAmB,GAAG,EAAE;AAErC,OAAO,MAAMC,iBAAiB,GAAG,EAAE;AAEnC,OAAO,MAAMC,UAAU,GAAG,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export const DrawerContext = /*#__PURE__*/React.createContext({
|
|
5
|
+
drawerRef: {
|
|
6
|
+
current: null
|
|
7
|
+
},
|
|
8
|
+
overlayRef: {
|
|
9
|
+
current: null
|
|
10
|
+
},
|
|
11
|
+
onPress: () => {},
|
|
12
|
+
onRelease: () => {},
|
|
13
|
+
onDrag: () => {},
|
|
14
|
+
onTouchDrag: () => {},
|
|
15
|
+
onTouchRelease: () => {},
|
|
16
|
+
onNestedDrag: () => {},
|
|
17
|
+
onNestedOpenChange: () => {},
|
|
18
|
+
onNestedRelease: () => {},
|
|
19
|
+
openProp: undefined,
|
|
20
|
+
dismissible: false,
|
|
21
|
+
isOpen: false,
|
|
22
|
+
isDragging: false,
|
|
23
|
+
keyboardIsOpen: {
|
|
24
|
+
current: false
|
|
25
|
+
},
|
|
26
|
+
snapPointsOffset: null,
|
|
27
|
+
snapPoints: null,
|
|
28
|
+
handleOnly: false,
|
|
29
|
+
modal: false,
|
|
30
|
+
shouldFade: false,
|
|
31
|
+
activeSnapPoint: null,
|
|
32
|
+
onOpenChange: () => {},
|
|
33
|
+
setActiveSnapPoint: () => {},
|
|
34
|
+
closeDrawer: () => {},
|
|
35
|
+
direction: 'bottom',
|
|
36
|
+
shouldAnimate: {
|
|
37
|
+
current: true
|
|
38
|
+
},
|
|
39
|
+
shouldScaleBackground: false,
|
|
40
|
+
setBackgroundColorOnScale: true,
|
|
41
|
+
noBodyStyles: false,
|
|
42
|
+
container: null,
|
|
43
|
+
autoFocus: false,
|
|
44
|
+
onPositionChangeRef: {
|
|
45
|
+
current: undefined
|
|
46
|
+
},
|
|
47
|
+
setContentHeight: () => {},
|
|
48
|
+
detached: false,
|
|
49
|
+
detachedOffset: 0,
|
|
50
|
+
detachedRadius: 0
|
|
51
|
+
});
|
|
52
|
+
export const useDrawerContext = () => {
|
|
53
|
+
const context = React.useContext(DrawerContext);
|
|
54
|
+
if (!context) {
|
|
55
|
+
throw new Error('useDrawerContext must be used within a Drawer.Root');
|
|
56
|
+
}
|
|
57
|
+
return context;
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","DrawerContext","createContext","drawerRef","current","overlayRef","onPress","onRelease","onDrag","onTouchDrag","onTouchRelease","onNestedDrag","onNestedOpenChange","onNestedRelease","openProp","undefined","dismissible","isOpen","isDragging","keyboardIsOpen","snapPointsOffset","snapPoints","handleOnly","modal","shouldFade","activeSnapPoint","onOpenChange","setActiveSnapPoint","closeDrawer","direction","shouldAnimate","shouldScaleBackground","setBackgroundColorOnScale","noBodyStyles","container","autoFocus","onPositionChangeRef","setContentHeight","detached","detachedOffset","detachedRadius","useDrawerContext","context","useContext","Error"],"sourceRoot":"../../../../src","sources":["web/vaul/context.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AAuDzB,OAAO,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAAqB;EACnEC,SAAS,EAAE;IAAEC,OAAO,EAAE;EAAK,CAAC;EAC5BC,UAAU,EAAE;IAAED,OAAO,EAAE;EAAK,CAAC;EAC7BE,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjBC,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;EACnBC,MAAM,EAAEA,CAAA,KAAM,CAAC,CAAC;EAChBC,WAAW,EAAEA,CAAA,KAAM,CAAC,CAAC;EACr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OAAOF,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// CSSStyleDeclaration has no string index signature, so dynamic camelCase
|
|
4
|
+
// keys are assigned through this writable-record view. Values include
|
|
5
|
+
// undefined: originals captured for unknown keys read back as undefined.
|
|
6
|
+
|
|
7
|
+
const cache = new WeakMap();
|
|
8
|
+
export function isInView(el) {
|
|
9
|
+
const rect = el.getBoundingClientRect();
|
|
10
|
+
if (!window.visualViewport) return false;
|
|
11
|
+
return rect.top >= 0 && rect.left >= 0 &&
|
|
12
|
+
// Need + 40 for safari detection
|
|
13
|
+
rect.bottom <= window.visualViewport.height - 40 && rect.right <= window.visualViewport.width;
|
|
14
|
+
}
|
|
15
|
+
export function set(el, styles, ignoreCache = false) {
|
|
16
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
|
17
|
+
let originalStyles = {};
|
|
18
|
+
const style = el.style;
|
|
19
|
+
Object.entries(styles).forEach(([key, value]) => {
|
|
20
|
+
if (key.startsWith('--')) {
|
|
21
|
+
el.style.setProperty(key, value);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
originalStyles[key] = style[key];
|
|
25
|
+
style[key] = value;
|
|
26
|
+
});
|
|
27
|
+
if (ignoreCache) return;
|
|
28
|
+
cache.set(el, originalStyles);
|
|
29
|
+
}
|
|
30
|
+
export function reset(el, prop) {
|
|
31
|
+
if (!el || !(el instanceof HTMLElement)) return;
|
|
32
|
+
let originalStyles = cache.get(el);
|
|
33
|
+
if (!originalStyles) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const style = el.style;
|
|
37
|
+
if (prop) {
|
|
38
|
+
style[prop] = originalStyles[prop];
|
|
39
|
+
} else {
|
|
40
|
+
Object.entries(originalStyles).forEach(([key, value]) => {
|
|
41
|
+
style[key] = value;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export const isVertical = direction => {
|
|
46
|
+
switch (direction) {
|
|
47
|
+
case 'top':
|
|
48
|
+
case 'bottom':
|
|
49
|
+
return true;
|
|
50
|
+
case 'left':
|
|
51
|
+
case 'right':
|
|
52
|
+
return false;
|
|
53
|
+
default:
|
|
54
|
+
return direction;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export function getTranslate(element, direction) {
|
|
58
|
+
if (!element) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const style = window.getComputedStyle(element);
|
|
62
|
+
const transform =
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
style.transform || style.webkitTransform || style.mozTransform;
|
|
65
|
+
let mat = transform.match(/^matrix3d\((.+)\)$/);
|
|
66
|
+
if (mat) {
|
|
67
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d
|
|
68
|
+
return parseFloat(mat[1].split(', ')[isVertical(direction) ? 13 : 12]);
|
|
69
|
+
}
|
|
70
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix
|
|
71
|
+
mat = transform.match(/^matrix\((.+)\)$/);
|
|
72
|
+
return mat ? parseFloat(mat[1].split(', ')[isVertical(direction) ? 5 : 4]) : null;
|
|
73
|
+
}
|
|
74
|
+
export function dampenValue(v) {
|
|
75
|
+
return 8 * (Math.log(v + 1) - 2);
|
|
76
|
+
}
|
|
77
|
+
export function assignStyle(element, style) {
|
|
78
|
+
if (!element) return () => {};
|
|
79
|
+
const prevStyle = element.style.cssText;
|
|
80
|
+
Object.assign(element.style, style);
|
|
81
|
+
return () => {
|
|
82
|
+
element.style.cssText = prevStyle;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Receives functions as arguments and returns a new function that calls all.
|
|
88
|
+
*/
|
|
89
|
+
export function chain(...fns) {
|
|
90
|
+
return (...args) => {
|
|
91
|
+
for (const fn of fns) {
|
|
92
|
+
if (typeof fn === 'function') {
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
fn(...args);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cache","WeakMap","isInView","el","rect","getBoundingClientRect","window","visualViewport","top","left","bottom","height","right","width","set","styles","ignoreCache","HTMLElement","originalStyles","style","Object","entries","forEach","key","value","startsWith","setProperty","reset","prop","get","isVertical","direction","getTranslate","element","getComputedStyle","transform","webkitTransform","mozTransform","mat","match","parseFloat","split","dampenValue","v","Math","log","assignStyle","prevStyle","cssText","assign","chain","fns","args","fn"],"sourceRoot":"../../../../src","sources":["web/vaul/helpers.ts"],"mappings":";;AAMA;AACA;AACA;;AAGA,MAAMA,KAAK,GAAG,IAAIC,OAAO,CAAkD,CAAC;AAE5E,OAAO,SAASC,QAAQA,CAACC,EAAe,EAAW;EACjD,MAAMC,IAAI,GAAGD,EAAE,CAACE,qBAAqB,CAAC,CAAC;EAEvC,IAAI,CAACC,MAAM,CAACC,cAAc,EAAE,OAAO,KAAK;EAExC,OACEH,IAAI,CAACI,GAAG,IAAI,CAAC,IACbJ,IAAI,CAACK,IAAI,IAAI,CAAC;EACd;EACAL,IAAI,CAACM,MAAM,IAAIJ,MAAM,CAACC,cAAc,CAACI,MAAM,GAAG,EAAE,IAChDP,IAAI,CAACQ,KAAK,IAAIN,MAAM,CAACC,cAAc,CAACM,KAAK;AAE7C;AAEA,OAAO,SAASC,GAAGA,CACjBX,EAA4C,EAC5CY,MAAa,EACbC,WAAW,GAAG,KAAK,EACnB;EACA,IAAI,CAACb,EAAE,IAAI,EAAEA,EAAE,YAAYc,WAAW,CAAC,EAAE;EACzC,IAAIC,cAAkD,GAAG,CAAC,CAAC;EAC3D,MAAMC,KAAK,GAAGhB,EAAE,CAACgB,KAAuB;EAExCC,MAAM,CAACC,OAAO,CAACN,MAAM,CAAC,CAACO,OAAO,CAAC,CAAC,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