@tenphi/tasty 0.0.0-snapshot.d5c5a10 → 0.0.0-snapshot.d656d18

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 (356) hide show
  1. package/README.md +197 -141
  2. package/dist/babel-_RVkw0iE.d.ts +83 -0
  3. package/dist/{ssr/async-storage.js → chunks/async-storage-DKK-wTD4.js} +17 -8
  4. package/dist/chunks/async-storage-DKK-wTD4.js.map +1 -0
  5. package/dist/chunks/collector-DBGcmUEq.js +326 -0
  6. package/dist/chunks/collector-DBGcmUEq.js.map +1 -0
  7. package/dist/chunks/css-resources-Cyl_axbI.js +149 -0
  8. package/dist/chunks/css-resources-Cyl_axbI.js.map +1 -0
  9. package/dist/{zero/extractor.js → chunks/css-writer-PFzrSPeu.js} +149 -26
  10. package/dist/chunks/css-writer-PFzrSPeu.js.map +1 -0
  11. package/dist/{debug.js → chunks/debug-BUwqo6vC.js} +193 -65
  12. package/dist/chunks/debug-BUwqo6vC.js.map +1 -0
  13. package/dist/chunks/dsl-CXvoaLnj.js +2097 -0
  14. package/dist/chunks/dsl-CXvoaLnj.js.map +1 -0
  15. package/dist/chunks/hydrate-6YoHZP6A.js +37 -0
  16. package/dist/chunks/hydrate-6YoHZP6A.js.map +1 -0
  17. package/dist/chunks/react-runtime-B3CmvDEQ.js +1525 -0
  18. package/dist/chunks/react-runtime-B3CmvDEQ.js.map +1 -0
  19. package/dist/chunks/runtime-engine-Y00VWjrS.js +4719 -0
  20. package/dist/chunks/runtime-engine-Y00VWjrS.js.map +1 -0
  21. package/dist/{utils/merge-styles.js → chunks/shared-utils-OIg0N_dp.js} +43 -6
  22. package/dist/chunks/shared-utils-OIg0N_dp.js.map +1 -0
  23. package/dist/chunks/style-engine-CqSmIlud.js +7196 -0
  24. package/dist/chunks/style-engine-CqSmIlud.js.map +1 -0
  25. package/dist/collector-CVdVIy7s.d.ts +163 -0
  26. package/dist/config-BI0y21JV.d.ts +1367 -0
  27. package/dist/core/index.d.ts +5 -34
  28. package/dist/core/index.js +7 -27
  29. package/dist/index-BzAC3p06.d.ts +1616 -0
  30. package/dist/index-CrT0bsiI.d.ts +1980 -0
  31. package/dist/index.d.ts +5 -51
  32. package/dist/index.js +8 -36
  33. package/dist/{utils/merge-styles.d.ts → merge-styles-BFktNP8J.d.ts} +3 -3
  34. package/dist/ssr/astro-client.d.ts +1 -0
  35. package/dist/ssr/astro-client.js +19 -0
  36. package/dist/ssr/astro-client.js.map +1 -0
  37. package/dist/ssr/astro-middleware-extract-static.d.ts +11 -0
  38. package/dist/ssr/astro-middleware-extract-static.js +9 -0
  39. package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
  40. package/dist/ssr/astro-middleware-extract.d.ts +11 -0
  41. package/dist/ssr/astro-middleware-extract.js +9 -0
  42. package/dist/ssr/astro-middleware-extract.js.map +1 -0
  43. package/dist/ssr/astro-middleware-static.d.ts +18 -0
  44. package/dist/ssr/astro-middleware-static.js +18 -0
  45. package/dist/ssr/astro-middleware-static.js.map +1 -0
  46. package/dist/ssr/astro-middleware.d.ts +19 -0
  47. package/dist/ssr/astro-middleware.js +19 -0
  48. package/dist/ssr/astro-middleware.js.map +1 -0
  49. package/dist/ssr/astro.d.ts +117 -11
  50. package/dist/ssr/astro.js +268 -33
  51. package/dist/ssr/astro.js.map +1 -1
  52. package/dist/ssr/index.d.ts +37 -5
  53. package/dist/ssr/index.js +7 -9
  54. package/dist/ssr/index.js.map +1 -1
  55. package/dist/ssr/next-config.d.ts +66 -0
  56. package/dist/ssr/next-config.js +115 -0
  57. package/dist/ssr/next-config.js.map +1 -0
  58. package/dist/ssr/next.d.ts +14 -7
  59. package/dist/ssr/next.js +39 -20
  60. package/dist/ssr/next.js.map +1 -1
  61. package/dist/static/index.d.ts +91 -5
  62. package/dist/static/index.js +49 -4
  63. package/dist/static/index.js.map +1 -0
  64. package/dist/static/inject.d.ts +5 -0
  65. package/dist/static/inject.js +17 -0
  66. package/dist/static/inject.js.map +1 -0
  67. package/dist/zero/babel.d.ts +2 -167
  68. package/dist/zero/babel.js +160 -57
  69. package/dist/zero/babel.js.map +1 -1
  70. package/dist/zero/index.d.ts +81 -3
  71. package/dist/zero/index.js +2 -4
  72. package/dist/zero/next.d.ts +13 -1
  73. package/dist/zero/next.js +6 -5
  74. package/dist/zero/next.js.map +1 -1
  75. package/docs/README.md +20 -12
  76. package/docs/adoption.md +59 -32
  77. package/docs/ai-agents.md +229 -0
  78. package/docs/comparison.md +76 -48
  79. package/docs/configuration.md +566 -69
  80. package/docs/debug.md +37 -23
  81. package/docs/design-system.md +63 -32
  82. package/docs/dsl.md +527 -180
  83. package/docs/getting-started.md +62 -41
  84. package/docs/injector.md +157 -51
  85. package/docs/methodology.md +116 -35
  86. package/docs/migration-v3.md +285 -0
  87. package/docs/pipeline.md +741 -0
  88. package/docs/plugins.md +353 -0
  89. package/docs/react-api.md +681 -0
  90. package/docs/runtime-benchmarks.md +351 -0
  91. package/docs/ssr.md +356 -130
  92. package/docs/styles.md +127 -26
  93. package/docs/tasty-static.md +219 -70
  94. package/package.json +108 -23
  95. package/tasty.config.ts +6 -0
  96. package/dist/_virtual/_rolldown/runtime.js +0 -8
  97. package/dist/chunks/cacheKey.js +0 -78
  98. package/dist/chunks/cacheKey.js.map +0 -1
  99. package/dist/chunks/definitions.d.ts +0 -37
  100. package/dist/chunks/definitions.js +0 -259
  101. package/dist/chunks/definitions.js.map +0 -1
  102. package/dist/chunks/renderChunk.js +0 -60
  103. package/dist/chunks/renderChunk.js.map +0 -1
  104. package/dist/config.d.ts +0 -366
  105. package/dist/config.js +0 -504
  106. package/dist/config.js.map +0 -1
  107. package/dist/counter-style/index.js +0 -51
  108. package/dist/counter-style/index.js.map +0 -1
  109. package/dist/debug.d.ts +0 -89
  110. package/dist/debug.js.map +0 -1
  111. package/dist/font-face/index.js +0 -63
  112. package/dist/font-face/index.js.map +0 -1
  113. package/dist/hooks/resolve-ssr-collector.js +0 -15
  114. package/dist/hooks/resolve-ssr-collector.js.map +0 -1
  115. package/dist/hooks/useCounterStyle.d.ts +0 -50
  116. package/dist/hooks/useCounterStyle.js +0 -47
  117. package/dist/hooks/useCounterStyle.js.map +0 -1
  118. package/dist/hooks/useFontFace.d.ts +0 -43
  119. package/dist/hooks/useFontFace.js +0 -71
  120. package/dist/hooks/useFontFace.js.map +0 -1
  121. package/dist/hooks/useGlobalStyles.d.ts +0 -30
  122. package/dist/hooks/useGlobalStyles.js +0 -79
  123. package/dist/hooks/useGlobalStyles.js.map +0 -1
  124. package/dist/hooks/useKeyframes.d.ts +0 -56
  125. package/dist/hooks/useKeyframes.js +0 -65
  126. package/dist/hooks/useKeyframes.js.map +0 -1
  127. package/dist/hooks/useProperty.d.ts +0 -79
  128. package/dist/hooks/useProperty.js +0 -110
  129. package/dist/hooks/useProperty.js.map +0 -1
  130. package/dist/hooks/useRawCSS.d.ts +0 -53
  131. package/dist/hooks/useRawCSS.js +0 -36
  132. package/dist/hooks/useRawCSS.js.map +0 -1
  133. package/dist/hooks/useStyles.d.ts +0 -45
  134. package/dist/hooks/useStyles.js +0 -270
  135. package/dist/hooks/useStyles.js.map +0 -1
  136. package/dist/injector/index.d.ts +0 -183
  137. package/dist/injector/index.js +0 -180
  138. package/dist/injector/index.js.map +0 -1
  139. package/dist/injector/injector.d.ts +0 -166
  140. package/dist/injector/injector.js +0 -465
  141. package/dist/injector/injector.js.map +0 -1
  142. package/dist/injector/sheet-manager.d.ts +0 -136
  143. package/dist/injector/sheet-manager.js +0 -731
  144. package/dist/injector/sheet-manager.js.map +0 -1
  145. package/dist/injector/types.d.ts +0 -204
  146. package/dist/keyframes/index.js +0 -206
  147. package/dist/keyframes/index.js.map +0 -1
  148. package/dist/parser/classify.js +0 -320
  149. package/dist/parser/classify.js.map +0 -1
  150. package/dist/parser/const.js +0 -33
  151. package/dist/parser/const.js.map +0 -1
  152. package/dist/parser/lru.js +0 -109
  153. package/dist/parser/lru.js.map +0 -1
  154. package/dist/parser/parser.d.ts +0 -25
  155. package/dist/parser/parser.js +0 -116
  156. package/dist/parser/parser.js.map +0 -1
  157. package/dist/parser/tokenizer.js +0 -69
  158. package/dist/parser/tokenizer.js.map +0 -1
  159. package/dist/parser/types.d.ts +0 -51
  160. package/dist/parser/types.js +0 -46
  161. package/dist/parser/types.js.map +0 -1
  162. package/dist/pipeline/conditions.d.ts +0 -134
  163. package/dist/pipeline/conditions.js +0 -406
  164. package/dist/pipeline/conditions.js.map +0 -1
  165. package/dist/pipeline/exclusive.js +0 -231
  166. package/dist/pipeline/exclusive.js.map +0 -1
  167. package/dist/pipeline/index.d.ts +0 -53
  168. package/dist/pipeline/index.js +0 -699
  169. package/dist/pipeline/index.js.map +0 -1
  170. package/dist/pipeline/materialize.js +0 -1105
  171. package/dist/pipeline/materialize.js.map +0 -1
  172. package/dist/pipeline/parseStateKey.d.ts +0 -15
  173. package/dist/pipeline/parseStateKey.js +0 -447
  174. package/dist/pipeline/parseStateKey.js.map +0 -1
  175. package/dist/pipeline/simplify.js +0 -516
  176. package/dist/pipeline/simplify.js.map +0 -1
  177. package/dist/pipeline/warnings.js +0 -18
  178. package/dist/pipeline/warnings.js.map +0 -1
  179. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  180. package/dist/plugins/okhsl-plugin.js +0 -98
  181. package/dist/plugins/okhsl-plugin.js.map +0 -1
  182. package/dist/plugins/types.d.ts +0 -76
  183. package/dist/properties/index.js +0 -223
  184. package/dist/properties/index.js.map +0 -1
  185. package/dist/properties/property-type-resolver.d.ts +0 -24
  186. package/dist/properties/property-type-resolver.js +0 -91
  187. package/dist/properties/property-type-resolver.js.map +0 -1
  188. package/dist/ssr/async-storage.d.ts +0 -17
  189. package/dist/ssr/async-storage.js.map +0 -1
  190. package/dist/ssr/collect-auto-properties.js +0 -40
  191. package/dist/ssr/collect-auto-properties.js.map +0 -1
  192. package/dist/ssr/collector.d.ts +0 -102
  193. package/dist/ssr/collector.js +0 -227
  194. package/dist/ssr/collector.js.map +0 -1
  195. package/dist/ssr/context.d.ts +0 -8
  196. package/dist/ssr/context.js +0 -14
  197. package/dist/ssr/context.js.map +0 -1
  198. package/dist/ssr/format-global-rules.js +0 -22
  199. package/dist/ssr/format-global-rules.js.map +0 -1
  200. package/dist/ssr/format-keyframes.js +0 -70
  201. package/dist/ssr/format-keyframes.js.map +0 -1
  202. package/dist/ssr/format-property.js +0 -50
  203. package/dist/ssr/format-property.js.map +0 -1
  204. package/dist/ssr/format-rules.js +0 -70
  205. package/dist/ssr/format-rules.js.map +0 -1
  206. package/dist/ssr/hydrate.d.ts +0 -22
  207. package/dist/ssr/hydrate.js +0 -50
  208. package/dist/ssr/hydrate.js.map +0 -1
  209. package/dist/ssr/ssr-collector-ref.js +0 -12
  210. package/dist/ssr/ssr-collector-ref.js.map +0 -1
  211. package/dist/states/index.d.ts +0 -49
  212. package/dist/states/index.js +0 -171
  213. package/dist/states/index.js.map +0 -1
  214. package/dist/static/tastyStatic.d.ts +0 -46
  215. package/dist/static/tastyStatic.js +0 -31
  216. package/dist/static/tastyStatic.js.map +0 -1
  217. package/dist/static/types.d.ts +0 -49
  218. package/dist/static/types.js +0 -24
  219. package/dist/static/types.js.map +0 -1
  220. package/dist/styles/align.d.ts +0 -15
  221. package/dist/styles/align.js +0 -14
  222. package/dist/styles/align.js.map +0 -1
  223. package/dist/styles/border.d.ts +0 -25
  224. package/dist/styles/border.js +0 -114
  225. package/dist/styles/border.js.map +0 -1
  226. package/dist/styles/color.d.ts +0 -14
  227. package/dist/styles/color.js +0 -27
  228. package/dist/styles/color.js.map +0 -1
  229. package/dist/styles/createStyle.js +0 -80
  230. package/dist/styles/createStyle.js.map +0 -1
  231. package/dist/styles/dimension.js +0 -97
  232. package/dist/styles/dimension.js.map +0 -1
  233. package/dist/styles/display.d.ts +0 -37
  234. package/dist/styles/display.js +0 -67
  235. package/dist/styles/display.js.map +0 -1
  236. package/dist/styles/fade.d.ts +0 -15
  237. package/dist/styles/fade.js +0 -58
  238. package/dist/styles/fade.js.map +0 -1
  239. package/dist/styles/fill.d.ts +0 -42
  240. package/dist/styles/fill.js +0 -52
  241. package/dist/styles/fill.js.map +0 -1
  242. package/dist/styles/flow.d.ts +0 -16
  243. package/dist/styles/flow.js +0 -12
  244. package/dist/styles/flow.js.map +0 -1
  245. package/dist/styles/gap.d.ts +0 -31
  246. package/dist/styles/gap.js +0 -37
  247. package/dist/styles/gap.js.map +0 -1
  248. package/dist/styles/height.d.ts +0 -17
  249. package/dist/styles/height.js +0 -20
  250. package/dist/styles/height.js.map +0 -1
  251. package/dist/styles/index.d.ts +0 -2
  252. package/dist/styles/index.js +0 -9
  253. package/dist/styles/index.js.map +0 -1
  254. package/dist/styles/inset.d.ts +0 -52
  255. package/dist/styles/inset.js +0 -150
  256. package/dist/styles/inset.js.map +0 -1
  257. package/dist/styles/justify.d.ts +0 -15
  258. package/dist/styles/justify.js +0 -14
  259. package/dist/styles/justify.js.map +0 -1
  260. package/dist/styles/list.d.ts +0 -16
  261. package/dist/styles/list.js +0 -98
  262. package/dist/styles/list.js.map +0 -1
  263. package/dist/styles/margin.d.ts +0 -24
  264. package/dist/styles/margin.js +0 -104
  265. package/dist/styles/margin.js.map +0 -1
  266. package/dist/styles/outline.d.ts +0 -29
  267. package/dist/styles/outline.js +0 -65
  268. package/dist/styles/outline.js.map +0 -1
  269. package/dist/styles/padding.d.ts +0 -24
  270. package/dist/styles/padding.js +0 -104
  271. package/dist/styles/padding.js.map +0 -1
  272. package/dist/styles/predefined.d.ts +0 -71
  273. package/dist/styles/predefined.js +0 -238
  274. package/dist/styles/predefined.js.map +0 -1
  275. package/dist/styles/preset.d.ts +0 -47
  276. package/dist/styles/preset.js +0 -112
  277. package/dist/styles/preset.js.map +0 -1
  278. package/dist/styles/radius.d.ts +0 -14
  279. package/dist/styles/radius.js +0 -51
  280. package/dist/styles/radius.js.map +0 -1
  281. package/dist/styles/scrollbar.d.ts +0 -25
  282. package/dist/styles/scrollbar.js +0 -48
  283. package/dist/styles/scrollbar.js.map +0 -1
  284. package/dist/styles/shadow.d.ts +0 -14
  285. package/dist/styles/shadow.js +0 -24
  286. package/dist/styles/shadow.js.map +0 -1
  287. package/dist/styles/transition.d.ts +0 -14
  288. package/dist/styles/transition.js +0 -158
  289. package/dist/styles/transition.js.map +0 -1
  290. package/dist/styles/types.d.ts +0 -545
  291. package/dist/styles/width.d.ts +0 -17
  292. package/dist/styles/width.js +0 -20
  293. package/dist/styles/width.js.map +0 -1
  294. package/dist/tasty.d.ts +0 -119
  295. package/dist/tasty.js +0 -232
  296. package/dist/tasty.js.map +0 -1
  297. package/dist/types.d.ts +0 -184
  298. package/dist/utils/cache-wrapper.js +0 -22
  299. package/dist/utils/cache-wrapper.js.map +0 -1
  300. package/dist/utils/case-converter.js +0 -8
  301. package/dist/utils/case-converter.js.map +0 -1
  302. package/dist/utils/color-math.d.ts +0 -46
  303. package/dist/utils/color-math.js +0 -749
  304. package/dist/utils/color-math.js.map +0 -1
  305. package/dist/utils/color-space.d.ts +0 -5
  306. package/dist/utils/color-space.js +0 -229
  307. package/dist/utils/color-space.js.map +0 -1
  308. package/dist/utils/colors.d.ts +0 -5
  309. package/dist/utils/colors.js +0 -11
  310. package/dist/utils/colors.js.map +0 -1
  311. package/dist/utils/css-types.d.ts +0 -7
  312. package/dist/utils/dotize.d.ts +0 -26
  313. package/dist/utils/dotize.js +0 -122
  314. package/dist/utils/dotize.js.map +0 -1
  315. package/dist/utils/filter-base-props.d.ts +0 -15
  316. package/dist/utils/filter-base-props.js +0 -45
  317. package/dist/utils/filter-base-props.js.map +0 -1
  318. package/dist/utils/get-display-name.d.ts +0 -7
  319. package/dist/utils/get-display-name.js +0 -10
  320. package/dist/utils/get-display-name.js.map +0 -1
  321. package/dist/utils/has-keys.js +0 -13
  322. package/dist/utils/has-keys.js.map +0 -1
  323. package/dist/utils/is-dev-env.js +0 -19
  324. package/dist/utils/is-dev-env.js.map +0 -1
  325. package/dist/utils/is-valid-element-type.js +0 -15
  326. package/dist/utils/is-valid-element-type.js.map +0 -1
  327. package/dist/utils/merge-styles.js.map +0 -1
  328. package/dist/utils/mod-attrs.d.ts +0 -8
  329. package/dist/utils/mod-attrs.js +0 -21
  330. package/dist/utils/mod-attrs.js.map +0 -1
  331. package/dist/utils/process-tokens.d.ts +0 -21
  332. package/dist/utils/process-tokens.js +0 -91
  333. package/dist/utils/process-tokens.js.map +0 -1
  334. package/dist/utils/resolve-recipes.d.ts +0 -17
  335. package/dist/utils/resolve-recipes.js +0 -147
  336. package/dist/utils/resolve-recipes.js.map +0 -1
  337. package/dist/utils/selector-transform.js +0 -32
  338. package/dist/utils/selector-transform.js.map +0 -1
  339. package/dist/utils/string.js +0 -8
  340. package/dist/utils/string.js.map +0 -1
  341. package/dist/utils/styles.d.ts +0 -100
  342. package/dist/utils/styles.js +0 -222
  343. package/dist/utils/styles.js.map +0 -1
  344. package/dist/utils/typography.d.ts +0 -47
  345. package/dist/utils/typography.js +0 -43
  346. package/dist/utils/typography.js.map +0 -1
  347. package/dist/utils/warnings.d.ts +0 -16
  348. package/dist/utils/warnings.js +0 -16
  349. package/dist/utils/warnings.js.map +0 -1
  350. package/dist/zero/css-writer.d.ts +0 -45
  351. package/dist/zero/css-writer.js +0 -74
  352. package/dist/zero/css-writer.js.map +0 -1
  353. package/dist/zero/extractor.d.ts +0 -24
  354. package/dist/zero/extractor.js.map +0 -1
  355. package/docs/PIPELINE.md +0 -519
  356. package/docs/runtime.md +0 -485
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenphi/tasty",
3
- "version": "0.0.0-snapshot.d5c5a10",
3
+ "version": "0.0.0-snapshot.d656d18",
4
4
  "description": "A design-system-integrated styling system and DSL for concise, state-aware UI styling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,6 +17,11 @@
