@tamagui/sheet 1.88.0 → 1.88.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Sheet.js +0 -11
- package/dist/cjs/SheetContext.js +0 -7
- package/dist/cjs/SheetController.js +0 -4
- package/dist/cjs/SheetImplementationCustom.js +4 -10
- package/dist/cjs/SheetImplementationCustom.js.map +1 -1
- package/dist/cjs/SheetScrollView.js +1 -5
- package/dist/cjs/SheetScrollView.js.map +1 -1
- package/dist/cjs/constants.js +0 -8
- package/dist/cjs/contexts.js +0 -5
- package/dist/cjs/createSheet.js +1 -6
- package/dist/cjs/createSheet.js.map +1 -1
- package/dist/cjs/helpers.js +0 -4
- package/dist/cjs/index.js +0 -9
- package/dist/cjs/nativeSheet.js +1 -7
- package/dist/cjs/nativeSheet.js.map +1 -1
- package/dist/cjs/useSheet.js +0 -4
- package/dist/cjs/useSheetController.js +2 -7
- package/dist/cjs/useSheetController.js.map +1 -1
- package/dist/cjs/useSheetOffscreenSize.js +0 -4
- package/dist/cjs/useSheetOpenState.js +2 -7
- package/dist/cjs/useSheetOpenState.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.js +0 -4
- package/dist/esm/Sheet.native.js +40 -16
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetContext.native.js +29 -6
- package/dist/esm/SheetContext.native.js.map +1 -1
- package/dist/esm/SheetController.native.js +26 -8
- package/dist/esm/SheetController.native.js.map +1 -1
- package/dist/esm/SheetImplementationCustom.native.js +69 -82
- package/dist/esm/SheetImplementationCustom.native.js.map +2 -2
- package/dist/esm/SheetScrollView.native.js +31 -14
- package/dist/esm/SheetScrollView.native.js.map +1 -1
- package/dist/esm/constants.native.js +29 -4
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/contexts.native.js +27 -5
- package/dist/esm/contexts.native.js.map +1 -1
- package/dist/esm/createSheet.native.js +62 -57
- package/dist/esm/createSheet.native.js.map +2 -2
- package/dist/esm/helpers.native.js +23 -2
- package/dist/esm/helpers.native.js.map +1 -1
- package/dist/esm/index.native.js +35 -9
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/nativeSheet.native.js +33 -16
- package/dist/esm/nativeSheet.native.js.map +1 -1
- package/dist/esm/types.native.js +14 -0
- package/dist/esm/types.native.js.map +2 -2
- package/dist/esm/useSheet.native.js +25 -4
- package/dist/esm/useSheet.native.js.map +1 -1
- package/dist/esm/useSheetController.native.js +28 -6
- package/dist/esm/useSheetController.native.js.map +1 -1
- package/dist/esm/useSheetOffscreenSize.native.js +23 -2
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/esm/useSheetOpenState.native.js +29 -8
- package/dist/esm/useSheetOpenState.native.js.map +1 -1
- package/dist/esm/useSheetProviderProps.native.js +38 -12
- package/dist/esm/useSheetProviderProps.native.js.map +2 -2
- package/dist/jsx/Sheet.native.js +40 -16
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetContext.native.js +29 -6
- package/dist/jsx/SheetContext.native.js.map +1 -1
- package/dist/jsx/SheetController.js +2 -1
- package/dist/jsx/SheetController.js.map +1 -1
- package/dist/jsx/SheetController.native.js +26 -7
- package/dist/jsx/SheetController.native.js.map +1 -1
- package/dist/jsx/SheetImplementationCustom.js +45 -37
- package/dist/jsx/SheetImplementationCustom.js.map +1 -1
- package/dist/jsx/SheetImplementationCustom.native.js +100 -107
- package/dist/jsx/SheetImplementationCustom.native.js.map +2 -2
- package/dist/jsx/SheetScrollView.js +19 -14
- package/dist/jsx/SheetScrollView.js.map +1 -1
- package/dist/jsx/SheetScrollView.native.js +44 -22
- package/dist/jsx/SheetScrollView.native.js.map +1 -1
- package/dist/jsx/constants.native.js +29 -4
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/contexts.native.js +27 -5
- package/dist/jsx/contexts.native.js.map +1 -1
- package/dist/jsx/createSheet.js +69 -54
- package/dist/jsx/createSheet.js.map +1 -1
- package/dist/jsx/createSheet.native.js +106 -87
- package/dist/jsx/createSheet.native.js.map +2 -2
- package/dist/jsx/helpers.native.js +23 -2
- package/dist/jsx/helpers.native.js.map +1 -1
- package/dist/jsx/index.native.js +35 -9
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/nativeSheet.js +15 -16
- package/dist/jsx/nativeSheet.js.map +1 -1
- package/dist/jsx/nativeSheet.native.js +41 -26
- package/dist/jsx/nativeSheet.native.js.map +1 -1
- package/dist/jsx/types.native.js +14 -0
- package/dist/jsx/types.native.js.map +2 -2
- package/dist/jsx/useSheet.native.js +25 -4
- package/dist/jsx/useSheet.native.js.map +1 -1
- package/dist/jsx/useSheetController.native.js +27 -5
- package/dist/jsx/useSheetController.native.js.map +1 -1
- package/dist/jsx/useSheetOffscreenSize.native.js +23 -2
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/jsx/useSheetOpenState.native.js +26 -6
- package/dist/jsx/useSheetOpenState.native.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.native.js +38 -12
- package/dist/jsx/useSheetProviderProps.native.js.map +2 -2
- package/package.json +16 -16
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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_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
|
+
);
|
|
19
25
|
function createSheet({ Handle, Frame, Overlay }) {
|
|
20
26
|
const SheetHandle = Handle.extractable(
|
|
21
27
|
({ __scopeSheet, ...props }) => {
|
|
22
|
-
const context = useSheetContext(SHEET_HANDLE_NAME, __scopeSheet);
|
|
23
|
-
return context.onlyShowFrame ? null : (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
...props
|
|
34
|
-
}
|
|
35
|
-
)
|
|
28
|
+
const context = (0, import_SheetContext.useSheetContext)(import_constants2.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
|
+
}
|
|
36
39
|
);
|
|
37
40
|
}
|
|
38
41
|
), SheetOverlay = Overlay.extractable(
|
|
39
|
-
memo((propsIn) => {
|
|
40
|
-
const { __scopeSheet, ...props } = propsIn, context = useSheetContext(SHEET_OVERLAY_NAME, __scopeSheet), element = useMemo(
|
|
42
|
+
(0, import_react.memo)((propsIn) => {
|
|
43
|
+
const { __scopeSheet, ...props } = propsIn, context = (0, import_SheetContext.useSheetContext)(import_constants2.SHEET_OVERLAY_NAME, __scopeSheet), element = (0, import_react.useMemo)(
|
|
41
44
|
() => (
|
|
42
45
|
// @ts-ignore
|
|
43
|
-
/* @__PURE__ */ jsx(
|
|
46
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
47
|
Overlay,
|
|
45
48
|
{
|
|
46
49
|
...props,
|
|
47
|
-
onPress: composeEventHandlers(
|
|
50
|
+
onPress: (0, import_helpers.composeEventHandlers)(
|
|
48
51
|
props.onPress,
|
|
49
52
|
context.dismissOnOverlayPress ? () => {
|
|
50
53
|
context.setOpen(!1);
|
|
@@ -55,12 +58,13 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
55
58
|
),
|
|
56
59
|
[props.onPress, context.dismissOnOverlayPress]
|
|
57
60
|
);
|
|
58
|
-
return useIsomorphicLayoutEffect(() => {
|
|
59
|
-
|
|
61
|
+
return (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = context.onOverlayComponent) == null || _a.call(context, element);
|
|
60
64
|
}, [element]), context.onlyShowFrame, null;
|
|
61
65
|
})
|
|
62
66
|
), SheetFrame = Frame.extractable(
|
|
63
|
-
forwardRef(
|
|
67
|
+
(0, import_react.forwardRef)(
|
|
64
68
|
({
|
|
65
69
|
__scopeSheet,
|
|
66
70
|
adjustPaddingForOffscreenContent,
|
|
@@ -68,9 +72,9 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
68
72
|
children,
|
|
69
73
|
...props
|
|
70
74
|
}, forwardedRef) => {
|
|
71
|
-
const context = useSheetContext(SHEET_NAME, __scopeSheet), { hasFit, removeScrollEnabled, frameSize, contentRef } = context, composedContentRef = useComposedRefs(forwardedRef, contentRef), offscreenSize = useSheetOffscreenSize(context), sheetContents = useMemo(() => (
|
|
75
|
+
const context = (0, import_SheetContext.useSheetContext)(import_constants2.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)(() => (
|
|
72
76
|
// @ts-ignore
|
|
73
|
-
/* @__PURE__ */ jsxs(
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
74
78
|
Frame,
|
|
75
79
|
{
|
|
76
80
|
ref: composedContentRef,
|
|
@@ -79,14 +83,14 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
79
83
|
...props,
|
|
80
84
|
children: [
|
|
81
85
|
children,
|
|
82
|
-
adjustPaddingForOffscreenContent && /* @__PURE__ */ jsx(Stack, { "data-sheet-offscreen-pad": !0, height: offscreenSize, width: "100%" })
|
|
86
|
+
adjustPaddingForOffscreenContent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { "data-sheet-offscreen-pad": !0, height: offscreenSize, width: "100%" })
|
|
83
87
|
]
|
|
84
88
|
}
|
|
85
89
|
)
|
|
86
90
|
), [props, frameSize, offscreenSize, adjustPaddingForOffscreenContent, hasFit]);
|
|
87
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
88
|
-
/* @__PURE__ */ jsx(
|
|
89
|
-
RemoveScroll,
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
+
import_remove_scroll.RemoveScroll,
|
|
90
94
|
{
|
|
91
95
|
forwardProps: !0,
|
|
92
96
|
enabled: removeScrollEnabled,
|
|
@@ -97,7 +101,7 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
97
101
|
}
|
|
98
102
|
),
|
|
99
103
|
!disableHideBottomOverflow && // @ts-ignore
|
|
100
|
-
/* @__PURE__ */ jsx(
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
101
105
|
Frame,
|
|
102
106
|
{
|
|
103
107
|
...props,
|
|
@@ -117,26 +121,27 @@ function createSheet({ Handle, Frame, Overlay }) {
|
|
|
117
121
|
] });
|
|
118
122
|
}
|
|
119
123
|
)
|
|
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");
|
|
124
|
+
), Sheet = (0, import_react.forwardRef)(function(props, ref) {
|
|
125
|
+
const hydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), { isShowingNonSheet } = (0, import_useSheetController.useSheetController)();
|
|
126
|
+
let SheetImplementation = import_SheetImplementationCustom.SheetImplementationCustom;
|
|
127
|
+
if (props.native && import_react_native.Platform.OS === "ios") {
|
|
128
|
+
const impl = (0, import_nativeSheet.getNativeSheet)("ios");
|
|
125
129
|
impl && (SheetImplementation = impl);
|
|
126
130
|
}
|
|
127
|
-
return isShowingNonSheet || !hydrated ? null : /* @__PURE__ */ jsx(SheetImplementation, { ref, ...props });
|
|
131
|
+
return isShowingNonSheet || !hydrated ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SheetImplementation, { ref, ...props });
|
|
128
132
|
}), components = {
|
|
129
133
|
Frame: SheetFrame,
|
|
130
134
|
Overlay: SheetOverlay,
|
|
131
135
|
Handle: SheetHandle,
|
|
132
|
-
ScrollView: SheetScrollView
|
|
133
|
-
}, Controlled = withStaticProperties(Sheet, components);
|
|
134
|
-
return withStaticProperties(Sheet, {
|
|
136
|
+
ScrollView: import_SheetScrollView.SheetScrollView
|
|
137
|
+
}, Controlled = (0, import_helpers.withStaticProperties)(Sheet, components);
|
|
138
|
+
return (0, import_helpers.withStaticProperties)(Sheet, {
|
|
135
139
|
...components,
|
|
136
140
|
Controlled
|
|
137
141
|
});
|
|
138
142
|
}
|
|
139
|
-
export
|
|
143
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
144
|
+
0 && (module.exports = {
|
|
140
145
|
createSheet
|
|
141
|
-
};
|
|
146
|
+
});
|
|
142
147
|
//# sourceMappingURL=createSheet.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/createSheet.tsx"],
|
|
4
|
-
"mappings": "AAAA
|
|
5
|
-
"names": []
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAgC,kCAChC,mBAA0C,+BAC1C,cAMO,0BACP,iBAA2D,6BAC3D,uBAA6B,mCAC7B,4BAAgC,wCAChC,eAA4E,kBAC5E,sBAA+B,yBAE/BA,oBAAkE,wBAClE,qBAA+B,0BAC/B,sBAAgC,2BAChC,mCAA0C,wCAC1C,yBAAgC,8BAEhC,4BAAmC,i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oB,KAAW,GAAG,OAAO;AAAA,EACnD,CAAC,GAEK,aAAa;AAAA,IACjB,OAAO;AAAA,IACP,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,YAAY;AAAA,EACd,GAEM,iBAAa,qCAAqB,OAAO,UAAU;AAKzD,aAAO,qCAAqB,OAAO;AAAA,IACjC,GAAG;AAAA,IACH;AAAA,EACF,CAAC;AACH;",
|
|
5
|
+
"names": ["import_constants"]
|
|
6
6
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
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);
|
|
1
21
|
function resisted(y, minY, maxOverflow = 25) {
|
|
2
22
|
if (y < minY) {
|
|
3
23
|
const past = minY - y, extra = -(1.1 - 0.1 ** (Math.min(maxOverflow, past) / maxOverflow)) * maxOverflow;
|
|
@@ -5,7 +25,8 @@ function resisted(y, minY, maxOverflow = 25) {
|
|
|
5
25
|
}
|
|
6
26
|
return y;
|
|
7
27
|
}
|
|
8
|
-
export
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
9
30
|
resisted
|
|
10
|
-
};
|
|
31
|
+
});
|
|
11
32
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/helpers.tsx"],
|
|
4
|
-
"mappings": "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;",
|
|
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
|
}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,10 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
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
|
+
});
|
|
10
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"mappings": "AAAA
|
|
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
|
}
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 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");
|
|
8
23
|
const nativeSheets = {
|
|
9
24
|
ios: null
|
|
10
25
|
};
|
|
@@ -13,13 +28,14 @@ function getNativeSheet(platform) {
|
|
|
13
28
|
}
|
|
14
29
|
function setupNativeSheet(platform, Implementation) {
|
|
15
30
|
platform === "ios" && (nativeSheets[platform] = (props) => {
|
|
16
|
-
const state = useSheetOpenState(props), providerProps = useSheetProviderProps(props, state), { open, setOpen } = state, ref = useRef();
|
|
17
|
-
return useEffect(() => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */ jsx(
|
|
22
|
-
|
|
31
|
+
const state = (0, import_useSheetOpenState.useSheetOpenState)(props), providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state), { open, setOpen } = state, ref = (0, import_react.useRef)();
|
|
32
|
+
return (0, import_react.useEffect)(() => {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = ref.current) == null || _a.setVisibility(open);
|
|
35
|
+
}, [open]), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, { ...providerProps, onlyShowFrame: !0, children: [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Implementation, { ref, onModalDismiss: () => setOpen(!1), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: { flex: 1 }, children: props.children }) }),
|
|
37
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
38
|
+
import_stacks.YStack,
|
|
23
39
|
{
|
|
24
40
|
position: "absolute",
|
|
25
41
|
opacity: 0,
|
|
@@ -32,8 +48,9 @@ function setupNativeSheet(platform, Implementation) {
|
|
|
32
48
|
] }) });
|
|
33
49
|
});
|
|
34
50
|
}
|
|
35
|
-
export
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
36
53
|
getNativeSheet,
|
|
37
54
|
setupNativeSheet
|
|
38
|
-
};
|
|
55
|
+
});
|
|
39
56
|
//# sourceMappingURL=nativeSheet.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/nativeSheet.tsx"],
|
|
4
|
-
"mappings": "AAAA
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB,4BACvB,eAAqD,kBACrD,sBAAqB,yBAErB,sBAA8B,2BAE9B,2BAAkC,gCAClC,+BAAsC,oCAsC9B;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,YAAQ,4CAAkB,KAAK,GAC/B,oBAAgB,oDAAsB,OAAO,KAAK,GAIlD,EAAE,MAAM,QAAQ,IAAI,OACpB,UAAM,qBAET;AAEH,uCAAU,MAAM;AAlCtB;AAmCQ,gBAAI,YAAJ,WAAa,cAAc;AAAA,IAC7B,GAAG,CAAC,IAAI,CAAC,GASP,2EACE,uDAAC,qCAAe,GAAG,eAAe,eAAa,IAC7C;AAAA,kDAAC,kBAAe,KAAU,gBAAgB,MAAM,QAAQ,EAAK,GAC3D,sDAAC,4BAAK,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 +1,15 @@
|
|
|
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);
|
|
1
15
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
5
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 = {
|
|
25
|
+
useSheet
|
|
26
|
+
});
|
|
6
27
|
//# sourceMappingURL=useSheet.js.map
|
|
@@ -1,17 +1,39 @@
|
|
|
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 __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");
|
|
2
23
|
const useSheetController = () => {
|
|
3
|
-
const controller = useContext(SheetControllerContext), isHidden = controller
|
|
24
|
+
const controller = (0, import_react.useContext)(SheetControllerContext), isHidden = controller == null ? void 0 : controller.hidden, isShowingNonSheet = isHidden && (controller == null ? void 0 : controller.open);
|
|
4
25
|
return {
|
|
5
26
|
controller,
|
|
6
27
|
isHidden,
|
|
7
28
|
isShowingNonSheet,
|
|
8
|
-
disableDrag: controller
|
|
29
|
+
disableDrag: controller == null ? void 0 : controller.disableDrag
|
|
9
30
|
};
|
|
10
|
-
}, SheetControllerContext = createContext(
|
|
31
|
+
}, SheetControllerContext = (0, import_react.createContext)(
|
|
11
32
|
null
|
|
12
33
|
);
|
|
13
|
-
export
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
14
36
|
SheetControllerContext,
|
|
15
37
|
useSheetController
|
|
16
|
-
};
|
|
38
|
+
});
|
|
17
39
|
//# sourceMappingURL=useSheetController.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useSheetController.tsx"],
|
|
4
|
-
"mappings": "AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0C;AAEnC,MAAM,qBAAqB,MAAM;AACtC,QAAM,iBAAa,yBAAW,sBAAsB,GAC9C,WAAW,yCAAY,QACvB,oBAAoB,aAAY,yCAAY;AAClD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa,yCAAY;AAAA,EAC3B;AACF,GAEa,6BAAyB;AAAA,EACpC;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
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 useSheetOffscreenSize_exports = {};
|
|
17
|
+
__export(useSheetOffscreenSize_exports, {
|
|
18
|
+
useSheetOffscreenSize: () => useSheetOffscreenSize
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(useSheetOffscreenSize_exports);
|
|
1
21
|
const useSheetOffscreenSize = ({
|
|
2
22
|
snapPoints,
|
|
3
23
|
position,
|
|
@@ -21,7 +41,8 @@ const useSheetOffscreenSize = ({
|
|
|
21
41
|
const maxSize = typeof maxSnapPoint == "string" ? Number(maxSnapPoint.slice(0, -1)) / 100 * screenSize : maxSnapPoint, currentSnapPoint = snapPoints[position] ?? 0, currentSize = typeof currentSnapPoint == "string" ? Number(currentSnapPoint.slice(0, -1)) / 100 * screenSize : currentSnapPoint, offscreenSize = maxSize - currentSize;
|
|
22
42
|
return Number.isNaN(offscreenSize) ? 0 : offscreenSize;
|
|
23
43
|
};
|
|
24
|
-
export
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
25
46
|
useSheetOffscreenSize
|
|
26
|
-
};
|
|
47
|
+
});
|
|
27
48
|
//# sourceMappingURL=useSheetOffscreenSize.js.map
|
|
@@ -1,6 +1,6 @@
|
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EAElC;AAEA,MAAI,mBAAmB,WAAW;AAChC,UAAM,mBAAmB,OAAO,WAAW,CAAC,CAAC,IAAI,KAC3C,gBAAgB,OAAO,WAAW,QAAQ,KAAK,CAAC,IAAI;AAG1D,YAFsB,mBAAmB,iBACH;AAAA,EAExC;AAGA,QAAM,eAAe,WAAW,CAAC;AACjC,MAAI,iBAAiB;AACnB,WAAO;AAGT,QAAM,UACJ,OAAO,gBAAiB,WACnB,OAAO,aAAa,MAAM,GAAG,EAAE,CAAC,IAAI,MAAO,aAC5C,cACA,mBAAmB,WAAW,QAAQ,KAAK,GAC3C,cACJ,OAAO,oBAAqB,WACvB,OAAO,iBAAiB,MAAM,GAAG,EAAE,CAAC,IAAI,MAAO,aAChD,kBACA,gBAAgB,UAAU;AAChC,SAAI,OAAO,MAAM,aAAa,IACrB,IAEF;AACT;",
|
|
5
5
|
"names": ["maxSize", "currentSize"]
|
|
6
6
|
}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 useSheetOpenState_exports = {};
|
|
17
|
+
__export(useSheetOpenState_exports, {
|
|
18
|
+
useSheetOpenState: () => useSheetOpenState
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(useSheetOpenState_exports);
|
|
21
|
+
var import_use_controllable_state = require("@tamagui/use-controllable-state"), import_useSheetController = require("./useSheetController");
|
|
3
22
|
const useSheetOpenState = (props) => {
|
|
4
|
-
const { isHidden, controller } = useSheetController(), onOpenChangeInternal = (val) => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
23
|
+
const { isHidden, controller } = (0, import_useSheetController.useSheetController)(), onOpenChangeInternal = (val) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
(_a = controller == null ? void 0 : controller.onOpenChange) == null || _a.call(controller, val), (_b = props.onOpenChange) == null || _b.call(props, val);
|
|
26
|
+
}, [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
|
|
27
|
+
prop: (controller == null ? void 0 : controller.open) ?? props.open,
|
|
8
28
|
defaultProp: props.defaultOpen ?? !1,
|
|
9
29
|
onChange: onOpenChangeInternal,
|
|
10
30
|
strategy: "most-recent-wins",
|
|
@@ -17,7 +37,8 @@ const useSheetOpenState = (props) => {
|
|
|
17
37
|
controller
|
|
18
38
|
};
|
|
19
39
|
};
|
|
20
|
-
export
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
21
42
|
useSheetOpenState
|
|
22
|
-
};
|
|
43
|
+
});
|
|
23
44
|
//# sourceMappingURL=useSheetOpenState.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useSheetOpenState.tsx"],
|
|
4
|
-
"mappings": "AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAAqC,4CAGrC,4BAAmC;AAE5B,MAAM,oBAAoB,CAAC,UAAsB;AACtD,QAAM,EAAE,UAAU,WAAW,QAAI,8CAAmB,GAE9C,uBAAuB,CAAC,QAAiB;AARjD;AASI,mDAAY,iBAAZ,4BAA2B,OAC3B,WAAM,iBAAN,uBAAqB;AAAA,EACvB,GAEM,CAAC,MAAM,OAAO,QAAI,oDAAqB;AAAA,IAC3C,OAAM,yCAAY,SAAQ,MAAM;AAAA,IAChC,aAAa,MAAM,eAAe;AAAA,IAClC,UAAU;AAAA,IACV,UAAU;AAAA,IACV,YAAY;AAAA,EACd,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|