@yahoo/uds-create-config 5.25.1 → 5.26.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 (46) hide show
  1. package/dist/configs/system.js +2 -0
  2. package/dist/entities/native/NativeToken.js +4 -1
  3. package/dist/entities/system/Component.d.ts +35 -2
  4. package/dist/entities/system/Component.js +224 -9
  5. package/dist/entities/system/Settings.js +1 -1
  6. package/dist/entities/system/StyleProperty.js +1 -1
  7. package/dist/entities/system/component-module.d.ts +17 -1
  8. package/dist/entities/system/component-module.js +54 -2
  9. package/dist/entities/system/defineComponent.d.ts +53 -13
  10. package/dist/entities/system/defineComponent.js +1 -0
  11. package/dist/entities/system/forward-route-invariants.js +1 -1
  12. package/dist/entities/system/icon-domain-invariants.js +1 -1
  13. package/dist/entities/system/linked-token-values.js +9 -2
  14. package/dist/entities/system/root-layer-invariants.js +1 -1
  15. package/dist/entities/system/token-values.js +1 -1
  16. package/dist/framework/Config.d.ts +1 -1
  17. package/dist/framework/Config.js +1 -1
  18. package/dist/framework/class-names.d.ts +27 -1
  19. package/dist/framework/class-names.js +56 -3
  20. package/dist/framework/component-states.d.ts +40 -0
  21. package/dist/framework/component-states.js +53 -0
  22. package/dist/framework/interaction-conditions.d.ts +48 -0
  23. package/dist/framework/interaction-conditions.js +104 -0
  24. package/dist/framework/layer-styles.d.ts +5 -1
  25. package/dist/framework/layer-styles.js +18 -4
  26. package/dist/framework/projections.js +44 -2
  27. package/dist/framework/render-spec.js +14 -4
  28. package/dist/framework/schema-version.d.ts +1 -1
  29. package/dist/framework/schema-version.js +5 -5
  30. package/dist/framework/validate-spec.js +14 -0
  31. package/dist/index.d.ts +5 -3
  32. package/dist/index.js +6 -4
  33. package/dist/migrations/20261013154037_component_states.d.ts +19 -0
  34. package/dist/migrations/20261013154037_component_states.js +74 -0
  35. package/dist/renderer/componentEntry.d.ts +7 -1
  36. package/dist/renderer/componentEntry.js +30 -1
  37. package/dist/renderer/forced-stamp.d.ts +26 -0
  38. package/dist/renderer/forced-stamp.js +50 -0
  39. package/dist/renderer/index.d.ts +3 -1
  40. package/dist/renderer/index.js +3 -1
  41. package/dist/renderer/use-forced-stamp.d.ts +11 -0
  42. package/dist/renderer/use-forced-stamp.js +50 -0
  43. package/dist/spec/specToJsx.d.ts +6 -0
  44. package/dist/spec/specToJsx.js +5 -0
  45. package/dist/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +2 -2
@@ -2,9 +2,20 @@ import { isRef, refLeaf } from "./utils/refs.js";
2
2
  import { authoredBag } from "./projections.js";
3
3
  //#region src/framework/layer-styles.ts
4
4
  /** Whether every prop a rule names holds the value it asks for. Compared as strings, because a
5
- * condition is canonicalized into the rule's key and a variant value is a string there. */
5
+ * condition is canonicalized into the rule's key and a variant value is a string there.
6
+ *
7
+ * An interaction (`_hover`, see `interaction-conditions`) holds only when the state says it does —
8
+ * `{ _hover: true }`, a surface forcing it — whichever layer the rule names: no prop bag is ever
9
+ * hovered, so at rest the rule is out. */
6
10
  function ruleApplies(when, state) {
7
- return Object.entries(when ?? {}).every(([prop, value]) => String(state[prop]) === String(refLeaf(value)));
11
+ return Object.entries(when ?? {}).every(([prop, value]) => prop.startsWith("_") ? interactionHolds(state, prop, value) : String(state[prop]) === String(refLeaf(value)));
12
+ }
13
+ /** Whether an interaction holds: forced for the whole component (`_hover: true`, a surface's pin), or
14
+ * reported for the layer the condition names (`'_hover@close': true`, a live pointer). */
15
+ function interactionHolds(state, key, value) {
16
+ const on = (held) => held === true || held === "true";
17
+ if (on(state[key])) return true;
18
+ return on(state[`${key}@${value === true || value === "true" ? "root" : String(value)}`]);
8
19
  }
9
20
  /**
10
21
  * Merge a bag over another, flattening any forced modifier block as it goes.
@@ -14,15 +25,17 @@ function ruleApplies(when, state) {
14
25
  * with" for a panel and a matrix cell, and a picker's options are leaves.
15
26
  */
16
27
  function mergeBag(into, bag, forced) {
28
+ const forcedBlocks = [];
17
29
  for (const [key, value] of Object.entries(bag)) {
18
30
  const modifier = key.startsWith("_") ? key.slice(1) : void 0;
19
31
  if (modifier && value && typeof value === "object" && !isRef(value)) {
20
- if (forced.includes(modifier)) mergeBag(into, value, forced);
32
+ if (forced.includes(modifier)) forcedBlocks.push(value);
21
33
  else into[key] = value;
22
34
  continue;
23
35
  }
24
36
  into[key] = value;
25
37
  }
38
+ for (const block of forcedBlocks) mergeBag(into, block, forced);
26
39
  }