17
17
  "import": "./dist/static/index.js",
18
18
  "default": "./dist/static/index.js"
19
19
  },
20
+ "./static/inject": {
21
+ "types": "./dist/static/inject.d.ts",
22
+ "import": "./dist/static/inject.js",
23
+ "default": "./dist/static/inject.js"
24
+ },
20
25
  "./babel-plugin": {
21
26
  "types": "./dist/zero/babel.d.ts",
22
27
  "import": "./dist/zero/babel.js",
@@ -27,7 +32,7 @@
27
32
  "import": "./dist/zero/index.js",
28
33
  "default": "./dist/zero/index.js"
29
34
  },
30
- "./next": {
35
+ "./zero/next": {
31
36
  "types": "./dist/zero/next.d.ts",
32
37
  "import": "./dist/zero/next.js",
33
38
  "default": "./dist/zero/next.js"
@@ -47,11 +52,41 @@
47
52
  "import": "./dist/ssr/next.js",
48
53
  "default": "./dist/ssr/next.js"
49
54
  },
55
+ "./ssr/next-config": {
56
+ "types": "./dist/ssr/next-config.d.ts",
57
+ "import": "./dist/ssr/next-config.js",
58
+ "default": "./dist/ssr/next-config.js"
59
+ },
50
60
  "./ssr/astro": {
51
61
  "types": "./dist/ssr/astro.d.ts",
52
62
  "import": "./dist/ssr/astro.js",
53
63
  "default": "./dist/ssr/astro.js"
54
64
  },
65
+ "./ssr/astro-client": {
66
+ "types": "./dist/ssr/astro-client.d.ts",
67
+ "import": "./dist/ssr/astro-client.js",
68
+ "default": "./dist/ssr/astro-client.js"
69
+ },
70
+ "./ssr/astro-middleware": {
71
+ "types": "./dist/ssr/astro-middleware.d.ts",
72
+ "import": "./dist/ssr/astro-middleware.js",
73
+ "default": "./dist/ssr/astro-middleware.js"
74
+ },
75
+ "./ssr/astro-middleware-static": {
76
+ "types": "./dist/ssr/astro-middleware-static.d.ts",
77
+ "import": "./dist/ssr/astro-middleware-static.js",
78
+ "default": "./dist/ssr/astro-middleware-static.js"
79
+ },
80
+ "./ssr/astro-middleware-extract": {
81
+ "types": "./dist/ssr/astro-middleware-extract.d.ts",
82
+ "import": "./dist/ssr/astro-middleware-extract.js",
83
+ "default": "./dist/ssr/astro-middleware-extract.js"
84
+ },
85
+ "./ssr/astro-middleware-extract-static": {
86
+ "types": "./dist/ssr/astro-middleware-extract-static.d.ts",
87
+ "import": "./dist/ssr/astro-middleware-extract-static.js",
88
+ "default": "./dist/ssr/astro-middleware-extract-static.js"
89
+ },
55
90
  "./tasty.config": "./tasty.config.ts"
56
91
  },
