@tamagui/core 1.0.1-beta.101 → 1.0.1-beta.102

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.
Files changed (46) hide show
  1. package/dist/cjs/constants/platform.js +7 -7
  2. package/dist/cjs/constants/platform.js.map +2 -2
  3. package/dist/cjs/helpers/calc.js.map +2 -2
  4. package/dist/cjs/helpers/matchMedia.js +6 -5
  5. package/dist/cjs/helpers/matchMedia.js.map +2 -2
  6. package/dist/cjs/helpers/startTransition.js +32 -0
  7. package/dist/cjs/helpers/startTransition.js.map +7 -0
  8. package/dist/cjs/hooks/useIsSSR.js +41 -0
  9. package/dist/cjs/hooks/useIsSSR.js.map +7 -0
  10. package/dist/cjs/hooks/useIsTouchDevice.js +8 -6
  11. package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
  12. package/dist/cjs/index.js +3 -2
  13. package/dist/cjs/index.js.map +2 -2
  14. package/dist/cjs/startTransition.js +32 -0
  15. package/dist/cjs/startTransition.js.map +7 -0
  16. package/dist/esm/constants/platform.js +6 -6
  17. package/dist/esm/constants/platform.js.map +2 -2
  18. package/dist/esm/helpers/calc.js.map +1 -1
  19. package/dist/esm/helpers/matchMedia.js +6 -5
  20. package/dist/esm/helpers/matchMedia.js.map +2 -2
  21. package/dist/esm/helpers/startTransition.js +6 -0
  22. package/dist/esm/helpers/startTransition.js.map +7 -0
  23. package/dist/esm/hooks/useIsSSR.js +18 -0
  24. package/dist/esm/hooks/useIsSSR.js.map +7 -0
  25. package/dist/esm/hooks/useIsTouchDevice.js +9 -7
  26. package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
  27. package/dist/esm/index.js +3 -2
  28. package/dist/esm/index.js.map +2 -2
  29. package/dist/esm/startTransition.js +6 -0
  30. package/dist/esm/startTransition.js.map +7 -0
  31. package/package.json +8 -8
  32. package/types/constants/platform.d.ts +3 -3
  33. package/types/constants/platform.d.ts.map +1 -1
  34. package/types/helpers/matchMedia.d.ts +1 -1
  35. package/types/helpers/matchMedia.d.ts.map +1 -1
  36. package/types/helpers/startTransition.d.ts +3 -0
  37. package/types/helpers/startTransition.d.ts.map +1 -0
  38. package/types/hooks/useIsSSR.d.ts +2 -0
  39. package/types/hooks/useIsSSR.d.ts.map +1 -0
  40. package/types/hooks/useIsTouchDevice.d.ts.map +1 -1
  41. package/types/index.d.ts +3 -2
  42. package/types/index.d.ts.map +1 -1
  43. package/types/startTransition.d.ts +3 -0
  44. package/types/startTransition.d.ts.map +1 -0
  45. package/types/views/ThemeInverse.d.ts +1 -0
  46. package/types/views/ThemeInverse.d.ts.map +1 -1
@@ -24,8 +24,8 @@ __export(platform_exports, {
24
24
  isSSR: () => isSSR,
25
25
  isTouchable: () => isTouchable,
26
26
  isWeb: () => isWeb,
27
- isWebIOS: () => isWebIOS,
28
27
  isWebTouchable: () => isWebTouchable,
28
+ isWindowDefined: () => isWindowDefined,
29
29
  useIsomorphicLayoutEffect: () => useIsomorphicLayoutEffect
30
30
  });
31
31
  module.exports = __toCommonJS(platform_exports);
@@ -35,13 +35,13 @@ var _a, _b;
35
35
  const isAndroid = ((_a = import_react_native.Platform) == null ? void 0 : _a.OS) === "android";
36
36
  const isIOS = ((_b = import_react_native.Platform) == null ? void 0 : _b.OS) === "ios";
37
37
  const isWeb = process.env.TAMAGUI_TARGET === "web";
38
- const isSSR = isWeb && typeof window === "undefined";
39
- const isClient = isWeb && typeof window !== "undefined";
40
- const useIsomorphicLayoutEffect = !isWeb || isClient ? import_react.useLayoutEffect : import_react.useEffect;
38
+ const isWindowDefined = typeof window !== "undefined";
39
+ const isSSR = isWeb && !isWindowDefined;
40
+ const isClient = isWeb && isWindowDefined;
41
+ const useIsomorphicLayoutEffect = isSSR ? import_react.useEffect : import_react.useLayoutEffect;
41
42
  const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
42
- const isWebTouchable = typeof window !== "undefined" && "ontouchstart" in window;
43
+ const isWebTouchable = isClient && "ontouchstart" in window;
43
44
  const isTouchable = !isWeb || isWebTouchable;
