@tamagui/sheet 1.88.22 → 1.88.23
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/esm/Sheet.native.js +16 -40
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetContext.native.js +6 -29
- package/dist/esm/SheetContext.native.js.map +1 -1
- package/dist/esm/SheetController.native.js +8 -26
- package/dist/esm/SheetController.native.js.map +1 -1
- package/dist/esm/SheetImplementationCustom.native.js +75 -65
- package/dist/esm/SheetImplementationCustom.native.js.map +2 -2
- package/dist/esm/SheetScrollView.native.js +13 -30
- package/dist/esm/SheetScrollView.native.js.map +1 -1
- package/dist/esm/constants.native.js +4 -29
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/contexts.native.js +5 -27
- package/dist/esm/contexts.native.js.map +1 -1
- package/dist/esm/createSheet.native.js +55 -61
- package/dist/esm/createSheet.native.js.map +2 -2
- package/dist/esm/helpers.native.js +2 -23
- package/dist/esm/helpers.native.js.map +1 -1
- package/dist/esm/index.native.js +9 -35
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/nativeSheet.native.js +15 -31
- package/dist/esm/nativeSheet.native.js.map +1 -1
- package/dist/esm/types.native.js +0 -14
- package/dist/esm/types.native.js.map +2 -2
- package/dist/esm/useSheet.native.js +4 -25
- package/dist/esm/useSheet.native.js.map +1 -1
- package/dist/esm/useSheetController.native.js +5 -27
- package/dist/esm/useSheetController.native.js.map +1 -1
- package/dist/esm/useSheetOffscreenSize.native.js +2 -23
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/esm/useSheetOpenState.native.js +6 -26
- package/dist/esm/useSheetOpenState.native.js.map +1 -1
- package/dist/esm/useSheetProviderProps.native.js +12 -38
- package/dist/esm/useSheetProviderProps.native.js.map +2 -2
- package/dist/jsx/Sheet.native.js +16 -40
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetContext.native.js +6 -29
- package/dist/jsx/SheetContext.native.js.map +1 -1
- package/dist/jsx/SheetController.native.js +8 -26
- package/dist/jsx/SheetController.native.js.map +1 -1
- package/dist/jsx/SheetImplementationCustom.native.js +75 -65
- package/dist/jsx/SheetImplementationCustom.native.js.map +2 -2
- package/dist/jsx/SheetScrollView.native.js +13 -30
- package/dist/jsx/SheetScrollView.native.js.map +1 -1
- package/dist/jsx/constants.native.js +4 -29
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/contexts.native.js +5 -27
- package/dist/jsx/contexts.native.js.map +1 -1
- package/dist/jsx/createSheet.native.js +55 -61
- package/dist/jsx/createSheet.native.js.map +2 -2
- package/dist/jsx/helpers.native.js +2 -23
- package/dist/jsx/helpers.native.js.map +1 -1
- package/dist/jsx/index.native.js +9 -35
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/nativeSheet.native.js +15 -31
- package/dist/jsx/nativeSheet.native.js.map +1 -1
- package/dist/jsx/types.native.js +0 -14
- package/dist/jsx/types.native.js.map +2 -2
- package/dist/jsx/useSheet.native.js +4 -25
- package/dist/jsx/useSheet.native.js.map +1 -1
- package/dist/jsx/useSheetController.native.js +5 -27
- package/dist/jsx/useSheetController.native.js.map +1 -1
- package/dist/jsx/useSheetOffscreenSize.native.js +2 -23
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/jsx/useSheetOpenState.native.js +6 -26
- package/dist/jsx/useSheetOpenState.native.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.native.js +12 -38
- package/dist/jsx/useSheetProviderProps.native.js.map +2 -2
- package/package.json +16 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SheetScrollView.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,mBAAmB;AAG5B,SAAS,kBAAkB;AAC3B,SAAS,YAAY,SAAS,cAAc;AAG5C,SAAS,uBAAuB;AAgE1B;AAvDN,MAAM,yBAAyB,mBAElB,kBAAkB;AAAA,EAC7B,CACE,EAAE,cAAc,UAAU,UAAU,GAAG,MAAM,GAC7C,QACG;AACH,UAAM,UAAU,gBAAgB,wBAAwB,YAAY,GAC9D,EAAE,aAAa,IAAI,SAEnB,YAAY,OAA4B,IAAI,GAc5C,QAAQ,OAAO;AAAA,MACnB,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,KAAK,CAAC;AAAA;AAAA,MACN,aAAa;AAAA,MACb,YAAY;AAAA,IACd,CAAC,GAEK,UAAU,MAAM;AACpB,UAAI,CAAC,MAAM,QAAQ;AACjB;AAEF,YAAM,QAAQ,aAAa,IAC3B,aAAa,eAAe,IAC5B,MAAM,QAAQ,cAAc;AAE5B,UAAI,KAAK;AACT,UAAI,MAAM,QAAQ,IAAI,QAAQ;AAC5B,cAAM,YAAY,MAAM,QAAQ,IAAI,MAAM,GAAG;AAG7C,cAFa,UAAU,SAAS,UAAU,OAAO,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,IAAI,KAClD,UAAU,SAClB;AAAA,MACf;AACA,YAAM,QAAQ,MAAM,CAAC,GACrB,aAAa,QAAQ;AAAA,QACnB,QAAQ,MAAM,QAAQ;AAAA,QACtB;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,KAAK,YAAY,WAAkB,GAAG;AAAA,QACtC,MAAM;AAAA,QACN,qBAAqB;AAAA,QAErB,UAAU,CAAC,MAAM;AACf,gBAAM,EAAE,EAAE,IAAI,EAAE,YAAY;AAC5B,uBAAa,IAAI,GACb,IAAI,MACN,aAAa,eAAe,KAI9B,6BAAW;AAAA,QASb;AAAA,QACA,2BAA2B,OACzB,aAAa,eAAe,IAC5B,MAAM,QAAQ,aAAa,IACpB;AAAA,QAGT,0BAA0B,MAAM;AAAA,QAmChC,oBAAoB;AAAA,QACpB,WAAU;AAAA,QACT,GAAG;AAAA,QAEH,kBAAQ,MAAM,UAAU,CAAC,QAAQ,CAAC;AAAA;AAAA,IACrC;AAAA,EAEJ;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var constants_exports = {};
|
|
17
|
-
__export(constants_exports, {
|
|
18
|
-
SHEET_HANDLE_NAME: () => SHEET_HANDLE_NAME,
|
|
19
|
-
SHEET_HIDDEN_STYLESHEET: () => SHEET_HIDDEN_STYLESHEET,
|
|
20
|
-
SHEET_NAME: () => SHEET_NAME,
|
|
21
|
-
SHEET_OVERLAY_NAME: () => SHEET_OVERLAY_NAME,
|
|
22
|
-
constants: () => constants
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(constants_exports);
|
|
25
|
-
var import_core = require("@tamagui/core");
|
|
26
|
-
const constants = {}, SHEET_NAME = "Sheet", SHEET_HANDLE_NAME = "SheetHandle", SHEET_OVERLAY_NAME = "SheetOverlay", SHEET_HIDDEN_STYLESHEET = import_core.isClient ? document.createElement("style") : null;
|
|
1
|
+
import { isClient } from "@tamagui/core";
|
|
2
|
+
const constants = {}, SHEET_NAME = "Sheet", SHEET_HANDLE_NAME = "SheetHandle", SHEET_OVERLAY_NAME = "SheetOverlay", SHEET_HIDDEN_STYLESHEET = isClient ? document.createElement("style") : null;
|
|
27
3
|
SHEET_HIDDEN_STYLESHEET && document.head.appendChild(SHEET_HIDDEN_STYLESHEET);
|
|
28
|
-
|
|
29
|
-
0 && (module.exports = {
|
|
4
|
+
export {
|
|
30
5
|
SHEET_HANDLE_NAME,
|
|
31
6
|
SHEET_HIDDEN_STYLESHEET,
|
|
32
7
|
SHEET_NAME,
|
|
33
8
|
SHEET_OVERLAY_NAME,
|
|
34
9
|
constants
|
|
35
|
-
}
|
|
10
|
+
};
|
|
36
11
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,gBAAgB;AAElB,MAAM,YAAY,CAAC,GAEb,aAAa,SACb,oBAAoB,eACpB,qBAAqB,gBAErB,0BAA0B,WAAW,SAAS,cAAc,OAAO,IAAI;AAChF,2BACF,SAAS,KAAK,YAAY,uBAAuB;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,31 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var contexts_exports = {};
|
|
17
|
-
__export(contexts_exports, {
|
|
18
|
-
ParentSheetContext: () => ParentSheetContext,
|
|
19
|
-
SheetInsideSheetContext: () => SheetInsideSheetContext
|
|
20
|
-
});
|
|
21
|
-
module.exports = __toCommonJS(contexts_exports);
|
|
22
|
-
var import_react = require("react");
|
|
23
|
-
const ParentSheetContext = (0, import_react.createContext)({
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
const ParentSheetContext = createContext({
|
|
24
3
|
zIndex: 1e5
|
|
25
|
-
}), SheetInsideSheetContext =
|
|
26
|
-
|
|
27
|
-
0 && (module.exports = {
|
|
4
|
+
}), SheetInsideSheetContext = createContext(null);
|
|
5
|
+
export {
|
|
28
6
|
ParentSheetContext,
|
|
29
7
|
SheetInsideSheetContext
|
|
30
|
-
}
|
|
8
|
+
};
|
|
31
9
|
//# sourceMappingURL=contexts.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/contexts.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAEvB,MAAM,qBAAqB,cAAc;AAAA,EAC9C,QAAQ;AACV,CAAC,GAEY,0BAA0B,cAErC,IAAI;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,54 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
__export(createSheet_exports, {
|
|
18
|
-
createSheet: () => createSheet
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(createSheet_exports);
|
|
21
|
-
var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_remove_scroll = require("@tamagui/remove-scroll"), import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr"), import_react = require("react"), import_react_native = require("react-native"), import_constants2 = require("./constants"), import_nativeSheet = require("./nativeSheet"), import_SheetContext = require("./SheetContext"), import_SheetImplementationCustom = require("./SheetImplementationCustom"), import_SheetScrollView = require("./SheetScrollView"), import_useSheetController = require("./useSheetController"), import_useSheetOffscreenSize = require("./useSheetOffscreenSize"), import_jsx_runtime = (
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
require("react/jsx-runtime")
|
|
24
|
-
);
|
|
1
|
+
import { useComposedRefs } from "@tamagui/compose-refs";
|
|
2
|
+
import { useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
3
|
+
import { Stack } from "@tamagui/core";
|
|
4
|
+
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
|
|
5
|
+
import { RemoveScroll } from "@tamagui/remove-scroll";
|
|
6
|
+
import { useDidFinishSSR } from "@tamagui/use-did-finish-ssr";
|
|
7
|
+
import { forwardRef, memo, useMemo } from "react";
|
|
8
|
+
import { Platform } from "react-native";
|
|
9
|
+
import { SHEET_HANDLE_NAME, SHEET_NAME, SHEET_OVERLAY_NAME } from "./constants";
|
|
10
|
+
import { getNativeSheet } from "./nativeSheet";
|
|
11
|
+
import { useSheetContext } from "./SheetContext";
|
|
12
|
+
import { SheetImplementationCustom } from "./SheetImplementationCustom";
|
|
13
|
+
import { SheetScrollView } from "./SheetScrollView";
|
|
14
|
+
import { useSheetController } from "./useSheetController";
|
|
15
|
+
import { useSheetOffscreenSize } from "./useSheetOffscreenSize";
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
25
17
|
function createSheet({ Handle, Frame, Overlay }) {
|
|
26
18
|
const SheetHandle = Handle.styleable(
|
|
27
19
|
({ __scopeSheet, ...props }, forwardedRef) => {
|
|
28
|
-
const context =
|
|
29
|
-
return context.onlyShowFrame ? null :
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
const context = useSheetContext(SHEET_HANDLE_NAME, __scopeSheet), composedRef = useComposedRefs(context.handleRef, forwardedRef);
|
|
21
|
+
return context.onlyShowFrame ? null : (
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
/* @__PURE__ */ jsx(
|
|
24
|
+
Handle,
|
|
25
|
+
{
|
|
26
|
+
ref: composedRef,
|
|
27
|
+
onPress: () => {
|
|
28
|
+
const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0), nextPos = (context.position + 1) % max;
|
|
29
|
+
context.setPosition(nextPos);
|
|
30
|
+
},
|
|
31
|
+
open: context.open,
|
|
32
|
+
...props
|
|
33
|
+
}
|
|
34
|
+
)
|
|
40
35
|
);
|
|
41
36
|
}
|
|
42
37
|
), SheetOverlay = Overlay.extractable(
|
|
43
|
-
|
|
44
|
-
const { __scopeSheet, ...props } = propsIn, context =
|
|
38
|
+
memo((propsIn) => {
|
|
39
|
+
const { __scopeSheet, ...props } = propsIn, context = useSheetContext(SHEET_OVERLAY_NAME, __scopeSheet), element = useMemo(
|
|
45
40
|
() => (
|
|
46
41
|
// @ts-ignore
|
|
47
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
48
43
|
Overlay,
|
|
49
44
|
{
|
|
50
45
|
...props,
|
|
51
|
-
onPress:
|
|
46
|
+
onPress: composeEventHandlers(
|
|
52
47
|
props.onPress,
|
|
53
48
|
context.dismissOnOverlayPress ? () => {
|
|
54
49
|
context.setOpen(!1);
|
|
@@ -59,13 +54,13 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
59
54
|
),
|
|
60
55
|
[props.onPress, context.dismissOnOverlayPress]
|
|
61
56
|
);
|
|
62
|
-
return
|
|
57
|
+
return useIsomorphicLayoutEffect(() => {
|
|
63
58
|
var _a;
|
|
64
59
|
(_a = context.onOverlayComponent) == null || _a.call(context, element);
|
|
65
60
|
}, [element]), context.onlyShowFrame, null;
|
|
66
61
|
})
|
|
67
62
|
), SheetFrame = Frame.extractable(
|
|
68
|
-
|
|
63
|
+
forwardRef(
|
|
69
64
|
({
|
|
70
65
|
__scopeSheet,
|
|
71
66
|
adjustPaddingForOffscreenContent,
|
|
@@ -73,9 +68,9 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
73
68
|
children,
|
|
74
69
|
...props
|
|
75
70
|
}, forwardedRef) => {
|
|
76
|
-
const context =
|
|
71
|
+
const context = useSheetContext(SHEET_NAME, __scopeSheet), { hasFit, removeScrollEnabled, frameSize, contentRef } = context, composedContentRef = useComposedRefs(forwardedRef, contentRef), offscreenSize = useSheetOffscreenSize(context), sheetContents = useMemo(() => (
|
|
77
72
|
// @ts-ignore
|
|
78
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ jsxs(
|
|
79
74
|
Frame,
|
|
80
75
|
{
|
|
81
76
|
ref: composedContentRef,
|
|
@@ -84,14 +79,14 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
84
79
|
...props,
|
|
85
80
|
children: [
|
|
86
81
|
children,
|
|
87
|
-
adjustPaddingForOffscreenContent && /* @__PURE__ */
|
|
82
|
+
adjustPaddingForOffscreenContent && /* @__PURE__ */ jsx(Stack, { "data-sheet-offscreen-pad": !0, height: offscreenSize, width: "100%" })
|
|
88
83
|
]
|
|
89
84
|
}
|
|
90
85
|
)
|
|
91
86
|
), [props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
87
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
RemoveScroll,
|
|
95
90
|
{
|
|
96
91
|
forwardProps: !0,
|
|
97
92
|
enabled: removeScrollEnabled,
|
|
@@ -102,7 +97,7 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
102
97
|
}
|
|
103
98
|
),
|
|
104
99
|
!disableHideBottomOverflow && // @ts-ignore
|
|
105
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ jsx(
|
|
106
101
|
Frame,
|
|
107
102
|
{
|
|
108
103
|
...props,
|
|
@@ -122,27 +117,26 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
122
117
|
] });
|
|
123
118
|
}
|
|
124
119
|
)
|
|
125
|
-
), Sheet =
|
|
126
|
-
const hydrated =
|
|
127
|
-
let SheetImplementation =
|
|
128
|
-
if (props.native &&
|
|
129
|
-
const impl =
|
|
120
|
+
), Sheet = forwardRef(function(props, ref) {
|
|
121
|
+
const hydrated = useDidFinishSSR(), { isShowingNonSheet } = useSheetController();
|
|
122
|
+
let SheetImplementation = SheetImplementationCustom;
|
|
123
|
+
if (props.native && Platform.OS === "ios") {
|
|
124
|
+
const impl = getNativeSheet("ios");
|
|
130
125
|
impl && (SheetImplementation = impl);
|
|
131
126
|
}
|
|
132
|
-
return isShowingNonSheet || !hydrated ? null : /* @__PURE__ */
|
|
127
|
+
return isShowingNonSheet || !hydrated ? null : /* @__PURE__ */ jsx(SheetImplementation, { ref, ...props });
|
|
133
128
|
}), components = {
|
|
134
129
|
Frame: SheetFrame,
|
|
135
130
|
Overlay: SheetOverlay,
|
|
136
131
|
Handle: SheetHandle,
|
|
137
|
-
ScrollView:
|
|
138
|
-
}, Controlled =
|
|
139
|
-
return
|
|
132
|
+
ScrollView: SheetScrollView
|
|
133
|
+
}, Controlled = withStaticProperties(Sheet, components);
|
|
134
|
+
return withStaticProperties(Sheet, {
|
|
140
135
|
...components,
|
|
141
136
|
Controlled
|
|
142
137
|
});
|
|
143
138
|
}
|
|
144
|
-
|
|
145
|
-
0 && (module.exports = {
|
|
139
|
+
export {
|
|
146
140
|
createSheet
|
|
147
|
-
}
|
|
141
|
+
};
|
|
148
142
|
//# sourceMappingURL=createSheet.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createSheet.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
4
|
+
"mappings": "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",
|
|
5
|
+
"names": []
|
|
6
6
|
}
|
|
@@ -1,23 +1,3 @@
|
|
|
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: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var helpers_exports = {};
|
|
17
|
-
__export(helpers_exports, {
|
|
18
|
-
resisted: () => resisted
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(helpers_exports);
|
|
21
1
|
function resisted(y, minY, maxOverflow = 25) {
|
|
22
2
|
if (y < minY) {
|
|
23
3
|
const past = minY - y, extra = -(1.1 - 0.15 ** (Math.min(maxOverflow, past) / maxOverflow)) * maxOverflow;
|
|
@@ -25,8 +5,7 @@ function resisted(y, minY, maxOverflow = 25) {
|
|
|
25
5
|
}
|
|
26
6
|
return y;
|
|
27
7
|
}
|
|
28
|
-
|
|
29
|
-
0 && (module.exports = {
|
|
8
|
+
export {
|
|
30
9
|
resisted
|
|
31
|
-
}
|
|
10
|
+
};
|
|
32
11
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAO,SAAS,SAAS,GAAW,MAAc,cAAc,IAAI;AAClE,MAAI,IAAI,MAAM;AACZ,UAAM,OAAO,OAAO,GAGd,QAAQ,EADK,MAAM,SADT,KAAK,IAAI,aAAa,IAAI,IAAI,gBAElB;AAC5B,WAAO,OAAO;AAAA,EAChB;AACA,SAAO;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,36 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var src_exports = {};
|
|
17
|
-
__export(src_exports, {
|
|
18
|
-
setupNativeSheet: () => import_nativeSheet.setupNativeSheet
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(src_exports);
|
|
21
|
-
__reExport(src_exports, require("./Sheet"), module.exports);
|
|
22
|
-
__reExport(src_exports, require("./useSheet"), module.exports);
|
|
23
|
-
__reExport(src_exports, require("./createSheet"), module.exports);
|
|
24
|
-
__reExport(src_exports, require("./SheetController"), module.exports);
|
|
25
|
-
__reExport(src_exports, require("./useSheetController"), module.exports);
|
|
26
|
-
var import_nativeSheet = require("./nativeSheet");
|
|
27
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
-
0 && (module.exports = {
|
|
29
|
-
setupNativeSheet,
|
|
30
|
-
...require("./Sheet"),
|
|
31
|
-
...require("./useSheet"),
|
|
32
|
-
...require("./createSheet"),
|
|
33
|
-
...require("./SheetController"),
|
|
34
|
-
...require("./useSheetController")
|
|
35
|
-
});
|
|
1
|
+
export * from "./Sheet";
|
|
2
|
+
export * from "./useSheet";
|
|
3
|
+
export * from "./createSheet";
|
|
4
|
+
export * from "./SheetController";
|
|
5
|
+
export * from "./useSheetController";
|
|
6
|
+
import { setupNativeSheet } from "./nativeSheet";
|
|
7
|
+
export {
|
|
8
|
+
setupNativeSheet
|
|
9
|
+
};
|
|
36
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAS,wBAAwB;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var nativeSheet_exports = {};
|
|
17
|
-
__export(nativeSheet_exports, {
|
|
18
|
-
getNativeSheet: () => getNativeSheet,
|
|
19
|
-
setupNativeSheet: () => setupNativeSheet
|
|
20
|
-
});
|
|
21
|
-
module.exports = __toCommonJS(nativeSheet_exports);
|
|
22
|
-
var import_stacks = require("@tamagui/stacks"), import_react = require("react"), import_react_native = require("react-native"), import_SheetContext = require("./SheetContext"), import_useSheetOpenState = require("./useSheetOpenState"), import_useSheetProviderProps = require("./useSheetProviderProps"), import_jsx_runtime = require("react/jsx-runtime");
|
|
1
|
+
import { YStack } from "@tamagui/stacks";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
import { SheetProvider } from "./SheetContext";
|
|
5
|
+
import { useSheetOpenState } from "./useSheetOpenState";
|
|
6
|
+
import { useSheetProviderProps } from "./useSheetProviderProps";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
8
|
const nativeSheets = {
|
|
24
9
|
ios: null
|
|
25
10
|
};
|
|
@@ -28,14 +13,14 @@ function getNativeSheet(platform) {
|
|
|
28
13
|
}
|
|
29
14
|
function setupNativeSheet(platform, Implementation) {
|
|
30
15
|
platform === "ios" && (nativeSheets[platform] = (props) => {
|
|
31
|
-
const state =
|
|
32
|
-
return
|
|
16
|
+
const state = useSheetOpenState(props), providerProps = useSheetProviderProps(props, state), { open, setOpen } = state, ref = useRef();
|
|
17
|
+
return useEffect(() => {
|
|
33
18
|
var _a;
|
|
34
19
|
(_a = ref.current) == null || _a.setVisibility(open);
|
|
35
|
-
}, [open]), /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
20
|
+
}, [open]), /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(SheetProvider, { ...providerProps, onlyShowFrame: !0, children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Implementation, { ref, onModalDismiss: () => setOpen(!1), children: /* @__PURE__ */ jsx(View, { style: { flex: 1 }, children: props.children }) }),
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
YStack,
|
|
39
24
|
{
|
|
40
25
|
position: "absolute",
|
|
41
26
|
opacity: 0,
|
|
@@ -48,9 +33,8 @@ function setupNativeSheet(platform, Implementation) {
|
|
|
48
33
|
] }) });
|
|
49
34
|
});
|
|
50
35
|
}
|
|
51
|
-
|
|
52
|
-
0 && (module.exports = {
|
|
36
|
+
export {
|
|
53
37
|
getNativeSheet,
|
|
54
38
|
setupNativeSheet
|
|
55
|
-
}
|
|
39
|
+
};
|
|
56
40
|
//# sourceMappingURL=nativeSheet.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/nativeSheet.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,cAAc;AAEvB,SAAS,WAAW,cAAc;AAClC,SAAS,YAAY;AAErB,SAAS,qBAAqB;AAE9B,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AAsC9B,mBAGM,KAFJ,YADF;AAhCR,MAAM,eAAmF;AAAA,EACvF,KAAK;AACP;AAEO,SAAS,eAAe,UAAgC;AAC7D,SAAO,aAAa,QAAQ;AAC9B;AAEO,SAAS,iBAAiB,UAAgC,gBAAqB;AACpF,EAAI,aAAa,UACf,aAAa,QAAQ,IAAI,CAAC,UAAsB;AAC9C,UAAM,QAAQ,kBAAkB,KAAK,GAC/B,gBAAgB,sBAAsB,OAAO,KAAK,GAIlD,EAAE,MAAM,QAAQ,IAAI,OACpB,MAAM,OAET;AAEH,qBAAU,MAAM;AAnCtB;AAoCQ,gBAAI,YAAJ,WAAa,cAAc;AAAA,IAC7B,GAAG,CAAC,IAAI,CAAC,GASP,gCACE,+BAAC,iBAAe,GAAG,eAAe,eAAa,IAC7C;AAAA,0BAAC,kBAAe,KAAU,gBAAgB,MAAM,QAAQ,EAAK,GAC3D,8BAAC,QAAK,OAAO,EAAE,MAAM,EAAE,GAAI,gBAAM,UAAS,GAC5C;AAAA,MAIA;AAAA,QAAC;AAAA;AAAA,UACC,UAAS;AAAA,UACT,SAAS;AAAA,UACT,eAAc;AAAA,UACd,OAAO;AAAA,UACP,QAAQ;AAAA,UAEP,gBAAM;AAAA;AAAA,MACT;AAAA,OACF,GACF;AAAA,EAEJ;AAEJ;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
package/dist/esm/types.native.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
return to;
|
|
11
|
-
};
|
|
12
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
13
|
-
var types_exports = {};
|
|
14
|
-
module.exports = __toCommonJS(types_exports);
|
|
15
1
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var useSheet_exports = {};
|
|
17
|
-
__export(useSheet_exports, {
|
|
18
|
-
useSheet: () => useSheet
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(useSheet_exports);
|
|
21
|
-
var import_SheetContext = require("./SheetContext");
|
|
22
|
-
const useSheet = () => (0, import_SheetContext.useSheetContext)("", void 0);
|
|
23
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
-
0 && (module.exports = {
|
|
1
|
+
import { useSheetContext } from "./SheetContext";
|
|
2
|
+
const useSheet = () => useSheetContext("", void 0);
|
|
3
|
+
export {
|
|
25
4
|
useSheet
|
|
26
|
-
}
|
|
5
|
+
};
|
|
27
6
|
//# sourceMappingURL=useSheet.js.map
|
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
|
|
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: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var useSheetController_exports = {};
|
|
17
|
-
__export(useSheetController_exports, {
|
|
18
|
-
SheetControllerContext: () => SheetControllerContext,
|
|
19
|
-
useSheetController: () => useSheetController
|
|
20
|
-
});
|
|
21
|
-
module.exports = __toCommonJS(useSheetController_exports);
|
|
22
|
-
var import_react = require("react");
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
23
2
|
const useSheetController = () => {
|
|
24
|
-
const controller =
|
|
3
|
+
const controller = useContext(SheetControllerContext), isHidden = controller == null ? void 0 : controller.hidden, isShowingNonSheet = isHidden && (controller == null ? void 0 : controller.open);
|
|
25
4
|
return {
|
|
26
5
|
controller,
|
|
27
6
|
isHidden,
|
|
28
7
|
isShowingNonSheet,
|
|
29
8
|
disableDrag: controller == null ? void 0 : controller.disableDrag
|
|
30
9
|
};
|
|
31
|
-
}, SheetControllerContext =
|
|
10
|
+
}, SheetControllerContext = createContext(
|
|
32
11
|
null
|
|
33
12
|
);
|
|
34
|
-
|
|
35
|
-
0 && (module.exports = {
|
|
13
|
+
export {
|
|
36
14
|
SheetControllerContext,
|
|
37
15
|
useSheetController
|
|
38
|
-
}
|
|
16
|
+
};
|
|
39
17
|
//# sourceMappingURL=useSheetController.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useSheetController.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": "AAAA,SAAS,eAAe,kBAAkB;AAEnC,MAAM,qBAAqB,MAAM;AACtC,QAAM,aAAa,WAAW,sBAAsB,GAC9C,WAAW,yCAAY,QACvB,oBAAoB,aAAY,yCAAY;AAClD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,yCAAY;AAAA,EAC3B;AACF,GAEa,yBAAyB;AAAA,EACpC;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|