@yahoo/uds-create-config 4.51.3 → 4.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/capture/node-ops.js +1 -11
  2. package/dist/configs/CanvasConfig.js +5 -1
  3. package/dist/configs/system.js +6 -0
  4. package/dist/entities/canvas/node-gestures.d.ts +2 -0
  5. package/dist/entities/canvas/node-gestures.js +616 -0
  6. package/dist/{capture → entities/canvas}/node-patches.d.ts +6 -4
  7. package/dist/{capture → entities/canvas}/node-patches.js +16 -3
  8. package/dist/entities/system/Component.d.ts +47 -32
  9. package/dist/entities/system/Component.js +181 -30
  10. package/dist/entities/system/LinkedSystem.d.ts +10 -3
  11. package/dist/entities/system/Motion.d.ts +5 -1
  12. package/dist/entities/system/Motion.js +7 -2
  13. package/dist/entities/system/component-forwards.d.ts +46 -0
  14. package/dist/entities/system/component-forwards.js +131 -0
  15. package/dist/entities/system/token-values.d.ts +9 -1
  16. package/dist/entities/system/token-values.js +4 -3
  17. package/dist/framework/Config.d.ts +1 -1
  18. package/dist/framework/Config.js +1 -1
  19. package/dist/framework/defineSubEntity.d.ts +10 -1
  20. package/dist/framework/defineSubEntity.js +19 -1
  21. package/dist/framework/rejection.js +16 -4
  22. package/dist/framework/schema-version.d.ts +1 -1
  23. package/dist/framework/schema-version.js +5 -5
  24. package/dist/framework/schemas.js +14 -3
  25. package/dist/index.d.ts +7 -6
  26. package/dist/index.js +5 -5
  27. package/dist/migrations/20261001112308_style_rules_as_list.d.ts +12 -0
  28. package/dist/migrations/20261001112308_style_rules_as_list.js +8 -0
  29. package/dist/migrations/20261001130958_motion_exit_and_element_duplicate.d.ts +9 -0
  30. package/dist/migrations/20261001130958_motion_exit_and_element_duplicate.js +10 -0
  31. package/dist/migrations/20261001131000_layer_style_and_forward_ops.d.ts +11 -0
  32. package/dist/migrations/20261001131000_layer_style_and_forward_ops.js +10 -0
  33. package/dist/spec/slot.d.ts +19 -1
  34. package/dist/spec/slot.js +49 -11
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/package.json +2 -2
@@ -3,7 +3,7 @@ import { pathOf } from "../framework/utils/refs.js";
3
3
  import { pathInput } from "../framework/schemas.js";
4
4
  import { CapturedNode } from "./captured-tree.js";
5
5
  import { specFromCapture } from "./capture-to-spec.js";
6
- import { specToNodePatches } from "./node-patches.js";
6
+ import { attachedSystem, specToNodePatches } from "../entities/canvas/node-patches.js";
7
7
  import { z } from "zod";
8
8
  //#region src/capture/node-ops.ts
9
9
  /**
@@ -40,16 +40,6 @@ const fromHtmlInput = z.object({
40
40
  path: pathInput("node"),
41
41
  data: fromHtmlData
42
42
  });
43
- /** The system this canvas draws on, with the slug node types are qualified by. */
44
- function attachedSystem(config) {
45
- const [source] = config.list("system-source");
46
- const system = source ? config.sourceFor(source.path) : void 0;
47
- if (!source || !system) return rejectData("This canvas has no system attached, so there is no component grammar to read a capture with.");
48
- return {
49
- slug: source.path,
50
- system
51
- };
52
- }
53
43
  function pageOf(body) {
54
44
  return body.page ? pathOf(body.page) : void 0;
55
45
  }
@@ -4,6 +4,7 @@ import { Package } from "../entities/system/Package.js";
4
4
  import { Component } from "../entities/system/Component.js";
5
5
  import { Icon } from "../entities/system/Icon.js";
6
6
  import { captureNodeOps } from "../capture/node-ops.js";
7
+ import { nodeGestureOps } from "../entities/canvas/node-gestures.js";
7
8
  import { Device } from "../entities/system/Device.js";
8
9
  import { Operation } from "../entities/system/Operation.js";
9
10
  import { Tool } from "../entities/system/Tool.js";
@@ -147,7 +148,10 @@ const Size = z.discriminatedUnion("type", [z.object({
147
148
  })]);
