@yahoo/uds-create-config 4.36.0 → 4.36.1

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 (68) hide show
  1. package/dist/configs/CanvasConfig.d.ts +68 -5167
  2. package/dist/configs/CanvasConfig.js +0 -76
  3. package/dist/configs/documentation.d.ts +11 -251
  4. package/dist/configs/documentation.js +0 -1
  5. package/dist/configs/react-native-system.d.ts +39 -4239
  6. package/dist/configs/react-native-system.js +0 -11
  7. package/dist/configs/system.d.ts +44 -4209
  8. package/dist/configs/system.js +0 -9
  9. package/dist/entities/documentation/Documentation.d.ts +5 -18
  10. package/dist/entities/documentation/Documentation.js +0 -1
  11. package/dist/entities/native/NativeModifier.d.ts +6 -3
  12. package/dist/entities/native/NativeSettings.d.ts +6 -3
  13. package/dist/entities/native/NativeSettings.js +0 -1
  14. package/dist/entities/native/NativeStyleProperty.d.ts +1 -20
  15. package/dist/entities/native/NativeToken.d.ts +2 -6
  16. package/dist/entities/system/CanvasRole.d.ts +6 -7
  17. package/dist/entities/system/Component.d.ts +86 -1588
  18. package/dist/entities/system/Component.js +0 -9
  19. package/dist/entities/system/Composite.d.ts +8 -6
  20. package/dist/entities/system/Composite.js +0 -1
  21. package/dist/entities/system/Device.d.ts +6 -3
  22. package/dist/entities/system/Device.js +0 -6
  23. package/dist/entities/system/File.d.ts +43 -8
  24. package/dist/entities/system/File.js +0 -51
  25. package/dist/entities/system/Font.d.ts +10 -11
  26. package/dist/entities/system/Font.js +0 -21
  27. package/dist/entities/system/GlobalStyle.d.ts +6 -3
  28. package/dist/entities/system/Guidance.d.ts +6 -3
  29. package/dist/entities/system/GuidanceStyle.d.ts +6 -3
  30. package/dist/entities/system/Icon.d.ts +8 -8
  31. package/dist/entities/system/Icon.js +0 -16
  32. package/dist/entities/system/LinkedSystem.d.ts +5 -155
  33. package/dist/entities/system/Modifier.d.ts +8 -8
  34. package/dist/entities/system/Motion.d.ts +6 -3
  35. package/dist/entities/system/Operation.d.ts +5 -2
  36. package/dist/entities/system/Package.d.ts +24 -4
  37. package/dist/entities/system/Package.js +0 -46
  38. package/dist/entities/system/Settings.d.ts +18 -7
  39. package/dist/entities/system/Settings.js +0 -6
  40. package/dist/entities/system/StyleProperty.d.ts +14 -27
  41. package/dist/entities/system/StyleProperty.js +0 -6
  42. package/dist/entities/system/Token.d.ts +12 -9
  43. package/dist/entities/system/Tool.d.ts +7 -90
  44. package/dist/entities/system/composed-values.d.ts +1 -1
  45. package/dist/entities/system/copy-plan.d.ts +2 -2
  46. package/dist/entities/system/copy-plan.js +31 -8
  47. package/dist/entities/system/defineComponent.d.ts +1 -1
  48. package/dist/entities/system/icon-metadata.d.ts +2 -6
  49. package/dist/entities/system/link-plan.d.ts +2 -0
  50. package/dist/entities/system/link-plan.js +1 -0
  51. package/dist/entities/system/style-bag.d.ts +27 -1
  52. package/dist/entities/system/style-bag.js +0 -10
  53. package/dist/framework/Config.d.ts +18 -2
  54. package/dist/framework/Config.js +70 -15
  55. package/dist/framework/class-names.js +1 -0
  56. package/dist/framework/defineConfig.d.ts +2 -2
  57. package/dist/framework/defineEntity.d.ts +27 -7
  58. package/dist/framework/named.d.ts +9 -0
  59. package/dist/framework/plan.d.ts +3 -0
  60. package/dist/framework/plan.js +4 -1
  61. package/dist/framework/utils/group.d.ts +15 -5
  62. package/dist/index.d.ts +46 -45
  63. package/dist/migrations/2.0.0/v1-artifact.d.ts +38 -2109
  64. package/dist/renderer/wrappers/html-aliases.js +1 -0
  65. package/dist/spec/cell.d.ts +1 -1
  66. package/dist/spec/preview-content.d.ts +1 -1
  67. package/dist/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +1 -1
@@ -1,10 +1,9 @@
1
- import { CopyPlan } from "./copy-plan.js";
2
1
  import { SourceResolver, SourceState } from "../../framework/sources.js";
3
2
  import { ComputedInput } from "../../framework/registry.js";
4
3
  import { RegisteredEntities } from "../../framework/registered.js";
5
4
  import { EntityClass, ItemOf } from "../../framework/defineEntity.js";
6
5
  import { PartialBodyOf } from "../../framework/defineConfig.js";
7
- import { BreakPlan, LinkPlan, SourceRowState, UnlinkPlan } from "./link-plan.js";
6
+ import { Named } from "../../framework/named.js";
8
7
  import { Config } from "../../framework/Config.js";
9
8
  import { z } from "zod";
10
9
 
@@ -86,38 +85,6 @@ declare const sourceUnavailable: z.ZodDiscriminatedUnion<[z.ZodObject<{
86
85
  code: z.ZodLiteral<"unreachable">;
87
86
  }, z.core.$strip>], "code">;
88
87
  type SourceUnavailable = z.infer<typeof sourceUnavailable>;