44
- const isWebIOS = isWeb && typeof navigator !== "undefined" && (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !window["MSStream"];
45
45
  // Annotate the CommonJS export names for ESM import in node:
46
46
  0 && (module.exports = {
47
47
  isAndroid,
@@ -51,8 +51,8 @@ const isWebIOS = isWeb && typeof navigator !== "undefined" && (/iPad|iPhone|iPod
51
51
  isSSR,
52
52
  isTouchable,
53
53
  isWeb,
54
- isWebIOS,
55
54
  isWebTouchable,
55
+ isWindowDefined,
56
56
  useIsomorphicLayoutEffect
57
57
  });
58
58
  //# sourceMappingURL=platform.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/constants/platform.ts"],
4
- "sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isSSR = isWeb && typeof window === 'undefined'\nexport const isClient = isWeb && typeof window !== 'undefined'\nexport const useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = typeof window !== 'undefined' && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\nexport const isWebIOS =\n isWeb &&\n typeof navigator !== 'undefined' &&\n (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !window['MSStream']\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAGO,MAAM,YAAY,2DAAU,QAAO;AACnC,MAAM,QAAQ,2DAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,WAAW,SAAS,OAAO,WAAW;AAC5C,MAAM,4BAA4B,CAAC,SAAS,WAAW,+BAAkB;AACzE,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,OAAO,WAAW,eAAe,kBAAkB;AAC1E,MAAM,cAAc,CAAC,SAAS;AAC9B,MAAM,WACX,SACA,OAAO,cAAc,eACpB,oBAAmB,KAAK,UAAU,QAAQ,KACxC,UAAU,aAAa,cAAc,UAAU,iBAAiB,MACnE,CAAC,OAAO;",
4
+ "sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const isSSR = isWeb && !isWindowDefined\nexport const isClient = isWeb && isWindowDefined\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = isClient && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,0BAAyB;AADzB;AAGO,MAAM,YAAY,2DAAU,QAAO;AACnC,MAAM,QAAQ,2DAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,QAAQ,SAAS,CAAC;AACxB,MAAM,WAAW,SAAS;AAC1B,MAAM,4BAA4B,QAAQ,yBAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,YAAY,kBAAkB;AACrD,MAAM,cAAc,CAAC,SAAS;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/calc.ts"],
4
- "sourcesContent": ["import { isWeb } from '../constants/platform'\nimport { getVariableValue, getVariableVariable } from '../createVariable'\nimport { FontLineHeightTokens, FontSizeTokens, SizeTokens, SpaceTokens } from '../types'\n\n/**\n * Simple calc() that handles native + web\n * on web: outputs a calc() string\n * on native: outputs a plain number\n */\n\nexport type CalcVal =\n | string\n | number\n | SizeTokens\n | SpaceTokens\n | FontSizeTokens\n | FontLineHeightTokens\n\nconst operators = {\n '+': (a: number, b: number) => a + b,\n '-': (a: number, b: number) => a - b,\n '/': (a: number, b: number) => a / b,\n '*': (a: number, b: number) => a * b,\n}\n\ntype Operator = keyof typeof operators\n\nexport const calc = (...valuesAndOperators: (CalcVal | Operator)[]) => {\n if (isWeb) {\n let res = 'calc('\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n // spaces are significant\n res += ' ' + cur + ' '\n } else {\n res += convertToVariableOrNumber(cur)\n }\n }\n return res + ')'\n }\n\n let res = 0\n let nextOp: any = null\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n nextOp = operators[cur as any]\n } else {\n if (nextOp) {\n res = nextOp(res, cur)\n nextOp = null\n } else {\n res = +cur\n }\n }\n }\n return res\n}\n\nconst convertToVariableOrNumber = (v: any) => {\n const varOrVal = getVariableVariable(v)\n if (typeof varOrVal === 'number') {\n return `${varOrVal}px`\n }\n return varOrVal\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AACtB,4BAAsD;AAiBtD,MAAM,YAAY;AAAA,EAChB,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AACrC;AAIO,MAAM,OAAO,IAAI,uBAA+C;AACrE,MAAI,uBAAO;AACT,QAAI,OAAM;AACV,eAAW,OAAO,oBAAoB;AACpC,UAAI,UAAU,MAAa;AAEzB,gBAAO,MAAM,MAAM;AAAA,MACrB,OAAO;AACL,gBAAO,0BAA0B,GAAG;AAAA,MACtC;AAAA,IACF;AACA,WAAO,OAAM;AAAA,EACf;AAEA,MAAI,MAAM;AACV,MAAI,SAAc;AAClB,aAAW,OAAO,oBAAoB;AACpC,QAAI,UAAU,MAAa;AACzB,eAAS,UAAU;AAAA,IACrB,OAAO;AACL,UAAI,QAAQ;AACV,cAAM,OAAO,KAAK,GAAG;AACrB,iBAAS;AAAA,MACX,OAAO;AACL,cAAM,CAAC;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,4BAA4B,CAAC,MAAW;AAC5C,QAAM,WAAW,+CAAoB,CAAC;AACtC,MAAI,OAAO,aAAa,UAAU;AAChC,WAAO,GAAG;AAAA,EACZ;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import { isWeb } from '../constants/platform'\nimport { getVariableVariable } from '../createVariable'\nimport { FontLineHeightTokens, FontSizeTokens, SizeTokens, SpaceTokens } from '../types'\n\n/**\n * Simple calc() that handles native + web\n * on web: outputs a calc() string\n * on native: outputs a plain number\n */\n\nexport type CalcVal =\n | string\n | number\n | SizeTokens\n | SpaceTokens\n | FontSizeTokens\n | FontLineHeightTokens\n\nconst operators = {\n '+': (a: number, b: number) => a + b,\n '-': (a: number, b: number) => a - b,\n '/': (a: number, b: number) => a / b,\n '*': (a: number, b: number) => a * b,\n}\n\ntype Operator = keyof typeof operators\n\nexport const calc = (...valuesAndOperators: (CalcVal | Operator)[]) => {\n if (isWeb) {\n let res = 'calc('\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n // spaces are significant\n res += ' ' + cur + ' '\n } else {\n res += convertToVariableOrNumber(cur)\n }\n }\n return res + ')'\n }\n\n let res = 0\n let nextOp: any = null\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n nextOp = operators[cur as any]\n } else {\n if (nextOp) {\n res = nextOp(res, cur)\n nextOp = null\n } else {\n res = +cur\n }\n }\n }\n return res\n}\n\nconst convertToVariableOrNumber = (v: any) => {\n const varOrVal = getVariableVariable(v)\n if (typeof varOrVal === 'number') {\n return `${varOrVal}px`\n }\n return varOrVal\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AACtB,4BAAoC;AAiBpC,MAAM,YAAY;AAAA,EAChB,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AACrC;AAIO,MAAM,OAAO,IAAI,uBAA+C;AACrE,MAAI,uBAAO;AACT,QAAI,OAAM;AACV,eAAW,OAAO,oBAAoB;AACpC,UAAI,UAAU,MAAa;AAEzB,gBAAO,MAAM,MAAM;AAAA,MACrB,OAAO;AACL,gBAAO,0BAA0B,GAAG;AAAA,MACtC;AAAA,IACF;AACA,WAAO,OAAM;AAAA,EACf;AAEA,MAAI,MAAM;AACV,MAAI,SAAc;AAClB,aAAW,OAAO,oBAAoB;AACpC,QAAI,UAAU,MAAa;AACzB,eAAS,UAAU;AAAA,IACrB,OAAO;AACL,UAAI,QAAQ;AACV,cAAM,OAAO,KAAK,GAAG;AACrB,iBAAS;AAAA,MACX,OAAO;AACL,cAAM,CAAC;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,4BAA4B,CAAC,MAAW;AAC5C,QAAM,WAAW,+CAAoB,CAAC;AACtC,MAAI,OAAO,aAAa,UAAU;AAChC,WAAO,GAAG;AAAA,EACZ;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -20,18 +20,19 @@ __export(matchMedia_exports, {
20
20
  matchMedia: () => matchMedia
21
21
  });
22
22
  module.exports = __toCommonJS(matchMedia_exports);
23
- const matchMedia = typeof window !== "undefined" && window.matchMedia || function matchMediaFallback(query) {
23
+ const matchMedia = typeof window !== "undefined" && window.matchMedia || matchMediaFallback;
24
+ function matchMediaFallback(query) {
25
+ if (process.env.NODE_ENV === "development" && !process.env.IS_STATIC && process.env.TAMAGUI_TARGET !== "web") {
26
+ console.log("warning: matchMedia not loading! Native not picking up .native.js files?");
27
+ }
24
28
  return {
25
29
  addListener() {
26
- if (process.env.NODE_ENV === "development" && !process.env.IS_STATIC && process.env.TAMAGUI_TARGET !== "web") {
27
- console.log("warning: matchMedia not loading! Is native picking up .native.js files?");
28
- }
29
30
  },
30
31
  removeListener() {
31
32
  },
32
33
  matches: false
33
34
  };
34
- };
35
+ }
35
36
  // Annotate the CommonJS export names for ESM import in node:
