@tamagui/adapt 1.89.26 → 1.89.27-1708112217600
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/Adapt.native.js
CHANGED
|
@@ -21,43 +21,91 @@ __export(Adapt_exports, {
|
|
|
21
21
|
useAdaptParent: () => useAdaptParent
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(Adapt_exports);
|
|
24
|
-
var import_constants = require("@tamagui/constants"), import_constants2 = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_react = require("react")
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
var import_constants = require("@tamagui/constants"), import_constants2 = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_helpers = require("@tamagui/helpers"), import_react = require("react");
|
|
25
|
+
function _array_like_to_array(arr, len) {
|
|
26
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
27
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
28
|
+
arr2[i] = arr[i];
|
|
29
|
+
return arr2;
|
|
30
|
+
}
|
|
31
|
+
function _array_with_holes(arr) {
|
|
32
|
+
if (Array.isArray(arr))
|
|
33
|
+
return arr;
|
|
34
|
+
}
|
|
35
|
+
function _iterable_to_array_limit(arr, i) {
|
|
36
|
+
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
37
|
+
if (_i != null) {
|
|
38
|
+
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
39
|
+
try {
|
|
40
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
41
|
+
;
|
|
42
|
+
} catch (err) {
|
|
43
|
+
_d = !0, _e = err;
|
|
44
|
+
} finally {
|
|
45
|
+
try {
|
|
46
|
+
!_n && _i.return != null && _i.return();
|
|
47
|
+
} finally {
|
|
48
|
+
if (_d)
|
|
49
|
+
throw _e;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return _arr;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function _non_iterable_rest() {
|
|
56
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
57
|
+
}
|
|
58
|
+
function _sliced_to_array(arr, i) {
|
|
59
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
60
|
+
}
|
|
61
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
62
|
+
if (o) {
|
|
63
|
+
if (typeof o == "string")
|
|
64
|
+
return _array_like_to_array(o, minLen);
|
|
65
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
66
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
67
|
+
return Array.from(n);
|
|
68
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
69
|
+
return _array_like_to_array(o, minLen);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
var AdaptParentContext = /* @__PURE__ */ (0, import_react.createContext)(null), AdaptContents = function(props) {
|
|
73
|
+
var context = (0, import_react.useContext)(AdaptParentContext);
|
|
27
74
|
if (!(context != null && context.Contents))
|
|
28
75
|
throw new Error("Adapt not supported by this component");
|
|
29
|
-
return (0, import_react.createElement)(context.Contents, props);
|
|
76
|
+
return /* @__PURE__ */ (0, import_react.createElement)(context.Contents, props);
|
|
30
77
|
};
|
|
31
78
|
AdaptContents.shouldForwardSpace = !0;
|
|
32
|
-
|
|
33
|
-
Contents
|
|
34
|
-
|
|
35
|
-
|
|
79
|
+
var useAdaptParent = function(param) {
|
|
80
|
+
var Contents = param.Contents, _useState = _sliced_to_array((0, import_react.useState)(null), 2), when = _useState[0], setWhen = _useState[1], AdaptProvider = (0, import_react.useMemo)(function() {
|
|
81
|
+
var AdaptProviderView = function(props) {
|
|
82
|
+
return /* @__PURE__ */ React.createElement(AdaptParentContext.Provider, {
|
|
83
|
+
value: context
|
|
84
|
+
}, props.children);
|
|
85
|
+
}, context = {
|
|
86
|
+
Contents,
|
|
87
|
+
setWhen
|
|
88
|
+
};
|
|
89
|
+
return AdaptProviderView;
|
|
90
|
+
}, [
|
|
91
|
+
Contents
|
|
92
|
+
]);
|
|
36
93
|
return {
|
|
37
|
-
AdaptProvider
|
|
38
|
-
const context = {
|
|
39
|
-
Contents,
|
|
40
|
-
setWhen
|
|
41
|
-
};
|
|
42
|
-
function AdaptProviderView(props) {
|
|
43
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdaptParentContext.Provider, { value: context, children: props.children });
|
|
44
|
-
}
|
|
45
|
-
return AdaptProviderView;
|
|
46
|
-
}, [Contents]),
|
|
94
|
+
AdaptProvider,
|
|
47
95
|
when
|
|
48
96
|
};
|
|
49
|
-
}, Adapt = (0, import_helpers.withStaticProperties)(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
);
|
|
97
|
+
}, Adapt = (0, import_helpers.withStaticProperties)(function(param) {
|
|
98
|
+
var platform = param.platform, when = param.when, children = param.children, context = (0, import_react.useContext)(AdaptParentContext), media = (0, import_core.useMedia)(), enabled = !platform;
|
|
99
|
+
return platform === "touch" && (enabled = import_constants2.isTouchable), platform === "native" && (enabled = !import_constants.isWeb), platform === "web" && (enabled = import_constants.isWeb), when && !media[when] && (enabled = !1), (0, import_constants.useIsomorphicLayoutEffect)(function() {
|
|
100
|
+
enabled && (context == null || context.setWhen(when || enabled));
|
|
101
|
+
}, [
|
|
102
|
+
when,
|
|
103
|
+
context,
|
|
104
|
+
enabled
|
|
105
|
+
]), enabled ? children : null;
|
|
106
|
+
}, {
|
|
107
|
+
Contents: AdaptContents
|
|
108
|
+
});
|
|
61
109
|
// Annotate the CommonJS export names for ESM import in node:
|
|
62
110
|
0 && (module.exports = {
|
|
63
111
|
Adapt,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/Adapt.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["import_constants"]
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/adapt/src/Adapt.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAiD,+BACjDA,oBAA4B,+BAE5B,cAAyB,0BACzB,iBAAqC,6BACrC,eAA4E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBrE,IAAMC,qBAAqBC,gDAA0C,IAAA,GAG/DC,gBAAgB,SAACC,OAAAA;AAC5B,MAAMC,cAAUC,yBAAWL,kBAAAA;AAC3B,MAAI,EAACI,WAAAA,QAAAA,QAASE;AACZ,UAAM,IAAIC,MAAM,uCAAA;AAElB,SAAOC,gDAAcJ,QAAQE,UAAUH,KAAAA;AACzC;AAEAD,cAAcO,qBAAqB;AAE5B,IAAMC,iBAAiB,SAAA,OAAA;MAC5BJ,WAAAA,MAAAA,UAIwBK,YAAAA,qBAAAA,uBAAe,IAAA,GAAA,CAAA,GAAhCC,OAAiBD,UAAAA,CAAAA,GAAXE,UAAWF,UAAAA,CAAAA,GAElBG,oBAAgBC,sBAAQ,WAAA;QAMnBC,oBAAT,SAA2Bb,OAAyB;AAClD,aACE,sBAAA,cAACH,mBAAmBiB,UAAQ;QAACC,OAAOd;SACjCD,MAAMgB,QAAQ;IAGrB,GAXMf,UAA+B;MACnCE;MACAO;IACF;AAUA,WAAOG;EACT,GAAG;IAACV;GAAS;AAEb,SAAO;IACLQ;IACAF;EACF;AACF,GAEaQ,YAAQC,qCACnB,SAAe,OAAwC;MAAtCC,WAAF,MAAEA,UAAUV,OAAZ,MAAYA,MAAMO,WAAlB,MAAkBA,UACzBf,cAAUC,yBAAWL,kBAAAA,GACrBuB,YAAQC,sBAAAA,GAEVC,UAAU,CAACH;AAcf,SAbIA,aAAa,YAASG,UAAUC,gCAChCJ,aAAa,aAAUG,UAAU,CAACE,yBAClCL,aAAa,UAAOG,UAAUE,yBAE9Bf,QAAQ,CAACW,MAAMX,IAAAA,MACjBa,UAAU,SAGZG,4CAA0B,WAAA;AACxB,IAAKH,YACLrB,WAAAA,QAAAA,QAASS,QAASD,QAAQa,OAAAA;EAC5B,GAAG;IAACb;IAAMR;IAASqB;GAAQ,GAEtBA,UAIEN,WAHE;AAIX,GACA;EACEb,UAAUJ;AACZ,CAAA;",
|
|
5
|
+
"names": ["import_constants", "AdaptParentContext", "createContext", "AdaptContents", "props", "context", "useContext", "Contents", "Error", "createElement", "shouldForwardSpace", "useAdaptParent", "useState", "when", "setWhen", "AdaptProvider", "useMemo", "AdaptProviderView", "Provider", "value", "children", "Adapt", "withStaticProperties", "platform", "media", "useMedia", "enabled", "isTouchable", "isWeb", "useIsomorphicLayoutEffect"]
|
|
6
6
|
}
|
package/dist/esm/Adapt.native.js
CHANGED
|
@@ -3,43 +3,90 @@ import { isTouchable } from "@tamagui/constants";
|
|
|
3
3
|
import { useMedia } from "@tamagui/core";
|
|
4
4
|
import { withStaticProperties } from "@tamagui/helpers";
|
|
5
5
|
import { createContext, createElement, useContext, useMemo, useState } from "react";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function _array_like_to_array(arr, len) {
|
|
7
|
+
(len == null || len > arr.length) && (len = arr.length);
|
|
8
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
9
|
+
arr2[i] = arr[i];
|
|
10
|
+
return arr2;
|
|
11
|
+
}
|
|
12
|
+
function _array_with_holes(arr) {
|
|
13
|
+
if (Array.isArray(arr))
|
|
14
|
+
return arr;
|
|
15
|
+
}
|
|
16
|
+
function _iterable_to_array_limit(arr, i) {
|
|
17
|
+
var _i = arr == null ? null : typeof Symbol < "u" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
18
|
+
if (_i != null) {
|
|
19
|
+
var _arr = [], _n = !0, _d = !1, _s, _e;
|
|
20
|
+
try {
|
|
21
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done) && (_arr.push(_s.value), !(i && _arr.length === i)); _n = !0)
|
|
22
|
+
;
|
|
23
|
+
} catch (err) {
|
|
24
|
+
_d = !0, _e = err;
|
|
25
|
+
} finally {
|
|
26
|
+
try {
|
|
27
|
+
!_n && _i.return != null && _i.return();
|
|
28
|
+
} finally {
|
|
29
|
+
if (_d)
|
|
30
|
+
throw _e;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return _arr;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function _non_iterable_rest() {
|
|
37
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
38
|
+
}
|
|
39
|
+
function _sliced_to_array(arr, i) {
|
|
40
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
41
|
+
}
|
|
42
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
43
|
+
if (o) {
|
|
44
|
+
if (typeof o == "string")
|
|
45
|
+
return _array_like_to_array(o, minLen);
|
|
46
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
47
|
+
if (n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set")
|
|
48
|
+
return Array.from(n);
|
|
49
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
50
|
+
return _array_like_to_array(o, minLen);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
var AdaptParentContext = /* @__PURE__ */ createContext(null), AdaptContents = function(props) {
|
|
54
|
+
var context = useContext(AdaptParentContext);
|
|
9
55
|
if (!(context != null && context.Contents))
|
|
10
56
|
throw new Error("Adapt not supported by this component");
|
|
11
|
-
return createElement(context.Contents, props);
|
|
57
|
+
return /* @__PURE__ */ createElement(context.Contents, props);
|
|
12
58
|
};
|
|
13
59
|
AdaptContents.shouldForwardSpace = !0;
|
|
14
|
-
|
|
15
|
-
Contents
|
|
16
|
-
|
|
17
|
-
|
|
60
|
+
var useAdaptParent = function(param) {
|
|
61
|
+
var Contents = param.Contents, _useState = _sliced_to_array(useState(null), 2), when = _useState[0], setWhen = _useState[1], AdaptProvider = useMemo(function() {
|
|
62
|
+
var AdaptProviderView = function(props) {
|
|
63
|
+
return /* @__PURE__ */ React.createElement(AdaptParentContext.Provider, {
|
|
64
|
+
value: context
|
|
65
|
+
}, props.children);
|
|
66
|
+
}, context = {
|
|
67
|
+
Contents,
|
|
68
|
+
setWhen
|
|
69
|
+
};
|
|
70
|
+
return AdaptProviderView;
|
|
71
|
+
}, [
|
|
72
|
+
Contents
|
|
73
|
+
]);
|
|
18
74
|
return {
|
|
19
|
-
AdaptProvider
|
|
20
|
-
const context = {
|
|
21
|
-
Contents,
|
|
22
|
-
setWhen
|
|
23
|
-
};
|
|
24
|
-
function AdaptProviderView(props) {
|
|
25
|
-
return /* @__PURE__ */ jsx(AdaptParentContext.Provider, { value: context, children: props.children });
|
|
26
|
-
}
|
|
27
|
-
return AdaptProviderView;
|
|
28
|
-
}, [Contents]),
|
|
75
|
+
AdaptProvider,
|
|
29
76
|
when
|
|
30
77
|
};
|
|
31
|
-
}, Adapt = withStaticProperties(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
78
|
+
}, Adapt = withStaticProperties(function(param) {
|
|
79
|
+
var platform = param.platform, when = param.when, children = param.children, context = useContext(AdaptParentContext), media = useMedia(), enabled = !platform;
|
|
80
|
+
return platform === "touch" && (enabled = isTouchable), platform === "native" && (enabled = !isWeb), platform === "web" && (enabled = isWeb), when && !media[when] && (enabled = !1), useIsomorphicLayoutEffect(function() {
|
|
81
|
+
enabled && (context == null || context.setWhen(when || enabled));
|
|
82
|
+
}, [
|
|
83
|
+
when,
|
|
84
|
+
context,
|
|
85
|
+
enabled
|
|
86
|
+
]), enabled ? children : null;
|
|
87
|
+
}, {
|
|
88
|
+
Contents: AdaptContents
|
|
89
|
+
});
|
|
43
90
|
export {
|
|
44
91
|
Adapt,
|
|
45
92
|
AdaptContents,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/Adapt.tsx"],
|
|
4
|
-
"mappings": "AAAA,
|
|
5
|
-
"names": []
|
|
3
|
+
"sources": ["../../src/Users/n8/tamagui/packages/adapt/src/Adapt.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAASA,OAAOC,iCAAiC;AACjD,SAASC,mBAAmB;AAE5B,SAASC,gBAAgB;AACzB,SAASC,4BAA4B;AACrC,SAASC,eAAeC,eAAeC,YAAYC,SAASC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBrE,IAAMC,qBAAqBL,8BAA0C,IAAA,GAG/DM,gBAAgB,SAACC,OAAAA;AAC5B,MAAMC,UAAUN,WAAWG,kBAAAA;AAC3B,MAAI,EAACG,WAAAA,QAAAA,QAASC;AACZ,UAAM,IAAIC,MAAM,uCAAA;AAElB,SAAOT,8BAAcO,QAAQC,UAAUF,KAAAA;AACzC;AAEAD,cAAcK,qBAAqB;AAE5B,IAAMC,iBAAiB,SAAA,OAAA;MAC5BH,WAAAA,MAAAA,UAIwBL,YAAAA,iBAAAA,SAAe,IAAA,GAAA,CAAA,GAAhCS,OAAiBT,UAAAA,CAAAA,GAAXU,UAAWV,UAAAA,CAAAA,GAElBW,gBAAgBZ,QAAQ,WAAA;QAMnBa,oBAAT,SAA2BT,OAAyB;AAClD,aACE,sBAAA,cAACF,mBAAmBY,UAAQ;QAACC,OAAOV;SACjCD,MAAMY,QAAQ;IAGrB,GAXMX,UAA+B;MACnCC;MACAK;IACF;AAUA,WAAOE;EACT,GAAG;IAACP;GAAS;AAEb,SAAO;IACLM;IACAF;EACF;AACF,GAEaO,QAAQrB,qBACnB,SAAe,OAAwC;MAAtCsB,WAAF,MAAEA,UAAUR,OAAZ,MAAYA,MAAMM,WAAlB,MAAkBA,UACzBX,UAAUN,WAAWG,kBAAAA,GACrBiB,QAAQxB,SAAAA,GAEVyB,UAAU,CAACF;AAcf,SAbIA,aAAa,YAASE,UAAU1B,cAChCwB,aAAa,aAAUE,UAAU,CAAC5B,QAClC0B,aAAa,UAAOE,UAAU5B,QAE9BkB,QAAQ,CAACS,MAAMT,IAAAA,MACjBU,UAAU,KAGZ3B,0BAA0B,WAAA;AACxB,IAAK2B,YACLf,WAAAA,QAAAA,QAASM,QAASD,QAAQU,OAAAA;EAC5B,GAAG;IAACV;IAAML;IAASe;GAAQ,GAEtBA,UAIEJ,WAHE;AAIX,GACA;EACEV,UAAUH;AACZ,CAAA;",
|
|
5
|
+
"names": ["isWeb", "useIsomorphicLayoutEffect", "isTouchable", "useMedia", "withStaticProperties", "createContext", "createElement", "useContext", "useMemo", "useState", "AdaptParentContext", "AdaptContents", "props", "context", "Contents", "Error", "shouldForwardSpace", "useAdaptParent", "when", "setWhen", "AdaptProvider", "AdaptProviderView", "Provider", "value", "children", "Adapt", "platform", "media", "enabled"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/adapt",
|
|
3
|
-
"version": "1.89.
|
|
3
|
+
"version": "1.89.27-1708112217600",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/constants": "1.89.
|
|
31
|
-
"@tamagui/core": "1.89.
|
|
32
|
-
"@tamagui/helpers": "1.89.
|
|
30
|
+
"@tamagui/constants": "1.89.27-1708112217600",
|
|
31
|
+
"@tamagui/core": "1.89.27-1708112217600",
|
|
32
|
+
"@tamagui/helpers": "1.89.27-1708112217600"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@tamagui/build": "1.89.
|
|
35
|
+
"@tamagui/build": "1.89.27-1708112217600"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|