@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.
- package/LICENSE +21 -0
- package/dist/cjs/Adapt.cjs +230 -0
- package/dist/cjs/Adapt.native.js +274 -0
- package/dist/cjs/Adapt.native.js.map +1 -0
- package/dist/cjs/index.cjs +18 -0
- package/dist/cjs/index.native.js +21 -0
- package/dist/cjs/index.native.js.map +1 -0
- package/dist/esm/Adapt.mjs +189 -0
- package/dist/esm/Adapt.mjs.map +1 -0
- package/dist/esm/Adapt.native.js +230 -0
- package/dist/esm/Adapt.native.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/index.mjs +2 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/index.native.js +2 -0
- package/dist/esm/index.native.js.map +1 -0
- package/package.json +51 -0
- package/src/Adapt.tsx +356 -0
- package/src/index.tsx +1 -0
- package/types/Adapt.d.ts +67 -0
- package/types/index.d.ts +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Nate Wienert
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var Adapt_exports = {};
|
|
33
|
+
__export(Adapt_exports, {
|
|
34
|
+
Adapt: () => Adapt,
|
|
35
|
+
AdaptContents: () => AdaptContents,
|
|
36
|
+
AdaptContext: () => AdaptContext,
|
|
37
|
+
AdaptParent: () => AdaptParent,
|
|
38
|
+
AdaptPortalContents: () => AdaptPortalContents,
|
|
39
|
+
ProvideAdaptContext: () => ProvideAdaptContext,
|
|
40
|
+
useAdaptContext: () => useAdaptContext,
|
|
41
|
+
useAdaptIsActive: () => useAdaptIsActive
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(Adapt_exports);
|
|
44
|
+
var import_gui_constants = require("@hanzo/gui-constants"),
|
|
45
|
+
import_gui_core = require("@hanzo/gui-core"),
|
|
46
|
+
import_gui_helpers = require("@hanzo/gui-helpers"),
|
|
47
|
+
import_gui_native = require("@hanzo/gui-native"),
|
|
48
|
+
import_gui_portal = require("@hanzo/gui-portal"),
|
|
49
|
+
import_gui_z_index_stack = require("@hanzo/gui-z-index-stack"),
|
|
50
|
+
import_react = __toESM(require("react"), 1),
|
|
51
|
+
import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
+
function createAdaptChildrenStore() {
|
|
53
|
+
let children = null;
|
|
54
|
+
const listeners = /* @__PURE__ */new Set();
|
|
55
|
+
return {
|
|
56
|
+
set(c) {
|
|
57
|
+
children = c;
|
|
58
|
+
for (const l of listeners) l();
|
|
59
|
+
},
|
|
60
|
+
get: () => children,
|
|
61
|
+
subscribe(callback) {
|
|
62
|
+
return listeners.add(callback), () => listeners.delete(callback);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const AdaptChildrenStoreContext = (0, import_react.createContext)(null),
|
|
67
|
+
emptySubscribe = () => () => {},
|
|
68
|
+
emptyGet = () => null;
|
|
69
|
+
function TeleportAdaptContents() {
|
|
70
|
+
const store = (0, import_react.useContext)(AdaptChildrenStoreContext),
|
|
71
|
+
children = import_react.default.useSyncExternalStore(store?.subscribe ?? emptySubscribe, store?.get ?? emptyGet, store?.get ?? emptyGet);
|
|
72
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
73
|
+
children
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const AdaptContext = (0, import_gui_core.createStyledContext)({
|
|
77
|
+
Contents: null,
|
|
78
|
+
scopeName: "",
|
|
79
|
+
portalName: "",
|
|
80
|
+
platform: null,
|
|
81
|
+
setPlatform: x => {},
|
|
82
|
+
when: null,
|
|
83
|
+
setWhen: () => {}
|
|
84
|
+
}),
|
|
85
|
+
LastAdaptContextScope = (0, import_react.createContext)(""),
|
|
86
|
+
ProvideAdaptContext = ({
|
|
87
|
+
children,
|
|
88
|
+
...context
|
|
89
|
+
}) => {
|
|
90
|
+
const scope = context.scopeName || "",
|
|
91
|
+
lastScope = (0, import_react.useContext)(LastAdaptContextScope);
|
|
92
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(LastAdaptContextScope.Provider, {
|
|
93
|
+
value: lastScope || context.lastScope || "",
|
|
94
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(AdaptContext.Provider, {
|
|
95
|
+
scope,
|
|
96
|
+
lastScope: lastScope || context.lastScope,
|
|
97
|
+
...context,
|
|
98
|
+
children
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
useAdaptContext = scope => {
|
|
103
|
+
const lastScope = (0, import_react.useContext)(LastAdaptContextScope),
|
|
104
|
+
adaptScope = scope ?? lastScope;
|
|
105
|
+
return AdaptContext.useStyledContext(adaptScope);
|
|
106
|
+
},
|
|
107
|
+
AdaptPortals = /* @__PURE__ */new Map(),
|
|
108
|
+
AdaptParent = ({
|
|
109
|
+
children,
|
|
110
|
+
Contents,
|
|
111
|
+
scope,
|
|
112
|
+
portal
|
|
113
|
+
}) => {
|
|
114
|
+
const id = (0, import_react.useId)(),
|
|
115
|
+
portalName = `AdaptPortal${scope}${id}`,
|
|
116
|
+
childrenStoreRef = import_react.default.useRef(null);
|
|
117
|
+
childrenStoreRef.current || (childrenStoreRef.current = createAdaptChildrenStore());
|
|
118
|
+
const isTeleport = !1,
|
|
119
|
+
FinalContents = (0, import_react.useMemo)(() => {
|
|
120
|
+
if (Contents) return Contents;
|
|
121
|
+
if (isTeleport) return TeleportAdaptContents;
|
|
122
|
+
if (AdaptPortals.has(portalName)) return AdaptPortals.get(portalName);
|
|
123
|
+
const element = () => /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_portal.PortalHost, {
|
|
124
|
+
name: portalName,
|
|
125
|
+
forwardProps: typeof portal == "boolean" ? void 0 : portal?.forwardProps
|
|
126
|
+
}, id);
|
|
127
|
+
return AdaptPortals.set(portalName, element), element;
|
|
128
|
+
}, [portalName, Contents, isTeleport]);
|
|
129
|
+
(0, import_gui_constants.useIsomorphicLayoutEffect)(() => {
|
|
130
|
+
if (!isTeleport) return AdaptPortals.set(portalName, FinalContents), () => {
|
|
131
|
+
AdaptPortals.delete(portalName);
|
|
132
|
+
};
|
|
133
|
+
}, [portalName, isTeleport]);
|
|
134
|
+
const [when, setWhen] = import_react.default.useState(null),
|
|
135
|
+
[platform, setPlatform] = import_react.default.useState(null);
|
|
136
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(AdaptChildrenStoreContext.Provider, {
|
|
137
|
+
value: childrenStoreRef.current,
|
|
138
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(LastAdaptContextScope.Provider, {
|
|
139
|
+
value: scope,
|
|
140
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(ProvideAdaptContext, {
|
|
141
|
+
Contents: FinalContents,
|
|
142
|
+
when,
|
|
143
|
+
platform,
|
|
144
|
+
setPlatform,
|
|
145
|
+
setWhen,
|
|
146
|
+
portalName,
|
|
147
|
+
scopeName: scope,
|
|
148
|
+
children
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
},
|
|
153
|
+
AdaptContents = ({
|
|
154
|
+
scope,
|
|
155
|
+
...rest
|
|
156
|
+
}) => {
|
|
157
|
+
const context = useAdaptContext(scope);
|
|
158
|
+
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.");
|
|
159
|
+
return import_react.default.createElement(context.Contents, {
|
|
160
|
+
...rest,
|
|
161
|
+
key: "stable"
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
AdaptContents.shouldForwardSpace = !0;
|
|
165
|
+
const Adapt = (0, import_gui_helpers.withStaticProperties)(function (props) {
|
|
166
|
+
const {
|
|
167
|
+
platform,
|
|
168
|
+
when,
|
|
169
|
+
children,
|
|
170
|
+
scope
|
|
171
|
+
} = props,
|
|
172
|
+
context = useAdaptContext(scope),
|
|
173
|
+
enabled = useAdaptIsActiveGiven(props);
|
|
174
|
+
(0, import_gui_constants.useIsomorphicLayoutEffect)(() => {
|
|
175
|
+
context?.setWhen?.(when || enabled), context?.setPlatform?.(platform || null);
|
|
176
|
+
}, [when, platform, enabled, context.setWhen, context.setPlatform]), (0, import_gui_constants.useIsomorphicLayoutEffect)(() => () => {
|
|
177
|
+
context?.setWhen?.(null), context?.setPlatform?.(null);
|
|
178
|
+
}, []);
|
|
179
|
+
let output;
|
|
180
|
+
if (typeof children == "function") {
|
|
181
|
+
const Component = context?.Contents;
|
|
182
|
+
output = children(Component ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(Component, {}) : null);
|
|
183
|
+
} else output = children;
|
|
184
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_z_index_stack.StackZIndexContext, {
|
|
185
|
+
children: enabled ? output : null
|
|
186
|
+
});
|
|
187
|
+
}, {
|
|
188
|
+
Contents: AdaptContents
|
|
189
|
+
}),
|
|
190
|
+
AdaptPortalContents = props => {
|
|
191
|
+
const isActive = useAdaptIsActive(props.scope),
|
|
192
|
+
{
|
|
193
|
+
portalName
|
|
194
|
+
} = useAdaptContext(props.scope),
|
|
195
|
+
childrenStore = (0, import_react.useContext)(AdaptChildrenStoreContext);
|
|
196
|
+
return !import_gui_constants.isWeb && (0, import_gui_native.getPortal)().state.type === "teleport" && childrenStore ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(AdaptPortalTeleport, {
|
|
197
|
+
isActive,
|
|
198
|
+
store: childrenStore,
|
|
199
|
+
children: props.children
|
|
200
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_portal.PortalItem, {
|
|
201
|
+
passThrough: !isActive,
|
|
202
|
+
hostName: portalName,
|
|
203
|
+
children: props.children
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
function AdaptPortalTeleport({
|
|
207
|
+
isActive,
|
|
208
|
+
store,
|
|
209
|
+
children
|
|
210
|
+
}) {
|
|
211
|
+
return (0, import_gui_constants.useIsomorphicLayoutEffect)(() => {
|
|
212
|
+
if (isActive) return store.set(children), () => store.set(null);
|
|
213
|
+
}), isActive ? null : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
214
|
+
children
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
const useAdaptIsActiveGiven = ({
|
|
218
|
+
when,
|
|
219
|
+
platform
|
|
220
|
+
}) => {
|
|
221
|
+
const media = (0, import_gui_core.useMedia)();
|
|
222
|
+
if (when == null && platform == null) return !1;
|
|
223
|
+
if (when === !0) return !0;
|
|
224
|
+
let enabled = !1;
|
|
225
|
+
return platform === "touch" ? enabled = import_gui_constants.isTouchable : platform === "native" ? enabled = !import_gui_constants.isWeb : platform === "web" ? enabled = import_gui_constants.isWeb : platform === "ios" ? enabled = import_gui_constants.isIos : platform === "android" && (enabled = import_gui_constants.isAndroid), platform && enabled == !1 ? !1 : (when && typeof when == "string" && (enabled = media[when]), enabled);
|
|
226
|
+
},
|
|
227
|
+
useAdaptIsActive = scope => {
|
|
228
|
+
const props = useAdaptContext(scope);
|
|
229
|
+
return useAdaptIsActiveGiven(props);
|
|
230
|
+
};
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
8
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: !0
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
__copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
17
|
+
get: () => from[key],
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: !0
|
|
30
|
+
}) : target, mod)),
|
|
31
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
32
|
+
value: !0
|
|
33
|
+
}), mod);
|
|
34
|
+
var Adapt_exports = {};
|
|
35
|
+
__export(Adapt_exports, {
|
|
36
|
+
Adapt: () => Adapt,
|
|
37
|
+
AdaptContents: () => AdaptContents,
|
|
38
|
+
AdaptContext: () => AdaptContext,
|
|
39
|
+
AdaptParent: () => AdaptParent,
|
|
40
|
+
AdaptPortalContents: () => AdaptPortalContents,
|
|
41
|
+
ProvideAdaptContext: () => ProvideAdaptContext,
|
|
42
|
+
useAdaptContext: () => useAdaptContext,
|
|
43
|
+
useAdaptIsActive: () => useAdaptIsActive
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(Adapt_exports);
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
47
|
+
import_gui_constants = require("@hanzo/gui-constants"),
|
|
48
|
+
import_gui_core = require("@hanzo/gui-core"),
|
|
49
|
+
import_gui_helpers = require("@hanzo/gui-helpers"),
|
|
50
|
+
import_gui_native = require("@hanzo/gui-native"),
|
|
51
|
+
import_gui_portal = require("@hanzo/gui-portal"),
|
|
52
|
+
import_gui_z_index_stack = require("@hanzo/gui-z-index-stack"),
|
|
53
|
+
import_react = __toESM(require("react"), 1);
|
|
54
|
+
function createAdaptChildrenStore() {
|
|
55
|
+
var children = null,
|
|
56
|
+
listeners = /* @__PURE__ */new Set();
|
|
57
|
+
return {
|
|
58
|
+
set(c) {
|
|
59
|
+
children = c;
|
|
60
|
+
var _iteratorNormalCompletion = !0,
|
|
61
|
+
_didIteratorError = !1,
|
|
62
|
+
_iteratorError = void 0;
|
|
63
|
+
try {
|
|
64
|
+
for (var _iterator = listeners[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
65
|
+
var l = _step.value;
|
|
66
|
+
l();
|
|
67
|
+
}
|
|
68
|
+
} catch (err) {
|
|
69
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
70
|
+
} finally {
|
|
71
|
+
try {
|
|
72
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
73
|
+
} finally {
|
|
74
|
+
if (_didIteratorError) throw _iteratorError;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
get: function () {
|
|
79
|
+
return children;
|
|
80
|
+
},
|
|
81
|
+
subscribe(callback) {
|
|
82
|
+
return listeners.add(callback), function () {
|
|
83
|
+
return listeners.delete(callback);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
var AdaptChildrenStoreContext = /* @__PURE__ */(0, import_react.createContext)(null),
|
|
89
|
+
emptySubscribe = function () {
|
|
90
|
+
return function () {};
|
|
91
|
+
},
|
|
92
|
+
emptyGet = function () {
|
|
93
|
+
return null;
|
|
94
|
+
};
|
|
95
|
+
function TeleportAdaptContents() {
|
|
96
|
+
var store = (0, import_react.useContext)(AdaptChildrenStoreContext),
|
|
97
|
+
_store_subscribe,
|
|
98
|
+
_store_get,
|
|
99
|
+
_store_get1,
|
|
100
|
+
children = import_react.default.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);
|
|
101
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
102
|
+
children
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
var AdaptContext = (0, import_gui_core.createStyledContext)({
|
|
106
|
+
Contents: null,
|
|
107
|
+
scopeName: "",
|
|
108
|
+
portalName: "",
|
|
109
|
+
platform: null,
|
|
110
|
+
setPlatform: function (x) {},
|
|
111
|
+
when: null,
|
|
112
|
+
setWhen: function () {}
|
|
113
|
+
}),
|
|
114
|
+
LastAdaptContextScope = /* @__PURE__ */(0, import_react.createContext)(""),
|
|
115
|
+
ProvideAdaptContext = function (param) {
|
|
116
|
+
var {
|
|
117
|
+
children,
|
|
118
|
+
...context
|
|
119
|
+
} = param,
|
|
120
|
+
scope = context.scopeName || "",
|
|
121
|
+
lastScope = (0, import_react.useContext)(LastAdaptContextScope);
|
|
122
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(LastAdaptContextScope.Provider, {
|
|
123
|
+
value: lastScope || context.lastScope || "",
|
|
124
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(AdaptContext.Provider, {
|
|
125
|
+
scope,
|
|
126
|
+
lastScope: lastScope || context.lastScope,
|
|
127
|
+
...context,
|
|
128
|
+
children
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
useAdaptContext = function (scope) {
|
|
133
|
+
var lastScope = (0, import_react.useContext)(LastAdaptContextScope),
|
|
134
|
+
adaptScope = scope ?? lastScope;
|
|
135
|
+
return AdaptContext.useStyledContext(adaptScope);
|
|
136
|
+
},
|
|
137
|
+
AdaptPortals = /* @__PURE__ */new Map(),
|
|
138
|
+
AdaptParent = function (param) {
|
|
139
|
+
var {
|
|
140
|
+
children,
|
|
141
|
+
Contents,
|
|
142
|
+
scope,
|
|
143
|
+
portal
|
|
144
|
+
} = param,
|
|
145
|
+
id = (0, import_react.useId)(),
|
|
146
|
+
portalName = `AdaptPortal${scope}${id}`,
|
|
147
|
+
childrenStoreRef = import_react.default.useRef(null);
|
|
148
|
+
childrenStoreRef.current || (childrenStoreRef.current = createAdaptChildrenStore());
|
|
149
|
+
var isTeleport = (0, import_gui_native.getPortal)().state.type === "teleport",
|
|
150
|
+
FinalContents = (0, import_react.useMemo)(function () {
|
|
151
|
+
if (Contents) return Contents;
|
|
152
|
+
if (isTeleport) return TeleportAdaptContents;
|
|
153
|
+
if (AdaptPortals.has(portalName)) return AdaptPortals.get(portalName);
|
|
154
|
+
var element = function () {
|
|
155
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_portal.PortalHost, {
|
|
156
|
+
name: portalName,
|
|
157
|
+
forwardProps: typeof portal == "boolean" ? void 0 : portal?.forwardProps
|
|
158
|
+
}, id);
|
|
159
|
+
};
|
|
160
|
+
return AdaptPortals.set(portalName, element), element;
|
|
161
|
+
}, [portalName, Contents, isTeleport]);
|
|
162
|
+
(0, import_gui_constants.useIsomorphicLayoutEffect)(function () {
|
|
163
|
+
if (!isTeleport) return AdaptPortals.set(portalName, FinalContents), function () {
|
|
164
|
+
AdaptPortals.delete(portalName);
|
|
165
|
+
};
|
|
166
|
+
}, [portalName, isTeleport]);
|
|
167
|
+
var [when, setWhen] = import_react.default.useState(null),
|
|
168
|
+
[platform, setPlatform] = import_react.default.useState(null);
|
|
169
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(AdaptChildrenStoreContext.Provider, {
|
|
170
|
+
value: childrenStoreRef.current,
|
|
171
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(LastAdaptContextScope.Provider, {
|
|
172
|
+
value: scope,
|
|
173
|
+
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(ProvideAdaptContext, {
|
|
174
|
+
Contents: FinalContents,
|
|
175
|
+
when,
|
|
176
|
+
platform,
|
|
177
|
+
setPlatform,
|
|
178
|
+
setWhen,
|
|
179
|
+
portalName,
|
|
180
|
+
scopeName: scope,
|
|
181
|
+
children
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
AdaptContents = function (param) {
|
|
187
|
+
var {
|
|
188
|
+
scope,
|
|
189
|
+
...rest
|
|
190
|
+
} = param,
|
|
191
|
+
context = useAdaptContext(scope);
|
|
192
|
+
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.");
|
|
193
|
+
return /* @__PURE__ */import_react.default.createElement(context.Contents, {
|
|
194
|
+
...rest,
|
|
195
|
+
key: "stable"
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
AdaptContents.shouldForwardSpace = !0;
|
|
199
|
+
var Adapt = (0, import_gui_helpers.withStaticProperties)(function (props) {
|
|
200
|
+
var {
|
|
201
|
+
platform,
|
|
202
|
+
when,
|
|
203
|
+
children,
|
|
204
|
+
scope
|
|
205
|
+
} = props,
|
|
206
|
+
context = useAdaptContext(scope),
|
|
207
|
+
enabled = useAdaptIsActiveGiven(props);
|
|
208
|
+
(0, import_gui_constants.useIsomorphicLayoutEffect)(function () {
|
|
209
|
+
var _context_setWhen, _context_setPlatform;
|
|
210
|
+
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);
|
|
211
|
+
}, [when, platform, enabled, context.setWhen, context.setPlatform]), (0, import_gui_constants.useIsomorphicLayoutEffect)(function () {
|
|
212
|
+
return function () {
|
|
213
|
+
var _context_setWhen, _context_setPlatform;
|
|
214
|
+
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);
|
|
215
|
+
};
|
|
216
|
+
}, []);
|
|
217
|
+
var output;
|
|
218
|
+
if (typeof children == "function") {
|
|
219
|
+
var Component = context?.Contents;
|
|
220
|
+
output = children(Component ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(Component, {}) : null);
|
|
221
|
+
} else output = children;
|
|
222
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_z_index_stack.StackZIndexContext, {
|
|
223
|
+
children: enabled ? output : null
|
|
224
|
+
});
|
|
225
|
+
}, {
|
|
226
|
+
Contents: AdaptContents
|
|
227
|
+
}),
|
|
228
|
+
AdaptPortalContents = function (props) {
|
|
229
|
+
var isActive = useAdaptIsActive(props.scope),
|
|
230
|
+
{
|
|
231
|
+
portalName
|
|
232
|
+
} = useAdaptContext(props.scope),
|
|
233
|
+
childrenStore = (0, import_react.useContext)(AdaptChildrenStoreContext),
|
|
234
|
+
isTeleport = !import_gui_constants.isWeb && (0, import_gui_native.getPortal)().state.type === "teleport";
|
|
235
|
+
return isTeleport && childrenStore ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(AdaptPortalTeleport, {
|
|
236
|
+
isActive,
|
|
237
|
+
store: childrenStore,
|
|
238
|
+
children: props.children
|
|
239
|
+
}) : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_gui_portal.PortalItem, {
|
|
240
|
+
passThrough: !isActive,
|
|
241
|
+
hostName: portalName,
|
|
242
|
+
children: props.children
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
function AdaptPortalTeleport(param) {
|
|
246
|
+
var {
|
|
247
|
+
isActive,
|
|
248
|
+
store,
|
|
249
|
+
children
|
|
250
|
+
} = param;
|
|
251
|
+
return (0, import_gui_constants.useIsomorphicLayoutEffect)(function () {
|
|
252
|
+
if (isActive) return store.set(children), function () {
|
|
253
|
+
return store.set(null);
|
|
254
|
+
};
|
|
255
|
+
}), isActive ? null : /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
256
|
+
children
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
var useAdaptIsActiveGiven = function (param) {
|
|
260
|
+
var {
|
|
261
|
+
when,
|
|
262
|
+
platform
|
|
263
|
+
} = param,
|
|
264
|
+
media = (0, import_gui_core.useMedia)();
|
|
265
|
+
if (when == null && platform == null) return !1;
|
|
266
|
+
if (when === !0) return !0;
|
|
267
|
+
var enabled = !1;
|
|
268
|
+
return platform === "touch" ? enabled = import_gui_constants.isTouchable : platform === "native" ? enabled = !import_gui_constants.isWeb : platform === "web" ? enabled = import_gui_constants.isWeb : platform === "ios" ? enabled = import_gui_constants.isIos : platform === "android" && (enabled = import_gui_constants.isAndroid), platform && enabled == !1 ? !1 : (when && typeof when == "string" && (enabled = media[when]), enabled);
|
|
269
|
+
},
|
|
270
|
+
useAdaptIsActive = function (scope) {
|
|
271
|
+
var props = useAdaptContext(scope);
|
|
272
|
+
return useAdaptIsActiveGiven(props);
|
|
273
|
+
};
|
|
274
|
+
//# sourceMappingURL=Adapt.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","Adapt_exports","__export","Adapt","AdaptContents","AdaptContext","AdaptParent","AdaptPortalContents","ProvideAdaptContext","useAdaptContext","useAdaptIsActive","module","exports","import_jsx_runtime","require","import_gui_constants","import_gui_core","import_gui_helpers","import_gui_native","import_gui_portal","import_gui_z_index_stack","import_react","__toESM","createAdaptChildrenStore","children","listeners","Set","set","c","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","l","err","return","get","subscribe","callback","add","delete","AdaptChildrenStoreContext","createContext","emptySubscribe","emptyGet","TeleportAdaptContents","store","useContext","_store_subscribe","_store_get","_store_get1","default","useSyncExternalStore","jsx","Fragment","createStyledContext","Contents","scopeName","portalName","platform","setPlatform","x","when","setWhen","LastAdaptContextScope","param","context","scope","lastScope","Provider","adaptScope","useStyledContext","AdaptPortals","Map","portal","id","useId","childrenStoreRef","useRef","current","isTeleport","getPortal","state","type","FinalContents","useMemo","has","element","PortalHost","name","forwardProps","useIsomorphicLayoutEffect","useState","rest","Error","process","env","NODE_ENV","createElement","key","shouldForwardSpace","withStaticProperties","props","enabled","useAdaptIsActiveGiven","_context_setWhen","_context_setPlatform","call","output","Component"],"sources":["../../src/Adapt.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,W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QAGL,IAAAc,gBAAS,EAAAC,oBAAA;QACXxC,OAAO,aAAAuC,gBAAA,GAAAvC,OAAA,CAAAH,OAAA,cAAA0C,gBAAA,eAAAA,gBAAA,CAAAE,IAAA,CAAAzC,OAAA,SAAAA,OAAA,aAAAwC,oBAAA,GAAAxC,OAAA,CAAAN,WAAA,cAAA8C,oBAAA,eAAAA,oBAAA,CAAAC,IAAA,CAAAzC,OAAA;MAGT;IAQA;IASF,IAEa0C,MAAA;IACX,WAAMzF,QAAQ,cAAgB,EAAK;MACnC,IAAA0F,SAAO,GAAA3C,OAAA,EAAAV,QAA2B;MACpCoD,MAAA,GAAAzF,QAAA,CAAA0F,SAAA,sBAAArG,kBAAA,CAAA6C,GAAA,EAAAwD,SAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
7
|
+
get: () => from[key],
|
|
8
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
9
|
+
});
|
|
10
|
+
return to;
|
|
11
|
+
},
|
|
12
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
13
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
14
|
+
value: !0
|
|
15
|
+
}), mod);
|
|
16
|
+
var index_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(index_exports);
|
|
18
|
+
__reExport(index_exports, require("./Adapt.cjs"), module.exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
9
|
+
get: () => from[key],
|
|
10
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
11
|
+
});
|
|
12
|
+
return to;
|
|
13
|
+
},
|
|
14
|
+
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
16
|
+
value: !0
|
|
17
|
+
}), mod);
|
|
18
|
+
var index_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(index_exports);
|
|
20
|
+
__reExport(index_exports, require("./Adapt.native.js"), module.exports);
|
|
21
|
+
//# sourceMappingURL=index.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
|