@tamagui/web 3.0.0-beta.922.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_withNativeStyle.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.cjs +3 -0
- package/dist/cjs/_withNativeStyle.native.js +3 -0
- package/dist/cjs/_withNativeStyle.native.js.map +1 -1
- package/dist/cjs/_withStableStyle.native.cjs +1 -5
- package/dist/cjs/_withStableStyle.native.js +1 -5
- package/dist/cjs/_withStableStyle.native.js.map +1 -1
- package/dist/cjs/config.cjs +6 -3
- package/dist/cjs/config.native.cjs +7 -5
- package/dist/cjs/config.native.js +7 -5
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/contexts/ComponentContext.cjs +1 -0
- package/dist/cjs/contexts/ComponentContext.native.cjs +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js +8 -0
- package/dist/cjs/contexts/ComponentContext.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +46 -32
- package/dist/cjs/createComponent.native.cjs +92 -72
- package/dist/cjs/createComponent.native.js +92 -72
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createTamagui.cjs +32 -14
- package/dist/cjs/createTamagui.native.cjs +33 -19
- package/dist/cjs/createTamagui.native.js +33 -19
- package/dist/cjs/createTamagui.native.js.map +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -5
- package/dist/cjs/createTokens.native.js +1 -5
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.native.cjs +1 -5
- package/dist/cjs/createVariable.native.js +1 -5
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/createVariables.native.cjs +2 -6
- package/dist/cjs/createVariables.native.js +2 -6
- package/dist/cjs/createVariables.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +87 -329
- package/dist/cjs/dom/html.native.cjs +53 -2
- package/dist/cjs/dom/html.native.js +53 -2
- package/dist/cjs/dom/html.native.js.map +1 -1
- package/dist/cjs/{helpers/timer.native.js → dom/htmlReset.cjs} +6 -12
- package/dist/cjs/{helpers/timer.native.cjs → dom/htmlReset.native.cjs} +6 -8
- package/dist/cjs/dom/htmlReset.native.js +30 -0
- package/dist/cjs/dom/htmlReset.native.js.map +1 -0
- package/dist/cjs/dom/htmlRuntime.native.cjs +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js +4 -0
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/htmlStaticConfig.cjs +44 -0
- package/dist/cjs/dom/htmlStaticConfig.native.cjs +46 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js +48 -0
- package/dist/cjs/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/cjs/dom/primitives.native.cjs +81 -34
- package/dist/cjs/dom/primitives.native.js +81 -34
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/eventHandling.cjs +10 -4
- package/dist/cjs/eventHandling.native.cjs +52 -16
- package/dist/cjs/eventHandling.native.js +52 -16
- package/dist/cjs/eventHandling.native.js.map +1 -1
- package/dist/cjs/helpers/NativeTextBinding.cjs +36 -0
- package/dist/cjs/helpers/NativeTextBinding.native.cjs +39 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js +41 -0
- package/dist/cjs/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/cjs/helpers/configVariables.native.cjs +2 -6
- package/dist/cjs/helpers/configVariables.native.js +2 -6
- package/dist/cjs/helpers/configVariables.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +14 -10
- package/dist/cjs/helpers/createDesignSystem.native.cjs +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js +5 -4
- package/dist/cjs/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/cjs/helpers/createStyledContext.native.cjs +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js +1 -5
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyle.cjs +45 -1
- package/dist/cjs/helpers/expandStyle.native.cjs +38 -2
- package/dist/cjs/helpers/expandStyle.native.js +38 -2
- package/dist/cjs/helpers/expandStyle.native.js.map +1 -1
- package/dist/cjs/helpers/expandStyles.cjs +15 -3
- package/dist/cjs/helpers/expandStyles.native.cjs +14 -8
- package/dist/cjs/helpers/expandStyles.native.js +14 -8
- package/dist/cjs/helpers/expandStyles.native.js.map +1 -1
- package/dist/cjs/helpers/fluid.cjs +56 -0
- package/dist/cjs/helpers/fluid.native.cjs +58 -0
- package/dist/cjs/helpers/fluid.native.js +60 -0
- package/dist/cjs/helpers/fluid.native.js.map +1 -0
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +2 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +6 -6
- package/dist/cjs/helpers/getSplitStyles.cjs +366 -150
- package/dist/cjs/helpers/getSplitStyles.native.cjs +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js +584 -184
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/getThemeCSSRules.cjs +37 -25
- package/dist/cjs/helpers/grammarConfig.cjs +6 -14
- package/dist/cjs/helpers/grammarConfig.native.cjs +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js +32 -22
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +11 -4
- package/dist/cjs/helpers/insertStyleRule.native.cjs +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js +8 -11
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/isObj.native.cjs +1 -5
- package/dist/cjs/helpers/isObj.native.js +1 -5
- package/dist/cjs/helpers/isObj.native.js.map +1 -1
- package/dist/cjs/helpers/mainThreadPressEvents.native.cjs +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/cjs/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/cjs/helpers/mergeProps.cjs +18 -21
- package/dist/cjs/helpers/mergeProps.native.cjs +20 -23
- package/dist/cjs/helpers/mergeProps.native.js +20 -23
- package/dist/cjs/helpers/mergeProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeTextMetrics.cjs +74 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.cjs +77 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js +79 -0
- package/dist/cjs/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/cjs/helpers/normalizeColor.native.cjs +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js +17 -2
- package/dist/cjs/helpers/normalizeColor.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +2 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/objectIdentityKey.native.cjs +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js +1 -5
- package/dist/cjs/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/cjs/helpers/parseNativeStyle.cjs +187 -0
- package/dist/cjs/helpers/parseNativeStyle.native.cjs +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js +6 -4
- package/dist/cjs/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/cjs/helpers/proxyThemeToParents.cjs +9 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.cjs +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js +28 -2
- package/dist/cjs/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/cjs/helpers/resolveAnimationDriver.native.cjs +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/cjs/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/cjs/helpers/{timer.cjs → resolveNativeUnits.cjs} +12 -8
- package/dist/cjs/helpers/resolveNativeUnits.native.cjs +205 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js +207 -0
- package/dist/cjs/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/cjs/helpers/resolveRem.native.cjs +18 -21
- package/dist/cjs/helpers/resolveRem.native.js +18 -21
- package/dist/cjs/helpers/resolveRem.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSizing.cjs +124 -0
- package/dist/cjs/helpers/resolveSizing.native.cjs +133 -0
- package/dist/cjs/helpers/resolveSizing.native.js +135 -0
- package/dist/cjs/helpers/resolveSizing.native.js.map +1 -0
- package/dist/cjs/helpers/resolveVariableValue.cjs +7 -7
- package/dist/cjs/helpers/resolveVariableValue.native.cjs +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js +7 -9
- package/dist/cjs/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/cjs/helpers/skipProps.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.cjs +0 -1
- package/dist/cjs/helpers/skipProps.native.js +0 -1
- package/dist/cjs/helpers/skipProps.native.js.map +1 -1
- package/dist/cjs/helpers/styleFrontend.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.cjs +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js +23 -1
- package/dist/cjs/helpers/styleFrontend.native.js.map +1 -1
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +5 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/cjs/helpers/styledDynamic.cjs +5 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js +8 -7
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -1
- package/dist/cjs/helpers/subscribeToContextGroup.cjs +16 -7
- package/dist/cjs/helpers/subscribeToContextGroup.native.cjs +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/cjs/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/cjs/helpers/themeRef.native.cjs +1 -5
- package/dist/cjs/helpers/themeRef.native.js +1 -5
- package/dist/cjs/helpers/themeRef.native.js.map +1 -1
- package/dist/cjs/helpers/themes.cjs +26 -11
- package/dist/cjs/helpers/themes.native.cjs +26 -11
- package/dist/cjs/helpers/themes.native.js +26 -11
- package/dist/cjs/helpers/themes.native.js.map +1 -1
- package/dist/cjs/helpers/tokenCategories.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.cjs +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js +2 -2
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variables.cjs +1 -1
- package/dist/cjs/helpers/variables.native.cjs +4 -8
- package/dist/cjs/helpers/variables.native.js +4 -8
- package/dist/cjs/helpers/variables.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -0
- package/dist/cjs/helpers/warnOnce.native.js +6 -0
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/helpers/webPropsToSkip.native.cjs +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js +3 -3
- package/dist/cjs/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/cjs/helpers/wrapStyleTags.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.cjs +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js +1 -1
- package/dist/cjs/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.native.cjs +1 -5
- package/dist/cjs/hooks/useComponentState.native.js +1 -5
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +27 -34
- package/dist/cjs/hooks/useMedia.native.cjs +45 -51
- package/dist/cjs/hooks/useMedia.native.js +45 -51
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.cjs +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js +1 -1
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/hooks/useThemeState.cjs +37 -47
- package/dist/cjs/hooks/useThemeState.native.cjs +44 -50
- package/dist/cjs/hooks/useThemeState.native.js +44 -50
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +7 -0
- package/dist/cjs/index.native.cjs +7 -0
- package/dist/cjs/index.native.js +7 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +22 -0
- package/dist/cjs/internal-runtime.native.cjs +22 -0
- package/dist/cjs/internal-runtime.native.js +22 -0
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.native.cjs +2 -9
- package/dist/cjs/static-resolve.native.js +2 -9
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +1 -1
- package/dist/cjs/style.native.cjs +4 -7
- package/dist/cjs/style.native.js +4 -7
- package/dist/cjs/style.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +10 -17
- package/dist/cjs/views/Theme.native.cjs +9 -11
- package/dist/cjs/views/Theme.native.js +9 -11
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.cjs +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js +1 -1
- package/dist/cjs/views/ThemeUpdate.native.js.map +1 -1
- package/dist/esm/_withNativeStyle.mjs +4 -1
- package/dist/esm/_withNativeStyle.mjs.map +1 -1
- package/dist/esm/_withNativeStyle.native.js +4 -1
- package/dist/esm/_withNativeStyle.native.js.map +1 -1
- package/dist/esm/_withStableStyle.native.js +1 -5
- package/dist/esm/_withStableStyle.native.js.map +1 -1
- package/dist/esm/config.mjs +6 -3
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +7 -5
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/contexts/ComponentContext.mjs +9 -9
- package/dist/esm/contexts/ComponentContext.mjs.map +1 -1
- package/dist/esm/contexts/ComponentContext.native.js +16 -9
- package/dist/esm/contexts/ComponentContext.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +45 -42
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +93 -82
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createTamagui.mjs +33 -15
- package/dist/esm/createTamagui.mjs.map +1 -1
- package/dist/esm/createTamagui.native.js +34 -20
- package/dist/esm/createTamagui.native.js.map +1 -1
- package/dist/esm/createTokens.native.js +1 -5
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.native.js +1 -5
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/createVariables.native.js +2 -6
- package/dist/esm/createVariables.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +87 -329
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/html.native.js +53 -2
- package/dist/esm/dom/html.native.js.map +1 -1
- package/dist/esm/dom/htmlReset.mjs +6 -0
- package/dist/esm/dom/htmlReset.mjs.map +1 -0
- package/dist/esm/dom/htmlReset.native.js +6 -0
- package/dist/esm/dom/htmlReset.native.js.map +1 -0
- package/dist/esm/dom/htmlRuntime.native.js +4 -0
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/htmlStaticConfig.mjs +22 -0
- package/dist/esm/dom/htmlStaticConfig.mjs.map +1 -0
- package/dist/esm/dom/htmlStaticConfig.native.js +22 -0
- package/dist/esm/dom/htmlStaticConfig.native.js.map +1 -0
- package/dist/esm/dom/primitives.native.js +81 -34
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/eventHandling.mjs +10 -4
- package/dist/esm/eventHandling.mjs.map +1 -1
- package/dist/esm/eventHandling.native.js +52 -16
- package/dist/esm/eventHandling.native.js.map +1 -1
- package/dist/esm/helpers/NativeTextBinding.mjs +17 -0
- package/dist/esm/helpers/NativeTextBinding.mjs.map +1 -0
- package/dist/esm/helpers/NativeTextBinding.native.js +18 -0
- package/dist/esm/helpers/NativeTextBinding.native.js.map +1 -0
- package/dist/esm/helpers/configVariables.native.js +2 -6
- package/dist/esm/helpers/configVariables.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +14 -10
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createDesignSystem.native.js +4 -4
- package/dist/esm/helpers/createDesignSystem.native.js.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +1 -5
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/expandStyle.mjs +41 -1
- package/dist/esm/helpers/expandStyle.mjs.map +1 -1
- package/dist/esm/helpers/expandStyle.native.js +36 -3
- package/dist/esm/helpers/expandStyle.native.js.map +1 -1
- package/dist/esm/helpers/expandStyles.mjs +15 -3
- package/dist/esm/helpers/expandStyles.mjs.map +1 -1
- package/dist/esm/helpers/expandStyles.native.js +14 -8
- package/dist/esm/helpers/expandStyles.native.js.map +1 -1
- package/dist/esm/helpers/fluid.mjs +36 -0
- package/dist/esm/helpers/fluid.mjs.map +1 -0
- package/dist/esm/helpers/fluid.native.js +36 -0
- package/dist/esm/helpers/fluid.native.js.map +1 -0
- package/dist/esm/helpers/formatDiagnostic.native.js +2 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +6 -6
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +364 -150
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +588 -188
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/getThemeCSSRules.mjs +37 -25
- package/dist/esm/helpers/getThemeCSSRules.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +6 -14
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +32 -22
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +11 -4
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +4 -4
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/isObj.native.js +1 -5
- package/dist/esm/helpers/isObj.native.js.map +1 -1
- package/dist/esm/helpers/mainThreadPressEvents.native.js +48 -100
- package/dist/esm/helpers/mainThreadPressEvents.native.js.map +1 -1
- package/dist/esm/helpers/mergeProps.mjs +18 -21
- package/dist/esm/helpers/mergeProps.mjs.map +1 -1
- package/dist/esm/helpers/mergeProps.native.js +20 -23
- package/dist/esm/helpers/mergeProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeTextMetrics.mjs +55 -0
- package/dist/esm/helpers/nativeTextMetrics.mjs.map +1 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js +56 -0
- package/dist/esm/helpers/nativeTextMetrics.native.js.map +1 -0
- package/dist/esm/helpers/normalizeColor.native.js +17 -2
- package/dist/esm/helpers/normalizeColor.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +2 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +3 -6
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/objectIdentityKey.native.js +1 -5
- package/dist/esm/helpers/objectIdentityKey.native.js.map +1 -1
- package/dist/esm/helpers/parseNativeStyle.mjs +168 -0
- package/dist/esm/helpers/parseNativeStyle.mjs.map +1 -0
- package/dist/esm/helpers/parseNativeStyle.native.js +4 -1
- package/dist/esm/helpers/parseNativeStyle.native.js.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.mjs +10 -2
- package/dist/esm/helpers/proxyThemeToParents.mjs.map +1 -1
- package/dist/esm/helpers/proxyThemeToParents.native.js +29 -2
- package/dist/esm/helpers/proxyThemeToParents.native.js.map +1 -1
- package/dist/esm/helpers/resolveAnimationDriver.native.js +1 -5
- package/dist/esm/helpers/resolveAnimationDriver.native.js.map +1 -1
- package/dist/esm/helpers/resolveNativeUnits.mjs +9 -0
- package/dist/esm/helpers/resolveNativeUnits.mjs.map +1 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js +178 -0
- package/dist/esm/helpers/resolveNativeUnits.native.js.map +1 -0
- package/dist/esm/helpers/resolveRem.native.js +18 -21
- package/dist/esm/helpers/resolveRem.native.js.map +1 -1
- package/dist/esm/helpers/resolveSizing.mjs +102 -0
- package/dist/esm/helpers/resolveSizing.mjs.map +1 -0
- package/dist/esm/helpers/resolveSizing.native.js +109 -0
- package/dist/esm/helpers/resolveSizing.native.js.map +1 -0
- package/dist/esm/helpers/resolveVariableValue.mjs +7 -7
- package/dist/esm/helpers/resolveVariableValue.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariableValue.native.js +7 -9
- package/dist/esm/helpers/resolveVariableValue.native.js.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.native.js +2 -6
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -1
- package/dist/esm/helpers/skipProps.mjs +0 -1
- package/dist/esm/helpers/skipProps.mjs.map +1 -1
- package/dist/esm/helpers/skipProps.native.js +0 -1
- package/dist/esm/helpers/skipProps.native.js.map +1 -1
- package/dist/esm/helpers/styleFrontend.mjs +20 -1
- package/dist/esm/helpers/styleFrontend.mjs.map +1 -1
- package/dist/esm/helpers/styleFrontend.native.js +20 -1
- package/dist/esm/helpers/styleFrontend.native.js.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.mjs +5 -4
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.native.js +7 -4
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -1
- package/dist/esm/helpers/styledDynamic.mjs +5 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -1
- package/dist/esm/helpers/styledDynamic.native.js +8 -7
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.mjs +16 -7
- package/dist/esm/helpers/subscribeToContextGroup.mjs.map +1 -1
- package/dist/esm/helpers/subscribeToContextGroup.native.js +18 -8
- package/dist/esm/helpers/subscribeToContextGroup.native.js.map +1 -1
- package/dist/esm/helpers/themeRef.native.js +1 -5
- package/dist/esm/helpers/themeRef.native.js.map +1 -1
- package/dist/esm/helpers/themes.mjs +20 -11
- package/dist/esm/helpers/themes.mjs.map +1 -1
- package/dist/esm/helpers/themes.native.js +20 -11
- package/dist/esm/helpers/themes.native.js.map +1 -1
- package/dist/esm/helpers/tokenCategories.mjs +2 -2
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +2 -2
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variables.mjs +1 -1
- package/dist/esm/helpers/variables.mjs.map +1 -1
- package/dist/esm/helpers/variables.native.js +4 -8
- package/dist/esm/helpers/variables.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +6 -1
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -1
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/helpers/webPropsToSkip.native.js +3 -3
- package/dist/esm/helpers/webPropsToSkip.native.js.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs +1 -1
- package/dist/esm/helpers/wrapStyleTags.mjs.map +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js +1 -1
- package/dist/esm/helpers/wrapStyleTags.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +1 -5
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +27 -34
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +45 -51
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useThemeState.mjs +36 -48
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +44 -50
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/index.mjs +4 -1
- package/dist/esm/index.native.js +4 -1
- package/dist/esm/internal-runtime.mjs +22 -3
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +22 -3
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.native.js +2 -9
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +1 -1
- package/dist/esm/style.mjs.map +1 -1
- package/dist/esm/style.native.js +4 -7
- package/dist/esm/style.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +15 -14
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +15 -15
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -1
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.mjs +1 -1
- package/dist/esm/views/ThemeUpdate.mjs.map +1 -1
- package/dist/esm/views/ThemeUpdate.native.js +1 -1
- package/dist/esm/views/ThemeUpdate.native.js.map +1 -1
- package/package.json +20 -18
- package/reset.css +11 -0
- package/src/_withNativeStyle.tsx +6 -1
- package/src/config.ts +6 -6
- package/src/contexts/ComponentContext.tsx +8 -0
- package/src/createComponent.tsx +177 -57
- package/src/createStyledHOC.tsx +25 -26
- package/src/createTamagui.ts +47 -28
- package/src/dom/contract.ts +4 -1
- package/src/dom/html.native.tsx +55 -2
- package/src/dom/html.tsx +189 -388
- package/src/dom/htmlReset.ts +15 -0
- package/src/dom/htmlRuntime.native.tsx +5 -0
- package/src/dom/htmlStaticConfig.ts +40 -0
- package/src/dom/primitives.native.tsx +138 -33
- package/src/dom/standalone.ts +2 -1
- package/src/dom/styleTypes.ts +82 -92
- package/src/eventHandling.native.ts +61 -11
- package/src/eventHandling.ts +19 -4
- package/src/helpers/NativeTextBinding.tsx +26 -0
- package/src/helpers/createDesignSystem.ts +24 -8
- package/src/helpers/expandStyle.ts +88 -4
- package/src/helpers/expandStyles.ts +6 -11
- package/src/helpers/fluid.ts +66 -0
- package/src/helpers/getCSSStylesAtomic.ts +11 -6
- package/src/helpers/getSplitStyles.tsx +1032 -296
- package/src/helpers/getThemeCSSRules.ts +73 -35
- package/src/helpers/grammarConfig.ts +23 -8
- package/src/helpers/insertStyleRule.tsx +14 -8
- package/src/helpers/mainThreadPressEvents.native.ts +65 -141
- package/src/helpers/mergeProps.ts +29 -62
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeTextMetrics.ts +77 -0
- package/src/helpers/normalizeColor.native.ts +29 -4
- package/src/helpers/normalizeValueWithProperty.ts +2 -1
- package/src/helpers/{parseNativeStyle.native.ts → parseNativeStyle.ts} +8 -1
- package/src/helpers/proxyThemeToParents.ts +13 -2
- package/src/helpers/resolveNativeUnits.native.ts +247 -0
- package/src/helpers/resolveNativeUnits.ts +10 -0
- package/src/helpers/resolveRem.native.ts +25 -26
- package/src/helpers/resolveSizing.ts +167 -0
- package/src/helpers/resolveVariableValue.ts +21 -17
- package/src/helpers/skipProps.ts +0 -1
- package/src/helpers/styleFrontend.ts +39 -0
- package/src/helpers/styleProvenance.ts +1 -1
- package/src/helpers/styleStaticConfigCore.ts +15 -4
- package/src/helpers/styledDynamic.ts +3 -1
- package/src/helpers/subscribeToContextGroup.tsx +16 -7
- package/src/helpers/themes.ts +27 -11
- package/src/helpers/tokenCategories.ts +15 -3
- package/src/helpers/variables.ts +2 -2
- package/src/helpers/warnOnce.ts +6 -0
- package/src/helpers/webPropsToSkip.native.ts +9 -3
- package/src/helpers/wrapStyleTags.tsx +4 -1
- package/src/hooks/useMedia.tsx +36 -47
- package/src/hooks/useSplitStyles.tsx +4 -1
- package/src/hooks/useThemeState.ts +69 -74
- package/src/index.ts +13 -0
- package/src/interfaces/RNExclusiveTypes.ts +1 -3
- package/src/internal-runtime.ts +43 -2
- package/src/style.ts +4 -1
- package/src/styled.tsx +34 -3
- package/src/types.tsx +412 -132
- package/src/views/Theme.tsx +18 -21
- package/src/views/ThemeDebug.tsx +1 -1
- package/src/views/ThemeUpdate.tsx +1 -1
- package/types/_withNativeStyle.d.ts.map +1 -1
- package/types/config.d.ts.map +1 -1
- package/types/contexts/ComponentContext.d.ts +1 -1
- package/types/contexts/ComponentContext.d.ts.map +1 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +5 -2
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createTamagui.d.ts.map +1 -1
- package/types/dom/contract.d.ts +4 -1
- package/types/dom/contract.d.ts.map +1 -1
- package/types/dom/html.d.ts +60 -51
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/html.native.d.ts.map +1 -1
- package/types/dom/htmlReset.d.ts +10 -0
- package/types/dom/htmlReset.d.ts.map +1 -0
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/htmlStaticConfig.d.ts +22 -0
- package/types/dom/htmlStaticConfig.d.ts.map +1 -0
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/dom/standalone.d.ts +2 -1
- package/types/dom/standalone.d.ts.map +1 -1
- package/types/dom/styleTypes.d.ts +63 -84
- package/types/dom/styleTypes.d.ts.map +1 -1
- package/types/eventHandling.d.ts +12 -4
- package/types/eventHandling.d.ts.map +1 -1
- package/types/eventHandling.native.d.ts.map +1 -1
- package/types/helpers/NativeTextBinding.d.ts +11 -0
- package/types/helpers/NativeTextBinding.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/expandStyle.d.ts +1 -0
- package/types/helpers/expandStyle.d.ts.map +1 -1
- package/types/helpers/expandStyles.d.ts.map +1 -1
- package/types/helpers/fluid.d.ts +21 -0
- package/types/helpers/fluid.d.ts.map +1 -0
- package/types/helpers/getCSSStylesAtomic.d.ts +3 -1
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +2 -1
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/getThemeCSSRules.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/mainThreadPressEvents.native.d.ts +0 -7
- package/types/helpers/mainThreadPressEvents.native.d.ts.map +1 -1
- package/types/helpers/mergeProps.d.ts +1 -15
- package/types/helpers/mergeProps.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts +0 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeTextMetrics.d.ts +16 -0
- package/types/helpers/nativeTextMetrics.d.ts.map +1 -0
- package/types/helpers/normalizeColor.native.d.ts +4 -1
- package/types/helpers/normalizeColor.native.d.ts.map +1 -1
- package/types/helpers/normalizeShadow.native.d.ts +3 -1
- package/types/helpers/normalizeShadow.native.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/{parseNativeStyle.native.d.ts → parseNativeStyle.d.ts} +1 -1
- package/types/helpers/parseNativeStyle.d.ts.map +1 -0
- package/types/helpers/proxyThemeToParents.d.ts +1 -1
- package/types/helpers/proxyThemeToParents.d.ts.map +1 -1
- package/types/helpers/resolveNativeUnits.d.ts +6 -0
- package/types/helpers/resolveNativeUnits.d.ts.map +1 -0
- package/types/helpers/resolveNativeUnits.native.d.ts +16 -0
- package/types/helpers/resolveNativeUnits.native.d.ts.map +1 -0
- package/types/helpers/resolveRem.native.d.ts +6 -4
- package/types/helpers/resolveRem.native.d.ts.map +1 -1
- package/types/helpers/resolveSizing.d.ts +90 -0
- package/types/helpers/resolveSizing.d.ts.map +1 -0
- package/types/helpers/resolveVariableValue.d.ts.map +1 -1
- package/types/helpers/skipProps.d.ts +0 -1
- package/types/helpers/skipProps.d.ts.map +1 -1
- package/types/helpers/styleFrontend.d.ts +21 -0
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleProvenance.d.ts +1 -1
- package/types/helpers/styleProvenance.d.ts.map +1 -1
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -1
- package/types/helpers/styledDynamic.d.ts +1 -1
- package/types/helpers/styledDynamic.d.ts.map +1 -1
- package/types/helpers/themes.d.ts +4 -0
- package/types/helpers/themes.d.ts.map +1 -1
- package/types/helpers/tokenCategories.d.ts +1 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts +1 -0
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +6 -2
- package/types/helpers/webPropsToSkip.native.d.ts.map +1 -1
- package/types/helpers/wrapStyleTags.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts +5 -2
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +4 -1
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/RNExclusiveTypes.d.ts +2 -3
- package/types/interfaces/RNExclusiveTypes.d.ts.map +1 -1
- package/types/internal-runtime.d.ts +12 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/style.d.ts.map +1 -1
- package/types/styled.d.ts +7 -4
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +258 -102
- package/types/types.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/dist/cjs/helpers/timer.native.js.map +0 -1
- package/dist/esm/helpers/timer.mjs +0 -13
- package/dist/esm/helpers/timer.mjs.map +0 -1
- package/dist/esm/helpers/timer.native.js +0 -13
- package/dist/esm/helpers/timer.native.js.map +0 -1
- package/src/helpers/timer.ts +0 -9
- package/types/helpers/parseNativeStyle.native.d.ts.map +0 -1
- package/types/helpers/timer.d.ts +0 -2
- package/types/helpers/timer.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport { ensureThemeVariable as ensureThemeVariableImpl
|
|
1
|
+
{"version":3,"file":"internal-runtime.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","copyAuthoredThemeSchemeImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { html } from \"./dom/html\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport {\n copyAuthoredThemeScheme as copyAuthoredThemeSchemeImpl,\n ensureThemeVariable as ensureThemeVariableImpl\n} from \"./helpers/themes\";\nimport { transformsToString as transformsToStringImpl } from \"./helpers/transformsToString\";\nimport {\n parseFont as parseFontImpl,\n registerFontVariables as registerFontVariablesImpl\n} from \"./insertFont\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { useThemeWithState as useThemeWithStateImpl } from \"./hooks/useTheme\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { mergeFrontendCondition, regularStyleFrontend } from \"./helpers/styleFrontend\";\nconst createVariables = createVariablesImpl;\nconst parseFont = parseFontImpl;\nconst registerFontVariables = registerFontVariablesImpl;\nconst fixStyles = fixStylesImpl;\nconst getThemeCSSRules = getThemeCSSRulesImpl;\nconst normalizeValueWithProperty = normalizeValueWithPropertyImpl;\nconst proxyThemeToParents = proxyThemeToParentsImpl;\nconst ensureThemeVariable = ensureThemeVariableImpl;\nconst copyAuthoredThemeScheme = copyAuthoredThemeSchemeImpl;\nconst transformsToString = transformsToStringImpl;\nconst styleToCSS = styleToCSSImpl;\nconst useThemeWithState = useThemeWithStateImpl;\nconst plainValueToPayload = (value, property) => {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nconst createTamagui = createTamaguiImpl;\nconst setupHooks = setupHooksImpl;\nconst TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend,\n displayName: \"View\"\n }),\n Text: createComponent({\n ...textStaticConfig,\n styleFrontend: frontend,\n displayName: \"Text\"\n })\n };\n}\nfunction createFrontendHTML(frontend) {\n const out = {};\n for (const tag in html) {\n const source = html[tag];\n if (!source.staticConfig) {\n out[tag] = source;\n continue;\n }\n const rebuilt = createComponent({\n ...source.staticConfig,\n styleFrontend: frontend,\n displayName: tag\n });\n out[tag] = source.rebindDOMTag ? source.rebindDOMTag(rebuilt) : rebuilt;\n }\n return out;\n}\nexport {\n TamaguiProvider,\n copyAuthoredThemeScheme,\n createFrontendHTML,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n mergeFrontendCondition,\n normalizeValueWithProperty,\n parseFont,\n plainValueToPayload,\n proxyThemeToParents,\n registerFontVariables,\n regularStyleFrontend,\n setupHooks,\n styleToCSS,\n transformsToString,\n useThemeWithState\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,kBAAkBA;AACxB,MAAM,YAAYC;AAClB,MAAM,wBAAwBC;AAC9B,MAAM,YAAYC;AAClB,MAAM,mBAAmBC;AACzB,MAAM,6BAA6BC;AACnC,MAAM,sBAAsBC;AAC5B,MAAM,sBAAsBC;AAC5B,MAAM,0BAA0BC;AAChC,MAAM,qBAAqBC;AAC3B,MAAM,aAAaC;AACnB,MAAM,oBAAoBC;AAC1B,MAAM,uBAAuB,OAAO,aAAa;CAC/C,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,MAAM,gBAAgBC;AACtB,MAAM,aAAaC;AACnB,MAAM,kBAAkBC;AACxB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;EACD,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;CACH;AACF;AACA,SAAS,mBAAmB,UAAU;CACpC,MAAM,MAAM,CAAC;CACb,KAAK,MAAM,OAAO,MAAM;EACtB,MAAM,SAAS,KAAK;EACpB,IAAI,CAAC,OAAO,cAAc;GACxB,IAAI,OAAO;GACX;EACF;EACA,MAAM,UAAU,gBAAgB;GAC9B,GAAG,OAAO;GACV,eAAe;GACf,aAAa;EACf,CAAC;EACD,IAAI,OAAO,OAAO,eAAe,OAAO,aAAa,OAAO,IAAI;CAClE;CACA,OAAO;AACT"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { stylePropsUnitless } from "@tamagui/helpers";
|
|
2
2
|
import { createComponent } from "./createComponent.native.js";
|
|
3
3
|
import { createVariables as createVariables$1 } from "./createVariables.native.js";
|
|
4
|
+
import { html } from "./dom/html.native.js";
|
|
4
5
|
import { fixStyles as fixStyles$1 } from "./helpers/expandStyles.native.js";
|
|
5
6
|
import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.native.js";
|
|
6
7
|
import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.native.js";
|
|
7
8
|
import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.native.js";
|
|
8
9
|
import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.native.js";
|
|
9
|
-
import { ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.native.js";
|
|
10
|
+
import { copyAuthoredThemeScheme as copyAuthoredThemeScheme$1, ensureThemeVariable as ensureThemeVariable$1 } from "./helpers/themes.native.js";
|
|
10
11
|
import { transformsToString as transformsToString$1 } from "./helpers/transformsToString.native.js";
|
|
11
12
|
import { parseFont as parseFont$1, registerFontVariables as registerFontVariables$1 } from "./insertFont.native.js";
|
|
12
13
|
import { createTamagui as createTamagui$1 } from "./createTamagui.native.js";
|
|
@@ -16,7 +17,7 @@ import { useThemeWithState as useThemeWithState$1 } from "./hooks/useTheme.nativ
|
|
|
16
17
|
import { TamaguiProvider as TamaguiProvider$1 } from "./views/TamaguiProvider.native.js";
|
|
17
18
|
import { textStaticConfig } from "./views/Text.native.js";
|
|
18
19
|
import { viewStaticConfig } from "./views/View.native.js";
|
|
19
|
-
import { regularStyleFrontend } from "./helpers/styleFrontend.native.js";
|
|
20
|
+
import { mergeFrontendCondition, regularStyleFrontend } from "./helpers/styleFrontend.native.js";
|
|
20
21
|
|
|
21
22
|
var createVariables = createVariables$1;
|
|
22
23
|
var parseFont = parseFont$1;
|
|
@@ -26,6 +27,7 @@ var getThemeCSSRules = getThemeCSSRules$1;
|
|
|
26
27
|
var normalizeValueWithProperty = normalizeValueWithProperty$1;
|
|
27
28
|
var proxyThemeToParents = proxyThemeToParents$1;
|
|
28
29
|
var ensureThemeVariable = ensureThemeVariable$1;
|
|
30
|
+
var copyAuthoredThemeScheme = copyAuthoredThemeScheme$1;
|
|
29
31
|
var transformsToString = transformsToString$1;
|
|
30
32
|
var styleToCSS = styleToCSS$1;
|
|
31
33
|
var useThemeWithState = useThemeWithState$1;
|
|
@@ -60,6 +62,23 @@ function createFrontendViews(frontend) {
|
|
|
60
62
|
})
|
|
61
63
|
};
|
|
62
64
|
}
|
|
65
|
+
function createFrontendHTML(frontend) {
|
|
66
|
+
var out = {};
|
|
67
|
+
for (var tag in html) {
|
|
68
|
+
var source = html[tag];
|
|
69
|
+
if (!source.staticConfig) {
|
|
70
|
+
out[tag] = source;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
var rebuilt = createComponent({
|
|
74
|
+
...source.staticConfig,
|
|
75
|
+
styleFrontend: frontend,
|
|
76
|
+
displayName: tag
|
|
77
|
+
});
|
|
78
|
+
out[tag] = source.rebindDOMTag ? source.rebindDOMTag(rebuilt) : rebuilt;
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
63
82
|
|
|
64
|
-
export { TamaguiProvider, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
|
|
83
|
+
export { TamaguiProvider, copyAuthoredThemeScheme, createFrontendHTML, createFrontendStyled, createFrontendViews, createTamagui, createVariables, ensureThemeVariable, fixStyles, getThemeCSSRules, mergeFrontendCondition, normalizeValueWithProperty, parseFont, plainValueToPayload, proxyThemeToParents, registerFontVariables, regularStyleFrontend, setupHooks, styleToCSS, transformsToString, useThemeWithState };
|
|
65
84
|
//# sourceMappingURL=internal-runtime.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.native.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport { ensureThemeVariable as ensureThemeVariableImpl } from \"./helpers/themes\";\nimport { transformsToString as transformsToStringImpl } from \"./helpers/transformsToString\";\nimport { parseFont as parseFontImpl, registerFontVariables as registerFontVariablesImpl } from \"./insertFont\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { useThemeWithState as useThemeWithStateImpl } from \"./hooks/useTheme\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { regularStyleFrontend } from \"./helpers/styleFrontend\";\nvar createVariables = createVariablesImpl;\nvar parseFont = parseFontImpl;\nvar registerFontVariables = registerFontVariablesImpl;\nvar fixStyles = fixStylesImpl;\nvar getThemeCSSRules = getThemeCSSRulesImpl;\nvar normalizeValueWithProperty = normalizeValueWithPropertyImpl;\nvar proxyThemeToParents = proxyThemeToParentsImpl;\nvar ensureThemeVariable = ensureThemeVariableImpl;\nvar transformsToString = transformsToStringImpl;\nvar styleToCSS = styleToCSSImpl;\nvar useThemeWithState = useThemeWithStateImpl;\nvar plainValueToPayload = function(value, property) {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = createTamaguiImpl;\nvar setupHooks = setupHooksImpl;\nvar TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend,\n displayName: \"View\"\n }),\n Text: createComponent({\n ...textStaticConfig,\n styleFrontend: frontend,\n displayName: \"Text\"\n })\n };\n}\nexport {\n TamaguiProvider,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n normalizeValueWithProperty,\n parseFont,\n plainValueToPayload,\n proxyThemeToParents,\n registerFontVariables,\n regularStyleFrontend,\n setupHooks,\n styleToCSS,\n transformsToString,\n useThemeWithState\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"internal-runtime.native.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","copyAuthoredThemeSchemeImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { html } from \"./dom/html\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport { copyAuthoredThemeScheme as copyAuthoredThemeSchemeImpl, ensureThemeVariable as ensureThemeVariableImpl } from \"./helpers/themes\";\nimport { transformsToString as transformsToStringImpl } from \"./helpers/transformsToString\";\nimport { parseFont as parseFontImpl, registerFontVariables as registerFontVariablesImpl } from \"./insertFont\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { useThemeWithState as useThemeWithStateImpl } from \"./hooks/useTheme\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { mergeFrontendCondition, regularStyleFrontend } from \"./helpers/styleFrontend\";\nvar createVariables = createVariablesImpl;\nvar parseFont = parseFontImpl;\nvar registerFontVariables = registerFontVariablesImpl;\nvar fixStyles = fixStylesImpl;\nvar getThemeCSSRules = getThemeCSSRulesImpl;\nvar normalizeValueWithProperty = normalizeValueWithPropertyImpl;\nvar proxyThemeToParents = proxyThemeToParentsImpl;\nvar ensureThemeVariable = ensureThemeVariableImpl;\nvar copyAuthoredThemeScheme = copyAuthoredThemeSchemeImpl;\nvar transformsToString = transformsToStringImpl;\nvar styleToCSS = styleToCSSImpl;\nvar useThemeWithState = useThemeWithStateImpl;\nvar plainValueToPayload = function(value, property) {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = createTamaguiImpl;\nvar setupHooks = setupHooksImpl;\nvar TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend,\n displayName: \"View\"\n }),\n Text: createComponent({\n ...textStaticConfig,\n styleFrontend: frontend,\n displayName: \"Text\"\n })\n };\n}\nfunction createFrontendHTML(frontend) {\n var out = {};\n for (var tag in html) {\n var source = html[tag];\n if (!source.staticConfig) {\n out[tag] = source;\n continue;\n }\n var rebuilt = createComponent({\n ...source.staticConfig,\n styleFrontend: frontend,\n displayName: tag\n });\n out[tag] = source.rebindDOMTag ? source.rebindDOMTag(rebuilt) : rebuilt;\n }\n return out;\n}\nexport {\n TamaguiProvider,\n copyAuthoredThemeScheme,\n createFrontendHTML,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n mergeFrontendCondition,\n normalizeValueWithProperty,\n parseFont,\n plainValueToPayload,\n proxyThemeToParents,\n registerFontVariables,\n regularStyleFrontend,\n setupHooks,\n styleToCSS,\n transformsToString,\n useThemeWithState\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI,kBAAkBA;AACtB,IAAI,YAAYC;AAChB,IAAI,wBAAwBC;AAC5B,IAAI,YAAYC;AAChB,IAAI,mBAAmBC;AACvB,IAAI,6BAA6BC;AACjC,IAAI,sBAAsBC;AAC1B,IAAI,sBAAsBC;AAC1B,IAAI,0BAA0BC;AAC9B,IAAI,qBAAqBC;AACzB,IAAI,aAAaC;AACjB,IAAI,oBAAoBC;AACxB,IAAI,sBAAsB,SAAS,OAAO,UAAU;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,IAAI,gBAAgBC;AACpB,IAAI,aAAaC;AACjB,IAAI,kBAAkBC;AACtB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;EACD,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;CACH;AACF;AACA,SAAS,mBAAmB,UAAU;CACpC,IAAI,MAAM,CAAC;CACX,KAAK,IAAI,OAAO,MAAM;EACpB,IAAI,SAAS,KAAK;EAClB,IAAI,CAAC,OAAO,cAAc;GACxB,IAAI,OAAO;GACX;EACF;EACA,IAAI,UAAU,gBAAgB;GAC5B,GAAG,OAAO;GACV,eAAe;GACf,aAAa;EACf,CAAC;EACD,IAAI,OAAO,OAAO,eAAe,OAAO,aAAa,OAAO,IAAI;CAClE;CACA,OAAO;AACT"}
|
|
@@ -5,13 +5,6 @@ import { getSplitStyles } from "./helpers/getSplitStyles.native.js";
|
|
|
5
5
|
import { getStyleStaticConfig } from "./helpers/styleStaticConfig.native.js";
|
|
6
6
|
import { mergeComponentProps } from "./helpers/mergeProps.native.js";
|
|
7
7
|
|
|
8
|
-
function _instanceof(left, right) {
|
|
9
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
10
|
-
return !!right[Symbol.hasInstance](left);
|
|
11
|
-
} else {
|
|
12
|
-
return left instanceof right;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
8
|
var DEFAULT_COMPONENT_STATE = {
|
|
16
9
|
hover: false,
|
|
17
10
|
focus: false,
|
|
@@ -118,7 +111,7 @@ function resolveStaticElement(element) {
|
|
|
118
111
|
}
|
|
119
112
|
if (target === "native") {
|
|
120
113
|
var _split_programLifecycleStyleKeys_enter, _split_programLifecycleStyleKeys, _split_programLifecycleStyleKeys_exit, _split_programLifecycleStyleKeys1;
|
|
121
|
-
var hasMedia = split.hasMedia === true ||
|
|
114
|
+
var hasMedia = split.hasMedia === true || split.hasMedia instanceof Set && split.hasMedia.size > 0;
|
|
122
115
|
var hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);
|
|
123
116
|
if (hasMedia || hasPseudo) {
|
|
124
117
|
return {
|
|
@@ -172,7 +165,7 @@ function resolveStaticElement(element) {
|
|
|
172
165
|
css: css.length > 0 ? css : void 0,
|
|
173
166
|
style: split.style || ((_split_viewProps1 = split.viewProps) === null || _split_viewProps1 === void 0 ? void 0 : _split_viewProps1.style) || null,
|
|
174
167
|
viewProps: split.viewProps,
|
|
175
|
-
hasMedia:
|
|
168
|
+
hasMedia: split.hasMedia instanceof Set ? Array.from(split.hasMedia) : split.hasMedia || void 0,
|
|
176
169
|
pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,
|
|
177
170
|
mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,
|
|
178
171
|
programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-resolve.native.js","names":["validStylesView"],"sources":["esm/static-resolve.native.js"],"sourcesContent":["import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsInput, stylePropsText, validStyles as validStylesView } from \"@tamagui/helpers\";\nimport { getConfig, getConfigMaybe, getThemes, getToken, getTokens, getTokenValue, setConfig, updateConfig } from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles } from \"./helpers/getSplitStyles\";\nimport { getStyleStaticConfig } from \"./helpers/styleStaticConfig\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\nvar DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nvar getGlobalProcessEnv = function() {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch (e) {\n return void 0;\n }\n};\nfunction resolveStaticElement(element) {\n var target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"web\", defaultThemeName = arguments.length > 2 ? arguments[2] : void 0;\n var _element_staticConfig, _element_staticConfig1, _element_options, _element_options1, _element_options2, _element_options3, _element_staticConfig_Component, _element_staticConfig2, _split_viewProps, _split_viewProps1;\n var conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n var themes = conf.themes || {};\n var themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n var theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n var baseStaticConfig = {\n validStyles: ((_element_staticConfig = element.staticConfig) === null || _element_staticConfig === void 0 ? void 0 : _element_staticConfig.isInput) ? stylePropsInput : ((_element_staticConfig1 = element.staticConfig) === null || _element_staticConfig1 === void 0 ? void 0 : _element_staticConfig1.isText) ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && {\n isReactNative: true\n },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n var styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);\n var elementProps = element.props || {};\n var { defaultProps } = styleStaticConfig;\n if (defaultProps) {\n var [merged] = mergeComponentProps(defaultProps, void 0, elementProps);\n elementProps = merged;\n }\n var componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n var _element_options_resolveValues, _element_options_noClass, _element_options_isAnimated, _element_options_displayName, _ref, _ref1;\n var styleProps = {\n isStatic: true,\n resolveValues: (_element_options_resolveValues = (_element_options = element.options) === null || _element_options === void 0 ? void 0 : _element_options.resolveValues) !== null && _element_options_resolveValues !== void 0 ? _element_options_resolveValues : target === \"native\" ? \"except-theme\" : \"variable\",\n noClass: (_element_options_noClass = (_element_options1 = element.options) === null || _element_options1 === void 0 ? void 0 : _element_options1.noClass) !== null && _element_options_noClass !== void 0 ? _element_options_noClass : target === \"native\",\n isAnimated: (_element_options_isAnimated = (_element_options2 = element.options) === null || _element_options2 === void 0 ? void 0 : _element_options2.isAnimated) !== null && _element_options_isAnimated !== void 0 ? _element_options_isAnimated : false,\n displayName: (_ref1 = (_ref = (_element_options_displayName = (_element_options3 = element.options) === null || _element_options3 === void 0 ? void 0 : _element_options3.displayName) !== null && _element_options_displayName !== void 0 ? _element_options_displayName : element.componentName) !== null && _ref !== void 0 ? _ref : (_element_staticConfig2 = element.staticConfig) === null || _element_staticConfig2 === void 0 ? void 0 : (_element_staticConfig_Component = _element_staticConfig2.Component) === null || _element_staticConfig_Component === void 0 ? void 0 : _element_staticConfig_Component.displayName) !== null && _ref1 !== void 0 ? _ref1 : \"TamaguiComponent\"\n };\n var env = getGlobalProcessEnv();\n var prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n var prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n var split = null;\n try {\n split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps, void 0, void 0, void 0, void 0, void 0, void 0, void 0, styleStaticConfig);\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: (err === null || err === void 0 ? void 0 : err.message) || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n var _split_programLifecycleStyleKeys_enter, _split_programLifecycleStyleKeys, _split_programLifecycleStyleKeys_exit, _split_programLifecycleStyleKeys1;\n var hasMedia = split.hasMedia === true || _instanceof(split.hasMedia, Set) && split.hasMedia.size > 0;\n var hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (((_split_programLifecycleStyleKeys = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys === void 0 ? void 0 : (_split_programLifecycleStyleKeys_enter = _split_programLifecycleStyleKeys.enter) === null || _split_programLifecycleStyleKeys_enter === void 0 ? void 0 : _split_programLifecycleStyleKeys_enter.size) || ((_split_programLifecycleStyleKeys1 = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys1 === void 0 ? void 0 : (_split_programLifecycleStyleKeys_exit = _split_programLifecycleStyleKeys1.exit) === null || _split_programLifecycleStyleKeys_exit === void 0 ? void 0 : _split_programLifecycleStyleKeys_exit.size)) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n var rules = [];\n var css = [];\n if (split.rulesToInsert) {\n for (var key in split.rulesToInsert) {\n var ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n var ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (var i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n var classNames = split.classNames || {};\n var classNamesList = Object.values(classNames).filter(Boolean);\n var fullClassName = ((_split_viewProps = split.viewProps) === null || _split_viewProps === void 0 ? void 0 : _split_viewProps.className) || void 0;\n var className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || ((_split_viewProps1 = split.viewProps) === null || _split_viewProps1 === void 0 ? void 0 : _split_viewProps1.style) || null,\n viewProps: split.viewProps,\n hasMedia: _instanceof(split.hasMedia, Set) ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n var target = batch.target || \"web\";\n var defaultThemeName = batch.defaultThemeName;\n var elements = batch.elements || [];\n var results = new Array(elements.length);\n for (var i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return {\n results\n };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n var parsed = JSON.parse(batch);\n var result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingURL=static-resolve.js.map\n"],"mappings":";;;;;;;;AAMA,SAAS,YAAY,MAAM,OAAO;CAChC,IAAI,SAAS,QAAQ,OAAO,WAAW,eAAe,MAAM,OAAO,cAAc;EAC/E,OAAO,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,IAAI;CACzC,OAAO;EACL,OAAO,gBAAgB;CACzB;AACF;AACA,IAAI,0BAA0B;CAC5B,OAAO;CACP,OAAO;CACP,cAAc;CACd,aAAa;CACb,OAAO;CACP,SAAS;CACT,UAAU;CACV,WAAW;AACb;AACA,IAAI,sBAAsB,WAAW;CACnC,IAAI;EACF,OAAO,OAAO,YAAY,eAAe,UAAU,QAAQ,MAAM,KAAK;CACxE,SAAS,GAAG;EACV,OAAO,KAAK;CACd;AACF;AACA,SAAS,qBAAqB,SAAS;CACrC,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,OAAO,mBAAmB,UAAU,SAAS,IAAI,UAAU,KAAK,KAAK;CACnJ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M,KAAK,MAAM,aAAa,IAAI,KAAK;EAC5G,oBAAoB,MAAM;EAC1B,YAAY,MAAM;EAClB,2BAA2B,MAAM,4BAA4B;GAC3D,OAAO,MAAM,0BAA0B,QAAQ,MAAM,KAAK,MAAM,0BAA0B,KAAK,IAAI,KAAK;GACxG,MAAM,MAAM,0BAA0B,OAAO,MAAM,KAAK,MAAM,0BAA0B,IAAI,IAAI,KAAK;EACvG,IAAI,KAAK;CACX;AACF;AACA,SAAS,mBAAmB,OAAO;CACjC,IAAI,SAAS,MAAM,UAAU;CAC7B,IAAI,mBAAmB,MAAM;CAC7B,IAAI,WAAW,MAAM,YAAY,CAAC;CAClC,IAAI,UAAU,IAAI,MAAM,SAAS,MAAM;CACvC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,QAAQ,KAAK,qBAAqB,SAAS,IAAI,QAAQ,gBAAgB;CACzE;CACA,OAAO,EACL,QACF;AACF;AACA,SAAS,cAAc,OAAO;CAC5B,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,SAAS,KAAK,MAAM,KAAK;EAC7B,IAAI,SAAS,mBAAmB,MAAM;EACtC,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,OAAO,mBAAmB,KAAK;AACjC"}
|
|
1
|
+
{"version":3,"file":"static-resolve.native.js","names":["validStylesView"],"sources":["esm/static-resolve.native.js"],"sourcesContent":["import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsInput, stylePropsText, validStyles as validStylesView } from \"@tamagui/helpers\";\nimport { getConfig, getConfigMaybe, getThemes, getToken, getTokens, getTokenValue, setConfig, updateConfig } from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles } from \"./helpers/getSplitStyles\";\nimport { getStyleStaticConfig } from \"./helpers/styleStaticConfig\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nvar DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nvar getGlobalProcessEnv = function() {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch (e) {\n return void 0;\n }\n};\nfunction resolveStaticElement(element) {\n var target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"web\", defaultThemeName = arguments.length > 2 ? arguments[2] : void 0;\n var _element_staticConfig, _element_staticConfig1, _element_options, _element_options1, _element_options2, _element_options3, _element_staticConfig_Component, _element_staticConfig2, _split_viewProps, _split_viewProps1;\n var conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n var themes = conf.themes || {};\n var themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n var theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n var baseStaticConfig = {\n validStyles: ((_element_staticConfig = element.staticConfig) === null || _element_staticConfig === void 0 ? void 0 : _element_staticConfig.isInput) ? stylePropsInput : ((_element_staticConfig1 = element.staticConfig) === null || _element_staticConfig1 === void 0 ? void 0 : _element_staticConfig1.isText) ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && {\n isReactNative: true\n },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n var styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);\n var elementProps = element.props || {};\n var { defaultProps } = styleStaticConfig;\n if (defaultProps) {\n var [merged] = mergeComponentProps(defaultProps, void 0, elementProps);\n elementProps = merged;\n }\n var componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n var _element_options_resolveValues, _element_options_noClass, _element_options_isAnimated, _element_options_displayName, _ref, _ref1;\n var styleProps = {\n isStatic: true,\n resolveValues: (_element_options_resolveValues = (_element_options = element.options) === null || _element_options === void 0 ? void 0 : _element_options.resolveValues) !== null && _element_options_resolveValues !== void 0 ? _element_options_resolveValues : target === \"native\" ? \"except-theme\" : \"variable\",\n noClass: (_element_options_noClass = (_element_options1 = element.options) === null || _element_options1 === void 0 ? void 0 : _element_options1.noClass) !== null && _element_options_noClass !== void 0 ? _element_options_noClass : target === \"native\",\n isAnimated: (_element_options_isAnimated = (_element_options2 = element.options) === null || _element_options2 === void 0 ? void 0 : _element_options2.isAnimated) !== null && _element_options_isAnimated !== void 0 ? _element_options_isAnimated : false,\n displayName: (_ref1 = (_ref = (_element_options_displayName = (_element_options3 = element.options) === null || _element_options3 === void 0 ? void 0 : _element_options3.displayName) !== null && _element_options_displayName !== void 0 ? _element_options_displayName : element.componentName) !== null && _ref !== void 0 ? _ref : (_element_staticConfig2 = element.staticConfig) === null || _element_staticConfig2 === void 0 ? void 0 : (_element_staticConfig_Component = _element_staticConfig2.Component) === null || _element_staticConfig_Component === void 0 ? void 0 : _element_staticConfig_Component.displayName) !== null && _ref1 !== void 0 ? _ref1 : \"TamaguiComponent\"\n };\n var env = getGlobalProcessEnv();\n var prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n var prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n var split = null;\n try {\n split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps, void 0, void 0, void 0, void 0, void 0, void 0, void 0, styleStaticConfig);\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: (err === null || err === void 0 ? void 0 : err.message) || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n var _split_programLifecycleStyleKeys_enter, _split_programLifecycleStyleKeys, _split_programLifecycleStyleKeys_exit, _split_programLifecycleStyleKeys1;\n var hasMedia = split.hasMedia === true || split.hasMedia instanceof Set && split.hasMedia.size > 0;\n var hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (((_split_programLifecycleStyleKeys = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys === void 0 ? void 0 : (_split_programLifecycleStyleKeys_enter = _split_programLifecycleStyleKeys.enter) === null || _split_programLifecycleStyleKeys_enter === void 0 ? void 0 : _split_programLifecycleStyleKeys_enter.size) || ((_split_programLifecycleStyleKeys1 = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys1 === void 0 ? void 0 : (_split_programLifecycleStyleKeys_exit = _split_programLifecycleStyleKeys1.exit) === null || _split_programLifecycleStyleKeys_exit === void 0 ? void 0 : _split_programLifecycleStyleKeys_exit.size)) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n var rules = [];\n var css = [];\n if (split.rulesToInsert) {\n for (var key in split.rulesToInsert) {\n var ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n var ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (var i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n var classNames = split.classNames || {};\n var classNamesList = Object.values(classNames).filter(Boolean);\n var fullClassName = ((_split_viewProps = split.viewProps) === null || _split_viewProps === void 0 ? void 0 : _split_viewProps.className) || void 0;\n var className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || ((_split_viewProps1 = split.viewProps) === null || _split_viewProps1 === void 0 ? void 0 : _split_viewProps1.style) || null,\n viewProps: split.viewProps,\n hasMedia: split.hasMedia instanceof Set ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n var target = batch.target || \"web\";\n var defaultThemeName = batch.defaultThemeName;\n var elements = batch.elements || [];\n var results = new Array(elements.length);\n for (var i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return {\n results\n };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n var parsed = JSON.parse(batch);\n var result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingURL=static-resolve.js.map\n"],"mappings":";;;;;;;;AAMA,IAAI,0BAA0B;CAC5B,OAAO;CACP,OAAO;CACP,cAAc;CACd,aAAa;CACb,OAAO;CACP,SAAS;CACT,UAAU;CACV,WAAW;AACb;AACA,IAAI,sBAAsB,WAAW;CACnC,IAAI;EACF,OAAO,OAAO,YAAY,eAAe,UAAU,QAAQ,MAAM,KAAK;CACxE,SAAS,GAAG;EACV,OAAO,KAAK;CACd;AACF;AACA,SAAS,qBAAqB,SAAS;CACrC,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,OAAO,mBAAmB,UAAU,SAAS,IAAI,UAAU,KAAK,KAAK;CACnJ,IAAI,uBAAuB,wBAAwB,kBAAkB,mBAAmB,mBAAmB,mBAAmB,iCAAiC,wBAAwB,kBAAkB;CACzM,IAAI,OAAO,eAAe;CAC1B,IAAI,CAAC,MAAM;EACT,OAAO;GACL,IAAI,QAAQ;GACZ,IAAI;GACJ,SAAS;IACP,QAAQ;IACR,SAAS;GACX;EACF;CACF;CACA,IAAI,SAAS,KAAK,UAAU,CAAC;CAC7B,IAAI,YAAY,QAAQ,aAAa,qBAAqB,OAAO,WAAW,UAAU,OAAO,KAAK,MAAM,CAAC,CAAC,OAAO;CACjH,IAAI,QAAQ,OAAO,cAAc,OAAO,YAAY,OAAO,WAAW,OAAO,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC;CACnG,IAAI,mBAAmB;EACrB,eAAe,wBAAwB,QAAQ,kBAAkB,QAAQ,0BAA0B,KAAK,IAAI,KAAK,IAAI,sBAAsB,WAAW,oBAAoB,yBAAyB,QAAQ,kBAAkB,QAAQ,2BAA2B,KAAK,IAAI,KAAK,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EAC7B,IAAI,SAAS,KAAK,MAAM,KAAK;EAC7B,IAAI,SAAS,mBAAmB,MAAM;EACtC,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,OAAO,mBAAmB,KAAK;AACjC"}
|
package/dist/esm/style.mjs
CHANGED
|
@@ -44,7 +44,7 @@ function createStylePiece(definition, layer = "style") {
|
|
|
44
44
|
function style(definition) {
|
|
45
45
|
if (process.env.NODE_ENV === "development") {
|
|
46
46
|
const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
47
|
-
if (internals?.
|
|
47
|
+
if (internals?.A?.getOwner?.()) {
|
|
48
48
|
warnOnce("[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.");
|
|
49
49
|
}
|
|
50
50
|
}
|
package/dist/esm/style.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","names":[],"sources":["esm/style.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nlet compileStylePiece;\nlet resolveStylePiece;\nconst uncacheablePieces = /* @__PURE__ */ new WeakSet();\nconst flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (const key in definition) {\n const value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition, layer = \"style\") {\n const piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece?.(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (process.env.NODE_ENV === \"development\") {\n const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals?.
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["esm/style.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nlet compileStylePiece;\nlet resolveStylePiece;\nconst uncacheablePieces = /* @__PURE__ */ new WeakSet();\nconst flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (const key in definition) {\n const value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition, layer = \"style\") {\n const piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece?.(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (process.env.NODE_ENV === \"development\") {\n const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals?.A?.getOwner?.()) {\n warnOnce(\n \"[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.\"\n );\n }\n }\n return createStylePiece(definition);\n}\nfunction resolveStylePieceForTheme(piece, theme, themeName) {\n return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;\n}\nexport {\n createStylePiece,\n isStylePiece,\n isStylePieceCacheable,\n resolveStylePieceForTheme,\n setStylePieceCompiler,\n setStylePieceResolver,\n style\n};\n//# sourceMappingURL=style.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,IAAI;AACJ,MAAM,oCAAoC,IAAI,QAAQ;AACtD,MAAM,oBAAoB;AAC1B,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,oBAAoB;AACrE;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,CAAC,kBAAkB,IAAI,KAAK;AACrC;AACA,SAAS,gBAAgB,YAAY;CACnC,KAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,WAAW;EACzB,IAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,UAAU,UAAU;GACpG,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,YAAY,QAAQ,SAAS;CACrD,MAAM,QAAQ;EACZ,WAAW;GACV,mBAAmB;GAClB,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,IAAI,CAAC,gBAAgB,UAAU,GAAG;EAChC,kBAAkB,IAAI,KAAK;CAC7B;CACA,oBAAoB,OAAO,KAAK;CAChC,OAAO;AACT;AACA,SAAS,MAAM,YAAY;CACzB,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,YAAY,MAAM;EACxB,IAAI,WAAW,GAAG,WAAW,GAAG;GAC9B,SACE,8GACF;EACF;CACF;CACA,OAAO,iBAAiB,UAAU;AACpC;AACA,SAAS,0BAA0B,OAAO,OAAO,WAAW;CAC1D,OAAO,oBAAoB,kBAAkB,OAAO,OAAO,SAAS,IAAI,MAAM,iBAAiB,CAAC;AAClG"}
|
package/dist/esm/style.native.js
CHANGED
|
@@ -2,10 +2,6 @@ import React from "react";
|
|
|
2
2
|
import { stylePieceSymbol } from "./types.native.js";
|
|
3
3
|
import { warnOnce } from "./helpers/warnOnce.native.js";
|
|
4
4
|
|
|
5
|
-
function _type_of(obj) {
|
|
6
|
-
"@swc/helpers - typeof";
|
|
7
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
8
|
-
}
|
|
9
5
|
var compileStylePiece;
|
|
10
6
|
var resolveStylePiece;
|
|
11
7
|
var uncacheablePieces = /* @__PURE__ */ new WeakSet();
|
|
@@ -17,7 +13,7 @@ function setStylePieceResolver(resolver) {
|
|
|
17
13
|
resolveStylePiece = resolver;
|
|
18
14
|
}
|
|
19
15
|
function isStylePiece(value) {
|
|
20
|
-
return !!value &&
|
|
16
|
+
return !!value && typeof value === "object" && stylePieceSymbol in value;
|
|
21
17
|
}
|
|
22
18
|
function isStylePieceCacheable(piece) {
|
|
23
19
|
return !uncacheablePieces.has(piece);
|
|
@@ -25,7 +21,7 @@ function isStylePieceCacheable(piece) {
|
|
|
25
21
|
function canCacheByTheme(definition) {
|
|
26
22
|
for (var key in definition) {
|
|
27
23
|
var value = definition[key];
|
|
28
|
-
if (typeof value === "string" && flatClausePattern.test(value) || value &&
|
|
24
|
+
if (typeof value === "string" && flatClausePattern.test(value) || value && typeof value === "object") {
|
|
29
25
|
return false;
|
|
30
26
|
}
|
|
31
27
|
}
|
|
@@ -48,8 +44,9 @@ function createStylePiece(definition) {
|
|
|
48
44
|
}
|
|
49
45
|
function style(definition) {
|
|
50
46
|
if (process.env.NODE_ENV === "development") {
|
|
47
|
+
var _internals_A_getOwner, _internals_A;
|
|
51
48
|
var internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
52
|
-
if (internals === null || internals === void 0 ? void 0 : internals.
|
|
49
|
+
if (internals === null || internals === void 0 ? void 0 : (_internals_A = internals.A) === null || _internals_A === void 0 ? void 0 : (_internals_A_getOwner = _internals_A.getOwner) === null || _internals_A_getOwner === void 0 ? void 0 : _internals_A_getOwner.call(_internals_A)) {
|
|
53
50
|
warnOnce("[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.");
|
|
54
51
|
}
|
|
55
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.native.js","names":[],"sources":["esm/style.native.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\
|
|
1
|
+
{"version":3,"file":"style.native.js","names":[],"sources":["esm/style.native.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nvar compileStylePiece;\nvar resolveStylePiece;\nvar uncacheablePieces = /* @__PURE__ */ new WeakSet();\nvar flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (var key in definition) {\n var value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition) {\n var layer = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"style\";\n var piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece === null || compileStylePiece === void 0 ? void 0 : compileStylePiece(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (process.env.NODE_ENV === \"development\") {\n var _internals_A_getOwner, _internals_A;\n var internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals === null || internals === void 0 ? void 0 : (_internals_A = internals.A) === null || _internals_A === void 0 ? void 0 : (_internals_A_getOwner = _internals_A.getOwner) === null || _internals_A_getOwner === void 0 ? void 0 : _internals_A_getOwner.call(_internals_A)) {\n warnOnce(\"[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.\");\n }\n }\n return createStylePiece(definition);\n}\nfunction resolveStylePieceForTheme(piece, theme, themeName) {\n return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;\n}\nexport {\n createStylePiece,\n isStylePiece,\n isStylePieceCacheable,\n resolveStylePieceForTheme,\n setStylePieceCompiler,\n setStylePieceResolver,\n style\n};\n//# sourceMappingURL=style.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,IAAI;AACJ,IAAI,oCAAoC,IAAI,QAAQ;AACpD,IAAI,oBAAoB;AACxB,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,oBAAoB;AACrE;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,CAAC,kBAAkB,IAAI,KAAK;AACrC;AACA,SAAS,gBAAgB,YAAY;CACnC,KAAK,IAAI,OAAO,YAAY;EAC1B,IAAI,QAAQ,WAAW;EACvB,IAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,UAAU,UAAU;GACpG,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,YAAY;CACpC,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK;CAC7E,IAAI,QAAQ;EACV,WAAW;GACV,mBAAmB;GAClB,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,IAAI,CAAC,gBAAgB,UAAU,GAAG;EAChC,kBAAkB,IAAI,KAAK;CAC7B;CACA,sBAAsB,QAAQ,sBAAsB,KAAK,IAAI,KAAK,IAAI,kBAAkB,OAAO,KAAK;CACpG,OAAO;AACT;AACA,SAAS,MAAM,YAAY;CACzB,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,IAAI,uBAAuB;EAC3B,IAAI,YAAY,MAAM;EACtB,IAAI,cAAc,QAAQ,cAAc,KAAK,IAAI,KAAK,KAAK,eAAe,UAAU,OAAO,QAAQ,iBAAiB,KAAK,IAAI,KAAK,KAAK,wBAAwB,aAAa,cAAc,QAAQ,0BAA0B,KAAK,IAAI,KAAK,IAAI,sBAAsB,KAAK,YAAY,GAAG;GACtR,SAAS,8GAA8G;EACzH;CACF;CACA,OAAO,iBAAiB,UAAU;AACpC;AACA,SAAS,0BAA0B,OAAO,OAAO,WAAW;CAC1D,OAAO,oBAAoB,kBAAkB,OAAO,OAAO,SAAS,IAAI,MAAM,iBAAiB,CAAC;AAClG"}
|
package/dist/esm/views/Theme.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRefComponent } from "@tamagui/compose-refs";
|
|
2
2
|
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
3
3
|
import { getThemeClassNames, reservedThemeProps } from "@tamagui/helpers";
|
|
4
|
-
import
|
|
4
|
+
import { Children, cloneElement, isValidElement, useRef } from "react";
|
|
5
5
|
import { variableToString } from "../createVariable.mjs";
|
|
6
6
|
import { formatDiagnostic } from "../helpers/formatDiagnostic.mjs";
|
|
7
7
|
import { warnOnce } from "../helpers/warnOnce.mjs";
|
|
@@ -25,10 +25,7 @@ const Theme = createRefComponent(function Theme2(props, ref) {
|
|
|
25
25
|
themeState.theme
|
|
26
26
|
]);
|
|
27
27
|
let finalChildren = props["disable-child-theme"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { ["data-disable-theme"]: true })) : props.children;
|
|
28
|
-
if (ref)
|
|
29
|
-
React.Children.only(finalChildren);
|
|
30
|
-
finalChildren = cloneElement(finalChildren, { ref });
|
|
31
|
-
} catch {}
|
|
28
|
+
if (ref && isValidElement(finalChildren)) finalChildren = cloneElement(finalChildren, { ref });
|
|
32
29
|
const stateRef = useRef({ hasEverThemed: false });
|
|
33
30
|
return getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);
|
|
34
31
|
});
|
|
@@ -47,10 +44,11 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
47
44
|
value: themeState.id,
|
|
48
45
|
children
|
|
49
46
|
});
|
|
50
|
-
const { isInverse
|
|
47
|
+
const { isInverse } = themeState;
|
|
51
48
|
const requiresExtraWrapper = isInverse || forceClassName;
|
|
52
|
-
|
|
53
|
-
if (
|
|
49
|
+
const isFirstThemedRender = !state.hasEverThemed;
|
|
50
|
+
if (isFirstThemedRender) state.hasEverThemed = true;
|
|
51
|
+
if (requiresExtraWrapper || isFirstThemedRender && (themeState.name === "dark" || themeState.name === "light")) state.hasEverThemed = "wrapped";
|
|
54
52
|
if (shallow) if (!themeState.parentId) {} else {
|
|
55
53
|
const parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);
|
|
56
54
|
if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
@@ -86,10 +84,13 @@ function getThemedChildren(themeState, children, props, isRoot = false, stateRef
|
|
|
86
84
|
},
|
|
87
85
|
children
|
|
88
86
|
});
|
|
89
|
-
if (state.hasEverThemed === "wrapped")
|
|
90
|
-
|
|
91
|
-
children
|
|
92
|
-
|
|
87
|
+
if (state.hasEverThemed === "wrapped") {
|
|
88
|
+
const scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;
|
|
89
|
+
children = /* @__PURE__ */ jsx("span", {
|
|
90
|
+
className: scheme ? `t_${scheme} _dsp_contents` : "_dsp_contents",
|
|
91
|
+
children
|
|
92
|
+
});
|
|
93
|
+
}
|
|
93
94
|
return children;
|
|
94
95
|
}
|
|
95
96
|
return children;
|
|
@@ -103,11 +104,11 @@ const empty = {
|
|
|
103
104
|
className: "",
|
|
104
105
|
color: void 0
|
|
105
106
|
};
|
|
106
|
-
function getThemeClassNameAndColor(themeState, props, isRoot
|
|
107
|
+
function getThemeClassNameAndColor(themeState, props, isRoot) {
|
|
107
108
|
if (!themeState.isNew && !props.forceClassName) return empty;
|
|
108
109
|
return {
|
|
109
110
|
color: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : "",
|
|
110
|
-
className: getThemeClassNames(themeState.name, isRoot)
|
|
111
|
+
className: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport
|
|
1
|
+
{"version":3,"file":"Theme.js","names":[],"sources":["esm/views/Theme.js"],"sourcesContent":["import { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\nimport { jsx } from \"react/jsx-runtime\";\n\nconst Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (const key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tconst { passThrough } = props;\n\tconst isRoot = !!props[\"_isRoot\"];\n\tconst [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(() => {}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tlet finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, (child) => passThrough || !isValidElement(child) ? child : cloneElement(child, { [\"data-disable-theme\"]: true })) : props.children;\n\tif (ref && isValidElement(finalChildren)) finalChildren = cloneElement(finalChildren, { ref });\n\tconst stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props, isRoot = false, stateRef, passThrough = false) {\n\tconst { shallow, forceClassName } = props;\n\tconst state = stateRef.current;\n\tlet shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tconst { isInverse } = themeState;\n\tconst requiresExtraWrapper = isInverse || forceClassName;\n\tconst isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tconst parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map((child) => {\n\t\t\treturn isValidElement(child) ? passThrough ? child : cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tconst baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tconst { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tconst inlineClassName = passThrough ? void 0 : props._themeUpdate?.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tconst scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\",\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nconst inertStyle = { display: \"contents\" };\nconst inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nconst empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: themeState?.theme && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC5D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,MAAM,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACnP;CACA,MAAM,EAAE,gBAAgB;CACxB,MAAM,SAAS,CAAC,CAAC,MAAM;CACvB,MAAM,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC7D,gCAAgC,CAAC,GAAG;EACnC,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC;CACD,IAAI,gBAAgB,MAAM,yBAAyB,SAAS,IAAI,MAAM,WAAW,UAAU,eAAe,CAAC,eAAe,KAAK,IAAI,QAAQ,aAAa,OAAO,GAAG,uBAAuB,KAAK,CAAC,CAAC,IAAI,MAAM;CAC1M,IAAI,OAA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react/jsx-runtime";
|
|
|
2
2
|
import { createRefComponent } from "@tamagui/compose-refs";
|
|
3
3
|
import { isWeb, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
4
4
|
import { getThemeClassNames, reservedThemeProps } from "@tamagui/helpers";
|
|
5
|
-
import
|
|
5
|
+
import { Children, cloneElement, isValidElement, useRef } from "react";
|
|
6
6
|
import { variableToString } from "../createVariable.native.js";
|
|
7
7
|
import { formatDiagnostic } from "../helpers/formatDiagnostic.native.js";
|
|
8
8
|
import { removeNativeStyleScope, updateNativeStyleScope } from "../helpers/nativeStyleEngine.native.js";
|
|
@@ -33,10 +33,7 @@ var Theme = createRefComponent(function Theme2(props, ref) {
|
|
|
33
33
|
var finalChildren = props["disable-child-theme"] ? Children.map(props.children, function(child) {
|
|
34
34
|
return passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { ["data-disable-theme"]: true });
|
|
35
35
|
}) : props.children;
|
|
36
|
-
if (ref)
|
|
37
|
-
React.Children.only(finalChildren);
|
|
38
|
-
finalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });
|
|
39
|
-
} catch (e) {}
|
|
36
|
+
if (ref && /* @__PURE__ */ isValidElement(finalChildren)) finalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });
|
|
40
37
|
var stateRef = useRef({ hasEverThemed: false });
|
|
41
38
|
return getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);
|
|
42
39
|
});
|
|
@@ -56,10 +53,11 @@ function getThemedChildren(themeState, children, props) {
|
|
|
56
53
|
value: themeState.id,
|
|
57
54
|
children
|
|
58
55
|
});
|
|
59
|
-
var { isInverse
|
|
56
|
+
var { isInverse } = themeState;
|
|
60
57
|
var requiresExtraWrapper = isInverse || forceClassName;
|
|
61
|
-
|
|
62
|
-
if (
|
|
58
|
+
var isFirstThemedRender = !state.hasEverThemed;
|
|
59
|
+
if (isFirstThemedRender) state.hasEverThemed = true;
|
|
60
|
+
if (requiresExtraWrapper || isFirstThemedRender && (themeState.name === "dark" || themeState.name === "light")) state.hasEverThemed = "wrapped";
|
|
63
61
|
if (shallow) if (!themeState.parentId) {} else {
|
|
64
62
|
var parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);
|
|
65
63
|
if (!parentState) throw new Error(process.env.NODE_ENV !== "production" ? formatDiagnostic("‼️010", "Theme", "parent theme state is missing for shallow rendering", "Keep <Theme shallow> inside its mounted parent Theme", "name,parentId", {
|
|
@@ -96,10 +94,13 @@ function getThemedChildren(themeState, children, props) {
|
|
|
96
94
|
},
|
|
97
95
|
children
|
|
98
96
|
});
|
|
99
|
-
if (state.hasEverThemed === "wrapped")
|
|
100
|
-
|
|
101
|
-
children
|
|
102
|
-
|
|
97
|
+
if (state.hasEverThemed === "wrapped") {
|
|
98
|
+
var scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;
|
|
99
|
+
children = /* @__PURE__ */ jsx("span", {
|
|
100
|
+
className: scheme ? `t_${scheme} _dsp_contents` : "_dsp_contents",
|
|
101
|
+
children
|
|
102
|
+
});
|
|
103
|
+
}
|
|
103
104
|
return children;
|
|
104
105
|
}
|
|
105
106
|
return children;
|
|
@@ -113,12 +114,11 @@ var empty = {
|
|
|
113
114
|
className: "",
|
|
114
115
|
color: void 0
|
|
115
116
|
};
|
|
116
|
-
function getThemeClassNameAndColor(themeState, props) {
|
|
117
|
-
var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
117
|
+
function getThemeClassNameAndColor(themeState, props, isRoot) {
|
|
118
118
|
if (!themeState.isNew && !props.forceClassName) return empty;
|
|
119
119
|
return {
|
|
120
120
|
color: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : "",
|
|
121
|
-
className: getThemeClassNames(themeState.name, isRoot)
|
|
121
|
+
className: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport
|
|
1
|
+
{"version":3,"file":"Theme.native.js","names":[],"sources":["esm/views/Theme.native.js"],"sourcesContent":["import { jsx } from \"react/jsx-runtime\";\nimport { createRefComponent } from \"@tamagui/compose-refs\";\nimport { isWeb, useIsomorphicLayoutEffect } from \"@tamagui/constants\";\nimport { getThemeClassNames, reservedThemeProps } from \"@tamagui/helpers\";\nimport { Children, cloneElement, isValidElement, useRef } from \"react\";\nimport { variableToString } from \"../createVariable\";\nimport { formatDiagnostic } from \"../helpers/formatDiagnostic\";\nimport { removeNativeStyleScope, updateNativeStyleScope } from \"../helpers/nativeStyleEngine\";\nimport { warnOnce } from \"../helpers/warnOnce\";\nimport { useThemeWithState } from \"../hooks/useTheme\";\nimport { ThemeStateContext, getThemeState, hasThemeUpdatingProps } from \"../hooks/useThemeState\";\nimport { ThemeDebug } from \"./ThemeDebug\";\n\nvar Theme = createRefComponent(function Theme2(props, ref) {\n\t\"use no memo\";\n\tif (props.disable) return props.children;\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tfor (var key in props) if (!reservedThemeProps[key] && key !== \"srcloc\" && !key.startsWith(\"data-\")) warnOnce(`theme-update:${key}`, `<Theme ${key}=...> no longer accepts inline values. Wrap the subtree in <ThemeUpdate ${key}=...> instead.`);\n\t}\n\tvar { passThrough } = props;\n\tvar isRoot = !!props[\"_isRoot\"];\n\tvar [_, themeState] = useThemeWithState(props, isRoot, true);\n\tuseIsomorphicLayoutEffect(function() {\n\t\tupdateNativeStyleScope(themeState.id, themeState.name, themeState.theme);\n\t\treturn function() {\n\t\t\treturn removeNativeStyleScope(themeState.id);\n\t\t};\n\t}, [\n\t\tthemeState.id,\n\t\tthemeState.name,\n\t\tthemeState.theme\n\t]);\n\tvar finalChildren = props[\"disable-child-theme\"] ? Children.map(props.children, function(child) {\n\t\treturn passThrough || !/* @__PURE__ */ isValidElement(child) ? child : /* @__PURE__ */ cloneElement(child, { [\"data-disable-theme\"]: true });\n\t}) : props.children;\n\tif (ref && /* @__PURE__ */ isValidElement(finalChildren)) finalChildren = /* @__PURE__ */ cloneElement(finalChildren, { ref });\n\tvar stateRef = useRef({ hasEverThemed: false });\n\treturn getThemedChildren(themeState, finalChildren, props, isRoot, stateRef, passThrough);\n});\nTheme[\"avoidForwardRef\"] = true;\nfunction getThemedChildren(themeState, children, props) {\n\tvar isRoot = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false, stateRef = arguments.length > 4 ? arguments[4] : void 0, passThrough = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;\n\tvar { shallow, forceClassName } = props;\n\tvar state = stateRef.current;\n\tvar shouldRenderChildrenWithTheme = state.hasEverThemed || themeState.isNew || isRoot || hasThemeUpdatingProps(props);\n\tif (process.env.NODE_ENV === \"development\" && props.debug === \"visualize\") children = /* @__PURE__ */ jsx(ThemeDebug, {\n\t\tthemeState,\n\t\tthemeProps: props,\n\t\tchildren\n\t});\n\tif (!shouldRenderChildrenWithTheme) return children;\n\tchildren = /* @__PURE__ */ jsx(ThemeStateContext.Provider, {\n\t\tvalue: themeState.id,\n\t\tchildren\n\t});\n\tvar { isInverse } = themeState;\n\tvar requiresExtraWrapper = isInverse || forceClassName;\n\tvar isFirstThemedRender = !state.hasEverThemed;\n\tif (isFirstThemedRender) state.hasEverThemed = true;\n\tif (requiresExtraWrapper || isFirstThemedRender && (themeState.name === \"dark\" || themeState.name === \"light\")) state.hasEverThemed = \"wrapped\";\n\tif (shallow) if (!themeState.parentId) {} else {\n\t\tvar parentState = getThemeState(themeState.isNew ? themeState.id : themeState.parentId);\n\t\tif (!parentState) throw new Error(process.env.NODE_ENV !== \"production\" ? formatDiagnostic(\"‼️010\", \"Theme\", \"parent theme state is missing for shallow rendering\", \"Keep <Theme shallow> inside its mounted parent Theme\", \"name,parentId\", {\n\t\t\tname: themeState.name,\n\t\t\tparentId: themeState.parentId\n\t\t}) : \"❌ Error 014\");\n\t\tchildren = Children.toArray(children).map(function(child) {\n\t\t\treturn /* @__PURE__ */ isValidElement(child) ? passThrough ? child : /* @__PURE__ */ cloneElement(child, void 0, /* @__PURE__ */ jsx(Theme, {\n\t\t\t\tname: parentState.name,\n\t\t\t\tchildren: child.props.children\n\t\t\t})) : child;\n\t\t});\n\t}\n\tif (process.env.NODE_ENV === \"development\") {\n\t\tif (!passThrough && props.debug) console.warn(` getThemedChildren`, {\n\t\t\trequiresExtraWrapper,\n\t\t\tforceClassName,\n\t\t\tthemeState,\n\t\t\tstate,\n\t\t\tthemeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)\n\t\t});\n\t}\n\tif (forceClassName === false) return children;\n\tif (isWeb) {\n\t\tvar _props__themeUpdate;\n\t\tvar baseStyle = props.contain ? inertContainedStyle : inertStyle;\n\t\tvar { className = \"\", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);\n\t\tvar inlineClassName = passThrough ? void 0 : (_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.className;\n\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\tclassName: `${className} is_Theme${inlineClassName ? ` ${inlineClassName}` : \"\"}`,\n\t\t\tstyle: passThrough ? baseStyle : {\n\t\t\t\tcolor,\n\t\t\t\t...baseStyle\n\t\t\t},\n\t\t\tchildren\n\t\t});\n\t\tif (state.hasEverThemed === \"wrapped\") {\n\t\t\tvar scheme = requiresExtraWrapper && themeState.schemeAuthored && themeState.scheme;\n\t\t\tchildren = /* @__PURE__ */ jsx(\"span\", {\n\t\t\t\tclassName: scheme ? `t_${scheme} _dsp_contents` : \"_dsp_contents\",\n\t\t\t\tchildren\n\t\t\t});\n\t\t}\n\t\treturn children;\n\t}\n\treturn children;\n}\nvar inertStyle = { display: \"contents\" };\nvar inertContainedStyle = {\n\tdisplay: \"contents\",\n\tcontain: \"strict\"\n};\nvar empty = {\n\tclassName: \"\",\n\tcolor: void 0\n};\nfunction getThemeClassNameAndColor(themeState, props, isRoot) {\n\tif (!themeState.isNew && !props.forceClassName) return empty;\n\treturn {\n\t\tcolor: (themeState === null || themeState === void 0 ? void 0 : themeState.theme) && themeState.isNew ? variableToString(themeState.theme.color) : \"\",\n\t\tclassName: getThemeClassNames(themeState.name, isRoot, themeState.schemeAuthored)\n\t};\n}\n\nexport { Theme, getThemedChildren };"],"mappings":";;;;;;;;;;;;;;AAaA,IAAI,QAAQ,mBAAmB,SAAS,OAAO,OAAO,KAAK;CAC1D;CACA,IAAI,MAAM,SAAS,OAAO,MAAM;CAChC,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC3C,KAAK,IAAI,OAAO,OAAO,IAAI,CAAC,mBAAmB,QAAQ,QAAQ,YAAY,CAAC,IAAI,WAAW,OAAO,GAAG,SAAS,gBAAgB,OAAO,UAAU,IAAI,0EAA0E,IAAI,eAAe;CACjP;CACA,IAAI,EAAE,gBAAgB;CACtB,IAAI,SAAS,CAAC,CAAC,MAAM;CACrB,IAAI,CAAC,GAAG,cAAc,kBAAkB,OAAO,QAAQ,IAAI;CAC3D,0BAA0B,WAAW;EACpC,uBAAuB,WAAW,IAAI,WAAW,MAAM,WAAW,KAAK;EACvE,OAAO,WAAW;GACjB,OAAO,uBAAuB,WAAW,EAAE;EAC5C;CACD,GAAG;EACF,WAAW;EACX,WAAW;EACX,WAAW;CACZ,CAAC;CACD,IAAI,gBAAgB,MAAM,yBAAyB,SAAS,IAAI,MAAM,UAAU,SAAS,OAAO;EAC/F,OAAO,eAAe,CAAiB,+BAAe,KAAK,IAAI,QAAwB,6BAAa,OAAO,GAAG,uBAAuB,KAAK,CAAC;CAC5I,CAAC,IAA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AA0B,YAAY,OAAO,QAAQ;CAC7D,IAAI,CAAC,WAAW,SAAS,CAAC,MAAM,gBAAgB,OAAO;CACvD,OAAO;EACN,QAAQ,eAAe,QAAQ,eAAe,KAAK,IAAI,KAAK,IAAI,WAAW,UAAU,WAAW,QAAQ,iBAAiB,WAAW,MAAM,KAAK,IAAI;EACnJ,WAAW,mBAAmB,WAAW,MAAM,QAAQ,WAAW,cAAc;CACjF;AACD"}
|
|
@@ -45,7 +45,7 @@ function ThemeDebug({ themeState, themeProps, children }) {
|
|
|
45
45
|
" />\xA0",
|
|
46
46
|
JSON.stringify({
|
|
47
47
|
name: themeState.name,
|
|
48
|
-
|
|
48
|
+
"color-1": themeState.theme["color-1"].val,
|
|
49
49
|
parentId: themeState.parentId,
|
|
50
50
|
isNew: themeState.isNew,
|
|
51
51
|
themeProps: { name: themeProps.name },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeDebug.js","names":[],"sources":["esm/views/ThemeDebug.js"],"sourcesContent":["import { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { getThemeState } from \"../hooks/useThemeState\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nlet node;\nfunction ThemeDebug({\n themeState,\n themeProps,\n children\n}) {\n if (process.env.NODE_ENV === \"development\") {\n const isHydrated = useDidFinishSSR();\n if (process.env.NODE_ENV === \"development\" && typeof document !== \"undefined\") {\n if (!node) {\n node = document.createElement(\"div\");\n node.style.height = \"200px\";\n node.style.overflowY = \"scroll\";\n node.style.position = \"fixed\";\n node.style.zIndex = 1e7;\n node.style.bottom = \"30px\";\n node.style.left = \"30px\";\n node.style.right = \"30px\";\n node.style.display = \"flex\";\n node.style.border = \"1px solid #888\";\n node.style.flexDirection = \"row\";\n node.style.background = \"var(--background)\";\n }\n }\n useEffect(() => {\n document.body.appendChild(node);\n }, []);\n if (themeProps[\"disable-child-theme\"] || !isHydrated) {\n return children;\n }\n const parentState = themeState.parentId ? getThemeState(themeState.parentId) : null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n createPortal(\n /* @__PURE__ */ jsxs(\n \"code\",\n {\n style: {\n whiteSpace: \"pre\",\n maxWidth: 250,\n overflow: \"auto\",\n padding: 5\n },\n children: [\n \"<Theme \",\n themeState.id,\n \" />\\xA0\",\n JSON.stringify(\n {\n name: themeState.name,\n
|
|
1
|
+
{"version":3,"file":"ThemeDebug.js","names":[],"sources":["esm/views/ThemeDebug.js"],"sourcesContent":["import { useDidFinishSSR } from \"@tamagui/use-did-finish-ssr\";\nimport { useEffect } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { getThemeState } from \"../hooks/useThemeState\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nlet node;\nfunction ThemeDebug({\n themeState,\n themeProps,\n children\n}) {\n if (process.env.NODE_ENV === \"development\") {\n const isHydrated = useDidFinishSSR();\n if (process.env.NODE_ENV === \"development\" && typeof document !== \"undefined\") {\n if (!node) {\n node = document.createElement(\"div\");\n node.style.height = \"200px\";\n node.style.overflowY = \"scroll\";\n node.style.position = \"fixed\";\n node.style.zIndex = 1e7;\n node.style.bottom = \"30px\";\n node.style.left = \"30px\";\n node.style.right = \"30px\";\n node.style.display = \"flex\";\n node.style.border = \"1px solid #888\";\n node.style.flexDirection = \"row\";\n node.style.background = \"var(--background)\";\n }\n }\n useEffect(() => {\n document.body.appendChild(node);\n }, []);\n if (themeProps[\"disable-child-theme\"] || !isHydrated) {\n return children;\n }\n const parentState = themeState.parentId ? getThemeState(themeState.parentId) : null;\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n createPortal(\n /* @__PURE__ */ jsxs(\n \"code\",\n {\n style: {\n whiteSpace: \"pre\",\n maxWidth: 250,\n overflow: \"auto\",\n padding: 5\n },\n children: [\n \"<Theme \",\n themeState.id,\n \" />\\xA0\",\n JSON.stringify(\n {\n name: themeState.name,\n \"color-1\": themeState.theme[\"color-1\"].val,\n parentId: themeState.parentId,\n // inverses: themeState.inverses,\n isNew: themeState.isNew,\n themeProps: {\n name: themeProps.name\n },\n parentState: {\n name: parentState?.name,\n isNew: parentState?.isNew\n }\n },\n null,\n 2\n )\n ]\n }\n ),\n node\n ),\n /* @__PURE__ */ jsx(\"div\", { style: { color: \"red\" }, children: themeState.id }),\n children\n ] });\n }\n return children;\n}\nThemeDebug[\"displayName\"] = \"ThemeDebug\";\nexport {\n ThemeDebug\n};\n//# sourceMappingURL=ThemeDebug.js.map\n"],"mappings":";;;;;;;AAKA,IAAI;AACJ,SAAS,WAAW,EAClB,YACA,YACA,YACC;CACD,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,aAAa,gBAAgB;EACnC,IAAI,QAAQ,IAAI,aAAa,iBAAiB,OAAO,aAAa,aAAa;GAC7E,IAAI,CAAC,MAAM;IACT,OAAO,SAAS,cAAc,KAAK;IACnC,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,YAAY;IACvB,KAAK,MAAM,WAAW;IACtB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,OAAO;IAClB,KAAK,MAAM,QAAQ;IACnB,KAAK,MAAM,UAAU;IACrB,KAAK,MAAM,SAAS;IACpB,KAAK,MAAM,gBAAgB;IAC3B,KAAK,MAAM,aAAa;GAC1B;EACF;EACA,gBAAgB;GACd,SAAS,KAAK,YAAY,IAAI;EAChC,GAAG,CAAC,CAAC;EACL,IAAI,WAAW,0BAA0B,CAAC,YAAY;GACpD,OAAO;EACT;EACA,MAAM,cAAc,WAAW,WAAW,cAAc,WAAW,QAAQ,IAAI;EAC/E,OAAuB,qBAAK,UAAU,EAAE,UAAU;GAChD,aACkB,qBACd,QACA;IACE,OAAO;KACL,YAAY;KACZ,UAAU;KACV,UAAU;KACV,SAAS;IACX;IACA,UAAU;KACR;KACA,WAAW;KACX;KACA,KAAK,UACH;MACE,MAAM,WAAW;MACjB,WAAW,WAAW,MAAM,UAAU,CAAC;MACvC,UAAU,WAAW;MAErB,OAAO,WAAW;MAClB,YAAY,EACV,MAAM,WAAW,KACnB;MACA,aAAa;OACX,MAAM,aAAa;OACnB,OAAO,aAAa;MACtB;KACF,GACA,MACA,CACF;IACF;GACF,CACF,GACA,IACF;GACgB,oBAAI,OAAO;IAAE,OAAO,EAAE,OAAO,MAAM;IAAG,UAAU,WAAW;GAAG,CAAC;GAC/E;EACF,EAAE,CAAC;CACL;CACA,OAAO;AACT;AACA,WAAW,iBAAiB"}
|
|
@@ -27,7 +27,7 @@ const ThemeUpdate = createRefComponent(function ThemeUpdate2(props, ref) {
|
|
|
27
27
|
"use no memo";
|
|
28
28
|
const config = getConfig();
|
|
29
29
|
const values = getInlineValuesFromProps(props, config);
|
|
30
|
-
const css = process.env.
|
|
30
|
+
const css = process.env.TAMAGUI_RUNTIME === "island" || !values ? null : getVariablesCSSRules(values, config);
|
|
31
31
|
let rulesToInsert = null;
|
|
32
32
|
if (css && shouldInsertStyleRules(css.identifier)) {
|
|
33
33
|
updateRules(css.identifier, css.rules);
|