synthesisui 0.16.110 → 0.16.111
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/anatomy-from-sketch.js +17 -0
- package/dist/anatomy-read.js +11 -0
- package/package.json +1 -1
|
@@ -436,10 +436,27 @@ versionOf) {
|
|
|
436
436
|
},
|
|
437
437
|
];
|
|
438
438
|
}
|
|
439
|
+
/**
|
|
440
|
+
* A BOX OF OURS THAT IS SOMEBODY ELSE'S ELEMENT SAYS SO.
|
|
441
|
+
*
|
|
442
|
+
* A headless primitive is ours to draw - the classes on it are the client's - and
|
|
443
|
+
* that is why it becomes a PART rather than a frontier. But the element itself is
|
|
444
|
+
* `<Collapsible.Trigger>`, and the usage snippet was emitting a plain `<div>` with
|
|
445
|
+
* our class on it: a person following it gets the look and none of the behaviour, no
|
|
446
|
+
* `aria-expanded` and no keyboard (dono, 03/08). Measured on their library: 31 parts
|
|
447
|
+
* across 9 components are a library element, plus 11 roots.
|
|
448
|
+
*
|
|
449
|
+
* The package AND their own spelling, because the snippet needs both - the import
|
|
450
|
+
* line comes from the first and the tag from the second.
|
|
451
|
+
*/
|
|
452
|
+
const fromLib = kind === "headless" && node.from
|
|
453
|
+
? { from: String(node.from), refName: tag }
|
|
454
|
+
: {};
|
|
439
455
|
const built = {
|
|
440
456
|
as,
|
|
441
457
|
...(name ? { name } : {}),
|
|
442
458
|
...(classes ? { at: index } : {}),
|
|
459
|
+
...fromLib,
|
|
443
460
|
...(node.text ? { text: node.text } : {}),
|
|
444
461
|
};
|
|
445
462
|
const inside = hasKids ? descend() : [];
|
package/dist/anatomy-read.js
CHANGED
|
@@ -265,6 +265,17 @@ sketch) {
|
|
|
265
265
|
continue;
|
|
266
266
|
}
|
|
267
267
|
const node_ = { as };
|
|
268
|
+
/**
|
|
269
|
+
* A PART THAT IS A LIBRARY ELEMENT CARRIES BOTH FACTS - see `AnatomyRead.from`.
|
|
270
|
+
* Inert for the renderer, which dispatches on `as`; read by the usage snippet,
|
|
271
|
+
* which has to emit `<Collapsible.Trigger>` and the import line rather than a
|
|
272
|
+
* `<div>` that looks right and does nothing.
|
|
273
|
+
*/
|
|
274
|
+
if (typeof node.from === "string" && node.from.trim()) {
|
|
275
|
+
node_.from = node.from.trim();
|
|
276
|
+
if (typeof node.refName === "string" && node.refName.trim())
|
|
277
|
+
node_.refName = node.refName.trim();
|
|
278
|
+
}
|
|
268
279
|
// The NAME is what carries the styles, so it is claimed even when nothing
|
|
269
280
|
// resolved: the tree triggers on presence, and structure is most of the
|
|
270
281
|
// value. A node with no name is pure structure and that is legitimate.
|
package/package.json
CHANGED