36
37
  0 && (module.exports = {
37
38
  matchMedia
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/matchMedia.ts"],
4
- "sourcesContent": ["export const matchMedia =\n (typeof window !== 'undefined' && window.matchMedia) ||\n (function matchMediaFallback(query: string) {\n return {\n addListener() {\n if (\n process.env.NODE_ENV === 'development' &&\n !process.env.IS_STATIC &&\n process.env.TAMAGUI_TARGET !== 'web'\n ) {\n console.log('warning: matchMedia not loading! Is native picking up .native.js files?')\n }\n },\n removeListener() {},\n matches: false,\n }\n } as any)\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aACV,OAAO,WAAW,eAAe,OAAO,cACxC,4BAA4B,OAAe;AAC1C,SAAO;AAAA,IACL,cAAc;AACZ,UACE,QAAQ,IAAI,aAAa,iBACzB,CAAC,QAAQ,IAAI,aACb,QAAQ,IAAI,mBAAmB,OAC/B;AACA,gBAAQ,IAAI,yEAAyE;AAAA,MACvF;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,IAAC;AAAA,IAClB,SAAS;AAAA,EACX;AACF;",
4
+ "sourcesContent": ["export const matchMedia = (typeof window !== 'undefined' && window.matchMedia) || matchMediaFallback\n\nfunction matchMediaFallback(query: string): MediaQueryList {\n if (\n process.env.NODE_ENV === 'development' &&\n !process.env.IS_STATIC &&\n process.env.TAMAGUI_TARGET !== 'web'\n ) {\n console.log('warning: matchMedia not loading! Native not picking up .native.js files?')\n }\n return {\n addListener() {},\n removeListener() {},\n matches: false,\n } as any\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAc,OAAO,WAAW,eAAe,OAAO,cAAe;AAElF,4BAA4B,OAA+B;AACzD,MACE,QAAQ,IAAI,aAAa,iBACzB,CAAC,QAAQ,IAAI,aACb,QAAQ,IAAI,mBAAmB,OAC/B;AACA,YAAQ,IAAI,0EAA0E;AAAA,EACxF;AACA,SAAO;AAAA,IACL,cAAc;AAAA,IAAC;AAAA,IACf,iBAAiB;AAAA,IAAC;AAAA,IAClB,SAAS;AAAA,EACX;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,32 @@
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
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var startTransition_exports = {};
22
+ __export(startTransition_exports, {
23
+ startTransition: () => startTransition
24
+ });
25
+ module.exports = __toCommonJS(startTransition_exports);
26
+ var import_react = __toESM(require("react"));
27
+ const startTransition = import_react.default.startTransition || ((cb) => cb());
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ startTransition
31
+ });
32
+ //# sourceMappingURL=startTransition.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/startTransition.ts"],
4
+ "sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGX,MAAM,kBAAkB,qBAAM,mBAAoB,EAAC,OAAO,GAAG;",
6
+ "names": []
7
+ }
@@ -0,0 +1,41 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var useIsSSR_exports = {};
19
+ __export(useIsSSR_exports, {
20
+ useIsSSR: () => useIsSSR
21
+ });
22
+ module.exports = __toCommonJS(useIsSSR_exports);
23
+ var import_react = require("react");
24
+ var import_platform = require("../constants/platform");
25
+ var import_startTransition = require("../helpers/startTransition");
26
+ const useIsSSR = () => {
27
+ const [val, setVal] = (0, import_react.useState)(import_platform.isSSR);
28
+ (0, import_react.useEffect)(() => {
29
+ if (import_platform.isWeb && !import_platform.isSSR) {
30
+ (0, import_startTransition.startTransition)(() => {
31
+ setVal(false);
32
+ });
33
+ }
34
+ }, []);
35
+ return val;
36
+ };
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ useIsSSR
40
+ });
41
+ //# sourceMappingURL=useIsSSR.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useIsSSR.tsx"],
4
+ "sourcesContent": ["import { useEffect, useState } from 'react'\n\nimport { isSSR, isWeb } from '../constants/platform'\nimport { startTransition } from '../helpers/startTransition'\n\n// because any change before first useEffect causes hydration / mismatch issues\n\nexport const useIsSSR = () => {\n const [val, setVal] = useState(isSSR)\n\n useEffect(() => {\n if (isWeb && !isSSR) {\n startTransition(() => {\n setVal(false)\n })\n }\n }, [])\n\n return val\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AAEpC,sBAA6B;AAC7B,6BAAgC;AAIzB,MAAM,WAAW,MAAM;AAC5B,QAAM,CAAC,KAAK,UAAU,2BAAS,qBAAK;AAEpC,8BAAU,MAAM;AACd,QAAI,yBAAS,CAAC,uBAAO;AACnB,kDAAgB,MAAM;AACpB,eAAO,KAAK;AAAA,MACd,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -23,12 +23,14 @@ module.exports = __toCommonJS(useIsTouchDevice_exports);
23
23
  var import_react = require("react");
24
24
  var import_platform = require("../constants/platform");
25
25
  const useIsTouchDevice = () => {
26
- const [touchOnly, setTouchOnly] = (0, import_react.useState)(false);
27
- (0, import_platform.useIsomorphicLayoutEffect)(() => {
28
- if (import_platform.isTouchable) {
29
- setTouchOnly(true);
30
- }
31
- }, []);
26
+ const [touchOnly, setTouchOnly] = (0, import_react.useState)(import_platform.isTouchable);
27
+ if (import_platform.isWeb && !import_platform.isSSR) {
28
+ (0, import_platform.useIsomorphicLayoutEffect)(() => {
29
+ if (import_platform.isTouchable) {
30
+ setTouchOnly(true);
31
+ }
32
+ }, []);
33
+ }
32
34
  return touchOnly;
33
35
  };
34
36
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useIsTouchDevice.tsx"],
4
- "sourcesContent": ["import { useState } from 'react'\n\nimport { isTouchable, useIsomorphicLayoutEffect } from '../constants/platform'\n\n// ssr friendly\n\nexport const useIsTouchDevice = () => {\n const [touchOnly, setTouchOnly] = useState(false)\n\n useIsomorphicLayoutEffect(() => {\n if (isTouchable) {\n setTouchOnly(true)\n }\n }, [])\n\n return touchOnly\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyB;AAEzB,sBAAuD;AAIhD,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,WAAW,gBAAgB,2BAAS,KAAK;AAEhD,iDAA0B,MAAM;AAC9B,QAAI,6BAAa;AACf,mBAAa,IAAI;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
4
+ "sourcesContent": ["import { useState } from 'react'\n\nimport { isSSR, isTouchable, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\n\n// ssr friendly\n\nexport const useIsTouchDevice = () => {\n const [touchOnly, setTouchOnly] = useState(isTouchable)\n\n if (isWeb && !isSSR) {\n // only ever false on web SSR (env), so run effect conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useIsomorphicLayoutEffect(() => {\n if (isTouchable) {\n setTouchOnly(true)\n }\n }, [])\n }\n\n return touchOnly\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyB;AAEzB,sBAAqE;AAI9D,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,WAAW,gBAAgB,2BAAS,2BAAW;AAEtD,MAAI,yBAAS,CAAC,uBAAO;AAGnB,mDAA0B,MAAM;AAC9B,UAAI,6BAAa;AACf,qBAAa,IAAI;AAAA,MACnB;AAAA,IACF,GAAG,CAAC,CAAC;AAAA,EACP;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -60,6 +60,7 @@ __reExport(src_exports, require("./helpers/isObj"), module.exports);
60
60
  __reExport(src_exports, require("./helpers/isTamaguiElement"), module.exports);
61
61
  __reExport(src_exports, require("./helpers/isTamaguiComponent"), module.exports);
62
62
  __reExport(src_exports, require("./helpers/matchMedia"), module.exports);
63
+ __reExport(src_exports, require("./helpers/startTransition"), module.exports);
63
64
  __reExport(src_exports, require("./helpers/themeable"), module.exports);
64
65
  __reExport(src_exports, require("./helpers/withStaticProperties"), module.exports);
65
66
  __reExport(src_exports, require("./contexts/ButtonInsideButtonContext"), module.exports);
@@ -70,9 +71,8 @@ __reExport(src_exports, require("./hooks/useIsTouchDevice"), module.exports);
70
71
  __reExport(src_exports, require("./hooks/useMedia"), module.exports);
71
72
  __reExport(src_exports, require("./hooks/usePressable"), module.exports);
72
73
  __reExport(src_exports, require("./hooks/useTheme"), module.exports);
73
- __reExport(src_exports, require("./hooks/useGet"), module.exports);
74
+ __reExport(src_exports, require("./hooks/useIsSSR"), module.exports);
74
75
  __reExport(src_exports, require("./hooks/useUnmountEffect"), module.exports);
75
- __reExport(src_exports, require("./hooks/useEvent"), module.exports);
76
76
  __reExport(src_exports, require("./views/Slot"), module.exports);
77
77
  __reExport(src_exports, require("./views/Stack"), module.exports);
78
78
  __reExport(src_exports, require("./views/Text"), module.exports);
@@ -82,6 +82,7 @@ __reExport(src_exports, require("./views/ThemeInverse"), module.exports);
82
82
  __reExport(src_exports, require("./views/ThemeProvider"), module.exports);
83
83
  __reExport(src_exports, require("./views/ThemeReset"), module.exports);
84
84
  __reExport(src_exports, require("@tamagui/use-force-update"), module.exports);
85
+ __reExport(src_exports, require("@tamagui/use-event"), module.exports);
85
86
  __reExport(src_exports, require("@tamagui/helpers"), module.exports);
86
87
  // Annotate the CommonJS export names for ESM import in node:
87
88
  0 && (module.exports = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createVariable'\nexport * from './createVariables'\nexport * from './insertFont'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport type { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport { createDOMProps } from '@tamagui/rnw'\n\nexport * from './helpers/calc'\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/mergeProps'\nexport * from './helpers/expandStyles'\nexport * from './helpers/getFont'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/isTamaguiComponent'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useGet'\nexport * from './hooks/useUnmountEffect'\nexport * from './hooks/useEvent'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport { TextAncestorProvider, TextAncestorContext } from './views/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/helpers'\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,sBAAd;AACA,wBAAc,8BADd;AAEA,wBAAc,+BAFd;AAGA,wBAAc,0BAHd;AAIA,wBAAc,4BAJd;AAKA,wBAAc,yBALd;AAMA,wBAAc,2BANd;AAOA,wBAAc,6BAPd;AAQA,wBAAc,8BARd;AASA,wBAAc,yBATd;AAUA,wBAAc,qBAVd;AAWA,wBAAc,oBAXd;AAcA,kBAAoF;AAEpF,wBAAc,kCAhBd;AAiBA,wBAAc,iCAjBd;AAkBA,iBAA+B;AAE/B,wBAAc,2BApBd;AAqBA,wBAAc,0CArBd;AAsBA,wBAAc,mCAtBd;AAuBA,wBAAc,uCAvBd;AAwBA,wBAAc,4CAxBd;AAyBA,wBAAc,8BAzBd;AA0BA,wBAAc,qCA1Bd;AA2BA,wBAAc,sCA3Bd;AA4BA,wBAAc,wCA5Bd;AA6BA,wBAAc,iCA7Bd;AA8BA,wBAAc,mCA9Bd;AA+BA,wBAAc,8BA/Bd;AAgCA,wBAAc,4BAhCd;AAiCA,wBAAc,uCAjCd;AAkCA,wBAAc,yCAlCd;AAmCA,wBAAc,iCAnCd;AAoCA,wBAAc,gCApCd;AAqCA,wBAAc,2CArCd;AAuCA,wBAAc,iDAvCd;AAyCA,wBAAc,gCAzCd;AA0CA,wBAAc,0BA1Cd;AA2CA,wBAAc,iCA3Cd;AA4CA,wBAAc,qCA5Cd;AA6CA,wBAAc,6BA7Cd;AA8CA,wBAAc,iCA9Cd;AA+CA,wBAAc,6BA/Cd;AAgDA,wBAAc,2BAhDd;AAiDA,wBAAc,qCAjDd;AAkDA,wBAAc,6BAlDd;AAoDA,wBAAc,yBApDd;AAqDA,wBAAc,0BArDd;AAsDA,wBAAc,yBAtDd;AAuDA,iCAA0D;AAC1D,wBAAc,0BAxDd;AAyDA,wBAAc,iCAzDd;AA0DA,wBAAc,kCA1Dd;AA2DA,wBAAc,+BA3Dd;AA6DA,wBAAc,sCA7Dd;AA8DA,wBAAc,6BA9Dd;",
4
+ "sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createVariable'\nexport * from './createVariables'\nexport * from './insertFont'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport type { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport { createDOMProps } from '@tamagui/rnw'\n\nexport * from './helpers/calc'\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/mergeProps'\nexport * from './helpers/expandStyles'\nexport * from './helpers/getFont'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/isTamaguiComponent'\nexport * from './helpers/matchMedia'\nexport * from './helpers/startTransition'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useIsSSR'\nexport * from './hooks/useUnmountEffect'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport { TextAncestorProvider, TextAncestorContext } from './views/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-event'\nexport * from '@tamagui/helpers'\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAc,sBAAd;AACA,wBAAc,8BADd;AAEA,wBAAc,+BAFd;AAGA,wBAAc,0BAHd;AAIA,wBAAc,4BAJd;AAKA,wBAAc,yBALd;AAMA,wBAAc,2BANd;AAOA,wBAAc,6BAPd;AAQA,wBAAc,8BARd;AASA,wBAAc,yBATd;AAUA,wBAAc,qBAVd;AAWA,wBAAc,oBAXd;AAcA,kBAAoF;AAEpF,wBAAc,kCAhBd;AAiBA,wBAAc,iCAjBd;AAkBA,iBAA+B;AAE/B,wBAAc,2BApBd;AAqBA,wBAAc,0CArBd;AAsBA,wBAAc,mCAtBd;AAuBA,wBAAc,uCAvBd;AAwBA,wBAAc,4CAxBd;AAyBA,wBAAc,8BAzBd;AA0BA,wBAAc,qCA1Bd;AA2BA,wBAAc,sCA3Bd;AA4BA,wBAAc,wCA5Bd;AA6BA,wBAAc,iCA7Bd;AA8BA,wBAAc,mCA9Bd;AA+BA,wBAAc,8BA/Bd;AAgCA,wBAAc,4BAhCd;AAiCA,wBAAc,uCAjCd;AAkCA,wBAAc,yCAlCd;AAmCA,wBAAc,iCAnCd;AAoCA,wBAAc,sCApCd;AAqCA,wBAAc,gCArCd;AAsCA,wBAAc,2CAtCd;AAwCA,wBAAc,iDAxCd;AA0CA,wBAAc,gCA1Cd;AA2CA,wBAAc,0BA3Cd;AA4CA,wBAAc,iCA5Cd;AA6CA,wBAAc,qCA7Cd;AA8CA,wBAAc,6BA9Cd;AA+CA,wBAAc,iCA/Cd;AAgDA,wBAAc,6BAhDd;AAiDA,wBAAc,6BAjDd;AAkDA,wBAAc,qCAlDd;AAoDA,wBAAc,yBApDd;AAqDA,wBAAc,0BArDd;AAsDA,wBAAc,yBAtDd;AAuDA,iCAA0D;AAC1D,wBAAc,0BAxDd;AAyDA,wBAAc,iCAzDd;AA0DA,wBAAc,kCA1Dd;AA2DA,wBAAc,+BA3Dd;AA6DA,wBAAc,sCA7Dd;AA8DA,wBAAc,+BA9Dd;AA+DA,wBAAc,6BA/Dd;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,32 @@
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
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var startTransition_exports = {};
22
+ __export(startTransition_exports, {
23
+ startTransition: () => startTransition
24
+ });
25
+ module.exports = __toCommonJS(startTransition_exports);
26
+ var import_react = __toESM(require("react"));
27
+ const startTransition = import_react.default.startTransition || ((cb) => cb());
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ startTransition
31
+ });
32
+ //# sourceMappingURL=startTransition.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/startTransition.ts"],
4
+ "sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAGX,MAAM,kBAAkB,qBAAM,mBAAoB,EAAC,OAAO,GAAG;",
6
+ "names": []
7
+ }
@@ -4,13 +4,13 @@ import { Platform } from "react-native";
4
4
  const isAndroid = ((_a = Platform) == null ? void 0 : _a.OS) === "android";
5
5
  const isIOS = ((_b = Platform) == null ? void 0 : _b.OS) === "ios";
6
6
  const isWeb = process.env.TAMAGUI_TARGET === "web";
7
- const isSSR = isWeb && typeof window === "undefined";
8
- const isClient = isWeb && typeof window !== "undefined";
9
- const useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect;
7
+ const isWindowDefined = typeof window !== "undefined";
8
+ const isSSR = isWeb && !isWindowDefined;
9
+ const isClient = isWeb && isWindowDefined;
10
+ const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
10
11
  const isChrome = typeof navigator !== "undefined" && /Chrome/.test(navigator.userAgent || "");
11
- const isWebTouchable = typeof window !== "undefined" && "ontouchstart" in window;
12
+ const isWebTouchable = isClient && "ontouchstart" in window;
12
13
  const isTouchable = !isWeb || isWebTouchable;
13
- const isWebIOS = isWeb && typeof navigator !== "undefined" && (/iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) && !window["MSStream"];
14
14
  export {
15
15
  isAndroid,
16
16
  isChrome,
@@ -19,8 +19,8 @@ export {
19
19
  isSSR,
20
20
  isTouchable,
21
21
  isWeb,
22
- isWebIOS,
23
22
  isWebTouchable,
23
+ isWindowDefined,
24
24
  useIsomorphicLayoutEffect
25
25
  };
26
26
  //# sourceMappingURL=platform.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/constants/platform.ts"],
4
- "sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isSSR = isWeb && typeof window === 'undefined'\nexport const isClient = isWeb && typeof window !== 'undefined'\nexport const useIsomorphicLayoutEffect = !isWeb || isClient ? useLayoutEffect : useEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = typeof window !== 'undefined' && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\nexport const isWebIOS =\n isWeb &&\n typeof navigator !== 'undefined' &&\n (/iPad|iPhone|iPod/.test(navigator.platform) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) &&\n !window['MSStream']\n"],
5
- "mappings": "AAAA;AAAA;AACA;AAEO,MAAM,YAAY,uCAAU,QAAO;AACnC,MAAM,QAAQ,uCAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,QAAQ,SAAS,OAAO,WAAW;AACzC,MAAM,WAAW,SAAS,OAAO,WAAW;AAC5C,MAAM,4BAA4B,CAAC,SAAS,WAAW,kBAAkB;AACzE,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,OAAO,WAAW,eAAe,kBAAkB;AAC1E,MAAM,cAAc,CAAC,SAAS;AAC9B,MAAM,WACX,SACA,OAAO,cAAc,eACpB,oBAAmB,KAAK,UAAU,QAAQ,KACxC,UAAU,aAAa,cAAc,UAAU,iBAAiB,MACnE,CAAC,OAAO;",
4
+ "sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\nimport { Platform } from 'react-native'\n\nexport const isAndroid = Platform?.OS === 'android'\nexport const isIOS = Platform?.OS === 'ios'\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const isSSR = isWeb && !isWindowDefined\nexport const isClient = isWeb && isWindowDefined\nexport const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect\nexport const isChrome = typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\nexport const isWebTouchable = isClient && 'ontouchstart' in window\nexport const isTouchable = !isWeb || isWebTouchable\n"],
5
+ "mappings": "AAAA;AAAA;AACA;AAEO,MAAM,YAAY,uCAAU,QAAO;AACnC,MAAM,QAAQ,uCAAU,QAAO;AAC/B,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,QAAQ,SAAS,CAAC;AACxB,MAAM,WAAW,SAAS;AAC1B,MAAM,4BAA4B,QAAQ,YAAY;AACtD,MAAM,WAAW,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAC5F,MAAM,iBAAiB,YAAY,kBAAkB;AACrD,MAAM,cAAc,CAAC,SAAS;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/calc.ts"],
4
- "sourcesContent": ["import { isWeb } from '../constants/platform'\nimport { getVariableValue, getVariableVariable } from '../createVariable'\nimport { FontLineHeightTokens, FontSizeTokens, SizeTokens, SpaceTokens } from '../types'\n\n/**\n * Simple calc() that handles native + web\n * on web: outputs a calc() string\n * on native: outputs a plain number\n */\n\nexport type CalcVal =\n | string\n | number\n | SizeTokens\n | SpaceTokens\n | FontSizeTokens\n | FontLineHeightTokens\n\nconst operators = {\n '+': (a: number, b: number) => a + b,\n '-': (a: number, b: number) => a - b,\n '/': (a: number, b: number) => a / b,\n '*': (a: number, b: number) => a * b,\n}\n\ntype Operator = keyof typeof operators\n\nexport const calc = (...valuesAndOperators: (CalcVal | Operator)[]) => {\n if (isWeb) {\n let res = 'calc('\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n // spaces are significant\n res += ' ' + cur + ' '\n } else {\n res += convertToVariableOrNumber(cur)\n }\n }\n return res + ')'\n }\n\n let res = 0\n let nextOp: any = null\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n nextOp = operators[cur as any]\n } else {\n if (nextOp) {\n res = nextOp(res, cur)\n nextOp = null\n } else {\n res = +cur\n }\n }\n }\n return res\n}\n\nconst convertToVariableOrNumber = (v: any) => {\n const varOrVal = getVariableVariable(v)\n if (typeof varOrVal === 'number') {\n return `${varOrVal}px`\n }\n return varOrVal\n}\n"],
4
+ "sourcesContent": ["import { isWeb } from '../constants/platform'\nimport { getVariableVariable } from '../createVariable'\nimport { FontLineHeightTokens, FontSizeTokens, SizeTokens, SpaceTokens } from '../types'\n\n/**\n * Simple calc() that handles native + web\n * on web: outputs a calc() string\n * on native: outputs a plain number\n */\n\nexport type CalcVal =\n | string\n | number\n | SizeTokens\n | SpaceTokens\n | FontSizeTokens\n | FontLineHeightTokens\n\nconst operators = {\n '+': (a: number, b: number) => a + b,\n '-': (a: number, b: number) => a - b,\n '/': (a: number, b: number) => a / b,\n '*': (a: number, b: number) => a * b,\n}\n\ntype Operator = keyof typeof operators\n\nexport const calc = (...valuesAndOperators: (CalcVal | Operator)[]) => {\n if (isWeb) {\n let res = 'calc('\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n // spaces are significant\n res += ' ' + cur + ' '\n } else {\n res += convertToVariableOrNumber(cur)\n }\n }\n return res + ')'\n }\n\n let res = 0\n let nextOp: any = null\n for (const cur of valuesAndOperators) {\n if (operators[cur as any]) {\n nextOp = operators[cur as any]\n } else {\n if (nextOp) {\n res = nextOp(res, cur)\n nextOp = null\n } else {\n res = +cur\n }\n }\n }\n return res\n}\n\nconst convertToVariableOrNumber = (v: any) => {\n const varOrVal = getVariableVariable(v)\n if (typeof varOrVal === 'number') {\n return `${varOrVal}px`\n }\n return varOrVal\n}\n"],
5
5
  "mappings": "AAAA;AACA;AAiBA,MAAM,YAAY;AAAA,EAChB,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AAAA,EACnC,KAAK,CAAC,GAAW,MAAc,IAAI;AACrC;AAIO,MAAM,OAAO,IAAI,uBAA+C;AACrE,MAAI,OAAO;AACT,QAAI,OAAM;AACV,eAAW,OAAO,oBAAoB;AACpC,UAAI,UAAU,MAAa;AAEzB,gBAAO,MAAM,MAAM;AAAA,MACrB,OAAO;AACL,gBAAO,0BAA0B,GAAG;AAAA,MACtC;AAAA,IACF;AACA,WAAO,OAAM;AAAA,EACf;AAEA,MAAI,MAAM;AACV,MAAI,SAAc;AAClB,aAAW,OAAO,oBAAoB;AACpC,QAAI,UAAU,MAAa;AACzB,eAAS,UAAU;AAAA,IACrB,OAAO;AACL,UAAI,QAAQ;AACV,cAAM,OAAO,KAAK,GAAG;AACrB,iBAAS;AAAA,MACX,OAAO;AACL,cAAM,CAAC;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEA,MAAM,4BAA4B,CAAC,MAAW;AAC5C,QAAM,WAAW,oBAAoB,CAAC;AACtC,MAAI,OAAO,aAAa,UAAU;AAChC,WAAO,GAAG;AAAA,EACZ;AACA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,16 @@
