@tenphi/tasty 0.0.0-snapshot.61ff2fb → 0.0.0-snapshot.63aafaf

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.
Files changed (337) hide show
  1. package/README.md +39 -28
  2. package/dist/{ssr/async-storage.js → async-storage-B7_o6FKt.js} +16 -6
  3. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  4. package/dist/{ssr/collector.js → collector-Crs9kGJW.js} +52 -35
  5. package/dist/collector-Crs9kGJW.js.map +1 -0
  6. package/dist/{ssr/collector.d.ts → collector-osfWTeRd.d.ts} +21 -15
  7. package/dist/config-BaxtQMS3.js +10464 -0
  8. package/dist/config-BaxtQMS3.js.map +1 -0
  9. package/dist/config-BoZDUHW5.d.ts +945 -0
  10. package/dist/context-CkSg-kDT.js +24 -0
  11. package/dist/context-CkSg-kDT.js.map +1 -0
  12. package/dist/core/index.d.ts +5 -33
  13. package/dist/core/index.js +6 -26
  14. package/dist/core-CmxaoZ-N.js +1598 -0
  15. package/dist/core-CmxaoZ-N.js.map +1 -0
  16. package/dist/{zero/extractor.js → css-writer-CPy_cbFJ.js} +98 -13
  17. package/dist/css-writer-CPy_cbFJ.js.map +1 -0
  18. package/dist/{ssr/format-global-rules.js → format-global-rules-Dbc_1tc3.js} +2 -2
  19. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  20. package/dist/format-rules-CPirO_Mj.js +143 -0
  21. package/dist/format-rules-CPirO_Mj.js.map +1 -0
  22. package/dist/hydrate-CVn-A_3y.js +45 -0
  23. package/dist/hydrate-CVn-A_3y.js.map +1 -0
  24. package/dist/index-B_k47mc_.d.ts +1655 -0
  25. package/dist/index-tcHuMPFt.d.ts +1286 -0
  26. package/dist/index.d.ts +5 -50
  27. package/dist/index.js +732 -35
  28. package/dist/index.js.map +1 -0
  29. package/dist/keyframes-vpzoVdUR.js +588 -0
  30. package/dist/keyframes-vpzoVdUR.js.map +1 -0
  31. package/dist/{utils/merge-styles.d.ts → merge-styles-BMWcH6MF.d.ts} +3 -3
  32. package/dist/{utils/merge-styles.js → merge-styles-BzQutdAK.js} +3 -4
  33. package/dist/merge-styles-BzQutdAK.js.map +1 -0
  34. package/dist/{utils/resolve-recipes.js → resolve-recipes-DgH8A3Nn.js} +4 -6
  35. package/dist/resolve-recipes-DgH8A3Nn.js.map +1 -0
  36. package/dist/ssr/astro-client.js +19 -0
  37. package/dist/ssr/astro-client.js.map +1 -0
  38. package/dist/ssr/astro-middleware.d.ts +15 -0
  39. package/dist/ssr/astro-middleware.js +19 -0
  40. package/dist/ssr/astro-middleware.js.map +1 -0
  41. package/dist/ssr/astro.d.ts +78 -10
  42. package/dist/ssr/astro.js +115 -30
  43. package/dist/ssr/astro.js.map +1 -1
  44. package/dist/ssr/index.d.ts +44 -5
  45. package/dist/ssr/index.js +6 -7
  46. package/dist/ssr/index.js.map +1 -1
  47. package/dist/ssr/next.d.ts +5 -4
  48. package/dist/ssr/next.js +16 -10
  49. package/dist/ssr/next.js.map +1 -1
  50. package/dist/static/index.d.ts +91 -5
  51. package/dist/static/index.js +49 -3
  52. package/dist/static/index.js.map +1 -0
  53. package/dist/static/inject.js.map +1 -1
  54. package/dist/zero/babel.d.ts +7 -108
  55. package/dist/zero/babel.js +57 -21
  56. package/dist/zero/babel.js.map +1 -1
  57. package/dist/zero/index.d.ts +67 -3
  58. package/dist/zero/index.js +1 -2
  59. package/dist/zero/next.js.map +1 -1
  60. package/docs/README.md +4 -4
  61. package/docs/adoption.md +5 -3
  62. package/docs/comparison.md +24 -25
  63. package/docs/configuration.md +113 -1
  64. package/docs/debug.md +11 -9
  65. package/docs/design-system.md +22 -10
  66. package/docs/dsl.md +37 -20
  67. package/docs/getting-started.md +10 -10
  68. package/docs/injector.md +43 -27
  69. package/docs/methodology.md +78 -3
  70. package/docs/{PIPELINE.md → pipeline.md} +230 -50
  71. package/docs/{runtime.md → react-api.md} +128 -32
  72. package/docs/ssr.md +142 -82
  73. package/docs/styles.md +23 -7
  74. package/docs/tasty-static.md +29 -2
  75. package/package.json +19 -12
  76. package/tasty.config.ts +1 -0
  77. package/dist/_virtual/_rolldown/runtime.js +0 -7
  78. package/dist/chunks/cacheKey.js +0 -77
  79. package/dist/chunks/cacheKey.js.map +0 -1
  80. package/dist/chunks/definitions.d.ts +0 -37
  81. package/dist/chunks/definitions.js +0 -258
  82. package/dist/chunks/definitions.js.map +0 -1
  83. package/dist/chunks/index.d.ts +0 -1
  84. package/dist/chunks/renderChunk.d.ts +0 -1
  85. package/dist/chunks/renderChunk.js +0 -59
  86. package/dist/chunks/renderChunk.js.map +0 -1
  87. package/dist/config.d.ts +0 -366
  88. package/dist/config.js +0 -503
  89. package/dist/config.js.map +0 -1
  90. package/dist/counter-style/index.js +0 -51
  91. package/dist/counter-style/index.js.map +0 -1
  92. package/dist/debug.d.ts +0 -89
  93. package/dist/debug.js +0 -453
  94. package/dist/debug.js.map +0 -1
  95. package/dist/font-face/index.js +0 -63
  96. package/dist/font-face/index.js.map +0 -1
  97. package/dist/hooks/index.d.ts +0 -7
  98. package/dist/hooks/resolve-ssr-collector.js +0 -14
  99. package/dist/hooks/resolve-ssr-collector.js.map +0 -1
  100. package/dist/hooks/useCounterStyle.d.ts +0 -50
  101. package/dist/hooks/useCounterStyle.js +0 -46
  102. package/dist/hooks/useCounterStyle.js.map +0 -1
  103. package/dist/hooks/useFontFace.d.ts +0 -43
  104. package/dist/hooks/useFontFace.js +0 -70
  105. package/dist/hooks/useFontFace.js.map +0 -1
  106. package/dist/hooks/useGlobalStyles.d.ts +0 -30
  107. package/dist/hooks/useGlobalStyles.js +0 -78
  108. package/dist/hooks/useGlobalStyles.js.map +0 -1
  109. package/dist/hooks/useKeyframes.d.ts +0 -56
  110. package/dist/hooks/useKeyframes.js +0 -64
  111. package/dist/hooks/useKeyframes.js.map +0 -1
  112. package/dist/hooks/useProperty.d.ts +0 -79
  113. package/dist/hooks/useProperty.js +0 -109
  114. package/dist/hooks/useProperty.js.map +0 -1
  115. package/dist/hooks/useRawCSS.d.ts +0 -53
  116. package/dist/hooks/useRawCSS.js +0 -35
  117. package/dist/hooks/useRawCSS.js.map +0 -1
  118. package/dist/hooks/useStyles.d.ts +0 -45
  119. package/dist/hooks/useStyles.js +0 -237
  120. package/dist/hooks/useStyles.js.map +0 -1
  121. package/dist/injector/index.d.ts +0 -183
  122. package/dist/injector/index.js +0 -179
  123. package/dist/injector/index.js.map +0 -1
  124. package/dist/injector/injector.d.ts +0 -166
  125. package/dist/injector/injector.js +0 -464
  126. package/dist/injector/injector.js.map +0 -1
  127. package/dist/injector/sheet-manager.d.ts +0 -136
  128. package/dist/injector/sheet-manager.js +0 -733
  129. package/dist/injector/sheet-manager.js.map +0 -1
  130. package/dist/injector/types.d.ts +0 -204
  131. package/dist/keyframes/index.js +0 -206
  132. package/dist/keyframes/index.js.map +0 -1
  133. package/dist/parser/classify.js +0 -319
  134. package/dist/parser/classify.js.map +0 -1
  135. package/dist/parser/const.js +0 -49
  136. package/dist/parser/const.js.map +0 -1
  137. package/dist/parser/lru.js +0 -109
  138. package/dist/parser/lru.js.map +0 -1
  139. package/dist/parser/parser.d.ts +0 -25
  140. package/dist/parser/parser.js +0 -115
  141. package/dist/parser/parser.js.map +0 -1
  142. package/dist/parser/tokenizer.js +0 -69
  143. package/dist/parser/tokenizer.js.map +0 -1
  144. package/dist/parser/types.d.ts +0 -51
  145. package/dist/parser/types.js +0 -46
  146. package/dist/parser/types.js.map +0 -1
  147. package/dist/pipeline/conditions.d.ts +0 -134
  148. package/dist/pipeline/conditions.js +0 -406
  149. package/dist/pipeline/conditions.js.map +0 -1
  150. package/dist/pipeline/exclusive.js +0 -230
  151. package/dist/pipeline/exclusive.js.map +0 -1
  152. package/dist/pipeline/index.d.ts +0 -55
  153. package/dist/pipeline/index.js +0 -708
  154. package/dist/pipeline/index.js.map +0 -1
  155. package/dist/pipeline/materialize.js +0 -1103
  156. package/dist/pipeline/materialize.js.map +0 -1
  157. package/dist/pipeline/parseStateKey.d.ts +0 -15
  158. package/dist/pipeline/parseStateKey.js +0 -446
  159. package/dist/pipeline/parseStateKey.js.map +0 -1
  160. package/dist/pipeline/simplify.js +0 -515
  161. package/dist/pipeline/simplify.js.map +0 -1
  162. package/dist/pipeline/warnings.js +0 -18
  163. package/dist/pipeline/warnings.js.map +0 -1
  164. package/dist/plugins/index.d.ts +0 -2
  165. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  166. package/dist/plugins/okhsl-plugin.js +0 -97
  167. package/dist/plugins/okhsl-plugin.js.map +0 -1
  168. package/dist/plugins/types.d.ts +0 -76
  169. package/dist/properties/index.js +0 -222
  170. package/dist/properties/index.js.map +0 -1
  171. package/dist/properties/property-type-resolver.d.ts +0 -24
  172. package/dist/properties/property-type-resolver.js +0 -90
  173. package/dist/properties/property-type-resolver.js.map +0 -1
  174. package/dist/ssr/async-storage.d.ts +0 -17
  175. package/dist/ssr/async-storage.js.map +0 -1
  176. package/dist/ssr/collect-auto-properties.js +0 -39
  177. package/dist/ssr/collect-auto-properties.js.map +0 -1
  178. package/dist/ssr/collector.js.map +0 -1
  179. package/dist/ssr/context.d.ts +0 -8
  180. package/dist/ssr/context.js +0 -13
  181. package/dist/ssr/context.js.map +0 -1
  182. package/dist/ssr/format-global-rules.js.map +0 -1
  183. package/dist/ssr/format-keyframes.js +0 -69
  184. package/dist/ssr/format-keyframes.js.map +0 -1
  185. package/dist/ssr/format-property.js +0 -49
  186. package/dist/ssr/format-property.js.map +0 -1
  187. package/dist/ssr/format-rules.js +0 -73
  188. package/dist/ssr/format-rules.js.map +0 -1
  189. package/dist/ssr/hydrate.d.ts +0 -22
  190. package/dist/ssr/hydrate.js +0 -49
  191. package/dist/ssr/hydrate.js.map +0 -1
  192. package/dist/ssr/ssr-collector-ref.js +0 -12
  193. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  194. package/dist/states/index.d.ts +0 -49
  195. package/dist/states/index.js +0 -170
  196. package/dist/states/index.js.map +0 -1
  197. package/dist/static/tastyStatic.d.ts +0 -46
  198. package/dist/static/tastyStatic.js +0 -30
  199. package/dist/static/tastyStatic.js.map +0 -1
  200. package/dist/static/types.d.ts +0 -49
  201. package/dist/static/types.js +0 -24
  202. package/dist/static/types.js.map +0 -1
  203. package/dist/styles/align.d.ts +0 -15
  204. package/dist/styles/align.js +0 -14
  205. package/dist/styles/align.js.map +0 -1
  206. package/dist/styles/border.d.ts +0 -25
  207. package/dist/styles/border.js +0 -113
  208. package/dist/styles/border.js.map +0 -1
  209. package/dist/styles/color.d.ts +0 -14
  210. package/dist/styles/color.js +0 -26
  211. package/dist/styles/color.js.map +0 -1
  212. package/dist/styles/createStyle.js +0 -79
  213. package/dist/styles/createStyle.js.map +0 -1
  214. package/dist/styles/dimension.js +0 -96
  215. package/dist/styles/dimension.js.map +0 -1
  216. package/dist/styles/display.d.ts +0 -37
  217. package/dist/styles/display.js +0 -66
  218. package/dist/styles/display.js.map +0 -1
  219. package/dist/styles/fade.d.ts +0 -15
  220. package/dist/styles/fade.js +0 -57
  221. package/dist/styles/fade.js.map +0 -1
  222. package/dist/styles/fill.d.ts +0 -42
  223. package/dist/styles/fill.js +0 -51
  224. package/dist/styles/fill.js.map +0 -1
  225. package/dist/styles/flow.d.ts +0 -16
  226. package/dist/styles/flow.js +0 -12
  227. package/dist/styles/flow.js.map +0 -1
  228. package/dist/styles/gap.d.ts +0 -31
  229. package/dist/styles/gap.js +0 -36
  230. package/dist/styles/gap.js.map +0 -1
  231. package/dist/styles/height.d.ts +0 -17
  232. package/dist/styles/height.js +0 -19
  233. package/dist/styles/height.js.map +0 -1
  234. package/dist/styles/index.d.ts +0 -1
  235. package/dist/styles/index.js +0 -8
  236. package/dist/styles/index.js.map +0 -1
  237. package/dist/styles/inset.d.ts +0 -52
  238. package/dist/styles/inset.js +0 -149
  239. package/dist/styles/inset.js.map +0 -1
  240. package/dist/styles/justify.d.ts +0 -15
  241. package/dist/styles/justify.js +0 -14
  242. package/dist/styles/justify.js.map +0 -1
  243. package/dist/styles/list.d.ts +0 -16
  244. package/dist/styles/list.js +0 -98
  245. package/dist/styles/list.js.map +0 -1
  246. package/dist/styles/margin.d.ts +0 -24
  247. package/dist/styles/margin.js +0 -103
  248. package/dist/styles/margin.js.map +0 -1
  249. package/dist/styles/outline.d.ts +0 -29
  250. package/dist/styles/outline.js +0 -64
  251. package/dist/styles/outline.js.map +0 -1
  252. package/dist/styles/padding.d.ts +0 -24
  253. package/dist/styles/padding.js +0 -103
  254. package/dist/styles/padding.js.map +0 -1
  255. package/dist/styles/predefined.d.ts +0 -71
  256. package/dist/styles/predefined.js +0 -237
  257. package/dist/styles/predefined.js.map +0 -1
  258. package/dist/styles/preset.d.ts +0 -52
  259. package/dist/styles/preset.js +0 -126
  260. package/dist/styles/preset.js.map +0 -1
  261. package/dist/styles/radius.d.ts +0 -12
  262. package/dist/styles/radius.js +0 -71
  263. package/dist/styles/radius.js.map +0 -1
  264. package/dist/styles/scrollbar.d.ts +0 -25
  265. package/dist/styles/scrollbar.js +0 -46
  266. package/dist/styles/scrollbar.js.map +0 -1
  267. package/dist/styles/shadow.d.ts +0 -14
  268. package/dist/styles/shadow.js +0 -23
  269. package/dist/styles/shadow.js.map +0 -1
  270. package/dist/styles/transition.d.ts +0 -14
  271. package/dist/styles/transition.js +0 -157
  272. package/dist/styles/transition.js.map +0 -1
  273. package/dist/styles/types.d.ts +0 -549
  274. package/dist/styles/width.d.ts +0 -17
  275. package/dist/styles/width.js +0 -19
  276. package/dist/styles/width.js.map +0 -1
  277. package/dist/tasty.d.ts +0 -119
  278. package/dist/tasty.js +0 -231
  279. package/dist/tasty.js.map +0 -1
  280. package/dist/types.d.ts +0 -184
  281. package/dist/utils/cache-wrapper.js +0 -21
  282. package/dist/utils/cache-wrapper.js.map +0 -1
  283. package/dist/utils/case-converter.js +0 -8
  284. package/dist/utils/case-converter.js.map +0 -1
  285. package/dist/utils/color-math.d.ts +0 -46
  286. package/dist/utils/color-math.js +0 -749
  287. package/dist/utils/color-math.js.map +0 -1
  288. package/dist/utils/color-space.d.ts +0 -5
  289. package/dist/utils/color-space.js +0 -228
  290. package/dist/utils/color-space.js.map +0 -1
  291. package/dist/utils/colors.d.ts +0 -5
  292. package/dist/utils/colors.js +0 -10
  293. package/dist/utils/colors.js.map +0 -1
  294. package/dist/utils/css-types.d.ts +0 -7
  295. package/dist/utils/dotize.d.ts +0 -26
  296. package/dist/utils/dotize.js +0 -122
  297. package/dist/utils/dotize.js.map +0 -1
  298. package/dist/utils/filter-base-props.d.ts +0 -15
  299. package/dist/utils/filter-base-props.js +0 -45
  300. package/dist/utils/filter-base-props.js.map +0 -1
  301. package/dist/utils/get-display-name.d.ts +0 -7
  302. package/dist/utils/get-display-name.js +0 -10
  303. package/dist/utils/get-display-name.js.map +0 -1
  304. package/dist/utils/has-keys.js +0 -13
  305. package/dist/utils/has-keys.js.map +0 -1
  306. package/dist/utils/is-dev-env.js +0 -19
  307. package/dist/utils/is-dev-env.js.map +0 -1
  308. package/dist/utils/is-valid-element-type.js +0 -15
  309. package/dist/utils/is-valid-element-type.js.map +0 -1
  310. package/dist/utils/merge-styles.js.map +0 -1
  311. package/dist/utils/mod-attrs.d.ts +0 -6
  312. package/dist/utils/mod-attrs.js +0 -20
  313. package/dist/utils/mod-attrs.js.map +0 -1
  314. package/dist/utils/process-tokens.d.ts +0 -21
  315. package/dist/utils/process-tokens.js +0 -90
  316. package/dist/utils/process-tokens.js.map +0 -1
  317. package/dist/utils/resolve-recipes.d.ts +0 -17
  318. package/dist/utils/resolve-recipes.js.map +0 -1
  319. package/dist/utils/selector-transform.js +0 -32
  320. package/dist/utils/selector-transform.js.map +0 -1
  321. package/dist/utils/string.js +0 -8
  322. package/dist/utils/string.js.map +0 -1
  323. package/dist/utils/styles.d.ts +0 -99
  324. package/dist/utils/styles.js +0 -220
  325. package/dist/utils/styles.js.map +0 -1
  326. package/dist/utils/typography.d.ts +0 -47
  327. package/dist/utils/typography.js +0 -51
  328. package/dist/utils/typography.js.map +0 -1
  329. package/dist/utils/warnings.d.ts +0 -16
  330. package/dist/utils/warnings.js +0 -16
  331. package/dist/utils/warnings.js.map +0 -1
  332. package/dist/zero/css-writer.d.ts +0 -45
  333. package/dist/zero/css-writer.js +0 -73
  334. package/dist/zero/css-writer.js.map +0 -1
  335. package/dist/zero/extractor.d.ts +0 -24
  336. package/dist/zero/extractor.js.map +0 -1
  337. /package/dist/{chunks/cacheKey.d.ts → ssr/astro-client.d.ts} +0 -0
