@yahoo/uds-create-config 2.34.0 → 2.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Config.d.ts CHANGED
@@ -100,6 +100,21 @@ declare class Config {
100
100
  * link-marked value against it.
101
101
  */
102
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;
103
118
  /**
104
119
  * Set top-level config metadata in one call — the single scalar-setter,
105
120
  * replacing the former `withPrefix` / `withPreflight` / `withName` /
package/dist/Config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./brands.js";
2
- import "./entity-utils.js";
2
+ import { makeTokenRefToCss } from "./entity-utils.js";
3
3
  import { AssetGroup } from "./AssetGroup.js";
4
4
  import { attachSourcePath } from "./captureCallerPath.js";
5
5
  import { isAssetGroupRef, isModeRef, isTokenRef } from "./refs.js";
@@ -9,6 +9,7 @@ import { Component, assertDefinitionAcceptsPlaceable } from "./Component.js";
9
9
  import { ComponentGroup } from "./ComponentGroup.js";
10
10
  import { CompositeStyle } from "./CompositeStyle.js";
11
11
  import { assertLinkedTokenPinned, assertLinkedValuePinned, validateLinkedSystemPin } from "./linked-system-pins.js";
12
+ import { assignLinkedNodePrefixes } from "./linkedNodePrefixes.js";
12
13
  import { Mode } from "./Mode.js";
13
14
  import { Modifier } from "./Modifier.js";
14
15
  import { CssMotionDef, JsMotionDef } from "./MotionDef.js";
@@ -72,6 +73,43 @@ var Config = class Config {
72
73
  * link-marked value against it.
73
74
  */
74
75
  linkedSystems = /* @__PURE__ */ new Map();
76
+ /** Build-supplied node CSS prefixes (`{systemId}@{version}` → prefix). */
77
+ #linkedNodePrefixes;
78
+ /**
79
+ * Supply the closure-accurate node prefix assignment (build sites know the
80
+ * full transitive closure; the pins-derived fallback below only sees direct
81
+ * pins). Affects how system-scoped refs without consumer entries derive.
82
+ */
83
+ setLinkedNodePrefixes(prefixes) {
84
+ this.#linkedNodePrefixes = prefixes;
85
+ this.#invalidate();
86
+ return this;
87
+ }
88
+ /**
89
+ * The CSS prefix a pinned system's regenerated node sheet uses — the var
90
+ * namespace a system-scoped ref resolves into when no consumer entry
91
+ * exists. Explicit build-supplied assignment wins; otherwise derived from
92
+ * the direct pins with the same pure assignment the build uses (identical
93
+ * for directly pinned systems, which are the only ones payload refs may
94
+ * name). Null when the system isn't pinned.
95
+ */
96
+ linkedNodeVarPrefix(systemId, version) {
97
+ if (this.#linkedNodePrefixes) {
98
+ if (version) {
99
+ const exact = this.#linkedNodePrefixes.get(`${systemId}@${version}`);
100
+ if (exact) return exact;
101
+ }
102
+ for (const [key, prefix] of this.#linkedNodePrefixes) if (key.startsWith(`${systemId}@`)) return prefix;
103
+ return null;
104
+ }
105
+ const pin = this.linkedSystems.get(systemId);
106
+ if (!pin) return null;
107
+ return assignLinkedNodePrefixes([...this.linkedSystems.entries()].map(([id, p]) => ({
108
+ systemId: id,
109
+ version: p.version,
110
+ name: p.name
111
+ })), this.prefix).get(`${systemId}@${pin.version}`)?.cssPrefix ?? null;
112
+ }
75
113
  #derived;
76
114
  /**
77
115
  * Set top-level config metadata in one call — the single scalar-setter,
@@ -892,6 +930,10 @@ var Config = class Config {
892
930
  prefixGetter: () => this.prefix,
893
931
  definition: def,
894
932
  tokenLookup: (ref, context) => this.resolveTokenRef(ref, context),
933
+ linkedVarRef: (system, ref) => {
934
+ const prefix = this.linkedNodeVarPrefix(system.id, system.version);
935
+ return prefix ? makeTokenRefToCss(prefix)(ref) : void 0;
936
+ },
895
937
  stylePropertiesLookup: (ns) => this.#stylePropertiesFor(ns)
896
938
  }));
897
939
  }
@@ -1619,21 +1661,30 @@ function validateNamespace(value) {
1619
1661
  */
1620
1662
  function visit(qualified, token, resolve, seen) {
1621
1663
  if (seen.has(qualified)) throw new Error(`Token cycle detected at '${qualified}'`);
1622
- const followRef = (ref) => {
1623
- const next = resolve(ref, token.link);
1664
+ const followRef = (marker) => {
1665
+ let context = token.link;
1666
+ if (marker.scope === "consumer") context = void 0;
1667
+ else if (marker.system) context = {
1668
+ kind: "token",
1669
+ systemId: marker.system.id,
1670
+ systemVersion: marker.system.version,
1671
+ sourceKey: marker.ref
1672
+ };
1673
+ const next = resolve(marker.ref, context);
1624
1674
  if (!next) {
1625
- if (token.link) {
1626
- const [sourceGroup] = ref.split("/");
1627
- throw new Error(`Token '${qualified}' is linked from system "${token.link.systemId}" and references its token '${ref}', which nothing in this config provides — link the source system's "${sourceGroup}" group too (refs on linked tokens resolve by provenance, not by local group names).`);
1675
+ if (marker.system) return;
1676
+ if (context && token.link) {
1677
+ const [sourceGroup] = marker.ref.split("/");
1678
+ throw new Error(`Token '${qualified}' is linked from system "${token.link.systemId}" and references its token '${marker.ref}', which nothing in this config provides — link the source system's "${sourceGroup}" group too (refs on linked tokens resolve by provenance, not by local group names).`);
1628
1679
  }
1629
- throw new Error(`Token '${qualified}' references unknown token '${ref}'`);
1680
+ throw new Error(`Token '${qualified}' references unknown token '${marker.ref}'`);
1630
1681
  }
1631
1682
  visit(`${next.namespace}/${next.name}`, next, resolve, new Set(seen).add(qualified));
1632
1683
  };
1633
- if (isTokenRefValue(token.value)) followRef(token.value.ref);
1684
+ if (isTokenRefValue(token.value)) followRef(token.value);
1634
1685
  if (token.link && token.modifiers) for (const value of Object.values(token.modifiers)) {
1635
1686
  const inner = typeof value === "object" && value !== null && "value" in value ? value.value : value;
1636
- if (isTokenRefValue(inner)) followRef(inner.ref);
1687
+ if (isTokenRefValue(inner)) followRef(inner);
1637
1688
  }
1638
1689
  }
1639
1690
  /** A `token()` ref marker — `{ ref: 'ns/name' }` — in a value position. */
package/dist/Token.d.ts CHANGED
@@ -21,6 +21,16 @@ type ResolvedTokenLiteral = string | number | boolean | undefined;
21
21
  * tokens pass no context and resolve against the consumer's keys directly.
22
22
  */
23
23
  type TokenSiblingLookup = (qualifiedName: string, context?: SystemLink) => Token | undefined;
24
+ /**
25
+ * Fallback for system-scoped refs with NO consumer entry: the var reference
26
+ * into the pinned system's regenerated node sheet (`var(--<nodePrefix>-…)`).
27
+ * The node sheet emits all its tokens, so the reference always resolves on
28
+ * the page — `undefined` only when the system isn't pinned.
29
+ */
30
+ type LinkedVarRefLookup = (system: {
31
+ id: string;
32
+ version: string;
33
+ }, qualifiedName: string) => string | undefined;
24
34
  declare class Token {
25
35
  #private;
26
36
  readonly name: string;
@@ -37,6 +47,7 @@ declare class Token {
37
47
  prefixGetter: () => string;
38
48
  definition: TokenDefinition;
39
49
  lookup: TokenSiblingLookup;
50
+ linkedVarRef?: LinkedVarRefLookup;
40
51
  groupTypeGetter: () => TokenType | undefined;
41
52
  });
42
53
  /**
@@ -62,4 +73,4 @@ declare class Token {
62
73
  };
63
74
  }
64
75
  //#endregion
65
- export { ResolvedTokenLiteral, Token, TokenSiblingLookup };
76
+ export { LinkedVarRefLookup, ResolvedTokenLiteral, Token, TokenSiblingLookup };
package/dist/Token.js CHANGED
@@ -13,6 +13,7 @@ var Token = class {
13
13
  link;
14
14
  #prefixGetter;
15
15
  #lookup;
16
+ #linkedVarRef;
16
17
  #groupTypeGetter;
17
18
  #derived;
18
19
  constructor(args) {
@@ -24,6 +25,7 @@ var Token = class {
24
25
  this.link = args.definition.link;
25
26
  this.#prefixGetter = args.prefixGetter;
26
27
  this.#lookup = args.lookup;
28
+ this.#linkedVarRef = args.linkedVarRef;
27
29
  this.#groupTypeGetter = args.groupTypeGetter;
28
30
  }
29
31
  /**
@@ -46,6 +48,7 @@ var Token = class {
46
48
  const link = this.link;
47
49
  const prefixGetter = this.#prefixGetter;
48
50
  const lookup = this.#lookup;
51
+ const linkedVarRef = this.#linkedVarRef;
49
52
  const groupTypeGetter = this.#groupTypeGetter;
50
53
  this.#derived = {
51
54
  namespace,
@@ -58,10 +61,10 @@ var Token = class {
58
61
  return `var(${buildCssVar(prefixGetter(), namespace, name)})`;
59
62
  },
60
63
  get value() {
61
- return chaseLiteral(tokenValue, lookup, link);
64
+ return chaseLiteral(tokenValue, lookup, link, void 0, linkedVarRef);
62
65
  },
63
66
  get cssValueType() {
64
- const literal = chaseLiteral(tokenValue, lookup, link);
67
+ const literal = chaseLiteral(tokenValue, lookup, link, void 0, linkedVarRef);
65
68
  return resolveTokenValueType({
66
69
  value: typeof literal === "string" ? literal : String(tokenValue),
67
70
  type: tokenType
@@ -69,7 +72,7 @@ var Token = class {
69
72
  },
70
73
  *modifierValues() {
71
74
  if (!modifiers) return;
72
- for (const [key, value] of Object.entries(modifiers)) yield [key, resolveModifierLiteral(value, lookup, link)];
75
+ for (const [key, value] of Object.entries(modifiers)) yield [key, resolveModifierLiteral(value, lookup, link, linkedVarRef)];
73
76
  }
74
77
  };
75
78
  }
@@ -100,20 +103,31 @@ function collectModifiers(definition) {
100
103
  }
101
104
  return count > 0 ? modifiers : void 0;
102
105
  }
103
- function chaseLiteral(value, lookup, context, seen = /* @__PURE__ */ new Set()) {
106
+ function chaseLiteral(value, lookup, context, seen = /* @__PURE__ */ new Set(), linkedVarRef) {
104
107
  if (isTokenRef(value)) {
105
- const seenKey = `${context?.systemId ?? ""}:${value.ref}`;
108
+ let refContext = context;
109
+ if (value.scope === "consumer") refContext = void 0;
110
+ else if (value.system) refContext = {
111
+ kind: "token",
112
+ systemId: value.system.id,
113
+ systemVersion: value.system.version,
114
+ sourceKey: value.ref
115
+ };
116
+ const seenKey = `${refContext?.systemId ?? ""}:${value.ref}`;
106
117
  if (seen.has(seenKey)) return void 0;
107
118
  seen.add(seenKey);
108
- const next = lookup(value.ref, context);
109
- if (!next) return void 0;
110
- return chaseLiteral(next.value, lookup, next.link, seen);
119
+ const next = lookup(value.ref, refContext);
120
+ if (!next) {
121
+ if (value.system && linkedVarRef) return linkedVarRef(value.system, value.ref);
122
+ return;
123
+ }
124
+ return chaseLiteral(next.value, lookup, next.link, seen, linkedVarRef);
111
125
  }
112
126
  if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
113
127
  }
114
- function resolveModifierLiteral(value, lookup, context) {
115
- if (typeof value === "object" && value !== null && "value" in value) return chaseLiteral(value.value, lookup, context);
116
- return chaseLiteral(value, lookup, context);
128
+ function resolveModifierLiteral(value, lookup, context, linkedVarRef) {
129
+ if (typeof value === "object" && value !== null && "value" in value) return chaseLiteral(value.value, lookup, context, void 0, linkedVarRef);
130
+ return chaseLiteral(value, lookup, context, void 0, linkedVarRef);
117
131
  }
118
132
  //#endregion
119
133
  export { Token };
@@ -1,5 +1,5 @@
1
1
  import { SerializedTokenGroup, TokenGroupDefinition } from "./types.js";
2
- import { Token, TokenSiblingLookup } from "./Token.js";
2
+ import { LinkedVarRefLookup, Token, TokenSiblingLookup } from "./Token.js";
3
3
 
4
4
  //#region src/TokenGroup.d.ts
5
5
  type StylePropertiesLookup = (namespace: string) => readonly string[];
@@ -14,6 +14,7 @@ declare class TokenGroup {
14
14
  prefixGetter: () => string;
15
15
  definition: TokenGroupDefinition;
16
16
  tokenLookup: TokenSiblingLookup;
17
+ linkedVarRef?: LinkedVarRefLookup;
17
18
  stylePropertiesLookup: StylePropertiesLookup;
18
19
  });
19
20
  get derived(): {
@@ -28,6 +28,7 @@ var TokenGroup = class {
28
28
  prefixGetter: args.prefixGetter,
29
29
  definition: tokenDef,
30
30
  lookup: args.tokenLookup,
31
+ linkedVarRef: args.linkedVarRef,
31
32
  groupTypeGetter
32
33
  }));
33
34
  this.tokens = tokens;
@@ -17,8 +17,14 @@ declare function applyComponentExtension(def: ComponentDefinition, patch: Compon
17
17
  /**
18
18
  * Apply an engine-generated inverse. Unlike payloads, inverses carry
19
19
  * removals (`null` reverts an added path), so removal is permitted here.
20
+ * `lenient` skips stale paths (removals of keys that no longer exist,
21
+ * children that left the family) instead of throwing — the extension
22
+ * DELETE path uses it so a source-shape change can never trap a consumer
23
+ * with an extension they cannot remove.
20
24
  */
21
- declare function applyComponentExtensionInverse(def: ComponentDefinition, inverse: ComponentExtension): {
25
+ declare function applyComponentExtensionInverse(def: ComponentDefinition, inverse: ComponentExtension, options?: {
26
+ lenient?: boolean;
27
+ }): {
22
28
  result: ComponentDefinition;
23
29
  };
24
30
  /**
package/dist/extension.js CHANGED
@@ -31,12 +31,28 @@ function isMergeable(value) {
31
31
  return isPlainObject(value) && !isMarker(value);
32
32
  }
33
33
  /**
34
+ * A consumer-authored `token()` ref means the CONSUMER's namespace — stamp
35
+ * it so downstream resolution (consumer derived tables, node replay) never
36
+ * mistakes it for a source-namespace ref riding a linked definition.
37
+ * System-scoped refs (barrel `token()` utilities) and already-scoped refs
38
+ * pass through unchanged. Applied to payload values only — inverses carry
39
+ * values captured from the definition, whose scoping is already correct.
40
+ */
41
+ function stampConsumerScope(value) {
42
+ if (!isPlainObject(value)) return value;
43
+ if (value.__kind === "token" && value.scope === void 0 && value.system === void 0) return {
44
+ ...value,
45
+ scope: "consumer"
46
+ };
47
+ return value;
48
+ }
49
+ /**
34
50
  * Merge `patch` into `base` (copy-on-write) and collect the inverse patch.
35
51
  * Returns the merged node; writes each touched key's inverse into `inverse`.
36
52
  * `allowRemoval` is false for authored payloads (additive only) and true
37
53
  * when applying an engine-generated inverse, whose `null`s revert additions.
38
54
  */
39
- function mergeNode(base, patch, inverse, path, allowRemoval) {
55
+ function mergeNode(base, patch, inverse, path, allowRemoval, label = "Component extension", lenient = false) {
40
56
  const result = { ...base };
41
57
  for (const [key, patchValue] of Object.entries(patch)) {
42
58
  if (patchValue === void 0) continue;
@@ -44,8 +60,11 @@ function mergeNode(base, patch, inverse, path, allowRemoval) {
44
60
  const had = Object.hasOwn(base, key);
45
61
  const baseValue = base[key];
46
62
  if (patchValue === null) {
47
- if (!allowRemoval) throw new Error(`Component extension: "${keyPath}" is null — extensions add and override values but never remove them.`);
48
- if (!had) throw new Error(`Component extension: "${keyPath}" does not exist, so the inverse cannot remove it — the stored inverse is stale.`);
63
+ if (!allowRemoval) throw new Error(`${label}: "${keyPath}" is null — extensions add and override values but never remove them.`);
64
+ if (!had) {
65
+ if (lenient) continue;
66
+ throw new Error(`${label}: "${keyPath}" does not exist, so the inverse cannot remove it — the stored inverse is stale.`);
67
+ }
49
68
  delete result[key];
50
69
  inverse[key] = baseValue;
51
70
  continue;
@@ -53,13 +72,13 @@ function mergeNode(base, patch, inverse, path, allowRemoval) {
53
72
  if (isMergeable(patchValue)) {
54
73
  const childBase = isMergeable(baseValue) ? baseValue : {};
55
74
  const childInverse = {};
56
- result[key] = mergeNode(childBase, patchValue, childInverse, keyPath, allowRemoval);
75
+ result[key] = mergeNode(childBase, patchValue, childInverse, keyPath, allowRemoval, label, lenient);
57
76
  if (!had) inverse[key] = null;
58
77
  else if (!isMergeable(baseValue)) inverse[key] = baseValue;
59
78
  else if (Object.keys(childInverse).length > 0) inverse[key] = childInverse;
60
79
  continue;
61
80
  }
62
- result[key] = patchValue;
81
+ result[key] = allowRemoval ? patchValue : stampConsumerScope(patchValue);
63
82
  inverse[key] = had ? baseValue : null;
64
83
  }
65
84
  return result;
@@ -73,11 +92,11 @@ function assertExtendableRoots(patch) {
73
92
  * definition fields (merged onto the parent) and the `subcomponents` block
74
93
  * (each entry merged onto the matching `__subcomponents` child).
75
94
  */
76
- function applyPatch(def, patch, allowRemoval) {
95
+ function applyPatch(def, patch, allowRemoval, lenient = false) {
77
96
  assertExtendableRoots(patch);
78
97
  const { subcomponents: subPatches, ...fieldPatch } = patch;
79
98
  const inverse = {};
80
- const result = mergeNode(def, fieldPatch, inverse, "", allowRemoval);
99
+ const result = mergeNode(def, fieldPatch, inverse, "", allowRemoval, void 0, lenient);
81
100
  if (subPatches !== void 0) {
82
101
  if (!isMergeable(subPatches)) throw new Error("Component extension: \"subcomponents\" must be an object mapping child component names to their overrides.");
83
102
  const children = def.__subcomponents;
@@ -87,6 +106,7 @@ function applyPatch(def, patch, allowRemoval) {
87
106
  if (childPatch === void 0) continue;
88
107
  const child = children?.[childName];
89
108
  if (!child) {
109
+ if (lenient) continue;
90
110
  const known = Object.keys(children ?? {});
91
111
  const hint = known.length > 0 ? `known subcomponents are ${known.map((n) => `"${n}"`).join(", ")}.` : "this component has no subcomponents.";
92
112
  throw new Error(`Component extension: subcomponent "${childName}" does not exist — ${hint}`);
@@ -95,7 +115,7 @@ function applyPatch(def, patch, allowRemoval) {
95
115
  if (Object.hasOwn(childPatch, "subcomponents")) throw new Error(`Component extension: subcomponent "${childName}" cannot declare nested subcomponents.`);
96
116
  assertExtendableRoots(childPatch);
97
117
  const childInverse = {};
98
- mergedChildren[childName] = mergeNode(child, childPatch, childInverse, `subcomponents.${childName}`, allowRemoval);
118
+ mergedChildren[childName] = mergeNode(child, childPatch, childInverse, `subcomponents.${childName}`, allowRemoval, void 0, lenient);
99
119
  if (Object.keys(childInverse).length > 0) subInverse[childName] = childInverse;
100
120
  }
101
121
  result.__subcomponents = mergedChildren;
@@ -117,9 +137,13 @@ function applyComponentExtension(def, patch) {
117
137
  /**
118
138
  * Apply an engine-generated inverse. Unlike payloads, inverses carry
119
139
  * removals (`null` reverts an added path), so removal is permitted here.
140
+ * `lenient` skips stale paths (removals of keys that no longer exist,
141
+ * children that left the family) instead of throwing — the extension
142
+ * DELETE path uses it so a source-shape change can never trap a consumer
143
+ * with an extension they cannot remove.
120
144
  */
121
- function applyComponentExtensionInverse(def, inverse) {
122
- return { result: applyPatch(def, inverse, true).result };
145
+ function applyComponentExtensionInverse(def, inverse, options) {
146
+ return { result: applyPatch(def, inverse, true, options?.lenient ?? false).result };
123
147
  }
124
148
  /**
125
149
  * Apply an extension payload to one component inside a FLAT serialized
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ASSET_CLASS_CAPABILITIES, AssetKind, isPlaceable } from "./asset-kind.js";
2
- import { AnyRef, AssetGroupName, AssetGroupRef, AssetName, AssetRef, ComponentName, ComponentRef, CompositeName, CompositeRef, CompositeRefBuilder, ModeName, ModeRef, MotionName, RegisteredAssetGroups, RegisteredComponents, RegisteredCompositeStyles, RegisteredModes, RegisteredModifiers, RegisteredMotion, RegisteredStyleProps, RegisteredTokenGroups, StylePropName, StylePropRef, TagName, TagRef, TokenGroupName, TokenGroupRef, TokenName, TokenQualifiedName, TokenRawNameRegistry, TokenRef, asset, assetGroup, component, composite, isAssetGroupRef, isAssetRef, isComponentRef, isCompositeRef, isModeRef, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, mode, styleProp, tag, token, tokenGroup } from "./refs.js";
2
+ import { AnyRef, AssetGroupName, AssetGroupRef, AssetName, AssetRef, ComponentName, ComponentRef, CompositeName, CompositeRef, CompositeRefBuilder, ModeName, ModeRef, MotionName, RegisteredAssetGroups, RegisteredComponents, RegisteredCompositeStyles, RegisteredModes, RegisteredModifiers, RegisteredMotion, RegisteredStyleProps, RegisteredTokenGroups, StylePropName, StylePropRef, TagName, TagRef, TokenGroupName, TokenGroupRef, TokenName, TokenQualifiedName, TokenRawNameRegistry, TokenRef, asset, assetGroup, component, composite, isAssetGroupRef, isAssetRef, isComponentRef, isCompositeRef, isModeRef, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, mode, styleProp, systemToken, tag, token, tokenGroup } from "./refs.js";
3
3
  import { ColorFn, ColorKeyword, CssAngle, CssColor, CssLength, CssPercentage, CssRatio, CssTime, CssValue, CssValueTypeName, CssVarRef, HexColor, HslColor, RgbColor } from "./types/css-values.js";
4
4
  import { ColorExpression, ColorSpace, ColorValue, GradientStop, GradientValue, LengthOrPercent, LineDirection, LinearGradientExpr, MixExpr, RadialGradientExpr, RadialSize, TokenRefToCss, alpha, isColorExpression, isLinearGradientExpr, isMixExpr, isRadialGradientExpr, linearGradient, mix, radialGradient, resolveColorExpression } from "./colorExpressions.js";
5
5
  import { MOTION_CSS_DIRECTIONS, MOTION_CSS_FILL_MODES, MOTION_CSS_PLAY_STATES, MOTION_CSS_PROPERTY_PREFIXES, MOTION_JS_DRAG_AXES, MOTION_JS_LAYOUT_MODES, MOTION_JS_REPEAT_TYPES, MOTION_JS_SPRING_FIELDS, MOTION_JS_TRANSITION_TYPES, MOTION_JS_TWEEN_FIELDS } from "./motion-constants.js";
@@ -33,9 +33,10 @@ import { ELEMENT_MARKER_KIND, ElementMarker, OpaqueLeafPredicate, hasElementMark
33
33
  import { LinkedComponentValue, applyComponentExtension, applyComponentExtensionInverse, extendSerializedComponents, linkedComponent } from "./extension.js";
34
34
  import { collectFontFaceCss, deriveFontFaceCss, familiesInRawCss } from "./font-face.js";
35
35
  import { interpolate } from "./interpolate.js";
36
+ import { LinkedNameDeclaration, LinkedNodeIdentity, LinkedNodePrefix, assignLinkedNodePrefixes, resolveDeclaredNames } from "./linkedNodePrefixes.js";
36
37
  import { RegistryAliasSource, buildRegistryAliases, slugifyLinkedName } from "./registry-aliases.js";
37
38
  import { resolveRegistryDir } from "./registry-dir.js";
38
39
  import { ModeBackedModifierDefinition, ModeBackedModifierInput, ModeBackedModifierLookup, ModifierTree, OverrideModeRef, OverrideRow, buildModeBackedModifierLookup, buildNestedModifierUpdate, createModeBackedModifierLookup, mergeModifierUpdates, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, overrideRowsToModifierTree, resolveOverrideRow, resolveOverrideRowValue } from "./token-override-rows.js";
39
40
  import { rem } from "./units.js";
40
41
  import { EntityKind } from "@yahoo/uds-create-types/entity";
41
- export { ASSET_CLASS_CAPABILITIES, type AnyRef, type AnyStylePropDefinition, type ArbitrarySpec, AssetGroup, type AssetGroupBuilder, type AssetGroupConfig, type AssetGroupDefinition, type AssetGroupName, type AssetGroupRef, type AssetKind, type AssetName, type AssetRef, type BaseStyles, type BooleanMarker, type BoundComponent, type BuildOptions, CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS, type CanvasRole, type CanvasRoleEntry, type CanvasRoleEntryInput, type CanvasRolesDefinition, type CanvasRolesDefinitionInput, type CanvasRolesInputConstraint, type ColorCssProperty, type ColorExpression, type ColorFn, type ColorKeyword, type ColorSpace, type ColorValue, Component, type ComponentBuilder, type ComponentBuilderMethods, type ComponentDefinition, type ComponentExtension, type ComponentExtensionRecord, ComponentGroup, type ComponentGroupDefinition, type ComponentKind, type ComponentMetadata, type ComponentName, type ComponentRef, type ComponentRenderFn, type CompositeInfo, type CompositeName, type CompositeRef, type CompositeRefBuilder, CompositeStyle, type CompositeStyleDefinition, type CompositeStyleObject, type CompoundPropsEntry, Config, type ConfigCallbackHelpers, type ConfigDiagnostic, type ConfigDiagnosticDefinition, ConfigValidationError, type Css, type CssAngle, type CssClassName, type CssColor, type CssDeclaration, type CssGlobalKeyword, type CssLength, CssMotionDef, type CssMotionDefinition, type CssMotionFields, type CssPercentage, type CssPropertyName, type CssPropertyValues, type CssPropertyWithKeywords, type CssRatio, type CssSelector, type CssSlotMotion, type CssTime, type CssValue, type CssValueTypeName, type CssVar, type CssVarRef, type DataAttrs, type DefineComponentFn, type DefinedComponent, type DefinedMotion, type DefinedProvider, type DefinedStyleProp, type DefinedTokenGroup, type DependenciesQuery, type DependencyKind, type DependencyRef, type DependentsQuery, ELEMENT_MARKER_KIND, type ElementMarker, type EntityKind, type FontAssetGroupConfig, type FontAssetGroupDefinition, type FontAssetMember, type FunctionInfo, type GlobalStylesDef, type GradientStop, type GradientValue, type HexColor, type HslColor, type IconAssetGroupConfig, type IconAssetGroupDefinition, type IconAssetMember, type IconAssetMetadata, JsMotionDef, type JsMotionDefinition, type JsMotionFields, type JsSlotMotion, Layer, type LayerInput, type LayerMarker, type LayerPropsMap, type LengthOrPercent, type LineDirection, type LinearGradientExpr, type LinkedComponentValue, type LinkedSystemPin, type LinkedSystemsInput, type LiteralFor, MOTION_CSS_DEFINITION_KEYS, MOTION_CSS_DIRECTIONS, MOTION_CSS_FILL_MODES, MOTION_CSS_PLAY_STATES, MOTION_CSS_PROPERTY_PREFIXES, MOTION_JS_DEFINITION_KEYS, MOTION_JS_DRAG_AXES, MOTION_JS_FIELD_KEYS, MOTION_JS_LAYOUT_MODES, MOTION_JS_REPEAT_TYPES, MOTION_JS_SPRING_FIELDS, MOTION_JS_TRANSITION_TYPES, MOTION_JS_TWEEN_FIELDS, type MixExpr, Mode, type ModeBackedModifierDefinition, type ModeBackedModifierInput, type ModeBackedModifierLookup, type ModeDefinition, type ModeName, ModeOption, type ModeOptionDefinition, type ModeRef, Modifier, type ModifierDefinition, type ModifierTree, type MotionDef, type MotionDefinitionInput, type MotionDragBox, type MotionKeyframes, type MotionMarker, type MotionMetadata, type MotionName, type MotionState, type MotionStateKeyframe, type MotionTransition, type MotionVariants, type MotionViewportOptions, type NumberMarker, type OpacityPairSpec, type OpaqueLeafPredicate, type OverrideModeRef, type OverrideRow, PREVIEW_SEED_KEY, type PlaygroundOptions, type PlaygroundPage, type PlaygroundSpec, type PreviewAxisMarker, type PreviewCallbackHelpers, type PreviewDefinition, type PreviewPropsRule, type PrimitivePropKind, type PropBase, type PropBinding, type PropInfo, type PropKind, Provider, type RadialGradientExpr, type RadialSize, type RawToken, type RegisteredAssetGroups, type RegisteredComponents, type RegisteredCompositeStyles, type RegisteredModes, type RegisteredModifiers, type RegisteredMotion, type RegisteredStyleProps, type RegisteredTokenGroups, type RegistryAliasSource, type RequiredBrand, type ResolvedCompoundOverrides, type ResolvedTokenLiteral, type RgbColor, SOURCE_PATH_KEY, type SerializedAssetGroup, type SerializedComponentGroup, type SerializedConfig, type SerializedFontAssetGroup, type SerializedIconAssetGroup, type SerializedPlaygroundOptions, type SerializedTokenGroup, type SlotInfo, type SlotMarker, type SlotMotion, type SlotRef, type SlotValueKind, type SlotValueType, type StringMarker, StyleProp, type StylePropDefinition, type StylePropInfo, type StylePropKeyword, type StylePropMetadata, type StylePropName, type StylePropProperty, type StylePropRef, type StylePropTokenUsage, type SystemLink, type TagName, type TagRef, Token, type TokenDefinition, type TokenDefinitionFor, TokenGroup, type TokenGroupDefinition, type TokenGroupDefinitionFor, type TokenGroupMetadata, type TokenGroupName, type TokenGroupRef, type TokenModifierKey, type TokenModifierValue, type TokenName, type TokenQualifiedName, type TokenRawNameRegistry, type TokenRawValue, type TokenRef, type TokenRefToCss, type TokenType, type TokenValue, type TypedSlotRef, VOID_HTML_TAGS, type ValuesEntry, type VariantInfo, type VariantMarker, type VariantMarkerArray, type VariantMarkerObject, alpha, applyComponentExtension, applyComponentExtensionInverse, asChild, asset, assetGroup, attachSourcePath, boolean, buildModeBackedModifierLookup, buildNestedModifierUpdate, buildRegistryAliases, captureCallerPath, collectFontFaceCss, component, composite, createModeBackedModifierLookup, cssClassName, cssDeclaration, cssSelector, cssVar, defineAssetGroup, defineAssetIcon, defineComponent, defineComponentGroup, defineCompositeStyle, defineMode, defineModifier, defineMotion, defineProvider, defineStyleProp, defineTokenGroup, deriveFontFaceCss, extendSerializedComponents, familiesInRawCss, findComponentReferrers, hasElementMarkerDeep, interpolate, isAssetGroupRef, isAssetRef, isBoolMarker, isColorExpression, isComponentRef, isCompositeRef, isElementLikeValue, isElementMarker, isLayerMarker, isLinearGradientExpr, isMixExpr, isModeRef, isMotionMarker, isNumberMarker, isPlaceable, isPreviewAxisMarker, isRadialGradientExpr, isSafeClassNameValue, isSlotMarker, isStringMarker, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, isVariantArrayMarker, isVariantMarker, linearGradient, linkedComponent, makeTokenRefToCss, matchesPreviewWhen, mergeModifierUpdates, mix, mode, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, motion, number, overrideRowsToModifierTree, parseRegistryKey, radialGradient, readSourcePath, rem, resolveAssetRefCss, resolveColorExpression, resolveFontStack, resolveOverrideRow, resolveOverrideRowValue, resolvePreviewRules, resolveRegistryDir, reviveElementMarkersDeep, serializeElementsDeep, slot, slugifyLinkedName, string, styleProp, tag, token, tokenGroup, variant };
42
+ export { ASSET_CLASS_CAPABILITIES, type AnyRef, type AnyStylePropDefinition, type ArbitrarySpec, AssetGroup, type AssetGroupBuilder, type AssetGroupConfig, type AssetGroupDefinition, type AssetGroupName, type AssetGroupRef, type AssetKind, type AssetName, type AssetRef, type BaseStyles, type BooleanMarker, type BoundComponent, type BuildOptions, CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS, type CanvasRole, type CanvasRoleEntry, type CanvasRoleEntryInput, type CanvasRolesDefinition, type CanvasRolesDefinitionInput, type CanvasRolesInputConstraint, type ColorCssProperty, type ColorExpression, type ColorFn, type ColorKeyword, type ColorSpace, type ColorValue, Component, type ComponentBuilder, type ComponentBuilderMethods, type ComponentDefinition, type ComponentExtension, type ComponentExtensionRecord, ComponentGroup, type ComponentGroupDefinition, type ComponentKind, type ComponentMetadata, type ComponentName, type ComponentRef, type ComponentRenderFn, type CompositeInfo, type CompositeName, type CompositeRef, type CompositeRefBuilder, CompositeStyle, type CompositeStyleDefinition, type CompositeStyleObject, type CompoundPropsEntry, Config, type ConfigCallbackHelpers, type ConfigDiagnostic, type ConfigDiagnosticDefinition, ConfigValidationError, type Css, type CssAngle, type CssClassName, type CssColor, type CssDeclaration, type CssGlobalKeyword, type CssLength, CssMotionDef, type CssMotionDefinition, type CssMotionFields, type CssPercentage, type CssPropertyName, type CssPropertyValues, type CssPropertyWithKeywords, type CssRatio, type CssSelector, type CssSlotMotion, type CssTime, type CssValue, type CssValueTypeName, type CssVar, type CssVarRef, type DataAttrs, type DefineComponentFn, type DefinedComponent, type DefinedMotion, type DefinedProvider, type DefinedStyleProp, type DefinedTokenGroup, type DependenciesQuery, type DependencyKind, type DependencyRef, type DependentsQuery, ELEMENT_MARKER_KIND, type ElementMarker, type EntityKind, type FontAssetGroupConfig, type FontAssetGroupDefinition, type FontAssetMember, type FunctionInfo, type GlobalStylesDef, type GradientStop, type GradientValue, type HexColor, type HslColor, type IconAssetGroupConfig, type IconAssetGroupDefinition, type IconAssetMember, type IconAssetMetadata, JsMotionDef, type JsMotionDefinition, type JsMotionFields, type JsSlotMotion, Layer, type LayerInput, type LayerMarker, type LayerPropsMap, type LengthOrPercent, type LineDirection, type LinearGradientExpr, type LinkedComponentValue, type LinkedNameDeclaration, type LinkedNodeIdentity, type LinkedNodePrefix, type LinkedSystemPin, type LinkedSystemsInput, type LiteralFor, MOTION_CSS_DEFINITION_KEYS, MOTION_CSS_DIRECTIONS, MOTION_CSS_FILL_MODES, MOTION_CSS_PLAY_STATES, MOTION_CSS_PROPERTY_PREFIXES, MOTION_JS_DEFINITION_KEYS, MOTION_JS_DRAG_AXES, MOTION_JS_FIELD_KEYS, MOTION_JS_LAYOUT_MODES, MOTION_JS_REPEAT_TYPES, MOTION_JS_SPRING_FIELDS, MOTION_JS_TRANSITION_TYPES, MOTION_JS_TWEEN_FIELDS, type MixExpr, Mode, type ModeBackedModifierDefinition, type ModeBackedModifierInput, type ModeBackedModifierLookup, type ModeDefinition, type ModeName, ModeOption, type ModeOptionDefinition, type ModeRef, Modifier, type ModifierDefinition, type ModifierTree, type MotionDef, type MotionDefinitionInput, type MotionDragBox, type MotionKeyframes, type MotionMarker, type MotionMetadata, type MotionName, type MotionState, type MotionStateKeyframe, type MotionTransition, type MotionVariants, type MotionViewportOptions, type NumberMarker, type OpacityPairSpec, type OpaqueLeafPredicate, type OverrideModeRef, type OverrideRow, PREVIEW_SEED_KEY, type PlaygroundOptions, type PlaygroundPage, type PlaygroundSpec, type PreviewAxisMarker, type PreviewCallbackHelpers, type PreviewDefinition, type PreviewPropsRule, type PrimitivePropKind, type PropBase, type PropBinding, type PropInfo, type PropKind, Provider, type RadialGradientExpr, type RadialSize, type RawToken, type RegisteredAssetGroups, type RegisteredComponents, type RegisteredCompositeStyles, type RegisteredModes, type RegisteredModifiers, type RegisteredMotion, type RegisteredStyleProps, type RegisteredTokenGroups, type RegistryAliasSource, type RequiredBrand, type ResolvedCompoundOverrides, type ResolvedTokenLiteral, type RgbColor, SOURCE_PATH_KEY, type SerializedAssetGroup, type SerializedComponentGroup, type SerializedConfig, type SerializedFontAssetGroup, type SerializedIconAssetGroup, type SerializedPlaygroundOptions, type SerializedTokenGroup, type SlotInfo, type SlotMarker, type SlotMotion, type SlotRef, type SlotValueKind, type SlotValueType, type StringMarker, StyleProp, type StylePropDefinition, type StylePropInfo, type StylePropKeyword, type StylePropMetadata, type StylePropName, type StylePropProperty, type StylePropRef, type StylePropTokenUsage, type SystemLink, type TagName, type TagRef, Token, type TokenDefinition, type TokenDefinitionFor, TokenGroup, type TokenGroupDefinition, type TokenGroupDefinitionFor, type TokenGroupMetadata, type TokenGroupName, type TokenGroupRef, type TokenModifierKey, type TokenModifierValue, type TokenName, type TokenQualifiedName, type TokenRawNameRegistry, type TokenRawValue, type TokenRef, type TokenRefToCss, type TokenType, type TokenValue, type TypedSlotRef, VOID_HTML_TAGS, type ValuesEntry, type VariantInfo, type VariantMarker, type VariantMarkerArray, type VariantMarkerObject, alpha, applyComponentExtension, applyComponentExtensionInverse, asChild, asset, assetGroup, assignLinkedNodePrefixes, attachSourcePath, boolean, buildModeBackedModifierLookup, buildNestedModifierUpdate, buildRegistryAliases, captureCallerPath, collectFontFaceCss, component, composite, createModeBackedModifierLookup, cssClassName, cssDeclaration, cssSelector, cssVar, defineAssetGroup, defineAssetIcon, defineComponent, defineComponentGroup, defineCompositeStyle, defineMode, defineModifier, defineMotion, defineProvider, defineStyleProp, defineTokenGroup, deriveFontFaceCss, extendSerializedComponents, familiesInRawCss, findComponentReferrers, hasElementMarkerDeep, interpolate, isAssetGroupRef, isAssetRef, isBoolMarker, isColorExpression, isComponentRef, isCompositeRef, isElementLikeValue, isElementMarker, isLayerMarker, isLinearGradientExpr, isMixExpr, isModeRef, isMotionMarker, isNumberMarker, isPlaceable, isPreviewAxisMarker, isRadialGradientExpr, isSafeClassNameValue, isSlotMarker, isStringMarker, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, isVariantArrayMarker, isVariantMarker, linearGradient, linkedComponent, makeTokenRefToCss, matchesPreviewWhen, mergeModifierUpdates, mix, mode, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, motion, number, overrideRowsToModifierTree, parseRegistryKey, radialGradient, readSourcePath, rem, resolveAssetRefCss, resolveColorExpression, resolveDeclaredNames, resolveFontStack, resolveOverrideRow, resolveOverrideRowValue, resolvePreviewRules, resolveRegistryDir, reviveElementMarkersDeep, serializeElementsDeep, slot, slugifyLinkedName, string, styleProp, systemToken, tag, token, tokenGroup, variant };
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { AssetGroup } from "./AssetGroup.js";
4
4
  import { ASSET_CLASS_CAPABILITIES, isPlaceable } from "./asset-kind.js";
5
5
  import { resolveAssetRefCss, resolveFontStack } from "./asset-value.js";
6
6
  import { SOURCE_PATH_KEY, attachSourcePath, captureCallerPath, readSourcePath } from "./captureCallerPath.js";
7
- import { asset, assetGroup, component, composite, isAssetGroupRef, isAssetRef, isComponentRef, isCompositeRef, isModeRef, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, mode, styleProp, tag, token, tokenGroup } from "./refs.js";
7
+ import { asset, assetGroup, component, composite, isAssetGroupRef, isAssetRef, isComponentRef, isCompositeRef, isModeRef, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, mode, styleProp, systemToken, tag, token, tokenGroup } from "./refs.js";
8
8
  import { alpha, isColorExpression, isLinearGradientExpr, isMixExpr, isRadialGradientExpr, linearGradient, mix, radialGradient, resolveColorExpression } from "./colorExpressions.js";
9
9
  import { defineAssetGroup, defineAssetIcon } from "./defineAssetGroup.js";
10
10
  import { ELEMENT_MARKER_KIND, hasElementMarkerDeep, isElementLikeValue, isElementMarker, reviveElementMarkersDeep, serializeElementsDeep } from "./element-marker.js";
@@ -12,6 +12,8 @@ import { PREVIEW_SEED_KEY, isBoolMarker, isLayerMarker, isMotionMarker, isNumber
12
12
  import { Component, Layer, VOID_HTML_TAGS } from "./Component.js";
13
13
  import { ComponentGroup } from "./ComponentGroup.js";
14
14
  import { CompositeStyle } from "./CompositeStyle.js";
15
+ import { buildRegistryAliases, slugifyLinkedName } from "./registry-aliases.js";
16
+ import { assignLinkedNodePrefixes, resolveDeclaredNames } from "./linkedNodePrefixes.js";
15
17
  import { Mode, ModeOption } from "./Mode.js";
16
18
  import { Modifier } from "./Modifier.js";
17
19
  import { CssMotionDef, JsMotionDef, MOTION_CSS_DEFINITION_KEYS, MOTION_JS_DEFINITION_KEYS, MOTION_JS_FIELD_KEYS } from "./MotionDef.js";
@@ -28,9 +30,8 @@ import { asChild, boolean, defineComponent, defineComponentGroup, defineComposit
28
30
  import { collectFontFaceCss, deriveFontFaceCss, familiesInRawCss } from "./font-face.js";
29
31
  import { interpolate } from "./interpolate.js";
30
32
  import { MOTION_CSS_DIRECTIONS, MOTION_CSS_FILL_MODES, MOTION_CSS_PLAY_STATES, MOTION_CSS_PROPERTY_PREFIXES, MOTION_JS_DRAG_AXES, MOTION_JS_LAYOUT_MODES, MOTION_JS_REPEAT_TYPES, MOTION_JS_SPRING_FIELDS, MOTION_JS_TRANSITION_TYPES, MOTION_JS_TWEEN_FIELDS } from "./motion-constants.js";
31
- import { buildRegistryAliases, slugifyLinkedName } from "./registry-aliases.js";
32
33
  import { resolveRegistryDir } from "./registry-dir.js";
33
34
  import { buildModeBackedModifierLookup, buildNestedModifierUpdate, createModeBackedModifierLookup, mergeModifierUpdates, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, overrideRowsToModifierTree, resolveOverrideRow, resolveOverrideRowValue } from "./token-override-rows.js";
34
35
  import { CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS } from "./types/css-property-keywords.js";
35
36
  import { rem } from "./units.js";
36
- export { ASSET_CLASS_CAPABILITIES, AssetGroup, CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS, Component, ComponentGroup, CompositeStyle, Config, ConfigValidationError, CssMotionDef, ELEMENT_MARKER_KIND, JsMotionDef, Layer, MOTION_CSS_DEFINITION_KEYS, MOTION_CSS_DIRECTIONS, MOTION_CSS_FILL_MODES, MOTION_CSS_PLAY_STATES, MOTION_CSS_PROPERTY_PREFIXES, MOTION_JS_DEFINITION_KEYS, MOTION_JS_DRAG_AXES, MOTION_JS_FIELD_KEYS, MOTION_JS_LAYOUT_MODES, MOTION_JS_REPEAT_TYPES, MOTION_JS_SPRING_FIELDS, MOTION_JS_TRANSITION_TYPES, MOTION_JS_TWEEN_FIELDS, Mode, ModeOption, Modifier, PREVIEW_SEED_KEY, Provider, SOURCE_PATH_KEY, StyleProp, Token, TokenGroup, VOID_HTML_TAGS, alpha, applyComponentExtension, applyComponentExtensionInverse, asChild, asset, assetGroup, attachSourcePath, boolean, buildModeBackedModifierLookup, buildNestedModifierUpdate, buildRegistryAliases, captureCallerPath, collectFontFaceCss, component, composite, createModeBackedModifierLookup, cssClassName, cssDeclaration, cssSelector, cssVar, defineAssetGroup, defineAssetIcon, defineComponent, defineComponentGroup, defineCompositeStyle, defineMode, defineModifier, defineMotion, defineProvider, defineStyleProp, defineTokenGroup, deriveFontFaceCss, extendSerializedComponents, familiesInRawCss, findComponentReferrers, hasElementMarkerDeep, interpolate, isAssetGroupRef, isAssetRef, isBoolMarker, isColorExpression, isComponentRef, isCompositeRef, isElementLikeValue, isElementMarker, isLayerMarker, isLinearGradientExpr, isMixExpr, isModeRef, isMotionMarker, isNumberMarker, isPlaceable, isPreviewAxisMarker, isRadialGradientExpr, isSafeClassNameValue, isSlotMarker, isStringMarker, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, isVariantArrayMarker, isVariantMarker, linearGradient, linkedComponent, makeTokenRefToCss, matchesPreviewWhen, mergeModifierUpdates, mix, mode, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, motion, number, overrideRowsToModifierTree, parseRegistryKey, radialGradient, readSourcePath, rem, resolveAssetRefCss, resolveColorExpression, resolveFontStack, resolveOverrideRow, resolveOverrideRowValue, resolvePreviewRules, resolveRegistryDir, reviveElementMarkersDeep, serializeElementsDeep, slot, slugifyLinkedName, string, styleProp, tag, token, tokenGroup, variant };
37
+ export { ASSET_CLASS_CAPABILITIES, AssetGroup, CSS_GLOBAL_KEYWORDS, CSS_PROPERTY_KEYWORDS, Component, ComponentGroup, CompositeStyle, Config, ConfigValidationError, CssMotionDef, ELEMENT_MARKER_KIND, JsMotionDef, Layer, MOTION_CSS_DEFINITION_KEYS, MOTION_CSS_DIRECTIONS, MOTION_CSS_FILL_MODES, MOTION_CSS_PLAY_STATES, MOTION_CSS_PROPERTY_PREFIXES, MOTION_JS_DEFINITION_KEYS, MOTION_JS_DRAG_AXES, MOTION_JS_FIELD_KEYS, MOTION_JS_LAYOUT_MODES, MOTION_JS_REPEAT_TYPES, MOTION_JS_SPRING_FIELDS, MOTION_JS_TRANSITION_TYPES, MOTION_JS_TWEEN_FIELDS, Mode, ModeOption, Modifier, PREVIEW_SEED_KEY, Provider, SOURCE_PATH_KEY, StyleProp, Token, TokenGroup, VOID_HTML_TAGS, alpha, applyComponentExtension, applyComponentExtensionInverse, asChild, asset, assetGroup, assignLinkedNodePrefixes, attachSourcePath, boolean, buildModeBackedModifierLookup, buildNestedModifierUpdate, buildRegistryAliases, captureCallerPath, collectFontFaceCss, component, composite, createModeBackedModifierLookup, cssClassName, cssDeclaration, cssSelector, cssVar, defineAssetGroup, defineAssetIcon, defineComponent, defineComponentGroup, defineCompositeStyle, defineMode, defineModifier, defineMotion, defineProvider, defineStyleProp, defineTokenGroup, deriveFontFaceCss, extendSerializedComponents, familiesInRawCss, findComponentReferrers, hasElementMarkerDeep, interpolate, isAssetGroupRef, isAssetRef, isBoolMarker, isColorExpression, isComponentRef, isCompositeRef, isElementLikeValue, isElementMarker, isLayerMarker, isLinearGradientExpr, isMixExpr, isModeRef, isMotionMarker, isNumberMarker, isPlaceable, isPreviewAxisMarker, isRadialGradientExpr, isSafeClassNameValue, isSlotMarker, isStringMarker, isStylePropRef, isTagRef, isTokenGroupRef, isTokenRef, isVariantArrayMarker, isVariantMarker, linearGradient, linkedComponent, makeTokenRefToCss, matchesPreviewWhen, mergeModifierUpdates, mix, mode, modifierIdToPath, modifierPathToId, modifierTreeToOverrideRows, motion, number, overrideRowsToModifierTree, parseRegistryKey, radialGradient, readSourcePath, rem, resolveAssetRefCss, resolveColorExpression, resolveDeclaredNames, resolveFontStack, resolveOverrideRow, resolveOverrideRowValue, resolvePreviewRules, resolveRegistryDir, reviveElementMarkersDeep, serializeElementsDeep, slot, slugifyLinkedName, string, styleProp, systemToken, tag, token, tokenGroup, variant };
@@ -0,0 +1,73 @@
1
+ //#region src/linkedNodePrefixes.d.ts
2
+ /**
3
+ * Node-scoped CSS-prefix assignment for materialized linked systems.
4
+ *
5
+ * Every linked node (`{systemId}@{version}`) regenerates its CSS at consumer
6
+ * build time from its sealed `config.json`, with its `prefix` overridden to a
7
+ * composed, collision-free identity: `<consumerPrefix>-linked-<slug>`. One
8
+ * prefix per NODE (not per link path) — the module graph resolves each node's
9
+ * files once, so its lowered class names can only carry one prefix; sharing a
10
+ * node between parents shares byte-identical sealed content, so sharing the
11
+ * prefix is correct.
12
+ *
13
+ * The assignment must be identical everywhere it's consumed (pull-time shim
14
+ * generation, `uds build` CSS regeneration, the bundler loaders), so every
15
+ * consumer derives it from the same inputs with the same pure functions:
16
+ * node identities from the registry tree, display names from the declaring
17
+ * configs' `registerLinkedSystems` entries ({@link resolveDeclaredNames}),
18
+ * and the consumer's own prefix. Nothing is persisted — the registry tree is
19
+ * the source of truth.
20
+ */
21
+ /** Identity of one linked node, as pulled from the server closure. */
22
+ interface LinkedNodeIdentity {
23
+ systemId: string;
24
+ version: string;
25
+ /** Display-name snapshot captured at link time (from the consumer's
26
+ * `registerLinkedSystems` entry / the server's system record). */
27
+ name: string;
28
+ }
29
+ /** Assigned naming for one node. */
30
+ interface LinkedNodePrefix {
31
+ /** Filesystem/import-safe slug of the node's display name. */
32
+ slug: string;
33
+ /** The node's composed CSS identity — every var and class name of its
34
+ * regenerated CSS derives from this. */
35
+ cssPrefix: string;
36
+ }
37
+ /**
38
+ * Assign each node in a linked closure its slug + composed CSS prefix,
39
+ * keyed by `{systemId}@{version}`.
40
+ *
41
+ * Deterministic and input-order independent: nodes are processed sorted by
42
+ * `(systemId, version)`. Within a slug-collision group the first sorted node
43
+ * keeps the bare slug; a different system appends `-x<systemId[0..8]>`; the
44
+ * same system at another version appends `-v<version>` — so every node in
45
+ * the closure gets a unique, stable prefix.
46
+ *
47
+ * `consumerPrefix` is the consuming system's own `Config.prefix`. An empty
48
+ * prefix is disallowed as a base (a bare `linked-…` could collide with the
49
+ * consumer's unprefixed classes) — the node's own uuid fragment substitutes.
50
+ */
51
+ declare function assignLinkedNodePrefixes(nodes: LinkedNodeIdentity[], consumerPrefix: string): Map<string, LinkedNodePrefix>;
52
+ /** One `registerLinkedSystems` declaration observed while walking a
53
+ * closure: `declarerKey` is the declaring node's `{systemId}@{version}` pair
54
+ * (empty string for the consumer's own config). */
55
+ interface LinkedNameDeclaration {
56
+ /** The declared child's `{systemId}@{version}` pair key. */
57
+ key: string;
58
+ /** The declarer's display-name snapshot for the child. */
59
+ name: string;
60
+ /** The declaring node's pair key; `''` = the consumer root config. */
61
+ declarerKey: string;
62
+ }
63
+ /**
64
+ * Resolve each node's display name from the closure's declarations. A node
65
+ * can be declared by several parents under different name snapshots; the
66
+ * winner is the declaration with the lowest `declarerKey` in sort order (the
67
+ * consumer's own declarations sort first as `''`), so every tool that walks
68
+ * the same closure derives the same names — and therefore the same slugs and
69
+ * CSS prefixes — without any persisted mapping.
70
+ */
71
+ declare function resolveDeclaredNames(declarations: LinkedNameDeclaration[]): Map<string, string>;
72
+ //#endregion
73
+ export { LinkedNameDeclaration, LinkedNodeIdentity, LinkedNodePrefix, assignLinkedNodePrefixes, resolveDeclaredNames };