27
40
  /**
28
41
  * The resolved style bag per layer, for the props an instance was given.
@@ -36,7 +49,8 @@ function layerStyles(config, path, props = {}, options = {}) {
36
49
  ...defaultProps,
37
50
  ...props
38
51
  };
39
- const forced = options.forced ?? [];
52
+ const forced = (options.forced ?? []).map((name) => name.replace(/^_/, ""));
53
+ for (const name of forced) state[`_${name}`] = true;
40
54
  const applicable = Object.values(styles).filter((rule) => ruleApplies(rule.when, state)).sort((left, right) => Object.keys(left.when ?? {}).length - Object.keys(right.when ?? {}).length);
41
55
  const out = {};
42
56
  for (const rule of applicable) for (const [layer, bag] of Object.entries(rule.layers ?? {})) {
@@ -4,12 +4,13 @@ import { isOklchColor, renderOklch } from "../entities/system/color.js";
4
4
  import { isComposedValue, renderComposedValue } from "../entities/system/composed-values.js";
5
5
  import { modifierCategory } from "../entities/system/modifier-axis.js";
6
6
  import { forwardedPropName, forwardsOf, rootLayerOf } from "../entities/system/element.js";
7
+ import { createSliceMemo } from "./memo.js";
7
8
  import { fontFamilyStack } from "../entities/system/Font.js";
8
9
  import { listedIn } from "./utils/enumerated.js";
9
10
  import "../entities/system/Modifier.js";
10
- import { createSliceMemo } from "./memo.js";
11
11
  import { classPrefixOf, prefixed, varPrefixOf } from "../entities/system/Settings.js";
12
12
  import { StyleProperty, leavesOfStylePropValue, numberUnitRefusal } from "../entities/system/StyleProperty.js";
13
+ import { componentStates } from "./component-states.js";
13
14
  import { isConditionalPreview, storedPreview, unconditionalPreviewProps } from "./preview-store.js";
14
15
  //#region src/framework/projections.ts
15
16
  /**
@@ -797,6 +798,10 @@ function authoredBag(config, bag) {
797
798
  continue;
798
799
  }
799
800
  }
801
+ if (isComposedValue(value)) {
802
+ out[key] = value;
803
+ continue;
804
+ }
800
805
  if (value && typeof value === "object" && !Array.isArray(value) && !isRef(value)) {
801
806
  const inner = authoredBag(config, value);
802
807
  out[key] = inner;
@@ -1792,8 +1797,34 @@ function validateComponentProps(config, componentPath, props) {
1792
1797
  value: props[LAYER_PROPS],
1793
1798
  where: componentPath
1794
1799
  });
1800
+ const states = Object.fromEntries(componentStates(config, componentPath).map((state) => [state.name, {
1801
+ type: state.type,
1802
+ value: state.values
1803
+ }]));
1804
+ const checkState = (name, value) => {
1805
+ if (name.startsWith("_")) {
1806
+ if (modifierCategory(config, name.slice(1)) !== "state") errors.push(`\`${name}\` is not a state modifier`);
1807
+ else if (!["true", "false"].includes(String(value))) errors.push(`\`${name}\` is \`true\` or \`false\`, not \`${String(value)}\``);
1808
+ return;
1809
+ }
1810
+ const state = states[name];
1811
+ if (!state) {
1812
+ errors.push(`\`${name}\` is not a state`);
1813
+ return;
1814
+ }
1815
+ const allowed = state.type === "variant" && Array.isArray(state.value) ? state.value.map(String) : ["true", "false"];
1816
+ if (!allowed.includes(String(value))) errors.push(`state \`${name}\` is ${allowed.map((v) => `\`${v}\``).join(" or ")}, not \`${String(value)}\``);
1817
+ };
1795
1818
  for (const [name, value] of Object.entries(props)) {
1796
1819
  if (name === "layerProps") continue;
1820
+ if (name === "__udsForceStates") {
1821
+ for (const [pinned, pin] of Object.entries(value ?? {})) checkState(pinned, pin);
1822
+ continue;
1823
+ }
1824
+ if (states[name]) {
1825
+ errors.push(`\`${name}\` is a state, not a prop — pin it as \`__udsForceStates: { ${name}: … }\``);
1826
+ continue;
1827
+ }
1797
1828
  const decl = declared[name];
1798
1829
  if (!decl) {
1799
1830
  errors.push(`unknown prop \`${name}\``);
@@ -1957,7 +1988,13 @@ function previewMatrix(config, path) {
1957
1988
  props[prop] = values;
1958
1989
  };
1959
1990
  for (const rule of Object.values(styles)) {
1960
- for (const [prop, stored] of Object.entries(rule.when ?? {})) nameAxisPoint(prop, stored);
1991
+ for (const [prop, stored] of Object.entries(rule.when ?? {})) {
1992
+ if (prop.startsWith("_")) {
1993
+ if (modifierCategory(config, prop.slice(1)) === "state") modifiers.add(prop);
1994
+ continue;
1995
+ }
1996
+ nameAxisPoint(prop, stored);
1997
+ }
1961
1998
  for (const bag of Object.values(rule.layers ?? {})) for (const key of Object.keys(bag ?? {})) {
1962
1999
  if (!key.startsWith("_")) continue;
1963
2000
  if (modifierCategory(config, key.slice(1)) === "state") modifiers.add(key);
@@ -1975,6 +2012,10 @@ function previewMatrix(config, path) {
1975
2012
  if (values.length > 0) props[name] = values;
1976
2013
  }
1977
2014
  }
2015
+ for (const state of componentStates(config, path)) {
2016
+ if (state.type === "boolean") props[state.name] = declaredFirst(["false", "true"], props[state.name] ?? []);
2017
+ if (state.type === "variant") props[state.name] = declaredFirst([...state.values ?? []], props[state.name] ?? []);
2018
+ }
1978
2019
  return {
1979
2020
  props,
1980
2021
  modifiers: [...modifiers]
@@ -1995,6 +2036,7 @@ function declaredFirst(declared, ruleNamed) {
1995
2036
  function propValueFromAxis(config, path, prop, value) {
1996
2037
  const declared = resolveComponentProps(config, path)[prop];
1997
2038
  if (declared?.type === "boolean") return value === "true";
2039
+ if (componentStates(config, path).some((state) => state.name === prop && state.type === "boolean")) return value === "true";
1998
2040
  if (declared?.type === "number") {
1999
2041
  const parsed = Number(value);
2000
2042
  return Number.isFinite(parsed) ? parsed : value;
@@ -1,6 +1,7 @@
1
1
  import { isRef, kindOf, memberOf, pathOf, ref, splitRef } from "./utils/refs.js";
2
2
  import { renderedElement } from "../entities/system/element.js";
3
3
  import { createSliceMemo } from "./memo.js";
4
+ import { componentStateDefaults, componentStates } from "./component-states.js";
4
5
  import { unconditionalPreviewProps } from "./preview-store.js";
5
6
  import { authoredBag, authoredValue, declaredPropDefaults, memberFromLeaf, refListOf, resolveComponentProps, stylePropertyPathFor } from "./projections.js";
6
7
  import { slotHostLayer } from "./slot-host.js";
@@ -8,7 +9,7 @@ import { forwardRoutes, forwardedLayers, intoName, isValueSlot, renderBindingsOf
8
9
  import { withRequiredContentHidden } from "../entities/system/required-content-layers.js";
9
10
  import { inlineMotionProps, jsMotionPresets } from "../entities/system/motion-presets.js";
10
11
  import { graftPreviewElements } from "../spec/preview-elements.js";
11
- import { componentLayerClass, componentPropClasses, componentRuleClasses, layerJsMotionPresets, layerRoutedProps, splitStyleProps, styleRuleMotionClasses } from "./class-names.js";
12
+ import { componentLayerClass, componentPropClasses, componentRuleClasses, componentStateAttributes, forcedModifierAttributes, layerJsMotionPresets, layerRoutedProps, splitStyleProps, styleRuleMotionClasses } from "./class-names.js";
12
13
  //#region src/framework/render-spec.ts
13
14
  /** A repeat source that is one prop binding: `{ "$state": "/stops" }`, settled by the cell alone. */
