@tamagui/web 3.0.0-beta.924.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
|
@@ -85,11 +85,11 @@ function buildCSSRuleSets(declarations, fontDeclarations) {
|
|
|
85
85
|
var defaultFontToken = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
86
86
|
if (!process.env.TAMAGUI_DID_OUTPUT_CSS) {
|
|
87
87
|
let declarationsToRuleSet2 = function(decs) {
|
|
88
|
-
return `:root${arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""}
|
|
89
|
-
}`;
|
|
88
|
+
return `:root${arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""}${sep}{${sep}${[...decs].join(`;${sep}`)}${developmentWhitespace ? "\n" : ""}}`;
|
|
90
89
|
};
|
|
91
90
|
var cssRuleSets = [];
|
|
92
|
-
var
|
|
91
|
+
var developmentWhitespace = process.env.NODE_ENV === "development";
|
|
92
|
+
var sep = developmentWhitespace ? " " : "";
|
|
93
93
|
if (declarations.length) cssRuleSets.push(declarationsToRuleSet2(declarations));
|
|
94
94
|
var fontSelectors = [];
|
|
95
95
|
var sortedFontDeclarationKeys = Object.keys(fontDeclarations).sort();
|
|
@@ -117,7 +117,7 @@ function buildCSSRuleSets(declarations, fontDeclarations) {
|
|
|
117
117
|
var defaultFont = fontDeclarations[defaultFontToken];
|
|
118
118
|
if (defaultFont === null || defaultFont === void 0 ? void 0 : defaultFont.fontParsed) {
|
|
119
119
|
var sharedSelectors = `:where(${[...fontSelectors, ".is_View"].join(", ")})`;
|
|
120
|
-
cssRuleSets.push(`${sharedSelectors}
|
|
120
|
+
cssRuleSets.push(`${sharedSelectors}${sep}{font-family:${sep}var(--f-family)}`);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return cssRuleSets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDesignSystem.native.js","names":[],"sources":["esm/helpers/createDesignSystem.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { registerCSSVariable, variableToCSS } from \"./registerCSSVariable\";\nimport { getThemeCSSRules } from \"./getThemeCSSRules\";\n\nfunction createTokenCSS(tokens, shouldTokenCategoryHaveUnits) {\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tvar declarations = [];\n\t\tvar sortedTokenKeys = Object.keys(tokens).sort();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = sortedTokenKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar key = _step.value;\n\t\t\t\tvar sortedSubKeys = Object.keys(tokens[key]).sort();\n\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator1 = sortedSubKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\tvar skey = _step1.value;\n\t\t\t\t\t\tvar variable = tokens[key][skey];\n\t\t\t\t\t\tif (isWeb) {\n\t\t\t\t\t\t\tregisterCSSVariable(variable);\n\t\t\t\t\t\t\tvar variableNeedsPx = variable.needsPx === true;\n\t\t\t\t\t\t\tvar categoryNeedsPx = shouldTokenCategoryHaveUnits(key);\n\t\t\t\t\t\t\tvar shouldBeUnitless = !(variableNeedsPx || categoryNeedsPx);\n\t\t\t\t\t\t\tdeclarations.push(variableToCSS(variable, shouldBeUnitless));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\treturn declarations;\n\t}\n\treturn [];\n}\nfunction createFontCSS(fontsParsed, registerFontVariables) {\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tvar fontDeclarations = {};\n\t\tif (!fontsParsed) return fontDeclarations;\n\t\tvar sortedFontKeys = Object.keys(fontsParsed).sort();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = sortedFontKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar key = _step.value;\n\t\t\t\tvar fontParsed = fontsParsed[key];\n\t\t\t\tvar [name, language] = key.includes(\"_\") ? key.split(\"_\") : [key];\n\t\t\t\tfontDeclarations[key] = {\n\t\t\t\t\tname,\n\t\t\t\t\tdeclarations: registerFontVariables(fontParsed),\n\t\t\t\t\tlanguage,\n\t\t\t\t\tfontParsed\n\t\t\t\t};\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\treturn fontDeclarations;\n\t}\n\treturn {};\n}\nfunction buildCSSRuleSets(declarations, fontDeclarations) {\n\tvar defaultFontToken = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : \"\";\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tlet declarationsToRuleSet2 = function(decs) {\n\t\t\treturn `:root${arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"\"} {${sep}${[...decs].join(`;${sep}`)}\n}`;\n\t\t};\n\t\tvar cssRuleSets = [];\n\t\tvar sep = \" \";\n\t\tif (declarations.length) cssRuleSets.push(declarationsToRuleSet2(declarations));\n\t\tvar fontSelectors = [];\n\t\tvar sortedFontDeclarationKeys = Object.keys(fontDeclarations).sort();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = sortedFontDeclarationKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar { name, declarations: _$declarations, language = \"default\" } = fontDeclarations[_step.value];\n\t\t\t\tvar fontSelector = `.font_${name}`;\n\t\t\t\tfontSelectors.push(fontSelector);\n\t\t\t\tvar langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`;\n\t\t\t\tvar specificRuleSet = declarationsToRuleSet2(_$declarations, language === \"default\" ? ` ${fontSelector}, ${langSelector}` : langSelector);\n\t\t\t\tcssRuleSets.push(specificRuleSet);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\tif (fontSelectors.length) {\n\t\t\tvar defaultFont = fontDeclarations[defaultFontToken];\n\t\t\tif (defaultFont === null || defaultFont === void 0 ? void 0 : defaultFont.fontParsed) {\n\t\t\t\tvar sharedSelectors = `:where(${[...fontSelectors, \".is_View\"].join(\", \")})`;\n\t\t\t\tcssRuleSets.push(`${sharedSelectors} {font-family: var(--f-family)}`);\n\t\t\t}\n\t\t}\n\t\treturn cssRuleSets;\n\t}\n\treturn [];\n}\nfunction createThemeCSS(dedupedThemes, configIn) {\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tvar themeRuleSets = [];\n\t\tif (isWeb) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = dedupedThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar { names, theme } = _step.value;\n\t\t\t\t\tvar nextRules = getThemeCSSRules({\n\t\t\t\t\t\tconfig: configIn,\n\t\t\t\t\t\tthemeName: names[0],\n\t\t\t\t\t\tnames,\n\t\t\t\t\t\ttheme\n\t\t\t\t\t});\n\t\t\t\t\tthemeRuleSets = [...themeRuleSets, ...nextRules];\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn themeRuleSets;\n\t}\n\treturn [];\n}\nfunction getCSS(themeConfig) {\n\targuments.length > 1 && arguments[1] !== void 0 && arguments[1];\n\targuments.length > 2 && arguments[2];\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS && false);\n\treturn \"\";\n}\n\nexport { buildCSSRuleSets, createFontCSS, createThemeCSS, createTokenCSS, getCSS };"],"mappings":";;;;;AAIA,SAAS,eAAe,QAAQ,8BAA8B;CAC7D,IAAI,CAAC,QAAQ,IAAI,wBAAwB;EACxC,IAAI,eAAe,CAAC;EACpB,IAAI,kBAAkB,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK;EAC/C,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACH,KAAK,IAAI,YAAY,gBAAgB,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IACjK,IAAI,MAAM,MAAM;IAChB,IAAI,gBAAgB,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC,KAAK;IAClD,IAAI,6BAA6B,MAAM,qBAAqB,OAAO,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IAC9B;GACD;EACD;EACA,OAAO;CACR;CACA,OAAO,CAAC;AACT;AACA,SAAS,OAAO,aAAa;CAC5B,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,KAAK,UAAU;CAC7D,UAAU,SAAS,KAAK,UAAU;CAClC,IAAI,CAAC,QAAQ,IAAI,0BAA0B;CAC3C,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"createDesignSystem.native.js","names":[],"sources":["esm/helpers/createDesignSystem.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { registerCSSVariable, variableToCSS } from \"./registerCSSVariable\";\nimport { getThemeCSSRules } from \"./getThemeCSSRules\";\n\nfunction createTokenCSS(tokens, shouldTokenCategoryHaveUnits) {\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tvar declarations = [];\n\t\tvar sortedTokenKeys = Object.keys(tokens).sort();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = sortedTokenKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar key = _step.value;\n\t\t\t\tvar sortedSubKeys = Object.keys(tokens[key]).sort();\n\t\t\t\tvar _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tfor (var _iterator1 = sortedSubKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n\t\t\t\t\t\tvar skey = _step1.value;\n\t\t\t\t\t\tvar variable = tokens[key][skey];\n\t\t\t\t\t\tif (isWeb) {\n\t\t\t\t\t\t\tregisterCSSVariable(variable);\n\t\t\t\t\t\t\tvar variableNeedsPx = variable.needsPx === true;\n\t\t\t\t\t\t\tvar categoryNeedsPx = shouldTokenCategoryHaveUnits(key);\n\t\t\t\t\t\t\tvar shouldBeUnitless = !(variableNeedsPx || categoryNeedsPx);\n\t\t\t\t\t\t\tdeclarations.push(variableToCSS(variable, shouldBeUnitless));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_didIteratorError1 = true;\n\t\t\t\t\t_iteratorError1 = err;\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tif (_didIteratorError1) throw _iteratorError1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\treturn declarations;\n\t}\n\treturn [];\n}\nfunction createFontCSS(fontsParsed, registerFontVariables) {\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tvar fontDeclarations = {};\n\t\tif (!fontsParsed) return fontDeclarations;\n\t\tvar sortedFontKeys = Object.keys(fontsParsed).sort();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = sortedFontKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar key = _step.value;\n\t\t\t\tvar fontParsed = fontsParsed[key];\n\t\t\t\tvar [name, language] = key.includes(\"_\") ? key.split(\"_\") : [key];\n\t\t\t\tfontDeclarations[key] = {\n\t\t\t\t\tname,\n\t\t\t\t\tdeclarations: registerFontVariables(fontParsed),\n\t\t\t\t\tlanguage,\n\t\t\t\t\tfontParsed\n\t\t\t\t};\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\treturn fontDeclarations;\n\t}\n\treturn {};\n}\nfunction buildCSSRuleSets(declarations, fontDeclarations) {\n\tvar defaultFontToken = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : \"\";\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tlet declarationsToRuleSet2 = function(decs) {\n\t\t\treturn `:root${arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"\"}${sep}{${sep}${[...decs].join(`;${sep}`)}${developmentWhitespace ? \"\\n\" : \"\"}}`;\n\t\t};\n\t\tvar cssRuleSets = [];\n\t\tvar developmentWhitespace = process.env.NODE_ENV === \"development\";\n\t\tvar sep = developmentWhitespace ? \" \" : \"\";\n\t\tif (declarations.length) cssRuleSets.push(declarationsToRuleSet2(declarations));\n\t\tvar fontSelectors = [];\n\t\tvar sortedFontDeclarationKeys = Object.keys(fontDeclarations).sort();\n\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\ttry {\n\t\t\tfor (var _iterator = sortedFontDeclarationKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\tvar { name, declarations: _$declarations, language = \"default\" } = fontDeclarations[_step.value];\n\t\t\t\tvar fontSelector = `.font_${name}`;\n\t\t\t\tfontSelectors.push(fontSelector);\n\t\t\t\tvar langSelector = `:root .t_lang-${name}-${language} ${fontSelector}`;\n\t\t\t\tvar specificRuleSet = declarationsToRuleSet2(_$declarations, language === \"default\" ? ` ${fontSelector}, ${langSelector}` : langSelector);\n\t\t\t\tcssRuleSets.push(specificRuleSet);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError = true;\n\t\t\t_iteratorError = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t}\n\t\t}\n\t\tif (fontSelectors.length) {\n\t\t\tvar defaultFont = fontDeclarations[defaultFontToken];\n\t\t\tif (defaultFont === null || defaultFont === void 0 ? void 0 : defaultFont.fontParsed) {\n\t\t\t\tvar sharedSelectors = `:where(${[...fontSelectors, \".is_View\"].join(\", \")})`;\n\t\t\t\tcssRuleSets.push(`${sharedSelectors}${sep}{font-family:${sep}var(--f-family)}`);\n\t\t\t}\n\t\t}\n\t\treturn cssRuleSets;\n\t}\n\treturn [];\n}\nfunction createThemeCSS(dedupedThemes, configIn) {\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS) {\n\t\tvar themeRuleSets = [];\n\t\tif (isWeb) {\n\t\t\tvar _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n\t\t\ttry {\n\t\t\t\tfor (var _iterator = dedupedThemes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\t\t\tvar { names, theme } = _step.value;\n\t\t\t\t\tvar nextRules = getThemeCSSRules({\n\t\t\t\t\t\tconfig: configIn,\n\t\t\t\t\t\tthemeName: names[0],\n\t\t\t\t\t\tnames,\n\t\t\t\t\t\ttheme\n\t\t\t\t\t});\n\t\t\t\t\tthemeRuleSets = [...themeRuleSets, ...nextRules];\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t_didIteratorError = true;\n\t\t\t\t_iteratorError = err;\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();\n\t\t\t\t} finally {\n\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn themeRuleSets;\n\t}\n\treturn [];\n}\nfunction getCSS(themeConfig) {\n\targuments.length > 1 && arguments[1] !== void 0 && arguments[1];\n\targuments.length > 2 && arguments[2];\n\tif (!process.env.TAMAGUI_DID_OUTPUT_CSS && false);\n\treturn \"\";\n}\n\nexport { buildCSSRuleSets, createFontCSS, createThemeCSS, createTokenCSS, getCSS };"],"mappings":";;;;;AAIA,SAAS,eAAe,QAAQ,8BAA8B;CAC7D,IAAI,CAAC,QAAQ,IAAI,wBAAwB;EACxC,IAAI,eAAe,CAAC;EACpB,IAAI,kBAAkB,OAAO,KAAK,MAAM,CAAC,CAAC,KAAK;EAC/C,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;EACvF,IAAI;GACH,KAAK,IAAI,YAAY,gBAAgB,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;IACjK,IAAI,MAAM,MAAM;IAChB,IAAI,gBAAgB,OAAO,KAAK,OAAO,IAAI,CAAC,CAAC,KAAK;IAClD,IAAI,6BAA6B,MAAM,qBAAqB,OAAO,kBAAkB,KAAK;IAC1F,IAAI;KACH,KAAK,IAAI,aAAa,cAAc,OAAO,SAAS,CAAC,GAAG,QAAQ,EAAE,8BAA8B,SAAS,WAAW,KAAK,EAAC,CAAE,OAAO,6BAA6B,MAAM;MACrK,IAAI,OAAO,OAAO;MAClB,IAAI,WAAW,OAAO,IAAI,CAAC;MAC3B,IAAI,OAAO;OACV,oBAAoB,QAAQ;OAC5B,IAAI,kBAAkB,SAAS,YAAY;OAC3C,IAAI,kBAAkB,6BAA6B,GAAG;OACtD,IAAI,mBAAmB,EAAE,mBAAmB;OAC5C,aAAa,KAAK,cAAc,UAAU,gBAAgB,CAAC;MAC5D;KACD;IACD,SAAS,KAAK;KACb,qBAAqB;KACrB,kBAAkB;IACnB,UAAU;KACT,IAAI;MACH,IAAI,CAAC,8BAA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YAAY;IACrF,IAAI,kBAAkB,UAAU,CAAC,GAAG,eAAe,UAAU,CAAC,CAAC,KAAK,IAAI,EAAE;IAC1E,YAAY,KAAK,GAAG,kBAAkB,IAAI,eAAe,IAAI,iBAAiB;GAC/E;EACD;EACA,OAAO;CACR;CACA,OAAO,CAAC;AACT;AACA,SAAS,eAAe,eAAe,UAAU;CAChD,IAAI,CAAC,QAAQ,IAAI,wBAAwB;EACxC,IAAI,gBAAgB,CAAC;EACrB,IAAI,OAAO;GACV,IAAI,4BAA4B,MAAM,oBAAoB,OAAO,iBAAiB,KAAK;GACvF,IAAI;IACH,KAAK,IAAI,YAAY,cAAc,OAAO,SAAS,CAAC,GAAG,OAAO,EAAE,6BAA6B,QAAQ,UAAU,KAAK,EAAC,CAAE,OAAO,4BAA4B,MAAM;KAC/J,IAAI,EAAE,OAAO,UAAU,MAAM;KAC7B,IAAI,YAAY,iBAAiB;MAChC,QAAQ;MACR,WAAW,MAAM;MACjB;MACA;KACD,CAAC;KACD,gBAAgB,CAAC,GAAG,eAAe,GAAG,SAAS;IAChD;GACD,SAAS,KAAK;IACb,oBAAoB;IACpB,iBAAiB;GAClB,UAAU;IACT,IAAI;KACH,IAAI,CAAC,6BAA6B,UAAU,UAAU,MAAM,UAAU,OAAO;IAC9E,UAAU;KACT,IAAI,mBAAmB,MAAM;IAC9B;GACD;EACD;EACA,OAAO;CACR;CACA,OAAO,CAAC;AACT;AACA,SAAS,OAAO,aAAa;CAC5B,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,KAAK,UAAU;CAC7D,UAAU,SAAS,KAAK,UAAU;CAClC,IAAI,CAAC,QAAQ,IAAI,0BAA0B;CAC3C,OAAO;AACR"}
|
|
@@ -4,16 +4,12 @@ import { isPlainObject } from "./isObj.native.js";
|
|
|
4
4
|
import { mergeProps } from "./mergeProps.native.js";
|
|
5
5
|
import { objectIdentityKey } from "./objectIdentityKey.native.js";
|
|
6
6
|
|
|
7
|
-
function _type_of(obj) {
|
|
8
|
-
"@swc/helpers - typeof";
|
|
9
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
10
|
-
}
|
|
11
7
|
var createStyledContext = function(defaultValues) {
|
|
12
8
|
"use no memo";
|
|
13
9
|
var namespaceOrOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
14
10
|
var namespace = typeof namespaceOrOptions === "string" ? namespaceOrOptions : namespaceOrOptions.namespace || "";
|
|
15
11
|
var defaultKeys = isPlainObject(defaultValues) ? Object.keys(defaultValues) : void 0;
|
|
16
|
-
var propKeys =
|
|
12
|
+
var propKeys = typeof namespaceOrOptions === "object" && namespaceOrOptions.keys ? namespaceOrOptions.keys : defaultKeys;
|
|
17
13
|
var OGContext = /* @__PURE__ */ React.createContext(defaultValues);
|
|
18
14
|
var OGProvider = OGContext.Provider;
|
|
19
15
|
var Context = OGContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStyledContext.native.js","names":[],"sources":["esm/helpers/createStyledContext.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { isPlainObject } from \"./isObj\";\nimport { mergeProps } from \"./mergeProps\";\nimport { objectIdentityKey } from \"./objectIdentityKey\";\
|
|
1
|
+
{"version":3,"file":"createStyledContext.native.js","names":[],"sources":["esm/helpers/createStyledContext.native.js"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { isPlainObject } from \"./isObj\";\nimport { mergeProps } from \"./mergeProps\";\nimport { objectIdentityKey } from \"./objectIdentityKey\";\nvar createStyledContext = function(defaultValues) {\n \"use no memo\";\n var namespaceOrOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"\";\n var namespace = typeof namespaceOrOptions === \"string\" ? namespaceOrOptions : namespaceOrOptions.namespace || \"\";\n var defaultKeys = isPlainObject(defaultValues) ? Object.keys(defaultValues) : void 0;\n var propKeys = typeof namespaceOrOptions === \"object\" && namespaceOrOptions.keys ? namespaceOrOptions.keys : defaultKeys;\n var OGContext = /* @__PURE__ */ React.createContext(defaultValues);\n var OGProvider = OGContext.Provider;\n var Context = OGContext;\n var scopedContexts = /* @__PURE__ */ new Map();\n var LastScopeInNamespace = /* @__PURE__ */ React.createContext(namespace);\n function getOrCreateScopedContext(scope) {\n var ScopedContext = scopedContexts.get(scope);\n if (!ScopedContext) {\n ScopedContext = /* @__PURE__ */ React.createContext(defaultValues);\n scopedContexts.set(scope, ScopedContext);\n }\n return ScopedContext;\n }\n var getNamespacedScope = function(scope) {\n return namespace ? `${namespace}--${scope}` : scope;\n };\n var Provider = function(param) {\n var { children, scope: scopeIn, __disableMergeDefaultValues, ...values } = param;\n var scope = getNamespacedScope(scopeIn);\n var next = React.useMemo(function() {\n if (__disableMergeDefaultValues) return values;\n return mergeProps(defaultValues || {}, values);\n }, [\n objectIdentityKey(values)\n ]);\n var ScopedProvider = scope ? getOrCreateScopedContext(scope).Provider : OGProvider;\n return /* @__PURE__ */ _jsx(LastScopeInNamespace.Provider, {\n value: scope,\n children: /* @__PURE__ */ _jsx(ScopedProvider, {\n value: next,\n children\n })\n });\n };\n var useStyledContext = function() {\n var scopeIn = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \"\";\n var lastScopeInNamespace = React.useContext(LastScopeInNamespace);\n var scope = namespace ? scopeIn ? getNamespacedScope(scopeIn) : lastScopeInNamespace : scopeIn;\n var context = scope ? getOrCreateScopedContext(scope) : OGContext;\n return React.useContext(context);\n };\n Context.Provider = Provider;\n Context.props = defaultValues;\n Context.propKeys = propKeys;\n Context.context = OGContext;\n Context.useStyledContext = useStyledContext;\n return Context;\n};\nexport {\n createStyledContext\n};\n//# sourceMappingURL=createStyledContext.js.map\n"],"mappings":";;;;;;;AAKA,IAAI,sBAAsB,SAAS,eAAe;CAChD;CACA,IAAI,qBAAqB,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK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,mBAAmB,OAAO,IAAI,uBAAuB;EACvF,IAAI,UAAU,QAAQ,yBAAyB,KAAK,IAAI;EACxD,OAAO,MAAM,WAAW,OAAO;CACjC;CACA,QAAQ,WAAW;CACnB,QAAQ,QAAQ;CAChB,QAAQ,WAAW;CACnB,QAAQ,UAAU;CAClB,QAAQ,mBAAmB;CAC3B,OAAO;AACT"}
|
|
@@ -47,6 +47,7 @@ function expandStyle(key, value, styleCompat = getStyleCompat()) {
|
|
|
47
47
|
case "writingDirection": return [["direction", value]];
|
|
48
48
|
case "backdropFilter": return [["backdropFilter", value], ["WebkitBackdropFilter", value]];
|
|
49
49
|
}
|
|
50
|
+
if (key in webInlineRenames) return [[webInlineRenames[key], value]];
|
|
50
51
|
if (key in universalExpansions) return universalExpansions[key].map((k) => [k, value]);
|
|
51
52
|
if (key in EXPANSIONS) return EXPANSIONS[key].map((k) => [k, value]);
|
|
52
53
|
}
|
|
@@ -131,6 +132,45 @@ const universalExpansions = {
|
|
|
131
132
|
blockSize: ["height"],
|
|
132
133
|
inlineSize: ["width"]
|
|
133
134
|
};
|
|
135
|
+
const webInlineRenames = {
|
|
136
|
+
paddingStart: "paddingInlineStart",
|
|
137
|
+
paddingEnd: "paddingInlineEnd",
|
|
138
|
+
marginStart: "marginInlineStart",
|
|
139
|
+
marginEnd: "marginInlineEnd",
|
|
140
|
+
borderStartWidth: "borderInlineStartWidth",
|
|
141
|
+
borderEndWidth: "borderInlineEndWidth",
|
|
142
|
+
borderStartColor: "borderInlineStartColor",
|
|
143
|
+
borderEndColor: "borderInlineEndColor",
|
|
144
|
+
borderStartStyle: "borderInlineStartStyle",
|
|
145
|
+
borderEndStyle: "borderInlineEndStyle",
|
|
146
|
+
borderTopStartRadius: "borderStartStartRadius",
|
|
147
|
+
borderTopEndRadius: "borderStartEndRadius",
|
|
148
|
+
borderBottomStartRadius: "borderEndStartRadius",
|
|
149
|
+
borderBottomEndRadius: "borderEndEndRadius",
|
|
150
|
+
start: "insetInlineStart",
|
|
151
|
+
end: "insetInlineEnd"
|
|
152
|
+
};
|
|
153
|
+
const paddingLogicals = ["paddingStart", "paddingEnd"];
|
|
154
|
+
const marginLogicals = ["marginStart", "marginEnd"];
|
|
155
|
+
const nativeShorthandLogicals = {
|
|
156
|
+
padding: paddingLogicals,
|
|
157
|
+
paddingHorizontal: paddingLogicals,
|
|
158
|
+
margin: marginLogicals,
|
|
159
|
+
marginHorizontal: marginLogicals,
|
|
160
|
+
borderRadius: [
|
|
161
|
+
"borderTopStartRadius",
|
|
162
|
+
"borderTopEndRadius",
|
|
163
|
+
"borderBottomStartRadius",
|
|
164
|
+
"borderBottomEndRadius",
|
|
165
|
+
"borderStartStartRadius",
|
|
166
|
+
"borderStartEndRadius",
|
|
167
|
+
"borderEndStartRadius",
|
|
168
|
+
"borderEndEndRadius"
|
|
169
|
+
],
|
|
170
|
+
borderWidth: ["borderStartWidth", "borderEndWidth"],
|
|
171
|
+
borderColor: ["borderStartColor", "borderEndColor"],
|
|
172
|
+
gap: ["rowGap", "columnGap"]
|
|
173
|
+
};
|
|
134
174
|
|
|
135
|
-
export { expandStyle };
|
|
175
|
+
export { expandStyle, nativeShorthandLogicals };
|
|
136
176
|
//# sourceMappingURL=expandStyle.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStyle.js","names":[],"sources":["esm/helpers/expandStyle.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\n\nconst neg1Flex = [\n\t[\"flexGrow\", 0],\n\t[\"flexShrink\", 1],\n\t[\"flexBasis\", \"auto\"]\n];\nfunction expandFlex(value, compat) {\n\tif (typeof value === \"string\") return [[\"flex\", value]];\n\tif (typeof value !== \"number\") return;\n\tif (value === -1) return neg1Flex;\n\tswitch (compat) {\n\t\tcase \"legacy\": return [\n\t\t\t[\"flexGrow\", value],\n\t\t\t[\"flexShrink\", 1],\n\t\t\t[\"flexBasis\", \"auto\"]\n\t\t];\n\t\tcase \"react-native\":\n\t\t\tif (value > 0) return [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t\t\tif (value === 0) return [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", -value],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\tcase \"web\":\n\t\t\tif (value < 0) return [[\"flex\", value]];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 1],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t}\n}\nfunction expandStyle(key, value, styleCompat = getStyleCompat()) {\n\tif (key === \"flex\") return expandFlex(value, styleCompat);\n\tswitch (key) {\n\t\tcase \"writingDirection\": return [[\"direction\", value]];\n\t\tcase \"backdropFilter\": return [[\"backdropFilter\", value], [\"WebkitBackdropFilter\", value]];\n\t}\n\tif (key in universalExpansions) return universalExpansions[key].map((k) => [k, value]);\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map((k) => [k, value]);\n}\nconst all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nconst horiz = [\"Right\", \"Left\"];\nconst vert = [\"Top\", \"Bottom\"];\nconst xy = [\"X\", \"Y\"];\nconst EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (const parent in EXPANSIONS) {\n\tconst prefix = parent.slice(0, /[A-Z]/.exec(parent)?.index ?? parent.length);\n\tEXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);\n}\nconst universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [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,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,cAAc,CAAC,WAAW;CAC1B,cAAc,CAAC,WAAW;CAC1B,eAAe,CAAC,UAAU;CAC1B,eAAe,CAAC,UAAU;CAC1B,WAAW,CAAC,QAAQ;CACpB,YAAY,CAAC,OAAO;AACrB"}
|
|
1
|
+
{"version":3,"file":"expandStyle.js","names":[],"sources":["esm/helpers/expandStyle.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\n\nconst neg1Flex = [\n\t[\"flexGrow\", 0],\n\t[\"flexShrink\", 1],\n\t[\"flexBasis\", \"auto\"]\n];\nfunction expandFlex(value, compat) {\n\tif (typeof value === \"string\") return [[\"flex\", value]];\n\tif (typeof value !== \"number\") return;\n\tif (value === -1) return neg1Flex;\n\tswitch (compat) {\n\t\tcase \"legacy\": return [\n\t\t\t[\"flexGrow\", value],\n\t\t\t[\"flexShrink\", 1],\n\t\t\t[\"flexBasis\", \"auto\"]\n\t\t];\n\t\tcase \"react-native\":\n\t\t\tif (value > 0) return [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t\t\tif (value === 0) return [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", 0],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", 0],\n\t\t\t\t[\"flexShrink\", -value],\n\t\t\t\t[\"flexBasis\", \"auto\"]\n\t\t\t];\n\t\tcase \"web\":\n\t\t\tif (value < 0) return [[\"flex\", value]];\n\t\t\treturn [\n\t\t\t\t[\"flexGrow\", value],\n\t\t\t\t[\"flexShrink\", 1],\n\t\t\t\t[\"flexBasis\", 0]\n\t\t\t];\n\t}\n}\nfunction expandStyle(key, value, styleCompat = getStyleCompat()) {\n\tif (key === \"flex\") return expandFlex(value, styleCompat);\n\tswitch (key) {\n\t\tcase \"writingDirection\": return [[\"direction\", value]];\n\t\tcase \"backdropFilter\": return [[\"backdropFilter\", value], [\"WebkitBackdropFilter\", value]];\n\t}\n\tif (key in webInlineRenames) return [[webInlineRenames[key], value]];\n\tif (key in universalExpansions) return universalExpansions[key].map((k) => [k, value]);\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map((k) => [k, value]);\n}\nconst all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nconst horiz = [\"Right\", \"Left\"];\nconst vert = [\"Top\", \"Bottom\"];\nconst xy = [\"X\", \"Y\"];\nconst EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (const parent in EXPANSIONS) {\n\tconst prefix = parent.slice(0, /[A-Z]/.exec(parent)?.index ?? parent.length);\n\tEXPANSIONS[parent] = EXPANSIONS[parent].map((k) => `${prefix}${k}`);\n}\nconst universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nconst webInlineRenames = {\n\tpaddingStart: \"paddingInlineStart\",\n\tpaddingEnd: \"paddingInlineEnd\",\n\tmarginStart: \"marginInlineStart\",\n\tmarginEnd: \"marginInlineEnd\",\n\tborderStartWidth: \"borderInlineStartWidth\",\n\tborderEndWidth: \"borderInlineEndWidth\",\n\tborderStartColor: \"borderInlineStartColor\",\n\tborderEndColor: \"borderInlineEndColor\",\n\tborderStartStyle: \"borderInlineStartStyle\",\n\tborderEndStyle: \"borderInlineEndStyle\",\n\tborderTopStartRadius: \"borderStartStartRadius\",\n\tborderTopEndRadius: \"borderStartEndRadius\",\n\tborderBottomStartRadius: \"borderEndStartRadius\",\n\tborderBottomEndRadius: \"borderEndEndRadius\",\n\tstart: \"insetInlineStart\",\n\tend: \"insetInlineEnd\"\n};\nconst paddingLogicals = [\"paddingStart\", \"paddingEnd\"];\nconst marginLogicals = [\"marginStart\", \"marginEnd\"];\nconst nativeShorthandLogicals = {\n\tpadding: paddingLogicals,\n\tpaddingHorizontal: paddingLogicals,\n\tmargin: marginLogicals,\n\tmarginHorizontal: marginLogicals,\n\tborderRadius: [\n\t\t\"borderTopStartRadius\",\n\t\t\"borderTopEndRadius\",\n\t\t\"borderBottomStartRadius\",\n\t\t\"borderBottomEndRadius\",\n\t\t\"borderStartStartRadius\",\n\t\t\"borderStartEndRadius\",\n\t\t\"borderEndStartRadius\",\n\t\t\"borderEndEndRadius\"\n\t],\n\tborderWidth: [\"borderStartWidth\", \"borderEndWidth\"],\n\tborderColor: [\"borderStartColor\", \"borderEndColor\"],\n\tgap: [\"rowGap\", \"columnGap\"]\n};\n\nexport { expandStyle, nativeShorthandLogicals };"],"mappings":";;;;AAGA,MAAM,WAAW;CAChB,CAAC,YAAY,CAAC;CACd,CAAC,cAAc,CAAC;CAChB,CAAC,aAAa,MAAM;AACrB;AACA,SAAS,WAAW,OAAO,QAAQ;CAClC,IAAI,OAAO,UAAU,UAAU,OAAO,CAAC,CAAC,QAAQ,KAAK,CAAC;CACtD,IAAI,OAAO,UAAU,UAAU;CAC/B,IAAI,UAAU,CAAC,GAAG,OAAO;CACzB,QAAQ,QAAR;EACC,KAAK,UAAU,OAAO;GACrB,CAAC,YAAY,KAAK;GAClB,CAAC,cAAc,CAAC;GAChB,CAAC,aAAa,MAAM;EACrB;EACA,KAAK;GACJ,IAAI,QAAQ,GAAG,OAAO;IACrB,CAAC,YAAY,KAAK;IAClB,CAAC,cAAc,CAAC;IAChB,CAAC,aAAa,CAAC;GAChB;GACA,IAAI,UAAU,GAAG,OAAO;IACvB,CAAC,YAAY,CAAC;IACd,CAAC,cAAc,CAAC;IAChB,CAAC,aAAa,MAAM;GACrB;GACA,OAAO;IACN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AAClD,MAAM,0BAA0B;CAC/B,SAAS;CACT,mBAAmB;CACnB,QAAQ;CACR,kBAAkB;CAClB,cAAc;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,KAAK,CAAC,UAAU,WAAW;AAC5B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isWeb } from "@tamagui/constants";
|
|
2
2
|
import { getStyleCompat } from "../config.native.js";
|
|
3
|
+
import { splitComponents } from "./borderComponents.native.js";
|
|
3
4
|
import { parseBorderShorthand } from "./parseBorderShorthand.native.js";
|
|
4
5
|
import { parseOutlineShorthand } from "./parseOutlineShorthand.native.js";
|
|
5
6
|
|
|
@@ -13,10 +14,16 @@ var _loop = function(parent2) {
|
|
|
13
14
|
};
|
|
14
15
|
function expandStyle(key, value) {
|
|
15
16
|
arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getStyleCompat();
|
|
16
|
-
if (isAndroid && key === "elevationAndroid") return [["elevation", value]];
|
|
17
17
|
switch (key) {
|
|
18
18
|
case "objectFit": return [["resizeMode", resizeModeMap[value] || "cover"]];
|
|
19
19
|
case "verticalAlign": return [["textAlignVertical", verticalAlignMap[value] || "auto"]];
|
|
20
|
+
case "direction": return [["direction", value], ["writingDirection", directionMap[value] || "auto"]];
|
|
21
|
+
case "gap":
|
|
22
|
+
if (typeof value === "string") {
|
|
23
|
+
var parts = splitComponents(value);
|
|
24
|
+
if (parts.length === 2) return [["rowGap", parts[0]], ["columnGap", parts[1]]];
|
|
25
|
+
}
|
|
26
|
+
return;
|
|
20
27
|
case "position":
|
|
21
28
|
if (value === "fixed" || value === "sticky") return [["position", "absolute"]];
|
|
22
29
|
return;
|
|
@@ -62,6 +69,11 @@ var verticalAlignMap = {
|
|
|
62
69
|
bottom: "bottom",
|
|
63
70
|
auto: "auto"
|
|
64
71
|
};
|
|
72
|
+
var directionMap = {
|
|
73
|
+
ltr: "ltr",
|
|
74
|
+
rtl: "rtl",
|
|
75
|
+
inherit: "auto"
|
|
76
|
+
};
|
|
65
77
|
var all = [
|
|
66
78
|
"Top",
|
|
67
79
|
"Right",
|
|
@@ -159,6 +171,27 @@ var nativeInlineExpansions = {
|
|
|
159
171
|
insetInlineStart: ["left"],
|
|
160
172
|
insetInlineEnd: ["right"]
|
|
161
173
|
};
|
|
174
|
+
var paddingLogicals = ["paddingStart", "paddingEnd"];
|
|
175
|
+
var marginLogicals = ["marginStart", "marginEnd"];
|
|
176
|
+
var nativeShorthandLogicals = {
|
|
177
|
+
padding: paddingLogicals,
|
|
178
|
+
paddingHorizontal: paddingLogicals,
|
|
179
|
+
margin: marginLogicals,
|
|
180
|
+
marginHorizontal: marginLogicals,
|
|
181
|
+
borderRadius: [
|
|
182
|
+
"borderTopStartRadius",
|
|
183
|
+
"borderTopEndRadius",
|
|
184
|
+
"borderBottomStartRadius",
|
|
185
|
+
"borderBottomEndRadius",
|
|
186
|
+
"borderStartStartRadius",
|
|
187
|
+
"borderStartEndRadius",
|
|
188
|
+
"borderEndStartRadius",
|
|
189
|
+
"borderEndEndRadius"
|
|
190
|
+
],
|
|
191
|
+
borderWidth: ["borderStartWidth", "borderEndWidth"],
|
|
192
|
+
borderColor: ["borderStartColor", "borderEndColor"],
|
|
193
|
+
gap: ["rowGap", "columnGap"]
|
|
194
|
+
};
|
|
162
195
|
|
|
163
|
-
export { expandStyle };
|
|
196
|
+
export { expandStyle, nativeShorthandLogicals };
|
|
164
197
|
//# sourceMappingURL=expandStyle.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStyle.native.js","names":[],"sources":["esm/helpers/expandStyle.native.js"],"sourcesContent":["import { isAndroid, isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\nimport { parseBorderShorthand } from \"./parseBorderShorthand\";\nimport { parseOutlineShorthand } from \"./parseOutlineShorthand\";\n\nvar _loop = function(parent2) {\n\tvar _exec;\n\tvar _exec_index;\n\tvar prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);\n\tEXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {\n\t\treturn `${prefix}${k}`;\n\t});\n};\nfunction expandStyle(key, value) {\n\targuments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getStyleCompat();\n\tif (isAndroid && key === \"elevationAndroid\") return [[\"elevation\", value]];\n\tswitch (key) {\n\t\tcase \"objectFit\": return [[\"resizeMode\", resizeModeMap[value] || \"cover\"]];\n\t\tcase \"verticalAlign\": return [[\"textAlignVertical\", verticalAlignMap[value] || \"auto\"]];\n\t\tcase \"position\":\n\t\t\tif (value === \"fixed\" || value === \"sticky\") return [[\"position\", \"absolute\"]];\n\t\t\treturn;\n\t\tcase \"visibility\":\n\t\t\tif (value === \"hidden\") return [[\"opacity\", 0], [\"pointerEvents\", \"none\"]];\n\t\t\treturn [];\n\t\tcase \"backgroundImage\":\n\t\t\tif (typeof value === \"string\") return;\n\t\t\treturn [[\"experimental_backgroundImage\", value]];\n\t\tcase \"border\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed = parseBorderShorthand(value);\n\t\t\t\tif (parsed) return parsed;\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"outline\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed1 = parseOutlineShorthand(value);\n\t\t\t\tif (parsed1) return parsed1;\n\t\t\t}\n\t\t\treturn;\n\t}\n\tif (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in universalExpansions) return universalExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n}\nvar resizeModeMap = {\n\tfill: \"stretch\",\n\tnone: \"center\",\n\t\"scale-down\": \"contain\",\n\tcontain: \"contain\",\n\tcover: \"cover\"\n};\nvar verticalAlignMap = {\n\ttop: \"top\",\n\tmiddle: \"center\",\n\tbottom: \"bottom\",\n\tauto: \"auto\"\n};\nvar all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nvar horiz = [\"Right\", \"Left\"];\nvar vert = [\"Top\", \"Bottom\"];\nvar xy = [\"X\", \"Y\"];\nvar EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (var parent in EXPANSIONS) _loop(parent);\nvar universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nvar nativeInlineExpansions = {\n\tborderInlineColor: [\"borderEndColor\", \"borderStartColor\"],\n\tborderInlineWidth: [\"borderEndWidth\", \"borderStartWidth\"],\n\tborderInlineStyle: [\"borderEndStyle\", \"borderStartStyle\"],\n\tborderInlineStartColor: [\"borderStartColor\"],\n\tborderInlineEndColor: [\"borderEndColor\"],\n\tborderInlineStartWidth: [\"borderStartWidth\"],\n\tborderInlineEndWidth: [\"borderEndWidth\"],\n\tborderInlineStartStyle: [\"borderStartStyle\"],\n\tborderInlineEndStyle: [\"borderEndStyle\"],\n\tmarginInline: [\"marginEnd\", \"marginStart\"],\n\tmarginInlineStart: [\"marginStart\"],\n\tmarginInlineEnd: [\"marginEnd\"],\n\tpaddingInline: [\"paddingEnd\", \"paddingStart\"],\n\tpaddingInlineStart: [\"paddingStart\"],\n\tpaddingInlineEnd: [\"paddingEnd\"],\n\tinsetInlineStart: [\"left\"],\n\tinsetInlineEnd: [\"right\"]\n};\n\nexport { expandStyle };"],"mappings":";;;;;;AAKA,IAAI,QAAQ,SAAS,SAAS;CAC7B,IAAI;CACJ,IAAI;CACJ,IAAI,SAAS,QA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B,CAAC,kBAAkB,mBAAmB;CACxD,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,uBAAuB,CAAC,gBAAgB;CACxC,qBAAqB,CAAC,mBAAmB;CACzC,cAAc,CAAC,WAAW;CAC1B,cAAc,CAAC,WAAW;CAC1B,eAAe,CAAC,UAAU;CAC1B,eAAe,CAAC,UAAU;CAC1B,WAAW,CAAC,QAAQ;CACpB,YAAY,CAAC,OAAO;AACrB;AACA,IAAI,yBAAyB;CAC5B,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,cAAc,CAAC,aAAa,aAAa;CACzC,mBAAmB,CAAC,aAAa;CACjC,iBAAiB,CAAC,WAAW;CAC7B,eAAe,CAAC,cAAc,cAAc;CAC5C,oBAAoB,CAAC,cAAc;CACnC,kBAAkB,CAAC,YAAY;CAC/B,kBAAkB,CAAC,MAAM;CACzB,gBAAgB,CAAC,OAAO;AACzB"}
|
|
1
|
+
{"version":3,"file":"expandStyle.native.js","names":[],"sources":["esm/helpers/expandStyle.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { getStyleCompat } from \"../config\";\nimport { splitComponents } from \"./borderComponents\";\nimport { parseBorderShorthand } from \"./parseBorderShorthand\";\nimport { parseOutlineShorthand } from \"./parseOutlineShorthand\";\n\nvar _loop = function(parent2) {\n\tvar _exec;\n\tvar _exec_index;\n\tvar prefix = parent2.slice(0, (_exec_index = (_exec = /[A-Z]/.exec(parent2)) === null || _exec === void 0 ? void 0 : _exec.index) !== null && _exec_index !== void 0 ? _exec_index : parent2.length);\n\tEXPANSIONS[parent2] = EXPANSIONS[parent2].map(function(k) {\n\t\treturn `${prefix}${k}`;\n\t});\n};\nfunction expandStyle(key, value) {\n\targuments.length > 2 && arguments[2] !== void 0 ? arguments[2] : getStyleCompat();\n\tswitch (key) {\n\t\tcase \"objectFit\": return [[\"resizeMode\", resizeModeMap[value] || \"cover\"]];\n\t\tcase \"verticalAlign\": return [[\"textAlignVertical\", verticalAlignMap[value] || \"auto\"]];\n\t\tcase \"direction\": return [[\"direction\", value], [\"writingDirection\", directionMap[value] || \"auto\"]];\n\t\tcase \"gap\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parts = splitComponents(value);\n\t\t\t\tif (parts.length === 2) return [[\"rowGap\", parts[0]], [\"columnGap\", parts[1]]];\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"position\":\n\t\t\tif (value === \"fixed\" || value === \"sticky\") return [[\"position\", \"absolute\"]];\n\t\t\treturn;\n\t\tcase \"visibility\":\n\t\t\tif (value === \"hidden\") return [[\"opacity\", 0], [\"pointerEvents\", \"none\"]];\n\t\t\treturn [];\n\t\tcase \"backgroundImage\":\n\t\t\tif (typeof value === \"string\") return;\n\t\t\treturn [[\"experimental_backgroundImage\", value]];\n\t\tcase \"border\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed = parseBorderShorthand(value);\n\t\t\t\tif (parsed) return parsed;\n\t\t\t}\n\t\t\treturn;\n\t\tcase \"outline\":\n\t\t\tif (typeof value === \"string\") {\n\t\t\t\tvar parsed1 = parseOutlineShorthand(value);\n\t\t\t\tif (parsed1) return parsed1;\n\t\t\t}\n\t\t\treturn;\n\t}\n\tif (key in nativeInlineExpansions) return nativeInlineExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in universalExpansions) return universalExpansions[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n\tif (key in EXPANSIONS) return EXPANSIONS[key].map(function(k) {\n\t\treturn [k, value];\n\t});\n}\nvar resizeModeMap = {\n\tfill: \"stretch\",\n\tnone: \"center\",\n\t\"scale-down\": \"contain\",\n\tcontain: \"contain\",\n\tcover: \"cover\"\n};\nvar verticalAlignMap = {\n\ttop: \"top\",\n\tmiddle: \"center\",\n\tbottom: \"bottom\",\n\tauto: \"auto\"\n};\nvar directionMap = {\n\tltr: \"ltr\",\n\trtl: \"rtl\",\n\tinherit: \"auto\"\n};\nvar all = [\n\t\"Top\",\n\t\"Right\",\n\t\"Bottom\",\n\t\"Left\"\n];\nvar horiz = [\"Right\", \"Left\"];\nvar vert = [\"Top\", \"Bottom\"];\nvar xy = [\"X\", \"Y\"];\nvar EXPANSIONS = {\n\tborderColor: [\n\t\t\"TopColor\",\n\t\t\"RightColor\",\n\t\t\"BottomColor\",\n\t\t\"LeftColor\"\n\t],\n\tborderRadius: [\n\t\t\"TopLeftRadius\",\n\t\t\"TopRightRadius\",\n\t\t\"BottomRightRadius\",\n\t\t\"BottomLeftRadius\"\n\t],\n\tborderWidth: [\n\t\t\"TopWidth\",\n\t\t\"RightWidth\",\n\t\t\"BottomWidth\",\n\t\t\"LeftWidth\"\n\t],\n\tmargin: all,\n\tmarginHorizontal: horiz,\n\tmarginVertical: vert,\n\tpadding: all,\n\tpaddingHorizontal: horiz,\n\tpaddingVertical: vert,\n\t...isWeb && {\n\t\tborderStyle: [\n\t\t\t\"TopStyle\",\n\t\t\t\"RightStyle\",\n\t\t\t\"BottomStyle\",\n\t\t\t\"LeftStyle\"\n\t\t],\n\t\toverflow: xy,\n\t\toverscrollBehavior: xy\n\t}\n};\nfor (var parent in EXPANSIONS) _loop(parent);\nvar universalExpansions = {\n\tinset: [\n\t\t\"top\",\n\t\t\"right\",\n\t\t\"bottom\",\n\t\t\"left\"\n\t],\n\tinsetBlock: [\"top\", \"bottom\"],\n\tinsetBlockStart: [\"top\"],\n\tinsetBlockEnd: [\"bottom\"],\n\tmarginBlock: [\"marginTop\", \"marginBottom\"],\n\tmarginBlockStart: [\"marginTop\"],\n\tmarginBlockEnd: [\"marginBottom\"],\n\tpaddingBlock: [\"paddingTop\", \"paddingBottom\"],\n\tpaddingBlockStart: [\"paddingTop\"],\n\tpaddingBlockEnd: [\"paddingBottom\"],\n\tborderBlockColor: [\"borderTopColor\", \"borderBottomColor\"],\n\tborderBlockWidth: [\"borderTopWidth\", \"borderBottomWidth\"],\n\tborderBlockStyle: [\"borderTopStyle\", \"borderBottomStyle\"],\n\tborderBlockStartColor: [\"borderTopColor\"],\n\tborderBlockEndColor: [\"borderBottomColor\"],\n\tborderBlockStartWidth: [\"borderTopWidth\"],\n\tborderBlockEndWidth: [\"borderBottomWidth\"],\n\tborderBlockStartStyle: [\"borderTopStyle\"],\n\tborderBlockEndStyle: [\"borderBottomStyle\"],\n\tminBlockSize: [\"minHeight\"],\n\tmaxBlockSize: [\"maxHeight\"],\n\tminInlineSize: [\"minWidth\"],\n\tmaxInlineSize: [\"maxWidth\"],\n\tblockSize: [\"height\"],\n\tinlineSize: [\"width\"]\n};\nvar nativeInlineExpansions = {\n\tborderInlineColor: [\"borderEndColor\", \"borderStartColor\"],\n\tborderInlineWidth: [\"borderEndWidth\", \"borderStartWidth\"],\n\tborderInlineStyle: [\"borderEndStyle\", \"borderStartStyle\"],\n\tborderInlineStartColor: [\"borderStartColor\"],\n\tborderInlineEndColor: [\"borderEndColor\"],\n\tborderInlineStartWidth: [\"borderStartWidth\"],\n\tborderInlineEndWidth: [\"borderEndWidth\"],\n\tborderInlineStartStyle: [\"borderStartStyle\"],\n\tborderInlineEndStyle: [\"borderEndStyle\"],\n\tmarginInline: [\"marginEnd\", \"marginStart\"],\n\tmarginInlineStart: [\"marginStart\"],\n\tmarginInlineEnd: [\"marginEnd\"],\n\tpaddingInline: [\"paddingEnd\", \"paddingStart\"],\n\tpaddingInlineStart: [\"paddingStart\"],\n\tpaddingInlineEnd: [\"paddingEnd\"],\n\tinsetInlineStart: [\"left\"],\n\tinsetInlineEnd: [\"right\"]\n};\nvar paddingLogicals = [\"paddingStart\", \"paddingEnd\"];\nvar marginLogicals = [\"marginStart\", \"marginEnd\"];\nvar nativeShorthandLogicals = {\n\tpadding: paddingLogicals,\n\tpaddingHorizontal: paddingLogicals,\n\tmargin: marginLogicals,\n\tmarginHorizontal: marginLogicals,\n\tborderRadius: [\n\t\t\"borderTopStartRadius\",\n\t\t\"borderTopEndRadius\",\n\t\t\"borderBottomStartRadius\",\n\t\t\"borderBottomEndRadius\",\n\t\t\"borderStartStartRadius\",\n\t\t\"borderStartEndRadius\",\n\t\t\"borderEndStartRadius\",\n\t\t\"borderEndEndRadius\"\n\t],\n\tborderWidth: [\"borderStartWidth\", \"borderEndWidth\"],\n\tborderColor: [\"borderStartColor\", \"borderEndColor\"],\n\tgap: [\"rowGap\", \"columnGap\"]\n};\n\nexport { expandStyle, nativeShorthandLogicals };"],"mappings":";;;;;;;AAMA,IAAI,QAAQ,SAAS,SAAS;CAC7B,IAAI;CACJ,IAAI;CACJ,IAAI,SAAS,QAAQ,MAAM,IAAI,eAAe,QAAQ,QAAQ,KAAK,OAAO,OAAO,QAAQ,UAAU,KAAK,IAAI,KAAK,IAAI,MAAM,WAAW,QAAQ,gBAAgB,KAAK,IAAI,cAAc,QAAQ,MAAM;CACnM,WAAW,WAAW,WAAW,QAAQ,CAAC,IAAI,SAAS,GAAG;EACzD,OAAO,GAAG,SAAS;CACpB,CAAC;AACF;AACA,SAAS,YAAY,KAAK,OAAO;CAChC,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,eAAe;CAChF,QAAQ,KAAR;EACC,KAAK,aAAa,OAAO,CAAC,CAAC,cAAc,cAAc,UAAU,OAAO,CAAC;EACzE,KAAK,iBAAiB,OAAO,CAAC,CAAC,qBAAqB,iBAAiB,UAAU,MAAM,CAAC;EACtF,KAAK,aAAa,OAAO,CAAC,CAAC,aAAa,KAAK,GAAG,CAAC,oBAAoB,aAAa,UAAU,M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AC,QAAQ;CACpB,YAAY,CAAC,OAAO;AACrB;AACA,IAAI,yBAAyB;CAC5B,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,mBAAmB,CAAC,kBAAkB,kBAAkB;CACxD,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,wBAAwB,CAAC,kBAAkB;CAC3C,sBAAsB,CAAC,gBAAgB;CACvC,cAAc,CAAC,aAAa,aAAa;CACzC,mBAAmB,CAAC,aAAa;CACjC,iBAAiB,CAAC,WAAW;CAC7B,eAAe,CAAC,cAAc,cAAc;CAC5C,oBAAoB,CAAC,cAAc;CACnC,kBAAkB,CAAC,YAAY;CAC/B,kBAAkB,CAAC,MAAM;CACzB,gBAAgB,CAAC,OAAO;AACzB;AACA,IAAI,kBAAkB,CAAC,gBAAgB,YAAY;AACnD,IAAI,iBAAiB,CAAC,eAAe,WAAW;AAChD,IAAI,0BAA0B;CAC7B,SAAS;CACT,mBAAmB;CACnB,QAAQ;CACR,kBAAkB;CAClB,cAAc;EACb;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD;CACA,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,aAAa,CAAC,oBAAoB,gBAAgB;CAClD,KAAK,CAAC,UAAU,WAAW;AAC5B"}
|
|
@@ -2,8 +2,14 @@ import { isWeb } from "@tamagui/constants";
|
|
|
2
2
|
import { normalizeShadow } from "./normalizeShadow.mjs";
|
|
3
3
|
|
|
4
4
|
function fixStyles(style) {
|
|
5
|
-
if (style.shadowRadius != null || style.shadowColor || style.shadowOpacity != null || style.shadowOffset)
|
|
6
|
-
|
|
5
|
+
if (style.shadowRadius != null || style.shadowColor || style.shadowOpacity != null || style.shadowOffset) {
|
|
6
|
+
Object.assign(style, normalizeShadow(style));
|
|
7
|
+
}
|
|
8
|
+
for (const key in borderDefaults) {
|
|
9
|
+
if (key in style) {
|
|
10
|
+
style[borderDefaults[key]] ||= "solid";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
7
13
|
}
|
|
8
14
|
const nativeStyle = isWeb ? null : "borderStyle";
|
|
9
15
|
const borderDefaults = {
|
|
@@ -11,7 +17,13 @@ const borderDefaults = {
|
|
|
11
17
|
borderBottomWidth: nativeStyle || "borderBottomStyle",
|
|
12
18
|
borderTopWidth: nativeStyle || "borderTopStyle",
|
|
13
19
|
borderLeftWidth: nativeStyle || "borderLeftStyle",
|
|
14
|
-
borderRightWidth: nativeStyle || "borderRightStyle"
|
|
20
|
+
borderRightWidth: nativeStyle || "borderRightStyle",
|
|
21
|
+
borderBlockWidth: nativeStyle || "borderBlockStyle",
|
|
22
|
+
borderBlockStartWidth: nativeStyle || "borderBlockStartStyle",
|
|
23
|
+
borderBlockEndWidth: nativeStyle || "borderBlockEndStyle",
|
|
24
|
+
borderInlineWidth: nativeStyle || "borderInlineStyle",
|
|
25
|
+
borderInlineStartWidth: nativeStyle || "borderInlineStartStyle",
|
|
26
|
+
borderInlineEndWidth: nativeStyle || "borderInlineEndStyle"
|
|
15
27
|
};
|
|
16
28
|
|
|
17
29
|
export { fixStyles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStyles.js","names":[],"sources":["esm/helpers/expandStyles.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { normalizeShadow } from \"./normalizeShadow\";\
|
|
1
|
+
{"version":3,"file":"expandStyles.js","names":[],"sources":["esm/helpers/expandStyles.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { normalizeShadow } from \"./normalizeShadow\";\nfunction fixStyles(style) {\n if (style.shadowRadius != null || style.shadowColor || style.shadowOpacity != null || style.shadowOffset) {\n Object.assign(style, normalizeShadow(style));\n }\n for (const key in borderDefaults) {\n if (key in style) {\n style[borderDefaults[key]] ||= \"solid\";\n }\n }\n}\nconst nativeStyle = isWeb ? null : \"borderStyle\";\nconst borderDefaults = {\n borderWidth: \"borderStyle\",\n borderBottomWidth: nativeStyle || \"borderBottomStyle\",\n borderTopWidth: nativeStyle || \"borderTopStyle\",\n borderLeftWidth: nativeStyle || \"borderLeftStyle\",\n borderRightWidth: nativeStyle || \"borderRightStyle\",\n borderBlockWidth: nativeStyle || \"borderBlockStyle\",\n borderBlockStartWidth: nativeStyle || \"borderBlockStartStyle\",\n borderBlockEndWidth: nativeStyle || \"borderBlockEndStyle\",\n borderInlineWidth: nativeStyle || \"borderInlineStyle\",\n borderInlineStartWidth: nativeStyle || \"borderInlineStartStyle\",\n borderInlineEndWidth: nativeStyle || \"borderInlineEndStyle\"\n};\nexport {\n fixStyles\n};\n//# sourceMappingURL=expandStyles.js.map\n"],"mappings":";;;;AAEA,SAAS,UAAU,OAAO;CACxB,IAAI,MAAM,gBAAgB,QAAQ,MAAM,eAAe,MAAM,iBAAiB,QAAQ,MAAM,cAAc;EACxG,OAAO,OAAO,OAAO,gBAAgB,KAAK,CAAC;CAC7C;CACA,KAAK,MAAM,OAAO,gBAAgB;EAChC,IAAI,OAAO,OAAO;GAChB,MAAM,eAAe,UAAU;EACjC;CACF;AACF;AACA,MAAM,cAAc,QAAQ,OAAO;AACnC,MAAM,iBAAiB;CACrB,aAAa;CACb,mBAAmB,eAAe;CAClC,gBAAgB,eAAe;CAC/B,iBAAiB,eAAe;CAChC,kBAAkB,eAAe;CACjC,kBAAkB,eAAe;CACjC,uBAAuB,eAAe;CACtC,qBAAqB,eAAe;CACpC,mBAAmB,eAAe;CAClC,wBAAwB,eAAe;CACvC,sBAAsB,eAAe;AACvC"}
|
|
@@ -2,14 +2,14 @@ import { isWeb } from "@tamagui/constants";
|
|
|
2
2
|
import { normalizeShadow } from "./normalizeShadow.native.js";
|
|
3
3
|
|
|
4
4
|
function fixStyles(style) {
|
|
5
|
-
if (
|
|
6
|
-
style
|
|
7
|
-
delete style.elevationAndroid;
|
|
5
|
+
if (style.shadowRadius != null || style.shadowColor || style.shadowOpacity != null || style.shadowOffset) {
|
|
6
|
+
Object.assign(style, normalizeShadow(style));
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
for (var key in borderDefaults) {
|
|
9
|
+
if (key in style) {
|
|
10
|
+
var _style, _borderDefaults_key;
|
|
11
|
+
(_style = style)[_borderDefaults_key = borderDefaults[key]] || (_style[_borderDefaults_key] = "solid");
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
var nativeStyle = isWeb ? null : "borderStyle";
|
|
@@ -18,7 +18,13 @@ var borderDefaults = {
|
|
|
18
18
|
borderBottomWidth: nativeStyle || "borderBottomStyle",
|
|
19
19
|
borderTopWidth: nativeStyle || "borderTopStyle",
|
|
20
20
|
borderLeftWidth: nativeStyle || "borderLeftStyle",
|
|
21
|
-
borderRightWidth: nativeStyle || "borderRightStyle"
|
|
21
|
+
borderRightWidth: nativeStyle || "borderRightStyle",
|
|
22
|
+
borderBlockWidth: nativeStyle || "borderBlockStyle",
|
|
23
|
+
borderBlockStartWidth: nativeStyle || "borderBlockStartStyle",
|
|
24
|
+
borderBlockEndWidth: nativeStyle || "borderBlockEndStyle",
|
|
25
|
+
borderInlineWidth: nativeStyle || "borderInlineStyle",
|
|
26
|
+
borderInlineStartWidth: nativeStyle || "borderInlineStartStyle",
|
|
27
|
+
borderInlineEndWidth: nativeStyle || "borderInlineEndStyle"
|
|
22
28
|
};
|
|
23
29
|
|
|
24
30
|
export { fixStyles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandStyles.native.js","names":[],"sources":["esm/helpers/expandStyles.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { normalizeShadow } from \"./normalizeShadow\";\
|
|
1
|
+
{"version":3,"file":"expandStyles.native.js","names":[],"sources":["esm/helpers/expandStyles.native.js"],"sourcesContent":["import { isWeb } from \"@tamagui/constants\";\nimport { normalizeShadow } from \"./normalizeShadow\";\nfunction fixStyles(style) {\n if (style.shadowRadius != null || style.shadowColor || style.shadowOpacity != null || style.shadowOffset) {\n Object.assign(style, normalizeShadow(style));\n }\n for (var key in borderDefaults) {\n if (key in style) {\n var _style, _borderDefaults_key;\n (_style = style)[_borderDefaults_key = borderDefaults[key]] || (_style[_borderDefaults_key] = \"solid\");\n }\n }\n}\nvar nativeStyle = isWeb ? null : \"borderStyle\";\nvar borderDefaults = {\n borderWidth: \"borderStyle\",\n borderBottomWidth: nativeStyle || \"borderBottomStyle\",\n borderTopWidth: nativeStyle || \"borderTopStyle\",\n borderLeftWidth: nativeStyle || \"borderLeftStyle\",\n borderRightWidth: nativeStyle || \"borderRightStyle\",\n borderBlockWidth: nativeStyle || \"borderBlockStyle\",\n borderBlockStartWidth: nativeStyle || \"borderBlockStartStyle\",\n borderBlockEndWidth: nativeStyle || \"borderBlockEndStyle\",\n borderInlineWidth: nativeStyle || \"borderInlineStyle\",\n borderInlineStartWidth: nativeStyle || \"borderInlineStartStyle\",\n borderInlineEndWidth: nativeStyle || \"borderInlineEndStyle\"\n};\nexport {\n fixStyles\n};\n//# sourceMappingURL=expandStyles.js.map\n"],"mappings":";;;;AAEA,SAAS,UAAU,OAAO;CACxB,IAAI,MAAM,gBAAgB,QAAQ,MAAM,eAAe,MAAM,iBAAiB,QAAQ,MAAM,cAAc;EACxG,OAAO,OAAO,OAAO,gBAAgB,KAAK,CAAC;CAC7C;CACA,KAAK,IAAI,OAAO,gBAAgB;EAC9B,IAAI,OAAO,OAAO;GAChB,IAAI,QAAQ;GACZ,CAAC,SAAS,MAAK,CAAE,sBAAsB,eAAe,UAAU,OAAO,uBAAuB;EAChG;CACF;AACF;AACA,IAAI,cAAc,QAAQ,OAAO;AACjC,IAAI,iBAAiB;CACnB,aAAa;CACb,mBAAmB,eAAe;CAClC,gBAAgB,eAAe;CAC/B,iBAAiB,eAAe;CAChC,kBAAkB,eAAe;CACjC,kBAAkB,eAAe;CACjC,uBAAuB,eAAe;CACtC,qBAAqB,eAAe;CACpC,mBAAmB,eAAe;CAClC,wBAAwB,eAAe;CACvC,sBAAsB,eAAe;AACvC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
function fluid(arg1, arg2, arg3) {
|
|
2
|
+
let min;
|
|
3
|
+
let max;
|
|
4
|
+
let from = 375;
|
|
5
|
+
let to = 1200;
|
|
6
|
+
let unit = "cqi";
|
|
7
|
+
if (typeof arg1 === "number") {
|
|
8
|
+
min = arg1;
|
|
9
|
+
max = arg2;
|
|
10
|
+
if (arg3) {
|
|
11
|
+
if (arg3.from !== void 0) from = arg3.from;
|
|
12
|
+
if (arg3.to !== void 0) to = arg3.to;
|
|
13
|
+
if (arg3.unit !== void 0) unit = arg3.unit;
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
min = arg1.min;
|
|
17
|
+
max = arg1.max;
|
|
18
|
+
if (arg1.from !== void 0) from = arg1.from;
|
|
19
|
+
if (arg1.to !== void 0) to = arg1.to;
|
|
20
|
+
if (arg1.unit !== void 0) unit = arg1.unit;
|
|
21
|
+
}
|
|
22
|
+
const slope = (max - min) / (to - from);
|
|
23
|
+
const intercept = min - slope * from;
|
|
24
|
+
const slopePercent = +(slope * 100).toFixed(4);
|
|
25
|
+
const interceptRounded = +intercept.toFixed(2);
|
|
26
|
+
let expr = `${slopePercent}${unit}`;
|
|
27
|
+
if (interceptRounded > 0) {
|
|
28
|
+
expr += ` + ${interceptRounded}px`;
|
|
29
|
+
} else if (interceptRounded < 0) {
|
|
30
|
+
expr += ` - ${Math.abs(interceptRounded)}px`;
|
|
31
|
+
}
|
|
32
|
+
return `clamp(${min}px, ${expr}, ${max}px)`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { fluid };
|
|
36
|
+
//# sourceMappingURL=fluid.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid.js","names":[],"sources":["esm/helpers/fluid.js"],"sourcesContent":["function fluid(arg1, arg2, arg3) {\n let min;\n let max;\n let from = 375;\n let to = 1200;\n let unit = \"cqi\";\n if (typeof arg1 === \"number\") {\n min = arg1;\n max = arg2;\n if (arg3) {\n if (arg3.from !== void 0) from = arg3.from;\n if (arg3.to !== void 0) to = arg3.to;\n if (arg3.unit !== void 0) unit = arg3.unit;\n }\n } else {\n min = arg1.min;\n max = arg1.max;\n if (arg1.from !== void 0) from = arg1.from;\n if (arg1.to !== void 0) to = arg1.to;\n if (arg1.unit !== void 0) unit = arg1.unit;\n }\n const slope = (max - min) / (to - from);\n const intercept = min - slope * from;\n const slopePercent = +(slope * 100).toFixed(4);\n const interceptRounded = +intercept.toFixed(2);\n let expr = `${slopePercent}${unit}`;\n if (interceptRounded > 0) {\n expr += ` + ${interceptRounded}px`;\n } else if (interceptRounded < 0) {\n expr += ` - ${Math.abs(interceptRounded)}px`;\n }\n return `clamp(${min}px, ${expr}, ${max}px)`;\n}\nexport {\n fluid\n};\n//# sourceMappingURL=fluid.js.map\n"],"mappings":";AAAA,SAAS,MAAM,MAAM,MAAM,MAAM;CAC/B,IAAI;CACJ,IAAI;CACJ,IAAI,OAAO;CACX,IAAI,KAAK;CACT,IAAI,OAAO;CACX,IAAI,OAAO,SAAS,UAAU;EAC5B,MAAM;EACN,MAAM;EACN,IAAI,MAAM;GACR,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;GACtC,IAAI,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK;GAClC,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;EACxC;CACF,OAAO;EACL,MAAM,KAAK;EACX,MAAM,KAAK;EACX,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;EACtC,IAAI,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK;EAClC,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;CACxC;CACA,MAAM,SAAS,MAAM,QAAQ,KAAK;CAClC,MAAM,YAAY,MAAM,QAAQ;CAChC,MAAM,eAAe,EAAE,QAAQ,IAAG,CAAE,QAAQ,CAAC;CAC7C,MAAM,mBAAmB,CAAC,UAAU,QAAQ,CAAC;CAC7C,IAAI,OAAO,GAAG,eAAe;CAC7B,IAAI,mBAAmB,GAAG;EACxB,QAAQ,MAAM,iBAAiB;CACjC,OAAO,IAAI,mBAAmB,GAAG;EAC/B,QAAQ,MAAM,KAAK,IAAI,gBAAgB,EAAE;CAC3C;CACA,OAAO,SAAS,IAAI,MAAM,KAAK,IAAI,IAAI;AACzC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
function fluid(arg1, arg2, arg3) {
|
|
2
|
+
var min;
|
|
3
|
+
var max;
|
|
4
|
+
var from = 375;
|
|
5
|
+
var to = 1200;
|
|
6
|
+
var unit = "cqi";
|
|
7
|
+
if (typeof arg1 === "number") {
|
|
8
|
+
min = arg1;
|
|
9
|
+
max = arg2;
|
|
10
|
+
if (arg3) {
|
|
11
|
+
if (arg3.from !== void 0) from = arg3.from;
|
|
12
|
+
if (arg3.to !== void 0) to = arg3.to;
|
|
13
|
+
if (arg3.unit !== void 0) unit = arg3.unit;
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
min = arg1.min;
|
|
17
|
+
max = arg1.max;
|
|
18
|
+
if (arg1.from !== void 0) from = arg1.from;
|
|
19
|
+
if (arg1.to !== void 0) to = arg1.to;
|
|
20
|
+
if (arg1.unit !== void 0) unit = arg1.unit;
|
|
21
|
+
}
|
|
22
|
+
var slope = (max - min) / (to - from);
|
|
23
|
+
var intercept = min - slope * from;
|
|
24
|
+
var slopePercent = +(slope * 100).toFixed(4);
|
|
25
|
+
var interceptRounded = +intercept.toFixed(2);
|
|
26
|
+
var expr = `${slopePercent}${unit}`;
|
|
27
|
+
if (interceptRounded > 0) {
|
|
28
|
+
expr += ` + ${interceptRounded}px`;
|
|
29
|
+
} else if (interceptRounded < 0) {
|
|
30
|
+
expr += ` - ${Math.abs(interceptRounded)}px`;
|
|
31
|
+
}
|
|
32
|
+
return `clamp(${min}px, ${expr}, ${max}px)`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { fluid };
|
|
36
|
+
//# sourceMappingURL=fluid.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fluid.native.js","names":[],"sources":["esm/helpers/fluid.native.js"],"sourcesContent":["function fluid(arg1, arg2, arg3) {\n var min;\n var max;\n var from = 375;\n var to = 1200;\n var unit = \"cqi\";\n if (typeof arg1 === \"number\") {\n min = arg1;\n max = arg2;\n if (arg3) {\n if (arg3.from !== void 0) from = arg3.from;\n if (arg3.to !== void 0) to = arg3.to;\n if (arg3.unit !== void 0) unit = arg3.unit;\n }\n } else {\n min = arg1.min;\n max = arg1.max;\n if (arg1.from !== void 0) from = arg1.from;\n if (arg1.to !== void 0) to = arg1.to;\n if (arg1.unit !== void 0) unit = arg1.unit;\n }\n var slope = (max - min) / (to - from);\n var intercept = min - slope * from;\n var slopePercent = +(slope * 100).toFixed(4);\n var interceptRounded = +intercept.toFixed(2);\n var expr = `${slopePercent}${unit}`;\n if (interceptRounded > 0) {\n expr += ` + ${interceptRounded}px`;\n } else if (interceptRounded < 0) {\n expr += ` - ${Math.abs(interceptRounded)}px`;\n }\n return `clamp(${min}px, ${expr}, ${max}px)`;\n}\nexport {\n fluid\n};\n//# sourceMappingURL=fluid.js.map\n"],"mappings":";AAAA,SAAS,MAAM,MAAM,MAAM,MAAM;CAC/B,IAAI;CACJ,IAAI;CACJ,IAAI,OAAO;CACX,IAAI,KAAK;CACT,IAAI,OAAO;CACX,IAAI,OAAO,SAAS,UAAU;EAC5B,MAAM;EACN,MAAM;EACN,IAAI,MAAM;GACR,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;GACtC,IAAI,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK;GAClC,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;EACxC;CACF,OAAO;EACL,MAAM,KAAK;EACX,MAAM,KAAK;EACX,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;EACtC,IAAI,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK;EAClC,IAAI,KAAK,SAAS,KAAK,GAAG,OAAO,KAAK;CACxC;CACA,IAAI,SAAS,MAAM,QAAQ,KAAK;CAChC,IAAI,YAAY,MAAM,QAAQ;CAC9B,IAAI,eAAe,EAAE,QAAQ,IAAG,CAAE,QAAQ,CAAC;CAC3C,IAAI,mBAAmB,CAAC,UAAU,QAAQ,CAAC;CAC3C,IAAI,OAAO,GAAG,eAAe;CAC7B,IAAI,mBAAmB,GAAG;EACxB,QAAQ,MAAM,iBAAiB;CACjC,OAAO,IAAI,mBAAmB,GAAG;EAC/B,QAAQ,MAAM,KAAK,IAAI,gBAAgB,EAAE;CAC3C;CACA,OAAO,SAAS,IAAI,MAAM,KAAK,IAAI,IAAI;AACzC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
function _type_of(obj) {
|
|
2
|
-
"@swc/helpers - typeof";
|
|
3
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
4
|
-
}
|
|
5
1
|
var maxDiagnosticValueLength = 160;
|
|
6
2
|
function formatDiagnosticValue(value) {
|
|
7
3
|
var depth = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, seen = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : /* @__PURE__ */ new WeakSet();
|
|
@@ -12,9 +8,9 @@ function formatDiagnosticValue(value) {
|
|
|
12
8
|
if (value == null || typeof value === "number" || typeof value === "boolean") {
|
|
13
9
|
return String(value);
|
|
14
10
|
}
|
|
15
|
-
if (
|
|
11
|
+
if (typeof value === "bigint") return `${value}n`;
|
|
16
12
|
if (typeof value === "function") return `[Function ${value.name || "anonymous"}]`;
|
|
17
|
-
if (
|
|
13
|
+
if (typeof value !== "object") return String(value);
|
|
18
14
|
if (seen.has(value)) return "[Circular]";
|
|
19
15
|
if (depth === 2) return Array.isArray(value) ? "[Array]" : "[Object]";
|
|
20
16
|
seen.add(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatDiagnostic.native.js","names":[],"sources":["esm/helpers/formatDiagnostic.native.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"formatDiagnostic.native.js","names":[],"sources":["esm/helpers/formatDiagnostic.native.js"],"sourcesContent":["var maxDiagnosticValueLength = 160;\nfunction formatDiagnosticValue(value) {\n var depth = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, seen = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : /* @__PURE__ */ new WeakSet();\n if (typeof value === \"string\") {\n var output = value.length > maxDiagnosticValueLength ? `${value.slice(0, maxDiagnosticValueLength - 1)}\\u2026` : value;\n return JSON.stringify(output);\n }\n if (value == null || typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n if (typeof value === \"bigint\") return `${value}n`;\n if (typeof value === \"function\") return `[Function ${value.name || \"anonymous\"}]`;\n if (typeof value !== \"object\") return String(value);\n if (seen.has(value)) return \"[Circular]\";\n if (depth === 2) return Array.isArray(value) ? \"[Array]\" : \"[Object]\";\n seen.add(value);\n if (Array.isArray(value)) {\n var items = value.slice(0, 5).map(function(item) {\n return formatDiagnosticValue(item, depth + 1, seen);\n });\n if (value.length > 5) items.push(`\\u2026 ${value.length - 5} more`);\n return `[${items.join(\", \")}]`;\n }\n var keys = [];\n for (var key in value) {\n keys.push(key);\n if (keys.length === 6) break;\n }\n var hasMore = keys.length === 6;\n if (hasMore) keys.pop();\n var items1 = keys.map(function(key2) {\n try {\n return `${key2}: ${formatDiagnosticValue(value[key2], depth + 1, seen)}`;\n } catch (e) {\n return `${key2}: [Unavailable]`;\n }\n });\n if (hasMore) items1.push(\"\\u2026 more\");\n return `{ ${items1.join(\", \")} }`;\n}\nfunction formatDiagnostic(code, component, message, action, prop, received) {\n if (process.env.NODE_ENV === \"development\") {\n var formattedValue = prop ? formatDiagnosticValue(received) : \"\";\n var boundedValue = formattedValue.length > maxDiagnosticValueLength ? `${formattedValue.slice(0, maxDiagnosticValueLength - 1)}\\u2026` : formattedValue;\n var value = prop ? ` Received ${prop}=${boundedValue}.` : \"\";\n return `${code} ${component}: ${message}.${value} ${action}`;\n }\n return `${code}: ${message}`;\n}\nexport {\n formatDiagnostic\n};\n//# sourceMappingURL=formatDiagnostic.js.map\n"],"mappings":";AAAA,IAAI,2BAA2B;AAC/B,SAAS,sBAAsB,OAAO;CACpC,IAAI,QAAQ,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,GAAG,OAAO,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,qBAAqB,IAAI,QAAQ;CACpL,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,SAAS,MAAM,SAAS,2BAA2B,GAAG,MAAM,MAAM,GAAG,2BAA2B,CAAC,EAAE,UAAU;EACjH,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,IAAI,SAAS,QAAQ,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW;EAC5E,OAAO,OAAO,KAAK;CACrB;CACA,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,MAAM;CAC/C,IAAI,OAAO,UAAU,YAAY,OAAO,aAAa,MAAM,QAAQ,YAAY;CAC/E,IAAI,OAAO,UAAU,UAAU,OAAO,OAAO,KAAK;CAClD,IAAI,KAAK,IAAI,KAAK,GAAG,OAAO;CAC5B,IAAI,UAAU,GAAG,OAAO,MAAM,QAAQ,KAAK,IAAI,YAAY;CAC3D,KAAK,IAAI,KAAK;CACd,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,IAAI,QAAQ,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,SAAS,MAAM;GAC/C,OAAO,sBAAsB,MAAM,QAAQ,GAAG,IAAI;EACpD,CAAC;EACD,IAAI,MAAM,SAAS,GAAG,MAAM,KAAK,UAAU,MAAM,SAAS,EAAE,MAAM;EAClE,OAAO,IAAI,MAAM,KAAK,IAAI,EAAE;CAC9B;CACA,IAAI,OAAO,CAAC;CACZ,KAAK,IAAI,OAAO,OAAO;EACrB,KAAK,KAAK,GAAG;EACb,IAAI,KAAK,WAAW,GAAG;CACzB;CACA,IAAI,UAAU,KAAK,WAAW;CAC9B,IAAI,SAAS,KAAK,IAAI;CACtB,IAAI,SAAS,KAAK,IAAI,SAAS,MAAM;EACnC,IAAI;GACF,OAAO,GAAG,KAAK,IAAI,sBAAsB,MAAM,OAAO,QAAQ,GAAG,IAAI;EACvE,SAAS,GAAG;GACV,OAAO,GAAG,KAAK;EACjB;CACF,CAAC;CACD,IAAI,SAAS,OAAO,KAAK,QAAa;CACtC,OAAO,KAAK,OAAO,KAAK,IAAI,EAAE;AAChC;AACA,SAAS,iBAAiB,MAAM,WAAW,SAAS,QAAQ,MAAM,UAAU;CAC1E,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,IAAI,iBAAiB,OAAO,sBAAsB,QAAQ,IAAI;EAC9D,IAAI,eAAe,eAAe,SAAS,2BAA2B,GAAG,eAAe,MAAM,GAAG,2BAA2B,CAAC,EAAE,UAAU;EACzI,IAAI,QAAQ,OAAO,aAAa,KAAK,GAAG,aAAa,KAAK;EAC1D,OAAO,GAAG,KAAK,GAAG,UAAU,IAAI,QAAQ,GAAG,MAAM,GAAG;CACtD;CACA,OAAO,GAAG,KAAK,IAAI;AACrB"}
|
|
@@ -6,7 +6,7 @@ import { normalizeValueWithProperty } from "./normalizeValueWithProperty.mjs";
|
|
|
6
6
|
import { styleToCSS, styleToCSS as styleToCSS2 } from "./styleToCSS.mjs";
|
|
7
7
|
import { transformsToString } from "./transformsToString.mjs";
|
|
8
8
|
|
|
9
|
-
const canGenerateCSS =
|
|
9
|
+
const canGenerateCSS = process.env.TAMAGUI_RUNTIME !== "island";
|
|
10
10
|
function directStyleSignature(property, value, conditionKey = "") {
|
|
11
11
|
return "" + property + "" + conditionKey + "" + String(value);
|
|
12
12
|
}
|
|
@@ -82,7 +82,7 @@ function addComposition(state, property) {
|
|
|
82
82
|
state.classNames[property] = identifier;
|
|
83
83
|
}
|
|
84
84
|
function getCSSStylesAtomic(style) {
|
|
85
|
-
if (process.env.
|
|
85
|
+
if (process.env.TAMAGUI_RUNTIME === "island") return [];
|
|
86
86
|
styleToCSS(style);
|
|
87
87
|
const out = [];
|
|
88
88
|
for (const key in style) {
|
|
@@ -94,7 +94,7 @@ function getCSSStylesAtomic(style) {
|
|
|
94
94
|
return out;
|
|
95
95
|
}
|
|
96
96
|
function getCSSStyleAtomic(key, val, condition = "", wrappers, identity, direct = false, identityKey = key, classRepetitions = 1) {
|
|
97
|
-
if (process.env.
|
|
97
|
+
if (process.env.TAMAGUI_RUNTIME === "island") return;
|
|
98
98
|
return getStyleObject(val, key, condition, wrappers, identity, direct, identityKey, classRepetitions);
|
|
99
99
|
}
|
|
100
100
|
let conf = null;
|
|
@@ -133,7 +133,7 @@ function syncAtomicConfig() {
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
function buildAtomicSlotCSS(atomicKey, entries, signature) {
|
|
136
|
-
if (process.env.
|
|
136
|
+
if (process.env.TAMAGUI_RUNTIME === "island") return;
|
|
137
137
|
syncAtomicConfig();
|
|
138
138
|
let bySignature = slotIdentities.get(atomicKey);
|
|
139
139
|
if (!bySignature) slotIdentities.set(atomicKey, bySignature = /* @__PURE__ */ new Map());
|
|
@@ -177,7 +177,7 @@ const hcache = {};
|
|
|
177
177
|
const toHyphenLower = (match) => `-${match.toLowerCase()}`;
|
|
178
178
|
const hyphenateStyleName = (key) => {
|
|
179
179
|
if (key in hcache) return hcache[key];
|
|
180
|
-
const val = key.replace(/[A-Z]/g, toHyphenLower);
|
|
180
|
+
const val = key.replace(/[A-Z]/g, toHyphenLower).replace(/^ms-/, "-ms-");
|
|
181
181
|
hcache[key] = val;
|
|
182
182
|
return val;
|
|
183
183
|
};
|
|
@@ -209,7 +209,7 @@ function createAtomicRules(identifier, property, value, condition = "", wrappers
|
|
|
209
209
|
if (direct) {
|
|
210
210
|
const subject = value === "none" || value === "box-none" ? "none" : "auto";
|
|
211
211
|
const children = value === "none" || value === "box-only" ? "none" : "auto";
|
|
212
|
-
rules.push(`${selector}{pointer-events:${subject}}`,
|
|
212
|
+
rules.push(`${selector}{pointer-events:${subject}}`, `:where(${selector})>*{pointer-events:${children}}`);
|
|
213
213
|
break;
|
|
214
214
|
}
|
|
215
215
|
let finalValue = value;
|