@tamagui/web 3.0.0-beta.831.1 → 3.0.0-beta.889.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/createComponent.cjs +12 -1
- package/dist/cjs/createComponent.native.cjs +12 -1
- package/dist/cjs/createComponent.native.js +12 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.js +1 -1
- package/dist/cjs/createStyledHOC.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/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/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 +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +128 -109
- 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 +1042 -1715
- package/dist/cjs/helpers/getSplitStyles.native.cjs +1081 -1887
- package/dist/cjs/helpers/getSplitStyles.native.js +1081 -1887
- 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/styleStaticConfig.cjs +1 -50
- package/dist/cjs/helpers/styleStaticConfig.native.cjs +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -1
- 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 +15 -38
- package/dist/cjs/helpers/tokenCategories.native.cjs +15 -40
- package/dist/cjs/helpers/tokenCategories.native.js +15 -40
- 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/{helpers/directStyleCSS.native.js → hooks/useStyle.cjs} +16 -8
- package/dist/cjs/{helpers/directStyleCSS.native.cjs → hooks/useStyle.native.cjs} +16 -4
- 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 +6 -3
- package/dist/cjs/index.native.cjs +6 -3
- package/dist/cjs/index.native.js +6 -3
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +2 -2
- package/dist/cjs/static-resolve.native.cjs +2 -2
- package/dist/cjs/static-resolve.native.js +2 -2
- 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 +11 -6
- package/dist/cjs/styled.native.cjs +11 -6
- package/dist/cjs/styled.native.js +11 -6
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +6 -4
- package/dist/cjs/types.native.cjs +6 -4
- package/dist/cjs/types.native.js +6 -4
- 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 +17 -12
- package/dist/cjs/views/Text.native.cjs +1 -0
- package/dist/cjs/views/Text.native.js +1 -0
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +3 -3
- package/dist/cjs/views/Theme.native.cjs +3 -3
- package/dist/cjs/views/Theme.native.js +3 -3
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -4
- package/dist/esm/createComponent.mjs +12 -1
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +12 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +1 -1
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +1 -1
- package/dist/esm/createStyledHOC.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/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/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 +6 -6
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +6 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +126 -109
- 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 +1034 -1705
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +1071 -1871
- 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/styleStaticConfig.mjs +1 -50
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfig.native.js +1 -51
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -1
- 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 +15 -36
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +15 -38
- 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/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 +6 -4
- package/dist/esm/index.mjs +6 -4
- package/dist/esm/index.native.js +6 -4
- package/dist/esm/static-resolve.mjs +3 -3
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +3 -3
- 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 +12 -6
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +12 -6
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +3 -4
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +3 -4
- 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 +17 -12
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Theme.mjs +3 -3
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +3 -3
- 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/package.json +15 -15
- package/src/createComponent.tsx +21 -1
- package/src/createStyledHOC.tsx +4 -2
- package/src/createVariable.ts +0 -10
- package/src/helpers/borderComponents.ts +62 -0
- package/src/helpers/createDesignSystem.ts +0 -2
- package/src/helpers/createStyledContext.tsx +15 -53
- package/src/helpers/formatDiagnostic.ts +9 -9
- package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
- package/src/helpers/getCSSStylesAtomic.ts +192 -207
- package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
- package/src/helpers/getDynamicVal.ts +4 -0
- package/src/helpers/getSplitStyles.tsx +2080 -3270
- 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/styleFrontend.ts +8 -5
- package/src/helpers/styleStaticConfig.ts +5 -72
- package/src/helpers/styleStaticConfigCore.ts +110 -0
- package/src/helpers/styledDynamic.ts +191 -0
- package/src/helpers/tokenCategories.ts +40 -65
- 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/useStyle.ts +10 -0
- package/src/hooks/useThemeState.ts +51 -264
- package/src/index.ts +6 -6
- package/src/internalRuntimeTypes.ts +1 -0
- package/src/static-resolve.ts +7 -4
- package/src/style.ts +97 -0
- package/src/styled.tsx +39 -68
- package/src/types.tsx +105 -169
- package/src/views/TamaguiProvider.tsx +0 -2
- package/src/views/Text.tsx +20 -14
- package/src/views/Theme.tsx +13 -9
- package/src/views/ThemeDebug.tsx +0 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +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/helpers/borderComponents.d.ts +10 -0
- package/types/helpers/borderComponents.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +20 -19
- 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 +3 -5
- 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/styleFrontend.d.ts +3 -5
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +4 -9
- package/types/helpers/styleStaticConfig.d.ts.map +1 -1
- 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/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 +6 -4
- package/types/index.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.map +1 -1
- package/types/style.d.ts +18 -0
- package/types/style.d.ts.map +1 -0
- package/types/styled.d.ts +10 -10
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +74 -49
- 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/dist/cjs/helpers/directStyleCSS.cjs +0 -345
- 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/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/variantResolvers.cjs +0 -87
- package/dist/cjs/helpers/variantResolvers.native.cjs +0 -140
- package/dist/cjs/helpers/variantResolvers.native.js +0 -142
- package/dist/cjs/helpers/variantResolvers.native.js.map +0 -1
- package/dist/esm/helpers/directStyleCSS.mjs +0 -317
- 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/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/variantResolvers.mjs +0 -65
- package/dist/esm/helpers/variantResolvers.mjs.map +0 -1
- package/dist/esm/helpers/variantResolvers.native.js +0 -116
- package/dist/esm/helpers/variantResolvers.native.js.map +0 -1
- package/src/helpers/directStyleCSS.native.ts +0 -1
- package/src/helpers/directStyleCSS.ts +0 -513
- package/src/helpers/directStyleCSSCompiled.ts +0 -32
- package/src/helpers/getVariantExtras.tsx +0 -95
- package/src/helpers/variantResolvers.ts +0 -121
- 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/getVariantExtras.d.ts +0 -4
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/variantResolvers.d.ts +0 -9
- package/types/helpers/variantResolvers.d.ts.map +0 -1
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { isAndroid, isClient,
|
|
2
|
-
import { nonAnimatableStyleProps,
|
|
3
|
-
import { addTransformValue,
|
|
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";
|
|
4
4
|
import { getConfig, getFont } from "../config.native.js";
|
|
5
5
|
import { isDevTools } from "../constants/isDevTools.native.js";
|
|
6
|
+
import { defaultComponentStateMounted } from "../defaultComponentState.native.js";
|
|
6
7
|
import { isVariable } from "../createVariable.native.js";
|
|
7
|
-
import {
|
|
8
|
+
import { stylePieceSymbol } from "../types.native.js";
|
|
9
|
+
import { addComposition, canGenerateCSS, flushDirectStyles, registerAtomicSlot } from "./getCSSStylesAtomic.native.js";
|
|
8
10
|
import { expandStyle } from "./expandStyle.native.js";
|
|
11
|
+
import { classifyBorderComponents, splitComponents, startsValueFunction } from "./borderComponents.native.js";
|
|
9
12
|
import { fixStyles } from "./expandStyles.native.js";
|
|
10
13
|
import { getConfigRevisionState } from "./grammarConfig.native.js";
|
|
11
14
|
import { mediaKeyMatch, mediaState } from "./mediaState.native.js";
|
|
12
15
|
import { getStyleStaticConfig } from "./styleStaticConfig.native.js";
|
|
13
|
-
import {
|
|
16
|
+
import { nativeTextInputColorProps } from "./nativeStyleEngine.native.js";
|
|
14
17
|
import { warnOnce, warnRefusedValue } from "./warnOnce.native.js";
|
|
15
18
|
import { isColorStyleKey } from "./getDynamicVal.native.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
19
|
+
import { getDynamicEnv } from "./styledDynamic.native.js";
|
|
20
|
+
import { getRulesForIdentifier } from "./insertStyleRule.native.js";
|
|
18
21
|
import { log } from "./log.native.js";
|
|
19
22
|
import { normalizeColor } from "./normalizeColor.native.js";
|
|
20
|
-
import { normalizeStyle } from "./normalizeStyle.native.js";
|
|
21
23
|
import { normalizeValueWithProperty } from "./normalizeValueWithProperty.native.js";
|
|
22
24
|
import { parseNativeStyle } from "./parseNativeStyle.native.js";
|
|
23
25
|
import { parseNativeTransform } from "./parseNativeTransform.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
27
|
import { HOC_CLASSNAME_MARKER, skipProps } from "./skipProps.native.js";
|
|
29
28
|
import { styleOriginalValues } from "./styleOriginalValues.native.js";
|
|
30
29
|
import { STYLE_TOKEN_PROVENANCE_KEY, getStyleTokenProvenance, setStyleTokenProvenance } from "./styleProvenance.native.js";
|
|
31
30
|
import { THEME_REF_PREFIX } from "./themeRef.native.js";
|
|
32
|
-
import { getTokenCategoryForProperty } from "./tokenCategories.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,310 +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
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
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;
|
|
53
50
|
var conditionPlatformPseudoFlag = 32;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var length = conditionNumbers.length * 2;
|
|
75
|
-
while (length < required) length *= 2;
|
|
76
|
-
var previous1 = conditionNumbers;
|
|
77
|
-
conditionNumbers = new Float64Array(length);
|
|
78
|
-
conditionNumbers.set(previous1);
|
|
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
|
+
];
|
|
79
71
|
}
|
|
80
|
-
function setConditionUnresolved(
|
|
72
|
+
function setConditionUnresolved(condition) {
|
|
81
73
|
var name = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
for (var offset1 = 0; offset1 < conditionTextWidth; offset1++) conditionTexts[target2 + offset1] = conditionTexts[source + offset1] || "";
|
|
96
|
-
var wrapper = conditionNumbers[source + conditionWrapperOffset];
|
|
97
|
-
var wrapperStart = wrapper >> 3;
|
|
98
|
-
var wrapperCount = wrapper & 7;
|
|
99
|
-
for (var index = 0; index < wrapperCount; index++) conditionWrappers[conditionWrapperTop++] = conditionWrappers[wrapperStart + index];
|
|
100
|
-
conditionNumbers[target2 + conditionWrapperOffset] += wrapperCount;
|
|
101
|
-
}
|
|
102
|
-
function resetConditionCursor(cursor, parent) {
|
|
103
|
-
conditionNumbers[cursor + conditionValueOffset] = 0;
|
|
104
|
-
conditionNumbers[cursor + conditionFlagsOffset] = conditionInitialFlags;
|
|
105
|
-
conditionNumbers[cursor + conditionPrecedenceOffset] = 0;
|
|
106
|
-
conditionNumbers[cursor + conditionWrapperOffset] = conditionWrapperTop << 3;
|
|
107
|
-
conditionTexts.fill("", cursor, cursor + conditionTextWidth);
|
|
108
|
-
if (parent) copyConditionCursor(cursor, parent);
|
|
109
|
-
}
|
|
110
|
-
function acquireConditionCursor() {
|
|
111
|
-
var parent = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
112
|
-
var cursor = conditionCursorTop;
|
|
113
|
-
conditionCursorTop += conditionWidth;
|
|
114
|
-
reserveConditionCursor(cursor);
|
|
115
|
-
resetConditionCursor(cursor, parent);
|
|
116
|
-
return cursor;
|
|
117
|
-
}
|
|
118
|
-
function releaseConditionCursors(watermark) {
|
|
119
|
-
if (watermark >= conditionCursorTop) return;
|
|
120
|
-
conditionTexts.fill("", watermark, conditionCursorTop);
|
|
121
|
-
conditionCursorTop = watermark;
|
|
122
|
-
}
|
|
123
|
-
function releaseConditionPayloads(wrapperBase) {
|
|
124
|
-
conditionWrappers.fill("", wrapperBase, conditionWrapperTop);
|
|
125
|
-
conditionWrapperTop = wrapperBase;
|
|
126
|
-
}
|
|
127
|
-
function accumulateConditionAtom(state, cursor, kind, rank, name) {
|
|
128
|
-
var keySlot = cursor + conditionKeyOffset;
|
|
129
|
-
var key = conditionTexts[keySlot];
|
|
130
|
-
if (!key) conditionTexts[keySlot] = name;
|
|
131
|
-
else {
|
|
132
|
-
var slotStart = 0;
|
|
133
|
-
var inserted = false;
|
|
134
|
-
while (slotStart <= key.length) {
|
|
135
|
-
var slotEnd = key.indexOf(":", slotStart);
|
|
136
|
-
if (slotEnd === -1) slotEnd = key.length;
|
|
137
|
-
var order = 0;
|
|
138
|
-
var compareLength = Math.min(name.length, slotEnd - slotStart);
|
|
139
|
-
for (var offset = 0; offset < compareLength; offset++) {
|
|
140
|
-
order = name.charCodeAt(offset) - key.charCodeAt(slotStart + offset);
|
|
141
|
-
if (order) break;
|
|
142
|
-
}
|
|
143
|
-
order || (order = name.length - (slotEnd - slotStart));
|
|
144
|
-
if (!order) return;
|
|
145
|
-
if (order < 0) {
|
|
146
|
-
conditionTexts[keySlot] = `${key.slice(0, slotStart)}${name}:${key.slice(slotStart)}`;
|
|
147
|
-
inserted = true;
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
if (slotEnd === key.length) break;
|
|
151
|
-
slotStart = slotEnd + 1;
|
|
152
|
-
}
|
|
153
|
-
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;
|
|
154
87
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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;
|
|
159
98
|
return;
|
|
160
99
|
}
|
|
161
|
-
var
|
|
162
|
-
var
|
|
163
|
-
var
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
categoryRank = nextCategory;
|
|
168
|
-
withinRank = rank;
|
|
169
|
-
} else if (nextCategory === categoryRank && rank > withinRank) withinRank = rank;
|
|
170
|
-
precedence1 = precedence1 & -67108864 | depth << 23 | categoryRank << 20 | withinRank;
|
|
171
|
-
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;
|
|
172
106
|
var buildCSS = canGenerateCSS && state.flatShouldDoClasses;
|
|
173
|
-
if (kind ===
|
|
107
|
+
if (kind === 2) {
|
|
174
108
|
var _state_flatMediaState;
|
|
175
109
|
var _state;
|
|
176
|
-
var query =
|
|
177
|
-
if (!query)
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
if (buildCSS) appendConditionWrapper(cursor, `@media ${query}`);
|
|
182
|
-
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;
|
|
183
114
|
((_state = state).flatMediaKeys || (_state.flatMediaKeys = /* @__PURE__ */ new Set())).add(name);
|
|
184
|
-
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (kind === 4) {
|
|
185
118
|
var _state_flatThemeName;
|
|
186
|
-
|
|
187
|
-
if (buildCSS) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
var
|
|
194
|
-
var
|
|
195
|
-
var
|
|
196
|
-
var groupName =
|
|
197
|
-
var stateSelector = stateModifierSelectors[rank];
|
|
198
|
-
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}`;
|
|
199
130
|
if (buildCSS) {
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
|
|
131
|
+
var query1 = modifier[3];
|
|
132
|
+
appendConditionWrapper(condition, containerName ? `@container ${containerName} ${query1}` : `@container ${query1}`);
|
|
203
133
|
}
|
|
204
134
|
var component = (_state_componentState_group = state.componentState.group) === null || _state_componentState_group === void 0 ? void 0 : _state_componentState_group[groupName];
|
|
205
135
|
var context = (_state_flatGroupContext = state.flatGroupContext) === null || _state_flatGroupContext === void 0 ? void 0 : _state_flatGroupContext[groupName];
|
|
206
|
-
|
|
207
|
-
|
|
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;
|
|
208
139
|
((_state1 = state).flatGroupKeys || (_state1.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupName);
|
|
209
|
-
|
|
210
|
-
var _state_componentState_group1, _state_flatGroupContext1, _state_flatGroupContext2, _component_media;
|
|
211
|
-
var _state2, _state3;
|
|
212
|
-
var slash1 = name.indexOf("/");
|
|
213
|
-
var containerSize = name.slice(1, slash1 === -1 ? name.length : slash1);
|
|
214
|
-
var containerName = slash1 === -1 ? "" : name.slice(slash1 + 1);
|
|
215
|
-
var containerQuery = getConfigRevisionState(state.conf).mediaQueries[containerSize];
|
|
216
|
-
var groupKey = `@${containerName}`;
|
|
217
|
-
if (buildCSS) appendConditionWrapper(cursor, containerName ? `@container ${containerName} ${containerQuery}` : `@container ${containerQuery}`);
|
|
218
|
-
var component1 = (_state_componentState_group1 = state.componentState.group) === null || _state_componentState_group1 === void 0 ? void 0 : _state_componentState_group1[groupKey];
|
|
219
|
-
var context1 = (_state_flatGroupContext1 = state.flatGroupContext) === null || _state_flatGroupContext1 === void 0 ? void 0 : _state_flatGroupContext1[groupKey];
|
|
220
|
-
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.`);
|
|
221
|
-
var match = component1 === null || component1 === void 0 ? void 0 : (_component_media = component1.media) === null || _component_media === void 0 ? void 0 : _component_media[containerSize];
|
|
222
|
-
if (!(match === void 0 ? (context1 === null || context1 === void 0 ? void 0 : context1.state.layout) && mediaKeyMatch(containerSize, context1.state.layout) : match)) conditionNumbers[cursor + conditionFlagsOffset] &= ~conditionActiveFlag;
|
|
223
|
-
((_state2 = state).flatGroupKeys || (_state2.flatGroupKeys = /* @__PURE__ */ new Set())).add(groupKey);
|
|
224
|
-
((_state3 = state).flatGroupMedia || (_state3.flatGroupMedia = /* @__PURE__ */ new Set())).add(containerSize);
|
|
225
|
-
} else {
|
|
226
|
-
var stateSelector1 = stateModifierSelectors[rank];
|
|
227
|
-
conditionNumbers[cursor + conditionFlagsOffset] += 64;
|
|
228
|
-
if (stateSelector1[0] === "[" && name !== "disabled") conditionTexts[cursor + conditionUnsupportedStateOffset] = name;
|
|
229
|
-
if (rank === 6) conditionNumbers[cursor + conditionFlagsOffset] |= conditionEnterFlag;
|
|
230
|
-
else if (rank === 7) conditionNumbers[cursor + conditionFlagsOffset] |= conditionExitFlag;
|
|
231
|
-
else if (rank === 0 || rank === 2 || rank === 4) conditionNumbers[cursor + conditionFlagsOffset] |= conditionPlatformPseudoFlag;
|
|
232
|
-
if (buildCSS) {
|
|
233
|
-
var selector2 = cursor + conditionSelectorOffset;
|
|
234
|
-
if (stateSelector1[0] === ".") conditionTexts[selector2] += `:is(${stateSelector1}, ${stateSelector1} *)`;
|
|
235
|
-
else conditionTexts[selector2] += stateSelector1;
|
|
236
|
-
if (rank === 0) appendConditionWrapper(cursor, "@media (hover: hover)");
|
|
237
|
-
}
|
|
238
|
-
var component2 = state.componentState;
|
|
239
|
-
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;
|
|
240
|
-
if (stateSelector1[0] === ":") {
|
|
241
|
-
var _state4;
|
|
242
|
-
((_state4 = state).flatStateKeys || (_state4.flatStateKeys = /* @__PURE__ */ new Set())).add(name);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
function resolveConditionModifier(state, cursor, modifier) {
|
|
247
|
-
var compiled = getConfigRevisionState(state.conf);
|
|
248
|
-
var code = compiled.modifiers[modifier];
|
|
249
|
-
var kind = code & 7;
|
|
250
|
-
var rank = code >> 3;
|
|
251
|
-
if (kind === modifierKindState) {
|
|
252
|
-
accumulateConditionAtom(state, cursor, kind, rank, canonicalStateModifierNames[rank]);
|
|
140
|
+
((_state2 = state).flatGroupMedia || (_state2.flatGroupMedia = /* @__PURE__ */ new Set())).add(size);
|
|
253
141
|
return;
|
|
254
142
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
var
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
var
|
|
273
|
-
if (
|
|
274
|
-
|
|
275
|
-
return;
|
|
276
|
-
}
|
|
277
|
-
} else if (kind) {
|
|
278
|
-
accumulateConditionAtom(state, cursor, kind, rank, modifier);
|
|
279
|
-
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);
|
|
280
163
|
}
|
|
281
|
-
|
|
164
|
+
if (rank === 0 && buildCSS) appendConditionWrapper(condition, "@media (hover: hover)");
|
|
282
165
|
}
|
|
283
|
-
function resolveConditionText(state,
|
|
166
|
+
function resolveConditionText(state, condition, text) {
|
|
284
167
|
var start = 0;
|
|
285
168
|
for (var index = 0; index <= text.length; index++) {
|
|
286
169
|
if (index !== text.length && text.charCodeAt(index) !== 58) continue;
|
|
287
170
|
if (index === start) {
|
|
288
|
-
setConditionUnresolved(
|
|
171
|
+
setConditionUnresolved(condition);
|
|
289
172
|
return;
|
|
290
173
|
}
|
|
291
|
-
if (!(
|
|
292
|
-
resolveConditionModifier(state,
|
|
174
|
+
if (!(condition[conditionValue] & conditionResolvedFlag)) return;
|
|
175
|
+
resolveConditionModifier(state, condition, text.slice(start, index));
|
|
293
176
|
start = index + 1;
|
|
294
177
|
}
|
|
295
178
|
}
|
|
296
|
-
function
|
|
297
|
-
if (!(
|
|
298
|
-
|
|
179
|
+
function commitCondition(condition) {
|
|
180
|
+
if (!(condition[conditionValue] & conditionResolvedFlag)) {
|
|
181
|
+
condition[conditionValue] = 0;
|
|
299
182
|
return 0;
|
|
300
183
|
}
|
|
301
|
-
|
|
302
|
-
var
|
|
303
|
-
var depth =
|
|
304
|
-
if (depth > 5)
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
conditionNumbers[cursor + conditionValueOffset] = condition;
|
|
308
|
-
return condition;
|
|
309
|
-
}
|
|
310
|
-
function acquireConditionKeyCursor(state, key) {
|
|
311
|
-
var cursor = acquireConditionCursor();
|
|
312
|
-
if (key) {
|
|
313
|
-
resolveConditionText(state, cursor, key);
|
|
314
|
-
commitConditionCursor(state, cursor);
|
|
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;
|
|
315
190
|
}
|
|
316
|
-
|
|
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;
|
|
196
|
+
}
|
|
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;
|
|
317
218
|
}
|
|
318
|
-
function classifyConditionalObject(value, state, isChain,
|
|
219
|
+
function classifyConditionalObject(value, state, isChain, firstCondition) {
|
|
319
220
|
if ("default" in value) return -1;
|
|
320
221
|
for (var key in value) {
|
|
321
222
|
if (!key.length) return 0;
|
|
322
223
|
if (!state) return (isChain === null || isChain === void 0 ? void 0 : isChain(key)) ? 1 : 0;
|
|
323
|
-
var
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
resolveConditionText(state, cursor, key);
|
|
327
|
-
return commitConditionCursor(state, cursor);
|
|
328
|
-
} finally {
|
|
329
|
-
if (!firstCursor) releaseConditionCursors(watermark);
|
|
330
|
-
}
|
|
224
|
+
var condition = firstCondition || createCondition();
|
|
225
|
+
resolveConditionText(state, condition, key);
|
|
226
|
+
return commitCondition(condition);
|
|
331
227
|
}
|
|
332
228
|
return 0;
|
|
333
229
|
}
|
|
334
|
-
var
|
|
335
|
-
var
|
|
336
|
-
var
|
|
337
|
-
var
|
|
338
|
-
var
|
|
339
|
-
var
|
|
340
|
-
var
|
|
341
|
-
var
|
|
342
|
-
var
|
|
343
|
-
var
|
|
344
|
-
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;
|
|
345
247
|
var passNoSkipFlag = 1;
|
|
346
248
|
var passDisableShorthandsFlag = 2;
|
|
347
249
|
var passNoExpandFlag = 4;
|
|
@@ -350,357 +252,269 @@ var passHocFlag = 16;
|
|
|
350
252
|
var passTextFlag = 32;
|
|
351
253
|
var passInputFlag = 64;
|
|
352
254
|
var passAsChildStyleFlag = 128;
|
|
353
|
-
function
|
|
354
|
-
|
|
355
|
-
var processedProps = styleState.props;
|
|
356
|
-
var styleStaticConfig = styleState.flatStyleStaticConfig;
|
|
357
|
-
var baseStyle = styleStaticConfig.baseStyle;
|
|
358
|
-
var baseVariantProps = styleStaticConfig.baseVariantProps;
|
|
359
|
-
var conditionWrapperBase = conditionWrapperTop;
|
|
360
|
-
try {
|
|
361
|
-
var appliesBaseStyle = baseStyle && !processedProps.asChild;
|
|
362
|
-
if (appliesBaseStyle) for (var key in baseStyle) contributeProp(pass, key, baseVariantProps && Object.hasOwn(baseVariantProps, key) && Object.hasOwn(processedProps, key) ? processedProps[key] : baseStyle[key]);
|
|
363
|
-
for (var key1 in processedProps) {
|
|
364
|
-
if (appliesBaseStyle && baseVariantProps && Object.hasOwn(baseVariantProps, key1)) continue;
|
|
365
|
-
contributeProp(pass, key1, processedProps[key1]);
|
|
366
|
-
}
|
|
367
|
-
} catch (error) {
|
|
368
|
-
releaseConditionPayloads(conditionWrapperBase);
|
|
369
|
-
throw error;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
function isValidStyleKey(key, validStyles, accept) {
|
|
373
|
-
return Boolean(key in validStyles || accept && key in accept);
|
|
374
|
-
}
|
|
375
|
-
function flushForwardStylesToClasses(pass) {
|
|
376
|
-
var styleState = pass[passStyleState];
|
|
377
|
-
if (!pass[passShouldDoClasses]) return;
|
|
378
|
-
completeStreamingCSS(styleState);
|
|
379
|
-
flushDirectStyles(styleState, true);
|
|
255
|
+
function isValidStyleKey(key, validStyles) {
|
|
256
|
+
return key in validStyles;
|
|
380
257
|
}
|
|
381
258
|
function effectiveLifecycleKeys(keys) {
|
|
382
259
|
if (!keys) return;
|
|
383
260
|
var out = /* @__PURE__ */ new Set();
|
|
384
|
-
var
|
|
261
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
385
262
|
try {
|
|
386
|
-
for (var
|
|
387
|
-
var key =
|
|
263
|
+
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
264
|
+
var key = _step.value;
|
|
388
265
|
out.add(key === "--t-x" || key === "--t-y" ? "translate" : key === "--t-scale-x" || key === "--t-scale-y" ? "scale" : key);
|
|
389
266
|
}
|
|
390
267
|
} catch (err) {
|
|
391
|
-
|
|
392
|
-
|
|
268
|
+
_didIteratorError = true;
|
|
269
|
+
_iteratorError = err;
|
|
393
270
|
} finally {
|
|
394
271
|
try {
|
|
395
|
-
if (!
|
|
272
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
396
273
|
} finally {
|
|
397
|
-
if (
|
|
274
|
+
if (_didIteratorError) throw _iteratorError;
|
|
398
275
|
}
|
|
399
276
|
}
|
|
400
277
|
return out;
|
|
401
278
|
}
|
|
402
|
-
function
|
|
403
|
-
var
|
|
404
|
-
var
|
|
405
|
-
var
|
|
406
|
-
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);
|
|
407
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;
|
|
408
294
|
var hocParentVariants = isHOC ? parentVariants : void 0;
|
|
409
|
-
var
|
|
410
|
-
var
|
|
411
|
-
if (
|
|
412
|
-
|
|
413
|
-
if (key in stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
|
|
414
|
-
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.`);
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
viewProps[key] = val;
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
421
|
-
console.groupCollapsed(" 💠 expanded", keyInit, "=>", key);
|
|
422
|
-
log(val);
|
|
423
|
-
console.groupEnd();
|
|
424
|
-
}
|
|
425
|
-
if (val == null) return;
|
|
426
|
-
if (accept && key in accept) {
|
|
427
|
-
viewProps[key] = val;
|
|
295
|
+
var keyInit = keyOg;
|
|
296
|
+
var valInit = valOg;
|
|
297
|
+
if (keyInit === "children") {
|
|
298
|
+
viewProps[keyInit] = valInit;
|
|
428
299
|
return;
|
|
429
300
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
if (
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
var structured = mergeConditionTransport(styleState, viewProps[key], conditionCursor, val);
|
|
437
|
-
if (key in viewProps) delete viewProps[key];
|
|
438
|
-
viewProps[key] = structured;
|
|
439
|
-
} 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.`);
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
if (isHostStyleKey || isContextProgramKey) {
|
|
443
|
-
contributeValue(styleState, key, val, mergeStyle, originalVal, !isHostStyleKey);
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
var isVariant = Boolean(variants && key in variants);
|
|
447
|
-
if (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(key)) {
|
|
448
|
-
var _props_key;
|
|
449
|
-
viewProps[key] = (_props_key = props[key]) !== null && _props_key !== void 0 ? _props_key : val;
|
|
450
|
-
}
|
|
451
|
-
if (Boolean(hocParentVariants && hocParentVariants[keyInit])) {
|
|
452
|
-
passDownProp(viewProps, key, val);
|
|
453
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
454
|
-
console.groupCollapsed(` - passing down prop ${key}`);
|
|
455
|
-
log({
|
|
456
|
-
val,
|
|
457
|
-
after: { ...viewProps[key] }
|
|
458
|
-
});
|
|
459
|
-
console.groupEnd();
|
|
460
|
-
}
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
if (!isVariant) {
|
|
464
|
-
if (isStyledContextProp) return;
|
|
465
|
-
if (key in stylePropsAll && !isValidStyleKey(key, validStyles, accept)) {
|
|
466
|
-
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.`);
|
|
467
|
-
return;
|
|
468
|
-
}
|
|
469
|
-
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];
|
|
470
307
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
var [styleState, conf, props, viewProps, staticConfig, validStyles, accept, neverSkipProps, variants, inlineProps, parentVariants, styleFrontend, styledContext, styledContextKeys, flags, debug, parentStaticConfig, defaultProps, driverAnimations, driverOutputStyle, elementType] = pass;
|
|
477
|
-
var noSkip = Boolean(flags & passNoSkipFlag);
|
|
478
|
-
var disableExpandShorthands = Boolean(flags & passDisableShorthandsFlag);
|
|
479
|
-
var noExpand = Boolean(flags & passNoExpandFlag);
|
|
480
|
-
var noMergeStyle = Boolean(flags & passNoMergeFlag);
|
|
481
|
-
var isHOC = Boolean(flags & passHocFlag);
|
|
482
|
-
var isText = Boolean(flags & passTextFlag);
|
|
483
|
-
var isInput = Boolean(flags & passInputFlag);
|
|
484
|
-
var shorthands = conf.shorthands;
|
|
485
|
-
var shouldSkipDirectProps = !noSkip && !isHOC;
|
|
486
|
-
var shouldCheckSkipProps = !noSkip;
|
|
487
|
-
var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
|
|
488
|
-
var isTextOrInput = isText || isInput;
|
|
489
|
-
var hocParentVariants = isHOC ? parentVariants : void 0;
|
|
490
|
-
var keyInit = keyOg;
|
|
491
|
-
var valInit = valOg;
|
|
492
|
-
if (keyInit === "children") {
|
|
493
|
-
viewProps[keyInit] = valInit;
|
|
494
|
-
return;
|
|
495
|
-
}
|
|
496
|
-
if (keyInit === "ref") return;
|
|
497
|
-
if (keyInit[0] === "d" && keyInit.startsWith("data-")) return;
|
|
498
|
-
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`before-prop-${keyInit}`;
|
|
499
|
-
if (process.env.NODE_ENV === "test" && keyInit === "jestAnimatedStyle") return;
|
|
500
|
-
if (accept) {
|
|
501
|
-
var accepted = accept[keyInit];
|
|
502
|
-
if ((accepted === "style" || accepted === "textStyle") && valInit && (typeof valInit === "undefined" ? "undefined" : _type_of(valInit)) === "object") {
|
|
503
|
-
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;
|
|
504
313
|
return;
|
|
505
314
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
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]);
|
|
515
326
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
clearDirectStyle(styleState, property);
|
|
524
|
-
styleState.classNames[property] = generatedClass;
|
|
525
|
-
((_pass = pass)[_passHocMappedProperties = passHocMappedProperties] || (_pass[_passHocMappedProperties] = /* @__PURE__ */ new Set())).add(property);
|
|
526
|
-
((_pass1 = pass)[_passHocMappedClasses = passHocMappedClasses] || (_pass1[_passHocMappedClasses] = /* @__PURE__ */ new Set())).add(generatedClass);
|
|
527
|
-
}
|
|
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;
|
|
528
334
|
}
|
|
529
|
-
var
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
if ((_pass_passHocMappedClasses = pass[passHocMappedClasses]) === null || _pass_passHocMappedClasses === void 0 ? void 0 : _pass_passHocMappedClasses.has(candidate)) {
|
|
540
|
-
start = index + 1;
|
|
541
|
-
continue;
|
|
542
|
-
}
|
|
543
|
-
var plan = getClassPlan ? getClassPlan(candidate, conf) : "raw";
|
|
544
|
-
if (plan === null) {
|
|
545
|
-
if (process.env.NODE_ENV === "development") warnOnce(`[tamagui] frontend candidate "${candidate}" is unavailable on this platform and was dropped.`);
|
|
546
|
-
} else if (plan === "raw") {
|
|
547
|
-
pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
|
|
548
|
-
if (getClassPlan) {
|
|
549
|
-
flushForwardStylesToClasses(pass);
|
|
550
|
-
pass[passShouldDoClasses] = false;
|
|
551
|
-
styleState.flatShouldDoClasses = false;
|
|
552
|
-
}
|
|
553
|
-
} else {
|
|
554
|
-
var parentPlan = plan;
|
|
555
|
-
if (!Array.isArray(plan) && parentPlan.preserveRawClass) {
|
|
556
|
-
pass[passClassName] = pass[passClassName] ? `${pass[passClassName]} ${candidate}` : candidate;
|
|
557
|
-
flushForwardStylesToClasses(pass);
|
|
558
|
-
pass[passShouldDoClasses] = false;
|
|
559
|
-
styleState.flatShouldDoClasses = false;
|
|
560
|
-
}
|
|
561
|
-
var entries = Array.isArray(plan) ? plan : parentPlan.entries;
|
|
562
|
-
for (var entryIndex = 0; entryIndex < entries.length; entryIndex++) {
|
|
563
|
-
var entry = entries[entryIndex];
|
|
564
|
-
if (entry[2] !== void 0) {
|
|
565
|
-
if (isValidStyleKey(entry[0], validStyles, accept)) contributeValue(styleState, entry[0], entry[1], mergeStyle, void 0, false, entry[2]);
|
|
566
|
-
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.`);
|
|
567
|
-
} else {
|
|
568
|
-
if (entry[0] === "group") pass[passFrontendGroup] = entry[1];
|
|
569
|
-
else if (entry[0] === "container") pass[passFrontendContainer] = entry[1];
|
|
570
|
-
else if (entry[0] === "containerType") pass[passFrontendContainerType] = entry[1];
|
|
571
|
-
contributeProp(pass, entry[0], entry[1]);
|
|
572
|
-
}
|
|
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);
|
|
573
345
|
}
|
|
346
|
+
pass[passShouldDoClasses] = false;
|
|
347
|
+
styleState.flatShouldDoClasses = false;
|
|
574
348
|
}
|
|
575
|
-
start = index + 1;
|
|
576
|
-
}
|
|
577
|
-
if (props[HOC_CLASSNAME_MARKER] !== void 0) {
|
|
578
|
-
flushForwardStylesToClasses(pass);
|
|
579
|
-
pass[passShouldDoClasses] = false;
|
|
580
|
-
styleState.flatShouldDoClasses = false;
|
|
581
349
|
}
|
|
350
|
+
start = index + 1;
|
|
582
351
|
}
|
|
583
|
-
return;
|
|
584
352
|
}
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
var
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
if (!style) continue;
|
|
596
|
-
var hocClassNames1 = style[TAMAGUI_CLASS_PROPS];
|
|
597
|
-
if (hocClassNames1) {
|
|
598
|
-
for (var property1 in hocClassNames1) {
|
|
599
|
-
var _pass2, _passHocMappedProperties1;
|
|
600
|
-
clearDirectStyle(styleState, property1);
|
|
601
|
-
styleState.classNames[property1] = hocClassNames1[property1];
|
|
602
|
-
((_pass2 = pass)[_passHocMappedProperties1 = passHocMappedProperties] || (_pass2[_passHocMappedProperties1] = /* @__PURE__ */ new Set())).add(property1);
|
|
603
|
-
}
|
|
604
|
-
continue;
|
|
605
|
-
}
|
|
606
|
-
var normalized = normalizeStyle(style, false, true);
|
|
607
|
-
var styleOriginals = shouldTrackStyleTokenProvenance ? styleOriginalValues.get(style) : void 0;
|
|
608
|
-
for (var key in normalized) {
|
|
609
|
-
var _pass_passHocMappedProperties;
|
|
610
|
-
if (normalized[key] == null) continue;
|
|
611
|
-
if ((_pass_passHocMappedProperties = pass[passHocMappedProperties]) === null || _pass_passHocMappedProperties === void 0 ? void 0 : _pass_passHocMappedProperties.delete(key)) clearDirectStyle(styleState, key);
|
|
612
|
-
contributeValue(styleState, key, normalized[key], mergeStyle, styleOriginals === null || styleOriginals === void 0 ? void 0 : styleOriginals[key]);
|
|
613
|
-
}
|
|
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]);
|
|
614
363
|
}
|
|
615
|
-
return;
|
|
616
364
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (keyInit === "style") {
|
|
368
|
+
if (!valInit) return;
|
|
369
|
+
if (noMergeStyle) {
|
|
370
|
+
viewProps.style = valInit;
|
|
371
|
+
return;
|
|
621
372
|
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
var
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
if (
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
var _numberOfLines;
|
|
636
|
-
(_numberOfLines = (_viewProps = viewProps).numberOfLines) !== null && _numberOfLines !== void 0 || (_viewProps.numberOfLines = 1);
|
|
637
|
-
var _ellipsizeMode;
|
|
638
|
-
(_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]);
|
|
639
386
|
}
|
|
640
|
-
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
if (isStyleProp && asChildExceptStyleLike) return;
|
|
647
|
-
var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
|
|
648
|
-
var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
|
|
649
|
-
var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps));
|
|
650
|
-
var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
|
|
651
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") {
|
|
652
|
-
console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
|
|
653
|
-
log({
|
|
654
|
-
isVariant,
|
|
655
|
-
valInit,
|
|
656
|
-
shouldPassProp
|
|
657
|
-
});
|
|
658
|
-
if (isClient) log({
|
|
659
|
-
variants,
|
|
660
|
-
variant: variants === null || variants === void 0 ? void 0 : variants[keyInit],
|
|
661
|
-
isVariant,
|
|
662
|
-
isHOCShouldPassThrough,
|
|
663
|
-
parentStaticConfig
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
if (shouldPassThrough) {
|
|
667
|
-
passDownProp(viewProps, keyInit, valInit);
|
|
668
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
669
|
-
if (!isVariant) return;
|
|
670
|
-
}
|
|
671
|
-
if (shouldCheckSkipProps && !(neverSkipProps === null || neverSkipProps === void 0 ? void 0 : neverSkipProps[keyInit])) {
|
|
672
|
-
if (keyInit in skipProps && !(keyInit === "transition" && typeof valInit === "string" && !(driverAnimations === null || driverAnimations === void 0 ? void 0 : driverAnimations[valInit]))) {
|
|
673
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") console.groupEnd();
|
|
674
|
-
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]);
|
|
675
393
|
}
|
|
676
394
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
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();
|
|
683
456
|
return;
|
|
684
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;
|
|
685
470
|
pass[passMapSourceKey] = keyInit;
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
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();
|
|
700
514
|
}
|
|
701
515
|
}
|
|
702
516
|
var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) {
|
|
703
|
-
var _styleState_style;
|
|
517
|
+
var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_style;
|
|
704
518
|
var conf = getConfig();
|
|
705
519
|
styleStaticConfig || (styleStaticConfig = getStyleStaticConfig(staticConfig, conf));
|
|
706
520
|
var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
|
|
@@ -723,7 +537,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
723
537
|
var staticPassthroughClassName = "";
|
|
724
538
|
var className = staticPassthroughClassName;
|
|
725
539
|
if (staticPassthroughClassName) shouldDoClasses = false;
|
|
726
|
-
var validStyles$1 = staticConfig.validStyles || (staticConfig.
|
|
540
|
+
var validStyles$1 = staticConfig.validStyles || (staticConfig.isInput ? stylePropsInput : staticConfig.isText ? stylePropsText : validStyles);
|
|
727
541
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-setup`;
|
|
728
542
|
var styleState = {
|
|
729
543
|
classNames,
|
|
@@ -745,7 +559,6 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
745
559
|
animationDriver: resolvedDriver
|
|
746
560
|
};
|
|
747
561
|
styleState.flatStyleStaticConfig = styleStaticConfig;
|
|
748
|
-
if (canGenerateCSS && shouldDoClasses && styleProps.canPlatformPseudo) styleState.flatDeferCSS = true;
|
|
749
562
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`style-state`;
|
|
750
563
|
if (process.env.NODE_ENV === "development" && debug === "verbose" && isClient) {
|
|
751
564
|
if (isDevTools) {
|
|
@@ -763,21 +576,20 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
763
576
|
}
|
|
764
577
|
}
|
|
765
578
|
var { asChild } = props;
|
|
766
|
-
var {
|
|
579
|
+
var { neverSkipProps } = staticConfig;
|
|
767
580
|
var { noSkip, disableExpandShorthands, noExpand, noClass, noMergeStyle, noNormalize, isAnimated, styledContext } = styleProps;
|
|
768
581
|
var styledContextKeys = styleStaticConfig.styledContextKeys;
|
|
769
582
|
var styleFrontend = staticConfig.styleFrontend;
|
|
770
583
|
var frontendGroup;
|
|
771
584
|
var frontendContainer;
|
|
772
585
|
var frontendContainerType;
|
|
586
|
+
var processedProps = props;
|
|
773
587
|
var parentVariants = parentStaticConfig ? getStyleStaticConfig(parentStaticConfig, conf).variants : void 0;
|
|
774
588
|
var defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
|
|
775
589
|
var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
|
|
776
590
|
var containerValue;
|
|
777
591
|
var containerName;
|
|
778
592
|
var containerType;
|
|
779
|
-
var hocMappedClassProperties;
|
|
780
|
-
var hocMappedClasses;
|
|
781
593
|
var pass = [
|
|
782
594
|
styleState,
|
|
783
595
|
conf,
|
|
@@ -785,7 +597,6 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
785
597
|
viewProps,
|
|
786
598
|
staticConfig,
|
|
787
599
|
validStyles$1,
|
|
788
|
-
accept,
|
|
789
600
|
neverSkipProps,
|
|
790
601
|
variants,
|
|
791
602
|
inlineProps,
|
|
@@ -807,36 +618,103 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
807
618
|
containerType,
|
|
808
619
|
frontendGroup,
|
|
809
620
|
frontendContainer,
|
|
810
|
-
frontendContainerType
|
|
811
|
-
hocMappedClassProperties,
|
|
812
|
-
hocMappedClasses
|
|
621
|
+
frontendContainerType
|
|
813
622
|
];
|
|
814
623
|
styleState.flatPass = pass;
|
|
815
624
|
var conditionalStates = null;
|
|
816
625
|
var usesSafeArea = false;
|
|
817
|
-
var
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
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]);
|
|
834
659
|
}
|
|
835
|
-
convertDeferredInline(styleState, mergeStyle);
|
|
836
660
|
}
|
|
837
|
-
|
|
838
|
-
}
|
|
839
|
-
|
|
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];
|
|
671
|
+
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-propsend`;
|
|
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;
|
|
689
|
+
try {
|
|
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;
|
|
693
|
+
}
|
|
694
|
+
} catch (err) {
|
|
695
|
+
_didIteratorError = true;
|
|
696
|
+
_iteratorError = err;
|
|
697
|
+
} finally {
|
|
698
|
+
try {
|
|
699
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
700
|
+
} finally {
|
|
701
|
+
if (_didIteratorError) throw _iteratorError;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
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
|
+
];
|
|
840
718
|
}
|
|
841
719
|
var effectiveTransition = (_styleState_style = styleState.style) === null || _styleState_style === void 0 ? void 0 : _styleState_style.transition;
|
|
842
720
|
if (effectiveTransition != null && styleState.style && true) delete styleState.style.transition;
|
|
@@ -845,21 +723,18 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
845
723
|
if ("containerName" in styleState.style) delete styleState.style.containerName;
|
|
846
724
|
}
|
|
847
725
|
if (!(noNormalize === false)) {
|
|
848
|
-
if (styleState.style)
|
|
849
|
-
fixStyles(styleState.style);
|
|
850
|
-
if (!noExpand && !noMergeStyle) {}
|
|
851
|
-
}
|
|
726
|
+
if (styleState.style) fixStyles(styleState.style);
|
|
852
727
|
if (styleState.transformAccumulator && !styleState.flatShouldDoClasses) {
|
|
853
728
|
var _styleState;
|
|
854
729
|
(_styleState = styleState).style || (_styleState.style = {});
|
|
855
730
|
styleState.style.transform = finalizeTransformAccumulator(styleState.transformAccumulator);
|
|
856
731
|
}
|
|
857
732
|
if (parentSplitStyles) {
|
|
858
|
-
if (!shouldDoClasses) for (var
|
|
733
|
+
if (!shouldDoClasses) for (var key5 in parentSplitStyles.style) {
|
|
859
734
|
var _styleState1;
|
|
860
|
-
if (
|
|
735
|
+
if (key5 in classNames || styleState.style && key5 in styleState.style) continue;
|
|
861
736
|
(_styleState1 = styleState).style || (_styleState1.style = {});
|
|
862
|
-
styleState.style[
|
|
737
|
+
styleState.style[key5] = parentSplitStyles.style[key5];
|
|
863
738
|
}
|
|
864
739
|
}
|
|
865
740
|
}
|
|
@@ -888,9 +763,9 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
888
763
|
if (shouldTrackStyleTokenProvenance && styleState.style && styleState.tokenProvenance) {
|
|
889
764
|
var provenance = {};
|
|
890
765
|
var hasProvenance = false;
|
|
891
|
-
for (var
|
|
892
|
-
provenance[
|
|
893
|
-
token: styleState.tokenProvenance[
|
|
766
|
+
for (var key6 in styleState.tokenProvenance) {
|
|
767
|
+
provenance[key6] = {
|
|
768
|
+
token: styleState.tokenProvenance[key6],
|
|
894
769
|
theme: themeName
|
|
895
770
|
};
|
|
896
771
|
hasProvenance = true;
|
|
@@ -911,7 +786,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
911
786
|
if (effectiveTransition != null) result.effectiveTransition = effectiveTransition;
|
|
912
787
|
if (conditionalStates) result.programStates = conditionalStates;
|
|
913
788
|
if (usesSafeArea) result.usesSafeArea = true;
|
|
914
|
-
if (
|
|
789
|
+
if (styleState.flatDynamicThemeAccess) result.dynamicThemeAccess = true;
|
|
915
790
|
if (styleState.flatEnterKeys || styleState.flatExitKeys) result.programLifecycleStyleKeys = {
|
|
916
791
|
enter: effectiveLifecycleKeys(styleState.flatEnterKeys),
|
|
917
792
|
exit: effectiveLifecycleKeys(styleState.flatExitKeys)
|
|
@@ -941,7 +816,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
941
816
|
rulesToInsert,
|
|
942
817
|
parentSplitStyles
|
|
943
818
|
};
|
|
944
|
-
for (var
|
|
819
|
+
for (var key8 in logs) log(key8, logs[key8]);
|
|
945
820
|
} catch (e) {}
|
|
946
821
|
console.groupEnd();
|
|
947
822
|
}
|
|
@@ -949,6 +824,36 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
|
|
|
949
824
|
if (process.env.NODE_ENV === "development" && (debug === "profile" || globalThis.time)) time`split-styles-done`;
|
|
950
825
|
return result;
|
|
951
826
|
};
|
|
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
|
+
}
|
|
952
857
|
function mergeStyle(styleState, key, val) {
|
|
953
858
|
arguments.length > 3 && arguments[3] !== void 0 && arguments[3];
|
|
954
859
|
var originalVal = arguments.length > 4 ? arguments[4] : void 0;
|
|
@@ -968,7 +873,7 @@ function mergeStyle(styleState, key, val) {
|
|
|
968
873
|
addTransformValue(styleState.transformAccumulator, key, val);
|
|
969
874
|
} else {
|
|
970
875
|
var out = val;
|
|
971
|
-
if (staticConfig.
|
|
876
|
+
if (staticConfig.isInput && key in nativeTextInputColorProps) viewProps[nativeTextInputColorProps[key]] = out;
|
|
972
877
|
else {
|
|
973
878
|
var _styleState2;
|
|
974
879
|
(_styleState2 = styleState).style || (_styleState2.style = {});
|
|
@@ -992,7 +897,7 @@ function recordStyleTokenProvenance(styleState, key, originalVal) {
|
|
|
992
897
|
((_styleState = styleState).tokenProvenance || (_styleState.tokenProvenance = {}))[key] = originalVal;
|
|
993
898
|
} else if (styleState.tokenProvenance && key in styleState.tokenProvenance) delete styleState.tokenProvenance[key];
|
|
994
899
|
}
|
|
995
|
-
var
|
|
900
|
+
var resolveStyleObject = function(styleState, styleIn) {
|
|
996
901
|
var { conf, styleProps } = styleState;
|
|
997
902
|
var styleOut = {};
|
|
998
903
|
var originalValues;
|
|
@@ -1005,12 +910,9 @@ var resolveAcceptedStyle = function(styleState, styleIn) {
|
|
|
1005
910
|
style: styleOut,
|
|
1006
911
|
transformAccumulator: void 0
|
|
1007
912
|
};
|
|
1008
|
-
childState.flatUsed = void 0;
|
|
1009
|
-
childState.flatTransitions = void 0;
|
|
1010
913
|
childState.flatAtomics = void 0;
|
|
1011
|
-
childState.flatSingleEntries = void 0;
|
|
1012
914
|
childState.flatSlots = void 0;
|
|
1013
|
-
childState.
|
|
915
|
+
childState.flatPropertyLayers = void 0;
|
|
1014
916
|
var mergeAccepted = function(_state, key2, value2, disableNormalize, originalValue) {
|
|
1015
917
|
styleOut[key2] = disableNormalize || styleProps.noNormalize ? value2 : normalizeValueWithProperty(value2, key2);
|
|
1016
918
|
var _styleInOriginalValues_key;
|
|
@@ -1021,92 +923,63 @@ var resolveAcceptedStyle = function(styleState, styleIn) {
|
|
|
1021
923
|
var value = styleIn[key];
|
|
1022
924
|
key = conf.shorthands[key] || key;
|
|
1023
925
|
if (key in skipProps || value == null) continue;
|
|
1024
|
-
contributeValue(childState, key, value
|
|
926
|
+
contributeValue(childState, key, value);
|
|
1025
927
|
}
|
|
1026
|
-
|
|
928
|
+
completeResolvedStyles(childState, mergeAccepted);
|
|
1027
929
|
if (childState.transformAccumulator) styleOut.transform = finalizeTransformAccumulator(childState.transformAccumulator);
|
|
1028
930
|
if (!styleProps.noNormalize) fixStyles(styleOut);
|
|
1029
931
|
if (originalValues) styleOriginalValues.set(styleOut, originalValues);
|
|
1030
932
|
return styleOut;
|
|
1031
933
|
};
|
|
1032
|
-
function passDownProp(viewProps, key, val) {
|
|
1033
|
-
if (key in viewProps) delete viewProps[key];
|
|
1034
|
-
viewProps[key] = val;
|
|
1035
|
-
}
|
|
1036
934
|
var frameSequence = 0;
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
for (var index = 0; index < transitions.length; index++) if (transitions[index][0] === property && transitions[index][3] === identity) {
|
|
1046
|
-
transitions[index][1] = value;
|
|
1047
|
-
transitions[index][2] = condition;
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
transitions.push([
|
|
1051
|
-
property,
|
|
1052
|
-
value,
|
|
1053
|
-
condition,
|
|
1054
|
-
identity,
|
|
1055
|
-
cursor ? conditionTexts[cursor + conditionSelectorOffset] || "" : "",
|
|
1056
|
-
cursor ? conditionWrappers : void 0,
|
|
1057
|
-
cursor ? conditionNumbers[cursor + conditionWrapperOffset] >> 3 : 0,
|
|
1058
|
-
cursor ? conditionNumbers[cursor + conditionWrapperOffset] & 7 : 0
|
|
1059
|
-
]);
|
|
1060
|
-
return;
|
|
1061
|
-
}
|
|
1062
|
-
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, false, original);
|
|
1063
|
-
}
|
|
1064
|
-
function streamWriteInline(state, property, value, cursor, merge, original) {
|
|
1065
|
-
var normalize = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false, conditionOverride = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : -1;
|
|
1066
|
-
var _direct;
|
|
1067
|
-
var direct = state;
|
|
1068
|
-
var condition = conditionOverride !== -1 ? conditionOverride : cursor ? conditionNumbers[cursor + conditionValueOffset] : 0;
|
|
1069
|
-
var importance = condition ? Math.floor(condition / 256) + 1 : 0;
|
|
1070
|
-
var used = (_direct = direct).flatUsed || (_direct.flatUsed = {});
|
|
1071
|
-
var previous = used[property];
|
|
1072
|
-
if (previous !== void 0 && previous > importance) return;
|
|
1073
|
-
used[property] = importance;
|
|
1074
|
-
merge(state, property, value, !normalize, original);
|
|
1075
|
-
}
|
|
1076
|
-
function streamRetractInline(state, property, cursor) {
|
|
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;
|
|
1077
943
|
var _direct;
|
|
1078
|
-
var
|
|
1079
|
-
var
|
|
1080
|
-
var
|
|
1081
|
-
var
|
|
1082
|
-
var
|
|
1083
|
-
if (
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
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;
|
|
1095
964
|
}
|
|
1096
|
-
};
|
|
1097
|
-
var slots = direct.flatSlots;
|
|
1098
|
-
if (slots) {
|
|
1099
|
-
direct.flatSlots = void 0;
|
|
1100
|
-
for (var property in slots) consume(slots[property]);
|
|
1101
|
-
}
|
|
1102
|
-
var transitions = direct.flatTransitions;
|
|
1103
|
-
if (transitions) {
|
|
1104
|
-
direct.flatTransitions = void 0;
|
|
1105
|
-
consume(transitions);
|
|
1106
965
|
}
|
|
1107
|
-
|
|
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
|
+
]);
|
|
976
|
+
}
|
|
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);
|
|
1108
980
|
}
|
|
1109
|
-
function
|
|
981
|
+
function completeResolvedStyles(state) {
|
|
982
|
+
var merge = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : mergeStyle;
|
|
1110
983
|
var direct = state;
|
|
1111
984
|
var shadow = direct.flatWebShadow;
|
|
1112
985
|
if (shadow && (direct.flatBoxShadowSequence || 0) <= shadow[4]) {
|
|
@@ -1118,275 +991,116 @@ function completeStreaming(state, merge) {
|
|
|
1118
991
|
var color = normalizeColor(shadow[0], (_shadow_ = shadow[2]) !== null && _shadow_ !== void 0 ? _shadow_ : 1);
|
|
1119
992
|
if (color) {
|
|
1120
993
|
var next = `${shadowUnit(offset.width)} ${shadowUnit(offset.height)} ${shadowUnit(shadow[3])} ${color}`;
|
|
1121
|
-
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;
|
|
1122
1049
|
}
|
|
1123
1050
|
}
|
|
1124
|
-
|
|
1051
|
+
direct.flatSlots = void 0;
|
|
1125
1052
|
}
|
|
1126
|
-
function emitAtParentCondition(state, property, value,
|
|
1053
|
+
function emitAtParentCondition(state, property, value, originalValue, contextOnly) {
|
|
1127
1054
|
var _state_flatPass;
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
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}"`);
|
|
1134
1063
|
return 0;
|
|
1135
1064
|
}
|
|
1136
|
-
|
|
1137
|
-
if (
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
var flags = conditionNumbers[cursor + conditionFlagsOffset];
|
|
1141
|
-
if (flags & conditionEnterFlag) state.flatHasEnterStyle = true;
|
|
1142
|
-
if (flags & conditionPlatformPseudoFlag) state.flatHasPlatformPseudo = true;
|
|
1143
|
-
} else if (merge && property && condition & 2) {
|
|
1144
|
-
var flags1 = conditionNumbers[cursor + conditionFlagsOffset];
|
|
1145
|
-
if (flags1 & conditionEnterFlag) state.flatHasEnterStyle = true;
|
|
1146
|
-
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;
|
|
1147
1069
|
}
|
|
1148
1070
|
return condition;
|
|
1149
1071
|
}
|
|
1150
|
-
var
|
|
1151
|
-
|
|
1152
|
-
if (isBase) {
|
|
1153
|
-
if (start === end) return;
|
|
1154
|
-
if (!valid) {
|
|
1155
|
-
if (failure === "invalid-character" || failure === "stray-comment-close") return 16;
|
|
1156
|
-
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, failure === "unterminated-string" ? "an unterminated string" : failure === "unterminated-comment" ? "an unterminated \"/*\" comment" : "an unterminated \"(\"");
|
|
1157
|
-
return;
|
|
1158
|
-
}
|
|
1159
|
-
var value = source.slice(start, end);
|
|
1160
|
-
emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
1161
|
-
return 5;
|
|
1162
|
-
}
|
|
1163
|
-
if (!chainValid) {
|
|
1164
|
-
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 \"(\"");
|
|
1165
|
-
return;
|
|
1166
|
-
}
|
|
1167
|
-
if (start === end) {
|
|
1168
|
-
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, "a conditional clause has no value");
|
|
1169
|
-
return;
|
|
1170
|
-
}
|
|
1171
|
-
if (property === "aspectRatio" && chainCount === 1) {
|
|
1172
|
-
var left = Number(source.slice(chainStart, chainEnd));
|
|
1173
|
-
var right = Number(source.slice(start, end));
|
|
1174
|
-
if (chainStart < chainEnd && Number.isFinite(left) && left > 0 && Number.isFinite(right) && right > 0) return 12;
|
|
1175
|
-
}
|
|
1176
|
-
var cursor = state.flatScanCursor;
|
|
1177
|
-
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;
|
|
1178
|
-
if (!condition) return;
|
|
1179
|
-
if (!valid) {
|
|
1180
|
-
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 \"(\"");
|
|
1181
|
-
return;
|
|
1182
|
-
}
|
|
1183
|
-
return 4 | (condition & 12 ? 2 : 0);
|
|
1184
|
-
},
|
|
1185
|
-
modifier(state, start, end, valid, first, source) {
|
|
1186
|
-
var directState = state;
|
|
1187
|
-
var cursor = directState.flatScanCursor;
|
|
1188
|
-
if (!cursor) {
|
|
1189
|
-
var _directState_flatPass;
|
|
1190
|
-
cursor = directState.flatScanCursor = acquireConditionCursor(((_directState_flatPass = directState.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null);
|
|
1191
|
-
} else if (first) {
|
|
1192
|
-
var _directState_flatPass1;
|
|
1193
|
-
resetConditionCursor(cursor, ((_directState_flatPass1 = directState.flatPass) === null || _directState_flatPass1 === void 0 ? void 0 : _directState_flatPass1[passParentCursor]) || null);
|
|
1194
|
-
}
|
|
1195
|
-
if (!valid) {
|
|
1196
|
-
setConditionUnresolved(cursor);
|
|
1197
|
-
return;
|
|
1198
|
-
}
|
|
1199
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(state, cursor, source.slice(start, end));
|
|
1200
|
-
},
|
|
1201
|
-
chain(state, _start, _end, valid) {
|
|
1202
|
-
var cursor = state.flatScanCursor;
|
|
1203
|
-
if (cursor) {
|
|
1204
|
-
if (!valid) setConditionUnresolved(cursor);
|
|
1205
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(state, cursor);
|
|
1206
|
-
}
|
|
1207
|
-
return true;
|
|
1208
|
-
},
|
|
1209
|
-
end(state, source, result, lastPayloadStart, chainCount, property, merge, originalValue, contextOnly, failure, failureIndex) {
|
|
1210
|
-
var hasBase = !!(result & 1);
|
|
1211
|
-
if (result & 16) {
|
|
1212
|
-
if (chainCount === 0) {
|
|
1213
|
-
emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1214
|
-
hasBase = true;
|
|
1215
|
-
} 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 \"(\"");
|
|
1216
|
-
}
|
|
1217
|
-
if (result & 8 && chainCount === 1) {
|
|
1218
|
-
emitAtParentCondition(state, property, source, merge, originalValue !== null && originalValue !== void 0 ? originalValue : source, contextOnly);
|
|
1219
|
-
hasBase = true;
|
|
1220
|
-
}
|
|
1221
|
-
if (process.env.NODE_ENV === "development" && !hasBase && result & 4 && property in propToTokenCategoryCode && splitComponents(source.slice(lastPayloadStart)).length > 1) warnOnce(`${property}="${source}" has multiple values after its first conditional. Write the base value before the first conditional.`);
|
|
1222
|
-
if ((!canGenerateCSS || !state.flatShouldDoClasses) && result & 2 && !hasBase) {
|
|
1223
|
-
var value = implicitLifecycleBase(property);
|
|
1224
|
-
if (value !== null) emitAtParentCondition(state, property, value, merge, value, contextOnly);
|
|
1225
|
-
}
|
|
1226
|
-
}
|
|
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 \"(\"";
|
|
1227
1074
|
};
|
|
1228
|
-
function
|
|
1229
|
-
|
|
1230
|
-
}
|
|
1231
|
-
var legacyTransformParts = /* @__PURE__ */ new Set([
|
|
1232
|
-
"matrix",
|
|
1233
|
-
"perspective",
|
|
1234
|
-
"rotateX",
|
|
1235
|
-
"rotateY",
|
|
1236
|
-
"rotateZ",
|
|
1237
|
-
"scaleZ",
|
|
1238
|
-
"skewX",
|
|
1239
|
-
"skewY"
|
|
1240
|
-
]);
|
|
1241
|
-
var webShadowParts = {
|
|
1242
|
-
shadowColor: 1,
|
|
1243
|
-
shadowOffset: 2,
|
|
1244
|
-
shadowOpacity: 3,
|
|
1245
|
-
shadowRadius: 4
|
|
1075
|
+
var warnScanFailure = function(property, source, failure, failureIndex) {
|
|
1076
|
+
if (process.env.NODE_ENV === "development") warnRefusedValue(property, source, formatScanFailure(failure, source, failureIndex));
|
|
1246
1077
|
};
|
|
1247
|
-
var webTextShadowParts = /* @__PURE__ */ new Set([
|
|
1248
|
-
"textShadowColor",
|
|
1249
|
-
"textShadowOffset",
|
|
1250
|
-
"textShadowRadius"
|
|
1251
|
-
]);
|
|
1252
|
-
var lineStyles = /* @__PURE__ */ new Set([
|
|
1253
|
-
"none",
|
|
1254
|
-
"hidden",
|
|
1255
|
-
"dotted",
|
|
1256
|
-
"dashed",
|
|
1257
|
-
"solid",
|
|
1258
|
-
"double",
|
|
1259
|
-
"groove",
|
|
1260
|
-
"ridge",
|
|
1261
|
-
"inset",
|
|
1262
|
-
"outset"
|
|
1263
|
-
]);
|
|
1264
1078
|
var borderTargets = {
|
|
1265
|
-
border:
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
color: [
|
|
1279
|
-
"borderTopColor",
|
|
1280
|
-
"borderRightColor",
|
|
1281
|
-
"borderBottomColor",
|
|
1282
|
-
"borderLeftColor"
|
|
1283
|
-
]
|
|
1284
|
-
},
|
|
1285
|
-
borderTop: {
|
|
1286
|
-
width: ["borderTopWidth"],
|
|
1287
|
-
style: ["borderTopStyle"],
|
|
1288
|
-
color: ["borderTopColor"]
|
|
1289
|
-
},
|
|
1290
|
-
borderRight: {
|
|
1291
|
-
width: ["borderRightWidth"],
|
|
1292
|
-
style: ["borderRightStyle"],
|
|
1293
|
-
color: ["borderRightColor"]
|
|
1294
|
-
},
|
|
1295
|
-
borderBottom: {
|
|
1296
|
-
width: ["borderBottomWidth"],
|
|
1297
|
-
style: ["borderBottomStyle"],
|
|
1298
|
-
color: ["borderBottomColor"]
|
|
1299
|
-
},
|
|
1300
|
-
borderLeft: {
|
|
1301
|
-
width: ["borderLeftWidth"],
|
|
1302
|
-
style: ["borderLeftStyle"],
|
|
1303
|
-
color: ["borderLeftColor"]
|
|
1304
|
-
},
|
|
1305
|
-
outline: {
|
|
1306
|
-
width: ["outlineWidth"],
|
|
1307
|
-
style: ["outlineStyle"],
|
|
1308
|
-
color: ["outlineColor"]
|
|
1309
|
-
},
|
|
1310
|
-
borderBlock: {
|
|
1311
|
-
width: ["borderBlockStartWidth", "borderBlockEndWidth"],
|
|
1312
|
-
style: ["borderBlockStartStyle", "borderBlockEndStyle"],
|
|
1313
|
-
color: ["borderBlockStartColor", "borderBlockEndColor"]
|
|
1314
|
-
},
|
|
1315
|
-
borderInline: {
|
|
1316
|
-
width: ["borderInlineStartWidth", "borderInlineEndWidth"],
|
|
1317
|
-
style: ["borderInlineStartStyle", "borderInlineEndStyle"],
|
|
1318
|
-
color: ["borderInlineStartColor", "borderInlineEndColor"]
|
|
1319
|
-
}
|
|
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"]
|
|
1320
1092
|
};
|
|
1321
|
-
var
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
};
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
tokenLookup.fromTheme = fromTheme;
|
|
1329
|
-
tokenLookup.themeKey = themeKey;
|
|
1330
|
-
return tokenLookup;
|
|
1331
|
-
}
|
|
1332
|
-
function tokenVariable(state, property, name) {
|
|
1333
|
-
var _state_theme, _state_conf_themes_, _state_conf_themes, _state_conf_tokensParsed_space, _state_conf_tokensParsed_color;
|
|
1334
|
-
var lookupName = name.charCodeAt(0) === 36 ? name.slice(1) : name;
|
|
1335
|
-
if (property === "fontFamily") {
|
|
1336
|
-
var _state_conf_fontsParsed_lookupName;
|
|
1337
|
-
var family = (_state_conf_fontsParsed_lookupName = state.conf.fontsParsed[lookupName]) === null || _state_conf_fontsParsed_lookupName === void 0 ? void 0 : _state_conf_fontsParsed_lookupName.family;
|
|
1338
|
-
return family ? fillTokenLookup(family, false, lookupName) : void 0;
|
|
1339
|
-
}
|
|
1340
|
-
var fontKey = property === "fontSize" ? "size" : property === "fontWeight" ? "weight" : property === "lineHeight" || property === "letterSpacing" ? property : void 0;
|
|
1341
|
-
if (fontKey) {
|
|
1342
|
-
var _font_fontKey;
|
|
1343
|
-
var font = state.conf.fontsParsed[state.fontFamily || state.conf.defaultFontToken] || state.conf.fontsParsed[state.conf.defaultFontToken];
|
|
1344
|
-
var value = font === null || font === void 0 ? void 0 : (_font_fontKey = font[fontKey]) === null || _font_fontKey === void 0 ? void 0 : _font_fontKey[lookupName];
|
|
1345
|
-
return value ? fillTokenLookup(value, false, lookupName) : void 0;
|
|
1346
|
-
}
|
|
1347
|
-
var category = getTokenCategoryForProperty(property);
|
|
1348
|
-
var dot = lookupName.indexOf(".");
|
|
1349
|
-
if (dot !== -1) {
|
|
1350
|
-
var prefix = lookupName.slice(0, dot);
|
|
1351
|
-
if (!category || prefix === category || prefix === "color") lookupName = lookupName.slice(dot + 1);
|
|
1352
|
-
}
|
|
1353
|
-
if (category) {
|
|
1354
|
-
var _state_conf_tokensParsed_category;
|
|
1355
|
-
var own = (_state_conf_tokensParsed_category = state.conf.tokensParsed[category]) === null || _state_conf_tokensParsed_category === void 0 ? void 0 : _state_conf_tokensParsed_category[lookupName];
|
|
1356
|
-
if (own) return fillTokenLookup(own, false, lookupName);
|
|
1357
|
-
} else {
|
|
1358
|
-
var first = lookupName.charCodeAt(0);
|
|
1359
|
-
if (first >= 48 && first <= 57 || first === 43 || first === 45 || first === 46) return;
|
|
1360
|
-
}
|
|
1361
|
-
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]);
|
|
1362
|
-
if (theme) return fillTokenLookup(theme, true, lookupName);
|
|
1363
|
-
if (category) return;
|
|
1364
|
-
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]);
|
|
1365
|
-
return token ? fillTokenLookup(token, false, lookupName) : void 0;
|
|
1366
|
-
}
|
|
1367
|
-
var literalMissConf = null;
|
|
1368
|
-
var literalMissRevision = -1;
|
|
1369
|
-
var literalMisses = /* @__PURE__ */ new WeakMap();
|
|
1370
|
-
var literalMissRootTheme = {};
|
|
1371
|
-
function isFontKeyedProperty(property) {
|
|
1372
|
-
return property === "fontFamily" || property === "fontSize" || property === "fontWeight" || property === "lineHeight" || property === "letterSpacing";
|
|
1373
|
-
}
|
|
1374
|
-
function literalMissSet(state) {
|
|
1375
|
-
var revision = getConfigRevisionState(state.conf).revision;
|
|
1376
|
-
if (state.conf !== literalMissConf || revision !== literalMissRevision) {
|
|
1377
|
-
literalMissConf = state.conf;
|
|
1378
|
-
literalMissRevision = revision;
|
|
1379
|
-
literalMisses = /* @__PURE__ */ new WeakMap();
|
|
1380
|
-
}
|
|
1381
|
-
var themeKey = state.theme && _type_of(state.theme) === "object" ? state.theme : literalMissRootTheme;
|
|
1382
|
-
var set = literalMisses.get(themeKey);
|
|
1383
|
-
if (!set) {
|
|
1384
|
-
set = /* @__PURE__ */ new Set();
|
|
1385
|
-
literalMisses.set(themeKey, set);
|
|
1386
|
-
}
|
|
1387
|
-
return set;
|
|
1388
|
-
}
|
|
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();
|
|
1389
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);
|
|
1390
1104
|
var name = raw;
|
|
1391
1105
|
var opacity;
|
|
1392
1106
|
var slash = raw.lastIndexOf("/");
|
|
@@ -1397,157 +1111,142 @@ function configuredValue(state, property, raw) {
|
|
|
1397
1111
|
opacity = amount;
|
|
1398
1112
|
}
|
|
1399
1113
|
}
|
|
1400
|
-
var safeArea =
|
|
1114
|
+
var safeArea = grammar.safeAreaVariable(name);
|
|
1401
1115
|
if (safeArea !== void 0) {
|
|
1402
1116
|
state.flatUsesSafeArea = true;
|
|
1403
1117
|
return safeArea;
|
|
1404
1118
|
}
|
|
1405
|
-
var
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
misses = literalMissSet(state);
|
|
1410
|
-
missKey = `${state.flatThemeName || ""}${property}${name}`;
|
|
1411
|
-
if (misses.has(missKey)) 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);
|
|
1412
1123
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
if (misses) misses.add(missKey);
|
|
1421
|
-
return raw;
|
|
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;
|
|
1422
1131
|
}
|
|
1423
1132
|
var resolveValues = state.styleProps.resolveValues;
|
|
1424
|
-
|
|
1425
|
-
var
|
|
1426
|
-
if (
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
continue;
|
|
1443
|
-
}
|
|
1444
|
-
if (!(code === 36 || code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122)) continue;
|
|
1445
|
-
var end = index + 1;
|
|
1446
|
-
while (end < raw.length) {
|
|
1447
|
-
var next = raw.charCodeAt(end);
|
|
1448
|
-
if (next === 36 || next === 45 || next === 46 || next === 95 || next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122) end++;
|
|
1449
|
-
else break;
|
|
1450
|
-
}
|
|
1451
|
-
if (raw.charCodeAt(end) === 47) {
|
|
1452
|
-
var suffix = end + 1;
|
|
1453
|
-
while (suffix < raw.length) {
|
|
1454
|
-
var next1 = raw.charCodeAt(suffix);
|
|
1455
|
-
if (next1 < 48 || next1 > 57) break;
|
|
1456
|
-
suffix++;
|
|
1457
|
-
}
|
|
1458
|
-
if (suffix > end + 1) end = suffix;
|
|
1459
|
-
}
|
|
1460
|
-
var before = raw.charCodeAt(index - 1);
|
|
1461
|
-
if (code !== 36 && (before >= 48 && before <= 57 || before === 35 || before === 45 && raw.charCodeAt(index - 2) === 45 || raw.charCodeAt(end) === 40)) {
|
|
1462
|
-
index = end - 1;
|
|
1463
|
-
continue;
|
|
1464
|
-
}
|
|
1465
|
-
var word = raw.slice(index, end);
|
|
1466
|
-
var value = configuredValue(state, property, word);
|
|
1467
|
-
if (value !== word) {
|
|
1468
|
-
out += raw.slice(copyFrom, index);
|
|
1469
|
-
out += String(value);
|
|
1470
|
-
copyFrom = end;
|
|
1471
|
-
}
|
|
1472
|
-
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;
|
|
1473
1151
|
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
depth++;
|
|
1494
|
-
continue;
|
|
1495
|
-
}
|
|
1496
|
-
if (code === 41) {
|
|
1497
|
-
depth--;
|
|
1498
|
-
continue;
|
|
1499
|
-
}
|
|
1500
|
-
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;
|
|
1501
|
-
var end = index + 1;
|
|
1502
|
-
while (end < raw.length) {
|
|
1503
|
-
var next = raw.charCodeAt(end);
|
|
1504
|
-
if (next >= 48 && next <= 57 || next >= 65 && next <= 90 || next >= 97 && next <= 122 || next === 45 || next === 95) end++;
|
|
1505
|
-
else break;
|
|
1506
|
-
}
|
|
1507
|
-
if (raw.charCodeAt(end) !== 40) {
|
|
1508
|
-
var authored = raw.slice(index, end);
|
|
1509
|
-
var property = state.conf.shorthands[authored] || authored;
|
|
1510
|
-
if (property === "x" || property === "y") property = "translate";
|
|
1511
|
-
else if (property === "scaleX" || property === "scaleY") property = "scale";
|
|
1512
|
-
else if (legacyTransformParts.has(property)) property = "transform";
|
|
1513
|
-
var hasUpper = false;
|
|
1514
|
-
for (var offset = 0; offset < property.length; offset++) {
|
|
1515
|
-
var letter = property.charCodeAt(offset);
|
|
1516
|
-
if (letter >= 65 && letter <= 90) {
|
|
1517
|
-
hasUpper = true;
|
|
1518
|
-
break;
|
|
1519
|
-
}
|
|
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);
|
|
1520
1171
|
}
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
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
|
+
}
|
|
1526
1183
|
}
|
|
1527
|
-
copyFrom = end;
|
|
1528
1184
|
}
|
|
1529
1185
|
}
|
|
1530
|
-
index = end - 1;
|
|
1531
1186
|
}
|
|
1532
|
-
|
|
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;
|
|
1533
1215
|
}
|
|
1534
|
-
function
|
|
1535
|
-
|
|
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;
|
|
1536
1233
|
}
|
|
1537
|
-
function emitProperty(state, property, value, cursor,
|
|
1234
|
+
function emitProperty(state, property, value, cursor, originalValue, contextOnly) {
|
|
1538
1235
|
var _state_animationDriver;
|
|
1539
1236
|
var _state, _state1;
|
|
1237
|
+
if (!ownsSourceLayer(state, property, cursor !== null)) return;
|
|
1540
1238
|
var direct = state;
|
|
1541
|
-
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;
|
|
1542
1241
|
if (condition & 4) ((_state = state).flatEnterKeys || (_state.flatEnterKeys = /* @__PURE__ */ new Set())).add(property);
|
|
1543
1242
|
if (condition & 8) ((_state1 = state).flatExitKeys || (_state1.flatExitKeys = /* @__PURE__ */ new Set())).add(property);
|
|
1544
|
-
var theme = cursor ?
|
|
1243
|
+
var theme = cursor ? cursor[conditionTheme] : "";
|
|
1545
1244
|
if (theme) {
|
|
1546
1245
|
if (supportsDynamicColorIOS && isColorStyleKey(property)) {
|
|
1547
1246
|
var _direct, _ref, _property;
|
|
1548
1247
|
var schemes = (_ref = (_direct = direct).flatDynamicColors || (_direct.flatDynamicColors = {}))[_property = property] || (_ref[_property] = {});
|
|
1549
|
-
schemes[theme] = typeof originalValue === "string" &&
|
|
1550
|
-
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);
|
|
1551
1250
|
return;
|
|
1552
1251
|
}
|
|
1553
1252
|
direct.flatDynamicThemeAccess = true;
|
|
@@ -1562,20 +1261,20 @@ function emitProperty(state, property, value, cursor, merge, originalValue, cont
|
|
|
1562
1261
|
if (canGenerateCSS && state.flatShouldDoClasses && !condition && property === "transform") {
|
|
1563
1262
|
var _state4;
|
|
1564
1263
|
if (process.env.NODE_ENV === "development" && state.transformAccumulator) {
|
|
1565
|
-
var
|
|
1264
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
1566
1265
|
try {
|
|
1567
|
-
for (var
|
|
1568
|
-
var
|
|
1569
|
-
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`);
|
|
1570
1269
|
}
|
|
1571
1270
|
} catch (err) {
|
|
1572
|
-
|
|
1573
|
-
|
|
1271
|
+
_didIteratorError = true;
|
|
1272
|
+
_iteratorError = err;
|
|
1574
1273
|
} finally {
|
|
1575
1274
|
try {
|
|
1576
|
-
if (!
|
|
1275
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1577
1276
|
} finally {
|
|
1578
|
-
if (
|
|
1277
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1579
1278
|
}
|
|
1580
1279
|
}
|
|
1581
1280
|
}
|
|
@@ -1585,42 +1284,10 @@ function emitProperty(state, property, value, cursor, merge, originalValue, cont
|
|
|
1585
1284
|
}
|
|
1586
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;
|
|
1587
1286
|
if (canGenerateCSS && (state.flatShouldDoClasses || shouldPromoteAnimatedStyle)) {
|
|
1588
|
-
|
|
1589
|
-
streamWriteCSS(state, property, value, cursor, originalValue);
|
|
1287
|
+
writeStyleRecord(state, property, value, cursor, originalValue, shouldPromoteAnimatedStyle ? recordCSS : 0);
|
|
1590
1288
|
return;
|
|
1591
1289
|
}
|
|
1592
|
-
|
|
1593
|
-
streamWriteInline(state, property, value, cursor, merge, originalValue);
|
|
1594
|
-
}
|
|
1595
|
-
function splitComponents(value) {
|
|
1596
|
-
var parts = [];
|
|
1597
|
-
var start = 0;
|
|
1598
|
-
var quote = 0;
|
|
1599
|
-
var depth = 0;
|
|
1600
|
-
for (var index = 0; index <= value.length; index++) {
|
|
1601
|
-
var code = index === value.length ? 32 : value.charCodeAt(index);
|
|
1602
|
-
if (quote) {
|
|
1603
|
-
if (code === 92) index++;
|
|
1604
|
-
else if (code === quote) quote = 0;
|
|
1605
|
-
continue;
|
|
1606
|
-
}
|
|
1607
|
-
if (code === 34 || code === 39) quote = code;
|
|
1608
|
-
else if (code === 40) depth++;
|
|
1609
|
-
else if (code === 41) depth--;
|
|
1610
|
-
else if (!depth && code <= 32) {
|
|
1611
|
-
if (index > start) parts.push(value.slice(start, index));
|
|
1612
|
-
start = index + 1;
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
return parts;
|
|
1616
|
-
}
|
|
1617
|
-
function isAsciiLetters(value) {
|
|
1618
|
-
if (!value) return false;
|
|
1619
|
-
for (var index = 0; index < value.length; index++) {
|
|
1620
|
-
var code = value.charCodeAt(index) | 32;
|
|
1621
|
-
if (code < 97 || code > 122) return false;
|
|
1622
|
-
}
|
|
1623
|
-
return true;
|
|
1290
|
+
streamWriteInline(state, property, value, cursor, originalValue);
|
|
1624
1291
|
}
|
|
1625
1292
|
function numericUnitValue(value, first, second) {
|
|
1626
1293
|
var unitLength = value.endsWith(first) || second !== void 0 && value.endsWith(second) ? first.length : 0;
|
|
@@ -1628,381 +1295,207 @@ function numericUnitValue(value, first, second) {
|
|
|
1628
1295
|
var numeric = Number(value.slice(0, value.length - unitLength));
|
|
1629
1296
|
return Number.isFinite(numeric) ? numeric : NaN;
|
|
1630
1297
|
}
|
|
1631
|
-
function
|
|
1632
|
-
var index = 0;
|
|
1633
|
-
if (value.charCodeAt(index) === 43 || value.charCodeAt(index) === 45) index++;
|
|
1634
|
-
var digits = 0;
|
|
1635
|
-
var dot = false;
|
|
1636
|
-
for (; index < value.length; index++) {
|
|
1637
|
-
var code = value.charCodeAt(index);
|
|
1638
|
-
if (code >= 48 && code <= 57) {
|
|
1639
|
-
digits++;
|
|
1640
|
-
continue;
|
|
1641
|
-
}
|
|
1642
|
-
if (code === 46 && !dot) {
|
|
1643
|
-
dot = true;
|
|
1644
|
-
continue;
|
|
1645
|
-
}
|
|
1646
|
-
break;
|
|
1647
|
-
}
|
|
1648
|
-
if (!digits) return false;
|
|
1649
|
-
for (; index < value.length; index++) {
|
|
1650
|
-
var code1 = value.charCodeAt(index);
|
|
1651
|
-
if (code1 !== 37 && (code1 < 97 || code1 > 122)) return false;
|
|
1652
|
-
}
|
|
1653
|
-
return true;
|
|
1654
|
-
}
|
|
1655
|
-
function startsValueFunction(value) {
|
|
1656
|
-
var index = 0;
|
|
1657
|
-
while (index < value.length) {
|
|
1658
|
-
var code = value.charCodeAt(index);
|
|
1659
|
-
if (code === 45 || code >= 97 && code <= 122) {
|
|
1660
|
-
index++;
|
|
1661
|
-
continue;
|
|
1662
|
-
}
|
|
1663
|
-
break;
|
|
1664
|
-
}
|
|
1665
|
-
return index > 0 && value.charCodeAt(index) === 40;
|
|
1666
|
-
}
|
|
1667
|
-
function emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly) {
|
|
1298
|
+
function emitBorder(state, property, raw, cursor, originalValue, contextOnly) {
|
|
1668
1299
|
if (property === "borderBlock" || property === "borderInline") {
|
|
1669
1300
|
if (process.env.NODE_ENV === "development") warnOnce(`RN has no logical border shorthand "${property}"; dropping it`);
|
|
1670
1301
|
return;
|
|
1671
1302
|
}
|
|
1672
|
-
var width;
|
|
1673
|
-
var style;
|
|
1674
|
-
var color;
|
|
1675
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
1676
|
-
try {
|
|
1677
|
-
for (var _iterator2 = splitComponents(raw)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
1678
|
-
var part3 = _step2.value;
|
|
1679
|
-
if (lineStyles.has(part3) || property === "outline" && part3 === "auto") style = part3;
|
|
1680
|
-
else if (part3 === "thin" || part3 === "medium" || part3 === "thick" || isNumericCSSComponent(part3) || startsValueFunction(part3)) width = part3;
|
|
1681
|
-
else color = part3;
|
|
1682
|
-
}
|
|
1683
|
-
} catch (err) {
|
|
1684
|
-
_didIteratorError2 = true;
|
|
1685
|
-
_iteratorError2 = err;
|
|
1686
|
-
} finally {
|
|
1687
|
-
try {
|
|
1688
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
1689
|
-
} finally {
|
|
1690
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1303
|
+
var { width, style, color } = classifyBorderComponents(raw, property === "outline");
|
|
1693
1304
|
if (style === "none" && width === void 0) width = "0";
|
|
1694
|
-
var targets = borderTargets[property];
|
|
1695
1305
|
if (width !== void 0) {
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
var target2 = _step12.value;
|
|
1700
|
-
emitResolved(state, target2, width, cursor, merge, originalValue, contextOnly);
|
|
1701
|
-
}
|
|
1702
|
-
} catch (err) {
|
|
1703
|
-
_didIteratorError12 = true;
|
|
1704
|
-
_iteratorError12 = err;
|
|
1705
|
-
} finally {
|
|
1706
|
-
try {
|
|
1707
|
-
if (!_iteratorNormalCompletion12 && _iterator12.return != null) _iterator12.return();
|
|
1708
|
-
} finally {
|
|
1709
|
-
if (_didIteratorError12) throw _iteratorError12;
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
if (style !== void 0) {
|
|
1714
|
-
var styleTargets = property === "border" ? ["borderStyle"] : targets.style;
|
|
1715
|
-
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
1716
|
-
try {
|
|
1717
|
-
for (var _iterator22 = styleTargets[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
1718
|
-
var target1 = _step22.value;
|
|
1719
|
-
emitProperty(state, target1, style, cursor, merge, originalValue, contextOnly);
|
|
1720
|
-
}
|
|
1721
|
-
} catch (err) {
|
|
1722
|
-
_didIteratorError22 = true;
|
|
1723
|
-
_iteratorError22 = err;
|
|
1724
|
-
} finally {
|
|
1725
|
-
try {
|
|
1726
|
-
if (!_iteratorNormalCompletion22 && _iterator22.return != null) _iterator22.return();
|
|
1727
|
-
} finally {
|
|
1728
|
-
if (_didIteratorError22) throw _iteratorError22;
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
if (color !== void 0) {
|
|
1733
|
-
var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
1734
|
-
try {
|
|
1735
|
-
for (var _iterator3 = targets.color[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
1736
|
-
var target22 = _step3.value;
|
|
1737
|
-
emitResolved(state, target22, color, cursor, merge, originalValue, contextOnly);
|
|
1738
|
-
}
|
|
1739
|
-
} catch (err) {
|
|
1740
|
-
_didIteratorError3 = true;
|
|
1741
|
-
_iteratorError3 = err;
|
|
1742
|
-
} finally {
|
|
1743
|
-
try {
|
|
1744
|
-
if (!_iteratorNormalCompletion3 && _iterator3.return != null) _iterator3.return();
|
|
1745
|
-
} finally {
|
|
1746
|
-
if (_didIteratorError3) throw _iteratorError3;
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1306
|
+
if (width === "thin") width = "1px";
|
|
1307
|
+
else if (width === "medium") width = "3px";
|
|
1308
|
+
else if (width === "thick") width = "5px";
|
|
1749
1309
|
}
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
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;
|
|
1753
1314
|
try {
|
|
1754
|
-
for (var
|
|
1755
|
-
var
|
|
1756
|
-
|
|
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);
|
|
1757
1320
|
}
|
|
1758
1321
|
} catch (err) {
|
|
1759
|
-
|
|
1760
|
-
|
|
1322
|
+
_didIteratorError = true;
|
|
1323
|
+
_iteratorError = err;
|
|
1761
1324
|
} finally {
|
|
1762
1325
|
try {
|
|
1763
|
-
if (!
|
|
1326
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1764
1327
|
} finally {
|
|
1765
|
-
if (
|
|
1328
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1766
1329
|
}
|
|
1767
1330
|
}
|
|
1768
1331
|
}
|
|
1769
|
-
function
|
|
1770
|
-
|
|
1771
|
-
emitProperty(state, property, value, cursor, merge, originalValue, contextOnly);
|
|
1772
|
-
return;
|
|
1773
|
-
}
|
|
1774
|
-
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"];
|
|
1775
|
-
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;
|
|
1776
1334
|
try {
|
|
1777
|
-
for (var
|
|
1778
|
-
var
|
|
1779
|
-
|
|
1780
|
-
if (typeof targetValue === "number") {
|
|
1781
|
-
if (target2 === "--t-x" || target2 === "--t-y") targetValue = `${targetValue}px`;
|
|
1782
|
-
else if (target2 === "rotate") targetValue = `${targetValue}deg`;
|
|
1783
|
-
}
|
|
1784
|
-
emitProperty(state, target2, targetValue, cursor, merge, originalValue, contextOnly);
|
|
1785
|
-
if (target2 === "--t-x" || target2 === "--t-y") addComposition(state, "translate");
|
|
1786
|
-
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);
|
|
1787
1338
|
}
|
|
1788
1339
|
} catch (err) {
|
|
1789
|
-
|
|
1790
|
-
|
|
1340
|
+
_didIteratorError = true;
|
|
1341
|
+
_iteratorError = err;
|
|
1791
1342
|
} finally {
|
|
1792
1343
|
try {
|
|
1793
|
-
if (!
|
|
1344
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1794
1345
|
} finally {
|
|
1795
|
-
if (
|
|
1346
|
+
if (_didIteratorError) throw _iteratorError;
|
|
1796
1347
|
}
|
|
1797
1348
|
}
|
|
1798
1349
|
}
|
|
1799
|
-
function emitResolved(state, property, raw, cursor,
|
|
1800
|
-
var value = configuredValue(state, property, raw);
|
|
1801
|
-
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);
|
|
1802
1352
|
if (typeof value === "string") {
|
|
1803
1353
|
var unitValue = numericUnitValue(value, "px", "dp");
|
|
1804
1354
|
if (Number.isFinite(unitValue)) value = unitValue;
|
|
1805
1355
|
else if (value !== "" && Number.isFinite(Number(value))) value = Number(value);
|
|
1806
1356
|
}
|
|
1807
|
-
emitProperty(state, property, value, cursor,
|
|
1808
|
-
}
|
|
1809
|
-
var emitKindTransition = 1;
|
|
1810
|
-
var emitKindTransformPart = 2;
|
|
1811
|
-
var emitKindWebShadow = 3;
|
|
1812
|
-
var emitKindWebTextShadow = 4;
|
|
1813
|
-
var emitKindTransform = 5;
|
|
1814
|
-
var emitKindBorder = 6;
|
|
1815
|
-
var emitKindTextDecoration = 7;
|
|
1816
|
-
var emitKindBackground = 8;
|
|
1817
|
-
var emitKindAxis = 9;
|
|
1818
|
-
var emitKindBorderRadius = 10;
|
|
1819
|
-
var emitKindBorderWidth = 11;
|
|
1820
|
-
var emitValueKinds = {
|
|
1821
|
-
transition: emitKindTransition,
|
|
1822
|
-
transitionProperty: emitKindTransition,
|
|
1823
|
-
transform: emitKindTransform,
|
|
1824
|
-
textDecoration: emitKindTextDecoration,
|
|
1825
|
-
background: emitKindBackground,
|
|
1826
|
-
x: emitKindAxis,
|
|
1827
|
-
y: emitKindAxis,
|
|
1828
|
-
scale: emitKindAxis,
|
|
1829
|
-
scaleX: emitKindAxis,
|
|
1830
|
-
scaleY: emitKindAxis,
|
|
1831
|
-
rotate: emitKindAxis,
|
|
1832
|
-
borderRadius: emitKindBorderRadius,
|
|
1833
|
-
borderWidth: emitKindBorderWidth,
|
|
1834
|
-
borderTopWidth: emitKindBorderWidth,
|
|
1835
|
-
borderRightWidth: emitKindBorderWidth,
|
|
1836
|
-
borderBottomWidth: emitKindBorderWidth,
|
|
1837
|
-
borderLeftWidth: emitKindBorderWidth
|
|
1838
|
-
};
|
|
1839
|
-
var _iteratorNormalCompletion = true;
|
|
1840
|
-
var _didIteratorError = false;
|
|
1841
|
-
var _iteratorError = void 0;
|
|
1842
|
-
try {
|
|
1843
|
-
for (var _iterator = legacyTransformParts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
1844
|
-
var part = _step.value;
|
|
1845
|
-
emitValueKinds[part] = emitKindTransformPart;
|
|
1846
|
-
}
|
|
1847
|
-
} catch (err) {
|
|
1848
|
-
_didIteratorError = true;
|
|
1849
|
-
_iteratorError = err;
|
|
1850
|
-
} finally {
|
|
1851
|
-
try {
|
|
1852
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
1853
|
-
} finally {
|
|
1854
|
-
if (_didIteratorError) throw _iteratorError;
|
|
1855
|
-
}
|
|
1856
|
-
}
|
|
1857
|
-
for (var part1 in webShadowParts) emitValueKinds[part1] = emitKindWebShadow;
|
|
1858
|
-
var _iteratorNormalCompletion1 = true;
|
|
1859
|
-
var _didIteratorError1 = false;
|
|
1860
|
-
var _iteratorError1 = void 0;
|
|
1861
|
-
try {
|
|
1862
|
-
for (var _iterator1 = webTextShadowParts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
1863
|
-
var part2 = _step1.value;
|
|
1864
|
-
emitValueKinds[part2] = emitKindWebTextShadow;
|
|
1865
|
-
}
|
|
1866
|
-
} catch (err) {
|
|
1867
|
-
_didIteratorError1 = true;
|
|
1868
|
-
_iteratorError1 = err;
|
|
1869
|
-
} finally {
|
|
1870
|
-
try {
|
|
1871
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
1872
|
-
} finally {
|
|
1873
|
-
if (_didIteratorError1) throw _iteratorError1;
|
|
1874
|
-
}
|
|
1357
|
+
emitProperty(state, property, value, cursor, originalValue, contextOnly);
|
|
1875
1358
|
}
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
return typeof part3 === "number" ? `${part3}px` : part3 || "0px";
|
|
1359
|
+
function shadowUnit(part) {
|
|
1360
|
+
return typeof part === "number" ? `${part}px` : part || "0px";
|
|
1879
1361
|
}
|
|
1880
|
-
function emitValue(state, property, raw, cursor,
|
|
1881
|
-
var condition = cursor ?
|
|
1362
|
+
function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
|
|
1363
|
+
var condition = cursor ? cursor[conditionValue] : 0;
|
|
1364
|
+
var grammar = getConfigRevisionState(state.conf);
|
|
1882
1365
|
if (isVariable(raw)) raw = resolveVariableValue(property, raw, state.styleProps.resolveValues);
|
|
1883
|
-
|
|
1884
|
-
if (
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
case emitKindWebTextShadow: break;
|
|
1902
|
-
case emitKindTransform:
|
|
1903
|
-
if (canGenerateCSS && state.flatShouldDoClasses && Array.isArray(raw)) raw = transformsToString(raw);
|
|
1904
|
-
if (typeof raw === "string") {
|
|
1905
|
-
var transform = parseNativeTransform(raw);
|
|
1906
|
-
if (transform) {
|
|
1907
|
-
emitProperty(state, property, transform, cursor, merge, originalValue, contextOnly);
|
|
1908
|
-
return;
|
|
1909
|
-
}
|
|
1910
|
-
}
|
|
1911
|
-
break;
|
|
1912
|
-
case emitKindBorder:
|
|
1913
|
-
if (typeof raw === "string") {
|
|
1914
|
-
emitBorder(state, property, raw, cursor, merge, originalValue, contextOnly);
|
|
1915
|
-
return;
|
|
1916
|
-
}
|
|
1917
|
-
break;
|
|
1918
|
-
case emitKindTextDecoration:
|
|
1919
|
-
if (typeof raw === "string") {
|
|
1920
|
-
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);
|
|
1921
1384
|
return;
|
|
1922
1385
|
}
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
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);
|
|
1930
1413
|
}
|
|
1931
|
-
if (process.env.NODE_ENV === "development") warnOnce(`native background cannot represent "${raw}"; dropping it`);
|
|
1932
1414
|
return;
|
|
1933
1415
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
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`;
|
|
1945
1433
|
}
|
|
1946
|
-
|
|
1947
|
-
if (
|
|
1948
|
-
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");
|
|
1949
1437
|
}
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
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;
|
|
1958
1449
|
}
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
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);
|
|
1963
1456
|
}
|
|
1964
1457
|
if (canGenerateCSS && state.flatShouldDoClasses && property === "boxShadow" && !condition) {
|
|
1965
|
-
state.flatBoxShadow =
|
|
1458
|
+
state.flatBoxShadow = value3;
|
|
1966
1459
|
state.flatBoxShadowSequence = frameSequence + 1;
|
|
1967
1460
|
}
|
|
1968
|
-
if (typeof
|
|
1969
|
-
var parsed = parseNativeStyle(property,
|
|
1461
|
+
if (typeof value3 === "string" && (property === "backgroundImage" || property === "boxShadow" || property === "textShadow")) {
|
|
1462
|
+
var parsed = parseNativeStyle(property, value3);
|
|
1970
1463
|
if (parsed) {
|
|
1971
1464
|
if (property === "textShadow") {
|
|
1972
|
-
var
|
|
1465
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
1973
1466
|
try {
|
|
1974
|
-
for (var
|
|
1975
|
-
var [key, parsedValue] =
|
|
1976
|
-
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);
|
|
1977
1470
|
}
|
|
1978
1471
|
} catch (err) {
|
|
1979
|
-
|
|
1980
|
-
|
|
1472
|
+
_didIteratorError1 = true;
|
|
1473
|
+
_iteratorError1 = err;
|
|
1981
1474
|
} finally {
|
|
1982
1475
|
try {
|
|
1983
|
-
if (!
|
|
1476
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) _iterator1.return();
|
|
1984
1477
|
} finally {
|
|
1985
|
-
if (
|
|
1478
|
+
if (_didIteratorError1) throw _iteratorError1;
|
|
1986
1479
|
}
|
|
1987
1480
|
}
|
|
1988
|
-
} else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, cursor,
|
|
1481
|
+
} else emitProperty(state, property === "backgroundImage" ? "experimental_backgroundImage" : property, parsed, cursor, originalValue, contextOnly);
|
|
1989
1482
|
return;
|
|
1990
1483
|
}
|
|
1991
1484
|
}
|
|
1992
|
-
if (property === "fontVariant" && typeof
|
|
1485
|
+
if (property === "fontVariant" && typeof value3 === "string") {
|
|
1993
1486
|
var variants = [];
|
|
1994
1487
|
var start = 0;
|
|
1995
|
-
for (var index = 0; index <=
|
|
1996
|
-
var code = index ===
|
|
1488
|
+
for (var index = 0; index <= value3.length; index++) {
|
|
1489
|
+
var code = index === value3.length ? 32 : value3.charCodeAt(index);
|
|
1997
1490
|
if (code !== 44 && code > 32) continue;
|
|
1998
|
-
if (start < index) variants.push(
|
|
1491
|
+
if (start < index) variants.push(value3.slice(start, index));
|
|
1999
1492
|
start = index + 1;
|
|
2000
1493
|
}
|
|
2001
|
-
|
|
1494
|
+
value3 = variants;
|
|
2002
1495
|
}
|
|
2003
|
-
var expanded = state.styleProps.noExpand ?
|
|
1496
|
+
var expanded = !state.styleProps.noExpand ? expandStyle(property, value3, state.conf.settings.styleCompat || "web") : null;
|
|
2004
1497
|
if (!expanded) {
|
|
2005
|
-
emitProperty(state, property,
|
|
1498
|
+
emitProperty(state, property, value3, cursor, originalValue, contextOnly);
|
|
2006
1499
|
return;
|
|
2007
1500
|
}
|
|
2008
1501
|
if (typeof raw === "string" && expanded.length > 1) {
|
|
@@ -2010,476 +1503,183 @@ function emitValue(state, property, raw, cursor, merge, originalValue, contextOn
|
|
|
2010
1503
|
if (parts1.length > 0 && parts1.length <= (expanded.length === 4 ? 4 : 2)) {
|
|
2011
1504
|
for (var index1 = 0; index1 < expanded.length; index1++) {
|
|
2012
1505
|
var partIndex = index1 === 0 || parts1.length === 1 ? 0 : index1 === 1 || index1 === 3 && parts1.length < 4 ? 1 : index1 === 2 && parts1.length < 3 ? 0 : index1;
|
|
2013
|
-
emitResolved(state, expanded[index1][0], parts1[partIndex], cursor,
|
|
1506
|
+
emitResolved(state, expanded[index1][0], parts1[partIndex], cursor, originalValue, contextOnly);
|
|
2014
1507
|
}
|
|
2015
1508
|
return;
|
|
2016
1509
|
}
|
|
2017
1510
|
}
|
|
2018
|
-
for (var index2 = 0; index2 < expanded.length; index2++) emitProperty(state, expanded[index2][0], expanded[index2][1], cursor,
|
|
2019
|
-
}
|
|
2020
|
-
function contributeStyleString(state, property, source, merge, originalValue) {
|
|
2021
|
-
var contextOnly = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
|
|
2022
|
-
var directState = state;
|
|
2023
|
-
var watermark = conditionCursorTop;
|
|
2024
|
-
var previousCursor = directState.flatScanCursor;
|
|
2025
|
-
var previousExpectMulti = directState.flatExpectMulti;
|
|
2026
|
-
directState.flatScanCursor = null;
|
|
2027
|
-
directState.flatExpectMulti = source.indexOf(":") !== -1;
|
|
2028
|
-
try {
|
|
2029
|
-
scanFlatValue(source, directStyleHandler, state, property, merge, originalValue, contextOnly);
|
|
2030
|
-
} finally {
|
|
2031
|
-
directState.flatScanCursor = previousCursor;
|
|
2032
|
-
directState.flatExpectMulti = previousExpectMulti;
|
|
2033
|
-
releaseConditionCursors(watermark);
|
|
2034
|
-
}
|
|
2035
|
-
return true;
|
|
2036
|
-
}
|
|
2037
|
-
function contributeStyleObject(state, property, value, merge, contextOnly) {
|
|
2038
|
-
var outerState = state;
|
|
2039
|
-
var previousExpectMulti = outerState.flatExpectMulti;
|
|
2040
|
-
outerState.flatExpectMulti = true;
|
|
2041
|
-
try {
|
|
2042
|
-
return contributeStyleObjectInner(state, property, value, merge, contextOnly);
|
|
2043
|
-
} finally {
|
|
2044
|
-
outerState.flatExpectMulti = previousExpectMulti;
|
|
2045
|
-
}
|
|
1511
|
+
for (var index2 = 0; index2 < expanded.length; index2++) emitProperty(state, expanded[index2][0], expanded[index2][1], cursor, originalValue, contextOnly);
|
|
2046
1512
|
}
|
|
2047
|
-
function
|
|
2048
|
-
var
|
|
2049
|
-
var
|
|
2050
|
-
var hasDefault = "default" in value;
|
|
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;
|
|
2051
1516
|
var hasBase = false;
|
|
2052
|
-
var base = hasDefault ? value.default : void 0;
|
|
2053
|
-
if (base != null) {
|
|
2054
|
-
emitAtParentCondition(state, property, base, merge, base, contextOnly);
|
|
2055
|
-
hasBase = true;
|
|
2056
|
-
}
|
|
2057
1517
|
var conditions = 0;
|
|
2058
|
-
var
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
var
|
|
2062
|
-
var
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
if (
|
|
2069
|
-
|
|
2070
|
-
|
|
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;
|
|
2071
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;
|
|
1578
|
+
}
|
|
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]);
|
|
2072
1584
|
}
|
|
2073
|
-
if (payload != null) conditions |= emitUnderCondition(state, property, payload, cursor, merge, payload, contextOnly, 1, payload);
|
|
2074
|
-
releaseConditionCursors(watermark);
|
|
2075
1585
|
}
|
|
2076
|
-
if (!
|
|
2077
|
-
if ((!canGenerateCSS || !state.flatShouldDoClasses) && conditions & 12 && !hasBase) {
|
|
2078
|
-
var
|
|
2079
|
-
|
|
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);
|
|
2080
1591
|
}
|
|
2081
1592
|
return true;
|
|
2082
1593
|
}
|
|
2083
|
-
function contributeValue(state, property, value,
|
|
2084
|
-
var contextOnly = arguments.length >
|
|
2085
|
-
|
|
2086
|
-
if (value[transportHasBase]) {
|
|
2087
|
-
var base = value[transportBase];
|
|
2088
|
-
contributeValue(state, property, base, merge, base, contextOnly);
|
|
2089
|
-
}
|
|
2090
|
-
for (var offset = transportEntries; offset < value.length;) {
|
|
2091
|
-
var entryValue = value[offset];
|
|
2092
|
-
var watermark = conditionCursorTop;
|
|
2093
|
-
try {
|
|
2094
|
-
var _state_flatPass;
|
|
2095
|
-
emitUnderCondition(state, property, entryValue, acquireTransportCursor(state, value, offset, ((_state_flatPass = state.flatPass) === null || _state_flatPass === void 0 ? void 0 : _state_flatPass[passParentCursor]) || null), merge, entryValue, contextOnly, 2, entryValue);
|
|
2096
|
-
} finally {
|
|
2097
|
-
releaseConditionCursors(watermark);
|
|
2098
|
-
}
|
|
2099
|
-
offset += transportEntryWidth;
|
|
2100
|
-
}
|
|
2101
|
-
return true;
|
|
2102
|
-
}
|
|
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;
|
|
2103
1597
|
if (condition !== void 0) {
|
|
2104
1598
|
var _directState_flatPass;
|
|
2105
1599
|
var parent = ((_directState_flatPass = state.flatPass) === null || _directState_flatPass === void 0 ? void 0 : _directState_flatPass[passParentCursor]) || null;
|
|
2106
|
-
var
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
if (isObjectValue && classifyConditionalObject(value, state, void 0, firstChild || void 0)) {
|
|
2124
|
-
var useFirstChild = firstChild !== null;
|
|
2125
|
-
for (var key in value) {
|
|
2126
|
-
var payload = value[key];
|
|
2127
|
-
if (payload == null) continue;
|
|
2128
|
-
if (key === "default") emitUnderCondition(state, property, payload, effective, merge, payload, contextOnly, 2, payload);
|
|
2129
|
-
else {
|
|
2130
|
-
var keyWatermark = conditionCursorTop;
|
|
2131
|
-
var child = useFirstChild ? firstChild : acquireConditionCursor(effective);
|
|
2132
|
-
if (useFirstChild) useFirstChild = false;
|
|
2133
|
-
else {
|
|
2134
|
-
resolveConditionText(state, child, key);
|
|
2135
|
-
commitConditionCursor(state, child);
|
|
2136
|
-
}
|
|
2137
|
-
emitUnderCondition(state, property, payload, child, merge, payload, contextOnly, 2, payload);
|
|
2138
|
-
if (child !== firstChild) releaseConditionCursors(keyWatermark);
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
return true;
|
|
2142
|
-
}
|
|
2143
|
-
emitUnderCondition(state, property, value, effective, merge, originalValue, contextOnly, 2, value);
|
|
2144
|
-
return true;
|
|
2145
|
-
} finally {
|
|
2146
|
-
releaseConditionCursors(watermark1);
|
|
2147
|
-
}
|
|
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;
|
|
2148
1617
|
}
|
|
2149
|
-
if (value === "safe"
|
|
2150
|
-
var expanded =
|
|
1618
|
+
if (value === "safe") {
|
|
1619
|
+
var expanded = getConfigRevisionState(state.conf).expandSafeArea(property);
|
|
2151
1620
|
if (expanded) {
|
|
2152
1621
|
state.flatUsesSafeArea = true;
|
|
2153
|
-
var
|
|
1622
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
2154
1623
|
try {
|
|
2155
|
-
for (var
|
|
2156
|
-
var [
|
|
2157
|
-
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);
|
|
2158
1627
|
}
|
|
2159
1628
|
} catch (err) {
|
|
2160
|
-
|
|
2161
|
-
|
|
1629
|
+
_didIteratorError = true;
|
|
1630
|
+
_iteratorError = err;
|
|
2162
1631
|
} finally {
|
|
2163
1632
|
try {
|
|
2164
|
-
if (!
|
|
1633
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) _iterator.return();
|
|
2165
1634
|
} finally {
|
|
2166
|
-
if (
|
|
1635
|
+
if (_didIteratorError) throw _iteratorError;
|
|
2167
1636
|
}
|
|
2168
1637
|
}
|
|
2169
1638
|
return true;
|
|
2170
1639
|
}
|
|
2171
1640
|
}
|
|
2172
|
-
if (
|
|
2173
|
-
|
|
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;
|
|
2174
1644
|
if (value != null) {
|
|
2175
|
-
emitAtParentCondition(state, property, value,
|
|
1645
|
+
emitAtParentCondition(state, property, value, originalValue !== null && originalValue !== void 0 ? originalValue : value, contextOnly);
|
|
2176
1646
|
return true;
|
|
2177
1647
|
}
|
|
2178
1648
|
return false;
|
|
2179
1649
|
}
|
|
2180
1650
|
function clearDirectStyle(state, property) {
|
|
1651
|
+
var _direct_flatAtomics;
|
|
2181
1652
|
var direct = state;
|
|
2182
|
-
var
|
|
2183
|
-
|
|
2184
|
-
var
|
|
2185
|
-
|
|
2186
|
-
if (
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
var
|
|
2191
|
-
var transportHasBase = 1;
|
|
2192
|
-
var transportBase = 2;
|
|
2193
|
-
var transportEntries = 3;
|
|
2194
|
-
var transportEntryWidth = 2;
|
|
2195
|
-
function isConditionTransport(value) {
|
|
2196
|
-
return Array.isArray(value) && value[0] === conditionTransportTag;
|
|
2197
|
-
}
|
|
2198
|
-
function appendConditionEntry(transport, cursor, value) {
|
|
2199
|
-
transport.push(value, conditionTexts[cursor + conditionKeyOffset] || "");
|
|
2200
|
-
}
|
|
2201
|
-
function acquireTransportCursor(state, transport, offset, parent) {
|
|
2202
|
-
var cursor = acquireConditionCursor(parent);
|
|
2203
|
-
var key = transport[offset + 1];
|
|
2204
|
-
if (key) resolveConditionText(state, cursor, key);
|
|
2205
|
-
commitConditionCursor(state, cursor);
|
|
2206
|
-
return cursor;
|
|
2207
|
-
}
|
|
2208
|
-
function mergeConditionTransport(state, prev, cursor, value) {
|
|
2209
|
-
var transport;
|
|
2210
|
-
if (isConditionTransport(prev)) transport = prev;
|
|
2211
|
-
else {
|
|
2212
|
-
transport = [
|
|
2213
|
-
conditionTransportTag,
|
|
2214
|
-
false,
|
|
2215
|
-
void 0
|
|
2216
|
-
];
|
|
2217
|
-
if (prev != null) {
|
|
2218
|
-
var isObjectValue = (typeof prev === "undefined" ? "undefined" : _type_of(prev)) === "object" && !Array.isArray(prev) && !isVariable(prev);
|
|
2219
|
-
var objectHasDefault = isObjectValue && "default" in prev;
|
|
2220
|
-
var authoredWatermark = conditionCursorTop;
|
|
2221
|
-
try {
|
|
2222
|
-
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
2223
|
-
if (isObjectValue && classifyConditionalObject(prev, state, void 0, firstCursor || void 0)) {
|
|
2224
|
-
var useFirstCursor = firstCursor !== null;
|
|
2225
|
-
for (var key in prev) {
|
|
2226
|
-
var payload = prev[key];
|
|
2227
|
-
if (payload == null) continue;
|
|
2228
|
-
if (key === "default") {
|
|
2229
|
-
transport[transportHasBase] = true;
|
|
2230
|
-
transport[transportBase] = payload;
|
|
2231
|
-
continue;
|
|
2232
|
-
}
|
|
2233
|
-
var watermark = conditionCursorTop;
|
|
2234
|
-
var keyCursor = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2235
|
-
if (useFirstCursor) useFirstCursor = false;
|
|
2236
|
-
else {
|
|
2237
|
-
resolveConditionText(state, keyCursor, key);
|
|
2238
|
-
commitConditionCursor(state, keyCursor);
|
|
2239
|
-
}
|
|
2240
|
-
appendConditionEntry(transport, keyCursor, payload);
|
|
2241
|
-
if (keyCursor !== firstCursor) releaseConditionCursors(watermark);
|
|
2242
|
-
}
|
|
2243
|
-
} else {
|
|
2244
|
-
transport[transportHasBase] = true;
|
|
2245
|
-
transport[transportBase] = prev;
|
|
2246
|
-
}
|
|
2247
|
-
} finally {
|
|
2248
|
-
releaseConditionCursors(authoredWatermark);
|
|
2249
|
-
}
|
|
2250
|
-
}
|
|
2251
|
-
}
|
|
2252
|
-
var cursorKey = conditionTexts[cursor + conditionKeyOffset] || "";
|
|
2253
|
-
for (var offset = transportEntries; offset < transport.length; offset += transportEntryWidth) if (transport[offset + 1] === cursorKey) {
|
|
2254
|
-
transport.splice(offset, transportEntryWidth);
|
|
2255
|
-
break;
|
|
2256
|
-
}
|
|
2257
|
-
appendConditionEntry(transport, cursor, value);
|
|
2258
|
-
return transport;
|
|
2259
|
-
}
|
|
2260
|
-
var variantValueHandler = {
|
|
2261
|
-
segment(ctx, start, end, isBase, valid, source, chainStart, chainEnd, chainValid) {
|
|
2262
|
-
var state = ctx[0];
|
|
2263
|
-
if (start === end) return;
|
|
2264
|
-
if (isBase) {
|
|
2265
|
-
if (!valid) return;
|
|
2266
|
-
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], null);
|
|
2267
|
-
return;
|
|
2268
|
-
}
|
|
2269
|
-
if (!valid || !chainValid) return;
|
|
2270
|
-
var cursor = state.flatScanCursor;
|
|
2271
|
-
if (!(cursor && conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag ? conditionNumbers[cursor + conditionValueOffset] : 0)) return;
|
|
2272
|
-
emitResolvedVariant(ctx[1], source.slice(start, end), state, ctx[2], cursor);
|
|
2273
|
-
},
|
|
2274
|
-
modifier(ctx, start, end, valid, first, source) {
|
|
2275
|
-
var directState = ctx[0];
|
|
2276
|
-
var cursor = directState.flatScanCursor;
|
|
2277
|
-
if (!cursor) cursor = directState.flatScanCursor = acquireConditionCursor();
|
|
2278
|
-
else if (first) resetConditionCursor(cursor, 0);
|
|
2279
|
-
if (!valid) {
|
|
2280
|
-
setConditionUnresolved(cursor);
|
|
2281
|
-
return;
|
|
2282
|
-
}
|
|
2283
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) resolveConditionModifier(ctx[0], cursor, source.slice(start, end));
|
|
2284
|
-
},
|
|
2285
|
-
chain(ctx, _start, _end, valid) {
|
|
2286
|
-
var cursor = ctx[0].flatScanCursor;
|
|
2287
|
-
if (cursor) {
|
|
2288
|
-
if (!valid) setConditionUnresolved(cursor);
|
|
2289
|
-
if (conditionNumbers[cursor + conditionFlagsOffset] & conditionResolvedFlag) commitConditionCursor(ctx[0], cursor);
|
|
2290
|
-
}
|
|
2291
|
-
return true;
|
|
2292
|
-
}
|
|
2293
|
-
};
|
|
2294
|
-
function emitMappedValue(styleState, key, value, originalValue, nestedCondition, parentCondition, fallbackOriginal) {
|
|
2295
|
-
var nested = nestedCondition;
|
|
2296
|
-
var parent = parentCondition;
|
|
2297
|
-
var resolvedCondition = nested !== null && nested !== void 0 ? nested : parent;
|
|
2298
|
-
var watermark = conditionCursorTop;
|
|
2299
|
-
if (nested && parent) {
|
|
2300
|
-
var composed = acquireConditionCursor(parent);
|
|
2301
|
-
var nestedKey = conditionTexts[nested + conditionKeyOffset] || "";
|
|
2302
|
-
if (nestedKey) resolveConditionText(styleState, composed, nestedKey);
|
|
2303
|
-
if (!(conditionNumbers[nested + conditionFlagsOffset] & conditionResolvedFlag)) setConditionUnresolved(composed);
|
|
2304
|
-
commitConditionCursor(styleState, composed);
|
|
2305
|
-
resolvedCondition = composed;
|
|
2306
|
-
}
|
|
2307
|
-
var conf = styleState.conf;
|
|
2308
|
-
if (key === "fontFamily" || key === conf.inverseShorthands.fontFamily) styleState.fontFamily = getFontFamilyFromNameOrVariable(value, conf);
|
|
2309
|
-
mapContributedProp(styleState, key, value, originalValue !== null && originalValue !== void 0 ? originalValue : fallbackOriginal, resolvedCondition);
|
|
2310
|
-
releaseConditionCursors(watermark);
|
|
2311
|
-
}
|
|
2312
|
-
var contributeMappedValue = function(key, value, styleState, disabled, parentCondition, fallbackOriginal) {
|
|
2313
|
-
if (disabled) return emitMappedValue(styleState, key, value, void 0, void 0, parentCondition, fallbackOriginal);
|
|
2314
|
-
var { conf, styleProps } = styleState;
|
|
2315
|
-
var variants = styleState.flatStyleStaticConfig.variants;
|
|
2316
|
-
var { disableExpandShorthands, noExpand, resolveValues } = styleProps;
|
|
2317
|
-
var shorthands = conf.shorthands;
|
|
2318
|
-
if (value === "unset") {
|
|
2319
|
-
var expandedKey = !disableExpandShorthands && shorthands[key] || key;
|
|
2320
|
-
var expanded = noExpand ? null : expandStyle(expandedKey, value, conf.settings.styleCompat || "web");
|
|
2321
|
-
var used = styleState.flatUsed;
|
|
2322
|
-
if (expanded) {
|
|
2323
|
-
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
2324
|
-
try {
|
|
2325
|
-
for (var _iterator2 = expanded[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
2326
|
-
var [nkey] = _step2.value;
|
|
2327
|
-
if (used) delete used[nkey];
|
|
2328
|
-
if (styleState.style) delete styleState.style[nkey];
|
|
2329
|
-
}
|
|
2330
|
-
} catch (err) {
|
|
2331
|
-
_didIteratorError2 = true;
|
|
2332
|
-
_iteratorError2 = err;
|
|
2333
|
-
} finally {
|
|
2334
|
-
try {
|
|
2335
|
-
if (!_iteratorNormalCompletion2 && _iterator2.return != null) _iterator2.return();
|
|
2336
|
-
} finally {
|
|
2337
|
-
if (_didIteratorError2) throw _iteratorError2;
|
|
2338
|
-
}
|
|
2339
|
-
}
|
|
2340
|
-
} else {
|
|
2341
|
-
if (used) delete used[expandedKey];
|
|
2342
|
-
if (styleState.style) delete styleState.style[expandedKey];
|
|
2343
|
-
}
|
|
2344
|
-
return;
|
|
2345
|
-
}
|
|
2346
|
-
if (!noExpand) {
|
|
2347
|
-
if (variants && key in variants) {
|
|
2348
|
-
resolveVariants(key, value, styleProps, styleState, key);
|
|
2349
|
-
return;
|
|
2350
|
-
}
|
|
2351
|
-
}
|
|
2352
|
-
if (!disableExpandShorthands) {
|
|
2353
|
-
if (key in shorthands) key = shorthands[key];
|
|
2354
|
-
}
|
|
2355
|
-
var originalValue = value;
|
|
2356
|
-
if (value === "safe" && isSafeAreaKey(key)) {
|
|
2357
|
-
var expanded1 = expandSafeAreaValue(key);
|
|
2358
|
-
if (expanded1) {
|
|
2359
|
-
for (var i = 0; i < expanded1.length; i++) {
|
|
2360
|
-
var [nkey1, nvalue] = expanded1[i];
|
|
2361
|
-
emitMappedValue(styleState, nkey1, nvalue, originalValue, void 0, parentCondition, fallbackOriginal);
|
|
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);
|
|
2362
1662
|
}
|
|
2363
|
-
return;
|
|
2364
1663
|
}
|
|
1664
|
+
direct.flatSlots.delete(atomicKey);
|
|
2365
1665
|
}
|
|
2366
|
-
if (
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
}
|
|
2371
|
-
if (value != null) {
|
|
2372
|
-
if (key === "fontFamily" && typeof originalValue === "string") {
|
|
2373
|
-
if (originalValue in conf.fontsParsed) styleState.fontFamily = originalValue;
|
|
2374
|
-
}
|
|
2375
|
-
var expanded2 = noExpand || typeof value === "string" ? null : expandStyle(key, value, conf.settings.styleCompat || "web");
|
|
2376
|
-
if (expanded2) {
|
|
2377
|
-
var max = expanded2.length;
|
|
2378
|
-
for (var i1 = 0; i1 < max; i1++) {
|
|
2379
|
-
var [nkey2, nvalue1, noriginalValue] = expanded2[i1];
|
|
2380
|
-
emitMappedValue(styleState, nkey2, nvalue1, noriginalValue !== null && noriginalValue !== void 0 ? noriginalValue : originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2381
|
-
}
|
|
2382
|
-
} else emitMappedValue(styleState, key, value, originalValue, void 0, parentCondition, fallbackOriginal);
|
|
2383
|
-
}
|
|
2384
|
-
};
|
|
2385
|
-
function resolveVariants(key, value, styleProps, styleState, parentVariantKey) {
|
|
2386
|
-
var _styleState_flatStyleStaticConfig_variants;
|
|
2387
|
-
var variantDefinition = (_styleState_flatStyleStaticConfig_variants = styleState.flatStyleStaticConfig.variants) === null || _styleState_flatStyleStaticConfig_variants === void 0 ? void 0 : _styleState_flatStyleStaticConfig_variants[key];
|
|
2388
|
-
if (isConditionTransport(value)) {
|
|
2389
|
-
if (value[transportHasBase]) emitResolvedVariant(key, value[transportBase], styleState, parentVariantKey, null);
|
|
2390
|
-
for (var offset = transportEntries; offset < value.length;) {
|
|
2391
|
-
var entryValue = value[offset];
|
|
2392
|
-
var watermark = conditionCursorTop;
|
|
2393
|
-
try {
|
|
2394
|
-
emitResolvedVariant(key, entryValue, styleState, parentVariantKey, acquireTransportCursor(styleState, value, offset, null));
|
|
2395
|
-
} finally {
|
|
2396
|
-
releaseConditionCursors(watermark);
|
|
2397
|
-
}
|
|
2398
|
-
offset += transportEntryWidth;
|
|
2399
|
-
}
|
|
2400
|
-
return;
|
|
2401
|
-
}
|
|
2402
|
-
if (typeof value === "string" && !(variantDefinition && (typeof variantDefinition === "undefined" ? "undefined" : _type_of(variantDefinition)) === "object" && value in variantDefinition)) {
|
|
2403
|
-
var directState = styleState;
|
|
2404
|
-
var watermark1 = conditionCursorTop;
|
|
2405
|
-
var previousCursor = directState.flatScanCursor;
|
|
2406
|
-
directState.flatScanCursor = null;
|
|
2407
|
-
try {
|
|
2408
|
-
scanFlatValue(value, variantValueHandler, [
|
|
2409
|
-
styleState,
|
|
2410
|
-
key,
|
|
2411
|
-
parentVariantKey
|
|
2412
|
-
]);
|
|
2413
|
-
} finally {
|
|
2414
|
-
directState.flatScanCursor = previousCursor;
|
|
2415
|
-
releaseConditionCursors(watermark1);
|
|
2416
|
-
}
|
|
2417
|
-
return;
|
|
2418
|
-
}
|
|
2419
|
-
var isObjectValue = value && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && !Array.isArray(value) && !isVariable(value);
|
|
2420
|
-
var objectHasDefault = isObjectValue && "default" in value;
|
|
2421
|
-
var objectWatermark = conditionCursorTop;
|
|
2422
|
-
try {
|
|
2423
|
-
var firstCursor = isObjectValue && !objectHasDefault ? acquireConditionCursor() : null;
|
|
2424
|
-
if (isObjectValue && classifyConditionalObject(value, styleState, void 0, firstCursor || void 0)) {
|
|
2425
|
-
var useFirstCursor = firstCursor !== null;
|
|
2426
|
-
for (var objKey in value) {
|
|
2427
|
-
var payload = value[objKey];
|
|
2428
|
-
if (payload == null) continue;
|
|
2429
|
-
if (objKey === "default") {
|
|
2430
|
-
emitResolvedVariant(key, payload, styleState, parentVariantKey, null);
|
|
2431
|
-
continue;
|
|
2432
|
-
}
|
|
2433
|
-
var watermark2 = conditionCursorTop;
|
|
2434
|
-
var cursor1 = useFirstCursor ? firstCursor : acquireConditionCursor();
|
|
2435
|
-
conditionNumbers[cursor1 + conditionValueOffset];
|
|
2436
|
-
if (useFirstCursor) useFirstCursor = false;
|
|
2437
|
-
else {
|
|
2438
|
-
resolveConditionText(styleState, cursor1, objKey);
|
|
2439
|
-
commitConditionCursor(styleState, cursor1);
|
|
2440
|
-
}
|
|
2441
|
-
emitResolvedVariant(key, payload, styleState, parentVariantKey, cursor1);
|
|
2442
|
-
if (cursor1 !== firstCursor) releaseConditionCursors(watermark2);
|
|
2443
|
-
}
|
|
2444
|
-
return;
|
|
2445
|
-
}
|
|
2446
|
-
} finally {
|
|
2447
|
-
releaseConditionCursors(objectWatermark);
|
|
2448
|
-
}
|
|
2449
|
-
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];
|
|
2450
1670
|
}
|
|
2451
|
-
function
|
|
2452
|
-
var
|
|
2453
|
-
var
|
|
2454
|
-
|
|
2455
|
-
if (
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
if (!variantValue) return;
|
|
2459
|
-
if (typeof variantValue === "function") {
|
|
2460
|
-
variantValue = variantValue(value, getVariantExtras(styleState));
|
|
2461
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose" && false);
|
|
2462
|
-
}
|
|
2463
|
-
if (!isObj(variantValue)) return;
|
|
2464
|
-
if (process.env.NODE_ENV === "development" && debug === "verbose") console.info(` expanding styles from `, variantValue);
|
|
2465
|
-
var { noSkip } = styleProps;
|
|
2466
|
-
var originals = styleOriginalValues.get(variantValue);
|
|
2467
|
-
for (var outputKey in variantValue) {
|
|
2468
|
-
if (!noSkip && outputKey in skipProps) continue;
|
|
2469
|
-
var rawOutputValue = variantValue[outputKey];
|
|
2470
|
-
var outputValue = styleProps.noNormalize ? rawOutputValue : normalizeValueWithProperty(rawOutputValue, conf.shorthands[outputKey] || outputKey);
|
|
2471
|
-
var _originals_outputKey;
|
|
2472
|
-
var originalValue = (_originals_outputKey = originals === null || originals === void 0 ? void 0 : originals[outputKey]) !== null && _originals_outputKey !== void 0 ? _originals_outputKey : rawOutputValue;
|
|
2473
|
-
var contextPropSet = styleState.flatStyleStaticConfig.styledContextKeys;
|
|
2474
|
-
if (contextPropSet === null || contextPropSet === void 0 ? void 0 : contextPropSet.has(outputKey)) {
|
|
2475
|
-
var _styleState, _styleState1;
|
|
2476
|
-
(_styleState = styleState).overriddenContextProps || (_styleState.overriddenContextProps = {});
|
|
2477
|
-
styleState.overriddenContextProps[outputKey] = originalValue;
|
|
2478
|
-
(_styleState1 = styleState).originalContextPropValues || (_styleState1.originalContextPropValues = {});
|
|
2479
|
-
styleState.originalContextPropValues[outputKey] = originalValue;
|
|
2480
|
-
}
|
|
2481
|
-
contributeMappedValue(outputKey, outputValue, styleState, parentVariantKey === key && outputKey === key, conditionCursor || void 0, originalValue);
|
|
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;
|
|
2482
1678
|
}
|
|
1679
|
+
var parent = pass[passParentCursor];
|
|
1680
|
+
pass[passParentCursor] = condition;
|
|
1681
|
+
contributeProp(pass, key, value, original, disabled);
|
|
1682
|
+
pass[passParentCursor] = parent;
|
|
2483
1683
|
}
|
|
2484
1684
|
function getFontFamilyFromNameOrVariable(input, conf) {
|
|
2485
1685
|
if (isVariable(input)) {
|
|
@@ -2496,5 +1696,5 @@ function getFontFamilyFromNameOrVariable(input, conf) {
|
|
|
2496
1696
|
}
|
|
2497
1697
|
var variableToFontNameCache = /* @__PURE__ */ new WeakMap();
|
|
2498
1698
|
|
|
2499
|
-
export { STYLE_TOKEN_PROVENANCE_KEY,
|
|
1699
|
+
export { STYLE_TOKEN_PROVENANCE_KEY, emitVariantStyle, getFontFamilyFromNameOrVariable, getSplitStyles, getStyleStaticConfig, getStyleTokenProvenance, isValidStyleKey, styleOriginalValues, walkConditionalValue };
|
|
2500
1700
|
//# sourceMappingURL=getSplitStyles.native.js.map
|