synthesisui 0.16.386 → 0.16.388
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/commands/add.js +2 -2
- package/dist/commands/component.js +62 -18
- package/dist/commands/generate.js +5 -2
- package/dist/commands/refit.js +4 -1
- package/dist/commands/upgrade.js +10 -2
- package/dist/component-codegen.js +39 -2
- package/dist/install-marks.js +1 -1
- package/dist/tailwind-theme-vars.js +453 -0
- package/dist/their-theme.js +35 -1
- package/dist/their-tongue.js +27 -2
- package/package.json +1 -1
package/dist/commands/add.js
CHANGED
|
@@ -551,7 +551,7 @@ export async function add(slug, opts) {
|
|
|
551
551
|
* A linha diz quantos utilitários do Tailwind ficaram apontando para a decisão dele e quantos
|
|
552
552
|
* saíram por serem nossos, com os primeiros nomes. Quem lê pode discordar de qualquer um.
|
|
553
553
|
*/
|
|
554
|
-
if (aligned.dropped.length > 0) {
|
|
554
|
+
if (aligned.dropped.length > 0 || aligned.own.length > 0) {
|
|
555
555
|
console.log(line(
|
|
556
556
|
/**
|
|
557
557
|
* A LINHA DIZ QUE FICARAM DE FORA - e nao AFIRMA por que, porque ela nao sabe.
|
|
@@ -570,7 +570,7 @@ export async function add(slug, opts) {
|
|
|
570
570
|
* Entao a linha diz o FATO que ela tem - a classe dele continua significando o que
|
|
571
571
|
* significa - e nomeia os primeiros, para quem quiser discordar de qualquer um.
|
|
572
572
|
*/
|
|
573
|
-
` ${aligned.kept} Tailwind utilit${aligned.kept === 1 ? "y" : "ies"} now point at your own decisions
|
|
573
|
+
` ${aligned.kept} Tailwind utilit${aligned.kept === 1 ? "y" : "ies"} now point at your own decisions${aligned.own.length > 0 ? `; ${aligned.own.length} more name${aligned.own.length === 1 ? "s a utility" : " utilities"} only this system has (${aligned.own.slice(0, 3).join(", ")}${aligned.own.length > 3 ? ", …" : ""}), so they are declared here` : ""}${aligned.dropped.length > 0 ? `; ${aligned.dropped.length} were left as ${aligned.dropped.length === 1 ? "it is" : "they are"} (${aligned.dropped.slice(0, 3).join(", ")}${aligned.dropped.length > 3 ? ", …" : ""}) - your classes keep meaning what they mean today` : ""}.`));
|
|
574
574
|
}
|
|
575
575
|
/**
|
|
576
576
|
* O CICLO RECUSADO É DITO, e não engolido - senão o cliente lê um número menor sem saber por quê.
|
|
@@ -9,7 +9,7 @@ import { body, section, snippet } from "../output.js";
|
|
|
9
9
|
import { findCollision, reactMajorOf, readInstalledConvention, readInstalledScheme, } from "../project-facts.js";
|
|
10
10
|
import { fetchComponent, RegistryError } from "../registry.js";
|
|
11
11
|
import { flavourResolver } from "../styles-flavour.js";
|
|
12
|
-
import { inTheirTongue, projectTongue } from "../their-tongue.js";
|
|
12
|
+
import { inTheirTongue, projectTongue, sumSpoken, } from "../their-tongue.js";
|
|
13
13
|
import { readCensus, unreadComment, unreadForComponent, } from "../unread-for-component.js";
|
|
14
14
|
import { recordWritten } from "../written.js";
|
|
15
15
|
/**
|
|
@@ -100,27 +100,26 @@ export async function component(slug, name, opts) {
|
|
|
100
100
|
* continua sendo o caminho - o comando DIZ qual dos dois aconteceu.
|
|
101
101
|
*/
|
|
102
102
|
const tongue = await projectTongue(root, slug);
|
|
103
|
-
const spoken = tongue ? inTheirTongue(res.css, tongue) : null;
|
|
104
|
-
const css = spoken ? spoken.css : res.css;
|
|
105
103
|
/**
|
|
106
|
-
*
|
|
104
|
+
* O RELATÓRIO SÓ EXISTE DEPOIS DE OS BYTES EXISTIREM - e é essa ordem que corrige o defeito.
|
|
107
105
|
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
106
|
+
* Ele era calculado aqui, sobre `res.css`, e impresso ANTES da materialização. Num projeto
|
|
107
|
+
* tailwind o CSS não vai a disco: a frase falava de um arquivo inexistente enquanto o `.tsx`
|
|
108
|
+
* escrito apontava 45 vezes para a nossa folha (medido no `button` do codelevel, 07/09). Agora
|
|
109
|
+
* cada caminho de escrita preenche esta variável com a tradução DAQUELES arquivos, e a mensagem
|
|
110
|
+
* sai no fim - depois da linha que nomeia o que foi escrito.
|
|
111
111
|
*/
|
|
112
|
-
|
|
113
|
-
console.log(` ${spoken.named} reference${spoken.named === 1 ? "" : "s"} now speak${spoken.named === 1 ? "s" : ""} the name YOUR code gives the value${spoken.inlined > 0 ? `, and ${spoken.inlined} carr${spoken.inlined === 1 ? "ies" : "y"} the value because your code names no token for it` : ""}.`);
|
|
114
|
-
console.log(spoken.left.length === 0
|
|
115
|
-
? ` Nothing in this file points at our stylesheet - it renders on your own tokens alone.`
|
|
116
|
-
: ` ${spoken.left.length} still point${spoken.left.length === 1 ? "s" : ""} at our stylesheet (${spoken.left.slice(0, 3).join(", ")}${spoken.left.length > 3 ? ", …" : ""}), so tokens.css is still needed here.`);
|
|
117
|
-
}
|
|
112
|
+
let spoken = null;
|
|
118
113
|
const artifactsAreTheProduct = opts.artifactsOnly === true || config.target !== "next";
|
|
119
114
|
if (artifactsAreTheProduct) {
|
|
120
115
|
const dir = join(root, "_synthesisui", "ds", slug, "components");
|
|
121
116
|
await mkdir(dir, { recursive: true });
|
|
122
117
|
await writeFile(join(dir, `${res.name}.json`), `${JSON.stringify(res.recipe, null, 2)}\n`, "utf8");
|
|
123
|
-
|
|
118
|
+
/** A FOLHA TAMBÉM PASSA PELA PORTA - este caminho escreve sem o codegen. */
|
|
119
|
+
const sheet = tongue ? inTheirTongue(res.css, tongue) : null;
|
|
120
|
+
if (sheet)
|
|
121
|
+
spoken = sheet;
|
|
122
|
+
await writeFile(join(dir, `${res.name}.css`), `${sheet ? sheet.css : res.css}\n`, "utf8");
|
|
124
123
|
console.log(`✓ ${res.name} → _synthesisui/ds/${slug}/components/${res.name}.{json,css} (${slug} v${res.version})`);
|
|
125
124
|
}
|
|
126
125
|
// 2. YOUR component - a real, importable `export function <Pascal>()` in the
|
|
@@ -272,9 +271,23 @@ export async function component(slug, name, opts) {
|
|
|
272
271
|
// it wears (.css) + the barrel. Ignores the css|tailwind flavor - the
|
|
273
272
|
// template drives itself off the .ds-* classes.
|
|
274
273
|
const tsx = interactiveTemplate(res.name);
|
|
274
|
+
/**
|
|
275
|
+
* O TEMPLATE CURADO TAMBÉM FALA A LÍNGUA DELE - e como `stylesheet`.
|
|
276
|
+
*
|
|
277
|
+
* Ele escreve `transition: opacity var(--ds-motion-durations-base)` num `style` inline de
|
|
278
|
+
* JSX, onde o espaço é válido: pedir o escape do Tailwind aqui trocaria um valor correto por
|
|
279
|
+
* um inválido. O caminho interativo escreve sem o codegen, então a porta é chamada aqui.
|
|
280
|
+
*/
|
|
281
|
+
const say = (text) => tongue ? inTheirTongue(text, tongue, "stylesheet") : null;
|
|
282
|
+
const saidTsx = say(tsx);
|
|
283
|
+
const saidCss = say(res.css);
|
|
284
|
+
spoken = sumSpoken([saidTsx, saidCss]);
|
|
275
285
|
const written = [
|
|
276
|
-
{ filename: `${local}.tsx`, content: tsx },
|
|
277
|
-
{
|
|
286
|
+
{ filename: `${local}.tsx`, content: saidTsx ? saidTsx.css : tsx },
|
|
287
|
+
{
|
|
288
|
+
filename: `${local}.css`,
|
|
289
|
+
content: `${saidCss ? saidCss.css : res.css}\n`,
|
|
290
|
+
},
|
|
278
291
|
{ filename: "index.ts", content: `export * from "./${local}";\n` },
|
|
279
292
|
];
|
|
280
293
|
for (const f of written)
|
|
@@ -284,7 +297,7 @@ export async function component(slug, name, opts) {
|
|
|
284
297
|
filenames = written.map((f) => f.filename);
|
|
285
298
|
}
|
|
286
299
|
else {
|
|
287
|
-
const files = generateComponentFiles(slug, res.name, res.recipe, css, res.version, flavour, await reactMajorOf(root),
|
|
300
|
+
const { files, spoken: said } = generateComponentFiles(slug, res.name, res.recipe, res.css, res.version, flavour, await reactMajorOf(root),
|
|
288
301
|
/**
|
|
289
302
|
* THE SPELLING, FROM THE VERSION WE JUST FETCHED.
|
|
290
303
|
*
|
|
@@ -303,7 +316,8 @@ export async function component(slug, name, opts) {
|
|
|
303
316
|
* O ARQUIVO e o EXPORT levam o nome dele; a CLASSE continua sendo a do blueprint. Um
|
|
304
317
|
* `<CardPreview>` vestindo `.ds-card` está estilizado certo e não faz sombra em nada dele.
|
|
305
318
|
*/
|
|
306
|
-
local, await readInstalledScheme(root, slug));
|
|
319
|
+
local, await readInstalledScheme(root, slug), tongue);
|
|
320
|
+
spoken = said;
|
|
307
321
|
/**
|
|
308
322
|
* AS DECLARAÇÕES DO ARQUIVO DELE QUE O INTERPRETADOR NÃO LEU - ver `unread-for-component.ts`.
|
|
309
323
|
*
|
|
@@ -337,6 +351,19 @@ export async function component(slug, name, opts) {
|
|
|
337
351
|
else if (opts.interactive && !hasInteractiveTemplate(res.name)) {
|
|
338
352
|
console.log(` note: no interactive template for "${res.name}" - materialized the standard shell.`);
|
|
339
353
|
}
|
|
354
|
+
/**
|
|
355
|
+
* O RELATÓRIO DA TRADUÇÃO - agora sobre os arquivos que ACABARAM de ser nomeados acima.
|
|
356
|
+
*
|
|
357
|
+
* Um ponto só, depois de todo caminho de escrita (artefato, interativo, codegen), porque a
|
|
358
|
+
* pergunta é uma: o que foi escrito ainda precisa da nossa folha? Enquanto isto era calculado
|
|
359
|
+
* antes da materialização, a resposta descrevia outro arquivo.
|
|
360
|
+
*/
|
|
361
|
+
if (spoken && (spoken.named > 0 || spoken.inlined > 0)) {
|
|
362
|
+
console.log(` ${spoken.named} reference${spoken.named === 1 ? "" : "s"} now speak${spoken.named === 1 ? "s" : ""} the name YOUR code gives the value${spoken.inlined > 0 ? `, and ${spoken.inlined} carr${spoken.inlined === 1 ? "ies" : "y"} the value because your code names no token for it` : ""}.`);
|
|
363
|
+
console.log(spoken.left.length === 0
|
|
364
|
+
? ` No variable in what was just written points at our stylesheet - they are all names YOUR code declares.`
|
|
365
|
+
: ` ${spoken.left.length} still point${spoken.left.length === 1 ? "s" : ""} at our stylesheet (${spoken.left.slice(0, 3).join(", ")}${spoken.left.length > 3 ? ", …" : ""}), so tokens.css carries ${spoken.left.length === 1 ? "it" : "those"}.`);
|
|
366
|
+
}
|
|
340
367
|
// ── DX: concrete paths + copy-pasteable snippets, with breathing room ──
|
|
341
368
|
const tailwind = flavour === "tailwind";
|
|
342
369
|
const imports = tailwind
|
|
@@ -347,6 +374,23 @@ export async function component(slug, name, opts) {
|
|
|
347
374
|
]
|
|
348
375
|
: [`@import "../_synthesisui/ds/${slug}/tokens.css";`];
|
|
349
376
|
console.log(section(`One-time setup (once per app, for "${slug}")`));
|
|
377
|
+
/**
|
|
378
|
+
* POR QUE O SETUP CONTINUA AQUI QUANDO NENHUMA VARIÁVEL É NOSSA - e dizer isto é o conserto.
|
|
379
|
+
*
|
|
380
|
+
* A tentação era suprimir o bloco quando `left` é vazio, e ele leria como a promessa "seu
|
|
381
|
+
* repositório dispensa a folha". Medido no codelevel (07/09): as duas coisas são independentes.
|
|
382
|
+
* As VARIÁVEIS podem ser todas dele e o arquivo continua vestindo utilitários que só o adaptador
|
|
383
|
+
* do sistema gera (`rounded-3`, `gap-2xs`) e movimento que o `theme.css` declara referenciando
|
|
384
|
+
* `--ds-*`. Suprimir entregaria um componente sem raio e sem gap.
|
|
385
|
+
*
|
|
386
|
+
* Então o bloco não muda de tamanho: ele muda de MOTIVO. A linha abaixo diz qual das duas coisas
|
|
387
|
+
* a importação ainda serve, e ela é derivada, nunca fixa.
|
|
388
|
+
*/
|
|
389
|
+
if (spoken && spoken.left.length === 0) {
|
|
390
|
+
console.log(body(`(the variables are already yours - what these imports still bring is the`));
|
|
391
|
+
console.log(body(` system's own utilities and its motion, which the app has to generate)`));
|
|
392
|
+
console.log("");
|
|
393
|
+
}
|
|
350
394
|
console.log(body(`1. Import the design system in your GLOBAL stylesheet, e.g. app/globals.css`));
|
|
351
395
|
console.log(body(` (the path is relative to that file - hence the leading ../):`));
|
|
352
396
|
console.log("");
|
|
@@ -6,6 +6,7 @@ import { installedSlugs } from "../installed.js";
|
|
|
6
6
|
import { reactMajorOf, readInstalledConvention, readInstalledScheme, } from "../project-facts.js";
|
|
7
7
|
import { postGenerate, RegistryError } from "../registry.js";
|
|
8
8
|
import { flavourResolver } from "../styles-flavour.js";
|
|
9
|
+
import { projectTongue } from "../their-tongue.js";
|
|
9
10
|
import { recordWritten } from "../written.js";
|
|
10
11
|
/** PascalCase para o hint de import (course-card → CourseCard). */
|
|
11
12
|
function pascalName(name) {
|
|
@@ -69,10 +70,12 @@ export async function generate(description, opts) {
|
|
|
69
70
|
await mkdir(compDir, { recursive: true });
|
|
70
71
|
// A LÍNGUA DE CADA COMPONENTE, resolvida uma vez - ver `flavourResolver`.
|
|
71
72
|
const flavourOf = await flavourResolver(root, config.styles);
|
|
72
|
-
const files = generateComponentFiles(slug, res.name, res.recipe, res.css, version, flavourOf(res.name), await reactMajorOf(root),
|
|
73
|
+
const { files } = generateComponentFiles(slug, res.name, res.recipe, res.css, version, flavourOf(res.name), await reactMajorOf(root),
|
|
73
74
|
// Read off the installed document: a generated component lands in the same
|
|
74
75
|
// project as the stylesheet it has to match.
|
|
75
|
-
await readInstalledConvention(root, slug), res.name, await readInstalledScheme(root, slug)
|
|
76
|
+
await readInstalledConvention(root, slug), res.name, await readInstalledScheme(root, slug),
|
|
77
|
+
/** O VOCABULÁRIO DELE - um componente gerado cai no mesmo projeto e fala a mesma língua. */
|
|
78
|
+
await projectTongue(root, slug));
|
|
76
79
|
for (const file of files) {
|
|
77
80
|
await writeFile(join(compDir, file.filename), file.code, "utf8");
|
|
78
81
|
}
|
package/dist/commands/refit.js
CHANGED
|
@@ -7,6 +7,7 @@ import { body, section, snippet } from "../output.js";
|
|
|
7
7
|
import { reactMajorOf, readInstalledConvention, readInstalledScheme, } from "../project-facts.js";
|
|
8
8
|
import { fetchComponent, postRefit, postSaveComponent, RegistryError, } from "../registry.js";
|
|
9
9
|
import { flavourResolver } from "../styles-flavour.js";
|
|
10
|
+
import { projectTongue } from "../their-tongue.js";
|
|
10
11
|
import { recordWritten } from "../written.js";
|
|
11
12
|
/** Slugs INSTALLED under `_synthesisui/ds/` (a `.lock` marks a real install -
|
|
12
13
|
* a folder holding only refit artifacts doesn't count). */
|
|
@@ -118,7 +119,9 @@ export async function refit(file, opts) {
|
|
|
118
119
|
await mkdir(compDir, { recursive: true });
|
|
119
120
|
// A LÍNGUA DE CADA COMPONENTE, resolvida uma vez - ver `flavourResolver`.
|
|
120
121
|
const flavourOf = await flavourResolver(root, config.styles);
|
|
121
|
-
const files = generateComponentFiles(slug, res.name, res.recipe, res.css, saved.version, flavourOf(res.name), await reactMajorOf(root), await readInstalledConvention(root, slug), res.name, await readInstalledScheme(root, slug)
|
|
122
|
+
const { files } = generateComponentFiles(slug, res.name, res.recipe, res.css, saved.version, flavourOf(res.name), await reactMajorOf(root), await readInstalledConvention(root, slug), res.name, await readInstalledScheme(root, slug),
|
|
123
|
+
/** O VOCABULÁRIO DELE - o `refit` reescreve o componente e não passava pela porta. */
|
|
124
|
+
await projectTongue(root, slug));
|
|
122
125
|
for (const f of files) {
|
|
123
126
|
await writeFile(join(compDir, f.filename), f.code, "utf8");
|
|
124
127
|
}
|
package/dist/commands/upgrade.js
CHANGED
|
@@ -11,6 +11,7 @@ import { body, section, snippet } from "../output.js";
|
|
|
11
11
|
import { reactMajorOf, readInstalledConvention, readInstalledScheme, } from "../project-facts.js";
|
|
12
12
|
import { fetchChangelog, fetchComponent, fetchDesignSystem, RegistryError, } from "../registry.js";
|
|
13
13
|
import { flavourResolver } from "../styles-flavour.js";
|
|
14
|
+
import { projectTongue } from "../their-tongue.js";
|
|
14
15
|
import { readCensus, unreadComment, unreadForComponent, } from "../unread-for-component.js";
|
|
15
16
|
import { editedSinceWritten, keptLine, readWritten, recordWritten, } from "../written.js";
|
|
16
17
|
import { add } from "./add.js";
|
|
@@ -323,6 +324,13 @@ export async function upgrade(asked, opts) {
|
|
|
323
324
|
// componente: `upgrade` reescreve tudo que já está instalado, e reler o censo a cada
|
|
324
325
|
// arquivo seria a mesma resposta lida N vezes. Ver `flavourResolver`.
|
|
325
326
|
const flavourOf = await flavourResolver(root, config.styles);
|
|
327
|
+
/**
|
|
328
|
+
* O VOCABULÁRIO DELE, e este comando é o que mais precisava dele: `upgrade` REESCREVE
|
|
329
|
+
* componentes que a pessoa já tem, e ele não passava pela porta - então cada corrida DESFAZIA a
|
|
330
|
+
* tradução que o `component` tinha feito, devolvendo `var(--ds-*)` a arquivos que já falavam a
|
|
331
|
+
* língua do repositório. Resolvido uma vez para a corrida inteira, como o sabor.
|
|
332
|
+
*/
|
|
333
|
+
const tongue = await projectTongue(root, slug);
|
|
326
334
|
for (const entry of entries) {
|
|
327
335
|
const tsxPath = join(componentsRoot, entry, `${entry}.tsx`);
|
|
328
336
|
let head = "";
|
|
@@ -347,11 +355,11 @@ export async function upgrade(asked, opts) {
|
|
|
347
355
|
}
|
|
348
356
|
try {
|
|
349
357
|
const res = await fetchComponent(base, slug, entry);
|
|
350
|
-
const files = generateComponentFiles(slug, res.name, res.recipe, res.css, res.version, flavourOf(res.name),
|
|
358
|
+
const { files } = generateComponentFiles(slug, res.name, res.recipe, res.css, res.version, flavourOf(res.name),
|
|
351
359
|
// Both were missing here, and `upgrade` is the command that REWRITES
|
|
352
360
|
// components somebody already has: without the convention it would have
|
|
353
361
|
// taken a working component and stripped its styles.
|
|
354
|
-
await reactMajorOf(root), res.classNames ?? (await readInstalledConvention(root, slug)), res.name, await readInstalledScheme(root, slug));
|
|
362
|
+
await reactMajorOf(root), res.classNames ?? (await readInstalledConvention(root, slug)), res.name, await readInstalledScheme(root, slug), tongue);
|
|
355
363
|
/**
|
|
356
364
|
* A NOTA DAS DECLARAÇÕES NÃO INTERPRETADAS SOBREVIVE AO UPGRADE.
|
|
357
365
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { emittableAttrs } from "./attr-shape.js";
|
|
2
|
+
import { inTheirTongue, sumSpoken, } from "./their-tongue.js";
|
|
2
3
|
import { PHRASING_FORMS, } from "./types.js";
|
|
3
4
|
export const DEFAULT_CONVENTION = {
|
|
4
5
|
prefix: "ds-",
|
|
@@ -1384,7 +1385,20 @@ localName = name,
|
|
|
1384
1385
|
* without ever deciding, and an optional argument that can be forgotten is the
|
|
1385
1386
|
* shape this file has already been bitten by. `tsc` refuses the half-call instead.
|
|
1386
1387
|
*/
|
|
1387
|
-
scheme
|
|
1388
|
+
scheme,
|
|
1389
|
+
/**
|
|
1390
|
+
* O VOCABULÁRIO DESTE REPOSITÓRIO - `projectTongue(root, slug)`, ou `null` quando não há mapa.
|
|
1391
|
+
*
|
|
1392
|
+
* OBRIGATÓRIO, e é a única forma de fechar a porta (INV-VOLTA-02). A tradução morava em cada
|
|
1393
|
+
* comando: o `component` traduzia o CSS por fora e o `upgrade`, o `refit` e o `generate` não
|
|
1394
|
+
* traduziam nada - três dos cinco materializadores reescreviam o repositório dele com
|
|
1395
|
+
* `var(--ds-*)` cru, e o `upgrade` DESFAZIA a tradução que o `component` tinha feito. O gate lia
|
|
1396
|
+
* o texto do módulo e via a porta importada, então passava verde.
|
|
1397
|
+
*
|
|
1398
|
+
* Aqui a tradução acontece uma vez, sobre os bytes que vão a disco, e `tsc` recusa a meia-chamada
|
|
1399
|
+
* de um materializador novo - o mesmo argumento do `scheme` logo acima.
|
|
1400
|
+
*/
|
|
1401
|
+
tongue) {
|
|
1388
1402
|
const files = [];
|
|
1389
1403
|
const props = propsTypeName(reactMajor);
|
|
1390
1404
|
if (styles === "css") {
|
|
@@ -1404,5 +1418,28 @@ scheme) {
|
|
|
1404
1418
|
filename: "index.ts",
|
|
1405
1419
|
code: `export * from "./${localName}";\n`,
|
|
1406
1420
|
});
|
|
1407
|
-
return files;
|
|
1421
|
+
return speak(files, tongue, styles === "tailwind" ? "tailwind-class" : "stylesheet");
|
|
1422
|
+
}
|
|
1423
|
+
/**
|
|
1424
|
+
* A TRADUÇÃO, SOBRE OS BYTES, UMA VEZ - e o destino é de quem GEROU o texto, não da extensão.
|
|
1425
|
+
*
|
|
1426
|
+
* No modo tailwind toda referência nossa está DENTRO de um valor arbitrário (`arbitrary()` é o
|
|
1427
|
+
* único ponto do módulo que escreve `var(--ds-…)`, e ele sempre a envolve em `[prop:…]`), então um
|
|
1428
|
+
* gradiente inlined precisa de `_` no lugar do espaço ou a classe não é gerada. Numa folha, e num
|
|
1429
|
+
* `style` inline de JSX, o espaço é válido e `_` seria o defeito - por isso `interactive-templates`
|
|
1430
|
+
* (que escreve `transition: opacity var(--ds-…)`) chama a porta como `stylesheet`.
|
|
1431
|
+
*
|
|
1432
|
+
* `index.ts` é um re-export e não carrega estilo, mas passa pela mesma porta: um arquivo isento por
|
|
1433
|
+
* lista é a lista que alguém esquece de atualizar.
|
|
1434
|
+
*/
|
|
1435
|
+
function speak(files, tongue, tsxDestination) {
|
|
1436
|
+
if (!tongue)
|
|
1437
|
+
return { files, spoken: null };
|
|
1438
|
+
const reports = [];
|
|
1439
|
+
const said = files.map((file) => {
|
|
1440
|
+
const spoken = inTheirTongue(file.code, tongue, file.filename.endsWith(".css") ? "stylesheet" : tsxDestination);
|
|
1441
|
+
reports.push(spoken);
|
|
1442
|
+
return { filename: file.filename, code: spoken.css };
|
|
1443
|
+
});
|
|
1444
|
+
return { files: said, spoken: sumSpoken(reports) };
|
|
1408
1445
|
}
|
package/dist/install-marks.js
CHANGED
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
* O que o cliente ganha ao rodar `upgrade`: o agente dele no Codex passa a poder PERGUNTAR ao
|
|
171
171
|
* sistema, em vez de só receber as regras e adivinhar o resto.
|
|
172
172
|
*/
|
|
173
|
-
export const MATERIALISER_SINCE = "0.16.
|
|
173
|
+
export const MATERIALISER_SINCE = "0.16.388";
|
|
174
174
|
/**
|
|
175
175
|
* A ÚLTIMA VERSÃO EM QUE O QUE O HOOK RODA MUDOU.
|
|
176
176
|
*
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* O QUE O TAILWIND JÁ DECLARA - e por isso NÃO é uma referência pendurada.
|
|
3
|
+
*
|
|
4
|
+
* O QUE O CLIENTE PERCEBE SEM ISTO. A folha que ele instala o avisava sobre uma variável que
|
|
5
|
+
* funciona: *"--font-sans has no name in this system"*. Ela tem - o `@import "tailwindcss"` do
|
|
6
|
+
* projeto dele a declara, e a regra pinta certo. Um aviso falso no arquivo dele custa mais que
|
|
7
|
+
* aviso nenhum, e a tela de admin cobrava, pelo mesmo motivo, um trabalho que não existe.
|
|
8
|
+
*
|
|
9
|
+
* MEDIDO em 01/09 nos 26 sistemas de produção: 3 variáveis acusadas de penduradas, todas num
|
|
10
|
+
* sistema só - o `codelevel`, que é o único importado de um repositório real. Das três, DUAS
|
|
11
|
+
* (`--font-sans`, `--animate-spin`) são declaradas aqui. A terceira, `--tracking-tightest`, não é -
|
|
12
|
+
* e essa continua sendo apontada, porque ela é genuína: a escala do Tailwind vai até
|
|
13
|
+
* `--tracking-tighter`, e o degrau a mais é uma decisão da escala DELE.
|
|
14
|
+
*
|
|
15
|
+
* ─────────────────────────────────────────────────────────────────────────
|
|
16
|
+
* ESTA LISTA É DERIVADA DO PACOTE, NUNCA ESCRITA À MÃO - `tailwind-theme-vars.spec.ts` a compara
|
|
17
|
+
* com o `@theme` de `node_modules/tailwindcss/theme.css` e reprova quando as duas divergem. Uma
|
|
18
|
+
* lista curada envelheceria em silêncio na primeira versão nova do Tailwind, e o sintoma seria o
|
|
19
|
+
* defeito que ela existe para evitar: um aviso falso na folha do cliente.
|
|
20
|
+
*
|
|
21
|
+
* PROCEDÊNCIA: extraída de `tailwindcss@4.2.1`, 419 nomes. A versão fica em comentário e não em
|
|
22
|
+
* constante de propósito - o que importa é a lista BATER com o pacote instalado, e é isso que o
|
|
23
|
+
* spec compara. Uma constante de versão que só o teste lê é um símbolo que o produto não chama.
|
|
24
|
+
*
|
|
25
|
+
* POR QUE UMA LISTA E NÃO UM PREFIXO: `--tracking-tighter` e `--tracking-tightest` compartilham o
|
|
26
|
+
* prefixo e têm respostas OPOSTAS. É exatamente a distinção que decide, então o nome é o dado.
|
|
27
|
+
*
|
|
28
|
+
* O PRESSUPOSTO, dito em voz alta: o projeto de destino importa o Tailwind. Ele já é o pressuposto
|
|
29
|
+
* de todo o compilador - `CASCADE_LAYERS` são as quatro camadas que `@import "tailwindcss"`
|
|
30
|
+
* declara, e o `theme.css`/`shadcn.css` do payload existem para essa stack.
|
|
31
|
+
*/
|
|
32
|
+
/** Toda custom property que o `@theme` padrão do Tailwind declara, incluindo o bloco deprecated. */
|
|
33
|
+
export const TAILWIND_THEME_VARS = new Set([
|
|
34
|
+
"--animate-bounce",
|
|
35
|
+
"--animate-ping",
|
|
36
|
+
"--animate-pulse",
|
|
37
|
+
"--animate-spin",
|
|
38
|
+
"--aspect-video",
|
|
39
|
+
"--blur",
|
|
40
|
+
"--blur-2xl",
|
|
41
|
+
"--blur-3xl",
|
|
42
|
+
"--blur-lg",
|
|
43
|
+
"--blur-md",
|
|
44
|
+
"--blur-sm",
|
|
45
|
+
"--blur-xl",
|
|
46
|
+
"--blur-xs",
|
|
47
|
+
"--breakpoint-2xl",
|
|
48
|
+
"--breakpoint-lg",
|
|
49
|
+
"--breakpoint-md",
|
|
50
|
+
"--breakpoint-sm",
|
|
51
|
+
"--breakpoint-xl",
|
|
52
|
+
"--color-amber-100",
|
|
53
|
+
"--color-amber-200",
|
|
54
|
+
"--color-amber-300",
|
|
55
|
+
"--color-amber-400",
|
|
56
|
+
"--color-amber-50",
|
|
57
|
+
"--color-amber-500",
|
|
58
|
+
"--color-amber-600",
|
|
59
|
+
"--color-amber-700",
|
|
60
|
+
"--color-amber-800",
|
|
61
|
+
"--color-amber-900",
|
|
62
|
+
"--color-amber-950",
|
|
63
|
+
"--color-black",
|
|
64
|
+
"--color-blue-100",
|
|
65
|
+
"--color-blue-200",
|
|
66
|
+
"--color-blue-300",
|
|
67
|
+
"--color-blue-400",
|
|
68
|
+
"--color-blue-50",
|
|
69
|
+
"--color-blue-500",
|
|
70
|
+
"--color-blue-600",
|
|
71
|
+
"--color-blue-700",
|
|
72
|
+
"--color-blue-800",
|
|
73
|
+
"--color-blue-900",
|
|
74
|
+
"--color-blue-950",
|
|
75
|
+
"--color-cyan-100",
|
|
76
|
+
"--color-cyan-200",
|
|
77
|
+
"--color-cyan-300",
|
|
78
|
+
"--color-cyan-400",
|
|
79
|
+
"--color-cyan-50",
|
|
80
|
+
"--color-cyan-500",
|
|
81
|
+
"--color-cyan-600",
|
|
82
|
+
"--color-cyan-700",
|
|
83
|
+
"--color-cyan-800",
|
|
84
|
+
"--color-cyan-900",
|
|
85
|
+
"--color-cyan-950",
|
|
86
|
+
"--color-emerald-100",
|
|
87
|
+
"--color-emerald-200",
|
|
88
|
+
"--color-emerald-300",
|
|
89
|
+
"--color-emerald-400",
|
|
90
|
+
"--color-emerald-50",
|
|
91
|
+
"--color-emerald-500",
|
|
92
|
+
"--color-emerald-600",
|
|
93
|
+
"--color-emerald-700",
|
|
94
|
+
"--color-emerald-800",
|
|
95
|
+
"--color-emerald-900",
|
|
96
|
+
"--color-emerald-950",
|
|
97
|
+
"--color-fuchsia-100",
|
|
98
|
+
"--color-fuchsia-200",
|
|
99
|
+
"--color-fuchsia-300",
|
|
100
|
+
"--color-fuchsia-400",
|
|
101
|
+
"--color-fuchsia-50",
|
|
102
|
+
"--color-fuchsia-500",
|
|
103
|
+
"--color-fuchsia-600",
|
|
104
|
+
"--color-fuchsia-700",
|
|
105
|
+
"--color-fuchsia-800",
|
|
106
|
+
"--color-fuchsia-900",
|
|
107
|
+
"--color-fuchsia-950",
|
|
108
|
+
"--color-gray-100",
|
|
109
|
+
"--color-gray-200",
|
|
110
|
+
"--color-gray-300",
|
|
111
|
+
"--color-gray-400",
|
|
112
|
+
"--color-gray-50",
|
|
113
|
+
"--color-gray-500",
|
|
114
|
+
"--color-gray-600",
|
|
115
|
+
"--color-gray-700",
|
|
116
|
+
"--color-gray-800",
|
|
117
|
+
"--color-gray-900",
|
|
118
|
+
"--color-gray-950",
|
|
119
|
+
"--color-green-100",
|
|
120
|
+
"--color-green-200",
|
|
121
|
+
"--color-green-300",
|
|
122
|
+
"--color-green-400",
|
|
123
|
+
"--color-green-50",
|
|
124
|
+
"--color-green-500",
|
|
125
|
+
"--color-green-600",
|
|
126
|
+
"--color-green-700",
|
|
127
|
+
"--color-green-800",
|
|
128
|
+
"--color-green-900",
|
|
129
|
+
"--color-green-950",
|
|
130
|
+
"--color-indigo-100",
|
|
131
|
+
"--color-indigo-200",
|
|
132
|
+
"--color-indigo-300",
|
|
133
|
+
"--color-indigo-400",
|
|
134
|
+
"--color-indigo-50",
|
|
135
|
+
"--color-indigo-500",
|
|
136
|
+
"--color-indigo-600",
|
|
137
|
+
"--color-indigo-700",
|
|
138
|
+
"--color-indigo-800",
|
|
139
|
+
"--color-indigo-900",
|
|
140
|
+
"--color-indigo-950",
|
|
141
|
+
"--color-lime-100",
|
|
142
|
+
"--color-lime-200",
|
|
143
|
+
"--color-lime-300",
|
|
144
|
+
"--color-lime-400",
|
|
145
|
+
"--color-lime-50",
|
|
146
|
+
"--color-lime-500",
|
|
147
|
+
"--color-lime-600",
|
|
148
|
+
"--color-lime-700",
|
|
149
|
+
"--color-lime-800",
|
|
150
|
+
"--color-lime-900",
|
|
151
|
+
"--color-lime-950",
|
|
152
|
+
"--color-mauve-100",
|
|
153
|
+
"--color-mauve-200",
|
|
154
|
+
"--color-mauve-300",
|
|
155
|
+
"--color-mauve-400",
|
|
156
|
+
"--color-mauve-50",
|
|
157
|
+
"--color-mauve-500",
|
|
158
|
+
"--color-mauve-600",
|
|
159
|
+
"--color-mauve-700",
|
|
160
|
+
"--color-mauve-800",
|
|
161
|
+
"--color-mauve-900",
|
|
162
|
+
"--color-mauve-950",
|
|
163
|
+
"--color-mist-100",
|
|
164
|
+
"--color-mist-200",
|
|
165
|
+
"--color-mist-300",
|
|
166
|
+
"--color-mist-400",
|
|
167
|
+
"--color-mist-50",
|
|
168
|
+
"--color-mist-500",
|
|
169
|
+
"--color-mist-600",
|
|
170
|
+
"--color-mist-700",
|
|
171
|
+
"--color-mist-800",
|
|
172
|
+
"--color-mist-900",
|
|
173
|
+
"--color-mist-950",
|
|
174
|
+
"--color-neutral-100",
|
|
175
|
+
"--color-neutral-200",
|
|
176
|
+
"--color-neutral-300",
|
|
177
|
+
"--color-neutral-400",
|
|
178
|
+
"--color-neutral-50",
|
|
179
|
+
"--color-neutral-500",
|
|
180
|
+
"--color-neutral-600",
|
|
181
|
+
"--color-neutral-700",
|
|
182
|
+
"--color-neutral-800",
|
|
183
|
+
"--color-neutral-900",
|
|
184
|
+
"--color-neutral-950",
|
|
185
|
+
"--color-olive-100",
|
|
186
|
+
"--color-olive-200",
|
|
187
|
+
"--color-olive-300",
|
|
188
|
+
"--color-olive-400",
|
|
189
|
+
"--color-olive-50",
|
|
190
|
+
"--color-olive-500",
|
|
191
|
+
"--color-olive-600",
|
|
192
|
+
"--color-olive-700",
|
|
193
|
+
"--color-olive-800",
|
|
194
|
+
"--color-olive-900",
|
|
195
|
+
"--color-olive-950",
|
|
196
|
+
"--color-orange-100",
|
|
197
|
+
"--color-orange-200",
|
|
198
|
+
"--color-orange-300",
|
|
199
|
+
"--color-orange-400",
|
|
200
|
+
"--color-orange-50",
|
|
201
|
+
"--color-orange-500",
|
|
202
|
+
"--color-orange-600",
|
|
203
|
+
"--color-orange-700",
|
|
204
|
+
"--color-orange-800",
|
|
205
|
+
"--color-orange-900",
|
|
206
|
+
"--color-orange-950",
|
|
207
|
+
"--color-pink-100",
|
|
208
|
+
"--color-pink-200",
|
|
209
|
+
"--color-pink-300",
|
|
210
|
+
"--color-pink-400",
|
|
211
|
+
"--color-pink-50",
|
|
212
|
+
"--color-pink-500",
|
|
213
|
+
"--color-pink-600",
|
|
214
|
+
"--color-pink-700",
|
|
215
|
+
"--color-pink-800",
|
|
216
|
+
"--color-pink-900",
|
|
217
|
+
"--color-pink-950",
|
|
218
|
+
"--color-purple-100",
|
|
219
|
+
"--color-purple-200",
|
|
220
|
+
"--color-purple-300",
|
|
221
|
+
"--color-purple-400",
|
|
222
|
+
"--color-purple-50",
|
|
223
|
+
"--color-purple-500",
|
|
224
|
+
"--color-purple-600",
|
|
225
|
+
"--color-purple-700",
|
|
226
|
+
"--color-purple-800",
|
|
227
|
+
"--color-purple-900",
|
|
228
|
+
"--color-purple-950",
|
|
229
|
+
"--color-red-100",
|
|
230
|
+
"--color-red-200",
|
|
231
|
+
"--color-red-300",
|
|
232
|
+
"--color-red-400",
|
|
233
|
+
"--color-red-50",
|
|
234
|
+
"--color-red-500",
|
|
235
|
+
"--color-red-600",
|
|
236
|
+
"--color-red-700",
|
|
237
|
+
"--color-red-800",
|
|
238
|
+
"--color-red-900",
|
|
239
|
+
"--color-red-950",
|
|
240
|
+
"--color-rose-100",
|
|
241
|
+
"--color-rose-200",
|
|
242
|
+
"--color-rose-300",
|
|
243
|
+
"--color-rose-400",
|
|
244
|
+
"--color-rose-50",
|
|
245
|
+
"--color-rose-500",
|
|
246
|
+
"--color-rose-600",
|
|
247
|
+
"--color-rose-700",
|
|
248
|
+
"--color-rose-800",
|
|
249
|
+
"--color-rose-900",
|
|
250
|
+
"--color-rose-950",
|
|
251
|
+
"--color-sky-100",
|
|
252
|
+
"--color-sky-200",
|
|
253
|
+
"--color-sky-300",
|
|
254
|
+
"--color-sky-400",
|
|
255
|
+
"--color-sky-50",
|
|
256
|
+
"--color-sky-500",
|
|
257
|
+
"--color-sky-600",
|
|
258
|
+
"--color-sky-700",
|
|
259
|
+
"--color-sky-800",
|
|
260
|
+
"--color-sky-900",
|
|
261
|
+
"--color-sky-950",
|
|
262
|
+
"--color-slate-100",
|
|
263
|
+
"--color-slate-200",
|
|
264
|
+
"--color-slate-300",
|
|
265
|
+
"--color-slate-400",
|
|
266
|
+
"--color-slate-50",
|
|
267
|
+
"--color-slate-500",
|
|
268
|
+
"--color-slate-600",
|
|
269
|
+
"--color-slate-700",
|
|
270
|
+
"--color-slate-800",
|
|
271
|
+
"--color-slate-900",
|
|
272
|
+
"--color-slate-950",
|
|
273
|
+
"--color-stone-100",
|
|
274
|
+
"--color-stone-200",
|
|
275
|
+
"--color-stone-300",
|
|
276
|
+
"--color-stone-400",
|
|
277
|
+
"--color-stone-50",
|
|
278
|
+
"--color-stone-500",
|
|
279
|
+
"--color-stone-600",
|
|
280
|
+
"--color-stone-700",
|
|
281
|
+
"--color-stone-800",
|
|
282
|
+
"--color-stone-900",
|
|
283
|
+
"--color-stone-950",
|
|
284
|
+
"--color-taupe-100",
|
|
285
|
+
"--color-taupe-200",
|
|
286
|
+
"--color-taupe-300",
|
|
287
|
+
"--color-taupe-400",
|
|
288
|
+
"--color-taupe-50",
|
|
289
|
+
"--color-taupe-500",
|
|
290
|
+
"--color-taupe-600",
|
|
291
|
+
"--color-taupe-700",
|
|
292
|
+
"--color-taupe-800",
|
|
293
|
+
"--color-taupe-900",
|
|
294
|
+
"--color-taupe-950",
|
|
295
|
+
"--color-teal-100",
|
|
296
|
+
"--color-teal-200",
|
|
297
|
+
"--color-teal-300",
|
|
298
|
+
"--color-teal-400",
|
|
299
|
+
"--color-teal-50",
|
|
300
|
+
"--color-teal-500",
|
|
301
|
+
"--color-teal-600",
|
|
302
|
+
"--color-teal-700",
|
|
303
|
+
"--color-teal-800",
|
|
304
|
+
"--color-teal-900",
|
|
305
|
+
"--color-teal-950",
|
|
306
|
+
"--color-violet-100",
|
|
307
|
+
"--color-violet-200",
|
|
308
|
+
"--color-violet-300",
|
|
309
|
+
"--color-violet-400",
|
|
310
|
+
"--color-violet-50",
|
|
311
|
+
"--color-violet-500",
|
|
312
|
+
"--color-violet-600",
|
|
313
|
+
"--color-violet-700",
|
|
314
|
+
"--color-violet-800",
|
|
315
|
+
"--color-violet-900",
|
|
316
|
+
"--color-violet-950",
|
|
317
|
+
"--color-white",
|
|
318
|
+
"--color-yellow-100",
|
|
319
|
+
"--color-yellow-200",
|
|
320
|
+
"--color-yellow-300",
|
|
321
|
+
"--color-yellow-400",
|
|
322
|
+
"--color-yellow-50",
|
|
323
|
+
"--color-yellow-500",
|
|
324
|
+
"--color-yellow-600",
|
|
325
|
+
"--color-yellow-700",
|
|
326
|
+
"--color-yellow-800",
|
|
327
|
+
"--color-yellow-900",
|
|
328
|
+
"--color-yellow-950",
|
|
329
|
+
"--color-zinc-100",
|
|
330
|
+
"--color-zinc-200",
|
|
331
|
+
"--color-zinc-300",
|
|
332
|
+
"--color-zinc-400",
|
|
333
|
+
"--color-zinc-50",
|
|
334
|
+
"--color-zinc-500",
|
|
335
|
+
"--color-zinc-600",
|
|
336
|
+
"--color-zinc-700",
|
|
337
|
+
"--color-zinc-800",
|
|
338
|
+
"--color-zinc-900",
|
|
339
|
+
"--color-zinc-950",
|
|
340
|
+
"--container-2xl",
|
|
341
|
+
"--container-2xs",
|
|
342
|
+
"--container-3xl",
|
|
343
|
+
"--container-3xs",
|
|
344
|
+
"--container-4xl",
|
|
345
|
+
"--container-5xl",
|
|
346
|
+
"--container-6xl",
|
|
347
|
+
"--container-7xl",
|
|
348
|
+
"--container-lg",
|
|
349
|
+
"--container-md",
|
|
350
|
+
"--container-sm",
|
|
351
|
+
"--container-xl",
|
|
352
|
+
"--container-xs",
|
|
353
|
+
"--default-font-family",
|
|
354
|
+
"--default-font-feature-settings",
|
|
355
|
+
"--default-font-variation-settings",
|
|
356
|
+
"--default-mono-font-family",
|
|
357
|
+
"--default-mono-font-feature-settings",
|
|
358
|
+
"--default-mono-font-variation-settings",
|
|
359
|
+
"--default-transition-duration",
|
|
360
|
+
"--default-transition-timing-function",
|
|
361
|
+
"--drop-shadow",
|
|
362
|
+
"--drop-shadow-2xl",
|
|
363
|
+
"--drop-shadow-lg",
|
|
364
|
+
"--drop-shadow-md",
|
|
365
|
+
"--drop-shadow-sm",
|
|
366
|
+
"--drop-shadow-xl",
|
|
367
|
+
"--drop-shadow-xs",
|
|
368
|
+
"--ease-in",
|
|
369
|
+
"--ease-in-out",
|
|
370
|
+
"--ease-out",
|
|
371
|
+
"--font-mono",
|
|
372
|
+
"--font-sans",
|
|
373
|
+
"--font-serif",
|
|
374
|
+
"--font-weight-black",
|
|
375
|
+
"--font-weight-bold",
|
|
376
|
+
"--font-weight-extrabold",
|
|
377
|
+
"--font-weight-extralight",
|
|
378
|
+
"--font-weight-light",
|
|
379
|
+
"--font-weight-medium",
|
|
380
|
+
"--font-weight-normal",
|
|
381
|
+
"--font-weight-semibold",
|
|
382
|
+
"--font-weight-thin",
|
|
383
|
+
"--inset-shadow-2xs",
|
|
384
|
+
"--inset-shadow-sm",
|
|
385
|
+
"--inset-shadow-xs",
|
|
386
|
+
"--leading-loose",
|
|
387
|
+
"--leading-normal",
|
|
388
|
+
"--leading-relaxed",
|
|
389
|
+
"--leading-snug",
|
|
390
|
+
"--leading-tight",
|
|
391
|
+
"--max-width-prose",
|
|
392
|
+
"--perspective-distant",
|
|
393
|
+
"--perspective-dramatic",
|
|
394
|
+
"--perspective-midrange",
|
|
395
|
+
"--perspective-near",
|
|
396
|
+
"--perspective-normal",
|
|
397
|
+
"--radius",
|
|
398
|
+
"--radius-2xl",
|
|
399
|
+
"--radius-3xl",
|
|
400
|
+
"--radius-4xl",
|
|
401
|
+
"--radius-lg",
|
|
402
|
+
"--radius-md",
|
|
403
|
+
"--radius-sm",
|
|
404
|
+
"--radius-xl",
|
|
405
|
+
"--radius-xs",
|
|
406
|
+
"--shadow",
|
|
407
|
+
"--shadow-2xl",
|
|
408
|
+
"--shadow-2xs",
|
|
409
|
+
"--shadow-inner",
|
|
410
|
+
"--shadow-lg",
|
|
411
|
+
"--shadow-md",
|
|
412
|
+
"--shadow-sm",
|
|
413
|
+
"--shadow-xl",
|
|
414
|
+
"--shadow-xs",
|
|
415
|
+
"--spacing",
|
|
416
|
+
"--text-2xl",
|
|
417
|
+
"--text-2xl--line-height",
|
|
418
|
+
"--text-3xl",
|
|
419
|
+
"--text-3xl--line-height",
|
|
420
|
+
"--text-4xl",
|
|
421
|
+
"--text-4xl--line-height",
|
|
422
|
+
"--text-5xl",
|
|
423
|
+
"--text-5xl--line-height",
|
|
424
|
+
"--text-6xl",
|
|
425
|
+
"--text-6xl--line-height",
|
|
426
|
+
"--text-7xl",
|
|
427
|
+
"--text-7xl--line-height",
|
|
428
|
+
"--text-8xl",
|
|
429
|
+
"--text-8xl--line-height",
|
|
430
|
+
"--text-9xl",
|
|
431
|
+
"--text-9xl--line-height",
|
|
432
|
+
"--text-base",
|
|
433
|
+
"--text-base--line-height",
|
|
434
|
+
"--text-lg",
|
|
435
|
+
"--text-lg--line-height",
|
|
436
|
+
"--text-shadow-2xs",
|
|
437
|
+
"--text-shadow-lg",
|
|
438
|
+
"--text-shadow-md",
|
|
439
|
+
"--text-shadow-sm",
|
|
440
|
+
"--text-shadow-xs",
|
|
441
|
+
"--text-sm",
|
|
442
|
+
"--text-sm--line-height",
|
|
443
|
+
"--text-xl",
|
|
444
|
+
"--text-xl--line-height",
|
|
445
|
+
"--text-xs",
|
|
446
|
+
"--text-xs--line-height",
|
|
447
|
+
"--tracking-normal",
|
|
448
|
+
"--tracking-tight",
|
|
449
|
+
"--tracking-tighter",
|
|
450
|
+
"--tracking-wide",
|
|
451
|
+
"--tracking-wider",
|
|
452
|
+
"--tracking-widest",
|
|
453
|
+
]);
|
package/dist/their-theme.js
CHANGED
|
@@ -1,17 +1,51 @@
|
|
|
1
|
+
import { TAILWIND_THEME_VARS } from "./tailwind-theme-vars.js";
|
|
1
2
|
/** `--radius-lg: var(--ds-radius-lg);` - uma redefinição de utilitário do Tailwind pelo nosso token. */
|
|
2
3
|
const ALIGNMENT = /^([ \t]*)(--[a-zA-Z0-9-]+)(\s*:\s*)var\(\s*(--ds-[a-zA-Z0-9-]+)\s*\)\s*;[ \t]*\n?/gm;
|
|
3
4
|
export function onlyWhatMatched(css,
|
|
4
5
|
/** Os nossos tokens que casaram com um nome do código dele - ver `PointedAt.pairs`. */
|
|
5
6
|
matched) {
|
|
6
7
|
let kept = 0;
|
|
8
|
+
const own = [];
|
|
7
9
|
const dropped = [];
|
|
8
10
|
const out = css.replace(ALIGNMENT, (whole, _indent, tailwind, _sep, ours) => {
|
|
9
11
|
if (matched.has(ours)) {
|
|
10
12
|
kept += 1;
|
|
11
13
|
return whole;
|
|
12
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* NÃO HÁ CLASSE DELE PARA PROTEGER QUANDO O NOME É NOSSO - e sem esta linha o utilitário
|
|
17
|
+
* simplesmente não existe.
|
|
18
|
+
*
|
|
19
|
+
* A pergunta que este arquivo faz precisa ser *"esta redefinição ROUBA o significado de uma
|
|
20
|
+
* classe que o app dele já usa?"*, e a resposta está no `@theme` padrão do Tailwind. Para
|
|
21
|
+
* `--radius-xl` ela é sim: `rounded-xl` vale 12px no código dele e a nossa folha o faria
|
|
22
|
+
* valer 28px - o defeito de 23/08, e a exigência do casamento continua valendo ali.
|
|
23
|
+
*
|
|
24
|
+
* Para `--spacing-2xs`, `--color-canvas` ou `--shadow-glow` a resposta é NÃO: o Tailwind não
|
|
25
|
+
* declara nenhum dos três, então não existe classe dele com esse nome e nada é roubado. O que
|
|
26
|
+
* a remoção fazia era apagar a ÚNICA declaração que podia gerar o utilitário - e o Tailwind
|
|
27
|
+
* v4 só gera a partir de `@theme`, nunca das variáveis que o `tokens.css` re-emite dentro de
|
|
28
|
+
* `[data-ds]`.
|
|
29
|
+
*
|
|
30
|
+
* MEDIDO em 07/09, nas duas populações, com o Tailwind 4.3.3 de verdade:
|
|
31
|
+
*
|
|
32
|
+
* codelevel 74 removidas = 24 que colidem + 50 que só existem no sistema
|
|
33
|
+
* ember, app novo 64 removidas = 19 que colidem + 45 que só existem no sistema
|
|
34
|
+
*
|
|
35
|
+
* E o efeito na tela: das 23 classes utilitárias do `button` do ember, 11 dependiam de uma
|
|
36
|
+
* linha removida, e 10 delas NÃO eram geradas - o botão chegava sem padding, sem gap, sem cor
|
|
37
|
+
* de texto, sem sombra e sem a família de fonte.
|
|
38
|
+
*
|
|
39
|
+
* A LISTA É DERIVADA DO PACOTE e vem do gêmeo `tailwind-theme-vars.ts`; um nome que o
|
|
40
|
+
* Tailwind passe a declarar numa versão futura é divergência que o spec do lado do web
|
|
41
|
+
* reprova, e não silêncio.
|
|
42
|
+
*/
|
|
43
|
+
if (!TAILWIND_THEME_VARS.has(tailwind)) {
|
|
44
|
+
own.push(tailwind);
|
|
45
|
+
return whole;
|
|
46
|
+
}
|
|
13
47
|
dropped.push(tailwind);
|
|
14
48
|
return "";
|
|
15
49
|
});
|
|
16
|
-
return { css: out, kept, dropped: dropped.sort() };
|
|
50
|
+
return { css: out, kept, own: own.sort(), dropped: dropped.sort() };
|
|
17
51
|
}
|
package/dist/their-tongue.js
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
/** `var(--ds-x)` e `var(--ds-x, fallback)` - o que a folha compilada escreve. */
|
|
2
2
|
const OUR_VAR = /var\(\s*(--ds-[a-zA-Z0-9_-]+)\s*(?:,([^()]*))?\)/g;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* VÁRIOS ARQUIVOS, UM NÚMERO - porque a promessa é sobre a MATERIALIZAÇÃO, não sobre um arquivo.
|
|
5
|
+
*
|
|
6
|
+
* Um componente sai como `.tsx` + `.css` + barrel, e dizer "nada aponta para a nossa folha" só é
|
|
7
|
+
* verdade quando nenhum dos três aponta. Somar aqui, e não em cada comando, é o que impede duas
|
|
8
|
+
* contas diferentes para a mesma pergunta.
|
|
9
|
+
*
|
|
10
|
+
* `null` quando nada foi traduzido (projeto sem mapa) - e aí quem chama DIZ isso.
|
|
11
|
+
*/
|
|
12
|
+
export function sumSpoken(reports) {
|
|
13
|
+
const real = reports.filter((r) => r !== null);
|
|
14
|
+
if (real.length === 0)
|
|
15
|
+
return null;
|
|
16
|
+
const left = new Set();
|
|
17
|
+
for (const r of real)
|
|
18
|
+
for (const name of r.left)
|
|
19
|
+
left.add(name);
|
|
20
|
+
return {
|
|
21
|
+
named: real.reduce((n, r) => n + r.named, 0),
|
|
22
|
+
inlined: real.reduce((n, r) => n + r.inlined, 0),
|
|
23
|
+
left: [...left].sort(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function inTheirTongue(css, tongue, destination = "stylesheet") {
|
|
4
27
|
let named = 0;
|
|
5
28
|
let inlined = 0;
|
|
6
29
|
const left = new Set();
|
|
@@ -18,7 +41,9 @@ export function inTheirTongue(css, tongue) {
|
|
|
18
41
|
const value = tongue.values.get(name);
|
|
19
42
|
if (value) {
|
|
20
43
|
inlined += 1;
|
|
21
|
-
return
|
|
44
|
+
return destination === "tailwind-class"
|
|
45
|
+
? value.replace(/\s+/g, "_")
|
|
46
|
+
: value;
|
|
22
47
|
}
|
|
23
48
|
left.add(name);
|
|
24
49
|
return fallback ? whole : whole;
|
package/package.json
CHANGED