@tamagui/adapt 1.88.1 → 1.88.3

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.js CHANGED
@@ -23,7 +23,7 @@ module.exports = __toCommonJS(Adapt_exports);
23
23
  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"), import_jsx_runtime = require("react/jsx-runtime");
24
24
  const AdaptParentContext = (0, import_react.createContext)(null), AdaptContents = (props) => {
25
25
  const context = (0, import_react.useContext)(AdaptParentContext);
26
- if (!(context != null && context.Contents))
26
+ if (!context?.Contents)
27
27
  throw new Error("Adapt not supported by this component");
28
28
  return (0, import_react.createElement)(context.Contents, props);
29
29
  };
@@ -50,18 +50,11 @@ const useAdaptParent = ({
50
50
  const context = (0, import_react.useContext)(AdaptParentContext), media = (0, import_core.useMedia)();
51
51
  let enabled = !platform;
52
52
  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)(() => {
53
- enabled && (context == null || context.setWhen(when || enabled));
53
+ enabled && context?.setWhen(when || enabled);
54
54
  }, [when, context, enabled]), enabled ? children : null;
55
55
  },
56
56
  {
57
57
  Contents: AdaptContents
58
58
  }
59
59
  );
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- Adapt,
63
- AdaptContents,
64
- AdaptParentContext,
65
- useAdaptParent
66
- });
67
60
  //# sourceMappingURL=Adapt.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Adapt.tsx"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAiD,+BACjDA,oBAA4B,+BAC5B,cAA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value: !0
12
12
  var src_exports = {};
13
13
  module.exports = __toCommonJS(src_exports);
14
14
  __reExport(src_exports, require("./Adapt"), module.exports);
15
- // Annotate the CommonJS export names for ESM import in node:
16
- 0 && (module.exports = {
17
- ...require("./Adapt")
18
- });
19
15
  //# sourceMappingURL=index.js.map
