synthesisui 0.16.493 → 0.16.494
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/install-marks.js +1 -1
- package/dist/their-tongue.js +27 -1
- package/package.json +1 -1
package/dist/install-marks.js
CHANGED
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
* 0.16.492 -> 0.16.493 em 06/10, e o passo 1 dá **SIM** ("a galeria aprende", E02): o `init` declara as durações do
|
|
329
329
|
* sistema no @theme (`--duration-fast`), e o blueprint as escreve pelo nome. Um componente escrito antes traz `100ms`.
|
|
330
330
|
*/
|
|
331
|
-
export const MATERIALISER_SINCE = "0.16.
|
|
331
|
+
export const MATERIALISER_SINCE = "0.16.494";
|
|
332
332
|
/**
|
|
333
333
|
* A ÚLTIMA VERSÃO EM QUE O QUE O HOOK RODA MUDOU.
|
|
334
334
|
*
|
package/dist/their-tongue.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FAMILY_SEAM_PREFIX } from "./fonts.js";
|
|
1
2
|
/** `var(--ds-x)` e `var(--ds-x, fallback)` - o que a folha compilada escreve. */
|
|
2
3
|
const OUR_VAR = /var\(\s*(--ds-[a-zA-Z0-9_-]+)\s*(?:,([^()]*))?\)/g;
|
|
3
4
|
/**
|
|
@@ -24,6 +25,30 @@ export function sumSpoken(reports) {
|
|
|
24
25
|
left: [...left].sort(),
|
|
25
26
|
};
|
|
26
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* A FAMÍLIA PASSA PELA FONTE QUE O `add` CARREGOU - ele, 14/10, no teste com um agente do zero: o template saía com
|
|
30
|
+
* `font-family: "Instrument Serif"`, e o `next/font` do `fonts.ts` registra a fonte com um nome interno dele. Os dois não
|
|
31
|
+
* se encontravam: o agente apagou o `fonts.ts` e trocou o layout por um `<link>` do Google.
|
|
32
|
+
*
|
|
33
|
+
* A variável é DELE - o `fonts.ts` que o `add` escreveu declara `variable: "--font-ds-<papel>"`, e o layout a põe no
|
|
34
|
+
* `<body>`. Com ela ligada, a seção usa a fonte que o `next/font` baixou; sem ela, cai no nome, como antes. Dois papéis
|
|
35
|
+
* com a mesma família viram UMA const no `fonts.ts` (a do primeiro), então a cadeia passa por todos os papéis que dividem
|
|
36
|
+
* a família: a variável que existir vence.
|
|
37
|
+
*/
|
|
38
|
+
const FAMILY = FAMILY_SEAM_PREFIX;
|
|
39
|
+
const firstOf = (stack) => (stack.split(",")[0] ?? "").trim().replace(/^["']|["']$/g, "").toLowerCase();
|
|
40
|
+
function viaNextFont(name, value, tongue) {
|
|
41
|
+
if (!name.startsWith(FAMILY))
|
|
42
|
+
return null;
|
|
43
|
+
const family = firstOf(value);
|
|
44
|
+
if (!family)
|
|
45
|
+
return null;
|
|
46
|
+
const roles = [name.slice(FAMILY.length)];
|
|
47
|
+
for (const [other, v] of tongue.values)
|
|
48
|
+
if (other !== name && other.startsWith(FAMILY) && firstOf(v) === family)
|
|
49
|
+
roles.push(other.slice(FAMILY.length));
|
|
50
|
+
return roles.reduceRight((inner, role) => `var(--font-ds-${role}, ${inner})`, value);
|
|
51
|
+
}
|
|
27
52
|
export function inTheirTongue(css, tongue, destination = "stylesheet") {
|
|
28
53
|
let named = 0;
|
|
29
54
|
let inlined = 0;
|
|
@@ -46,7 +71,8 @@ export function inTheirTongue(css, tongue, destination = "stylesheet") {
|
|
|
46
71
|
inlined += 1;
|
|
47
72
|
if (tongue.frozen.has(name))
|
|
48
73
|
froze += 1;
|
|
49
|
-
|
|
74
|
+
const font = destination === "stylesheet" ? viaNextFont(name, value, tongue) : null;
|
|
75
|
+
return write(font ?? value);
|
|
50
76
|
}
|
|
51
77
|
/**
|
|
52
78
|
* O FALLBACK ESCRITO NA PRÓPRIA REFERÊNCIA É A ÚLTIMA RESPOSTA, e ela é do autor do texto.
|
package/package.json
CHANGED