@tamagui/web 3.0.0-beta.924.1 → 3.0.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/_withNativeStyle.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.js +3 -0
- package/dist/cjs/_withNativeStyle.native.js.map +1 -1
- package/dist/cjs/_withStableStyle.native.cjs +1 -5
- package/dist/cjs/_withStableStyle.native.js +1 -5
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +6 -3
- package/dist/cjs/config.native.cjs +7 -5
- package/dist/cjs/config.native.js +7 -5
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.cjs +1 -0
- package/dist/cjs/contexts/ComponentContext.native.cjs +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +46 -32
- package/dist/cjs/createComponent.native.cjs +92 -72
- package/dist/cjs/createComponent.native.js +92 -72
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +32 -14
- package/dist/cjs/createTamagui.native.cjs +33 -19
- package/dist/cjs/createTamagui.native.js +33 -19
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -5
- package/dist/cjs/createTokens.native.js +1 -5
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.native.cjs +1 -5
- package/dist/cjs/createVariable.native.js +1 -5
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/createVariables.native.cjs +2 -6
- package/dist/cjs/createVariables.native.js +2 -6
- package/dist/cjs/createVariables.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +87 -329
- package/dist/cjs/dom/html.native.cjs +53 -2
- package/dist/cjs/dom/html.native.js +53 -2
- package/dist/cjs/dom/html.native.js.map +1 -1
- package/dist/cjs/{helpers/timer.native.js → dom/htmlReset.cjs} +6 -12
- package/dist/cjs/{helpers/timer.native.cjs → dom/htmlReset.native.cjs} +6 -8
- package/dist/cjs/dom/htmlReset.native.js +30 -0
- package/dist/cjs/dom/htmlReset.native.js.map +1 -0
- package/dist/cjs/dom/htmlRuntime.native.cjs +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/htmlStaticConfig.cjs +44 -0
- package/dist/cjs/dom/htmlStaticConfig.native.cjs +46 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js +48 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/cjs/dom/primitives.native.cjs +81 -34
- package/dist/cjs/dom/primitives.native.js +81 -34
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/eventHandling.cjs +10 -4
- package/dist/cjs/eventHandling.native.cjs +52 -16
- package/dist/cjs/eventHandling.native.js +52 -16
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/NativeTextBinding.cjs +36 -0
- package/dist/cjs/helpers/NativeTextBinding.native.cjs +39 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js +41 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/cjs/helpers/configVariables.native.cjs +2 -6
- package/dist/cjs/helpers/configVariables.native.js +2 -6
- package/dist/cjs/helpers/configVariables.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +14 -10
- package/dist/cjs/helpers/createDesignSystem.native.cjs +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.cjs +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +45 -1
- package/dist/cjs/helpers/expandStyle.native.cjs +38 -2
- package/dist/cjs/helpers/expandStyle.native.js +38 -2
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +15 -3
- package/dist/cjs/helpers/expandStyles.native.cjs +14 -8
- package/dist/cjs/helpers/expandStyles.native.js +14 -8
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/fluid.cjs +56 -0
- package/dist/cjs/helpers/fluid.native.cjs +58 -0
- package/dist/cjs/helpers/fluid.native.js +60 -0
- package/dist/cjs/helpers/fluid.native.js.map +1 -0
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +6 -6
- package/dist/cjs/helpers/getSplitStyles.cjs +366 -150
- package/dist/cjs/helpers/getSplitStyles.native.cjs +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +37 -25
- package/dist/cjs/helpers/grammarConfig.cjs +6 -14
- package/dist/cjs/helpers/grammarConfig.native.cjs +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +11 -4
- package/dist/cjs/helpers/insertStyleRule.native.cjs +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isObj.native.cjs +1 -5
- package/dist/cjs/helpers/isObj.native.js +1 -5
- package/dist/cjs/helpers/isObj.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.cjs +18 -21
- package/dist/cjs/helpers/mergeProps.native.cjs +20 -23
- package/dist/cjs/helpers/mergeProps.native.js +20 -23
- package/dist/cjs/helpers/mergeProps.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/nativeTextMetrics.cjs +74 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.cjs +77 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js +79 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/cjs/helpers/normalizeColor.native.cjs +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +2 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/objectIdentityKey.native.cjs +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/cjs/helpers/parseNativeStyle.cjs +187 -0
- package/dist/cjs/helpers/parseNativeStyle.native.cjs +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.cjs +9 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.cjs +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/{timer.cjs → resolveNativeUnits.cjs} +12 -8
- package/dist/cjs/helpers/resolveNativeUnits.native.cjs +205 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js +207 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/cjs/helpers/resolveRem.native.cjs +18 -21
- package/dist/cjs/helpers/resolveRem.native.js +18 -21
- package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSizing.cjs +124 -0
- package/dist/cjs/helpers/resolveSizing.native.cjs +133 -0
- package/dist/cjs/helpers/resolveSizing.native.js +135 -0
- package/dist/cjs/helpers/resolveSizing.native.js.map +1 -0
- package/dist/cjs/helpers/resolveVariableValue.cjs +7 -7
- package/dist/cjs/helpers/resolveVariableValue.native.cjs +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.js +0 -1
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +5 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/cjs/helpers/styledDynamic.cjs +5 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +16 -7
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/themeRef.native.cjs +1 -5
- package/dist/cjs/helpers/themeRef.native.js +1 -5
- package/dist/cjs/helpers/themeRef.native.js.map +1 -1
- package/dist/cjs/helpers/themes.cjs +26 -11
- package/dist/cjs/helpers/themes.native.cjs +26 -11
- package/dist/cjs/helpers/themes.native.js +26 -11
- package/dist/cjs/helpers/themes.native.js.map +1 -1
- package/dist/cjs/helpers/tokenCategories.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +1 -1
- package/dist/cjs/helpers/variables.native.cjs +4 -8
- package/dist/cjs/helpers/variables.native.js +4 -8
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.js +6 -0
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/helpers/webPropsToSkip.native.cjs +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.native.cjs +1 -5
- package/dist/cjs/hooks/useComponentState.native.js +1 -5
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +27 -34
- package/dist/cjs/hooks/useMedia.native.cjs +45 -51
- package/dist/cjs/hooks/useMedia.native.js +45 -51
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +37 -47
- package/dist/cjs/hooks/useThemeState.native.cjs +44 -50
- package/dist/cjs/hooks/useThemeState.native.js +44 -50
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -0
- package/dist/cjs/index.native.cjs +7 -0
- package/dist/cjs/index.native.js +7 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +22 -0
- package/dist/cjs/internal-runtime.native.cjs +22 -0
- package/dist/cjs/internal-runtime.native.js +22 -0
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.native.cjs +2 -9
- package/dist/cjs/static-resolve.native.js +2 -9
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +1 -1
- package/dist/cjs/style.native.cjs +4 -7
- package/dist/cjs/style.native.js +4 -7
- package/dist/cjs/style.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +10 -17
- package/dist/cjs/views/Theme.native.cjs +9 -11
- package/dist/cjs/views/Theme.native.js +9 -11
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
- package/dist/esm/_withNativeStyle.mjs +4 -1
- package/dist/esm/_withNativeStyle.mjs.map +1 -1
- package/dist/esm/_withNativeStyle.native.js +4 -1
- package/dist/esm/_withNativeStyle.native.js.map +1 -1
- package/dist/esm/_withStableStyle.native.js +1 -5
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +6 -3
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +7 -5
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.mjs +9 -9
- package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +16 -9
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +45 -42
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +93 -82
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +33 -15
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +34 -20
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.native.js +1 -5
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.native.js +1 -5
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.native.js +2 -6
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +87 -329
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/html.native.js +53 -2
- package/dist/esm/dom/html.native.js.map +1 -1
- package/dist/esm/dom/htmlReset.mjs +6 -0
- package/dist/esm/dom/htmlReset.mjs.map +1 -0
- package/dist/esm/dom/htmlReset.native.js +6 -0
- package/dist/esm/dom/htmlReset.native.js.map +1 -0
- package/dist/esm/dom/htmlRuntime.native.js +4 -0
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/htmlStaticConfig.mjs +22 -0
- package/dist/esm/dom/htmlStaticConfig.mjs.map +1 -0
- package/dist/esm/dom/htmlStaticConfig.native.js +22 -0
- package/dist/esm/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/esm/dom/primitives.native.js +81 -34
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/eventHandling.mjs +10 -4
- package/dist/esm/eventHandling.mjs.map +1 -1
- package/dist/esm/eventHandling.native.js +52 -16
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/NativeTextBinding.mjs +17 -0
- package/dist/esm/helpers/NativeTextBinding.mjs.map +1 -0
- package/dist/esm/helpers/NativeTextBinding.native.js +18 -0
- package/dist/esm/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/esm/helpers/configVariables.native.js +2 -6
- package/dist/esm/helpers/configVariables.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +14 -10
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +4 -4
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +1 -5
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +41 -1
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +36 -3
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +15 -3
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +14 -8
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/fluid.mjs +36 -0
- package/dist/esm/helpers/fluid.mjs.map +1 -0
- package/dist/esm/helpers/fluid.native.js +36 -0
- package/dist/esm/helpers/fluid.native.js.map +1 -0
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +6 -6
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +364 -150
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +588 -188
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +37 -25
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +6 -14
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +32 -22
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +11 -4
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +4 -4
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.native.js +1 -5
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.mjs +18 -21
- package/dist/esm/helpers/mergeProps.mjs.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +20 -23
- package/dist/esm/helpers/mergeProps.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/nativeTextMetrics.mjs +55 -0
- package/dist/esm/helpers/nativeTextMetrics.mjs.map +1 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js +56 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/esm/helpers/normalizeColor.native.js +17 -2
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +2 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +1 -5
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/parseNativeStyle.mjs +168 -0
- package/dist/esm/helpers/parseNativeStyle.mjs.map +1 -0
- package/dist/esm/helpers/parseNativeStyle.native.js +4 -1
- package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +10 -2
- package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +29 -2
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/esm/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/resolveNativeUnits.mjs +9 -0
- package/dist/esm/helpers/resolveNativeUnits.mjs.map +1 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js +178 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/esm/helpers/resolveRem.native.js +18 -21
- package/dist/esm/helpers/resolveRem.native.js.map +1 -1
- package/dist/esm/helpers/resolveSizing.mjs +102 -0
- package/dist/esm/helpers/resolveSizing.mjs.map +1 -0
- package/dist/esm/helpers/resolveSizing.native.js +109 -0
- package/dist/esm/helpers/resolveSizing.native.js.map +1 -0
- package/dist/esm/helpers/resolveVariableValue.mjs +7 -7
- package/dist/esm/helpers/resolveVariableValue.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariableValue.native.js +7 -9
- package/dist/esm/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +0 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +0 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +20 -1
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
- package/dist/esm/helpers/styleFrontend.native.js +20 -1
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.mjs +5 -4
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/esm/helpers/styledDynamic.mjs +5 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
- package/dist/esm/helpers/styledDynamic.native.js +8 -7
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +16 -7
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/themeRef.native.js +1 -5
- package/dist/esm/helpers/themeRef.native.js.map +1 -1
- package/dist/esm/helpers/themes.mjs +20 -11
- package/dist/esm/helpers/themes.mjs.map +1 -1
- package/dist/esm/helpers/themes.native.js +20 -11
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/helpers/tokenCategories.mjs +2 -2
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +2 -2
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +1 -1
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +4 -8
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +6 -1
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -1
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/helpers/webPropsToSkip.native.js +3 -3
- package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +1 -5
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +27 -34
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +45 -51
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +36 -48
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +44 -50
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.mjs +4 -1
- package/dist/esm/index.native.js +4 -1
- package/dist/esm/internal-runtime.mjs +22 -3
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +22 -3
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.native.js +2 -9
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +1 -1
- package/dist/esm/style.mjs.map +1 -1
- package/dist/esm/style.native.js +4 -7
- package/dist/esm/style.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +15 -14
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +15 -15
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -1
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.mjs +1 -1
- package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.native.js +1 -1
- package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
- package/package.json +20 -18
- package/reset.css +11 -0
- package/src/_withNativeStyle.tsx +6 -1
- package/src/config.ts +6 -6
- package/src/contexts/ComponentContext.tsx +8 -0
- package/src/createComponent.tsx +177 -57
- package/src/createStyledHOC.tsx +25 -26
- package/src/createTamagui.ts +47 -28
- package/src/dom/contract.ts +4 -1
- package/src/dom/html.native.tsx +55 -2
- package/src/dom/html.tsx +189 -388
- package/src/dom/htmlReset.ts +15 -0
- package/src/dom/htmlRuntime.native.tsx +5 -0
- package/src/dom/htmlStaticConfig.ts +40 -0
- package/src/dom/primitives.native.tsx +138 -33
- package/src/dom/standalone.ts +2 -1
- package/src/dom/styleTypes.ts +82 -92
- package/src/eventHandling.native.ts +61 -11
- package/src/eventHandling.ts +19 -4
- package/src/helpers/NativeTextBinding.tsx +26 -0
- package/src/helpers/createDesignSystem.ts +24 -8
- package/src/helpers/expandStyle.ts +88 -4
- package/src/helpers/expandStyles.ts +6 -11
- package/src/helpers/fluid.ts +66 -0
- package/src/helpers/getCSSStylesAtomic.ts +11 -6
- package/src/helpers/getSplitStyles.tsx +1032 -296
- package/src/helpers/getThemeCSSRules.ts +73 -35
- package/src/helpers/grammarConfig.ts +23 -8
- package/src/helpers/insertStyleRule.tsx +14 -8
- package/src/helpers/mainThreadPressEvents.native.ts +65 -141
- package/src/helpers/mergeProps.ts +29 -62
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeTextMetrics.ts +77 -0
- package/src/helpers/normalizeColor.native.ts +29 -4
- package/src/helpers/normalizeValueWithProperty.ts +2 -1
- package/src/helpers/{parseNativeStyle.native.ts → parseNativeStyle.ts} +8 -1
- package/src/helpers/proxyThemeToParents.ts +13 -2
- package/src/helpers/resolveNativeUnits.native.ts +247 -0
- package/src/helpers/resolveNativeUnits.ts +10 -0
- package/src/helpers/resolveRem.native.ts +25 -26
- package/src/helpers/resolveSizing.ts +167 -0
- package/src/helpers/resolveVariableValue.ts +21 -17
- package/src/helpers/skipProps.ts +0 -1
- package/src/helpers/styleFrontend.ts +39 -0
- package/src/helpers/styleProvenance.ts +1 -1
- package/src/helpers/styleStaticConfigCore.ts +15 -4
- package/src/helpers/styledDynamic.ts +3 -1
- package/src/helpers/subscribeToContextGroup.tsx +16 -7
- package/src/helpers/themes.ts +27 -11
- package/src/helpers/tokenCategories.ts +15 -3
- package/src/helpers/variables.ts +2 -2
- package/src/helpers/warnOnce.ts +6 -0
- package/src/helpers/webPropsToSkip.native.ts +9 -3
- package/src/helpers/wrapStyleTags.tsx +4 -1
- package/src/hooks/useMedia.tsx +36 -47
- package/src/hooks/useSplitStyles.tsx +4 -1
- package/src/hooks/useThemeState.ts +69 -74
- package/src/index.ts +13 -0
- package/src/interfaces/RNExclusiveTypes.ts +1 -3
- package/src/internal-runtime.ts +43 -2
- package/src/style.ts +4 -1
- package/src/styled.tsx +34 -3
- package/src/types.tsx +412 -132
- package/src/views/Theme.tsx +18 -21
- package/src/views/ThemeDebug.tsx +1 -1
- package/src/views/ThemeUpdate.tsx +1 -1
- package/types/_withNativeStyle.d.ts.map +1 -1
- package/types/config.d.ts.map +1 -1
- package/types/contexts/ComponentContext.d.ts +1 -1
- package/types/contexts/ComponentContext.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +5 -2
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/dom/contract.d.ts +4 -1
- package/types/dom/contract.d.ts.map +1 -1
- package/types/dom/html.d.ts +60 -51
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/html.native.d.ts.map +1 -1
- package/types/dom/htmlReset.d.ts +10 -0
- package/types/dom/htmlReset.d.ts.map +1 -0
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/htmlStaticConfig.d.ts +22 -0
- package/types/dom/htmlStaticConfig.d.ts.map +1 -0
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/dom/standalone.d.ts +2 -1
- package/types/dom/standalone.d.ts.map +1 -1
- package/types/dom/styleTypes.d.ts +63 -84
- package/types/dom/styleTypes.d.ts.map +1 -1
- package/types/eventHandling.d.ts +12 -4
- package/types/eventHandling.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/NativeTextBinding.d.ts +11 -0
- package/types/helpers/NativeTextBinding.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts +1 -0
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/expandStyles.d.ts.map +1 -1
- package/types/helpers/fluid.d.ts +21 -0
- package/types/helpers/fluid.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +3 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/mainThreadPressEvents.native.d.ts +0 -7
- package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
- package/types/helpers/mergeProps.d.ts +1 -15
- package/types/helpers/mergeProps.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/nativeTextMetrics.d.ts +16 -0
- package/types/helpers/nativeTextMetrics.d.ts.map +1 -0
- package/types/helpers/normalizeColor.native.d.ts +4 -1
- package/types/helpers/normalizeColor.native.d.ts.map +1 -1
- package/types/helpers/normalizeShadow.native.d.ts +3 -1
- package/types/helpers/normalizeShadow.native.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/{parseNativeStyle.native.d.ts → parseNativeStyle.d.ts} +1 -1
- package/types/helpers/parseNativeStyle.d.ts.map +1 -0
- package/types/helpers/proxyThemeToParents.d.ts +1 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/resolveNativeUnits.d.ts +6 -0
- package/types/helpers/resolveNativeUnits.d.ts.map +1 -0
- package/types/helpers/resolveNativeUnits.native.d.ts +16 -0
- package/types/helpers/resolveNativeUnits.native.d.ts.map +1 -0
- package/types/helpers/resolveRem.native.d.ts +6 -4
- package/types/helpers/resolveRem.native.d.ts.map +1 -1
- package/types/helpers/resolveSizing.d.ts +90 -0
- package/types/helpers/resolveSizing.d.ts.map +1 -0
- package/types/helpers/resolveVariableValue.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +0 -1
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +21 -0
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleProvenance.d.ts +1 -1
- package/types/helpers/styleProvenance.d.ts.map +1 -1
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -1
- package/types/helpers/styledDynamic.d.ts +1 -1
- package/types/helpers/styledDynamic.d.ts.map +1 -1
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/helpers/tokenCategories.d.ts +1 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts +1 -0
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +6 -2
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +5 -2
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +4 -1
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/RNExclusiveTypes.d.ts +2 -3
- package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +12 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/style.d.ts.map +1 -1
- package/types/styled.d.ts +7 -4
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +258 -102
- package/types/types.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/dist/cjs/helpers/timer.native.js.map +0 -1
- package/dist/esm/helpers/timer.mjs +0 -13
- package/dist/esm/helpers/timer.mjs.map +0 -1
- package/dist/esm/helpers/timer.native.js +0 -13
- package/dist/esm/helpers/timer.native.js.map +0 -1
- package/src/helpers/timer.ts +0 -9
- package/types/helpers/parseNativeStyle.native.d.ts.map +0 -1
- package/types/helpers/timer.d.ts +0 -2
- package/types/helpers/timer.d.ts.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { getTransitionResolver } from "@tamagui/animation-helpers/transitionResolver";
|
|
1
2
|
import { isClient } from "@tamagui/constants";
|
|
2
3
|
import { nonAnimatableStyleProps, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTransform, validStyles } from "@tamagui/helpers";
|
|
3
|
-
import { addTransformValue, createTransformAccumulator, finalizeTransformAccumulator, getTransformPartKeys, removeTransformValue } from "@tamagui/style-grammar/runtime";
|
|
4
|
-
import { getConfig, getConfigMaybe } from "../config.mjs";
|
|
4
|
+
import { addTransformValue, createTransformAccumulator, finalizeTransformAccumulator, getTransformPartKeys, grammarMaxNonPlatformDepth, namedCssColors, removeTransformValue } from "@tamagui/style-grammar/runtime";
|
|
5
|
+
import { getConfig, getConfigMaybe, getSetting } from "../config.mjs";
|
|
5
6
|
import { isDevTools } from "../constants/isDevTools.mjs";
|
|
6
7
|
import { defaultComponentStateMounted } from "../defaultComponentState.mjs";
|
|
7
8
|
import { isVariable } from "../createVariable.mjs";
|
|
@@ -11,12 +12,14 @@ import { splitComponents, startsValueFunction } from "./borderComponents.mjs";
|
|
|
11
12
|
import { getConfigRevisionState } from "./grammarConfig.mjs";
|
|
12
13
|
import { mediaKeyMatch, mediaState } from "./mediaState.mjs";
|
|
13
14
|
import { getStyleStaticConfig } from "./styleStaticConfig.mjs";
|
|
15
|
+
import { mergeFrontendCondition } from "./styleFrontend.mjs";
|
|
14
16
|
import { warnOnce, warnRefusedValue } from "./warnOnce.mjs";
|
|
15
17
|
import { getDynamicEnv } from "./styledDynamic.mjs";
|
|
16
18
|
import { getRulesForIdentifier, insertStyleRules, shouldInsertStyleRules } from "./insertStyleRule.mjs";
|
|
17
19
|
import { log } from "./log.mjs";
|
|
18
20
|
import { normalizeColor } from "./normalizeColor.mjs";
|
|
19
21
|
import { normalizeValueWithProperty } from "./normalizeValueWithProperty.mjs";
|
|
22
|
+
import { parseNativeTransform } from "./parseNativeTransform.native.js";
|
|
20
23
|
import { resolveVariableValue } from "./resolveVariableValue.mjs";
|
|
21
24
|
import { HOC_CLASSNAME_MARKER, skipProps } from "./skipProps.mjs";
|
|
22
25
|
import { styleOriginalValues } from "./styleOriginalValues.mjs";
|
|
@@ -215,6 +218,7 @@ const passFrontendContainerType = 27;
|
|
|
215
218
|
const passSourceLayer = 28;
|
|
216
219
|
const passParentCursor = 29;
|
|
217
220
|
const passMapSourceKey = 30;
|
|
221
|
+
const passVariantOutput = 31;
|
|
218
222
|
const passFlags = 13;
|
|
219
223
|
const sourceLayerBase = 0;
|
|
220
224
|
const sourceLayerVariant = 1;
|
|
@@ -229,6 +233,9 @@ const passHocFlag = 16;
|
|
|
229
233
|
const passTextFlag = 32;
|
|
230
234
|
const passInputFlag = 64;
|
|
231
235
|
const passAsChildStyleFlag = 128;
|
|
236
|
+
function isRemovedVendorStyleProp(property) {
|
|
237
|
+
return /^(Webkit|Moz|ms)[A-Z]/.test(property) && !(property in stylePropsAll);
|
|
238
|
+
}
|
|
232
239
|
function isValidStyleKey(key, validStyles) {
|
|
233
240
|
return key in validStyles;
|
|
234
241
|
}
|
|
@@ -252,7 +259,6 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
252
259
|
const shouldCheckSkipProps = !noSkip;
|
|
253
260
|
const asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
|
|
254
261
|
const isTextOrInput = isText || isInput;
|
|
255
|
-
const hocParentVariants = isHOC ? parentVariants : void 0;
|
|
256
262
|
let keyInit = keyOg;
|
|
257
263
|
let valInit = valOg;
|
|
258
264
|
if (keyInit === "children") {
|
|
@@ -276,17 +282,24 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
276
282
|
return;
|
|
277
283
|
}
|
|
278
284
|
const resolveClassName = styleFrontend?.resolveClassName;
|
|
285
|
+
let composedProps = null;
|
|
279
286
|
const sink = (entry) => {
|
|
280
287
|
const property = entry[0];
|
|
281
|
-
|
|
282
|
-
|
|
288
|
+
const condition2 = entry[2];
|
|
289
|
+
if (property.charCodeAt(0) === 95 && property.charCodeAt(1) === 95) {
|
|
290
|
+
composedProps ||= {};
|
|
291
|
+
composedProps[property] = mergeFrontendCondition(composedProps[property], entry[1], condition2);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (condition2 !== void 0) {
|
|
295
|
+
if (isValidStyleKey(property, validStyles)) contributeValue(styleState, property, entry[1], void 0, false, condition2);
|
|
283
296
|
else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property}" is not a valid style on this component; the frontend value is dropped.`);
|
|
284
|
-
|
|
285
|
-
if (property === "group") pass[passFrontendGroup] = entry[1];
|
|
286
|
-
else if (property === "container") pass[passFrontendContainer] = entry[1];
|
|
287
|
-
else if (property === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
288
|
-
contributeProp(pass, property, entry[1]);
|
|
297
|
+
return;
|
|
289
298
|
}
|
|
299
|
+
if (property === "group") pass[passFrontendGroup] = entry[1];
|
|
300
|
+
else if (property === "container") pass[passFrontendContainer] = entry[1];
|
|
301
|
+
else if (property === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
302
|
+
contributeProp(pass, property, entry[1]);
|
|
290
303
|
};
|
|
291
304
|
let start = 0;
|
|
292
305
|
for (let index = 0; index <= valInit.length; index++) {
|
|
@@ -312,18 +325,38 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
312
325
|
}
|
|
313
326
|
start = index + 1;
|
|
314
327
|
}
|
|
328
|
+
if (composedProps) {
|
|
329
|
+
const composed = styleFrontend.compose?.(composedProps);
|
|
330
|
+
for (const property in composed) contributeProp(pass, property, composed[property]);
|
|
331
|
+
}
|
|
315
332
|
}
|
|
316
333
|
return;
|
|
317
334
|
}
|
|
318
335
|
if (keyInit === HOC_CLASSNAME_MARKER) {
|
|
319
|
-
if (valInit
|
|
336
|
+
if (valInit) {
|
|
337
|
+
const [hocClassNames, hocSlots] = valInit;
|
|
320
338
|
const direct = styleState;
|
|
321
339
|
const layers = direct.flatPropertyLayers ||= /* @__PURE__ */ new Map();
|
|
322
|
-
for (const property in
|
|
340
|
+
for (const property in hocClassNames) {
|
|
341
|
+
if (hocSlots?.has(property)) continue;
|
|
323
342
|
clearDirectStyle(styleState, property);
|
|
324
|
-
styleState.classNames[property] =
|
|
343
|
+
styleState.classNames[property] = hocClassNames[property];
|
|
325
344
|
layers.set(property, pass[passSourceLayer]);
|
|
326
345
|
}
|
|
346
|
+
if (hocSlots) {
|
|
347
|
+
const slots = direct.flatSlots ||= /* @__PURE__ */ new Map();
|
|
348
|
+
const markerLayer = pass[passSourceLayer];
|
|
349
|
+
for (const [slot, entries] of hocSlots) for (const entry of entries) {
|
|
350
|
+
pass[passSourceLayer] = Math.max(entry[7] >> 5, sourceLayerResolver);
|
|
351
|
+
if (!ownsSourceLayer(styleState, entry[0], !!entry[2])) continue;
|
|
352
|
+
if (!isHOC && styleState.styleProps.isAnimated && (slot === "transition" || entry[8]) && !(entry[0] in nonAnimatableStyleProps)) {
|
|
353
|
+
const property = entry[0] === "--t-x" ? "x" : entry[0] === "--t-y" ? "y" : entry[0] === "--t-scale-x" ? "scaleX" : entry[0] === "--t-scale-y" ? "scaleY" : entry[0];
|
|
354
|
+
const value = styleState.animationDriver?.inputStyle === "value" ? entry[6] : entry[1];
|
|
355
|
+
entry[3] ? contributeValue(styleState, property, value, entry[6], false, entry[3]) : emitValue(styleState, property, value, null, entry[6], false);
|
|
356
|
+
} else writeStyleSlot(slots, slot, [...entry], pass[passSourceLayer]);
|
|
357
|
+
}
|
|
358
|
+
pass[passSourceLayer] = markerLayer;
|
|
359
|
+
}
|
|
327
360
|
}
|
|
328
361
|
return;
|
|
329
362
|
}
|
|
@@ -351,11 +384,30 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
351
384
|
continue;
|
|
352
385
|
}
|
|
353
386
|
const styleOriginals = shouldTrackStyleTokenProvenance ? styleOriginalValues.get(style) : void 0;
|
|
354
|
-
for (const
|
|
355
|
-
|
|
356
|
-
if (
|
|
357
|
-
|
|
358
|
-
|
|
387
|
+
for (const authoredKey in style) {
|
|
388
|
+
const value = style[authoredKey];
|
|
389
|
+
if (value == null) continue;
|
|
390
|
+
const key = disableExpandShorthands ? authoredKey : shorthands[authoredKey] || authoredKey;
|
|
391
|
+
let inline = !styleState.styleProps.stylePieceEntries;
|
|
392
|
+
if (key === "containerName") {
|
|
393
|
+
pass[passContainerName] = value;
|
|
394
|
+
inline = false;
|
|
395
|
+
} else if (key === "containerType") {
|
|
396
|
+
pass[passContainerType] = value;
|
|
397
|
+
inline = false;
|
|
398
|
+
}
|
|
399
|
+
if (inline) {
|
|
400
|
+
if (typeof value === "string") {
|
|
401
|
+
const [segments] = getConfigRevisionState(conf).parseFlatValue(value);
|
|
402
|
+
for (let index2 = 4; index2 < segments.length; index2 += 5) if (!(segments[index2] & 1)) {
|
|
403
|
+
inline = false;
|
|
404
|
+
break;
|
|
405
|
+
}
|
|
406
|
+
} else if (value && typeof value === "object" && !Array.isArray(value) && !isVariable(value) && classifyConditionalObject(value, styleState) !== 0) inline = false;
|
|
407
|
+
}
|
|
408
|
+
styleState.flatInlineStyleProp = inline;
|
|
409
|
+
contributeValue(styleState, key, value, styleOriginals?.[authoredKey]);
|
|
410
|
+
styleState.flatInlineStyleProp = false;
|
|
359
411
|
}
|
|
360
412
|
}
|
|
361
413
|
pass[passSourceLayer] = layerBeforeStyle;
|
|
@@ -365,12 +417,26 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
365
417
|
const defaultVal = defaultProps[keyOg] ?? defaultProps[keyInit];
|
|
366
418
|
if (defaultVal !== void 0 && valInit === defaultVal) return;
|
|
367
419
|
}
|
|
420
|
+
if (process.env.NODE_ENV === "development") {
|
|
421
|
+
if (!isValidStyleKey(keyInit, validStyles) && (keyInit === "animation" || !(keyInit in stylePropsAll)) && (!variants || !(keyInit in variants))) {
|
|
422
|
+
let replacement;
|
|
423
|
+
if (keyInit === "animation") replacement = "transition=";
|
|
424
|
+
else if (keyInit === "hoverStyle") replacement = "hover: clause";
|
|
425
|
+
else if (keyInit === "pressStyle") replacement = "press: clause";
|
|
426
|
+
else if (keyInit === "focusStyle") replacement = "focus: clause";
|
|
427
|
+
else if (keyInit === "enterStyle") replacement = "enter: clause";
|
|
428
|
+
else if (keyInit === "exitStyle") replacement = "exit: clause";
|
|
429
|
+
else if (keyInit.charCodeAt(0) === 36 && keyInit.length > 1) replacement = `${keyInit.slice(1)}: clause`;
|
|
430
|
+
if (replacement) warnOnce(`v2-prop:${keyInit}`, `prop "${keyInit}" was removed in v3; use ${replacement}`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
368
433
|
if (keyInit in skipProps && shouldSkipDirectProps && !neverSkipProps?.[keyInit]) {
|
|
369
434
|
if (keyInit === "container") pass[passContainerValue] = valInit;
|
|
370
435
|
if (keyInit === "transition" && typeof valInit === "string") {
|
|
371
|
-
const
|
|
372
|
-
|
|
373
|
-
|
|
436
|
+
const transitions = getTransitionResolver();
|
|
437
|
+
const resolved = transitions?.resolve(valInit, { animations: driverAnimations });
|
|
438
|
+
if (resolved?.fused) if (driverOutputStyle === "css" && process.env.IS_STATIC === "is_static") valInit = transitions.toCSS(resolved) ?? valInit;
|
|
439
|
+
else return;
|
|
374
440
|
} else return;
|
|
375
441
|
}
|
|
376
442
|
let isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles);
|
|
@@ -378,11 +444,15 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
378
444
|
viewProps[keyInit] = valInit;
|
|
379
445
|
return;
|
|
380
446
|
}
|
|
447
|
+
if (pass[passVariantOutput] && !isValidStyleKeyInit && !keyInit.startsWith("aria-") && !(keyInit in stylePropsAll) && !(keyInit in skipProps) && !(variants && keyInit in variants) && !(parentVariants && keyInit in parentVariants) && !styledContextKeys?.has(keyInit) && !(styledContext && keyInit in styledContext)) {
|
|
448
|
+
if (process.env.NODE_ENV === "development") warnOnce(`variant-non-style:${keyInit}`, `a variant set "${keyInit}", which is not a style. Variants hold styles and aria/data attributes only: set "${keyInit}" on the component one level up.`);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
381
451
|
if (!noExpand) {
|
|
382
452
|
if (keyInit === "disabled" && valInit === true) {
|
|
383
453
|
viewProps["aria-disabled"] = true;
|
|
384
454
|
if (isInput || elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") viewProps.disabled = true;
|
|
385
|
-
if (!variants?.disabled) return;
|
|
455
|
+
if (!variants?.disabled && !isHOC) return;
|
|
386
456
|
}
|
|
387
457
|
if (keyInit === "testID") {
|
|
388
458
|
viewProps["data-testid"] = valInit;
|
|
@@ -401,9 +471,8 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
401
471
|
let isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
|
|
402
472
|
const isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
|
|
403
473
|
if (isStyleProp && asChildExceptStyleLike) return;
|
|
404
|
-
const shouldPassProp = !isStyleProp && isHOC ||
|
|
405
|
-
const
|
|
406
|
-
const isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps));
|
|
474
|
+
const shouldPassProp = !isStyleProp && isHOC || isHOC && keyInit === "disabled" || parentVariants && keyInit in parentVariants || inlineProps?.has(keyInit);
|
|
475
|
+
const isHOCShouldPassThrough = isHOC && keyInit in skipProps;
|
|
407
476
|
const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
408
477
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
409
478
|
console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
|
|
@@ -427,7 +496,7 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
427
496
|
if (!isVariant) return;
|
|
428
497
|
}
|
|
429
498
|
if (shouldCheckSkipProps && !neverSkipProps?.[keyInit]) {
|
|
430
|
-
if (keyInit in skipProps && !(keyInit === "transition" && typeof valInit === "string" && !
|
|
499
|
+
if (keyInit in skipProps && !(keyInit === "transition" && typeof valInit === "string" && !getTransitionResolver()?.resolve(valInit, { animations: driverAnimations }).fused)) {
|
|
431
500
|
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
432
501
|
return;
|
|
433
502
|
}
|
|
@@ -455,7 +524,7 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
455
524
|
}
|
|
456
525
|
const isHostStyleKey = isValidStyleKeyInit || false;
|
|
457
526
|
if (isHostStyleKey || isStyledContextProp) {
|
|
458
|
-
contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey);
|
|
527
|
+
contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey || isStyledContextProp && typeof valInit === "boolean");
|
|
459
528
|
return;
|
|
460
529
|
}
|
|
461
530
|
const condition = pass[passParentCursor];
|
|
@@ -468,8 +537,8 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
468
537
|
} else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${keyInit}" is not a valid style on this component; the conditional variant value is dropped.`);
|
|
469
538
|
return;
|
|
470
539
|
}
|
|
471
|
-
if (keyInit in stylePropsAll) {
|
|
472
|
-
if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${keyInit}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
540
|
+
if (keyInit in stylePropsAll || isRemovedVendorStyleProp(keyInit)) {
|
|
541
|
+
if (process.env.NODE_ENV === "development" && true) console.warn(`[tamagui] "${keyInit}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
473
542
|
return;
|
|
474
543
|
}
|
|
475
544
|
viewProps[keyInit] = valInit;
|
|
@@ -497,7 +566,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
497
566
|
const variants = styleStaticConfig.variants;
|
|
498
567
|
const viewProps = {};
|
|
499
568
|
const mediaState$1 = styleProps.mediaState || mediaState;
|
|
500
|
-
let shouldDoClasses =
|
|
569
|
+
let shouldDoClasses = process.env.TAMAGUI_RUNTIME !== "island" && acceptsClassName && !styleProps.noClass;
|
|
501
570
|
const rulesToInsert = {};
|
|
502
571
|
const classNames = {};
|
|
503
572
|
let hasMedia = false;
|
|
@@ -553,7 +622,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
553
622
|
let frontendContainer;
|
|
554
623
|
let frontendContainerType;
|
|
555
624
|
const processedProps = props;
|
|
556
|
-
const parentVariants =
|
|
625
|
+
const parentVariants = isHOC ? staticConfig.Component?.staticConfig?.variants : void 0;
|
|
557
626
|
const defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
|
|
558
627
|
const asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
559
628
|
let containerValue;
|
|
@@ -577,7 +646,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
577
646
|
styledContextKeys,
|
|
578
647
|
(noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
|
|
579
648
|
debug,
|
|
580
|
-
parentStaticConfig,
|
|
649
|
+
process.env.NODE_ENV === "development" ? parentStaticConfig : void 0,
|
|
581
650
|
defaultProps,
|
|
582
651
|
driverAnimations,
|
|
583
652
|
driverOutputStyle,
|
|
@@ -624,6 +693,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
624
693
|
}
|
|
625
694
|
const resolvers = staticConfig.resolvers;
|
|
626
695
|
if (resolvers && !noExpand) {
|
|
696
|
+
const prevSourceLayer = pass[passSourceLayer];
|
|
627
697
|
pass[passSourceLayer] = sourceLayerResolver;
|
|
628
698
|
const flagsBefore = pass[passFlags];
|
|
629
699
|
pass[passFlags] = flagsBefore | passNoExpandFlag;
|
|
@@ -636,6 +706,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
636
706
|
}
|
|
637
707
|
}
|
|
638
708
|
pass[passFlags] = flagsBefore;
|
|
709
|
+
pass[passSourceLayer] = prevSourceLayer;
|
|
639
710
|
}
|
|
640
711
|
className = pass[passClassName];
|
|
641
712
|
shouldDoClasses = pass[passShouldDoClasses];
|
|
@@ -669,6 +740,8 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
669
740
|
if (slots) for (const [slot, entries] of slots) styleProps.stylePieceEntries[slot] = entries;
|
|
670
741
|
}
|
|
671
742
|
completeResolvedStyles(styleState);
|
|
743
|
+
if (styleState.flatGroupKeys?.size) pseudoGroups = styleState.flatGroupKeys;
|
|
744
|
+
if (styleState.flatGroupMedia?.size) mediaGroups = styleState.flatGroupMedia;
|
|
672
745
|
if (styleProps.isStatic) for (const property in classNames) {
|
|
673
746
|
const identifier = classNames[property];
|
|
674
747
|
if (rulesToInsert[identifier]) continue;
|
|
@@ -748,7 +821,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
748
821
|
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "";
|
|
749
822
|
const group = props.group ?? frontendGroup;
|
|
750
823
|
const groupClassName = group ? `t_group_${group}` : "";
|
|
751
|
-
let finalClassName = isText ? "is_Text" : "is_View";
|
|
824
|
+
let finalClassName = staticConfig.isDOM ? "is_DOM" : isText ? "is_Text" : "is_View";
|
|
752
825
|
if (fontFamilyClassName) finalClassName += ` ${fontFamilyClassName}`;
|
|
753
826
|
let hasPropertyClassNames = false;
|
|
754
827
|
if (classNames) for (const key in classNames) {
|
|
@@ -757,7 +830,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
757
830
|
}
|
|
758
831
|
if (groupClassName) finalClassName += ` ${groupClassName}`;
|
|
759
832
|
if (className) finalClassName += ` ${className}`;
|
|
760
|
-
if (isHOC && hasPropertyClassNames) viewProps[HOC_CLASSNAME_MARKER] = classNames;
|
|
833
|
+
if (isHOC && hasPropertyClassNames) viewProps[HOC_CLASSNAME_MARKER] = [classNames, styleState.flatCapturedSlots];
|
|
761
834
|
if (finalClassName) viewProps.className = finalClassName;
|
|
762
835
|
if (style) viewProps.style = style;
|
|
763
836
|
}
|
|
@@ -788,7 +861,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
788
861
|
const stylePieceStaticConfig = {
|
|
789
862
|
acceptsClassName: true,
|
|
790
863
|
isText: true,
|
|
791
|
-
validStyles:
|
|
864
|
+
validStyles: stylePropsInput
|
|
792
865
|
};
|
|
793
866
|
const compiledStylePieces = /* @__PURE__ */ new WeakMap();
|
|
794
867
|
const compileStylePieceRuntime = (piece, layer) => {
|
|
@@ -865,7 +938,7 @@ function applyStylePieceClasses(styleState, piece, sourceLayer) {
|
|
|
865
938
|
for (const slot in compiled.slots) for (const entry of compiled.slots[slot]) {
|
|
866
939
|
const property = entry[0];
|
|
867
940
|
if (!ownsSourceLayer(styleState, property, !!entry[2])) continue;
|
|
868
|
-
|
|
941
|
+
writeStyleSlot(slots, slot, [...entry], sourceLayer);
|
|
869
942
|
}
|
|
870
943
|
if (compiled.programStates) {
|
|
871
944
|
const target = styleState.flatStateKeys ||= /* @__PURE__ */ new Set();
|
|
@@ -911,7 +984,7 @@ function applyStylePieceClasses(styleState, piece, sourceLayer) {
|
|
|
911
984
|
}
|
|
912
985
|
return applied;
|
|
913
986
|
}
|
|
914
|
-
function
|
|
987
|
+
function writeStyleSlot(slots, slot, source, sourceLayer) {
|
|
915
988
|
let list = slots.get(slot);
|
|
916
989
|
if (!list) slots.set(slot, list = []);
|
|
917
990
|
const flags = source[7] & 31;
|
|
@@ -920,7 +993,10 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
920
993
|
for (let index = 0; index < list.length; index++) {
|
|
921
994
|
const entry = list[index];
|
|
922
995
|
const entryFlags = entry[7] & 31;
|
|
923
|
-
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS)))
|
|
996
|
+
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) {
|
|
997
|
+
if (sourceLayer === sourceLayerStyle && entry[7] >> 5 === sourceLayerStyle && entry[0] === source[0] && !condition && !entry[2]) list.splice(index--, 1);
|
|
998
|
+
continue;
|
|
999
|
+
}
|
|
924
1000
|
if (entry[0] !== source[0]) continue;
|
|
925
1001
|
if (flags & recordDefault) {
|
|
926
1002
|
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
@@ -933,9 +1009,8 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
933
1009
|
break;
|
|
934
1010
|
}
|
|
935
1011
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
list.push(next);
|
|
1012
|
+
source[7] = flags | sourceLayer << 5;
|
|
1013
|
+
list.push(source);
|
|
939
1014
|
}
|
|
940
1015
|
function mergeStyle(styleState, key, val, disableNormalize = false, originalVal) {
|
|
941
1016
|
const { viewProps, styleProps, staticConfig } = styleState;
|
|
@@ -948,7 +1023,7 @@ function mergeStyle(styleState, key, val, disableNormalize = false, originalVal)
|
|
|
948
1023
|
styleState.transformAccumulator ||= createTransformAccumulator();
|
|
949
1024
|
addTransformValue(styleState.transformAccumulator, key, val);
|
|
950
1025
|
} else {
|
|
951
|
-
|
|
1026
|
+
let out = !disableNormalize && !styleProps.noNormalize ? normalizeValueWithProperty(val, key) : val;
|
|
952
1027
|
styleState.style ||= {};
|
|
953
1028
|
styleState.style[key] = out;
|
|
954
1029
|
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
@@ -958,8 +1033,8 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
958
1033
|
let tokenName = typeof originalVal === "string" ? originalVal : "";
|
|
959
1034
|
if (tokenName) {
|
|
960
1035
|
const slash = tokenName.lastIndexOf("/");
|
|
961
|
-
const opacity = slash === -1 ? NaN :
|
|
962
|
-
if (
|
|
1036
|
+
const opacity = slash === -1 ? NaN : +tokenName.slice(slash + 1);
|
|
1037
|
+
if (opacity % 1 === 0 && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
|
|
963
1038
|
}
|
|
964
1039
|
if (tokenName !== "" && (tokenName in styleState.theme || tokenName in (styleState.conf.themes?.[styleState.flatThemeName || ""] || {}) || Object.values(styleState.conf.tokensParsed).some((category) => tokenName in category))) (styleState.tokenProvenance ||= {})[key] = originalVal;
|
|
965
1040
|
else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
|
|
@@ -1002,11 +1077,34 @@ const recordNormalize = 2;
|
|
|
1002
1077
|
const recordRetract = 4;
|
|
1003
1078
|
const recordDefault = 8;
|
|
1004
1079
|
const recordCSS = 16;
|
|
1080
|
+
const webRTLRenames = {
|
|
1081
|
+
marginHorizontal: "marginInline",
|
|
1082
|
+
marginVertical: "marginBlock",
|
|
1083
|
+
paddingHorizontal: "paddingInline",
|
|
1084
|
+
paddingVertical: "paddingBlock",
|
|
1085
|
+
writingDirection: "direction",
|
|
1086
|
+
paddingStart: "paddingInlineStart",
|
|
1087
|
+
paddingEnd: "paddingInlineEnd",
|
|
1088
|
+
marginStart: "marginInlineStart",
|
|
1089
|
+
marginEnd: "marginInlineEnd",
|
|
1090
|
+
borderStartWidth: "borderInlineStartWidth",
|
|
1091
|
+
borderEndWidth: "borderInlineEndWidth",
|
|
1092
|
+
borderStartColor: "borderInlineStartColor",
|
|
1093
|
+
borderEndColor: "borderInlineEndColor",
|
|
1094
|
+
borderStartStyle: "borderInlineStartStyle",
|
|
1095
|
+
borderEndStyle: "borderInlineEndStyle",
|
|
1096
|
+
borderTopStartRadius: "borderStartStartRadius",
|
|
1097
|
+
borderTopEndRadius: "borderStartEndRadius",
|
|
1098
|
+
borderBottomStartRadius: "borderEndStartRadius",
|
|
1099
|
+
borderBottomEndRadius: "borderEndEndRadius",
|
|
1100
|
+
start: "insetInlineStart",
|
|
1101
|
+
end: "insetInlineEnd"
|
|
1102
|
+
};
|
|
1005
1103
|
const webStyleProperties = /* @__PURE__ */ new Map();
|
|
1006
1104
|
function webStyleProperty(property) {
|
|
1007
1105
|
let web = webStyleProperties.get(property);
|
|
1008
1106
|
if (web === void 0) {
|
|
1009
|
-
web = property
|
|
1107
|
+
web = webRTLRenames[property] || property;
|
|
1010
1108
|
webStyleProperties.set(property, web);
|
|
1011
1109
|
}
|
|
1012
1110
|
return web;
|
|
@@ -1025,26 +1123,21 @@ function writeStyleRecord(state, property, value, cursor, original, flags, condi
|
|
|
1025
1123
|
const identity = cursor ? cursor[conditionKey] : "";
|
|
1026
1124
|
const direct = state;
|
|
1027
1125
|
const slots = direct.flatSlots ||= /* @__PURE__ */ new Map();
|
|
1028
|
-
const
|
|
1126
|
+
const sourceLayer = direct.flatPass?.[passSourceLayer] || 0;
|
|
1127
|
+
if (direct.flatInlineStyleProp) flags |= recordInline;
|
|
1128
|
+
const cssSlot = canGenerateCSS && (state.flatShouldDoClasses || flags & recordCSS) ? styleSlot(property) : property.startsWith("transition") ? "transition" : property;
|
|
1129
|
+
const slot = flags & recordInline && cssSlot !== property ? property : cssSlot;
|
|
1029
1130
|
let list = slots.get(slot);
|
|
1030
1131
|
if (!list) slots.set(slot, list = []);
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
1038
|
-
} else if (entryFlags & recordDefault && (!condition || entry[3] === identity)) {
|
|
1039
|
-
list.splice(index--, 1);
|
|
1040
|
-
continue;
|
|
1041
|
-
}
|
|
1042
|
-
if (entry[3] === identity) {
|
|
1043
|
-
list.splice(index, 1);
|
|
1044
|
-
break;
|
|
1132
|
+
if (sourceLayer === sourceLayerStyle && !condition) {
|
|
1133
|
+
const other = slot === cssSlot ? list : slots.get(flags & recordInline ? cssSlot : property);
|
|
1134
|
+
if (other) for (let index = 0; index < other.length; index++) {
|
|
1135
|
+
const entry = other[index];
|
|
1136
|
+
const entryFlags = entry[7];
|
|
1137
|
+
if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & 17) !== (flags & 17)) other.splice(index--, 1);
|
|
1045
1138
|
}
|
|
1046
1139
|
}
|
|
1047
|
-
|
|
1140
|
+
writeStyleSlot(slots, slot, [
|
|
1048
1141
|
property,
|
|
1049
1142
|
value,
|
|
1050
1143
|
condition,
|
|
@@ -1052,8 +1145,10 @@ function writeStyleRecord(state, property, value, cursor, original, flags, condi
|
|
|
1052
1145
|
cursor ? cursor[conditionSelector] : "",
|
|
1053
1146
|
cursor ? cursor[conditionWrappers] : void 0,
|
|
1054
1147
|
original,
|
|
1055
|
-
flags
|
|
1056
|
-
|
|
1148
|
+
flags,
|
|
1149
|
+
void 0,
|
|
1150
|
+
!sourceLayer && direct.flatPass?.[passVariantOutput]
|
|
1151
|
+
], sourceLayer);
|
|
1057
1152
|
}
|
|
1058
1153
|
function streamWriteInline(state, property, value, cursor, original, normalize = property === "lineHeight", conditionOverride = -1, force = false) {
|
|
1059
1154
|
writeStyleRecord(state, property, value, cursor, original, (normalize ? recordNormalize : 0) | (force ? recordInline : 0), conditionOverride);
|
|
@@ -1080,6 +1175,7 @@ function completeResolvedStyles(state, merge = mergeStyle) {
|
|
|
1080
1175
|
}
|
|
1081
1176
|
const slots = direct.flatSlots;
|
|
1082
1177
|
if (!slots) return;
|
|
1178
|
+
const capture = state.staticConfig.isHOC ? direct.flatCapturedSlots ||= /* @__PURE__ */ new Map() : void 0;
|
|
1083
1179
|
for (const [property, entries] of slots) {
|
|
1084
1180
|
let cssEntries;
|
|
1085
1181
|
let inlineWinner;
|
|
@@ -1108,7 +1204,17 @@ function completeResolvedStyles(state, merge = mergeStyle) {
|
|
|
1108
1204
|
}
|
|
1109
1205
|
}
|
|
1110
1206
|
}
|
|
1111
|
-
if (cssEntries)
|
|
1207
|
+
if (cssEntries) {
|
|
1208
|
+
registerAtomicSlot(direct, property, cssEntries);
|
|
1209
|
+
if (capture) {
|
|
1210
|
+
for (const entry of cssEntries) {
|
|
1211
|
+
entry[7] = entry[7] | recordCSS;
|
|
1212
|
+
if (!(entry[2] & 12)) continue;
|
|
1213
|
+
for (const sibling of cssEntries) if (sibling[0] === entry[0]) sibling[8] = true;
|
|
1214
|
+
}
|
|
1215
|
+
capture.set(property, cssEntries);
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1112
1218
|
if (inlineWinner) if (inlineWinner[7] & recordRetract) {
|
|
1113
1219
|
if (state.style) delete state.style[inlineWinner[0]];
|
|
1114
1220
|
} else merge(state, inlineWinner[0], inlineWinner[1], !(inlineWinner[7] & recordNormalize), inlineWinner[6] !== void 0 ? inlineWinner[6] : inlineWinner[1]);
|
|
@@ -1133,7 +1239,7 @@ function emitUnderCondition(state, property, value, cursor, originalValue, conte
|
|
|
1133
1239
|
}
|
|
1134
1240
|
return condition;
|
|
1135
1241
|
}
|
|
1136
|
-
const formatScanFailure = (failure, source, failureIndex) => failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"";
|
|
1242
|
+
const formatScanFailure = (failure, source, failureIndex) => failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : failure === "over-deep-clause" ? `a clause with more than ${grammarMaxNonPlatformDepth} non-platform conditions` : "an unterminated \"(\"";
|
|
1137
1243
|
const warnScanFailure = (property, source, failure, failureIndex) => {
|
|
1138
1244
|
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, formatScanFailure(failure, source, failureIndex));
|
|
1139
1245
|
};
|
|
@@ -1143,15 +1249,28 @@ let valueCaches = /* @__PURE__ */ new WeakMap();
|
|
|
1143
1249
|
let valueCacheEntries = 0;
|
|
1144
1250
|
const valueCacheRoot = {};
|
|
1145
1251
|
const parsedSlices = /* @__PURE__ */ new WeakMap();
|
|
1146
|
-
const
|
|
1147
|
-
|
|
1252
|
+
const cssWideColorKeywords = /* @__PURE__ */ new Set([
|
|
1253
|
+
"inherit",
|
|
1254
|
+
"initial",
|
|
1255
|
+
"unset",
|
|
1256
|
+
"revert",
|
|
1257
|
+
"revert-layer",
|
|
1258
|
+
"currentcolor",
|
|
1259
|
+
"transparent"
|
|
1260
|
+
]);
|
|
1261
|
+
const shadowRecipeProperties = /* @__PURE__ */ new Set([
|
|
1262
|
+
"boxShadow",
|
|
1263
|
+
"textShadow",
|
|
1264
|
+
"filter"
|
|
1265
|
+
]);
|
|
1266
|
+
function configuredValue(state, property, raw, embedded = false, nativeColors) {
|
|
1148
1267
|
const grammar = getConfigRevisionState(state.conf);
|
|
1149
1268
|
let name = raw;
|
|
1150
1269
|
let opacity;
|
|
1151
1270
|
const slash = raw.lastIndexOf("/");
|
|
1152
1271
|
if (slash > 0) {
|
|
1153
|
-
const amount =
|
|
1154
|
-
if (
|
|
1272
|
+
const amount = +raw.slice(slash + 1);
|
|
1273
|
+
if (amount % 1 === 0 && amount >= 0 && amount <= 100) {
|
|
1155
1274
|
name = raw.slice(0, slash);
|
|
1156
1275
|
opacity = amount;
|
|
1157
1276
|
}
|
|
@@ -1161,36 +1280,32 @@ function configuredValue(state, property, raw, embedded = false) {
|
|
|
1161
1280
|
state.flatUsesSafeArea = true;
|
|
1162
1281
|
return safeArea;
|
|
1163
1282
|
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
let maps = scope.get(property);
|
|
1191
|
-
if (maps === void 0) scope.set(property, maps = { direct: /* @__PURE__ */ new Map() });
|
|
1192
|
-
const byRaw = embedded ? maps.embedded ||= /* @__PURE__ */ new Map() : maps.direct;
|
|
1193
|
-
if (!fontProperty) {
|
|
1283
|
+
const fontProperty = property.startsWith("font") || property === "lineHeight" || property === "letterSpacing";
|
|
1284
|
+
const resolveValues = state.styleProps.resolveValues;
|
|
1285
|
+
let byRaw;
|
|
1286
|
+
if (!fontProperty && !nativeColors) {
|
|
1287
|
+
const revision = grammar.revision;
|
|
1288
|
+
if (state.conf !== valueCacheConf || revision !== valueCacheRevision) {
|
|
1289
|
+
valueCacheConf = state.conf;
|
|
1290
|
+
valueCacheRevision = revision;
|
|
1291
|
+
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
1292
|
+
valueCacheEntries = 0;
|
|
1293
|
+
state.flatValueScope = void 0;
|
|
1294
|
+
}
|
|
1295
|
+
const direct = state;
|
|
1296
|
+
let scope = direct.flatValueScope;
|
|
1297
|
+
if (scope === void 0) {
|
|
1298
|
+
const themeObject = state.theme && typeof state.theme === "object" ? state.theme : valueCacheRoot;
|
|
1299
|
+
let byScope = valueCaches.get(themeObject);
|
|
1300
|
+
if (!byScope) valueCaches.set(themeObject, byScope = /* @__PURE__ */ new Map());
|
|
1301
|
+
const scopeKey = `${state.flatThemeName || ""}${resolveValues}`;
|
|
1302
|
+
scope = byScope.get(scopeKey);
|
|
1303
|
+
if (!scope) byScope.set(scopeKey, scope = /* @__PURE__ */ new Map());
|
|
1304
|
+
direct.flatValueScope = scope;
|
|
1305
|
+
}
|
|
1306
|
+
let maps = scope.get(property);
|
|
1307
|
+
if (maps === void 0) scope.set(property, maps = { direct: /* @__PURE__ */ new Map() });
|
|
1308
|
+
byRaw = embedded ? maps.embedded ||= /* @__PURE__ */ new Map() : maps.direct;
|
|
1194
1309
|
const known = byRaw.get(raw);
|
|
1195
1310
|
if (known !== void 0 || byRaw.has(raw)) return known;
|
|
1196
1311
|
}
|
|
@@ -1220,20 +1335,87 @@ function configuredValue(state, property, raw, embedded = false) {
|
|
|
1220
1335
|
}
|
|
1221
1336
|
}
|
|
1222
1337
|
if (process.env.NODE_ENV === "development") {
|
|
1223
|
-
const category = grammar.tokenCategory(property);
|
|
1224
|
-
if (category && category !== "color" && state.conf.tokensParsed.color?.[name]) warnOnce(`"${name}" contributes to "color", not "${property}"`);
|
|
1338
|
+
const category = grammar.tokenCategory(property) || grammar.tokenCategory(state.conf.shorthands[property] || property);
|
|
1339
|
+
if (category && category !== "color" && category !== "boxShadow" && category !== "textShadow" && state.conf.tokensParsed.color?.[name]) warnOnce(`"${name}" contributes to "color", not "${property}"`);
|
|
1340
|
+
if (!value && !fontProperty) {
|
|
1341
|
+
if (name.charCodeAt(0) === 36 || raw.charCodeAt(0) === 36) {
|
|
1342
|
+
const suggested = name.charCodeAt(0) === 36 ? name.slice(1) : raw.slice(1);
|
|
1343
|
+
warnOnce(`v2-token:${property}=${raw}`, `${property}="${raw}": v3 tokens have no "$" prefix, did you mean "${suggested}"?`);
|
|
1344
|
+
} else if ((category === "size" || category === "space" || category === "radius" || category === "zIndex") && /^-?\d+(?:\.\d+)?$/.test(name)) {
|
|
1345
|
+
let nearest;
|
|
1346
|
+
let minDistance = Infinity;
|
|
1347
|
+
const rawNum = Number(name);
|
|
1348
|
+
const tokens = category ? state.conf.tokensParsed[category] : void 0;
|
|
1349
|
+
if (tokens && Number.isFinite(rawNum)) for (const key in tokens) {
|
|
1350
|
+
const val = tokens[key]?.val;
|
|
1351
|
+
const valNum = typeof val === "number" ? val : Number(val);
|
|
1352
|
+
if (Number.isFinite(valNum)) {
|
|
1353
|
+
const dist = Math.abs(valNum - rawNum);
|
|
1354
|
+
if (dist < minDistance) {
|
|
1355
|
+
minDistance = dist;
|
|
1356
|
+
nearest = key;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
if (nearest) warnOnce(`numeric-token:${property}=${raw}`, `${property}="${raw}" was passed to CSS as-is${category === "zIndex" ? "" : " with px units"}${nearest ? `; nearest token is "${nearest}"` : ""}`);
|
|
1361
|
+
} else if (category === "color" && /^[a-zA-Z0-9-]+$/.test(name) && /[a-zA-Z]/.test(name)) {
|
|
1362
|
+
const lower = name.toLowerCase();
|
|
1363
|
+
if (!namedCssColors.has(lower) && !cssWideColorKeywords.has(lower)) {
|
|
1364
|
+
const themeKeys = [];
|
|
1365
|
+
if (state.theme && typeof state.theme === "object") for (const k in state.theme) themeKeys.push(k);
|
|
1366
|
+
if (state.conf.themes) {
|
|
1367
|
+
const active = state.conf.themes[state.flatThemeName || ""];
|
|
1368
|
+
if (active) for (const k in active) themeKeys.push(k);
|
|
1369
|
+
else for (const t in state.conf.themes) for (const k in state.conf.themes[t]) themeKeys.push(k);
|
|
1370
|
+
}
|
|
1371
|
+
let bestMatch;
|
|
1372
|
+
let minDistance = 3;
|
|
1373
|
+
for (const key of themeKeys) {
|
|
1374
|
+
if (Math.abs(key.length - name.length) > 2) continue;
|
|
1375
|
+
const m = name.length;
|
|
1376
|
+
const n = key.length;
|
|
1377
|
+
const d = [];
|
|
1378
|
+
for (let i = 0; i <= m; i++) d[i] = i;
|
|
1379
|
+
for (let j = 1; j <= n; j++) {
|
|
1380
|
+
let prev = d[0];
|
|
1381
|
+
d[0] = j;
|
|
1382
|
+
for (let i = 1; i <= m; i++) {
|
|
1383
|
+
const temp = d[i];
|
|
1384
|
+
d[i] = name[i - 1] === key[j - 1] ? prev : Math.min(prev, d[i], d[i - 1]) + 1;
|
|
1385
|
+
prev = temp;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
const dist = d[m];
|
|
1389
|
+
if (dist <= 2 && dist < minDistance) {
|
|
1390
|
+
minDistance = dist;
|
|
1391
|
+
bestMatch = key;
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
warnOnce(`unknown-color:${property}=${raw}`, bestMatch ? `unknown color "${name}", did you mean "${bestMatch}"?` : `unknown color "${name}"`);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1225
1398
|
}
|
|
1226
1399
|
let out = raw;
|
|
1227
1400
|
if (isVariable(value)) {
|
|
1228
|
-
out = resolveValues === "except-theme" && fromTheme ? `${THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : resolveVariableValue(property, value, resolveValues);
|
|
1401
|
+
out = resolveValues === "except-theme" && fromTheme ? `${THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : resolveVariableValue(nativeColors ? "color" : property, value, resolveValues);
|
|
1229
1402
|
if (opacity !== void 0) out = `color-mix(in srgb, ${out} ${opacity}%, transparent)`;
|
|
1230
1403
|
}
|
|
1404
|
+
if (nativeColors && out && typeof out === "object") {
|
|
1405
|
+
const reference = `__tamagui_native_color_${nativeColors.size}`;
|
|
1406
|
+
nativeColors.set(reference, out);
|
|
1407
|
+
out = reference;
|
|
1408
|
+
}
|
|
1231
1409
|
if (embedded && out === raw) {
|
|
1232
1410
|
const usedSafeArea = state.flatUsesSafeArea;
|
|
1233
|
-
out = grammar.embeddedTokens(raw, (word) =>
|
|
1411
|
+
out = grammar.embeddedTokens(raw, (word) => {
|
|
1412
|
+
const resolved = configuredValue(state, property, word, false, nativeColors);
|
|
1413
|
+
if (resolved !== word || !shadowRecipeProperties.has(property) || !/^[a-z][\w-]*$/i.test(word)) return resolved;
|
|
1414
|
+
return configuredValue(state, "color", word, false, nativeColors);
|
|
1415
|
+
});
|
|
1234
1416
|
if (!usedSafeArea && state.flatUsesSafeArea) return out;
|
|
1235
1417
|
}
|
|
1236
|
-
if (!fontProperty && !fromTheme) if (valueCacheEntries > 8192) {
|
|
1418
|
+
if (!fontProperty && !fromTheme && !nativeColors) if (valueCacheEntries > 8192) {
|
|
1237
1419
|
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
1238
1420
|
valueCacheEntries = 0;
|
|
1239
1421
|
} else {
|
|
@@ -1247,13 +1429,15 @@ function ownsSourceLayer(state, property, conditional = false) {
|
|
|
1247
1429
|
const layer = direct.flatPass?.[passSourceLayer] || 0;
|
|
1248
1430
|
const layers = direct.flatPropertyLayers ||= /* @__PURE__ */ new Map();
|
|
1249
1431
|
const previous = layers.get(property);
|
|
1250
|
-
if (
|
|
1251
|
-
|
|
1252
|
-
if (
|
|
1253
|
-
if (
|
|
1254
|
-
clearDirectStyle(state, property);
|
|
1432
|
+
if (!layer && !conditional && !direct.flatPass?.[passVariantOutput]) {
|
|
1433
|
+
const entries = direct.flatSlots?.get(styleSlot(property));
|
|
1434
|
+
if (entries) {
|
|
1435
|
+
for (let index = entries.length; index--;) if (entries[index][0] === property && entries[index][9]) entries.splice(index, 1);
|
|
1255
1436
|
}
|
|
1256
|
-
}
|
|
1437
|
+
}
|
|
1438
|
+
if (previous > layer) return false;
|
|
1439
|
+
if (conditional && previous !== layer) return true;
|
|
1440
|
+
if (previous < layer) clearDirectStyle(state, property);
|
|
1257
1441
|
layers.set(property, layer);
|
|
1258
1442
|
return true;
|
|
1259
1443
|
}
|
|
@@ -1280,6 +1464,10 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
|
|
|
1280
1464
|
addTransformValue(state.transformAccumulator, property, value);
|
|
1281
1465
|
return;
|
|
1282
1466
|
}
|
|
1467
|
+
if (property === "transition" && condition & 12 && !state.staticConfig.isHOC && state.styleProps.isAnimated) {
|
|
1468
|
+
streamWriteInline(state, property, value, cursor, originalValue, false, -1, true);
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1283
1471
|
const shouldPromoteAnimatedStyle = canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && state.animationDriver?.inputStyle === "css" && property in nonAnimatableStyleProps;
|
|
1284
1472
|
if (canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
1285
1473
|
writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
|
|
@@ -1288,19 +1476,19 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
|
|
|
1288
1476
|
streamWriteInline(state, property, value, cursor, originalValue);
|
|
1289
1477
|
}
|
|
1290
1478
|
function numericUnitValue(value, first, second) {
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1479
|
+
return value.length > first.length && (value.endsWith(first) || value.endsWith(second)) ? +value.slice(0, -first.length) : NaN;
|
|
1480
|
+
}
|
|
1481
|
+
function resolveNumericValue(value) {
|
|
1482
|
+
let numeric = numericUnitValue(value, "px", "dp");
|
|
1483
|
+
return isFinite(numeric) ? numeric : isFinite(numeric = +value) ? numeric : value;
|
|
1295
1484
|
}
|
|
1296
1485
|
function emitResolved(state, property, raw, cursor, originalValue, contextOnly) {
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
emitProperty(state, property, value, cursor, originalValue, contextOnly);
|
|
1486
|
+
emitProperty(state, property, resolveValue(state, property, raw), cursor, originalValue, contextOnly);
|
|
1487
|
+
}
|
|
1488
|
+
function resolveValue(state, property, raw, nativeColors) {
|
|
1489
|
+
let value = typeof raw === "string" ? configuredValue(state, property, raw, true, nativeColors) : raw;
|
|
1490
|
+
if (!state.flatShouldDoClasses && typeof value === "string" && value !== "" && property !== "lineHeight") value = resolveNumericValue(value);
|
|
1491
|
+
return value;
|
|
1304
1492
|
}
|
|
1305
1493
|
function shadowUnit(part) {
|
|
1306
1494
|
return typeof part === "number" ? `${part}px` : part || "0px";
|
|
@@ -1320,7 +1508,13 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1320
1508
|
const grammar = getConfigRevisionState(state.conf);
|
|
1321
1509
|
property = webStyleProperty(property);
|
|
1322
1510
|
if (property === "backdropFilter") emitValue(state, "WebkitBackdropFilter", raw, cursor, originalValue, contextOnly);
|
|
1323
|
-
if (isVariable(raw))
|
|
1511
|
+
if (isVariable(raw)) {
|
|
1512
|
+
raw = resolveVariableValue(property, raw, state.styleProps.resolveValues);
|
|
1513
|
+
if (property === "lineHeight") {
|
|
1514
|
+
emitProperty(state, property, raw, cursor, originalValue, contextOnly);
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1324
1518
|
if (typeof raw === "string" && (property === "transition" || property === "transitionProperty")) raw = grammar.normalizeTransition(raw);
|
|
1325
1519
|
if ((property === "borderWidth" || property === "borderTopWidth" || property === "borderRightWidth" || property === "borderBottomWidth" || property === "borderLeftWidth") && state.styleProps.noNormalize !== false) writeStyleRecord(state, property.slice(0, -5) + "Style", "solid", cursor, originalValue, recordDefault);
|
|
1326
1520
|
const propertyKind = grammar.propertyKind(property);
|
|
@@ -1357,10 +1551,17 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1357
1551
|
}
|
|
1358
1552
|
if (property === "transform") {
|
|
1359
1553
|
if (canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = transformsToString(raw);
|
|
1554
|
+
if (typeof raw === "string" && !state.flatShouldDoClasses && state.animationDriver?.inputStyle === "value") {
|
|
1555
|
+
const transform = parseNativeTransform(raw);
|
|
1556
|
+
if (transform) {
|
|
1557
|
+
emitProperty(state, property, transform, cursor, originalValue, contextOnly);
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1360
1561
|
}
|
|
1361
1562
|
if (typeof raw === "string" && property === "background") {
|
|
1362
1563
|
const parts = splitComponents(raw);
|
|
1363
|
-
if (parts.length === 1 && !startsValueFunction(parts[0])) {
|
|
1564
|
+
if (parts.length === 1 && (!startsValueFunction(parts[0]) || false)) {
|
|
1364
1565
|
emitResolved(state, "backgroundColor", parts[0], cursor, originalValue, contextOnly);
|
|
1365
1566
|
return;
|
|
1366
1567
|
}
|
|
@@ -1368,7 +1569,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1368
1569
|
if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
|
|
1369
1570
|
let value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
1370
1571
|
if (!state.flatShouldDoClasses && typeof value2 === "string" && !value2.startsWith(THEME_REF_PREFIX)) {
|
|
1371
|
-
if (property === "rotate" && !
|
|
1572
|
+
if (property === "rotate" && !isFinite(numericUnitValue(value2, "deg", "rad")) && !startsValueFunction(value2)) {
|
|
1372
1573
|
if (process.env.NODE_ENV === "development") warnOnce(`native transform "${property}" cannot represent "${value2}"; dropping it`);
|
|
1373
1574
|
if (condition & 1) {
|
|
1374
1575
|
removeTransformValue(state.transformAccumulator, property);
|
|
@@ -1376,9 +1577,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1376
1577
|
}
|
|
1377
1578
|
return;
|
|
1378
1579
|
}
|
|
1379
|
-
|
|
1380
|
-
if (Number.isFinite(unitValue)) value2 = unitValue;
|
|
1381
|
-
else if (Number.isFinite(Number(value2))) value2 = Number(value2);
|
|
1580
|
+
value2 = resolveNumericValue(value2);
|
|
1382
1581
|
}
|
|
1383
1582
|
if (!canGenerateCSS || !state.flatShouldDoClasses) {
|
|
1384
1583
|
emitProperty(state, property, value2, cursor, originalValue, contextOnly);
|
|
@@ -1402,13 +1601,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1402
1601
|
else emitProperty(state, property, raw, cursor, originalValue, contextOnly);
|
|
1403
1602
|
return;
|
|
1404
1603
|
}
|
|
1405
|
-
let value = raw;
|
|
1406
|
-
if (typeof raw === "string") value = configuredValue(state, property, raw, true);
|
|
1407
|
-
if (!state.flatShouldDoClasses && typeof value === "string") {
|
|
1408
|
-
const unitValue = numericUnitValue(value, "px", "dp");
|
|
1409
|
-
if (Number.isFinite(unitValue)) value = unitValue;
|
|
1410
|
-
else if (value !== "" && Number.isFinite(Number(value))) value = Number(value);
|
|
1411
|
-
}
|
|
1604
|
+
let value = resolveValue(state, property, raw, void 0);
|
|
1412
1605
|
if (canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
|
|
1413
1606
|
state.flatBoxShadow = value;
|
|
1414
1607
|
state.flatBoxShadowSequence = frameSequence + 1;
|
|
@@ -1419,7 +1612,12 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1419
1612
|
}
|
|
1420
1613
|
emitProperty(state, property, value, cursor, originalValue, contextOnly);
|
|
1421
1614
|
}
|
|
1422
|
-
function
|
|
1615
|
+
function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
|
|
1616
|
+
if (sink) sink(payload, condition, source);
|
|
1617
|
+
else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 || state.staticConfig.isHOC || state.styleProps.stylePieceEntries ? payload : void 0, contextOnly, mode, source);
|
|
1618
|
+
else emitValue(state, property, payload, null, payload, contextOnly);
|
|
1619
|
+
}
|
|
1620
|
+
function walkConditionalValue(state, property, value, parent, sink, warnMode = 0, contextOnly = false) {
|
|
1423
1621
|
const parentCondition = parent || null;
|
|
1424
1622
|
let hasBase = false;
|
|
1425
1623
|
let conditions = 0;
|
|
@@ -1427,13 +1625,18 @@ function walkConditionalValue(state, property, value, parent, sink, warnMode = 0
|
|
|
1427
1625
|
if (typeof value === "string") {
|
|
1428
1626
|
const parsed = getConfigRevisionState(state.conf).parseFlatValue(value);
|
|
1429
1627
|
const [segments, failure, failureIndex] = parsed;
|
|
1628
|
+
if (process.env.NODE_ENV === "development") {
|
|
1629
|
+
if (getSetting("styleValueSyntax") === "object") {
|
|
1630
|
+
if (segments.length > 5 || segments.length >= 5 && segments[2] !== -1 || value.includes(":")) warnOnce(`syntax:string:${property}=${value}`, `string syntax is disabled by config (styleValueSyntax: 'object'); received "${property}=${value}"`);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1430
1633
|
let slices = parsedSlices.get(parsed);
|
|
1431
1634
|
if (slices === void 0) parsedSlices.set(parsed, slices = []);
|
|
1432
1635
|
const chainCount = segments.length / 5 - 1;
|
|
1433
1636
|
if (property === "aspectRatio" && chainCount === 1) {
|
|
1434
|
-
const left =
|
|
1435
|
-
const right =
|
|
1436
|
-
if (left > 0 && right > 0 &&
|
|
1637
|
+
const left = +value.slice(segments[7], segments[8]);
|
|
1638
|
+
const right = +value.slice(segments[5], segments[6]);
|
|
1639
|
+
if (left > 0 && right > 0 && isFinite(left) && isFinite(right)) return false;
|
|
1437
1640
|
}
|
|
1438
1641
|
for (let index = 0; index < segments.length; index += 5) {
|
|
1439
1642
|
const start = segments[index];
|
|
@@ -1443,10 +1646,10 @@ function walkConditionalValue(state, property, value, parent, sink, warnMode = 0
|
|
|
1443
1646
|
if (start === end) continue;
|
|
1444
1647
|
if (flags & 2) {
|
|
1445
1648
|
const payload = slices[index] ??= value.slice(start, end);
|
|
1446
|
-
|
|
1649
|
+
emitConditionalValue(state, property, payload, parentCondition, payload, sink, warnMode, contextOnly);
|
|
1447
1650
|
hasBase = true;
|
|
1448
1651
|
} else if (process.env.NODE_ENV !== "production" && warnMode && !chainCount && (failure === "invalid-character" || failure === "stray-comment-close")) {
|
|
1449
|
-
|
|
1652
|
+
emitConditionalValue(state, property, value, parentCondition, value, sink, warnMode, contextOnly);
|
|
1450
1653
|
hasBase = true;
|
|
1451
1654
|
} else if (warnMode) warnScanFailure(property, value, failure, failureIndex);
|
|
1452
1655
|
}
|
|
@@ -1467,30 +1670,36 @@ function walkConditionalValue(state, property, value, parent, sink, warnMode = 0
|
|
|
1467
1670
|
}
|
|
1468
1671
|
const cursor = conditionFromKey(state, slices[index + 2] ??= value.slice(segments[index + 2], segments[index + 3]), parentCondition);
|
|
1469
1672
|
conditions |= cursor[conditionValue];
|
|
1470
|
-
if (cursor[conditionValue] & conditionResolvedFlag || warnMode)
|
|
1673
|
+
if (cursor[conditionValue] & conditionResolvedFlag || warnMode) emitConditionalValue(state, property, slices[index] ??= value.slice(start, end), cursor, value, sink, warnMode, contextOnly);
|
|
1471
1674
|
}
|
|
1472
1675
|
if (process.env.NODE_ENV !== "production") lastPayload = value.slice(lastPayloadStart);
|
|
1473
1676
|
} else {
|
|
1474
1677
|
if (!value || typeof value !== "object" || Array.isArray(value) || isVariable(value) || !classifyConditionalObject(value, state)) return false;
|
|
1678
|
+
if (process.env.NODE_ENV === "development") {
|
|
1679
|
+
if (getSetting("styleValueSyntax") === "string") warnOnce(`syntax:object:${property}=${JSON.stringify(value)}`, `object-form conditional syntax is disabled by config (styleValueSyntax: 'string'); received "${property}"`);
|
|
1680
|
+
}
|
|
1475
1681
|
if (value.default != null) {
|
|
1476
|
-
|
|
1682
|
+
emitConditionalValue(state, property, value.default, parentCondition, value.default, sink, warnMode, contextOnly);
|
|
1477
1683
|
hasBase = true;
|
|
1478
1684
|
}
|
|
1479
1685
|
for (const key in value) {
|
|
1480
1686
|
if (key === "default" || value[key] == null) continue;
|
|
1481
1687
|
const cursor = conditionFromKey(state, key, parentCondition);
|
|
1482
1688
|
conditions |= cursor[conditionValue];
|
|
1483
|
-
if (cursor[conditionValue] & conditionResolvedFlag || warnMode)
|
|
1689
|
+
if (cursor[conditionValue] & conditionResolvedFlag || warnMode) emitConditionalValue(state, property, value[key], cursor, value[key], sink, warnMode, contextOnly);
|
|
1484
1690
|
}
|
|
1485
1691
|
}
|
|
1486
|
-
if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && getConfigRevisionState(state.conf).tokenCategory(property) && splitComponents(lastPayload).length > 1) warnOnce(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1487
|
-
if (warnMode === 1 &&
|
|
1692
|
+
if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && getConfigRevisionState(state.conf).tokenCategory(property) && getConfigRevisionState(state.conf).propertyKind(property) !== 8 && property !== "boxShadow" && property !== "textShadow" && property !== "fontFamily" && property !== "gap" && splitComponents(lastPayload).length > 1) warnOnce(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1693
|
+
if (warnMode === 1 && conditions & 12 && !hasBase) {
|
|
1488
1694
|
const resting = property === "opacity" || property.startsWith("scale") ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
|
|
1489
|
-
|
|
1695
|
+
const layers = state.flatPropertyLayers;
|
|
1696
|
+
const owned = !canGenerateCSS || !state.flatShouldDoClasses ? layers?.has(property) : property === "scale" ? layers?.has("--t-scale-x") || layers?.has("--t-scale-y") : layers?.has(property === "x" ? "--t-x" : property === "y" ? "--t-y" : property === "scaleX" ? "--t-scale-x" : property === "scaleY" ? "--t-scale-y" : property);
|
|
1697
|
+
if (resting !== null && !owned) emitConditionalValue(state, property, resting, parentCondition, resting, sink, warnMode, contextOnly);
|
|
1490
1698
|
}
|
|
1491
1699
|
return true;
|
|
1492
1700
|
}
|
|
1493
1701
|
function contributeValue(state, property, value, originalValue, contextOnly = false, condition) {
|
|
1702
|
+
if (!contextOnly && isRemovedVendorStyleProp(property) && !(state.staticConfig.validStyles && property in state.staticConfig.validStyles)) return;
|
|
1494
1703
|
if (condition !== void 0) {
|
|
1495
1704
|
const parent2 = state.flatPass?.[passParentCursor] || null;
|
|
1496
1705
|
let effective;
|
|
@@ -1500,7 +1709,7 @@ function contributeValue(state, property, value, originalValue, contextOnly = fa
|
|
|
1500
1709
|
if (!(condition[conditionValue] & conditionResolvedFlag)) setConditionUnresolved(effective);
|
|
1501
1710
|
commitCondition(effective);
|
|
1502
1711
|
} else effective = condition;
|
|
1503
|
-
if (typeof value !== "string" && walkConditionalValue(state, property, value, effective,
|
|
1712
|
+
if (typeof value !== "string" && walkConditionalValue(state, property, value, effective, null, 2, contextOnly)) return true;
|
|
1504
1713
|
emitUnderCondition(state, property, value, effective, originalValue, contextOnly, 2, value);
|
|
1505
1714
|
return true;
|
|
1506
1715
|
}
|
|
@@ -1517,7 +1726,7 @@ function contributeValue(state, property, value, originalValue, contextOnly = fa
|
|
|
1517
1726
|
return true;
|
|
1518
1727
|
}
|
|
1519
1728
|
}
|
|
1520
|
-
if (walkConditionalValue(state, property, value, state.flatPass?.[passParentCursor] || null,
|
|
1729
|
+
if (walkConditionalValue(state, property, value, state.flatPass?.[passParentCursor] || null, null, 1, contextOnly)) return true;
|
|
1521
1730
|
if (value != null) {
|
|
1522
1731
|
emitAtParentCondition(state, property, value, originalValue ?? value, contextOnly);
|
|
1523
1732
|
return true;
|
|
@@ -1526,19 +1735,21 @@ function contributeValue(state, property, value, originalValue, contextOnly = fa
|
|
|
1526
1735
|
}
|
|
1527
1736
|
function clearDirectStyle(state, property) {
|
|
1528
1737
|
const direct = state;
|
|
1738
|
+
if (direct.flatDynamicColors) delete direct.flatDynamicColors[property];
|
|
1529
1739
|
property = webStyleProperty(property);
|
|
1530
1740
|
const propertyKind = getConfigRevisionState(state.conf).propertyKind(property);
|
|
1531
1741
|
const atomicKey = property.startsWith("transition") ? "transition" : propertyKind > 0 && propertyKind < 5 ? "boxShadow" : propertyKind === 6 ? "textShadow" : propertyKind === 5 ? "transform" : property;
|
|
1532
1742
|
const slot = styleSlot(atomicKey);
|
|
1533
1743
|
direct.flatAtomics?.delete(slot);
|
|
1534
1744
|
if (direct.flatSlots) {
|
|
1535
|
-
if (slot !== atomicKey) {
|
|
1745
|
+
if (slot !== atomicKey || atomicKey === "flex") {
|
|
1536
1746
|
const entries = direct.flatSlots.get(slot);
|
|
1537
1747
|
if (entries) {
|
|
1538
1748
|
for (let index = entries.length; index--;) if (entries[index][0] === atomicKey) entries.splice(index, 1);
|
|
1749
|
+
if (!entries.length) direct.flatSlots.delete(slot);
|
|
1539
1750
|
}
|
|
1540
1751
|
}
|
|
1541
|
-
direct.flatSlots.delete(atomicKey);
|
|
1752
|
+
if (atomicKey !== "flex") direct.flatSlots.delete(atomicKey);
|
|
1542
1753
|
}
|
|
1543
1754
|
if (atomicKey === "transform") state.transformAccumulator = void 0;
|
|
1544
1755
|
if (state.style) delete state.style[atomicKey];
|
|
@@ -1550,9 +1761,12 @@ function emitVariantStyle(state, key, value, original, condition, disabled) {
|
|
|
1550
1761
|
if (key !== pass[passMapSourceKey] && state.flatCallerVariantKeys?.has(key)) return;
|
|
1551
1762
|
if (state.flatStyleStaticConfig.styledContextKeys?.has(key)) (state.overriddenContextProps ||= {})[key] = (state.originalContextPropValues ||= {})[key] = original;
|
|
1552
1763
|
const parent = pass[passParentCursor];
|
|
1764
|
+
const parentVariantOutput = pass[passVariantOutput];
|
|
1553
1765
|
pass[passParentCursor] = condition;
|
|
1766
|
+
pass[passVariantOutput] = true;
|
|
1554
1767
|
contributeProp(pass, key, value, original, disabled);
|
|
1555
1768
|
pass[passParentCursor] = parent;
|
|
1769
|
+
pass[passVariantOutput] = parentVariantOutput;
|
|
1556
1770
|
}
|
|
1557
1771
|
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
1558
1772
|
if (isVariable(input)) {
|