synthesisui 0.16.192 → 0.16.193
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-read.js +55 -36
- package/package.json +1 -1
package/dist/anatomy-read.js
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
*/
|
|
32
32
|
import { readSxProps } from "./doctor/style-props.js";
|
|
33
33
|
import { transcribe, } from "./doctor/transcribe.js";
|
|
34
|
-
import { frontierKind } from "./frontier-kind.js";
|
|
34
|
+
import { frontierKind, packageRoot } from "./frontier-kind.js";
|
|
35
35
|
/** The ten forms, closed. A renderer that accepts any tag draws anything. */
|
|
36
36
|
const FORMS = new Set([
|
|
37
37
|
"image",
|
|
@@ -174,6 +174,49 @@ function frontierSx(node, sketch) {
|
|
|
174
174
|
const trimmed = raw?.trim();
|
|
175
175
|
return trimmed ? { sx: trimmed.slice(0, 400) } : {};
|
|
176
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* O QUE O SKETCH MEDIU NAQUELE NÓ - e é UMA função porque três ramos precisam dela.
|
|
179
|
+
*
|
|
180
|
+
* A leitura autorada diz a FORMA; o sketch guarda os fatos daquele elemento, alcançáveis pelo índice
|
|
181
|
+
* `at`. Isto era um bloco solto no meio do caminhamento, e o ramo de FRONTEIRA saía por um `continue`
|
|
182
|
+
* antes de chegar nele - então `behaviourProps`, `contentFrom`, `passes` e `repeats` nunca chegavam
|
|
183
|
+
* num nó que nomeia uma biblioteca.
|
|
184
|
+
*
|
|
185
|
+
* Medido no repo do dono em 09/08, DEPOIS de o conserto da travessia ter subido: `behaviourProps` em
|
|
186
|
+
* 15 nós de fronteira e ZERO chegando, `contentFrom` em 23 e zero. O detector de perda apontou; a
|
|
187
|
+
* causa era este `continue`.
|
|
188
|
+
*
|
|
189
|
+
* É a terceira vez que o mesmo formato cobra: um ramo que retorna antes do trabalho comum. O `upgrade`
|
|
190
|
+
* pulava a medição, o `repointToSteps` enumerava ramos e esquecia um, e agora este. Por isso vira
|
|
191
|
+
* função - uma lista de campos copiada à mão nasce desatualizada no próximo campo.
|
|
192
|
+
*/
|
|
193
|
+
function measuredAt(node, sketch) {
|
|
194
|
+
const out = {};
|
|
195
|
+
if (typeof node.at !== "number") {
|
|
196
|
+
if (node.when)
|
|
197
|
+
out.when = node.when;
|
|
198
|
+
if (node.atRest === false)
|
|
199
|
+
out.atRest = false;
|
|
200
|
+
return out;
|
|
201
|
+
}
|
|
202
|
+
const measured = sketch?.[node.at];
|
|
203
|
+
const when = node.when ?? measured?.when;
|
|
204
|
+
if (when)
|
|
205
|
+
out.when = when;
|
|
206
|
+
const atRest = node.atRest ?? measured?.atRest;
|
|
207
|
+
if (atRest === false)
|
|
208
|
+
out.atRest = false;
|
|
209
|
+
if (measured?.contentFrom)
|
|
210
|
+
out.contentFrom = measured.contentFrom;
|
|
211
|
+
if (measured?.behaviourProps &&
|
|
212
|
+
Object.keys(measured.behaviourProps).length > 0)
|
|
213
|
+
out.behaviourProps = measured.behaviourProps;
|
|
214
|
+
if (measured?.passes && Object.keys(measured.passes).length > 0)
|
|
215
|
+
out.passes = measured.passes;
|
|
216
|
+
if (measured?.repeats)
|
|
217
|
+
out.repeats = measured.repeats;
|
|
218
|
+
return out;
|
|
219
|
+
}
|
|
177
220
|
export function resolveAnatomy(read, declared, deps,
|
|
178
221
|
/** Their name → the slug it reaches in this system. See `RefResolver`. */
|
|
179
222
|
resolve,
|
|
@@ -284,6 +327,8 @@ sxSpacing) {
|
|
|
284
327
|
ref: slug || safePartName(name),
|
|
285
328
|
...(slug && slug !== safePartName(name) ? { refName: name } : {}),
|
|
286
329
|
...frontierClasses(node, sketch),
|
|
330
|
+
/** Um componente DELE também é um nó, e o que o sketch mediu nele vale igual. */
|
|
331
|
+
...measuredAt(node, sketch),
|
|
287
332
|
...holds,
|
|
288
333
|
});
|
|
289
334
|
continue;
|
|
@@ -291,7 +336,12 @@ sxSpacing) {
|
|
|
291
336
|
const from = String(node.from ?? "").trim();
|
|
292
337
|
if (!from)
|
|
293
338
|
continue;
|
|
294
|
-
|
|
339
|
+
/**
|
|
340
|
+
* PELA RAIZ DO PACOTE. O manifesto declara `@base-ui/react` e o código importa
|
|
341
|
+
* `@base-ui/react/menu` - o mesmo defeito consertado no `import.ts` em 09/08, e este era o
|
|
342
|
+
* segundo site. Uma receita de headless sem versão é um palpite datado.
|
|
343
|
+
*/
|
|
344
|
+
const version = deps?.[packageRoot(from)] ?? deps?.[from];
|
|
295
345
|
if (!external.some((e) => e.from === from))
|
|
296
346
|
external.push({ from, version });
|
|
297
347
|
out.push({
|
|
@@ -300,6 +350,8 @@ sxSpacing) {
|
|
|
300
350
|
...(version ? { version } : {}),
|
|
301
351
|
...frontierClasses(node, sketch),
|
|
302
352
|
...frontierSx(node, sketch),
|
|
353
|
+
/** O que o sketch mediu naquele nó - o `continue` abaixo o pulava. */
|
|
354
|
+
...measuredAt(node, sketch),
|
|
303
355
|
...holds,
|
|
304
356
|
});
|
|
305
357
|
continue;
|
|
@@ -309,40 +361,7 @@ sxSpacing) {
|
|
|
309
361
|
* THE GUARD TRAVELS WITH THE NODE, off the sketch it points at - so neither a
|
|
310
362
|
* reading nor the deriver has to carry it, and both get it.
|
|
311
363
|
*/
|
|
312
|
-
|
|
313
|
-
const measured = sketch?.[node.at];
|
|
314
|
-
const when = node.when ?? measured?.when;
|
|
315
|
-
if (when)
|
|
316
|
-
node_.when = when;
|
|
317
|
-
const atRest = node.atRest ?? measured?.atRest;
|
|
318
|
-
if (atRest === false)
|
|
319
|
-
node_.atRest = false;
|
|
320
|
-
/**
|
|
321
|
-
* WHAT THE NODE WRITES AND WHICH BEHAVIOUR PROPS IT CARRIES - the two facts that
|
|
322
|
-
* turn a styled shell into a component somebody can rebuild. Same lookup as the
|
|
323
|
-
* guard, one line up: measured on the sketch, dropped by every seam after it.
|
|
324
|
-
*/
|
|
325
|
-
if (measured?.contentFrom)
|
|
326
|
-
node_.contentFrom = measured.contentFrom;
|
|
327
|
-
if (measured?.behaviourProps &&
|
|
328
|
-
Object.keys(measured.behaviourProps).length > 0)
|
|
329
|
-
node_.behaviourProps = measured.behaviourProps;
|
|
330
|
-
/**
|
|
331
|
-
* O QUE ELE RECEBE E O QUE ELE REPETE, pela mesma consulta. As duas peças que fazem uma
|
|
332
|
-
* receita de TELA carregar a fiação de dados, e não só a casca - ver `SketchNode.passes`
|
|
333
|
-
* e `SketchNode.repeats`.
|
|
334
|
-
*/
|
|
335
|
-
if (measured?.passes && Object.keys(measured.passes).length > 0)
|
|
336
|
-
node_.passes = measured.passes;
|
|
337
|
-
if (measured?.repeats)
|
|
338
|
-
node_.repeats = measured.repeats;
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
if (node.when)
|
|
342
|
-
node_.when = node.when;
|
|
343
|
-
if (node.atRest === false)
|
|
344
|
-
node_.atRest = false;
|
|
345
|
-
}
|
|
364
|
+
Object.assign(node_, measuredAt(node, sketch));
|
|
346
365
|
/**
|
|
347
366
|
* A PART THAT IS A LIBRARY ELEMENT CARRIES BOTH FACTS - see `AnatomyRead.from`.
|
|
348
367
|
* Inert for the renderer, which dispatches on `as`; read by the usage snippet,
|
package/package.json
CHANGED