1
- const matchMedia = typeof window !== "undefined" && window.matchMedia || function matchMediaFallback(query) {
1
+ const matchMedia = typeof window !== "undefined" && window.matchMedia || matchMediaFallback;
2
+ function matchMediaFallback(query) {
3
+ if (process.env.NODE_ENV === "development" && !process.env.IS_STATIC && process.env.TAMAGUI_TARGET !== "web") {
4
+ console.log("warning: matchMedia not loading! Native not picking up .native.js files?");
5
+ }
2
6
  return {
3
7
  addListener() {
4
- if (process.env.NODE_ENV === "development" && !process.env.IS_STATIC && process.env.TAMAGUI_TARGET !== "web") {
5
- console.log("warning: matchMedia not loading! Is native picking up .native.js files?");
6
- }
7
8
  },
8
9
  removeListener() {
9
10
  },
10
11
  matches: false
11
12
  };
12
- };
13
+ }
13
14
  export {
14
15
  matchMedia
15
16
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/helpers/matchMedia.ts"],
4
- "sourcesContent": ["export const matchMedia =\n (typeof window !== 'undefined' && window.matchMedia) ||\n (function matchMediaFallback(query: string) {\n return {\n addListener() {\n if (\n process.env.NODE_ENV === 'development' &&\n !process.env.IS_STATIC &&\n process.env.TAMAGUI_TARGET !== 'web'\n ) {\n console.log('warning: matchMedia not loading! Is native picking up .native.js files?')\n }\n },\n removeListener() {},\n matches: false,\n }\n } as any)\n"],
5
- "mappings": "AAAO,MAAM,aACV,OAAO,WAAW,eAAe,OAAO,cACxC,4BAA4B,OAAe;AAC1C,SAAO;AAAA,IACL,cAAc;AACZ,UACE,QAAQ,IAAI,aAAa,iBACzB,CAAC,QAAQ,IAAI,aACb,QAAQ,IAAI,mBAAmB,OAC/B;AACA,gBAAQ,IAAI,yEAAyE;AAAA,MACvF;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,IAAC;AAAA,IAClB,SAAS;AAAA,EACX;AACF;",
4
+ "sourcesContent": ["export const matchMedia = (typeof window !== 'undefined' && window.matchMedia) || matchMediaFallback\n\nfunction matchMediaFallback(query: string): MediaQueryList {\n if (\n process.env.NODE_ENV === 'development' &&\n !process.env.IS_STATIC &&\n process.env.TAMAGUI_TARGET !== 'web'\n ) {\n console.log('warning: matchMedia not loading! Native not picking up .native.js files?')\n }\n return {\n addListener() {},\n removeListener() {},\n matches: false,\n } as any\n}\n"],
5
+ "mappings": "AAAO,MAAM,aAAc,OAAO,WAAW,eAAe,OAAO,cAAe;AAElF,4BAA4B,OAA+B;AACzD,MACE,QAAQ,IAAI,aAAa,iBACzB,CAAC,QAAQ,IAAI,aACb,QAAQ,IAAI,mBAAmB,OAC/B;AACA,YAAQ,IAAI,0EAA0E;AAAA,EACxF;AACA,SAAO;AAAA,IACL,cAAc;AAAA,IAAC;AAAA,IACf,iBAAiB;AAAA,IAAC;AAAA,IAClB,SAAS;AAAA,EACX;AACF;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ const startTransition = React.startTransition || ((cb) => cb());
3
+ export {
4
+ startTransition
5
+ };
6
+ //# sourceMappingURL=startTransition.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/startTransition.ts"],
4
+ "sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
5
+ "mappings": "AAAA;AAGO,MAAM,kBAAkB,MAAM,mBAAoB,EAAC,OAAO,GAAG;",
6
+ "names": []
7
+ }
@@ -0,0 +1,18 @@
1
+ import { useEffect, useState } from "react";
2
+ import { isSSR, isWeb } from "../constants/platform";
3
+ import { startTransition } from "../helpers/startTransition";
4
+ const useIsSSR = () => {
5
+ const [val, setVal] = useState(isSSR);
6
+ useEffect(() => {
7
+ if (isWeb && !isSSR) {
8
+ startTransition(() => {
9
+ setVal(false);
10
+ });
11
+ }
12
+ }, []);
13
+ return val;
14
+ };
15
+ export {
16
+ useIsSSR
17
+ };
18
+ //# sourceMappingURL=useIsSSR.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useIsSSR.tsx"],
4
+ "sourcesContent": ["import { useEffect, useState } from 'react'\n\nimport { isSSR, isWeb } from '../constants/platform'\nimport { startTransition } from '../helpers/startTransition'\n\n// because any change before first useEffect causes hydration / mismatch issues\n\nexport const useIsSSR = () => {\n const [val, setVal] = useState(isSSR)\n\n useEffect(() => {\n if (isWeb && !isSSR) {\n startTransition(() => {\n setVal(false)\n })\n }\n }, [])\n\n return val\n}\n"],
5
+ "mappings": "AAAA;AAEA;AACA;AAIO,MAAM,WAAW,MAAM;AAC5B,QAAM,CAAC,KAAK,UAAU,SAAS,KAAK;AAEpC,YAAU,MAAM;AACd,QAAI,SAAS,CAAC,OAAO;AACnB,sBAAgB,MAAM;AACpB,eAAO,KAAK;AAAA,MACd,CAAC;AAAA,IACH;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -1,12 +1,14 @@
1
1
  import { useState } from "react";
