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