@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
|
@@ -32,6 +32,7 @@ __export(getSplitStyles_exports, {
|
|
|
32
32
|
walkConditionalValue: () => walkConditionalValue
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(getSplitStyles_exports);
|
|
35
|
+
var import_transitionResolver = require("@tamagui/animation-helpers/transitionResolver");
|
|
35
36
|
var import_constants = require("@tamagui/constants");
|
|
36
37
|
var import_helpers = require("@tamagui/helpers");
|
|
37
38
|
var import_runtime = require("@tamagui/style-grammar/runtime");
|
|
@@ -47,6 +48,7 @@ require("./expandStyles.cjs");
|
|
|
47
48
|
var import_grammarConfig = require("./grammarConfig.cjs");
|
|
48
49
|
var import_mediaState = require("./mediaState.cjs");
|
|
49
50
|
var import_styleStaticConfig = require("./styleStaticConfig.cjs");
|
|
51
|
+
var import_styleFrontend = require("./styleFrontend.cjs");
|
|
50
52
|
require("./nativeStyleEngine.cjs");
|
|
51
53
|
var import_warnOnce = require("./warnOnce.cjs");
|
|
52
54
|
require("./getDynamicVal.cjs");
|
|
@@ -55,8 +57,11 @@ var import_insertStyleRule = require("./insertStyleRule.cjs");
|
|
|
55
57
|
var import_log = require("./log.cjs");
|
|
56
58
|
var import_normalizeColor = require("./normalizeColor.cjs");
|
|
57
59
|
var import_normalizeValueWithProperty = require("./normalizeValueWithProperty.cjs");
|
|
58
|
-
require("./
|
|
59
|
-
require("./
|
|
60
|
+
require("./nativeTextMetrics.cjs");
|
|
61
|
+
require("./isTamaguiElement.cjs");
|
|
62
|
+
require("./parseNativeStyle.cjs");
|
|
63
|
+
var import_parseNativeTransform = require("./parseNativeTransform.native.cjs");
|
|
64
|
+
require("./resolveNativeUnits.cjs");
|
|
60
65
|
var import_resolveVariableValue = require("./resolveVariableValue.cjs");
|
|
61
66
|
var import_skipProps = require("./skipProps.cjs");
|
|
62
67
|
var import_styleOriginalValues = require("./styleOriginalValues.cjs");
|
|
@@ -254,6 +259,7 @@ const passFrontendContainerType = 27;
|
|
|
254
259
|
const passSourceLayer = 28;
|
|
255
260
|
const passParentCursor = 29;
|
|
256
261
|
const passMapSourceKey = 30;
|
|
262
|
+
const passVariantOutput = 31;
|
|
257
263
|
const passFlags = 13;
|
|
258
264
|
const sourceLayerBase = 0;
|
|
259
265
|
const sourceLayerVariant = 1;
|
|
@@ -268,6 +274,9 @@ const passHocFlag = 16;
|
|
|
268
274
|
const passTextFlag = 32;
|
|
269
275
|
const passInputFlag = 64;
|
|
270
276
|
const passAsChildStyleFlag = 128;
|
|
277
|
+
function isRemovedVendorStyleProp(property) {
|
|
278
|
+
return /^(Webkit|Moz|ms)[A-Z]/.test(property) && !(property in import_helpers.stylePropsAll);
|
|
279
|
+
}
|
|
271
280
|
function isValidStyleKey(key, validStyles) {
|
|
272
281
|
return key in validStyles;
|
|
273
282
|
}
|
|
@@ -291,7 +300,6 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
291
300
|
const shouldCheckSkipProps = !noSkip;
|
|
292
301
|
const asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
|
|
293
302
|
const isTextOrInput = isText || isInput;
|
|
294
|
-
const hocParentVariants = isHOC ? parentVariants : void 0;
|
|
295
303
|
let keyInit = keyOg;
|
|
296
304
|
let valInit = valOg;
|
|
297
305
|
if (keyInit === "children") {
|
|
@@ -315,17 +323,24 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
315
323
|
return;
|
|
316
324
|
}
|
|
317
325
|
const resolveClassName = styleFrontend?.resolveClassName;
|
|
326
|
+
let composedProps = null;
|
|
318
327
|
const sink = (entry) => {
|
|
319
328
|
const property = entry[0];
|
|
320
|
-
|
|
321
|
-
|
|
329
|
+
const condition2 = entry[2];
|
|
330
|
+
if (property.charCodeAt(0) === 95 && property.charCodeAt(1) === 95) {
|
|
331
|
+
composedProps ||= {};
|
|
332
|
+
composedProps[property] = (0, import_styleFrontend.mergeFrontendCondition)(composedProps[property], entry[1], condition2);
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
if (condition2 !== void 0) {
|
|
336
|
+
if (isValidStyleKey(property, validStyles)) contributeValue(styleState, property, entry[1], void 0, false, condition2);
|
|
322
337
|
else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property}" is not a valid style on this component; the frontend value is dropped.`);
|
|
323
|
-
|
|
324
|
-
if (property === "group") pass[passFrontendGroup] = entry[1];
|
|
325
|
-
else if (property === "container") pass[passFrontendContainer] = entry[1];
|
|
326
|
-
else if (property === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
327
|
-
contributeProp(pass, property, entry[1]);
|
|
338
|
+
return;
|
|
328
339
|
}
|
|
340
|
+
if (property === "group") pass[passFrontendGroup] = entry[1];
|
|
341
|
+
else if (property === "container") pass[passFrontendContainer] = entry[1];
|
|
342
|
+
else if (property === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
343
|
+
contributeProp(pass, property, entry[1]);
|
|
329
344
|
};
|
|
330
345
|
let start = 0;
|
|
331
346
|
for (let index = 0; index <= valInit.length; index++) {
|
|
@@ -351,18 +366,38 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
351
366
|
}
|
|
352
367
|
start = index + 1;
|
|
353
368
|
}
|
|
369
|
+
if (composedProps) {
|
|
370
|
+
const composed = styleFrontend.compose?.(composedProps);
|
|
371
|
+
for (const property in composed) contributeProp(pass, property, composed[property]);
|
|
372
|
+
}
|
|
354
373
|
}
|
|
355
374
|
return;
|
|
356
375
|
}
|
|
357
376
|
if (keyInit === import_skipProps.HOC_CLASSNAME_MARKER) {
|
|
358
|
-
if (valInit
|
|
377
|
+
if (valInit) {
|
|
378
|
+
const [hocClassNames, hocSlots] = valInit;
|
|
359
379
|
const direct = styleState;
|
|
360
380
|
const layers = direct.flatPropertyLayers ||= /* @__PURE__ */ new Map();
|
|
361
|
-
for (const property in
|
|
381
|
+
for (const property in hocClassNames) {
|
|
382
|
+
if (hocSlots?.has(property)) continue;
|
|
362
383
|
clearDirectStyle(styleState, property);
|
|
363
|
-
styleState.classNames[property] =
|
|
384
|
+
styleState.classNames[property] = hocClassNames[property];
|
|
364
385
|
layers.set(property, pass[passSourceLayer]);
|
|
365
386
|
}
|
|
387
|
+
if (hocSlots) {
|
|
388
|
+
const slots = direct.flatSlots ||= /* @__PURE__ */ new Map();
|
|
389
|
+
const markerLayer = pass[passSourceLayer];
|
|
390
|
+
for (const [slot, entries] of hocSlots) for (const entry of entries) {
|
|
391
|
+
pass[passSourceLayer] = Math.max(entry[7] >> 5, sourceLayerResolver);
|
|
392
|
+
if (!ownsSourceLayer(styleState, entry[0], !!entry[2])) continue;
|
|
393
|
+
if (!isHOC && styleState.styleProps.isAnimated && (slot === "transition" || entry[8]) && !(entry[0] in import_helpers.nonAnimatableStyleProps)) {
|
|
394
|
+
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];
|
|
395
|
+
const value = styleState.animationDriver?.inputStyle === "value" ? entry[6] : entry[1];
|
|
396
|
+
entry[3] ? contributeValue(styleState, property, value, entry[6], false, entry[3]) : emitValue(styleState, property, value, null, entry[6], false);
|
|
397
|
+
} else writeStyleSlot(slots, slot, [...entry], pass[passSourceLayer]);
|
|
398
|
+
}
|
|
399
|
+
pass[passSourceLayer] = markerLayer;
|
|
400
|
+
}
|
|
366
401
|
}
|
|
367
402
|
return;
|
|
368
403
|
}
|
|
@@ -390,11 +425,30 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
390
425
|
continue;
|
|
391
426
|
}
|
|
392
427
|
const styleOriginals = shouldTrackStyleTokenProvenance ? import_styleOriginalValues.styleOriginalValues.get(style) : void 0;
|
|
393
|
-
for (const
|
|
394
|
-
|
|
395
|
-
if (
|
|
396
|
-
|
|
397
|
-
|
|
428
|
+
for (const authoredKey in style) {
|
|
429
|
+
const value = style[authoredKey];
|
|
430
|
+
if (value == null) continue;
|
|
431
|
+
const key = disableExpandShorthands ? authoredKey : shorthands[authoredKey] || authoredKey;
|
|
432
|
+
let inline = !styleState.styleProps.stylePieceEntries;
|
|
433
|
+
if (key === "containerName") {
|
|
434
|
+
pass[passContainerName] = value;
|
|
435
|
+
inline = false;
|
|
436
|
+
} else if (key === "containerType") {
|
|
437
|
+
pass[passContainerType] = value;
|
|
438
|
+
inline = false;
|
|
439
|
+
}
|
|
440
|
+
if (inline) {
|
|
441
|
+
if (typeof value === "string") {
|
|
442
|
+
const [segments] = (0, import_grammarConfig.getConfigRevisionState)(conf).parseFlatValue(value);
|
|
443
|
+
for (let index2 = 4; index2 < segments.length; index2 += 5) if (!(segments[index2] & 1)) {
|
|
444
|
+
inline = false;
|
|
445
|
+
break;
|
|
446
|
+
}
|
|
447
|
+
} else if (value && typeof value === "object" && !Array.isArray(value) && !(0, import_createVariable.isVariable)(value) && classifyConditionalObject(value, styleState) !== 0) inline = false;
|
|
448
|
+
}
|
|
449
|
+
styleState.flatInlineStyleProp = inline;
|
|
450
|
+
contributeValue(styleState, key, value, styleOriginals?.[authoredKey]);
|
|
451
|
+
styleState.flatInlineStyleProp = false;
|
|
398
452
|
}
|
|
399
453
|
}
|
|
400
454
|
pass[passSourceLayer] = layerBeforeStyle;
|
|
@@ -404,12 +458,26 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
404
458
|
const defaultVal = defaultProps[keyOg] ?? defaultProps[keyInit];
|
|
405
459
|
if (defaultVal !== void 0 && valInit === defaultVal) return;
|
|
406
460
|
}
|
|
461
|
+
if (process.env.NODE_ENV === "development") {
|
|
462
|
+
if (!isValidStyleKey(keyInit, validStyles) && (keyInit === "animation" || !(keyInit in import_helpers.stylePropsAll)) && (!variants || !(keyInit in variants))) {
|
|
463
|
+
let replacement;
|
|
464
|
+
if (keyInit === "animation") replacement = "transition=";
|
|
465
|
+
else if (keyInit === "hoverStyle") replacement = "hover: clause";
|
|
466
|
+
else if (keyInit === "pressStyle") replacement = "press: clause";
|
|
467
|
+
else if (keyInit === "focusStyle") replacement = "focus: clause";
|
|
468
|
+
else if (keyInit === "enterStyle") replacement = "enter: clause";
|
|
469
|
+
else if (keyInit === "exitStyle") replacement = "exit: clause";
|
|
470
|
+
else if (keyInit.charCodeAt(0) === 36 && keyInit.length > 1) replacement = `${keyInit.slice(1)}: clause`;
|
|
471
|
+
if (replacement) (0, import_warnOnce.warnOnce)(`v2-prop:${keyInit}`, `prop "${keyInit}" was removed in v3; use ${replacement}`);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
407
474
|
if (keyInit in import_skipProps.skipProps && shouldSkipDirectProps && !neverSkipProps?.[keyInit]) {
|
|
408
475
|
if (keyInit === "container") pass[passContainerValue] = valInit;
|
|
409
476
|
if (keyInit === "transition" && typeof valInit === "string") {
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
477
|
+
const transitions = (0, import_transitionResolver.getTransitionResolver)();
|
|
478
|
+
const resolved = transitions?.resolve(valInit, { animations: driverAnimations });
|
|
479
|
+
if (resolved?.fused) if (driverOutputStyle === "css" && process.env.IS_STATIC === "is_static") valInit = transitions.toCSS(resolved) ?? valInit;
|
|
480
|
+
else return;
|
|
413
481
|
} else return;
|
|
414
482
|
}
|
|
415
483
|
let isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles);
|
|
@@ -417,11 +485,15 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
417
485
|
viewProps[keyInit] = valInit;
|
|
418
486
|
return;
|
|
419
487
|
}
|
|
488
|
+
if (pass[passVariantOutput] && !isValidStyleKeyInit && !keyInit.startsWith("aria-") && !(keyInit in import_helpers.stylePropsAll) && !(keyInit in import_skipProps.skipProps) && !(variants && keyInit in variants) && !(parentVariants && keyInit in parentVariants) && !styledContextKeys?.has(keyInit) && !(styledContext && keyInit in styledContext)) {
|
|
489
|
+
if (process.env.NODE_ENV === "development") (0, import_warnOnce.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.`);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
420
492
|
if (!noExpand) {
|
|
421
493
|
if (keyInit === "disabled" && valInit === true) {
|
|
422
494
|
viewProps["aria-disabled"] = true;
|
|
423
495
|
if (isInput || elementType === "button" || elementType === "form" || elementType === "input" || elementType === "select" || elementType === "textarea") viewProps.disabled = true;
|
|
424
|
-
if (!variants?.disabled) return;
|
|
496
|
+
if (!variants?.disabled && !isHOC) return;
|
|
425
497
|
}
|
|
426
498
|
if (keyInit === "testID") {
|
|
427
499
|
viewProps["data-testid"] = valInit;
|
|
@@ -440,9 +512,8 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
440
512
|
let isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
|
|
441
513
|
const isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
|
|
442
514
|
if (isStyleProp && asChildExceptStyleLike) return;
|
|
443
|
-
const shouldPassProp = !isStyleProp && isHOC ||
|
|
444
|
-
const
|
|
445
|
-
const isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in import_skipProps.skipProps));
|
|
515
|
+
const shouldPassProp = !isStyleProp && isHOC || isHOC && keyInit === "disabled" || parentVariants && keyInit in parentVariants || inlineProps?.has(keyInit);
|
|
516
|
+
const isHOCShouldPassThrough = isHOC && keyInit in import_skipProps.skipProps;
|
|
446
517
|
const shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
447
518
|
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
448
519
|
console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
|
|
@@ -466,7 +537,7 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
466
537
|
if (!isVariant) return;
|
|
467
538
|
}
|
|
468
539
|
if (shouldCheckSkipProps && !neverSkipProps?.[keyInit]) {
|
|
469
|
-
if (keyInit in import_skipProps.skipProps && !(keyInit === "transition" && typeof valInit === "string" && !
|
|
540
|
+
if (keyInit in import_skipProps.skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(0, import_transitionResolver.getTransitionResolver)()?.resolve(valInit, { animations: driverAnimations }).fused)) {
|
|
470
541
|
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
471
542
|
return;
|
|
472
543
|
}
|
|
@@ -494,7 +565,7 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
494
565
|
}
|
|
495
566
|
const isHostStyleKey = isValidStyleKeyInit || false;
|
|
496
567
|
if (isHostStyleKey || isStyledContextProp) {
|
|
497
|
-
contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey);
|
|
568
|
+
contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey || isStyledContextProp && typeof valInit === "boolean");
|
|
498
569
|
return;
|
|
499
570
|
}
|
|
500
571
|
const condition = pass[passParentCursor];
|
|
@@ -507,8 +578,8 @@ function contributeProp(pass, keyOg, valOg, originalOg = valOg, disabled = false
|
|
|
507
578
|
} 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.`);
|
|
508
579
|
return;
|
|
509
580
|
}
|
|
510
|
-
if (keyInit in import_helpers.stylePropsAll) {
|
|
511
|
-
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.`);
|
|
581
|
+
if (keyInit in import_helpers.stylePropsAll || isRemovedVendorStyleProp(keyInit)) {
|
|
582
|
+
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.`);
|
|
512
583
|
return;
|
|
513
584
|
}
|
|
514
585
|
viewProps[keyInit] = valInit;
|
|
@@ -536,7 +607,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
536
607
|
const variants = styleStaticConfig.variants;
|
|
537
608
|
const viewProps = {};
|
|
538
609
|
const mediaState = styleProps.mediaState || import_mediaState.mediaState;
|
|
539
|
-
let shouldDoClasses =
|
|
610
|
+
let shouldDoClasses = process.env.TAMAGUI_RUNTIME !== "island" && acceptsClassName && !styleProps.noClass;
|
|
540
611
|
const rulesToInsert = {};
|
|
541
612
|
const classNames = {};
|
|
542
613
|
let hasMedia = false;
|
|
@@ -592,7 +663,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
592
663
|
let frontendContainer;
|
|
593
664
|
let frontendContainerType;
|
|
594
665
|
const processedProps = props;
|
|
595
|
-
const parentVariants =
|
|
666
|
+
const parentVariants = isHOC ? staticConfig.Component?.staticConfig?.variants : void 0;
|
|
596
667
|
const defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
|
|
597
668
|
const asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
598
669
|
let containerValue;
|
|
@@ -616,7 +687,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
616
687
|
styledContextKeys,
|
|
617
688
|
(noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
|
|
618
689
|
debug,
|
|
619
|
-
parentStaticConfig,
|
|
690
|
+
process.env.NODE_ENV === "development" ? parentStaticConfig : void 0,
|
|
620
691
|
defaultProps,
|
|
621
692
|
driverAnimations,
|
|
622
693
|
driverOutputStyle,
|
|
@@ -663,6 +734,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
663
734
|
}
|
|
664
735
|
const resolvers = staticConfig.resolvers;
|
|
665
736
|
if (resolvers && !noExpand) {
|
|
737
|
+
const prevSourceLayer = pass[passSourceLayer];
|
|
666
738
|
pass[passSourceLayer] = sourceLayerResolver;
|
|
667
739
|
const flagsBefore = pass[passFlags];
|
|
668
740
|
pass[passFlags] = flagsBefore | passNoExpandFlag;
|
|
@@ -675,6 +747,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
675
747
|
}
|
|
676
748
|
}
|
|
677
749
|
pass[passFlags] = flagsBefore;
|
|
750
|
+
pass[passSourceLayer] = prevSourceLayer;
|
|
678
751
|
}
|
|
679
752
|
className = pass[passClassName];
|
|
680
753
|
shouldDoClasses = pass[passShouldDoClasses];
|
|
@@ -708,6 +781,8 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
708
781
|
if (slots) for (const [slot, entries] of slots) styleProps.stylePieceEntries[slot] = entries;
|
|
709
782
|
}
|
|
710
783
|
completeResolvedStyles(styleState);
|
|
784
|
+
if (styleState.flatGroupKeys?.size) pseudoGroups = styleState.flatGroupKeys;
|
|
785
|
+
if (styleState.flatGroupMedia?.size) mediaGroups = styleState.flatGroupMedia;
|
|
711
786
|
if (styleProps.isStatic) for (const property in classNames) {
|
|
712
787
|
const identifier = classNames[property];
|
|
713
788
|
if (rulesToInsert[identifier]) continue;
|
|
@@ -787,7 +862,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
787
862
|
const fontFamilyClassName = fontFamily ? `font_${fontFamily}` : "";
|
|
788
863
|
const group = props.group ?? frontendGroup;
|
|
789
864
|
const groupClassName = group ? `t_group_${group}` : "";
|
|
790
|
-
let finalClassName = isText ? "is_Text" : "is_View";
|
|
865
|
+
let finalClassName = staticConfig.isDOM ? "is_DOM" : isText ? "is_Text" : "is_View";
|
|
791
866
|
if (fontFamilyClassName) finalClassName += ` ${fontFamilyClassName}`;
|
|
792
867
|
let hasPropertyClassNames = false;
|
|
793
868
|
if (classNames) for (const key in classNames) {
|
|
@@ -796,7 +871,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
796
871
|
}
|
|
797
872
|
if (groupClassName) finalClassName += ` ${groupClassName}`;
|
|
798
873
|
if (className) finalClassName += ` ${className}`;
|
|
799
|
-
if (isHOC && hasPropertyClassNames) viewProps[import_skipProps.HOC_CLASSNAME_MARKER] = classNames;
|
|
874
|
+
if (isHOC && hasPropertyClassNames) viewProps[import_skipProps.HOC_CLASSNAME_MARKER] = [classNames, styleState.flatCapturedSlots];
|
|
800
875
|
if (finalClassName) viewProps.className = finalClassName;
|
|
801
876
|
if (style) viewProps.style = style;
|
|
802
877
|
}
|
|
@@ -827,7 +902,7 @@ const getSplitStyles = (props, staticConfig, theme, themeName, componentState, s
|
|
|
827
902
|
const stylePieceStaticConfig = {
|
|
828
903
|
acceptsClassName: true,
|
|
829
904
|
isText: true,
|
|
830
|
-
validStyles: import_helpers.
|
|
905
|
+
validStyles: import_helpers.stylePropsInput
|
|
831
906
|
};
|
|
832
907
|
const compiledStylePieces = /* @__PURE__ */ new WeakMap();
|
|
833
908
|
const compileStylePieceRuntime = (piece, layer) => {
|
|
@@ -904,7 +979,7 @@ function applyStylePieceClasses(styleState, piece, sourceLayer) {
|
|
|
904
979
|
for (const slot in compiled.slots) for (const entry of compiled.slots[slot]) {
|
|
905
980
|
const property = entry[0];
|
|
906
981
|
if (!ownsSourceLayer(styleState, property, !!entry[2])) continue;
|
|
907
|
-
|
|
982
|
+
writeStyleSlot(slots, slot, [...entry], sourceLayer);
|
|
908
983
|
}
|
|
909
984
|
if (compiled.programStates) {
|
|
910
985
|
const target = styleState.flatStateKeys ||= /* @__PURE__ */ new Set();
|
|
@@ -950,7 +1025,7 @@ function applyStylePieceClasses(styleState, piece, sourceLayer) {
|
|
|
950
1025
|
}
|
|
951
1026
|
return applied;
|
|
952
1027
|
}
|
|
953
|
-
function
|
|
1028
|
+
function writeStyleSlot(slots, slot, source, sourceLayer) {
|
|
954
1029
|
let list = slots.get(slot);
|
|
955
1030
|
if (!list) slots.set(slot, list = []);
|
|
956
1031
|
const flags = source[7] & 31;
|
|
@@ -959,7 +1034,10 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
959
1034
|
for (let index = 0; index < list.length; index++) {
|
|
960
1035
|
const entry = list[index];
|
|
961
1036
|
const entryFlags = entry[7] & 31;
|
|
962
|
-
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS)))
|
|
1037
|
+
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) {
|
|
1038
|
+
if (sourceLayer === sourceLayerStyle && entry[7] >> 5 === sourceLayerStyle && entry[0] === source[0] && !condition && !entry[2]) list.splice(index--, 1);
|
|
1039
|
+
continue;
|
|
1040
|
+
}
|
|
963
1041
|
if (entry[0] !== source[0]) continue;
|
|
964
1042
|
if (flags & recordDefault) {
|
|
965
1043
|
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
@@ -972,9 +1050,8 @@ function writeCapturedStyleRecord(slots, slot, source, sourceLayer) {
|
|
|
972
1050
|
break;
|
|
973
1051
|
}
|
|
974
1052
|
}
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
list.push(next);
|
|
1053
|
+
source[7] = flags | sourceLayer << 5;
|
|
1054
|
+
list.push(source);
|
|
978
1055
|
}
|
|
979
1056
|
function mergeStyle(styleState, key, val, disableNormalize = false, originalVal) {
|
|
980
1057
|
const { viewProps, styleProps, staticConfig } = styleState;
|
|
@@ -987,7 +1064,7 @@ function mergeStyle(styleState, key, val, disableNormalize = false, originalVal)
|
|
|
987
1064
|
styleState.transformAccumulator ||= (0, import_runtime.createTransformAccumulator)();
|
|
988
1065
|
(0, import_runtime.addTransformValue)(styleState.transformAccumulator, key, val);
|
|
989
1066
|
} else {
|
|
990
|
-
|
|
1067
|
+
let out = !disableNormalize && !styleProps.noNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
|
|
991
1068
|
styleState.style ||= {};
|
|
992
1069
|
styleState.style[key] = out;
|
|
993
1070
|
if (shouldTrackStyleTokenProvenance) recordStyleTokenProvenance(styleState, key, originalVal);
|
|
@@ -997,8 +1074,8 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
997
1074
|
let tokenName = typeof originalVal === "string" ? originalVal : "";
|
|
998
1075
|
if (tokenName) {
|
|
999
1076
|
const slash = tokenName.lastIndexOf("/");
|
|
1000
|
-
const opacity = slash === -1 ? NaN :
|
|
1001
|
-
if (
|
|
1077
|
+
const opacity = slash === -1 ? NaN : +tokenName.slice(slash + 1);
|
|
1078
|
+
if (opacity % 1 === 0 && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
|
|
1002
1079
|
}
|
|
1003
1080
|
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;
|
|
1004
1081
|
else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
|
|
@@ -1041,11 +1118,34 @@ const recordNormalize = 2;
|
|
|
1041
1118
|
const recordRetract = 4;
|
|
1042
1119
|
const recordDefault = 8;
|
|
1043
1120
|
const recordCSS = 16;
|
|
1121
|
+
const webRTLRenames = {
|
|
1122
|
+
marginHorizontal: "marginInline",
|
|
1123
|
+
marginVertical: "marginBlock",
|
|
1124
|
+
paddingHorizontal: "paddingInline",
|
|
1125
|
+
paddingVertical: "paddingBlock",
|
|
1126
|
+
writingDirection: "direction",
|
|
1127
|
+
paddingStart: "paddingInlineStart",
|
|
1128
|
+
paddingEnd: "paddingInlineEnd",
|
|
1129
|
+
marginStart: "marginInlineStart",
|
|
1130
|
+
marginEnd: "marginInlineEnd",
|
|
1131
|
+
borderStartWidth: "borderInlineStartWidth",
|
|
1132
|
+
borderEndWidth: "borderInlineEndWidth",
|
|
1133
|
+
borderStartColor: "borderInlineStartColor",
|
|
1134
|
+
borderEndColor: "borderInlineEndColor",
|
|
1135
|
+
borderStartStyle: "borderInlineStartStyle",
|
|
1136
|
+
borderEndStyle: "borderInlineEndStyle",
|
|
1137
|
+
borderTopStartRadius: "borderStartStartRadius",
|
|
1138
|
+
borderTopEndRadius: "borderStartEndRadius",
|
|
1139
|
+
borderBottomStartRadius: "borderEndStartRadius",
|
|
1140
|
+
borderBottomEndRadius: "borderEndEndRadius",
|
|
1141
|
+
start: "insetInlineStart",
|
|
1142
|
+
end: "insetInlineEnd"
|
|
1143
|
+
};
|
|
1044
1144
|
const webStyleProperties = /* @__PURE__ */ new Map();
|
|
1045
1145
|
function webStyleProperty(property) {
|
|
1046
1146
|
let web = webStyleProperties.get(property);
|
|
1047
1147
|
if (web === void 0) {
|
|
1048
|
-
web = property
|
|
1148
|
+
web = webRTLRenames[property] || property;
|
|
1049
1149
|
webStyleProperties.set(property, web);
|
|
1050
1150
|
}
|
|
1051
1151
|
return web;
|
|
@@ -1064,26 +1164,21 @@ function writeStyleRecord(state, property, value, cursor, original, flags, condi
|
|
|
1064
1164
|
const identity = cursor ? cursor[conditionKey] : "";
|
|
1065
1165
|
const direct = state;
|
|
1066
1166
|
const slots = direct.flatSlots ||= /* @__PURE__ */ new Map();
|
|
1067
|
-
const
|
|
1167
|
+
const sourceLayer = direct.flatPass?.[passSourceLayer] || 0;
|
|
1168
|
+
if (direct.flatInlineStyleProp) flags |= recordInline;
|
|
1169
|
+
const cssSlot = import_getCSSStylesAtomic.canGenerateCSS && (state.flatShouldDoClasses || flags & recordCSS) ? styleSlot(property) : property.startsWith("transition") ? "transition" : property;
|
|
1170
|
+
const slot = flags & recordInline && cssSlot !== property ? property : cssSlot;
|
|
1068
1171
|
let list = slots.get(slot);
|
|
1069
1172
|
if (!list) slots.set(slot, list = []);
|
|
1070
|
-
|
|
1071
|
-
const
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
1077
|
-
} else if (entryFlags & recordDefault && (!condition || entry[3] === identity)) {
|
|
1078
|
-
list.splice(index--, 1);
|
|
1079
|
-
continue;
|
|
1080
|
-
}
|
|
1081
|
-
if (entry[3] === identity) {
|
|
1082
|
-
list.splice(index, 1);
|
|
1083
|
-
break;
|
|
1173
|
+
if (sourceLayer === sourceLayerStyle && !condition) {
|
|
1174
|
+
const other = slot === cssSlot ? list : slots.get(flags & recordInline ? cssSlot : property);
|
|
1175
|
+
if (other) for (let index = 0; index < other.length; index++) {
|
|
1176
|
+
const entry = other[index];
|
|
1177
|
+
const entryFlags = entry[7];
|
|
1178
|
+
if (entry[0] === property && !entry[2] && entryFlags >> 5 === sourceLayerStyle && (entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) other.splice(index--, 1);
|
|
1084
1179
|
}
|
|
1085
1180
|
}
|
|
1086
|
-
|
|
1181
|
+
writeStyleSlot(slots, slot, [
|
|
1087
1182
|
property,
|
|
1088
1183
|
value,
|
|
1089
1184
|
condition,
|
|
@@ -1091,8 +1186,10 @@ function writeStyleRecord(state, property, value, cursor, original, flags, condi
|
|
|
1091
1186
|
cursor ? cursor[conditionSelector] : "",
|
|
1092
1187
|
cursor ? cursor[conditionWrappers] : void 0,
|
|
1093
1188
|
original,
|
|
1094
|
-
flags
|
|
1095
|
-
|
|
1189
|
+
flags,
|
|
1190
|
+
void 0,
|
|
1191
|
+
!sourceLayer && direct.flatPass?.[passVariantOutput]
|
|
1192
|
+
], sourceLayer);
|
|
1096
1193
|
}
|
|
1097
1194
|
function streamWriteInline(state, property, value, cursor, original, normalize = property === "lineHeight", conditionOverride = -1, force = false) {
|
|
1098
1195
|
writeStyleRecord(state, property, value, cursor, original, (normalize ? recordNormalize : 0) | (force ? recordInline : 0), conditionOverride);
|
|
@@ -1119,6 +1216,7 @@ function completeResolvedStyles(state, merge = mergeStyle) {
|
|
|
1119
1216
|
}
|
|
1120
1217
|
const slots = direct.flatSlots;
|
|
1121
1218
|
if (!slots) return;
|
|
1219
|
+
const capture = state.staticConfig.isHOC ? direct.flatCapturedSlots ||= /* @__PURE__ */ new Map() : void 0;
|
|
1122
1220
|
for (const [property, entries] of slots) {
|
|
1123
1221
|
let cssEntries;
|
|
1124
1222
|
let inlineWinner;
|
|
@@ -1147,7 +1245,17 @@ function completeResolvedStyles(state, merge = mergeStyle) {
|
|
|
1147
1245
|
}
|
|
1148
1246
|
}
|
|
1149
1247
|
}
|
|
1150
|
-
if (cssEntries)
|
|
1248
|
+
if (cssEntries) {
|
|
1249
|
+
(0, import_getCSSStylesAtomic.registerAtomicSlot)(direct, property, cssEntries);
|
|
1250
|
+
if (capture) {
|
|
1251
|
+
for (const entry of cssEntries) {
|
|
1252
|
+
entry[7] = entry[7] | recordCSS;
|
|
1253
|
+
if (!(entry[2] & 12)) continue;
|
|
1254
|
+
for (const sibling of cssEntries) if (sibling[0] === entry[0]) sibling[8] = true;
|
|
1255
|
+
}
|
|
1256
|
+
capture.set(property, cssEntries);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1151
1259
|
if (inlineWinner) if (inlineWinner[7] & recordRetract) {
|
|
1152
1260
|
if (state.style) delete state.style[inlineWinner[0]];
|
|
1153
1261
|
} else merge(state, inlineWinner[0], inlineWinner[1], !(inlineWinner[7] & recordNormalize), inlineWinner[6] !== void 0 ? inlineWinner[6] : inlineWinner[1]);
|
|
@@ -1172,7 +1280,7 @@ function emitUnderCondition(state, property, value, cursor, originalValue, conte
|
|
|
1172
1280
|
}
|
|
1173
1281
|
return condition;
|
|
1174
1282
|
}
|
|
1175
|
-
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 \"(\"";
|
|
1283
|
+
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 ${import_runtime.grammarMaxNonPlatformDepth} non-platform conditions` : "an unterminated \"(\"";
|
|
1176
1284
|
const warnScanFailure = (property, source, failure, failureIndex) => {
|
|
1177
1285
|
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnRefusedValue)(property, source, formatScanFailure(failure, source, failureIndex));
|
|
1178
1286
|
};
|
|
@@ -1182,15 +1290,28 @@ let valueCaches = /* @__PURE__ */ new WeakMap();
|
|
|
1182
1290
|
let valueCacheEntries = 0;
|
|
1183
1291
|
const valueCacheRoot = {};
|
|
1184
1292
|
const parsedSlices = /* @__PURE__ */ new WeakMap();
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1293
|
+
const cssWideColorKeywords = /* @__PURE__ */ new Set([
|
|
1294
|
+
"inherit",
|
|
1295
|
+
"initial",
|
|
1296
|
+
"unset",
|
|
1297
|
+
"revert",
|
|
1298
|
+
"revert-layer",
|
|
1299
|
+
"currentcolor",
|
|
1300
|
+
"transparent"
|
|
1301
|
+
]);
|
|
1302
|
+
const shadowRecipeProperties = /* @__PURE__ */ new Set([
|
|
1303
|
+
"boxShadow",
|
|
1304
|
+
"textShadow",
|
|
1305
|
+
"filter"
|
|
1306
|
+
]);
|
|
1307
|
+
function configuredValue(state, property, raw, embedded = false, nativeColors) {
|
|
1187
1308
|
const grammar = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
|
|
1188
1309
|
let name = raw;
|
|
1189
1310
|
let opacity;
|
|
1190
1311
|
const slash = raw.lastIndexOf("/");
|
|
1191
1312
|
if (slash > 0) {
|
|
1192
|
-
const amount =
|
|
1193
|
-
if (
|
|
1313
|
+
const amount = +raw.slice(slash + 1);
|
|
1314
|
+
if (amount % 1 === 0 && amount >= 0 && amount <= 100) {
|
|
1194
1315
|
name = raw.slice(0, slash);
|
|
1195
1316
|
opacity = amount;
|
|
1196
1317
|
}
|
|
@@ -1200,36 +1321,32 @@ function configuredValue(state, property, raw, embedded = false) {
|
|
|
1200
1321
|
state.flatUsesSafeArea = true;
|
|
1201
1322
|
return safeArea;
|
|
1202
1323
|
}
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
let maps = scope.get(property);
|
|
1230
|
-
if (maps === void 0) scope.set(property, maps = { direct: /* @__PURE__ */ new Map() });
|
|
1231
|
-
const byRaw = embedded ? maps.embedded ||= /* @__PURE__ */ new Map() : maps.direct;
|
|
1232
|
-
if (!fontProperty) {
|
|
1324
|
+
const fontProperty = property.startsWith("font") || property === "lineHeight" || property === "letterSpacing";
|
|
1325
|
+
const resolveValues = state.styleProps.resolveValues;
|
|
1326
|
+
let byRaw;
|
|
1327
|
+
if (!fontProperty && !nativeColors) {
|
|
1328
|
+
const revision = grammar.revision;
|
|
1329
|
+
if (state.conf !== valueCacheConf || revision !== valueCacheRevision) {
|
|
1330
|
+
valueCacheConf = state.conf;
|
|
1331
|
+
valueCacheRevision = revision;
|
|
1332
|
+
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
1333
|
+
valueCacheEntries = 0;
|
|
1334
|
+
state.flatValueScope = void 0;
|
|
1335
|
+
}
|
|
1336
|
+
const direct = state;
|
|
1337
|
+
let scope = direct.flatValueScope;
|
|
1338
|
+
if (scope === void 0) {
|
|
1339
|
+
const themeObject = state.theme && typeof state.theme === "object" ? state.theme : valueCacheRoot;
|
|
1340
|
+
let byScope = valueCaches.get(themeObject);
|
|
1341
|
+
if (!byScope) valueCaches.set(themeObject, byScope = /* @__PURE__ */ new Map());
|
|
1342
|
+
const scopeKey = `${state.flatThemeName || ""}${resolveValues}`;
|
|
1343
|
+
scope = byScope.get(scopeKey);
|
|
1344
|
+
if (!scope) byScope.set(scopeKey, scope = /* @__PURE__ */ new Map());
|
|
1345
|
+
direct.flatValueScope = scope;
|
|
1346
|
+
}
|
|
1347
|
+
let maps = scope.get(property);
|
|
1348
|
+
if (maps === void 0) scope.set(property, maps = { direct: /* @__PURE__ */ new Map() });
|
|
1349
|
+
byRaw = embedded ? maps.embedded ||= /* @__PURE__ */ new Map() : maps.direct;
|
|
1233
1350
|
const known = byRaw.get(raw);
|
|
1234
1351
|
if (known !== void 0 || byRaw.has(raw)) return known;
|
|
1235
1352
|
}
|
|
@@ -1259,20 +1376,87 @@ function configuredValue(state, property, raw, embedded = false) {
|
|
|
1259
1376
|
}
|
|
1260
1377
|
}
|
|
1261
1378
|
if (process.env.NODE_ENV === "development") {
|
|
1262
|
-
const category = grammar.tokenCategory(property);
|
|
1263
|
-
if (category && category !== "color" && state.conf.tokensParsed.color?.[name]) (0, import_warnOnce.warnOnce)(`"${name}" contributes to "color", not "${property}"`);
|
|
1379
|
+
const category = grammar.tokenCategory(property) || grammar.tokenCategory(state.conf.shorthands[property] || property);
|
|
1380
|
+
if (category && category !== "color" && category !== "boxShadow" && category !== "textShadow" && state.conf.tokensParsed.color?.[name]) (0, import_warnOnce.warnOnce)(`"${name}" contributes to "color", not "${property}"`);
|
|
1381
|
+
if (!value && !fontProperty) {
|
|
1382
|
+
if (name.charCodeAt(0) === 36 || raw.charCodeAt(0) === 36) {
|
|
1383
|
+
const suggested = name.charCodeAt(0) === 36 ? name.slice(1) : raw.slice(1);
|
|
1384
|
+
(0, import_warnOnce.warnOnce)(`v2-token:${property}=${raw}`, `${property}="${raw}": v3 tokens have no "$" prefix, did you mean "${suggested}"?`);
|
|
1385
|
+
} else if ((category === "size" || category === "space" || category === "radius" || category === "zIndex") && /^-?\d+(?:\.\d+)?$/.test(name)) {
|
|
1386
|
+
let nearest;
|
|
1387
|
+
let minDistance = Infinity;
|
|
1388
|
+
const rawNum = Number(name);
|
|
1389
|
+
const tokens = category ? state.conf.tokensParsed[category] : void 0;
|
|
1390
|
+
if (tokens && Number.isFinite(rawNum)) for (const key in tokens) {
|
|
1391
|
+
const val = tokens[key]?.val;
|
|
1392
|
+
const valNum = typeof val === "number" ? val : Number(val);
|
|
1393
|
+
if (Number.isFinite(valNum)) {
|
|
1394
|
+
const dist = Math.abs(valNum - rawNum);
|
|
1395
|
+
if (dist < minDistance) {
|
|
1396
|
+
minDistance = dist;
|
|
1397
|
+
nearest = key;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
if (nearest) (0, import_warnOnce.warnOnce)(`numeric-token:${property}=${raw}`, `${property}="${raw}" was passed to CSS as-is${category === "zIndex" ? "" : " with px units"}${nearest ? `; nearest token is "${nearest}"` : ""}`);
|
|
1402
|
+
} else if (category === "color" && /^[a-zA-Z0-9-]+$/.test(name) && /[a-zA-Z]/.test(name)) {
|
|
1403
|
+
const lower = name.toLowerCase();
|
|
1404
|
+
if (!import_runtime.namedCssColors.has(lower) && !cssWideColorKeywords.has(lower)) {
|
|
1405
|
+
const themeKeys = [];
|
|
1406
|
+
if (state.theme && typeof state.theme === "object") for (const k in state.theme) themeKeys.push(k);
|
|
1407
|
+
if (state.conf.themes) {
|
|
1408
|
+
const active = state.conf.themes[state.flatThemeName || ""];
|
|
1409
|
+
if (active) for (const k in active) themeKeys.push(k);
|
|
1410
|
+
else for (const t in state.conf.themes) for (const k in state.conf.themes[t]) themeKeys.push(k);
|
|
1411
|
+
}
|
|
1412
|
+
let bestMatch;
|
|
1413
|
+
let minDistance = 3;
|
|
1414
|
+
for (const key of themeKeys) {
|
|
1415
|
+
if (Math.abs(key.length - name.length) > 2) continue;
|
|
1416
|
+
const m = name.length;
|
|
1417
|
+
const n = key.length;
|
|
1418
|
+
const d = [];
|
|
1419
|
+
for (let i = 0; i <= m; i++) d[i] = i;
|
|
1420
|
+
for (let j = 1; j <= n; j++) {
|
|
1421
|
+
let prev = d[0];
|
|
1422
|
+
d[0] = j;
|
|
1423
|
+
for (let i = 1; i <= m; i++) {
|
|
1424
|
+
const temp = d[i];
|
|
1425
|
+
d[i] = name[i - 1] === key[j - 1] ? prev : Math.min(prev, d[i], d[i - 1]) + 1;
|
|
1426
|
+
prev = temp;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
const dist = d[m];
|
|
1430
|
+
if (dist <= 2 && dist < minDistance) {
|
|
1431
|
+
minDistance = dist;
|
|
1432
|
+
bestMatch = key;
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
(0, import_warnOnce.warnOnce)(`unknown-color:${property}=${raw}`, bestMatch ? `unknown color "${name}", did you mean "${bestMatch}"?` : `unknown color "${name}"`);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1264
1439
|
}
|
|
1265
1440
|
let out = raw;
|
|
1266
1441
|
if ((0, import_createVariable.isVariable)(value)) {
|
|
1267
|
-
out = resolveValues === "except-theme" && fromTheme ? `${import_themeRef.THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : (0, import_resolveVariableValue.resolveVariableValue)(property, value, resolveValues);
|
|
1442
|
+
out = resolveValues === "except-theme" && fromTheme ? `${import_themeRef.THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : (0, import_resolveVariableValue.resolveVariableValue)(nativeColors ? "color" : property, value, resolveValues);
|
|
1268
1443
|
if (opacity !== void 0) out = `color-mix(in srgb, ${out} ${opacity}%, transparent)`;
|
|
1269
1444
|
}
|
|
1445
|
+
if (nativeColors && out && typeof out === "object") {
|
|
1446
|
+
const reference = `__tamagui_native_color_${nativeColors.size}`;
|
|
1447
|
+
nativeColors.set(reference, out);
|
|
1448
|
+
out = reference;
|
|
1449
|
+
}
|
|
1270
1450
|
if (embedded && out === raw) {
|
|
1271
1451
|
const usedSafeArea = state.flatUsesSafeArea;
|
|
1272
|
-
out = grammar.embeddedTokens(raw, (word) =>
|
|
1452
|
+
out = grammar.embeddedTokens(raw, (word) => {
|
|
1453
|
+
const resolved = configuredValue(state, property, word, false, nativeColors);
|
|
1454
|
+
if (resolved !== word || !shadowRecipeProperties.has(property) || !/^[a-z][\w-]*$/i.test(word)) return resolved;
|
|
1455
|
+
return configuredValue(state, "color", word, false, nativeColors);
|
|
1456
|
+
});
|
|
1273
1457
|
if (!usedSafeArea && state.flatUsesSafeArea) return out;
|
|
1274
1458
|
}
|
|
1275
|
-
if (!fontProperty && !fromTheme) if (valueCacheEntries > 8192) {
|
|
1459
|
+
if (!fontProperty && !fromTheme && !nativeColors) if (valueCacheEntries > 8192) {
|
|
1276
1460
|
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
1277
1461
|
valueCacheEntries = 0;
|
|
1278
1462
|
} else {
|
|
@@ -1286,13 +1470,15 @@ function ownsSourceLayer(state, property, conditional = false) {
|
|
|
1286
1470
|
const layer = direct.flatPass?.[passSourceLayer] || 0;
|
|
1287
1471
|
const layers = direct.flatPropertyLayers ||= /* @__PURE__ */ new Map();
|
|
1288
1472
|
const previous = layers.get(property);
|
|
1289
|
-
if (
|
|
1290
|
-
|
|
1291
|
-
if (
|
|
1292
|
-
if (
|
|
1293
|
-
clearDirectStyle(state, property);
|
|
1473
|
+
if (!layer && !conditional && !direct.flatPass?.[passVariantOutput]) {
|
|
1474
|
+
const entries = direct.flatSlots?.get(styleSlot(property));
|
|
1475
|
+
if (entries) {
|
|
1476
|
+
for (let index = entries.length; index--;) if (entries[index][0] === property && entries[index][9]) entries.splice(index, 1);
|
|
1294
1477
|
}
|
|
1295
|
-
}
|
|
1478
|
+
}
|
|
1479
|
+
if (previous > layer) return false;
|
|
1480
|
+
if (conditional && previous !== layer) return true;
|
|
1481
|
+
if (previous < layer) clearDirectStyle(state, property);
|
|
1296
1482
|
layers.set(property, layer);
|
|
1297
1483
|
return true;
|
|
1298
1484
|
}
|
|
@@ -1319,6 +1505,10 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
|
|
|
1319
1505
|
(0, import_runtime.addTransformValue)(state.transformAccumulator, property, value);
|
|
1320
1506
|
return;
|
|
1321
1507
|
}
|
|
1508
|
+
if (property === "transition" && condition & 12 && !state.staticConfig.isHOC && state.styleProps.isAnimated) {
|
|
1509
|
+
streamWriteInline(state, property, value, cursor, originalValue, false, -1, true);
|
|
1510
|
+
return;
|
|
1511
|
+
}
|
|
1322
1512
|
const shouldPromoteAnimatedStyle = import_getCSSStylesAtomic.canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && state.animationDriver?.inputStyle === "css" && property in import_helpers.nonAnimatableStyleProps;
|
|
1323
1513
|
if (import_getCSSStylesAtomic.canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
1324
1514
|
writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
|
|
@@ -1327,19 +1517,19 @@ function emitProperty(state, property, value, cursor, originalValue, contextOnly
|
|
|
1327
1517
|
streamWriteInline(state, property, value, cursor, originalValue);
|
|
1328
1518
|
}
|
|
1329
1519
|
function numericUnitValue(value, first, second) {
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1520
|
+
return value.length > first.length && (value.endsWith(first) || value.endsWith(second)) ? +value.slice(0, -first.length) : NaN;
|
|
1521
|
+
}
|
|
1522
|
+
function resolveNumericValue(value) {
|
|
1523
|
+
let numeric = numericUnitValue(value, "px", "dp");
|
|
1524
|
+
return isFinite(numeric) ? numeric : isFinite(numeric = +value) ? numeric : value;
|
|
1334
1525
|
}
|
|
1335
1526
|
function emitResolved(state, property, raw, cursor, originalValue, contextOnly) {
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
emitProperty(state, property, value, cursor, originalValue, contextOnly);
|
|
1527
|
+
emitProperty(state, property, resolveValue(state, property, raw), cursor, originalValue, contextOnly);
|
|
1528
|
+
}
|
|
1529
|
+
function resolveValue(state, property, raw, nativeColors) {
|
|
1530
|
+
let value = typeof raw === "string" ? configuredValue(state, property, raw, true, nativeColors) : raw;
|
|
1531
|
+
if (!state.flatShouldDoClasses && typeof value === "string" && value !== "" && property !== "lineHeight") value = resolveNumericValue(value);
|
|
1532
|
+
return value;
|
|
1343
1533
|
}
|
|
1344
1534
|
function shadowUnit(part) {
|
|
1345
1535
|
return typeof part === "number" ? `${part}px` : part || "0px";
|
|
@@ -1359,7 +1549,13 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1359
1549
|
const grammar = (0, import_grammarConfig.getConfigRevisionState)(state.conf);
|
|
1360
1550
|
property = webStyleProperty(property);
|
|
1361
1551
|
if (property === "backdropFilter") emitValue(state, "WebkitBackdropFilter", raw, cursor, originalValue, contextOnly);
|
|
1362
|
-
if ((0, import_createVariable.isVariable)(raw))
|
|
1552
|
+
if ((0, import_createVariable.isVariable)(raw)) {
|
|
1553
|
+
raw = (0, import_resolveVariableValue.resolveVariableValue)(property, raw, state.styleProps.resolveValues);
|
|
1554
|
+
if (property === "lineHeight") {
|
|
1555
|
+
emitProperty(state, property, raw, cursor, originalValue, contextOnly);
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1363
1559
|
if (typeof raw === "string" && (property === "transition" || property === "transitionProperty")) raw = grammar.normalizeTransition(raw);
|
|
1364
1560
|
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);
|
|
1365
1561
|
const propertyKind = grammar.propertyKind(property);
|
|
@@ -1396,10 +1592,17 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1396
1592
|
}
|
|
1397
1593
|
if (property === "transform") {
|
|
1398
1594
|
if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = (0, import_transformsToString.transformsToString)(raw);
|
|
1595
|
+
if (typeof raw === "string" && !state.flatShouldDoClasses && state.animationDriver?.inputStyle === "value") {
|
|
1596
|
+
const transform = (0, import_parseNativeTransform.parseNativeTransform)(raw);
|
|
1597
|
+
if (transform) {
|
|
1598
|
+
emitProperty(state, property, transform, cursor, originalValue, contextOnly);
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1399
1602
|
}
|
|
1400
1603
|
if (typeof raw === "string" && property === "background") {
|
|
1401
1604
|
const parts = (0, import_borderComponents.splitComponents)(raw);
|
|
1402
|
-
if (parts.length === 1 && !(0, import_borderComponents.startsValueFunction)(parts[0])) {
|
|
1605
|
+
if (parts.length === 1 && (!(0, import_borderComponents.startsValueFunction)(parts[0]) || false)) {
|
|
1403
1606
|
emitResolved(state, "backgroundColor", parts[0], cursor, originalValue, contextOnly);
|
|
1404
1607
|
return;
|
|
1405
1608
|
}
|
|
@@ -1407,7 +1610,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1407
1610
|
if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
|
|
1408
1611
|
let value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
1409
1612
|
if (!state.flatShouldDoClasses && typeof value2 === "string" && !value2.startsWith(import_themeRef.THEME_REF_PREFIX)) {
|
|
1410
|
-
if (property === "rotate" && !
|
|
1613
|
+
if (property === "rotate" && !isFinite(numericUnitValue(value2, "deg", "rad")) && !(0, import_borderComponents.startsValueFunction)(value2)) {
|
|
1411
1614
|
if (process.env.NODE_ENV === "development") (0, import_warnOnce.warnOnce)(`native transform "${property}" cannot represent "${value2}"; dropping it`);
|
|
1412
1615
|
if (condition & 1) {
|
|
1413
1616
|
(0, import_runtime.removeTransformValue)(state.transformAccumulator, property);
|
|
@@ -1415,9 +1618,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1415
1618
|
}
|
|
1416
1619
|
return;
|
|
1417
1620
|
}
|
|
1418
|
-
|
|
1419
|
-
if (Number.isFinite(unitValue)) value2 = unitValue;
|
|
1420
|
-
else if (Number.isFinite(Number(value2))) value2 = Number(value2);
|
|
1621
|
+
value2 = resolveNumericValue(value2);
|
|
1421
1622
|
}
|
|
1422
1623
|
if (!import_getCSSStylesAtomic.canGenerateCSS || !state.flatShouldDoClasses) {
|
|
1423
1624
|
emitProperty(state, property, value2, cursor, originalValue, contextOnly);
|
|
@@ -1441,13 +1642,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1441
1642
|
else emitProperty(state, property, raw, cursor, originalValue, contextOnly);
|
|
1442
1643
|
return;
|
|
1443
1644
|
}
|
|
1444
|
-
let value = raw;
|
|
1445
|
-
if (typeof raw === "string") value = configuredValue(state, property, raw, true);
|
|
1446
|
-
if (!state.flatShouldDoClasses && typeof value === "string") {
|
|
1447
|
-
const unitValue = numericUnitValue(value, "px", "dp");
|
|
1448
|
-
if (Number.isFinite(unitValue)) value = unitValue;
|
|
1449
|
-
else if (value !== "" && Number.isFinite(Number(value))) value = Number(value);
|
|
1450
|
-
}
|
|
1645
|
+
let value = resolveValue(state, property, raw, void 0);
|
|
1451
1646
|
if (import_getCSSStylesAtomic.canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
|
|
1452
1647
|
state.flatBoxShadow = value;
|
|
1453
1648
|
state.flatBoxShadowSequence = frameSequence + 1;
|
|
@@ -1458,7 +1653,12 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
|
1458
1653
|
}
|
|
1459
1654
|
emitProperty(state, property, value, cursor, originalValue, contextOnly);
|
|
1460
1655
|
}
|
|
1461
|
-
function
|
|
1656
|
+
function emitConditionalValue(state, property, payload, condition, source, sink, mode, contextOnly) {
|
|
1657
|
+
if (sink) sink(payload, condition, source);
|
|
1658
|
+
else if (condition) emitUnderCondition(state, property, payload, condition, mode === 2 || state.staticConfig.isHOC || state.styleProps.stylePieceEntries ? payload : void 0, contextOnly, mode, source);
|
|
1659
|
+
else emitValue(state, property, payload, null, payload, contextOnly);
|
|
1660
|
+
}
|
|
1661
|
+
function walkConditionalValue(state, property, value, parent, sink, warnMode = 0, contextOnly = false) {
|
|
1462
1662
|
const parentCondition = parent || null;
|
|
1463
1663
|
let hasBase = false;
|
|
1464
1664
|
let conditions = 0;
|
|
@@ -1466,13 +1666,18 @@ function walkConditionalValue(state, property, value, parent, sink, warnMode = 0
|
|
|
1466
1666
|
if (typeof value === "string") {
|
|
1467
1667
|
const parsed = (0, import_grammarConfig.getConfigRevisionState)(state.conf).parseFlatValue(value);
|
|
1468
1668
|
const [segments, failure, failureIndex] = parsed;
|
|
1669
|
+
if (process.env.NODE_ENV === "development") {
|
|
1670
|
+
if ((0, import_config.getSetting)("styleValueSyntax") === "object") {
|
|
1671
|
+
if (segments.length > 5 || segments.length >= 5 && segments[2] !== -1 || value.includes(":")) (0, import_warnOnce.warnOnce)(`syntax:string:${property}=${value}`, `string syntax is disabled by config (styleValueSyntax: 'object'); received "${property}=${value}"`);
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1469
1674
|
let slices = parsedSlices.get(parsed);
|
|
1470
1675
|
if (slices === void 0) parsedSlices.set(parsed, slices = []);
|
|
1471
1676
|
const chainCount = segments.length / 5 - 1;
|
|
1472
1677
|
if (property === "aspectRatio" && chainCount === 1) {
|
|
1473
|
-
const left =
|
|
1474
|
-
const right =
|
|
1475
|
-
if (left > 0 && right > 0 &&
|
|
1678
|
+
const left = +value.slice(segments[7], segments[8]);
|
|
1679
|
+
const right = +value.slice(segments[5], segments[6]);
|
|
1680
|
+
if (left > 0 && right > 0 && isFinite(left) && isFinite(right)) return false;
|
|
1476
1681
|
}
|
|
1477
1682
|
for (let index = 0; index < segments.length; index += 5) {
|
|
1478
1683
|
const start = segments[index];
|
|
@@ -1482,10 +1687,10 @@ function walkConditionalValue(state, property, value, parent, sink, warnMode = 0
|
|
|
1482
1687
|
if (start === end) continue;
|
|
1483
1688
|
if (flags & 2) {
|
|
1484
1689
|
const payload = slices[index] ??= value.slice(start, end);
|
|
1485
|
-
|
|
1690
|
+
emitConditionalValue(state, property, payload, parentCondition, payload, sink, warnMode, contextOnly);
|
|
1486
1691
|
hasBase = true;
|
|
1487
1692
|
} else if (process.env.NODE_ENV !== "production" && warnMode && !chainCount && (failure === "invalid-character" || failure === "stray-comment-close")) {
|
|
1488
|
-
|
|
1693
|
+
emitConditionalValue(state, property, value, parentCondition, value, sink, warnMode, contextOnly);
|
|
1489
1694
|
hasBase = true;
|
|
1490
1695
|
} else if (warnMode) warnScanFailure(property, value, failure, failureIndex);
|
|
1491
1696
|
}
|
|
@@ -1506,30 +1711,36 @@ function walkConditionalValue(state, property, value, parent, sink, warnMode = 0
|
|
|
1506
1711
|
}
|
|
1507
1712
|
const cursor = conditionFromKey(state, slices[index + 2] ??= value.slice(segments[index + 2], segments[index + 3]), parentCondition);
|
|
1508
1713
|
conditions |= cursor[conditionValue];
|
|
1509
|
-
if (cursor[conditionValue] & conditionResolvedFlag || warnMode)
|
|
1714
|
+
if (cursor[conditionValue] & conditionResolvedFlag || warnMode) emitConditionalValue(state, property, slices[index] ??= value.slice(start, end), cursor, value, sink, warnMode, contextOnly);
|
|
1510
1715
|
}
|
|
1511
1716
|
if (process.env.NODE_ENV !== "production") lastPayload = value.slice(lastPayloadStart);
|
|
1512
1717
|
} else {
|
|
1513
1718
|
if (!value || typeof value !== "object" || Array.isArray(value) || (0, import_createVariable.isVariable)(value) || !classifyConditionalObject(value, state)) return false;
|
|
1719
|
+
if (process.env.NODE_ENV === "development") {
|
|
1720
|
+
if ((0, import_config.getSetting)("styleValueSyntax") === "string") (0, import_warnOnce.warnOnce)(`syntax:object:${property}=${JSON.stringify(value)}`, `object-form conditional syntax is disabled by config (styleValueSyntax: 'string'); received "${property}"`);
|
|
1721
|
+
}
|
|
1514
1722
|
if (value.default != null) {
|
|
1515
|
-
|
|
1723
|
+
emitConditionalValue(state, property, value.default, parentCondition, value.default, sink, warnMode, contextOnly);
|
|
1516
1724
|
hasBase = true;
|
|
1517
1725
|
}
|
|
1518
1726
|
for (const key in value) {
|
|
1519
1727
|
if (key === "default" || value[key] == null) continue;
|
|
1520
1728
|
const cursor = conditionFromKey(state, key, parentCondition);
|
|
1521
1729
|
conditions |= cursor[conditionValue];
|
|
1522
|
-
if (cursor[conditionValue] & conditionResolvedFlag || warnMode)
|
|
1730
|
+
if (cursor[conditionValue] & conditionResolvedFlag || warnMode) emitConditionalValue(state, property, value[key], cursor, value[key], sink, warnMode, contextOnly);
|
|
1523
1731
|
}
|
|
1524
1732
|
}
|
|
1525
|
-
if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && (0, import_grammarConfig.getConfigRevisionState)(state.conf).tokenCategory(property) && (0, import_borderComponents.splitComponents)(lastPayload).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1526
|
-
if (warnMode === 1 &&
|
|
1733
|
+
if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && (0, import_grammarConfig.getConfigRevisionState)(state.conf).tokenCategory(property) && (0, import_grammarConfig.getConfigRevisionState)(state.conf).propertyKind(property) !== 8 && property !== "boxShadow" && property !== "textShadow" && property !== "fontFamily" && property !== "gap" && (0, import_borderComponents.splitComponents)(lastPayload).length > 1) (0, import_warnOnce.warnOnce)(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1734
|
+
if (warnMode === 1 && conditions & 12 && !hasBase) {
|
|
1527
1735
|
const resting = property === "opacity" || property.startsWith("scale") ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
|
|
1528
|
-
|
|
1736
|
+
const layers = state.flatPropertyLayers;
|
|
1737
|
+
const owned = !import_getCSSStylesAtomic.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);
|
|
1738
|
+
if (resting !== null && !owned) emitConditionalValue(state, property, resting, parentCondition, resting, sink, warnMode, contextOnly);
|
|
1529
1739
|
}
|
|
1530
1740
|
return true;
|
|
1531
1741
|
}
|
|
1532
1742
|
function contributeValue(state, property, value, originalValue, contextOnly = false, condition) {
|
|
1743
|
+
if (!contextOnly && isRemovedVendorStyleProp(property) && !(state.staticConfig.validStyles && property in state.staticConfig.validStyles)) return;
|
|
1533
1744
|
if (condition !== void 0) {
|
|
1534
1745
|
const parent2 = state.flatPass?.[passParentCursor] || null;
|
|
1535
1746
|
let effective;
|
|
@@ -1539,7 +1750,7 @@ function contributeValue(state, property, value, originalValue, contextOnly = fa
|
|
|
1539
1750
|
if (!(condition[conditionValue] & conditionResolvedFlag)) setConditionUnresolved(effective);
|
|
1540
1751
|
commitCondition(effective);
|
|
1541
1752
|
} else effective = condition;
|
|
1542
|
-
if (typeof value !== "string" && walkConditionalValue(state, property, value, effective,
|
|
1753
|
+
if (typeof value !== "string" && walkConditionalValue(state, property, value, effective, null, 2, contextOnly)) return true;
|
|
1543
1754
|
emitUnderCondition(state, property, value, effective, originalValue, contextOnly, 2, value);
|
|
1544
1755
|
return true;
|
|
1545
1756
|
}
|
|
@@ -1556,7 +1767,7 @@ function contributeValue(state, property, value, originalValue, contextOnly = fa
|
|
|
1556
1767
|
return true;
|
|
1557
1768
|
}
|
|
1558
1769
|
}
|
|
1559
|
-
if (walkConditionalValue(state, property, value, state.flatPass?.[passParentCursor] || null,
|
|
1770
|
+
if (walkConditionalValue(state, property, value, state.flatPass?.[passParentCursor] || null, null, 1, contextOnly)) return true;
|
|
1560
1771
|
if (value != null) {
|
|
1561
1772
|
emitAtParentCondition(state, property, value, originalValue ?? value, contextOnly);
|
|
1562
1773
|
return true;
|
|
@@ -1565,19 +1776,21 @@ function contributeValue(state, property, value, originalValue, contextOnly = fa
|
|
|
1565
1776
|
}
|
|
1566
1777
|
function clearDirectStyle(state, property) {
|
|
1567
1778
|
const direct = state;
|
|
1779
|
+
if (direct.flatDynamicColors) delete direct.flatDynamicColors[property];
|
|
1568
1780
|
property = webStyleProperty(property);
|
|
1569
1781
|
const propertyKind = (0, import_grammarConfig.getConfigRevisionState)(state.conf).propertyKind(property);
|
|
1570
1782
|
const atomicKey = property.startsWith("transition") ? "transition" : propertyKind > 0 && propertyKind < 5 ? "boxShadow" : propertyKind === 6 ? "textShadow" : propertyKind === 5 ? "transform" : property;
|
|
1571
1783
|
const slot = styleSlot(atomicKey);
|
|
1572
1784
|
direct.flatAtomics?.delete(slot);
|
|
1573
1785
|
if (direct.flatSlots) {
|
|
1574
|
-
if (slot !== atomicKey) {
|
|
1786
|
+
if (slot !== atomicKey || atomicKey === "flex") {
|
|
1575
1787
|
const entries = direct.flatSlots.get(slot);
|
|
1576
1788
|
if (entries) {
|
|
1577
1789
|
for (let index = entries.length; index--;) if (entries[index][0] === atomicKey) entries.splice(index, 1);
|
|
1790
|
+
if (!entries.length) direct.flatSlots.delete(slot);
|
|
1578
1791
|
}
|
|
1579
1792
|
}
|
|
1580
|
-
direct.flatSlots.delete(atomicKey);
|
|
1793
|
+
if (atomicKey !== "flex") direct.flatSlots.delete(atomicKey);
|
|
1581
1794
|
}
|
|
1582
1795
|
if (atomicKey === "transform") state.transformAccumulator = void 0;
|
|
1583
1796
|
if (state.style) delete state.style[atomicKey];
|
|
@@ -1589,9 +1802,12 @@ function emitVariantStyle(state, key, value, original, condition, disabled) {
|
|
|
1589
1802
|
if (key !== pass[passMapSourceKey] && state.flatCallerVariantKeys?.has(key)) return;
|
|
1590
1803
|
if (state.flatStyleStaticConfig.styledContextKeys?.has(key)) (state.overriddenContextProps ||= {})[key] = (state.originalContextPropValues ||= {})[key] = original;
|
|
1591
1804
|
const parent = pass[passParentCursor];
|
|
1805
|
+
const parentVariantOutput = pass[passVariantOutput];
|
|
1592
1806
|
pass[passParentCursor] = condition;
|
|
1807
|
+
pass[passVariantOutput] = true;
|
|
1593
1808
|
contributeProp(pass, key, value, original, disabled);
|
|
1594
1809
|
pass[passParentCursor] = parent;
|
|
1810
|
+
pass[passVariantOutput] = parentVariantOutput;
|
|
1595
1811
|
}
|
|
1596
1812
|
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
1597
1813
|
if ((0, import_createVariable.isVariable)(input)) {
|