@hanzogui/sheet 8.0.0 → 8.1.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/package.json +36 -21
- package/types/Sheet.d.ts +43 -43
- package/types/Sheet.d.ts.map +1 -1
- package/types/SheetImplementationCustom.d.ts +2 -2
- package/types/SheetScrollView.d.ts +10 -10
- package/types/createSheet.d.ts +22 -22
- package/.turbo/turbo-build.log +0 -2
- package/test/keyboardAvoidance.test.ts +0 -269
- package/tsconfig.json +0 -57
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/sheet",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"controller",
|
|
8
|
+
"dist",
|
|
9
|
+
"next.md",
|
|
10
|
+
"setup-gesture-handler.cjs",
|
|
11
|
+
"setup-gesture-handler",
|
|
12
|
+
"src",
|
|
13
|
+
"types"
|
|
14
|
+
],
|
|
6
15
|
"type": "module",
|
|
7
16
|
"sideEffects": false,
|
|
8
17
|
"main": "dist/cjs",
|
|
@@ -54,27 +63,28 @@
|
|
|
54
63
|
"clean": "hanzogui-build clean"
|
|
55
64
|
},
|
|
56
65
|
"dependencies": {
|
|
57
|
-
"@hanzogui/adapt": "8.
|
|
58
|
-
"@hanzogui/animate-presence": "8.
|
|
59
|
-
"@hanzogui/animations-react-native": "8.
|
|
60
|
-
"@hanzogui/compose-refs": "8.
|
|
61
|
-
"@hanzogui/constants": "8.
|
|
62
|
-
"@hanzogui/core": "8.
|
|
63
|
-
"@hanzogui/create-context": "8.
|
|
64
|
-
"@hanzogui/helpers": "8.
|
|
65
|
-
"@hanzogui/native": "8.
|
|
66
|
-
"@hanzogui/portal": "8.
|
|
67
|
-
"@hanzogui/remove-scroll": "8.
|
|
68
|
-
"@hanzogui/scroll-view": "8.
|
|
69
|
-
"@hanzogui/stacks": "8.
|
|
70
|
-
"@hanzogui/use-constant": "8.
|
|
71
|
-
"@hanzogui/use-controllable-state": "8.
|
|
72
|
-
"@hanzogui/use-did-finish-ssr": "8.
|
|
73
|
-
"@hanzogui/use-keyboard-visible": "8.
|
|
74
|
-
"@hanzogui/
|
|
66
|
+
"@hanzogui/adapt": "8.1.0",
|
|
67
|
+
"@hanzogui/animate-presence": "8.1.0",
|
|
68
|
+
"@hanzogui/animations-react-native": "8.1.0",
|
|
69
|
+
"@hanzogui/compose-refs": "8.1.0",
|
|
70
|
+
"@hanzogui/constants": "8.1.0",
|
|
71
|
+
"@hanzogui/core": "8.1.0",
|
|
72
|
+
"@hanzogui/create-context": "8.1.0",
|
|
73
|
+
"@hanzogui/helpers": "8.1.0",
|
|
74
|
+
"@hanzogui/native": "8.1.0",
|
|
75
|
+
"@hanzogui/portal": "8.1.0",
|
|
76
|
+
"@hanzogui/remove-scroll": "8.1.0",
|
|
77
|
+
"@hanzogui/scroll-view": "8.1.0",
|
|
78
|
+
"@hanzogui/stacks": "8.1.0",
|
|
79
|
+
"@hanzogui/use-constant": "8.1.0",
|
|
80
|
+
"@hanzogui/use-controllable-state": "8.1.0",
|
|
81
|
+
"@hanzogui/use-did-finish-ssr": "8.1.0",
|
|
82
|
+
"@hanzogui/use-keyboard-visible": "8.1.0",
|
|
83
|
+
"@hanzogui/web": "8.1.0",
|
|
84
|
+
"@hanzogui/z-index-stack": "8.1.0"
|
|
75
85
|
},
|
|
76
86
|
"devDependencies": {
|
|
77
|
-
"@hanzogui/build": "8.
|
|
87
|
+
"@hanzogui/build": "8.1.0",
|
|
78
88
|
"react": ">=19",
|
|
79
89
|
"react-native": "0.83.2",
|
|
80
90
|
"react-native-gesture-handler": "~2.30.0",
|
|
@@ -84,5 +94,10 @@
|
|
|
84
94
|
"react": ">=19"
|
|
85
95
|
},
|
|
86
96
|
"module:jsx": "dist/jsx",
|
|
87
|
-
"removeSideEffects": true
|
|
97
|
+
"removeSideEffects": true,
|
|
98
|
+
"repository": {
|
|
99
|
+
"type": "git",
|
|
100
|
+
"url": "git+https://github.com/hanzoai/gui.git",
|
|
101
|
+
"directory": "pkgs/ui/sheet"
|
|
102
|
+
}
|
|
88
103
|
}
|
package/types/Sheet.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export { createSheetScope } from './SheetContext';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export declare const Handle: import("@hanzogui/
|
|
3
|
+
export declare const Handle: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
4
4
|
open?: boolean | undefined;
|
|
5
5
|
unstyled?: boolean | undefined;
|
|
6
|
-
elevation?: number | import("@hanzogui/
|
|
6
|
+
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
7
7
|
fullscreen?: boolean | undefined;
|
|
8
|
-
}, import("@hanzogui/
|
|
9
|
-
export declare const Overlay: import("@hanzogui/
|
|
8
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
9
|
+
export declare const Overlay: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
10
10
|
open?: boolean | undefined;
|
|
11
11
|
unstyled?: boolean | undefined;
|
|
12
|
-
elevation?: number | import("@hanzogui/
|
|
12
|
+
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
13
13
|
fullscreen?: boolean | undefined;
|
|
14
|
-
}, import("@hanzogui/
|
|
15
|
-
export declare const Frame: import("@hanzogui/
|
|
14
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
15
|
+
export declare const Frame: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
16
16
|
unstyled?: boolean | undefined;
|
|
17
|
-
elevation?: number | import("@hanzogui/
|
|
17
|
+
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
18
18
|
fullscreen?: boolean | undefined;
|
|
19
|
-
}, import("@hanzogui/
|
|
19
|
+
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
20
20
|
export declare const Sheet: import("react").ForwardRefExoticComponent<{
|
|
21
21
|
open?: boolean;
|
|
22
22
|
defaultOpen?: boolean;
|
|
@@ -31,12 +31,12 @@ export declare const Sheet: import("react").ForwardRefExoticComponent<{
|
|
|
31
31
|
dismissOnSnapToBottom?: boolean;
|
|
32
32
|
disableRemoveScroll?: boolean;
|
|
33
33
|
forceRemoveScrollEnabled?: boolean;
|
|
34
|
-
transitionConfig?: import("@hanzogui/
|
|
34
|
+
transitionConfig?: import("@hanzogui/web").AnimatedNumberStrategy;
|
|
35
35
|
preferAdaptParentOpenState?: boolean;
|
|
36
36
|
unmountChildrenWhenHidden?: boolean;
|
|
37
37
|
disableTransparencyHide?: boolean;
|
|
38
38
|
native?: "ios"[] | boolean;
|
|
39
|
-
transition?: import("@hanzogui/
|
|
39
|
+
transition?: import("@hanzogui/web").TransitionProp;
|
|
40
40
|
handleDisableScroll?: boolean;
|
|
41
41
|
disableDrag?: boolean;
|
|
42
42
|
modal?: boolean;
|
|
@@ -51,9 +51,9 @@ export declare const Sheet: import("react").ForwardRefExoticComponent<{
|
|
|
51
51
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
52
52
|
} & import("react").RefAttributes<import("react-native").View>> & {
|
|
53
53
|
Controlled: import("react").FunctionComponent<Omit<import("./types").SheetProps, "open" | "onOpenChange"> & import("react").RefAttributes<import("react-native").View>> & {
|
|
54
|
-
Frame: import("react").ForwardRefExoticComponent<import("./types").SheetScopedProps<Omit<import("@hanzogui/
|
|
54
|
+
Frame: import("react").ForwardRefExoticComponent<import("./types").SheetScopedProps<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
55
55
|
unstyled?: boolean | undefined;
|
|
56
|
-
elevation?: number | import("@hanzogui/
|
|
56
|
+
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
57
57
|
fullscreen?: boolean | undefined;
|
|
58
58
|
}>, keyof {
|
|
59
59
|
disableHideBottomOverflow?: boolean;
|
|
@@ -62,52 +62,52 @@ export declare const Sheet: import("react").ForwardRefExoticComponent<{
|
|
|
62
62
|
disableHideBottomOverflow?: boolean;
|
|
63
63
|
adjustPaddingForOffscreenContent?: boolean;
|
|
64
64
|
}>>;
|
|
65
|
-
Overlay: import("@hanzogui/
|
|
65
|
+
Overlay: import("@hanzogui/web").GuiComponent<Omit<import("@hanzogui/web").StackNonStyleProps & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase, {}>> & {
|
|
66
66
|
open?: boolean;
|
|
67
67
|
}, "__scopeSheet"> & {
|
|
68
68
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
69
69
|
}, any, any, any, {
|
|
70
70
|
open?: boolean;
|
|
71
|
-
}, {}> | import("@hanzogui/
|
|
71
|
+
}, {}> | import("@hanzogui/web").GuiComponent<Omit<import("@hanzogui/web").StackNonStyleProps & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase, {}>> & {
|
|
72
72
|
open?: boolean;
|
|
73
73
|
}, "__scopeSheet"> & {
|
|
74
74
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
75
75
|
}, any, {
|
|
76
76
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
77
77
|
}, {}, {}, {}>;
|
|
78
|
-
Handle: import("@hanzogui/
|
|
78
|
+
Handle: import("@hanzogui/web").GuiComponent<any, any, any, any, {
|
|
79
79
|
open?: boolean;
|
|
80
|
-
}, {}> | import("@hanzogui/
|
|
81
|
-
ScrollView: import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/
|
|
82
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
80
|
+
}, {}> | import("@hanzogui/web").GuiComponent<any, any, any, {}, {}, {}>;
|
|
81
|
+
ScrollView: import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/web").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@hanzogui/web").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
82
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
83
83
|
accept: {
|
|
84
84
|
readonly contentContainerStyle: "style";
|
|
85
85
|
};
|
|
86
86
|
}>> | undefined;
|
|
87
87
|
}> & {
|
|
88
88
|
fullscreen?: boolean | undefined;
|
|
89
|
-
} & import("@hanzogui/
|
|
90
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
89
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
90
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
91
91
|
accept: {
|
|
92
92
|
readonly contentContainerStyle: "style";
|
|
93
93
|
};
|
|
94
94
|
}>> | undefined;
|
|
95
|
-
}>> & import("@hanzogui/
|
|
96
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
95
|
+
}>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
96
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
97
97
|
accept: {
|
|
98
98
|
readonly contentContainerStyle: "style";
|
|
99
99
|
};
|
|
100
100
|
}>> | undefined;
|
|
101
101
|
}> & {
|
|
102
102
|
fullscreen?: boolean | undefined;
|
|
103
|
-
} & import("@hanzogui/
|
|
104
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
103
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
104
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
105
105
|
accept: {
|
|
106
106
|
readonly contentContainerStyle: "style";
|
|
107
107
|
};
|
|
108
108
|
}>> | undefined;
|
|
109
|
-
}>>> & import("@hanzogui/
|
|
110
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
109
|
+
}>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
|
|
110
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
111
111
|
accept: {
|
|
112
112
|
readonly contentContainerStyle: "style";
|
|
113
113
|
};
|
|
@@ -116,9 +116,9 @@ export declare const Sheet: import("react").ForwardRefExoticComponent<{
|
|
|
116
116
|
fullscreen?: boolean | undefined;
|
|
117
117
|
}>> & import("react").RefAttributes<import("react-native").ScrollView>>;
|
|
118
118
|
};
|
|
119
|
-
Frame: import("react").ForwardRefExoticComponent<import("./types").SheetScopedProps<Omit<import("@hanzogui/
|
|
119
|
+
Frame: import("react").ForwardRefExoticComponent<import("./types").SheetScopedProps<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
120
120
|
unstyled?: boolean | undefined;
|
|
121
|
-
elevation?: number | import("@hanzogui/
|
|
121
|
+
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
122
122
|
fullscreen?: boolean | undefined;
|
|
123
123
|
}>, keyof {
|
|
124
124
|
disableHideBottomOverflow?: boolean;
|
|
@@ -127,52 +127,52 @@ export declare const Sheet: import("react").ForwardRefExoticComponent<{
|
|
|
127
127
|
disableHideBottomOverflow?: boolean;
|
|
128
128
|
adjustPaddingForOffscreenContent?: boolean;
|
|
129
129
|
}>>;
|
|
130
|
-
Overlay: import("@hanzogui/
|
|
130
|
+
Overlay: import("@hanzogui/web").GuiComponent<Omit<import("@hanzogui/web").StackNonStyleProps & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase, {}>> & {
|
|
131
131
|
open?: boolean;
|
|
132
132
|
}, "__scopeSheet"> & {
|
|
133
133
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
134
134
|
}, any, any, any, {
|
|
135
135
|
open?: boolean;
|
|
136
|
-
}, {}> | import("@hanzogui/
|
|
136
|
+
}, {}> | import("@hanzogui/web").GuiComponent<Omit<import("@hanzogui/web").StackNonStyleProps & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase> & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase, {}>> & {
|
|
137
137
|
open?: boolean;
|
|
138
138
|
}, "__scopeSheet"> & {
|
|
139
139
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
140
140
|
}, any, {
|
|
141
141
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
142
142
|
}, {}, {}, {}>;
|
|
143
|
-
Handle: import("@hanzogui/
|
|
143
|
+
Handle: import("@hanzogui/web").GuiComponent<any, any, any, any, {
|
|
144
144
|
open?: boolean;
|
|
145
|
-
}, {}> | import("@hanzogui/
|
|
146
|
-
ScrollView: import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/
|
|
147
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
145
|
+
}, {}> | import("@hanzogui/web").GuiComponent<any, any, any, {}, {}, {}>;
|
|
146
|
+
ScrollView: import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/web").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@hanzogui/web").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
147
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
148
148
|
accept: {
|
|
149
149
|
readonly contentContainerStyle: "style";
|
|
150
150
|
};
|
|
151
151
|
}>> | undefined;
|
|
152
152
|
}> & {
|
|
153
153
|
fullscreen?: boolean | undefined;
|
|
154
|
-
} & import("@hanzogui/
|
|
155
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
154
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
155
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
156
156
|
accept: {
|
|
157
157
|
readonly contentContainerStyle: "style";
|
|
158
158
|
};
|
|
159
159
|
}>> | undefined;
|
|
160
|
-
}>> & import("@hanzogui/
|
|
161
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
160
|
+
}>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
161
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
162
162
|
accept: {
|
|
163
163
|
readonly contentContainerStyle: "style";
|
|
164
164
|
};
|
|
165
165
|
}>> | undefined;
|
|
166
166
|
}> & {
|
|
167
167
|
fullscreen?: boolean | undefined;
|
|
168
|
-
} & import("@hanzogui/
|
|
169
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
168
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
169
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
170
170
|
accept: {
|
|
171
171
|
readonly contentContainerStyle: "style";
|
|
172
172
|
};
|
|
173
173
|
}>> | undefined;
|
|
174
|
-
}>>> & import("@hanzogui/
|
|
175
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
174
|
+
}>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
|
|
175
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
176
176
|
accept: {
|
|
177
177
|
readonly contentContainerStyle: "style";
|
|
178
178
|
};
|
package/types/Sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../src/Sheet.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,cAAc,SAAS,CAAA;AAMvB,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../src/Sheet.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,cAAc,SAAS,CAAA;AAMvB,eAAO,MAAM,MAAM;;;;;8CAmCjB,CAAA;AAMF,eAAO,MAAM,OAAO;;;;;8CA2BlB,CAAA;AAMF,eAAO,MAAM,KAAK;;;;8CAoBhB,CAAA;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhB,CAAA"}
|
|
@@ -15,12 +15,12 @@ export declare const SheetImplementationCustom: React.ForwardRefExoticComponent<
|
|
|
15
15
|
dismissOnSnapToBottom?: boolean;
|
|
16
16
|
disableRemoveScroll?: boolean;
|
|
17
17
|
forceRemoveScrollEnabled?: boolean;
|
|
18
|
-
transitionConfig?: import("@hanzogui/
|
|
18
|
+
transitionConfig?: import("@hanzogui/web").AnimatedNumberStrategy;
|
|
19
19
|
preferAdaptParentOpenState?: boolean;
|
|
20
20
|
unmountChildrenWhenHidden?: boolean;
|
|
21
21
|
disableTransparencyHide?: boolean;
|
|
22
22
|
native?: "ios"[] | boolean;
|
|
23
|
-
transition?: import("@hanzogui/
|
|
23
|
+
transition?: import("@hanzogui/web").TransitionProp;
|
|
24
24
|
handleDisableScroll?: boolean;
|
|
25
25
|
disableDrag?: boolean;
|
|
26
26
|
modal?: boolean;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ScrollView as RNScrollView } from 'react-native';
|
|
3
|
-
export declare const SheetScrollView: React.ForwardRefExoticComponent<Omit<import("@hanzogui/
|
|
4
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
3
|
+
export declare const SheetScrollView: React.ForwardRefExoticComponent<Omit<import("@hanzogui/web").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@hanzogui/web").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
4
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof RNScrollView, {
|
|
5
5
|
accept: {
|
|
6
6
|
readonly contentContainerStyle: "style";
|
|
7
7
|
};
|
|
8
8
|
}>> | undefined;
|
|
9
9
|
}> & {
|
|
10
10
|
fullscreen?: boolean | undefined;
|
|
11
|
-
} & import("@hanzogui/
|
|
12
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
11
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
12
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof RNScrollView, {
|
|
13
13
|
accept: {
|
|
14
14
|
readonly contentContainerStyle: "style";
|
|
15
15
|
};
|
|
16
16
|
}>> | undefined;
|
|
17
|
-
}>> & import("@hanzogui/
|
|
18
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
17
|
+
}>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
18
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof RNScrollView, {
|
|
19
19
|
accept: {
|
|
20
20
|
readonly contentContainerStyle: "style";
|
|
21
21
|
};
|
|
22
22
|
}>> | undefined;
|
|
23
23
|
}> & {
|
|
24
24
|
fullscreen?: boolean | undefined;
|
|
25
|
-
} & import("@hanzogui/
|
|
26
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
25
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
26
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof RNScrollView, {
|
|
27
27
|
accept: {
|
|
28
28
|
readonly contentContainerStyle: "style";
|
|
29
29
|
};
|
|
30
30
|
}>> | undefined;
|
|
31
|
-
}>>> & import("@hanzogui/
|
|
32
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
31
|
+
}>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
|
|
32
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof RNScrollView, {
|
|
33
33
|
accept: {
|
|
34
34
|
readonly contentContainerStyle: "style";
|
|
35
35
|
};
|
package/types/createSheet.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ export declare function createSheet<H extends GuiComponent | SheetStyledComponen
|
|
|
25
25
|
dismissOnSnapToBottom?: boolean;
|
|
26
26
|
disableRemoveScroll?: boolean;
|
|
27
27
|
forceRemoveScrollEnabled?: boolean;
|
|
28
|
-
transitionConfig?: import("@hanzogui/
|
|
28
|
+
transitionConfig?: import("@hanzogui/web").AnimatedNumberStrategy;
|
|
29
29
|
preferAdaptParentOpenState?: boolean;
|
|
30
30
|
unmountChildrenWhenHidden?: boolean;
|
|
31
31
|
disableTransparencyHide?: boolean;
|
|
32
32
|
native?: "ios"[] | boolean;
|
|
33
|
-
transition?: import("@hanzogui/
|
|
33
|
+
transition?: import("@hanzogui/web").TransitionProp;
|
|
34
34
|
handleDisableScroll?: boolean;
|
|
35
35
|
disableDrag?: boolean;
|
|
36
36
|
modal?: boolean;
|
|
@@ -80,36 +80,36 @@ export declare function createSheet<H extends GuiComponent | SheetStyledComponen
|
|
|
80
80
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
81
81
|
}, {}, {}, {}>;
|
|
82
82
|
Handle: GuiComponent<any, any, any, any, SharedSheetProps, {}> | GuiComponent<any, any, any, {}, {}, {}>;
|
|
83
|
-
ScrollView: ForwardRefExoticComponent<Omit<import("@hanzogui/
|
|
84
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
83
|
+
ScrollView: ForwardRefExoticComponent<Omit<import("@hanzogui/web").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@hanzogui/web").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
84
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
85
85
|
accept: {
|
|
86
86
|
readonly contentContainerStyle: "style";
|
|
87
87
|
};
|
|
88
88
|
}>> | undefined;
|
|
89
89
|
}> & {
|
|
90
90
|
fullscreen?: boolean | undefined;
|
|
91
|
-
} & import("@hanzogui/
|
|
92
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
91
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
92
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
93
93
|
accept: {
|
|
94
94
|
readonly contentContainerStyle: "style";
|
|
95
95
|
};
|
|
96
96
|
}>> | undefined;
|
|
97
|
-
}>> & import("@hanzogui/
|
|
98
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
97
|
+
}>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
98
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
99
99
|
accept: {
|
|
100
100
|
readonly contentContainerStyle: "style";
|
|
101
101
|
};
|
|
102
102
|
}>> | undefined;
|
|
103
103
|
}> & {
|
|
104
104
|
fullscreen?: boolean | undefined;
|
|
105
|
-
} & import("@hanzogui/
|
|
106
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
105
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
106
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
107
107
|
accept: {
|
|
108
108
|
readonly contentContainerStyle: "style";
|
|
109
109
|
};
|
|
110
110
|
}>> | undefined;
|
|
111
|
-
}>>> & import("@hanzogui/
|
|
112
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
111
|
+
}>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
|
|
112
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
113
113
|
accept: {
|
|
114
114
|
readonly contentContainerStyle: "style";
|
|
115
115
|
};
|
|
@@ -153,36 +153,36 @@ export declare function createSheet<H extends GuiComponent | SheetStyledComponen
|
|
|
153
153
|
__scopeSheet?: import("@hanzogui/create-context").Scope<any>;
|
|
154
154
|
}, {}, {}, {}>;
|
|
155
155
|
Handle: GuiComponent<any, any, any, any, SharedSheetProps, {}> | GuiComponent<any, any, any, {}, {}, {}>;
|
|
156
|
-
ScrollView: ForwardRefExoticComponent<Omit<import("@hanzogui/
|
|
157
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
156
|
+
ScrollView: ForwardRefExoticComponent<Omit<import("@hanzogui/web").GuiComponentPropsBaseBase & import("react-native").ScrollViewProps, keyof import("@hanzogui/web").StackStyleBase | "fullscreen" | "contentContainerStyle"> & import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
157
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
158
158
|
accept: {
|
|
159
159
|
readonly contentContainerStyle: "style";
|
|
160
160
|
};
|
|
161
161
|
}>> | undefined;
|
|
162
162
|
}> & {
|
|
163
163
|
fullscreen?: boolean | undefined;
|
|
164
|
-
} & import("@hanzogui/
|
|
165
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
164
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
165
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
166
166
|
accept: {
|
|
167
167
|
readonly contentContainerStyle: "style";
|
|
168
168
|
};
|
|
169
169
|
}>> | undefined;
|
|
170
|
-
}>> & import("@hanzogui/
|
|
171
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
170
|
+
}>> & import("@hanzogui/web").WithPseudoProps<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
171
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
172
172
|
accept: {
|
|
173
173
|
readonly contentContainerStyle: "style";
|
|
174
174
|
};
|
|
175
175
|
}>> | undefined;
|
|
176
176
|
}> & {
|
|
177
177
|
fullscreen?: boolean | undefined;
|
|
178
|
-
} & import("@hanzogui/
|
|
179
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
178
|
+
} & import("@hanzogui/web").WithShorthands<import("@hanzogui/web").WithThemeValues<import("@hanzogui/web").StackStyleBase & {
|
|
179
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
180
180
|
accept: {
|
|
181
181
|
readonly contentContainerStyle: "style";
|
|
182
182
|
};
|
|
183
183
|
}>> | undefined;
|
|
184
|
-
}>>> & import("@hanzogui/
|
|
185
|
-
readonly contentContainerStyle?: Partial<import("@hanzogui/
|
|
184
|
+
}>>> & import("@hanzogui/web").WithMediaProps<import("@hanzogui/web").WithThemeShorthandsAndPseudos<import("@hanzogui/web").StackStyleBase & {
|
|
185
|
+
readonly contentContainerStyle?: Partial<import("@hanzogui/web").InferStyleProps<typeof import("react-native").ScrollView, {
|
|
186
186
|
accept: {
|
|
187
187
|
readonly contentContainerStyle: "style";
|
|
188
188
|
};
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,269 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, test } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getKeyboardAdjustedSheetY,
|
|
5
|
-
getKeyboardOccludedHeight,
|
|
6
|
-
getSheetReleasePosition,
|
|
7
|
-
} from '../src/keyboardAvoidance'
|
|
8
|
-
import {
|
|
9
|
-
getWebKeyboardBottomInset,
|
|
10
|
-
getWebKeyboardResizeHeight,
|
|
11
|
-
getWebVisualViewportOffsetTop,
|
|
12
|
-
} from '../src/webViewport'
|
|
13
|
-
|
|
14
|
-
const originalWindow = globalThis.window
|
|
15
|
-
const originalDocument = globalThis.document
|
|
16
|
-
|
|
17
|
-
function setWebViewport({
|
|
18
|
-
clientHeight,
|
|
19
|
-
visualViewportHeight,
|
|
20
|
-
offsetTop = 0,
|
|
21
|
-
}: {
|
|
22
|
-
clientHeight: number
|
|
23
|
-
visualViewportHeight: number
|
|
24
|
-
offsetTop?: number
|
|
25
|
-
}) {
|
|
26
|
-
Object.defineProperty(globalThis, 'document', {
|
|
27
|
-
configurable: true,
|
|
28
|
-
value: {
|
|
29
|
-
documentElement: {
|
|
30
|
-
clientHeight,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
Object.defineProperty(globalThis, 'window', {
|
|
35
|
-
configurable: true,
|
|
36
|
-
value: {
|
|
37
|
-
innerHeight: clientHeight,
|
|
38
|
-
visualViewport: {
|
|
39
|
-
height: visualViewportHeight,
|
|
40
|
-
offsetTop,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
})
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
afterEach(() => {
|
|
47
|
-
Object.defineProperty(globalThis, 'window', {
|
|
48
|
-
configurable: true,
|
|
49
|
-
value: originalWindow,
|
|
50
|
-
})
|
|
51
|
-
Object.defineProperty(globalThis, 'document', {
|
|
52
|
-
configurable: true,
|
|
53
|
-
value: originalDocument,
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
describe('getKeyboardAdjustedSheetY', () => {
|
|
58
|
-
const base = {
|
|
59
|
-
sheetY: 320,
|
|
60
|
-
screenSize: 844,
|
|
61
|
-
isKeyboardVisible: true,
|
|
62
|
-
keyboardHeight: 300,
|
|
63
|
-
safeAreaTop: 44,
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
test('keeps the original position when translation is disabled', () => {
|
|
67
|
-
expect(
|
|
68
|
-
getKeyboardAdjustedSheetY({
|
|
69
|
-
...base,
|
|
70
|
-
shouldTranslate: false,
|
|
71
|
-
})
|
|
72
|
-
).toBe(base.sheetY)
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
test('shifts sheets up by keyboard height and caps at safe area', () => {
|
|
76
|
-
expect(
|
|
77
|
-
getKeyboardAdjustedSheetY({
|
|
78
|
-
...base,
|
|
79
|
-
shouldTranslate: true,
|
|
80
|
-
})
|
|
81
|
-
).toBe(44)
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
test('keeps a smaller fit sheet at its natural height and moves it with the keyboard', () => {
|
|
85
|
-
expect(
|
|
86
|
-
getKeyboardAdjustedSheetY({
|
|
87
|
-
...base,
|
|
88
|
-
sheetY: 500,
|
|
89
|
-
shouldTranslate: true,
|
|
90
|
-
})
|
|
91
|
-
).toBe(200)
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
test('does not shift hidden keyboard or offscreen close positions', () => {
|
|
95
|
-
expect(
|
|
96
|
-
getKeyboardAdjustedSheetY({
|
|
97
|
-
...base,
|
|
98
|
-
isKeyboardVisible: false,
|
|
99
|
-
shouldTranslate: true,
|
|
100
|
-
})
|
|
101
|
-
).toBe(base.sheetY)
|
|
102
|
-
expect(
|
|
103
|
-
getKeyboardAdjustedSheetY({
|
|
104
|
-
...base,
|
|
105
|
-
sheetY: base.screenSize,
|
|
106
|
-
shouldTranslate: true,
|
|
107
|
-
})
|
|
108
|
-
).toBe(base.screenSize)
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
describe('getKeyboardOccludedHeight', () => {
|
|
113
|
-
const base = {
|
|
114
|
-
frameSize: 700,
|
|
115
|
-
isKeyboardVisible: true,
|
|
116
|
-
keyboardHeight: 300,
|
|
117
|
-
screenSize: 844,
|
|
118
|
-
sheetY: 59,
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
test('returns overflow below the keyboard top after the sheet is clamped', () => {
|
|
122
|
-
expect(getKeyboardOccludedHeight(base)).toBe(215)
|
|
123
|
-
})
|
|
124
|
-
|
|
125
|
-
test('returns zero when the keyboard-adjusted sheet clears the keyboard', () => {
|
|
126
|
-
expect(
|
|
127
|
-
getKeyboardOccludedHeight({
|
|
128
|
-
...base,
|
|
129
|
-
frameSize: 400,
|
|
130
|
-
sheetY: 144,
|
|
131
|
-
})
|
|
132
|
-
).toBe(0)
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
test('ignores hidden keyboard and offscreen sheet positions', () => {
|
|
136
|
-
expect(
|
|
137
|
-
getKeyboardOccludedHeight({
|
|
138
|
-
...base,
|
|
139
|
-
isKeyboardVisible: false,
|
|
140
|
-
})
|
|
141
|
-
).toBe(0)
|
|
142
|
-
expect(
|
|
143
|
-
getKeyboardOccludedHeight({
|
|
144
|
-
...base,
|
|
145
|
-
sheetY: base.screenSize,
|
|
146
|
-
})
|
|
147
|
-
).toBe(0)
|
|
148
|
-
})
|
|
149
|
-
|
|
150
|
-
test('clamps occlusion to the frame height', () => {
|
|
151
|
-
expect(
|
|
152
|
-
getKeyboardOccludedHeight({
|
|
153
|
-
...base,
|
|
154
|
-
frameSize: 120,
|
|
155
|
-
keyboardHeight: 1000,
|
|
156
|
-
sheetY: 0,
|
|
157
|
-
})
|
|
158
|
-
).toBe(120)
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
describe('getSheetReleasePosition', () => {
|
|
163
|
-
// WEB keyboard-fit-dismiss threshold (the 75de9c9694 web keyboard-handoff fix):
|
|
164
|
-
// when the keyboard is up, a fit+dismiss sheet only dismisses after enough
|
|
165
|
-
// ACTUAL travel, ignoring a velocity-projected short drag.
|
|
166
|
-
test('web: keeps a keyboard-fit sheet open when velocity projects a short drag to dismiss', () => {
|
|
167
|
-
expect(
|
|
168
|
-
getSheetReleasePosition({
|
|
169
|
-
positions: [0, 844],
|
|
170
|
-
projectedEnd: 480,
|
|
171
|
-
currentPosition: 150,
|
|
172
|
-
frameSize: 591,
|
|
173
|
-
dismissOnSnapToBottom: true,
|
|
174
|
-
snapPointsMode: 'fit',
|
|
175
|
-
isKeyboardVisible: true,
|
|
176
|
-
isWeb: true,
|
|
177
|
-
})
|
|
178
|
-
).toBe(0)
|
|
179
|
-
})
|
|
180
|
-
|
|
181
|
-
test('web: allows a keyboard-fit sheet to dismiss after enough actual travel', () => {
|
|
182
|
-
expect(
|
|
183
|
-
getSheetReleasePosition({
|
|
184
|
-
positions: [0, 844],
|
|
185
|
-
projectedEnd: 560,
|
|
186
|
-
currentPosition: 225,
|
|
187
|
-
frameSize: 591,
|
|
188
|
-
dismissOnSnapToBottom: true,
|
|
189
|
-
snapPointsMode: 'fit',
|
|
190
|
-
isKeyboardVisible: true,
|
|
191
|
-
isWeb: true,
|
|
192
|
-
})
|
|
193
|
-
).toBe(1)
|
|
194
|
-
})
|
|
195
|
-
|
|
196
|
-
// NATIVE must NOT apply the web threshold — it snaps purely by projected
|
|
197
|
-
// position (the pre-rework v2.1.0 behavior). regression guard: with the
|
|
198
|
-
// threshold leaking into native, this short-projected drag wrongly stayed open
|
|
199
|
-
// (0); native should snap to the nearest point (here: dismiss, index 1).
|
|
200
|
-
test('native: snaps a keyboard-fit sheet by projected position, ignoring the web threshold', () => {
|
|
201
|
-
expect(
|
|
202
|
-
getSheetReleasePosition({
|
|
203
|
-
positions: [0, 844],
|
|
204
|
-
projectedEnd: 480,
|
|
205
|
-
currentPosition: 150,
|
|
206
|
-
frameSize: 591,
|
|
207
|
-
dismissOnSnapToBottom: true,
|
|
208
|
-
snapPointsMode: 'fit',
|
|
209
|
-
isKeyboardVisible: true,
|
|
210
|
-
isWeb: false,
|
|
211
|
-
})
|
|
212
|
-
).toBe(1)
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
test('native: a projected-open drag snaps back open', () => {
|
|
216
|
-
expect(
|
|
217
|
-
getSheetReleasePosition({
|
|
218
|
-
positions: [0, 844],
|
|
219
|
-
projectedEnd: 200,
|
|
220
|
-
currentPosition: 300,
|
|
221
|
-
frameSize: 591,
|
|
222
|
-
dismissOnSnapToBottom: true,
|
|
223
|
-
snapPointsMode: 'fit',
|
|
224
|
-
isKeyboardVisible: true,
|
|
225
|
-
isWeb: false,
|
|
226
|
-
})
|
|
227
|
-
).toBe(0)
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
test('keeps normal multi-snap release behavior outside keyboard-fit dismiss', () => {
|
|
231
|
-
expect(
|
|
232
|
-
getSheetReleasePosition({
|
|
233
|
-
positions: [0, 360, 844],
|
|
234
|
-
projectedEnd: 310,
|
|
235
|
-
currentPosition: 90,
|
|
236
|
-
frameSize: 591,
|
|
237
|
-
dismissOnSnapToBottom: true,
|
|
238
|
-
snapPointsMode: 'percent',
|
|
239
|
-
isKeyboardVisible: true,
|
|
240
|
-
isWeb: true,
|
|
241
|
-
})
|
|
242
|
-
).toBe(1)
|
|
243
|
-
})
|
|
244
|
-
})
|
|
245
|
-
|
|
246
|
-
describe('web viewport keyboard metrics', () => {
|
|
247
|
-
test('separates keyboard resize height from bottom inset when Safari pans the visual viewport', () => {
|
|
248
|
-
setWebViewport({
|
|
249
|
-
clientHeight: 678,
|
|
250
|
-
visualViewportHeight: 452,
|
|
251
|
-
offsetTop: 158,
|
|
252
|
-
})
|
|
253
|
-
|
|
254
|
-
expect(getWebKeyboardResizeHeight()).toBe(226)
|
|
255
|
-
expect(getWebVisualViewportOffsetTop()).toBe(158)
|
|
256
|
-
expect(getWebKeyboardBottomInset()).toBe(68)
|
|
257
|
-
})
|
|
258
|
-
|
|
259
|
-
test('matches resize height and bottom inset when the visual viewport is not panned', () => {
|
|
260
|
-
setWebViewport({
|
|
261
|
-
clientHeight: 678,
|
|
262
|
-
visualViewportHeight: 452,
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
expect(getWebKeyboardResizeHeight()).toBe(226)
|
|
266
|
-
expect(getWebVisualViewportOffsetTop()).toBe(0)
|
|
267
|
-
expect(getWebKeyboardBottomInset()).toBe(226)
|
|
268
|
-
})
|
|
269
|
-
})
|
package/tsconfig.json
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": true,
|
|
5
|
-
"strict": true
|
|
6
|
-
},
|
|
7
|
-
"references": [
|
|
8
|
-
{
|
|
9
|
-
"path": "../../core/animations-react-native"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"path": "../../core/compose-refs"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"path": "../../core/constants"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"path": "../../core/core"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"path": "../../core/create-context"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"path": "../../core/helpers"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../../core/use-constant"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"path": "../../core/use-controllable-state"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"path": "../../core/use-keyboard-visible"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"path": "../animate-presence"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"path": "../portal"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"path": "../remove-scroll"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"path": "../scroll-view"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"path": "../stacks"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"exclude": [
|
|
52
|
-
"types",
|
|
53
|
-
"dist",
|
|
54
|
-
"test",
|
|
55
|
-
"**/__tests__"
|
|
56
|
-
]
|
|
57
|
-
}
|