@lodev09/react-native-true-sheet 2.0.6 → 4.0.0-beta.0
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 +36 -8
- package/RNTrueSheet.podspec +20 -0
- package/android/build.gradle +26 -14
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerView.kt +108 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContainerViewManager.kt +21 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentView.kt +46 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetContentViewManager.kt +21 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterView.kt +47 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetFooterViewManager.kt +21 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetModule.kt +165 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetPackage.kt +36 -4
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetView.kt +257 -303
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewController.kt +855 -0
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewManager.kt +104 -82
- package/android/src/main/java/com/lodev09/truesheet/events/DetentChangeEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DidDismissEvent.kt +20 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DidPresentEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DragBeginEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DragChangeEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/DragEndEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/events/MountEvent.kt +20 -0
- package/android/src/main/java/com/lodev09/truesheet/events/PositionChangeEvent.kt +32 -0
- package/android/src/main/java/com/lodev09/truesheet/events/SizeChangeEvent.kt +27 -0
- package/android/src/main/java/com/lodev09/truesheet/events/WillDismissEvent.kt +20 -0
- package/android/src/main/java/com/lodev09/truesheet/events/WillPresentEvent.kt +26 -0
- package/android/src/main/java/com/lodev09/truesheet/{core/Utils.kt → utils/ScreenUtils.kt} +47 -17
- package/android/src/main/res/values/styles.xml +8 -0
- package/ios/TrueSheetComponentDescriptor.h +24 -0
- package/ios/TrueSheetContainerView.h +47 -0
- package/ios/TrueSheetContainerView.mm +117 -0
- package/ios/TrueSheetContentView.h +37 -0
- package/ios/TrueSheetContentView.mm +114 -0
- package/ios/TrueSheetFooterView.h +27 -0
- package/ios/TrueSheetFooterView.mm +101 -0
- package/ios/TrueSheetModule.h +44 -0
- package/ios/TrueSheetModule.mm +133 -0
- package/ios/TrueSheetView.h +53 -0
- package/ios/TrueSheetView.mm +433 -0
- package/ios/TrueSheetViewController.h +53 -0
- package/ios/TrueSheetViewController.mm +649 -0
- package/ios/events/OnDetentChangeEvent.h +28 -0
- package/ios/events/OnDetentChangeEvent.mm +30 -0
- package/ios/events/OnDidDismissEvent.h +26 -0
- package/ios/events/OnDidDismissEvent.mm +25 -0
- package/ios/events/OnDidPresentEvent.h +28 -0
- package/ios/events/OnDidPresentEvent.mm +30 -0
- package/ios/events/OnDragBeginEvent.h +28 -0
- package/ios/events/OnDragBeginEvent.mm +30 -0
- package/ios/events/OnDragChangeEvent.h +28 -0
- package/ios/events/OnDragChangeEvent.mm +30 -0
- package/ios/events/OnDragEndEvent.h +28 -0
- package/ios/events/OnDragEndEvent.mm +30 -0
- package/ios/events/OnMountEvent.h +26 -0
- package/ios/events/OnMountEvent.mm +25 -0
- package/ios/events/OnPositionChangeEvent.h +29 -0
- package/ios/events/OnPositionChangeEvent.mm +32 -0
- package/ios/events/OnSizeChangeEvent.h +28 -0
- package/ios/events/OnSizeChangeEvent.mm +30 -0
- package/ios/events/OnWillDismissEvent.h +26 -0
- package/ios/events/OnWillDismissEvent.mm +25 -0
- package/ios/events/OnWillPresentEvent.h +28 -0
- package/ios/events/OnWillPresentEvent.mm +30 -0
- package/ios/utils/GestureUtil.h +25 -0
- package/ios/utils/GestureUtil.mm +26 -0
- package/ios/utils/LayoutUtil.h +44 -0
- package/ios/utils/LayoutUtil.mm +50 -0
- package/ios/utils/WindowUtil.h +27 -0
- package/ios/utils/WindowUtil.mm +42 -0
- package/lib/module/TrueSheet.js +231 -135
- package/lib/module/TrueSheet.js.map +1 -1
- package/lib/module/TrueSheetGrabber.js +16 -14
- package/lib/module/TrueSheetGrabber.js.map +1 -1
- package/lib/module/fabric/TrueSheetContainerViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetContentViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetFooterViewNativeComponent.ts +8 -0
- package/lib/module/fabric/TrueSheetViewNativeComponent.ts +63 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/reanimated/ReanimatedTrueSheet.js +87 -0
- package/lib/module/reanimated/ReanimatedTrueSheet.js.map +1 -0
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js +72 -0
- package/lib/module/reanimated/ReanimatedTrueSheetProvider.js.map +1 -0
- package/lib/module/reanimated/index.js +6 -0
- package/lib/module/reanimated/index.js.map +1 -0
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.js +19 -0
- package/lib/module/reanimated/useReanimatedPositionChangeHandler.js.map +1 -0
- package/lib/module/specs/NativeTrueSheetModule.js +12 -0
- package/lib/module/specs/NativeTrueSheetModule.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/TrueSheet.d.ts +79 -0
- package/lib/typescript/src/TrueSheet.d.ts.map +1 -0
- package/lib/typescript/src/TrueSheet.types.d.ts +260 -0
- package/lib/typescript/src/TrueSheet.types.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/TrueSheetGrabber.d.ts +1 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetContainerViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetContainerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetContentViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetContentViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/TrueSheetFooterViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts +44 -0
- package/lib/typescript/src/fabric/TrueSheetViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/{commonjs/src → src}/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts +43 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheet.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts +57 -0
- package/lib/typescript/src/reanimated/ReanimatedTrueSheetProvider.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/index.d.ts +4 -0
- package/lib/typescript/src/reanimated/index.d.ts.map +1 -0
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.d.ts +6 -0
- package/lib/typescript/src/reanimated/useReanimatedPositionChangeHandler.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts +34 -0
- package/lib/typescript/src/specs/NativeTrueSheetModule.d.ts.map +1 -0
- package/package.json +104 -75
- package/react-native.config.js +17 -0
- package/src/TrueSheet.tsx +285 -188
- package/src/TrueSheet.types.ts +119 -106
- package/src/TrueSheetGrabber.tsx +29 -28
- package/src/__mocks__/index.js +60 -12
- package/src/fabric/TrueSheetContainerViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetContentViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetFooterViewNativeComponent.ts +8 -0
- package/src/fabric/TrueSheetViewNativeComponent.ts +63 -0
- package/src/index.ts +4 -3
- package/src/reanimated/ReanimatedTrueSheet.tsx +95 -0
- package/src/reanimated/ReanimatedTrueSheetProvider.tsx +92 -0
- package/src/reanimated/index.ts +3 -0
- package/src/reanimated/useReanimatedPositionChangeHandler.ts +26 -0
- package/src/specs/NativeTrueSheetModule.ts +38 -0
- package/TrueSheet.podspec +0 -49
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetDialog.kt +0 -413
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetEvent.kt +0 -22
- package/android/src/main/java/com/lodev09/truesheet/TrueSheetViewModule.kt +0 -63
- package/android/src/main/java/com/lodev09/truesheet/core/KeyboardManager.kt +0 -58
- package/android/src/main/java/com/lodev09/truesheet/core/RootSheetView.kt +0 -102
- package/ios/Extensions/UIBlurEffect+withTint.swift +0 -62
- package/ios/Extensions/UIView+pinTo.swift +0 -74
- package/ios/Extensions/UIViewController+detentForSize.swift +0 -134
- package/ios/TrueSheet-Bridging-Header.h +0 -14
- package/ios/TrueSheetEvent.swift +0 -48
- package/ios/TrueSheetView.swift +0 -467
- package/ios/TrueSheetViewController.swift +0 -275
- package/ios/TrueSheetViewManager.m +0 -53
- package/ios/TrueSheetViewManager.swift +0 -48
- package/ios/Utils/Logger.swift +0 -39
- package/ios/Utils/Promise.swift +0 -25
- package/lib/commonjs/TrueSheet.js +0 -258
- package/lib/commonjs/TrueSheet.js.map +0 -1
- package/lib/commonjs/TrueSheet.types.js +0 -6
- package/lib/commonjs/TrueSheet.types.js.map +0 -1
- package/lib/commonjs/TrueSheetFooter.js +0 -19
- package/lib/commonjs/TrueSheetFooter.js.map +0 -1
- package/lib/commonjs/TrueSheetGrabber.js +0 -54
- package/lib/commonjs/TrueSheetGrabber.js.map +0 -1
- package/lib/commonjs/TrueSheetModule.js +0 -19
- package/lib/commonjs/TrueSheetModule.js.map +0 -1
- package/lib/commonjs/__mocks__/index.js +0 -52
- package/lib/commonjs/__mocks__/index.js.map +0 -1
- package/lib/commonjs/index.js +0 -39
- package/lib/commonjs/index.js.map +0 -1
- package/lib/module/TrueSheetFooter.js +0 -14
- package/lib/module/TrueSheetFooter.js.map +0 -1
- package/lib/module/TrueSheetModule.js +0 -15
- package/lib/module/TrueSheetModule.js.map +0 -1
- package/lib/module/__mocks__/index.js +0 -21
- package/lib/module/__mocks__/index.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/TrueSheet.d.ts +0 -70
- package/lib/typescript/commonjs/src/TrueSheet.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheet.types.d.ts +0 -241
- package/lib/typescript/commonjs/src/TrueSheet.types.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheetFooter.d.ts +0 -7
- package/lib/typescript/commonjs/src/TrueSheetFooter.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheetGrabber.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/TrueSheetModule.d.ts +0 -2
- package/lib/typescript/commonjs/src/TrueSheetModule.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheet.d.ts +0 -70
- package/lib/typescript/module/src/TrueSheet.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheet.types.d.ts +0 -241
- package/lib/typescript/module/src/TrueSheet.types.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheetFooter.d.ts +0 -7
- package/lib/typescript/module/src/TrueSheetFooter.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheetGrabber.d.ts +0 -39
- package/lib/typescript/module/src/TrueSheetGrabber.d.ts.map +0 -1
- package/lib/typescript/module/src/TrueSheetModule.d.ts +0 -2
- package/lib/typescript/module/src/TrueSheetModule.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -4
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/src/TrueSheetFooter.tsx +0 -17
- package/src/TrueSheetModule.ts +0 -19
- /package/lib/{typescript/module → module}/package.json +0 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import type { ComponentType, ReactElement } from 'react';
|
|
2
|
+
import type { ColorValue, NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
3
|
+
import type { TrueSheetGrabberProps } from './TrueSheetGrabber';
|
|
4
|
+
export interface DetentInfoEventPayload {
|
|
5
|
+
/**
|
|
6
|
+
* The index position from the provided `detents`.
|
|
7
|
+
*/
|
|
8
|
+
index: number;
|
|
9
|
+
/**
|
|
10
|
+
* The Y position of the sheet relative to the screen.
|
|
11
|
+
*/
|
|
12
|
+
position: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PositionChangeEventPayload extends DetentInfoEventPayload {
|
|
15
|
+
/**
|
|
16
|
+
* Workaround for cases where we can't get real-time position from native.
|
|
17
|
+
* When true, manually animate the position in JS.
|
|
18
|
+
*/
|
|
19
|
+
transitioning: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type MountEvent = NativeSyntheticEvent<null>;
|
|
22
|
+
export type DetentChangeEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
|
|
23
|
+
export type WillPresentEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
|
|
24
|
+
export type DidPresentEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
|
|
25
|
+
export type WillDismissEvent = NativeSyntheticEvent<null>;
|
|
26
|
+
export type DidDismissEvent = NativeSyntheticEvent<null>;
|
|
27
|
+
export type DragBeginEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
|
|
28
|
+
export type DragChangeEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
|
|
29
|
+
export type DragEndEvent = NativeSyntheticEvent<DetentInfoEventPayload>;
|
|
30
|
+
export type PositionChangeEvent = NativeSyntheticEvent<PositionChangeEventPayload>;
|
|
31
|
+
/**
|
|
32
|
+
* Internal event payload for size changes (not exposed to users)
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export interface SizeChangeEventPayload {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Internal event type for size changes (not exposed to users)
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
export type SizeChangeEvent = NativeSyntheticEvent<SizeChangeEventPayload>;
|
|
44
|
+
/**
|
|
45
|
+
* Blur style mapped to native values in IOS.
|
|
46
|
+
*
|
|
47
|
+
* @platform ios
|
|
48
|
+
*/
|
|
49
|
+
export type BlurTint = 'light' | 'dark' | 'default' | 'extraLight' | 'regular' | 'prominent' | 'systemUltraThinMaterial' | 'systemThinMaterial' | 'systemMaterial' | 'systemThickMaterial' | 'systemChromeMaterial' | 'systemUltraThinMaterialLight' | 'systemThinMaterialLight' | 'systemMaterialLight' | 'systemThickMaterialLight' | 'systemChromeMaterialLight' | 'systemUltraThinMaterialDark' | 'systemThinMaterialDark' | 'systemMaterialDark' | 'systemThickMaterialDark' | 'systemChromeMaterialDark';
|
|
50
|
+
/**
|
|
51
|
+
* Supported Sheet detent.
|
|
52
|
+
*
|
|
53
|
+
* @platform android
|
|
54
|
+
* @platform ios 15+
|
|
55
|
+
*/
|
|
56
|
+
export type SheetDetent =
|
|
57
|
+
/**
|
|
58
|
+
* Auto resize based on content height, clamped to container height.
|
|
59
|
+
* Use the `maxHeight` prop to set a custom limit.
|
|
60
|
+
*
|
|
61
|
+
* @platform android
|
|
62
|
+
* @platform ios 16+
|
|
63
|
+
*/
|
|
64
|
+
'auto'
|
|
65
|
+
/**
|
|
66
|
+
* Relative height as a fraction (0-1) of the available height.
|
|
67
|
+
* For example, 0.5 represents 50% of the available height.
|
|
68
|
+
*
|
|
69
|
+
* @platform android
|
|
70
|
+
* @platform ios 16+
|
|
71
|
+
*/
|
|
72
|
+
| number;
|
|
73
|
+
export interface TrueSheetProps extends ViewProps {
|
|
74
|
+
/**
|
|
75
|
+
* The name to reference this sheet. It has to be unique.
|
|
76
|
+
* You can then present this sheet globally using its `name`.
|
|
77
|
+
*
|
|
78
|
+
* Example:
|
|
79
|
+
* ```ts
|
|
80
|
+
* <TrueSheet name="my-awesome-sheet">
|
|
81
|
+
* <MyComponent />
|
|
82
|
+
* </TrueSheet>
|
|
83
|
+
* ```
|
|
84
|
+
* ```ts
|
|
85
|
+
* TrueSheet.present('my-awesome-sheet')
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
name?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The detents you want the Sheet to support.
|
|
91
|
+
* Maximum of 3 detents only; collapsed, half-expanded, expanded.
|
|
92
|
+
*
|
|
93
|
+
* Example:
|
|
94
|
+
* ```ts
|
|
95
|
+
* detents={['auto', 0.6, 1]}
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @default [0.5, 1]
|
|
99
|
+
*/
|
|
100
|
+
detents?: SheetDetent[];
|
|
101
|
+
/**
|
|
102
|
+
* Specify whether the sheet background is dimmed.
|
|
103
|
+
* Set to `false` to allow interaction with the background components.
|
|
104
|
+
*
|
|
105
|
+
* @platform android
|
|
106
|
+
* @platform ios 15+
|
|
107
|
+
* @default true
|
|
108
|
+
*/
|
|
109
|
+
dimmed?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Initially present the sheet, after mounting, at a given detent index.
|
|
112
|
+
*
|
|
113
|
+
* @note This property is only used during the initial mount.
|
|
114
|
+
* @default -1
|
|
115
|
+
*/
|
|
116
|
+
initialDetentIndex?: number;
|
|
117
|
+
/**
|
|
118
|
+
* Specify whether the sheet should animate after mounting.
|
|
119
|
+
* Used with `initialDetentIndex`.
|
|
120
|
+
*
|
|
121
|
+
* @default true
|
|
122
|
+
*/
|
|
123
|
+
initialDetentAnimated?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* The detent index that the sheet should start to dim the background.
|
|
126
|
+
* This is ignored if `dimmed` is set to `false`.
|
|
127
|
+
*
|
|
128
|
+
* @default 0
|
|
129
|
+
*/
|
|
130
|
+
dimmedIndex?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Prevents interactive dismissal of the Sheet.
|
|
133
|
+
*
|
|
134
|
+
* @default true
|
|
135
|
+
*/
|
|
136
|
+
dismissible?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Main sheet background color.
|
|
139
|
+
|
|
140
|
+
* @default white
|
|
141
|
+
*/
|
|
142
|
+
backgroundColor?: ColorValue;
|
|
143
|
+
/**
|
|
144
|
+
* The sheet corner radius.
|
|
145
|
+
*
|
|
146
|
+
* - `undefined` (not provided): Uses system default corner radius
|
|
147
|
+
* - `0`: Sharp corners (no rounding)
|
|
148
|
+
* - `> 0`: Custom corner radius value
|
|
149
|
+
*
|
|
150
|
+
* @platform android
|
|
151
|
+
* @platform ios 15+
|
|
152
|
+
*/
|
|
153
|
+
cornerRadius?: number;
|
|
154
|
+
/**
|
|
155
|
+
* Shows native grabber (or handle) on IOS.
|
|
156
|
+
*
|
|
157
|
+
* @platform ios
|
|
158
|
+
* @default true
|
|
159
|
+
*/
|
|
160
|
+
grabber?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Grabber props to be used for android grabber or handle.
|
|
163
|
+
*
|
|
164
|
+
* @platform android
|
|
165
|
+
*/
|
|
166
|
+
grabberProps?: TrueSheetGrabberProps;
|
|
167
|
+
/**
|
|
168
|
+
* The blur effect style on iOS.
|
|
169
|
+
* Overrides `backgroundColor` if set.
|
|
170
|
+
*
|
|
171
|
+
* @platform ios
|
|
172
|
+
*/
|
|
173
|
+
blurTint?: BlurTint;
|
|
174
|
+
/**
|
|
175
|
+
* Overrides `large` or `100%` height.
|
|
176
|
+
* Also sets the maximum height for 'auto' detents.
|
|
177
|
+
*/
|
|
178
|
+
maxHeight?: number;
|
|
179
|
+
/**
|
|
180
|
+
* Allows the sheet to extend behind the status bar when fully expanded in edge-to-edge mode.
|
|
181
|
+
* When false (default), the sheet stops at the bottom of the status bar.
|
|
182
|
+
*
|
|
183
|
+
* @platform android
|
|
184
|
+
* @default false
|
|
185
|
+
*/
|
|
186
|
+
edgeToEdgeFullScreen?: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* A component that floats at the bottom of the Sheet.
|
|
189
|
+
*/
|
|
190
|
+
footer?: ComponentType<unknown> | ReactElement;
|
|
191
|
+
/**
|
|
192
|
+
* Determines how the software keyboard will impact the layout of the sheet.
|
|
193
|
+
* Set to `pan` if you're working with `FlatList` with a `TextInput`.
|
|
194
|
+
*
|
|
195
|
+
* @platform android
|
|
196
|
+
* @default resize
|
|
197
|
+
*/
|
|
198
|
+
keyboardMode?: 'resize' | 'pan';
|
|
199
|
+
/**
|
|
200
|
+
* Called when the sheet's content is mounted and ready.
|
|
201
|
+
* The sheet automatically waits for this event before presenting.
|
|
202
|
+
*/
|
|
203
|
+
onMount?: (event: MountEvent) => void;
|
|
204
|
+
/**
|
|
205
|
+
* Called when the Sheet is about to be presented.
|
|
206
|
+
*/
|
|
207
|
+
onWillPresent?: (event: WillPresentEvent) => void;
|
|
208
|
+
/**
|
|
209
|
+
* Called when the Sheet has been presented.
|
|
210
|
+
* Comes with the detent info.
|
|
211
|
+
*/
|
|
212
|
+
onDidPresent?: (event: DidPresentEvent) => void;
|
|
213
|
+
/**
|
|
214
|
+
* Called when the Sheet is about to be dismissed
|
|
215
|
+
*/
|
|
216
|
+
onWillDismiss?: (event: WillDismissEvent) => void;
|
|
217
|
+
/**
|
|
218
|
+
* Called when the Sheet has been dismissed
|
|
219
|
+
*/
|
|
220
|
+
onDidDismiss?: (event: DidDismissEvent) => void;
|
|
221
|
+
/**
|
|
222
|
+
* Called when the detent of the sheet has changed.
|
|
223
|
+
* Either by dragging or programatically.
|
|
224
|
+
*/
|
|
225
|
+
onDetentChange?: (event: DetentChangeEvent) => void;
|
|
226
|
+
/**
|
|
227
|
+
* Called when the sheet has began dragging.
|
|
228
|
+
* Comes with the detent info.
|
|
229
|
+
*
|
|
230
|
+
* @platform android
|
|
231
|
+
* @platform ios 15+
|
|
232
|
+
*/
|
|
233
|
+
onDragBegin?: (event: DragBeginEvent) => void;
|
|
234
|
+
/**
|
|
235
|
+
* Called when the sheet is being dragged.
|
|
236
|
+
* Comes with the detent info.
|
|
237
|
+
*
|
|
238
|
+
* @platform android
|
|
239
|
+
* @platform ios 15+
|
|
240
|
+
*/
|
|
241
|
+
onDragChange?: (event: DragChangeEvent) => void;
|
|
242
|
+
/**
|
|
243
|
+
* Called when the sheet dragging has ended.
|
|
244
|
+
* Comes with the detent info.
|
|
245
|
+
*
|
|
246
|
+
* @platform android
|
|
247
|
+
* @platform ios 15+
|
|
248
|
+
*/
|
|
249
|
+
onDragEnd?: (event: DragEndEvent) => void;
|
|
250
|
+
/**
|
|
251
|
+
* Called when the sheet's position changes.
|
|
252
|
+
* This fires continuously during sheet position changes.
|
|
253
|
+
* Comes with the detent info.
|
|
254
|
+
*
|
|
255
|
+
* @platform android
|
|
256
|
+
* @platform ios 15+
|
|
257
|
+
*/
|
|
258
|
+
onPositionChange?: (event: PositionChangeEvent) => void;
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=TrueSheet.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheet.types.d.ts","sourceRoot":"","sources":["../../../src/TrueSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;IACxE;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;AACpD,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,CA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IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAEhD;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAEpD;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAE9C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAEhD;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IAE1C;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAQjG,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,mDAiB5D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=TrueSheetContainerViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetContainerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetContainerViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,wBAAiF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=TrueSheetContentViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetContentViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetContentViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,wBAA+E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
export interface NativeProps extends ViewProps {
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
5
|
+
export default _default;
|
|
6
|
+
//# sourceMappingURL=TrueSheetFooterViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetFooterViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetFooterViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,WAAY,SAAQ,SAAS;CAE7C;;AAED,wBAA8E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
import type { DirectEventHandler, Double, Int32, WithDefault, Float } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface DetentInfoEventPayload {
|
|
4
|
+
index: Int32;
|
|
5
|
+
position: Double;
|
|
6
|
+
}
|
|
7
|
+
export interface PositionChangeEventPayload {
|
|
8
|
+
index: Int32;
|
|
9
|
+
position: Double;
|
|
10
|
+
transitioning: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SizeChangeEventPayload {
|
|
13
|
+
width: Double;
|
|
14
|
+
height: Double;
|
|
15
|
+
}
|
|
16
|
+
export interface NativeProps extends ViewProps {
|
|
17
|
+
detents?: ReadonlyArray<Float>;
|
|
18
|
+
maxHeight?: WithDefault<Double, 0>;
|
|
19
|
+
background?: WithDefault<Int32, 0>;
|
|
20
|
+
cornerRadius?: WithDefault<Double, -1>;
|
|
21
|
+
initialDetentIndex?: WithDefault<Int32, -1>;
|
|
22
|
+
dimmedIndex?: WithDefault<Int32, 0>;
|
|
23
|
+
blurTint?: WithDefault<string, ''>;
|
|
24
|
+
keyboardMode?: WithDefault<'resize' | 'pan', 'resize'>;
|
|
25
|
+
grabber?: WithDefault<boolean, true>;
|
|
26
|
+
dismissible?: WithDefault<boolean, true>;
|
|
27
|
+
dimmed?: WithDefault<boolean, true>;
|
|
28
|
+
initialDetentAnimated?: WithDefault<boolean, true>;
|
|
29
|
+
edgeToEdgeFullScreen?: WithDefault<boolean, false>;
|
|
30
|
+
onMount?: DirectEventHandler<null>;
|
|
31
|
+
onWillPresent?: DirectEventHandler<DetentInfoEventPayload>;
|
|
32
|
+
onDidPresent?: DirectEventHandler<DetentInfoEventPayload>;
|
|
33
|
+
onWillDismiss?: DirectEventHandler<null>;
|
|
34
|
+
onDidDismiss?: DirectEventHandler<null>;
|
|
35
|
+
onDetentChange?: DirectEventHandler<DetentInfoEventPayload>;
|
|
36
|
+
onDragBegin?: DirectEventHandler<DetentInfoEventPayload>;
|
|
37
|
+
onDragChange?: DirectEventHandler<DetentInfoEventPayload>;
|
|
38
|
+
onDragEnd?: DirectEventHandler<DetentInfoEventPayload>;
|
|
39
|
+
onPositionChange?: DirectEventHandler<PositionChangeEventPayload>;
|
|
40
|
+
onSizeChange?: DirectEventHandler<SizeChangeEventPayload>;
|
|
41
|
+
}
|
|
42
|
+
declare const _default: import("react-native").HostComponent<NativeProps>;
|
|
43
|
+
export default _default;
|
|
44
|
+
//# sourceMappingURL=TrueSheetViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrueSheetViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/TrueSheetViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,MAAM,EACN,KAAK,EACL,WAAW,EACX,KAAK,EACN,MAAM,2CAA2C,CAAC;AAGnD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAE5C,OAAO,CAAC,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAG/B,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CA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,CAAC;IAC1D,SAAS,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;IACvD,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;IAClE,YAAY,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;CAC3D;;AAED,wBAAoE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TrueSheet } from '../TrueSheet';
|
|
2
|
+
import type { TrueSheetProps } from '../TrueSheet.types';
|
|
3
|
+
interface ReanimatedTrueSheetProps extends TrueSheetProps {
|
|
4
|
+
/**
|
|
5
|
+
* Worklet version of `onPositionChange`
|
|
6
|
+
*
|
|
7
|
+
* @see {@link TrueSheetProps.onPositionChange}
|
|
8
|
+
*/
|
|
9
|
+
onPositionChange?: TrueSheetProps['onPositionChange'];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reanimated-enabled version of TrueSheet that automatically syncs position with the provider's shared value.
|
|
13
|
+
* Must be used within a ReanimatedTrueSheetProvider.
|
|
14
|
+
*
|
|
15
|
+
* NOTE: `onPositionChange` is now under UI thread.
|
|
16
|
+
* Make sure you add `worklet` if you want to override this.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { ReanimatedTrueSheet, ReanimatedTrueSheetProvider } from '@lodev09/react-native-true-sheet'
|
|
21
|
+
*
|
|
22
|
+
* function MyScreen() {
|
|
23
|
+
* const sheetRef = useRef<TrueSheet>(null)
|
|
24
|
+
*
|
|
25
|
+
* return (
|
|
26
|
+
* <ReanimatedTrueSheetProvider>
|
|
27
|
+
* <View>
|
|
28
|
+
* <ReanimatedTrueSheet
|
|
29
|
+
* ref={sheetRef}
|
|
30
|
+
* detents={[0.25, 0.5, 1]}
|
|
31
|
+
* initialDetentIndex={1}
|
|
32
|
+
* >
|
|
33
|
+
* <Text>Sheet Content</Text>
|
|
34
|
+
* </ReanimatedTrueSheet>
|
|
35
|
+
* </View>
|
|
36
|
+
* </ReanimatedTrueSheetProvider>
|
|
37
|
+
* )
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const ReanimatedTrueSheet: import("react").ForwardRefExoticComponent<ReanimatedTrueSheetProps & import("react").RefAttributes<TrueSheet>>;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=ReanimatedTrueSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReanimatedTrueSheet.d.ts","sourceRoot":"","sources":["../../../../src/reanimated/ReanimatedTrueSheet.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,oBAAoB,CAAC;AAgB9E,UAAU,wBAAyB,SAAQ,cAAc;IACvD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,cAAc,CAAC,kBAAkB,CAAC,CAAC;CACvD;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,mBAAmB,gHAyB9B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
3
|
+
export interface ReanimatedTrueSheetContextValue {
|
|
4
|
+
/**
|
|
5
|
+
* Shared value representing the current sheet position (Y offset from bottom)
|
|
6
|
+
*/
|
|
7
|
+
animatedPosition: SharedValue<number>;
|
|
8
|
+
/**
|
|
9
|
+
* Shared value representing the current detent index
|
|
10
|
+
*/
|
|
11
|
+
animatedIndex: SharedValue<number>;
|
|
12
|
+
}
|
|
13
|
+
export interface ReanimatedTrueSheetProviderProps {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Provider component that manages shared values for Reanimated TrueSheet.
|
|
18
|
+
* Wrap your app or component tree with this provider to enable Reanimated integration.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* import { ReanimatedTrueSheetProvider } from '@lodev09/react-native-true-sheet'
|
|
23
|
+
*
|
|
24
|
+
* function App() {
|
|
25
|
+
* return (
|
|
26
|
+
* <ReanimatedTrueSheetProvider>
|
|
27
|
+
* <YourApp />
|
|
28
|
+
* </ReanimatedTrueSheetProvider>
|
|
29
|
+
* )
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const ReanimatedTrueSheetProvider: ({ children }: ReanimatedTrueSheetProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* Hook to access the Reanimated TrueSheet context.
|
|
36
|
+
* Returns the shared values for sheet position and detent index that can be used in animations.
|
|
37
|
+
*
|
|
38
|
+
* @throws Error if used outside of ReanimatedTrueSheetProvider
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* import { useReanimatedTrueSheet } from '@lodev09/react-native-true-sheet'
|
|
43
|
+
* import { useAnimatedStyle } from 'react-native-reanimated'
|
|
44
|
+
*
|
|
45
|
+
* function MyComponent() {
|
|
46
|
+
* const { animatedPosition, animatedIndex } = useReanimatedTrueSheet()
|
|
47
|
+
*
|
|
48
|
+
* const animatedStyle = useAnimatedStyle(() => ({
|
|
49
|
+
* transform: [{ translateY: -animatedPosition.value }]
|
|
50
|
+
* }))
|
|
51
|
+
*
|
|
52
|
+
* return <Animated.View style={animatedStyle}>...</Animated.View>
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare const useReanimatedTrueSheet: () => ReanimatedTrueSheetContextValue;
|
|
57
|
+
//# sourceMappingURL=ReanimatedTrueSheetProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReanimatedTrueSheetProvider.d.ts","sourceRoot":"","sources":["../../../../src/reanimated/ReanimatedTrueSheetProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3E,MAAM,WAAW,+BAA+B;IAC9C;;OAEG;IACH,gBAAgB,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC;;OAEG;IACH,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACpC;AAID,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,2BAA2B,GAAI,cAAc,gCAAgC,4CAkBzF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB,QAAO,+BAWzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/reanimated/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PositionChangeEvent, PositionChangeEventPayload } from '../TrueSheet.types';
|
|
2
|
+
import type { DependencyList } from 'react-native-reanimated/lib/typescript/hook/commonTypes';
|
|
3
|
+
type PositionChangeHandler = (payload: PositionChangeEventPayload, context: Record<string, unknown>) => void;
|
|
4
|
+
export declare const useReanimatedPositionChangeHandler: (handler: PositionChangeHandler, dependencies?: DependencyList) => import("react-native-reanimated").EventHandlerProcessed<PositionChangeEvent, never>;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=useReanimatedPositionChangeHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReanimatedPositionChangeHandler.d.ts","sourceRoot":"","sources":["../../../../src/reanimated/useReanimatedPositionChangeHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AAE9F,KAAK,qBAAqB,GAAG,CAC3B,OAAO,EAAE,0BAA0B,EACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,IAAI,CAAC;AAEV,eAAO,MAAM,kCAAkC,GAC7C,SAAS,qBAAqB,EAC9B,eAAc,cAAmB,wFAclC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TurboModule spec for TrueSheet imperative API
|
|
3
|
+
* Provides promise-based async operations with proper error handling
|
|
4
|
+
*
|
|
5
|
+
* @format
|
|
6
|
+
*/
|
|
7
|
+
import type { TurboModule } from 'react-native';
|
|
8
|
+
interface Spec extends TurboModule {
|
|
9
|
+
/**
|
|
10
|
+
* Present a sheet by reference
|
|
11
|
+
* @param viewTag - Native view tag of the sheet component
|
|
12
|
+
* @param index - Detent index to present at
|
|
13
|
+
* @returns Promise that resolves when sheet is fully presented
|
|
14
|
+
* @throws PRESENT_FAILED if presentation fails
|
|
15
|
+
*/
|
|
16
|
+
presentByRef(viewTag: number, index: number): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Dismiss a sheet by reference
|
|
19
|
+
* @param viewTag - Native view tag of the sheet component
|
|
20
|
+
* @returns Promise that resolves when sheet is fully dismissed
|
|
21
|
+
* @throws DISMISS_FAILED if dismissal fails
|
|
22
|
+
*/
|
|
23
|
+
dismissByRef(viewTag: number): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Resize a sheet to a different index by reference
|
|
26
|
+
* @param viewTag - Native view tag of the sheet component
|
|
27
|
+
* @param index - New detent index
|
|
28
|
+
* @returns Promise that resolves when resize is complete
|
|
29
|
+
*/
|
|
30
|
+
resizeByRef(viewTag: number, index: number): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
declare const _default: Spec | null;
|
|
33
|
+
export default _default;
|
|
34
|
+
//# sourceMappingURL=NativeTrueSheetModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeTrueSheetModule.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativeTrueSheetModule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,UAAU,IAAK,SAAQ,WAAW;IAChC;;;;;;OAMG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;;AAED,wBAAgE"}
|