@yahoo/uds-create-config 4.24.0 → 4.25.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.
- package/dist/configs/CanvasConfig.d.ts +65 -5
- package/dist/configs/react-native-system.d.ts +45 -5
- package/dist/configs/system.d.ts +43 -3
- package/dist/configs/system.js +2 -0
- package/dist/entities/native/NativeSettings.d.ts +1 -1
- package/dist/entities/native/NativeToken.d.ts +1 -1
- package/dist/entities/system/Component.d.ts +45 -3
- package/dist/entities/system/Component.js +13 -5
- package/dist/entities/system/composed-values.d.ts +1 -1
- package/dist/entities/system/defineComponent.d.ts +87 -18
- package/dist/entities/system/icon-library.js +3 -2
- package/dist/framework/Config.d.ts +1 -1
- package/dist/framework/Config.js +1 -1
- package/dist/framework/projections.js +1 -1
- package/dist/framework/prop-surface.d.ts +35 -1
- package/dist/framework/prop-surface.js +85 -2
- package/dist/framework/render-spec.js +2 -2
- package/dist/framework/schema-version.d.ts +1 -1
- package/dist/framework/schema-version.js +5 -5
- package/dist/index.d.ts +12 -12
- package/dist/index.js +3 -3
- package/dist/migrations/2.0.0/v1-artifact.d.ts +23 -3
- package/dist/migrations/20260924044539_slot_code_forms.d.ts +12 -0
- package/dist/migrations/20260924044539_slot_code_forms.js +8 -0
- package/dist/spec/detach.js +6 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -9,15 +9,15 @@ import { Config } from "../framework/Config.js";
|
|
|
9
9
|
import { GlyphNamespace } from "../entities/system/glyph-identity.js";
|
|
10
10
|
import { StoredPreviewCondition } from "../framework/preview-store.js";
|
|
11
11
|
import { listSlots, namedSlots, slotHostedBy, slotOf } from "../spec/slot.js";
|
|
12
|
-
import { cellAt } from "../spec/cell.js";
|
|
13
|
-
import { instanceAt } from "../spec/instance.js";
|
|
14
|
-
import { ReactNativeSystem } from "./react-native-system.js";
|
|
15
|
-
import { System } from "./system.js";
|
|
16
|
-
import { AnySystemConfig } from "./platform.js";
|
|
17
12
|
import { ComposedValue } from "../entities/system/composed-values.js";
|
|
18
13
|
import { StyleValue } from "../entities/system/style-bag.js";
|
|
19
14
|
import { OverrideCondition, TokenRefPath, TokenReference } from "../entities/system/Token.js";
|
|
15
|
+
import { instanceAt } from "../spec/instance.js";
|
|
20
16
|
import { ComponentElementBody, ComponentReference, ComponentStyleBody } from "../entities/system/Component.js";
|
|
17
|
+
import { cellAt } from "../spec/cell.js";
|
|
18
|
+
import { ReactNativeSystem } from "./react-native-system.js";
|
|
19
|
+
import { System } from "./system.js";
|
|
20
|
+
import { AnySystemConfig } from "./platform.js";
|
|
21
21
|
import { z } from "zod";
|
|
22
22
|
|
|
23
23
|
//#region src/configs/CanvasConfig.d.ts
|
|
@@ -169,6 +169,16 @@ declare const Node: EntityClass<z.ZodObject<{
|
|
|
169
169
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
170
170
|
__ref: z.ZodString;
|
|
171
171
|
}, z.core.$strip>>]>>;
|
|
172
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
173
|
+
__ref: z.ZodString;
|
|
174
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
175
|
+
__ref: z.ZodString;
|
|
176
|
+
}, z.core.$strip>>]>>;
|
|
177
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
178
|
+
node: "node";
|
|
179
|
+
element: "element";
|
|
180
|
+
render: "render";
|
|
181
|
+
}>>>;
|
|
172
182
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
173
183
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
174
184
|
__ref: z.ZodString;
|
|
@@ -357,6 +367,16 @@ declare const Node: EntityClass<z.ZodObject<{
|
|
|
357
367
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
358
368
|
__ref: z.ZodString;
|
|
359
369
|
}, z.core.$strip>>]>>;
|
|
370
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
371
|
+
__ref: z.ZodString;
|
|
372
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
373
|
+
__ref: z.ZodString;
|
|
374
|
+
}, z.core.$strip>>]>>;
|
|
375
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
376
|
+
node: "node";
|
|
377
|
+
element: "element";
|
|
378
|
+
render: "render";
|
|
379
|
+
}>>>;
|
|
360
380
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
361
381
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
362
382
|
__ref: z.ZodString;
|
|
@@ -1713,6 +1733,16 @@ declare const CanvasConfig: ConfigClass<{
|
|
|
1713
1733
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1714
1734
|
__ref: z.ZodString;
|
|
1715
1735
|
}, z.core.$strip>>]>>;
|
|
1736
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1737
|
+
__ref: z.ZodString;
|
|
1738
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1739
|
+
__ref: z.ZodString;
|
|
1740
|
+
}, z.core.$strip>>]>>;
|
|
1741
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1742
|
+
node: "node";
|
|
1743
|
+
element: "element";
|
|
1744
|
+
render: "render";
|
|
1745
|
+
}>>>;
|
|
1716
1746
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
1717
1747
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1718
1748
|
__ref: z.ZodString;
|
|
@@ -1901,6 +1931,16 @@ declare const CanvasConfig: ConfigClass<{
|
|
|
1901
1931
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1902
1932
|
__ref: z.ZodString;
|
|
1903
1933
|
}, z.core.$strip>>]>>;
|
|
1934
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
1935
|
+
__ref: z.ZodString;
|
|
1936
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1937
|
+
__ref: z.ZodString;
|
|
1938
|
+
}, z.core.$strip>>]>>;
|
|
1939
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
1940
|
+
node: "node";
|
|
1941
|
+
element: "element";
|
|
1942
|
+
render: "render";
|
|
1943
|
+
}>>>;
|
|
1904
1944
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
1905
1945
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
1906
1946
|
__ref: z.ZodString;
|
|
@@ -3522,6 +3562,16 @@ declare function createCanvasConfig(system: AnySystemConfig): ConfigInstance<{
|
|
|
3522
3562
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
3523
3563
|
__ref: z.ZodString;
|
|
3524
3564
|
}, z.core.$strip>>]>>;
|
|
3565
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
3566
|
+
__ref: z.ZodString;
|
|
3567
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
3568
|
+
__ref: z.ZodString;
|
|
3569
|
+
}, z.core.$strip>>]>>;
|
|
3570
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
3571
|
+
node: "node";
|
|
3572
|
+
element: "element";
|
|
3573
|
+
render: "render";
|
|
3574
|
+
}>>>;
|
|
3525
3575
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3526
3576
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
3527
3577
|
__ref: z.ZodString;
|
|
@@ -3710,6 +3760,16 @@ declare function createCanvasConfig(system: AnySystemConfig): ConfigInstance<{
|
|
|
3710
3760
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
3711
3761
|
__ref: z.ZodString;
|
|
3712
3762
|
}, z.core.$strip>>]>>;
|
|
3763
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
3764
|
+
__ref: z.ZodString;
|
|
3765
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
3766
|
+
__ref: z.ZodString;
|
|
3767
|
+
}, z.core.$strip>>]>>;
|
|
3768
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
3769
|
+
node: "node";
|
|
3770
|
+
element: "element";
|
|
3771
|
+
render: "render";
|
|
3772
|
+
}>>>;
|
|
3713
3773
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3714
3774
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
3715
3775
|
__ref: z.ZodString;
|
|
@@ -13,13 +13,13 @@ import { GlyphNamespace } from "../entities/system/glyph-identity.js";
|
|
|
13
13
|
import { StylePropValue } from "../entities/system/StyleProperty.js";
|
|
14
14
|
import { StoredPreviewCondition } from "../framework/preview-store.js";
|
|
15
15
|
import { listSlots, namedSlots, slotHostedBy, slotOf } from "../spec/slot.js";
|
|
16
|
-
import { cellAt } from "../spec/cell.js";
|
|
17
|
-
import { instanceAt } from "../spec/instance.js";
|
|
18
|
-
import { ComposedValue } from "../entities/system/composed-values.js";
|
|
19
16
|
import { DerivedColor } from "../entities/system/color.js";
|
|
17
|
+
import { ComposedValue } from "../entities/system/composed-values.js";
|
|
20
18
|
import { StyleValue } from "../entities/system/style-bag.js";
|
|
21
19
|
import { OverrideCondition, TokenRefPath, TokenReference } from "../entities/system/Token.js";
|
|
20
|
+
import { instanceAt } from "../spec/instance.js";
|
|
22
21
|
import { ComponentElementBody, ComponentReference, ComponentStyleBody } from "../entities/system/Component.js";
|
|
22
|
+
import { cellAt } from "../spec/cell.js";
|
|
23
23
|
import * as _$zod from "zod";
|
|
24
24
|
import * as _$zod_v4_core0 from "zod/v4/core";
|
|
25
25
|
|
|
@@ -58,7 +58,7 @@ declare const ReactNativeSystem: ConfigClass<{
|
|
|
58
58
|
pagesDir: _$zod.ZodOptional<_$zod.ZodString>;
|
|
59
59
|
port: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
60
60
|
}, _$zod_v4_core0.$strict>>;
|
|
61
|
-
}, "
|
|
61
|
+
}, "canvas" | "css" | "playground"> & {
|
|
62
62
|
canvas: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
63
63
|
packageAliases: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodString>>;
|
|
64
64
|
}, _$zod_v4_core0.$strict>>;
|
|
@@ -96,6 +96,16 @@ declare const ReactNativeSystem: ConfigClass<{
|
|
|
96
96
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
97
97
|
__ref: _$zod.ZodString;
|
|
98
98
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
99
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
100
|
+
__ref: _$zod.ZodString;
|
|
101
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
102
|
+
__ref: _$zod.ZodString;
|
|
103
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
104
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
105
|
+
node: "node";
|
|
106
|
+
element: "element";
|
|
107
|
+
render: "render";
|
|
108
|
+
}>>>;
|
|
99
109
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
100
110
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
101
111
|
__ref: _$zod.ZodString;
|
|
@@ -284,6 +294,16 @@ declare const ReactNativeSystem: ConfigClass<{
|
|
|
284
294
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
285
295
|
__ref: _$zod.ZodString;
|
|
286
296
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
297
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
298
|
+
__ref: _$zod.ZodString;
|
|
299
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
300
|
+
__ref: _$zod.ZodString;
|
|
301
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
302
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
303
|
+
node: "node";
|
|
304
|
+
element: "element";
|
|
305
|
+
render: "render";
|
|
306
|
+
}>>>;
|
|
287
307
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
288
308
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
289
309
|
__ref: _$zod.ZodString;
|
|
@@ -2245,7 +2265,7 @@ declare const ReactNativeSystem: ConfigClass<{
|
|
|
2245
2265
|
pagesDir: _$zod.ZodOptional<_$zod.ZodString>;
|
|
2246
2266
|
port: _$zod.ZodOptional<_$zod.ZodNumber>;
|
|
2247
2267
|
}, _$zod_v4_core0.$strict>>;
|
|
2248
|
-
}, "
|
|
2268
|
+
}, "canvas" | "css" | "playground"> & {
|
|
2249
2269
|
canvas: _$zod.ZodOptional<_$zod.ZodObject<{
|
|
2250
2270
|
packageAliases: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodString>>;
|
|
2251
2271
|
}, _$zod_v4_core0.$strict>>;
|
|
@@ -2283,6 +2303,16 @@ declare const ReactNativeSystem: ConfigClass<{
|
|
|
2283
2303
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2284
2304
|
__ref: _$zod.ZodString;
|
|
2285
2305
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
2306
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
2307
|
+
__ref: _$zod.ZodString;
|
|
2308
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2309
|
+
__ref: _$zod.ZodString;
|
|
2310
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
2311
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
2312
|
+
node: "node";
|
|
2313
|
+
element: "element";
|
|
2314
|
+
render: "render";
|
|
2315
|
+
}>>>;
|
|
2286
2316
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
2287
2317
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
2288
2318
|
__ref: _$zod.ZodString;
|
|
@@ -2471,6 +2501,16 @@ declare const ReactNativeSystem: ConfigClass<{
|
|
|
2471
2501
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2472
2502
|
__ref: _$zod.ZodString;
|
|
2473
2503
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
2504
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
2505
|
+
__ref: _$zod.ZodString;
|
|
2506
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2507
|
+
__ref: _$zod.ZodString;
|
|
2508
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
2509
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
2510
|
+
node: "node";
|
|
2511
|
+
element: "element";
|
|
2512
|
+
render: "render";
|
|
2513
|
+
}>>>;
|
|
2474
2514
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
2475
2515
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
2476
2516
|
__ref: _$zod.ZodString;
|
package/dist/configs/system.d.ts
CHANGED
|
@@ -13,13 +13,13 @@ import { GlyphNamespace } from "../entities/system/glyph-identity.js";
|
|
|
13
13
|
import { StylePropValue } from "../entities/system/StyleProperty.js";
|
|
14
14
|
import { StoredPreviewCondition } from "../framework/preview-store.js";
|
|
15
15
|
import { listSlots, namedSlots, slotHostedBy, slotOf } from "../spec/slot.js";
|
|
16
|
-
import { cellAt } from "../spec/cell.js";
|
|
17
|
-
import { instanceAt } from "../spec/instance.js";
|
|
18
|
-
import { ComposedValue } from "../entities/system/composed-values.js";
|
|
19
16
|
import { DerivedColor } from "../entities/system/color.js";
|
|
17
|
+
import { ComposedValue } from "../entities/system/composed-values.js";
|
|
20
18
|
import { StyleValue } from "../entities/system/style-bag.js";
|
|
21
19
|
import { OverrideCondition, TokenRefPath, TokenReference } from "../entities/system/Token.js";
|
|
20
|
+
import { instanceAt } from "../spec/instance.js";
|
|
22
21
|
import { ComponentElementBody, ComponentReference, ComponentStyleBody } from "../entities/system/Component.js";
|
|
22
|
+
import { cellAt } from "../spec/cell.js";
|
|
23
23
|
import * as _$zod from "zod";
|
|
24
24
|
import * as _$zod_v4_core0 from "zod/v4/core";
|
|
25
25
|
|
|
@@ -86,6 +86,16 @@ declare const System: ConfigClass<{
|
|
|
86
86
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
87
87
|
__ref: _$zod.ZodString;
|
|
88
88
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
89
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
90
|
+
__ref: _$zod.ZodString;
|
|
91
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
92
|
+
__ref: _$zod.ZodString;
|
|
93
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
94
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
95
|
+
node: "node";
|
|
96
|
+
element: "element";
|
|
97
|
+
render: "render";
|
|
98
|
+
}>>>;
|
|
89
99
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
90
100
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
91
101
|
__ref: _$zod.ZodString;
|
|
@@ -274,6 +284,16 @@ declare const System: ConfigClass<{
|
|
|
274
284
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
275
285
|
__ref: _$zod.ZodString;
|
|
276
286
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
287
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
288
|
+
__ref: _$zod.ZodString;
|
|
289
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
290
|
+
__ref: _$zod.ZodString;
|
|
291
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
292
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
293
|
+
node: "node";
|
|
294
|
+
element: "element";
|
|
295
|
+
render: "render";
|
|
296
|
+
}>>>;
|
|
277
297
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
278
298
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
279
299
|
__ref: _$zod.ZodString;
|
|
@@ -2148,6 +2168,16 @@ declare const System: ConfigClass<{
|
|
|
2148
2168
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2149
2169
|
__ref: _$zod.ZodString;
|
|
2150
2170
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
2171
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
2172
|
+
__ref: _$zod.ZodString;
|
|
2173
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2174
|
+
__ref: _$zod.ZodString;
|
|
2175
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
2176
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
2177
|
+
node: "node";
|
|
2178
|
+
element: "element";
|
|
2179
|
+
render: "render";
|
|
2180
|
+
}>>>;
|
|
2151
2181
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
2152
2182
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
2153
2183
|
__ref: _$zod.ZodString;
|
|
@@ -2336,6 +2366,16 @@ declare const System: ConfigClass<{
|
|
|
2336
2366
|
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2337
2367
|
__ref: _$zod.ZodString;
|
|
2338
2368
|
}, _$zod_v4_core0.$strip>>]>>;
|
|
2369
|
+
value: _$zod.ZodOptional<_$zod.ZodUnion<readonly [_$zod.ZodObject<{
|
|
2370
|
+
__ref: _$zod.ZodString;
|
|
2371
|
+
}, _$zod_v4_core0.$strip>, _$zod.ZodArray<_$zod.ZodObject<{
|
|
2372
|
+
__ref: _$zod.ZodString;
|
|
2373
|
+
}, _$zod_v4_core0.$strip>>]>>;
|
|
2374
|
+
code: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodEnum<{
|
|
2375
|
+
node: "node";
|
|
2376
|
+
element: "element";
|
|
2377
|
+
render: "render";
|
|
2378
|
+
}>>>;
|
|
2339
2379
|
required: _$zod.ZodOptional<_$zod.ZodBoolean>;
|
|
2340
2380
|
when: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnion<readonly [_$zod.ZodUnion<readonly [_$zod.ZodString, _$zod.ZodNumber, _$zod.ZodBoolean, _$zod.ZodObject<{
|
|
2341
2381
|
__ref: _$zod.ZodString;
|
package/dist/configs/system.js
CHANGED
|
@@ -40,6 +40,7 @@ import { computedValuesAndRepeatedNodesMigration } from "../migrations/202609231
|
|
|
40
40
|
import { transitionTokenValueMigration } from "../migrations/20260923144958_transition_token_value.js";
|
|
41
41
|
import { renderTokenRefsMigration } from "../migrations/20260923160425_render_token_refs.js";
|
|
42
42
|
import { globalStyleDerivedColorsMigration } from "../migrations/20260923163604_global_style_derived_colors.js";
|
|
43
|
+
import { slotCodeFormsMigration } from "../migrations/20260924044539_slot_code_forms.js";
|
|
43
44
|
//#region src/configs/system.ts
|
|
44
45
|
/**
|
|
45
46
|
* `System` — the design-system config TYPE. Declares the exact kinds a design system owns (tokens,
|
|
@@ -100,5 +101,6 @@ if (!registeredSchemaMigrations().has(20260923112910)) registerSchemaMigrations(
|
|
|
100
101
|
if (!registeredSchemaMigrations().has(20260923144958)) registerSchemaMigrations(transitionTokenValueMigration);
|
|
101
102
|
if (!registeredSchemaMigrations().has(20260923160425)) registerSchemaMigrations(renderTokenRefsMigration);
|
|
102
103
|
if (!registeredSchemaMigrations().has(20260923163604)) registerSchemaMigrations(globalStyleDerivedColorsMigration);
|
|
104
|
+
if (!registeredSchemaMigrations().has(20260924044539)) registerSchemaMigrations(slotCodeFormsMigration);
|
|
103
105
|
//#endregion
|
|
104
106
|
export { System };
|
|
@@ -36,7 +36,7 @@ declare const NativeSettings: EntityClass<z.ZodObject<Omit<{
|
|
|
36
36
|
pagesDir: z.ZodOptional<z.ZodString>;
|
|
37
37
|
port: z.ZodOptional<z.ZodNumber>;
|
|
38
38
|
}, z.core.$strict>>;
|
|
39
|
-
}, "
|
|
39
|
+
}, "canvas" | "css" | "playground"> & {
|
|
40
40
|
canvas: z.ZodOptional<z.ZodObject<{
|
|
41
41
|
packageAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
42
42
|
}, z.core.$strict>>;
|
|
@@ -2,8 +2,8 @@ import { Ref } from "../../framework/utils/ref-grammar.js";
|
|
|
2
2
|
import { Ref as Ref$1 } from "../../framework/utils/refs.js";
|
|
3
3
|
import { SubEntityClass } from "../../framework/defineSubEntity.js";
|
|
4
4
|
import { EntityClass } from "../../framework/defineEntity.js";
|
|
5
|
-
import { ComposedValue } from "../system/composed-values.js";
|
|
6
5
|
import { DerivedColor } from "../system/color.js";
|
|
6
|
+
import { ComposedValue } from "../system/composed-values.js";
|
|
7
7
|
import { OverrideCondition } from "../system/Token.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
@@ -8,12 +8,12 @@ import { Config } from "../../framework/Config.js";
|
|
|
8
8
|
import { RepeatSpec } from "../../framework/render-spec.js";
|
|
9
9
|
import { StoredPreviewCondition } from "../../framework/preview-store.js";
|
|
10
10
|
import { listSlots, namedSlots, slotHostedBy, slotOf } from "../../spec/slot.js";
|
|
11
|
-
import { cellAt } from "../../spec/cell.js";
|
|
12
|
-
import { instanceAt } from "../../spec/instance.js";
|
|
13
11
|
import { ComposedValue } from "./composed-values.js";
|
|
14
12
|
import { StyleValue } from "./style-bag.js";
|
|
15
13
|
import { OverrideCondition, TokenRefPath, TokenReference } from "./Token.js";
|
|
14
|
+
import { instanceAt } from "../../spec/instance.js";
|
|
16
15
|
import { AsInput, LayerMap, PhantomCallProps, PhantomReadProps, PropMap, RenderArgs, StyleRuleInput } from "./defineComponent.js";
|
|
16
|
+
import { cellAt } from "../../spec/cell.js";
|
|
17
17
|
import { z } from "zod";
|
|
18
18
|
|
|
19
19
|
//#region src/entities/system/Component.d.ts
|
|
@@ -51,6 +51,8 @@ declare const variantValueFields: z.ZodObject<{
|
|
|
51
51
|
type VariantValueBody = z.infer<typeof variantValueFields>;
|
|
52
52
|
/** A variant prop's own values — name → body, in the order they were declared. */
|
|
53
53
|
type VariantValues = Record<string, VariantValueBody>;
|
|
54
|
+
/** The forms code may fill a slot with beside its own value — the members of {@link SlotCodeForm}. */
|
|
55
|
+
declare const SLOT_CODE_FORMS: readonly ["node", "element", "render"];
|
|
54
56
|
declare const propShape: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
55
57
|
type: z.ZodLiteral<"slot">;
|
|
56
58
|
text: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -59,6 +61,16 @@ declare const propShape: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
59
61
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
60
62
|
__ref: z.ZodString;
|
|
61
63
|
}, z.core.$strip>>]>>;
|
|
64
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
65
|
+
__ref: z.ZodString;
|
|
66
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
67
|
+
__ref: z.ZodString;
|
|
68
|
+
}, z.core.$strip>>]>>;
|
|
69
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
70
|
+
node: "node";
|
|
71
|
+
element: "element";
|
|
72
|
+
render: "render";
|
|
73
|
+
}>>>;
|
|
62
74
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
63
75
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
64
76
|
__ref: z.ZodString;
|
|
@@ -565,6 +577,16 @@ declare const componentFields: z.ZodObject<{
|
|
|
565
577
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
566
578
|
__ref: z.ZodString;
|
|
567
579
|
}, z.core.$strip>>]>>;
|
|
580
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
581
|
+
__ref: z.ZodString;
|
|
582
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
583
|
+
__ref: z.ZodString;
|
|
584
|
+
}, z.core.$strip>>]>>;
|
|
585
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
586
|
+
node: "node";
|
|
587
|
+
element: "element";
|
|
588
|
+
render: "render";
|
|
589
|
+
}>>>;
|
|
568
590
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
569
591
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
570
592
|
__ref: z.ZodString;
|
|
@@ -769,6 +791,16 @@ declare const ComponentEntity: EntityClass<z.ZodObject<{
|
|
|
769
791
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
770
792
|
__ref: z.ZodString;
|
|
771
793
|
}, z.core.$strip>>]>>;
|
|
794
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
795
|
+
__ref: z.ZodString;
|
|
796
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
797
|
+
__ref: z.ZodString;
|
|
798
|
+
}, z.core.$strip>>]>>;
|
|
799
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
800
|
+
node: "node";
|
|
801
|
+
element: "element";
|
|
802
|
+
render: "render";
|
|
803
|
+
}>>>;
|
|
772
804
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
773
805
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
774
806
|
__ref: z.ZodString;
|
|
@@ -957,6 +989,16 @@ declare const ComponentEntity: EntityClass<z.ZodObject<{
|
|
|
957
989
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
958
990
|
__ref: z.ZodString;
|
|
959
991
|
}, z.core.$strip>>]>>;
|
|
992
|
+
value: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
993
|
+
__ref: z.ZodString;
|
|
994
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
995
|
+
__ref: z.ZodString;
|
|
996
|
+
}, z.core.$strip>>]>>;
|
|
997
|
+
code: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
998
|
+
node: "node";
|
|
999
|
+
element: "element";
|
|
1000
|
+
render: "render";
|
|
1001
|
+
}>>>;
|
|
960
1002
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
961
1003
|
when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
962
1004
|
__ref: z.ZodString;
|
|
@@ -2280,4 +2322,4 @@ declare const Component: Omit<typeof ComponentEntity, "ref"> & {
|
|
|
2280
2322
|
instance: typeof instanceAt;
|
|
2281
2323
|
};
|
|
2282
2324
|
//#endregion
|
|
2283
|
-
export { AuthoredPropBody, Component, ComponentBody, ComponentElementBody, ComponentPropBody, ComponentReference, ComponentStyleBody, ElementVisibility, ElementVisibilityInput, ExtendedComponentRef, ProjectedVisibility, VariantValueBody, VariantValues, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef };
|
|
2325
|
+
export { AuthoredPropBody, Component, ComponentBody, ComponentElementBody, ComponentPropBody, ComponentReference, ComponentStyleBody, ElementVisibility, ElementVisibilityInput, ExtendedComponentRef, ProjectedVisibility, SLOT_CODE_FORMS, VariantValueBody, VariantValues, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef };
|
|
@@ -21,7 +21,7 @@ import { File } from "./File.js";
|
|
|
21
21
|
import { iconDomainInvariants } from "./icon-domain-invariants.js";
|
|
22
22
|
import { rootLayerInvariants } from "./root-layer-invariants.js";
|
|
23
23
|
import { Token } from "./Token.js";
|
|
24
|
-
import { intoName, routedPropIn, routesContent } from "../../framework/prop-surface.js";
|
|
24
|
+
import { carriesContent, intoName, isValueSlot, routedPropIn, routesContent } from "../../framework/prop-surface.js";
|
|
25
25
|
import { z } from "zod";
|
|
26
26
|
//#region src/entities/system/Component.ts
|
|
27
27
|
/**
|
|
@@ -361,6 +361,12 @@ const conditionLeaf = z.union([
|
|
|
361
361
|
refSchema
|
|
362
362
|
]);
|
|
363
363
|
const propCondition = z.record(z.string(), z.union([conditionLeaf, z.array(conditionLeaf)])).optional();
|
|
364
|
+
/** The forms code may fill a slot with beside its own value — the members of {@link SlotCodeForm}. */
|
|
365
|
+
const SLOT_CODE_FORMS = [
|
|
366
|
+
"node",
|
|
367
|
+
"element",
|
|
368
|
+
"render"
|
|
369
|
+
];
|
|
364
370
|
/**
|
|
365
371
|
* The declaration shape over a given condition schema: the generic one with `when` open, and one
|
|
366
372
|
* per owner with `when` narrowed to that component's props. A factory rather than a per-owner
|
|
@@ -373,6 +379,8 @@ function propShapeWith(when) {
|
|
|
373
379
|
type: z.literal("slot"),
|
|
374
380
|
text: z.boolean().optional(),
|
|
375
381
|
accepts: z.union([refSchema, z.array(refSchema)]).optional(),
|
|
382
|
+
value: z.union([refSchema, z.array(refSchema).min(1)]).optional(),
|
|
383
|
+
code: z.array(z.enum(SLOT_CODE_FORMS)).min(1).optional(),
|
|
376
384
|
required: z.boolean().optional(),
|
|
377
385
|
when
|
|
378
386
|
}),
|
|
@@ -445,7 +453,7 @@ const PROP_TYPES = [
|
|
|
445
453
|
"number",
|
|
446
454
|
"boolean"
|
|
447
455
|
];
|
|
448
|
-
const PROP_DESCRIPTION = "What the prop is. A style property the component exposes, `{ \"type\": \"styleProperty\", \"value\": { \"__ref\": \"style-property:<name>\" } }`, which is what a primitive's props mostly are and what makes a style rule's bag key valid on it; a closed set of names a style rule keys on, `{ \"type\": \"variant\", \"value\": [\"sm\", \"lg\"] }`; content, `{ \"type\": \"slot\", \"text\": true }
|
|
456
|
+
const PROP_DESCRIPTION = "What the prop is. A style property the component exposes, `{ \"type\": \"styleProperty\", \"value\": { \"__ref\": \"style-property:<name>\" } }`, which is what a primitive's props mostly are and what makes a style rule's bag key valid on it; a closed set of names a style rule keys on, `{ \"type\": \"variant\", \"value\": [\"sm\", \"lg\"] }`; content, `{ \"type\": \"slot\", \"text\": true }`, or a slot whose own value is a library member, `{ \"type\": \"slot\", \"value\": { \"__ref\": \"icon:<library>\" } }`, which code may also fill with the forms it lists under `code` (`[\"node\", \"element\", \"render\"]`); or a plain `string`, `number` or `boolean`. `null` hides a prop an inherited layer would expose. A prop that applies only under a condition on a sibling carries `when`, the record a style rule uses: `{ \"type\": \"string\", \"when\": { \"type\": \"color\" } }` shows it for one value, `{ \"when\": { \"type\": [\"default\", \"header\"] } }` for several.";
|
|
449
457
|
/** Nullable because `null` is the omit tombstone: a component that `inherits` its element's props
|
|
450
458
|
* drops one by declaring it `null`, rather than needing a second "don't expose" mechanism. */
|
|
451
459
|
const Prop = defineSubEntity({
|
|
@@ -534,7 +542,7 @@ function styleBagValue({ config, declaration, name = "<prop>", glyphLibraries })
|
|
|
534
542
|
config,
|
|
535
543
|
libraries: glyphLibraries
|
|
536
544
|
}), domain]);
|
|
537
|
-
if (declaration?.type === "slot") return z.union([domain, z.never()], { error: () => `\`${name}\` is a slot, so a rule may set it to a string of content and nothing else. A glyph or a nested element is an anatomy node under the layer's node — \`{ "element": { "__ref": "icon:<library>/<Name>" }, "visible": { "$state": "<prop>", "eq": "<value>" } }\` to show one per variant value — and the instance's own content arrives through the prop.` });
|
|
545
|
+
if (declaration?.type === "slot" && !isValueSlot(declaration)) return z.union([domain, z.never()], { error: () => `\`${name}\` is a slot, so a rule may set it to a string of content and nothing else. A glyph or a nested element is an anatomy node under the layer's node — \`{ "element": { "__ref": "icon:<library>/<Name>" }, "visible": { "$state": "<prop>", "eq": "<value>" } }\` to show one per variant value — and the instance's own content arrives through the prop.` });
|
|
538
546
|
if (!isRef(bound) || kindOf(bound.__ref) !== "style-property") return domain;
|
|
539
547
|
const property = pathOf(bound.__ref);
|
|
540
548
|
return z.union([
|
|
@@ -1569,7 +1577,7 @@ slots: ({ config, path, member }) => {
|
|
|
1569
1577
|
for (const [name, decl] of Object.entries(resolveComponentProps(config, path))) {
|
|
1570
1578
|
const body = decl;
|
|
1571
1579
|
if (!body) continue;
|
|
1572
|
-
if (
|
|
1580
|
+
if (carriesContent(config, layers, body)) names.push(name);
|
|
1573
1581
|
}
|
|
1574
1582
|
return names;
|
|
1575
1583
|
} },
|
|
@@ -2156,4 +2164,4 @@ function exampleProps(config, componentPath) {
|
|
|
2156
2164
|
return {};
|
|
2157
2165
|
}
|
|
2158
2166
|
//#endregion
|
|
2159
|
-
export { Component, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef };
|
|
2167
|
+
export { Component, SLOT_CODE_FORMS, blankComponentBody, canonicalWhen, forwardedNames, layerRef, ownValues, ownsItsValues, valueRef };
|