@tamagui/web 1.82.0 → 1.82.1
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/helpers/expandStyles.js +1 -1
- package/dist/cjs/helpers/expandStyles.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.native.js +1 -1
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/expandStylesAndRemoveNullishValues.js.map +1 -1
- package/dist/cjs/helpers/expandStylesAndRemoveNullishValues.native.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +2 -2
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.native.js +2 -2
- package/dist/cjs/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.js +8 -21
- package/dist/cjs/helpers/mergeVariants.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.native.js +8 -21
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.js +2 -2
- package/dist/cjs/helpers/normalizeColor.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.native.js +2 -2
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
- package/dist/cjs/helpers/propMapper.js +2 -2
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +2 -2
- package/dist/cjs/helpers/propMapper.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.js +5 -9
- package/dist/cjs/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.native.js +5 -9
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.js +1 -2
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.native.js +1 -2
- package/dist/cjs/helpers/proxyThemeVariables.native.js.map +1 -1
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/themeable.native.js.map +1 -1
- package/dist/cjs/helpers/themes.js +5 -5
- package/dist/cjs/helpers/themes.js.map +1 -1
- package/dist/cjs/helpers/themes.native.js +5 -5
- package/dist/cjs/helpers/themes.native.js.map +1 -1
- package/dist/cjs/hooks/useDisableSSR.js +4 -10
- package/dist/cjs/hooks/useDisableSSR.js.map +1 -1
- package/dist/cjs/hooks/useDisableSSR.native.js +4 -10
- package/dist/cjs/hooks/useDisableSSR.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.js +3 -3
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useMedia.native.js +3 -3
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +2 -4
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js +2 -4
- package/dist/cjs/hooks/useTheme.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.js +1 -1
- package/dist/esm/helpers/expandStyles.js.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +1 -1
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/expandStylesAndRemoveNullishValues.js.map +1 -1
- package/dist/esm/helpers/expandStylesAndRemoveNullishValues.native.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.native.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js +1 -2
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.native.js +1 -2
- package/dist/esm/helpers/getVariantExtras.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.js +8 -21
- package/dist/esm/helpers/mergeVariants.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +8 -21
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.js +1 -2
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.native.js +1 -2
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +2 -2
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/propMapper.native.js +2 -2
- package/dist/esm/helpers/propMapper.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.js +3 -7
- package/dist/esm/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +3 -7
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeVariables.js +1 -2
- package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/esm/helpers/proxyThemeVariables.native.js +1 -2
- package/dist/esm/helpers/proxyThemeVariables.native.js.map +1 -1
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/themeable.native.js.map +1 -1
- package/dist/esm/helpers/themes.js +5 -5
- package/dist/esm/helpers/themes.js.map +1 -1
- package/dist/esm/helpers/themes.native.js +5 -5
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/hooks/useDisableSSR.js +2 -9
- package/dist/esm/hooks/useDisableSSR.js.map +1 -1
- package/dist/esm/hooks/useDisableSSR.native.js +2 -9
- package/dist/esm/hooks/useDisableSSR.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +3 -4
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +3 -4
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +1 -5
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useTheme.native.js +1 -5
- package/dist/esm/hooks/useTheme.native.js.map +1 -1
- package/package.json +10 -10
- package/src/helpers/expandStyles.ts +2 -2
- package/src/helpers/expandStylesAndRemoveNullishValues.ts +0 -1
- package/src/helpers/getExpandedShorthands.ts +3 -0
- package/src/helpers/getVariantExtras.tsx +1 -2
- package/src/helpers/mergeVariants.ts +13 -32
- package/src/helpers/normalizeColor.ts +1 -5
- package/src/helpers/propMapper.ts +3 -1
- package/src/helpers/proxyThemeToParents.ts +5 -8
- package/src/helpers/proxyThemeVariables.tsx +1 -3
- package/src/helpers/themeable.tsx +1 -1
- package/src/helpers/themes.ts +4 -5
- package/src/hooks/useDisableSSR.tsx +2 -10
- package/src/hooks/useMedia.tsx +4 -5
- package/src/hooks/useTheme.tsx +1 -7
- package/types/helpers/expandStylesAndRemoveNullishValues.d.ts.map +1 -1
- package/types/helpers/getExpandedShorthands.d.ts +3 -0
- package/types/helpers/getExpandedShorthands.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/mergeVariants.d.ts +1 -1
- package/types/helpers/mergeVariants.d.ts.map +1 -1
- package/types/helpers/normalizeColor.d.ts.map +1 -1
- package/types/helpers/propMapper.d.ts.map +1 -1
- package/types/helpers/proxyThemeToParents.d.ts +0 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/proxyThemeVariables.d.ts.map +1 -1
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/hooks/useDisableSSR.d.ts +1 -2
- package/types/hooks/useDisableSSR.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/src/helpers/createChainedWeakCache.tsx +0 -39
- package/src/helpers/createProxy.ts +0 -15
- package/src/hooks/getThemeUnwrapped.tsx +0 -5
- package/src/hooks/useId.tsx +0 -1
- package/src/hooks/useMemoDebug.tsx +0 -18
|
@@ -2,14 +2,12 @@ import { isClient, isIos, isServer } from "@tamagui/constants";
|
|
|
2
2
|
import { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { getConfig } from "../config";
|
|
4
4
|
import { getVariable } from "../createVariable";
|
|
5
|
-
import { createProxy } from "../helpers/createProxy";
|
|
6
5
|
import { isEqualShallow } from "../helpers/createShallowSetState";
|
|
7
6
|
import {
|
|
8
7
|
ThemeManager,
|
|
9
8
|
getHasThemeUpdatingProps
|
|
10
9
|
} from "../helpers/ThemeManager";
|
|
11
10
|
import { ThemeManagerContext } from "../helpers/ThemeManagerContext";
|
|
12
|
-
import { GetThemeUnwrapped } from "./getThemeUnwrapped";
|
|
13
11
|
const emptyProps = { name: null };
|
|
14
12
|
let cached;
|
|
15
13
|
function getDefaultThemeProxied() {
|
|
@@ -51,7 +49,7 @@ function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys
|
|
|
51
49
|
function track(key) {
|
|
52
50
|
keys && !keys.includes(key) && (keys.push(key), process.env.NODE_ENV === "development" && debug && console.info(` \u{1F3A8} useTheme() tracking new key: ${key}`));
|
|
53
51
|
}
|
|
54
|
-
return
|
|
52
|
+
return new Proxy(theme, {
|
|
55
53
|
has(_, key) {
|
|
56
54
|
if (Reflect.has(theme, key))
|
|
57
55
|
return !0;
|
|
@@ -59,8 +57,6 @@ function getThemeProxied({ theme, name, scheme }, deopt = !1, themeManager, keys
|
|
|
59
57
|
return key[0] === "$" && (key = key.slice(1)), themeManager?.allKeys.has(key);
|
|
60
58
|
},
|
|
61
59
|
get(_, key) {
|
|
62
|
-
if (key === GetThemeUnwrapped)
|
|
63
|
-
return theme;
|
|
64
60
|
if (
|
|
65
61
|
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
66
62
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/hooks/useTheme.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,UAAU,OAAO,gBAAgB;AAC1C,SAAS,Y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A,cAAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC,GACD,QAAQ,SAAS;AAAA,IACnB;AAEA,WAAO;AAAA,EACT;AACF;",
|
|
5
5
|
"names": ["_", "themeManager", "state", "isNewTheme", "mounted", "inversed"]
|
|
6
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/web",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.1",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"reset.css"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@tamagui/compose-refs": "1.82.
|
|
31
|
-
"@tamagui/constants": "1.82.
|
|
32
|
-
"@tamagui/helpers": "1.82.
|
|
33
|
-
"@tamagui/normalize-css-color": "1.82.
|
|
34
|
-
"@tamagui/timer": "1.82.
|
|
35
|
-
"@tamagui/use-did-finish-ssr": "1.82.
|
|
36
|
-
"@tamagui/use-event": "1.82.
|
|
37
|
-
"@tamagui/use-force-update": "1.82.
|
|
30
|
+
"@tamagui/compose-refs": "1.82.1",
|
|
31
|
+
"@tamagui/constants": "1.82.1",
|
|
32
|
+
"@tamagui/helpers": "1.82.1",
|
|
33
|
+
"@tamagui/normalize-css-color": "1.82.1",
|
|
34
|
+
"@tamagui/timer": "1.82.1",
|
|
35
|
+
"@tamagui/use-did-finish-ssr": "1.82.1",
|
|
36
|
+
"@tamagui/use-event": "1.82.1",
|
|
37
|
+
"@tamagui/use-force-update": "1.82.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "*"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@tamagui/build": "1.82.
|
|
43
|
+
"@tamagui/build": "1.82.1",
|
|
44
44
|
"@testing-library/react": "^14.0.0",
|
|
45
45
|
"csstype": "^3.0.10",
|
|
46
46
|
"react": "^18.2.0",
|
|
@@ -24,8 +24,8 @@ export function fixStyles(style: Record<string, any>) {
|
|
|
24
24
|
// TODO could be native-only
|
|
25
25
|
// ensure border style set by default to solid
|
|
26
26
|
for (const key in borderDefaults) {
|
|
27
|
-
if (key in style
|
|
28
|
-
style[borderDefaults[key]]
|
|
27
|
+
if (key in style) {
|
|
28
|
+
style[borderDefaults[key]] ||= 'solid'
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getVariableValue } from '../createVariable'
|
|
2
2
|
import { GenericFonts, GetStyleState } from '../types'
|
|
3
3
|
import { LanguageContextType } from '../views/FontLanguage.types'
|
|
4
|
-
import { createProxy } from './createProxy'
|
|
5
4
|
|
|
6
5
|
export function getVariantExtras(styleState: GetStyleState) {
|
|
7
6
|
const { curProps, conf, context, theme } = styleState
|
|
@@ -23,7 +22,7 @@ export function getVariantExtras(styleState: GetStyleState) {
|
|
|
23
22
|
font: fonts[fontFamily] || fonts[styleState.conf.defaultFont!],
|
|
24
23
|
// TODO do this in splitstlye
|
|
25
24
|
// we avoid passing in default props for media queries because that would confuse things like SizableText.size:
|
|
26
|
-
props:
|
|
25
|
+
props: new Proxy(curProps, {
|
|
27
26
|
// handles shorthands
|
|
28
27
|
get(target, key) {
|
|
29
28
|
const shorthand = conf.inverseShorthands[key as any]
|
|
@@ -5,51 +5,32 @@ import type { GenericVariantDefinitions } from '../types'
|
|
|
5
5
|
|
|
6
6
|
export const mergeVariants = (
|
|
7
7
|
parentVariants: GenericVariantDefinitions,
|
|
8
|
-
ourVariants: GenericVariantDefinitions
|
|
8
|
+
ourVariants: GenericVariantDefinitions,
|
|
9
|
+
level = 0
|
|
9
10
|
) => {
|
|
10
11
|
const variants = {}
|
|
11
12
|
|
|
12
13
|
for (const key in ourVariants) {
|
|
13
14
|
const parentVariant = parentVariants?.[key]
|
|
14
15
|
const ourVariant = ourVariants[key]
|
|
15
|
-
|
|
16
|
-
// do some early checks to avoid bad merges
|
|
17
16
|
if (!parentVariant || typeof ourVariant === 'function') {
|
|
18
17
|
variants[key] = ourVariant
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// do some early checks to avoid bad merges
|
|
23
|
-
if (parentVariant && !ourVariant) {
|
|
18
|
+
} else if (parentVariant && !ourVariant) {
|
|
24
19
|
variants[key] = parentVariant[key]
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const parentVal = parentVariant?.[subKey]
|
|
33
|
-
if (typeof val === 'function') {
|
|
34
|
-
variants[key][subKey] = val
|
|
35
|
-
} else if (!parentVal || typeof parentVal === 'function') {
|
|
36
|
-
variants[key][subKey] = val
|
|
20
|
+
} else {
|
|
21
|
+
if (level === 0) {
|
|
22
|
+
variants[key] = mergeVariants(
|
|
23
|
+
parentVariant as Record<string, any>,
|
|
24
|
+
ourVariant as Record<string, any>,
|
|
25
|
+
level + 1
|
|
26
|
+
)
|
|
37
27
|
} else {
|
|
38
|
-
variants[key]
|
|
39
|
-
|
|
40
|
-
...
|
|
41
|
-
...val,
|
|
28
|
+
variants[key] = {
|
|
29
|
+
...parentVariant,
|
|
30
|
+
...ourVariant,
|
|
42
31
|
}
|
|
43
32
|
}
|
|
44
33
|
}
|
|
45
|
-
|
|
46
|
-
// merge parent variant keys that are superset
|
|
47
|
-
if (parentVariant) {
|
|
48
|
-
variants[key] = {
|
|
49
|
-
...parentVariant,
|
|
50
|
-
...variants[key],
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
34
|
}
|
|
54
35
|
|
|
55
36
|
return {
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { isWeb } from '@tamagui/constants'
|
|
2
1
|
import { normalizeCSSColor, rgba } from '@tamagui/normalize-css-color'
|
|
3
2
|
|
|
4
3
|
export { rgba } from '@tamagui/normalize-css-color'
|
|
5
4
|
|
|
6
5
|
export const normalizeColor = (color?: string | null, opacity?: number) => {
|
|
7
6
|
if (!color) return
|
|
8
|
-
if (color[0] === '$' ||
|
|
9
|
-
return color
|
|
10
|
-
}
|
|
11
|
-
if (isWeb && opacity === 1) {
|
|
7
|
+
if (color[0] === '$' || color.startsWith('var(')) {
|
|
12
8
|
return color
|
|
13
9
|
}
|
|
14
10
|
const colorProcessed = normalizeCSSColor(color)
|
|
@@ -19,6 +19,8 @@ import { isObj } from './isObj'
|
|
|
19
19
|
import { pseudoDescriptors } from './pseudoDescriptors'
|
|
20
20
|
|
|
21
21
|
export const propMapper: PropMapper = (key, value, styleStateIn, subPropsIn) => {
|
|
22
|
+
lastFontFamilyToken = null
|
|
23
|
+
|
|
22
24
|
if (!(process.env.TAMAGUI_TARGET === 'native' && isAndroid)) {
|
|
23
25
|
// this shouldnt be necessary and handled in the outer loop
|
|
24
26
|
if (key === 'elevationAndroid') return
|
|
@@ -99,7 +101,7 @@ export const propMapper: PropMapper = (key, value, styleStateIn, subPropsIn) =>
|
|
|
99
101
|
[key, value],
|
|
100
102
|
]
|
|
101
103
|
|
|
102
|
-
if (key === 'fontFamily') {
|
|
104
|
+
if (key === 'fontFamily' && lastFontFamilyToken) {
|
|
103
105
|
fontFamilyCache.set(result, lastFontFamilyToken)
|
|
104
106
|
}
|
|
105
107
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GetThemeUnwrapped } from '../hooks/getThemeUnwrapped'
|
|
1
|
+
import { getTokenObject } from '../config'
|
|
3
2
|
import { DedupedThemes, ThemeParsed } from '../types'
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
const themesRaw: Record<string, ThemeParsed> = {}
|
|
6
5
|
|
|
7
6
|
// this seems expensive but its necessary to do two loops unless we want to refactor a variety of things again
|
|
8
7
|
// not *too* much work but not a big cost doing the two loops
|
|
@@ -50,9 +49,8 @@ export function proxyThemeToParents(themeName: string, theme: ThemeParsed) {
|
|
|
50
49
|
// proxy fallback values to parent theme values
|
|
51
50
|
return new Proxy(theme, {
|
|
52
51
|
get(target, key) {
|
|
53
|
-
if (key === GetThemeUnwrapped) return theme
|
|
54
52
|
if (
|
|
55
|
-
key
|
|
53
|
+
!key ||
|
|
56
54
|
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
57
55
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
58
56
|
key == 'undefined' ||
|
|
@@ -63,12 +61,11 @@ export function proxyThemeToParents(themeName: string, theme: ThemeParsed) {
|
|
|
63
61
|
// check parents
|
|
64
62
|
for (let i = numParents - 1; i >= 0; i--) {
|
|
65
63
|
const parent = themesRaw[parents[i]]
|
|
66
|
-
if (
|
|
67
|
-
if (Reflect.has(parent, key)) {
|
|
64
|
+
if (parent && Reflect.has(parent, key)) {
|
|
68
65
|
return Reflect.get(parent, key)
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
|
-
return getTokenObject(key as any)
|
|
68
|
+
return getTokenObject(key as any)
|
|
72
69
|
},
|
|
73
70
|
})
|
|
74
71
|
}
|
package/src/helpers/themes.ts
CHANGED
|
@@ -4,19 +4,18 @@ import { createVariable, isVariable } from '../createVariable'
|
|
|
4
4
|
// shared by createTamagui so extracted here
|
|
5
5
|
export function ensureThemeVariable(theme: any, key: string) {
|
|
6
6
|
const val = theme[key]
|
|
7
|
-
const themeKey = key
|
|
8
7
|
if (!isVariable(val)) {
|
|
9
8
|
theme[key] = createVariable({
|
|
10
|
-
key
|
|
11
|
-
name:
|
|
9
|
+
key,
|
|
10
|
+
name: key,
|
|
12
11
|
val,
|
|
13
12
|
})
|
|
14
13
|
} else {
|
|
15
|
-
if (val.name !==
|
|
14
|
+
if (val.name !== key) {
|
|
16
15
|
// rename to theme name
|
|
17
16
|
theme[key] = createVariable({
|
|
18
17
|
key: val.name,
|
|
19
|
-
name:
|
|
18
|
+
name: key,
|
|
20
19
|
val: val.val,
|
|
21
20
|
})
|
|
22
21
|
}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import { useContext } from 'react'
|
|
2
|
-
|
|
3
1
|
import { getConfig } from '../config'
|
|
4
|
-
import { ComponentContext } from '../contexts/ComponentContext'
|
|
5
2
|
import { ComponentContextI } from '../types'
|
|
6
3
|
|
|
7
|
-
export function
|
|
8
|
-
|
|
9
|
-
return getDisableSSR(componentContext)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function getDisableSSR(componentContext: ComponentContextI) {
|
|
13
|
-
return componentContext.disableSSR ?? getConfig().disableSSR
|
|
4
|
+
export function getDisableSSR(componentContext?: ComponentContextI) {
|
|
5
|
+
return componentContext?.disableSSR ?? getConfig().disableSSR
|
|
14
6
|
}
|
package/src/hooks/useMedia.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { isServer, isWeb
|
|
1
|
+
import { isServer, isWeb } from '@tamagui/constants'
|
|
2
2
|
import { useRef, useSyncExternalStore } from 'react'
|
|
3
3
|
|
|
4
4
|
import { getConfig } from '../config'
|
|
5
|
-
import { createProxy } from '../helpers/createProxy'
|
|
6
5
|
import { matchMedia } from '../helpers/matchMedia'
|
|
7
6
|
import { pseudoDescriptors } from '../helpers/pseudoDescriptors'
|
|
8
7
|
import type {
|
|
@@ -15,12 +14,12 @@ import type {
|
|
|
15
14
|
TamaguiInternalConfig,
|
|
16
15
|
UseMediaState,
|
|
17
16
|
} from '../types'
|
|
18
|
-
import { getDisableSSR
|
|
17
|
+
import { getDisableSSR } from './useDisableSSR'
|
|
19
18
|
|
|
20
19
|
export let mediaState: MediaQueryState =
|
|
21
20
|
// development only safeguard
|
|
22
21
|
process.env.NODE_ENV === 'development'
|
|
23
|
-
?
|
|
22
|
+
? new Proxy(
|
|
24
23
|
{},
|
|
25
24
|
{
|
|
26
25
|
get(target, key) {
|
|
@@ -191,7 +190,7 @@ function subscribe(subscriber: any) {
|
|
|
191
190
|
export function useMedia(uid?: any, componentContext?: ComponentContextI): UseMediaState {
|
|
192
191
|
const internal = useRef<UseMediaInternalState | undefined>()
|
|
193
192
|
// performance boost to avoid using context twice
|
|
194
|
-
const disableSSR =
|
|
193
|
+
const disableSSR = getDisableSSR(componentContext)
|
|
195
194
|
const initialState = (disableSSR || !isWeb ? mediaState : initState) || {}
|
|
196
195
|
|
|
197
196
|
const state = useSyncExternalStore<MediaQueryState>(
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import { useContext, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { getConfig } from '../config'
|
|
5
5
|
import { Variable, getVariable } from '../createVariable'
|
|
6
|
-
import { createProxy } from '../helpers/createProxy'
|
|
7
6
|
import { isEqualShallow } from '../helpers/createShallowSetState'
|
|
8
7
|
import {
|
|
9
8
|
ThemeManager,
|
|
@@ -19,7 +18,6 @@ import type {
|
|
|
19
18
|
VariableVal,
|
|
20
19
|
VariableValGeneric,
|
|
21
20
|
} from '../types'
|
|
22
|
-
import { GetThemeUnwrapped } from './getThemeUnwrapped'
|
|
23
21
|
|
|
24
22
|
export type ChangedThemeResponse = {
|
|
25
23
|
state?: ThemeManagerState
|
|
@@ -156,7 +154,7 @@ export function getThemeProxied(
|
|
|
156
154
|
}
|
|
157
155
|
}
|
|
158
156
|
|
|
159
|
-
return
|
|
157
|
+
return new Proxy(theme, {
|
|
160
158
|
has(_, key) {
|
|
161
159
|
if (Reflect.has(theme, key)) {
|
|
162
160
|
return true
|
|
@@ -167,10 +165,6 @@ export function getThemeProxied(
|
|
|
167
165
|
}
|
|
168
166
|
},
|
|
169
167
|
get(_, key) {
|
|
170
|
-
if (key === GetThemeUnwrapped) {
|
|
171
|
-
return theme
|
|
172
|
-
}
|
|
173
|
-
|
|
174
168
|
if (
|
|
175
169
|
// dont ask me, idk why but on hermes you can see that useTheme()[undefined] passes in STRING undefined to proxy
|
|
176
170
|
// if someone is crazy enough to use "undefined" as a theme key then this not working is on them
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStylesAndRemoveNullishValues.d.ts","sourceRoot":"","sources":["../../src/helpers/expandStylesAndRemoveNullishValues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"expandStylesAndRemoveNullishValues.d.ts","sourceRoot":"","sources":["../../src/helpers/expandStylesAndRemoveNullishValues.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AAEH,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,gBAAgB,UAAQ,uBAwBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExpandedShorthands.d.ts","sourceRoot":"","sources":["../../src/helpers/getExpandedShorthands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,KAAK,EAAE,CAAC,GACP,IAAI,CAAC,CAAC,EAAE,MAAM,UAAU,CAAC,CAS3B"}
|
|
1
|
+
{"version":3,"file":"getExpandedShorthands.d.ts","sourceRoot":"","sources":["../../src/helpers/getExpandedShorthands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,KAAK,EAAE,CAAC,GACP,IAAI,CAAC,CAAC,EAAE,MAAM,UAAU,CAAC,CAS3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVariantExtras.d.ts","sourceRoot":"","sources":["../../src/helpers/getVariantExtras.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"getVariantExtras.d.ts","sourceRoot":"","sources":["../../src/helpers/getVariantExtras.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,aAAa,OAqCzD;AAID,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,mBAAmB,OAkBrF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { GenericVariantDefinitions } from '../types';
|
|
2
|
-
export declare const mergeVariants: (parentVariants: GenericVariantDefinitions, ourVariants: GenericVariantDefinitions) => {};
|
|
2
|
+
export declare const mergeVariants: (parentVariants: GenericVariantDefinitions, ourVariants: GenericVariantDefinitions, level?: number) => {};
|
|
3
3
|
//# sourceMappingURL=mergeVariants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeVariants.d.ts","sourceRoot":"","sources":["../../src/helpers/mergeVariants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAKzD,eAAO,MAAM,aAAa,mBACR,yBAAyB,eAC5B,yBAAyB,
|
|
1
|
+
{"version":3,"file":"mergeVariants.d.ts","sourceRoot":"","sources":["../../src/helpers/mergeVariants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAA;AAKzD,eAAO,MAAM,aAAa,mBACR,yBAAyB,eAC5B,yBAAyB,uBAgCvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeColor.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizeColor.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAEnD,eAAO,MAAM,cAAc,WAAY,MAAM,GAAG,IAAI,YAAY,MAAM,uBAqBrE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/propMapper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EAEjB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAOjB,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"propMapper.d.ts","sourceRoot":"","sources":["../../src/helpers/propMapper.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EAEjB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAOjB,eAAO,MAAM,UAAU,EAAE,UAyFxB,CAAA;AAgGD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,sBAkBtF;AAMD,eAAO,MAAM,uBAAuB,cAAe,GAAG,QAErD,CAAA;AA6ID,eAAO,MAAM,cAAc,QACpB,MAAM,SACJ,MAAM,wDAED,QAAQ,aAAa,CAAC,QAiGnC,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DedupedThemes, ThemeParsed } from '../types';
|
|
2
|
-
export declare const themesRaw: Record<string, ThemeParsed>;
|
|
3
2
|
export declare function proxyThemesToParents(dedupedThemes: DedupedThemes): Record<string, ThemeParsed>;
|
|
4
3
|
export declare function proxyThemeToParents(themeName: string, theme: ThemeParsed): ThemeParsed;
|
|
5
4
|
//# sourceMappingURL=proxyThemeToParents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxyThemeToParents.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeToParents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxyThemeToParents.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeToParents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAMrD,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,GAC3B,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAsB7B;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,eAqCxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxyThemeVariables.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeVariables.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxyThemeVariables.d.ts","sourceRoot":"","sources":["../../src/helpers/proxyThemeVariables.tsx"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAS/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/helpers/themes.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/helpers/themes.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,QAkB1D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { ComponentContextI } from '../types';
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function getDisableSSR(componentContext: ComponentContextI): boolean | undefined;
|
|
2
|
+
export declare function getDisableSSR(componentContext?: ComponentContextI): boolean | undefined;
|
|
4
3
|
//# sourceMappingURL=useDisableSSR.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDisableSSR.d.ts","sourceRoot":"","sources":["../../src/hooks/useDisableSSR.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDisableSSR.d.ts","sourceRoot":"","sources":["../../src/hooks/useDisableSSR.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAE5C,wBAAgB,aAAa,CAAC,gBAAgB,CAAC,EAAE,iBAAiB,uBAEjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/useMedia.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMedia.d.ts","sourceRoot":"","sources":["../../src/hooks/useMedia.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACd,MAAM,UAAU,CAAA;AAGjB,eAAO,IAAI,UAAU,EAAE,eAmBN,CAAA;AAEjB,eAAO,MAAM,gBAAgB,EAAE,YAAiB,CAAA;AAEhD,eAAO,MAAM,QAAQ,uBAAmB,CAAA;AAExC,eAAO,MAAM,SAAS,aAAoB,CAAA;AAE1C,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,WAQxC,CAAA;AAUD,eAAO,MAAM,qBAAqB,QAAS,MAAM,WAchD,CAAA;AAMD,eAAO,MAAM,cAAc,WAAY,qBAAqB,SAiB3D,CAAA;AAaD,wBAAgB,mBAAmB,SAiClC;AAsBD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,aAAa,EAAE,CAAA;CACtB,CAAA;AAID,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,6BAEhE;AAYD,wBAAgB,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,gBAAgB,CAAC,EAAE,iBAAiB,GAAG,aAAa,CAgDvF;AAED,eAAO,MAAM,iCAAiC,aAClC,MAAM,OACX,MAAM,mBACM,OAAO,MAAM,EAAE,MAAM,CAAC,eAC1B,OAAO,kBAQrB,CAAA;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,GAAG,EACV,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,WAAW,EAAE,OAAO,EACpB,cAAc,CAAC,EAAE,MAAM,WAiBxB;AASD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,EAAE,GAAG,CAAC,EAAE,MAAM,UAwBjF;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,UAE1C;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,WAY9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAe,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/hooks/useTheme.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAe,MAAM,mBAAmB,CAAA;AAEzD,OAAO,EACL,YAAY,EACZ,iBAAiB,EAElB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,WAAW,EACX,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAEjB,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,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const createChainedWeakCache = () => {
|
|
2
|
-
const baseMap = new WeakMap()
|
|
3
|
-
|
|
4
|
-
return {
|
|
5
|
-
get: (args: any[]) => {
|
|
6
|
-
let cur = baseMap
|
|
7
|
-
for (let arg of args) {
|
|
8
|
-
if (cur.has(arg)) {
|
|
9
|
-
cur = cur.get(arg)
|
|
10
|
-
} else {
|
|
11
|
-
return
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return cur
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
set(args: any[], result: any) {
|
|
18
|
-
const len = args.length
|
|
19
|
-
let cur = baseMap
|
|
20
|
-
|
|
21
|
-
for (let i = 0; i < len; i++) {
|
|
22
|
-
const arg = args[i]
|
|
23
|
-
const isLast = i === len - 1
|
|
24
|
-
|
|
25
|
-
if (isLast) {
|
|
26
|
-
cur!.set(arg, result)
|
|
27
|
-
} else {
|
|
28
|
-
if (cur.has(arg)) {
|
|
29
|
-
cur = cur.get(arg)
|
|
30
|
-
} else {
|
|
31
|
-
const next = new WeakMap()
|
|
32
|
-
cur.set(arg, next)
|
|
33
|
-
cur = next
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function createProxy<A extends object>(target: A, handler: ProxyHandler<A>) {
|
|
2
|
-
if (process.env.NODE_ENV === 'development') {
|
|
3
|
-
if (typeof target !== 'object' || !target) {
|
|
4
|
-
console.warn(
|
|
5
|
-
'Invalid object given for proxy:',
|
|
6
|
-
target,
|
|
7
|
-
`
|
|
8
|
-
|
|
9
|
-
This can be due to a missing theme or configuration given to Tamagui.`,
|
|
10
|
-
new Error().stack
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return new Proxy(target || {}, handler)
|
|
15
|
-
}
|
package/src/hooks/useId.tsx
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useId } from 'react'
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// only for debugging if a useMemo is working
|
|
2
|
-
|
|
3
|
-
import { useMemo } from 'react'
|
|
4
|
-
|
|
5
|
-
export const useMemoDebug: typeof useMemo = (fn, args) => {
|
|
6
|
-
let run = 1
|
|
7
|
-
|
|
8
|
-
const res = useMemo(() => {
|
|
9
|
-
run = 0
|
|
10
|
-
return fn()
|
|
11
|
-
}, args)
|
|
12
|
-
|
|
13
|
-
if (run === 1) {
|
|
14
|
-
console.info('saved a run')
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return res
|
|
18
|
-
}
|