synthesisui 0.16.188 → 0.16.189
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 +47 -1
- package/dist/commands/import.js +12 -2
- package/dist/frontier-kind.js +8 -1
- package/package.json +1 -1
|
@@ -237,6 +237,33 @@ const MEMBER_FORM = {
|
|
|
237
237
|
* already the recipe's `base`, and emitting it again would draw the component
|
|
238
238
|
* inside a copy of itself.
|
|
239
239
|
*/
|
|
240
|
+
/**
|
|
241
|
+
* COMO A PEÇA DA BIBLIOTECA FOI USADA, verbatim - e ela nunca atravessava.
|
|
242
|
+
*
|
|
243
|
+
* O sketch já lia `behaviourProps` no ponto de chamada (`open`, `onOpenChange`, `disabled`) e o
|
|
244
|
+
* contrato já tinha o campo; entre um e outro não havia ninguém carregando. Medido no repo do dono em
|
|
245
|
+
* 09/08: 15 nós carregavam as props na leitura e ZERO chegavam na receita.
|
|
246
|
+
*
|
|
247
|
+
* É a metade que decide se um agente consegue reproduzir o componente sem inventar: `Collapsible.Root`
|
|
248
|
+
* sozinho não diz se o disclosure é controlado; `Collapsible.Root` com `open` e `onOpenChange` diz.
|
|
249
|
+
*
|
|
250
|
+
* Teto de 12 props e 200 caracteres cada: isto viaja no censo e uma expressão de chamada pode ser uma
|
|
251
|
+
* linha inteira de código. O que passa disso é ruído no lugar onde a receita precisa ser lida.
|
|
252
|
+
*/
|
|
253
|
+
function behaviour(node) {
|
|
254
|
+
const raw = node.behaviourProps;
|
|
255
|
+
if (!raw || typeof raw !== "object")
|
|
256
|
+
return {};
|
|
257
|
+
const out = {};
|
|
258
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
259
|
+
if (Object.keys(out).length >= 12)
|
|
260
|
+
break;
|
|
261
|
+
if (typeof value !== "string" || !key)
|
|
262
|
+
continue;
|
|
263
|
+
out[key] = value.slice(0, 200);
|
|
264
|
+
}
|
|
265
|
+
return Object.keys(out).length > 0 ? { behaviourProps: out } : {};
|
|
266
|
+
}
|
|
240
267
|
export function anatomyFromSketch(sketch, defines,
|
|
241
268
|
/**
|
|
242
269
|
* Their manifest: a package name → the range they pinned. This is what tells
|
|
@@ -335,6 +362,7 @@ versionOf) {
|
|
|
335
362
|
as: held.length > 0 ? "stack" : "text",
|
|
336
363
|
from: String(node.from ?? tag),
|
|
337
364
|
refName: tag,
|
|
365
|
+
...behaviour(node),
|
|
338
366
|
/** Its own index, so its guard and its props are still reachable - see `at`. */
|
|
339
367
|
at: index,
|
|
340
368
|
...(held.length > 0 ? { children: held } : {}),
|
|
@@ -352,6 +380,8 @@ versionOf) {
|
|
|
352
380
|
{
|
|
353
381
|
as: "component",
|
|
354
382
|
ref: tag,
|
|
383
|
+
/** Como ELE configurou o próprio componente é receita igual - ver `behaviour`. */
|
|
384
|
+
...behaviour(node),
|
|
355
385
|
/**
|
|
356
386
|
* THE INDEX IS THE NODE'S IDENTITY ON THE SKETCH, not a pointer to its classes.
|
|
357
387
|
*
|
|
@@ -380,6 +410,16 @@ versionOf) {
|
|
|
380
410
|
{
|
|
381
411
|
as: "external",
|
|
382
412
|
from: String(node.from ?? tag),
|
|
413
|
+
/**
|
|
414
|
+
* QUAL PEÇA, e não só de qual pacote - o ramo headless já dizia isto e o opaco não.
|
|
415
|
+
*
|
|
416
|
+
* `Collapsible.Root` e `Collapsible.Trigger` vêm do mesmo especificador e não são a mesma
|
|
417
|
+
* coisa: quem gera código a partir da receita tem de saber qual das duas escrever. Medido
|
|
418
|
+
* no repo do dono em 09/08: dos 119 nós de fronteira, 42 diziam a peça e 77 diziam apenas
|
|
419
|
+
* o pacote - e os 77 eram exatamente este ramo.
|
|
420
|
+
*/
|
|
421
|
+
refName: tag,
|
|
422
|
+
...behaviour(node),
|
|
383
423
|
at: index,
|
|
384
424
|
...(children.length > 0 ? { children: descend() } : {}),
|
|
385
425
|
},
|
|
@@ -513,8 +553,14 @@ versionOf) {
|
|
|
513
553
|
* props are copied into the snippet and can never fire, because the element unmounts
|
|
514
554
|
* before anything animates. Headless-only dropped it (dono, 04/08).
|
|
515
555
|
*/
|
|
556
|
+
/**
|
|
557
|
+
* Uma primitiva headless DESENHADA continua sendo daquela biblioteca, e as props do ponto de
|
|
558
|
+
* chamada são o que dizem se ela é controlada. Medido em 09/08: `Collapsible.Root`,
|
|
559
|
+
* `Popover.Root`, `Switch.Root`, `BaseDialog.Root` e `Field.Root` chegavam aqui e perdiam
|
|
560
|
+
* `open`/`onOpenChange`/`checked` - 11 dos 15 nós que a leitura media.
|
|
561
|
+
*/
|
|
516
562
|
const fromLib = (kind === "headless" || kind === "motion") && node.from
|
|
517
|
-
? { from: String(node.from), refName: tag }
|
|
563
|
+
? { from: String(node.from), refName: tag, ...behaviour(node) }
|
|
518
564
|
: {};
|
|
519
565
|
const built = {
|
|
520
566
|
as,
|
package/dist/commands/import.js
CHANGED
|
@@ -32,7 +32,7 @@ import { MUI_DEFAULT_SPACING, readStyledComponents, spacingOf, } from "../doctor
|
|
|
32
32
|
import { buildTable } from "../doctor/tokens.js";
|
|
33
33
|
import { definitionSpan, readInlineStyle, rootClasses, rootTag, transcribe, } from "../doctor/transcribe.js";
|
|
34
34
|
import { transcribeVariants } from "../doctor/variant-read.js";
|
|
35
|
-
import { frontierKind } from "../frontier-kind.js";
|
|
35
|
+
import { frontierKind, packageRoot } from "../frontier-kind.js";
|
|
36
36
|
import { withLibraryStructure } from "../library-structure.js";
|
|
37
37
|
import { body, paint, section } from "../output.js";
|
|
38
38
|
import { phase, startProgress } from "../progress.js";
|
|
@@ -2478,7 +2478,17 @@ export async function resolveReadParts(census, root) {
|
|
|
2478
2478
|
.filter((lib) => !resolved.external.some((e) => e.from === lib.from))
|
|
2479
2479
|
.map((lib) => ({
|
|
2480
2480
|
from: lib.from,
|
|
2481
|
-
|
|
2481
|
+
/**
|
|
2482
|
+
* PELA RAIZ DO PACOTE, e não pelo especificador inteiro.
|
|
2483
|
+
*
|
|
2484
|
+
* O `package.json` declara `@base-ui/react`; o código importa
|
|
2485
|
+
* `@base-ui/react/collapsible`. Consultar o manifesto com o segundo acerta só quando os
|
|
2486
|
+
* dois coincidem - medido no repo do dono em 09/08, 95 de 119 nós de fronteira chegavam
|
|
2487
|
+
* sem versão, e uma receita de biblioteca headless sem versão é um palpite datado.
|
|
2488
|
+
*/
|
|
2489
|
+
...(pinned[packageRoot(lib.from)]
|
|
2490
|
+
? { version: pinned[packageRoot(lib.from)] }
|
|
2491
|
+
: {}),
|
|
2482
2492
|
/**
|
|
2483
2493
|
* EVERY KIND, not the two the rule sentence happened to need.
|
|
2484
2494
|
*
|
package/dist/frontier-kind.js
CHANGED
|
@@ -118,7 +118,14 @@ export function frontierKind(pkg) {
|
|
|
118
118
|
return "opaque";
|
|
119
119
|
}
|
|
120
120
|
/** `@scope/name/sub` → `@scope/name`; `name/sub` → `name`. */
|
|
121
|
-
|
|
121
|
+
/**
|
|
122
|
+
* O NOME DO PACOTE, do especificador inteiro: `@base-ui/react/collapsible` -> `@base-ui/react`.
|
|
123
|
+
*
|
|
124
|
+
* Exportado em 09/08 porque o carimbo de VERSÃO consultava o manifesto com o especificador cru, e o
|
|
125
|
+
* `package.json` declara a raiz. Resultado medido no repo do dono: 95 de 119 nós de fronteira
|
|
126
|
+
* chegavam sem versão, e os 24 que chegavam eram justamente os que importam da raiz.
|
|
127
|
+
*/
|
|
128
|
+
export function packageRoot(pkg) {
|
|
122
129
|
const parts = pkg.split("/");
|
|
123
130
|
return pkg.startsWith("@") ? parts.slice(0, 2).join("/") : parts[0];
|
|
124
131
|
}
|
package/package.json
CHANGED