@yahoo/uds-create-config 5.90.1 → 5.90.3

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.
@@ -46,6 +46,7 @@ import { componentGetDetailMigration } from "../migrations/20261107213031_compon
46
46
  import { tokenGetDetailMigration } from "../migrations/20261108042210_token_get_detail.js";
47
47
  import { lintRulesByGroupMigration } from "../migrations/20261109144822_lint_rules_by_group.js";
48
48
  import { stringPropUniqueIdsMigration } from "../migrations/20261109205852_string_prop_unique_ids.js";
49
+ import { anatomyNodeOverridesMigration } from "../migrations/20261109214535_anatomy_node_overrides.js";
49
50
  import { CanvasRole } from "../entities/system/CanvasRole.js";
50
51
  import { GlobalStyle } from "../entities/system/GlobalStyle.js";
51
52
  import { Guidance } from "../entities/system/Guidance.js";
@@ -228,5 +229,6 @@ if (!registeredSchemaMigrations().has(20261107213031)) registerSchemaMigrations(
228
229
  if (!registeredSchemaMigrations().has(20261108042210)) registerSchemaMigrations(tokenGetDetailMigration);
229
230
  if (!registeredSchemaMigrations().has(20261109144822)) registerSchemaMigrations(lintRulesByGroupMigration);
230
231
  if (!registeredSchemaMigrations().has(20261109205852)) registerSchemaMigrations(stringPropUniqueIdsMigration);
232
+ if (!registeredSchemaMigrations().has(20261109214535)) registerSchemaMigrations(anatomyNodeOverridesMigration);
231
233
  //#endregion
232
234
  export { System };
@@ -661,6 +661,9 @@ interface ComponentElementBody {
661
661
  slots?: Record<string, string[]>;
662
662
  visible?: ElementVisibility;
663
663
  props?: Record<string, unknown>;
664
+ /** The keys of `props` the render writes after the layer's own spread, which win over the
665
+ * layer's style rules. */
666
+ overrides?: string[];
664
667
  text?: string;
665
668
  /** Event name → the state actions it runs, in json-render's `on` grammar. */
666
669
  on?: Record<string, {
@@ -1654,6 +1654,7 @@ const AnatomyNode = defineSubEntity({
1654
1654
  cssBehind: false,
1655
1655
  values: anatomyPropValue
1656
1656
  }) : z.record(z.string(), anatomyPropValue)).optional().describe("Props passed to what the node renders, keyed by prop or style-property name, as literal values. Content is not set here: a `slot` prop's content lands where a `{ \"element\": \"Slot\", \"props\": { \"name\": \"<prop>\" } }` node sits among a parent's `children` (on the root when there is none), and a `forward` prop (`{ \"type\": \"forward\", \"target\": \"label/children\" }`) routes it into that layer with no node entry. `$state` belongs to `visible` and to an `element` a prop chooses."),
1657
+ overrides: z.array(z.string()).optional().describe("Keys of `props` the render writes after the layer's spread, so they win over its style rules."),
1657
1658
  text: z.string().optional().describe("Literal text content, for a node that renders a fixed string."),
1658
1659
  repeat: z.strictObject({
1659
1660
  source: z.unknown(),
@@ -74,7 +74,7 @@ interface RecordedSource {
74
74
  * The dense-counter `2` a short-lived scheme stamped before the chain existed reads as the mint
75
75
  * that replaced it (see `detectedWireVersion`).
76
76
  */
77
- declare const SERIALIZED_CONFIG_VERSION = 20261109205852;
77
+ declare const SERIALIZED_CONFIG_VERSION = 20261109214535;
78
78
  interface SerializedConfig {
79
79
  /** See {@link SERIALIZED_CONFIG_VERSION}. Always written; a stored artifact may lack it. */
80
80
  readonly version: number;
@@ -6583,7 +6583,7 @@ var Config = class Config {
6583
6583
  * links from the provided sources. A declared `linkedKind` with no provided source throws. */
6584
6584
  hydrateFrom(stored, options) {
6585
6585
  const claimed = schemaVersionOf(stored);
6586
- if (claimed > 20261109205852) throw new SchemaVersionTooNew(claimed);
6586
+ if (claimed > 20261109214535) throw new SchemaVersionTooNew(claimed);
6587
6587
  const wire = upgradeSerializedConfig(stored);
6588
6588
  if (!Array.isArray(wire.ownedKinds) || typeof wire.items !== "object" || wire.items === null) throw new ConfigFormatError(`Config "${stored.name ?? "system-config"}" cannot be hydrated: this is not a serialized config-v2 config (no "ownedKinds"/"items"). A pre-cutover build artifact converts through the registered cutover migration — import the config type's module (e.g. \`configs/system\`) before hydrating.`);
6589
6589
  const leftover = wire.options;
@@ -1451,8 +1451,11 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1451
1451
  const slotValue = slot && !subtreeBinds(anatomy, key, slot.from) && !(positioned.has(slot.from) && isText(instanceProps[slot.from])) ? instanceProps[slot.from] : void 0;
1452
1452
  const siblingRoutes = layer ? (targetedRoutes.get(layer) ?? []).filter((route) => route !== slot) : [];
1453
1453
  const siblingValues = Object.fromEntries(siblingRoutes.filter((route) => instanceProps[route.from] !== void 0 && !subtreeBinds(anatomy, key, route.from)).map((route) => [intoName(route.into), instanceProps[route.from]]));
1454
+ const authored = authoredProps(config, node.props);
1455
+ const overriding = new Set(layer ? node.overrides ?? [] : []);
1456
+ const written = Object.fromEntries(Object.entries(authored).filter(([name]) => overriding.has(name)));
1454
1457
  const props = layer ? {
1455
- ...withoutKeys(authoredProps(config, node.props), ruleKeysFor(config, path, layer, state, pins)),
1458
+ ...withoutKeys(withoutKeys(authored, overriding), ruleKeysFor(config, path, layer, state, pins)),
1456
1459
  "data-uds-component": path,
1457
1460
  "data-uds-layer": layer,
1458
1461
  ...forwarded[layer],
@@ -1464,6 +1467,7 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1464
1467
  ...siblingValues,
1465
1468
  ...slot && slotValue !== void 0 ? { [intoName(slot.into)]: slotValue } : {},
1466
1469
  ...layerProps[layer],
1470
+ ...written,
1467
1471
  className: classesFor(config, path, layer, state, [
1468
1472
  isRoot ? styleClasses : forwardedSplits.get(layer)?.className,
1469
1473
  isRoot && !forwardsClassName ? instanceProps.className : void 0,
@@ -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 = 20261109205852;
18
+ declare const CURRENT_SCHEMA_VERSION = 20261109214535;
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 = 20261109205852;
16
+ const CURRENT_SCHEMA_VERSION = 20261109214535;
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 > 20261109205852) 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 > 20261109214535) 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 ?? 20261109205852;
105
+ const target = options?.target ?? 20261109214535;
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 ?? 20261109205852;
163
+ const target = options?.target ?? 20261109214535;
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 ?? 20261109205852;
182
+ const target = options?.target ?? 20261109214535;
183
183
  const entries = [];
184
184
  const held = [];
185
185
  const retired = [];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Additions only, so the envelope passes through as it is:
3
+ *
4
+ * - An anatomy node takes `overrides`, the keys of its `props` a layer's render writes after the
5
+ * layer's own spread, which win over the layer's style rules. A node without it reads as before:
6
+ * every literal is the layer's to replace. A stored config gains the list when its components are
7
+ * next read from source.
8
+ */
9
+ import type { SchemaMigration } from '../framework/schema-version';
10
+ export declare const ANATOMY_NODE_OVERRIDES_VERSION = 20261109214535;
11
+ export declare const anatomyNodeOverridesMigration: SchemaMigration;
@@ -0,0 +1,10 @@
1
+ //#region src/migrations/20261109214535_anatomy_node_overrides.ts
2
+ const ANATOMY_NODE_OVERRIDES_VERSION = 20261109214535;
3
+ const anatomyNodeOverridesMigration = {
4
+ version: ANATOMY_NODE_OVERRIDES_VERSION,
5
+ up(json) {
6
+ return json;
7
+ }
8
+ };
9
+ //#endregion
10
+ export { ANATOMY_NODE_OVERRIDES_VERSION, anatomyNodeOverridesMigration };