@hanzogui/adapt 2.0.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.
@@ -0,0 +1,189 @@
1
+ import { isAndroid, isIos, isTouchable, isWeb, useIsomorphicLayoutEffect } from "@hanzo/gui-constants";
2
+ import { createStyledContext, useMedia } from "@hanzo/gui-core";
3
+ import { withStaticProperties } from "@hanzo/gui-helpers";
4
+ import { getPortal } from "@hanzo/gui-native";
5
+ import { PortalHost, PortalItem } from "@hanzo/gui-portal";
6
+ import { StackZIndexContext } from "@hanzo/gui-z-index-stack";
7
+ import React, { createContext, useContext, useId, useMemo } from "react";
8
+ import { Fragment, jsx } from "react/jsx-runtime";
9
+ function createAdaptChildrenStore() {
10
+ let children = null;
11
+ const listeners = /* @__PURE__ */new Set();
12
+ return {
13
+ set(c) {
14
+ children = c;
15
+ for (const l of listeners) l();
16
+ },
17
+ get: () => children,
18
+ subscribe(callback) {
19
+ return listeners.add(callback), () => listeners.delete(callback);
20
+ }
21
+ };
22
+ }
23
+ const AdaptChildrenStoreContext = createContext(null),
24
+ emptySubscribe = () => () => {},
25
+ emptyGet = () => null;
26
+ function TeleportAdaptContents() {
27
+ const store = useContext(AdaptChildrenStoreContext),
28
+ children = React.useSyncExternalStore(store?.subscribe ?? emptySubscribe, store?.get ?? emptyGet, store?.get ?? emptyGet);
29
+ return /* @__PURE__ */jsx(Fragment, {
30
+ children
31
+ });
32
+ }
33
+ const AdaptContext = createStyledContext({
34
+ Contents: null,
35
+ scopeName: "",
36
+ portalName: "",
37
+ platform: null,
38
+ setPlatform: x => {},
39
+ when: null,
40
+ setWhen: () => {}
41
+ }),
42
+ LastAdaptContextScope = createContext(""),
43
+ ProvideAdaptContext = ({
44
+ children,
45
+ ...context
46
+ }) => {
47
+ const scope = context.scopeName || "",
48
+ lastScope = useContext(LastAdaptContextScope);
49
+ return /* @__PURE__ */jsx(LastAdaptContextScope.Provider, {
50
+ value: lastScope || context.lastScope || "",
51
+ children: /* @__PURE__ */jsx(AdaptContext.Provider, {
52
+ scope,
53
+ lastScope: lastScope || context.lastScope,
54
+ ...context,
55
+ children
56
+ })
57
+ });
58
+ },
59
+ useAdaptContext = scope => {
60
+ const lastScope = useContext(LastAdaptContextScope),
61
+ adaptScope = scope ?? lastScope;
62
+ return AdaptContext.useStyledContext(adaptScope);
63
+ },
64
+ AdaptPortals = /* @__PURE__ */new Map(),
65
+ AdaptParent = ({
66
+ children,
67
+ Contents,
68
+ scope,
69
+ portal
70
+ }) => {
71
+ const id = useId(),
72
+ portalName = `AdaptPortal${scope}${id}`,
73
+ childrenStoreRef = React.useRef(null);
74
+ childrenStoreRef.current || (childrenStoreRef.current = createAdaptChildrenStore());
75
+ const isTeleport = !1,
76
+ FinalContents = useMemo(() => {
77
+ if (Contents) return Contents;
78
+ if (isTeleport) return TeleportAdaptContents;
79
+ if (AdaptPortals.has(portalName)) return AdaptPortals.get(portalName);
80
+ const element = () => /* @__PURE__ */jsx(PortalHost, {
81
+ name: portalName,
82
+ forwardProps: typeof portal == "boolean" ? void 0 : portal?.forwardProps
83
+ }, id);
84
+ return AdaptPortals.set(portalName, element), element;
85
+ }, [portalName, Contents, isTeleport]);
86
+ useIsomorphicLayoutEffect(() => {
87
+ if (!isTeleport) return AdaptPortals.set(portalName, FinalContents), () => {
88
+ AdaptPortals.delete(portalName);
89
+ };
90
+ }, [portalName, isTeleport]);
91
+ const [when, setWhen] = React.useState(null),
92
+ [platform, setPlatform] = React.useState(null);
93
+ return /* @__PURE__ */jsx(AdaptChildrenStoreContext.Provider, {
94
+ value: childrenStoreRef.current,
95
+ children: /* @__PURE__ */jsx(LastAdaptContextScope.Provider, {
96
+ value: scope,
97
+ children: /* @__PURE__ */jsx(ProvideAdaptContext, {
98
+ Contents: FinalContents,
99
+ when,
100
+ platform,
101
+ setPlatform,
102
+ setWhen,
103
+ portalName,
104
+ scopeName: scope,
105
+ children
106
+ })
107
+ })
108
+ });
109
+ },
110
+ AdaptContents = ({
111
+ scope,
112
+ ...rest
113
+ }) => {
114
+ const context = useAdaptContext(scope);
115
+ if (!context?.Contents) throw new Error(process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.");
116
+ return React.createElement(context.Contents, {
117
+ ...rest,
118
+ key: "stable"
119
+ });
120
+ };
121
+ AdaptContents.shouldForwardSpace = !0;
122
+ const Adapt = withStaticProperties(function (props) {
123
+ const {
124
+ platform,
125
+ when,
126
+ children,
127
+ scope
128
+ } = props,
129
+ context = useAdaptContext(scope),
130
+ enabled = useAdaptIsActiveGiven(props);
131
+ useIsomorphicLayoutEffect(() => {
132
+ context?.setWhen?.(when || enabled), context?.setPlatform?.(platform || null);
133
+ }, [when, platform, enabled, context.setWhen, context.setPlatform]), useIsomorphicLayoutEffect(() => () => {
134
+ context?.setWhen?.(null), context?.setPlatform?.(null);
135
+ }, []);
136
+ let output;
137
+ if (typeof children == "function") {
138
+ const Component = context?.Contents;
139
+ output = children(Component ? /* @__PURE__ */jsx(Component, {}) : null);
140
+ } else output = children;
141
+ return /* @__PURE__ */jsx(StackZIndexContext, {
142
+ children: enabled ? output : null
143
+ });
144
+ }, {
145
+ Contents: AdaptContents
146
+ }),
147
+ AdaptPortalContents = props => {
148
+ const isActive = useAdaptIsActive(props.scope),
149
+ {
150
+ portalName
151
+ } = useAdaptContext(props.scope),
152
+ childrenStore = useContext(AdaptChildrenStoreContext);
153
+ return !isWeb && getPortal().state.type === "teleport" && childrenStore ? /* @__PURE__ */jsx(AdaptPortalTeleport, {
154
+ isActive,
155
+ store: childrenStore,
156
+ children: props.children
157
+ }) : /* @__PURE__ */jsx(PortalItem, {
158
+ passThrough: !isActive,
159
+ hostName: portalName,
160
+ children: props.children
161
+ });
162
+ };
163
+ function AdaptPortalTeleport({
164
+ isActive,
165
+ store,
166
+ children
167
+ }) {
168
+ return useIsomorphicLayoutEffect(() => {
169
+ if (isActive) return store.set(children), () => store.set(null);
170
+ }), isActive ? null : /* @__PURE__ */jsx(Fragment, {
171
+ children
172
+ });
173
+ }
174
+ const useAdaptIsActiveGiven = ({
175
+ when,
176
+ platform
177
+ }) => {
178
+ const media = useMedia();
179
+ if (when == null && platform == null) return !1;
180
+ if (when === !0) return !0;
181
+ let enabled = !1;
182
+ return platform === "touch" ? enabled = isTouchable : platform === "native" ? enabled = !isWeb : platform === "web" ? enabled = isWeb : platform === "ios" ? enabled = isIos : platform === "android" && (enabled = isAndroid), platform && enabled == !1 ? !1 : (when && typeof when == "string" && (enabled = media[when]), enabled);
183
+ },
184
+ useAdaptIsActive = scope => {
185
+ const props = useAdaptContext(scope);
186
+ return useAdaptIsActiveGiven(props);
187
+ };
188
+ export { Adapt, AdaptContents, AdaptContext, AdaptParent, AdaptPortalContents, ProvideAdaptContext, useAdaptContext, useAdaptIsActive };
189
+ //# sourceMappingURL=Adapt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["isAndroid","isIos","isTouchable","isWeb","useIsomorphicLayoutEffect","createStyledContext","useMedia","withStaticProperties","getPortal","PortalHost","PortalItem","StackZIndexContext","React","createContext","useContext","useId","useMemo","Fragment","jsx","createAdaptChildrenStore","children","listeners","Set","set","c","l","get","subscribe","callback","add","delete","AdaptChildrenStoreContext","emptySubscribe","emptyGet","TeleportAdaptContents","store","useSyncExternalStore","AdaptContext","Contents","scopeName","portalName","platform","setPlatform","x","when","setWhen","LastAdaptContextScope","ProvideAdaptContext","context","scope","lastScope","Provider","value","useAdaptContext","adaptScope","useStyledContext","AdaptPortals","Map","AdaptParent","portal","id","childrenStoreRef","useRef","current","isTeleport","FinalContents","has","element","name","forwardProps","useState","AdaptContents","rest","Error","process","env","NODE_ENV","createElement","key","shouldForwardSpace","Adapt","props","enabled","useAdaptIsActiveGiven","output","Component","AdaptPortalContents","isActive","useAdaptIsActive","childrenStore","state","type","AdaptPortalTeleport","passThrough","hostName","media"],"sources":["../../src/Adapt.tsx"],"sourcesContent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AAMsD,KAAA,GAAQzF,QAAA,CAAS;IAEvB,IAAIsC,IAAA,IAAQ,QAAQH,QAAA,IAAY,MAC9B,OAAO;IAGT,IAAIG,IAAA,KAAS,IACX,OAAO;IAGT,IAAIsC,OAAA,GAAU;IAQd,OANIzC,QAAA,KAAa,UAASyC,OAAA,GAAUhF,WAAA,GAC3BuC,QAAA,KAAa,WAAUyC,OAAA,GAAU,CAAC/E,KAAA,GAClCsC,QAAA,KAAa,QAAOyC,OAAA,GAAU/E,KAAA,GAC9BsC,QAAA,KAAa,QAAOyC,OAAA,GAAUjF,KAAA,GAC9BwC,QAAA,KAAa,cAAWyC,OAAA,GAAUlF,SAAA,GAEvCyC,QAAA,IAAYyC,OAAA,IAAW,KAClB,MAGLtC,IAAA,IAAQ,OAAOA,IAAA,IAAS,aAC1BsC,OAAA,GAAUa,KAAA,CAAMnD,IAAI,IAGfsC,OAAA;EACT;EAEaM,gBAAA,GAAoBvC,KAAA,IAAmB;IAClD,MAAMgC,KAAA,GAAQ5B,eAAA,CAAgBJ,KAAK;IACnC,OAAOkC,qBAAA,CAAsBF,KAAK;EACpC","ignoreList":[]}
@@ -0,0 +1,230 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { isAndroid, isIos, isTouchable, isWeb, useIsomorphicLayoutEffect } from "@hanzo/gui-constants";
3
+ import { createStyledContext, useMedia } from "@hanzo/gui-core";
4
+ import { withStaticProperties } from "@hanzo/gui-helpers";
5
+ import { getPortal } from "@hanzo/gui-native";
6
+ import { PortalHost, PortalItem } from "@hanzo/gui-portal";
7
+ import { StackZIndexContext } from "@hanzo/gui-z-index-stack";
8
+ import React, { createContext, useContext, useId, useMemo } from "react";
9
+ function createAdaptChildrenStore() {
10
+ var children = null,
11
+ listeners = /* @__PURE__ */new Set();
12
+ return {
13
+ set(c) {
14
+ children = c;
15
+ var _iteratorNormalCompletion = !0,
16
+ _didIteratorError = !1,
17
+ _iteratorError = void 0;
18
+ try {
19
+ for (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
20
+ var l = _step.value;
21
+ l();
22
+ }
23
+ } catch (err) {
24
+ _didIteratorError = !0, _iteratorError = err;
25
+ } finally {
26
+ try {
27
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
28
+ } finally {
29
+ if (_didIteratorError) throw _iteratorError;
30
+ }
31
+ }
32
+ },
33
+ get: function () {
34
+ return children;
35
+ },
36
+ subscribe(callback) {
37
+ return listeners.add(callback), function () {
38
+ return listeners.delete(callback);
39
+ };
40
+ }
41
+ };
42
+ }
43
+ var AdaptChildrenStoreContext = /* @__PURE__ */createContext(null),
44
+ emptySubscribe = function () {
45
+ return function () {};
46
+ },
47
+ emptyGet = function () {
48
+ return null;
49
+ };
50
+ function TeleportAdaptContents() {
51
+ var store = useContext(AdaptChildrenStoreContext),
52
+ _store_subscribe,
53
+ _store_get,
54
+ _store_get1,
55
+ children = React.useSyncExternalStore((_store_subscribe = store?.subscribe) !== null && _store_subscribe !== void 0 ? _store_subscribe : emptySubscribe, (_store_get = store?.get) !== null && _store_get !== void 0 ? _store_get : emptyGet, (_store_get1 = store?.get) !== null && _store_get1 !== void 0 ? _store_get1 : emptyGet);
56
+ return /* @__PURE__ */_jsx(_Fragment, {
57
+ children
58
+ });
59
+ }
60
+ var AdaptContext = createStyledContext({
61
+ Contents: null,
62
+ scopeName: "",
63
+ portalName: "",
64
+ platform: null,
65
+ setPlatform: function (x) {},
66
+ when: null,
67
+ setWhen: function () {}
68
+ }),
69
+ LastAdaptContextScope = /* @__PURE__ */createContext(""),
70
+ ProvideAdaptContext = function (param) {
71
+ var {
72
+ children,
73
+ ...context
74
+ } = param,
75
+ scope = context.scopeName || "",
76
+ lastScope = useContext(LastAdaptContextScope);
77
+ return /* @__PURE__ */_jsx(LastAdaptContextScope.Provider, {
78
+ value: lastScope || context.lastScope || "",
79
+ children: /* @__PURE__ */_jsx(AdaptContext.Provider, {
80
+ scope,
81
+ lastScope: lastScope || context.lastScope,
82
+ ...context,
83
+ children
84
+ })
85
+ });
86
+ },
87
+ useAdaptContext = function (scope) {
88
+ var lastScope = useContext(LastAdaptContextScope),
89
+ adaptScope = scope ?? lastScope;
90
+ return AdaptContext.useStyledContext(adaptScope);
91
+ },
92
+ AdaptPortals = /* @__PURE__ */new Map(),
93
+ AdaptParent = function (param) {
94
+ var {
95
+ children,
96
+ Contents,
97
+ scope,
98
+ portal
99
+ } = param,
100
+ id = useId(),
101
+ portalName = `AdaptPortal${scope}${id}`,
102
+ childrenStoreRef = React.useRef(null);
103
+ childrenStoreRef.current || (childrenStoreRef.current = createAdaptChildrenStore());
104
+ var isTeleport = getPortal().state.type === "teleport",
105
+ FinalContents = useMemo(function () {
106
+ if (Contents) return Contents;
107
+ if (isTeleport) return TeleportAdaptContents;
108
+ if (AdaptPortals.has(portalName)) return AdaptPortals.get(portalName);
109
+ var element = function () {
110
+ return /* @__PURE__ */_jsx(PortalHost, {
111
+ name: portalName,
112
+ forwardProps: typeof portal == "boolean" ? void 0 : portal?.forwardProps
113
+ }, id);
114
+ };
115
+ return AdaptPortals.set(portalName, element), element;
116
+ }, [portalName, Contents, isTeleport]);
117
+ useIsomorphicLayoutEffect(function () {
118
+ if (!isTeleport) return AdaptPortals.set(portalName, FinalContents), function () {
119
+ AdaptPortals.delete(portalName);
120
+ };
121
+ }, [portalName, isTeleport]);
122
+ var [when, setWhen] = React.useState(null),
123
+ [platform, setPlatform] = React.useState(null);
124
+ return /* @__PURE__ */_jsx(AdaptChildrenStoreContext.Provider, {
125
+ value: childrenStoreRef.current,
126
+ children: /* @__PURE__ */_jsx(LastAdaptContextScope.Provider, {
127
+ value: scope,
128
+ children: /* @__PURE__ */_jsx(ProvideAdaptContext, {
129
+ Contents: FinalContents,
130
+ when,
131
+ platform,
132
+ setPlatform,
133
+ setWhen,
134
+ portalName,
135
+ scopeName: scope,
136
+ children
137
+ })
138
+ })
139
+ });
140
+ },
141
+ AdaptContents = function (param) {
142
+ var {
143
+ scope,
144
+ ...rest
145
+ } = param,
146
+ context = useAdaptContext(scope);
147
+ if (!context?.Contents) throw new Error(process.env.NODE_ENV === "production" ? "tamagui.dev/docs/intro/errors#warning-002" : "You're rendering a Tamagui <Adapt /> component without nesting it inside a parent that is able to adapt.");
148
+ return /* @__PURE__ */React.createElement(context.Contents, {
149
+ ...rest,
150
+ key: "stable"
151
+ });
152
+ };
153
+ AdaptContents.shouldForwardSpace = !0;
154
+ var Adapt = withStaticProperties(function (props) {
155
+ var {
156
+ platform,
157
+ when,
158
+ children,
159
+ scope
160
+ } = props,
161
+ context = useAdaptContext(scope),
162
+ enabled = useAdaptIsActiveGiven(props);
163
+ useIsomorphicLayoutEffect(function () {
164
+ var _context_setWhen, _context_setPlatform;
165
+ context == null || (_context_setWhen = context.setWhen) === null || _context_setWhen === void 0 || _context_setWhen.call(context, when || enabled), context == null || (_context_setPlatform = context.setPlatform) === null || _context_setPlatform === void 0 || _context_setPlatform.call(context, platform || null);
166
+ }, [when, platform, enabled, context.setWhen, context.setPlatform]), useIsomorphicLayoutEffect(function () {
167
+ return function () {
168
+ var _context_setWhen, _context_setPlatform;
169
+ context == null || (_context_setWhen = context.setWhen) === null || _context_setWhen === void 0 || _context_setWhen.call(context, null), context == null || (_context_setPlatform = context.setPlatform) === null || _context_setPlatform === void 0 || _context_setPlatform.call(context, null);
170
+ };
171
+ }, []);
172
+ var output;
173
+ if (typeof children == "function") {
174
+ var Component = context?.Contents;
175
+ output = children(Component ? /* @__PURE__ */_jsx(Component, {}) : null);
176
+ } else output = children;
177
+ return /* @__PURE__ */_jsx(StackZIndexContext, {
178
+ children: enabled ? output : null
179
+ });
180
+ }, {
181
+ Contents: AdaptContents
182
+ }),
183
+ AdaptPortalContents = function (props) {
184
+ var isActive = useAdaptIsActive(props.scope),
185
+ {
186
+ portalName
187
+ } = useAdaptContext(props.scope),
188
+ childrenStore = useContext(AdaptChildrenStoreContext),
189
+ isTeleport = !isWeb && getPortal().state.type === "teleport";
190
+ return isTeleport && childrenStore ? /* @__PURE__ */_jsx(AdaptPortalTeleport, {
191
+ isActive,
192
+ store: childrenStore,
193
+ children: props.children
194
+ }) : /* @__PURE__ */_jsx(PortalItem, {
195
+ passThrough: !isActive,
196
+ hostName: portalName,
197
+ children: props.children
198
+ });
199
+ };
200
+ function AdaptPortalTeleport(param) {
201
+ var {
202
+ isActive,
203
+ store,
204
+ children
205
+ } = param;
206
+ return useIsomorphicLayoutEffect(function () {
207
+ if (isActive) return store.set(children), function () {
208
+ return store.set(null);
209
+ };
210
+ }), isActive ? null : /* @__PURE__ */_jsx(_Fragment, {
211
+ children
212
+ });
213
+ }
214
+ var useAdaptIsActiveGiven = function (param) {
215
+ var {
216
+ when,
217
+ platform
218
+ } = param,
219
+ media = useMedia();
220
+ if (when == null && platform == null) return !1;
221
+ if (when === !0) return !0;
222
+ var enabled = !1;
223
+ return platform === "touch" ? enabled = isTouchable : platform === "native" ? enabled = !isWeb : platform === "web" ? enabled = isWeb : platform === "ios" ? enabled = isIos : platform === "android" && (enabled = isAndroid), platform && enabled == !1 ? !1 : (when && typeof when == "string" && (enabled = media[when]), enabled);
224
+ },
225
+ useAdaptIsActive = function (scope) {
226
+ var props = useAdaptContext(scope);
227
+ return useAdaptIsActiveGiven(props);
228
+ };
229
+ export { Adapt, AdaptContents, AdaptContext, AdaptParent, AdaptPortalContents, ProvideAdaptContext, useAdaptContext, useAdaptIsActive };
230
+ //# sourceMappingURL=Adapt.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["jsx","_jsx","Fragment","_Fragment","isAndroid","isIos","isTouchable","isWeb","useIsomorphicLayoutEffect","createStyledContext","useMedia","withStaticProperties","getPortal","PortalHost","PortalItem","StackZIndexContext","React","createContext","useContext","useId","useMemo","createAdaptChildrenStore","children","listeners","Set","set","c","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","l","value","err","return","get","subscribe","callback","add","delete","AdaptChildrenStoreContext","emptySubscribe","emptyGet","TeleportAdaptContents","store","_store_subscribe","_store_get","_store_get1","useSyncExternalStore","AdaptContext","Contents","scopeName","portalName","platform","setPlatform","x","when","setWhen","LastAdaptContextScope","ProvideAdaptContext","param","context","scope","lastScope","Provider","useAdaptContext","adaptScope","useStyledContext","AdaptPortals","Map","AdaptParent","portal","id","childrenStoreRef","useRef","current","isTeleport","state","type","FinalContents","has","element","name","forwardProps","useState","AdaptContents","rest","Error","process","env","NODE_ENV","createElement","key","shouldForwardSpace","Adapt","props","enabled","useAdaptIsActiveGiven","_context_setWhen","_context_setPlatform","call","output","Component"],"sources":["../../src/Adapt.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAAA,SACEC,SAAA,EAAAC,KAAA,EAAAC,WAAA,EAAAC,KAAA,EAAAC,yBAAA;AAAA,SACAC,mBAAA,EAAAC,QAAA;AAAA,SACAC,oBAAA;AAAA,SACAC,SAAA;AAAA,SACAC,UAAA,EAAAC,UAAA;AAAA,SACKC,kBAAA;AAEP,OAAAC,KAAS,IAAAC,aAAA,EAAqBC,UAAA,EAAAC,KAAgB,EAAAC,OAAA;AAC9C,SAASC,yBAAA;EACT,IAAAC,QAAS;IAAAC,SAAiB,sBAAAC,GAAA;EAC1B,OAAS;IACTC,IAAAC,CAAS;MACTJ,QAAO,GAASI,CAAA;MA2CP,IAAAC,yBAAA;QAAAC,iBAAA;QAAAC,cAAA;MA7BT,IAAS;QACH,SAA4BC,SAAA,GAAAP,SAAA,CAAAQ,MAAA,CAAAC,QAAA,KAAAC,KAAA,IAAAN,yBAAA,IAAAM,KAAA,GAAAH,SAAA,CAAAI,IAAA,IAAAC,IAAA,GAAAR,yBAAA;UAC1B,IAAAS,CAAA,GAAAH,KAAY,CAAAI,KAAA;UACXD,CAAA;QACD;MACF,SAAAE,GAAW;QACXV,iBAAgB,OAAWC,cAAE,GAAAS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F,QAAS,CAAAqF,SAAA,kBAAA1G,IAAA,CAAA0G,SAAA;IACX,OAGFD,MAAI,GAAApF,QAAU;IAQd,OANI,eAAarB,IAAA,CAAAc,kBAAmB;MAiBzBO,QAAA,EAAA+E,OAAA,GAAoBK,MAAA,GAAmB;IAClD;EACA;IACFnD,QAAA,EAAAmC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./Adapt.mjs";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./Adapt.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./Adapt.native.js";
2
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@hanzogui/adapt",
3
+ "version": "2.0.0",
4
+ "files": [
5
+ "src",
6
+ "types",
7
+ "dist"
8
+ ],
9
+ "type": "module",
10
+ "sideEffects": [
11
+ "*.css"
12
+ ],
13
+ "main": "dist/cjs",
14
+ "module": "dist/esm",
15
+ "types": "./types/index.d.ts",
16
+ "exports": {
17
+ "./package.json": "./package.json",
18
+ ".": {
19
+ "types": "./types/index.d.ts",
20
+ "react-native": "./dist/esm/index.native.js",
21
+ "browser": "./dist/esm/index.mjs",
22
+ "module": "./dist/esm/index.mjs",
23
+ "import": "./dist/esm/index.mjs",
24
+ "require": "./dist/cjs/index.cjs",
25
+ "default": "./dist/esm/index.mjs"
26
+ }
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "scripts": {
32
+ "build": "hanzo-gui-build",
33
+ "watch": "hanzo-gui-build --watch",
34
+ "clean": "hanzo-gui-build clean",
35
+ "clean:build": "hanzo-gui-build clean:build"
36
+ },
37
+ "dependencies": {
38
+ "@hanzogui/constants": "2.0.0-rc.29",
39
+ "@hanzogui/core": "2.0.0-rc.29",
40
+ "@hanzogui/helpers": "2.0.0-rc.29",
41
+ "@hanzogui/portal": "2.0.0",
42
+ "@hanzogui/z-index-stack": "2.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@hanzogui/build": "2.0.0-rc.29",
46
+ "react": ">=19"
47
+ },
48
+ "peerDependencies": {
49
+ "react": ">=19"
50
+ }
51
+ }