@tamagui/core 1.0.1-beta.169 → 1.0.1-beta.170

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.
@@ -181,6 +181,11 @@ export function createComponent<
181
181
  const setStateShallow = useShallowSetState(setState)
182
182
 
183
183
  if (process.env.NODE_ENV === 'development') {
184
+ if (!process.env.TAMAGUI_TARGET) {
185
+ // eslint-disable-next-line no-console
186
+ console.error(`No process.env.TAMAGUI_TARGET set, please set it to "native" or "web".`)
187
+ }
188
+
184
189
  if (debugProp) {
185
190
  const name = `${
186
191
  componentName || Component?.displayName || Component?.name || '[Unnamed Component]'
@@ -210,7 +215,14 @@ export function createComponent<
210
215
  }
211
216
  }
212
217
 
213
- const { viewProps: viewPropsIn, pseudos, medias, style, classNames, mediaKeys } = splitStyles
218
+ const {
219
+ viewProps: viewPropsIn,
220
+ pseudos,
221
+ medias,
222
+ style: splitStylesStyle,
223
+ classNames,
224
+ mediaKeys,
225
+ } = splitStyles
214
226
 
215
227
  // media queries
216
228
  useIsomorphicLayoutEffect(() => {
@@ -242,7 +254,9 @@ export function createComponent<
242
254
  // animations
243
255
  const useAnimations = tamaguiConfig?.animations?.useAnimations as UseAnimationHook | undefined
244
256
  const isAnimated = !!(useAnimations && props.animation)
245
- const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...style } : null
257
+ const animationFeatureStylesIn = props.animation
258
+ ? { ...defaultNativeStyle, ...splitStylesStyle }
259
+ : null
246
260
  const propsWithAnimation = props as UseAnimationProps
247
261
 
248
262
  // lets make changing the key mandatory for adding/removing animations
@@ -659,11 +673,11 @@ export function createComponent<
659
673
  if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
660
674
  styles = {
661
675
  ...defaultNativeStyle,
662
- ...(animationStyles ?? style),
676
+ ...(animationStyles ?? splitStylesStyle),
663
677
  ...medias,
664
678
  }
665
679
  } else {
666
- styles = [isWeb ? null : defaultNativeStyle, animationStyles ?? style, medias]
680
+ styles = [isWeb ? null : defaultNativeStyle, animationStyles ?? splitStylesStyle, medias]
667
681
  if (!animationStyles && initialSplitStyles) {
668
682
  const initPseudos = initialSplitStyles.pseudos
669
683
  !state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, 'enterStyle')
@@ -1042,7 +1056,7 @@ export function createComponent<
1042
1056
  if (typeof window !== 'undefined') {
1043
1057
  // prettier-ignore
1044
1058
  // eslint-disable-next-line no-console
1045
- console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) } : null) })
1059
+ console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: props.className?.split(' '), classNamesOut: viewProps.className?.split(' '), events, shouldAttach, styles, pseudos, content, childEls, shouldAvoidClasses, avoidClasses, animation: props.animation, style: splitStylesStyle, defaultNativeStyle, initialSplitStyles, ...(typeof window !== 'undefined' ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) } : null) })
1046
1060
  }
1047
1061
  // eslint-disable-next-line no-console
1048
1062
  console.groupEnd()
@@ -1,5 +1,5 @@
1
1
  import { getConfig } from '../config'
2
- import { GenericFonts, StaticConfig } from '../types'
2
+ import { GenericFonts } from '../types'
3
3
  import { LanguageContextType } from '../views/FontLanguage.types'
4
4
 
5
5
  const extrasCache = new WeakMap()
@@ -17,9 +17,10 @@ export function getVariantExtras(
17
17
  return extrasCache.get(props)
18
18
  }
19
19
 
20
- const fonts = languageContext
21
- ? getFontsForLanguage(conf.fontsParsed, languageContext)
22
- : conf.fontsParsed
20
+ let fonts = conf.fontsParsed
21
+ if (languageContext) {
22
+ fonts = getFontsForLanguage(conf.fontsParsed, languageContext)
23
+ }
23
24
 
24
25
  const next = {
25
26
  fonts,