@yahoo/uds-create-config 2.45.0 → 3.0.1
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
package/dist/Config.d.ts
DELETED
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import { CssVarRef } from "./types/css-values.js";
|
|
2
|
-
import { AnyStylePropDefinition, BuildOptions, CanvasRole, CanvasRoleEntry, CanvasRolesDefinitionInput, CanvasRolesInputConstraint, ComponentDefinition, ComponentGroupDefinition, CompositeStyleDefinition, GlobalStylesDef, LinkedSystemPin, LinkedSystemsInput, ModeDefinition, ModifierDefinition, MotionDefinitionInput, PlaygroundOptions, SerializedConfig, SystemLink, TokenGroupDefinition, TokenModifierKey } from "./types.js";
|
|
3
|
-
import { AssetGroupDefinition } from "./defineAssetGroup.js";
|
|
4
|
-
import { AssetGroup } from "./AssetGroup.js";
|
|
5
|
-
import { cssVar } from "./brands.js";
|
|
6
|
-
import { Component } from "./Component.js";
|
|
7
|
-
import { ComponentGroup } from "./ComponentGroup.js";
|
|
8
|
-
import { CompositeStyle } from "./CompositeStyle.js";
|
|
9
|
-
import { kebabCase } from "./entity-utils.js";
|
|
10
|
-
import { ProviderComponent } from "./factories.js";
|
|
11
|
-
import { Mode, ModeOption } from "./Mode.js";
|
|
12
|
-
import { Modifier } from "./Modifier.js";
|
|
13
|
-
import { MotionDef } from "./MotionDef.js";
|
|
14
|
-
import { Provider } from "./Provider.js";
|
|
15
|
-
import { Token } from "./Token.js";
|
|
16
|
-
import { StyleProp } from "./StyleProp.js";
|
|
17
|
-
import { TokenGroup } from "./TokenGroup.js";
|
|
18
|
-
|
|
19
|
-
//#region src/Config.d.ts
|
|
20
|
-
/**
|
|
21
|
-
* The entity kinds the dependency graph addresses — the discriminant for both
|
|
22
|
-
* {@link Config.dependentsOf} (inbound) and {@link Config.dependenciesOf}
|
|
23
|
-
* (outbound), and the single source of truth for the surface. The query unions
|
|
24
|
-
* are mapped over this type, so adding a kind here automatically widens both
|
|
25
|
-
* queries, which makes each method's `switch` non-exhaustive — its trailing
|
|
26
|
-
* `assertNever(query)` then fails to compile until a `case` is added. A new
|
|
27
|
-
* kind therefore can't ship without logic in *both* directions.
|
|
28
|
-
*/
|
|
29
|
-
type DependencyKind = 'component' | 'compositeStyle' | 'styleProp' | 'modifier' | 'token' | 'tokenGroup';
|
|
30
|
-
/**
|
|
31
|
-
* A tagged node in a dependency result. `value` is populated only for a
|
|
32
|
-
* style-prop *keyword* edge — `{ kind: 'styleProp', name: 'display', value:
|
|
33
|
-
* 'flex' }` — where the prop alone doesn't identify the dependency.
|
|
34
|
-
*/
|
|
35
|
-
interface DependencyRef {
|
|
36
|
-
readonly kind: DependencyKind;
|
|
37
|
-
readonly name: string;
|
|
38
|
-
readonly value?: string;
|
|
39
|
-
}
|
|
40
|
-
/** Per-kind edge-narrowing options for the inbound {@link DependentsQuery}.
|
|
41
|
-
* Only kinds that take options appear here; the rest get none. */
|
|
42
|
-
interface DependentsOptionsByKind {
|
|
43
|
-
/** Narrow to components that use this keyword *value* of the prop
|
|
44
|
-
* (`display`=`flex`) for value-removal impact; omit for the components that
|
|
45
|
-
* expose the prop. */
|
|
46
|
-
styleProp: {
|
|
47
|
-
value?: string;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/** Inbound query for {@link Config.dependentsOf} — "what references this?".
|
|
51
|
-
* Mapped over {@link DependencyKind} so it always covers every kind. */
|
|
52
|
-
type DependentsQuery = { [K in DependencyKind]: {
|
|
53
|
-
kind: K;
|
|
54
|
-
name: string;
|
|
55
|
-
} & (K extends keyof DependentsOptionsByKind ? DependentsOptionsByKind[K] : unknown) }[DependencyKind];
|
|
56
|
-
/** Outbound query for {@link Config.dependenciesOf} — "what does this use?".
|
|
57
|
-
* Mapped over {@link DependencyKind} for the same exhaustiveness guarantee. */
|
|
58
|
-
type DependenciesQuery = { [K in DependencyKind]: {
|
|
59
|
-
kind: K;
|
|
60
|
-
name: string;
|
|
61
|
-
} }[DependencyKind];
|
|
62
|
-
declare class Config {
|
|
63
|
-
#private;
|
|
64
|
-
static readonly SCHEMA_VERSION = 1;
|
|
65
|
-
readonly platform: "web";
|
|
66
|
-
prefix: string;
|
|
67
|
-
/**
|
|
68
|
-
* Registry namespace — a stable, `package.json`-style identifier
|
|
69
|
-
* (`uds`, `@acme/system`) that namespaces every component's
|
|
70
|
-
* `registryKey` as `<namespace>:<ComponentName>` (the spec `type`).
|
|
71
|
-
* Declared in `uds.config.ts` via `configure({ namespace })` so it's
|
|
72
|
-
* available at build time; the push pipeline validates it for
|
|
73
|
-
* uniqueness / ownership. `undefined` ⇒ components keep bare-name
|
|
74
|
-
* registry keys. See Linear doc "RFC: Registry-namespaced component
|
|
75
|
-
* types".
|
|
76
|
-
*/
|
|
77
|
-
namespace?: string;
|
|
78
|
-
preflight: boolean;
|
|
79
|
-
globalStyles: GlobalStylesDef;
|
|
80
|
-
rawCss: string[];
|
|
81
|
-
designPrinciples: string[];
|
|
82
|
-
buildOptions: BuildOptions;
|
|
83
|
-
/** Root-config playground settings authored via `configure({ playgroundOptions })`. */
|
|
84
|
-
playgroundOptions: PlaygroundOptions;
|
|
85
|
-
readonly tokenGroups: Map<string, TokenGroup>;
|
|
86
|
-
readonly styleProps: Map<string, StyleProp>;
|
|
87
|
-
readonly modifiers: Map<`_${string}`, Modifier>;
|
|
88
|
-
readonly modes: Map<string, Mode>;
|
|
89
|
-
readonly compositeStyles: Map<string, CompositeStyle>;
|
|
90
|
-
readonly components: Map<string, Component>;
|
|
91
|
-
readonly componentGroups: Map<string, ComponentGroup>;
|
|
92
|
-
readonly assetGroups: Map<string, AssetGroup>;
|
|
93
|
-
readonly providers: Map<string, Provider>;
|
|
94
|
-
readonly motion: Map<string, MotionDef>;
|
|
95
|
-
readonly canvasRoles: Map<CanvasRole, readonly CanvasRoleEntry[]>;
|
|
96
|
-
/**
|
|
97
|
-
* Source systems pinned via {@link registerLinkedSystems}, keyed by the
|
|
98
|
-
* source system's database UUID. A pin anchors every linked value from that
|
|
99
|
-
* system to one exact published version — registration validates each
|
|
100
|
-
* link-marked value against it.
|
|
101
|
-
*/
|
|
102
|
-
readonly linkedSystems: Map<string, LinkedSystemPin>;
|
|
103
|
-
/**
|
|
104
|
-
* Supply the closure-accurate node prefix assignment (build sites know the
|
|
105
|
-
* full transitive closure; the pins-derived fallback below only sees direct
|
|
106
|
-
* pins). Affects how system-scoped refs without consumer entries derive.
|
|
107
|
-
*/
|
|
108
|
-
setLinkedNodePrefixes(prefixes: ReadonlyMap<string, string>): this;
|
|
109
|
-
/**
|
|
110
|
-
* The CSS prefix a pinned system's regenerated node sheet uses — the var
|
|
111
|
-
* namespace a system-scoped ref resolves into when no consumer entry
|
|
112
|
-
* exists. Explicit build-supplied assignment wins; otherwise derived from
|
|
113
|
-
* the direct pins with the same pure assignment the build uses (identical
|
|
114
|
-
* for directly pinned systems, which are the only ones payload refs may
|
|
115
|
-
* name). Null when the system isn't pinned.
|
|
116
|
-
*/
|
|
117
|
-
linkedNodeVarPrefix(systemId: string, version?: string): string | null;
|
|
118
|
-
/**
|
|
119
|
-
* Set top-level config metadata in one call — the single scalar-setter,
|
|
120
|
-
* replacing the former `withPrefix` / `withPreflight` / `withName` /
|
|
121
|
-
* `withDesignPrinciples` / `withBuildOptions` chain. Partial: only
|
|
122
|
-
* provided keys are applied, so it can run once or be merged across
|
|
123
|
-
* calls. `globalStyles` stays on `defineGlobalStyles` — its callback
|
|
124
|
-
* form needs the derived token refs, so it doesn't fit a plain bag.
|
|
125
|
-
*
|
|
126
|
-
* - `namespace` — the registry namespace (`uds`, `@acme/system`) that
|
|
127
|
-
* namespaces every component's `registryKey` as `<namespace>:<Component>`.
|
|
128
|
-
* Declared in `uds.config.ts` (the `package.json`-`name` model) so it's
|
|
129
|
-
* available at build time; the push pipeline additionally validates it
|
|
130
|
-
* for uniqueness / ownership. Throws on a structurally invalid value
|
|
131
|
-
* (the `:` separator, whitespace, or empty).
|
|
132
|
-
* - `prefix` — class-name + CSS-variable prefix (default `uds`); invalidates
|
|
133
|
-
* derived. Pass `''` or `false` to opt out entirely — classes and vars
|
|
134
|
-
* emit unprefixed (`bg-primary`, `--color-brand`). `false` is sugar for
|
|
135
|
-
* `''`, normalized to the empty string here so the value stays a string.
|
|
136
|
-
* - `preflight` — include Tailwind's reset (default `true`).
|
|
137
|
-
* - `designPrinciples` — freeform strings surfaced in the AI prompt.
|
|
138
|
-
* - `buildOptions` — shallow-merged into existing build options.
|
|
139
|
-
* - `playgroundOptions` — pages directory + settings for `uds dev --playground`
|
|
140
|
-
* (replaces the value wholesale, like `designPrinciples`).
|
|
141
|
-
*/
|
|
142
|
-
configure(options: {
|
|
143
|
-
namespace?: string;
|
|
144
|
-
prefix?: string | false;
|
|
145
|
-
preflight?: boolean;
|
|
146
|
-
designPrinciples?: readonly string[];
|
|
147
|
-
buildOptions?: BuildOptions;
|
|
148
|
-
playgroundOptions?: PlaygroundOptions;
|
|
149
|
-
}): this;
|
|
150
|
-
/**
|
|
151
|
-
* Resolve a spec element `type` (or any component identifier) to its
|
|
152
|
-
* {@link Component}, namespace-aware and backwards-compatible.
|
|
153
|
-
*
|
|
154
|
-
* `components` is keyed by the bare `name`, so:
|
|
155
|
-
* - an exact match is tried first — a bare `'Badge'` resolves directly,
|
|
156
|
-
* keeping every existing bare-name lookup working;
|
|
157
|
-
* - otherwise a namespaced registry key (`'<namespace>:<name>'`, the spec
|
|
158
|
-
* `type`) resolves by its bare name **only when the namespace is this
|
|
159
|
-
* registry's own**. A key from a different registry (`'other:Badge'`)
|
|
160
|
-
* deliberately does not resolve, so specs from multiple registries can
|
|
161
|
-
* coexist without colliding on a shared bare name.
|
|
162
|
-
*
|
|
163
|
-
* Returns `undefined` for unknown types and foreign (`foreign:`) sentinels.
|
|
164
|
-
* This is the single resolution path consumers should use instead of
|
|
165
|
-
* `config.components.get(type)` when `type` may be a spec/registry key.
|
|
166
|
-
*/
|
|
167
|
-
getComponent(type: string): Component | undefined;
|
|
168
|
-
/**
|
|
169
|
-
* The bare, human-readable component name for a spec `type` — strips this
|
|
170
|
-
* registry's `<namespace>:` prefix (`'uds:Text'` → `'Text'`) for display, and
|
|
171
|
-
* the `foreign:` sentinel third-party leaves carry (`'foreign:CopyIcon'` →
|
|
172
|
-
* `'CopyIcon'`) — that prefix marks "not a UDS component," not a peer system,
|
|
173
|
-
* so the bare name is what every display surface wants. A bare type, an
|
|
174
|
-
* unknown type, or a key from another *peer* registry (`@acme/system:Button`)
|
|
175
|
-
* is returned unchanged — there the prefix is meaningful disambiguation.
|
|
176
|
-
*/
|
|
177
|
-
componentDisplayName(type: string): string;
|
|
178
|
-
/**
|
|
179
|
-
* Components whose catalog `metadata.label` matches `label` (case-insensitive)
|
|
180
|
-
* — the display-name lookup that complements `getComponent` (registry key).
|
|
181
|
-
* Returns an array because labels aren't unique: a collision-dodging export
|
|
182
|
-
* (`StudioListItem` with `label: 'ListItem'`) can share a label with another
|
|
183
|
-
* component's key, so callers must handle 0, 1, or many. Empty when no label
|
|
184
|
-
* matches.
|
|
185
|
-
*/
|
|
186
|
-
getComponentsByLabel(label: string): Component[];
|
|
187
|
-
/**
|
|
188
|
-
* Style props that emit a given CSS property — the reverse of
|
|
189
|
-
* `StyleProp.cssProperty`. A property can be served by more than one prop
|
|
190
|
-
* (e.g. `border-color` by `borderColor`, `divideColor`; `margin-top` by both
|
|
191
|
-
* the positive `marginTop` and the `negative` `offsetTop`). Match is exact on
|
|
192
|
-
* the CSS property name; a prop targeting several properties matches any.
|
|
193
|
-
*
|
|
194
|
-
* `negative` props are ordered LAST, so a caller taking the first match
|
|
195
|
-
* (`getStylePropsByCssProperty(css)[0]`) always gets the primary, positive
|
|
196
|
-
* prop — the negative variant is only the first result when it's the sole
|
|
197
|
-
* prop for that property. Registration order is preserved within each group.
|
|
198
|
-
*
|
|
199
|
-
* Pass `opts.negative` to filter explicitly: `{ negative: false }` for only
|
|
200
|
-
* positive props, `{ negative: true }` for only the negative variant(s) (e.g.
|
|
201
|
-
* the `offsetTop` behind `margin-top`). Omit it to get every match.
|
|
202
|
-
*/
|
|
203
|
-
getStylePropsByCssProperty(cssProperty: string, opts?: {
|
|
204
|
-
negative?: boolean;
|
|
205
|
-
}): StyleProp[];
|
|
206
|
-
/**
|
|
207
|
-
* Resolve the `StyleProp` behind a component's JSX prop, following any
|
|
208
|
-
* re-alias. A component can expose a style prop under a different JSX name
|
|
209
|
-
* than the registry key — `Box`'s `backgroundColor` prop binds
|
|
210
|
-
* `styleProp('bg')` — so this maps the on-component name back to the
|
|
211
|
-
* registered `StyleProp`. Returns `undefined` if the component has no such
|
|
212
|
-
* style prop.
|
|
213
|
-
*/
|
|
214
|
-
getComponentStyleProp(componentName: string, jsxProp: string): StyleProp | undefined;
|
|
215
|
-
/**
|
|
216
|
-
* Aggregate token-usage stats across the whole registry — how many tokens
|
|
217
|
-
* are referenced *somewhere* (components, other tokens, or composite styles;
|
|
218
|
-
* see {@link Config.#referencedTokenNames}) vs not. `usagePercent` is
|
|
219
|
-
* rounded; `0` total tokens reports `0%`.
|
|
220
|
-
*/
|
|
221
|
-
tokenUsageStats(): {
|
|
222
|
-
total: number;
|
|
223
|
-
used: number;
|
|
224
|
-
unused: number;
|
|
225
|
-
usagePercent: number;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* Token values ranked by how often they appear across component base styles —
|
|
229
|
-
* the aggregate "what's load-bearing?" companion to `dependentsOf('token')`.
|
|
230
|
-
* `opts.property` narrows to one CSS property. Descends into `_<modifier>`
|
|
231
|
-
* sub-objects so a value used only in a hover/dark state still counts.
|
|
232
|
-
*/
|
|
233
|
-
tokenValueUsage(opts?: {
|
|
234
|
-
property?: string;
|
|
235
|
-
}): Array<{
|
|
236
|
-
value: string;
|
|
237
|
-
count: number;
|
|
238
|
-
property: string;
|
|
239
|
-
}>;
|
|
240
|
-
/**
|
|
241
|
-
* The reverse-dependency read surface — "what references this entity, and
|
|
242
|
-
* would break if I delete or rename it?" — uniform across every kind. One
|
|
243
|
-
* public entry point: callers dispatch by `kind` and get a single tagged
|
|
244
|
-
* list (the affected entities, each with its own kind), never a per-kind
|
|
245
|
-
* bespoke shape. The relation is always *references to the entity*; the
|
|
246
|
-
* per-kind walks behind it are private slices.
|
|
247
|
-
*
|
|
248
|
-
* A `token` resolves to BOTH the components that reference it AND the tokens
|
|
249
|
-
* that alias or mode-override it — a token's full referrer set, not split
|
|
250
|
-
* across two methods. A `modifier` flattens its components, composite styles,
|
|
251
|
-
* and token-group namespaces into the one tagged list. A token group's other
|
|
252
|
-
* relation — what actually *uses* its member tokens — is the separate
|
|
253
|
-
* {@link Config.getTokenGroupUsage} (only containers have it); ranking every
|
|
254
|
-
* entity of a kind at once is {@link Config.componentDependentCounts} & co.
|
|
255
|
-
*/
|
|
256
|
-
dependentsOf(query: DependentsQuery): DependencyRef[];
|
|
257
|
-
/**
|
|
258
|
-
* The outbound mirror of {@link Config.dependentsOf} — "what does this entity
|
|
259
|
-
* *use*, and would I have to update if I delete those?". Same tagged
|
|
260
|
-
* `DependencyRef[]` shape, same `kind`-keyed exhaustiveness. A `component`
|
|
261
|
-
* reports the tokens it references, the keyword values it sets
|
|
262
|
-
* (`{ kind: 'styleProp', name, value }`), the composites and style props it
|
|
263
|
-
* binds, the components it renders as layers, and the modifiers it styles
|
|
264
|
-
* with; a `token` reports the tokens it aliases and the modifiers in its mode
|
|
265
|
-
* overrides; a `styleProp` reports the token groups it draws from. `modifier`
|
|
266
|
-
* and `tokenGroup` are leaves here — a selector and a container don't *use*
|
|
267
|
-
* other registry entities — so they report nothing.
|
|
268
|
-
*/
|
|
269
|
-
dependenciesOf(query: DependenciesQuery): DependencyRef[];
|
|
270
|
-
/**
|
|
271
|
-
* The aggregate sibling of {@link Config.dependentsOf} — for *every* entity of
|
|
272
|
-
* a kind at once, how many dependents each has (`Map<name, count>`, ranked by
|
|
273
|
-
* `uds_analyze_usage`). A single entity's count is just
|
|
274
|
-
* `dependentsOf(query).length`; this exists for the all-at-once case, where
|
|
275
|
-
* calling that per entity would re-walk the component set N times
|
|
276
|
-
* (O(N × components)) — each private slice walks once (O(components)) and
|
|
277
|
-
* tallies as it goes, kept consistent with `dependentsOf` (a dependent
|
|
278
|
-
* counted once per entity, self-references excluded; the cross-check tests
|
|
279
|
-
* assert the equivalence against the live config).
|
|
280
|
-
*/
|
|
281
|
-
dependentCounts(kind: DependencyKind): Map<string, number>;
|
|
282
|
-
/**
|
|
283
|
-
* A component's style-prop surface as a delta against a base set, so
|
|
284
|
-
* consumers can render "inherits Box (226); adds …; removes …" instead of
|
|
285
|
-
* re-emitting the full ~226-name list per component. The base is the
|
|
286
|
-
* `extendsFrom` parent's set when value-extending, else the union across the
|
|
287
|
-
* `primitives` group (the set every primitive shares). `baseSource` is the
|
|
288
|
-
* parent's name, or `undefined` when the base is the primitives union — every
|
|
289
|
-
* `extends:Box` primitive has an identical set today, so `adds`/`removes` are
|
|
290
|
-
* usually empty, which is the dedup the projection relies on.
|
|
291
|
-
*/
|
|
292
|
-
stylePropSummary(component: Component): {
|
|
293
|
-
own: readonly string[];
|
|
294
|
-
base: readonly string[];
|
|
295
|
-
baseSource?: string;
|
|
296
|
-
adds: readonly string[];
|
|
297
|
-
removes: readonly string[];
|
|
298
|
-
};
|
|
299
|
-
/**
|
|
300
|
-
* Author global CSS — a selector → declarations bag. The callback
|
|
301
|
-
* form receives the same 2D CSS-var ref table as `derived.cssVarRefs`
|
|
302
|
-
* (`tokens.bg.primary` resolves to a `var(--uds-bg-primary)` brand)
|
|
303
|
-
* so consumers can reach for token values without re-deriving them.
|
|
304
|
-
* Mirrors the old `@yahoo/uds-create-config` `defineGlobalStyles` chain.
|
|
305
|
-
*/
|
|
306
|
-
defineGlobalStyles(input: GlobalStylesDef | ((tokens: Readonly<Record<string, Readonly<Record<string, CssVarRef>>>>) => GlobalStylesDef)): this;
|
|
307
|
-
/**
|
|
308
|
-
* Include a raw CSS string verbatim in the generated stylesheet — for
|
|
309
|
-
* declarations the token/style-prop system can't express, most commonly
|
|
310
|
-
* `@font-face` blocks (the codegen pipeline emits none on its own) plus
|
|
311
|
-
* the `:root { --<prefix>-font-family-<id>: … }` definitions that font
|
|
312
|
-
* tokens reference. Accumulates across calls.
|
|
313
|
-
*
|
|
314
|
-
* Takes the CSS *content*, not a path, so `Config` stays free of Node
|
|
315
|
-
* `fs` and remains importable in the browser/runtime. Read the file in
|
|
316
|
-
* `uds.config.ts` (Node context) and pass the string:
|
|
317
|
-
*
|
|
318
|
-
* ```ts
|
|
319
|
-
* import { readFileSync } from 'node:fs';
|
|
320
|
-
* const fontsCss = readFileSync(new URL('./fonts.css', import.meta.url), 'utf8');
|
|
321
|
-
* export default defineConfig({ … }).includeCss(fontsCss);
|
|
322
|
-
* ```
|
|
323
|
-
*
|
|
324
|
-
* Injected after Tailwind compilation and the unused-var purge, so
|
|
325
|
-
* `@font-face` families and any custom properties it declares are never
|
|
326
|
-
* stripped as "unused".
|
|
327
|
-
*/
|
|
328
|
-
includeCss(css: string): this;
|
|
329
|
-
registerModes(modes: Record<string, ModeDefinition>): this;
|
|
330
|
-
registerModifiers(modifiers: Record<string, ModifierDefinition>): this;
|
|
331
|
-
registerTokenGroups(groups: Record<string, TokenGroupDefinition>): this;
|
|
332
|
-
registerStyleProps(props: Record<string, AnyStylePropDefinition>): this;
|
|
333
|
-
registerComposites(composites: Record<string, CompositeStyleDefinition>): this;
|
|
334
|
-
registerMotion(motion: Record<string, MotionDefinitionInput>): this;
|
|
335
|
-
/**
|
|
336
|
-
* Pin the source systems this config links values from. Each record key is
|
|
337
|
-
* the source system's database UUID (the identity — globally unique,
|
|
338
|
-
* immutable, rename-proof); the pin carries the system's display-name
|
|
339
|
-
* snapshot at link time and an exact published version.
|
|
340
|
-
*
|
|
341
|
-
* One pin per system, one version per pin. Every linked value registered
|
|
342
|
-
* afterwards (a barrel value carrying a `link` marker) is validated against
|
|
343
|
-
* its pin — an unpinned system or a version mismatch throws at
|
|
344
|
-
* registration, so pins must appear before the `register*` calls that use
|
|
345
|
-
* them. The pin's `name` also feeds the registry folder slug the pull
|
|
346
|
-
* pipeline derives.
|
|
347
|
-
*/
|
|
348
|
-
registerLinkedSystems(input: LinkedSystemsInput): this;
|
|
349
|
-
registerComponents(components: Record<string, ComponentDefinition>): this;
|
|
350
|
-
/**
|
|
351
|
-
* Build a single component from its definition with this config's context
|
|
352
|
-
* getters wired — `prefixGetter`, `namespaceGetter`, `componentResolver` —
|
|
353
|
-
* and set it on the registry, replacing any existing entry of the same name.
|
|
354
|
-
*
|
|
355
|
-
* This is the ONE sanctioned way to put a constructed component into the
|
|
356
|
-
* config outside `registerComponents`. Constructing a `Component` by hand and
|
|
357
|
-
* calling `config.components.set(...)` silently drops those getters, so the
|
|
358
|
-
* component's `derived.classNames` fall back to an empty prefix/namespace and
|
|
359
|
-
* its anatomy CSS emits unprefixed (`:where(.button-root)`) — it renders
|
|
360
|
-
* unstyled while the runtime applies the prefixed class. Patch-apply code that
|
|
361
|
-
* rebuilds a component from a mutated definition (e.g.
|
|
362
|
-
* `applyComponentStyleUpdatePatch`) routes through here so the wiring can't be
|
|
363
|
-
* forgotten.
|
|
364
|
-
*/
|
|
365
|
-
upsertComponent(name: string, definition: ComponentDefinition, meta?: {
|
|
366
|
-
componentGroup?: string;
|
|
367
|
-
subcomponentOf?: string;
|
|
368
|
-
subcomponents?: readonly string[];
|
|
369
|
-
}): this;
|
|
370
|
-
/**
|
|
371
|
-
* Register one or more labeled bundles of components. Each group's
|
|
372
|
-
* `components` record is flattened into `this.components` (same
|
|
373
|
-
* surface as `registerComponents`), and every member's
|
|
374
|
-
* `Component.derived.componentGroup` carries the group key. The
|
|
375
|
-
* group entry itself lives on `this.componentGroups[key]` with a
|
|
376
|
-
* JSON-safe ref list (`components: readonly string[]`).
|
|
377
|
-
*
|
|
378
|
-
* Subcomponents declared on a grouped parent via
|
|
379
|
-
* `.subcomponents({...})` auto-register alongside their parent;
|
|
380
|
-
* they carry `subcomponentOf` instead of `componentGroup` (a
|
|
381
|
-
* subcomponent belongs to a parent, not a group).
|
|
382
|
-
*
|
|
383
|
-
* Component names are the identity (`<namespace>:<name>`, the spec
|
|
384
|
-
* `type`) and must be unique across the whole config — the same name
|
|
385
|
-
* under two groups, repeated in one group, or already registered by a
|
|
386
|
-
* prior `register*` call throws. Two components that should *display*
|
|
387
|
-
* the same use distinct names + `metadata.label`.
|
|
388
|
-
*/
|
|
389
|
-
registerComponentGroups(groups: Record<string, ComponentGroupDefinition>): this;
|
|
390
|
-
/**
|
|
391
|
-
* Register one or more asset groups. The record key IS the slug —
|
|
392
|
-
* stamped onto the group at registration (late-bound, like
|
|
393
|
-
* `registerComponentGroups` deriving a group's name from its key and
|
|
394
|
-
* `Component.registryKey` reading the namespace getter). Each member
|
|
395
|
-
* then resolves to `${namespace}:asset:${slug}/${assetName}` via
|
|
396
|
-
* `AssetGroup.assetType()`.
|
|
397
|
-
*
|
|
398
|
-
* Trade-off (accepted, same as `registerComponentGroups`): the
|
|
399
|
-
* `{ icons }` shorthand ties the slug to the variable name — write
|
|
400
|
-
* the key out explicitly (`{ icons: phosphorIcons }`) whenever it
|
|
401
|
-
* shouldn't track the variable.
|
|
402
|
-
*/
|
|
403
|
-
registerAssetGroups(groups: Record<string, AssetGroupDefinition>): this;
|
|
404
|
-
/**
|
|
405
|
-
* Map the Studio canvas insert tools to registered components.
|
|
406
|
-
*
|
|
407
|
-
* config.registerCanvasRoles({
|
|
408
|
-
* frame: [
|
|
409
|
-
* {
|
|
410
|
-
* component: Box, // or 'Box'
|
|
411
|
-
* default: true,
|
|
412
|
-
* defaultProps: { width: '[200px]', height: '[150px]' },
|
|
413
|
-
* },
|
|
414
|
-
* { component: HStack },
|
|
415
|
-
* ],
|
|
416
|
-
* text: [{ component: Text }],
|
|
417
|
-
* });
|
|
418
|
-
*
|
|
419
|
-
* `component` accepts the authored `defineComponent(...)` value or the
|
|
420
|
-
* registered name. Passing the value typechecks `defaultProps` against
|
|
421
|
-
* that component's real prop surface (see
|
|
422
|
-
* {@link CanvasRolesInputConstraint}); either form is normalized to the
|
|
423
|
-
* name for storage and the wire format.
|
|
424
|
-
*
|
|
425
|
-
* Every entry's component must already be registered — chain this
|
|
426
|
-
* after `registerComponents` / `registerComponentGroups`. At most one
|
|
427
|
-
* entry per role carries `default: true` (with none marked, the first
|
|
428
|
-
* entry is the default). Re-registering a role replaces its entry
|
|
429
|
-
* list wholesale.
|
|
430
|
-
*/
|
|
431
|
-
registerCanvasRoles<const R extends CanvasRolesDefinitionInput>(roles: R & CanvasRolesInputConstraint<R>): this;
|
|
432
|
-
/** Entries registered for a canvas role (empty when unregistered). */
|
|
433
|
-
canvasRoleEntries(role: CanvasRole): readonly CanvasRoleEntry[];
|
|
434
|
-
/**
|
|
435
|
-
* The component a canvas role's tool preselects — the entry marked
|
|
436
|
-
* `default: true`, or the first entry when none is marked. `undefined`
|
|
437
|
-
* when the role isn't registered (the canvas disables the tool).
|
|
438
|
-
*/
|
|
439
|
-
defaultCanvasComponent(role: CanvasRole): string | undefined;
|
|
440
|
-
registerProviders(providers: Record<string, ProviderComponent<Record<never, never>>>): this;
|
|
441
|
-
get derived(): {
|
|
442
|
-
readonly tokens: ReadonlyMap<string, Token>;
|
|
443
|
-
/**
|
|
444
|
-
* Provenance index for linked tokens — `"<systemId>:<sourceKey>"` →
|
|
445
|
-
* token. A `token()` ref authored inside a linked token names SOURCE-
|
|
446
|
-
* system groups, so it resolves through this index (rename-proof: the
|
|
447
|
-
* consumer's local group name never appears in the key).
|
|
448
|
-
*/
|
|
449
|
-
readonly tokensBySource: ReadonlyMap<string, Token>;
|
|
450
|
-
readonly cssVarRefs: Readonly<Record<string, Readonly<Record<string, CssVarRef>>>>;
|
|
451
|
-
/**
|
|
452
|
-
* Reverse lookup: a style modifier key (`_dark`) → the mode option that
|
|
453
|
-
* owns it. Built from `modes`, so a modifier auto-created by a mode
|
|
454
|
-
* (`colorMode: { dark }` → `_dark`) is recognizable as mode-tied — used to
|
|
455
|
-
* group/describe such modifiers as modes rather than bare custom states.
|
|
456
|
-
*/
|
|
457
|
-
readonly modeOptionsByModifier: ReadonlyMap<TokenModifierKey, ModeOption>;
|
|
458
|
-
};
|
|
459
|
-
/**
|
|
460
|
-
* Resolve a `token()` ref, provenance-aware — the ONE lookup every ref
|
|
461
|
-
* consumer (registration wiring, `validate()`, codegen emission) should
|
|
462
|
-
* use. A ref authored on a linked token (`context` set) names the SOURCE
|
|
463
|
-
* system's groups, so it resolves through the provenance index only —
|
|
464
|
-
* falling back to the consumer's own keys would let a coincidentally-named
|
|
465
|
-
* local group silently shadow a missing source group. Local refs resolve
|
|
466
|
-
* against consumer keys.
|
|
467
|
-
*/
|
|
468
|
-
resolveTokenRef(ref: string, context?: SystemLink): Token | undefined;
|
|
469
|
-
/**
|
|
470
|
-
* Resolve a component ref, provenance-aware — the component counterpart of
|
|
471
|
-
* {@link resolveTokenRef}. A layer ref authored on a linked component
|
|
472
|
-
* (`context` set) names the SOURCE system's components, so it resolves
|
|
473
|
-
* only through markers (the co-linked component whose `sourceKey` matches)
|
|
474
|
-
* — never through consumer names, where a coincidentally-named local
|
|
475
|
-
* component would silently shadow the source one.
|
|
476
|
-
*/
|
|
477
|
-
resolveComponentRef(ref: string, context?: SystemLink): Component | undefined;
|
|
478
|
-
/**
|
|
479
|
-
* Validate cross-references. Throws on cycles in token aliases or on
|
|
480
|
-
* unknown refs in markers (`token()`, `composite()`, `mode()`,
|
|
481
|
-
* `styleProp()`, `tokenGroup()`).
|
|
482
|
-
*/
|
|
483
|
-
validate(): void;
|
|
484
|
-
/**
|
|
485
|
-
* Deep-fork for Studio drafts. Re-builds every entity from `toJSON` /
|
|
486
|
-
* `fromJSON` rather than sharing instances so the clone is fully
|
|
487
|
-
* isolated.
|
|
488
|
-
*
|
|
489
|
-
* `overlay` shallow-merges into the serialized form before re-hydration —
|
|
490
|
-
* lets callers swap top-level slices (`{ components, tokenGroups }`)
|
|
491
|
-
* without round-tripping through the chain methods. Each overlay key
|
|
492
|
-
* fully replaces the existing slice (no per-entry merge); pass the
|
|
493
|
-
* full record you want for that slice.
|
|
494
|
-
*/
|
|
495
|
-
clone(overlay?: Partial<SerializedConfig>): Config;
|
|
496
|
-
/**
|
|
497
|
-
* Serialize to the wire format. Derived data is never included.
|
|
498
|
-
* `meta.builtAt` lands in the JSON when the caller passes it (CLI
|
|
499
|
-
* stamps it at write time so re-serializing in tests stays stable).
|
|
500
|
-
* `meta.projectRoot` relativizes per-component `sourceFilePath`
|
|
501
|
-
* values at the wire boundary — keeps `config.json` portable across
|
|
502
|
-
* machines. Omitting it leaves paths absolute.
|
|
503
|
-
*/
|
|
504
|
-
toJSON(meta?: {
|
|
505
|
-
builtAt?: string;
|
|
506
|
-
projectRoot?: string;
|
|
507
|
-
}): SerializedConfig;
|
|
508
|
-
/**
|
|
509
|
-
* Hydrate from the wire format. Throws when `schemaVersion` doesn't
|
|
510
|
-
* match — the CLI's job is to translate the error into "your manifest
|
|
511
|
-
* is from an older build; run `uds build`."
|
|
512
|
-
*/
|
|
513
|
-
static fromJSON(json: SerializedConfig): Config;
|
|
514
|
-
}
|
|
515
|
-
/**
|
|
516
|
-
* Split a spec element `type` / registry key into its namespace + bare name.
|
|
517
|
-
* `'uds:Text'` → `{ namespace: 'uds', name: 'Text' }`; a bare `'Text'` →
|
|
518
|
-
* `{ name: 'Text' }`. The namespace is everything before the first `:`
|
|
519
|
-
* (namespaces are validated to contain no `:`, see {@link validateNamespace}),
|
|
520
|
-
* so a scoped namespace like `'@acme/system:Button'` still splits on the right
|
|
521
|
-
* colon. The inverse of {@link Component.registryKey}.
|
|
522
|
-
*/
|
|
523
|
-
declare function parseRegistryKey(type: string): {
|
|
524
|
-
namespace?: string;
|
|
525
|
-
name: string;
|
|
526
|
-
};
|
|
527
|
-
//#endregion
|
|
528
|
-
export { Config, DependenciesQuery, DependencyKind, DependencyRef, DependentsQuery, parseRegistryKey };
|