@tamagui/sheet 1.135.4-1761748186554 → 1.135.4
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.native.js +90 -96
- package/dist/cjs/Sheet.native.js.map +6 -1
- package/dist/cjs/SheetContext.native.js +18 -21
- package/dist/cjs/SheetContext.native.js.map +6 -1
- package/dist/cjs/SheetController.cjs +1 -1
- package/dist/cjs/SheetController.js +1 -1
- package/dist/cjs/SheetController.js.map +1 -1
- package/dist/cjs/SheetController.native.js +38 -51
- package/dist/cjs/SheetController.native.js.map +6 -1
- package/dist/cjs/SheetImplementationCustom.cjs +1 -1
- package/dist/cjs/SheetImplementationCustom.js +1 -1
- package/dist/cjs/SheetImplementationCustom.js.map +1 -1
- package/dist/cjs/SheetImplementationCustom.native.js +312 -362
- package/dist/cjs/SheetImplementationCustom.native.js.map +6 -1
- package/dist/cjs/SheetScrollView.cjs +1 -1
- package/dist/cjs/SheetScrollView.js +1 -1
- package/dist/cjs/SheetScrollView.js.map +1 -1
- package/dist/cjs/SheetScrollView.native.js +107 -137
- package/dist/cjs/SheetScrollView.native.js.map +6 -1
- package/dist/cjs/constants.native.js +18 -21
- package/dist/cjs/constants.native.js.map +6 -1
- package/dist/cjs/contexts.cjs +1 -1
- package/dist/cjs/contexts.js +1 -1
- package/dist/cjs/contexts.native.js +21 -28
- package/dist/cjs/contexts.native.js.map +6 -1
- package/dist/cjs/createSheet.native.js +101 -148
- package/dist/cjs/createSheet.native.js.map +6 -1
- package/dist/cjs/helpers.native.js +17 -20
- package/dist/cjs/helpers.native.js.map +6 -1
- package/dist/cjs/index.native.js +32 -23
- package/dist/cjs/index.native.js.map +6 -1
- package/dist/cjs/nativeSheet.native.js +53 -65
- package/dist/cjs/nativeSheet.native.js.map +6 -1
- package/dist/cjs/types.native.js +5 -9
- package/dist/cjs/types.native.js.map +6 -1
- package/dist/cjs/useSheet.native.js +17 -21
- package/dist/cjs/useSheet.native.js.map +6 -1
- package/dist/cjs/useSheetController.cjs +1 -1
- package/dist/cjs/useSheetController.js +1 -1
- package/dist/cjs/useSheetController.native.js +27 -36
- package/dist/cjs/useSheetController.native.js.map +6 -1
- package/dist/cjs/useSheetOffscreenSize.native.js +23 -41
- package/dist/cjs/useSheetOffscreenSize.native.js.map +6 -1
- package/dist/cjs/useSheetOpenState.native.js +30 -44
- package/dist/cjs/useSheetOpenState.native.js.map +6 -1
- package/dist/cjs/useSheetProviderProps.cjs +1 -1
- package/dist/cjs/useSheetProviderProps.js +1 -1
- package/dist/cjs/useSheetProviderProps.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.native.js +108 -119
- package/dist/cjs/useSheetProviderProps.native.js.map +6 -1
- package/dist/jsx/Sheet.native.js +84 -114
- package/dist/jsx/Sheet.native.js.map +6 -1
- package/dist/jsx/SheetContext.native.js +10 -35
- package/dist/jsx/SheetContext.native.js.map +6 -1
- package/dist/jsx/SheetController.native.js +29 -67
- package/dist/jsx/SheetController.native.js.map +6 -1
- package/dist/jsx/SheetImplementationCustom.native.js +312 -377
- package/dist/jsx/SheetImplementationCustom.native.js.map +6 -1
- package/dist/jsx/SheetScrollView.native.js +104 -156
- package/dist/jsx/SheetScrollView.native.js.map +6 -1
- package/dist/jsx/constants.native.js +8 -35
- package/dist/jsx/constants.native.js.map +6 -1
- package/dist/jsx/contexts.native.js +9 -45
- package/dist/jsx/contexts.native.js.map +6 -1
- package/dist/jsx/createSheet.native.js +109 -160
- package/dist/jsx/createSheet.native.js.map +6 -1
- package/dist/jsx/helpers.native.js +7 -31
- package/dist/jsx/helpers.native.js.map +6 -1
- package/dist/jsx/index.native.js +12 -31
- package/dist/jsx/index.native.js.map +6 -1
- package/dist/jsx/nativeSheet.native.js +50 -77
- package/dist/jsx/nativeSheet.native.js.map +6 -1
- package/dist/jsx/types.native.js +1 -19
- package/dist/jsx/types.native.js.map +6 -1
- package/dist/jsx/useSheet.native.js +8 -32
- package/dist/jsx/useSheet.native.js.map +6 -1
- package/dist/jsx/useSheetController.native.js +14 -52
- package/dist/jsx/useSheetController.native.js.map +6 -1
- package/dist/jsx/useSheetOffscreenSize.native.js +13 -52
- package/dist/jsx/useSheetOffscreenSize.native.js.map +6 -1
- package/dist/jsx/useSheetOpenState.native.js +22 -55
- package/dist/jsx/useSheetOpenState.native.js.map +6 -1
- package/dist/jsx/useSheetProviderProps.native.js +98 -135
- package/dist/jsx/useSheetProviderProps.native.js.map +6 -1
- package/package.json +19 -20
- package/types/SheetContext.d.ts.map +1 -1
|
@@ -1,146 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
23
|
-
var createSheet_exports = {};
|
|
24
|
-
__export(createSheet_exports, {
|
|
25
|
-
createSheet: () => createSheet
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(createSheet_exports);
|
|
28
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
29
|
-
import_compose_refs = require("@tamagui/compose-refs"),
|
|
30
|
-
import_constants = require("@tamagui/constants"),
|
|
31
|
-
import_core = require("@tamagui/core"),
|
|
32
|
-
import_helpers = require("@tamagui/helpers"),
|
|
33
|
-
import_portal = require("@tamagui/portal"),
|
|
34
|
-
import_remove_scroll = require("@tamagui/remove-scroll"),
|
|
35
|
-
import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr"),
|
|
36
|
-
import_z_index_stack = require("@tamagui/z-index-stack"),
|
|
37
|
-
import_react = require("react"),
|
|
38
|
-
import_react_native = require("react-native"),
|
|
39
|
-
import_constants2 = require("./constants.native.js"),
|
|
40
|
-
import_nativeSheet = require("./nativeSheet.native.js"),
|
|
41
|
-
import_SheetContext = require("./SheetContext.native.js"),
|
|
42
|
-
import_SheetImplementationCustom = require("./SheetImplementationCustom.native.js"),
|
|
43
|
-
import_SheetScrollView = require("./SheetScrollView.native.js"),
|
|
44
|
-
import_useSheetController = require("./useSheetController.native.js"),
|
|
45
|
-
import_useSheetOffscreenSize = require("./useSheetOffscreenSize.native.js");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
3
|
+
import { useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
4
|
+
import { Stack } from "@tamagui/core";
|
|
5
|
+
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
6
|
+
import { resolveViewZIndex } from "@tamagui/portal";
|
|
7
|
+
import { RemoveScroll } from "@tamagui/remove-scroll";
|
|
8
|
+
import { useDidFinishSSR } from "@tamagui/use-did-finish-ssr";
|
|
9
|
+
import { StackZIndexContext } from "@tamagui/z-index-stack";
|
|
10
|
+
import { forwardRef, memo, useMemo } from "react";
|
|
11
|
+
import { Platform } from "react-native";
|
|
12
|
+
import { SHEET_HANDLE_NAME, SHEET_NAME, SHEET_OVERLAY_NAME } from "./constants";
|
|
13
|
+
import { getNativeSheet } from "./nativeSheet";
|
|
14
|
+
import { useSheetContext } from "./SheetContext";
|
|
15
|
+
import { SheetImplementationCustom } from "./SheetImplementationCustom";
|
|
16
|
+
import { SheetScrollView } from "./SheetScrollView";
|
|
17
|
+
import { useSheetController } from "./useSheetController";
|
|
18
|
+
import { useSheetOffscreenSize } from "./useSheetOffscreenSize";
|
|
46
19
|
function createSheet(param) {
|
|
47
|
-
var {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Overlay
|
|
51
|
-
} = param,
|
|
52
|
-
SheetHandle = Handle.styleable(function (param2, forwardedRef) {
|
|
53
|
-
var {
|
|
54
|
-
__scopeSheet,
|
|
55
|
-
...props
|
|
56
|
-
} = param2,
|
|
57
|
-
context = (0, import_SheetContext.useSheetContext)(import_constants2.SHEET_HANDLE_NAME, __scopeSheet),
|
|
58
|
-
composedRef = (0, import_compose_refs.useComposedRefs)(context.handleRef, forwardedRef);
|
|
59
|
-
return context.onlyShowFrame ? null :
|
|
20
|
+
var { Handle, Frame, Overlay } = param, SheetHandle = Handle.styleable(function(param2, forwardedRef) {
|
|
21
|
+
var { __scopeSheet, ...props } = param2, context = useSheetContext(SHEET_HANDLE_NAME, __scopeSheet), composedRef = useComposedRefs(context.handleRef, forwardedRef);
|
|
22
|
+
return context.onlyShowFrame ? null : (
|
|
60
23
|
// @ts-ignore
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
(0, import_jsx_runtime.jsx)(Handle, {
|
|
24
|
+
/* @__PURE__ */ _jsx(Handle, {
|
|
63
25
|
ref: composedRef,
|
|
64
|
-
onPress: function
|
|
65
|
-
var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0),
|
|
66
|
-
nextPos = (context.position + 1) % max;
|
|
26
|
+
onPress: function() {
|
|
27
|
+
var max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0), nextPos = (context.position + 1) % max;
|
|
67
28
|
context.setPosition(nextPos);
|
|
68
29
|
},
|
|
69
30
|
open: context.open,
|
|
70
31
|
...props
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
sheetContents = (0, import_react.useMemo)(function () {
|
|
115
|
-
return (
|
|
116
|
-
// @ts-expect-error
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
(0, import_jsx_runtime.jsxs)(Frame, {
|
|
119
|
-
ref: composedContentRef,
|
|
120
|
-
flex: hasFit ? 0 : 1,
|
|
121
|
-
height: hasFit ? void 0 : frameSize,
|
|
122
|
-
pointerEvents: open ? "auto" : "none",
|
|
123
|
-
...props,
|
|
124
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_z_index_stack.StackZIndexContext, {
|
|
125
|
-
zIndex: (0, import_portal.resolveViewZIndex)(props.zIndex),
|
|
126
|
-
children
|
|
127
|
-
}), adjustPaddingForOffscreenContent && /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_core.Stack, {
|
|
128
|
-
"data-sheet-offscreen-pad": !0,
|
|
129
|
-
height: offscreenSize,
|
|
130
|
-
width: "100%"
|
|
131
|
-
})]
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
}), SheetOverlay = Overlay.extractable(/* @__PURE__ */ memo(function(propsIn) {
|
|
35
|
+
var { __scopeSheet, ...props } = propsIn, context = useSheetContext(SHEET_OVERLAY_NAME, __scopeSheet), element = useMemo(function() {
|
|
36
|
+
return (
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
/* @__PURE__ */ _jsx(Overlay, {
|
|
39
|
+
...props,
|
|
40
|
+
onPress: composeEventHandlers(props.onPress, context.dismissOnOverlayPress ? function() {
|
|
41
|
+
context.setOpen(!1);
|
|
42
|
+
} : void 0)
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
}, [
|
|
46
|
+
props.onPress,
|
|
47
|
+
props.opacity,
|
|
48
|
+
context.dismissOnOverlayPress
|
|
49
|
+
]);
|
|
50
|
+
return useIsomorphicLayoutEffect(function() {
|
|
51
|
+
var _context_onOverlayComponent;
|
|
52
|
+
(_context_onOverlayComponent = context.onOverlayComponent) === null || _context_onOverlayComponent === void 0 || _context_onOverlayComponent.call(context, element);
|
|
53
|
+
}, [
|
|
54
|
+
element
|
|
55
|
+
]), context.onlyShowFrame, null;
|
|
56
|
+
})), SheetFrame = Frame.extractable(/* @__PURE__ */ forwardRef(function(param2, forwardedRef) {
|
|
57
|
+
var { __scopeSheet, adjustPaddingForOffscreenContent, disableHideBottomOverflow, children, ...props } = param2, context = useSheetContext(SHEET_NAME, __scopeSheet), { hasFit, removeScrollEnabled = !0, frameSize, contentRef, open } = context, composedContentRef = useComposedRefs(forwardedRef, contentRef), offscreenSize = useSheetOffscreenSize(context), sheetContents = useMemo(function() {
|
|
58
|
+
return (
|
|
59
|
+
// @ts-expect-error
|
|
60
|
+
/* @__PURE__ */ _jsxs(Frame, {
|
|
61
|
+
ref: composedContentRef,
|
|
62
|
+
flex: hasFit ? 0 : 1,
|
|
63
|
+
height: hasFit ? void 0 : frameSize,
|
|
64
|
+
pointerEvents: open ? "auto" : "none",
|
|
65
|
+
...props,
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ _jsx(StackZIndexContext, {
|
|
68
|
+
zIndex: resolveViewZIndex(props.zIndex),
|
|
69
|
+
children
|
|
70
|
+
}),
|
|
71
|
+
adjustPaddingForOffscreenContent && /* @__PURE__ */ _jsx(Stack, {
|
|
72
|
+
"data-sheet-offscreen-pad": !0,
|
|
73
|
+
height: offscreenSize,
|
|
74
|
+
width: "100%"
|
|
132
75
|
})
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
76
|
+
]
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
}, [
|
|
80
|
+
open,
|
|
81
|
+
props,
|
|
82
|
+
frameSize,
|
|
83
|
+
offscreenSize,
|
|
84
|
+
adjustPaddingForOffscreenContent,
|
|
85
|
+
hasFit
|
|
86
|
+
]);
|
|
87
|
+
return /* @__PURE__ */ _jsxs(_Fragment, {
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ _jsx(RemoveScroll, {
|
|
137
90
|
enabled: removeScrollEnabled && context.open,
|
|
138
91
|
children: sheetContents
|
|
139
|
-
}),
|
|
140
|
-
|
|
141
|
-
// @ts-ignore
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
(0, import_jsx_runtime.jsx)(Frame, {
|
|
92
|
+
}),
|
|
93
|
+
/* below frame hide when bouncing past 100% */
|
|
94
|
+
!disableHideBottomOverflow && // @ts-ignore
|
|
95
|
+
/* @__PURE__ */ _jsx(Frame, {
|
|
144
96
|
...props,
|
|
145
97
|
"data-testid": "ensure-sheet-cover-not-overlapping",
|
|
146
98
|
componentName: "SheetCover",
|
|
@@ -155,34 +107,31 @@ function createSheet(param) {
|
|
|
155
107
|
borderWidth: 0,
|
|
156
108
|
borderRadius: 0,
|
|
157
109
|
shadowOpacity: 0
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
Overlay: SheetOverlay,
|
|
179
|
-
Handle: SheetHandle,
|
|
180
|
-
ScrollView: import_SheetScrollView.SheetScrollView
|
|
181
|
-
},
|
|
182
|
-
Controlled = (0, import_helpers.withStaticProperties)(Sheet, components);
|
|
183
|
-
return (0, import_helpers.withStaticProperties)(Sheet, {
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
})), Sheet = /* @__PURE__ */ forwardRef(function(props, ref) {
|
|
114
|
+
var hydrated = useDidFinishSSR(), { isShowingNonSheet } = useSheetController(), SheetImplementation = SheetImplementationCustom;
|
|
115
|
+
if (props.native && Platform.OS === "ios") {
|
|
116
|
+
var impl = getNativeSheet("ios");
|
|
117
|
+
impl && (SheetImplementation = impl);
|
|
118
|
+
}
|
|
119
|
+
return isShowingNonSheet || !hydrated ? null : /* @__PURE__ */ _jsx(SheetImplementation, {
|
|
120
|
+
ref,
|
|
121
|
+
...props
|
|
122
|
+
});
|
|
123
|
+
}), components = {
|
|
124
|
+
Frame: SheetFrame,
|
|
125
|
+
Overlay: SheetOverlay,
|
|
126
|
+
Handle: SheetHandle,
|
|
127
|
+
ScrollView: SheetScrollView
|
|
128
|
+
}, Controlled = withStaticProperties(Sheet, components);
|
|
129
|
+
return withStaticProperties(Sheet, {
|
|
184
130
|
...components,
|
|
185
131
|
Controlled
|
|
186
132
|
});
|
|
187
133
|
}
|
|
188
|
-
|
|
134
|
+
export {
|
|
135
|
+
createSheet
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=createSheet.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/createSheet.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,OAAO,MAAM,QAAQ,OAAO,YAAY,iBAAiB;AAClE,SAAS,uBAAuB;AAChC,SAAS,iCAAiC;AAC1C,SAAS,aAAa;AACtB,SAAS,sBAAsB,4BAA4B;AAC3D,SAAS,yBAAyB;AAClC,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,YAAY,MAAM,eAAe;AAC1C,SAAS,gBAAgB;AACzB,SAAS,mBAAmB,YAAY,0BAA0B;AAClE,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,iCAAiC;AAC1C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AAC/B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AA,IACJ,CAAC;AAAA,EACL,CAAC,CAAC,GACE,QAAsB,2BAAW,SAAe,OAAO,KAAK;AAC5D,QAAI,WAAW,gBAAgB,GAC3B,EAAE,kBAAkB,IAAI,mBAAmB,GAC3C,sBAAsB;AAC1B,QAAI,MAAM,UAAU,SAAS,OAAO,OAAO;AAEnC,UAAI,OAAO,eAAe,KAAK;AAC/B,MAAI,SAEA,sBAAsB;AAAA,IAGlC;AAGA,WAAI,qBAAqB,CAAC,WACf,OAEU,qBAAK,qBAAqB;AAAA,MAC3C;AAAA,MACA,GAAG;AAAA,IACP,CAAC;AAAA,EACL,CAAC,GACG,aAAa;AAAA,IACb,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,EAChB,GACI,aAAa,qBAAqB,OAAO,UAAU;AACvD,SAAO,qBAAqB,OAAO;AAAA,IAC/B,GAAG;AAAA,IACH;AAAA,EACJ,CAAC;AACL;",
|
|
5
|
+
"names": ["param"]
|
|
6
|
+
}
|
|
@@ -1,35 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all) __defProp(target, name, {
|
|
9
|
-
get: all[name],
|
|
10
|
-
enumerable: !0
|
|
11
|
-
});
|
|
12
|
-
},
|
|
13
|
-
__copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
-
get: () => from[key],
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
23
|
-
var helpers_exports = {};
|
|
24
|
-
__export(helpers_exports, {
|
|
25
|
-
resisted: () => resisted
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(helpers_exports);
|
|
28
1
|
function resisted(y, minY) {
|
|
29
2
|
var maxOverflow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 25;
|
|
30
|
-
if (y >= minY)
|
|
31
|
-
|
|
32
|
-
|
|
3
|
+
if (y >= minY)
|
|
4
|
+
return y;
|
|
5
|
+
var pastBoundary = minY - y, resistedDistance = Math.sqrt(pastBoundary) * 2;
|
|
33
6
|
return minY - resistedDistance;
|
|
34
7
|
}
|
|
35
|
-
|
|
8
|
+
export {
|
|
9
|
+
resisted
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/helpers.tsx"],
|
|
4
|
+
"mappings": "AAAO,SAAS,SAAS,GAAG,MAAM;AAC9B,MAAI,cAAc,UAAU,SAAS,KAAK,UAAU,CAAC,MAAM,SAAS,UAAU,CAAC,IAAI;AAEnF,MAAI,KAAK;AACL,WAAO;AAGX,MAAI,eAAe,OAAO,GAItB,mBAAmB,KAAK,KAAK,YAAY,IAAI;AAEjD,SAAO,OAAO;AAClB;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/jsx/index.native.js
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
-
value: !0
|
|
17
|
-
}), mod);
|
|
18
|
-
var index_exports = {};
|
|
19
|
-
module.exports = __toCommonJS(index_exports);
|
|
20
|
-
__reExport(index_exports, require("./Sheet.native.js"), module.exports);
|
|
21
|
-
__reExport(index_exports, require("./useSheet.native.js"), module.exports);
|
|
22
|
-
__reExport(index_exports, require("./createSheet.native.js"), module.exports);
|
|
23
|
-
__reExport(index_exports, require("./SheetController.native.js"), module.exports);
|
|
24
|
-
__reExport(index_exports, require("./useSheetController.native.js"), module.exports);
|
|
25
|
-
__reExport(index_exports, require("./useSheetOpenState.native.js"), module.exports);
|
|
26
|
-
__reExport(index_exports, require("./useSheetOffscreenSize.native.js"), module.exports);
|
|
27
|
-
__reExport(index_exports, require("./SheetScrollView.native.js"), module.exports);
|
|
28
|
-
__reExport(index_exports, require("./nativeSheet.native.js"), module.exports);
|
|
29
|
-
__reExport(index_exports, require("./types.native.js"), module.exports);
|
|
30
|
-
__reExport(index_exports, require("./contexts.native.js"), module.exports);
|
|
31
|
-
//# sourceMappingURL=index.native.js.map
|
|
1
|
+
export * from "./Sheet";
|
|
2
|
+
export * from "./useSheet";
|
|
3
|
+
export * from "./createSheet";
|
|
4
|
+
export * from "./SheetController";
|
|
5
|
+
export * from "./useSheetController";
|
|
6
|
+
export * from "./useSheetOpenState";
|
|
7
|
+
export * from "./useSheetOffscreenSize";
|
|
8
|
+
export * from "./SheetScrollView";
|
|
9
|
+
export * from "./nativeSheet";
|
|
10
|
+
export * from "./types";
|
|
11
|
+
export * from "./contexts";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,58 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
});
|
|
12
|
-
},
|
|
13
|
-
__copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
-
get: () => from[key],
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
21
|
-
value: !0
|
|
22
|
-
}), mod);
|
|
23
|
-
var nativeSheet_exports = {};
|
|
24
|
-
__export(nativeSheet_exports, {
|
|
25
|
-
getNativeSheet: () => getNativeSheet,
|
|
26
|
-
setupNativeSheet: () => setupNativeSheet
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(nativeSheet_exports);
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
30
|
-
import_stacks = require("@tamagui/stacks"),
|
|
31
|
-
import_react = require("react"),
|
|
32
|
-
import_react_native = require("react-native"),
|
|
33
|
-
import_SheetContext = require("./SheetContext.native.js"),
|
|
34
|
-
import_useSheetOpenState = require("./useSheetOpenState.native.js"),
|
|
35
|
-
import_useSheetProviderProps = require("./useSheetProviderProps.native.js"),
|
|
36
|
-
nativeSheets = {
|
|
37
|
-
ios: null
|
|
38
|
-
};
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { YStack } from "@tamagui/stacks";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
import { SheetProvider } from "./SheetContext";
|
|
6
|
+
import { useSheetOpenState } from "./useSheetOpenState";
|
|
7
|
+
import { useSheetProviderProps } from "./useSheetProviderProps";
|
|
8
|
+
var nativeSheets = {
|
|
9
|
+
ios: null
|
|
10
|
+
};
|
|
39
11
|
function getNativeSheet(platform) {
|
|
40
12
|
return nativeSheets[platform];
|
|
41
13
|
}
|
|
42
14
|
function setupNativeSheet(platform, RNIOSModal) {
|
|
43
|
-
var {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
platform === "ios" && (nativeSheets[platform] = function (props) {
|
|
48
|
-
var state = (0, import_useSheetOpenState.useSheetOpenState)(props),
|
|
49
|
-
providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state),
|
|
50
|
-
{
|
|
51
|
-
open,
|
|
52
|
-
setOpen
|
|
53
|
-
} = state,
|
|
54
|
-
ref = (0, import_react.useRef)(void 0);
|
|
55
|
-
(0, import_react.useEffect)(function () {
|
|
15
|
+
var { ModalSheetView, ModalSheetViewMainContent } = RNIOSModal;
|
|
16
|
+
platform === "ios" && (nativeSheets[platform] = function(props) {
|
|
17
|
+
var state = useSheetOpenState(props), providerProps = useSheetProviderProps(props, state), { open, setOpen } = state, ref = useRef(void 0);
|
|
18
|
+
useEffect(function() {
|
|
56
19
|
if (open) {
|
|
57
20
|
var _ref_current;
|
|
58
21
|
(_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.presentModal();
|
|
@@ -60,42 +23,52 @@ function setupNativeSheet(platform, RNIOSModal) {
|
|
|
60
23
|
var _ref_current1;
|
|
61
24
|
(_ref_current1 = ref.current) === null || _ref_current1 === void 0 || _ref_current1.dismissModal();
|
|
62
25
|
}
|
|
63
|
-
}, [
|
|
26
|
+
}, [
|
|
27
|
+
open
|
|
28
|
+
]);
|
|
64
29
|
function setOpenInternal(next) {
|
|
65
30
|
var _props_onOpenChange;
|
|
66
31
|
(_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 || _props_onOpenChange.call(props, open), setOpen(next);
|
|
67
32
|
}
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
children: /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ _jsx(_Fragment, {
|
|
34
|
+
children: /* @__PURE__ */ _jsxs(SheetProvider, {
|
|
70
35
|
setHasScrollView: emptyFn,
|
|
71
36
|
...providerProps,
|
|
72
37
|
onlyShowFrame: !0,
|
|
73
|
-
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ _jsx(ModalSheetView, {
|
|
40
|
+
ref,
|
|
41
|
+
onModalDidDismiss: function() {
|
|
42
|
+
return setOpenInternal(!1);
|
|
43
|
+
},
|
|
44
|
+
children: /* @__PURE__ */ _jsx(ModalSheetViewMainContent, {
|
|
45
|
+
children: /* @__PURE__ */ _jsx(View, {
|
|
46
|
+
style: {
|
|
47
|
+
flex: 1
|
|
48
|
+
},
|
|
49
|
+
children: props.children
|
|
50
|
+
})
|
|
84
51
|
})
|
|
52
|
+
}),
|
|
53
|
+
/* for some reason select triggers wont show on native if this isn't inside the actual tree not inside implementation... */
|
|
54
|
+
/* so just hiding it here for now... not great... */
|
|
55
|
+
/* @__PURE__ */ _jsx(YStack, {
|
|
56
|
+
position: "absolute",
|
|
57
|
+
opacity: 0,
|
|
58
|
+
pointerEvents: "none",
|
|
59
|
+
width: 0,
|
|
60
|
+
height: 0,
|
|
61
|
+
children: props.children
|
|
85
62
|
})
|
|
86
|
-
|
|
87
|
-
/* so just hiding it here for now... not great... */
|
|
88
|
-
/* @__PURE__ */(0, import_jsx_runtime.jsx)(import_stacks.YStack, {
|
|
89
|
-
position: "absolute",
|
|
90
|
-
opacity: 0,
|
|
91
|
-
pointerEvents: "none",
|
|
92
|
-
width: 0,
|
|
93
|
-
height: 0,
|
|
94
|
-
children: props.children
|
|
95
|
-
})]
|
|
63
|
+
]
|
|
96
64
|
})
|
|
97
65
|
});
|
|
98
66
|
});
|
|
99
67
|
}
|
|
100
|
-
var emptyFn = function
|
|
101
|
-
|
|
68
|
+
var emptyFn = function() {
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
getNativeSheet,
|
|
72
|
+
setupNativeSheet
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=nativeSheet.js.map
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/nativeSheet.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,OAAO,MAAM,QAAQ,OAAO,YAAY,iBAAiB;AAClE,SAAS,cAAc;AACvB,SAAS,WAAW,cAAc;AAClC,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AAEtC,IAAI,eAAe;AAAA,EACf,KAAK;AACT;AACO,SAAS,eAAe,UAAU;AACrC,SAAO,aAAa,QAAQ;AAChC;AACO,SAAS,iBAAiB,UAAU,YAAY;AACnD,MAAI,EAAE,gBAAgB,0BAA0B,IAAI;AACpD,EAAI,aAAa,UACb,aAAa,QAAQ,IAAI,SAAS,OAAO;AACrC,QAAI,QAAQ,kBAAkB,KAAK,GAC/B,gBAAgB,sBAAsB,OAAO,KAAK,GAGlD,EAAE,MAAM,QAAQ,IAAI,OACpB,MAAM,OAAO,MAAS;AAC1B,cAAU,WAAW;AACjB,UAAI,MAAM;AACN,YAAI;AACJ,SAAC,eAAe,IAAI,aAAa,QAAQ,iBAAiB,UAAkB,aAAa,aAAa;AAAA,MAC1G,OAAO;AACH,YAAI;AACJ,SAAC,gBAAgB,IAAI,aAAa,QAAQ,kBAAkB,UAAkB,cAAc,aAAa;AAAA,MAC7G;AAAA,IACJ,GAAG;AAAA,MACC;AAAA,IACJ,CAAC;AACD,aAAS,gBAAgB,MAAM;AAC3B,UAAI;AACJ,OAAC,sBAAsB,MAAM,kBAAkB,QAAQ,wBAAwB,UAAkB,oBAAoB,KAAK,OAAO,IAAI,GACrI,QAAQ,IAAI;AAAA,IAChB;AAMA,WAAqB,qBAAK,WAAW;AAAA,MACjC,UAAwB,sBAAM,eAAe;AAAA,QACzC,kBAAkB;AAAA,QAClB,GAAG;AAAA,QACH,eAAe;AAAA,QACf,UAAU;AAAA,UACQ,qBAAK,gBAAgB;AAAA,YAC/B;AAAA,YACA,mBAAmB,WAAW;AAC1B,qBAAO,gBAAgB,EAAK;AAAA,YAChC;AAAA,YACA,UAAwB,qBAAK,2BAA2B;AAAA,cACpD,UAAwB,qBAAK,MAAM;AAAA,gBAC/B,OAAO;AAAA,kBACH,MAAM;AAAA,gBACV;AAAA,gBACA,UAAU,MAAM;AAAA,cACpB,CAAC;AAAA,YACL,CAAC;AAAA,UACL,CAAC;AAAA;AAAA;AAAA,UAC8L,qBAAK,QAAQ;AAAA,YACxM,UAAU;AAAA,YACV,SAAS;AAAA,YACT,eAAe;AAAA,YACf,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,UAAU,MAAM;AAAA,UACpB,CAAC;AAAA,QACL;AAAA,MACJ,CAAC;AAAA,IACL,CAAC;AAAA,EACL;AAER;AACA,IAAI,UAAU,WAAW;AAAC;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/jsx/types.native.js
CHANGED
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __copyProps = (to, from, except, desc) => {
|
|
8
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
9
|
-
get: () => from[key],
|
|
10
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
-
});
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
15
|
-
value: !0
|
|
16
|
-
}), mod);
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
19
|
-
//# sourceMappingURL=types.native.js.map
|
|
1
|
+
//# sourceMappingURL=types.js.map
|