@tamagui/core 1.0.1-beta.19 → 1.0.1-beta.190
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/Tamagui.js +14 -12
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/addTheme.js +80 -0
- package/dist/cjs/addTheme.js.map +7 -0
- package/dist/cjs/{conf.js → config.js} +33 -19
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/constants.js +11 -23
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/{helpers/nativeGestureHandler.js → constants/isDevTools.js} +8 -8
- package/dist/cjs/constants/isDevTools.js.map +7 -0
- package/dist/cjs/constants/platform.js +32 -16
- package/dist/cjs/constants/platform.js.map +2 -2
- package/dist/cjs/constants/platform.native.js +62 -0
- package/dist/cjs/constants/platform.native.js.map +7 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js +1 -0
- package/dist/cjs/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/cjs/contexts/FontLanguageContext.js +30 -0
- package/dist/cjs/contexts/FontLanguageContext.js.map +7 -0
- package/dist/cjs/{views → contexts}/TextAncestorContext.js +11 -13
- package/dist/cjs/contexts/TextAncestorContext.js.map +7 -0
- package/dist/cjs/{ThemeContext.js → contexts/ThemeContext.js} +1 -0
- package/dist/cjs/contexts/ThemeContext.js.map +7 -0
- package/dist/cjs/createComponent.js +925 -484
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createFont.js +5 -8
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createShorthands.js +1 -2
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createTamagui.js +129 -177
- package/dist/cjs/createTamagui.js.map +3 -3
- package/dist/cjs/createTheme.js +4 -2
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +5 -25
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createVariable.js +52 -28
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariables.js +52 -0
- package/dist/cjs/createVariables.js.map +7 -0
- package/dist/cjs/helpers/RNComponents.js +12 -11
- package/dist/cjs/helpers/RNComponents.js.map +2 -2
- package/dist/cjs/{ThemeManager.js → helpers/ThemeManager.js} +54 -52
- package/dist/cjs/helpers/ThemeManager.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +3 -3
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +188 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +30 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/cjs/helpers/calc.js +71 -0
- package/dist/cjs/helpers/calc.js.map +7 -0
- package/dist/cjs/helpers/createMediaStyle.js +17 -9
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +268 -120
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createShallowUpdate.js +14 -25
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.js +90 -0
- package/dist/cjs/helpers/expandStyle.js.map +7 -0
- package/dist/cjs/helpers/expandStyles.js +115 -0
- package/dist/cjs/helpers/expandStyles.js.map +7 -0
- package/dist/cjs/helpers/extendStaticConfig.js +49 -37
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +3 -3
- package/dist/cjs/helpers/fixNativeShadow.js.map +1 -1
- package/dist/cjs/helpers/getAnimationDriver.js +32 -0
- package/dist/cjs/helpers/getAnimationDriver.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +4 -5
- package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/cjs/helpers/{getTextSize.js → getFont.js} +22 -12
- package/dist/cjs/helpers/getFont.js.map +7 -0
- package/dist/cjs/helpers/getFontLanguage.js +29 -0
- package/dist/cjs/helpers/getFontLanguage.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +19 -10
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +381 -208
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js +46 -0
- package/dist/cjs/helpers/getStackSize.js.map +7 -0
- package/dist/cjs/helpers/getStylesAtomic.js +199 -133
- package/dist/cjs/helpers/getStylesAtomic.js.map +3 -3
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +103 -0
- package/dist/cjs/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/cjs/{nativeGestureHandler.native.js → helpers/getThemeCSSRules.native.js} +18 -5
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/cjs/helpers/getVariantExtras.js +88 -0
- package/dist/cjs/helpers/getVariantExtras.js.map +7 -0
- package/dist/cjs/helpers/insertStyleRule.js +87 -52
- package/dist/cjs/helpers/insertStyleRule.js.map +3 -3
- package/dist/cjs/helpers/isObj.js +2 -2
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +37 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/cjs/helpers/isTamaguiElement.js +5 -5
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +7 -6
- package/dist/cjs/helpers/matchMedia.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.native.js +6 -3
- package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js +54 -0
- package/dist/cjs/helpers/mergeProps.js.map +7 -0
- package/dist/cjs/helpers/mergeTransform.js +42 -0
- package/dist/cjs/helpers/mergeTransform.js.map +7 -0
- package/dist/cjs/helpers/normalizeColor.js +80 -0
- package/dist/cjs/helpers/normalizeColor.js.map +7 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js +93 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +7 -4
- package/dist/cjs/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.js +42 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/cjs/helpers/registerCSSVariable.js +40 -0
- package/dist/cjs/helpers/registerCSSVariable.js.map +7 -0
- package/dist/cjs/helpers/{wrapThemeManagerContext.js → startTransition.js} +12 -15
- package/dist/cjs/helpers/startTransition.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +17 -40
- package/dist/cjs/helpers/themeable.js.map +3 -3
- package/dist/cjs/helpers/themes.js +79 -0
- package/dist/cjs/helpers/themes.js.map +7 -0
- package/dist/cjs/helpers/useShallowSetState.js +44 -0
- package/dist/cjs/helpers/useShallowSetState.js.map +7 -0
- package/dist/cjs/helpers/validate.js +1 -122
- package/dist/cjs/helpers/validate.js.map +3 -3
- package/dist/cjs/helpers/withStaticProperties.js +3 -3
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +39 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +4 -2
- package/dist/cjs/hooks/useConstant.js.map +2 -2
- package/dist/cjs/hooks/useDidFinishSSR.js +60 -0
- package/dist/cjs/hooks/useDidFinishSSR.js.map +7 -0
- package/dist/cjs/hooks/useId.js +3 -33
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +3 -4
- package/dist/cjs/hooks/useIsMounted.js.map +2 -2
- package/dist/cjs/hooks/useIsSSR.js +46 -0
- package/dist/cjs/hooks/useIsSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +11 -9
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +162 -113
- package/dist/cjs/hooks/useMedia.js.map +3 -3
- package/dist/cjs/hooks/usePressable.js +4 -18
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useSafeRef.js +60 -0
- package/dist/cjs/hooks/useSafeRef.js.map +7 -0
- package/dist/cjs/hooks/useServerHooks.js +36 -0
- package/dist/cjs/hooks/useServerHooks.js.map +7 -0
- package/dist/cjs/hooks/useTheme.js +166 -132
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/hooks/useUnmountEffect.js +1 -2
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +59 -21
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/injectStyles.js +40 -0
- package/dist/cjs/injectStyles.js.map +7 -0
- package/dist/cjs/insertFont.js +93 -0
- package/dist/cjs/insertFont.js.map +7 -0
- package/dist/cjs/static.js +22 -15
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +47 -44
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +2 -2
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/updateTheme.js +47 -0
- package/dist/cjs/updateTheme.js.map +7 -0
- package/dist/cjs/vendor/Pressability.js +32 -0
- package/dist/cjs/vendor/Pressability.js.map +7 -0
- package/dist/cjs/vendor/Pressability.native.js +32 -0
- package/dist/cjs/vendor/Pressability.native.js.map +7 -0
- package/dist/cjs/views/FontLanguage.js +38 -0
- package/dist/cjs/views/FontLanguage.js.map +7 -0
- package/dist/cjs/views/FontLanguage.native.js +38 -0
- package/dist/cjs/views/FontLanguage.native.js.map +7 -0
- package/dist/cjs/{helpers/nativeGestureHandler.native.js → views/FontLanguage.types.js} +4 -5
- package/dist/cjs/views/FontLanguage.types.js.map +7 -0
- package/dist/cjs/views/Slot.js +63 -65
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.js +82 -0
- package/dist/cjs/views/TamaguiProvider.js.map +7 -0
- package/dist/cjs/views/Text.js +28 -29
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +43 -21
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeInverse.js +25 -25
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +35 -23
- package/dist/cjs/views/ThemeProvider.js.map +3 -3
- package/dist/cjs/views/ThemeReset.js +18 -12
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Tamagui.js +8 -11
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/addTheme.js +56 -0
- package/dist/esm/addTheme.js.map +7 -0
- package/dist/esm/config.js +45 -0
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/constants.js +2 -2
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/isDevTools.js +5 -0
- package/dist/esm/constants/isDevTools.js.map +7 -0
- package/dist/esm/constants/platform.js +25 -12
- package/dist/esm/constants/platform.js.map +2 -2
- package/dist/esm/constants/platform.native.js +28 -0
- package/dist/esm/constants/platform.native.js.map +7 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js +0 -0
- package/dist/esm/contexts/ButtonInsideButtonContext.js.map +1 -1
- package/dist/esm/contexts/FontLanguageContext.js +6 -0
- package/dist/esm/contexts/FontLanguageContext.js.map +7 -0
- package/dist/esm/contexts/TextAncestorContext.js +17 -0
- package/dist/esm/contexts/TextAncestorContext.js.map +7 -0
- package/dist/esm/{ThemeContext.js → contexts/ThemeContext.js} +0 -0
- package/dist/esm/contexts/ThemeContext.js.map +7 -0
- package/dist/esm/createComponent.js +891 -389
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createFont.js +4 -9
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createShorthands.js +0 -3
- package/dist/esm/createShorthands.js.map +1 -1
- package/dist/esm/createTamagui.js +128 -158
- package/dist/esm/createTamagui.js.map +3 -3
- package/dist/esm/createTheme.js +3 -3
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +3 -24
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createVariable.js +47 -26
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariables.js +28 -0
- package/dist/esm/createVariables.js.map +7 -0
- package/dist/esm/helpers/RNComponents.js +11 -8
- package/dist/esm/helpers/RNComponents.js.map +2 -2
- package/dist/esm/{ThemeManager.js → helpers/ThemeManager.js} +53 -53
- package/dist/esm/helpers/ThemeManager.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +2 -4
- package/dist/esm/helpers/areEqualSets.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.js +164 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +7 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +6 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +7 -0
- package/dist/esm/helpers/calc.js +47 -0
- package/dist/esm/helpers/calc.js.map +7 -0
- package/dist/esm/helpers/createMediaStyle.js +16 -10
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +263 -121
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createShallowUpdate.js +13 -12
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +66 -0
- package/dist/esm/helpers/expandStyle.js.map +7 -0
- package/dist/esm/helpers/expandStyles.js +89 -0
- package/dist/esm/helpers/expandStyles.js.map +7 -0
- package/dist/esm/helpers/extendStaticConfig.js +35 -28
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +2 -4
- package/dist/esm/helpers/fixNativeShadow.js.map +1 -1
- package/dist/esm/helpers/getAnimationDriver.js +8 -0
- package/dist/esm/helpers/getAnimationDriver.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +2 -5
- package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/esm/helpers/{getTextSize.js → getFont.js} +17 -9
- package/dist/esm/helpers/getFont.js.map +7 -0
- package/dist/esm/helpers/getFontLanguage.js +5 -0
- package/dist/esm/helpers/getFontLanguage.js.map +7 -0
- package/dist/esm/helpers/getSize.js +16 -10
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +364 -188
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js +22 -0
- package/dist/esm/helpers/getStackSize.js.map +7 -0
- package/dist/esm/helpers/getStylesAtomic.js +187 -108
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -3
- package/dist/esm/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +79 -0
- package/dist/esm/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/esm/helpers/getThemeCSSRules.native.js +7 -0
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/esm/helpers/getVariantExtras.js +63 -0
- package/dist/esm/helpers/getVariantExtras.js.map +7 -0
- package/dist/esm/helpers/insertStyleRule.js +82 -50
- package/dist/esm/helpers/insertStyleRule.js.map +3 -3
- package/dist/esm/helpers/isObj.js +1 -3
- package/dist/esm/helpers/isObj.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +13 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +7 -0
- package/dist/esm/helpers/isTamaguiElement.js +4 -6
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +6 -7
- package/dist/esm/helpers/matchMedia.js.map +2 -2
- package/dist/esm/helpers/matchMedia.native.js +1 -3
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +30 -0
- package/dist/esm/helpers/mergeProps.js.map +7 -0
- package/dist/esm/helpers/mergeTransform.js +17 -0
- package/dist/esm/helpers/mergeTransform.js.map +7 -0
- package/dist/esm/helpers/normalizeColor.js +49 -0
- package/dist/esm/helpers/normalizeColor.js.map +7 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js +69 -0
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +7 -0
- package/dist/esm/helpers/proxyThemeVariables.js +6 -5
- package/dist/esm/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/esm/helpers/pseudoDescriptors.js +18 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +7 -0
- package/dist/esm/helpers/registerCSSVariable.js +14 -0
- package/dist/esm/helpers/registerCSSVariable.js.map +7 -0
- package/dist/esm/helpers/startTransition.js +6 -0
- package/dist/esm/helpers/startTransition.js.map +7 -0
- package/dist/esm/helpers/themeable.js +11 -9
- package/dist/esm/helpers/themeable.js.map +2 -2
- package/dist/esm/helpers/themes.js +54 -0
- package/dist/esm/helpers/themes.js.map +7 -0
- package/dist/esm/helpers/useShallowSetState.js +20 -0
- package/dist/esm/helpers/useShallowSetState.js.map +7 -0
- package/dist/esm/helpers/validate.js +0 -75
- package/dist/esm/helpers/validate.js.map +3 -3
- package/dist/esm/helpers/withStaticProperties.js +2 -4
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/hooks/getThemeUnwrapped.js +14 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/esm/hooks/useConstant.js +4 -4
- package/dist/esm/hooks/useConstant.js.map +2 -2
- package/dist/esm/hooks/useDidFinishSSR.js +35 -0
- package/dist/esm/hooks/useDidFinishSSR.js.map +7 -0
- package/dist/esm/hooks/useId.js +1 -31
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +1 -4
- package/dist/esm/hooks/useIsMounted.js.map +2 -2
- package/dist/esm/hooks/useIsSSR.js +22 -0
- package/dist/esm/hooks/useIsSSR.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +10 -10
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +157 -103
- package/dist/esm/hooks/useMedia.js.map +3 -3
- package/dist/esm/hooks/usePressable.js +2 -4
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useSafeRef.js +36 -0
- package/dist/esm/hooks/useSafeRef.js.map +7 -0
- package/dist/esm/hooks/useServerHooks.js +11 -0
- package/dist/esm/hooks/useServerHooks.js.map +7 -0
- package/dist/esm/hooks/useTheme.js +159 -109
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/hooks/useUnmountEffect.js +0 -3
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +51 -13
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/injectStyles.js +16 -0
- package/dist/esm/injectStyles.js.map +7 -0
- package/dist/esm/insertFont.js +67 -0
- package/dist/esm/insertFont.js.map +7 -0
- package/dist/esm/static.js +15 -15
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +40 -12
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/types-rnw.js +0 -0
- package/dist/esm/types-rnw.js.map +0 -0
- package/dist/esm/types.js +0 -0
- package/dist/esm/types.js.map +0 -0
- package/dist/esm/updateTheme.js +23 -0
- package/dist/esm/updateTheme.js.map +7 -0
- package/dist/esm/vendor/Pressability.js +7 -0
- package/dist/esm/vendor/Pressability.js.map +7 -0
- package/dist/esm/vendor/Pressability.native.js +7 -0
- package/dist/esm/vendor/Pressability.native.js.map +7 -0
- package/dist/esm/views/FontLanguage.js +14 -0
- package/dist/esm/views/FontLanguage.js.map +7 -0
- package/dist/esm/views/FontLanguage.native.js +14 -0
- package/dist/esm/views/FontLanguage.native.js.map +7 -0
- package/dist/esm/views/FontLanguage.types.js +1 -0
- package/dist/{cjs/defaultComponentState.js.map → esm/views/FontLanguage.types.js.map} +0 -0
- package/dist/esm/views/Slot.js +50 -32
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +0 -0
- package/dist/esm/views/Stack.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.js +52 -0
- package/dist/esm/views/TamaguiProvider.js.map +7 -0
- package/dist/esm/views/Text.js +13 -5
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +35 -19
- package/dist/esm/views/Theme.js.map +3 -3
- package/dist/esm/views/ThemeInverse.js +22 -20
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +28 -21
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +13 -12
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +48 -16
- package/reset.css +25 -4
- package/src/Tamagui.ts +44 -0
- package/src/addTheme.ts +67 -0
- package/src/config.ts +45 -0
- package/src/constants/constants.ts +15 -0
- package/src/constants/isDevTools.ts +6 -0
- package/src/constants/platform.native.ts +14 -0
- package/src/constants/platform.ts +41 -0
- package/src/contexts/ButtonInsideButtonContext.tsx +3 -0
- package/src/contexts/FontLanguageContext.tsx +5 -0
- package/src/contexts/TextAncestorContext.tsx +10 -0
- package/src/contexts/ThemeContext.tsx +5 -0
- package/src/createComponent.tsx +1599 -0
- package/src/createFont.ts +29 -0
- package/src/createShorthands.ts +5 -0
- package/src/createTamagui.ts +229 -0
- package/src/createTheme.ts +13 -0
- package/src/createTokens.ts +35 -0
- package/src/createVariable.ts +85 -0
- package/src/createVariables.ts +42 -0
- package/src/helpers/RNComponents.tsx +14 -0
- package/src/helpers/ThemeManager.tsx +235 -0
- package/src/helpers/areEqualSets.tsx +9 -0
- package/src/helpers/assignNativePropsToWeb.native.tsx +1 -0
- package/src/helpers/assignNativePropsToWeb.tsx +178 -0
- package/src/helpers/calc.ts +68 -0
- package/src/helpers/createMediaStyle.ts +48 -0
- package/src/helpers/createPropMapper.ts +523 -0
- package/src/helpers/expandStyle.ts +81 -0
- package/src/helpers/expandStyles.ts +106 -0
- package/src/helpers/extendStaticConfig.ts +76 -0
- package/src/helpers/fixNativeShadow.tsx +2 -0
- package/src/helpers/getAnimationDriver.tsx +5 -0
- package/src/helpers/getExpandedShorthands.ts +15 -0
- package/src/helpers/getFont.tsx +43 -0
- package/src/helpers/getFontLanguage.ts +2 -0
- package/src/helpers/getSize.ts +22 -0
- package/src/helpers/getSplitStyles.tsx +738 -0
- package/src/helpers/getStackSize.ts +22 -0
- package/src/helpers/getStylesAtomic.native.ts +3 -0
- package/src/helpers/getStylesAtomic.ts +292 -0
- package/src/helpers/getThemeCSSRules.native.ts +3 -0
- package/src/helpers/getThemeCSSRules.ts +105 -0
- package/src/helpers/getVariantExtras.tsx +84 -0
- package/src/helpers/insertStyleRule.tsx +150 -0
- package/src/helpers/isObj.ts +1 -0
- package/src/helpers/isTamaguiComponent.tsx +15 -0
- package/src/helpers/isTamaguiElement.tsx +12 -0
- package/src/helpers/matchMedia.native.ts +6 -0
- package/src/helpers/matchMedia.ts +16 -0
- package/src/helpers/mergeProps.ts +56 -0
- package/src/helpers/mergeTransform.ts +16 -0
- package/src/helpers/normalizeColor.ts +53 -0
- package/src/helpers/normalizeValueWithProperty.ts +80 -0
- package/src/helpers/proxyThemeVariables.tsx +18 -0
- package/src/helpers/pseudoDescriptors.ts +18 -0
- package/src/helpers/registerCSSVariable.ts +11 -0
- package/src/helpers/startTransition.ts +4 -0
- package/src/helpers/themeable.tsx +45 -0
- package/src/helpers/themes.ts +69 -0
- package/src/helpers/useShallowSetState.tsx +20 -0
- package/src/helpers/validate.ts +80 -0
- package/src/helpers/withStaticProperties.tsx +7 -0
- package/src/hooks/getThemeUnwrapped.tsx +8 -0
- package/src/hooks/useConstant.tsx +19 -0
- package/src/hooks/useId.tsx +1 -0
- package/src/hooks/useIsMounted.ts +16 -0
- package/src/hooks/useIsTouchDevice.tsx +20 -0
- package/src/hooks/useMedia.tsx +266 -0
- package/src/hooks/usePressable.tsx +9 -0
- package/src/hooks/useSafeRef.ts +49 -0
- package/src/hooks/useServerHooks.tsx +12 -0
- package/src/hooks/useTheme.tsx +299 -0
- package/src/hooks/useUnmountEffect.ts +5 -0
- package/src/index.ts +83 -0
- package/src/injectStyles.ts +20 -0
- package/src/insertFont.ts +70 -0
- package/src/static.ts +15 -0
- package/src/styled.tsx +198 -0
- package/src/types-rnw.tsx +162 -0
- package/src/types.tsx +1307 -0
- package/src/updateTheme.ts +23 -0
- package/src/vendor/Pressability.native.tsx +3 -0
- package/src/vendor/Pressability.tsx +2 -0
- package/src/views/FontLanguage.native.tsx +9 -0
- package/src/views/FontLanguage.tsx +18 -0
- package/src/views/FontLanguage.types.ts +13 -0
- package/src/views/Slot.tsx +151 -0
- package/src/views/Stack.tsx +24 -0
- package/src/views/TamaguiProvider.tsx +56 -0
- package/src/views/Text.tsx +79 -0
- package/src/views/Theme.tsx +72 -0
- package/src/views/ThemeInverse.tsx +33 -0
- package/src/views/ThemeProvider.tsx +63 -0
- package/src/views/ThemeReset.tsx +43 -0
- package/types/Tamagui.d.ts +6 -8
- package/types/addTheme.d.ts +11 -0
- package/types/conf.d.ts +4 -5
- package/types/config.d.ts +47 -0
- package/types/constants/constants.d.ts +1 -1
- package/types/constants/isDevTools.d.ts +2 -0
- package/types/constants/platform.d.ts +7 -6
- package/types/constants/platform.native.d.ts +13 -0
- package/types/contexts/FontLanguageContext.d.ts +5 -0
- package/types/{views → contexts}/TextAncestorContext.d.ts +0 -0
- package/types/{ThemeContext.d.ts → contexts/ThemeContext.d.ts} +1 -1
- package/types/createComponent.d.ts +32 -15
- package/types/createComponent.server.d.ts +36 -0
- package/types/createTamagui.d.ts +2 -17
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +5 -6
- package/types/createVariable.d.ts +24 -12
- package/types/createVariables.d.ts +10 -0
- package/types/helpers/RNComponents.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +46 -0
- package/types/helpers/assignNativePropsToWeb.d.ts +2 -0
- package/types/helpers/assignNativePropsToWeb.native.d.ts +2 -0
- package/types/helpers/calc.d.ts +17 -0
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createPropMapper.d.ts +6 -3
- package/types/helpers/createShallowUpdate.d.ts +1 -2
- package/types/helpers/cssHash.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts +6 -0
- package/types/helpers/expandStyles.d.ts +26 -0
- package/types/helpers/getAnimationDriver.d.ts +6 -0
- package/types/helpers/getFont.d.ts +3 -0
- package/types/helpers/getFontLanguage.d.ts +2 -0
- package/types/helpers/getSize.d.ts +3 -2
- package/types/helpers/getSplitStyles.d.ts +16 -9
- package/types/helpers/getStackSize.d.ts +8 -0
- package/types/helpers/getStylesAtomic.d.ts +17 -22
- package/types/helpers/getThemeCSSRules.d.ts +8 -0
- package/types/helpers/getThemeCSSRules.native.d.ts +2 -0
- package/types/helpers/getVariantExtras.d.ts +5 -0
- package/types/helpers/insertStyleRule.d.ts +7 -3
- package/types/helpers/isTamaguiComponent.d.ts +5 -0
- package/types/helpers/isTamaguiElement.d.ts +5 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/mergeProps.d.ts +17 -0
- package/types/helpers/mergeTransform.d.ts +7 -0
- package/types/helpers/normalizeColor.d.ts +3 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +6 -0
- package/types/helpers/pseudoDescriptors.d.ts +16 -0
- package/types/helpers/registerCSSVariable.d.ts +5 -0
- package/types/helpers/startTransition.d.ts +3 -0
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/useAnimationDriver.d.ts +1 -0
- package/types/helpers/useShallowSetState.d.ts +3 -0
- package/types/helpers/validate.d.ts +0 -3
- package/types/hooks/getThemeUnwrapped.d.ts +3 -0
- package/types/hooks/useAnimationDriver.d.ts +1 -0
- package/types/hooks/useDidFinishSSR.d.ts +3 -0
- package/types/hooks/useFeatures.d.ts +10 -5
- package/types/hooks/useId.d.ts +1 -8
- package/types/hooks/useIsSSR.d.ts +4 -0
- package/types/hooks/useMedia.d.ts +20 -6
- package/types/hooks/useSafeRef.d.ts +4 -0
- package/types/hooks/useServerContext.d.ts +2 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +21 -31
- package/types/index.d.ts +29 -9
- package/types/injectStyles.d.ts +7 -0
- package/types/insertFont.d.ts +9 -0
- package/types/static.d.ts +2 -15
- package/types/styled.d.ts +7 -3
- package/types/types.d.ts +277 -77
- package/types/updateTheme.d.ts +9 -0
- package/types/vendor/Pressability.d.ts +3 -0
- package/types/vendor/Pressability.native.d.ts +3 -0
- package/types/views/FontLanguage.d.ts +4 -0
- package/types/views/FontLanguage.native.d.ts +4 -0
- package/types/views/FontLanguage.types.d.ts +11 -0
- package/types/views/Slot.d.ts +1 -0
- package/types/views/TamaguiProvider.d.ts +4 -0
- package/types/views/Theme.d.ts +3 -9
- package/types/views/ThemeInverse.d.ts +4 -8
- package/types/views/ThemeProvider.d.ts +2 -1
- package/dist/cjs/ThemeContext.js.map +0 -7
- package/dist/cjs/ThemeManager.js.map +0 -7
- package/dist/cjs/conf.js.map +0 -7
- package/dist/cjs/constants/rnw.js +0 -46
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/defaultComponentState.js +0 -1
- package/dist/cjs/helpers/addStylesUsingClassname.js +0 -87
- package/dist/cjs/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -93
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/cjs/helpers/fixNativeShadow.native.js +0 -53
- package/dist/cjs/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/cjs/helpers/getButtonSize.js +0 -45
- package/dist/cjs/helpers/getButtonSize.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/cjs/hooks/useFeatures.js +0 -228
- package/dist/cjs/hooks/useFeatures.js.map +0 -7
- package/dist/cjs/hooks/usePrevious.js +0 -1
- package/dist/cjs/hooks/usePrevious.js.map +0 -7
- package/dist/cjs/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/views/TextAncestorContext.js.map +0 -7
- package/dist/esm/ThemeContext.js.map +0 -7
- package/dist/esm/ThemeManager.js.map +0 -7
- package/dist/esm/conf.js +0 -36
- package/dist/esm/conf.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -24
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/defaultComponentState.js +0 -1
- package/dist/esm/defaultComponentState.js.map +0 -7
- package/dist/esm/helpers/addStylesUsingClassname.js +0 -64
- package/dist/esm/helpers/addStylesUsingClassname.js.map +0 -7
- package/dist/esm/helpers/createTamaguiProvider.js +0 -40
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/esm/helpers/fixNativeShadow.native.js +0 -32
- package/dist/esm/helpers/fixNativeShadow.native.js.map +0 -7
- package/dist/esm/helpers/getButtonSize.js +0 -24
- package/dist/esm/helpers/getButtonSize.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.js +0 -7
- package/dist/esm/helpers/nativeGestureHandler.js.map +0 -7
- package/dist/esm/helpers/nativeGestureHandler.native.js +0 -2
- package/dist/esm/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/helpers/wrapThemeManagerContext.js +0 -14
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/esm/hooks/useFeatures.js +0 -173
- package/dist/esm/hooks/useFeatures.js.map +0 -7
- package/dist/esm/hooks/usePrevious.js +0 -1
- package/dist/esm/hooks/usePrevious.js.map +0 -7
- package/dist/esm/nativeGestureHandler.native.js +0 -2
- package/dist/esm/nativeGestureHandler.native.js.map +0 -7
- package/dist/esm/views/TextAncestorContext.js +0 -18
- package/dist/esm/views/TextAncestorContext.js.map +0 -7
- package/dist/jsx/Tamagui.js +0 -41
- package/dist/jsx/ThemeContext.js +0 -5
- package/dist/jsx/ThemeManager.js +0 -186
- package/dist/jsx/conf.js +0 -35
- package/dist/jsx/constants/constants.js +0 -17
- package/dist/jsx/constants/platform.js +0 -25
- package/dist/jsx/constants/rnw.js +0 -23
- package/dist/jsx/contexts/ButtonInsideButtonContext.js +0 -5
- package/dist/jsx/createComponent.js +0 -636
- package/dist/jsx/createFont.js +0 -27
- package/dist/jsx/createShorthands.js +0 -9
- package/dist/jsx/createTamagui.js +0 -201
- package/dist/jsx/createTheme.js +0 -6
- package/dist/jsx/createTokens.js +0 -28
- package/dist/jsx/createVariable.js +0 -48
- package/dist/jsx/defaultComponentState.js +0 -0
- package/dist/jsx/helpers/RNComponents.js +0 -11
- package/dist/jsx/helpers/addStylesUsingClassname.js +0 -63
- package/dist/jsx/helpers/areEqualSets.js +0 -15
- package/dist/jsx/helpers/createMediaStyle.js +0 -30
- package/dist/jsx/helpers/createPropMapper.js +0 -237
- package/dist/jsx/helpers/createShallowUpdate.js +0 -18
- package/dist/jsx/helpers/createTamaguiProvider.js +0 -34
- package/dist/jsx/helpers/extendStaticConfig.js +0 -61
- package/dist/jsx/helpers/fixNativeShadow.js +0 -7
- package/dist/jsx/helpers/fixNativeShadow.native.js +0 -31
- package/dist/jsx/helpers/getButtonSize.js +0 -23
- package/dist/jsx/helpers/getExpandedShorthands.js +0 -18
- package/dist/jsx/helpers/getSize.js +0 -12
- package/dist/jsx/helpers/getSplitStyles.js +0 -322
- package/dist/jsx/helpers/getStylesAtomic.js +0 -130
- package/dist/jsx/helpers/getStylesAtomic.native.js +0 -9
- package/dist/jsx/helpers/getTextSize.js +0 -33
- package/dist/jsx/helpers/insertStyleRule.js +0 -94
- package/dist/jsx/helpers/isObj.js +0 -6
- package/dist/jsx/helpers/isTamaguiElement.js +0 -10
- package/dist/jsx/helpers/matchMedia.js +0 -17
- package/dist/jsx/helpers/matchMedia.native.js +0 -8
- package/dist/jsx/helpers/nativeGestureHandler.js +0 -6
- package/dist/jsx/helpers/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/helpers/proxyThemeVariables.js +0 -17
- package/dist/jsx/helpers/themeable.js +0 -24
- package/dist/jsx/helpers/validate.js +0 -75
- package/dist/jsx/helpers/withStaticProperties.js +0 -9
- package/dist/jsx/helpers/wrapThemeManagerContext.js +0 -10
- package/dist/jsx/hooks/useConstant.js +0 -14
- package/dist/jsx/hooks/useFeatures.js +0 -167
- package/dist/jsx/hooks/useId.js +0 -34
- package/dist/jsx/hooks/useIsMounted.js +0 -18
- package/dist/jsx/hooks/useIsTouchDevice.js +0 -16
- package/dist/jsx/hooks/useMedia.js +0 -158
- package/dist/jsx/hooks/usePressable.js +0 -13
- package/dist/jsx/hooks/usePrevious.js +0 -0
- package/dist/jsx/hooks/useTheme.js +0 -177
- package/dist/jsx/hooks/useUnmountEffect.js +0 -10
- package/dist/jsx/index.js +0 -54
- package/dist/jsx/nativeGestureHandler.native.js +0 -1
- package/dist/jsx/static.js +0 -16
- package/dist/jsx/styled.js +0 -47
- package/dist/jsx/types-rnw.js +0 -0
- package/dist/jsx/types.js +0 -0
- package/dist/jsx/views/Slot.js +0 -75
- package/dist/jsx/views/Stack.js +0 -12
- package/dist/jsx/views/Text.js +0 -56
- package/dist/jsx/views/TextAncestorContext.js +0 -15
- package/dist/jsx/views/Theme.js +0 -31
- package/dist/jsx/views/ThemeInverse.js +0 -27
- package/dist/jsx/views/ThemeProvider.js +0 -35
- package/dist/jsx/views/ThemeReset.js +0 -34
- package/types/Tamagui.d.ts.map +0 -1
- package/types/ThemeContext.d.ts.map +0 -1
- package/types/ThemeManager.d.ts +0 -49
- package/types/ThemeManager.d.ts.map +0 -1
- package/types/conf.d.ts.map +0 -1
- package/types/constants/constants.d.ts.map +0 -1
- package/types/constants/platform.d.ts.map +0 -1
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/contexts/ButtonInsideButtonContext.d.ts.map +0 -1
- package/types/createComponent.d.ts.map +0 -1
- package/types/createFont.d.ts.map +0 -1
- package/types/createShorthands.d.ts.map +0 -1
- package/types/createTamagui.d.ts.map +0 -1
- package/types/createTheme.d.ts.map +0 -1
- package/types/createTokens.d.ts.map +0 -1
- package/types/createVariable.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts +0 -1
- package/types/defaultComponentState.d.ts.map +0 -1
- package/types/helpers/RNComponents.d.ts.map +0 -1
- package/types/helpers/addStylesUsingClassname.d.ts +0 -3
- package/types/helpers/addStylesUsingClassname.d.ts.map +0 -1
- package/types/helpers/areEqualSets.d.ts.map +0 -1
- package/types/helpers/createMediaStyle.d.ts.map +0 -1
- package/types/helpers/createPropMapper.d.ts.map +0 -1
- package/types/helpers/createShallowUpdate.d.ts.map +0 -1
- package/types/helpers/createTamaguiProvider.d.ts +0 -7
- package/types/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/types/helpers/extendStaticConfig.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.d.ts.map +0 -1
- package/types/helpers/fixNativeShadow.native.d.ts +0 -3
- package/types/helpers/fixNativeShadow.native.d.ts.map +0 -1
- package/types/helpers/getButtonSize.d.ts +0 -8
- package/types/helpers/getButtonSize.d.ts.map +0 -1
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -1
- package/types/helpers/getSize.d.ts.map +0 -1
- package/types/helpers/getSplitStyles.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.native.d.ts.map +0 -1
- package/types/helpers/getTextSize.d.ts +0 -3
- package/types/helpers/getTextSize.d.ts.map +0 -1
- package/types/helpers/insertStyleRule.d.ts.map +0 -1
- package/types/helpers/isObj.d.ts.map +0 -1
- package/types/helpers/isTamaguiElement.d.ts.map +0 -1
- package/types/helpers/matchMedia.d.ts.map +0 -1
- package/types/helpers/matchMedia.native.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.d.ts +0 -2
- package/types/helpers/nativeGestureHandler.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.native.d.ts +0 -2
- package/types/helpers/nativeGestureHandler.native.d.ts.map +0 -1
- package/types/helpers/proxyThemeVariables.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/helpers/validate.d.ts.map +0 -1
- package/types/helpers/withStaticProperties.d.ts.map +0 -1
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -3
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts.map +0 -1
- package/types/hooks/useFeatures.d.ts.map +0 -1
- package/types/hooks/useId.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts.map +0 -1
- package/types/hooks/useIsTouchDevice.d.ts.map +0 -1
- package/types/hooks/useMedia.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts.map +0 -1
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/usePrevious.d.ts.map +0 -1
- package/types/hooks/useTheme.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types/nativeGestureHandler.native.d.ts +0 -2
- package/types/nativeGestureHandler.native.d.ts.map +0 -1
- package/types/static.d.ts.map +0 -1
- package/types/styled.d.ts.map +0 -1
- package/types/types-rnw.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
- package/types/views/Slot.d.ts.map +0 -1
- package/types/views/Stack.d.ts.map +0 -1
- package/types/views/Text.d.ts.map +0 -1
- package/types/views/TextAncestorContext.d.ts.map +0 -1
- package/types/views/Theme.d.ts.map +0 -1
- package/types/views/ThemeInverse.d.ts.map +0 -1
- package/types/views/ThemeProvider.d.ts.map +0 -1
- package/types/views/ThemeReset.d.ts.map +0 -1
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isClient, isRSC, isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
3
|
+
import {
|
|
4
|
+
composeEventHandlers,
|
|
5
|
+
stylePropsView,
|
|
6
|
+
validPseudoKeys,
|
|
7
|
+
validStyles
|
|
8
|
+
} from "@tamagui/helpers";
|
|
9
|
+
import {
|
|
10
|
+
useElementLayout,
|
|
11
|
+
useMergeRefs,
|
|
12
|
+
usePlatformMethods,
|
|
13
|
+
useResponderEvents
|
|
14
|
+
} from "@tamagui/rnw";
|
|
4
15
|
import { useForceUpdate } from "@tamagui/use-force-update";
|
|
5
16
|
import React, {
|
|
6
17
|
Children,
|
|
@@ -10,210 +21,281 @@ import React, {
|
|
|
10
21
|
memo,
|
|
11
22
|
useCallback,
|
|
12
23
|
useContext,
|
|
13
|
-
|
|
14
|
-
useState
|
|
24
|
+
useEffect
|
|
15
25
|
} from "react";
|
|
16
|
-
import {
|
|
17
|
-
import { onConfiguredOnce } from "./
|
|
26
|
+
import { Text, View } from "react-native";
|
|
27
|
+
import { getConfig, onConfiguredOnce } from "./config";
|
|
18
28
|
import { stackDefaultStyles } from "./constants/constants";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
29
|
+
import { FontLanguageContext } from "./contexts/FontLanguageContext";
|
|
30
|
+
import { TextAncestorContext } from "./contexts/TextAncestorContext";
|
|
31
|
+
import { assignNativePropsToWeb } from "./helpers/assignNativePropsToWeb";
|
|
32
|
+
import { getReturnVariablesAs } from "./helpers/createPropMapper";
|
|
22
33
|
import { extendStaticConfig, parseStaticConfig } from "./helpers/extendStaticConfig";
|
|
23
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
getSubStyle,
|
|
36
|
+
insertSplitStyles,
|
|
37
|
+
useSplitStyles
|
|
38
|
+
} from "./helpers/getSplitStyles";
|
|
24
39
|
import { getAllSelectors } from "./helpers/insertStyleRule";
|
|
25
|
-
import {
|
|
40
|
+
import { mergeProps } from "./helpers/mergeProps";
|
|
26
41
|
import { proxyThemeVariables } from "./helpers/proxyThemeVariables";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { useIsTouchDevice } from "./hooks/useIsTouchDevice";
|
|
42
|
+
import { useShallowSetState } from "./helpers/useShallowSetState";
|
|
43
|
+
import { addMediaQueryListener, getInitialMediaState } from "./hooks/useMedia";
|
|
30
44
|
import { usePressable } from "./hooks/usePressable";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
45
|
+
import { useServerRef, useServerState } from "./hooks/useServerHooks";
|
|
46
|
+
import { getThemeManager, useTheme } from "./hooks/useTheme";
|
|
47
|
+
import { usePressability } from "./vendor/Pressability";
|
|
48
|
+
import { Slot, mergeEvent } from "./views/Slot";
|
|
49
|
+
import { wrapThemeManagerContext } from "./views/Theme";
|
|
34
50
|
React["keep"];
|
|
35
|
-
|
|
36
|
-
hover: false,
|
|
37
|
-
press: false,
|
|
38
|
-
pressIn: false,
|
|
39
|
-
focus: false,
|
|
40
|
-
mounted: false,
|
|
41
|
-
animation: null
|
|
42
|
-
};
|
|
51
|
+
let defaultComponentState = null;
|
|
43
52
|
const mouseUps = /* @__PURE__ */ new Set();
|
|
44
53
|
if (typeof document !== "undefined") {
|
|
45
|
-
|
|
46
|
-
mouseUps.forEach((x) => x());
|
|
47
|
-
mouseUps.clear();
|
|
48
|
-
});
|
|
49
|
-
document.addEventListener("touchend", () => {
|
|
54
|
+
const cancelTouches = () => {
|
|
50
55
|
mouseUps.forEach((x) => x());
|
|
51
56
|
mouseUps.clear();
|
|
52
|
-
}
|
|
53
|
-
document.addEventListener("
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
+
};
|
|
58
|
+
document.addEventListener("mouseup", cancelTouches);
|
|
59
|
+
document.addEventListener("touchend", cancelTouches);
|
|
60
|
+
document.addEventListener("touchcancel", cancelTouches);
|
|
57
61
|
}
|
|
58
62
|
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
59
|
-
for (const key
|
|
63
|
+
for (const key of Object.keys(defaultProps)) {
|
|
60
64
|
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
__name(mergeShorthands, "mergeShorthands");
|
|
64
67
|
let initialTheme;
|
|
68
|
+
let config;
|
|
65
69
|
function createComponent(configIn, ParentComponent) {
|
|
66
70
|
const staticConfig = (() => {
|
|
67
|
-
const
|
|
68
|
-
if ("parsed" in
|
|
69
|
-
return
|
|
71
|
+
const next = extendStaticConfig(configIn, ParentComponent);
|
|
72
|
+
if ("parsed" in next) {
|
|
73
|
+
return next;
|
|
70
74
|
} else {
|
|
71
|
-
return parseStaticConfig(
|
|
75
|
+
return parseStaticConfig(next);
|
|
72
76
|
}
|
|
73
77
|
})();
|
|
74
|
-
const
|
|
78
|
+
const defaultComponentClassName = `is_${staticConfig.componentName}`;
|
|
75
79
|
let tamaguiConfig;
|
|
76
80
|
let AnimatedText;
|
|
77
81
|
let AnimatedView;
|
|
78
82
|
let avoidClasses = true;
|
|
79
83
|
let defaultNativeStyle;
|
|
80
|
-
let defaultNativeStyleSheet;
|
|
81
84
|
let tamaguiDefaultProps;
|
|
82
85
|
let initialSplitStyles;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (pseudoStyle) {
|
|
91
|
-
styles.push(shouldNestObject ? { [name]: pseudoStyle } : pseudoStyle);
|
|
86
|
+
const component = forwardRef((propsIn, forwardedRef) => {
|
|
87
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
88
|
+
let props;
|
|
89
|
+
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
90
|
+
props = mergeProps(tamaguiDefaultProps, propsIn)[0];
|
|
91
|
+
} else {
|
|
92
|
+
props = propsIn;
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
const debugProp = props["debug"];
|
|
95
|
+
const { Component, isText, isZStack } = staticConfig;
|
|
96
|
+
const componentName = props.componentName || staticConfig.componentName;
|
|
97
|
+
const componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
|
|
98
|
+
const forceUpdate = useForceUpdate();
|
|
99
|
+
config = config || getConfig();
|
|
100
|
+
const theme = useTheme(props.theme, componentName, props, forceUpdate);
|
|
101
|
+
const states = useServerState(defaultComponentState);
|
|
102
|
+
const state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: true } : states[0];
|
|
103
|
+
const shouldAvoidClasses = !!(props.animation && avoidClasses) || !staticConfig.acceptsClassName;
|
|
104
|
+
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
105
|
+
const hasTextAncestor = !!(isWeb && isText ? useContext(TextAncestorContext) : false);
|
|
106
|
+
const splitStyleState = !shouldAvoidClasses && !shouldForcePseudo ? {
|
|
107
|
+
...state,
|
|
108
|
+
hasTextAncestor,
|
|
109
|
+
dynamicStylesInline: true
|
|
110
|
+
} : {
|
|
111
|
+
...state,
|
|
112
|
+
noClassNames: true,
|
|
113
|
+
dynamicStylesInline: true,
|
|
114
|
+
hasTextAncestor,
|
|
115
|
+
resolveVariablesAs: "value"
|
|
116
|
+
};
|
|
117
|
+
const languageContext = isRSC ? null : useContext(FontLanguageContext);
|
|
118
|
+
const splitStyles = useSplitStyles(
|
|
119
|
+
props,
|
|
120
|
+
staticConfig,
|
|
121
|
+
theme,
|
|
122
|
+
splitStyleState,
|
|
123
|
+
props.asChild ? null : initialSplitStyles == null ? void 0 : initialSplitStyles.classNames,
|
|
124
|
+
languageContext || void 0,
|
|
125
|
+
debugProp
|
|
126
|
+
);
|
|
127
|
+
const hostRef = useServerRef(null);
|
|
128
|
+
const setState = states[1];
|
|
129
|
+
const setStateShallow = useShallowSetState(setState);
|
|
99
130
|
if (process.env.NODE_ENV === "development") {
|
|
100
|
-
if (
|
|
101
|
-
console.
|
|
102
|
-
|
|
103
|
-
|
|
131
|
+
if (!process.env.TAMAGUI_TARGET) {
|
|
132
|
+
console.error(`No process.env.TAMAGUI_TARGET set, please set it to "native" or "web".`);
|
|
133
|
+
}
|
|
134
|
+
if (debugProp) {
|
|
135
|
+
const name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`;
|
|
136
|
+
const type = staticConfig.isReactNativeWeb ? "rnw" : "tamagui";
|
|
137
|
+
const banner = `${name} ${propsIn["data-is"] || ""} ${type}`;
|
|
138
|
+
console.group(`%c \u{1F41B} ${banner}`, "background: yellow;");
|
|
139
|
+
console.groupCollapsed("initial props/state");
|
|
140
|
+
console.log("props", propsIn);
|
|
141
|
+
console.log("splitStyles", splitStyles);
|
|
142
|
+
console.log("className", Object.values(splitStyles.classNames));
|
|
143
|
+
if (typeof window !== "undefined") {
|
|
144
|
+
console.log("ref", hostRef, "(click to view)");
|
|
145
|
+
}
|
|
146
|
+
console.groupEnd();
|
|
147
|
+
if (debugProp === "break") {
|
|
104
148
|
debugger;
|
|
149
|
+
}
|
|
105
150
|
}
|
|
106
151
|
}
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
const [state, set_] = useState(defaultComponentState);
|
|
110
|
-
const setStateShallow = createShallowUpdate(set_);
|
|
111
|
-
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
112
|
-
const splitStyles = useSplitStyles(props, staticConfig, theme, shouldAvoidClasses ? { ...state, noClassNames: true, resolveVariablesAs: "value" } : state, shouldAvoidClasses || props.asChild ? null : initialSplitStyles.classNames);
|
|
113
|
-
const { viewProps: viewPropsIn, pseudos, medias, style, classNames } = splitStyles;
|
|
114
|
-
const useAnimations = (_a = tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
115
|
-
const isAnimated = !!(useAnimations && props.animation);
|
|
116
|
-
const hasEnterStyle = !!props.enterStyle;
|
|
117
|
-
const features = useFeatures(props, {
|
|
118
|
-
forceUpdate,
|
|
119
|
-
setStateShallow,
|
|
120
|
-
useAnimations,
|
|
121
|
-
state,
|
|
122
|
-
style: props.animation ? { ...defaultNativeStyle, ...style } : null,
|
|
152
|
+
const {
|
|
153
|
+
viewProps: viewPropsIn,
|
|
123
154
|
pseudos,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
155
|
+
medias,
|
|
156
|
+
style: splitStylesStyle,
|
|
157
|
+
classNames,
|
|
158
|
+
mediaKeys
|
|
159
|
+
} = splitStyles;
|
|
160
|
+
useIsomorphicLayoutEffect(() => {
|
|
161
|
+
if (!mediaKeys.length) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const disposers = [];
|
|
165
|
+
for (const key of mediaKeys) {
|
|
166
|
+
disposers.push(
|
|
167
|
+
addMediaQueryListener(key, (next) => {
|
|
168
|
+
setState((prev) => {
|
|
169
|
+
if (prev.mediaState[key] !== next) {
|
|
170
|
+
return {
|
|
171
|
+
...prev,
|
|
172
|
+
mediaState: {
|
|
173
|
+
...prev.mediaState,
|
|
174
|
+
[key]: next
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
return prev;
|
|
179
|
+
});
|
|
180
|
+
})
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
return () => {
|
|
184
|
+
};
|
|
185
|
+
}, [mediaKeys.join(",")]);
|
|
186
|
+
const useAnimations = (_a = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _a.useAnimations;
|
|
187
|
+
const nextIsAnimated = !!(useAnimations && props.animation);
|
|
188
|
+
const isAnimated = nextIsAnimated || state.hasAnimation;
|
|
189
|
+
if (nextIsAnimated && !state.hasAnimation) {
|
|
190
|
+
setStateShallow({ hasAnimation: true });
|
|
191
|
+
}
|
|
192
|
+
const animationFeatureStylesIn = props.animation ? { ...defaultNativeStyle, ...splitStylesStyle } : null;
|
|
193
|
+
const propsWithAnimation = props;
|
|
194
|
+
if (!isRSC && isAnimated && useAnimations) {
|
|
195
|
+
const animationState = useAnimations(propsWithAnimation, {
|
|
196
|
+
state,
|
|
197
|
+
pseudos,
|
|
198
|
+
onDidAnimate: props.onDidAnimate,
|
|
199
|
+
hostRef,
|
|
200
|
+
staticConfig,
|
|
201
|
+
getStyle({ isExiting, isEntering, exitVariant, enterVariant } = {}) {
|
|
202
|
+
var _a2, _b2, _c2, _d2;
|
|
203
|
+
const style = animationFeatureStylesIn;
|
|
204
|
+
const enterStyle = isEntering ? enterVariant && ((_a2 = staticConfig.variants) == null ? void 0 : _a2[enterVariant]["true"]) ? getSubStyle(
|
|
205
|
+
"",
|
|
206
|
+
(_b2 = staticConfig.variants) == null ? void 0 : _b2[enterVariant]["true"],
|
|
207
|
+
staticConfig,
|
|
208
|
+
theme,
|
|
209
|
+
props,
|
|
210
|
+
state,
|
|
211
|
+
tamaguiConfig
|
|
212
|
+
) || pseudos.enterStyle : pseudos.enterStyle : null;
|
|
213
|
+
const exitStyle = isExiting ? exitVariant && ((_c2 = staticConfig.variants) == null ? void 0 : _c2[exitVariant]["true"]) ? getSubStyle(
|
|
214
|
+
"",
|
|
215
|
+
(_d2 = staticConfig.variants) == null ? void 0 : _d2[exitVariant]["true"],
|
|
216
|
+
staticConfig,
|
|
217
|
+
theme,
|
|
218
|
+
props,
|
|
219
|
+
state,
|
|
220
|
+
tamaguiConfig
|
|
221
|
+
) || pseudos.exitStyle : pseudos.exitStyle : null;
|
|
222
|
+
ensureBaseHasDefaults(
|
|
223
|
+
style,
|
|
224
|
+
pseudos.hoverStyle,
|
|
225
|
+
pseudos.focusStyle,
|
|
226
|
+
pseudos.pressStyle,
|
|
227
|
+
pseudos.pressStyle
|
|
228
|
+
);
|
|
229
|
+
enterStyle && isEntering && merge(style, enterStyle);
|
|
230
|
+
state.hover && pseudos.hoverStyle && merge(style, pseudos.hoverStyle);
|
|
231
|
+
state.focus && pseudos.focusStyle && merge(style, pseudos.focusStyle);
|
|
232
|
+
state.press && pseudos.pressStyle && merge(style, pseudos.pressStyle);
|
|
233
|
+
exitStyle && isExiting && merge(style, exitStyle);
|
|
234
|
+
if (process.env.NODE_ENV === "development") {
|
|
235
|
+
if (debugProp) {
|
|
236
|
+
console.log("animation style", style);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return style;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
if (animationState !== state.animation) {
|
|
243
|
+
setStateShallow({
|
|
244
|
+
animation: animationState
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
128
248
|
const {
|
|
129
249
|
tag,
|
|
130
250
|
hitSlop,
|
|
131
251
|
asChild,
|
|
132
252
|
children,
|
|
133
|
-
pointerEvents,
|
|
134
253
|
onPress,
|
|
135
254
|
onPressIn,
|
|
136
255
|
onPressOut,
|
|
137
256
|
onHoverIn,
|
|
138
257
|
onHoverOut,
|
|
139
|
-
|
|
140
|
-
|
|
258
|
+
themeShallow,
|
|
259
|
+
space: spaceProp,
|
|
260
|
+
spaceDirection: _spaceDirection,
|
|
261
|
+
disabled: disabledProp,
|
|
262
|
+
onMouseUp,
|
|
263
|
+
onMouseDown,
|
|
141
264
|
onMouseEnter,
|
|
142
265
|
onMouseLeave,
|
|
143
266
|
hrefAttrs,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
onResponderEnd,
|
|
147
|
-
onResponderGrant,
|
|
148
|
-
onResponderMove,
|
|
149
|
-
onResponderReject,
|
|
150
|
-
onResponderRelease,
|
|
151
|
-
onResponderStart,
|
|
152
|
-
onResponderTerminate,
|
|
153
|
-
onResponderTerminationRequest,
|
|
154
|
-
onScrollShouldSetResponder,
|
|
155
|
-
onScrollShouldSetResponderCapture,
|
|
156
|
-
onSelectionChangeShouldSetResponder,
|
|
157
|
-
onSelectionChangeShouldSetResponderCapture,
|
|
158
|
-
onStartShouldSetResponder,
|
|
159
|
-
onStartShouldSetResponderCapture,
|
|
160
|
-
onMouseDown,
|
|
161
|
-
nativeID,
|
|
162
|
-
accessible,
|
|
163
|
-
accessibilityRole,
|
|
164
|
-
collapsable,
|
|
165
|
-
focusable,
|
|
267
|
+
separator,
|
|
268
|
+
forceStyle: _forceStyle,
|
|
166
269
|
onClick,
|
|
167
270
|
theme: _themeProp,
|
|
168
271
|
defaultVariants,
|
|
169
|
-
|
|
170
|
-
...viewPropsRest
|
|
272
|
+
...nonTamaguiProps
|
|
171
273
|
} = viewPropsIn;
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
internal.current.isMounted = false;
|
|
198
|
-
};
|
|
199
|
-
}, [hasEnterStyle, props.animation]);
|
|
200
|
-
if (nativeID) {
|
|
201
|
-
viewProps.id = nativeID;
|
|
202
|
-
}
|
|
203
|
-
if (isAndroid) {
|
|
204
|
-
if (collapsable)
|
|
205
|
-
viewProps.collapsable = collapsable;
|
|
206
|
-
if (focusable)
|
|
207
|
-
viewProps.focusable = focusable;
|
|
208
|
-
}
|
|
209
|
-
if (!isWeb) {
|
|
210
|
-
if (accessible)
|
|
211
|
-
viewProps.accessible = accessible;
|
|
212
|
-
if (accessibilityRole)
|
|
213
|
-
viewProps.accessibilityRole = accessibilityRole;
|
|
214
|
-
}
|
|
215
|
-
if (isWeb && !asChild) {
|
|
216
|
-
rnw.useResponderEvents(hostRef, {
|
|
274
|
+
const isTaggable = !Component || typeof Component === "string";
|
|
275
|
+
const element = isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
276
|
+
const BaseTextComponent = !isWeb ? Text : element || "span";
|
|
277
|
+
const BaseViewComponent = !isWeb ? View : element || (hasTextAncestor ? "span" : "div");
|
|
278
|
+
let elementType = isText ? (isAnimated ? AnimatedText || Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || View : null) || BaseViewComponent;
|
|
279
|
+
elementType = Component || elementType;
|
|
280
|
+
const isStringElement = typeof elementType === "string";
|
|
281
|
+
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
282
|
+
let viewProps;
|
|
283
|
+
const hasEnterStyle = !!props.enterStyle;
|
|
284
|
+
const shouldSetMounted = Boolean(
|
|
285
|
+
(isWeb ? isClient : true) && (hasEnterStyle || props.animation) && !state.mounted
|
|
286
|
+
);
|
|
287
|
+
const setMounted = shouldSetMounted ? () => {
|
|
288
|
+
setTimeout(
|
|
289
|
+
() => {
|
|
290
|
+
setStateShallow({
|
|
291
|
+
mounted: true
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
isWeb ? 10 : 0
|
|
295
|
+
);
|
|
296
|
+
} : void 0;
|
|
297
|
+
if (process.env.TAMAGUI_TARGET === "web" && !staticConfig.isReactNativeWeb) {
|
|
298
|
+
const {
|
|
217
299
|
onMoveShouldSetResponder,
|
|
218
300
|
onMoveShouldSetResponderCapture,
|
|
219
301
|
onResponderEnd,
|
|
@@ -229,117 +311,262 @@ function createComponent(configIn, ParentComponent) {
|
|
|
229
311
|
onSelectionChangeShouldSetResponder,
|
|
230
312
|
onSelectionChangeShouldSetResponderCapture,
|
|
231
313
|
onStartShouldSetResponder,
|
|
232
|
-
onStartShouldSetResponderCapture
|
|
314
|
+
onStartShouldSetResponderCapture,
|
|
315
|
+
nativeID,
|
|
316
|
+
accessibilityActiveDescendant,
|
|
317
|
+
accessibilityAtomic,
|
|
318
|
+
accessibilityAutoComplete,
|
|
319
|
+
accessibilityBusy,
|
|
320
|
+
accessibilityChecked,
|
|
321
|
+
accessibilityColumnCount,
|
|
322
|
+
accessibilityColumnIndex,
|
|
323
|
+
accessibilityColumnSpan,
|
|
324
|
+
accessibilityControls,
|
|
325
|
+
accessibilityCurrent,
|
|
326
|
+
accessibilityDescribedBy,
|
|
327
|
+
accessibilityDetails,
|
|
328
|
+
accessibilityDisabled,
|
|
329
|
+
accessibilityErrorMessage,
|
|
330
|
+
accessibilityExpanded,
|
|
331
|
+
accessibilityFlowTo,
|
|
332
|
+
accessibilityHasPopup,
|
|
333
|
+
accessibilityHidden,
|
|
334
|
+
accessibilityInvalid,
|
|
335
|
+
accessibilityKeyShortcuts,
|
|
336
|
+
accessibilityLabel,
|
|
337
|
+
accessibilityLabelledBy,
|
|
338
|
+
accessibilityLevel,
|
|
339
|
+
accessibilityLiveRegion,
|
|
340
|
+
accessibilityModal,
|
|
341
|
+
accessibilityMultiline,
|
|
342
|
+
accessibilityMultiSelectable,
|
|
343
|
+
accessibilityOrientation,
|
|
344
|
+
accessibilityOwns,
|
|
345
|
+
accessibilityPlaceholder,
|
|
346
|
+
accessibilityPosInSet,
|
|
347
|
+
accessibilityPressed,
|
|
348
|
+
accessibilityReadOnly,
|
|
349
|
+
accessibilityRequired,
|
|
350
|
+
accessibilityRole,
|
|
351
|
+
accessibilityRoleDescription,
|
|
352
|
+
accessibilityRowCount,
|
|
353
|
+
accessibilityRowIndex,
|
|
354
|
+
accessibilityRowSpan,
|
|
355
|
+
accessibilitySelected,
|
|
356
|
+
accessibilitySetSize,
|
|
357
|
+
accessibilitySort,
|
|
358
|
+
accessibilityValueMax,
|
|
359
|
+
accessibilityValueMin,
|
|
360
|
+
accessibilityValueNow,
|
|
361
|
+
accessibilityValueText,
|
|
362
|
+
accessible,
|
|
363
|
+
accessibilityState,
|
|
364
|
+
accessibilityValue,
|
|
365
|
+
collapsable,
|
|
366
|
+
focusable,
|
|
367
|
+
onLayout,
|
|
368
|
+
...webProps
|
|
369
|
+
} = nonTamaguiProps;
|
|
370
|
+
viewProps = webProps;
|
|
371
|
+
assignNativePropsToWeb(elementType, viewProps, nonTamaguiProps);
|
|
372
|
+
if (!isRSC) {
|
|
373
|
+
useElementLayout(hostRef, onLayout);
|
|
374
|
+
useResponderEvents(hostRef, {
|
|
375
|
+
onMoveShouldSetResponder,
|
|
376
|
+
onMoveShouldSetResponderCapture,
|
|
377
|
+
onResponderEnd,
|
|
378
|
+
onResponderGrant,
|
|
379
|
+
onResponderMove,
|
|
380
|
+
onResponderReject,
|
|
381
|
+
onResponderRelease,
|
|
382
|
+
onResponderStart,
|
|
383
|
+
onResponderTerminate,
|
|
384
|
+
onResponderTerminationRequest,
|
|
385
|
+
onScrollShouldSetResponder,
|
|
386
|
+
onScrollShouldSetResponderCapture,
|
|
387
|
+
onSelectionChangeShouldSetResponder,
|
|
388
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
389
|
+
onStartShouldSetResponder,
|
|
390
|
+
onStartShouldSetResponderCapture
|
|
391
|
+
});
|
|
392
|
+
const platformMethodsRef = usePlatformMethods(viewProps);
|
|
393
|
+
const setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef, setMounted);
|
|
394
|
+
viewProps.ref = setRef;
|
|
395
|
+
}
|
|
396
|
+
if (props.href != void 0 && hrefAttrs != void 0) {
|
|
397
|
+
const { download, rel, target } = hrefAttrs;
|
|
398
|
+
if (download != null) {
|
|
399
|
+
viewProps.download = download;
|
|
400
|
+
}
|
|
401
|
+
if (rel != null) {
|
|
402
|
+
viewProps.rel = rel;
|
|
403
|
+
}
|
|
404
|
+
if (typeof target === "string") {
|
|
405
|
+
viewProps.target = target.charAt(0) !== "_" ? "_" + target : target;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
const _focusable = focusable != void 0 ? focusable : accessible;
|
|
409
|
+
const role = viewProps.role;
|
|
410
|
+
if (_focusable === false) {
|
|
411
|
+
viewProps.tabIndex = "-1";
|
|
412
|
+
}
|
|
413
|
+
if (elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
414
|
+
if (_focusable === false || accessibilityDisabled === true) {
|
|
415
|
+
viewProps.tabIndex = "-1";
|
|
416
|
+
}
|
|
417
|
+
} else if (role === "button" || role === "checkbox" || role === "link" || role === "radio" || role === "textbox" || role === "switch") {
|
|
418
|
+
if (_focusable !== false) {
|
|
419
|
+
viewProps.tabIndex = "0";
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (_focusable === true) {
|
|
423
|
+
viewProps.tabIndex = "0";
|
|
424
|
+
}
|
|
425
|
+
} else {
|
|
426
|
+
viewProps = nonTamaguiProps;
|
|
427
|
+
if (forwardedRef) {
|
|
428
|
+
viewProps.ref = forwardedRef;
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (process.env.NODE_ENV === "development" && !isText && isWeb && !staticConfig.isHOC) {
|
|
432
|
+
Children.toArray(props.children).forEach((item) => {
|
|
433
|
+
if (typeof item === "string") {
|
|
434
|
+
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
435
|
+
}
|
|
233
436
|
});
|
|
234
437
|
}
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
438
|
+
const unPress = useCallback(() => {
|
|
439
|
+
setStateShallow({
|
|
440
|
+
press: false,
|
|
441
|
+
pressIn: false
|
|
442
|
+
});
|
|
443
|
+
}, [setStateShallow]);
|
|
444
|
+
if (!isRSC) {
|
|
445
|
+
useEffect(() => {
|
|
446
|
+
return () => {
|
|
447
|
+
mouseUps.delete(unPress);
|
|
448
|
+
};
|
|
449
|
+
}, [unPress]);
|
|
450
|
+
}
|
|
241
451
|
let styles;
|
|
242
|
-
const isStringElement = typeof ViewComponent === "string";
|
|
243
452
|
const animationStyles = state.animation ? state.animation.style : null;
|
|
244
|
-
if (isStringElement && shouldAvoidClasses) {
|
|
453
|
+
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
245
454
|
styles = {
|
|
246
455
|
...defaultNativeStyle,
|
|
247
|
-
...animationStyles,
|
|
456
|
+
...animationStyles ?? splitStylesStyle,
|
|
248
457
|
...medias
|
|
249
458
|
};
|
|
250
459
|
} else {
|
|
251
|
-
styles = [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
if (!shouldAvoidClasses) {
|
|
265
|
-
const fontFamilyName = isText ? props.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
266
|
-
const fontFamily = fontFamilyName && fontFamilyName[0] === "$" ? fontFamilyName.slice(1) : null;
|
|
267
|
-
const classList = [
|
|
268
|
-
componentName ? componentClassName : "",
|
|
269
|
-
fontFamily ? `font_${fontFamily}` : "",
|
|
270
|
-
theme.className,
|
|
271
|
-
classNames ? Object.values(classNames).join(" ") : ""
|
|
272
|
-
];
|
|
273
|
-
const className = classList.join(" ");
|
|
274
|
-
if (process.env.NODE_ENV === "development") {
|
|
275
|
-
if (props["debug"]) {
|
|
276
|
-
console.log(" \xBB className", { isStringElement, pseudos, state, classNames, propsClassName: props.className, style, classList, className: className.trim().split(" "), themeClassName: theme.className, values: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, getAllSelectors()[v]])) });
|
|
460
|
+
styles = [isWeb ? null : defaultNativeStyle, animationStyles ?? splitStylesStyle, medias];
|
|
461
|
+
if (!animationStyles && initialSplitStyles) {
|
|
462
|
+
const initPseudos = initialSplitStyles.pseudos;
|
|
463
|
+
!state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, "enterStyle");
|
|
464
|
+
state.hover && addPseudoToStyles(styles, initPseudos, pseudos, "hoverStyle", shouldForcePseudo);
|
|
465
|
+
state.focus && addPseudoToStyles(styles, initPseudos, pseudos, "focusStyle", shouldForcePseudo);
|
|
466
|
+
state.press && addPseudoToStyles(styles, initPseudos, pseudos, "pressStyle", shouldForcePseudo);
|
|
467
|
+
}
|
|
468
|
+
if (shouldForcePseudo) {
|
|
469
|
+
const next = {};
|
|
470
|
+
for (const style of styles) {
|
|
471
|
+
if (style) {
|
|
472
|
+
Object.assign(next, style);
|
|
277
473
|
}
|
|
278
474
|
}
|
|
279
|
-
|
|
280
|
-
viewProps.style = animationStyles;
|
|
281
|
-
} else {
|
|
282
|
-
viewProps.style = styles;
|
|
475
|
+
Object.assign(splitStyles.style, next);
|
|
283
476
|
}
|
|
284
|
-
} else {
|
|
285
|
-
viewProps.style = styles;
|
|
286
477
|
}
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
const platformMethodsRef = rnw.usePlatformMethods(viewProps);
|
|
292
|
-
const setRef = rnw.useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
|
|
293
|
-
if (!isAnimated) {
|
|
294
|
-
viewProps.ref = setRef;
|
|
295
|
-
} else {
|
|
296
|
-
if (forwardedRef) {
|
|
297
|
-
viewProps.ref = forwardedRef;
|
|
298
|
-
}
|
|
478
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
479
|
+
let fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
480
|
+
if (fontFamily && fontFamily[0] === "$") {
|
|
481
|
+
fontFamily = fontFamily.slice(1);
|
|
299
482
|
}
|
|
300
|
-
if (
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
483
|
+
if (process.env.NODE_ENV === "development") {
|
|
484
|
+
if (fontFamily == null ? void 0 : fontFamily.startsWith(`var(`)) {
|
|
485
|
+
console.warn(
|
|
486
|
+
`Received variable instead of resolved name of font, this is a bug. Please report on Github.`,
|
|
487
|
+
{
|
|
488
|
+
fontFamily,
|
|
489
|
+
props,
|
|
490
|
+
splitStyles,
|
|
491
|
+
staticConfig
|
|
492
|
+
}
|
|
493
|
+
);
|
|
307
494
|
}
|
|
308
|
-
|
|
309
|
-
|
|
495
|
+
}
|
|
496
|
+
const classList = [
|
|
497
|
+
componentName ? componentClassName : "",
|
|
498
|
+
fontFamily ? `font_${fontFamily}` : "",
|
|
499
|
+
theme.className,
|
|
500
|
+
classNames ? Object.values(classNames).join(" ") : ""
|
|
501
|
+
];
|
|
502
|
+
const className = classList.join(" ");
|
|
503
|
+
const style = animationStyles ?? splitStyles.style;
|
|
504
|
+
const isAnimatedReactNativeWeb = props.animation && avoidClasses;
|
|
505
|
+
if (staticConfig.isReactNativeWeb || isAnimatedReactNativeWeb) {
|
|
506
|
+
viewProps.dataSet = {
|
|
507
|
+
...viewProps.dataSet,
|
|
508
|
+
className,
|
|
509
|
+
id: props.id
|
|
510
|
+
};
|
|
511
|
+
if (process.env.NODE_ENV === "development") {
|
|
512
|
+
Object.keys(viewProps).forEach((key) => {
|
|
513
|
+
if (key.startsWith("data-")) {
|
|
514
|
+
viewProps.dataSet[key.replace("data-", "")] = viewProps[key];
|
|
515
|
+
delete viewProps[key];
|
|
516
|
+
}
|
|
517
|
+
});
|
|
310
518
|
}
|
|
519
|
+
} else {
|
|
520
|
+
viewProps.className = className;
|
|
311
521
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
522
|
+
viewProps.style = style;
|
|
523
|
+
}
|
|
524
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
525
|
+
const mergedRef = useMergeRefs(forwardedRef, hostRef, setMounted);
|
|
526
|
+
viewProps.ref = mergedRef;
|
|
527
|
+
if (splitStyles.fontFamily) {
|
|
528
|
+
const faceInfo = (_b = config.fontsParsed[splitStyles.fontFamily]) == null ? void 0 : _b.face;
|
|
529
|
+
if (faceInfo) {
|
|
530
|
+
const [weight, style] = (() => {
|
|
531
|
+
var _a2, _b2;
|
|
532
|
+
let weight2;
|
|
533
|
+
let style2;
|
|
534
|
+
for (let i = styles.length; i >= 0; i--) {
|
|
535
|
+
weight2 ??= (_a2 = styles[i]) == null ? void 0 : _a2.fontWeight;
|
|
536
|
+
style2 ??= (_b2 = styles[i]) == null ? void 0 : _b2.fontStyle;
|
|
537
|
+
}
|
|
538
|
+
return [weight2 || "400", style2 || "normal"];
|
|
539
|
+
})();
|
|
540
|
+
const overrideFace = (_d = (_c = faceInfo[weight]) == null ? void 0 : _c[style]) == null ? void 0 : _d.val;
|
|
541
|
+
if (overrideFace) {
|
|
542
|
+
for (const style2 of styles) {
|
|
543
|
+
if (style2 == null ? void 0 : style2.fontFamily) {
|
|
544
|
+
style2.fontFamily = overrideFace;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
315
549
|
}
|
|
550
|
+
viewProps.style = styles;
|
|
316
551
|
}
|
|
317
|
-
const initialPseudos = initialSplitStyles.pseudos;
|
|
318
|
-
const attachPress = !!(pseudos
|
|
319
|
-
const
|
|
320
|
-
const isHoverable = isWeb && !isTouch;
|
|
552
|
+
const initialPseudos = initialSplitStyles == null ? void 0 : initialSplitStyles.pseudos;
|
|
553
|
+
const attachPress = !!((pseudos == null ? void 0 : pseudos.pressStyle) || (initialPseudos == null ? void 0 : initialPseudos.pressStyle) || onPress || onPressOut || onPressIn || onClick);
|
|
554
|
+
const isHoverable = isWeb;
|
|
321
555
|
const attachHover = isHoverable && !!(pseudos && pseudos.hoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
322
556
|
const handlesPressEvents = !isStringElement && !asChild;
|
|
323
557
|
const pressKey = handlesPressEvents ? "onPress" : "onClick";
|
|
324
558
|
const pressInKey = handlesPressEvents ? "onPressIn" : "onMouseDown";
|
|
325
559
|
const pressOutKey = handlesPressEvents ? "onPressOut" : "onMouseUp";
|
|
326
560
|
const shouldAttach = !asChild && (attachPress || attachHover || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props));
|
|
327
|
-
const
|
|
328
|
-
if (!internal.current.isMounted)
|
|
329
|
-
return;
|
|
330
|
-
setStateShallow({
|
|
331
|
-
press: false,
|
|
332
|
-
pressIn: false
|
|
333
|
-
});
|
|
334
|
-
}, []);
|
|
335
|
-
const events = shouldAttach ? {
|
|
561
|
+
const events = shouldAttach && !isRSC ? {
|
|
336
562
|
[pressOutKey]: attachPress ? (e) => {
|
|
337
563
|
unPress();
|
|
338
564
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
565
|
+
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
339
566
|
} : void 0,
|
|
340
567
|
...isHoverable && {
|
|
341
568
|
onMouseEnter: attachHover ? (e) => {
|
|
342
|
-
|
|
569
|
+
const next = {};
|
|
343
570
|
if (attachHover) {
|
|
344
571
|
next.hover = true;
|
|
345
572
|
}
|
|
@@ -353,7 +580,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
353
580
|
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
354
581
|
} : void 0,
|
|
355
582
|
onMouseLeave: attachHover ? (e) => {
|
|
356
|
-
|
|
583
|
+
const next = {};
|
|
357
584
|
mouseUps.add(unPress);
|
|
358
585
|
if (attachHover) {
|
|
359
586
|
next.hover = false;
|
|
@@ -372,7 +599,8 @@ function createComponent(configIn, ParentComponent) {
|
|
|
372
599
|
[pressInKey]: attachPress ? (e) => {
|
|
373
600
|
setStateShallow({
|
|
374
601
|
press: true,
|
|
375
|
-
pressIn: true
|
|
602
|
+
pressIn: true,
|
|
603
|
+
hover: false
|
|
376
604
|
});
|
|
377
605
|
onPressIn == null ? void 0 : onPressIn(e);
|
|
378
606
|
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
@@ -384,47 +612,68 @@ function createComponent(configIn, ParentComponent) {
|
|
|
384
612
|
unPress();
|
|
385
613
|
onClick == null ? void 0 : onClick(e);
|
|
386
614
|
onPress == null ? void 0 : onPress(e);
|
|
387
|
-
} : null
|
|
615
|
+
} : null,
|
|
616
|
+
...!isWeb && {
|
|
617
|
+
cancelable: !props.rejectResponderTermination,
|
|
618
|
+
disabled: props.disabled !== null ? props.disabled : (_e = props.accessibilityState) == null ? void 0 : _e.disabled,
|
|
619
|
+
hitSlop: props.hitSlop,
|
|
620
|
+
delayLongPress: props.delayLongPress,
|
|
621
|
+
delayPressIn: props.delayPressIn,
|
|
622
|
+
delayPressOut: props.delayPressOut,
|
|
623
|
+
focusable: viewProps.focusable ?? true,
|
|
624
|
+
minPressDuration: 0
|
|
625
|
+
}
|
|
388
626
|
} : null;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
if (isWeb) {
|
|
397
|
-
if (staticConfig.isReactNativeWeb) {
|
|
398
|
-
viewProps.dataSet = {
|
|
399
|
-
...viewProps.dataSet,
|
|
400
|
-
className: viewProps.className
|
|
401
|
-
};
|
|
402
|
-
} else {
|
|
403
|
-
const rnProps = rnw.createDOMProps(viewProps);
|
|
404
|
-
const className = rnProps.className && rnProps.className !== viewProps.className ? `${rnProps.className} ${viewProps.className}` : viewProps.className;
|
|
405
|
-
Object.assign(viewProps, rnProps);
|
|
406
|
-
if (className) {
|
|
407
|
-
viewProps.className = className;
|
|
627
|
+
let space = spaceProp;
|
|
628
|
+
if (state.mediaState && mediaKeys.length) {
|
|
629
|
+
for (const key in state.mediaState) {
|
|
630
|
+
if (!state.mediaState[key])
|
|
631
|
+
continue;
|
|
632
|
+
if (props[key] && props[key].space !== void 0) {
|
|
633
|
+
space = props[key].space;
|
|
408
634
|
}
|
|
409
635
|
}
|
|
410
636
|
}
|
|
637
|
+
const themeManager = getThemeManager(theme);
|
|
638
|
+
const shouldSetChildrenThemeToParent = Boolean(
|
|
639
|
+
themeShallow && themeManager && themeManager.didChangeTheme
|
|
640
|
+
);
|
|
641
|
+
const shouldProvideThemeManager = shouldSetChildrenThemeToParent || themeManager && themeManager.didChangeTheme;
|
|
642
|
+
const childEls = !children || asChild ? children : wrapThemeManagerContext(
|
|
643
|
+
spacedChildren({
|
|
644
|
+
separator,
|
|
645
|
+
children,
|
|
646
|
+
space,
|
|
647
|
+
direction: props.spaceDirection || "both",
|
|
648
|
+
isZStack
|
|
649
|
+
}),
|
|
650
|
+
shouldProvideThemeManager ? themeManager : void 0,
|
|
651
|
+
shouldSetChildrenThemeToParent
|
|
652
|
+
);
|
|
653
|
+
let content;
|
|
411
654
|
if (asChild) {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
655
|
+
elementType = Slot;
|
|
656
|
+
viewProps = {
|
|
657
|
+
...viewProps,
|
|
658
|
+
onPress,
|
|
659
|
+
onPressIn,
|
|
660
|
+
onPressOut
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
if (!isRSC && isWeb) {
|
|
664
|
+
const [pressableProps] = usePressable(
|
|
665
|
+
events ? {
|
|
666
|
+
disabled,
|
|
667
|
+
...hitSlop && {
|
|
668
|
+
hitSlop
|
|
669
|
+
},
|
|
670
|
+
onPressOut: events[pressOutKey],
|
|
671
|
+
onPressIn: events[pressInKey],
|
|
672
|
+
onPress: events[pressKey]
|
|
673
|
+
} : {
|
|
674
|
+
disabled: true
|
|
675
|
+
}
|
|
676
|
+
);
|
|
428
677
|
if (events) {
|
|
429
678
|
if (handlesPressEvents) {
|
|
430
679
|
Object.assign(viewProps, pressableProps);
|
|
@@ -433,90 +682,171 @@ function createComponent(configIn, ParentComponent) {
|
|
|
433
682
|
}
|
|
434
683
|
}
|
|
435
684
|
}
|
|
436
|
-
|
|
437
|
-
|
|
685
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
686
|
+
const attachFocus = !!(pseudos && pseudos.focusStyle || initialPseudos && initialPseudos.focusStyle);
|
|
687
|
+
if (attachFocus) {
|
|
688
|
+
viewProps.onFocus = mergeEvent(viewProps.onFocus, () => {
|
|
689
|
+
setStateShallow({ focus: true });
|
|
690
|
+
});
|
|
691
|
+
viewProps.onBlur = mergeEvent(viewProps.onBlur, () => {
|
|
692
|
+
setStateShallow({ focus: false });
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
const pressability = usePressability(events);
|
|
438
696
|
if (attachPress && events) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
697
|
+
const dontComposePressabilityKeys = {
|
|
698
|
+
onClick: true
|
|
699
|
+
};
|
|
700
|
+
if (hitSlop) {
|
|
701
|
+
viewProps.hitSlop = hitSlop;
|
|
702
|
+
}
|
|
703
|
+
for (const key in pressability) {
|
|
704
|
+
const og = props[key];
|
|
705
|
+
const val = pressability[key];
|
|
706
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? composeEventHandlers(og, val) : val;
|
|
707
|
+
}
|
|
449
708
|
}
|
|
450
709
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
710
|
+
content = createElement(elementType, viewProps, childEls);
|
|
711
|
+
if (process.env.TAMAGUI_TARGET === "web") {
|
|
712
|
+
const isAnimatedRNWView = isAnimated && typeof elementType !== "string";
|
|
713
|
+
const shouldWrapWithComponentTheme = !!theme.className && isAnimatedRNWView && getReturnVariablesAs(props, splitStyleState) === "non-color-value";
|
|
714
|
+
const shouldWrapWithHover = Boolean(events || isRSC) && attachHover;
|
|
715
|
+
if (shouldWrapWithHover || shouldWrapWithComponentTheme) {
|
|
716
|
+
const themeClassName = shouldWrapWithComponentTheme ? `${theme.className}` : "";
|
|
717
|
+
const hoverClassName = shouldWrapWithHover ? "t_Hoverable" : "";
|
|
718
|
+
content = /* @__PURE__ */ jsx("span", {
|
|
719
|
+
className: `${hoverClassName} ${themeClassName}`,
|
|
720
|
+
style: {
|
|
721
|
+
display: "contents"
|
|
722
|
+
},
|
|
723
|
+
...events && shouldWrapWithHover && {
|
|
724
|
+
onMouseEnter: events.onMouseEnter,
|
|
725
|
+
onMouseLeave: events.onMouseLeave
|
|
726
|
+
},
|
|
727
|
+
children: content
|
|
728
|
+
});
|
|
729
|
+
}
|
|
460
730
|
}
|
|
461
731
|
if (process.env.NODE_ENV === "development") {
|
|
462
|
-
if (
|
|
463
|
-
|
|
732
|
+
if (debugProp) {
|
|
733
|
+
const element2 = typeof elementType === "string" ? elementType : "Component";
|
|
734
|
+
console.groupCollapsed(`render <${element2} /> with props`, viewProps);
|
|
735
|
+
for (const key in viewProps) {
|
|
736
|
+
console.log(key, viewProps[key]);
|
|
737
|
+
}
|
|
738
|
+
console.log("children", content);
|
|
739
|
+
console.groupEnd();
|
|
740
|
+
if (typeof window !== "undefined") {
|
|
741
|
+
console.log({ state, shouldProvideThemeManager, tamaguiDefaultProps, viewProps, splitStyles, animationStyles, handlesPressEvents, isStringElement, classNamesIn: (_f = props.className) == null ? void 0 : _f.split(" "), classNamesOut: (_g = viewProps.className) == null ? void 0 : _g.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 });
|
|
742
|
+
}
|
|
743
|
+
console.groupEnd();
|
|
464
744
|
}
|
|
465
745
|
}
|
|
466
|
-
if (features.length) {
|
|
467
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, features, content);
|
|
468
|
-
}
|
|
469
746
|
return content;
|
|
470
747
|
});
|
|
471
|
-
|
|
748
|
+
if (staticConfig.componentName) {
|
|
749
|
+
component.displayName = staticConfig.componentName;
|
|
750
|
+
}
|
|
472
751
|
onConfiguredOnce((conf) => {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
752
|
+
if (!defaultComponentState) {
|
|
753
|
+
defaultComponentState = Object.freeze({
|
|
754
|
+
hover: false,
|
|
755
|
+
press: false,
|
|
756
|
+
pressIn: false,
|
|
757
|
+
focus: false,
|
|
758
|
+
mounted: false,
|
|
759
|
+
animation: null,
|
|
760
|
+
mediaState: getInitialMediaState()
|
|
761
|
+
});
|
|
476
762
|
}
|
|
763
|
+
if (process.env.IS_STATIC === "is_static")
|
|
764
|
+
return;
|
|
477
765
|
tamaguiConfig = conf;
|
|
478
766
|
mergeShorthands(staticConfig, tamaguiConfig);
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
767
|
+
if (tamaguiConfig.animations) {
|
|
768
|
+
avoidClasses = !!tamaguiConfig.animations.avoidClasses;
|
|
769
|
+
AnimatedText = tamaguiConfig.animations.Text;
|
|
770
|
+
AnimatedView = tamaguiConfig.animations.View;
|
|
771
|
+
}
|
|
772
|
+
if (!initialTheme) {
|
|
773
|
+
const next = conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]];
|
|
774
|
+
initialTheme = proxyThemeVariables(next);
|
|
775
|
+
if (!initialTheme && process.env.NODE_ENV === "development") {
|
|
776
|
+
console.log(`Warning: Missing theme`);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
config = getConfig();
|
|
780
|
+
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
781
|
+
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
782
|
+
if (config.defaultProps && parentNames && staticConfig.componentName) {
|
|
783
|
+
defaultPropsIn = mergeConfigDefaultProps(
|
|
784
|
+
staticConfig.componentName,
|
|
785
|
+
defaultPropsIn,
|
|
786
|
+
config.defaultProps,
|
|
787
|
+
parentNames,
|
|
788
|
+
conf
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
const debug = defaultPropsIn["debug"];
|
|
792
|
+
if (process.env.NODE_ENV === "development" && debug === "break") {
|
|
793
|
+
debugger;
|
|
794
|
+
}
|
|
795
|
+
const [parentProps, parentClassNames] = mergeProps(defaultPropsIn, {}, true);
|
|
796
|
+
initialSplitStyles = insertSplitStyles(
|
|
797
|
+
parentProps,
|
|
798
|
+
staticConfig,
|
|
799
|
+
initialTheme,
|
|
800
|
+
{
|
|
801
|
+
mounted: true,
|
|
802
|
+
hover: false,
|
|
803
|
+
press: false,
|
|
804
|
+
pressIn: false,
|
|
805
|
+
focus: false,
|
|
806
|
+
resolveVariablesAs: "both",
|
|
807
|
+
noClassNames: !staticConfig.acceptsClassName,
|
|
808
|
+
keepVariantsAsProps: true
|
|
809
|
+
},
|
|
810
|
+
void 0,
|
|
811
|
+
void 0,
|
|
812
|
+
debug
|
|
813
|
+
);
|
|
814
|
+
const [defaults2, defaultsClassnames] = mergeProps(
|
|
815
|
+
component.defaultProps,
|
|
816
|
+
initialSplitStyles.viewProps,
|
|
817
|
+
true
|
|
818
|
+
);
|
|
819
|
+
initialSplitStyles.classNames = {
|
|
820
|
+
...parentClassNames,
|
|
821
|
+
...defaultsClassnames,
|
|
822
|
+
...initialSplitStyles.classNames
|
|
495
823
|
};
|
|
496
824
|
defaultNativeStyle = {};
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
825
|
+
const validStyles2 = staticConfig.validStyles || stylePropsView;
|
|
826
|
+
if (!isWeb) {
|
|
827
|
+
for (const key in staticConfig.defaultProps) {
|
|
828
|
+
const val = staticConfig.defaultProps[key];
|
|
829
|
+
if (validPseudoKeys[key])
|
|
830
|
+
continue;
|
|
831
|
+
if (typeof val === "string" && val[0] === "$" || !validStyles2[key]) {
|
|
832
|
+
defaults2[key] = val;
|
|
833
|
+
} else {
|
|
834
|
+
defaultNativeStyle[key] = val;
|
|
835
|
+
}
|
|
504
836
|
}
|
|
505
837
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
});
|
|
509
|
-
if (Object.keys(defaults).length) {
|
|
510
|
-
tamaguiDefaultProps = defaults;
|
|
838
|
+
if (Object.keys(defaults2).length) {
|
|
839
|
+
tamaguiDefaultProps = defaults2;
|
|
511
840
|
}
|
|
512
|
-
if (process.env.NODE_ENV === "development" &&
|
|
841
|
+
if (process.env.NODE_ENV === "development" && debug) {
|
|
513
842
|
if (process.env.IS_STATIC !== "is_static") {
|
|
514
843
|
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
515
844
|
staticConfig,
|
|
516
845
|
initialSplitStyles,
|
|
517
846
|
tamaguiDefaultProps,
|
|
518
847
|
defaultNativeStyle,
|
|
519
|
-
defaults
|
|
848
|
+
defaults: defaults2,
|
|
849
|
+
defaultPropsIn
|
|
520
850
|
});
|
|
521
851
|
}
|
|
522
852
|
}
|
|
@@ -525,41 +855,46 @@ function createComponent(configIn, ParentComponent) {
|
|
|
525
855
|
if (configIn.memo) {
|
|
526
856
|
res = memo(res);
|
|
527
857
|
}
|
|
528
|
-
res
|
|
858
|
+
res.staticConfig = {
|
|
529
859
|
validStyles: staticConfig.validStyles || stylePropsView,
|
|
530
860
|
...staticConfig
|
|
531
861
|
};
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
|
|
862
|
+
res.extractable = (Component, conf) => {
|
|
863
|
+
Component.staticConfig = extendStaticConfig(
|
|
864
|
+
{
|
|
865
|
+
Component,
|
|
866
|
+
...conf,
|
|
867
|
+
neverFlatten: true,
|
|
868
|
+
isHOC: true,
|
|
869
|
+
defaultProps: {
|
|
870
|
+
...Component.defaultProps,
|
|
871
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
res
|
|
875
|
+
);
|
|
545
876
|
return Component;
|
|
546
877
|
};
|
|
547
878
|
return res;
|
|
548
879
|
}
|
|
549
|
-
|
|
880
|
+
const Unspaced = (props) => {
|
|
881
|
+
return props.children;
|
|
882
|
+
};
|
|
883
|
+
Unspaced["isUnspaced"] = true;
|
|
550
884
|
const Spacer = createComponent({
|
|
551
885
|
memo: true,
|
|
552
886
|
componentName: "Spacer",
|
|
887
|
+
validStyles,
|
|
553
888
|
defaultProps: {
|
|
554
889
|
...stackDefaultStyles,
|
|
890
|
+
tag: "span",
|
|
555
891
|
size: true
|
|
556
892
|
},
|
|
557
893
|
variants: {
|
|
558
894
|
size: {
|
|
559
895
|
"...size": (size, { tokens }) => {
|
|
560
|
-
var _a;
|
|
561
896
|
size = size == true ? "$true" : size;
|
|
562
|
-
const sizePx =
|
|
897
|
+
const sizePx = tokens.space[size] ?? size;
|
|
563
898
|
return {
|
|
564
899
|
width: sizePx,
|
|
565
900
|
height: sizePx,
|
|
@@ -570,7 +905,7 @@ const Spacer = createComponent({
|
|
|
570
905
|
},
|
|
571
906
|
flex: {
|
|
572
907
|
true: {
|
|
573
|
-
|
|
908
|
+
flexGrow: 1
|
|
574
909
|
}
|
|
575
910
|
},
|
|
576
911
|
direction: {
|
|
@@ -581,75 +916,242 @@ const Spacer = createComponent({
|
|
|
581
916
|
vertical: {
|
|
582
917
|
width: 0,
|
|
583
918
|
minWidth: 0
|
|
584
|
-
}
|
|
919
|
+
},
|
|
920
|
+
both: {}
|
|
585
921
|
}
|
|
586
922
|
},
|
|
587
923
|
defaultVariants: {
|
|
588
|
-
direction: "
|
|
924
|
+
direction: "both"
|
|
589
925
|
}
|
|
590
926
|
});
|
|
591
927
|
function spacedChildren({
|
|
592
928
|
isZStack,
|
|
593
929
|
children,
|
|
594
930
|
space,
|
|
595
|
-
|
|
596
|
-
spaceFlex
|
|
931
|
+
direction,
|
|
932
|
+
spaceFlex,
|
|
933
|
+
separator
|
|
597
934
|
}) {
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
|
|
935
|
+
const hasSpace = !!(space || spaceFlex);
|
|
936
|
+
const hasSeparator = !(separator === void 0 || separator === null);
|
|
937
|
+
if (!hasSpace && !hasSeparator && !isZStack) {
|
|
938
|
+
return children;
|
|
939
|
+
}
|
|
940
|
+
const childrenList = Children.toArray(children);
|
|
941
|
+
if (childrenList.length <= 1 && !isZStack) {
|
|
602
942
|
return childrenList;
|
|
603
943
|
}
|
|
604
944
|
const final = [];
|
|
605
945
|
for (const [index, child] of childrenList.entries()) {
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
}
|
|
609
|
-
if (!child || child["key"] && !isZStack) {
|
|
946
|
+
const isEmpty = child === null || child === void 0 || Array.isArray(child) && child.length === 0;
|
|
947
|
+
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
610
948
|
final.push(child);
|
|
611
949
|
} else {
|
|
612
|
-
final.push(
|
|
613
|
-
|
|
614
|
-
|
|
950
|
+
final.push(
|
|
951
|
+
/* @__PURE__ */ jsx(Fragment, {
|
|
952
|
+
children: isZStack ? /* @__PURE__ */ jsx(AbsoluteFill, {
|
|
953
|
+
children: child
|
|
954
|
+
}) : child
|
|
955
|
+
}, index)
|
|
956
|
+
);
|
|
957
|
+
}
|
|
958
|
+
if (isUnspaced(child) && index === 0) {
|
|
959
|
+
continue;
|
|
615
960
|
}
|
|
616
|
-
if (
|
|
961
|
+
if (isZStack) {
|
|
617
962
|
continue;
|
|
618
963
|
}
|
|
619
964
|
const next = childrenList[index + 1];
|
|
620
|
-
if (next &&
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
965
|
+
if (next && !isUnspaced(next)) {
|
|
966
|
+
if (separator) {
|
|
967
|
+
if (hasSpace) {
|
|
968
|
+
final.push(
|
|
969
|
+
createSpacer({
|
|
970
|
+
key: `_${index}_before_sep_spacer`,
|
|
971
|
+
direction,
|
|
972
|
+
space,
|
|
973
|
+
spaceFlex
|
|
974
|
+
})
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
final.push(
|
|
978
|
+
React.isValidElement(separator) ? React.cloneElement(separator, { key: `sep_${index}` }) : separator
|
|
979
|
+
);
|
|
980
|
+
if (hasSpace) {
|
|
981
|
+
final.push(
|
|
982
|
+
createSpacer({
|
|
983
|
+
key: `_${index}_after_sep_spacer`,
|
|
984
|
+
direction,
|
|
985
|
+
space,
|
|
986
|
+
spaceFlex
|
|
987
|
+
})
|
|
988
|
+
);
|
|
627
989
|
}
|
|
628
|
-
}
|
|
990
|
+
} else {
|
|
991
|
+
final.push(
|
|
992
|
+
createSpacer({
|
|
993
|
+
key: `_${index}_spacer`,
|
|
994
|
+
direction,
|
|
995
|
+
space,
|
|
996
|
+
spaceFlex
|
|
997
|
+
})
|
|
998
|
+
);
|
|
999
|
+
}
|
|
629
1000
|
}
|
|
630
1001
|
}
|
|
631
1002
|
return final;
|
|
632
1003
|
}
|
|
633
|
-
|
|
1004
|
+
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
1005
|
+
return /* @__PURE__ */ jsx(Spacer, {
|
|
1006
|
+
size: space,
|
|
1007
|
+
direction,
|
|
1008
|
+
...spaceFlex && {
|
|
1009
|
+
flex: spaceFlex
|
|
1010
|
+
}
|
|
1011
|
+
}, key);
|
|
1012
|
+
}
|
|
1013
|
+
function isUnspaced(child) {
|
|
1014
|
+
var _a, _b;
|
|
1015
|
+
return ((_a = child == null ? void 0 : child["type"]) == null ? void 0 : _a["isVisuallyHidden"]) || ((_b = child == null ? void 0 : child["type"]) == null ? void 0 : _b["isUnspaced"]);
|
|
1016
|
+
}
|
|
634
1017
|
function AbsoluteFill(props) {
|
|
635
|
-
return
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
1018
|
+
return /* @__PURE__ */ jsx(View, {
|
|
1019
|
+
pointerEvents: "box-none",
|
|
1020
|
+
style: absoluteFill,
|
|
1021
|
+
children: props.children
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
const absoluteFill = {
|
|
1025
|
+
position: "absolute",
|
|
1026
|
+
top: 0,
|
|
1027
|
+
left: 0,
|
|
1028
|
+
right: 0,
|
|
1029
|
+
bottom: 0
|
|
1030
|
+
};
|
|
1031
|
+
function processIDRefList(idRefList) {
|
|
1032
|
+
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
1033
|
+
}
|
|
1034
|
+
const accessibilityRoleToWebRole = {
|
|
1035
|
+
adjustable: "slider",
|
|
1036
|
+
button: "button",
|
|
1037
|
+
header: "heading",
|
|
1038
|
+
image: "img",
|
|
1039
|
+
imagebutton: null,
|
|
1040
|
+
keyboardkey: null,
|
|
1041
|
+
label: null,
|
|
1042
|
+
link: "link",
|
|
1043
|
+
none: "presentation",
|
|
1044
|
+
search: "search",
|
|
1045
|
+
summary: "region",
|
|
1046
|
+
text: null
|
|
1047
|
+
};
|
|
1048
|
+
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
1049
|
+
const pseudoStyle = pseudos[name];
|
|
1050
|
+
const shouldNestObject = isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
1051
|
+
const defaultPseudoStyle = initialPseudos[name];
|
|
1052
|
+
const style = defaultPseudoStyle ? { ...defaultPseudoStyle, ...pseudoStyle } : pseudoStyle;
|
|
1053
|
+
if (style) {
|
|
1054
|
+
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
const DefaultProps = /* @__PURE__ */ new Map();
|
|
1058
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames, conf) {
|
|
1059
|
+
const len = parentNames.length;
|
|
1060
|
+
let prev;
|
|
1061
|
+
for (let i = 0; i < len; i++) {
|
|
1062
|
+
const n = parentNames[i];
|
|
1063
|
+
if (!n)
|
|
1064
|
+
continue;
|
|
1065
|
+
if (DefaultProps.has(n)) {
|
|
1066
|
+
prev = DefaultProps.get(n);
|
|
1067
|
+
continue;
|
|
1068
|
+
}
|
|
1069
|
+
const props2 = configDefaults[n];
|
|
1070
|
+
if (!props2) {
|
|
1071
|
+
if (prev) {
|
|
1072
|
+
DefaultProps.set(n, prev);
|
|
1073
|
+
}
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
prev = mergeProps(prev || {}, props2, false, conf.inverseShorthands)[0];
|
|
1077
|
+
DefaultProps.set(n, prev);
|
|
1078
|
+
}
|
|
1079
|
+
const ourDefaultsMerged = DefaultProps.get(name);
|
|
1080
|
+
if (ourDefaultsMerged) {
|
|
1081
|
+
return mergeProps(props, ourDefaultsMerged, false, conf.inverseShorthands)[0];
|
|
1082
|
+
}
|
|
1083
|
+
return props;
|
|
1084
|
+
}
|
|
1085
|
+
const defaults = {
|
|
1086
|
+
left: 0,
|
|
1087
|
+
right: 0,
|
|
1088
|
+
top: 0,
|
|
1089
|
+
bottom: 0,
|
|
1090
|
+
opacity: 1,
|
|
1091
|
+
translateX: 0,
|
|
1092
|
+
translateY: 0,
|
|
1093
|
+
skew: 0,
|
|
1094
|
+
skewX: 0,
|
|
1095
|
+
skewY: 0,
|
|
1096
|
+
scale: 1,
|
|
1097
|
+
rotate: "0deg",
|
|
1098
|
+
rotateY: "0deg",
|
|
1099
|
+
rotateX: "0deg"
|
|
1100
|
+
};
|
|
1101
|
+
function ensureBaseHasDefaults(base, ...pseudos) {
|
|
1102
|
+
for (const pseudo of pseudos) {
|
|
1103
|
+
if (!pseudo)
|
|
1104
|
+
continue;
|
|
1105
|
+
for (const key in pseudo) {
|
|
1106
|
+
const val = pseudo[key];
|
|
1107
|
+
if (key === "transform") {
|
|
1108
|
+
if (typeof val === "string") {
|
|
1109
|
+
continue;
|
|
1110
|
+
}
|
|
1111
|
+
for (const t of val) {
|
|
1112
|
+
const tkey = Object.keys(t)[0];
|
|
1113
|
+
const defaultVal = defaults[tkey];
|
|
1114
|
+
const tDefaultVal = { [tkey]: defaultVal };
|
|
1115
|
+
if (!base.transform) {
|
|
1116
|
+
base.transform = [tDefaultVal];
|
|
1117
|
+
} else {
|
|
1118
|
+
if (!base.transform.find((x) => x[tkey])) {
|
|
1119
|
+
base.transform.push(tDefaultVal);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
} else {
|
|
1124
|
+
if (!(key in base)) {
|
|
1125
|
+
base[key] = defaults[key];
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
function merge(base, next) {
|
|
1132
|
+
if (!next.transform || !base.transform) {
|
|
1133
|
+
Object.assign(base, next);
|
|
1134
|
+
return;
|
|
1135
|
+
}
|
|
1136
|
+
const { transform, ...rest } = next;
|
|
1137
|
+
Object.assign(base, rest);
|
|
1138
|
+
for (const t of transform) {
|
|
1139
|
+
const key = Object.keys(t)[0];
|
|
1140
|
+
const existing = base.transform.find((x) => key in x);
|
|
1141
|
+
if (existing) {
|
|
1142
|
+
existing[key] = t[key];
|
|
1143
|
+
} else {
|
|
1144
|
+
base.transform.push(t);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
646
1147
|
}
|
|
647
|
-
__name(AbsoluteFill, "AbsoluteFill");
|
|
648
1148
|
export {
|
|
649
|
-
AbsoluteFill,
|
|
650
1149
|
Spacer,
|
|
1150
|
+
Unspaced,
|
|
1151
|
+
accessibilityRoleToWebRole,
|
|
651
1152
|
createComponent,
|
|
652
1153
|
mouseUps,
|
|
1154
|
+
processIDRefList,
|
|
653
1155
|
spacedChildren
|
|
654
1156
|
};
|
|
655
1157
|
//# sourceMappingURL=createComponent.js.map
|