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