@tamagui/core 1.0.1-beta.99 → 1.0.1-rc.0
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 +12 -6
- package/dist/cjs/Tamagui.js.map +2 -2
- package/dist/cjs/addTheme.js +77 -0
- package/dist/cjs/addTheme.js.map +7 -0
- package/dist/cjs/{conf.js → config.js} +25 -13
- package/dist/cjs/config.js.map +7 -0
- package/dist/cjs/constants/constants.js +16 -23
- package/dist/cjs/constants/constants.js.map +2 -2
- package/dist/cjs/constants/isDevTools.js +37 -0
- package/dist/cjs/constants/isDevTools.js.map +7 -0
- package/dist/cjs/constants/platform.js +16 -9
- 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/ButtonNestingContext.js +30 -0
- package/dist/cjs/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/cjs/contexts/FontLanguageContext.js +30 -0
- package/dist/cjs/contexts/FontLanguageContext.js.map +7 -0
- package/dist/cjs/contexts/TextAncestorContext.js +30 -0
- 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 +583 -644
- package/dist/cjs/createComponent.js.map +3 -3
- package/dist/cjs/createFont.js +39 -19
- package/dist/cjs/createFont.js.map +2 -2
- package/dist/cjs/createFont.test.js +125 -0
- package/dist/cjs/createFont.test.js.map +7 -0
- package/dist/cjs/createShorthands.js +1 -0
- package/dist/cjs/createShorthands.js.map +2 -2
- package/dist/cjs/createTamagui.js +98 -193
- package/dist/cjs/createTamagui.js.map +3 -3
- package/dist/cjs/createTheme.js +1 -0
- package/dist/cjs/createTheme.js.map +2 -2
- package/dist/cjs/createTokens.js +1 -4
- package/dist/cjs/createTokens.js.map +2 -2
- package/dist/cjs/createTokens.test.js +27 -0
- package/dist/cjs/createTokens.test.js.map +7 -0
- package/dist/cjs/createVariable.js +36 -40
- package/dist/cjs/createVariable.js.map +2 -2
- package/dist/cjs/createVariable.test.js +7 -0
- package/dist/cjs/createVariable.test.js.map +7 -0
- package/dist/cjs/createVariables.js +15 -19
- package/dist/cjs/createVariables.js.map +2 -2
- package/dist/cjs/helpers/RNComponents.js +12 -11
- package/dist/cjs/helpers/RNComponents.js.map +2 -2
- package/dist/cjs/helpers/ThemeManager.js +230 -0
- package/dist/cjs/helpers/ThemeManager.js.map +7 -0
- package/dist/cjs/helpers/ThemeManager.test.js +465 -0
- package/dist/cjs/helpers/ThemeManager.test.js.map +7 -0
- package/dist/cjs/helpers/ThemeManagerContext.js +30 -0
- package/dist/cjs/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/cjs/helpers/areEqualSets.js +1 -0
- package/dist/cjs/helpers/areEqualSets.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js +1 -0
- package/dist/cjs/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/cjs/helpers/cache.js +43 -0
- package/dist/cjs/helpers/cache.js.map +7 -0
- package/dist/cjs/helpers/calc.js +1 -0
- package/dist/cjs/helpers/calc.js.map +3 -3
- package/dist/cjs/helpers/createMediaStyle.js +23 -9
- package/dist/cjs/helpers/createMediaStyle.js.map +2 -2
- package/dist/cjs/helpers/createPropMapper.js +185 -57
- package/dist/cjs/helpers/createPropMapper.js.map +2 -2
- package/dist/cjs/helpers/createProxy.js +43 -0
- package/dist/cjs/helpers/createProxy.js.map +7 -0
- package/dist/cjs/helpers/createShallowUpdate.js +13 -23
- package/dist/cjs/helpers/createShallowUpdate.js.map +2 -2
- package/dist/cjs/helpers/expandStyle.js +9 -30
- package/dist/cjs/helpers/expandStyle.js.map +3 -3
- package/dist/cjs/helpers/expandStyles.js +26 -37
- package/dist/cjs/helpers/expandStyles.js.map +2 -2
- package/dist/cjs/helpers/extendStaticConfig.js +35 -34
- package/dist/cjs/helpers/extendStaticConfig.js.map +2 -2
- package/dist/cjs/helpers/fixNativeShadow.js +1 -0
- 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/getBoundingClientRect.js +37 -0
- package/dist/cjs/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +4 -3
- package/dist/cjs/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/cjs/helpers/getFont.js +7 -2
- package/dist/cjs/helpers/getFont.js.map +2 -2
- package/dist/cjs/helpers/getFontLanguage.js +29 -0
- package/dist/cjs/helpers/getFontLanguage.js.map +7 -0
- package/dist/cjs/helpers/getRect.js +36 -0
- package/dist/cjs/helpers/getRect.js.map +7 -0
- package/dist/cjs/helpers/getSize.js +3 -2
- package/dist/cjs/helpers/getSize.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.js +538 -228
- package/dist/cjs/helpers/getSplitStyles.js.map +3 -3
- package/dist/cjs/helpers/getStackSize.js +1 -0
- package/dist/cjs/helpers/getStackSize.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.js +53 -65
- package/dist/cjs/helpers/getStylesAtomic.js.map +2 -2
- package/dist/cjs/helpers/getStylesAtomic.native.js +1 -0
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/cjs/helpers/getThemeCSSRules.js +107 -0
- package/dist/cjs/helpers/getThemeCSSRules.js.map +7 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.js +31 -0
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +7 -0
- package/dist/cjs/helpers/getVariantExtras.js +50 -7
- package/dist/cjs/helpers/getVariantExtras.js.map +2 -2
- package/dist/cjs/helpers/insertStyleRule.js +53 -28
- package/dist/cjs/helpers/insertStyleRule.js.map +3 -3
- package/dist/cjs/helpers/isObj.js +1 -0
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.js +1 -0
- package/dist/cjs/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/cjs/helpers/isTamaguiElement.js +1 -0
- package/dist/cjs/helpers/isTamaguiElement.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.js +7 -5
- package/dist/cjs/helpers/matchMedia.js.map +2 -2
- package/dist/cjs/helpers/matchMedia.native.js +5 -1
- package/dist/cjs/helpers/matchMedia.native.js.map +2 -2
- package/dist/cjs/helpers/mergeProps.js +19 -14
- package/dist/cjs/helpers/mergeProps.js.map +2 -2
- package/dist/cjs/helpers/mergeTransform.js +12 -8
- package/dist/cjs/helpers/mergeTransform.js.map +2 -2
- package/dist/cjs/helpers/normalizeColor.js +5 -1
- package/dist/cjs/helpers/normalizeColor.js.map +2 -2
- package/dist/cjs/helpers/normalizeValueWithProperty.js +47 -5
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/cjs/helpers/proxyThemeVariables.js +3 -1
- package/dist/cjs/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/cjs/helpers/pseudoDescriptors.js +12 -0
- package/dist/cjs/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/cjs/helpers/registerCSSVariable.js +8 -8
- package/dist/cjs/helpers/registerCSSVariable.js.map +2 -2
- package/dist/cjs/{constants/rnw.js → helpers/startTransition.js} +13 -9
- package/dist/cjs/helpers/startTransition.js.map +7 -0
- package/dist/cjs/helpers/themeable.js +17 -43
- 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/{constants/rnw.native.js → helpers/timer.js} +14 -7
- package/dist/cjs/helpers/timer.js.map +7 -0
- package/dist/cjs/helpers/useShallowSetState.js +49 -0
- package/dist/cjs/helpers/useShallowSetState.js.map +7 -0
- package/dist/cjs/helpers/validate.js +1 -124
- package/dist/cjs/helpers/validate.js.map +3 -3
- package/dist/cjs/helpers/withStaticProperties.js +1 -0
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.js +37 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/cjs/hooks/useConstant.js +4 -0
- package/dist/cjs/hooks/useConstant.js.map +2 -2
- package/dist/cjs/hooks/useElementLayout.js +84 -0
- package/dist/cjs/hooks/useElementLayout.js.map +7 -0
- package/dist/cjs/hooks/useId.js +3 -32
- package/dist/cjs/hooks/useId.js.map +2 -2
- package/dist/cjs/hooks/useIsMounted.js +1 -0
- package/dist/cjs/hooks/useIsMounted.js.map +1 -1
- package/dist/cjs/hooks/useIsSSR.js +46 -0
- package/dist/cjs/hooks/useIsSSR.js.map +7 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +4 -9
- package/dist/cjs/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/cjs/hooks/useMedia.js +165 -120
- package/dist/cjs/hooks/useMedia.js.map +3 -3
- package/dist/cjs/hooks/usePressable.js +2 -15
- package/dist/cjs/hooks/usePressable.js.map +1 -1
- package/dist/cjs/hooks/useSafeRef.js +58 -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 +182 -163
- package/dist/cjs/hooks/useTheme.js.map +3 -3
- package/dist/cjs/hooks/useThemeName.js +52 -0
- package/dist/cjs/hooks/useThemeName.js.map +7 -0
- package/dist/cjs/hooks/useUnmountEffect.js +1 -0
- package/dist/cjs/hooks/useUnmountEffect.js.map +1 -1
- package/dist/cjs/index.js +41 -30
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/inject-styles.js +40 -0
- package/dist/cjs/inject-styles.js.map +7 -0
- package/dist/cjs/injectStyles.js +40 -0
- package/dist/cjs/injectStyles.js.map +7 -0
- package/dist/cjs/insertFont.js +19 -15
- package/dist/cjs/insertFont.js.map +2 -2
- package/dist/cjs/setupReactNative.js +50 -0
- package/dist/cjs/setupReactNative.js.map +7 -0
- package/dist/cjs/static.js +2 -17
- package/dist/cjs/static.js.map +2 -2
- package/dist/cjs/styled.js +30 -49
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types-rnw.js +1 -0
- package/dist/cjs/types-rnw.js.map +1 -1
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/{helpers/cssHash.js → updateTheme.js} +23 -26
- package/dist/cjs/updateTheme.js.map +7 -0
- package/dist/cjs/{Pressability.js → vendor/Pressability.js} +6 -2
- package/dist/cjs/vendor/Pressability.js.map +7 -0
- package/dist/cjs/{Pressability.native.js → vendor/Pressability.native.js} +6 -2
- 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 +49 -52
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Stack.js +4 -19
- package/dist/cjs/views/Stack.js.map +2 -2
- package/dist/cjs/views/TamaguiProvider.js +83 -0
- package/dist/cjs/views/TamaguiProvider.js.map +7 -0
- package/dist/cjs/views/Text.js +32 -29
- package/dist/cjs/views/Text.js.map +2 -2
- package/dist/cjs/views/Theme.js +55 -23
- package/dist/cjs/views/Theme.js.map +3 -3
- package/dist/cjs/views/ThemeInverse.js +22 -20
- package/dist/cjs/views/ThemeInverse.js.map +2 -2
- package/dist/cjs/views/ThemeProvider.js +14 -27
- package/dist/cjs/views/ThemeProvider.js.map +3 -3
- package/dist/cjs/views/ThemeReset.js +11 -5
- package/dist/cjs/views/ThemeReset.js.map +3 -3
- package/dist/esm/Tamagui.js +7 -5
- package/dist/esm/Tamagui.js.map +2 -2
- package/dist/esm/addTheme.js +53 -0
- package/dist/esm/addTheme.js.map +7 -0
- package/dist/esm/{conf.js → config.js} +18 -8
- package/dist/esm/config.js.map +7 -0
- package/dist/esm/constants/constants.js +13 -24
- package/dist/esm/constants/constants.js.map +2 -2
- package/dist/esm/constants/isDevTools.js +13 -0
- package/dist/esm/constants/isDevTools.js.map +7 -0
- package/dist/esm/constants/platform.js +11 -7
- 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/ButtonNestingContext.js +6 -0
- package/dist/esm/contexts/ButtonNestingContext.js.map +7 -0
- package/dist/esm/contexts/FontLanguageContext.js +6 -0
- package/dist/esm/contexts/FontLanguageContext.js.map +7 -0
- package/dist/esm/contexts/TextAncestorContext.js +6 -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 +583 -648
- package/dist/esm/createComponent.js.map +3 -3
- package/dist/esm/createFont.js +38 -19
- package/dist/esm/createFont.js.map +2 -2
- package/dist/esm/createFont.test.js +124 -0
- package/dist/esm/createFont.test.js.map +7 -0
- package/dist/esm/createShorthands.js +0 -0
- package/dist/esm/createShorthands.js.map +2 -2
- package/dist/esm/createTamagui.js +95 -192
- package/dist/esm/createTamagui.js.map +3 -3
- package/dist/esm/createTheme.js +0 -0
- package/dist/esm/createTheme.js.map +2 -2
- package/dist/esm/createTokens.js +0 -4
- package/dist/esm/createTokens.js.map +2 -2
- package/dist/esm/createTokens.test.js +26 -0
- package/dist/esm/createTokens.test.js.map +7 -0
- package/dist/esm/createVariable.js +32 -38
- package/dist/esm/createVariable.js.map +2 -2
- package/dist/esm/createVariable.test.js +6 -0
- package/dist/esm/createVariable.test.js.map +7 -0
- package/dist/esm/createVariables.js +14 -19
- package/dist/esm/createVariables.js.map +2 -2
- package/dist/esm/helpers/RNComponents.js +11 -8
- package/dist/esm/helpers/RNComponents.js.map +2 -2
- package/dist/esm/helpers/ThemeManager.js +186 -0
- package/dist/esm/helpers/ThemeManager.js.map +7 -0
- package/dist/esm/helpers/ThemeManager.test.js +464 -0
- package/dist/esm/helpers/ThemeManager.test.js.map +7 -0
- package/dist/esm/helpers/ThemeManagerContext.js +6 -0
- package/dist/esm/helpers/ThemeManagerContext.js.map +7 -0
- package/dist/esm/helpers/areEqualSets.js +0 -0
- package/dist/esm/helpers/areEqualSets.js.map +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.js.map +1 -1
- package/dist/esm/helpers/assignNativePropsToWeb.native.js +0 -0
- package/dist/esm/helpers/assignNativePropsToWeb.native.js.map +1 -1
- package/dist/esm/helpers/cache.js +18 -0
- package/dist/esm/helpers/cache.js.map +7 -0
- package/dist/esm/helpers/calc.js +0 -0
- package/dist/esm/helpers/calc.js.map +3 -3
- package/dist/esm/helpers/createMediaStyle.js +22 -9
- package/dist/esm/helpers/createMediaStyle.js.map +2 -2
- package/dist/esm/helpers/createPropMapper.js +180 -55
- package/dist/esm/helpers/createPropMapper.js.map +2 -2
- package/dist/esm/helpers/createProxy.js +19 -0
- package/dist/esm/helpers/createProxy.js.map +7 -0
- package/dist/esm/helpers/createShallowUpdate.js +12 -25
- package/dist/esm/helpers/createShallowUpdate.js.map +2 -2
- package/dist/esm/helpers/expandStyle.js +8 -32
- package/dist/esm/helpers/expandStyle.js.map +3 -3
- package/dist/esm/helpers/expandStyles.js +25 -39
- package/dist/esm/helpers/expandStyles.js.map +2 -2
- package/dist/esm/helpers/extendStaticConfig.js +34 -36
- package/dist/esm/helpers/extendStaticConfig.js.map +2 -2
- package/dist/esm/helpers/fixNativeShadow.js +0 -0
- package/dist/esm/helpers/fixNativeShadow.js.map +0 -0
- package/dist/esm/helpers/getAnimationDriver.js +8 -0
- package/dist/esm/helpers/getAnimationDriver.js.map +7 -0
- package/dist/esm/helpers/getBoundingClientRect.js +13 -0
- package/dist/esm/helpers/getBoundingClientRect.js.map +7 -0
- package/dist/esm/helpers/getExpandedShorthands.js +2 -2
- package/dist/esm/helpers/getExpandedShorthands.js.map +2 -2
- package/dist/esm/helpers/getFont.js +6 -2
- package/dist/esm/helpers/getFont.js.map +2 -2
- package/dist/esm/helpers/getFontLanguage.js +5 -0
- package/dist/esm/helpers/getFontLanguage.js.map +7 -0
- package/dist/esm/helpers/getRect.js +12 -0
- package/dist/esm/helpers/getRect.js.map +7 -0
- package/dist/esm/helpers/getSize.js +2 -2
- package/dist/esm/helpers/getSize.js.map +2 -2
- package/dist/esm/helpers/getSplitStyles.js +551 -229
- package/dist/esm/helpers/getSplitStyles.js.map +3 -3
- package/dist/esm/helpers/getStackSize.js +0 -0
- package/dist/esm/helpers/getStackSize.js.map +1 -1
- package/dist/esm/helpers/getStylesAtomic.js +49 -59
- package/dist/esm/helpers/getStylesAtomic.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -0
- package/dist/esm/helpers/getStylesAtomic.native.js.map +2 -2
- package/dist/esm/helpers/getThemeCSSRules.js +83 -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 +47 -6
- package/dist/esm/helpers/getVariantExtras.js.map +2 -2
- package/dist/esm/helpers/insertStyleRule.js +48 -25
- package/dist/esm/helpers/insertStyleRule.js.map +3 -3
- package/dist/esm/helpers/isObj.js +0 -0
- package/dist/esm/helpers/isObj.js.map +0 -0
- package/dist/esm/helpers/isTamaguiComponent.js +0 -0
- package/dist/esm/helpers/isTamaguiComponent.js.map +2 -2
- package/dist/esm/helpers/isTamaguiElement.js +0 -0
- package/dist/esm/helpers/isTamaguiElement.js.map +2 -2
- package/dist/esm/helpers/matchMedia.js +6 -5
- package/dist/esm/helpers/matchMedia.js.map +2 -2
- package/dist/esm/helpers/matchMedia.native.js +0 -0
- package/dist/esm/helpers/matchMedia.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +18 -14
- package/dist/esm/helpers/mergeProps.js.map +2 -2
- package/dist/esm/helpers/mergeTransform.js +8 -6
- package/dist/esm/helpers/mergeTransform.js.map +2 -2
- package/dist/esm/helpers/normalizeColor.js +0 -0
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js +44 -4
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +2 -2
- package/dist/esm/helpers/proxyThemeVariables.js +2 -1
- package/dist/esm/helpers/proxyThemeVariables.js.map +2 -2
- package/dist/esm/helpers/pseudoDescriptors.js +11 -0
- package/dist/esm/helpers/pseudoDescriptors.js.map +2 -2
- package/dist/esm/helpers/registerCSSVariable.js +5 -6
- package/dist/esm/helpers/registerCSSVariable.js.map +2 -2
- package/dist/esm/helpers/startTransition.js +6 -0
- package/dist/esm/helpers/startTransition.js.map +7 -0
- package/dist/esm/helpers/themeable.js +12 -44
- 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/timer.js +11 -0
- package/dist/esm/helpers/timer.js.map +7 -0
- package/dist/esm/helpers/useShallowSetState.js +25 -0
- package/dist/esm/helpers/useShallowSetState.js.map +7 -0
- package/dist/esm/helpers/validate.js +0 -98
- package/dist/esm/helpers/validate.js.map +3 -3
- package/dist/esm/helpers/withStaticProperties.js +0 -0
- package/dist/esm/helpers/withStaticProperties.js.map +0 -0
- package/dist/esm/hooks/getThemeUnwrapped.js +12 -0
- package/dist/esm/hooks/getThemeUnwrapped.js.map +7 -0
- package/dist/esm/hooks/useConstant.js +4 -1
- package/dist/esm/hooks/useConstant.js.map +2 -2
- package/dist/esm/hooks/useElementLayout.js +59 -0
- package/dist/esm/hooks/useElementLayout.js.map +7 -0
- package/dist/esm/hooks/useId.js +1 -28
- package/dist/esm/hooks/useId.js.map +2 -2
- package/dist/esm/hooks/useIsMounted.js +0 -0
- package/dist/esm/hooks/useIsMounted.js.map +1 -1
- package/dist/esm/hooks/useIsSSR.js +22 -0
- package/dist/esm/hooks/useIsSSR.js.map +7 -0
- package/dist/esm/hooks/useIsTouchDevice.js +3 -9
- package/dist/esm/hooks/useIsTouchDevice.js.map +2 -2
- package/dist/esm/hooks/useMedia.js +159 -122
- package/dist/esm/hooks/useMedia.js.map +3 -3
- package/dist/esm/hooks/usePressable.js +1 -16
- package/dist/esm/hooks/usePressable.js.map +1 -1
- package/dist/esm/hooks/useSafeRef.js +34 -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 +178 -162
- package/dist/esm/hooks/useTheme.js.map +3 -3
- package/dist/esm/hooks/useThemeName.js +28 -0
- package/dist/esm/hooks/useThemeName.js.map +7 -0
- package/dist/esm/hooks/useUnmountEffect.js +0 -0
- package/dist/esm/hooks/useUnmountEffect.js.map +1 -1
- package/dist/esm/index.js +37 -22
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/inject-styles.js +16 -0
- package/dist/esm/inject-styles.js.map +7 -0
- package/dist/esm/injectStyles.js +16 -0
- package/dist/esm/injectStyles.js.map +7 -0
- package/dist/esm/insertFont.js +18 -15
- package/dist/esm/insertFont.js.map +2 -2
- package/dist/esm/setupReactNative.js +24 -0
- package/dist/esm/setupReactNative.js.map +7 -0
- package/dist/esm/static.js +1 -17
- package/dist/esm/static.js.map +2 -2
- package/dist/esm/styled.js +29 -51
- 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/{Pressability.js → vendor/Pressability.js} +3 -1
- package/dist/esm/vendor/Pressability.js.map +7 -0
- package/dist/esm/{Pressability.native.js → vendor/Pressability.native.js} +3 -1
- 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 +47 -50
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +3 -21
- package/dist/esm/views/Stack.js.map +2 -2
- package/dist/esm/views/TamaguiProvider.js +53 -0
- package/dist/esm/views/TamaguiProvider.js.map +7 -0
- package/dist/esm/views/Text.js +29 -29
- package/dist/esm/views/Text.js.map +2 -2
- package/dist/esm/views/Theme.js +48 -21
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeInverse.js +20 -15
- package/dist/esm/views/ThemeInverse.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +11 -22
- package/dist/esm/views/ThemeProvider.js.map +2 -2
- package/dist/esm/views/ThemeReset.js +6 -4
- package/dist/esm/views/ThemeReset.js.map +2 -2
- package/package.json +51 -19
- package/reset.css +1 -9
- package/src/Tamagui.ts +48 -0
- package/src/__snapshots__/createTokens.test.ts.snap +877 -0
- package/src/addTheme.ts +65 -0
- package/src/config.ts +52 -0
- package/src/constants/constants.ts +19 -0
- package/src/constants/isDevTools.ts +12 -0
- package/src/contexts/ButtonNestingContext.tsx +3 -0
- package/src/contexts/FontLanguageContext.tsx +5 -0
- package/src/contexts/TextAncestorContext.tsx +3 -0
- package/src/createComponent.tsx +1280 -0
- package/src/createFont.test.ts +129 -0
- package/src/createFont.ts +52 -0
- package/src/createShorthands.ts +7 -0
- package/src/createTamagui.ts +230 -0
- package/src/createTheme.ts +13 -0
- package/src/createTokens.test.ts +29 -0
- package/src/createTokens.ts +35 -0
- package/src/createVariable.test.ts +7 -0
- package/src/createVariable.ts +79 -0
- package/src/createVariables.ts +42 -0
- package/src/helpers/RNComponents.tsx +14 -0
- package/src/helpers/ThemeManager.test.tsx +497 -0
- package/src/helpers/ThemeManager.tsx +252 -0
- package/src/helpers/ThemeManagerContext.tsx +5 -0
- package/src/helpers/cache.ts +18 -0
- package/src/helpers/createMediaStyle.ts +55 -0
- package/src/helpers/createPropMapper.ts +526 -0
- package/src/helpers/createProxy.ts +16 -0
- package/src/helpers/expandStyle.ts +81 -0
- package/src/helpers/expandStyles.ts +106 -0
- package/src/helpers/extendStaticConfig.ts +75 -0
- package/src/helpers/fixNativeShadow.tsx +2 -0
- package/src/helpers/getAnimationDriver.tsx +5 -0
- package/src/helpers/getBoundingClientRect.tsx +7 -0
- package/src/helpers/getExpandedShorthands.ts +15 -0
- package/src/helpers/getFontLanguage.ts +2 -0
- package/src/helpers/getRect.tsx +8 -0
- package/src/helpers/getSize.ts +22 -0
- package/src/helpers/getSplitStyles.tsx +980 -0
- package/src/helpers/getStylesAtomic.native.ts +4 -0
- package/src/helpers/getStylesAtomic.ts +275 -0
- package/src/helpers/getThemeCSSRules.native.ts +3 -0
- package/src/helpers/getThemeCSSRules.ts +112 -0
- package/src/helpers/getVariantExtras.tsx +85 -0
- package/src/helpers/insertStyleRule.tsx +163 -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 +17 -0
- package/src/helpers/mergeProps.ts +56 -0
- package/src/helpers/mergeTransform.ts +23 -0
- package/src/helpers/normalizeColor.ts +53 -0
- package/src/helpers/normalizeValueWithProperty.ts +123 -0
- package/src/helpers/proxyThemeVariables.tsx +15 -0
- package/src/helpers/pseudoDescriptors.ts +40 -0
- package/src/helpers/registerCSSVariable.ts +11 -0
- package/src/helpers/themeable.tsx +44 -0
- package/src/helpers/themes.ts +69 -0
- package/src/helpers/timer.ts +9 -0
- package/src/helpers/useShallowSetState.tsx +29 -0
- package/src/helpers/withStaticProperties.tsx +7 -0
- package/src/hooks/getThemeUnwrapped.tsx +7 -0
- package/src/hooks/useElementLayout.tsx +85 -0
- package/src/hooks/useId.tsx +1 -0
- package/src/hooks/useIsTouchDevice.tsx +6 -0
- package/src/hooks/useMedia.tsx +265 -0
- package/src/hooks/useSafeRef.ts +48 -0
- package/src/hooks/useServerHooks.tsx +12 -0
- package/src/hooks/useTheme.tsx +243 -0
- package/src/hooks/useThemeName.tsx +27 -0
- package/src/index.ts +73 -0
- package/src/inject-styles.ts +20 -0
- package/src/insertFont.ts +70 -0
- package/src/setupReactNative.ts +20 -0
- package/src/static.ts +5 -0
- package/src/styled.tsx +172 -0
- package/src/types-rnw.tsx +162 -0
- package/src/types.tsx +1350 -0
- package/src/updateTheme.ts +26 -0
- package/src/vendor/Pressability.native.tsx +3 -0
- package/src/vendor/Pressability.tsx +2 -0
- package/src/views/FontLanguage.native.tsx +10 -0
- package/src/views/FontLanguage.tsx +18 -0
- package/src/views/FontLanguage.types.ts +13 -0
- package/src/views/Slot.tsx +147 -0
- package/src/views/Stack.tsx +24 -0
- package/src/views/TamaguiProvider.tsx +59 -0
- package/src/views/Text.tsx +87 -0
- package/src/views/Theme.tsx +77 -0
- package/src/views/ThemeProvider.tsx +41 -0
- package/types/Tamagui.d.ts +9 -7
- package/types/addTheme.d.ts +32 -0
- package/types/config.d.ts +46 -0
- package/types/constants/constants.d.ts +14 -3
- package/types/constants/isDevTools.d.ts +2 -0
- package/types/contexts/ButtonNestingContext.d.ts +3 -0
- package/types/contexts/FontLanguageContext.d.ts +5 -0
- package/types/contexts/TextAncestorContext.d.ts +3 -0
- package/types/createComponent.d.ts +1 -24
- package/types/createFont.d.ts +0 -0
- package/types/createFont.test.d.ts +2 -0
- package/types/createShorthands.d.ts +2 -1
- package/types/createTamagui.d.ts +2 -25
- package/types/createTheme.d.ts +1 -1
- package/types/createTokens.d.ts +5 -5
- package/types/createTokens.test.d.ts +2 -0
- package/types/createVariable.d.ts +15 -10
- package/types/createVariable.test.d.ts +2 -0
- package/types/createVariables.d.ts +1 -1
- package/types/helpers/RNComponents.d.ts +1 -1
- package/types/helpers/ThemeManager.d.ts +36 -0
- package/types/helpers/ThemeManager.test.d.ts +2 -0
- package/types/helpers/ThemeManagerContext.d.ts +4 -0
- package/types/helpers/cache.d.ts +12 -0
- package/types/helpers/createMediaStyle.d.ts +2 -4
- package/types/helpers/createPropMapper.d.ts +3 -1
- package/types/helpers/createProxy.d.ts +2 -0
- package/types/helpers/expandStyle.d.ts +4 -0
- package/types/helpers/expandStyles.d.ts +20 -1
- package/types/helpers/extendStaticConfig.d.ts +0 -0
- package/types/helpers/fixNativeShadow.d.ts +0 -0
- package/types/helpers/getAnimationDriver.d.ts +6 -0
- package/types/helpers/getBoundingClientRect.d.ts +2 -0
- package/types/helpers/getExpandedShorthands.d.ts +0 -0
- package/types/helpers/getFontLanguage.d.ts +2 -0
- package/types/helpers/getRect.d.ts +9 -0
- package/types/helpers/getSize.d.ts +0 -0
- package/types/helpers/getSplitStyles.d.ts +32 -16
- package/types/helpers/getStylesAtomic.d.ts +11 -10
- package/types/helpers/getStylesAtomic.native.d.ts +0 -0
- package/types/helpers/getThemeCSSRules.d.ts +8 -0
- package/types/helpers/getThemeCSSRules.native.d.ts +2 -0
- package/types/helpers/getVariantExtras.d.ts +4 -6
- package/types/helpers/insertStyleRule.d.ts +8 -4
- package/types/helpers/isObj.d.ts +0 -0
- package/types/helpers/isTamaguiComponent.d.ts +1 -1
- package/types/helpers/isTamaguiElement.d.ts +5 -1
- package/types/helpers/matchMedia.d.ts +1 -1
- package/types/helpers/matchMedia.native.d.ts +0 -0
- package/types/helpers/mergeProps.d.ts +16 -1
- package/types/helpers/mergeTransform.d.ts +6 -4
- package/types/helpers/normalizeColor.d.ts +0 -0
- package/types/helpers/normalizeValueWithProperty.d.ts +5 -0
- package/types/helpers/proxyThemeVariables.d.ts +0 -0
- package/types/helpers/pseudoDescriptors.d.ts +8 -14
- package/types/helpers/registerCSSVariable.d.ts +3 -3
- package/types/helpers/themeable.d.ts +7 -7
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/timer.d.ts +2 -0
- package/types/helpers/useShallowSetState.d.ts +4 -0
- package/types/helpers/withStaticProperties.d.ts +0 -0
- package/types/hooks/getThemeUnwrapped.d.ts +3 -0
- package/types/hooks/useElementLayout.d.ts +19 -0
- package/types/hooks/useId.d.ts +1 -8
- package/types/hooks/useIsTouchDevice.d.ts +0 -0
- package/types/hooks/useMedia.d.ts +22 -6
- package/types/hooks/useSafeRef.d.ts +4 -0
- package/types/hooks/useServerHooks.d.ts +4 -0
- package/types/hooks/useTheme.d.ts +11 -41
- package/types/hooks/useThemeName.d.ts +5 -0
- package/types/index.d.ts +17 -17
- package/types/inject-styles.d.ts +7 -0
- package/types/insertFont.d.ts +4 -1
- package/types/setupReactNative.d.ts +5 -0
- package/types/static.d.ts +1 -17
- package/types/styled.d.ts +6 -2
- package/types/types-rnw.d.ts +0 -0
- package/types/types.d.ts +298 -89
- package/types/updateTheme.d.ts +30 -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 +4 -4
- package/types/views/Stack.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts +4 -0
- package/types/views/Text.d.ts +1 -1
- package/types/views/Theme.d.ts +4 -3
- package/types/views/ThemeProvider.d.ts +0 -1
- package/dist/cjs/Pressability.js.map +0 -7
- package/dist/cjs/Pressability.native.js.map +0 -7
- package/dist/cjs/ThemeContext.js.map +0 -7
- package/dist/cjs/ThemeManager.js +0 -204
- package/dist/cjs/ThemeManager.js.map +0 -7
- package/dist/cjs/conf.js.map +0 -7
- package/dist/cjs/constants/rnw.js.map +0 -7
- package/dist/cjs/constants/rnw.native.js.map +0 -7
- package/dist/cjs/defaultComponentState.js +0 -1
- package/dist/cjs/helpers/createTamaguiProvider.js +0 -91
- package/dist/cjs/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/cjs/helpers/cssHash.js.map +0 -7
- package/dist/cjs/helpers/getTextSize.js +0 -55
- package/dist/cjs/helpers/getTextSize.js.map +0 -7
- package/dist/cjs/helpers/nativeGestureHandler.native.js.map +0 -7
- package/dist/cjs/helpers/wrapThemeManagerContext.js +0 -37
- package/dist/cjs/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/cjs/hooks/useFeatures.js +0 -230
- 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/views/TextAncestorContext.js +0 -43
- package/dist/cjs/views/TextAncestorContext.js.map +0 -7
- package/dist/esm/Pressability.js.map +0 -7
- package/dist/esm/Pressability.native.js.map +0 -7
- package/dist/esm/ThemeContext.js.map +0 -7
- package/dist/esm/ThemeManager.js +0 -179
- package/dist/esm/ThemeManager.js.map +0 -7
- package/dist/esm/conf.js.map +0 -7
- package/dist/esm/constants/rnw.js +0 -6
- package/dist/esm/constants/rnw.js.map +0 -7
- package/dist/esm/constants/rnw.native.js +0 -5
- package/dist/esm/constants/rnw.native.js.map +0 -7
- package/dist/esm/defaultComponentState.js +0 -1
- package/dist/esm/defaultComponentState.js.map +0 -7
- package/dist/esm/helpers/createTamaguiProvider.js +0 -67
- package/dist/esm/helpers/createTamaguiProvider.js.map +0 -7
- package/dist/esm/helpers/cssHash.js +0 -27
- package/dist/esm/helpers/cssHash.js.map +0 -7
- package/dist/esm/helpers/getTextSize.js +0 -32
- package/dist/esm/helpers/getTextSize.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 -11
- package/dist/esm/helpers/wrapThemeManagerContext.js.map +0 -7
- package/dist/esm/hooks/useFeatures.js +0 -206
- 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/views/TextAncestorContext.js +0 -15
- package/dist/esm/views/TextAncestorContext.js.map +0 -7
- package/types/Pressability.d.ts +0 -2
- package/types/Pressability.native.d.ts +0 -2
- package/types/Tamagui.d.ts.map +0 -1
- package/types/ThemeContext.d.ts +0 -7
- package/types/ThemeContext.d.ts.map +0 -1
- package/types/ThemeManager.d.ts +0 -52
- package/types/ThemeManager.d.ts.map +0 -1
- package/types/conf.d.ts +0 -26
- package/types/conf.d.ts.map +0 -1
- package/types/constants/platform.d.ts +0 -12
- package/types/constants/rnw.d.ts +0 -2
- package/types/constants/rnw.d.ts.map +0 -1
- package/types/constants/rnw.native.d.ts +0 -2
- package/types/contexts/ButtonInsideButtonContext.d.ts +0 -3
- package/types/createComponent.d.ts.map +0 -1
- package/types/createFont.d.ts.map +0 -1
- package/types/createTamagui.d.ts.map +0 -1
- package/types/createTokens.d.ts.map +0 -1
- package/types/defaultComponentState.d.ts +0 -1
- package/types/helpers/areEqualSets.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.d.ts +0 -2
- package/types/helpers/assignNativePropsToWeb.d.ts.map +0 -1
- package/types/helpers/assignNativePropsToWeb.native.d.ts +0 -2
- package/types/helpers/calc.d.ts +0 -12
- package/types/helpers/calc.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 +0 -3
- package/types/helpers/createTamaguiProvider.d.ts +0 -3
- package/types/helpers/createTamaguiProvider.d.ts.map +0 -1
- package/types/helpers/cssHash.d.ts +0 -2
- package/types/helpers/cssHash.d.ts.map +0 -1
- package/types/helpers/expandStyle.d.ts.map +0 -1
- package/types/helpers/expandStyles.d.ts.map +0 -1
- package/types/helpers/extendStaticConfig.d.ts.map +0 -1
- package/types/helpers/getExpandedShorthands.d.ts.map +0 -1
- package/types/helpers/getFont.d.ts +0 -3
- package/types/helpers/getFont.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/getStackSize.d.ts +0 -8
- package/types/helpers/getStackSize.d.ts.map +0 -1
- package/types/helpers/getStylesAtomic.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/isTamaguiComponent.d.ts.map +0 -1
- package/types/helpers/isTamaguiElement.d.ts.map +0 -1
- package/types/helpers/nativeGestureHandler.native.d.ts +0 -2
- package/types/helpers/normalizeColor.d.ts.map +0 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/helpers/validate.d.ts +0 -4
- package/types/helpers/wrapThemeManagerContext.d.ts +0 -3
- package/types/helpers/wrapThemeManagerContext.d.ts.map +0 -1
- package/types/hooks/useConstant.d.ts +0 -2
- package/types/hooks/useFeatures.d.ts +0 -24
- package/types/hooks/useFeatures.d.ts.map +0 -1
- package/types/hooks/useIsMounted.d.ts +0 -3
- package/types/hooks/useMedia.d.ts.map +0 -1
- package/types/hooks/usePressable.d.ts +0 -3
- package/types/hooks/usePrevious.d.ts +0 -1
- package/types/hooks/useTheme.d.ts.map +0 -1
- package/types/hooks/useUnmountEffect.d.ts +0 -2
- package/types/index.d.ts.map +0 -1
- package/types/insertFont.d.ts.map +0 -1
- package/types/static.d.ts.map +0 -1
- package/types/styled.d.ts.map +0 -1
- package/types/types.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 +0 -5
- package/types/views/TextAncestorContext.d.ts.map +0 -1
- package/types/views/Theme.d.ts.map +0 -1
- package/types/views/ThemeInverse.d.ts +0 -10
- package/types/views/ThemeInverse.d.ts.map +0 -1
- package/types/views/ThemeProvider.d.ts.map +0 -1
- package/types/views/ThemeReset.d.ts +0 -4
- package/types/views/ThemeReset.d.ts.map +0 -1
|
@@ -1,38 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __objRest = (source, exclude) => {
|
|
25
|
-
var target = {};
|
|
26
|
-
for (var prop in source)
|
|
27
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
if (source != null && __getOwnPropSymbols)
|
|
30
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
};
|
|
36
8
|
var __export = (target, all) => {
|
|
37
9
|
for (var name in all)
|
|
38
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -45,159 +17,267 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
45
17
|
}
|
|
46
18
|
return to;
|
|
47
19
|
};
|
|
48
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
49
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
50
25
|
var createComponent_exports = {};
|
|
51
26
|
__export(createComponent_exports, {
|
|
52
|
-
AbsoluteFill: () => AbsoluteFill,
|
|
53
27
|
Spacer: () => Spacer,
|
|
54
28
|
Unspaced: () => Unspaced,
|
|
55
|
-
accessibilityRoleToWebRole: () => accessibilityRoleToWebRole,
|
|
56
29
|
createComponent: () => createComponent,
|
|
57
30
|
mouseUps: () => mouseUps,
|
|
58
|
-
processIDRefList: () => processIDRefList,
|
|
59
31
|
spacedChildren: () => spacedChildren
|
|
60
32
|
});
|
|
61
33
|
module.exports = __toCommonJS(createComponent_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var import_compose_refs = require("@tamagui/compose-refs");
|
|
36
|
+
var import_constants = require("@tamagui/constants");
|
|
62
37
|
var import_helpers = require("@tamagui/helpers");
|
|
63
|
-
var
|
|
64
|
-
var import_use_force_update = require("@tamagui/use-force-update");
|
|
38
|
+
var import_react_native_use_responder_events = require("@tamagui/react-native-use-responder-events");
|
|
65
39
|
var import_react = __toESM(require("react"));
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
69
|
-
var
|
|
70
|
-
var import_assignNativePropsToWeb = require("./helpers/assignNativePropsToWeb");
|
|
71
|
-
var import_createPropMapper = require("./helpers/createPropMapper");
|
|
72
|
-
var import_createShallowUpdate = require("./helpers/createShallowUpdate");
|
|
40
|
+
var import_config = require("./config");
|
|
41
|
+
var import_constants2 = require("./constants/constants");
|
|
42
|
+
var import_FontLanguageContext = require("./contexts/FontLanguageContext");
|
|
43
|
+
var import_TextAncestorContext = require("./contexts/TextAncestorContext");
|
|
73
44
|
var import_extendStaticConfig = require("./helpers/extendStaticConfig");
|
|
45
|
+
var import_getRect = require("./helpers/getRect");
|
|
74
46
|
var import_getSplitStyles = require("./helpers/getSplitStyles");
|
|
75
47
|
var import_insertStyleRule = require("./helpers/insertStyleRule");
|
|
76
48
|
var import_mergeProps = require("./helpers/mergeProps");
|
|
77
49
|
var import_proxyThemeVariables = require("./helpers/proxyThemeVariables");
|
|
78
|
-
var
|
|
79
|
-
var
|
|
80
|
-
var import_useIsTouchDevice = require("./hooks/useIsTouchDevice");
|
|
50
|
+
var import_useShallowSetState = require("./helpers/useShallowSetState");
|
|
51
|
+
var import_useElementLayout = require("./hooks/useElementLayout");
|
|
81
52
|
var import_useMedia = require("./hooks/useMedia");
|
|
82
|
-
var
|
|
53
|
+
var import_useServerHooks = require("./hooks/useServerHooks");
|
|
83
54
|
var import_useTheme = require("./hooks/useTheme");
|
|
84
|
-
var import_Pressability = require("./Pressability");
|
|
55
|
+
var import_Pressability = require("./vendor/Pressability");
|
|
85
56
|
var import_Slot = require("./views/Slot");
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
animation: null
|
|
95
|
-
});
|
|
57
|
+
var import_Theme = require("./views/Theme");
|
|
58
|
+
process.env.TAMAGUI_TARGET;
|
|
59
|
+
let defaultComponentState = null;
|
|
60
|
+
let defaultComponentStateMounted = null;
|
|
61
|
+
let tamaguiConfig;
|
|
62
|
+
let AnimatedText;
|
|
63
|
+
let AnimatedView;
|
|
64
|
+
let initialTheme;
|
|
96
65
|
const mouseUps = /* @__PURE__ */ new Set();
|
|
97
66
|
if (typeof document !== "undefined") {
|
|
98
|
-
|
|
99
|
-
mouseUps.forEach((x) => x());
|
|
100
|
-
mouseUps.clear();
|
|
101
|
-
});
|
|
102
|
-
document.addEventListener("touchend", () => {
|
|
103
|
-
mouseUps.forEach((x) => x());
|
|
104
|
-
mouseUps.clear();
|
|
105
|
-
});
|
|
106
|
-
document.addEventListener("touchcancel", () => {
|
|
67
|
+
const cancelTouches = () => {
|
|
107
68
|
mouseUps.forEach((x) => x());
|
|
108
69
|
mouseUps.clear();
|
|
109
|
-
}
|
|
70
|
+
};
|
|
71
|
+
addEventListener("mouseup", cancelTouches);
|
|
72
|
+
addEventListener("touchend", cancelTouches);
|
|
73
|
+
addEventListener("touchcancel", cancelTouches);
|
|
110
74
|
}
|
|
111
75
|
function mergeShorthands({ defaultProps }, { shorthands }) {
|
|
112
|
-
for (const key
|
|
76
|
+
for (const key of Object.keys(defaultProps)) {
|
|
113
77
|
defaultProps[shorthands[key] || key] = defaultProps[key];
|
|
114
78
|
}
|
|
115
79
|
}
|
|
116
|
-
let
|
|
80
|
+
let BaseText;
|
|
81
|
+
let BaseView;
|
|
82
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
83
|
+
const native = require("react-native");
|
|
84
|
+
BaseText = native.Text || native.default.Text;
|
|
85
|
+
BaseView = native.View || native.default.View;
|
|
86
|
+
}
|
|
117
87
|
function createComponent(configIn, ParentComponent) {
|
|
118
88
|
const staticConfig = (() => {
|
|
119
|
-
const
|
|
120
|
-
if ("parsed" in
|
|
121
|
-
return
|
|
89
|
+
const next = (0, import_extendStaticConfig.extendStaticConfig)(configIn, ParentComponent);
|
|
90
|
+
if ("parsed" in next) {
|
|
91
|
+
return next;
|
|
122
92
|
} else {
|
|
123
|
-
return (0, import_extendStaticConfig.parseStaticConfig)(
|
|
93
|
+
return (0, import_extendStaticConfig.parseStaticConfig)(next);
|
|
124
94
|
}
|
|
125
95
|
})();
|
|
126
96
|
const defaultComponentClassName = `is_${staticConfig.componentName}`;
|
|
127
|
-
let tamaguiConfig;
|
|
128
|
-
let AnimatedText;
|
|
129
|
-
let AnimatedView;
|
|
130
|
-
let avoidClasses = true;
|
|
131
97
|
let defaultNativeStyle;
|
|
132
|
-
let defaultNativeStyleSheet;
|
|
133
98
|
let tamaguiDefaultProps;
|
|
134
|
-
let
|
|
99
|
+
let defaultTag;
|
|
135
100
|
const component = (0, import_react.forwardRef)((propsIn, forwardedRef) => {
|
|
136
|
-
var _a, _d, _e, _f;
|
|
101
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
137
102
|
let props;
|
|
138
103
|
if (tamaguiDefaultProps && !propsIn.asChild) {
|
|
139
104
|
props = (0, import_mergeProps.mergeProps)(tamaguiDefaultProps, propsIn)[0];
|
|
140
105
|
} else {
|
|
141
106
|
props = propsIn;
|
|
142
107
|
}
|
|
143
|
-
const
|
|
108
|
+
const debugProp = props["debug"];
|
|
144
109
|
const { Component, isText, isZStack } = staticConfig;
|
|
145
110
|
const componentName = props.componentName || staticConfig.componentName;
|
|
146
111
|
const componentClassName = props.asChild ? "" : props.componentName ? `is_${props.componentName}` : defaultComponentClassName;
|
|
112
|
+
const animationsConfig = tamaguiConfig.animations;
|
|
113
|
+
const useAnimations = animationsConfig == null ? void 0 : animationsConfig.useAnimations;
|
|
114
|
+
const avoidClassesWhileAnimating = animationsConfig.isReactNative;
|
|
115
|
+
const hasEnterStyle = !!props.enterStyle;
|
|
116
|
+
const needsMount = Boolean((import_constants.isWeb ? import_constants.isClient : true) && (hasEnterStyle || props.animation));
|
|
117
|
+
const states = (0, import_useServerHooks.useServerState)(
|
|
118
|
+
needsMount ? defaultComponentState : defaultComponentStateMounted
|
|
119
|
+
);
|
|
120
|
+
const state = propsIn.forceStyle ? { ...states[0], [propsIn.forceStyle]: true } : states[0];
|
|
121
|
+
const setState = states[1];
|
|
122
|
+
const setStateShallow = (0, import_useShallowSetState.useShallowSetState)(setState, debugProp, componentName);
|
|
123
|
+
const stateRef = (0, import_react.useRef)(
|
|
124
|
+
void 0
|
|
125
|
+
);
|
|
126
|
+
stateRef.current ?? (stateRef.current = {});
|
|
127
|
+
const isAnimated = (() => {
|
|
128
|
+
const next = !!(useAnimations && props.animation);
|
|
129
|
+
if (next && !stateRef.current.hasAnimated) {
|
|
130
|
+
stateRef.current.hasAnimated = true;
|
|
131
|
+
}
|
|
132
|
+
return next || stateRef.current.hasAnimated;
|
|
133
|
+
})();
|
|
134
|
+
const usePresence = (_a = tamaguiConfig.animations) == null ? void 0 : _a.usePresence;
|
|
135
|
+
const presence = !import_constants.isRSC && isAnimated ? usePresence() : null;
|
|
136
|
+
if (isAnimated && presence) {
|
|
137
|
+
const presenceState = presence[2];
|
|
138
|
+
if (presenceState) {
|
|
139
|
+
if (state.unmounted && presenceState.enterVariant) {
|
|
140
|
+
props[presenceState.enterVariant] = true;
|
|
141
|
+
}
|
|
142
|
+
if (!presenceState.isPresent && presenceState.exitVariant) {
|
|
143
|
+
props[presenceState.exitVariant] = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const isReactNative = Boolean(
|
|
148
|
+
staticConfig.isReactNative || isAnimated && tamaguiConfig.animations.isReactNative
|
|
149
|
+
);
|
|
147
150
|
if (process.env.NODE_ENV === "development") {
|
|
148
|
-
if (
|
|
151
|
+
if (debugProp) {
|
|
149
152
|
const name = `${componentName || (Component == null ? void 0 : Component.displayName) || (Component == null ? void 0 : Component.name) || "[Unnamed Component]"}`;
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
console.
|
|
154
|
-
if (
|
|
155
|
-
|
|
153
|
+
const type = isReactNative ? "(rnw)" : "";
|
|
154
|
+
const dataIs = propsIn["data-is"] || "";
|
|
155
|
+
const banner = `${name}${dataIs ? ` ${dataIs}` : ""} ${type}`;
|
|
156
|
+
console.group(`%c ${banner}`, "background: yellow;");
|
|
157
|
+
if (!import_constants.isServer) {
|
|
158
|
+
console.log(`state`, state);
|
|
156
159
|
}
|
|
157
160
|
}
|
|
158
161
|
}
|
|
159
|
-
const
|
|
160
|
-
const theme = (0, import_useTheme.useTheme)(props.theme, componentName, props, forceUpdate);
|
|
161
|
-
const statesUsed = (0, import_react.useState)(defaultComponentState);
|
|
162
|
-
const setStateShallow = (0, import_createShallowUpdate.createShallowUpdate)(statesUsed[1]);
|
|
163
|
-
let state = statesUsed[0];
|
|
164
|
-
if (propsIn.forceStyle) {
|
|
165
|
-
state = __spreadProps(__spreadValues({}, state), {
|
|
166
|
-
[propsIn.forceStyle]: true
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
const shouldAvoidClasses = !!(props.animation && avoidClasses);
|
|
162
|
+
const shouldAvoidClasses = !import_constants.isWeb || !!(props.animation && avoidClassesWhileAnimating) || !staticConfig.acceptsClassName;
|
|
170
163
|
const shouldForcePseudo = !!propsIn.forceStyle;
|
|
171
|
-
const
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
resolveVariablesAs: "value"
|
|
164
|
+
const noClassNames = shouldAvoidClasses || shouldForcePseudo;
|
|
165
|
+
const theme = (0, import_useTheme.useTheme)({
|
|
166
|
+
name: props.theme,
|
|
167
|
+
componentName,
|
|
168
|
+
reset: props.reset,
|
|
169
|
+
inverse: props.themeInverse,
|
|
170
|
+
disable: props["data-themeable"],
|
|
171
|
+
debug: props.debug
|
|
180
172
|
});
|
|
181
|
-
const
|
|
182
|
-
const
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
173
|
+
const themeManager = (0, import_useTheme.getThemeManager)(theme);
|
|
174
|
+
const themeIsNew = (0, import_useTheme.getThemeIsNewTheme)(theme);
|
|
175
|
+
const shouldSetMounted = needsMount && state.unmounted;
|
|
176
|
+
const setMounted = shouldSetMounted ? () => {
|
|
177
|
+
setTimeout(
|
|
178
|
+
() => {
|
|
179
|
+
setStateShallow({
|
|
180
|
+
unmounted: false
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
import_constants.isWeb ? 10 : 0
|
|
184
|
+
);
|
|
185
|
+
} : void 0;
|
|
186
|
+
const hasTextAncestor = !!(import_constants.isWeb && isText ? (0, import_react.useContext)(import_TextAncestorContext.TextAncestorContext) : false);
|
|
187
|
+
const languageContext = import_constants.isRSC ? null : (0, import_react.useContext)(import_FontLanguageContext.FontLanguageContext);
|
|
188
|
+
const isDisabled = props.disabled ?? ((_b = props.accessibilityState) == null ? void 0 : _b.disabled);
|
|
189
|
+
const isTaggable = !Component || typeof Component === "string";
|
|
190
|
+
const element = import_constants.isWeb ? isTaggable ? props.tag || defaultTag || Component : Component : Component;
|
|
191
|
+
const BaseTextComponent = BaseText || element || "span";
|
|
192
|
+
const BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div");
|
|
193
|
+
let elementType = isText ? (isAnimated ? AnimatedText : null) || BaseTextComponent : (isAnimated ? AnimatedView : null) || BaseViewComponent;
|
|
194
|
+
elementType = Component || elementType;
|
|
195
|
+
const isStringElement = typeof elementType === "string";
|
|
196
|
+
const isExiting = (presence == null ? void 0 : presence[0]) === false;
|
|
197
|
+
const splitStyles = (0, import_getSplitStyles.useSplitStyles)(
|
|
198
|
+
props,
|
|
194
199
|
staticConfig,
|
|
195
200
|
theme,
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
{
|
|
202
|
+
...state,
|
|
203
|
+
noClassNames,
|
|
204
|
+
dynamicStylesInline: noClassNames,
|
|
205
|
+
hasTextAncestor,
|
|
206
|
+
resolveVariablesAs: "value",
|
|
207
|
+
isExiting
|
|
208
|
+
},
|
|
209
|
+
null,
|
|
210
|
+
languageContext || void 0,
|
|
211
|
+
elementType,
|
|
212
|
+
debugProp
|
|
213
|
+
);
|
|
214
|
+
const hostRef = (0, import_useServerHooks.useServerRef)(null);
|
|
215
|
+
const isAnimatedReactNativeWeb = isAnimated && avoidClassesWhileAnimating;
|
|
216
|
+
if (process.env.NODE_ENV === "development") {
|
|
217
|
+
if (!process.env.TAMAGUI_TARGET) {
|
|
218
|
+
console.error(`No process.env.TAMAGUI_TARGET set, please set it to "native" or "web".`);
|
|
219
|
+
}
|
|
220
|
+
if (debugProp) {
|
|
221
|
+
console.groupCollapsed("props");
|
|
222
|
+
console.log("props in", propsIn, "mapped to", props, "in order", Object.keys(props));
|
|
223
|
+
console.log("splitStyles", splitStyles);
|
|
224
|
+
console.log("className", Object.values(splitStyles.classNames));
|
|
225
|
+
if (import_constants.isClient) {
|
|
226
|
+
console.log("ref", hostRef, "(click to view)");
|
|
227
|
+
}
|
|
228
|
+
console.groupEnd();
|
|
229
|
+
if (debugProp === "break") {
|
|
230
|
+
debugger;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const {
|
|
235
|
+
viewProps: viewPropsIn,
|
|
236
|
+
pseudos,
|
|
237
|
+
medias,
|
|
238
|
+
style: splitStylesStyle,
|
|
239
|
+
classNames,
|
|
240
|
+
mediaKeys
|
|
241
|
+
} = splitStyles;
|
|
242
|
+
const propsWithAnimation = props;
|
|
243
|
+
let animationStyles;
|
|
244
|
+
if (!import_constants.isRSC && isAnimated && useAnimations) {
|
|
245
|
+
const animations = useAnimations({
|
|
246
|
+
props: propsWithAnimation,
|
|
247
|
+
style: splitStylesStyle,
|
|
248
|
+
presence,
|
|
249
|
+
state,
|
|
250
|
+
pseudos,
|
|
251
|
+
onDidAnimate: props.onDidAnimate,
|
|
252
|
+
hostRef,
|
|
253
|
+
staticConfig
|
|
254
|
+
});
|
|
255
|
+
if (animations) {
|
|
256
|
+
animationStyles = animations.style;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
260
|
+
const disposers = mediaKeys.map((key) => {
|
|
261
|
+
return (0, import_useMedia.addMediaQueryListener)(key, (next) => {
|
|
262
|
+
setState((prev) => {
|
|
263
|
+
if (prev.mediaState[key] !== next) {
|
|
264
|
+
return {
|
|
265
|
+
...prev,
|
|
266
|
+
mediaState: getMediaStateObject({
|
|
267
|
+
...prev.mediaState,
|
|
268
|
+
[key]: next
|
|
269
|
+
})
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
return prev;
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
return () => {
|
|
277
|
+
disposers.forEach((d) => d());
|
|
278
|
+
};
|
|
279
|
+
}, [mediaKeys.join(",")]);
|
|
280
|
+
const {
|
|
201
281
|
hitSlop,
|
|
202
282
|
asChild,
|
|
203
283
|
children,
|
|
@@ -206,6 +286,7 @@ function createComponent(configIn, ParentComponent) {
|
|
|
206
286
|
onPressOut,
|
|
207
287
|
onHoverIn,
|
|
208
288
|
onHoverOut,
|
|
289
|
+
themeShallow,
|
|
209
290
|
space: spaceProp,
|
|
210
291
|
spaceDirection: _spaceDirection,
|
|
211
292
|
disabled: disabledProp,
|
|
@@ -218,42 +299,13 @@ function createComponent(configIn, ParentComponent) {
|
|
|
218
299
|
forceStyle: _forceStyle,
|
|
219
300
|
onClick,
|
|
220
301
|
theme: _themeProp,
|
|
221
|
-
defaultVariants
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
"hitSlop",
|
|
225
|
-
"asChild",
|
|
226
|
-
"children",
|
|
227
|
-
"onPress",
|
|
228
|
-
"onPressIn",
|
|
229
|
-
"onPressOut",
|
|
230
|
-
"onHoverIn",
|
|
231
|
-
"onHoverOut",
|
|
232
|
-
"space",
|
|
233
|
-
"spaceDirection",
|
|
234
|
-
"disabled",
|
|
235
|
-
"onMouseUp",
|
|
236
|
-
"onMouseDown",
|
|
237
|
-
"onMouseEnter",
|
|
238
|
-
"onMouseLeave",
|
|
239
|
-
"hrefAttrs",
|
|
240
|
-
"separator",
|
|
241
|
-
"forceStyle",
|
|
242
|
-
"onClick",
|
|
243
|
-
"theme",
|
|
244
|
-
"defaultVariants"
|
|
245
|
-
]);
|
|
246
|
-
const isTaggable = !Component || typeof Component === "string";
|
|
247
|
-
const element = import_platform.isWeb ? isTaggable ? tag || Component : Component : Component;
|
|
248
|
-
const BaseTextComponent = !import_platform.isWeb ? import_react_native.Text : element || "span";
|
|
249
|
-
const BaseViewComponent = !import_platform.isWeb ? import_react_native.View : element || (hasTextAncestor ? "span" : "div");
|
|
250
|
-
let elementType = isText ? (isAnimated ? AnimatedText || import_react_native.Text : null) || BaseTextComponent : (isAnimated ? AnimatedView || import_react_native.View : null) || BaseViewComponent;
|
|
251
|
-
elementType = Component || elementType;
|
|
252
|
-
const isStringElement = typeof elementType === "string";
|
|
302
|
+
defaultVariants,
|
|
303
|
+
...nonTamaguiProps
|
|
304
|
+
} = viewPropsIn;
|
|
253
305
|
const disabled = props.accessibilityState != null && props.accessibilityState.disabled === true || props.accessibilityDisabled;
|
|
254
306
|
let viewProps;
|
|
255
|
-
if (process.env.TAMAGUI_TARGET === "web" && !
|
|
256
|
-
const
|
|
307
|
+
if (process.env.TAMAGUI_TARGET === "web" && !isReactNative) {
|
|
308
|
+
const {
|
|
257
309
|
onMoveShouldSetResponder,
|
|
258
310
|
onMoveShouldSetResponderCapture,
|
|
259
311
|
onResponderEnd,
|
|
@@ -270,154 +322,36 @@ function createComponent(configIn, ParentComponent) {
|
|
|
270
322
|
onSelectionChangeShouldSetResponderCapture,
|
|
271
323
|
onStartShouldSetResponder,
|
|
272
324
|
onStartShouldSetResponderCapture,
|
|
273
|
-
nativeID,
|
|
274
|
-
accessibilityActiveDescendant,
|
|
275
|
-
accessibilityAtomic,
|
|
276
|
-
accessibilityAutoComplete,
|
|
277
|
-
accessibilityBusy,
|
|
278
|
-
accessibilityChecked,
|
|
279
|
-
accessibilityColumnCount,
|
|
280
|
-
accessibilityColumnIndex,
|
|
281
|
-
accessibilityColumnSpan,
|
|
282
|
-
accessibilityControls,
|
|
283
|
-
accessibilityCurrent,
|
|
284
|
-
accessibilityDescribedBy,
|
|
285
|
-
accessibilityDetails,
|
|
286
|
-
accessibilityDisabled,
|
|
287
|
-
accessibilityErrorMessage,
|
|
288
|
-
accessibilityExpanded,
|
|
289
|
-
accessibilityFlowTo,
|
|
290
|
-
accessibilityHasPopup,
|
|
291
|
-
accessibilityHidden,
|
|
292
|
-
accessibilityInvalid,
|
|
293
|
-
accessibilityKeyShortcuts,
|
|
294
|
-
accessibilityLabel,
|
|
295
|
-
accessibilityLabelledBy,
|
|
296
|
-
accessibilityLevel,
|
|
297
|
-
accessibilityLiveRegion,
|
|
298
|
-
accessibilityModal,
|
|
299
|
-
accessibilityMultiline,
|
|
300
|
-
accessibilityMultiSelectable,
|
|
301
|
-
accessibilityOrientation,
|
|
302
|
-
accessibilityOwns,
|
|
303
|
-
accessibilityPlaceholder,
|
|
304
|
-
accessibilityPosInSet,
|
|
305
|
-
accessibilityPressed,
|
|
306
|
-
accessibilityReadOnly,
|
|
307
|
-
accessibilityRequired,
|
|
308
|
-
accessibilityRole,
|
|
309
|
-
accessibilityRoleDescription,
|
|
310
|
-
accessibilityRowCount,
|
|
311
|
-
accessibilityRowIndex,
|
|
312
|
-
accessibilityRowSpan,
|
|
313
|
-
accessibilitySelected,
|
|
314
|
-
accessibilitySetSize,
|
|
315
|
-
accessibilitySort,
|
|
316
|
-
accessibilityValueMax,
|
|
317
|
-
accessibilityValueMin,
|
|
318
|
-
accessibilityValueNow,
|
|
319
|
-
accessibilityValueText,
|
|
320
|
-
accessible,
|
|
321
|
-
accessibilityState,
|
|
322
|
-
accessibilityValue,
|
|
323
325
|
collapsable,
|
|
324
326
|
focusable,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
"onResponderGrant",
|
|
331
|
-
"onResponderMove",
|
|
332
|
-
"onResponderReject",
|
|
333
|
-
"onResponderRelease",
|
|
334
|
-
"onResponderStart",
|
|
335
|
-
"onResponderTerminate",
|
|
336
|
-
"onResponderTerminationRequest",
|
|
337
|
-
"onScrollShouldSetResponder",
|
|
338
|
-
"onScrollShouldSetResponderCapture",
|
|
339
|
-
"onSelectionChangeShouldSetResponder",
|
|
340
|
-
"onSelectionChangeShouldSetResponderCapture",
|
|
341
|
-
"onStartShouldSetResponder",
|
|
342
|
-
"onStartShouldSetResponderCapture",
|
|
343
|
-
"nativeID",
|
|
344
|
-
"accessibilityActiveDescendant",
|
|
345
|
-
"accessibilityAtomic",
|
|
346
|
-
"accessibilityAutoComplete",
|
|
347
|
-
"accessibilityBusy",
|
|
348
|
-
"accessibilityChecked",
|
|
349
|
-
"accessibilityColumnCount",
|
|
350
|
-
"accessibilityColumnIndex",
|
|
351
|
-
"accessibilityColumnSpan",
|
|
352
|
-
"accessibilityControls",
|
|
353
|
-
"accessibilityCurrent",
|
|
354
|
-
"accessibilityDescribedBy",
|
|
355
|
-
"accessibilityDetails",
|
|
356
|
-
"accessibilityDisabled",
|
|
357
|
-
"accessibilityErrorMessage",
|
|
358
|
-
"accessibilityExpanded",
|
|
359
|
-
"accessibilityFlowTo",
|
|
360
|
-
"accessibilityHasPopup",
|
|
361
|
-
"accessibilityHidden",
|
|
362
|
-
"accessibilityInvalid",
|
|
363
|
-
"accessibilityKeyShortcuts",
|
|
364
|
-
"accessibilityLabel",
|
|
365
|
-
"accessibilityLabelledBy",
|
|
366
|
-
"accessibilityLevel",
|
|
367
|
-
"accessibilityLiveRegion",
|
|
368
|
-
"accessibilityModal",
|
|
369
|
-
"accessibilityMultiline",
|
|
370
|
-
"accessibilityMultiSelectable",
|
|
371
|
-
"accessibilityOrientation",
|
|
372
|
-
"accessibilityOwns",
|
|
373
|
-
"accessibilityPlaceholder",
|
|
374
|
-
"accessibilityPosInSet",
|
|
375
|
-
"accessibilityPressed",
|
|
376
|
-
"accessibilityReadOnly",
|
|
377
|
-
"accessibilityRequired",
|
|
378
|
-
"accessibilityRole",
|
|
379
|
-
"accessibilityRoleDescription",
|
|
380
|
-
"accessibilityRowCount",
|
|
381
|
-
"accessibilityRowIndex",
|
|
382
|
-
"accessibilityRowSpan",
|
|
383
|
-
"accessibilitySelected",
|
|
384
|
-
"accessibilitySetSize",
|
|
385
|
-
"accessibilitySort",
|
|
386
|
-
"accessibilityValueMax",
|
|
387
|
-
"accessibilityValueMin",
|
|
388
|
-
"accessibilityValueNow",
|
|
389
|
-
"accessibilityValueText",
|
|
390
|
-
"accessible",
|
|
391
|
-
"accessibilityState",
|
|
392
|
-
"accessibilityValue",
|
|
393
|
-
"collapsable",
|
|
394
|
-
"focusable",
|
|
395
|
-
"onLayout"
|
|
396
|
-
]);
|
|
327
|
+
accessible,
|
|
328
|
+
accessibilityDisabled,
|
|
329
|
+
onLayout,
|
|
330
|
+
...webProps
|
|
331
|
+
} = nonTamaguiProps;
|
|
397
332
|
viewProps = webProps;
|
|
398
|
-
(
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
viewProps.ref = setRef;
|
|
333
|
+
if (!import_constants.isRSC) {
|
|
334
|
+
usePlatformMethods(hostRef);
|
|
335
|
+
(0, import_useElementLayout.useElementLayout)(hostRef, onLayout);
|
|
336
|
+
(0, import_react_native_use_responder_events.useResponderEvents)(hostRef, {
|
|
337
|
+
onMoveShouldSetResponder,
|
|
338
|
+
onMoveShouldSetResponderCapture,
|
|
339
|
+
onResponderEnd,
|
|
340
|
+
onResponderGrant,
|
|
341
|
+
onResponderMove,
|
|
342
|
+
onResponderReject,
|
|
343
|
+
onResponderRelease,
|
|
344
|
+
onResponderStart,
|
|
345
|
+
onResponderTerminate,
|
|
346
|
+
onResponderTerminationRequest,
|
|
347
|
+
onScrollShouldSetResponder,
|
|
348
|
+
onScrollShouldSetResponderCapture,
|
|
349
|
+
onSelectionChangeShouldSetResponder,
|
|
350
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
351
|
+
onStartShouldSetResponder,
|
|
352
|
+
onStartShouldSetResponderCapture
|
|
353
|
+
});
|
|
354
|
+
}
|
|
421
355
|
if (props.href != void 0 && hrefAttrs != void 0) {
|
|
422
356
|
const { download, rel, target } = hrefAttrs;
|
|
423
357
|
if (download != null) {
|
|
@@ -449,222 +383,220 @@ function createComponent(configIn, ParentComponent) {
|
|
|
449
383
|
}
|
|
450
384
|
} else {
|
|
451
385
|
viewProps = nonTamaguiProps;
|
|
452
|
-
if (forwardedRef) {
|
|
453
|
-
viewProps.ref = forwardedRef;
|
|
454
|
-
}
|
|
455
386
|
}
|
|
456
|
-
|
|
387
|
+
viewProps.ref = (0, import_compose_refs.useComposedRefs)(hostRef, forwardedRef, setMounted);
|
|
388
|
+
if (process.env.NODE_ENV === "development" && !isText && import_constants.isWeb) {
|
|
457
389
|
import_react.Children.toArray(props.children).forEach((item) => {
|
|
458
390
|
if (typeof item === "string") {
|
|
459
391
|
console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
460
392
|
}
|
|
461
393
|
});
|
|
462
394
|
}
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
};
|
|
395
|
+
const unPress = (0, import_react.useCallback)(() => {
|
|
396
|
+
setStateShallow({
|
|
397
|
+
press: false,
|
|
398
|
+
pressIn: false
|
|
399
|
+
});
|
|
400
|
+
}, [setStateShallow]);
|
|
401
|
+
if (!import_constants.isRSC) {
|
|
402
|
+
(0, import_react.useEffect)(() => {
|
|
403
|
+
return () => {
|
|
404
|
+
mouseUps.delete(unPress);
|
|
405
|
+
};
|
|
406
|
+
}, [unPress]);
|
|
468
407
|
}
|
|
469
|
-
(0, import_platform.useIsomorphicLayoutEffect)(() => {
|
|
470
|
-
if (typeof window !== "undefined" && (hasEnterStyle || props.animation)) {
|
|
471
|
-
setStateShallow({
|
|
472
|
-
mounted: true
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
internal.current.isMounted = true;
|
|
476
|
-
return () => {
|
|
477
|
-
var _a2;
|
|
478
|
-
mouseUps.delete(unPress);
|
|
479
|
-
internal.current.isMounted = false;
|
|
480
|
-
(_a2 = internal.current.unmountEffects) == null ? void 0 : _a2.forEach((cb) => cb());
|
|
481
|
-
};
|
|
482
|
-
}, [hasEnterStyle, props.animation]);
|
|
483
408
|
let styles;
|
|
484
|
-
const animationStyles = state.animation ? state.animation.style : null;
|
|
485
409
|
if (isStringElement && shouldAvoidClasses && !shouldForcePseudo) {
|
|
486
|
-
styles =
|
|
410
|
+
styles = {
|
|
411
|
+
...defaultNativeStyle,
|
|
412
|
+
...animationStyles ?? splitStylesStyle,
|
|
413
|
+
...medias
|
|
414
|
+
};
|
|
487
415
|
} else {
|
|
488
|
-
styles = [
|
|
489
|
-
import_platform.isWeb ? null : defaultNativeStyleSheet ? defaultNativeStyleSheet.base : null,
|
|
490
|
-
animationStyles ?? style,
|
|
491
|
-
medias
|
|
492
|
-
];
|
|
493
|
-
if (!animationStyles) {
|
|
494
|
-
const initPseudos = initialSplitStyles.pseudos;
|
|
495
|
-
const force = shouldForcePseudo;
|
|
496
|
-
!state.mounted && addPseudoToStyles(styles, initPseudos, pseudos, "enterStyle");
|
|
497
|
-
state.hover && addPseudoToStyles(styles, initPseudos, pseudos, "hoverStyle", force);
|
|
498
|
-
state.focus && addPseudoToStyles(styles, initPseudos, pseudos, "focusStyle", force);
|
|
499
|
-
state.press && addPseudoToStyles(styles, initPseudos, pseudos, "pressStyle", force);
|
|
500
|
-
}
|
|
416
|
+
styles = [import_constants.isWeb ? null : defaultNativeStyle, animationStyles ?? splitStylesStyle, medias];
|
|
501
417
|
if (shouldForcePseudo) {
|
|
502
418
|
const next = {};
|
|
503
|
-
|
|
504
|
-
if (style2) {
|
|
505
|
-
Object.assign(next, style2);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
419
|
+
styles.forEach((style) => Object.assign(next, style));
|
|
508
420
|
Object.assign(splitStyles.style, next);
|
|
509
421
|
}
|
|
510
422
|
}
|
|
423
|
+
let fontFamily = isText ? splitStyles.fontFamily || staticConfig.defaultProps.fontFamily : null;
|
|
424
|
+
if (fontFamily && fontFamily[0] === "$") {
|
|
425
|
+
fontFamily = fontFamily.slice(1);
|
|
426
|
+
}
|
|
427
|
+
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "";
|
|
428
|
+
const classList = [
|
|
429
|
+
componentName ? componentClassName : "",
|
|
430
|
+
fontFamilyClassName,
|
|
431
|
+
themeIsNew ? theme.className : "",
|
|
432
|
+
classNames ? Object.values(classNames).join(" ") : ""
|
|
433
|
+
];
|
|
434
|
+
const className = classList.join(" ");
|
|
511
435
|
if (process.env.TAMAGUI_TARGET === "web") {
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
viewProps.dataSet.is = props["data-is"];
|
|
436
|
+
const style = animationStyles ?? splitStyles.style;
|
|
437
|
+
if (isAnimatedReactNativeWeb) {
|
|
438
|
+
viewProps.style = style;
|
|
439
|
+
} else if (isReactNative) {
|
|
440
|
+
const rnwStyle = { $$css: true };
|
|
441
|
+
for (const name of className.split(" ")) {
|
|
442
|
+
rnwStyle[name] = name;
|
|
443
|
+
}
|
|
444
|
+
viewProps.style = [rnwStyle, ...Array.isArray(style) ? style : [style]];
|
|
445
|
+
if (process.env.NODE_ENV === "development") {
|
|
446
|
+
Object.keys(viewProps).forEach((key) => {
|
|
447
|
+
if (key.startsWith("data-")) {
|
|
448
|
+
viewProps.dataSet ?? (viewProps.dataSet = {});
|
|
449
|
+
viewProps.dataSet[key.replace("data-", "")] = viewProps[key];
|
|
450
|
+
delete viewProps[key];
|
|
451
|
+
}
|
|
452
|
+
});
|
|
530
453
|
}
|
|
531
454
|
} else {
|
|
532
455
|
viewProps.className = className;
|
|
456
|
+
viewProps.style = style;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if (process.env.TAMAGUI_TARGET === "native") {
|
|
460
|
+
if (splitStyles.fontFamily) {
|
|
461
|
+
const faceInfo = (_c = tamaguiConfig.fontsParsed[splitStyles.fontFamily]) == null ? void 0 : _c.face;
|
|
462
|
+
if (faceInfo) {
|
|
463
|
+
const [weight, style] = (() => {
|
|
464
|
+
var _a2, _b2;
|
|
465
|
+
let weight2;
|
|
466
|
+
let style2;
|
|
467
|
+
for (let i = styles.length; i >= 0; i--) {
|
|
468
|
+
weight2 ?? (weight2 = (_a2 = styles[i]) == null ? void 0 : _a2.fontWeight);
|
|
469
|
+
style2 ?? (style2 = (_b2 = styles[i]) == null ? void 0 : _b2.fontStyle);
|
|
470
|
+
}
|
|
471
|
+
return [weight2 || "400", style2 || "normal"];
|
|
472
|
+
})();
|
|
473
|
+
const overrideFace = (_e = (_d = faceInfo[weight]) == null ? void 0 : _d[style]) == null ? void 0 : _e.val;
|
|
474
|
+
if (overrideFace) {
|
|
475
|
+
for (const style2 of styles) {
|
|
476
|
+
if (style2 == null ? void 0 : style2.fontFamily) {
|
|
477
|
+
style2.fontFamily = overrideFace;
|
|
478
|
+
delete style2.fontWeight;
|
|
479
|
+
delete style2.fontStyle;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
533
484
|
}
|
|
534
|
-
viewProps.style = style2;
|
|
535
|
-
} else {
|
|
536
485
|
viewProps.style = styles;
|
|
537
486
|
}
|
|
538
|
-
const
|
|
539
|
-
const attachPress = !!(
|
|
540
|
-
const
|
|
541
|
-
const isHoverable =
|
|
542
|
-
const
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
const unPress = (0, import_react.useCallback)(() => {
|
|
549
|
-
if (!internal.current.isMounted)
|
|
550
|
-
return;
|
|
551
|
-
setStateShallow({
|
|
552
|
-
press: false,
|
|
553
|
-
pressIn: false
|
|
554
|
-
});
|
|
555
|
-
}, []);
|
|
556
|
-
const events = shouldAttach ? __spreadValues(__spreadProps(__spreadValues({
|
|
557
|
-
[pressOutKey]: attachPress ? (e) => {
|
|
487
|
+
const runtimePressStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.pressStyle);
|
|
488
|
+
const attachPress = !!(runtimePressStyle || onPress || onPressOut || onPressIn || onClick);
|
|
489
|
+
const runtimeHoverStyle = !disabled && noClassNames && (pseudos == null ? void 0 : pseudos.hoverStyle);
|
|
490
|
+
const isHoverable = import_constants.isWeb && !!(runtimeHoverStyle || onHoverIn || onHoverOut || onMouseEnter || onMouseLeave);
|
|
491
|
+
const handlesPressEvents = !import_constants.isWeb && !asChild;
|
|
492
|
+
const shouldAttach = asChild ? false : Boolean(
|
|
493
|
+
attachPress || isHoverable || "pressStyle" in props || "onPress" in props || "onPressIn" in props || "onPressOut" in props || import_constants.isWeb && ("hoverStyle" in props || "onHoverIn" in props || "onHoverOut" in props || "onMouseEnter" in props || "onMouseLeave" in props)
|
|
494
|
+
);
|
|
495
|
+
const events = shouldAttach && !import_constants.isRSC && !isDisabled ? {
|
|
496
|
+
onPressOut: attachPress ? (e) => {
|
|
558
497
|
unPress();
|
|
559
498
|
onPressOut == null ? void 0 : onPressOut(e);
|
|
560
499
|
onMouseUp == null ? void 0 : onMouseUp(e);
|
|
561
|
-
} : void 0
|
|
562
|
-
}, isHoverable && {
|
|
563
|
-
onMouseEnter: attachHover ? (e) => {
|
|
564
|
-
const next = {};
|
|
565
|
-
if (attachHover) {
|
|
566
|
-
next.hover = true;
|
|
567
|
-
}
|
|
568
|
-
if (state.pressIn) {
|
|
569
|
-
next.press = true;
|
|
570
|
-
}
|
|
571
|
-
if (Object.keys(next).length) {
|
|
572
|
-
setStateShallow(next);
|
|
573
|
-
}
|
|
574
|
-
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
575
|
-
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
576
500
|
} : void 0,
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
501
|
+
...isHoverable && {
|
|
502
|
+
onMouseEnter: isHoverable ? (e) => {
|
|
503
|
+
const next = {};
|
|
504
|
+
if (isHoverable) {
|
|
505
|
+
next.hover = true;
|
|
506
|
+
}
|
|
507
|
+
if (state.pressIn) {
|
|
508
|
+
next.press = true;
|
|
509
|
+
}
|
|
510
|
+
if (isHoverable || state.pressIn) {
|
|
511
|
+
setStateShallow(next);
|
|
512
|
+
}
|
|
513
|
+
onHoverIn == null ? void 0 : onHoverIn(e);
|
|
514
|
+
onMouseEnter == null ? void 0 : onMouseEnter(e);
|
|
515
|
+
} : void 0,
|
|
516
|
+
onMouseLeave: isHoverable ? (e) => {
|
|
517
|
+
const next = {};
|
|
518
|
+
mouseUps.add(unPress);
|
|
519
|
+
if (isHoverable) {
|
|
520
|
+
next.hover = false;
|
|
521
|
+
}
|
|
522
|
+
if (state.pressIn) {
|
|
523
|
+
next.press = false;
|
|
524
|
+
next.pressIn = false;
|
|
525
|
+
}
|
|
526
|
+
if (Object.keys(next).length) {
|
|
527
|
+
setStateShallow(next);
|
|
528
|
+
}
|
|
529
|
+
onHoverOut == null ? void 0 : onHoverOut(e);
|
|
530
|
+
onMouseLeave == null ? void 0 : onMouseLeave(e);
|
|
531
|
+
} : void 0
|
|
532
|
+
},
|
|
533
|
+
onPressIn: attachPress ? (e) => {
|
|
595
534
|
setStateShallow({
|
|
596
535
|
press: true,
|
|
597
|
-
pressIn: true
|
|
536
|
+
pressIn: true,
|
|
537
|
+
hover: false
|
|
598
538
|
});
|
|
599
539
|
onPressIn == null ? void 0 : onPressIn(e);
|
|
600
540
|
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
601
|
-
if (
|
|
541
|
+
if (import_constants.isWeb) {
|
|
602
542
|
mouseUps.add(unPress);
|
|
603
543
|
}
|
|
604
|
-
} :
|
|
605
|
-
|
|
544
|
+
} : void 0,
|
|
545
|
+
onPress: attachPress ? (e) => {
|
|
606
546
|
unPress();
|
|
607
547
|
onClick == null ? void 0 : onClick(e);
|
|
608
548
|
onPress == null ? void 0 : onPress(e);
|
|
609
|
-
} :
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
549
|
+
} : void 0,
|
|
550
|
+
...!import_constants.isWeb && {
|
|
551
|
+
cancelable: !props.rejectResponderTermination,
|
|
552
|
+
disabled: isDisabled,
|
|
553
|
+
hitSlop: props.hitSlop,
|
|
554
|
+
delayLongPress: props.delayLongPress,
|
|
555
|
+
delayPressIn: props.delayPressIn,
|
|
556
|
+
delayPressOut: props.delayPressOut,
|
|
557
|
+
focusable: viewProps.focusable ?? true,
|
|
558
|
+
minPressDuration: 0
|
|
559
|
+
}
|
|
560
|
+
} : null;
|
|
620
561
|
let space = spaceProp;
|
|
621
|
-
if (
|
|
622
|
-
for (const key in
|
|
623
|
-
if (
|
|
624
|
-
continue;
|
|
625
|
-
if (props[key] && props[key].space !== void 0) {
|
|
562
|
+
if (state.mediaState && mediaKeys.length) {
|
|
563
|
+
for (const key in state.mediaState) {
|
|
564
|
+
if (key in state.mediaState && key in props && props[key].space !== void 0) {
|
|
626
565
|
space = props[key].space;
|
|
627
566
|
}
|
|
628
567
|
}
|
|
629
568
|
}
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
569
|
+
const themeShouldReset = Boolean(themeShallow && themeManager && themeIsNew);
|
|
570
|
+
const shouldProvideThemeManager = themeShouldReset || themeManager && themeIsNew;
|
|
571
|
+
if (shouldProvideThemeManager) {
|
|
572
|
+
stateRef.current.hasProvidedThemeManager = true;
|
|
573
|
+
}
|
|
574
|
+
if (themeShouldReset) {
|
|
575
|
+
stateRef.current.themeShouldReset = true;
|
|
576
|
+
}
|
|
577
|
+
const childEls = !children || asChild ? children : (0, import_Theme.wrapThemeManagerContext)(
|
|
578
|
+
spacedChildren({
|
|
579
|
+
separator,
|
|
580
|
+
children,
|
|
581
|
+
space,
|
|
582
|
+
direction: props.spaceDirection || "both",
|
|
583
|
+
isZStack
|
|
584
|
+
}),
|
|
585
|
+
stateRef.current.hasProvidedThemeManager ? themeManager : void 0,
|
|
586
|
+
stateRef.current.themeShouldReset
|
|
587
|
+
);
|
|
637
588
|
let content;
|
|
638
589
|
if (asChild) {
|
|
639
590
|
elementType = import_Slot.Slot;
|
|
640
|
-
viewProps =
|
|
591
|
+
viewProps = {
|
|
592
|
+
...viewProps,
|
|
641
593
|
onPress,
|
|
642
594
|
onPressIn,
|
|
643
595
|
onPressOut
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
if (import_platform.isWeb) {
|
|
647
|
-
const [pressableProps] = (0, import_usePressable.usePressable)(events ? __spreadProps(__spreadValues({
|
|
648
|
-
disabled
|
|
649
|
-
}, hitSlop && {
|
|
650
|
-
hitSlop
|
|
651
|
-
}), {
|
|
652
|
-
onPressOut: events[pressOutKey],
|
|
653
|
-
onPressIn: events[pressInKey],
|
|
654
|
-
onPress: events[pressKey]
|
|
655
|
-
}) : {
|
|
656
|
-
disabled: true
|
|
657
|
-
});
|
|
658
|
-
if (events) {
|
|
659
|
-
if (handlesPressEvents) {
|
|
660
|
-
Object.assign(viewProps, pressableProps);
|
|
661
|
-
} else {
|
|
662
|
-
Object.assign(viewProps, events);
|
|
663
|
-
}
|
|
664
|
-
}
|
|
596
|
+
};
|
|
665
597
|
}
|
|
666
598
|
if (process.env.TAMAGUI_TARGET === "native") {
|
|
667
|
-
const attachFocus = !!
|
|
599
|
+
const attachFocus = !!pseudos.focusStyle;
|
|
668
600
|
if (attachFocus) {
|
|
669
601
|
viewProps.onFocus = (0, import_Slot.mergeEvent)(viewProps.onFocus, () => {
|
|
670
602
|
setStateShallow({ focus: true });
|
|
@@ -673,110 +605,114 @@ function createComponent(configIn, ParentComponent) {
|
|
|
673
605
|
setStateShallow({ focus: false });
|
|
674
606
|
});
|
|
675
607
|
}
|
|
676
|
-
|
|
677
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
678
|
-
const pressability = (0, import_react.useMemo)(() => {
|
|
679
|
-
if (attachPress && events) {
|
|
680
|
-
const pressability2 = new import_Pressability.Pressability(events);
|
|
681
|
-
internal.current.unmountEffects = [
|
|
682
|
-
() => {
|
|
683
|
-
pressability2.reset();
|
|
684
|
-
}
|
|
685
|
-
];
|
|
686
|
-
return pressability2;
|
|
687
|
-
}
|
|
688
|
-
}, []);
|
|
608
|
+
const pressability = (0, import_Pressability.usePressability)(events ? { ...events, hitSlop } : {});
|
|
689
609
|
if (attachPress && events) {
|
|
690
|
-
pressability
|
|
691
|
-
const eventHandlers = pressability.getEventHandlers();
|
|
692
|
-
for (const key in eventHandlers) {
|
|
693
|
-
if (key === "onBlur" || key === "onFocus") {
|
|
694
|
-
continue;
|
|
695
|
-
}
|
|
610
|
+
for (const key in pressability) {
|
|
696
611
|
const og = props[key];
|
|
697
|
-
const val =
|
|
698
|
-
viewProps[key] = og ? (0, import_helpers.composeEventHandlers)(og, val) : val;
|
|
612
|
+
const val = pressability[key];
|
|
613
|
+
viewProps[key] = og && !dontComposePressabilityKeys[key] ? (0, import_helpers.composeEventHandlers)(og, val) : val;
|
|
699
614
|
}
|
|
700
615
|
}
|
|
701
616
|
}
|
|
702
617
|
content = (0, import_react.createElement)(elementType, viewProps, childEls);
|
|
703
618
|
if (process.env.TAMAGUI_TARGET === "web") {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
}), content);
|
|
619
|
+
if (events || isAnimatedReactNativeWeb) {
|
|
620
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
621
|
+
className: (isAnimatedReactNativeWeb ? className : "") + ` _dsp_contents`,
|
|
622
|
+
...events && {
|
|
623
|
+
onMouseEnter: events.onMouseEnter,
|
|
624
|
+
onMouseLeave: events.onMouseLeave,
|
|
625
|
+
onClick: events.onPress,
|
|
626
|
+
onMouseDown: events.onPressIn,
|
|
627
|
+
onMouseUp: events.onPressOut,
|
|
628
|
+
onTouchStart: events.onPressIn,
|
|
629
|
+
onTouchEnd: events.onPressOut
|
|
630
|
+
},
|
|
631
|
+
children: content
|
|
632
|
+
});
|
|
719
633
|
}
|
|
720
634
|
}
|
|
721
|
-
if (process.env.NODE_ENV === "development") {
|
|
722
|
-
if (
|
|
723
|
-
|
|
635
|
+
if (process.env.NODE_ENV === "development" && process.env.DEBUG !== "tamagui") {
|
|
636
|
+
if (debugProp) {
|
|
637
|
+
const element2 = typeof elementType === "string" ? elementType : "Component";
|
|
638
|
+
console.groupCollapsed(`render <${element2} /> with props`, viewProps);
|
|
724
639
|
for (const key in viewProps) {
|
|
725
640
|
console.log(key, viewProps[key]);
|
|
726
641
|
}
|
|
642
|
+
console.log("children", content);
|
|
727
643
|
console.groupEnd();
|
|
728
644
|
if (typeof window !== "undefined") {
|
|
729
|
-
console.log(
|
|
645
|
+
console.log({ state, shouldProvideThemeManager, isAnimated, isAnimatedReactNativeWeb, 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: avoidClassesWhileAnimating, animation: props.animation, style: splitStylesStyle, defaultNativeStyle, ...typeof window !== "undefined" ? { theme, themeClassName: theme.className, staticConfig, tamaguiConfig, events, shouldAvoidClasses, shouldForcePseudo, classNames: Object.fromEntries(Object.entries(classNames).map(([k, v]) => [v, (0, import_insertStyleRule.getAllSelectors)()[v]])) } : null });
|
|
730
646
|
}
|
|
731
647
|
console.groupEnd();
|
|
732
648
|
}
|
|
733
649
|
}
|
|
734
|
-
if (features.elements.length) {
|
|
735
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, features.elements, content);
|
|
736
|
-
}
|
|
737
650
|
return content;
|
|
738
651
|
});
|
|
739
652
|
if (staticConfig.componentName) {
|
|
740
653
|
component.displayName = staticConfig.componentName;
|
|
741
654
|
}
|
|
742
|
-
(0,
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
655
|
+
(0, import_config.onConfiguredOnce)((conf) => {
|
|
656
|
+
if (!tamaguiConfig) {
|
|
657
|
+
tamaguiConfig = conf;
|
|
658
|
+
if (!defaultComponentState) {
|
|
659
|
+
defaultComponentState = {
|
|
660
|
+
hover: false,
|
|
661
|
+
press: false,
|
|
662
|
+
pressIn: false,
|
|
663
|
+
focus: false,
|
|
664
|
+
unmounted: true,
|
|
665
|
+
mediaState: getMediaStateObject((0, import_useMedia.getInitialMediaState)())
|
|
666
|
+
};
|
|
667
|
+
defaultComponentStateMounted = {
|
|
668
|
+
...defaultComponentState,
|
|
669
|
+
unmounted: false
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
if (tamaguiConfig.animations) {
|
|
673
|
+
AnimatedText = tamaguiConfig.animations.Text;
|
|
674
|
+
AnimatedView = tamaguiConfig.animations.View;
|
|
675
|
+
}
|
|
676
|
+
if (!initialTheme) {
|
|
677
|
+
const next = conf.themes[Object.keys(conf.themes)[0]];
|
|
678
|
+
initialTheme = (0, import_proxyThemeVariables.proxyThemeVariables)(next);
|
|
679
|
+
if (process.env.NODE_ENV === "development") {
|
|
680
|
+
if (!initialTheme) {
|
|
681
|
+
console.log(`Warning: Missing theme`);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
746
685
|
}
|
|
747
|
-
tamaguiConfig = conf;
|
|
748
686
|
mergeShorthands(staticConfig, tamaguiConfig);
|
|
749
|
-
avoidClasses = !!((_a = tamaguiConfig.animations) == null ? void 0 : _a.avoidClasses);
|
|
750
|
-
AnimatedText = (_b = tamaguiConfig.animations) == null ? void 0 : _b.Text;
|
|
751
|
-
AnimatedView = (_c = tamaguiConfig == null ? void 0 : tamaguiConfig.animations) == null ? void 0 : _c.View;
|
|
752
|
-
initialTheme = initialTheme || (0, import_proxyThemeVariables.proxyThemeVariables)(conf.themes[conf.defaultTheme || Object.keys(conf.themes)[0]]);
|
|
753
|
-
const config = (0, import_conf.getConfig)();
|
|
754
687
|
let defaultPropsIn = staticConfig.defaultProps || {};
|
|
755
688
|
const parentNames = [...staticConfig.parentNames || [], staticConfig.componentName];
|
|
756
|
-
if (
|
|
757
|
-
defaultPropsIn = mergeConfigDefaultProps(
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
689
|
+
if (tamaguiConfig.defaultProps && parentNames && staticConfig.componentName) {
|
|
690
|
+
defaultPropsIn = mergeConfigDefaultProps(
|
|
691
|
+
staticConfig.componentName,
|
|
692
|
+
defaultPropsIn,
|
|
693
|
+
tamaguiConfig.defaultProps,
|
|
694
|
+
parentNames,
|
|
695
|
+
tamaguiConfig
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
const debug = defaultPropsIn["debug"];
|
|
699
|
+
const [ourProps, ourClassNames] = (0, import_mergeProps.mergeProps)(defaultPropsIn, {});
|
|
700
|
+
if (ourProps.tag) {
|
|
701
|
+
defaultTag = ourProps.tag;
|
|
702
|
+
}
|
|
703
|
+
const noClassNames = !staticConfig.acceptsClassName;
|
|
704
|
+
const { name, variants, defaultVariants, ...restProps } = ourProps;
|
|
705
|
+
const [defaults, defaultsClassnames] = (0, import_mergeProps.mergeProps)(component.defaultProps, {
|
|
706
|
+
...defaultVariants,
|
|
707
|
+
...restProps
|
|
708
|
+
});
|
|
775
709
|
defaultNativeStyle = {};
|
|
776
710
|
const validStyles2 = staticConfig.validStyles || import_helpers.stylePropsView;
|
|
777
|
-
if (!
|
|
711
|
+
if (!import_constants.isWeb) {
|
|
778
712
|
for (const key in staticConfig.defaultProps) {
|
|
779
713
|
const val = staticConfig.defaultProps[key];
|
|
714
|
+
if (import_helpers.validPseudoKeys[key])
|
|
715
|
+
continue;
|
|
780
716
|
if (typeof val === "string" && val[0] === "$" || !validStyles2[key]) {
|
|
781
717
|
defaults[key] = val;
|
|
782
718
|
} else {
|
|
@@ -784,22 +720,10 @@ function createComponent(configIn, ParentComponent) {
|
|
|
784
720
|
}
|
|
785
721
|
}
|
|
786
722
|
}
|
|
787
|
-
|
|
788
|
-
base: defaultNativeStyle
|
|
789
|
-
});
|
|
790
|
-
if (Object.keys(defaults).length) {
|
|
791
|
-
tamaguiDefaultProps = defaults;
|
|
792
|
-
}
|
|
723
|
+
tamaguiDefaultProps = defaults;
|
|
793
724
|
if (process.env.NODE_ENV === "development" && debug) {
|
|
794
725
|
if (process.env.IS_STATIC !== "is_static") {
|
|
795
|
-
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, {
|
|
796
|
-
staticConfig,
|
|
797
|
-
initialSplitStyles,
|
|
798
|
-
tamaguiDefaultProps,
|
|
799
|
-
defaultNativeStyle,
|
|
800
|
-
defaults,
|
|
801
|
-
defaultPropsIn
|
|
802
|
-
});
|
|
726
|
+
console.log(`\u{1F41B} [${staticConfig.componentName || "Component"}]`, { staticConfig, tamaguiDefaultProps, defaultNativeStyle, defaults, defaultPropsIn, defaultPropsKeyOrder: Object.keys(staticConfig.defaultProps), defaultPropsInKeyOrder: Object.keys(defaultPropsIn).map((k) => [k, defaultPropsIn[k]]), ourProps, ourClassNames, defaultsClassnames, defaultTag, noClassNames });
|
|
803
727
|
}
|
|
804
728
|
}
|
|
805
729
|
});
|
|
@@ -807,17 +731,23 @@ function createComponent(configIn, ParentComponent) {
|
|
|
807
731
|
if (configIn.memo) {
|
|
808
732
|
res = (0, import_react.memo)(res);
|
|
809
733
|
}
|
|
810
|
-
res.staticConfig =
|
|
811
|
-
validStyles: staticConfig.validStyles || import_helpers.stylePropsView
|
|
812
|
-
|
|
734
|
+
res.staticConfig = {
|
|
735
|
+
validStyles: staticConfig.validStyles || import_helpers.stylePropsView,
|
|
736
|
+
...staticConfig
|
|
737
|
+
};
|
|
813
738
|
res.extractable = (Component, conf) => {
|
|
814
|
-
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)(
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
739
|
+
Component.staticConfig = (0, import_extendStaticConfig.extendStaticConfig)(
|
|
740
|
+
{
|
|
741
|
+
Component,
|
|
742
|
+
...conf,
|
|
743
|
+
neverFlatten: true,
|
|
744
|
+
defaultProps: {
|
|
745
|
+
...Component.defaultProps,
|
|
746
|
+
...conf == null ? void 0 : conf.defaultProps
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
res
|
|
750
|
+
);
|
|
821
751
|
return Component;
|
|
822
752
|
};
|
|
823
753
|
return res;
|
|
@@ -830,9 +760,11 @@ const Spacer = createComponent({
|
|
|
830
760
|
memo: true,
|
|
831
761
|
componentName: "Spacer",
|
|
832
762
|
validStyles: import_helpers.validStyles,
|
|
833
|
-
defaultProps:
|
|
763
|
+
defaultProps: {
|
|
764
|
+
...import_constants2.stackDefaultStyles,
|
|
765
|
+
tag: "span",
|
|
834
766
|
size: true
|
|
835
|
-
}
|
|
767
|
+
},
|
|
836
768
|
variants: {
|
|
837
769
|
size: {
|
|
838
770
|
"...size": (size, { tokens }) => {
|
|
@@ -862,9 +794,6 @@ const Spacer = createComponent({
|
|
|
862
794
|
},
|
|
863
795
|
both: {}
|
|
864
796
|
}
|
|
865
|
-
},
|
|
866
|
-
defaultVariants: {
|
|
867
|
-
direction: "both"
|
|
868
797
|
}
|
|
869
798
|
});
|
|
870
799
|
function spacedChildren({
|
|
@@ -890,95 +819,73 @@ function spacedChildren({
|
|
|
890
819
|
if (isEmpty || !child || child["key"] && !isZStack) {
|
|
891
820
|
final.push(child);
|
|
892
821
|
} else {
|
|
893
|
-
final.push(
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
822
|
+
final.push(
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, {
|
|
824
|
+
children: isZStack ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AbsoluteFill, {
|
|
825
|
+
children: child
|
|
826
|
+
}) : child
|
|
827
|
+
}, index)
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
if (isUnspaced(child) && index === 0)
|
|
898
831
|
continue;
|
|
899
|
-
|
|
900
|
-
if (isZStack) {
|
|
832
|
+
if (isZStack)
|
|
901
833
|
continue;
|
|
902
|
-
}
|
|
903
834
|
const next = childrenList[index + 1];
|
|
904
835
|
if (next && !isUnspaced(next)) {
|
|
905
836
|
if (separator) {
|
|
906
837
|
if (hasSpace) {
|
|
907
|
-
final.push(
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
838
|
+
final.push(
|
|
839
|
+
createSpacer({
|
|
840
|
+
key: `_${index}_00tmgui`,
|
|
841
|
+
direction,
|
|
842
|
+
space,
|
|
843
|
+
spaceFlex
|
|
844
|
+
})
|
|
845
|
+
);
|
|
913
846
|
}
|
|
914
|
-
final.push(
|
|
847
|
+
final.push(
|
|
848
|
+
import_react.default.isValidElement(separator) ? import_react.default.cloneElement(separator, { key: `sep_${index}` }) : separator
|
|
849
|
+
);
|
|
915
850
|
if (hasSpace) {
|
|
916
|
-
final.push(
|
|
917
|
-
|
|
851
|
+
final.push(
|
|
852
|
+
createSpacer({
|
|
853
|
+
key: `_${index}01tmgui`,
|
|
854
|
+
direction,
|
|
855
|
+
space,
|
|
856
|
+
spaceFlex
|
|
857
|
+
})
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
} else {
|
|
861
|
+
final.push(
|
|
862
|
+
createSpacer({
|
|
863
|
+
key: `_${index}02tmgui`,
|
|
918
864
|
direction,
|
|
919
865
|
space,
|
|
920
866
|
spaceFlex
|
|
921
|
-
})
|
|
922
|
-
|
|
923
|
-
} else {
|
|
924
|
-
final.push(createSpacer({
|
|
925
|
-
key: `_${index}_spacer`,
|
|
926
|
-
direction,
|
|
927
|
-
space,
|
|
928
|
-
spaceFlex
|
|
929
|
-
}));
|
|
867
|
+
})
|
|
868
|
+
);
|
|
930
869
|
}
|
|
931
870
|
}
|
|
932
871
|
}
|
|
933
872
|
return final;
|
|
934
873
|
}
|
|
935
874
|
function createSpacer({ key, direction, space, spaceFlex }) {
|
|
936
|
-
return /* @__PURE__ */
|
|
937
|
-
key,
|
|
875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Spacer, {
|
|
938
876
|
size: space,
|
|
939
|
-
direction
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
877
|
+
direction,
|
|
878
|
+
...typeof spaceFlex !== "undefined" && {
|
|
879
|
+
flex: spaceFlex === true ? 1 : spaceFlex === false ? 0 : spaceFlex
|
|
880
|
+
}
|
|
881
|
+
}, key);
|
|
943
882
|
}
|
|
944
883
|
function isUnspaced(child) {
|
|
945
884
|
var _a, _b;
|
|
946
885
|
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"]);
|
|
947
886
|
}
|
|
948
|
-
function AbsoluteFill(props) {
|
|
949
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react_native.View, {
|
|
950
|
-
pointerEvents: "box-none",
|
|
951
|
-
style: import_react_native.StyleSheet.absoluteFill
|
|
952
|
-
}, props.children);
|
|
953
|
-
}
|
|
954
|
-
function processIDRefList(idRefList) {
|
|
955
|
-
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
956
|
-
}
|
|
957
|
-
const accessibilityRoleToWebRole = {
|
|
958
|
-
adjustable: "slider",
|
|
959
|
-
button: "button",
|
|
960
|
-
header: "heading",
|
|
961
|
-
image: "img",
|
|
962
|
-
imagebutton: null,
|
|
963
|
-
keyboardkey: null,
|
|
964
|
-
label: null,
|
|
965
|
-
link: "link",
|
|
966
|
-
none: "presentation",
|
|
967
|
-
search: "search",
|
|
968
|
-
summary: "region",
|
|
969
|
-
text: null
|
|
970
|
-
};
|
|
971
|
-
function addPseudoToStyles(styles, initialPseudos, pseudos, name, force = false) {
|
|
972
|
-
const pseudoStyle = pseudos[name];
|
|
973
|
-
const shouldNestObject = import_platform.isWeb && name !== "enterStyle" && name !== "exitStyle";
|
|
974
|
-
const defaultPseudoStyle = initialPseudos[name];
|
|
975
|
-
const style = defaultPseudoStyle ? __spreadValues(__spreadValues({}, defaultPseudoStyle), pseudoStyle) : pseudoStyle;
|
|
976
|
-
if (style) {
|
|
977
|
-
styles.push(shouldNestObject && !force ? { [name]: style } : style);
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
887
|
const DefaultProps = /* @__PURE__ */ new Map();
|
|
981
|
-
function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
888
|
+
function mergeConfigDefaultProps(name, props, configDefaults, parentNames, conf) {
|
|
982
889
|
const len = parentNames.length;
|
|
983
890
|
let prev;
|
|
984
891
|
for (let i = 0; i < len; i++) {
|
|
@@ -996,25 +903,57 @@ function mergeConfigDefaultProps(name, props, configDefaults, parentNames) {
|
|
|
996
903
|
}
|
|
997
904
|
continue;
|
|
998
905
|
}
|
|
999
|
-
prev = (0, import_mergeProps.mergeProps)(prev || {}, props2)[0];
|
|
1000
|
-
console.log("set prev", prev);
|
|
906
|
+
prev = (0, import_mergeProps.mergeProps)(prev || {}, props2, false, conf.inverseShorthands)[0];
|
|
1001
907
|
DefaultProps.set(n, prev);
|
|
1002
908
|
}
|
|
1003
909
|
const ourDefaultsMerged = DefaultProps.get(name);
|
|
1004
910
|
if (ourDefaultsMerged) {
|
|
1005
|
-
return (0, import_mergeProps.mergeProps)(props, ourDefaultsMerged)[0];
|
|
911
|
+
return (0, import_mergeProps.mergeProps)(props, ourDefaultsMerged, false, conf.inverseShorthands)[0];
|
|
1006
912
|
}
|
|
1007
913
|
return props;
|
|
1008
914
|
}
|
|
915
|
+
function usePlatformMethods(hostRef) {
|
|
916
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
917
|
+
const node = hostRef.current;
|
|
918
|
+
if (!node)
|
|
919
|
+
return;
|
|
920
|
+
node.measure = (callback) => (0, import_useElementLayout.measureLayout)(node, null, callback);
|
|
921
|
+
node.measureLayout = (relativeToNode, success) => (0, import_useElementLayout.measureLayout)(node, relativeToNode, success);
|
|
922
|
+
node.measureInWindow = (callback) => {
|
|
923
|
+
if (!node)
|
|
924
|
+
return;
|
|
925
|
+
setTimeout(() => {
|
|
926
|
+
const { height, left, top, width } = (0, import_getRect.getRect)(node);
|
|
927
|
+
callback(left, top, width, height);
|
|
928
|
+
}, 0);
|
|
929
|
+
};
|
|
930
|
+
}, [hostRef]);
|
|
931
|
+
}
|
|
932
|
+
const AbsoluteFill = createComponent({
|
|
933
|
+
componentName: "AbsoluteFill",
|
|
934
|
+
defaultProps: {
|
|
935
|
+
...import_constants2.stackDefaultStyles,
|
|
936
|
+
flexDirection: "column",
|
|
937
|
+
position: "absolute",
|
|
938
|
+
top: 0,
|
|
939
|
+
right: 0,
|
|
940
|
+
bottom: 0,
|
|
941
|
+
left: 0,
|
|
942
|
+
pointerEvents: "box-none"
|
|
943
|
+
}
|
|
944
|
+
});
|
|
945
|
+
const dontComposePressabilityKeys = {
|
|
946
|
+
onClick: true
|
|
947
|
+
};
|
|
948
|
+
function getMediaStateObject(obj) {
|
|
949
|
+
return Object.fromEntries(Object.entries(obj).flatMap(([k, v]) => v ? [[`$${k}`, v]] : []));
|
|
950
|
+
}
|
|
1009
951
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1010
952
|
0 && (module.exports = {
|
|
1011
|
-
AbsoluteFill,
|
|
1012
953
|
Spacer,
|
|
1013
954
|
Unspaced,
|
|
1014
|
-
accessibilityRoleToWebRole,
|
|
1015
955
|
createComponent,
|
|
1016
956
|
mouseUps,
|
|
1017
|
-
processIDRefList,
|
|
1018
957
|
spacedChildren
|
|
1019
958
|
});
|
|
1020
959
|
//# sourceMappingURL=createComponent.js.map
|