@tamagui/sheet 1.0.1-beta.100
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/dist/cjs/Drawer.js +284 -0
- package/dist/cjs/Drawer.js.map +7 -0
- package/dist/cjs/Sheet.js +284 -0
- package/dist/cjs/Sheet.js.map +7 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/esm/Drawer.js +264 -0
- package/dist/esm/Drawer.js.map +7 -0
- package/dist/esm/Sheet.js +264 -0
- package/dist/esm/Sheet.js.map +7 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/jsx/Drawer.js +220 -0
- package/dist/jsx/Drawer.js.map +7 -0
- package/dist/jsx/Sheet.js +220 -0
- package/dist/jsx/Sheet.js.map +7 -0
- package/dist/jsx/index.js +2 -0
- package/dist/jsx/index.js.map +7 -0
- package/package.json +42 -0
- package/src/Sheet.tsx +308 -0
- package/src/index.ts +1 -0
- package/types/Drawer.d.ts +184 -0
- package/types/Drawer.d.ts.map +1 -0
- package/types/Sheet.d.ts +184 -0
- package/types/Sheet.d.ts.map +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __export = (target, all) => {
|
|
37
|
+
for (var name in all)
|
|
38
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
+
};
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
45
|
+
}
|
|
46
|
+
return to;
|
|
47
|
+
};
|
|
48
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
49
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
50
|
+
var Drawer_exports = {};
|
|
51
|
+
__export(Drawer_exports, {
|
|
52
|
+
Drawer: () => Drawer,
|
|
53
|
+
DrawerBackdrop: () => DrawerBackdrop,
|
|
54
|
+
DrawerFrame: () => DrawerFrame,
|
|
55
|
+
DrawerHandle: () => DrawerHandle,
|
|
56
|
+
DrawerHandleFrame: () => DrawerHandleFrame,
|
|
57
|
+
createDrawerScope: () => createDrawerScope
|
|
58
|
+
});
|
|
59
|
+
module.exports = __toCommonJS(Drawer_exports);
|
|
60
|
+
var import_core = require("@tamagui/core");
|
|
61
|
+
var import_create_context = require("@tamagui/create-context");
|
|
62
|
+
var import_stacks = require("@tamagui/stacks");
|
|
63
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
64
|
+
var import_react = __toESM(require("react"));
|
|
65
|
+
var import_react_native = require("react-native");
|
|
66
|
+
const DRAWER_NAME = "Drawer";
|
|
67
|
+
const DRAWER_HANDLE_NAME = "DrawerHandle";
|
|
68
|
+
const DrawerHandleFrame = (0, import_core.styled)(import_stacks.XStack, {
|
|
69
|
+
name: DRAWER_HANDLE_NAME,
|
|
70
|
+
height: 10,
|
|
71
|
+
borderRadius: 100,
|
|
72
|
+
backgroundColor: "$background",
|
|
73
|
+
position: "absolute",
|
|
74
|
+
pointerEvents: "auto",
|
|
75
|
+
zIndex: 10,
|
|
76
|
+
y: -18,
|
|
77
|
+
top: 0,
|
|
78
|
+
left: "35%",
|
|
79
|
+
right: "35%",
|
|
80
|
+
opacity: 0.5,
|
|
81
|
+
hoverStyle: {
|
|
82
|
+
opacity: 0.7
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const DrawerHandle = DrawerHandleFrame.extractable((_a) => {
|
|
86
|
+
var _b = _a, { __scopeDrawer } = _b, props = __objRest(_b, ["__scopeDrawer"]);
|
|
87
|
+
const context = useDrawerContext(DRAWER_HANDLE_NAME, __scopeDrawer);
|
|
88
|
+
return /* @__PURE__ */ import_react.default.createElement(DrawerHandleFrame, __spreadValues({
|
|
89
|
+
onPress: () => {
|
|
90
|
+
const nextPos = (context.position + 1) % context.snapPoints.length;
|
|
91
|
+
context.setPosition(nextPos);
|
|
92
|
+
}
|
|
93
|
+
}, props));
|
|
94
|
+
});
|
|
95
|
+
const [createDrawerContext, createDrawerScope] = (0, import_create_context.createContextScope)(DRAWER_NAME);
|
|
96
|
+
const [DrawerProvider, useDrawerContext] = createDrawerContext(DRAWER_NAME, {});
|
|
97
|
+
const DrawerBackdrop = (0, import_core.styled)(import_stacks.YStack, {
|
|
98
|
+
name: "DrawerBackdrop",
|
|
99
|
+
backgroundColor: "$color",
|
|
100
|
+
fullscreen: true,
|
|
101
|
+
opacity: 0.2
|
|
102
|
+
});
|
|
103
|
+
const DrawerFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
104
|
+
name: "DrawerFrame",
|
|
105
|
+
flex: 1,
|
|
106
|
+
backgroundColor: "$background",
|
|
107
|
+
borderTopLeftRadius: "$4",
|
|
108
|
+
borderTopRightRadius: "$4",
|
|
109
|
+
padding: "$4",
|
|
110
|
+
width: "100%"
|
|
111
|
+
});
|
|
112
|
+
const useIsSSR = () => {
|
|
113
|
+
const [val, setVal] = (0, import_react.useState)(import_core.isWeb ? import_core.isSSR : false);
|
|
114
|
+
(0, import_react.useEffect)(() => {
|
|
115
|
+
if (import_core.isWeb && !import_core.isSSR) {
|
|
116
|
+
setVal(false);
|
|
117
|
+
}
|
|
118
|
+
}, []);
|
|
119
|
+
return val;
|
|
120
|
+
};
|
|
121
|
+
const Drawer = (0, import_core.withStaticProperties)((0, import_core.themeable)((0, import_react.forwardRef)((props, ref) => {
|
|
122
|
+
const _a = props, {
|
|
123
|
+
__scopeDrawer,
|
|
124
|
+
snapPoints: snapPointsProp = [80, 10],
|
|
125
|
+
children: childrenProp,
|
|
126
|
+
position: positionProp,
|
|
127
|
+
onChangePosition,
|
|
128
|
+
defaultPosition
|
|
129
|
+
} = _a, rest = __objRest(_a, [
|
|
130
|
+
"__scopeDrawer",
|
|
131
|
+
"snapPoints",
|
|
132
|
+
"children",
|
|
133
|
+
"position",
|
|
134
|
+
"onChangePosition",
|
|
135
|
+
"defaultPosition"
|
|
136
|
+
]);
|
|
137
|
+
const isServerSide = useIsSSR();
|
|
138
|
+
const [position, setPosition] = (0, import_use_controllable_state.useControllableState)({
|
|
139
|
+
prop: positionProp,
|
|
140
|
+
defaultProp: defaultPosition || 0,
|
|
141
|
+
onChange: onChangePosition,
|
|
142
|
+
strategy: "most-recent-wins"
|
|
143
|
+
});
|
|
144
|
+
const [layout, setLayout] = (0, import_react.useState)();
|
|
145
|
+
const positionValue = (0, import_react.useRef)();
|
|
146
|
+
if (!positionValue.current) {
|
|
147
|
+
positionValue.current = new import_react_native.Animated.Value(position);
|
|
148
|
+
}
|
|
149
|
+
const snapPoints = (0, import_react.useMemo)(() => snapPointsProp, [JSON.stringify(snapPointsProp)]);
|
|
150
|
+
if (isServerSide) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
const spring = (0, import_react.useRef)(null);
|
|
154
|
+
function stopSpring() {
|
|
155
|
+
var _a2;
|
|
156
|
+
(_a2 = spring.current) == null ? void 0 : _a2.stop();
|
|
157
|
+
spring.current = null;
|
|
158
|
+
}
|
|
159
|
+
const positions = (0, import_react.useMemo)(() => snapPoints.map((point) => getYForPosition(point, layout)), [layout, snapPoints]);
|
|
160
|
+
const animateTo = (0, import_react.useCallback)((position2) => {
|
|
161
|
+
if (!positionValue.current)
|
|
162
|
+
return;
|
|
163
|
+
const toValue = positions[position2];
|
|
164
|
+
stopSpring();
|
|
165
|
+
spring.current = import_react_native.Animated.spring(positionValue.current, {
|
|
166
|
+
useNativeDriver: !import_core.isWeb,
|
|
167
|
+
toValue
|
|
168
|
+
});
|
|
169
|
+
spring.current.start(({ finished }) => finished && stopSpring());
|
|
170
|
+
}, [positions]);
|
|
171
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
172
|
+
animateTo(position);
|
|
173
|
+
}, [position, animateTo]);
|
|
174
|
+
const panResponder = (0, import_react.useMemo)(() => {
|
|
175
|
+
if (!layout)
|
|
176
|
+
return;
|
|
177
|
+
console.log("setup pan");
|
|
178
|
+
const pos = positionValue.current;
|
|
179
|
+
const minY = positions[0];
|
|
180
|
+
let startY = pos["_value"];
|
|
181
|
+
return import_react_native.PanResponder.create({
|
|
182
|
+
onMoveShouldSetPanResponder: (_e, { dy }) => {
|
|
183
|
+
return Math.abs(dy) > 6;
|
|
184
|
+
},
|
|
185
|
+
onPanResponderGrant: () => {
|
|
186
|
+
stopSpring();
|
|
187
|
+
startY = pos["_value"];
|
|
188
|
+
},
|
|
189
|
+
onPanResponderMove: (_e, { dy }) => {
|
|
190
|
+
const to = dy + startY;
|
|
191
|
+
pos.setValue(resisted(to, minY));
|
|
192
|
+
},
|
|
193
|
+
onPanResponderRelease: (_e, { vy, dy }) => {
|
|
194
|
+
const at = dy + startY;
|
|
195
|
+
const end = at + layout.height * vy * 0.33;
|
|
196
|
+
let closestPoint = 0;
|
|
197
|
+
let dist = Infinity;
|
|
198
|
+
for (let i = 0; i < positions.length; i++) {
|
|
199
|
+
const position2 = positions[i];
|
|
200
|
+
const curDist = end > position2 ? end - position2 : position2 - end;
|
|
201
|
+
if (curDist < dist) {
|
|
202
|
+
dist = curDist;
|
|
203
|
+
closestPoint = i;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
setPosition(closestPoint);
|
|
207
|
+
animateTo(closestPoint);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}, [layout, positions, setPosition]);
|
|
211
|
+
let handleComponent = null;
|
|
212
|
+
let backdropComponent = null;
|
|
213
|
+
let frameComponent = null;
|
|
214
|
+
import_react.default.Children.forEach(childrenProp, (child) => {
|
|
215
|
+
var _a2;
|
|
216
|
+
if ((0, import_react.isValidElement)(child)) {
|
|
217
|
+
switch ((_a2 = child.type) == null ? void 0 : _a2["staticConfig"].componentName) {
|
|
218
|
+
case "DrawerHandle":
|
|
219
|
+
handleComponent = child;
|
|
220
|
+
break;
|
|
221
|
+
case "DrawerFrame":
|
|
222
|
+
frameComponent = child;
|
|
223
|
+
break;
|
|
224
|
+
case "DrawerBackdrop":
|
|
225
|
+
backdropComponent = child;
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
console.warn("Warning: passed invalid child to Drawer", child);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
return /* @__PURE__ */ import_react.default.createElement(DrawerProvider, {
|
|
233
|
+
scope: __scopeDrawer,
|
|
234
|
+
position,
|
|
235
|
+
snapPoints,
|
|
236
|
+
setPosition
|
|
237
|
+
}, backdropComponent, handleComponent, /* @__PURE__ */ import_react.default.createElement(import_react_native.Animated.View, __spreadProps(__spreadValues({}, panResponder == null ? void 0 : panResponder.panHandlers), {
|
|
238
|
+
onLayout: (e) => {
|
|
239
|
+
setLayout(e.nativeEvent.layout);
|
|
240
|
+
},
|
|
241
|
+
style: {
|
|
242
|
+
width: "100%",
|
|
243
|
+
height: "100%",
|
|
244
|
+
transform: [{ translateY: positionValue.current }]
|
|
245
|
+
}
|
|
246
|
+
}), frameComponent));
|
|
247
|
+
}), {
|
|
248
|
+
componentName: "Drawer"
|
|
249
|
+
}), {
|
|
250
|
+
Handle: DrawerHandle,
|
|
251
|
+
Frame: DrawerFrame,
|
|
252
|
+
Backdrop: DrawerBackdrop
|
|
253
|
+
});
|
|
254
|
+
function getYForPosition(point, layout) {
|
|
255
|
+
if (!layout)
|
|
256
|
+
return 0;
|
|
257
|
+
if (point === void 0) {
|
|
258
|
+
console.warn(`No snapPoint`);
|
|
259
|
+
return 0;
|
|
260
|
+
}
|
|
261
|
+
const pct = point / 100;
|
|
262
|
+
const next = layout.height - pct * layout.height;
|
|
263
|
+
return next;
|
|
264
|
+
}
|
|
265
|
+
function resisted(y, minY, maxOverflow = 25) {
|
|
266
|
+
if (y < minY) {
|
|
267
|
+
const past = minY - y;
|
|
268
|
+
const pctPast = Math.min(maxOverflow, past) / maxOverflow;
|
|
269
|
+
const diminishBy = 1.1 - Math.pow(0.1, pctPast);
|
|
270
|
+
const extra = -diminishBy * maxOverflow;
|
|
271
|
+
return minY + extra;
|
|
272
|
+
}
|
|
273
|
+
return y;
|
|
274
|
+
}
|
|
275
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
276
|
+
0 && (module.exports = {
|
|
277
|
+
Drawer,
|
|
278
|
+
DrawerBackdrop,
|
|
279
|
+
DrawerFrame,
|
|
280
|
+
DrawerHandle,
|
|
281
|
+
DrawerHandleFrame,
|
|
282
|
+
createDrawerScope
|
|
283
|
+
});
|
|
284
|
+
//# sourceMappingURL=Drawer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Drawer.tsx"],
|
|
4
|
+
"sourcesContent": ["import { isSSR, isWeb, styled, themeable, withStaticProperties } from '@tamagui/core'\nimport { ScopedProps, createContextScope } from '@tamagui/create-context'\nimport { XStack, XStackProps, YStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport React, {\n ReactNode,\n forwardRef,\n isValidElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Animated, LayoutRectangle, PanResponder, View } from 'react-native'\n\ntype PositionChangeHandler =\n | ((position: number) => void)\n | React.Dispatch<React.SetStateAction<number>>\n\nconst DRAWER_NAME = 'Drawer'\nconst DRAWER_HANDLE_NAME = 'DrawerHandle'\n\nexport const DrawerHandleFrame = styled(XStack, {\n name: DRAWER_HANDLE_NAME,\n height: 10,\n borderRadius: 100,\n backgroundColor: '$background',\n position: 'absolute',\n pointerEvents: 'auto',\n zIndex: 10,\n y: -18,\n top: 0,\n left: '35%',\n right: '35%',\n opacity: 0.5,\n\n hoverStyle: {\n opacity: 0.7,\n },\n})\n\nexport const DrawerHandle = DrawerHandleFrame.extractable(\n ({ __scopeDrawer, ...props }: ScopedProps<XStackProps, 'Drawer'>) => {\n const context = useDrawerContext(DRAWER_HANDLE_NAME, __scopeDrawer)\n\n return (\n <DrawerHandleFrame\n onPress={() => {\n const nextPos = (context.position + 1) % context.snapPoints.length\n context.setPosition(nextPos)\n }}\n {...props}\n />\n )\n }\n)\n\ntype DrawerContextValue = {\n position: number\n snapPoints: number[]\n setPosition: React.Dispatch<React.SetStateAction<number>>\n}\n\nconst [createDrawerContext, createDrawerScope] = createContextScope(DRAWER_NAME)\nconst [DrawerProvider, useDrawerContext] = createDrawerContext<DrawerContextValue>(\n DRAWER_NAME,\n {} as any\n)\n\nexport const DrawerBackdrop = styled(YStack, {\n name: 'DrawerBackdrop',\n backgroundColor: '$color',\n fullscreen: true,\n opacity: 0.2,\n})\n\nexport const DrawerFrame = styled(YStack, {\n name: 'DrawerFrame',\n flex: 1,\n backgroundColor: '$background',\n borderTopLeftRadius: '$4',\n borderTopRightRadius: '$4',\n padding: '$4',\n width: '100%',\n})\n\nexport type DrawerProps = ScopedProps<\n {\n open?: boolean\n defaultOpen?: boolean\n defaultPosition?: number\n snapPoints?: number[]\n position?: number\n onChangePosition?: PositionChangeHandler\n children?: ReactNode\n },\n 'Drawer'\n>\n\nconst useIsSSR = () => {\n const [val, setVal] = useState(isWeb ? isSSR : false)\n useEffect(() => {\n if (isWeb && !isSSR) {\n setVal(false)\n }\n }, [])\n return val\n}\n\nexport const Drawer = withStaticProperties(\n themeable(\n forwardRef<View, DrawerProps>((props, ref) => {\n const {\n __scopeDrawer,\n snapPoints: snapPointsProp = [80, 10],\n children: childrenProp,\n position: positionProp,\n onChangePosition,\n defaultPosition,\n ...rest\n } = props\n const isServerSide = useIsSSR()\n\n const [position, setPosition] = useControllableState({\n prop: positionProp,\n defaultProp: defaultPosition || 0,\n onChange: onChangePosition,\n strategy: 'most-recent-wins',\n })\n\n const [layout, setLayout] = useState<LayoutRectangle>()\n\n const positionValue = useRef<Animated.Value>()\n if (!positionValue.current) {\n positionValue.current = new Animated.Value(position)\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const snapPoints = useMemo(() => snapPointsProp, [JSON.stringify(snapPointsProp)])\n\n // we can put non-server side hooks after conditional because based on env\n if (isServerSide) {\n return null\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const spring = useRef<Animated.CompositeAnimation | null>(null)\n\n function stopSpring() {\n spring.current?.stop()\n spring.current = null\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const positions = useMemo(\n () => snapPoints.map((point) => getYForPosition(point, layout)),\n [layout, snapPoints]\n )\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const animateTo = useCallback(\n (position: number) => {\n if (!positionValue.current) return\n const toValue = positions[position]\n stopSpring()\n spring.current = Animated.spring(positionValue.current, {\n useNativeDriver: !isWeb,\n toValue,\n })\n spring.current.start(({ finished }) => finished && stopSpring())\n },\n [positions]\n )\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n animateTo(position)\n }, [position, animateTo])\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const panResponder = useMemo(() => {\n if (!layout) return\n console.log('setup pan')\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const pos = positionValue.current!\n const minY = positions[0]\n let startY = pos['_value']\n\n return PanResponder.create({\n onMoveShouldSetPanResponder: (_e, { dy }) => {\n // we could do some detection of other touchables and cancel here..\n // console.log('wut is', _e)\n return Math.abs(dy) > 6\n },\n onPanResponderGrant: () => {\n stopSpring()\n startY = pos['_value']\n },\n onPanResponderMove: (_e, { dy }) => {\n const to = dy + startY\n pos.setValue(resisted(to, minY))\n },\n onPanResponderRelease: (_e, { vy, dy }) => {\n const at = dy + startY\n // seems liky vy goes up to about 4 at the very most (+ is down, - is up)\n // lets base our multiplier on the total layout height\n const end = at + layout.height * vy * 0.33\n let closestPoint = 0\n let dist = Infinity\n for (let i = 0; i < positions.length; i++) {\n const position = positions[i]\n const curDist = end > position ? end - position : position - end\n if (curDist < dist) {\n dist = curDist\n closestPoint = i\n }\n }\n // have to call both because state may not change but need to snap back\n setPosition(closestPoint)\n animateTo(closestPoint)\n },\n })\n }, [layout, positions, setPosition])\n\n let handleComponent: React.ReactElement | null = null\n let backdropComponent: React.ReactElement | null = null\n let frameComponent: React.ReactElement | null = null\n\n React.Children.forEach(childrenProp, (child) => {\n if (isValidElement(child)) {\n switch (child.type?.['staticConfig'].componentName) {\n case 'DrawerHandle':\n handleComponent = child\n break\n case 'DrawerFrame':\n frameComponent = child\n break\n case 'DrawerBackdrop':\n backdropComponent = child\n break\n default:\n console.warn('Warning: passed invalid child to Drawer', child)\n }\n }\n })\n\n return (\n <DrawerProvider\n scope={__scopeDrawer}\n position={position}\n snapPoints={snapPoints}\n setPosition={setPosition}\n >\n {backdropComponent}\n {handleComponent}\n <Animated.View\n {...panResponder?.panHandlers}\n onLayout={(e) => {\n setLayout(e.nativeEvent.layout)\n }}\n style={{\n width: '100%',\n height: '100%',\n transform: [{ translateY: positionValue.current }],\n }}\n >\n {frameComponent}\n </Animated.View>\n </DrawerProvider>\n )\n }),\n {\n componentName: 'Drawer',\n }\n ),\n {\n Handle: DrawerHandle,\n Frame: DrawerFrame,\n Backdrop: DrawerBackdrop,\n }\n)\n\nfunction getYForPosition(point?: number, layout?: LayoutRectangle) {\n if (!layout) return 0\n if (point === undefined) {\n console.warn(`No snapPoint`)\n return 0\n }\n const pct = point / 100\n const next = layout.height - pct * layout.height\n return next\n}\n\nfunction resisted(y: number, minY: number, maxOverflow = 25) {\n if (y < minY) {\n const past = minY - y\n const pctPast = Math.min(maxOverflow, past) / maxOverflow\n const diminishBy = 1.1 - Math.pow(0.1, pctPast)\n const extra = -diminishBy * maxOverflow\n return minY + extra\n }\n return y\n}\n\nex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AC9C,UAAM,aAAa,MAAM,KAAK,IAAI,KAAK,OAAO;AAC9C,UAAM,QAAQ,CAAC,aAAa;AAC5B,WAAO,OAAO;AAAA,EAChB;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __objRest = (source, exclude) => {
|
|
25
|
+
var target = {};
|
|
26
|
+
for (var prop in source)
|
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
+
target[prop] = source[prop];
|
|
33
|
+
}
|
|
34
|
+
return target;
|
|
35
|
+
};
|
|
36
|
+
var __export = (target, all) => {
|
|
37
|
+
for (var name in all)
|
|
38
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
39
|
+
};
|
|
40
|
+
var __copyProps = (to, from, except, desc) => {
|
|
41
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
42
|
+
for (let key of __getOwnPropNames(from))
|
|
43
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
44
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
45
|
+
}
|
|
46
|
+
return to;
|
|
47
|
+
};
|
|
48
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
49
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
50
|
+
var Sheet_exports = {};
|
|
51
|
+
__export(Sheet_exports, {
|
|
52
|
+
Drawer: () => Drawer,
|
|
53
|
+
DrawerBackdrop: () => DrawerBackdrop,
|
|
54
|
+
DrawerFrame: () => DrawerFrame,
|
|
55
|
+
DrawerHandle: () => DrawerHandle,
|
|
56
|
+
DrawerHandleFrame: () => DrawerHandleFrame,
|
|
57
|
+
createDrawerScope: () => createDrawerScope
|
|
58
|
+
});
|
|
59
|
+
module.exports = __toCommonJS(Sheet_exports);
|
|
60
|
+
var import_core = require("@tamagui/core");
|
|
61
|
+
var import_create_context = require("@tamagui/create-context");
|
|
62
|
+
var import_stacks = require("@tamagui/stacks");
|
|
63
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state");
|
|
64
|
+
var import_react = __toESM(require("react"));
|
|
65
|
+
var import_react_native = require("react-native");
|
|
66
|
+
const DRAWER_NAME = "Drawer";
|
|
67
|
+
const DRAWER_HANDLE_NAME = "DrawerHandle";
|
|
68
|
+
const DrawerHandleFrame = (0, import_core.styled)(import_stacks.XStack, {
|
|
69
|
+
name: DRAWER_HANDLE_NAME,
|
|
70
|
+
height: 10,
|
|
71
|
+
borderRadius: 100,
|
|
72
|
+
backgroundColor: "$background",
|
|
73
|
+
position: "absolute",
|
|
74
|
+
pointerEvents: "auto",
|
|
75
|
+
zIndex: 10,
|
|
76
|
+
y: -18,
|
|
77
|
+
top: 0,
|
|
78
|
+
left: "35%",
|
|
79
|
+
right: "35%",
|
|
80
|
+
opacity: 0.5,
|
|
81
|
+
hoverStyle: {
|
|
82
|
+
opacity: 0.7
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const DrawerHandle = DrawerHandleFrame.extractable((_a) => {
|
|
86
|
+
var _b = _a, { __scopeDrawer } = _b, props = __objRest(_b, ["__scopeDrawer"]);
|
|
87
|
+
const context = useDrawerContext(DRAWER_HANDLE_NAME, __scopeDrawer);
|
|
88
|
+
return /* @__PURE__ */ import_react.default.createElement(DrawerHandleFrame, __spreadValues({
|
|
89
|
+
onPress: () => {
|
|
90
|
+
const nextPos = (context.position + 1) % context.snapPoints.length;
|
|
91
|
+
context.setPosition(nextPos);
|
|
92
|
+
}
|
|
93
|
+
}, props));
|
|
94
|
+
});
|
|
95
|
+
const [createDrawerContext, createDrawerScope] = (0, import_create_context.createContextScope)(DRAWER_NAME);
|
|
96
|
+
const [DrawerProvider, useDrawerContext] = createDrawerContext(DRAWER_NAME, {});
|
|
97
|
+
const DrawerBackdrop = (0, import_core.styled)(import_stacks.YStack, {
|
|
98
|
+
name: "DrawerBackdrop",
|
|
99
|
+
backgroundColor: "$color",
|
|
100
|
+
fullscreen: true,
|
|
101
|
+
opacity: 0.2
|
|
102
|
+
});
|
|
103
|
+
const DrawerFrame = (0, import_core.styled)(import_stacks.YStack, {
|
|
104
|
+
name: "DrawerFrame",
|
|
105
|
+
flex: 1,
|
|
106
|
+
backgroundColor: "$background",
|
|
107
|
+
borderTopLeftRadius: "$4",
|
|
108
|
+
borderTopRightRadius: "$4",
|
|
109
|
+
padding: "$4",
|
|
110
|
+
width: "100%"
|
|
111
|
+
});
|
|
112
|
+
const useIsSSR = () => {
|
|
113
|
+
const [val, setVal] = (0, import_react.useState)(import_core.isWeb ? import_core.isSSR : false);
|
|
114
|
+
(0, import_react.useEffect)(() => {
|
|
115
|
+
if (import_core.isWeb && !import_core.isSSR) {
|
|
116
|
+
setVal(false);
|
|
117
|
+
}
|
|
118
|
+
}, []);
|
|
119
|
+
return val;
|
|
120
|
+
};
|
|
121
|
+
const Drawer = (0, import_core.withStaticProperties)((0, import_core.themeable)((0, import_react.forwardRef)((props, ref) => {
|
|
122
|
+
const _a = props, {
|
|
123
|
+
__scopeDrawer,
|
|
124
|
+
snapPoints: snapPointsProp = [80, 10],
|
|
125
|
+
children: childrenProp,
|
|
126
|
+
position: positionProp,
|
|
127
|
+
onChangePosition,
|
|
128
|
+
defaultPosition
|
|
129
|
+
} = _a, rest = __objRest(_a, [
|
|
130
|
+
"__scopeDrawer",
|
|
131
|
+
"snapPoints",
|
|
132
|
+
"children",
|
|
133
|
+
"position",
|
|
134
|
+
"onChangePosition",
|
|
135
|
+
"defaultPosition"
|
|
136
|
+
]);
|
|
137
|
+
const isServerSide = useIsSSR();
|
|
138
|
+
const [position, setPosition] = (0, import_use_controllable_state.useControllableState)({
|
|
139
|
+
prop: positionProp,
|
|
140
|
+
defaultProp: defaultPosition || 0,
|
|
141
|
+
onChange: onChangePosition,
|
|
142
|
+
strategy: "most-recent-wins"
|
|
143
|
+
});
|
|
144
|
+
const [layout, setLayout] = (0, import_react.useState)();
|
|
145
|
+
const positionValue = (0, import_react.useRef)();
|
|
146
|
+
if (!positionValue.current) {
|
|
147
|
+
positionValue.current = new import_react_native.Animated.Value(position);
|
|
148
|
+
}
|
|
149
|
+
const snapPoints = (0, import_react.useMemo)(() => snapPointsProp, [JSON.stringify(snapPointsProp)]);
|
|
150
|
+
if (isServerSide) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
const spring = (0, import_react.useRef)(null);
|
|
154
|
+
function stopSpring() {
|
|
155
|
+
var _a2;
|
|
156
|
+
(_a2 = spring.current) == null ? void 0 : _a2.stop();
|
|
157
|
+
spring.current = null;
|
|
158
|
+
}
|
|
159
|
+
const positions = (0, import_react.useMemo)(() => snapPoints.map((point) => getYForPosition(point, layout)), [layout, snapPoints]);
|
|
160
|
+
const animateTo = (0, import_react.useCallback)((position2) => {
|
|
161
|
+
if (!positionValue.current)
|
|
162
|
+
return;
|
|
163
|
+
const toValue = positions[position2];
|
|
164
|
+
stopSpring();
|
|
165
|
+
spring.current = import_react_native.Animated.spring(positionValue.current, {
|
|
166
|
+
useNativeDriver: !import_core.isWeb,
|
|
167
|
+
toValue
|
|
168
|
+
});
|
|
169
|
+
spring.current.start(({ finished }) => finished && stopSpring());
|
|
170
|
+
}, [positions]);
|
|
171
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
172
|
+
animateTo(position);
|
|
173
|
+
}, [position, animateTo]);
|
|
174
|
+
const panResponder = (0, import_react.useMemo)(() => {
|
|
175
|
+
if (!layout)
|
|
176
|
+
return;
|
|
177
|
+
console.log("setup pan");
|
|
178
|
+
const pos = positionValue.current;
|
|
179
|
+
const minY = positions[0];
|
|
180
|
+
let startY = pos["_value"];
|
|
181
|
+
return import_react_native.PanResponder.create({
|
|
182
|
+
onMoveShouldSetPanResponder: (_e, { dy }) => {
|
|
183
|
+
return Math.abs(dy) > 6;
|
|
184
|
+
},
|
|
185
|
+
onPanResponderGrant: () => {
|
|
186
|
+
stopSpring();
|
|
187
|
+
startY = pos["_value"];
|
|
188
|
+
},
|
|
189
|
+
onPanResponderMove: (_e, { dy }) => {
|
|
190
|
+
const to = dy + startY;
|
|
191
|
+
pos.setValue(resisted(to, minY));
|
|
192
|
+
},
|
|
193
|
+
onPanResponderRelease: (_e, { vy, dy }) => {
|
|
194
|
+
const at = dy + startY;
|
|
195
|
+
const end = at + layout.height * vy * 0.33;
|
|
196
|
+
let closestPoint = 0;
|
|
197
|
+
let dist = Infinity;
|
|
198
|
+
for (let i = 0; i < positions.length; i++) {
|
|
199
|
+
const position2 = positions[i];
|
|
200
|
+
const curDist = end > position2 ? end - position2 : position2 - end;
|
|
201
|
+
if (curDist < dist) {
|
|
202
|
+
dist = curDist;
|
|
203
|
+
closestPoint = i;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
setPosition(closestPoint);
|
|
207
|
+
animateTo(closestPoint);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}, [layout, positions, setPosition]);
|
|
211
|
+
let handleComponent = null;
|
|
212
|
+
let backdropComponent = null;
|
|
213
|
+
let frameComponent = null;
|
|
214
|
+
import_react.default.Children.forEach(childrenProp, (child) => {
|
|
215
|
+
var _a2;
|
|
216
|
+
if ((0, import_react.isValidElement)(child)) {
|
|
217
|
+
switch ((_a2 = child.type) == null ? void 0 : _a2["staticConfig"].componentName) {
|
|
218
|
+
case "DrawerHandle":
|
|
219
|
+
handleComponent = child;
|
|
220
|
+
break;
|
|
221
|
+
case "DrawerFrame":
|
|
222
|
+
frameComponent = child;
|
|
223
|
+
break;
|
|
224
|
+
case "DrawerBackdrop":
|
|
225
|
+
backdropComponent = child;
|
|
226
|
+
break;
|
|
227
|
+
default:
|
|
228
|
+
console.warn("Warning: passed invalid child to Drawer", child);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
return /* @__PURE__ */ import_react.default.createElement(DrawerProvider, {
|
|
233
|
+
scope: __scopeDrawer,
|
|
234
|
+
position,
|
|
235
|
+
snapPoints,
|
|
236
|
+
setPosition
|
|
237
|
+
}, backdropComponent, handleComponent, /* @__PURE__ */ import_react.default.createElement(import_react_native.Animated.View, __spreadProps(__spreadValues({}, panResponder == null ? void 0 : panResponder.panHandlers), {
|
|
238
|
+
onLayout: (e) => {
|
|
239
|
+
setLayout(e.nativeEvent.layout);
|
|
240
|
+
},
|
|
241
|
+
style: {
|
|
242
|
+
width: "100%",
|
|
243
|
+
height: "100%",
|
|
244
|
+
transform: [{ translateY: positionValue.current }]
|
|
245
|
+
}
|
|
246
|
+
}), frameComponent));
|
|
247
|
+
}), {
|
|
248
|
+
componentName: "Drawer"
|
|
249
|
+
}), {
|
|
250
|
+
Handle: DrawerHandle,
|
|
251
|
+
Frame: DrawerFrame,
|
|
252
|
+
Backdrop: DrawerBackdrop
|
|
253
|
+
});
|
|
254
|
+
function getYForPosition(point, layout) {
|
|
255
|
+
if (!layout)
|
|
256
|
+
return 0;
|
|
257
|
+
if (point === void 0) {
|
|
258
|
+
console.warn(`No snapPoint`);
|
|
259
|
+
return 0;
|
|
260
|
+
}
|
|
261
|
+
const pct = point / 100;
|
|
262
|
+
const next = layout.height - pct * layout.height;
|
|
263
|
+
return next;
|
|
264
|
+
}
|
|
265
|
+
function resisted(y, minY, maxOverflow = 25) {
|
|
266
|
+
if (y < minY) {
|
|
267
|
+
const past = minY - y;
|
|
268
|
+
const pctPast = Math.min(maxOverflow, past) / maxOverflow;
|
|
269
|
+
const diminishBy = 1.1 - Math.pow(0.1, pctPast);
|
|
270
|
+
const extra = -diminishBy * maxOverflow;
|
|
271
|
+
return minY + extra;
|
|
272
|
+
}
|
|
273
|
+
return y;
|
|
274
|
+
}
|
|
275
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
276
|
+
0 && (module.exports = {
|
|
277
|
+
Drawer,
|
|
278
|
+
DrawerBackdrop,
|
|
279
|
+
DrawerFrame,
|
|
280
|
+
DrawerHandle,
|
|
281
|
+
DrawerHandleFrame,
|
|
282
|
+
createDrawerScope
|
|
283
|
+
});
|
|
284
|
+
//# sourceMappingURL=Sheet.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Sheet.tsx"],
|
|
4
|
+
"sourcesContent": ["import { isSSR, isWeb, styled, themeable, withStaticProperties } from '@tamagui/core'\nimport { ScopedProps, createContextScope } from '@tamagui/create-context'\nimport { XStack, XStackProps, YStack } from '@tamagui/stacks'\nimport { useControllableState } from '@tamagui/use-controllable-state'\nimport React, {\n ReactNode,\n forwardRef,\n isValidElement,\n useCallback,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { Animated, LayoutRectangle, PanResponder, View } from 'react-native'\n\ntype PositionChangeHandler =\n | ((position: number) => void)\n | React.Dispatch<React.SetStateAction<number>>\n\nconst DRAWER_NAME = 'Drawer'\nconst DRAWER_HANDLE_NAME = 'DrawerHandle'\n\nexport const DrawerHandleFrame = styled(XStack, {\n name: DRAWER_HANDLE_NAME,\n height: 10,\n borderRadius: 100,\n backgroundColor: '$background',\n position: 'absolute',\n pointerEvents: 'auto',\n zIndex: 10,\n y: -18,\n top: 0,\n left: '35%',\n right: '35%',\n opacity: 0.5,\n\n hoverStyle: {\n opacity: 0.7,\n },\n})\n\nexport const DrawerHandle = DrawerHandleFrame.extractable(\n ({ __scopeDrawer, ...props }: ScopedProps<XStackProps, 'Drawer'>) => {\n const context = useDrawerContext(DRAWER_HANDLE_NAME, __scopeDrawer)\n\n return (\n <DrawerHandleFrame\n onPress={() => {\n const nextPos = (context.position + 1) % context.snapPoints.length\n context.setPosition(nextPos)\n }}\n {...props}\n />\n )\n }\n)\n\ntype DrawerContextValue = {\n position: number\n snapPoints: number[]\n setPosition: React.Dispatch<React.SetStateAction<number>>\n}\n\nconst [createDrawerContext, createDrawerScope] = createContextScope(DRAWER_NAME)\nconst [DrawerProvider, useDrawerContext] = createDrawerContext<DrawerContextValue>(\n DRAWER_NAME,\n {} as any\n)\n\nexport const DrawerBackdrop = styled(YStack, {\n name: 'DrawerBackdrop',\n backgroundColor: '$color',\n fullscreen: true,\n opacity: 0.2,\n})\n\nexport const DrawerFrame = styled(YStack, {\n name: 'DrawerFrame',\n flex: 1,\n backgroundColor: '$background',\n borderTopLeftRadius: '$4',\n borderTopRightRadius: '$4',\n padding: '$4',\n width: '100%',\n})\n\nexport type DrawerProps = ScopedProps<\n {\n open?: boolean\n defaultOpen?: boolean\n defaultPosition?: number\n snapPoints?: number[]\n position?: number\n onChangePosition?: PositionChangeHandler\n children?: ReactNode\n },\n 'Drawer'\n>\n\nconst useIsSSR = () => {\n const [val, setVal] = useState(isWeb ? isSSR : false)\n useEffect(() => {\n if (isWeb && !isSSR) {\n setVal(false)\n }\n }, [])\n return val\n}\n\nexport const Drawer = withStaticProperties(\n themeable(\n forwardRef<View, DrawerProps>((props, ref) => {\n const {\n __scopeDrawer,\n snapPoints: snapPointsProp = [80, 10],\n children: childrenProp,\n position: positionProp,\n onChangePosition,\n defaultPosition,\n ...rest\n } = props\n const isServerSide = useIsSSR()\n\n const [position, setPosition] = useControllableState({\n prop: positionProp,\n defaultProp: defaultPosition || 0,\n onChange: onChangePosition,\n strategy: 'most-recent-wins',\n })\n\n const [layout, setLayout] = useState<LayoutRectangle>()\n\n const positionValue = useRef<Animated.Value>()\n if (!positionValue.current) {\n positionValue.current = new Animated.Value(position)\n }\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const snapPoints = useMemo(() => snapPointsProp, [JSON.stringify(snapPointsProp)])\n\n // we can put non-server side hooks after conditional because based on env\n if (isServerSide) {\n return null\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const spring = useRef<Animated.CompositeAnimation | null>(null)\n\n function stopSpring() {\n spring.current?.stop()\n spring.current = null\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const positions = useMemo(\n () => snapPoints.map((point) => getYForPosition(point, layout)),\n [layout, snapPoints]\n )\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const animateTo = useCallback(\n (position: number) => {\n if (!positionValue.current) return\n const toValue = positions[position]\n stopSpring()\n spring.current = Animated.spring(positionValue.current, {\n useNativeDriver: !isWeb,\n toValue,\n })\n spring.current.start(({ finished }) => finished && stopSpring())\n },\n [positions]\n )\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n animateTo(position)\n }, [position, animateTo])\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const panResponder = useMemo(() => {\n if (!layout) return\n console.log('setup pan')\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const pos = positionValue.current!\n const minY = positions[0]\n let startY = pos['_value']\n\n return PanResponder.create({\n onMoveShouldSetPanResponder: (_e, { dy }) => {\n // we could do some detection of other touchables and cancel here..\n // console.log('wut is', _e)\n return Math.abs(dy) > 6\n },\n onPanResponderGrant: () => {\n stopSpring()\n startY = pos['_value']\n },\n onPanResponderMove: (_e, { dy }) => {\n const to = dy + startY\n pos.setValue(resisted(to, minY))\n },\n onPanResponderRelease: (_e, { vy, dy }) => {\n const at = dy + startY\n // seems liky vy goes up to about 4 at the very most (+ is down, - is up)\n // lets base our multiplier on the total layout height\n const end = at + layout.height * vy * 0.33\n let closestPoint = 0\n let dist = Infinity\n for (let i = 0; i < positions.length; i++) {\n const position = positions[i]\n const curDist = end > position ? end - position : position - end\n if (curDist < dist) {\n dist = curDist\n closestPoint = i\n }\n }\n // have to call both because state may not change but need to snap back\n setPosition(closestPoint)\n animateTo(closestPoint)\n },\n })\n }, [layout, positions, setPosition])\n\n let handleComponent: React.ReactElement | null = null\n let backdropComponent: React.ReactElement | null = null\n let frameComponent: React.ReactElement | null = null\n\n React.Children.forEach(childrenProp, (child) => {\n if (isValidElement(child)) {\n switch (child.type?.['staticConfig'].componentName) {\n case 'DrawerHandle':\n handleComponent = child\n break\n case 'DrawerFrame':\n frameComponent = child\n break\n case 'DrawerBackdrop':\n backdropComponent = child\n break\n default:\n console.warn('Warning: passed invalid child to Drawer', child)\n }\n }\n })\n\n return (\n <DrawerProvider\n scope={__scopeDrawer}\n position={position}\n snapPoints={snapPoints}\n setPosition={setPosition}\n >\n {backdropComponent}\n {handleComponent}\n <Animated.View\n {...panResponder?.panHandlers}\n onLayout={(e) => {\n setLayout(e.nativeEvent.layout)\n }}\n style={{\n width: '100%',\n height: '100%',\n transform: [{ translateY: positionValue.current }],\n }}\n >\n {frameComponent}\n </Animated.View>\n </DrawerProvider>\n )\n }),\n {\n componentName: 'Drawer',\n }\n ),\n {\n Handle: DrawerHandle,\n Frame: DrawerFrame,\n Backdrop: DrawerBackdrop,\n }\n)\n\nfunction getYForPosition(point?: number, layout?: LayoutRectangle) {\n if (!layout) return 0\n if (point === undefined) {\n console.warn(`No snapPoint`)\n return 0\n }\n const pct = point / 100\n const next = layout.height - pct * layout.height\n return next\n}\n\nfunction resisted(y: number, minY: number, maxOverflow = 25) {\n if (y < minY) {\n const past = minY - y\n const pctPast = Math.min(maxOverflow, past) / maxOverflow\n const diminishBy = 1.1 - Math.pow(0.1, pctPast)\n const extra = -diminishBy * maxOverflow\n return minY + extra\n }\n return y\n}\n\nexport { createDrawerScope }\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAsE;AACtE,4BAAgD;AAChD,oBAA4C;AAC5C,oCAAqC;AACrC,mBAUO;AACP,0BAA8D;AAM9D,MAAM,cAAc;AACpB,MAAM,qBAAqB;AAEpB,MAAM,oBAAoB,wBAAO,sBAAQ;AAAA,EAC9C,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,UAAU;AAAA,EACV,eAAe;AAAA,EACf,QAAQ;AAAA,EACR,GAAG;AAAA,EACH,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EAET,YAAY;AAAA,IACV,SAAS;AAAA,EACX;AACF,CAAC;AAEM,MAAM,eAAe,kBAAkB,Y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AAAA,IAChC;AAAA,IACA,OAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,WAAW,CAAC,EAAE,YAAY,cAAc,QAAQ,CAAC;AAAA,IACnD;AAAA,MAEC,cACH,CACF;AAEJ,CAAC,GACD;AAAA,EACE,eAAe;AACjB,CACF,GACA;AAAA,EACE,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AACZ,CACF;AAEA,yBAAyB,OAAgB,QAA0B;AACjE,MAAI,CAAC;AAAQ,WAAO;AACpB,MAAI,UAAU,QAAW;AACvB,YAAQ,KAAK,cAAc;AAC3B,WAAO;AAAA,EACT;AACA,QAAM,MAAM,QAAQ;AACpB,QAAM,OAAO,OAAO,SAAS,MAAM,OAAO;AAC1C,SAAO;AACT;AAEA,kBAAkB,GAAW,MAAc,cAAc,IAAI;AAC3D,MAAI,IAAI,MAAM;AACZ,UAAM,OAAO,OAAO;AACpB,UAAM,UAAU,KAAK,IAAI,aAAa,IAAI,IAAI;AAC9C,UAAM,aAAa,MAAM,KAAK,IAAI,KAAK,OAAO;AAC9C,UAAM,QAAQ,CAAC,aAAa;AAC5B,WAAO,OAAO;AAAA,EAChB;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var src_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(src_exports);
|
|
17
|
+
__reExport(src_exports, require("./Sheet"), module.exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|