89
- /** A `link` or `unlink` example: one entity the source offers, under the accessor this config files it by. */
90
- declare function linkExample({
91
- config,
92
- path
93
- }: {
94
- config: Config;
95
- path: string;
96
- }): Record<string, unknown> | undefined;
97
- /** An example for an op that takes the pin alone, shown once the pin has a source to read. */
98
- declare function pinExample({
99
- config,
100
- path
101
- }: {
102
- config: Config;
103
- path: string;
104
- }): Record<string, unknown> | undefined;
105
- /** A break's example, shown once the pin has a source to read. */
106
- declare function breakExample({
107
- config,
108
- path
109
- }: {
110
- config: Config;
111
- path: string;
112
- }): Record<string, unknown> | undefined;
113
- /** A copy's example: one entity the source offers, under the accessor this config files it by. */
114
- declare function copyExample({
115
- config,
116
- path
117
- }: {
118
- config: Config;
119
- path: string;
120
- }): Record<string, unknown> | undefined;
121
88
  /**
122
89
  * The bridging cast, and the annotation that survives declaration emit.
123
90
  *
@@ -127,7 +94,7 @@ declare function copyExample({
127
94
  * would then change nothing.
128
95
  */
129
96
  type PinOptionsField = z.ZodOptional<z.ZodType<PinOptions, PinOptions>>;
130
- declare const LinkedSystem: EntityClass<z.ZodObject<{
97
+ declare const LinkedSystemDefinition: EntityClass<z.ZodObject<{
131
98
  configPath: z.ZodOptional<z.ZodString>;
132
99
  link: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>]>>;
133
100
  options: PinOptionsField;
@@ -136,87 +103,35 @@ declare const LinkedSystem: EntityClass<z.ZodObject<{
136
103
  name: z.ZodOptional<z.ZodString>;
137
104
  version: z.ZodOptional<z.ZodString>;
138
105
  }, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "linked-system", {
139
- /**
140
- * Draw entities from a linked system: the pin's `link` declaration grows to cover them and the
141
- * build mints a pointer row per entity, in this one op. A row of this config's own at a covered
142
- * path is deleted so theirs shows through; a row held through another pin becomes an extension
143
- * through this one. `link-plan` says what that replaces before anything is written.
144
- */
145
106
  readonly link: {
146
107
  readonly input: z.ZodObject<{
147
108
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
148
109
  data: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>]>;
149
110
  }, z.core.$strip>;
150
- readonly readOnly: false;
151
- readonly label: "Link from";
152
- readonly description: "Draw entities from a linked system, following the source: `data` names them by accessor — `{ tokens: ['color/brand', 'color'] }` takes an entity and a folder's members, `{ tokens: '*' }` every token, and `'*'` the whole system. What this config already holds at those paths is replaced by theirs, so run `linked-system/link-plan` with the same input first to see what that is. To hold their values as your own instead, `copy`.";
153
- readonly scope: "item";
154
- readonly approval: "reference-change";
155
- readonly title: (entity: string) => string;
156
- readonly example: typeof linkExample;
157
- readonly handler: (input: Record<string, unknown>, config: Config) => Config;
158
111
  };
159
112
  readonly 'link-plan': {
160
113
  readonly input: z.ZodObject<{
161
114
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
162
115
  data: z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>]>;
163
116
  }, z.core.$strip>;
164
- readonly readOnly: true;
165
- readonly label: "Plan a link";
166
- readonly description: "What `link` with the same input replaces — rows of yours deleted so the source shows through, rows held through another pin turned into extensions, and members left alone because they are already here from the same origin. Writes nothing.";
167
- readonly scope: "item";
168
- readonly title: (entity: string) => string;
169
- readonly example: typeof linkExample;
170
- readonly handler: (input: Record<string, unknown>, config: Config) => Omit<LinkPlan, "patches">;
171
117
  };
172
- /**
173
- * Stop drawing from a linked system, whole or in part. The declaration narrows and the rows it
174
- * minted retire in the same op; the pin stays, so it can be linked again.
175
- */
176
118
  readonly unlink: {
177
119
  readonly input: z.ZodObject<{
178
120
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
179
121
  data: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>]>>;
180
122
  }, z.core.$strip>;
181
- readonly readOnly: false;
182
- readonly label: "Unlink from";
183
- readonly description: "Stop following a linked system's entities, in `link`'s shape or everything when `data` is omitted. The rows the declaration minted go with it, and so do the linked rows that point at them, since left linked they would bring them back; nothing of yours moves. A row of yours pointing at one of theirs refuses this — `copy` what is used first, or `break` with `keep: true`. `unlink-plan` names everything that goes.";
184
- readonly scope: "item";
185
- readonly approval: "reference-change";
186
- readonly title: (entity: string) => string;
187
- readonly example: typeof pinExample;
188
- readonly handler: (input: Record<string, unknown>, config: Config) => Config;
189
123
  };
190
124
  readonly 'unlink-plan': {
191
125
  readonly input: z.ZodObject<{
192
126
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
193
127
  data: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>]>>;
194
128
  }, z.core.$strip>;
195
- readonly readOnly: true;
196
- readonly label: "Plan an unlink";
197
- readonly description: "What `unlink` with the same input removes — the minted rows the narrower declaration no longer reaches, with the linked rows taken along because they point at them named in `cascade` — and why the config would refuse it. Writes nothing.";
198
- readonly scope: "item";
199
- readonly title: (entity: string) => string;
200
- readonly example: typeof pinExample;
201
- readonly handler: (input: Record<string, unknown>, config: Config) => Omit<UnlinkPlan, "patches">;
202
129
  };