2
- import { isTouchable, useIsomorphicLayoutEffect } from "../constants/platform";
2
+ import { isSSR, isTouchable, isWeb, useIsomorphicLayoutEffect } from "../constants/platform";
3
3
  const useIsTouchDevice = () => {
4
- const [touchOnly, setTouchOnly] = useState(false);
5
- useIsomorphicLayoutEffect(() => {
6
- if (isTouchable) {
7
- setTouchOnly(true);
8
- }
9
- }, []);
4
+ const [touchOnly, setTouchOnly] = useState(isTouchable);
5
+ if (isWeb && !isSSR) {
6
+ useIsomorphicLayoutEffect(() => {
7
+ if (isTouchable) {
8
+ setTouchOnly(true);
9
+ }
10
+ }, []);
11
+ }
10
12
  return touchOnly;
11
13
  };
12
14
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/hooks/useIsTouchDevice.tsx"],
4
- "sourcesContent": ["import { useState } from 'react'\n\nimport { isTouchable, useIsomorphicLayoutEffect } from '../constants/platform'\n\n// ssr friendly\n\nexport const useIsTouchDevice = () => {\n const [touchOnly, setTouchOnly] = useState(false)\n\n useIsomorphicLayoutEffect(() => {\n if (isTouchable) {\n setTouchOnly(true)\n }\n }, [])\n\n return touchOnly\n}\n"],
5
- "mappings": "AAAA;AAEA;AAIO,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;AAEhD,4BAA0B,MAAM;AAC9B,QAAI,aAAa;AACf,mBAAa,IAAI;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;",
4
+ "sourcesContent": ["import { useState } from 'react'\n\nimport { isSSR, isTouchable, isWeb, useIsomorphicLayoutEffect } from '../constants/platform'\n\n// ssr friendly\n\nexport const useIsTouchDevice = () => {\n const [touchOnly, setTouchOnly] = useState(isTouchable)\n\n if (isWeb && !isSSR) {\n // only ever false on web SSR (env), so run effect conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useIsomorphicLayoutEffect(() => {\n if (isTouchable) {\n setTouchOnly(true)\n }\n }, [])\n }\n\n return touchOnly\n}\n"],
5
+ "mappings": "AAAA;AAEA;AAIO,MAAM,mBAAmB,MAAM;AACpC,QAAM,CAAC,WAAW,gBAAgB,SAAS,WAAW;AAEtD,MAAI,SAAS,CAAC,OAAO;AAGnB,8BAA0B,MAAM;AAC9B,UAAI,aAAa;AACf,qBAAa,IAAI;AAAA,MACnB;AAAA,IACF,GAAG,CAAC,CAAC;AAAA,EACP;AAEA,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/dist/esm/index.js CHANGED
@@ -30,6 +30,7 @@ export * from "./helpers/isObj";
30
30
  export * from "./helpers/isTamaguiElement";