@@ -1,49 +1,68 @@
1
- import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
2
- import { isTouchable } from "@tamagui/constants";
3
- import { useMedia } from "@tamagui/core";
4
- import { withStaticProperties } from "@tamagui/helpers";
5
- import { createContext, createElement, useContext, useMemo, useState } from "react";
6
- import { jsx } from "react/jsx-runtime";
7
- const AdaptParentContext = createContext(null), AdaptContents = (props) => {
8
- const context = useContext(AdaptParentContext);
9
- if (!context?.Contents)
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 Adapt_exports = {};
17
+ __export(Adapt_exports, {
18
+ Adapt: () => Adapt,
19
+ AdaptContents: () => AdaptContents,
20
+ AdaptParentContext: () => AdaptParentContext,
21
+ useAdaptParent: () => useAdaptParent
22
+ });
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"), import_jsx_runtime = require("react/jsx-runtime");
25
+ const AdaptParentContext = (0, import_react.createContext)(null), AdaptContents = (props) => {
26
+ const context = (0, import_react.useContext)(AdaptParentContext);
27
+ if (!(context != null && context.Contents))
10
28
  throw new Error("Adapt not supported by this component");
11
- return createElement(context.Contents, props);
29
+ return (0, import_react.createElement)(context.Contents, props);
12
30
  };
13
31
  AdaptContents.shouldForwardSpace = !0;
14
32
  const useAdaptParent = ({
15
33
  Contents
16
34
  }) => {
17
- const [when, setWhen] = useState(null);
35
+ const [when, setWhen] = (0, import_react.useState)(null);
18
36
  return {
19
- AdaptProvider: useMemo(() => {
37
+ AdaptProvider: (0, import_react.useMemo)(() => {
20
38
  const context = {
21
39
  Contents,
22
40
  setWhen
23
41
  };
24
42
  function AdaptProviderView(props) {
25
- return /* @__PURE__ */ jsx(AdaptParentContext.Provider, { value: context, children: props.children });
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AdaptParentContext.Provider, { value: context, children: props.children });
26
44
  }
27
45
  return AdaptProviderView;
28
46
  }, [Contents]),
29
47
  when
30
48
  };
31
- }, Adapt = withStaticProperties(
49
+ }, Adapt = (0, import_helpers.withStaticProperties)(
32
50
  function({ platform, when, children }) {
33
- const context = useContext(AdaptParentContext), media = useMedia();
51
+ const context = (0, import_react.useContext)(AdaptParentContext), media = (0, import_core.useMedia)();
34
52
  let enabled = !platform;
35
- return platform === "touch" && (enabled = isTouchable), platform === "native" && (enabled = !isWeb), platform === "web" && (enabled = isWeb), when && !media[when] && (enabled = !1), useIsomorphicLayoutEffect(() => {
36
- enabled && context?.setWhen(when || enabled);
53
+ 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)(() => {
54
+ enabled && (context == null || context.setWhen(when || enabled));
37
55
  }, [when, context, enabled]), enabled ? children : null;
38
56
  },
39
57
  {
40
58
  Contents: AdaptContents
41
59
  }
42
60
  );
43
- export {
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
44
63
  Adapt,
45
64
  AdaptContents,
46
65
  AdaptParentContext,
47
66
  useAdaptParent
48
- };
67
+ });
49
68
  //# sourceMappingURL=Adapt.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Adapt.tsx"],
4
- "mappings": "AAAA,SAAS,OAAO,iCAAiC;AACjD,SAAS,mBAAmB;AAC5B,SAAwB,gBAAgB;AACxC,SAAS,4BAA4B;AACrC,SAAS,eAAe,eAAe,YAAY,SAAS,gBAAgB;AA8CpE;AA5BD,MAAM,qBAAqB,cAA0C,IAAI,GAGnE,gBAAgB,CAAC,UAAe;AAC3C,QAAM,UAAU,WAAW,kBAAkB;AAC7C,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,uCAAuC;AAEzD,SAAO,cAAc,QAAQ,UAAU,KAAK;AAC9C;AAEA,cAAc,qBAAqB;AAE5B,MAAM,iBAAiB,CAAC;AAAA,EAC7B;AACF,MAEM;AACJ,QAAM,CAAC,MAAM,OAAO,IAAI,SAAe,IAAI;AAmB3C,SAAO;AAAA,IACL,eAlBoB,QAAQ,MAAM;AAClC,YAAM,UAA+B;AAAA,QACnC;AAAA,QACA;AAAA,MACF;AAEA,eAAS,kBAAkB,OAA2B;AACpD,eACE,oBAAC,mBAAmB,UAAnB,EAA4B,OAAO,SACjC,gBAAM,UACT;AAAA,MAEJ;AAEA,aAAO;AAAA,IACT,GAAG,CAAC,QAAQ,CAAC;AAAA,IAIX;AAAA,EACF;AACF,GAEa,QAAQ;AAAA,EACnB,SAAe,EAAE,UAAU,MAAM,SAAS,GAAe;AACvD,UAAM,UAAU,WAAW,kBAAkB,GACvC,QAAQ,SAAS;AAEvB,QAAI,UAAU,CAAC;AAcf,WAbI,aAAa,YAAS,UAAU,cAChC,aAAa,aAAU,UAAU,CAAC,QAClC,aAA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,CAAC,yBAClC,aAAa,UAAO,UAAU,yBAE9B,QAAQ,CAAC,MAAM,IAAI,MACrB,UAAU,SAGZ,4CAA0B,MAAM;AAC9B,MAAK,YACL,2BAAS,QAAS,QAAQ;AAAA,IAC5B,GAAG,CAAC,MAAM,SAAS,OAAO,CAAC,GAEtB,UAIE,WAHE;AAAA,EAIX;AAAA,EACA;AAAA,IACE,UAAU;AAAA,EACZ;AACF;",
5
+ "names": ["import_constants"]
6
6
  }
@@ -1,2 +1,20 @@
1
- export * from "./Adapt";
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
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
+ var src_exports = {};
14
+ module.exports = __toCommonJS(src_exports);
15
+ __reExport(src_exports, require("./Adapt"), module.exports);
16
+ // Annotate the CommonJS export names for ESM import in node:
17
+ 0 && (module.exports = {
18
+ ...require("./Adapt")
19
+ });
2
20
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.tsx"],
4
- "mappings": "AAAA,cAAc;",
4
+ "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,oBAAd;",
5
5
  "names": []
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/adapt",
3
- "version": "1.88.1",
3
+ "version": "1.88.3",
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.88.1",
31
- "@tamagui/core": "1.88.1",
32
- "@tamagui/helpers": "1.88.1"
30
+ "@tamagui/constants": "1.88.3",
31
+ "@tamagui/core": "1.88.3",
32
+ "@tamagui/helpers": "1.88.3"
33
33
  },
34
34
  "devDependencies": {
35
- "@tamagui/build": "1.88.1"
35
+ "@tamagui/build": "1.88.3"
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"