@tamagui/web 1.46.2 → 1.47.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/constants/constants.js +15 -15
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/createComponent.js +82 -106
- package/dist/cjs/createComponent.js.map +1 -1
- package/dist/cjs/createTamagui.js +0 -1
- package/dist/cjs/createTamagui.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.js +6 -5
- package/dist/cjs/helpers/ThemeManager.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.js +78 -98
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.js +7 -7
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +2 -10
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.js +6 -14
- package/dist/cjs/helpers/mergeProps.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.js +2 -1
- package/dist/cjs/helpers/normalizeColor.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.js +5 -56
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/cjs/helpers/{createPropMapper.js → propMapper.js} +64 -139
- package/dist/cjs/helpers/propMapper.js.map +6 -0
- package/dist/cjs/helpers/pseudoDescriptors.js +0 -1
- package/dist/cjs/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/cjs/helpers/useShallowSetState.js +9 -17
- package/dist/cjs/helpers/useShallowSetState.js.map +1 -1
- package/dist/cjs/helpers/withStaticProperties.js +9 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/hooks/useMedia.js +7 -9
- package/dist/cjs/hooks/useMedia.js.map +1 -1
- package/dist/cjs/hooks/useStyle.js +5 -2
- package/dist/cjs/hooks/useStyle.js.map +1 -1
- package/dist/cjs/hooks/useTheme.js +28 -32
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/views/Stack.js +1 -4
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/Theme.js +2 -2
- package/dist/cjs/views/Theme.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.js +2 -2
- package/dist/cjs/views/ThemeDebug.js.map +1 -1
- package/dist/esm/constants/constants.js +14 -13
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/createComponent.js +82 -106
- package/dist/esm/createComponent.js.map +1 -1
- package/dist/esm/createTamagui.js +0 -1
- package/dist/esm/createTamagui.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.js +6 -5
- package/dist/esm/helpers/ThemeManager.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +77 -97
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +7 -7
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js +2 -10
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +6 -14
- package/dist/esm/helpers/mergeProps.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.js +2 -1
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js +5 -56
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/esm/helpers/{createPropMapper.js → propMapper.js} +57 -132
- package/dist/esm/helpers/propMapper.js.map +6 -0
- package/dist/esm/helpers/pseudoDescriptors.js +0 -1
- package/dist/esm/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/esm/helpers/useShallowSetState.js +9 -17
- package/dist/esm/helpers/useShallowSetState.js.map +1 -1
- package/dist/esm/helpers/withStaticProperties.js +9 -0
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +8 -10
- package/dist/esm/hooks/useMedia.js.map +1 -1
- package/dist/esm/hooks/useStyle.js +5 -2
- package/dist/esm/hooks/useStyle.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +28 -32
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/views/Stack.js +1 -4
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/Theme.js +2 -2
- package/dist/esm/views/Theme.js.map +1 -1
- package/dist/esm/views/ThemeDebug.js +2 -2
- package/dist/esm/views/ThemeDebug.js.map +1 -1
- package/package.json +9 -9
- package/src/constants/constants.ts +15 -11
- package/src/createComponent.tsx +142 -140
- package/src/createTamagui.ts +0 -1
- package/src/helpers/ThemeManager.tsx +10 -6
- package/src/helpers/getSplitStyles.tsx +144 -173
- package/src/helpers/getStylesAtomic.ts +7 -7
- package/src/helpers/getVariantExtras.tsx +15 -31
- package/src/helpers/isTamaguiComponent.tsx +3 -3
- package/src/helpers/mergeProps.ts +5 -20
- package/src/helpers/normalizeColor.ts +2 -1
- package/src/helpers/normalizeValueWithProperty.ts +8 -64
- package/src/helpers/{createPropMapper.ts → propMapper.ts} +72 -164
- package/src/helpers/pseudoDescriptors.ts +0 -1
- package/src/helpers/useShallowSetState.tsx +10 -16
- package/src/helpers/withStaticProperties.tsx +13 -0
- package/src/hooks/useMedia.tsx +15 -10
- package/src/hooks/useStyle.tsx +7 -4
- package/src/hooks/useTheme.tsx +36 -47
- package/src/index.ts +1 -1
- package/src/types.tsx +20 -33
- package/src/views/Stack.tsx +1 -4
- package/src/views/Theme.tsx +3 -3
- package/src/views/ThemeDebug.tsx +2 -2
- package/types/constants/constants.d.ts +0 -15
- package/types/constants/constants.d.ts.map +1 -1
- package/types/createComponent.d.ts +5 -8
- package/types/createComponent.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/ThemeManager.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +3 -7
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getVariantExtras.d.ts +1 -1
- package/types/helpers/getVariantExtras.d.ts.map +1 -1
- package/types/helpers/isTamaguiComponent.d.ts.map +1 -1
- package/types/helpers/mergeProps.d.ts +1 -1
- package/types/helpers/mergeProps.d.ts.map +1 -1
- package/types/helpers/normalizeColor.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/{createPropMapper.d.ts → propMapper.d.ts} +3 -3
- package/types/helpers/propMapper.d.ts.map +1 -0
- package/types/helpers/pseudoDescriptors.d.ts.map +1 -1
- package/types/helpers/useShallowSetState.d.ts.map +1 -1
- package/types/helpers/withStaticProperties.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +2 -2
- package/types/hooks/useStyle.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +7 -13
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/styled.d.ts +1 -1
- package/types/types.d.ts +17 -25
- package/types/types.d.ts.map +1 -1
- package/types/views/Stack.d.ts.map +1 -1
- package/dist/cjs/helpers/createPropMapper.js.map +0 -6
- package/dist/cjs/helpers/parseStaticConfig.js +0 -40
- package/dist/cjs/helpers/parseStaticConfig.js.map +0 -6
- package/dist/cjs/helpers/swapFontFaceOnWeight.js +0 -63
- package/dist/cjs/helpers/swapFontFaceOnWeight.js.map +0 -6
- package/dist/cjs/hooks/useSafeRef.js +0 -59
- package/dist/cjs/hooks/useSafeRef.js.map +0 -6
- package/dist/cjs/hooks/useServerHooks.js +0 -36
- package/dist/cjs/hooks/useServerHooks.js.map +0 -6
- package/dist/esm/helpers/createPropMapper.js.map +0 -6
- package/dist/esm/helpers/parseStaticConfig.js +0 -16
- package/dist/esm/helpers/parseStaticConfig.js.map +0 -6
- package/dist/esm/helpers/swapFontFaceOnWeight.js +0 -39
- package/dist/esm/helpers/swapFontFaceOnWeight.js.map +0 -6
- package/dist/esm/hooks/useSafeRef.js +0 -35
- package/dist/esm/hooks/useSafeRef.js.map +0 -6
- package/dist/esm/hooks/useServerHooks.js +0 -11
- package/dist/esm/hooks/useServerHooks.js.map +0 -6
- package/src/helpers/parseStaticConfig.ts +0 -14
- package/src/hooks/useSafeRef.ts +0 -45
- package/types/helpers/createPropMapper.d.ts.map +0 -1
- package/types/helpers/parseStaticConfig.d.ts +0 -3
- package/types/helpers/parseStaticConfig.d.ts.map +0 -1
- package/types/helpers/swapFontFaceOnWeight.d.ts +0 -4
- package/types/helpers/swapFontFaceOnWeight.d.ts.map +0 -1
- package/types/hooks/useSafeRef.d.ts +0 -4
- package/types/hooks/useSafeRef.d.ts.map +0 -1
- package/types/hooks/useServerHooks.d.ts +0 -4
- package/types/hooks/useServerHooks.d.ts.map +0 -1
package/src/hooks/useMedia.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useIsomorphicLayoutEffect } from '@tamagui/constants'
|
|
2
|
-
import { useMemo, useSyncExternalStore } from 'react'
|
|
2
|
+
import { useMemo, useRef, useSyncExternalStore } from 'react'
|
|
3
3
|
|
|
4
4
|
import { getConfig } from '../config'
|
|
5
5
|
import { createProxy } from '../helpers/createProxy'
|
|
@@ -12,7 +12,6 @@ import type {
|
|
|
12
12
|
MediaQueryState,
|
|
13
13
|
TamaguiInternalConfig,
|
|
14
14
|
} from '../types'
|
|
15
|
-
import { useSafeRef } from './useSafeRef'
|
|
16
15
|
|
|
17
16
|
export let mediaState: MediaQueryState =
|
|
18
17
|
// development only safeguard
|
|
@@ -36,10 +35,14 @@ export let mediaState: MediaQueryState =
|
|
|
36
35
|
: ({} as any)
|
|
37
36
|
|
|
38
37
|
export const mediaQueryConfig: MediaQueries = {}
|
|
38
|
+
|
|
39
39
|
export const getMedia = () => mediaState
|
|
40
|
+
|
|
40
41
|
export const mediaKeys = new Set<string>() // with $ prefix
|
|
42
|
+
|
|
41
43
|
export const isMediaKey = (key: string) =>
|
|
42
|
-
mediaKeys.has(key) ||
|
|
44
|
+
mediaKeys.has(key) ||
|
|
45
|
+
(key[0] === '$' && (key.startsWith('$platform-') || key.startsWith('$theme-')))
|
|
43
46
|
|
|
44
47
|
// for SSR capture it at time of startup
|
|
45
48
|
let initState: MediaQueryState
|
|
@@ -179,18 +182,19 @@ function subscribe(subscriber: any) {
|
|
|
179
182
|
}
|
|
180
183
|
|
|
181
184
|
export function useMedia(uid?: any, debug?: any): UseMediaState {
|
|
182
|
-
const internal =
|
|
183
|
-
|
|
184
|
-
internal.current = {
|
|
185
|
-
prev: initState,
|
|
186
|
-
}
|
|
187
|
-
}
|
|
185
|
+
const internal = useRef<UseMediaInternalState | undefined>()
|
|
186
|
+
|
|
188
187
|
const state = useSyncExternalStore<MediaQueryState>(
|
|
189
188
|
subscribe,
|
|
190
189
|
() => {
|
|
190
|
+
if (!internal.current) {
|
|
191
|
+
return initState
|
|
192
|
+
}
|
|
193
|
+
|
|
191
194
|
const { touched, prev } = internal.current
|
|
192
195
|
const componentState = uid ? shouldUpdate.get(uid) : undefined
|
|
193
|
-
|
|
196
|
+
|
|
197
|
+
if (!componentState?.enabled === false) {
|
|
194
198
|
return prev
|
|
195
199
|
}
|
|
196
200
|
|
|
@@ -215,6 +219,7 @@ export function useMedia(uid?: any, debug?: any): UseMediaState {
|
|
|
215
219
|
return new Proxy(state, {
|
|
216
220
|
get(_, key) {
|
|
217
221
|
if (typeof key === 'string') {
|
|
222
|
+
internal.current ||= { prev: initState }
|
|
218
223
|
internal.current.touched ||= new Set()
|
|
219
224
|
internal.current.touched.add(key)
|
|
220
225
|
}
|
package/src/hooks/useStyle.tsx
CHANGED
|
@@ -3,11 +3,12 @@ import { useContext } from 'react'
|
|
|
3
3
|
|
|
4
4
|
import { FontLanguageContext } from '../contexts/FontLanguageContext'
|
|
5
5
|
import { TextAncestorContext } from '../contexts/TextAncestorContext'
|
|
6
|
+
import { defaultComponentState } from '../createComponent'
|
|
6
7
|
import { useSplitStyles } from '../helpers/getSplitStyles'
|
|
7
8
|
import {
|
|
8
9
|
DebugProp,
|
|
9
10
|
GetProps,
|
|
10
|
-
|
|
11
|
+
SplitStyleProps,
|
|
11
12
|
TamaguiComponent,
|
|
12
13
|
TextNonStyleProps,
|
|
13
14
|
} from '../types'
|
|
@@ -20,17 +21,19 @@ export function useStyle<
|
|
|
20
21
|
>(
|
|
21
22
|
base: Component,
|
|
22
23
|
style: StyleProps,
|
|
23
|
-
options?: Partial<
|
|
24
|
+
options?: Partial<SplitStyleProps> & { debug?: DebugProp }
|
|
24
25
|
) {
|
|
25
26
|
const isText = base.staticConfig.isText
|
|
26
27
|
const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false)
|
|
27
28
|
const languageContext = useContext(FontLanguageContext)
|
|
28
|
-
const themeState = useThemeWithState({})
|
|
29
|
+
const [themeState] = useThemeWithState({})
|
|
29
30
|
const media = useMedia()
|
|
30
31
|
const out = useSplitStyles(
|
|
31
32
|
style as any,
|
|
32
33
|
base.staticConfig,
|
|
33
|
-
themeState!,
|
|
34
|
+
themeState.state.theme!,
|
|
35
|
+
themeState.state.name,
|
|
36
|
+
defaultComponentState,
|
|
34
37
|
{
|
|
35
38
|
...(options as any),
|
|
36
39
|
mediaState: media,
|
package/src/hooks/useTheme.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import { isClient, isServer, isWeb } from '@tamagui/constants'
|
|
|
3
3
|
import { useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
|
|
4
4
|
|
|
5
5
|
import { getConfig } from '../config'
|
|
6
|
-
import { isDevTools } from '../constants/isDevTools'
|
|
7
6
|
import { getVariable } from '../createVariable'
|
|
8
7
|
import { createProxy } from '../helpers/createProxy'
|
|
9
8
|
import {
|
|
@@ -13,17 +12,9 @@ import {
|
|
|
13
12
|
} from '../helpers/ThemeManager'
|
|
14
13
|
import { ThemeManagerContext } from '../helpers/ThemeManagerContext'
|
|
15
14
|
import type { ThemeParsed, ThemeProps } from '../types'
|
|
16
|
-
import { GetThemeUnwrapped } from './getThemeUnwrapped'
|
|
15
|
+
import { GetThemeUnwrapped, getThemeUnwrapped } from './getThemeUnwrapped'
|
|
17
16
|
|
|
18
17
|
export type ChangedThemeResponse = {
|
|
19
|
-
isNewTheme: boolean
|
|
20
|
-
themeManager: ThemeManager | null
|
|
21
|
-
name: string
|
|
22
|
-
theme?: ThemeParsed | null
|
|
23
|
-
className?: string
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
type State = {
|
|
27
18
|
state: ThemeManagerState
|
|
28
19
|
themeManager: ThemeManager
|
|
29
20
|
isNewTheme: boolean
|
|
@@ -34,10 +25,8 @@ const emptyProps = { name: null }
|
|
|
34
25
|
|
|
35
26
|
function getDefaultThemeProxied() {
|
|
36
27
|
const config = getConfig()
|
|
37
|
-
const name = Object.keys(config.themes)[0]
|
|
38
28
|
return getThemeProxied({
|
|
39
|
-
theme: config.themes[
|
|
40
|
-
name,
|
|
29
|
+
theme: config.themes[Object.keys(config.themes)[0]],
|
|
41
30
|
})
|
|
42
31
|
}
|
|
43
32
|
|
|
@@ -47,63 +36,61 @@ type UseThemeResult = {
|
|
|
47
36
|
}
|
|
48
37
|
}
|
|
49
38
|
|
|
50
|
-
export const useTheme = (props: ThemeProps = emptyProps)
|
|
51
|
-
|
|
39
|
+
export const useTheme = (props: ThemeProps = emptyProps) => {
|
|
40
|
+
const [_, theme] = useThemeWithState(props)
|
|
41
|
+
const res = theme || getDefaultThemeProxied()
|
|
42
|
+
return res as UseThemeResult
|
|
52
43
|
}
|
|
53
44
|
|
|
54
|
-
export const useThemeWithState = (
|
|
45
|
+
export const useThemeWithState = (
|
|
46
|
+
props: ThemeProps
|
|
47
|
+
): [ChangedThemeResponse, ThemeParsed] => {
|
|
55
48
|
const keys = useRef<string[]>([])
|
|
56
49
|
|
|
57
|
-
const
|
|
50
|
+
const changedThemeState = useChangeThemeEffect(
|
|
58
51
|
props,
|
|
59
52
|
false,
|
|
60
53
|
keys.current,
|
|
61
|
-
|
|
54
|
+
!isServer
|
|
62
55
|
? () => {
|
|
63
56
|
return props.shouldUpdate?.() ?? (keys.current.length > 0 ? true : undefined)
|
|
64
57
|
}
|
|
65
58
|
: undefined
|
|
66
59
|
)
|
|
67
60
|
|
|
68
|
-
const { themeManager,
|
|
69
|
-
|
|
70
|
-
if (!
|
|
71
|
-
|
|
72
|
-
console.warn('No theme found', name, props, themeManager)
|
|
73
|
-
}
|
|
74
|
-
return null
|
|
61
|
+
const { themeManager, state } = changedThemeState
|
|
62
|
+
const { theme, name, className } = state
|
|
63
|
+
if (!theme) {
|
|
64
|
+
throw `❌`
|
|
75
65
|
}
|
|
76
66
|
|
|
77
|
-
const
|
|
78
|
-
return getThemeProxied(
|
|
67
|
+
const themeProxied = useMemo(() => {
|
|
68
|
+
return getThemeProxied(
|
|
69
|
+
{
|
|
70
|
+
theme,
|
|
71
|
+
themeManager,
|
|
72
|
+
},
|
|
73
|
+
keys.current
|
|
74
|
+
)
|
|
79
75
|
}, [theme, name, className, themeManager])
|
|
80
76
|
|
|
81
|
-
const result = {
|
|
82
|
-
...changedTheme,
|
|
83
|
-
theme: proxiedTheme,
|
|
84
|
-
}
|
|
85
|
-
|
|
86
77
|
if (process.env.NODE_ENV === 'development' && props.debug === 'verbose') {
|
|
87
78
|
console.groupCollapsed(' 🔹 useTheme =>', name)
|
|
88
|
-
const logs = { props, changedTheme, ...(isDevTools && { theme }) }
|
|
89
|
-
for (const key in logs) {
|
|
90
|
-
// rome-ignore lint/nursery/noConsoleLog: <explanation>
|
|
91
|
-
console.log(' · ', key, logs[key])
|
|
92
|
-
}
|
|
93
79
|
// rome-ignore lint/nursery/noConsoleLog: <explanation>
|
|
94
|
-
console.log('returning state',
|
|
80
|
+
console.log('returning state', changedThemeState, 'from props', props)
|
|
95
81
|
console.groupEnd()
|
|
96
82
|
}
|
|
97
83
|
|
|
98
|
-
return
|
|
84
|
+
return [changedThemeState, themeProxied]
|
|
99
85
|
}
|
|
100
86
|
|
|
101
87
|
export function getThemeProxied(
|
|
102
88
|
{
|
|
103
89
|
theme,
|
|
104
90
|
themeManager,
|
|
105
|
-
}:
|
|
91
|
+
}: {
|
|
106
92
|
theme: ThemeParsed
|
|
93
|
+
themeManager?: ThemeManager
|
|
107
94
|
},
|
|
108
95
|
keys?: string[]
|
|
109
96
|
): UseThemeResult {
|
|
@@ -122,7 +109,7 @@ export function getThemeProxied(
|
|
|
122
109
|
if (typeof key === 'string' && keys) {
|
|
123
110
|
// auto convert variables to plain
|
|
124
111
|
const keyString = key[0] === '$' ? key.slice(1) : key
|
|
125
|
-
const val = themeManager
|
|
112
|
+
const val = themeManager?.getValue(keyString)
|
|
126
113
|
if (val && typeof val === 'object') {
|
|
127
114
|
return new Proxy(val as any, {
|
|
128
115
|
// when they touch the actual value we only track it
|
|
@@ -169,12 +156,12 @@ export const useChangeThemeEffect = (
|
|
|
169
156
|
if (!parentManager) throw `❌`
|
|
170
157
|
return {
|
|
171
158
|
isNewTheme: false,
|
|
172
|
-
|
|
159
|
+
state: parentManager.state,
|
|
173
160
|
themeManager: parentManager,
|
|
174
161
|
}
|
|
175
162
|
}
|
|
176
163
|
|
|
177
|
-
const [themeState, setThemeState] = useState<
|
|
164
|
+
const [themeState, setThemeState] = useState<ChangedThemeResponse>(createState)
|
|
178
165
|
const { state, mounted, isNewTheme, themeManager } = themeState
|
|
179
166
|
const isInversingOnMount = Boolean(!themeState.mounted && props.inverse)
|
|
180
167
|
|
|
@@ -272,19 +259,21 @@ export const useChangeThemeEffect = (
|
|
|
272
259
|
if (!parentManager) throw '❌'
|
|
273
260
|
return {
|
|
274
261
|
isNewTheme: false,
|
|
275
|
-
...parentManager.state,
|
|
276
|
-
className: '',
|
|
277
262
|
themeManager: parentManager,
|
|
263
|
+
state: {
|
|
264
|
+
...parentManager.state,
|
|
265
|
+
className: '',
|
|
266
|
+
},
|
|
278
267
|
}
|
|
279
268
|
}
|
|
280
269
|
|
|
281
270
|
return {
|
|
282
|
-
|
|
271
|
+
state,
|
|
283
272
|
isNewTheme,
|
|
284
273
|
themeManager,
|
|
285
274
|
}
|
|
286
275
|
|
|
287
|
-
function createState(prev?:
|
|
276
|
+
function createState(prev?: ChangedThemeResponse, force = false): ChangedThemeResponse {
|
|
288
277
|
if (prev && shouldUpdate?.() === false) {
|
|
289
278
|
return prev
|
|
290
279
|
}
|
package/src/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './constants/constants'
|
|
|
25
25
|
|
|
26
26
|
export * from './helpers/createStyledContext'
|
|
27
27
|
export * from './helpers/expandStyles'
|
|
28
|
+
export * from './helpers/propMapper'
|
|
28
29
|
export * from './helpers/getAnimationDriver'
|
|
29
30
|
export * from './helpers/getExpandedShorthands'
|
|
30
31
|
export * from './helpers/getSplitStyles'
|
|
@@ -56,7 +57,6 @@ export {
|
|
|
56
57
|
} from './hooks/useMedia'
|
|
57
58
|
export * from './hooks/useTheme'
|
|
58
59
|
export * from './hooks/useThemeName'
|
|
59
|
-
export * from './hooks/useSafeRef'
|
|
60
60
|
export * from './hooks/useStyle'
|
|
61
61
|
export * from './hooks/useAnimationDriver'
|
|
62
62
|
export * from './hooks/useIsTouchDevice'
|
package/src/types.tsx
CHANGED
|
@@ -26,8 +26,8 @@ import type {
|
|
|
26
26
|
} from 'react-native'
|
|
27
27
|
|
|
28
28
|
import type { Variable } from './createVariable'
|
|
29
|
-
import type { ResolveVariableTypes } from './helpers/createPropMapper'
|
|
30
29
|
import { StyledContext } from './helpers/createStyledContext'
|
|
30
|
+
import type { ResolveVariableTypes } from './helpers/propMapper'
|
|
31
31
|
import type { FontLanguageProps, LanguageContextType } from './views/FontLanguage.types'
|
|
32
32
|
import type { ThemeProviderProps } from './views/ThemeProvider'
|
|
33
33
|
|
|
@@ -53,7 +53,7 @@ export type LoadedComponents = {
|
|
|
53
53
|
nameToInfo: Record<
|
|
54
54
|
string,
|
|
55
55
|
{
|
|
56
|
-
staticConfig:
|
|
56
|
+
staticConfig: StaticConfig
|
|
57
57
|
}
|
|
58
58
|
>
|
|
59
59
|
}
|
|
@@ -1238,7 +1238,7 @@ export type Styleable<Props, Ref> = <
|
|
|
1238
1238
|
>(
|
|
1239
1239
|
a: X
|
|
1240
1240
|
) => ReactComponentWithRef<CustomProps & Omit<Props, keyof CustomProps>, Ref> & {
|
|
1241
|
-
staticConfig:
|
|
1241
|
+
staticConfig: StaticConfig
|
|
1242
1242
|
styleable: Styleable<Props, Ref>
|
|
1243
1243
|
}
|
|
1244
1244
|
|
|
@@ -1256,7 +1256,7 @@ export type TamaguiComponent<
|
|
|
1256
1256
|
}
|
|
1257
1257
|
|
|
1258
1258
|
type StaticComponentObject<Props, Ref> = {
|
|
1259
|
-
staticConfig:
|
|
1259
|
+
staticConfig: StaticConfig
|
|
1260
1260
|
|
|
1261
1261
|
/** @deprecated use `styleable` instead (same functionality, better name) */
|
|
1262
1262
|
extractable: <X>(a: X, opts?: Partial<StaticConfig>) => X
|
|
@@ -1279,52 +1279,42 @@ export type TamaguiProviderProps = Partial<Omit<ThemeProviderProps, 'children'>>
|
|
|
1279
1279
|
|
|
1280
1280
|
export type PropMappedValue = [string, any][] | undefined
|
|
1281
1281
|
|
|
1282
|
+
type FlatTransforms = Record<string, any>
|
|
1283
|
+
|
|
1282
1284
|
export type GetStyleState = {
|
|
1283
1285
|
style: TextStyleProps
|
|
1284
1286
|
usedKeys: Record<string, number>
|
|
1285
1287
|
classNames: ClassNamesObject
|
|
1286
|
-
staticConfig:
|
|
1288
|
+
staticConfig: StaticConfig
|
|
1287
1289
|
theme: ThemeParsed
|
|
1288
1290
|
props: Record<string, any>
|
|
1289
1291
|
curProps: Record<string, any>
|
|
1290
1292
|
viewProps: Record<string, any>
|
|
1291
|
-
|
|
1293
|
+
styleProps: SplitStyleProps
|
|
1294
|
+
componentState: TamaguiComponentState
|
|
1292
1295
|
conf: TamaguiInternalConfig
|
|
1293
1296
|
languageContext?: FontLanguageProps
|
|
1294
|
-
avoidDefaultProps?: boolean
|
|
1295
1297
|
avoidMergeTransform?: boolean
|
|
1296
1298
|
fontFamily?: string
|
|
1297
1299
|
debug?: DebugProp
|
|
1300
|
+
transforms?: FlatTransforms
|
|
1298
1301
|
}
|
|
1299
1302
|
|
|
1300
1303
|
export type StyleResolver<Response = PropMappedValue> = (
|
|
1301
1304
|
key: string,
|
|
1302
1305
|
value: any,
|
|
1306
|
+
props: SplitStyleProps,
|
|
1303
1307
|
state: GetStyleState,
|
|
1304
|
-
|
|
1305
|
-
returnVariablesAs: 'auto' | 'value',
|
|
1306
|
-
parentVariantKey: string,
|
|
1307
|
-
avoidDefaultProps?: boolean
|
|
1308
|
+
parentVariantKey: string
|
|
1308
1309
|
) => Response
|
|
1309
1310
|
|
|
1310
1311
|
export type PropMapper = (
|
|
1311
1312
|
key: string,
|
|
1312
1313
|
value: any,
|
|
1313
1314
|
state: GetStyleState,
|
|
1314
|
-
subProps?: Record<string, any
|
|
1315
|
-
avoidDefaultProps?: boolean
|
|
1315
|
+
subProps?: Record<string, any>
|
|
1316
1316
|
) => PropMappedValue
|
|
1317
1317
|
|
|
1318
|
-
export type StaticConfigParsed = StaticConfig & {
|
|
1319
|
-
parsed: true
|
|
1320
|
-
propMapper: PropMapper
|
|
1321
|
-
variantsParsed?: {
|
|
1322
|
-
[key: string]: {
|
|
1323
|
-
[key: string]: any
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
1318
|
export type GenericVariantDefinitions = {
|
|
1329
1319
|
[key: string]: {
|
|
1330
1320
|
[key: string]:
|
|
@@ -1336,6 +1326,8 @@ export type GenericVariantDefinitions = {
|
|
|
1336
1326
|
}
|
|
1337
1327
|
|
|
1338
1328
|
export type StaticConfigPublic = {
|
|
1329
|
+
defaultProps?: Record<string, any>
|
|
1330
|
+
|
|
1339
1331
|
/**
|
|
1340
1332
|
* (compiler) If you need to pass context or something, prevents from ever
|
|
1341
1333
|
* flattening. The 'jsx' option means it will never flatten. if you
|
|
@@ -1407,11 +1399,6 @@ type StaticConfigBase = StaticConfigPublic & {
|
|
|
1407
1399
|
*/
|
|
1408
1400
|
componentName?: string
|
|
1409
1401
|
|
|
1410
|
-
/**
|
|
1411
|
-
* Same as React.defaultProps, be sure to sync
|
|
1412
|
-
*/
|
|
1413
|
-
defaultProps: Record<string, any>
|
|
1414
|
-
|
|
1415
1402
|
/**
|
|
1416
1403
|
* Merges into defaultProps later on, used internally yonly
|
|
1417
1404
|
*/
|
|
@@ -1884,13 +1871,12 @@ export type TamaguiComponentState = {
|
|
|
1884
1871
|
}
|
|
1885
1872
|
}
|
|
1886
1873
|
|
|
1887
|
-
export type
|
|
1874
|
+
export type SplitStyleProps = {
|
|
1888
1875
|
mediaState?: Record<string, boolean>
|
|
1889
1876
|
noClassNames?: boolean
|
|
1890
1877
|
resolveVariablesAs?: ResolveVariableTypes
|
|
1891
1878
|
fallbackProps?: Record<string, any>
|
|
1892
1879
|
hasTextAncestor?: boolean
|
|
1893
|
-
|
|
1894
1880
|
// for animations
|
|
1895
1881
|
isAnimated: boolean
|
|
1896
1882
|
isExiting?: boolean
|
|
@@ -1953,7 +1939,7 @@ export type UniversalAnimatedNumber<A> = {
|
|
|
1953
1939
|
export type AnimationDriver<A extends AnimationConfig = AnimationConfig> = {
|
|
1954
1940
|
isReactNative?: boolean
|
|
1955
1941
|
keepStyleSSR?: boolean
|
|
1956
|
-
|
|
1942
|
+
supportsCSSVars?: boolean
|
|
1957
1943
|
useAnimations: UseAnimationHook
|
|
1958
1944
|
usePresence: () => UsePresenceResult
|
|
1959
1945
|
useAnimatedNumber: (initial: number) => UniversalAnimatedNumber<any>
|
|
@@ -1980,8 +1966,9 @@ export type UseAnimationHook = (props: {
|
|
|
1980
1966
|
props: Record<string, any>
|
|
1981
1967
|
presence?: UsePresenceResult | null
|
|
1982
1968
|
hostRef: RefObject<HTMLElement | View>
|
|
1983
|
-
staticConfig:
|
|
1984
|
-
|
|
1969
|
+
staticConfig: StaticConfig
|
|
1970
|
+
styleProps: SplitStyleProps
|
|
1971
|
+
componentState: TamaguiComponentState
|
|
1985
1972
|
theme: ThemeParsed
|
|
1986
1973
|
pseudos: PseudoProps<ViewStyle> | null
|
|
1987
1974
|
onDidAnimate?: any
|
package/src/views/Stack.tsx
CHANGED
|
@@ -8,10 +8,7 @@ export type Stack = TamaguiElement
|
|
|
8
8
|
|
|
9
9
|
export const Stack = createComponent<StackProps, Stack, StackPropsBase>({
|
|
10
10
|
acceptsClassName: true,
|
|
11
|
-
defaultProps:
|
|
12
|
-
...stackDefaultStyles,
|
|
13
|
-
flexDirection: 'column',
|
|
14
|
-
},
|
|
11
|
+
defaultProps: stackDefaultStyles,
|
|
15
12
|
validStyles,
|
|
16
13
|
})
|
|
17
14
|
|
package/src/views/Theme.tsx
CHANGED
|
@@ -125,8 +125,8 @@ export function wrapThemeElements({
|
|
|
125
125
|
|
|
126
126
|
// in order to provide currentColor, set color by default
|
|
127
127
|
const themeColor =
|
|
128
|
-
themeState.theme && themeState.isNewTheme
|
|
129
|
-
? variableToString(themeState.theme.color)
|
|
128
|
+
themeState.state.theme && themeState.isNewTheme
|
|
129
|
+
? variableToString(themeState.state.theme.color)
|
|
130
130
|
: ''
|
|
131
131
|
const colorStyle = themeColor
|
|
132
132
|
? {
|
|
@@ -137,7 +137,7 @@ export function wrapThemeElements({
|
|
|
137
137
|
const parentScheme = themeState.themeManager?.parentManager?.scheme
|
|
138
138
|
const scheme = themeState.themeManager?.scheme
|
|
139
139
|
const isInversing = scheme && parentScheme && scheme !== parentScheme
|
|
140
|
-
const className = themeState.className || ''
|
|
140
|
+
const className = themeState.state.className || ''
|
|
141
141
|
|
|
142
142
|
let themedChildren = (
|
|
143
143
|
<span className={`${className} _dsp_contents is_Theme`} style={colorStyle}>
|
package/src/views/ThemeDebug.tsx
CHANGED
|
@@ -71,8 +71,8 @@ export function ThemeDebug({
|
|
|
71
71
|
<Theme {id} />
|
|
72
72
|
{JSON.stringify(
|
|
73
73
|
{
|
|
74
|
-
name: themeState.name,
|
|
75
|
-
className: themeState.className,
|
|
74
|
+
name: themeState.state.name,
|
|
75
|
+
className: themeState.state.className,
|
|
76
76
|
inverse: themeProps.inverse,
|
|
77
77
|
forceClassName: themeProps.forceClassName,
|
|
78
78
|
parent: themeState.themeManager?.state.parentName,
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
export declare const THEME_NAME_SEPARATOR = "_";
|
|
2
2
|
export declare const THEME_CLASSNAME_PREFIX = "t_";
|
|
3
|
-
export declare const webOnlyDefaultStyles: {
|
|
4
|
-
display: string;
|
|
5
|
-
flexBasis: string;
|
|
6
|
-
boxSizing: string;
|
|
7
|
-
position: string;
|
|
8
|
-
minHeight: number;
|
|
9
|
-
minWidth: number;
|
|
10
|
-
};
|
|
11
3
|
export declare const stackDefaultStyles: {
|
|
12
|
-
display: string;
|
|
13
|
-
flexBasis: string;
|
|
14
|
-
boxSizing: string;
|
|
15
|
-
position: string;
|
|
16
|
-
minHeight: number;
|
|
17
|
-
minWidth: number;
|
|
18
4
|
alignItems: string;
|
|
19
|
-
flexShrink: number;
|
|
20
5
|
};
|
|
21
6
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,MAAM,CAAA;AACvC,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAE1C,eAAO,MAAM,kBAAkB;;CAE9B,CAAA"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DebugProp, SpaceDirection, SpaceValue, SpacerProps, StaticConfig,
|
|
2
|
+
import { DebugProp, SpaceDirection, SpaceValue, SpacerProps, StaticConfig, TamaguiComponent, TamaguiComponentState, TamaguiElement } from './types';
|
|
3
3
|
export declare const defaultComponentState: TamaguiComponentState;
|
|
4
4
|
export declare const mouseUps: Set<Function>;
|
|
5
|
-
export declare function createComponent<ComponentPropTypes extends Object = {}, Ref = TamaguiElement, BaseProps = never>(
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}): any;
|
|
10
|
-
isUnspaced: boolean;
|
|
11
|
-
};
|
|
5
|
+
export declare function createComponent<ComponentPropTypes extends Object = {}, Ref = TamaguiElement, BaseProps = never>(staticConfig: StaticConfig): TamaguiComponent<ComponentPropTypes, Ref, BaseProps, {}>;
|
|
6
|
+
export declare function Unspaced(props: {
|
|
7
|
+
children?: any;
|
|
8
|
+
}): any;
|
|
12
9
|
export declare const Spacer: TamaguiComponent<SpacerProps, TamaguiElement, never, {}>;
|
|
13
10
|
export type SpacedChildrenProps = {
|
|
14
11
|
isZStack?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["../src/createComponent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAWN,MAAM,OAAO,CAAA;AAgBd,OAAO,EACL,SAAS,EACT,cAAc,EACd,UAAU,EACV,WAAW,EACX,YAAY,EACZ,gBAAgB,EAEhB,qBAAqB,EACrB,cAAc,EAIf,MAAM,SAAS,CAAA;AAUhB,eAAO,MAAM,qBAAqB,EAAE,qBAMnC,CAAA;AAwBD,eAAO,MAAM,QAAQ,eAAsB,CAAA;AAqB3C,wBAAgB,eAAe,CAC7B,kBAAkB,SAAS,MAAM,GAAG,EAAE,EACtC,GAAG,GAAG,cAAc,EACpB,SAAS,GAAG,KAAK,EACjB,YAAY,EAAE,YAAY,4DA+1B3B;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAA;CAAE,OAEjD;AAMD,eAAO,MAAM,MAAM,0DA8CjB,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,mBAkGxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,kBAAkB,EAElB,kBAAkB,EAGnB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"createTamagui.d.ts","sourceRoot":"","sources":["../src/createTamagui.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,kBAAkB,EAElB,kBAAkB,EAGnB,MAAM,SAAS,CAAA;AAKhB,wBAAgB,aAAa,CAAC,IAAI,SAAS,kBAAkB,EAC3D,QAAQ,EAAE,IAAI,GACb,kBAAkB,CAAC,IAAI,CAAC,CA4S1B"}
|
|
@@ -14,7 +14,7 @@ export type ThemeManagerState = {
|
|
|
14
14
|
parentName?: string;
|
|
15
15
|
componentName?: string;
|
|
16
16
|
};
|
|
17
|
-
export declare function getHasThemeUpdatingProps(props: ThemeProps):
|
|
17
|
+
export declare function getHasThemeUpdatingProps(props: ThemeProps): boolean;
|
|
18
18
|
export declare class ThemeManager {
|
|
19
19
|
props: ThemeProps;
|
|
20
20
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../../src/helpers/ThemeManager.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAElD,KAAK,aAAa,GAAG,CACnB,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,OAAO,KACZ,IAAI,CAAA;AAET,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAID,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"ThemeManager.d.ts","sourceRoot":"","sources":["../../src/helpers/ThemeManager.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAElD,KAAK,aAAa,GAAG,CACnB,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,OAAO,KACZ,IAAI,CAAA;AAET,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAID,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,UAAU,WAEzD;AAID,qBAAa,YAAY;IASd,KAAK,EAAE,UAAU;IAR1B,EAAE,SAAQ;IACV,WAAW,UAAQ;IACnB,cAAc,qBAA2B;IACzC,aAAa,EAAE,YAAY,GAAG,IAAI,CAAO;IACzC,KAAK,EAAE,iBAAiB,CAAa;IACrC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAO;gBAG7B,KAAK,GAAE,UAAe,EAC7B,eAAe,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IA8B5D,WAAW,CACT,KAAK,GAAE,UAAU,GAAG;QAAE,UAAU,CAAC,EAAE,WAAW,CAAA;KAAqB,EACnE,YAAY,UAAO;IAsCrB,iBAAiB,CACf,KAAK,aAAa,EAClB,KAAK,GAAE,iBAAiB,GAAG,IAAiB,EAC5C,aAAa,sBAAqB;IAYpC,oBAAoB,CAClB,SAAS,EAAE,iBAAiB,GAAG,IAAI,EACnC,KAAK,GAAE,iBAAiB,GAAG,IAAiB;IAQ9C,QAAQ,CAAC,KAAK,aAAa,EAAE,aAAa,sBAAqB;IAO/D,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAO;IACnC,IAAI,OAAO,gBAMV;IAGD,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,iBAA8B;IAiB3D,MAAM,CAAC,MAAM,UAAQ;IAIrB,aAAa,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM;CAalD;AAsKD,wBAAgB,4BAA4B,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,4CAe9E"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import type { DebugProp, GetStyleResult, GetStyleState,
|
|
1
|
+
import type { DebugProp, GetStyleResult, GetStyleState, SplitStyleProps, StaticConfig, TamaguiComponentState, TextStyleProps, ThemeParsed } from '../types';
|
|
2
2
|
import type { LanguageContextType } from '../views/FontLanguage.types';
|
|
3
3
|
export type SplitStyles = ReturnType<typeof getSplitStyles>;
|
|
4
4
|
export type SplitStyleResult = ReturnType<typeof getSplitStyles>;
|
|
5
5
|
type StyleSplitter = (props: {
|
|
6
6
|
[key: string]: any;
|
|
7
|
-
}, staticConfig:
|
|
8
|
-
theme: ThemeParsed;
|
|
9
|
-
name: string;
|
|
10
|
-
}, state: SplitStyleState, parentSplitStyles?: GetStyleResult | null, languageContext?: LanguageContextType, elementType?: string, debug?: DebugProp) => GetStyleResult;
|
|
7
|
+
}, staticConfig: StaticConfig, theme: ThemeParsed, themeName: string, componentState: TamaguiComponentState, styleProps: SplitStyleProps, parentSplitStyles?: GetStyleResult | null, languageContext?: LanguageContextType, elementType?: string, debug?: DebugProp) => GetStyleResult;
|
|
11
8
|
export declare const PROP_SPLIT = "-";
|
|
12
9
|
export declare const getSplitStyles: StyleSplitter;
|
|
13
|
-
export declare const getSubStyle: (styleState: GetStyleState, subKey: string, styleIn: Object,
|
|
10
|
+
export declare const getSubStyle: (styleState: GetStyleState, subKey: string, styleIn: Object, avoidMergeTransform?: boolean) => TextStyleProps;
|
|
14
11
|
export declare const useSplitStyles: StyleSplitter;
|
|
15
|
-
export type FlatTransforms = Record<string, any>;
|
|
16
12
|
export {};
|
|
17
13
|
//# sourceMappingURL=getSplitStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAEV,SAAS,EACT,cAAc,EACd,aAAa,EAMb,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"getSplitStyles.d.ts","sourceRoot":"","sources":["../../src/helpers/getSplitStyles.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAEV,SAAS,EACT,cAAc,EACd,aAAa,EAMb,eAAe,EACf,YAAY,EAEZ,qBAAqB,EAErB,cAAc,EACd,WAAW,EAEZ,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAuBtE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAE3D,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;AAMhE,KAAK,aAAa,GAAG,CACnB,KAAK,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC7B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,qBAAqB,EACrC,UAAU,EAAE,eAAe,EAC3B,iBAAiB,CAAC,EAAE,cAAc,GAAG,IAAI,EACzC,eAAe,CAAC,EAAE,mBAAmB,EAErC,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,SAAS,KACd,cAAc,CAAA;AAEnB,eAAO,MAAM,UAAU,MAAM,CAAA;AAuB7B,eAAO,MAAM,cAAc,EAAE,aA4+B5B,CAAA;AAoDD,eAAO,MAAM,WAAW,eACV,aAAa,UACjB,MAAM,WACL,MAAM,wBACO,OAAO,KAC5B,cAuBF,CAAA;AAOD,eAAO,MAAM,cAAc,EAAE,aAQ5B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenericFonts, GetStyleState } from '../types';
|
|
2
2
|
import { LanguageContextType } from '../views/FontLanguage.types';
|
|
3
|
-
export declare function getVariantExtras(styleState: GetStyleState
|
|
3
|
+
export declare function getVariantExtras(styleState: GetStyleState): any;
|
|
4
4
|
export declare function getFontsForLanguage(fonts: GenericFonts, language: LanguageContextType): any;
|
|
5
5
|
//# sourceMappingURL=getVariantExtras.d.ts.map
|
|
@@ -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;AAGjE,wBAAgB,gBAAgB,
|
|
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;AAGjE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,aAAa,OAqCzD;AAID,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,mBAAmB,OAkBrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTamaguiComponent.d.ts","sourceRoot":"","sources":["../../src/helpers/isTamaguiComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"isTamaguiComponent.d.ts","sourceRoot":"","sources":["../../src/helpers/isTamaguiComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEvC,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,IAAI,CAAC,GAAG;IACb,YAAY,EAAE,YAAY,CAAA;CAC3B,CAGA"}
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
* - shorthands can be expanded before merging
|
|
13
13
|
*/
|
|
14
14
|
type AnyRecord = Record<string, any>;
|
|
15
|
-
export declare const mergeProps: (a: Object, b?: Object,
|
|
15
|
+
export declare const mergeProps: (a: Object, b?: Object, inverseShorthands?: AnyRecord) => AnyRecord;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=mergeProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mergeProps.d.ts","sourceRoot":"","sources":["../../src/helpers/mergeProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAEpC,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"mergeProps.d.ts","sourceRoot":"","sources":["../../src/helpers/mergeProps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAEpC,eAAO,MAAM,UAAU,MAAO,MAAM,MAAM,MAAM,sBAAsB,SAAS,cAW9E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeColor.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAA;AAEnD,eAAO,MAAM,IAAI,iBAAW,CAAA;AAC5B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAY,CAAA;AAE9B,eAAO,MAAM,cAAc,WAAY,MAAM,GAAG,IAAI,YAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"normalizeColor.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAA;AAEnD,eAAO,MAAM,IAAI,iBAAW,CAAA;AAC5B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAY,CAAA;AAE9B,eAAO,MAAM,cAAc,WAAY,MAAM,GAAG,IAAI,YAAY,MAAM,uBAmBrE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeValueWithProperty.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeValueWithProperty.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"normalizeValueWithProperty.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeValueWithProperty.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,GAAG,CAY7E;AAKD,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAyCxE"}
|