31
31
  export * from "./helpers/isTamaguiComponent";
32
32
  export * from "./helpers/matchMedia";
33
+ export * from "./helpers/startTransition";
33
34
  export * from "./helpers/themeable";
34
35
  export * from "./helpers/withStaticProperties";
35
36
  export * from "./contexts/ButtonInsideButtonContext";
@@ -40,9 +41,8 @@ export * from "./hooks/useIsTouchDevice";
40
41
  export * from "./hooks/useMedia";
41
42
  export * from "./hooks/usePressable";
42
43
  export * from "./hooks/useTheme";
43
- export * from "./hooks/useGet";
44
+ export * from "./hooks/useIsSSR";
44
45
  export * from "./hooks/useUnmountEffect";
45
- export * from "./hooks/useEvent";
46
46
  export * from "./views/Slot";
47
47
  export * from "./views/Stack";
48
48
  export * from "./views/Text";
@@ -52,6 +52,7 @@ export * from "./views/ThemeInverse";
52
52
  export * from "./views/ThemeProvider";
53
53
  export * from "./views/ThemeReset";
54
54
  export * from "@tamagui/use-force-update";
55
+ export * from "@tamagui/use-event";
55
56
  export * from "@tamagui/helpers";
56
57
  export {
57
58
  TextAncestorContext,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createVariable'\nexport * from './createVariables'\nexport * from './insertFont'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport type { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport { createDOMProps } from '@tamagui/rnw'\n\nexport * from './helpers/calc'\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/mergeProps'\nexport * from './helpers/expandStyles'\nexport * from './helpers/getFont'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/isTamaguiComponent'\nexport * from './helpers/matchMedia'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useGet'\nexport * from './hooks/useUnmountEffect'\nexport * from './hooks/useEvent'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport { TextAncestorProvider, TextAncestorContext } from './views/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/helpers'\n"],
5
- "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;",
4
+ "sourcesContent": ["export * from './Tamagui'\nexport * from './createComponent'\nexport * from './createShorthands'\nexport * from './createTheme'\nexport * from './createTamagui'\nexport * from './createFont'\nexport * from './createTokens'\nexport * from './createVariable'\nexport * from './createVariables'\nexport * from './insertFont'\nexport * from './styled'\nexport * from './types'\n// for type portability\nexport type { RNWTextProps, RNWViewProps } from './types-rnw'\nexport { getHasConfigured, getConfig, getThemes, getTokens, onConfiguredOnce } from './conf'\n\nexport * from './constants/constants'\nexport * from './constants/platform'\nexport { createDOMProps } from '@tamagui/rnw'\n\nexport * from './helpers/calc'\nexport * from './helpers/createShallowUpdate'\nexport * from './helpers/getStackSize'\nexport * from './helpers/getVariantExtras'\nexport * from './helpers/getExpandedShorthands'\nexport * from './helpers/getSize'\nexport * from './helpers/getSplitStyles'\nexport * from './helpers/getStylesAtomic'\nexport * from './helpers/pseudoDescriptors'\nexport * from './helpers/mergeProps'\nexport * from './helpers/expandStyles'\nexport * from './helpers/getFont'\nexport * from './helpers/isObj'\nexport * from './helpers/isTamaguiElement'\nexport * from './helpers/isTamaguiComponent'\nexport * from './helpers/matchMedia'\nexport * from './helpers/startTransition'\nexport * from './helpers/themeable'\nexport * from './helpers/withStaticProperties'\n\nexport * from './contexts/ButtonInsideButtonContext'\n\nexport * from './hooks/useConstant'\nexport * from './hooks/useId'\nexport * from './hooks/useIsMounted'\nexport * from './hooks/useIsTouchDevice'\nexport * from './hooks/useMedia'\nexport * from './hooks/usePressable'\nexport * from './hooks/useTheme'\nexport * from './hooks/useIsSSR'\nexport * from './hooks/useUnmountEffect'\n\nexport * from './views/Slot'\nexport * from './views/Stack'\nexport * from './views/Text'\nexport { TextAncestorProvider, TextAncestorContext } from './views/TextAncestorContext'\nexport * from './views/Theme'\nexport * from './views/ThemeInverse'\nexport * from './views/ThemeProvider'\nexport * from './views/ThemeReset'\n\nexport * from '@tamagui/use-force-update'\nexport * from '@tamagui/use-event'\nexport * from '@tamagui/helpers'\n"],
5
+ "mappings": "AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ const startTransition = React.startTransition || ((cb) => cb());
3
+ export {
4
+ startTransition
5
+ };
6
+ //# sourceMappingURL=startTransition.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/startTransition.ts"],
4
+ "sourcesContent": ["import React from 'react'\n\n// backwards compat\nexport const startTransition = React.startTransition || ((cb) => cb())\n"],
5
+ "mappings": "AAAA;AAGO,MAAM,kBAAkB,MAAM,mBAAoB,EAAC,OAAO,GAAG;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "1.0.1-beta.101",
3
+ "version": "1.0.1-beta.102",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -21,13 +21,13 @@
21
21
  ],
