synthesisui 0.16.192 → 0.16.194

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.
@@ -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,56 @@ 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
+ /**
219
+ * O TEXTO LITERAL. O nó desenhado já o pegava da leitura autorada; um nó de FRONTEIRA não, e é
220
+ * conteúdo de verdade - medido no repo do dono, `Dialog.Title` diz "Insert link" e `Dialog.Close`
221
+ * diz "Cancel". Quem regenera o componente a partir da receita precisa dos dois.
222
+ */
223
+ if (measured?.text)
224
+ out.text = String(measured.text).trim().slice(0, 120);
225
+ return out;
226
+ }
177
227
  export function resolveAnatomy(read, declared, deps,
178
228
  /** Their name → the slug it reaches in this system. See `RefResolver`. */
179
229
  resolve,
@@ -284,6 +334,8 @@ sxSpacing) {
284
334
  ref: slug || safePartName(name),
285
335
  ...(slug && slug !== safePartName(name) ? { refName: name } : {}),
286
336
  ...frontierClasses(node, sketch),
337
+ /** Um componente DELE também é um nó, e o que o sketch mediu nele vale igual. */
338
+ ...measuredAt(node, sketch),
287
339
  ...holds,
288
340
  });
289
341
  continue;
@@ -291,7 +343,12 @@ sxSpacing) {
291
343
  const from = String(node.from ?? "").trim();
292
344
  if (!from)
293
345
  continue;
294
- const version = deps?.[from];
346
+ /**
347
+ * PELA RAIZ DO PACOTE. O manifesto declara `@base-ui/react` e o código importa
348
+ * `@base-ui/react/menu` - o mesmo defeito consertado no `import.ts` em 09/08, e este era o
349
+ * segundo site. Uma receita de headless sem versão é um palpite datado.
350
+ */
351
+ const version = deps?.[packageRoot(from)] ?? deps?.[from];
295
352
  if (!external.some((e) => e.from === from))
296
353
  external.push({ from, version });
297
354
  out.push({
@@ -300,6 +357,8 @@ sxSpacing) {
300
357
  ...(version ? { version } : {}),
301
358
  ...frontierClasses(node, sketch),
302
359
  ...frontierSx(node, sketch),
360
+ /** O que o sketch mediu naquele nó - o `continue` abaixo o pulava. */
361
+ ...measuredAt(node, sketch),
303
362
  ...holds,
304
363
  });
305
364
  continue;
@@ -309,40 +368,7 @@ sxSpacing) {
309
368
  * THE GUARD TRAVELS WITH THE NODE, off the sketch it points at - so neither a
310
369
  * reading nor the deriver has to carry it, and both get it.
311
370
  */
312
- if (typeof node.at === "number") {
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
- }
371
+ Object.assign(node_, measuredAt(node, sketch));
346
372
  /**
347
373
  * A PART THAT IS A LIBRARY ELEMENT CARRIES BOTH FACTS - see `AnatomyRead.from`.
348
374
  * Inert for the renderer, which dispatches on `as`; read by the usage snippet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.192",
3
+ "version": "0.16.194",
4
4
  "description": "Bring SynthesisUI design systems into any project - tokens, typed components, whole pages and an agent-ready CLAUDE.md manifest.",
5
5
  "type": "module",
6
6
  "bin": {