synthesisui 0.16.316 → 0.16.317
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/doctor.js +3 -1
- package/dist/fonts.js +14 -2
- package/dist/guide.js +4 -3
- package/dist/their-vars.js +3 -1
- package/package.json +1 -1
package/dist/commands/add.js
CHANGED
|
@@ -581,7 +581,7 @@ export async function add(slug, opts) {
|
|
|
581
581
|
const families = payload.document.foundations.typography.families;
|
|
582
582
|
const fontsHref = googleFontsHref(families);
|
|
583
583
|
const nextFonts = projectConfig.target === "next"
|
|
584
|
-
? nextFontSnippet(families, payload.slug, appDir)
|
|
584
|
+
? nextFontSnippet(families, payload.slug, appDir, payload.fontSeam)
|
|
585
585
|
: null;
|
|
586
586
|
if (nextFonts) {
|
|
587
587
|
/**
|
|
@@ -603,7 +603,7 @@ export async function add(slug, opts) {
|
|
|
603
603
|
continue;
|
|
604
604
|
if (!(await exists(join(projectRoot, ...dir.split("/")))))
|
|
605
605
|
continue;
|
|
606
|
-
const snippet = nextFontSnippet(families, payload.slug, dir);
|
|
606
|
+
const snippet = nextFontSnippet(families, payload.slug, dir, payload.fontSeam);
|
|
607
607
|
if (!snippet)
|
|
608
608
|
continue;
|
|
609
609
|
const header = [
|
package/dist/commands/doctor.js
CHANGED
|
@@ -16,6 +16,7 @@ import { diagnose, nameToWrite, scanSource, siblingTokens, } from "../doctor/sca
|
|
|
16
16
|
import { findSelfConflicts, forbiddenProps, isReset, propMatchesLabel, } from "../doctor/self-conflict.js";
|
|
17
17
|
import { withTheirNames } from "../doctor/their-names.js";
|
|
18
18
|
import { buildTable, EMPTY_TABLE, nearestToken, } from "../doctor/tokens.js";
|
|
19
|
+
import { FAMILY_SEAM_PREFIX } from "../fonts.js";
|
|
19
20
|
import { groupRole } from "../group-role.js";
|
|
20
21
|
import { actingSlug, describeScope, measuredScope, scopePaths, } from "../measured-scope.js";
|
|
21
22
|
import { body, paint, section, snippet } from "../output.js";
|
|
@@ -554,7 +555,8 @@ async function readWiring(root, slug) {
|
|
|
554
555
|
// default face (my-test2, 27/07). What the checker checks is what gets done.
|
|
555
556
|
if (src.includes("--font-ds-") && /next\/font/.test(src))
|
|
556
557
|
w.fontsWritten = true;
|
|
557
|
-
|
|
558
|
+
/** O prefixo vem da const única da costura - um literal aqui divergiria em silêncio (26/08). */
|
|
559
|
+
if (new RegExp(`${FAMILY_SEAM_PREFIX}\\w+\\s*:\\s*var\\(\\s*--font-ds-`).test(src))
|
|
558
560
|
w.fontsMapped = true;
|
|
559
561
|
// The bridge joins the early exit, otherwise the walk can stop before the
|
|
560
562
|
// stylesheet that imports it and report a wired project as unbridged.
|
package/dist/fonts.js
CHANGED
|
@@ -81,7 +81,19 @@ export function googleFontsHref(families) {
|
|
|
81
81
|
* `<link href="fonts.googleapis.com...">` stays as the framework-agnostic
|
|
82
82
|
* fallback - it works everywhere but swaps visibly on cold loads.
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
/**
|
|
85
|
+
* O PREFIXO DO FALLBACK, exportado para o twin: quando o payload não traz a costura (`fontSeam`),
|
|
86
|
+
* o bloco é composto com este prefixo - e o twin-drift assere que ele é o MESMO que a plataforma
|
|
87
|
+
* batiza em `fontSeamOf`. Payload novo dispensa a convenção: o dado vence.
|
|
88
|
+
*/
|
|
89
|
+
export const FAMILY_SEAM_PREFIX = "--ds-typography-families-";
|
|
90
|
+
export function nextFontSnippet(families, slug, appDir = "app",
|
|
91
|
+
/**
|
|
92
|
+
* A COSTURA SERVIDA PELO PAYLOAD (papel → nome do token no tokens.css) - ver `fontSeam` em
|
|
93
|
+
* `types.ts`. Presente, o bloco de mapa fala os nomes que o ARTEFATO declara, por construção;
|
|
94
|
+
* ausente (payload antigo), a composição por convenção continua valendo.
|
|
95
|
+
*/
|
|
96
|
+
seam) {
|
|
85
97
|
/** Toda vaga que o documento tem, não só as nossas três - ver `customFontFamilies`. */
|
|
86
98
|
const roles = familySlots(families).filter((role) => {
|
|
87
99
|
const name = firstFamily(families[role] ?? "");
|
|
@@ -128,7 +140,7 @@ export function nextFontSnippet(families, slug, appDir = "app") {
|
|
|
128
140
|
const css = [
|
|
129
141
|
`/* ${appDir}/globals.css - AFTER the tokens.css import */`,
|
|
130
142
|
`[data-ds="${slug}"] {`,
|
|
131
|
-
...roles.map((role) => `
|
|
143
|
+
...roles.map((role) => ` ${seam?.[role] ?? `${FAMILY_SEAM_PREFIX}${role}`}: var(${roleVar(role)});`),
|
|
132
144
|
`}`,
|
|
133
145
|
];
|
|
134
146
|
return { fontsFile, layout, css };
|
package/dist/guide.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* famílias que o código dele declara, as três deixaram de carregar a fonte ao mesmo tempo. Este
|
|
7
7
|
* arquivo já importava `nextFontSnippet` do mesmo módulo; a cópia não tinha razão de existir.
|
|
8
8
|
*/
|
|
9
|
-
import { customFontFamilies, familySlots, nextFontSnippet } from "./fonts.js";
|
|
9
|
+
import { customFontFamilies, FAMILY_SEAM_PREFIX, familySlots, nextFontSnippet, } from "./fonts.js";
|
|
10
10
|
import { animationShorthand, classifyKeyframe, describeKeyframe, isFullRotation, } from "./motion.js";
|
|
11
11
|
const kebab = (v) => v.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
12
12
|
/**
|
|
@@ -280,7 +280,8 @@ export function buildGuide(payload) {
|
|
|
280
280
|
.map((n) => `family=${n.replace(/ /g, "+")}:wght@400;500;600;700`)
|
|
281
281
|
.join("&")}&display=swap`
|
|
282
282
|
: null;
|
|
283
|
-
|
|
283
|
+
/** A costura vem do payload quando o servidor a fala - o dado vence a convenção (T18-par). */
|
|
284
|
+
const nextFonts = nextFontSnippet(foundations.typography.families, slug, undefined, payload.fontSeam);
|
|
284
285
|
const fontsSection = fontsHref
|
|
285
286
|
? `
|
|
286
287
|
## Fonts
|
|
@@ -696,7 +697,7 @@ ${hasTailwind
|
|
|
696
697
|
- Radius → \`var(--ds-radius-<key>)\`: ${list(Object.keys(foundations.radius))}.
|
|
697
698
|
- Shadow → \`var(--ds-shadow-<key>)\`: ${list(Object.keys(foundations.shadow))}.
|
|
698
699
|
- Typography: families ${familySlots(foundations.typography.families)
|
|
699
|
-
.map((slot) =>
|
|
700
|
+
.map((slot) => `\`${payload.fontSeam?.[slot] ?? `${FAMILY_SEAM_PREFIX}${slot}`}\` (${foundations.typography.families[slot]})`)
|
|
700
701
|
.join(", ")};
|
|
701
702
|
weights${hasTailwind ? " (utility: `font-<key>`)" : ""}: ${list(weights)};
|
|
702
703
|
scale \`--ds-typography-scale-<key>-font-size\`${hasTailwind ? " (utility: `text-<key>`)" : ""}: ${list(Object.keys(foundations.typography.scale))}.
|
package/dist/their-vars.js
CHANGED
|
@@ -2,6 +2,7 @@ import { readdir, readFile } from "node:fs/promises";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { theirNames } from "./doctor/their-names.js";
|
|
4
4
|
import { buildTable, normalizeValue, } from "./doctor/tokens.js";
|
|
5
|
+
import { FAMILY_SEAM_PREFIX } from "./fonts.js";
|
|
5
6
|
/**
|
|
6
7
|
* A FOLHA APONTA PARA O NOME QUE O CÓDIGO DELE JÁ DÁ AO VALOR.
|
|
7
8
|
*
|
|
@@ -136,7 +137,8 @@ export function pointAtTheirNames(css, theirs, resolvable) {
|
|
|
136
137
|
const FAMILY_KIND = {
|
|
137
138
|
"--ds-color-": "color",
|
|
138
139
|
"--ds-shadow-": "shadow",
|
|
139
|
-
|
|
140
|
+
/** A const única da costura - um literal aqui seria o stray que a varredura de 26/08 caçou. */
|
|
141
|
+
[FAMILY_SEAM_PREFIX]: "font",
|
|
140
142
|
"--ds-motion-durations-": "motion",
|
|
141
143
|
"--ds-motion-easings-": "motion",
|
|
142
144
|
};
|
package/package.json
CHANGED