@yahoo/uds-create-config 2.45.0 → 3.0.0
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/README.md +129 -0
- package/dist/ai-lanes.d.ts +23 -0
- package/dist/ai-lanes.js +34 -0
- package/dist/authoring/define-component.d.ts +85 -0
- package/dist/configs/CanvasConfig.d.ts +3237 -0
- package/dist/configs/CanvasConfig.js +332 -0
- package/dist/configs/build-options.d.ts +10 -0
- package/dist/configs/build-options.js +68 -0
- package/dist/configs/platform.d.ts +15 -0
- package/dist/configs/platform.js +17 -0
- package/dist/configs/react-native-system.d.ts +3026 -0
- package/dist/configs/react-native-system.js +64 -0
- package/dist/configs/system.d.ts +2771 -0
- package/dist/configs/system.js +74 -0
- package/dist/css/properties.generated.d.ts +14 -0
- package/dist/css/properties.generated.js +6260 -0
- package/dist/css/value-type.d.ts +48 -0
- package/dist/css/value-type.js +131 -0
- package/dist/css/values.d.ts +33 -0
- package/dist/css/values.js +116 -0
- package/dist/entities/native/NativeModifier.d.ts +25 -0
- package/dist/entities/native/NativeModifier.js +41 -0
- package/dist/entities/native/NativeSettings.d.ts +44 -0
- package/dist/entities/native/NativeSettings.js +39 -0
- package/dist/entities/native/NativeStyleProperty.d.ts +355 -0
- package/dist/entities/native/NativeStyleProperty.js +28 -0
- package/dist/entities/native/NativeToken.d.ts +31 -0
- package/dist/entities/native/NativeToken.js +49 -0
- package/dist/entities/system/CanvasRole.d.ts +34 -0
- package/dist/entities/system/CanvasRole.js +45 -0
- package/dist/entities/system/Component.d.ts +1287 -0
- package/dist/entities/system/Component.js +1840 -0
- package/dist/entities/system/Composite.d.ts +12 -0
- package/dist/entities/system/Composite.js +26 -0
- package/dist/entities/system/Device.d.ts +11 -0
- package/dist/entities/system/Device.js +18 -0
- package/dist/entities/system/File.d.ts +72 -0
- package/dist/entities/system/File.js +136 -0
- package/dist/entities/system/Font.d.ts +48 -0
- package/dist/entities/system/Font.js +56 -0
- package/dist/entities/system/GlobalStyle.d.ts +26 -0
- package/dist/entities/system/GlobalStyle.js +54 -0
- package/dist/entities/system/Guidance.d.ts +85 -0
- package/dist/entities/system/Guidance.js +59 -0
- package/dist/entities/system/GuidanceStyle.d.ts +14 -0
- package/dist/entities/system/GuidanceStyle.js +8 -0
- package/dist/entities/system/Icon.d.ts +46 -0
- package/dist/entities/system/Icon.js +46 -0
- package/dist/entities/system/LinkedSystem.d.ts +504 -0
- package/dist/entities/system/LinkedSystem.js +814 -0
- package/dist/entities/system/Modifier.d.ts +92 -0
- package/dist/entities/system/Modifier.js +120 -0
- package/dist/entities/system/Motion.d.ts +28 -0
- package/dist/entities/system/Motion.js +48 -0
- package/dist/entities/system/Operation.d.ts +100 -0
- package/dist/entities/system/Operation.js +236 -0
- package/dist/entities/system/Package.d.ts +42 -0
- package/dist/entities/system/Package.js +75 -0
- package/dist/entities/system/Settings.d.ts +94 -0
- package/dist/entities/system/Settings.js +166 -0
- package/dist/entities/system/StyleProperty.d.ts +135 -0
- package/dist/entities/system/StyleProperty.js +438 -0
- package/dist/entities/system/Token.d.ts +67 -0
- package/dist/entities/system/Token.js +129 -0
- package/dist/entities/system/Tool.d.ts +134 -0
- package/dist/entities/system/Tool.js +124 -0
- package/dist/entities/system/color.d.ts +64 -0
- package/dist/entities/system/color.js +123 -0
- package/dist/entities/system/component-module.d.ts +63 -0
- package/dist/entities/system/component-module.js +258 -0
- package/dist/entities/system/copy-plan.d.ts +98 -0
- package/dist/entities/system/copy-plan.js +451 -0
- package/dist/entities/system/defineComponent.d.ts +428 -0
- package/dist/entities/system/defineComponent.js +337 -0
- package/dist/entities/system/element.d.ts +101 -0
- package/dist/entities/system/element.js +171 -0
- package/dist/entities/system/icon-library.d.ts +64 -0
- package/dist/entities/system/icon-library.js +112 -0
- package/dist/entities/system/icon-metadata.d.ts +72 -0
- package/dist/entities/system/icon-metadata.js +111 -0
- package/dist/entities/system/link-declaration.d.ts +27 -0
- package/dist/entities/system/link-declaration.js +64 -0
- package/dist/entities/system/link-plan.d.ts +160 -0
- package/dist/entities/system/link-plan.js +770 -0
- package/dist/entities/system/runtime-modules.d.ts +25 -0
- package/dist/entities/system/runtime-modules.js +38 -0
- package/dist/entities/system/style-bag.d.ts +20 -0
- package/dist/entities/system/style-bag.js +246 -0
- package/dist/entities/system/token-index.d.ts +89 -0
- package/dist/entities/system/token-index.js +112 -0
- package/dist/framework/Config.d.ts +2472 -0
- package/dist/framework/Config.js +5023 -0
- package/dist/framework/Entity.d.ts +127 -0
- package/dist/framework/Entity.js +125 -0
- package/dist/framework/authoring.d.ts +24 -0
- package/dist/framework/authoring.js +7 -0
- package/dist/framework/change-hooks.d.ts +119 -0
- package/dist/framework/change-hooks.js +131 -0
- package/dist/framework/changes.d.ts +88 -0
- package/dist/framework/changes.js +246 -0
- package/dist/framework/class-names.d.ts +260 -0
- package/dist/framework/class-names.js +630 -0
- package/dist/framework/coalesce.d.ts +25 -0
- package/dist/framework/coalesce.js +60 -0
- package/dist/framework/config-op.d.ts +76 -0
- package/dist/framework/config-op.js +43 -0
- package/dist/framework/config-operation-kind.d.ts +14 -0
- package/dist/framework/config-operation-kind.js +14 -0
- package/dist/framework/config-ops.d.ts +34 -0
- package/dist/framework/config-ops.js +187 -0
- package/dist/framework/defineConfig.d.ts +196 -0
- package/dist/framework/defineConfig.js +100 -0
- package/dist/framework/defineDerivedEntity.d.ts +74 -0
- package/dist/framework/defineDerivedEntity.js +83 -0
- package/dist/framework/defineEntity.d.ts +318 -0
- package/dist/framework/defineEntity.js +183 -0
- package/dist/framework/defineSubEntity.d.ts +148 -0
- package/dist/framework/defineSubEntity.js +121 -0
- package/dist/framework/derived-mutations.d.ts +20 -0
- package/dist/framework/derived-mutations.js +38 -0
- package/dist/framework/entity-search.d.ts +29 -0
- package/dist/framework/entity-search.js +117 -0
- package/dist/framework/inline-sources.d.ts +49 -0
- package/dist/framework/inline-sources.js +388 -0
- package/dist/framework/layer-styles.d.ts +25 -0
- package/dist/framework/layer-styles.js +49 -0
- package/dist/framework/memo.d.ts +48 -0
- package/dist/framework/memo.js +84 -0
- package/dist/framework/overlay.d.ts +49 -0
- package/dist/framework/overlay.js +17 -0
- package/dist/framework/plan.d.ts +49 -0
- package/dist/framework/plan.js +73 -0
- package/dist/framework/projections.d.ts +480 -0
- package/dist/framework/projections.js +974 -0
- package/dist/framework/prop-surface.d.ts +132 -0
- package/dist/framework/prop-surface.js +278 -0
- package/dist/framework/ref-graph.d.ts +71 -0
- package/dist/framework/ref-graph.js +158 -0
- package/dist/framework/ref-integrity.d.ts +55 -0
- package/dist/framework/ref-integrity.js +171 -0
- package/dist/framework/registered.d.ts +95 -0
- package/dist/framework/registry-dir.d.ts +42 -0
- package/dist/framework/registry-dir.js +48 -0
- package/dist/framework/registry.d.ts +300 -0
- package/dist/framework/registry.js +104 -0
- package/dist/framework/rejection.d.ts +58 -0
- package/dist/framework/rejection.js +111 -0
- package/dist/framework/rename-inference.d.ts +26 -0
- package/dist/framework/rename-inference.js +50 -0
- package/dist/framework/render-spec.d.ts +296 -0
- package/dist/framework/render-spec.js +809 -0
- package/dist/framework/schema-version.d.ts +140 -0
- package/dist/framework/schema-version.js +214 -0
- package/dist/framework/schemas.d.ts +109 -0
- package/dist/framework/schemas.js +615 -0
- package/dist/framework/session.d.ts +196 -0
- package/dist/framework/session.js +367 -0
- package/dist/framework/signature.d.ts +15 -0
- package/dist/framework/signature.js +83 -0
- package/dist/framework/snapshot.d.ts +115 -0
- package/dist/framework/snapshot.js +277 -0
- package/dist/framework/source-integrity.d.ts +226 -0
- package/dist/framework/source-integrity.js +478 -0
- package/dist/framework/sources.d.ts +211 -0
- package/dist/framework/sources.js +89 -0
- package/dist/framework/utils/compiled-schema.d.ts +23 -0
- package/dist/framework/utils/compiled-schema.js +46 -0
- package/dist/framework/utils/content-key.d.ts +15 -0
- package/dist/framework/utils/content-key.js +33 -0
- package/dist/framework/utils/enumerated.d.ts +13 -0
- package/dist/framework/utils/enumerated.js +19 -0
- package/dist/framework/utils/field-path.d.ts +95 -0
- package/dist/framework/utils/field-path.js +136 -0
- package/dist/framework/utils/field-schema.d.ts +55 -0
- package/dist/framework/utils/field-schema.js +183 -0
- package/dist/framework/utils/group.d.ts +37 -0
- package/dist/framework/utils/group.js +13 -0
- package/dist/framework/utils/package-path.d.ts +37 -0
- package/dist/framework/utils/package-path.js +61 -0
- package/dist/framework/utils/refs.d.ts +194 -0
- package/dist/framework/utils/refs.js +403 -0
- package/dist/framework/validate-spec.d.ts +27 -0
- package/dist/framework/validate-spec.js +45 -0
- package/dist/framework/value-domain.d.ts +26 -0
- package/dist/framework/value-domain.js +202 -0
- package/dist/framework/views-facade.d.ts +15 -0
- package/dist/framework/views-facade.js +19 -0
- package/dist/index.d.ts +90 -42
- package/dist/index.js +86 -37
- package/dist/migrations/2.0.0/raw-css.d.ts +11 -0
- package/dist/migrations/2.0.0/raw-css.js +72 -0
- package/dist/migrations/2.0.0/v1-artifact.d.ts +1559 -0
- package/dist/migrations/2.0.0/v1-artifact.js +1018 -0
- package/dist/migrations/20260908171448_settings_as_kind.d.ts +22 -0
- package/dist/migrations/20260908171448_settings_as_kind.js +89 -0
- package/dist/migrations/20260908194245_visible_state_pointer.d.ts +19 -0
- package/dist/migrations/20260908194245_visible_state_pointer.js +115 -0
- package/dist/migrations/20260909183001_icon_knockout_variants.d.ts +18 -0
- package/dist/migrations/20260909183001_icon_knockout_variants.js +8 -0
- package/dist/migrations/20260910212453_linked_system_link_ops.d.ts +13 -0
- package/dist/migrations/20260910212453_linked_system_link_ops.js +8 -0
- package/dist/migrations/index.d.ts +2 -0
- package/dist/migrations/index.js +2 -0
- package/dist/react-native/style-keys.generated.d.ts +10 -0
- package/dist/react-native/style-keys.generated.js +167 -0
- package/dist/renderer/RendererErrorBoundary.d.ts +32 -5
- package/dist/renderer/RendererErrorBoundary.js +59 -10
- package/dist/renderer/UdsRenderer.d.ts +11 -10
- package/dist/renderer/UdsRenderer.js +1 -1
- package/dist/renderer/assetEntries.d.ts +37 -0
- package/dist/renderer/assetEntries.js +39 -0
- package/dist/renderer/assetRenderable.d.ts +14 -6
- package/dist/renderer/assetRenderable.js +8 -2
- package/dist/renderer/componentEntry.d.ts +58 -0
- package/dist/renderer/componentEntry.js +71 -0
- package/dist/renderer/icon-library.d.ts +20 -0
- package/dist/renderer/index.d.ts +7 -7
- package/dist/renderer/index.js +5 -5
- package/dist/renderer/primitives/SlotRenderer.d.ts +1 -1
- package/dist/renderer/primitives/SlotRenderer.js +1 -1
- package/dist/renderer/runtimeComponent.d.ts +33 -0
- package/dist/renderer/runtimeComponent.js +113 -0
- package/dist/renderer/spec-content.d.ts +43 -0
- package/dist/renderer/spec-content.js +95 -0
- package/dist/renderer/wrapRegistry.d.ts +22 -37
- package/dist/renderer/wrapRegistry.js +10 -20
- package/dist/renderer/wrappers/event-bridge.js +6 -5
- package/dist/renderer/wrappers/hex-normalize.js +6 -5
- package/dist/renderer/wrappers/html-aliases.d.ts +7 -2
- package/dist/renderer/wrappers/html-aliases.js +36 -19
- package/dist/renderer/wrappers/inline-styles.js +7 -6
- package/dist/spec/asset-jsx.d.ts +18 -5
- package/dist/spec/asset-jsx.js +27 -16
- package/dist/spec/collapse-text-labels.d.ts +5 -15
- package/dist/spec/collapse-text-labels.js +26 -19
- package/dist/spec/empty-node-slots.d.ts +56 -34
- package/dist/spec/empty-node-slots.js +87 -47
- package/dist/spec/index.d.ts +21 -10
- package/dist/spec/index.js +21 -10
- package/dist/spec/jsxToSpec.d.ts +14 -9
- package/dist/spec/jsxToSpec.js +20 -3
- package/dist/spec/preview-elements.d.ts +63 -0
- package/dist/spec/preview-elements.js +89 -0
- package/dist/spec/rewrite-refs.d.ts +58 -0
- package/dist/spec/rewrite-refs.js +250 -0
- package/dist/spec/specToJsx.js +18 -29
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -52
- package/dist/AssetGroup.d.ts +0 -77
- package/dist/AssetGroup.js +0 -125
- package/dist/Component.d.ts +0 -333
- package/dist/Component.js +0 -1061
- package/dist/ComponentGroup.d.ts +0 -22
- package/dist/ComponentGroup.js +0 -51
- package/dist/CompositeStyle.d.ts +0 -30
- package/dist/CompositeStyle.js +0 -59
- package/dist/Config.d.ts +0 -528
- package/dist/Config.js +0 -1712
- package/dist/Mode.d.ts +0 -41
- package/dist/Mode.js +0 -81
- package/dist/Modifier.d.ts +0 -51
- package/dist/Modifier.js +0 -97
- package/dist/MotionDef.d.ts +0 -81
- package/dist/MotionDef.js +0 -212
- package/dist/Props.d.ts +0 -332
- package/dist/Props.js +0 -35
- package/dist/Provider.d.ts +0 -20
- package/dist/Provider.js +0 -14
- package/dist/StyleProp.d.ts +0 -145
- package/dist/StyleProp.js +0 -239
- package/dist/Token.d.ts +0 -76
- package/dist/Token.js +0 -133
- package/dist/TokenGroup.d.ts +0 -33
- package/dist/TokenGroup.js +0 -69
- package/dist/asset-kind.d.ts +0 -55
- package/dist/asset-kind.js +0 -29
- package/dist/asset-value.d.ts +0 -23
- package/dist/asset-value.js +0 -40
- package/dist/brands.d.ts +0 -30
- package/dist/brands.js +0 -20
- package/dist/captureCallerPath.d.ts +0 -48
- package/dist/captureCallerPath.js +0 -95
- package/dist/colorExpressions.d.ts +0 -131
- package/dist/colorExpressions.js +0 -148
- package/dist/component-referrers.d.ts +0 -30
- package/dist/component-referrers.js +0 -40
- package/dist/config-diagnostics.d.ts +0 -21
- package/dist/config-diagnostics.js +0 -12
- package/dist/defineAssetGroup.d.ts +0 -200
- package/dist/defineAssetGroup.js +0 -323
- package/dist/defineProvider.d.ts +0 -29
- package/dist/defineProvider.js +0 -60
- package/dist/element-marker.d.ts +0 -63
- package/dist/element-marker.js +0 -113
- package/dist/entity-utils.d.ts +0 -56
- package/dist/entity-utils.js +0 -105
- package/dist/extension.d.ts +0 -55
- package/dist/extension.js +0 -214
- package/dist/factories.d.ts +0 -863
- package/dist/factories.js +0 -475
- package/dist/font-face.d.ts +0 -25
- package/dist/font-face.js +0 -72
- package/dist/foreign-component-name.d.ts +0 -21
- package/dist/foreign-component-name.js +0 -42
- package/dist/interpolate.d.ts +0 -20
- package/dist/interpolate.js +0 -10
- package/dist/jsx/__fixtures__/cross-component-preview.d.ts +0 -3
- package/dist/jsx/__fixtures__/cross-component-preview.js +0 -15
- package/dist/jsx/jsx-dev-runtime.d.ts +0 -15
- package/dist/jsx/jsx-dev-runtime.js +0 -11
- package/dist/jsx/jsx-runtime.d.ts +0 -48
- package/dist/jsx/jsx-runtime.js +0 -305
- package/dist/linked-system-pins.d.ts +0 -30
- package/dist/linked-system-pins.js +0 -45
- package/dist/linkedNodePrefixes.d.ts +0 -73
- package/dist/linkedNodePrefixes.js +0 -99
- package/dist/markers.d.ts +0 -235
- package/dist/markers.js +0 -70
- package/dist/motion-constants.d.ts +0 -37
- package/dist/motion-constants.js +0 -61
- package/dist/native/NativeConfig.d.ts +0 -56
- package/dist/native/NativeConfig.js +0 -162
- package/dist/native/assets.d.ts +0 -20
- package/dist/native/assets.js +0 -17
- package/dist/native/components.d.ts +0 -139
- package/dist/native/components.js +0 -67
- package/dist/native/index.d.ts +0 -18
- package/dist/native/index.js +0 -17
- package/dist/native/modes.d.ts +0 -10
- package/dist/native/modes.js +0 -11
- package/dist/native/types.d.ts +0 -95
- package/dist/native/types.js +0 -0
- package/dist/native/validation.d.ts +0 -8
- package/dist/native/validation.js +0 -885
- package/dist/native/values.d.ts +0 -7
- package/dist/native/values.js +0 -15
- package/dist/native.d.ts +0 -12
- package/dist/native.js +0 -10
- package/dist/refs.d.ts +0 -204
- package/dist/refs.js +0 -129
- package/dist/registry-aliases.d.ts +0 -33
- package/dist/registry-aliases.js +0 -35
- package/dist/registry-dir.d.ts +0 -22
- package/dist/registry-dir.js +0 -10
- package/dist/renderer/makeRegistry.d.ts +0 -34
- package/dist/renderer/makeRegistry.js +0 -52
- package/dist/renderer/makeUdsRenderer.d.ts +0 -13
- package/dist/renderer/makeUdsRenderer.js +0 -51
- package/dist/renderer/wrappers/component-slots.d.ts +0 -41
- package/dist/renderer/wrappers/component-slots.js +0 -66
- package/dist/renderer/wrappers/slot-resolution.d.ts +0 -25
- package/dist/renderer/wrappers/slot-resolution.js +0 -68
- package/dist/renderer/wrappers/void-elements.d.ts +0 -37
- package/dist/renderer/wrappers/void-elements.js +0 -40
- package/dist/spec/layer-props.d.ts +0 -52
- package/dist/spec/layer-props.js +0 -149
- package/dist/spec/preview-controls.d.ts +0 -44
- package/dist/spec/preview-controls.js +0 -139
- package/dist/spec/slot-refs.d.ts +0 -39
- package/dist/spec/slot-refs.js +0 -56
- package/dist/token-override-rows.d.ts +0 -68
- package/dist/token-override-rows.js +0 -233
- package/dist/tokenValueType.d.ts +0 -34
- package/dist/tokenValueType.js +0 -138
- package/dist/types/css-properties.d.ts +0 -233
- package/dist/types/css-properties.js +0 -14
- package/dist/types/css-property-keywords.d.ts +0 -156
- package/dist/types/css-property-keywords.js +0 -616
- package/dist/types/css-values.d.ts +0 -63
- package/dist/types/css-values.js +0 -16
- package/dist/types.d.ts +0 -1138
- package/dist/types.js +0 -12
- package/dist/units.d.ts +0 -14
- package/dist/units.js +0 -16
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.js +0 -4
|
@@ -0,0 +1,1287 @@
|
|
|
1
|
+
import { ExtendedRef, Ref } from "../../framework/utils/refs.js";
|
|
2
|
+
import { SubEntityClass } from "../../framework/defineSubEntity.js";
|
|
3
|
+
import { ComponentContractOf, PathOf } from "../../framework/registered.js";
|
|
4
|
+
import { EntityClass } from "../../framework/defineEntity.js";
|
|
5
|
+
import { Config } from "../../framework/Config.js";
|
|
6
|
+
import { ComputedInput } from "../../framework/registry.js";
|
|
7
|
+
import { StyleValue } from "./style-bag.js";
|
|
8
|
+
import { ComponentPropsOf, LayerMap, PropMap, RenderArgs, StyleRuleInput } from "./defineComponent.js";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
|
|
11
|
+
//#region src/entities/system/Component.d.ts
|
|
12
|
+
/** A component-relative reference to one of the enclosing component's own layers — a slot's
|
|
13
|
+
* `target`. Relative (no component path) because a slot only ever targets a sibling layer, so a
|
|
14
|
+
* Component rename can't break it; a layer rename cascades through it. */
|
|
15
|
+
declare function layerRef(layerKey: string): Ref;
|
|
16
|
+
/**
|
|
17
|
+
* A component-relative reference to one value of one of the enclosing component's own variant
|
|
18
|
+
* props — what a style rule conditions on.
|
|
19
|
+
*
|
|
20
|
+
* Relative for the same reason {@link layerRef} is: a value only ever belongs to a sibling prop, so
|
|
21
|
+
* a component rename can't break it. What it buys is the other direction — a value rename is an
|
|
22
|
+
* ordinary ref rewrite, and because a rule's key is derived from its condition, the rules holding it
|
|
23
|
+
* re-key themselves. Without the ref the name sits in a plain string, invisible to that rewrite, and
|
|
24
|
+
* every rule conditioned on the old name silently stops applying.
|
|
25
|
+
*/
|
|
26
|
+
declare function valueRef(prop: string, value: string): Ref;
|
|
27
|
+
/** The prop names one entry exposes — `null` when the config can't say (an unresolved element). */
|
|
28
|
+
declare function forwardedNames(config: Config, element: unknown, entry: unknown): string[] | null;
|
|
29
|
+
/**
|
|
30
|
+
* One value a variant prop offers — the keyed collection under its `value`.
|
|
31
|
+
*
|
|
32
|
+
* Keyed rather than a list of names, for the three things a bare string can't be: it can't be
|
|
33
|
+
* reordered without rewriting every other value beside it, it can't carry what to call it in a
|
|
34
|
+
* picker, and it can't be renamed by the ordinary cascade — which is what a keyed collection gets
|
|
35
|
+
* from the framework, the same one `layers` and `props` are.
|
|
36
|
+
*/
|
|
37
|
+
declare const variantValueFields: z.ZodObject<{
|
|
38
|
+
label: z.ZodOptional<z.ZodString>;
|
|
39
|
+
description: z.ZodOptional<z.ZodString>;
|
|
40
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
/** One variant value's body, as stored. */
|
|
43
|
+
type VariantValueBody = z.infer<typeof variantValueFields>;
|
|
44
|
+
/** A variant prop's own values — name → body, in the order they were declared. */
|
|
45
|
+
type VariantValues = Record<string, VariantValueBody>;
|
|
46
|
+
declare const propShape: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"slot">;
|
|
48
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
50
|
+
__ref: z.ZodString;
|
|
51
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
52
|
+
__ref: z.ZodString;
|
|
53
|
+
}, z.core.$strip>>]>>;
|
|
54
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
+
type: z.ZodLiteral<"variant">;
|
|
57
|
+
value: z.ZodUnion<readonly [z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<{
|
|
58
|
+
[k: string]: {};
|
|
59
|
+
}, string[]>>, z.ZodObject<{
|
|
60
|
+
__ref: z.ZodString;
|
|
61
|
+
}, z.core.$strip>, SubEntityClass<z.ZodObject<{
|
|
62
|
+
label: z.ZodOptional<z.ZodString>;
|
|
63
|
+
description: z.ZodOptional<z.ZodString>;
|
|
64
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
}, z.core.$strict>>]>;
|
|
66
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
}, z.core.$strict>, z.ZodPipe<z.ZodObject<{
|
|
68
|
+
type: z.ZodLiteral<"forward">;
|
|
69
|
+
target: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
70
|
+
__ref: z.ZodString;
|
|
71
|
+
}, z.core.$strip>]>;
|
|
72
|
+
into: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
73
|
+
__ref: z.ZodString;
|
|
74
|
+
}, z.core.$strip>]>>;
|
|
75
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
76
|
+
__ref: z.ZodString;
|
|
77
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
78
|
+
__ref: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>]>>;
|
|
80
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
83
|
+
type: "forward";
|
|
84
|
+
target: string | {
|
|
85
|
+
__ref: string;
|
|
86
|
+
};
|
|
87
|
+
into?: string | {
|
|
88
|
+
__ref: string;
|
|
89
|
+
} | undefined;
|
|
90
|
+
accepts?: {
|
|
91
|
+
__ref: string;
|
|
92
|
+
} | {
|
|
93
|
+
__ref: string;
|
|
94
|
+
}[] | undefined;
|
|
95
|
+
text?: boolean | undefined;
|
|
96
|
+
required?: boolean | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
type: "forward";
|
|
99
|
+
target: string | {
|
|
100
|
+
__ref: string;
|
|
101
|
+
};
|
|
102
|
+
into?: string | {
|
|
103
|
+
__ref: string;
|
|
104
|
+
} | undefined;
|
|
105
|
+
accepts?: {
|
|
106
|
+
__ref: string;
|
|
107
|
+
} | {
|
|
108
|
+
__ref: string;
|
|
109
|
+
}[] | undefined;
|
|
110
|
+
text?: boolean | undefined;
|
|
111
|
+
required?: boolean | undefined;
|
|
112
|
+
}>>, z.ZodObject<{
|
|
113
|
+
type: z.ZodLiteral<"styleProperty">;
|
|
114
|
+
value: z.ZodObject<{
|
|
115
|
+
__ref: z.ZodString;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
118
|
+
type: z.ZodLiteral<"composite">;
|
|
119
|
+
value: z.ZodObject<{
|
|
120
|
+
__ref: z.ZodString;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
123
|
+
type: z.ZodLiteral<"motion">;
|
|
124
|
+
value: z.ZodDefault<z.ZodObject<{
|
|
125
|
+
__ref: z.ZodString;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
128
|
+
type: z.ZodLiteral<"string">;
|
|
129
|
+
value: z.ZodOptional<z.ZodString>;
|
|
130
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
131
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"number">;
|
|
133
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
136
|
+
type: z.ZodLiteral<"boolean">;
|
|
137
|
+
value: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
}, z.core.$strict>], "type">;
|
|
140
|
+
/** Nullable because `null` is the omit tombstone: a component that `inherits` its element's props
|
|
141
|
+
* drops one by declaring it `null`, rather than needing a second "don't expose" mechanism. */
|
|
142
|
+
/** One prop as stored — the discriminated declaration, or `null` (the omit tombstone). */
|
|
143
|
+
type ComponentPropBody = z.infer<typeof propShape> | null;
|
|
144
|
+
/** One prop as accepted — what may be written, before the schema's coercions. The two differ by
|
|
145
|
+
* design (a variant's values are authored as a list and stored as a collection), which is why the
|
|
146
|
+
* authoring types name this one rather than restating either. */
|
|
147
|
+
type AuthoredPropBody = z.input<typeof propShape>;
|
|
148
|
+
/** A rule's identity is its condition, as a canonical query string (`*`, `size=xs`,
|
|
149
|
+
* `size=xs&variant=tertiary`) — sorted, so the same condition always yields the same key however
|
|
150
|
+
* the editor collected it. */
|
|
151
|
+
declare function canonicalWhen(when: unknown): string;
|
|
152
|
+
/**
|
|
153
|
+
* Whether a prop's values belong to this component — an enumerated variant, whose values exist
|
|
154
|
+
* nowhere else and so have no identity until one is given here.
|
|
155
|
+
*
|
|
156
|
+
* A variant that delegates its domain to a ref (an icon prop drawing on the icon library) names
|
|
157
|
+
* values another entity already owns; those rename through their owner's own cascade, and minting a
|
|
158
|
+
* Component-relative identity for them would be a second name for the same thing.
|
|
159
|
+
*/
|
|
160
|
+
declare function ownsItsValues(declaration: unknown): boolean;
|
|
161
|
+
/** The values a variant prop declares, in order — empty for one that delegates its domain. */
|
|
162
|
+
declare function ownValues(declaration: unknown): string[];
|
|
163
|
+
/** One style rule as stored: the condition it applies under (`null` = unconditional), and the bag
|
|
164
|
+
* it applies to each layer. The per-owner factory below narrows both far past this — which props
|
|
165
|
+
* may be named, which layers may be targeted — but every reader sees these two fields, so they're
|
|
166
|
+
* what the collection's member type states. */
|
|
167
|
+
interface ComponentStyleBody {
|
|
168
|
+
when?: Record<string, unknown> | null;
|
|
169
|
+
/** Layer name → its bag. Each bag's keys are narrowed per owner (only props that layer's element
|
|
170
|
+
* exposes), which no single static type can state — so the bag stays open here. */
|
|
171
|
+
layers?: Record<string, Record<string, unknown> | undefined>;
|
|
172
|
+
}
|
|
173
|
+
declare const visibility: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
174
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
175
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
176
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
177
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
$state: z.ZodString;
|
|
182
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
183
|
+
$state: string;
|
|
184
|
+
not?: true | undefined;
|
|
185
|
+
eq?: unknown;
|
|
186
|
+
neq?: unknown;
|
|
187
|
+
gt?: number | undefined;
|
|
188
|
+
gte?: number | undefined;
|
|
189
|
+
lt?: number | undefined;
|
|
190
|
+
lte?: number | undefined;
|
|
191
|
+
}, {
|
|
192
|
+
$state: string;
|
|
193
|
+
not?: true | undefined;
|
|
194
|
+
eq?: unknown;
|
|
195
|
+
neq?: unknown;
|
|
196
|
+
gt?: number | undefined;
|
|
197
|
+
gte?: number | undefined;
|
|
198
|
+
lt?: number | undefined;
|
|
199
|
+
lte?: number | undefined;
|
|
200
|
+
}>>, z.ZodObject<{
|
|
201
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
202
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
203
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
204
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
205
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
207
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
$state: z.ZodString;
|
|
210
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
211
|
+
$state: string;
|
|
212
|
+
not?: true | undefined;
|
|
213
|
+
eq?: unknown;
|
|
214
|
+
neq?: unknown;
|
|
215
|
+
gt?: number | undefined;
|
|
216
|
+
gte?: number | undefined;
|
|
217
|
+
lt?: number | undefined;
|
|
218
|
+
lte?: number | undefined;
|
|
219
|
+
}, {
|
|
220
|
+
$state: string;
|
|
221
|
+
not?: true | undefined;
|
|
222
|
+
eq?: unknown;
|
|
223
|
+
neq?: unknown;
|
|
224
|
+
gt?: number | undefined;
|
|
225
|
+
gte?: number | undefined;
|
|
226
|
+
lt?: number | undefined;
|
|
227
|
+
lte?: number | undefined;
|
|
228
|
+
}>>>;
|
|
229
|
+
}, z.core.$strict>, z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
230
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
231
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
232
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
233
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
236
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
237
|
+
$state: z.ZodString;
|
|
238
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
239
|
+
$state: string;
|
|
240
|
+
not?: true | undefined;
|
|
241
|
+
eq?: unknown;
|
|
242
|
+
neq?: unknown;
|
|
243
|
+
gt?: number | undefined;
|
|
244
|
+
gte?: number | undefined;
|
|
245
|
+
lt?: number | undefined;
|
|
246
|
+
lte?: number | undefined;
|
|
247
|
+
}, {
|
|
248
|
+
$state: string;
|
|
249
|
+
not?: true | undefined;
|
|
250
|
+
eq?: unknown;
|
|
251
|
+
neq?: unknown;
|
|
252
|
+
gt?: number | undefined;
|
|
253
|
+
gte?: number | undefined;
|
|
254
|
+
lt?: number | undefined;
|
|
255
|
+
lte?: number | undefined;
|
|
256
|
+
}>>, z.ZodObject<{
|
|
257
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
258
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
259
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
260
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
261
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
265
|
+
$state: z.ZodString;
|
|
266
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
267
|
+
$state: string;
|
|
268
|
+
not?: true | undefined;
|
|
269
|
+
eq?: unknown;
|
|
270
|
+
neq?: unknown;
|
|
271
|
+
gt?: number | undefined;
|
|
272
|
+
gte?: number | undefined;
|
|
273
|
+
lt?: number | undefined;
|
|
274
|
+
lte?: number | undefined;
|
|
275
|
+
}, {
|
|
276
|
+
$state: string;
|
|
277
|
+
not?: true | undefined;
|
|
278
|
+
eq?: unknown;
|
|
279
|
+
neq?: unknown;
|
|
280
|
+
gt?: number | undefined;
|
|
281
|
+
gte?: number | undefined;
|
|
282
|
+
lt?: number | undefined;
|
|
283
|
+
lte?: number | undefined;
|
|
284
|
+
}>>>;
|
|
285
|
+
}, z.core.$strict>]>>, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
286
|
+
__ref: z.ZodString;
|
|
287
|
+
}, z.core.$strip>]>>, z.ZodTransform<{
|
|
288
|
+
$state: string;
|
|
289
|
+
eq?: unknown;
|
|
290
|
+
} | {
|
|
291
|
+
$state: string;
|
|
292
|
+
eq?: unknown;
|
|
293
|
+
}[], Record<string, string | number | boolean | {
|
|
294
|
+
__ref: string;
|
|
295
|
+
}>>>]>;
|
|
296
|
+
/** A stored `visible` condition — json-render's grammar as the entity narrows it, with a flat
|
|
297
|
+
* `{ prop: value }` already compiled to its `$state` form and every `$state` a JSON pointer. */
|
|
298
|
+
type ElementVisibility = z.infer<typeof visibility>;
|
|
299
|
+
/** A `visible` condition as a surface writes it: the flat `{ prop: value }` form included, and
|
|
300
|
+
* `$state` accepted with or without its slash. */
|
|
301
|
+
type ElementVisibilityInput = z.input<typeof visibility>;
|
|
302
|
+
/** A `visible` condition on a projected element: the stored condition, or the boolean
|
|
303
|
+
* `specWithResolvedVisibility` bakes it to once a coordinate settles it. */
|
|
304
|
+
type ProjectedVisibility = ElementVisibility | boolean;
|
|
305
|
+
/** One anatomy node as stored: what it renders, what nests inside it, and the props/text baked
|
|
306
|
+
* onto it. The per-owner factory narrows `children` to this component's own node names and checks
|
|
307
|
+
* the target's children policy; these are the fields every reader sees. */
|
|
308
|
+
interface ComponentElementBody {
|
|
309
|
+
element?: unknown;
|
|
310
|
+
children?: string[];
|
|
311
|
+
/** Slot fills, in json-render's native grammar: slot prop name → the node keys that fill it.
|
|
312
|
+
* A slotted node nests in render without a `children` edge, exactly like the spec form. */
|
|
313
|
+
slots?: Record<string, string[]>;
|
|
314
|
+
visible?: ElementVisibility;
|
|
315
|
+
props?: Record<string, unknown>;
|
|
316
|
+
text?: string;
|
|
317
|
+
}
|
|
318
|
+
declare const componentFields: z.ZodObject<{
|
|
319
|
+
layers: SubEntityClass<z.ZodUnion<readonly [z.ZodString, z.ZodLazy<z.ZodType<Ref, unknown, z.core.$ZodTypeInternals<Ref, unknown>>>, EntityClass<z.ZodObject<{
|
|
320
|
+
version: z.ZodOptional<z.ZodString>;
|
|
321
|
+
exports: z.ZodOptional<SubEntityClass<z.ZodObject<{}, z.core.$strict>>>;
|
|
322
|
+
}, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "package", Record<never, never>, Record<never, never>, false>]>>;
|
|
323
|
+
props: z.ZodOptional<SubEntityClass<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
324
|
+
type: z.ZodLiteral<"slot">;
|
|
325
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
327
|
+
__ref: z.ZodString;
|
|
328
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
329
|
+
__ref: z.ZodString;
|
|
330
|
+
}, z.core.$strip>>]>>;
|
|
331
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
332
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
333
|
+
type: z.ZodLiteral<"variant">;
|
|
334
|
+
value: z.ZodUnion<readonly [z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<{
|
|
335
|
+
[k: string]: {};
|
|
336
|
+
}, string[]>>, z.ZodObject<{
|
|
337
|
+
__ref: z.ZodString;
|
|
338
|
+
}, z.core.$strip>, SubEntityClass<z.ZodObject<{
|
|
339
|
+
label: z.ZodOptional<z.ZodString>;
|
|
340
|
+
description: z.ZodOptional<z.ZodString>;
|
|
341
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
342
|
+
}, z.core.$strict>>]>;
|
|
343
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
344
|
+
}, z.core.$strict>, z.ZodPipe<z.ZodObject<{
|
|
345
|
+
type: z.ZodLiteral<"forward">;
|
|
346
|
+
target: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
347
|
+
__ref: z.ZodString;
|
|
348
|
+
}, z.core.$strip>]>;
|
|
349
|
+
into: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
350
|
+
__ref: z.ZodString;
|
|
351
|
+
}, z.core.$strip>]>>;
|
|
352
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
353
|
+
__ref: z.ZodString;
|
|
354
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
355
|
+
__ref: z.ZodString;
|
|
356
|
+
}, z.core.$strip>>]>>;
|
|
357
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
358
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
359
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
360
|
+
type: "forward";
|
|
361
|
+
target: string | {
|
|
362
|
+
__ref: string;
|
|
363
|
+
};
|
|
364
|
+
into?: string | {
|
|
365
|
+
__ref: string;
|
|
366
|
+
} | undefined;
|
|
367
|
+
accepts?: {
|
|
368
|
+
__ref: string;
|
|
369
|
+
} | {
|
|
370
|
+
__ref: string;
|
|
371
|
+
}[] | undefined;
|
|
372
|
+
text?: boolean | undefined;
|
|
373
|
+
required?: boolean | undefined;
|
|
374
|
+
}, {
|
|
375
|
+
type: "forward";
|
|
376
|
+
target: string | {
|
|
377
|
+
__ref: string;
|
|
378
|
+
};
|
|
379
|
+
into?: string | {
|
|
380
|
+
__ref: string;
|
|
381
|
+
} | undefined;
|
|
382
|
+
accepts?: {
|
|
383
|
+
__ref: string;
|
|
384
|
+
} | {
|
|
385
|
+
__ref: string;
|
|
386
|
+
}[] | undefined;
|
|
387
|
+
text?: boolean | undefined;
|
|
388
|
+
required?: boolean | undefined;
|
|
389
|
+
}>>, z.ZodObject<{
|
|
390
|
+
type: z.ZodLiteral<"styleProperty">;
|
|
391
|
+
value: z.ZodObject<{
|
|
392
|
+
__ref: z.ZodString;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
395
|
+
type: z.ZodLiteral<"composite">;
|
|
396
|
+
value: z.ZodObject<{
|
|
397
|
+
__ref: z.ZodString;
|
|
398
|
+
}, z.core.$strip>;
|
|
399
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
400
|
+
type: z.ZodLiteral<"motion">;
|
|
401
|
+
value: z.ZodDefault<z.ZodObject<{
|
|
402
|
+
__ref: z.ZodString;
|
|
403
|
+
}, z.core.$strip>>;
|
|
404
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
405
|
+
type: z.ZodLiteral<"string">;
|
|
406
|
+
value: z.ZodOptional<z.ZodString>;
|
|
407
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
409
|
+
type: z.ZodLiteral<"number">;
|
|
410
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
411
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
412
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
413
|
+
type: z.ZodLiteral<"boolean">;
|
|
414
|
+
value: z.ZodOptional<z.ZodBoolean>;
|
|
415
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
416
|
+
}, z.core.$strict>], "type">>>>;
|
|
417
|
+
forwards: z.ZodOptional<SubEntityClass<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodObject<{
|
|
418
|
+
__ref: z.ZodString;
|
|
419
|
+
}, z.core.$strip>>]>>>;
|
|
420
|
+
styles: z.ZodOptional<SubEntityClass<z.ZodType<ComponentStyleBody, unknown, z.core.$ZodTypeInternals<ComponentStyleBody, unknown>>>>;
|
|
421
|
+
anatomy: z.ZodOptional<SubEntityClass<z.ZodType<ComponentElementBody, unknown, z.core.$ZodTypeInternals<ComponentElementBody, unknown>>>>;
|
|
422
|
+
defaultProps: z.ZodOptional<SubEntityClass<z.ZodType<StyleValue, unknown, z.core.$ZodTypeInternals<StyleValue, unknown>>>>;
|
|
423
|
+
previewProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
424
|
+
file: z.ZodOptional<z.ZodObject<{
|
|
425
|
+
__ref: z.ZodString;
|
|
426
|
+
}, z.core.$strip>>;
|
|
427
|
+
export: z.ZodOptional<z.ZodString>;
|
|
428
|
+
}, z.core.$strict>;
|
|
429
|
+
/**
|
|
430
|
+
* A component's stored body — every field, typed off the schema above.
|
|
431
|
+
*
|
|
432
|
+
* The type a reader names when it holds a component's fields (`Component.get(config, path)` returns
|
|
433
|
+
* an `Entity &` this). Inferred rather than restated so it can't drift from what the entity accepts:
|
|
434
|
+
* a surface that needs a field the schema doesn't declare is a gap in the schema, not a cast.
|
|
435
|
+
*/
|
|
436
|
+
type ComponentBody = z.infer<typeof componentFields>;
|
|
437
|
+
declare const ComponentEntity: EntityClass<z.ZodObject<{
|
|
438
|
+
layers: SubEntityClass<z.ZodUnion<readonly [z.ZodString, z.ZodLazy<z.ZodType<Ref, unknown, z.core.$ZodTypeInternals<Ref, unknown>>>, EntityClass<z.ZodObject<{
|
|
439
|
+
version: z.ZodOptional<z.ZodString>;
|
|
440
|
+
exports: z.ZodOptional<SubEntityClass<z.ZodObject<{}, z.core.$strict>>>;
|
|
441
|
+
}, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "package", Record<never, never>, Record<never, never>, false>]>>;
|
|
442
|
+
props: z.ZodOptional<SubEntityClass<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
443
|
+
type: z.ZodLiteral<"slot">;
|
|
444
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
445
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
446
|
+
__ref: z.ZodString;
|
|
447
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
448
|
+
__ref: z.ZodString;
|
|
449
|
+
}, z.core.$strip>>]>>;
|
|
450
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
451
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
452
|
+
type: z.ZodLiteral<"variant">;
|
|
453
|
+
value: z.ZodUnion<readonly [z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<{
|
|
454
|
+
[k: string]: {};
|
|
455
|
+
}, string[]>>, z.ZodObject<{
|
|
456
|
+
__ref: z.ZodString;
|
|
457
|
+
}, z.core.$strip>, SubEntityClass<z.ZodObject<{
|
|
458
|
+
label: z.ZodOptional<z.ZodString>;
|
|
459
|
+
description: z.ZodOptional<z.ZodString>;
|
|
460
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
461
|
+
}, z.core.$strict>>]>;
|
|
462
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
463
|
+
}, z.core.$strict>, z.ZodPipe<z.ZodObject<{
|
|
464
|
+
type: z.ZodLiteral<"forward">;
|
|
465
|
+
target: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
466
|
+
__ref: z.ZodString;
|
|
467
|
+
}, z.core.$strip>]>;
|
|
468
|
+
into: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
469
|
+
__ref: z.ZodString;
|
|
470
|
+
}, z.core.$strip>]>>;
|
|
471
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
472
|
+
__ref: z.ZodString;
|
|
473
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
474
|
+
__ref: z.ZodString;
|
|
475
|
+
}, z.core.$strip>>]>>;
|
|
476
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
477
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
478
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
479
|
+
type: "forward";
|
|
480
|
+
target: string | {
|
|
481
|
+
__ref: string;
|
|
482
|
+
};
|
|
483
|
+
into?: string | {
|
|
484
|
+
__ref: string;
|
|
485
|
+
} | undefined;
|
|
486
|
+
accepts?: {
|
|
487
|
+
__ref: string;
|
|
488
|
+
} | {
|
|
489
|
+
__ref: string;
|
|
490
|
+
}[] | undefined;
|
|
491
|
+
text?: boolean | undefined;
|
|
492
|
+
required?: boolean | undefined;
|
|
493
|
+
}, {
|
|
494
|
+
type: "forward";
|
|
495
|
+
target: string | {
|
|
496
|
+
__ref: string;
|
|
497
|
+
};
|
|
498
|
+
into?: string | {
|
|
499
|
+
__ref: string;
|
|
500
|
+
} | undefined;
|
|
501
|
+
accepts?: {
|
|
502
|
+
__ref: string;
|
|
503
|
+
} | {
|
|
504
|
+
__ref: string;
|
|
505
|
+
}[] | undefined;
|
|
506
|
+
text?: boolean | undefined;
|
|
507
|
+
required?: boolean | undefined;
|
|
508
|
+
}>>, z.ZodObject<{
|
|
509
|
+
type: z.ZodLiteral<"styleProperty">;
|
|
510
|
+
value: z.ZodObject<{
|
|
511
|
+
__ref: z.ZodString;
|
|
512
|
+
}, z.core.$strip>;
|
|
513
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
514
|
+
type: z.ZodLiteral<"composite">;
|
|
515
|
+
value: z.ZodObject<{
|
|
516
|
+
__ref: z.ZodString;
|
|
517
|
+
}, z.core.$strip>;
|
|
518
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
519
|
+
type: z.ZodLiteral<"motion">;
|
|
520
|
+
value: z.ZodDefault<z.ZodObject<{
|
|
521
|
+
__ref: z.ZodString;
|
|
522
|
+
}, z.core.$strip>>;
|
|
523
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
524
|
+
type: z.ZodLiteral<"string">;
|
|
525
|
+
value: z.ZodOptional<z.ZodString>;
|
|
526
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
527
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
528
|
+
type: z.ZodLiteral<"number">;
|
|
529
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
530
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
531
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
532
|
+
type: z.ZodLiteral<"boolean">;
|
|
533
|
+
value: z.ZodOptional<z.ZodBoolean>;
|
|
534
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
535
|
+
}, z.core.$strict>], "type">>>>;
|
|
536
|
+
forwards: z.ZodOptional<SubEntityClass<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodObject<{
|
|
537
|
+
__ref: z.ZodString;
|
|
538
|
+
}, z.core.$strip>>]>>>;
|
|
539
|
+
styles: z.ZodOptional<SubEntityClass<z.ZodType<ComponentStyleBody, unknown, z.core.$ZodTypeInternals<ComponentStyleBody, unknown>>>>;
|
|
540
|
+
anatomy: z.ZodOptional<SubEntityClass<z.ZodType<ComponentElementBody, unknown, z.core.$ZodTypeInternals<ComponentElementBody, unknown>>>>;
|
|
541
|
+
defaultProps: z.ZodOptional<SubEntityClass<z.ZodType<StyleValue, unknown, z.core.$ZodTypeInternals<StyleValue, unknown>>>>;
|
|
542
|
+
previewProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
543
|
+
file: z.ZodOptional<z.ZodObject<{
|
|
544
|
+
__ref: z.ZodString;
|
|
545
|
+
}, z.core.$strip>>;
|
|
546
|
+
export: z.ZodOptional<z.ZodString>;
|
|
547
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
548
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
549
|
+
}, z.core.$strip>, "component", {
|
|
550
|
+
readonly create: {
|
|
551
|
+
readonly data: z.ZodObject<{
|
|
552
|
+
layers: SubEntityClass<z.ZodUnion<readonly [z.ZodString, z.ZodLazy<z.ZodType<Ref, unknown, z.core.$ZodTypeInternals<Ref, unknown>>>, EntityClass<z.ZodObject<{
|
|
553
|
+
version: z.ZodOptional<z.ZodString>;
|
|
554
|
+
exports: z.ZodOptional<SubEntityClass<z.ZodObject<{}, z.core.$strict>>>;
|
|
555
|
+
}, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "package", Record<never, never>, Record<never, never>, false>]>>;
|
|
556
|
+
props: z.ZodOptional<SubEntityClass<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
557
|
+
type: z.ZodLiteral<"slot">;
|
|
558
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
559
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
560
|
+
__ref: z.ZodString;
|
|
561
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
562
|
+
__ref: z.ZodString;
|
|
563
|
+
}, z.core.$strip>>]>>;
|
|
564
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
565
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
566
|
+
type: z.ZodLiteral<"variant">;
|
|
567
|
+
value: z.ZodUnion<readonly [z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<{
|
|
568
|
+
[k: string]: {};
|
|
569
|
+
}, string[]>>, z.ZodObject<{
|
|
570
|
+
__ref: z.ZodString;
|
|
571
|
+
}, z.core.$strip>, SubEntityClass<z.ZodObject<{
|
|
572
|
+
label: z.ZodOptional<z.ZodString>;
|
|
573
|
+
description: z.ZodOptional<z.ZodString>;
|
|
574
|
+
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
575
|
+
}, z.core.$strict>>]>;
|
|
576
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
577
|
+
}, z.core.$strict>, z.ZodPipe<z.ZodObject<{
|
|
578
|
+
type: z.ZodLiteral<"forward">;
|
|
579
|
+
target: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
580
|
+
__ref: z.ZodString;
|
|
581
|
+
}, z.core.$strip>]>;
|
|
582
|
+
into: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
583
|
+
__ref: z.ZodString;
|
|
584
|
+
}, z.core.$strip>]>>;
|
|
585
|
+
accepts: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
586
|
+
__ref: z.ZodString;
|
|
587
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
588
|
+
__ref: z.ZodString;
|
|
589
|
+
}, z.core.$strip>>]>>;
|
|
590
|
+
text: z.ZodOptional<z.ZodBoolean>;
|
|
591
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
592
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
593
|
+
type: "forward";
|
|
594
|
+
target: string | {
|
|
595
|
+
__ref: string;
|
|
596
|
+
};
|
|
597
|
+
into?: string | {
|
|
598
|
+
__ref: string;
|
|
599
|
+
} | undefined;
|
|
600
|
+
accepts?: {
|
|
601
|
+
__ref: string;
|
|
602
|
+
} | {
|
|
603
|
+
__ref: string;
|
|
604
|
+
}[] | undefined;
|
|
605
|
+
text?: boolean | undefined;
|
|
606
|
+
required?: boolean | undefined;
|
|
607
|
+
}, {
|
|
608
|
+
type: "forward";
|
|
609
|
+
target: string | {
|
|
610
|
+
__ref: string;
|
|
611
|
+
};
|
|
612
|
+
into?: string | {
|
|
613
|
+
__ref: string;
|
|
614
|
+
} | undefined;
|
|
615
|
+
accepts?: {
|
|
616
|
+
__ref: string;
|
|
617
|
+
} | {
|
|
618
|
+
__ref: string;
|
|
619
|
+
}[] | undefined;
|
|
620
|
+
text?: boolean | undefined;
|
|
621
|
+
required?: boolean | undefined;
|
|
622
|
+
}>>, z.ZodObject<{
|
|
623
|
+
type: z.ZodLiteral<"styleProperty">;
|
|
624
|
+
value: z.ZodObject<{
|
|
625
|
+
__ref: z.ZodString;
|
|
626
|
+
}, z.core.$strip>;
|
|
627
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
628
|
+
type: z.ZodLiteral<"composite">;
|
|
629
|
+
value: z.ZodObject<{
|
|
630
|
+
__ref: z.ZodString;
|
|
631
|
+
}, z.core.$strip>;
|
|
632
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
633
|
+
type: z.ZodLiteral<"motion">;
|
|
634
|
+
value: z.ZodDefault<z.ZodObject<{
|
|
635
|
+
__ref: z.ZodString;
|
|
636
|
+
}, z.core.$strip>>;
|
|
637
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
638
|
+
type: z.ZodLiteral<"string">;
|
|
639
|
+
value: z.ZodOptional<z.ZodString>;
|
|
640
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
641
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
642
|
+
type: z.ZodLiteral<"number">;
|
|
643
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
644
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
645
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
646
|
+
type: z.ZodLiteral<"boolean">;
|
|
647
|
+
value: z.ZodOptional<z.ZodBoolean>;
|
|
648
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
649
|
+
}, z.core.$strict>], "type">>>>;
|
|
650
|
+
forwards: z.ZodOptional<SubEntityClass<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodObject<{
|
|
651
|
+
__ref: z.ZodString;
|
|
652
|
+
}, z.core.$strip>>]>>>;
|
|
653
|
+
styles: z.ZodOptional<SubEntityClass<z.ZodType<ComponentStyleBody, unknown, z.core.$ZodTypeInternals<ComponentStyleBody, unknown>>>>;
|
|
654
|
+
anatomy: z.ZodOptional<SubEntityClass<z.ZodType<ComponentElementBody, unknown, z.core.$ZodTypeInternals<ComponentElementBody, unknown>>>>;
|
|
655
|
+
defaultProps: z.ZodOptional<SubEntityClass<z.ZodType<StyleValue, unknown, z.core.$ZodTypeInternals<StyleValue, unknown>>>>;
|
|
656
|
+
previewProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
657
|
+
file: z.ZodOptional<z.ZodObject<{
|
|
658
|
+
__ref: z.ZodString;
|
|
659
|
+
}, z.core.$strip>>;
|
|
660
|
+
export: z.ZodOptional<z.ZodString>;
|
|
661
|
+
}, z.core.$strict>;
|
|
662
|
+
readonly description: "Create a component at a new qualified `path`. When its complete body is known, include all layers, anatomy, props, defaults, and styles in this one operation. `data.layers` maps each stable layer name to the element it renders and must include `root` — a tag for a primitive (`{ \"layers\": { \"root\": \"div\" } }`), and for anything built on top, a ref to a primitive (`{ \"root\": { \"__ref\": \"component:Box\" }, \"label\": { \"__ref\": \"component:Text\" } }`), which is what lets the layer take that primitive's style props. A primitive exposes style props as `{ \"type\": \"styleProperty\", \"value\": { \"__ref\": \"style-property:bg\" } }` and declares `children: { \"type\": \"slot\", \"text\": true }` when it holds content — without the slot, nothing nested inside it renders. A composed component exposes a layer's props at its own top level through `forwards`, keyed by layer: `{ \"forwards\": { \"root\": \"*\" } }` passes every prop the root's element takes (so `<Button width=\"full\">` reaches the root's `width`), and a list of member refs (`[{ \"__ref\": \"component:Box#props/width\" }]`, each naming the component that declares the prop) passes only those. A prop a layer already exposes is forwarded, never redeclared in `props`; a `props` entry of `{ \"type\": \"forward\" }` is the reverse route, one of this component's props into a layer's. `anatomy` is the tree the build would read off a render: each node renders a layer (`{ \"__ref\": \"layer:<name>\" }`), an intrinsic tag, or `Slot` (`{ \"element\": \"Slot\", \"props\": { \"name\": \"children\" } }`, where a slot prop's content lands — but a declared slot fills `root` by default, so a primitive still declares its `children` slot prop yet needs no `Slot` node or `children` entry for it, and a `Slot` node is only for landing that content in a nested layer); `children` lists sibling node keys from the `root` node, never a prop name; `text` is a fixed string; `visible` is a condition on a prop (`{ \"$state\": \"<prop>\" }`, or with `eq`); content shown in a nested layer is a route, `children: { \"type\": \"forward\", \"target\": \"label/children\" }`. `$state` appears only in `visible` and in an `element` a prop chooses, never as a prop value. A glyph is a node of its own, `{ \"element\": { \"__ref\": \"icon:<library>/<Name>\" } }`, listed in the `children` of the layer node that holds it, never a prop value. Text a prop supplies to a text layer is never a node either: declare the prop `{ \"type\": \"forward\", \"target\": \"<layer>/children\" }` and the layer shows it; a `Slot` node goes only under a layer that takes nodes. A style rule is `\"styles\": { \"*\": { \"when\": null, \"layers\": { \"root\": { \"bg\": \"surface\" } } } }`, keyed by a name, with each layer's bag under `layers`. A composed component carries its own styles: give it an unconditional (`\"*\"`) rule that lays out and surfaces it through the system's style properties — spacing, alignment and gap on the container, a background and color where it has one — rather than leaning on the bare primitives, which paint flat. Style a layer only with the style props the primitive it renders exposes, set to the values those props accept: `component/get` on the primitive lists both, so read it and choose from that rather than reaching for a CSS name or value the system has no style property for. Set `previewProps` (or `defaultProps`) so the component previews with content; a root that takes children renders empty otherwise. A style rule's layer bag is keyed by style-prop name (`fontWeight`, `color`), never by CSS property name, and each value is one of that prop's values.";
|
|
663
|
+
readonly example: ({
|
|
664
|
+
config
|
|
665
|
+
}: {
|
|
666
|
+
config: Config;
|
|
667
|
+
kind: string;
|
|
668
|
+
path: string;
|
|
669
|
+
}) => {
|
|
670
|
+
path: string;
|
|
671
|
+
data: Record<string, unknown>;
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
readonly 'sub-create/anatomy': {
|
|
675
|
+
readonly description: "Add one anatomy node (`key` + `data`) to a component. In a batch, create child nodes before a parent whose `children` or `slots` names them; each referenced node must already exist when this operation runs.";
|
|
676
|
+
};
|
|
677
|
+
readonly 'sub-create/props': {
|
|
678
|
+
readonly description: "Declare a prop this component owns (`key` + `data`): a `variant`, a `slot`, a `styleProperty` or `composite` on a primitive, a `forward` routing this prop into a layer's (`{ \"type\": \"forward\", \"target\": \"<layer>/<prop>\" }`), or `null` to drop a forwarded prop from the surface. A prop one of its layers already exposes — `width` on a root that renders `Box` — is not declared here; `sub-create/forwards` exposes it at the top level.";
|
|
679
|
+
};
|
|
680
|
+
readonly 'sub-create/forwards': {
|
|
681
|
+
readonly description: "Expose a layer's props at this component's top level. `key` is one of the component's own layer names; `data` is `\"*\"` for every prop that layer's element takes, or a list of component prop member refs (`[{ \"__ref\": \"component:Box#props/width\" }]`) for a selection, each naming the component that declares the prop — `Button` forwarding `width` from a `Pressable` root names `Box`, where `Pressable` takes it from. This is how `<Button width=\"full\">` reaches the root's `width` with no `width` entry in `props`; a prop the layer already exposes is forwarded, never redeclared. Two entries may not offer the same prop, and removing one forwarded prop is a `null` tombstone under `props`.";
|
|
682
|
+
readonly example: ({
|
|
683
|
+
config
|
|
684
|
+
}: {
|
|
685
|
+
config: Config;
|
|
686
|
+
kind: string;
|
|
687
|
+
path: string;
|
|
688
|
+
}) => {
|
|
689
|
+
path: string;
|
|
690
|
+
key: string;
|
|
691
|
+
data: "*";
|
|
692
|
+
} | undefined;
|
|
693
|
+
};
|
|
694
|
+
readonly 'sub-upsert/forwards': {
|
|
695
|
+
readonly description: "Set what one layer forwards, added when absent and replaced whole when present. Expose a layer's props at this component's top level. `key` is one of the component's own layer names; `data` is `\"*\"` for every prop that layer's element takes, or a list of component prop member refs (`[{ \"__ref\": \"component:Box#props/width\" }]`) for a selection, each naming the component that declares the prop — `Button` forwarding `width` from a `Pressable` root names `Box`, where `Pressable` takes it from. This is how `<Button width=\"full\">` reaches the root's `width` with no `width` entry in `props`; a prop the layer already exposes is forwarded, never redeclared. Two entries may not offer the same prop, and removing one forwarded prop is a `null` tombstone under `props`.";
|
|
696
|
+
};
|
|
697
|
+
readonly 'sub-update/forwards': {
|
|
698
|
+
readonly description: "Replace what one layer forwards: the member is `'*'` or a list, so `data` is the whole new value. Expose a layer's props at this component's top level. `key` is one of the component's own layer names; `data` is `\"*\"` for every prop that layer's element takes, or a list of component prop member refs (`[{ \"__ref\": \"component:Box#props/width\" }]`) for a selection, each naming the component that declares the prop — `Button` forwarding `width` from a `Pressable` root names `Box`, where `Pressable` takes it from. This is how `<Button width=\"full\">` reaches the root's `width` with no `width` entry in `props`; a prop the layer already exposes is forwarded, never redeclared. Two entries may not offer the same prop, and removing one forwarded prop is a `null` tombstone under `props`.";
|
|
699
|
+
};
|
|
700
|
+
/**
|
|
701
|
+
* Add an element to a composition — a layer and the node that targets it, together.
|
|
702
|
+
*
|
|
703
|
+
* Two writes, one op, because either alone is broken: a node whose element is a component ref
|
|
704
|
+
* directly can never be styled (`styles` keys on layer names, and it has none), and a layer no
|
|
705
|
+
* node places renders nowhere. Making it one op is also what keeps the parent's `children` from
|
|
706
|
+
* being left dangling between two patches.
|
|
707
|
+
*
|
|
708
|
+
* That the new element gets a layer is the whole difference between a read component and an
|
|
709
|
+
* authored one. A render's inline glyph stays unnamed because the source never named it; a thing
|
|
710
|
+
* a person adds is added in order to be styled.
|
|
711
|
+
*
|
|
712
|
+
* The layer name is what makes this survive a second platform: native replaces `layers` (a `div`
|
|
713
|
+
* becomes a `View`) and inherits the styles and the structure, because both address the name
|
|
714
|
+
* rather than the element.
|
|
715
|
+
*/
|
|
716
|
+
readonly 'element-insert': {
|
|
717
|
+
readonly input: z.ZodObject<{
|
|
718
|
+
path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
|
|
719
|
+
key: z.ZodOptional<z.ZodString>;
|
|
720
|
+
data: z.ZodPrefault<z.ZodObject<{
|
|
721
|
+
element: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
722
|
+
__ref: z.ZodString;
|
|
723
|
+
}, z.core.$strip>]>>;
|
|
724
|
+
parent: z.ZodOptional<z.ZodString>;
|
|
725
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
726
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
727
|
+
slotProp: z.ZodOptional<z.ZodString>;
|
|
728
|
+
visible: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
729
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
730
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
731
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
732
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
733
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
734
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
735
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
736
|
+
$state: z.ZodString;
|
|
737
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
738
|
+
$state: string;
|
|
739
|
+
not?: true | undefined;
|
|
740
|
+
eq?: unknown;
|
|
741
|
+
neq?: unknown;
|
|
742
|
+
gt?: number | undefined;
|
|
743
|
+
gte?: number | undefined;
|
|
744
|
+
lt?: number | undefined;
|
|
745
|
+
lte?: number | undefined;
|
|
746
|
+
}, {
|
|
747
|
+
$state: string;
|
|
748
|
+
not?: true | undefined;
|
|
749
|
+
eq?: unknown;
|
|
750
|
+
neq?: unknown;
|
|
751
|
+
gt?: number | undefined;
|
|
752
|
+
gte?: number | undefined;
|
|
753
|
+
lt?: number | undefined;
|
|
754
|
+
lte?: number | undefined;
|
|
755
|
+
}>>, z.ZodObject<{
|
|
756
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
757
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
758
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
759
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
760
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
761
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
762
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
763
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
764
|
+
$state: z.ZodString;
|
|
765
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
766
|
+
$state: string;
|
|
767
|
+
not?: true | undefined;
|
|
768
|
+
eq?: unknown;
|
|
769
|
+
neq?: unknown;
|
|
770
|
+
gt?: number | undefined;
|
|
771
|
+
gte?: number | undefined;
|
|
772
|
+
lt?: number | undefined;
|
|
773
|
+
lte?: number | undefined;
|
|
774
|
+
}, {
|
|
775
|
+
$state: string;
|
|
776
|
+
not?: true | undefined;
|
|
777
|
+
eq?: unknown;
|
|
778
|
+
neq?: unknown;
|
|
779
|
+
gt?: number | undefined;
|
|
780
|
+
gte?: number | undefined;
|
|
781
|
+
lt?: number | undefined;
|
|
782
|
+
lte?: number | undefined;
|
|
783
|
+
}>>>;
|
|
784
|
+
}, z.core.$strict>, z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
785
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
786
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
787
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
788
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
789
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
790
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
791
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
792
|
+
$state: z.ZodString;
|
|
793
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
794
|
+
$state: string;
|
|
795
|
+
not?: true | undefined;
|
|
796
|
+
eq?: unknown;
|
|
797
|
+
neq?: unknown;
|
|
798
|
+
gt?: number | undefined;
|
|
799
|
+
gte?: number | undefined;
|
|
800
|
+
lt?: number | undefined;
|
|
801
|
+
lte?: number | undefined;
|
|
802
|
+
}, {
|
|
803
|
+
$state: string;
|
|
804
|
+
not?: true | undefined;
|
|
805
|
+
eq?: unknown;
|
|
806
|
+
neq?: unknown;
|
|
807
|
+
gt?: number | undefined;
|
|
808
|
+
gte?: number | undefined;
|
|
809
|
+
lt?: number | undefined;
|
|
810
|
+
lte?: number | undefined;
|
|
811
|
+
}>>, z.ZodObject<{
|
|
812
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
813
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
814
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
815
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
816
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
817
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
818
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
819
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
820
|
+
$state: z.ZodString;
|
|
821
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
822
|
+
$state: string;
|
|
823
|
+
not?: true | undefined;
|
|
824
|
+
eq?: unknown;
|
|
825
|
+
neq?: unknown;
|
|
826
|
+
gt?: number | undefined;
|
|
827
|
+
gte?: number | undefined;
|
|
828
|
+
lt?: number | undefined;
|
|
829
|
+
lte?: number | undefined;
|
|
830
|
+
}, {
|
|
831
|
+
$state: string;
|
|
832
|
+
not?: true | undefined;
|
|
833
|
+
eq?: unknown;
|
|
834
|
+
neq?: unknown;
|
|
835
|
+
gt?: number | undefined;
|
|
836
|
+
gte?: number | undefined;
|
|
837
|
+
lt?: number | undefined;
|
|
838
|
+
lte?: number | undefined;
|
|
839
|
+
}>>>;
|
|
840
|
+
}, z.core.$strict>]>>, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
841
|
+
__ref: z.ZodString;
|
|
842
|
+
}, z.core.$strip>]>>, z.ZodTransform<{
|
|
843
|
+
$state: string;
|
|
844
|
+
eq?: unknown;
|
|
845
|
+
} | {
|
|
846
|
+
$state: string;
|
|
847
|
+
eq?: unknown;
|
|
848
|
+
}[], Record<string, string | number | boolean | {
|
|
849
|
+
__ref: string;
|
|
850
|
+
}>>>]>>;
|
|
851
|
+
text: z.ZodOptional<z.ZodString>;
|
|
852
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
853
|
+
slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
854
|
+
nodes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
855
|
+
element: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
856
|
+
__ref: z.ZodString;
|
|
857
|
+
}, z.core.$strip>]>>;
|
|
858
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
859
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
860
|
+
slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
861
|
+
visible: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
862
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
863
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
864
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
865
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
866
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
867
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
868
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
869
|
+
$state: z.ZodString;
|
|
870
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
871
|
+
$state: string;
|
|
872
|
+
not?: true | undefined;
|
|
873
|
+
eq?: unknown;
|
|
874
|
+
neq?: unknown;
|
|
875
|
+
gt?: number | undefined;
|
|
876
|
+
gte?: number | undefined;
|
|
877
|
+
lt?: number | undefined;
|
|
878
|
+
lte?: number | undefined;
|
|
879
|
+
}, {
|
|
880
|
+
$state: string;
|
|
881
|
+
not?: true | undefined;
|
|
882
|
+
eq?: unknown;
|
|
883
|
+
neq?: unknown;
|
|
884
|
+
gt?: number | undefined;
|
|
885
|
+
gte?: number | undefined;
|
|
886
|
+
lt?: number | undefined;
|
|
887
|
+
lte?: number | undefined;
|
|
888
|
+
}>>, z.ZodObject<{
|
|
889
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
890
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
891
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
892
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
893
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
894
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
895
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
896
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
897
|
+
$state: z.ZodString;
|
|
898
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
899
|
+
$state: string;
|
|
900
|
+
not?: true | undefined;
|
|
901
|
+
eq?: unknown;
|
|
902
|
+
neq?: unknown;
|
|
903
|
+
gt?: number | undefined;
|
|
904
|
+
gte?: number | undefined;
|
|
905
|
+
lt?: number | undefined;
|
|
906
|
+
lte?: number | undefined;
|
|
907
|
+
}, {
|
|
908
|
+
$state: string;
|
|
909
|
+
not?: true | undefined;
|
|
910
|
+
eq?: unknown;
|
|
911
|
+
neq?: unknown;
|
|
912
|
+
gt?: number | undefined;
|
|
913
|
+
gte?: number | undefined;
|
|
914
|
+
lt?: number | undefined;
|
|
915
|
+
lte?: number | undefined;
|
|
916
|
+
}>>>;
|
|
917
|
+
}, z.core.$strict>, z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
918
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
919
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
920
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
921
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
922
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
923
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
924
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
925
|
+
$state: z.ZodString;
|
|
926
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
927
|
+
$state: string;
|
|
928
|
+
not?: true | undefined;
|
|
929
|
+
eq?: unknown;
|
|
930
|
+
neq?: unknown;
|
|
931
|
+
gt?: number | undefined;
|
|
932
|
+
gte?: number | undefined;
|
|
933
|
+
lt?: number | undefined;
|
|
934
|
+
lte?: number | undefined;
|
|
935
|
+
}, {
|
|
936
|
+
$state: string;
|
|
937
|
+
not?: true | undefined;
|
|
938
|
+
eq?: unknown;
|
|
939
|
+
neq?: unknown;
|
|
940
|
+
gt?: number | undefined;
|
|
941
|
+
gte?: number | undefined;
|
|
942
|
+
lt?: number | undefined;
|
|
943
|
+
lte?: number | undefined;
|
|
944
|
+
}>>, z.ZodObject<{
|
|
945
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
946
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
947
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
948
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
949
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
950
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
951
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
952
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
953
|
+
$state: z.ZodString;
|
|
954
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
955
|
+
$state: string;
|
|
956
|
+
not?: true | undefined;
|
|
957
|
+
eq?: unknown;
|
|
958
|
+
neq?: unknown;
|
|
959
|
+
gt?: number | undefined;
|
|
960
|
+
gte?: number | undefined;
|
|
961
|
+
lt?: number | undefined;
|
|
962
|
+
lte?: number | undefined;
|
|
963
|
+
}, {
|
|
964
|
+
$state: string;
|
|
965
|
+
not?: true | undefined;
|
|
966
|
+
eq?: unknown;
|
|
967
|
+
neq?: unknown;
|
|
968
|
+
gt?: number | undefined;
|
|
969
|
+
gte?: number | undefined;
|
|
970
|
+
lt?: number | undefined;
|
|
971
|
+
lte?: number | undefined;
|
|
972
|
+
}>>>;
|
|
973
|
+
}, z.core.$strict>]>>, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
974
|
+
__ref: z.ZodString;
|
|
975
|
+
}, z.core.$strip>]>>, z.ZodTransform<{
|
|
976
|
+
$state: string;
|
|
977
|
+
eq?: unknown;
|
|
978
|
+
} | {
|
|
979
|
+
$state: string;
|
|
980
|
+
eq?: unknown;
|
|
981
|
+
}[], Record<string, string | number | boolean | {
|
|
982
|
+
__ref: string;
|
|
983
|
+
}>>>]>>;
|
|
984
|
+
text: z.ZodOptional<z.ZodString>;
|
|
985
|
+
}, z.core.$strict>>>;
|
|
986
|
+
subtree: z.ZodOptional<z.ZodObject<{
|
|
987
|
+
root: z.ZodString;
|
|
988
|
+
elements: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
989
|
+
element: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
990
|
+
__ref: z.ZodString;
|
|
991
|
+
}, z.core.$strip>]>>;
|
|
992
|
+
props: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
993
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
994
|
+
slots: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
995
|
+
visible: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
996
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
997
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
998
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
999
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
1000
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
1001
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
1002
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
1003
|
+
$state: z.ZodString;
|
|
1004
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
1005
|
+
$state: string;
|
|
1006
|
+
not?: true | undefined;
|
|
1007
|
+
eq?: unknown;
|
|
1008
|
+
neq?: unknown;
|
|
1009
|
+
gt?: number | undefined;
|
|
1010
|
+
gte?: number | undefined;
|
|
1011
|
+
lt?: number | undefined;
|
|
1012
|
+
lte?: number | undefined;
|
|
1013
|
+
}, {
|
|
1014
|
+
$state: string;
|
|
1015
|
+
not?: true | undefined;
|
|
1016
|
+
eq?: unknown;
|
|
1017
|
+
neq?: unknown;
|
|
1018
|
+
gt?: number | undefined;
|
|
1019
|
+
gte?: number | undefined;
|
|
1020
|
+
lt?: number | undefined;
|
|
1021
|
+
lte?: number | undefined;
|
|
1022
|
+
}>>, z.ZodObject<{
|
|
1023
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
1024
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1025
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
1026
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
1027
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
1028
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
1029
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
1030
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
1031
|
+
$state: z.ZodString;
|
|
1032
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
1033
|
+
$state: string;
|
|
1034
|
+
not?: true | undefined;
|
|
1035
|
+
eq?: unknown;
|
|
1036
|
+
neq?: unknown;
|
|
1037
|
+
gt?: number | undefined;
|
|
1038
|
+
gte?: number | undefined;
|
|
1039
|
+
lt?: number | undefined;
|
|
1040
|
+
lte?: number | undefined;
|
|
1041
|
+
}, {
|
|
1042
|
+
$state: string;
|
|
1043
|
+
not?: true | undefined;
|
|
1044
|
+
eq?: unknown;
|
|
1045
|
+
neq?: unknown;
|
|
1046
|
+
gt?: number | undefined;
|
|
1047
|
+
gte?: number | undefined;
|
|
1048
|
+
lt?: number | undefined;
|
|
1049
|
+
lte?: number | undefined;
|
|
1050
|
+
}>>>;
|
|
1051
|
+
}, z.core.$strict>, z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
|
|
1052
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1053
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
1054
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
1055
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
1056
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
1057
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
1058
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
1059
|
+
$state: z.ZodString;
|
|
1060
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
1061
|
+
$state: string;
|
|
1062
|
+
not?: true | undefined;
|
|
1063
|
+
eq?: unknown;
|
|
1064
|
+
neq?: unknown;
|
|
1065
|
+
gt?: number | undefined;
|
|
1066
|
+
gte?: number | undefined;
|
|
1067
|
+
lt?: number | undefined;
|
|
1068
|
+
lte?: number | undefined;
|
|
1069
|
+
}, {
|
|
1070
|
+
$state: string;
|
|
1071
|
+
not?: true | undefined;
|
|
1072
|
+
eq?: unknown;
|
|
1073
|
+
neq?: unknown;
|
|
1074
|
+
gt?: number | undefined;
|
|
1075
|
+
gte?: number | undefined;
|
|
1076
|
+
lt?: number | undefined;
|
|
1077
|
+
lte?: number | undefined;
|
|
1078
|
+
}>>, z.ZodObject<{
|
|
1079
|
+
$or: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
1080
|
+
not: z.ZodOptional<z.ZodLiteral<true>>;
|
|
1081
|
+
eq: z.ZodOptional<z.ZodUnknown>;
|
|
1082
|
+
neq: z.ZodOptional<z.ZodUnknown>;
|
|
1083
|
+
gt: z.ZodOptional<z.ZodNumber>;
|
|
1084
|
+
gte: z.ZodOptional<z.ZodNumber>;
|
|
1085
|
+
lt: z.ZodOptional<z.ZodNumber>;
|
|
1086
|
+
lte: z.ZodOptional<z.ZodNumber>;
|
|
1087
|
+
$state: z.ZodString;
|
|
1088
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
1089
|
+
$state: string;
|
|
1090
|
+
not?: true | undefined;
|
|
1091
|
+
eq?: unknown;
|
|
1092
|
+
neq?: unknown;
|
|
1093
|
+
gt?: number | undefined;
|
|
1094
|
+
gte?: number | undefined;
|
|
1095
|
+
lt?: number | undefined;
|
|
1096
|
+
lte?: number | undefined;
|
|
1097
|
+
}, {
|
|
1098
|
+
$state: string;
|
|
1099
|
+
not?: true | undefined;
|
|
1100
|
+
eq?: unknown;
|
|
1101
|
+
neq?: unknown;
|
|
1102
|
+
gt?: number | undefined;
|
|
1103
|
+
gte?: number | undefined;
|
|
1104
|
+
lt?: number | undefined;
|
|
1105
|
+
lte?: number | undefined;
|
|
1106
|
+
}>>>;
|
|
1107
|
+
}, z.core.$strict>]>>, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1108
|
+
__ref: z.ZodString;
|
|
1109
|
+
}, z.core.$strip>]>>, z.ZodTransform<{
|
|
1110
|
+
$state: string;
|
|
1111
|
+
eq?: unknown;
|
|
1112
|
+
} | {
|
|
1113
|
+
$state: string;
|
|
1114
|
+
eq?: unknown;
|
|
1115
|
+
}[], Record<string, string | number | boolean | {
|
|
1116
|
+
__ref: string;
|
|
1117
|
+
}>>>]>>;
|
|
1118
|
+
text: z.ZodOptional<z.ZodString>;
|
|
1119
|
+
}, z.core.$strict>>;
|
|
1120
|
+
}, z.core.$strip>>;
|
|
1121
|
+
}, z.core.$strip>>;
|
|
1122
|
+
}, z.core.$strip>;
|
|
1123
|
+
readonly readOnly: false;
|
|
1124
|
+
readonly label: "Add element";
|
|
1125
|
+
readonly description: "Add an element to a component: creates the LAYER it is styled through and the anatomy node that places it, under `parent`.";
|
|
1126
|
+
readonly scope: "item";
|
|
1127
|
+
readonly creates: true;
|
|
1128
|
+
readonly title: (entity: string) => string;
|
|
1129
|
+
readonly handler: (input: Record<string, unknown>, config: Config) => Config;
|
|
1130
|
+
};
|
|
1131
|
+
/**
|
|
1132
|
+
* Remove an element from a composition — the node, its layer, and everything that named it.
|
|
1133
|
+
*
|
|
1134
|
+
* A custom op for the same reason `element-insert` is: it writes more than one thing and either
|
|
1135
|
+
* half alone is broken. `sub-delete/layers` drops the layer and leaves the anatomy node holding
|
|
1136
|
+
* a dangling `layer:<key>` ref, its parent's `children` still naming it, and every style rule
|
|
1137
|
+
* still carrying a bag for a layer that no longer exists. `sub-delete/anatomy` leaves the parent
|
|
1138
|
+
* edge — a value the stored `children` enum would now refuse on the next write to that node.
|
|
1139
|
+
*
|
|
1140
|
+
* The rule bags are the part `orphans` cannot express: a rule targeting a deleted layer is not
|
|
1141
|
+
* itself orphaned (it has other layers to style), so what has to go is the layer's entry inside
|
|
1142
|
+
* each rule. That is a delta, which is what the merge verb is for — the rule is left alone when
|
|
1143
|
+
* it still styles something and pruned by the caller's own `sub-delete` when it doesn't.
|
|
1144
|
+
*/
|
|
1145
|
+
readonly 'element-delete': {
|
|
1146
|
+
readonly input: z.ZodObject<{
|
|
1147
|
+
path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
|
|
1148
|
+
key: z.ZodString;
|
|
1149
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
1150
|
+
subtree: z.ZodDefault<z.ZodBoolean>;
|
|
1151
|
+
}, z.core.$strip>>;
|
|
1152
|
+
}, z.core.$strip>;
|
|
1153
|
+
readonly readOnly: false;
|
|
1154
|
+
readonly label: "Remove element";
|
|
1155
|
+
readonly description: "Remove an element from a component: its anatomy node, the layer it is styled through, its subtree, every parent edge naming it, and its entry in every style rule.";
|
|
1156
|
+
readonly scope: "item";
|
|
1157
|
+
readonly approval: "destructive";
|
|
1158
|
+
readonly title: (entity: string) => string;
|
|
1159
|
+
readonly handler: (input: Record<string, unknown>, config: Config) => Config;
|
|
1160
|
+
};
|
|
1161
|
+
/**
|
|
1162
|
+
* Move a node to a different parent, or to a different place under the same one.
|
|
1163
|
+
*
|
|
1164
|
+
* Sibling order lives in a parent's `children`, so a move is two updates — one per parent — and
|
|
1165
|
+
* both have to land or the node is in neither list or in both.
|
|
1166
|
+
*
|
|
1167
|
+
* A node can also be held by a slot rather than a child edge (`slots: { icon: [key] }`),
|
|
1168
|
+
* and a move treats both as the home being left: every child edge naming the key is detached,
|
|
1169
|
+
* and every stale slot entry naming it is cleared, whichever new home the move names. With
|
|
1170
|
+
* `slotProp` the new home is the parent's slot instead of its `children` — the same statement
|
|
1171
|
+
* `element-insert` makes about a new node, made about one that already exists, so the moved
|
|
1172
|
+
* element keeps its key, props, styles and subtree.
|
|
1173
|
+
*/
|
|
1174
|
+
readonly 'element-move': {
|
|
1175
|
+
readonly input: z.ZodObject<{
|
|
1176
|
+
path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
|
|
1177
|
+
key: z.ZodString;
|
|
1178
|
+
data: z.ZodPrefault<z.ZodObject<{
|
|
1179
|
+
parent: z.ZodDefault<z.ZodString>;
|
|
1180
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
1181
|
+
slotProp: z.ZodOptional<z.ZodString>;
|
|
1182
|
+
}, z.core.$strip>>;
|
|
1183
|
+
}, z.core.$strip>;
|
|
1184
|
+
readonly readOnly: false;
|
|
1185
|
+
readonly label: "Move element";
|
|
1186
|
+
readonly description: "Move a component's anatomy node under a different parent, to a different position under the same one, or — with `slotProp` — into a parent's slot.";
|
|
1187
|
+
readonly scope: "item";
|
|
1188
|
+
readonly approval: "reference-change";
|
|
1189
|
+
readonly title: (entity: string) => string;
|
|
1190
|
+
readonly handler: (input: Record<string, unknown>, config: Config) => Config;
|
|
1191
|
+
};
|
|
1192
|
+
readonly validate: {
|
|
1193
|
+
readonly input: z.ZodObject<{
|
|
1194
|
+
path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
|
|
1195
|
+
data: z.ZodObject<{
|
|
1196
|
+
props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1197
|
+
}, z.core.$strip>;
|
|
1198
|
+
}, z.core.$strip>;
|
|
1199
|
+
readonly readOnly: true;
|
|
1200
|
+
readonly label: "Validate props";
|
|
1201
|
+
readonly description: "Check a bag of prop VALUES against a component — rejects unknown props and out-of-domain values.";
|
|
1202
|
+
readonly scope: "item";
|
|
1203
|
+
readonly title: (entity: string) => string;
|
|
1204
|
+
readonly example: ({
|
|
1205
|
+
config,
|
|
1206
|
+
path
|
|
1207
|
+
}: {
|
|
1208
|
+
config: Config;
|
|
1209
|
+
kind: string;
|
|
1210
|
+
path: string;
|
|
1211
|
+
}) => {
|
|
1212
|
+
path: string;
|
|
1213
|
+
data: {
|
|
1214
|
+
props: Record<string, unknown>;
|
|
1215
|
+
};
|
|
1216
|
+
};
|
|
1217
|
+
readonly handler: (input: Record<string, unknown>, config: Config) => string[];
|
|
1218
|
+
};
|
|
1219
|
+
}, {
|
|
1220
|
+
/**
|
|
1221
|
+
* The prop names an instance may fill through a spec element's `slots` field — every prop that
|
|
1222
|
+
* routes content: a `slot`, or a `forward` whose far end takes content. Resolved over the
|
|
1223
|
+
* inheritance chain, since an inherited slot is as fillable as a declared one. This is the
|
|
1224
|
+
* `slots: string[]` json-render's catalog metadata declares per component, computed here so the
|
|
1225
|
+
* emitted catalog, the validator, and every picker read one answer.
|
|
1226
|
+
*/
|
|
1227
|
+
readonly slots: ({
|
|
1228
|
+
config,
|
|
1229
|
+
path,
|
|
1230
|
+
member
|
|
1231
|
+
}: ComputedInput) => string[];
|
|
1232
|
+
}, false>;
|
|
1233
|
+
type ComponentRefDelta = Parameters<ReturnType<(typeof ComponentEntity)['ref']>['extend']>[0];
|
|
1234
|
+
type ExactComponentDelta<Delta> = Delta & { [Key in Exclude<keyof Delta, keyof ComponentRefDelta>]: never };
|
|
1235
|
+
type ContractLayers<Contract> = Contract extends {
|
|
1236
|
+
layers: infer Layers;
|
|
1237
|
+
} ? Layers extends LayerMap ? Layers : LayerMap : LayerMap;
|
|
1238
|
+
type ContractProps<Contract> = Contract extends {
|
|
1239
|
+
props: infer Props;
|
|
1240
|
+
} ? Props extends PropMap ? Props : PropMap : PropMap;
|
|
1241
|
+
type ResolvedLayers<Contract, Delta> = Delta extends {
|
|
1242
|
+
readonly layers: infer Layers;
|
|
1243
|
+
} ? Layers extends LayerMap ? Layers : ContractLayers<Contract> : ContractLayers<Contract>;
|
|
1244
|
+
type ResolvedProps<Contract, Delta> = Delta extends {
|
|
1245
|
+
readonly props: infer Props;
|
|
1246
|
+
} ? Props extends PropMap ? Props : ContractProps<Contract> : ContractProps<Contract>;
|
|
1247
|
+
type ResolvedDefaults<Contract, Delta> = Delta extends {
|
|
1248
|
+
readonly defaultProps: infer Defaults;
|
|
1249
|
+
} ? Defaults : Contract extends {
|
|
1250
|
+
defaultProps: infer Defaults;
|
|
1251
|
+
} ? Defaults : Record<never, never>;
|
|
1252
|
+
type ResolvedForwards<Contract, Delta> = Delta extends {
|
|
1253
|
+
readonly forwards: infer Forwards;
|
|
1254
|
+
} ? Forwards : Contract extends {
|
|
1255
|
+
forwards: infer Forwards;
|
|
1256
|
+
} ? Forwards : Record<never, never>;
|
|
1257
|
+
type ForwardedLayerNames<Contract, Delta> = ResolvedForwards<Contract, Delta> extends Record<string, unknown> ? keyof ResolvedForwards<Contract, Delta> & string : never;
|
|
1258
|
+
/** The source-only half of a linked component extension. The callback is deliberately absent from
|
|
1259
|
+
* {@link ExtendedRef}: it is code, so ts-morph reads it from the authoring file while Config stores
|
|
1260
|
+
* only `{ __ref, extend }`. */
|
|
1261
|
+
type ExtendedComponentRef<Contract = ComponentContractOf<string>, Delta extends ComponentRefDelta = ComponentRefDelta, Extra = Record<never, never>> = ExtendedRef<Delta> & {
|
|
1262
|
+
/** Phantom component signature: codegen replaces the authoring value before it is rendered, but
|
|
1263
|
+
* this lets `ComponentProps<typeof Button>` see the inherited and locally replaced contract. */
|
|
1264
|
+
(props: ComponentPropsOf<ResolvedLayers<Contract, Delta>, ResolvedProps<Contract, Delta>, ResolvedDefaults<Contract, Delta>, Extra, ForwardedLayerNames<Contract, Delta>>): null;
|
|
1265
|
+
render<E = Extra>(fn: (args: RenderArgs<ResolvedLayers<Contract, Delta>, ResolvedProps<Contract, Delta>> & E) => unknown): ExtendedComponentRef<Contract, Delta, E>;
|
|
1266
|
+
/**
|
|
1267
|
+
* Style rules for the extension, typed against the layers it ends up with — the linked contract's,
|
|
1268
|
+
* with the delta's replacing them when it declares its own.
|
|
1269
|
+
*
|
|
1270
|
+
* Chained rather than a `styles` key inside `extend`, and that is the whole point: a key in the same
|
|
1271
|
+
* object literal is checked against the same wide type as everything else there, so a rule naming a
|
|
1272
|
+
* layer that does not exist typechecked. `extend` has already fixed `Delta` by the time this is
|
|
1273
|
+
* called, so `ResolvedLayers` is known and a bad layer name is an error — the same reason
|
|
1274
|
+
* `defineComponent` is a chain instead of one object argument.
|
|
1275
|
+
*/
|
|
1276
|
+
styles(rules: readonly StyleRuleInput<ResolvedLayers<Contract, Delta>>[]): ExtendedComponentRef<Contract, Delta, Extra>;
|
|
1277
|
+
};
|
|
1278
|
+
type ComponentReference<Contract = ComponentContractOf<string>> = Ref & {
|
|
1279
|
+
extend<const Delta extends ComponentRefDelta>(delta: ExactComponentDelta<Delta>): ExtendedComponentRef<Contract, Delta>;
|
|
1280
|
+
};
|
|
1281
|
+
/** Component keeps the generic entity surface; only its ref authoring result knows about the
|
|
1282
|
+
* source-only `.render()` step. */
|
|
1283
|
+
declare const Component: Omit<typeof ComponentEntity, "ref"> & {
|
|
1284
|
+
ref<const Path extends PathOf<"component">>(path: Path): ComponentReference<ComponentContractOf<Path>>;
|
|
1285
|
+
};
|
|
1286
|
+
//#endregion
|
|
1287
|
+
export { AuthoredPropBody, Component, ComponentBody, ComponentElementBody, ComponentPropBody, ComponentReference, ComponentStyleBody, ElementVisibility, ElementVisibilityInput, ExtendedComponentRef, ProjectedVisibility, VariantValueBody, VariantValues, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef };
|