@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
|
@@ -44,6 +44,7 @@ const _withNativeStyle = (Component, baseStyle, themeStyleKeys) => {
|
|
|
44
44
|
const Native = import_react.default.memo(function NativeStyleView({ _scopeId, ...props }) {
|
|
45
45
|
const { ref, _expressions: _ignoredExpressions, ...rest } = props;
|
|
46
46
|
const link = (0, import_react.useRef)(null);
|
|
47
|
+
const [refused, setRefused] = (0, import_react.useState)(false);
|
|
47
48
|
const themeState = (0, import_useThemeState.getThemeState)(_scopeId);
|
|
48
49
|
const stateName = themeState?.name;
|
|
49
50
|
const theme = themeState?.theme;
|
|
@@ -53,6 +54,7 @@ const _withNativeStyle = (Component, baseStyle, themeStyleKeys) => {
|
|
|
53
54
|
(0, import_compose_refs.setRef)(ref, host);
|
|
54
55
|
if (host && stateName && theme) {
|
|
55
56
|
link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
|
|
57
|
+
if (!link.current) setRefused(true);
|
|
56
58
|
}
|
|
57
59
|
}, [
|
|
58
60
|
ref,
|
|
@@ -60,6 +62,7 @@ const _withNativeStyle = (Component, baseStyle, themeStyleKeys) => {
|
|
|
60
62
|
stateName,
|
|
61
63
|
theme
|
|
62
64
|
]);
|
|
65
|
+
if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
|
|
63
66
|
const stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;
|
|
64
67
|
if (process.env.NODE_ENV === "development" && (!stateName || !theme)) {
|
|
65
68
|
throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);
|
|
@@ -48,6 +48,7 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
|
|
|
48
48
|
var { _scopeId, ...props } = param;
|
|
49
49
|
var { ref, _expressions: _ignoredExpressions, ...rest } = props;
|
|
50
50
|
var link = (0, import_react.useRef)(null);
|
|
51
|
+
var [refused, setRefused] = (0, import_react.useState)(false);
|
|
51
52
|
var themeState = (0, import_useThemeState.getThemeState)(_scopeId);
|
|
52
53
|
var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;
|
|
53
54
|
var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;
|
|
@@ -58,6 +59,7 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
|
|
|
58
59
|
(0, import_compose_refs.setRef)(ref, host);
|
|
59
60
|
if (host && stateName && theme) {
|
|
60
61
|
link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
|
|
62
|
+
if (!link.current) setRefused(true);
|
|
61
63
|
}
|
|
62
64
|
}, [
|
|
63
65
|
ref,
|
|
@@ -65,6 +67,7 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
|
|
|
65
67
|
stateName,
|
|
66
68
|
theme
|
|
67
69
|
]);
|
|
70
|
+
if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
|
|
68
71
|
var stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;
|
|
69
72
|
if (process.env.NODE_ENV === "development" && (!stateName || !theme)) {
|
|
70
73
|
throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);
|
|
@@ -48,6 +48,7 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
|
|
|
48
48
|
var { _scopeId, ...props } = param;
|
|
49
49
|
var { ref, _expressions: _ignoredExpressions, ...rest } = props;
|
|
50
50
|
var link = (0, import_react.useRef)(null);
|
|
51
|
+
var [refused, setRefused] = (0, import_react.useState)(false);
|
|
51
52
|
var themeState = (0, import_useThemeState.getThemeState)(_scopeId);
|
|
52
53
|
var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;
|
|
53
54
|
var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;
|
|
@@ -58,6 +59,7 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
|
|
|
58
59
|
(0, import_compose_refs.setRef)(ref, host);
|
|
59
60
|
if (host && stateName && theme) {
|
|
60
61
|
link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);
|
|
62
|
+
if (!link.current) setRefused(true);
|
|
61
63
|
}
|
|
62
64
|
}, [
|
|
63
65
|
ref,
|
|
@@ -65,6 +67,7 @@ var _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {
|
|
|
65
67
|
stateName,
|
|
66
68
|
theme
|
|
67
69
|
]);
|
|
70
|
+
if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, { ...props });
|
|
68
71
|
var stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;
|
|
69
72
|
if (process.env.NODE_ENV === "development" && (!stateName || !theme)) {
|
|
70
73
|
throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_withNativeStyle.native.js","names":[],"sources":["cjs/_withNativeStyle.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withNativeStyle_exports = {};\n__export(withNativeStyle_exports, {\n _withNativeStyle: () => _withNativeStyle\n});\nmodule.exports = __toCommonJS(withNativeStyle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_withStableStyle = require(\"./_withStableStyle\");\nvar import_nativeStyleEngine = require(\"./helpers/nativeStyleEngine\");\nvar import_useThemeState = require(\"./hooks/useThemeState\");\nvar _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {\n var Fallback = (0, import_withStableStyle._withStableStyle)(Component, function(theme) {\n var themedStyle = {};\n for (var styleKey in themeStyleKeys) {\n var _theme_themeStyleKeys_styleKey;\n themedStyle[styleKey] = (_theme_themeStyleKeys_styleKey = theme[themeStyleKeys[styleKey]]) === null || _theme_themeStyleKeys_styleKey === void 0 ? void 0 : _theme_themeStyleKeys_styleKey.get();\n }\n return [\n baseStyle,\n themedStyle\n ];\n }, true, false);\n var Native = /* @__PURE__ */ import_react.default.memo(function NativeStyleView(param) {\n var { _scopeId, ...props } = param;\n var { ref, _expressions: _ignoredExpressions, ...rest } = props;\n var link = (0, import_react.useRef)(null);\n var themeState = (0, import_useThemeState.getThemeState)(_scopeId);\n var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;\n var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;\n var hostRef = (0, import_react.useCallback)(function(host) {\n var _link_current;\n (_link_current = link.current) === null || _link_current === void 0 ? void 0 : _link_current.unlink();\n link.current = null;\n (0, import_compose_refs.setRef)(ref, host);\n if (host && stateName && theme) {\n link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);\n }\n }, [\n ref,\n _scopeId,\n stateName,\n theme\n ]);\n var stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;\n if (process.env.NODE_ENV === \"development\" && (!stateName || !theme)) {\n throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {\n ref: hostRef,\n style: [\n baseStyle,\n stateStyle\n ],\n ...rest\n });\n });\n return /* @__PURE__ */ import_react.default.memo(function NativeStyleBoundary(props) {\n var scopeId = (0, import_react.useContext)(import_useThemeState.ThemeStateContext);\n return (0, import_nativeStyleEngine.getNativeStyleEngine)() && scopeId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Native, {\n ...props,\n _scopeId: scopeId\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {\n ...props\n });\n });\n};\n//# sourceMappingURL=_withNativeStyle.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,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IAAI,WAAW;EACnF,IAAI,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW;EAC/E,IAAI,WAAW,GAAG,aAAa,YAAW,CAAE,SAAS,MAAM;GACzD,IAAI;GACJ,CAAC,gBAAgB,KAAK,aAAa,QAAQ,kBAAkB,KAAK,IAAI,KAAK,IAAI,cAAc,OAAO;GACpG,KAAK,UAAU;GACf,CAAC,GAAG,oBAAoB,OAAM,CAAE,KAAK,IAAI;GACzC,IAAI,QAAQ,aAAa,OAAO;IAC9B,KAAK,WAAW,GAAG,yBAAyB,uBAAsB,CAAE,MAAM,WAAW,gBAAgB,UAAU,WAAW,KAAK;
|
|
1
|
+
{"version":3,"file":"_withNativeStyle.native.js","names":[],"sources":["cjs/_withNativeStyle.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withNativeStyle_exports = {};\n__export(withNativeStyle_exports, {\n _withNativeStyle: () => _withNativeStyle\n});\nmodule.exports = __toCommonJS(withNativeStyle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_compose_refs = require(\"@tamagui/compose-refs\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_withStableStyle = require(\"./_withStableStyle\");\nvar import_nativeStyleEngine = require(\"./helpers/nativeStyleEngine\");\nvar import_useThemeState = require(\"./hooks/useThemeState\");\nvar _withNativeStyle = function(Component, baseStyle, themeStyleKeys) {\n var Fallback = (0, import_withStableStyle._withStableStyle)(Component, function(theme) {\n var themedStyle = {};\n for (var styleKey in themeStyleKeys) {\n var _theme_themeStyleKeys_styleKey;\n themedStyle[styleKey] = (_theme_themeStyleKeys_styleKey = theme[themeStyleKeys[styleKey]]) === null || _theme_themeStyleKeys_styleKey === void 0 ? void 0 : _theme_themeStyleKeys_styleKey.get();\n }\n return [\n baseStyle,\n themedStyle\n ];\n }, true, false);\n var Native = /* @__PURE__ */ import_react.default.memo(function NativeStyleView(param) {\n var { _scopeId, ...props } = param;\n var { ref, _expressions: _ignoredExpressions, ...rest } = props;\n var link = (0, import_react.useRef)(null);\n var [refused, setRefused] = (0, import_react.useState)(false);\n var themeState = (0, import_useThemeState.getThemeState)(_scopeId);\n var stateName = themeState === null || themeState === void 0 ? void 0 : themeState.name;\n var theme = themeState === null || themeState === void 0 ? void 0 : themeState.theme;\n var hostRef = (0, import_react.useCallback)(function(host) {\n var _link_current;\n (_link_current = link.current) === null || _link_current === void 0 ? void 0 : _link_current.unlink();\n link.current = null;\n (0, import_compose_refs.setRef)(ref, host);\n if (host && stateName && theme) {\n link.current = (0, import_nativeStyleEngine.linkNativeStyleMapping)(host, baseStyle, themeStyleKeys, _scopeId, stateName, theme);\n if (!link.current) setRefused(true);\n }\n }, [\n ref,\n _scopeId,\n stateName,\n theme\n ]);\n if (refused) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {\n ...props\n });\n var stateStyle = stateName && theme ? (0, import_nativeStyleEngine.resolveNativeStyleMapping)(themeStyleKeys, stateName, theme) : void 0;\n if (process.env.NODE_ENV === \"development\" && (!stateName || !theme)) {\n throw new Error(`[@tamagui/core] native fast path cannot resolve theme ${JSON.stringify(stateName)}`);\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {\n ref: hostRef,\n style: [\n baseStyle,\n stateStyle\n ],\n ...rest\n });\n });\n return /* @__PURE__ */ import_react.default.memo(function NativeStyleBoundary(props) {\n var scopeId = (0, import_react.useContext)(import_useThemeState.ThemeStateContext);\n return (0, import_nativeStyleEngine.getNativeStyleEngine)() && scopeId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Native, {\n ...props,\n _scopeId: scopeId\n }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Fallback, {\n ...props\n });\n });\n};\n//# sourceMappingURL=_withNativeStyle.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OA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,GAAG,mBAAmB,IAAG,CAAE,QAAQ;GAC3H,GAAG;GACH,UAAU;EACZ,CAAC,IAAoB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,UAAU,EACzD,GAAG,MACL,CAAC;CACH,CAAC;AACH"}
|
|
@@ -36,10 +36,6 @@ var import_createVariable = require("./createVariable.native.js");
|
|
|
36
36
|
var import_useMedia = require("./hooks/useMedia.native.js");
|
|
37
37
|
var import_useTheme = require("./hooks/useTheme.native.js");
|
|
38
38
|
var import_useThemeState = require("./hooks/useThemeState.native.js");
|
|
39
|
-
function _type_of(obj) {
|
|
40
|
-
"@swc/helpers - typeof";
|
|
41
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
42
|
-
}
|
|
43
39
|
var EMPTY_EXPRESSIONS = [];
|
|
44
40
|
var EMPTY_THEME = {};
|
|
45
41
|
var FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();
|
|
@@ -65,7 +61,7 @@ var _withStableStyle = function(Component, createStyle, hasThemeKeys, hasMediaKe
|
|
|
65
61
|
var _loop = function(key2) {
|
|
66
62
|
var value = fallbackTheme[key2];
|
|
67
63
|
gettableTheme[key2] = typeof (value === null || value === void 0 ? void 0 : value.get) === "function" ? value : {
|
|
68
|
-
...value &&
|
|
64
|
+
...value && typeof value === "object" ? value : { val: value },
|
|
69
65
|
get: function() {
|
|
70
66
|
return (0, import_createVariable.getVariable)(value);
|
|
71
67
|
}
|
|
@@ -36,10 +36,6 @@ var import_createVariable = require("./createVariable.native.js");
|
|
|
36
36
|
var import_useMedia = require("./hooks/useMedia.native.js");
|
|
37
37
|
var import_useTheme = require("./hooks/useTheme.native.js");
|
|
38
38
|
var import_useThemeState = require("./hooks/useThemeState.native.js");
|
|
39
|
-
function _type_of(obj) {
|
|
40
|
-
"@swc/helpers - typeof";
|
|
41
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
42
|
-
}
|
|
43
39
|
var EMPTY_EXPRESSIONS = [];
|
|
44
40
|
var EMPTY_THEME = {};
|
|
45
41
|
var FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();
|
|
@@ -65,7 +61,7 @@ var _withStableStyle = function(Component, createStyle, hasThemeKeys, hasMediaKe
|
|
|
65
61
|
var _loop = function(key2) {
|
|
66
62
|
var value = fallbackTheme[key2];
|
|
67
63
|
gettableTheme[key2] = typeof (value === null || value === void 0 ? void 0 : value.get) === "function" ? value : {
|
|
68
|
-
...value &&
|
|
64
|
+
...value && typeof value === "object" ? value : { val: value },
|
|
69
65
|
get: function() {
|
|
70
66
|
return (0, import_createVariable.getVariable)(value);
|
|
71
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_withStableStyle.native.js","names":[],"sources":["cjs/_withStableStyle.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withStableStyle_exports = {};\n__export(withStableStyle_exports, {\n _withStableStyle: () => _withStableStyle\n});\nmodule.exports = __toCommonJS(withStableStyle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_config = require(\"./config\");\nvar import_createVariable = require(\"./createVariable\");\nvar import_useMedia = require(\"./hooks/useMedia\");\nvar import_useTheme = require(\"./hooks/useTheme\");\nvar import_useThemeState = require(\"./hooks/useThemeState\");\
|
|
1
|
+
{"version":3,"file":"_withStableStyle.native.js","names":[],"sources":["cjs/_withStableStyle.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withStableStyle_exports = {};\n__export(withStableStyle_exports, {\n _withStableStyle: () => _withStableStyle\n});\nmodule.exports = __toCommonJS(withStableStyle_exports);\nvar import_jsx_runtime = require(\"react/jsx-runtime\");\nvar import_react = __toESM(require(\"react\"), 1);\nvar import_config = require(\"./config\");\nvar import_createVariable = require(\"./createVariable\");\nvar import_useMedia = require(\"./hooks/useMedia\");\nvar import_useTheme = require(\"./hooks/useTheme\");\nvar import_useThemeState = require(\"./hooks/useThemeState\");\nvar EMPTY_EXPRESSIONS = [];\nvar EMPTY_THEME = {};\nvar FALLBACK_THEME_CACHE = /* @__PURE__ */ new WeakMap();\nvar _withStableStyle = function(Component, createStyle, hasThemeKeys, hasMediaKeys) {\n return /* @__PURE__ */ import_react.default.memo(function WithStableStyle(props) {\n var { ref, ...propsWithoutRef } = props;\n var { _expressions = EMPTY_EXPRESSIONS, ...rest } = propsWithoutRef;\n var parentId = (0, import_react.useContext)(import_useThemeState.ThemeStateContext);\n var theme = hasThemeKeys && parentId ? (0, import_useTheme.useTheme)() : null;\n var media = hasMediaKeys ? (0, import_useMedia.useMedia)() : null;\n var resolvedExpressions = media ? _expressions.map(function(expr) {\n return (\n // ['gtLg', cond] needs the media query and the runtime condition\n Array.isArray(expr) ? !!(media[expr[0]] && expr[1]) : typeof expr === \"string\" ? media[expr] : expr\n );\n }) : _expressions;\n var resolvedTheme = theme || EMPTY_THEME;\n if (hasThemeKeys && !parentId) {\n var config = (0, import_config.getConfigMaybe)();\n var themes = config === null || config === void 0 ? void 0 : config.themes;\n if (themes) {\n for (var k in themes) {\n var fallbackTheme = themes.light || themes.dark || themes[k];\n var gettableTheme = FALLBACK_THEME_CACHE.get(fallbackTheme);\n if (!gettableTheme) {\n var _loop = function(key2) {\n var value = fallbackTheme[key2];\n gettableTheme[key2] = typeof (value === null || value === void 0 ? void 0 : value.get) === \"function\" ? value : {\n ...value && typeof value === \"object\" ? value : {\n val: value\n },\n get: function() {\n return (0, import_createVariable.getVariable)(value);\n }\n };\n };\n gettableTheme = {};\n for (var key in fallbackTheme) _loop(key);\n FALLBACK_THEME_CACHE.set(fallbackTheme, gettableTheme);\n }\n resolvedTheme = gettableTheme;\n break;\n }\n }\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\"[@tamagui] _withStableStyle: no ThemeStateContext found. This usually means duplicate tamagui instances in a monorepo. Falling back to default theme from config.\");\n }\n }\n return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {\n ref,\n style: createStyle(resolvedTheme, resolvedExpressions),\n ...rest\n });\n });\n};\n//# sourceMappingURL=_withStableStyle.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG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O;GACpE,IAAI,QAAQ;IACV,KAAK,IAAI,KAAK,QAAQ;KACpB,IAAI,gBAAgB,OAAO,SAAS,OAAO,QAAQ,OAAO;KAC1D,IAAI,gBAAgB,qBAAqB,IAAI,aAAa;KAC1D,IAAI,CAAC,eAAe;MAClB,IAAI,QAAQ,SAAS,MAAM;OACzB,IAAI,QAAQ,cAAc;OAC1B,cAAc,QAAQ,QAAQ,UAAU,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,SAAS,aAAa,QAAQ;QAC9G,GAAG,SAAS,OAAO,UAAU,WAAW,QAAQ,EAC9C,KAAK,MACP;QACA,KAAK,WAAW;SACd,QAAQ,GAAG,sBAAsB,YAAW,CAAE,KAAK;QACrD;OACF;MACF;MACA,gBAAgB,CAAC;MACjB,KAAK,IAAI,OAAO,eAAe,MAAM,GAAG;MACxC,qBAAqB,IAAI,eAAe,aAAa;KACvD;KACA,gBAAgB;KAChB;IACF;GACF;GACA,IAAI,QAAQ,IAAI,aAAa,eAAe;IAC1C,QAAQ,KAAK,mKAAmK;GAClL;EACF;EACA,OAAuB,iBAAC,GAAG,mBAAmB,IAAG,CAAE,WAAW;GAC5D;GACA,OAAO,YAAY,eAAe,mBAAmB;GACrD,GAAG;EACL,CAAC;CACH,CAAC;AACH"}
|
package/dist/cjs/config.cjs
CHANGED
|
@@ -54,7 +54,7 @@ const getConfigFromGlobalOrLocal = () => {
|
|
|
54
54
|
return conf;
|
|
55
55
|
}
|
|
56
56
|
if (globalThis.__tamaguiConfig) {
|
|
57
|
-
if (process.env.NODE_ENV === "development" && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
57
|
+
if (process.env.NODE_ENV === "development" && globalThis.__tamaguiEvaluationConfig !== globalThis.__tamaguiConfig && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
58
58
|
globalThis.__tamaguiPendingCheck = true;
|
|
59
59
|
setTimeout(() => {
|
|
60
60
|
if (!setConfigCalledByThisInstance && !globalThis.__tamaguiHasWarnedGlobalFallback) {
|
|
@@ -77,11 +77,11 @@ const getSetting = (key) => {
|
|
|
77
77
|
if (process.env.NODE_ENV === "development") {
|
|
78
78
|
if (!config) throw new Error(haventCalledErrorMessage);
|
|
79
79
|
}
|
|
80
|
-
return config.settings[key]
|
|
80
|
+
return config.settings[key];
|
|
81
81
|
};
|
|
82
82
|
function getStyleCompat() {
|
|
83
83
|
const config = getConfigFromGlobalOrLocal();
|
|
84
|
-
return
|
|
84
|
+
return config?.settings?.styleCompat || "web";
|
|
85
85
|
}
|
|
86
86
|
const setConfig = (next) => {
|
|
87
87
|
setConfigCalledByThisInstance = true;
|
|
@@ -91,6 +91,9 @@ const setConfig = (next) => {
|
|
|
91
91
|
if (conf !== previous || globalThis.__tamaguiConfig !== previousGlobal) return;
|
|
92
92
|
conf = next;
|
|
93
93
|
globalThis.__tamaguiConfig = next;
|
|
94
|
+
if (process.env.TAMAGUI_ENVIRONMENT === "tamagui") {
|
|
95
|
+
globalThis.__tamaguiEvaluationConfig = next;
|
|
96
|
+
}
|
|
94
97
|
};
|
|
95
98
|
const setConfigFont = (name, font, fontParsed) => {
|
|
96
99
|
const config = getConfigFromGlobalOrLocal();
|
|
@@ -56,7 +56,7 @@ var getConfigFromGlobalOrLocal = function() {
|
|
|
56
56
|
return conf;
|
|
57
57
|
}
|
|
58
58
|
if (globalThis.__tamaguiConfig) {
|
|
59
|
-
if (process.env.NODE_ENV === "development" && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
59
|
+
if (process.env.NODE_ENV === "development" && globalThis.__tamaguiEvaluationConfig !== globalThis.__tamaguiConfig && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
60
60
|
globalThis.__tamaguiPendingCheck = true;
|
|
61
61
|
setTimeout(function() {
|
|
62
62
|
if (!setConfigCalledByThisInstance && !globalThis.__tamaguiHasWarnedGlobalFallback) {
|
|
@@ -79,13 +79,12 @@ var getSetting = function(key) {
|
|
|
79
79
|
if (process.env.NODE_ENV === "development") {
|
|
80
80
|
if (!config) throw new Error(haventCalledErrorMessage);
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
return (_config_settings_key = config.settings[key]) !== null && _config_settings_key !== void 0 ? _config_settings_key : config[key];
|
|
82
|
+
return config.settings[key];
|
|
84
83
|
};
|
|
85
84
|
function getStyleCompat() {
|
|
85
|
+
var _config_settings;
|
|
86
86
|
var config = getConfigFromGlobalOrLocal();
|
|
87
|
-
|
|
88
|
-
return ((_config_settings_styleCompat = config === null || config === void 0 ? void 0 : config.settings.styleCompat) !== null && _config_settings_styleCompat !== void 0 ? _config_settings_styleCompat : config === null || config === void 0 ? void 0 : config.styleCompat) || "web";
|
|
87
|
+
return (config === null || config === void 0 ? void 0 : (_config_settings = config.settings) === null || _config_settings === void 0 ? void 0 : _config_settings.styleCompat) || "web";
|
|
89
88
|
}
|
|
90
89
|
var setConfig = function(next) {
|
|
91
90
|
setConfigCalledByThisInstance = true;
|
|
@@ -95,6 +94,9 @@ var setConfig = function(next) {
|
|
|
95
94
|
if (conf !== previous || globalThis.__tamaguiConfig !== previousGlobal) return;
|
|
96
95
|
conf = next;
|
|
97
96
|
globalThis.__tamaguiConfig = next;
|
|
97
|
+
if (process.env.TAMAGUI_ENVIRONMENT === "tamagui") {
|
|
98
|
+
globalThis.__tamaguiEvaluationConfig = next;
|
|
99
|
+
}
|
|
98
100
|
};
|
|
99
101
|
var setConfigFont = function(name, font, fontParsed) {
|
|
100
102
|
var config = getConfigFromGlobalOrLocal();
|
|
@@ -56,7 +56,7 @@ var getConfigFromGlobalOrLocal = function() {
|
|
|
56
56
|
return conf;
|
|
57
57
|
}
|
|
58
58
|
if (globalThis.__tamaguiConfig) {
|
|
59
|
-
if (process.env.NODE_ENV === "development" && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
59
|
+
if (process.env.NODE_ENV === "development" && globalThis.__tamaguiEvaluationConfig !== globalThis.__tamaguiConfig && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {
|
|
60
60
|
globalThis.__tamaguiPendingCheck = true;
|
|
61
61
|
setTimeout(function() {
|
|
62
62
|
if (!setConfigCalledByThisInstance && !globalThis.__tamaguiHasWarnedGlobalFallback) {
|
|
@@ -79,13 +79,12 @@ var getSetting = function(key) {
|
|
|
79
79
|
if (process.env.NODE_ENV === "development") {
|
|
80
80
|
if (!config) throw new Error(haventCalledErrorMessage);
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
return (_config_settings_key = config.settings[key]) !== null && _config_settings_key !== void 0 ? _config_settings_key : config[key];
|
|
82
|
+
return config.settings[key];
|
|
84
83
|
};
|
|
85
84
|
function getStyleCompat() {
|
|
85
|
+
var _config_settings;
|
|
86
86
|
var config = getConfigFromGlobalOrLocal();
|
|
87
|
-
|
|
88
|
-
return ((_config_settings_styleCompat = config === null || config === void 0 ? void 0 : config.settings.styleCompat) !== null && _config_settings_styleCompat !== void 0 ? _config_settings_styleCompat : config === null || config === void 0 ? void 0 : config.styleCompat) || "web";
|
|
87
|
+
return (config === null || config === void 0 ? void 0 : (_config_settings = config.settings) === null || _config_settings === void 0 ? void 0 : _config_settings.styleCompat) || "web";
|
|
89
88
|
}
|
|
90
89
|
var setConfig = function(next) {
|
|
91
90
|
setConfigCalledByThisInstance = true;
|
|
@@ -95,6 +94,9 @@ var setConfig = function(next) {
|
|
|
95
94
|
if (conf !== previous || globalThis.__tamaguiConfig !== previousGlobal) return;
|
|
96
95
|
conf = next;
|
|
97
96
|
globalThis.__tamaguiConfig = next;
|
|
97
|
+
if (process.env.TAMAGUI_ENVIRONMENT === "tamagui") {
|
|
98
|
+
globalThis.__tamaguiEvaluationConfig = next;
|
|
99
|
+
}
|
|
98
100
|
};
|
|
99
101
|
var setConfigFont = function(name, font, fontParsed) {
|
|
100
102
|
var config = getConfigFromGlobalOrLocal();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.native.js","names":[],"sources":["cjs/config.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar config_exports = {};\n__export(config_exports, {\n devConfig: () => devConfig,\n getConfig: () => getConfig,\n getConfigMaybe: () => getConfigMaybe,\n getFont: () => getFont,\n getSetting: () => getSetting,\n getStyleCompat: () => getStyleCompat,\n getThemes: () => getThemes,\n getToken: () => getToken,\n getTokenObject: () => getTokenObject,\n getTokenValue: () => getTokenValue,\n getTokens: () => getTokens,\n loadAnimationDriver: () => loadAnimationDriver,\n setConfig: () => setConfig,\n setConfigFont: () => setConfigFont,\n setTokens: () => setTokens,\n setupDev: () => setupDev,\n updateConfig: () => updateConfig,\n useTokens: () => useTokens\n});\nmodule.exports = __toCommonJS(config_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_constants2 = require(\"./constants/constants\");\nvar import_formatDiagnostic = require(\"./helpers/formatDiagnostic\");\nvar import_grammarConfig = require(\"./helpers/grammarConfig\");\nvar conf;\nvar setConfigCalledByThisInstance = false;\nvar haventCalledErrorMessage = process.env.NODE_ENV === \"development\" ? `\nHaven't called createTamagui yet. ${import_constants2.MISSING_THEME_MESSAGE}\n` : `\\u274C Error 001`;\nvar getConfigFromGlobalOrLocal = function() {\n if (conf) {\n return conf;\n }\n if (globalThis.__tamaguiConfig) {\n if (process.env.NODE_ENV === \"development\" && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {\n globalThis.__tamaguiPendingCheck = true;\n setTimeout(function() {\n if (!setConfigCalledByThisInstance && !globalThis.__tamaguiHasWarnedGlobalFallback) {\n globalThis.__tamaguiHasWarnedGlobalFallback = true;\n console.warn(`\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\n\nTamagui: Using global config fallback. This may indicate duplicate tamagui instances (e.g., from Vite SSR bundling). This is handled automatically, but likely causes issues!\n\n\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F`);\n }\n globalThis.__tamaguiPendingCheck = false;\n }, 500);\n }\n return globalThis.__tamaguiConfig;\n }\n return null;\n};\nvar getSetting = function(key) {\n var config = getConfigFromGlobalOrLocal();\n if (process.env.NODE_ENV === \"development\") {\n if (!config) throw new Error(haventCalledErrorMessage);\n }\n var _config_settings_key;\n return (_config_settings_key = config.settings[key]) !== null && _config_settings_key !== void 0 ? _config_settings_key : (\n // @ts-expect-error\n config[key]\n );\n};\nfunction getStyleCompat() {\n var config = getConfigFromGlobalOrLocal();\n var _config_settings_styleCompat;\n return ((_config_settings_styleCompat = config === null || config === void 0 ? void 0 : config.settings.styleCompat) !== null && _config_settings_styleCompat !== void 0 ? _config_settings_styleCompat : config === null || config === void 0 ? void 0 : config.styleCompat) || \"web\";\n}\nvar setConfig = function(next) {\n setConfigCalledByThisInstance = true;\n var previous = conf;\n var previousGlobal = globalThis.__tamaguiConfig;\n (0, import_grammarConfig.prepareConfigRevision)(next);\n if (conf !== previous || globalThis.__tamaguiConfig !== previousGlobal) return;\n conf = next;\n globalThis.__tamaguiConfig = next;\n};\nvar setConfigFont = function(name, font, fontParsed) {\n var config = getConfigFromGlobalOrLocal();\n if (process.env.NODE_ENV === \"development\") {\n if (!config) throw new Error(haventCalledErrorMessage);\n }\n config.fonts[name] = font;\n config.fontsParsed[name] = fontParsed;\n (0, import_grammarConfig.prepareConfigRevision)(config);\n};\nvar getConfig = function() {\n var config = getConfigFromGlobalOrLocal();\n if (!config) {\n throw new Error((0, import_formatDiagnostic.formatDiagnostic)(\"Err0\", \"TamaguiConfig\", \"no config is available\", \"Call createTamagui before rendering and deduplicate Tamagui package versions\", \"config\", config));\n }\n return config;\n};\nvar getConfigMaybe = function() {\n return getConfigFromGlobalOrLocal();\n};\nvar tokens;\nfunction setTokens(next) {\n tokens = next;\n}\nvar getTokensParsed = function() {\n var _getConfigFromGlobalOrLocal;\n var _getConfigFromGlobalOrLocal_tokensParsed;\n return (_getConfigFromGlobalOrLocal_tokensParsed = (_getConfigFromGlobalOrLocal = getConfigFromGlobalOrLocal()) === null || _getConfigFromGlobalOrLocal === void 0 ? void 0 : _getConfigFromGlobalOrLocal.tokensParsed) !== null && _getConfigFromGlobalOrLocal_tokensParsed !== void 0 ? _getConfigFromGlobalOrLocal_tokensParsed : tokens;\n};\nvar getTokens = function() {\n if (process.env.NODE_ENV === \"development\") {\n if (!getConfigFromGlobalOrLocal()) throw new Error(haventCalledErrorMessage);\n }\n return getTokensParsed();\n};\nvar getTokenObject = function(value, group) {\n var _tokens_group, _tokens_;\n var tokens2 = getTokensParsed();\n return group ? (_tokens_group = tokens2[group]) === null || _tokens_group === void 0 ? void 0 : _tokens_group[value] : (_tokens_ = tokens2[Object.keys(tokens2).find(function(cat) {\n return tokens2[cat][value];\n }) || \"\"]) === null || _tokens_ === void 0 ? void 0 : _tokens_[value];\n};\nvar getToken = function(value, group) {\n var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants.isWeb;\n var token = getTokenObject(value, group);\n return useVariable ? token === null || token === void 0 ? void 0 : token.variable : token === null || token === void 0 ? void 0 : token.val;\n};\nvar getTokenValue = function(value, group) {\n if (value === \"unset\" || value === \"auto\") return;\n return getToken(value, group, false);\n};\nvar useTokens = getTokens;\nvar getThemes = function() {\n return getConfigFromGlobalOrLocal().themes;\n};\nvar updateConfig = function(key, value) {\n var config = getConfigFromGlobalOrLocal();\n if (!config || key === \"__proto__\" || !(key in config)) {\n return;\n }\n Object.assign(config[key], value);\n (0, import_grammarConfig.prepareConfigRevision)(config);\n};\nvar getFont = function(name) {\n var _Object_entries_find;\n var conf2 = getConfig();\n var _conf_fontsParsed_name;\n return (_conf_fontsParsed_name = conf2.fontsParsed[name]) !== null && _conf_fontsParsed_name !== void 0 ? _conf_fontsParsed_name : (_Object_entries_find = Object.entries(conf2.fontsParsed).find(function(param) {\n var [k] = param;\n var _conf_fontsParsed_k_family, _conf_fontsParsed_k;\n return ((_conf_fontsParsed_k = conf2.fontsParsed[k]) === null || _conf_fontsParsed_k === void 0 ? void 0 : (_conf_fontsParsed_k_family = _conf_fontsParsed_k.family) === null || _conf_fontsParsed_k_family === void 0 ? void 0 : _conf_fontsParsed_k_family[\"val\"]) === name;\n })) === null || _Object_entries_find === void 0 ? void 0 : _Object_entries_find[1];\n};\nvar devConfig;\nfunction setupDev(conf2) {\n if (process.env.NODE_ENV === \"development\") {\n devConfig = conf2;\n }\n}\nfunction loadAnimationDriver(name, driver) {\n var config = getConfigFromGlobalOrLocal();\n if (!config) {\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\"loadAnimationDriver called before createTamagui\");\n }\n return;\n }\n if (config.animations && !(\"default\" in config.animations)) {\n ;\n config.animations = {\n default: config.animations\n };\n }\n if (config.animations) {\n ;\n config.animations[name] = driver;\n } else {\n ;\n config.animations = {\n default: driver,\n [name]: driver\n };\n }\n}\n//# sourceMappingURL=config.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAA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E;EACA;CACF;CACA,IAAI,OAAO,cAAc,EAAE,aAAa,OAAO,aAAa;EAC1D;EACA,OAAO,aAAa,EAClB,SAAS,OAAO,WAClB;CACF;CACA,IAAI,OAAO,YAAY;EACrB;EACA,OAAO,WAAW,QAAQ;CAC5B,OAAO;EACL;EACA,OAAO,aAAa;GAClB,SAAS;IACR,OAAO;EACV;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"config.native.js","names":[],"sources":["cjs/config.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar config_exports = {};\n__export(config_exports, {\n devConfig: () => devConfig,\n getConfig: () => getConfig,\n getConfigMaybe: () => getConfigMaybe,\n getFont: () => getFont,\n getSetting: () => getSetting,\n getStyleCompat: () => getStyleCompat,\n getThemes: () => getThemes,\n getToken: () => getToken,\n getTokenObject: () => getTokenObject,\n getTokenValue: () => getTokenValue,\n getTokens: () => getTokens,\n loadAnimationDriver: () => loadAnimationDriver,\n setConfig: () => setConfig,\n setConfigFont: () => setConfigFont,\n setTokens: () => setTokens,\n setupDev: () => setupDev,\n updateConfig: () => updateConfig,\n useTokens: () => useTokens\n});\nmodule.exports = __toCommonJS(config_exports);\nvar import_constants = require(\"@tamagui/constants\");\nvar import_constants2 = require(\"./constants/constants\");\nvar import_formatDiagnostic = require(\"./helpers/formatDiagnostic\");\nvar import_grammarConfig = require(\"./helpers/grammarConfig\");\nvar conf;\nvar setConfigCalledByThisInstance = false;\nvar haventCalledErrorMessage = process.env.NODE_ENV === \"development\" ? `\nHaven't called createTamagui yet. ${import_constants2.MISSING_THEME_MESSAGE}\n` : `\\u274C Error 001`;\nvar getConfigFromGlobalOrLocal = function() {\n if (conf) {\n return conf;\n }\n if (globalThis.__tamaguiConfig) {\n if (process.env.NODE_ENV === \"development\" && globalThis.__tamaguiEvaluationConfig !== globalThis.__tamaguiConfig && !globalThis.__tamaguiHasWarnedGlobalFallback && !globalThis.__tamaguiPendingCheck) {\n globalThis.__tamaguiPendingCheck = true;\n setTimeout(function() {\n if (!setConfigCalledByThisInstance && !globalThis.__tamaguiHasWarnedGlobalFallback) {\n globalThis.__tamaguiHasWarnedGlobalFallback = true;\n console.warn(`\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\n\nTamagui: Using global config fallback. This may indicate duplicate tamagui instances (e.g., from Vite SSR bundling). This is handled automatically, but likely causes issues!\n\n\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F\\u26A0\\uFE0F`);\n }\n globalThis.__tamaguiPendingCheck = false;\n }, 500);\n }\n return globalThis.__tamaguiConfig;\n }\n return null;\n};\nvar getSetting = function(key) {\n var config = getConfigFromGlobalOrLocal();\n if (process.env.NODE_ENV === \"development\") {\n if (!config) throw new Error(haventCalledErrorMessage);\n }\n return config.settings[key];\n};\nfunction getStyleCompat() {\n var _config_settings;\n var config = getConfigFromGlobalOrLocal();\n return (config === null || config === void 0 ? void 0 : (_config_settings = config.settings) === null || _config_settings === void 0 ? void 0 : _config_settings.styleCompat) || \"web\";\n}\nvar setConfig = function(next) {\n setConfigCalledByThisInstance = true;\n var previous = conf;\n var previousGlobal = globalThis.__tamaguiConfig;\n (0, import_grammarConfig.prepareConfigRevision)(next);\n if (conf !== previous || globalThis.__tamaguiConfig !== previousGlobal) return;\n conf = next;\n globalThis.__tamaguiConfig = next;\n if (process.env.TAMAGUI_ENVIRONMENT === \"tamagui\") {\n globalThis.__tamaguiEvaluationConfig = next;\n }\n};\nvar setConfigFont = function(name, font, fontParsed) {\n var config = getConfigFromGlobalOrLocal();\n if (process.env.NODE_ENV === \"development\") {\n if (!config) throw new Error(haventCalledErrorMessage);\n }\n config.fonts[name] = font;\n config.fontsParsed[name] = fontParsed;\n (0, import_grammarConfig.prepareConfigRevision)(config);\n};\nvar getConfig = function() {\n var config = getConfigFromGlobalOrLocal();\n if (!config) {\n throw new Error((0, import_formatDiagnostic.formatDiagnostic)(\"Err0\", \"TamaguiConfig\", \"no config is available\", \"Call createTamagui before rendering and deduplicate Tamagui package versions\", \"config\", config));\n }\n return config;\n};\nvar getConfigMaybe = function() {\n return getConfigFromGlobalOrLocal();\n};\nvar tokens;\nfunction setTokens(next) {\n tokens = next;\n}\nvar getTokensParsed = function() {\n var _getConfigFromGlobalOrLocal;\n var _getConfigFromGlobalOrLocal_tokensParsed;\n return (_getConfigFromGlobalOrLocal_tokensParsed = (_getConfigFromGlobalOrLocal = getConfigFromGlobalOrLocal()) === null || _getConfigFromGlobalOrLocal === void 0 ? void 0 : _getConfigFromGlobalOrLocal.tokensParsed) !== null && _getConfigFromGlobalOrLocal_tokensParsed !== void 0 ? _getConfigFromGlobalOrLocal_tokensParsed : tokens;\n};\nvar getTokens = function() {\n if (process.env.NODE_ENV === \"development\") {\n if (!getConfigFromGlobalOrLocal()) throw new Error(haventCalledErrorMessage);\n }\n return getTokensParsed();\n};\nvar getTokenObject = function(value, group) {\n var _tokens_group, _tokens_;\n var tokens2 = getTokensParsed();\n return group ? (_tokens_group = tokens2[group]) === null || _tokens_group === void 0 ? void 0 : _tokens_group[value] : (_tokens_ = tokens2[Object.keys(tokens2).find(function(cat) {\n return tokens2[cat][value];\n }) || \"\"]) === null || _tokens_ === void 0 ? void 0 : _tokens_[value];\n};\nvar getToken = function(value, group) {\n var useVariable = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_constants.isWeb;\n var token = getTokenObject(value, group);\n return useVariable ? token === null || token === void 0 ? void 0 : token.variable : token === null || token === void 0 ? void 0 : token.val;\n};\nvar getTokenValue = function(value, group) {\n if (value === \"unset\" || value === \"auto\") return;\n return getToken(value, group, false);\n};\nvar useTokens = getTokens;\nvar getThemes = function() {\n return getConfigFromGlobalOrLocal().themes;\n};\nvar updateConfig = function(key, value) {\n var config = getConfigFromGlobalOrLocal();\n if (!config || key === \"__proto__\" || !(key in config)) {\n return;\n }\n Object.assign(config[key], value);\n (0, import_grammarConfig.prepareConfigRevision)(config);\n};\nvar getFont = function(name) {\n var _Object_entries_find;\n var conf2 = getConfig();\n var _conf_fontsParsed_name;\n return (_conf_fontsParsed_name = conf2.fontsParsed[name]) !== null && _conf_fontsParsed_name !== void 0 ? _conf_fontsParsed_name : (_Object_entries_find = Object.entries(conf2.fontsParsed).find(function(param) {\n var [k] = param;\n var _conf_fontsParsed_k_family, _conf_fontsParsed_k;\n return ((_conf_fontsParsed_k = conf2.fontsParsed[k]) === null || _conf_fontsParsed_k === void 0 ? void 0 : (_conf_fontsParsed_k_family = _conf_fontsParsed_k.family) === null || _conf_fontsParsed_k_family === void 0 ? void 0 : _conf_fontsParsed_k_family[\"val\"]) === name;\n })) === null || _Object_entries_find === void 0 ? void 0 : _Object_entries_find[1];\n};\nvar devConfig;\nfunction setupDev(conf2) {\n if (process.env.NODE_ENV === \"development\") {\n devConfig = conf2;\n }\n}\nfunction loadAnimationDriver(name, driver) {\n var config = getConfigFromGlobalOrLocal();\n if (!config) {\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\"loadAnimationDriver called before createTamagui\");\n }\n return;\n }\n if (config.animations && !(\"default\" in config.animations)) {\n ;\n config.animations = {\n default: config.animations\n };\n }\n if (config.animations) {\n ;\n config.animations[name] = driver;\n } else {\n ;\n config.animations = {\n default: driver,\n [name]: driver\n };\n }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F;AACA,SAAS,oBAAoB,MAAM,QAAQ;CACzC,IAAI,SAAS,2BAA2B;CACxC,IAAI,CAAC,QAAQ;EACX,IAAI,QAAQ,IAAI,aAAa,eAAe;GAC1C,QAAQ,KAAK,iDAAiD;EAChE;EACA;CACF;CACA,IAAI,OAAO,cAAc,EAAE,aAAa,OAAO,aAAa;EAC1D;EACA,OAAO,aAAa,EAClB,SAAS,OAAO,WAClB;CACF;CACA,IAAI,OAAO,YAAY;EACrB;EACA,OAAO,WAAW,QAAQ;CAC5B,OAAO;EACL;EACA,OAAO,aAAa;GAClB,SAAS;IACR,OAAO;EACV;CACF;AACF"}
|
|
@@ -31,6 +31,11 @@ var import_createStyledContext = require("../helpers/createStyledContext.native.
|
|
|
31
31
|
var componentContextKeys = [
|
|
32
32
|
"disableSSR",
|
|
33
33
|
"inText",
|
|
34
|
+
...[
|
|
35
|
+
"parentFontSize",
|
|
36
|
+
"parentLineHeight",
|
|
37
|
+
"animatedText"
|
|
38
|
+
],
|
|
34
39
|
"language",
|
|
35
40
|
"animationDriver",
|
|
36
41
|
"setParentFocusState",
|
|
@@ -39,6 +44,9 @@ var componentContextKeys = [
|
|
|
39
44
|
var ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
40
45
|
disableSSR: void 0,
|
|
41
46
|
inText: false,
|
|
47
|
+
parentFontSize: void 0,
|
|
48
|
+
parentLineHeight: void 0,
|
|
49
|
+
animatedText: null,
|
|
42
50
|
language: null,
|
|
43
51
|
animationDriver: null,
|
|
44
52
|
setParentFocusState: null,
|
|
@@ -31,6 +31,11 @@ var import_createStyledContext = require("../helpers/createStyledContext.native.
|
|
|
31
31
|
var componentContextKeys = [
|
|
32
32
|
"disableSSR",
|
|
33
33
|
"inText",
|
|
34
|
+
...[
|
|
35
|
+
"parentFontSize",
|
|
36
|
+
"parentLineHeight",
|
|
37
|
+
"animatedText"
|
|
38
|
+
],
|
|
34
39
|
"language",
|
|
35
40
|
"animationDriver",
|
|
36
41
|
"setParentFocusState",
|
|
@@ -39,6 +44,9 @@ var componentContextKeys = [
|
|
|
39
44
|
var ComponentContext = (0, import_createStyledContext.createStyledContext)({
|
|
40
45
|
disableSSR: void 0,
|
|
41
46
|
inText: false,
|
|
47
|
+
parentFontSize: void 0,
|
|
48
|
+
parentLineHeight: void 0,
|
|
49
|
+
animatedText: null,
|
|
42
50
|
language: null,
|
|
43
51
|
animationDriver: null,
|
|
44
52
|
setParentFocusState: null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentContext.native.js","names":[],"sources":["cjs/contexts/ComponentContext.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n
|
|
1
|
+
{"version":3,"file":"ComponentContext.native.js","names":[],"sources":["cjs/contexts/ComponentContext.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar ComponentContext_exports = {};\n__export(ComponentContext_exports, {\n\tComponentContext: () => ComponentContext,\n\tuseConfiguration: () => useConfiguration\n});\nmodule.exports = __toCommonJS(ComponentContext_exports);\nvar import_react = require(\"react\");\nvar import_createStyledContext = require(\"../helpers/createStyledContext\");\nvar componentContextKeys = [\n\t\"disableSSR\",\n\t\"inText\",\n\t...[\n\t\t\"parentFontSize\",\n\t\t\"parentLineHeight\",\n\t\t\"animatedText\"\n\t],\n\t\"language\",\n\t\"animationDriver\",\n\t\"setParentFocusState\",\n\t\"insets\"\n];\nvar ComponentContext = (0, import_createStyledContext.createStyledContext)({\n\tdisableSSR: void 0,\n\tinText: false,\n\tparentFontSize: void 0,\n\tparentLineHeight: void 0,\n\tanimatedText: null,\n\tlanguage: null,\n\tanimationDriver: null,\n\tsetParentFocusState: null,\n\tinsets: null\n}, { keys: componentContextKeys });\nvar useConfiguration = function() {\n\treturn (0, import_react.useContext)(ComponentContext);\n};\n//# sourceMappingURL=ComponentContext.js.map\n"],"mappings":";;;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC/B,KAAK,IAAI,QAAQ,KAAK,UAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;CACb,CAAC;AACF;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC7C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EACnE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QAAQ,UAAU,IAAI,KAAK;GAC9G,WAAW,KAAK;GAChB,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAC3D,CAAC;CACF;CACA,OAAO;AACR;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,2BAA2B,CAAC;AAChC,SAAS,0BAA0B;CAClC,wBAAwB;CACxB,wBAAwB;AACzB,CAAC;AACD,OAAO,UAAU,aAAa,wBAAwB;AACtD,IAAI,eAAe,QAAQ,OAAO;AAClC,IAAI,6BAA6B,QAAQ,0CAAgC;AACzE,IAAI,uBAAuB;CAC1B;CACA;CACA,GAAG;EACF;EACA;EACA;CACD;CACA;CACA;CACA;CACA;AACD;AACA,IAAI,oBAAoB,GAAG,2BAA2B,oBAAmB,CAAE;CAC1E,YAAY,KAAK;CACjB,QAAQ;CACR,gBAAgB,KAAK;CACrB,kBAAkB,KAAK;CACvB,cAAc;CACd,UAAU;CACV,iBAAiB;CACjB,qBAAqB;CACrB,QAAQ;AACT,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACjC,IAAI,mBAAmB,WAAW;CACjC,QAAQ,GAAG,aAAa,WAAU,CAAE,gBAAgB;AACrD"}
|
|
@@ -45,6 +45,8 @@ var import_defaultComponentState = require("./defaultComponentState.cjs");
|
|
|
45
45
|
var import_eventHandling = require("./eventHandling.cjs");
|
|
46
46
|
var import_componentDisplayName = require("./helpers/componentDisplayName.cjs");
|
|
47
47
|
var import_getSplitStyles = require("./helpers/getSplitStyles.cjs");
|
|
48
|
+
require("./helpers/isTamaguiElement.cjs");
|
|
49
|
+
require("./helpers/NativeTextBinding.cjs");
|
|
48
50
|
var import_grammarConfig = require("./helpers/grammarConfig.cjs");
|
|
49
51
|
var import_styleStaticConfig = require("./helpers/styleStaticConfig.cjs");
|
|
50
52
|
require("./helpers/nativeStyleEngine.cjs");
|
|
@@ -78,8 +80,7 @@ const avoidReRenderKeys = /* @__PURE__ */ new Set([
|
|
|
78
80
|
"group",
|
|
79
81
|
"focus",
|
|
80
82
|
"focusWithin",
|
|
81
|
-
"media"
|
|
82
|
-
"group"
|
|
83
|
+
"media"
|
|
83
84
|
]);
|
|
84
85
|
const groupPseudoKeys = [
|
|
85
86
|
"disabled",
|
|
@@ -207,7 +208,7 @@ function createComponent(staticConfig) {
|
|
|
207
208
|
const nextStyleStaticConfig = (0, import_styleStaticConfig.getStyleStaticConfig)(staticConfig, config);
|
|
208
209
|
resolvedStyleStaticConfig = nextStyleStaticConfig;
|
|
209
210
|
resolvedDefaultProps = nextStyleStaticConfig.defaultProps;
|
|
210
|
-
if (import_constants.isWeb && !staticConfig.isText && config.settings.defaultPosition === "relative" && nextStyleStaticConfig.baseStyle?.position === void 0) resolvedStyleStaticConfig = {
|
|
211
|
+
if (import_constants.isWeb && !staticConfig.isText && !staticConfig.isStyledHOC && config.settings.defaultPosition === "relative" && nextStyleStaticConfig.baseStyle?.position === void 0) resolvedStyleStaticConfig = {
|
|
211
212
|
...nextStyleStaticConfig,
|
|
212
213
|
baseStyle: {
|
|
213
214
|
position: "relative",
|
|
@@ -237,10 +238,6 @@ function createComponent(staticConfig) {
|
|
|
237
238
|
let overriddenContextProps = null;
|
|
238
239
|
const componentContext = import_react.default.useContext(import_ComponentContext.ComponentContext);
|
|
239
240
|
const hasTextAncestor = !!(import_constants.isWeb && isText ? componentContext.inText : false);
|
|
240
|
-
if (!process.env.TAMAGUI_IS_CORE_NODE && process.env.NODE_ENV === "development" && debugProp === "profile" && !time) {
|
|
241
|
-
time = require("@tamagui/timer").timer().start();
|
|
242
|
-
globalThis["time"] = time;
|
|
243
|
-
}
|
|
244
241
|
if (process.env.NODE_ENV === "development" && !time && globalThis.time) time = globalThis.time;
|
|
245
242
|
if (process.env.NODE_ENV === "development" && time) time`non-tamagui time (ignore)`;
|
|
246
243
|
let props = propsIn;
|
|
@@ -334,7 +331,7 @@ function createComponent(staticConfig) {
|
|
|
334
331
|
let elementType = BaseComponent;
|
|
335
332
|
const isAnimatedCustomComponent = animationDriver && isAnimated && animationDriver.needsCustomComponent;
|
|
336
333
|
if (isAnimatedCustomComponent) elementType = animationDriver[isText ? "Text" : "View"] || elementType;
|
|
337
|
-
const disableTheme = props["data-disable-theme"] || isHOC;
|
|
334
|
+
const disableTheme = props["data-disable-theme"] && !("theme" in props) || isHOC && true;
|
|
338
335
|
if (process.env.NODE_ENV === "development" && time) time`theme-props`;
|
|
339
336
|
const themeStateProps = {
|
|
340
337
|
disable: disableTheme,
|
|
@@ -411,7 +408,7 @@ ${banner}
|
|
|
411
408
|
if (process.env.NODE_ENV === "development" && time) time`theme`;
|
|
412
409
|
if (!isAnimatedCustomComponent) elementType = element || elementType;
|
|
413
410
|
const isStringElement = typeof elementType === "string";
|
|
414
|
-
const mediaState = (0, import_useMedia.useMedia)(
|
|
411
|
+
const mediaState = (0, import_useMedia.useMedia)(stateRef.current, debugProp, stateRef.current);
|
|
415
412
|
(0, import_createVariable.setDidGetVariableValue)(false);
|
|
416
413
|
if (process.env.NODE_ENV === "development" && time) time`media`;
|
|
417
414
|
const styleProps = {
|
|
@@ -423,7 +420,8 @@ ${banner}
|
|
|
423
420
|
willBeAnimated,
|
|
424
421
|
canPlatformPseudo: componentState.platformPseudo,
|
|
425
422
|
displayName,
|
|
426
|
-
styledContext: styledContextValue
|
|
423
|
+
styledContext: styledContextValue,
|
|
424
|
+
prevStyle: import_constants.isWeb ? void 0 : stateRef.current.prevStyle
|
|
427
425
|
};
|
|
428
426
|
const themeName = themeState?.name || "";
|
|
429
427
|
if (process.env.NODE_ENV === "development" && time) time`split-styles-prepare`;
|
|
@@ -528,22 +526,18 @@ ${banner}
|
|
|
528
526
|
const effectiveTransition = nextStyles?.effectiveTransition ?? props.transition ?? (platformPseudo ? "0ms" : void 0);
|
|
529
527
|
stateRef.current.prevPseudoState = (0, import_extractPseudoState.extractPseudoState)(updatedState);
|
|
530
528
|
const hasActivePseudo = Boolean(updatedState.hover || updatedState.press || updatedState.pressIn || updatedState.focus || updatedState.focusWithin);
|
|
531
|
-
useStyleListener(nextStyles?.style || {}, effectiveTransition, hasActivePseudo);
|
|
529
|
+
useStyleListener(nextStyles?.style || {}, effectiveTransition, hasActivePseudo, void 0);
|
|
530
|
+
};
|
|
531
|
+
stateRef.current.mediaEmit ||= (next) => {
|
|
532
|
+
const sr = stateRef.current;
|
|
533
|
+
sr.nextMedia = next;
|
|
534
|
+
if (sr.mediaEmitQueued) return;
|
|
535
|
+
sr.mediaEmitQueued = true;
|
|
536
|
+
queueMicrotask(() => {
|
|
537
|
+
sr.mediaEmitQueued = false;
|
|
538
|
+
sr.updateStyleListener?.();
|
|
539
|
+
});
|
|
532
540
|
};
|
|
533
|
-
componentContext.mediaEmitListeners = componentContext.mediaEmitListeners || /* @__PURE__ */ new Set();
|
|
534
|
-
if (!stateRef.current.mediaEmitCleanup) {
|
|
535
|
-
const updateListener = (next) => {
|
|
536
|
-
stateRef.current.nextMedia = next;
|
|
537
|
-
stateRef.current.updateStyleListener?.();
|
|
538
|
-
};
|
|
539
|
-
componentContext.mediaEmitListeners.add(updateListener);
|
|
540
|
-
stateRef.current.mediaEmitCleanup = () => {
|
|
541
|
-
componentContext.mediaEmitListeners?.delete(updateListener);
|
|
542
|
-
};
|
|
543
|
-
}
|
|
544
|
-
componentContext.mediaEmit = componentContext.mediaEmit || ((next) => {
|
|
545
|
-
for (const listener of componentContext.mediaEmitListeners) listener(next);
|
|
546
|
-
});
|
|
547
541
|
stateRef.current.setStateShallow = (nextOrGetNext) => {
|
|
548
542
|
const prev = stateRef.current.nextState || state;
|
|
549
543
|
const next = typeof nextOrGetNext === "function" ? nextOrGetNext(prev) : nextOrGetNext;
|
|
@@ -595,12 +589,13 @@ ${banner}
|
|
|
595
589
|
(0, import_useMedia.setMediaShouldUpdate)(stateRef.current, shouldListenForMedia, mediaListeningKeys, stateRef.current.optimizeForFirstRender);
|
|
596
590
|
const { viewProps: viewPropsIn, style: splitStylesStyle, classNames, pseudoGroups, mediaGroups } = splitStyles || {};
|
|
597
591
|
const groupSetRevision = (0, import_subscribeToContextGroup.useGroupSetRevision)(pseudoGroups, mediaGroups);
|
|
592
|
+
if (!import_constants.isWeb) stateRef.current.prevStyle = splitStylesStyle || null;
|
|
598
593
|
const propsWithAnimation = props;
|
|
599
|
-
const { asChild, children, themeShallow,
|
|
594
|
+
const { asChild, children, themeShallow, onPress, onLongPress, onPressIn, onPressOut, onHoverIn, onHoverOut, onMouseUp, onMouseDown, onMouseEnter, onMouseLeave, onFocus, onBlur, onTransition, separator, passThrough, forceStyle: _forceStyle, onClick, theme: _themeProp, ...nonTamaguiProps } = viewPropsIn || {};
|
|
600
595
|
let viewProps = nonTamaguiProps;
|
|
601
596
|
if (props.forceStyle) viewProps.forceStyle = props.forceStyle;
|
|
602
597
|
if (isHOC) {
|
|
603
|
-
if (typeof _themeProp !== "undefined") viewProps.theme = _themeProp;
|
|
598
|
+
if (typeof _themeProp !== "undefined" && true) viewProps.theme = _themeProp;
|
|
604
599
|
if (typeof passThrough !== "undefined") viewProps.passThrough = passThrough;
|
|
605
600
|
if (typeof asChild !== "undefined") viewProps.asChild = asChild;
|
|
606
601
|
if (typeof onTransition !== "undefined") viewProps.onTransition = onTransition;
|
|
@@ -650,10 +645,21 @@ ${banner}
|
|
|
650
645
|
stateRef.current.hasMeasured = true;
|
|
651
646
|
});
|
|
652
647
|
viewProps = import_setupHooks.hooks.usePropsTransform?.(elementType, nonTamaguiProps, stateRef, stateRef.current.willHydrate) || nonTamaguiProps;
|
|
648
|
+
stateRef.current.composedForwardedRef = forwardedRef;
|
|
653
649
|
if (!stateRef.current.composedRef) stateRef.current.composedRef = (0, import_compose_refs.composeRefs)((x) => {
|
|
654
650
|
stateRef.current.host = x;
|
|
655
|
-
|
|
651
|
+
const current = stateRef.current.composedForwardedRef;
|
|
652
|
+
stateRef.current.attachedForwardedRef = x ? current : void 0;
|
|
653
|
+
(0, import_compose_refs.setRef)(current, x);
|
|
654
|
+
}, import_setElementProps.setElementProps, animatedRef);
|
|
656
655
|
viewProps.ref = stateRef.current.composedRef;
|
|
656
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
657
|
+
const attached = stateRef.current.attachedForwardedRef;
|
|
658
|
+
if (attached === forwardedRef) return;
|
|
659
|
+
if (attached) (0, import_compose_refs.setRef)(attached, null);
|
|
660
|
+
stateRef.current.attachedForwardedRef = forwardedRef;
|
|
661
|
+
if (stateRef.current.host) (0, import_compose_refs.setRef)(forwardedRef, stateRef.current.host);
|
|
662
|
+
}, [forwardedRef]);
|
|
657
663
|
(0, import_pointerEvents.usePointerEvents)(props, viewProps);
|
|
658
664
|
if (process.env.NODE_ENV === "development") {
|
|
659
665
|
if (!isText && import_constants.isWeb && !isHOC) import_react.default.Children.toArray(props.children).forEach((item) => {
|
|
@@ -709,8 +715,6 @@ ${banner}
|
|
|
709
715
|
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
710
716
|
return () => {
|
|
711
717
|
componentSetStates.delete(setState);
|
|
712
|
-
stateRef.current.mediaEmitCleanup?.();
|
|
713
|
-
stateRef.current.mediaEmitCleanup = void 0;
|
|
714
718
|
};
|
|
715
719
|
}, []);
|
|
716
720
|
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
@@ -843,6 +847,14 @@ ${banner}
|
|
|
843
847
|
}
|
|
844
848
|
}
|
|
845
849
|
} : null;
|
|
850
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
851
|
+
const hadPressPlumbing = stateRef.current.hadAttachPress;
|
|
852
|
+
stateRef.current.hadAttachPress = attachPress;
|
|
853
|
+
if (hadPressPlumbing && !attachPress && !pseudoGroups?.size) (stateRef.current.setStateShallow ?? stateRef.current.baseSetStateShallow)?.({
|
|
854
|
+
press: false,
|
|
855
|
+
pressIn: false
|
|
856
|
+
});
|
|
857
|
+
}, [attachPress, pseudoGroups]);
|
|
846
858
|
if (events) Object.assign(viewProps, (0, import_eventHandling.getWebEvents)(events));
|
|
847
859
|
if (process.env.NODE_ENV === "development" && time) time`events`;
|
|
848
860
|
if (process.env.NODE_ENV === "development" && debugProp === "verbose") (0, import_log.log)(`events`, {
|
|
@@ -863,7 +875,9 @@ ${banner}
|
|
|
863
875
|
onMouseUp,
|
|
864
876
|
onMouseDown,
|
|
865
877
|
onMouseEnter,
|
|
866
|
-
onMouseLeave
|
|
878
|
+
onMouseLeave,
|
|
879
|
+
onFocus,
|
|
880
|
+
onBlur
|
|
867
881
|
}, webStyleEvents);
|
|
868
882
|
Object.assign(viewProps, passEvents);
|
|
869
883
|
}
|
|
@@ -925,7 +939,7 @@ ${banner}
|
|
|
925
939
|
});
|
|
926
940
|
}
|
|
927
941
|
if (process.env.NODE_ENV === "development" && time) time`context-override`;
|
|
928
|
-
if (
|
|
942
|
+
if (process.env.TAMAGUI_RUNTIME !== "island" && startedUnhydrated && splitStyles) content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [content, !isHydrated ? (0, import_wrapStyleTags.getStyleTags)(Object.values(splitStyles.rulesToInsert)) : null] });
|
|
929
943
|
if (process.env.NODE_ENV === "development" && time) time`style-tags`;
|
|
930
944
|
if (process.env.NODE_ENV === "development") {
|
|
931
945
|
if (debugProp && debugProp !== "profile") {
|