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,531 @@
|
|
|
1
|
+
/** Lowers static recipe structure into ordered ordinary style conditions. @module */
|
|
2
|
+
import type * as Ast from '@oxc-project/types'
|
|
3
|
+
import type * as Query from '../../internal/Query.js'
|
|
4
|
+
import * as ConditionalRecipe from '../../runtime/ConditionalRecipe.js'
|
|
5
|
+
import type * as Recipe from '../../runtime/Recipe.js'
|
|
6
|
+
import type * as StaticRecipe from '../../internal/Recipe.js'
|
|
7
|
+
import * as Expression from './Expression.js'
|
|
8
|
+
import * as RecipeConditions from './RecipeConditions.js'
|
|
9
|
+
import * as RecipePayloads from './RecipePayloads.js'
|
|
10
|
+
import * as Themes from './Themes.js'
|
|
11
|
+
|
|
12
|
+
type Property = Extract<
|
|
13
|
+
Ast.ObjectExpression['properties'][number],
|
|
14
|
+
{ type: 'Property' }
|
|
15
|
+
>
|
|
16
|
+
|
|
17
|
+
function object(node: Ast.Node): asserts node is Ast.ObjectExpression {
|
|
18
|
+
if (node.type !== 'ObjectExpression')
|
|
19
|
+
throw new Themes.InvalidError('Recipes require static object bodies.', node)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function entries(node: Ast.Node): readonly (readonly [string, Property])[] {
|
|
23
|
+
if (node.type !== 'ObjectExpression')
|
|
24
|
+
throw new Themes.InvalidError('Recipes require static object bodies.', node)
|
|
25
|
+
|
|
26
|
+
const seen = new Set<string>()
|
|
27
|
+
return node.properties.map((property) => {
|
|
28
|
+
if (
|
|
29
|
+
property.type !== 'Property' ||
|
|
30
|
+
property.computed ||
|
|
31
|
+
property.method ||
|
|
32
|
+
property.shorthand ||
|
|
33
|
+
property.kind !== 'init'
|
|
34
|
+
)
|
|
35
|
+
throw new Themes.InvalidError(
|
|
36
|
+
'Recipe structure requires explicit static keys.',
|
|
37
|
+
property,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
const key =
|
|
41
|
+
property.key.type === 'Identifier'
|
|
42
|
+
? property.key.name
|
|
43
|
+
: property.key.type === 'Literal'
|
|
44
|
+
? String(property.key.value)
|
|
45
|
+
: undefined
|
|
46
|
+
if (key === undefined || seen.has(key))
|
|
47
|
+
throw new Themes.InvalidError('Recipe keys must be unique.', property)
|
|
48
|
+
|
|
49
|
+
seen.add(key)
|
|
50
|
+
return [key, property] as const
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function choice(node: Ast.Node, choices: readonly string[]): string | null {
|
|
55
|
+
if (
|
|
56
|
+
node.type !== 'Literal' ||
|
|
57
|
+
!(
|
|
58
|
+
node.value === null ||
|
|
59
|
+
typeof node.value === 'string' ||
|
|
60
|
+
typeof node.value === 'boolean'
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
throw new Themes.InvalidError(
|
|
64
|
+
'Selections require literal choice names, booleans, or null.',
|
|
65
|
+
node,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
if (node.value === null) return null
|
|
69
|
+
const value = String(node.value)
|
|
70
|
+
if (!choices.includes(value))
|
|
71
|
+
throw new Themes.InvalidError('Unknown recipe choice.', node)
|
|
72
|
+
|
|
73
|
+
return value
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function predicate(attribute: string, value: string): string {
|
|
77
|
+
const quoted =
|
|
78
|
+
'"' +
|
|
79
|
+
value.replace(
|
|
80
|
+
// oxlint-disable-next-line no-control-regex -- CSS strings require hexadecimal escapes for control characters.
|
|
81
|
+
/[\x00-\x1f\x7f"\\]/g,
|
|
82
|
+
(character) => `\\${character.codePointAt(0)!.toString(16)} `,
|
|
83
|
+
) +
|
|
84
|
+
'"'
|
|
85
|
+
return `[${attribute}=${quoted}]`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Expands every finite alternative while retaining authored style-node locations. */
|
|
89
|
+
export function expand(
|
|
90
|
+
node: Ast.ObjectExpression,
|
|
91
|
+
options: expand.Options,
|
|
92
|
+
): {
|
|
93
|
+
bindings: RecipePayloads.Bindings
|
|
94
|
+
types: { readonly [axis: string]: { readonly [choice: string]: string } }
|
|
95
|
+
body: Ast.ObjectExpression
|
|
96
|
+
recipe: Recipe.Definition
|
|
97
|
+
dynamicRecipe?: StaticRecipe.Definition<Ast.ObjectExpression> | undefined
|
|
98
|
+
staticRecipe?: StaticRecipe.Definition<Ast.ObjectExpression> | undefined
|
|
99
|
+
} {
|
|
100
|
+
const bindings = RecipePayloads.create(options)
|
|
101
|
+
const payloads: Recipe.Payload[] = []
|
|
102
|
+
const defaultsValidators = new Map<
|
|
103
|
+
Recipe.Payload,
|
|
104
|
+
NonNullable<ReturnType<typeof bindings.read>>
|
|
105
|
+
>()
|
|
106
|
+
const types: Record<string, Record<string, string>> = Object.create(null)
|
|
107
|
+
const defaultPayloads: Record<
|
|
108
|
+
string,
|
|
109
|
+
Record<string, string | number>
|
|
110
|
+
> = Object.create(null)
|
|
111
|
+
const properties: Ast.ObjectExpression['properties'] = []
|
|
112
|
+
const fields = new Map(entries(node))
|
|
113
|
+
const axes: Record<string, readonly string[]> = Object.create(null)
|
|
114
|
+
const defaults: Record<string, string | null> = Object.create(null)
|
|
115
|
+
|
|
116
|
+
for (const [key, property] of fields)
|
|
117
|
+
if (
|
|
118
|
+
![
|
|
119
|
+
'base',
|
|
120
|
+
'variants',
|
|
121
|
+
'defaultVariants',
|
|
122
|
+
'compoundVariants',
|
|
123
|
+
'conditions',
|
|
124
|
+
].includes(key)
|
|
125
|
+
)
|
|
126
|
+
throw new Themes.InvalidError(`Unknown recipe field: ${key}.`, property)
|
|
127
|
+
|
|
128
|
+
const conditions = fields.get('conditions')
|
|
129
|
+
const named = (conditions ? entries(conditions.value) : []).map(
|
|
130
|
+
([name, property]) =>
|
|
131
|
+
RecipeConditions.read({
|
|
132
|
+
name,
|
|
133
|
+
node: property.value,
|
|
134
|
+
queries: options.queries,
|
|
135
|
+
}),
|
|
136
|
+
)
|
|
137
|
+
const regions = RecipeConditions.regions(named)
|
|
138
|
+
const base = fields.get('base')
|
|
139
|
+
if (base) {
|
|
140
|
+
object(base.value)
|
|
141
|
+
if (
|
|
142
|
+
named.length ||
|
|
143
|
+
base.value.properties.some(
|
|
144
|
+
(property) =>
|
|
145
|
+
property.type === 'Property' &&
|
|
146
|
+
!property.computed &&
|
|
147
|
+
(property.key.type === 'Identifier'
|
|
148
|
+
? property.key.name === 'targets'
|
|
149
|
+
: property.key.type === 'Literal' &&
|
|
150
|
+
property.key.value === 'targets'),
|
|
151
|
+
)
|
|
152
|
+
)
|
|
153
|
+
properties.push(group(base.value, '&', base.value))
|
|
154
|
+
else properties.push(...(base.value as Ast.ObjectExpression).properties)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function group(node: Ast.Node, key: string, value: Ast.Expression): Property {
|
|
158
|
+
return {
|
|
159
|
+
type: 'Property',
|
|
160
|
+
kind: 'init',
|
|
161
|
+
method: false,
|
|
162
|
+
shorthand: false,
|
|
163
|
+
start: node.start,
|
|
164
|
+
end: node.end,
|
|
165
|
+
computed: false,
|
|
166
|
+
key: {
|
|
167
|
+
type: 'Literal',
|
|
168
|
+
value: key,
|
|
169
|
+
raw: JSON.stringify(key),
|
|
170
|
+
start: node.start,
|
|
171
|
+
end: node.end,
|
|
172
|
+
},
|
|
173
|
+
value,
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
type Rule = {
|
|
178
|
+
bodies?: readonly Ast.ObjectExpression[] | undefined
|
|
179
|
+
matches: readonly (readonly [string, readonly string[]])[]
|
|
180
|
+
property: Property
|
|
181
|
+
suffix: string
|
|
182
|
+
}
|
|
183
|
+
const rules: Rule[] = []
|
|
184
|
+
|
|
185
|
+
const variants = fields.get('variants')
|
|
186
|
+
for (const [axis, property] of variants ? entries(variants.value) : []) {
|
|
187
|
+
if (
|
|
188
|
+
!/^[a-z][a-z0-9-]*$/.test(axis) ||
|
|
189
|
+
axis.startsWith('zyzz-condition-') ||
|
|
190
|
+
[
|
|
191
|
+
'class',
|
|
192
|
+
'className',
|
|
193
|
+
'conditions',
|
|
194
|
+
'key',
|
|
195
|
+
'ref',
|
|
196
|
+
'style',
|
|
197
|
+
'variables',
|
|
198
|
+
].includes(axis)
|
|
199
|
+
)
|
|
200
|
+
throw new Themes.InvalidError(
|
|
201
|
+
'Recipe axes require lowercase data-attribute names and cannot use reserved props.',
|
|
202
|
+
property,
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
const choices = entries(property.value)
|
|
206
|
+
if (!choices.length)
|
|
207
|
+
throw new Themes.InvalidError(
|
|
208
|
+
'Recipe axes require at least one choice.',
|
|
209
|
+
property,
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
for (const [key, property] of choices)
|
|
213
|
+
if (
|
|
214
|
+
(property.key.type === 'Literal' &&
|
|
215
|
+
typeof property.key.value === 'number') ||
|
|
216
|
+
key.includes('\0') ||
|
|
217
|
+
/[\ud800-\udfff]/u.test(key)
|
|
218
|
+
)
|
|
219
|
+
throw new Themes.InvalidError(
|
|
220
|
+
'Recipe choice names require CSS-safe strings.',
|
|
221
|
+
property,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
axes[axis] = choices.map(([key]) => key)
|
|
225
|
+
for (const [key, style] of choices) {
|
|
226
|
+
if (
|
|
227
|
+
key === '__proto__' &&
|
|
228
|
+
(style.value.type === 'ArrowFunctionExpression' ||
|
|
229
|
+
style.value.type === 'FunctionExpression')
|
|
230
|
+
)
|
|
231
|
+
throw new Themes.InvalidError(
|
|
232
|
+
'Dynamic choice names cannot use __proto__.',
|
|
233
|
+
style,
|
|
234
|
+
)
|
|
235
|
+
const models = Array.from({ length: named.length + 1 }, (_, context) =>
|
|
236
|
+
bindings.read(
|
|
237
|
+
style.value,
|
|
238
|
+
`${options.identity}-${Object.keys(axes).length}-${choices.findIndex(([name]) => name === key)}-${context}`,
|
|
239
|
+
),
|
|
240
|
+
)
|
|
241
|
+
const first = models[0]
|
|
242
|
+
if (first) {
|
|
243
|
+
types[axis] ??= Object.create(null)
|
|
244
|
+
types[axis]![key] = options.source.slice(
|
|
245
|
+
first.type.start,
|
|
246
|
+
first.type.end,
|
|
247
|
+
)
|
|
248
|
+
const payload: Recipe.Payload = {
|
|
249
|
+
axis,
|
|
250
|
+
choice: key,
|
|
251
|
+
slots: models.map((model) =>
|
|
252
|
+
Object.fromEntries(
|
|
253
|
+
Object.entries(model!.slots).map(([field, slot]) => [
|
|
254
|
+
field,
|
|
255
|
+
slot.name,
|
|
256
|
+
]),
|
|
257
|
+
),
|
|
258
|
+
),
|
|
259
|
+
}
|
|
260
|
+
payloads.push(payload)
|
|
261
|
+
defaultsValidators.set(payload, first)
|
|
262
|
+
}
|
|
263
|
+
rules.push({
|
|
264
|
+
matches: [[axis, [key]]],
|
|
265
|
+
property: style,
|
|
266
|
+
suffix: '',
|
|
267
|
+
...(first ? { bodies: models.map((model) => model!.body) } : {}),
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const defaultVariants = fields.get('defaultVariants')
|
|
273
|
+
for (const [axis, property] of defaultVariants
|
|
274
|
+
? entries(defaultVariants.value)
|
|
275
|
+
: []) {
|
|
276
|
+
if (!Object.hasOwn(axes, axis))
|
|
277
|
+
throw new Themes.InvalidError('Unknown default variant axis.', property)
|
|
278
|
+
|
|
279
|
+
if (
|
|
280
|
+
property.value.type === 'Identifier' &&
|
|
281
|
+
property.value.name === 'undefined'
|
|
282
|
+
)
|
|
283
|
+
continue
|
|
284
|
+
|
|
285
|
+
if (property.value.type === 'ObjectExpression') {
|
|
286
|
+
const selections = entries(property.value)
|
|
287
|
+
const selected = selections[0]
|
|
288
|
+
const payload =
|
|
289
|
+
selected &&
|
|
290
|
+
payloads.find(
|
|
291
|
+
(item) => item.axis === axis && item.choice === selected[0],
|
|
292
|
+
)
|
|
293
|
+
if (selections.length !== 1 || !selected || !payload)
|
|
294
|
+
throw new Themes.InvalidError(
|
|
295
|
+
'Dynamic defaults require exactly one declared dynamic choice.',
|
|
296
|
+
property,
|
|
297
|
+
)
|
|
298
|
+
const values: Record<string, string | number> = Object.create(null)
|
|
299
|
+
for (const [field, input] of entries(selected[1].value)) {
|
|
300
|
+
const node = input.value
|
|
301
|
+
const value =
|
|
302
|
+
node.type === 'TemplateLiteral'
|
|
303
|
+
? Expression.template(node)
|
|
304
|
+
: node.type === 'Literal'
|
|
305
|
+
? node.value
|
|
306
|
+
: node.type === 'UnaryExpression' &&
|
|
307
|
+
node.argument.type === 'Literal' &&
|
|
308
|
+
typeof node.argument.value === 'number' &&
|
|
309
|
+
(node.operator === '-' || node.operator === '+')
|
|
310
|
+
? node.operator === '-'
|
|
311
|
+
? -node.argument.value
|
|
312
|
+
: node.argument.value
|
|
313
|
+
: undefined
|
|
314
|
+
if (
|
|
315
|
+
!Object.hasOwn(payload.slots[0]!, field) ||
|
|
316
|
+
(typeof value !== 'string' && typeof value !== 'number')
|
|
317
|
+
)
|
|
318
|
+
throw new Themes.InvalidError(
|
|
319
|
+
'Dynamic defaults require complete scalar payloads.',
|
|
320
|
+
input,
|
|
321
|
+
)
|
|
322
|
+
if (!defaultsValidators.get(payload)!.acceptsValue(field, value))
|
|
323
|
+
throw new Themes.InvalidError(
|
|
324
|
+
'Dynamic default does not match its declared payload type.',
|
|
325
|
+
input,
|
|
326
|
+
)
|
|
327
|
+
values[field] = value
|
|
328
|
+
}
|
|
329
|
+
if (Object.keys(values).length !== Object.keys(payload.slots[0]!).length)
|
|
330
|
+
throw new Themes.InvalidError(
|
|
331
|
+
'Dynamic defaults require complete scalar payloads.',
|
|
332
|
+
property,
|
|
333
|
+
)
|
|
334
|
+
defaults[axis] = selected[0]
|
|
335
|
+
defaultPayloads[axis] = values
|
|
336
|
+
} else {
|
|
337
|
+
defaults[axis] = choice(property.value, axes[axis]!)
|
|
338
|
+
if (
|
|
339
|
+
payloads.some(
|
|
340
|
+
(item) => item.axis === axis && item.choice === defaults[axis],
|
|
341
|
+
)
|
|
342
|
+
)
|
|
343
|
+
throw new Themes.InvalidError(
|
|
344
|
+
'Dynamic choices require a scoped payload.',
|
|
345
|
+
property,
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const compounds = fields.get('compoundVariants')
|
|
351
|
+
if (compounds) {
|
|
352
|
+
if (compounds.value.type !== 'ArrayExpression')
|
|
353
|
+
throw new Themes.InvalidError(
|
|
354
|
+
'Compounds require a static array.',
|
|
355
|
+
compounds,
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
for (const [index, element] of compounds.value.elements.entries()) {
|
|
359
|
+
if (!element)
|
|
360
|
+
throw new Themes.InvalidError(
|
|
361
|
+
'Compounds require dense entries.',
|
|
362
|
+
compounds,
|
|
363
|
+
)
|
|
364
|
+
const fields = new Map(entries(element))
|
|
365
|
+
const when = fields.get('when')
|
|
366
|
+
const style = fields.get('style')
|
|
367
|
+
if (!when || !style || fields.size !== 2)
|
|
368
|
+
throw new Themes.InvalidError(
|
|
369
|
+
'Compounds require only when and style.',
|
|
370
|
+
element,
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
const matches: (readonly [string, readonly string[]])[] = []
|
|
374
|
+
for (const [axis, property] of entries(when.value)) {
|
|
375
|
+
if (!Object.hasOwn(axes, axis))
|
|
376
|
+
throw new Themes.InvalidError(
|
|
377
|
+
'Unknown compound variant axis.',
|
|
378
|
+
property,
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
const values =
|
|
382
|
+
property.value.type === 'ArrayExpression'
|
|
383
|
+
? property.value.elements
|
|
384
|
+
: [property.value]
|
|
385
|
+
if (!values.length || values.some((value) => !value))
|
|
386
|
+
throw new Themes.InvalidError(
|
|
387
|
+
'Compound matches require nonempty choices.',
|
|
388
|
+
property,
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
matches.push([
|
|
392
|
+
axis,
|
|
393
|
+
values.map((value) => {
|
|
394
|
+
const selected = choice(value!, axes[axis]!)
|
|
395
|
+
if (selected === null)
|
|
396
|
+
throw new Themes.InvalidError(
|
|
397
|
+
'Compounds match choice names, not null.',
|
|
398
|
+
value!,
|
|
399
|
+
)
|
|
400
|
+
return selected
|
|
401
|
+
}),
|
|
402
|
+
])
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// Distinct zero-specificity suffixes preserve repeated compound groups.
|
|
406
|
+
rules.push({
|
|
407
|
+
matches,
|
|
408
|
+
property: style,
|
|
409
|
+
suffix: `:where(*, .__zyzz-compound-${index})`,
|
|
410
|
+
})
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
const tree: Ast.ObjectExpression = { ...node, properties: [] }
|
|
415
|
+
for (const region of regions) {
|
|
416
|
+
let target = tree
|
|
417
|
+
for (const { node: source, rule } of region.rules) {
|
|
418
|
+
const existing = target.properties.find(
|
|
419
|
+
(property) =>
|
|
420
|
+
property.type === 'Property' &&
|
|
421
|
+
property.key.type === 'Literal' &&
|
|
422
|
+
property.key.value === rule,
|
|
423
|
+
) as Property | undefined
|
|
424
|
+
if (existing) target = existing.value as Ast.ObjectExpression
|
|
425
|
+
else {
|
|
426
|
+
const nested: Ast.ObjectExpression = { ...node, properties: [] }
|
|
427
|
+
target.properties.push(group(source, rule, nested))
|
|
428
|
+
target = nested
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
for (const { bodies, matches, property, suffix } of rules) {
|
|
433
|
+
if (bodies) {
|
|
434
|
+
const [axis, choices] = matches[0]!
|
|
435
|
+
const sources = [-1, ...region.active]
|
|
436
|
+
for (const [index, condition] of sources.entries()) {
|
|
437
|
+
const attribute =
|
|
438
|
+
condition === -1
|
|
439
|
+
? `data-${axis}`
|
|
440
|
+
: ConditionalRecipe.attribute({ axis, condition })
|
|
441
|
+
const excluded = sources
|
|
442
|
+
.slice(index + 1)
|
|
443
|
+
.map(
|
|
444
|
+
(condition) =>
|
|
445
|
+
`:not([${ConditionalRecipe.attribute({ axis, condition })}])`,
|
|
446
|
+
)
|
|
447
|
+
.join('')
|
|
448
|
+
const selector = `&:where(${predicate(attribute, condition === -1 ? choices[0]! : `s${choices[0]}`)}${excluded})`
|
|
449
|
+
target.properties.push(
|
|
450
|
+
group(property.key, selector, bodies[condition + 1]!),
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
continue
|
|
454
|
+
}
|
|
455
|
+
object(property.value)
|
|
456
|
+
const selector =
|
|
457
|
+
'&' +
|
|
458
|
+
matches
|
|
459
|
+
.map(([axis, choices]) => {
|
|
460
|
+
const sources = [-1, ...region.active]
|
|
461
|
+
const alternatives = sources.flatMap((condition, index) => {
|
|
462
|
+
const attribute =
|
|
463
|
+
condition === -1
|
|
464
|
+
? `data-${axis}`
|
|
465
|
+
: ConditionalRecipe.attribute({ axis, condition })
|
|
466
|
+
const excluded = sources
|
|
467
|
+
.slice(index + 1)
|
|
468
|
+
.map(
|
|
469
|
+
(condition) =>
|
|
470
|
+
`:not([${ConditionalRecipe.attribute({ axis, condition })}])`,
|
|
471
|
+
)
|
|
472
|
+
.join('')
|
|
473
|
+
return choices.map(
|
|
474
|
+
(choice) =>
|
|
475
|
+
predicate(
|
|
476
|
+
attribute,
|
|
477
|
+
condition === -1 ? choice : `s${choice}`,
|
|
478
|
+
) + excluded,
|
|
479
|
+
)
|
|
480
|
+
})
|
|
481
|
+
return `:where(${alternatives.join(',')})`
|
|
482
|
+
})
|
|
483
|
+
.join('') +
|
|
484
|
+
suffix
|
|
485
|
+
target.properties.push(group(property.key, selector, property.value))
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
properties.push(...tree.properties)
|
|
489
|
+
|
|
490
|
+
return {
|
|
491
|
+
bindings,
|
|
492
|
+
types,
|
|
493
|
+
body: { ...node, properties },
|
|
494
|
+
...(!named.length
|
|
495
|
+
? {
|
|
496
|
+
[payloads.length ? 'dynamicRecipe' : 'staticRecipe']: {
|
|
497
|
+
axes,
|
|
498
|
+
defaults,
|
|
499
|
+
rules: [
|
|
500
|
+
...(base
|
|
501
|
+
? [{ matches: [], value: base.value as Ast.ObjectExpression }]
|
|
502
|
+
: []),
|
|
503
|
+
...rules.map(({ matches, property, bodies }) => ({
|
|
504
|
+
matches,
|
|
505
|
+
value: bodies?.[0] ?? (property.value as Ast.ObjectExpression),
|
|
506
|
+
})),
|
|
507
|
+
],
|
|
508
|
+
},
|
|
509
|
+
}
|
|
510
|
+
: {}),
|
|
511
|
+
recipe: {
|
|
512
|
+
axes,
|
|
513
|
+
defaults,
|
|
514
|
+
...(payloads.length ? { payloads, defaultPayloads } : {}),
|
|
515
|
+
...(named.length ? { conditions: named.map(({ name }) => name) } : {}),
|
|
516
|
+
},
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/** Source inputs for finite recipe lowering. */
|
|
521
|
+
export declare namespace expand {
|
|
522
|
+
/** Resolution hooks and source identity for isolated payload slots. */
|
|
523
|
+
type Options = RecipePayloads.create.Options & {
|
|
524
|
+
/** Stable module and call identity. */
|
|
525
|
+
readonly identity: string
|
|
526
|
+
/** Bound query aliases. */
|
|
527
|
+
readonly queries?: Query.Metadata | undefined
|
|
528
|
+
/** Original source retained for declaration signatures. */
|
|
529
|
+
readonly source: string
|
|
530
|
+
}
|
|
531
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retains closed in-memory relative resolution for callers without a build host.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Resolves only supplied relative source modules; build adapters supply their own edges. */
|
|
7
|
+
export function resolve(options: resolve.Options): string | undefined {
|
|
8
|
+
if (!options.specifier.startsWith('.')) return undefined
|
|
9
|
+
|
|
10
|
+
if (
|
|
11
|
+
/\.[a-z0-9]+$/i.test(options.specifier) &&
|
|
12
|
+
!/\.[cm]?[jt]sx?$/.test(options.specifier)
|
|
13
|
+
)
|
|
14
|
+
return undefined
|
|
15
|
+
|
|
16
|
+
const parts = options.moduleId.split('/').slice(0, -1)
|
|
17
|
+
|
|
18
|
+
for (const part of options.specifier.split('/')) {
|
|
19
|
+
if (part === '.' || !part) continue
|
|
20
|
+
|
|
21
|
+
if (part === '..') {
|
|
22
|
+
if (!parts.length)
|
|
23
|
+
throw new Error('Source import escapes the supplied graph.')
|
|
24
|
+
|
|
25
|
+
parts.pop()
|
|
26
|
+
} else parts.push(part)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const path = parts.join('/')
|
|
30
|
+
if (Object.hasOwn(options.modules, path)) return path
|
|
31
|
+
|
|
32
|
+
const candidates = (() => {
|
|
33
|
+
if (/\.[cm]?jsx?$/.test(path)) {
|
|
34
|
+
return [
|
|
35
|
+
path.replace(/\.js$/, '.ts'),
|
|
36
|
+
path.replace(/\.js$/, '.tsx'),
|
|
37
|
+
path.replace(/\.jsx$/, '.tsx'),
|
|
38
|
+
path.replace(/\.mjs$/, '.mts'),
|
|
39
|
+
path.replace(/\.cjs$/, '.cts'),
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!/\.[^/]+$/.test(path)) {
|
|
44
|
+
return [
|
|
45
|
+
'.cjs',
|
|
46
|
+
'.cjsx',
|
|
47
|
+
'.cts',
|
|
48
|
+
'.ctsx',
|
|
49
|
+
'.js',
|
|
50
|
+
'.jsx',
|
|
51
|
+
'.mjs',
|
|
52
|
+
'.mjsx',
|
|
53
|
+
'.mts',
|
|
54
|
+
'.mtsx',
|
|
55
|
+
'.ts',
|
|
56
|
+
'.tsx',
|
|
57
|
+
].flatMap((extension) => [path + extension, path + '/index' + extension])
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return []
|
|
61
|
+
})()
|
|
62
|
+
|
|
63
|
+
const matches = [...new Set(candidates)].filter((candidate) =>
|
|
64
|
+
Object.hasOwn(options.modules, candidate),
|
|
65
|
+
)
|
|
66
|
+
if (matches.length !== 1)
|
|
67
|
+
throw new Error(
|
|
68
|
+
matches.length
|
|
69
|
+
? `Ambiguous source import: ${options.specifier}`
|
|
70
|
+
: `Missing source module: ${options.specifier}`,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
return matches[0]!
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Closed source-map resolution contracts. */
|
|
77
|
+
export declare namespace resolve {
|
|
78
|
+
/** Source identity and available files; no filesystem or package lookup occurs. */
|
|
79
|
+
type Options = {
|
|
80
|
+
/** Importing source identity. */
|
|
81
|
+
readonly moduleId: string
|
|
82
|
+
/** Complete supplied source map. */
|
|
83
|
+
readonly modules: Readonly<Record<string, string>>
|
|
84
|
+
/** Authored import string. */
|
|
85
|
+
readonly specifier: string
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves lexical bindings and shadowing across parsed JavaScript scopes.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import * as Walker from 'oxc-walker'
|
|
6
|
+
|
|
7
|
+
/** ScopeTracker extension that keeps body variables out of parameter initializers. */
|
|
8
|
+
export class Tracker extends Walker.ScopeTracker {
|
|
9
|
+
protected override getVarScopeKey(): string {
|
|
10
|
+
for (let index = this.scopeOwnerStack.length - 1; index >= 0; index--) {
|
|
11
|
+
const owner = this.scopeOwnerStack[index]!
|
|
12
|
+
|
|
13
|
+
if (
|
|
14
|
+
owner.type === 'ArrowFunctionExpression' ||
|
|
15
|
+
owner.type === 'FunctionDeclaration' ||
|
|
16
|
+
owner.type === 'FunctionExpression'
|
|
17
|
+
) {
|
|
18
|
+
// oxc-walker 1.1.1 hoists body vars into the parameter environment.
|
|
19
|
+
// Its existing body scope preserves the enclosing parameter bindings.
|
|
20
|
+
if (this.scopeOwnerStack[index + 1] === owner.body)
|
|
21
|
+
return this.getScopeKeyAt(index + 1)
|
|
22
|
+
|
|
23
|
+
break
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (
|
|
27
|
+
owner.type === 'Program' ||
|
|
28
|
+
owner.type === 'StaticBlock' ||
|
|
29
|
+
owner.type === 'TSModuleBlock'
|
|
30
|
+
)
|
|
31
|
+
break
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return super.getVarScopeKey()
|
|
35
|
+
}
|
|
36
|
+
}
|