57
92
  "files": [
@@ -62,7 +97,12 @@
62
97
  "sideEffects": [
63
98
  "./dist/ssr/index.js",
64
99
  "./dist/ssr/next.js",
65
- "./dist/ssr/astro.js"
100
+ "./dist/ssr/astro.js",
101
+ "./dist/ssr/astro-client.js",
102
+ "./dist/ssr/astro-middleware.js",
103
+ "./dist/ssr/astro-middleware-static.js",
104
+ "./dist/ssr/astro-middleware-extract.js",
105
+ "./dist/ssr/astro-middleware-extract-static.js"
66
106
  ],
67
107
  "engines": {
68
108
  "node": ">=20"
@@ -70,6 +110,9 @@
70
110
  "scripts": {
71
111
  "build": "tsdown",
72
112
  "test": "vitest run",
113
+ "test:node": "vitest run --project node",
114
+ "test:browser": "vitest run --project browser",
115
+ "test:setup": "playwright install chromium",
73
116
  "test:watch": "vitest",
74
117
  "test:coverage": "vitest run --coverage",
75
118
  "typecheck": "tsc --noEmit",
@@ -78,11 +121,19 @@
78
121
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
79
122
  "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
80
123
  "size": "size-limit",
81
- "bench": "vitest bench",
124
+ "bench": "vitest bench --project node",
125
+ "bench:browser": "vitest bench --project browser",
126
+ "bench:overhead": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-overhead.bench.tsx",
127
+ "bench:injection": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-injection.bench.ts",
128
+ "bench:interaction": "vitest bench --config vitest.production-browser-bench.config.ts src/tasty-interaction.bench.tsx",
129
+ "bench:cold-start": "node scripts/cold-start/index.mjs",
82
130
  "prepublishOnly": "pnpm run build",
83
131
  "changeset": "changeset",
84
132
  "version": "changeset version",
85
133
  "release": "changeset publish",
134
+ "knip": "knip",
135
+ "check:build": "node scripts/check-built-entries.mjs",
136
+ "check:test-only": "node scripts/check-test-only-code.mjs",
86
137
  "hygiene": "pnpm lint && pnpm format:check && pnpm typecheck",
87
138
  "hygiene:fix": "pnpm lint:fix && pnpm format && pnpm typecheck"
88
139
  },
@@ -112,6 +163,7 @@
112
163
  "@babel/helper-plugin-utils": "^7.24.0",
113
164
  "@babel/types": "^7.24.0",
114
165
  "jiti": "^2.6.1",
166
+ "next": ">=14.0.0",
115
167
  "react": "^18.0.0 || ^19.0.0"
116
168
  },
117
169
  "peerDependenciesMeta": {
@@ -129,60 +181,93 @@
129
181
  },
130
182
  "jiti": {
131
183
  "optional": true
184
+ },
185
+ "next": {
186
+ "optional": true
132
187
  }
133
188
  },
