@yahoo/uds-create-config 5.54.0 → 5.55.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 (45) hide show
  1. package/dist/capture/node-ops.js +1 -1
  2. package/dist/configs/system.js +2 -0
  3. package/dist/entities/canvas/node-gestures.js +1 -1
  4. package/dist/entities/canvas/node-patches.js +1 -1
  5. package/dist/entities/system/Component.d.ts +5 -2
  6. package/dist/entities/system/Component.js +121 -8
  7. package/dist/entities/system/LinkedSystem.js +2 -2
  8. package/dist/entities/system/Operation.js +1 -1
  9. package/dist/entities/system/component-forwards.js +1 -1
  10. package/dist/entities/system/component-source-fields.js +1 -1
  11. package/dist/entities/system/component-style-set.js +1 -1
  12. package/dist/entities/system/conditional-defaults.d.ts +45 -0
  13. package/dist/entities/system/conditional-defaults.js +142 -0
  14. package/dist/entities/system/copy-plan.js +1 -1
  15. package/dist/entities/system/css-motion-reach.js +1 -1
  16. package/dist/entities/system/defineComponent.d.ts +11 -2
  17. package/dist/entities/system/defineComponent.js +3 -0
  18. package/dist/entities/system/link-plan.js +1 -1
  19. package/dist/entities/system/motion-convert.js +1 -1
  20. package/dist/entities/system/motion-variants.js +2 -2
  21. package/dist/framework/Config.d.ts +1 -1
  22. package/dist/framework/Config.js +13 -4
  23. package/dist/framework/class-names.js +18 -6
  24. package/dist/framework/default-conditions.d.ts +26 -0
  25. package/dist/framework/default-conditions.js +35 -0
  26. package/dist/framework/defineEntity.js +1 -1
  27. package/dist/framework/inline-sources.js +1 -1
  28. package/dist/framework/layer-styles.js +7 -2
  29. package/dist/framework/plan.js +1 -1
  30. package/dist/framework/projections.js +18 -5
  31. package/dist/framework/render-spec.js +10 -2
  32. package/dist/framework/schema-version.d.ts +1 -1
  33. package/dist/framework/schema-version.js +5 -5
  34. package/dist/framework/schemas.js +2 -2
  35. package/dist/framework/source-integrity.js +1 -1
  36. package/dist/index.d.ts +4 -2
  37. package/dist/index.js +5 -3
  38. package/dist/migrations/20261023152030_conditional_defaults.d.ts +6 -0
  39. package/dist/migrations/20261023152030_conditional_defaults.js +8 -0
  40. package/dist/spec/bake.js +14 -6
  41. package/dist/spec/cell.d.ts +2 -1
  42. package/dist/spec/cell.js +14 -6
  43. package/dist/spec/detach.js +5 -1
  44. package/dist/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
+ import { applyPathDelta, isPlainObject, namedFields, pathSegments, sectionDelta, touchedFields } from "./utils/field-path.js";
2
+ import { MINTED, collectRefs, entityPathProblem, entityRefOf, isExtendedRef, isMintedRow, isRef, kindOf, memberOf, memberRef, pathOf, qualifyRefs, ref, rewriteRefNamespace, rewriteRefSource, rewriteRefs, routedSource, singletonRef, sourceHops, sourceOf, splitRef } from "./utils/refs.js";
1
3
  import "./config-operation-kind.js";
2
4
  import { ConfigFormatError, ConfigRejection, isConfigRejection, issuePath, refusalIssues, reject, rejectData, rejectInvalid, rejectReferrers } from "./rejection.js";
3
- import { MINTED, collectRefs, entityPathProblem, entityRefOf, isExtendedRef, isMintedRow, isRef, kindOf, memberOf, memberRef, pathOf, qualifyRefs, ref, rewriteRefNamespace, rewriteRefSource, rewriteRefs, routedSource, singletonRef, sourceHops, sourceOf, splitRef } from "./utils/refs.js";
4
5
  import { describePatch } from "./plan.js";
5
- import { applyPathDelta, isPlainObject, namedFields, pathSegments, sectionDelta, touchedFields } from "./utils/field-path.js";
6
6
  import { METADATA_KEYS, declaredField } from "./utils/field-schema.js";
7
7
  import { dataSchema, resolveInputSchema } from "./schemas.js";
8
8
  import { isComposedValue } from "../entities/system/composed-values.js";
@@ -438,13 +438,18 @@ function storeCollection(def, patch, next) {
438
438
  }
439
439
  /** Drop every member of a declared `orphans` collection that still points at `target` — what a
440
440
  * delete leaves behind when a sibling member exists only to describe the one removed. */
