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,155 @@
|
|
|
1
|
+
/** Serializes root appearance restoration and controls the live root selection from compiled scope names. @module */
|
|
2
|
+
import * as Scheme from '../internal/Scheme.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Binds an HTML-safe script factory to compiled named theme classes.
|
|
6
|
+
* The factory is server-safe; only its returned JavaScript accesses the DOM.
|
|
7
|
+
* A saved scheme swaps the stylesheet scheme class and sets the inline `color-scheme`;
|
|
8
|
+
* a saved `null` scheme removes both so a cleared selection survives reloads.
|
|
9
|
+
* @param entries - Catalog names paired with compiled scope classes.
|
|
10
|
+
* @param options - Storage key shared with the configuration's root controls.
|
|
11
|
+
* @returns A pure script factory that never reads or writes browser state itself.
|
|
12
|
+
*/
|
|
13
|
+
export function create(
|
|
14
|
+
entries: readonly (readonly [string, string])[],
|
|
15
|
+
options: create.Options = {},
|
|
16
|
+
): () => string {
|
|
17
|
+
return () => {
|
|
18
|
+
const catalog = serialize(entries)
|
|
19
|
+
const key = serialize(options.storageKey ?? 'zyzz')
|
|
20
|
+
const schemes = serialize(Object.entries(Scheme.classes))
|
|
21
|
+
|
|
22
|
+
return `(()=>{try{const value=JSON.parse(localStorage.getItem(${key})||"null");if(!value||typeof value!=="object"||Array.isArray(value))return;const root=document.documentElement;const catalog=new Map(${catalog});if(Object.hasOwn(value,"theme")&&typeof value.theme==="string"&&catalog.has(value.theme)){root.classList.remove(...catalog.values());root.classList.add(catalog.get(value.theme))}const schemes=new Map(${schemes});if(Object.hasOwn(value,"colorScheme")){if(value.colorScheme===null){root.classList.remove(...schemes.values());root.style.removeProperty("color-scheme")}else if(schemes.has(value.colorScheme)){root.classList.remove(...schemes.values());root.classList.add(schemes.get(value.colorScheme));root.style.colorScheme=value.colorScheme}}}catch{}})();`
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Script factory settings. */
|
|
27
|
+
export declare namespace create {
|
|
28
|
+
/** Configuration-level initialization settings. */
|
|
29
|
+
type Options = {
|
|
30
|
+
/** localStorage key shared with root controls; defaults to zyzz. */
|
|
31
|
+
readonly storageKey?: string | undefined
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Binds root selection controls to compiled named theme classes.
|
|
37
|
+
* Creation touches no browser state; `get` and `set` read and write
|
|
38
|
+
* `document.documentElement` and the record the initialization script restores.
|
|
39
|
+
* @param entries - Catalog names paired with compiled scope classes.
|
|
40
|
+
* @param options - Default theme reported without a root class and the storage key.
|
|
41
|
+
* @returns Controls reading the applied root selection and applying saved changes.
|
|
42
|
+
* @throws {TypeError} If a named catalog receives no default or one outside its entries.
|
|
43
|
+
*/
|
|
44
|
+
export function root<const name extends string>(
|
|
45
|
+
entries: readonly (readonly [name, string])[],
|
|
46
|
+
options: root.Options<name> = {},
|
|
47
|
+
): Root<name> {
|
|
48
|
+
const catalog = new Map<string, string>(entries)
|
|
49
|
+
const key = options.storageKey ?? 'zyzz'
|
|
50
|
+
const schemes = Object.entries(Scheme.classes) as [Scheme.Name, string][]
|
|
51
|
+
|
|
52
|
+
// Named catalogs always report a theme, so the fallback must be one of them.
|
|
53
|
+
if (
|
|
54
|
+
catalog.size &&
|
|
55
|
+
(options.defaultTheme === undefined || !catalog.has(options.defaultTheme))
|
|
56
|
+
)
|
|
57
|
+
throw new TypeError('defaultTheme must name a catalog theme.')
|
|
58
|
+
|
|
59
|
+
function get(): Selection<name> {
|
|
60
|
+
const classes = document.documentElement.classList
|
|
61
|
+
const theme =
|
|
62
|
+
[...catalog].find(([, className]) => classes.contains(className))?.[0] ??
|
|
63
|
+
options.defaultTheme
|
|
64
|
+
const colorScheme = schemes.find(([, className]) =>
|
|
65
|
+
classes.contains(className),
|
|
66
|
+
)?.[0]
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
...(theme === undefined ? {} : { theme }),
|
|
70
|
+
...(colorScheme === undefined ? {} : { colorScheme }),
|
|
71
|
+
} as Selection<name>
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function set(selection: Partial<Selection<name>>) {
|
|
75
|
+
const element = document.documentElement
|
|
76
|
+
const next = { ...get(), ...selection } as {
|
|
77
|
+
colorScheme?: Scheme.Name | undefined
|
|
78
|
+
theme?: string | undefined
|
|
79
|
+
}
|
|
80
|
+
const scopeClass =
|
|
81
|
+
next.theme === undefined ? undefined : catalog.get(next.theme)
|
|
82
|
+
|
|
83
|
+
// Rejected input leaves the document and the saved record untouched.
|
|
84
|
+
if (next.theme !== undefined && scopeClass === undefined)
|
|
85
|
+
throw new TypeError('Invalid theme selection.')
|
|
86
|
+
|
|
87
|
+
if (
|
|
88
|
+
next.colorScheme !== undefined &&
|
|
89
|
+
!Object.hasOwn(Scheme.classes, next.colorScheme)
|
|
90
|
+
)
|
|
91
|
+
throw new TypeError('Invalid theme selection.')
|
|
92
|
+
|
|
93
|
+
element.classList.remove(
|
|
94
|
+
...catalog.values(),
|
|
95
|
+
...schemes.map(([, className]) => className),
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
if (scopeClass !== undefined) element.classList.add(scopeClass)
|
|
99
|
+
|
|
100
|
+
if (next.colorScheme !== undefined) {
|
|
101
|
+
element.classList.add(Scheme.classes[next.colorScheme])
|
|
102
|
+
element.style.colorScheme = next.colorScheme
|
|
103
|
+
} else element.style.removeProperty('color-scheme')
|
|
104
|
+
|
|
105
|
+
// The record mirrors the applied root, so a cleared scheme saves as null
|
|
106
|
+
// and the script removes a server-rendered scheme on the next load.
|
|
107
|
+
const record = {
|
|
108
|
+
...(next.theme === undefined ? {} : { theme: next.theme }),
|
|
109
|
+
colorScheme: next.colorScheme ?? null,
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
localStorage.setItem(key, JSON.stringify(record))
|
|
114
|
+
} catch {
|
|
115
|
+
// Blocked storage keeps the selection for this document only.
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return { get, set }
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Root control contracts. */
|
|
123
|
+
export declare namespace root {
|
|
124
|
+
/** Catalog defaults and storage settings. */
|
|
125
|
+
type Options<name extends string = string> = {
|
|
126
|
+
/** Theme reported by `get` when the root carries no catalog class; required with a named catalog. */
|
|
127
|
+
readonly defaultTheme?: NoInfer<name> | undefined
|
|
128
|
+
/** localStorage key shared with the initialization script; defaults to zyzz. */
|
|
129
|
+
readonly storageKey?: string | undefined
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Live root selection controls. */
|
|
134
|
+
export type Root<name extends string> = {
|
|
135
|
+
/** Reads the theme and scheme classes the root carries. */
|
|
136
|
+
readonly get: () => Selection<name>
|
|
137
|
+
/** Applies fields over the current selection and saves the result. */
|
|
138
|
+
readonly set: (selection: Partial<Selection<name>>) => void
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** A catalog theme with an optional scheme; an omitted scheme inherits. Token-free and single-theme configurations select only a scheme. */
|
|
142
|
+
export type Selection<name extends string> = [name] extends [never]
|
|
143
|
+
? { readonly colorScheme?: Scheme.Name | undefined }
|
|
144
|
+
: {
|
|
145
|
+
readonly colorScheme?: Scheme.Name | undefined
|
|
146
|
+
readonly theme: name
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function serialize(value: unknown): string {
|
|
150
|
+
return JSON.stringify(value).replace(
|
|
151
|
+
/[<>&\u2028\u2029]/g,
|
|
152
|
+
(character) =>
|
|
153
|
+
`\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`,
|
|
154
|
+
)
|
|
155
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Merges bindings and attributes over a compiler-resolved ordered CSS group. @module */
|
|
2
|
+
import type { style } from '../styleFunction.js'
|
|
3
|
+
|
|
4
|
+
/** Private ownership retained in generated initialization data, never DOM props. */
|
|
5
|
+
export type Owner = {
|
|
6
|
+
/** Recipe attributes replaced together for repeated applications. */
|
|
7
|
+
readonly attributes: readonly string[]
|
|
8
|
+
/** Stable authoring definition identity. */
|
|
9
|
+
readonly identity: string
|
|
10
|
+
/** Private callback slots replaced together for repeated applications. */
|
|
11
|
+
readonly slots: readonly string[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Binds a fixed composition class to runtime styling inputs without generating rules. */
|
|
15
|
+
type Entry =
|
|
16
|
+
| (style.Props & { readonly [key: `data-${string}`]: string | undefined })
|
|
17
|
+
| false
|
|
18
|
+
| null
|
|
19
|
+
| undefined
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Binds compiled classes and ownership metadata to a props-merging callable.
|
|
23
|
+
* @param options - Fixed classes, conditional cases, and ordered input owners.
|
|
24
|
+
* @returns A callable that merges application props without mutating its inputs.
|
|
25
|
+
* Initialization allocates class lookup sets; calls allocate fresh props and emit no CSS.
|
|
26
|
+
*/
|
|
27
|
+
export function create(options: create.Options) {
|
|
28
|
+
const inputs = options.inputs.map((input) => ({
|
|
29
|
+
...input,
|
|
30
|
+
classes: new Set(input.className.split(/\s+/).filter(Boolean)),
|
|
31
|
+
}))
|
|
32
|
+
|
|
33
|
+
return (...entries: readonly Entry[]) => {
|
|
34
|
+
let mask = 0
|
|
35
|
+
for (const [index, input] of inputs.entries())
|
|
36
|
+
if (input.condition !== undefined && entries[index])
|
|
37
|
+
mask |= 1 << input.condition
|
|
38
|
+
const className = options.cases?.[mask] ?? options.className
|
|
39
|
+
const result: style.Props & Record<string, unknown> = {
|
|
40
|
+
className,
|
|
41
|
+
}
|
|
42
|
+
const external: string[] = []
|
|
43
|
+
const style: Record<string, string | number | undefined> = {}
|
|
44
|
+
for (const [index, entry] of entries.entries()) {
|
|
45
|
+
if (!entry) continue
|
|
46
|
+
const input = inputs[index]!
|
|
47
|
+
for (const owner of input.owners) {
|
|
48
|
+
for (const attribute of owner.attributes) delete result[attribute]
|
|
49
|
+
for (const slot of owner.slots) delete style[slot]
|
|
50
|
+
}
|
|
51
|
+
for (const name of entry.className.split(/\s+/))
|
|
52
|
+
if (name && !input.classes.has(name)) external.push(name)
|
|
53
|
+
for (const [name, value] of Object.entries(entry))
|
|
54
|
+
if (name.startsWith('data-')) result[name] = value
|
|
55
|
+
for (const [name, value] of Object.entries(entry.style ?? {})) {
|
|
56
|
+
// Reinsert overwritten keys so inline shorthand/longhand ordering follows arguments.
|
|
57
|
+
delete style[name]
|
|
58
|
+
style[name] = value
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
...result,
|
|
63
|
+
className: [className, ...external].filter(Boolean).join(' '),
|
|
64
|
+
...(Object.keys(style).length ? { style } : {}),
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Fixed composition initialization inputs. */
|
|
70
|
+
export declare namespace create {
|
|
71
|
+
/** Compiler-selected rules and ownership for each application. */
|
|
72
|
+
type Options = {
|
|
73
|
+
/** Optional precompiled class lists indexed by argument-presence mask. */
|
|
74
|
+
readonly cases?: readonly string[] | undefined
|
|
75
|
+
/** Complete precompiled composition class list. */
|
|
76
|
+
readonly className: string
|
|
77
|
+
/** Ordered application class lists and private ownership. */
|
|
78
|
+
readonly inputs: readonly {
|
|
79
|
+
/** Generated classes superseded by the composition class. */
|
|
80
|
+
readonly className: string
|
|
81
|
+
/** Presence bit assigned to a conditional argument. */
|
|
82
|
+
readonly condition?: number | undefined
|
|
83
|
+
/** Original definitions whose bindings and attributes this application owns. */
|
|
84
|
+
readonly owners: readonly Owner[]
|
|
85
|
+
}[]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Retains canonical inputs only for HTML applications used by compiled composition. @module */
|
|
2
|
+
import type { style } from '../styleFunction.js'
|
|
3
|
+
import * as Composition from './Composition.js'
|
|
4
|
+
import * as Html from './Html.js'
|
|
5
|
+
|
|
6
|
+
// A package may have distinct runtime copies in dependency optimization or SSR.
|
|
7
|
+
// This versioned protocol key preserves canonical props across those module graphs.
|
|
8
|
+
const input = Symbol.for('zyzz.composition.input.v1')
|
|
9
|
+
type Props = style.Props & {
|
|
10
|
+
readonly [name: `data-${string}`]: string | undefined
|
|
11
|
+
}
|
|
12
|
+
type Prepared = Html.Attributes & { readonly [input]: Props }
|
|
13
|
+
|
|
14
|
+
/** Binds a generated React-shaped callable to composable HTML attributes. */
|
|
15
|
+
export function bind<const args extends readonly unknown[]>(
|
|
16
|
+
fn: (...args: args) => Props | Html.Attributes,
|
|
17
|
+
) {
|
|
18
|
+
// Generated callers bind the underlying callable with HTML output disabled.
|
|
19
|
+
return (...args: args) => from(fn(...args) as Props)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Merges canonical props and serializes HTML once, without parsing style strings. */
|
|
23
|
+
export function create(options: Composition.create.Options) {
|
|
24
|
+
const compose = Composition.create(options)
|
|
25
|
+
return (
|
|
26
|
+
...entries: readonly (Html.Attributes | false | null | undefined)[]
|
|
27
|
+
) =>
|
|
28
|
+
from(
|
|
29
|
+
compose(
|
|
30
|
+
...entries.map((entry) => (entry ? (entry as Prepared)[input] : entry)),
|
|
31
|
+
),
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Converts props while retaining nonenumerable inputs for a surrounding composition. */
|
|
36
|
+
export function from(props: Props): Html.Attributes {
|
|
37
|
+
return Object.defineProperty(Html.from(props), input, { value: props })
|
|
38
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/** Serializes conditional recipe instructions without evaluating queries. @module */
|
|
2
|
+
import type { style } from '../styleFunction.js'
|
|
3
|
+
import * as Html from './Html.js'
|
|
4
|
+
import * as Recipe from './Recipe.js'
|
|
5
|
+
|
|
6
|
+
/** Shared compiler/runtime spelling for a conditional selection attribute. */
|
|
7
|
+
export function attribute(options: attribute.Options): `data-${string}` {
|
|
8
|
+
return `data-zyzz-condition-${options.condition}-${options.axis}`
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Conditional attribute identity. */
|
|
12
|
+
export declare namespace attribute {
|
|
13
|
+
/** Statically assigned axis and condition index. */
|
|
14
|
+
type Options = {
|
|
15
|
+
/** Declared axis name. */
|
|
16
|
+
readonly axis: string
|
|
17
|
+
/** Index in authored condition order. */
|
|
18
|
+
readonly condition: number
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Binds conditional instructions while leaving query evaluation entirely to CSS. */
|
|
23
|
+
export function create(options: create.Options) {
|
|
24
|
+
const base = Recipe.create({ ...options, html: false })
|
|
25
|
+
const conditions = options.conditions.map((name, condition) => ({
|
|
26
|
+
name,
|
|
27
|
+
axes: Object.keys(options.axes).map((axis) => ({
|
|
28
|
+
axis,
|
|
29
|
+
attribute: attribute({ axis, condition }),
|
|
30
|
+
})),
|
|
31
|
+
}))
|
|
32
|
+
|
|
33
|
+
return (input: Record<string, unknown> & style.Options = {}) => {
|
|
34
|
+
// The base was explicitly bound to React-shaped props above; HTML
|
|
35
|
+
// serialization occurs once, after all conditional attributes are added.
|
|
36
|
+
const result = base(input) as style.Props & Record<`data-${string}`, string>
|
|
37
|
+
const selected = input.conditions as
|
|
38
|
+
| Record<
|
|
39
|
+
string,
|
|
40
|
+
Record<string, string | boolean | null | undefined> | undefined
|
|
41
|
+
>
|
|
42
|
+
| undefined
|
|
43
|
+
for (const condition of conditions) {
|
|
44
|
+
const selections =
|
|
45
|
+
selected && Object.hasOwn(selected, condition.name)
|
|
46
|
+
? selected[condition.name]
|
|
47
|
+
: undefined
|
|
48
|
+
if (!selections) continue
|
|
49
|
+
|
|
50
|
+
for (const { axis, attribute } of condition.axes) {
|
|
51
|
+
const value = Object.hasOwn(selections, axis)
|
|
52
|
+
? selections[axis]
|
|
53
|
+
: undefined
|
|
54
|
+
if (value !== undefined)
|
|
55
|
+
result[attribute] = value === null ? 'n' : `s${value}`
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return options.html ? Html.from(result) : result
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Conditional recipe initialization inputs. */
|
|
64
|
+
export declare namespace create {
|
|
65
|
+
/** Static recipe metadata with a declared condition order. */
|
|
66
|
+
type Options = Recipe.create.Options & {
|
|
67
|
+
/** Names whose overrides are serialized by the returned callable. */
|
|
68
|
+
readonly conditions: readonly string[]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** Assigns fixed private variables for compiled dynamic styles. @module */
|
|
2
|
+
import type { style } from '../styleFunction.js'
|
|
3
|
+
|
|
4
|
+
/** Binds required runtime scalars to fixed private variables and merges styling overrides. */
|
|
5
|
+
export function create(
|
|
6
|
+
options: create.Options,
|
|
7
|
+
): style.Dynamic<Record<string, string | number>> {
|
|
8
|
+
const { className } = options
|
|
9
|
+
const slots = Object.entries(options.slots)
|
|
10
|
+
|
|
11
|
+
return ((input: Record<string, string | number> & style.Options) => {
|
|
12
|
+
const values = slots.map(([key]) => {
|
|
13
|
+
const value = input[key]!
|
|
14
|
+
|
|
15
|
+
return value === '' ? ' ' : value
|
|
16
|
+
})
|
|
17
|
+
const external = input.className
|
|
18
|
+
const style = { ...input.variables, ...input.style }
|
|
19
|
+
|
|
20
|
+
for (let index = 0; index < slots.length; index++)
|
|
21
|
+
style[slots[index]![1].name] = values[index]!
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
className:
|
|
25
|
+
className && external
|
|
26
|
+
? `${className} ${external}`
|
|
27
|
+
: external || className,
|
|
28
|
+
style,
|
|
29
|
+
}
|
|
30
|
+
}) as style.Dynamic<Record<string, string | number>>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Contracts for compiler-generated dynamic callables. */
|
|
34
|
+
export declare namespace create {
|
|
35
|
+
/** Fixed class and private slot assignments supplied by compilation. */
|
|
36
|
+
type Options = {
|
|
37
|
+
/** Complete generated class list. */
|
|
38
|
+
readonly className: string
|
|
39
|
+
/** Required scalar slots keyed by input name. */
|
|
40
|
+
readonly slots: Readonly<
|
|
41
|
+
Record<
|
|
42
|
+
string,
|
|
43
|
+
{
|
|
44
|
+
readonly name: `--${string}`
|
|
45
|
+
readonly type: string
|
|
46
|
+
readonly zero?: boolean
|
|
47
|
+
}
|
|
48
|
+
>
|
|
49
|
+
>
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** Converts compiled styling props to DOM attributes and HTML text. @module */
|
|
2
|
+
import type { style } from '../styleFunction.js'
|
|
3
|
+
import * as Props from './Props.js'
|
|
4
|
+
|
|
5
|
+
/** DOM attributes ready for a framework spread or setAttribute. */
|
|
6
|
+
export type Attributes = {
|
|
7
|
+
/** Compiled and external classes. */
|
|
8
|
+
readonly class: string
|
|
9
|
+
/** Serialized CSS declarations; renderers own HTML escaping. */
|
|
10
|
+
readonly style?: string | undefined
|
|
11
|
+
} & { readonly [name: `data-${string}`]: string | undefined }
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Converts compiled styling props without generating CSS rules or mutating inputs.
|
|
15
|
+
* Values retain explicit CSS units. Custom properties retain their spelling.
|
|
16
|
+
* @param props - Applied style or theme props, including owned data attributes.
|
|
17
|
+
* @returns Unescaped DOM attribute values; never insert them into HTML directly.
|
|
18
|
+
*/
|
|
19
|
+
export function from(
|
|
20
|
+
props: style.Props & {
|
|
21
|
+
readonly [name: `data-${string}`]: string | undefined
|
|
22
|
+
},
|
|
23
|
+
): Attributes {
|
|
24
|
+
const result: {
|
|
25
|
+
class: string
|
|
26
|
+
style?: string
|
|
27
|
+
[name: `data-${string}`]: string | undefined
|
|
28
|
+
} = { class: props.className }
|
|
29
|
+
|
|
30
|
+
if (props.style !== undefined) {
|
|
31
|
+
const declarations: string[] = []
|
|
32
|
+
|
|
33
|
+
for (const [property, value] of Object.entries(props.style)) {
|
|
34
|
+
if (value === undefined || value === null) continue
|
|
35
|
+
|
|
36
|
+
const name = property.startsWith('--')
|
|
37
|
+
? property
|
|
38
|
+
: property
|
|
39
|
+
.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)
|
|
40
|
+
.replace(/^ms-/, '-ms-')
|
|
41
|
+
|
|
42
|
+
declarations.push(`${name}:${value}`)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
result.style = declarations.join(';')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
for (const [name, value] of Object.entries(props))
|
|
49
|
+
if (name.startsWith('data-'))
|
|
50
|
+
result[name as `data-${string}`] = value as string | undefined
|
|
51
|
+
|
|
52
|
+
return result
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Serializes styling attributes for insertion inside an HTML opening tag.
|
|
57
|
+
* @param attributes - DOM attributes returned by from.
|
|
58
|
+
* @returns Space-separated attributes with quoted, HTML-escaped values.
|
|
59
|
+
*/
|
|
60
|
+
export function serialize(attributes: Attributes): string {
|
|
61
|
+
return Object.entries(attributes)
|
|
62
|
+
.filter(([, value]) => value !== undefined)
|
|
63
|
+
.map(([name, value]) => `${escape(name)}="${escape(value!)}"`)
|
|
64
|
+
.join(' ')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function escape(value: string): string {
|
|
68
|
+
return value.replace(/[&<>"'\s]/g, (character) => {
|
|
69
|
+
if (character === '&') return '&'
|
|
70
|
+
if (character === '<') return '<'
|
|
71
|
+
if (character === '>') return '>'
|
|
72
|
+
if (character === '"') return '"'
|
|
73
|
+
if (character === "'") return '''
|
|
74
|
+
|
|
75
|
+
return `&#${character.charCodeAt(0)};`
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Binds compiler-generated props to native HTML attributes. */
|
|
80
|
+
export function bind<input>(
|
|
81
|
+
fn: (input: input) => style.Props,
|
|
82
|
+
): (input: input) => style.Props<'html'> {
|
|
83
|
+
return (input) => from(fn(input))
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Creates a static HTML style callable without CSS generation. */
|
|
87
|
+
export function create(
|
|
88
|
+
options: Props.create.Options,
|
|
89
|
+
): style.ReturnType<'html'> {
|
|
90
|
+
return bind(Props.create(options)) as style.ReturnType<'html'>
|
|
91
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/** Selects precompiled native props and composes caller-owned native style values. @module */
|
|
2
|
+
import type * as StyleSheet from '../react-native/StyleSheet.js'
|
|
3
|
+
|
|
4
|
+
type Choices<values extends readonly string[]> =
|
|
5
|
+
values[number] extends infer value
|
|
6
|
+
? value extends 'true'
|
|
7
|
+
? true
|
|
8
|
+
: value extends 'false'
|
|
9
|
+
? false
|
|
10
|
+
: value
|
|
11
|
+
: never
|
|
12
|
+
|
|
13
|
+
/** Inferred finite inputs for a generated native recipe callable. */
|
|
14
|
+
export type Callable<
|
|
15
|
+
axes extends Readonly<Record<string, readonly string[]>>,
|
|
16
|
+
style extends object = StyleSheet.NativeStyle,
|
|
17
|
+
> = <const overrides extends object = never>(
|
|
18
|
+
input?: {
|
|
19
|
+
readonly [axis in keyof axes]?: Choices<axes[axis]> | null | undefined
|
|
20
|
+
} & {
|
|
21
|
+
/** Caller-owned native overrides, applied after the selected table entry. */
|
|
22
|
+
readonly style?: StyleSheet.StyleProp<overrides> | undefined
|
|
23
|
+
},
|
|
24
|
+
) => Props<style | overrides>
|
|
25
|
+
|
|
26
|
+
type EntryStyle<entry> = entry extends Props<infer style> ? style : never
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Combines applied native props in order without flattening caller-owned values.
|
|
30
|
+
* @param entries - Applied props or falsy conditional entries.
|
|
31
|
+
* @returns Native style props preserving nested arrays and object identity.
|
|
32
|
+
*/
|
|
33
|
+
export function compose<
|
|
34
|
+
const entries extends readonly (Props<object> | false | null | undefined)[],
|
|
35
|
+
>(...entries: entries): Props<EntryStyle<entries[number]>> {
|
|
36
|
+
for (const entry of entries)
|
|
37
|
+
if (
|
|
38
|
+
entry &&
|
|
39
|
+
(!Object.hasOwn(entry, 'style') ||
|
|
40
|
+
Object.keys(entry).some((key) => key !== 'style'))
|
|
41
|
+
)
|
|
42
|
+
throw new SelectionError(
|
|
43
|
+
'Native composition requires native style props.',
|
|
44
|
+
)
|
|
45
|
+
const styles = entries
|
|
46
|
+
.filter(
|
|
47
|
+
(entry): entry is Extract<entries[number], Props<object>> => !!entry,
|
|
48
|
+
)
|
|
49
|
+
.map((entry) => entry.style)
|
|
50
|
+
return { style: styles.length === 1 ? styles[0] : styles } as Props<
|
|
51
|
+
EntryStyle<entries[number]>
|
|
52
|
+
>
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Binds a finite native table to defaults and optional styling overrides.
|
|
57
|
+
* @param options - Compiler-owned axes, defaults, and a selected theme/scheme table.
|
|
58
|
+
* @returns A callable that only looks up static data and composes native overrides.
|
|
59
|
+
* @throws {SelectionError} For undeclared axes, choices, or missing table entries.
|
|
60
|
+
*/
|
|
61
|
+
export function create<
|
|
62
|
+
const axes extends Readonly<Record<string, readonly string[]>>,
|
|
63
|
+
const styles extends Readonly<Record<string, StyleSheet.NativeStyle>>,
|
|
64
|
+
>(options: create.Options<axes, styles>): Callable<axes, styles[keyof styles]> {
|
|
65
|
+
const axes = Object.entries(options.axes)
|
|
66
|
+
for (const style of Object.values(options.styles)) freeze(style)
|
|
67
|
+
const staticStyle =
|
|
68
|
+
axes.length === 0 ? options.styles['0' as keyof styles] : undefined
|
|
69
|
+
const staticProps = staticStyle
|
|
70
|
+
? Object.freeze({ style: staticStyle })
|
|
71
|
+
: undefined
|
|
72
|
+
return (input) => {
|
|
73
|
+
if (input === undefined && staticProps) return staticProps
|
|
74
|
+
if (input === undefined) input = {}
|
|
75
|
+
for (const key of Object.keys(input))
|
|
76
|
+
if (key !== 'style' && !Object.hasOwn(options.axes, key))
|
|
77
|
+
throw new SelectionError(`Unknown native recipe input: ${key}.`)
|
|
78
|
+
let index = 0
|
|
79
|
+
let stride = 1
|
|
80
|
+
const values: Readonly<Record<string, unknown>> = input
|
|
81
|
+
for (const [axis, choices] of axes) {
|
|
82
|
+
const supplied = Object.hasOwn(values, axis) ? values[axis] : undefined
|
|
83
|
+
const selected =
|
|
84
|
+
supplied === undefined
|
|
85
|
+
? Object.hasOwn(options.defaults, axis)
|
|
86
|
+
? options.defaults[axis]
|
|
87
|
+
: undefined
|
|
88
|
+
: supplied
|
|
89
|
+
const choice =
|
|
90
|
+
selected === null || selected === undefined
|
|
91
|
+
? choices.length
|
|
92
|
+
: typeof selected === 'string' || typeof selected === 'boolean'
|
|
93
|
+
? choices.indexOf(String(selected))
|
|
94
|
+
: -1
|
|
95
|
+
if (choice < 0)
|
|
96
|
+
throw new SelectionError(`Unknown native recipe choice for ${axis}.`)
|
|
97
|
+
index += choice * stride
|
|
98
|
+
stride *= choices.length + 1
|
|
99
|
+
}
|
|
100
|
+
const style = options.styles[String(index) as keyof styles]
|
|
101
|
+
if (!style)
|
|
102
|
+
throw new SelectionError('Native recipe table is missing a selection.')
|
|
103
|
+
return { style: input.style ? [style, input.style] : style }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Inputs emitted by the native compiler. */
|
|
108
|
+
export declare namespace create {
|
|
109
|
+
/** Finite metadata and precompiled objects, with no device-state lookup. */
|
|
110
|
+
type Options<
|
|
111
|
+
axes extends Readonly<Record<string, readonly string[]>> = Readonly<
|
|
112
|
+
Record<string, readonly string[]>
|
|
113
|
+
>,
|
|
114
|
+
styles extends Readonly<Record<string, StyleSheet.NativeStyle>> = Readonly<
|
|
115
|
+
Record<string, StyleSheet.NativeStyle>
|
|
116
|
+
>,
|
|
117
|
+
> = {
|
|
118
|
+
/** Ordered finite choice names. */
|
|
119
|
+
readonly axes: axes
|
|
120
|
+
/** Default selections. Null suppresses an axis. */
|
|
121
|
+
readonly defaults: Readonly<Record<string, string | null>>
|
|
122
|
+
/** One theme/scheme table indexed by finite selections. */
|
|
123
|
+
readonly styles: styles
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** Props returned by compiled native definitions and native composition. */
|
|
128
|
+
export type Props<style extends object = StyleSheet.NativeStyle> = {
|
|
129
|
+
/** Native style values ready for an ordinary component's style prop. */
|
|
130
|
+
readonly style: StyleSheet.StyleProp<style>
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** An application selected an unknown finite native variant. */
|
|
134
|
+
export class SelectionError extends Error {
|
|
135
|
+
/** Stable namespaced diagnostic name. */
|
|
136
|
+
override name = 'Native.SelectionError'
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function freeze(value: object): void {
|
|
140
|
+
if (Object.isFrozen(value)) return
|
|
141
|
+
for (const child of Object.values(value))
|
|
142
|
+
if (child && typeof child === 'object') freeze(child)
|
|
143
|
+
Object.freeze(value)
|
|
144
|
+
}
|