203
- /**
204
- * Break the link: the pin goes, and everything drawn through it either becomes this config's own
205
- * or goes with it.
206
- */
207
130
  readonly break: {
208
131
  readonly input: z.ZodObject<{
209
132
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
210
133
  keep: z.ZodBoolean;
211
134
  }, z.core.$strip>;
212
- readonly readOnly: false;
213
- readonly label: "Break link";
214
- readonly description: "Remove a linked system. With `keep: true` every value drawn through it is copied in as your own first, and a row of yours that pointed through the pin points at the copies; with `keep: false` the rows it minted go, and a row of yours still pointing through it refuses the break. Run `linked-system/break-plan` first to see every row it reaches.";
215
- readonly scope: "item";
216
- readonly approval: "destructive";
217
- readonly title: (entity: string) => string;
218
- readonly example: typeof breakExample;
219
- readonly handler: (input: Record<string, unknown>, config: Config) => Config;
220
135
  };
221
136
  readonly 'break-plan': {
222
137
  readonly input: z.ZodObject<{
@@ -224,57 +139,12 @@ declare const LinkedSystem: EntityClass<z.ZodObject<{
224
139
  keep: z.ZodOptional<z.ZodBoolean>;
225
140
  data: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodLiteral<"*">, z.ZodArray<z.ZodString>]>>]>>;
226
141
  }, z.core.$strip>;
227
- readonly readOnly: true;
228
- readonly label: "Plan a break";
229
- readonly description: "Every row a break reaches, and why the config would refuse it. `keep` plans `break` with the same input; `data` in `copy`'s shape plans detaching those entities alone — the rows the copy lands, the rows of yours it points at the copies, and the rows still linked that reference what moves. Writes nothing.";
230
- readonly scope: "item";
231
- readonly title: (entity: string) => string;
232
- readonly example: typeof breakExample;
233
- readonly handler: (input: Record<string, unknown>, config: Config) => Omit<BreakPlan, "patches">;
234
142
  };
235
- /**
236
- * The source's catalogue read against this config: one row per top-level folder or item the
237
- * source offers, saying whether it is linked here and what linking it would replace.
238
- */
239
143
  readonly rows: {
240
144
  readonly input: z.ZodObject<{
241
145
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
242
146
  }, z.core.$strip>;
243
- readonly readOnly: true;
244
- readonly label: "Source rows";
245
- readonly description: "Every top-level folder and item the linked system offers, read against this config: whether every member is linked through this pin, how many rows of yours a `link` would replace, and how many members are already here from the source's own origin. Needs the source attached; empty otherwise.";
246
- readonly scope: "item";
247
- readonly title: (entity: string) => string;
248
- readonly example: typeof pinExample;
249
- readonly handler: (input: Record<string, unknown>, config: Config) => SourceRowState[];
250
147
  };
251
- /**
252
- * Take entities from a linked system as this config's own — the source's bodies, written once.
253
- * A pin puts a system within reach and its `link` mints pointers; `copy` stores the value. A copied
254
- * row is an ordinary authored row from the moment it lands: the source's later versions never reach
255
- * it, and it renames and deletes like anything else here.
256
- *
257
- * A copy stands on its own. What a copied row points at comes with it — a component brings the
258
- * style properties and tokens it names, a style property brings the token folder its values
259
- * range over, a code component brings the files its module reaches — and every one of those refs
260
- * lands bare, on the local copy. A path this config already holds as its own is reused rather
261
- * than copied, and refs bind to it. Only a ref to a kind this config can't hold stays qualified,
262
- * and the pin survives to answer it. Someone who wants theirs by reference writes `Button@slug`
263
- * instead.
264
- *
265
- * A pointer at the path, minted through this pin, becomes the literal it stood for with its
266
- * `extend` laid over the source's body. A folder's meta comes with its members, so a label the
267
- * folder was inheriting becomes its own.
268
- *
269
- * `data` is keyed the way the pin's `link` is: by accessor, then `'*'` for every entry of the kind
270
- * or the source's paths — an item, or a folder, which takes its members. `'*'` alone takes every
271
- * kind the source offers and this config can hold. Kinds taken in one edit are copied together,
272
- * which is what lets a copied component point at the copied tokens rather than back through the
273
- * pin.
274
- *
275
- * Every row lands in one derive (`Config.applyAll`), and each is its own `create` or `replace`
276
- * patch carrying the literal body, so a draft replays a copy onto a base with nothing attached.
277
- */
278
148
  readonly copy: {
279
149
  readonly input: z.ZodObject<{
280
150
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
@@ -284,22 +154,7 @@ declare const LinkedSystem: EntityClass<z.ZodObject<{
284
154
  skip: "skip";
285
155
  }>>;
286
156
  }, z.core.$strip>;
287
- readonly readOnly: false;
288
- readonly label: "Copy from";
289
- readonly description: "Take entities from a linked system as your own, holding the values the source has now and no longer following it. `data` names them by accessor: `{ tokens: ['color/brand', 'color'] }` takes an entity and a folder's members, `{ tokens: '*' }` every token, and `'*'` the whole system. What a copied entity points at comes with it, so run `linked-system/copy-plan` with the same input first and see everything that lands. To use theirs without owning it, declare it in the pin's `link` instead. A whole-system copy is thousands of rows, and on a repo-backed system each one is written into `uds.config.ts`.";
290
- readonly scope: "item";
291
- readonly approval: "reference-change";
292
- readonly title: (entity: string) => string;
293
- readonly example: typeof copyExample;
294
- readonly handler: (input: Record<string, unknown>, config: Config) => Config;
295
157
  };
