@tamagui/web 1.61.3 → 1.62.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Tamagui.js +10 -26
- package/dist/cjs/Tamagui.js.map +1 -1
- package/dist/cjs/Tamagui.native.js +64 -0
- package/dist/cjs/Tamagui.native.js.map +6 -0
- package/dist/cjs/config.js +25 -64
- package/dist/cjs/config.js.map +2 -2
- package/dist/cjs/config.native.js +90 -0
- package/dist/cjs/config.native.js.map +6 -0
- package/dist/cjs/constants/accessibilityDirectMap.js +41 -51
- package/dist/cjs/constants/accessibilityDirectMap.js.map +1 -1
- package/dist/cjs/constants/accessibilityDirectMap.native.js +9 -16
- package/dist/cjs/constants/accessibilityDirectMap.native.js.map +1 -1
- package/dist/cjs/constants/constants.js +16 -24
- package/dist/cjs/constants/constants.js.map +1 -1
- package/dist/cjs/constants/constants.native.js +32 -0
- package/dist/cjs/constants/constants.native.js.map +6 -0
- package/dist/cjs/constants/isDevTools.js +7 -12
- package/dist/cjs/constants/isDevTools.js.map +1 -1
- package/dist/cjs/constants/isDevTools.native.js +33 -0
- package/dist/cjs/constants/isDevTools.native.js.map +6 -0
- package/dist/cjs/contexts/ComponentContext.js +8 -14
- package/dist/cjs/contexts/ComponentContext.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.native.js +42 -0
- package/dist/cjs/contexts/ComponentContext.native.js.map +6 -0
- package/dist/cjs/createComponent.js +288 -710
- package/dist/cjs/createComponent.js.map +2 -2
- package/dist/cjs/createComponent.native.js +643 -0
- package/dist/cjs/createComponent.native.js.map +6 -0
- package/dist/cjs/createFont.js +18 -29
- package/dist/cjs/createFont.js.map +1 -1
- package/dist/cjs/createFont.native.js +59 -0
- package/dist/cjs/createFont.native.js.map +6 -0
- package/dist/cjs/createShorthands.js +5 -9
- package/dist/cjs/createShorthands.js.map +1 -1
- package/dist/cjs/createShorthands.native.js +28 -0
- package/dist/cjs/createShorthands.native.js.map +6 -0
- package/dist/cjs/createTamagui.js +56 -144
- package/dist/cjs/createTamagui.js.map +2 -2
- package/dist/cjs/createTamagui.native.js +186 -0
- package/dist/cjs/createTamagui.native.js.map +6 -0
- package/dist/cjs/createTheme.js +6 -12
- package/dist/cjs/createTheme.js.map +1 -1
- package/dist/cjs/createTheme.native.js +26 -0
- package/dist/cjs/createTheme.native.js.map +6 -0
- package/dist/cjs/createTokens.js +5 -9
- package/dist/cjs/createTokens.js.map +1 -1
- package/dist/cjs/createTokens.native.js +29 -0
- package/dist/cjs/createTokens.native.js.map +6 -0
- package/dist/cjs/createVariable.js +20 -47
- package/dist/cjs/createVariable.js.map +1 -1
- package/dist/cjs/createVariable.native.js +85 -0
- package/dist/cjs/createVariable.native.js.map +6 -0
- package/dist/cjs/createVariables.js +11 -22
- package/dist/cjs/createVariables.js.map +1 -1
- package/dist/cjs/createVariables.native.js +54 -0
- package/dist/cjs/createVariables.native.js.map +6 -0
- package/dist/cjs/helpers/ThemeManager.js +75 -169
- package/dist/cjs/helpers/ThemeManager.js.map +1 -1
- package/dist/cjs/helpers/ThemeManager.native.js +178 -0
- package/dist/cjs/helpers/ThemeManager.native.js.map +6 -0
- package/dist/cjs/helpers/ThemeManagerContext.js +5 -9
- package/dist/cjs/helpers/ThemeManagerContext.js.map +1 -1
- package/dist/cjs/helpers/ThemeManagerContext.native.js +27 -0
- package/dist/cjs/helpers/ThemeManagerContext.native.js.map +6 -0
- package/dist/cjs/helpers/createChainedWeakCache.js +14 -24
- package/dist/cjs/helpers/createChainedWeakCache.js.map +1 -1
- package/dist/cjs/helpers/createChainedWeakCache.native.js +54 -0
- package/dist/cjs/helpers/createChainedWeakCache.native.js.map +6 -0
- package/dist/cjs/helpers/createMediaStyle.js +20 -70
- package/dist/cjs/helpers/createMediaStyle.js.map +1 -1
- package/dist/cjs/helpers/createMediaStyle.native.js +72 -0
- package/dist/cjs/helpers/createMediaStyle.native.js.map +6 -0
- package/dist/cjs/helpers/createProxy.js +11 -20
- package/dist/cjs/helpers/createProxy.js.map +1 -1
- package/dist/cjs/helpers/createProxy.native.js +35 -0
- package/dist/cjs/helpers/createProxy.native.js.map +6 -0
- package/dist/cjs/helpers/createShallowSetState.js +7 -13
- package/dist/cjs/helpers/createShallowSetState.js.map +1 -1
- package/dist/cjs/helpers/createShallowSetState.native.js +36 -0
- package/dist/cjs/helpers/createShallowSetState.native.js.map +6 -0
- package/dist/cjs/helpers/createStyledContext.js +12 -26
- package/dist/cjs/helpers/createStyledContext.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.js +39 -0
- package/dist/cjs/helpers/createStyledContext.native.js.map +6 -0
- package/dist/cjs/helpers/defaultOffset.js +5 -9
- package/dist/cjs/helpers/defaultOffset.js.map +1 -1
- package/dist/cjs/helpers/defaultOffset.native.js +26 -0
- package/dist/cjs/helpers/defaultOffset.native.js.map +6 -0
- package/dist/cjs/helpers/expandStyle.js +20 -40
- package/dist/cjs/helpers/expandStyle.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.native.js +64 -0
- package/dist/cjs/helpers/expandStyle.native.js.map +6 -0
- package/dist/cjs/helpers/expandStyles.js +13 -39
- package/dist/cjs/helpers/expandStyles.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.native.js +55 -0
- package/dist/cjs/helpers/expandStyles.native.js.map +6 -0
- package/dist/cjs/helpers/getAnimationDriver.js +5 -9
- package/dist/cjs/helpers/getAnimationDriver.js.map +1 -1
- package/dist/cjs/helpers/getAnimationDriver.native.js +29 -0
- package/dist/cjs/helpers/getAnimationDriver.native.js.map +6 -0
- package/dist/cjs/helpers/getExpandedShorthands.js +6 -11
- package/dist/cjs/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/cjs/helpers/getExpandedShorthands.native.js +35 -0
- package/dist/cjs/helpers/getExpandedShorthands.native.js.map +6 -0
- package/dist/cjs/helpers/getFontLanguage.js +5 -9
- package/dist/cjs/helpers/getFontLanguage.js.map +1 -1
- package/dist/cjs/helpers/getFontLanguage.native.js +26 -0
- package/dist/cjs/helpers/getFontLanguage.native.js.map +6 -0
- package/dist/cjs/helpers/getGroupPropParts.js +7 -17
- package/dist/cjs/helpers/getGroupPropParts.js.map +1 -1
- package/dist/cjs/helpers/getGroupPropParts.native.js +32 -0
- package/dist/cjs/helpers/getGroupPropParts.native.js.map +6 -0
- package/dist/cjs/helpers/getSplitStyles.js +364 -827
- package/dist/cjs/helpers/getSplitStyles.js.map +2 -2
- package/dist/cjs/helpers/getSplitStyles.native.js +503 -0
- package/dist/cjs/helpers/getSplitStyles.native.js.map +6 -0
- package/dist/cjs/helpers/getStylesAtomic.js +39 -102
- package/dist/cjs/helpers/getStylesAtomic.js.map +1 -1
- package/dist/cjs/helpers/getStylesAtomic.native.js +6 -13
- package/dist/cjs/helpers/getStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.js +25 -70
- package/dist/cjs/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.native.js +5 -8
- package/dist/cjs/helpers/getThemeCSSRules.native.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.js +13 -26
- package/dist/cjs/helpers/getVariantExtras.js.map +1 -1
- package/dist/cjs/helpers/getVariantExtras.native.js +72 -0
- package/dist/cjs/helpers/getVariantExtras.native.js.map +6 -0
- package/dist/cjs/helpers/insertStyleRule.js +85 -197
- package/dist/cjs/helpers/insertStyleRule.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +223 -0
- package/dist/cjs/helpers/insertStyleRule.native.js.map +6 -0
- package/dist/cjs/helpers/isObj.js +6 -10
- package/dist/cjs/helpers/isObj.js.map +1 -1
- package/dist/cjs/helpers/isObj.native.js +26 -0
- package/dist/cjs/helpers/isObj.native.js.map +6 -0
- package/dist/cjs/helpers/isTamaguiComponent.js +7 -11
- package/dist/cjs/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiComponent.native.js +29 -0
- package/dist/cjs/helpers/isTamaguiComponent.native.js.map +6 -0
- package/dist/cjs/helpers/isTamaguiElement.js +7 -14
- package/dist/cjs/helpers/isTamaguiElement.js.map +1 -1
- package/dist/cjs/helpers/isTamaguiElement.native.js +27 -0
- package/dist/cjs/helpers/isTamaguiElement.native.js.map +6 -0
- package/dist/cjs/helpers/matchMedia.js +8 -12
- package/dist/cjs/helpers/matchMedia.js.map +1 -1
- package/dist/cjs/helpers/matchMedia.native.js +9 -16
- package/dist/cjs/helpers/matchMedia.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.js +10 -18
- package/dist/cjs/helpers/mergeProps.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.native.js +49 -0
- package/dist/cjs/helpers/mergeProps.native.js.map +6 -0
- package/dist/cjs/helpers/mergeVariants.js +16 -30
- package/dist/cjs/helpers/mergeVariants.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.native.js +56 -0
- package/dist/cjs/helpers/mergeVariants.native.js.map +6 -0
- package/dist/cjs/helpers/normalizeColor.js +9 -27
- package/dist/cjs/helpers/normalizeColor.js.map +1 -1
- package/dist/cjs/helpers/normalizeColor.native.js +40 -0
- package/dist/cjs/helpers/normalizeColor.native.js.map +6 -0
- package/dist/cjs/helpers/normalizeShadow.js +6 -12
- package/dist/cjs/helpers/normalizeShadow.js.map +1 -1
- package/dist/cjs/helpers/normalizeShadow.native.js +8 -17
- package/dist/cjs/helpers/normalizeShadow.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.js +5 -9
- package/dist/cjs/helpers/normalizeStylePropKeys.js.map +1 -1
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js +15 -18
- package/dist/cjs/helpers/normalizeStylePropKeys.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.js +22 -63
- package/dist/cjs/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +60 -0
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +6 -0
- package/dist/cjs/helpers/objectIdentityKey.js +9 -14
- package/dist/cjs/helpers/objectIdentityKey.js.map +1 -1
- package/dist/cjs/helpers/objectIdentityKey.native.js +43 -0
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +6 -0
- package/dist/cjs/helpers/propMapper.js +91 -241
- package/dist/cjs/helpers/propMapper.js.map +1 -1
- package/dist/cjs/helpers/propMapper.native.js +201 -0
- package/dist/cjs/helpers/propMapper.native.js.map +6 -0
- package/dist/cjs/helpers/proxyThemeToParents.js +12 -29
- package/dist/cjs/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.native.js +62 -0
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +6 -0
- package/dist/cjs/helpers/proxyThemeVariables.js +6 -10
- package/dist/cjs/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeVariables.native.js +37 -0
- package/dist/cjs/helpers/proxyThemeVariables.native.js.map +6 -0
- package/dist/cjs/helpers/pseudoDescriptors.js +7 -13
- package/dist/cjs/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/cjs/helpers/pseudoDescriptors.native.js +60 -0
- package/dist/cjs/helpers/pseudoDescriptors.native.js.map +6 -0
- package/dist/cjs/helpers/registerCSSVariable.js +6 -14
- package/dist/cjs/helpers/registerCSSVariable.js.map +1 -1
- package/dist/cjs/helpers/registerCSSVariable.native.js +33 -0
- package/dist/cjs/helpers/registerCSSVariable.native.js.map +6 -0
- package/dist/cjs/helpers/themeable.js +15 -27
- package/dist/cjs/helpers/themeable.js.map +1 -1
- package/dist/cjs/helpers/themeable.native.js +56 -0
- package/dist/cjs/helpers/themeable.native.js.map +6 -0
- package/dist/cjs/helpers/themes.js +15 -26
- package/dist/cjs/helpers/themes.js.map +1 -1
- package/dist/cjs/helpers/themes.native.js +38 -0
- package/dist/cjs/helpers/themes.native.js.map +6 -0
- package/dist/cjs/helpers/timer.js +6 -10
- package/dist/cjs/helpers/timer.js.map +1 -1
- package/dist/cjs/helpers/timer.native.js +32 -0
- package/dist/cjs/helpers/timer.native.js.map +6 -0
- package/dist/cjs/helpers/withStaticProperties.js +8 -15
- package/dist/cjs/helpers/withStaticProperties.js.map +1 -1
- package/dist/cjs/helpers/withStaticProperties.native.js +41 -0
- package/dist/cjs/helpers/withStaticProperties.native.js.map +6 -0
- package/dist/cjs/hooks/getThemeUnwrapped.js +6 -13
- package/dist/cjs/hooks/getThemeUnwrapped.js.map +1 -1
- package/dist/cjs/hooks/getThemeUnwrapped.native.js +28 -0
- package/dist/cjs/hooks/getThemeUnwrapped.native.js.map +6 -0
- package/dist/cjs/hooks/useAnimationDriver.js +7 -15
- package/dist/cjs/hooks/useAnimationDriver.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.native.js +27 -0
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +6 -0
- package/dist/cjs/hooks/useId.js +5 -9
- package/dist/cjs/hooks/useId.js.map +1 -1
- package/dist/cjs/hooks/useId.native.js +26 -0
- package/dist/cjs/hooks/useId.native.js.map +6 -0
- package/dist/cjs/hooks/useIsTouchDevice.js +7 -14
- package/dist/cjs/hooks/useIsTouchDevice.js.map +1 -1
- package/dist/cjs/hooks/useIsTouchDevice.native.js +27 -0
- package/dist/cjs/hooks/useIsTouchDevice.native.js.map +6 -0
- package/dist/cjs/hooks/useMedia.js +60 -170
- package/dist/cjs/hooks/useMedia.js.map +2 -2
- package/dist/cjs/hooks/useMedia.native.js +219 -0
- package/dist/cjs/hooks/useMedia.native.js.map +6 -0
- package/dist/cjs/hooks/useMemoDebug.js +7 -17
- package/dist/cjs/hooks/useMemoDebug.js.map +1 -1
- package/dist/cjs/hooks/useMemoDebug.native.js +31 -0
- package/dist/cjs/hooks/useMemoDebug.native.js.map +6 -0
- package/dist/cjs/hooks/useProps.js +7 -11
- package/dist/cjs/hooks/useProps.js.map +1 -1
- package/dist/cjs/hooks/useProps.native.js +32 -0
- package/dist/cjs/hooks/useProps.native.js.map +6 -0
- package/dist/cjs/hooks/useStyle.js +8 -21
- package/dist/cjs/hooks/useStyle.js.map +1 -1
- package/dist/cjs/hooks/useStyle.native.js +48 -0
- package/dist/cjs/hooks/useStyle.native.js.map +6 -0
- package/dist/cjs/hooks/useTheme.js +95 -215
- package/dist/cjs/hooks/useTheme.js.map +1 -1
- package/dist/cjs/hooks/useTheme.native.js +215 -0
- package/dist/cjs/hooks/useTheme.native.js.map +6 -0
- package/dist/cjs/hooks/useThemeName.js +14 -26
- package/dist/cjs/hooks/useThemeName.js.map +1 -1
- package/dist/cjs/hooks/useThemeName.native.js +36 -0
- package/dist/cjs/hooks/useThemeName.native.js.map +6 -0
- package/dist/cjs/index.js +7 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +168 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/cjs/inject-styles.js +7 -15
- package/dist/cjs/inject-styles.js.map +1 -1
- package/dist/cjs/inject-styles.native.js +33 -0
- package/dist/cjs/inject-styles.native.js.map +6 -0
- package/dist/cjs/insertFont.js +25 -49
- package/dist/cjs/insertFont.js.map +1 -1
- package/dist/cjs/insertFont.native.js +69 -0
- package/dist/cjs/insertFont.native.js.map +6 -0
- package/dist/cjs/interfaces/CSSColorNames.js +3 -6
- package/dist/cjs/interfaces/CSSColorNames.js.map +1 -1
- package/dist/cjs/interfaces/CSSColorNames.native.js +15 -0
- package/dist/cjs/interfaces/CSSColorNames.native.js.map +6 -0
- package/dist/cjs/interfaces/GetRef.js +3 -6
- package/dist/cjs/interfaces/GetRef.js.map +1 -1
- package/dist/cjs/interfaces/GetRef.native.js +15 -0
- package/dist/cjs/interfaces/GetRef.native.js.map +6 -0
- package/dist/cjs/interfaces/Role.js +3 -6
- package/dist/cjs/interfaces/Role.js.map +1 -1
- package/dist/cjs/interfaces/Role.native.js +15 -0
- package/dist/cjs/interfaces/Role.native.js.map +6 -0
- package/dist/cjs/setupHooks.js +5 -9
- package/dist/cjs/setupHooks.js.map +1 -1
- package/dist/cjs/setupHooks.native.js +31 -0
- package/dist/cjs/setupHooks.native.js.map +6 -0
- package/dist/cjs/setupReactNative.js +11 -17
- package/dist/cjs/setupReactNative.js.map +1 -1
- package/dist/cjs/setupReactNative.native.js +44 -0
- package/dist/cjs/setupReactNative.native.js.map +6 -0
- package/dist/cjs/styled.js +25 -67
- package/dist/cjs/styled.js.map +1 -1
- package/dist/cjs/styled.native.js +75 -0
- package/dist/cjs/styled.native.js.map +6 -0
- package/dist/cjs/types.js +3 -6
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js +15 -0
- package/dist/cjs/types.native.js.map +6 -0
- package/dist/cjs/views/AnimationDriverProvider.js +7 -14
- package/dist/cjs/views/AnimationDriverProvider.js.map +1 -1
- package/dist/cjs/views/AnimationDriverProvider.native.js +27 -0
- package/dist/cjs/views/AnimationDriverProvider.native.js.map +6 -0
- package/dist/cjs/views/FontLanguage.js +15 -21
- package/dist/cjs/views/FontLanguage.js.map +1 -1
- package/dist/cjs/views/FontLanguage.native.js +6 -11
- package/dist/cjs/views/FontLanguage.native.js.map +1 -1
- package/dist/cjs/views/FontLanguage.types.js +3 -6
- package/dist/cjs/views/FontLanguage.types.js.map +1 -1
- package/dist/cjs/views/FontLanguage.types.native.js +15 -0
- package/dist/cjs/views/FontLanguage.types.native.js.map +6 -0
- package/dist/cjs/views/Slot.js +15 -46
- package/dist/cjs/views/Slot.js.map +2 -2
- package/dist/cjs/views/Slot.native.js +58 -0
- package/dist/cjs/views/Slot.native.js.map +6 -0
- package/dist/cjs/views/Stack.js +7 -13
- package/dist/cjs/views/Stack.js.map +1 -1
- package/dist/cjs/views/Stack.native.js +31 -0
- package/dist/cjs/views/Stack.native.js.map +6 -0
- package/dist/cjs/views/TamaguiProvider.js +16 -38
- package/dist/cjs/views/TamaguiProvider.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.native.js +58 -0
- package/dist/cjs/views/TamaguiProvider.native.js.map +6 -0
- package/dist/cjs/views/Text.js +28 -45
- package/dist/cjs/views/Text.js.map +1 -1
- package/dist/cjs/views/Text.native.js +53 -0
- package/dist/cjs/views/Text.native.js.map +6 -0
- package/dist/cjs/views/Theme.js +41 -89
- package/dist/cjs/views/Theme.js.map +2 -2
- package/dist/cjs/views/Theme.native.js +99 -0
- package/dist/cjs/views/Theme.native.js.map +6 -0
- package/dist/cjs/views/ThemeDebug.js +19 -52
- package/dist/cjs/views/ThemeDebug.js.map +2 -2
- package/dist/cjs/views/ThemeDebug.native.js +5 -8
- package/dist/cjs/views/ThemeDebug.native.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.js +22 -37
- package/dist/cjs/views/ThemeProvider.js.map +1 -1
- package/dist/cjs/views/ThemeProvider.native.js +43 -0
- package/dist/cjs/views/ThemeProvider.native.js.map +6 -0
- package/dist/cjs/views/View.js +7 -12
- package/dist/cjs/views/View.js.map +1 -1
- package/dist/cjs/views/View.native.js +30 -0
- package/dist/cjs/views/View.native.js.map +6 -0
- package/dist/esm/Tamagui.js +2 -9
- package/dist/esm/Tamagui.js.map +1 -1
- package/dist/esm/config.js +20 -55
- package/dist/esm/config.js.map +2 -2
- package/dist/esm/constants/accessibilityDirectMap.js +36 -42
- package/dist/esm/constants/accessibilityDirectMap.js.map +1 -1
- package/dist/esm/constants/constants.js +11 -15
- package/dist/esm/constants/constants.js.map +1 -1
- package/dist/esm/constants/isDevTools.js +2 -3
- package/dist/esm/constants/isDevTools.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.js +3 -5
- package/dist/esm/contexts/ComponentContext.js.map +1 -1
- package/dist/esm/createComponent.js +281 -677
- package/dist/esm/createComponent.js.map +2 -2
- package/dist/esm/createFont.js +13 -20
- package/dist/esm/createFont.js.map +1 -1
- package/dist/esm/createTamagui.js +50 -124
- package/dist/esm/createTamagui.js.map +2 -2
- package/dist/esm/createTheme.js +1 -3
- package/dist/esm/createTheme.js.map +1 -1
- package/dist/esm/createVariable.js +14 -35
- package/dist/esm/createVariable.js.map +1 -1
- package/dist/esm/createVariables.js +5 -11
- package/dist/esm/createVariables.js.map +1 -1
- package/dist/esm/helpers/ThemeManager.js +69 -157
- package/dist/esm/helpers/ThemeManager.js.map +1 -1
- package/dist/esm/helpers/createChainedWeakCache.js +9 -15
- package/dist/esm/helpers/createChainedWeakCache.js.map +1 -1
- package/dist/esm/helpers/createMediaStyle.js +14 -58
- package/dist/esm/helpers/createMediaStyle.js.map +1 -1
- package/dist/esm/helpers/createProxy.js +6 -11
- package/dist/esm/helpers/createProxy.js.map +1 -1
- package/dist/esm/helpers/createShallowSetState.js +2 -4
- package/dist/esm/helpers/createShallowSetState.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.js +7 -15
- package/dist/esm/helpers/createStyledContext.js.map +1 -1
- package/dist/esm/helpers/expandStyle.js +16 -32
- package/dist/esm/helpers/expandStyle.js.map +1 -1
- package/dist/esm/helpers/expandStyles.js +7 -25
- package/dist/esm/helpers/expandStyles.js.map +1 -1
- package/dist/esm/helpers/getExpandedShorthands.js +1 -2
- package/dist/esm/helpers/getExpandedShorthands.js.map +1 -1
- package/dist/esm/helpers/getGroupPropParts.js +2 -8
- package/dist/esm/helpers/getGroupPropParts.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.js +360 -810
- package/dist/esm/helpers/getSplitStyles.js.map +2 -2
- package/dist/esm/helpers/getStylesAtomic.js +33 -88
- package/dist/esm/helpers/getStylesAtomic.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.js +19 -57
- package/dist/esm/helpers/getThemeCSSRules.js.map +1 -1
- package/dist/esm/helpers/getVariantExtras.js +7 -15
- package/dist/esm/helpers/getVariantExtras.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.js +79 -186
- package/dist/esm/helpers/insertStyleRule.js.map +1 -1
- package/dist/esm/helpers/isObj.js +1 -1
- package/dist/esm/helpers/isObj.js.map +1 -1
- package/dist/esm/helpers/isTamaguiComponent.js +2 -2
- package/dist/esm/helpers/isTamaguiComponent.js.map +1 -1
- package/dist/esm/helpers/isTamaguiElement.js +1 -3
- package/dist/esm/helpers/isTamaguiElement.js.map +1 -1
- package/dist/esm/helpers/matchMedia.js +3 -3
- package/dist/esm/helpers/matchMedia.js.map +1 -1
- package/dist/esm/helpers/mergeProps.js +5 -9
- package/dist/esm/helpers/mergeProps.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.js +11 -21
- package/dist/esm/helpers/mergeVariants.js.map +1 -1
- package/dist/esm/helpers/normalizeColor.js +3 -15
- package/dist/esm/helpers/normalizeColor.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.js +16 -51
- package/dist/esm/helpers/normalizeValueWithProperty.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.js +4 -5
- package/dist/esm/helpers/objectIdentityKey.js.map +1 -1
- package/dist/esm/helpers/propMapper.js +86 -223
- package/dist/esm/helpers/propMapper.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.js +6 -18
- package/dist/esm/helpers/proxyThemeToParents.js.map +1 -1
- package/dist/esm/helpers/proxyThemeVariables.js +1 -1
- package/dist/esm/helpers/proxyThemeVariables.js.map +1 -1
- package/dist/esm/helpers/pseudoDescriptors.js +2 -4
- package/dist/esm/helpers/pseudoDescriptors.js.map +1 -1
- package/dist/esm/helpers/registerCSSVariable.js +1 -5
- package/dist/esm/helpers/registerCSSVariable.js.map +1 -1
- package/dist/esm/helpers/themeable.js +8 -12
- package/dist/esm/helpers/themeable.js.map +1 -1
- package/dist/esm/helpers/themes.js +10 -17
- package/dist/esm/helpers/themes.js.map +1 -1
- package/dist/esm/helpers/timer.js +1 -1
- package/dist/esm/helpers/withStaticProperties.js +3 -6
- package/dist/esm/helpers/withStaticProperties.js.map +1 -1
- package/dist/esm/hooks/getThemeUnwrapped.js +1 -4
- package/dist/esm/hooks/getThemeUnwrapped.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.js +1 -3
- package/dist/esm/hooks/useAnimationDriver.js.map +1 -1
- package/dist/esm/hooks/useIsTouchDevice.js +1 -3
- package/dist/esm/hooks/useIsTouchDevice.js.map +1 -1
- package/dist/esm/hooks/useMedia.js +54 -152
- package/dist/esm/hooks/useMedia.js.map +2 -2
- package/dist/esm/hooks/useMemoDebug.js +2 -8
- package/dist/esm/hooks/useMemoDebug.js.map +1 -1
- package/dist/esm/hooks/useProps.js +2 -2
- package/dist/esm/hooks/useProps.js.map +1 -1
- package/dist/esm/hooks/useStyle.js +2 -6
- package/dist/esm/hooks/useStyle.js.map +1 -1
- package/dist/esm/hooks/useTheme.js +89 -198
- package/dist/esm/hooks/useTheme.js.map +1 -1
- package/dist/esm/hooks/useThemeName.js +8 -14
- package/dist/esm/hooks/useThemeName.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/inject-styles.js +2 -6
- package/dist/esm/inject-styles.js.map +1 -1
- package/dist/esm/insertFont.js +19 -36
- package/dist/esm/insertFont.js.map +1 -1
- package/dist/esm/setupReactNative.js +6 -8
- package/dist/esm/setupReactNative.js.map +1 -1
- package/dist/esm/styled.js +19 -55
- package/dist/esm/styled.js.map +1 -1
- package/dist/esm/views/AnimationDriverProvider.js +2 -4
- package/dist/esm/views/AnimationDriverProvider.js.map +1 -1
- package/dist/esm/views/FontLanguage.js +10 -12
- package/dist/esm/views/FontLanguage.js.map +1 -1
- package/dist/esm/views/Slot.js +10 -33
- package/dist/esm/views/Slot.js.map +2 -2
- package/dist/esm/views/Stack.js +1 -1
- package/dist/esm/views/TamaguiProvider.js +9 -20
- package/dist/esm/views/TamaguiProvider.js.map +1 -1
- package/dist/esm/views/Text.js +22 -34
- package/dist/esm/views/Text.js.map +1 -1
- package/dist/esm/views/Theme.js +34 -70
- package/dist/esm/views/Theme.js.map +2 -2
- package/dist/esm/views/ThemeDebug.js +14 -40
- package/dist/esm/views/ThemeDebug.js.map +2 -2
- package/dist/esm/views/ThemeProvider.js +17 -24
- package/dist/esm/views/ThemeProvider.js.map +1 -1
- package/dist/esm/views/View.js +1 -1
- package/package.json +15 -10
- package/src/createTamagui.ts +8 -7
- package/src/helpers/getStylesAtomic.ts +1 -0
- package/src/helpers/getThemeCSSRules.ts +3 -1
- package/src/index.ts +2 -0
- package/types/createTamagui.d.ts.map +1 -1
- package/types/helpers/getStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/dist/esm/constants/accessibilityDirectMap.native.js +0 -63
- package/dist/esm/constants/accessibilityDirectMap.native.js.map +0 -6
- package/dist/esm/helpers/getStylesAtomic.native.js +0 -14
- package/dist/esm/helpers/getStylesAtomic.native.js.map +0 -6
- package/dist/esm/helpers/getThemeCSSRules.native.js +0 -7
- package/dist/esm/helpers/getThemeCSSRules.native.js.map +0 -6
- package/dist/esm/helpers/matchMedia.native.js +0 -24
- package/dist/esm/helpers/matchMedia.native.js.map +0 -6
- package/dist/esm/helpers/normalizeShadow.native.js +0 -31
- package/dist/esm/helpers/normalizeShadow.native.js.map +0 -6
- package/dist/esm/helpers/normalizeStylePropKeys.native.js +0 -16
- package/dist/esm/helpers/normalizeStylePropKeys.native.js.map +0 -6
- package/dist/esm/views/FontLanguage.native.js +0 -11
- package/dist/esm/views/FontLanguage.native.js.map +0 -6
- package/dist/esm/views/ThemeDebug.native.js +0 -11
- package/dist/esm/views/ThemeDebug.native.js.map +0 -6
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var getSplitStyles_exports = {};
|
|
20
16
|
__export(getSplitStyles_exports, {
|
|
21
17
|
PROP_SPLIT: () => PROP_SPLIT,
|
|
@@ -24,30 +20,12 @@ __export(getSplitStyles_exports, {
|
|
|
24
20
|
useSplitStyles: () => useSplitStyles
|
|
25
21
|
});
|
|
26
22
|
module.exports = __toCommonJS(getSplitStyles_exports);
|
|
27
|
-
var import_constants = require("@tamagui/constants");
|
|
28
|
-
|
|
29
|
-
var import_react = require("react");
|
|
30
|
-
var import_config = require("../config");
|
|
31
|
-
var import_accessibilityDirectMap = require("../constants/accessibilityDirectMap");
|
|
32
|
-
var import_isDevTools = require("../constants/isDevTools");
|
|
33
|
-
var import_useMedia = require("../hooks/useMedia");
|
|
34
|
-
var import_createMediaStyle = require("./createMediaStyle");
|
|
35
|
-
var import_expandStyles = require("./expandStyles");
|
|
36
|
-
var import_getGroupPropParts = require("./getGroupPropParts");
|
|
37
|
-
var import_getStylesAtomic = require("./getStylesAtomic");
|
|
38
|
-
var import_insertStyleRule = require("./insertStyleRule");
|
|
39
|
-
var import_normalizeValueWithProperty = require("./normalizeValueWithProperty");
|
|
40
|
-
var import_propMapper = require("./propMapper");
|
|
41
|
-
var import_pseudoDescriptors = require("./pseudoDescriptors");
|
|
42
|
-
const fontFamilyKey = "fontFamily";
|
|
43
|
-
const IS_STATIC = process.env.IS_STATIC === "is_static";
|
|
23
|
+
var import_constants = require("@tamagui/constants"), import_helpers = require("@tamagui/helpers"), import_react = require("react"), import_config = require("../config"), import_accessibilityDirectMap = require("../constants/accessibilityDirectMap"), import_isDevTools = require("../constants/isDevTools"), import_useMedia = require("../hooks/useMedia"), import_createMediaStyle = require("./createMediaStyle"), import_expandStyles = require("./expandStyles"), import_getGroupPropParts = require("./getGroupPropParts"), import_getStylesAtomic = require("./getStylesAtomic"), import_insertStyleRule = require("./insertStyleRule"), import_normalizeValueWithProperty = require("./normalizeValueWithProperty"), import_propMapper = require("./propMapper"), import_pseudoDescriptors = require("./pseudoDescriptors");
|
|
24
|
+
const fontFamilyKey = "fontFamily", IS_STATIC = process.env.IS_STATIC === "is_static";
|
|
44
25
|
let conf;
|
|
45
|
-
const PROP_SPLIT = "-"
|
|
46
|
-
const getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
26
|
+
const PROP_SPLIT = "-", getSplitStyles = (props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, debug) => {
|
|
48
27
|
conf = conf || (0, import_config.getConfig)();
|
|
49
|
-
const { shorthands } = conf
|
|
50
|
-
const {
|
|
28
|
+
const { shorthands } = conf, {
|
|
51
29
|
isHOC,
|
|
52
30
|
isText,
|
|
53
31
|
variants,
|
|
@@ -56,24 +34,8 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
56
34
|
inlineWhenUnflattened,
|
|
57
35
|
parentStaticConfig,
|
|
58
36
|
acceptsClassName
|
|
59
|
-
} = staticConfig;
|
|
60
|
-
|
|
61
|
-
const viewProps = {};
|
|
62
|
-
const mediaState = styleProps.mediaState || import_useMedia.mediaState;
|
|
63
|
-
const usedKeys = {};
|
|
64
|
-
const shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames;
|
|
65
|
-
const rulesToInsert = [];
|
|
66
|
-
const classNames = {};
|
|
67
|
-
const transforms = {};
|
|
68
|
-
let pseudos = null;
|
|
69
|
-
let space = props.space;
|
|
70
|
-
let hasMedia = false;
|
|
71
|
-
let dynamicThemeAccess;
|
|
72
|
-
let pseudoGroups;
|
|
73
|
-
let mediaGroups;
|
|
74
|
-
let style = {};
|
|
75
|
-
let className = "";
|
|
76
|
-
let mediaStylesSeen = 0;
|
|
37
|
+
} = staticConfig, validStyleProps = isText ? import_helpers.stylePropsText : import_helpers.validStyles, viewProps = {}, mediaState = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants.isWeb && !styleProps.noClassNames, rulesToInsert = [], classNames = {}, transforms = {};
|
|
38
|
+
let pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, style = {}, className = "", mediaStylesSeen = 0;
|
|
77
39
|
const styleState = {
|
|
78
40
|
curProps: Object.assign({}, props),
|
|
79
41
|
classNames,
|
|
@@ -89,432 +51,223 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
89
51
|
context,
|
|
90
52
|
debug
|
|
91
53
|
};
|
|
92
|
-
if (process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
console.groupEnd();
|
|
104
|
-
}
|
|
105
|
-
if (process.env.TAMAGUI_TARGET === "web" && typeof props.className === "string") {
|
|
106
|
-
for (const cn of props.className.split(" ")) {
|
|
54
|
+
if (process.env.NODE_ENV === "development" && debug && debug !== "profile" && import_constants.isClient && (console.groupCollapsed("getSplitStyles (collapsed)"), console.log({
|
|
55
|
+
props,
|
|
56
|
+
staticConfig,
|
|
57
|
+
shouldDoClasses,
|
|
58
|
+
styleProps,
|
|
59
|
+
componentState,
|
|
60
|
+
styleState,
|
|
61
|
+
theme: { ...theme }
|
|
62
|
+
}), console.groupEnd()), typeof props.className == "string")
|
|
63
|
+
for (const cn of props.className.split(" "))
|
|
107
64
|
if (cn[0] === "_") {
|
|
108
|
-
const [shorthand, mediaOrPseudo] = cn.slice(1).split("-");
|
|
109
|
-
const isMedia = mediaOrPseudo[0] === "_";
|
|
110
|
-
const isPseudo = mediaOrPseudo[0] === "0";
|
|
111
|
-
const isMediaOrPseudo = isMedia || isPseudo;
|
|
65
|
+
const [shorthand, mediaOrPseudo] = cn.slice(1).split("-"), isMedia = mediaOrPseudo[0] === "_", isPseudo = mediaOrPseudo[0] === "0", isMediaOrPseudo = isMedia || isPseudo;
|
|
112
66
|
let fullKey = shorthands[shorthand];
|
|
113
67
|
if (isMedia) {
|
|
114
68
|
let mediaShortKey = mediaOrPseudo.slice(1);
|
|
115
|
-
mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf("_"))
|
|
116
|
-
fullKey += `${PROP_SPLIT}${mediaShortKey}`;
|
|
69
|
+
mediaShortKey = mediaShortKey.slice(0, mediaShortKey.indexOf("_")), fullKey += `${PROP_SPLIT}${mediaShortKey}`;
|
|
117
70
|
} else if (isPseudo) {
|
|
118
71
|
const pseudoShortKey = mediaOrPseudo.slice(1);
|
|
119
72
|
fullKey += `${PROP_SPLIT}${pseudoShortKey}`;
|
|
120
73
|
}
|
|
121
|
-
usedKeys[fullKey] = 1;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
className += ` ${cn}`;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
74
|
+
usedKeys[fullKey] = 1, mergeClassName(transforms, classNames, fullKey, cn, isMediaOrPseudo);
|
|
75
|
+
} else
|
|
76
|
+
cn && (className += ` ${cn}`);
|
|
128
77
|
for (const keyOg in props) {
|
|
129
|
-
let keyInit = keyOg;
|
|
130
|
-
|
|
131
|
-
if (keyInit in shorthands) {
|
|
132
|
-
keyInit = shorthands[keyInit];
|
|
133
|
-
}
|
|
134
|
-
if (keyInit === "className")
|
|
135
|
-
continue;
|
|
136
|
-
if (keyInit in usedKeys)
|
|
78
|
+
let keyInit = keyOg, valInit = props[keyOg];
|
|
79
|
+
if (keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys)
|
|
137
80
|
continue;
|
|
138
81
|
if (keyInit in skipProps && !isHOC) {
|
|
139
82
|
if (keyInit === "group") {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
};
|
|
149
|
-
addStyleToInsertRules(rulesToInsert, containerCSS);
|
|
150
|
-
}
|
|
83
|
+
const identifier = `t_group_${valInit}`, containerCSS = {
|
|
84
|
+
identifier,
|
|
85
|
+
property: "container",
|
|
86
|
+
rules: [
|
|
87
|
+
`.${identifier} { container-name: ${valInit}; container-type: inline-size; }`
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
addStyleToInsertRules(rulesToInsert, containerCSS);
|
|
151
91
|
}
|
|
152
92
|
continue;
|
|
153
93
|
}
|
|
154
94
|
const valInitType = typeof valInit;
|
|
155
|
-
styleState.curProps[keyInit] = valInit
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if (keyInit in validStyleProps || keyInit.includes("-")) {
|
|
159
|
-
if (process.env.NODE_ENV === "development" && debug) {
|
|
160
|
-
console.log(`Adding compiled style ${keyInit}: ${valInit}`);
|
|
161
|
-
}
|
|
162
|
-
if (shouldDoClasses) {
|
|
163
|
-
classNames[keyInit] = valInit;
|
|
164
|
-
delete style[keyInit];
|
|
165
|
-
} else {
|
|
166
|
-
style[keyInit] = (0, import_normalizeValueWithProperty.reverseMapClassNameToValue)(keyInit, valInit);
|
|
167
|
-
delete className[keyInit];
|
|
168
|
-
}
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (process.env.TAMAGUI_TARGET === "native") {
|
|
174
|
-
if (!import_constants.isAndroid) {
|
|
175
|
-
if (keyInit === "elevationAndroid")
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (keyInit === "userSelect") {
|
|
179
|
-
keyInit = "selectable";
|
|
180
|
-
valInit = valInit === "none" ? false : true;
|
|
181
|
-
} else if (keyInit === "role") {
|
|
182
|
-
viewProps["accessibilityRole"] = import_accessibilityDirectMap.accessibilityWebRoleToNativeRole[valInit];
|
|
183
|
-
continue;
|
|
184
|
-
} else if (keyInit.startsWith("aria-")) {
|
|
185
|
-
if (import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit]) {
|
|
186
|
-
const nativeA11yProp = import_accessibilityDirectMap.webToNativeAccessibilityDirectMap[keyInit];
|
|
187
|
-
if (keyInit === "aria-hidden") {
|
|
188
|
-
viewProps["aria-hidden"] = valInit;
|
|
189
|
-
}
|
|
190
|
-
viewProps[nativeA11yProp] = valInit;
|
|
191
|
-
continue;
|
|
192
|
-
} else if (import_accessibilityDirectMap.nativeAccessibilityValue[keyInit]) {
|
|
193
|
-
let field = import_accessibilityDirectMap.nativeAccessibilityValue[keyInit];
|
|
194
|
-
if (viewProps["accessibilityValue"]) {
|
|
195
|
-
viewProps["accessibilityValue"][field] = valInit;
|
|
196
|
-
} else {
|
|
197
|
-
viewProps["accessibilityValue"] = {
|
|
198
|
-
[field]: valInit
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
} else if (import_accessibilityDirectMap.nativeAccessibilityState[keyInit]) {
|
|
202
|
-
let field = import_accessibilityDirectMap.nativeAccessibilityState[keyInit];
|
|
203
|
-
if (viewProps["accessibilityState"]) {
|
|
204
|
-
viewProps["accessibilityState"][field] = valInit;
|
|
205
|
-
} else {
|
|
206
|
-
viewProps["accessibilityState"] = {
|
|
207
|
-
[field]: valInit
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
continue;
|
|
212
|
-
} else if (keyInit.startsWith("data-")) {
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
95
|
+
if (styleState.curProps[keyInit] = valInit, valInitType === "string" && valInit[0] === "_" && (keyInit in validStyleProps || keyInit.includes("-"))) {
|
|
96
|
+
process.env.NODE_ENV === "development" && debug && console.log(`Adding compiled style ${keyInit}: ${valInit}`), shouldDoClasses ? (classNames[keyInit] = valInit, delete style[keyInit]) : (style[keyInit] = (0, import_normalizeValueWithProperty.reverseMapClassNameToValue)(keyInit, valInit), delete className[keyInit]);
|
|
97
|
+
continue;
|
|
215
98
|
}
|
|
216
99
|
if (keyInit === "dataSet") {
|
|
217
|
-
for (const keyInit2 in valInit)
|
|
100
|
+
for (const keyInit2 in valInit)
|
|
218
101
|
viewProps[`data-${hyphenate(keyInit2)}`] = valInit[keyInit2];
|
|
219
|
-
}
|
|
220
102
|
continue;
|
|
221
103
|
}
|
|
222
104
|
if (keyInit[0] === "_" && keyInit.startsWith("_style")) {
|
|
223
105
|
mergeStyleProp(styleState, valInit);
|
|
224
106
|
continue;
|
|
225
107
|
}
|
|
226
|
-
|
|
227
|
-
if (keyInit === "disabled" && valInit ===
|
|
228
|
-
|
|
229
|
-
if (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
230
|
-
viewProps.disabled = true;
|
|
231
|
-
}
|
|
232
|
-
if (!(variants == null ? void 0 : variants.disabled)) {
|
|
233
|
-
continue;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
108
|
+
{
|
|
109
|
+
if (keyInit === "disabled" && valInit === !0 && (viewProps["aria-disabled"] = !0, (elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") && (viewProps.disabled = !0), !variants?.disabled))
|
|
110
|
+
continue;
|
|
236
111
|
if (keyInit === "testID") {
|
|
237
112
|
viewProps[isReactNative ? keyInit : "data-testid"] = valInit;
|
|
238
113
|
continue;
|
|
239
114
|
}
|
|
240
115
|
if (keyInit === "id" || keyInit === "nativeID") {
|
|
241
|
-
|
|
242
|
-
viewProps.nativeID = valInit;
|
|
243
|
-
} else {
|
|
244
|
-
viewProps.id = valInit;
|
|
245
|
-
}
|
|
116
|
+
isReactNative ? viewProps.nativeID = valInit : viewProps.id = valInit;
|
|
246
117
|
continue;
|
|
247
118
|
}
|
|
248
|
-
let didUseKeyInit =
|
|
119
|
+
let didUseKeyInit = !1;
|
|
249
120
|
if (isReactNative) {
|
|
250
121
|
if (keyInit in import_accessibilityDirectMap.accessibilityDirectMap || keyInit.startsWith("accessibility")) {
|
|
251
122
|
viewProps[keyInit] = valInit;
|
|
252
123
|
continue;
|
|
253
124
|
}
|
|
254
|
-
} else {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
case "accessibilityReadOnly": {
|
|
287
|
-
viewProps["aria-readonly"] = valInit;
|
|
288
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
289
|
-
viewProps.readOnly = true;
|
|
290
|
-
}
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
case "accessibilityRequired": {
|
|
294
|
-
viewProps["aria-required"] = valInit;
|
|
295
|
-
if (elementType === "input" || elementType === "select" || elementType === "textarea") {
|
|
296
|
-
viewProps.required = valInit;
|
|
297
|
-
}
|
|
298
|
-
continue;
|
|
299
|
-
}
|
|
300
|
-
default: {
|
|
301
|
-
didUseKeyInit = false;
|
|
302
|
-
}
|
|
125
|
+
} else if (didUseKeyInit = !0, keyInit in import_accessibilityDirectMap.accessibilityDirectMap) {
|
|
126
|
+
viewProps[import_accessibilityDirectMap.accessibilityDirectMap[keyInit]] = valInit;
|
|
127
|
+
continue;
|
|
128
|
+
} else
|
|
129
|
+
switch (keyInit) {
|
|
130
|
+
case "accessibilityRole": {
|
|
131
|
+
valInit === "none" ? viewProps.role = "presentation" : viewProps.role = accessibilityRoleToWebRole[valInit] || valInit;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
case "accessibilityLabelledBy":
|
|
135
|
+
case "accessibilityFlowTo":
|
|
136
|
+
case "accessibilityControls":
|
|
137
|
+
case "accessibilityDescribedBy": {
|
|
138
|
+
viewProps[`aria-${keyInit.replace("accessibility", "").toLowerCase()}`] = processIDRefList(valInit);
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
case "accessibilityKeyShortcuts": {
|
|
142
|
+
Array.isArray(valInit) && (viewProps["aria-keyshortcuts"] = valInit.join(" "));
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
case "accessibilityLiveRegion": {
|
|
146
|
+
viewProps["aria-live"] = valInit === "none" ? "off" : valInit;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
case "accessibilityReadOnly": {
|
|
150
|
+
viewProps["aria-readonly"] = valInit, (elementType === "input" || elementType === "select" || elementType === "textarea") && (viewProps.readOnly = !0);
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
case "accessibilityRequired": {
|
|
154
|
+
viewProps["aria-required"] = valInit, (elementType === "input" || elementType === "select" || elementType === "textarea") && (viewProps.required = valInit);
|
|
155
|
+
continue;
|
|
303
156
|
}
|
|
157
|
+
default:
|
|
158
|
+
didUseKeyInit = !1;
|
|
304
159
|
}
|
|
305
|
-
|
|
306
|
-
if (didUseKeyInit) {
|
|
160
|
+
if (didUseKeyInit)
|
|
307
161
|
continue;
|
|
308
|
-
}
|
|
309
162
|
if (valInit && valInit[0] === "_") {
|
|
310
|
-
const isValidClassName = keyInit in import_helpers.validStyles;
|
|
311
|
-
const isMediaOrPseudo2 = !isValidClassName && keyInit.includes(PROP_SPLIT) && import_helpers.validStyles[keyInit.split(PROP_SPLIT)[0]];
|
|
163
|
+
const isValidClassName = keyInit in import_helpers.validStyles, isMediaOrPseudo2 = !isValidClassName && keyInit.includes(PROP_SPLIT) && import_helpers.validStyles[keyInit.split(PROP_SPLIT)[0]];
|
|
312
164
|
if (isValidClassName || isMediaOrPseudo2) {
|
|
313
|
-
|
|
314
|
-
console.log("tamagui classname prop", keyInit, valInit);
|
|
315
|
-
}
|
|
316
|
-
if (shouldDoClasses) {
|
|
317
|
-
mergeClassName(transforms, classNames, keyInit, valInit, isMediaOrPseudo2);
|
|
318
|
-
delete style[keyInit];
|
|
319
|
-
} else {
|
|
320
|
-
style[keyInit] = (0, import_normalizeValueWithProperty.reverseMapClassNameToValue)(keyInit, valInit);
|
|
321
|
-
delete className[keyInit];
|
|
322
|
-
}
|
|
165
|
+
process.env.NODE_ENV === "development" && debug && console.log("tamagui classname prop", keyInit, valInit), shouldDoClasses ? (mergeClassName(transforms, classNames, keyInit, valInit, isMediaOrPseudo2), delete style[keyInit]) : (style[keyInit] = (0, import_normalizeValueWithProperty.reverseMapClassNameToValue)(keyInit, valInit), delete className[keyInit]);
|
|
323
166
|
continue;
|
|
324
167
|
}
|
|
325
168
|
}
|
|
326
169
|
}
|
|
327
|
-
const isValidStyleKeyInit = keyInit in validStyleProps;
|
|
328
|
-
const isShorthand = keyInit in shorthands;
|
|
170
|
+
const isValidStyleKeyInit = keyInit in validStyleProps, isShorthand = keyInit in shorthands;
|
|
329
171
|
let isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
|
|
330
172
|
const isStyleLikeKey = isShorthand || isValidStyleKeyInit || isVariant;
|
|
331
|
-
let isPseudo = keyInit in import_helpers.validPseudoKeys;
|
|
332
|
-
let isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit);
|
|
333
|
-
let isMediaOrPseudo = isMedia || isPseudo;
|
|
173
|
+
let isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = isMedia || isPseudo;
|
|
334
174
|
const isStyleProp = isMediaOrPseudo || isVariant || isValidStyleKeyInit || isShorthand;
|
|
335
|
-
if (isStyleProp && props.asChild === "except-style")
|
|
175
|
+
if (isStyleProp && props.asChild === "except-style")
|
|
336
176
|
continue;
|
|
337
|
-
}
|
|
338
177
|
const shouldPassProp = !isStyleProp || // is in parent variants
|
|
339
|
-
isHOC &&
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
)
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
console.log({
|
|
351
|
-
variants,
|
|
352
|
-
variant: variants == null ? void 0 : variants[keyInit],
|
|
353
|
-
isVariant,
|
|
354
|
-
isHOCShouldPassThrough,
|
|
355
|
-
curProps: { ...styleState.curProps },
|
|
356
|
-
parentStaticConfig
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
console.groupEnd();
|
|
360
|
-
}
|
|
361
|
-
if (shouldPassThrough) {
|
|
362
|
-
passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo);
|
|
363
|
-
if (!isVariant) {
|
|
364
|
-
continue;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
if (keyInit in skipProps)
|
|
368
|
-
continue;
|
|
369
|
-
if (isText) {
|
|
370
|
-
if (valInit && (keyInit === fontFamilyKey || keyInit === shorthands[fontFamilyKey]) && valInit in conf.fontsParsed) {
|
|
371
|
-
styleState.fontFamily = valInit;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
if (process.env.TAMAGUI_TARGET === "native" && isValidStyleKeyInit && !variants && (valInitType === "number" || valInitType === "string" && valInit[0] !== "$")) {
|
|
375
|
-
style[keyInit] = valInit;
|
|
178
|
+
isHOC && parentStaticConfig?.variants && keyInit in parentStaticConfig.variants || inlineProps?.has(keyInit), isHOCShouldPassThrough = !!(isHOC && (isShorthand || isValidStyleKeyInit || isMediaOrPseudo || parentStaticConfig?.variants?.[keyInit] || keyInit in skipProps)), shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
179
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(
|
|
180
|
+
`\u{1F539}\u{1F539}\u{1F539}\u{1F539} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""} \u{1F539}\u{1F539}\u{1F539}\u{1F539}`
|
|
181
|
+
), console.log({ isVariant, valInit, shouldPassProp }), import_constants.isClient && console.log({
|
|
182
|
+
variants,
|
|
183
|
+
variant: variants?.[keyInit],
|
|
184
|
+
isVariant,
|
|
185
|
+
isHOCShouldPassThrough,
|
|
186
|
+
curProps: { ...styleState.curProps },
|
|
187
|
+
parentStaticConfig
|
|
188
|
+
}), console.groupEnd()), shouldPassThrough && (passDownProp(viewProps, keyInit, valInit, isMediaOrPseudo), !isVariant) || keyInit in skipProps)
|
|
376
189
|
continue;
|
|
377
|
-
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
const next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
381
|
-
if (next) {
|
|
382
|
-
styleState.fontFamily = next;
|
|
383
|
-
}
|
|
384
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
190
|
+
isText && valInit && (keyInit === fontFamilyKey || keyInit === shorthands[fontFamilyKey]) && valInit in conf.fontsParsed && (styleState.fontFamily = valInit);
|
|
191
|
+
const expanded = isMediaOrPseudo || !isVariant && !isValidStyleKeyInit ? [[keyInit, valInit]] : (0, import_propMapper.propMapper)(keyInit, valInit, styleState), next = (0, import_propMapper.getPropMappedFontFamily)(expanded);
|
|
192
|
+
if (next && (styleState.fontFamily = next), process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
385
193
|
console.groupCollapsed(" \u{1F4A0} expanded", keyInit, valInit);
|
|
386
194
|
try {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}
|
|
195
|
+
!import_constants.isServer && import_isDevTools.isDevTools && (console.log({
|
|
196
|
+
expanded,
|
|
197
|
+
styleProps,
|
|
198
|
+
componentState,
|
|
199
|
+
isVariant,
|
|
200
|
+
variant: variants?.[keyInit],
|
|
201
|
+
shouldPassProp,
|
|
202
|
+
isHOCShouldPassThrough,
|
|
203
|
+
theme,
|
|
204
|
+
usedKeys: { ...usedKeys },
|
|
205
|
+
curProps: { ...styleState.curProps }
|
|
206
|
+
}), console.log("expanded", expanded, `
|
|
207
|
+
usedKeys`, { ...usedKeys }, `
|
|
208
|
+
current`, {
|
|
209
|
+
...style
|
|
210
|
+
}));
|
|
404
211
|
} catch {
|
|
405
212
|
}
|
|
406
213
|
console.groupEnd();
|
|
407
214
|
}
|
|
408
|
-
if (
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
if (val == null)
|
|
412
|
-
continue;
|
|
413
|
-
if (key in usedKeys)
|
|
414
|
-
continue;
|
|
415
|
-
isPseudo = key in import_helpers.validPseudoKeys;
|
|
416
|
-
isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key);
|
|
417
|
-
isMediaOrPseudo = isMedia || isPseudo;
|
|
418
|
-
isVariant = variants && key in variants;
|
|
419
|
-
if ((inlineProps == null ? void 0 : inlineProps.has(key)) || IS_STATIC && (inlineWhenUnflattened == null ? void 0 : inlineWhenUnflattened.has(key))) {
|
|
420
|
-
viewProps[key] = props[key] ?? val;
|
|
421
|
-
}
|
|
422
|
-
const isHOCShouldPassThrough2 = isHOC && (isMediaOrPseudo || ((_b = parentStaticConfig == null ? void 0 : parentStaticConfig.variants) == null ? void 0 : _b[keyInit]));
|
|
423
|
-
if (isHOCShouldPassThrough2) {
|
|
424
|
-
passDownProp(viewProps, key, val, isMediaOrPseudo);
|
|
425
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
426
|
-
console.groupCollapsed(` - passing down prop ${key}`);
|
|
427
|
-
console.log({ val, after: { ...viewProps[key] } });
|
|
428
|
-
console.groupEnd();
|
|
429
|
-
}
|
|
430
|
-
continue;
|
|
431
|
-
}
|
|
432
|
-
if (isPseudo) {
|
|
433
|
-
if (!val)
|
|
215
|
+
if (expanded) {
|
|
216
|
+
for (const [key, val] of expanded) {
|
|
217
|
+
if (val == null || key in usedKeys)
|
|
434
218
|
continue;
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
key,
|
|
438
|
-
val,
|
|
439
|
-
styleProps.noClassNames
|
|
440
|
-
);
|
|
441
|
-
const descriptor = import_pseudoDescriptors.pseudoDescriptors[key];
|
|
442
|
-
const isEnter = key === "enterStyle";
|
|
443
|
-
const isExit = key === "exitStyle";
|
|
444
|
-
if (process.env.NODE_ENV === "development" && !styleProps.isAnimated && !componentState.unmounted && (isEnter || isExit)) {
|
|
445
|
-
console.warn(
|
|
446
|
-
`No animation prop given to component ${staticConfig.componentName || ""} with enterStyle / exitStyle, these styles will be ignore.`
|
|
447
|
-
);
|
|
448
|
-
}
|
|
449
|
-
if (!descriptor || isExit && !styleProps.isExiting) {
|
|
219
|
+
if (isPseudo = key in import_helpers.validPseudoKeys, isMedia = !isPseudo && !isValidStyleKeyInit && (0, import_useMedia.isMediaKey)(key), isMediaOrPseudo = isMedia || isPseudo, isVariant = variants && key in variants, (inlineProps?.has(key) || IS_STATIC && inlineWhenUnflattened?.has(key)) && (viewProps[key] = props[key] ?? val), isHOC && (isMediaOrPseudo || parentStaticConfig?.variants?.[keyInit])) {
|
|
220
|
+
passDownProp(viewProps, key, val, isMediaOrPseudo), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed(` - passing down prop ${key}`), console.log({ val, after: { ...viewProps[key] } }), console.groupEnd());
|
|
450
221
|
continue;
|
|
451
222
|
}
|
|
452
|
-
if (
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
if (process.env.NODE_ENV === "development" &&
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
let isDisabled = isExit ? !styleProps.isExiting : !pseudoState;
|
|
484
|
-
if (import_constants.isWeb && !import_constants.isClient && isEnter) {
|
|
485
|
-
isDisabled = false;
|
|
486
|
-
}
|
|
487
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
488
|
-
console.groupCollapsed("pseudo", key, { isDisabled });
|
|
489
|
-
console.log(pseudoStyleObject, {
|
|
223
|
+
if (isPseudo) {
|
|
224
|
+
if (!val)
|
|
225
|
+
continue;
|
|
226
|
+
const pseudoStyleObject = getSubStyle(
|
|
227
|
+
styleState,
|
|
228
|
+
key,
|
|
229
|
+
val,
|
|
230
|
+
styleProps.noClassNames
|
|
231
|
+
), descriptor = import_pseudoDescriptors.pseudoDescriptors[key], isEnter = key === "enterStyle", isExit = key === "exitStyle";
|
|
232
|
+
if (process.env.NODE_ENV === "development" && !styleProps.isAnimated && !componentState.unmounted && (isEnter || isExit) && console.warn(
|
|
233
|
+
`No animation prop given to component ${staticConfig.componentName || ""} with enterStyle / exitStyle, these styles will be ignore.`
|
|
234
|
+
), !descriptor || isExit && !styleProps.isExiting)
|
|
235
|
+
continue;
|
|
236
|
+
if ((!shouldDoClasses || IS_STATIC) && (pseudos ||= {}, pseudos[key] ||= {}, IS_STATIC && Object.assign(pseudos[key], pseudoStyleObject)), shouldDoClasses && !isEnter && !isExit) {
|
|
237
|
+
const pseudoStyles = (0, import_getStylesAtomic.generateAtomicStyles)(pseudoStyleObject, descriptor);
|
|
238
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo (classes)", key), console.log({ pseudoStyleObject, pseudoStyles }), console.groupEnd());
|
|
239
|
+
for (const psuedoStyle of pseudoStyles) {
|
|
240
|
+
const fullKey = `${psuedoStyle.property}${PROP_SPLIT}${descriptor.name}`;
|
|
241
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), mergeClassName(
|
|
242
|
+
transforms,
|
|
243
|
+
classNames,
|
|
244
|
+
fullKey,
|
|
245
|
+
psuedoStyle.identifier,
|
|
246
|
+
isMediaOrPseudo,
|
|
247
|
+
!0
|
|
248
|
+
));
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
const descriptorKey = descriptor.stateKey || descriptor.name, pseudoState = componentState[descriptorKey];
|
|
252
|
+
let isDisabled = isExit ? !styleProps.isExiting : !pseudoState;
|
|
253
|
+
import_constants.isWeb && !import_constants.isClient && isEnter && (isDisabled = !1), process.env.NODE_ENV === "development" && debug === "verbose" && (console.groupCollapsed("pseudo", key, { isDisabled }), console.log(pseudoStyleObject, {
|
|
490
254
|
isDisabled,
|
|
491
255
|
descriptorKey,
|
|
492
256
|
descriptor,
|
|
493
257
|
pseudoState,
|
|
494
258
|
state: { ...componentState }
|
|
495
|
-
});
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
const curImportance = usedKeys[importance] || 0;
|
|
508
|
-
const shouldMerge = importance >= curImportance;
|
|
509
|
-
if (shouldMerge) {
|
|
510
|
-
pseudos || (pseudos = {});
|
|
511
|
-
pseudos[key] || (pseudos[key] = {});
|
|
512
|
-
pseudos[key][pkey] = val2;
|
|
513
|
-
mergeStyle(styleState, pkey, val2);
|
|
514
|
-
usedKeys[pkey] || (usedKeys[pkey] = 1);
|
|
515
|
-
}
|
|
516
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
517
|
-
console.log(" subKey", pkey, shouldMerge, {
|
|
259
|
+
}), console.groupEnd());
|
|
260
|
+
const importance = descriptor.priority;
|
|
261
|
+
for (const pkey in pseudoStyleObject) {
|
|
262
|
+
const val2 = pseudoStyleObject[pkey];
|
|
263
|
+
if (isDisabled) {
|
|
264
|
+
if (pkey in animatableDefaults && !(pkey in usedKeys)) {
|
|
265
|
+
const defaultVal = animatableDefaults[pkey];
|
|
266
|
+
mergeStyle(styleState, pkey, defaultVal);
|
|
267
|
+
}
|
|
268
|
+
} else {
|
|
269
|
+
const curImportance = usedKeys[importance] || 0, shouldMerge = importance >= curImportance;
|
|
270
|
+
shouldMerge && (pseudos ||= {}, pseudos[key] ||= {}, pseudos[key][pkey] = val2, mergeStyle(styleState, pkey, val2), usedKeys[pkey] ||= 1), process.env.NODE_ENV === "development" && debug === "verbose" && console.log(" subKey", pkey, shouldMerge, {
|
|
518
271
|
importance,
|
|
519
272
|
curImportance,
|
|
520
273
|
pkey,
|
|
@@ -522,306 +275,187 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
522
275
|
});
|
|
523
276
|
}
|
|
524
277
|
}
|
|
278
|
+
if (!isDisabled)
|
|
279
|
+
for (const key2 in val) {
|
|
280
|
+
const k = shorthands[key2] || key2;
|
|
281
|
+
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
282
|
+
}
|
|
525
283
|
}
|
|
526
|
-
if (!isDisabled) {
|
|
527
|
-
for (const key2 in val) {
|
|
528
|
-
const k = shorthands[key2] || key2;
|
|
529
|
-
usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
continue;
|
|
534
|
-
} else if (isMedia) {
|
|
535
|
-
if (!val)
|
|
536
284
|
continue;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
const platform = key.slice(10);
|
|
540
|
-
if (
|
|
541
|
-
// supports web, ios, android
|
|
542
|
-
platform !== import_constants.currentPlatform && // supports web, native
|
|
543
|
-
platform !== process.env.TAMAGUI_TARGET
|
|
544
|
-
) {
|
|
285
|
+
} else if (isMedia) {
|
|
286
|
+
if (!val)
|
|
545
287
|
continue;
|
|
288
|
+
const isPlatformMedia = key.startsWith("$platform-");
|
|
289
|
+
if (isPlatformMedia) {
|
|
290
|
+
const platform = key.slice(10);
|
|
291
|
+
if (
|
|
292
|
+
// supports web, ios, android
|
|
293
|
+
platform !== import_constants.currentPlatform && // supports web, native
|
|
294
|
+
platform !== "web"
|
|
295
|
+
)
|
|
296
|
+
continue;
|
|
546
297
|
}
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
}
|
|
560
|
-
const hasSpace = val["space"];
|
|
561
|
-
if (hasSpace || !shouldDoClasses) {
|
|
562
|
-
if (!Array.isArray(hasMedia)) {
|
|
563
|
-
hasMedia = [];
|
|
564
|
-
}
|
|
565
|
-
hasMedia.push(mediaKeyShort);
|
|
566
|
-
}
|
|
567
|
-
if (shouldDoClasses) {
|
|
568
|
-
if (hasSpace) {
|
|
569
|
-
delete mediaStyle["space"];
|
|
570
|
-
if (mediaState[mediaKeyShort]) {
|
|
298
|
+
hasMedia ||= !0;
|
|
299
|
+
const mediaStyle = getSubStyle(
|
|
300
|
+
styleState,
|
|
301
|
+
key,
|
|
302
|
+
val,
|
|
303
|
+
// TODO try true like pseudo
|
|
304
|
+
!1
|
|
305
|
+
), mediaKeyShort = key.slice(1);
|
|
306
|
+
process.env.NODE_ENV === "development" && debug === "verbose" && console.log(` \u{1F4FA} ${key}`, { key, val, mediaStyle, props, shouldDoClasses, componentState });
|
|
307
|
+
const hasSpace = val.space;
|
|
308
|
+
if ((hasSpace || !shouldDoClasses) && (Array.isArray(hasMedia) || (hasMedia = []), hasMedia.push(mediaKeyShort)), shouldDoClasses) {
|
|
309
|
+
if (hasSpace && (delete mediaStyle.space, mediaState[mediaKeyShort])) {
|
|
571
310
|
const importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(
|
|
572
311
|
mediaKeyShort,
|
|
573
312
|
"space",
|
|
574
313
|
usedKeys,
|
|
575
|
-
|
|
314
|
+
!0
|
|
576
315
|
);
|
|
577
|
-
|
|
578
|
-
space
|
|
579
|
-
|
|
580
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
581
|
-
console.log(
|
|
582
|
-
`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
316
|
+
importance && (space = val.space, usedKeys.space = importance, process.env.NODE_ENV === "development" && debug === "verbose" && console.log(
|
|
317
|
+
`Found more important space for current media ${mediaKeyShort}: ${val} (importance: ${importance})`
|
|
318
|
+
));
|
|
586
319
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
);
|
|
599
|
-
const fullKey = `${style2.property}${PROP_SPLIT}${mediaKeyShort}`;
|
|
600
|
-
if (fullKey in usedKeys)
|
|
601
|
-
continue;
|
|
602
|
-
addStyleToInsertRules(rulesToInsert, out);
|
|
603
|
-
mergeClassName(transforms, classNames, fullKey, out.identifier, true, true);
|
|
604
|
-
}
|
|
605
|
-
} else {
|
|
606
|
-
const isThemeMedia = !isPlatformMedia && mediaKeyShort.startsWith("theme-");
|
|
607
|
-
const isGroupMedia = !isPlatformMedia && !isThemeMedia && mediaKeyShort.startsWith("group-");
|
|
608
|
-
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia) {
|
|
609
|
-
if (!mediaState[mediaKeyShort]) {
|
|
610
|
-
continue;
|
|
320
|
+
const mediaStyles = (0, import_getStylesAtomic.getStylesAtomic)(mediaStyle, debug), priority = mediaStylesSeen;
|
|
321
|
+
mediaStylesSeen += 1;
|
|
322
|
+
for (const style2 of mediaStyles) {
|
|
323
|
+
const out = (0, import_createMediaStyle.createMediaStyle)(
|
|
324
|
+
style2,
|
|
325
|
+
mediaKeyShort,
|
|
326
|
+
import_useMedia.mediaQueryConfig,
|
|
327
|
+
!1,
|
|
328
|
+
priority
|
|
329
|
+
), fullKey = `${style2.property}${PROP_SPLIT}${mediaKeyShort}`;
|
|
330
|
+
fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, out), mergeClassName(transforms, classNames, fullKey, out.identifier, !0, !0));
|
|
611
331
|
}
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
dynamicThemeAccess = true;
|
|
616
|
-
const mediaThemeName = mediaKeyShort.slice(6);
|
|
617
|
-
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName))) {
|
|
332
|
+
} else {
|
|
333
|
+
const isThemeMedia = !isPlatformMedia && mediaKeyShort.startsWith("theme-"), isGroupMedia = !isPlatformMedia && !isThemeMedia && mediaKeyShort.startsWith("group-");
|
|
334
|
+
if (!isThemeMedia && !isPlatformMedia && !isGroupMedia && !mediaState[mediaKeyShort])
|
|
618
335
|
continue;
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
336
|
+
let importanceBump = 0;
|
|
337
|
+
if (isThemeMedia) {
|
|
338
|
+
dynamicThemeAccess = !0;
|
|
339
|
+
const mediaThemeName = mediaKeyShort.slice(6);
|
|
340
|
+
if (!(themeName === mediaThemeName || themeName.startsWith(mediaThemeName)))
|
|
341
|
+
continue;
|
|
342
|
+
} else if (isGroupMedia) {
|
|
343
|
+
const groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context?.groups.state[groupName];
|
|
344
|
+
if (!groupContext) {
|
|
345
|
+
process.env.NODE_ENV === "development" && debug && console.warn(`No parent with group prop, skipping styles: ${groupName}`);
|
|
346
|
+
continue;
|
|
627
347
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
348
|
+
const groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = componentState.group?.[groupName];
|
|
349
|
+
if (groupMediaKey) {
|
|
350
|
+
mediaGroups ||= /* @__PURE__ */ new Set(), mediaGroups.add(groupMediaKey);
|
|
351
|
+
const mediaState2 = componentGroupState?.media;
|
|
352
|
+
let isActive = mediaState2?.[groupMediaKey];
|
|
353
|
+
if (!mediaState2 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), !isActive)
|
|
354
|
+
continue;
|
|
355
|
+
importanceBump = 2;
|
|
356
|
+
}
|
|
357
|
+
if (groupPseudoKey) {
|
|
358
|
+
if (pseudoGroups ||= /* @__PURE__ */ new Set(), pseudoGroups.add(groupName), !(componentGroupState || // fallback to context initially
|
|
359
|
+
context.groups.state[groupName]).pseudo?.[groupPseudoKey])
|
|
360
|
+
continue;
|
|
361
|
+
importanceBump = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
|
|
640
362
|
}
|
|
641
|
-
if (!isActive)
|
|
642
|
-
continue;
|
|
643
|
-
importanceBump = 2;
|
|
644
363
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
const componentGroupPseudoState = (componentGroupState || // fallback to context initially
|
|
649
|
-
context.groups.state[groupName]).pseudo;
|
|
650
|
-
const isActive = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey];
|
|
651
|
-
if (!isActive)
|
|
364
|
+
for (const subKey in mediaStyle) {
|
|
365
|
+
if (subKey === "space") {
|
|
366
|
+
space = valInit.space;
|
|
652
367
|
continue;
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
style,
|
|
664
|
-
mediaKeyShort,
|
|
665
|
-
subKey,
|
|
666
|
-
mediaStyle[subKey],
|
|
667
|
-
usedKeys,
|
|
668
|
-
mediaState[mediaKeyShort],
|
|
669
|
-
importanceBump
|
|
670
|
-
);
|
|
671
|
-
if (key === fontFamilyKey) {
|
|
672
|
-
styleState.fontFamily = mediaStyle.fontFamily;
|
|
368
|
+
}
|
|
369
|
+
(0, import_useMedia.mergeMediaByImportance)(
|
|
370
|
+
style,
|
|
371
|
+
mediaKeyShort,
|
|
372
|
+
subKey,
|
|
373
|
+
mediaStyle[subKey],
|
|
374
|
+
usedKeys,
|
|
375
|
+
mediaState[mediaKeyShort],
|
|
376
|
+
importanceBump
|
|
377
|
+
), key === fontFamilyKey && (styleState.fontFamily = mediaStyle.fontFamily);
|
|
673
378
|
}
|
|
674
379
|
}
|
|
380
|
+
continue;
|
|
675
381
|
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
382
|
+
if (
|
|
383
|
+
// is HOC we can just pass through the styles as props
|
|
384
|
+
// this fixes issues where style prop got merged with wrong priority
|
|
385
|
+
!isHOC && key in validStyleProps
|
|
386
|
+
) {
|
|
387
|
+
mergeStyle(styleState, key, val);
|
|
681
388
|
continue;
|
|
682
389
|
}
|
|
390
|
+
isVariant || (viewProps[key] = val);
|
|
683
391
|
}
|
|
684
|
-
if (
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
if (!isVariant) {
|
|
693
|
-
viewProps[key] = val;
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
697
|
-
console.groupCollapsed(` \u2714\uFE0F expand complete`, keyInit);
|
|
698
|
-
try {
|
|
699
|
-
console.log("style", { ...style });
|
|
700
|
-
console.log("viewProps", { ...viewProps });
|
|
701
|
-
} catch {
|
|
392
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
393
|
+
console.groupCollapsed(" \u2714\uFE0F expand complete", keyInit);
|
|
394
|
+
try {
|
|
395
|
+
console.log("style", { ...style }), console.log("viewProps", { ...viewProps });
|
|
396
|
+
} catch {
|
|
397
|
+
}
|
|
398
|
+
console.groupEnd();
|
|
702
399
|
}
|
|
703
|
-
console.groupEnd();
|
|
704
400
|
}
|
|
705
401
|
}
|
|
706
|
-
if (props.style) {
|
|
707
|
-
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
402
|
+
if (props.style && mergeStyleProp(styleState, props.style), (0, import_expandStyles.fixStyles)(style), import_constants.isWeb && !staticConfig.isReactNative && (0, import_getStylesAtomic.styleToCSS)(style), styleState.transforms && Object.entries(styleState.transforms).sort(([a], [b]) => a.localeCompare(b)).forEach(([key, val]) => {
|
|
403
|
+
mergeTransform(style, key, val, !0);
|
|
404
|
+
}), parentSplitStyles) {
|
|
405
|
+
if (shouldDoClasses)
|
|
406
|
+
for (const key in parentSplitStyles.classNames) {
|
|
407
|
+
const val = parentSplitStyles.classNames[key];
|
|
408
|
+
key in style || key in classNames || (classNames[key] = val);
|
|
409
|
+
}
|
|
410
|
+
if (!shouldDoClasses)
|
|
411
|
+
for (const key in parentSplitStyles.style)
|
|
412
|
+
key in classNames || key in style || (style[key] = parentSplitStyles.style[key]);
|
|
712
413
|
}
|
|
713
|
-
if (
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
if (!shouldDoClasses) {
|
|
730
|
-
for (const key in parentSplitStyles.style) {
|
|
731
|
-
if (key in classNames || key in style)
|
|
732
|
-
continue;
|
|
733
|
-
style[key] = parentSplitStyles.style[key];
|
|
414
|
+
if (shouldDoClasses) {
|
|
415
|
+
let retainedStyles, shouldRetain = !1;
|
|
416
|
+
if (!style.$$css) {
|
|
417
|
+
const atomic = (0, import_getStylesAtomic.getStylesAtomic)(style);
|
|
418
|
+
for (const atomicStyle of atomic) {
|
|
419
|
+
const key = atomicStyle.property, isAnimatedAndAnimateOnly = styleProps.isAnimated && styleProps.noClassNames && (!props.animateOnly || props.animateOnly.includes(key)), nonAnimatedAnimateOnly = !isAnimatedAndAnimateOnly && !styleProps.isAnimated && props.animateOnly?.includes(key);
|
|
420
|
+
isAnimatedAndAnimateOnly ? (retainedStyles ||= {}, retainedStyles[key] = style[key]) : nonAnimatedAnimateOnly ? (retainedStyles ||= {}, retainedStyles[key] = atomicStyle.value, shouldRetain = !0) : (addStyleToInsertRules(rulesToInsert, atomicStyle), mergeClassName(
|
|
421
|
+
transforms,
|
|
422
|
+
classNames,
|
|
423
|
+
key,
|
|
424
|
+
atomicStyle.identifier,
|
|
425
|
+
!1,
|
|
426
|
+
!0
|
|
427
|
+
));
|
|
734
428
|
}
|
|
429
|
+
(shouldRetain || !IS_STATIC && !styleProps.keepStyleSSR) && (style = retainedStyles || {});
|
|
735
430
|
}
|
|
736
431
|
}
|
|
737
|
-
if (
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
} else {
|
|
743
|
-
const atomic = (0, import_getStylesAtomic.getStylesAtomic)(style);
|
|
744
|
-
for (const atomicStyle of atomic) {
|
|
745
|
-
const key = atomicStyle.property;
|
|
746
|
-
const isAnimatedAndAnimateOnly = styleProps.isAnimated && styleProps.noClassNames && (!props.animateOnly || props.animateOnly.includes(key));
|
|
747
|
-
const nonAnimatedAnimateOnly = !isAnimatedAndAnimateOnly && !styleProps.isAnimated && ((_d = props.animateOnly) == null ? void 0 : _d.includes(key));
|
|
748
|
-
if (isAnimatedAndAnimateOnly) {
|
|
749
|
-
retainedStyles || (retainedStyles = {});
|
|
750
|
-
retainedStyles[key] = style[key];
|
|
751
|
-
} else if (nonAnimatedAnimateOnly) {
|
|
752
|
-
retainedStyles || (retainedStyles = {});
|
|
753
|
-
retainedStyles[key] = atomicStyle.value;
|
|
754
|
-
shouldRetain = true;
|
|
755
|
-
} else {
|
|
756
|
-
addStyleToInsertRules(rulesToInsert, atomicStyle);
|
|
757
|
-
mergeClassName(
|
|
758
|
-
transforms,
|
|
759
|
-
classNames,
|
|
760
|
-
key,
|
|
761
|
-
atomicStyle.identifier,
|
|
762
|
-
false,
|
|
763
|
-
true
|
|
764
|
-
);
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
if (shouldRetain || !IS_STATIC && !styleProps.keepStyleSSR) {
|
|
768
|
-
style = retainedStyles || {};
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
if (transforms) {
|
|
773
|
-
for (const namespace in transforms) {
|
|
774
|
-
if (!transforms[namespace]) {
|
|
775
|
-
if (process.env.NODE_ENV === "development") {
|
|
776
|
-
console.warn("Error no transform", transforms, namespace);
|
|
777
|
-
}
|
|
778
|
-
continue;
|
|
779
|
-
}
|
|
780
|
-
const [hash, val] = transforms[namespace];
|
|
781
|
-
const identifier = `_transform${hash}`;
|
|
782
|
-
if (import_constants.isClient && !import_insertStyleRule.insertedTransforms[identifier]) {
|
|
783
|
-
const rule = `.${identifier} { transform: ${val}; }`;
|
|
784
|
-
addStyleToInsertRules(rulesToInsert, {
|
|
785
|
-
identifier,
|
|
786
|
-
rules: [rule],
|
|
787
|
-
property: namespace
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
classNames[namespace] = identifier;
|
|
432
|
+
if (transforms)
|
|
433
|
+
for (const namespace in transforms) {
|
|
434
|
+
if (!transforms[namespace]) {
|
|
435
|
+
process.env.NODE_ENV === "development" && console.warn("Error no transform", transforms, namespace);
|
|
436
|
+
continue;
|
|
791
437
|
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
if (isFocusable === false) {
|
|
801
|
-
viewProps.tabIndex = "-1";
|
|
802
|
-
}
|
|
803
|
-
if (
|
|
804
|
-
// These native elements are focusable by default
|
|
805
|
-
elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea"
|
|
806
|
-
) {
|
|
807
|
-
if (isFocusable === false || props.accessibilityDisabled === true) {
|
|
808
|
-
viewProps.tabIndex = "-1";
|
|
809
|
-
}
|
|
810
|
-
} else if (
|
|
811
|
-
// These roles are made focusable by default
|
|
812
|
-
role === "button" || role === "checkbox" || role === "link" || role === "radio" || // @ts-expect-error (consistent with RNW)
|
|
813
|
-
role === "textbox" || role === "switch"
|
|
814
|
-
) {
|
|
815
|
-
if (isFocusable !== false) {
|
|
816
|
-
viewProps.tabIndex = "0";
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
if (isFocusable) {
|
|
820
|
-
viewProps.tabIndex = "0";
|
|
821
|
-
delete viewProps.focusable;
|
|
822
|
-
}
|
|
438
|
+
const [hash, val] = transforms[namespace], identifier = `_transform${hash}`;
|
|
439
|
+
if (import_constants.isClient && !import_insertStyleRule.insertedTransforms[identifier]) {
|
|
440
|
+
const rule = `.${identifier} { transform: ${val}; }`;
|
|
441
|
+
addStyleToInsertRules(rulesToInsert, {
|
|
442
|
+
identifier,
|
|
443
|
+
rules: [rule],
|
|
444
|
+
property: namespace
|
|
445
|
+
});
|
|
823
446
|
}
|
|
447
|
+
classNames[namespace] = identifier;
|
|
824
448
|
}
|
|
449
|
+
if (import_constants.isWeb && !isReactNative && viewProps.tabIndex == null) {
|
|
450
|
+
const isFocusable = viewProps.focusable ?? viewProps.accessible;
|
|
451
|
+
viewProps.focusable && delete viewProps.focusable;
|
|
452
|
+
const role = viewProps.role;
|
|
453
|
+
isFocusable === !1 && (viewProps.tabIndex = "-1"), // These native elements are focusable by default
|
|
454
|
+
elementType === "a" || elementType === "button" || elementType === "input" || elementType === "select" || elementType === "textarea" ? (isFocusable === !1 || props.accessibilityDisabled === !0) && (viewProps.tabIndex = "-1") : (
|
|
455
|
+
// These roles are made focusable by default
|
|
456
|
+
(role === "button" || role === "checkbox" || role === "link" || role === "radio" || // @ts-expect-error (consistent with RNW)
|
|
457
|
+
role === "textbox" || role === "switch") && isFocusable !== !1 && (viewProps.tabIndex = "0")
|
|
458
|
+
), isFocusable && (viewProps.tabIndex = "0", delete viewProps.focusable);
|
|
825
459
|
}
|
|
826
460
|
const result = {
|
|
827
461
|
space,
|
|
@@ -837,110 +471,57 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
837
471
|
pseudoGroups,
|
|
838
472
|
mediaGroups
|
|
839
473
|
};
|
|
840
|
-
if (process.env.
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
console.log(
|
|
854
|
-
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
if (className) {
|
|
858
|
-
classNames.className = className;
|
|
859
|
-
}
|
|
860
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
861
|
-
if (import_isDevTools.isDevTools) {
|
|
862
|
-
console.groupCollapsed(" \u{1F539} ===>");
|
|
863
|
-
try {
|
|
864
|
-
const logs = {
|
|
865
|
-
...result,
|
|
866
|
-
componentState,
|
|
867
|
-
transforms,
|
|
868
|
-
viewProps,
|
|
869
|
-
viewPropsOrder: Object.keys(viewProps),
|
|
870
|
-
rulesToInsert,
|
|
871
|
-
parentSplitStyles
|
|
872
|
-
};
|
|
873
|
-
for (const key in logs) {
|
|
874
|
-
console.log(key, logs[key]);
|
|
875
|
-
}
|
|
876
|
-
} catch {
|
|
877
|
-
}
|
|
878
|
-
console.groupEnd();
|
|
474
|
+
if (className && (classNames.className = className), process.env.NODE_ENV === "development" && debug === "verbose" && import_isDevTools.isDevTools) {
|
|
475
|
+
console.groupCollapsed(" \u{1F539} ===>");
|
|
476
|
+
try {
|
|
477
|
+
const logs = {
|
|
478
|
+
...result,
|
|
479
|
+
componentState,
|
|
480
|
+
transforms,
|
|
481
|
+
viewProps,
|
|
482
|
+
viewPropsOrder: Object.keys(viewProps),
|
|
483
|
+
rulesToInsert,
|
|
484
|
+
parentSplitStyles
|
|
485
|
+
};
|
|
486
|
+
for (const key in logs)
|
|
487
|
+
console.log(key, logs[key]);
|
|
488
|
+
} catch {
|
|
879
489
|
}
|
|
490
|
+
console.groupEnd();
|
|
880
491
|
}
|
|
881
492
|
return result;
|
|
882
493
|
};
|
|
883
|
-
function mergeClassName(transforms, classNames, key, val, isMediaOrPseudo =
|
|
884
|
-
if (
|
|
885
|
-
if (!val)
|
|
886
|
-
return;
|
|
494
|
+
function mergeClassName(transforms, classNames, key, val, isMediaOrPseudo = !1, isInsertingNow = !1) {
|
|
495
|
+
if (val)
|
|
887
496
|
if (!isInsertingNow && val[0] === "_" && val.startsWith("_transform-")) {
|
|
888
497
|
const ns = isMediaOrPseudo ? key : "transform";
|
|
889
498
|
let transform = import_insertStyleRule.insertedTransforms[val];
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
transform = import_insertStyleRule.insertedTransforms[val];
|
|
893
|
-
if (!transform && import_constants.isWeb && val[0] !== "_") {
|
|
894
|
-
transform = val;
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
transforms[ns] || (transforms[ns] = ["", ""]);
|
|
898
|
-
transforms[ns][0] += val.replace("_transform", "");
|
|
899
|
-
if (transform) {
|
|
900
|
-
transforms[ns][1] += transform;
|
|
901
|
-
}
|
|
902
|
-
} else {
|
|
499
|
+
import_constants.isClient && !transform && ((0, import_insertStyleRule.scanAllSheets)(), transform = import_insertStyleRule.insertedTransforms[val], !transform && import_constants.isWeb && val[0] !== "_" && (transform = val)), transforms[ns] ||= ["", ""], transforms[ns][0] += val.replace("_transform", ""), transform && (transforms[ns][1] += transform);
|
|
500
|
+
} else
|
|
903
501
|
classNames[key] = val;
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
502
|
}
|
|
907
503
|
function mergeStyle(styleState, key, val) {
|
|
908
504
|
const { classNames, viewProps, style, usedKeys } = styleState;
|
|
909
|
-
if (import_constants.isWeb &&
|
|
910
|
-
classNames[key] = val;
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
styleState.transforms[key] = val;
|
|
915
|
-
} else {
|
|
505
|
+
if (import_constants.isWeb && val?.[0] === "_")
|
|
506
|
+
classNames[key] = val, usedKeys[key] ||= 1;
|
|
507
|
+
else if (key in import_helpers.stylePropsTransform)
|
|
508
|
+
styleState.transforms ||= {}, styleState.transforms[key] = val;
|
|
509
|
+
else {
|
|
916
510
|
const out = import_constants.isWeb ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
917
|
-
|
|
918
|
-
viewProps[key] = out;
|
|
919
|
-
} else {
|
|
920
|
-
style[key] = out;
|
|
921
|
-
}
|
|
511
|
+
key in import_helpers.validStylesOnBaseProps ? viewProps[key] = out : style[key] = out;
|
|
922
512
|
}
|
|
923
513
|
}
|
|
924
514
|
const getSubStyle = (styleState, subKey, styleIn, avoidMergeTransform) => {
|
|
925
|
-
const { staticConfig, props, conf: conf2 } = styleState;
|
|
926
|
-
const styleOut = {};
|
|
515
|
+
const { staticConfig, props, conf: conf2 } = styleState, styleOut = {};
|
|
927
516
|
for (let key in styleIn) {
|
|
928
517
|
const val = styleIn[key];
|
|
929
518
|
key = conf2.shorthands[key] || key;
|
|
930
519
|
const expanded = (0, import_propMapper.propMapper)(key, val, styleState, { ...props, ...props[subKey] });
|
|
931
|
-
if (!expanded || !staticConfig.isHOC && key in skipProps)
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
for (const [skey, sval] of expanded) {
|
|
935
|
-
if (!avoidMergeTransform && skey in import_helpers.stylePropsTransform) {
|
|
936
|
-
mergeTransform(styleOut, skey, sval);
|
|
937
|
-
} else {
|
|
938
|
-
styleOut[skey] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
939
|
-
}
|
|
940
|
-
}
|
|
520
|
+
if (!(!expanded || !staticConfig.isHOC && key in skipProps))
|
|
521
|
+
for (const [skey, sval] of expanded)
|
|
522
|
+
!avoidMergeTransform && skey in import_helpers.stylePropsTransform ? mergeTransform(styleOut, skey, sval) : styleOut[skey] = (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(sval, key);
|
|
941
523
|
}
|
|
942
|
-
(0, import_expandStyles.fixStyles)(styleOut);
|
|
943
|
-
return styleOut;
|
|
524
|
+
return (0, import_expandStyles.fixStyles)(styleOut), styleOut;
|
|
944
525
|
};
|
|
945
526
|
function mergeStyleProp(styleState, val) {
|
|
946
527
|
if (!val)
|
|
@@ -949,36 +530,22 @@ function mergeStyleProp(styleState, val) {
|
|
|
949
530
|
for (const cur of styles) {
|
|
950
531
|
if (!cur)
|
|
951
532
|
continue;
|
|
952
|
-
|
|
953
|
-
if (isRNW) {
|
|
533
|
+
if (cur.$$css)
|
|
954
534
|
Object.assign(styleState.classNames, cur);
|
|
955
|
-
|
|
956
|
-
for (const key in cur)
|
|
957
|
-
|
|
958
|
-
continue;
|
|
959
|
-
}
|
|
960
|
-
mergeStyle(styleState, key, cur[key]);
|
|
961
|
-
}
|
|
962
|
-
}
|
|
535
|
+
else
|
|
536
|
+
for (const key in cur)
|
|
537
|
+
key in styleState.usedKeys || mergeStyle(styleState, key, cur[key]);
|
|
963
538
|
}
|
|
964
539
|
}
|
|
965
540
|
const useInsertEffectCompat = import_constants.isWeb ? import_react.useInsertionEffect || import_constants.useIsomorphicLayoutEffect : () => {
|
|
966
|
-
}
|
|
967
|
-
const useSplitStyles = (...args) => {
|
|
541
|
+
}, useSplitStyles = (...args) => {
|
|
968
542
|
const res = getSplitStyles(...args);
|
|
969
|
-
useInsertEffectCompat(() => {
|
|
543
|
+
return useInsertEffectCompat(() => {
|
|
970
544
|
(0, import_insertStyleRule.insertStyleRules)(res.rulesToInsert);
|
|
971
|
-
}, [res.rulesToInsert]);
|
|
972
|
-
return res;
|
|
545
|
+
}, [res.rulesToInsert]), res;
|
|
973
546
|
};
|
|
974
547
|
function addStyleToInsertRules(rulesToInsert, styleObject) {
|
|
975
|
-
|
|
976
|
-
if (!(0, import_insertStyleRule.shouldInsertStyleRules)(styleObject.identifier)) {
|
|
977
|
-
return;
|
|
978
|
-
}
|
|
979
|
-
(0, import_insertStyleRule.updateRules)(styleObject.identifier, styleObject.rules);
|
|
980
|
-
rulesToInsert.push(styleObject);
|
|
981
|
-
}
|
|
548
|
+
(0, import_insertStyleRule.shouldInsertStyleRules)(styleObject.identifier) && ((0, import_insertStyleRule.updateRules)(styleObject.identifier, styleObject.rules), rulesToInsert.push(styleObject));
|
|
982
549
|
}
|
|
983
550
|
function processIDRefList(idRefList) {
|
|
984
551
|
return Array.isArray(idRefList) ? idRefList.join(" ") : idRefList;
|
|
@@ -991,23 +558,14 @@ const animatableDefaults = {
|
|
|
991
558
|
rotateX: "0deg",
|
|
992
559
|
x: 0,
|
|
993
560
|
y: 0
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
const hyphenate = (str) => str.replace(/[A-Z]/g, lowercaseHyphenate);
|
|
997
|
-
const mergeTransform = (obj, key, val, backwards = false) => {
|
|
998
|
-
if (typeof obj.transform === "string") {
|
|
999
|
-
return;
|
|
1000
|
-
}
|
|
1001
|
-
obj.transform || (obj.transform = []);
|
|
1002
|
-
obj.transform[backwards ? "unshift" : "push"]({
|
|
561
|
+
}, lowercaseHyphenate = (match) => `-${match.toLowerCase()}`, hyphenate = (str) => str.replace(/[A-Z]/g, lowercaseHyphenate), mergeTransform = (obj, key, val, backwards = !1) => {
|
|
562
|
+
typeof obj.transform != "string" && (obj.transform ||= [], obj.transform[backwards ? "unshift" : "push"]({
|
|
1003
563
|
[mapTransformKeys[key] || key]: val
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
const mapTransformKeys = {
|
|
564
|
+
}));
|
|
565
|
+
}, mapTransformKeys = {
|
|
1007
566
|
x: "translateX",
|
|
1008
567
|
y: "translateY"
|
|
1009
|
-
}
|
|
1010
|
-
const skipProps = {
|
|
568
|
+
}, skipProps = {
|
|
1011
569
|
untilMeasured: 1,
|
|
1012
570
|
animation: 1,
|
|
1013
571
|
space: 1,
|
|
@@ -1021,31 +579,12 @@ const skipProps = {
|
|
|
1021
579
|
// handled after loop so pseudos set usedKeys and override it if necessary
|
|
1022
580
|
group: 1
|
|
1023
581
|
};
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
wordWrap: 1,
|
|
1031
|
-
textOverflow: 1,
|
|
1032
|
-
textDecorationDistance: 1,
|
|
1033
|
-
cursor: 1,
|
|
1034
|
-
contain: 1,
|
|
1035
|
-
boxSizing: 1,
|
|
1036
|
-
boxShadow: 1,
|
|
1037
|
-
outlineStyle: 1,
|
|
1038
|
-
outlineOffset: 1,
|
|
1039
|
-
outlineWidth: 1,
|
|
1040
|
-
outlineColor: 1
|
|
1041
|
-
});
|
|
1042
|
-
} else {
|
|
1043
|
-
Object.assign(skipProps, {
|
|
1044
|
-
elevationAndroid: 1,
|
|
1045
|
-
allowFontScaling: true,
|
|
1046
|
-
adjustsFontSizeToFit: true
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
582
|
+
process.env.NODE_ENV === "test" && (skipProps["data-test-renders"] = 1);
|
|
583
|
+
Object.assign(skipProps, {
|
|
584
|
+
elevationAndroid: 1,
|
|
585
|
+
allowFontScaling: !0,
|
|
586
|
+
adjustsFontSizeToFit: !0
|
|
587
|
+
});
|
|
1049
588
|
const accessibilityRoleToWebRole = {
|
|
1050
589
|
adjustable: "slider",
|
|
1051
590
|
header: "heading",
|
|
@@ -1054,17 +593,15 @@ const accessibilityRoleToWebRole = {
|
|
|
1054
593
|
none: "presentation",
|
|
1055
594
|
summary: "region"
|
|
1056
595
|
};
|
|
1057
|
-
function passDownProp(viewProps, key, val, shouldMergeObject =
|
|
596
|
+
function passDownProp(viewProps, key, val, shouldMergeObject = !1) {
|
|
1058
597
|
if (shouldMergeObject) {
|
|
1059
598
|
const next = {
|
|
1060
599
|
...viewProps[key],
|
|
1061
600
|
...val
|
|
1062
601
|
};
|
|
1063
|
-
delete viewProps[key];
|
|
1064
|
-
|
|
1065
|
-
} else {
|
|
602
|
+
delete viewProps[key], viewProps[key] = next;
|
|
603
|
+
} else
|
|
1066
604
|
viewProps[key] = val;
|
|
1067
|
-
}
|
|
1068
605
|
}
|
|
1069
606
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1070
607
|
0 && (module.exports = {
|