@tamagui/adapt 1.111.8 → 1.111.9
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/esm/Adapt.native.js +50 -49
- package/dist/esm/Adapt.native.js.map +1 -6
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/index.native.js.map +1 -6
- package/package.json +6 -6
- package/dist/esm/Adapt.native.mjs +0 -57
- package/dist/esm/Adapt.native.mjs.map +0 -1
- package/dist/esm/index.native.mjs +0 -2
- package/dist/esm/index.native.mjs.map +0 -1
package/dist/esm/Adapt.native.js
CHANGED
|
@@ -3,54 +3,55 @@ import React from "react";
|
|
|
3
3
|
import { isAndroid, isIos, isTouchable, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
4
4
|
import { useMedia } from "@tamagui/core";
|
|
5
5
|
import { withStaticProperties } from "@tamagui/helpers";
|
|
6
|
-
var AdaptParentContext = /* @__PURE__ */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
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.");
|
|
10
|
-
|
|
11
|
-
};
|
|
6
|
+
var AdaptParentContext = /* @__PURE__ */React.createContext(null),
|
|
7
|
+
AdaptContents = function (props) {
|
|
8
|
+
var context = React.useContext(AdaptParentContext);
|
|
9
|
+
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.");
|
|
10
|
+
return /* @__PURE__ */React.createElement(context.Contents, props);
|
|
11
|
+
};
|
|
12
12
|
AdaptContents.shouldForwardSpace = !0;
|
|
13
|
-
var useAdaptParent = function(param) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
setWhen
|
|
13
|
+
var useAdaptParent = function (param) {
|
|
14
|
+
var {
|
|
15
|
+
Contents
|
|
16
|
+
} = param,
|
|
17
|
+
[when, setWhen] = React.useState(null),
|
|
18
|
+
AdaptProvider = React.useMemo(function () {
|
|
19
|
+
var context = {
|
|
20
|
+
Contents,
|
|
21
|
+
setWhen
|
|
22
|
+
};
|
|
23
|
+
function AdaptProviderView(props) {
|
|
24
|
+
return /* @__PURE__ */_jsx(AdaptParentContext.Provider, {
|
|
25
|
+
value: context,
|
|
26
|
+
children: props.children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return AdaptProviderView;
|
|
30
|
+
}, [Contents]);
|
|
31
|
+
return {
|
|
32
|
+
AdaptProvider,
|
|
33
|
+
when
|
|
18
34
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
when
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
enabled
|
|
43
|
-
]), enabled ? typeof children == "function" ? children({
|
|
44
|
-
enabled,
|
|
45
|
-
media
|
|
46
|
-
}) : children : null;
|
|
47
|
-
}, {
|
|
48
|
-
Contents: AdaptContents
|
|
49
|
-
});
|
|
50
|
-
export {
|
|
51
|
-
Adapt,
|
|
52
|
-
AdaptContents,
|
|
53
|
-
AdaptParentContext,
|
|
54
|
-
useAdaptParent
|
|
55
|
-
};
|
|
56
|
-
//# sourceMappingURL=Adapt.js.map
|
|
35
|
+
},
|
|
36
|
+
Adapt = withStaticProperties(function (param) {
|
|
37
|
+
var {
|
|
38
|
+
platform,
|
|
39
|
+
when,
|
|
40
|
+
children
|
|
41
|
+
} = param,
|
|
42
|
+
context = React.useContext(AdaptParentContext),
|
|
43
|
+
media = useMedia(),
|
|
44
|
+
enabled = !1;
|
|
45
|
+
return typeof when == "function" ? enabled = when({
|
|
46
|
+
media
|
|
47
|
+
}) : (enabled = !platform, platform === "touch" && (enabled = isTouchable), platform === "native" && (enabled = !isWeb), platform === "web" && (enabled = isWeb), platform === "ios" && (enabled = isIos), platform === "android" && (enabled = isAndroid), when && !media[when] && (enabled = !1)), useIsomorphicLayoutEffect(function () {
|
|
48
|
+
enabled && context?.setWhen(when || enabled);
|
|
49
|
+
}, [when, context, enabled]), enabled ? typeof children == "function" ? children({
|
|
50
|
+
enabled,
|
|
51
|
+
media
|
|
52
|
+
}) : children : null;
|
|
53
|
+
}, {
|
|
54
|
+
Contents: AdaptContents
|
|
55
|
+
});
|
|
56
|
+
export { Adapt, AdaptContents, AdaptParentContext, useAdaptParent };
|
|
57
|
+
//# sourceMappingURL=Adapt.native.js.map
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Users/n8/tamagui/code/ui/adapt/src/Adapt.tsx"],
|
|
4
|
-
"mappings": ";AAAA,OAAOA,WAAW;AAClB,SACEC,WACAC,OACAC,aACAC,OACAC,iCACK;AAEP,SAASC,gBAAgB;AACzB,SAASC,4BAA4B;AAoB9B,IAAMC,qBAAqBR,sBAAMS,cAA0C,IAAA,GAGrEC,gBAAgB,SAACC,OAAAA;AAC5B,MAAMC,UAAUZ,MAAMa,WAAWL,kBAAAA;AACjC,MAAI,CAACI,SAASE;AACZ,UAAM,IAAIC,MACRC,QAAQC,IAAIC,aAAa,eACrB,8CACA,0GAA0G;AAGlH,SAAOlB,sBAAMmB,cAAcP,QAAQE,UAAUH,KAAAA;AAC/C;AAEAD,cAAcU,qBAAqB;AAE5B,IAAMC,iBAAiB,SAAA,OAAA;MAAC,EAC7BP,SAAQ,IACsC,OACxC,CAACQ,MAAMC,OAAAA,IAAWvB,MAAMwB,SAAe,IAAA,GAEvCC,gBAAgBzB,MAAM0B,QAAQ,WAAA;AAClC,QAAMd,UAA+B;MACnCE;MACAS;IACF;AAEA,aAASI,kBAAkBhB,OAAyB;AAClD,aACE,qBAACH,mBAAmBoB,UAAQ;QAACC,OAAOjB;kBACjCD,MAAMmB;;IAGb;AAEA,WAAOH;EACT,GAAG;IAACb;GAAS;AAEb,SAAO;IACLW;IACAH;EACF;AACF,GAEaS,QAAQxB,qBACnB,SAAe,OAAwC;MAAxC,EAAEyB,UAAUV,MAAMQ,SAAQ,IAA1B,OACPlB,UAAUZ,MAAMa,WAAWL,kBAAAA,GAC3ByB,QAAQ3B,SAAAA,GAEV4B,UAAU;AAuBd,SArBI,OAAOZ,QAAS,aAClBY,UAAUZ,KAAK;IAAEW;EAAM,CAAA,KAEvBC,UAAU,CAACF,UAEPA,aAAa,YAASE,UAAU/B,cAChC6B,aAAa,aAAUE,UAAU,CAAC9B,QAClC4B,aAAa,UAAOE,UAAU9B,QAC9B4B,aAAa,UAAOE,UAAUhC,QAC9B8B,aAAa,cAAWE,UAAUjC,YAElCqB,QAAQ,CAACW,MAAMX,IAAAA,MACjBY,UAAU,MAId7B,0BAA0B,WAAA;AACxB,IAAK6B,WACLtB,SAASW,QAASD,QAAQY,OAAAA;EAC5B,GAAG;IAACZ;IAAMV;IAASsB;GAAQ,GAEtBA,UAID,OAAOJ,YAAa,aACfA,SAAS;IAAEI;IAASD;EAAM,CAAA,IAG5BH,WAPE;AAQX,GACA;EACEhB,UAAUJ;AACZ,CAAA;",
|
|
5
|
-
"names": ["React", "isAndroid", "isIos", "isTouchable", "isWeb", "useIsomorphicLayoutEffect", "useMedia", "withStaticProperties", "AdaptParentContext", "createContext", "AdaptContents", "props", "context", "useContext", "Contents", "Error", "process", "env", "NODE_ENV", "createElement", "shouldForwardSpace", "useAdaptParent", "when", "setWhen", "useState", "AdaptProvider", "useMemo", "AdaptProviderView", "Provider", "value", "children", "Adapt", "platform", "media", "enabled"]
|
|
6
|
-
}
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","React","isAndroid","isIos","isTouchable","isWeb","useIsomorphicLayoutEffect","useMedia","withStaticProperties","AdaptParentContext","createContext","AdaptContents","props","context","useContext","Contents","Error","process","env","NODE_ENV","createElement","shouldForwardSpace","useAdaptParent","param","when","setWhen","useState","AdaptProvider","useMemo","AdaptProviderView","Provider","value","children","Adapt","platform","media","enabled"],"sources":["../../src/Adapt.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAOA,GAAA,IAAAC,IAAW;AAClB,OAAAC,KAAA;AAAA,SACEC,SAAA,EAAAC,KAAA,EAAAC,WAAA,EAAAC,KAAA,EAAAC,yBAAA;AAAA,SACAC,QAAA;AAAA,SACAC,oBAAA;AAAA,IACAC,kBAAA,kBAAAR,KAAA,CAAAS,aAAA;EAAAC,aAAA,YAAAA,CAAAC,KAAA;IACA,IAAAC,OAAA,GAAAZ,KAAA,CAAAa,UAAA,CAAAL,kBAAA;IAAA,KACKI,OAAA,EAAAE,QAAA,EAEP,MAAS,IAAAC,KAAA,CAAAC,OAAgB,CAAAC,GAAA,CAAAC,QAAA;IACzB,OAAS,eAAAlB,KAAA,CAAAmB,aAA4B,CAAAP,OAAA,CAAAE,QAAA,EAAAH,KAAA;EAkD7B;AA9BDD,aAAM,CAAAU,kBAAqB,GAAM;AAItC,IAAAC,cAAgB,YAAAA,CAAMC,KAAW;IACjC,IAAI;QAACR;MAAS,IAAAQ,KAAA;MAAA,CAAAC,IAAA,EAAAC,OAAA,IAAAxB,KAAA,CAAAyB,QAAA;MAAAC,aAAA,GAAA1B,KAAA,CAAA2B,OAAA;QACZ,IAAAf,OAAU;UACRE,QAAQ;UAGVU;QAEF;QACF,SAAAI,kBAAAjB,KAAA;UAEA,sBAAcZ,IAAA,CAAAS,kBAAqB,CAAAqB,QAAA;YAEtBC,KAAA,EAAAlB,OAAA;YACXmB,QAAA,EAAApB,KAAA,CAAAoB;UACmD;QACnD;QAmBA,OAAOH,iBAAA;MAAA,GACL,CAjBAd,QAAM,CAA+B;IACnC,OACA;MAAAY,aACF;MAEAH;IACE;EAGE;EAAAS,KAEJ,GAAAzB,oBAAA,WAAAe,KAAA;IAEA;QAAAW,QAAO;QAAAV,IAAA;QAAAQ;MAAA,IAAAT,KAAA;MAAAV,OAAA,GAAAZ,KAAA,CAAAa,UAAA,CAAAL,kBAAA;MAAA0B,KAAA,GAAA5B,QAAA;MAAA6B,OAAA;IAAA,OACL,OAAQZ,IAAC,iBAAAY,OAAA,GAAAZ,IAAA;MAIXW;IACF,MAAAC,OAAA,IAAAF,QAAA,EAAAA,QAAA,iBAAAE,OAAA,GAAAhC,WAAA,GAAA8B,QAAA,kBAAAE,OAAA,IAAA/B,KAAA,GAAA6B,QAAA,eAAAE,OAAA,GAAA/B,KAAA,GAAA6B,QAAA,eAAAE,OAAA,GAAAjC,KAAA,GAAA+B,QAAA,mBAAAE,OAAA,GAAAlC,SAAA,GAAAsB,IAAA,KAAAW,KAAA,CAAAX,IAAA,MAAAY,OAAA,SAAA9B,yBAAA;MAGW8B,OAAQ,IAAAvB,OAAA,EAAAY,OAAA,CAAAD,IAAA,IAAAY,OAAA;IACnB,IACEZ,IAAA,EAGAX,OAAI,EAuBJuB,OArBI,CAiBF,GAAKA,OAAA,UACLJ,QAAS,IAAS,UAAQ,GAAAA,QAAgB;MAC5CI,OAAI;MAWND;IACA,KAAAH,QAAA;EAAA;IAEAjB,QAAA,EAAAJ;EACF","ignoreList":[]}
|
package/dist/esm/index.native.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Adapt";
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./Adapt.native.js";
|
|
2
|
+
//# sourceMappingURL=index.native.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/adapt",
|
|
3
|
-
"version": "1.111.
|
|
3
|
+
"version": "1.111.9",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"exports": {
|
|
21
21
|
"./package.json": "./package.json",
|
|
22
22
|
".": {
|
|
23
|
-
"react-native-import": "./dist/esm/index.native.
|
|
23
|
+
"react-native-import": "./dist/esm/index.native.js",
|
|
24
24
|
"react-native": "./dist/cjs/index.native.js",
|
|
25
25
|
"types": "./types/index.d.ts",
|
|
26
26
|
"import": "./dist/esm/index.mjs",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@tamagui/constants": "1.111.
|
|
32
|
-
"@tamagui/core": "1.111.
|
|
33
|
-
"@tamagui/helpers": "1.111.
|
|
31
|
+
"@tamagui/constants": "1.111.9",
|
|
32
|
+
"@tamagui/core": "1.111.9",
|
|
33
|
+
"@tamagui/helpers": "1.111.9"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@tamagui/build": "1.111.
|
|
36
|
+
"@tamagui/build": "1.111.9"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { isAndroid, isIos, isTouchable, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
4
|
-
import { useMedia } from "@tamagui/core";
|
|
5
|
-
import { withStaticProperties } from "@tamagui/helpers";
|
|
6
|
-
var AdaptParentContext = /* @__PURE__ */React.createContext(null),
|
|
7
|
-
AdaptContents = function (props) {
|
|
8
|
-
var context = React.useContext(AdaptParentContext);
|
|
9
|
-
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.");
|
|
10
|
-
return /* @__PURE__ */React.createElement(context.Contents, props);
|
|
11
|
-
};
|
|
12
|
-
AdaptContents.shouldForwardSpace = !0;
|
|
13
|
-
var useAdaptParent = function (param) {
|
|
14
|
-
var {
|
|
15
|
-
Contents
|
|
16
|
-
} = param,
|
|
17
|
-
[when, setWhen] = React.useState(null),
|
|
18
|
-
AdaptProvider = React.useMemo(function () {
|
|
19
|
-
var context = {
|
|
20
|
-
Contents,
|
|
21
|
-
setWhen
|
|
22
|
-
};
|
|
23
|
-
function AdaptProviderView(props) {
|
|
24
|
-
return /* @__PURE__ */_jsx(AdaptParentContext.Provider, {
|
|
25
|
-
value: context,
|
|
26
|
-
children: props.children
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
return AdaptProviderView;
|
|
30
|
-
}, [Contents]);
|
|
31
|
-
return {
|
|
32
|
-
AdaptProvider,
|
|
33
|
-
when
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
Adapt = withStaticProperties(function (param) {
|
|
37
|
-
var {
|
|
38
|
-
platform,
|
|
39
|
-
when,
|
|
40
|
-
children
|
|
41
|
-
} = param,
|
|
42
|
-
context = React.useContext(AdaptParentContext),
|
|
43
|
-
media = useMedia(),
|
|
44
|
-
enabled = !1;
|
|
45
|
-
return typeof when == "function" ? enabled = when({
|
|
46
|
-
media
|
|
47
|
-
}) : (enabled = !platform, platform === "touch" && (enabled = isTouchable), platform === "native" && (enabled = !isWeb), platform === "web" && (enabled = isWeb), platform === "ios" && (enabled = isIos), platform === "android" && (enabled = isAndroid), when && !media[when] && (enabled = !1)), useIsomorphicLayoutEffect(function () {
|
|
48
|
-
enabled && context?.setWhen(when || enabled);
|
|
49
|
-
}, [when, context, enabled]), enabled ? typeof children == "function" ? children({
|
|
50
|
-
enabled,
|
|
51
|
-
media
|
|
52
|
-
}) : children : null;
|
|
53
|
-
}, {
|
|
54
|
-
Contents: AdaptContents
|
|
55
|
-
});
|
|
56
|
-
export { Adapt, AdaptContents, AdaptParentContext, useAdaptParent };
|
|
57
|
-
//# sourceMappingURL=Adapt.native.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","React","isAndroid","isIos","isTouchable","isWeb","useIsomorphicLayoutEffect","useMedia","withStaticProperties","AdaptParentContext","createContext","AdaptContents","props","context","useContext","Contents","Error","process","env","NODE_ENV","createElement","shouldForwardSpace","useAdaptParent","param","when","setWhen","useState","AdaptProvider","useMemo","AdaptProviderView","Provider","value","children","Adapt","platform","media","enabled"],"sources":["../../src/Adapt.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAOA,GAAA,IAAAC,IAAW;AAClB,OAAAC,KAAA;AAAA,SACEC,SAAA,EAAAC,KAAA,EAAAC,WAAA,EAAAC,KAAA,EAAAC,yBAAA;AAAA,SACAC,QAAA;AAAA,SACAC,oBAAA;AAAA,IACAC,kBAAA,kBAAAR,KAAA,CAAAS,aAAA;EAAAC,aAAA,YAAAA,CAAAC,KAAA;IACA,IAAAC,OAAA,GAAAZ,KAAA,CAAAa,UAAA,CAAAL,kBAAA;IAAA,KACKI,OAAA,EAAAE,QAAA,EAEP,MAAS,IAAAC,KAAA,CAAAC,OAAgB,CAAAC,GAAA,CAAAC,QAAA;IACzB,OAAS,eAAAlB,KAAA,CAAAmB,aAA4B,CAAAP,OAAA,CAAAE,QAAA,EAAAH,KAAA;EAkD7B;AA9BDD,aAAM,CAAAU,kBAAqB,GAAM;AAItC,IAAAC,cAAgB,YAAAA,CAAMC,KAAW;IACjC,IAAI;QAACR;MAAS,IAAAQ,KAAA;MAAA,CAAAC,IAAA,EAAAC,OAAA,IAAAxB,KAAA,CAAAyB,QAAA;MAAAC,aAAA,GAAA1B,KAAA,CAAA2B,OAAA;QACZ,IAAAf,OAAU;UACRE,QAAQ;UAGVU;QAEF;QACF,SAAAI,kBAAAjB,KAAA;UAEA,sBAAcZ,IAAA,CAAAS,kBAAqB,CAAAqB,QAAA;YAEtBC,KAAA,EAAAlB,OAAA;YACXmB,QAAA,EAAApB,KAAA,CAAAoB;UACmD;QACnD;QAmBA,OAAOH,iBAAA;MAAA,GACL,CAjBAd,QAAM,CAA+B;IACnC,OACA;MAAAY,aACF;MAEAH;IACE;EAGE;EAAAS,KAEJ,GAAAzB,oBAAA,WAAAe,KAAA;IAEA;QAAAW,QAAO;QAAAV,IAAA;QAAAQ;MAAA,IAAAT,KAAA;MAAAV,OAAA,GAAAZ,KAAA,CAAAa,UAAA,CAAAL,kBAAA;MAAA0B,KAAA,GAAA5B,QAAA;MAAA6B,OAAA;IAAA,OACL,OAAQZ,IAAC,iBAAAY,OAAA,GAAAZ,IAAA;MAIXW;IACF,MAAAC,OAAA,IAAAF,QAAA,EAAAA,QAAA,iBAAAE,OAAA,GAAAhC,WAAA,GAAA8B,QAAA,kBAAAE,OAAA,IAAA/B,KAAA,GAAA6B,QAAA,eAAAE,OAAA,GAAA/B,KAAA,GAAA6B,QAAA,eAAAE,OAAA,GAAAjC,KAAA,GAAA+B,QAAA,mBAAAE,OAAA,GAAAlC,SAAA,GAAAsB,IAAA,KAAAW,KAAA,CAAAX,IAAA,MAAAY,OAAA,SAAA9B,yBAAA;MAGW8B,OAAQ,IAAAvB,OAAA,EAAAY,OAAA,CAAAD,IAAA,IAAAY,OAAA;IACnB,IACEZ,IAAA,EAGAX,OAAI,EAuBJuB,OArBI,CAiBF,GAAKA,OAAA,UACLJ,QAAS,IAAS,UAAQ,GAAAA,QAAgB;MAC5CI,OAAI;MAWND;IACA,KAAAH,QAAA;EAAA;IAEAjB,QAAA,EAAAJ;EACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../src/index.tsx"],"sourcesContent":[null],"mappings":"AAAA,cAAc","ignoreList":[]}
|