@yschimke/compose-design-map 1.24.0 → 1.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.
- package/design-map.mjs +26 -0
- package/package.json +1 -1
package/design-map.mjs
CHANGED
|
@@ -311,6 +311,32 @@ function foldSeeds(catalog) {
|
|
|
311
311
|
function cellSeeds(overrides, catalog) {
|
|
312
312
|
if (!overrides) return { seeds: [], unattached: [] };
|
|
313
313
|
|
|
314
|
+
// A cell that declares the kit's WHOLE assignment compares against that assignment, and the knob
|
|
315
|
+
// seeds do not enter resolution at all.
|
|
316
|
+
//
|
|
317
|
+
// Not a merge, and the reason is that a resolver has to place EVERY seed it is given: one extra
|
|
318
|
+
// knob seed that aliases to nothing kills the whole cell, so carrying both vectors would make a
|
|
319
|
+
// fully-declared cell fail for the sake of information the declaration already supersedes. The
|
|
320
|
+
// knobs still say how the render was produced — that is the renderer's business and it is
|
|
321
|
+
// recorded on the preview — while `kitProps` says what it is compared against. Keeping those two
|
|
322
|
+
// apart is what lets a catalog hold a better default than the kit and still compare honestly.
|
|
323
|
+
//
|
|
324
|
+
// Each entry is emitted as its own seed carrying both halves of the declaration, which is the
|
|
325
|
+
// shape a resolver already reads per seed. The `key` is the kit's own axis name rather than a
|
|
326
|
+
// knob key: there is no knob to name here, and inventing one would be a third spelling of a fact
|
|
327
|
+
// that already has two.
|
|
328
|
+
if (overrides.kitProps?.length) {
|
|
329
|
+
return {
|
|
330
|
+
seeds: overrides.kitProps.map((p) => ({
|
|
331
|
+
key: p.key,
|
|
332
|
+
raw: p.value,
|
|
333
|
+
kitAxis: p.key,
|
|
334
|
+
kitValue: p.value,
|
|
335
|
+
})),
|
|
336
|
+
unattached: [],
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
|
|
314
340
|
const seeds = overrides.props?.length
|
|
315
341
|
? overrides.props.map((p) => ({ key: p.key, raw: p.value }))
|
|
316
342
|
: (overrides.seeds ?? []).map((s) => ({ key: s.key, raw: s.raw }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yschimke/compose-design-map",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Project a compose-preview discovery manifest into design-parity's design-map.json, plus a sidecar of unresolved variant declarations. Dependency-free.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|