@tamagui/web 3.0.0-beta.807.1 → 3.0.0-beta.881.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/config.cjs +1 -1
- package/dist/cjs/config.native.cjs +1 -1
- package/dist/cjs/config.native.js +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +40 -19
- package/dist/cjs/createComponent.native.cjs +42 -21
- package/dist/cjs/createComponent.native.js +42 -21
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +54 -4
- package/dist/cjs/createStyledHOC.native.cjs +55 -4
- package/dist/cjs/createStyledHOC.native.js +55 -4
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -1
- package/dist/cjs/createTokens.native.js +1 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +0 -10
- package/dist/cjs/createVariable.native.cjs +0 -10
- package/dist/cjs/createVariable.native.js +0 -10
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +147 -99
- package/dist/cjs/dom/htmlRuntime.native.cjs +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/primitives.native.cjs +16 -13
- package/dist/cjs/dom/primitives.native.js +16 -13
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/helpers/borderComponents.cjs +62 -0
- package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
- package/dist/cjs/helpers/borderComponents.native.js +84 -0
- package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
- package/dist/cjs/helpers/componentDisplayName.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
- package/dist/cjs/helpers/createStyledContext.cjs +10 -18
- package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.js +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +133 -114
- package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +1063 -2168
- package/dist/cjs/helpers/getSplitStyles.native.cjs +1115 -2515
- package/dist/cjs/helpers/getSplitStyles.native.js +1115 -2515
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/grammarConfig.cjs +163 -1
- package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +9 -8
- package/dist/cjs/helpers/log.native.cjs +9 -8
- package/dist/cjs/helpers/log.native.js +9 -8
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.cjs +44 -13
- package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeStyleEngine.cjs +34 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
- package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/cjs/helpers/splitStyleProps.cjs +46 -0
- package/dist/cjs/helpers/splitStyleProps.native.cjs +49 -0
- package/dist/cjs/helpers/splitStyleProps.native.js +51 -0
- package/dist/cjs/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/cjs/helpers/{getDefaultProps.native.cjs → styleStaticConfig.cjs} +7 -8
- package/dist/cjs/helpers/{getDefaultProps.native.js → styleStaticConfig.native.cjs} +7 -8
- package/dist/cjs/helpers/styleStaticConfig.native.js +31 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/cjs/helpers/styledDynamic.cjs +160 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
- package/dist/cjs/helpers/styledDynamic.native.js +197 -0
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +12 -74
- package/dist/cjs/helpers/tokenCategories.native.cjs +12 -76
- package/dist/cjs/helpers/tokenCategories.native.js +12 -76
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variableValue.cjs +17 -12
- package/dist/cjs/helpers/variableValue.native.cjs +46 -23
- package/dist/cjs/helpers/variableValue.native.js +46 -23
- package/dist/cjs/helpers/variableValue.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +5 -4
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
- package/dist/cjs/helpers/warnOnce.native.js +6 -4
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +41 -82
- package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
- package/dist/cjs/hooks/useComponentState.native.js +45 -84
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.js +2 -2
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/{helpers/getDefaultProps.cjs → hooks/useStyle.cjs} +10 -4
- package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.native.cjs} +16 -6
- package/dist/cjs/hooks/useStyle.native.js +34 -0
- package/dist/cjs/hooks/useStyle.native.js.map +1 -0
- package/dist/cjs/hooks/useThemeState.cjs +25 -90
- package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
- package/dist/cjs/hooks/useThemeState.native.js +34 -94
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -12
- package/dist/cjs/index.native.cjs +9 -12
- package/dist/cjs/index.native.js +9 -12
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +8 -7
- package/dist/cjs/internal-runtime.native.cjs +8 -7
- package/dist/cjs/internal-runtime.native.js +8 -7
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +8 -7
- package/dist/cjs/static-resolve.native.cjs +8 -7
- package/dist/cjs/static-resolve.native.js +8 -7
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +91 -0
- package/dist/cjs/style.native.cjs +98 -0
- package/dist/cjs/style.native.js +100 -0
- package/dist/cjs/style.native.js.map +1 -0
- package/dist/cjs/styled.cjs +15 -62
- package/dist/cjs/styled.native.cjs +15 -64
- package/dist/cjs/styled.native.js +15 -64
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +4 -22
- package/dist/cjs/types.native.cjs +4 -22
- package/dist/cjs/types.native.js +4 -22
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +21 -14
- package/dist/cjs/views/Text.native.cjs +5 -2
- package/dist/cjs/views/Text.native.js +5 -2
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +2 -2
- package/dist/cjs/views/Theme.native.cjs +2 -2
- package/dist/cjs/views/Theme.native.js +2 -2
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -4
- package/dist/cjs/views/View.cjs +4 -2
- package/dist/cjs/views/View.native.cjs +4 -2
- package/dist/cjs/views/View.native.js +4 -2
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +41 -20
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +43 -22
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +55 -5
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +56 -5
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +1 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +1 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +1 -9
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +1 -9
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +147 -99
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/htmlRuntime.native.js +7 -3
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/primitives.native.js +16 -13
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/helpers/borderComponents.mjs +37 -0
- package/dist/esm/helpers/borderComponents.mjs.map +1 -0
- package/dist/esm/helpers/borderComponents.native.js +55 -0
- package/dist/esm/helpers/borderComponents.native.js.map +1 -0
- package/dist/esm/helpers/componentDisplayName.mjs +1 -8
- package/dist/esm/helpers/componentDisplayName.mjs.map +1 -1
- package/dist/esm/helpers/componentDisplayName.native.js +1 -8
- package/dist/esm/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +0 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs +10 -18
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +14 -18
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +8 -10
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +8 -10
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +131 -114
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
- package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.mjs +5 -1
- package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
- package/dist/esm/helpers/getDynamicVal.native.js +5 -1
- package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +1052 -2151
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +1090 -2481
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +164 -2
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +187 -2
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +5 -2
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +7 -2
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +9 -8
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +9 -8
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.mjs +44 -13
- package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +79 -14
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.mjs +34 -15
- package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
- package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
- package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
- package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
- package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
- package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/esm/helpers/splitStyleProps.mjs +27 -0
- package/dist/esm/helpers/splitStyleProps.mjs.map +1 -0
- package/dist/esm/helpers/splitStyleProps.native.js +28 -0
- package/dist/esm/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +8 -0
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.native.js +8 -0
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/esm/helpers/styledDynamic.mjs +136 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
- package/dist/esm/helpers/styledDynamic.native.js +169 -0
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +12 -72
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +12 -74
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variableValue.mjs +17 -12
- package/dist/esm/helpers/variableValue.mjs.map +1 -1
- package/dist/esm/helpers/variableValue.native.js +46 -23
- package/dist/esm/helpers/variableValue.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +5 -4
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -4
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +41 -82
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +45 -84
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -2
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +2 -2
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +2 -2
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useStyle.mjs +11 -0
- package/dist/esm/hooks/useStyle.mjs.map +1 -0
- package/dist/esm/hooks/useStyle.native.js +11 -0
- package/dist/esm/hooks/useStyle.native.js.map +1 -0
- package/dist/esm/hooks/useThemeState.mjs +25 -90
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +34 -94
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/index.native.js +8 -8
- package/dist/esm/internal-runtime.mjs +8 -7
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +8 -7
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +11 -9
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +11 -9
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +58 -0
- package/dist/esm/style.mjs.map +1 -0
- package/dist/esm/style.native.js +63 -0
- package/dist/esm/style.native.js.map +1 -0
- package/dist/esm/styled.mjs +17 -62
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +17 -64
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +3 -21
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +3 -21
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +1 -2
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +1 -2
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +21 -14
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +4 -2
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +2 -2
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +2 -2
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -4
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/View.mjs +4 -2
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js +4 -2
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +15 -15
- package/src/config.ts +1 -1
- package/src/createComponent.tsx +62 -31
- package/src/createStyledHOC.tsx +56 -9
- package/src/createTokens.ts +1 -1
- package/src/createVariable.ts +0 -10
- package/src/dom/html.tsx +778 -877
- package/src/dom/htmlRuntime.native.tsx +7 -3
- package/src/dom/primitives.native.tsx +30 -39
- package/src/helpers/borderComponents.ts +62 -0
- package/src/helpers/componentDisplayName.ts +0 -11
- package/src/helpers/createDesignSystem.ts +0 -2
- package/src/helpers/createStyledContext.tsx +15 -53
- package/src/helpers/formatDiagnostic.ts +11 -13
- package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
- package/src/helpers/getCSSStylesAtomic.ts +197 -206
- package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
- package/src/helpers/getDynamicVal.ts +4 -0
- package/src/helpers/getSplitStyles.tsx +2058 -4052
- package/src/helpers/grammarConfig.ts +218 -1
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/log.ts +12 -11
- package/src/helpers/mergeVariants.ts +55 -18
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeStyleEngine.ts +55 -14
- package/src/helpers/normalizeValueWithProperty.ts +10 -12
- package/src/helpers/parseBorderShorthand.native.ts +23 -45
- package/src/helpers/parseOutlineShorthand.native.ts +9 -40
- package/src/helpers/resolveSafeArea.ts +34 -101
- package/src/helpers/resolveVariantStyle.ts +77 -0
- package/src/helpers/splitStyleProps.ts +166 -0
- package/src/helpers/styleFrontend.ts +16 -9
- package/src/helpers/styleStaticConfig.ts +21 -0
- package/src/helpers/styleStaticConfigCore.ts +110 -0
- package/src/helpers/styledDynamic.ts +191 -0
- package/src/helpers/tokenCategories.ts +32 -88
- package/src/helpers/variableValue.ts +20 -15
- package/src/helpers/warnOnce.ts +5 -4
- package/src/hooks/useAnimationDriver.ts +6 -2
- package/src/hooks/useComponentState.ts +55 -183
- package/src/hooks/useMedia.tsx +10 -8
- package/src/hooks/useSplitStyles.tsx +17 -2
- package/src/hooks/useStyle.ts +10 -0
- package/src/hooks/useTheme.tsx +1 -1
- package/src/hooks/useThemeState.ts +51 -264
- package/src/index.ts +14 -10
- package/src/internal-runtime.ts +10 -9
- package/src/internalRuntimeTypes.ts +1 -0
- package/src/static-resolve.ts +25 -18
- package/src/style.ts +97 -0
- package/src/styled.tsx +46 -332
- package/src/types.tsx +107 -192
- package/src/views/TamaguiProvider.tsx +0 -2
- package/src/views/Text.tsx +26 -21
- package/src/views/Theme.tsx +10 -8
- package/src/views/ThemeDebug.tsx +0 -1
- package/src/views/View.tsx +6 -7
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createVariable.d.ts +0 -2
- package/types/createVariable.d.ts.map +1 -1
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/helpers/borderComponents.d.ts +10 -0
- package/types/helpers/borderComponents.d.ts.map +1 -0
- package/types/helpers/componentDisplayName.d.ts +0 -3
- package/types/helpers/componentDisplayName.d.ts.map +1 -1
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +25 -22
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
- package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
- package/types/helpers/getDynamicVal.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +9 -11
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts +25 -2
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +1 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/log.d.ts.map +1 -1
- package/types/helpers/mergeVariants.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts +0 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeStyleEngine.d.ts +6 -0
- package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
- package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
- package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
- package/types/helpers/resolveSafeArea.d.ts +0 -1
- package/types/helpers/resolveSafeArea.d.ts.map +1 -1
- package/types/helpers/resolveVariantStyle.d.ts +3 -0
- package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
- package/types/helpers/splitStyleProps.d.ts +44 -0
- package/types/helpers/splitStyleProps.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +7 -9
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +14 -0
- package/types/helpers/styleStaticConfig.d.ts.map +1 -0
- package/types/helpers/styleStaticConfigCore.d.ts +4 -0
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
- package/types/helpers/styledDynamic.d.ts +18 -0
- package/types/helpers/styledDynamic.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +0 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variableValue.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +68 -68
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +4 -0
- package/types/hooks/useStyle.d.ts.map +1 -0
- package/types/hooks/useThemeState.d.ts +1 -11
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +8 -8
- package/types/index.d.ts.map +1 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -1
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/static-resolve.d.ts +2 -2
- package/types/static-resolve.d.ts.map +1 -1
- package/types/style.d.ts +18 -0
- package/types/style.d.ts.map +1 -0
- package/types/styled.d.ts +12 -48
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +75 -60
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +0 -348
- package/dist/cjs/helpers/directStyleCSS.native.cjs +0 -20
- package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/cjs/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
- package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
- package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
- package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/cjs/helpers/themeable.cjs +0 -92
- package/dist/cjs/helpers/themeable.native.cjs +0 -95
- package/dist/cjs/helpers/themeable.native.js +0 -97
- package/dist/cjs/helpers/themeable.native.js.map +0 -1
- package/dist/cjs/hooks/useProps.cjs +0 -129
- package/dist/cjs/hooks/useProps.native.cjs +0 -135
- package/dist/cjs/hooks/useProps.native.js +0 -137
- package/dist/cjs/hooks/useProps.native.js.map +0 -1
- package/dist/esm/helpers/directStyleCSS.mjs +0 -320
- package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSS.native.js +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/esm/helpers/getDefaultProps.mjs +0 -4
- package/dist/esm/helpers/getDefaultProps.mjs.map +0 -1
- package/dist/esm/helpers/getDefaultProps.native.js +0 -6
- package/dist/esm/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/esm/helpers/getVariantExtras.mjs +0 -69
- package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
- package/dist/esm/helpers/getVariantExtras.native.js +0 -70
- package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/esm/helpers/themeable.mjs +0 -67
- package/dist/esm/helpers/themeable.mjs.map +0 -1
- package/dist/esm/helpers/themeable.native.js +0 -68
- package/dist/esm/helpers/themeable.native.js.map +0 -1
- package/dist/esm/hooks/useProps.mjs +0 -100
- package/dist/esm/hooks/useProps.mjs.map +0 -1
- package/dist/esm/hooks/useProps.native.js +0 -104
- package/dist/esm/hooks/useProps.native.js.map +0 -1
- package/src/helpers/directStyleCSS.native.ts +0 -1
- package/src/helpers/directStyleCSS.ts +0 -534
- package/src/helpers/directStyleCSSCompiled.ts +0 -32
- package/src/helpers/getDefaultProps.ts +0 -3
- package/src/helpers/getVariantExtras.tsx +0 -95
- package/src/helpers/themeable.tsx +0 -96
- package/src/hooks/useProps.tsx +0 -186
- package/types/helpers/directStyleCSS.d.ts +0 -28
- package/types/helpers/directStyleCSS.d.ts.map +0 -1
- package/types/helpers/directStyleCSS.native.d.ts +0 -2
- package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
- package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
- package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
- package/types/helpers/getDefaultProps.d.ts +0 -3
- package/types/helpers/getDefaultProps.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts +0 -4
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts +0 -3
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/hooks/useProps.d.ts +0 -39
- package/types/hooks/useProps.d.ts.map +0 -1
|
@@ -26,11 +26,9 @@ var import_is_equal_shallow = require("@tamagui/is-equal-shallow");
|
|
|
26
26
|
var import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr");
|
|
27
27
|
var import_react = require("react");
|
|
28
28
|
var import_config = require("../config.cjs");
|
|
29
|
-
var import_formatDiagnostic = require("../helpers/formatDiagnostic.cjs");
|
|
30
29
|
var import_isOptimizedForFirstRender = require("./isOptimizedForFirstRender.cjs");
|
|
31
30
|
var import_defaultComponentState = require("../defaultComponentState.cjs");
|
|
32
31
|
var import_isObj = require("../helpers/isObj.cjs");
|
|
33
|
-
var import_log = require("../helpers/log.cjs");
|
|
34
32
|
const useComponentState = (props, animationDriver, staticConfig, config) => {
|
|
35
33
|
"use no memo";
|
|
36
34
|
const isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
@@ -38,48 +36,42 @@ const useComponentState = (props, animationDriver, staticConfig, config) => {
|
|
|
38
36
|
const useAnimations = animationDriver?.isStub ? void 0 : animationDriver?.useAnimations;
|
|
39
37
|
const { isHOC } = staticConfig;
|
|
40
38
|
const stateRef = (0, import_react.useRef)(void 0);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
}
|
|
39
|
+
const curStateRef = stateRef.current ||= {
|
|
40
|
+
startedUnhydrated: needsHydration && !isHydrated,
|
|
41
|
+
optimizeForFirstRender: (0, import_isOptimizedForFirstRender.isOptimizedForFirstRender)()
|
|
42
|
+
};
|
|
47
43
|
const hasAnimationProp = Boolean(!isHOC && "transition" in props || props.style && hasAnimatedStyleValue(props.style));
|
|
48
44
|
const inputStyle = animationDriver?.inputStyle ?? "css";
|
|
49
45
|
const outputStyle = animationDriver?.outputStyle ?? "css";
|
|
50
|
-
const curStateRef = stateRef.current;
|
|
51
46
|
if (!needsHydration && hasAnimationProp) {
|
|
52
47
|
curStateRef.hasAnimated = true;
|
|
53
48
|
}
|
|
54
49
|
const platformPseudoPossible = Boolean(!isHOC && useAnimations && animationDriver?.avoidReRenders && (0, import_constants.getPlatformDriver)()?.pseudo);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return Boolean(next || curStateRef.hasAnimated);
|
|
58
|
-
})();
|
|
59
|
-
let willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
50
|
+
const willBeAnimatedClient = Boolean((hasAnimationProp || platformPseudoPossible) && !isHOC && useAnimations || curStateRef.hasAnimated);
|
|
51
|
+
const willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
60
52
|
if (willBeAnimated && hasAnimationProp && !curStateRef.hasAnimated) {
|
|
61
53
|
curStateRef.hasAnimated = true;
|
|
62
54
|
}
|
|
63
55
|
const { disableClassName } = props;
|
|
64
|
-
|
|
56
|
+
const animatePresenceOptIn = willBeAnimated && !isHOC && props["animatePresence"] !== false;
|
|
57
|
+
if (animatePresenceOptIn) {
|
|
65
58
|
curStateRef.shouldRegisterPresence = true;
|
|
66
59
|
} else {
|
|
67
60
|
curStateRef.shouldRegisterPresence ??= false;
|
|
68
61
|
}
|
|
69
62
|
const presenceResult = animationDriver?.usePresence?.(curStateRef) || null;
|
|
70
|
-
const presence =
|
|
63
|
+
const presence = animatePresenceOptIn ? presenceResult : null;
|
|
71
64
|
const presenceState = presence?.[2];
|
|
72
65
|
const isExiting = presenceState?.isPresent === false;
|
|
73
66
|
const isEntering = presenceState?.isPresent === true && presenceState.initial !== false;
|
|
74
67
|
const hasAnimationThatNeedsHydrate = hasAnimationProp && !isHydrated && inputStyle !== "css";
|
|
75
|
-
const initialState = { ...import_defaultComponentState.defaultComponentStateMounted };
|
|
76
68
|
const disabled = isDisabled(props);
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
const [componentState, reactSetState] = (0, import_react.useState)(() => disabled != null ? {
|
|
70
|
+
...import_defaultComponentState.defaultComponentStateMounted,
|
|
71
|
+
disabled
|
|
72
|
+
} : import_defaultComponentState.defaultComponentStateMounted);
|
|
81
73
|
const initialStyleFrameUnmounted = curStateRef.initialStyleFrameUnmounted;
|
|
82
|
-
let state = !curStateRef.didFinalizeInitialStyleFrame && !isHOC || initialStyleFrameUnmounted !== void 0 ? { ...
|
|
74
|
+
let state = !curStateRef.didFinalizeInitialStyleFrame && !isHOC || initialStyleFrameUnmounted !== void 0 ? { ...componentState } : componentState;
|
|
83
75
|
if (!curStateRef.didFinalizeInitialStyleFrame && !isHOC) {
|
|
84
76
|
state.unmounted = true;
|
|
85
77
|
}
|
|
@@ -87,26 +79,22 @@ const useComponentState = (props, animationDriver, staticConfig, config) => {
|
|
|
87
79
|
state.unmounted = initialStyleFrameUnmounted;
|
|
88
80
|
}
|
|
89
81
|
if (props.forceStyle) {
|
|
90
|
-
if (state ===
|
|
82
|
+
if (state === componentState) state = { ...state };
|
|
91
83
|
state[props.forceStyle] = true;
|
|
92
84
|
}
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
curStateRef.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const setState = curStateRef.setState;
|
|
85
|
+
const setState = curStateRef.setState ||= (stateOrGetState) => {
|
|
86
|
+
const pendingUnmounted = curStateRef.initialStyleFrameUnmounted;
|
|
87
|
+
curStateRef.initialStyleFrameUnmounted = void 0;
|
|
88
|
+
reactSetState((previous) => {
|
|
89
|
+
const current = pendingUnmounted !== void 0 && previous.unmounted !== pendingUnmounted ? {
|
|
90
|
+
...previous,
|
|
91
|
+
unmounted: pendingUnmounted
|
|
92
|
+
} : previous;
|
|
93
|
+
return typeof stateOrGetState === "function" ? stateOrGetState(current) : stateOrGetState;
|
|
94
|
+
});
|
|
95
|
+
};
|
|
108
96
|
let isAnimated = willBeAnimated;
|
|
109
|
-
if (import_constants.isWeb && hasAnimationThatNeedsHydrate && !
|
|
97
|
+
if (import_constants.isWeb && hasAnimationThatNeedsHydrate && !isHOC && !isHydrated) {
|
|
110
98
|
isAnimated = false;
|
|
111
99
|
curStateRef.willHydrate = true;
|
|
112
100
|
}
|
|
@@ -118,36 +106,14 @@ const useComponentState = (props, animationDriver, staticConfig, config) => {
|
|
|
118
106
|
setState((_) => ({ ...state }));
|
|
119
107
|
}
|
|
120
108
|
const groupName = props.group;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (process.env.NODE_ENV === "development") {
|
|
128
|
-
const dbg = r.__debug;
|
|
129
|
-
if (dbg && update !== prev) {
|
|
130
|
-
console.groupCollapsed(`setStateShallow CHANGE`, "=>", update);
|
|
131
|
-
console.info(`previously`, prev);
|
|
132
|
-
console.trace();
|
|
133
|
-
console.groupEnd();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return update;
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
if (process.env.NODE_ENV === "development") {
|
|
141
|
-
;
|
|
142
|
-
stateRef.current.__debug = props.debug;
|
|
143
|
-
}
|
|
144
|
-
const setStateShallow = stateRef.current.baseSetStateShallow;
|
|
145
|
-
if (process.env.NODE_ENV === "development" && globalThis.time) globalThis.time`state-useCreateShallowSetState`;
|
|
109
|
+
const setStateShallow = curStateRef.baseSetStateShallow ||= (stateOrGetState) => {
|
|
110
|
+
setState((prev) => {
|
|
111
|
+
const next = typeof stateOrGetState === "function" ? stateOrGetState(prev) : stateOrGetState;
|
|
112
|
+
return (0, import_is_equal_shallow.mergeIfNotShallowEqual)(prev, next);
|
|
113
|
+
});
|
|
114
|
+
};
|
|
146
115
|
let outProps = props;
|
|
147
116
|
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
148
|
-
if (process.env.NODE_ENV === "development" && props.debug === "verbose") {
|
|
149
|
-
console.warn((0, import_formatDiagnostic.formatDiagnostic)("TAMAGUI_PRESENCE_STATE", staticConfig.Component?.displayName || staticConfig.Component?.name || "TamaguiComponent", "AnimatePresence supplied lifecycle state to an animated component", "Remove debug=\"verbose\" after inspecting the animation state", "presenceState", presenceState));
|
|
150
|
-
}
|
|
151
117
|
const { custom } = presenceState;
|
|
152
118
|
if ((0, import_isObj.isObj)(custom)) {
|
|
153
119
|
outProps = {
|
|
@@ -156,23 +122,16 @@ const useComponentState = (props, animationDriver, staticConfig, config) => {
|
|
|
156
122
|
};
|
|
157
123
|
}
|
|
158
124
|
}
|
|
159
|
-
let noClass = !import_constants.isWeb ||
|
|
160
|
-
if (
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const isAnimatedAndHydrated =
|
|
125
|
+
let noClass = !import_constants.isWeb || Boolean(props.forceStyle);
|
|
126
|
+
if (import_constants.isWeb) {
|
|
127
|
+
if (!isHydrated) {
|
|
128
|
+
noClass = false;
|
|
129
|
+
} else {
|
|
130
|
+
const isAnimatedAndHydrated = Boolean((hasAnimationProp || curStateRef.hasAnimated) && useAnimations && !isHOC);
|
|
165
131
|
const isClassNameDisabled = !staticConfig.acceptsClassName && ((0, import_config.getSetting)("disableSSR") || !state.unmounted);
|
|
166
|
-
const isDisabledManually = disableClassName && !state.unmounted;
|
|
132
|
+
const isDisabledManually = Boolean(disableClassName && !state.unmounted);
|
|
167
133
|
if (isAnimatedAndHydrated && outputStyle !== "css" || isDisabledManually || isClassNameDisabled) {
|
|
168
134
|
noClass = true;
|
|
169
|
-
if (process.env.NODE_ENV === "development" && props.debug === "verbose") {
|
|
170
|
-
(0, import_log.log)(`avoiding className`, {
|
|
171
|
-
isAnimatedAndHydrated,
|
|
172
|
-
isDisabledManually,
|
|
173
|
-
isClassNameDisabled
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
135
|
}
|
|
177
136
|
}
|
|
178
137
|
}
|
|
@@ -217,7 +176,7 @@ const useComponentState = (props, animationDriver, staticConfig, config) => {
|
|
|
217
176
|
result.platformPseudo = platformPseudo;
|
|
218
177
|
result.willBeAnimatedClient = nextWillBeAnimatedClient;
|
|
219
178
|
result.willBeAnimated = nextWillBeAnimated;
|
|
220
|
-
result.isAnimated = import_constants.isWeb && hasAnimationThatNeedsHydrate && !
|
|
179
|
+
result.isAnimated = import_constants.isWeb && hasAnimationThatNeedsHydrate && !isHOC && !isHydrated ? false : nextWillBeAnimated;
|
|
221
180
|
if (nextWillBeAnimated && !isHOC && props["animatePresence"] !== false) {
|
|
222
181
|
curStateRef.shouldRegisterPresence = true;
|
|
223
182
|
}
|
|
@@ -28,11 +28,9 @@ var import_is_equal_shallow = require("@tamagui/is-equal-shallow");
|
|
|
28
28
|
var import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr");
|
|
29
29
|
var import_react = require("react");
|
|
30
30
|
var import_config = require("../config.native.js");
|
|
31
|
-
var import_formatDiagnostic = require("../helpers/formatDiagnostic.native.js");
|
|
32
31
|
var import_isOptimizedForFirstRender = require("./isOptimizedForFirstRender.native.js");
|
|
33
32
|
var import_defaultComponentState = require("../defaultComponentState.native.js");
|
|
34
33
|
var import_isObj = require("../helpers/isObj.native.js");
|
|
35
|
-
var import_log = require("../helpers/log.native.js");
|
|
36
34
|
function _type_of(obj) {
|
|
37
35
|
"@swc/helpers - typeof";
|
|
38
36
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
@@ -40,57 +38,54 @@ function _type_of(obj) {
|
|
|
40
38
|
var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
41
39
|
"use no memo";
|
|
42
40
|
var _getPlatformDriver, _animationDriver_usePresence;
|
|
41
|
+
var _stateRef, _curStateRef, _curStateRef1;
|
|
43
42
|
var isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
44
43
|
var needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)();
|
|
45
44
|
var useAnimations = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? void 0 : animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.useAnimations;
|
|
46
45
|
var { isHOC } = staticConfig;
|
|
47
46
|
var stateRef = (0, import_react.useRef)(void 0);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
}
|
|
47
|
+
var curStateRef = (_stateRef = stateRef).current || (_stateRef.current = {
|
|
48
|
+
startedUnhydrated: needsHydration && !isHydrated,
|
|
49
|
+
optimizeForFirstRender: (0, import_isOptimizedForFirstRender.isOptimizedForFirstRender)()
|
|
50
|
+
});
|
|
54
51
|
var hasAnimationProp = Boolean(!isHOC && "transition" in props || props.style && hasAnimatedStyleValue(props.style));
|
|
55
52
|
var _animationDriver_inputStyle;
|
|
56
53
|
var inputStyle = (_animationDriver_inputStyle = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.inputStyle) !== null && _animationDriver_inputStyle !== void 0 ? _animationDriver_inputStyle : "css";
|
|
57
54
|
var _animationDriver_outputStyle;
|
|
58
55
|
var outputStyle = (_animationDriver_outputStyle = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.outputStyle) !== null && _animationDriver_outputStyle !== void 0 ? _animationDriver_outputStyle : "css";
|
|
59
|
-
var curStateRef = stateRef.current;
|
|
60
56
|
if (!needsHydration && hasAnimationProp) {
|
|
61
57
|
curStateRef.hasAnimated = true;
|
|
62
58
|
}
|
|
63
59
|
var platformPseudoPossible = Boolean(!isHOC && useAnimations && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && ((_getPlatformDriver = (0, import_constants.getPlatformDriver)()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo));
|
|
64
|
-
var willBeAnimatedClient = (
|
|
65
|
-
var next = !!((hasAnimationProp || platformPseudoPossible) && !isHOC && useAnimations);
|
|
66
|
-
return Boolean(next || curStateRef.hasAnimated);
|
|
67
|
-
})();
|
|
60
|
+
var willBeAnimatedClient = Boolean((hasAnimationProp || platformPseudoPossible) && !isHOC && useAnimations || curStateRef.hasAnimated);
|
|
68
61
|
var willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
69
62
|
if (willBeAnimated && hasAnimationProp && !curStateRef.hasAnimated) {
|
|
70
63
|
curStateRef.hasAnimated = true;
|
|
71
64
|
}
|
|
72
65
|
var { disableClassName } = props;
|
|
73
|
-
|
|
66
|
+
var animatePresenceOptIn = willBeAnimated && !isHOC && props["animatePresence"] !== false;
|
|
67
|
+
if (animatePresenceOptIn) {
|
|
74
68
|
curStateRef.shouldRegisterPresence = true;
|
|
75
69
|
} else {
|
|
76
|
-
var
|
|
70
|
+
var _curStateRef2;
|
|
77
71
|
var _shouldRegisterPresence;
|
|
78
|
-
(_shouldRegisterPresence = (
|
|
72
|
+
(_shouldRegisterPresence = (_curStateRef2 = curStateRef).shouldRegisterPresence) !== null && _shouldRegisterPresence !== void 0 ? _shouldRegisterPresence : _curStateRef2.shouldRegisterPresence = false;
|
|
79
73
|
}
|
|
80
74
|
var presenceResult = (animationDriver === null || animationDriver === void 0 ? void 0 : (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver, curStateRef)) || null;
|
|
81
|
-
var presence =
|
|
75
|
+
var presence = animatePresenceOptIn ? presenceResult : null;
|
|
82
76
|
var presenceState = presence === null || presence === void 0 ? void 0 : presence[2];
|
|
83
77
|
var isExiting = (presenceState === null || presenceState === void 0 ? void 0 : presenceState.isPresent) === false;
|
|
84
78
|
var isEntering = (presenceState === null || presenceState === void 0 ? void 0 : presenceState.isPresent) === true && presenceState.initial !== false;
|
|
85
79
|
var hasAnimationThatNeedsHydrate = hasAnimationProp && !isHydrated && inputStyle !== "css";
|
|
86
|
-
var initialState = { ...import_defaultComponentState.defaultComponentStateMounted };
|
|
87
80
|
var disabled = isDisabled(props);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
var [componentState, reactSetState] = (0, import_react.useState)(function() {
|
|
82
|
+
return disabled != null ? {
|
|
83
|
+
...import_defaultComponentState.defaultComponentStateMounted,
|
|
84
|
+
disabled
|
|
85
|
+
} : import_defaultComponentState.defaultComponentStateMounted;
|
|
86
|
+
});
|
|
92
87
|
var initialStyleFrameUnmounted = curStateRef.initialStyleFrameUnmounted;
|
|
93
|
-
var state = !curStateRef.didFinalizeInitialStyleFrame && !isHOC || initialStyleFrameUnmounted !== void 0 ? { ...
|
|
88
|
+
var state = !curStateRef.didFinalizeInitialStyleFrame && !isHOC || initialStyleFrameUnmounted !== void 0 ? { ...componentState } : componentState;
|
|
94
89
|
if (!curStateRef.didFinalizeInitialStyleFrame && !isHOC) {
|
|
95
90
|
state.unmounted = true;
|
|
96
91
|
}
|
|
@@ -98,26 +93,22 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
98
93
|
state.unmounted = initialStyleFrameUnmounted;
|
|
99
94
|
}
|
|
100
95
|
if (props.forceStyle) {
|
|
101
|
-
if (state ===
|
|
96
|
+
if (state === componentState) state = { ...state };
|
|
102
97
|
state[props.forceStyle] = true;
|
|
103
98
|
}
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
curStateRef.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
var setState = curStateRef.setState;
|
|
99
|
+
var setState = (_curStateRef = curStateRef).setState || (_curStateRef.setState = function(stateOrGetState) {
|
|
100
|
+
var pendingUnmounted = curStateRef.initialStyleFrameUnmounted;
|
|
101
|
+
curStateRef.initialStyleFrameUnmounted = void 0;
|
|
102
|
+
reactSetState(function(previous) {
|
|
103
|
+
var current = pendingUnmounted !== void 0 && previous.unmounted !== pendingUnmounted ? {
|
|
104
|
+
...previous,
|
|
105
|
+
unmounted: pendingUnmounted
|
|
106
|
+
} : previous;
|
|
107
|
+
return typeof stateOrGetState === "function" ? stateOrGetState(current) : stateOrGetState;
|
|
108
|
+
});
|
|
109
|
+
});
|
|
119
110
|
var isAnimated = willBeAnimated;
|
|
120
|
-
if (import_constants.isWeb && hasAnimationThatNeedsHydrate && !
|
|
111
|
+
if (import_constants.isWeb && hasAnimationThatNeedsHydrate && !isHOC && !isHydrated) {
|
|
121
112
|
isAnimated = false;
|
|
122
113
|
curStateRef.willHydrate = true;
|
|
123
114
|
}
|
|
@@ -131,37 +122,14 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
131
122
|
});
|
|
132
123
|
}
|
|
133
124
|
var groupName = props.group;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (process.env.NODE_ENV === "development") {
|
|
141
|
-
var dbg = r.__debug;
|
|
142
|
-
if (dbg && update !== prev) {
|
|
143
|
-
console.groupCollapsed(`setStateShallow CHANGE`, "=>", update);
|
|
144
|
-
console.info(`previously`, prev);
|
|
145
|
-
console.trace();
|
|
146
|
-
console.groupEnd();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return update;
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
if (process.env.NODE_ENV === "development") {
|
|
154
|
-
;
|
|
155
|
-
stateRef.current.__debug = props.debug;
|
|
156
|
-
}
|
|
157
|
-
var setStateShallow = stateRef.current.baseSetStateShallow;
|
|
158
|
-
if (process.env.NODE_ENV === "development" && globalThis.time) globalThis.time`state-useCreateShallowSetState`;
|
|
125
|
+
var setStateShallow = (_curStateRef1 = curStateRef).baseSetStateShallow || (_curStateRef1.baseSetStateShallow = function(stateOrGetState) {
|
|
126
|
+
setState(function(prev) {
|
|
127
|
+
var next = typeof stateOrGetState === "function" ? stateOrGetState(prev) : stateOrGetState;
|
|
128
|
+
return (0, import_is_equal_shallow.mergeIfNotShallowEqual)(prev, next);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
159
131
|
var outProps = props;
|
|
160
132
|
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
161
|
-
if (process.env.NODE_ENV === "development" && props.debug === "verbose") {
|
|
162
|
-
var _staticConfig_Component, _staticConfig_Component1;
|
|
163
|
-
console.warn((0, import_formatDiagnostic.formatDiagnostic)("TAMAGUI_PRESENCE_STATE", ((_staticConfig_Component = staticConfig.Component) === null || _staticConfig_Component === void 0 ? void 0 : _staticConfig_Component.displayName) || ((_staticConfig_Component1 = staticConfig.Component) === null || _staticConfig_Component1 === void 0 ? void 0 : _staticConfig_Component1.name) || "TamaguiComponent", "AnimatePresence supplied lifecycle state to an animated component", "Remove debug=\"verbose\" after inspecting the animation state", "presenceState", presenceState));
|
|
164
|
-
}
|
|
165
133
|
var { custom } = presenceState;
|
|
166
134
|
if ((0, import_isObj.isObj)(custom)) {
|
|
167
135
|
outProps = {
|
|
@@ -170,23 +138,16 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
170
138
|
};
|
|
171
139
|
}
|
|
172
140
|
}
|
|
173
|
-
var noClass = !import_constants.isWeb ||
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
var isAnimatedAndHydrated =
|
|
141
|
+
var noClass = !import_constants.isWeb || Boolean(props.forceStyle);
|
|
142
|
+
if (import_constants.isWeb) {
|
|
143
|
+
if (!isHydrated) {
|
|
144
|
+
noClass = false;
|
|
145
|
+
} else {
|
|
146
|
+
var isAnimatedAndHydrated = Boolean((hasAnimationProp || curStateRef.hasAnimated) && useAnimations && !isHOC);
|
|
179
147
|
var isClassNameDisabled = !staticConfig.acceptsClassName && ((0, import_config.getSetting)("disableSSR") || !state.unmounted);
|
|
180
|
-
var isDisabledManually = disableClassName && !state.unmounted;
|
|
148
|
+
var isDisabledManually = Boolean(disableClassName && !state.unmounted);
|
|
181
149
|
if (isAnimatedAndHydrated && outputStyle !== "css" || isDisabledManually || isClassNameDisabled) {
|
|
182
150
|
noClass = true;
|
|
183
|
-
if (process.env.NODE_ENV === "development" && props.debug === "verbose") {
|
|
184
|
-
(0, import_log.log)(`avoiding className`, {
|
|
185
|
-
isAnimatedAndHydrated,
|
|
186
|
-
isDisabledManually,
|
|
187
|
-
isClassNameDisabled
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
151
|
}
|
|
191
152
|
}
|
|
192
153
|
}
|
|
@@ -231,7 +192,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
231
192
|
result.platformPseudo = platformPseudo;
|
|
232
193
|
result.willBeAnimatedClient = nextWillBeAnimatedClient;
|
|
233
194
|
result.willBeAnimated = nextWillBeAnimated;
|
|
234
|
-
result.isAnimated = import_constants.isWeb && hasAnimationThatNeedsHydrate && !
|
|
195
|
+
result.isAnimated = import_constants.isWeb && hasAnimationThatNeedsHydrate && !isHOC && !isHydrated ? false : nextWillBeAnimated;
|
|
235
196
|
if (nextWillBeAnimated && !isHOC && props["animatePresence"] !== false) {
|
|
236
197
|
curStateRef.shouldRegisterPresence = true;
|
|
237
198
|
}
|
|
@@ -28,11 +28,9 @@ var import_is_equal_shallow = require("@tamagui/is-equal-shallow");
|
|
|
28
28
|
var import_use_did_finish_ssr = require("@tamagui/use-did-finish-ssr");
|
|
29
29
|
var import_react = require("react");
|
|
30
30
|
var import_config = require("../config.native.js");
|
|
31
|
-
var import_formatDiagnostic = require("../helpers/formatDiagnostic.native.js");
|
|
32
31
|
var import_isOptimizedForFirstRender = require("./isOptimizedForFirstRender.native.js");
|
|
33
32
|
var import_defaultComponentState = require("../defaultComponentState.native.js");
|
|
34
33
|
var import_isObj = require("../helpers/isObj.native.js");
|
|
35
|
-
var import_log = require("../helpers/log.native.js");
|
|
36
34
|
function _type_of(obj) {
|
|
37
35
|
"@swc/helpers - typeof";
|
|
38
36
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
@@ -40,57 +38,54 @@ function _type_of(obj) {
|
|
|
40
38
|
var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
41
39
|
"use no memo";
|
|
42
40
|
var _getPlatformDriver, _animationDriver_usePresence;
|
|
41
|
+
var _stateRef, _curStateRef, _curStateRef1;
|
|
43
42
|
var isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)();
|
|
44
43
|
var needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)();
|
|
45
44
|
var useAnimations = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? void 0 : animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.useAnimations;
|
|
46
45
|
var { isHOC } = staticConfig;
|
|
47
46
|
var stateRef = (0, import_react.useRef)(void 0);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
}
|
|
47
|
+
var curStateRef = (_stateRef = stateRef).current || (_stateRef.current = {
|
|
48
|
+
startedUnhydrated: needsHydration && !isHydrated,
|
|
49
|
+
optimizeForFirstRender: (0, import_isOptimizedForFirstRender.isOptimizedForFirstRender)()
|
|
50
|
+
});
|
|
54
51
|
var hasAnimationProp = Boolean(!isHOC && "transition" in props || props.style && hasAnimatedStyleValue(props.style));
|
|
55
52
|
var _animationDriver_inputStyle;
|
|
56
53
|
var inputStyle = (_animationDriver_inputStyle = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.inputStyle) !== null && _animationDriver_inputStyle !== void 0 ? _animationDriver_inputStyle : "css";
|
|
57
54
|
var _animationDriver_outputStyle;
|
|
58
55
|
var outputStyle = (_animationDriver_outputStyle = animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.outputStyle) !== null && _animationDriver_outputStyle !== void 0 ? _animationDriver_outputStyle : "css";
|
|
59
|
-
var curStateRef = stateRef.current;
|
|
60
56
|
if (!needsHydration && hasAnimationProp) {
|
|
61
57
|
curStateRef.hasAnimated = true;
|
|
62
58
|
}
|
|
63
59
|
var platformPseudoPossible = Boolean(!isHOC && useAnimations && (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.avoidReRenders) && ((_getPlatformDriver = (0, import_constants.getPlatformDriver)()) === null || _getPlatformDriver === void 0 ? void 0 : _getPlatformDriver.pseudo));
|
|
64
|
-
var willBeAnimatedClient = (
|
|
65
|
-
var next = !!((hasAnimationProp || platformPseudoPossible) && !isHOC && useAnimations);
|
|
66
|
-
return Boolean(next || curStateRef.hasAnimated);
|
|
67
|
-
})();
|
|
60
|
+
var willBeAnimatedClient = Boolean((hasAnimationProp || platformPseudoPossible) && !isHOC && useAnimations || curStateRef.hasAnimated);
|
|
68
61
|
var willBeAnimated = !import_constants.isServer && willBeAnimatedClient;
|
|
69
62
|
if (willBeAnimated && hasAnimationProp && !curStateRef.hasAnimated) {
|
|
70
63
|
curStateRef.hasAnimated = true;
|
|
71
64
|
}
|
|
72
65
|
var { disableClassName } = props;
|
|
73
|
-
|
|
66
|
+
var animatePresenceOptIn = willBeAnimated && !isHOC && props["animatePresence"] !== false;
|
|
67
|
+
if (animatePresenceOptIn) {
|
|
74
68
|
curStateRef.shouldRegisterPresence = true;
|
|
75
69
|
} else {
|
|
76
|
-
var
|
|
70
|
+
var _curStateRef2;
|
|
77
71
|
var _shouldRegisterPresence;
|
|
78
|
-
(_shouldRegisterPresence = (
|
|
72
|
+
(_shouldRegisterPresence = (_curStateRef2 = curStateRef).shouldRegisterPresence) !== null && _shouldRegisterPresence !== void 0 ? _shouldRegisterPresence : _curStateRef2.shouldRegisterPresence = false;
|
|
79
73
|
}
|
|
80
74
|
var presenceResult = (animationDriver === null || animationDriver === void 0 ? void 0 : (_animationDriver_usePresence = animationDriver.usePresence) === null || _animationDriver_usePresence === void 0 ? void 0 : _animationDriver_usePresence.call(animationDriver, curStateRef)) || null;
|
|
81
|
-
var presence =
|
|
75
|
+
var presence = animatePresenceOptIn ? presenceResult : null;
|
|
82
76
|
var presenceState = presence === null || presence === void 0 ? void 0 : presence[2];
|
|
83
77
|
var isExiting = (presenceState === null || presenceState === void 0 ? void 0 : presenceState.isPresent) === false;
|
|
84
78
|
var isEntering = (presenceState === null || presenceState === void 0 ? void 0 : presenceState.isPresent) === true && presenceState.initial !== false;
|
|
85
79
|
var hasAnimationThatNeedsHydrate = hasAnimationProp && !isHydrated && inputStyle !== "css";
|
|
86
|
-
var initialState = { ...import_defaultComponentState.defaultComponentStateMounted };
|
|
87
80
|
var disabled = isDisabled(props);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
var [componentState, reactSetState] = (0, import_react.useState)(function() {
|
|
82
|
+
return disabled != null ? {
|
|
83
|
+
...import_defaultComponentState.defaultComponentStateMounted,
|
|
84
|
+
disabled
|
|
85
|
+
} : import_defaultComponentState.defaultComponentStateMounted;
|
|
86
|
+
});
|
|
92
87
|
var initialStyleFrameUnmounted = curStateRef.initialStyleFrameUnmounted;
|
|
93
|
-
var state = !curStateRef.didFinalizeInitialStyleFrame && !isHOC || initialStyleFrameUnmounted !== void 0 ? { ...
|
|
88
|
+
var state = !curStateRef.didFinalizeInitialStyleFrame && !isHOC || initialStyleFrameUnmounted !== void 0 ? { ...componentState } : componentState;
|
|
94
89
|
if (!curStateRef.didFinalizeInitialStyleFrame && !isHOC) {
|
|
95
90
|
state.unmounted = true;
|
|
96
91
|
}
|
|
@@ -98,26 +93,22 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
98
93
|
state.unmounted = initialStyleFrameUnmounted;
|
|
99
94
|
}
|
|
100
95
|
if (props.forceStyle) {
|
|
101
|
-
if (state ===
|
|
96
|
+
if (state === componentState) state = { ...state };
|
|
102
97
|
state[props.forceStyle] = true;
|
|
103
98
|
}
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
curStateRef.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
var setState = curStateRef.setState;
|
|
99
|
+
var setState = (_curStateRef = curStateRef).setState || (_curStateRef.setState = function(stateOrGetState) {
|
|
100
|
+
var pendingUnmounted = curStateRef.initialStyleFrameUnmounted;
|
|
101
|
+
curStateRef.initialStyleFrameUnmounted = void 0;
|
|
102
|
+
reactSetState(function(previous) {
|
|
103
|
+
var current = pendingUnmounted !== void 0 && previous.unmounted !== pendingUnmounted ? {
|
|
104
|
+
...previous,
|
|
105
|
+
unmounted: pendingUnmounted
|
|
106
|
+
} : previous;
|
|
107
|
+
return typeof stateOrGetState === "function" ? stateOrGetState(current) : stateOrGetState;
|
|
108
|
+
});
|
|
109
|
+
});
|
|
119
110
|
var isAnimated = willBeAnimated;
|
|
120
|
-
if (import_constants.isWeb && hasAnimationThatNeedsHydrate && !
|
|
111
|
+
if (import_constants.isWeb && hasAnimationThatNeedsHydrate && !isHOC && !isHydrated) {
|
|
121
112
|
isAnimated = false;
|
|
122
113
|
curStateRef.willHydrate = true;
|
|
123
114
|
}
|
|
@@ -131,37 +122,14 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
131
122
|
});
|
|
132
123
|
}
|
|
133
124
|
var groupName = props.group;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (process.env.NODE_ENV === "development") {
|
|
141
|
-
var dbg = r.__debug;
|
|
142
|
-
if (dbg && update !== prev) {
|
|
143
|
-
console.groupCollapsed(`setStateShallow CHANGE`, "=>", update);
|
|
144
|
-
console.info(`previously`, prev);
|
|
145
|
-
console.trace();
|
|
146
|
-
console.groupEnd();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return update;
|
|
150
|
-
});
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
if (process.env.NODE_ENV === "development") {
|
|
154
|
-
;
|
|
155
|
-
stateRef.current.__debug = props.debug;
|
|
156
|
-
}
|
|
157
|
-
var setStateShallow = stateRef.current.baseSetStateShallow;
|
|
158
|
-
if (process.env.NODE_ENV === "development" && globalThis.time) globalThis.time`state-useCreateShallowSetState`;
|
|
125
|
+
var setStateShallow = (_curStateRef1 = curStateRef).baseSetStateShallow || (_curStateRef1.baseSetStateShallow = function(stateOrGetState) {
|
|
126
|
+
setState(function(prev) {
|
|
127
|
+
var next = typeof stateOrGetState === "function" ? stateOrGetState(prev) : stateOrGetState;
|
|
128
|
+
return (0, import_is_equal_shallow.mergeIfNotShallowEqual)(prev, next);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
159
131
|
var outProps = props;
|
|
160
132
|
if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
|
|
161
|
-
if (process.env.NODE_ENV === "development" && props.debug === "verbose") {
|
|
162
|
-
var _staticConfig_Component, _staticConfig_Component1;
|
|
163
|
-
console.warn((0, import_formatDiagnostic.formatDiagnostic)("TAMAGUI_PRESENCE_STATE", ((_staticConfig_Component = staticConfig.Component) === null || _staticConfig_Component === void 0 ? void 0 : _staticConfig_Component.displayName) || ((_staticConfig_Component1 = staticConfig.Component) === null || _staticConfig_Component1 === void 0 ? void 0 : _staticConfig_Component1.name) || "TamaguiComponent", "AnimatePresence supplied lifecycle state to an animated component", "Remove debug=\"verbose\" after inspecting the animation state", "presenceState", presenceState));
|
|
164
|
-
}
|
|
165
133
|
var { custom } = presenceState;
|
|
166
134
|
if ((0, import_isObj.isObj)(custom)) {
|
|
167
135
|
outProps = {
|
|
@@ -170,23 +138,16 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
170
138
|
};
|
|
171
139
|
}
|
|
172
140
|
}
|
|
173
|
-
var noClass = !import_constants.isWeb ||
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
var isAnimatedAndHydrated =
|
|
141
|
+
var noClass = !import_constants.isWeb || Boolean(props.forceStyle);
|
|
142
|
+
if (import_constants.isWeb) {
|
|
143
|
+
if (!isHydrated) {
|
|
144
|
+
noClass = false;
|
|
145
|
+
} else {
|
|
146
|
+
var isAnimatedAndHydrated = Boolean((hasAnimationProp || curStateRef.hasAnimated) && useAnimations && !isHOC);
|
|
179
147
|
var isClassNameDisabled = !staticConfig.acceptsClassName && ((0, import_config.getSetting)("disableSSR") || !state.unmounted);
|
|
180
|
-
var isDisabledManually = disableClassName && !state.unmounted;
|
|
148
|
+
var isDisabledManually = Boolean(disableClassName && !state.unmounted);
|
|
181
149
|
if (isAnimatedAndHydrated && outputStyle !== "css" || isDisabledManually || isClassNameDisabled) {
|
|
182
150
|
noClass = true;
|
|
183
|
-
if (process.env.NODE_ENV === "development" && props.debug === "verbose") {
|
|
184
|
-
(0, import_log.log)(`avoiding className`, {
|
|
185
|
-
isAnimatedAndHydrated,
|
|
186
|
-
isDisabledManually,
|
|
187
|
-
isClassNameDisabled
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
151
|
}
|
|
191
152
|
}
|
|
192
153
|
}
|
|
@@ -231,7 +192,7 @@ var useComponentState = function(props, animationDriver, staticConfig, config) {
|
|
|
231
192
|
result.platformPseudo = platformPseudo;
|
|
232
193
|
result.willBeAnimatedClient = nextWillBeAnimatedClient;
|
|
233
194
|
result.willBeAnimated = nextWillBeAnimated;
|
|
234
|
-
result.isAnimated = import_constants.isWeb && hasAnimationThatNeedsHydrate && !
|
|
195
|
+
result.isAnimated = import_constants.isWeb && hasAnimationThatNeedsHydrate && !isHOC && !isHydrated ? false : nextWillBeAnimated;
|
|
235
196
|
if (nextWillBeAnimated && !isHOC && props["animatePresence"] !== false) {
|
|
236
197
|
curStateRef.shouldRegisterPresence = true;
|
|
237
198
|
}
|