22
22
  "dependencies": {
23
23
  "@expo/match-media": "^0.3.0",
24
- "@tamagui/compose-refs": "^1.0.1-beta.101",
25
- "@tamagui/helpers": "^1.0.1-beta.101",
24
+ "@tamagui/compose-refs": "^1.0.1-beta.102",
25
+ "@tamagui/helpers": "^1.0.1-beta.102",
26
26
  "@tamagui/ow": "^0.28.1",
27
- "@tamagui/rnw": "^1.0.1-beta.101",
28
- "@tamagui/use-debounce": "^1.0.1-beta.101",
29
- "@tamagui/use-event": "^1.0.1-beta.101",
30
- "@tamagui/use-force-update": "^1.0.1-beta.101",
27
+ "@tamagui/rnw": "^1.0.1-beta.102",
28
+ "@tamagui/use-debounce": "^1.0.1-beta.102",
29
+ "@tamagui/use-event": "^1.0.1-beta.102",
30
+ "@tamagui/use-force-update": "^1.0.1-beta.102",
31
31
  "expo-screen-orientation": "^4.2.0",
32
32
  "hyphenate-style-name": "^1.0.4",
33
33
  "normalize-css-color": "^1.0.2",
@@ -38,7 +38,7 @@
38
38
  "react-native-web": "*"
39
39
  },
