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,283 @@
|
|
|
1
|
+
/** Typed nested selector and condition keys without a general string index. @module */
|
|
2
|
+
import type * as Theme from '../Theme.js'
|
|
3
|
+
|
|
4
|
+
type Case<text extends string> = text extends `${infer first}${infer rest}`
|
|
5
|
+
? `${Lowercase<first> | Uppercase<first>}${Case<rest>}`
|
|
6
|
+
: ''
|
|
7
|
+
|
|
8
|
+
type Media = Case<'all' | 'print' | 'screen'>
|
|
9
|
+
|
|
10
|
+
/** Explicit scoped selectors and standard conditional rule forms. */
|
|
11
|
+
export type Raw =
|
|
12
|
+
| `@${'media' | 'supports' | 'container' | 'scope' | 'layer'}${'\t' | '\n' | '\r' | '\f' | '(' | `/*${string}*/`}${string}`
|
|
13
|
+
| `${string}&${string}`
|
|
14
|
+
| `:${string}`
|
|
15
|
+
| `@document ${string}`
|
|
16
|
+
| '@starting-style'
|
|
17
|
+
| '@scope'
|
|
18
|
+
| '@layer'
|
|
19
|
+
| `@scope (${string}`
|
|
20
|
+
| `@scope to (${string}`
|
|
21
|
+
| `@layer ${string}`
|
|
22
|
+
| `@container scroll-state(${string}`
|
|
23
|
+
| `@container ${string} scroll-state(${string}`
|
|
24
|
+
| `@container not ${string}`
|
|
25
|
+
| `@supports selector(${string}`
|
|
26
|
+
| `@supports ${string}(${string}`
|
|
27
|
+
| `@media (${string}`
|
|
28
|
+
| `@media ${Media}`
|
|
29
|
+
| `@media ${Media} ${string}`
|
|
30
|
+
| `@media ${Media},${string}`
|
|
31
|
+
| `@media ${Case<'only' | 'not'>} ${string}`
|
|
32
|
+
| `@container style(${string}`
|
|
33
|
+
| `@container ${string} style(${string}`
|
|
34
|
+
| `@container (${string}`
|
|
35
|
+
| `@container ${string} (${string}`
|
|
36
|
+
|
|
37
|
+
type Names<tokens, group extends PropertyKey> = group extends keyof tokens
|
|
38
|
+
? `${Extract<keyof NonNullable<tokens[group]>, string | number>}`
|
|
39
|
+
: never
|
|
40
|
+
|
|
41
|
+
type Alias<name extends string> =
|
|
42
|
+
| name
|
|
43
|
+
| `>=${name}`
|
|
44
|
+
| `<${name}`
|
|
45
|
+
| `${name}..${name}`
|
|
46
|
+
|
|
47
|
+
type Containers<tokens> = tokens extends {
|
|
48
|
+
containerNames: readonly (infer name extends string)[]
|
|
49
|
+
}
|
|
50
|
+
? name
|
|
51
|
+
: never
|
|
52
|
+
declare const query: unique symbol
|
|
53
|
+
/** Opaque grouping key emitted by a custom-media declaration. */
|
|
54
|
+
export type Query = symbol & { readonly [query]: true }
|
|
55
|
+
|
|
56
|
+
declare const relationship: unique symbol
|
|
57
|
+
/** Opaque key returned only by typed relationship authoring helpers. */
|
|
58
|
+
export type Relationship = symbol & { readonly [relationship]: true }
|
|
59
|
+
|
|
60
|
+
/** Keys inferred from the bound theme's own threshold groups. */
|
|
61
|
+
export type Keys<
|
|
62
|
+
tokens extends Theme.Tokens = {},
|
|
63
|
+
key extends PropertyKey = never,
|
|
64
|
+
> =
|
|
65
|
+
| ([key] extends [never]
|
|
66
|
+
? never
|
|
67
|
+
: symbol extends key
|
|
68
|
+
? symbol
|
|
69
|
+
: Relationship | Query)
|
|
70
|
+
| Raw
|
|
71
|
+
| `@media ${Alias<Names<tokens, 'breakpoints'>>}`
|
|
72
|
+
| `@container ${Alias<Names<tokens, 'containers'>>}`
|
|
73
|
+
| `@container ${Containers<tokens>} ${Alias<Names<tokens, 'containers'>>}`
|
|
74
|
+
|
|
75
|
+
/** Recognizes structured rule keys before declaration parsing. */
|
|
76
|
+
export function is(key: string): boolean {
|
|
77
|
+
if (key.startsWith('--')) return false
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
nested(key) ||
|
|
81
|
+
key.startsWith(':') ||
|
|
82
|
+
['@starting-style', '@scope', '@layer'].includes(key) ||
|
|
83
|
+
/^@(media|supports|container|scope|layer|document)(?=[\t\n\r\f (]|\/\*)/.test(
|
|
84
|
+
key,
|
|
85
|
+
)
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Detects nesting tokens outside quoted data, comments, and escapes. */
|
|
90
|
+
export function nested(key: string): boolean {
|
|
91
|
+
let quote = ''
|
|
92
|
+
|
|
93
|
+
for (let index = 0; index < key.length; index++) {
|
|
94
|
+
const char = key[index]!
|
|
95
|
+
|
|
96
|
+
if (char === '\\') {
|
|
97
|
+
index++
|
|
98
|
+
continue
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (quote) {
|
|
102
|
+
if (char === quote) quote = ''
|
|
103
|
+
|
|
104
|
+
continue
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (char === '"' || char === "'") {
|
|
108
|
+
quote = char
|
|
109
|
+
continue
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (char === '/' && key[index + 1] === '*') {
|
|
113
|
+
const end = key.indexOf('*/', index + 2)
|
|
114
|
+
if (end === -1) return false
|
|
115
|
+
|
|
116
|
+
index = end + 1
|
|
117
|
+
} else if (char === '&') return true
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return false
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Normalizes rule whitespace and rejects unbalanced delimiters and unscoped selector lists. */
|
|
124
|
+
export function normalize(key: string): string {
|
|
125
|
+
const stack: string[] = []
|
|
126
|
+
let quote = ''
|
|
127
|
+
let output = ''
|
|
128
|
+
let scoped = false
|
|
129
|
+
let list = false
|
|
130
|
+
|
|
131
|
+
for (let index = 0; index < key.length; index++) {
|
|
132
|
+
const char = key[index]!
|
|
133
|
+
|
|
134
|
+
if (!quote && char === '/' && key[index + 1] === '*') {
|
|
135
|
+
const end = key.indexOf('*/', index + 2)
|
|
136
|
+
if (end === -1) throw new Error('Unterminated condition comment.')
|
|
137
|
+
|
|
138
|
+
output += key.slice(index, end + 2).replace(/[\n\r\f]/g, ' ')
|
|
139
|
+
index = end + 1
|
|
140
|
+
continue
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (char === '\\') {
|
|
144
|
+
const next = key[++index]
|
|
145
|
+
if (next === undefined) throw new Error('Incomplete condition escape.')
|
|
146
|
+
|
|
147
|
+
if (next !== '\n' && next !== '\r' && next !== '\f') output += char + next
|
|
148
|
+
else if (next === '\r' && key[index + 1] === '\n') index++
|
|
149
|
+
|
|
150
|
+
continue
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (quote) {
|
|
154
|
+
output += char
|
|
155
|
+
|
|
156
|
+
if (char === quote) quote = ''
|
|
157
|
+
|
|
158
|
+
continue
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (char === '"' || char === "'") quote = char
|
|
162
|
+
else if (char === '(' || char === '[') stack.push(char === '(' ? ')' : ']')
|
|
163
|
+
else if (char === ')' || char === ']') {
|
|
164
|
+
if (stack.pop() !== char)
|
|
165
|
+
throw new Error('Unbalanced condition delimiters.')
|
|
166
|
+
} else if (char === '{' || char === '}')
|
|
167
|
+
throw new Error('Unexpected condition block delimiter.')
|
|
168
|
+
else if (char === '&') scoped = true
|
|
169
|
+
else if (char === ',' && !stack.length && !key.startsWith('@')) {
|
|
170
|
+
if (!scoped)
|
|
171
|
+
throw new Error('Selector lists require explicit & selectors.')
|
|
172
|
+
|
|
173
|
+
scoped = false
|
|
174
|
+
list = true
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
output += /[\n\r\f]/.test(char) ? ' ' : char
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (quote || stack.length) throw new Error('Unbalanced condition delimiters.')
|
|
181
|
+
|
|
182
|
+
if (list && !scoped)
|
|
183
|
+
throw new Error('Selector lists require explicit & selectors.')
|
|
184
|
+
|
|
185
|
+
return output
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** Identifies conservative same-element selectors for private inline callback variables. */
|
|
189
|
+
export function local(key: string): boolean {
|
|
190
|
+
if (key.startsWith('@')) return true
|
|
191
|
+
|
|
192
|
+
let nesting = 0
|
|
193
|
+
let quoted = ''
|
|
194
|
+
|
|
195
|
+
for (let index = 0; index < key.length; index++) {
|
|
196
|
+
const char = key[index]!
|
|
197
|
+
|
|
198
|
+
if (!quoted && char === '/' && key[index + 1] === '*') {
|
|
199
|
+
const end = key.indexOf('*/', index + 2)
|
|
200
|
+
if (end < 0) return false
|
|
201
|
+
|
|
202
|
+
index = end + 1
|
|
203
|
+
continue
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if (char === '\\') {
|
|
207
|
+
index++
|
|
208
|
+
continue
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (quoted) {
|
|
212
|
+
if (char === quoted) quoted = ''
|
|
213
|
+
|
|
214
|
+
continue
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (char === '"' || char === "'") quoted = char
|
|
218
|
+
else if (char === '(' || char === '[') nesting++
|
|
219
|
+
else if (char === ')' || char === ']') nesting--
|
|
220
|
+
else if (char === ',' && !nesting)
|
|
221
|
+
return (
|
|
222
|
+
local(key.slice(0, index).trim()) && local(key.slice(index + 1).trim())
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (!key.startsWith('&') && (!key.startsWith(':') || nested(key)))
|
|
227
|
+
return false
|
|
228
|
+
|
|
229
|
+
let depth = 0
|
|
230
|
+
let quote = ''
|
|
231
|
+
|
|
232
|
+
for (let index = 0; index < key.length; index++) {
|
|
233
|
+
const char = key[index]!
|
|
234
|
+
|
|
235
|
+
if (!quote && char === '/' && key[index + 1] === '*') {
|
|
236
|
+
const end = key.indexOf('*/', index + 2)
|
|
237
|
+
if (end < 0) return false
|
|
238
|
+
|
|
239
|
+
index = end + 1
|
|
240
|
+
continue
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (char === '\\') {
|
|
244
|
+
index++
|
|
245
|
+
continue
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (quote) {
|
|
249
|
+
if (char === quote) quote = ''
|
|
250
|
+
|
|
251
|
+
continue
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (char === '"' || char === "'") {
|
|
255
|
+
quote = char
|
|
256
|
+
continue
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (!depth && char === ':' && key[index + 1] === ':') {
|
|
260
|
+
const name = /^::([a-z-]+)/i.exec(key.slice(index))?.[1]?.toLowerCase()
|
|
261
|
+
if (
|
|
262
|
+
!name ||
|
|
263
|
+
![
|
|
264
|
+
'before',
|
|
265
|
+
'after',
|
|
266
|
+
'first-letter',
|
|
267
|
+
'first-line',
|
|
268
|
+
'marker',
|
|
269
|
+
'placeholder',
|
|
270
|
+
'selection',
|
|
271
|
+
].includes(name)
|
|
272
|
+
)
|
|
273
|
+
return false
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (char === '(' || char === '[') depth++
|
|
277
|
+
else if (char === ')' || char === ']') depth--
|
|
278
|
+
else if (!depth && (/[\s+~>,]/.test(char) || (char === '&' && index !== 0)))
|
|
279
|
+
return false
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return true
|
|
283
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes corner curvature keywords and numeric superellipse functions.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Canonical corner shapes and explicit superellipse curvature. */
|
|
7
|
+
export type Value = (typeof keywords)[number] | `superellipse(${string})`
|
|
8
|
+
|
|
9
|
+
/** Named curvature values from the CSS Borders grammar. */
|
|
10
|
+
export const keywords = [
|
|
11
|
+
'bevel',
|
|
12
|
+
'notch',
|
|
13
|
+
'round',
|
|
14
|
+
'scoop',
|
|
15
|
+
'square',
|
|
16
|
+
'squircle',
|
|
17
|
+
] as const
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/** Models CSS function syntax components and composite alternatives. @module */
|
|
2
|
+
|
|
3
|
+
/** Value types in the CSS Properties and Values syntax-definition grammar. */
|
|
4
|
+
export const primitives = [
|
|
5
|
+
'<angle>',
|
|
6
|
+
'<color>',
|
|
7
|
+
'<custom-ident>',
|
|
8
|
+
'<image>',
|
|
9
|
+
'<integer>',
|
|
10
|
+
'<length>',
|
|
11
|
+
'<length-percentage>',
|
|
12
|
+
'<number>',
|
|
13
|
+
'<percentage>',
|
|
14
|
+
'<resolution>',
|
|
15
|
+
'<string>',
|
|
16
|
+
'<time>',
|
|
17
|
+
'<transform-function>',
|
|
18
|
+
'<transform-list>',
|
|
19
|
+
'<url>',
|
|
20
|
+
] as const
|
|
21
|
+
|
|
22
|
+
/** One primitive syntax component. */
|
|
23
|
+
export type Primitive = (typeof primitives)[number]
|
|
24
|
+
|
|
25
|
+
/** Removes CSS whitespace around signature components. */
|
|
26
|
+
export type Trim<value extends string> =
|
|
27
|
+
value extends `${' ' | '\t' | '\n' | '\r' | '\f'}${infer rest}`
|
|
28
|
+
? Trim<rest>
|
|
29
|
+
: value extends `${infer rest}${' ' | '\t' | '\n' | '\r' | '\f'}`
|
|
30
|
+
? Trim<rest>
|
|
31
|
+
: value
|
|
32
|
+
|
|
33
|
+
/** Removes the type() wrapper without changing authored alternatives. */
|
|
34
|
+
export type Unwrap<value extends string> =
|
|
35
|
+
Trim<value> extends `type(${infer body})` ? Trim<body> : Trim<value>
|
|
36
|
+
|
|
37
|
+
/** Rejects unsupported syntax-definition structure at the authoring boundary. */
|
|
38
|
+
export type Checked<value extends string> = string extends value
|
|
39
|
+
? never
|
|
40
|
+
: Trim<value> extends '*'
|
|
41
|
+
? value
|
|
42
|
+
: Trim<value> extends `type(${infer body})`
|
|
43
|
+
? Trim<body> extends '*'
|
|
44
|
+
? value
|
|
45
|
+
: Valid<Trim<body>> extends true
|
|
46
|
+
? value
|
|
47
|
+
: never
|
|
48
|
+
: Component<Trim<value>> extends true
|
|
49
|
+
? value
|
|
50
|
+
: never
|
|
51
|
+
|
|
52
|
+
type Valid<value extends string> = value extends `${infer first}|${infer rest}`
|
|
53
|
+
? Component<Trim<first>> extends true
|
|
54
|
+
? Valid<Trim<rest>>
|
|
55
|
+
: false
|
|
56
|
+
: Component<value>
|
|
57
|
+
|
|
58
|
+
type Component<value extends string> = value extends `${infer base}${'+' | '#'}`
|
|
59
|
+
? base extends '<transform-list>'
|
|
60
|
+
? false
|
|
61
|
+
: Atom<base>
|
|
62
|
+
: Atom<value>
|
|
63
|
+
|
|
64
|
+
type AsciiOther =
|
|
65
|
+
| ' '
|
|
66
|
+
| '\t'
|
|
67
|
+
| '\n'
|
|
68
|
+
| '\r'
|
|
69
|
+
| '\f'
|
|
70
|
+
| '!'
|
|
71
|
+
| '"'
|
|
72
|
+
| '#'
|
|
73
|
+
| '$'
|
|
74
|
+
| '%'
|
|
75
|
+
| '&'
|
|
76
|
+
| "'"
|
|
77
|
+
| '('
|
|
78
|
+
| ')'
|
|
79
|
+
| '*'
|
|
80
|
+
| '+'
|
|
81
|
+
| ','
|
|
82
|
+
| '.'
|
|
83
|
+
| '/'
|
|
84
|
+
| ':'
|
|
85
|
+
| ';'
|
|
86
|
+
| '<'
|
|
87
|
+
| '='
|
|
88
|
+
| '>'
|
|
89
|
+
| '?'
|
|
90
|
+
| '@'
|
|
91
|
+
| '['
|
|
92
|
+
| '\\'
|
|
93
|
+
| ']'
|
|
94
|
+
| '^'
|
|
95
|
+
| '`'
|
|
96
|
+
| '{'
|
|
97
|
+
| '|'
|
|
98
|
+
| '}'
|
|
99
|
+
| '~'
|
|
100
|
+
type Letter =
|
|
101
|
+
| 'a'
|
|
102
|
+
| 'b'
|
|
103
|
+
| 'c'
|
|
104
|
+
| 'd'
|
|
105
|
+
| 'e'
|
|
106
|
+
| 'f'
|
|
107
|
+
| 'g'
|
|
108
|
+
| 'h'
|
|
109
|
+
| 'i'
|
|
110
|
+
| 'j'
|
|
111
|
+
| 'k'
|
|
112
|
+
| 'l'
|
|
113
|
+
| 'm'
|
|
114
|
+
| 'n'
|
|
115
|
+
| 'o'
|
|
116
|
+
| 'p'
|
|
117
|
+
| 'q'
|
|
118
|
+
| 'r'
|
|
119
|
+
| 's'
|
|
120
|
+
| 't'
|
|
121
|
+
| 'u'
|
|
122
|
+
| 'v'
|
|
123
|
+
| 'w'
|
|
124
|
+
| 'x'
|
|
125
|
+
| 'y'
|
|
126
|
+
| 'z'
|
|
127
|
+
type Tail<value extends string> = value extends ''
|
|
128
|
+
? true
|
|
129
|
+
: value extends `${infer first}${infer rest}`
|
|
130
|
+
? Lowercase<first> extends
|
|
131
|
+
| Letter
|
|
132
|
+
| '_'
|
|
133
|
+
| '-'
|
|
134
|
+
| '0'
|
|
135
|
+
| '1'
|
|
136
|
+
| '2'
|
|
137
|
+
| '3'
|
|
138
|
+
| '4'
|
|
139
|
+
| '5'
|
|
140
|
+
| '6'
|
|
141
|
+
| '7'
|
|
142
|
+
| '8'
|
|
143
|
+
| '9'
|
|
144
|
+
? Tail<rest>
|
|
145
|
+
: first extends AsciiOther
|
|
146
|
+
? false
|
|
147
|
+
: Tail<rest>
|
|
148
|
+
: false
|
|
149
|
+
type Identifier<value extends string> = value extends `--${infer rest}`
|
|
150
|
+
? Tail<rest>
|
|
151
|
+
: value extends `-${infer rest}`
|
|
152
|
+
? Identifier<rest>
|
|
153
|
+
: value extends `${infer first}${infer rest}`
|
|
154
|
+
? Lowercase<first> extends Letter | '_'
|
|
155
|
+
? Tail<rest>
|
|
156
|
+
: first extends AsciiOther | `${number}`
|
|
157
|
+
? false
|
|
158
|
+
: Tail<rest>
|
|
159
|
+
: false
|
|
160
|
+
type Atom<value extends string> = value extends `${string}\\${string}`
|
|
161
|
+
? true
|
|
162
|
+
: value extends Primitive
|
|
163
|
+
? true
|
|
164
|
+
: Lowercase<value> extends
|
|
165
|
+
| 'default'
|
|
166
|
+
| 'inherit'
|
|
167
|
+
| 'initial'
|
|
168
|
+
| 'revert'
|
|
169
|
+
| 'revert-layer'
|
|
170
|
+
| 'unset'
|
|
171
|
+
? false
|
|
172
|
+
: Identifier<value>
|
|
173
|
+
|
|
174
|
+
/** Checks a source-extracted signature without executing application code. */
|
|
175
|
+
export function accepts(value: string): boolean {
|
|
176
|
+
const text = value.trim()
|
|
177
|
+
if (text === '*') return true
|
|
178
|
+
|
|
179
|
+
const wrapped = text.startsWith('type(') && text.endsWith(')')
|
|
180
|
+
const body = wrapped ? text.slice(5, -1).trim() : text
|
|
181
|
+
if (wrapped && body === '*') return true
|
|
182
|
+
if (!wrapped && body.includes('|')) return false
|
|
183
|
+
|
|
184
|
+
const escape = String.raw`\\(?:[0-9a-fA-F]{1,6}[ \t\n\r\f]?|[^\n\r\f0-9a-fA-F])`
|
|
185
|
+
const start = `(?:[_a-zA-Z\\u0080-\\uFFFF]|${escape})`
|
|
186
|
+
const tail = `(?:[-_a-zA-Z0-9\\u0080-\\uFFFF]|${escape})*`
|
|
187
|
+
const component = new RegExp(
|
|
188
|
+
`(?:<[-a-z]+>|(?:--|-${start}|${start})${tail})([+#])?`,
|
|
189
|
+
'y',
|
|
190
|
+
)
|
|
191
|
+
let index = 0
|
|
192
|
+
while (index < body.length) {
|
|
193
|
+
while (/[ \t\n\r\f]/.test(body[index] ?? '') && index < body.length) index++
|
|
194
|
+
component.lastIndex = index
|
|
195
|
+
const match = component.exec(body)
|
|
196
|
+
if (!match) return false
|
|
197
|
+
const atom = match[0].slice(0, match[0].length - (match[1]?.length ?? 0))
|
|
198
|
+
if (atom.startsWith('<')) {
|
|
199
|
+
if (
|
|
200
|
+
!(primitives as readonly string[]).includes(atom) ||
|
|
201
|
+
(atom === '<transform-list>' && match[1])
|
|
202
|
+
)
|
|
203
|
+
return false
|
|
204
|
+
} else {
|
|
205
|
+
const decoded = atom.replace(
|
|
206
|
+
/\\([0-9a-fA-F]{1,6})[ \t\n\r\f]?|\\([^\n\r\f])/g,
|
|
207
|
+
(_, hex: string | undefined, literal: string | undefined) => {
|
|
208
|
+
const point = hex ? Number.parseInt(hex, 16) : 0
|
|
209
|
+
return hex
|
|
210
|
+
? String.fromCodePoint(
|
|
211
|
+
point === 0 ||
|
|
212
|
+
point > 0x10ffff ||
|
|
213
|
+
(point >= 0xd800 && point <= 0xdfff)
|
|
214
|
+
? 0xfffd
|
|
215
|
+
: point,
|
|
216
|
+
)
|
|
217
|
+
: literal!
|
|
218
|
+
},
|
|
219
|
+
)
|
|
220
|
+
if (
|
|
221
|
+
[
|
|
222
|
+
'default',
|
|
223
|
+
'inherit',
|
|
224
|
+
'initial',
|
|
225
|
+
'revert',
|
|
226
|
+
'revert-layer',
|
|
227
|
+
'unset',
|
|
228
|
+
].includes(decoded.replace(/[A-Z]/g, (c) => c.toLowerCase()))
|
|
229
|
+
)
|
|
230
|
+
return false
|
|
231
|
+
}
|
|
232
|
+
index = component.lastIndex
|
|
233
|
+
while (index < body.length && /[ \t\n\r\f]/.test(body[index]!)) index++
|
|
234
|
+
if (index === body.length) return true
|
|
235
|
+
if (!wrapped || body[index++] !== '|') return false
|
|
236
|
+
if (index === body.length) return false
|
|
237
|
+
}
|
|
238
|
+
return false
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Whether numeric arguments are restricted to integer tokens by every alternative. */
|
|
242
|
+
export type IntegerOnly<syntax extends string> =
|
|
243
|
+
'number' extends NumericKind<Unwrap<syntax>>
|
|
244
|
+
? false
|
|
245
|
+
: 'integer' extends NumericKind<Unwrap<syntax>>
|
|
246
|
+
? true
|
|
247
|
+
: false
|
|
248
|
+
|
|
249
|
+
type NumericKind<syntax extends string> =
|
|
250
|
+
syntax extends `${infer first}|${infer rest}`
|
|
251
|
+
? NumericKind<Trim<first>> | NumericKind<Trim<rest>>
|
|
252
|
+
: syntax extends `${infer base}+` | `${infer base}#`
|
|
253
|
+
? NumericKind<base>
|
|
254
|
+
: syntax extends '<number>'
|
|
255
|
+
? 'number'
|
|
256
|
+
: syntax extends '<integer>'
|
|
257
|
+
? 'integer'
|
|
258
|
+
: never
|
|
259
|
+
|
|
260
|
+
/** Finds the integer-only scalar domain in a checked function signature. */
|
|
261
|
+
export function integerOnly(syntax: string): boolean {
|
|
262
|
+
const value = syntax.trim()
|
|
263
|
+
const body = value.startsWith('type(') ? value.slice(5, -1) : value
|
|
264
|
+
const alternatives = body
|
|
265
|
+
.split('|')
|
|
266
|
+
.map((value) => value.trim().replace(/[+#]$/, ''))
|
|
267
|
+
|
|
268
|
+
return (
|
|
269
|
+
alternatives.includes('<integer>') && !alternatives.includes('<number>')
|
|
270
|
+
)
|
|
271
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/** Carries native CSS function result domains through static declaration checking. @module */
|
|
2
|
+
import type * as FunctionSyntax from './FunctionSyntax.js'
|
|
3
|
+
import type * as Literal from './Literal.js'
|
|
4
|
+
|
|
5
|
+
declare const result: unique symbol
|
|
6
|
+
/** A native function expression with a declared CSS value syntax. */
|
|
7
|
+
export type Reference<syntax extends string = '*'> =
|
|
8
|
+
`--${string}(${string})` & { readonly [result]: syntax }
|
|
9
|
+
/** Detects a function result without expanding ordinary property grammars. */
|
|
10
|
+
export type Is<value> = typeof result extends keyof value ? true : false
|
|
11
|
+
/** Accepts results only when their value domain and repetition fit the destination. */
|
|
12
|
+
export type Accepted<value, property, name> =
|
|
13
|
+
value extends Reference<infer syntax>
|
|
14
|
+
? Repeated<FunctionSyntax.Unwrap<syntax>, name> extends false
|
|
15
|
+
? never
|
|
16
|
+
: FunctionSyntax.Unwrap<syntax> extends '*'
|
|
17
|
+
? value
|
|
18
|
+
: [Representative<FunctionSyntax.Unwrap<syntax>>] extends [never]
|
|
19
|
+
? never
|
|
20
|
+
: Representative<FunctionSyntax.Unwrap<syntax>> extends property
|
|
21
|
+
? value
|
|
22
|
+
: never
|
|
23
|
+
: never
|
|
24
|
+
|
|
25
|
+
type Repetition<syntax> = syntax extends `${infer first}|${infer rest}`
|
|
26
|
+
?
|
|
27
|
+
| Repetition<FunctionSyntax.Trim<first>>
|
|
28
|
+
| Repetition<FunctionSyntax.Trim<rest>>
|
|
29
|
+
: syntax extends `${string}+`
|
|
30
|
+
? '+'
|
|
31
|
+
: syntax extends `${string}#`
|
|
32
|
+
? '#'
|
|
33
|
+
: never
|
|
34
|
+
|
|
35
|
+
// Finite shorthand domains may have broad textual tails; only explicit list metadata proves repetition.
|
|
36
|
+
type Repeated<syntax, name> = [Repetition<syntax>] extends [never]
|
|
37
|
+
? true
|
|
38
|
+
: name extends `--${string}`
|
|
39
|
+
? true
|
|
40
|
+
: name extends keyof typeof Literal.rules
|
|
41
|
+
? [Repetition<syntax>] extends ['#']
|
|
42
|
+
? (typeof Literal.rules)[name] extends { list: true }
|
|
43
|
+
? true
|
|
44
|
+
: false
|
|
45
|
+
: name extends 'transform'
|
|
46
|
+
? syntax extends '<transform-function>+'
|
|
47
|
+
? true
|
|
48
|
+
: false
|
|
49
|
+
: false
|
|
50
|
+
: false
|
|
51
|
+
|
|
52
|
+
type Representative<syntax> = syntax extends `${infer first}|${infer rest}`
|
|
53
|
+
?
|
|
54
|
+
| Representative<FunctionSyntax.Trim<first>>
|
|
55
|
+
| Representative<FunctionSyntax.Trim<rest>>
|
|
56
|
+
: syntax extends `${infer base}+`
|
|
57
|
+
?
|
|
58
|
+
| Representative<base>
|
|
59
|
+
| `${Extract<Representative<base>, string | number>} ${string}`
|
|
60
|
+
: syntax extends `${infer base}#`
|
|
61
|
+
?
|
|
62
|
+
| Representative<base>
|
|
63
|
+
| `${Extract<Representative<base>, string | number>},${string}`
|
|
64
|
+
: syntax extends '<color>'
|
|
65
|
+
? '#000'
|
|
66
|
+
: syntax extends '<length>'
|
|
67
|
+
? '1px'
|
|
68
|
+
: syntax extends '<length-percentage>'
|
|
69
|
+
? '1px' | '1%'
|
|
70
|
+
: syntax extends '<number>'
|
|
71
|
+
? number
|
|
72
|
+
: syntax extends '<integer>'
|
|
73
|
+
? 1
|
|
74
|
+
: syntax extends '<percentage>'
|
|
75
|
+
? '1%'
|
|
76
|
+
: syntax extends '<angle>'
|
|
77
|
+
? '1deg'
|
|
78
|
+
: syntax extends '<time>'
|
|
79
|
+
? '1s'
|
|
80
|
+
: syntax extends '<resolution>'
|
|
81
|
+
? '1dppx'
|
|
82
|
+
: syntax extends '<image>'
|
|
83
|
+
? 'url(/image.svg)' | 'linear-gradient(red, blue)'
|
|
84
|
+
: syntax extends '<url>'
|
|
85
|
+
? 'url(/image.svg)'
|
|
86
|
+
: syntax extends '<string>'
|
|
87
|
+
? '"text"'
|
|
88
|
+
: syntax extends '<custom-ident>'
|
|
89
|
+
? string
|
|
90
|
+
: syntax extends
|
|
91
|
+
| '<transform-function>'
|
|
92
|
+
| '<transform-list>'
|
|
93
|
+
? 'translateX(1px)'
|
|
94
|
+
: syntax extends `<${string}>`
|
|
95
|
+
? never
|
|
96
|
+
: syntax
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Describes CSS geometric value types. @module */
|
|
2
|
+
/** Canonical CSS angle shapes. */
|
|
3
|
+
export type Angle = `${number}${'deg' | 'grad' | 'rad' | 'turn'}`
|
|
4
|
+
|
|
5
|
+
/** Transform functions available to typed authoring. */
|
|
6
|
+
export type FunctionName =
|
|
7
|
+
| 'matrix'
|
|
8
|
+
| 'matrix3d'
|
|
9
|
+
| 'perspective'
|
|
10
|
+
| 'rotate'
|
|
11
|
+
| 'rotate3d'
|
|
12
|
+
| 'rotateX'
|
|
13
|
+
| 'rotateY'
|
|
14
|
+
| 'rotateZ'
|
|
15
|
+
| 'scale'
|
|
16
|
+
| 'scale3d'
|
|
17
|
+
| 'scaleX'
|
|
18
|
+
| 'scaleY'
|
|
19
|
+
| 'scaleZ'
|
|
20
|
+
| 'skew'
|
|
21
|
+
| 'skewX'
|
|
22
|
+
| 'skewY'
|
|
23
|
+
| 'translate'
|
|
24
|
+
| 'translate3d'
|
|
25
|
+
| 'translateX'
|
|
26
|
+
| 'translateY'
|
|
27
|
+
| 'translateZ'
|
|
28
|
+
|
|
29
|
+
/** Geometric property domain. */
|
|
30
|
+
export type Kind = 'ratio' | 'rotate' | 'scale' | 'transform' | 'translate'
|