@yahoo/uds-create-config 3.1.0 → 3.3.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.
Files changed (36) hide show
  1. package/dist/configs/CanvasConfig.d.ts +66 -3
  2. package/dist/configs/react-native-system.d.ts +46 -2
  3. package/dist/configs/react-native-system.js +4 -0
  4. package/dist/configs/system.d.ts +46 -2
  5. package/dist/configs/system.js +4 -0
  6. package/dist/entities/system/Component.d.ts +40 -2
  7. package/dist/entities/system/Component.js +74 -9
  8. package/dist/entities/system/File.d.ts +1 -0
  9. package/dist/entities/system/File.js +27 -2
  10. package/dist/entities/system/style-bag.js +24 -5
  11. package/dist/framework/Config.d.ts +1 -1
  12. package/dist/framework/Config.js +1 -1
  13. package/dist/framework/anatomy-check.d.ts +99 -0
  14. package/dist/framework/anatomy-check.js +337 -0
  15. package/dist/framework/class-names.js +6 -2
  16. package/dist/framework/defineEntity.d.ts +1 -0
  17. package/dist/framework/ref-integrity.js +17 -3
  18. package/dist/framework/registry.d.ts +1 -0
  19. package/dist/framework/render-spec.d.ts +12 -1
  20. package/dist/framework/render-spec.js +122 -28
  21. package/dist/framework/schema-version.d.ts +1 -1
  22. package/dist/framework/schema-version.js +5 -5
  23. package/dist/index.d.ts +5 -3
  24. package/dist/index.js +5 -3
  25. package/dist/migrations/2.0.0/v1-artifact.d.ts +23 -1
  26. package/dist/migrations/20260914155048_component_create_blank_op.d.ts +13 -0
  27. package/dist/migrations/20260914155048_component_create_blank_op.js +8 -0
  28. package/dist/migrations/20260914181845_anatomy_harness.d.ts +23 -0
  29. package/dist/migrations/20260914181845_anatomy_harness.js +10 -0
  30. package/dist/renderer/assetEntries.js +2 -3
  31. package/dist/renderer/spec-content.js +1 -1
  32. package/dist/renderer/wrappers/inline-styles.js +21 -1
  33. package/dist/spec/index.d.ts +1 -1
  34. package/dist/spec/specToJsx.js +26 -2
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +2 -2
@@ -8,7 +8,10 @@ import { componentLayerClass, componentPropClasses, componentRuleClasses, layerC
8
8
  const refOf = (value) => typeof value?.__ref === "string" ? value.__ref : void 0;
9
9
  const layerOf = (element) => {
10
10
  const target = refOf(element);
11
- if (target === void 0) return void 0;
11
+ if (target === void 0) {
12
+ const standing = element?.layer;
13
+ return boundPropOf(element) !== void 0 && typeof standing === "string" ? standing : void 0;
14
+ }
12
15
  const { kind, qualifiedPath } = splitRef(target);
13
16
  return kind === "layer" ? qualifiedPath : void 0;
14
17
  };
@@ -17,6 +20,54 @@ const boundPropOf = (element) => {
17
20
  const marker = element?.$state;
18
21
  return typeof marker === "string" ? marker.replace(/^\//, "") : void 0;
19
22
  };
23
+ /** A stored element as a spec type: an intrinsic tag stays, a ref becomes its key. */
24
+ const typeOfStored = (element) => typeof element === "string" ? element : refOf(element);
25
+ /**
26
+ * The registry key of an element rendered THROUGH a package factory — `motion.create(Box)`, spelled
27
+ * `package:motion/react#motion(component:Box)`.
28
+ *
29
+ * The render wrapped the layer, so the module paints motion's element and the anatomy has to say
30
+ * so, or a cell shows the layer without the transition, the hidden-when-empty collapse, the press
31
+ * scale. The registry emits one entry per pair the anatomies name (see codegen's registry emitter);
32
+ * this is the one spelling both sides use. Not a ref path — the parentheses keep it from parsing as
33
+ * one — since it names a derived thing, not an entity.
34
+ */
35
+ function wrappedElementKey(wrapper, type) {
36
+ return `${wrapper}(${type})`;
37
+ }
38
+ /** The type inside a {@link wrappedElementKey}, or `undefined` for a key that wraps nothing. */
39
+ function unwrapElementKey(key) {
40
+ const open = key.indexOf("(");
41
+ if (open === -1 || !key.endsWith(")")) return void 0;
42
+ return key.slice(open + 1, -1);
43
+ }
44
+ /** The type a node renders as, wrapped when the node names a wrapper. */
45
+ function wrappedTypeOf(node, type) {
46
+ if (type === void 0) return void 0;
47
+ const wrapper = refOf(node.wrapper);
48
+ return wrapper ? wrappedElementKey(wrapper, type) : type;
49
+ }
50
+ /**
51
+ * The element a bound node mounts for one value, when the render wrote its own enumeration.
52
+ *
53
+ * `boundElementType` answers a DOMAIN lookup — the value names an icon, the library resolves it. A
54
+ * dispatch is the other shape: the render listed the alternatives itself (`if (mode === 'link')
55
+ * return <ChipLink/>`), so the map is the render's own words and the `else` is its final return.
56
+ * The map is asked first, the domain second, the fallback last — so an unset prop mounts what the
57
+ * render mounts for one.
58
+ */
59
+ function boundChoice(config, componentPath, element, value) {
60
+ const bound = boundPropOf(element);
61
+ if (bound === void 0) return void 0;
62
+ const { map, else: otherwise } = element;
63
+ if (map && typeof value === "string" && value in map) {
64
+ const chosen = typeOfStored(map[value]);
65
+ if (chosen) return chosen;
66
+ }
67
+ const fromDomain = boundElementType(config, componentPath, bound, value);
68
+ if (fromDomain) return fromDomain;
69
+ return typeOfStored(otherwise);
70
+ }
20
71
  /** The slot PROP a node STANDS FOR — a `Slot`-typed node whose `name` prop says which prop's
21
72
  * instance content splices at its position among the siblings. json-render's own vocabulary (the
22
73
  * `Slot` registry primitive and its `name` prop), so the stored node and the rendered element are
@@ -104,6 +155,7 @@ function entryKeyOf(nodes) {
104
155
  * own layers to whatever that layer is; a bound element has no json-render form (its `type` is a
105
156
  * plain string), so it is reported rather than guessed at. */
106
157
  function typeOf(layers, element) {
158
+ if (boundPropOf(element) !== void 0) return typeOfStored(element.else);
107
159
  const layer = layerOf(element);
108
160
  const target = layer === void 0 ? element : layers[layer];
109
161
  if (typeof target === "string") return target;
@@ -152,7 +204,7 @@ function deriveSpec(config, path) {
152
204
  };
153
205
  continue;
154
206
  }
155
- const type = typeOf(layers, node.element);
207
+ const type = wrappedTypeOf(node, typeOf(layers, node.element));
156
208
  if (!type) return void 0;
157
209
  const layer = layerOf(node.element);
158
210
  const props = {
@@ -163,16 +215,7 @@ function deriveSpec(config, path) {
163
215
  "data-uds-component": path
164
216
  } : {}
165
217
  };
166
- let children = node.children?.length ? [...node.children] : void 0;
167
- if (props.children !== void 0 && children) {
168
- const textKey = `${key}•text`;
169
- elements[textKey] = {
170
- type: "span",
171
- props: { children: props.children }
172
- };
173
- delete props.children;
174
- children = [textKey, ...children];
175
- }
218
+ const children = node.children?.length ? [...node.children] : void 0;
176
219
  elements[key] = {
177
220
  type,
178
221
  ...Object.keys(props).length ? { props } : {},
@@ -564,7 +607,7 @@ function consumedProps(config, path, body) {
564
607
  function computeConsumedProps(config, path, body) {
565
608
  const consumed = new Set(["className", "layerProps"]);
566
609
  const declared = body.props ?? {};
567
- for (const [name, decl] of Object.entries(declared)) if (decl?.type === "variant" || decl?.type === "slot" || decl?.type === "forward" || decl?.type === "composite") consumed.add(name);
610
+ for (const [name, decl] of Object.entries(declared)) if (decl && decl.type !== "styleProperty") consumed.add(name);
568
611
  for (const rule of componentRuleClasses(config, path)) for (const prop of Object.keys(rule.when)) if (declared[prop]) consumed.add(prop);
569
612
  return consumed;
570
613
  }
@@ -658,6 +701,8 @@ function classesFor(config, path, layer, state, extra) {
658
701
  /** Emit one element, expanding it when the config describes what it's made of. Returns the key it
659
702
  * was emitted under. */
660
703
  function place(sink, type, props, children, hint, slots) {
704
+ const target = unwrapElementKey(type);
705
+ if (target !== void 0 && sink.rendered && !sink.rendered.has(type)) return place(sink, target, props, children, hint, slots);
661
706
  if (expandable(sink, type)) return expandInstance(sink, pathOf(type), props, children, hint, slots);
662
707
  let tag = type;
663
708
  let own = props;
@@ -676,6 +721,21 @@ function place(sink, type, props, children, hint, slots) {
676
721
  };
677
722
  return key;
678
723
  }
724
+ /** Whether any node under `key` (itself excluded) binds `prop` as its content. */
725
+ function subtreeBinds(anatomy, key, prop) {
726
+ const seen = /* @__PURE__ */ new Set();
727
+ const visit = (at) => {
728
+ if (seen.has(at)) return false;
729
+ seen.add(at);
730
+ const node = anatomy[at];
731
+ if (!node) return false;
732
+ return [...node.children ?? [], ...Object.values(node.slots ?? {}).flat()].some((child) => {
733
+ const pointer = ((anatomy[child]?.props)?.children)?.$state;
734
+ return typeof pointer === "string" && pointer.replace(/^\//, "") === prop || visit(child);
735
+ });
736
+ };
737
+ return visit(key);
738
+ }
679
739
  /**
680
740
  * Replace one component instance with the tree it is made of.
681
741
  *
@@ -698,6 +758,19 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
698
758
  };
699
759
  const consumed = consumedProps(config, path, body);
700
760
  const { byLayer: targets } = slotTargets(config, path, body);
761
+ const valueRoutes = /* @__PURE__ */ new Map();
762
+ for (const [from, decl] of Object.entries(body.props ?? {})) {
763
+ if (decl?.type !== "forward") continue;
764
+ if (routesContent(config, layers, decl)) continue;
765
+ const target = refOf(decl.target);
766
+ if (!target) continue;
767
+ const routes = valueRoutes.get(pathOf(target)) ?? [];
768
+ routes.push({
769
+ from,
770
+ into: intoName(decl.into)
771
+ });
772
+ valueRoutes.set(pathOf(target), routes);
773
+ }
701
774
  const supplied = {
702
775
  ...body.defaultProps ?? {},
703
776
  ...instanceProps
@@ -723,7 +796,12 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
723
796
  let contentPlaced = false;
724
797
  const routedFroms = /* @__PURE__ */ new Set();
725
798
  for (const target of targets.values()) routedFroms.add(target.from);
726
- const unroutedFills = Object.entries(instanceSlots ?? {}).filter(([from]) => !routedFroms.has(from)).flatMap(([, fills]) => fills);
799
+ const positioned = /* @__PURE__ */ new Set();
800
+ for (const node of Object.values(anatomy)) {
801
+ const prop = slotAnatomyPropOf(node);
802
+ if (prop !== void 0) positioned.add(prop);
803
+ }
804
+ const unroutedFills = Object.entries(instanceSlots ?? {}).filter(([from]) => !routedFroms.has(from) && !positioned.has(from)).flatMap(([, fills]) => fills);
727
805
  const allContent = [...content, ...unroutedFills];
728
806
  const emit = (key, keyHint) => {
729
807
  const node = anatomy[key];
@@ -733,7 +811,8 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
733
811
  const isRoot = key === hostNode;
734
812
  let type = typeOf(layers, node.element);
735
813
  const bound = boundPropOf(node.element);
736
- if (bound) type = boundElementType(config, path, bound, state[bound]);
814
+ if (bound) type = boundChoice(config, path, node.element, state[bound]);
815
+ type = wrappedTypeOf(node, type);
737
816
  if (!type) {
738
817
  sink.unresolved.add(bound ? `component:${path}#${key} (${bound})` : `component:${path}#${key}`);
739
818
  return;
@@ -748,12 +827,13 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
748
827
  return key;
749
828
  }
750
829
  const slot = layer ? targets.get(layer) : void 0;
751
- const slotValue = slot ? instanceProps[slot.from] : void 0;
830
+ const slotValue = slot && !subtreeBinds(anatomy, key, slot.from) ? instanceProps[slot.from] : void 0;
752
831
  const props = layer ? {
753
832
  ...authoredProps(config, node.props),
754
833
  "data-uds-component": path,
755
834
  "data-uds-layer": layer,
756
835
  ...forwarded[layer],
836
+ ...Object.fromEntries((valueRoutes.get(layer) ?? []).filter(({ from }) => state[from] !== void 0).map(({ from, into }) => [into, state[from]])),
757
837
  ...isRoot ? rest : {},
758
838
  ...slot && slotValue !== void 0 ? { [intoName(slot.into)]: slotValue } : {},
759
839
  ...layerProps[layer],
@@ -765,20 +845,32 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
765
845
  } : authoredProps(config, node.props);
766
846
  if (node.text !== void 0) props.children = node.text;
767
847
  const children = [];
848
+ const boundFills = {};
849
+ for (const [name, value] of Object.entries(props)) {
850
+ const bound = boundPropOf(value);
851
+ const fills = bound !== void 0 ? instanceSlots?.[bound] : void 0;
852
+ if (!fills?.length) continue;
853
+ delete props[name];
854
+ if (name === "children") children.push(...fills);
855
+ else boundFills[name] = [...fills];
856
+ }
768
857
  for (const child of node.children ?? []) {
769
858
  const childSlot = slotAnatomyPropOf(anatomy[child]);
770
859
  if (childSlot !== void 0) {
771
- if (childSlot === untargetedSlot && allContent.length > 0) {
772
- children.push(...allContent);
773
- contentPlaced = true;
774
- }
860
+ if (childSlot === untargetedSlot) {
861
+ const fills = instanceSlots?.[childSlot] ?? [];
862
+ if (allContent.length > 0 || fills.length > 0) {
863
+ children.push(...allContent, ...fills);
864
+ contentPlaced = true;
865
+ }
866
+ } else children.push(...instanceSlots?.[childSlot] ?? []);
775
867
  continue;
776
868
  }
777
869
  const placed = emit(child, `${keyHint}•${child}`);
778
870
  if (placed) children.push(placed);
779
871
  }
780
872
  if (isRoot && allContent.length > 0 && !contentPlaced) children.push(...allContent);
781
- const slots = {};
873
+ const slots = { ...boundFills };
782
874
  const routed = slot ? instanceSlots?.[slot.from] : void 0;
783
875
  const overridden = routed?.length && slot && !slot.untargeted ? intoName(slot.into) : void 0;
784
876
  for (const [name, fills] of Object.entries(node.slots ?? {})) {
@@ -787,12 +879,7 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
787
879
  if (placedFills.length) slots[name] = placedFills;
788
880
  }
789
881
  if (overridden && routed) slots[overridden] = [...routed];
790
- if (routed?.length && !overridden) children.push(...routed);
791
- if ((node.text !== void 0 || node.props !== void 0 && "children" in node.props) && props.children !== void 0 && children.length > 0) {
792
- const text = props.children;
793
- delete props.children;
794
- children.unshift(place(nested, "span", { children: text }, [], `${keyHint}•text`));
795
- }
882
+ if (routed?.length && !overridden && !(slot && positioned.has(slot.from))) children.push(...routed);
796
883
  const placed = place(nested, type, props, children, keyHint, Object.keys(slots).length ? slots : void 0);
797
884
  if (visible === void 0) withCondition(nested, placed, { visible: node.visible });
798
885
  return placed;
@@ -824,9 +911,15 @@ function expandSpec(config, spec, options = {}) {
824
911
  unresolved: /* @__PURE__ */ new Set(),
825
912
  expanding: []
826
913
  };
914
+ const emitting = /* @__PURE__ */ new Set();
827
915
  const emit = (key) => {
828
916
  const element = spec.elements[key];
829
917
  if (!element) return void 0;
918
+ if (emitting.has(key)) {
919
+ sink.unresolved.add(key);
920
+ return;
921
+ }
922
+ emitting.add(key);
830
923
  const children = [];
831
924
  for (const child of element.children ?? []) {
832
925
  const placed = emit(child);
@@ -836,6 +929,7 @@ function expandSpec(config, spec, options = {}) {
836
929
  for (const [name, fills] of Object.entries(element.slots ?? {})) slots[name] = fills.map((fill) => emit(fill)).filter((placed) => placed !== void 0);
837
930
  const placed = place(sink, element.type, { ...element.props }, children, key, slots);
838
931
  if (element.visible !== void 0) withCondition(sink, placed, { visible: element.visible });
932
+ emitting.delete(key);
839
933
  return placed;
840
934
  };
841
935
  return {
@@ -857,4 +951,4 @@ function expandComponent(config, path, props = {}, options = {}) {
857
951
  return expandSpec(config, instanceSpec(path, props), options);
858
952
  }
859
953
  //#endregion
860
- export { boundElementType, componentSpec, deriveSpec, entryKeyOf, expandComponent, expandSpec, instanceSpec, previewSpec, resolveVisibility, slotAnatomyPropOf, slotTargetsOf, specWithResolvedVisibility, visibilityStateProps, visibilityTerms, withoutTruthyTerm };
954
+ export { boundElementType, componentSpec, deriveSpec, entryKeyOf, expandComponent, expandSpec, instanceSpec, previewSpec, resolveVisibility, slotAnatomyPropOf, slotTargetsOf, specWithResolvedVisibility, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey };
@@ -15,7 +15,7 @@ import { Patch, SerializedConfig } from "./Config.js";
15
15
  * sets this constant to its own older timestamp; the merge ref then carries a registered migration
16
16
  * newer than the constant, and the assertion fails until the author re-mints.
17
17
  */
18
- declare const CURRENT_SCHEMA_VERSION = 20260912164927;
18
+ declare const CURRENT_SCHEMA_VERSION = 20260914181845;
19
19
  /** What the walkers need to see of an envelope — loose on purpose, so a typed `SerializedConfig`
20
20
  * and a raw old-shape record both flow in without casts. */
21
21
  interface VersionStamped {
@@ -13,7 +13,7 @@ import { ConfigFormatError } from "./rejection.js";
13
13
  * sets this constant to its own older timestamp; the merge ref then carries a registered migration
14
14
  * newer than the constant, and the assertion fails until the author re-mints.
15
15
  */
16
- const CURRENT_SCHEMA_VERSION = 20260912164927;
16
+ const CURRENT_SCHEMA_VERSION = 20260914181845;
17
17
  /** The mint that moved `options` into the `settings` kind — restated here, rather than imported
18
18
  * from the migration that owns it, because that migration imports this module. */
19
19
  const SETTINGS_AS_KIND_VERSION = 20260908171448;
@@ -45,7 +45,7 @@ function registerSchemaMigrations(...migrations) {
45
45
  for (const migration of migrations) {
46
46
  if (migration.version !== 1 && !isMintTimestamp(migration.version)) throw new Error(`Schema migration version ${migration.version} is not a mint timestamp — mint one with \`date +%Y%m%d%H%M%S\`, like a supabase migration.`);
47
47
  if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
48
- if (migration.version > 20260912164927) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) — a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
48
+ if (migration.version > 20260914181845) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) — a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
49
49
  REGISTERED.set(migration.version, migration);
50
50
  }
51
51
  }
@@ -102,7 +102,7 @@ function pendingFor(version, target, options) {
102
102
  * Already-current input passes through untouched — same reference, so hot paths pay nothing.
103
103
  */
104
104
  function upgradeSerializedConfig(json, options) {
105
- const target = options?.target ?? 20260912164927;
105
+ const target = options?.target ?? 20260914181845;
106
106
  const version = detectedWireVersion(json);
107
107
  if (version > target) throw new SchemaVersionTooNew(version, target);
108
108
  const raw = json;
@@ -160,7 +160,7 @@ function upgradedSources(json, options) {
160
160
  * meaning under the current schema and replay skips it — reported by the caller, not swallowed here.
161
161
  */
162
162
  function upgradePatch(patch, writtenAt, options) {
163
- const target = options?.target ?? 20260912164927;
163
+ const target = options?.target ?? 20260914181845;
164
164
  if (writtenAt > target) throw new SchemaVersionTooNew(writtenAt, target);
165
165
  let current = patch;
166
166
  for (const migration of pendingFor(writtenAt, target, options)) {
@@ -179,7 +179,7 @@ function upgradePatch(patch, writtenAt, options) {
179
179
  * stamp would cause.
180
180
  */
181
181
  function upgradeDraftEntries(draft, options) {
182
- const target = options?.target ?? 20260912164927;
182
+ const target = options?.target ?? 20260914181845;
183
183
  const entries = [];
184
184
  const held = [];
185
185
  const retired = [];
package/dist/index.d.ts CHANGED
@@ -38,7 +38,7 @@ import { NativeToken, nativeTokenValue } from "./entities/native/NativeToken.js"
38
38
  import { CANVAS_ROLES, CanvasRole, CanvasRoleName } from "./entities/system/CanvasRole.js";
39
39
  import { StyleValue } from "./entities/system/style-bag.js";
40
40
  import { AsInput, AuthoredComponent, AuthoredProp, ComponentBuilder, ComponentPropsOf, LayerElement, LayerMap, PropDecl, PropMap, RenderArgs, StyleRuleInput, defineComponent } from "./entities/system/defineComponent.js";
41
- import { AuthoredPropBody, Component, ComponentBody, ComponentElementBody, ComponentPropBody, ComponentReference, ComponentStyleBody, ElementVisibility, ElementVisibilityInput, ExtendedComponentRef, ProjectedVisibility, VariantValueBody, VariantValues, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef } from "./entities/system/Component.js";
41
+ import { AuthoredPropBody, Component, ComponentBody, ComponentElementBody, ComponentPropBody, ComponentReference, ComponentStyleBody, ElementVisibility, ElementVisibilityInput, ExtendedComponentRef, ProjectedVisibility, VariantValueBody, VariantValues, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef } from "./entities/system/Component.js";
42
42
  import { Composite } from "./entities/system/Composite.js";
43
43
  import { ComponentModuleSource, ComponentRegistryImport, ComponentRegistryImportBinding, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports } from "./entities/system/component-module.js";
44
44
  import { Device } from "./entities/system/Device.js";
@@ -61,6 +61,7 @@ import { RefMember, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StylePropLe
61
61
  import { OverrideCondition, Token, TokenBody, defineOverride, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers } from "./entities/system/Token.js";
62
62
  import { Tool } from "./entities/system/Tool.js";
63
63
  import { TokenBinding, TokenMatch, matchTokens, searchTokens, tokenBinding } from "./entities/system/token-index.js";
64
+ import { AnatomyIssue, AnatomyIssueKind, AnatomyReport, DiffOptions, RenderedNode, SIZE_TOLERANCE_PX, STYLE_PROPERTIES, anatomyIssueKey, diffRendered, normalizeStyleValue, renderedSignatureOf, snapshotHtml } from "./framework/anatomy-check.js";
64
65
  import { ChangeHook, runChangeHooks } from "./framework/change-hooks.js";
65
66
  import { Change, ChangeTarget, baseOf, changeOf, changeValueAt, changesOf, describeBody, summarizeChanges } from "./framework/changes.js";
66
67
  import { ComponentRuleClass, SplitStyleProps, componentClassBase, componentCompositeClasses, componentLayerClass, componentMotionClasses, componentPropClasses, componentRuleClasses, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, isForceModeProp, kebabComponent, layerCompositeProps, modifierUtilitiesUsed, motionClassName, ruleCondition, splitStyleProps, stylePropClassBase, stylePropClassName, stylePropClasses, styleRuleMotionClasses } from "./framework/class-names.js";
@@ -75,7 +76,7 @@ import { ForwardClaims, SurfaceCompositeProp, SurfaceProp, SurfacePropKind, Surf
75
76
  import { DanglingLocalRef, UnknownStyleLeaf, danglingLocalRefs, unknownStyleLeaves } from "./framework/ref-integrity.js";
76
77
  import { resolveInputDir, resolveOutDir, resolveRegistryDir } from "./framework/registry-dir.js";
77
78
  import { InferredRename, inferredRenames } from "./framework/rename-inference.js";
78
- import { ComponentSpec, ComponentSpecs, ExpandOptions, ExpansionResult, RenderElement, RenderSpec, SlotTarget, VisibilityOperator, VisibilityTerm, boundElementType, componentSpec, deriveSpec, entryKeyOf, expandComponent, expandSpec, instanceSpec, previewSpec, resolveVisibility, slotTargetsOf, specWithResolvedVisibility, visibilityStateProps, visibilityTerms, withoutTruthyTerm } from "./framework/render-spec.js";
79
+ import { ComponentSpec, ComponentSpecs, ExpandOptions, ExpansionResult, RenderElement, RenderSpec, SlotTarget, VisibilityOperator, VisibilityTerm, boundElementType, componentSpec, deriveSpec, entryKeyOf, expandComponent, expandSpec, instanceSpec, previewSpec, resolveVisibility, slotTargetsOf, specWithResolvedVisibility, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey } from "./framework/render-spec.js";
79
80
  import { CURRENT_SCHEMA_VERSION, SchemaMigration, SchemaVersionTooNew, UpgradedDraft, WalkOptions, detectedWireVersion, registerSchemaMigrations, schemaVersionOf, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig } from "./framework/schema-version.js";
80
81
  import { ConfigSession, ConfigSessionOptions, ConfigSink, ConfigSource, DraftSource, RebaseOrigin, SourceChange, memoryConfigSource } from "./framework/session.js";
81
82
  import { SignatureOptions, renderSignature, signatureOf } from "./framework/signature.js";
@@ -87,4 +88,5 @@ import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
87
88
  import { views } from "./framework/views-facade.js";
88
89
  import { RN_STYLE_KEYS } from "./react-native/style-keys.generated.js";
89
90
  import { namedSlotTargets } from "./spec/empty-node-slots.js";
90
- export { AI_LANES, AiChat, AiFlow, type AiFlowOrigin, AiGeneration, type AiLane, AiMessage, type AiMultiAgentMode, type AnySystemConfig, type AsInput, type AttachedSources, type Authored, type AuthoredComponent, type AuthoredProp, type AuthoredPropBody, type AuthoringSignatureOptions, BUILD_DEFAULTS, type BreakOutcome, type BreakPlan, type BreakPlanInput, type BreakPlanRow, type BreakReach, BuildSection, CANVAS_ROLES, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, type CanvasRoleName, CanvasSection, type Change, type ChangeHook, type ChangeTarget, type ChildrenPolicy, type Collection, type ColorValue, Component, type ComponentBody, type ComponentBuilder, type ComponentContractOf, type ComponentElementBody, type ComponentModuleSource, type ComponentPropBody, type ComponentPropsOf, type ComponentReference, type ComponentRegistryImport, type ComponentRegistryImportBinding, type ComponentRuleClass, type ComponentSpec, type ComponentSpecs, type ComponentStyleBody, Composite, type ComputedFields, type ComputedInput, type ComputedMap, Config, type ConfigClass, type ConfigEdit, ConfigFormatError, type ConfigInstance, type ConfigIssue, type ConfigIssueCode, type ConfigKind, type ConfigOp, ConfigRejection, ConfigSession, type ConfigSessionOptions, type ConfigSink, type ConfigSource, type CopyPlan, type CopyPlanInput, type CopyPlanRow, type CreateInput, type CssGrammar, type CssPrefix, type CssPropertyEntry, CssSection, DERIVED_MUTATIONS, type DanglingDirective, type DanglingLocalRef, type DanglingRef, type DeclaredRuntimeModule, type DeletePlan, type DeriveMembers, type DerivedColor, type DerivedEntityClass, type DerivedOp, Device, type DraftSource, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, type Edition, type ElementVisibility, type ElementVisibilityInput, Entity, type EntityAddress, type EntityChange, type EntityClass, type EntityKind, type EntityMap, type ExpandOptions, type ExpansionResult, type ExtendedComponentRef, type ExtendedRef, type FieldsSchema, File, Font, FontFile, type ForwardClaims, GROUP, GUIDANCE_LANES, GlobalStyle, type Gradient, type GroupBody, Guidance, type GuidanceLane, type GuidanceScope, type GuidanceSegment, GuidanceStyle, type GuidanceStyleBody, type HasSnapshot, type HydrationOptions, ICON_METADATA_FORMATS, Icon, type IconLibrary, type IconMemberMetadata, type IconMetadataAdapter, type IconMetadataDeclaration, type IconMetadataFile, type IconMetadataFormat, type IdentifiedOp, type InferredRename, type ItemOf, type KindSignature, type KindSlice, LINK_SLUG, LINK_SLUG_MESSAGE, type LayerElement, type LayerMap, type LayerStyleOptions, type LeafAddress, type LinkArrival, type LinkDeclaration, type LinkPaths, type LinkPlan, type LinkPlanInput, LinkedSystem, type LinkedSystemResolver, type LinkedSystemState, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierGroupMeta, Motion, NATIVE_ACTIVATIONS, type NativeActivation, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, type OpHandler, type OpInput, Operation, type OverlayVerb, type OverrideCondition, type OwnedRecords, PLAYGROUND_DEFAULTS, Package, Page, type Patch, type PathOf, type PinDirective, type PinOptions, type PinOptionsField, type Plan, type PlanImpact, type PlanOp, PlaygroundSection, type PreviewMatrix, type ProjectedVisibility, type PropDecl, type PropDeclaration, type PropMap, RN_STYLE_KEYS, ReactNativeSystem, type ReactNativeSystemConfig, type RebaseConflict, type RebaseOrigin, type RebaseResult, type RecordedSource, type RedundantQualifier, type Ref, type RefGraph, type RefGraphEntry, type RefIndex, type RefIndexChange, type RefMember, type RefTarget, type RegisteredComponentContracts, type RegisteredEntities, type RegisteredModifiers, type RegisteredPaths, type RegisteredStyleProps, type RenamePlan, type RenderArgs, type RenderElement, type RenderSpec, type RenderedTarget, type ResolveValueTypeInput, type ResolvedSource, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, type SchemaEntry, type SchemaMigration, SchemaVersionTooNew, type SerializedConfig, type SerializedSourceAnswer, Settings, type SignatureOptions, type SkippedOp, type SlotTarget, Snapshot, type Source, type SourceAnswer, type SourceChange, type SourceMap, type SourceResolution, type SourceResolutionSchemas, type SourceResolver, type SourceRowState, type SourceState, type SourceUnavailable, type SourcesBySlug, type SourcesOf, type SpecNode, type SplitStyleProps, type StampedPatch, type StoredConfig, type StoredPreviewCondition, type StylePropEntry, type StylePropLeaf, type StylePropValue, type StylePropValueCtx, type StylePropValueKind, StyleProperty, type StylePropertyItem, type StyleRuleInput, type StyleValue, type SubEntityClass, type SubPatch, type SurfaceCompositeProp, type SurfaceProp, type SurfacePropKind, type SurfaceScalarProp, type SurfaceSlotProp, type SurfaceStylePropertyProp, type SurfaceVariantProp, System, type SystemConfig, SystemSection, SystemSource, Token, type TokenBinding, type TokenBody, type TokenMatch, Tool, type TraverseOptions, type TreeNode, UNREACHABLE, type UnadoptedDirective, type UnknownStyleLeaf, type UnlinkPlan, type UnlinkPlanInput, type UnreadableBorrow, type UnstatableCondition, type UpgradedDraft, type UserSchemas, VOID_ELEMENTS, type ValueOf, type ValueType, type VariantValueBody, type VariantValues, type VisibilityOperator, type VisibilityTerm, WEB_ACTIVATIONS, type WalkOptions, type WebActivation, addressOf, alpha, applyPathDelta, assetType, authoredBag, authoredValue, authoringSignatures, baseOf, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, changeOf, changeValueAt, changesOf, childrenPolicy, className, classPrefixOf, classifyStylePropValue, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentRegistryImports, componentRuleClasses, componentSpec, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, editOp, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, guidanceReaches, guidanceScopeOf, guidanceTextOf, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, inferredRenames, inputOf, instanceSpec, intoName, isAuthored, isBinaryAsset, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isRef, isSystemConfig, kebabComponent, kindOf, kindsOf, layerCompositeProps, layerRef, layerStyles, leafAddresses, leafVerb, leavesOfStylePropValue, lighten, linearGradient, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, namedFields, namedSlotTargets, nativeTokenValue, negatedCssValue, normalizeName, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, partsOf, pathDelta, pathOf, pathSegments, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propOwner, propValueDomain, propValueFromAxis, redundantQualifiers, ref, refGraphOf, refLeaf, refSchema, registerSchemaMigrations, renderDerivedColor, renderGradient, renderSignature, renderStyleValue, renderedElement, renderedTarget, resolutionSchema, resolveComponentProps, resolveFieldValue, resolveIconLibrary, resolveInputDir, resolveOutDir, resolveRegistryDir, resolveTokenValue, resolveTokenValueUnder, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootLayerOf, routedBag, routedProp, routedPropIn, routesContent, ruleApplies, ruleCondition, runChangeHooks, schemaVersionOf, searchEntities, searchTokens, setAtPath, signatureOf, slotTargetsOf, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specWithResolvedVisibility, splitRef, splitStyleProps, stamp, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, toCssPropertyName, tokenBinding, touchedFields, unadoptedDirectives, unknownStyleLeaves, unreadableBorrows, unstatableConditions, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm };
91
+ import { PreviewElement, graftPreviewElements, isPreviewElement } from "./spec/preview-elements.js";
92
+ export { AI_LANES, AiChat, AiFlow, type AiFlowOrigin, AiGeneration, type AiLane, AiMessage, type AiMultiAgentMode, type AnatomyIssue, type AnatomyIssueKind, type AnatomyReport, type AnySystemConfig, type AsInput, type AttachedSources, type Authored, type AuthoredComponent, type AuthoredProp, type AuthoredPropBody, type AuthoringSignatureOptions, BUILD_DEFAULTS, type BreakOutcome, type BreakPlan, type BreakPlanInput, type BreakPlanRow, type BreakReach, BuildSection, CANVAS_ROLES, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, type CanvasRoleName, CanvasSection, type Change, type ChangeHook, type ChangeTarget, type ChildrenPolicy, type Collection, type ColorValue, Component, type ComponentBody, type ComponentBuilder, type ComponentContractOf, type ComponentElementBody, type ComponentModuleSource, type ComponentPropBody, type ComponentPropsOf, type ComponentReference, type ComponentRegistryImport, type ComponentRegistryImportBinding, type ComponentRuleClass, type ComponentSpec, type ComponentSpecs, type ComponentStyleBody, Composite, type ComputedFields, type ComputedInput, type ComputedMap, Config, type ConfigClass, type ConfigEdit, ConfigFormatError, type ConfigInstance, type ConfigIssue, type ConfigIssueCode, type ConfigKind, type ConfigOp, ConfigRejection, ConfigSession, type ConfigSessionOptions, type ConfigSink, type ConfigSource, type CopyPlan, type CopyPlanInput, type CopyPlanRow, type CreateInput, type CssGrammar, type CssPrefix, type CssPropertyEntry, CssSection, DERIVED_MUTATIONS, type DanglingDirective, type DanglingLocalRef, type DanglingRef, type DeclaredRuntimeModule, type DeletePlan, type DeriveMembers, type DerivedColor, type DerivedEntityClass, type DerivedOp, Device, type DiffOptions, type DraftSource, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, type Edition, type ElementVisibility, type ElementVisibilityInput, Entity, type EntityAddress, type EntityChange, type EntityClass, type EntityKind, type EntityMap, type ExpandOptions, type ExpansionResult, type ExtendedComponentRef, type ExtendedRef, type FieldsSchema, File, Font, FontFile, type ForwardClaims, GROUP, GUIDANCE_LANES, GlobalStyle, type Gradient, type GroupBody, Guidance, type GuidanceLane, type GuidanceScope, type GuidanceSegment, GuidanceStyle, type GuidanceStyleBody, type HasSnapshot, type HydrationOptions, ICON_METADATA_FORMATS, Icon, type IconLibrary, type IconMemberMetadata, type IconMetadataAdapter, type IconMetadataDeclaration, type IconMetadataFile, type IconMetadataFormat, type IdentifiedOp, type InferredRename, type ItemOf, type KindSignature, type KindSlice, LINK_SLUG, LINK_SLUG_MESSAGE, type LayerElement, type LayerMap, type LayerStyleOptions, type LeafAddress, type LinkArrival, type LinkDeclaration, type LinkPaths, type LinkPlan, type LinkPlanInput, LinkedSystem, type LinkedSystemResolver, type LinkedSystemState, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierGroupMeta, Motion, NATIVE_ACTIVATIONS, type NativeActivation, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, type OpHandler, type OpInput, Operation, type OverlayVerb, type OverrideCondition, type OwnedRecords, PLAYGROUND_DEFAULTS, Package, Page, type Patch, type PathOf, type PinDirective, type PinOptions, type PinOptionsField, type Plan, type PlanImpact, type PlanOp, PlaygroundSection, type PreviewElement, type PreviewMatrix, type ProjectedVisibility, type PropDecl, type PropDeclaration, type PropMap, RN_STYLE_KEYS, ReactNativeSystem, type ReactNativeSystemConfig, type RebaseConflict, type RebaseOrigin, type RebaseResult, type RecordedSource, type RedundantQualifier, type Ref, type RefGraph, type RefGraphEntry, type RefIndex, type RefIndexChange, type RefMember, type RefTarget, type RegisteredComponentContracts, type RegisteredEntities, type RegisteredModifiers, type RegisteredPaths, type RegisteredStyleProps, type RenamePlan, type RenderArgs, type RenderElement, type RenderSpec, type RenderedNode, type RenderedTarget, type ResolveValueTypeInput, type ResolvedSource, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, STYLE_PROPERTIES, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, type SchemaEntry, type SchemaMigration, SchemaVersionTooNew, type SerializedConfig, type SerializedSourceAnswer, Settings, type SignatureOptions, type SkippedOp, type SlotTarget, Snapshot, type Source, type SourceAnswer, type SourceChange, type SourceMap, type SourceResolution, type SourceResolutionSchemas, type SourceResolver, type SourceRowState, type SourceState, type SourceUnavailable, type SourcesBySlug, type SourcesOf, type SpecNode, type SplitStyleProps, type StampedPatch, type StoredConfig, type StoredPreviewCondition, type StylePropEntry, type StylePropLeaf, type StylePropValue, type StylePropValueCtx, type StylePropValueKind, StyleProperty, type StylePropertyItem, type StyleRuleInput, type StyleValue, type SubEntityClass, type SubPatch, type SurfaceCompositeProp, type SurfaceProp, type SurfacePropKind, type SurfaceScalarProp, type SurfaceSlotProp, type SurfaceStylePropertyProp, type SurfaceVariantProp, System, type SystemConfig, SystemSection, SystemSource, Token, type TokenBinding, type TokenBody, type TokenMatch, Tool, type TraverseOptions, type TreeNode, UNREACHABLE, type UnadoptedDirective, type UnknownStyleLeaf, type UnlinkPlan, type UnlinkPlanInput, type UnreadableBorrow, type UnstatableCondition, type UpgradedDraft, type UserSchemas, VOID_ELEMENTS, type ValueOf, type ValueType, type VariantValueBody, type VariantValues, type VisibilityOperator, type VisibilityTerm, WEB_ACTIVATIONS, type WalkOptions, type WebActivation, addressOf, alpha, anatomyIssueKey, applyPathDelta, assetType, authoredBag, authoredValue, authoringSignatures, baseOf, blankComponentBody, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, changeOf, changeValueAt, changesOf, childrenPolicy, className, classPrefixOf, classifyStylePropValue, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentRegistryImports, componentRuleClasses, componentSpec, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, editOp, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, inferredRenames, inputOf, instanceSpec, intoName, isAuthored, isBinaryAsset, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isPreviewElement, isRef, isSystemConfig, kebabComponent, kindOf, kindsOf, layerCompositeProps, layerRef, layerStyles, leafAddresses, leafVerb, leavesOfStylePropValue, lighten, linearGradient, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, namedFields, namedSlotTargets, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, partsOf, pathDelta, pathOf, pathSegments, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propOwner, propValueDomain, propValueFromAxis, redundantQualifiers, ref, refGraphOf, refLeaf, refSchema, registerSchemaMigrations, renderDerivedColor, renderGradient, renderSignature, renderStyleValue, renderedElement, renderedSignatureOf, renderedTarget, resolutionSchema, resolveComponentProps, resolveFieldValue, resolveIconLibrary, resolveInputDir, resolveOutDir, resolveRegistryDir, resolveTokenValue, resolveTokenValueUnder, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootLayerOf, routedBag, routedProp, routedPropIn, routesContent, ruleApplies, ruleCondition, runChangeHooks, schemaVersionOf, searchEntities, searchTokens, setAtPath, signatureOf, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specWithResolvedVisibility, splitRef, splitStyleProps, stamp, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, toCssPropertyName, tokenBinding, touchedFields, unadoptedDirectives, unknownStyleLeaves, unreadableBorrows, unstatableConditions, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey };
package/dist/index.js CHANGED
@@ -23,12 +23,13 @@ import { STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StyleProperty, classif
23
23
  import { createSliceMemo } from "./framework/memo.js";
24
24
  import { authoredBag, authoredValue, className, cssPropValue, cssVar, cssVarRef, declaredPropRouting, memberFromLeaf, memberLeaves, negatedCssValue, opacityPercentage, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, propOwner, propValueDomain, propValueFromAxis, renderStyleValue, resolveComponentProps, resolveFieldValue, resolveTokenValue, resolveTokenValueUnder, routedBag, sourceVarPrefix, styleAliasesOf, styleDeclarations, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, validateComponentProps } from "./framework/projections.js";
25
25
  import { forwardClaims, forwardedLayers, intoName, routedProp, routedPropIn, routesContent, surfaceProp, surfaceProps } from "./framework/prop-surface.js";
26
+ import { graftPreviewElements, isPreviewElement } from "./spec/preview-elements.js";
26
27
  import { layerStyles, ruleApplies } from "./framework/layer-styles.js";
27
28
  import { componentClassBase, componentCompositeClasses, componentLayerClass, componentMotionClasses, componentPropClasses, componentRuleClasses, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, isForceModeProp, kebabComponent, layerCompositeProps, modifierUtilitiesUsed, motionClassName, ruleCondition, splitStyleProps, stylePropClassBase, stylePropClassName, stylePropClasses, styleRuleMotionClasses } from "./framework/class-names.js";
28
- import { boundElementType, componentSpec, deriveSpec, entryKeyOf, expandComponent, expandSpec, instanceSpec, previewSpec, resolveVisibility, slotTargetsOf, specWithResolvedVisibility, visibilityStateProps, visibilityTerms, withoutTruthyTerm } from "./framework/render-spec.js";
29
+ import { boundElementType, componentSpec, deriveSpec, entryKeyOf, expandComponent, expandSpec, instanceSpec, previewSpec, resolveVisibility, slotTargetsOf, specWithResolvedVisibility, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey } from "./framework/render-spec.js";
29
30
  import { Package } from "./entities/system/Package.js";
30
31
  import { File, SCRIPT_EXTENSIONS, isBinaryAsset } from "./entities/system/File.js";
31
- import { Component, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef } from "./entities/system/Component.js";
32
+ import { Component, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef } from "./entities/system/Component.js";
32
33
  import { Device } from "./entities/system/Device.js";
33
34
  import { ICON_METADATA_FORMATS, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat } from "./entities/system/icon-metadata.js";
34
35
  import { Icon } from "./entities/system/Icon.js";
@@ -74,6 +75,7 @@ import { assetType, iconCategories, iconLibraries, iconLibrary, isDeclaredElemen
74
75
  import { declaredRuntimeModules } from "./entities/system/runtime-modules.js";
75
76
  import { matchEntities, normalizeName, searchEntities } from "./framework/entity-search.js";
76
77
  import { matchTokens, searchTokens, tokenBinding } from "./entities/system/token-index.js";
78
+ import { SIZE_TOLERANCE_PX, STYLE_PROPERTIES, anatomyIssueKey, diffRendered, normalizeStyleValue, renderedSignatureOf, snapshotHtml } from "./framework/anatomy-check.js";
77
79
  import { runChangeHooks } from "./framework/change-hooks.js";
78
80
  import { baseOf, changeOf, changeValueAt, changesOf, describeBody, summarizeChanges } from "./framework/changes.js";
79
81
  import { DERIVED_MUTATIONS } from "./framework/derived-mutations.js";
@@ -83,4 +85,4 @@ import { ConfigSession, memoryConfigSource } from "./framework/session.js";
83
85
  import { EXPORT_MEMBER, packageKey, packageName } from "./framework/utils/package-path.js";
84
86
  import { validateSpec } from "./framework/validate-spec.js";
85
87
  import { namedSlotTargets } from "./spec/empty-node-slots.js";
86
- export { AI_LANES, AiChat, AiFlow, AiGeneration, AiMessage, BUILD_DEFAULTS, BuildSection, CANVAS_ROLES, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, CanvasSection, Component, Composite, Config, ConfigFormatError, ConfigRejection, ConfigSession, CssSection, DERIVED_MUTATIONS, Device, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, Entity, File, Font, FontFile, GROUP, GUIDANCE_LANES, GlobalStyle, Guidance, GuidanceStyle, ICON_METADATA_FORMATS, Icon, LINK_SLUG, LINK_SLUG_MESSAGE, LinkedSystem, MINTED, MODIFIER_CATEGORIES, Modifier, Motion, NATIVE_ACTIVATIONS, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, Operation, PLAYGROUND_DEFAULTS, Package, Page, PlaygroundSection, RN_STYLE_KEYS, ReactNativeSystem, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, SchemaVersionTooNew, Settings, Snapshot, StyleProperty, System, SystemSection, SystemSource, Token, Tool, UNREACHABLE, VOID_ELEMENTS, WEB_ACTIVATIONS, addressOf, alpha, applyPathDelta, assetType, authoredBag, authoredValue, authoringSignatures, baseOf, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, changeOf, changeValueAt, changesOf, childrenPolicy, className, classPrefixOf, classifyStylePropValue, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentRegistryImports, componentRuleClasses, componentSpec, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, editOp, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, guidanceReaches, guidanceScopeOf, guidanceTextOf, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, inferredRenames, inputOf, instanceSpec, intoName, isAuthored, isBinaryAsset, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isRef, isSystemConfig, kebabComponent, kindOf, kindsOf, layerCompositeProps, layerRef, layerStyles, leafAddresses, leafVerb, leavesOfStylePropValue, lighten, linearGradient, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, namedFields, namedSlotTargets, nativeTokenValue, negatedCssValue, normalizeName, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, partsOf, pathDelta, pathOf, pathSegments, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propOwner, propValueDomain, propValueFromAxis, redundantQualifiers, ref, refGraphOf, refLeaf, refSchema, registerSchemaMigrations, renderDerivedColor, renderGradient, renderSignature, renderStyleValue, renderedElement, renderedTarget, resolutionSchema, resolveComponentProps, resolveFieldValue, resolveIconLibrary, resolveInputDir, resolveOutDir, resolveRegistryDir, resolveTokenValue, resolveTokenValueUnder, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootLayerOf, routedBag, routedProp, routedPropIn, routesContent, ruleApplies, ruleCondition, runChangeHooks, schemaVersionOf, searchEntities, searchTokens, setAtPath, signatureOf, slotTargetsOf, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specWithResolvedVisibility, splitRef, splitStyleProps, stamp, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, toCssPropertyName, tokenBinding, touchedFields, unadoptedDirectives, unknownStyleLeaves, unreadableBorrows, unstatableConditions, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm };
88
+ export { AI_LANES, AiChat, AiFlow, AiGeneration, AiMessage, BUILD_DEFAULTS, BuildSection, CANVAS_ROLES, CONFIG_OPERATION_KIND, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, CanvasSection, Component, Composite, Config, ConfigFormatError, ConfigRejection, ConfigSession, CssSection, DERIVED_MUTATIONS, Device, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, Entity, File, Font, FontFile, GROUP, GUIDANCE_LANES, GlobalStyle, Guidance, GuidanceStyle, ICON_METADATA_FORMATS, Icon, LINK_SLUG, LINK_SLUG_MESSAGE, LinkedSystem, MINTED, MODIFIER_CATEGORIES, Modifier, Motion, NATIVE_ACTIVATIONS, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, Operation, PLAYGROUND_DEFAULTS, Package, Page, PlaygroundSection, RN_STYLE_KEYS, ReactNativeSystem, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, STYLE_PROPERTIES, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, SchemaVersionTooNew, Settings, Snapshot, StyleProperty, System, SystemSection, SystemSource, Token, Tool, UNREACHABLE, VOID_ELEMENTS, WEB_ACTIVATIONS, addressOf, alpha, anatomyIssueKey, applyPathDelta, assetType, authoredBag, authoredValue, authoringSignatures, baseOf, blankComponentBody, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, canonicalWhen, changeOf, changeValueAt, changesOf, childrenPolicy, className, classPrefixOf, classifyStylePropValue, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentRegistryImports, componentRuleClasses, componentSpec, createCanvasConfig, createSliceMemo, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declaredField, declaredPropRouting, declaredRuntimeModules, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, editOp, entityRefOf, entryKeyOf, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, inferredRenames, inputOf, instanceSpec, intoName, isAuthored, isBinaryAsset, isConfigFormatError, isConfigRejection, isCssProperty, isDeclaredElementProp, isDerivedColor, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isLinkSlug, isMintedRow, isNativeConfig, isPlainObject, isPreviewElement, isRef, isSystemConfig, kebabComponent, kindOf, kindsOf, layerCompositeProps, layerRef, layerStyles, leafAddresses, leafVerb, leavesOfStylePropValue, lighten, linearGradient, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, namedFields, namedSlotTargets, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, opOf, opVerb, opacityPercentage, opsForKind, orRef, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, ownValues, ownerOf, ownsItsValues, packageKey, packageName, partsOf, pathDelta, pathOf, pathSegments, planBreak, planCopy, planLink, planUnlink, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propOwner, propValueDomain, propValueFromAxis, redundantQualifiers, ref, refGraphOf, refLeaf, refSchema, registerSchemaMigrations, renderDerivedColor, renderGradient, renderSignature, renderStyleValue, renderedElement, renderedSignatureOf, renderedTarget, resolutionSchema, resolveComponentProps, resolveFieldValue, resolveIconLibrary, resolveInputDir, resolveOutDir, resolveRegistryDir, resolveTokenValue, resolveTokenValueUnder, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rnStyleKey, rootLayerOf, routedBag, routedProp, routedPropIn, routesContent, ruleApplies, ruleCondition, runChangeHooks, schemaVersionOf, searchEntities, searchTokens, setAtPath, signatureOf, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specWithResolvedVisibility, splitRef, splitStyleProps, stamp, styleAliasesOf, styleDeclarations, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, toCssPropertyName, tokenBinding, touchedFields, unadoptedDirectives, unknownStyleLeaves, unreadableBorrows, unstatableConditions, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueLeavesOf, valueRef, valueSchemaOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey };
@@ -472,7 +472,7 @@ declare function loadV1Artifact(studio: V1Artifact, options?: LoadV1Options): Co
472
472
  }, _$zod_v4_core0.$strip>>;
473
473
  export: _$zod.ZodOptional<_$zod.ZodString>;
474
474
  }, _$zod_v4_core0.$strict>;
475
- 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.";
475
+ readonly description: "Create a component at a new qualified `path`. For a component with nothing in it yet, one to design on the canvas before it has props or variants, use `create-blank` with only a `path` instead of authoring a minimal body here. 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.";
476
476
  readonly example: ({
477
477
  config
478
478
  }: {
@@ -484,6 +484,27 @@ declare function loadV1Artifact(studio: V1Artifact, options?: LoadV1Options): Co
484
484
  data: Record<string, unknown>;
485
485
  };
486
486
  };
487
+ readonly 'create-blank': {
488
+ readonly input: _$zod.ZodObject<{
489
+ path: _$zod.ZodType<string, string | undefined, _$zod_v4_core0.$ZodTypeInternals<string, string | undefined>>;
490
+ }, _$zod_v4_core0.$strip>;
491
+ readonly readOnly: false;
492
+ readonly label: "Create blank";
493
+ readonly description: "Create an empty component at a new qualified `path`, to design on the canvas first: one `div` root layer and the node that renders it, with no props, no variants, no slot, no styles and no preview content. This is exactly what Studio's \"+\" creates. Takes only `path`. Use it for \"a new component\", \"a blank component\" or \"start a component from nothing\"; `create` is for a component whose body is already known.";
494
+ readonly scope: "item";
495
+ readonly creates: true;
496
+ readonly title: (entity: string) => string;
497
+ readonly example: ({
498
+ config
499
+ }: {
500
+ config: Config;
501
+ kind: string;
502
+ path: string;
503
+ }) => {
504
+ path: string;
505
+ };
506
+ readonly handler: (input: Record<string, unknown>, config: Config) => Config;
507
+ };
487
508
  readonly 'sub-create/anatomy': {
488
509
  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.";
489
510
  };
@@ -1126,6 +1147,7 @@ declare function loadV1Artifact(studio: V1Artifact, options?: LoadV1Options): Co
1126
1147
  target: _$zod.ZodType<Ref, unknown, _$zod_v4_core0.$ZodTypeInternals<Ref, unknown>>;
1127
1148
  names: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
1128
1149
  }, _$zod_v4_core0.$strip>>>;
1150
+ exports: _$zod.ZodOptional<SubEntityClass<_$zod.ZodObject<{}, _$zod_v4_core0.$strict>>>;
1129
1151
  }, _$zod_v4_core0.$strict>, _$zod.ZodObject<Record<never, never>, _$zod_v4_core0.$strip>, "file", Record<never, never>, {
1130
1152
  readonly binary: ({
1131
1153
  path
@@ -0,0 +1,13 @@
1
+ /**
2
+ * An additive fence: the `component` kind gains the op `create-blank`, so the operation catalogue's
3
+ * fingerprint moves. No stored byte changes — the op is stored as the ordinary `component/create`
4
+ * patch it delegates to.
5
+ *
6
+ * Identity, so a stamp below this version means "does not know `create-blank`" and one at it means
7
+ * the catalogue is understood.
8
+ *
9
+ * Deletable once no stored config artifact is below this version.
10
+ */
11
+ import type { SchemaMigration } from '../framework/schema-version';
12
+ export declare const COMPONENT_CREATE_BLANK_OP_VERSION = 20260914155048;
13
+ export declare const componentCreateBlankOpMigration: SchemaMigration;
@@ -0,0 +1,8 @@
1
+ //#region src/migrations/20260914155048_component_create_blank_op.ts
2
+ const COMPONENT_CREATE_BLANK_OP_VERSION = 20260914155048;
3
+ const componentCreateBlankOpMigration = {
4
+ version: COMPONENT_CREATE_BLANK_OP_VERSION,
5
+ up: (json) => json
6
+ };
7
+ //#endregion
8
+ export { COMPONENT_CREATE_BLANK_OP_VERSION, componentCreateBlankOpMigration };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The wire shapes the anatomy reader and the anatomy check taught the config, all additive:
3
+ *
4
+ * - An anatomy node's prop-chosen element (`{ "$state": "/<prop>" }`) gains optional `map` (prop
5
+ * value → the element mounted for it), `else` (the element when nothing matches) and `layer` (the
6
+ * layer the chosen element stands in for), so a render that mounts a different component per
7
+ * value of one prop has one root node whose element the prop picks.
8
+ * - An anatomy node gains an optional `wrapper`: a ref to a package factory the element renders
9
+ * through, `{ "__ref": "package:motion/react#motion" }` for a layer written as
10
+ * `motion.create(Box)`, so the node carries the motion props and paints like the module.
11
+ * - A `File` gains an optional `exports` member collection, so an anatomy can name a same-file
12
+ * function component (`file:src/uds/components/pagination.tsx#PaginationProvider`) and the
13
+ * registry can import it from the module the file emits to. A node's props may also hold a list
14
+ * of literals, a motion keyframe track.
15
+ *
16
+ * Nothing stored before this version reshapes. A body without a field means what its absence
17
+ * always meant: a domain lookup, a direct element, a file with no members.
18
+ *
19
+ * Deletable once no stored artifact predates it.
20
+ */
21
+ import type { SchemaMigration } from '../framework/schema-version';
22
+ export declare const ANATOMY_HARNESS_VERSION = 20260914181845;
23
+ export declare const anatomyHarnessMigration: SchemaMigration;
@@ -0,0 +1,10 @@
1
+ //#region src/migrations/20260914181845_anatomy_harness.ts
2
+ const ANATOMY_HARNESS_VERSION = 20260914181845;
3
+ const anatomyHarnessMigration = {
4
+ version: ANATOMY_HARNESS_VERSION,
5
+ up(json) {
6
+ return json;
7
+ }
8
+ };
9
+ //#endregion
10
+ export { ANATOMY_HARNESS_VERSION, anatomyHarnessMigration };
@@ -20,13 +20,12 @@ function assetRegistryEntries({ libraries, components }) {
20
20
  for (const name of group.assetNames) {
21
21
  const member = members[name];
22
22
  if (member === void 0) continue;
23
- const Renderable = makeAssetRenderable(SystemComponent, member, name);
24
23
  const key = group.assetType(name);
25
24
  entries[key] = makeComponentEntry({
26
- component: Renderable,
25
+ component: makeAssetRenderable(void 0, member, name),
27
26
  name: key
28
27
  });
29
- bySlug.set(name, Renderable);
28
+ bySlug.set(name, makeAssetRenderable(SystemComponent, member, name));
30
29
  }
31
30
  assetMembers.set(group.name, bySlug);
32
31
  }
@@ -85,7 +85,7 @@ function specContent({ children, propChildren }) {
85
85
  propChildren,
86
86
  ...childArray.slice(slotAt)
87
87
  ];
88
- return children;
88
+ return propChildren != null ? [propChildren, ...childArray] : children;
89
89
  }
90
90
  if (propChildren != null && childArray.length > 0) return [propChildren, ...childArray];
91
91
  if (childArray.length > 0) return children;