zyzz 0.0.0 → 0.0.2
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 +167 -0
- package/dist/Style.d.ts.map +1 -0
- package/dist/Style.js +284 -0
- package/dist/Style.js.map +1 -0
- package/dist/Theme.d.ts +154 -0
- package/dist/Theme.d.ts.map +1 -0
- package/dist/Theme.js +257 -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 +165 -0
- package/dist/compiler/Source.d.ts.map +1 -0
- package/dist/compiler/Source.js +990 -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 +884 -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 +600 -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 +2008 -0
- package/dist/default.d.ts.map +1 -0
- package/dist/default.js +243 -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 +49 -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/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 +690 -0
- package/src/Props.ts +8 -0
- package/src/Style.ts +748 -0
- package/src/Theme.ts +713 -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 +1550 -0
- package/src/compiler/Transform.ts +1235 -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 +846 -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 +484 -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 +120 -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/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,112 @@
|
|
|
1
|
+
/** Names atomic declarations with readable values and scoped conflict identities. @module */
|
|
2
|
+
import * as Literal from '../../internal/Literal.js'
|
|
3
|
+
|
|
4
|
+
/** Creates a CSS identifier without embedding arbitrary CSS syntax. */
|
|
5
|
+
export function create(options: create.Options): string {
|
|
6
|
+
const property = Object.hasOwn(aliases, options.property)
|
|
7
|
+
? aliases[options.property]!
|
|
8
|
+
: Literal.name(options.property)
|
|
9
|
+
const condition =
|
|
10
|
+
/^&:(hover|focus|focus-visible|active|disabled)\{([^{}]+)\}$/.exec(
|
|
11
|
+
options.body,
|
|
12
|
+
)
|
|
13
|
+
const body = condition?.[2] ?? options.body
|
|
14
|
+
const prefix = `${Literal.name(options.property)}:`
|
|
15
|
+
const literal =
|
|
16
|
+
body.startsWith(prefix) && body.endsWith(';')
|
|
17
|
+
? body.slice(prefix.length, -1)
|
|
18
|
+
: ''
|
|
19
|
+
const simple = /^[a-zA-Z0-9-]{1,24}$/.test(literal)
|
|
20
|
+
const label =
|
|
21
|
+
options.property === 'display' && displays.has(literal)
|
|
22
|
+
? literal
|
|
23
|
+
: `${property.startsWith('--') ? encode(property).replaceAll('-', '_2d_') : property}${simple ? `-${literal}` : ''}`
|
|
24
|
+
|
|
25
|
+
const suffix = (() => {
|
|
26
|
+
if (options.context !== undefined)
|
|
27
|
+
return `-${hash(options.stable || simple ? options.context : JSON.stringify([options.context, options.body]))}${options.slot === undefined ? '' : `-${options.slot}`}`
|
|
28
|
+
if (!simple) return `-${hash(options.body)}`
|
|
29
|
+
return ''
|
|
30
|
+
})()
|
|
31
|
+
|
|
32
|
+
if (options.stable) return `z-${encode(property)}${suffix}`
|
|
33
|
+
|
|
34
|
+
// Custom properties and vendor spellings can contain identifier punctuation.
|
|
35
|
+
return `z-${condition ? `${condition[1]}-` : ''}${encode(label)}${suffix}`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Atomic naming inputs; context retains declaration ordering and module ownership. */
|
|
39
|
+
export declare namespace create {
|
|
40
|
+
/** Serialized declaration and its optional stable slot identity. */
|
|
41
|
+
type Options = {
|
|
42
|
+
/** Complete declaration, including fallbacks and conditions. */
|
|
43
|
+
readonly body: string
|
|
44
|
+
/** Identity required when the declaration cannot share a global rule. */
|
|
45
|
+
readonly context?: string | undefined
|
|
46
|
+
/** Authoring property spelling. */
|
|
47
|
+
readonly property: string
|
|
48
|
+
/** Ordered declaration slot inside a contextual style. */
|
|
49
|
+
readonly slot?: number | undefined
|
|
50
|
+
/** Keep names independent of values for CSS-only development updates. */
|
|
51
|
+
readonly stable?: boolean | undefined
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const aliases: Readonly<Record<string, string>> = {
|
|
56
|
+
backgroundColor: 'bg',
|
|
57
|
+
color: 'text',
|
|
58
|
+
height: 'h',
|
|
59
|
+
margin: 'm',
|
|
60
|
+
marginBottom: 'mb',
|
|
61
|
+
marginLeft: 'ml',
|
|
62
|
+
marginRight: 'mr',
|
|
63
|
+
marginTop: 'mt',
|
|
64
|
+
opacity: 'opacity',
|
|
65
|
+
padding: 'p',
|
|
66
|
+
paddingBottom: 'pb',
|
|
67
|
+
paddingLeft: 'pl',
|
|
68
|
+
paddingRight: 'pr',
|
|
69
|
+
paddingTop: 'pt',
|
|
70
|
+
width: 'w',
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Flex and grid also name shorthand properties, so retain their display prefix.
|
|
74
|
+
const displays = new Set([
|
|
75
|
+
'block',
|
|
76
|
+
'inline',
|
|
77
|
+
'inline-block',
|
|
78
|
+
'inline-flex',
|
|
79
|
+
'inline-grid',
|
|
80
|
+
'none',
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
function encode(value: string): string {
|
|
84
|
+
return value.replace(
|
|
85
|
+
/[^a-zA-Z0-9-]/g,
|
|
86
|
+
(character) => `_${character.charCodeAt(0).toString(16)}_`,
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Six CSS identifier characters retain 36 bits from two deterministic streams.
|
|
91
|
+
function hash(value: string): string {
|
|
92
|
+
let first = 2166136261
|
|
93
|
+
let second = 5381
|
|
94
|
+
|
|
95
|
+
for (let index = 0; index < value.length; index++) {
|
|
96
|
+
const code = value.charCodeAt(index)
|
|
97
|
+
first = Math.imul(first ^ code, 16777619)
|
|
98
|
+
second = Math.imul(second, 33) ^ code
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const alphabet =
|
|
102
|
+
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-'
|
|
103
|
+
let bits = (first >>> 0) * 16 + (second >>> 28)
|
|
104
|
+
let result = ''
|
|
105
|
+
|
|
106
|
+
for (let index = 0; index < 6; index++) {
|
|
107
|
+
result = alphabet[bits % 64]! + result
|
|
108
|
+
bits = Math.floor(bits / 64)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return result
|
|
112
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Defines legal enclosing contexts for stylesheet declaration helpers. @module */
|
|
2
|
+
/** Conditional and layer headers accepted around stylesheet declarations. */
|
|
3
|
+
export type Group =
|
|
4
|
+
| '@layer'
|
|
5
|
+
| `@${'container' | 'layer' | 'media' | 'supports'}${'\t' | '\n' | '\r' | '\f' | '(' | `/*${string}*/`}${string}`
|
|
6
|
+
| `@container ${string}`
|
|
7
|
+
| `@layer ${string}`
|
|
8
|
+
| `@media ${string}`
|
|
9
|
+
| `@supports ${string}`
|
|
10
|
+
/** Ordered enclosing groups, from outermost to innermost. */
|
|
11
|
+
export type Options = {
|
|
12
|
+
/** Explicit identity for named declarations without source rewriting. */
|
|
13
|
+
readonly id?: string | undefined
|
|
14
|
+
/** Enclosing groups; omitted means stylesheet scope. */
|
|
15
|
+
readonly within?: readonly Group[] | undefined
|
|
16
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/** Pure ordered stylesheet contribution data and layer ordering. @module */
|
|
2
|
+
import * as Block from './Block.js'
|
|
3
|
+
import * as Namespace from './Namespace.js'
|
|
4
|
+
import type * as Style from '../../Style.js'
|
|
5
|
+
|
|
6
|
+
/** Explicit stylesheet data supplied by source adapters or in-memory callers. */
|
|
7
|
+
export type Definition = {
|
|
8
|
+
/** Enclosing groups in authored outermost-first order. */
|
|
9
|
+
readonly within?: readonly string[] | undefined
|
|
10
|
+
} & (
|
|
11
|
+
| {
|
|
12
|
+
/** Whether the registered value inherits from its parent element. */
|
|
13
|
+
readonly inherits: boolean
|
|
14
|
+
/** Computationally independent initial CSS value. */
|
|
15
|
+
readonly initialValue?: number | string | undefined
|
|
16
|
+
/** Emits a CSS custom-property registration rule. */
|
|
17
|
+
readonly kind: 'property'
|
|
18
|
+
/** Registered custom-property name, including the -- prefix. */
|
|
19
|
+
readonly name: `--${string}`
|
|
20
|
+
/** CSS Properties and Values syntax descriptor. */
|
|
21
|
+
readonly syntax: string
|
|
22
|
+
}
|
|
23
|
+
| {
|
|
24
|
+
readonly kind: 'rule'
|
|
25
|
+
readonly selector: string
|
|
26
|
+
readonly style: Style.NamedStyle
|
|
27
|
+
}
|
|
28
|
+
| {
|
|
29
|
+
readonly kind: 'font-face'
|
|
30
|
+
readonly declarations: Readonly<Record<string, string | number>>
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
readonly kind: 'keyframes'
|
|
34
|
+
readonly name: string
|
|
35
|
+
readonly frames: readonly {
|
|
36
|
+
readonly stop: string
|
|
37
|
+
readonly style: Style.NamedStyle
|
|
38
|
+
}[]
|
|
39
|
+
}
|
|
40
|
+
| {
|
|
41
|
+
/** Structured named descriptor rule. */
|
|
42
|
+
readonly kind: 'descriptor'
|
|
43
|
+
/** Compiler-owned rule name. */
|
|
44
|
+
readonly name: string
|
|
45
|
+
/** CSS descriptor rule family. */
|
|
46
|
+
readonly rule: 'color-profile' | 'counter-style' | 'font-palette-values'
|
|
47
|
+
/** Authored scalar descriptors. */
|
|
48
|
+
readonly declarations: Readonly<Record<string, string | number>>
|
|
49
|
+
}
|
|
50
|
+
| {
|
|
51
|
+
/** Structured document-level descriptor rule. */
|
|
52
|
+
readonly kind: 'block'
|
|
53
|
+
/** CSS rule header. */
|
|
54
|
+
readonly header: string
|
|
55
|
+
/** Descriptors and nested blocks in authored order. */
|
|
56
|
+
readonly entries: readonly Block.Entry[]
|
|
57
|
+
}
|
|
58
|
+
| (Namespace.Definition & { readonly kind: 'namespace' })
|
|
59
|
+
| {
|
|
60
|
+
readonly kind: 'import'
|
|
61
|
+
readonly url: string
|
|
62
|
+
readonly layer?: string | true | undefined
|
|
63
|
+
readonly supports?: string | undefined
|
|
64
|
+
readonly media?: string | undefined
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
readonly kind: 'custom-media'
|
|
68
|
+
readonly name: string
|
|
69
|
+
readonly query: string | boolean
|
|
70
|
+
}
|
|
71
|
+
| { readonly kind: 'layers'; readonly names: readonly string[] }
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
/** Merges declared ordering constraints with deterministic unconstrained ties. */
|
|
75
|
+
export function order(
|
|
76
|
+
lists: readonly (readonly string[])[],
|
|
77
|
+
): readonly string[] {
|
|
78
|
+
const scopes = new Map<string, Map<string, Set<string>>>()
|
|
79
|
+
const authored = new Set<string>()
|
|
80
|
+
|
|
81
|
+
function scope(parent: string) {
|
|
82
|
+
let graph = scopes.get(parent)
|
|
83
|
+
|
|
84
|
+
if (!graph) {
|
|
85
|
+
graph = new Map()
|
|
86
|
+
scopes.set(parent, graph)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return graph
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
for (const list of lists) {
|
|
93
|
+
if (new Set(list).size !== list.length)
|
|
94
|
+
throw new Error('Duplicate layer name.')
|
|
95
|
+
|
|
96
|
+
for (const name of list) {
|
|
97
|
+
if (
|
|
98
|
+
!/^(?:--|-?[_a-zA-Z])[\w-]*(?:\.(?:--|-?[_a-zA-Z])[\w-]*)*$/.test(
|
|
99
|
+
name,
|
|
100
|
+
) ||
|
|
101
|
+
name
|
|
102
|
+
.split('.')
|
|
103
|
+
.some((part) =>
|
|
104
|
+
[
|
|
105
|
+
'default',
|
|
106
|
+
'inherit',
|
|
107
|
+
'initial',
|
|
108
|
+
'revert',
|
|
109
|
+
'revert-layer',
|
|
110
|
+
'unset',
|
|
111
|
+
].includes(part.toLowerCase()),
|
|
112
|
+
)
|
|
113
|
+
)
|
|
114
|
+
throw new Error('Invalid layer name.')
|
|
115
|
+
|
|
116
|
+
authored.add(name)
|
|
117
|
+
|
|
118
|
+
const parts = name.split('.')
|
|
119
|
+
|
|
120
|
+
for (let index = 0; index < parts.length; index++) {
|
|
121
|
+
const graph = scope(parts.slice(0, index).join('.'))
|
|
122
|
+
|
|
123
|
+
if (!graph.has(parts[index]!)) graph.set(parts[index]!, new Set())
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
for (let index = 1; index < list.length; index++) {
|
|
128
|
+
const before = list[index - 1]!.split('.'),
|
|
129
|
+
after = list[index]!.split('.')
|
|
130
|
+
const at = before.findIndex((value, index) => value !== after[index])
|
|
131
|
+
|
|
132
|
+
if (at >= 0 && after[at] !== undefined)
|
|
133
|
+
scope(before.slice(0, at).join('.')).get(before[at]!)!.add(after[at]!)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const result: string[] = []
|
|
138
|
+
|
|
139
|
+
function emit(parent: string) {
|
|
140
|
+
const graph = scopes.get(parent)
|
|
141
|
+
if (!graph) return
|
|
142
|
+
|
|
143
|
+
while (graph.size) {
|
|
144
|
+
const targets = new Set(
|
|
145
|
+
[...graph.values()].flatMap((values) => [...values]),
|
|
146
|
+
)
|
|
147
|
+
const next = [...graph.keys()].find((name) => !targets.has(name))
|
|
148
|
+
if (next === undefined)
|
|
149
|
+
throw new Error('Conflicting layer order constraints.')
|
|
150
|
+
|
|
151
|
+
const name = parent ? `${parent}.${next}` : next
|
|
152
|
+
|
|
153
|
+
if (authored.has(name)) result.push(name)
|
|
154
|
+
|
|
155
|
+
graph.delete(next)
|
|
156
|
+
emit(name)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
emit('')
|
|
161
|
+
|
|
162
|
+
return result
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Renders static contributions without registration or environment access. */
|
|
166
|
+
export function render(
|
|
167
|
+
definitions: readonly Definition[],
|
|
168
|
+
style: (value: Style.NamedStyle) => string,
|
|
169
|
+
): string {
|
|
170
|
+
const layers = order(
|
|
171
|
+
definitions.flatMap((value) =>
|
|
172
|
+
value.kind === 'layers' ? [value.names] : [],
|
|
173
|
+
),
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
return [
|
|
177
|
+
layers.length ? `@layer ${layers.join(',')};` : '',
|
|
178
|
+
...definitions
|
|
179
|
+
.toSorted((a, b) => rank(a) - rank(b))
|
|
180
|
+
.map((value) => {
|
|
181
|
+
if (value.kind === 'layers') return ''
|
|
182
|
+
const css = (() => {
|
|
183
|
+
if (value.kind === 'namespace') return Namespace.statement(value)
|
|
184
|
+
if (value.kind === 'custom-media')
|
|
185
|
+
return `@custom-media ${value.name} ${value.query};`
|
|
186
|
+
if (value.kind === 'import')
|
|
187
|
+
return `@import url(${JSON.stringify(value.url)})${value.layer === true ? ' layer' : value.layer ? ` layer(${value.layer})` : ''}${value.supports ? ` supports(${value.supports})` : ''}${value.media ? ` ${value.media}` : ''};`
|
|
188
|
+
if (value.kind === 'block')
|
|
189
|
+
return `${value.header}{${Block.render(value.entries, style)}}`
|
|
190
|
+
if (value.kind === 'rule')
|
|
191
|
+
return `${value.selector}{${style(value.style)}}`
|
|
192
|
+
if (value.kind === 'property')
|
|
193
|
+
return `@property ${value.name}{syntax:${JSON.stringify(value.syntax)};inherits:${value.inherits};${value.initialValue === undefined ? '' : `initial-value:${value.initialValue};`}}`
|
|
194
|
+
if (value.kind === 'font-face' || value.kind === 'descriptor')
|
|
195
|
+
return `@${value.kind === 'font-face' ? 'font-face' : `${value.rule} ${value.name}`}{${Object.entries(
|
|
196
|
+
value.declarations,
|
|
197
|
+
)
|
|
198
|
+
.map(
|
|
199
|
+
([key, value]) =>
|
|
200
|
+
`${key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}:${value};`,
|
|
201
|
+
)
|
|
202
|
+
.join('')}}`
|
|
203
|
+
return `@keyframes ${value.name}{${value.frames.map((frame) => `${frame.stop}{${style(frame.style)}}`).join('')}}`
|
|
204
|
+
})()
|
|
205
|
+
return (value.within ?? []).reduceRight(
|
|
206
|
+
(body, header) => `${header}{${body}}`,
|
|
207
|
+
css,
|
|
208
|
+
)
|
|
209
|
+
}),
|
|
210
|
+
]
|
|
211
|
+
.filter(Boolean)
|
|
212
|
+
.join('\n')
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function rank(value: Definition): number {
|
|
216
|
+
if (value.kind === 'import') return 0
|
|
217
|
+
if (value.kind === 'namespace') return 1
|
|
218
|
+
return 2
|
|
219
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Defines source-owned namespace bindings and their CSS statement encoding. @module */
|
|
2
|
+
/** One authored namespace and its compiler-owned output prefix. */
|
|
3
|
+
export type Definition = {
|
|
4
|
+
/** Unique emitted namespace prefix. */
|
|
5
|
+
readonly name: string
|
|
6
|
+
/** Authored selector prefix, or omitted for the default namespace. */
|
|
7
|
+
readonly prefix?: string | undefined
|
|
8
|
+
/** Namespace URI; this is an identity, not an asset URL. */
|
|
9
|
+
readonly uri: string
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Encodes a namespace URI as a CSS string, including control characters and quotes. */
|
|
13
|
+
export function statement(value: Definition): string {
|
|
14
|
+
// eslint-disable-next-line no-control-regex -- CSS strings require escaping control characters.
|
|
15
|
+
const uri = value.uri.replace(/[\x00-\x1f\x7f"\\]/g, (char) => {
|
|
16
|
+
if (char === '\0') return '\uFFFD'
|
|
17
|
+
if (char === '"' || char === '\\') return `\\${char}`
|
|
18
|
+
return `\\${char.charCodeAt(0).toString(16)} `
|
|
19
|
+
})
|
|
20
|
+
return `@namespace ${value.name} "${uri}";`
|
|
21
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collects live theme references and emits graph-local variables and scope rules.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
import * as Scheme from '../../internal/Scheme.js'
|
|
6
|
+
import * as Token from '../../internal/Token.js'
|
|
7
|
+
import type * as Theme from '../../Theme.js'
|
|
8
|
+
|
|
9
|
+
/** Collects live token references within one in-memory compilation graph. */
|
|
10
|
+
export function create() {
|
|
11
|
+
let nextScope = 0
|
|
12
|
+
let nextVariable = 0
|
|
13
|
+
const contracts = new Map<
|
|
14
|
+
Token.Contract,
|
|
15
|
+
{ identity: string | undefined; paths: Map<string, string> }
|
|
16
|
+
>()
|
|
17
|
+
|
|
18
|
+
function serialize(token: Token.Reference): string {
|
|
19
|
+
const value = token.value
|
|
20
|
+
let contract = contracts.get(token.contract)
|
|
21
|
+
|
|
22
|
+
if (!contract) {
|
|
23
|
+
contract = {
|
|
24
|
+
identity: token.contract[Token.identity],
|
|
25
|
+
paths: new Map(),
|
|
26
|
+
}
|
|
27
|
+
contracts.set(token.contract, contract)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let name = contract.paths.get(token.path)
|
|
31
|
+
|
|
32
|
+
if (!name) {
|
|
33
|
+
name =
|
|
34
|
+
contract.identity === undefined
|
|
35
|
+
? `--z${nextVariable++}`
|
|
36
|
+
: variable(contract.identity, token.path)
|
|
37
|
+
contract.paths.set(token.path, name)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return `var(${name},${literal(value)})`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function emit(
|
|
44
|
+
themes: Readonly<Record<string, Theme.Definition>>,
|
|
45
|
+
schemes = false,
|
|
46
|
+
) {
|
|
47
|
+
const classes: Record<string, string> = Object.create(null)
|
|
48
|
+
const rules: string[] = []
|
|
49
|
+
|
|
50
|
+
for (const [name, theme] of Object.entries(themes)) {
|
|
51
|
+
if (!name) throw new Error('Theme names must be nonempty.')
|
|
52
|
+
|
|
53
|
+
const data =
|
|
54
|
+
theme &&
|
|
55
|
+
(Object.getOwnPropertyDescriptor(theme, Token.definition)?.value as
|
|
56
|
+
| Token.Metadata
|
|
57
|
+
| undefined)
|
|
58
|
+
if (!data) throw new Error('Expected a theme definition.')
|
|
59
|
+
|
|
60
|
+
// Anonymous contracts are graph-local. Source-owned contracts retain stable
|
|
61
|
+
// identities across separately compiled components and theme scopes.
|
|
62
|
+
const className =
|
|
63
|
+
data.contract[Token.identity] === undefined
|
|
64
|
+
? `t_${nextScope++}`
|
|
65
|
+
: `z_theme-${encode(name)}`
|
|
66
|
+
|
|
67
|
+
classes[name] = className
|
|
68
|
+
|
|
69
|
+
let contract = contracts.get(data.contract)
|
|
70
|
+
|
|
71
|
+
if (data.contract[Token.complete]) {
|
|
72
|
+
contract ??= {
|
|
73
|
+
identity: data.contract[Token.identity],
|
|
74
|
+
paths: new Map(),
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Separately compiled components may reference tokens absent from this graph.
|
|
78
|
+
for (const path of Object.keys(data.values)) {
|
|
79
|
+
if (contract.paths.has(path)) continue
|
|
80
|
+
|
|
81
|
+
contract.paths.set(
|
|
82
|
+
path,
|
|
83
|
+
contract.identity === undefined
|
|
84
|
+
? `--z${nextVariable++}`
|
|
85
|
+
: variable(contract.identity, path),
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
contracts.set(data.contract, contract)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!contract) continue
|
|
93
|
+
|
|
94
|
+
const body = [...contract.paths]
|
|
95
|
+
.map(([path, name]) => {
|
|
96
|
+
const value = data.values[path]
|
|
97
|
+
if (value === undefined)
|
|
98
|
+
throw new Error('Theme scope is missing a live token.')
|
|
99
|
+
|
|
100
|
+
return `${name}:${literal(value)};`
|
|
101
|
+
})
|
|
102
|
+
.join('')
|
|
103
|
+
|
|
104
|
+
rules.push(`.${className}{${body}}`)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Scheme rules travel with the module that can apply them, so lowered
|
|
108
|
+
// light-dark() resolves wherever selection helpers load.
|
|
109
|
+
if (schemes) rules.push(Scheme.css)
|
|
110
|
+
|
|
111
|
+
return { classes: Object.freeze(classes), css: rules.join('\n') }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return { emit, serialize }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Escapes a scope key into the identifier segment of its compiled class. */
|
|
118
|
+
export function encode(value: string): string {
|
|
119
|
+
return value.replace(
|
|
120
|
+
/[^a-zA-Z0-9-]/g,
|
|
121
|
+
(character) => `_${character.charCodeAt(0).toString(16)}_`,
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function literal(value: Token.Value): string {
|
|
126
|
+
return typeof value === 'object'
|
|
127
|
+
? `light-dark(${value.light},${value.dark})`
|
|
128
|
+
: String(value)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function variable(index: number | string, path: string): string {
|
|
132
|
+
return `--z-t${encode(String(index))}-${encode(path)}`
|
|
133
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Declares statically named animation frames. @module */
|
|
2
|
+
import type * as Context from './internal/Context.js'
|
|
3
|
+
import type * as Lexical from '../internal/Lexical.js'
|
|
4
|
+
import * as Identity from '../internal/Identity.js'
|
|
5
|
+
import type * as Style from '../Style.js'
|
|
6
|
+
import type * as Value from '../internal/Value.js'
|
|
7
|
+
|
|
8
|
+
/** Compiles ordered frame stops and returns a fixed animation name. */
|
|
9
|
+
export function keyframes<const frames extends Record<string, unknown>>(
|
|
10
|
+
frames: frames &
|
|
11
|
+
NoInfer<{
|
|
12
|
+
[key in keyof frames]: key extends string
|
|
13
|
+
? Stops<Lexical.Fold<Lexical.Normalized<key>>> extends true
|
|
14
|
+
? Value.Accepted<frames[key], Style.DeclarationProperties> &
|
|
15
|
+
Value.Checked<frames[key]>
|
|
16
|
+
: never
|
|
17
|
+
: never
|
|
18
|
+
}>,
|
|
19
|
+
context: Context.Options = {},
|
|
20
|
+
): string {
|
|
21
|
+
void context
|
|
22
|
+
void frames
|
|
23
|
+
return Identity.contribution('keyframes', context.id)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type Space = ' ' | '\t' | '\n' | '\r' | '\f'
|
|
27
|
+
type Trim<value extends string> = value extends `${Space}${infer rest}`
|
|
28
|
+
? Trim<rest>
|
|
29
|
+
: value extends `${infer rest}${Space}`
|
|
30
|
+
? Trim<rest>
|
|
31
|
+
: value
|
|
32
|
+
|
|
33
|
+
type Stops<value extends string> = value extends `${infer first},${infer rest}`
|
|
34
|
+
? Stops<first> extends true
|
|
35
|
+
? Stops<rest>
|
|
36
|
+
: false
|
|
37
|
+
: Trim<value> extends
|
|
38
|
+
| 'from'
|
|
39
|
+
| 'to'
|
|
40
|
+
| `${number}%`
|
|
41
|
+
| `${'contain' | 'cover' | 'entry' | 'entry-crossing' | 'exit' | 'exit-crossing'}${Space}${number}%`
|
|
42
|
+
? true
|
|
43
|
+
: false
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Declares a module-owned CSS namespace. @module */
|
|
2
|
+
/** Emits an isolated namespace binding for the module's selectors. The last declaration for each decoded prefix applies throughout the module. */
|
|
3
|
+
export function namespace<const options extends namespace.Options>(
|
|
4
|
+
options: options &
|
|
5
|
+
Record<Exclude<keyof options, keyof namespace.Options>, never>,
|
|
6
|
+
): void {
|
|
7
|
+
void options
|
|
8
|
+
return
|
|
9
|
+
}
|
|
10
|
+
/** CSS namespace authoring options. */
|
|
11
|
+
export declare namespace namespace {
|
|
12
|
+
/** Namespace URI and optional authored selector prefix. */
|
|
13
|
+
type Options = {
|
|
14
|
+
/** CSS identifier spelling, including Unicode and escapes; omitted creates a default namespace. */
|
|
15
|
+
readonly prefix?: string | undefined
|
|
16
|
+
/** Namespace URI, never an asset to fetch or relocate. */
|
|
17
|
+
readonly uri: string
|
|
18
|
+
}
|
|
19
|
+
}
|