296
- /**
297
- * What that same `copy` call would do, without doing it — the rows that land, what comes along
298
- * because something named points at it, and the rows of yours a copied ref binds to instead.
299
- *
300
- * A read, taking `copy`'s own input verbatim, so a surface plans the invocation it is about to
301
- * send. The op is this plan applied, so the two cannot disagree.
302
- */
303
158
  readonly 'copy-plan': {
304
159
  readonly input: z.ZodObject<{
305
160
  path: z.ZodType<string, string | undefined, z.core.$ZodTypeInternals<string, string | undefined>>;
@@ -309,13 +164,6 @@ declare const LinkedSystem: EntityClass<z.ZodObject<{
309
164
  skip: "skip";
310
165
  }>>;
311
166
  }, z.core.$strip>;
312
- readonly readOnly: true;
313
- readonly label: "Plan a copy";
314
- readonly description: "See what copying would bring before you do it — what lands as yours, what comes along because it is pointed at, and what you already hold that the copies will point at. Takes exactly the same input as `copy` and writes nothing. Run it before `copy`, and always before a `'*'` copy.";
315
- readonly scope: "item";
316
- readonly title: (entity: string) => string;
317
- readonly example: typeof copyExample;
318
- readonly handler: (input: Record<string, unknown>, config: Config) => Omit<CopyPlan, "patches">;
319
167
  };
320
168
  }, {
321
169
  /**
@@ -330,6 +178,8 @@ declare const LinkedSystem: EntityClass<z.ZodObject<{
330
178
  path
331
179
  }: ComputedInput) => string;
332
180
  }, false, Record<never, never>, Record<never, never>>;
181
+ interface LinkedSystemClass extends Named<typeof LinkedSystemDefinition> {}
182
+ declare const LinkedSystem: LinkedSystemClass;
333
183
  /**
334
184
  * What a pin's `options` may say, checked against the config type it is declared in — one record per
335
185
  * accessor, keyed by the path the source spells, valued by what this config does to it.
@@ -501,4 +351,4 @@ declare function suggestLinkSlug({
501
351
  taken: ReadonlySet<string>;
502
352
  }): string;
503
353
  //#endregion
504
- export { LINK_SLUG, LINK_SLUG_MESSAGE, LinkDeclaration, LinkedSystem, LinkedSystemResolver, LinkedSystemState, PinDirective, PinOptions, PinOptionsField, ResolvedSource, Source, SourceUnavailable, borrowedGroup, borrowedItem, isLinkSlug, resolvedSource, sourceOfGroup, sourceOfItem, sourceSlugFor, sourceUnavailable, suggestLinkSlug };
354
+ export { LINK_SLUG, LINK_SLUG_MESSAGE, LinkDeclaration, LinkedSystem, LinkedSystemClass, LinkedSystemResolver, LinkedSystemState, PinDirective, PinOptions, PinOptionsField, ResolvedSource, Source, SourceUnavailable, borrowedGroup, borrowedItem, isLinkSlug, resolvedSource, sourceOfGroup, sourceOfItem, sourceSlugFor, sourceUnavailable, suggestLinkSlug };
@@ -1,7 +1,7 @@
1
- import { SubEntityClass } from "../../framework/defineSubEntity.js";
2
1
  import { EntityClass } from "../../framework/defineEntity.js";
2
+ import { Named } from "../../framework/named.js";
3
3
  import { Config } from "../../framework/Config.js";
4
- import { StyleValue } from "./style-bag.js";
4
+ import { CompositeClass } from "./Composite.js";
5
5
  import { z } from "zod";
6
6
 
7
7
  //#region src/entities/system/Modifier.d.ts
@@ -38,15 +38,13 @@ type ModifierGroupMeta = z.infer<typeof modifierGroupFields> & {
38
38
  label?: string;
39
39
  description?: string;
40
40
  };
41
- declare const Modifier: EntityClass<z.ZodObject<{
41
+ declare const ModifierDefinition: EntityClass<z.ZodObject<{
42
42
  type: z.ZodEnum<{
43
43
  composite: "composite";
44
44
  selector: "selector";
45
45
  "media-query": "media-query";
46
46
  }>;
47
- value: z.ZodUnion<readonly [z.ZodString, z.ZodLazy<EntityClass<z.ZodObject<{
48
- styles: SubEntityClass<z.ZodType<StyleValue, unknown, z.core.$ZodTypeInternals<StyleValue, unknown>>>;
49
- }, z.core.$strip>, z.ZodObject<Record<never, never>, z.core.$strip>, "composite", Record<never, never>, Record<never, never>, false, Record<never, never>, Record<never, never>>>]>;
47
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodLazy<CompositeClass>]>;
50
48
  }, z.core.$strip>, z.ZodObject<{
51
49
  type: z.ZodOptional<z.ZodEnum<{
52
50
  mode: "mode";
@@ -55,7 +53,9 @@ declare const Modifier: EntityClass<z.ZodObject<{
55
53
  default: z.ZodOptional<z.ZodObject<{
56
54
  __ref: z.ZodString;
57
55
  }, z.core.$strip>>;
58
- }, z.core.$strip>, "modifier", Record<never, never>, Record<never, never>, false, Record<never, never>, Record<never, never>>;
56
+ }, z.core.$strip>, "modifier", {}, Record<never, never>, false, Record<never, never>, Record<never, never>>;
57
+ interface ModifierClass extends Named<typeof ModifierDefinition> {}
58
+ declare const Modifier: ModifierClass;
59
59
  /** A path's last segment. */
60
60
  declare function modifierLeaf(path: string): string;
61
61
  /**
@@ -89,4 +89,4 @@ declare function modeAxes(config: Config): {
89
89
  */
90
90
  declare function modifierInvariants(config: Config): string[];
91
91
  //#endregion
92
- export { MODIFIER_CATEGORIES, Modifier, ModifierCategory, ModifierGroupMeta, WEB_ACTIVATIONS, WebActivation, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf };
92
+ export { MODIFIER_CATEGORIES, Modifier, ModifierCategory, ModifierClass, ModifierGroupMeta, WEB_ACTIVATIONS, WebActivation, modeAxes, modifierAxes, modifierAxis, modifierCategory, modifierGroupFields, modifierInvariants, modifierLeaf };
@@ -1,8 +1,9 @@
1
1
  import { EntityClass } from "../../framework/defineEntity.js";
2
+ import { Named } from "../../framework/named.js";
2
3
  import { z } from "zod";
3
4
 
4
5
  //#region src/entities/system/Motion.d.ts
5
- declare const Motion: EntityClass<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
+ declare const MotionDefinition: EntityClass<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
7
  runtime: z.ZodLiteral<"css">;
7
8
  keyframes: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>;
8
9
  duration: z.ZodOptional<z.ZodString>;
@@ -23,6 +24,8 @@ declare const Motion: EntityClass<z.ZodDiscriminatedUnion<[z.ZodObject<{
23
24
  drag: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
24
25
  dragConstraints: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
25
26
  dragElastic: z.ZodOptional<z.ZodNumber>;
26
- }, z.core.$strict>], "runtime">, z.ZodObject<Record<never, never>, z.core.$strip>, "motion", Record<never, never>, Record<never, never>, false, Record<never, never>, Record<never, never>>;
27
+ }, z.core.$strict>], "runtime">, z.ZodObject<Record<never, never>, z.core.$strip>, "motion", {}, Record<never, never>, false, Record<never, never>, Record<never, never>>;
28
+ interface MotionClass extends Named<typeof MotionDefinition> {}
29
+ declare const Motion: MotionClass;
27
30
  //#endregion