134
189
  "dependencies": {
135
190
  "csstype": "^3.1.0"
136
191
  },
137
192
  "devDependencies": {
193
+ "@astrojs/react": "^4.4.2",
138
194
  "@babel/core": "^7.24.0",
139
- "@changesets/changelog-github": "^0.5.2",
195
+ "@babel/helper-plugin-utils": "^7.24.0",
196
+ "@babel/types": "^7.24.0",
197
+ "@changesets/changelog-github": "^0.7.0",
140
198
  "@changesets/cli": "^2.29.8",
141
199
  "@eslint/js": "^10.0.1",
142
200
  "@size-limit/esbuild": "^12.0.0",
143
201
  "@size-limit/file": "^12.0.0",
202
+ "@tenphi/eslint-plugin-tasty": "^1.0.5",
144
203
  "@testing-library/jest-dom": "^6.9.1",
145
204
  "@testing-library/react": "^16.3.2",
146
205
  "@types/babel__core": "^7.20.5",
147
206
  "@types/babel__helper-plugin-utils": "^7.10.3",
148
- "@types/node": "^25.3.2",
207
+ "@types/node": "^24.13.3",
149
208
  "@types/react": "^19.0.0",
150
- "@vitest/runner": "^4.0.18",
209
+ "@types/react-dom": "^19.0.0",
210
+ "@vitest/browser-playwright": "^4.1.10",
211
+ "astro": "^5.18.2",
212
+ "esbuild": "^0.27.7",
151
213
  "eslint": "^10.0.0",
152
214
  "eslint-config-prettier": "^10.1.8",
153
- "jsdom": "^28.1.0",
154
- "prettier": "^3.8.1",
215
+ "jiti": "^2.6.1",
216
+ "knip": "^5.61.3",
217
+ "next": "^16.0.0",
218
+ "playwright": "^1.62.1",
219
+ "prettier": "^3.9.6",
155
220
  "react": "^19.0.0",
221
+ "react-dom": "^19.0.0",
156
222
  "size-limit": "^12.0.0",
157
- "tsdown": "^0.20.3",
158
- "typescript": "^5.9.3",
223
+ "tsdown": "^0.22.0",
224
+ "typescript": "^6.0.2",
159
225
  "typescript-eslint": "^8.56.0",
160
- "vitest": "^4.0.18"
161
- },
162
- "pnpm": {
163
- "onlyBuiltDependencies": [
164
- "esbuild"
165
- ]
226
+ "vitest": "^4.1.10"
166
227
  },
