@tamagui/sheet 1.61.2 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Sheet.js +16 -30
- package/dist/cjs/Sheet.js.map +1 -1
- package/dist/cjs/Sheet.native.js +119 -0
- package/dist/cjs/Sheet.native.js.map +6 -0
- package/dist/cjs/SheetContext.js +7 -13
- package/dist/cjs/SheetContext.js.map +1 -1
- package/dist/cjs/SheetContext.native.js +36 -0
- package/dist/cjs/SheetContext.native.js.map +6 -0
- package/dist/cjs/SheetController.js +7 -15
- package/dist/cjs/SheetController.js.map +1 -1
- package/dist/cjs/SheetController.native.js +42 -0
- package/dist/cjs/SheetController.native.js.map +6 -0
- package/dist/cjs/SheetImplementationCustom.js +99 -240
- package/dist/cjs/SheetImplementationCustom.js.map +2 -2
- package/dist/cjs/SheetImplementationCustom.native.js +281 -0
- package/dist/cjs/SheetImplementationCustom.native.js.map +6 -0
- package/dist/cjs/SheetScrollView.js +18 -44
- package/dist/cjs/SheetScrollView.js.map +1 -1
- package/dist/cjs/SheetScrollView.native.js +69 -0
- package/dist/cjs/SheetScrollView.native.js.map +6 -0
- package/dist/cjs/constants.js +7 -17
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/constants.native.js +36 -0
- package/dist/cjs/constants.native.js.map +6 -0
- package/dist/cjs/contexts.js +6 -11
- package/dist/cjs/contexts.js.map +1 -1
- package/dist/cjs/contexts.native.js +31 -0
- package/dist/cjs/contexts.native.js.map +6 -0
- package/dist/cjs/createSheet.js +42 -90
- package/dist/cjs/createSheet.js.map +2 -2
- package/dist/cjs/createSheet.native.js +146 -0
- package/dist/cjs/createSheet.native.js.map +6 -0
- package/dist/cjs/helpers.js +6 -13
- package/dist/cjs/helpers.js.map +1 -1
- package/dist/cjs/helpers.native.js +32 -0
- package/dist/cjs/helpers.native.js.map +6 -0
- package/dist/cjs/index.js +6 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +36 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/cjs/nativeSheet.js +25 -42
- package/dist/cjs/nativeSheet.js.map +1 -1
- package/dist/cjs/nativeSheet.native.js +55 -0
- package/dist/cjs/nativeSheet.native.js.map +6 -0
- package/dist/cjs/types.js +3 -6
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js +15 -0
- package/dist/cjs/types.native.js.map +6 -0
- package/dist/cjs/useSheet.js +5 -9
- package/dist/cjs/useSheet.js.map +1 -1
- package/dist/cjs/useSheet.native.js +27 -0
- package/dist/cjs/useSheet.native.js.map +6 -0
- package/dist/cjs/useSheetController.js +8 -15
- package/dist/cjs/useSheetController.js.map +1 -1
- package/dist/cjs/useSheetController.native.js +39 -0
- package/dist/cjs/useSheetController.native.js.map +6 -0
- package/dist/cjs/useSheetOffscreenSize.js +13 -30
- package/dist/cjs/useSheetOffscreenSize.js.map +2 -2
- package/dist/cjs/useSheetOffscreenSize.native.js +48 -0
- package/dist/cjs/useSheetOffscreenSize.native.js.map +6 -0
- package/dist/cjs/useSheetOpenState.js +12 -21
- package/dist/cjs/useSheetOpenState.js.map +1 -1
- package/dist/cjs/useSheetOpenState.native.js +43 -0
- package/dist/cjs/useSheetOpenState.native.js.map +6 -0
- package/dist/cjs/useSheetProviderProps.js +44 -96
- package/dist/cjs/useSheetProviderProps.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.native.js +116 -0
- package/dist/cjs/useSheetProviderProps.native.js.map +6 -0
- package/dist/esm/Sheet.js +9 -14
- package/dist/esm/Sheet.js.map +1 -1
- package/dist/esm/SheetContext.js +1 -2
- package/dist/esm/SheetContext.js.map +1 -1
- package/dist/esm/SheetController.js +2 -3
- package/dist/esm/SheetController.js.map +1 -1
- package/dist/esm/SheetImplementationCustom.js +95 -217
- package/dist/esm/SheetImplementationCustom.js.map +2 -2
- package/dist/esm/SheetScrollView.js +13 -31
- package/dist/esm/SheetScrollView.js.map +1 -1
- package/dist/esm/constants.js +2 -8
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/contexts.js +1 -2
- package/dist/esm/contexts.js.map +1 -1
- package/dist/esm/createSheet.js +38 -70
- package/dist/esm/createSheet.js.map +2 -2
- package/dist/esm/helpers.js +1 -4
- package/dist/esm/helpers.js.map +1 -1
- package/dist/esm/nativeSheet.js +20 -27
- package/dist/esm/nativeSheet.js.map +1 -1
- package/dist/esm/useSheetController.js +3 -6
- package/dist/esm/useSheetController.js.map +1 -1
- package/dist/esm/useSheetOffscreenSize.js +8 -21
- package/dist/esm/useSheetOffscreenSize.js.map +2 -2
- package/dist/esm/useSheetOpenState.js +6 -10
- package/dist/esm/useSheetOpenState.js.map +1 -1
- package/dist/esm/useSheetProviderProps.js +36 -79
- package/dist/esm/useSheetProviderProps.js.map +1 -1
- package/dist/jsx/Sheet.js +9 -14
- package/dist/jsx/Sheet.js.map +1 -1
- package/dist/jsx/Sheet.native.js +95 -0
- package/dist/jsx/Sheet.native.js.map +6 -0
- package/dist/jsx/SheetContext.js +1 -2
- package/dist/jsx/SheetContext.js.map +1 -1
- package/dist/jsx/SheetContext.native.js +13 -0
- package/dist/jsx/SheetContext.native.js.map +6 -0
- package/dist/jsx/SheetController.js +1 -2
- package/dist/jsx/SheetController.js.map +1 -1
- package/dist/jsx/SheetController.native.js +23 -0
- package/dist/jsx/SheetController.native.js.map +6 -0
- package/dist/jsx/SheetImplementationCustom.js +90 -210
- package/dist/jsx/SheetImplementationCustom.js.map +2 -2
- package/dist/jsx/SheetImplementationCustom.native.js +288 -0
- package/dist/jsx/SheetImplementationCustom.native.js.map +6 -0
- package/dist/jsx/SheetScrollView.js +12 -30
- package/dist/jsx/SheetScrollView.js.map +1 -1
- package/dist/jsx/SheetScrollView.native.js +47 -0
- package/dist/jsx/SheetScrollView.native.js.map +6 -0
- package/dist/jsx/constants.js +2 -8
- package/dist/jsx/constants.js.map +1 -1
- package/dist/jsx/constants.native.js +11 -0
- package/dist/jsx/constants.native.js.map +6 -0
- package/dist/jsx/contexts.js +1 -2
- package/dist/jsx/contexts.js.map +1 -1
- package/dist/jsx/contexts.native.js +9 -0
- package/dist/jsx/contexts.native.js.map +6 -0
- package/dist/jsx/createSheet.js +30 -61
- package/dist/jsx/createSheet.js.map +2 -2
- package/dist/jsx/createSheet.native.js +128 -0
- package/dist/jsx/createSheet.native.js.map +6 -0
- package/dist/jsx/helpers.js +1 -4
- package/dist/jsx/helpers.js.map +1 -1
- package/dist/jsx/helpers.native.js +11 -0
- package/dist/jsx/helpers.native.js.map +6 -0
- package/dist/jsx/index.native.js +10 -0
- package/dist/jsx/index.native.js.map +6 -0
- package/dist/jsx/nativeSheet.js +21 -27
- package/dist/jsx/nativeSheet.js.map +1 -1
- package/dist/jsx/nativeSheet.native.js +40 -0
- package/dist/jsx/nativeSheet.native.js.map +6 -0
- package/dist/jsx/types.native.js +1 -0
- package/dist/jsx/types.native.js.map +6 -0
- package/dist/jsx/useSheet.native.js +6 -0
- package/dist/jsx/useSheet.native.js.map +6 -0
- package/dist/jsx/useSheetController.js +2 -5
- package/dist/jsx/useSheetController.js.map +1 -1
- package/dist/jsx/useSheetController.native.js +17 -0
- package/dist/jsx/useSheetController.native.js.map +6 -0
- package/dist/jsx/useSheetOffscreenSize.js +8 -21
- package/dist/jsx/useSheetOffscreenSize.js.map +2 -2
- package/dist/jsx/useSheetOffscreenSize.native.js +27 -0
- package/dist/jsx/useSheetOffscreenSize.native.js.map +6 -0
- package/dist/jsx/useSheetOpenState.js +5 -8
- package/dist/jsx/useSheetOpenState.js.map +1 -1
- package/dist/jsx/useSheetOpenState.native.js +23 -0
- package/dist/jsx/useSheetOpenState.native.js.map +6 -0
- package/dist/jsx/useSheetProviderProps.js +36 -79
- package/dist/jsx/useSheetProviderProps.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.native.js +90 -0
- package/dist/jsx/useSheetProviderProps.native.js.map +6 -0
- package/package.json +14 -14
- package/src/SheetImplementationCustom.tsx +21 -3
- package/src/createSheet.tsx +21 -3
- package/types/Sheet.d.ts +2 -0
- package/types/Sheet.d.ts.map +1 -1
- package/types/SheetImplementationCustom.d.ts.map +1 -1
- package/types/createSheet.d.ts +22 -0
- package/types/createSheet.d.ts.map +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
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 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)({
|
|
24
|
+
zIndex: 1e5
|
|
25
|
+
}), SheetInsideSheetContext = (0, import_react.createContext)(null);
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
ParentSheetContext,
|
|
29
|
+
SheetInsideSheetContext
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=contexts.js.map
|
package/dist/cjs/createSheet.js
CHANGED
|
@@ -1,55 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var createSheet_exports = {};
|
|
20
16
|
__export(createSheet_exports, {
|
|
21
17
|
createSheet: () => createSheet
|
|
22
18
|
});
|
|
23
19
|
module.exports = __toCommonJS(createSheet_exports);
|
|
24
|
-
var import_jsx_runtime = (
|
|
20
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_core = require("@tamagui/core"), import_remove_scroll = require("@tamagui/remove-scroll"), import_react = require("react"), import_react_native = require("react-native"), import_constants = 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 = (
|
|
25
21
|
// @ts-ignore
|
|
26
22
|
require("react/jsx-runtime")
|
|
27
23
|
);
|
|
28
|
-
var import_compose_refs = require("@tamagui/compose-refs");
|
|
29
|
-
var import_core = require("@tamagui/core");
|
|
30
|
-
var import_remove_scroll = require("@tamagui/remove-scroll");
|
|
31
|
-
var import_react = require("react");
|
|
32
|
-
var import_react_native = require("react-native");
|
|
33
|
-
var import_constants = require("./constants");
|
|
34
|
-
var import_nativeSheet = require("./nativeSheet");
|
|
35
|
-
var import_SheetContext = require("./SheetContext");
|
|
36
|
-
var import_SheetImplementationCustom = require("./SheetImplementationCustom");
|
|
37
|
-
var import_SheetScrollView = require("./SheetScrollView");
|
|
38
|
-
var import_useSheetController = require("./useSheetController");
|
|
39
|
-
var import_useSheetOffscreenSize = require("./useSheetOffscreenSize");
|
|
40
24
|
function createSheet({ Handle, Frame, Overlay }) {
|
|
41
25
|
const SheetHandle = Handle.extractable(
|
|
42
26
|
({ __scopeSheet, ...props }) => {
|
|
43
27
|
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_HANDLE_NAME, __scopeSheet);
|
|
44
|
-
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
28
|
+
return context.onlyShowFrame ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
29
|
Handle,
|
|
49
30
|
{
|
|
50
31
|
onPress: () => {
|
|
51
|
-
const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0);
|
|
52
|
-
const nextPos = (context.position + 1) % max;
|
|
32
|
+
const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0), nextPos = (context.position + 1) % max;
|
|
53
33
|
context.setPosition(nextPos);
|
|
54
34
|
},
|
|
55
35
|
open: context.open,
|
|
@@ -57,12 +37,9 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
57
37
|
}
|
|
58
38
|
);
|
|
59
39
|
}
|
|
60
|
-
)
|
|
61
|
-
const SheetOverlay = Overlay.extractable(
|
|
40
|
+
), SheetOverlay = Overlay.extractable(
|
|
62
41
|
(0, import_react.memo)((propsIn) => {
|
|
63
|
-
const { __scopeSheet, ...props } = propsIn
|
|
64
|
-
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_OVERLAY_NAME, __scopeSheet);
|
|
65
|
-
const element = (0, import_react.useMemo)(
|
|
42
|
+
const { __scopeSheet, ...props } = propsIn, context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_OVERLAY_NAME, __scopeSheet), element = (0, import_react.useMemo)(
|
|
66
43
|
() => (
|
|
67
44
|
// @ts-ignore
|
|
68
45
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -72,7 +49,7 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
72
49
|
onPress: (0, import_core.composeEventHandlers)(
|
|
73
50
|
props.onPress,
|
|
74
51
|
context.dismissOnOverlayPress ? () => {
|
|
75
|
-
context.setOpen(
|
|
52
|
+
context.setOpen(!1);
|
|
76
53
|
} : void 0
|
|
77
54
|
)
|
|
78
55
|
}
|
|
@@ -80,58 +57,48 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
80
57
|
),
|
|
81
58
|
[props.onPress, context.dismissOnOverlayPress]
|
|
82
59
|
);
|
|
83
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, [element]);
|
|
87
|
-
if (context.onlyShowFrame) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
return null;
|
|
60
|
+
return (0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
61
|
+
context.onOverlayComponent?.(element);
|
|
62
|
+
}, [element]), context.onlyShowFrame, null;
|
|
91
63
|
})
|
|
92
|
-
)
|
|
93
|
-
const SheetFrame = Frame.extractable(
|
|
64
|
+
), SheetFrame = Frame.extractable(
|
|
94
65
|
(0, import_react.forwardRef)(
|
|
95
66
|
({
|
|
96
67
|
__scopeSheet,
|
|
68
|
+
adjustPaddingForOffscreenContent,
|
|
69
|
+
disableHideBottomOverflow,
|
|
97
70
|
children,
|
|
98
71
|
...props
|
|
99
72
|
}, forwardedRef) => {
|
|
100
|
-
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_NAME, __scopeSheet)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { "data-sheet-offscreen-pad": true, height: offscreenSize, width: "100%" })
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
)
|
|
120
|
-
);
|
|
121
|
-
}, [props, frameSize, offscreenSize, hasFit]);
|
|
73
|
+
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_NAME, __scopeSheet), { hasFit, removeScrollEnabled, frameSize, contentRef } = context, composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), offscreenSize = (0, import_useSheetOffscreenSize.useSheetOffscreenSize)(context), sheetContents = (0, import_react.useMemo)(() => (
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
76
|
+
Frame,
|
|
77
|
+
{
|
|
78
|
+
ref: composedContentRef,
|
|
79
|
+
flex: hasFit ? 0 : 1,
|
|
80
|
+
height: hasFit ? void 0 : frameSize,
|
|
81
|
+
...props,
|
|
82
|
+
children: [
|
|
83
|
+
children,
|
|
84
|
+
adjustPaddingForOffscreenContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { "data-sheet-offscreen-pad": !0, height: offscreenSize, width: "100%" })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
), [props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);
|
|
122
89
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
123
90
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
124
91
|
import_remove_scroll.RemoveScroll,
|
|
125
92
|
{
|
|
126
|
-
forwardProps:
|
|
93
|
+
forwardProps: !0,
|
|
127
94
|
enabled: removeScrollEnabled,
|
|
128
|
-
allowPinchZoom:
|
|
95
|
+
allowPinchZoom: !0,
|
|
129
96
|
shards: [contentRef],
|
|
130
|
-
removeScrollBar:
|
|
97
|
+
removeScrollBar: !1,
|
|
131
98
|
children: sheetContents
|
|
132
99
|
}
|
|
133
100
|
),
|
|
134
|
-
!
|
|
101
|
+
!disableHideBottomOverflow && // @ts-ignore
|
|
135
102
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
103
|
Frame,
|
|
137
104
|
{
|
|
@@ -152,31 +119,16 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
152
119
|
] });
|
|
153
120
|
}
|
|
154
121
|
)
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
const hydrated = (0, import_core.useDidFinishSSR)();
|
|
158
|
-
const { isShowingNonSheet } = (0, import_useSheetController.useSheetController)();
|
|
122
|
+
), Sheet = (0, import_react.forwardRef)(function(props, ref) {
|
|
123
|
+
const hydrated = (0, import_core.useDidFinishSSR)(), { isShowingNonSheet } = (0, import_useSheetController.useSheetController)();
|
|
159
124
|
let SheetImplementation = import_SheetImplementationCustom.SheetImplementationCustom;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const impl = (0, import_nativeSheet.getNativeSheet)("ios");
|
|
163
|
-
if (impl) {
|
|
164
|
-
SheetImplementation = impl;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
if (isShowingNonSheet || !hydrated) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetImplementation, { ref, ...props });
|
|
172
|
-
});
|
|
173
|
-
const components = {
|
|
125
|
+
return props.native && import_react_native.Platform.OS, isShowingNonSheet || !hydrated ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetImplementation, { ref, ...props });
|
|
126
|
+
}), components = {
|
|
174
127
|
Frame: SheetFrame,
|
|
175
128
|
Overlay: SheetOverlay,
|
|
176
129
|
Handle: SheetHandle,
|
|
177
130
|
ScrollView: import_SheetScrollView.SheetScrollView
|
|
178
|
-
};
|
|
179
|
-
const Controlled = (0, import_core.withStaticProperties)(Sheet, components);
|
|
131
|
+
}, Controlled = (0, import_core.withStaticProperties)(Sheet, components);
|
|
180
132
|
return (0, import_core.withStaticProperties)(Sheet, {
|
|
181
133
|
...components,
|
|
182
134
|
Controlled
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createSheet.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": [
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC,kCAChC,cAUO,0BACP,uBAA6B,mCAC7B,eAA4E,kBAC5E,sBAA+B,yBAE/B,mBAAkE,wBAClE,qBAA+B,0BAC/B,sBAAgC,2BAChC,mCAA0C,wCAC1C,yBAAgC,8BAEhC,4BAAmC,iCACnC,+BAAsC,oCAyB9B;AAAA;AAAA;AAAA;AAfD,SAAS,YAId,EAAE,QAAQ,OAAO,QAAQ,GAAwC;AACjE,QAAM,cAAc,OAAO;AAAA,IACzB,CAAC,EAAE,cAAc,GAAG,MAAM,MA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names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
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 createSheet_exports = {};
|
|
17
|
+
__export(createSheet_exports, {
|
|
18
|
+
createSheet: () => createSheet
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(createSheet_exports);
|
|
21
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_core = require("@tamagui/core"), import_remove_scroll = require("@tamagui/remove-scroll"), import_react = require("react"), import_react_native = require("react-native"), import_constants = 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
|
+
);
|
|
25
|
+
function createSheet({ Handle, Frame, Overlay }) {
|
|
26
|
+
const SheetHandle = Handle.extractable(
|
|
27
|
+
({ __scopeSheet, ...props }) => {
|
|
28
|
+
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_HANDLE_NAME, __scopeSheet);
|
|
29
|
+
return context.onlyShowFrame ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
30
|
+
Handle,
|
|
31
|
+
{
|
|
32
|
+
onPress: () => {
|
|
33
|
+
const max = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0), nextPos = (context.position + 1) % max;
|
|
34
|
+
context.setPosition(nextPos);
|
|
35
|
+
},
|
|
36
|
+
open: context.open,
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
), SheetOverlay = Overlay.extractable(
|
|
42
|
+
(0, import_react.memo)((propsIn) => {
|
|
43
|
+
const { __scopeSheet, ...props } = propsIn, context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_OVERLAY_NAME, __scopeSheet), element = (0, import_react.useMemo)(
|
|
44
|
+
() => (
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
|
+
Overlay,
|
|
48
|
+
{
|
|
49
|
+
...props,
|
|
50
|
+
onPress: (0, import_core.composeEventHandlers)(
|
|
51
|
+
props.onPress,
|
|
52
|
+
context.dismissOnOverlayPress ? () => {
|
|
53
|
+
context.setOpen(!1);
|
|
54
|
+
} : void 0
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
),
|
|
59
|
+
[props.onPress, context.dismissOnOverlayPress]
|
|
60
|
+
);
|
|
61
|
+
return (0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
62
|
+
context.onOverlayComponent?.(element);
|
|
63
|
+
}, [element]), context.onlyShowFrame, null;
|
|
64
|
+
})
|
|
65
|
+
), SheetFrame = Frame.extractable(
|
|
66
|
+
(0, import_react.forwardRef)(
|
|
67
|
+
({
|
|
68
|
+
__scopeSheet,
|
|
69
|
+
adjustPaddingForOffscreenContent,
|
|
70
|
+
disableHideBottomOverflow,
|
|
71
|
+
children,
|
|
72
|
+
...props
|
|
73
|
+
}, forwardedRef) => {
|
|
74
|
+
const context = (0, import_SheetContext.useSheetContext)(import_constants.SHEET_NAME, __scopeSheet), { hasFit, removeScrollEnabled, frameSize, contentRef } = context, composedContentRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), offscreenSize = (0, import_useSheetOffscreenSize.useSheetOffscreenSize)(context), sheetContents = (0, import_react.useMemo)(() => (
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
77
|
+
Frame,
|
|
78
|
+
{
|
|
79
|
+
ref: composedContentRef,
|
|
80
|
+
flex: hasFit ? 0 : 1,
|
|
81
|
+
height: hasFit ? void 0 : frameSize,
|
|
82
|
+
...props,
|
|
83
|
+
children: [
|
|
84
|
+
children,
|
|
85
|
+
adjustPaddingForOffscreenContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { "data-sheet-offscreen-pad": !0, height: offscreenSize, width: "100%" })
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
), [props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);
|
|
90
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
|
+
import_remove_scroll.RemoveScroll,
|
|
93
|
+
{
|
|
94
|
+
forwardProps: !0,
|
|
95
|
+
enabled: removeScrollEnabled,
|
|
96
|
+
allowPinchZoom: !0,
|
|
97
|
+
shards: [contentRef],
|
|
98
|
+
removeScrollBar: !1,
|
|
99
|
+
children: sheetContents
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
!disableHideBottomOverflow && // @ts-ignore
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
|
+
Frame,
|
|
105
|
+
{
|
|
106
|
+
...props,
|
|
107
|
+
componentName: "SheetCover",
|
|
108
|
+
children: null,
|
|
109
|
+
position: "absolute",
|
|
110
|
+
bottom: "-50%",
|
|
111
|
+
zIndex: -1,
|
|
112
|
+
height: context.frameSize,
|
|
113
|
+
left: 0,
|
|
114
|
+
right: 0,
|
|
115
|
+
borderWidth: 0,
|
|
116
|
+
borderRadius: 0,
|
|
117
|
+
shadowOpacity: 0
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
] });
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
), Sheet = (0, import_react.forwardRef)(function(props, ref) {
|
|
124
|
+
const hydrated = (0, import_core.useDidFinishSSR)(), { isShowingNonSheet } = (0, import_useSheetController.useSheetController)();
|
|
125
|
+
let SheetImplementation = import_SheetImplementationCustom.SheetImplementationCustom;
|
|
126
|
+
if (props.native && import_react_native.Platform.OS === "ios") {
|
|
127
|
+
const impl = (0, import_nativeSheet.getNativeSheet)("ios");
|
|
128
|
+
impl && (SheetImplementation = impl);
|
|
129
|
+
}
|
|
130
|
+
return isShowingNonSheet || !hydrated ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetImplementation, { ref, ...props });
|
|
131
|
+
}), components = {
|
|
132
|
+
Frame: SheetFrame,
|
|
133
|
+
Overlay: SheetOverlay,
|
|
134
|
+
Handle: SheetHandle,
|
|
135
|
+
ScrollView: import_SheetScrollView.SheetScrollView
|
|
136
|
+
}, Controlled = (0, import_core.withStaticProperties)(Sheet, components);
|
|
137
|
+
return (0, import_core.withStaticProperties)(Sheet, {
|
|
138
|
+
...components,
|
|
139
|
+
Controlled
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
143
|
+
0 && (module.exports = {
|
|
144
|
+
createSheet
|
|
145
|
+
});
|
|
146
|
+
//# sourceMappingURL=createSheet.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+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F,GAEM,YAAQ,yBAA6B,SAAe,OAAO,KAAK;AACpE,UAAM,eAAW,6BAAgB,GAC3B,EAAE,kBAAkB,QAAI,8CAAmB;AAEjD,QAAI,sBAAsB;AAE1B,QAAI,MAAM,UAAU,6BAAS,OAAO,OACW;AAC3C,YAAM,WAAO,mCAAe,KAAK;AACjC,MAAI,SACF,sBAAsB;AAAA,IAE1B;AAMF,WAAI,qBAAqB,CAAC,WACjB,OAGF,4CAAC,uBAAoB,KAAW,GAAG,OAAO;AAAA,EACnD,CAAC,GAEK,aAAa;AAAA,IACjB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,EACd,GAEM,iBAAa,kCAAqB,OAAO,UAAU;AAKzD,aAAO,kCAAqB,OAAO;AAAA,IACjC,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/cjs/helpers.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var helpers_exports = {};
|
|
20
16
|
__export(helpers_exports, {
|
|
21
17
|
resisted: () => resisted
|
|
@@ -23,10 +19,7 @@ __export(helpers_exports, {
|
|
|
23
19
|
module.exports = __toCommonJS(helpers_exports);
|
|
24
20
|
function resisted(y, minY, maxOverflow = 25) {
|
|
25
21
|
if (y < minY) {
|
|
26
|
-
const past = minY - y;
|
|
27
|
-
const pctPast = Math.min(maxOverflow, past) / maxOverflow;
|
|
28
|
-
const diminishBy = 1.1 - 0.1 ** pctPast;
|
|
29
|
-
const extra = -diminishBy * maxOverflow;
|
|
22
|
+
const past = minY - y, extra = -(1.1 - 0.1 ** (Math.min(maxOverflow, past) / maxOverflow)) * maxOverflow;
|
|
30
23
|
return minY + extra;
|
|
31
24
|
}
|
|
32
25
|
return y;
|
package/dist/cjs/helpers.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers.tsx"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,SAAS,GAAW,MAAc,cAAc,IAAI;AAClE,MAAI,IAAI,MAAM;AACZ,UAAM,OAAO,OAAO,GAGd,QAAQ,EADK,MAAM,QADT,KAAK,IAAI,aAAa,IAAI,IAAI,gBAElB;AAC5B,WAAO,OAAO;AAAA,EAChB;AACA,SAAO;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
function resisted(y, minY, maxOverflow = 25) {
|
|
22
|
+
if (y < minY) {
|
|
23
|
+
const past = minY - y, extra = -(1.1 - 0.1 ** (Math.min(maxOverflow, past) / maxOverflow)) * maxOverflow;
|
|
24
|
+
return minY + extra;
|
|
25
|
+
}
|
|
26
|
+
return y;
|
|
27
|
+
}
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
resisted
|
|
31
|
+
});
|
|
32
|
+
//# 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,GAGd,QAAQ,EADK,MAAM,QADT,KAAK,IAAI,aAAa,IAAI,IAAI,gBAElB;AAC5B,WAAO,OAAO;AAAA,EAChB;AACA,SAAO;AACT;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
|
-
};
|
|
18
|
-
var
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
13
|
+
}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
20
15
|
var src_exports = {};
|
|
21
16
|
__export(src_exports, {
|
|
22
17
|
setupNativeSheet: () => import_nativeSheet.setupNativeSheet
|
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": "
|
|
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
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}, __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
|
+
});
|
|
36
|
+
//# sourceMappingURL=index.js.map
|