zyzz 0.0.0 → 0.0.3
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/LICENSE +21 -0
- package/README.md +380 -0
- package/dist/Config.d.ts +170 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Config.js +249 -0
- package/dist/Config.js.map +1 -0
- package/dist/Props.d.ts +7 -0
- package/dist/Props.d.ts.map +1 -0
- package/dist/Props.js +3 -0
- package/dist/Props.js.map +1 -0
- package/dist/Style.d.ts +170 -0
- package/dist/Style.d.ts.map +1 -0
- package/dist/Style.js +325 -0
- package/dist/Style.js.map +1 -0
- package/dist/Theme.d.ts +157 -0
- package/dist/Theme.d.ts.map +1 -0
- package/dist/Theme.js +273 -0
- package/dist/Theme.js.map +1 -0
- package/dist/babel/NativeEdits.d.ts +8 -0
- package/dist/babel/NativeEdits.d.ts.map +1 -0
- package/dist/babel/NativeEdits.js +233 -0
- package/dist/babel/NativeEdits.js.map +1 -0
- package/dist/babel/NativeJsx.d.ts +10 -0
- package/dist/babel/NativeJsx.d.ts.map +1 -0
- package/dist/babel/NativeJsx.js +204 -0
- package/dist/babel/NativeJsx.js.map +1 -0
- package/dist/babel/index.d.ts +51 -0
- package/dist/babel/index.d.ts.map +1 -0
- package/dist/babel/index.js +220 -0
- package/dist/babel/index.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +178 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compiler/Graph.d.ts +64 -0
- package/dist/compiler/Graph.d.ts.map +1 -0
- package/dist/compiler/Graph.js +1111 -0
- package/dist/compiler/Graph.js.map +1 -0
- package/dist/compiler/Native.d.ts +53 -0
- package/dist/compiler/Native.d.ts.map +1 -0
- package/dist/compiler/Native.js +617 -0
- package/dist/compiler/Native.js.map +1 -0
- package/dist/compiler/Source.d.ts +167 -0
- package/dist/compiler/Source.d.ts.map +1 -0
- package/dist/compiler/Source.js +1012 -0
- package/dist/compiler/Source.js.map +1 -0
- package/dist/compiler/Transform.d.ts +57 -0
- package/dist/compiler/Transform.d.ts.map +1 -0
- package/dist/compiler/Transform.js +886 -0
- package/dist/compiler/Transform.js.map +1 -0
- package/dist/compiler/index.d.ts +13 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +13 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/internal/Applications.d.ts +35 -0
- package/dist/compiler/internal/Applications.d.ts.map +1 -0
- package/dist/compiler/internal/Applications.js +248 -0
- package/dist/compiler/internal/Applications.js.map +1 -0
- package/dist/compiler/internal/AtRules.d.ts +8 -0
- package/dist/compiler/internal/AtRules.d.ts.map +1 -0
- package/dist/compiler/internal/AtRules.js +180 -0
- package/dist/compiler/internal/AtRules.js.map +1 -0
- package/dist/compiler/internal/Catalogs.d.ts +19 -0
- package/dist/compiler/internal/Catalogs.d.ts.map +1 -0
- package/dist/compiler/internal/Catalogs.js +68 -0
- package/dist/compiler/internal/Catalogs.js.map +1 -0
- package/dist/compiler/internal/ColorProfiles.d.ts +3 -0
- package/dist/compiler/internal/ColorProfiles.d.ts.map +1 -0
- package/dist/compiler/internal/ColorProfiles.js +84 -0
- package/dist/compiler/internal/ColorProfiles.js.map +1 -0
- package/dist/compiler/internal/CompositionBindings.d.ts +16 -0
- package/dist/compiler/internal/CompositionBindings.d.ts.map +1 -0
- package/dist/compiler/internal/CompositionBindings.js +89 -0
- package/dist/compiler/internal/CompositionBindings.js.map +1 -0
- package/dist/compiler/internal/Compositions.d.ts +32 -0
- package/dist/compiler/internal/Compositions.d.ts.map +1 -0
- package/dist/compiler/internal/Compositions.js +464 -0
- package/dist/compiler/internal/Compositions.js.map +1 -0
- package/dist/compiler/internal/Configurations.d.ts +21 -0
- package/dist/compiler/internal/Configurations.d.ts.map +1 -0
- package/dist/compiler/internal/Configurations.js +171 -0
- package/dist/compiler/internal/Configurations.js.map +1 -0
- package/dist/compiler/internal/Contract.d.ts +27 -0
- package/dist/compiler/internal/Contract.d.ts.map +1 -0
- package/dist/compiler/internal/Contract.js +607 -0
- package/dist/compiler/internal/Contract.js.map +1 -0
- package/dist/compiler/internal/Contributions.d.ts +54 -0
- package/dist/compiler/internal/Contributions.d.ts.map +1 -0
- package/dist/compiler/internal/Contributions.js +1109 -0
- package/dist/compiler/internal/Contributions.js.map +1 -0
- package/dist/compiler/internal/Descriptors.d.ts +15 -0
- package/dist/compiler/internal/Descriptors.d.ts.map +1 -0
- package/dist/compiler/internal/Descriptors.js +183 -0
- package/dist/compiler/internal/Descriptors.js.map +1 -0
- package/dist/compiler/internal/Dynamic.d.ts +14 -0
- package/dist/compiler/internal/Dynamic.d.ts.map +1 -0
- package/dist/compiler/internal/Dynamic.js +172 -0
- package/dist/compiler/internal/Dynamic.js.map +1 -0
- package/dist/compiler/internal/Edits.d.ts +12 -0
- package/dist/compiler/internal/Edits.d.ts.map +1 -0
- package/dist/compiler/internal/Edits.js +5 -0
- package/dist/compiler/internal/Edits.js.map +1 -0
- package/dist/compiler/internal/Expression.d.ts +12 -0
- package/dist/compiler/internal/Expression.d.ts.map +1 -0
- package/dist/compiler/internal/Expression.js +98 -0
- package/dist/compiler/internal/Expression.js.map +1 -0
- package/dist/compiler/internal/Functions.d.ts +5 -0
- package/dist/compiler/internal/Functions.d.ts.map +1 -0
- package/dist/compiler/internal/Functions.js +191 -0
- package/dist/compiler/internal/Functions.js.map +1 -0
- package/dist/compiler/internal/Identifiers.d.ts +9 -0
- package/dist/compiler/internal/Identifiers.d.ts.map +1 -0
- package/dist/compiler/internal/Identifiers.js +106 -0
- package/dist/compiler/internal/Identifiers.js.map +1 -0
- package/dist/compiler/internal/Keyframes.d.ts +5 -0
- package/dist/compiler/internal/Keyframes.d.ts.map +1 -0
- package/dist/compiler/internal/Keyframes.js +51 -0
- package/dist/compiler/internal/Keyframes.js.map +1 -0
- package/dist/compiler/internal/Namespaces.d.ts +17 -0
- package/dist/compiler/internal/Namespaces.d.ts.map +1 -0
- package/dist/compiler/internal/Namespaces.js +265 -0
- package/dist/compiler/internal/Namespaces.js.map +1 -0
- package/dist/compiler/internal/NativeBindings.d.ts +74 -0
- package/dist/compiler/internal/NativeBindings.d.ts.map +1 -0
- package/dist/compiler/internal/NativeBindings.js +117 -0
- package/dist/compiler/internal/NativeBindings.js.map +1 -0
- package/dist/compiler/internal/PackedStyles.d.ts +35 -0
- package/dist/compiler/internal/PackedStyles.d.ts.map +1 -0
- package/dist/compiler/internal/PackedStyles.js +345 -0
- package/dist/compiler/internal/PackedStyles.js.map +1 -0
- package/dist/compiler/internal/Properties.d.ts +5 -0
- package/dist/compiler/internal/Properties.d.ts.map +1 -0
- package/dist/compiler/internal/Properties.js +82 -0
- package/dist/compiler/internal/Properties.js.map +1 -0
- package/dist/compiler/internal/RecipeConditions.d.ts +41 -0
- package/dist/compiler/internal/RecipeConditions.d.ts.map +1 -0
- package/dist/compiler/internal/RecipeConditions.js +82 -0
- package/dist/compiler/internal/RecipeConditions.js.map +1 -0
- package/dist/compiler/internal/RecipePayloads.d.ts +31 -0
- package/dist/compiler/internal/RecipePayloads.d.ts.map +1 -0
- package/dist/compiler/internal/RecipePayloads.js +99 -0
- package/dist/compiler/internal/RecipePayloads.js.map +1 -0
- package/dist/compiler/internal/Recipes.d.ts +32 -0
- package/dist/compiler/internal/Recipes.d.ts.map +1 -0
- package/dist/compiler/internal/Recipes.js +339 -0
- package/dist/compiler/internal/Recipes.js.map +1 -0
- package/dist/compiler/internal/Relative.d.ts +19 -0
- package/dist/compiler/internal/Relative.d.ts.map +1 -0
- package/dist/compiler/internal/Relative.js +62 -0
- package/dist/compiler/internal/Relative.js.map +1 -0
- package/dist/compiler/internal/Scope.d.ts +10 -0
- package/dist/compiler/internal/Scope.d.ts.map +1 -0
- package/dist/compiler/internal/Scope.js +28 -0
- package/dist/compiler/internal/Scope.js.map +1 -0
- package/dist/compiler/internal/Selectors.d.ts +12 -0
- package/dist/compiler/internal/Selectors.d.ts.map +1 -0
- package/dist/compiler/internal/Selectors.js +265 -0
- package/dist/compiler/internal/Selectors.js.map +1 -0
- package/dist/compiler/internal/Static.d.ts +39 -0
- package/dist/compiler/internal/Static.d.ts.map +1 -0
- package/dist/compiler/internal/Static.js +532 -0
- package/dist/compiler/internal/Static.js.map +1 -0
- package/dist/compiler/internal/Stylesheets.d.ts +47 -0
- package/dist/compiler/internal/Stylesheets.d.ts.map +1 -0
- package/dist/compiler/internal/Stylesheets.js +272 -0
- package/dist/compiler/internal/Stylesheets.js.map +1 -0
- package/dist/compiler/internal/Syntax.d.ts +17 -0
- package/dist/compiler/internal/Syntax.d.ts.map +1 -0
- package/dist/compiler/internal/Syntax.js +19 -0
- package/dist/compiler/internal/Syntax.js.map +1 -0
- package/dist/compiler/internal/Themes.d.ts +158 -0
- package/dist/compiler/internal/Themes.d.ts.map +1 -0
- package/dist/compiler/internal/Themes.js +1169 -0
- package/dist/compiler/internal/Themes.js.map +1 -0
- package/dist/compiler/internal/Variables.d.ts +31 -0
- package/dist/compiler/internal/Variables.d.ts.map +1 -0
- package/dist/compiler/internal/Variables.js +376 -0
- package/dist/compiler/internal/Variables.js.map +1 -0
- package/dist/compiler/internal/ViewTransitions.d.ts +3 -0
- package/dist/compiler/internal/ViewTransitions.d.ts.map +1 -0
- package/dist/compiler/internal/ViewTransitions.js +68 -0
- package/dist/compiler/internal/ViewTransitions.js.map +1 -0
- package/dist/cx.d.ts +18 -0
- package/dist/cx.d.ts.map +1 -0
- package/dist/cx.js +60 -0
- package/dist/cx.js.map +1 -0
- package/dist/default.d.ts +3225 -0
- package/dist/default.d.ts.map +1 -0
- package/dist/default.js +547 -0
- package/dist/default.js.map +7 -0
- package/dist/default.js.zyzz.json +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Authoring.d.ts +26 -0
- package/dist/internal/Authoring.d.ts.map +1 -0
- package/dist/internal/Authoring.js +134 -0
- package/dist/internal/Authoring.js.map +1 -0
- package/dist/internal/Binding.d.ts +64 -0
- package/dist/internal/Binding.d.ts.map +1 -0
- package/dist/internal/Binding.js +27 -0
- package/dist/internal/Binding.js.map +1 -0
- package/dist/internal/BindingDomains.d.ts +11 -0
- package/dist/internal/BindingDomains.d.ts.map +1 -0
- package/dist/internal/BindingDomains.js +459 -0
- package/dist/internal/BindingDomains.js.map +1 -0
- package/dist/internal/Cascade.d.ts +45 -0
- package/dist/internal/Cascade.d.ts.map +1 -0
- package/dist/internal/Cascade.js +165 -0
- package/dist/internal/Cascade.js.map +1 -0
- package/dist/internal/Compound.d.ts +132 -0
- package/dist/internal/Compound.d.ts.map +1 -0
- package/dist/internal/Compound.js +2 -0
- package/dist/internal/Compound.js.map +1 -0
- package/dist/internal/Condition.d.ts +33 -0
- package/dist/internal/Condition.d.ts.map +1 -0
- package/dist/internal/Condition.js +180 -0
- package/dist/internal/Condition.js.map +1 -0
- package/dist/internal/Corner.d.ts +9 -0
- package/dist/internal/Corner.d.ts.map +1 -0
- package/dist/internal/Corner.js +14 -0
- package/dist/internal/Corner.js.map +1 -0
- package/dist/internal/FunctionSyntax.d.ts +27 -0
- package/dist/internal/FunctionSyntax.d.ts.map +1 -0
- package/dist/internal/FunctionSyntax.js +91 -0
- package/dist/internal/FunctionSyntax.js.map +1 -0
- package/dist/internal/FunctionValue.d.ts +19 -0
- package/dist/internal/FunctionValue.d.ts.map +1 -0
- package/dist/internal/FunctionValue.js +2 -0
- package/dist/internal/FunctionValue.js.map +1 -0
- package/dist/internal/Geometry.d.ts +8 -0
- package/dist/internal/Geometry.d.ts.map +1 -0
- package/dist/internal/Geometry.js +2 -0
- package/dist/internal/Geometry.js.map +1 -0
- package/dist/internal/Grid.d.ts +15 -0
- package/dist/internal/Grid.d.ts.map +1 -0
- package/dist/internal/Grid.js +2 -0
- package/dist/internal/Grid.js.map +1 -0
- package/dist/internal/Identifier.d.ts +15 -0
- package/dist/internal/Identifier.d.ts.map +1 -0
- package/dist/internal/Identifier.js +2 -0
- package/dist/internal/Identifier.js.map +1 -0
- package/dist/internal/Identity.d.ts +16 -0
- package/dist/internal/Identity.d.ts.map +1 -0
- package/dist/internal/Identity.js +78 -0
- package/dist/internal/Identity.js.map +1 -0
- package/dist/internal/Lexical.d.ts +89 -0
- package/dist/internal/Lexical.d.ts.map +1 -0
- package/dist/internal/Lexical.js +15 -0
- package/dist/internal/Lexical.js.map +1 -0
- package/dist/internal/Literal.d.ts +3459 -0
- package/dist/internal/Literal.d.ts.map +1 -0
- package/dist/internal/Literal.js +3371 -0
- package/dist/internal/Literal.js.map +1 -0
- package/dist/internal/NativeProperties.d.ts +596 -0
- package/dist/internal/NativeProperties.d.ts.map +1 -0
- package/dist/internal/NativeProperties.js +2 -0
- package/dist/internal/NativeProperties.js.map +1 -0
- package/dist/internal/Numeric.d.ts +23 -0
- package/dist/internal/Numeric.d.ts.map +1 -0
- package/dist/internal/Numeric.js +2 -0
- package/dist/internal/Numeric.js.map +1 -0
- package/dist/internal/Query.d.ts +15 -0
- package/dist/internal/Query.d.ts.map +1 -0
- package/dist/internal/Query.js +58 -0
- package/dist/internal/Query.js.map +1 -0
- package/dist/internal/Recipe.d.ts +17 -0
- package/dist/internal/Recipe.d.ts.map +1 -0
- package/dist/internal/Recipe.js +2 -0
- package/dist/internal/Recipe.js.map +1 -0
- package/dist/internal/RuleReference.d.ts +23 -0
- package/dist/internal/RuleReference.d.ts.map +1 -0
- package/dist/internal/RuleReference.js +65 -0
- package/dist/internal/RuleReference.js.map +1 -0
- package/dist/internal/Scheme.d.ts +12 -0
- package/dist/internal/Scheme.d.ts.map +1 -0
- package/dist/internal/Scheme.js +16 -0
- package/dist/internal/Scheme.js.map +1 -0
- package/dist/internal/Shorthands.d.ts +20 -0
- package/dist/internal/Shorthands.d.ts.map +1 -0
- package/dist/internal/Shorthands.js +50 -0
- package/dist/internal/Shorthands.js.map +1 -0
- package/dist/internal/Targets.d.ts +43 -0
- package/dist/internal/Targets.d.ts.map +1 -0
- package/dist/internal/Targets.js +60 -0
- package/dist/internal/Targets.js.map +1 -0
- package/dist/internal/Token.d.ts +104 -0
- package/dist/internal/Token.d.ts.map +1 -0
- package/dist/internal/Token.js +162 -0
- package/dist/internal/Token.js.map +1 -0
- package/dist/internal/Tuple.d.ts +23 -0
- package/dist/internal/Tuple.d.ts.map +1 -0
- package/dist/internal/Tuple.js +2 -0
- package/dist/internal/Tuple.js.map +1 -0
- package/dist/internal/Typography.d.ts +23 -0
- package/dist/internal/Typography.d.ts.map +1 -0
- package/dist/internal/Typography.js +18 -0
- package/dist/internal/Typography.js.map +1 -0
- package/dist/internal/Value.d.ts +74 -0
- package/dist/internal/Value.d.ts.map +1 -0
- package/dist/internal/Value.js +60 -0
- package/dist/internal/Value.js.map +1 -0
- package/dist/metro/Graph.d.ts +8 -0
- package/dist/metro/Graph.d.ts.map +1 -0
- package/dist/metro/Graph.js +63 -0
- package/dist/metro/Graph.js.map +1 -0
- package/dist/metro/Watch.d.ts +21 -0
- package/dist/metro/Watch.d.ts.map +1 -0
- package/dist/metro/Watch.js +51 -0
- package/dist/metro/Watch.js.map +1 -0
- package/dist/metro/index.d.ts +30 -0
- package/dist/metro/index.d.ts.map +1 -0
- package/dist/metro/index.js +52 -0
- package/dist/metro/index.js.map +1 -0
- package/dist/metro/transformer.d.ts +21 -0
- package/dist/metro/transformer.d.ts.map +1 -0
- package/dist/metro/transformer.js +71 -0
- package/dist/metro/transformer.js.map +1 -0
- package/dist/next/index.d.ts +18 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +92 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/loader.d.ts +16 -0
- package/dist/next/loader.d.ts.map +1 -0
- package/dist/next/loader.js +282 -0
- package/dist/next/loader.js.map +1 -0
- package/dist/node/Host.d.ts +80 -0
- package/dist/node/Host.d.ts.map +1 -0
- package/dist/node/Host.js +882 -0
- package/dist/node/Host.js.map +1 -0
- package/dist/node/index.d.ts +7 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +7 -0
- package/dist/node/index.js.map +1 -0
- package/dist/react-native/Host.d.ts +76 -0
- package/dist/react-native/Host.d.ts.map +1 -0
- package/dist/react-native/Host.js +209 -0
- package/dist/react-native/Host.js.map +1 -0
- package/dist/react-native/StyleSheet.d.ts +226 -0
- package/dist/react-native/StyleSheet.d.ts.map +1 -0
- package/dist/react-native/StyleSheet.js +606 -0
- package/dist/react-native/StyleSheet.js.map +1 -0
- package/dist/react-native/Variants.d.ts +38 -0
- package/dist/react-native/Variants.d.ts.map +1 -0
- package/dist/react-native/Variants.js +66 -0
- package/dist/react-native/Variants.js.map +1 -0
- package/dist/react-native/index.d.ts +8 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +8 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/internal/Color.d.ts +7 -0
- package/dist/react-native/internal/Color.d.ts.map +1 -0
- package/dist/react-native/internal/Color.js +93 -0
- package/dist/react-native/internal/Color.js.map +1 -0
- package/dist/react-native/internal/NativeSchema.d.ts +5138 -0
- package/dist/react-native/internal/NativeSchema.d.ts.map +1 -0
- package/dist/react-native/internal/NativeSchema.js +3097 -0
- package/dist/react-native/internal/NativeSchema.js.map +1 -0
- package/dist/react-native/internal/Scalar.d.ts +95 -0
- package/dist/react-native/internal/Scalar.d.ts.map +1 -0
- package/dist/react-native/internal/Scalar.js +199 -0
- package/dist/react-native/internal/Scalar.js.map +1 -0
- package/dist/react-native/internal/Values.d.ts +5 -0
- package/dist/react-native/internal/Values.d.ts.map +1 -0
- package/dist/react-native/internal/Values.js +65 -0
- package/dist/react-native/internal/Values.js.map +1 -0
- package/dist/react-native/react.d.ts +22 -0
- package/dist/react-native/react.d.ts.map +1 -0
- package/dist/react-native/react.js +26 -0
- package/dist/react-native/react.js.map +1 -0
- package/dist/reset.css +244 -0
- package/dist/runtime/Appearance.d.ts +55 -0
- package/dist/runtime/Appearance.d.ts.map +1 -0
- package/dist/runtime/Appearance.js +84 -0
- package/dist/runtime/Appearance.js.map +1 -0
- package/dist/runtime/Composition.d.ts +46 -0
- package/dist/runtime/Composition.d.ts.map +1 -0
- package/dist/runtime/Composition.js +52 -0
- package/dist/runtime/Composition.js.map +1 -0
- package/dist/runtime/CompositionHtml.d.ts +15 -0
- package/dist/runtime/CompositionHtml.d.ts.map +1 -0
- package/dist/runtime/CompositionHtml.js +20 -0
- package/dist/runtime/CompositionHtml.js.map +1 -0
- package/dist/runtime/ConditionalRecipe.d.ts +30 -0
- package/dist/runtime/ConditionalRecipe.d.ts.map +1 -0
- package/dist/runtime/ConditionalRecipe.js +39 -0
- package/dist/runtime/ConditionalRecipe.js.map +1 -0
- package/dist/runtime/Dynamic.d.ts +19 -0
- package/dist/runtime/Dynamic.d.ts.map +1 -0
- package/dist/runtime/Dynamic.js +22 -0
- package/dist/runtime/Dynamic.js.map +1 -0
- package/dist/runtime/Html.d.ts +32 -0
- package/dist/runtime/Html.d.ts.map +1 -0
- package/dist/runtime/Html.js +63 -0
- package/dist/runtime/Html.js.map +1 -0
- package/dist/runtime/Native.d.ts +48 -0
- package/dist/runtime/Native.d.ts.map +1 -0
- package/dist/runtime/Native.js +78 -0
- package/dist/runtime/Native.js.map +1 -0
- package/dist/runtime/NativeContext.d.ts +17 -0
- package/dist/runtime/NativeContext.d.ts.map +1 -0
- package/dist/runtime/NativeContext.js +47 -0
- package/dist/runtime/NativeContext.js.map +1 -0
- package/dist/runtime/NativeDynamic.d.ts +47 -0
- package/dist/runtime/NativeDynamic.d.ts.map +1 -0
- package/dist/runtime/NativeDynamic.js +141 -0
- package/dist/runtime/NativeDynamic.js.map +1 -0
- package/dist/runtime/PayloadRecipe.d.ts +22 -0
- package/dist/runtime/PayloadRecipe.d.ts.map +1 -0
- package/dist/runtime/PayloadRecipe.js +59 -0
- package/dist/runtime/PayloadRecipe.js.map +1 -0
- package/dist/runtime/Props.d.ts +21 -0
- package/dist/runtime/Props.d.ts.map +1 -0
- package/dist/runtime/Props.js +17 -0
- package/dist/runtime/Props.js.map +1 -0
- package/dist/runtime/Recipe.d.ts +52 -0
- package/dist/runtime/Recipe.d.ts.map +1 -0
- package/dist/runtime/Recipe.js +30 -0
- package/dist/runtime/Recipe.js.map +1 -0
- package/dist/runtime/Selection.d.ts +31 -0
- package/dist/runtime/Selection.d.ts.map +1 -0
- package/dist/runtime/Selection.js +30 -0
- package/dist/runtime/Selection.js.map +1 -0
- package/dist/runtime/Variable.d.ts +6 -0
- package/dist/runtime/Variable.d.ts.map +1 -0
- package/dist/runtime/Variable.js +10 -0
- package/dist/runtime/Variable.js.map +1 -0
- package/dist/runtime/index.d.ts +33 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +33 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/styleFunction.d.ts +72 -0
- package/dist/styleFunction.d.ts.map +1 -0
- package/dist/styleFunction.js +18 -0
- package/dist/styleFunction.js.map +1 -0
- package/dist/themes/LICENSE.tailwind +21 -0
- package/dist/variable.d.ts +50 -0
- package/dist/variable.d.ts.map +1 -0
- package/dist/variable.js +20 -0
- package/dist/variable.js.map +1 -0
- package/dist/variants.d.ts +84 -0
- package/dist/variants.d.ts.map +1 -0
- package/dist/variants.js +21 -0
- package/dist/variants.js.map +1 -0
- package/dist/vite/index.d.ts +24 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +1089 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/web/Css.d.ts +81 -0
- package/dist/web/Css.d.ts.map +1 -0
- package/dist/web/Css.js +593 -0
- package/dist/web/Css.js.map +1 -0
- package/dist/web/colorProfile.d.ts +28 -0
- package/dist/web/colorProfile.d.ts.map +1 -0
- package/dist/web/colorProfile.js +8 -0
- package/dist/web/colorProfile.js.map +1 -0
- package/dist/web/counterStyle.d.ts +48 -0
- package/dist/web/counterStyle.d.ts.map +1 -0
- package/dist/web/counterStyle.js +8 -0
- package/dist/web/counterStyle.js.map +1 -0
- package/dist/web/cssFunction.d.ts +80 -0
- package/dist/web/cssFunction.d.ts.map +1 -0
- package/dist/web/cssFunction.js +18 -0
- package/dist/web/cssFunction.js.map +1 -0
- package/dist/web/customMedia.d.ts +12 -0
- package/dist/web/customMedia.d.ts.map +1 -0
- package/dist/web/customMedia.js +7 -0
- package/dist/web/customMedia.js.map +1 -0
- package/dist/web/fontFace.d.ts +26 -0
- package/dist/web/fontFace.d.ts.map +1 -0
- package/dist/web/fontFace.js +7 -0
- package/dist/web/fontFace.js.map +1 -0
- package/dist/web/fontFeatureValues.d.ts +40 -0
- package/dist/web/fontFeatureValues.d.ts.map +1 -0
- package/dist/web/fontFeatureValues.js +7 -0
- package/dist/web/fontFeatureValues.js.map +1 -0
- package/dist/web/fontPaletteValues.d.ts +21 -0
- package/dist/web/fontPaletteValues.d.ts.map +1 -0
- package/dist/web/fontPaletteValues.js +9 -0
- package/dist/web/fontPaletteValues.js.map +1 -0
- package/dist/web/global.d.ts +19 -0
- package/dist/web/global.d.ts.map +1 -0
- package/dist/web/global.js +6 -0
- package/dist/web/global.js.map +1 -0
- package/dist/web/importCss.d.ts +18 -0
- package/dist/web/importCss.d.ts.map +1 -0
- package/dist/web/importCss.js +7 -0
- package/dist/web/importCss.js.map +1 -0
- package/dist/web/index.d.ts +22 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +22 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/internal/Block.d.ts +18 -0
- package/dist/web/internal/Block.d.ts.map +1 -0
- package/dist/web/internal/Block.js +13 -0
- package/dist/web/internal/Block.js.map +1 -0
- package/dist/web/internal/ClassName.d.ts +19 -0
- package/dist/web/internal/ClassName.d.ts.map +1 -0
- package/dist/web/internal/ClassName.js +77 -0
- package/dist/web/internal/ClassName.js.map +1 -0
- package/dist/web/internal/Context.d.ts +11 -0
- package/dist/web/internal/Context.d.ts.map +1 -0
- package/dist/web/internal/Context.js +2 -0
- package/dist/web/internal/Context.js.map +1 -0
- package/dist/web/internal/Contributions.d.ts +70 -0
- package/dist/web/internal/Contributions.d.ts.map +1 -0
- package/dist/web/internal/Contributions.js +109 -0
- package/dist/web/internal/Contributions.js.map +1 -0
- package/dist/web/internal/Namespace.d.ts +13 -0
- package/dist/web/internal/Namespace.d.ts.map +1 -0
- package/dist/web/internal/Namespace.js +13 -0
- package/dist/web/internal/Namespace.js.map +1 -0
- package/dist/web/internal/Themes.d.ts +13 -0
- package/dist/web/internal/Themes.d.ts.map +1 -0
- package/dist/web/internal/Themes.js +96 -0
- package/dist/web/internal/Themes.js.map +1 -0
- package/dist/web/keyframes.d.ts +14 -0
- package/dist/web/keyframes.d.ts.map +1 -0
- package/dist/web/keyframes.js +8 -0
- package/dist/web/keyframes.js.map +1 -0
- package/dist/web/layers.d.ts +4 -0
- package/dist/web/layers.d.ts.map +1 -0
- package/dist/web/layers.js +7 -0
- package/dist/web/layers.js.map +1 -0
- package/dist/web/namespace.d.ts +14 -0
- package/dist/web/namespace.d.ts.map +1 -0
- package/dist/web/namespace.js +7 -0
- package/dist/web/namespace.js.map +1 -0
- package/dist/web/page.d.ts +38 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +7 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/positionTry.d.ts +14 -0
- package/dist/web/positionTry.d.ts.map +1 -0
- package/dist/web/positionTry.js +9 -0
- package/dist/web/positionTry.js.map +1 -0
- package/dist/web/property.d.ts +24 -0
- package/dist/web/property.d.ts.map +1 -0
- package/dist/web/property.js +7 -0
- package/dist/web/property.js.map +1 -0
- package/dist/web/viewTransition.d.ts +29 -0
- package/dist/web/viewTransition.d.ts.map +1 -0
- package/dist/web/viewTransition.js +7 -0
- package/dist/web/viewTransition.js.map +1 -0
- package/package.json +136 -10
- package/src/Config.ts +691 -0
- package/src/Props.ts +8 -0
- package/src/Style.ts +812 -0
- package/src/Theme.ts +784 -0
- package/src/babel/NativeEdits.ts +273 -0
- package/src/babel/NativeJsx.ts +260 -0
- package/src/babel/index.ts +332 -0
- package/src/cli/index.ts +196 -0
- package/src/compiler/Graph.ts +1586 -0
- package/src/compiler/Native.ts +801 -0
- package/src/compiler/Source.ts +1579 -0
- package/src/compiler/Transform.ts +1241 -0
- package/src/compiler/index.ts +12 -0
- package/src/compiler/internal/Applications.ts +378 -0
- package/src/compiler/internal/AtRules.ts +202 -0
- package/src/compiler/internal/Catalogs.ts +114 -0
- package/src/compiler/internal/ColorProfiles.ts +93 -0
- package/src/compiler/internal/CompositionBindings.ts +120 -0
- package/src/compiler/internal/Compositions.ts +629 -0
- package/src/compiler/internal/Configurations.ts +244 -0
- package/src/compiler/internal/Contract.ts +860 -0
- package/src/compiler/internal/Contributions.ts +1507 -0
- package/src/compiler/internal/Descriptors.ts +238 -0
- package/src/compiler/internal/Dynamic.ts +266 -0
- package/src/compiler/internal/Edits.ts +13 -0
- package/src/compiler/internal/Expression.ts +135 -0
- package/src/compiler/internal/Functions.ts +206 -0
- package/src/compiler/internal/Identifiers.ts +124 -0
- package/src/compiler/internal/Keyframes.ts +62 -0
- package/src/compiler/internal/Namespaces.ts +296 -0
- package/src/compiler/internal/NativeBindings.ts +151 -0
- package/src/compiler/internal/PackedStyles.ts +464 -0
- package/src/compiler/internal/Properties.ts +121 -0
- package/src/compiler/internal/RecipeConditions.ts +139 -0
- package/src/compiler/internal/RecipePayloads.ts +132 -0
- package/src/compiler/internal/Recipes.ts +531 -0
- package/src/compiler/internal/Relative.ts +87 -0
- package/src/compiler/internal/Scope.ts +36 -0
- package/src/compiler/internal/Selectors.ts +334 -0
- package/src/compiler/internal/Static.ts +783 -0
- package/src/compiler/internal/Stylesheets.ts +361 -0
- package/src/compiler/internal/Syntax.ts +31 -0
- package/src/compiler/internal/Themes.ts +1794 -0
- package/src/compiler/internal/Variables.ts +497 -0
- package/src/compiler/internal/ViewTransitions.ts +82 -0
- package/src/cx.ts +98 -0
- package/src/default.ts +1177 -0
- package/src/index.ts +20 -0
- package/src/internal/Authoring.ts +199 -0
- package/src/internal/Binding.ts +187 -0
- package/src/internal/BindingDomains.ts +458 -0
- package/src/internal/Cascade.ts +165 -0
- package/src/internal/Compound.ts +522 -0
- package/src/internal/Condition.ts +283 -0
- package/src/internal/Corner.ts +17 -0
- package/src/internal/FunctionSyntax.ts +271 -0
- package/src/internal/FunctionValue.ts +96 -0
- package/src/internal/Geometry.ts +30 -0
- package/src/internal/Grid.ts +67 -0
- package/src/internal/Identifier.ts +14 -0
- package/src/internal/Identity.ts +89 -0
- package/src/internal/Lexical.ts +202 -0
- package/src/internal/Literal.ts +3820 -0
- package/src/internal/NativeProperties.ts +936 -0
- package/src/internal/Numeric.ts +77 -0
- package/src/internal/Query.ts +87 -0
- package/src/internal/Recipe.ts +17 -0
- package/src/internal/RuleReference.ts +102 -0
- package/src/internal/Scheme.ts +20 -0
- package/src/internal/Shorthands.ts +122 -0
- package/src/internal/Targets.ts +162 -0
- package/src/internal/Token.ts +380 -0
- package/src/internal/Tuple.ts +29 -0
- package/src/internal/Typography.ts +51 -0
- package/src/internal/Value.ts +320 -0
- package/src/metro/Graph.ts +78 -0
- package/src/metro/Watch.ts +88 -0
- package/src/metro/index.ts +99 -0
- package/src/metro/transformer.ts +97 -0
- package/src/next/index.ts +114 -0
- package/src/next/loader.ts +369 -0
- package/src/node/Host.ts +1204 -0
- package/src/node/index.ts +6 -0
- package/src/react-native/Host.ts +289 -0
- package/src/react-native/StyleSheet.ts +1084 -0
- package/src/react-native/Variants.ts +122 -0
- package/src/react-native/index.ts +7 -0
- package/src/react-native/internal/Color.ts +110 -0
- package/src/react-native/internal/NativeSchema.ts +3096 -0
- package/src/react-native/internal/Scalar.ts +253 -0
- package/src/react-native/internal/Values.ts +87 -0
- package/src/react-native/react.ts +47 -0
- package/src/reset.css +244 -0
- package/src/runtime/Appearance.ts +155 -0
- package/src/runtime/Composition.ts +87 -0
- package/src/runtime/CompositionHtml.ts +38 -0
- package/src/runtime/ConditionalRecipe.ts +70 -0
- package/src/runtime/Dynamic.ts +51 -0
- package/src/runtime/Html.ts +91 -0
- package/src/runtime/Native.ts +144 -0
- package/src/runtime/NativeContext.ts +74 -0
- package/src/runtime/NativeDynamic.ts +246 -0
- package/src/runtime/PayloadRecipe.ts +96 -0
- package/src/runtime/Props.ts +33 -0
- package/src/runtime/Recipe.ts +74 -0
- package/src/runtime/Selection.ts +82 -0
- package/src/runtime/Variable.ts +15 -0
- package/src/runtime/index.ts +45 -0
- package/src/styleFunction.ts +138 -0
- package/src/themes/LICENSE.tailwind +21 -0
- package/src/variable.ts +105 -0
- package/src/variants.ts +218 -0
- package/src/vite/index.ts +1473 -0
- package/src/web/Css.ts +801 -0
- package/src/web/colorProfile.ts +60 -0
- package/src/web/counterStyle.ts +82 -0
- package/src/web/cssFunction.ts +181 -0
- package/src/web/customMedia.ts +16 -0
- package/src/web/fontFace.ts +41 -0
- package/src/web/fontFeatureValues.ts +79 -0
- package/src/web/fontPaletteValues.ts +42 -0
- package/src/web/global.ts +39 -0
- package/src/web/importCss.ts +23 -0
- package/src/web/index.ts +22 -0
- package/src/web/internal/Block.ts +29 -0
- package/src/web/internal/ClassName.ts +112 -0
- package/src/web/internal/Context.ts +16 -0
- package/src/web/internal/Contributions.ts +219 -0
- package/src/web/internal/Namespace.ts +21 -0
- package/src/web/internal/Themes.ts +133 -0
- package/src/web/keyframes.ts +43 -0
- package/src/web/layers.ts +6 -0
- package/src/web/namespace.ts +19 -0
- package/src/web/page.ts +140 -0
- package/src/web/positionTry.ts +71 -0
- package/src/web/property.ts +35 -0
- package/src/web/viewTransition.ts +89 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/** Checks CSS function arguments and defaults against native syntax definitions. @module */
|
|
2
|
+
import * as FunctionSyntax from '../../internal/FunctionSyntax.js'
|
|
3
|
+
import * as Lightning from 'lightningcss'
|
|
4
|
+
import * as Tree from 'css-tree'
|
|
5
|
+
|
|
6
|
+
/** Checks complete static values while leaving computed substitutions to CSS. */
|
|
7
|
+
export function value(syntax: string, input: string): string | undefined {
|
|
8
|
+
const text = input.trim()
|
|
9
|
+
const body =
|
|
10
|
+
text.startsWith('{') && text.endsWith('}') ? text.slice(1, -1) : text
|
|
11
|
+
const parsed = Tree.parse(body, { context: 'value' })
|
|
12
|
+
let computed = false
|
|
13
|
+
Tree.walk(parsed, (node) => {
|
|
14
|
+
if (
|
|
15
|
+
node.type === 'Function' &&
|
|
16
|
+
/^(?:--|var$|env$|attr$)/i.test(Tree.ident.decode(node.name))
|
|
17
|
+
)
|
|
18
|
+
computed = true
|
|
19
|
+
})
|
|
20
|
+
const normalized = syntax.trim()
|
|
21
|
+
const definition = normalized.startsWith('type(')
|
|
22
|
+
? normalized.slice(5, -1).trim()
|
|
23
|
+
: normalized
|
|
24
|
+
if (computed || definition === '*') return
|
|
25
|
+
const alternatives: string[] = []
|
|
26
|
+
let start = 0
|
|
27
|
+
Tree.tokenize(definition, (type, from, to) => {
|
|
28
|
+
if (type === Tree.tokenTypes.Delim && definition.slice(from, to) === '|') {
|
|
29
|
+
alternatives.push(definition.slice(start, from).trim())
|
|
30
|
+
start = to
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
alternatives.push(definition.slice(start).trim())
|
|
34
|
+
for (const alternative of alternatives) {
|
|
35
|
+
try {
|
|
36
|
+
if (alternative.startsWith('<')) {
|
|
37
|
+
if (alternative.startsWith('<string>')) {
|
|
38
|
+
if (Tree.lexer.match(alternative, body).error) continue
|
|
39
|
+
} else
|
|
40
|
+
Lightning.transform({
|
|
41
|
+
filename: 'argument.css',
|
|
42
|
+
code: new TextEncoder().encode(
|
|
43
|
+
`@property --argument{syntax:${JSON.stringify(alternative)};inherits:false;initial-value:${body};}`,
|
|
44
|
+
),
|
|
45
|
+
})
|
|
46
|
+
return alternative
|
|
47
|
+
}
|
|
48
|
+
let multiplier = ''
|
|
49
|
+
let atom = alternative
|
|
50
|
+
Tree.tokenize(alternative, (type, from, to) => {
|
|
51
|
+
if (
|
|
52
|
+
type === Tree.tokenTypes.Delim &&
|
|
53
|
+
to === alternative.length &&
|
|
54
|
+
['+', '#'].includes(alternative.slice(from, to))
|
|
55
|
+
) {
|
|
56
|
+
multiplier = alternative.slice(from, to)
|
|
57
|
+
atom = alternative.slice(0, from)
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
const expected = Tree.ident.decode(atom)
|
|
61
|
+
const nodes = (parsed as Tree.Value).children.toArray()
|
|
62
|
+
let count = 0
|
|
63
|
+
let comma = false
|
|
64
|
+
let valid = true
|
|
65
|
+
for (const node of nodes) {
|
|
66
|
+
if (
|
|
67
|
+
node.type === 'Operator' &&
|
|
68
|
+
node.value === ',' &&
|
|
69
|
+
multiplier === '#' &&
|
|
70
|
+
count > 0 &&
|
|
71
|
+
!comma
|
|
72
|
+
) {
|
|
73
|
+
comma = true
|
|
74
|
+
continue
|
|
75
|
+
}
|
|
76
|
+
if (
|
|
77
|
+
node.type !== 'Identifier' ||
|
|
78
|
+
Tree.ident.decode(node.name) !== expected ||
|
|
79
|
+
(count > 0 && (multiplier === '' || (multiplier === '#' && !comma)))
|
|
80
|
+
) {
|
|
81
|
+
valid = false
|
|
82
|
+
break
|
|
83
|
+
}
|
|
84
|
+
count++
|
|
85
|
+
comma = false
|
|
86
|
+
}
|
|
87
|
+
if (valid && count > 0 && !comma) return alternative
|
|
88
|
+
} catch {
|
|
89
|
+
/* Another syntax alternative may accept this value. */
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
throw new Error('Invalid CSS function argument for its declared syntax.')
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Validates packed function headers and body contexts before parser recovery. */
|
|
96
|
+
export function validate(source: string): void {
|
|
97
|
+
Tree.walk(Tree.parse(source), {
|
|
98
|
+
visit: 'Atrule',
|
|
99
|
+
enter(rule) {
|
|
100
|
+
if (rule.name.toLowerCase() !== 'function') return
|
|
101
|
+
if (!rule.prelude || !rule.block)
|
|
102
|
+
throw new Error('CSS functions require parameters and a body.')
|
|
103
|
+
const prelude = Tree.generate(rule.prelude)
|
|
104
|
+
let opening = 0
|
|
105
|
+
let closing = -1
|
|
106
|
+
let depth = 0
|
|
107
|
+
const commas: number[] = []
|
|
108
|
+
Tree.tokenize(prelude, (type, start, end) => {
|
|
109
|
+
if (closing >= 0) return
|
|
110
|
+
if (
|
|
111
|
+
type === Tree.tokenTypes.Function ||
|
|
112
|
+
type === Tree.tokenTypes.LeftParenthesis
|
|
113
|
+
) {
|
|
114
|
+
if (depth === 0) {
|
|
115
|
+
const name = Tree.ident.decode(prelude.slice(start, end - 1))
|
|
116
|
+
if (
|
|
117
|
+
start !== 0 ||
|
|
118
|
+
type !== Tree.tokenTypes.Function ||
|
|
119
|
+
!name.startsWith('--') ||
|
|
120
|
+
name.length <= 2
|
|
121
|
+
)
|
|
122
|
+
throw new Error('CSS function names require a dashed identifier.')
|
|
123
|
+
opening = end
|
|
124
|
+
}
|
|
125
|
+
depth++
|
|
126
|
+
} else if (type === Tree.tokenTypes.RightParenthesis) {
|
|
127
|
+
depth--
|
|
128
|
+
if (depth === 0) closing = start
|
|
129
|
+
} else if (type === Tree.tokenTypes.Comma && depth === 1)
|
|
130
|
+
commas.push(start)
|
|
131
|
+
})
|
|
132
|
+
if (closing < 0) throw new Error('Unclosed CSS function parameters.')
|
|
133
|
+
const names = new Set<string>()
|
|
134
|
+
let start = opening
|
|
135
|
+
for (const end of [...commas, closing]) {
|
|
136
|
+
const parameter = prelude.slice(start, end).trim()
|
|
137
|
+
start = end + 1
|
|
138
|
+
if (!parameter && end === closing && opening === closing) continue
|
|
139
|
+
let name = ''
|
|
140
|
+
let offset = 0
|
|
141
|
+
let colon = -1
|
|
142
|
+
let depth = 0
|
|
143
|
+
Tree.tokenize(parameter, (type, from, to) => {
|
|
144
|
+
if (from === 0 && type === Tree.tokenTypes.Ident) {
|
|
145
|
+
name = Tree.ident.decode(parameter.slice(from, to))
|
|
146
|
+
offset = to
|
|
147
|
+
}
|
|
148
|
+
if (
|
|
149
|
+
type === Tree.tokenTypes.Function ||
|
|
150
|
+
type === Tree.tokenTypes.LeftParenthesis
|
|
151
|
+
)
|
|
152
|
+
depth++
|
|
153
|
+
if (type === Tree.tokenTypes.RightParenthesis) depth--
|
|
154
|
+
if (type === Tree.tokenTypes.Colon && depth === 0 && colon < 0)
|
|
155
|
+
colon = from
|
|
156
|
+
})
|
|
157
|
+
if (!name.startsWith('--') || name.length <= 2 || names.has(name))
|
|
158
|
+
throw new Error(
|
|
159
|
+
'CSS function parameters require unique dashed names.',
|
|
160
|
+
)
|
|
161
|
+
names.add(name)
|
|
162
|
+
const syntax =
|
|
163
|
+
parameter.slice(offset, colon < 0 ? undefined : colon).trim() || '*'
|
|
164
|
+
if (!FunctionSyntax.accepts(syntax))
|
|
165
|
+
throw new Error('Invalid CSS function parameter syntax.')
|
|
166
|
+
if (colon >= 0) value(syntax, parameter.slice(colon + 1))
|
|
167
|
+
}
|
|
168
|
+
const returns = prelude.slice(closing + 1).trim()
|
|
169
|
+
if (
|
|
170
|
+
returns &&
|
|
171
|
+
(!returns.startsWith('returns ') ||
|
|
172
|
+
!FunctionSyntax.accepts(returns.slice(8)))
|
|
173
|
+
)
|
|
174
|
+
throw new Error('Invalid CSS function return syntax.')
|
|
175
|
+
function body(block: Tree.Block): void {
|
|
176
|
+
const declarations = Tree.parse(Tree.generate(block).slice(1, -1), {
|
|
177
|
+
context: 'declarationList',
|
|
178
|
+
}) as Tree.DeclarationList
|
|
179
|
+
declarations.children.forEach((node) => {
|
|
180
|
+
if (
|
|
181
|
+
node.type === 'Atrule' &&
|
|
182
|
+
['media', 'supports', 'container'].includes(node.name) &&
|
|
183
|
+
node.block &&
|
|
184
|
+
node.prelude
|
|
185
|
+
) {
|
|
186
|
+
if (
|
|
187
|
+
Tree.lexer.matchAtrulePrelude(
|
|
188
|
+
node.name,
|
|
189
|
+
Tree.generate(node.prelude),
|
|
190
|
+
).error
|
|
191
|
+
)
|
|
192
|
+
throw new Error('Invalid CSS function condition.')
|
|
193
|
+
body(node.block)
|
|
194
|
+
} else if (
|
|
195
|
+
node.type === 'Declaration' &&
|
|
196
|
+
!node.important &&
|
|
197
|
+
(node.property === 'result' || node.property.startsWith('--'))
|
|
198
|
+
) {
|
|
199
|
+
value('*', Tree.generate(node.value))
|
|
200
|
+
} else throw new Error('Invalid CSS function body context.')
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
body(rule.block)
|
|
204
|
+
},
|
|
205
|
+
})
|
|
206
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/** Decodes CSS identifier spellings at source and packed compiler boundaries. @module */
|
|
2
|
+
import * as Lightning from 'lightningcss'
|
|
3
|
+
|
|
4
|
+
/** Reads an entire CSS identifier list, including escaped delimiters and comments. */
|
|
5
|
+
export function list(
|
|
6
|
+
value: string,
|
|
7
|
+
separator: 'comma' | 'space',
|
|
8
|
+
): readonly string[] | undefined {
|
|
9
|
+
const input = tokens(value)
|
|
10
|
+
if (!input) return undefined
|
|
11
|
+
const names: string[] = []
|
|
12
|
+
let needName = true
|
|
13
|
+
for (const token of input) {
|
|
14
|
+
if (token.type === 'token' && token.value.type === 'comma') {
|
|
15
|
+
if (separator !== 'comma' || needName) return undefined
|
|
16
|
+
needName = true
|
|
17
|
+
continue
|
|
18
|
+
}
|
|
19
|
+
const name =
|
|
20
|
+
token.type === 'dashed-ident'
|
|
21
|
+
? token.value
|
|
22
|
+
: token.type === 'token' && token.value.type === 'ident'
|
|
23
|
+
? token.value.value
|
|
24
|
+
: undefined
|
|
25
|
+
if (name === undefined || (!needName && separator === 'comma'))
|
|
26
|
+
return undefined
|
|
27
|
+
names.push(name)
|
|
28
|
+
needName = false
|
|
29
|
+
}
|
|
30
|
+
return !needName && names.length ? names : undefined
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Checks a complete CSS URL value without accepting an injected declaration. */
|
|
34
|
+
export function url(value: string): boolean {
|
|
35
|
+
const input = tokens(value)
|
|
36
|
+
return input?.length === 1 && input[0]?.type === 'url'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function tokens(value: string): readonly Lightning.TokenOrValue[] | undefined {
|
|
40
|
+
try {
|
|
41
|
+
let result: readonly Lightning.TokenOrValue[] | undefined
|
|
42
|
+
Lightning.transform({
|
|
43
|
+
filename: 'tokens.css',
|
|
44
|
+
code: new TextEncoder().encode(`@zyzz-tokens ${value};`),
|
|
45
|
+
visitor: {
|
|
46
|
+
StyleSheet(sheet) {
|
|
47
|
+
const rule = sheet.rules[0]
|
|
48
|
+
if (
|
|
49
|
+
sheet.rules.length === 1 &&
|
|
50
|
+
rule?.type === 'unknown' &&
|
|
51
|
+
rule.value.name === 'zyzz-tokens' &&
|
|
52
|
+
rule.value.block === null
|
|
53
|
+
)
|
|
54
|
+
result = rule.value.prelude.filter(
|
|
55
|
+
(token) =>
|
|
56
|
+
!(
|
|
57
|
+
token.type === 'token' &&
|
|
58
|
+
['white-space', 'comment'].includes(token.value.type)
|
|
59
|
+
),
|
|
60
|
+
)
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
return result
|
|
65
|
+
} catch {
|
|
66
|
+
return undefined
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Returns the identifier token value, or undefined for malformed input. */
|
|
71
|
+
export function read(value: string): string | undefined {
|
|
72
|
+
if (/^(?:--|-?[_a-zA-Z])[\w-]*$/.test(value)) return value
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
let decoded: string | undefined
|
|
76
|
+
Lightning.transform({
|
|
77
|
+
filename: 'identifier.css',
|
|
78
|
+
code: new TextEncoder().encode(
|
|
79
|
+
`@namespace ${value}\n"urn:zyzz:identifier";`,
|
|
80
|
+
),
|
|
81
|
+
visitor: {
|
|
82
|
+
StyleSheet(sheet) {
|
|
83
|
+
const rule = sheet.rules[0]
|
|
84
|
+
if (
|
|
85
|
+
sheet.rules.length === 1 &&
|
|
86
|
+
rule?.type === 'namespace' &&
|
|
87
|
+
rule.value.url === 'urn:zyzz:identifier'
|
|
88
|
+
)
|
|
89
|
+
decoded = rule.value.prefix ?? undefined
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
})
|
|
93
|
+
return decoded
|
|
94
|
+
} catch {
|
|
95
|
+
return undefined
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Reads an explicit authoring identity shared with uncompiled execution. */
|
|
100
|
+
export function explicit(
|
|
101
|
+
call: import('@oxc-project/types').CallExpression,
|
|
102
|
+
): string | undefined {
|
|
103
|
+
const argument = call.arguments[1]
|
|
104
|
+
if (!argument) return undefined
|
|
105
|
+
if (argument.type !== 'ObjectExpression' || argument.properties.length !== 1)
|
|
106
|
+
throw new Error('Definition options require one literal id.')
|
|
107
|
+
const property = argument.properties[0]!
|
|
108
|
+
if (
|
|
109
|
+
property.type !== 'Property' ||
|
|
110
|
+
property.computed ||
|
|
111
|
+
property.kind !== 'init' ||
|
|
112
|
+
property.method ||
|
|
113
|
+
(property.key.type === 'Identifier'
|
|
114
|
+
? property.key.name
|
|
115
|
+
: property.key.type === 'Literal'
|
|
116
|
+
? property.key.value
|
|
117
|
+
: undefined) !== 'id' ||
|
|
118
|
+
property.value.type !== 'Literal' ||
|
|
119
|
+
typeof property.value.value !== 'string' ||
|
|
120
|
+
!property.value.value
|
|
121
|
+
)
|
|
122
|
+
throw new Error('Definition options require one nonempty literal id.')
|
|
123
|
+
return property.value.value
|
|
124
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Checks complete keyframe selectors, including named timeline ranges. @module */
|
|
2
|
+
import * as Lightning from 'lightningcss'
|
|
3
|
+
|
|
4
|
+
/** Rejects invalid ordinary offsets and importance in transported keyframes. */
|
|
5
|
+
export function validate(source: string): void {
|
|
6
|
+
Lightning.transform({
|
|
7
|
+
filename: 'keyframes.css',
|
|
8
|
+
code: new TextEncoder().encode(source),
|
|
9
|
+
visitor: {
|
|
10
|
+
Rule(rule) {
|
|
11
|
+
if (rule.type !== 'keyframes') return
|
|
12
|
+
for (const frame of rule.value.keyframes) {
|
|
13
|
+
if (
|
|
14
|
+
frame.selectors.some(
|
|
15
|
+
(selector) =>
|
|
16
|
+
selector.type === 'percentage' &&
|
|
17
|
+
(selector.value < 0 || selector.value > 1),
|
|
18
|
+
)
|
|
19
|
+
)
|
|
20
|
+
throw new Error('Ordinary keyframe offsets must be within 0–100%.')
|
|
21
|
+
if (frame.declarations.importantDeclarations?.length)
|
|
22
|
+
throw new Error('Keyframes forbid important declarations.')
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Named timeline percentages are unrestricted; ordinary offsets remain within 0–100%. */
|
|
30
|
+
export function accepts(selector: string): boolean {
|
|
31
|
+
try {
|
|
32
|
+
let valid = false
|
|
33
|
+
Lightning.transform({
|
|
34
|
+
filename: 'keyframe.css',
|
|
35
|
+
code: new TextEncoder().encode(
|
|
36
|
+
`@keyframes zyzz {${selector}{opacity:0}}`,
|
|
37
|
+
),
|
|
38
|
+
visitor: {
|
|
39
|
+
StyleSheet(sheet) {
|
|
40
|
+
const rule = sheet.rules[0]
|
|
41
|
+
if (
|
|
42
|
+
sheet.rules.length !== 1 ||
|
|
43
|
+
rule?.type !== 'keyframes' ||
|
|
44
|
+
rule.value.keyframes.length !== 1
|
|
45
|
+
)
|
|
46
|
+
return
|
|
47
|
+
const frame = rule.value.keyframes[0]!
|
|
48
|
+
valid =
|
|
49
|
+
frame.selectors.length > 0 &&
|
|
50
|
+
frame.selectors.every(
|
|
51
|
+
(selector) =>
|
|
52
|
+
selector.type !== 'percentage' ||
|
|
53
|
+
(selector.value >= 0 && selector.value <= 1),
|
|
54
|
+
)
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
})
|
|
58
|
+
return valid
|
|
59
|
+
} catch {
|
|
60
|
+
return false
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
/** Isolates CSS namespace selectors and composes their generated source maps. @module */
|
|
2
|
+
import MagicString, { Bundle } from 'magic-string'
|
|
3
|
+
import * as Mapping from '@jridgewell/gen-mapping'
|
|
4
|
+
import * as Trace from '@jridgewell/trace-mapping'
|
|
5
|
+
import type * as Lightning from 'lightningcss'
|
|
6
|
+
import * as Namespace from '../../web/internal/Namespace.js'
|
|
7
|
+
import * as AtRules from './AtRules.js'
|
|
8
|
+
import * as Identifiers from './Identifiers.js'
|
|
9
|
+
|
|
10
|
+
/** Rewrites namespace-sensitive selectors using native selector ASTs. */
|
|
11
|
+
export function rewrite(
|
|
12
|
+
css: string,
|
|
13
|
+
namespaces: readonly Namespace.Definition[],
|
|
14
|
+
previous?: Mapping.EncodedSourceMap,
|
|
15
|
+
includeDeclarations = false,
|
|
16
|
+
) {
|
|
17
|
+
if (!namespaces.length || !css) return { css, map: previous }
|
|
18
|
+
// Last bindings win across the module, including equivalent escaped spellings.
|
|
19
|
+
const names = new Map(
|
|
20
|
+
namespaces.map((value) => [
|
|
21
|
+
value.prefix === undefined ? undefined : Identifiers.read(value.prefix),
|
|
22
|
+
value.name,
|
|
23
|
+
]),
|
|
24
|
+
)
|
|
25
|
+
function selector(input: Lightning.Selector): Lightning.Selector {
|
|
26
|
+
const output: Lightning.Selector = []
|
|
27
|
+
let first = true
|
|
28
|
+
for (const original of input) {
|
|
29
|
+
let component = original
|
|
30
|
+
if (component.type === 'combinator') first = true
|
|
31
|
+
else if (first) {
|
|
32
|
+
const name = names.get(undefined)
|
|
33
|
+
if (
|
|
34
|
+
name &&
|
|
35
|
+
component.type !== 'namespace' &&
|
|
36
|
+
component.type !== 'nesting'
|
|
37
|
+
) {
|
|
38
|
+
output.push({ type: 'namespace', kind: 'named', prefix: name })
|
|
39
|
+
if (component.type !== 'type' && component.type !== 'universal')
|
|
40
|
+
output.push({ type: 'universal' })
|
|
41
|
+
}
|
|
42
|
+
first = false
|
|
43
|
+
}
|
|
44
|
+
if (component.type === 'namespace' && component.kind === 'named')
|
|
45
|
+
component = {
|
|
46
|
+
...component,
|
|
47
|
+
prefix: names.get(component.prefix) ?? component.prefix,
|
|
48
|
+
}
|
|
49
|
+
if (
|
|
50
|
+
component.type === 'attribute' &&
|
|
51
|
+
component.namespace?.type === 'specific'
|
|
52
|
+
)
|
|
53
|
+
component = {
|
|
54
|
+
...component,
|
|
55
|
+
namespace: {
|
|
56
|
+
...component.namespace,
|
|
57
|
+
prefix:
|
|
58
|
+
names.get(component.namespace.prefix) ??
|
|
59
|
+
component.namespace.prefix,
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
if ('selectors' in component && Array.isArray(component.selectors))
|
|
63
|
+
component = {
|
|
64
|
+
...component,
|
|
65
|
+
selectors: Array.isArray(component.selectors[0])
|
|
66
|
+
? (component.selectors as Lightning.Selector[]).map(selector)
|
|
67
|
+
: selector(component.selectors as Lightning.Selector),
|
|
68
|
+
} as typeof component
|
|
69
|
+
if ('of' in component && component.of)
|
|
70
|
+
component = { ...component, of: component.of.map(selector) }
|
|
71
|
+
output.push(component)
|
|
72
|
+
}
|
|
73
|
+
return output
|
|
74
|
+
}
|
|
75
|
+
const declared = new Set<string>()
|
|
76
|
+
const rewritten = AtRules.transform({
|
|
77
|
+
filename: 'zyzz.css',
|
|
78
|
+
code: new TextEncoder().encode(css),
|
|
79
|
+
sourceMap: !!previous,
|
|
80
|
+
visitor: {
|
|
81
|
+
Selector: selector,
|
|
82
|
+
Rule(rule) {
|
|
83
|
+
if (rule.type === 'namespace' && rule.value.prefix)
|
|
84
|
+
declared.add(rule.value.prefix)
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
const declarations = includeDeclarations
|
|
89
|
+
? namespaces
|
|
90
|
+
.filter((value) => !declared.has(value.name))
|
|
91
|
+
.map(Namespace.statement)
|
|
92
|
+
: []
|
|
93
|
+
const output = [
|
|
94
|
+
...declarations,
|
|
95
|
+
new TextDecoder().decode(rewritten.code).trimEnd(),
|
|
96
|
+
].join('\n')
|
|
97
|
+
if (!previous || !rewritten.map) return { css: output, map: previous }
|
|
98
|
+
const input = new Trace.TraceMap(previous)
|
|
99
|
+
const map = new Mapping.GenMapping({ file: previous.file ?? 'zyzz.css' })
|
|
100
|
+
Trace.eachMapping(
|
|
101
|
+
new Trace.TraceMap(JSON.parse(new TextDecoder().decode(rewritten.map))),
|
|
102
|
+
(entry) => {
|
|
103
|
+
if (entry.originalLine === null || entry.originalColumn === null) return
|
|
104
|
+
const original = Trace.originalPositionFor(input, {
|
|
105
|
+
line: entry.originalLine,
|
|
106
|
+
column: entry.originalColumn,
|
|
107
|
+
})
|
|
108
|
+
if (
|
|
109
|
+
original.line === null ||
|
|
110
|
+
original.column === null ||
|
|
111
|
+
original.source === null
|
|
112
|
+
)
|
|
113
|
+
return
|
|
114
|
+
const generated = {
|
|
115
|
+
line: entry.generatedLine + declarations.length,
|
|
116
|
+
column: entry.generatedColumn,
|
|
117
|
+
}
|
|
118
|
+
const position = { line: original.line, column: original.column }
|
|
119
|
+
if (original.name)
|
|
120
|
+
Mapping.addMapping(map, {
|
|
121
|
+
generated,
|
|
122
|
+
original: position,
|
|
123
|
+
source: original.source,
|
|
124
|
+
name: original.name,
|
|
125
|
+
})
|
|
126
|
+
else
|
|
127
|
+
Mapping.addMapping(map, {
|
|
128
|
+
generated,
|
|
129
|
+
original: position,
|
|
130
|
+
source: original.source,
|
|
131
|
+
})
|
|
132
|
+
},
|
|
133
|
+
)
|
|
134
|
+
previous.sources.forEach((source, index) => {
|
|
135
|
+
if (source !== null)
|
|
136
|
+
Mapping.setSourceContent(
|
|
137
|
+
map,
|
|
138
|
+
source,
|
|
139
|
+
previous.sourcesContent?.[index] ?? null,
|
|
140
|
+
)
|
|
141
|
+
})
|
|
142
|
+
return { css: output, map: Mapping.toEncodedMap(map) }
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Reads namespace metadata at the packed-library boundary. */
|
|
146
|
+
export function read(value: unknown): readonly Namespace.Definition[] {
|
|
147
|
+
if (value === undefined) return []
|
|
148
|
+
if (!Array.isArray(value)) throw new Error('Invalid packed namespaces.')
|
|
149
|
+
return value.map((entry: unknown) => {
|
|
150
|
+
if (!entry || typeof entry !== 'object')
|
|
151
|
+
throw new Error('Invalid packed namespace.')
|
|
152
|
+
const { name, prefix, uri } = entry as Partial<Namespace.Definition>
|
|
153
|
+
const decoded =
|
|
154
|
+
typeof prefix === 'string' ? Identifiers.read(prefix) : undefined
|
|
155
|
+
if (
|
|
156
|
+
typeof name !== 'string' ||
|
|
157
|
+
!/^z-n[a-z0-9-]+$/.test(name) ||
|
|
158
|
+
typeof uri !== 'string' ||
|
|
159
|
+
(prefix !== undefined &&
|
|
160
|
+
(typeof prefix !== 'string' || decoded === undefined))
|
|
161
|
+
)
|
|
162
|
+
throw new Error('Invalid packed namespace.')
|
|
163
|
+
return { name, uri, ...(prefix !== undefined ? { prefix } : {}) }
|
|
164
|
+
})
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Shields namespaces until Vite has concatenated and minified its CSS chunks. */
|
|
168
|
+
export function protect(css: string): string {
|
|
169
|
+
return AtRules.rename(css, 'namespace', '-zyzz-ns-')
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Restores namespace declarations to the stylesheet prolog after bundling. */
|
|
173
|
+
export function bundle(css: string, previous?: Mapping.EncodedSourceMap) {
|
|
174
|
+
if (!css.includes('@-zyzz-ns-')) return { css, map: previous }
|
|
175
|
+
const lines = [0]
|
|
176
|
+
for (let index = 0; index < css.length; index++)
|
|
177
|
+
if (css[index] === '\n') lines.push(index + 1)
|
|
178
|
+
const statements: { start: number; end: number; namespace: boolean }[] = []
|
|
179
|
+
AtRules.transform({
|
|
180
|
+
filename: 'bundle.css',
|
|
181
|
+
code: new TextEncoder().encode(css),
|
|
182
|
+
visitor: {
|
|
183
|
+
StyleSheet(sheet) {
|
|
184
|
+
let prolog = true
|
|
185
|
+
for (const rule of sheet.rules) {
|
|
186
|
+
const namespace =
|
|
187
|
+
rule.type === 'unknown' && rule.value.name === '-zyzz-ns-'
|
|
188
|
+
if (
|
|
189
|
+
!namespace &&
|
|
190
|
+
rule.type !== 'import' &&
|
|
191
|
+
rule.type !== 'layer-statement'
|
|
192
|
+
)
|
|
193
|
+
prolog = false
|
|
194
|
+
if (
|
|
195
|
+
!namespace &&
|
|
196
|
+
rule.type !== 'import' &&
|
|
197
|
+
!(rule.type === 'layer-statement' && prolog)
|
|
198
|
+
)
|
|
199
|
+
continue
|
|
200
|
+
if (!('value' in rule) || !('loc' in rule.value)) continue
|
|
201
|
+
const start = lines[rule.value.loc.line]! + rule.value.loc.column - 1
|
|
202
|
+
let quote = '',
|
|
203
|
+
parentheses = 0,
|
|
204
|
+
end = start
|
|
205
|
+
for (; end < css.length; end++) {
|
|
206
|
+
const char = css[end]
|
|
207
|
+
if (char === '\\') {
|
|
208
|
+
end++
|
|
209
|
+
continue
|
|
210
|
+
}
|
|
211
|
+
if (quote) {
|
|
212
|
+
if (char === quote) quote = ''
|
|
213
|
+
continue
|
|
214
|
+
}
|
|
215
|
+
if (char === '"' || char === "'") quote = char
|
|
216
|
+
else if (char === '/' && css[end + 1] === '*')
|
|
217
|
+
end = css.indexOf('*/', end + 2) + 1
|
|
218
|
+
else if (char === '(') parentheses++
|
|
219
|
+
else if (char === ')') parentheses--
|
|
220
|
+
else if (char === ';' && !parentheses) {
|
|
221
|
+
end++
|
|
222
|
+
break
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
statements.push({ start, end, namespace })
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
const original = new MagicString(css, { filename: 'bundle.css' })
|
|
231
|
+
const output = new Bundle({ separator: '' })
|
|
232
|
+
const remaining = original.clone()
|
|
233
|
+
const seen = new Set<string>()
|
|
234
|
+
for (const statement of statements.toSorted(
|
|
235
|
+
(a, b) => Number(a.namespace) - Number(b.namespace),
|
|
236
|
+
)) {
|
|
237
|
+
const text = css.slice(statement.start, statement.end)
|
|
238
|
+
remaining.remove(statement.start, statement.end)
|
|
239
|
+
if (statement.namespace && seen.has(text)) continue
|
|
240
|
+
if (statement.namespace) seen.add(text)
|
|
241
|
+
output.addSource({
|
|
242
|
+
content: original.snip(statement.start, statement.end),
|
|
243
|
+
filename: 'bundle.css',
|
|
244
|
+
})
|
|
245
|
+
}
|
|
246
|
+
output.addSource({ content: remaining, filename: 'bundle.css' })
|
|
247
|
+
const restored = AtRules.rename(output.toString(), '-zyzz-ns-', 'namespace')
|
|
248
|
+
if (!previous) return { css: restored, map: previous }
|
|
249
|
+
const input = new Trace.TraceMap(previous)
|
|
250
|
+
const map = new Mapping.GenMapping({ file: previous.file ?? 'bundle.css' })
|
|
251
|
+
Trace.eachMapping(
|
|
252
|
+
new Trace.TraceMap(
|
|
253
|
+
output.generateMap({ hires: true, includeContent: true }).toString(),
|
|
254
|
+
),
|
|
255
|
+
(entry) => {
|
|
256
|
+
if (entry.originalLine === null || entry.originalColumn === null) return
|
|
257
|
+
const original = Trace.originalPositionFor(input, {
|
|
258
|
+
line: entry.originalLine,
|
|
259
|
+
column: entry.originalColumn,
|
|
260
|
+
})
|
|
261
|
+
if (
|
|
262
|
+
original.source === null ||
|
|
263
|
+
original.line === null ||
|
|
264
|
+
original.column === null
|
|
265
|
+
)
|
|
266
|
+
return
|
|
267
|
+
const generated = {
|
|
268
|
+
line: entry.generatedLine,
|
|
269
|
+
column: entry.generatedColumn,
|
|
270
|
+
}
|
|
271
|
+
const position = { line: original.line, column: original.column }
|
|
272
|
+
if (original.name)
|
|
273
|
+
Mapping.addMapping(map, {
|
|
274
|
+
generated,
|
|
275
|
+
original: position,
|
|
276
|
+
source: original.source,
|
|
277
|
+
name: original.name,
|
|
278
|
+
})
|
|
279
|
+
else
|
|
280
|
+
Mapping.addMapping(map, {
|
|
281
|
+
generated,
|
|
282
|
+
original: position,
|
|
283
|
+
source: original.source,
|
|
284
|
+
})
|
|
285
|
+
},
|
|
286
|
+
)
|
|
287
|
+
previous.sources.forEach((source, index) => {
|
|
288
|
+
if (source !== null)
|
|
289
|
+
Mapping.setSourceContent(
|
|
290
|
+
map,
|
|
291
|
+
source,
|
|
292
|
+
previous.sourcesContent?.[index] ?? null,
|
|
293
|
+
)
|
|
294
|
+
})
|
|
295
|
+
return { css: restored, map: Mapping.toEncodedMap(map) }
|
|
296
|
+
}
|