synthesisui 0.16.489 → 0.16.490
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/mcp.js +1 -1
- package/dist/doctor/transcribe.js +53 -6
- package/dist/preferences.js +18 -3
- package/package.json +1 -1
package/dist/commands/mcp.js
CHANGED
|
@@ -1947,7 +1947,7 @@ cli) {
|
|
|
1947
1947
|
const section = args.section;
|
|
1948
1948
|
if (section !== undefined && (kind !== "landing" || !isSection(section)))
|
|
1949
1949
|
return fromContract(`section goes with kind landing and is one of ${SECTIONS.join(", ")} - for any other part, call with the kind alone.`);
|
|
1950
|
-
const prefs = await fetchPreferences({ base: resolveRegistry(), token }, kind, section);
|
|
1950
|
+
const prefs = await fetchPreferences({ base: resolveRegistry(), token }, kind, section, await installedSlug(root));
|
|
1951
1951
|
if ("failed" in prefs)
|
|
1952
1952
|
return fromContract(`Their preferences could not be read: ${prefs.failed}. Build with the system as usual and say so in one line.`);
|
|
1953
1953
|
return preferencesAnswer(kind, prefs, await readSelection(root), await readOff(root));
|
|
@@ -2719,12 +2719,59 @@ export function rootClasses(source, name) {
|
|
|
2719
2719
|
const own = ownClassNameExpr(tag);
|
|
2720
2720
|
if (own == null)
|
|
2721
2721
|
return [];
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2722
|
+
/**
|
|
2723
|
+
* O TEXTO FIXO DE UM TEMPLATE TAMBÉM É CLASSE ESCRITA - dono, 04/10 18:28Z, no PASS com a conta zerada: o botão do
|
|
2724
|
+
* projeto importado chegou sem centralizar e de canto reto. O `Button.tsx` dele escreve
|
|
2725
|
+
*
|
|
2726
|
+
* className={`inline-flex items-center justify-center gap-2 rounded-pill font-medium ${variants[variant]} ${sizes[size]} ${className}`}
|
|
2727
|
+
*
|
|
2728
|
+
* e esta função pulava template inteiro ("a class we cannot see in full"). Só que o texto FORA do `${}` se vê
|
|
2729
|
+
* inteiro: o que não se vê é a classe COLADA numa interpolação (`p-${n}`, `${tone}-500`). Então entram as classes
|
|
2730
|
+
* inteiras do texto fixo, e a colada continua de fora. O que vem DENTRO de `${}` é cálculo (o mapa da variante, uma
|
|
2731
|
+
* condição) e não é lido daqui - as variantes têm o leitor delas.
|
|
2732
|
+
*/
|
|
2733
|
+
const fromTemplates = [];
|
|
2734
|
+
const outside = own.replace(/`(?:\\[\s\S]|\$\{(?:[^{}]|\{[^{}]*\})*\}|[^`\\])*`/g, (lit) => {
|
|
2735
|
+
fromTemplates.push(...templateStatics(lit.slice(1, -1)));
|
|
2736
|
+
return " ";
|
|
2737
|
+
});
|
|
2738
|
+
// Every string literal inside the className expression - outside a template.
|
|
2739
|
+
return [
|
|
2740
|
+
...[...outside.matchAll(/["']([^"']+)["']/g)].flatMap((m) => m[1].split(/\s+/)),
|
|
2741
|
+
...fromTemplates,
|
|
2742
|
+
].filter((c) => c.length > 0 && !c.includes("${"));
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* As classes INTEIRAS do texto fixo de um template: cada `${...}` vira uma marca, e a classe que encosta nela (sem
|
|
2746
|
+
* espaço no meio) sai - ela só existe completa depois do cálculo.
|
|
2747
|
+
*/
|
|
2748
|
+
export function templateStatics(body) {
|
|
2749
|
+
let out = "";
|
|
2750
|
+
for (let i = 0; i < body.length; i++) {
|
|
2751
|
+
if (body[i] === "\\") {
|
|
2752
|
+
out += body[i + 1] ?? "";
|
|
2753
|
+
i++;
|
|
2754
|
+
continue;
|
|
2755
|
+
}
|
|
2756
|
+
if (body[i] === "$" && body[i + 1] === "{") {
|
|
2757
|
+
let depth = 0;
|
|
2758
|
+
let j = i + 1;
|
|
2759
|
+
for (; j < body.length; j++) {
|
|
2760
|
+
if (body[j] === "{")
|
|
2761
|
+
depth++;
|
|
2762
|
+
else if (body[j] === "}") {
|
|
2763
|
+
depth--;
|
|
2764
|
+
if (depth === 0)
|
|
2765
|
+
break;
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
out += "\u0000";
|
|
2769
|
+
i = j;
|
|
2770
|
+
continue;
|
|
2771
|
+
}
|
|
2772
|
+
out += body[i];
|
|
2773
|
+
}
|
|
2774
|
+
return out.split(/\s+/).filter((c) => c.length > 0 && !c.includes("\u0000"));
|
|
2728
2775
|
}
|
|
2729
2776
|
/**
|
|
2730
2777
|
* A EXPRESSÃO do `className` que é atributo DIRETO desta tag de abertura, ou `null`.
|
package/dist/preferences.js
CHANGED
|
@@ -95,8 +95,17 @@ export function chosen(all, selection) {
|
|
|
95
95
|
const want = new Set(selection.map((s) => s.toLowerCase()));
|
|
96
96
|
return all.filter((b) => want.has(b.name.toLowerCase()) || want.has(b.id.toLowerCase()));
|
|
97
97
|
}
|
|
98
|
-
export async function fetchPreferences(reach, kind, section
|
|
99
|
-
|
|
98
|
+
export async function fetchPreferences(reach, kind, section,
|
|
99
|
+
/** O projeto instalado aqui - a estrutura que vale é a dele ("a alma da estrutura", 04/10). */
|
|
100
|
+
ds) {
|
|
101
|
+
const params = new URLSearchParams();
|
|
102
|
+
if (kind)
|
|
103
|
+
params.set("kind", kind);
|
|
104
|
+
if (kind && section)
|
|
105
|
+
params.set("section", section);
|
|
106
|
+
if (ds)
|
|
107
|
+
params.set("ds", ds);
|
|
108
|
+
const q = params.size ? `?${params}` : "";
|
|
100
109
|
const res = await fetch(`${reach.base}/api/preferences${q}`, {
|
|
101
110
|
headers: { Authorization: `Bearer ${reach.token}` },
|
|
102
111
|
}).catch(() => null);
|
|
@@ -180,9 +189,13 @@ function craftOf(kind, prefs) {
|
|
|
180
189
|
const lines = prefs.craft?.[kind] ?? [];
|
|
181
190
|
if (lines.length === 0)
|
|
182
191
|
return [];
|
|
192
|
+
// a estrutura só existe para a landing: é ela que o rhythm e o type abaixo trazem
|
|
193
|
+
const structure = kind === "landing" && prefs.structure
|
|
194
|
+
? ` with THIS project's structure, "${prefs.structure.name}"${prefs.structure.chosen ? "" : " (the default - they can pick another under Structure on the site)"}`
|
|
195
|
+
: "";
|
|
183
196
|
return [
|
|
184
197
|
"",
|
|
185
|
-
`HOW THIS PLATFORM BUILDS A ${kind.toUpperCase()} - the same rules its guide uses; their blueprint wins where the two disagree:`,
|
|
198
|
+
`HOW THIS PLATFORM BUILDS A ${kind.toUpperCase()}${structure} - the same rules its guide uses; their blueprint wins where the two disagree:`,
|
|
186
199
|
...lines.map((l) => `- ${l}`),
|
|
187
200
|
];
|
|
188
201
|
}
|
|
@@ -213,6 +226,8 @@ off = false) {
|
|
|
213
226
|
return composed([
|
|
214
227
|
...sectionOf(prefs),
|
|
215
228
|
`${why} Build the ${kind} with the system as usual, and tell them in one line that they can keep their ${kind} preferences under Memory -> Preference blueprints on the site.`,
|
|
229
|
+
// a estrutura do projeto vale com ou sem blueprint: ela é do projeto, não da pessoa
|
|
230
|
+
...craftOf(kind, prefs),
|
|
216
231
|
].join("\n"), `preferences:${kind}:0${prefs.section ? `:${prefs.section.name}` : ""}`);
|
|
217
232
|
}
|
|
218
233
|
return composed([
|
package/package.json
CHANGED