synthesisui 0.16.323 → 0.16.325

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.
@@ -52,6 +52,26 @@ const SVG_INTERNALS = new Set([
52
52
  "feblend",
53
53
  "animate",
54
54
  ]);
55
+ /**
56
+ * UMA TAG INTRÍNSECA, e não um componente com o mesmo nome.
57
+ *
58
+ * O QUE O CLIENTE GANHA: o `<Text>` da biblioteca dele chega à receita com as classes que ele
59
+ * escreveu, em vez de sumir por ter o nome de uma tag de SVG.
60
+ *
61
+ * O DEFEITO, medido em 27/08: as duas listas abaixo eram consultadas com `tag.toLowerCase()`, então
62
+ * `<Text>` virava `"text"` - que é geometria de SVG - e o nó era descartado INTEIRO, antes de a
63
+ * fronteira ser sequer consultada. No repositório dele são 383 nós capitalizados colidindo, 348
64
+ * deles com classes, em 94 componentes. E não é só `Text`: a lista tem `line`, `circle`, `path`,
65
+ * `mask`, `use`, `symbol`, `filter`, `animate` - todos nomes normais de componente, e `Line` do
66
+ * recharts já aparece lá.
67
+ *
68
+ * A DISTINÇÃO É NORMATIVA, não heurística: no JSX, um nome que começa com minúscula É a tag
69
+ * intrínseca e um que começa com maiúscula É uma referência a variável. `<text>` e `<Text>` são
70
+ * coisas diferentes pela especificação da linguagem, e o coletor já preserva a grafia. Por isso a
71
+ * pergunta não precisa de `from`: um `<Text>` declarado no próprio arquivo, sem pacote nenhum,
72
+ * também não é a tag `<text>`.
73
+ */
74
+ const intrinsic = (tag) => /^[a-z]/.test(tag);
55
75
  /** Not a visual node at all: a script or style island, and `<head>` furniture. */
56
76
  const NOT_VISUAL = new Set(["style", "script", "noscript", "template", "head"]);
57
77
  /**
@@ -332,15 +352,17 @@ versionOf) {
332
352
  * holding a box (probe, 02/08).
333
353
  */
334
354
  const children = (kids[index] ?? []).filter((child) => {
335
- const tag = String(sketch[child]?.tag ?? "").toLowerCase();
355
+ const tag = String(sketch[child]?.tag ?? "");
356
+ if (!intrinsic(tag))
357
+ return true;
336
358
  return !SVG_INTERNALS.has(tag) && !NOT_VISUAL.has(tag);
337
359
  });
338
- if (NOT_VISUAL.has(lower)) {
360
+ if (intrinsic(tag) && NOT_VISUAL.has(lower)) {
339
361
  notes.push(`\`<${tag}>\` is a ${lower} island - its rules are real and this contract has no form that holds them`);
340
362
  return [];
341
363
  }
342
364
  // An svg's insides are geometry: the glyph is the node, and it stops here.
343
- if (SVG_INTERNALS.has(lower))
365
+ if (intrinsic(tag) && SVG_INTERNALS.has(lower))
344
366
  return [];
345
367
  const capitalised = /^[A-Z]/.test(tag);
346
368
  const kind = capitalised
@@ -343,8 +343,16 @@ export const CHECKER_SINCE = "0.16.308";
343
343
  * NÃO se moveu, e isso é a informação: os 21 apps dourados têm um componente por arquivo, então a
344
344
  * estabilidade ali prova ausência de regressão e não ausência de efeito. Quem tem dois componentes
345
345
  * num arquivo só vê a correção depois de remedir.
346
+ *
347
+ * 0.16.322 -> 0.16.324 em 27/08: o nome de um componente deixa de ser confundido com uma tag de
348
+ * SVG. `"Text".toLowerCase()` é `"text"`, que é geometria interna de SVG, e o nó era descartado
349
+ * INTEIRO - antes de a fronteira ser consultada. Medido no repositório do dono: 383 nós
350
+ * capitalizados colidiam, 348 deles com classes, em 94 componentes; depois da correção 228 nós
351
+ * ganham endereço e 50 componentes fecham. O hash do corpus NÃO se moveu, e isso é a informação:
352
+ * nenhum dos 22 apps dourados tem componente com nome de tag de SVG. Quem tem só vê a correção
353
+ * depois de remedir.
346
354
  */
347
- export const READER_SINCE = "0.16.322";
355
+ export const READER_SINCE = "0.16.324";
348
356
  /**
349
357
  * O QUE ESTÁ INSTALADO AQUI FICOU PARA TRÁS - e as DUAS condições que fazem isso ser verdade.
350
358
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "synthesisui",
3
- "version": "0.16.323",
3
+ "version": "0.16.325",
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": {