@@ -1,90 +0,0 @@
1
- import { inferSyntaxFromValue } from "./index.js";
2
- //#region src/properties/property-type-resolver.ts
3
- /**
4
- * PropertyTypeResolver
5
- *
6
- * Automatically infers CSS @property types from custom property values.
7
- * Supports deferred resolution for var() reference chains of arbitrary depth.
8
- */
9
- const CUSTOM_PROP_DECL = /^\s*(--[a-z0-9_-]+)\s*:\s*(.+?)\s*$/i;
10
- const SINGLE_VAR_REF = /^var\((--[a-z0-9_-]+)\)$/i;
11
- var PropertyTypeResolver = class {
12
- /** propName → the prop it depends on */
13
- pendingDeps = /* @__PURE__ */ new Map();
14
- /** propName → list of props waiting on it */
15
- reverseDeps = /* @__PURE__ */ new Map();
16
- /**
17
- * Scan CSS declarations and auto-register @property for custom properties
18
- * whose types can be inferred from their values.
19
- */
20
- scanDeclarations(declarations, isPropertyDefined, registerProperty) {
21
- if (!declarations.includes("--")) return;
22
- const parts = declarations.split(/;+/);
23
- for (const part of parts) {
24
- if (!part.trim()) continue;
25
- const match = CUSTOM_PROP_DECL.exec(part);
26
- if (!match) continue;
27
- const propName = match[1];
28
- const value = match[2].trim();
29
- if (isPropertyDefined(propName)) continue;
30
- if (propName.endsWith("-color")) {
31
- registerProperty(propName, "<color>", "transparent");
32
- continue;
33
- }
34
- if (propName.endsWith("-line-height")) {
35
- registerProperty(propName, "<number> | <length-percentage>", "0");
36
- continue;
37
- }
38
- if (propName.endsWith("-opacity")) {
39
- registerProperty(propName, "<number> | <percentage>", "0");
40
- continue;
41
- }
42
- const varMatch = SINGLE_VAR_REF.exec(value);
43
- if (varMatch) {
44
- const depName = varMatch[1];
45
- this.addDependency(propName, depName);
46
- continue;
47
- }
48
- if (this.isComplexValue(value)) continue;
49
- const inferred = inferSyntaxFromValue(value);
50
- if (!inferred) continue;
51
- this.resolve(propName, inferred.syntax, inferred.initialValue, isPropertyDefined, registerProperty);
52
- }
53
- }
54
- addDependency(propName, depName) {
55
- if (propName === depName) return;
56
- this.pendingDeps.set(propName, depName);
57
- let dependents = this.reverseDeps.get(depName);
58
- if (!dependents) {
59
- dependents = [];
60
- this.reverseDeps.set(depName, dependents);
61
- }
62
- if (!dependents.includes(propName)) dependents.push(propName);
63
- }
64
- resolve(propName, syntax, initialValue, isPropertyDefined, registerProperty, resolving) {
65
- if (!resolving) resolving = /* @__PURE__ */ new Set();
66
- if (resolving.has(propName)) return;
67
- resolving.add(propName);
68
- if (!isPropertyDefined(propName)) registerProperty(propName, syntax, initialValue);
69
- const dependents = this.reverseDeps.get(propName);
70
- if (dependents) {
71
- this.reverseDeps.delete(propName);
72
- for (const dependent of dependents) {
73
- this.pendingDeps.delete(dependent);
74
- if (isPropertyDefined(dependent)) continue;
75
- this.resolve(dependent, syntax, initialValue, isPropertyDefined, registerProperty, resolving);
76
- }
77
- }
78
- }
79
- isComplexValue(value) {
80
- if (value.includes("calc(")) return true;
81
- const firstVar = value.indexOf("var(");
82
- if (firstVar === -1) return false;
83
- if (value.indexOf("var(", firstVar + 4) !== -1) return true;
84
- return !SINGLE_VAR_REF.test(value);
85
- }
86
- };
87
- //#endregion
88
- export { PropertyTypeResolver };
89
-
90
- //# sourceMappingURL=property-type-resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"property-type-resolver.js","names":[],"sources":["../../src/properties/property-type-resolver.ts"],"sourcesContent":["/**\n * PropertyTypeResolver\n *\n * Automatically infers CSS @property types from custom property values.\n * Supports deferred resolution for var() reference chains of arbitrary depth.\n */\n\nimport { inferSyntaxFromValue } from './index';\n\nconst CUSTOM_PROP_DECL = /^\\s*(--[a-z0-9_-]+)\\s*:\\s*(.+?)\\s*$/i;\nconst SINGLE_VAR_REF = /^var\\((--[a-z0-9_-]+)\\)$/i;\n\nexport class PropertyTypeResolver {\n /** propName → the prop it depends on */\n private pendingDeps = new Map<string, string>();\n /** propName → list of props waiting on it */\n private reverseDeps = new Map<string, string[]>();\n\n /**\n * Scan CSS declarations and auto-register @property for custom properties\n * whose types can be inferred from their values.\n */\n scanDeclarations(\n declarations: string,\n isPropertyDefined: (name: string) => boolean,\n registerProperty: (\n name: string,\n syntax: string,\n initialValue: string,\n ) => void,\n ): void {\n if (!declarations.includes('--')) return;\n\n const parts = declarations.split(/;+/);\n\n for (const part of parts) {\n if (!part.trim()) continue;\n\n const match = CUSTOM_PROP_DECL.exec(part);\n if (!match) continue;\n\n const propName = match[1];\n const value = match[2].trim();\n\n if (isPropertyDefined(propName)) continue;\n\n // Name-based: --*-color properties are always <color> (from #name tokens)\n if (propName.endsWith('-color')) {\n registerProperty(propName, '<color>', 'transparent');\n continue;\n }\n\n // Name-based: --*-line-height accepts numbers, lengths, and percentages\n if (propName.endsWith('-line-height')) {\n registerProperty(propName, '<number> | <length-percentage>', '0');\n continue;\n }\n\n // Name-based: --*-opacity accepts numbers and percentages\n if (propName.endsWith('-opacity')) {\n registerProperty(propName, '<number> | <percentage>', '0');\n continue;\n }\n\n // Single var() reference → record dependency for deferred resolution\n const varMatch = SINGLE_VAR_REF.exec(value);\n if (varMatch) {\n const depName = varMatch[1];\n this.addDependency(propName, depName);\n continue;\n }\n\n // Skip complex expressions (calc, multiple var, etc.)\n if (this.isComplexValue(value)) continue;\n\n const inferred = inferSyntaxFromValue(value);\n if (!inferred) continue;\n\n this.resolve(\n propName,\n inferred.syntax,\n inferred.initialValue,\n isPropertyDefined,\n registerProperty,\n );\n }\n }\n\n private addDependency(propName: string, depName: string): void {\n if (propName === depName) return;\n\n this.pendingDeps.set(propName, depName);\n\n let dependents = this.reverseDeps.get(depName);\n if (!dependents) {\n dependents = [];\n this.reverseDeps.set(depName, dependents);\n }\n if (!dependents.includes(propName)) {\n dependents.push(propName);\n }\n }\n\n private resolve(\n propName: string,\n syntax: string,\n initialValue: string,\n isPropertyDefined: (name: string) => boolean,\n registerProperty: (\n name: string,\n syntax: string,\n initialValue: string,\n ) => void,\n resolving?: Set<string>,\n ): void {\n if (!resolving) resolving = new Set();\n if (resolving.has(propName)) return;\n resolving.add(propName);\n\n if (!isPropertyDefined(propName)) {\n registerProperty(propName, syntax, initialValue);\n }\n\n const dependents = this.reverseDeps.get(propName);\n if (dependents) {\n this.reverseDeps.delete(propName);\n\n for (const dependent of dependents) {\n this.pendingDeps.delete(dependent);\n\n if (isPropertyDefined(dependent)) continue;\n\n this.resolve(\n dependent,\n syntax,\n initialValue,\n isPropertyDefined,\n registerProperty,\n resolving,\n );\n }\n }\n }\n\n private isComplexValue(value: string): boolean {\n if (value.includes('calc(')) return true;\n const firstVar = value.indexOf('var(');\n if (firstVar === -1) return false;\n if (value.indexOf('var(', firstVar + 4) !== -1) return true;\n return !SINGLE_VAR_REF.test(value);\n }\n}\n"],"mappings":";;;;;;;;AASA,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;AAEvB,IAAa,uBAAb,MAAkC;;CAEhC,8BAAsB,IAAI,KAAqB;;CAE/C,8BAAsB,IAAI,KAAuB;;;;;CAMjD,iBACE,cACA,mBACA,kBAKM;AACN,MAAI,CAAC,aAAa,SAAS,KAAK,CAAE;EAElC,MAAM,QAAQ,aAAa,MAAM,KAAK;AAEtC,OAAK,MAAM,QAAQ,OAAO;AACxB,OAAI,CAAC,KAAK,MAAM,CAAE;GAElB,MAAM,QAAQ,iBAAiB,KAAK,KAAK;AACzC,OAAI,CAAC,MAAO;GAEZ,MAAM,WAAW,MAAM;GACvB,MAAM,QAAQ,MAAM,GAAG,MAAM;AAE7B,OAAI,kBAAkB,SAAS,CAAE;AAGjC,OAAI,SAAS,SAAS,SAAS,EAAE;AAC/B,qBAAiB,UAAU,WAAW,cAAc;AACp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,MAAM,WAAW,MAAM,QAAQ,OAAO;AACtC,MAAI,aAAa,GAAI,QAAO;AAC5B,MAAI,MAAM,QAAQ,QAAQ,WAAW,EAAE,KAAK,GAAI,QAAO;AACvD,SAAO,CAAC,eAAe,KAAK,MAAM"}
@@ -1,17 +0,0 @@
1
- import { ServerStyleCollector } from "./collector.js";
2
-
3
- //#region src/ssr/async-storage.d.ts
4
- /**
5
- * Run a function with a ServerStyleCollector bound to the current
6
- * async context. All useStyles() calls within `fn` (and any async
7
- * continuations) will find this collector via getSSRCollector().
8
- */
9
- declare function runWithCollector<T>(collector: ServerStyleCollector, fn: () => T): T;
10
- /**
11
- * Retrieve the ServerStyleCollector bound to the current async context.
12
- * Returns null when called outside of runWithCollector() or on the client.
13
- */
14
- declare function getSSRCollector(): ServerStyleCollector | null;
15
- //#endregion
16
- export { getSSRCollector, runWithCollector };
17
- //# sourceMappingURL=async-storage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-storage.js","names":[],"sources":["../../src/ssr/async-storage.ts"],"sourcesContent":["/**\n * AsyncLocalStorage integration for SSR collector discovery.\n *\n * Used by Astro middleware and generic framework integrations where\n * the library cannot wrap the React tree with a context provider.\n * The middleware calls runWithCollector() around the render, and\n * useStyles() calls getSSRCollector() to find it.\n *\n * This module imports from 'node:async_hooks' — it must be excluded\n * from client bundles via the build configuration.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nimport type { ServerStyleCollector } from './collector';\n\nconst tastySSRStorage = new AsyncLocalStorage<ServerStyleCollector>();\n\n/**\n * Run a function with a ServerStyleCollector bound to the current\n * async context. All useStyles() calls within `fn` (and any async\n * continuations) will find this collector via getSSRCollector().\n */\nexport function runWithCollector<T>(\n collector: ServerStyleCollector,\n fn: () => T,\n): T {\n return tastySSRStorage.run(collector, fn);\n}\n\n/**\n * Retrieve the ServerStyleCollector bound to the current async context.\n * Returns null when called outside of runWithCollector() or on the client.\n */\nexport function getSSRCollector(): ServerStyleCollector | null {\n if (typeof tastySSRStorage?.getStore !== 'function') return null;\n return tastySSRStorage.getStore() ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,MAAM,kBAAkB,IAAI,mBAAyC;;;;;;AAOrE,SAAgB,iBACd,WACA,IACG;AACH,QAAO,gBAAgB,IAAI,WAAW,GAAG;;;;;;AAO3C,SAAgB,kBAA+C;AAC7D,KAAI,OAAO,iBAAiB,aAAa,WAAY,QAAO;AAC5D,QAAO,gBAAgB,UAAU,IAAI"}
@@ -1,39 +0,0 @@
1
- import { parsePropertyToken } from "../properties/index.js";
2
- import { PropertyTypeResolver } from "../properties/property-type-resolver.js";
3
- import { formatPropertyCSS } from "./format-property.js";
4
- //#region src/ssr/collect-auto-properties.ts
5
- /**
6
- * Scan rendered rules for custom property declarations and collect
7
- * auto-inferred @property rules via the SSR collector.
8
- *
9
- * @param rules - Rendered style rules containing CSS declarations
10
- * @param collector - SSR collector to emit @property CSS into
11
- * @param styles - Original styles object (used to skip explicit @properties)
12
- */
13
- function collectAutoInferredProperties(rules, collector, styles) {
14
- const registered = /* @__PURE__ */ new Set();
15
- if (styles) {
16
- const localProps = styles["@properties"];
17
- if (localProps && typeof localProps === "object") for (const token of Object.keys(localProps)) {
18
- const parsed = parsePropertyToken(token);
19
- if (parsed.isValid) registered.add(parsed.cssName);
20
- }
21
- }
22
- const resolver = new PropertyTypeResolver();
23
- for (const rule of rules) {
24
- if (!rule.declarations) continue;
25
- resolver.scanDeclarations(rule.declarations, (name) => registered.has(name), (name, syntax, initialValue) => {
26
- registered.add(name);
27
- const css = formatPropertyCSS(name, {
28
- syntax,
29
- inherits: true,
30
- initialValue
31
- });
32
- if (css) collector.collectProperty(`__auto:${name}`, css);
33
- });
34
- }
35
- }
36
- //#endregion
37
- export { collectAutoInferredProperties };
38
-
39
- //# sourceMappingURL=collect-auto-properties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collect-auto-properties.js","names":[],"sources":["../../src/ssr/collect-auto-properties.ts"],"sourcesContent":["/**\n * SSR auto-property inference.\n *\n * Scans rendered CSS declarations for custom properties whose types\n * can be inferred from their values (e.g. `--angle: 30deg` → `<angle>`).\n * Mirrors the client-side auto-inference in StyleInjector.inject().\n */\n\nimport type { StyleResult } from '../pipeline';\nimport { parsePropertyToken } from '../properties';\nimport { PropertyTypeResolver } from '../properties/property-type-resolver';\nimport type { Styles } from '../styles/types';\n\nimport type { ServerStyleCollector } from './collector';\nimport { formatPropertyCSS } from './format-property';\n\n/**\n * Scan rendered rules for custom property declarations and collect\n * auto-inferred @property rules via the SSR collector.\n *\n * @param rules - Rendered style rules containing CSS declarations\n * @param collector - SSR collector to emit @property CSS into\n * @param styles - Original styles object (used to skip explicit @properties)\n */\nexport function collectAutoInferredProperties(\n rules: StyleResult[],\n collector: ServerStyleCollector,\n styles?: Styles,\n): void {\n const registered = new Set<string>();\n\n if (styles) {\n const localProps = styles['@properties'];\n if (localProps && typeof localProps === 'object') {\n for (const token of Object.keys(localProps as Record<string, unknown>)) {\n const parsed = parsePropertyToken(token);\n if (parsed.isValid) {\n registered.add(parsed.cssName);\n }\n }\n }\n }\n\n const resolver = new PropertyTypeResolver();\n\n for (const rule of rules) {\n if (!rule.declarations) continue;\n resolver.scanDeclarations(\n rule.declarations,\n (name) => registered.has(name),\n (name, syntax, initialValue) => {\n registered.add(name);\n const css = formatPropertyCSS(name, {\n syntax,\n inherits: true,\n initialValue,\n });\n if (css) {\n collector.collectProperty(`__auto:${name}`, css);\n }\n },\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;AAwBA,SAAgB,8BACd,OACA,WACA,QACM;CACN,MAAM,6BAAa,IAAI,KAAa;AAEpC,KAAI,QAAQ;EACV,MAAM,aAAa,OAAO;AAC1B,MAAI,cAAc,OAAO,eAAe,SACtC,MAAK,MAAM,SAAS,OAAO,KAAK,WAAsC,EAAE;GACtE,MAAM,SAAS,mBAAmB,MAAM;AACxC,OAAI,OAAO,QACT,YAAW,IAAI,OAAO,QAAQ;;;CAMtC,MAAM,WAAW,IAAI,sBAAsB;AAE3C,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,CAAC,KAAK,aAAc;AACxB,WAAS,iBACP,KAAK,eACJ,SAAS,WAAW,IAAI,KAAK,GAC7B,MAAM,QAAQ,iBAAiB;AAC9B,cAAW,IAAI,KAAK;GACpB,MAAM,MAAM,kBAAkB,MAAM;IAClC;IACA,UAAU;IACV;IACD,CAAC;AACF,OAAI,IACF,WAAU,gBAAgB,UAAU,QAAQ,IAAI;IAGrD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"collector.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 * sequential class names (t0, t1, …), formats CSS rules into text,\n * and serializes the cache state for client hydration.\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 getGlobalCounterStyle,\n getGlobalFontFace,\n getGlobalProperties,\n getGlobalConfigTokens,\n hasGlobalProperties,\n INTERNAL_PROPERTIES,\n} from '../config';\nimport { formatCounterStyleRule } from '../counter-style';\nimport { fontFaceContentHash, formatFontFaceRule } from '../font-face';\nimport { renderStyles } from '../pipeline';\nimport type { StyleResult } from '../pipeline';\nimport { formatPropertyCSS } from './format-property';\nimport { formatGlobalRules } from './format-global-rules';\nimport { formatRules } from './format-rules';\n\n/**\n * Cache state serialized to the client for hydration.\n */\nexport interface SSRCacheState {\n /** cacheKey → className map, to pre-populate the client registry */\n entries: Record<string, string>;\n /** Counter value so client allocations don't collide with server ones */\n classCounter: number;\n}\n\nfunction generateClassName(counter: number): string {\n return `t${counter}`;\n}\n\nexport class ServerStyleCollector {\n private chunks = new Map<string, string>();\n private cacheKeyToClassName = new Map<string, string>();\n private classCounter = 0;\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 keyframesCounter = 0;\n private counterStyleCounter = 0;\n private internalsCollected = false;\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 collectInternals(): void {\n if (this.internalsCollected) return;\n this.internalsCollected = true;\n\n for (const [token, definition] of Object.entries(INTERNAL_PROPERTIES)) {\n const css = formatPropertyCSS(token, definition);\n if (css) {\n this.collectProperty(`__internal:${token}`, css);\n }\n }\n\n if (hasGlobalProperties()) {\n const globalProps = getGlobalProperties();\n if (globalProps) {\n for (const [token, definition] of Object.entries(globalProps)) {\n const css = formatPropertyCSS(token, definition);\n if (css) {\n this.collectProperty(`__global:${token}`, css);\n }\n }\n }\n }\n\n // Inject configured tokens as :root CSS custom properties\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);\n }\n }\n }\n\n // Inject global @font-face rules (mirrors markStylesGenerated)\n const globalFF = getGlobalFontFace();\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);\n }\n }\n }\n\n // Inject global @counter-style rules (mirrors markStylesGenerated)\n const globalCS = getGlobalCounterStyle();\n if (globalCS) {\n for (const [name, descriptors] of Object.entries(globalCS)) {\n const css = formatCounterStyleRule(name, descriptors);\n this.collectCounterStyle(name, css);\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 = generateClassName(this.classCounter++);\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 = formatRules(rules, className);\n if (css) {\n this.chunks.set(cacheKey, css);\n }\n }\n\n /**\n * Record a @property rule. Deduplicated by name.\n */\n collectProperty(name: string, css: string): void {\n if (!this.propertyRules.has(name)) {\n this.propertyRules.set(name, css);\n }\n }\n\n /**\n * Record a @keyframes rule. Deduplicated by name.\n */\n collectKeyframes(name: string, css: string): void {\n if (!this.keyframeRules.has(name)) {\n this.keyframeRules.set(name, css);\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 providedName ?? `k${this.keyframesCounter++}`;\n }\n\n /**\n * Record a @font-face rule. Deduplicated by key (content hash).\n */\n collectFontFace(key: string, css: string): void {\n if (!this.fontFaceRules.has(key)) {\n this.fontFaceRules.set(key, css);\n }\n }\n\n /**\n * Record a @counter-style rule. Deduplicated by name.\n */\n collectCounterStyle(name: string, css: string): void {\n if (!this.counterStyleRules.has(name)) {\n this.counterStyleRules.set(name, css);\n }\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 providedName ?? `cs${this.counterStyleCounter++}`;\n }\n\n /**\n * Record global styles (from useGlobalStyles). Deduplicated by key.\n */\n collectGlobalStyles(key: string, css: string): void {\n if (!this.globalStyles.has(key)) {\n this.globalStyles.set(key, css);\n }\n }\n\n /**\n * Record raw CSS text (from useRawCSS). Deduplicated by key.\n */\n collectRawCSS(key: string, css: string): void {\n if (!this.rawCSS.has(key)) {\n this.rawCSS.set(key, css);\n }\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 const parts: string[] = [];\n\n for (const css of this.propertyRules.values()) {\n parts.push(css);\n }\n\n for (const css of this.fontFaceRules.values()) {\n parts.push(css);\n }\n\n for (const css of this.counterStyleRules.values()) {\n parts.push(css);\n }\n\n for (const css of this.rawCSS.values()) {\n parts.push(css);\n }\n\n for (const css of this.globalStyles.values()) {\n parts.push(css);\n }\n\n for (const css of this.chunks.values()) {\n parts.push(css);\n }\n\n for (const css of this.keyframeRules.values()) {\n parts.push(css);\n }\n\n return parts.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.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 /**\n * Serialize the cache state for client hydration.\n */\n getCacheState(): SSRCacheState {\n const entries: Record<string, string> = {};\n for (const [cacheKey, className] of this.cacheKeyToClassName) {\n entries[cacheKey] = className;\n }\n return { entries, classCounter: this.classCounter };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,SAAS,kBAAkB,SAAyB;AAClD,QAAO,IAAI;;AAGb,IAAa,uBAAb,MAAkC;CAChC,yBAAiB,IAAI,KAAqB;CAC1C,sCAA8B,IAAI,KAAqB;CACvD,eAAuB;CACvB,8BAAsB,IAAI,KAAa;CACvC,gCAAwB,IAAI,KAAqB;CACjD,sCAA8B,IAAI,KAAa;CAC/C,gCAAwB,IAAI,KAAqB;CACjD,sCAA8B,IAAI,KAAa;CAC/C,+BAAuB,IAAI,KAAqB;CAChD,oCAA4B,IAAI,KAAa;CAC7C,yBAAiB,IAAI,KAAqB;CAC1C,iCAAyB,IAAI,KAAa;CAC1C,gCAAwB,IAAI,KAAqB;CACjD,sCAA8B,IAAI,KAAa;CAC/C,oCAA4B,IAAI,KAAqB;CACrD,0CAAkC,IAAI,KAAa;CACnD,mBAA2B;CAC3B,sBAA8B;CAC9B,qBAA6B;;;;;;CAO7B,mBAAyB;AACvB,MAAI,KAAK,mBAAoB;AAC7B,OAAK,qBAAqB;AAE1B,OAAK,MAAM,CAAC,OAAO,eAAe,OAAO,QAAQ,oBAAoB,EAAE;GACrE,MAAM,MAAM,kBAAkB,OAAO,WAAW;AAChD,OAAI,IACF,MAAK,gBAAgB,cAAc,SAAS,IAAI;;AAIpD,MAAI,qBAAqB,EAAE;GACzB,MAAM,cAAc,qBAAqB;AACzC,OAAI,YACF,MAAK,MAAM,CAAC,OAAO,e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,oBAAoB,IAAI,KAAK;;AAItC,SAAO,MAAM,KAAK,KAAK;;;;;CAMzB,gBAA+B;EAC7B,MAAM,UAAkC,EAAE;AAC1C,OAAK,MAAM,CAAC,UAAU,cAAc,KAAK,oBACvC,SAAQ,YAAY;AAEtB,SAAO;GAAE;GAAS,cAAc,KAAK;GAAc"}
@@ -1,8 +0,0 @@
1
- import { ServerStyleCollector } from "./collector.js";
2
- import * as _$react from "react";
3
-
4
- //#region src/ssr/context.d.ts
5
- declare const TastySSRContext: _$react.Context<ServerStyleCollector | null>;
6
- //#endregion
7
- export { TastySSRContext };
8
- //# sourceMappingURL=context.d.ts.map
@@ -1,13 +0,0 @@
1
- import { createContext } from "react";
2
- //#region src/ssr/context.ts
3
- /**
4
- * React context for SSR collector discovery.
5
- *
6
- * Used by Next.js TastyRegistry to provide the ServerStyleCollector
7
- * to useStyles() via React context (the streaming-compatible path).
8
- */
9
- const TastySSRContext = createContext(null);
10
- //#endregion
11
- export { TastySSRContext };
12
-
13
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","names":[],"sources":["../../src/ssr/context.ts"],"sourcesContent":["/**\n * React context for SSR collector discovery.\n *\n * Used by Next.js TastyRegistry to provide the ServerStyleCollector\n * to useStyles() via React context (the streaming-compatible path).\n */\n\nimport { createContext } from 'react';\n\nimport type { ServerStyleCollector } from './collector';\n\nexport const TastySSRContext = createContext<ServerStyleCollector | null>(null);\n"],"mappings":";;;;;;;;AAWA,MAAa,kBAAkB,cAA2C,KAAK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-global-rules.js","names":[],"sources":["../../src/ssr/format-global-rules.ts"],"sourcesContent":["/**\n * Format global CSS rules for SSR output.\n *\n * Unlike formatRules() which applies className-based specificity doubling,\n * this function formats rules that already have their full selectors\n * (from renderStyles called with a selector string).\n */\n\nimport type { StyleResult } from '../pipeline';\n\n/**\n * Format an array of global StyleResult rules into a CSS text string.\n *\n * Rules already have their full selectors applied by renderStyles().\n * Handles rootPrefix prepending and at-rule wrapping.\n */\nexport function formatGlobalRules(rules: StyleResult[]): string {\n if (rules.length === 0) return '';\n\n const cssRules: string[] = [];\n\n for (const rule of rules) {\n const selector = rule.rootPrefix\n ? `${rule.rootPrefix} ${rule.selector}`\n : rule.selector;\n\n const baseRule = `${selector} { ${rule.declarations} }`;\n\n let fullRule = baseRule;\n if (rule.atRules && rule.atRules.length > 0) {\n fullRule = rule.atRules.reduce(\n (css, atRule) => `${atRule} { ${css} }`,\n baseRule,\n );\n }\n\n cssRules.push(fullRule);\n }\n\n return cssRules.join('\\n');\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,kBAAkB,OAA8B;AAC9D,KAAI,MAAM,WAAW,EAAG,QAAO;CAE/B,MAAM,WAAqB,EAAE;AAE7B,MAAK,MAAM,QAAQ,OAAO;EAKxB,MAAM,WAAW,GAJA,KAAK,aAClB,GAAG,KAAK,WAAW,GAAG,KAAK,aAC3B,KAAK,SAEoB,KAAK,KAAK,aAAa;EAEpD,IAAI,WAAW;AACf,MAAI,KAAK,WAAW,KAAK,QAAQ,SAAS,EACxC,YAAW,KAAK,QAAQ,QACrB,KAAK,WAAW,GAAG,OAAO,KAAK,IAAI,KACpC,SACD;AAGH,WAAS,KAAK,SAAS;;AAGzB,QAAO,SAAS,KAAK,KAAK"}
@@ -1,69 +0,0 @@
1
- import { createStyle } from "../styles/createStyle.js";
2
- import { STYLE_HANDLER_MAP } from "../styles/index.js";
3
- //#region src/ssr/format-keyframes.ts
4
- /**
5
- * Convert keyframes steps to a CSS string.
6
- * Replicates SheetManager.stepsToCSS() without the class instance.
7
- */
8
- function stepsToCSS(steps) {
9
- const rules = [];
10
- for (const [key, value] of Object.entries(steps)) {
11
- if (typeof value === "string") {
12
- rules.push(`${key} { ${value.trim()} }`);
13
- continue;
14
- }
15
- const styleMap = value || {};
16
- const styleNames = Object.keys(styleMap).sort();
17
- const handlerQueue = [];
18
- const seenHandlers = /* @__PURE__ */ new Set();
19
- styleNames.forEach((styleName) => {
20
- let handlers = STYLE_HANDLER_MAP[styleName];
21
- if (!handlers) handlers = STYLE_HANDLER_MAP[styleName] = [createStyle(styleName)];
22
- handlers.forEach((handler) => {
23
- if (!seenHandlers.has(handler)) {
24
- seenHandlers.add(handler);
25
- handlerQueue.push(handler);
26
- }
27
- });
28
- });
29
- const declarationPairs = [];
30
- handlerQueue.forEach((handler) => {
31
- const result = handler(handler.__lookupStyles.reduce((acc, name) => {
32
- const v = styleMap[name];
33
- if (v !== void 0) acc[name] = v;
34
- return acc;
35
- }, {}));
36
- if (!result) return;
37
- (Array.isArray(result) ? result : [result]).forEach((cssMap) => {
38
- if (!cssMap || typeof cssMap !== "object") return;
39
- const { $: _$, ...props } = cssMap;
40
- Object.entries(props).forEach(([prop, val]) => {
41
- if (val == null || val === "") return;
42
- if (Array.isArray(val)) val.forEach((v) => {
43
- if (v != null && v !== "") declarationPairs.push({
44
- prop,
45
- value: String(v)
46
- });
47
- });
48
- else declarationPairs.push({
49
- prop,
50
- value: String(val)
51
- });
52
- });
53
- });
54
- });
55
- const declarations = declarationPairs.map((d) => `${d.prop}: ${d.value}`).join("; ");
56
- rules.push(`${key} { ${declarations.trim()} }`);
57
- }
58
- return rules.join(" ");
59
- }
60
- /**
61
- * Format a @keyframes rule as a CSS string.
62
- */
63
- function formatKeyframesCSS(name, steps) {
64
- return `@keyframes ${name} { ${stepsToCSS(steps)} }`;
65
- }
66
- //#endregion
67
- export { formatKeyframesCSS };
68
-
69
- //# sourceMappingURL=format-keyframes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-keyframes.js","names":[],"sources":["../../src/ssr/format-keyframes.ts"],"sourcesContent":["/**\n * Format @keyframes CSS rules for SSR output.\n *\n * Replicates the stepsToCSS logic from SheetManager but as a\n * standalone function that doesn't need DOM access.\n */\n\nimport type { KeyframesSteps } from '../injector/types';\nimport { createStyle, STYLE_HANDLER_MAP } from '../styles';\nimport type { CSSMap, StyleHandler, StyleValueStateMap } from '../utils/styles';\n\n/**\n * Convert keyframes steps to a CSS string.\n * Replicates SheetManager.stepsToCSS() without the class instance.\n */\nfunction stepsToCSS(steps: KeyframesSteps): string {\n const rules: string[] = [];\n\n for (const [key, value] of Object.entries(steps)) {\n if (typeof value === 'string') {\n rules.push(`${key} { ${value.trim()} }`);\n continue;\n }\n\n const styleMap = (value || {}) as StyleValueStateMap;\n const styleNames = Object.keys(styleMap).sort();\n const handlerQueue: StyleHandler[] = [];\n const seenHandlers = new Set<StyleHandler>();\n\n styleNames.forEach((styleName) => {\n let handlers = STYLE_HANDLER_MAP[styleName];\n if (!handlers) {\n handlers = STYLE_HANDLER_MAP[styleName] = [createStyle(styleName)];\n }\n\n handlers.forEach((handler) => {\n if (!seenHandlers.has(handler)) {\n seenHandlers.add(handler);\n handlerQueue.push(handler);\n }\n });\n });\n\n const declarationPairs: { prop: string; value: string }[] = [];\n\n handlerQueue.forEach((handler) => {\n const lookup = handler.__lookupStyles;\n const filteredMap = lookup.reduce<StyleValueStateMap>((acc, name) => {\n const v = styleMap[name];\n if (v !== undefined) acc[name] = v;\n return acc;\n }, {});\n\n const result = handler(filteredMap);\n if (!result) return;\n\n const results = Array.isArray(result) ? result : [result];\n results.forEach((cssMap) => {\n if (!cssMap || typeof cssMap !== 'object') return;\n const { $: _$, ...props } = cssMap as CSSMap;\n\n Object.entries(props).forEach(([prop, val]) => {\n if (val == null || val === '') return;\n\n if (Array.isArray(val)) {\n val.forEach((v) => {\n if (v != null && v !== '') {\n declarationPairs.push({ prop, value: String(v) });\n }\n });\n } else {\n declarationPairs.push({ prop, value: String(val) });\n }\n });\n });\n });\n\n const declarations = declarationPairs\n .map((d) => `${d.prop}: ${d.value}`)\n .join('; ');\n\n rules.push(`${key} { ${declarations.trim()} }`);\n }\n\n return rules.join(' ');\n}\n\n/**\n * Format a @keyframes rule as a CSS string.\n */\nexport function formatKeyframesCSS(\n name: string,\n steps: KeyframesSteps,\n): string {\n const cssSteps = stepsToCSS(steps);\n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MAAM,GACrB,kBAAiB,KAAK;OAAE;OAAM,OAAO,OAAO,EAAE;OAAE,CAAC;OAEnD;SAEF,kBAAiB,KAAK;MAAE;MAAM,OAAO,OAAO,IAAI;MAAE,CAAC;MAErD;KACF;IACF;EAEF,MAAM,eAAe,iBAClB,KAAK,MAAM,GAAG,EAAE,KAAK,IAAI,EAAE,QAAQ,CACnC,KAAK,KAAK;AAEb,QAAM,KAAK,GAAG,IAAI,KAAK,aAAa,MAAM,CAAC,IAAI;;AAGjD,QAAO,MAAM,KAAK,IAAI;;;;;AAMxB,SAAgB,mBACd,MACA,OACQ;AAER,QAAO,cAAc,KAAK,KADT,WAAW,MAAM,CACM"}
@@ -1,49 +0,0 @@
1
- import { colorInitialValueToComponents, getColorSpaceSuffix, getComponentPropertySyntax } from "../utils/color-space.js";
2
- import { getEffectiveDefinition } from "../properties/index.js";
3
- import { parseStyle } from "../utils/styles.js";
4
- //#region src/ssr/format-property.ts
5
- /**
6
- * Format a single @property rule as a CSS string.
7
- *
8
- * Returns the full `@property --name { ... }` text, or empty string
9
- * if the token is invalid. For color properties, also returns
10
- * the companion component property.
11
- */
12
- function formatPropertyCSS(token, definition) {
13
- const result = getEffectiveDefinition(token, definition);
14
- if (!result.isValid) return "";
15
- const rules = [];
16
- rules.push(buildPropertyRule(result.cssName, result.definition));
17
- if (result.isColor) {
18
- const suffix = getColorSpaceSuffix();
19
- const componentCssName = `${result.cssName}-${suffix}`;
20
- const componentInitial = colorInitialValueToComponents(result.definition.initialValue);
21
- rules.push(buildPropertyRule(componentCssName, {
22
- syntax: getComponentPropertySyntax(),
23
- inherits: result.definition.inherits,
24
- initialValue: componentInitial
25
- }));
26
- }
27
- return rules.join("\n");
28
- }
29
- function buildPropertyRule(cssName, definition) {
30
- const parts = [];
31
- if (definition.syntax != null) {
32
- let syntax = String(definition.syntax).trim();
33
- if (!/^['"]/u.test(syntax)) syntax = `"${syntax}"`;
34
- parts.push(`syntax: ${syntax};`);
35
- }
36
- const inherits = definition.inherits ?? true;
37
- parts.push(`inherits: ${inherits ? "true" : "false"};`);
38
- if (definition.initialValue != null) {
39
- let initialValueStr;
40
- if (typeof definition.initialValue === "number") initialValueStr = String(definition.initialValue);
41
- else initialValueStr = parseStyle(definition.initialValue).output;
42
- parts.push(`initial-value: ${initialValueStr};`);
43
- }
44
- return `@property ${cssName} { ${parts.join(" ").trim()} }`;
45
- }
46
- //#endregion
47
- export { formatPropertyCSS };
48
-
49
- //# sourceMappingURL=format-property.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-property.js","names":[],"sources":["../../src/ssr/format-property.ts"],"sourcesContent":["/**\n * Format @property CSS rules for SSR output.\n *\n * Replicates the CSS construction from StyleInjector.property()\n * but returns a CSS string instead of inserting into the DOM.\n */\n\nimport type { PropertyDefinition } from '../injector/types';\nimport { getEffectiveDefinition } from '../properties';\nimport {\n colorInitialValueToComponents,\n getColorSpaceSuffix,\n getComponentPropertySyntax,\n} from '../utils/color-space';\nimport type { StyleValue } from '../utils/styles';\nimport { parseStyle } from '../utils/styles';\n\n/**\n * Format a single @property rule as a CSS string.\n *\n * Returns the full `@property --name { ... }` text, or empty string\n * if the token is invalid. For color properties, also returns\n * the companion component property.\n */\nexport function formatPropertyCSS(\n token: string,\n definition: PropertyDefinition,\n): string {\n const result = getEffectiveDefinition(token, definition);\n if (!result.isValid) return '';\n\n const rules: string[] = [];\n\n rules.push(buildPropertyRule(result.cssName, result.definition));\n\n if (result.isColor) {\n const suffix = getColorSpaceSuffix();\n const componentCssName = `${result.cssName}-${suffix}`;\n const componentInitial = colorInitialValueToComponents(\n result.definition.initialValue,\n );\n rules.push(\n buildPropertyRule(componentCssName, {\n syntax: getComponentPropertySyntax(),\n inherits: result.definition.inherits,\n initialValue: componentInitial,\n }),\n );\n }\n\n return rules.join('\\n');\n}\n\nfunction buildPropertyRule(\n cssName: string,\n definition: PropertyDefinition,\n): string {\n const parts: string[] = [];\n\n if (definition.syntax != null) {\n let syntax = String(definition.syntax).trim();\n if (!/^['\"]/u.test(syntax)) syntax = `\"${syntax}\"`;\n parts.push(`syntax: ${syntax};`);\n }\n\n const inherits = definition.inherits ?? true;\n parts.push(`inherits: ${inherits ? 'true' : 'false'};`);\n\n if (definition.initialValue != null) {\n let initialValueStr: string;\n if (typeof definition.initialValue === 'number') {\n initialValueStr = String(definition.initialValue);\n } else {\n initialValueStr = parseStyle(\n definition.initialValue as StyleValue,\n ).output;\n }\n parts.push(`initial-value: ${initialValueStr};`);\n }\n\n const declarations = parts.join(' ').trim();\n return `@property ${cssName} { ${declarations} }`;\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,kBACd,OACA,YACQ;CACR,MAAM,SAAS,uBAAuB,OAAO,WAAW;AACxD,KAAI,CAAC,OAAO,QAAS,QAAO;CAE5B,MAAM,QAAkB,EAAE;AAE1B,OAAM,KAAK,kBAAkB,OAAO,SAAS,OAAO,WAAW,CAAC;AAEhE,KAAI,OAAO,SAAS;EAClB,MAAM,SAAS,qBAAqB;EACpC,MAAM,mBAAmB,GAAG,OAAO,QAAQ,GAAG;EAC9C,MAAM,mBAAmB,8BACvB,OAAO,WAAW,aACnB;AACD,QAAM,KACJ,kBAAkB,kBAAkB;GAClC,QAAQ,4BAA4B;GACpC,UAAU,OAAO,WAAW;GAC5B,cAAc;GACf,CAAC,CACH;;AAGH,QAAO,MAAM,KAAK,KAAK;;AAGzB,SAAS,kBACP,SACA,YACQ;CACR,MAAM,QAAkB,EAAE;AAE1B,KAAI,WAAW,UAAU,MAAM;EAC7B,IAAI,SAAS,OAAO,WAAW,OAAO,CAAC,MAAM;AAC7C,MAAI,CAAC,SAAS,KAAK,OAAO,CAAE,UAAS,IAAI,OAAO;AAChD,QAAM,KAAK,WAAW,OAAO,GAAG;;CAGlC,MAAM,WAAW,WAAW,YAAY;AACxC,OAAM,KAAK,aAAa,WAAW,SAAS,QAAQ,GAAG;AAEvD,KAAI,WAAW,gBAAgB,MAAM;EACnC,IAAI;AACJ,MAAI,OAAO,WAAW,iBAAiB,SACrC,mBAAkB,OAAO,WAAW,aAAa;MAEjD,mBAAkB,WAChB,WAAW,aACZ,CAAC;AAEJ,QAAM,KAAK,kBAAkB,gBAAgB,GAAG;;AAIlD,QAAO,aAAa,QAAQ,KADP,MAAM,KAAK,IAAI,CAAC,MAAM,CACG"}
@@ -1,73 +0,0 @@
1
- //#region src/ssr/format-rules.ts
2
- /**
3
- * Resolve selectors for a rule, applying className-based specificity doubling
4
- * and rootPrefix handling. Mirrors the logic in StyleInjector.inject().
5
- */
6
- function resolveSelector(rule, className) {
7
- let selector = rule.selector;
8
- if (rule.needsClassName) {
9
- const selectorParts = selector ? selector.split("|||") : [""];
10
- const classPrefix = `.${className}.${className}`;
11
- selector = selectorParts.map((part) => {
12
- const classSelector = part ? `${classPrefix}${part}` : classPrefix;
13
- if (rule.rootPrefix) return `${rule.rootPrefix} ${classSelector}`;
14
- return classSelector;
15
- }).join(", ");
16
- }
17
- return selector;
18
- }
19
- /**
20
- * Group rules by selector + at-rules + startingStyle and merge their declarations.
21
- * Mirrors the grouping logic in SheetManager.insertRule().
22
- */
23
- function groupRules(rules) {
24
- const groupMap = /* @__PURE__ */ new Map();
25
- const order = [];
26
- const atKey = (at) => at && at.length ? at.join("|") : "";
27
- for (const r of rules) {
28
- const key = `${atKey(r.atRules)}||${r.selector}||${r.startingStyle ? "1" : "0"}`;
29
- const existing = groupMap.get(key);
30
- if (existing) existing.declarations = existing.declarations ? `${existing.declarations} ${r.declarations}` : r.declarations;
31
- else {
32
- groupMap.set(key, {
33
- selector: r.selector,
34
- atRules: r.atRules,
35
- startingStyle: r.startingStyle,
36
- declarations: r.declarations
37
- });
38
- order.push(key);
39
- }
40
- }
41
- return order.map((key) => groupMap.get(key));
42
- }
43
- /**
44
- * Format an array of StyleResult rules into a CSS text string.
45
- *
46
- * Applies className-based specificity doubling (.cls.cls),
47
- * groups rules by selector + at-rules, and wraps with at-rule blocks.
48
- *
49
- * Produces the same CSS text as SheetManager.insertRule() would insert
50
- * into the DOM, but as a plain string suitable for SSR output.
51
- */
52
- function formatRules(rules, className) {
53
- if (rules.length === 0) return "";
54
- const grouped = groupRules(rules.map((rule) => ({
55
- selector: resolveSelector(rule, className),
56
- declarations: rule.declarations,
57
- atRules: rule.atRules,
58
- startingStyle: rule.startingStyle
59
- })));
60
- const cssRules = [];
61
- for (const rule of grouped) {
62
- const innerContent = rule.startingStyle ? `@starting-style { ${rule.declarations} }` : rule.declarations;
63
- const baseRule = `${rule.selector} { ${innerContent} }`;
64
- let fullRule = baseRule;
65
- if (rule.atRules && rule.atRules.length > 0) fullRule = rule.atRules.reduce((css, atRule) => `${atRule} { ${css} }`, baseRule);
66
- cssRules.push(fullRule);
67
- }
68
- return cssRules.join("\n");
69
- }
70
- //#endregion
71
- export { formatRules };
72
-
73
- //# sourceMappingURL=format-rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"format-rules.js","names":[],"sources":["../../src/ssr/format-rules.ts"],"sourcesContent":["/**\n * Shared CSS rule formatting utility.\n *\n * Extracted from SheetManager to allow both the DOM-based injector (client)\n * and the ServerStyleCollector (server) to produce identical CSS text\n * from StyleResult arrays.\n */\n\nimport type { StyleResult } from '../pipeline';\n\n/**\n * Resolve selectors for a rule, applying className-based specificity doubling\n * and rootPrefix handling. Mirrors the logic in StyleInjector.inject().\n */\nfunction resolveSelector(rule: StyleResult, className: string): string {\n let selector = rule.selector;\n\n if (rule.needsClassName) {\n const selectorParts = selector ? selector.split('|||') : [''];\n const classPrefix = `.${className}.${className}`;\n\n selector = selectorParts\n .map((part) => {\n const classSelector = part ? `${classPrefix}${part}` : classPrefix;\n\n if (rule.rootPrefix) {\n return `${rule.rootPrefix} ${classSelector}`;\n }\n return classSelector;\n })\n .join(', ');\n }\n\n return selector;\n}\n\ninterface GroupedRule {\n selector: string;\n declarations: string;\n atRules?: string[];\n startingStyle?: boolean;\n}\n\n/**\n * Group rules by selector + at-rules + startingStyle and merge their declarations.\n * Mirrors the grouping logic in SheetManager.insertRule().\n */\nfunction groupRules(rules: GroupedRule[]): GroupedRule[] {\n const groupMap = new Map<string, GroupedRule>();\n const order: string[] = [];\n\n const atKey = (at?: string[]) => (at && at.length ? at.join('|') : '');\n\n for (const r of rules) {\n const key = `${atKey(r.atRules)}||${r.selector}||${r.startingStyle ? '1' : '0'}`;\n const existing = groupMap.get(key);\n if (existing) {\n existing.declarations = existing.declarations\n ? `${existing.declarations} ${r.declarations}`\n : r.declarations;\n } else {\n groupMap.set(key, {\n selector: r.selector,\n atRules: r.atRules,\n startingStyle: r.startingStyle,\n declarations: r.declarations,\n });\n order.push(key);\n }\n }\n\n return order.map((key) => groupMap.get(key)!);\n}\n\n/**\n * Format an array of StyleResult rules into a CSS text string.\n *\n * Applies className-based specificity doubling (.cls.cls),\n * groups rules by selector + at-rules, and wraps with at-rule blocks.\n *\n * Produces the same CSS text as SheetManager.insertRule() would insert\n * into the DOM, but as a plain string suitable for SSR output.\n */\nexport function formatRules(rules: StyleResult[], className: string): string {\n if (rules.length === 0) return '';\n\n const resolvedRules = rules.map((rule) => ({\n selector: resolveSelector(rule, className),\n declarations: rule.declarations,\n atRules: rule.atRules,\n startingStyle: rule.startingStyle,\n }));\n\n const grouped = groupRules(resolvedRules);\n const cssRules: string[] = [];\n\n for (const rule of grouped) {\n const innerContent = rule.startingStyle\n ? `@starting-style { ${rule.declarations} }`\n : rule.declarations;\n const baseRule = `${rule.selector} { ${innerContent} }`;\n\n let fullRule = baseRule;\n if (rule.atRules && rule.atRules.length > 0) {\n fullRule = rule.atRules.reduce(\n (css, atRule) => `${atRule} { ${css} }`,\n baseRule,\n );\n }\n\n cssRules.push(fullRule);\n }\n\n return cssRules.join('\\n');\n}\n"],"mappings":";;;;;AAcA,SAAS,gBAAgB,MAAmB,WAA2B;CACrE,IAAI,WAAW,KAAK;AAEpB,KAAI,KAAK,gBAAgB;EACvB,MAAM,gBAAgB,WAAW,SAAS,MAAM,MAAM,GAAG,CAAC,GAAG;EAC7D,MAAM,cA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K,WAAW,KAAK,QAAQ,SAAS,EACxC,YAAW,KAAK,QAAQ,QACrB,KAAK,WAAW,GAAG,OAAO,KAAK,IAAI,KACpC,SACD;AAGH,WAAS,KAAK,SAAS;;AAGzB,QAAO,SAAS,KAAK,KAAK"}
@@ -1,22 +0,0 @@
1
- import { SSRCacheState } from "./collector.js";
2
-
3
- //#region src/ssr/hydrate.d.ts
4
- declare global {
5
- interface Window {
6
- __TASTY_SSR_CACHE__?: SSRCacheState;
7
- }
8
- }
9
- /**
10
- * Pre-populate the client-side style cache from the server's SSR state.
11
- *
12
- * Call this before ReactDOM.hydrateRoot() or ensure it runs before
13
- * any tasty() component renders on the client.
14
- *
15
- * When called without arguments, reads state from:
16
- * 1. `window.__TASTY_SSR_CACHE__` (streaming — populated by inline scripts)
17
- * 2. `<script data-tasty-cache>` (non-streaming — JSON payload)
18
- */
19
- declare function hydrateTastyCache(state?: SSRCacheState): void;
20
- //#endregion
21
- export { hydrateTastyCache };
22
- //# sourceMappingURL=hydrate.d.ts.map
@@ -1,49 +0,0 @@
1
- import { getGlobalInjector } from "../config.js";
2
- //#region src/ssr/hydrate.ts
3
- /**
4
- * Client-side cache hydration for SSR.
5
- *
6
- * Pre-populates the client injector's cacheKeyToClassName map from the
7
- * server's serialized state. This ensures that useStyles() returns
8
- * cache hits during hydration, skipping the entire rendering pipeline.
9
- */
10
- /**
11
- * Pre-populate the client-side style cache from the server's SSR state.
12
- *
13
- * Call this before ReactDOM.hydrateRoot() or ensure it runs before
14
- * any tasty() component renders on the client.
15
- *
16
- * When called without arguments, reads state from:
17
- * 1. `window.__TASTY_SSR_CACHE__` (streaming — populated by inline scripts)
18
- * 2. `<script data-tasty-cache>` (non-streaming — JSON payload)
19
- */
20
- function hydrateTastyCache(state) {
21
- if (typeof document === "undefined") return;
22
- if (!state) {
23
- state = (typeof window !== "undefined" ? window.__TASTY_SSR_CACHE__ : null) ?? void 0;
24
- if (!state) {
25
- const script = document.querySelector("script[data-tasty-cache]");
26
- if (script) try {
27
- state = JSON.parse(script.textContent);
28
- } catch {
29
- return;
30
- }
31
- }
32
- }
33
- if (!state) return;
34
- const registry = getGlobalInjector()._sheetManager.getRegistry(document);
35
- registry.classCounter = Math.max(registry.classCounter, state.classCounter);
36
- for (const [cacheKey, className] of Object.entries(state.entries)) {
37
- registry.cacheKeyToClassName.set(cacheKey, className);
38
- registry.rules.set(className, {
39
- className,
40
- ruleIndex: -2,
41
- sheetIndex: -2
42
- });
43
- registry.refCounts.set(className, 0);
44
- }
45
- }
46
- //#endregion
47
- export { hydrateTastyCache };
48
-
49
- //# sourceMappingURL=hydrate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hydrate.js","names":[],"sources":["../../src/ssr/hydrate.ts"],"sourcesContent":["/**\n * Client-side cache hydration for SSR.\n *\n * Pre-populates the client injector's cacheKeyToClassName map from the\n * server's serialized state. This ensures that useStyles() returns\n * cache hits during hydration, skipping the entire rendering pipeline.\n */\n\nimport { getGlobalInjector } from '../config';\nimport type { SSRCacheState } from './collector';\n\ndeclare global {\n interface Window {\n __TASTY_SSR_CACHE__?: SSRCacheState;\n }\n}\n\n/**\n * Pre-populate the client-side style cache from the server's SSR state.\n *\n * Call this before ReactDOM.hydrateRoot() or ensure it runs before\n * any tasty() component renders on the client.\n *\n * When called without arguments, reads state from:\n * 1. `window.__TASTY_SSR_CACHE__` (streaming — populated by inline scripts)\n * 2. `<script data-tasty-cache>` (non-streaming — JSON payload)\n */\nexport function hydrateTastyCache(state?: SSRCacheState): void {\n if (typeof document === 'undefined') return;\n\n if (!state) {\n state =\n (typeof window !== 'undefined' ? window.__TASTY_SSR_CACHE__ : null) ??\n undefined;\n if (!state) {\n const script = document.querySelector('script[data-tasty-cache]');\n if (script) {\n try {\n state = JSON.parse(script.textContent!) as SSRCacheState;\n } catch {\n return;\n }\n }\n }\n }\n\n if (!state) return;\n\n const injector = getGlobalInjector();\n const registry = injector._sheetManager.getRegistry(document);\n\n registry.classCounter = Math.max(registry.classCounter, state.classCounter);\n\n for (const [cacheKey, className] of Object.entries(state.entries)) {\n registry.cacheKeyToClassName.set(cacheKey, className);\n registry.rules.set(className, {\n className,\n ruleIndex: -2,\n sheetIndex: -2,\n });\n registry.refCounts.set(className, 0);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,kBAAkB,OAA6B;AAC7D,KAAI,OAAO,aAAa,YAAa;AAErC,KAAI,CAAC,OAAO;AACV,WACG,OAAO,WAAW,cAAc,OAAO,sBAAsB,SAC9D,KAAA;AACF,MAAI,CAAC,OAAO;GACV,MAAM,SAAS,SAAS,cAAc,2BAA2B;AACjE,OAAI,OACF,KAAI;AACF,YAAQ,KAAK,MAAM,OAAO,YAAa;WACjC;AACN;;;;AAMR,KAAI,CAAC,MAAO;CAGZ,MAAM,WADW,mBAAmB,CACV,cAAc,YAAY,SAAS;AAE7D,UAAS,eAAe,KAAK,IAAI,SAAS,cAAc,MAAM,aAAa;AAE3E,MAAK,MAAM,CAAC,UAAU,cAAc,OAAO,QAAQ,MAAM,QAAQ,EAAE;AACjE,WAAS,oBAAoB,IAAI,UAAU,UAAU;AACrD,WAAS,MAAM,IAAI,WAAW;GAC5B;GACA,WAAW;GACX,YAAY;GACb,CAAC;AACF,WAAS,UAAU,IAAI,WAAW,EAAE"}
@@ -1,12 +0,0 @@
1
- //#region src/ssr/ssr-collector-ref.ts
2
- let _getSSRCollector = null;
3
- function registerSSRCollectorGetter(fn) {
4
- _getSSRCollector = fn;
5
- }
6
- function getRegisteredSSRCollector() {
7
- return _getSSRCollector ? _getSSRCollector() : null;
8
- }
9
- //#endregion
10
- export { getRegisteredSSRCollector, registerSSRCollectorGetter };
11
-
12
- //# sourceMappingURL=ssr-collector-ref.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr-collector-ref.js","names":[],"sources":["../../src/ssr/ssr-collector-ref.ts"],"sourcesContent":["/**\n * Global reference to the SSR collector getter function.\n *\n * This indirection avoids importing 'node:async_hooks' in the browser bundle.\n * The SSR entry point sets this ref when loaded on the server. The useStyles\n * hook calls it if set; on the client it stays null and is never called.\n */\n\nimport type { ServerStyleCollector } from './collector';\n\ntype SSRCollectorGetter = () => ServerStyleCollector | null;\n\nlet _getSSRCollector: SSRCollectorGetter | null = null;\n\nexport function registerSSRCollectorGetter(fn: SSRCollectorGetter): void {\n _getSSRCollector = fn;\n}\n\nexport function getRegisteredSSRCollector(): ServerStyleCollector | null {\n return _getSSRCollector ? _getSSRCollector() : null;\n}\n"],"mappings":";AAYA,IAAI,mBAA8C;AAElD,SAAgB,2BAA2B,IAA8B;AACvE,oBAAmB;;AAGrB,SAAgB,4BAAyD;AACvE,QAAO,mBAAmB,kBAAkB,GAAG"}
@@ -1,49 +0,0 @@
1
- import { Styles } from "../styles/types.js";
2
-
3
- //#region src/states/index.d.ts
4
- /**
5
- * Parsed advanced state information
6
- */
7
- interface ParsedAdvancedState {
8
- type: 'media' | 'container' | 'root' | 'parent' | 'own' | 'starting' | 'predefined' | 'modifier';
9
- condition: string;
10
- containerName?: string;
11
- raw: string;
12
- mediaType?: string;
13
- }
14
- /**
15
- * Context for state parsing operations
16
- */
17
- interface StateParserContext {
18
- localPredefinedStates: Record<string, string>;
19
- globalPredefinedStates: Record<string, string>;
20
- isSubElement?: boolean;
21
- }
22
- /**
23
- * At-rule context for CSS generation
24
- */
25
- interface AtRuleContext {
26
- media?: string[];
27
- container?: {
28
- name?: string;
29
- condition: string;
30
- }[];
31
- startingStyle?: boolean;
32
- rootStates?: string[];
33
- negatedRootStates?: string[];
34
- }
35
- /**
36
- * Configure global predefined states
37
- */
38
- declare function setGlobalPredefinedStates(states: Record<string, string>): void;
39
- /**
40
- * Get global predefined states
41
- */
42
- declare function getGlobalPredefinedStates(): Record<string, string>;
43
- /**
44
- * Create a state parser context from styles
45
- */
46
- declare function createStateParserContext(styles?: Styles, isSubElement?: boolean): StateParserContext;
47
- //#endregion
48
- export { AtRuleContext, ParsedAdvancedState, StateParserContext, createStateParserContext, getGlobalPredefinedStates, setGlobalPredefinedStates };
49
- //# sourceMappingURL=index.d.ts.map