28
- export { Motion };
31
+ export { Motion, MotionClass };
@@ -1,10 +1,11 @@
1
1
  import { ComputedInput } from "../../framework/registry.js";
2
2
  import { DerivedEntityClass } from "../../framework/defineDerivedEntity.js";
3
+ import { Named } from "../../framework/named.js";
3
4
  import { Config } from "../../framework/Config.js";
4
5
  import { z } from "zod";
5
6
 
6
7
  //#region src/entities/system/Operation.d.ts
7
- declare const Operation: DerivedEntityClass<z.ZodObject<{
8
+ declare const OperationDefinition: DerivedEntityClass<z.ZodObject<{
8
9
  kind: z.ZodString;
9
10
  verb: z.ZodString;
10
11
  readOnly: z.ZodBoolean;
@@ -96,5 +97,7 @@ declare const Operation: DerivedEntityClass<z.ZodObject<{
96
97
  };
97
98
  }) => Record<string, unknown> | undefined;
98
99
  }>;
100
+ interface OperationClass extends Named<typeof OperationDefinition> {}
101
+ declare const Operation: OperationClass;
99
102
  //#endregion
100
- export { Operation };
103
+ export { Operation, OperationClass };
@@ -1,8 +1,26 @@
1
1
  import { SubEntityClass } from "../../framework/defineSubEntity.js";
2
2
  import { EntityClass } from "../../framework/defineEntity.js";
3
+ import { Named } from "../../framework/named.js";
3
4
  import { z } from "zod";
4
5
 
5
6
  //#region src/entities/system/Package.d.ts
7
+ /**
8
+ * One export a system renders through — `package:react-native#Pressable`.
9
+ *
10
+ * A member rather than an entity of its own, because a `/` cannot separate the module from the export
11
+ * and nothing else can either. `react-native/Pressable` reads as a module and an export only by the
12
+ * CONVENTION that the last segment is the export, and that convention has cases it gets wrong:
13
+ * `motion/react` is a module (`import { motion } from 'motion/react'`) but parses as `motion` plus an
14
+ * export called `react`, and `@phosphor-icons/core` — a catalogue named by an icon library's
15
+ * `metadata` and imported by nobody — parsed as a `core` export of `@phosphor-icons`. The grammar
16
+ * already has the separator that says which is which, so it is used.
17
+ *
18
+ * A member's fields are empty because its identity IS its name: there is nothing else this system
19
+ * knows to be true about somebody else's export. `default` for a default import, `Animated.View` for
20
+ * a dotted one — the name as the TARGET spells it, which is what an emitted import has to write.
21
+ */
22
+ declare const PackageExportDefinition: SubEntityClass<z.ZodObject<{}, z.core.$strict>>;
23
+ interface PackageExportClass extends Named<typeof PackageExportDefinition> {}
6
24
  /**
7
25
  * Package (`react-native`, `@ariakit/react`, `motion/react`) — one MODULE a system renders through.
8
26
  *
@@ -34,9 +52,11 @@ import { z } from "zod";
34
52
  * and build collection updates rather than replaces it, so that metadata survives. What authoring
35
53
  * cannot do is choose the path.
36
54
  */
37
- declare const Package: EntityClass<z.ZodObject<{
55
+ declare const PackageDefinition: EntityClass<z.ZodObject<{
38
56
  version: z.ZodOptional<z.ZodString>;
39
- exports: z.ZodOptional<SubEntityClass<z.ZodObject<{}, z.core.$strict>>>;
40
- }, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "package", Record<never, never>, Record<never, never>, false, Record<never, never>, Record<never, never>>;
57
+ exports: z.ZodOptional<PackageExportClass>;
58
+ }, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "package", {}, Record<never, never>, false, Record<never, never>, Record<never, never>>;
59
+ interface PackageClass extends Named<typeof PackageDefinition> {}
60
+ declare const Package: PackageClass;
41
61
  //#endregion
