@tamagui/sheet 1.27.0 → 1.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Sheet.js +1 -2
- package/dist/cjs/Sheet.js.map +1 -1
- package/dist/cjs/SheetContext.js.map +1 -1
- package/dist/cjs/SheetImplementationCustom.js +340 -0
- package/dist/cjs/SheetImplementationCustom.js.map +6 -0
- package/dist/cjs/constants.js +10 -0
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/contexts.js +35 -0
- package/dist/cjs/contexts.js.map +6 -0
- package/dist/cjs/createSheet.js +68 -342
- package/dist/cjs/createSheet.js.map +2 -2
- package/dist/cjs/helpers.js +38 -0
- package/dist/cjs/helpers.js.map +6 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/nativeSheet.js +3 -5
- package/dist/cjs/nativeSheet.js.map +1 -1
- package/dist/cjs/useSheet.js +30 -0
- package/dist/cjs/useSheet.js.map +6 -0
- package/dist/cjs/useSheetChildren.js +4 -2
- package/dist/cjs/useSheetChildren.js.map +1 -1
- package/dist/cjs/useSheetController.js +2 -1
- package/dist/cjs/useSheetController.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.js +30 -3
- package/dist/cjs/useSheetProviderProps.js.map +1 -1
- package/dist/esm/Sheet.js +1 -2
- package/dist/esm/Sheet.js.map +1 -1
- package/dist/esm/SheetContext.js.map +1 -1
- package/dist/esm/SheetImplementationCustom.js +336 -0
- package/dist/esm/SheetImplementationCustom.js.map +6 -0
- package/dist/esm/constants.js +8 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/contexts.js +10 -0
- package/dist/esm/contexts.js.map +6 -0
- package/dist/esm/createSheet.js +72 -364
- package/dist/esm/createSheet.js.map +2 -2
- package/dist/esm/helpers.js +14 -0
- package/dist/esm/helpers.js.map +6 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/nativeSheet.js +3 -5
- package/dist/esm/nativeSheet.js.map +1 -1
- package/dist/esm/useSheet.js +6 -0
- package/dist/esm/useSheet.js.map +6 -0
- package/dist/esm/useSheetChildren.js +4 -2
- package/dist/esm/useSheetChildren.js.map +1 -1
- package/dist/esm/useSheetController.js +2 -1
- package/dist/esm/useSheetController.js.map +1 -1
- package/dist/esm/useSheetProviderProps.js +31 -4
- package/dist/esm/useSheetProviderProps.js.map +1 -1
- package/dist/jsx/Sheet.js +1 -2
- package/dist/jsx/Sheet.js.map +1 -1
- package/dist/jsx/Sheet.mjs +1 -2
- package/dist/jsx/Sheet.mjs.map +1 -1
- package/dist/jsx/SheetContext.js.map +1 -1
- package/dist/jsx/SheetContext.mjs.map +1 -1
- package/dist/jsx/SheetImplementationCustom.js +330 -0
- package/dist/jsx/SheetImplementationCustom.js.map +6 -0
- package/dist/jsx/SheetImplementationCustom.mjs +330 -0
- package/dist/jsx/SheetImplementationCustom.mjs.map +6 -0
- package/dist/jsx/constants.js +8 -0
- package/dist/jsx/constants.js.map +1 -1
- package/dist/jsx/constants.mjs +8 -0
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/contexts.js +10 -0
- package/dist/jsx/contexts.js.map +6 -0
- package/dist/jsx/contexts.mjs +10 -0
- package/dist/jsx/contexts.mjs.map +6 -0
- package/dist/jsx/createSheet.js +63 -354
- package/dist/jsx/createSheet.js.map +2 -2
- package/dist/jsx/createSheet.mjs +63 -354
- package/dist/jsx/createSheet.mjs.map +2 -2
- package/dist/jsx/helpers.js +14 -0
- package/dist/jsx/helpers.js.map +6 -0
- package/dist/jsx/helpers.mjs +14 -0
- package/dist/jsx/helpers.mjs.map +6 -0
- package/dist/jsx/index.js +1 -0
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +1 -0
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/nativeSheet.js +3 -5
- package/dist/jsx/nativeSheet.js.map +1 -1
- package/dist/jsx/nativeSheet.mjs +3 -5
- package/dist/jsx/nativeSheet.mjs.map +1 -1
- package/dist/jsx/useSheet.js +6 -0
- package/dist/jsx/useSheet.js.map +6 -0
- package/dist/jsx/useSheet.mjs +6 -0
- package/dist/jsx/useSheet.mjs.map +6 -0
- package/dist/jsx/useSheetChildren.js +4 -2
- package/dist/jsx/useSheetChildren.js.map +1 -1
- package/dist/jsx/useSheetChildren.mjs +4 -2
- package/dist/jsx/useSheetChildren.mjs.map +1 -1
- package/dist/jsx/useSheetController.js +2 -1
- package/dist/jsx/useSheetController.js.map +1 -1
- package/dist/jsx/useSheetController.mjs +2 -1
- package/dist/jsx/useSheetController.mjs.map +1 -1
- package/dist/jsx/useSheetProviderProps.js +31 -4
- package/dist/jsx/useSheetProviderProps.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.mjs +31 -4
- package/dist/jsx/useSheetProviderProps.mjs.map +1 -1
- package/package.json +13 -13
- package/src/Sheet.tsx +0 -1
- package/src/SheetContext.tsx +1 -16
- package/src/SheetImplementationCustom.tsx +404 -0
- package/src/constants.tsx +10 -0
- package/src/contexts.ts +9 -0
- package/src/createSheet.tsx +88 -441
- package/src/helpers.tsx +10 -0
- package/src/index.ts +1 -0
- package/src/nativeSheet.tsx +3 -5
- package/src/useSheet.tsx +3 -0
- package/src/useSheetController.tsx +1 -0
- package/src/useSheetProviderProps.tsx +48 -7
- package/types/Sheet.d.ts +10 -6
- package/types/Sheet.d.ts.map +1 -1
- package/types/SheetContext.d.ts +100 -27
- package/types/SheetContext.d.ts.map +1 -1
- package/types/SheetImplementationCustom.d.ts +27 -0
- package/types/SheetImplementationCustom.d.ts.map +1 -0
- package/types/constants.d.ts +2 -0
- package/types/constants.d.ts.map +1 -1
- package/types/contexts.d.ts +6 -0
- package/types/contexts.d.ts.map +1 -0
- package/types/createSheet.d.ts +8 -4
- package/types/createSheet.d.ts.map +1 -1
- package/types/helpers.d.ts +2 -0
- package/types/helpers.d.ts.map +1 -0
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/nativeSheet.d.ts.map +1 -1
- package/types/useSheet.d.ts +22 -0
- package/types/useSheet.d.ts.map +1 -0
- package/types/useSheetChildren.d.ts +1 -0
- package/types/useSheetChildren.d.ts.map +1 -1
- package/types/useSheetController.d.ts +1 -0
- package/types/useSheetController.d.ts.map +1 -1
- package/types/useSheetProviderProps.d.ts +8 -3
- package/types/useSheetProviderProps.d.ts.map +1 -1
- package/src/useSheetChildren.tsx +0 -47
- package/src/useSheetSnapPoints.tsx +0 -60
package/dist/cjs/createSheet.js
CHANGED
|
@@ -22,31 +22,24 @@ __export(createSheet_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(createSheet_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_adapt = require("@tamagui/adapt");
|
|
26
25
|
var import_compose_refs = require("@tamagui/compose-refs");
|
|
27
26
|
var import_core = require("@tamagui/core");
|
|
28
|
-
var import_portal = require("@tamagui/portal");
|
|
29
27
|
var import_remove_scroll = require("@tamagui/remove-scroll");
|
|
30
|
-
var import_use_keyboard_visible = require("@tamagui/use-keyboard-visible");
|
|
31
28
|
var import_react = require("react");
|
|
32
29
|
var import_react_native = require("react-native");
|
|
33
30
|
var import_constants = require("./constants");
|
|
34
31
|
var import_nativeSheet = require("./nativeSheet");
|
|
35
32
|
var import_SheetContext = require("./SheetContext");
|
|
33
|
+
var import_SheetImplementationCustom = require("./SheetImplementationCustom");
|
|
36
34
|
var import_SheetScrollView = require("./SheetScrollView");
|
|
37
|
-
var import_useSheetChildren = require("./useSheetChildren");
|
|
38
35
|
var import_useSheetController = require("./useSheetController");
|
|
39
|
-
var import_useSheetOpenState = require("./useSheetOpenState");
|
|
40
|
-
var import_useSheetProviderProps = require("./useSheetProviderProps");
|
|
41
|
-
var import_useSheetSnapPoints = require("./useSheetSnapPoints");
|
|
42
|
-
const selectionStyleSheet = import_core.isClient ? document.createElement("style") : null;
|
|
43
|
-
if (selectionStyleSheet) {
|
|
44
|
-
document.head.appendChild(selectionStyleSheet);
|
|
45
|
-
}
|
|
46
36
|
function createSheet({ Handle, Frame, Overlay }) {
|
|
47
37
|
const SheetHandle = Handle.extractable(
|
|
48
38
|
({ __scopeSheet, ...props }) => {
|
|
49
39
|
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_HANDLE_NAME, __scopeSheet);
|
|
40
|
+
if (context.onlyShowFrame) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
50
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
44
|
Handle,
|
|
52
45
|
{
|
|
@@ -62,36 +55,84 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
62
55
|
}
|
|
63
56
|
);
|
|
64
57
|
const SheetOverlay = Overlay.extractable(
|
|
65
|
-
(
|
|
58
|
+
(propsIn) => {
|
|
59
|
+
const { __scopeSheet, ...props } = propsIn;
|
|
66
60
|
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_OVERLAY_NAME, __scopeSheet);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
context.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
61
|
+
const element = (0, import_react.useMemo)(
|
|
62
|
+
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
|
+
Overlay,
|
|
64
|
+
{
|
|
65
|
+
open: context.open && !context.hidden,
|
|
66
|
+
...props,
|
|
67
|
+
onPress: (0, import_core.mergeEvent)(
|
|
68
|
+
props.onPress,
|
|
69
|
+
context.dismissOnOverlayPress ? () => {
|
|
70
|
+
context.setOpen(false);
|
|
71
|
+
} : void 0
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
[
|
|
76
|
+
context.open,
|
|
77
|
+
props,
|
|
78
|
+
context.hidden,
|
|
79
|
+
props.onPress,
|
|
80
|
+
context.dismissOnOverlayPress
|
|
81
|
+
]
|
|
79
82
|
);
|
|
83
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
84
|
+
var _a;
|
|
85
|
+
(_a = context.onOverlayComponent) == null ? void 0 : _a.call(context, element);
|
|
86
|
+
}, [element]);
|
|
87
|
+
if (context.onlyShowFrame) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
80
91
|
}
|
|
81
92
|
);
|
|
82
93
|
const SheetFrame = Frame.extractable(
|
|
83
94
|
(0, import_react.forwardRef)(
|
|
84
|
-
({
|
|
95
|
+
({
|
|
96
|
+
__scopeSheet,
|
|
97
|
+
children,
|
|
98
|
+
...props
|
|
99
|
+
}, forwardedRef) => {
|
|
85
100
|
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_NAME, __scopeSheet);
|
|
86
101
|
const composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.contentRef);
|
|
87
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
|
+
import_remove_scroll.RemoveScroll,
|
|
105
|
+
{
|
|
106
|
+
forwardProps: true,
|
|
107
|
+
enabled: context.removeScrollEnabled,
|
|
108
|
+
allowPinchZoom: true,
|
|
109
|
+
shards: [context.contentRef],
|
|
110
|
+
removeScrollBar: false,
|
|
111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Frame, { ref: composedContentRef, ...props, children })
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
!props.disableHideBottomOverflow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
+
Frame,
|
|
116
|
+
{
|
|
117
|
+
...props,
|
|
118
|
+
children: null,
|
|
119
|
+
position: "absolute",
|
|
120
|
+
bottom: 0,
|
|
121
|
+
maxHeight: 300,
|
|
122
|
+
left: 0,
|
|
123
|
+
right: 0,
|
|
124
|
+
borderRadius: 0,
|
|
125
|
+
shadowOpacity: 0
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
] });
|
|
88
129
|
}
|
|
89
130
|
)
|
|
90
131
|
);
|
|
91
132
|
const Sheet = (0, import_react.forwardRef)(function Sheet2(props, ref) {
|
|
92
133
|
const hydrated = (0, import_core.useDidFinishSSR)();
|
|
93
134
|
const { isShowingNonSheet } = (0, import_useSheetController.useSheetController)();
|
|
94
|
-
let SheetImplementation = SheetImplementationCustom;
|
|
135
|
+
let SheetImplementation = import_SheetImplementationCustom.SheetImplementationCustom;
|
|
95
136
|
if (props.native && import_react_native.Platform.OS === "ios") {
|
|
96
137
|
if (process.env.TAMAGUI_TARGET === "native") {
|
|
97
138
|
const impl = (0, import_nativeSheet.getNativeSheet)("ios");
|
|
@@ -117,321 +158,6 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
117
158
|
Controlled
|
|
118
159
|
});
|
|
119
160
|
}
|
|
120
|
-
const HIDDEN_SIZE = 1e4;
|
|
121
|
-
const ParentSheetContext = (0, import_react.createContext)({
|
|
122
|
-
zIndex: 1e5
|
|
123
|
-
});
|
|
124
|
-
const SheetImplementationCustom = (0, import_core.themeable)(
|
|
125
|
-
(0, import_react.forwardRef)(function SheetImplementationCustom2(props, forwardedRef) {
|
|
126
|
-
const parentSheet = (0, import_react.useContext)(ParentSheetContext);
|
|
127
|
-
const {
|
|
128
|
-
animationConfig,
|
|
129
|
-
forceRemoveScrollEnabled = null,
|
|
130
|
-
disableDrag: disableDragProp,
|
|
131
|
-
modal = false,
|
|
132
|
-
zIndex = parentSheet.zIndex + 1,
|
|
133
|
-
moveOnKeyboardChange = false,
|
|
134
|
-
portalProps
|
|
135
|
-
} = props;
|
|
136
|
-
const state = (0, import_useSheetOpenState.useSheetOpenState)(props);
|
|
137
|
-
const providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state);
|
|
138
|
-
const { positions, maxSnapPoint, screenSize } = (0, import_useSheetSnapPoints.useSheetSnapPoints)(providerProps);
|
|
139
|
-
const { position, contentRef, setPosition, scrollBridge, frameSize, setFrameSize } = providerProps;
|
|
140
|
-
const { open, isHidden, controller } = state;
|
|
141
|
-
const { frameComponent, handleComponent, bottomCoverComponent, overlayComponent } = (0, import_useSheetChildren.useSheetChildren)(props.children);
|
|
142
|
-
const sheetRef = (0, import_react.useRef)(null);
|
|
143
|
-
const ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef);
|
|
144
|
-
const driver = (0, import_core.useAnimationDriver)();
|
|
145
|
-
if (!driver) {
|
|
146
|
-
throw new Error("Must set animations in tamagui.config.ts");
|
|
147
|
-
}
|
|
148
|
-
const disableDrag = disableDragProp ?? (controller == null ? void 0 : controller.disableDrag);
|
|
149
|
-
const keyboardIsVisible = (0, import_use_keyboard_visible.useKeyboardVisible)();
|
|
150
|
-
const themeName = (0, import_core.useThemeName)();
|
|
151
|
-
const { useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle } = driver;
|
|
152
|
-
const animatedNumber = useAnimatedNumber(HIDDEN_SIZE);
|
|
153
|
-
const at = (0, import_react.useRef)(0);
|
|
154
|
-
useAnimatedNumberReaction(
|
|
155
|
-
{
|
|
156
|
-
value: animatedNumber,
|
|
157
|
-
hostRef: sheetRef
|
|
158
|
-
},
|
|
159
|
-
(value) => {
|
|
160
|
-
if (!driver.isReactNative)
|
|
161
|
-
return;
|
|
162
|
-
at.current = value;
|
|
163
|
-
scrollBridge.paneY = value;
|
|
164
|
-
}
|
|
165
|
-
);
|
|
166
|
-
function stopSpring() {
|
|
167
|
-
animatedNumber.stop();
|
|
168
|
-
if (scrollBridge.onFinishAnimate) {
|
|
169
|
-
scrollBridge.onFinishAnimate();
|
|
170
|
-
scrollBridge.onFinishAnimate = void 0;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
const [opacity, setOpacity] = (0, import_react.useState)(open ? 1 : 0);
|
|
174
|
-
if (open && opacity === 0) {
|
|
175
|
-
setOpacity(1);
|
|
176
|
-
}
|
|
177
|
-
(0, import_react.useEffect)(() => {
|
|
178
|
-
if (!open) {
|
|
179
|
-
const tm = setTimeout(() => {
|
|
180
|
-
setOpacity(0);
|
|
181
|
-
}, 400);
|
|
182
|
-
return () => {
|
|
183
|
-
clearTimeout(tm);
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
}, [open]);
|
|
187
|
-
const animateTo = (0, import_core.useEvent)((position2) => {
|
|
188
|
-
const current = animatedNumber.getValue();
|
|
189
|
-
if (isHidden && open)
|
|
190
|
-
return;
|
|
191
|
-
if (!current)
|
|
192
|
-
return;
|
|
193
|
-
if (frameSize === 0)
|
|
194
|
-
return;
|
|
195
|
-
const hiddenValue = frameSize === 0 ? HIDDEN_SIZE : screenSize;
|
|
196
|
-
const toValue = isHidden || position2 === -1 ? hiddenValue : positions[position2];
|
|
197
|
-
if (at.current === toValue)
|
|
198
|
-
return;
|
|
199
|
-
stopSpring();
|
|
200
|
-
if (isHidden) {
|
|
201
|
-
animatedNumber.setValue(toValue, {
|
|
202
|
-
type: "timing",
|
|
203
|
-
duration: 0
|
|
204
|
-
});
|
|
205
|
-
at.current = toValue;
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
const overshootClamping = at.current === HIDDEN_SIZE;
|
|
209
|
-
animatedNumber.setValue(toValue, {
|
|
210
|
-
...animationConfig,
|
|
211
|
-
type: "spring",
|
|
212
|
-
overshootClamping
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
216
|
-
animateTo(position);
|
|
217
|
-
}, [isHidden, frameSize, position, animateTo]);
|
|
218
|
-
const [isShowingInnerSheet, setIsShowingInnerSheet] = (0, import_react.useState)(false);
|
|
219
|
-
const shouldHideParentSheet = !import_core.isWeb && modal && isShowingInnerSheet;
|
|
220
|
-
const parentSheetContext = (0, import_react.useContext)(SheetInsideSheetContext);
|
|
221
|
-
const onInnerSheet = (0, import_react.useCallback)((hasChild) => {
|
|
222
|
-
setIsShowingInnerSheet(hasChild);
|
|
223
|
-
}, []);
|
|
224
|
-
const panResponder = (0, import_react.useMemo)(
|
|
225
|
-
() => {
|
|
226
|
-
if (disableDrag)
|
|
227
|
-
return;
|
|
228
|
-
if (!frameSize)
|
|
229
|
-
return;
|
|
230
|
-
if (isShowingInnerSheet)
|
|
231
|
-
return;
|
|
232
|
-
const minY = positions[0];
|
|
233
|
-
scrollBridge.paneMinY = minY;
|
|
234
|
-
let startY = at.current;
|
|
235
|
-
function makeUnselectable(val) {
|
|
236
|
-
if (!selectionStyleSheet)
|
|
237
|
-
return;
|
|
238
|
-
if (!val) {
|
|
239
|
-
selectionStyleSheet.innerText = "";
|
|
240
|
-
} else {
|
|
241
|
-
selectionStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }";
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
const release = ({ vy, dragAt }) => {
|
|
245
|
-
isExternalDrag = false;
|
|
246
|
-
previouslyScrolling = false;
|
|
247
|
-
makeUnselectable(false);
|
|
248
|
-
const at2 = dragAt + startY;
|
|
249
|
-
const end = at2 + frameSize * vy * 0.2;
|
|
250
|
-
let closestPoint = 0;
|
|
251
|
-
let dist = Infinity;
|
|
252
|
-
for (let i = 0; i < positions.length; i++) {
|
|
253
|
-
const position2 = positions[i];
|
|
254
|
-
const curDist = end > position2 ? end - position2 : position2 - end;
|
|
255
|
-
if (curDist < dist) {
|
|
256
|
-
dist = curDist;
|
|
257
|
-
closestPoint = i;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
setPosition(closestPoint);
|
|
261
|
-
animateTo(closestPoint);
|
|
262
|
-
};
|
|
263
|
-
const finish = (_e, state2) => {
|
|
264
|
-
release({
|
|
265
|
-
vy: state2.vy,
|
|
266
|
-
dragAt: state2.dy
|
|
267
|
-
});
|
|
268
|
-
};
|
|
269
|
-
let previouslyScrolling = false;
|
|
270
|
-
const onMoveShouldSet = (_e, { dy }) => {
|
|
271
|
-
const isScrolled = scrollBridge.y !== 0;
|
|
272
|
-
const isDraggingUp = dy < 0;
|
|
273
|
-
const isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
274
|
-
if (isScrolled) {
|
|
275
|
-
previouslyScrolling = true;
|
|
276
|
-
return false;
|
|
277
|
-
}
|
|
278
|
-
if (isNearTop) {
|
|
279
|
-
if (!isScrolled && isDraggingUp) {
|
|
280
|
-
return false;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return Math.abs(dy) > 5;
|
|
284
|
-
};
|
|
285
|
-
const grant = () => {
|
|
286
|
-
makeUnselectable(true);
|
|
287
|
-
stopSpring();
|
|
288
|
-
startY = at.current;
|
|
289
|
-
};
|
|
290
|
-
let isExternalDrag = false;
|
|
291
|
-
scrollBridge.drag = (dy) => {
|
|
292
|
-
if (!isExternalDrag) {
|
|
293
|
-
isExternalDrag = true;
|
|
294
|
-
grant();
|
|
295
|
-
}
|
|
296
|
-
const to = dy + startY;
|
|
297
|
-
animatedNumber.setValue(resisted(to, minY), { type: "direct" });
|
|
298
|
-
};
|
|
299
|
-
scrollBridge.release = release;
|
|
300
|
-
return import_react_native.PanResponder.create({
|
|
301
|
-
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
302
|
-
onPanResponderGrant: grant,
|
|
303
|
-
onPanResponderMove: (_e, { dy }) => {
|
|
304
|
-
const toFull = dy + startY;
|
|
305
|
-
const to = resisted(toFull, minY);
|
|
306
|
-
animatedNumber.setValue(to, { type: "direct" });
|
|
307
|
-
},
|
|
308
|
-
onPanResponderEnd: finish,
|
|
309
|
-
onPanResponderTerminate: finish,
|
|
310
|
-
onPanResponderRelease: finish
|
|
311
|
-
});
|
|
312
|
-
},
|
|
313
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
314
|
-
[disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]
|
|
315
|
-
);
|
|
316
|
-
const animatedStyle = useAnimatedNumberStyle(animatedNumber, (val) => {
|
|
317
|
-
"worklet";
|
|
318
|
-
const translateY = frameSize === 0 ? HIDDEN_SIZE : val;
|
|
319
|
-
return {
|
|
320
|
-
transform: [{ translateY }]
|
|
321
|
-
};
|
|
322
|
-
});
|
|
323
|
-
const sizeBeforeKeyboard = (0, import_react.useRef)(null);
|
|
324
|
-
(0, import_react.useEffect)(() => {
|
|
325
|
-
if (import_core.isWeb || !moveOnKeyboardChange)
|
|
326
|
-
return;
|
|
327
|
-
const keyboardDidShowListener = import_react_native.Keyboard.addListener("keyboardDidShow", (e) => {
|
|
328
|
-
if (sizeBeforeKeyboard.current !== null)
|
|
329
|
-
return;
|
|
330
|
-
sizeBeforeKeyboard.current = animatedNumber.getValue();
|
|
331
|
-
animatedNumber.setValue(
|
|
332
|
-
Math.max(animatedNumber.getValue() - e.endCoordinates.height, 0)
|
|
333
|
-
);
|
|
334
|
-
});
|
|
335
|
-
const keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
336
|
-
if (sizeBeforeKeyboard.current === null)
|
|
337
|
-
return;
|
|
338
|
-
animatedNumber.setValue(sizeBeforeKeyboard.current);
|
|
339
|
-
sizeBeforeKeyboard.current = null;
|
|
340
|
-
});
|
|
341
|
-
return () => {
|
|
342
|
-
keyboardDidHideListener.remove();
|
|
343
|
-
keyboardDidShowListener.remove();
|
|
344
|
-
};
|
|
345
|
-
}, []);
|
|
346
|
-
const AnimatedView = driver["NumberView"] ?? driver.View;
|
|
347
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
348
|
-
if (!(parentSheetContext && open))
|
|
349
|
-
return;
|
|
350
|
-
parentSheetContext(true);
|
|
351
|
-
return () => {
|
|
352
|
-
parentSheetContext(false);
|
|
353
|
-
};
|
|
354
|
-
}, [parentSheetContext, open]);
|
|
355
|
-
const nextParentContext = (0, import_react.useMemo)(
|
|
356
|
-
() => ({
|
|
357
|
-
zIndex
|
|
358
|
-
}),
|
|
359
|
-
[zIndex]
|
|
360
|
-
);
|
|
361
|
-
const handleLayout = (0, import_react.useCallback)(
|
|
362
|
-
(e) => {
|
|
363
|
-
var _a;
|
|
364
|
-
let next = (_a = e.nativeEvent) == null ? void 0 : _a.layout.height;
|
|
365
|
-
if (import_core.isWeb && import_core.isTouchable && !open) {
|
|
366
|
-
next += 100;
|
|
367
|
-
}
|
|
368
|
-
if (!next)
|
|
369
|
-
return;
|
|
370
|
-
setFrameSize(() => next);
|
|
371
|
-
},
|
|
372
|
-
[keyboardIsVisible]
|
|
373
|
-
);
|
|
374
|
-
const removeScrollEnabled = forceRemoveScrollEnabled ?? (open && modal);
|
|
375
|
-
const contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ParentSheetContext.Provider, { value: nextParentContext, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, { ...providerProps, children: [
|
|
376
|
-
shouldHideParentSheet ? null : overlayComponent,
|
|
377
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
378
|
-
AnimatedView,
|
|
379
|
-
{
|
|
380
|
-
ref,
|
|
381
|
-
...panResponder == null ? void 0 : panResponder.panHandlers,
|
|
382
|
-
onLayout: handleLayout,
|
|
383
|
-
pointerEvents: open && !shouldHideParentSheet ? "auto" : "none",
|
|
384
|
-
animation: props.animation,
|
|
385
|
-
style: [
|
|
386
|
-
{
|
|
387
|
-
position: "absolute",
|
|
388
|
-
zIndex,
|
|
389
|
-
width: "100%",
|
|
390
|
-
height: `${maxSnapPoint}%`,
|
|
391
|
-
opacity
|
|
392
|
-
},
|
|
393
|
-
animatedStyle
|
|
394
|
-
],
|
|
395
|
-
children: [
|
|
396
|
-
handleComponent,
|
|
397
|
-
bottomCoverComponent,
|
|
398
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
399
|
-
import_remove_scroll.RemoveScroll,
|
|
400
|
-
{
|
|
401
|
-
forwardProps: true,
|
|
402
|
-
enabled: removeScrollEnabled,
|
|
403
|
-
allowPinchZoom: true,
|
|
404
|
-
shards: [contentRef],
|
|
405
|
-
removeScrollBar: false,
|
|
406
|
-
children: frameComponent
|
|
407
|
-
}
|
|
408
|
-
)
|
|
409
|
-
]
|
|
410
|
-
}
|
|
411
|
-
)
|
|
412
|
-
] }) });
|
|
413
|
-
const adaptContext = (0, import_react.useContext)(import_adapt.AdaptParentContext);
|
|
414
|
-
if (modal) {
|
|
415
|
-
const modalContents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, { zIndex, ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, { forceClassName: true, name: themeName, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptParentContext.Provider, { value: adaptContext, children: contents }) }) });
|
|
416
|
-
if (import_core.isWeb) {
|
|
417
|
-
return modalContents;
|
|
418
|
-
}
|
|
419
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetInsideSheetContext.Provider, { value: onInnerSheet, children: modalContents });
|
|
420
|
-
}
|
|
421
|
-
return contents;
|
|
422
|
-
})
|
|
423
|
-
);
|
|
424
|
-
const SheetInsideSheetContext = (0, import_react.createContext)(null);
|
|
425
|
-
function resisted(y, minY, maxOverflow = 25) {
|
|
426
|
-
if (y < minY) {
|
|
427
|
-
const past = minY - y;
|
|
428
|
-
const pctPast = Math.min(maxOverflow, past) / maxOverflow;
|
|
429
|
-
const diminishBy = 1.1 - Math.pow(0.1, pctPast);
|
|
430
|
-
const extra = -diminishBy * maxOverflow;
|
|
431
|
-
return minY + extra;
|
|
432
|
-
}
|
|
433
|
-
return y;
|
|
434
|
-
}
|
|
435
161
|
// Annotate the CommonJS export names for ESM import in node:
|
|
436
162
|
0 && (module.exports = {
|
|
437
163
|
createSheet
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createSheet.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
5
|
-
"names": ["Sheet"
|
|
4
|
+
"mappings": "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",
|
|
5
|
+
"names": ["Sheet"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var helpers_exports = {};
|
|
20
|
+
__export(helpers_exports, {
|
|
21
|
+
resisted: () => resisted
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(helpers_exports);
|
|
24
|
+
function resisted(y, minY, maxOverflow = 25) {
|
|
25
|
+
if (y < minY) {
|
|
26
|
+
const past = minY - y;
|
|
27
|
+
const pctPast = Math.min(maxOverflow, past) / maxOverflow;
|
|
28
|
+
const diminishBy = 1.1 - Math.pow(0.1, pctPast);
|
|
29
|
+
const extra = -diminishBy * maxOverflow;
|
|
30
|
+
return minY + extra;
|
|
31
|
+
}
|
|
32
|
+
return y;
|
|
33
|
+
}
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
resisted
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/helpers.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,SAAS,GAAW,MAAc,cAAc,IAAI;AAClE,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;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __export(src_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(src_exports);
|
|
25
25
|
__reExport(src_exports, require("./Sheet"), module.exports);
|
|
26
|
+
__reExport(src_exports, require("./useSheet"), module.exports);
|
|
26
27
|
__reExport(src_exports, require("./createSheet"), module.exports);
|
|
27
28
|
__reExport(src_exports, require("./SheetController"), module.exports);
|
|
28
29
|
__reExport(src_exports, require("./useSheetController"), module.exports);
|
|
@@ -31,6 +32,7 @@ var import_nativeSheet = require("./nativeSheet");
|
|
|
31
32
|
0 && (module.exports = {
|
|
32
33
|
setupNativeSheet,
|
|
33
34
|
...require("./Sheet"),
|
|
35
|
+
...require("./useSheet"),
|
|
34
36
|
...require("./createSheet"),
|
|
35
37
|
...require("./SheetController"),
|
|
36
38
|
...require("./useSheetController")
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,oBAAd;AACA,wBAAc,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,oBAAd;AACA,wBAAc,uBADd;AAEA,wBAAc,0BAFd;AAGA,wBAAc,8BAHd;AAIA,wBAAc,iCAJd;AAKA,yBAAiC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/cjs/nativeSheet.js
CHANGED
|
@@ -26,7 +26,6 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
26
26
|
var import_stacks = require("@tamagui/stacks");
|
|
27
27
|
var import_react = require("react");
|
|
28
28
|
var import_SheetContext = require("./SheetContext");
|
|
29
|
-
var import_useSheetChildren = require("./useSheetChildren");
|
|
30
29
|
var import_useSheetOpenState = require("./useSheetOpenState");
|
|
31
30
|
var import_useSheetProviderProps = require("./useSheetProviderProps");
|
|
32
31
|
const nativeSheets = {
|
|
@@ -40,15 +39,14 @@ function setupNativeSheet(platform, Implementation) {
|
|
|
40
39
|
nativeSheets[platform] = (props) => {
|
|
41
40
|
const state = (0, import_useSheetOpenState.useSheetOpenState)(props);
|
|
42
41
|
const providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state);
|
|
43
|
-
const { frameComponent } = (0, import_useSheetChildren.useSheetChildren)(props.children);
|
|
44
42
|
const { open, setOpen } = state;
|
|
45
43
|
const ref = (0, import_react.useRef)();
|
|
46
44
|
(0, import_react.useEffect)(() => {
|
|
47
45
|
var _a;
|
|
48
46
|
(_a = ref.current) == null ? void 0 : _a.setVisibility(open);
|
|
49
47
|
}, [open]);
|
|
50
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, { ...providerProps, children: [
|
|
51
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Implementation, { ref, onModalDismiss: () => setOpen(false), children:
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, { ...providerProps, onlyShowFrame: true, children: [
|
|
49
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Implementation, { ref, onModalDismiss: () => setOpen(false), children: props.children }),
|
|
52
50
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
51
|
import_stacks.YStack,
|
|
54
52
|
{
|
|
@@ -57,7 +55,7 @@ function setupNativeSheet(platform, Implementation) {
|
|
|
57
55
|
pointerEvents: "none",
|
|
58
56
|
width: 0,
|
|
59
57
|
height: 0,
|
|
60
|
-
children:
|
|
58
|
+
children: props.children
|
|
61
59
|
}
|
|
62
60
|
)
|
|
63
61
|
] }) });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/nativeSheet.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CQ;AA5CR,oBAAuB;AACvB,mBAAqD;AAErD,0BAA8B;AAE9B,+BAAkC;AAClC,mCAAsC;AAMtC,MAAM,eAAmF;AAAA,EACvF,KAAK;AACP;AAEO,SAAS,eAAe,UAAgC;AAC7D,SAAO,aAAa,QAAQ;AAC9B;AAEO,SAAS,iBAAiB,UAAgC,gBAAqB;AACpF,MAAI,aAAa,OAAO;AACtB,iBAAa,QAAQ,IAAI,CAAC,UAAsB;AAC9C,YAAM,YAAQ,4CAAkB,KAAK;AACrC,YAAM,oBAAgB,oDAAsB,OAAO,KAAK;AAIxD,YAAM,EAAE,MAAM,QAAQ,IAAI;AAC1B,YAAM,UAAM,qBAET;AAEH,kCAAU,MAAM;AAjCtB;AAkCQ,kBAAI,YAAJ,mBAAa,cAAc;AAAA,MAC7B,GAAG,CAAC,IAAI,CAAC;AAQT,aACE,2EACE,uDAAC,qCAAe,GAAG,eAAe,eAAa,MAC7C;AAAA,oDAAC,kBAAe,KAAU,gBAAgB,MAAM,QAAQ,KAAK,GAC1D,gBAAM,UACT;AAAA,QAIA;AAAA,UAAC;AAAA;AAAA,YACC,UAAS;AAAA,YACT,SAAS;AAAA,YACT,eAAc;AAAA,YACd,OAAO;AAAA,YACP,QAAQ;AAAA,YAEP,gBAAM;AAAA;AAAA,QACT;AAAA,SACF,GACF;AAAA,IAEJ;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var useSheet_exports = {};
|
|
20
|
+
__export(useSheet_exports, {
|
|
21
|
+
useSheet: () => useSheet
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useSheet_exports);
|
|
24
|
+
var import_SheetContext = require("./SheetContext");
|
|
25
|
+
const useSheet = () => (0, import_SheetContext.useSheetContext)("", void 0);
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
useSheet
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=useSheet.js.map
|