167
- "packageManager": "pnpm@10.32.1",
228
+ "packageManager": "pnpm@11.24.0",
168
229
  "size-limit": [
169
230
  {
170
231
  "name": "main (import *)",
171
232
  "path": "dist/index.js",
172
233
  "import": "*",
173
- "limit": "47 kB"
234
+ "limit": "58.5 kB"
235
+ },
236
+ {
237
+ "name": "main (tasty)",
238
+ "path": "dist/index.js",
239
+ "import": "{ tasty }",
240
+ "limit": "51.5 kB"
241
+ },
242
+ {
243
+ "name": "main (StyleParser)",
244
+ "path": "dist/index.js",
245
+ "import": "{ StyleParser }",
246
+ "limit": "7.5 kB"
247
+ },
248
+ {
249
+ "name": "main (parseColor)",
250
+ "path": "dist/index.js",
251
+ "import": "{ parseColor }",
252
+ "limit": "8 kB"
253
+ },
254
+ {
255
+ "name": "main (useRawCSS)",
256
+ "path": "dist/index.js",
257
+ "import": "{ useRawCSS }",
258
+ "limit": "32 kB"
174
259
  },
175
260
  {
176
261
  "name": "core (import *)",
177
262
  "path": "dist/core/index.js",
178
263
  "import": "*",
179
- "limit": "45 kB"
264
+ "limit": "55.5 kB"
180
265
  },
181
266
  {
182
267
  "name": "static",
183
268
  "path": "dist/static/index.js",
184
269
  "import": "*",
185
- "limit": "2 kB"
270
+ "limit": "2.1 kB"
186
271
  },
187
272
  {
188
273
  "name": "zero",
@@ -193,7 +278,7 @@
193
278
  "path",
194
279
  "crypto"
195
280
  ],
196
- "limit": "28 kB"
281
+ "limit": "33.3 kB"
197
282
  },
198
283
  {
199
284
  "name": "babel-plugin",
@@ -204,7 +289,7 @@
204
289
  "path",
205
290
  "crypto"
206
291
  ],
207
- "limit": "40 kB"
292
+ "limit": "51.7 kB"
208
293
  }
209
294
  ]
210
295
  }
package/tasty.config.ts CHANGED
@@ -3,6 +3,7 @@ export default {
3
3
  '#white',
4
4
  '#black',
5
5
  '#current',
6
+ '#clear',
6
7
  '$gap',
7
8
  '$radius',
8
9
  '$border-width',
@@ -11,4 +12,9 @@ export default {
11
12
  '$sharp-radius',
12
13
  '$bold-font-weight',
13
14
  ],
15
+ styles: ['viewTransitionName'],
16
+ // This repo imports its own API relatively, so the plugin's default
17
+ // `@tenphi/tasty` import tracking never matches. List the local entry points so
18
+ // `tasty({ styles })` call sites are actually linted.
19
+ importSources: ['@tenphi/tasty', './tasty', '../tasty', './src/tasty'],
14
20
  };