42
- export { Package };
62
+ export { Package, PackageClass };
@@ -2,58 +2,12 @@ import { defineEntity } from "../../framework/defineEntity.js";
2
2
  import { defineSubEntity } from "../../framework/defineSubEntity.js";
3
3
  import { z } from "zod";
4
4
  //#region src/entities/system/Package.ts
5
- /**
6
- * One export a system renders through — `package:react-native#Pressable`.
7
- *
8
- * A member rather than an entity of its own, because a `/` cannot separate the module from the export
9
- * and nothing else can either. `react-native/Pressable` reads as a module and an export only by the
10
- * CONVENTION that the last segment is the export, and that convention has cases it gets wrong:
11
- * `motion/react` is a module (`import { motion } from 'motion/react'`) but parses as `motion` plus an
12
- * export called `react`, and `@phosphor-icons/core` — a catalogue named by an icon library's
13
- * `metadata` and imported by nobody — parsed as a `core` export of `@phosphor-icons`. The grammar
14
- * already has the separator that says which is which, so it is used.
15
- *
16
- * A member's fields are empty because its identity IS its name: there is nothing else this system
17
- * knows to be true about somebody else's export. `default` for a default import, `Animated.View` for
18
- * a dotted one — the name as the TARGET spells it, which is what an emitted import has to write.
19
- */
20
5
  const PackageExport = defineSubEntity({
21
6
  name: "exports",
22
7
  label: "Export",
23
8
  labelPlural: "Exports",
24
9
  fields: z.strictObject({})
25
10
  });