441
- function dropOrphans(sub, def, target, namespace) {
441
+ function dropOrphans(sub, def, target, namespace, keyed) {
442
442
  if (!sub?.orphans?.length) return def;
443
443
  let out = def;
444
444
  for (const field of sub.orphans) {
445
445
  const collection = out[field];
446
446
  if (!isPlainObject(collection)) continue;
447
+ const keyedFields = Object.entries(keyed?.subEntities[field]?.namesMembersOf ?? {}).filter(([, names]) => names === keyed?.collection).map(([record]) => record);
447
448
  const kept = Object.fromEntries(Object.entries(collection).filter(([, member]) => {
449
+ if (keyed && isPlainObject(member) && keyedFields.some((record) => {
450
+ const names = member[record];
451
+ return isPlainObject(names) && Object.hasOwn(names, keyed.key);
452
+ })) return false;
448
453
  const refs = collectRefs(member);
449
454
  if (refs.includes(target)) return false;
450
455
  if (!namespace) return true;
@@ -2401,6 +2406,10 @@ var Config = class Config {
2401
2406
  def = dropOrphans(sub, def, `${leafOf(patch.field).replace(/s$/, "")}:${refPathOf(patch, patch.key)}`, sub?.namespaces ? {
2402
2407
  kind: sub.namespaces,
2403
2408
  path: patch.key
2409
+ } : void 0, patch.owner === void 0 ? {
2410
+ collection: patch.field,
2411
+ key: patch.key,
2412
+ subEntities: entry.subEntities
2404
2413
  } : void 0);
2405
2414
  }
2406
2415
  const next = snapshot.withChanges([itemChange(entry, patch.kind, patch.path, def)]);
@@ -6044,7 +6053,7 @@ var Config = class Config {
6044
6053
  * links from the provided sources. A declared `linkedKind` with no provided source throws. */
6045
6054
  hydrateFrom(stored, options) {
6046
6055
  const claimed = schemaVersionOf(stored);
6047
- if (claimed > 20261022184639) throw new SchemaVersionTooNew(claimed);
6056
+ if (claimed > 20261023152030) throw new SchemaVersionTooNew(claimed);
6048
6057
  const wire = upgradeSerializedConfig(stored);
6049
6058
  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.`);
6050
6059
  const leftover = wire.options;
@@ -1,4 +1,5 @@
1
1
  import { isRef, kindOf, memberOf, pathOf, refLeaf, refOfKey, sourceHops, sourceOf } from "./utils/refs.js";
2
+ import { defaultsFor } from "./default-conditions.js";
2
3
  import { forwardsOf, rootLayerOf } from "../entities/system/element.js";
3
4
  import { createSliceMemo } from "./memo.js";
4
5
  import { moduleViewOf } from "./module-views.js";
@@ -658,9 +659,13 @@ function compositeMemberBag({ config, path, markedIn = config }) {
658
659
  function layerRoutedProps(config, path, state = {}) {
659
660
  const component = config.resolve("component", path);
660
661
  if (!component) return {};
661
- const { layers = {}, styles = {}, defaultProps = {} } = component.toJSON();
662
+ const body = component.toJSON();
663
+ const { layers = {}, styles = {} } = body;
662
664
  const resolved = {
663
- ...defaultProps,
665
+ ...defaultsFor({
666
+ body,
667
+ given: state
668
+ }),
664
669
  ...state
665
670
  };
666
671
  const out = {};
@@ -707,9 +712,13 @@ function layerRoutedProps(config, path, state = {}) {
707
712
  * that layer through motion's factory and hands it the preset's props.
708
713
  */
709
714
  function layerJsMotionPresets(config, path, state = {}) {
710
- const { styles = {}, defaultProps = {} } = config.resolve("component", path)?.toJSON() ?? {};
715
+ const body = config.resolve("component", path)?.toJSON();
716
+ const { styles = {} } = body ?? {};
711
717
  const resolved = {
712
- ...defaultProps,
718
+ ...defaultsFor({
719
+ body,
720
+ given: state
721
+ }),
713
722
  ...state
714
723
  };
715
724
  const rules = Object.entries(styles);
@@ -746,9 +755,12 @@ function layerJsMotionPresets(config, path, state = {}) {
746
755
  * here, and one expanded from the config alone needs this.
747
756
  */
748
757
  function styleRuleMotionClasses(config, path, state = {}) {
749
- const { defaultProps = {} } = config.resolve("component", path)?.toJSON() ?? {};
758
+ const body = config.resolve("component", path)?.toJSON();
750
759
  const resolved = {
751
- ...defaultProps,
760
+ ...defaultsFor({
761
+ body,
762
+ given: state
763
+ }),
752
764
  ...state
753
765
  };
754
766
  const out = {};
@@ -0,0 +1,26 @@
1
+ //#region src/framework/default-conditions.d.ts
2
+ /** One `defaultPropsWhen` entry as stored: the condition, and the defaults that hold under it. */
3
+ interface StoredDefaultCondition {
4
+ readonly when: Record<string, unknown>;
5
+ readonly props: Record<string, unknown>;
6
+ }
7
+ /** Every `defaultPropsWhen` entry a body stores, keyed and ordered as stored. Empty for none. */
8
+ declare function storedDefaultConditions(body: unknown): Readonly<Record<string, StoredDefaultCondition>>;
9
+ /**
10
+ * The defaults that apply to a component given the props it was handed: `defaultProps`, with every
11
+ * `defaultPropsWhen` entry whose condition holds laid over it in stored order, so a later entry wins
12
+ * on the prop it sets.
13
+ *
14
+ * A condition reads a prop's given value, else its unconditional default. A prop that is itself
15
+ * conditionally defaulted can't be a condition (the schema refuses it), so one pass decides.
16
+ * Values compare by leaf, so a stored value ref and the bare name a call site writes match.
17
+ */
18
+ declare function defaultsFor({
19
+ body,
20
+ given
21
+ }: {
22
+ body: unknown;
23
+ given: Readonly<Record<string, unknown>>;
24
+ }): Record<string, unknown>;
25
+ //#endregion
26
+ export { StoredDefaultCondition, defaultsFor, storedDefaultConditions };
@@ -0,0 +1,35 @@
1
+ import { isPlainObject } from "./utils/field-path.js";
2
+ import { refLeaf } from "./utils/refs.js";
3
+ //#region src/framework/default-conditions.ts
4
+ /**
5
+ * A component's stored `defaultPropsWhen` collection, read off a body with nothing else in scope:
6
+ * the defaults that hold only under a condition on the component's other props, beside the
7
+ * unconditional `defaultProps` they override.
8
+ */
9
+ /** Every `defaultPropsWhen` entry a body stores, keyed and ordered as stored. Empty for none. */
10
+ function storedDefaultConditions(body) {
11
+ const stored = body?.defaultPropsWhen;
12
+ return isPlainObject(stored) ? stored : {};
13
+ }
14
+ /**
15
+ * The defaults that apply to a component given the props it was handed: `defaultProps`, with every
16
+ * `defaultPropsWhen` entry whose condition holds laid over it in stored order, so a later entry wins
17
+ * on the prop it sets.
18
+ *
19
+ * A condition reads a prop's given value, else its unconditional default. A prop that is itself
20
+ * conditionally defaulted can't be a condition (the schema refuses it), so one pass decides.
21
+ * Values compare by leaf, so a stored value ref and the bare name a call site writes match.
22
+ */
23
+ function defaultsFor({ body, given }) {
24
+ const defaults = body?.defaultProps ?? {};
25
+ const conditions = Object.values(storedDefaultConditions(body));
26
+ if (conditions.length === 0) return defaults;
27
+ const out = { ...defaults };
28
+ for (const { when, props } of conditions) if (Object.entries(when).every(([prop, value]) => {
29
+ const current = given[prop] !== void 0 ? given[prop] : defaults[prop];
30
+ return String(refLeaf(current)) === String(refLeaf(value));
31
+ })) Object.assign(out, props);
32
+ return out;
33
+ }
34
+ //#endregion
35
+ export { defaultsFor, storedDefaultConditions };
@@ -1,5 +1,5 @@
1
- import { CONFIG_OPERATION_KIND } from "./config-operation-kind.js";
2
1
  import { isRef, kindOf, pathOf, ref, refSchema, refTo, sourceOf } from "./utils/refs.js";
2
+ import { CONFIG_OPERATION_KIND } from "./config-operation-kind.js";
3
3
  import { resolveFields } from "./schemas.js";
4
4
  import { buildKind } from "./registry.js";
5
5
  import { brandGroup } from "./utils/group.js";
@@ -1,5 +1,5 @@
1
- import { rejectData } from "./rejection.js";
2
1
  import { MINTED, collectRefs, entityRefOf, isRef, kindOf, pathOf, ref, rewriteRefs, sourceOf } from "./utils/refs.js";
2
+ import { rejectData } from "./rejection.js";
3
3
  import { kindBorrowable } from "./registry.js";
4
4
  //#region src/framework/inline-sources.ts
5
5
  /**
@@ -1,4 +1,5 @@
1
1
  import { isRef, refLeaf } from "./utils/refs.js";
2
+ import { defaultsFor } from "./default-conditions.js";
2
3
  import { authoredBag } from "./projections.js";
3
4
  import { resolveAppliedComposites } from "../entities/system/applied-composites.js";
4
5
  //#region src/framework/layer-styles.ts
@@ -83,9 +84,13 @@ function ruleSpecificity(when) {
83
84
  * "styled with nothing".
84
85
  */
85
86
  function layerStyles(config, path, props = {}, options = {}) {
86
- const { styles = {}, defaultProps = {} } = config.resolve("component", path)?.toJSON() ?? {};
87
+ const body = config.resolve("component", path)?.toJSON();
88
+ const { styles = {} } = body ?? {};
87
89
  const state = {
88
- ...defaultProps,
90
+ ...defaultsFor({
91
+ body,
92
+ given: props
93
+ }),
89
94
  ...props
90
95
  };
91
96
  const forced = (options.forced ?? []).map((name) => name.replace(/^_/, ""));
@@ -1,5 +1,5 @@
1
- import { isConfigRejection } from "./rejection.js";
2
1
  import { splitRef } from "./utils/refs.js";
2
+ import { isConfigRejection } from "./rejection.js";
3
3
  //#region src/framework/plan.ts
4
4
  /**
5
5
  * One line for a patch, read off the patch itself: its kind, what it did, and where. The payload
@@ -1,4 +1,5 @@
1
1
  import { declarationText, hasRefMarker, isRef, kindOf, memberOf, pathOf, ref, refLeaf, refOfKey, replaceRefMarkers, routedSource, sourceHops, sourceOf, splitRef } from "./utils/refs.js";
2
+ import { defaultsFor } from "./default-conditions.js";
2
3
  import { evaluateCalc, isCalc, leadingNumber } from "../entities/system/calc.js";
3
4
  import { isOklchColor, renderOklch } from "../entities/system/color.js";
4
5
  import { isComposedValue, renderComposedValue } from "../entities/system/composed-values.js";
@@ -1963,12 +1964,18 @@ function validateComponentProps(config, componentPath, props) {
1963
1964
  function previewDefaults(config, path, cell, options = {}) {
1964
1965
  const component = config.resolve("component", path);
1965
1966
  if (!component) return {};
1966
- const { props, defaultProps } = component.body;
1967
+ const { props } = component.body;
1967
1968
  const previewProps = unconditionalPreviewProps(component.body);
1968
1969
  const base = {
1969
1970
  ...options.firstVariants === false ? {} : firstVariantValues(props),
1970
1971
  ...declaredPropDefaults(props),
1971
- ...defaultProps,
1972
+ ...defaultsFor({
1973
+ body: component.body,
1974
+ given: {
1975
+ ...previewProps,
1976
+ ...cell
1977
+ }
1978
+ }),
1972
1979
  ...previewProps
1973
1980
  };
1974
1981
  if (!cell) return base;
@@ -2011,10 +2018,16 @@ function previewConditionalProps(config, path, cell) {
2011
2018
  function holdingPreviewConditions({ config, path, cell }) {
2012
2019
  const component = config.resolve("component", path);
2013
2020
  if (!component) return [];
2014
- const { defaultProps } = component.body;
2021
+ const previewProps = unconditionalPreviewProps(component.body);
2015
2022
  const state = {
2016
- ...defaultProps,
2017
- ...unconditionalPreviewProps(component.body),
2023
+ ...defaultsFor({
2024
+ body: component.body,
2025
+ given: {
2026
+ ...previewProps,
2027
+ ...cell
2028
+ }
2029
+ }),
2030
+ ...previewProps,
2018
2031
  ...cell
2019
2032
  };
2020
2033
  return Object.entries(keyedPreviewConditions(config, path)).flatMap(([key, condition]) => {
@@ -1,4 +1,5 @@
1
1
  import { isRef, kindOf, memberOf, pathOf, ref, refLeaf, splitRef } from "./utils/refs.js";
2
+ import { defaultsFor } from "./default-conditions.js";
2
3
  import { renderedElement } from "../entities/system/element.js";
3
4
  import { createSliceMemo } from "./memo.js";
4
5
  import { componentStateDefaults, componentStates } from "./component-states.js";
@@ -1264,9 +1265,16 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1264
1265
  for (const [from, fills] of Object.entries(instanceSlots ?? {})) if (fills.length > 0 && instanceProps[from] === void 0) filled[from] = true;
1265
1266
  const declaredDefaults = declaredPropDefaults(body.props);
1266
1267
  const pins = instanceProps["__udsForceStates"] ?? {};
1268
+ const defaults = defaultsFor({
1269
+ body,
1270
+ given: {
1271
+ ...filled,
1272
+ ...instanceProps
1273
+ }
1274
+ });
1267
1275
  const state = {
1268
1276
  ...declaredDefaults,
1269
- ...body.defaultProps,
1277
+ ...defaults,
1270
1278
  ...componentStateDefaults(config, path),
1271
1279
  ...filled,
1272
1280
  ...instanceProps,
@@ -1283,7 +1291,7 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1283
1291
  const forwardsClassName = [...valueRoutes.values()].some((routes) => routes.some((route) => route.from === "className"));
1284
1292
  const supplied = {
1285
1293
  ...declaredDefaults,
1286
- ...body.defaultProps ?? {},
1294
+ ...defaults,
1287
1295
  ...instanceProps
1288
1296
  };
1289
1297
  const stateNames = new Set(componentStates(config, path).map(({ name }) => name));
@@ -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 = 20261022184639;
18
+ declare const CURRENT_SCHEMA_VERSION = 20261023152030;
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 = 20261022184639;
16
+ const CURRENT_SCHEMA_VERSION = 20261023152030;
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 > 20261022184639) 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 > 20261023152030) 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 ?? 20261022184639;
105
+ const target = options?.target ?? 20261023152030;
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 ?? 20261022184639;
163
+ const target = options?.target ?? 20261023152030;
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 ?? 20261022184639;
182
+ const target = options?.target ?? 20261023152030;
183
183
  const entries = [];
184
184
  const held = [];
185
185
  const retired = [];
@@ -1,8 +1,8 @@
1
- import { reject } from "./rejection.js";
1
+ import { sectionDelta } from "./utils/field-path.js";
2
2
  import { ref } from "./utils/refs.js";
3
+ import { reject } from "./rejection.js";
3
4
  import { planDelete, planRename } from "./plan.js";
4
5
  import { compileSchema } from "./utils/compiled-schema.js";
5
- import { sectionDelta } from "./utils/field-path.js";
6
6
  import { deriveCreateSchema, deriveMemberUpdateSchema, deriveUpdateSchema } from "./utils/field-schema.js";
7
7
  import { z } from "zod";
8
8
  //#region src/framework/schemas.ts
@@ -1,5 +1,5 @@
1
- import { collectRefs, isExtendedRef, isRef, kindOf, memberOf, pathOf, sourceOf, splitRef } from "./utils/refs.js";
2
1
  import { isPlainObject, setAtPath } from "./utils/field-path.js";
2
+ import { collectRefs, isExtendedRef, isRef, kindOf, memberOf, pathOf, sourceOf, splitRef } from "./utils/refs.js";
3
3
  import { isComposedValue } from "../entities/system/composed-values.js";
4
4
  import { modifierCategory } from "../entities/system/modifier-axis.js";
5
5
  //#region src/framework/source-integrity.ts
package/dist/index.d.ts CHANGED
@@ -34,12 +34,14 @@ import { MODIFIER_CATEGORIES, Modifier, ModifierCategory, ModifierClass, Modifie
34
34
  import { RootFontSize, parseRootFontSize } from "./css/root-font-size.js";
35
35
  import { RegisteredTokenValues, TOKEN_READERS, TokenGroupReader, TokenGroupVariableReader, TokenReader, TokenReaders, TokenValueEntry, TokenValueRow, TokenValueState, TokenVariableReaders, isTokenReader, parseTokenValue, rootFontSize, spellTokenRead, tokenExists, tokenValueRow, tokenValueRows } from "./entities/system/token-values.js";
36
36
  import { CheckedTokenRefPath, OverrideCondition, Token, TokenBody, TokenClass, TokenRefPath, TokenReference, defineOverride, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers } from "./entities/system/Token.js";
37
+ import { StoredDefaultCondition, defaultsFor, storedDefaultConditions } from "./framework/default-conditions.js";
37
38
  import { RefMember, STYLE_PROP_NUMBER_UNITS, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StylePropLeaf, StylePropNumberUnit, StylePropValue, StylePropValueCtx, StylePropValueKind, StyleProperty, StylePropertyClass, TokenVariableAsText, classifyStylePropValue, cssPropertyNames, leavesOfStylePropValue, stylePropValueFormOf, stylePropValueSchema, toCssPropertyName, tokenVariablesAsText } from "./entities/system/StyleProperty.js";
38
39
  import { StoredPreviewCondition, UNCONDITIONAL_PREVIEW_KEY, storedPreview, unconditionalPreviewProps } from "./framework/preview-store.js";
39
40
  import { IconTool, LinkedDraw, PreviewMatrix, PropDeclaration, StyleDeclarationGroup, StylePropEntry, StylePropertyItem, VarNaming, authoredBag, authoredValue, bodyNumberLeaves, bodyNumberUnit, className, cssPropValue, cssVar, cssVarRef, declarationKeyName, declaredPropDefaults, declaredPropRouting, declaresCssVariable, glyphComponentOf, glyphLibrariesOf, glyphPropsOf, heldLinked, iconToolAxisOptions, iconToolFor, iconToolOf, iconToolsOf, isCustomPropertyKey, keyedPreviewConditions, linkedDraw, linkedLocalRow, linkedVarNaming, literalValueOf, memberFromLeaf, memberLeaves, nameStyleNumbers, negatedCssValue, opacityPercentage, pinStyleNumbers, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, propOwner, propValueDomain, propValueFromAxis, refListOf, renderInterpolated, renderStyleValue, resolveComponentProps, resolveFieldValue, resolveTokenValue, resolveTokenValueUnder, rewriteStyleNumbers, routedBag, sourceVarPrefix, styleAliasesOf, styleDeclarationGroups, styleDeclarations, styleNumberAsPainted, styleNumberReadingChanges, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropNumberCss, stylePropNumberLeaf, stylePropNumberLeaves, stylePropNumberName, stylePropNumberNamedLeaves, stylePropNumberUnit, stylePropNumberUnitRefusal, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, tokenReference, validateComponentProps } from "./framework/projections.js";
40
41
  import { ANATOMY_MARKER, ComponentSpec, ComponentSpecs, ComputedFunctions, ComputedValue, ExpandOptions, ExpansionResult, MOTION_FACTORY, RenderElement, RenderSpec, RepeatRow, RepeatSpec, ResolveContext, SlotTarget, VisibilityOperator, VisibilityTerm, anatomyElementComponent, anatomyTextProp, boundElementType, componentSpec, deriveSpec, entryKeyOf, expandComponent, expandSpec, instanceSpec, layerTextProp, liveStateProps, previewSpec, propInto, propsIntoLayer, readStatePointer, resolveValue, resolveVisibility, routeOf, routesOf, slotTargetsOf, specWithResolvedVisibility, statePointerProp, valueForwardsOf, visibilityStateProps, visibilityTerms, withoutTruthyTerm, wrappedElementKey } from "./framework/render-spec.js";
41
42
  import { componentSourceDerivedFields } from "./entities/system/component-source-fields.js";
42
- import { AsInput, AuthoredComponent, AuthoredProp, ComponentBuilder, ComponentPropsOf, GlyphComponent, GlyphValue, LayerElement, LayerMap, LinkedHandle, PropCondition, PropDecl, PropMap, RegisteredMembers, RenderArgs, SlotCodeForm, SlotDecl, StyleRuleInput, defineComponent } from "./entities/system/defineComponent.js";
43
+ import { ConditionalDefault, ConditionalDefaultEntry, conditionalDefault, isConditionalDefault, joinConditionalDefaults } from "./entities/system/conditional-defaults.js";
44
+ import { AsInput, AuthoredComponent, AuthoredDefaultsOf, AuthoredProp, ComponentBuilder, ComponentPropsOf, GlyphComponent, GlyphValue, LayerElement, LayerMap, LinkedHandle, PropCondition, PropDecl, PropMap, RegisteredMembers, RenderArgs, SlotCodeForm, SlotDecl, StyleRuleInput, defineComponent } from "./entities/system/defineComponent.js";
43
45
  import { BindingKind, CodeSlot, ForwardClaims, PropRoute, SurfaceCompositeProp, SurfaceProp, SurfacePropCondition, SurfacePropKind, SurfaceScalarProp, SurfaceSlotProp, SurfaceStylePropertyProp, SurfaceVariantProp, codeSlotsOf, forwardClaims, forwardRoutes, forwardedLayers, glyphVariantProp, intoName, isValueSlot, layerPropRoutes, ownTextProp, propApplies, propRegistryRef, renderBindingsOf, routedProp, routedPropIn, routesContent, slotCodeForms, standsInForCode, surfaceProp, surfaceProps } from "./framework/prop-surface.js";
44
46
  import { PreviewElement, graftPreviewElements, isPreviewElement } from "./spec/preview-elements.js";
45
47
  import { Slot, SlotCell, SlotHost } from "./spec/slot.js";
@@ -128,4 +130,4 @@ import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
128
130
  import { views } from "./framework/views-facade.js";
129
131
  import { RN_STYLE_KEYS } from "./react-native/style-keys.generated.js";
130
132
  import { EditedCellContent, cellSeedSpec, editedCellContent, followCellContent, followingContent, resetCellContent, withCellValues } from "./spec/bake.js";
131
- export { AI_LANES, ANATOMY_MARKER, type Add, AiChat, type AiChatClass, AiFlow, type AiFlowClass, type AiFlowOrigin, AiGeneration, type AiGenerationClass, type AiLane, AiMessage, type AiMessageClass, type AiMultiAgentMode, type AnatomyIssue, type AnatomyIssueKind, type AnatomyReport, Annotation, type AnnotationClass, AnnotationFields, type AnnotationSegment, type AnySystemConfig, type AppliedOp, type AsInput, type AttachedSources, type Authored, type AuthoredComponent, type AuthoredProp, type AuthoredPropBody, type AuthoredStyleBag, type AuthoredStyleField, type AuthoringSignatureOptions, BUILD_DEFAULTS, type BatchReceipt, type BindingKind, type BreakOutcome, type BreakPlan, type BreakPlanInput, type BreakPlanRow, type BreakReach, BuildSection, type BuildSectionClass, CANVAS_ROLES, COMPONENT_ENTRY_STATIC, CONFIG_OPERATION_KIND, CREATED_COMPONENT_DIRECTORY, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, type Calc, type CalcOperand, Canvas, type CanvasClass, CanvasConfig, type CanvasConfigClass, CanvasRole, type CanvasRoleClass, type CanvasRoleName, CanvasSection, type CanvasSectionClass, type CaptureToSpecOptions, type CaptureToSpecResult, type CapturedChild, type CapturedElement, CapturedNode, type CapturedNodeJson, type Spec as CapturedSpec, type SpecElement as CapturedSpecElement, type CapturedText, type Cell, type CellSlot, type Change, type ChangeHook, type ChangeTarget, type CheckedTokenRefPath, type ChildrenPolicy, type ClassGrammar, type CodeSlot, type Collection, type ColorValue, Component, type ComponentBody, type ComponentBuilder, type ComponentClass, type ComponentContractOf, type ComponentCreateInput, type ComponentElementBody, type ComponentInteraction, type ComponentItemInput, type ComponentModuleSource, type ComponentPropBody, type ComponentPropsOf, type ComponentReference, type ComponentRegistryImport, type ComponentRegistryImportBinding, type ComponentRuleClass, type ComponentSpec, type ComponentSpecs, type ComponentState, type ComponentStyleBody, type ComposedValue, type ComposedValueAuthoring, type ComposedValueForm, Composite, type CompositeClass, type ComputedFields, type ComputedFunctions, type ComputedInput, type ComputedMap, type ComputedValue, 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, type CssSectionClass, DERIVED_COLOR_DEFAULT_SPACE, DERIVED_COLOR_SPACE, DERIVED_MUTATIONS, type DanglingDirective, type DanglingLocalRef, type DanglingRef, type DeclaredRuntimeModule, type DeletePlan, type DeriveMembers, type DerivedColor, type DerivedEntityClass, type DerivedOp, Device, type DeviceClass, type DiffOptions, type Divide, Documentation, type DocumentationClass, DocumentationLibrary, type DocumentationLibraryClass, type DomLikeElement, type DraftSource, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, type EditedCellContent, type Edition, type ElementVisibility, type ElementVisibilityInput, type ElementVisibilitySchema, Entity, type EntityAddress, type EntityChange, type EntityClass, type EntityKind, type EntityMap, type EntryGroup, type ExpandOptions, type ExpansionResult, type ExtendedComponentRef, type ExtendedRef, type FieldsSchema, File, type FileClass, Font, type FontClass, FontFile, type FontFileClass, type ForwardBlockedReason, type ForwardClaims, type ForwardOption, type ForwardOptions, type ForwardRequest, GROUP, GUIDANCE_LANES, GlobalStyle, type GlobalStyleClass, type GlyphComponent, type GlyphExportRule, type GlyphSource, type GlyphValue, type GoverningCondition, type Gradient, type GroupBody, type GroupComputedInput, Guidance, type GuidanceClass, type GuidanceLane, type GuidanceScope, type GuidanceSegment, GuidanceStyle, type GuidanceStyleBody, type GuidanceStyleClass, type HasSnapshot, type HydrationOptions, ICON_METADATA_FORMATS, Icon, type IconAnswer, type IconClass, type IconGlyph, type IconHook, type IconLibrary, type IconMemberMetadata, type IconMetadataAdapter, type IconMetadataDeclaration, type IconMetadataFile, type IconMetadataFormat, type IconTool, type IconVariantAs, type IdentifiedOp, type InferredRename, type InlineMotion, type Instance, type InstanceSlot, type InstanceSpec, type InteractionCondition, type ItemOf, type KindRef, type KindSignature, type KindSlice, LINK_SLUG, LINK_SLUG_MESSAGE, type LayerElement, type LayerMap, type LayerPropDriver, type LayerStyleOptions, type LeafAddress, type LinkArrival, type LinkDeclaration, type LinkPaths, type LinkPlan, type LinkPlanInput, type LinkedDraw, type LinkedElsewhere, type LinkedHandle, LinkedSystem, type LinkedSystemClass, type LinkedSystemCreateInput, type LinkedSystemItemInput, type LinkedSystemResolver, type LinkedSystemState, LintSection, type LintSectionClass, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, MOTION_FACTORY, MOTION_VARIANT_STATES, type MarkerKind, type Max, type Min, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierClass, type ModifierGroupMeta, type ModuleViewLink, Motion, type MotionClass, type MotionPresetToken, type Multiply, NATIVE_ACTIVATIONS, type NativeActivation, type NativeFlexValue, NativeModifier, type NativeModifierClass, NativeSettings, NativeStyleProperty, NativeToken, Node, type NodeClass, type OklchColor, type OnLinked, type OpHandler, type OpInput, Operation, type OperationClass, type OrphanedMotionVariant, type OverlayVerb, type OverrideCondition, type OverrideCopyingSource, type OwnedRecords, PLACED_NODE_KEY, PLAYGROUND_DEFAULTS, Package, type PackageClass, Page, type PageClass, type Patch, type PathOf, type PickedComposite, type PinDirective, type PinOptions, type PinOptionsField, type PinOptionsInput, type PlacedMotion, type Plan, type PlanImpact, type PlanOp, PlaygroundSection, type PlaygroundSectionClass, Presence, type PresenceProps, type PreviewElement, type PreviewMatrix, type ProjectedVisibility, type PropCondition, type PropDecl, type PropDeclaration, type PropMap, type PropRoute, type PropShapeSchema, RN_STYLE_KEYS, ReactNativeSystem, type ReactNativeSystemClass, 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 RegisteredComponentHandles, type RegisteredEntities, type RegisteredGroupPaths, type RegisteredMembers, type RegisteredModifiers, type RegisteredPaths, type RegisteredStyleBag, type RegisteredStyleProps, type RegisteredTokenValues, type RelativeLineHeightValue, type RenamePlan, type RenderArgs, type RenderElement, type RenderSpec, type RenderedNode, type RenderedTarget, type RepeatRow, type RepeatSpec, type RequiredContent, type RequiredPropUnforwarded, type ResolveContext, type ResolveValueTypeInput, type ResolvedBinding, type ResolvedSource, type RootFontSize, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, SLOT_CODE_FORMS, STYLE_PROPERTIES, STYLE_PROP_NUMBER_UNITS, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, type SafelistEntry, type SchemaEntry, type SchemaMigration, SchemaVersionTooNew, type SerializedConfig, type SerializedSourceAnswer, Settings, type SettingsClass, type Shadow, type ShadowColor, type ShadowLayer, type ShadowParts, type ShipGraphFile, type ShipRuleOptions, type SignatureOptions, type SkippedOp, type Slot, type SlotCell, type SlotCodeForm, type SlotDecl, type SlotHost, type SlotTarget, Snapshot, type Source, type SourceAnswer, type SourceChange, type SourceMap, type SourceResolution, type SourceResolutionSchemas, type SourceResolver, type SourceRowState, type SourceState, type SourceType, type SourceUnavailable, type SourcesBySlug, type SourcesOf, type SpecNode, type SplitStyleProps, type StampedPatch, type StoredConfig, type StoredPreviewCondition, type StyleClass, type StyleDeclarationGroup, type StylePropEntry, type StylePropLeaf, type StylePropNumberUnit, type StylePropValue, type StylePropValueCtx, type StylePropValueKind, StyleProperty, type StylePropertyClass, type StylePropertyItem, type StyleRuleInput, type StyleSetChange, type StyleValue, type SubEntityClass, type SubPatch, type Subtract, type SurfaceCompositeProp, type SurfaceProp, type SurfacePropCondition, type SurfacePropKind, type SurfaceScalarProp, type SurfaceSlotProp, type SurfaceStylePropertyProp, type SurfaceVariantProp, System, type SystemClass, type SystemConfig, SystemSection, type SystemSectionClass, SystemSource, type SystemSourceClass, TOKEN_READERS, type TimingValue, Token, type TokenBinding, type TokenBody, type TokenClass, type TokenGroupReader, type TokenGroupVariableReader, type TokenMatch, type TokenReader, type TokenReaders, type TokenRefPath, type TokenReference, type TokenValueEntry, type TokenValueRow, type TokenValueState, type TokenVariableAsText, type TokenVariableReaders, Tool, type ToolClass, type Transition, type TransitionSegment, type TraverseOptions, type TreeNode, UDS_FORCE_STATES, UNCONDITIONAL_PREVIEW_KEY, UNREACHABLE, type UnadoptedDirective, type UnknownStyleLeaf, type UnlinkPlan, type UnlinkPlanInput, type UnreadableBorrow, type UnstatableCondition, type UnstatableOverride, type UpgradedDraft, type UserSchemas, VOID_ELEMENTS, type ValueOf, type ValueRefs, type ValueType, type VarNaming, type VariantValueBody, type VariantValues, type VisibilityOperator, type VisibilityTerm, WEB_ACTIVATIONS, type WalkOptions, type WebActivation, add, addressOf, adoptLinkedModule, alpha, anatomyElementComponent, anatomyIssueKey, anatomyTextProp, applyPathDelta, arbitraryClassName, arbitraryNeedsClass, authoredBag, authoredValue, authoringSignatures, baseOf, bindStateRef, bindingPath, blankComponentBody, bodyNumberLeaves, bodyNumberUnit, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, calcFunction, calcOperands, calcOperator, canonicalWhen, canvasCellAt, canvasDefaultCoordinate, capturedFromDom, cellAxes, cellSeedSpec, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, compareComponentRules, componentClassBase, componentCompositeClasses, componentInteractions, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSourceDerivedFields, componentSpec, componentStateAttribute, componentStateAttributes, componentStateDefaults, componentStates, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, compositeMemberBag, condArms, condValue, containsMarker, convertLinkedTokenValue, createCanvasConfig, createSliceMemo, createdComponentFilePath, createdComponentPathOf, createdModuleKey, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssString, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declarationKeyName, declarationText, declaredField, declaredPropDefaults, declaredPropRouting, declaredRuntimeModules, declaredVariants, declaresCssVariable, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveInputDir, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, editedCellContent, elementFromCaptured, entityPathProblem, entityRefOf, entryKeyOf, evaluateCalc, excludedCondition, expandComponent, expandSpec, fieldKeys, followCellContent, followingContent, fontFamilyStack, fontFileDescriptors, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forceStateSelector, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, hasInteraction, hasJsMotion, heldLinked, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, iconResolver, iconToolAxisOptions, iconToolFor, iconToolLibraries, iconToolOf, iconToolsOf, iconVariantAs, inferredRenames, inlineJsMotion, inlineMotionId, inlineMotionProps, inlineMotions, inlineRuleComposites, inputOf, instanceHolding, instanceSpec, interactionKey, interactionModifiers, intoName, isAdd, isAuthored, isBinaryAsset, isCalc, isComposedValue, isConfigFormatError, isConfigRejection, isCreatedComponent, isCssProperty, isCustomPropertyKey, isDeclaredElementProp, isDerivedColor, isDivide, isEntityPath, isExtendedRef, isFontFaceStyle, isFontFaceWeight, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isInteractionModifier, isLinkSlug, isMax, isMin, isMintedRow, isMultiply, isNativeConfig, isNativeFlexValue, isOklchColor, isPlainObject, isPreviewElement, isRef, isRelativeLineHeightValue, isReservedWord, isShadow, isSubtract, isSystemConfig, isTokenReader, isTransition, isValueSlot, jsMotionBody, jsMotionPresets, jsMotionPropFields, kebabComponent, keyedPreviewConditions, kindOf, kindsOf, layerJsMotionPresets, layerPropDrivers, layerPropRoutes, layerRef, layerRoutedProps, layerStyles, layerTextProp, leafAddresses, leafVerb, leavesOfStylePropValue, librariesBoundBy, libraryHolding, lighten, linearGradient, linkedComponentModule, linkedDraw, linkedLocalRow, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, matchesExclude, max, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, min, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, moduleViewOf, motionClassName, motionKeyframesName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeFlexToWeb, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, overridesCopyingSource, ownTextProp, ownValues, ownerOf, ownsItsValues, packageKey, packageName, parseRootFontSize, parseTokenValue, partsOf, pathDelta, pathOf, pathSegments, pinStyleNumbers, placedGlyphElement, placedMotions, planBreak, planCopy, planLink, planUnlink, prefixed, prepareLinkedTokenBody, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propApplies, propInto, propOwner, propRegistryRef, propValueDomain, propValueFromAxis, propsIntoLayer, readStatePointer, readsState, redundantQualifiers, ref, refGraphOf, refKey, refLeaf, refListOf, refOfKey, refSchema, refTo, registerSchemaMigrations, renderBindingsOf, renderComposedValue, renderDerivedColor, renderGradient, renderInterpolated, renderOklch, renderShadow, renderSignature, renderStyleValue, renderTransition, renderValue, renderedElement, renderedSignatureOf, renderedTarget, replaceRefMarkers, requiredContentCondition, requiredContentLayers, requiredPropsUnforwarded, resetCellContent, resolutionSchema, resolveAppliedComposites, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveLinkedAlias, resolveLinkedDir, resolveOutDir, resolveOutputAlias, resolveRetiredLinkedDir, resolveSourceAlias, resolveTokenValue, resolveTokenValueUnder, resolveValue, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rewriteStyleNumbers, rnStyleKey, rootFontSize, rootLayerOf, routeOf, routedBag, routedProp, routedPropIn, routedSource, routesContent, routesOf, ruleApplies, ruleCondition, runChangeHooks, safelistEntrySchema, schemaVersionOf, searchEntities, searchTokens, setAtPath, shadow, shippedModuleRoots, shippedModules, shipsByDefault, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, splitRuleComposites, splitStyleProps, splitVariants, stamp, standsInForCode, statePointerProp, stateRef, stateTest, stateVariantNames, storedPreview, styleAliasesOf, styleDeclarationGroups, styleDeclarations, styleNumberAsPainted, styleNumberReadingChanges, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropNumberCss, stylePropNumberLeaf, stylePropNumberLeaves, stylePropNumberName, stylePropNumberNamedLeaves, stylePropNumberUnit, stylePropNumberUnitRefusal, stylePropOffScaleLiteral, stylePropOwnClasses, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, styleSetEdits, subtract, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, tablerExportName, tablerStyledExportName, toCssPropertyName, tokenBinding, tokenExists, tokenReference, tokenValueRow, tokenValueRows, tokenVariablesAsText, touchedFields, transition, unadoptedDirectives, unconditionalPreviewProps, unknownStyleLeaves, unreadableBorrows, unstatableConditions, unstatableOverrides, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueForwardsOf, valueLeavesOf, valueRef, valueSchemaOf, valueTypeOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, webFlexToNative, whenParts, withCellValues, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
133
+ export { AI_LANES, ANATOMY_MARKER, type Add, AiChat, type AiChatClass, AiFlow, type AiFlowClass, type AiFlowOrigin, AiGeneration, type AiGenerationClass, type AiLane, AiMessage, type AiMessageClass, type AiMultiAgentMode, type AnatomyIssue, type AnatomyIssueKind, type AnatomyReport, Annotation, type AnnotationClass, AnnotationFields, type AnnotationSegment, type AnySystemConfig, type AppliedOp, type AsInput, type AttachedSources, type Authored, type AuthoredComponent, type AuthoredDefaultsOf, type AuthoredProp, type AuthoredPropBody, type AuthoredStyleBag, type AuthoredStyleField, type AuthoringSignatureOptions, BUILD_DEFAULTS, type BatchReceipt, type BindingKind, type BreakOutcome, type BreakPlan, type BreakPlanInput, type BreakPlanRow, type BreakReach, BuildSection, type BuildSectionClass, CANVAS_ROLES, COMPONENT_ENTRY_STATIC, CONFIG_OPERATION_KIND, CREATED_COMPONENT_DIRECTORY, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, type Calc, type CalcOperand, Canvas, type CanvasClass, CanvasConfig, type CanvasConfigClass, CanvasRole, type CanvasRoleClass, type CanvasRoleName, CanvasSection, type CanvasSectionClass, type CaptureToSpecOptions, type CaptureToSpecResult, type CapturedChild, type CapturedElement, CapturedNode, type CapturedNodeJson, type Spec as CapturedSpec, type SpecElement as CapturedSpecElement, type CapturedText, type Cell, type CellSlot, type Change, type ChangeHook, type ChangeTarget, type CheckedTokenRefPath, type ChildrenPolicy, type ClassGrammar, type CodeSlot, type Collection, type ColorValue, Component, type ComponentBody, type ComponentBuilder, type ComponentClass, type ComponentContractOf, type ComponentCreateInput, type ComponentElementBody, type ComponentInteraction, type ComponentItemInput, type ComponentModuleSource, type ComponentPropBody, type ComponentPropsOf, type ComponentReference, type ComponentRegistryImport, type ComponentRegistryImportBinding, type ComponentRuleClass, type ComponentSpec, type ComponentSpecs, type ComponentState, type ComponentStyleBody, type ComposedValue, type ComposedValueAuthoring, type ComposedValueForm, Composite, type CompositeClass, type ComputedFields, type ComputedFunctions, type ComputedInput, type ComputedMap, type ComputedValue, type ConditionalDefault, type ConditionalDefaultEntry, 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, type CssSectionClass, DERIVED_COLOR_DEFAULT_SPACE, DERIVED_COLOR_SPACE, DERIVED_MUTATIONS, type DanglingDirective, type DanglingLocalRef, type DanglingRef, type DeclaredRuntimeModule, type DeletePlan, type DeriveMembers, type DerivedColor, type DerivedEntityClass, type DerivedOp, Device, type DeviceClass, type DiffOptions, type Divide, Documentation, type DocumentationClass, DocumentationLibrary, type DocumentationLibraryClass, type DomLikeElement, type DraftSource, ENTITY_PATH_MESSAGE, EXPORT_MEMBER, type EditedCellContent, type Edition, type ElementVisibility, type ElementVisibilityInput, type ElementVisibilitySchema, Entity, type EntityAddress, type EntityChange, type EntityClass, type EntityKind, type EntityMap, type EntryGroup, type ExpandOptions, type ExpansionResult, type ExtendedComponentRef, type ExtendedRef, type FieldsSchema, File, type FileClass, Font, type FontClass, FontFile, type FontFileClass, type ForwardBlockedReason, type ForwardClaims, type ForwardOption, type ForwardOptions, type ForwardRequest, GROUP, GUIDANCE_LANES, GlobalStyle, type GlobalStyleClass, type GlyphComponent, type GlyphExportRule, type GlyphSource, type GlyphValue, type GoverningCondition, type Gradient, type GroupBody, type GroupComputedInput, Guidance, type GuidanceClass, type GuidanceLane, type GuidanceScope, type GuidanceSegment, GuidanceStyle, type GuidanceStyleBody, type GuidanceStyleClass, type HasSnapshot, type HydrationOptions, ICON_METADATA_FORMATS, Icon, type IconAnswer, type IconClass, type IconGlyph, type IconHook, type IconLibrary, type IconMemberMetadata, type IconMetadataAdapter, type IconMetadataDeclaration, type IconMetadataFile, type IconMetadataFormat, type IconTool, type IconVariantAs, type IdentifiedOp, type InferredRename, type InlineMotion, type Instance, type InstanceSlot, type InstanceSpec, type InteractionCondition, type ItemOf, type KindRef, type KindSignature, type KindSlice, LINK_SLUG, LINK_SLUG_MESSAGE, type LayerElement, type LayerMap, type LayerPropDriver, type LayerStyleOptions, type LeafAddress, type LinkArrival, type LinkDeclaration, type LinkPaths, type LinkPlan, type LinkPlanInput, type LinkedDraw, type LinkedElsewhere, type LinkedHandle, LinkedSystem, type LinkedSystemClass, type LinkedSystemCreateInput, type LinkedSystemItemInput, type LinkedSystemResolver, type LinkedSystemState, LintSection, type LintSectionClass, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, MOTION_FACTORY, MOTION_VARIANT_STATES, type MarkerKind, type Max, type Min, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierClass, type ModifierGroupMeta, type ModuleViewLink, Motion, type MotionClass, type MotionPresetToken, type Multiply, NATIVE_ACTIVATIONS, type NativeActivation, type NativeFlexValue, NativeModifier, type NativeModifierClass, NativeSettings, NativeStyleProperty, NativeToken, Node, type NodeClass, type OklchColor, type OnLinked, type OpHandler, type OpInput, Operation, type OperationClass, type OrphanedMotionVariant, type OverlayVerb, type OverrideCondition, type OverrideCopyingSource, type OwnedRecords, PLACED_NODE_KEY, PLAYGROUND_DEFAULTS, Package, type PackageClass, Page, type PageClass, type Patch, type PathOf, type PickedComposite, type PinDirective, type PinOptions, type PinOptionsField, type PinOptionsInput, type PlacedMotion, type Plan, type PlanImpact, type PlanOp, PlaygroundSection, type PlaygroundSectionClass, Presence, type PresenceProps, type PreviewElement, type PreviewMatrix, type ProjectedVisibility, type PropCondition, type PropDecl, type PropDeclaration, type PropMap, type PropRoute, type PropShapeSchema, RN_STYLE_KEYS, ReactNativeSystem, type ReactNativeSystemClass, 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 RegisteredComponentHandles, type RegisteredEntities, type RegisteredGroupPaths, type RegisteredMembers, type RegisteredModifiers, type RegisteredPaths, type RegisteredStyleBag, type RegisteredStyleProps, type RegisteredTokenValues, type RelativeLineHeightValue, type RenamePlan, type RenderArgs, type RenderElement, type RenderSpec, type RenderedNode, type RenderedTarget, type RepeatRow, type RepeatSpec, type RequiredContent, type RequiredPropUnforwarded, type ResolveContext, type ResolveValueTypeInput, type ResolvedBinding, type ResolvedSource, type RootFontSize, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, SLOT_CODE_FORMS, STYLE_PROPERTIES, STYLE_PROP_NUMBER_UNITS, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, type SafelistEntry, type SchemaEntry, type SchemaMigration, SchemaVersionTooNew, type SerializedConfig, type SerializedSourceAnswer, Settings, type SettingsClass, type Shadow, type ShadowColor, type ShadowLayer, type ShadowParts, type ShipGraphFile, type ShipRuleOptions, type SignatureOptions, type SkippedOp, type Slot, type SlotCell, type SlotCodeForm, type SlotDecl, type SlotHost, type SlotTarget, Snapshot, type Source, type SourceAnswer, type SourceChange, type SourceMap, type SourceResolution, type SourceResolutionSchemas, type SourceResolver, type SourceRowState, type SourceState, type SourceType, type SourceUnavailable, type SourcesBySlug, type SourcesOf, type SpecNode, type SplitStyleProps, type StampedPatch, type StoredConfig, type StoredDefaultCondition, type StoredPreviewCondition, type StyleClass, type StyleDeclarationGroup, type StylePropEntry, type StylePropLeaf, type StylePropNumberUnit, type StylePropValue, type StylePropValueCtx, type StylePropValueKind, StyleProperty, type StylePropertyClass, type StylePropertyItem, type StyleRuleInput, type StyleSetChange, type StyleValue, type SubEntityClass, type SubPatch, type Subtract, type SurfaceCompositeProp, type SurfaceProp, type SurfacePropCondition, type SurfacePropKind, type SurfaceScalarProp, type SurfaceSlotProp, type SurfaceStylePropertyProp, type SurfaceVariantProp, System, type SystemClass, type SystemConfig, SystemSection, type SystemSectionClass, SystemSource, type SystemSourceClass, TOKEN_READERS, type TimingValue, Token, type TokenBinding, type TokenBody, type TokenClass, type TokenGroupReader, type TokenGroupVariableReader, type TokenMatch, type TokenReader, type TokenReaders, type TokenRefPath, type TokenReference, type TokenValueEntry, type TokenValueRow, type TokenValueState, type TokenVariableAsText, type TokenVariableReaders, Tool, type ToolClass, type Transition, type TransitionSegment, type TraverseOptions, type TreeNode, UDS_FORCE_STATES, UNCONDITIONAL_PREVIEW_KEY, UNREACHABLE, type UnadoptedDirective, type UnknownStyleLeaf, type UnlinkPlan, type UnlinkPlanInput, type UnreadableBorrow, type UnstatableCondition, type UnstatableOverride, type UpgradedDraft, type UserSchemas, VOID_ELEMENTS, type ValueOf, type ValueRefs, type ValueType, type VarNaming, type VariantValueBody, type VariantValues, type VisibilityOperator, type VisibilityTerm, WEB_ACTIVATIONS, type WalkOptions, type WebActivation, add, addressOf, adoptLinkedModule, alpha, anatomyElementComponent, anatomyIssueKey, anatomyTextProp, applyPathDelta, arbitraryClassName, arbitraryNeedsClass, authoredBag, authoredValue, authoringSignatures, baseOf, bindStateRef, bindingPath, blankComponentBody, bodyNumberLeaves, bodyNumberUnit, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, calcFunction, calcOperands, calcOperator, canonicalWhen, canvasCellAt, canvasDefaultCoordinate, capturedFromDom, cellAxes, cellSeedSpec, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, compareComponentRules, componentClassBase, componentCompositeClasses, componentInteractions, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSourceDerivedFields, componentSpec, componentStateAttribute, componentStateAttributes, componentStateDefaults, componentStates, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, compositeMemberBag, condArms, condValue, conditionalDefault, containsMarker, convertLinkedTokenValue, createCanvasConfig, createSliceMemo, createdComponentFilePath, createdComponentPathOf, createdModuleKey, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssString, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declarationKeyName, declarationText, declaredField, declaredPropDefaults, declaredPropRouting, declaredRuntimeModules, declaredVariants, declaresCssVariable, defaultsFor, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveInputDir, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, editedCellContent, elementFromCaptured, entityPathProblem, entityRefOf, entryKeyOf, evaluateCalc, excludedCondition, expandComponent, expandSpec, fieldKeys, followCellContent, followingContent, fontFamilyStack, fontFileDescriptors, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forceStateSelector, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, hasInteraction, hasJsMotion, heldLinked, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, iconResolver, iconToolAxisOptions, iconToolFor, iconToolLibraries, iconToolOf, iconToolsOf, iconVariantAs, inferredRenames, inlineJsMotion, inlineMotionId, inlineMotionProps, inlineMotions, inlineRuleComposites, inputOf, instanceHolding, instanceSpec, interactionKey, interactionModifiers, intoName, isAdd, isAuthored, isBinaryAsset, isCalc, isComposedValue, isConditionalDefault, isConfigFormatError, isConfigRejection, isCreatedComponent, isCssProperty, isCustomPropertyKey, isDeclaredElementProp, isDerivedColor, isDivide, isEntityPath, isExtendedRef, isFontFaceStyle, isFontFaceWeight, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isInteractionModifier, isLinkSlug, isMax, isMin, isMintedRow, isMultiply, isNativeConfig, isNativeFlexValue, isOklchColor, isPlainObject, isPreviewElement, isRef, isRelativeLineHeightValue, isReservedWord, isShadow, isSubtract, isSystemConfig, isTokenReader, isTransition, isValueSlot, joinConditionalDefaults, jsMotionBody, jsMotionPresets, jsMotionPropFields, kebabComponent, keyedPreviewConditions, kindOf, kindsOf, layerJsMotionPresets, layerPropDrivers, layerPropRoutes, layerRef, layerRoutedProps, layerStyles, layerTextProp, leafAddresses, leafVerb, leavesOfStylePropValue, librariesBoundBy, libraryHolding, lighten, linearGradient, linkedComponentModule, linkedDraw, linkedLocalRow, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, matchesExclude, max, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, min, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, moduleViewOf, motionClassName, motionKeyframesName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeFlexToWeb, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, overridesCopyingSource, ownTextProp, ownValues, ownerOf, ownsItsValues, packageKey, packageName, parseRootFontSize, parseTokenValue, partsOf, pathDelta, pathOf, pathSegments, pinStyleNumbers, placedGlyphElement, placedMotions, planBreak, planCopy, planLink, planUnlink, prefixed, prepareLinkedTokenBody, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propApplies, propInto, propOwner, propRegistryRef, propValueDomain, propValueFromAxis, propsIntoLayer, readStatePointer, readsState, redundantQualifiers, ref, refGraphOf, refKey, refLeaf, refListOf, refOfKey, refSchema, refTo, registerSchemaMigrations, renderBindingsOf, renderComposedValue, renderDerivedColor, renderGradient, renderInterpolated, renderOklch, renderShadow, renderSignature, renderStyleValue, renderTransition, renderValue, renderedElement, renderedSignatureOf, renderedTarget, replaceRefMarkers, requiredContentCondition, requiredContentLayers, requiredPropsUnforwarded, resetCellContent, resolutionSchema, resolveAppliedComposites, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveLinkedAlias, resolveLinkedDir, resolveOutDir, resolveOutputAlias, resolveRetiredLinkedDir, resolveSourceAlias, resolveTokenValue, resolveTokenValueUnder, resolveValue, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rewriteStyleNumbers, rnStyleKey, rootFontSize, rootLayerOf, routeOf, routedBag, routedProp, routedPropIn, routedSource, routesContent, routesOf, ruleApplies, ruleCondition, runChangeHooks, safelistEntrySchema, schemaVersionOf, searchEntities, searchTokens, setAtPath, shadow, shippedModuleRoots, shippedModules, shipsByDefault, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, splitRuleComposites, splitStyleProps, splitVariants, stamp, standsInForCode, statePointerProp, stateRef, stateTest, stateVariantNames, storedDefaultConditions, storedPreview, styleAliasesOf, styleDeclarationGroups, styleDeclarations, styleNumberAsPainted, styleNumberReadingChanges, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropNumberCss, stylePropNumberLeaf, stylePropNumberLeaves, stylePropNumberName, stylePropNumberNamedLeaves, stylePropNumberUnit, stylePropNumberUnitRefusal, stylePropOffScaleLiteral, stylePropOwnClasses, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, styleSetEdits, subtract, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, tablerExportName, tablerStyledExportName, toCssPropertyName, tokenBinding, tokenExists, tokenReference, tokenValueRow, tokenValueRows, tokenVariablesAsText, touchedFields, transition, unadoptedDirectives, unconditionalPreviewProps, unknownStyleLeaves, unreadableBorrows, unstatableConditions, unstatableOverrides, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueForwardsOf, valueLeavesOf, valueRef, valueSchemaOf, valueTypeOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, webFlexToNative, whenParts, withCellValues, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
package/dist/index.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { AI_LANES, GUIDANCE_LANES } from "./ai-lanes.js";
2
2
  import { Presence } from "./authoring/presence.js";
3
3
  import { isNativeConfig, isSystemConfig } from "./configs/platform.js";
4
+ import { applyPathDelta, isPlainObject, namedFields, pathDelta, pathSegments, setAtPath, touchedFields } from "./framework/utils/field-path.js";
5
+ import { ENTITY_PATH_MESSAGE, MINTED, collectRefs, declarationText, entityPathProblem, entityRefOf, isEntityPath, isExtendedRef, isMintedRow, isRef, kindOf, memberOf, memberRef, orRef, pathOf, ref, refKey, refLeaf, refOfKey, refSchema, refTo, replaceRefMarkers, rewriteRefNamespace, rewriteRefSource, rewriteRefs, routedSource, sourceHops, sourceOf, splitRef, splitRefMarkers } from "./framework/utils/refs.js";
6
+ import { defaultsFor, storedDefaultConditions } from "./framework/default-conditions.js";
4
7
  import { CONFIG_OPERATION_KIND } from "./framework/config-operation-kind.js";
5
8
  import { ConfigFormatError, ConfigRejection, isConfigFormatError, isConfigRejection } from "./framework/rejection.js";
6
- import { ENTITY_PATH_MESSAGE, MINTED, collectRefs, declarationText, entityPathProblem, entityRefOf, isEntityPath, isExtendedRef, isMintedRow, isRef, kindOf, memberOf, memberRef, orRef, pathOf, ref, refKey, refLeaf, refOfKey, refSchema, refTo, replaceRefMarkers, rewriteRefNamespace, rewriteRefSource, rewriteRefs, routedSource, sourceHops, sourceOf, splitRef, splitRefMarkers } from "./framework/utils/refs.js";
7
9
  import { describePatch } from "./framework/plan.js";
8
- import { applyPathDelta, isPlainObject, namedFields, pathDelta, pathSegments, setAtPath, touchedFields } from "./framework/utils/field-path.js";
9
10
  import { declaredField, deriveCreateSchema, deriveUpdateSchema, fieldKeys } from "./framework/utils/field-schema.js";
10
11
  import { add, calcFunction, calcOperands, calcOperator, divide, evaluateCalc, isAdd, isCalc, isDivide, isMax, isMin, isMultiply, isSubtract, max, min, multiply, subtract } from "./entities/system/calc.js";
11
12
  import { DERIVED_COLOR_DEFAULT_SPACE, DERIVED_COLOR_SPACE, alpha, darken, isDerivedColor, isGradient, isOklchColor, lighten, linearGradient, mix, oklch, renderDerivedColor, renderGradient, renderOklch } from "./entities/system/color.js";
@@ -60,6 +61,7 @@ import { canvasCellAt, canvasDefaultCoordinate, cellAxes } from "./spec/cell.js"
60
61
  import { instanceHolding } from "./spec/instance.js";
61
62
  import { componentSourceDerivedFields } from "./entities/system/component-source-fields.js";
62
63
  import { styleSetEdits } from "./entities/system/component-style-set.js";
64
+ import { conditionalDefault, isConditionalDefault, joinConditionalDefaults } from "./entities/system/conditional-defaults.js";
63
65
  import { convertLinkedTokenValue, prepareLinkedTokenBody } from "./entities/system/linked-token-values.js";
64
66
  import { Token, defineOverride, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers } from "./entities/system/Token.js";
65
67
  import { Component, SLOT_CODE_FORMS, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef } from "./entities/system/Component.js";
@@ -121,4 +123,4 @@ import { ConfigSession, memoryConfigSource } from "./framework/session.js";
121
123
  import { EXPORT_MEMBER, packageKey, packageName } from "./framework/utils/package-path.js";
122
124
  import { validateSpec } from "./framework/validate-spec.js";
123
125
  import { cellSeedSpec, editedCellContent, followCellContent, followingContent, resetCellContent, withCellValues } from "./spec/bake.js";
124
- export { AI_LANES, ANATOMY_MARKER, AiChat, AiFlow, AiGeneration, AiMessage, Annotation, AnnotationFields, BUILD_DEFAULTS, BuildSection, CANVAS_ROLES, COMPONENT_ENTRY_STATIC, CONFIG_OPERATION_KIND, CREATED_COMPONENT_DIRECTORY, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, CanvasSection, CapturedNode, Component, Composite, Config, ConfigFormatError, ConfigRejection, ConfigSession, CssSection, DERIVED_COLOR_DEFAULT_SPACE, DERIVED_COLOR_SPACE, DERIVED_MUTATIONS, Device, Documentation, DocumentationLibrary, 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, LintSection, MINTED, MODIFIER_CATEGORIES, MOTION_FACTORY, MOTION_VARIANT_STATES, Modifier, Motion, NATIVE_ACTIVATIONS, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, Operation, PLACED_NODE_KEY, PLAYGROUND_DEFAULTS, Package, Page, PlaygroundSection, Presence, RN_STYLE_KEYS, ReactNativeSystem, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, SLOT_CODE_FORMS, STYLE_PROPERTIES, STYLE_PROP_NUMBER_UNITS, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, SchemaVersionTooNew, Settings, Snapshot, StyleProperty, System, SystemSection, SystemSource, TOKEN_READERS, Token, Tool, UDS_FORCE_STATES, UNCONDITIONAL_PREVIEW_KEY, UNREACHABLE, VOID_ELEMENTS, WEB_ACTIVATIONS, add, addressOf, adoptLinkedModule, alpha, anatomyElementComponent, anatomyIssueKey, anatomyTextProp, applyPathDelta, arbitraryClassName, arbitraryNeedsClass, authoredBag, authoredValue, authoringSignatures, baseOf, bindStateRef, bindingPath, blankComponentBody, bodyNumberLeaves, bodyNumberUnit, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, calcFunction, calcOperands, calcOperator, canonicalWhen, canvasCellAt, canvasDefaultCoordinate, capturedFromDom, cellAxes, cellSeedSpec, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, compareComponentRules, componentClassBase, componentCompositeClasses, componentInteractions, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSourceDerivedFields, componentSpec, componentStateAttribute, componentStateAttributes, componentStateDefaults, componentStates, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, compositeMemberBag, condArms, condValue, containsMarker, convertLinkedTokenValue, createCanvasConfig, createSliceMemo, createdComponentFilePath, createdComponentPathOf, createdModuleKey, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssString, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declarationKeyName, declarationText, declaredField, declaredPropDefaults, declaredPropRouting, declaredRuntimeModules, declaredVariants, declaresCssVariable, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveInputDir, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, editedCellContent, elementFromCaptured, entityPathProblem, entityRefOf, entryKeyOf, evaluateCalc, excludedCondition, expandComponent, expandSpec, fieldKeys, followCellContent, followingContent, fontFamilyStack, fontFileDescriptors, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forceStateSelector, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, hasInteraction, hasJsMotion, heldLinked, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, iconResolver, iconToolAxisOptions, iconToolFor, iconToolLibraries, iconToolOf, iconToolsOf, iconVariantAs, inferredRenames, inlineJsMotion, inlineMotionId, inlineMotionProps, inlineMotions, inlineRuleComposites, inputOf, instanceHolding, instanceSpec, interactionKey, interactionModifiers, intoName, isAdd, isAuthored, isBinaryAsset, isCalc, isComposedValue, isConfigFormatError, isConfigRejection, isCreatedComponent, isCssProperty, isCustomPropertyKey, isDeclaredElementProp, isDerivedColor, isDivide, isEntityPath, isExtendedRef, isFontFaceStyle, isFontFaceWeight, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isInteractionModifier, isLinkSlug, isMax, isMin, isMintedRow, isMultiply, isNativeConfig, isNativeFlexValue, isOklchColor, isPlainObject, isPreviewElement, isRef, isRelativeLineHeightValue, isReservedWord, isShadow, isSubtract, isSystemConfig, isTokenReader, isTransition, isValueSlot, jsMotionBody, jsMotionPresets, jsMotionPropFields, kebabComponent, keyedPreviewConditions, kindOf, kindsOf, layerJsMotionPresets, layerPropDrivers, layerPropRoutes, layerRef, layerRoutedProps, layerStyles, layerTextProp, leafAddresses, leafVerb, leavesOfStylePropValue, librariesBoundBy, libraryHolding, lighten, linearGradient, linkedComponentModule, linkedDraw, linkedLocalRow, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, matchesExclude, max, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, min, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, moduleViewOf, motionClassName, motionKeyframesName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeFlexToWeb, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, overridesCopyingSource, ownTextProp, ownValues, ownerOf, ownsItsValues, packageKey, packageName, parseRootFontSize, parseTokenValue, partsOf, pathDelta, pathOf, pathSegments, pinStyleNumbers, placedGlyphElement, placedMotions, planBreak, planCopy, planLink, planUnlink, prefixed, prepareLinkedTokenBody, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propApplies, propInto, propOwner, propRegistryRef, propValueDomain, propValueFromAxis, propsIntoLayer, readStatePointer, readsState, redundantQualifiers, ref, refGraphOf, refKey, refLeaf, refListOf, refOfKey, refSchema, refTo, registerSchemaMigrations, renderBindingsOf, renderComposedValue, renderDerivedColor, renderGradient, renderInterpolated, renderOklch, renderShadow, renderSignature, renderStyleValue, renderTransition, renderValue, renderedElement, renderedSignatureOf, renderedTarget, replaceRefMarkers, requiredContentCondition, requiredContentLayers, requiredPropsUnforwarded, resetCellContent, resolutionSchema, resolveAppliedComposites, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveLinkedAlias, resolveLinkedDir, resolveOutDir, resolveOutputAlias, resolveRetiredLinkedDir, resolveSourceAlias, resolveTokenValue, resolveTokenValueUnder, resolveValue, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rewriteStyleNumbers, rnStyleKey, rootFontSize, rootLayerOf, routeOf, routedBag, routedProp, routedPropIn, routedSource, routesContent, routesOf, ruleApplies, ruleCondition, runChangeHooks, safelistEntrySchema, schemaVersionOf, searchEntities, searchTokens, setAtPath, shadow, shippedModuleRoots, shippedModules, shipsByDefault, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, splitRuleComposites, splitStyleProps, splitVariants, stamp, standsInForCode, statePointerProp, stateRef, stateTest, stateVariantNames, storedPreview, styleAliasesOf, styleDeclarationGroups, styleDeclarations, styleNumberAsPainted, styleNumberReadingChanges, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropNumberCss, stylePropNumberLeaf, stylePropNumberLeaves, stylePropNumberName, stylePropNumberNamedLeaves, stylePropNumberUnit, stylePropNumberUnitRefusal, stylePropOffScaleLiteral, stylePropOwnClasses, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, styleSetEdits, subtract, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, tablerExportName, tablerStyledExportName, toCssPropertyName, tokenBinding, tokenExists, tokenReference, tokenValueRow, tokenValueRows, tokenVariablesAsText, touchedFields, transition, unadoptedDirectives, unconditionalPreviewProps, unknownStyleLeaves, unreadableBorrows, unstatableConditions, unstatableOverrides, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueForwardsOf, valueLeavesOf, valueRef, valueSchemaOf, valueTypeOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, webFlexToNative, whenParts, withCellValues, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
126
+ export { AI_LANES, ANATOMY_MARKER, AiChat, AiFlow, AiGeneration, AiMessage, Annotation, AnnotationFields, BUILD_DEFAULTS, BuildSection, CANVAS_ROLES, COMPONENT_ENTRY_STATIC, CONFIG_OPERATION_KIND, CREATED_COMPONENT_DIRECTORY, CSS_DEFAULTS, CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, CURRENT_SCHEMA_VERSION, Canvas, CanvasConfig, CanvasRole, CanvasSection, CapturedNode, Component, Composite, Config, ConfigFormatError, ConfigRejection, ConfigSession, CssSection, DERIVED_COLOR_DEFAULT_SPACE, DERIVED_COLOR_SPACE, DERIVED_MUTATIONS, Device, Documentation, DocumentationLibrary, 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, LintSection, MINTED, MODIFIER_CATEGORIES, MOTION_FACTORY, MOTION_VARIANT_STATES, Modifier, Motion, NATIVE_ACTIVATIONS, NativeModifier, NativeSettings, NativeStyleProperty, NativeToken, Node, Operation, PLACED_NODE_KEY, PLAYGROUND_DEFAULTS, Package, Page, PlaygroundSection, Presence, RN_STYLE_KEYS, ReactNativeSystem, SCRIPT_EXTENSIONS, SERIALIZED_CONFIG_VERSION, SIZE_TOLERANCE_PX, SLOT_CODE_FORMS, STYLE_PROPERTIES, STYLE_PROP_NUMBER_UNITS, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, SchemaVersionTooNew, Settings, Snapshot, StyleProperty, System, SystemSection, SystemSource, TOKEN_READERS, Token, Tool, UDS_FORCE_STATES, UNCONDITIONAL_PREVIEW_KEY, UNREACHABLE, VOID_ELEMENTS, WEB_ACTIVATIONS, add, addressOf, adoptLinkedModule, alpha, anatomyElementComponent, anatomyIssueKey, anatomyTextProp, applyPathDelta, arbitraryClassName, arbitraryNeedsClass, authoredBag, authoredValue, authoringSignatures, baseOf, bindStateRef, bindingPath, blankComponentBody, bodyNumberLeaves, bodyNumberUnit, borrowedGroup, borrowedItem, boundElementType, brandGroup, buildRefGraph, buildRefIndex, calcFunction, calcOperands, calcOperator, canonicalWhen, canvasCellAt, canvasDefaultCoordinate, capturedFromDom, cellAxes, cellSeedSpec, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, compareComponentRules, componentClassBase, componentCompositeClasses, componentInteractions, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSourceDerivedFields, componentSpec, componentStateAttribute, componentStateAttributes, componentStateDefaults, componentStates, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, compositeMemberBag, condArms, condValue, conditionalDefault, containsMarker, convertLinkedTokenValue, createCanvasConfig, createSliceMemo, createdComponentFilePath, createdComponentPathOf, createdModuleKey, cssPrefixes, cssPropValue, cssProperty, cssPropertyNames, cssString, cssValueIssue, cssVar, cssVarRef, danglingDirectives, danglingLocalRefs, danglingSourcedRefs, darken, declarationKeyName, declarationText, declaredField, declaredPropDefaults, declaredPropRouting, declaredRuntimeModules, declaredVariants, declaresCssVariable, defaultsFor, defineComponent, defineConfig, defineDerivedEntity, defineEntity, defineOverride, defineSubEntity, deriveCreateSchema, deriveInputDir, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, editedCellContent, elementFromCaptured, entityPathProblem, entityRefOf, entryKeyOf, evaluateCalc, excludedCondition, expandComponent, expandSpec, fieldKeys, followCellContent, followingContent, fontFamilyStack, fontFileDescriptors, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forceStateSelector, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, hasInteraction, hasJsMotion, heldLinked, iconCategories, iconLibraries, iconLibrary, iconMemberMetadata, iconMetadata, iconMetadataDeclaration, iconMetadataFile, iconMetadataFileJsonSchema, iconMetadataFormat, iconMetadataSourceFile, iconResolver, iconToolAxisOptions, iconToolFor, iconToolLibraries, iconToolOf, iconToolsOf, iconVariantAs, inferredRenames, inlineJsMotion, inlineMotionId, inlineMotionProps, inlineMotions, inlineRuleComposites, inputOf, instanceHolding, instanceSpec, interactionKey, interactionModifiers, intoName, isAdd, isAuthored, isBinaryAsset, isCalc, isComposedValue, isConditionalDefault, isConfigFormatError, isConfigRejection, isCreatedComponent, isCssProperty, isCustomPropertyKey, isDeclaredElementProp, isDerivedColor, isDivide, isEntityPath, isExtendedRef, isFontFaceStyle, isFontFaceWeight, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isInteractionModifier, isLinkSlug, isMax, isMin, isMintedRow, isMultiply, isNativeConfig, isNativeFlexValue, isOklchColor, isPlainObject, isPreviewElement, isRef, isRelativeLineHeightValue, isReservedWord, isShadow, isSubtract, isSystemConfig, isTokenReader, isTransition, isValueSlot, joinConditionalDefaults, jsMotionBody, jsMotionPresets, jsMotionPropFields, kebabComponent, keyedPreviewConditions, kindOf, kindsOf, layerJsMotionPresets, layerPropDrivers, layerPropRoutes, layerRef, layerRoutedProps, layerStyles, layerTextProp, leafAddresses, leafVerb, leavesOfStylePropValue, librariesBoundBy, libraryHolding, lighten, linearGradient, linkedComponentModule, linkedDraw, linkedLocalRow, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, matchesExclude, max, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, min, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, moduleViewOf, motionClassName, motionKeyframesName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeFlexToWeb, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, overridesCopyingSource, ownTextProp, ownValues, ownerOf, ownsItsValues, packageKey, packageName, parseRootFontSize, parseTokenValue, partsOf, pathDelta, pathOf, pathSegments, pinStyleNumbers, placedGlyphElement, placedMotions, planBreak, planCopy, planLink, planUnlink, prefixed, prepareLinkedTokenBody, previewConditionalProps, previewConditions, previewDefaults, previewMatrix, previewSpec, propApplies, propInto, propOwner, propRegistryRef, propValueDomain, propValueFromAxis, propsIntoLayer, readStatePointer, readsState, redundantQualifiers, ref, refGraphOf, refKey, refLeaf, refListOf, refOfKey, refSchema, refTo, registerSchemaMigrations, renderBindingsOf, renderComposedValue, renderDerivedColor, renderGradient, renderInterpolated, renderOklch, renderShadow, renderSignature, renderStyleValue, renderTransition, renderValue, renderedElement, renderedSignatureOf, renderedTarget, replaceRefMarkers, requiredContentCondition, requiredContentLayers, requiredPropsUnforwarded, resetCellContent, resolutionSchema, resolveAppliedComposites, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveLinkedAlias, resolveLinkedDir, resolveOutDir, resolveOutputAlias, resolveRetiredLinkedDir, resolveSourceAlias, resolveTokenValue, resolveTokenValueUnder, resolveValue, resolveValueType, resolveVisibility, resolvedSource, rewriteRefNamespace, rewriteRefSource, rewriteRefs, rewriteStyleNumbers, rnStyleKey, rootFontSize, rootLayerOf, routeOf, routedBag, routedProp, routedPropIn, routedSource, routesContent, routesOf, ruleApplies, ruleCondition, runChangeHooks, safelistEntrySchema, schemaVersionOf, searchEntities, searchTokens, setAtPath, shadow, shippedModuleRoots, shippedModules, shipsByDefault, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, splitRuleComposites, splitStyleProps, splitVariants, stamp, standsInForCode, statePointerProp, stateRef, stateTest, stateVariantNames, storedDefaultConditions, storedPreview, styleAliasesOf, styleDeclarationGroups, styleDeclarations, styleNumberAsPainted, styleNumberReadingChanges, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropEntries, stylePropLeafForToken, stylePropNegates, stylePropNumberCss, stylePropNumberLeaf, stylePropNumberLeaves, stylePropNumberName, stylePropNumberNamedLeaves, stylePropNumberUnit, stylePropNumberUnitRefusal, stylePropOffScaleLiteral, stylePropOwnClasses, stylePropTokenGroup, stylePropTokenPath, stylePropTokenValues, stylePropValueFormOf, stylePropValueFromLeaf, stylePropValueLeaves, stylePropValueSchema, stylePropValues, stylePropertiesWriting, stylePropertyAccepts, stylePropertyFor, stylePropertyPathFor, styleRuleMotionClasses, styleSetEdits, subtract, suggestLinkSlug, summarizeChanges, surfaceProp, surfaceProps, tablerExportName, tablerStyledExportName, toCssPropertyName, tokenBinding, tokenExists, tokenReference, tokenValueRow, tokenValueRows, tokenVariablesAsText, touchedFields, transition, unadoptedDirectives, unconditionalPreviewProps, unknownStyleLeaves, unreadableBorrows, unstatableConditions, unstatableOverrides, updateRefIndex, upgradeDraftEntries, upgradePatch, upgradeSerializedConfig, validateComponentProps, validateSpec, valueAt, valueForwardsOf, valueLeavesOf, valueRef, valueSchemaOf, valueTypeOf, varPrefixOf, views, visibilityStateProps, visibilityTerms, webFlexToNative, whenParts, withCellValues, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
@@ -0,0 +1,6 @@
1
+ /** A component's `defaultPropsWhen` is a new, optional field: the defaults that hold under a condition
2
+ * on its other props. Additive, so existing configs and draft patches keep their meaning. Retire this
3
+ * identity hop only when no supported artifact predates this schema. */
4
+ import type { SchemaMigration } from '../framework/schema-version';
5
+ export declare const CONDITIONAL_DEFAULTS_VERSION = 20261023152030;
6
+ export declare const conditionalDefaultsMigration: SchemaMigration;
@@ -0,0 +1,8 @@
1
+ //#region src/migrations/20261023152030_conditional_defaults.ts
2
+ const CONDITIONAL_DEFAULTS_VERSION = 20261023152030;
3
+ const conditionalDefaultsMigration = {
4
+ version: CONDITIONAL_DEFAULTS_VERSION,
5
+ up: (json) => json
6
+ };
7
+ //#endregion
8
+ export { CONDITIONAL_DEFAULTS_VERSION, conditionalDefaultsMigration };
package/dist/spec/bake.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { kindOf, refLeaf } from "../framework/utils/refs.js";
2
+ import { defaultsFor } from "../framework/default-conditions.js";
2
3
  import { declaredPropDefaults } from "../framework/projections.js";
3
4
  import { graftPreviewElements } from "./preview-elements.js";
4
5
  import { instanceSpec } from "../framework/render-spec.js";
@@ -269,8 +270,15 @@ function seedAt({ config, path, props }) {
269
270
  const key = `${path}\u0000${JSON.stringify(cell.coordinate)}`;
270
271
  const hit = byKey.get(key);
271
272
  if (hit) return hit;
273
+ const own = {
274
+ ...codeDefaults(config, path),
275
+ ...defaultsFor({
276
+ body: config.resolve("component", path)?.body,
277
+ given: cell.props
278
+ })
279
+ };
272
280
  const values = {};
273
- for (const [prop, value] of Object.entries(cell.props)) if (!givesItself(config, path, prop, value)) values[prop] = value;
281
+ for (const [prop, value] of Object.entries(cell.props)) if (!givesItself(own, prop, value)) values[prop] = value;
274
282
  const spec = graftPreviewElements(instanceSpec(path, values), values);
275
283
  const root = spec.elements[spec.root];
276
284
  const made = {
@@ -356,11 +364,11 @@ function graftSubtree({ source, from, into, root }) {
356
364
  }
357
365
  return remap;
358
366
  }
359
- /** Whether a component renders `value` for `prop` with nothing set: its own default is that value,
360
- * or it has none and the value is an off boolean. */
361
- function givesItself(config, path, prop, value) {
362
- const own = codeDefaults(config, path)[prop];
363
- return own === void 0 ? value === false : stable(refLeaf(own)) === stable(refLeaf(value));
367
+ /** Whether a component renders `value` for `prop` with nothing set: `own` is that value, or holds
368
+ * nothing for it and the value is an off boolean. */
369
+ function givesItself(own, prop, value) {
370
+ const given = own[prop];
371
+ return given === void 0 ? value === false : stable(refLeaf(given)) === stable(refLeaf(value));
364
372
  }
365
373
  const codeDefaultsByConfig = /* @__PURE__ */ new WeakMap();
366
374
  /** What a component gives a prop by itself: its declared defaults under `defaultProps`. */