148
149
  const Node = defineEntity({
149
150
  kind: "node",
150
- schemas: captureNodeOps,
151
+ schemas: {
152
+ ...captureNodeOps,
153
+ ...nodeGestureOps
154
+ },
151
155
  fields: z.object({
152
156
  /** A real ref, never a bare name — dependents()/rename-cascade need a real edge, and a bare
153
157
  * `kind:path` string the framework never walks gives neither. Absent only on a placeholder
@@ -50,6 +50,9 @@ import { forwardRoutesMigration } from "../migrations/20260929161433_forward_rou
50
50
  import { registryDirBesideComponentsMigration } from "../migrations/20260930152239_registry_dir_beside_components.js";
51
51
  import { buildImportAliasesMigration } from "../migrations/20260930153059_build_import_aliases.js";
52
52
  import { canvasToolIconsAndDescriptionsMigration } from "../migrations/20260930183521_canvas_tool_icons_and_descriptions.js";
53
+ import { styleRulesAsListMigration } from "../migrations/20261001112308_style_rules_as_list.js";
54
+ import { motionExitAndElementDuplicateMigration } from "../migrations/20261001130958_motion_exit_and_element_duplicate.js";
55
+ import { layerStyleAndForwardOpsMigration } from "../migrations/20261001131000_layer_style_and_forward_ops.js";
53
56
  const System = defineConfig({
54
57
  name: WEB_CONFIG_NAME,
55
58
  description: "A design system: the values, primitives and compositions an app is built from. A ref is written `{ \"__ref\": \"<kind>:<path>\" }`, so a token is `{ \"__ref\": \"token:<group>/<name>\" }` and a token group is `{ \"__ref\": \"token:<group>\" }`. Build it in this order. Tokens first, in groups by purpose (colors, spacing, radii, type sizes), since everything else names them. Then style properties, each with `values` holding one ref to the token group whose members it accepts (`{ \"__ref\": \"token:color\" }`), so a prop takes token names rather than raw CSS; add a string keyword only for a value no token holds. A style rule's bag holds a prop's values (`\"padding\": \"4\"`, `\"bg\": \"brand\"`), never raw CSS. Then a few primitive components, one layer each, whose props are style properties (a box for layout and surface, a text for type, a pressable for interaction). Then every other component composed from those primitives: its layers name a primitive or an element, its anatomy places them (a node renders a layer, a tag or `Slot` where a slot prop's content lands; `children` is the edge list; `visible` is `{ \"$state\": \"<prop>\" }`; a prop shown in a nested layer is a `forward` route, and `$state` never sits in a node's props), and its style rules set style-property values per layer, keyed by prop values when a variant changes them. Modes (a dark mode is `{ type: \"selector\", value: \".dark\" }`) change token values through a token's `overrides`, so a component never restyles for a mode; modifiers (hover, focus, disabled) name a state, and a style rule applies under one as a `_hover` block inside a layer bag. Composites bundle style values that recur. Last, register canvas roles: the canvas draws with them, one entity per tool (`frame` for the layout primitive, `text` for the text primitive, `image`) whose entries name the components that tool inserts, and a tool whose role is unregistered is disabled. Give each component a `preview` entry under `*` so it shows content, and never write a CSS property name where a style-property name belongs.",
@@ -111,5 +114,8 @@ if (!registeredSchemaMigrations().has(20260929161433)) registerSchemaMigrations(
111
114
  if (!registeredSchemaMigrations().has(20260930152239)) registerSchemaMigrations(registryDirBesideComponentsMigration);
112
115
  if (!registeredSchemaMigrations().has(20260930153059)) registerSchemaMigrations(buildImportAliasesMigration);
113
116
  if (!registeredSchemaMigrations().has(20260930183521)) registerSchemaMigrations(canvasToolIconsAndDescriptionsMigration);
117
+ if (!registeredSchemaMigrations().has(20261001112308)) registerSchemaMigrations(styleRulesAsListMigration);
118
+ if (!registeredSchemaMigrations().has(20261001130958)) registerSchemaMigrations(motionExitAndElementDuplicateMigration);
119
+ if (!registeredSchemaMigrations().has(20261001131e3)) registerSchemaMigrations(layerStyleAndForwardOpsMigration);
114
120
  //#endregion
115
121
  export { System };
@@ -0,0 +1,2 @@
1
+ import { type UserSchemas } from '../../framework/schemas';
2
+ export declare const nodeGestureOps: UserSchemas;