@tamagui/constants 1.1.7 → 1.1.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/cjs/constants.js
CHANGED
|
@@ -35,7 +35,14 @@ const isWeb = process.env.TAMAGUI_TARGET === "web";
|
|
|
35
35
|
const isWindowDefined = typeof window !== "undefined";
|
|
36
36
|
const isServer = isWeb && !isWindowDefined;
|
|
37
37
|
const isClient = isWeb && isWindowDefined;
|
|
38
|
-
const isRSC = process.env.ENABLE_RSC ?
|
|
38
|
+
const isRSC = process.env.ENABLE_RSC ? (
|
|
39
|
+
// note this is statically analyzed so no funny business, just access it without optional chaining
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
import_meta.env ? (
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
import_meta.env.SSR
|
|
44
|
+
) : false
|
|
45
|
+
) : false;
|
|
39
46
|
const idFn = () => {
|
|
40
47
|
};
|
|
41
48
|
const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? import_react.useEffect : import_react.useLayoutEffect;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.ts"],
|
|
4
4
|
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\n\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const isServer = isWeb && !isWindowDefined\nexport const isClient = isWeb && isWindowDefined\n\n// may want to move to VITE_RSC_BUILD\nexport const isRSC = process.env.ENABLE_RSC\n ? // note this is statically analyzed so no funny business, just access it without optional chaining\n // @ts-ignore\n import.meta.env\n ? // @ts-ignore\n import.meta.env.SSR\n : false\n : false\n\nconst idFn = () => {}\nexport const useIsomorphicLayoutEffect = isRSC\n ? idFn\n : isServer\n ? useEffect\n : useLayoutEffect\nexport const isChrome =\n typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\n\nexport const isWebTouchable =\n isClient && ('ontouchstart' in window || navigator.maxTouchPoints > 0)\n\nexport const isTouchable = !isWeb || isWebTouchable\n\nif (process.env.NODE_ENV === 'development') {\n if (!process.env.TAMAGUI_TARGET) {\n // eslint-disable-next-line no-console\n console.warn(`Must set TAMAGUI_TARGET to \"web\" or \"native\"`)\n } else if (\n isClient &&\n process.env.TAMAGUI_TARGET !== 'web' &&\n process.env.TAMAGUI_IGNORE_TARGET !== '1'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Must set TAMAGUI_TARGET to \"web\" for web apps - if you have window defined outside of the browser, set TAMAGUI_IGNORE_TARGET=1 to hide this`\n )\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAA3C;AAEO,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,WAAW,SAAS,CAAC;AAC3B,MAAM,WAAW,SAAS;AAG1B,MAAM,QAAQ,QAAQ,IAAI,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAA3C;AAEO,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,WAAW,SAAS,CAAC;AAC3B,MAAM,WAAW,SAAS;AAG1B,MAAM,QAAQ,QAAQ,IAAI;AAAA;AAAA;AAAA,EAG7B,YAAY;AAAA;AAAA,IAEV,YAAY,IAAI;AAAA,MAChB;AAAA,IACF;AAEJ,MAAM,OAAO,MAAM;AAAC;AACb,MAAM,4BAA4B,QACrC,OACA,WACA,yBACA;AACG,MAAM,WACX,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAEtE,MAAM,iBACX,aAAa,kBAAkB,UAAU,UAAU,iBAAiB;AAE/D,MAAM,cAAc,CAAC,SAAS;AAErC,IAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,MAAI,CAAC,QAAQ,IAAI,gBAAgB;AAE/B,YAAQ,KAAK,8CAA8C;AAAA,EAC7D,WACE,YACA,QAAQ,IAAI,mBAAmB,SAC/B,QAAQ,IAAI,0BAA0B,KACtC;AAEA,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/constants.js
CHANGED
|
@@ -3,7 +3,14 @@ const isWeb = process.env.TAMAGUI_TARGET === "web";
|
|
|
3
3
|
const isWindowDefined = typeof window !== "undefined";
|
|
4
4
|
const isServer = isWeb && !isWindowDefined;
|
|
5
5
|
const isClient = isWeb && isWindowDefined;
|
|
6
|
-
const isRSC = process.env.ENABLE_RSC ?
|
|
6
|
+
const isRSC = process.env.ENABLE_RSC ? (
|
|
7
|
+
// note this is statically analyzed so no funny business, just access it without optional chaining
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
import.meta.env ? (
|
|
10
|
+
// @ts-ignore
|
|
11
|
+
import.meta.env.SSR
|
|
12
|
+
) : false
|
|
13
|
+
) : false;
|
|
7
14
|
const idFn = () => {
|
|
8
15
|
};
|
|
9
16
|
const useIsomorphicLayoutEffect = isRSC ? idFn : isServer ? useEffect : useLayoutEffect;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.ts"],
|
|
4
4
|
"sourcesContent": ["import { useEffect, useLayoutEffect } from 'react'\n\nexport const isWeb = process.env.TAMAGUI_TARGET === 'web'\nexport const isWindowDefined = typeof window !== 'undefined'\nexport const isServer = isWeb && !isWindowDefined\nexport const isClient = isWeb && isWindowDefined\n\n// may want to move to VITE_RSC_BUILD\nexport const isRSC = process.env.ENABLE_RSC\n ? // note this is statically analyzed so no funny business, just access it without optional chaining\n // @ts-ignore\n import.meta.env\n ? // @ts-ignore\n import.meta.env.SSR\n : false\n : false\n\nconst idFn = () => {}\nexport const useIsomorphicLayoutEffect = isRSC\n ? idFn\n : isServer\n ? useEffect\n : useLayoutEffect\nexport const isChrome =\n typeof navigator !== 'undefined' && /Chrome/.test(navigator.userAgent || '')\n\nexport const isWebTouchable =\n isClient && ('ontouchstart' in window || navigator.maxTouchPoints > 0)\n\nexport const isTouchable = !isWeb || isWebTouchable\n\nif (process.env.NODE_ENV === 'development') {\n if (!process.env.TAMAGUI_TARGET) {\n // eslint-disable-next-line no-console\n console.warn(`Must set TAMAGUI_TARGET to \"web\" or \"native\"`)\n } else if (\n isClient &&\n process.env.TAMAGUI_TARGET !== 'web' &&\n process.env.TAMAGUI_IGNORE_TARGET !== '1'\n ) {\n // eslint-disable-next-line no-console\n console.warn(\n `Must set TAMAGUI_TARGET to \"web\" for web apps - if you have window defined outside of the browser, set TAMAGUI_IGNORE_TARGET=1 to hide this`\n )\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,WAAW,uBAAuB;AAEpC,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,WAAW,SAAS,CAAC;AAC3B,MAAM,WAAW,SAAS;AAG1B,MAAM,QAAQ,QAAQ,IAAI,
|
|
5
|
+
"mappings": "AAAA,SAAS,WAAW,uBAAuB;AAEpC,MAAM,QAAQ,QAAQ,IAAI,mBAAmB;AAC7C,MAAM,kBAAkB,OAAO,WAAW;AAC1C,MAAM,WAAW,SAAS,CAAC;AAC3B,MAAM,WAAW,SAAS;AAG1B,MAAM,QAAQ,QAAQ,IAAI;AAAA;AAAA;AAAA,EAG7B,YAAY;AAAA;AAAA,IAEV,YAAY,IAAI;AAAA,MAChB;AAAA,IACF;AAEJ,MAAM,OAAO,MAAM;AAAC;AACb,MAAM,4BAA4B,QACrC,OACA,WACA,YACA;AACG,MAAM,WACX,OAAO,cAAc,eAAe,SAAS,KAAK,UAAU,aAAa,EAAE;AAEtE,MAAM,iBACX,aAAa,kBAAkB,UAAU,UAAU,iBAAiB;AAE/D,MAAM,cAAc,CAAC,SAAS;AAErC,IAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,MAAI,CAAC,QAAQ,IAAI,gBAAgB;AAE/B,YAAQ,KAAK,8CAA8C;AAAA,EAC7D,WACE,YACA,QAAQ,IAAI,mBAAmB,SAC/B,QAAQ,IAAI,0BAA0B,KACtC;AAEA,YAAQ;AAAA,MACN;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/constants",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"types": "./types/constants.d.ts",
|
|
5
5
|
"main": "dist/cjs/constants",
|
|
6
6
|
"module": "dist/esm/constants",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"clean:build": "tamagui-build clean:build"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@tamagui/build": "^1.1.
|
|
21
|
+
"@tamagui/build": "^1.1.9",
|
|
22
22
|
"react": "^18.2.0",
|
|
23
23
|
"react-native": "*"
|
|
24
24
|
},
|