@tamagui/web 3.0.0-beta.807.1 → 3.0.0-beta.881.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config.cjs +1 -1
- package/dist/cjs/config.native.cjs +1 -1
- package/dist/cjs/config.native.js +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/createComponent.cjs +40 -19
- package/dist/cjs/createComponent.native.cjs +42 -21
- package/dist/cjs/createComponent.native.js +42 -21
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +54 -4
- package/dist/cjs/createStyledHOC.native.cjs +55 -4
- package/dist/cjs/createStyledHOC.native.js +55 -4
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createTokens.cjs +1 -1
- package/dist/cjs/createTokens.native.cjs +1 -1
- package/dist/cjs/createTokens.native.js +1 -1
- package/dist/cjs/createTokens.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +0 -10
- package/dist/cjs/createVariable.native.cjs +0 -10
- package/dist/cjs/createVariable.native.js +0 -10
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/dom/html.cjs +147 -99
- package/dist/cjs/dom/htmlRuntime.native.cjs +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js +6 -2
- package/dist/cjs/dom/htmlRuntime.native.js.map +1 -1
- package/dist/cjs/dom/primitives.native.cjs +16 -13
- package/dist/cjs/dom/primitives.native.js +16 -13
- package/dist/cjs/dom/primitives.native.js.map +1 -1
- package/dist/cjs/helpers/borderComponents.cjs +62 -0
- package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
- package/dist/cjs/helpers/borderComponents.native.js +84 -0
- package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
- package/dist/cjs/helpers/componentDisplayName.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.cjs +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js +1 -11
- package/dist/cjs/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
- package/dist/cjs/helpers/createStyledContext.cjs +10 -18
- package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.js +8 -10
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +133 -114
- package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +1063 -2168
- package/dist/cjs/helpers/getSplitStyles.native.cjs +1115 -2515
- package/dist/cjs/helpers/getSplitStyles.native.js +1115 -2515
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/grammarConfig.cjs +163 -1
- package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +9 -8
- package/dist/cjs/helpers/log.native.cjs +9 -8
- package/dist/cjs/helpers/log.native.js +9 -8
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.cjs +44 -13
- package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js +79 -14
- package/dist/cjs/helpers/mergeVariants.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/nativeStyleEngine.cjs +34 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
- package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/cjs/helpers/splitStyleProps.cjs +46 -0
- package/dist/cjs/helpers/splitStyleProps.native.cjs +49 -0
- package/dist/cjs/helpers/splitStyleProps.native.js +51 -0
- package/dist/cjs/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/cjs/helpers/{getDefaultProps.native.cjs → styleStaticConfig.cjs} +7 -8
- package/dist/cjs/helpers/{getDefaultProps.native.js → styleStaticConfig.native.cjs} +7 -8
- package/dist/cjs/helpers/styleStaticConfig.native.js +31 -0
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/cjs/helpers/styledDynamic.cjs +160 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
- package/dist/cjs/helpers/styledDynamic.native.js +197 -0
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +12 -74
- package/dist/cjs/helpers/tokenCategories.native.cjs +12 -76
- package/dist/cjs/helpers/tokenCategories.native.js +12 -76
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variableValue.cjs +17 -12
- package/dist/cjs/helpers/variableValue.native.cjs +46 -23
- package/dist/cjs/helpers/variableValue.native.js +46 -23
- package/dist/cjs/helpers/variableValue.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +5 -4
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
- package/dist/cjs/helpers/warnOnce.native.js +6 -4
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +41 -82
- package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
- package/dist/cjs/hooks/useComponentState.native.js +45 -84
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.js +2 -2
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/hooks/useSplitStyles.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.cjs +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js +2 -2
- package/dist/cjs/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/cjs/{helpers/getDefaultProps.cjs → hooks/useStyle.cjs} +10 -4
- package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.native.cjs} +16 -6
- package/dist/cjs/hooks/useStyle.native.js +34 -0
- package/dist/cjs/hooks/useStyle.native.js.map +1 -0
- package/dist/cjs/hooks/useThemeState.cjs +25 -90
- package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
- package/dist/cjs/hooks/useThemeState.native.js +34 -94
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +9 -12
- package/dist/cjs/index.native.cjs +9 -12
- package/dist/cjs/index.native.js +9 -12
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/internal-runtime.cjs +8 -7
- package/dist/cjs/internal-runtime.native.cjs +8 -7
- package/dist/cjs/internal-runtime.native.js +8 -7
- package/dist/cjs/internal-runtime.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +8 -7
- package/dist/cjs/static-resolve.native.cjs +8 -7
- package/dist/cjs/static-resolve.native.js +8 -7
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +91 -0
- package/dist/cjs/style.native.cjs +98 -0
- package/dist/cjs/style.native.js +100 -0
- package/dist/cjs/style.native.js.map +1 -0
- package/dist/cjs/styled.cjs +15 -62
- package/dist/cjs/styled.native.cjs +15 -64
- package/dist/cjs/styled.native.js +15 -64
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +4 -22
- package/dist/cjs/types.native.cjs +4 -22
- package/dist/cjs/types.native.js +4 -22
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +21 -14
- package/dist/cjs/views/Text.native.cjs +5 -2
- package/dist/cjs/views/Text.native.js +5 -2
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +2 -2
- package/dist/cjs/views/Theme.native.cjs +2 -2
- package/dist/cjs/views/Theme.native.js +2 -2
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -4
- package/dist/cjs/views/View.cjs +4 -2
- package/dist/cjs/views/View.native.cjs +4 -2
- package/dist/cjs/views/View.native.js +4 -2
- package/dist/cjs/views/View.native.js.map +1 -1
- package/dist/esm/config.mjs +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/createComponent.mjs +41 -20
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +43 -22
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +55 -5
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +56 -5
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createTokens.mjs +1 -1
- package/dist/esm/createTokens.mjs.map +1 -1
- package/dist/esm/createTokens.native.js +1 -1
- package/dist/esm/createTokens.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +1 -9
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +1 -9
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/dom/html.mjs +147 -99
- package/dist/esm/dom/html.mjs.map +1 -1
- package/dist/esm/dom/htmlRuntime.native.js +7 -3
- package/dist/esm/dom/htmlRuntime.native.js.map +1 -1
- package/dist/esm/dom/primitives.native.js +16 -13
- package/dist/esm/dom/primitives.native.js.map +1 -1
- package/dist/esm/helpers/borderComponents.mjs +37 -0
- package/dist/esm/helpers/borderComponents.mjs.map +1 -0
- package/dist/esm/helpers/borderComponents.native.js +55 -0
- package/dist/esm/helpers/borderComponents.native.js.map +1 -0
- package/dist/esm/helpers/componentDisplayName.mjs +1 -8
- package/dist/esm/helpers/componentDisplayName.mjs.map +1 -1
- package/dist/esm/helpers/componentDisplayName.native.js +1 -8
- package/dist/esm/helpers/componentDisplayName.native.js.map +1 -1
- package/dist/esm/helpers/createDesignSystem.mjs +0 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs +10 -18
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +14 -18
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +8 -10
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +8 -10
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +131 -114
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
- package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.mjs +5 -1
- package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
- package/dist/esm/helpers/getDynamicVal.native.js +5 -1
- package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +1052 -2151
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +1090 -2481
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +164 -2
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +187 -2
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +5 -2
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +7 -2
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +9 -8
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +9 -8
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.mjs +44 -13
- package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +79 -14
- package/dist/esm/helpers/mergeVariants.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/nativeStyleEngine.mjs +34 -15
- package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
- package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
- package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
- package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
- package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
- package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/esm/helpers/splitStyleProps.mjs +27 -0
- package/dist/esm/helpers/splitStyleProps.mjs.map +1 -0
- package/dist/esm/helpers/splitStyleProps.native.js +28 -0
- package/dist/esm/helpers/splitStyleProps.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +8 -0
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.native.js +8 -0
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/esm/helpers/styledDynamic.mjs +136 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
- package/dist/esm/helpers/styledDynamic.native.js +169 -0
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +12 -72
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +12 -74
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variableValue.mjs +17 -12
- package/dist/esm/helpers/variableValue.mjs.map +1 -1
- package/dist/esm/helpers/variableValue.native.js +46 -23
- package/dist/esm/helpers/variableValue.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +5 -4
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -4
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +41 -82
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +45 -84
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -2
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useSplitStyles.mjs +2 -2
- package/dist/esm/hooks/useSplitStyles.mjs.map +1 -1
- package/dist/esm/hooks/useSplitStyles.native.js +2 -2
- package/dist/esm/hooks/useSplitStyles.native.js.map +1 -1
- package/dist/esm/hooks/useStyle.mjs +11 -0
- package/dist/esm/hooks/useStyle.mjs.map +1 -0
- package/dist/esm/hooks/useStyle.native.js +11 -0
- package/dist/esm/hooks/useStyle.native.js.map +1 -0
- package/dist/esm/hooks/useThemeState.mjs +25 -90
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +34 -94
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/index.native.js +8 -8
- package/dist/esm/internal-runtime.mjs +8 -7
- package/dist/esm/internal-runtime.mjs.map +1 -1
- package/dist/esm/internal-runtime.native.js +8 -7
- package/dist/esm/internal-runtime.native.js.map +1 -1
- package/dist/esm/static-resolve.mjs +11 -9
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +11 -9
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +58 -0
- package/dist/esm/style.mjs.map +1 -0
- package/dist/esm/style.native.js +63 -0
- package/dist/esm/style.native.js.map +1 -0
- package/dist/esm/styled.mjs +17 -62
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +17 -64
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +3 -21
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +3 -21
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +1 -2
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +1 -2
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +21 -14
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Text.native.js +4 -2
- package/dist/esm/views/Text.native.js.map +1 -1
- package/dist/esm/views/Theme.mjs +2 -2
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +2 -2
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -4
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/dist/esm/views/View.mjs +4 -2
- package/dist/esm/views/View.mjs.map +1 -1
- package/dist/esm/views/View.native.js +4 -2
- package/dist/esm/views/View.native.js.map +1 -1
- package/package.json +15 -15
- package/src/config.ts +1 -1
- package/src/createComponent.tsx +62 -31
- package/src/createStyledHOC.tsx +56 -9
- package/src/createTokens.ts +1 -1
- package/src/createVariable.ts +0 -10
- package/src/dom/html.tsx +778 -877
- package/src/dom/htmlRuntime.native.tsx +7 -3
- package/src/dom/primitives.native.tsx +30 -39
- package/src/helpers/borderComponents.ts +62 -0
- package/src/helpers/componentDisplayName.ts +0 -11
- package/src/helpers/createDesignSystem.ts +0 -2
- package/src/helpers/createStyledContext.tsx +15 -53
- package/src/helpers/formatDiagnostic.ts +11 -13
- package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
- package/src/helpers/getCSSStylesAtomic.ts +197 -206
- package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
- package/src/helpers/getDynamicVal.ts +4 -0
- package/src/helpers/getSplitStyles.tsx +2058 -4052
- package/src/helpers/grammarConfig.ts +218 -1
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/log.ts +12 -11
- package/src/helpers/mergeVariants.ts +55 -18
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeStyleEngine.ts +55 -14
- package/src/helpers/normalizeValueWithProperty.ts +10 -12
- package/src/helpers/parseBorderShorthand.native.ts +23 -45
- package/src/helpers/parseOutlineShorthand.native.ts +9 -40
- package/src/helpers/resolveSafeArea.ts +34 -101
- package/src/helpers/resolveVariantStyle.ts +77 -0
- package/src/helpers/splitStyleProps.ts +166 -0
- package/src/helpers/styleFrontend.ts +16 -9
- package/src/helpers/styleStaticConfig.ts +21 -0
- package/src/helpers/styleStaticConfigCore.ts +110 -0
- package/src/helpers/styledDynamic.ts +191 -0
- package/src/helpers/tokenCategories.ts +32 -88
- package/src/helpers/variableValue.ts +20 -15
- package/src/helpers/warnOnce.ts +5 -4
- package/src/hooks/useAnimationDriver.ts +6 -2
- package/src/hooks/useComponentState.ts +55 -183
- package/src/hooks/useMedia.tsx +10 -8
- package/src/hooks/useSplitStyles.tsx +17 -2
- package/src/hooks/useStyle.ts +10 -0
- package/src/hooks/useTheme.tsx +1 -1
- package/src/hooks/useThemeState.ts +51 -264
- package/src/index.ts +14 -10
- package/src/internal-runtime.ts +10 -9
- package/src/internalRuntimeTypes.ts +1 -0
- package/src/static-resolve.ts +25 -18
- package/src/style.ts +97 -0
- package/src/styled.tsx +46 -332
- package/src/types.tsx +107 -192
- package/src/views/TamaguiProvider.tsx +0 -2
- package/src/views/Text.tsx +26 -21
- package/src/views/Theme.tsx +10 -8
- package/src/views/ThemeDebug.tsx +0 -1
- package/src/views/View.tsx +6 -7
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createVariable.d.ts +0 -2
- package/types/createVariable.d.ts.map +1 -1
- package/types/dom/html.d.ts.map +1 -1
- package/types/dom/htmlRuntime.native.d.ts.map +1 -1
- package/types/dom/primitives.native.d.ts.map +1 -1
- package/types/helpers/borderComponents.d.ts +10 -0
- package/types/helpers/borderComponents.d.ts.map +1 -0
- package/types/helpers/componentDisplayName.d.ts +0 -3
- package/types/helpers/componentDisplayName.d.ts.map +1 -1
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/formatDiagnostic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +25 -22
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
- package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
- package/types/helpers/getDynamicVal.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +9 -11
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts +25 -2
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +1 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/log.d.ts.map +1 -1
- package/types/helpers/mergeVariants.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/nativeStyleEngine.d.ts +6 -0
- package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
- package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
- package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
- package/types/helpers/resolveSafeArea.d.ts +0 -1
- package/types/helpers/resolveSafeArea.d.ts.map +1 -1
- package/types/helpers/resolveVariantStyle.d.ts +3 -0
- package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
- package/types/helpers/splitStyleProps.d.ts +44 -0
- package/types/helpers/splitStyleProps.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +7 -9
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +14 -0
- package/types/helpers/styleStaticConfig.d.ts.map +1 -0
- package/types/helpers/styleStaticConfigCore.d.ts +4 -0
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
- package/types/helpers/styledDynamic.d.ts +18 -0
- package/types/helpers/styledDynamic.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +0 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variableValue.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +68 -68
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useSplitStyles.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +4 -0
- package/types/hooks/useStyle.d.ts.map +1 -0
- package/types/hooks/useThemeState.d.ts +1 -11
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +8 -8
- package/types/index.d.ts.map +1 -1
- package/types/internal-runtime.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -1
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/static-resolve.d.ts +2 -2
- package/types/static-resolve.d.ts.map +1 -1
- package/types/style.d.ts +18 -0
- package/types/style.d.ts.map +1 -0
- package/types/styled.d.ts +12 -48
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +75 -60
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/types/views/View.d.ts.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +0 -348
- package/dist/cjs/helpers/directStyleCSS.native.cjs +0 -20
- package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/cjs/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
- package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
- package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
- package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/cjs/helpers/themeable.cjs +0 -92
- package/dist/cjs/helpers/themeable.native.cjs +0 -95
- package/dist/cjs/helpers/themeable.native.js +0 -97
- package/dist/cjs/helpers/themeable.native.js.map +0 -1
- package/dist/cjs/hooks/useProps.cjs +0 -129
- package/dist/cjs/hooks/useProps.native.cjs +0 -135
- package/dist/cjs/hooks/useProps.native.js +0 -137
- package/dist/cjs/hooks/useProps.native.js.map +0 -1
- package/dist/esm/helpers/directStyleCSS.mjs +0 -320
- package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSS.native.js +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/esm/helpers/getDefaultProps.mjs +0 -4
- package/dist/esm/helpers/getDefaultProps.mjs.map +0 -1
- package/dist/esm/helpers/getDefaultProps.native.js +0 -6
- package/dist/esm/helpers/getDefaultProps.native.js.map +0 -1
- package/dist/esm/helpers/getVariantExtras.mjs +0 -69
- package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
- package/dist/esm/helpers/getVariantExtras.native.js +0 -70
- package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/esm/helpers/themeable.mjs +0 -67
- package/dist/esm/helpers/themeable.mjs.map +0 -1
- package/dist/esm/helpers/themeable.native.js +0 -68
- package/dist/esm/helpers/themeable.native.js.map +0 -1
- package/dist/esm/hooks/useProps.mjs +0 -100
- package/dist/esm/hooks/useProps.mjs.map +0 -1
- package/dist/esm/hooks/useProps.native.js +0 -104
- package/dist/esm/hooks/useProps.native.js.map +0 -1
- package/src/helpers/directStyleCSS.native.ts +0 -1
- package/src/helpers/directStyleCSS.ts +0 -534
- package/src/helpers/directStyleCSSCompiled.ts +0 -32
- package/src/helpers/getDefaultProps.ts +0 -3
- package/src/helpers/getVariantExtras.tsx +0 -95
- package/src/helpers/themeable.tsx +0 -96
- package/src/hooks/useProps.tsx +0 -186
- package/types/helpers/directStyleCSS.d.ts +0 -28
- package/types/helpers/directStyleCSS.d.ts.map +0 -1
- package/types/helpers/directStyleCSS.native.d.ts +0 -2
- package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
- package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
- package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
- package/types/helpers/getDefaultProps.d.ts +0 -3
- package/types/helpers/getDefaultProps.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts +0 -4
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/themeable.d.ts +0 -3
- package/types/helpers/themeable.d.ts.map +0 -1
- package/types/hooks/useProps.d.ts +0 -39
- package/types/hooks/useProps.d.ts.map +0 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -5,11 +5,10 @@ import { _withStableStyle } from "./_withStableStyle.mjs";
|
|
|
5
5
|
import { _withNativeStyle } from "./_withNativeStyle.mjs";
|
|
6
6
|
import { createComponent } from "./createComponent.mjs";
|
|
7
7
|
import { createStyledContext } from "./helpers/createStyledContext.mjs";
|
|
8
|
-
import { getDefaultProps } from "./helpers/getDefaultProps.mjs";
|
|
9
8
|
import { getCSSStylesAtomic } from "./helpers/getCSSStylesAtomic.mjs";
|
|
10
9
|
import { getExpandedShorthand } from "./helpers/getExpandedShorthands.mjs";
|
|
11
10
|
import { formatDiagnostic } from "./helpers/formatDiagnostic.mjs";
|
|
12
|
-
import { getSplitStyles,
|
|
11
|
+
import { getSplitStyles, getStyleStaticConfig, isValidStyleKey } from "./helpers/getSplitStyles.mjs";
|
|
13
12
|
import { getNativeStyleEngine, removeNativeStyleScope, setNativeStyleEngine, setNativeStyleEngineFlushListener, updateNativeStyleScope } from "./helpers/nativeStyleEngine.mjs";
|
|
14
13
|
import { autoVariables, getAutoVariableCSS, getMutatedAutoVariableCSS, mutatedAutoVariables } from "./helpers/registerCSSVariable.mjs";
|
|
15
14
|
import { insertStyleRules, setNonce } from "./helpers/insertStyleRule.mjs";
|
|
@@ -18,10 +17,10 @@ import { isTamaguiElement } from "./helpers/isTamaguiElement.mjs";
|
|
|
18
17
|
import { matchMedia, setupMatchMedia } from "./helpers/matchMedia.mjs";
|
|
19
18
|
import { mergeProps } from "./helpers/mergeProps.mjs";
|
|
20
19
|
import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.mjs";
|
|
20
|
+
import { splitStyleProps } from "./helpers/splitStyleProps.mjs";
|
|
21
21
|
import { normalizeColor } from "./helpers/normalizeColor.mjs";
|
|
22
22
|
import { normalizeStyle } from "./helpers/normalizeStyle.mjs";
|
|
23
23
|
import { containsThemeRef, themeRefKey } from "./helpers/themeRef.mjs";
|
|
24
|
-
import { themeable } from "./helpers/themeable.mjs";
|
|
25
24
|
import { getStyleTags } from "./helpers/wrapStyleTags.mjs";
|
|
26
25
|
import { createFont } from "./createFont.mjs";
|
|
27
26
|
import { createChangeEventDetails } from "./eventDetails.mjs";
|
|
@@ -29,11 +28,13 @@ import { createStyledHOC } from "./createStyledHOC.mjs";
|
|
|
29
28
|
import { createShorthands } from "./createShorthands.mjs";
|
|
30
29
|
import { createTamagui, installTamaguiConfig } from "./createTamagui.mjs";
|
|
31
30
|
import { createTokens } from "./createTokens.mjs";
|
|
32
|
-
import { createCSSVariable, createVariable, getVariable,
|
|
31
|
+
import { createCSSVariable, createVariable, getVariable, getVariableValue, isVariable, px, variableToString } from "./createVariable.mjs";
|
|
33
32
|
import { insertFont, updateFont } from "./insertFont.mjs";
|
|
34
33
|
import { styled } from "./styled.mjs";
|
|
34
|
+
import { style } from "./style.mjs";
|
|
35
|
+
import { useStyle } from "./hooks/useStyle.mjs";
|
|
35
36
|
import { Tamagui } from "./Tamagui.mjs";
|
|
36
|
-
import {
|
|
37
|
+
import { stylePieceSymbol } from "./types.mjs";
|
|
37
38
|
import { composeRefs, createRefComponent, setRef, useComposedRefs } from "@tamagui/compose-refs";
|
|
38
39
|
import { getConfig, getSetting, getStyleCompat, getThemes, getToken, getTokenValue, getTokens, loadAnimationDriver, setConfig, setupDev, updateConfig } from "./config.mjs";
|
|
39
40
|
import { useIsTouchDevice } from "./hooks/useIsTouchDevice.mjs";
|
|
@@ -41,7 +42,6 @@ import { _disableMediaTouch, _mediaListenerStats, configureMedia, mediaKeyMatch,
|
|
|
41
42
|
import { mediaObjectToString } from "./helpers/mediaObjectToString.mjs";
|
|
42
43
|
import { getMedia, mediaQueryConfig, mediaState, setMediaState } from "./helpers/mediaState.mjs";
|
|
43
44
|
import { useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver } from "./hooks/useAnimationDriver.mjs";
|
|
44
|
-
import { useProps, usePropsAndStyle, useStyle } from "./hooks/useProps.mjs";
|
|
45
45
|
import { useTheme } from "./hooks/useTheme.mjs";
|
|
46
46
|
import { usePortalThemeState } from "./hooks/usePortalThemeState.mjs";
|
|
47
47
|
import { useThemeName } from "./hooks/useThemeName.mjs";
|
|
@@ -57,9 +57,9 @@ import { Theme } from "./views/Theme.mjs";
|
|
|
57
57
|
import { ThemeProvider } from "./views/ThemeProvider.mjs";
|
|
58
58
|
import { View, viewStaticConfig } from "./views/View.mjs";
|
|
59
59
|
import { currentPlatform, getPlatformDriver, isAndroid, isBrowser, isChrome, isClient, isIos, isNativeDesktop, isServer, isTV, isTouchable, isWeb, isWebTouchable, setupPlatformDriver, supportsDynamicColorIOS, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
60
|
-
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, clamp, composeEventHandlers, cssShorthandLonghands, getThemeClassNames, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, reservedThemeProps, shouldRenderNativePlatform, simpleHash, stylePropsAll, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, tokenCategories, validStyles, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties } from "@tamagui/helpers";
|
|
60
|
+
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, clamp, composeEventHandlers, cssShorthandLonghands, getThemeClassNames, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, reservedThemeProps, shouldRenderNativePlatform, simpleHash, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, tokenCategories, validStyles, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties } from "@tamagui/helpers";
|
|
61
61
|
import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsClientOnly } from "@tamagui/use-did-finish-ssr";
|
|
62
62
|
import { useEvent, useGet } from "@tamagui/use-event";
|
|
63
63
|
import { hooks, setupHooks } from "./setupHooks.mjs";
|
|
64
64
|
|
|
65
|
-
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable,
|
|
65
|
+
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
|
package/dist/esm/index.native.js
CHANGED
|
@@ -5,11 +5,10 @@ import { _withStableStyle } from "./_withStableStyle.native.js";
|
|
|
5
5
|
import { _withNativeStyle } from "./_withNativeStyle.native.js";
|
|
6
6
|
import { createComponent } from "./createComponent.native.js";
|
|
7
7
|
import { createStyledContext } from "./helpers/createStyledContext.native.js";
|
|
8
|
-
import { getDefaultProps } from "./helpers/getDefaultProps.native.js";
|
|
9
8
|
import { getCSSStylesAtomic } from "./helpers/getCSSStylesAtomic.native.js";
|
|
10
9
|
import { getExpandedShorthand } from "./helpers/getExpandedShorthands.native.js";
|
|
11
10
|
import { formatDiagnostic } from "./helpers/formatDiagnostic.native.js";
|
|
12
|
-
import { getSplitStyles,
|
|
11
|
+
import { getSplitStyles, getStyleStaticConfig, isValidStyleKey } from "./helpers/getSplitStyles.native.js";
|
|
13
12
|
import { getNativeStyleEngine, removeNativeStyleScope, setNativeStyleEngine, setNativeStyleEngineFlushListener, updateNativeStyleScope } from "./helpers/nativeStyleEngine.native.js";
|
|
14
13
|
import { autoVariables, getAutoVariableCSS, getMutatedAutoVariableCSS, mutatedAutoVariables } from "./helpers/registerCSSVariable.native.js";
|
|
15
14
|
import { insertStyleRules, setNonce } from "./helpers/insertStyleRule.native.js";
|
|
@@ -18,10 +17,10 @@ import { isTamaguiElement } from "./helpers/isTamaguiElement.native.js";
|
|
|
18
17
|
import { matchMedia, setupMatchMedia } from "./helpers/matchMedia.native.js";
|
|
19
18
|
import { mergeProps } from "./helpers/mergeProps.native.js";
|
|
20
19
|
import { mergeSlotStyleProps } from "./helpers/mergeSlotStyleProps.native.js";
|
|
20
|
+
import { splitStyleProps } from "./helpers/splitStyleProps.native.js";
|
|
21
21
|
import { normalizeColor } from "./helpers/normalizeColor.native.js";
|
|
22
22
|
import { normalizeStyle } from "./helpers/normalizeStyle.native.js";
|
|
23
23
|
import { containsThemeRef, themeRefKey } from "./helpers/themeRef.native.js";
|
|
24
|
-
import { themeable } from "./helpers/themeable.native.js";
|
|
25
24
|
import { getStyleTags } from "./helpers/wrapStyleTags.native.js";
|
|
26
25
|
import { createFont } from "./createFont.native.js";
|
|
27
26
|
import { createChangeEventDetails } from "./eventDetails.native.js";
|
|
@@ -29,11 +28,13 @@ import { createStyledHOC } from "./createStyledHOC.native.js";
|
|
|
29
28
|
import { createShorthands } from "./createShorthands.native.js";
|
|
30
29
|
import { createTamagui, installTamaguiConfig } from "./createTamagui.native.js";
|
|
31
30
|
import { createTokens } from "./createTokens.native.js";
|
|
32
|
-
import { createCSSVariable, createVariable, getVariable,
|
|
31
|
+
import { createCSSVariable, createVariable, getVariable, getVariableValue, isVariable, px, variableToString } from "./createVariable.native.js";
|
|
33
32
|
import { insertFont, updateFont } from "./insertFont.native.js";
|
|
34
33
|
import { styled } from "./styled.native.js";
|
|
34
|
+
import { style } from "./style.native.js";
|
|
35
|
+
import { useStyle } from "./hooks/useStyle.native.js";
|
|
35
36
|
import { Tamagui } from "./Tamagui.native.js";
|
|
36
|
-
import {
|
|
37
|
+
import { stylePieceSymbol } from "./types.native.js";
|
|
37
38
|
import { composeRefs, createRefComponent, setRef, useComposedRefs } from "@tamagui/compose-refs";
|
|
38
39
|
import { getConfig, getSetting, getStyleCompat, getThemes, getToken, getTokenValue, getTokens, loadAnimationDriver, setConfig, setupDev, updateConfig } from "./config.native.js";
|
|
39
40
|
import { useIsTouchDevice } from "./hooks/useIsTouchDevice.native.js";
|
|
@@ -41,7 +42,6 @@ import { _disableMediaTouch, _mediaListenerStats, configureMedia, mediaKeyMatch,
|
|
|
41
42
|
import { mediaObjectToString } from "./helpers/mediaObjectToString.native.js";
|
|
42
43
|
import { getMedia, mediaQueryConfig, mediaState, setMediaState } from "./helpers/mediaState.native.js";
|
|
43
44
|
import { useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver } from "./hooks/useAnimationDriver.native.js";
|
|
44
|
-
import { useProps, usePropsAndStyle, useStyle } from "./hooks/useProps.native.js";
|
|
45
45
|
import { useTheme } from "./hooks/useTheme.native.js";
|
|
46
46
|
import { usePortalThemeState } from "./hooks/usePortalThemeState.native.js";
|
|
47
47
|
import { useThemeName } from "./hooks/useThemeName.native.js";
|
|
@@ -57,9 +57,9 @@ import { Theme } from "./views/Theme.native.js";
|
|
|
57
57
|
import { ThemeProvider } from "./views/ThemeProvider.native.js";
|
|
58
58
|
import { View, viewStaticConfig } from "./views/View.native.js";
|
|
59
59
|
import { currentPlatform, getPlatformDriver, isAndroid, isBrowser, isChrome, isClient, isIos, isNativeDesktop, isServer, isTV, isTouchable, isWeb, isWebTouchable, setupPlatformDriver, supportsDynamicColorIOS, useIsomorphicLayoutEffect } from "@tamagui/constants";
|
|
60
|
-
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, clamp, composeEventHandlers, cssShorthandLonghands, getThemeClassNames, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, reservedThemeProps, shouldRenderNativePlatform, simpleHash, stylePropsAll, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, tokenCategories, validStyles, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties } from "@tamagui/helpers";
|
|
60
|
+
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, clamp, composeEventHandlers, cssShorthandLonghands, getThemeClassNames, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, reservedThemeProps, shouldRenderNativePlatform, simpleHash, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, tokenCategories, validStyles, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties } from "@tamagui/helpers";
|
|
61
61
|
import { ClientOnly, ClientOnlyContext, useClientValue, useDidFinishSSR, useIsClientOnly } from "@tamagui/use-did-finish-ssr";
|
|
62
62
|
import { useEvent, useGet } from "@tamagui/use-event";
|
|
63
63
|
import { hooks, setupHooks } from "./setupHooks.native.js";
|
|
64
64
|
|
|
65
|
-
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable,
|
|
65
|
+
export { ClientOnly, ClientOnlyContext, ComponentContext, Configuration, FontLanguage, GroupContext, Slot, Slottable, StyleObjectIdentifier, StyleObjectProperty, StyleObjectPseudo, StyleObjectRules, StyleObjectValue, Tamagui, TamaguiProvider, TamaguiRoot, Text, Theme, ThemeProvider, View, _disableMediaTouch, _mediaListenerStats, _withNativeStyle, _withStableStyle, autoVariables, clamp, composeEventHandlers, composeRefs, configureMedia, containsThemeRef, createCSSVariable, createChangeEventDetails, createComponent, createFont, createRefComponent, createShorthands, createStyledContext, createStyledHOC, createTamagui, createTokens, createVariable, cssShorthandLonghands, currentPlatform, forceUpdateThemes, formatDiagnostic, getAutoVariableCSS, getCSSStylesAtomic, getConfig, getExpandedShorthand, getMedia, getMutatedAutoVariableCSS, getNativeStyleEngine, getPlatformDriver, getSetting, getSplitStyles, getStyleCompat, getStyleStaticConfig, getStyleTags, getThemeClassNames, getThemeProviderChainSizes, getThemes, getToken, getTokenValue, getTokens, getVariable, getVariableValue, hooks, html, insertFont, insertStyleRules, installTamaguiConfig, isAndroid, isBrowser, isChrome, isClient, isEqualShallow, isIos, isNativeDesktop, isServer, isTV, isTamaguiComponent, isTamaguiElement, isTouchable, isValidStyleKey, isVariable, isWeb, isWebTouchable, loadAnimationDriver, matchMedia, mediaKeyMatch, mediaObjectToString, mediaQueryConfig, mediaState, mergeIfNotShallowEqual, mergeProps, mergeSlotStyleProps, mutatedAutoVariables, nonAnimatableStyleProps, nonAnimatableWebTextProps, nonAnimatableWebViewProps, normalizeColor, normalizeStyle, px, removeNativeStyleScope, reservedThemeProps, resolveThemeName, setConfig, setMediaState, setNativeStyleEngine, setNativeStyleEngineFlushListener, setNonce, setRef, setupDev, setupHooks, setupMatchMedia, setupPlatformDriver, shouldRenderNativePlatform, simpleHash, splitStyleProps, style, stylePieceSymbol, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTextOnly, stylePropsTransform, stylePropsUnitless, stylePropsView, styled, supportsDynamicColorIOS, textStaticConfig, themeRefKey, tokenCategories, updateConfig, updateFont, updateMediaListeners, updateNativeStyleScope, useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle, useAnimatedNumbersStyle, useAnimationDriver, useClientValue, useComposedRefs, useConfiguration, useCreateShallowSetState, useDidFinishSSR, useEvent, useGet, useIsClientOnly, useIsTouchDevice, useIsomorphicLayoutEffect, useMedia, usePortalThemeState, useStyle, useTheme, useThemeName, validStyles, variableToString, viewStaticConfig, webOnlyStylePropsText, webOnlyStylePropsView, withStaticProperties };
|
|
@@ -3,7 +3,6 @@ import { createComponent } from "./createComponent.mjs";
|
|
|
3
3
|
import { createVariables as createVariables$1 } from "./createVariables.mjs";
|
|
4
4
|
import { fixStyles as fixStyles$1 } from "./helpers/expandStyles.mjs";
|
|
5
5
|
import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.mjs";
|
|
6
|
-
import { setComponentDisplayName } from "./helpers/componentDisplayName.mjs";
|
|
7
6
|
import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.mjs";
|
|
8
7
|
import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.mjs";
|
|
9
8
|
import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.mjs";
|
|
@@ -49,14 +48,16 @@ function createFrontendStyled(frontend) {
|
|
|
49
48
|
}
|
|
50
49
|
function createFrontendViews(frontend) {
|
|
51
50
|
return {
|
|
52
|
-
View:
|
|
51
|
+
View: createComponent({
|
|
53
52
|
...viewStaticConfig,
|
|
54
|
-
styleFrontend: frontend
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
styleFrontend: frontend,
|
|
54
|
+
displayName: "View"
|
|
55
|
+
}),
|
|
56
|
+
Text: createComponent({
|
|
57
57
|
...textStaticConfig,
|
|
58
|
-
styleFrontend: frontend
|
|
59
|
-
|
|
58
|
+
styleFrontend: frontend,
|
|
59
|
+
displayName: "Text"
|
|
60
|
+
})
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport {
|
|
1
|
+
{"version":3,"file":"internal-runtime.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport { ensureThemeVariable as ensureThemeVariableImpl } from \"./helpers/themes\";\nimport { transformsToString as transformsToStringImpl } from \"./helpers/transformsToString\";\nimport {\n parseFont as parseFontImpl,\n registerFontVariables as registerFontVariablesImpl\n} from \"./insertFont\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { useThemeWithState as useThemeWithStateImpl } from \"./hooks/useTheme\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { regularStyleFrontend } from \"./helpers/styleFrontend\";\nconst createVariables = createVariablesImpl;\nconst parseFont = parseFontImpl;\nconst registerFontVariables = registerFontVariablesImpl;\nconst fixStyles = fixStylesImpl;\nconst getThemeCSSRules = getThemeCSSRulesImpl;\nconst normalizeValueWithProperty = normalizeValueWithPropertyImpl;\nconst proxyThemeToParents = proxyThemeToParentsImpl;\nconst ensureThemeVariable = ensureThemeVariableImpl;\nconst transformsToString = transformsToStringImpl;\nconst styleToCSS = styleToCSSImpl;\nconst useThemeWithState = useThemeWithStateImpl;\nconst plainValueToPayload = (value, property) => {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nconst createTamagui = createTamaguiImpl;\nconst setupHooks = setupHooksImpl;\nconst TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend,\n displayName: \"View\"\n }),\n Text: createComponent({\n ...textStaticConfig,\n styleFrontend: frontend,\n displayName: \"Text\"\n })\n };\n}\nexport {\n TamaguiProvider,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n normalizeValueWithProperty,\n parseFont,\n plainValueToPayload,\n proxyThemeToParents,\n registerFontVariables,\n regularStyleFrontend,\n setupHooks,\n styleToCSS,\n transformsToString,\n useThemeWithState\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,kBAAkBA;AACxB,MAAM,YAAYC;AAClB,MAAM,wBAAwBC;AAC9B,MAAM,YAAYC;AAClB,MAAM,mBAAmBC;AACzB,MAAM,6BAA6BC;AACnC,MAAM,sBAAsBC;AAC5B,MAAM,sBAAsBC;AAC5B,MAAM,qBAAqBC;AAC3B,MAAM,aAAaC;AACnB,MAAM,oBAAoBC;AAC1B,MAAM,uBAAuB,OAAO,aAAa;CAC/C,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,MAAM,gBAAgBC;AACtB,MAAM,aAAaC;AACnB,MAAM,kBAAkBC;AACxB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;EACD,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;CACH;AACF"}
|
|
@@ -3,7 +3,6 @@ import { createComponent } from "./createComponent.native.js";
|
|
|
3
3
|
import { createVariables as createVariables$1 } from "./createVariables.native.js";
|
|
4
4
|
import { fixStyles as fixStyles$1 } from "./helpers/expandStyles.native.js";
|
|
5
5
|
import { styleToCSS as styleToCSS$1 } from "./helpers/styleToCSS.native.js";
|
|
6
|
-
import { setComponentDisplayName } from "./helpers/componentDisplayName.native.js";
|
|
7
6
|
import { getThemeCSSRules as getThemeCSSRules$1 } from "./helpers/getThemeCSSRules.native.js";
|
|
8
7
|
import { normalizeValueWithProperty as normalizeValueWithProperty$1 } from "./helpers/normalizeValueWithProperty.native.js";
|
|
9
8
|
import { proxyThemeToParents as proxyThemeToParents$1 } from "./helpers/proxyThemeToParents.native.js";
|
|
@@ -49,14 +48,16 @@ function createFrontendStyled(frontend) {
|
|
|
49
48
|
}
|
|
50
49
|
function createFrontendViews(frontend) {
|
|
51
50
|
return {
|
|
52
|
-
View:
|
|
51
|
+
View: createComponent({
|
|
53
52
|
...viewStaticConfig,
|
|
54
|
-
styleFrontend: frontend
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
styleFrontend: frontend,
|
|
54
|
+
displayName: "View"
|
|
55
|
+
}),
|
|
56
|
+
Text: createComponent({
|
|
57
57
|
...textStaticConfig,
|
|
58
|
-
styleFrontend: frontend
|
|
59
|
-
|
|
58
|
+
styleFrontend: frontend,
|
|
59
|
+
displayName: "Text"
|
|
60
|
+
})
|
|
60
61
|
};
|
|
61
62
|
}
|
|
62
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-runtime.native.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport {
|
|
1
|
+
{"version":3,"file":"internal-runtime.native.js","names":["createVariablesImpl","parseFontImpl","registerFontVariablesImpl","fixStylesImpl","getThemeCSSRulesImpl","normalizeValueWithPropertyImpl","proxyThemeToParentsImpl","ensureThemeVariableImpl","transformsToStringImpl","styleToCSSImpl","useThemeWithStateImpl","createTamaguiImpl","setupHooksImpl","TamaguiProviderImpl","createFrontendStyledImpl"],"sources":["esm/internal-runtime.native.js"],"sourcesContent":["import { stylePropsUnitless } from \"@tamagui/helpers\";\nimport { createComponent } from \"./createComponent\";\nimport { createVariables as createVariablesImpl } from \"./createVariables\";\nimport { fixStyles as fixStylesImpl } from \"./helpers/expandStyles\";\nimport { styleToCSS as styleToCSSImpl } from \"./helpers/styleToCSS\";\nimport { getThemeCSSRules as getThemeCSSRulesImpl } from \"./helpers/getThemeCSSRules\";\nimport { normalizeValueWithProperty as normalizeValueWithPropertyImpl } from \"./helpers/normalizeValueWithProperty\";\nimport { proxyThemeToParents as proxyThemeToParentsImpl } from \"./helpers/proxyThemeToParents\";\nimport { ensureThemeVariable as ensureThemeVariableImpl } from \"./helpers/themes\";\nimport { transformsToString as transformsToStringImpl } from \"./helpers/transformsToString\";\nimport { parseFont as parseFontImpl, registerFontVariables as registerFontVariablesImpl } from \"./insertFont\";\nimport { createTamagui as createTamaguiImpl } from \"./createTamagui\";\nimport { setupHooks as setupHooksImpl } from \"./setupHooks\";\nimport { createFrontendStyled as createFrontendStyledImpl } from \"./styled\";\nimport { useThemeWithState as useThemeWithStateImpl } from \"./hooks/useTheme\";\nimport { TamaguiProvider as TamaguiProviderImpl } from \"./views/TamaguiProvider\";\nimport { textStaticConfig } from \"./views/Text\";\nimport { viewStaticConfig } from \"./views/View\";\nimport { regularStyleFrontend } from \"./helpers/styleFrontend\";\nvar createVariables = createVariablesImpl;\nvar parseFont = parseFontImpl;\nvar registerFontVariables = registerFontVariablesImpl;\nvar fixStyles = fixStylesImpl;\nvar getThemeCSSRules = getThemeCSSRulesImpl;\nvar normalizeValueWithProperty = normalizeValueWithPropertyImpl;\nvar proxyThemeToParents = proxyThemeToParentsImpl;\nvar ensureThemeVariable = ensureThemeVariableImpl;\nvar transformsToString = transformsToStringImpl;\nvar styleToCSS = styleToCSSImpl;\nvar useThemeWithState = useThemeWithStateImpl;\nvar plainValueToPayload = function(value, property) {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"number\" || !Number.isFinite(value)) return null;\n if (property === \"rotate\" || property === \"rotateX\" || property === \"rotateY\" || property === \"rotateZ\") {\n return value === 0 ? \"0\" : `${value}deg`;\n }\n if (property === \"x\" || property === \"y\" || property === \"perspective\" || property === \"translateX\" || property === \"translateY\") {\n return value === 0 ? \"0\" : `${value}px`;\n }\n return stylePropsUnitless[property] ? String(value) : `${value}px`;\n};\nvar createTamagui = createTamaguiImpl;\nvar setupHooks = setupHooksImpl;\nvar TamaguiProvider = TamaguiProviderImpl;\nfunction createFrontendStyled(frontend) {\n return createFrontendStyledImpl(frontend);\n}\nfunction createFrontendViews(frontend) {\n return {\n View: createComponent({\n ...viewStaticConfig,\n styleFrontend: frontend,\n displayName: \"View\"\n }),\n Text: createComponent({\n ...textStaticConfig,\n styleFrontend: frontend,\n displayName: \"Text\"\n })\n };\n}\nexport {\n TamaguiProvider,\n createFrontendStyled,\n createFrontendViews,\n createTamagui,\n createVariables,\n ensureThemeVariable,\n fixStyles,\n getThemeCSSRules,\n normalizeValueWithProperty,\n parseFont,\n plainValueToPayload,\n proxyThemeToParents,\n registerFontVariables,\n regularStyleFrontend,\n setupHooks,\n styleToCSS,\n transformsToString,\n useThemeWithState\n};\n//# sourceMappingURL=internal-runtime.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBA,IAAI,kBAAkBA;AACtB,IAAI,YAAYC;AAChB,IAAI,wBAAwBC;AAC5B,IAAI,YAAYC;AAChB,IAAI,mBAAmBC;AACvB,IAAI,6BAA6BC;AACjC,IAAI,sBAAsBC;AAC1B,IAAI,sBAAsBC;AAC1B,IAAI,qBAAqBC;AACzB,IAAI,aAAaC;AACjB,IAAI,oBAAoBC;AACxB,IAAI,sBAAsB,SAAS,OAAO,UAAU;CAClD,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,GAAG,OAAO;CACjE,IAAI,aAAa,YAAY,aAAa,aAAa,aAAa,aAAa,aAAa,WAAW;EACvG,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,IAAI,aAAa,OAAO,aAAa,OAAO,aAAa,iBAAiB,aAAa,gBAAgB,aAAa,cAAc;EAChI,OAAO,UAAU,IAAI,MAAM,GAAG,MAAM;CACtC;CACA,OAAO,mBAAmB,YAAY,OAAO,KAAK,IAAI,GAAG,MAAM;AACjE;AACA,IAAI,gBAAgBC;AACpB,IAAI,aAAaC;AACjB,IAAI,kBAAkBC;AACtB,SAAS,qBAAqB,UAAU;CACtC,OAAOC,uBAAyB,QAAQ;AAC1C;AACA,SAAS,oBAAoB,UAAU;CACrC,OAAO;EACL,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;EACD,MAAM,gBAAgB;GACpB,GAAG;GACH,eAAe;GACf,aAAa;EACf,CAAC;CACH;AACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsText, validStyles } from "@tamagui/helpers";
|
|
1
|
+
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsInput, stylePropsText, validStyles } from "@tamagui/helpers";
|
|
2
2
|
import { getConfig, getConfigMaybe, getThemes, getToken, getTokenValue, getTokens, setConfig, updateConfig } from "./config.mjs";
|
|
3
3
|
import { createTamagui, installTamaguiConfig } from "./createTamagui.mjs";
|
|
4
|
-
import { getSplitStyles
|
|
4
|
+
import { getSplitStyles } from "./helpers/getSplitStyles.mjs";
|
|
5
|
+
import { getStyleStaticConfig } from "./helpers/styleStaticConfig.mjs";
|
|
5
6
|
import { mergeComponentProps } from "./helpers/mergeProps.mjs";
|
|
6
7
|
|
|
7
8
|
const DEFAULT_COMPONENT_STATE = {
|
|
@@ -36,9 +37,8 @@ function resolveStaticElement(element, target = "web", defaultThemeName) {
|
|
|
36
37
|
const themes = conf.themes || {};
|
|
37
38
|
const themeName = element.themeName || defaultThemeName || (themes["light"] ? "light" : Object.keys(themes)[0]) || "light";
|
|
38
39
|
const theme = themes[themeName] || themes["light"] || themes["dark"] || Object.values(themes)[0] || {};
|
|
39
|
-
const isTextLike = Boolean(element.staticConfig?.isText || element.staticConfig?.isInput);
|
|
40
40
|
const baseStaticConfig = {
|
|
41
|
-
validStyles:
|
|
41
|
+
validStyles: element.staticConfig?.isInput ? stylePropsInput : element.staticConfig?.isText ? stylePropsText : validStyles,
|
|
42
42
|
defaultProps: {},
|
|
43
43
|
acceptsClassName: target !== "native",
|
|
44
44
|
...target === "native" && { isReactNative: true },
|
|
@@ -47,10 +47,11 @@ function resolveStaticElement(element, target = "web", defaultThemeName) {
|
|
|
47
47
|
if (target !== "native") {
|
|
48
48
|
delete baseStaticConfig.isReactNative;
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
const styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);
|
|
51
51
|
let elementProps = element.props || {};
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const { defaultProps } = styleStaticConfig;
|
|
53
|
+
if (defaultProps) {
|
|
54
|
+
const [merged] = mergeComponentProps(defaultProps, void 0, elementProps);
|
|
54
55
|
elementProps = merged;
|
|
55
56
|
}
|
|
56
57
|
const componentState = {
|
|
@@ -58,6 +59,7 @@ function resolveStaticElement(element, target = "web", defaultThemeName) {
|
|
|
58
59
|
...element.componentState
|
|
59
60
|
};
|
|
60
61
|
const styleProps = {
|
|
62
|
+
isStatic: true,
|
|
61
63
|
resolveValues: element.options?.resolveValues ?? (target === "native" ? "except-theme" : "variable"),
|
|
62
64
|
noClass: element.options?.noClass ?? target === "native",
|
|
63
65
|
isAnimated: element.options?.isAnimated ?? false,
|
|
@@ -76,7 +78,7 @@ function resolveStaticElement(element, target = "web", defaultThemeName) {
|
|
|
76
78
|
}
|
|
77
79
|
let split = null;
|
|
78
80
|
try {
|
|
79
|
-
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps);
|
|
81
|
+
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps, void 0, void 0, void 0, void 0, void 0, void 0, void 0, styleStaticConfig);
|
|
80
82
|
} catch (err) {
|
|
81
83
|
return {
|
|
82
84
|
id: element.id,
|
|
@@ -190,5 +192,5 @@ function resolveStatic(batch) {
|
|
|
190
192
|
return resolveStaticBatch(batch);
|
|
191
193
|
}
|
|
192
194
|
|
|
193
|
-
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig,
|
|
195
|
+
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig, resolveStatic, resolveStaticBatch, resolveStaticElement, setConfig, updateConfig };
|
|
194
196
|
//# sourceMappingURL=static-resolve.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-resolve.js","names":["validStylesView"],"sources":["esm/static-resolve.js"],"sourcesContent":["import {\n StyleObjectIdentifier,\n StyleObjectProperty,\n StyleObjectRules,\n stylePropsText,\n validStyles as validStylesView\n} from \"@tamagui/helpers\";\nimport {\n getConfig,\n getConfigMaybe,\n getThemes,\n getToken,\n getTokens,\n getTokenValue,\n setConfig,\n updateConfig\n} from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles, prepareStyleStaticConfig } from \"./helpers/getSplitStyles\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nconst DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nconst getGlobalProcessEnv = () => {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch {\n return void 0;\n }\n};\nfunction resolveStaticElement(element, target = \"web\", defaultThemeName) {\n const conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n const themes = conf.themes || {};\n const themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n const theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n const isTextLike = Boolean(\n element.staticConfig?.isText || element.staticConfig?.isInput\n );\n const baseStaticConfig = {\n validStyles: isTextLike ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && { isReactNative: true },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n prepareStyleStaticConfig(baseStaticConfig);\n let elementProps = element.props || {};\n if (baseStaticConfig.defaultProps && Object.keys(baseStaticConfig.defaultProps).length > 0) {\n const [merged] = mergeComponentProps(\n baseStaticConfig.defaultProps,\n void 0,\n elementProps\n );\n elementProps = merged;\n }\n const componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n const styleProps = {\n resolveValues: element.options?.resolveValues ?? (target === \"native\" ? \"except-theme\" : \"variable\"),\n noClass: element.options?.noClass ?? target === \"native\",\n isAnimated: element.options?.isAnimated ?? false,\n displayName: element.options?.displayName ?? element.componentName ?? element.staticConfig?.Component?.displayName ?? \"TamaguiComponent\"\n };\n const env = getGlobalProcessEnv();\n const prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n const prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n let split = null;\n try {\n split = getSplitStyles(\n elementProps,\n baseStaticConfig,\n theme,\n themeName,\n componentState,\n styleProps\n );\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: err?.message || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n const hasMedia = split.hasMedia === true || split.hasMedia instanceof Set && split.hasMedia.size > 0;\n const hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (split.programLifecycleStyleKeys?.enter?.size || split.programLifecycleStyleKeys?.exit?.size) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n const rules = [];\n const css = [];\n if (split.rulesToInsert) {\n for (const key in split.rulesToInsert) {\n const ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n const ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (let i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n const classNames = split.classNames || {};\n const classNamesList = Object.values(classNames).filter(Boolean);\n const fullClassName = split.viewProps?.className || void 0;\n const className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || split.viewProps?.style || null,\n viewProps: split.viewProps,\n hasMedia: split.hasMedia instanceof Set ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n const target = batch.target || \"web\";\n const defaultThemeName = batch.defaultThemeName;\n const elements = batch.elements || [];\n const results = new Array(elements.length);\n for (let i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return { results };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n const parsed = JSON.parse(batch);\n const result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n prepareStyleStaticConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingURL=static-resolve.js.map\n"],"mappings":";;;;;;;AAoBA,MAAM,0BAA0B;CAC9B,OAAO;CACP,OAAO;CACP,cAAc;CACd,aAAa;CACb,OAAO;CACP,SAAS;CACT,UAAU;CACV,WAAW;AACb;AACA,MAAM,4BAA4B;CAChC,IAAI;EACF,OAAO,OAAO,YAAY,eAAe,UAAU,QAAQ,MAAM,KAAK;CACxE,QAAQ;EACN,OAAO,KAAK;CACd;AACF;AACA,SAAS,qBAAqB,SAAS,SAAS,OAAO,kBAAkB;CACvE,MAAM,OAAO,eAAe;CAC5B,IAAI,CAAC,MAAM;EACT,OAAO;GACL,IAAI,QAAQ;GACZ,IAAI;GACJ,SAAS;IACP,QAAQ;IACR,SAAS;GACX;EACF;CACF;CACA,MAAM,SAAS,KAAK,UAAU,CAAC;CAC/B,MAAM,YAAY,QAAQ,aAAa,qBAAqB,OAAO,WAAW,U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AAM,WAAW,MAAM,YAAY,CAAC;CACpC,MAAM,UAAU,IAAI,MAAM,SAAS,MAAM;CACzC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,QAAQ,KAAK,qBAAqB,SAAS,IAAI,QAAQ,gBAAgB;CACzE;CACA,OAAO,EAAE,QAAQ;AACnB;AACA,SAAS,cAAc,OAAO;CAC5B,IAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,SAAS,KAAK,MAAM,KAAK;EAC/B,MAAM,SAAS,mBAAmB,MAAM;EACxC,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,OAAO,mBAAmB,KAAK;AACjC"}
|
|
1
|
+
{"version":3,"file":"static-resolve.js","names":["validStylesView"],"sources":["esm/static-resolve.js"],"sourcesContent":["import {\n StyleObjectIdentifier,\n StyleObjectProperty,\n StyleObjectRules,\n stylePropsInput,\n stylePropsText,\n validStyles as validStylesView\n} from \"@tamagui/helpers\";\nimport {\n getConfig,\n getConfigMaybe,\n getThemes,\n getToken,\n getTokens,\n getTokenValue,\n setConfig,\n updateConfig\n} from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles } from \"./helpers/getSplitStyles\";\nimport { getStyleStaticConfig } from \"./helpers/styleStaticConfig\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nconst DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nconst getGlobalProcessEnv = () => {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch {\n return void 0;\n }\n};\nfunction resolveStaticElement(element, target = \"web\", defaultThemeName) {\n const conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n const themes = conf.themes || {};\n const themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n const theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n const baseStaticConfig = {\n validStyles: element.staticConfig?.isInput ? stylePropsInput : element.staticConfig?.isText ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && { isReactNative: true },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n const styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);\n let elementProps = element.props || {};\n const { defaultProps } = styleStaticConfig;\n if (defaultProps) {\n const [merged] = mergeComponentProps(defaultProps, void 0, elementProps);\n elementProps = merged;\n }\n const componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n const styleProps = {\n isStatic: true,\n resolveValues: element.options?.resolveValues ?? (target === \"native\" ? \"except-theme\" : \"variable\"),\n noClass: element.options?.noClass ?? target === \"native\",\n isAnimated: element.options?.isAnimated ?? false,\n displayName: element.options?.displayName ?? element.componentName ?? element.staticConfig?.Component?.displayName ?? \"TamaguiComponent\"\n };\n const env = getGlobalProcessEnv();\n const prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n const prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n let split = null;\n try {\n split = getSplitStyles(\n elementProps,\n baseStaticConfig,\n theme,\n themeName,\n componentState,\n styleProps,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n void 0,\n styleStaticConfig\n );\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: err?.message || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n const hasMedia = split.hasMedia === true || split.hasMedia instanceof Set && split.hasMedia.size > 0;\n const hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (split.programLifecycleStyleKeys?.enter?.size || split.programLifecycleStyleKeys?.exit?.size) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n const rules = [];\n const css = [];\n if (split.rulesToInsert) {\n for (const key in split.rulesToInsert) {\n const ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n const ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (let i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n const classNames = split.classNames || {};\n const classNamesList = Object.values(classNames).filter(Boolean);\n const fullClassName = split.viewProps?.className || void 0;\n const className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || split.viewProps?.style || null,\n viewProps: split.viewProps,\n hasMedia: split.hasMedia instanceof Set ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n const target = batch.target || \"web\";\n const defaultThemeName = batch.defaultThemeName;\n const elements = batch.elements || [];\n const results = new Array(elements.length);\n for (let i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return { results };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n const parsed = JSON.parse(batch);\n const result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingURL=static-resolve.js.map\n"],"mappings":";;;;;;;;AAsBA,MAAM,0BAA0B;CAC9B,OAAO;CACP,OAAO;CACP,cAAc;CACd,aAAa;CACb,OAAO;CACP,SAAS;CACT,UAAU;CACV,WAAW;AACb;AACA,MAAM,4BAA4B;CAChC,IAAI;EACF,OAAO,OAAO,YAAY,eAAe,UAAU,QAAQ,MAAM,KAAK;CACxE,QAAQ;EACN,OAAO,KAAK;CACd;AACF;AACA,SAAS,qBAAqB,SAAS,SAAS,OAAO,kBAAkB;CACv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4B;GAC3D,OAAO,MAAM,0BAA0B,QAAQ,MAAM,KAAK,MAAM,0BAA0B,KAAK,IAAI,KAAK;GACxG,MAAM,MAAM,0BAA0B,OAAO,MAAM,KAAK,MAAM,0BAA0B,IAAI,IAAI,KAAK;EACvG,IAAI,KAAK;CACX;AACF;AACA,SAAS,mBAAmB,OAAO;CACjC,MAAM,SAAS,MAAM,UAAU;CAC/B,MAAM,mBAAmB,MAAM;CAC/B,MAAM,WAAW,MAAM,YAAY,CAAC;CACpC,MAAM,UAAU,IAAI,MAAM,SAAS,MAAM;CACzC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,QAAQ,KAAK,qBAAqB,SAAS,IAAI,QAAQ,gBAAgB;CACzE;CACA,OAAO,EAAE,QAAQ;AACnB;AACA,SAAS,cAAc,OAAO;CAC5B,IAAI,OAAO,UAAU,UAAU;EAC7B,MAAM,SAAS,KAAK,MAAM,KAAK;EAC/B,MAAM,SAAS,mBAAmB,MAAM;EACxC,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,OAAO,mBAAmB,KAAK;AACjC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsText, validStyles } from "@tamagui/helpers";
|
|
1
|
+
import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsInput, stylePropsText, validStyles } from "@tamagui/helpers";
|
|
2
2
|
import { getConfig, getConfigMaybe, getThemes, getToken, getTokenValue, getTokens, setConfig, updateConfig } from "./config.native.js";
|
|
3
3
|
import { createTamagui, installTamaguiConfig } from "./createTamagui.native.js";
|
|
4
|
-
import { getSplitStyles
|
|
4
|
+
import { getSplitStyles } from "./helpers/getSplitStyles.native.js";
|
|
5
|
+
import { getStyleStaticConfig } from "./helpers/styleStaticConfig.native.js";
|
|
5
6
|
import { mergeComponentProps } from "./helpers/mergeProps.native.js";
|
|
6
7
|
|
|
7
8
|
function _instanceof(left, right) {
|
|
@@ -45,9 +46,8 @@ function resolveStaticElement(element) {
|
|
|
45
46
|
var themes = conf.themes || {};
|
|
46
47
|
var themeName = element.themeName || defaultThemeName || (themes["light"] ? "light" : Object.keys(themes)[0]) || "light";
|
|
47
48
|
var theme = themes[themeName] || themes["light"] || themes["dark"] || Object.values(themes)[0] || {};
|
|
48
|
-
var isTextLike = Boolean(((_element_staticConfig = element.staticConfig) === null || _element_staticConfig === void 0 ? void 0 : _element_staticConfig.isText) || ((_element_staticConfig1 = element.staticConfig) === null || _element_staticConfig1 === void 0 ? void 0 : _element_staticConfig1.isInput));
|
|
49
49
|
var baseStaticConfig = {
|
|
50
|
-
validStyles:
|
|
50
|
+
validStyles: ((_element_staticConfig = element.staticConfig) === null || _element_staticConfig === void 0 ? void 0 : _element_staticConfig.isInput) ? stylePropsInput : ((_element_staticConfig1 = element.staticConfig) === null || _element_staticConfig1 === void 0 ? void 0 : _element_staticConfig1.isText) ? stylePropsText : validStyles,
|
|
51
51
|
defaultProps: {},
|
|
52
52
|
acceptsClassName: target !== "native",
|
|
53
53
|
...target === "native" && { isReactNative: true },
|
|
@@ -56,10 +56,11 @@ function resolveStaticElement(element) {
|
|
|
56
56
|
if (target !== "native") {
|
|
57
57
|
delete baseStaticConfig.isReactNative;
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
var styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);
|
|
60
60
|
var elementProps = element.props || {};
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
var { defaultProps } = styleStaticConfig;
|
|
62
|
+
if (defaultProps) {
|
|
63
|
+
var [merged] = mergeComponentProps(defaultProps, void 0, elementProps);
|
|
63
64
|
elementProps = merged;
|
|
64
65
|
}
|
|
65
66
|
var componentState = {
|
|
@@ -68,6 +69,7 @@ function resolveStaticElement(element) {
|
|
|
68
69
|
};
|
|
69
70
|
var _element_options_resolveValues, _element_options_noClass, _element_options_isAnimated, _element_options_displayName, _ref, _ref1;
|
|
70
71
|
var styleProps = {
|
|
72
|
+
isStatic: true,
|
|
71
73
|
resolveValues: (_element_options_resolveValues = (_element_options = element.options) === null || _element_options === void 0 ? void 0 : _element_options.resolveValues) !== null && _element_options_resolveValues !== void 0 ? _element_options_resolveValues : target === "native" ? "except-theme" : "variable",
|
|
72
74
|
noClass: (_element_options_noClass = (_element_options1 = element.options) === null || _element_options1 === void 0 ? void 0 : _element_options1.noClass) !== null && _element_options_noClass !== void 0 ? _element_options_noClass : target === "native",
|
|
73
75
|
isAnimated: (_element_options_isAnimated = (_element_options2 = element.options) === null || _element_options2 === void 0 ? void 0 : _element_options2.isAnimated) !== null && _element_options_isAnimated !== void 0 ? _element_options_isAnimated : false,
|
|
@@ -86,7 +88,7 @@ function resolveStaticElement(element) {
|
|
|
86
88
|
}
|
|
87
89
|
var split = null;
|
|
88
90
|
try {
|
|
89
|
-
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps);
|
|
91
|
+
split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps, void 0, void 0, void 0, void 0, void 0, void 0, void 0, styleStaticConfig);
|
|
90
92
|
} catch (err) {
|
|
91
93
|
return {
|
|
92
94
|
id: element.id,
|
|
@@ -201,5 +203,5 @@ function resolveStatic(batch) {
|
|
|
201
203
|
return resolveStaticBatch(batch);
|
|
202
204
|
}
|
|
203
205
|
|
|
204
|
-
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig,
|
|
206
|
+
export { createTamagui, getConfig, getConfigMaybe, getSplitStyles, getThemes, getToken, getTokenValue, getTokens, installTamaguiConfig, resolveStatic, resolveStaticBatch, resolveStaticElement, setConfig, updateConfig };
|
|
205
207
|
//# sourceMappingURL=static-resolve.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-resolve.native.js","names":["validStylesView"],"sources":["esm/static-resolve.native.js"],"sourcesContent":["import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsText, validStyles as validStylesView } from \"@tamagui/helpers\";\nimport { getConfig, getConfigMaybe, getThemes, getToken, getTokens, getTokenValue, setConfig, updateConfig } from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles, prepareStyleStaticConfig } from \"./helpers/getSplitStyles\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\nvar DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nvar getGlobalProcessEnv = function() {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch (e) {\n return void 0;\n }\n};\nfunction resolveStaticElement(element) {\n var target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"web\", defaultThemeName = arguments.length > 2 ? arguments[2] : void 0;\n var _element_staticConfig, _element_staticConfig1, _element_options, _element_options1, _element_options2, _element_options3, _element_staticConfig_Component, _element_staticConfig2, _split_viewProps, _split_viewProps1;\n var conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n var themes = conf.themes || {};\n var themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n var theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n var isTextLike = Boolean(((_element_staticConfig = element.staticConfig) === null || _element_staticConfig === void 0 ? void 0 : _element_staticConfig.isText) || ((_element_staticConfig1 = element.staticConfig) === null || _element_staticConfig1 === void 0 ? void 0 : _element_staticConfig1.isInput));\n var baseStaticConfig = {\n validStyles: isTextLike ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && {\n isReactNative: true\n },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n prepareStyleStaticConfig(baseStaticConfig);\n var elementProps = element.props || {};\n if (baseStaticConfig.defaultProps && Object.keys(baseStaticConfig.defaultProps).length > 0) {\n var [merged] = mergeComponentProps(baseStaticConfig.defaultProps, void 0, elementProps);\n elementProps = merged;\n }\n var componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n var _element_options_resolveValues, _element_options_noClass, _element_options_isAnimated, _element_options_displayName, _ref, _ref1;\n var styleProps = {\n resolveValues: (_element_options_resolveValues = (_element_options = element.options) === null || _element_options === void 0 ? void 0 : _element_options.resolveValues) !== null && _element_options_resolveValues !== void 0 ? _element_options_resolveValues : target === \"native\" ? \"except-theme\" : \"variable\",\n noClass: (_element_options_noClass = (_element_options1 = element.options) === null || _element_options1 === void 0 ? void 0 : _element_options1.noClass) !== null && _element_options_noClass !== void 0 ? _element_options_noClass : target === \"native\",\n isAnimated: (_element_options_isAnimated = (_element_options2 = element.options) === null || _element_options2 === void 0 ? void 0 : _element_options2.isAnimated) !== null && _element_options_isAnimated !== void 0 ? _element_options_isAnimated : false,\n displayName: (_ref1 = (_ref = (_element_options_displayName = (_element_options3 = element.options) === null || _element_options3 === void 0 ? void 0 : _element_options3.displayName) !== null && _element_options_displayName !== void 0 ? _element_options_displayName : element.componentName) !== null && _ref !== void 0 ? _ref : (_element_staticConfig2 = element.staticConfig) === null || _element_staticConfig2 === void 0 ? void 0 : (_element_staticConfig_Component = _element_staticConfig2.Component) === null || _element_staticConfig_Component === void 0 ? void 0 : _element_staticConfig_Component.displayName) !== null && _ref1 !== void 0 ? _ref1 : \"TamaguiComponent\"\n };\n var env = getGlobalProcessEnv();\n var prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n var prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n var split = null;\n try {\n split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps);\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: (err === null || err === void 0 ? void 0 : err.message) || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n var _split_programLifecycleStyleKeys_enter, _split_programLifecycleStyleKeys, _split_programLifecycleStyleKeys_exit, _split_programLifecycleStyleKeys1;\n var hasMedia = split.hasMedia === true || _instanceof(split.hasMedia, Set) && split.hasMedia.size > 0;\n var hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (((_split_programLifecycleStyleKeys = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys === void 0 ? void 0 : (_split_programLifecycleStyleKeys_enter = _split_programLifecycleStyleKeys.enter) === null || _split_programLifecycleStyleKeys_enter === void 0 ? void 0 : _split_programLifecycleStyleKeys_enter.size) || ((_split_programLifecycleStyleKeys1 = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys1 === void 0 ? void 0 : (_split_programLifecycleStyleKeys_exit = _split_programLifecycleStyleKeys1.exit) === null || _split_programLifecycleStyleKeys_exit === void 0 ? void 0 : _split_programLifecycleStyleKeys_exit.size)) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n var rules = [];\n var css = [];\n if (split.rulesToInsert) {\n for (var key in split.rulesToInsert) {\n var ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n var ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (var i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n var classNames = split.classNames || {};\n var classNamesList = Object.values(classNames).filter(Boolean);\n var fullClassName = ((_split_viewProps = split.viewProps) === null || _split_viewProps === void 0 ? void 0 : _split_viewProps.className) || void 0;\n var className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || ((_split_viewProps1 = split.viewProps) === null || _split_viewProps1 === void 0 ? void 0 : _split_viewProps1.style) || null,\n viewProps: split.viewProps,\n hasMedia: _instanceof(split.hasMedia, Set) ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n var target = batch.target || \"web\";\n var defaultThemeName = batch.defaultThemeName;\n var elements = batch.elements || [];\n var results = new Array(elements.length);\n for (var i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return {\n results\n };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n var parsed = JSON.parse(batch);\n var result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n prepareStyleStaticConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingURL=static-resolve.js.map\n"],"mappings":";;;;;;;AAKA,SAAS,YAAY,MAAM,OAAO;CAChC,IAAI,SAAS,QAAQ,OAAO,WAAW,eAAe,MAAM,OAAO,cAAc;EAC/E,OAAO,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,IAAI;CACzC,OAAO;EACL,OAAO,gBAAgB;CACzB;AACF;AACA,IAAI,0BAA0B;CAC5B,OAAO;CACP,OAAO;CACP,cAAc;CACd,aAAa;CACb,OAAO;CACP,SAAS;CACT,UAAU;CACV,WAAW;AACb;AACA,IAAI,sBAAsB,WAAW;CACnC,IAAI;EACF,OAAO,OAAO,YAAY,eAAe,UAAU,QAAQ,MAAM,KAAK;CACxE,SAAS,GAAG;EACV,OAAO,KAAK;CACd;AACF;AACA,SAAS,qBAAqB,SAAS;CACrC,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,OAAO,mBAAmB,UAAU,SAAS,IAAI,UAAU,KAAK,KAAK;CACnJ,IAAI,uBAAuB,wBAA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AClB,2BAA2B,MAAM,4BAA4B;GAC3D,OAAO,MAAM,0BAA0B,QAAQ,MAAM,KAAK,MAAM,0BAA0B,KAAK,IAAI,KAAK;GACxG,MAAM,MAAM,0BAA0B,OAAO,MAAM,KAAK,MAAM,0BAA0B,IAAI,IAAI,KAAK;EACvG,IAAI,KAAK;CACX;AACF;AACA,SAAS,mBAAmB,OAAO;CACjC,IAAI,SAAS,MAAM,UAAU;CAC7B,IAAI,mBAAmB,MAAM;CAC7B,IAAI,WAAW,MAAM,YAAY,CAAC;CAClC,IAAI,UAAU,IAAI,MAAM,SAAS,MAAM;CACvC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,QAAQ,KAAK,qBAAqB,SAAS,IAAI,QAAQ,gBAAgB;CACzE;CACA,OAAO,EACL,QACF;AACF;AACA,SAAS,cAAc,OAAO;CAC5B,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,SAAS,KAAK,MAAM,KAAK;EAC7B,IAAI,SAAS,mBAAmB,MAAM;EACtC,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,OAAO,mBAAmB,KAAK;AACjC"}
|
|
1
|
+
{"version":3,"file":"static-resolve.native.js","names":["validStylesView"],"sources":["esm/static-resolve.native.js"],"sourcesContent":["import { StyleObjectIdentifier, StyleObjectProperty, StyleObjectRules, stylePropsInput, stylePropsText, validStyles as validStylesView } from \"@tamagui/helpers\";\nimport { getConfig, getConfigMaybe, getThemes, getToken, getTokens, getTokenValue, setConfig, updateConfig } from \"./config\";\nimport { createTamagui, installTamaguiConfig } from \"./createTamagui\";\nimport { getSplitStyles } from \"./helpers/getSplitStyles\";\nimport { getStyleStaticConfig } from \"./helpers/styleStaticConfig\";\nimport { mergeComponentProps } from \"./helpers/mergeProps\";\nfunction _instanceof(left, right) {\n if (right != null && typeof Symbol !== \"undefined\" && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n}\nvar DEFAULT_COMPONENT_STATE = {\n hover: false,\n focus: false,\n focusVisible: false,\n focusWithin: false,\n press: false,\n pressIn: false,\n disabled: false,\n unmounted: false\n};\nvar getGlobalProcessEnv = function() {\n try {\n return typeof process !== \"undefined\" && process ? process.env : void 0;\n } catch (e) {\n return void 0;\n }\n};\nfunction resolveStaticElement(element) {\n var target = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"web\", defaultThemeName = arguments.length > 2 ? arguments[2] : void 0;\n var _element_staticConfig, _element_staticConfig1, _element_options, _element_options1, _element_options2, _element_options3, _element_staticConfig_Component, _element_staticConfig2, _split_viewProps, _split_viewProps1;\n var conf = getConfigMaybe();\n if (!conf) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"config-missing\",\n message: \"No Tamagui config installed. Call createTamagui or installTamaguiConfig first.\"\n }\n };\n }\n var themes = conf.themes || {};\n var themeName = element.themeName || defaultThemeName || (themes[\"light\"] ? \"light\" : Object.keys(themes)[0]) || \"light\";\n var theme = themes[themeName] || themes[\"light\"] || themes[\"dark\"] || Object.values(themes)[0] || {};\n var baseStaticConfig = {\n validStyles: ((_element_staticConfig = element.staticConfig) === null || _element_staticConfig === void 0 ? void 0 : _element_staticConfig.isInput) ? stylePropsInput : ((_element_staticConfig1 = element.staticConfig) === null || _element_staticConfig1 === void 0 ? void 0 : _element_staticConfig1.isText) ? stylePropsText : validStylesView,\n defaultProps: {},\n acceptsClassName: target !== \"native\",\n ...target === \"native\" && {\n isReactNative: true\n },\n ...element.staticConfig\n };\n if (target !== \"native\") {\n delete baseStaticConfig.isReactNative;\n }\n var styleStaticConfig = getStyleStaticConfig(baseStaticConfig, conf);\n var elementProps = element.props || {};\n var { defaultProps } = styleStaticConfig;\n if (defaultProps) {\n var [merged] = mergeComponentProps(defaultProps, void 0, elementProps);\n elementProps = merged;\n }\n var componentState = {\n ...DEFAULT_COMPONENT_STATE,\n ...element.componentState\n };\n var _element_options_resolveValues, _element_options_noClass, _element_options_isAnimated, _element_options_displayName, _ref, _ref1;\n var styleProps = {\n isStatic: true,\n resolveValues: (_element_options_resolveValues = (_element_options = element.options) === null || _element_options === void 0 ? void 0 : _element_options.resolveValues) !== null && _element_options_resolveValues !== void 0 ? _element_options_resolveValues : target === \"native\" ? \"except-theme\" : \"variable\",\n noClass: (_element_options_noClass = (_element_options1 = element.options) === null || _element_options1 === void 0 ? void 0 : _element_options1.noClass) !== null && _element_options_noClass !== void 0 ? _element_options_noClass : target === \"native\",\n isAnimated: (_element_options_isAnimated = (_element_options2 = element.options) === null || _element_options2 === void 0 ? void 0 : _element_options2.isAnimated) !== null && _element_options_isAnimated !== void 0 ? _element_options_isAnimated : false,\n displayName: (_ref1 = (_ref = (_element_options_displayName = (_element_options3 = element.options) === null || _element_options3 === void 0 ? void 0 : _element_options3.displayName) !== null && _element_options_displayName !== void 0 ? _element_options_displayName : element.componentName) !== null && _ref !== void 0 ? _ref : (_element_staticConfig2 = element.staticConfig) === null || _element_staticConfig2 === void 0 ? void 0 : (_element_staticConfig_Component = _element_staticConfig2.Component) === null || _element_staticConfig_Component === void 0 ? void 0 : _element_staticConfig_Component.displayName) !== null && _ref1 !== void 0 ? _ref1 : \"TamaguiComponent\"\n };\n var env = getGlobalProcessEnv();\n var prevStatic = env ? env[\"IS_STATIC\"] : void 0;\n var prevTarget = env ? env[\"TAMAGUI_TARGET\"] : void 0;\n if (env) {\n if (target === \"native\") {\n env[\"IS_STATIC\"] = \"is_static\";\n } else {\n delete env[\"IS_STATIC\"];\n }\n env[\"TAMAGUI_TARGET\"] = target;\n }\n var split = null;\n try {\n split = getSplitStyles(elementProps, baseStaticConfig, theme, themeName, componentState, styleProps, void 0, void 0, void 0, void 0, void 0, void 0, void 0, styleStaticConfig);\n } catch (err) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-error\",\n message: (err === null || err === void 0 ? void 0 : err.message) || String(err)\n }\n };\n } finally {\n if (env) {\n if (prevStatic === void 0) delete env[\"IS_STATIC\"];\n else env[\"IS_STATIC\"] = prevStatic;\n if (prevTarget === void 0) delete env[\"TAMAGUI_TARGET\"];\n else env[\"TAMAGUI_TARGET\"] = prevTarget;\n }\n }\n if (!split) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/style-resolution-failed\",\n message: \"getSplitStyles returned no static result\"\n }\n };\n }\n if (target === \"native\") {\n var _split_programLifecycleStyleKeys_enter, _split_programLifecycleStyleKeys, _split_programLifecycleStyleKeys_exit, _split_programLifecycleStyleKeys1;\n var hasMedia = split.hasMedia === true || _instanceof(split.hasMedia, Set) && split.hasMedia.size > 0;\n var hasPseudo = Boolean(split.pseudoGroups && split.pseudoGroups.size > 0) || Boolean(split.mediaGroups && split.mediaGroups.size > 0) || Boolean(split.programStates && split.programStates.size > 0);\n if (hasMedia || hasPseudo) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Native target does not support static media queries or pseudo styles\"\n }\n };\n }\n if (((_split_programLifecycleStyleKeys = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys === void 0 ? void 0 : (_split_programLifecycleStyleKeys_enter = _split_programLifecycleStyleKeys.enter) === null || _split_programLifecycleStyleKeys_enter === void 0 ? void 0 : _split_programLifecycleStyleKeys_enter.size) || ((_split_programLifecycleStyleKeys1 = split.programLifecycleStyleKeys) === null || _split_programLifecycleStyleKeys1 === void 0 ? void 0 : (_split_programLifecycleStyleKeys_exit = _split_programLifecycleStyleKeys1.exit) === null || _split_programLifecycleStyleKeys_exit === void 0 ? void 0 : _split_programLifecycleStyleKeys_exit.size)) {\n return {\n id: element.id,\n ok: false,\n bailout: {\n reason: \"local/unsupported-target\",\n message: \"Lifecycle value programs remain on the runtime path\"\n }\n };\n }\n }\n var rules = [];\n var css = [];\n if (split.rulesToInsert) {\n for (var key in split.rulesToInsert) {\n var ruleObj = split.rulesToInsert[key];\n if (ruleObj) {\n var ruleList = ruleObj[StyleObjectRules] || [];\n rules.push({\n identifier: ruleObj[StyleObjectIdentifier] || key,\n property: ruleObj[StyleObjectProperty],\n rules: ruleList\n });\n for (var i = 0; i < ruleList.length; i++) {\n css.push(ruleList[i]);\n }\n }\n }\n }\n var classNames = split.classNames || {};\n var classNamesList = Object.values(classNames).filter(Boolean);\n var fullClassName = ((_split_viewProps = split.viewProps) === null || _split_viewProps === void 0 ? void 0 : _split_viewProps.className) || void 0;\n var className = fullClassName || (classNamesList.length > 0 ? classNamesList.join(\" \") : void 0);\n return {\n id: element.id,\n ok: true,\n className,\n classNames: Object.keys(classNames).length > 0 ? classNames : void 0,\n rules: rules.length > 0 ? rules : void 0,\n css: css.length > 0 ? css : void 0,\n style: split.style || ((_split_viewProps1 = split.viewProps) === null || _split_viewProps1 === void 0 ? void 0 : _split_viewProps1.style) || null,\n viewProps: split.viewProps,\n hasMedia: _instanceof(split.hasMedia, Set) ? Array.from(split.hasMedia) : split.hasMedia || void 0,\n pseudoGroups: split.pseudoGroups && split.pseudoGroups.size > 0 ? Array.from(split.pseudoGroups) : void 0,\n mediaGroups: split.mediaGroups && split.mediaGroups.size > 0 ? Array.from(split.mediaGroups) : void 0,\n programStates: split.programStates && split.programStates.size > 0 ? Array.from(split.programStates) : void 0,\n dynamicThemeAccess: split.dynamicThemeAccess,\n fontFamily: split.fontFamily,\n programLifecycleStyleKeys: split.programLifecycleStyleKeys ? {\n enter: split.programLifecycleStyleKeys.enter ? Array.from(split.programLifecycleStyleKeys.enter) : void 0,\n exit: split.programLifecycleStyleKeys.exit ? Array.from(split.programLifecycleStyleKeys.exit) : void 0\n } : void 0\n };\n}\nfunction resolveStaticBatch(batch) {\n var target = batch.target || \"web\";\n var defaultThemeName = batch.defaultThemeName;\n var elements = batch.elements || [];\n var results = new Array(elements.length);\n for (var i = 0; i < elements.length; i++) {\n results[i] = resolveStaticElement(elements[i], target, defaultThemeName);\n }\n return {\n results\n };\n}\nfunction resolveStatic(batch) {\n if (typeof batch === \"string\") {\n var parsed = JSON.parse(batch);\n var result = resolveStaticBatch(parsed);\n return JSON.stringify(result);\n }\n return resolveStaticBatch(batch);\n}\nexport {\n createTamagui,\n getConfig,\n getConfigMaybe,\n getSplitStyles,\n getThemes,\n getToken,\n getTokenValue,\n getTokens,\n installTamaguiConfig,\n resolveStatic,\n resolveStaticBatch,\n resolveStaticElement,\n setConfig,\n updateConfig\n};\n//# sourceMappingURL=static-resolve.js.map\n"],"mappings":";;;;;;;;AAMA,SAAS,YAAY,MAAM,OAAO;CAChC,IAAI,SAAS,QAAQ,OAAO,WAAW,eAAe,MAAM,OAAO,cAAc;EAC/E,OAAO,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,IAAI;CACzC,OAAO;EACL,OAAO,gBAAgB;CACzB;AACF;AACA,IAAI,0BAA0B;CAC5B,OAAO;CACP,OAAO;CACP,cAAc;CACd,aAAa;CACb,OAAO;CACP,SAAS;CACT,UAAU;CACV,WAAW;AACb;AACA,IAAI,sBAAsB,WAAW;CACnC,IAAI;EACF,OAAO,OAAO,YAAY,eAAe,UAAU,QAAQ,MAAM,KAAK;CACxE,SAAS,GAAG;EACV,OAAO,KAAK;CACd;AACF;AACA,SAAS,qBAAqB,SAAS;CACrC,IAAI,SAAS,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,OAAO,mBAAmB,UAAU,SAAS,IAAI,UAAU,KAAK,KAAK;CACnJ,IAAI,uBAAuB,wBAAwB,kBAAkB,mBAAmB,mBAAmB,mBAAmB,iCAAiC,wBAAwB,kBAAkB;CACzM,IAAI,OAAO,eAAe;CAC1B,IAAI,CAAC,MAAM;EACT,OAAO;GACL,IAAI,QAAQ;GACZ,IAAI;GACJ,SAAS;IACP,QAAQ;IACR,SAAS;GACX;EACF;CACF;CACA,IAAI,SAAS,KAAK,UAAU,CAAC;CAC7B,IAAI,YAAY,QAAQ,aAAa,qBAAqB,OAAO,WAAW,UAAU,OAAO,KAAK,MAAM,CAAC,CAAC,OAAO;CACjH,IAAI,QAAQ,OAAO,cAAc,OAA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,MAAM,YAAY,CAAC;CAClC,IAAI,UAAU,IAAI,MAAM,SAAS,MAAM;CACvC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,QAAQ,KAAK,qBAAqB,SAAS,IAAI,QAAQ,gBAAgB;CACzE;CACA,OAAO,EACL,QACF;AACF;AACA,SAAS,cAAc,OAAO;CAC5B,IAAI,OAAO,UAAU,UAAU;EAC7B,IAAI,SAAS,KAAK,MAAM,KAAK;EAC7B,IAAI,SAAS,mBAAmB,MAAM;EACtC,OAAO,KAAK,UAAU,MAAM;CAC9B;CACA,OAAO,mBAAmB,KAAK;AACjC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { stylePieceSymbol } from "./types.mjs";
|
|
3
|
+
import { warnOnce } from "./helpers/warnOnce.mjs";
|
|
4
|
+
|
|
5
|
+
let compileStylePiece;
|
|
6
|
+
let resolveStylePiece;
|
|
7
|
+
const uncacheablePieces = /* @__PURE__ */ new WeakSet();
|
|
8
|
+
const flatClausePattern = /(?:^|\s)@?[A-Za-z][A-Za-z0-9-]*(?:\/[A-Za-z0-9_-]+)?:/;
|
|
9
|
+
function setStylePieceCompiler(compiler) {
|
|
10
|
+
compileStylePiece = compiler;
|
|
11
|
+
}
|
|
12
|
+
function setStylePieceResolver(resolver) {
|
|
13
|
+
resolveStylePiece = resolver;
|
|
14
|
+
}
|
|
15
|
+
function isStylePiece(value) {
|
|
16
|
+
return !!value && typeof value === "object" && stylePieceSymbol in value;
|
|
17
|
+
}
|
|
18
|
+
function isStylePieceCacheable(piece) {
|
|
19
|
+
return !uncacheablePieces.has(piece);
|
|
20
|
+
}
|
|
21
|
+
function canCacheByTheme(definition) {
|
|
22
|
+
for (const key in definition) {
|
|
23
|
+
const value = definition[key];
|
|
24
|
+
if (typeof value === "string" && flatClausePattern.test(value) || value && typeof value === "object") {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
function createStylePiece(definition, layer = "style") {
|
|
31
|
+
const piece = {
|
|
32
|
+
className: "",
|
|
33
|
+
[stylePieceSymbol]: {
|
|
34
|
+
byKey: {},
|
|
35
|
+
styleObject: definition
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
if (!canCacheByTheme(definition)) {
|
|
39
|
+
uncacheablePieces.add(piece);
|
|
40
|
+
}
|
|
41
|
+
compileStylePiece?.(piece, layer);
|
|
42
|
+
return piece;
|
|
43
|
+
}
|
|
44
|
+
function style(definition) {
|
|
45
|
+
if (process.env.NODE_ENV === "development") {
|
|
46
|
+
const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
47
|
+
if (internals?.H) {
|
|
48
|
+
warnOnce("[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return createStylePiece(definition);
|
|
52
|
+
}
|
|
53
|
+
function resolveStylePieceForTheme(piece, theme, themeName) {
|
|
54
|
+
return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { createStylePiece, isStylePiece, isStylePieceCacheable, resolveStylePieceForTheme, setStylePieceCompiler, setStylePieceResolver, style };
|
|
58
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.js","names":[],"sources":["esm/style.js"],"sourcesContent":["import React from \"react\";\nimport { stylePieceSymbol } from \"./types\";\nimport { warnOnce } from \"./helpers/warnOnce\";\nlet compileStylePiece;\nlet resolveStylePiece;\nconst uncacheablePieces = /* @__PURE__ */ new WeakSet();\nconst flatClausePattern = /(?:^|\\s)@?[A-Za-z][A-Za-z0-9-]*(?:\\/[A-Za-z0-9_-]+)?:/;\nfunction setStylePieceCompiler(compiler) {\n compileStylePiece = compiler;\n}\nfunction setStylePieceResolver(resolver) {\n resolveStylePiece = resolver;\n}\nfunction isStylePiece(value) {\n return !!value && typeof value === \"object\" && stylePieceSymbol in value;\n}\nfunction isStylePieceCacheable(piece) {\n return !uncacheablePieces.has(piece);\n}\nfunction canCacheByTheme(definition) {\n for (const key in definition) {\n const value = definition[key];\n if (typeof value === \"string\" && flatClausePattern.test(value) || value && typeof value === \"object\") {\n return false;\n }\n }\n return true;\n}\nfunction createStylePiece(definition, layer = \"style\") {\n const piece = {\n className: \"\",\n [stylePieceSymbol]: {\n byKey: {},\n styleObject: definition\n }\n };\n if (!canCacheByTheme(definition)) {\n uncacheablePieces.add(piece);\n }\n compileStylePiece?.(piece, layer);\n return piece;\n}\nfunction style(definition) {\n if (process.env.NODE_ENV === \"development\") {\n const internals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n if (internals?.H) {\n warnOnce(\n \"[tamagui] style() was called during render. Define style pieces at module scope so their rules compile once.\"\n );\n }\n }\n return createStylePiece(definition);\n}\nfunction resolveStylePieceForTheme(piece, theme, themeName) {\n return resolveStylePiece ? resolveStylePiece(piece, theme, themeName) : piece[stylePieceSymbol].styleObject;\n}\nexport {\n createStylePiece,\n isStylePiece,\n isStylePieceCacheable,\n resolveStylePieceForTheme,\n setStylePieceCompiler,\n setStylePieceResolver,\n style\n};\n//# sourceMappingURL=style.js.map\n"],"mappings":";;;;;AAGA,IAAI;AACJ,IAAI;AACJ,MAAM,oCAAoC,IAAI,QAAQ;AACtD,MAAM,oBAAoB;AAC1B,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,sBAAsB,UAAU;CACvC,oBAAoB;AACtB;AACA,SAAS,aAAa,OAAO;CAC3B,OAAO,CAAC,CAAC,SAAS,OAAO,UAAU,YAAY,oBAAoB;AACrE;AACA,SAAS,sBAAsB,OAAO;CACpC,OAAO,CAAC,kBAAkB,IAAI,KAAK;AACrC;AACA,SAAS,gBAAgB,YAAY;CACnC,KAAK,MAAM,OAAO,YAAY;EAC5B,MAAM,QAAQ,WAAW;EACzB,IAAI,OAAO,UAAU,YAAY,kBAAkB,KAAK,KAAK,KAAK,SAAS,OAAO,UAAU,UAAU;GACpG,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,SAAS,iBAAiB,YAAY,QAAQ,SAAS;CACrD,MAAM,QAAQ;EACZ,WAAW;GACV,mBAAmB;GAClB,OAAO,CAAC;GACR,aAAa;EACf;CACF;CACA,IAAI,CAAC,gBAAgB,UAAU,GAAG;EAChC,kBAAkB,IAAI,KAAK;CAC7B;CACA,oBAAoB,OAAO,KAAK;CAChC,OAAO;AACT;AACA,SAAS,MAAM,YAAY;CACzB,IAAI,QAAQ,IAAI,aAAa,eAAe;EAC1C,MAAM,YAAY,MAAM;EACxB,IAAI,WAAW,GAAG;GAChB,SACE,8GACF;EACF;CACF;CACA,OAAO,iBAAiB,UAAU;AACpC;AACA,SAAS,0BAA0B,OAAO,OAAO,WAAW;CAC1D,OAAO,oBAAoB,kBAAkB,OAAO,OAAO,SAAS,IAAI,MAAM,iBAAiB,CAAC;AAClG"}
|