synthesisui 0.16.23 → 0.16.25
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/cn-codegen.js +31 -1
- package/dist/fonts.js +11 -1
- package/package.json +1 -1
package/dist/cn-codegen.js
CHANGED
|
@@ -104,9 +104,26 @@ const PREFIXES = [
|
|
|
104
104
|
"gap-x", "gap-y", "gap",
|
|
105
105
|
"w", "h", "min-w", "min-h", "max-w", "max-h",
|
|
106
106
|
"leading", "tracking",
|
|
107
|
-
"
|
|
107
|
+
"justify-items", "justify-self", "justify",
|
|
108
|
+
"items", "self", "order", "z",
|
|
108
109
|
];
|
|
109
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Utilities that set \`display\`. One group, so \`hidden\` can evict \`flex\` -
|
|
113
|
+
* and kept OUT of the prefix walk, because \`flex\` also heads whole families
|
|
114
|
+
* that set OTHER properties. Read as a prefix, \`flex-row\` evicted the \`flex\`
|
|
115
|
+
* that makes the box a flex container, and every Row and Stack in the project
|
|
116
|
+
* stacked its children in silence. Found by an agent in the field (test03,
|
|
117
|
+
* 29/07), diagnosed against computed output, fixed locally, and FILED - this
|
|
118
|
+
* is its fix, ported to the source so it stops evaporating on regeneration.
|
|
119
|
+
*/
|
|
120
|
+
const DISPLAYS = new Set([
|
|
121
|
+
"flex", "grid", "block", "inline", "inline-flex", "inline-grid",
|
|
122
|
+
"inline-block", "hidden", "contents", "flow-root", "table", "list-item",
|
|
123
|
+
]);
|
|
124
|
+
const FLEX_DIRECTIONS = new Set(["row", "col", "row-reverse", "col-reverse"]);
|
|
125
|
+
const FLEX_WRAPS = new Set(["wrap", "nowrap", "wrap-reverse"]);
|
|
126
|
+
|
|
110
127
|
/**
|
|
111
128
|
* The property this class sets, or the class itself when we cannot tell.
|
|
112
129
|
*
|
|
@@ -124,10 +141,23 @@ function groupOf(cls: string): string {
|
|
|
124
141
|
const negative = base.startsWith("-");
|
|
125
142
|
if (negative) base = base.slice(1);
|
|
126
143
|
|
|
144
|
+
if (DISPLAYS.has(base)) return \`\${variants}display\`;
|
|
145
|
+
|
|
127
146
|
const dash = base.indexOf("-");
|
|
128
147
|
const head = dash === -1 ? base : base.slice(0, dash);
|
|
129
148
|
const rest = dash === -1 ? "" : base.slice(dash + 1);
|
|
130
149
|
|
|
150
|
+
if (head === "flex") {
|
|
151
|
+
if (FLEX_DIRECTIONS.has(rest)) return \`\${variants}flex-direction\`;
|
|
152
|
+
if (FLEX_WRAPS.has(rest)) return \`\${variants}flex-wrap\`;
|
|
153
|
+
return \`\${variants}flex\`; // flex-1 / flex-auto / flex-none / flex-initial
|
|
154
|
+
}
|
|
155
|
+
if (head === "grid") {
|
|
156
|
+
// grid-cols-* / grid-rows-* / grid-flow-* each own their property.
|
|
157
|
+
const sub = rest.indexOf("-") === -1 ? rest : rest.slice(0, rest.indexOf("-"));
|
|
158
|
+
return \`\${variants}grid-\${sub}\`;
|
|
159
|
+
}
|
|
160
|
+
|
|
131
161
|
// The two families a prefix cannot settle, answered by this system's names.
|
|
132
162
|
if (head === "text") {
|
|
133
163
|
if (TEXT_SIZES.has(rest)) return \`\${variants}font-size\`;
|
package/dist/fonts.js
CHANGED
|
@@ -62,7 +62,17 @@ export function nextFontSnippet(families, slug, appDir = "app") {
|
|
|
62
62
|
if (!seen.has(name)) {
|
|
63
63
|
seen.set(name, role);
|
|
64
64
|
importNames.push(importName(name));
|
|
65
|
-
consts.push(`export const ${seen.get(name)} = ${importName(name)}({`, ` subsets: ["latin"],`,
|
|
65
|
+
consts.push(`export const ${seen.get(name)} = ${importName(name)}({`, ` subsets: ["latin"],`,
|
|
66
|
+
// WEIGHTS ARE ALWAYS SPELLED OUT, because next/font only allows
|
|
67
|
+
// omitting them for VARIABLE fonts - and plenty of Google families
|
|
68
|
+
// ship as static cuts (IBM Plex Mono, for one). The generated file
|
|
69
|
+
// assumed variable and broke the consumer's first `next build`; an
|
|
70
|
+
// agent caught it in the field (test03, 29/07) and had to repair our
|
|
71
|
+
// output by hand. Explicit weights are valid for BOTH kinds, so
|
|
72
|
+
// emitting them always can never break - and these three are the
|
|
73
|
+
// steps every generated system actually uses (regular/medium/
|
|
74
|
+
// semibold), so no static cut is downloaded for nothing.
|
|
75
|
+
` weight: ["400", "500", "600"],`, ` variable: "--font-ds-${seen.get(name)}",`, `});`);
|
|
66
76
|
}
|
|
67
77
|
}
|
|
68
78
|
const fontsFile = [
|
package/package.json
CHANGED