@tenphi/tasty 0.0.0-snapshot.fc88416 → 0.0.0-snapshot.fde6cf3
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/{astro-CeYENy2x.js → astro-Dj8YpRd7.js} +3 -3
- package/dist/{astro-CeYENy2x.js.map → astro-Dj8YpRd7.js.map} +1 -1
- package/dist/{babel-DWCsafYw.d.ts → babel-Cbp2C2bj.d.ts} +2 -2
- package/dist/{collector-BTVXj2hS.d.ts → collector-DBY6liC2.d.ts} +75 -10
- package/dist/{collector-B3OsM252.js → collector-NjmUiB8f.js} +224 -22
- package/dist/collector-NjmUiB8f.js.map +1 -0
- package/dist/{config-B3gPdCqd.js → config-Bd2vOF0Z.js} +268 -23
- package/dist/config-Bd2vOF0Z.js.map +1 -0
- package/dist/{config-LfIDmVHx.d.ts → config-CA7iAlEI.d.ts} +25 -2
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +5 -5
- package/dist/{core-DGm0CFHP.js → core-ClInK6YG.js} +231 -111
- package/dist/core-ClInK6YG.js.map +1 -0
- package/dist/{css-writer-Bgowobbx.js → css-writer-BDQXG9Jo.js} +3 -3
- package/dist/{css-writer-Bgowobbx.js.map → css-writer-BDQXG9Jo.js.map} +1 -1
- package/dist/{format-rules-XRw9u7d4.js → format-rules-CGhgoVLR.js} +22 -6
- package/dist/{format-rules-XRw9u7d4.js.map → format-rules-CGhgoVLR.js.map} +1 -1
- package/dist/{hydrate-CNOmZprz.js → hydrate-CqbxwVh_.js} +2 -2
- package/dist/{hydrate-CNOmZprz.js.map → hydrate-CqbxwVh_.js.map} +1 -1
- package/dist/{index-BmogEzTo.d.ts → index-C8RFYeFW.d.ts} +13 -1
- package/dist/{index-Bm9ltvdH.d.ts → index-FpYK0H5g.d.ts} +21 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +42 -26
- package/dist/index.js.map +1 -1
- package/dist/{keyframes-DE-OE76F.js → keyframes-BjfNVhaB.js} +2 -2
- package/dist/{keyframes-DE-OE76F.js.map → keyframes-BjfNVhaB.js.map} +1 -1
- package/dist/{merge-styles-BcLl1u_d.d.ts → merge-styles-BQv7d3fx.d.ts} +2 -2
- package/dist/{merge-styles-DuoZEsm9.js → merge-styles-BbJhjesV.js} +2 -2
- package/dist/{merge-styles-DuoZEsm9.js.map → merge-styles-BbJhjesV.js.map} +1 -1
- package/dist/precompile/index.d.ts +11 -0
- package/dist/precompile/index.js +72 -0
- package/dist/precompile/index.js.map +1 -0
- package/dist/precompile/register.d.ts +13 -0
- package/dist/precompile/register.js +2 -0
- package/dist/register-BkC-8Zuy.js +333 -0
- package/dist/register-BkC-8Zuy.js.map +1 -0
- package/dist/{resolve-recipes-H9NqOQuP.js → resolve-recipes-B2Sf36AH.js} +3 -3
- package/dist/{resolve-recipes-H9NqOQuP.js.map → resolve-recipes-B2Sf36AH.js.map} +1 -1
- package/dist/ssr/astro-client.js +1 -1
- package/dist/ssr/astro-middleware-extract-static.js +1 -1
- package/dist/ssr/astro-middleware-extract.js +1 -1
- package/dist/ssr/astro-middleware-static.js +1 -1
- package/dist/ssr/astro-middleware.js +1 -1
- package/dist/ssr/astro.js +1 -1
- package/dist/ssr/index.d.ts +1 -1
- package/dist/ssr/index.js +2 -2
- package/dist/ssr/next-config.d.ts +1 -1
- package/dist/ssr/next-config.js +2 -2
- package/dist/ssr/next.d.ts +1 -1
- package/dist/ssr/next.js +3 -3
- package/dist/static/index.d.ts +2 -2
- package/dist/static/index.js +1 -1
- package/dist/types-Bo5ePLZh.d.ts +111 -0
- package/dist/zero/babel.d.ts +1 -1
- package/dist/zero/babel.js +4 -4
- package/dist/zero/index.d.ts +1 -1
- package/dist/zero/index.js +1 -1
- package/dist/zero/next.d.ts +1 -1
- package/docs/README.md +3 -1
- package/docs/debug.md +17 -19
- package/docs/precompile.md +202 -0
- package/docs/runtime-benchmarks.md +121 -175
- package/package.json +19 -6
- package/dist/collector-B3OsM252.js.map +0 -1
- package/dist/config-B3gPdCqd.js.map +0 -1
- package/dist/core-DGm0CFHP.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
1
|
+
import { $ as getRegisteredPrecompiledDependencies, Et as makeKeyframeName, Gt as formatFunctionRule, Nt as normalizePropertyDefinition, Ot as validateNamePrefix, Q as getPrecompiledRevision, R as renderStyles, Tt as makeCounterStyleName, a as getGlobalConfigTokens, at as formatCounterStyleRule, c as getGlobalFunctions, ct as fontFaceContentHash, f as getGlobalStyles, i as getEffectiveProperties, jt as getEffectiveDefinition, kt as hashString, lt as formatFontFaceRule, o as getGlobalCounterStyles, p as getNamePrefix, qt as parseFunctionName, s as getGlobalFontFaces, wt as makeClassName } from "./config-Bd2vOF0Z.js";
|
|
2
|
+
import { n as formatRulesWithStats, r as formatPropertyCSS } from "./format-rules-CGhgoVLR.js";
|
|
3
3
|
import { t as formatGlobalRules } from "./format-global-rules-DklyaXv-.js";
|
|
4
4
|
//#region src/ssr/collector.ts
|
|
5
5
|
/**
|
|
@@ -20,6 +20,7 @@ function artifactId(kind, key, css) {
|
|
|
20
20
|
}
|
|
21
21
|
var ServerStyleCollector = class {
|
|
22
22
|
chunks = /* @__PURE__ */ new Map();
|
|
23
|
+
chunkRuleCounts = /* @__PURE__ */ new Map();
|
|
23
24
|
cacheKeyToClassName = /* @__PURE__ */ new Map();
|
|
24
25
|
flushedKeys = /* @__PURE__ */ new Set();
|
|
25
26
|
propertyRules = /* @__PURE__ */ new Map();
|
|
@@ -40,6 +41,21 @@ var ServerStyleCollector = class {
|
|
|
40
41
|
counterStyleCounter = 0;
|
|
41
42
|
internalsCollected = false;
|
|
42
43
|
namePrefix;
|
|
44
|
+
artifactSources = /* @__PURE__ */ new Map();
|
|
45
|
+
precompiledChunks = /* @__PURE__ */ new Map();
|
|
46
|
+
precompiledProperties = /* @__PURE__ */ new Map();
|
|
47
|
+
precompiledKeyframes = /* @__PURE__ */ new Map();
|
|
48
|
+
precompiledFontFaces = /* @__PURE__ */ new Set();
|
|
49
|
+
precompiledCounterStyles = /* @__PURE__ */ new Map();
|
|
50
|
+
precompiledFunctions = /* @__PURE__ */ new Set();
|
|
51
|
+
precompiledRSCKeys = /* @__PURE__ */ new Set();
|
|
52
|
+
appliedPrecompiledRevision = -1;
|
|
53
|
+
externalProperties = /* @__PURE__ */ new Set();
|
|
54
|
+
externalKeyframes = /* @__PURE__ */ new Set();
|
|
55
|
+
externalFontFaces = /* @__PURE__ */ new Set();
|
|
56
|
+
externalCounterStyles = /* @__PURE__ */ new Set();
|
|
57
|
+
externalFunctions = /* @__PURE__ */ new Set();
|
|
58
|
+
precompileRecording = false;
|
|
43
59
|
/**
|
|
44
60
|
* @param namePrefix - Optional override for the configured prefix.
|
|
45
61
|
* Defaults to the value from `configure({ namePrefix })` (or `'t'`).
|
|
@@ -51,9 +67,63 @@ var ServerStyleCollector = class {
|
|
|
51
67
|
if (namePrefix !== void 0) validateNamePrefix(namePrefix);
|
|
52
68
|
this.namePrefix = namePrefix ?? getNamePrefix();
|
|
53
69
|
}
|
|
70
|
+
sourceKey(kind, key) {
|
|
71
|
+
return `${kind}\0${key}`;
|
|
72
|
+
}
|
|
73
|
+
setSource(kind, key, source) {
|
|
74
|
+
this.artifactSources.set(this.sourceKey(kind, key), source);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Pick up manifests registered after this collector was constructed.
|
|
78
|
+
*
|
|
79
|
+
* Deliberately not called from the constructor. Reading the registered
|
|
80
|
+
* dependencies is what validates the catalogs against the host's
|
|
81
|
+
* configuration, and registration is a side-effect import that routinely
|
|
82
|
+
* runs before the host's own `configure()` call — so a collector built in
|
|
83
|
+
* between would validate against defaults and permanently drop a catalog
|
|
84
|
+
* that matches once configuration is installed.
|
|
85
|
+
*
|
|
86
|
+
* Instead every method that consults an `external*` set calls this first, so
|
|
87
|
+
* the seed lands at whichever style-producing operation happens to come
|
|
88
|
+
* first. That gate belongs here rather than at the call sites: the standalone
|
|
89
|
+
* at-rule hooks (`useKeyframes`, `useCounterStyle`, `useFontFace`) go
|
|
90
|
+
* straight to `collect*` and never reach `collectInternals()`, so a catalog's
|
|
91
|
+
* standalone rule would otherwise be emitted a second time during SSR.
|
|
92
|
+
* After the first call this is an integer comparison.
|
|
93
|
+
*/
|
|
94
|
+
applyRegisteredPrecompiledDependencies() {
|
|
95
|
+
const revision = getPrecompiledRevision();
|
|
96
|
+
if (revision === this.appliedPrecompiledRevision) return;
|
|
97
|
+
this.appliedPrecompiledRevision = revision;
|
|
98
|
+
this.externalProperties.clear();
|
|
99
|
+
this.externalKeyframes.clear();
|
|
100
|
+
this.externalFontFaces.clear();
|
|
101
|
+
this.externalCounterStyles.clear();
|
|
102
|
+
this.externalFunctions.clear();
|
|
103
|
+
if (this.precompileRecording) return;
|
|
104
|
+
const dependencies = getRegisteredPrecompiledDependencies(this.namePrefix);
|
|
105
|
+
for (const item of dependencies.properties) this.externalProperties.add(item.name);
|
|
106
|
+
for (const item of dependencies.keyframes) this.externalKeyframes.add(item.contentKey);
|
|
107
|
+
for (const hash of dependencies.fontFaces) this.externalFontFaces.add(hash);
|
|
108
|
+
for (const item of dependencies.counterStyles) this.externalCounterStyles.add(item.name);
|
|
109
|
+
for (const name of dependencies.functions) this.externalFunctions.add(name);
|
|
110
|
+
}
|
|
54
111
|
generateClassName(cacheKey) {
|
|
55
112
|
return makeClassName(this.namePrefix, hashString(cacheKey));
|
|
56
113
|
}
|
|
114
|
+
/** @internal Enable build-time chunk lookup metadata collection. */
|
|
115
|
+
enablePrecompileRecording() {
|
|
116
|
+
this.precompileRecording = true;
|
|
117
|
+
this.externalProperties.clear();
|
|
118
|
+
this.externalKeyframes.clear();
|
|
119
|
+
this.externalFontFaces.clear();
|
|
120
|
+
this.externalCounterStyles.clear();
|
|
121
|
+
this.externalFunctions.clear();
|
|
122
|
+
}
|
|
123
|
+
/** @internal Whether this collector is producing a catalog artifact. */
|
|
124
|
+
isPrecompileRecording() {
|
|
125
|
+
return this.precompileRecording;
|
|
126
|
+
}
|
|
57
127
|
/**
|
|
58
128
|
* Collect internal @property rules and :root token defaults.
|
|
59
129
|
* Mirrors markStylesGenerated() from the client-side injector.
|
|
@@ -66,16 +136,24 @@ var ServerStyleCollector = class {
|
|
|
66
136
|
collectInternals() {
|
|
67
137
|
if (this.internalsCollected) return;
|
|
68
138
|
this.internalsCollected = true;
|
|
139
|
+
this.applyRegisteredPrecompiledDependencies();
|
|
69
140
|
for (const [token, definition] of Object.entries(getEffectiveProperties())) {
|
|
70
141
|
const css = formatPropertyCSS(token, definition);
|
|
71
|
-
if (css)
|
|
142
|
+
if (css) {
|
|
143
|
+
const effective = getEffectiveDefinition(token, definition);
|
|
144
|
+
this.collectProperty(`__prop:${token}`, css, {
|
|
145
|
+
source: "config",
|
|
146
|
+
cssName: effective.isValid ? effective.cssName : void 0,
|
|
147
|
+
normalizedDefinition: effective.isValid ? normalizePropertyDefinition(effective.definition) : void 0
|
|
148
|
+
});
|
|
149
|
+
}
|
|
72
150
|
}
|
|
73
151
|
const tokenStyles = getGlobalConfigTokens();
|
|
74
152
|
if (tokenStyles && Object.keys(tokenStyles).length > 0) {
|
|
75
153
|
const tokenRules = renderStyles(tokenStyles, ":root");
|
|
76
154
|
if (tokenRules.length > 0) {
|
|
77
155
|
const css = formatGlobalRules(tokenRules);
|
|
78
|
-
if (css) this.collectGlobalStyles("__global:tokens", css);
|
|
156
|
+
if (css) this.collectGlobalStyles("__global:tokens", css, false, { source: "config" });
|
|
79
157
|
}
|
|
80
158
|
}
|
|
81
159
|
const globalFF = getGlobalFontFaces();
|
|
@@ -84,18 +162,24 @@ var ServerStyleCollector = class {
|
|
|
84
162
|
for (const desc of descriptors) {
|
|
85
163
|
const hash = fontFaceContentHash(family, desc);
|
|
86
164
|
const css = formatFontFaceRule(family, desc);
|
|
87
|
-
this.collectFontFace(hash, css);
|
|
165
|
+
this.collectFontFace(hash, css, { source: "config" });
|
|
88
166
|
}
|
|
89
167
|
}
|
|
90
168
|
const globalCS = getGlobalCounterStyles();
|
|
91
169
|
if (globalCS) for (const [name, descriptors] of Object.entries(globalCS)) {
|
|
92
170
|
const css = formatCounterStyleRule(name, descriptors);
|
|
93
|
-
this.collectCounterStyle(name, css, {
|
|
171
|
+
this.collectCounterStyle(name, css, {
|
|
172
|
+
weak: true,
|
|
173
|
+
source: "config"
|
|
174
|
+
});
|
|
94
175
|
}
|
|
95
176
|
const globalFn = getGlobalFunctions();
|
|
96
177
|
if (globalFn) for (const [name, definition] of Object.entries(globalFn)) {
|
|
97
178
|
const css = formatFunctionRule(name, definition);
|
|
98
|
-
this.collectFunction(parseFunctionName(name), css, {
|
|
179
|
+
this.collectFunction(parseFunctionName(name), css, {
|
|
180
|
+
weak: true,
|
|
181
|
+
source: "config"
|
|
182
|
+
});
|
|
99
183
|
}
|
|
100
184
|
const globalStyles = getGlobalStyles();
|
|
101
185
|
if (globalStyles) {
|
|
@@ -103,7 +187,7 @@ var ServerStyleCollector = class {
|
|
|
103
187
|
const rules = renderStyles(styles, selector);
|
|
104
188
|
if (rules.length > 0) {
|
|
105
189
|
const css = formatGlobalRules(rules);
|
|
106
|
-
if (css) this.collectGlobalStyles(`__global:styles:${selector}`, css);
|
|
190
|
+
if (css) this.collectGlobalStyles(`__global:styles:${selector}`, css, false, { source: "config" });
|
|
107
191
|
}
|
|
108
192
|
}
|
|
109
193
|
}
|
|
@@ -131,20 +215,59 @@ var ServerStyleCollector = class {
|
|
|
131
215
|
*/
|
|
132
216
|
collectChunk(cacheKey, className, rules) {
|
|
133
217
|
if (this.chunks.has(cacheKey)) return;
|
|
134
|
-
const css =
|
|
135
|
-
if (css)
|
|
218
|
+
const { css, ruleCount } = formatRulesWithStats(rules, className);
|
|
219
|
+
if (css) {
|
|
220
|
+
this.chunks.set(cacheKey, css);
|
|
221
|
+
this.chunkRuleCounts.set(cacheKey, ruleCount);
|
|
222
|
+
this.setSource("chunk", cacheKey, "component");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/** Record the pre-render lookup key corresponding to a collected chunk. */
|
|
226
|
+
recordPrecompiledChunk(lookupKey, className, animations) {
|
|
227
|
+
if (!this.precompiledChunks.has(lookupKey)) this.precompiledChunks.set(lookupKey, {
|
|
228
|
+
lookupKey,
|
|
229
|
+
className,
|
|
230
|
+
animations: [...animations]
|
|
231
|
+
});
|
|
136
232
|
}
|
|
137
233
|
/**
|
|
138
234
|
* Record a @property rule. Deduplicated by name.
|
|
139
235
|
*/
|
|
140
|
-
collectProperty(name, css) {
|
|
141
|
-
|
|
236
|
+
collectProperty(name, css, options) {
|
|
237
|
+
this.applyRegisteredPrecompiledDependencies();
|
|
238
|
+
if (options?.cssName && this.externalProperties.has(options.cssName)) return;
|
|
239
|
+
if (!this.propertyRules.has(name)) {
|
|
240
|
+
this.propertyRules.set(name, css);
|
|
241
|
+
this.setSource("property", name, options?.source ?? "component");
|
|
242
|
+
} else if ((options?.source ?? "component") === "component") this.setSource("property", name, "component");
|
|
243
|
+
if ((options?.source ?? "component") === "component" && options?.cssName && options.normalizedDefinition !== void 0) {
|
|
244
|
+
this.precompiledProperties.set(options.cssName, {
|
|
245
|
+
name: options.cssName,
|
|
246
|
+
definition: options.normalizedDefinition
|
|
247
|
+
});
|
|
248
|
+
if (options.rscKey) this.precompiledRSCKeys.add(options.rscKey);
|
|
249
|
+
}
|
|
142
250
|
}
|
|
143
251
|
/**
|
|
144
252
|
* Record a @keyframes rule. Deduplicated by name.
|
|
145
253
|
*/
|
|
146
|
-
collectKeyframes(name, css) {
|
|
147
|
-
|
|
254
|
+
collectKeyframes(name, css, options) {
|
|
255
|
+
this.applyRegisteredPrecompiledDependencies();
|
|
256
|
+
if (options?.contentKey && this.externalKeyframes.has(options.contentKey)) return;
|
|
257
|
+
if (!this.keyframeRules.has(name)) {
|
|
258
|
+
this.keyframeRules.set(name, css);
|
|
259
|
+
this.setSource("keyframes", name, options?.source ?? "component");
|
|
260
|
+
} else if ((options?.source ?? "component") === "component") this.setSource("keyframes", name, "component");
|
|
261
|
+
if ((options?.source ?? "component") === "component" && options?.contentKey) {
|
|
262
|
+
const existing = this.precompiledKeyframes.get(options.contentKey);
|
|
263
|
+
const rscKeys = new Set(existing?.rscKeys ?? []);
|
|
264
|
+
for (const key of options.rscKeys ?? []) rscKeys.add(key);
|
|
265
|
+
this.precompiledKeyframes.set(options.contentKey, {
|
|
266
|
+
name,
|
|
267
|
+
contentKey: options.contentKey,
|
|
268
|
+
rscKeys: [...rscKeys]
|
|
269
|
+
});
|
|
270
|
+
}
|
|
148
271
|
}
|
|
149
272
|
/**
|
|
150
273
|
* Allocate a keyframe name for SSR. Uses provided name or generates one.
|
|
@@ -155,8 +278,17 @@ var ServerStyleCollector = class {
|
|
|
155
278
|
/**
|
|
156
279
|
* Record a @font-face rule. Deduplicated by key (content hash).
|
|
157
280
|
*/
|
|
158
|
-
collectFontFace(key, css) {
|
|
159
|
-
|
|
281
|
+
collectFontFace(key, css, options) {
|
|
282
|
+
this.applyRegisteredPrecompiledDependencies();
|
|
283
|
+
if (this.externalFontFaces.has(key)) return;
|
|
284
|
+
if (!this.fontFaceRules.has(key)) {
|
|
285
|
+
this.fontFaceRules.set(key, css);
|
|
286
|
+
this.setSource("font-face", key, options?.source ?? "component");
|
|
287
|
+
} else if ((options?.source ?? "component") === "component") this.setSource("font-face", key, "component");
|
|
288
|
+
if ((options?.source ?? "component") === "component") {
|
|
289
|
+
this.precompiledFontFaces.add(key);
|
|
290
|
+
this.precompiledRSCKeys.add(`__ff:${key}`);
|
|
291
|
+
}
|
|
160
292
|
}
|
|
161
293
|
/**
|
|
162
294
|
* Record a @counter-style rule. Deduplicated by name and overrides an
|
|
@@ -164,13 +296,33 @@ var ServerStyleCollector = class {
|
|
|
164
296
|
* definitions, which never clobber an existing rule.
|
|
165
297
|
*/
|
|
166
298
|
collectCounterStyle(name, css, options) {
|
|
299
|
+
this.applyRegisteredPrecompiledDependencies();
|
|
300
|
+
if (this.externalCounterStyles.has(name)) return;
|
|
301
|
+
const source = options?.source ?? "component";
|
|
167
302
|
const existing = this.counterStyleRules.get(name);
|
|
168
303
|
if (existing === void 0) {
|
|
169
304
|
this.counterStyleRules.set(name, css);
|
|
305
|
+
this.setSource("counter-style", name, source);
|
|
306
|
+
if (source === "component") this.precompiledCounterStyles.set(name, {
|
|
307
|
+
name,
|
|
308
|
+
rscKeys: [...options?.rscKeys ?? []]
|
|
309
|
+
});
|
|
170
310
|
return;
|
|
171
311
|
}
|
|
312
|
+
if (source === "component") {
|
|
313
|
+
this.precompiledCounterStyles.set(name, {
|
|
314
|
+
name,
|
|
315
|
+
rscKeys: [...options?.rscKeys ?? []]
|
|
316
|
+
});
|
|
317
|
+
if (existing === css) this.setSource("counter-style", name, "component");
|
|
318
|
+
}
|
|
172
319
|
if (options?.weak || existing === css) return;
|
|
173
320
|
this.counterStyleRules.set(name, css);
|
|
321
|
+
this.setSource("counter-style", name, source);
|
|
322
|
+
if (source === "component") this.precompiledCounterStyles.set(name, {
|
|
323
|
+
name,
|
|
324
|
+
rscKeys: [...options?.rscKeys ?? []]
|
|
325
|
+
});
|
|
174
326
|
this.flushedCounterStyleKeys.delete(name);
|
|
175
327
|
}
|
|
176
328
|
/**
|
|
@@ -179,13 +331,31 @@ var ServerStyleCollector = class {
|
|
|
179
331
|
* definitions, which never clobber an existing rule.
|
|
180
332
|
*/
|
|
181
333
|
collectFunction(name, css, options) {
|
|
334
|
+
this.applyRegisteredPrecompiledDependencies();
|
|
335
|
+
if (this.externalFunctions.has(name)) return;
|
|
336
|
+
const source = options?.source ?? "component";
|
|
182
337
|
const existing = this.functionRules.get(name);
|
|
183
338
|
if (existing === void 0) {
|
|
184
339
|
this.functionRules.set(name, css);
|
|
340
|
+
this.setSource("function", name, source);
|
|
341
|
+
if (source === "component") {
|
|
342
|
+
this.precompiledFunctions.add(name);
|
|
343
|
+
this.precompiledRSCKeys.add(`__func:${name}`);
|
|
344
|
+
}
|
|
185
345
|
return;
|
|
186
346
|
}
|
|
347
|
+
if (source === "component") {
|
|
348
|
+
this.precompiledFunctions.add(name);
|
|
349
|
+
this.precompiledRSCKeys.add(`__func:${name}`);
|
|
350
|
+
if (existing === css) this.setSource("function", name, "component");
|
|
351
|
+
}
|
|
187
352
|
if (options?.weak || existing === css) return;
|
|
188
353
|
this.functionRules.set(name, css);
|
|
354
|
+
this.setSource("function", name, source);
|
|
355
|
+
if (source === "component") {
|
|
356
|
+
this.precompiledFunctions.add(name);
|
|
357
|
+
this.precompiledRSCKeys.add(`__func:${name}`);
|
|
358
|
+
}
|
|
189
359
|
this.flushedFunctionKeys.delete(name);
|
|
190
360
|
}
|
|
191
361
|
/**
|
|
@@ -200,8 +370,11 @@ var ServerStyleCollector = class {
|
|
|
200
370
|
* Pass `replace` for slot-keyed entries (an explicit `id`), where the last
|
|
201
371
|
* write must win to match the client's update-tracking behavior.
|
|
202
372
|
*/
|
|
203
|
-
collectGlobalStyles(key, css, replace) {
|
|
204
|
-
if (replace || !this.globalStyles.has(key))
|
|
373
|
+
collectGlobalStyles(key, css, replace, options) {
|
|
374
|
+
if (replace || !this.globalStyles.has(key)) {
|
|
375
|
+
this.globalStyles.set(key, css);
|
|
376
|
+
this.setSource("global", key, options?.source ?? "global");
|
|
377
|
+
}
|
|
205
378
|
}
|
|
206
379
|
/**
|
|
207
380
|
* Record raw CSS text (from useRawCSS). Deduplicated by key.
|
|
@@ -209,8 +382,36 @@ var ServerStyleCollector = class {
|
|
|
209
382
|
* Pass `replace` for slot-keyed entries (an explicit `id`), where the last
|
|
210
383
|
* write must win to match the client's update-tracking behavior.
|
|
211
384
|
*/
|
|
212
|
-
collectRawCSS(key, css, replace) {
|
|
213
|
-
if (replace || !this.rawCSS.has(key))
|
|
385
|
+
collectRawCSS(key, css, replace, options) {
|
|
386
|
+
if (replace || !this.rawCSS.has(key)) {
|
|
387
|
+
this.rawCSS.set(key, css);
|
|
388
|
+
this.setSource("raw", key, options?.source ?? "global");
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
getPrecompiledChunks() {
|
|
392
|
+
return [...this.precompiledChunks.values()];
|
|
393
|
+
}
|
|
394
|
+
getPrecompiledDependencies() {
|
|
395
|
+
return {
|
|
396
|
+
properties: [...this.precompiledProperties.values()],
|
|
397
|
+
keyframes: [...this.precompiledKeyframes.values()],
|
|
398
|
+
fontFaces: [...this.precompiledFontFaces],
|
|
399
|
+
counterStyles: [...this.precompiledCounterStyles.values()],
|
|
400
|
+
functions: [...this.precompiledFunctions],
|
|
401
|
+
rscKeys: [...this.precompiledRSCKeys]
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
/** @internal Structural top-level rule count for component artifacts. */
|
|
405
|
+
getPrecompiledRuleCount() {
|
|
406
|
+
const isComponent = (kind, key) => (this.artifactSources.get(this.sourceKey(kind, key)) ?? "component") === "component";
|
|
407
|
+
let count = 0;
|
|
408
|
+
for (const key of this.propertyRules.keys()) if (isComponent("property", key)) count++;
|
|
409
|
+
for (const key of this.fontFaceRules.keys()) if (isComponent("font-face", key)) count++;
|
|
410
|
+
for (const key of this.counterStyleRules.keys()) if (isComponent("counter-style", key)) count++;
|
|
411
|
+
for (const key of this.functionRules.keys()) if (isComponent("function", key)) count++;
|
|
412
|
+
for (const key of this.chunks.keys()) if (isComponent("chunk", key)) count += this.chunkRuleCounts.get(key) ?? 0;
|
|
413
|
+
for (const key of this.keyframeRules.keys()) if (isComponent("keyframes", key)) count++;
|
|
414
|
+
return count;
|
|
214
415
|
}
|
|
215
416
|
/**
|
|
216
417
|
* Return the collected CSS as structured, ordered artifacts.
|
|
@@ -227,7 +428,8 @@ var ServerStyleCollector = class {
|
|
|
227
428
|
id: artifactId(kind, key, css),
|
|
228
429
|
kind,
|
|
229
430
|
css,
|
|
230
|
-
order: artifacts.length
|
|
431
|
+
order: artifacts.length,
|
|
432
|
+
source: this.artifactSources.get(this.sourceKey(kind, key)) ?? "component"
|
|
231
433
|
});
|
|
232
434
|
};
|
|
233
435
|
append("property", this.propertyRules);
|
|
@@ -324,4 +526,4 @@ function createServerStyleCollector(namePrefix) {
|
|
|
324
526
|
//#endregion
|
|
325
527
|
export { createServerStyleCollector as n, ServerStyleCollector as t };
|
|
326
528
|
|
|
327
|
-
//# sourceMappingURL=collector-
|
|
529
|
+
//# sourceMappingURL=collector-NjmUiB8f.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector-NjmUiB8f.js","names":[],"sources":["../src/ssr/collector.ts"],"sourcesContent":["/**\n * ServerStyleCollector — server-safe style collector for SSR.\n *\n * Accumulates CSS rules and cache metadata during server rendering.\n * This is the server-side counterpart to StyleInjector: it allocates\n * hash-based class names using the configured `namePrefix` (defaults\n * to `'t'`), formats CSS rules into text, and tracks rendered class\n * names for lightweight client transfer.\n *\n * One instance is created per HTTP request. Concurrent requests\n * each get their own collector (via AsyncLocalStorage or React context).\n */\n\nimport {\n getEffectiveProperties,\n getGlobalStyles,\n getGlobalCounterStyles,\n getGlobalFontFaces,\n getGlobalFunctions,\n getGlobalConfigTokens,\n getNamePrefix,\n} from '../config';\nimport { formatCounterStyleRule } from '../counter-style';\nimport { fontFaceContentHash, formatFontFaceRule } from '../font-face';\nimport { formatFunctionRule, parseFunctionName } from '../functions';\nimport { renderStyles } from '../pipeline';\nimport type { StyleResult } from '../pipeline';\nimport {\n getEffectiveDefinition,\n normalizePropertyDefinition,\n} from '../properties';\nimport { hashString } from '../utils/hash';\nimport {\n makeClassName,\n makeCounterStyleName,\n makeKeyframeName,\n validateNamePrefix,\n} from '../utils/name-prefix';\nimport { formatPropertyCSS } from './format-property';\nimport { formatGlobalRules } from './format-global-rules';\nimport { formatRulesWithStats } from './format-rules';\nimport {\n getPrecompiledRevision,\n getRegisteredPrecompiledDependencies,\n} from '../precompile/runtime';\nimport type {\n PrecompiledCounterStyleCacheEntry,\n PrecompiledKeyframeCacheEntry,\n PrecompiledPropertyCacheEntry,\n TastyPrecompiledChunk,\n TastyPrecompiledDependencies,\n TastyStyleArtifactSource,\n} from '../precompile/types';\n\nexport type ServerStyleArtifactKind =\n | 'property'\n | 'font-face'\n | 'counter-style'\n | 'function'\n | 'raw'\n | 'global'\n | 'chunk'\n | 'keyframes';\n\nexport interface ServerStyleArtifact {\n /** Stable identifier derived from the artifact kind, logical key, and CSS. */\n id: string;\n kind: ServerStyleArtifactKind;\n css: string;\n /** Zero-based position in the collector's final cascade order. */\n order: number;\n /** Origin of the rule. */\n source: TastyStyleArtifactSource;\n}\n\ninterface CollectArtifactOptions {\n source?: TastyStyleArtifactSource;\n}\n\ninterface CollectPropertyOptions extends CollectArtifactOptions {\n cssName?: string;\n normalizedDefinition?: string;\n rscKey?: string;\n}\n\ninterface CollectKeyframesOptions extends CollectArtifactOptions {\n contentKey?: string;\n rscKeys?: readonly string[];\n}\n\ninterface CollectCounterStyleOptions extends CollectArtifactOptions {\n weak?: boolean;\n rscKeys?: readonly string[];\n}\n\nfunction artifactId(kind: ServerStyleArtifactKind, key: string, css: string) {\n const content = `${kind}\\0${key}\\0${css}`;\n return `${kind}:${hashString(content)}:${content.length.toString(36)}`;\n}\n\nexport class ServerStyleCollector {\n private chunks = new Map<string, string>();\n private chunkRuleCounts = new Map<string, number>();\n private cacheKeyToClassName = new Map<string, string>();\n private flushedKeys = new Set<string>();\n private propertyRules = new Map<string, string>();\n private flushedPropertyKeys = new Set<string>();\n private keyframeRules = new Map<string, string>();\n private flushedKeyframeKeys = new Set<string>();\n private globalStyles = new Map<string, string>();\n private flushedGlobalKeys = new Set<string>();\n private rawCSS = new Map<string, string>();\n private flushedRawKeys = new Set<string>();\n private fontFaceRules = new Map<string, string>();\n private flushedFontFaceKeys = new Set<string>();\n private counterStyleRules = new Map<string, string>();\n private flushedCounterStyleKeys = new Set<string>();\n private functionRules = new Map<string, string>();\n private flushedFunctionKeys = new Set<string>();\n private keyframesCounter = 0;\n private counterStyleCounter = 0;\n private internalsCollected = false;\n private namePrefix: string;\n private artifactSources = new Map<string, TastyStyleArtifactSource>();\n private precompiledChunks = new Map<string, TastyPrecompiledChunk>();\n private precompiledProperties = new Map<\n string,\n PrecompiledPropertyCacheEntry\n >();\n private precompiledKeyframes = new Map<\n string,\n PrecompiledKeyframeCacheEntry\n >();\n private precompiledFontFaces = new Set<string>();\n private precompiledCounterStyles = new Map<\n string,\n PrecompiledCounterStyleCacheEntry\n >();\n private precompiledFunctions = new Set<string>();\n private precompiledRSCKeys = new Set<string>();\n private appliedPrecompiledRevision = -1;\n private externalProperties = new Set<string>();\n private externalKeyframes = new Set<string>();\n private externalFontFaces = new Set<string>();\n private externalCounterStyles = new Set<string>();\n private externalFunctions = new Set<string>();\n private precompileRecording = false;\n\n /**\n * @param namePrefix - Optional override for the configured prefix.\n * Defaults to the value from `configure({ namePrefix })` (or `'t'`).\n * Pass an explicit prefix when constructing a collector outside the\n * normal configure() lifecycle (e.g. in tests). Validated eagerly\n * so misconfiguration fails before any CSS is collected.\n */\n constructor(namePrefix?: string) {\n if (namePrefix !== undefined) {\n validateNamePrefix(namePrefix);\n }\n this.namePrefix = namePrefix ?? getNamePrefix();\n }\n\n private sourceKey(kind: ServerStyleArtifactKind, key: string): string {\n return `${kind}\\0${key}`;\n }\n\n private setSource(\n kind: ServerStyleArtifactKind,\n key: string,\n source: TastyStyleArtifactSource,\n ): void {\n this.artifactSources.set(this.sourceKey(kind, key), source);\n }\n\n /**\n * Pick up manifests registered after this collector was constructed.\n *\n * Deliberately not called from the constructor. Reading the registered\n * dependencies is what validates the catalogs against the host's\n * configuration, and registration is a side-effect import that routinely\n * runs before the host's own `configure()` call — so a collector built in\n * between would validate against defaults and permanently drop a catalog\n * that matches once configuration is installed.\n *\n * Instead every method that consults an `external*` set calls this first, so\n * the seed lands at whichever style-producing operation happens to come\n * first. That gate belongs here rather than at the call sites: the standalone\n * at-rule hooks (`useKeyframes`, `useCounterStyle`, `useFontFace`) go\n * straight to `collect*` and never reach `collectInternals()`, so a catalog's\n * standalone rule would otherwise be emitted a second time during SSR.\n * After the first call this is an integer comparison.\n */\n applyRegisteredPrecompiledDependencies(): void {\n const revision = getPrecompiledRevision();\n if (revision === this.appliedPrecompiledRevision) return;\n this.appliedPrecompiledRevision = revision;\n\n this.externalProperties.clear();\n this.externalKeyframes.clear();\n this.externalFontFaces.clear();\n this.externalCounterStyles.clear();\n this.externalFunctions.clear();\n\n // Catalog generation deliberately records a self-contained artifact even\n // when another package registered precompiled styles in this process.\n if (this.precompileRecording) return;\n\n const dependencies = getRegisteredPrecompiledDependencies(this.namePrefix);\n for (const item of dependencies.properties) {\n this.externalProperties.add(item.name);\n }\n for (const item of dependencies.keyframes) {\n this.externalKeyframes.add(item.contentKey);\n }\n for (const hash of dependencies.fontFaces) this.externalFontFaces.add(hash);\n for (const item of dependencies.counterStyles) {\n this.externalCounterStyles.add(item.name);\n }\n for (const name of dependencies.functions) this.externalFunctions.add(name);\n }\n\n private generateClassName(cacheKey: string): string {\n return makeClassName(this.namePrefix, hashString(cacheKey));\n }\n\n /** @internal Enable build-time chunk lookup metadata collection. */\n enablePrecompileRecording(): void {\n this.precompileRecording = true;\n // A catalog build must be self-contained even if this process previously\n // registered another package's manifest.\n this.externalProperties.clear();\n this.externalKeyframes.clear();\n this.externalFontFaces.clear();\n this.externalCounterStyles.clear();\n this.externalFunctions.clear();\n }\n\n /** @internal Whether this collector is producing a catalog artifact. */\n isPrecompileRecording(): boolean {\n return this.precompileRecording;\n }\n\n /**\n * Collect internal @property rules and :root token defaults.\n * Mirrors markStylesGenerated() from the client-side injector.\n * Called automatically on first chunk collection; idempotent.\n *\n * Internals are always emitted here — the RSC path deliberately\n * defers to SSR so that tokens appear exactly once per page in\n * <style data-tasty-ssr> (avoiding duplication of large token sets).\n */\n collectInternals(): void {\n if (this.internalsCollected) return;\n this.internalsCollected = true;\n\n this.applyRegisteredPrecompiledDependencies();\n\n for (const [token, definition] of Object.entries(\n getEffectiveProperties(),\n )) {\n const css = formatPropertyCSS(token, definition);\n if (css) {\n const effective = getEffectiveDefinition(token, definition);\n this.collectProperty(`__prop:${token}`, css, {\n source: 'config',\n cssName: effective.isValid ? effective.cssName : undefined,\n normalizedDefinition: effective.isValid\n ? normalizePropertyDefinition(effective.definition)\n : undefined,\n });\n }\n }\n\n const tokenStyles = getGlobalConfigTokens();\n if (tokenStyles && Object.keys(tokenStyles).length > 0) {\n const tokenRules = renderStyles(tokenStyles, ':root') as StyleResult[];\n if (tokenRules.length > 0) {\n const css = formatGlobalRules(tokenRules);\n if (css) {\n this.collectGlobalStyles('__global:tokens', css, false, {\n source: 'config',\n });\n }\n }\n }\n\n const globalFF = getGlobalFontFaces();\n if (globalFF) {\n for (const [family, input] of Object.entries(globalFF)) {\n const descriptors = Array.isArray(input) ? input : [input];\n for (const desc of descriptors) {\n const hash = fontFaceContentHash(family, desc);\n const css = formatFontFaceRule(family, desc);\n this.collectFontFace(hash, css, { source: 'config' });\n }\n }\n }\n\n const globalCS = getGlobalCounterStyles();\n if (globalCS) {\n for (const [name, descriptors] of Object.entries(globalCS)) {\n const css = formatCounterStyleRule(name, descriptors);\n this.collectCounterStyle(name, css, {\n weak: true,\n source: 'config',\n });\n }\n }\n\n const globalFn = getGlobalFunctions();\n if (globalFn) {\n for (const [name, definition] of Object.entries(globalFn)) {\n const css = formatFunctionRule(name, definition);\n this.collectFunction(parseFunctionName(name), css, {\n weak: true,\n source: 'config',\n });\n }\n }\n\n const globalStyles = getGlobalStyles();\n if (globalStyles) {\n for (const [selector, styles] of Object.entries(globalStyles)) {\n if (Object.keys(styles).length > 0) {\n const rules = renderStyles(styles, selector) as StyleResult[];\n if (rules.length > 0) {\n const css = formatGlobalRules(rules);\n if (css) {\n this.collectGlobalStyles(\n `__global:styles:${selector}`,\n css,\n false,\n { source: 'config' },\n );\n }\n }\n }\n }\n }\n }\n\n /**\n * Allocate a className for a cache key, server-side.\n * Mirrors StyleInjector.allocateClassName but without DOM access.\n */\n allocateClassName(cacheKey: string): {\n className: string;\n isNewAllocation: boolean;\n } {\n const existing = this.cacheKeyToClassName.get(cacheKey);\n if (existing) {\n return { className: existing, isNewAllocation: false };\n }\n\n const className = this.generateClassName(cacheKey);\n this.cacheKeyToClassName.set(cacheKey, className);\n\n return { className, isNewAllocation: true };\n }\n\n /**\n * Record CSS rules for a chunk.\n * Called by useStyles during server render.\n */\n collectChunk(\n cacheKey: string,\n className: string,\n rules: StyleResult[],\n ): void {\n if (this.chunks.has(cacheKey)) return;\n const { css, ruleCount } = formatRulesWithStats(rules, className);\n if (css) {\n this.chunks.set(cacheKey, css);\n this.chunkRuleCounts.set(cacheKey, ruleCount);\n this.setSource('chunk', cacheKey, 'component');\n }\n }\n\n /** Record the pre-render lookup key corresponding to a collected chunk. */\n recordPrecompiledChunk(\n lookupKey: string,\n className: string,\n animations: readonly string[],\n ): void {\n if (!this.precompiledChunks.has(lookupKey)) {\n this.precompiledChunks.set(lookupKey, {\n lookupKey,\n className,\n animations: [...animations],\n });\n }\n }\n\n /**\n * Record a @property rule. Deduplicated by name.\n */\n collectProperty(\n name: string,\n css: string,\n options?: CollectPropertyOptions,\n ): void {\n this.applyRegisteredPrecompiledDependencies();\n if (options?.cssName && this.externalProperties.has(options.cssName))\n return;\n if (!this.propertyRules.has(name)) {\n this.propertyRules.set(name, css);\n this.setSource('property', name, options?.source ?? 'component');\n } else if ((options?.source ?? 'component') === 'component') {\n this.setSource('property', name, 'component');\n }\n if (\n (options?.source ?? 'component') === 'component' &&\n options?.cssName &&\n options.normalizedDefinition !== undefined\n ) {\n this.precompiledProperties.set(options.cssName, {\n name: options.cssName,\n definition: options.normalizedDefinition,\n });\n if (options.rscKey) this.precompiledRSCKeys.add(options.rscKey);\n }\n }\n\n /**\n * Record a @keyframes rule. Deduplicated by name.\n */\n collectKeyframes(\n name: string,\n css: string,\n options?: CollectKeyframesOptions,\n ): void {\n this.applyRegisteredPrecompiledDependencies();\n if (options?.contentKey && this.externalKeyframes.has(options.contentKey)) {\n return;\n }\n if (!this.keyframeRules.has(name)) {\n this.keyframeRules.set(name, css);\n this.setSource('keyframes', name, options?.source ?? 'component');\n } else if ((options?.source ?? 'component') === 'component') {\n this.setSource('keyframes', name, 'component');\n }\n if (\n (options?.source ?? 'component') === 'component' &&\n options?.contentKey\n ) {\n const existing = this.precompiledKeyframes.get(options.contentKey);\n const rscKeys = new Set(existing?.rscKeys ?? []);\n for (const key of options.rscKeys ?? []) rscKeys.add(key);\n this.precompiledKeyframes.set(options.contentKey, {\n name,\n contentKey: options.contentKey,\n rscKeys: [...rscKeys],\n });\n }\n }\n\n /**\n * Allocate a keyframe name for SSR. Uses provided name or generates one.\n */\n allocateKeyframeName(providedName?: string): string {\n return (\n providedName ??\n makeKeyframeName(this.namePrefix, String(this.keyframesCounter++))\n );\n }\n\n /**\n * Record a @font-face rule. Deduplicated by key (content hash).\n */\n collectFontFace(\n key: string,\n css: string,\n options?: CollectArtifactOptions,\n ): void {\n this.applyRegisteredPrecompiledDependencies();\n if (this.externalFontFaces.has(key)) return;\n if (!this.fontFaceRules.has(key)) {\n this.fontFaceRules.set(key, css);\n this.setSource('font-face', key, options?.source ?? 'component');\n } else if ((options?.source ?? 'component') === 'component') {\n this.setSource('font-face', key, 'component');\n }\n if ((options?.source ?? 'component') === 'component') {\n this.precompiledFontFaces.add(key);\n this.precompiledRSCKeys.add(`__ff:${key}`);\n }\n }\n\n /**\n * Record a @counter-style rule. Deduplicated by name and overrides an\n * existing rule by default. Pass `weak: true` for global `configure()`\n * definitions, which never clobber an existing rule.\n */\n collectCounterStyle(\n name: string,\n css: string,\n options?: CollectCounterStyleOptions,\n ): void {\n this.applyRegisteredPrecompiledDependencies();\n if (this.externalCounterStyles.has(name)) return;\n const source = options?.source ?? 'component';\n const existing = this.counterStyleRules.get(name);\n if (existing === undefined) {\n this.counterStyleRules.set(name, css);\n this.setSource('counter-style', name, source);\n if (source === 'component') {\n this.precompiledCounterStyles.set(name, {\n name,\n rscKeys: [...(options?.rscKeys ?? [])],\n });\n }\n return;\n }\n if (source === 'component') {\n this.precompiledCounterStyles.set(name, {\n name,\n rscKeys: [...(options?.rscKeys ?? [])],\n });\n if (existing === css) this.setSource('counter-style', name, 'component');\n }\n if (options?.weak || existing === css) return;\n this.counterStyleRules.set(name, css);\n this.setSource('counter-style', name, source);\n if (source === 'component') {\n this.precompiledCounterStyles.set(name, {\n name,\n rscKeys: [...(options?.rscKeys ?? [])],\n });\n }\n // If a rule with this name was already flushed (streaming), allow the\n // overriding rule to be flushed again so it wins by source order.\n this.flushedCounterStyleKeys.delete(name);\n }\n\n /**\n * Record a @function rule. Deduplicated by CSS function name and overrides an\n * existing rule by default. Pass `weak: true` for global `configure()`\n * definitions, which never clobber an existing rule.\n */\n collectFunction(\n name: string,\n css: string,\n options?: { weak?: boolean; source?: TastyStyleArtifactSource },\n ): void {\n this.applyRegisteredPrecompiledDependencies();\n if (this.externalFunctions.has(name)) return;\n const source = options?.source ?? 'component';\n const existing = this.functionRules.get(name);\n if (existing === undefined) {\n this.functionRules.set(name, css);\n this.setSource('function', name, source);\n if (source === 'component') {\n this.precompiledFunctions.add(name);\n this.precompiledRSCKeys.add(`__func:${name}`);\n }\n return;\n }\n if (source === 'component') {\n this.precompiledFunctions.add(name);\n this.precompiledRSCKeys.add(`__func:${name}`);\n if (existing === css) this.setSource('function', name, 'component');\n }\n if (options?.weak || existing === css) return;\n this.functionRules.set(name, css);\n this.setSource('function', name, source);\n if (source === 'component') {\n this.precompiledFunctions.add(name);\n this.precompiledRSCKeys.add(`__func:${name}`);\n }\n // If a rule with this name was already flushed (streaming), allow the\n // overriding rule to be flushed again so it wins by source order.\n this.flushedFunctionKeys.delete(name);\n }\n\n /**\n * Allocate a counter-style name for SSR. Uses provided name or generates one.\n */\n allocateCounterStyleName(providedName?: string): string {\n return (\n providedName ??\n makeCounterStyleName(this.namePrefix, String(this.counterStyleCounter++))\n );\n }\n\n /**\n * Record global styles (from useGlobalStyles). Deduplicated by key.\n *\n * Pass `replace` for slot-keyed entries (an explicit `id`), where the last\n * write must win to match the client's update-tracking behavior.\n */\n collectGlobalStyles(\n key: string,\n css: string,\n replace?: boolean,\n options?: CollectArtifactOptions,\n ): void {\n if (replace || !this.globalStyles.has(key)) {\n this.globalStyles.set(key, css);\n this.setSource('global', key, options?.source ?? 'global');\n }\n }\n\n /**\n * Record raw CSS text (from useRawCSS). Deduplicated by key.\n *\n * Pass `replace` for slot-keyed entries (an explicit `id`), where the last\n * write must win to match the client's update-tracking behavior.\n */\n collectRawCSS(\n key: string,\n css: string,\n replace?: boolean,\n options?: CollectArtifactOptions,\n ): void {\n if (replace || !this.rawCSS.has(key)) {\n this.rawCSS.set(key, css);\n this.setSource('raw', key, options?.source ?? 'global');\n }\n }\n\n getPrecompiledChunks(): TastyPrecompiledChunk[] {\n return [...this.precompiledChunks.values()];\n }\n\n getPrecompiledDependencies(): TastyPrecompiledDependencies {\n return {\n properties: [...this.precompiledProperties.values()],\n keyframes: [...this.precompiledKeyframes.values()],\n fontFaces: [...this.precompiledFontFaces],\n counterStyles: [...this.precompiledCounterStyles.values()],\n functions: [...this.precompiledFunctions],\n rscKeys: [...this.precompiledRSCKeys],\n };\n }\n\n /** @internal Structural top-level rule count for component artifacts. */\n getPrecompiledRuleCount(): number {\n const isComponent = (kind: ServerStyleArtifactKind, key: string) =>\n (this.artifactSources.get(this.sourceKey(kind, key)) ?? 'component') ===\n 'component';\n\n let count = 0;\n for (const key of this.propertyRules.keys()) {\n if (isComponent('property', key)) count++;\n }\n for (const key of this.fontFaceRules.keys()) {\n if (isComponent('font-face', key)) count++;\n }\n for (const key of this.counterStyleRules.keys()) {\n if (isComponent('counter-style', key)) count++;\n }\n for (const key of this.functionRules.keys()) {\n if (isComponent('function', key)) count++;\n }\n for (const key of this.chunks.keys()) {\n if (isComponent('chunk', key)) {\n count += this.chunkRuleCounts.get(key) ?? 0;\n }\n }\n for (const key of this.keyframeRules.keys()) {\n if (isComponent('keyframes', key)) count++;\n }\n\n return count;\n }\n\n /**\n * Return the collected CSS as structured, ordered artifacts.\n *\n * Artifact boundaries are part of the collector output so build tools never\n * need to split or parse CSS text. IDs include the logical collection key\n * and content, making them stable across equivalent page renders while a CSS\n * change always produces a different ID.\n */\n getArtifacts(): ServerStyleArtifact[] {\n const artifacts: ServerStyleArtifact[] = [];\n\n const append = (\n kind: ServerStyleArtifactKind,\n entries: Iterable<[string, string]>,\n ) => {\n for (const [key, css] of entries) {\n artifacts.push({\n id: artifactId(kind, key, css),\n kind,\n css,\n order: artifacts.length,\n source:\n this.artifactSources.get(this.sourceKey(kind, key)) ?? 'component',\n });\n }\n };\n\n append('property', this.propertyRules);\n append('font-face', this.fontFaceRules);\n append('counter-style', this.counterStyleRules);\n append('function', this.functionRules);\n append('raw', this.rawCSS);\n append('global', this.globalStyles);\n append('chunk', this.chunks);\n append('keyframes', this.keyframeRules);\n\n return artifacts;\n }\n\n /**\n * Extract all CSS collected so far as a single string.\n * Includes @property and @keyframes rules.\n * Used for non-streaming SSR (renderToString).\n */\n getCSS(): string {\n return this.getArtifacts()\n .map(({ css }) => css)\n .join('\\n');\n }\n\n /**\n * Flush only newly collected CSS since the last flush.\n * Used for streaming SSR (renderToPipeableStream + useServerInsertedHTML).\n */\n flushCSS(): string {\n const parts: string[] = [];\n\n for (const [name, css] of this.propertyRules) {\n if (!this.flushedPropertyKeys.has(name)) {\n parts.push(css);\n this.flushedPropertyKeys.add(name);\n }\n }\n\n for (const [key, css] of this.fontFaceRules) {\n if (!this.flushedFontFaceKeys.has(key)) {\n parts.push(css);\n this.flushedFontFaceKeys.add(key);\n }\n }\n\n for (const [key, css] of this.counterStyleRules) {\n if (!this.flushedCounterStyleKeys.has(key)) {\n parts.push(css);\n this.flushedCounterStyleKeys.add(key);\n }\n }\n\n for (const [key, css] of this.functionRules) {\n if (!this.flushedFunctionKeys.has(key)) {\n parts.push(css);\n this.flushedFunctionKeys.add(key);\n }\n }\n\n for (const [key, css] of this.rawCSS) {\n if (!this.flushedRawKeys.has(key)) {\n parts.push(css);\n this.flushedRawKeys.add(key);\n }\n }\n\n for (const [key, css] of this.globalStyles) {\n if (!this.flushedGlobalKeys.has(key)) {\n parts.push(css);\n this.flushedGlobalKeys.add(key);\n }\n }\n\n for (const [key, css] of this.chunks) {\n if (!this.flushedKeys.has(key)) {\n parts.push(css);\n this.flushedKeys.add(key);\n }\n }\n\n for (const [name, css] of this.keyframeRules) {\n if (!this.flushedKeyframeKeys.has(name)) {\n parts.push(css);\n this.flushedKeyframeKeys.add(name);\n }\n }\n\n return parts.join('\\n');\n }\n\n private flushedClassNames = new Set<string>();\n\n /**\n * Return class names rendered since the last call (for streaming).\n * Used to emit lightweight class-list scripts for client hydration.\n */\n getRenderedClassNames(): string[] {\n const names: string[] = [];\n for (const className of this.cacheKeyToClassName.values()) {\n if (!this.flushedClassNames.has(className)) {\n this.flushedClassNames.add(className);\n names.push(className);\n }\n }\n return names;\n }\n}\n\n/**\n * Factory for creating a {@link ServerStyleCollector} instance.\n *\n * Canonical functional entry point; the `ServerStyleCollector` class remains\n * exported for advanced/internal use.\n *\n * @param namePrefix - Optional override for the configured class-name prefix.\n * Defaults to the value from `configure({ namePrefix })` (or `'t'`).\n *\n * @example\n * ```ts\n * import { createServerStyleCollector } from '@tenphi/tasty/ssr';\n *\n * const collector = createServerStyleCollector();\n * ```\n */\nexport function createServerStyleCollector(\n namePrefix?: string,\n): ServerStyleCollector {\n return new ServerStyleCollector(namePrefix);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+FA,SAAS,WAAW,MAA+B,KAAa,KAAa;CAC3E,MAAM,UAAU,GAAG,KAAK,IAAI,IAAI,IAAI;CACpC,OAAO,GAAG,KAAK,GAAG,WAAW,OAAO,EAAE,GAAG,QAAQ,OAAO,SAAS,EAAE;AACrE;AAEA,IAAa,uBAAb,MAAkC;CAChC,yBAAiB,IAAI,IAAoB;CACzC,kCAA0B,IAAI,IAAoB;CAClD,sCAA8B,IAAI,IAAoB;CACtD,8BAAsB,IAAI,IAAY;CACtC,gCAAwB,IAAI,IAAoB;CAChD,sCAA8B,IAAI,IAAY;CAC9C,gCAAwB,IAA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