40
40
  "devDependencies": {
41
- "@tamagui/build": "^1.0.1-beta.101",
41
+ "@tamagui/build": "^1.0.1-beta.102",
42
42
  "@types/react": "^18.0.14",
43
43
  "csstype": "^3.0.10",
44
44
  "esbuild": "^0.14.48",
@@ -1,12 +1,12 @@
1
- import { useLayoutEffect } from 'react';
1
+ import { useEffect } from 'react';
2
2
  export declare const isAndroid: boolean;
3
3
  export declare const isIOS: boolean;
4
4
  export declare const isWeb: boolean;
5
+ export declare const isWindowDefined: boolean;
5
6
  export declare const isSSR: boolean;
6
7
  export declare const isClient: boolean;
7
- export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
8
+ export declare const useIsomorphicLayoutEffect: typeof useEffect;
8
9
  export declare const isChrome: boolean;
9
10
  export declare const isWebTouchable: boolean;
10
11
  export declare const isTouchable: boolean;
11
- export declare const isWebIOS: boolean;
12
12
  //# sourceMappingURL=platform.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,eAAe,EAAE,MAAM,OAAO,CAAA;AAGlD,eAAO,MAAM,SAAS,SAA6B,CAAA;AACnD,eAAO,MAAM,KAAK,SAAyB,CAAA;AAC3C,eAAO,MAAM,KAAK,SAAuC,CAAA;AACzD,eAAO,MAAM,KAAK,SAAyC,CAAA;AAC3D,eAAO,MAAM,QAAQ,SAAyC,CAAA;AAC9D,eAAO,MAAM,yBAAyB,wBAAmD,CAAA;AACzF,eAAO,MAAM,QAAQ,SAA+E,CAAA;AACpG,eAAO,MAAM,cAAc,SAA4D,CAAA;AACvF,eAAO,MAAM,WAAW,SAA2B,CAAA;AACnD,eAAO,MAAM,QAAQ,SAKA,CAAA"}
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/constants/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAGlD,eAAO,MAAM,SAAS,SAA6B,CAAA;AACnD,eAAO,MAAM,KAAK,SAAyB,CAAA;AAC3C,eAAO,MAAM,KAAK,SAAuC,CAAA;AACzD,eAAO,MAAM,eAAe,SAAgC,CAAA;AAC5D,eAAO,MAAM,KAAK,SAA4B,CAAA;AAC9C,eAAO,MAAM,QAAQ,SAA2B,CAAA;AAChD,eAAO,MAAM,yBAAyB,kBAAsC,CAAA;AAC5E,eAAO,MAAM,QAAQ,SAA+E,CAAA;AACpG,eAAO,MAAM,cAAc,SAAuC,CAAA;AAClE,eAAO,MAAM,WAAW,SAA2B,CAAA"}
@@ -1,2 +1,2 @@
1
- export declare const matchMedia: any;
1
+ export declare const matchMedia: ((query: string) => MediaQueryList) & typeof globalThis.matchMedia;
2
2
  //# sourceMappingURL=matchMedia.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"matchMedia.d.ts","sourceRoot":"","sources":["../../src/helpers/matchMedia.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,KAgBZ,CAAA"}
1
+ {"version":3,"file":"matchMedia.d.ts","sourceRoot":"","sources":["../../src/helpers/matchMedia.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,oEAA6E,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const startTransition: typeof React.startTransition;
3
+ //# sourceMappingURL=startTransition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startTransition.d.ts","sourceRoot":"","sources":["../../src/helpers/startTransition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,eAAe,8BAA0C,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const useIsSSR: () => boolean;
2
+ //# sourceMappingURL=useIsSSR.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIsSSR.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsSSR.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,QAAQ,eAYpB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIsTouchDevice.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsTouchDevice.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,eAU5B,CAAA"}
1
+ {"version":3,"file":"useIsTouchDevice.d.ts","sourceRoot":"","sources":["../../src/hooks/useIsTouchDevice.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,eAc5B,CAAA"}
package/types/index.d.ts CHANGED
@@ -31,6 +31,7 @@ export * from './helpers/isObj';
31
31
  export * from './helpers/isTamaguiElement';
32
32
  export * from './helpers/isTamaguiComponent';
33
33
  export * from './helpers/matchMedia';
34
+ export * from './helpers/startTransition';
34
35
  export * from './helpers/themeable';
35
36
  export * from './helpers/withStaticProperties';
36
37
  export * from './contexts/ButtonInsideButtonContext';
@@ -41,9 +42,8 @@ export * from './hooks/useIsTouchDevice';
41
42
  export * from './hooks/useMedia';
42
43
  export * from './hooks/usePressable';
43
44
  export * from './hooks/useTheme';
44
- export * from './hooks/useGet';
45
+ export * from './hooks/useIsSSR';
45
46
  export * from './hooks/useUnmountEffect';
46
- export * from './hooks/useEvent';
47
47
  export * from './views/Slot';
48
48
  export * from './views/Stack';
49
49
  export * from './views/Text';
@@ -53,5 +53,6 @@ export * from './views/ThemeInverse';
53
53
  export * from './views/ThemeProvider';
54
54
  export * from './views/ThemeReset';
55
55
  export * from '@tamagui/use-force-update';
56
+ export * from '@tamagui/use-event';
56
57
  export * from '@tamagui/helpers';
57
58
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAE5F,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAE9C,cAAc,sCAAsC,CAAA;AAEpD,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAEhC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACvF,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAElC,cAAc,2BAA2B,CAAA;AACzC,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC7D,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAE5F,cAAc,uBAAuB,CAAA;AACrC,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,mBAAmB,CAAA;AACjC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA;AACpC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAE9C,cAAc,sCAAsC,CAAA;AAEpD,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AAExC,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACvF,cAAc,eAAe,CAAA;AAC7B,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAElC,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const startTransition: typeof React.startTransition;
3
+ //# sourceMappingURL=startTransition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startTransition.d.ts","sourceRoot":"","sources":["../src/startTransition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,eAAe,8BAA0C,CAAA"}
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare type StringRecord = {
2
3
  [key: string]: string;
3
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeInverse.d.ts","sourceRoot":"","sources":["../../src/views/ThemeInverse.tsx"],"names":[],"mappings":"AAMA,aAAK,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAA;AAO7C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,QAEpD;AAED,eAAO,MAAM,YAAY,UAAW;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,gBAWpD,CAAA"}
1
+ {"version":3,"file":"ThemeInverse.d.ts","sourceRoot":"","sources":["../../src/views/ThemeInverse.tsx"],"names":[],"mappings":";AAMA,aAAK,YAAY,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAA;AAO7C,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,QAEpD;AAED,eAAO,MAAM,YAAY,UAAW;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,gBAWpD,CAAA"}