@@ -1,8 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
3
- if (typeof require !== "undefined") return require.apply(this, arguments);
4
- throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
5
- });
6
-
7
- //#endregion
8
- export { __require };
@@ -1,78 +0,0 @@
1
- import { extractLocalPredefinedStates, extractPredefinedStateRefs } from "../states/index.js";
2
-
3
- //#region src/chunks/cacheKey.ts
4
- /**
5
- * Chunk-specific cache key generation.
6
- *
7
- * Generates cache keys that only include styles relevant to a specific chunk,
8
- * enabling more granular caching and reuse.
9
- *
10
- * Enhanced to support predefined states:
11
- * - Global predefined states don't affect cache keys (constant across app)
12
- * - Local predefined states only affect cache keys if referenced in the chunk
13
- */
14
- const _stableStringifyCache = /* @__PURE__ */ new WeakMap();
15
- /**
16
- * Recursively serialize a value with sorted keys for stable output.
17
- * This ensures that {a: 1, b: 2} and {b: 2, a: 1} produce the same string.
18
- * Uses a WeakMap cache for object values to avoid re-serializing the same references.
19
- */
20
- function stableStringify(value) {
21
- if (value === null) return "null";
22
- if (value === void 0) return "undefined";
23
- if (typeof value !== "object") return JSON.stringify(value);
24
- const cached = _stableStringifyCache.get(value);
25
- if (cached !== void 0) return cached;
26
- let result;
27
- if (Array.isArray(value)) result = "[" + value.map(stableStringify).join(",") + "]";
28
- else {
29
- const obj = value;
30
- const sortedKeys = Object.keys(obj).sort();
31
- const parts = [];
32
- for (const key of sortedKeys) if (obj[key] !== void 0) parts.push(`${JSON.stringify(key)}:${stableStringify(obj[key])}`);
33
- result = "{" + parts.join(",") + "}";
34
- }
35
- _stableStringifyCache.set(value, result);
36
- return result;
37
- }
38
- /**
39
- * Generate a cache key for a specific chunk.
40
- *
41
- * Only includes the styles that belong to this chunk, allowing
42
- * chunks to be cached independently.
43
- *
44
- * Also includes relevant local predefined states that are referenced
45
- * by this chunk's styles.
46
- *
47
- * @param styles - The full styles object
48
- * @param chunkName - Name of the chunk
49
- * @param styleKeys - Keys of styles belonging to this chunk
50
- * @returns A stable cache key string
51
- */
52
- function generateChunkCacheKey(styles, chunkName, styleKeys) {
53
- const parts = [chunkName];
54
- let chunkStylesStr = "";
55
- for (const key of styleKeys) {
56
- const value = styles[key];
57
- if (value !== void 0) {
58
- const serialized = stableStringify(value);
59
- parts.push(`${key}:${serialized}`);
60
- chunkStylesStr += serialized;
61
- }
62
- }
63
- const localStates = extractLocalPredefinedStates(styles);
64
- if (Object.keys(localStates).length > 0) {
65
- const referencedStates = extractPredefinedStateRefs(chunkStylesStr);
66
- const relevantLocalStates = [];
67
- for (const stateName of referencedStates) if (localStates[stateName]) relevantLocalStates.push(`${stateName}=${localStates[stateName]}`);
68
- if (relevantLocalStates.length > 0) {
69
- relevantLocalStates.sort();
70
- parts.unshift(`[states:${relevantLocalStates.join("|")}]`);
71
- }
72
- }
73
- return parts.join("\0");
74
- }
75
-
76
- //#endregion
77
- export { generateChunkCacheKey };
78
- //# sourceMappingURL=cacheKey.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cacheKey.js","names":[],"sources":["../../src/chunks/cacheKey.ts"],"sourcesContent":["/**\n * Chunk-specific cache key generation.\n *\n * Generates cache keys that only include styles relevant to a specific chunk,\n * enabling more granular caching and reuse.\n *\n * Enhanced to support predefined states:\n * - Global predefined states don't affect cache keys (constant across app)\n * - Local predefined states only affect cache keys if referenced in the chunk\n */\n\nimport {\n extractLocalPredefinedStates,\n extractPredefinedStateRefs,\n} from '../states';\nimport type { Styles } from '../styles/types';\n\nconst _stableStringifyCache = new WeakMap<object, string>();\n\n/**\n * Recursively serialize a value with sorted keys for stable output.\n * This ensures that {a: 1, b: 2} and {b: 2, a: 1} produce the same string.\n * Uses a WeakMap cache for object values to avoid re-serializing the same references.\n */\nfunction stableStringify(value: unknown): string {\n if (value === null) {\n return 'null';\n }\n if (value === undefined) {\n return 'undefined';\n }\n if (typeof value !== 'object') {\n return JSON.stringify(value);\n }\n\n const cached = _stableStringifyCache.get(value as object);\n if (cached !== undefined) return cached;\n\n let result: string;\n if (Array.isArray(value)) {\n result = '[' + value.map(stableStringify).join(',') + ']';\n } else {\n const obj = value as Record<string, unknown>;\n const sortedKeys = Object.keys(obj).sort();\n const parts: string[] = [];\n for (const key of sortedKeys) {\n if (obj[key] !== undefined) {\n parts.push(`${JSON.stringify(key)}:${stableStringify(obj[key])}`);\n }\n }\n result = '{' + parts.join(',') + '}';\n }\n\n _stableStringifyCache.set(value as object, result);\n return result;\n}\n\n/**\n * Generate a cache key for a specific chunk.\n *\n * Only includes the styles that belong to this chunk, allowing\n * chunks to be cached independently.\n *\n * Also includes relevant local predefined states that are referenced\n * by this chunk's styles.\n *\n * @param styles - The full styles object\n * @param chunkName - Name of the chunk\n * @param styleKeys - Keys of styles belonging to this chunk\n * @returns A stable cache key string\n */\nexport function generateChunkCacheKey(\n styles: Styles,\n chunkName: string,\n styleKeys: string[],\n): string {\n // Start with chunk name for namespace separation\n const parts: string[] = [chunkName];\n\n // styleKeys are already sorted by categorizeStyleKeys\n let chunkStylesStr = '';\n\n for (const key of styleKeys) {\n const value = styles[key];\n if (value !== undefined) {\n // Use stable stringify for consistent serialization regardless of key order\n const serialized = stableStringify(value);\n parts.push(`${key}:${serialized}`);\n chunkStylesStr += serialized;\n }\n }\n\n // Extract local predefined states from the full styles object\n const localStates = extractLocalPredefinedStates(styles);\n\n // Only include local predefined states that are actually referenced in this chunk\n if (Object.keys(localStates).length > 0) {\n const referencedStates = extractPredefinedStateRefs(chunkStylesStr);\n const relevantLocalStates: string[] = [];\n\n for (const stateName of referencedStates) {\n if (localStates[stateName]) {\n relevantLocalStates.push(`${stateName}=${localStates[stateName]}`);\n }\n }\n\n // Add relevant local states to the cache key (sorted for stability)\n if (relevantLocalStates.length > 0) {\n relevantLocalStates.sort();\n parts.unshift(`[states:${relevantLocalStates.join('|')}]`);\n }\n }\n\n // Use null character as separator (safe, not in JSON output)\n return parts.join('\\0');\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAM,wCAAwB,IAAI,SAAyB;;;;;;AAO3D,SAAS,gBAAgB,OAAwB;AAC/C,KAAI,UAAU,KACZ,QAAO;AAET,KAAI,UAAU,OACZ,QAAO;AAET,KAAI,OAAO,UAAU,SACnB,QAAO,KAAK,UAAU,MAAM;CAG9B,MAAM,SAAS,sBAAsB,IAAI,MAAgB;AACzD,KAAI,WAAW,OAAW,QAAO;CAEjC,IAAI;AACJ,KAAI,MAAM,QAAQ,MAAM,CACtB,UAAS,MAAM,MAAM,IAAI,gBAAgB,CAAC,KAAK,IAAI,GAAG;MACjD;EACL,MAAM,MAAM;EACZ,MAAM,aAAa,OAAO,KAAK,IAAI,CAAC,MAAM;EAC1C,MAAM,QAAkB,EAAE;AAC1B,OAAK,MAAM,OAAO,WAChB,KAAI,IAAI,SAAS,OACf,OAAM,KAAK,GAAG,KAAK,UAAU,IAAI,CAAC,GAAG,gBAAgB,IAAI,KAAK,GAAG;AAGrE,WAAS,MAAM,MAAM,KAAK,IAAI,GAAG;;AAGnC,uBAAsB,IAAI,OAAiB,OAAO;AAClD,QAAO;;;;;;;;;;;;;;;;AAiBT,SAAgB,sBACd,QACA,WACA,WACQ;CAER,MAAM,QAAkB,CAAC,UAAU;CAGnC,IAAI,iBAAiB;AAErB,MAAK,MAAM,OAAO,WAAW;EAC3B,MAAM,QAAQ,OAAO;AACrB,MAAI,UAAU,QAAW;GAEvB,MAAM,aAAa,gBAAgB,MAAM;AACzC,SAAM,KAAK,GAAG,IAAI,GAAG,aAAa;AAClC,qBAAkB;;;CAKtB,MAAM,cAAc,6BAA6B,OAAO;AAGxD,KAAI,OAAO,KAAK,YAAY,CAAC,SAAS,GAAG;EACvC,MAAM,mBAAmB,2BAA2B,eAAe;EACnE,MAAM,sBAAgC,EAAE;AAExC,OAAK,MAAM,aAAa,iBACtB,KAAI,YAAY,WACd,qBAAoB,KAAK,GAAG,UAAU,GAAG,YAAY,aAAa;AAKtE,MAAI,oBAAoB,SAAS,GAAG;AAClC,uBAAoB,MAAM;AAC1B,SAAM,QAAQ,WAAW,oBAAoB,KAAK,IAAI,CAAC,GAAG;;;AAK9D,QAAO,MAAM,KAAK,KAAK"}
@@ -1,37 +0,0 @@
1
- //#region src/chunks/definitions.d.ts
2
- declare const CHUNK_NAMES: {
3
- /** Special chunk for styles that cannot be split (e.g., @starting-style) */readonly COMBINED: "combined";
4
- readonly SUBCOMPONENTS: "subcomponents";
5
- readonly APPEARANCE: "appearance";
6
- readonly FONT: "font";
7
- readonly DIMENSION: "dimension";
8
- readonly DISPLAY: "display";
9
- readonly LAYOUT: "layout";
10
- readonly POSITION: "position";
11
- readonly MISC: "misc";
12
- };
13
- type ChunkName = (typeof CHUNK_NAMES)[keyof typeof CHUNK_NAMES];
14
- /**
15
- * Pre-computed map for O(1) style-to-chunk lookup.
16
- * Built once at module load time.
17
- */
18
- declare const STYLE_TO_CHUNK: Map<string, ChunkName>;
19
- interface ChunkInfo {
20
- /** Name of the chunk */
21
- name: ChunkName | string;
22
- /** Style keys belonging to this chunk */
23
- styleKeys: string[];
24
- }
25
- /**
26
- * Categorize style keys into chunks.
27
- *
28
- * Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
29
- * of the order of keys in the input styles object.
30
- *
31
- * @param styles - The styles object to categorize
32
- * @returns Map of chunk name to array of style keys in that chunk (in priority order)
33
- */
34
- declare function categorizeStyleKeys(styles: Record<string, unknown>): Map<string, string[]>;
35
- //#endregion
36
- export { CHUNK_NAMES, ChunkInfo, ChunkName, STYLE_TO_CHUNK, categorizeStyleKeys };
37
- //# sourceMappingURL=definitions.d.ts.map
@@ -1,259 +0,0 @@
1
- import { isSelector } from "../pipeline/index.js";
2
-
3
- //#region src/chunks/definitions.ts
4
- /**
5
- * Style chunk definitions for CSS chunking optimization.
6
- *
7
- * Styles are grouped into chunks based on:
8
- * 1. Handler dependencies - styles that share a handler MUST be in the same chunk
9
- * 2. Logical grouping - related styles grouped for better cache reuse
10
- *
11
- * See STYLE_CHUNKING_SPEC.md for detailed rationale.
12
- *
13
- * ============================================================================
14
- * ⚠️ CRITICAL ARCHITECTURAL CONSTRAINT: NO CROSS-CHUNK HANDLER DEPENDENCIES
15
- * ============================================================================
16
- *
17
- * Style handlers declare their dependencies via `__lookupStyles` array.
18
- * This creates a dependency graph where handlers read multiple style props.
19
- *
20
- * **ALL styles in a handler's `__lookupStyles` MUST be in the SAME chunk.**
21
- *
22
- * Why this matters:
23
- * 1. Each chunk computes a cache key from ONLY its own style values
24
- * 2. If a handler reads a style from another chunk, that value isn't in the cache key
25
- * 3. Changing the cross-chunk style won't invalidate this chunk's cache
26
- * 4. Result: stale CSS output or incorrect cache hits
27
- *
28
- * Example of a violation:
29
- * ```
30
- * // flowStyle.__lookupStyles = ['display', 'flow']
31
- * // If 'display' is in DISPLAY chunk and 'flow' is in LAYOUT chunk:
32
- * // - User sets { display: 'grid', flow: 'column' }
33
- * // - LAYOUT chunk caches CSS with flow=column, display=grid
34
- * // - User changes to { display: 'flex', flow: 'column' }
35
- * // - LAYOUT chunk cache key unchanged (only has 'flow')
36
- * // - Returns stale CSS computed with display=grid!
37
- * ```
38
- *
39
- * Before adding/moving styles, verify:
40
- * 1. Find all handlers that use this style (grep for the style name in __lookupStyles)
41
- * 2. Ensure ALL styles from each handler's __lookupStyles are in the same chunk
42
- * ============================================================================
43
- */
44
- /**
45
- * Appearance chunk - visual styling with independent handlers
46
- */
47
- const APPEARANCE_CHUNK_STYLES = [
48
- "fill",
49
- "color",
50
- "opacity",
51
- "border",
52
- "radius",
53
- "outline",
54
- "outlineOffset",
55
- "shadow",
56
- "fade"
57
- ];
58
- /**
59
- * Font chunk - typography styles
60
- *
61
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
62
- * ⚠️ presetStyle: preset, fontSize, lineHeight, letterSpacing, textTransform,
63
- * fontWeight, fontStyle, font
64
- */
65
- const FONT_CHUNK_STYLES = [
66
- "preset",
67
- "font",
68
- "fontWeight",
69
- "fontStyle",
70
- "fontSize",
71
- "lineHeight",
72
- "letterSpacing",
73
- "textTransform",
74
- "fontFamily",
75
- "textAlign",
76
- "textDecoration",
77
- "wordBreak",
78
- "wordWrap",
79
- "boldFontWeight"
80
- ];
81
- /**
82
- * Dimension chunk - sizing and spacing
83
- *
84
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
85
- * ⚠️ paddingStyle: padding, paddingTop/Right/Bottom/Left, paddingBlock/Inline
86
- * ⚠️ marginStyle: margin, marginTop/Right/Bottom/Left, marginBlock/Inline
87
- * ⚠️ widthStyle: width, minWidth, maxWidth
88
- * ⚠️ heightStyle: height, minHeight, maxHeight
89
- */
90
- const DIMENSION_CHUNK_STYLES = [
91
- "padding",
92
- "paddingTop",
93
- "paddingRight",
94
- "paddingBottom",
95
- "paddingLeft",
96
- "paddingBlock",
97
- "paddingInline",
98
- "margin",
99
- "marginTop",
100
- "marginRight",
101
- "marginBottom",
102
- "marginLeft",
103
- "marginBlock",
104
- "marginInline",
105
- "width",
106
- "minWidth",
107
- "maxWidth",
108
- "height",
109
- "minHeight",
110
- "maxHeight",
111
- "flexBasis",
112
- "flexGrow",
113
- "flexShrink",
114
- "flex"
115
- ];
116
- /**
117
- * Display chunk - display mode, layout flow, text overflow, and scrollbar
118
- *
119
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
120
- * ⚠️ displayStyle: display, hide, textOverflow, overflow, whiteSpace
121
- * ⚠️ flowStyle: display, flow
122
- * ⚠️ gapStyle: display, flow, gap
123
- * ⚠️ scrollbarStyle: scrollbar, overflow
124
- */
125
- const DISPLAY_CHUNK_STYLES = [
126
- "display",
127
- "hide",
128
- "textOverflow",
129
- "overflow",
130
- "whiteSpace",
131
- "flow",
132
- "gap",
133
- "scrollbar"
134
- ];
135
- /**
136
- * Layout chunk - flex/grid alignment and grid templates
137
- *
138
- * Note: flow and gap are in DISPLAY chunk due to handler dependencies
139
- * (flowStyle and gapStyle both require 'display' prop).
140
- */
141
- const LAYOUT_CHUNK_STYLES = [
142
- "placeItems",
143
- "placeContent",
144
- "alignItems",
145
- "alignContent",
146
- "justifyItems",
147
- "justifyContent",
148
- "align",
149
- "justify",
150
- "place",
151
- "columnGap",
152
- "rowGap",
153
- "gridColumns",
154
- "gridRows",
155
- "gridTemplate",
156
- "gridAreas",
157
- "gridAutoFlow",
158
- "gridAutoColumns",
159
- "gridAutoRows"
160
- ];
161
- /**
162
- * Position chunk - element positioning
163
- *
164
- * Handler dependencies (all styles in each handler MUST stay in this chunk):
165
- * ⚠️ insetStyle: inset, insetBlock, insetInline, top, right, bottom, left
166
- */
167
- const POSITION_CHUNK_STYLES = [
168
- "position",
169
- "inset",
170
- "insetBlock",
171
- "insetInline",
172
- "top",
173
- "right",
174
- "bottom",
175
- "left",
176
- "zIndex",
177
- "gridArea",
178
- "gridColumn",
179
- "gridRow",
180
- "order",
181
- "placeSelf",
182
- "alignSelf",
183
- "justifySelf",
184
- "transform",
185
- "transition",
186
- "animation"
187
- ];
188
- const CHUNK_NAMES = {
189
- COMBINED: "combined",
190
- SUBCOMPONENTS: "subcomponents",
191
- APPEARANCE: "appearance",
192
- FONT: "font",
193
- DIMENSION: "dimension",
194
- DISPLAY: "display",
195
- LAYOUT: "layout",
196
- POSITION: "position",
197
- MISC: "misc"
198
- };
199
- /**
200
- * Pre-computed map for O(1) style-to-chunk lookup.
201
- * Built once at module load time.
202
- */
203
- const STYLE_TO_CHUNK = /* @__PURE__ */ new Map();
204
- function populateStyleToChunkMap() {
205
- for (const style of APPEARANCE_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.APPEARANCE);
206
- for (const style of FONT_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.FONT);
207
- for (const style of DIMENSION_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.DIMENSION);
208
- for (const style of DISPLAY_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.DISPLAY);
209
- for (const style of LAYOUT_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.LAYOUT);
210
- for (const style of POSITION_CHUNK_STYLES) STYLE_TO_CHUNK.set(style, CHUNK_NAMES.POSITION);
211
- }
212
- populateStyleToChunkMap();
213
- /**
214
- * Chunk processing order. This ensures deterministic className allocation
215
- * regardless of style key order in the input.
216
- */
217
- const CHUNK_ORDER = [
218
- CHUNK_NAMES.APPEARANCE,
219
- CHUNK_NAMES.FONT,
220
- CHUNK_NAMES.DIMENSION,
221
- CHUNK_NAMES.DISPLAY,
222
- CHUNK_NAMES.LAYOUT,
223
- CHUNK_NAMES.POSITION,
224
- CHUNK_NAMES.MISC,
225
- CHUNK_NAMES.SUBCOMPONENTS
226
- ];
227
- new Map(CHUNK_ORDER.map((name, index) => [name, index]));
228
- /**
229
- * Categorize style keys into chunks.
230
- *
231
- * Returns chunks in a deterministic order (by CHUNK_ORDER) regardless
232
- * of the order of keys in the input styles object.
233
- *
234
- * @param styles - The styles object to categorize
235
- * @returns Map of chunk name to array of style keys in that chunk (in priority order)
236
- */
237
- function categorizeStyleKeys(styles) {
238
- const chunkData = {};
239
- const keys = Object.keys(styles);
240
- for (const key of keys) {
241
- if (key === "$" || key === "@keyframes" || key === "@properties" || key === "@fontFace" || key === "@counterStyle" || key === "recipe") continue;
242
- if (isSelector(key)) {
243
- if (!chunkData[CHUNK_NAMES.SUBCOMPONENTS]) chunkData[CHUNK_NAMES.SUBCOMPONENTS] = [];
244
- chunkData[CHUNK_NAMES.SUBCOMPONENTS].push(key);
245
- } else {
246
- const chunkName = STYLE_TO_CHUNK.get(key) ?? CHUNK_NAMES.MISC;
247
- if (!chunkData[chunkName]) chunkData[chunkName] = [];
248
- chunkData[chunkName].push(key);
249
- }
250
- }
251
- const orderedChunks = /* @__PURE__ */ new Map();
252
- for (const chunkName of CHUNK_ORDER) if (chunkData[chunkName] && chunkData[chunkName].length > 0) orderedChunks.set(chunkName, chunkData[chunkName].sort());
253
- for (const chunkName of Object.keys(chunkData)) if (!orderedChunks.has(chunkName)) orderedChunks.set(chunkName, chunkData[chunkName].sort());
254
- return orderedChunks;
255
- }
256
-
257
- //#endregion
258
- export { CHUNK_NAMES, STYLE_TO_CHUNK, categorizeStyleKeys };
259
- //# sourceMappingURL=definitions.js.map