@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
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { isAndroid, isClient,
|
|
2
|
-
import { nonAnimatableStyleProps, stylePropsAll, stylePropsText, stylePropsTransform,
|
|
1
|
+
import { isAndroid, isClient, supportsDynamicColorIOS } from "@tamagui/constants";
|
|
2
|
+
import { nonAnimatableStyleProps, stylePropsAll, stylePropsInput, stylePropsText, stylePropsTransform, validStyles } from "@tamagui/helpers";
|
|
3
|
+
import { addTransformValue, createTransformAccumulator, finalizeTransformAccumulator, getTransformPartKeys, removeTransformValue } from "@tamagui/style-grammar/runtime";
|
|
3
4
|
import { getConfig, getFont } from "../config.native.js";
|
|
4
|
-
import { isVariable } from "../createVariable.native.js";
|
|
5
5
|
import { isDevTools } from "../constants/isDevTools.native.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { defaultComponentStateMounted } from "../defaultComponentState.native.js";
|
|
7
|
+
import { isVariable } from "../createVariable.native.js";
|
|
8
|
+
import { stylePieceSymbol } from "../types.native.js";
|
|
9
|
+
import { addComposition, canGenerateCSS, flushDirectStyles, registerAtomicSlot } from "./getCSSStylesAtomic.native.js";
|
|
10
10
|
import { expandStyle } from "./expandStyle.native.js";
|
|
11
|
+
import { classifyBorderComponents, splitComponents, startsValueFunction } from "./borderComponents.native.js";
|
|
11
12
|
import { fixStyles } from "./expandStyles.native.js";
|
|
12
|
-
import { addComposition, canGenerateCSS, clearFrameAtomic, completeStreamingCSS, directStyleSignature, flushDirectStyles, flushDirectStyles as flushDirectStyles2, requestBorderStyleDefault, streamAtomic } from "./directStyleCSS.native.js";
|
|
13
13
|
import { getConfigRevisionState } from "./grammarConfig.native.js";
|
|
14
|
+
import { mediaKeyMatch, mediaState } from "./mediaState.native.js";
|
|
15
|
+
import { getStyleStaticConfig } from "./styleStaticConfig.native.js";
|
|
16
|
+
import { nativeTextInputColorProps } from "./nativeStyleEngine.native.js";
|
|
17
|
+
import { warnOnce, warnRefusedValue } from "./warnOnce.native.js";
|
|
14
18
|
import { isColorStyleKey } from "./getDynamicVal.native.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
19
|
+
import { getDynamicEnv } from "./styledDynamic.native.js";
|
|
20
|
+
import { getRulesForIdentifier } from "./insertStyleRule.native.js";
|
|
17
21
|
import { log } from "./log.native.js";
|
|
18
|
-
import { normalizeStyle } from "./normalizeStyle.native.js";
|
|
19
22
|
import { normalizeColor } from "./normalizeColor.native.js";
|
|
20
23
|
import { normalizeValueWithProperty } from "./normalizeValueWithProperty.native.js";
|
|
21
24
|
import { parseNativeStyle } from "./parseNativeStyle.native.js";
|
|
22
25
|
import { parseNativeTransform } from "./parseNativeTransform.native.js";
|
|
23
|
-
import { getVariantExtras } from "./getVariantExtras.native.js";
|
|
24
|
-
import { isRemValue, resolveRem } from "./resolveRem.native.js";
|
|
25
|
-
import { expandSafeAreaValue, isSafeAreaKey } from "./resolveSafeArea.native.js";
|
|
26
|
-
import { resolveSafeAreaVariable } from "./resolveSafeAreaVariable.native.js";
|
|
27
26
|
import { resolveVariableValue } from "./resolveVariableValue.native.js";
|
|
28
|
-
import { THEME_REF_PREFIX } from "./themeRef.native.js";
|
|
29
|
-
import { getTokenCategoryForProperty, tokenCategoryByProperty } from "./tokenCategories.native.js";
|
|
30
27
|
import { HOC_CLASSNAME_MARKER, skipProps } from "./skipProps.native.js";
|
|
31
28
|
import { styleOriginalValues } from "./styleOriginalValues.native.js";
|
|
32
29
|
import { STYLE_TOKEN_PROVENANCE_KEY, getStyleTokenProvenance, setStyleTokenProvenance } from "./styleProvenance.native.js";
|
|
30
|
+
import { THEME_REF_PREFIX } from "./themeRef.native.js";
|
|
33
31
|
import { transformsToString } from "./transformsToString.native.js";
|
|
32
|
+
import { isStylePiece, isStylePieceCacheable, setStylePieceCompiler, setStylePieceResolver } from "../style.native.js";
|
|
34
33
|
|
|
35
34
|
export * from "./tokenCategories.native.js"
|
|
36
35
|
|
|
@@ -38,525 +37,213 @@ function _type_of(obj) {
|
|
|
38
37
|
"@swc/helpers - typeof";
|
|
39
38
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
40
39
|
}
|
|
41
|
-
var TAMAGUI_CLASS_PROPS = "$$tamaguiClassProps";
|
|
42
40
|
var shouldTrackStyleTokenProvenance = process.env.NODE_ENV === "development" && process.env.TAMAGUI_ENABLE_STYLE_TOKEN_PROVENANCE === "1";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (var index = 0; index < expected.length; index++) if (compoundMatcherMatchesPayload(expected[index], source, start, end)) return true;
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
var expectedValue = typeof expected === "string" ? expected : String(expected);
|
|
56
|
-
if (expectedValue.length !== end - start) return false;
|
|
57
|
-
for (var index1 = 0; index1 < expectedValue.length; index1++) if (expectedValue.charCodeAt(index1) !== source.charCodeAt(start + index1)) return false;
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
var preparedCompoundsKey = /* @__PURE__ */ Symbol();
|
|
61
|
-
function prepareStaticConfigCompounds(staticConfig) {
|
|
62
|
-
var compoundVariants = staticConfig.compoundVariants;
|
|
63
|
-
var preparedConfig = staticConfig;
|
|
64
|
-
if (!(compoundVariants === null || compoundVariants === void 0 ? void 0 : compoundVariants.length)) {
|
|
65
|
-
preparedConfig[preparedCompoundsKey] = null;
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
var selectorCounts = [];
|
|
69
|
-
var indexesByKey = /* @__PURE__ */ Object.create(null);
|
|
70
|
-
indexesByKey[preparedCompoundsKey] = selectorCounts;
|
|
71
|
-
for (var index = 0; index < compoundVariants.length; index++) {
|
|
72
|
-
var compoundVariant = compoundVariants[index];
|
|
73
|
-
var selectorCount = 0;
|
|
74
|
-
for (var key in compoundVariant) {
|
|
75
|
-
var _indexesByKey, _key;
|
|
76
|
-
if (key === "style") continue;
|
|
77
|
-
selectorCount++;
|
|
78
|
-
((_indexesByKey = indexesByKey)[_key = key] || (_indexesByKey[_key] = [])).push(index);
|
|
79
|
-
}
|
|
80
|
-
selectorCounts[index] = selectorCount;
|
|
81
|
-
}
|
|
82
|
-
preparedConfig[preparedCompoundsKey] = indexesByKey;
|
|
83
|
-
}
|
|
84
|
-
var conditionWidth = 4;
|
|
85
|
-
var conditionValueOffset = 0;
|
|
86
|
-
var conditionFlagsOffset = 1;
|
|
87
|
-
var conditionPrecedenceOffset = 2;
|
|
88
|
-
var conditionWrapperOffset = 3;
|
|
89
|
-
var conditionActiveFlag = 1;
|
|
90
|
-
var conditionEmitFlag = 2;
|
|
91
|
-
var conditionResolvedFlag = 4;
|
|
92
|
-
var conditionEnterFlag = 8;
|
|
93
|
-
var conditionExitFlag = 16;
|
|
41
|
+
var conditionValue = 0;
|
|
42
|
+
var conditionPlatform = 1;
|
|
43
|
+
var conditionKey = 2;
|
|
44
|
+
var conditionSelector = 3;
|
|
45
|
+
var conditionTheme = 4;
|
|
46
|
+
var conditionWrappers = 5;
|
|
47
|
+
var conditionAtoms = 6;
|
|
48
|
+
var conditionRanks = 7;
|
|
49
|
+
var conditionResolvedFlag = 16;
|
|
94
50
|
var conditionPlatformPseudoFlag = 32;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
var length = conditionNumbers.length * 2;
|
|
116
|
-
while (length < required) length *= 2;
|
|
117
|
-
var previous1 = conditionNumbers;
|
|
118
|
-
conditionNumbers = new Float64Array(length);
|
|
119
|
-
conditionNumbers.set(previous1);
|
|
120
|
-
}
|
|
121
|
-
function conditionWrapperCopy(cursor) {
|
|
122
|
-
var wrapper = conditionNumbers[cursor + conditionWrapperOffset];
|
|
123
|
-
var count = wrapper & 7;
|
|
124
|
-
if (!count) return void 0;
|
|
125
|
-
var start = wrapper >> 3;
|
|
126
|
-
var wrappers = new Array(count);
|
|
127
|
-
for (var index = 0; index < count; index++) wrappers[index] = conditionWrappers[start + index];
|
|
128
|
-
return wrappers;
|
|
51
|
+
function createCondition(parent) {
|
|
52
|
+
return parent ? [
|
|
53
|
+
parent[conditionValue] & 63,
|
|
54
|
+
parent[conditionPlatform],
|
|
55
|
+
"",
|
|
56
|
+
parent[conditionSelector],
|
|
57
|
+
parent[conditionTheme],
|
|
58
|
+
parent[conditionWrappers].slice(),
|
|
59
|
+
parent[conditionAtoms].slice(),
|
|
60
|
+
parent[conditionRanks].slice()
|
|
61
|
+
] : [
|
|
62
|
+
19,
|
|
63
|
+
0,
|
|
64
|
+
"",
|
|
65
|
+
"",
|
|
66
|
+
"",
|
|
67
|
+
[],
|
|
68
|
+
[],
|
|
69
|
+
[]
|
|
70
|
+
];
|
|
129
71
|
}
|
|
130
|
-
function setConditionUnresolved(
|
|
72
|
+
function setConditionUnresolved(condition) {
|
|
131
73
|
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
for (var offset1 = 0; offset1 < conditionTextWidth; offset1++) conditionTexts[target2 + offset1] = conditionTexts[source + offset1] || "";
|
|
146
|
-
var wrapper = conditionNumbers[source + conditionWrapperOffset];
|
|
147
|
-
var wrapperStart = wrapper >> 3;
|
|
148
|
-
var wrapperCount = wrapper & 7;
|
|
149
|
-
for (var index = 0; index < wrapperCount; index++) conditionWrappers[conditionWrapperTop++] = conditionWrappers[wrapperStart + index];
|
|
150
|
-
conditionNumbers[target2 + conditionWrapperOffset] += wrapperCount;
|
|
151
|
-
}
|
|
152
|
-
function resetConditionCursor(cursor, parent) {
|
|
153
|
-
conditionNumbers[cursor + conditionValueOffset] = 0;
|
|
154
|
-
conditionNumbers[cursor + conditionFlagsOffset] = conditionInitialFlags;
|
|
155
|
-
conditionNumbers[cursor + conditionPrecedenceOffset] = 0;
|
|
156
|
-
conditionNumbers[cursor + conditionWrapperOffset] = conditionWrapperTop << 3;
|
|
157
|
-
conditionTexts.fill("", cursor, cursor + conditionTextWidth);
|
|
158
|
-
if (parent) copyConditionCursor(cursor, parent);
|
|
159
|
-
}
|
|
160
|
-
function acquireConditionCursor() {
|
|
161
|
-
var parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
162
|
-
var cursor = conditionCursorTop;
|
|
163
|
-
conditionCursorTop += conditionWidth;
|
|
164
|
-
reserveConditionCursor(cursor);
|
|
165
|
-
resetConditionCursor(cursor, parent);
|
|
166
|
-
return cursor;
|
|
167
|
-
}
|
|
168
|
-
function releaseConditionCursors(watermark) {
|
|
169
|
-
if (watermark >= conditionCursorTop) return;
|
|
170
|
-
conditionTexts.fill("", watermark, conditionCursorTop);
|
|
171
|
-
conditionCursorTop = watermark;
|
|
172
|
-
}
|
|
173
|
-
function releaseConditionPayloads(wrapperBase) {
|
|
174
|
-
conditionWrappers.fill("", wrapperBase, conditionWrapperTop);
|
|
175
|
-
conditionWrapperTop = wrapperBase;
|
|
176
|
-
}
|
|
177
|
-
function accumulateConditionAtom(state, cursor, kind, rank, name) {
|
|
178
|
-
var keySlot = cursor + conditionKeyOffset;
|
|
179
|
-
var key = conditionTexts[keySlot];
|
|
180
|
-
if (!key) conditionTexts[keySlot] = name;
|
|
181
|
-
else {
|
|
182
|
-
var slotStart = 0;
|
|
183
|
-
var inserted = false;
|
|
184
|
-
while (slotStart <= key.length) {
|
|
185
|
-
var slotEnd = key.indexOf(":", slotStart);
|
|
186
|
-
if (slotEnd === -1) slotEnd = key.length;
|
|
187
|
-
var order = 0;
|
|
188
|
-
var compareLength = Math.min(name.length, slotEnd - slotStart);
|
|
189
|
-
for (var offset = 0; offset < compareLength; offset++) {
|
|
190
|
-
order = name.charCodeAt(offset) - key.charCodeAt(slotStart + offset);
|
|
191
|
-
if (order) break;
|
|
192
|
-
}
|
|
193
|
-
order || (order = name.length - (slotEnd - slotStart));
|
|
194
|
-
if (!order) return;
|
|
195
|
-
if (order < 0) {
|
|
196
|
-
conditionTexts[keySlot] = `${key.slice(0, slotStart)}${name}:${key.slice(slotStart)}`;
|
|
197
|
-
inserted = true;
|
|
198
|
-
break;
|
|
199
|
-
}
|
|
200
|
-
if (slotEnd === key.length) break;
|
|
201
|
-
slotStart = slotEnd + 1;
|
|
202
|
-
}
|
|
203
|
-
if (!inserted) conditionTexts[keySlot] = `${key}:${name}`;
|
|
74
|
+
var _condition;
|
|
75
|
+
condition[conditionValue] &= ~conditionResolvedFlag;
|
|
76
|
+
if (process.env.NODE_ENV !== "production") (_condition = condition).problem || (_condition.problem = name);
|
|
77
|
+
}
|
|
78
|
+
function appendConditionWrapper(condition, wrapper) {
|
|
79
|
+
var wrappers = condition[conditionWrappers];
|
|
80
|
+
if (!wrappers.includes(wrapper)) wrappers.push(wrapper);
|
|
81
|
+
}
|
|
82
|
+
function resolveConditionModifier(state, condition, authored) {
|
|
83
|
+
var modifier = getConfigRevisionState(state.conf).resolveCondition(authored);
|
|
84
|
+
if (!modifier) {
|
|
85
|
+
setConditionUnresolved(condition, authored);
|
|
86
|
+
return;
|
|
204
87
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
88
|
+
var [name, kind, rank] = modifier;
|
|
89
|
+
var atoms = condition[conditionAtoms];
|
|
90
|
+
var atomIndex = 0;
|
|
91
|
+
while (atomIndex < atoms.length && atoms[atomIndex] < name) atomIndex++;
|
|
92
|
+
if (atoms[atomIndex] === name) return;
|
|
93
|
+
for (var index = atoms.length; index > atomIndex; index--) atoms[index] = atoms[index - 1];
|
|
94
|
+
atoms[atomIndex] = name;
|
|
95
|
+
if (kind === 3) {
|
|
96
|
+
condition[conditionPlatform] = Math.max(condition[conditionPlatform], rank);
|
|
97
|
+
if (!modifier[6]) condition[conditionValue] &= -4;
|
|
209
98
|
return;
|
|
210
99
|
}
|
|
211
|
-
var
|
|
212
|
-
var
|
|
213
|
-
var
|
|
214
|
-
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
categoryRank = nextCategory;
|
|
218
|
-
withinRank = rank;
|
|
219
|
-
} else if (nextCategory === categoryRank && rank > withinRank) withinRank = rank;
|
|
220
|
-
precedence1 = precedence1 & -67108864 | depth << 23 | categoryRank << 20 | withinRank;
|
|
221
|
-
conditionNumbers[cursor + conditionPrecedenceOffset] = precedence1;
|
|
100
|
+
var precedence = kind === 2 ? 1 + Math.min(rank, 63) : kind === 6 ? 65 + Math.min(rank, 63) : kind === 4 ? 129 : kind === 5 ? 161 + rank : 225 + rank;
|
|
101
|
+
var ranks = condition[conditionRanks];
|
|
102
|
+
var rankIndex = 0;
|
|
103
|
+
while (rankIndex < ranks.length && ranks[rankIndex] >= precedence) rankIndex++;
|
|
104
|
+
for (var index1 = ranks.length; index1 > rankIndex; index1--) ranks[index1] = ranks[index1 - 1];
|
|
105
|
+
ranks[rankIndex] = precedence;
|
|
222
106
|
var buildCSS = canGenerateCSS && state.flatShouldDoClasses;
|
|
223
|
-
if (kind ===
|
|
107
|
+
if (kind === 2) {
|
|
224
108
|
var _state_flatMediaState;
|
|
225
109
|
var _state;
|
|
226
|
-
var query =
|
|
227
|
-
if (!query)
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
if (buildCSS) appendConditionWrapper(cursor, `@media ${query}`);
|
|
232
|
-
if (!((_state_flatMediaState = state.flatMediaState) === null || _state_flatMediaState === void 0 ? void 0 : _state_flatMediaState[name])) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
110
|
+
var query = modifier[3];
|
|
111
|
+
if (!query) return setConditionUnresolved(condition, name);
|
|
112
|
+
if (buildCSS) appendConditionWrapper(condition, `@media ${query}`);
|
|
113
|
+
if (!((_state_flatMediaState = state.flatMediaState) === null || _state_flatMediaState === void 0 ? void 0 : _state_flatMediaState[name])) condition[conditionValue] &= -2;
|
|
233
114
|
((_state = state).flatMediaKeys || (_state.flatMediaKeys = /* @__PURE__ */ new Set())).add(name);
|
|
234
|
-
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (kind === 4) {
|
|
235
118
|
var _state_flatThemeName;
|
|
236
|
-
|
|
237
|
-
if (buildCSS) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
var
|
|
244
|
-
var
|
|
245
|
-
var
|
|
246
|
-
var groupName =
|
|
247
|
-
var stateSelector = stateModifierSelectors[rank];
|
|
248
|
-
var conditionStateName = canonicalStateModifierNames[rank];
|
|
119
|
+
condition[conditionTheme] = name;
|
|
120
|
+
if (buildCSS) condition[conditionSelector] += `:where(.t_${name}, .t_${name} *)`;
|
|
121
|
+
if (state.flatThemeName !== name && ((_state_flatThemeName = state.flatThemeName) === null || _state_flatThemeName === void 0 ? void 0 : _state_flatThemeName.startsWith(`${name}_`)) !== true) condition[conditionValue] &= -2;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (kind === 6) {
|
|
125
|
+
var _state_componentState_group, _state_flatGroupContext, _state_flatGroupContext1, _component_media;
|
|
126
|
+
var _state1, _state2;
|
|
127
|
+
var size = modifier[4];
|
|
128
|
+
var containerName = modifier[5];
|
|
129
|
+
var groupName = `@${containerName}`;
|
|
249
130
|
if (buildCSS) {
|
|
250
|
-
var
|
|
251
|
-
|
|
252
|
-
if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
|
|
131
|
+
var query1 = modifier[3];
|
|
132
|
+
appendConditionWrapper(condition, containerName ? `@container ${containerName} ${query1}` : `@container ${query1}`);
|
|
253
133
|
}
|
|
254
134
|
var component = (_state_componentState_group = state.componentState.group) === null || _state_componentState_group === void 0 ? void 0 : _state_componentState_group[groupName];
|
|
255
135
|
var context = (_state_flatGroupContext = state.flatGroupContext) === null || _state_flatGroupContext === void 0 ? void 0 : _state_flatGroupContext[groupName];
|
|
256
|
-
|
|
257
|
-
|
|
136
|
+
if (process.env.NODE_ENV === "development" && containerName && !component && !context && ((_state_flatGroupContext1 = state.flatGroupContext) === null || _state_flatGroupContext1 === void 0 ? void 0 : _state_flatGroupContext1[containerName])) warnOnce(`group-container:${containerName}`, `@${size}/${containerName}: targets group="${containerName}", but groups no longer establish query containers. Add container="${containerName}" to that group.`);
|
|
137
|
+
var match = component === null || component === void 0 ? void 0 : (_component_media = component.media) === null || _component_media === void 0 ? void 0 : _component_media[size];
|
|
138
|
+
if (!(match !== null && match !== void 0 ? match : (context === null || context === void 0 ? void 0 : context.state.layout) && mediaKeyMatch(size, context.state.layout))) condition[conditionValue] &= -2;
|
|
258
139
|
((_state1 = state).flatGroupKeys || (_state1.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupName);
|
|
259
|
-
|
|
260
|
-
var _state_componentState_group1, _state_flatGroupContext1, _state_flatGroupContext2, _component_media;
|
|
261
|
-
var _state2, _state3;
|
|
262
|
-
var slash1 = name.indexOf("/");
|
|
263
|
-
var containerSize = name.slice(1, slash1 === -1 ? name.length : slash1);
|
|
264
|
-
var containerName = slash1 === -1 ? "" : name.slice(slash1 + 1);
|
|
265
|
-
var containerQuery = getConfigRevisionState(state.conf).mediaQueries[containerSize];
|
|
266
|
-
var groupKey = `@${containerName}`;
|
|
267
|
-
if (buildCSS) appendConditionWrapper(cursor, containerName ? `@container ${containerName} ${containerQuery}` : `@container ${containerQuery}`);
|
|
268
|
-
var component1 = (_state_componentState_group1 = state.componentState.group) === null || _state_componentState_group1 === void 0 ? void 0 : _state_componentState_group1[groupKey];
|
|
269
|
-
var context1 = (_state_flatGroupContext1 = state.flatGroupContext) === null || _state_flatGroupContext1 === void 0 ? void 0 : _state_flatGroupContext1[groupKey];
|
|
270
|
-
if (process.env.NODE_ENV === "development" && containerName && !component1 && !context1 && ((_state_flatGroupContext2 = state.flatGroupContext) === null || _state_flatGroupContext2 === void 0 ? void 0 : _state_flatGroupContext2[containerName])) warnOnce(`group-container:${containerName}`, `@${containerSize}/${containerName}: targets group="${containerName}", but groups no longer establish query containers. Add container="${containerName}" to that group.`);
|
|
271
|
-
var match = component1 === null || component1 === void 0 ? void 0 : (_component_media = component1.media) === null || _component_media === void 0 ? void 0 : _component_media[containerSize];
|
|
272
|
-
if (!(match === void 0 ? (context1 === null || context1 === void 0 ? void 0 : context1.state.layout) && mediaKeyMatch(containerSize, context1.state.layout) : match)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
273
|
-
((_state2 = state).flatGroupKeys || (_state2.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupKey);
|
|
274
|
-
((_state3 = state).flatGroupMedia || (_state3.flatGroupMedia = /* @__PURE__ */ new Set())).add(containerSize);
|
|
275
|
-
} else {
|
|
276
|
-
var stateSelector1 = stateModifierSelectors[rank];
|
|
277
|
-
conditionNumbers[cursor + conditionFlagsOffset] += 64;
|
|
278
|
-
if (stateSelector1[0] === "[" && name !== "disabled") conditionTexts[cursor + conditionUnsupportedStateOffset] = name;
|
|
279
|
-
if (rank === 6) conditionNumbers[cursor + conditionFlagsOffset] |= conditionEnterFlag;
|
|
280
|
-
else if (rank === 7) conditionNumbers[cursor + conditionFlagsOffset] |= conditionExitFlag;
|
|
281
|
-
else if (rank === 0 || rank === 2 || rank === 4) conditionNumbers[cursor + conditionFlagsOffset] |= conditionPlatformPseudoFlag;
|
|
282
|
-
if (buildCSS) {
|
|
283
|
-
var selector2 = cursor + conditionSelectorOffset;
|
|
284
|
-
if (stateSelector1[0] === ".") conditionTexts[selector2] += `:is(${stateSelector1}, ${stateSelector1} *)`;
|
|
285
|
-
else conditionTexts[selector2] += stateSelector1;
|
|
286
|
-
if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
|
|
287
|
-
}
|
|
288
|
-
var component2 = state.componentState;
|
|
289
|
-
if (!(rank === 0 ? !!component2.hover : rank === 4 ? !!(component2.press || component2.pressIn) : rank === 2 ? !!component2.focus : rank === 3 ? !!component2.focusVisible : rank === 1 ? !!component2.focusWithin : rank === 5 ? !!(component2.disabled || state.props.disabled) : rank === 6 ? !!component2.unmounted : rank === 7 ? !!state.styleProps.isExiting : false)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
290
|
-
if (stateSelector1[0] === ":") {
|
|
291
|
-
var _state4;
|
|
292
|
-
((_state4 = state).flatStateKeys || (_state4.flatStateKeys = /* @__PURE__ */ new Set())).add(name);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
function resolveConditionModifier(state, cursor, modifier) {
|
|
297
|
-
var compiled = getConfigRevisionState(state.conf);
|
|
298
|
-
var code = compiled.modifiers[modifier];
|
|
299
|
-
var kind = code & 7;
|
|
300
|
-
var rank = code >> 3;
|
|
301
|
-
if (kind === modifierKindState) {
|
|
302
|
-
accumulateConditionAtom(state, cursor, kind, rank, canonicalStateModifierNames[rank]);
|
|
140
|
+
((_state2 = state).flatGroupMedia || (_state2.flatGroupMedia = /* @__PURE__ */ new Set())).add(size);
|
|
303
141
|
return;
|
|
304
142
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
var
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
327
|
-
} else if (kind) {
|
|
328
|
-
accumulateConditionAtom(state, cursor, kind, rank, modifier);
|
|
329
|
-
return;
|
|
143
|
+
var selector = modifier[3];
|
|
144
|
+
if (kind === 5) {
|
|
145
|
+
var _state_componentState_group1, _state_flatGroupContext2, _this;
|
|
146
|
+
var _state3;
|
|
147
|
+
var groupName1 = modifier[4];
|
|
148
|
+
if (buildCSS) condition[conditionSelector] += `:where(.t_group_${groupName1}${selector} *)`;
|
|
149
|
+
var component1 = (_state_componentState_group1 = state.componentState.group) === null || _state_componentState_group1 === void 0 ? void 0 : _state_componentState_group1[groupName1];
|
|
150
|
+
var context1 = (_state_flatGroupContext2 = state.flatGroupContext) === null || _state_flatGroupContext2 === void 0 ? void 0 : _state_flatGroupContext2[groupName1];
|
|
151
|
+
var _component_pseudo;
|
|
152
|
+
if (!((_this = (_component_pseudo = component1 === null || component1 === void 0 ? void 0 : component1.pseudo) !== null && _component_pseudo !== void 0 ? _component_pseudo : context1 === null || context1 === void 0 ? void 0 : context1.state.pseudo) === null || _this === void 0 ? void 0 : _this[modifier[5]])) condition[conditionValue] &= -2;
|
|
153
|
+
((_state3 = state).flatGroupKeys || (_state3.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupName1);
|
|
154
|
+
} else {
|
|
155
|
+
var _state4;
|
|
156
|
+
if (rank === 0 || rank === 2 || rank === 4) condition[conditionValue] |= conditionPlatformPseudoFlag;
|
|
157
|
+
else if (rank === 6) condition[conditionValue] |= 4;
|
|
158
|
+
else if (rank === 7) condition[conditionValue] |= 8;
|
|
159
|
+
if (buildCSS) condition[conditionSelector] += `:where(${selector}${selector[0] === "." ? `, ${selector} *` : ""})`;
|
|
160
|
+
var component2 = state.componentState;
|
|
161
|
+
if (!(rank === 1 ? component2.focusWithin : rank === 3 ? component2.focusVisible : rank === 4 ? component2.press || component2.pressIn : rank === 5 ? component2.disabled || state.props.disabled : rank === 6 ? component2.unmounted : rank === 7 ? state.styleProps.isExiting : component2[name])) condition[conditionValue] &= -2;
|
|
162
|
+
if (selector[0] === ":") ((_state4 = state).flatStateKeys || (_state4.flatStateKeys = /* @__PURE__ */ new Set())).add(name);
|
|
330
163
|
}
|
|
331
|
-
|
|
164
|
+
if (rank === 0 && buildCSS) appendConditionWrapper(condition, "@media (hover: hover)");
|
|
332
165
|
}
|
|
333
|
-
function resolveConditionText(state,
|
|
166
|
+
function resolveConditionText(state, condition, text) {
|
|
334
167
|
var start = 0;
|
|
335
168
|
for (var index = 0; index <= text.length; index++) {
|
|
336
169
|
if (index !== text.length && text.charCodeAt(index) !== 58) continue;
|
|
337
170
|
if (index === start) {
|
|
338
|
-
setConditionUnresolved(
|
|
171
|
+
setConditionUnresolved(condition);
|
|
339
172
|
return;
|
|
340
173
|
}
|
|
341
|
-
if (!(
|
|
342
|
-
resolveConditionModifier(state,
|
|
174
|
+
if (!(condition[conditionValue] & conditionResolvedFlag)) return;
|
|
175
|
+
resolveConditionModifier(state, condition, text.slice(start, index));
|
|
343
176
|
start = index + 1;
|
|
344
177
|
}
|
|
345
178
|
}
|
|
346
|
-
function
|
|
347
|
-
if (!(
|
|
348
|
-
|
|
179
|
+
function commitCondition(condition) {
|
|
180
|
+
if (!(condition[conditionValue] & conditionResolvedFlag)) {
|
|
181
|
+
condition[conditionValue] = 0;
|
|
349
182
|
return 0;
|
|
350
183
|
}
|
|
351
|
-
|
|
352
|
-
var
|
|
353
|
-
var depth =
|
|
354
|
-
if (depth > 5)
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
conditionNumbers[cursor + conditionValueOffset] = condition;
|
|
358
|
-
return condition;
|
|
359
|
-
}
|
|
360
|
-
function acquireConditionKeyCursor(state, key) {
|
|
361
|
-
var cursor = acquireConditionCursor();
|
|
362
|
-
if (key) {
|
|
363
|
-
resolveConditionText(state, cursor, key);
|
|
364
|
-
commitConditionCursor(state, cursor);
|
|
365
|
-
}
|
|
366
|
-
return cursor;
|
|
367
|
-
}
|
|
368
|
-
function combineConditionKeys(state, first, second) {
|
|
369
|
-
if (!first) return second;
|
|
370
|
-
if (!second || first === second) return first;
|
|
371
|
-
var watermark = conditionCursorTop;
|
|
372
|
-
var target2 = acquireConditionKeyCursor(state, first);
|
|
373
|
-
resolveConditionText(state, target2, second);
|
|
374
|
-
commitConditionCursor(state, target2);
|
|
375
|
-
var key = conditionTexts[target2 + conditionKeyOffset] || "";
|
|
376
|
-
releaseConditionCursors(watermark);
|
|
377
|
-
return key;
|
|
378
|
-
}
|
|
379
|
-
function freshCompoundState() {
|
|
380
|
-
return {
|
|
381
|
-
seen: 0,
|
|
382
|
-
failed: false,
|
|
383
|
-
matchedBase: false,
|
|
384
|
-
scanned: false,
|
|
385
|
-
pending: null,
|
|
386
|
-
combinations: null
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function beginCompoundEdges(indexes, states) {
|
|
390
|
-
if (!indexes) return;
|
|
391
|
-
for (var index = 0; index < indexes.length; index++) {
|
|
392
|
-
var _states, _indexes_index;
|
|
393
|
-
var state = (_states = states)[_indexes_index = indexes[index]] || (_states[_indexes_index] = freshCompoundState());
|
|
394
|
-
state.pending = null;
|
|
395
|
-
state.matchedBase = false;
|
|
396
|
-
state.scanned = false;
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
function feedCompoundSegment(state, source, start, end, isBase, valid, conditionKey) {
|
|
400
|
-
if (state.flatCompoundOutputDepth) return;
|
|
401
|
-
var pass = state.flatPass;
|
|
402
|
-
var indexes = pass[passCompoundIndexes];
|
|
403
|
-
var states = pass[passCompoundStates];
|
|
404
|
-
var key = pass[passCompoundKey];
|
|
405
|
-
if (!indexes || !states || !key) return;
|
|
406
|
-
var compoundVariants = state.staticConfig.compoundVariants;
|
|
407
|
-
for (var index = 0; index < indexes.length; index++) {
|
|
408
|
-
var _states, _compoundIndex;
|
|
409
|
-
var compoundIndex = indexes[index];
|
|
410
|
-
var compoundState = (_states = states)[_compoundIndex = compoundIndex] || (_states[_compoundIndex] = freshCompoundState());
|
|
411
|
-
compoundState.scanned = true;
|
|
412
|
-
if (!valid || start === end || !compoundMatcherMatchesPayload(compoundVariants[compoundIndex][key], source, start, end)) continue;
|
|
413
|
-
if (isBase) compoundState.matchedBase = true;
|
|
414
|
-
else if (!compoundState.matchedBase) {
|
|
415
|
-
var _compoundState;
|
|
416
|
-
((_compoundState = compoundState).pending || (_compoundState.pending = [])).push(conditionKey);
|
|
417
|
-
}
|
|
184
|
+
condition[conditionKey] = condition[conditionAtoms].join(":");
|
|
185
|
+
var ranks = condition[conditionRanks];
|
|
186
|
+
var depth = ranks.length;
|
|
187
|
+
if (depth > 5) {
|
|
188
|
+
if (process.env.NODE_ENV !== "production") throw new Error(`a flat value clause supports at most 5 non-platform conditions; received ${depth} in "${condition[conditionKey]}:"`);
|
|
189
|
+
return 0;
|
|
418
190
|
}
|
|
191
|
+
var precedence = condition[conditionPlatform] * 6 + depth;
|
|
192
|
+
for (var index = 0; index < 5; index++) precedence = precedence * 256 + (ranks[index] || 0);
|
|
193
|
+
var value = precedence * 256 + condition[conditionValue];
|
|
194
|
+
condition[conditionValue] = value;
|
|
195
|
+
return value;
|
|
419
196
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
|
|
442
|
-
},
|
|
443
|
-
chain(state, _start, _end, valid) {
|
|
444
|
-
var cursor = state.flatScanCursor;
|
|
445
|
-
if (cursor) {
|
|
446
|
-
if (!valid) setConditionUnresolved(cursor);
|
|
447
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
|
|
448
|
-
}
|
|
449
|
-
return true;
|
|
450
|
-
}
|
|
451
|
-
};
|
|
452
|
-
function finishCompoundEdges(pass, key, value, indexes, states) {
|
|
453
|
-
if (!indexes) return;
|
|
454
|
-
var state = pass[passStyleState];
|
|
455
|
-
pass[passCompoundIndexes] = indexes;
|
|
456
|
-
pass[passCompoundKey] = key;
|
|
457
|
-
pass[passCompoundStates] = states;
|
|
458
|
-
var needsScan = false;
|
|
459
|
-
for (var index = 0; index < indexes.length; index++) {
|
|
460
|
-
var _states, _indexes_index;
|
|
461
|
-
if (!((_states = states)[_indexes_index = indexes[index]] || (_states[_indexes_index] = freshCompoundState())).scanned) {
|
|
462
|
-
needsScan = true;
|
|
463
|
-
break;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (needsScan) if (typeof value === "string") {
|
|
467
|
-
var watermark = conditionCursorTop;
|
|
468
|
-
var previousCursor = state.flatScanCursor;
|
|
469
|
-
state.flatScanCursor = null;
|
|
470
|
-
try {
|
|
471
|
-
scanFlatValue(value, compoundOnlyHandler, state);
|
|
472
|
-
} finally {
|
|
473
|
-
state.flatScanCursor = previousCursor;
|
|
474
|
-
releaseConditionCursors(watermark);
|
|
475
|
-
}
|
|
476
|
-
} else if (value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value) && Object.prototype.hasOwnProperty.call(value, "default")) for (var conditionKey in value) {
|
|
477
|
-
var payload = value[conditionKey];
|
|
478
|
-
if (conditionKey === "default") {
|
|
479
|
-
var payloadString = String(payload);
|
|
480
|
-
feedCompoundSegment(state, payloadString, 0, payloadString.length, true, true, "");
|
|
481
|
-
} else {
|
|
482
|
-
var watermark1 = conditionCursorTop;
|
|
483
|
-
var cursor = acquireConditionCursor();
|
|
484
|
-
resolveConditionText(state, cursor, conditionKey);
|
|
485
|
-
var condition = commitConditionCursor(state, cursor);
|
|
486
|
-
var payloadString1 = String(payload);
|
|
487
|
-
feedCompoundSegment(state, payloadString1, 0, payloadString1.length, false, Boolean(condition), condition ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
488
|
-
releaseConditionCursors(watermark1);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
else {
|
|
492
|
-
var variants = state.staticConfig.compoundVariants;
|
|
493
|
-
for (var index1 = 0; index1 < indexes.length; index1++) {
|
|
494
|
-
var _states1, _compoundIndex;
|
|
495
|
-
var compoundIndex = indexes[index1];
|
|
496
|
-
var compoundState1 = (_states1 = states)[_compoundIndex = compoundIndex] || (_states1[_compoundIndex] = freshCompoundState());
|
|
497
|
-
compoundState1.scanned = true;
|
|
498
|
-
if (compoundMatcherMatches(variants[compoundIndex][key], value)) compoundState1.matchedBase = true;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
var variants1 = state.staticConfig.compoundVariants;
|
|
502
|
-
var selectorCounts = state.staticConfig[preparedCompoundsKey][preparedCompoundsKey];
|
|
503
|
-
for (var index2 = 0; index2 < indexes.length; index2++) {
|
|
504
|
-
var compoundIndex1 = indexes[index2];
|
|
505
|
-
var compoundState2 = states[compoundIndex1];
|
|
506
|
-
if (compoundState2.failed) continue;
|
|
507
|
-
var branches = compoundState2.matchedBase ? [""] : compoundState2.pending;
|
|
508
|
-
if (!branches || !branches.length) {
|
|
509
|
-
compoundState2.failed = true;
|
|
510
|
-
continue;
|
|
511
|
-
}
|
|
512
|
-
if (!compoundState2.seen) compoundState2.combinations = branches;
|
|
513
|
-
else {
|
|
514
|
-
var previous = compoundState2.combinations;
|
|
515
|
-
var next = [];
|
|
516
|
-
for (var left = 0; left < previous.length; left++) for (var right = 0; right < branches.length; right++) {
|
|
517
|
-
var conditionKey1 = combineConditionKeys(state, previous[left], branches[right]);
|
|
518
|
-
if (!next.includes(conditionKey1)) next.push(conditionKey1);
|
|
519
|
-
}
|
|
520
|
-
compoundState2.combinations = next;
|
|
521
|
-
}
|
|
522
|
-
compoundState2.seen++;
|
|
523
|
-
if (compoundState2.seen !== selectorCounts[compoundIndex1]) continue;
|
|
524
|
-
var style = variants1[compoundIndex1].style;
|
|
525
|
-
if (!isPlainObject(style)) continue;
|
|
526
|
-
var combinations = compoundState2.combinations;
|
|
527
|
-
for (var combination = 0; combination < combinations.length; combination++) for (var styleKey in style) contributeProp(pass, styleKey, style[styleKey], void 0, states, combinations[combination]);
|
|
528
|
-
}
|
|
197
|
+
function conditionFromKey(state, key, parent) {
|
|
198
|
+
if (!key) return createCondition(parent);
|
|
199
|
+
if (!parent) {
|
|
200
|
+
var direct = state;
|
|
201
|
+
var cache = direct.flatConditions;
|
|
202
|
+
if (cache === void 0 || direct.flatConditionsClassed !== state.flatShouldDoClasses) {
|
|
203
|
+
cache = direct.flatConditions = /* @__PURE__ */ new Map();
|
|
204
|
+
direct.flatConditionsClassed = state.flatShouldDoClasses;
|
|
205
|
+
}
|
|
206
|
+
var known = cache.get(key);
|
|
207
|
+
if (known !== void 0) return known;
|
|
208
|
+
var resolved = createCondition(null);
|
|
209
|
+
resolveConditionText(state, resolved, key);
|
|
210
|
+
commitCondition(resolved);
|
|
211
|
+
cache.set(key, resolved);
|
|
212
|
+
return resolved;
|
|
213
|
+
}
|
|
214
|
+
var condition = createCondition(parent);
|
|
215
|
+
resolveConditionText(state, condition, key);
|
|
216
|
+
commitCondition(condition);
|
|
217
|
+
return condition;
|
|
529
218
|
}
|
|
530
|
-
function classifyConditionalObject(value, state, isChain,
|
|
531
|
-
if (
|
|
219
|
+
function classifyConditionalObject(value, state, isChain, firstCondition) {
|
|
220
|
+
if ("default" in value) return -1;
|
|
532
221
|
for (var key in value) {
|
|
533
222
|
if (!key.length) return 0;
|
|
534
223
|
if (!state) return (isChain === null || isChain === void 0 ? void 0 : isChain(key)) ? 1 : 0;
|
|
535
|
-
var
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
resolveConditionText(state, cursor, key);
|
|
539
|
-
return commitConditionCursor(state, cursor);
|
|
540
|
-
} finally {
|
|
541
|
-
if (!firstCursor) releaseConditionCursors(watermark);
|
|
542
|
-
}
|
|
224
|
+
var condition = firstCondition || createCondition();
|
|
225
|
+
resolveConditionText(state, condition, key);
|
|
226
|
+
return commitCondition(condition);
|
|
543
227
|
}
|
|
544
228
|
return 0;
|
|
545
229
|
}
|
|
546
|
-
var
|
|
547
|
-
var
|
|
548
|
-
var
|
|
549
|
-
var
|
|
550
|
-
var
|
|
551
|
-
var
|
|
552
|
-
var
|
|
553
|
-
var
|
|
554
|
-
var
|
|
555
|
-
var
|
|
556
|
-
var
|
|
557
|
-
var
|
|
558
|
-
var
|
|
559
|
-
var
|
|
230
|
+
var passClassName = 20;
|
|
231
|
+
var passShouldDoClasses = 21;
|
|
232
|
+
var passContainerValue = 22;
|
|
233
|
+
var passContainerName = 23;
|
|
234
|
+
var passContainerType = 24;
|
|
235
|
+
var passFrontendGroup = 25;
|
|
236
|
+
var passFrontendContainer = 26;
|
|
237
|
+
var passFrontendContainerType = 27;
|
|
238
|
+
var passSourceLayer = 28;
|
|
239
|
+
var passParentCursor = 29;
|
|
240
|
+
var passMapSourceKey = 30;
|
|
241
|
+
var passFlags = 13;
|
|
242
|
+
var sourceLayerBase = 0;
|
|
243
|
+
var sourceLayerVariant = 1;
|
|
244
|
+
var sourceLayerResolver = 2;
|
|
245
|
+
var sourceLayerProps = 3;
|
|
246
|
+
var sourceLayerStyle = 4;
|
|
560
247
|
var passNoSkipFlag = 1;
|
|
561
248
|
var passDisableShorthandsFlag = 2;
|
|
562
249
|
var passNoExpandFlag = 4;
|
|
@@ -565,437 +252,271 @@ var passHocFlag = 16;
|
|
|
565
252
|
var passTextFlag = 32;
|
|
566
253
|
var passInputFlag = 64;
|
|
567
254
|
var passAsChildStyleFlag = 128;
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
var prepared = styledDefaultsCache.get(staticConfig);
|
|
571
|
-
if (prepared === void 0) {
|
|
572
|
-
var entries = null;
|
|
573
|
-
var defaults = staticConfig.defaultProps;
|
|
574
|
-
if (defaults) for (var key in defaults) {
|
|
575
|
-
if (!(key in stylePropsAll || key in shorthands)) continue;
|
|
576
|
-
var value = defaults[key];
|
|
577
|
-
if (maybeStyleProgram(value)) (entries || (entries = [])).push(key, value);
|
|
578
|
-
}
|
|
579
|
-
prepared = entries;
|
|
580
|
-
styledDefaultsCache.set(staticConfig, prepared);
|
|
581
|
-
}
|
|
582
|
-
return prepared;
|
|
583
|
-
}
|
|
584
|
-
var maybeStyleProgram = function(value) {
|
|
585
|
-
return typeof value === "string" ? value.indexOf(":") !== -1 : !!value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value);
|
|
586
|
-
};
|
|
587
|
-
function contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass) {
|
|
588
|
-
if (!styledDefaults) return;
|
|
589
|
-
for (var offset = 0; offset < styledDefaults.length; offset += 2) {
|
|
590
|
-
var key = styledDefaults[offset];
|
|
591
|
-
var value = styledDefaults[offset + 1];
|
|
592
|
-
var propValue = processedProps[key];
|
|
593
|
-
if (propValue !== void 0 && propValue !== value) contributeProp(pass, key, value);
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
function injectDisplacedStyledDefault(pass, key, value) {
|
|
597
|
-
var _pass__defaultProps;
|
|
598
|
-
var defaultValue = (_pass__defaultProps = pass[4].defaultProps) === null || _pass__defaultProps === void 0 ? void 0 : _pass__defaultProps[key];
|
|
599
|
-
if (defaultValue === void 0 || value === void 0 || value === defaultValue || maybeStyleProgram(defaultValue)) return;
|
|
600
|
-
var state = pass[passStyleState];
|
|
601
|
-
state.flatWeakContribution = true;
|
|
602
|
-
try {
|
|
603
|
-
contributeProp(pass, key, defaultValue);
|
|
604
|
-
} finally {
|
|
605
|
-
state.flatWeakContribution = false;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
function forEachPropInForwardOrder(pass) {
|
|
609
|
-
var _staticConfig_compoundVariants;
|
|
610
|
-
var styleState = pass[passStyleState];
|
|
611
|
-
var staticConfig = styleState.staticConfig;
|
|
612
|
-
var processedProps = styleState.props;
|
|
613
|
-
var shorthands = styleState.conf.shorthands;
|
|
614
|
-
var processedBaseStyle = staticConfig.baseStyle;
|
|
615
|
-
var styledDefaults = getStyledDefaults(staticConfig, shorthands);
|
|
616
|
-
var directState = styleState;
|
|
617
|
-
var preparedCompounds = staticConfig[preparedCompoundsKey];
|
|
618
|
-
if (preparedCompounds === void 0 && ((_staticConfig_compoundVariants = staticConfig.compoundVariants) === null || _staticConfig_compoundVariants === void 0 ? void 0 : _staticConfig_compoundVariants.length)) throw new Error("A component with compoundVariants reached style resolution before its static config was prepared.");
|
|
619
|
-
var conditionWrapperBase = conditionWrapperTop;
|
|
620
|
-
if (!preparedCompounds) {
|
|
621
|
-
try {
|
|
622
|
-
if (processedBaseStyle) for (var key in processedBaseStyle) contributeProp(pass, key, processedBaseStyle[key]);
|
|
623
|
-
contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass);
|
|
624
|
-
for (var key1 in processedProps) {
|
|
625
|
-
var value = processedProps[key1];
|
|
626
|
-
directState.flatPropSawCondition = false;
|
|
627
|
-
contributeProp(pass, key1, value);
|
|
628
|
-
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key1, value);
|
|
629
|
-
}
|
|
630
|
-
} finally {
|
|
631
|
-
releaseConditionPayloads(conditionWrapperBase);
|
|
632
|
-
}
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
var compoundVariants = staticConfig.compoundVariants;
|
|
636
|
-
var compoundStates = new Array(compoundVariants.length);
|
|
637
|
-
try {
|
|
638
|
-
if (processedBaseStyle) for (var key2 in processedBaseStyle) contributeProp(pass, key2, processedBaseStyle[key2]);
|
|
639
|
-
contributeDisplacedStyledDefaults(styledDefaults, processedProps, pass);
|
|
640
|
-
var selectorCounts = preparedCompounds[preparedCompoundsKey];
|
|
641
|
-
for (var compoundIndex = 0; compoundIndex < compoundVariants.length; compoundIndex++) {
|
|
642
|
-
if (selectorCounts[compoundIndex]) continue;
|
|
643
|
-
var style = compoundVariants[compoundIndex].style;
|
|
644
|
-
if (!isPlainObject(style)) continue;
|
|
645
|
-
for (var key3 in style) contributeProp(pass, key3, style[key3]);
|
|
646
|
-
}
|
|
647
|
-
for (var key4 in processedProps) {
|
|
648
|
-
var compoundIndexes = preparedCompounds[key4];
|
|
649
|
-
var value1 = processedProps[key4];
|
|
650
|
-
beginCompoundEdges(compoundIndexes, compoundStates);
|
|
651
|
-
directState.flatPropSawCondition = false;
|
|
652
|
-
contributeProp(pass, key4, value1, compoundIndexes, compoundStates);
|
|
653
|
-
if (directState.flatPropSawCondition) injectDisplacedStyledDefault(pass, key4, value1);
|
|
654
|
-
finishCompoundEdges(pass, key4, value1, compoundIndexes, compoundStates);
|
|
655
|
-
}
|
|
656
|
-
} finally {
|
|
657
|
-
releaseConditionPayloads(conditionWrapperBase);
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
function isValidStyleKey(key, validStyles, accept) {
|
|
661
|
-
return Boolean(key in validStyles || accept && key in accept);
|
|
662
|
-
}
|
|
663
|
-
function flushForwardStylesToClasses(pass) {
|
|
664
|
-
var styleState = pass[passStyleState];
|
|
665
|
-
if (!pass[passShouldDoClasses]) return;
|
|
666
|
-
completeStreamingCSS(styleState);
|
|
667
|
-
flushDirectStyles(styleState, true);
|
|
255
|
+
function isValidStyleKey(key, validStyles) {
|
|
256
|
+
return key in validStyles;
|
|
668
257
|
}
|
|
669
258
|
function effectiveLifecycleKeys(keys) {
|
|
670
259
|
if (!keys) return;
|
|
671
260
|
var out = /* @__PURE__ */ new Set();
|
|
672
|
-
var
|
|
261
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
673
262
|
try {
|
|
674
|
-
for (var
|
|
675
|
-
var key =
|
|
263
|
+
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
264
|
+
var key = _step.value;
|
|
676
265
|
out.add(key === "--t-x" || key === "--t-y" ? "translate" : key === "--t-scale-x" || key === "--t-scale-y" ? "scale" : key);
|
|
677
266
|
}
|
|
678
267
|
} catch (err) {
|
|
679
|
-
|
|
680
|
-
|
|
268
|
+
_didIteratorError = true;
|
|
269
|
+
_iteratorError = err;
|
|
681
270
|
} finally {
|
|
682
271
|
try {
|
|
683
|
-
if (!
|
|
272
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
684
273
|
} finally {
|
|
685
|
-
if (
|
|
274
|
+
if (_didIteratorError) throw _iteratorError;
|
|
686
275
|
}
|
|
687
276
|
}
|
|
688
277
|
return out;
|
|
689
278
|
}
|
|
690
|
-
function
|
|
691
|
-
var
|
|
692
|
-
var
|
|
693
|
-
var
|
|
694
|
-
var
|
|
279
|
+
function contributeProp(pass, keyOg, valOg) {
|
|
280
|
+
var originalOg = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : valOg, disabled = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
|
|
281
|
+
var [styleState, conf, props, viewProps, , validStyles, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, , defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
|
|
282
|
+
var noSkip = Boolean(flags & passNoSkipFlag);
|
|
283
|
+
var disableExpandShorthands = Boolean(flags & passDisableShorthandsFlag);
|
|
284
|
+
var noExpand = Boolean(flags & passNoExpandFlag);
|
|
285
|
+
var noMergeStyle = Boolean(flags & passNoMergeFlag);
|
|
695
286
|
var isHOC = Boolean(flags & passHocFlag);
|
|
287
|
+
var isText = Boolean(flags & passTextFlag);
|
|
288
|
+
var isInput = Boolean(flags & passInputFlag);
|
|
289
|
+
var shorthands = conf.shorthands;
|
|
290
|
+
var shouldSkipDirectProps = !noSkip && !isHOC;
|
|
291
|
+
var shouldCheckSkipProps = !noSkip;
|
|
292
|
+
var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
|
|
293
|
+
var isTextOrInput = isText || isInput;
|
|
696
294
|
var hocParentVariants = isHOC ? parentVariants : void 0;
|
|
697
|
-
var
|
|
698
|
-
var
|
|
699
|
-
if (
|
|
700
|
-
|
|
701
|
-
if (key in stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
|
|
702
|
-
if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
703
|
-
return;
|
|
704
|
-
}
|
|
705
|
-
viewProps[key] = val;
|
|
706
|
-
return;
|
|
707
|
-
}
|
|
708
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
709
|
-
console.groupCollapsed(" 💠 expanded", keyInit, "=>", key);
|
|
710
|
-
log(val);
|
|
711
|
-
console.groupEnd();
|
|
712
|
-
}
|
|
713
|
-
if (val == null) return;
|
|
714
|
-
if (accept && key in accept) {
|
|
715
|
-
viewProps[key] = val;
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
var isHostStyleKey = isValidStyleKey(key, validStyles, accept) || isAndroid && key === "elevation";
|
|
719
|
-
var isContextProgramKey = canResolveContextPrograms && Boolean(isStyledContextProp);
|
|
720
|
-
if (condition !== void 0) {
|
|
721
|
-
var conditionCursor = condition;
|
|
722
|
-
if (isHostStyleKey || isContextProgramKey) contributeValue(styleState, key, val, mergeStyle, originalVal, !isHostStyleKey, conditionCursor);
|
|
723
|
-
else if (isHOC) {
|
|
724
|
-
var structured = mergeConditionTransport(styleState, viewProps[key], conditionCursor, val);
|
|
725
|
-
if (key in viewProps) delete viewProps[key];
|
|
726
|
-
viewProps[key] = structured;
|
|
727
|
-
} else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${key}" is not a valid style on this component; the conditional variant value is dropped.`);
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
|
-
if (isHostStyleKey || isContextProgramKey) {
|
|
731
|
-
contributeValue(styleState, key, val, mergeStyle, originalVal, !isHostStyleKey);
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
var isVariant = Boolean(variants && key in variants);
|
|
735
|
-
if (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key)) {
|
|
736
|
-
var _props_key;
|
|
737
|
-
viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
|
|
738
|
-
}
|
|
739
|
-
if (Boolean(hocParentVariants && hocParentVariants[keyInit])) {
|
|
740
|
-
passDownProp(viewProps, key, val);
|
|
741
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
742
|
-
console.groupCollapsed(` - passing down prop ${key}`);
|
|
743
|
-
log({
|
|
744
|
-
val,
|
|
745
|
-
after: { ...viewProps[key] }
|
|
746
|
-
});
|
|
747
|
-
console.groupEnd();
|
|
748
|
-
}
|
|
295
|
+
var keyInit = keyOg;
|
|
296
|
+
var valInit = valOg;
|
|
297
|
+
if (keyInit === "children") {
|
|
298
|
+
viewProps[keyInit] = valInit;
|
|
749
299
|
return;
|
|
750
300
|
}
|
|
751
|
-
if (
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
viewProps[key] = val;
|
|
301
|
+
if (keyInit === "ref") return;
|
|
302
|
+
if (keyInit[0] === "d" && keyInit.startsWith("data-")) return;
|
|
303
|
+
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`before-prop-${keyInit}`;
|
|
304
|
+
if (process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return;
|
|
305
|
+
if (!disableExpandShorthands) {
|
|
306
|
+
if (keyInit in shorthands) keyInit = shorthands[keyInit];
|
|
758
307
|
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
pass[passCompoundKey] = keyOg;
|
|
765
|
-
pass[passCompoundStates] = compoundStates;
|
|
766
|
-
} else if (pass[passCompoundIndexes]) pass[passCompoundIndexes] = void 0;
|
|
767
|
-
if (parentConditionKey) pass[passParentCursor] = acquireConditionKeyCursor(pass[passStyleState], parentConditionKey);
|
|
768
|
-
try {
|
|
769
|
-
var [styleState, conf, props, viewProps, staticConfig, validStyles, accept, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, parentStaticConfig, defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
|
|
770
|
-
var noSkip = Boolean(flags & passNoSkipFlag);
|
|
771
|
-
var disableExpandShorthands = Boolean(flags & passDisableShorthandsFlag);
|
|
772
|
-
var noExpand = Boolean(flags & passNoExpandFlag);
|
|
773
|
-
var noMergeStyle = Boolean(flags & passNoMergeFlag);
|
|
774
|
-
var isHOC = Boolean(flags & passHocFlag);
|
|
775
|
-
var isText = Boolean(flags & passTextFlag);
|
|
776
|
-
var isInput = Boolean(flags & passInputFlag);
|
|
777
|
-
var shorthands = conf.shorthands;
|
|
778
|
-
var shouldSkipDirectProps = !noSkip && !isHOC;
|
|
779
|
-
var shouldCheckSkipProps = !noSkip;
|
|
780
|
-
var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
|
|
781
|
-
var isTextOrInput = isText || isInput;
|
|
782
|
-
var hocParentVariants = isHOC ? parentVariants : void 0;
|
|
783
|
-
var keyInit = keyOg;
|
|
784
|
-
var valInit = valOg;
|
|
785
|
-
if (keyInit === "children") {
|
|
786
|
-
viewProps[keyInit] = valInit;
|
|
787
|
-
return;
|
|
788
|
-
}
|
|
789
|
-
if (keyInit === "ref") return;
|
|
790
|
-
if (keyInit[0] === "d" && keyInit.startsWith("data-")) return;
|
|
791
|
-
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`before-prop-${keyInit}`;
|
|
792
|
-
if (process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return;
|
|
793
|
-
if (accept) {
|
|
794
|
-
var accepted = accept[keyInit];
|
|
795
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit === "undefined" ? "undefined" : _type_of(valInit)) === "object") {
|
|
796
|
-
viewProps[keyInit] = resolveAcceptedStyle(styleState, valInit);
|
|
308
|
+
if (keyInit === "className") {
|
|
309
|
+
if (pass[passParentCursor]) return;
|
|
310
|
+
if (typeof valInit === "string" && valInit && (styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.resolveClassName)) {
|
|
311
|
+
if (noMergeStyle) {
|
|
312
|
+
viewProps.className = valInit;
|
|
797
313
|
return;
|
|
798
314
|
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
315
|
+
var resolveClassName = styleFrontend === null || styleFrontend === void 0 ? void 0 : styleFrontend.resolveClassName;
|
|
316
|
+
var sink = function(entry) {
|
|
317
|
+
var property2 = entry[0];
|
|
318
|
+
if (entry[2] !== void 0) {
|
|
319
|
+
if (isValidStyleKey(property2, validStyles)) contributeValue(styleState, property2, entry[1], void 0, false, entry[2]);
|
|
320
|
+
else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${property2}" is not a valid style on this component; the frontend value is dropped.`);
|
|
321
|
+
} else {
|
|
322
|
+
if (property2 === "group") pass[passFrontendGroup] = entry[1];
|
|
323
|
+
else if (property2 === "container") pass[passFrontendContainer] = entry[1];
|
|
324
|
+
else if (property2 === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
325
|
+
contributeProp(pass, property2, entry[1]);
|
|
808
326
|
}
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
clearDirectStyle(styleState, property);
|
|
817
|
-
styleState.classNames[property] = generatedClass;
|
|
818
|
-
((_pass = pass)[_passHocMappedProperties = passHocMappedProperties] || (_pass[_passHocMappedProperties] = /* @__PURE__ */ new Set())).add(property);
|
|
819
|
-
((_pass1 = pass)[_passHocMappedClasses = passHocMappedClasses] || (_pass1[_passHocMappedClasses] = /* @__PURE__ */ new Set())).add(generatedClass);
|
|
820
|
-
}
|
|
327
|
+
};
|
|
328
|
+
var start = 0;
|
|
329
|
+
for (var index = 0; index <= valInit.length; index++) {
|
|
330
|
+
if (index !== valInit.length && valInit.charCodeAt(index) > 32) continue;
|
|
331
|
+
if (index === start) {
|
|
332
|
+
start = index + 1;
|
|
333
|
+
continue;
|
|
821
334
|
}
|
|
822
|
-
var
|
|
823
|
-
var
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
if ((_pass_passHocMappedClasses = pass[passHocMappedClasses]) === null || _pass_passHocMappedClasses === void 0 ? void 0 : _pass_passHocMappedClasses.has(candidate)) {
|
|
833
|
-
start = index + 1;
|
|
834
|
-
continue;
|
|
835
|
-
}
|
|
836
|
-
var plan = getClassPlan ? getClassPlan(candidate, conf) : "raw";
|
|
837
|
-
if (plan === null) {
|
|
838
|
-
if (process.env.NODE_ENV === "development") warnOnce(`[tamagui] frontend candidate "${candidate}" is unavailable on this platform and was dropped.`);
|
|
839
|
-
} else if (plan === "raw") {
|
|
840
|
-
pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
|
|
841
|
-
if (getClassPlan) {
|
|
842
|
-
flushForwardStylesToClasses(pass);
|
|
843
|
-
pass[passShouldDoClasses] = false;
|
|
844
|
-
styleState.flatShouldDoClasses = false;
|
|
845
|
-
}
|
|
846
|
-
} else {
|
|
847
|
-
var parentPlan = plan;
|
|
848
|
-
if (!Array.isArray(plan) && parentPlan.preserveRawClass) {
|
|
849
|
-
pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
|
|
850
|
-
flushForwardStylesToClasses(pass);
|
|
851
|
-
pass[passShouldDoClasses] = false;
|
|
852
|
-
styleState.flatShouldDoClasses = false;
|
|
853
|
-
}
|
|
854
|
-
var entries = Array.isArray(plan) ? plan : parentPlan.entries;
|
|
855
|
-
for (var entryIndex = 0; entryIndex < entries.length; entryIndex++) {
|
|
856
|
-
var entry = entries[entryIndex];
|
|
857
|
-
if (entry[2] !== void 0) {
|
|
858
|
-
if (isValidStyleKey(entry[0], validStyles, accept)) contributeValue(styleState, entry[0], entry[1], mergeStyle, void 0, false, entry[2]);
|
|
859
|
-
else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${entry[0]}" is not a valid style on this component; the frontend value is dropped.`);
|
|
860
|
-
} else {
|
|
861
|
-
if (entry[0] === "group") pass[passFrontendGroup] = entry[1];
|
|
862
|
-
else if (entry[0] === "container") pass[passFrontendContainer] = entry[1];
|
|
863
|
-
else if (entry[0] === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
864
|
-
contributeProp(pass, entry[0], entry[1]);
|
|
865
|
-
}
|
|
335
|
+
var candidate = valInit.slice(start, index);
|
|
336
|
+
var preserveRaw = resolveClassName ? resolveClassName(candidate, conf, sink) : true;
|
|
337
|
+
if (preserveRaw === null) {
|
|
338
|
+
if (process.env.NODE_ENV === "development") warnOnce(`[tamagui] frontend candidate "${candidate}" is unavailable on this platform and was dropped.`);
|
|
339
|
+
} else if (preserveRaw) {
|
|
340
|
+
pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
|
|
341
|
+
if (resolveClassName) {
|
|
342
|
+
if (pass[passShouldDoClasses]) {
|
|
343
|
+
completeResolvedStyles(styleState);
|
|
344
|
+
flushDirectStyles(styleState, true);
|
|
866
345
|
}
|
|
346
|
+
pass[passShouldDoClasses] = false;
|
|
347
|
+
styleState.flatShouldDoClasses = false;
|
|
867
348
|
}
|
|
868
|
-
start = index + 1;
|
|
869
|
-
}
|
|
870
|
-
if (props[HOC_CLASSNAME_MARKER] !== void 0) {
|
|
871
|
-
flushForwardStylesToClasses(pass);
|
|
872
|
-
pass[passShouldDoClasses] = false;
|
|
873
|
-
styleState.flatShouldDoClasses = false;
|
|
874
349
|
}
|
|
350
|
+
start = index + 1;
|
|
875
351
|
}
|
|
876
|
-
return;
|
|
877
352
|
}
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
var
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
if (!style) continue;
|
|
889
|
-
var hocClassNames1 = style[TAMAGUI_CLASS_PROPS];
|
|
890
|
-
if (hocClassNames1) {
|
|
891
|
-
for (var property1 in hocClassNames1) {
|
|
892
|
-
var _pass2, _passHocMappedProperties1;
|
|
893
|
-
clearDirectStyle(styleState, property1);
|
|
894
|
-
styleState.classNames[property1] = hocClassNames1[property1];
|
|
895
|
-
((_pass2 = pass)[_passHocMappedProperties1 = passHocMappedProperties] || (_pass2[_passHocMappedProperties1] = /* @__PURE__ */ new Set())).add(property1);
|
|
896
|
-
}
|
|
897
|
-
continue;
|
|
898
|
-
}
|
|
899
|
-
var normalized = normalizeStyle(style, false, true);
|
|
900
|
-
var styleOriginals = shouldTrackStyleTokenProvenance ? styleOriginalValues.get(style) : void 0;
|
|
901
|
-
for (var key in normalized) {
|
|
902
|
-
var _pass_passHocMappedProperties;
|
|
903
|
-
if (normalized[key] == null) continue;
|
|
904
|
-
if ((_pass_passHocMappedProperties = pass[passHocMappedProperties]) === null || _pass_passHocMappedProperties === void 0 ? void 0 : _pass_passHocMappedProperties.delete(key)) clearDirectStyle(styleState, key);
|
|
905
|
-
contributeValue(styleState, key, normalized[key], mergeStyle, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key]);
|
|
906
|
-
}
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
if (keyInit === HOC_CLASSNAME_MARKER) {
|
|
356
|
+
if (valInit && (typeof valInit === "undefined" ? "undefined" : _type_of(valInit)) === "object") {
|
|
357
|
+
var _direct;
|
|
358
|
+
var layers = (_direct = styleState).flatPropertyLayers || (_direct.flatPropertyLayers = /* @__PURE__ */ new Map());
|
|
359
|
+
for (var property in valInit) {
|
|
360
|
+
clearDirectStyle(styleState, property);
|
|
361
|
+
styleState.classNames[property] = valInit[property];
|
|
362
|
+
layers.set(property, pass[passSourceLayer]);
|
|
907
363
|
}
|
|
908
|
-
return;
|
|
909
364
|
}
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (keyInit === "style") {
|
|
368
|
+
if (!valInit) return;
|
|
369
|
+
if (noMergeStyle) {
|
|
370
|
+
viewProps.style = valInit;
|
|
371
|
+
return;
|
|
914
372
|
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
var
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
if (
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
var _numberOfLines;
|
|
929
|
-
(_numberOfLines = (_viewProps = viewProps).numberOfLines) !== null && _numberOfLines !== void 0 || (_viewProps.numberOfLines = 1);
|
|
930
|
-
var _ellipsizeMode;
|
|
931
|
-
(_ellipsizeMode = (_viewProps1 = viewProps).ellipsizeMode) !== null && _ellipsizeMode !== void 0 || (_viewProps1.ellipsizeMode = "tail");
|
|
373
|
+
var layerBeforeStyle = pass[passSourceLayer];
|
|
374
|
+
pass[passSourceLayer] = sourceLayerStyle;
|
|
375
|
+
var isArray = Array.isArray(valInit);
|
|
376
|
+
var length = isArray ? valInit.length : 1;
|
|
377
|
+
for (var index1 = 0; index1 < length; index1++) {
|
|
378
|
+
var style = isArray ? valInit[index1] : valInit;
|
|
379
|
+
if (!style) continue;
|
|
380
|
+
if (isStylePiece(style)) {
|
|
381
|
+
var resolvedPiece = resolveStylePiece(styleState, style);
|
|
382
|
+
var pieceOriginals = shouldTrackStyleTokenProvenance ? styleOriginalValues.get(style[stylePieceSymbol].styleObject) : void 0;
|
|
383
|
+
for (var key in resolvedPiece) {
|
|
384
|
+
if (resolvedPiece[key] == null) continue;
|
|
385
|
+
contributeValue(styleState, key, resolvedPiece[key], pieceOriginals === null || pieceOriginals === void 0 ? void 0 : pieceOriginals[key]);
|
|
932
386
|
}
|
|
933
|
-
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
if (isStyleProp && asChildExceptStyleLike) return;
|
|
940
|
-
var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
|
|
941
|
-
var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
|
|
942
|
-
var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps));
|
|
943
|
-
var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
944
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
945
|
-
console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
|
|
946
|
-
log({
|
|
947
|
-
isVariant,
|
|
948
|
-
valInit,
|
|
949
|
-
shouldPassProp
|
|
950
|
-
});
|
|
951
|
-
if (isClient) log({
|
|
952
|
-
variants,
|
|
953
|
-
variant: variants === null || variants === void 0 ? void 0 : variants[keyInit],
|
|
954
|
-
isVariant,
|
|
955
|
-
isHOCShouldPassThrough,
|
|
956
|
-
parentStaticConfig
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
if (shouldPassThrough) {
|
|
960
|
-
passDownProp(viewProps, keyInit, valInit);
|
|
961
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
962
|
-
if (!isVariant) return;
|
|
963
|
-
}
|
|
964
|
-
if (shouldCheckSkipProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) {
|
|
965
|
-
if (keyInit in skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(driverAnimations === null || driverAnimations === void 0 ? void 0 : driverAnimations[valInit]))) {
|
|
966
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
967
|
-
return;
|
|
387
|
+
continue;
|
|
388
|
+
}
|
|
389
|
+
var styleOriginals = shouldTrackStyleTokenProvenance ? styleOriginalValues.get(style) : void 0;
|
|
390
|
+
for (var key1 in style) {
|
|
391
|
+
if (style[key1] == null) continue;
|
|
392
|
+
contributeValue(styleState, key1, style[key1], styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key1]);
|
|
968
393
|
}
|
|
969
394
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
395
|
+
pass[passSourceLayer] = layerBeforeStyle;
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
if (defaultProps) {
|
|
399
|
+
var _defaultProps_keyOg;
|
|
400
|
+
var defaultVal = (_defaultProps_keyOg = defaultProps[keyOg]) !== null && _defaultProps_keyOg !== void 0 ? _defaultProps_keyOg : defaultProps[keyInit];
|
|
401
|
+
if (defaultVal !== void 0 && valInit === defaultVal) return;
|
|
402
|
+
}
|
|
403
|
+
var isNativeInputColor = isInput && keyInit in nativeTextInputColorProps;
|
|
404
|
+
if (!isNativeInputColor && keyInit in skipProps && shouldSkipDirectProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) if (keyInit === "transition" && typeof valInit === "string") return;
|
|
405
|
+
else return;
|
|
406
|
+
var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles);
|
|
407
|
+
if (!isValidStyleKeyInit) {
|
|
408
|
+
if (!isAndroid) {
|
|
409
|
+
if (keyInit === "elevationAndroid") return;
|
|
410
|
+
}
|
|
411
|
+
if (keyInit === "userSelect") {
|
|
412
|
+
keyInit = "selectable";
|
|
413
|
+
valInit = valInit !== "none";
|
|
414
|
+
} else if (keyInit === "textOverflow") {
|
|
415
|
+
if (isText && valInit === "ellipsis") {
|
|
416
|
+
var _viewProps, _viewProps1;
|
|
417
|
+
var _numberOfLines;
|
|
418
|
+
(_numberOfLines = (_viewProps = viewProps).numberOfLines) !== null && _numberOfLines !== void 0 || (_viewProps.numberOfLines = 1);
|
|
419
|
+
var _ellipsizeMode;
|
|
420
|
+
(_ellipsizeMode = (_viewProps1 = viewProps).ellipsizeMode) !== null && _ellipsizeMode !== void 0 || (_viewProps1.ellipsizeMode = "tail");
|
|
421
|
+
}
|
|
422
|
+
return;
|
|
423
|
+
} else if (keyInit.startsWith("data-")) return;
|
|
424
|
+
}
|
|
425
|
+
var isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
|
|
426
|
+
var isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
|
|
427
|
+
if (isStyleProp && asChildExceptStyleLike) return;
|
|
428
|
+
var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
|
|
429
|
+
var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
|
|
430
|
+
var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps));
|
|
431
|
+
var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
432
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
433
|
+
console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
|
|
434
|
+
log({
|
|
435
|
+
isVariant,
|
|
436
|
+
valInit,
|
|
437
|
+
shouldPassProp
|
|
438
|
+
});
|
|
439
|
+
if (isClient) log({
|
|
440
|
+
variants,
|
|
441
|
+
variant: variants === null || variants === void 0 ? void 0 : variants[keyInit],
|
|
442
|
+
isVariant,
|
|
443
|
+
isHOCShouldPassThrough,
|
|
444
|
+
parentStaticConfig: pass[15]
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
if (shouldPassThrough) {
|
|
448
|
+
if (keyInit in viewProps) delete viewProps[keyInit];
|
|
449
|
+
viewProps[keyInit] = valInit;
|
|
450
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
451
|
+
if (!isVariant) return;
|
|
452
|
+
}
|
|
453
|
+
if (!isNativeInputColor && shouldCheckSkipProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) {
|
|
454
|
+
if (keyInit in skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(driverAnimations === null || driverAnimations === void 0 ? void 0 : driverAnimations[valInit]))) {
|
|
455
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
976
456
|
return;
|
|
977
457
|
}
|
|
458
|
+
}
|
|
459
|
+
if (isTextOrInput) {
|
|
460
|
+
if (valInit && (keyInit === "fontFamily" || keyInit === shorthands["fontFamily"]) && valInit in conf.fontsParsed) styleState.fontFamily = valInit;
|
|
461
|
+
}
|
|
462
|
+
if (isValidStyleKeyInit && valInit != null && !(valInit === "unset") && !(variants && keyInit in variants) && !((styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(keyInit)) || styledContext && keyInit in styledContext)) {
|
|
463
|
+
contributeValue(styleState, keyInit, valInit, originalOg);
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
if (variants && keyInit in variants && !noExpand && !disabled) {
|
|
467
|
+
var _variantConfig_variantStyleResolver;
|
|
468
|
+
var previousLayer = pass[passSourceLayer];
|
|
469
|
+
pass[passSourceLayer] = previousLayer ? sourceLayerVariant : sourceLayerBase;
|
|
978
470
|
pass[passMapSourceKey] = keyInit;
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
471
|
+
var variantConfig = styleState.flatStyleStaticConfig;
|
|
472
|
+
(_variantConfig_variantStyleResolver = variantConfig.variantStyleResolver) === null || _variantConfig_variantStyleResolver === void 0 || _variantConfig_variantStyleResolver.call(variantConfig, styleState, variantConfig.variants, keyInit, valInit, keyInit, pass[passParentCursor]);
|
|
473
|
+
pass[passSourceLayer] = previousLayer;
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
var isStyledContextProp = !isHOC && ((styledContextKeys === null || styledContextKeys === void 0 ? void 0 : styledContextKeys.has(keyInit)) || styledContext && keyInit in styledContext);
|
|
477
|
+
if (isStyledContextProp) {
|
|
478
|
+
var _styleState1, _styleState2;
|
|
479
|
+
((_styleState1 = styleState).overriddenContextProps || (_styleState1.overriddenContextProps = {}))[keyInit] = originalOg;
|
|
480
|
+
((_styleState2 = styleState).originalContextPropValues || (_styleState2.originalContextPropValues = {}))[keyInit] = originalOg;
|
|
481
|
+
}
|
|
482
|
+
var isHostStyleKey = isValidStyleKeyInit || isAndroid && keyInit === "elevation";
|
|
483
|
+
if (isHostStyleKey || isStyledContextProp) {
|
|
484
|
+
if (valInit === "unset") {
|
|
485
|
+
var expanded = expandStyle(keyInit, valInit, conf.settings.styleCompat || "web");
|
|
486
|
+
clearDirectStyle(styleState, keyInit);
|
|
487
|
+
if (expanded) for (var index2 = 0; index2 < expanded.length; index2++) clearDirectStyle(styleState, expanded[index2][0]);
|
|
488
|
+
} else contributeValue(styleState, keyInit, valInit, originalOg, !isHostStyleKey);
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
var condition = pass[passParentCursor];
|
|
492
|
+
if (condition) {
|
|
493
|
+
if (isHOC) {
|
|
494
|
+
var previous = viewProps[keyInit];
|
|
495
|
+
var transport = previous && (typeof previous === "undefined" ? "undefined" : _type_of(previous)) === "object" && !Array.isArray(previous) && "default" in previous ? previous : { default: previous };
|
|
496
|
+
transport[condition[conditionKey]] = valInit;
|
|
497
|
+
viewProps[keyInit] = transport;
|
|
498
|
+
} else if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${keyInit}" is not a valid style on this component; the conditional variant value is dropped.`);
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
if (keyInit in stylePropsAll) {
|
|
502
|
+
if (process.env.NODE_ENV === "development") console.warn(`[tamagui] "${keyInit}" is a text style prop and this component is not text \u2014 it would render on neither platform. Use a Text-based component, or html.* for raw web elements.`);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
viewProps[keyInit] = valInit;
|
|
506
|
+
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
507
|
+
try {
|
|
508
|
+
log(` \u2714\uFE0F expand complete`, keyInit);
|
|
509
|
+
log("style", { ...styleState.style });
|
|
510
|
+
log("viewProps", { ...viewProps });
|
|
511
|
+
log("transforms", styleState.transformAccumulator);
|
|
512
|
+
} catch (e) {}
|
|
513
|
+
console.groupEnd();
|
|
993
514
|
}
|
|
994
515
|
}
|
|
995
|
-
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver) {
|
|
996
|
-
var
|
|
516
|
+
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) {
|
|
517
|
+
var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_style;
|
|
997
518
|
var conf = getConfig();
|
|
998
|
-
|
|
519
|
+
styleStaticConfig || (styleStaticConfig = getStyleStaticConfig(staticConfig, conf));
|
|
999
520
|
var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
|
|
1000
521
|
var driverAnimations = driver === null || driver === void 0 ? void 0 : driver.animations;
|
|
1001
522
|
driver === null || driver === void 0 || driver.inputStyle;
|
|
@@ -1003,7 +524,8 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1003
524
|
var resolvedDriver = (driver === null || driver === void 0 ? void 0 : driver.isStub) ? null : driver;
|
|
1004
525
|
if (props.passThrough) return null;
|
|
1005
526
|
var { shorthands } = conf;
|
|
1006
|
-
var { isHOC, isText, isInput,
|
|
527
|
+
var { isHOC, isText, isInput, inlineProps, parentStaticConfig, acceptsClassName } = staticConfig;
|
|
528
|
+
var variants = styleStaticConfig.variants;
|
|
1007
529
|
var viewProps = {};
|
|
1008
530
|
var mediaState$1 = styleProps.mediaState || mediaState;
|
|
1009
531
|
var shouldDoClasses = !process.env.TAMAGUI_DID_OUTPUT_CSS && acceptsClassName && false;
|
|
@@ -1015,7 +537,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1015
537
|
var staticPassthroughClassName = "";
|
|
1016
538
|
var className = staticPassthroughClassName;
|
|
1017
539
|
if (staticPassthroughClassName) shouldDoClasses = false;
|
|
1018
|
-
var validStyles$1 = staticConfig.validStyles || (staticConfig.
|
|
540
|
+
var validStyles$1 = staticConfig.validStyles || (staticConfig.isInput ? stylePropsInput : staticConfig.isText ? stylePropsText : validStyles);
|
|
1019
541
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-setup`;
|
|
1020
542
|
var styleState = {
|
|
1021
543
|
classNames,
|
|
@@ -1036,7 +558,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1036
558
|
flatGroupContext: groupContext,
|
|
1037
559
|
animationDriver: resolvedDriver
|
|
1038
560
|
};
|
|
1039
|
-
|
|
561
|
+
styleState.flatStyleStaticConfig = styleStaticConfig;
|
|
1040
562
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`style-state`;
|
|
1041
563
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && isClient) {
|
|
1042
564
|
if (isDevTools) {
|
|
@@ -1054,21 +576,20 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1054
576
|
}
|
|
1055
577
|
}
|
|
1056
578
|
var { asChild } = props;
|
|
1057
|
-
var {
|
|
1058
|
-
var { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext
|
|
579
|
+
var { neverSkipProps } = staticConfig;
|
|
580
|
+
var { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext } = styleProps;
|
|
581
|
+
var styledContextKeys = styleStaticConfig.styledContextKeys;
|
|
1059
582
|
var styleFrontend = staticConfig.styleFrontend;
|
|
1060
583
|
var frontendGroup;
|
|
1061
584
|
var frontendContainer;
|
|
1062
585
|
var frontendContainerType;
|
|
1063
|
-
var
|
|
1064
|
-
var
|
|
586
|
+
var processedProps = props;
|
|
587
|
+
var parentVariants = parentStaticConfig ? getStyleStaticConfig(parentStaticConfig, conf).variants : void 0;
|
|
588
|
+
var defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
|
|
1065
589
|
var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
1066
590
|
var containerValue;
|
|
1067
591
|
var containerName;
|
|
1068
592
|
var containerType;
|
|
1069
|
-
var hocMappedClassProperties;
|
|
1070
|
-
var hocMappedClasses;
|
|
1071
|
-
var stylePassFlags = (noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0);
|
|
1072
593
|
var pass = [
|
|
1073
594
|
styleState,
|
|
1074
595
|
conf,
|
|
@@ -1076,7 +597,6 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1076
597
|
viewProps,
|
|
1077
598
|
staticConfig,
|
|
1078
599
|
validStyles$1,
|
|
1079
|
-
accept,
|
|
1080
600
|
neverSkipProps,
|
|
1081
601
|
variants,
|
|
1082
602
|
inlineProps,
|
|
@@ -1084,7 +604,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1084
604
|
styleFrontend,
|
|
1085
605
|
styledContext,
|
|
1086
606
|
styledContextKeys,
|
|
1087
|
-
|
|
607
|
+
(noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
|
|
1088
608
|
debug,
|
|
1089
609
|
parentStaticConfig,
|
|
1090
610
|
defaultProps,
|
|
@@ -1098,85 +618,104 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1098
618
|
containerType,
|
|
1099
619
|
frontendGroup,
|
|
1100
620
|
frontendContainer,
|
|
1101
|
-
frontendContainerType
|
|
1102
|
-
hocMappedClassProperties,
|
|
1103
|
-
hocMappedClasses
|
|
621
|
+
frontendContainerType
|
|
1104
622
|
];
|
|
1105
623
|
styleState.flatPass = pass;
|
|
1106
|
-
|
|
1107
|
-
|
|
624
|
+
var conditionalStates = null;
|
|
625
|
+
var usesSafeArea = false;
|
|
626
|
+
var baseStyle = styleStaticConfig.baseStyle;
|
|
627
|
+
var baseVariantProps = styleStaticConfig.baseVariantProps;
|
|
628
|
+
var appliesBaseStyle = baseStyle && !processedProps.asChild;
|
|
629
|
+
pass[passSourceLayer] = sourceLayerBase;
|
|
630
|
+
if (appliesBaseStyle && baseVariantProps) {
|
|
631
|
+
var callerKeys;
|
|
632
|
+
for (var key in baseVariantProps) if (Object.hasOwn(processedProps, key) && processedProps[key] !== baseVariantProps[key]) (callerKeys || (callerKeys = /* @__PURE__ */ new Set())).add(key);
|
|
633
|
+
styleState.flatCallerVariantKeys = callerKeys;
|
|
634
|
+
}
|
|
635
|
+
if (appliesBaseStyle) for (var key1 in baseStyle) {
|
|
636
|
+
var _styleStaticConfig_baseStylePieces;
|
|
637
|
+
var baseValue = baseVariantProps && Object.hasOwn(baseVariantProps, key1) && Object.hasOwn(processedProps, key1) ? processedProps[key1] : baseStyle[key1];
|
|
638
|
+
var expandedKey = shorthands[key1] || key1;
|
|
639
|
+
if ((isText || isInput) && baseValue && expandedKey === "fontFamily" && baseValue in conf.fontsParsed) styleState.fontFamily = baseValue;
|
|
640
|
+
(_styleStaticConfig_baseStylePieces = styleStaticConfig.baseStylePieces) === null || _styleStaticConfig_baseStylePieces === void 0 || _styleStaticConfig_baseStylePieces[key1];
|
|
641
|
+
contributeProp(pass, key1, baseValue);
|
|
642
|
+
}
|
|
643
|
+
pass[passSourceLayer] = sourceLayerProps;
|
|
644
|
+
for (var key2 in processedProps) {
|
|
645
|
+
if (appliesBaseStyle && baseVariantProps && Object.hasOwn(baseVariantProps, key2)) continue;
|
|
646
|
+
contributeProp(pass, key2, processedProps[key2]);
|
|
647
|
+
}
|
|
648
|
+
var resolvers = staticConfig.resolvers;
|
|
649
|
+
if (resolvers && !noExpand) {
|
|
650
|
+
pass[passSourceLayer] = sourceLayerResolver;
|
|
651
|
+
var flagsBefore = pass[passFlags];
|
|
652
|
+
pass[passFlags] = flagsBefore | passNoExpandFlag;
|
|
653
|
+
var env = getDynamicEnv(styleState);
|
|
654
|
+
for (var index = 0; index < resolvers.length; index++) {
|
|
655
|
+
var resolved = resolvers[index](processedProps, env);
|
|
656
|
+
if (resolved) for (var key3 in resolved) {
|
|
657
|
+
if (resolved[key3] == null) continue;
|
|
658
|
+
contributeProp(pass, key3, resolved[key3]);
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
pass[passFlags] = flagsBefore;
|
|
662
|
+
}
|
|
663
|
+
className = pass[passClassName];
|
|
664
|
+
shouldDoClasses = pass[passShouldDoClasses];
|
|
665
|
+
containerValue = pass[passContainerValue];
|
|
666
|
+
containerName = pass[passContainerName];
|
|
667
|
+
containerType = pass[passContainerType];
|
|
668
|
+
frontendGroup = pass[passFrontendGroup];
|
|
669
|
+
frontendContainer = pass[passFrontendContainer];
|
|
670
|
+
frontendContainerType = pass[passFrontendContainerType];
|
|
1108
671
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-propsend`;
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
672
|
+
conditionalStates = styleState.flatStateKeys || null;
|
|
673
|
+
usesSafeArea = !!styleState.flatUsesSafeArea;
|
|
674
|
+
hasMedia = ((_styleState_flatMediaKeys = styleState.flatMediaKeys) === null || _styleState_flatMediaKeys === void 0 ? void 0 : _styleState_flatMediaKeys.size) ? styleState.flatMediaKeys : false;
|
|
675
|
+
pseudoGroups = ((_styleState_flatGroupKeys = styleState.flatGroupKeys) === null || _styleState_flatGroupKeys === void 0 ? void 0 : _styleState_flatGroupKeys.size) ? styleState.flatGroupKeys : void 0;
|
|
676
|
+
mediaGroups = ((_styleState_flatGroupMedia = styleState.flatGroupMedia) === null || _styleState_flatGroupMedia === void 0 ? void 0 : _styleState_flatGroupMedia.size) ? styleState.flatGroupMedia : void 0;
|
|
677
|
+
if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
|
|
678
|
+
shouldDoClasses = false;
|
|
679
|
+
styleState.flatShouldDoClasses = false;
|
|
680
|
+
if (styleState.transformAccumulator) {
|
|
681
|
+
mergeStyle(styleState, "transform", finalizeTransformAccumulator(styleState.transformAccumulator), true);
|
|
682
|
+
styleState.transformAccumulator = void 0;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
if (styleProps.stylePieceEntries) {
|
|
686
|
+
var slots = styleState.flatSlots;
|
|
687
|
+
if (slots) {
|
|
688
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1115
689
|
try {
|
|
1116
|
-
for (var
|
|
1117
|
-
var
|
|
1118
|
-
|
|
690
|
+
for (var _iterator = slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
691
|
+
var [slot, entries] = _step.value;
|
|
692
|
+
styleProps.stylePieceEntries[slot] = entries;
|
|
1119
693
|
}
|
|
1120
694
|
} catch (err) {
|
|
1121
|
-
|
|
1122
|
-
|
|
695
|
+
_didIteratorError = true;
|
|
696
|
+
_iteratorError = err;
|
|
1123
697
|
} finally {
|
|
1124
698
|
try {
|
|
1125
|
-
if (!
|
|
699
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1126
700
|
} finally {
|
|
1127
|
-
if (
|
|
701
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1128
702
|
}
|
|
1129
703
|
}
|
|
1130
704
|
}
|
|
1131
705
|
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
var
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
try {
|
|
1145
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
1146
|
-
} finally {
|
|
1147
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
if ((_styleState_flatGroupMedia = styleState.flatGroupMedia) === null || _styleState_flatGroupMedia === void 0 ? void 0 : _styleState_flatGroupMedia.size) {
|
|
1152
|
-
mediaGroups || (mediaGroups = /* @__PURE__ */ new Set());
|
|
1153
|
-
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
1154
|
-
try {
|
|
1155
|
-
for (var _iterator22 = styleState.flatGroupMedia[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
1156
|
-
var key2 = _step22.value;
|
|
1157
|
-
mediaGroups.add(key2);
|
|
1158
|
-
}
|
|
1159
|
-
} catch (err) {
|
|
1160
|
-
_didIteratorError22 = true;
|
|
1161
|
-
_iteratorError22 = err;
|
|
1162
|
-
} finally {
|
|
1163
|
-
try {
|
|
1164
|
-
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
1165
|
-
} finally {
|
|
1166
|
-
if (_didIteratorError22) throw _iteratorError22;
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
if (styleProps.canPlatformPseudo && styleState.flatHasPlatformPseudo) {
|
|
1171
|
-
shouldDoClasses = false;
|
|
1172
|
-
styleState.flatShouldDoClasses = false;
|
|
1173
|
-
if (styleState.transformAccumulator) {
|
|
1174
|
-
mergeStyle(styleState, "transform", finalizeTransformAccumulator(styleState.transformAccumulator), 1, true);
|
|
1175
|
-
styleState.transformAccumulator = void 0;
|
|
1176
|
-
}
|
|
1177
|
-
convertDeferredInline(styleState, mergeStyle);
|
|
706
|
+
completeResolvedStyles(styleState);
|
|
707
|
+
if (styleProps.isStatic) for (var property in classNames) {
|
|
708
|
+
var identifier = classNames[property];
|
|
709
|
+
if (rulesToInsert[identifier]) continue;
|
|
710
|
+
var rules = getRulesForIdentifier(identifier);
|
|
711
|
+
if (rules) rulesToInsert[identifier] = [
|
|
712
|
+
property,
|
|
713
|
+
"",
|
|
714
|
+
identifier,
|
|
715
|
+
void 0,
|
|
716
|
+
rules
|
|
717
|
+
];
|
|
1178
718
|
}
|
|
1179
|
-
completeStreaming(styleState, mergeStyle);
|
|
1180
719
|
var effectiveTransition = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transition;
|
|
1181
720
|
if (effectiveTransition != null && styleState.style && true) delete styleState.style.transition;
|
|
1182
721
|
if (styleState.style) {
|
|
@@ -1184,21 +723,18 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1184
723
|
if ("containerName" in styleState.style) delete styleState.style.containerName;
|
|
1185
724
|
}
|
|
1186
725
|
if (!(noNormalize === false)) {
|
|
1187
|
-
if (styleState.style)
|
|
1188
|
-
fixStyles(styleState.style);
|
|
1189
|
-
if (!noExpand && !noMergeStyle) {}
|
|
1190
|
-
}
|
|
726
|
+
if (styleState.style) fixStyles(styleState.style);
|
|
1191
727
|
if (styleState.transformAccumulator && !styleState.flatShouldDoClasses) {
|
|
1192
728
|
var _styleState;
|
|
1193
729
|
(_styleState = styleState).style || (_styleState.style = {});
|
|
1194
730
|
styleState.style.transform = finalizeTransformAccumulator(styleState.transformAccumulator);
|
|
1195
731
|
}
|
|
1196
732
|
if (parentSplitStyles) {
|
|
1197
|
-
if (!shouldDoClasses) for (var
|
|
733
|
+
if (!shouldDoClasses) for (var key5 in parentSplitStyles.style) {
|
|
1198
734
|
var _styleState1;
|
|
1199
|
-
if (
|
|
735
|
+
if (key5 in classNames || styleState.style && key5 in styleState.style) continue;
|
|
1200
736
|
(_styleState1 = styleState).style || (_styleState1.style = {});
|
|
1201
|
-
styleState.style[
|
|
737
|
+
styleState.style[key5] = parentSplitStyles.style[key5];
|
|
1202
738
|
}
|
|
1203
739
|
}
|
|
1204
740
|
}
|
|
@@ -1227,9 +763,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1227
763
|
if (shouldTrackStyleTokenProvenance && styleState.style && styleState.tokenProvenance) {
|
|
1228
764
|
var provenance = {};
|
|
1229
765
|
var hasProvenance = false;
|
|
1230
|
-
for (var
|
|
1231
|
-
provenance[
|
|
1232
|
-
token: styleState.tokenProvenance[
|
|
766
|
+
for (var key6 in styleState.tokenProvenance) {
|
|
767
|
+
provenance[key6] = {
|
|
768
|
+
token: styleState.tokenProvenance[key6],
|
|
1233
769
|
theme: themeName
|
|
1234
770
|
};
|
|
1235
771
|
hasProvenance = true;
|
|
@@ -1250,7 +786,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1250
786
|
if (effectiveTransition != null) result.effectiveTransition = effectiveTransition;
|
|
1251
787
|
if (conditionalStates) result.programStates = conditionalStates;
|
|
1252
788
|
if (usesSafeArea) result.usesSafeArea = true;
|
|
1253
|
-
if (
|
|
789
|
+
if (styleState.flatDynamicThemeAccess) result.dynamicThemeAccess = true;
|
|
1254
790
|
if (styleState.flatEnterKeys || styleState.flatExitKeys) result.programLifecycleStyleKeys = {
|
|
1255
791
|
enter: effectiveLifecycleKeys(styleState.flatEnterKeys),
|
|
1256
792
|
exit: effectiveLifecycleKeys(styleState.flatExitKeys)
|
|
@@ -1280,7 +816,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1280
816
|
rulesToInsert,
|
|
1281
817
|
parentSplitStyles
|
|
1282
818
|
};
|
|
1283
|
-
for (var
|
|
819
|
+
for (var key8 in logs) log(key8, logs[key8]);
|
|
1284
820
|
} catch (e) {}
|
|
1285
821
|
console.groupEnd();
|
|
1286
822
|
}
|
|
@@ -1288,11 +824,41 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
1288
824
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-done`;
|
|
1289
825
|
return result;
|
|
1290
826
|
};
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
827
|
+
var stylePieceStaticConfig = {
|
|
828
|
+
acceptsClassName: true,
|
|
829
|
+
isText: true,
|
|
830
|
+
validStyles: stylePropsAll
|
|
831
|
+
};
|
|
832
|
+
var compileStylePieceRuntime = function(piece, layer) {};
|
|
833
|
+
setStylePieceCompiler(compileStylePieceRuntime);
|
|
834
|
+
setStylePieceResolver(function(piece, theme, themeName) {
|
|
835
|
+
var split = getSplitStyles({ style: piece }, stylePieceStaticConfig, theme, themeName, defaultComponentStateMounted, {
|
|
836
|
+
isAnimated: false,
|
|
837
|
+
resolveValues: "value"
|
|
838
|
+
});
|
|
839
|
+
return (split === null || split === void 0 ? void 0 : split.style) || {};
|
|
840
|
+
});
|
|
841
|
+
var resolvedStylePieceCache = /* @__PURE__ */ new WeakMap();
|
|
842
|
+
function resolveStylePiece(styleState, piece) {
|
|
843
|
+
var definition = piece[stylePieceSymbol].styleObject;
|
|
844
|
+
if (!isStylePieceCacheable(piece)) return resolveStyleObject(styleState, definition);
|
|
845
|
+
var themeCache = resolvedStylePieceCache.get(piece);
|
|
846
|
+
if (!themeCache) {
|
|
847
|
+
themeCache = /* @__PURE__ */ new WeakMap();
|
|
848
|
+
resolvedStylePieceCache.set(piece, themeCache);
|
|
849
|
+
}
|
|
850
|
+
var theme = styleState.theme;
|
|
851
|
+
var cached = themeCache.get(theme);
|
|
852
|
+
if (cached) return cached;
|
|
853
|
+
var resolved = resolveStyleObject(styleState, definition);
|
|
854
|
+
themeCache.set(theme, resolved);
|
|
855
|
+
return resolved;
|
|
856
|
+
}
|
|
857
|
+
function mergeStyle(styleState, key, val) {
|
|
858
|
+
arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
|
|
859
|
+
var originalVal = arguments.length > 4 ? arguments[4] : void 0;
|
|
1294
860
|
var { viewProps, styleProps, staticConfig } = styleState;
|
|
1295
|
-
var contextPropSet =
|
|
861
|
+
var contextPropSet = styleState.flatStyleStaticConfig.styledContextKeys;
|
|
1296
862
|
if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(key)) {
|
|
1297
863
|
var _styleState_originalContextPropValues;
|
|
1298
864
|
var _styleState;
|
|
@@ -1307,7 +873,7 @@ function mergeStyle(styleState, key, val, _importance) {
|
|
|
1307
873
|
addTransformValue(styleState.transformAccumulator, key, val);
|
|
1308
874
|
} else {
|
|
1309
875
|
var out = val;
|
|
1310
|
-
if (staticConfig.
|
|
876
|
+
if (staticConfig.isInput && key in nativeTextInputColorProps) viewProps[nativeTextInputColorProps[key]] = out;
|
|
1311
877
|
else {
|
|
1312
878
|
var _styleState2;
|
|
1313
879
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
@@ -1324,14 +890,14 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
1324
890
|
var opacity = slash === -1 ? NaN : Number(tokenName.slice(slash + 1));
|
|
1325
891
|
if (Number.isInteger(opacity) && opacity >= 0 && opacity <= 100) tokenName = tokenName.slice(0, slash);
|
|
1326
892
|
}
|
|
1327
|
-
if (tokenName !== "" && (
|
|
1328
|
-
return
|
|
893
|
+
if (tokenName !== "" && (tokenName in styleState.theme || tokenName in (((_styleState_conf_themes = styleState.conf.themes) === null || _styleState_conf_themes === void 0 ? void 0 : _styleState_conf_themes[styleState.flatThemeName || ""]) || {}) || Object.values(styleState.conf.tokensParsed).some(function(category) {
|
|
894
|
+
return tokenName in category;
|
|
1329
895
|
}))) {
|
|
1330
896
|
var _styleState;
|
|
1331
897
|
((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
|
|
1332
898
|
} else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
|
|
1333
899
|
}
|
|
1334
|
-
var
|
|
900
|
+
var resolveStyleObject = function(styleState, styleIn) {
|
|
1335
901
|
var { conf, styleProps } = styleState;
|
|
1336
902
|
var styleOut = {};
|
|
1337
903
|
var originalValues;
|
|
@@ -1344,13 +910,10 @@ var resolveAcceptedStyle = function(styleState, styleIn) {
|
|
|
1344
910
|
style: styleOut,
|
|
1345
911
|
transformAccumulator: void 0
|
|
1346
912
|
};
|
|
1347
|
-
childState.flatUsed = void 0;
|
|
1348
|
-
childState.flatTransitions = void 0;
|
|
1349
913
|
childState.flatAtomics = void 0;
|
|
1350
|
-
childState.flatSingleEntries = void 0;
|
|
1351
914
|
childState.flatSlots = void 0;
|
|
1352
|
-
childState.
|
|
1353
|
-
var mergeAccepted = function(_state, key2, value2,
|
|
915
|
+
childState.flatPropertyLayers = void 0;
|
|
916
|
+
var mergeAccepted = function(_state, key2, value2, disableNormalize, originalValue) {
|
|
1354
917
|
styleOut[key2] = disableNormalize || styleProps.noNormalize ? value2 : normalizeValueWithProperty(value2, key2);
|
|
1355
918
|
var _styleInOriginalValues_key;
|
|
1356
919
|
var trackedOriginal = (_styleInOriginalValues_key = styleInOriginalValues === null || styleInOriginalValues === void 0 ? void 0 : styleInOriginalValues[key2]) !== null && _styleInOriginalValues_key !== void 0 ? _styleInOriginalValues_key : originalValue;
|
|
@@ -1360,99 +923,63 @@ var resolveAcceptedStyle = function(styleState, styleIn) {
|
|
|
1360
923
|
var value = styleIn[key];
|
|
1361
924
|
key = conf.shorthands[key] || key;
|
|
1362
925
|
if (key in skipProps || value == null) continue;
|
|
1363
|
-
contributeValue(childState, key, value
|
|
926
|
+
contributeValue(childState, key, value);
|
|
1364
927
|
}
|
|
1365
|
-
|
|
928
|
+
completeResolvedStyles(childState, mergeAccepted);
|
|
1366
929
|
if (childState.transformAccumulator) styleOut.transform = finalizeTransformAccumulator(childState.transformAccumulator);
|
|
1367
930
|
if (!styleProps.noNormalize) fixStyles(styleOut);
|
|
1368
931
|
if (originalValues) styleOriginalValues.set(styleOut, originalValues);
|
|
1369
932
|
return styleOut;
|
|
1370
933
|
};
|
|
1371
|
-
function passDownProp(viewProps, key, val) {
|
|
1372
|
-
if (key in viewProps) delete viewProps[key];
|
|
1373
|
-
viewProps[key] = val;
|
|
1374
|
-
}
|
|
1375
934
|
var frameSequence = 0;
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
for (var index = 0; index < transitions.length; index++) if (transitions[index].property === property && transitions[index].identity === identity) {
|
|
1385
|
-
transitions[index].value = value;
|
|
1386
|
-
transitions[index].condition = condition;
|
|
1387
|
-
return;
|
|
1388
|
-
}
|
|
1389
|
-
transitions.push({
|
|
1390
|
-
property,
|
|
1391
|
-
value,
|
|
1392
|
-
condition,
|
|
1393
|
-
identity,
|
|
1394
|
-
selector: cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "",
|
|
1395
|
-
wrappers: cursor ? conditionWrapperCopy(cursor) : void 0
|
|
1396
|
-
});
|
|
1397
|
-
return;
|
|
1398
|
-
}
|
|
1399
|
-
streamAtomic(state, property, value, condition, identity, cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "", cursor ? conditionWrappers : void 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0, cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0, direct.flatWeakContribution === true, original);
|
|
1400
|
-
}
|
|
1401
|
-
function streamWriteInline(state, property, value, cursor, merge, original) {
|
|
1402
|
-
var normalize = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false, conditionOverride = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : -1;
|
|
1403
|
-
var _direct;
|
|
1404
|
-
var direct = state;
|
|
1405
|
-
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1406
|
-
var importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1407
|
-
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1408
|
-
var previous = used[property];
|
|
1409
|
-
if (previous !== void 0) {
|
|
1410
|
-
if (previous > importance) return;
|
|
1411
|
-
if (direct.flatWeakContribution === true) return;
|
|
1412
|
-
}
|
|
1413
|
-
used[property] = importance;
|
|
1414
|
-
merge(state, property, value, 1, !normalize, original);
|
|
1415
|
-
}
|
|
1416
|
-
function streamRetractInline(state, property, cursor) {
|
|
1417
|
-
var _direct;
|
|
1418
|
-
var direct = state;
|
|
1419
|
-
var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1420
|
-
var importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1421
|
-
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1422
|
-
var previous = used[property];
|
|
1423
|
-
if (previous !== void 0 && previous > importance) return;
|
|
1424
|
-
used[property] = importance;
|
|
1425
|
-
if (state.style) delete state.style[property];
|
|
1426
|
-
}
|
|
1427
|
-
function convertDeferredInline(state, merge) {
|
|
935
|
+
var recordInline = 1;
|
|
936
|
+
var recordNormalize = 2;
|
|
937
|
+
var recordRetract = 4;
|
|
938
|
+
var recordDefault = 8;
|
|
939
|
+
var recordCSS = 16;
|
|
940
|
+
function writeStyleRecord(state, property, value, cursor, original, flags) {
|
|
941
|
+
var conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1;
|
|
942
|
+
var _state_flatPass;
|
|
1428
943
|
var _direct;
|
|
1429
|
-
var
|
|
1430
|
-
var
|
|
1431
|
-
var
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
944
|
+
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? cursor[conditionValue] : 0;
|
|
945
|
+
var identity = cursor ? cursor[conditionKey] : "";
|
|
946
|
+
var slots = (_direct = state).flatSlots || (_direct.flatSlots = /* @__PURE__ */ new Map());
|
|
947
|
+
var slot = property.startsWith("transition") ? "transition" : property;
|
|
948
|
+
var list = slots.get(slot);
|
|
949
|
+
if (!list) slots.set(slot, list = []);
|
|
950
|
+
for (var index = 0; index < list.length; index++) {
|
|
951
|
+
var entry = list[index];
|
|
952
|
+
var entryFlags = entry[7];
|
|
953
|
+
if ((entryFlags & (recordInline | recordCSS)) !== (flags & (recordInline | recordCSS))) continue;
|
|
954
|
+
if (entry[0] !== property) continue;
|
|
955
|
+
if (flags & recordDefault) {
|
|
956
|
+
if (!(entryFlags & recordDefault) && (!entry[2] || entry[3] === identity)) return;
|
|
957
|
+
} else if (entryFlags & recordDefault && (!condition || entry[3] === identity)) {
|
|
958
|
+
list.splice(index--, 1);
|
|
959
|
+
continue;
|
|
960
|
+
}
|
|
961
|
+
if (entry[3] === identity) {
|
|
962
|
+
list.splice(index, 1);
|
|
963
|
+
break;
|
|
1441
964
|
}
|
|
1442
|
-
};
|
|
1443
|
-
var slots = direct.flatSlots;
|
|
1444
|
-
if (slots) {
|
|
1445
|
-
direct.flatSlots = void 0;
|
|
1446
|
-
for (var property in slots) consume(slots[property]);
|
|
1447
|
-
}
|
|
1448
|
-
var transitions = direct.flatTransitions;
|
|
1449
|
-
if (transitions) {
|
|
1450
|
-
direct.flatTransitions = void 0;
|
|
1451
|
-
consume(transitions);
|
|
1452
965
|
}
|
|
1453
|
-
|
|
966
|
+
list.push([
|
|
967
|
+
property,
|
|
968
|
+
value,
|
|
969
|
+
condition,
|
|
970
|
+
identity,
|
|
971
|
+
cursor ? cursor[conditionSelector] : "",
|
|
972
|
+
cursor ? cursor[conditionWrappers] : void 0,
|
|
973
|
+
original,
|
|
974
|
+
flags | (((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passSourceLayer]) || 0) << 5
|
|
975
|
+
]);
|
|
1454
976
|
}
|
|
1455
|
-
function
|
|
977
|
+
function streamWriteInline(state, property, value, cursor, original) {
|
|
978
|
+
var normalize = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : property === "lineHeight", conditionOverride = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : -1, force = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : false;
|
|
979
|
+
writeStyleRecord(state, property, value, cursor, original, (normalize ? recordNormalize : 0) | (force ? recordInline : 0), conditionOverride);
|
|
980
|
+
}
|
|
981
|
+
function completeResolvedStyles(state) {
|
|
982
|
+
var merge = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : mergeStyle;
|
|
1456
983
|
var direct = state;
|
|
1457
984
|
var shadow = direct.flatWebShadow;
|
|
1458
985
|
if (shadow && (direct.flatBoxShadowSequence || 0) <= shadow[4]) {
|
|
@@ -1464,291 +991,116 @@ function completeStreaming(state, merge) {
|
|
|
1464
991
|
var color = normalizeColor(shadow[0], (_shadow_ = shadow[2]) !== null && _shadow_ !== void 0 ? _shadow_ : 1);
|
|
1465
992
|
if (color) {
|
|
1466
993
|
var next = `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow[3])} ${color}`;
|
|
1467
|
-
emitProperty(state, "boxShadow", direct.flatBoxShadow ? `${direct.flatBoxShadow}, ${next}` : next, null,
|
|
994
|
+
emitProperty(state, "boxShadow", direct.flatBoxShadow ? `${direct.flatBoxShadow}, ${next}` : next, null, shadow[5], shadow[6]);
|
|
995
|
+
}
|
|
996
|
+
direct.flatWebShadow = void 0;
|
|
997
|
+
}
|
|
998
|
+
if (state.flatShouldDoClasses && state.transformAccumulator) {
|
|
999
|
+
var transform = finalizeTransformAccumulator(state.transformAccumulator);
|
|
1000
|
+
state.transformAccumulator = void 0;
|
|
1001
|
+
writeStyleRecord(state, "transform", Array.isArray(transform) ? transformsToString(transform) : transform, null, transform, 0);
|
|
1002
|
+
}
|
|
1003
|
+
var slots = direct.flatSlots;
|
|
1004
|
+
if (!slots) return;
|
|
1005
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1006
|
+
try {
|
|
1007
|
+
for (var _iterator = slots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1008
|
+
var [property, entries] = _step.value;
|
|
1009
|
+
var cssEntries = void 0;
|
|
1010
|
+
var inlineWinner = void 0;
|
|
1011
|
+
var importance = -1;
|
|
1012
|
+
for (var index = 0; index < entries.length; index++) {
|
|
1013
|
+
var entry = entries[index];
|
|
1014
|
+
var flags = entry[7];
|
|
1015
|
+
if (flags & recordCSS || state.flatShouldDoClasses && !(flags & recordInline)) {
|
|
1016
|
+
cssEntries || (cssEntries = []);
|
|
1017
|
+
var precedence = entry[2] ? Math.floor(entry[2] / 256) : -1;
|
|
1018
|
+
var layer = flags >> 5;
|
|
1019
|
+
var index1 = cssEntries.length;
|
|
1020
|
+
while (index1 > 0) {
|
|
1021
|
+
var before = cssEntries[index1 - 1];
|
|
1022
|
+
var beforeLayer = before[7] >> 5;
|
|
1023
|
+
if (beforeLayer < layer || beforeLayer === layer && (before[2] ? Math.floor(before[2] / 256) : -1) <= precedence) break;
|
|
1024
|
+
index1--;
|
|
1025
|
+
}
|
|
1026
|
+
if (index1 === cssEntries.length) cssEntries.push(entry);
|
|
1027
|
+
else cssEntries.splice(index1, 0, entry);
|
|
1028
|
+
} else if (!entry[2] || entry[2] & 1) {
|
|
1029
|
+
var next1 = entry[2] ? Math.floor(entry[2] / 256) : 0;
|
|
1030
|
+
if (next1 >= importance) {
|
|
1031
|
+
importance = next1;
|
|
1032
|
+
inlineWinner = entry;
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
if (cssEntries) registerAtomicSlot(direct, property, cssEntries);
|
|
1037
|
+
if (inlineWinner) if (inlineWinner[7] & recordRetract) {
|
|
1038
|
+
if (state.style) delete state.style[inlineWinner[0]];
|
|
1039
|
+
} else merge(state, inlineWinner[0], inlineWinner[1], !(inlineWinner[7] & recordNormalize), inlineWinner[6] !== void 0 ? inlineWinner[6] : inlineWinner[1]);
|
|
1040
|
+
}
|
|
1041
|
+
} catch (err) {
|
|
1042
|
+
_didIteratorError = true;
|
|
1043
|
+
_iteratorError = err;
|
|
1044
|
+
} finally {
|
|
1045
|
+
try {
|
|
1046
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1047
|
+
} finally {
|
|
1048
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1468
1049
|
}
|
|
1469
1050
|
}
|
|
1470
|
-
|
|
1051
|
+
direct.flatSlots = void 0;
|
|
1471
1052
|
}
|
|
1472
|
-
function emitAtParentCondition(state, property, value,
|
|
1053
|
+
function emitAtParentCondition(state, property, value, originalValue, contextOnly) {
|
|
1473
1054
|
var _state_flatPass;
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1055
|
+
var cursor = (_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor];
|
|
1056
|
+
if (cursor) emitUnderCondition(state, property, value, cursor, originalValue, contextOnly, 0, value);
|
|
1057
|
+
else emitValue(state, property, value, null, originalValue, contextOnly);
|
|
1058
|
+
}
|
|
1059
|
+
function emitUnderCondition(state, property, value, cursor, originalValue, contextOnly, warnMode, warnSource) {
|
|
1060
|
+
var condition = cursor[conditionValue];
|
|
1061
|
+
if (!(condition & conditionResolvedFlag)) {
|
|
1062
|
+
if (warnMode && process.env.NODE_ENV !== "production") warnRefusedValue(property, warnSource, `unknown modifier "${cursor.problem}"`);
|
|
1481
1063
|
return 0;
|
|
1482
1064
|
}
|
|
1483
|
-
|
|
1484
|
-
if (
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
var flags = conditionNumbers[cursor + conditionFlagsOffset];
|
|
1488
|
-
if (flags & conditionEnterFlag) state.flatHasEnterStyle = true;
|
|
1489
|
-
if (flags & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
|
|
1490
|
-
} else if (merge && property && condition & 2) {
|
|
1491
|
-
var flags1 = conditionNumbers[cursor + conditionFlagsOffset];
|
|
1492
|
-
if (flags1 & conditionEnterFlag) state.flatHasEnterStyle = true;
|
|
1493
|
-
if (flags1 & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
|
|
1065
|
+
emitValue(state, property, value, cursor, warnMode === 2 ? originalValue : originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
1066
|
+
if (condition & 2) {
|
|
1067
|
+
if (condition & 4) state.flatHasEnterStyle = true;
|
|
1068
|
+
if (condition & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
|
|
1494
1069
|
}
|
|
1495
1070
|
return condition;
|
|
1496
1071
|
}
|
|
1497
|
-
var
|
|
1498
|
-
|
|
1499
|
-
var _directState_flatPass;
|
|
1500
|
-
if (isBase) {
|
|
1501
|
-
if (start === end) return;
|
|
1502
|
-
feedCompoundSegment(state, source, start, end, true, valid || failure === "invalid-character" || failure === "stray-comment-close", "");
|
|
1503
|
-
if (!valid) {
|
|
1504
|
-
if (failure === "invalid-character" || failure === "stray-comment-close") return 16;
|
|
1505
|
-
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : "an unterminated \"(\"");
|
|
1506
|
-
return;
|
|
1507
|
-
}
|
|
1508
|
-
var value = source.slice(start, end);
|
|
1509
|
-
emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
1510
|
-
return 5;
|
|
1511
|
-
}
|
|
1512
|
-
if (!chainValid) {
|
|
1513
|
-
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
|
|
1514
|
-
return;
|
|
1515
|
-
}
|
|
1516
|
-
if (start === end) {
|
|
1517
|
-
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, "a conditional clause has no value");
|
|
1518
|
-
return;
|
|
1519
|
-
}
|
|
1520
|
-
if (property === "aspectRatio" && chainCount === 1) {
|
|
1521
|
-
var left = Number(source.slice(chainStart, chainEnd));
|
|
1522
|
-
var right = Number(source.slice(start, end));
|
|
1523
|
-
if (chainStart < chainEnd && Number.isFinite(left) && left > 0 && Number.isFinite(right) && right > 0) return 12;
|
|
1524
|
-
}
|
|
1525
|
-
var directState = state;
|
|
1526
|
-
var cursor = directState.flatScanCursor;
|
|
1527
|
-
var condition = valid ? emitUnderCondition(state, property, source.slice(start, end), cursor, merge, void 0, contextOnly, 1, source) : conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1528
|
-
feedCompoundSegment(directState, source, start, end, false, valid && Boolean(condition), condition && ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
1529
|
-
if (!condition) return;
|
|
1530
|
-
if (!valid) {
|
|
1531
|
-
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
|
|
1532
|
-
return;
|
|
1533
|
-
}
|
|
1534
|
-
return 4 | (condition & 12 ? 2 : 0);
|
|
1535
|
-
},
|
|
1536
|
-
modifier(state, start, end, valid, first, source) {
|
|
1537
|
-
var directState = state;
|
|
1538
|
-
var cursor = directState.flatScanCursor;
|
|
1539
|
-
if (!cursor) {
|
|
1540
|
-
var _directState_flatPass;
|
|
1541
|
-
cursor = directState.flatScanCursor = acquireConditionCursor(((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null);
|
|
1542
|
-
} else if (first) {
|
|
1543
|
-
var _directState_flatPass1;
|
|
1544
|
-
resetConditionCursor(cursor, ((_directState_flatPass1 = directState.flatPass) === null || _directState_flatPass1 === void 0 ? void 0 : _directState_flatPass1[passParentCursor]) || null);
|
|
1545
|
-
}
|
|
1546
|
-
if (!valid) {
|
|
1547
|
-
setConditionUnresolved(cursor);
|
|
1548
|
-
return;
|
|
1549
|
-
}
|
|
1550
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
|
|
1551
|
-
},
|
|
1552
|
-
chain(state, _start, _end, valid) {
|
|
1553
|
-
var cursor = state.flatScanCursor;
|
|
1554
|
-
if (cursor) {
|
|
1555
|
-
if (!valid) setConditionUnresolved(cursor);
|
|
1556
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
|
|
1557
|
-
}
|
|
1558
|
-
return true;
|
|
1559
|
-
},
|
|
1560
|
-
end(state, source, result, lastPayloadStart, chainCount, property, merge, originalValue, contextOnly, failure, failureIndex) {
|
|
1561
|
-
var hasBase = !!(result & 1);
|
|
1562
|
-
if (result & 16) {
|
|
1563
|
-
if (chainCount === 0) {
|
|
1564
|
-
emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1565
|
-
hasBase = true;
|
|
1566
|
-
} else if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"");
|
|
1567
|
-
}
|
|
1568
|
-
if (result & 8 && chainCount === 1) {
|
|
1569
|
-
emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1570
|
-
hasBase = true;
|
|
1571
|
-
}
|
|
1572
|
-
if (process.env.NODE_ENV === "development" && !hasBase && result & 4 && (property in tokenCategories.color || property in tokenCategoryByProperty) && splitComponents(source.slice(lastPayloadStart)).length > 1) warnOnce(`${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1573
|
-
if ((!canGenerateCSS || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
|
|
1574
|
-
var value = implicitLifecycleBase(property);
|
|
1575
|
-
if (value !== null) emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1072
|
+
var formatScanFailure = function(failure, source, failureIndex) {
|
|
1073
|
+
return failure === "invalid-character" ? `"${source[failureIndex]}" would end the declaration or rule` : failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : failure === "stray-comment-close" ? "a stray \"*/\"" : "an unterminated \"(\"";
|
|
1578
1074
|
};
|
|
1579
|
-
function
|
|
1580
|
-
|
|
1581
|
-
}
|
|
1582
|
-
var legacyTransformParts = /* @__PURE__ */ new Set([
|
|
1583
|
-
"matrix",
|
|
1584
|
-
"perspective",
|
|
1585
|
-
"rotateX",
|
|
1586
|
-
"rotateY",
|
|
1587
|
-
"rotateZ",
|
|
1588
|
-
"scaleZ",
|
|
1589
|
-
"skewX",
|
|
1590
|
-
"skewY"
|
|
1591
|
-
]);
|
|
1592
|
-
var webShadowParts = {
|
|
1593
|
-
shadowColor: 1,
|
|
1594
|
-
shadowOffset: 2,
|
|
1595
|
-
shadowOpacity: 3,
|
|
1596
|
-
shadowRadius: 4
|
|
1075
|
+
var warnScanFailure = function(property, source, failure, failureIndex) {
|
|
1076
|
+
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, formatScanFailure(failure, source, failureIndex));
|
|
1597
1077
|
};
|
|
1598
|
-
var webTextShadowParts = /* @__PURE__ */ new Set([
|
|
1599
|
-
"textShadowColor",
|
|
1600
|
-
"textShadowOffset",
|
|
1601
|
-
"textShadowRadius"
|
|
1602
|
-
]);
|
|
1603
|
-
var lineStyles = /* @__PURE__ */ new Set([
|
|
1604
|
-
"none",
|
|
1605
|
-
"hidden",
|
|
1606
|
-
"dotted",
|
|
1607
|
-
"dashed",
|
|
1608
|
-
"solid",
|
|
1609
|
-
"double",
|
|
1610
|
-
"groove",
|
|
1611
|
-
"ridge",
|
|
1612
|
-
"inset",
|
|
1613
|
-
"outset"
|
|
1614
|
-
]);
|
|
1615
1078
|
var borderTargets = {
|
|
1616
|
-
border:
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
color: [
|
|
1630
|
-
"borderTopColor",
|
|
1631
|
-
"borderRightColor",
|
|
1632
|
-
"borderBottomColor",
|
|
1633
|
-
"borderLeftColor"
|
|
1634
|
-
]
|
|
1635
|
-
},
|
|
1636
|
-
borderTop: {
|
|
1637
|
-
width: ["borderTopWidth"],
|
|
1638
|
-
style: ["borderTopStyle"],
|
|
1639
|
-
color: ["borderTopColor"]
|
|
1640
|
-
},
|
|
1641
|
-
borderRight: {
|
|
1642
|
-
width: ["borderRightWidth"],
|
|
1643
|
-
style: ["borderRightStyle"],
|
|
1644
|
-
color: ["borderRightColor"]
|
|
1645
|
-
},
|
|
1646
|
-
borderBottom: {
|
|
1647
|
-
width: ["borderBottomWidth"],
|
|
1648
|
-
style: ["borderBottomStyle"],
|
|
1649
|
-
color: ["borderBottomColor"]
|
|
1650
|
-
},
|
|
1651
|
-
borderLeft: {
|
|
1652
|
-
width: ["borderLeftWidth"],
|
|
1653
|
-
style: ["borderLeftStyle"],
|
|
1654
|
-
color: ["borderLeftColor"]
|
|
1655
|
-
},
|
|
1656
|
-
outline: {
|
|
1657
|
-
width: ["outlineWidth"],
|
|
1658
|
-
style: ["outlineStyle"],
|
|
1659
|
-
color: ["outlineColor"]
|
|
1660
|
-
},
|
|
1661
|
-
borderBlock: {
|
|
1662
|
-
width: ["borderBlockStartWidth", "borderBlockEndWidth"],
|
|
1663
|
-
style: ["borderBlockStartStyle", "borderBlockEndStyle"],
|
|
1664
|
-
color: ["borderBlockStartColor", "borderBlockEndColor"]
|
|
1665
|
-
},
|
|
1666
|
-
borderInline: {
|
|
1667
|
-
width: ["borderInlineStartWidth", "borderInlineEndWidth"],
|
|
1668
|
-
style: ["borderInlineStartStyle", "borderInlineEndStyle"],
|
|
1669
|
-
color: ["borderInlineStartColor", "borderInlineEndColor"]
|
|
1670
|
-
}
|
|
1671
|
-
};
|
|
1672
|
-
var tokenLookup = {
|
|
1673
|
-
value: void 0,
|
|
1674
|
-
fromTheme: false,
|
|
1675
|
-
themeKey: ""
|
|
1079
|
+
border: [
|
|
1080
|
+
"Top",
|
|
1081
|
+
"Right",
|
|
1082
|
+
"Bottom",
|
|
1083
|
+
"Left"
|
|
1084
|
+
],
|
|
1085
|
+
borderTop: ["Top"],
|
|
1086
|
+
borderRight: ["Right"],
|
|
1087
|
+
borderBottom: ["Bottom"],
|
|
1088
|
+
borderLeft: ["Left"],
|
|
1089
|
+
outline: [""],
|
|
1090
|
+
borderBlock: ["BlockStart", "BlockEnd"],
|
|
1091
|
+
borderInline: ["InlineStart", "InlineEnd"]
|
|
1676
1092
|
};
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
var _state_theme, _state_conf_themes_, _state_conf_themes, _state_conf_tokensParsed_space, _state_conf_tokensParsed_color;
|
|
1685
|
-
var lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name;
|
|
1686
|
-
if (property === "fontFamily") {
|
|
1687
|
-
var _state_conf_fontsParsed_lookupName;
|
|
1688
|
-
var family = (_state_conf_fontsParsed_lookupName = state.conf.fontsParsed[lookupName]) === null || _state_conf_fontsParsed_lookupName === void 0 ? void 0 : _state_conf_fontsParsed_lookupName.family;
|
|
1689
|
-
return family ? fillTokenLookup(family, false, lookupName) : void 0;
|
|
1690
|
-
}
|
|
1691
|
-
var fontKey = property === "fontSize" ? "size" : property === "fontWeight" ? "weight" : property === "lineHeight" || property === "letterSpacing" ? property : void 0;
|
|
1692
|
-
if (fontKey) {
|
|
1693
|
-
var _font_fontKey;
|
|
1694
|
-
var font = state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] || state.conf.fontsParsed[state.conf.defaultFontToken];
|
|
1695
|
-
var value = font === null || font === void 0 ? void 0 : (_font_fontKey = font[fontKey]) === null || _font_fontKey === void 0 ? void 0 : _font_fontKey[lookupName];
|
|
1696
|
-
return value ? fillTokenLookup(value, false, lookupName) : void 0;
|
|
1697
|
-
}
|
|
1698
|
-
var category = getTokenCategoryForProperty(property);
|
|
1699
|
-
var dot = lookupName.indexOf(".");
|
|
1700
|
-
if (dot !== -1) {
|
|
1701
|
-
var prefix = lookupName.slice(0, dot);
|
|
1702
|
-
if (!category || prefix === category || prefix === "color") lookupName = lookupName.slice(dot + 1);
|
|
1703
|
-
}
|
|
1704
|
-
if (category) {
|
|
1705
|
-
var _state_conf_tokensParsed_category;
|
|
1706
|
-
var own = (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName];
|
|
1707
|
-
if (own) return fillTokenLookup(own, false, lookupName);
|
|
1708
|
-
for (var _i = 0, _iter = [
|
|
1709
|
-
"color",
|
|
1710
|
-
"space",
|
|
1711
|
-
"size",
|
|
1712
|
-
"radius",
|
|
1713
|
-
"zIndex"
|
|
1714
|
-
]; _i < _iter.length; _i++) {
|
|
1715
|
-
var sibling = _iter[_i];
|
|
1716
|
-
var _state_conf_tokensParsed_sibling;
|
|
1717
|
-
if (sibling !== category && ((_state_conf_tokensParsed_sibling = state.conf.tokensParsed[sibling]) === null || _state_conf_tokensParsed_sibling === void 0 ? void 0 : _state_conf_tokensParsed_sibling[lookupName])) return;
|
|
1718
|
-
}
|
|
1719
|
-
} else {
|
|
1720
|
-
var first = lookupName.charCodeAt(0);
|
|
1721
|
-
if (first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46) return;
|
|
1722
|
-
}
|
|
1723
|
-
var theme = ((_state_theme = state.theme) === null || _state_theme === void 0 ? void 0 : _state_theme[lookupName]) || ((_state_conf_themes = state.conf.themes) === null || _state_conf_themes === void 0 ? void 0 : (_state_conf_themes_ = _state_conf_themes[state.flatThemeName || ""]) === null || _state_conf_themes_ === void 0 ? void 0 : _state_conf_themes_[lookupName]);
|
|
1724
|
-
if (theme) return fillTokenLookup(theme, true, lookupName);
|
|
1725
|
-
if (category) return;
|
|
1726
|
-
var token = ((_state_conf_tokensParsed_space = state.conf.tokensParsed.space) === null || _state_conf_tokensParsed_space === void 0 ? void 0 : _state_conf_tokensParsed_space[lookupName]) || ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[lookupName]);
|
|
1727
|
-
return token ? fillTokenLookup(token, false, lookupName) : void 0;
|
|
1728
|
-
}
|
|
1729
|
-
var literalMissConf = null;
|
|
1730
|
-
var literalMissRevision = -1;
|
|
1731
|
-
var literalMisses = /* @__PURE__ */ new WeakMap();
|
|
1732
|
-
var literalMissRootTheme = {};
|
|
1733
|
-
function isFontKeyedProperty(property) {
|
|
1734
|
-
return property === "fontFamily" || property === "fontSize" || property === "fontWeight" || property === "lineHeight" || property === "letterSpacing";
|
|
1735
|
-
}
|
|
1736
|
-
function literalMissSet(state) {
|
|
1737
|
-
var revision = getConfigRevisionState(state.conf).revision;
|
|
1738
|
-
if (state.conf !== literalMissConf || revision !== literalMissRevision) {
|
|
1739
|
-
literalMissConf = state.conf;
|
|
1740
|
-
literalMissRevision = revision;
|
|
1741
|
-
literalMisses = /* @__PURE__ */ new WeakMap();
|
|
1742
|
-
}
|
|
1743
|
-
var themeKey = state.theme && _type_of(state.theme) === "object" ? state.theme : literalMissRootTheme;
|
|
1744
|
-
var set = literalMisses.get(themeKey);
|
|
1745
|
-
if (!set) {
|
|
1746
|
-
set = /* @__PURE__ */ new Set();
|
|
1747
|
-
literalMisses.set(themeKey, set);
|
|
1748
|
-
}
|
|
1749
|
-
return set;
|
|
1750
|
-
}
|
|
1093
|
+
var valueCacheConf;
|
|
1094
|
+
var valueCacheRevision = -1;
|
|
1095
|
+
var valueCaches = /* @__PURE__ */ new WeakMap();
|
|
1096
|
+
var valueCacheEntries = 0;
|
|
1097
|
+
var valueCacheRoot = {};
|
|
1098
|
+
var parsedSlices = /* @__PURE__ */ new WeakMap();
|
|
1099
|
+
var fontProperties = /* @__PURE__ */ new Map();
|
|
1751
1100
|
function configuredValue(state, property, raw) {
|
|
1101
|
+
var embedded = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
1102
|
+
var _maps;
|
|
1103
|
+
var grammar = getConfigRevisionState(state.conf);
|
|
1752
1104
|
var name = raw;
|
|
1753
1105
|
var opacity;
|
|
1754
1106
|
var slash = raw.lastIndexOf("/");
|
|
@@ -1759,227 +1111,183 @@ function configuredValue(state, property, raw) {
|
|
|
1759
1111
|
opacity = amount;
|
|
1760
1112
|
}
|
|
1761
1113
|
}
|
|
1762
|
-
var safeArea =
|
|
1114
|
+
var safeArea = grammar.safeAreaVariable(name);
|
|
1763
1115
|
if (safeArea !== void 0) {
|
|
1764
1116
|
state.flatUsesSafeArea = true;
|
|
1765
1117
|
return safeArea;
|
|
1766
1118
|
}
|
|
1767
|
-
var
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
if (process.env.NODE_ENV === "development" && tokenCategoryByProperty[property] && ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[name])) warnOnce(`"${name}" contributes to "color", not "${property}"; keeping it literal`);
|
|
1780
|
-
return raw;
|
|
1119
|
+
var fontProperty = fontProperties.get(property);
|
|
1120
|
+
if (fontProperty === void 0) {
|
|
1121
|
+
fontProperty = property.startsWith("font") || property === "lineHeight" || property === "letterSpacing";
|
|
1122
|
+
fontProperties.set(property, fontProperty);
|
|
1123
|
+
}
|
|
1124
|
+
var revision = grammar.revision;
|
|
1125
|
+
if (state.conf !== valueCacheConf || revision !== valueCacheRevision) {
|
|
1126
|
+
valueCacheConf = state.conf;
|
|
1127
|
+
valueCacheRevision = revision;
|
|
1128
|
+
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
1129
|
+
valueCacheEntries = 0;
|
|
1130
|
+
state.flatValueScope = void 0;
|
|
1781
1131
|
}
|
|
1782
1132
|
var resolveValues = state.styleProps.resolveValues;
|
|
1783
|
-
|
|
1784
|
-
var
|
|
1785
|
-
if (
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
continue;
|
|
1802
|
-
}
|
|
1803
|
-
if (!(code === 36 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122)) continue;
|
|
1804
|
-
var end = index + 1;
|
|
1805
|
-
while (end < raw.length) {
|
|
1806
|
-
var next = raw.charCodeAt(end);
|
|
1807
|
-
if (next === 36 || next === 45 || next === 46 || next === 95 || next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122) end++;
|
|
1808
|
-
else break;
|
|
1809
|
-
}
|
|
1810
|
-
if (raw.charCodeAt(end) === 47) {
|
|
1811
|
-
var suffix = end + 1;
|
|
1812
|
-
while (suffix < raw.length) {
|
|
1813
|
-
var next1 = raw.charCodeAt(suffix);
|
|
1814
|
-
if (next1 < 48 || next1 > 57) break;
|
|
1815
|
-
suffix++;
|
|
1816
|
-
}
|
|
1817
|
-
if (suffix > end + 1) end = suffix;
|
|
1818
|
-
}
|
|
1819
|
-
var before = raw.charCodeAt(index - 1);
|
|
1820
|
-
if (code !== 36 && (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(index - 2) === 45 || raw.charCodeAt(end) === 40)) {
|
|
1821
|
-
index = end - 1;
|
|
1822
|
-
continue;
|
|
1823
|
-
}
|
|
1824
|
-
var word = raw.slice(index, end);
|
|
1825
|
-
var value = configuredValue(state, property, word);
|
|
1826
|
-
if (value !== word) {
|
|
1827
|
-
out += raw.slice(copyFrom, index);
|
|
1828
|
-
out += String(value);
|
|
1829
|
-
copyFrom = end;
|
|
1830
|
-
}
|
|
1831
|
-
index = end - 1;
|
|
1133
|
+
var direct = state;
|
|
1134
|
+
var scope = direct.flatValueScope;
|
|
1135
|
+
if (scope === void 0 || direct.flatValueScopeKind !== resolveValues) {
|
|
1136
|
+
var themeObject = state.theme && _type_of(state.theme) === "object" ? state.theme : valueCacheRoot;
|
|
1137
|
+
var byScope = valueCaches.get(themeObject);
|
|
1138
|
+
if (!byScope) valueCaches.set(themeObject, byScope = /* @__PURE__ */ new Map());
|
|
1139
|
+
var scopeKey = `${state.flatThemeName || ""}${resolveValues}`;
|
|
1140
|
+
scope = byScope.get(scopeKey);
|
|
1141
|
+
if (!scope) byScope.set(scopeKey, scope = /* @__PURE__ */ new Map());
|
|
1142
|
+
direct.flatValueScope = scope;
|
|
1143
|
+
direct.flatValueScopeKind = resolveValues;
|
|
1144
|
+
}
|
|
1145
|
+
var maps = scope.get(property);
|
|
1146
|
+
if (maps === void 0) scope.set(property, maps = { direct: /* @__PURE__ */ new Map() });
|
|
1147
|
+
var byRaw = embedded ? (_maps = maps).embedded || (_maps.embedded = /* @__PURE__ */ new Map()) : maps.direct;
|
|
1148
|
+
if (!fontProperty) {
|
|
1149
|
+
var known = byRaw.get(raw);
|
|
1150
|
+
if (known !== void 0 || byRaw.has(raw)) return known;
|
|
1832
1151
|
}
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
depth++;
|
|
1853
|
-
continue;
|
|
1854
|
-
}
|
|
1855
|
-
if (code === 41) {
|
|
1856
|
-
depth--;
|
|
1857
|
-
continue;
|
|
1858
|
-
}
|
|
1859
|
-
if (depth || !(code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95) || index > 1 && raw.charCodeAt(index - 1) === 45 && raw.charCodeAt(index - 2) === 45) continue;
|
|
1860
|
-
var end = index + 1;
|
|
1861
|
-
while (end < raw.length) {
|
|
1862
|
-
var next = raw.charCodeAt(end);
|
|
1863
|
-
if (next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122 || next === 45 || next === 95) end++;
|
|
1864
|
-
else break;
|
|
1865
|
-
}
|
|
1866
|
-
if (raw.charCodeAt(end) !== 40) {
|
|
1867
|
-
var authored = raw.slice(index, end);
|
|
1868
|
-
var property = state.conf.shorthands[authored] || authored;
|
|
1869
|
-
if (property === "x" || property === "y") property = "translate";
|
|
1870
|
-
else if (property === "scaleX" || property === "scaleY") property = "scale";
|
|
1871
|
-
else if (legacyTransformParts.has(property)) property = "transform";
|
|
1872
|
-
var hasUpper = false;
|
|
1873
|
-
for (var offset = 0; offset < property.length; offset++) {
|
|
1874
|
-
var letter = property.charCodeAt(offset);
|
|
1875
|
-
if (letter >= 65 && letter <= 90) {
|
|
1876
|
-
hasUpper = true;
|
|
1877
|
-
break;
|
|
1878
|
-
}
|
|
1152
|
+
var lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name;
|
|
1153
|
+
var value;
|
|
1154
|
+
var fromTheme = false;
|
|
1155
|
+
if (property === "fontFamily") {
|
|
1156
|
+
var _state_conf_fontsParsed_lookupName;
|
|
1157
|
+
value = (_state_conf_fontsParsed_lookupName = state.conf.fontsParsed[lookupName]) === null || _state_conf_fontsParsed_lookupName === void 0 ? void 0 : _state_conf_fontsParsed_lookupName.family;
|
|
1158
|
+
} else {
|
|
1159
|
+
var fontKey = property === "fontSize" ? "size" : property === "fontWeight" ? "weight" : property === "lineHeight" || property === "letterSpacing" ? property : "";
|
|
1160
|
+
if (fontKey) {
|
|
1161
|
+
var _font_fontKey;
|
|
1162
|
+
var font = state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] || state.conf.fontsParsed[state.conf.defaultFontToken];
|
|
1163
|
+
value = font === null || font === void 0 ? void 0 : (_font_fontKey = font[fontKey]) === null || _font_fontKey === void 0 ? void 0 : _font_fontKey[lookupName];
|
|
1164
|
+
} else {
|
|
1165
|
+
var _state_conf_tokensParsed_category;
|
|
1166
|
+
var category = grammar.tokenCategory(property);
|
|
1167
|
+
var dot = lookupName.indexOf(".");
|
|
1168
|
+
if (dot !== -1) {
|
|
1169
|
+
var prefix = lookupName.slice(0, dot);
|
|
1170
|
+
if (!category || prefix === category || prefix === "color") lookupName = lookupName.slice(dot + 1);
|
|
1879
1171
|
}
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1172
|
+
value = category ? (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName] : void 0;
|
|
1173
|
+
if (!value) {
|
|
1174
|
+
var first = lookupName.charCodeAt(0);
|
|
1175
|
+
if (category || !(first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46)) {
|
|
1176
|
+
var _state_theme, _state_conf_themes_, _state_conf_themes;
|
|
1177
|
+
value = ((_state_theme = state.theme) === null || _state_theme === void 0 ? void 0 : _state_theme[lookupName]) || ((_state_conf_themes = state.conf.themes) === null || _state_conf_themes === void 0 ? void 0 : (_state_conf_themes_ = _state_conf_themes[state.flatThemeName || ""]) === null || _state_conf_themes_ === void 0 ? void 0 : _state_conf_themes_[lookupName]);
|
|
1178
|
+
fromTheme = !!value;
|
|
1179
|
+
if (!value && !category) {
|
|
1180
|
+
var _state_conf_tokensParsed_space, _state_conf_tokensParsed_color;
|
|
1181
|
+
value = ((_state_conf_tokensParsed_space = state.conf.tokensParsed.space) === null || _state_conf_tokensParsed_space === void 0 ? void 0 : _state_conf_tokensParsed_space[lookupName]) || ((_state_conf_tokensParsed_color = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color === void 0 ? void 0 : _state_conf_tokensParsed_color[lookupName]);
|
|
1182
|
+
}
|
|
1885
1183
|
}
|
|
1886
|
-
copyFrom = end;
|
|
1887
1184
|
}
|
|
1888
1185
|
}
|
|
1889
|
-
index = end - 1;
|
|
1890
1186
|
}
|
|
1891
|
-
|
|
1187
|
+
if (process.env.NODE_ENV === "development") {
|
|
1188
|
+
var _state_conf_tokensParsed_color1;
|
|
1189
|
+
var category1 = grammar.tokenCategory(property);
|
|
1190
|
+
if (category1 && category1 !== "color" && ((_state_conf_tokensParsed_color1 = state.conf.tokensParsed.color) === null || _state_conf_tokensParsed_color1 === void 0 ? void 0 : _state_conf_tokensParsed_color1[name])) warnOnce(`"${name}" contributes to "color", not "${property}"`);
|
|
1191
|
+
}
|
|
1192
|
+
var out = raw;
|
|
1193
|
+
if (isVariable(value)) {
|
|
1194
|
+
out = resolveValues === "except-theme" && fromTheme ? `${THEME_REF_PREFIX}${lookupName}${opacity !== void 0 ? `/${opacity}` : ""}` : resolveVariableValue(property, value, resolveValues);
|
|
1195
|
+
if (opacity !== void 0) {
|
|
1196
|
+
var _normalizeColor;
|
|
1197
|
+
out = (_normalizeColor = normalizeColor(out, opacity / 100)) !== null && _normalizeColor !== void 0 ? _normalizeColor : out;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
if (embedded && out === raw) {
|
|
1201
|
+
var usedSafeArea = state.flatUsesSafeArea;
|
|
1202
|
+
out = grammar.embeddedTokens(raw, function(word) {
|
|
1203
|
+
return configuredValue(state, property, word);
|
|
1204
|
+
});
|
|
1205
|
+
if (!usedSafeArea && state.flatUsesSafeArea) return out;
|
|
1206
|
+
}
|
|
1207
|
+
if (!fontProperty && !fromTheme) if (valueCacheEntries > 8192) {
|
|
1208
|
+
valueCaches = /* @__PURE__ */ new WeakMap();
|
|
1209
|
+
valueCacheEntries = 0;
|
|
1210
|
+
} else {
|
|
1211
|
+
valueCacheEntries++;
|
|
1212
|
+
byRaw.set(raw, out);
|
|
1213
|
+
}
|
|
1214
|
+
return out;
|
|
1892
1215
|
}
|
|
1893
|
-
function
|
|
1894
|
-
|
|
1216
|
+
function ownsSourceLayer(state, property) {
|
|
1217
|
+
var conditional = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
1218
|
+
var _direct_flatPass;
|
|
1219
|
+
var _direct;
|
|
1220
|
+
var direct = state;
|
|
1221
|
+
var layer = ((_direct_flatPass = direct.flatPass) === null || _direct_flatPass === void 0 ? void 0 : _direct_flatPass[passSourceLayer]) || 0;
|
|
1222
|
+
var layers = (_direct = direct).flatPropertyLayers || (_direct.flatPropertyLayers = /* @__PURE__ */ new Map());
|
|
1223
|
+
var previous = layers.get(property);
|
|
1224
|
+
if (previous !== void 0) {
|
|
1225
|
+
if (previous > layer) return false;
|
|
1226
|
+
if (previous < layer) {
|
|
1227
|
+
if (conditional) return true;
|
|
1228
|
+
clearDirectStyle(state, property);
|
|
1229
|
+
}
|
|
1230
|
+
} else if (conditional) return true;
|
|
1231
|
+
layers.set(property, layer);
|
|
1232
|
+
return true;
|
|
1895
1233
|
}
|
|
1896
|
-
function emitProperty(state, property, value, cursor,
|
|
1234
|
+
function emitProperty(state, property, value, cursor, originalValue, contextOnly) {
|
|
1897
1235
|
var _state_animationDriver;
|
|
1898
1236
|
var _state, _state1;
|
|
1237
|
+
if (!ownsSourceLayer(state, property, cursor !== null)) return;
|
|
1899
1238
|
var direct = state;
|
|
1900
|
-
var condition = cursor ?
|
|
1239
|
+
var condition = cursor ? cursor[conditionValue] : 0;
|
|
1240
|
+
if (condition && (!(condition & 2) || !(condition & 1) && !(canGenerateCSS && state.flatShouldDoClasses) && !(cursor[conditionTheme] && supportsDynamicColorIOS && isColorStyleKey(property)))) return;
|
|
1901
1241
|
if (condition & 4) ((_state = state).flatEnterKeys || (_state.flatEnterKeys = /* @__PURE__ */ new Set())).add(property);
|
|
1902
1242
|
if (condition & 8) ((_state1 = state).flatExitKeys || (_state1.flatExitKeys = /* @__PURE__ */ new Set())).add(property);
|
|
1903
|
-
var theme = cursor ?
|
|
1243
|
+
var theme = cursor ? cursor[conditionTheme] : "";
|
|
1904
1244
|
if (theme) {
|
|
1905
1245
|
if (supportsDynamicColorIOS && isColorStyleKey(property)) {
|
|
1906
1246
|
var _direct, _ref, _property;
|
|
1907
1247
|
var schemes = (_ref = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {}))[_property = property] || (_ref[_property] = {});
|
|
1908
|
-
schemes[theme] = typeof originalValue === "string" &&
|
|
1909
|
-
streamWriteInline(state, property, { dynamic: { ...schemes } }, cursor,
|
|
1248
|
+
schemes[theme] = typeof originalValue === "string" && /^[a-z]+$/i.test(originalValue) ? originalValue : value;
|
|
1249
|
+
streamWriteInline(state, property, { dynamic: { ...schemes } }, cursor, originalValue, true, condition & 1 ? condition : condition + 1);
|
|
1910
1250
|
return;
|
|
1911
1251
|
}
|
|
1912
1252
|
direct.flatDynamicThemeAccess = true;
|
|
1913
1253
|
}
|
|
1914
1254
|
if (contextOnly) {
|
|
1915
1255
|
if (!condition || condition & 1) {
|
|
1916
|
-
var
|
|
1917
|
-
((
|
|
1256
|
+
var _state3;
|
|
1257
|
+
((_state3 = state).overriddenContextProps || (_state3.overriddenContextProps = {}))[property] = originalValue;
|
|
1918
1258
|
}
|
|
1919
1259
|
return;
|
|
1920
1260
|
}
|
|
1921
1261
|
if (canGenerateCSS && state.flatShouldDoClasses && !condition && property === "transform") {
|
|
1922
|
-
var
|
|
1262
|
+
var _state4;
|
|
1923
1263
|
if (process.env.NODE_ENV === "development" && state.transformAccumulator) {
|
|
1924
|
-
var
|
|
1264
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1925
1265
|
try {
|
|
1926
|
-
for (var
|
|
1927
|
-
var
|
|
1928
|
-
warnOnce(`legacy transform part "${
|
|
1266
|
+
for (var _iterator = getTransformPartKeys(state.transformAccumulator)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1267
|
+
var part = _step.value;
|
|
1268
|
+
warnOnce(`legacy transform part "${part}" is dropped because "transform" owns the property`);
|
|
1929
1269
|
}
|
|
1930
1270
|
} catch (err) {
|
|
1931
|
-
|
|
1932
|
-
|
|
1271
|
+
_didIteratorError = true;
|
|
1272
|
+
_iteratorError = err;
|
|
1933
1273
|
} finally {
|
|
1934
1274
|
try {
|
|
1935
|
-
if (!
|
|
1275
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1936
1276
|
} finally {
|
|
1937
|
-
if (
|
|
1277
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1938
1278
|
}
|
|
1939
1279
|
}
|
|
1940
1280
|
}
|
|
1941
|
-
(
|
|
1281
|
+
(_state4 = state).transformAccumulator || (_state4.transformAccumulator = createTransformAccumulator());
|
|
1942
1282
|
addTransformValue(state.transformAccumulator, property, value);
|
|
1943
1283
|
return;
|
|
1944
1284
|
}
|
|
1945
1285
|
var shouldPromoteAnimatedStyle = canGenerateCSS && !condition && !state.flatShouldDoClasses && !state.styleProps.noMergeStyle && state.styleProps.isAnimated && ((_state_animationDriver = state.animationDriver) === null || _state_animationDriver === void 0 ? void 0 : _state_animationDriver.inputStyle) === "css" && property in nonAnimatableStyleProps;
|
|
1946
1286
|
if (canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
1947
|
-
|
|
1948
|
-
streamWriteCSS(state, property, value, cursor, originalValue);
|
|
1287
|
+
writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
|
|
1949
1288
|
return;
|
|
1950
1289
|
}
|
|
1951
|
-
|
|
1952
|
-
streamWriteInline(state, property, value, cursor, merge, originalValue);
|
|
1953
|
-
}
|
|
1954
|
-
function splitComponents(value) {
|
|
1955
|
-
var parts = [];
|
|
1956
|
-
var start = 0;
|
|
1957
|
-
var quote = 0;
|
|
1958
|
-
var depth = 0;
|
|
1959
|
-
for (var index = 0; index <= value.length; index++) {
|
|
1960
|
-
var code = index === value.length ? 32 : value.charCodeAt(index);
|
|
1961
|
-
if (quote) {
|
|
1962
|
-
if (code === 92) index++;
|
|
1963
|
-
else if (code === quote) quote = 0;
|
|
1964
|
-
continue;
|
|
1965
|
-
}
|
|
1966
|
-
if (code === 34 || code === 39) quote = code;
|
|
1967
|
-
else if (code === 40) depth++;
|
|
1968
|
-
else if (code === 41) depth--;
|
|
1969
|
-
else if (!depth && code <= 32) {
|
|
1970
|
-
if (index > start) parts.push(value.slice(start, index));
|
|
1971
|
-
start = index + 1;
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
return parts;
|
|
1975
|
-
}
|
|
1976
|
-
function isAsciiLetters(value) {
|
|
1977
|
-
if (!value) return false;
|
|
1978
|
-
for (var index = 0; index < value.length; index++) {
|
|
1979
|
-
var code = value.charCodeAt(index) | 32;
|
|
1980
|
-
if (code < 97 || code > 122) return false;
|
|
1981
|
-
}
|
|
1982
|
-
return true;
|
|
1290
|
+
streamWriteInline(state, property, value, cursor, originalValue);
|
|
1983
1291
|
}
|
|
1984
1292
|
function numericUnitValue(value, first, second) {
|
|
1985
1293
|
var unitLength = value.endsWith(first) || second !== void 0 && value.endsWith(second) ? first.length : 0;
|
|
@@ -1987,381 +1295,207 @@ function numericUnitValue(value, first, second) {
|
|
|
1987
1295
|
var numeric = Number(value.slice(0, value.length - unitLength));
|
|
1988
1296
|
return Number.isFinite(numeric) ? numeric : NaN;
|
|
1989
1297
|
}
|
|
1990
|
-
function
|
|
1991
|
-
var index = 0;
|
|
1992
|
-
if (value.charCodeAt(index) === 43 || value.charCodeAt(index) === 45) index++;
|
|
1993
|
-
var digits = 0;
|
|
1994
|
-
var dot = false;
|
|
1995
|
-
for (; index < value.length; index++) {
|
|
1996
|
-
var code = value.charCodeAt(index);
|
|
1997
|
-
if (code >= 48 && code <= 57) {
|
|
1998
|
-
digits++;
|
|
1999
|
-
continue;
|
|
2000
|
-
}
|
|
2001
|
-
if (code === 46 && !dot) {
|
|
2002
|
-
dot = true;
|
|
2003
|
-
continue;
|
|
2004
|
-
}
|
|
2005
|
-
break;
|
|
2006
|
-
}
|
|
2007
|
-
if (!digits) return false;
|
|
2008
|
-
for (; index < value.length; index++) {
|
|
2009
|
-
var code1 = value.charCodeAt(index);
|
|
2010
|
-
if (code1 !== 37 && (code1 < 97 || code1 > 122)) return false;
|
|
2011
|
-
}
|
|
2012
|
-
return true;
|
|
2013
|
-
}
|
|
2014
|
-
function startsValueFunction(value) {
|
|
2015
|
-
var index = 0;
|
|
2016
|
-
while (index < value.length) {
|
|
2017
|
-
var code = value.charCodeAt(index);
|
|
2018
|
-
if (code === 45 || code >= 97 && code <= 122) {
|
|
2019
|
-
index++;
|
|
2020
|
-
continue;
|
|
2021
|
-
}
|
|
2022
|
-
break;
|
|
2023
|
-
}
|
|
2024
|
-
return index > 0 && value.charCodeAt(index) === 40;
|
|
2025
|
-
}
|
|
2026
|
-
function emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly) {
|
|
1298
|
+
function emitBorder(state, property, raw, cursor, originalValue, contextOnly) {
|
|
2027
1299
|
if (property === "borderBlock" || property === "borderInline") {
|
|
2028
1300
|
if (process.env.NODE_ENV === "development") warnOnce(`RN has no logical border shorthand "${property}"; dropping it`);
|
|
2029
1301
|
return;
|
|
2030
1302
|
}
|
|
2031
|
-
var width;
|
|
2032
|
-
var style;
|
|
2033
|
-
var color;
|
|
2034
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2035
|
-
try {
|
|
2036
|
-
for (var _iterator2 = splitComponents(raw)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2037
|
-
var part3 = _step2.value;
|
|
2038
|
-
if (lineStyles.has(part3) || property === "outline" && part3 === "auto") style = part3;
|
|
2039
|
-
else if (part3 === "thin" || part3 === "medium" || part3 === "thick" || isNumericCSSComponent(part3) || startsValueFunction(part3)) width = part3;
|
|
2040
|
-
else color = part3;
|
|
2041
|
-
}
|
|
2042
|
-
} catch (err) {
|
|
2043
|
-
_didIteratorError2 = true;
|
|
2044
|
-
_iteratorError2 = err;
|
|
2045
|
-
} finally {
|
|
2046
|
-
try {
|
|
2047
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2048
|
-
} finally {
|
|
2049
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
2050
|
-
}
|
|
2051
|
-
}
|
|
1303
|
+
var { width, style, color } = classifyBorderComponents(raw, property === "outline");
|
|
2052
1304
|
if (style === "none" && width === void 0) width = "0";
|
|
2053
|
-
var targets = borderTargets[property];
|
|
2054
1305
|
if (width !== void 0) {
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
var target2 = _step12.value;
|
|
2059
|
-
emitResolved(state, target2, width, cursor, merge, originalValue, contextOnly);
|
|
2060
|
-
}
|
|
2061
|
-
} catch (err) {
|
|
2062
|
-
_didIteratorError12 = true;
|
|
2063
|
-
_iteratorError12 = err;
|
|
2064
|
-
} finally {
|
|
2065
|
-
try {
|
|
2066
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
2067
|
-
} finally {
|
|
2068
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
2069
|
-
}
|
|
2070
|
-
}
|
|
2071
|
-
}
|
|
2072
|
-
if (style !== void 0) {
|
|
2073
|
-
var styleTargets = property === "border" ? ["borderStyle"] : targets.style;
|
|
2074
|
-
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
2075
|
-
try {
|
|
2076
|
-
for (var _iterator22 = styleTargets[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
2077
|
-
var target1 = _step22.value;
|
|
2078
|
-
emitProperty(state, target1, style, cursor, merge, originalValue, contextOnly);
|
|
2079
|
-
}
|
|
2080
|
-
} catch (err) {
|
|
2081
|
-
_didIteratorError22 = true;
|
|
2082
|
-
_iteratorError22 = err;
|
|
2083
|
-
} finally {
|
|
2084
|
-
try {
|
|
2085
|
-
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
2086
|
-
} finally {
|
|
2087
|
-
if (_didIteratorError22) throw _iteratorError22;
|
|
2088
|
-
}
|
|
2089
|
-
}
|
|
1306
|
+
if (width === "thin") width = "1px";
|
|
1307
|
+
else if (width === "medium") width = "3px";
|
|
1308
|
+
else if (width === "thick") width = "5px";
|
|
2090
1309
|
}
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
var target22 = _step3.value;
|
|
2096
|
-
emitResolved(state, target22, color, cursor, merge, originalValue, contextOnly);
|
|
2097
|
-
}
|
|
2098
|
-
} catch (err) {
|
|
2099
|
-
_didIteratorError3 = true;
|
|
2100
|
-
_iteratorError3 = err;
|
|
2101
|
-
} finally {
|
|
2102
|
-
try {
|
|
2103
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) _iterator3.return();
|
|
2104
|
-
} finally {
|
|
2105
|
-
if (_didIteratorError3) throw _iteratorError3;
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
function emitTextDecoration(state, raw, cursor, merge, originalValue, contextOnly) {
|
|
2111
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
1310
|
+
var targets = borderTargets[property];
|
|
1311
|
+
var prefix = property === "outline" ? "outline" : "border";
|
|
1312
|
+
if (style !== void 0 && property === "border") emitProperty(state, "borderStyle", style, cursor, originalValue, contextOnly);
|
|
1313
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2112
1314
|
try {
|
|
2113
|
-
for (var
|
|
2114
|
-
var
|
|
2115
|
-
|
|
1315
|
+
for (var _iterator = targets[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1316
|
+
var propBase = `${prefix}${_step.value}`;
|
|
1317
|
+
if (width !== void 0) emitResolved(state, `${propBase}Width`, width, cursor, originalValue, contextOnly);
|
|
1318
|
+
if (style !== void 0 && !(property === "border")) emitProperty(state, `${propBase}Style`, style, cursor, originalValue, contextOnly);
|
|
1319
|
+
if (color !== void 0) emitResolved(state, `${propBase}Color`, color, cursor, originalValue, contextOnly);
|
|
2116
1320
|
}
|
|
2117
1321
|
} catch (err) {
|
|
2118
|
-
|
|
2119
|
-
|
|
1322
|
+
_didIteratorError = true;
|
|
1323
|
+
_iteratorError = err;
|
|
2120
1324
|
} finally {
|
|
2121
1325
|
try {
|
|
2122
|
-
if (!
|
|
1326
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
2123
1327
|
} finally {
|
|
2124
|
-
if (
|
|
1328
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2125
1329
|
}
|
|
2126
1330
|
}
|
|
2127
1331
|
}
|
|
2128
|
-
function
|
|
2129
|
-
|
|
2130
|
-
emitProperty(state, property, value, cursor, merge, originalValue, contextOnly);
|
|
2131
|
-
return;
|
|
2132
|
-
}
|
|
2133
|
-
var targets = property === "scale" ? ["--t-scale-x", "--t-scale-y"] : [property === "x" ? "--t-x" : property === "y" ? "--t-y" : property === "scaleX" ? "--t-scale-x" : property === "scaleY" ? "--t-scale-y" : "rotate"];
|
|
2134
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
1332
|
+
function emitTextDecoration(state, raw, cursor, originalValue, contextOnly) {
|
|
1333
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2135
1334
|
try {
|
|
2136
|
-
for (var
|
|
2137
|
-
var
|
|
2138
|
-
|
|
2139
|
-
if (typeof targetValue === "number") {
|
|
2140
|
-
if (target2 === "--t-x" || target2 === "--t-y") targetValue = `${targetValue}px`;
|
|
2141
|
-
else if (target2 === "rotate") targetValue = `${targetValue}deg`;
|
|
2142
|
-
}
|
|
2143
|
-
emitProperty(state, target2, targetValue, cursor, merge, originalValue, contextOnly);
|
|
2144
|
-
if (target2 === "--t-x" || target2 === "--t-y") addComposition(state, "translate");
|
|
2145
|
-
else if (target2.startsWith("--t-scale")) addComposition(state, "scale");
|
|
1335
|
+
for (var _iterator = splitComponents(raw)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1336
|
+
var part = _step.value;
|
|
1337
|
+
emitResolved(state, part === "solid" || part === "double" || part === "dotted" || part === "dashed" || part === "wavy" ? "textDecorationStyle" : part === "underline" || part === "overline" || part === "line-through" || part === "none" ? "textDecorationLine" : "textDecorationColor", part, cursor, originalValue, contextOnly);
|
|
2146
1338
|
}
|
|
2147
1339
|
} catch (err) {
|
|
2148
|
-
|
|
2149
|
-
|
|
1340
|
+
_didIteratorError = true;
|
|
1341
|
+
_iteratorError = err;
|
|
2150
1342
|
} finally {
|
|
2151
1343
|
try {
|
|
2152
|
-
if (!
|
|
1344
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
2153
1345
|
} finally {
|
|
2154
|
-
if (
|
|
1346
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2155
1347
|
}
|
|
2156
1348
|
}
|
|
2157
1349
|
}
|
|
2158
|
-
function emitResolved(state, property, raw, cursor,
|
|
2159
|
-
var value = configuredValue(state, property, raw);
|
|
2160
|
-
if (value === raw) value = resolveEmbeddedTokens(state, property, raw);
|
|
1350
|
+
function emitResolved(state, property, raw, cursor, originalValue, contextOnly) {
|
|
1351
|
+
var value = configuredValue(state, property, raw, true);
|
|
2161
1352
|
if (typeof value === "string") {
|
|
2162
1353
|
var unitValue = numericUnitValue(value, "px", "dp");
|
|
2163
1354
|
if (Number.isFinite(unitValue)) value = unitValue;
|
|
2164
1355
|
else if (value !== "" && Number.isFinite(Number(value))) value = Number(value);
|
|
2165
1356
|
}
|
|
2166
|
-
emitProperty(state, property, value, cursor,
|
|
1357
|
+
emitProperty(state, property, value, cursor, originalValue, contextOnly);
|
|
2167
1358
|
}
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
var emitKindWebShadow = 3;
|
|
2171
|
-
var emitKindWebTextShadow = 4;
|
|
2172
|
-
var emitKindTransform = 5;
|
|
2173
|
-
var emitKindBorder = 6;
|
|
2174
|
-
var emitKindTextDecoration = 7;
|
|
2175
|
-
var emitKindBackground = 8;
|
|
2176
|
-
var emitKindAxis = 9;
|
|
2177
|
-
var emitKindBorderRadius = 10;
|
|
2178
|
-
var emitKindBorderWidth = 11;
|
|
2179
|
-
var emitValueKinds = {
|
|
2180
|
-
transition: emitKindTransition,
|
|
2181
|
-
transitionProperty: emitKindTransition,
|
|
2182
|
-
transform: emitKindTransform,
|
|
2183
|
-
textDecoration: emitKindTextDecoration,
|
|
2184
|
-
background: emitKindBackground,
|
|
2185
|
-
x: emitKindAxis,
|
|
2186
|
-
y: emitKindAxis,
|
|
2187
|
-
scale: emitKindAxis,
|
|
2188
|
-
scaleX: emitKindAxis,
|
|
2189
|
-
scaleY: emitKindAxis,
|
|
2190
|
-
rotate: emitKindAxis,
|
|
2191
|
-
borderRadius: emitKindBorderRadius,
|
|
2192
|
-
borderWidth: emitKindBorderWidth,
|
|
2193
|
-
borderTopWidth: emitKindBorderWidth,
|
|
2194
|
-
borderRightWidth: emitKindBorderWidth,
|
|
2195
|
-
borderBottomWidth: emitKindBorderWidth,
|
|
2196
|
-
borderLeftWidth: emitKindBorderWidth
|
|
2197
|
-
};
|
|
2198
|
-
var _iteratorNormalCompletion = true;
|
|
2199
|
-
var _didIteratorError = false;
|
|
2200
|
-
var _iteratorError = void 0;
|
|
2201
|
-
try {
|
|
2202
|
-
for (var _iterator = legacyTransformParts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
2203
|
-
var part = _step.value;
|
|
2204
|
-
emitValueKinds[part] = emitKindTransformPart;
|
|
2205
|
-
}
|
|
2206
|
-
} catch (err) {
|
|
2207
|
-
_didIteratorError = true;
|
|
2208
|
-
_iteratorError = err;
|
|
2209
|
-
} finally {
|
|
2210
|
-
try {
|
|
2211
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
2212
|
-
} finally {
|
|
2213
|
-
if (_didIteratorError) throw _iteratorError;
|
|
2214
|
-
}
|
|
1359
|
+
function shadowUnit(part) {
|
|
1360
|
+
return typeof part === "number" ? `${part}px` : part || "0px";
|
|
2215
1361
|
}
|
|
2216
|
-
|
|
2217
|
-
var
|
|
2218
|
-
var
|
|
2219
|
-
var _iteratorError1 = void 0;
|
|
2220
|
-
try {
|
|
2221
|
-
for (var _iterator1 = webTextShadowParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
2222
|
-
var part2 = _step1.value;
|
|
2223
|
-
emitValueKinds[part2] = emitKindWebTextShadow;
|
|
2224
|
-
}
|
|
2225
|
-
} catch (err) {
|
|
2226
|
-
_didIteratorError1 = true;
|
|
2227
|
-
_iteratorError1 = err;
|
|
2228
|
-
} finally {
|
|
2229
|
-
try {
|
|
2230
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
2231
|
-
} finally {
|
|
2232
|
-
if (_didIteratorError1) throw _iteratorError1;
|
|
2233
|
-
}
|
|
2234
|
-
}
|
|
2235
|
-
for (var target in borderTargets) emitValueKinds[target] = emitKindBorder;
|
|
2236
|
-
function shadowUnit(part3) {
|
|
2237
|
-
return typeof part3 === "number" ? `${part3}px` : part3 || "0px";
|
|
2238
|
-
}
|
|
2239
|
-
function emitValue(state, property, raw, cursor, merge, originalValue, contextOnly) {
|
|
2240
|
-
var condition = cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1362
|
+
function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
1363
|
+
var condition = cursor ? cursor[conditionValue] : 0;
|
|
1364
|
+
var grammar = getConfigRevisionState(state.conf);
|
|
2241
1365
|
if (isVariable(raw)) raw = resolveVariableValue(property, raw, state.styleProps.resolveValues);
|
|
2242
|
-
|
|
2243
|
-
if (
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
case emitKindWebTextShadow: break;
|
|
2261
|
-
case emitKindTransform:
|
|
2262
|
-
if (canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = transformsToString(raw);
|
|
2263
|
-
if (typeof raw === "string") {
|
|
2264
|
-
var transform = parseNativeTransform(raw);
|
|
2265
|
-
if (transform) {
|
|
2266
|
-
emitProperty(state, property, transform, cursor, merge, originalValue, contextOnly);
|
|
2267
|
-
return;
|
|
2268
|
-
}
|
|
2269
|
-
}
|
|
2270
|
-
break;
|
|
2271
|
-
case emitKindBorder:
|
|
2272
|
-
if (typeof raw === "string") {
|
|
2273
|
-
emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly);
|
|
2274
|
-
return;
|
|
2275
|
-
}
|
|
2276
|
-
break;
|
|
2277
|
-
case emitKindTextDecoration:
|
|
2278
|
-
if (typeof raw === "string") {
|
|
2279
|
-
emitTextDecoration(state, raw, cursor, merge, originalValue, contextOnly);
|
|
1366
|
+
if (typeof raw === "string" && (property === "transition" || property === "transitionProperty")) raw = grammar.normalizeTransition(raw);
|
|
1367
|
+
if ((property === "borderWidth" || property === "borderTopWidth" || property === "borderRightWidth" || property === "borderBottomWidth" || property === "borderLeftWidth") && state.styleProps.noNormalize !== false) writeStyleRecord(state, "borderStyle", "solid", cursor, originalValue, recordDefault);
|
|
1368
|
+
if (grammar.propertyKind(property) === 5) {
|
|
1369
|
+
var value = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
1370
|
+
if (canGenerateCSS && state.flatShouldDoClasses && !condition) {
|
|
1371
|
+
var _state;
|
|
1372
|
+
(_state = state).transformAccumulator || (_state.transformAccumulator = createTransformAccumulator());
|
|
1373
|
+
addTransformValue(state.transformAccumulator, property, value);
|
|
1374
|
+
} else if (condition && canGenerateCSS && state.flatShouldDoClasses) emitProperty(state, "transform", `${property}(${value})`, cursor, originalValue, contextOnly);
|
|
1375
|
+
else streamWriteInline(state, property, value, cursor, originalValue, true);
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1378
|
+
if (property === "transform") {
|
|
1379
|
+
if (canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = transformsToString(raw);
|
|
1380
|
+
if (typeof raw === "string") {
|
|
1381
|
+
var transform = parseNativeTransform(raw);
|
|
1382
|
+
if (transform) {
|
|
1383
|
+
emitProperty(state, property, transform, cursor, originalValue, contextOnly);
|
|
2280
1384
|
return;
|
|
2281
1385
|
}
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
if (typeof raw === "string" && borderTargets[property]) {
|
|
1389
|
+
emitBorder(state, property, raw, cursor, originalValue, contextOnly);
|
|
1390
|
+
return;
|
|
1391
|
+
}
|
|
1392
|
+
if (typeof raw === "string" && property === "textDecoration") {
|
|
1393
|
+
emitTextDecoration(state, raw, cursor, originalValue, contextOnly);
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
if (typeof raw === "string" && property === "background") {
|
|
1397
|
+
var parts = splitComponents(raw);
|
|
1398
|
+
if (parts.length === 1 && !startsValueFunction(parts[0])) {
|
|
1399
|
+
emitResolved(state, "backgroundColor", parts[0], cursor, originalValue, contextOnly);
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (process.env.NODE_ENV === "development") warnOnce(`native background cannot represent "${raw}"; dropping it`);
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
if (property === "x" || property === "y" || property === "scale" || property === "scaleX" || property === "scaleY" || property === "rotate") {
|
|
1406
|
+
var value2 = typeof raw === "string" ? configuredValue(state, property, raw) : raw;
|
|
1407
|
+
if (typeof value2 === "string" && !value2.startsWith(THEME_REF_PREFIX)) {
|
|
1408
|
+
if (property === "rotate" && !Number.isFinite(numericUnitValue(value2, "deg", "rad"))) {
|
|
1409
|
+
if (process.env.NODE_ENV === "development") warnOnce(`native transform "${property}" cannot represent "${value2}"; dropping it`);
|
|
1410
|
+
if (condition & 1) {
|
|
1411
|
+
removeTransformValue(state.transformAccumulator, property);
|
|
1412
|
+
writeStyleRecord(state, property, void 0, cursor, void 0, recordRetract);
|
|
2289
1413
|
}
|
|
2290
|
-
if (process.env.NODE_ENV === "development") warnOnce(`native background cannot represent "${raw}"; dropping it`);
|
|
2291
1414
|
return;
|
|
2292
1415
|
}
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
1416
|
+
var unitValue = numericUnitValue(value2, "px", "dp");
|
|
1417
|
+
if (Number.isFinite(unitValue)) value2 = unitValue;
|
|
1418
|
+
else if (Number.isFinite(Number(value2))) value2 = Number(value2);
|
|
1419
|
+
}
|
|
1420
|
+
if (!canGenerateCSS || !state.flatShouldDoClasses) {
|
|
1421
|
+
emitProperty(state, property, value2, cursor, originalValue, contextOnly);
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1424
|
+
var targets = property === "scale" ? ["--t-scale-x", "--t-scale-y"] : [property === "x" ? "--t-x" : property === "y" ? "--t-y" : property === "scaleX" ? "--t-scale-x" : property === "scaleY" ? "--t-scale-y" : "rotate"];
|
|
1425
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1426
|
+
try {
|
|
1427
|
+
for (var _iterator = targets[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1428
|
+
var target1 = _step.value;
|
|
1429
|
+
var targetValue = value2;
|
|
1430
|
+
if (typeof targetValue === "number") {
|
|
1431
|
+
if (target1 === "--t-x" || target1 === "--t-y") targetValue = `${targetValue}px`;
|
|
1432
|
+
else if (target1 === "rotate") targetValue = `${targetValue}deg`;
|
|
2304
1433
|
}
|
|
2305
|
-
|
|
2306
|
-
if (
|
|
2307
|
-
else if (
|
|
1434
|
+
emitProperty(state, target1, targetValue, cursor, originalValue, contextOnly);
|
|
1435
|
+
if (target1 === "--t-x" || target1 === "--t-y") addComposition(state, "translate");
|
|
1436
|
+
else if (target1.startsWith("--t-scale")) addComposition(state, "scale");
|
|
2308
1437
|
}
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
1438
|
+
} catch (err) {
|
|
1439
|
+
_didIteratorError = true;
|
|
1440
|
+
_iteratorError = err;
|
|
1441
|
+
} finally {
|
|
1442
|
+
try {
|
|
1443
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1444
|
+
} finally {
|
|
1445
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
return;
|
|
2317
1449
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
1450
|
+
var value3 = raw;
|
|
1451
|
+
if (typeof raw === "string") value3 = configuredValue(state, property, raw, true);
|
|
1452
|
+
if (typeof value3 === "string") {
|
|
1453
|
+
var unitValue1 = numericUnitValue(value3, "px", "dp");
|
|
1454
|
+
if (Number.isFinite(unitValue1)) value3 = unitValue1;
|
|
1455
|
+
else if (value3 !== "" && Number.isFinite(Number(value3))) value3 = Number(value3);
|
|
2322
1456
|
}
|
|
2323
1457
|
if (canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
|
|
2324
|
-
state.flatBoxShadow =
|
|
1458
|
+
state.flatBoxShadow = value3;
|
|
2325
1459
|
state.flatBoxShadowSequence = frameSequence + 1;
|
|
2326
1460
|
}
|
|
2327
|
-
if (typeof
|
|
2328
|
-
var parsed = parseNativeStyle(property,
|
|
1461
|
+
if (typeof value3 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
|
|
1462
|
+
var parsed = parseNativeStyle(property, value3);
|
|
2329
1463
|
if (parsed) {
|
|
2330
1464
|
if (property === "textShadow") {
|
|
2331
|
-
var
|
|
1465
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
2332
1466
|
try {
|
|
2333
|
-
for (var
|
|
2334
|
-
var [key, parsedValue] =
|
|
2335
|
-
emitProperty(state, key, parsedValue, cursor,
|
|
1467
|
+
for (var _iterator1 = parsed[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
1468
|
+
var [key, parsedValue] = _step1.value;
|
|
1469
|
+
emitProperty(state, key, parsedValue, cursor, originalValue, contextOnly);
|
|
2336
1470
|
}
|
|
2337
1471
|
} catch (err) {
|
|
2338
|
-
|
|
2339
|
-
|
|
1472
|
+
_didIteratorError1 = true;
|
|
1473
|
+
_iteratorError1 = err;
|
|
2340
1474
|
} finally {
|
|
2341
1475
|
try {
|
|
2342
|
-
if (!
|
|
1476
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
2343
1477
|
} finally {
|
|
2344
|
-
if (
|
|
1478
|
+
if (_didIteratorError1) throw _iteratorError1;
|
|
2345
1479
|
}
|
|
2346
1480
|
}
|
|
2347
|
-
} else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, cursor,
|
|
1481
|
+
} else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, cursor, originalValue, contextOnly);
|
|
2348
1482
|
return;
|
|
2349
1483
|
}
|
|
2350
1484
|
}
|
|
2351
|
-
if (property === "fontVariant" && typeof
|
|
1485
|
+
if (property === "fontVariant" && typeof value3 === "string") {
|
|
2352
1486
|
var variants = [];
|
|
2353
1487
|
var start = 0;
|
|
2354
|
-
for (var index = 0; index <=
|
|
2355
|
-
var code = index ===
|
|
1488
|
+
for (var index = 0; index <= value3.length; index++) {
|
|
1489
|
+
var code = index === value3.length ? 32 : value3.charCodeAt(index);
|
|
2356
1490
|
if (code !== 44 && code > 32) continue;
|
|
2357
|
-
if (start < index) variants.push(
|
|
1491
|
+
if (start < index) variants.push(value3.slice(start, index));
|
|
2358
1492
|
start = index + 1;
|
|
2359
1493
|
}
|
|
2360
|
-
|
|
1494
|
+
value3 = variants;
|
|
2361
1495
|
}
|
|
2362
|
-
var expanded = state.styleProps.noExpand ?
|
|
1496
|
+
var expanded = !state.styleProps.noExpand ? expandStyle(property, value3, state.conf.settings.styleCompat || "web") : null;
|
|
2363
1497
|
if (!expanded) {
|
|
2364
|
-
emitProperty(state, property,
|
|
1498
|
+
emitProperty(state, property, value3, cursor, originalValue, contextOnly);
|
|
2365
1499
|
return;
|
|
2366
1500
|
}
|
|
2367
1501
|
if (typeof raw === "string" && expanded.length > 1) {
|
|
@@ -2369,587 +1503,183 @@ function emitValue(state, property, raw, cursor, merge, originalValue, contextOn
|
|
|
2369
1503
|
if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
2370
1504
|
for (var index1 = 0; index1 < expanded.length; index1++) {
|
|
2371
1505
|
var partIndex = index1 === 0 || parts1.length === 1 ? 0 : index1 === 1 || index1 === 3 && parts1.length < 4 ? 1 : index1 === 2 && parts1.length < 3 ? 0 : index1;
|
|
2372
|
-
emitResolved(state, expanded[index1][0], parts1[partIndex], cursor,
|
|
1506
|
+
emitResolved(state, expanded[index1][0], parts1[partIndex], cursor, originalValue, contextOnly);
|
|
2373
1507
|
}
|
|
2374
1508
|
return;
|
|
2375
1509
|
}
|
|
2376
1510
|
}
|
|
2377
|
-
for (var index2 = 0; index2 < expanded.length; index2++) emitProperty(state, expanded[index2][0], expanded[index2][1], cursor,
|
|
2378
|
-
}
|
|
2379
|
-
function contributeStyleString(state, property, source, merge, originalValue) {
|
|
2380
|
-
var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
|
|
2381
|
-
var directState = state;
|
|
2382
|
-
var watermark = conditionCursorTop;
|
|
2383
|
-
var previousCursor = directState.flatScanCursor;
|
|
2384
|
-
var previousExpectMulti = directState.flatExpectMulti;
|
|
2385
|
-
directState.flatScanCursor = null;
|
|
2386
|
-
directState.flatExpectMulti = source.indexOf(":") !== -1;
|
|
2387
|
-
try {
|
|
2388
|
-
scanFlatValue(source, directStyleHandler, state, property, merge, originalValue, contextOnly);
|
|
2389
|
-
} finally {
|
|
2390
|
-
directState.flatScanCursor = previousCursor;
|
|
2391
|
-
directState.flatExpectMulti = previousExpectMulti;
|
|
2392
|
-
releaseConditionCursors(watermark);
|
|
2393
|
-
}
|
|
2394
|
-
return true;
|
|
1511
|
+
for (var index2 = 0; index2 < expanded.length; index2++) emitProperty(state, expanded[index2][0], expanded[index2][1], cursor, originalValue, contextOnly);
|
|
2395
1512
|
}
|
|
2396
|
-
function
|
|
2397
|
-
var
|
|
2398
|
-
var
|
|
2399
|
-
outerState.flatExpectMulti = true;
|
|
2400
|
-
try {
|
|
2401
|
-
return contributeStyleObjectInner(state, property, value, merge, contextOnly);
|
|
2402
|
-
} finally {
|
|
2403
|
-
outerState.flatExpectMulti = previousExpectMulti;
|
|
2404
|
-
}
|
|
2405
|
-
}
|
|
2406
|
-
function contributeStyleObjectInner(state, property, value, merge, contextOnly) {
|
|
2407
|
-
var _directState_flatPass;
|
|
2408
|
-
var directState = state;
|
|
2409
|
-
var parent = ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
|
|
2410
|
-
var hasDefault = Object.prototype.hasOwnProperty.call(value, "default");
|
|
1513
|
+
function walkConditionalValue(state, property, value, parent, sink) {
|
|
1514
|
+
var warnMode = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 0;
|
|
1515
|
+
var parentCondition = parent || null;
|
|
2411
1516
|
var hasBase = false;
|
|
2412
|
-
var base = hasDefault ? value.default : void 0;
|
|
2413
|
-
if (base != null) {
|
|
2414
|
-
var baseString = String(base);
|
|
2415
|
-
feedCompoundSegment(directState, baseString, 0, baseString.length, true, true, "");
|
|
2416
|
-
emitAtParentCondition(state, property, base, merge, base, contextOnly);
|
|
2417
|
-
hasBase = true;
|
|
2418
|
-
}
|
|
2419
1517
|
var conditions = 0;
|
|
2420
|
-
var
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
var
|
|
2424
|
-
var
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
if (
|
|
2431
|
-
|
|
2432
|
-
|
|
1518
|
+
var lastPayload = "";
|
|
1519
|
+
if (typeof value === "string") {
|
|
1520
|
+
var parsed = getConfigRevisionState(state.conf).parseFlatValue(value);
|
|
1521
|
+
var [segments, failure, failureIndex] = parsed;
|
|
1522
|
+
var slices = parsedSlices.get(parsed);
|
|
1523
|
+
if (slices === void 0) parsedSlices.set(parsed, slices = []);
|
|
1524
|
+
var chainCount = segments.length / 5 - 1;
|
|
1525
|
+
if (property === "aspectRatio" && chainCount === 1) {
|
|
1526
|
+
var left = Number(value.slice(segments[7], segments[8]));
|
|
1527
|
+
var right = Number(value.slice(segments[5], segments[6]));
|
|
1528
|
+
if (left > 0 && right > 0 && Number.isFinite(left) && Number.isFinite(right)) return false;
|
|
1529
|
+
}
|
|
1530
|
+
for (var index = 0; index < segments.length; index += 5) {
|
|
1531
|
+
var start = segments[index];
|
|
1532
|
+
var end = segments[index + 1];
|
|
1533
|
+
var flags = segments[index + 4];
|
|
1534
|
+
if (!(flags & 1)) continue;
|
|
1535
|
+
if (start === end) continue;
|
|
1536
|
+
if (flags & 2) {
|
|
1537
|
+
var _slices, _index;
|
|
1538
|
+
var _;
|
|
1539
|
+
var payload = (_ = (_slices = slices)[_index = index]) !== null && _ !== void 0 ? _ : _slices[_index] = value.slice(start, end);
|
|
1540
|
+
sink(payload, parentCondition, payload);
|
|
1541
|
+
hasBase = true;
|
|
1542
|
+
} else if (process.env.NODE_ENV !== "production" && warnMode && !chainCount && (failure === "invalid-character" || failure === "stray-comment-close")) {
|
|
1543
|
+
sink(value, parentCondition, value);
|
|
1544
|
+
hasBase = true;
|
|
1545
|
+
} else if (warnMode) warnScanFailure(property, value, failure, failureIndex);
|
|
1546
|
+
}
|
|
1547
|
+
var lastPayloadStart = 0;
|
|
1548
|
+
for (var index1 = 0; index1 < segments.length; index1 += 5) {
|
|
1549
|
+
var _slices1, _ref;
|
|
1550
|
+
var start1 = segments[index1];
|
|
1551
|
+
var end1 = segments[index1 + 1];
|
|
1552
|
+
var flags1 = segments[index1 + 4];
|
|
1553
|
+
if (flags1 & 1) continue;
|
|
1554
|
+
if (!(flags1 & 4) || !(flags1 & 2)) {
|
|
1555
|
+
if (warnMode) warnScanFailure(property, value, failure, failureIndex);
|
|
1556
|
+
continue;
|
|
2433
1557
|
}
|
|
1558
|
+
lastPayloadStart = start1;
|
|
1559
|
+
if (start1 === end1) {
|
|
1560
|
+
if (warnMode && process.env.NODE_ENV === "development") warnRefusedValue(property, value, "a conditional clause has no value");
|
|
1561
|
+
continue;
|
|
1562
|
+
}
|
|
1563
|
+
var _1;
|
|
1564
|
+
var cursor = conditionFromKey(state, (_1 = (_slices1 = slices)[_ref = index1 + 2]) !== null && _1 !== void 0 ? _1 : _slices1[_ref] = value.slice(segments[index1 + 2], segments[index1 + 3]), parentCondition);
|
|
1565
|
+
conditions |= cursor[conditionValue];
|
|
1566
|
+
if (cursor[conditionValue] & conditionResolvedFlag || warnMode) {
|
|
1567
|
+
var _slices2, _index1;
|
|
1568
|
+
var _2;
|
|
1569
|
+
sink((_2 = (_slices2 = slices)[_index1 = index1]) !== null && _2 !== void 0 ? _2 : _slices2[_index1] = value.slice(start1, end1), cursor, value);
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
if (process.env.NODE_ENV !== "production") lastPayload = value.slice(lastPayloadStart);
|
|
1573
|
+
} else {
|
|
1574
|
+
if (!value || (typeof value === "undefined" ? "undefined" : _type_of(value)) !== "object" || Array.isArray(value) || isVariable(value) || !classifyConditionalObject(value, state)) return false;
|
|
1575
|
+
if (value.default != null) {
|
|
1576
|
+
sink(value.default, parentCondition, value.default);
|
|
1577
|
+
hasBase = true;
|
|
2434
1578
|
}
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
1579
|
+
for (var key in value) {
|
|
1580
|
+
if (key === "default" || value[key] == null) continue;
|
|
1581
|
+
var cursor1 = conditionFromKey(state, key, parentCondition);
|
|
1582
|
+
conditions |= cursor1[conditionValue];
|
|
1583
|
+
if (cursor1[conditionValue] & conditionResolvedFlag || warnMode) sink(value[key], cursor1, value[key]);
|
|
2440
1584
|
}
|
|
2441
|
-
releaseConditionCursors(watermark);
|
|
2442
1585
|
}
|
|
2443
|
-
if (!
|
|
2444
|
-
if ((!canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
|
|
2445
|
-
var
|
|
2446
|
-
|
|
1586
|
+
if (warnMode && process.env.NODE_ENV === "development" && typeof value === "string" && !hasBase && conditions && getConfigRevisionState(state.conf).tokenCategory(property) && splitComponents(lastPayload).length > 1) warnOnce(`${property}="${value}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1587
|
+
if (warnMode === 1 && (!canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
|
|
1588
|
+
var _state_flatPropertyLayers;
|
|
1589
|
+
var resting = property === "opacity" || property.startsWith("scale") ? 1 : property === "rotate" ? "0deg" : property === "x" || property === "y" ? 0 : null;
|
|
1590
|
+
if (resting !== null && !((_state_flatPropertyLayers = state.flatPropertyLayers) === null || _state_flatPropertyLayers === void 0 ? void 0 : _state_flatPropertyLayers.has(property))) sink(resting, parentCondition, resting);
|
|
2447
1591
|
}
|
|
2448
1592
|
return true;
|
|
2449
1593
|
}
|
|
2450
|
-
function contributeValue(state, property, value,
|
|
2451
|
-
var contextOnly = arguments.length >
|
|
2452
|
-
|
|
2453
|
-
if (value.hasBase) contributeValue(state, property, value.base, merge, value.base, contextOnly);
|
|
2454
|
-
for (var offset = 0; offset < value.entries.length;) {
|
|
2455
|
-
var entryValue = value.entries[offset];
|
|
2456
|
-
var watermark = conditionCursorTop;
|
|
2457
|
-
try {
|
|
2458
|
-
var _state_flatPass;
|
|
2459
|
-
emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value.entries, offset, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null), merge, entryValue, contextOnly, 2, entryValue);
|
|
2460
|
-
} finally {
|
|
2461
|
-
releaseConditionCursors(watermark);
|
|
2462
|
-
}
|
|
2463
|
-
offset += transportEntryWidth;
|
|
2464
|
-
}
|
|
2465
|
-
return true;
|
|
2466
|
-
}
|
|
1594
|
+
function contributeValue(state, property, value, originalValue) {
|
|
1595
|
+
var contextOnly = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, condition = arguments.length > 5 ? arguments[5] : void 0;
|
|
1596
|
+
var _state_flatPass;
|
|
2467
1597
|
if (condition !== void 0) {
|
|
2468
1598
|
var _directState_flatPass;
|
|
2469
1599
|
var parent = ((_directState_flatPass = state.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
|
|
2470
|
-
var
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
if (isObjectValue && classifyConditionalObject(value, state, void 0, firstChild || void 0)) {
|
|
2488
|
-
var useFirstChild = firstChild !== null;
|
|
2489
|
-
for (var key in value) {
|
|
2490
|
-
var payload = value[key];
|
|
2491
|
-
if (payload == null) continue;
|
|
2492
|
-
if (key === "default") emitUnderCondition(state, property, payload, effective, merge, payload, contextOnly, 2, payload);
|
|
2493
|
-
else {
|
|
2494
|
-
var keyWatermark = conditionCursorTop;
|
|
2495
|
-
var child = useFirstChild ? firstChild : acquireConditionCursor(effective);
|
|
2496
|
-
if (useFirstChild) useFirstChild = false;
|
|
2497
|
-
else {
|
|
2498
|
-
resolveConditionText(state, child, key);
|
|
2499
|
-
commitConditionCursor(state, child);
|
|
2500
|
-
}
|
|
2501
|
-
emitUnderCondition(state, property, payload, child, merge, payload, contextOnly, 2, payload);
|
|
2502
|
-
if (child !== firstChild) releaseConditionCursors(keyWatermark);
|
|
2503
|
-
}
|
|
2504
|
-
}
|
|
2505
|
-
return true;
|
|
2506
|
-
}
|
|
2507
|
-
emitUnderCondition(state, property, value, effective, merge, originalValue, contextOnly, 2, value);
|
|
2508
|
-
return true;
|
|
2509
|
-
} finally {
|
|
2510
|
-
releaseConditionCursors(watermark1);
|
|
2511
|
-
}
|
|
1600
|
+
var effective;
|
|
1601
|
+
if (typeof condition === "string") effective = conditionFromKey(state, condition, parent);
|
|
1602
|
+
else if (parent) {
|
|
1603
|
+
effective = conditionFromKey(state, condition[conditionKey], parent);
|
|
1604
|
+
if (!(condition[conditionValue] & conditionResolvedFlag)) setConditionUnresolved(effective);
|
|
1605
|
+
commitCondition(effective);
|
|
1606
|
+
} else effective = condition;
|
|
1607
|
+
if (typeof value !== "string" && walkConditionalValue(state, property, value, effective, function(payload, cursor, source) {
|
|
1608
|
+
return emitUnderCondition(state, property, payload, cursor, payload, contextOnly, 2, source);
|
|
1609
|
+
}, 2)) return true;
|
|
1610
|
+
emitUnderCondition(state, property, value, effective, originalValue, contextOnly, 2, value);
|
|
1611
|
+
return true;
|
|
1612
|
+
}
|
|
1613
|
+
var compositeKind = 0;
|
|
1614
|
+
if (compositeKind > 0 && compositeKind < 6 && (typeof value === "string" && value.indexOf(":") !== -1 || value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value) && classifyConditionalObject(value, state))) {
|
|
1615
|
+
if (process.env.NODE_ENV === "development") warnOnce(`conditional "${property}" needs its composite property; dropping it`);
|
|
1616
|
+
return true;
|
|
2512
1617
|
}
|
|
2513
|
-
if (value === "safe"
|
|
2514
|
-
var expanded =
|
|
1618
|
+
if (value === "safe") {
|
|
1619
|
+
var expanded = getConfigRevisionState(state.conf).expandSafeArea(property);
|
|
2515
1620
|
if (expanded) {
|
|
2516
1621
|
state.flatUsesSafeArea = true;
|
|
2517
|
-
var
|
|
1622
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2518
1623
|
try {
|
|
2519
|
-
for (var
|
|
2520
|
-
var [
|
|
2521
|
-
emitAtParentCondition(state,
|
|
1624
|
+
for (var _iterator = expanded[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1625
|
+
var [key, resolved] = _step.value;
|
|
1626
|
+
emitAtParentCondition(state, key, resolved, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
2522
1627
|
}
|
|
2523
1628
|
} catch (err) {
|
|
2524
|
-
|
|
2525
|
-
|
|
1629
|
+
_didIteratorError = true;
|
|
1630
|
+
_iteratorError = err;
|
|
2526
1631
|
} finally {
|
|
2527
1632
|
try {
|
|
2528
|
-
if (!
|
|
1633
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
2529
1634
|
} finally {
|
|
2530
|
-
if (
|
|
1635
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2531
1636
|
}
|
|
2532
1637
|
}
|
|
2533
1638
|
return true;
|
|
2534
1639
|
}
|
|
2535
1640
|
}
|
|
2536
|
-
if (
|
|
2537
|
-
|
|
1641
|
+
if (walkConditionalValue(state, property, value, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null, function(payload, cursor, source) {
|
|
1642
|
+
return cursor ? emitUnderCondition(state, property, payload, cursor, void 0, contextOnly, 1, source) : emitValue(state, property, payload, null, payload, contextOnly);
|
|
1643
|
+
}, 1)) return true;
|
|
2538
1644
|
if (value != null) {
|
|
2539
|
-
emitAtParentCondition(state, property, value,
|
|
1645
|
+
emitAtParentCondition(state, property, value, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
2540
1646
|
return true;
|
|
2541
1647
|
}
|
|
2542
1648
|
return false;
|
|
2543
1649
|
}
|
|
2544
1650
|
function clearDirectStyle(state, property) {
|
|
1651
|
+
var _direct_flatAtomics;
|
|
2545
1652
|
var direct = state;
|
|
2546
|
-
var
|
|
2547
|
-
|
|
2548
|
-
var
|
|
2549
|
-
|
|
2550
|
-
if (
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
var
|
|
2555
|
-
function isConditionTransport(value) {
|
|
2556
|
-
return (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null && conditionTransports.has(value);
|
|
2557
|
-
}
|
|
2558
|
-
var transportEntryWidth = 2;
|
|
2559
|
-
function appendConditionEntry(entries, cursor, value) {
|
|
2560
|
-
entries.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
2561
|
-
}
|
|
2562
|
-
function acquireTransportCursor(state, entries, offset, parent) {
|
|
2563
|
-
var cursor = acquireConditionCursor(parent);
|
|
2564
|
-
var key = entries[offset + 1];
|
|
2565
|
-
if (key) resolveConditionText(state, cursor, key);
|
|
2566
|
-
commitConditionCursor(state, cursor);
|
|
2567
|
-
return cursor;
|
|
2568
|
-
}
|
|
2569
|
-
function mergeConditionTransport(state, prev, cursor, value) {
|
|
2570
|
-
var transport;
|
|
2571
|
-
if (isConditionTransport(prev)) transport = prev;
|
|
2572
|
-
else {
|
|
2573
|
-
transport = {
|
|
2574
|
-
hasBase: false,
|
|
2575
|
-
base: void 0,
|
|
2576
|
-
entries: []
|
|
2577
|
-
};
|
|
2578
|
-
conditionTransports.add(transport);
|
|
2579
|
-
if (prev != null) {
|
|
2580
|
-
var isObjectValue = (typeof prev === "undefined" ? "undefined" : _type_of(prev)) === "object" && !Array.isArray(prev) && !isVariable(prev);
|
|
2581
|
-
var objectHasDefault = isObjectValue && Object.prototype.hasOwnProperty.call(prev, "default");
|
|
2582
|
-
var authoredWatermark = conditionCursorTop;
|
|
2583
|
-
try {
|
|
2584
|
-
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
2585
|
-
if (isObjectValue && classifyConditionalObject(prev, state, void 0, firstCursor || void 0)) {
|
|
2586
|
-
var useFirstCursor = firstCursor !== null;
|
|
2587
|
-
for (var key in prev) {
|
|
2588
|
-
var payload = prev[key];
|
|
2589
|
-
if (payload == null) continue;
|
|
2590
|
-
if (key === "default") {
|
|
2591
|
-
transport.hasBase = true;
|
|
2592
|
-
transport.base = payload;
|
|
2593
|
-
continue;
|
|
2594
|
-
}
|
|
2595
|
-
var watermark = conditionCursorTop;
|
|
2596
|
-
var keyCursor = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2597
|
-
if (useFirstCursor) useFirstCursor = false;
|
|
2598
|
-
else {
|
|
2599
|
-
resolveConditionText(state, keyCursor, key);
|
|
2600
|
-
commitConditionCursor(state, keyCursor);
|
|
2601
|
-
}
|
|
2602
|
-
appendConditionEntry(transport.entries, keyCursor, payload);
|
|
2603
|
-
if (keyCursor !== firstCursor) releaseConditionCursors(watermark);
|
|
2604
|
-
}
|
|
2605
|
-
} else {
|
|
2606
|
-
transport.hasBase = true;
|
|
2607
|
-
transport.base = prev;
|
|
2608
|
-
}
|
|
2609
|
-
} finally {
|
|
2610
|
-
releaseConditionCursors(authoredWatermark);
|
|
1653
|
+
var propertyKind = getConfigRevisionState(state.conf).propertyKind(property);
|
|
1654
|
+
var atomicKey = property.startsWith("transition") ? "transition" : propertyKind > 0 && propertyKind < 5 ? "boxShadow" : propertyKind === 6 ? "textShadow" : propertyKind === 5 ? "transform" : property;
|
|
1655
|
+
var slot = atomicKey;
|
|
1656
|
+
(_direct_flatAtomics = direct.flatAtomics) === null || _direct_flatAtomics === void 0 || _direct_flatAtomics.delete(slot);
|
|
1657
|
+
if (direct.flatSlots) {
|
|
1658
|
+
if (slot !== atomicKey) {
|
|
1659
|
+
var entries = direct.flatSlots.get(slot);
|
|
1660
|
+
if (entries) {
|
|
1661
|
+
for (var index = entries.length; index--;) if (entries[index][0] === atomicKey) entries.splice(index, 1);
|
|
2611
1662
|
}
|
|
2612
1663
|
}
|
|
1664
|
+
direct.flatSlots.delete(atomicKey);
|
|
2613
1665
|
}
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
}
|
|
2619
|
-
appendConditionEntry(transport.entries, cursor, value);
|
|
2620
|
-
return transport;
|
|
2621
|
-
}
|
|
2622
|
-
var variantValueHandler = {
|
|
2623
|
-
segment(ctx, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
2624
|
-
var _directState_flatPass;
|
|
2625
|
-
var state = ctx[0];
|
|
2626
|
-
var directState = state;
|
|
2627
|
-
if (start === end) return;
|
|
2628
|
-
if (isBase) {
|
|
2629
|
-
feedCompoundSegment(directState, source, start, end, true, valid, "");
|
|
2630
|
-
if (!valid) return;
|
|
2631
|
-
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], null);
|
|
2632
|
-
return;
|
|
2633
|
-
}
|
|
2634
|
-
if (!valid || !chainValid) return;
|
|
2635
|
-
var cursor = directState.flatScanCursor;
|
|
2636
|
-
var condition = cursor && conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
2637
|
-
feedCompoundSegment(directState, source, start, end, false, Boolean(condition), condition && ((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) ? conditionTexts[cursor + conditionKeyOffset] || "" : "");
|
|
2638
|
-
if (!condition) return;
|
|
2639
|
-
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], cursor);
|
|
2640
|
-
},
|
|
2641
|
-
modifier(ctx, start, end, valid, first, source) {
|
|
2642
|
-
var directState = ctx[0];
|
|
2643
|
-
var cursor = directState.flatScanCursor;
|
|
2644
|
-
if (!cursor) cursor = directState.flatScanCursor = acquireConditionCursor();
|
|
2645
|
-
else if (first) resetConditionCursor(cursor, 0);
|
|
2646
|
-
if (!valid) {
|
|
2647
|
-
setConditionUnresolved(cursor);
|
|
2648
|
-
return;
|
|
2649
|
-
}
|
|
2650
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(ctx[0], cursor, source.slice(start, end));
|
|
2651
|
-
},
|
|
2652
|
-
chain(ctx, _start, _end, valid) {
|
|
2653
|
-
var cursor = ctx[0].flatScanCursor;
|
|
2654
|
-
if (cursor) {
|
|
2655
|
-
if (!valid) setConditionUnresolved(cursor);
|
|
2656
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(ctx[0], cursor);
|
|
2657
|
-
}
|
|
2658
|
-
return true;
|
|
2659
|
-
}
|
|
2660
|
-
};
|
|
2661
|
-
var contextPropSets = /* @__PURE__ */ new WeakMap();
|
|
2662
|
-
function getContextPropSet(staticConfig) {
|
|
2663
|
-
var _staticConfig_parentStaticConfig, _staticConfig_parentStaticConfig1, _staticConfig_parentStaticConfig2, _staticConfig_parentStaticConfig_context, _staticConfig_parentStaticConfig3;
|
|
2664
|
-
var cached = contextPropSets.get(staticConfig);
|
|
2665
|
-
if (cached !== void 0) return cached;
|
|
2666
|
-
var contextConfig = staticConfig.context || ((_staticConfig_parentStaticConfig = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig === void 0 ? void 0 : _staticConfig_parentStaticConfig.context);
|
|
2667
|
-
var inheritedContextPropKeys = !staticConfig.context || staticConfig.context === ((_staticConfig_parentStaticConfig1 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig1 === void 0 ? void 0 : _staticConfig_parentStaticConfig1.context) ? (_staticConfig_parentStaticConfig2 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig2 === void 0 ? void 0 : _staticConfig_parentStaticConfig2.contextProps : void 0;
|
|
2668
|
-
var contextPropKeys = staticConfig.contextProps || inheritedContextPropKeys;
|
|
2669
|
-
var set = null;
|
|
2670
|
-
if (contextConfig === null || contextConfig === void 0 ? void 0 : contextConfig.props) {
|
|
2671
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2672
|
-
for (var key in contextConfig.props) set.add(key);
|
|
2673
|
-
}
|
|
2674
|
-
if (contextPropKeys) {
|
|
2675
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2676
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2677
|
-
try {
|
|
2678
|
-
for (var _iterator2 = contextPropKeys[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2679
|
-
var key1 = _step2.value;
|
|
2680
|
-
set.add(key1);
|
|
2681
|
-
}
|
|
2682
|
-
} catch (err) {
|
|
2683
|
-
_didIteratorError2 = true;
|
|
2684
|
-
_iteratorError2 = err;
|
|
2685
|
-
} finally {
|
|
2686
|
-
try {
|
|
2687
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2688
|
-
} finally {
|
|
2689
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
2690
|
-
}
|
|
2691
|
-
}
|
|
2692
|
-
}
|
|
2693
|
-
if (contextConfig === null || contextConfig === void 0 ? void 0 : contextConfig.propKeys) {
|
|
2694
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2695
|
-
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
2696
|
-
try {
|
|
2697
|
-
for (var _iterator12 = contextConfig.propKeys[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
2698
|
-
var key2 = _step12.value;
|
|
2699
|
-
set.add(key2);
|
|
2700
|
-
}
|
|
2701
|
-
} catch (err) {
|
|
2702
|
-
_didIteratorError12 = true;
|
|
2703
|
-
_iteratorError12 = err;
|
|
2704
|
-
} finally {
|
|
2705
|
-
try {
|
|
2706
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
2707
|
-
} finally {
|
|
2708
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
var parentPropKeys = (_staticConfig_parentStaticConfig3 = staticConfig.parentStaticConfig) === null || _staticConfig_parentStaticConfig3 === void 0 ? void 0 : (_staticConfig_parentStaticConfig_context = _staticConfig_parentStaticConfig3.context) === null || _staticConfig_parentStaticConfig_context === void 0 ? void 0 : _staticConfig_parentStaticConfig_context.propKeys;
|
|
2713
|
-
if (parentPropKeys) {
|
|
2714
|
-
set || (set = /* @__PURE__ */ new Set());
|
|
2715
|
-
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
2716
|
-
try {
|
|
2717
|
-
for (var _iterator22 = parentPropKeys[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
2718
|
-
var key3 = _step22.value;
|
|
2719
|
-
set.add(key3);
|
|
2720
|
-
}
|
|
2721
|
-
} catch (err) {
|
|
2722
|
-
_didIteratorError22 = true;
|
|
2723
|
-
_iteratorError22 = err;
|
|
2724
|
-
} finally {
|
|
2725
|
-
try {
|
|
2726
|
-
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
2727
|
-
} finally {
|
|
2728
|
-
if (_didIteratorError22) throw _iteratorError22;
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2731
|
-
}
|
|
2732
|
-
contextPropSets.set(staticConfig, set);
|
|
2733
|
-
return set;
|
|
2734
|
-
}
|
|
2735
|
-
function emitMappedValue(styleState, key, value, originalValue, nestedCondition, parentCondition, fallbackOriginal) {
|
|
2736
|
-
var nested = nestedCondition;
|
|
2737
|
-
var parent = parentCondition;
|
|
2738
|
-
var resolvedCondition = nested !== null && nested !== void 0 ? nested : parent;
|
|
2739
|
-
var watermark = conditionCursorTop;
|
|
2740
|
-
if (nested && parent) {
|
|
2741
|
-
var composed = acquireConditionCursor(parent);
|
|
2742
|
-
var nestedKey = conditionTexts[nested + conditionKeyOffset] || "";
|
|
2743
|
-
if (nestedKey) resolveConditionText(styleState, composed, nestedKey);
|
|
2744
|
-
if (!(conditionNumbers[nested + conditionFlagsOffset] & conditionResolvedFlag)) setConditionUnresolved(composed);
|
|
2745
|
-
commitConditionCursor(styleState, composed);
|
|
2746
|
-
resolvedCondition = composed;
|
|
2747
|
-
}
|
|
2748
|
-
var conf = styleState.conf;
|
|
2749
|
-
if (key === "fontFamily" || key === conf.inverseShorthands.fontFamily) styleState.fontFamily = getFontFamilyFromNameOrVariable(value, conf);
|
|
2750
|
-
mapContributedProp(styleState, key, value, originalValue !== null && originalValue !== void 0 ? originalValue : fallbackOriginal, resolvedCondition);
|
|
2751
|
-
releaseConditionCursors(watermark);
|
|
2752
|
-
}
|
|
2753
|
-
var contributeMappedValue = function(key, value, styleState, disabled, parentCondition, fallbackOriginal) {
|
|
2754
|
-
if (disabled) return emitMappedValue(styleState, key, value, void 0, void 0, parentCondition, fallbackOriginal);
|
|
2755
|
-
var { conf, styleProps, staticConfig } = styleState;
|
|
2756
|
-
var { variants } = staticConfig;
|
|
2757
|
-
var { disableExpandShorthands, noExpand, resolveValues } = styleProps;
|
|
2758
|
-
var shorthands = conf.shorthands;
|
|
2759
|
-
if (value === "unset") {
|
|
2760
|
-
var expandedKey = !disableExpandShorthands && shorthands[key] || key;
|
|
2761
|
-
var expanded = noExpand ? null : expandStyle(expandedKey, value, conf.settings.styleCompat || "web");
|
|
2762
|
-
var used = styleState.flatUsed;
|
|
2763
|
-
if (expanded) {
|
|
2764
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2765
|
-
try {
|
|
2766
|
-
for (var _iterator2 = expanded[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2767
|
-
var [nkey] = _step2.value;
|
|
2768
|
-
if (used) delete used[nkey];
|
|
2769
|
-
if (styleState.style) delete styleState.style[nkey];
|
|
2770
|
-
}
|
|
2771
|
-
} catch (err) {
|
|
2772
|
-
_didIteratorError2 = true;
|
|
2773
|
-
_iteratorError2 = err;
|
|
2774
|
-
} finally {
|
|
2775
|
-
try {
|
|
2776
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2777
|
-
} finally {
|
|
2778
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
2779
|
-
}
|
|
2780
|
-
}
|
|
2781
|
-
} else {
|
|
2782
|
-
if (used) delete used[expandedKey];
|
|
2783
|
-
if (styleState.style) delete styleState.style[expandedKey];
|
|
2784
|
-
}
|
|
2785
|
-
return;
|
|
2786
|
-
}
|
|
2787
|
-
if (!noExpand) {
|
|
2788
|
-
if (variants && key in variants) {
|
|
2789
|
-
resolveVariants(key, value, styleProps, styleState, key);
|
|
2790
|
-
return;
|
|
2791
|
-
}
|
|
2792
|
-
}
|
|
2793
|
-
if (!disableExpandShorthands) {
|
|
2794
|
-
if (key in shorthands) key = shorthands[key];
|
|
2795
|
-
}
|
|
2796
|
-
var originalValue = value;
|
|
2797
|
-
if (value === "safe" && isSafeAreaKey(key)) {
|
|
2798
|
-
var expanded1 = expandSafeAreaValue(key);
|
|
2799
|
-
if (expanded1) {
|
|
2800
|
-
for (var i = 0; i < expanded1.length; i++) {
|
|
2801
|
-
var [nkey1, nvalue] = expanded1[i];
|
|
2802
|
-
emitMappedValue(styleState, nkey1, nvalue, originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2803
|
-
}
|
|
2804
|
-
return;
|
|
2805
|
-
}
|
|
2806
|
-
}
|
|
2807
|
-
if (value != null) {
|
|
2808
|
-
if (typeof value === "string") value = isRemValue(value) ? resolveRem(value) : value;
|
|
2809
|
-
else if (isVariable(value)) value = resolveVariableValue(key, value, resolveValues);
|
|
2810
|
-
else if (isRemValue(value)) value = resolveRem(value);
|
|
2811
|
-
}
|
|
2812
|
-
if (value != null) {
|
|
2813
|
-
if (key === "fontFamily" && typeof originalValue === "string") {
|
|
2814
|
-
if (originalValue in conf.fontsParsed) styleState.fontFamily = originalValue;
|
|
2815
|
-
}
|
|
2816
|
-
var expanded2 = noExpand || typeof value === "string" ? null : expandStyle(key, value, conf.settings.styleCompat || "web");
|
|
2817
|
-
if (expanded2) {
|
|
2818
|
-
var max = expanded2.length;
|
|
2819
|
-
for (var i1 = 0; i1 < max; i1++) {
|
|
2820
|
-
var [nkey2, nvalue1, noriginalValue] = expanded2[i1];
|
|
2821
|
-
emitMappedValue(styleState, nkey2, nvalue1, noriginalValue !== null && noriginalValue !== void 0 ? noriginalValue : originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2822
|
-
}
|
|
2823
|
-
} else emitMappedValue(styleState, key, value, originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2824
|
-
}
|
|
2825
|
-
};
|
|
2826
|
-
function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
2827
|
-
var _styleState_staticConfig_variants;
|
|
2828
|
-
var variantDefinition = (_styleState_staticConfig_variants = styleState.staticConfig.variants) === null || _styleState_staticConfig_variants === void 0 ? void 0 : _styleState_staticConfig_variants[key];
|
|
2829
|
-
if (isConditionTransport(value)) {
|
|
2830
|
-
if (value.hasBase) emitResolvedVariant(key, value.base, styleState, parentVariantKey, null);
|
|
2831
|
-
for (var offset = 0; offset < value.entries.length;) {
|
|
2832
|
-
var entryValue = value.entries[offset];
|
|
2833
|
-
var watermark = conditionCursorTop;
|
|
2834
|
-
try {
|
|
2835
|
-
emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value.entries, offset, null));
|
|
2836
|
-
} finally {
|
|
2837
|
-
releaseConditionCursors(watermark);
|
|
2838
|
-
}
|
|
2839
|
-
offset += transportEntryWidth;
|
|
2840
|
-
}
|
|
2841
|
-
return;
|
|
2842
|
-
}
|
|
2843
|
-
if (typeof value === "string" && !(variantDefinition && (typeof variantDefinition === "undefined" ? "undefined" : _type_of(variantDefinition)) === "object" && value in variantDefinition)) {
|
|
2844
|
-
var directState = styleState;
|
|
2845
|
-
var watermark1 = conditionCursorTop;
|
|
2846
|
-
var previousCursor = directState.flatScanCursor;
|
|
2847
|
-
directState.flatScanCursor = null;
|
|
2848
|
-
try {
|
|
2849
|
-
scanFlatValue(value, variantValueHandler, [
|
|
2850
|
-
styleState,
|
|
2851
|
-
key,
|
|
2852
|
-
parentVariantKey
|
|
2853
|
-
]);
|
|
2854
|
-
} finally {
|
|
2855
|
-
directState.flatScanCursor = previousCursor;
|
|
2856
|
-
releaseConditionCursors(watermark1);
|
|
2857
|
-
}
|
|
2858
|
-
return;
|
|
2859
|
-
}
|
|
2860
|
-
var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value);
|
|
2861
|
-
var objectHasDefault = isObjectValue && Object.prototype.hasOwnProperty.call(value, "default");
|
|
2862
|
-
var objectWatermark = conditionCursorTop;
|
|
2863
|
-
try {
|
|
2864
|
-
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
2865
|
-
if (isObjectValue && classifyConditionalObject(value, styleState, void 0, firstCursor || void 0)) {
|
|
2866
|
-
var useFirstCursor = firstCursor !== null;
|
|
2867
|
-
for (var objKey in value) {
|
|
2868
|
-
var _directState_flatPass;
|
|
2869
|
-
var payload = value[objKey];
|
|
2870
|
-
if (payload == null) continue;
|
|
2871
|
-
var directState1 = styleState;
|
|
2872
|
-
var payloadString = String(payload);
|
|
2873
|
-
if (objKey === "default") {
|
|
2874
|
-
feedCompoundSegment(directState1, payloadString, 0, payloadString.length, true, true, "");
|
|
2875
|
-
emitResolvedVariant(key, payload, styleState, parentVariantKey, null);
|
|
2876
|
-
continue;
|
|
2877
|
-
}
|
|
2878
|
-
var watermark2 = conditionCursorTop;
|
|
2879
|
-
var cursor1 = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2880
|
-
var condition = conditionNumbers[cursor1 + conditionValueOffset];
|
|
2881
|
-
if (useFirstCursor) useFirstCursor = false;
|
|
2882
|
-
else {
|
|
2883
|
-
resolveConditionText(styleState, cursor1, objKey);
|
|
2884
|
-
condition = commitConditionCursor(styleState, cursor1);
|
|
2885
|
-
}
|
|
2886
|
-
if ((_directState_flatPass = directState1.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passCompoundIndexes]) feedCompoundSegment(directState1, payloadString, 0, payloadString.length, false, Boolean(condition), condition ? conditionTexts[cursor1 + conditionKeyOffset] || "" : "");
|
|
2887
|
-
emitResolvedVariant(key, payload, styleState, parentVariantKey, cursor1);
|
|
2888
|
-
if (cursor1 !== firstCursor) releaseConditionCursors(watermark2);
|
|
2889
|
-
}
|
|
2890
|
-
return;
|
|
2891
|
-
}
|
|
2892
|
-
} finally {
|
|
2893
|
-
releaseConditionCursors(objectWatermark);
|
|
2894
|
-
}
|
|
2895
|
-
emitResolvedVariant(key, value, styleState, parentVariantKey, null);
|
|
1666
|
+
if (atomicKey === "transform") state.transformAccumulator = void 0;
|
|
1667
|
+
if (state.style) delete state.style[atomicKey];
|
|
1668
|
+
delete state.classNames[atomicKey];
|
|
1669
|
+
delete state.classNames[slot];
|
|
2896
1670
|
}
|
|
2897
|
-
function
|
|
2898
|
-
var
|
|
2899
|
-
var
|
|
2900
|
-
|
|
2901
|
-
if (
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
2905
|
-
console.groupCollapsed(`\u2666\uFE0F\u2666\uFE0F\u2666\uFE0F resolve variant ${key}`);
|
|
2906
|
-
console.info({
|
|
2907
|
-
key,
|
|
2908
|
-
value,
|
|
2909
|
-
variantValue,
|
|
2910
|
-
variants
|
|
2911
|
-
});
|
|
2912
|
-
console.groupEnd();
|
|
2913
|
-
}
|
|
2914
|
-
if (!variantValue) {
|
|
2915
|
-
if (process.env.TAMAGUI_WARN_ON_MISSING_VARIANT === "1") {
|
|
2916
|
-
if (typeof value !== "boolean") {
|
|
2917
|
-
var name = styleState.styleProps.displayName || "[UnnamedComponent]";
|
|
2918
|
-
console.warn(`No variant found: ${name} has variant "${key}", but no matching value "${value}"`);
|
|
2919
|
-
}
|
|
2920
|
-
}
|
|
2921
|
-
return;
|
|
2922
|
-
}
|
|
2923
|
-
if (typeof variantValue === "function") {
|
|
2924
|
-
variantValue = variantValue(value, getVariantExtras(styleState));
|
|
2925
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && false);
|
|
2926
|
-
}
|
|
2927
|
-
if (!isObj(variantValue)) return;
|
|
2928
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` expanding styles from `, variantValue);
|
|
2929
|
-
var { noSkip } = styleProps;
|
|
2930
|
-
var originals = styleOriginalValues.get(variantValue);
|
|
2931
|
-
var directState = styleState;
|
|
2932
|
-
directState.flatCompoundOutputDepth = (directState.flatCompoundOutputDepth || 0) + 1;
|
|
2933
|
-
try {
|
|
2934
|
-
for (var outputKey in variantValue) {
|
|
2935
|
-
if (!noSkip && outputKey in skipProps) continue;
|
|
2936
|
-
var rawOutputValue = variantValue[outputKey];
|
|
2937
|
-
var outputValue = styleProps.noNormalize ? rawOutputValue : normalizeValueWithProperty(rawOutputValue, conf.shorthands[outputKey] || outputKey);
|
|
2938
|
-
var _originals_outputKey;
|
|
2939
|
-
var originalValue = (_originals_outputKey = originals === null || originals === void 0 ? void 0 : originals[outputKey]) !== null && _originals_outputKey !== void 0 ? _originals_outputKey : rawOutputValue;
|
|
2940
|
-
var contextPropSet = getContextPropSet(staticConfig);
|
|
2941
|
-
if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(outputKey)) {
|
|
2942
|
-
var _styleState, _styleState1;
|
|
2943
|
-
(_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
|
|
2944
|
-
styleState.overriddenContextProps[outputKey] = originalValue;
|
|
2945
|
-
(_styleState1 = styleState).originalContextPropValues || (_styleState1.originalContextPropValues = {});
|
|
2946
|
-
styleState.originalContextPropValues[outputKey] = originalValue;
|
|
2947
|
-
}
|
|
2948
|
-
contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
|
|
2949
|
-
}
|
|
2950
|
-
} finally {
|
|
2951
|
-
directState.flatCompoundOutputDepth--;
|
|
1671
|
+
function emitVariantStyle(state, key, value, original, condition, disabled) {
|
|
1672
|
+
var _state_flatCallerVariantKeys, _state_flatStyleStaticConfig_styledContextKeys;
|
|
1673
|
+
var pass = state.flatPass;
|
|
1674
|
+
if (key !== pass[passMapSourceKey] && ((_state_flatCallerVariantKeys = state.flatCallerVariantKeys) === null || _state_flatCallerVariantKeys === void 0 ? void 0 : _state_flatCallerVariantKeys.has(key))) return;
|
|
1675
|
+
if ((_state_flatStyleStaticConfig_styledContextKeys = state.flatStyleStaticConfig.styledContextKeys) === null || _state_flatStyleStaticConfig_styledContextKeys === void 0 ? void 0 : _state_flatStyleStaticConfig_styledContextKeys.has(key)) {
|
|
1676
|
+
var _state, _state1;
|
|
1677
|
+
((_state = state).overriddenContextProps || (_state.overriddenContextProps = {}))[key] = ((_state1 = state).originalContextPropValues || (_state1.originalContextPropValues = {}))[key] = original;
|
|
2952
1678
|
}
|
|
1679
|
+
var parent = pass[passParentCursor];
|
|
1680
|
+
pass[passParentCursor] = condition;
|
|
1681
|
+
contributeProp(pass, key, value, original, disabled);
|
|
1682
|
+
pass[passParentCursor] = parent;
|
|
2953
1683
|
}
|
|
2954
1684
|
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
2955
1685
|
if (isVariable(input)) {
|
|
@@ -2965,127 +1695,6 @@ function getFontFamilyFromNameOrVariable(input, conf) {
|
|
|
2965
1695
|
} else if (typeof input === "string" && input in conf.fontsParsed) return input;
|
|
2966
1696
|
}
|
|
2967
1697
|
var variableToFontNameCache = /* @__PURE__ */ new WeakMap();
|
|
2968
|
-
function getVariantDefinition(variant, value, conf, param) {
|
|
2969
|
-
var { theme } = param;
|
|
2970
|
-
if (!variant) return;
|
|
2971
|
-
if (value === void 0) return;
|
|
2972
|
-
if (typeof variant === "function") return variant;
|
|
2973
|
-
if (Object.prototype.hasOwnProperty.call(variant, value)) return variant[value];
|
|
2974
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2975
|
-
try {
|
|
2976
|
-
for (var _iterator2 = getCompiledVariantResolvers(variant)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2977
|
-
var { key, parts } = _step2.value;
|
|
2978
|
-
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
2979
|
-
try {
|
|
2980
|
-
for (var _iterator12 = parts[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
2981
|
-
var part3 = _step12.value;
|
|
2982
|
-
if (matchesVariantResolver(part3, value, conf, theme)) return variant[key];
|
|
2983
|
-
}
|
|
2984
|
-
} catch (err) {
|
|
2985
|
-
_didIteratorError12 = true;
|
|
2986
|
-
_iteratorError12 = err;
|
|
2987
|
-
} finally {
|
|
2988
|
-
try {
|
|
2989
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
2990
|
-
} finally {
|
|
2991
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
2992
|
-
}
|
|
2993
|
-
}
|
|
2994
|
-
}
|
|
2995
|
-
} catch (err) {
|
|
2996
|
-
_didIteratorError2 = true;
|
|
2997
|
-
_iteratorError2 = err;
|
|
2998
|
-
} finally {
|
|
2999
|
-
try {
|
|
3000
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
3001
|
-
} finally {
|
|
3002
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
3003
|
-
}
|
|
3004
|
-
}
|
|
3005
|
-
}
|
|
3006
|
-
var variantResolverNameSet = new Set(variantResolverNames);
|
|
3007
|
-
var variantResolverCache = /* @__PURE__ */ new WeakMap();
|
|
3008
|
-
var preparedStyleStaticConfigs = /* @__PURE__ */ new WeakSet();
|
|
3009
|
-
function prepareStyleStaticConfig(staticConfig) {
|
|
3010
|
-
if (preparedStyleStaticConfigs.has(staticConfig)) return staticConfig;
|
|
3011
|
-
preparedStyleStaticConfigs.add(staticConfig);
|
|
3012
|
-
getContextPropSet(staticConfig);
|
|
3013
|
-
prepareStaticConfigCompounds(staticConfig);
|
|
3014
|
-
var variants = staticConfig.variants;
|
|
3015
|
-
if (variants) for (var key in variants) {
|
|
3016
|
-
var variant = variants[key];
|
|
3017
|
-
if (variant && (typeof variant === "undefined" ? "undefined" : _type_of(variant)) === "object") getCompiledVariantResolvers(variant);
|
|
3018
|
-
}
|
|
3019
|
-
return staticConfig;
|
|
3020
|
-
}
|
|
3021
|
-
function getCompiledVariantResolvers(variant) {
|
|
3022
|
-
var cached = variantResolverCache.get(variant);
|
|
3023
|
-
if (cached) return cached;
|
|
3024
|
-
var compiled = [];
|
|
3025
|
-
for (var key in variant) {
|
|
3026
|
-
var parts = parseVariantResolverKey(key);
|
|
3027
|
-
if (parts) compiled.push({
|
|
3028
|
-
key,
|
|
3029
|
-
parts
|
|
3030
|
-
});
|
|
3031
|
-
}
|
|
3032
|
-
variantResolverCache.set(variant, compiled);
|
|
3033
|
-
return compiled;
|
|
3034
|
-
}
|
|
3035
|
-
function parseVariantResolverKey(key) {
|
|
3036
|
-
if (!key) return null;
|
|
3037
|
-
var parts = [];
|
|
3038
|
-
var start = 0;
|
|
3039
|
-
for (var index = 0; index <= key.length; index++) {
|
|
3040
|
-
if (index !== key.length && key.charCodeAt(index) !== 124) continue;
|
|
3041
|
-
var partStart = start;
|
|
3042
|
-
var partEnd = index;
|
|
3043
|
-
while (partStart < partEnd && key.charCodeAt(partStart) <= 32) partStart++;
|
|
3044
|
-
while (partEnd > partStart && key.charCodeAt(partEnd - 1) <= 32) partEnd--;
|
|
3045
|
-
if (partStart === partEnd) return null;
|
|
3046
|
-
var part3 = key.slice(partStart, partEnd);
|
|
3047
|
-
if (!variantResolverNameSet.has(part3)) return null;
|
|
3048
|
-
parts.push(part3);
|
|
3049
|
-
start = index + 1;
|
|
3050
|
-
}
|
|
3051
|
-
return parts;
|
|
3052
|
-
}
|
|
3053
|
-
function hasNumericPrefix(value, suffixLength) {
|
|
3054
|
-
if (value.length <= suffixLength) return false;
|
|
3055
|
-
return Number.isFinite(Number(value.slice(0, value.length - suffixLength)));
|
|
3056
|
-
}
|
|
3057
|
-
function matchesVariantResolver(resolverName, value, conf, theme) {
|
|
3058
|
-
var string = typeof value === "string";
|
|
3059
|
-
var number = typeof value === "number";
|
|
3060
|
-
var rem = string && value.endsWith("rem") && hasNumericPrefix(value, 3);
|
|
3061
|
-
switch (resolverName) {
|
|
3062
|
-
case "Size":
|
|
3063
|
-
case "Space":
|
|
3064
|
-
case "Radius":
|
|
3065
|
-
case "ZIndex": return value === true || number || string || resolverName !== "Size" && isVariable(value);
|
|
3066
|
-
case "Color": return value != null && value in conf.tokensParsed.color || string;
|
|
3067
|
-
case "Theme": return string && !!theme && value in theme;
|
|
3068
|
-
case "FontSize":
|
|
3069
|
-
var _conf_fontsParsed_body_size, _conf_fontsParsed_body;
|
|
3070
|
-
return value === true || !!((_conf_fontsParsed_body = conf.fontsParsed.body) === null || _conf_fontsParsed_body === void 0 ? void 0 : (_conf_fontsParsed_body_size = _conf_fontsParsed_body.size) === null || _conf_fontsParsed_body_size === void 0 ? void 0 : _conf_fontsParsed_body_size[value]) || number || rem;
|
|
3071
|
-
case "FontStyle":
|
|
3072
|
-
var _conf_fontsParsed_body_style, _conf_fontsParsed_body1;
|
|
3073
|
-
return !!((_conf_fontsParsed_body1 = conf.fontsParsed.body) === null || _conf_fontsParsed_body1 === void 0 ? void 0 : (_conf_fontsParsed_body_style = _conf_fontsParsed_body1.style) === null || _conf_fontsParsed_body_style === void 0 ? void 0 : _conf_fontsParsed_body_style[value]) || value === "normal" || value === "italic";
|
|
3074
|
-
case "FontTransform":
|
|
3075
|
-
var _conf_fontsParsed_body_transform, _conf_fontsParsed_body2;
|
|
3076
|
-
return !!((_conf_fontsParsed_body2 = conf.fontsParsed.body) === null || _conf_fontsParsed_body2 === void 0 ? void 0 : (_conf_fontsParsed_body_transform = _conf_fontsParsed_body2.transform) === null || _conf_fontsParsed_body_transform === void 0 ? void 0 : _conf_fontsParsed_body_transform[value]) || value === "none" || value === "capitalize" || value === "uppercase" || value === "lowercase";
|
|
3077
|
-
case "FontLineHeight":
|
|
3078
|
-
var _conf_fontsParsed_body_lineHeight, _conf_fontsParsed_body3;
|
|
3079
|
-
return !!((_conf_fontsParsed_body3 = conf.fontsParsed.body) === null || _conf_fontsParsed_body3 === void 0 ? void 0 : (_conf_fontsParsed_body_lineHeight = _conf_fontsParsed_body3.lineHeight) === null || _conf_fontsParsed_body_lineHeight === void 0 ? void 0 : _conf_fontsParsed_body_lineHeight[value]) || number || rem;
|
|
3080
|
-
case "FontLetterSpacing":
|
|
3081
|
-
var _conf_fontsParsed_body_letterSpacing, _conf_fontsParsed_body4;
|
|
3082
|
-
return !!((_conf_fontsParsed_body4 = conf.fontsParsed.body) === null || _conf_fontsParsed_body4 === void 0 ? void 0 : (_conf_fontsParsed_body_letterSpacing = _conf_fontsParsed_body4.letterSpacing) === null || _conf_fontsParsed_body_letterSpacing === void 0 ? void 0 : _conf_fontsParsed_body_letterSpacing[value]) || number || rem;
|
|
3083
|
-
case "number":
|
|
3084
|
-
case "string":
|
|
3085
|
-
case "boolean": return (typeof value === "undefined" ? "undefined" : _type_of(value)) === resolverName;
|
|
3086
|
-
case "any": return true;
|
|
3087
|
-
}
|
|
3088
|
-
}
|
|
3089
1698
|
|
|
3090
|
-
export { STYLE_TOKEN_PROVENANCE_KEY,
|
|
1699
|
+
export { STYLE_TOKEN_PROVENANCE_KEY, emitVariantStyle, getFontFamilyFromNameOrVariable, getSplitStyles, getStyleStaticConfig, getStyleTokenProvenance, isValidStyleKey, styleOriginalValues, walkConditionalValue };
|
|
3091
1700
|
//# sourceMappingURL=getSplitStyles.native.js.map
|