14
15
  function isStateSource(source) {
@@ -1202,11 +1203,14 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1202
1203
  const filled = {};
1203
1204
  for (const [from, fills] of Object.entries(instanceSlots ?? {})) if (fills.length > 0 && instanceProps[from] === void 0) filled[from] = true;
1204
1205
  const declaredDefaults = declaredPropDefaults(body.props);
1206
+ const pins = instanceProps["__udsForceStates"] ?? {};
1205
1207
  const state = {
1206
1208
  ...declaredDefaults,
1207
1209
  ...body.defaultProps,
1210
+ ...componentStateDefaults(config, path),
1208
1211
  ...filled,
1209
- ...instanceProps
1212
+ ...instanceProps,
1213
+ ...Object.fromEntries(Object.entries(pins).map(([key, value]) => key.startsWith("_") ? [key, value === true || value === "true"] : [key, value]))
1210
1214
  };
1211
1215
  const consumed = consumedProps(config, path, body);
1212
1216
  const { byLayer: targets } = slotTargets(config, path, body);
@@ -1222,8 +1226,12 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1222
1226
  ...body.defaultProps ?? {},
1223
1227
  ...instanceProps
1224
1228
  };
1229
+ const stateNames = new Set(componentStates(config, path).map(({ name }) => name));
1225
1230
  const bag = {};
1226
- for (const [name, value] of Object.entries(supplied)) if (!consumed.has(name)) bag[name] = value;
1231
+ for (const [name, value] of Object.entries(supplied)) {
1232
+ if (name === "__udsForceStates") continue;
1233
+ if (!consumed.has(name) && !stateNames.has(name)) bag[name] = value;
1234
+ }
1227
1235
  const { className: styleClasses, rest } = splitStyleProps({
1228
1236
  config,
1229
1237
  bag,
@@ -1352,6 +1360,8 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1352
1360
  ...forwarded[layer],
1353
1361
  ...motionPreset !== void 0 ? withoutKey(presetProps[motionPreset], "reducedMotion") : {},
1354
1362
  ...Object.fromEntries((valueRoutes.get(layer) ?? []).filter(({ from }) => state[from] !== void 0).map(({ from, into }) => [into, state[from]])),
1363
+ ...isRoot ? componentStateAttributes(componentStates(config, path), state) : {},
1364
+ ...isRoot || type === void 0 || kindOf(type) !== "component" ? forcedModifierAttributes(pins, path) : {},
1355
1365
  ...isRoot ? rest : {},
1356
1366
  ...slot && slotValue !== void 0 ? { [intoName(slot.into)]: slotValue } : {},
1357
1367
  ...layerProps[layer],
@@ -1365,7 +1375,7 @@ function expandInstance(sink, path, instanceProps, content, hint, instanceSlots)
1365
1375
  ...authoredProps(config, node.props),
1366
1376
  [ANATOMY_MARKER]: key
1367
1377
  };
1368
- if (node.text !== void 0) props.children = node.text;
1378
+ if (node.text !== void 0 && props.children === void 0) props.children = node.text;
1369
1379
  for (const [name, value] of Object.entries(props)) {
1370
1380
  const settled = resolveValue(value, state, resolving);
1371
1381
  if (settled !== value) props[name] = settled;
@@ -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 = 20261012200606;
18
+ declare const CURRENT_SCHEMA_VERSION = 20261013154037;
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 = 20261012200606;
16
+ const CURRENT_SCHEMA_VERSION = 20261013154037;
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 > 20261012200606) 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 > 20261013154037) 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 ?? 20261012200606;
105
+ const target = options?.target ?? 20261013154037;
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 ?? 20261012200606;
163
+ const target = options?.target ?? 20261013154037;
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 ?? 20261012200606;
182
+ const target = options?.target ?? 20261013154037;
183
183
  const entries = [];
