@tamagui/web 3.0.0-beta.831.1 → 3.0.0-beta.889.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createComponent.cjs +12 -1
- package/dist/cjs/createComponent.native.cjs +12 -1
- package/dist/cjs/createComponent.native.js +12 -1
- package/dist/cjs/createComponent.native.js.map +1 -1
- package/dist/cjs/createStyledHOC.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.cjs +1 -1
- package/dist/cjs/createStyledHOC.native.js +1 -1
- package/dist/cjs/createStyledHOC.native.js.map +1 -1
- package/dist/cjs/createVariable.cjs +0 -10
- package/dist/cjs/createVariable.native.cjs +0 -10
- package/dist/cjs/createVariable.native.js +0 -10
- package/dist/cjs/createVariable.native.js.map +1 -1
- package/dist/cjs/helpers/borderComponents.cjs +62 -0
- package/dist/cjs/helpers/borderComponents.native.cjs +82 -0
- package/dist/cjs/helpers/borderComponents.native.js +84 -0
- package/dist/cjs/helpers/borderComponents.native.js.map +1 -0
- package/dist/cjs/helpers/createDesignSystem.cjs +0 -2
- package/dist/cjs/helpers/createStyledContext.cjs +10 -18
- package/dist/cjs/helpers/createStyledContext.native.cjs +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js +14 -18
- package/dist/cjs/helpers/createStyledContext.native.js.map +1 -1
- package/dist/cjs/helpers/formatDiagnostic.cjs +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.cjs +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js +6 -6
- package/dist/cjs/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomic.cjs +128 -109
- package/dist/cjs/helpers/getCSSStylesAtomic.native.cjs +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js +11 -3
- package/dist/cjs/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.cjs +13 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.cjs +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js +15 -1
- package/dist/cjs/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/cjs/helpers/getDynamicVal.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.cjs +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js +5 -1
- package/dist/cjs/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/cjs/helpers/getSplitStyles.cjs +1042 -1715
- package/dist/cjs/helpers/getSplitStyles.native.cjs +1081 -1887
- package/dist/cjs/helpers/getSplitStyles.native.js +1081 -1887
- package/dist/cjs/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/cjs/helpers/grammarConfig.cjs +163 -1
- package/dist/cjs/helpers/grammarConfig.native.cjs +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js +186 -1
- package/dist/cjs/helpers/grammarConfig.native.js.map +1 -1
- package/dist/cjs/helpers/insertStyleRule.cjs +5 -1
- package/dist/cjs/helpers/insertStyleRule.native.cjs +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js +7 -1
- package/dist/cjs/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/cjs/helpers/log.cjs +9 -8
- package/dist/cjs/helpers/log.native.cjs +9 -8
- package/dist/cjs/helpers/log.native.js +9 -8
- package/dist/cjs/helpers/log.native.js.map +1 -1
- package/dist/cjs/helpers/mergeVariants.cjs +44 -13
- package/dist/cjs/helpers/mergeVariants.native.cjs +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js +79 -14
- package/dist/cjs/helpers/mergeVariants.native.js.map +1 -1
- package/dist/cjs/helpers/nativeOnlyProps.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.cjs +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/cjs/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/cjs/helpers/nativeStyleEngine.cjs +34 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.cjs +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js +36 -14
- package/dist/cjs/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/cjs/helpers/normalizeValueWithProperty.cjs +7 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.cjs +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/cjs/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/cjs/helpers/parseBorderShorthand.native.cjs +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js +25 -56
- package/dist/cjs/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/parseOutlineShorthand.native.cjs +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js +9 -49
- package/dist/cjs/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/cjs/helpers/resolveSafeArea.cjs +35 -100
- package/dist/cjs/helpers/resolveVariantStyle.cjs +57 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.cjs +67 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js +69 -0
- package/dist/cjs/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/cjs/helpers/styleStaticConfig.cjs +1 -50
- package/dist/cjs/helpers/styleStaticConfig.native.cjs +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js +1 -51
- package/dist/cjs/helpers/styleStaticConfig.native.js.map +1 -1
- package/dist/cjs/helpers/styleStaticConfigCore.cjs +107 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.cjs +127 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js +129 -0
- package/dist/cjs/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/cjs/helpers/styledDynamic.cjs +160 -0
- package/dist/cjs/helpers/styledDynamic.native.cjs +195 -0
- package/dist/cjs/helpers/styledDynamic.native.js +197 -0
- package/dist/cjs/helpers/styledDynamic.native.js.map +1 -0
- package/dist/cjs/helpers/tokenCategories.cjs +15 -38
- package/dist/cjs/helpers/tokenCategories.native.cjs +15 -40
- package/dist/cjs/helpers/tokenCategories.native.js +15 -40
- package/dist/cjs/helpers/tokenCategories.native.js.map +1 -1
- package/dist/cjs/helpers/variableValue.cjs +17 -12
- package/dist/cjs/helpers/variableValue.native.cjs +46 -23
- package/dist/cjs/helpers/variableValue.native.js +46 -23
- package/dist/cjs/helpers/variableValue.native.js.map +1 -1
- package/dist/cjs/helpers/warnOnce.cjs +5 -4
- package/dist/cjs/helpers/warnOnce.native.cjs +6 -4
- package/dist/cjs/helpers/warnOnce.native.js +6 -4
- package/dist/cjs/helpers/warnOnce.native.js.map +1 -1
- package/dist/cjs/hooks/useAnimationDriver.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.cjs +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js +2 -2
- package/dist/cjs/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/cjs/hooks/useComponentState.cjs +41 -82
- package/dist/cjs/hooks/useComponentState.native.cjs +45 -84
- package/dist/cjs/hooks/useComponentState.native.js +45 -84
- package/dist/cjs/hooks/useComponentState.native.js.map +1 -1
- package/dist/cjs/hooks/useMedia.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.cjs +2 -2
- package/dist/cjs/hooks/useMedia.native.js +2 -2
- package/dist/cjs/hooks/useMedia.native.js.map +1 -1
- package/dist/cjs/{helpers/directStyleCSS.native.js → hooks/useStyle.cjs} +16 -8
- package/dist/cjs/{helpers/directStyleCSS.native.cjs → hooks/useStyle.native.cjs} +16 -4
- package/dist/cjs/hooks/useStyle.native.js +34 -0
- package/dist/cjs/hooks/useStyle.native.js.map +1 -0
- package/dist/cjs/hooks/useThemeState.cjs +25 -90
- package/dist/cjs/hooks/useThemeState.native.cjs +34 -94
- package/dist/cjs/hooks/useThemeState.native.js +34 -94
- package/dist/cjs/hooks/useThemeState.native.js.map +1 -1
- package/dist/cjs/index.cjs +6 -3
- package/dist/cjs/index.native.cjs +6 -3
- package/dist/cjs/index.native.js +6 -3
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/static-resolve.cjs +2 -2
- package/dist/cjs/static-resolve.native.cjs +2 -2
- package/dist/cjs/static-resolve.native.js +2 -2
- package/dist/cjs/static-resolve.native.js.map +1 -1
- package/dist/cjs/style.cjs +91 -0
- package/dist/cjs/style.native.cjs +98 -0
- package/dist/cjs/style.native.js +100 -0
- package/dist/cjs/style.native.js.map +1 -0
- package/dist/cjs/styled.cjs +11 -6
- package/dist/cjs/styled.native.cjs +11 -6
- package/dist/cjs/styled.native.js +11 -6
- package/dist/cjs/styled.native.js.map +1 -1
- package/dist/cjs/types.cjs +6 -4
- package/dist/cjs/types.native.cjs +6 -4
- package/dist/cjs/types.native.js +6 -4
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/views/TamaguiProvider.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.cjs +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js +1 -2
- package/dist/cjs/views/TamaguiProvider.native.js.map +1 -1
- package/dist/cjs/views/Text.cjs +17 -12
- package/dist/cjs/views/Text.native.cjs +1 -0
- package/dist/cjs/views/Text.native.js +1 -0
- package/dist/cjs/views/Text.native.js.map +1 -1
- package/dist/cjs/views/Theme.cjs +3 -3
- package/dist/cjs/views/Theme.native.cjs +3 -3
- package/dist/cjs/views/Theme.native.js +3 -3
- package/dist/cjs/views/Theme.native.js.map +1 -1
- package/dist/cjs/views/ThemeDebug.cjs +1 -4
- package/dist/esm/createComponent.mjs +12 -1
- package/dist/esm/createComponent.mjs.map +1 -1
- package/dist/esm/createComponent.native.js +12 -1
- package/dist/esm/createComponent.native.js.map +1 -1
- package/dist/esm/createStyledHOC.mjs +1 -1
- package/dist/esm/createStyledHOC.mjs.map +1 -1
- package/dist/esm/createStyledHOC.native.js +1 -1
- package/dist/esm/createStyledHOC.native.js.map +1 -1
- package/dist/esm/createVariable.mjs +1 -9
- package/dist/esm/createVariable.mjs.map +1 -1
- package/dist/esm/createVariable.native.js +1 -9
- package/dist/esm/createVariable.native.js.map +1 -1
- package/dist/esm/helpers/borderComponents.mjs +37 -0
- package/dist/esm/helpers/borderComponents.mjs.map +1 -0
- package/dist/esm/helpers/borderComponents.native.js +55 -0
- package/dist/esm/helpers/borderComponents.native.js.map +1 -0
- package/dist/esm/helpers/createDesignSystem.mjs +0 -2
- package/dist/esm/helpers/createDesignSystem.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.mjs +10 -18
- package/dist/esm/helpers/createStyledContext.mjs.map +1 -1
- package/dist/esm/helpers/createStyledContext.native.js +14 -18
- package/dist/esm/helpers/createStyledContext.native.js.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.mjs +6 -6
- package/dist/esm/helpers/formatDiagnostic.mjs.map +1 -1
- package/dist/esm/helpers/formatDiagnostic.native.js +6 -6
- package/dist/esm/helpers/formatDiagnostic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.mjs +126 -109
- package/dist/esm/helpers/getCSSStylesAtomic.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomic.native.js +7 -4
- package/dist/esm/helpers/getCSSStylesAtomic.native.js.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs +8 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.mjs.map +1 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js +10 -1
- package/dist/esm/helpers/getCSSStylesAtomicCompiled.native.js.map +1 -1
- package/dist/esm/helpers/getDynamicVal.mjs +5 -1
- package/dist/esm/helpers/getDynamicVal.mjs.map +1 -1
- package/dist/esm/helpers/getDynamicVal.native.js +5 -1
- package/dist/esm/helpers/getDynamicVal.native.js.map +1 -1
- package/dist/esm/helpers/getSplitStyles.mjs +1034 -1705
- package/dist/esm/helpers/getSplitStyles.mjs.map +1 -1
- package/dist/esm/helpers/getSplitStyles.native.js +1071 -1871
- package/dist/esm/helpers/getSplitStyles.native.js.map +1 -1
- package/dist/esm/helpers/grammarConfig.mjs +164 -2
- package/dist/esm/helpers/grammarConfig.mjs.map +1 -1
- package/dist/esm/helpers/grammarConfig.native.js +187 -2
- package/dist/esm/helpers/grammarConfig.native.js.map +1 -1
- package/dist/esm/helpers/insertStyleRule.mjs +5 -2
- package/dist/esm/helpers/insertStyleRule.mjs.map +1 -1
- package/dist/esm/helpers/insertStyleRule.native.js +7 -2
- package/dist/esm/helpers/insertStyleRule.native.js.map +1 -1
- package/dist/esm/helpers/log.mjs +9 -8
- package/dist/esm/helpers/log.mjs.map +1 -1
- package/dist/esm/helpers/log.native.js +9 -8
- package/dist/esm/helpers/log.native.js.map +1 -1
- package/dist/esm/helpers/mergeVariants.mjs +44 -13
- package/dist/esm/helpers/mergeVariants.mjs.map +1 -1
- package/dist/esm/helpers/mergeVariants.native.js +79 -14
- package/dist/esm/helpers/mergeVariants.native.js.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs +0 -1
- package/dist/esm/helpers/nativeOnlyProps.mjs.map +1 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js +0 -1
- package/dist/esm/helpers/nativeOnlyProps.native.js.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.mjs +34 -15
- package/dist/esm/helpers/nativeStyleEngine.mjs.map +1 -1
- package/dist/esm/helpers/nativeStyleEngine.native.js +36 -15
- package/dist/esm/helpers/nativeStyleEngine.native.js.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.mjs +7 -8
- package/dist/esm/helpers/normalizeValueWithProperty.mjs.map +1 -1
- package/dist/esm/helpers/normalizeValueWithProperty.native.js +9 -8
- package/dist/esm/helpers/normalizeValueWithProperty.native.js.map +1 -1
- package/dist/esm/helpers/parseBorderShorthand.native.js +23 -56
- package/dist/esm/helpers/parseBorderShorthand.native.js.map +1 -1
- package/dist/esm/helpers/parseOutlineShorthand.native.js +10 -49
- package/dist/esm/helpers/parseOutlineShorthand.native.js.map +1 -1
- package/dist/esm/helpers/resolveSafeArea.mjs +35 -97
- package/dist/esm/helpers/resolveSafeArea.mjs.map +1 -1
- package/dist/esm/helpers/resolveVariantStyle.mjs +38 -0
- package/dist/esm/helpers/resolveVariantStyle.mjs.map +1 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js +46 -0
- package/dist/esm/helpers/resolveVariantStyle.native.js.map +1 -0
- package/dist/esm/helpers/styleStaticConfig.mjs +1 -50
- package/dist/esm/helpers/styleStaticConfig.mjs.map +1 -1
- package/dist/esm/helpers/styleStaticConfig.native.js +1 -51
- package/dist/esm/helpers/styleStaticConfig.native.js.map +1 -1
- package/dist/esm/helpers/styleStaticConfigCore.mjs +88 -0
- package/dist/esm/helpers/styleStaticConfigCore.mjs.map +1 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js +106 -0
- package/dist/esm/helpers/styleStaticConfigCore.native.js.map +1 -0
- package/dist/esm/helpers/styledDynamic.mjs +136 -0
- package/dist/esm/helpers/styledDynamic.mjs.map +1 -0
- package/dist/esm/helpers/styledDynamic.native.js +169 -0
- package/dist/esm/helpers/styledDynamic.native.js.map +1 -0
- package/dist/esm/helpers/tokenCategories.mjs +15 -36
- package/dist/esm/helpers/tokenCategories.mjs.map +1 -1
- package/dist/esm/helpers/tokenCategories.native.js +15 -38
- package/dist/esm/helpers/tokenCategories.native.js.map +1 -1
- package/dist/esm/helpers/variableValue.mjs +17 -12
- package/dist/esm/helpers/variableValue.mjs.map +1 -1
- package/dist/esm/helpers/variableValue.native.js +46 -23
- package/dist/esm/helpers/variableValue.native.js.map +1 -1
- package/dist/esm/helpers/warnOnce.mjs +5 -4
- package/dist/esm/helpers/warnOnce.mjs.map +1 -1
- package/dist/esm/helpers/warnOnce.native.js +6 -4
- package/dist/esm/helpers/warnOnce.native.js.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.mjs +2 -2
- package/dist/esm/hooks/useAnimationDriver.mjs.map +1 -1
- package/dist/esm/hooks/useAnimationDriver.native.js +2 -2
- package/dist/esm/hooks/useAnimationDriver.native.js.map +1 -1
- package/dist/esm/hooks/useComponentState.mjs +41 -82
- package/dist/esm/hooks/useComponentState.mjs.map +1 -1
- package/dist/esm/hooks/useComponentState.native.js +45 -84
- package/dist/esm/hooks/useComponentState.native.js.map +1 -1
- package/dist/esm/hooks/useMedia.mjs +2 -2
- package/dist/esm/hooks/useMedia.mjs.map +1 -1
- package/dist/esm/hooks/useMedia.native.js +2 -2
- package/dist/esm/hooks/useMedia.native.js.map +1 -1
- package/dist/esm/hooks/useStyle.mjs +11 -0
- package/dist/esm/hooks/useStyle.mjs.map +1 -0
- package/dist/esm/hooks/useStyle.native.js +11 -0
- package/dist/esm/hooks/useStyle.native.js.map +1 -0
- package/dist/esm/hooks/useThemeState.mjs +25 -90
- package/dist/esm/hooks/useThemeState.mjs.map +1 -1
- package/dist/esm/hooks/useThemeState.native.js +34 -94
- package/dist/esm/hooks/useThemeState.native.js.map +1 -1
- package/dist/esm/index.js +6 -4
- package/dist/esm/index.mjs +6 -4
- package/dist/esm/index.native.js +6 -4
- package/dist/esm/static-resolve.mjs +3 -3
- package/dist/esm/static-resolve.mjs.map +1 -1
- package/dist/esm/static-resolve.native.js +3 -3
- package/dist/esm/static-resolve.native.js.map +1 -1
- package/dist/esm/style.mjs +58 -0
- package/dist/esm/style.mjs.map +1 -0
- package/dist/esm/style.native.js +63 -0
- package/dist/esm/style.native.js.map +1 -0
- package/dist/esm/styled.mjs +12 -6
- package/dist/esm/styled.mjs.map +1 -1
- package/dist/esm/styled.native.js +12 -6
- package/dist/esm/styled.native.js.map +1 -1
- package/dist/esm/types.mjs +3 -4
- package/dist/esm/types.mjs.map +1 -1
- package/dist/esm/types.native.js +3 -4
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/views/TamaguiProvider.mjs +1 -2
- package/dist/esm/views/TamaguiProvider.mjs.map +1 -1
- package/dist/esm/views/TamaguiProvider.native.js +1 -2
- package/dist/esm/views/TamaguiProvider.native.js.map +1 -1
- package/dist/esm/views/Text.mjs +17 -12
- package/dist/esm/views/Text.mjs.map +1 -1
- package/dist/esm/views/Theme.mjs +3 -3
- package/dist/esm/views/Theme.mjs.map +1 -1
- package/dist/esm/views/Theme.native.js +3 -3
- package/dist/esm/views/Theme.native.js.map +1 -1
- package/dist/esm/views/ThemeDebug.mjs +1 -4
- package/dist/esm/views/ThemeDebug.mjs.map +1 -1
- package/package.json +15 -15
- package/src/createComponent.tsx +21 -1
- package/src/createStyledHOC.tsx +4 -2
- package/src/createVariable.ts +0 -10
- package/src/helpers/borderComponents.ts +62 -0
- package/src/helpers/createDesignSystem.ts +0 -2
- package/src/helpers/createStyledContext.tsx +15 -53
- package/src/helpers/formatDiagnostic.ts +9 -9
- package/src/helpers/getCSSStylesAtomic.native.ts +6 -3
- package/src/helpers/getCSSStylesAtomic.ts +192 -207
- package/src/helpers/getCSSStylesAtomicCompiled.ts +13 -1
- package/src/helpers/getDynamicVal.ts +4 -0
- package/src/helpers/getSplitStyles.tsx +2080 -3270
- package/src/helpers/grammarConfig.ts +218 -1
- package/src/helpers/insertStyleRule.tsx +4 -2
- package/src/helpers/log.ts +12 -11
- package/src/helpers/mergeVariants.ts +55 -18
- package/src/helpers/nativeOnlyProps.ts +0 -1
- package/src/helpers/nativeStyleEngine.ts +55 -14
- package/src/helpers/normalizeValueWithProperty.ts +10 -12
- package/src/helpers/parseBorderShorthand.native.ts +23 -45
- package/src/helpers/parseOutlineShorthand.native.ts +9 -40
- package/src/helpers/resolveSafeArea.ts +34 -101
- package/src/helpers/resolveVariantStyle.ts +77 -0
- package/src/helpers/styleFrontend.ts +8 -5
- package/src/helpers/styleStaticConfig.ts +5 -72
- package/src/helpers/styleStaticConfigCore.ts +110 -0
- package/src/helpers/styledDynamic.ts +191 -0
- package/src/helpers/tokenCategories.ts +40 -65
- package/src/helpers/variableValue.ts +20 -15
- package/src/helpers/warnOnce.ts +5 -4
- package/src/hooks/useAnimationDriver.ts +6 -2
- package/src/hooks/useComponentState.ts +55 -183
- package/src/hooks/useMedia.tsx +10 -8
- package/src/hooks/useStyle.ts +10 -0
- package/src/hooks/useThemeState.ts +51 -264
- package/src/index.ts +6 -6
- package/src/internalRuntimeTypes.ts +1 -0
- package/src/static-resolve.ts +7 -4
- package/src/style.ts +97 -0
- package/src/styled.tsx +39 -68
- package/src/types.tsx +105 -169
- package/src/views/TamaguiProvider.tsx +0 -2
- package/src/views/Text.tsx +20 -14
- package/src/views/Theme.tsx +13 -9
- package/src/views/ThemeDebug.tsx +0 -1
- package/types/createComponent.d.ts.map +1 -1
- package/types/createStyledHOC.d.ts +1 -1
- package/types/createStyledHOC.d.ts.map +1 -1
- package/types/createVariable.d.ts +0 -2
- package/types/createVariable.d.ts.map +1 -1
- package/types/helpers/borderComponents.d.ts +10 -0
- package/types/helpers/borderComponents.d.ts.map +1 -0
- package/types/helpers/createDesignSystem.d.ts.map +1 -1
- package/types/helpers/createStyledContext.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.d.ts +20 -19
- package/types/helpers/getCSSStylesAtomic.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomic.native.d.ts +5 -0
- package/types/helpers/getCSSStylesAtomic.native.d.ts.map +1 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts +6 -1
- package/types/helpers/getCSSStylesAtomicCompiled.d.ts.map +1 -1
- package/types/helpers/getDynamicVal.d.ts.map +1 -1
- package/types/helpers/getSplitStyles.d.ts +3 -5
- package/types/helpers/getSplitStyles.d.ts.map +1 -1
- package/types/helpers/grammarConfig.d.ts +25 -2
- package/types/helpers/grammarConfig.d.ts.map +1 -1
- package/types/helpers/insertStyleRule.d.ts +1 -0
- package/types/helpers/insertStyleRule.d.ts.map +1 -1
- package/types/helpers/log.d.ts.map +1 -1
- package/types/helpers/mergeVariants.d.ts.map +1 -1
- package/types/helpers/nativeOnlyProps.d.ts +0 -1
- package/types/helpers/nativeOnlyProps.d.ts.map +1 -1
- package/types/helpers/nativeStyleEngine.d.ts +6 -0
- package/types/helpers/nativeStyleEngine.d.ts.map +1 -1
- package/types/helpers/normalizeValueWithProperty.d.ts.map +1 -1
- package/types/helpers/parseBorderShorthand.native.d.ts +1 -0
- package/types/helpers/parseBorderShorthand.native.d.ts.map +1 -1
- package/types/helpers/parseOutlineShorthand.native.d.ts.map +1 -1
- package/types/helpers/resolveSafeArea.d.ts +0 -1
- package/types/helpers/resolveSafeArea.d.ts.map +1 -1
- package/types/helpers/resolveVariantStyle.d.ts +3 -0
- package/types/helpers/resolveVariantStyle.d.ts.map +1 -0
- package/types/helpers/styleFrontend.d.ts +3 -5
- package/types/helpers/styleFrontend.d.ts.map +1 -1
- package/types/helpers/styleStaticConfig.d.ts +4 -9
- package/types/helpers/styleStaticConfig.d.ts.map +1 -1
- package/types/helpers/styleStaticConfigCore.d.ts +4 -0
- package/types/helpers/styleStaticConfigCore.d.ts.map +1 -0
- package/types/helpers/styledDynamic.d.ts +18 -0
- package/types/helpers/styledDynamic.d.ts.map +1 -0
- package/types/helpers/tokenCategories.d.ts +0 -1
- package/types/helpers/tokenCategories.d.ts.map +1 -1
- package/types/helpers/variableValue.d.ts.map +1 -1
- package/types/helpers/warnOnce.d.ts.map +1 -1
- package/types/helpers/webPropsToSkip.native.d.ts +68 -68
- package/types/hooks/useAnimationDriver.d.ts.map +1 -1
- package/types/hooks/useComponentState.d.ts.map +1 -1
- package/types/hooks/useMedia.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +4 -0
- package/types/hooks/useStyle.d.ts.map +1 -0
- package/types/hooks/useThemeState.d.ts +1 -11
- package/types/hooks/useThemeState.d.ts.map +1 -1
- package/types/index.d.ts +6 -4
- package/types/index.d.ts.map +1 -1
- package/types/internalRuntimeTypes.d.ts +1 -1
- package/types/internalRuntimeTypes.d.ts.map +1 -1
- package/types/static-resolve.d.ts.map +1 -1
- package/types/style.d.ts +18 -0
- package/types/style.d.ts.map +1 -0
- package/types/styled.d.ts +10 -10
- package/types/styled.d.ts.map +1 -1
- package/types/types.d.ts +74 -49
- package/types/types.d.ts.map +1 -1
- package/types/views/TamaguiProvider.d.ts +1 -1
- package/types/views/TamaguiProvider.d.ts.map +1 -1
- package/types/views/Text.d.ts.map +1 -1
- package/types/views/Theme.d.ts.map +1 -1
- package/types/views/ThemeDebug.d.ts.map +1 -1
- package/dist/cjs/helpers/directStyleCSS.cjs +0 -345
- package/dist/cjs/helpers/directStyleCSS.native.js.map +0 -1
- package/dist/cjs/helpers/directStyleCSSCompiled.cjs +0 -40
- package/dist/cjs/helpers/directStyleCSSCompiled.native.cjs +0 -46
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js +0 -48
- package/dist/cjs/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/cjs/helpers/getVariantExtras.cjs +0 -91
- package/dist/cjs/helpers/getVariantExtras.native.cjs +0 -94
- package/dist/cjs/helpers/getVariantExtras.native.js +0 -96
- package/dist/cjs/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/cjs/helpers/variantResolvers.cjs +0 -87
- package/dist/cjs/helpers/variantResolvers.native.cjs +0 -140
- package/dist/cjs/helpers/variantResolvers.native.js +0 -142
- package/dist/cjs/helpers/variantResolvers.native.js.map +0 -1
- package/dist/esm/helpers/directStyleCSS.mjs +0 -317
- package/dist/esm/helpers/directStyleCSS.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSS.native.js +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.mjs +0 -11
- package/dist/esm/helpers/directStyleCSSCompiled.mjs.map +0 -1
- package/dist/esm/helpers/directStyleCSSCompiled.native.js +0 -15
- package/dist/esm/helpers/directStyleCSSCompiled.native.js.map +0 -1
- package/dist/esm/helpers/getVariantExtras.mjs +0 -69
- package/dist/esm/helpers/getVariantExtras.mjs.map +0 -1
- package/dist/esm/helpers/getVariantExtras.native.js +0 -70
- package/dist/esm/helpers/getVariantExtras.native.js.map +0 -1
- package/dist/esm/helpers/variantResolvers.mjs +0 -65
- package/dist/esm/helpers/variantResolvers.mjs.map +0 -1
- package/dist/esm/helpers/variantResolvers.native.js +0 -116
- package/dist/esm/helpers/variantResolvers.native.js.map +0 -1
- package/src/helpers/directStyleCSS.native.ts +0 -1
- package/src/helpers/directStyleCSS.ts +0 -513
- package/src/helpers/directStyleCSSCompiled.ts +0 -32
- package/src/helpers/getVariantExtras.tsx +0 -95
- package/src/helpers/variantResolvers.ts +0 -121
- package/types/helpers/directStyleCSS.d.ts +0 -28
- package/types/helpers/directStyleCSS.d.ts.map +0 -1
- package/types/helpers/directStyleCSS.native.d.ts +0 -2
- package/types/helpers/directStyleCSS.native.d.ts.map +0 -1
- package/types/helpers/directStyleCSSCompiled.d.ts +0 -10
- package/types/helpers/directStyleCSSCompiled.d.ts.map +0 -1
- package/types/helpers/getVariantExtras.d.ts +0 -4
- package/types/helpers/getVariantExtras.d.ts.map +0 -1
- package/types/helpers/variantResolvers.d.ts +0 -9
- package/types/helpers/variantResolvers.d.ts.map +0 -1
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { isVariable } from "../createVariable.native.js";
|
|
2
|
-
|
|
3
|
-
function _type_of(obj) {
|
|
4
|
-
"@swc/helpers - typeof";
|
|
5
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
6
|
-
}
|
|
7
|
-
var variantResolverCache = /* @__PURE__ */ new WeakMap();
|
|
8
|
-
function getCompiledVariantResolvers(variant) {
|
|
9
|
-
var compiled = variantResolverCache.get(variant);
|
|
10
|
-
if (!compiled) {
|
|
11
|
-
var next = [];
|
|
12
|
-
for (var key in variant) {
|
|
13
|
-
var parts = parseVariantResolverKey(key);
|
|
14
|
-
if (parts) next.push({
|
|
15
|
-
key,
|
|
16
|
-
parts
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
compiled = next;
|
|
20
|
-
variantResolverCache.set(variant, compiled);
|
|
21
|
-
}
|
|
22
|
-
return compiled;
|
|
23
|
-
}
|
|
24
|
-
function parseVariantResolverKey(key) {
|
|
25
|
-
if (!key) return null;
|
|
26
|
-
return key.split("|").map(function(part) {
|
|
27
|
-
return part.trim();
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function getVariantDefinition(variant, value, conf, param) {
|
|
31
|
-
var { theme } = param;
|
|
32
|
-
if (!variant) return;
|
|
33
|
-
if (value === void 0) return;
|
|
34
|
-
if (typeof variant === "function") {
|
|
35
|
-
return variant;
|
|
36
|
-
}
|
|
37
|
-
if (value in variant) {
|
|
38
|
-
return variant[value];
|
|
39
|
-
}
|
|
40
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
41
|
-
try {
|
|
42
|
-
for (var _iterator = getCompiledVariantResolvers(variant)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
43
|
-
var { key, parts } = _step.value;
|
|
44
|
-
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
45
|
-
try {
|
|
46
|
-
for (var _iterator1 = parts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
47
|
-
var part = _step1.value;
|
|
48
|
-
if (matchesVariantResolver(part, value, conf, theme)) {
|
|
49
|
-
return variant[key];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
} catch (err) {
|
|
53
|
-
_didIteratorError1 = true;
|
|
54
|
-
_iteratorError1 = err;
|
|
55
|
-
} finally {
|
|
56
|
-
try {
|
|
57
|
-
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
58
|
-
_iterator1.return();
|
|
59
|
-
}
|
|
60
|
-
} finally {
|
|
61
|
-
if (_didIteratorError1) {
|
|
62
|
-
throw _iteratorError1;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
} catch (err) {
|
|
68
|
-
_didIteratorError = true;
|
|
69
|
-
_iteratorError = err;
|
|
70
|
-
} finally {
|
|
71
|
-
try {
|
|
72
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
73
|
-
_iterator.return();
|
|
74
|
-
}
|
|
75
|
-
} finally {
|
|
76
|
-
if (_didIteratorError) {
|
|
77
|
-
throw _iteratorError;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function matchesVariantResolver(resolverName, value, conf, theme) {
|
|
83
|
-
var string = typeof value === "string";
|
|
84
|
-
var number = typeof value === "number";
|
|
85
|
-
var rem = string && value.length > 3 && value.endsWith("rem") && Number.isFinite(Number(value.slice(0, -3)));
|
|
86
|
-
switch (resolverName) {
|
|
87
|
-
case "Size":
|
|
88
|
-
case "Space":
|
|
89
|
-
case "Radius":
|
|
90
|
-
case "ZIndex": return value === true || number || string || resolverName !== "Size" && isVariable(value);
|
|
91
|
-
case "Color": return string;
|
|
92
|
-
case "Theme": return string && !!theme && value in theme;
|
|
93
|
-
case "FontSize":
|
|
94
|
-
var _conf_fontsParsed_body_size, _conf_fontsParsed_body;
|
|
95
|
-
return value === true || !!((_conf_fontsParsed_body = conf.fontsParsed.body) === null || _conf_fontsParsed_body === void 0 ? void 0 : (_conf_fontsParsed_body_size = _conf_fontsParsed_body.size) === null || _conf_fontsParsed_body_size === void 0 ? void 0 : _conf_fontsParsed_body_size[value]) || number || rem;
|
|
96
|
-
case "FontStyle":
|
|
97
|
-
var _conf_fontsParsed_body_style, _conf_fontsParsed_body1;
|
|
98
|
-
return !!((_conf_fontsParsed_body1 = conf.fontsParsed.body) === null || _conf_fontsParsed_body1 === void 0 ? void 0 : (_conf_fontsParsed_body_style = _conf_fontsParsed_body1.style) === null || _conf_fontsParsed_body_style === void 0 ? void 0 : _conf_fontsParsed_body_style[value]) || value === "normal" || value === "italic";
|
|
99
|
-
case "FontTransform":
|
|
100
|
-
var _conf_fontsParsed_body_transform, _conf_fontsParsed_body2;
|
|
101
|
-
return !!((_conf_fontsParsed_body2 = conf.fontsParsed.body) === null || _conf_fontsParsed_body2 === void 0 ? void 0 : (_conf_fontsParsed_body_transform = _conf_fontsParsed_body2.transform) === null || _conf_fontsParsed_body_transform === void 0 ? void 0 : _conf_fontsParsed_body_transform[value]) || value === "none" || value === "capitalize" || value === "uppercase" || value === "lowercase";
|
|
102
|
-
case "FontLineHeight":
|
|
103
|
-
var _conf_fontsParsed_body_lineHeight, _conf_fontsParsed_body3;
|
|
104
|
-
return !!((_conf_fontsParsed_body3 = conf.fontsParsed.body) === null || _conf_fontsParsed_body3 === void 0 ? void 0 : (_conf_fontsParsed_body_lineHeight = _conf_fontsParsed_body3.lineHeight) === null || _conf_fontsParsed_body_lineHeight === void 0 ? void 0 : _conf_fontsParsed_body_lineHeight[value]) || number || rem;
|
|
105
|
-
case "FontLetterSpacing":
|
|
106
|
-
var _conf_fontsParsed_body_letterSpacing, _conf_fontsParsed_body4;
|
|
107
|
-
return !!((_conf_fontsParsed_body4 = conf.fontsParsed.body) === null || _conf_fontsParsed_body4 === void 0 ? void 0 : (_conf_fontsParsed_body_letterSpacing = _conf_fontsParsed_body4.letterSpacing) === null || _conf_fontsParsed_body_letterSpacing === void 0 ? void 0 : _conf_fontsParsed_body_letterSpacing[value]) || number || rem;
|
|
108
|
-
case "number":
|
|
109
|
-
case "string":
|
|
110
|
-
case "boolean": return (typeof value === "undefined" ? "undefined" : _type_of(value)) === resolverName;
|
|
111
|
-
case "any": return true;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export { getCompiledVariantResolvers, getVariantDefinition };
|
|
116
|
-
//# sourceMappingURL=variantResolvers.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"variantResolvers.native.js","names":[],"sources":["esm/helpers/variantResolvers.native.js"],"sourcesContent":["import { isVariable } from \"../createVariable\";\nfunction _type_of(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nvar variantResolverCache = /* @__PURE__ */ new WeakMap();\nfunction getCompiledVariantResolvers(variant) {\n var compiled = variantResolverCache.get(variant);\n if (!compiled) {\n var next = [];\n for (var key in variant) {\n var parts = parseVariantResolverKey(key);\n if (parts) next.push({\n key,\n parts\n });\n }\n compiled = next;\n variantResolverCache.set(variant, compiled);\n }\n return compiled;\n}\nfunction parseVariantResolverKey(key) {\n if (!key) return null;\n return key.split(\"|\").map(function(part) {\n return part.trim();\n });\n}\nfunction getVariantDefinition(variant, value, conf, param) {\n var { theme } = param;\n if (!variant) return;\n if (value === void 0) return;\n if (typeof variant === \"function\") {\n return variant;\n }\n if (value in variant) {\n return variant[value];\n }\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = getCompiledVariantResolvers(variant)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var { key, parts } = _step.value;\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;\n try {\n for (var _iterator1 = parts[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {\n var part = _step1.value;\n if (matchesVariantResolver(part, value, conf, theme)) {\n return variant[key];\n }\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally {\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n}\nfunction matchesVariantResolver(resolverName, value, conf, theme) {\n var string = typeof value === \"string\";\n var number = typeof value === \"number\";\n var rem = string && value.length > 3 && value.endsWith(\"rem\") && Number.isFinite(Number(value.slice(0, -3)));\n switch (resolverName) {\n case \"Size\":\n case \"Space\":\n case \"Radius\":\n case \"ZIndex\":\n return value === true || number || string || resolverName !== \"Size\" && isVariable(value);\n // a token or theme color, otherwise any string is taken to be a raw CSS\n // color and left for the browser to resolve. checking that against a CSS\n // color-name table costs 2.3KB gzip to reject values that were never valid\n // anyway. `red/50` opacity modifiers stay limited to token and theme\n // colors, which the branches above already covered.\n case \"Color\":\n return string;\n case \"Theme\":\n return string && !!theme && value in theme;\n case \"FontSize\":\n var _conf_fontsParsed_body_size, _conf_fontsParsed_body;\n return value === true || !!((_conf_fontsParsed_body = conf.fontsParsed.body) === null || _conf_fontsParsed_body === void 0 ? void 0 : (_conf_fontsParsed_body_size = _conf_fontsParsed_body.size) === null || _conf_fontsParsed_body_size === void 0 ? void 0 : _conf_fontsParsed_body_size[value]) || number || rem;\n case \"FontStyle\":\n var _conf_fontsParsed_body_style, _conf_fontsParsed_body1;\n return !!((_conf_fontsParsed_body1 = conf.fontsParsed.body) === null || _conf_fontsParsed_body1 === void 0 ? void 0 : (_conf_fontsParsed_body_style = _conf_fontsParsed_body1.style) === null || _conf_fontsParsed_body_style === void 0 ? void 0 : _conf_fontsParsed_body_style[value]) || value === \"normal\" || value === \"italic\";\n case \"FontTransform\":\n var _conf_fontsParsed_body_transform, _conf_fontsParsed_body2;\n return !!((_conf_fontsParsed_body2 = conf.fontsParsed.body) === null || _conf_fontsParsed_body2 === void 0 ? void 0 : (_conf_fontsParsed_body_transform = _conf_fontsParsed_body2.transform) === null || _conf_fontsParsed_body_transform === void 0 ? void 0 : _conf_fontsParsed_body_transform[value]) || value === \"none\" || value === \"capitalize\" || value === \"uppercase\" || value === \"lowercase\";\n case \"FontLineHeight\":\n var _conf_fontsParsed_body_lineHeight, _conf_fontsParsed_body3;\n return !!((_conf_fontsParsed_body3 = conf.fontsParsed.body) === null || _conf_fontsParsed_body3 === void 0 ? void 0 : (_conf_fontsParsed_body_lineHeight = _conf_fontsParsed_body3.lineHeight) === null || _conf_fontsParsed_body_lineHeight === void 0 ? void 0 : _conf_fontsParsed_body_lineHeight[value]) || number || rem;\n case \"FontLetterSpacing\":\n var _conf_fontsParsed_body_letterSpacing, _conf_fontsParsed_body4;\n return !!((_conf_fontsParsed_body4 = conf.fontsParsed.body) === null || _conf_fontsParsed_body4 === void 0 ? void 0 : (_conf_fontsParsed_body_letterSpacing = _conf_fontsParsed_body4.letterSpacing) === null || _conf_fontsParsed_body_letterSpacing === void 0 ? void 0 : _conf_fontsParsed_body_letterSpacing[value]) || number || rem;\n case \"number\":\n case \"string\":\n case \"boolean\":\n return (typeof value === \"undefined\" ? \"undefined\" : _type_of(value)) === resolverName;\n case \"any\":\n return true;\n }\n}\nexport {\n getCompiledVariantResolvers,\n getVariantDefinition\n};\n//# sourceMappingURL=variantResolvers.js.map\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './directStyleCSSCompiled'
|
|
@@ -1,513 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
StyleObjectIdentifier,
|
|
3
|
-
StyleObjectRules,
|
|
4
|
-
type StyleObject,
|
|
5
|
-
} from '@tamagui/helpers'
|
|
6
|
-
import { finalizeTransformAccumulator } from '@tamagui/style-grammar/runtime'
|
|
7
|
-
|
|
8
|
-
import type { GetStyleState } from '../types'
|
|
9
|
-
import {
|
|
10
|
-
buildAtomicSlotCSS,
|
|
11
|
-
probeRawSlotIdentity,
|
|
12
|
-
storeRawSlotIdentity,
|
|
13
|
-
type AtomicSlotEntry,
|
|
14
|
-
} from './getCSSStylesAtomic'
|
|
15
|
-
import { normalizeValueWithProperty } from './normalizeValueWithProperty'
|
|
16
|
-
import { shouldInsertStyleRules, updateRules } from './insertStyleRule'
|
|
17
|
-
import { transformsToString } from './transformsToString'
|
|
18
|
-
|
|
19
|
-
export const canGenerateCSS =
|
|
20
|
-
process.env.TAMAGUI_TARGET === 'web' && !process.env.TAMAGUI_DID_OUTPUT_CSS
|
|
21
|
-
|
|
22
|
-
type DirectAtomicState = GetStyleState & {
|
|
23
|
-
flatAtomics?: Record<string, StyleObject>
|
|
24
|
-
flatBorderDefaultRequests?: AtomicSlotEntry[]
|
|
25
|
-
flatTransitions?: AtomicSlotEntry[]
|
|
26
|
-
/** first streamed entry per property when it carried a condition */
|
|
27
|
-
flatSingleEntries?: Record<string, AtomicSlotEntry>
|
|
28
|
-
/** properties with 2+ contributions: combined at completion, ordered by
|
|
29
|
-
* precedence, restoring the deferred slot the cascade tie-break requires
|
|
30
|
-
* (clauseOrderIndependence pins state-after-media at equal specificity) */
|
|
31
|
-
flatSlots?: Record<string, AtomicSlotEntry[]>
|
|
32
|
-
/** the current value carries clauses: open the combined slot up front */
|
|
33
|
-
flatExpectMulti?: boolean
|
|
34
|
-
/** a platform driver may flip this whole pass inline at completion: defer
|
|
35
|
-
* every contribution into slots so the policy stays choosable */
|
|
36
|
-
flatDeferCSS?: boolean
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* A border width was authored, so its edge needs `borderStyle: solid` unless
|
|
41
|
-
* an authored border style owns the property by completion time. Requests key
|
|
42
|
-
* off the authored (pre-expansion) property, matching the emitted class.
|
|
43
|
-
*/
|
|
44
|
-
export function requestBorderStyleDefault(
|
|
45
|
-
state: GetStyleState,
|
|
46
|
-
property: string,
|
|
47
|
-
condition: number,
|
|
48
|
-
identity: string,
|
|
49
|
-
selector: string,
|
|
50
|
-
wrapperSource: readonly string[] | undefined,
|
|
51
|
-
wrapperStart: number,
|
|
52
|
-
wrapperCount: number
|
|
53
|
-
) {
|
|
54
|
-
if (!canGenerateCSS || !state.flatShouldDoClasses) return
|
|
55
|
-
if (state.styleProps.noNormalize === false) return
|
|
56
|
-
const target = borderStyleDefaults[property]
|
|
57
|
-
if (!target) return
|
|
58
|
-
const requests = ((state as DirectAtomicState).flatBorderDefaultRequests ||= [])
|
|
59
|
-
for (let index = 0; index < requests.length; index++) {
|
|
60
|
-
if (requests[index][0] === target && requests[index][3] === identity) {
|
|
61
|
-
return
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
requests.push([
|
|
65
|
-
target,
|
|
66
|
-
'solid',
|
|
67
|
-
condition,
|
|
68
|
-
identity,
|
|
69
|
-
selector,
|
|
70
|
-
wrapperSource,
|
|
71
|
-
wrapperStart,
|
|
72
|
-
wrapperCount,
|
|
73
|
-
])
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function directStyleSignature(
|
|
77
|
-
property: string,
|
|
78
|
-
value: unknown,
|
|
79
|
-
conditionKey = ''
|
|
80
|
-
) {
|
|
81
|
-
return `\u001f${property}\u001f${conditionKey}\u001e${String(value)}`
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const borderStyleDefaults: Record<string, string> = {
|
|
85
|
-
borderWidth: 'borderStyle',
|
|
86
|
-
borderTopWidth: 'borderTopStyle',
|
|
87
|
-
borderRightWidth: 'borderRightStyle',
|
|
88
|
-
borderBottomWidth: 'borderBottomStyle',
|
|
89
|
-
borderLeftWidth: 'borderLeftStyle',
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function registerSlot(
|
|
93
|
-
state: DirectAtomicState,
|
|
94
|
-
atomicKey: string,
|
|
95
|
-
entries: readonly AtomicSlotEntry[]
|
|
96
|
-
) {
|
|
97
|
-
// identity derives from the slot's winning content AFTER normalization and
|
|
98
|
-
// AFTER ordering (base first, conditionals ascending precedence): the same
|
|
99
|
-
// final rules are the same class, whatever order they were contributed in
|
|
100
|
-
const ordered: AtomicSlotEntry[] = []
|
|
101
|
-
for (let index = 0; index < entries.length; index++) {
|
|
102
|
-
const entry = entries[index]
|
|
103
|
-
let value = entry[1]
|
|
104
|
-
if (entry[0] === 'transform' && Array.isArray(value)) {
|
|
105
|
-
value = transformsToString(value)
|
|
106
|
-
}
|
|
107
|
-
entry[1] = normalizeValueWithProperty(value, entry[0])
|
|
108
|
-
const precedence = entry[2] ? Math.floor(entry[2] / 256) : -1
|
|
109
|
-
let insertAt = ordered.length
|
|
110
|
-
while (insertAt > 0) {
|
|
111
|
-
const before = ordered[insertAt - 1]
|
|
112
|
-
const beforePrecedence = before[2] ? Math.floor(before[2] / 256) : -1
|
|
113
|
-
if (beforePrecedence <= precedence) break
|
|
114
|
-
insertAt--
|
|
115
|
-
}
|
|
116
|
-
ordered.splice(insertAt, 0, entry)
|
|
117
|
-
}
|
|
118
|
-
let signature = ''
|
|
119
|
-
for (let index = 0; index < ordered.length; index++) {
|
|
120
|
-
const entry = ordered[index]
|
|
121
|
-
signature += directStyleSignature(entry[0], entry[1], entry[3])
|
|
122
|
-
}
|
|
123
|
-
const built = buildAtomicSlotCSS(atomicKey, ordered, signature)
|
|
124
|
-
if (!built) return
|
|
125
|
-
const styleObject = (built[3] ||= [
|
|
126
|
-
atomicKey,
|
|
127
|
-
built[2],
|
|
128
|
-
built[0],
|
|
129
|
-
undefined,
|
|
130
|
-
built[1],
|
|
131
|
-
]) as StyleObject
|
|
132
|
-
;(state.flatAtomics ||= {})[atomicKey] = styleObject
|
|
133
|
-
state.classNames[atomicKey] = built[0]
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// shared synchronous scratch for streamed and composition single-entry slots
|
|
137
|
-
const scratchEntry: AtomicSlotEntry = ['', '', 0, '', '', undefined, 0, 0]
|
|
138
|
-
const singleSlot: AtomicSlotEntry[] = [scratchEntry]
|
|
139
|
-
|
|
140
|
-
function appendSlotEntry(
|
|
141
|
-
list: AtomicSlotEntry[],
|
|
142
|
-
property: string,
|
|
143
|
-
value: any,
|
|
144
|
-
condition: number,
|
|
145
|
-
identity: string,
|
|
146
|
-
selector: string,
|
|
147
|
-
wrapperSource: readonly string[] | undefined,
|
|
148
|
-
wrapperStart: number,
|
|
149
|
-
wrapperCount: number,
|
|
150
|
-
weak: boolean,
|
|
151
|
-
original?: any
|
|
152
|
-
) {
|
|
153
|
-
for (let index = 0; index < list.length; index++) {
|
|
154
|
-
if (list[index][3] === identity) {
|
|
155
|
-
// a weak write never displaces the identity's existing contribution
|
|
156
|
-
if (weak) return
|
|
157
|
-
list[index][1] = value
|
|
158
|
-
list[index][2] = condition
|
|
159
|
-
list[index][8] = original
|
|
160
|
-
return
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
list.push([
|
|
164
|
-
property,
|
|
165
|
-
value,
|
|
166
|
-
condition,
|
|
167
|
-
identity,
|
|
168
|
-
selector,
|
|
169
|
-
wrapperSource,
|
|
170
|
-
wrapperStart,
|
|
171
|
-
wrapperCount,
|
|
172
|
-
original,
|
|
173
|
-
])
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Stream one CSS contribution. A property's first contribution serializes its
|
|
178
|
-
* class immediately (the overwhelmingly common case pays one cached build and
|
|
179
|
-
* no entry). A second contribution promotes the property to a combined slot,
|
|
180
|
-
* finished at completion by precedence order - the deferred arrangement the
|
|
181
|
-
* equal-specificity cascade tie-break requires (clauseOrderIndependence).
|
|
182
|
-
*/
|
|
183
|
-
export function streamAtomic(
|
|
184
|
-
state: GetStyleState,
|
|
185
|
-
property: string,
|
|
186
|
-
value: any,
|
|
187
|
-
condition: number,
|
|
188
|
-
identity: string,
|
|
189
|
-
selector: string,
|
|
190
|
-
wrapperSource: readonly string[] | undefined,
|
|
191
|
-
wrapperStart: number,
|
|
192
|
-
wrapperCount: number,
|
|
193
|
-
weak: boolean,
|
|
194
|
-
original?: any
|
|
195
|
-
) {
|
|
196
|
-
if (!canGenerateCSS) return
|
|
197
|
-
const direct = state as DirectAtomicState
|
|
198
|
-
|
|
199
|
-
// an existing combined slot absorbs everything for its property
|
|
200
|
-
const slots = direct.flatSlots
|
|
201
|
-
if (slots) {
|
|
202
|
-
const slot = slots[property]
|
|
203
|
-
if (slot) {
|
|
204
|
-
appendSlotEntry(
|
|
205
|
-
slot,
|
|
206
|
-
property,
|
|
207
|
-
value,
|
|
208
|
-
condition,
|
|
209
|
-
identity,
|
|
210
|
-
selector,
|
|
211
|
-
wrapperSource,
|
|
212
|
-
wrapperStart,
|
|
213
|
-
wrapperCount,
|
|
214
|
-
weak,
|
|
215
|
-
original
|
|
216
|
-
)
|
|
217
|
-
return
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const singleEntries = direct.flatSingleEntries
|
|
222
|
-
const singleEntry = singleEntries ? singleEntries[property] : undefined
|
|
223
|
-
const atomics = direct.flatAtomics
|
|
224
|
-
const streamed = atomics ? atomics[property] : undefined
|
|
225
|
-
if (singleEntry) {
|
|
226
|
-
if (singleEntry[3] !== identity) {
|
|
227
|
-
// second distinct contribution: promote the single into a combined slot
|
|
228
|
-
delete singleEntries![property]
|
|
229
|
-
const list = ((direct.flatSlots ||= {})[property] = [singleEntry])
|
|
230
|
-
appendSlotEntry(
|
|
231
|
-
list,
|
|
232
|
-
property,
|
|
233
|
-
value,
|
|
234
|
-
condition,
|
|
235
|
-
identity,
|
|
236
|
-
selector,
|
|
237
|
-
wrapperSource,
|
|
238
|
-
wrapperStart,
|
|
239
|
-
wrapperCount,
|
|
240
|
-
weak,
|
|
241
|
-
original
|
|
242
|
-
)
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
// repeat write for the same identity replaces the single in place below
|
|
246
|
-
if (weak) return
|
|
247
|
-
} else if (streamed !== undefined) {
|
|
248
|
-
// a plain single was streamed: its normalized value lives in its own
|
|
249
|
-
// style object, so promotion needs no side record
|
|
250
|
-
if (identity) {
|
|
251
|
-
const list = ((direct.flatSlots ||= {})[property] = [
|
|
252
|
-
[property, (streamed as any)[1], 0, '', '', undefined, 0, 0],
|
|
253
|
-
])
|
|
254
|
-
appendSlotEntry(
|
|
255
|
-
list,
|
|
256
|
-
property,
|
|
257
|
-
value,
|
|
258
|
-
condition,
|
|
259
|
-
identity,
|
|
260
|
-
selector,
|
|
261
|
-
wrapperSource,
|
|
262
|
-
wrapperStart,
|
|
263
|
-
wrapperCount,
|
|
264
|
-
weak,
|
|
265
|
-
original
|
|
266
|
-
)
|
|
267
|
-
return
|
|
268
|
-
}
|
|
269
|
-
if (weak) return
|
|
270
|
-
// repeat plain write replaces the single in place below
|
|
271
|
-
} else if (weak && state.classNames[property] !== undefined) {
|
|
272
|
-
// an externally merged class owns the property; the styled-default
|
|
273
|
-
// restore never displaces it
|
|
274
|
-
return
|
|
275
|
-
} else if (direct.flatExpectMulti === true || direct.flatDeferCSS === true) {
|
|
276
|
-
// the value is known to carry more contributions for this property, or a
|
|
277
|
-
// platform driver may flip this pass inline at completion: open the
|
|
278
|
-
// combined slot directly instead of building a single class
|
|
279
|
-
const list: AtomicSlotEntry[] = ((direct.flatSlots ||= {})[property] = [])
|
|
280
|
-
appendSlotEntry(
|
|
281
|
-
list,
|
|
282
|
-
property,
|
|
283
|
-
value,
|
|
284
|
-
condition,
|
|
285
|
-
identity,
|
|
286
|
-
selector,
|
|
287
|
-
wrapperSource,
|
|
288
|
-
wrapperStart,
|
|
289
|
-
wrapperCount,
|
|
290
|
-
weak,
|
|
291
|
-
original
|
|
292
|
-
)
|
|
293
|
-
return
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// repeat authored base values hit the raw memo and skip normalization,
|
|
297
|
-
// signature building, and the identity lookup chain entirely
|
|
298
|
-
if (!identity) {
|
|
299
|
-
const memo = probeRawSlotIdentity(property, value)
|
|
300
|
-
if (memo) {
|
|
301
|
-
const styleObject = (memo[3] ||= [
|
|
302
|
-
property,
|
|
303
|
-
memo[2],
|
|
304
|
-
memo[0],
|
|
305
|
-
undefined,
|
|
306
|
-
memo[1],
|
|
307
|
-
]) as StyleObject
|
|
308
|
-
;(direct.flatAtomics ||= {})[property] = styleObject
|
|
309
|
-
state.classNames[property] = memo[0]
|
|
310
|
-
return
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
const rawValue = value
|
|
314
|
-
if (property === 'transform' && Array.isArray(value)) {
|
|
315
|
-
value = transformsToString(value)
|
|
316
|
-
}
|
|
317
|
-
const normalized = normalizeValueWithProperty(value, property)
|
|
318
|
-
scratchEntry[0] = property
|
|
319
|
-
scratchEntry[1] = normalized
|
|
320
|
-
scratchEntry[2] = condition
|
|
321
|
-
scratchEntry[3] = identity
|
|
322
|
-
scratchEntry[4] = selector
|
|
323
|
-
scratchEntry[5] = wrapperSource
|
|
324
|
-
scratchEntry[6] = wrapperStart
|
|
325
|
-
scratchEntry[7] = wrapperCount
|
|
326
|
-
const built = buildAtomicSlotCSS(
|
|
327
|
-
property,
|
|
328
|
-
singleSlot,
|
|
329
|
-
directStyleSignature(property, normalized, identity)
|
|
330
|
-
)
|
|
331
|
-
scratchEntry[5] = undefined
|
|
332
|
-
scratchEntry[1] = ''
|
|
333
|
-
if (!built) return
|
|
334
|
-
if (!identity) {
|
|
335
|
-
storeRawSlotIdentity(property, rawValue, built)
|
|
336
|
-
}
|
|
337
|
-
if (identity) {
|
|
338
|
-
;(direct.flatSingleEntries ||= {})[property] = [
|
|
339
|
-
property,
|
|
340
|
-
normalized,
|
|
341
|
-
condition,
|
|
342
|
-
identity,
|
|
343
|
-
selector,
|
|
344
|
-
wrapperSource,
|
|
345
|
-
wrapperStart,
|
|
346
|
-
wrapperCount,
|
|
347
|
-
]
|
|
348
|
-
}
|
|
349
|
-
const styleObject = (built[3] ||= [
|
|
350
|
-
property,
|
|
351
|
-
built[2],
|
|
352
|
-
built[0],
|
|
353
|
-
undefined,
|
|
354
|
-
built[1],
|
|
355
|
-
]) as StyleObject
|
|
356
|
-
;(direct.flatAtomics ||= {})[property] = styleObject
|
|
357
|
-
state.classNames[property] = built[0]
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* The CSS residue that genuinely cannot stream: border-style defaults resolve
|
|
362
|
-
* against what the pass authored, promoted multi-contribution slots combine
|
|
363
|
-
* in precedence order, transition longhands group into one record, and the
|
|
364
|
-
* transform accumulator becomes the transform slot's base.
|
|
365
|
-
*/
|
|
366
|
-
export function completeStreamingCSS(state: GetStyleState) {
|
|
367
|
-
if (!canGenerateCSS) return
|
|
368
|
-
const direct = state as DirectAtomicState
|
|
369
|
-
const cssMode = !!state.flatShouldDoClasses
|
|
370
|
-
const singleEntries = direct.flatSingleEntries
|
|
371
|
-
|
|
372
|
-
const requests = direct.flatBorderDefaultRequests
|
|
373
|
-
if (cssMode && requests) {
|
|
374
|
-
direct.flatBorderDefaultRequests = undefined
|
|
375
|
-
for (let index = 0; index < requests.length; index++) {
|
|
376
|
-
const request = requests[index]
|
|
377
|
-
const target = request[0]
|
|
378
|
-
const targetSingle = singleEntries ? singleEntries[target] : undefined
|
|
379
|
-
if (targetSingle) {
|
|
380
|
-
if (targetSingle[3] === request[3]) continue
|
|
381
|
-
// promote so the synthetic joins the target's combined slot
|
|
382
|
-
delete singleEntries![target]
|
|
383
|
-
;((direct.flatSlots ||= {})[target] = [targetSingle]).push(request)
|
|
384
|
-
continue
|
|
385
|
-
}
|
|
386
|
-
const slot = direct.flatSlots ? direct.flatSlots[target] : undefined
|
|
387
|
-
if (slot) {
|
|
388
|
-
let covered = false
|
|
389
|
-
for (let t = 0; t < slot.length; t++) {
|
|
390
|
-
if (!slot[t][2] || slot[t][3] === request[3]) {
|
|
391
|
-
covered = true
|
|
392
|
-
break
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
if (!covered) slot.push(request)
|
|
396
|
-
continue
|
|
397
|
-
}
|
|
398
|
-
// an unconditioned streamed single owns the property outright
|
|
399
|
-
if (direct.flatAtomics && direct.flatAtomics[target] !== undefined) continue
|
|
400
|
-
// nothing authored: an externally merged class still suppresses it
|
|
401
|
-
if (state.classNames[target] !== undefined) continue
|
|
402
|
-
registerSlot(direct, target, [request])
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// the transform accumulator is the transform slot's base contribution
|
|
407
|
-
if (cssMode && state.transformAccumulator) {
|
|
408
|
-
const transform = finalizeTransformAccumulator(state.transformAccumulator)
|
|
409
|
-
state.transformAccumulator = undefined
|
|
410
|
-
const accumulated: AtomicSlotEntry = [
|
|
411
|
-
'transform',
|
|
412
|
-
Array.isArray(transform) ? transformsToString(transform) : transform,
|
|
413
|
-
0,
|
|
414
|
-
'',
|
|
415
|
-
'',
|
|
416
|
-
undefined,
|
|
417
|
-
0,
|
|
418
|
-
0,
|
|
419
|
-
]
|
|
420
|
-
const slot = direct.flatSlots ? direct.flatSlots.transform : undefined
|
|
421
|
-
const transformSingle = singleEntries ? singleEntries.transform : undefined
|
|
422
|
-
if (slot) {
|
|
423
|
-
slot.unshift(accumulated)
|
|
424
|
-
} else if (transformSingle) {
|
|
425
|
-
delete singleEntries!.transform
|
|
426
|
-
;(direct.flatSlots ||= {}).transform = [accumulated, transformSingle]
|
|
427
|
-
} else {
|
|
428
|
-
;(direct.flatSlots ||= {}).transform = [accumulated]
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
const slots = direct.flatSlots
|
|
433
|
-
if (slots) {
|
|
434
|
-
direct.flatSlots = undefined
|
|
435
|
-
for (const property in slots) {
|
|
436
|
-
registerSlot(direct, property, slots[property])
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
const transitions = direct.flatTransitions
|
|
441
|
-
if (transitions) {
|
|
442
|
-
direct.flatTransitions = undefined
|
|
443
|
-
registerSlot(direct, 'transition', transitions)
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
export function flushDirectStyles(state: GetStyleState, clear = false) {
|
|
448
|
-
if (!canGenerateCSS) {
|
|
449
|
-
if (clear) (state as DirectAtomicState).flatAtomics = undefined
|
|
450
|
-
return
|
|
451
|
-
}
|
|
452
|
-
const direct = state as DirectAtomicState
|
|
453
|
-
const atomics = direct.flatAtomics
|
|
454
|
-
if (!atomics) return
|
|
455
|
-
for (const property in atomics) {
|
|
456
|
-
const styleObject = atomics[property]
|
|
457
|
-
const identifier = styleObject[StyleObjectIdentifier]
|
|
458
|
-
if (shouldInsertStyleRules(identifier)) {
|
|
459
|
-
// rulesToInsert owns its array; never expose the cache's copy
|
|
460
|
-
const rules = styleObject[StyleObjectRules].slice()
|
|
461
|
-
styleObject[StyleObjectRules] = rules
|
|
462
|
-
updateRules(identifier, rules)
|
|
463
|
-
state.flatRulesToInsert![identifier] = styleObject
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (clear) direct.flatAtomics = undefined
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
export function addComposition(state: GetStyleState, property: 'translate' | 'scale') {
|
|
470
|
-
if (!canGenerateCSS || state.classNames[property]) return
|
|
471
|
-
const value =
|
|
472
|
-
property === 'translate'
|
|
473
|
-
? 'var(--t-x, 0px) var(--t-y, 0px)'
|
|
474
|
-
: 'var(--t-scale-x, 1) var(--t-scale-y, 1)'
|
|
475
|
-
const defaults =
|
|
476
|
-
property === 'translate' ? '--t-x:0px;--t-y:0px' : '--t-scale-x:1;--t-scale-y:1'
|
|
477
|
-
scratchEntry[0] = property
|
|
478
|
-
scratchEntry[1] = value
|
|
479
|
-
scratchEntry[2] = 0
|
|
480
|
-
scratchEntry[3] = ''
|
|
481
|
-
scratchEntry[4] = ''
|
|
482
|
-
scratchEntry[5] = undefined
|
|
483
|
-
scratchEntry[6] = 0
|
|
484
|
-
scratchEntry[7] = 0
|
|
485
|
-
const built = buildAtomicSlotCSS(
|
|
486
|
-
property,
|
|
487
|
-
singleSlot,
|
|
488
|
-
directStyleSignature(property, value, '')
|
|
489
|
-
)
|
|
490
|
-
if (!built) return
|
|
491
|
-
const identifier = built[0]
|
|
492
|
-
const rules = built[1].slice()
|
|
493
|
-
rules.unshift(`:where(.${identifier}){${defaults}}`)
|
|
494
|
-
if (shouldInsertStyleRules(identifier)) {
|
|
495
|
-
updateRules(identifier, rules)
|
|
496
|
-
state.flatRulesToInsert![identifier] = [
|
|
497
|
-
property,
|
|
498
|
-
built[2],
|
|
499
|
-
identifier,
|
|
500
|
-
undefined,
|
|
501
|
-
rules,
|
|
502
|
-
] as any
|
|
503
|
-
}
|
|
504
|
-
state.classNames[property] = identifier
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
export function clearFrameAtomic(state: GetStyleState, atomicKey: string) {
|
|
508
|
-
const direct = state as DirectAtomicState
|
|
509
|
-
if (direct.flatAtomics) delete direct.flatAtomics[atomicKey]
|
|
510
|
-
if (direct.flatSingleEntries) delete direct.flatSingleEntries[atomicKey]
|
|
511
|
-
if (direct.flatSlots) delete direct.flatSlots[atomicKey]
|
|
512
|
-
if (atomicKey === 'transition') direct.flatTransitions = undefined
|
|
513
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { GetStyleState } from '../types'
|
|
2
|
-
|
|
3
|
-
export const canGenerateCSS = false
|
|
4
|
-
export const directStyleSignature = () => ''
|
|
5
|
-
|
|
6
|
-
export function streamAtomic(
|
|
7
|
-
_state: GetStyleState,
|
|
8
|
-
_property: string,
|
|
9
|
-
_value: any,
|
|
10
|
-
_condition: number,
|
|
11
|
-
_identity: string,
|
|
12
|
-
_selector: string,
|
|
13
|
-
_wrapperSource: readonly string[] | undefined,
|
|
14
|
-
_wrapperStart: number,
|
|
15
|
-
_wrapperCount: number,
|
|
16
|
-
_weak: boolean,
|
|
17
|
-
_original?: any
|
|
18
|
-
) {}
|
|
19
|
-
export function completeStreamingCSS(_state: GetStyleState) {}
|
|
20
|
-
export function requestBorderStyleDefault(
|
|
21
|
-
_state: GetStyleState,
|
|
22
|
-
_property: string,
|
|
23
|
-
_condition: number,
|
|
24
|
-
_identity: string,
|
|
25
|
-
_selector: string,
|
|
26
|
-
_wrapperSource: readonly string[] | undefined,
|
|
27
|
-
_wrapperStart: number,
|
|
28
|
-
_wrapperCount: number
|
|
29
|
-
) {}
|
|
30
|
-
export function flushDirectStyles(_state: GetStyleState, _clear = false) {}
|
|
31
|
-
export function addComposition(_state: GetStyleState, _property: 'translate' | 'scale') {}
|
|
32
|
-
export function clearFrameAtomic(_state: GetStyleState, _atomicKey: string) {}
|