26
- /**
27
- * Package (`react-native`, `@ariakit/react`, `motion/react`) — one MODULE a system renders through.
28
- *
29
- * **The path IS the specifier**, verbatim, subpath and all — the same choice `File` makes for its src.
30
- * So there is no `module` field: a second copy of the path could disagree with it, which is the
31
- * reason a `File` computes its `binary` rather than storing one.
32
- *
33
- * Verbatim matters because the stored form has to regenerate the import an author wrote. `motion` and
34
- * `motion/react` are ONE npm package and TWO modules; emitting `from 'motion'` for a source that
35
- * wrote `from 'motion/react'` names a different entry point that resolves to a different file. That
36
- * the two are one thing to INSTALL is a separate question, and the seal is the only place it is asked
37
- * — `packageName` collapses them there.
38
- *
39
- * A key derived from the module — a slug like `ariakit` — is what this replaced. The slug was
40
- * resolved over the whole import SET so two specifiers sharing a scope could both qualify away from
41
- * it, which made a key depend on what else happened to be imported: `@phosphor-icons/core` arriving
42
- * beside `@phosphor-icons/react` renamed the latter and stranded every ref that named it. npm has
43
- * already made a module name unique; nothing here has to.
44
- *
45
- * The same shape `Icon` uses for a glyph library, with one difference in where membership comes from.
46
- * An icon group lists every glyph the package exports, because a person picks one from a picker and
47
- * all of them are candidates. A package's exports are only what a render actually placed in JSX,
48
- * because nobody browses a component library's exports; the build registers them from JSX usage. The
49
- * MODULE set is broader: it records every external module the render closure needs, which is what
50
- * makes the portable config the source of truth for consumer install requirements.
51
- *
52
- * Ordinary component authoring does not maintain this graph: the build derives modules and exports
53
- * from the source it walked. A human may still author one — to carry a label, or to pin a `version` —
54
- * and build collection updates rather than replaces it, so that metadata survives. What authoring
55
- * cannot do is choose the path.
56
- */
57
11
  const Package = defineEntity({
58
12
  kind: "package",
59
13
  label: "Package",
@@ -1,21 +1,26 @@
1
1
  import { SubEntityClass } from "../../framework/defineSubEntity.js";
2
2
  import { ComputedInput } from "../../framework/registry.js";
3
3
  import { EntityClass } from "../../framework/defineEntity.js";
4
+ import { Named } from "../../framework/named.js";
4
5
  import { Config } from "../../framework/Config.js";
5
6
  import { z } from "zod";
6
7
 
7
8
  //#region src/entities/system/Settings.d.ts
8
9
  /** The `system` section — what this config is in Create. */
9
- declare const SystemSection: SubEntityClass<z.ZodObject<{
10
+ declare const SystemSectionDefinition: SubEntityClass<z.ZodObject<{
10
11
  id: z.ZodOptional<z.ZodString>;
11
12
  }, z.core.$strict>>;
13
+ interface SystemSectionClass extends Named<typeof SystemSectionDefinition> {}
14
+ declare const SystemSection: SystemSectionClass;
12
15
  /** The `build` section — where a repo keeps this system's sources, where `uds build` writes, and
13
16
  * where linked systems are materialised. */
14
- declare const BuildSection: SubEntityClass<z.ZodObject<{
17
+ declare const BuildSectionDefinition: SubEntityClass<z.ZodObject<{
15
18
  inputDir: z.ZodOptional<z.ZodString>;
16
19
  outDir: z.ZodOptional<z.ZodString>;
17
20
  registryDir: z.ZodOptional<z.ZodString>;
18
21
  }, z.core.$strict>>;
22
+ interface BuildSectionClass extends Named<typeof BuildSectionDefinition> {}
23
+ declare const BuildSection: BuildSectionClass;
19
24
  /**
20
25
  * One prefix for both namespaces, or one each. A string names classes and variables alike; the object
21
26
  * names them apart, for a host page that already owns one of the two. Either form may be `''`, which
@@ -34,7 +39,7 @@ declare const CSS_DEFAULTS: {
34
39
  };
35
40
  /** The `css` section — how a web system names what it emits and where its stylesheet applies. A
36
41
  * native system declares no such section, so a native config setting one is refused. */
37
- declare const CssSection: SubEntityClass<z.ZodObject<{
42
+ declare const CssSectionDefinition: SubEntityClass<z.ZodObject<{
38
43
  prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
39
44
  classNames: z.ZodString;
40
45
  variables: z.ZodString;
@@ -44,6 +49,8 @@ declare const CssSection: SubEntityClass<z.ZodObject<{
44
49
  rem: z.ZodOptional<z.ZodString>;
45
50
  safelist: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
51
  }, z.core.$strict>>;
52
+ interface CssSectionClass extends Named<typeof CssSectionDefinition> {}
53
+ declare const CssSection: CssSectionClass;
47
54
  /** The two namespaces a prefix names, whichever form it was written in, defaulted when unset. */
48
55
  declare function cssPrefixes(value: CssPrefix | undefined): {
49
56
  classNames: string;
@@ -66,11 +73,13 @@ declare const PLAYGROUND_DEFAULTS: {
66
73
  readonly port: 4321;
67
74
  };
68
75
  /** The `playground` section — dev-server settings for `uds dev --playground`. */
69
- declare const PlaygroundSection: SubEntityClass<z.ZodObject<{
76
+ declare const PlaygroundSectionDefinition: SubEntityClass<z.ZodObject<{
70
77
  pagesDir: z.ZodOptional<z.ZodString>;
71
78
  port: z.ZodOptional<z.ZodNumber>;
72
79
  }, z.core.$strict>>;
73
- declare const Settings: EntityClass<z.ZodObject<{
80
+ interface PlaygroundSectionClass extends Named<typeof PlaygroundSectionDefinition> {}
81
+ declare const PlaygroundSection: PlaygroundSectionClass;
82
+ declare const SettingsDefinition: EntityClass<z.ZodObject<{
74
83
  system: z.ZodOptional<z.ZodObject<{
75
84
  id: z.ZodOptional<z.ZodString>;
76
85
  }, z.core.$strict>>;
@@ -93,7 +102,7 @@ declare const Settings: EntityClass<z.ZodObject<{
93
102
  pagesDir: z.ZodOptional<z.ZodString>;
94
103
  port: z.ZodOptional<z.ZodNumber>;
95
104
  }, z.core.$strict>>;
96
- }, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "settings", Record<never, never>, {
105
+ }, z.core.$strict>, z.ZodObject<Record<never, never>, z.core.$strip>, "settings", {}, {
97
106
  /**
98
107
  * The directory this system's component files are laid out beneath, always defined:
99
108
  * `build.inputDir` when authored, else derived from where the files live. Every reader of the
@@ -104,5 +113,7 @@ declare const Settings: EntityClass<z.ZodObject<{
104
113
  config
105
114
  }: ComputedInput) => string;
106
115
  }, true, Record<never, never>, Record<never, never>>;
116
+ interface SettingsClass extends Named<typeof SettingsDefinition> {}
117
+ declare const Settings: SettingsClass;
107
118
  //#endregion
108
- export { BuildSection, CSS_DEFAULTS, CssPrefix, CssSection, PLAYGROUND_DEFAULTS, PlaygroundSection, Settings, SystemSection, classPrefixOf, cssPrefixes, varPrefixOf };
119
+ export { BuildSection, BuildSectionClass, CSS_DEFAULTS, CssPrefix, CssSection, CssSectionClass, PLAYGROUND_DEFAULTS, PlaygroundSection, PlaygroundSectionClass, Settings, SettingsClass, SystemSection, SystemSectionClass, classPrefixOf, cssPrefixes, varPrefixOf };
@@ -38,15 +38,12 @@ id: z.string().uuid().meta({
38
38
  title: "System ID",
39
39
  description: "This system's id in Create. The default target for `uds push` and remote agent edits, and what lets a build refuse a link back to itself. `uds connect` records the repo binding on the server; this is the copy the repo carries."
40
40
  }).optional() });
41
- /** The `system` section — what this config is in Create. */
42
41
  const SystemSection = defineSubEntity({
43
42
  name: "system",
44
43
  label: "System",
45
44
  singleton: true,
46
45
  fields: systemFields
47
46
  });
48
- /** The `build` section — where a repo keeps this system's sources, where `uds build` writes, and
49
- * where linked systems are materialised. */
50
47
  const BuildSection = defineSubEntity({
51
48
  name: "build",
52
49
  label: "Build",
@@ -102,8 +99,6 @@ const cssFields = z.strictObject({
102
99
  description: "Classes the stylesheet always keeps, whether or not a scanned file names them, as in `uds-bg-brand`. For a class assembled at runtime, or one used by a file the build does not scan."
103
100
  }).optional()
104
101
  });
105
- /** The `css` section — how a web system names what it emits and where its stylesheet applies. A
106
- * native system declares no such section, so a native config setting one is refused. */
107
102
  const CssSection = defineSubEntity({
108
103
  name: "css",
109
104
  label: "CSS",
@@ -149,7 +144,6 @@ const playgroundFields = z.strictObject({
149
144
  default: PLAYGROUND_DEFAULTS.port
150
145
  }).optional()
151
146
  });
152
- /** The `playground` section — dev-server settings for `uds dev --playground`. */
153
147
  const PlaygroundSection = defineSubEntity({
154
148
  name: "playground",
155
149
  label: "Playground",
@@ -1,6 +1,7 @@
1
1
  import { Ref } from "../../framework/utils/ref-grammar.js";
2
2
  import { Ref as Ref$1 } from "../../framework/utils/refs.js";
3
3
  import { EntityClass } from "../../framework/defineEntity.js";
4
+ import { Named } from "../../framework/named.js";
4
5
  import { Config } from "../../framework/Config.js";
5
6
  import { z } from "zod";
6
7
 
@@ -97,13 +98,9 @@ declare function classifyStylePropValue({
97
98
  config: Config;
98
99
  entry: StylePropValue;
99
100
  }): StylePropValueKind;
100
- /**
101
- * `StyleProperty.ref('bg')` keeps the path literal in its type, so a component prop declared as the
102
- * ref is typed by the property it points at: `bg: StyleProperty.ref('bg')` offers the registered `bg`
103
- * values, and `columns: StyleProperty.ref('gridTemplateColumns')` offers the target's rather than
104
- * the name's.
105
- */
106
- declare const StyleProperty: EntityClass<z.ZodObject<{
101
+ /** StyleProperty (`flex/direction`) — a prop a component can expose, mapped to a CSS
102
+ * property with an allowed value set. Grouping (`flex`) is emergent from the path. */
103
+ declare const StylePropertyEntity: EntityClass<z.ZodObject<{
107
104
  properties: z.ZodArray<z.ZodString>;
108
105
  values: z.ZodOptional<z.ZodArray<z.ZodType<StylePropValue, unknown, z.core.$ZodTypeInternals<StylePropValue, unknown>>>>;
109
106
  responsive: z.ZodDefault<z.ZodBoolean>;
@@ -111,25 +108,15 @@ declare const StyleProperty: EntityClass<z.ZodObject<{
111
108
  arbitrary: z.ZodDefault<z.ZodBoolean>;
112
109
  negates: z.ZodDefault<z.ZodBoolean>;
113
110
  opacityOf: z.ZodOptional<z.ZodLazy<z.ZodType<Ref, unknown, z.core.$ZodTypeInternals<Ref, unknown>>>>;
114
- }, z.core.$strip>, z.ZodObject<Record<never, never>, z.core.$strip>, "style-property", {
115
- readonly rename: {
116
- readonly to: z.ZodString;
117
- };
118
- readonly create: {
119
- readonly path: z.ZodString;
120
- readonly description: `Create a style property \u2014 the prop a component exposes for one CSS effect. \`path\` is the prop's JSX name, camelCase (\`borderRadius\`), never a CSS name; the CSS goes in \`properties\`. \`values\` is a ref to a token GROUP (\`${string}\`), which offers every token in it and keeps the prop in step with modes and edits; \`{ "alias": "brand", "value": ${string} }\` offers one token under a name of the prop's own; a literal (\`"row"\`, \`{ "alias": "full", "value": "9999px" }\`) is for a keyword the system has no token for. Restating a token's value as a literal instead of referencing it is refused.`;
121
- readonly example: ({
122
- config
123
- }: {
124
- config: Config;
125
- kind: string;
126
- path: string;
127
- }) => {
128
- path: string;
129
- data: Record<string, unknown>;
130
- } | undefined;
131
- };
132
- }, Record<never, never>, false, Record<never, never>, Record<never, never>>;
111
+ }, z.core.$strip>, z.ZodObject<Record<never, never>, z.core.$strip>, "style-property", {}, Record<never, never>, false, Record<never, never>, Record<never, never>>;
112
+ /**
113
+ * `StyleProperty.ref('bg')` keeps the path literal in its type, so a component prop declared as the
114
+ * ref is typed by the property it points at: `bg: StyleProperty.ref('bg')` offers the registered `bg`
115
+ * values, and `columns: StyleProperty.ref('gridTemplateColumns')` offers the target's rather than
116
+ * the name's.
117
+ */
118
+ interface StylePropertyClass extends Named<typeof StylePropertyEntity> {}
119
+ declare const StyleProperty: StylePropertyClass;
133
120
  /** `flexDirection` → `flex-direction`. A name already spelled as CSS comes back unchanged. */
134
121
  declare function toCssPropertyName(property: string): string;
135
122
  /**
@@ -145,4 +132,4 @@ declare function cssPropertyNames(styleProp: {
145
132
  readonly properties: readonly string[];
146
133
  }): string[];
147
134
  //#endregion
148
- export { RefMember, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StylePropLeaf, StylePropValue, StylePropValueCtx, StylePropValueKind, StyleProperty, classifyStylePropValue, cssPropertyNames, leavesOfStylePropValue, stylePropValueFormOf, stylePropValueSchema, toCssPropertyName };
135
+ export { RefMember, STYLE_PROP_VALUE_FORMS, STYLE_PROP_VALUE_LEAVES, StylePropLeaf, StylePropValue, StylePropValueCtx, StylePropValueKind, StyleProperty, StylePropertyClass, classifyStylePropValue, cssPropertyNames, leavesOfStylePropValue, stylePropValueFormOf, stylePropValueSchema, toCssPropertyName };
@@ -417,12 +417,6 @@ function freePath(config, path) {
417
417
  for (let n = 2; config.resolve("style-property", candidate); n += 1) candidate = `${path}${n}`;
418
418
  return candidate;
419
419
  }
420
- /**
421
- * `StyleProperty.ref('bg')` keeps the path literal in its type, so a component prop declared as the
422
- * ref is typed by the property it points at: `bg: StyleProperty.ref('bg')` offers the registered `bg`
423
- * values, and `columns: StyleProperty.ref('gridTemplateColumns')` offers the target's rather than
424
- * the name's.
425
- */
426
420
  const StyleProperty = defineEntity({
427
421
  kind: "style-property",
428
422
  label: "Style property",