184
184
  const held = [];
185
185
  const retired = [];
@@ -1,6 +1,9 @@
1
1
  import { kindOf, memberOf, pathOf, splitRef } from "./utils/refs.js";
2
+ import { modifierCategory } from "../entities/system/modifier-axis.js";
2
3
  import { childrenPolicy } from "../entities/system/element.js";
4
+ import { UDS_FORCE_STATES, componentStates } from "./component-states.js";
3
5
  import { LAYER_PROPS, layerPropsErrors, resolveComponentProps } from "./projections.js";
6
+ import "./class-names.js";
4
7
  import { slotOf } from "../spec/slot.js";
5
8
  import { refResolves } from "./ref-integrity.js";
6
9
  //#region src/framework/validate-spec.ts
@@ -28,8 +31,19 @@ function walk(config, node, path, errors) {
28
31
  errors.push(`${path}: unknown ${kind} "${named}"`);
29
32
  } else if (kind === "component") {
30
33
  const props = resolveComponentProps(config, target);
34
+ const states = new Set(componentStates(config, target).map(({ name }) => name));
31
35
  for (const name of Object.keys(node.props ?? {})) {
32
36
  if (name === "layerProps") continue;
37
+ if (name === "__udsForceStates") {
38
+ for (const pinned of Object.keys(node.props?.["__udsForceStates"] ?? {})) if (pinned.startsWith("_")) {
39
+ if (modifierCategory(config, pinned.slice(1)) !== "state") errors.push(`${path}: "${pinned}" is not a state modifier`);
40
+ } else if (!states.has(pinned)) errors.push(`${path}: "${pinned}" is not a state of "${node.type}"`);
41
+ continue;
42
+ }
43
+ if (states.has(name)) {
44
+ errors.push(`${path}: "${name}" is a state of "${node.type}", not a prop — pin it as ${UDS_FORCE_STATES}: { ${name}: … }`);
45
+ continue;
46
+ }
33
47
  if (!(name in props)) errors.push(`${path}: unknown prop "${name}" on "${node.type}"`);
34
48
  }
35
49
  errors.push(...layerPropsErrors({
package/dist/index.d.ts CHANGED
@@ -72,7 +72,7 @@ import { CanvasSection, CanvasSectionClass, NativeSettings } from "./entities/na
72
72
  import { NativeStyleProperty, rnStyleKey } from "./entities/native/NativeStyleProperty.js";
73
73
  import { NativeToken, nativeTokenValue } from "./entities/native/NativeToken.js";
74
74
  import { CANVAS_ROLES, CanvasRole, CanvasRoleClass, CanvasRoleName } from "./entities/system/CanvasRole.js";
75
- import { COMPONENT_ENTRY_STATIC, ComponentModuleSource, ComponentRegistryImport, ComponentRegistryImportBinding, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, linkedComponentModule, linkedModuleView } from "./entities/system/component-module.js";
75
+ import { COMPONENT_ENTRY_STATIC, CREATED_COMPONENT_DIRECTORY, ComponentModuleSource, ComponentRegistryImport, ComponentRegistryImportBinding, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, createdComponentFilePath, createdComponentPathOf, createdModuleKey, isCreatedComponent, linkedComponentModule, linkedModuleView } from "./entities/system/component-module.js";
76
76
  import { Device, DeviceClass } from "./entities/system/Device.js";
77
77
  import { ChildrenPolicy, RenderedTarget, VOID_ELEMENTS, childrenPolicy, forwardsOf, ownerOf, partsOf, renderedElement, renderedTarget, rootLayerOf } from "./entities/system/element.js";
78
78
  import { File, FileClass, SCRIPT_EXTENSIONS, isBinaryAsset } from "./entities/system/File.js";
@@ -97,11 +97,13 @@ import { AnatomyIssue, AnatomyIssueKind, AnatomyReport, DiffOptions, RenderedNod
97
97
  import { LayerPropDriver, MarkerKind, ResolvedBinding, bindStateRef, bindingPath, condArms, condValue, containsMarker, layerPropDrivers, markerKind, readsState, resolveBinding, stateRef, stateTest } from "./framework/bindings.js";
98
98
  import { ChangeHook, runChangeHooks } from "./framework/change-hooks.js";
99
99
  import { Change, ChangeTarget, baseOf, changeOf, changeValueAt, changesOf, describeBody, summarizeChanges } from "./framework/changes.js";
100
- import { ComponentRuleClass, PickedComposite, SplitStyleProps, arbitraryClassName, arbitraryNeedsClass, classLeaf, classSelector, componentClassBase, componentCompositeClasses, componentLayerClass, componentMotionClasses, componentPropClasses, componentPropComposites, componentRuleClasses, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, inlineRuleComposites, isForceModeProp, kebabComponent, layerJsMotionPresets, layerRoutedProps, modifierUtilitiesUsed, motionClassName, ruleCondition, splitStyleProps, splitVariants, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropOffScaleLiteral, stylePropOwnClasses, styleRuleMotionClasses } from "./framework/class-names.js";
100
+ import { ComponentState, UDS_FORCE_STATES, componentStateDefaults, componentStates } from "./framework/component-states.js";
101
+ import { ComponentRuleClass, PickedComposite, SplitStyleProps, arbitraryClassName, arbitraryNeedsClass, classLeaf, classSelector, componentClassBase, componentCompositeClasses, componentLayerClass, componentMotionClasses, componentPropClasses, componentPropComposites, componentRuleClasses, componentStateAttribute, componentStateAttributes, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forceStateSelector, inlineRuleComposites, isForceModeProp, kebabComponent, layerJsMotionPresets, layerRoutedProps, modifierUtilitiesUsed, motionClassName, ruleCondition, splitStyleProps, splitVariants, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropOffScaleLiteral, stylePropOwnClasses, styleRuleMotionClasses } from "./framework/class-names.js";
101
102
  import { CONFIG_OPERATION_KIND } from "./framework/config-operation-kind.js";
102
103
  import { AuthoringSignatureOptions, KindSignature, authoringSignatures } from "./framework/config-ops.js";
103
104
  import { DERIVED_MUTATIONS } from "./framework/derived-mutations.js";
104
105
  import { matchEntities, normalizeName, searchEntities } from "./framework/entity-search.js";
106
+ import { ComponentInteraction, InteractionCondition, componentInteractions, hasInteraction, interactionKey, interactionModifiers, isInteractionModifier, whenParts } from "./framework/interaction-conditions.js";
105
107
  import { LayerStyleOptions, layerStyles, ruleApplies } from "./framework/layer-styles.js";
106
108
  import { HasSnapshot, createSliceMemo } from "./framework/memo.js";
107
109
  import { DanglingLocalRef, UnknownStyleLeaf, danglingLocalRefs, unknownStyleLeaves } from "./framework/ref-integrity.js";
@@ -118,4 +120,4 @@ import { SpecNode, validateSpec } from "./framework/validate-spec.js";
118
120
  import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
119
121
  import { views } from "./framework/views-facade.js";
120
122
  import { RN_STYLE_KEYS } from "./react-native/style-keys.generated.js";
121
- 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, 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 ComponentItemInput, type ComponentModuleSource, type ComponentPropBody, type ComponentPropsOf, type ComponentReference, type ComponentRegistryImport, type ComponentRegistryImportBinding, type ComponentRuleClass, type ComponentSpec, type ComponentSpecs, 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 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 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 LinkedElsewhere, LinkedSystem, type LinkedSystemClass, type LinkedSystemCreateInput, type LinkedSystemItemInput, type LinkedSystemResolver, type LinkedSystemState, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, MOTION_FACTORY, MOTION_VARIANT_STATES, type MarkerKind, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierClass, type ModifierGroupMeta, Motion, type MotionClass, type MotionPresetToken, type Multiply, NATIVE_ACTIVATIONS, type NativeActivation, 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 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 RegisteredEntities, type RegisteredMembers, type RegisteredModifiers, type RegisteredMotionRuntimes, type RegisteredPaths, type RegisteredStyleBag, type RegisteredStyleProps, type RegisteredTokenValues, 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 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 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 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, 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, calcOperands, calcOperator, canonicalWhen, capturedFromDom, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSpec, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, condArms, condValue, containsMarker, convertLinkedTokenValue, createCanvasConfig, createSliceMemo, 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, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, elementFromCaptured, entityRefOf, entryKeyOf, evaluateCalc, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, 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, intoName, isAdd, isAuthored, isBinaryAsset, isCalc, isComposedValue, isConfigFormatError, isConfigRejection, isCssProperty, isCustomPropertyKey, isDeclaredElementProp, isDerivedColor, isDivide, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isLinkSlug, isMintedRow, isMultiply, isNativeConfig, isOklchColor, isPlainObject, isPreviewElement, isRef, 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, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, 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, resolutionSchema, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, 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, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, 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, 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, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
123
+ 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 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 LinkedElsewhere, LinkedSystem, type LinkedSystemClass, type LinkedSystemCreateInput, type LinkedSystemItemInput, type LinkedSystemResolver, type LinkedSystemState, type ListOptions, type LiveConfig, type LocalOverlay, MINTED, MODIFIER_CATEGORIES, MOTION_FACTORY, MOTION_VARIANT_STATES, type MarkerKind, type MisdeclaredOverlay, Modifier, type ModifierCategory, type ModifierClass, type ModifierGroupMeta, Motion, type MotionClass, type MotionPresetToken, type Multiply, NATIVE_ACTIVATIONS, type NativeActivation, 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 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 RegisteredEntities, type RegisteredMembers, type RegisteredModifiers, type RegisteredMotionRuntimes, type RegisteredPaths, type RegisteredStyleBag, type RegisteredStyleProps, type RegisteredTokenValues, 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 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 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 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, calcOperands, calcOperator, canonicalWhen, capturedFromDom, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, componentClassBase, componentCompositeClasses, componentInteractions, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSpec, componentStateAttribute, componentStateAttributes, componentStateDefaults, componentStates, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, 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, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, elementFromCaptured, entityRefOf, entryKeyOf, evaluateCalc, expandComponent, expandSpec, fieldKeys, fontFamilyStack, 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, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isInteractionModifier, isLinkSlug, isMintedRow, isMultiply, isNativeConfig, isOklchColor, isPlainObject, isPreviewElement, isRef, 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, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, 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, resolutionSchema, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, 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, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, 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, 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, whenParts, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
package/dist/index.js CHANGED
@@ -18,6 +18,8 @@ import { GROUP, brandGroup, isGroupBody } from "./framework/utils/group.js";
18
18
  import { defineEntity } from "./framework/defineEntity.js";
19
19
  import { defineSubEntity, orList } from "./framework/defineSubEntity.js";
20
20
  import { VOID_ELEMENTS, childrenPolicy, forwardsOf, ownerOf, partsOf, renderedElement, renderedTarget, rootLayerOf } from "./entities/system/element.js";
21
+ import { createSliceMemo } from "./framework/memo.js";
22
+ import { componentInteractions, hasInteraction, interactionKey, interactionModifiers, isInteractionModifier, whenParts } from "./framework/interaction-conditions.js";
21
23
  import { Font, FontFile, cssString, fontFamilyStack } from "./entities/system/Font.js";
22
24
  import { CSS_PROPERTY_NAMES, CSS_WIDE_KEYWORDS, cssProperty, cssValueIssue, isCssProperty } from "./css/values.js";
23
25
  import { valueLeavesOf, valueSchemaOf } from "./framework/value-domain.js";
@@ -28,12 +30,12 @@ import { MODIFIER_CATEGORIES, Modifier, WEB_ACTIVATIONS, modeAxes, modifierAxes,
28
30
  import { BUILD_DEFAULTS } from "./configs/build-options.js";
29
31
  import { resolveValueType, sniffValueType } from "./css/value-type.js";
30
32
  import { parseRootFontSize } from "./css/root-font-size.js";
31
- import { createSliceMemo } from "./framework/memo.js";
32
33
  import { resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, resolveSourceAlias } from "./framework/registry-dir.js";
33
34
  import { safelistEntrySchema } from "./entities/system/safelist.js";
34
35
  import { BuildSection, CSS_DEFAULTS, CssSection, PLAYGROUND_DEFAULTS, PlaygroundSection, Settings, SystemSection, classPrefixOf, cssPrefixes, prefixed, varPrefixOf } from "./entities/system/Settings.js";
35
36
  import { isIdentifier, isReservedWord } from "./framework/utils/identifier.js";
36
37
  import { STYLE_PROP_NUMBER_UNITS, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StyleProperty, classifyStylePropValue, cssPropertyNames, leavesOfStylePropValue, stylePropValueFormOf, stylePropValueSchema, toCssPropertyName, tokenVariablesAsText } from "./entities/system/StyleProperty.js";
38
+ import { UDS_FORCE_STATES, componentStateDefaults, componentStates } from "./framework/component-states.js";
37
39
  import { UNCONDITIONAL_PREVIEW_KEY, storedPreview, unconditionalPreviewProps } from "./framework/preview-store.js";
38
40
  import { authoredBag, authoredValue, bodyNumberLeaves, bodyNumberUnit, className, cssPropValue, cssVar, cssVarRef, declarationKeyName, declaredPropDefaults, declaredPropRouting, declaresCssVariable, glyphComponentOf, glyphLibrariesOf, glyphPropsOf, heldLinked, iconToolAxisOptions, iconToolFor, iconToolOf, iconToolsOf, isCustomPropertyKey, keyedPreviewConditions, 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";
39
41
  import { codeSlotsOf, forwardClaims, forwardRoutes, forwardedLayers, glyphVariantProp, intoName, isValueSlot, layerPropRoutes, ownTextProp, propApplies, propRegistryRef, renderBindingsOf, routedProp, routedPropIn, routesContent, slotCodeForms, standsInForCode, surfaceProp, surfaceProps } from "./framework/prop-surface.js";
@@ -45,7 +47,7 @@ import { renderValue, valueTypeOf } from "./entities/system/value-render.js";
45
47
  import { hasJsMotion, inlineMotionProps, jsMotionPresets, motionPresetTokens } from "./entities/system/motion-presets.js";
46
48
  import { graftPreviewElements, isPreviewElement } from "./spec/preview-elements.js";
47
49
  import { layerStyles, ruleApplies } from "./framework/layer-styles.js";
48
- import { arbitraryClassName, arbitraryNeedsClass, classLeaf, classSelector, componentClassBase, componentCompositeClasses, componentLayerClass, componentMotionClasses, componentPropClasses, componentPropComposites, componentRuleClasses, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, inlineRuleComposites, isForceModeProp, kebabComponent, layerJsMotionPresets, layerRoutedProps, modifierUtilitiesUsed, motionClassName, ruleCondition, splitStyleProps, splitVariants, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropOffScaleLiteral, stylePropOwnClasses, styleRuleMotionClasses } from "./framework/class-names.js";
50
+ import { arbitraryClassName, arbitraryNeedsClass, classLeaf, classSelector, componentClassBase, componentCompositeClasses, componentLayerClass, componentMotionClasses, componentPropClasses, componentPropComposites, componentRuleClasses, componentStateAttribute, componentStateAttributes, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forceStateSelector, inlineRuleComposites, isForceModeProp, kebabComponent, layerJsMotionPresets, layerRoutedProps, modifierUtilitiesUsed, motionClassName, ruleCondition, splitStyleProps, splitVariants, stylePropClassBase, stylePropClassName, stylePropClasses, stylePropOffScaleLiteral, stylePropOwnClasses, styleRuleMotionClasses } from "./framework/class-names.js";
49
51
  import { ANATOMY_MARKER, MOTION_FACTORY, 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";
50
52
  import { instanceHolding } from "./spec/instance.js";
51
53
  import { File, SCRIPT_EXTENSIONS, isBinaryAsset } from "./entities/system/File.js";
@@ -81,7 +83,7 @@ import { CANVAS_ROLES, CanvasRole } from "./entities/system/CanvasRole.js";
81
83
  import { GlobalStyle, globalStyleName } from "./entities/system/GlobalStyle.js";
82
84
  import { Guidance, guidanceReaches, guidanceScopeOf, guidanceTextOf } from "./entities/system/Guidance.js";
83
85
  import { GuidanceStyle } from "./entities/system/GuidanceStyle.js";
84
- import { COMPONENT_ENTRY_STATIC, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, linkedComponentModule, linkedModuleView } from "./entities/system/component-module.js";
86
+ import { COMPONENT_ENTRY_STATIC, CREATED_COMPONENT_DIRECTORY, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentRegistryImports, createdComponentFilePath, createdComponentPathOf, createdModuleKey, isCreatedComponent, linkedComponentModule, linkedModuleView } from "./entities/system/component-module.js";
85
87
  import { planCopy, sourceEntries } from "./entities/system/copy-plan.js";
86
88
  import { planBreak, planLink, planUnlink, sourceRowStates } from "./entities/system/link-plan.js";
87
89
  import { LINK_SLUG, LINK_SLUG_MESSAGE, LinkedSystem, borrowedGroup, borrowedItem, isLinkSlug, resolvedSource, sourceOfGroup, sourceOfItem, sourceSlugFor, sourceUnavailable, suggestLinkSlug } from "./entities/system/LinkedSystem.js";
@@ -110,4 +112,4 @@ import { inferredRenames } from "./framework/rename-inference.js";
110
112
  import { ConfigSession, memoryConfigSource } from "./framework/session.js";
111
113
  import { EXPORT_MEMBER, packageKey, packageName } from "./framework/utils/package-path.js";
112
114
  import { validateSpec } from "./framework/validate-spec.js";
113
- export { AI_LANES, ANATOMY_MARKER, AiChat, AiFlow, AiGeneration, AiMessage, Annotation, AnnotationFields, BUILD_DEFAULTS, BuildSection, CANVAS_ROLES, COMPONENT_ENTRY_STATIC, CONFIG_OPERATION_KIND, 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, 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, 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, calcOperands, calcOperator, canonicalWhen, capturedFromDom, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, componentClassBase, componentCompositeClasses, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSpec, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, condArms, condValue, containsMarker, convertLinkedTokenValue, createCanvasConfig, createSliceMemo, 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, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, elementFromCaptured, entityRefOf, entryKeyOf, evaluateCalc, expandComponent, expandSpec, fieldKeys, fontFamilyStack, forceModeAttribute, forceModeAttributeOf, forceModeProp, forceModePropGroup, forceModePropValue, forceModeProps, forceStateAttribute, forwardClaims, forwardRoutes, forwardedLayers, forwardedNames, forwardsOf, globalStyleName, glyphComponentOf, glyphExportNames, glyphExportRule, glyphLibrariesOf, glyphPropsOf, glyphSourcesOf, glyphType, glyphVariantProp, graftPreviewElements, guidanceReaches, guidanceScopeOf, guidanceTextOf, 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, intoName, isAdd, isAuthored, isBinaryAsset, isCalc, isComposedValue, isConfigFormatError, isConfigRejection, isCssProperty, isCustomPropertyKey, isDeclaredElementProp, isDerivedColor, isDivide, isEntityPath, isExtendedRef, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isLinkSlug, isMintedRow, isMultiply, isNativeConfig, isOklchColor, isPlainObject, isPreviewElement, isRef, 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, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, 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, resolutionSchema, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, 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, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, 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, 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, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
115
+ 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, 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, calcOperands, calcOperator, canonicalWhen, capturedFromDom, changeOf, changeValueAt, changesOf, childrenPolicy, classGrammar, classLeaf, className, classPrefixOf, classSelector, classifyOverlay, classifyStylePropValue, codeSlotsOf, collectRefs, componentClassBase, componentCompositeClasses, componentInteractions, componentLayerClass, componentModuleFilePaths, componentModuleKey, componentModuleSource, componentMotionClasses, componentPropClasses, componentPropComposites, componentRegistryImports, componentRuleClasses, componentSpec, componentStateAttribute, componentStateAttributes, componentStateDefaults, componentStates, composedValueAuthoring, composedValueFormOf, composedValueForms, composedValueSchemas, 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, deriveSpec, deriveUpdateSchema, describeBody, describePatch, detectedWireVersion, diffRendered, divide, editOp, elementFromCaptured, entityRefOf, entryKeyOf, evaluateCalc, expandComponent, expandSpec, fieldKeys, fontFamilyStack, 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, isForceModeProp, isGradient, isGroupBody, isIdentifier, isInlineMotion, isInteractionModifier, isLinkSlug, isMintedRow, isMultiply, isNativeConfig, isOklchColor, isPlainObject, isPreviewElement, isRef, 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, linkedModuleView, linkedVarNaming, literalValueOf, liveStateProps, markerKind, matchEntities, matchTokens, memberFromLeaf, memberLeaves, memberOf, memberRef, memberVariantOptions, memoryConfigSource, misdeclaredOverlays, mix, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf, modifierUtilitiesUsed, motionClassName, motionPresetTokens, motionVariantGroups, multiply, nameIconsInTree, nameStyleNumbers, namedFields, nativeTokenValue, negatedCssValue, normalizeName, normalizeStyleValue, oklch, opOf, opVerb, opacityPercentage, opsForKind, orList, orRef, orphanedMotionVariants, overlayVerb, overrideCondition, overrideKey, overrideKeyModifiers, overrideModifiers, 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, resolutionSchema, resolveBinding, resolveComponentProps, resolveFieldValue, resolveIconLibraries, resolveInputDir, resolveOutDir, resolveOutputAlias, resolveRegistryDir, 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, signatureOf, slotCodeForms, slotTargetsOf, snapshotHtml, sniffValueType, sourceEntries, sourceHops, sourceOf, sourceOfGroup, sourceOfItem, sourceRowStates, sourceSlugFor, sourceUnavailable, sourceUnreachable, sourceVarPrefix, specFromCapture, specToNodePatches, specWithResolvedVisibility, spellTokenRead, splitRef, splitRefMarkers, 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, 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, whenParts, withRequiredContentHidden, withoutTruthyTerm, wrappedElementKey };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A component's STATES — what its render knows and a style rule keys on — are their own field,
3
+ * `states`, not props: `{ "filled": { "type": "boolean" } }`, `{ "phase": { "type": "variant",
4
+ * "value": ["idle", "sliding"], "default": "idle" } }`. A caller never passes one, so none is part of
5
+ * the component's API. Style rules name a state in `when` like a prop, with its value written plainly
6
+ * (a variant state has no value members to ref).
7
+ *
8
+ * A stored config from before this version has no states, so `up` passes it through. The one shape it
9
+ * folds is the `state: true` prop a pre-release build of this change wrote (stamped 20261006125634 on
10
+ * its preview deployments only, never on main): it moves to `states`, taking a variant's
11
+ * `defaultProps` entry as its default. Stored patches never named it, so there is no `upPatch`.
12
+ *
13
+ * Deletable once no stored artifact predates it.
14
+ */
15
+ import type { SchemaMigration } from '../framework/schema-version';
16
+ export declare const COMPONENT_STATES_VERSION = 20261013154037;
17
+ /** One component body with its `state: true` props moved to `states`. */
18
+ export declare function foldedStates(body: Record<string, unknown>): Record<string, unknown>;
19
+ export declare const componentStatesMigration: SchemaMigration;
@@ -0,0 +1,74 @@
1
+ import { isPlainObject } from "../framework/utils/field-path.js";
2
+ //#region src/migrations/20261013154037_component_states.ts
3
+ const COMPONENT_STATES_VERSION = 20261013154037;
4
+ /** A condition value read to the name it spells, frozen here: a ref's last path segment, else the
5
+ * value itself. */
6
+ function leafOf(value) {
7
+ if (isPlainObject(value) && typeof value.__ref === "string") return /([^/]*)$/.exec(value.__ref)?.[1] ?? value.__ref;
8
+ return value;
9
+ }
10
+ /** One component body with its `state: true` props moved to `states`. */
11
+ function foldedStates(body) {
12
+ const props = isPlainObject(body.props) ? body.props : void 0;
13
+ if (!props) return body;
14
+ const moved = Object.entries(props).filter(([, decl]) => isPlainObject(decl) && decl.state === true);
15
+ if (moved.length === 0) return body;
16
+ const nextProps = { ...props };
17
+ const defaults = isPlainObject(body.defaultProps) ? { ...body.defaultProps } : void 0;
18
+ const states = isPlainObject(body.states) ? { ...body.states } : {};
19
+ for (const [name, decl] of moved) {
20
+ delete nextProps[name];
21
+ const { type, value } = decl;
22
+ if (type === "variant" && Array.isArray(value)) {
23
+ const fallback = defaults?.[name];
24
+ states[name] = {
25
+ type: "variant",
26
+ value: value.map((member) => String(leafOf(member))),
27
+ ...typeof leafOf(fallback) === "string" ? { default: leafOf(fallback) } : {}
28
+ };
29
+ } else states[name] = { type: "boolean" };
30
+ if (defaults) delete defaults[name];
31
+ }
32
+ const movedVariants = new Set(moved.filter(([, decl]) => decl.type === "variant").map(([name]) => name));
33
+ const plainWhen = (entry) => {
34
+ if (!isPlainObject(entry) || !isPlainObject(entry.when)) return entry;
35
+ const when = { ...entry.when };
36
+ for (const name of movedVariants) if (name in when) when[name] = leafOf(when[name]);
37
+ return {
38
+ ...entry,
39
+ when
40
+ };
41
+ };
42
+ const plainConditions = (collection) => Array.isArray(collection) ? collection.map(plainWhen) : isPlainObject(collection) ? Object.fromEntries(Object.entries(collection).map(([key, entry]) => [key, plainWhen(entry)])) : collection;
43
+ return {
44
+ ...body,
45
+ props: nextProps,
46
+ states,
47
+ ...defaults ? { defaultProps: defaults } : {},
48
+ ...movedVariants.size > 0 && body.styles !== void 0 ? { styles: plainConditions(body.styles) } : {},
49
+ ...movedVariants.size > 0 && body.preview !== void 0 ? { preview: plainConditions(body.preview) } : {}
50
+ };
51
+ }
52
+ const componentStatesMigration = {
53
+ version: COMPONENT_STATES_VERSION,
54
+ up(json) {
55
+ const items = isPlainObject(json.items) ? json.items : void 0;
56
+ const components = isPlainObject(items?.component) ? items.component : void 0;
57
+ if (!items || !components) return json;
58
+ let changed = false;
59
+ const folded = Object.fromEntries(Object.entries(components).map(([path, body]) => {
60
+ const next = isPlainObject(body) ? foldedStates(body) : body;
61
+ if (next !== body) changed = true;
62
+ return [path, next];
63
+ }));
64
+ return changed ? {
65
+ ...json,
66
+ items: {
67
+ ...items,
68
+ component: folded
69
+ }
70
+ } : json;
71
+ }
72
+ };
73
+ //#endregion
74
+ export { COMPONENT_STATES_VERSION, componentStatesMigration };
@@ -19,7 +19,7 @@ type ComponentEntry = (ctx: BaseComponentProps) => React.ReactNode;
19
19
  */
20
20
  declare function slotFillValue(fill: React.ReactNode): React.ReactNode;
21
21
  /** The facts codegen stamps on an emitted component as `__udsEntry`. */
22
- type ComponentEntryFacts = Pick<MakeComponentEntryOptions, 'childless' | 'computed'>;
22
+ type ComponentEntryFacts = Pick<MakeComponentEntryOptions, 'childless' | 'computed' | 'states'>;
23
23
  interface MakeComponentEntryOptions {
24
24
  component: React.ComponentType<any>;
25
25
  /**
@@ -41,6 +41,12 @@ interface MakeComponentEntryOptions {
41
41
  * registered as the entry is made, which is when a canvas can first paint the component.
42
42
  */
43
43
  computed?: ComputedFunctions;
44
+ /**
45
+ * The component's states. A spec element pins one under its name (the grid's `filled` column, a
46
+ * canvas mock); a state is never a prop, so the entry hands those values to the module through its
47
+ * internal channel ({@link UDS_FORCE_STATES}) instead.
48
+ */
49
+ states?: readonly string[];
44
50
  }
45
51
  /**
46
52
  * One component's registry entry.