@lodev09/react-native-true-sheet 4.0.0-beta.3 → 4.0.0-beta.30
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/README.md +28 -5
- package/android/build.gradle +23 -1
- package/android/proguard-rules.pro +3 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +50 -16
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +303 -184
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +5 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +38 -109
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +13 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayView.kt +127 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetOverlayViewManager.kt +45 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +2 -1
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetStateUpdater.kt +29 -3
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +234 -66
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +491 -186
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +64 -10
- package/android/src/main/java/com/lodev09/truesheet/core/RNScreensEventObserver.kt +31 -14
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetBehavior.kt +135 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetBottomSheetView.kt +23 -23
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetCoordinatorLayout.kt +130 -6
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDetentCalculator.kt +104 -39
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetDimView.kt +14 -17
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetGrabberView.kt +2 -4
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetOverlayRootView.kt +148 -0
- package/android/src/main/java/com/lodev09/truesheet/core/TrueSheetStackManager.kt +33 -40
- package/android/src/main/java/com/lodev09/truesheet/events/TrueSheetLifecycleEvents.kt +15 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/ColorUtils.kt +19 -0
- package/android/src/main/java/com/lodev09/truesheet/utils/KeyboardUtils.kt +15 -2
- package/android/src/main/java/com/lodev09/truesheet/utils/ScreenUtils.kt +0 -12
- package/android/src/main/java/com/lodev09/truesheet/utils/ViewUtils.kt +19 -7
- package/android/src/main/jni/TrueSheetSpec.h +1 -0
- package/android/src/main/jni/TrueSheetStateUpdater.cpp +37 -6
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewComponentDescriptor.h +1 -9
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.cpp +114 -30
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewShadowNode.h +30 -7
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.cpp +2 -2
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetContentViewState.h +9 -8
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewComponentDescriptor.h +3 -5
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.cpp +14 -3
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewShadowNode.h +5 -6
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.cpp +1 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetFooterViewState.h +10 -6
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.cpp +1 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetInsets.h +1 -1
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetLayoutUtils.h +43 -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 +33 -0
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewComponentDescriptor.h +3 -5
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.cpp +7 -40
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewShadowNode.h +3 -7
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.cpp +3 -5
- package/common/cpp/react/renderer/components/TrueSheetSpec/TrueSheetViewState.h +4 -5
- package/ios/TrueSheetContainerView.h +23 -7
- package/ios/TrueSheetContainerView.mm +45 -25
- package/ios/TrueSheetContentView.h +44 -15
- package/ios/TrueSheetContentView.mm +221 -190
- package/ios/TrueSheetFooterView.mm +133 -28
- package/ios/TrueSheetModule.h +2 -7
- package/ios/TrueSheetModule.mm +18 -18
- package/ios/TrueSheetOverlayView.h +42 -0
- package/ios/TrueSheetOverlayView.mm +175 -0
- package/ios/TrueSheetView.h +2 -0
- package/ios/TrueSheetView.mm +268 -52
- package/ios/TrueSheetViewController.h +36 -3
- package/ios/TrueSheetViewController.mm +797 -102
- package/ios/core/RNScreensEventObserver.mm +31 -28
- package/ios/core/TrueSheetBlurView.h +0 -2
- package/ios/core/TrueSheetBlurView.mm +3 -36
- package/ios/core/TrueSheetDetentCalculator.h +18 -1
- package/ios/core/TrueSheetDetentCalculator.mm +44 -9
- package/ios/core/TrueSheetDimView.h +27 -0
- package/ios/core/TrueSheetDimView.mm +41 -0
- package/ios/core/TrueSheetGrabberView.mm +13 -3
- package/ios/core/TrueSheetKeyboardObserver.h +7 -0
- package/ios/core/TrueSheetKeyboardObserver.mm +107 -15
- package/ios/core/TrueSheetOverlayContainerView.h +31 -0
- package/ios/core/TrueSheetOverlayContainerView.mm +35 -0
- package/ios/events/TrueSheetLifecycleEvents.h +2 -0
- package/ios/events/TrueSheetLifecycleEvents.mm +8 -0
- package/ios/tvos/TrueSheetStubs.mm +12 -0
- package/ios/utils/UIView+ScrollEdgeInteraction.h +1 -0
- package/ios/utils/UIView+ScrollEdgeInteraction.mm +24 -2
- package/lib/module/TrueSheet.js +222 -54
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheet.web.js +364 -275
- package/lib/module/TrueSheet.web.js.map +1 -1
- package/lib/module/TrueSheetBackground.js +15 -0
- package/lib/module/TrueSheetBackground.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.web.js +20 -15
- package/lib/module/TrueSheetPeek.web.js.map +1 -1
- package/lib/module/TrueSheetProvider.web.js +13 -9
- package/lib/module/TrueSheetProvider.web.js.map +1 -1
- package/lib/module/detentBackgrounds.js +21 -0
- package/lib/module/detentBackgrounds.js.map +1 -0
- package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +1 -1
- package/lib/module/fabric/TrueSheetFooterViewNativeComponent.ts +2 -3
- package/lib/module/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +89 -73
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mocks/index.js +18 -2
- package/lib/module/mocks/index.js.map +1 -1
- package/lib/module/mocks/navigationExpoRouter.js.map +1 -1
- 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 +158 -100
- package/lib/module/navigation/createTrueSheetRouter.js.map +1 -1
- 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/extendTrueSheetRouter.js +71 -0
- package/lib/module/navigation/expo-router/extendTrueSheetRouter.js.map +1 -0
- package/lib/module/navigation/expo-router/index.js +18 -7
- package/lib/module/navigation/expo-router/index.js.map +1 -1
- 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.map +1 -1
- package/lib/module/navigation/screen/useSheetScreenState.js +1 -0
- package/lib/module/navigation/screen/useSheetScreenState.js.map +1 -1
- package/lib/module/scrollable.js +28 -0
- package/lib/module/scrollable.js.map +1 -0
- package/lib/module/web/constants.js +1 -1
- package/lib/module/web/constants.js.map +1 -1
- package/lib/module/web/keyboard.js +69 -0
- package/lib/module/web/keyboard.js.map +1 -0
- package/lib/module/web/layout.js +168 -0
- package/lib/module/web/layout.js.map +1 -0
- package/lib/module/web/vaul/constants.js +9 -0
- package/lib/module/web/vaul/constants.js.map +1 -1
- package/lib/module/web/vaul/context.js +4 -0
- package/lib/module/web/vaul/context.js.map +1 -1
- package/lib/module/web/vaul/helpers.js +1 -0
- package/lib/module/web/vaul/helpers.js.map +1 -1
- package/lib/module/web/vaul/index.js +83 -21
- package/lib/module/web/vaul/index.js.map +1 -1
- package/lib/module/web/vaul/use-snap-points.js +57 -28
- package/lib/module/web/vaul/use-snap-points.js.map +1 -1
- package/lib/typescript/src/TrueSheet.d.ts +18 -1
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.types.d.ts +209 -35
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheet.web.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheetBackground.d.ts +3 -0
- package/lib/typescript/src/TrueSheetBackground.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.web.d.ts +8 -4
- package/lib/typescript/src/TrueSheetPeek.web.d.ts.map +1 -1
- package/lib/typescript/src/TrueSheetProvider.web.d.ts +5 -1
- package/lib/typescript/src/TrueSheetProvider.web.d.ts.map +1 -1
- package/lib/typescript/src/detentBackgrounds.d.ts +10 -0
- package/lib/typescript/src/detentBackgrounds.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts +2 -3
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts.map +1 -1
- 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/TrueSheetViewNativeComponent.d.ts +76 -65
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/mocks/index.d.ts +4 -0
- package/lib/typescript/src/mocks/index.d.ts.map +1 -1
- package/lib/typescript/src/mocks/navigationExpoRouter.d.ts +3 -3
- package/lib/typescript/src/mocks/navigationExpoRouter.d.ts.map +1 -1
- 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 +36 -10
- package/lib/typescript/src/navigation/createTrueSheetRouter.d.ts.map +1 -1
- 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/extendTrueSheetRouter.d.ts +33 -0
- package/lib/typescript/src/navigation/expo-router/extendTrueSheetRouter.d.ts.map +1 -0
- package/lib/typescript/src/navigation/expo-router/index.d.ts +9 -6
- package/lib/typescript/src/navigation/expo-router/index.d.ts.map +1 -1
- 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 +3 -4
- package/lib/typescript/src/navigation/index.d.ts.map +1 -1
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts +2 -1
- package/lib/typescript/src/navigation/screen/useSheetScreenState.d.ts.map +1 -1
- package/lib/typescript/src/navigation/types.d.ts +43 -6
- package/lib/typescript/src/navigation/types.d.ts.map +1 -1
- package/lib/typescript/src/scrollable.d.ts +2 -0
- package/lib/typescript/src/scrollable.d.ts.map +1 -0
- package/lib/typescript/src/web/constants.d.ts +1 -1
- package/lib/typescript/src/web/constants.d.ts.map +1 -1
- package/lib/typescript/src/web/keyboard.d.ts +15 -0
- package/lib/typescript/src/web/keyboard.d.ts.map +1 -0
- package/lib/typescript/src/web/layout.d.ts +20 -0
- package/lib/typescript/src/web/layout.d.ts.map +1 -0
- package/lib/typescript/src/web/vaul/constants.d.ts +3 -0
- package/lib/typescript/src/web/vaul/constants.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/context.d.ts +5 -1
- package/lib/typescript/src/web/vaul/context.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/helpers.d.ts +1 -0
- package/lib/typescript/src/web/vaul/helpers.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/index.d.ts +20 -1
- package/lib/typescript/src/web/vaul/index.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/types.d.ts +9 -0
- package/lib/typescript/src/web/vaul/types.d.ts.map +1 -1
- package/lib/typescript/src/web/vaul/use-snap-points.d.ts +6 -4
- package/lib/typescript/src/web/vaul/use-snap-points.d.ts.map +1 -1
- package/package.json +18 -8
- package/react-native.config.js +1 -0
- package/src/TrueSheet.tsx +257 -62
- package/src/TrueSheet.types.ts +225 -35
- package/src/TrueSheet.web.tsx +445 -333
- package/src/TrueSheetBackground.tsx +17 -0
- package/src/TrueSheetOverlay.tsx +24 -0
- package/src/TrueSheetOverlay.web.tsx +33 -0
- package/src/TrueSheetPeek.web.tsx +25 -23
- package/src/TrueSheetProvider.web.tsx +22 -13
- package/src/detentBackgrounds.ts +24 -0
- package/src/fabric/TrueSheetContentViewNativeComponent.ts +1 -1
- package/src/fabric/TrueSheetFooterViewNativeComponent.ts +2 -3
- package/src/fabric/TrueSheetOverlayViewNativeComponent.ts +12 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +89 -73
- package/src/index.ts +1 -0
- package/src/mocks/index.ts +17 -2
- package/src/mocks/navigationExpoRouter.ts +6 -5
- package/src/navigation/base-types.ts +20 -0
- package/src/navigation/createTrueSheetRouter.ts +220 -144
- package/src/navigation/expo-router/base-types.ts +18 -0
- package/src/navigation/expo-router/extendTrueSheetRouter.ts +99 -0
- package/src/navigation/expo-router/index.ts +41 -30
- package/src/navigation/expo-router/types.ts +116 -0
- package/src/navigation/index.ts +6 -7
- package/src/navigation/screen/useSheetScreenState.ts +2 -0
- package/src/navigation/types.ts +81 -23
- package/src/scrollable.ts +25 -0
- package/src/web/constants.ts +1 -1
- package/src/web/keyboard.ts +79 -0
- package/src/web/layout.ts +196 -0
- package/src/web/vaul/constants.ts +9 -0
- package/src/web/vaul/context.ts +7 -1
- package/src/web/vaul/helpers.ts +5 -0
- package/src/web/vaul/index.tsx +113 -16
- package/src/web/vaul/types.ts +10 -0
- package/src/web/vaul/use-snap-points.ts +86 -33
|
@@ -1,87 +1,98 @@
|
|
|
1
|
-
import type { ColorValue, ProcessedColorValue, ViewProps } from 'react-native';
|
|
2
|
-
import type {
|
|
3
|
-
DirectEventHandler,
|
|
4
|
-
Double,
|
|
5
|
-
Int32,
|
|
6
|
-
WithDefault,
|
|
7
|
-
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
1
|
+
import type { CodegenTypes, ColorValue, ProcessedColorValue, ViewProps } from 'react-native';
|
|
8
2
|
import { codegenNativeComponent } from 'react-native';
|
|
9
3
|
|
|
10
4
|
type GrabberOptionsType = Readonly<{
|
|
11
|
-
width?: Double;
|
|
12
|
-
height?: Double;
|
|
13
|
-
topMargin?: Double;
|
|
14
|
-
cornerRadius?: WithDefault<Double, -1>;
|
|
5
|
+
width?: CodegenTypes.Double;
|
|
6
|
+
height?: CodegenTypes.Double;
|
|
7
|
+
topMargin?: CodegenTypes.Double;
|
|
8
|
+
cornerRadius?: CodegenTypes.WithDefault<CodegenTypes.Double, -1>;
|
|
15
9
|
color?: ProcessedColorValue | null;
|
|
16
|
-
adaptive?: WithDefault<boolean, true>;
|
|
10
|
+
adaptive?: CodegenTypes.WithDefault<boolean, true>;
|
|
17
11
|
}>;
|
|
18
12
|
|
|
19
13
|
type AccessibilityOptionsType = Readonly<{
|
|
20
|
-
grabberLabel?: WithDefault<string, 'Sheet Grabber'>;
|
|
21
|
-
grabberHint?: WithDefault<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
intensity?: WithDefault<Double, -1>;
|
|
32
|
-
interaction?: WithDefault<boolean, true>;
|
|
14
|
+
grabberLabel?: CodegenTypes.WithDefault<string, 'Sheet Grabber'>;
|
|
15
|
+
grabberHint?: CodegenTypes.WithDefault<
|
|
16
|
+
string,
|
|
17
|
+
'Double-tap to expand. Swipe up or down to resize the sheet'
|
|
18
|
+
>;
|
|
19
|
+
expandedValue?: CodegenTypes.WithDefault<string, 'Expanded'>;
|
|
20
|
+
collapsedValue?: CodegenTypes.WithDefault<string, 'Collapsed'>;
|
|
21
|
+
detentValue?: CodegenTypes.WithDefault<string, 'Detent {index} of {count}'>;
|
|
22
|
+
expandActionLabel?: CodegenTypes.WithDefault<string, 'Expand'>;
|
|
23
|
+
collapseActionLabel?: CodegenTypes.WithDefault<string, 'Collapse'>;
|
|
24
|
+
paneTitle?: CodegenTypes.WithDefault<string, 'Bottom sheet'>;
|
|
33
25
|
}>;
|
|
34
26
|
|
|
35
27
|
type ScrollEdgeEffect = 'automatic' | 'hard' | 'soft' | 'hidden';
|
|
36
28
|
|
|
37
29
|
type ScrollableOptionsType = Readonly<{
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
contentInsetAdjustment?: CodegenTypes.WithDefault<
|
|
31
|
+
'automatic' | 'safe-area' | 'footer' | 'never',
|
|
32
|
+
'automatic'
|
|
33
|
+
>;
|
|
34
|
+
keyboardScrollOffset?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
35
|
+
keyboardOffset?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
36
|
+
scrollingExpandsSheet?: CodegenTypes.WithDefault<boolean, true>;
|
|
37
|
+
topScrollEdgeEffect?: CodegenTypes.WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
38
|
+
bottomScrollEdgeEffect?: CodegenTypes.WithDefault<ScrollEdgeEffect, 'hidden'>;
|
|
42
39
|
}>;
|
|
43
40
|
|
|
44
41
|
type FooterOptionsType = Readonly<{
|
|
45
42
|
// Named uniquely across option structs — codegen derives the enum name from
|
|
46
43
|
// the field name, so a second `position` would redefine TrueSheetViewPosition
|
|
47
|
-
footerPosition?: WithDefault<'relative' | 'absolute', 'relative'>;
|
|
48
|
-
keyboardOffset?: WithDefault<Double, 0>;
|
|
44
|
+
footerPosition?: CodegenTypes.WithDefault<'relative' | 'absolute', 'relative'>;
|
|
45
|
+
keyboardOffset?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
46
|
+
avoidKeyboard?: CodegenTypes.WithDefault<boolean, true>;
|
|
49
47
|
}>;
|
|
50
48
|
|
|
51
49
|
type HeaderOptionsType = Readonly<{
|
|
52
|
-
position?: WithDefault<'relative' | 'absolute', 'relative'>;
|
|
50
|
+
position?: CodegenTypes.WithDefault<'relative' | 'absolute', 'relative'>;
|
|
51
|
+
}>;
|
|
52
|
+
|
|
53
|
+
type FoldOptionsType = Readonly<{
|
|
54
|
+
hingeDetentIndex?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
55
|
+
hingeBehavior?: CodegenTypes.WithDefault<'none' | 'avoid' | 'snap', 'none'>;
|
|
53
56
|
}>;
|
|
54
57
|
|
|
55
58
|
export interface DetentInfoEventPayload {
|
|
56
|
-
index: Int32;
|
|
57
|
-
position: Double;
|
|
58
|
-
detent: Double;
|
|
59
|
+
index: CodegenTypes.Int32;
|
|
60
|
+
position: CodegenTypes.Double;
|
|
61
|
+
detent: CodegenTypes.Double;
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
export interface PositionChangeEventPayload {
|
|
62
|
-
index: Double;
|
|
63
|
-
position: Double;
|
|
64
|
-
detent: Double;
|
|
65
|
+
index: CodegenTypes.Double;
|
|
66
|
+
position: CodegenTypes.Double;
|
|
67
|
+
detent: CodegenTypes.Double;
|
|
65
68
|
realtime: boolean;
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
export interface NativeProps extends ViewProps {
|
|
69
72
|
// Array properties
|
|
70
|
-
detents?: ReadonlyArray<Double>;
|
|
73
|
+
detents?: ReadonlyArray<CodegenTypes.Double>;
|
|
74
|
+
detentBackgrounds?: ReadonlyArray<
|
|
75
|
+
Readonly<{
|
|
76
|
+
color?: ProcessedColorValue | null;
|
|
77
|
+
blur?: string;
|
|
78
|
+
}>
|
|
79
|
+
>;
|
|
71
80
|
|
|
72
81
|
// Number properties - use 0 as default to avoid nil insertion
|
|
73
|
-
maxContentHeight?: WithDefault<Double, 0>;
|
|
74
|
-
maxContentWidth?: WithDefault<Double, 0>;
|
|
75
|
-
cornerRadius?: WithDefault<Double, -1>;
|
|
76
|
-
elevation?: WithDefault<Double, -1>;
|
|
82
|
+
maxContentHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
83
|
+
maxContentWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
84
|
+
cornerRadius?: CodegenTypes.WithDefault<CodegenTypes.Double, -1>;
|
|
85
|
+
elevation?: CodegenTypes.WithDefault<CodegenTypes.Double, -1>;
|
|
77
86
|
|
|
78
87
|
// Color properties
|
|
79
88
|
backgroundColor?: ColorValue;
|
|
80
|
-
initialDetentIndex?: WithDefault<Int32, -1>;
|
|
81
|
-
|
|
89
|
+
initialDetentIndex?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
90
|
+
dimColor?: ColorValue;
|
|
91
|
+
dimOpacity?: CodegenTypes.WithDefault<CodegenTypes.Double, -1>;
|
|
92
|
+
dimmedDetentIndex?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
|
|
82
93
|
|
|
83
94
|
// String properties - use empty string as default to avoid nil insertion
|
|
84
|
-
backgroundBlur?: WithDefault<
|
|
95
|
+
backgroundBlur?: CodegenTypes.WithDefault<
|
|
85
96
|
| 'none'
|
|
86
97
|
| 'light'
|
|
87
98
|
| 'dark'
|
|
@@ -107,42 +118,47 @@ export interface NativeProps extends ViewProps {
|
|
|
107
118
|
'none'
|
|
108
119
|
>;
|
|
109
120
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
121
|
+
placement?: CodegenTypes.WithDefault<
|
|
122
|
+
'automatic' | 'leading' | 'center' | 'trailing',
|
|
123
|
+
'automatic'
|
|
124
|
+
>;
|
|
125
|
+
placementOffset?: CodegenTypes.WithDefault<CodegenTypes.Double, 16>;
|
|
126
|
+
insetAdjustment?: CodegenTypes.WithDefault<'automatic' | 'never', 'automatic'>;
|
|
127
|
+
dismissThreshold?: CodegenTypes.WithDefault<'half' | 'short', 'half'>;
|
|
116
128
|
|
|
117
129
|
// Boolean properties - match defaults from TrueSheet.types.ts
|
|
118
|
-
grabber?: WithDefault<boolean, true>;
|
|
130
|
+
grabber?: CodegenTypes.WithDefault<boolean, true>;
|
|
119
131
|
grabberOptions?: GrabberOptionsType;
|
|
120
132
|
accessibilityOptions?: AccessibilityOptionsType;
|
|
121
|
-
dismissible?: WithDefault<boolean, true>;
|
|
122
|
-
draggable?: WithDefault<boolean, true>;
|
|
123
|
-
dimmed?: WithDefault<boolean, true>;
|
|
124
|
-
initialDetentAnimated?: WithDefault<boolean, true>;
|
|
133
|
+
dismissible?: CodegenTypes.WithDefault<boolean, true>;
|
|
134
|
+
draggable?: CodegenTypes.WithDefault<boolean, true>;
|
|
135
|
+
dimmed?: CodegenTypes.WithDefault<boolean, true>;
|
|
136
|
+
initialDetentAnimated?: CodegenTypes.WithDefault<boolean, true>;
|
|
137
|
+
// React tag of the scrollable component within the content (see scrollableRef)
|
|
138
|
+
scrollableHandle?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
|
|
125
139
|
scrollableOptions?: ScrollableOptionsType;
|
|
126
140
|
headerOptions?: HeaderOptionsType;
|
|
127
141
|
footerOptions?: FooterOptionsType;
|
|
128
|
-
|
|
142
|
+
foldOptions?: FoldOptionsType;
|
|
143
|
+
presentation?: CodegenTypes.WithDefault<'page' | 'form', 'page'>;
|
|
129
144
|
|
|
130
145
|
// Event handlers
|
|
131
|
-
onMount?: DirectEventHandler<null>;
|
|
132
|
-
onWillPresent?: DirectEventHandler<DetentInfoEventPayload>;
|
|
133
|
-
onDidPresent?: DirectEventHandler<DetentInfoEventPayload>;
|
|
134
|
-
onWillDismiss?: DirectEventHandler<null>;
|
|
135
|
-
onDidDismiss?: DirectEventHandler<null>;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
onMount?: CodegenTypes.DirectEventHandler<null>;
|
|
147
|
+
onWillPresent?: CodegenTypes.DirectEventHandler<DetentInfoEventPayload>;
|
|
148
|
+
onDidPresent?: CodegenTypes.DirectEventHandler<DetentInfoEventPayload>;
|
|
149
|
+
onWillDismiss?: CodegenTypes.DirectEventHandler<null>;
|
|
150
|
+
onDidDismiss?: CodegenTypes.DirectEventHandler<null>;
|
|
151
|
+
onDismissAttempt?: CodegenTypes.DirectEventHandler<null>;
|
|
152
|
+
onDetentChange?: CodegenTypes.DirectEventHandler<DetentInfoEventPayload>;
|
|
153
|
+
onDragBegin?: CodegenTypes.DirectEventHandler<DetentInfoEventPayload>;
|
|
154
|
+
onDragChange?: CodegenTypes.DirectEventHandler<DetentInfoEventPayload>;
|
|
155
|
+
onDragEnd?: CodegenTypes.DirectEventHandler<DetentInfoEventPayload>;
|
|
156
|
+
onPositionChange?: CodegenTypes.DirectEventHandler<PositionChangeEventPayload>;
|
|
157
|
+
onWillFocus?: CodegenTypes.DirectEventHandler<null>;
|
|
158
|
+
onDidFocus?: CodegenTypes.DirectEventHandler<null>;
|
|
159
|
+
onWillBlur?: CodegenTypes.DirectEventHandler<null>;
|
|
160
|
+
onDidBlur?: CodegenTypes.DirectEventHandler<null>;
|
|
161
|
+
onVisibilityChange?: CodegenTypes.DirectEventHandler<Readonly<{ visible: boolean }>>;
|
|
146
162
|
}
|
|
147
163
|
|
|
148
164
|
export default codegenNativeComponent<NativeProps>('TrueSheetView', {
|
package/lib/module/index.js
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
export * from './TrueSheet';
|
|
4
4
|
export * from "./TrueSheet.types.js";
|
|
5
5
|
export { TrueSheetPeek } from './TrueSheetPeek';
|
|
6
|
+
export { TrueSheetOverlay } from './TrueSheetOverlay';
|
|
6
7
|
export { TrueSheetProvider, useTrueSheet } from './TrueSheetProvider';
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TrueSheetPeek","TrueSheetProvider","useTrueSheet"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,sBAAmB;AACjC,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["TrueSheetPeek","TrueSheetOverlay","TrueSheetProvider","useTrueSheet"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,cAAc,aAAa;AAC3B,cAAc,sBAAmB;AACjC,SAASA,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,qBAAqB","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { createElement, isValidElement } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
|
+
import { TrueSheetBackground } from "../TrueSheetBackground.js";
|
|
5
6
|
/**
|
|
6
7
|
* Mock TrueSheet component for testing.
|
|
7
8
|
* Import from '@lodev09/react-native-true-sheet/mock' in your test setup.
|
|
@@ -50,11 +51,16 @@ export class TrueSheet extends React.Component {
|
|
|
50
51
|
render() {
|
|
51
52
|
const {
|
|
52
53
|
children,
|
|
53
|
-
style
|
|
54
|
+
style,
|
|
55
|
+
background,
|
|
56
|
+
backgroundStyle
|
|
54
57
|
} = this.props;
|
|
55
58
|
return /*#__PURE__*/React.createElement(View, {
|
|
56
59
|
style
|
|
57
|
-
},
|
|
60
|
+
}, /*#__PURE__*/React.createElement(TrueSheetBackground, {
|
|
61
|
+
background,
|
|
62
|
+
backgroundStyle
|
|
63
|
+
}), this.renderHeader(), children, this.renderFooter());
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
|
|
@@ -68,6 +74,16 @@ export function TrueSheetPeek({
|
|
|
68
74
|
return /*#__PURE__*/React.createElement(View, rest, children);
|
|
69
75
|
}
|
|
70
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Mock TrueSheetOverlay component for testing.
|
|
79
|
+
*/
|
|
80
|
+
export function TrueSheetOverlay({
|
|
81
|
+
children,
|
|
82
|
+
...rest
|
|
83
|
+
}) {
|
|
84
|
+
return /*#__PURE__*/React.createElement(View, rest, children);
|
|
85
|
+
}
|
|
86
|
+
|
|
71
87
|
/**
|
|
72
88
|
* Mock TrueSheetProvider for testing.
|
|
73
89
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createElement","isValidElement","View","TrueSheet","Component","instances","dismiss","jest","fn","_name","_animated","Promise","resolve","dismissStack","present","_index","resize","dismissAll","componentDidMount","name","props","componentWillUnmount","renderHeader","header","renderFooter","footer","render","children","style","TrueSheetPeek","rest","TrueSheetProvider","useTrueSheet"],"sourceRoot":"../../../src","sources":["mocks/index.ts"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,cAAc,QAAwB,OAAO;AAC5E,SAASC,IAAI,QAAwB,cAAc;
|
|
1
|
+
{"version":3,"names":["React","createElement","isValidElement","View","TrueSheetBackground","TrueSheet","Component","instances","dismiss","jest","fn","_name","_animated","Promise","resolve","dismissStack","present","_index","resize","dismissAll","componentDidMount","name","props","componentWillUnmount","renderHeader","header","renderFooter","footer","render","children","style","background","backgroundStyle","TrueSheetPeek","rest","TrueSheetOverlay","TrueSheetProvider","useTrueSheet"],"sourceRoot":"../../../src","sources":["mocks/index.ts"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,cAAc,QAAwB,OAAO;AAC5E,SAASC,IAAI,QAAwB,cAAc;AAGnD,SAASC,mBAAmB,QAAQ,2BAAwB;AAM5D;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,SAASL,KAAK,CAACM,SAAS,CAAiC;EAC7E,OAAOC,SAAS,GAA8B,CAAC,CAAC;EAEhD,OAAOC,OAAO,GAAGC,IAAI,CAACC,EAAE,CAAC,CAACC,KAAa,EAAEC,SAAmB,KAAKC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;EACnF,OAAOC,YAAY,GAAGN,IAAI,CAACC,EAAE,CAAC,CAACC,KAAa,EAAEC,SAAmB,KAAKC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAC;EACxF,OAAOE,OAAO,GAAGP,IAAI,CAACC,E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AAS,CAACW,OAAO;IAC1BR,OAAO,EAAEH,SAAS,CAACG,OAAO;IAC1BO,YAAY,EAAEV,SAAS,CAACU,YAAY;IACpCG,MAAM,EAAEb,SAAS,CAACa,MAAM;IACxBC,UAAU,EAAEd,SAAS,CAACc;EACxB,CAAC;AACH;AAEA,cAAc,uBAAoB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TrueSheetActions","useTrueSheetNavigation","useTrueSheetNavigationMock","Sheet","Object","assign","jest","fn","children","Screen","Protected"],"sourceRoot":"../../../src","sources":["mocks/navigationExpoRouter.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["TrueSheetActions","useTrueSheetNavigation","useTrueSheetNavigationMock","Sheet","Object","assign","jest","fn","children","Screen","Protected"],"sourceRoot":"../../../src","sources":["mocks/navigationExpoRouter.ts"],"mappings":";;AAEA,SACEA,gBAAgB,EAChBC,sBAAsB,IAAIC,0BAA0B,QAC/C,iBAAc;;AAErB;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGC,MAAM,CAACC,MAAM,CAChCC,IAAI,CAACC,EAAE,CAAC,CAAC;EAAEC;AAAwC,CAAC,KAAKA,QAAQ,CAAC,EAClE;EACEC,MAAM,EAAEH,IAAI,CAACC,EAAE,CAAC,MAAM,IAAI,CAAC;EAC3BG,SAAS,EAAEJ,IAAI,CAACC,EAAE,CAAC,MAAM,IAAI;AAC/B,CACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMN,sBAAsB,GAAGK,IAAI,CAACC,EAAE,CAG3C,MACEL,0BAA0B,CAAC,CAC/B,CAAC;AAED,SAASF,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["navigation/base-types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { TrueSheetActions } from "./actions.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The base `StackRouter` factory to wrap, typed generically over the state and
|
|
7
|
-
* action types the wrapper threads through — `StackRouter` is structural and
|
|
8
|
-
* never touches the sheet-specific fields.
|
|
9
|
-
* Injected by each entry point so the shared router never imports
|
|
10
|
-
* `@react-navigation/*` at runtime (Expo Router apps don't install it).
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
4
|
const uid = () => Math.random().toString(36).slice(2, 10);
|
|
14
5
|
const ensureBaseRoute = (state, baseRouteName, routeParamList) => {
|
|
15
6
|
if (!baseRouteName) {
|
|
@@ -30,6 +21,160 @@ const ensureBaseRoute = (state, baseRouteName, routeParamList) => {
|
|
|
30
21
|
}
|
|
31
22
|
return state;
|
|
32
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Index of the route a `RESIZE` targets: the dispatching screen, else the focused route.
|
|
26
|
+
*/
|
|
27
|
+
export const getResizeRouteIndex = (state, action) => action.target === state.key && action.source ? state.routes.findIndex(r => r.key === action.source) : state.index;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Reduces the sheet-specific actions shared by every router flavour.
|
|
31
|
+
* Returns `undefined` for actions the base `StackRouter` should handle.
|
|
32
|
+
*/
|
|
33
|
+
export const getTrueSheetStateForAction = (state, action) => {
|
|
34
|
+
switch (action.type) {
|
|
35
|
+
case 'RESIZE':
|
|
36
|
+
{
|
|
37
|
+
const routeIndex = getResizeRouteIndex(state, action);
|
|
38
|
+
return {
|
|
39
|
+
...state,
|
|
40
|
+
routes: state.routes.map((route, i) => i === routeIndex ? {
|
|
41
|
+
...route,
|
|
42
|
+
resizeIndex: action.index,
|
|
43
|
+
resizeKey: (route.resizeKey ?? 0) + 1
|
|
44
|
+
} : route)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
case 'GO_BACK':
|
|
48
|
+
case 'DISMISS':
|
|
49
|
+
{
|
|
50
|
+
return getTrueSheetStateForAction(state, TrueSheetActions.pop(1));
|
|
51
|
+
}
|
|
52
|
+
case 'POP':
|
|
53
|
+
{
|
|
54
|
+
// Only base screen remains - let parent navigator handle it
|
|
55
|
+
if (state.routes.length <= 1) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const count = 'payload' in action && typeof action.payload?.count === 'number' ? action.payload.count : 1;
|
|
59
|
+
|
|
60
|
+
// Calculate how many routes we can actually pop (don't pop base screen)
|
|
61
|
+
const maxPopCount = state.routes.length - 1;
|
|
62
|
+
const actualCount = Math.min(count, maxPopCount);
|
|
63
|
+
|
|
64
|
+
// Base screen - let parent navigator handle it
|
|
65
|
+
if (actualCount <= 0) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Target index is the route we want to stay on (land on after pop)
|
|
70
|
+
// closingIndex is the first route to be dismissed (the one after target)
|
|
71
|
+
const targetIndex = state.routes.length - 1 - actualCount;
|
|
72
|
+
const closingIndex = targetIndex + 1;
|
|
73
|
+
|
|
74
|
+
// Mark only the bottom-most route to pop as closing
|
|
75
|
+
// The sheet's dismiss() will handle dismissing sheets above it first.
|
|
76
|
+
// The index stays on the top sheet until REMOVE: Expo Router 58 treats the routes
|
|
77
|
+
// after `index` as preloaded.
|
|
78
|
+
return {
|
|
79
|
+
...state,
|
|
80
|
+
routes: state.routes.map((route, i) => {
|
|
81
|
+
if (i === closingIndex) return {
|
|
82
|
+
...route,
|
|
83
|
+
closing: true
|
|
84
|
+
};
|
|
85
|
+
if (i > closingIndex) return {
|
|
86
|
+
...route,
|
|
87
|
+
dismissing: true
|
|
88
|
+
};
|
|
89
|
+
return route;
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
case 'POP_TO_TOP':
|
|
94
|
+
{
|
|
95
|
+
const popCount = state.routes.length - 1;
|
|
96
|
+
return getTrueSheetStateForAction(state, TrueSheetActions.pop(popCount));
|
|
97
|
+
}
|
|
98
|
+
case 'POP_TO':
|
|
99
|
+
{
|
|
100
|
+
const targetName = 'payload' in action && typeof action.payload?.name === 'string' ? action.payload.name : null;
|
|
101
|
+
if (!targetName) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const targetIndex = state.routes.findIndex(r => r.name === targetName);
|
|
105
|
+
|
|
106
|
+
// Target not found or is the current route
|
|
107
|
+
if (targetIndex === -1 || targetIndex >= state.index) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const popCount = state.routes.length - 1 - targetIndex;
|
|
111
|
+
return getTrueSheetStateForAction(state, TrueSheetActions.pop(popCount));
|
|
112
|
+
}
|
|
113
|
+
case 'REMOVE':
|
|
114
|
+
{
|
|
115
|
+
// Actually remove the closing route and all routes above it
|
|
116
|
+
const routeKey = action.source;
|
|
117
|
+
const routeIndex = routeKey ? state.routes.findIndex(r => r.key === routeKey) : state.routes.findIndex(r => r.closing);
|
|
118
|
+
if (routeIndex === -1) {
|
|
119
|
+
return state;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Remove the route and the routes dismissed with it. A popped route keeps the
|
|
123
|
+
// routes pushed after the pop started: they aren't stacked on it natively.
|
|
124
|
+
const removed = state.routes[routeIndex];
|
|
125
|
+
const isPopped = removed.closing || removed.dismissing;
|
|
126
|
+
const routes = state.routes.filter((route, i) => i < routeIndex || i > routeIndex && isPopped && !route.dismissing);
|
|
127
|
+
return {
|
|
128
|
+
...state,
|
|
129
|
+
index: Math.min(state.index, routes.length - 1),
|
|
130
|
+
routes
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
default:
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const BASE_ROUTE_ACTIONS = new Set(['NAVIGATE', 'NAVIGATE_DEPRECATED', 'PUSH', 'REPLACE', 'POP_TO']);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Reduces an action that targets the base route by name. React Navigation 7 adds another base
|
|
141
|
+
* route for a `PUSH`, a `REPLACE` or a `NAVIGATE` without `pop`, which presents the base screen
|
|
142
|
+
* as a sheet, and this router's `POP_TO` drops the params and nested state. This goes back to it
|
|
143
|
+
* instead: `getPoppedState` reduces the action as a `NAVIGATE` with `pop` (a `PUSH` ignores
|
|
144
|
+
* `pop`) to update the base route (params, nested state), then the sheets above it are dismissed.
|
|
145
|
+
* Returns `undefined` for other actions, a `REPLACE` with no sheet (it swaps the base route), or
|
|
146
|
+
* when the base router doesn't land on the base route.
|
|
147
|
+
*/
|
|
148
|
+
export const getStateForNavigateToBase = (state, action, getPoppedState) => {
|
|
149
|
+
const {
|
|
150
|
+
type,
|
|
151
|
+
payload
|
|
152
|
+
} = action;
|
|
153
|
+
const baseRoute = state.routes[0];
|
|
154
|
+
const hasSheets = state.routes.length > 1;
|
|
155
|
+
if (!BASE_ROUTE_ACTIONS.has(type) || payload?.name !== baseRoute.name || type === 'REPLACE' && !hasSheets) {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
const popped = getPoppedState({
|
|
159
|
+
...action,
|
|
160
|
+
type: 'NAVIGATE',
|
|
161
|
+
payload: {
|
|
162
|
+
...payload,
|
|
163
|
+
pop: true
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const base = popped?.routes[popped.index];
|
|
167
|
+
if (base?.key !== baseRoute.key) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
if (!hasSheets) {
|
|
171
|
+
return popped;
|
|
172
|
+
}
|
|
173
|
+
return getTrueSheetStateForAction({
|
|
174
|
+
...state,
|
|
175
|
+
routes: [base, ...state.routes.slice(1)]
|
|
176
|
+
}, TrueSheetActions.pop(state.routes.length - 1));
|
|
177
|
+
};
|
|
33
178
|
export const createTrueSheetRouter = stackRouter => routerOptions => {
|
|
34
179
|
const baseRouter = stackRouter(routerOptions);
|
|
35
180
|
return {
|
|
@@ -47,97 +192,10 @@ export const createTrueSheetRouter = stackRouter => routerOptions => {
|
|
|
47
192
|
};
|
|
48
193
|
},
|
|
49
194
|
getStateForAction(state, action, options) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
...state,
|
|
56
|
-
routes: state.routes.map((route, i) => i === routeIndex ? {
|
|
57
|
-
...route,
|
|
58
|
-
resizeIndex: action.index,
|
|
59
|
-
resizeKey: (route.resizeKey ?? 0) + 1
|
|
60
|
-
} : route)
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
case 'GO_BACK':
|
|
64
|
-
case 'DISMISS':
|
|
65
|
-
{
|
|
66
|
-
return this.getStateForAction(state, TrueSheetActions.pop(1), options);
|
|
67
|
-
}
|
|
68
|
-
case 'POP':
|
|
69
|
-
{
|
|
70
|
-
// Only base screen remains - let parent navigator handle it
|
|
71
|
-
if (state.routes.length <= 1) {
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
const count = 'payload' in action && typeof action.payload?.count === 'number' ? action.payload.count : 1;
|
|
75
|
-
|
|
76
|
-
// Calculate how many routes we can actually pop (don't pop base screen)
|
|
77
|
-
const maxPopCount = state.routes.length - 1;
|
|
78
|
-
const actualCount = Math.min(count, maxPopCount);
|
|
79
|
-
|
|
80
|
-
// Base screen - let parent navigator handle it
|
|
81
|
-
if (actualCount <= 0) {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Target index is the route we want to stay on (land on after pop)
|
|
86
|
-
// closingIndex is the first route to be dismissed (the one after target)
|
|
87
|
-
const targetIndex = state.routes.length - 1 - actualCount;
|
|
88
|
-
const closingIndex = targetIndex + 1;
|
|
89
|
-
|
|
90
|
-
// Mark only the bottom-most route to pop as closing
|
|
91
|
-
// The sheet's dismiss() will handle dismissing sheets above it first
|
|
92
|
-
return {
|
|
93
|
-
...state,
|
|
94
|
-
index: closingIndex,
|
|
95
|
-
routes: state.routes.map((route, i) => i === closingIndex ? {
|
|
96
|
-
...route,
|
|
97
|
-
closing: true
|
|
98
|
-
} : route)
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
case 'POP_TO_TOP':
|
|
102
|
-
{
|
|
103
|
-
const popCount = state.routes.length - 1;
|
|
104
|
-
return this.getStateForAction(state, TrueSheetActions.pop(popCount), options);
|
|
105
|
-
}
|
|
106
|
-
case 'POP_TO':
|
|
107
|
-
{
|
|
108
|
-
const targetName = 'payload' in action && typeof action.payload?.name === 'string' ? action.payload.name : null;
|
|
109
|
-
if (!targetName) {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
const targetIndex = state.routes.findIndex(r => r.name === targetName);
|
|
113
|
-
|
|
114
|
-
// Target not found or is the current route
|
|
115
|
-
if (targetIndex === -1 || targetIndex >= state.index) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
const popCount = state.routes.length - 1 - targetIndex;
|
|
119
|
-
return this.getStateForAction(state, TrueSheetActions.pop(popCount), options);
|
|
120
|
-
}
|
|
121
|
-
case 'REMOVE':
|
|
122
|
-
{
|
|
123
|
-
// Actually remove the closing route and all routes above it
|
|
124
|
-
const routeKey = action.source;
|
|
125
|
-
const routeIndex = routeKey ? state.routes.findIndex(r => r.key === routeKey) : state.routes.findIndex(r => r.closing);
|
|
126
|
-
if (routeIndex === -1) {
|
|
127
|
-
return state;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Remove the route and all routes above it (they were dismissed together)
|
|
131
|
-
const routes = state.routes.filter((_, i) => i < routeIndex);
|
|
132
|
-
return {
|
|
133
|
-
...state,
|
|
134
|
-
index: Math.min(state.index, routes.length - 1),
|
|
135
|
-
routes
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
default:
|
|
139
|
-
return baseRouter.getStateForAction(state, action, options);
|
|
140
|
-
}
|
|
195
|
+
const result = getStateForNavigateToBase(state, action,
|
|
196
|
+
// NAVIGATE never returns a partial state
|
|
197
|
+
popAction => baseRouter.getStateForAction(state, popAction, options)) ?? getTrueSheetStateForAction(state, action);
|
|
198
|
+
return result === undefined ? baseRouter.getStateForAction(state, action, options) : result;
|
|
141
199
|
},
|
|
142
200
|
getRehydratedState(partialState, {
|
|
143
201
|
routeNames,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TrueSheetActions","uid","Math","random","toString","slice","ensureBaseRoute","state","baseRouteName","routeParamList","hasBaseRoute","routes","some","r","name","baseRoute","key","params","index","length","
|
|
1
|
+
{"version":3,"names":["TrueSheetActions","uid","Math","random","toString","slice","ensureBaseRoute","state","baseRouteName","routeParamList","hasBaseRoute","routes","some","r","name","baseRoute","key","params","index","length","getResizeRouteIndex","action","target","source","findIndex","getTrueSheetStateForAction","type","routeIndex","map","route","i","resizeIndex","resizeKey","pop","count","payload","maxPopCount","actualCount","min","targetIndex","closingIndex","closing","dismissing","popCount","targetName","routeKey","removed","isPopped","filter","undefined","BASE_ROUTE_ACTIONS","Set","getStateForNavigateToBase","getPoppedState","hasSheets","has","popped","base","createTrueSheetRouter","stackRouter","routerOptions","baseRouter","getInitialState","options","initialRouteName","routeNames","stateWithBaseRoute","stale","getStateForAction","result","popAction","getRehydratedState","partialState","routeGetIdList","actionCreators"],"sourceRoot":"../../../src","sources":["navigation/createTrueSheetRouter.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAkC,cAAW;AAQtE,MAAMC,GAAG,GAAGA,CAAA,KAAMC,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AAEzD,MAAMC,eAAe,GAAGA,CACtBC,KAAQ,EACRC,aAAiC,EACjCC,cAA8D,KACf;EAC/C,IAAI,CAACD,aAAa,EAAE;IAClB,OAAOD,KAAK;EACd;EAEA,MAAMG,YAAY,GAAGH,KAAK,CAACI,MAAM,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,KAAKN,aAAa,CAAC;EAEvE,IAAI,CAACE,YAAY,EAAE;IACjB,MAAMK,SAAS,GA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1D,CAAC,IAAItC,0BAA0B,CAAClB,KAAK,EAAEc,MAAM,CAAC;MAEhD,OAAOgD,MAAM,KAAKpB,SAAS,GAAGY,UAAU,CAACO,iBAAiB,CAAC7D,KAAK,EAAEc,MAAM,EAAE0C,OAAO,CAAC,GAAGM,MAAM;IAC7F,CAAC;IAEDE,kBAAkBA,CAACC,YAAY,EAAE;MAAEP,UAAU;MAAExD,cAAc;MAAEgE;IAAe,CAAC,EAAE;MAC/E,IAAID,YAAY,CAACL,KAAK,KAAK,KAAK,EAAE;QAChC,OAAOK,YAAY;MACrB;MAEA,MAAMjE,KAAK,GAAGsD,UAAU,CAACU,kBAAkB,CAACC,YAAY,EAAE;QACxDP,UAAU;QACVxD,cAAc;QACdgE;MACF,CAAC,CAAC;MAEF,MAAMjE,aAAa,GAAGoD,aAAa,CAACI,gBAAgB,IAAIC,UAAU,CAAC,CAAC,CAAC;MACrE,MAAMC,kBAAkB,GAAG5D,eAAe,CAACC,KAAK,EAAEC,aAAa,EAAEC,cAAc,CAAC;MAEhF,OAAO;QACL,GAAGyD,kBAAkB;QACrBxC,IAAI,EAAE,YAAY;QAClBV,GAAG,EAAE,cAAcf,GAAG,CAAC,CAAC;MAC1B,CAAC;IACH,CAAC;IAEDyE,cAAc,EAAE1E;EAClB,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["navigation/expo-router/base-types.ts"],"mappings":"","ignoreList":[]}
|