@ecopages/radiant 0.2.0 → 0.3.0-alpha.1

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 (445) hide show
  1. package/README.md +293 -34
  2. package/dist/chunk-0bswvy25.js +4 -0
  3. package/dist/chunk-0bswvy25.js.map +10 -0
  4. package/dist/chunk-0btkzzyc.js +4 -0
  5. package/dist/chunk-0btkzzyc.js.map +10 -0
  6. package/dist/chunk-0g0j9re6.js +4 -0
  7. package/dist/chunk-0g0j9re6.js.map +10 -0
  8. package/dist/chunk-1x26p09c.js +4 -0
  9. package/dist/chunk-1x26p09c.js.map +10 -0
  10. package/dist/chunk-21a7jask.js +4 -0
  11. package/dist/chunk-21a7jask.js.map +10 -0
  12. package/dist/chunk-25zjh0kg.js +4 -0
  13. package/dist/chunk-25zjh0kg.js.map +10 -0
  14. package/dist/chunk-30x4hggg.js +4 -0
  15. package/dist/chunk-30x4hggg.js.map +10 -0
  16. package/dist/chunk-3ryr5wx2.js +4 -0
  17. package/dist/chunk-3ryr5wx2.js.map +10 -0
  18. package/dist/chunk-3xxvmd5c.js +4 -0
  19. package/dist/chunk-3xxvmd5c.js.map +10 -0
  20. package/dist/chunk-3ynk7e1e.js +4 -0
  21. package/dist/chunk-3ynk7e1e.js.map +10 -0
  22. package/dist/chunk-4e559cy5.js +4 -0
  23. package/dist/chunk-4e559cy5.js.map +10 -0
  24. package/dist/chunk-5b1en9vz.js +4 -0
  25. package/dist/chunk-5b1en9vz.js.map +10 -0
  26. package/dist/chunk-5bkat72n.js +4 -0
  27. package/dist/chunk-5bkat72n.js.map +10 -0
  28. package/dist/chunk-5qeaq3tj.js +4 -0
  29. package/dist/chunk-5qeaq3tj.js.map +10 -0
  30. package/dist/chunk-66e6s792.js +4 -0
  31. package/dist/chunk-66e6s792.js.map +10 -0
  32. package/dist/chunk-79jg8q67.js +4 -0
  33. package/dist/chunk-79jg8q67.js.map +10 -0
  34. package/dist/chunk-8d5ddvvf.js +4 -0
  35. package/dist/chunk-8d5ddvvf.js.map +10 -0
  36. package/dist/chunk-8e9fgtbn.js +4 -0
  37. package/dist/chunk-8e9fgtbn.js.map +10 -0
  38. package/dist/chunk-9mqtp3js.js +4 -0
  39. package/dist/chunk-9mqtp3js.js.map +10 -0
  40. package/dist/chunk-9rj2rwes.js +4 -0
  41. package/dist/chunk-9rj2rwes.js.map +10 -0
  42. package/dist/chunk-atms6yrh.js +4 -0
  43. package/dist/chunk-atms6yrh.js.map +10 -0
  44. package/dist/chunk-bk2nbmcd.js +4 -0
  45. package/dist/chunk-bk2nbmcd.js.map +10 -0
  46. package/dist/chunk-bk6qkvfp.js +4 -0
  47. package/dist/chunk-bk6qkvfp.js.map +10 -0
  48. package/dist/chunk-c0qyz98c.js +4 -0
  49. package/dist/chunk-c0qyz98c.js.map +10 -0
  50. package/dist/chunk-c52qhh0j.js +4 -0
  51. package/dist/chunk-c52qhh0j.js.map +10 -0
  52. package/dist/chunk-cnyxrh9r.js +4 -0
  53. package/dist/chunk-cnyxrh9r.js.map +10 -0
  54. package/dist/chunk-cvz9mrxa.js +4 -0
  55. package/dist/chunk-cvz9mrxa.js.map +10 -0
  56. package/dist/chunk-dabagjk6.js +4 -0
  57. package/dist/chunk-dabagjk6.js.map +10 -0
  58. package/dist/chunk-e0r6ca2g.js +4 -0
  59. package/dist/chunk-e0r6ca2g.js.map +10 -0
  60. package/dist/chunk-eevw1j2q.js +4 -0
  61. package/dist/chunk-eevw1j2q.js.map +10 -0
  62. package/dist/chunk-ek664x1c.js +4 -0
  63. package/dist/chunk-ek664x1c.js.map +10 -0
  64. package/dist/chunk-eyw14d6y.js +4 -0
  65. package/dist/chunk-eyw14d6y.js.map +10 -0
  66. package/dist/chunk-fs4j94bk.js +4 -0
  67. package/dist/chunk-fs4j94bk.js.map +10 -0
  68. package/dist/chunk-g2z3mm6b.js +4 -0
  69. package/dist/chunk-g2z3mm6b.js.map +10 -0
  70. package/dist/chunk-g5n3m11h.js +4 -0
  71. package/dist/chunk-g5n3m11h.js.map +10 -0
  72. package/dist/chunk-gdkte2vd.js +4 -0
  73. package/dist/chunk-gdkte2vd.js.map +10 -0
  74. package/dist/chunk-gg74gdpv.js +4 -0
  75. package/dist/chunk-gg74gdpv.js.map +10 -0
  76. package/dist/chunk-h9k7crjc.js +4 -0
  77. package/dist/chunk-h9k7crjc.js.map +10 -0
  78. package/dist/chunk-hpzgnxgq.js +4 -0
  79. package/dist/chunk-hpzgnxgq.js.map +10 -0
  80. package/dist/chunk-hrjc8b1y.js +4 -0
  81. package/dist/chunk-hrjc8b1y.js.map +10 -0
  82. package/dist/chunk-hvy4zvcc.js +4 -0
  83. package/dist/chunk-hvy4zvcc.js.map +10 -0
  84. package/dist/chunk-hztr86b4.js +4 -0
  85. package/dist/chunk-hztr86b4.js.map +10 -0
  86. package/dist/chunk-j3v7rca5.js +4 -0
  87. package/dist/chunk-j3v7rca5.js.map +10 -0
  88. package/dist/chunk-j864sv4w.js +4 -0
  89. package/dist/chunk-j864sv4w.js.map +10 -0
  90. package/dist/chunk-jkb2y7c8.js +4 -0
  91. package/dist/chunk-jkb2y7c8.js.map +10 -0
  92. package/dist/chunk-kakpjgzf.js +4 -0
  93. package/dist/chunk-kakpjgzf.js.map +10 -0
  94. package/dist/chunk-kmebacvv.js +4 -0
  95. package/dist/chunk-kmebacvv.js.map +10 -0
  96. package/dist/chunk-knqsm6v3.js +4 -0
  97. package/dist/chunk-knqsm6v3.js.map +10 -0
  98. package/dist/chunk-mp2vtrkg.js +4 -0
  99. package/dist/chunk-mp2vtrkg.js.map +10 -0
  100. package/dist/chunk-mpsj3cjs.js +4 -0
  101. package/dist/chunk-mpsj3cjs.js.map +10 -0
  102. package/dist/chunk-n4p2542b.js +4 -0
  103. package/dist/chunk-n4p2542b.js.map +10 -0
  104. package/dist/chunk-nctznxyz.js +4 -0
  105. package/dist/chunk-nctznxyz.js.map +10 -0
  106. package/dist/chunk-ndw3hc3v.js +4 -0
  107. package/dist/chunk-ndw3hc3v.js.map +10 -0
  108. package/dist/chunk-nnnb6pac.js +4 -0
  109. package/dist/chunk-nnnb6pac.js.map +10 -0
  110. package/dist/chunk-nssj2x13.js +4 -0
  111. package/dist/chunk-nssj2x13.js.map +10 -0
  112. package/dist/chunk-nvr37vma.js +4 -0
  113. package/dist/chunk-nvr37vma.js.map +10 -0
  114. package/dist/chunk-p8k4g99a.js +4 -0
  115. package/dist/chunk-p8k4g99a.js.map +10 -0
  116. package/dist/chunk-pkszgjqf.js +4 -0
  117. package/dist/chunk-pkszgjqf.js.map +10 -0
  118. package/dist/chunk-q9z6tnzw.js +4 -0
  119. package/dist/chunk-q9z6tnzw.js.map +10 -0
  120. package/dist/chunk-qdz5sncz.js +4 -0
  121. package/dist/chunk-qdz5sncz.js.map +10 -0
  122. package/dist/chunk-qe0eww1n.js +4 -0
  123. package/dist/chunk-qe0eww1n.js.map +10 -0
  124. package/dist/chunk-r33zvvda.js +4 -0
  125. package/dist/chunk-r33zvvda.js.map +10 -0
  126. package/dist/chunk-rkh1vkb9.js +4 -0
  127. package/dist/chunk-rkh1vkb9.js.map +10 -0
  128. package/dist/chunk-rrg759ht.js +4 -0
  129. package/dist/chunk-rrg759ht.js.map +10 -0
  130. package/dist/chunk-s09s5ayx.js +4 -0
  131. package/dist/chunk-s09s5ayx.js.map +10 -0
  132. package/dist/chunk-s5p5z3z4.js +4 -0
  133. package/dist/chunk-s5p5z3z4.js.map +10 -0
  134. package/dist/chunk-sf4a2gy5.js +4 -0
  135. package/dist/chunk-sf4a2gy5.js.map +10 -0
  136. package/dist/chunk-ssnnxzrj.js +4 -0
  137. package/dist/chunk-ssnnxzrj.js.map +10 -0
  138. package/dist/chunk-t8xtvgyg.js +4 -0
  139. package/dist/chunk-t8xtvgyg.js.map +10 -0
  140. package/dist/chunk-v3ta7hnv.js +4 -0
  141. package/dist/chunk-v3ta7hnv.js.map +10 -0
  142. package/dist/chunk-v92hp9g0.js +4 -0
  143. package/dist/chunk-v92hp9g0.js.map +10 -0
  144. package/dist/chunk-vgtggzb6.js +4 -0
  145. package/dist/chunk-vgtggzb6.js.map +9 -0
  146. package/dist/chunk-vk48hgm4.js +4 -0
  147. package/dist/chunk-vk48hgm4.js.map +10 -0
  148. package/dist/chunk-w8s5fnsq.js +4 -0
  149. package/dist/chunk-w8s5fnsq.js.map +10 -0
  150. package/dist/chunk-wd23rn4q.js +4 -0
  151. package/dist/chunk-wd23rn4q.js.map +10 -0
  152. package/dist/chunk-wds4href.js +4 -0
  153. package/dist/chunk-wds4href.js.map +10 -0
  154. package/dist/chunk-wvd1ffe4.js +4 -0
  155. package/dist/chunk-wvd1ffe4.js.map +10 -0
  156. package/dist/chunk-wwbjz9k4.js +4 -0
  157. package/dist/chunk-wwbjz9k4.js.map +10 -0
  158. package/dist/chunk-x2k0ngpz.js +4 -0
  159. package/dist/chunk-x2k0ngpz.js.map +10 -0
  160. package/dist/chunk-x457d0ap.js +4 -0
  161. package/dist/chunk-x457d0ap.js.map +10 -0
  162. package/dist/chunk-xbhtzkre.js +4 -0
  163. package/dist/chunk-xbhtzkre.js.map +10 -0
  164. package/dist/chunk-y139ycfm.js +4 -0
  165. package/dist/chunk-y139ycfm.js.map +10 -0
  166. package/dist/chunk-z9kxfckm.js +4 -0
  167. package/dist/chunk-z9kxfckm.js.map +10 -0
  168. package/dist/chunk-zx5txex8.js +4 -0
  169. package/dist/chunk-zx5txex8.js.map +10 -0
  170. package/dist/client/hydrator.d.ts +19 -0
  171. package/dist/client/hydrator.js +3 -0
  172. package/dist/client/hydrator.js.map +9 -0
  173. package/dist/client/install-hydrator.d.ts +1 -0
  174. package/dist/client/install-hydrator.js +3 -0
  175. package/dist/client/install-hydrator.js.map +10 -0
  176. package/dist/context/context-consumer-bootstrap.d.ts +41 -0
  177. package/dist/context/context-consumer-bootstrap.js +3 -0
  178. package/dist/context/context-consumer-bootstrap.js.map +9 -0
  179. package/dist/context/context-consumer-runtime.d.ts +34 -0
  180. package/dist/context/context-consumer-runtime.js +3 -0
  181. package/dist/context/context-consumer-runtime.js.map +9 -0
  182. package/dist/context/context-provider.d.ts +50 -2
  183. package/dist/context/context-provider.js +2 -3
  184. package/dist/context/context-provider.js.map +3 -4
  185. package/dist/context/context-ssr-bridge.d.ts +16 -0
  186. package/dist/context/context-ssr-bridge.js +3 -0
  187. package/dist/context/context-ssr-bridge.js.map +9 -0
  188. package/dist/context/create-context.js +2 -3
  189. package/dist/context/create-context.js.map +3 -4
  190. package/dist/context/decorators/consume-context.d.ts +8 -4
  191. package/dist/context/decorators/consume-context.js +2 -3
  192. package/dist/context/decorators/consume-context.js.map +3 -4
  193. package/dist/context/decorators/context-selection-delivery.d.ts +1 -0
  194. package/dist/context/decorators/context-selection-delivery.js +3 -0
  195. package/dist/context/decorators/context-selection-delivery.js.map +9 -0
  196. package/dist/context/decorators/context-selector.d.ts +26 -8
  197. package/dist/context/decorators/context-selector.js +2 -3
  198. package/dist/context/decorators/context-selector.js.map +3 -4
  199. package/dist/context/decorators/legacy/consume-context.d.ts +1 -1
  200. package/dist/context/decorators/legacy/consume-context.js +2 -3
  201. package/dist/context/decorators/legacy/consume-context.js.map +3 -4
  202. package/dist/context/decorators/legacy/context-selector-field.d.ts +8 -0
  203. package/dist/context/decorators/legacy/context-selector-field.js +3 -0
  204. package/dist/context/decorators/legacy/context-selector-field.js.map +9 -0
  205. package/dist/context/decorators/legacy/context-selector.d.ts +3 -3
  206. package/dist/context/decorators/legacy/context-selector.js +2 -3
  207. package/dist/context/decorators/legacy/context-selector.js.map +3 -4
  208. package/dist/context/decorators/legacy/provide-context.d.ts +1 -1
  209. package/dist/context/decorators/legacy/provide-context.js +2 -3
  210. package/dist/context/decorators/legacy/provide-context.js.map +3 -4
  211. package/dist/context/decorators/on-context-update.d.ts +31 -0
  212. package/dist/context/decorators/on-context-update.js +3 -0
  213. package/dist/context/decorators/on-context-update.js.map +9 -0
  214. package/dist/context/decorators/provide-context.d.ts +12 -0
  215. package/dist/context/decorators/provide-context.js +2 -3
  216. package/dist/context/decorators/provide-context.js.map +3 -4
  217. package/dist/context/decorators/standard/consume-context.d.ts +1 -1
  218. package/dist/context/decorators/standard/consume-context.js +2 -3
  219. package/dist/context/decorators/standard/consume-context.js.map +3 -4
  220. package/dist/context/decorators/standard/context-selector-field.d.ts +8 -0
  221. package/dist/context/decorators/standard/context-selector-field.js +3 -0
  222. package/dist/context/decorators/standard/context-selector-field.js.map +9 -0
  223. package/dist/context/decorators/standard/context-selector.d.ts +4 -3
  224. package/dist/context/decorators/standard/context-selector.js +2 -3
  225. package/dist/context/decorators/standard/context-selector.js.map +3 -4
  226. package/dist/context/decorators/standard/provide-context.d.ts +1 -1
  227. package/dist/context/decorators/standard/provide-context.js +2 -3
  228. package/dist/context/decorators/standard/provide-context.js.map +3 -4
  229. package/dist/context/events.js +2 -3
  230. package/dist/context/events.js.map +3 -4
  231. package/dist/context/hydration-script.d.ts +13 -0
  232. package/dist/context/hydration-script.js +3 -0
  233. package/dist/context/hydration-script.js.map +9 -0
  234. package/dist/core/custom-element-metadata.d.ts +3 -0
  235. package/dist/core/custom-element-metadata.js +3 -0
  236. package/dist/core/custom-element-metadata.js.map +9 -0
  237. package/dist/core/hydration-codec.d.ts +24 -0
  238. package/dist/core/hydration-codec.js +3 -0
  239. package/dist/core/hydration-codec.js.map +9 -0
  240. package/dist/core/radiant-component-ssr-registry.d.ts +54 -0
  241. package/dist/core/radiant-component-ssr-registry.js +3 -0
  242. package/dist/core/radiant-component-ssr-registry.js.map +9 -0
  243. package/dist/core/radiant-component-ssr.d.ts +29 -0
  244. package/dist/core/radiant-component-ssr.js +3 -0
  245. package/dist/core/radiant-component-ssr.js.map +9 -0
  246. package/dist/core/radiant-component.d.ts +113 -0
  247. package/dist/core/radiant-component.js +3 -0
  248. package/dist/core/radiant-component.js.map +9 -0
  249. package/dist/core/radiant-element.d.ts +217 -9
  250. package/dist/core/radiant-element.js +2 -3
  251. package/dist/core/radiant-element.js.map +3 -4
  252. package/dist/core/radiant-hydrator-state.d.ts +20 -0
  253. package/dist/core/radiant-hydrator-state.js +3 -0
  254. package/dist/core/radiant-hydrator-state.js.map +9 -0
  255. package/dist/core/reactive-jsx-value.d.ts +10 -0
  256. package/dist/core/reactive-jsx-value.js +3 -0
  257. package/dist/core/reactive-jsx-value.js.map +9 -0
  258. package/dist/core/reactive-prop-metadata.d.ts +7 -0
  259. package/dist/core/reactive-prop-metadata.js +3 -0
  260. package/dist/core/reactive-prop-metadata.js.map +9 -0
  261. package/dist/core/slot-projection-runtime.d.ts +14 -0
  262. package/dist/core/slot-projection-runtime.js +3 -0
  263. package/dist/core/slot-projection-runtime.js.map +9 -0
  264. package/dist/core/ssr-hydration-binding.d.ts +14 -0
  265. package/dist/core/ssr-hydration-binding.js +2 -0
  266. package/dist/core/ssr-hydration-binding.js.map +9 -0
  267. package/dist/core/ssr-preparation.d.ts +18 -0
  268. package/dist/core/ssr-preparation.js +3 -0
  269. package/dist/core/ssr-preparation.js.map +9 -0
  270. package/dist/decorators/bound.js +2 -2
  271. package/dist/decorators/bound.js.map +3 -4
  272. package/dist/decorators/bridge.d.ts +8 -0
  273. package/dist/decorators/bridge.js +3 -0
  274. package/dist/decorators/bridge.js.map +9 -0
  275. package/dist/decorators/custom-element.js +2 -3
  276. package/dist/decorators/custom-element.js.map +3 -4
  277. package/dist/decorators/debounce.js +2 -2
  278. package/dist/decorators/debounce.js.map +3 -4
  279. package/dist/decorators/event.js +2 -3
  280. package/dist/decorators/event.js.map +3 -4
  281. package/dist/decorators/legacy/bound.js +2 -3
  282. package/dist/decorators/legacy/bound.js.map +3 -4
  283. package/dist/decorators/legacy/custom-element.js +2 -3
  284. package/dist/decorators/legacy/custom-element.js.map +3 -4
  285. package/dist/decorators/legacy/debounce.js +2 -3
  286. package/dist/decorators/legacy/debounce.js.map +3 -4
  287. package/dist/decorators/legacy/event.d.ts +1 -1
  288. package/dist/decorators/legacy/event.js +2 -2
  289. package/dist/decorators/legacy/event.js.map +3 -4
  290. package/dist/decorators/legacy/instance-initializers.d.ts +17 -0
  291. package/dist/decorators/legacy/instance-initializers.js +3 -0
  292. package/dist/decorators/legacy/instance-initializers.js.map +9 -0
  293. package/dist/decorators/legacy/on-event.d.ts +2 -11
  294. package/dist/decorators/legacy/on-event.js +2 -3
  295. package/dist/decorators/legacy/on-event.js.map +3 -4
  296. package/dist/decorators/legacy/on-updated.js +2 -3
  297. package/dist/decorators/legacy/on-updated.js.map +3 -4
  298. package/dist/decorators/legacy/query-slot.d.ts +3 -0
  299. package/dist/decorators/legacy/query-slot.js +3 -0
  300. package/dist/decorators/legacy/query-slot.js.map +9 -0
  301. package/dist/decorators/legacy/query.js +2 -3
  302. package/dist/decorators/legacy/query.js.map +3 -4
  303. package/dist/decorators/legacy/reactive-field.js +2 -3
  304. package/dist/decorators/legacy/reactive-field.js.map +3 -4
  305. package/dist/decorators/legacy/reactive-prop.d.ts +2 -1
  306. package/dist/decorators/legacy/reactive-prop.js +2 -3
  307. package/dist/decorators/legacy/reactive-prop.js.map +3 -4
  308. package/dist/decorators/legacy/signal.d.ts +10 -0
  309. package/dist/decorators/legacy/signal.js +3 -0
  310. package/dist/decorators/legacy/signal.js.map +9 -0
  311. package/dist/decorators/on-event.d.ts +3 -11
  312. package/dist/decorators/on-event.js +2 -3
  313. package/dist/decorators/on-event.js.map +3 -4
  314. package/dist/decorators/on-updated.js +2 -3
  315. package/dist/decorators/on-updated.js.map +3 -4
  316. package/dist/decorators/prop.d.ts +14 -0
  317. package/dist/decorators/prop.js +3 -0
  318. package/dist/decorators/prop.js.map +9 -0
  319. package/dist/decorators/query-slot.d.ts +13 -0
  320. package/dist/decorators/query-slot.js +3 -0
  321. package/dist/decorators/query-slot.js.map +9 -0
  322. package/dist/decorators/query.d.ts +4 -13
  323. package/dist/decorators/query.js +2 -3
  324. package/dist/decorators/query.js.map +3 -4
  325. package/dist/decorators/signal.d.ts +23 -0
  326. package/dist/decorators/signal.js +3 -0
  327. package/dist/decorators/signal.js.map +9 -0
  328. package/dist/decorators/standard/bound.js +2 -3
  329. package/dist/decorators/standard/bound.js.map +3 -4
  330. package/dist/decorators/standard/custom-element.js +2 -3
  331. package/dist/decorators/standard/custom-element.js.map +3 -4
  332. package/dist/decorators/standard/debounce.js +2 -3
  333. package/dist/decorators/standard/debounce.js.map +3 -4
  334. package/dist/decorators/standard/event.d.ts +1 -1
  335. package/dist/decorators/standard/event.js +2 -3
  336. package/dist/decorators/standard/event.js.map +3 -4
  337. package/dist/decorators/standard/on-event.d.ts +1 -11
  338. package/dist/decorators/standard/on-event.js +2 -3
  339. package/dist/decorators/standard/on-event.js.map +3 -4
  340. package/dist/decorators/standard/on-updated.js +2 -3
  341. package/dist/decorators/standard/on-updated.js.map +3 -4
  342. package/dist/decorators/standard/query-slot.d.ts +8 -0
  343. package/dist/decorators/standard/query-slot.js +3 -0
  344. package/dist/decorators/standard/query-slot.js.map +9 -0
  345. package/dist/decorators/standard/query.js +2 -3
  346. package/dist/decorators/standard/query.js.map +3 -4
  347. package/dist/decorators/standard/reactive-field.js +2 -3
  348. package/dist/decorators/standard/reactive-field.js.map +3 -4
  349. package/dist/decorators/standard/reactive-prop.d.ts +1 -1
  350. package/dist/decorators/standard/reactive-prop.js +2 -3
  351. package/dist/decorators/standard/reactive-prop.js.map +3 -4
  352. package/dist/decorators/standard/signal.d.ts +33 -0
  353. package/dist/decorators/standard/signal.js +3 -0
  354. package/dist/decorators/standard/signal.js.map +9 -0
  355. package/dist/decorators/state.d.ts +11 -0
  356. package/dist/decorators/state.js +3 -0
  357. package/dist/decorators/state.js.map +9 -0
  358. package/dist/helpers/create-event-listener.d.ts +28 -0
  359. package/dist/helpers/create-event-listener.js +3 -0
  360. package/dist/helpers/create-event-listener.js.map +9 -0
  361. package/dist/helpers/create-event.d.ts +9 -0
  362. package/dist/helpers/create-event.js +3 -0
  363. package/dist/helpers/create-event.js.map +9 -0
  364. package/dist/helpers/create-query-slot.d.ts +20 -0
  365. package/dist/helpers/create-query-slot.js +3 -0
  366. package/dist/helpers/create-query-slot.js.map +9 -0
  367. package/dist/helpers/create-query.d.ts +27 -0
  368. package/dist/helpers/create-query.js +3 -0
  369. package/dist/helpers/create-query.js.map +9 -0
  370. package/dist/helpers/debounce.d.ts +39 -0
  371. package/dist/helpers/debounce.js +3 -0
  372. package/dist/helpers/debounce.js.map +9 -0
  373. package/dist/helpers/index.d.ts +5 -0
  374. package/dist/helpers/index.js +3 -0
  375. package/dist/{mixins → helpers}/index.js.map +1 -1
  376. package/dist/index.d.ts +13 -5
  377. package/dist/index.js +2 -2
  378. package/dist/index.js.map +1 -1
  379. package/dist/server/context-ssr.d.ts +27 -0
  380. package/dist/server/context-ssr.js +3 -0
  381. package/dist/server/context-ssr.js.map +9 -0
  382. package/dist/server/html-parser.d.ts +21 -0
  383. package/dist/server/html-parser.js +3 -0
  384. package/dist/server/html-parser.js.map +9 -0
  385. package/dist/server/install-light-dom-shim.d.ts +1 -0
  386. package/dist/server/install-light-dom-shim.js +3 -0
  387. package/dist/server/install-light-dom-shim.js.map +10 -0
  388. package/dist/server/light-dom-shim.d.ts +53 -0
  389. package/dist/server/light-dom-shim.js +3 -0
  390. package/dist/server/light-dom-shim.js.map +9 -0
  391. package/dist/server/project-root.d.ts +20 -0
  392. package/dist/server/project-root.js +3 -0
  393. package/dist/server/project-root.js.map +11 -0
  394. package/dist/server/radiant-component-ssr-runtime.d.ts +9 -0
  395. package/dist/server/radiant-component-ssr-runtime.js +3 -0
  396. package/dist/server/radiant-component-ssr-runtime.js.map +9 -0
  397. package/dist/server/render-component.d.ts +195 -0
  398. package/dist/server/render-component.js +3 -0
  399. package/dist/server/render-component.js.map +10 -0
  400. package/dist/server/slot-projection-html.d.ts +3 -0
  401. package/dist/server/slot-projection-html.js +3 -0
  402. package/dist/server/slot-projection-html.js.map +10 -0
  403. package/dist/signals/host-resource.d.ts +59 -0
  404. package/dist/signals/host-resource.js +3 -0
  405. package/dist/signals/host-resource.js.map +10 -0
  406. package/dist/signals/host-signal.d.ts +45 -0
  407. package/dist/signals/host-signal.js +3 -0
  408. package/dist/signals/host-signal.js.map +9 -0
  409. package/dist/signals/hydration-script.d.ts +7 -0
  410. package/dist/signals/hydration-script.js +3 -0
  411. package/dist/signals/hydration-script.js.map +9 -0
  412. package/dist/tools/escape-script-json.d.ts +5 -0
  413. package/dist/tools/escape-script-json.js +3 -0
  414. package/dist/tools/escape-script-json.js.map +9 -0
  415. package/dist/tools/event-emitter.js +2 -3
  416. package/dist/tools/event-emitter.js.map +3 -4
  417. package/dist/tools/index.d.ts +2 -0
  418. package/dist/tools/index.js +2 -2
  419. package/dist/tools/index.js.map +1 -1
  420. package/dist/tools/render-jsx-template.d.ts +5 -0
  421. package/dist/tools/render-jsx-template.js +3 -0
  422. package/dist/tools/render-jsx-template.js.map +9 -0
  423. package/dist/tools/stringify-typed.d.ts +4 -6
  424. package/dist/tools/stringify-typed.js +2 -3
  425. package/dist/tools/stringify-typed.js.map +3 -4
  426. package/dist/types.d.ts +0 -21
  427. package/dist/types.js +2 -2
  428. package/dist/types.js.map +3 -3
  429. package/dist/utils/attribute-utils.js +2 -3
  430. package/dist/utils/attribute-utils.js.map +3 -4
  431. package/dist/utils/index.js +2 -2
  432. package/dist/utils/index.js.map +1 -1
  433. package/package.json +106 -21
  434. package/size-budget.json +16 -0
  435. package/dist/decorators/reactive-field.d.ts +0 -6
  436. package/dist/decorators/reactive-field.js +0 -4
  437. package/dist/decorators/reactive-field.js.map +0 -10
  438. package/dist/decorators/reactive-prop.d.ts +0 -8
  439. package/dist/decorators/reactive-prop.js +0 -4
  440. package/dist/decorators/reactive-prop.js.map +0 -10
  441. package/dist/mixins/index.d.ts +0 -1
  442. package/dist/mixins/index.js +0 -3
  443. package/dist/mixins/with-kita.d.ts +0 -15
  444. package/dist/mixins/with-kita.js +0 -4
  445. package/dist/mixins/with-kita.js.map +0 -10
@@ -0,0 +1,195 @@
1
+ import type { JsxRenderable } from '@ecopages/jsx';
2
+ import type { RenderToStringOptions } from '@ecopages/jsx/server';
3
+ import type { ContextType, UnknownContext } from '../context/types';
4
+ import { type ServerRenderEnvironment } from './light-dom-shim';
5
+ /** Default response header carrying the fragment render timestamp. */
6
+ export declare const RENDERED_COMPONENT_GENERATED_AT_HEADER = "x-generated-at";
7
+ /** Default response header carrying the custom-element tag name for the fragment. */
8
+ export declare const RENDERED_COMPONENT_TAG_NAME_HEADER = "x-radiant-tag-name";
9
+ /** Default response header carrying the client module URL for the fragment. */
10
+ export declare const RENDERED_COMPONENT_CLIENT_MODULE_HEADER = "x-radiant-client-module";
11
+ /** Default response header carrying serialized fragment asset metadata. */
12
+ export declare const RENDERED_COMPONENT_ASSETS_HEADER = "x-radiant-assets";
13
+ /** Asset dependency emitted by a rendered fragment. */
14
+ export type RenderedComponentAsset = {
15
+ /** Browser module specifier that must be loaded to activate the fragment. */
16
+ kind: 'script-module';
17
+ /** Runtime loading policy for the module. */
18
+ stage?: 'hydrate' | 'idle' | 'immediate';
19
+ /** Module specifier or browser-importable URL. */
20
+ src: string;
21
+ } | {
22
+ /** Module graph preload hint for adapters that control the document head. */
23
+ kind: 'modulepreload';
24
+ /** Module specifier or browser-importable URL. */
25
+ href: string;
26
+ } | {
27
+ /** Stylesheet dependency required by the rendered fragment. */
28
+ kind: 'style';
29
+ /** Browser-importable stylesheet URL. */
30
+ href: string;
31
+ /** Optional media query applied to the stylesheet link. */
32
+ media?: string;
33
+ };
34
+ /** Creates a module asset entry for a rendered fragment. */
35
+ export declare function scriptModuleAsset(src: string, stage?: 'hydrate' | 'idle' | 'immediate'): RenderedComponentAsset;
36
+ /** Creates a modulepreload hint for a rendered fragment. */
37
+ export declare function modulePreloadAsset(href: string): RenderedComponentAsset;
38
+ /** Creates a stylesheet asset entry for a rendered fragment. */
39
+ export declare function styleAsset(href: string, media?: string): RenderedComponentAsset;
40
+ /** Portable metadata for a server-rendered custom-element fragment. */
41
+ export type RenderedComponentMetadata = {
42
+ /** Asset dependencies required by the rendered fragment. */
43
+ assets: readonly RenderedComponentAsset[];
44
+ /** Browser-importable client module URL used to register the component before hydration. */
45
+ clientModuleUrl?: string;
46
+ /** ISO timestamp describing when the fragment was rendered. */
47
+ generatedAt: string;
48
+ /** Custom-element tag name emitted at the fragment root. */
49
+ tagName: string;
50
+ };
51
+ /** Canonical server render result returned by `renderComponent()`. */
52
+ export type RenderedComponent = {
53
+ /** Serialized custom-element host markup. */
54
+ markup: string;
55
+ /** Transport-agnostic metadata that adapters can map onto headers or JSON. */
56
+ metadata: RenderedComponentMetadata;
57
+ /** JSX-compatible preview value that can be embedded into a larger SSR shell. */
58
+ preview: JsxRenderable;
59
+ };
60
+ /** Serializable metadata for a server-rendered custom-element fragment. */
61
+ export type RenderedComponentPayload = {
62
+ /** Asset dependencies required by the rendered fragment. */
63
+ assets?: readonly RenderedComponentAsset[];
64
+ /** Browser-importable client module URL used to register the component before hydration. */
65
+ clientModuleSrc?: string;
66
+ /** ISO timestamp describing when the fragment was rendered. */
67
+ generatedAt: string;
68
+ /** Serialized custom-element host markup. */
69
+ markup: string;
70
+ /** Custom-element tag name emitted at the fragment root. */
71
+ tagName: string;
72
+ };
73
+ /** Full SSR result including a JSX-compatible preview value for shell composition. */
74
+ export type RenderedComponentWithPreview = RenderedComponentPayload & {
75
+ /** JSX-compatible preview value that can be embedded into a larger SSR shell. */
76
+ preview: JsxRenderable;
77
+ };
78
+ /** Minimal component contract needed for framework-agnostic SSR helpers. */
79
+ export type ServerRenderableComponent = {
80
+ renderHost?: () => JsxRenderable;
81
+ renderHostToString: (options?: RenderToStringOptions) => string;
82
+ };
83
+ /** Constructor shape for a server-renderable component. */
84
+ export type ServerRenderableComponentConstructor<TComponent extends ServerRenderableComponent> = CustomElementConstructor & {
85
+ new (): TComponent;
86
+ };
87
+ /**
88
+ * Resolves the browser-importable client module URL for a component constructor.
89
+ *
90
+ * Use this when the server adapter can derive the client entry lazily instead of
91
+ * hardcoding `clientModuleSrc` for every render call.
92
+ */
93
+ export type ResolveRenderedComponentClientModule<TComponent extends ServerRenderableComponent> = (component: ServerRenderableComponentConstructor<TComponent>) => string | undefined | Promise<string | undefined>;
94
+ /**
95
+ * Resolves fragment assets for a component constructor.
96
+ *
97
+ * Prefer this over `resolveClientModuleSrc(...)` for new adapters so assets can
98
+ * describe scripts, styles, and preload hints through one transport-agnostic shape.
99
+ */
100
+ export type ResolveRenderedComponentAssets<TComponent extends ServerRenderableComponent> = (component: ServerRenderableComponentConstructor<TComponent>) => readonly RenderedComponentAsset[] | undefined | Promise<readonly RenderedComponentAsset[] | undefined>;
101
+ /**
102
+ * Prepares a component host before SSR so slot-aware logic can observe authored
103
+ * light-DOM content during render.
104
+ */
105
+ export type PrepareRenderedComponentHost<TComponent extends ServerRenderableComponent> = (host: TComponent & HTMLElement, environment: ServerRenderEnvironment) => void;
106
+ /**
107
+ * Ambient SSR context value visible while a standalone component render runs.
108
+ *
109
+ * This lets adapters provide ancestor-like context to `consumeContext(...)` and
110
+ * `contextSelector(...)` without needing to instantiate a real provider host.
111
+ */
112
+ export type RenderComponentSsrContextEntry<TContext extends UnknownContext = UnknownContext> = {
113
+ context: TContext;
114
+ value: ContextType<TContext>;
115
+ };
116
+ type RenderComponentSharedOptions<TComponent extends ServerRenderableComponent> = {
117
+ /** Asset dependencies required by the rendered fragment. */
118
+ assets?: readonly RenderedComponentAsset[];
119
+ /** Serialized authored light-DOM content to attach to the host before rendering. */
120
+ authoredContent?: string;
121
+ /** Browser-importable client module URL used to register the component before hydration. */
122
+ clientModuleSrc?: string;
123
+ /** Initializes the component instance before the host is rendered. */
124
+ initialize?: (component: TComponent) => void;
125
+ /** SSR environment responsible for preparing the host runtime and authored content. */
126
+ environment?: ServerRenderEnvironment;
127
+ /**
128
+ * Dedicated host-preparation hook for slot-aware SSR.
129
+ *
130
+ * Use this when the server needs to append or mutate authored light-DOM
131
+ * nodes directly instead of passing `authoredContent` as a string.
132
+ */
133
+ prepareHost?: PrepareRenderedComponentHost<TComponent>;
134
+ /**
135
+ * Ambient SSR context entries that should be visible while the component is
136
+ * instantiated and rendered.
137
+ *
138
+ * This solves standalone fragment renders that need to consume context from a
139
+ * parent-like server environment.
140
+ */
141
+ ssrContext?: readonly RenderComponentSsrContextEntry[];
142
+ /** Clock override used by tests and adapters that need deterministic timestamps. */
143
+ now?: () => Date;
144
+ /** JSX server-renderer options forwarded to `renderHostToString()`. */
145
+ renderOptions?: RenderToStringOptions;
146
+ /** Lazy asset resolver used when `assets` are not provided directly. */
147
+ resolveAssets?: ResolveRenderedComponentAssets<TComponent>;
148
+ /** Lazy client-module resolver used when `clientModuleSrc` is not provided directly. */
149
+ resolveClientModuleSrc?: ResolveRenderedComponentClientModule<TComponent>;
150
+ /** Explicit tag-name override when `@customElement(...)` metadata is not desired. */
151
+ tagName?: string;
152
+ };
153
+ /** Options accepted by the reusable SSR component rendering helpers. */
154
+ export type RenderComponentOptions<TComponent extends ServerRenderableComponent> = RenderComponentSharedOptions<TComponent> & ({
155
+ component: ServerRenderableComponentConstructor<TComponent>;
156
+ } | {
157
+ load: () => Promise<ServerRenderableComponentConstructor<TComponent>>;
158
+ });
159
+ /** Call-site options used when the component constructor is passed directly. */
160
+ export type RenderComponentCallOptions<TComponent extends ServerRenderableComponent> = RenderComponentSharedOptions<TComponent>;
161
+ /**
162
+ * Serializes a custom element into HTML, inferring its tag name from
163
+ * `@customElement(...)` metadata when the caller does not provide one.
164
+ */
165
+ export declare function renderComponentToString<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<string>;
166
+ export declare function renderComponentToString<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<string>;
167
+ /**
168
+ * Renders a custom element into the canonical portable server-rendered shape,
169
+ * separating transport-agnostic metadata from any HTTP-specific adapter.
170
+ */
171
+ export declare function renderComponent<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<RenderedComponent>;
172
+ export declare function renderComponent<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<RenderedComponent>;
173
+ /**
174
+ * Serializes a custom element into a fragment payload that frameworks can
175
+ * attach to any response shape they prefer.
176
+ */
177
+ export declare function renderComponentToPayload<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<RenderedComponentPayload>;
178
+ export declare function renderComponentToPayload<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<RenderedComponentPayload>;
179
+ /**
180
+ * Renders a component into both fragment metadata and a JSX-compatible preview
181
+ * value that can be embedded into a larger server-rendered shell.
182
+ */
183
+ export declare function renderComponentWithPreview<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<RenderedComponentWithPreview>;
184
+ export declare function renderComponentWithPreview<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<RenderedComponentWithPreview>;
185
+ /**
186
+ * Drops the preview renderable so the result can be sent through lightweight
187
+ * framework adapters or JSON/HTML fragment endpoints.
188
+ */
189
+ export declare function toRenderedComponentPayload(render: RenderedComponentWithPreview | RenderedComponent): RenderedComponentPayload;
190
+ /**
191
+ * Converts a rendered fragment payload into the standard metadata headers used
192
+ * by client-side fragment loaders.
193
+ */
194
+ export declare function createRenderedComponentHeaders(render: RenderedComponent | RenderedComponentMetadata | RenderedComponentPayload | RenderedComponentWithPreview): Record<string, string>;
195
+ export {};
@@ -0,0 +1,3 @@
1
+ import{f as V}from"../chunk-4e559cy5.js";import"../chunk-3ryr5wx2.js";import{h as W}from"../chunk-ssnnxzrj.js";import{l as x}from"../chunk-sf4a2gy5.js";import"../chunk-5b1en9vz.js";import{Ta as I}from"../chunk-e0r6ca2g.js";import{Xa as U}from"../chunk-hztr86b4.js";import"../chunk-9mqtp3js.js";import"../chunk-t8xtvgyg.js";import"../chunk-66e6s792.js";import"../chunk-vgtggzb6.js";var D="x-generated-at",H="x-radiant-tag-name",R="x-radiant-client-module",f="x-radiant-assets";V();function N(j,q="hydrate"){return{kind:"script-module",src:j,stage:q}}function d(j){return{kind:"modulepreload",href:j}}function s(j,q){return q?{kind:"style",href:j,media:q}:{kind:"style",href:j}}async function i(j,q){return(await K(Q(j,q))).markup}async function t(j,q){return K(Q(j,q))}async function o(j,q){return h(await K(Q(j,q)))}async function r(j,q){return M(await K(Q(j,q)))}async function K(j){V();let q=j.environment??x(),F=W(B(j.ssrContext));try{let G="component"in j?j.component:await j.load(),J=new G;v(q,J,j.authoredContent,j.prepareHost),j.initialize?.(J);let X=j.clientModuleSrc??await j.resolveClientModuleSrc?.(G),w=j.assets??await j.resolveAssets?.(G)??[],Y=S(w,X),T=u(Y)??X,A=j.tagName??O(G),P=(j.now??C)().toISOString(),Z=g(j.renderOptions),$=k(J),b=$?.renderHostToString?.(Z)??J.renderHostToString(Z),_=E(J,$,b);return{markup:b,metadata:{assets:Y,clientModuleUrl:T,generatedAt:P,tagName:A},preview:_}}finally{F()}}function k(j){return I()?.resolveRenderBridge(j)}function E(j,q,F){if(!q)return j.renderHost?.()??{nodeType:1,outerHTML:F};if(!q.renderHostToString&&q.renderHost)return{nodeType:1,outerHTML:F};return q.renderHost?.()??j.renderHost?.()??{nodeType:1,outerHTML:F}}function v(j,q,F,G){if(!z(q)){if(F===void 0&&G===void 0)return;throw Error(`${q.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}j.prepareHost(q,{authoredContent:F}),G?.(q,j)}function B(j){if(!j||j.length===0)return[];return j.map((q)=>({getContext:()=>q.value,getContextKey:()=>q.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function h(j){if("metadata"in j)return{assets:j.metadata.assets,clientModuleSrc:j.metadata.clientModuleUrl,generatedAt:j.metadata.generatedAt,markup:j.markup,tagName:j.metadata.tagName};let{preview:q,...F}=j;return F}function n(j){let q=y(j);return{...q.assets.length>0?{[f]:JSON.stringify(q.assets)}:{},...q.clientModuleUrl?{[R]:q.clientModuleUrl}:{},[D]:q.generatedAt,[H]:q.tagName}}function y(j){if("metadata"in j)return j.metadata;if("markup"in j)return{assets:j.assets??L(j.clientModuleSrc),clientModuleUrl:j.clientModuleSrc,generatedAt:j.generatedAt,tagName:j.tagName};return j}function M(j){return{assets:j.metadata.assets,clientModuleSrc:j.metadata.clientModuleUrl,generatedAt:j.metadata.generatedAt,markup:j.markup,preview:j.preview,tagName:j.metadata.tagName}}function C(){return new Date}function L(j){if(!j)return[];return[N(j)]}function S(j,q){if(!q)return j;if(j.some((F)=>F.kind==="script-module"&&F.src===q))return j;return[...L(q),...j]}function u(j){return j.find((q)=>q.kind==="script-module")?.src}function Q(j,q){if(typeof j==="function")return{...q,component:j};return j}function g(j){if(j?.hydrate!==void 0)return j;return{...j,hydrate:!0}}function z(j){return"innerHTML"in j}function O(j){let q=U(j);if(!q)throw Error(`${j.name} is missing @customElement metadata.`);return q}export{h as toRenderedComponentPayload,s as styleAsset,N as scriptModuleAsset,r as renderComponentWithPreview,i as renderComponentToString,o as renderComponentToPayload,t as renderComponent,d as modulePreloadAsset,n as createRenderedComponentHeaders,H as RENDERED_COMPONENT_TAG_NAME_HEADER,D as RENDERED_COMPONENT_GENERATED_AT_HEADER,R as RENDERED_COMPONENT_CLIENT_MODULE_HEADER,f as RENDERED_COMPONENT_ASSETS_HEADER};
2
+
3
+ //# debugId=D8CA00B6DC44E8E864756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/server/render-component.ts"],
4
+ "sourcesContent": [
5
+ "import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport {\n\tgetRadiantComponentSsrRuntime,\n\ttype RadiantComponentRenderBridge,\n\ttype RadiantComponentSsrCapable,\n} from '../core/radiant-component-ssr-registry';\nimport { withSsrContextProviders } from './context-ssr';\nimport type { ContextType, UnknownContext } from '../context/types';\nimport { getCustomElementTagName } from '../core/custom-element-metadata';\nimport { createServerRenderEnvironment, type ServerRenderEnvironment } from './light-dom-shim';\nimport { ensureRadiantComponentSsrRuntimeRegistered } from './radiant-component-ssr-runtime';\n\n/** Default response header carrying the fragment render timestamp. */\nexport const RENDERED_COMPONENT_GENERATED_AT_HEADER = 'x-generated-at';\n\n/** Default response header carrying the custom-element tag name for the fragment. */\nexport const RENDERED_COMPONENT_TAG_NAME_HEADER = 'x-radiant-tag-name';\n\n/** Default response header carrying the client module URL for the fragment. */\nexport const RENDERED_COMPONENT_CLIENT_MODULE_HEADER = 'x-radiant-client-module';\n\n/** Default response header carrying serialized fragment asset metadata. */\nexport const RENDERED_COMPONENT_ASSETS_HEADER = 'x-radiant-assets';\n\nensureRadiantComponentSsrRuntimeRegistered();\n\n/** Asset dependency emitted by a rendered fragment. */\nexport type RenderedComponentAsset =\n\t| {\n\t\t\t/** Browser module specifier that must be loaded to activate the fragment. */\n\t\t\tkind: 'script-module';\n\t\t\t/** Runtime loading policy for the module. */\n\t\t\tstage?: 'hydrate' | 'idle' | 'immediate';\n\t\t\t/** Module specifier or browser-importable URL. */\n\t\t\tsrc: string;\n\t }\n\t| {\n\t\t\t/** Module graph preload hint for adapters that control the document head. */\n\t\t\tkind: 'modulepreload';\n\t\t\t/** Module specifier or browser-importable URL. */\n\t\t\thref: string;\n\t }\n\t| {\n\t\t\t/** Stylesheet dependency required by the rendered fragment. */\n\t\t\tkind: 'style';\n\t\t\t/** Browser-importable stylesheet URL. */\n\t\t\thref: string;\n\t\t\t/** Optional media query applied to the stylesheet link. */\n\t\t\tmedia?: string;\n\t };\n\n/** Creates a module asset entry for a rendered fragment. */\nexport function scriptModuleAsset(\n\tsrc: string,\n\tstage: 'hydrate' | 'idle' | 'immediate' = 'hydrate',\n): RenderedComponentAsset {\n\treturn { kind: 'script-module', src, stage };\n}\n\n/** Creates a modulepreload hint for a rendered fragment. */\nexport function modulePreloadAsset(href: string): RenderedComponentAsset {\n\treturn { kind: 'modulepreload', href };\n}\n\n/** Creates a stylesheet asset entry for a rendered fragment. */\nexport function styleAsset(href: string, media?: string): RenderedComponentAsset {\n\treturn media ? { kind: 'style', href, media } : { kind: 'style', href };\n}\n\n/** Portable metadata for a server-rendered custom-element fragment. */\nexport type RenderedComponentMetadata = {\n\t/** Asset dependencies required by the rendered fragment. */\n\tassets: readonly RenderedComponentAsset[];\n\t/** Browser-importable client module URL used to register the component before hydration. */\n\tclientModuleUrl?: string;\n\t/** ISO timestamp describing when the fragment was rendered. */\n\tgeneratedAt: string;\n\t/** Custom-element tag name emitted at the fragment root. */\n\ttagName: string;\n};\n\n/** Canonical server render result returned by `renderComponent()`. */\nexport type RenderedComponent = {\n\t/** Serialized custom-element host markup. */\n\tmarkup: string;\n\t/** Transport-agnostic metadata that adapters can map onto headers or JSON. */\n\tmetadata: RenderedComponentMetadata;\n\t/** JSX-compatible preview value that can be embedded into a larger SSR shell. */\n\tpreview: JsxRenderable;\n};\n\n/** Serializable metadata for a server-rendered custom-element fragment. */\nexport type RenderedComponentPayload = {\n\t/** Asset dependencies required by the rendered fragment. */\n\tassets?: readonly RenderedComponentAsset[];\n\t/** Browser-importable client module URL used to register the component before hydration. */\n\tclientModuleSrc?: string;\n\t/** ISO timestamp describing when the fragment was rendered. */\n\tgeneratedAt: string;\n\t/** Serialized custom-element host markup. */\n\tmarkup: string;\n\t/** Custom-element tag name emitted at the fragment root. */\n\ttagName: string;\n};\n\n/** Full SSR result including a JSX-compatible preview value for shell composition. */\nexport type RenderedComponentWithPreview = RenderedComponentPayload & {\n\t/** JSX-compatible preview value that can be embedded into a larger SSR shell. */\n\tpreview: JsxRenderable;\n};\n\n/** Minimal component contract needed for framework-agnostic SSR helpers. */\nexport type ServerRenderableComponent = {\n\trenderHost?: () => JsxRenderable;\n\trenderHostToString: (options?: RenderToStringOptions) => string;\n};\n\n/** Constructor shape for a server-renderable component. */\nexport type ServerRenderableComponentConstructor<TComponent extends ServerRenderableComponent> =\n\tCustomElementConstructor & {\n\t\tnew (): TComponent;\n\t};\n\n/**\n * Resolves the browser-importable client module URL for a component constructor.\n *\n * Use this when the server adapter can derive the client entry lazily instead of\n * hardcoding `clientModuleSrc` for every render call.\n */\nexport type ResolveRenderedComponentClientModule<TComponent extends ServerRenderableComponent> = (\n\tcomponent: ServerRenderableComponentConstructor<TComponent>,\n) => string | undefined | Promise<string | undefined>;\n\n/**\n * Resolves fragment assets for a component constructor.\n *\n * Prefer this over `resolveClientModuleSrc(...)` for new adapters so assets can\n * describe scripts, styles, and preload hints through one transport-agnostic shape.\n */\nexport type ResolveRenderedComponentAssets<TComponent extends ServerRenderableComponent> = (\n\tcomponent: ServerRenderableComponentConstructor<TComponent>,\n) => readonly RenderedComponentAsset[] | undefined | Promise<readonly RenderedComponentAsset[] | undefined>;\n\n/**\n * Prepares a component host before SSR so slot-aware logic can observe authored\n * light-DOM content during render.\n */\nexport type PrepareRenderedComponentHost<TComponent extends ServerRenderableComponent> = (\n\thost: TComponent & HTMLElement,\n\tenvironment: ServerRenderEnvironment,\n) => void;\n\n/**\n * Ambient SSR context value visible while a standalone component render runs.\n *\n * This lets adapters provide ancestor-like context to `consumeContext(...)` and\n * `contextSelector(...)` without needing to instantiate a real provider host.\n */\nexport type RenderComponentSsrContextEntry<TContext extends UnknownContext = UnknownContext> = {\n\tcontext: TContext;\n\tvalue: ContextType<TContext>;\n};\n\ntype RenderComponentSharedOptions<TComponent extends ServerRenderableComponent> = {\n\t/** Asset dependencies required by the rendered fragment. */\n\tassets?: readonly RenderedComponentAsset[];\n\t/** Serialized authored light-DOM content to attach to the host before rendering. */\n\tauthoredContent?: string;\n\t/** Browser-importable client module URL used to register the component before hydration. */\n\tclientModuleSrc?: string;\n\t/** Initializes the component instance before the host is rendered. */\n\tinitialize?: (component: TComponent) => void;\n\t/** SSR environment responsible for preparing the host runtime and authored content. */\n\tenvironment?: ServerRenderEnvironment;\n\t/**\n\t * Dedicated host-preparation hook for slot-aware SSR.\n\t *\n\t * Use this when the server needs to append or mutate authored light-DOM\n\t * nodes directly instead of passing `authoredContent` as a string.\n\t */\n\tprepareHost?: PrepareRenderedComponentHost<TComponent>;\n\t/**\n\t * Ambient SSR context entries that should be visible while the component is\n\t * instantiated and rendered.\n\t *\n\t * This solves standalone fragment renders that need to consume context from a\n\t * parent-like server environment.\n\t */\n\tssrContext?: readonly RenderComponentSsrContextEntry[];\n\t/** Clock override used by tests and adapters that need deterministic timestamps. */\n\tnow?: () => Date;\n\t/** JSX server-renderer options forwarded to `renderHostToString()`. */\n\trenderOptions?: RenderToStringOptions;\n\t/** Lazy asset resolver used when `assets` are not provided directly. */\n\tresolveAssets?: ResolveRenderedComponentAssets<TComponent>;\n\t/** Lazy client-module resolver used when `clientModuleSrc` is not provided directly. */\n\tresolveClientModuleSrc?: ResolveRenderedComponentClientModule<TComponent>;\n\t/** Explicit tag-name override when `@customElement(...)` metadata is not desired. */\n\ttagName?: string;\n};\n\n/** Options accepted by the reusable SSR component rendering helpers. */\nexport type RenderComponentOptions<TComponent extends ServerRenderableComponent> =\n\tRenderComponentSharedOptions<TComponent> &\n\t\t(\n\t\t\t| {\n\t\t\t\t\tcomponent: ServerRenderableComponentConstructor<TComponent>;\n\t\t\t }\n\t\t\t| {\n\t\t\t\t\tload: () => Promise<ServerRenderableComponentConstructor<TComponent>>;\n\t\t\t }\n\t\t);\n\n/** Call-site options used when the component constructor is passed directly. */\nexport type RenderComponentCallOptions<TComponent extends ServerRenderableComponent> =\n\tRenderComponentSharedOptions<TComponent>;\n\n/**\n * Serializes a custom element into HTML, inferring its tag name from\n * `@customElement(...)` metadata when the caller does not provide one.\n */\nexport function renderComponentToString<TComponent extends ServerRenderableComponent>(\n\tcomponent: ServerRenderableComponentConstructor<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<string>;\n\nexport function renderComponentToString<TComponent extends ServerRenderableComponent>(\n\toptions: RenderComponentOptions<TComponent>,\n): Promise<string>;\n\nexport async function renderComponentToString<TComponent extends ServerRenderableComponent>(\n\tcomponentOrOptions: ServerRenderableComponentConstructor<TComponent> | RenderComponentOptions<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<string> {\n\treturn (await renderResolvedComponent(normalizeRenderComponentOptions(componentOrOptions, options))).markup;\n}\n\n/**\n * Renders a custom element into the canonical portable server-rendered shape,\n * separating transport-agnostic metadata from any HTTP-specific adapter.\n */\nexport function renderComponent<TComponent extends ServerRenderableComponent>(\n\tcomponent: ServerRenderableComponentConstructor<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<RenderedComponent>;\n\nexport function renderComponent<TComponent extends ServerRenderableComponent>(\n\toptions: RenderComponentOptions<TComponent>,\n): Promise<RenderedComponent>;\n\nexport async function renderComponent<TComponent extends ServerRenderableComponent>(\n\tcomponentOrOptions: ServerRenderableComponentConstructor<TComponent> | RenderComponentOptions<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<RenderedComponent> {\n\treturn renderResolvedComponent(normalizeRenderComponentOptions(componentOrOptions, options));\n}\n\n/**\n * Serializes a custom element into a fragment payload that frameworks can\n * attach to any response shape they prefer.\n */\nexport function renderComponentToPayload<TComponent extends ServerRenderableComponent>(\n\tcomponent: ServerRenderableComponentConstructor<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<RenderedComponentPayload>;\n\nexport function renderComponentToPayload<TComponent extends ServerRenderableComponent>(\n\toptions: RenderComponentOptions<TComponent>,\n): Promise<RenderedComponentPayload>;\n\nexport async function renderComponentToPayload<TComponent extends ServerRenderableComponent>(\n\tcomponentOrOptions: ServerRenderableComponentConstructor<TComponent> | RenderComponentOptions<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<RenderedComponentPayload> {\n\treturn toRenderedComponentPayload(\n\t\tawait renderResolvedComponent(normalizeRenderComponentOptions(componentOrOptions, options)),\n\t);\n}\n\n/**\n * Renders a component into both fragment metadata and a JSX-compatible preview\n * value that can be embedded into a larger server-rendered shell.\n */\nexport function renderComponentWithPreview<TComponent extends ServerRenderableComponent>(\n\tcomponent: ServerRenderableComponentConstructor<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<RenderedComponentWithPreview>;\n\nexport function renderComponentWithPreview<TComponent extends ServerRenderableComponent>(\n\toptions: RenderComponentOptions<TComponent>,\n): Promise<RenderedComponentWithPreview>;\n\nexport async function renderComponentWithPreview<TComponent extends ServerRenderableComponent>(\n\tcomponentOrOptions: ServerRenderableComponentConstructor<TComponent> | RenderComponentOptions<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<RenderedComponentWithPreview> {\n\treturn toRenderedComponentWithPreview(\n\t\tawait renderResolvedComponent(normalizeRenderComponentOptions(componentOrOptions, options)),\n\t);\n}\n\nasync function renderResolvedComponent<TComponent extends ServerRenderableComponent>(\n\tnormalizedOptions: RenderComponentOptions<TComponent>,\n): Promise<RenderedComponent> {\n\tensureRadiantComponentSsrRuntimeRegistered();\n\n\tconst environment = normalizedOptions.environment ?? createServerRenderEnvironment();\n\tconst restoreAmbientContext = withSsrContextProviders(\n\t\tcreateAmbientSsrContextProviders(normalizedOptions.ssrContext),\n\t);\n\n\ttry {\n\t\tconst Component =\n\t\t\t'component' in normalizedOptions ? normalizedOptions.component : await normalizedOptions.load();\n\t\tconst component = new Component();\n\t\tprepareRenderedComponentHost(\n\t\t\tenvironment,\n\t\t\tcomponent,\n\t\t\tnormalizedOptions.authoredContent,\n\t\t\tnormalizedOptions.prepareHost,\n\t\t);\n\t\tnormalizedOptions.initialize?.(component);\n\n\t\tconst legacyClientModuleSrc =\n\t\t\tnormalizedOptions.clientModuleSrc ?? (await normalizedOptions.resolveClientModuleSrc?.(Component));\n\t\tconst resolvedAssets = normalizedOptions.assets ?? (await normalizedOptions.resolveAssets?.(Component)) ?? [];\n\t\tconst assets = mergeRenderedComponentAssets(resolvedAssets, legacyClientModuleSrc);\n\t\tconst clientModuleSrc = resolvePrimaryClientModuleSrc(assets) ?? legacyClientModuleSrc;\n\t\tconst tagName = normalizedOptions.tagName ?? resolveRenderedComponentTagName(Component);\n\t\tconst generatedAt = (normalizedOptions.now ?? createDefaultRenderTimestamp)().toISOString();\n\t\tconst renderOptions = normalizeRenderOptions(normalizedOptions.renderOptions);\n\t\tconst radiantSsrBridge = getRadiantComponentRenderBridge(component as unknown as RadiantComponentSsrCapable);\n\t\tconst markup =\n\t\t\tradiantSsrBridge?.renderHostToString?.(renderOptions) ?? component.renderHostToString(renderOptions);\n\t\tconst preview = resolveRenderedComponentPreview(component, radiantSsrBridge, markup);\n\n\t\treturn {\n\t\t\tmarkup,\n\t\t\tmetadata: {\n\t\t\t\tassets,\n\t\t\t\tclientModuleUrl: clientModuleSrc,\n\t\t\t\tgeneratedAt,\n\t\t\t\ttagName,\n\t\t\t},\n\t\t\tpreview,\n\t\t};\n\t} finally {\n\t\trestoreAmbientContext();\n\t}\n}\n\nfunction getRadiantComponentRenderBridge(\n\tcomponent: RadiantComponentSsrCapable,\n): RadiantComponentRenderBridge | undefined {\n\treturn getRadiantComponentSsrRuntime()?.resolveRenderBridge(component);\n}\n\n/**\n * Chooses the preview renderable returned by `renderComponent()`.\n *\n * When a component overrides only `renderHostToString()`, the inherited\n * `renderHost()` implementation would otherwise generate a different preview\n * tree than the final serialized markup. In that case the preview falls back to\n * the already-computed markup so shell composition stays aligned with the real\n * SSR output.\n */\nfunction resolveRenderedComponentPreview<TComponent extends ServerRenderableComponent>(\n\tcomponent: TComponent,\n\tradiantSsrBridge: RadiantComponentRenderBridge | undefined,\n\tmarkup: string,\n): JsxRenderable {\n\tif (!radiantSsrBridge) {\n\t\treturn component.renderHost?.() ?? { nodeType: 1, outerHTML: markup };\n\t}\n\n\tif (!radiantSsrBridge.renderHostToString && radiantSsrBridge.renderHost) {\n\t\treturn { nodeType: 1, outerHTML: markup };\n\t}\n\n\treturn radiantSsrBridge.renderHost?.() ?? component.renderHost?.() ?? { nodeType: 1, outerHTML: markup };\n}\n\nfunction prepareRenderedComponentHost<TComponent extends ServerRenderableComponent>(\n\tenvironment: ServerRenderEnvironment,\n\tcomponent: TComponent,\n\tauthoredContent: string | undefined,\n\tprepareHost: PrepareRenderedComponentHost<TComponent> | undefined,\n): void {\n\tif (!canPrepareSsrHost(component)) {\n\t\tif (authoredContent === undefined && prepareHost === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tthrow new Error(\n\t\t\t`${component.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`,\n\t\t);\n\t}\n\n\tenvironment.prepareHost(component, { authoredContent });\n\tprepareHost?.(component, environment);\n}\n\n/**\n * Wraps ad-hoc `ssrContext` values in provider-like objects so the existing SSR\n * context stack can resolve them exactly like real ancestor providers.\n */\nfunction createAmbientSsrContextProviders(\n\tentries: readonly RenderComponentSsrContextEntry[] | undefined,\n): SsrSerializableContextProvider[] {\n\tif (!entries || entries.length === 0) {\n\t\treturn [];\n\t}\n\n\treturn entries.map((entry) => ({\n\t\tgetContext: () => entry.value,\n\t\tgetContextKey: () => entry.context,\n\t\trenderHydrationScript: () => undefined,\n\t\trenderHydrationScriptTag: () => undefined,\n\t}));\n}\n\n/**\n * Drops the preview renderable so the result can be sent through lightweight\n * framework adapters or JSON/HTML fragment endpoints.\n */\nexport function toRenderedComponentPayload(\n\trender: RenderedComponentWithPreview | RenderedComponent,\n): RenderedComponentPayload {\n\tif ('metadata' in render) {\n\t\treturn {\n\t\t\tassets: render.metadata.assets,\n\t\t\tclientModuleSrc: render.metadata.clientModuleUrl,\n\t\t\tgeneratedAt: render.metadata.generatedAt,\n\t\t\tmarkup: render.markup,\n\t\t\ttagName: render.metadata.tagName,\n\t\t};\n\t}\n\n\tconst { preview: _preview, ...payload } = render;\n\treturn payload;\n}\n\n/**\n * Converts a rendered fragment payload into the standard metadata headers used\n * by client-side fragment loaders.\n */\nexport function createRenderedComponentHeaders(\n\trender: RenderedComponent | RenderedComponentMetadata | RenderedComponentPayload | RenderedComponentWithPreview,\n): Record<string, string> {\n\tconst metadata = toRenderedComponentMetadata(render);\n\n\treturn {\n\t\t...(metadata.assets.length > 0 ? { [RENDERED_COMPONENT_ASSETS_HEADER]: JSON.stringify(metadata.assets) } : {}),\n\t\t...(metadata.clientModuleUrl ? { [RENDERED_COMPONENT_CLIENT_MODULE_HEADER]: metadata.clientModuleUrl } : {}),\n\t\t[RENDERED_COMPONENT_GENERATED_AT_HEADER]: metadata.generatedAt,\n\t\t[RENDERED_COMPONENT_TAG_NAME_HEADER]: metadata.tagName,\n\t};\n}\n\nfunction toRenderedComponentMetadata(\n\trender: RenderedComponent | RenderedComponentMetadata | RenderedComponentPayload | RenderedComponentWithPreview,\n): RenderedComponentMetadata {\n\tif ('metadata' in render) {\n\t\treturn render.metadata;\n\t}\n\n\tif ('markup' in render) {\n\t\treturn {\n\t\t\tassets: render.assets ?? createLegacyRenderedComponentAssets(render.clientModuleSrc),\n\t\t\tclientModuleUrl: render.clientModuleSrc,\n\t\t\tgeneratedAt: render.generatedAt,\n\t\t\ttagName: render.tagName,\n\t\t};\n\t}\n\n\treturn render;\n}\n\nfunction toRenderedComponentWithPreview(render: RenderedComponent): RenderedComponentWithPreview {\n\treturn {\n\t\tassets: render.metadata.assets,\n\t\tclientModuleSrc: render.metadata.clientModuleUrl,\n\t\tgeneratedAt: render.metadata.generatedAt,\n\t\tmarkup: render.markup,\n\t\tpreview: render.preview,\n\t\ttagName: render.metadata.tagName,\n\t};\n}\n\nfunction createDefaultRenderTimestamp(): Date {\n\treturn new Date();\n}\n\nfunction createLegacyRenderedComponentAssets(clientModuleSrc: string | undefined): readonly RenderedComponentAsset[] {\n\tif (!clientModuleSrc) {\n\t\treturn [];\n\t}\n\n\treturn [scriptModuleAsset(clientModuleSrc)];\n}\n\nfunction mergeRenderedComponentAssets(\n\tassets: readonly RenderedComponentAsset[],\n\tlegacyClientModuleSrc: string | undefined,\n): readonly RenderedComponentAsset[] {\n\tif (!legacyClientModuleSrc) {\n\t\treturn assets;\n\t}\n\n\tif (assets.some((asset) => asset.kind === 'script-module' && asset.src === legacyClientModuleSrc)) {\n\t\treturn assets;\n\t}\n\n\treturn [...createLegacyRenderedComponentAssets(legacyClientModuleSrc), ...assets];\n}\n\nfunction resolvePrimaryClientModuleSrc(assets: readonly RenderedComponentAsset[]): string | undefined {\n\treturn assets.find((asset) => asset.kind === 'script-module')?.src;\n}\n\nfunction normalizeRenderComponentOptions<TComponent extends ServerRenderableComponent>(\n\tcomponentOrOptions: ServerRenderableComponentConstructor<TComponent> | RenderComponentOptions<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): RenderComponentOptions<TComponent> {\n\tif (typeof componentOrOptions === 'function') {\n\t\treturn {\n\t\t\t...options,\n\t\t\tcomponent: componentOrOptions,\n\t\t};\n\t}\n\n\treturn componentOrOptions;\n}\n\nfunction normalizeRenderOptions(options: RenderToStringOptions | undefined): RenderToStringOptions {\n\tif (options?.hydrate !== undefined) {\n\t\treturn options;\n\t}\n\n\treturn {\n\t\t...options,\n\t\thydrate: true,\n\t};\n}\n\nfunction canPrepareSsrHost<TComponent extends ServerRenderableComponent>(\n\tcomponent: TComponent,\n): component is TComponent & HTMLElement {\n\treturn 'innerHTML' in component;\n}\n\nfunction resolveRenderedComponentTagName(target: CustomElementConstructor): string {\n\tconst tagName = getCustomElementTagName(target);\n\n\tif (!tagName) {\n\t\tthrow new Error(`${target.name} is missing @customElement metadata.`);\n\t}\n\n\treturn tagName;\n}\n"
6
+ ],
7
+ "mappings": "+aAeO,DAAM,HAAyC,YAGzC,HAAqC,gBAGrC,HAA0C,qBAG1C,HAAmC,cAEhD,HAA2C,EA4BpC,SAAS,CAAiB,CAChC,EACA,EAA0C,UACjB,CACzB,MAAO,CAAE,KAAM,gBAAiB,MAAK,OAAM,EAIrC,SAAS,CAAkB,CAAC,EAAsC,CACxE,MAAO,CAAE,KAAM,gBAAiB,MAAK,EAI/B,SAAS,CAAU,CAAC,EAAc,EAAwC,CAChF,OAAO,EAAQ,CAAE,KAAM,QAAS,OAAM,OAAM,EAAI,CAAE,KAAM,QAAS,MAAK,EAoKvE,eAAsB,CAAqE,CAC1F,EACA,EACkB,CAClB,OAAQ,MAAM,EAAwB,EAAgC,EAAoB,CAAO,CAAC,GAAG,OAgBtG,eAAsB,CAA6D,CAClF,EACA,EAC6B,CAC7B,OAAO,EAAwB,EAAgC,EAAoB,CAAO,CAAC,EAgB5F,eAAsB,CAAsE,CAC3F,EACA,EACoC,CACpC,OAAO,EACN,MAAM,EAAwB,EAAgC,EAAoB,CAAO,CAAC,CAC3F,EAgBD,eAAsB,CAAwE,CAC7F,EACA,EACwC,CACxC,OAAO,EACN,MAAM,EAAwB,EAAgC,EAAoB,CAAO,CAAC,CAC3F,EAGD,eAAe,CAAqE,CACnF,EAC6B,CAC7B,EAA2C,EAE3C,IAAM,EAAc,EAAkB,aAAe,EAA8B,EAC7E,EAAwB,EAC7B,EAAiC,EAAkB,UAAU,CAC9D,EAEA,GAAI,CACH,IAAM,EACL,cAAe,EAAoB,EAAkB,UAAY,MAAM,EAAkB,KAAK,EACzF,EAAY,IAAI,EACtB,EACC,EACA,EACA,EAAkB,gBAClB,EAAkB,WACnB,EACA,EAAkB,aAAa,CAAS,EAExC,IAAM,EACL,EAAkB,iBAAoB,MAAM,EAAkB,yBAAyB,CAAS,EAC3F,EAAiB,EAAkB,QAAW,MAAM,EAAkB,gBAAgB,CAAS,GAAM,CAAC,EACtG,EAAS,EAA6B,EAAgB,CAAqB,EAC3E,EAAkB,EAA8B,CAAM,GAAK,EAC3D,EAAU,EAAkB,SAAW,EAAgC,CAAS,EAChF,GAAe,EAAkB,KAAO,GAA8B,EAAE,YAAY,EACpF,EAAgB,EAAuB,EAAkB,aAAa,EACtE,EAAmB,EAAgC,CAAkD,EACrG,EACL,GAAkB,qBAAqB,CAAa,GAAK,EAAU,mBAAmB,CAAa,EAC9F,EAAU,EAAgC,EAAW,EAAkB,CAAM,EAEnF,MAAO,CACN,SACA,SAAU,CACT,SACA,gBAAiB,EACjB,cACA,SACD,EACA,SACD,SACC,CACD,EAAsB,GAIxB,SAAS,CAA+B,CACvC,EAC2C,CAC3C,OAAO,EAA8B,GAAG,oBAAoB,CAAS,EAYtE,SAAS,CAA6E,CACrF,EACA,EACA,EACgB,CAChB,GAAI,CAAC,EACJ,OAAO,EAAU,aAAa,GAAK,CAAE,SAAU,EAAG,UAAW,CAAO,EAGrE,GAAI,CAAC,EAAiB,oBAAsB,EAAiB,WAC5D,MAAO,CAAE,SAAU,EAAG,UAAW,CAAO,EAGzC,OAAO,EAAiB,aAAa,GAAK,EAAU,aAAa,GAAK,CAAE,SAAU,EAAG,UAAW,CAAO,EAGxG,SAAS,CAA0E,CAClF,EACA,EACA,EACA,EACO,CACP,GAAI,CAAC,EAAkB,CAAS,EAAG,CAClC,GAAI,IAAoB,QAAa,IAAgB,OACpD,OAGD,MAAU,MACT,GAAG,EAAU,YAAY,4FAC1B,EAGD,EAAY,YAAY,EAAW,CAAE,iBAAgB,CAAC,EACtD,IAAc,EAAW,CAAW,EAOrC,SAAS,CAAgC,CACxC,EACmC,CACnC,GAAI,CAAC,GAAW,EAAQ,SAAW,EAClC,MAAO,CAAC,EAGT,OAAO,EAAQ,IAAI,CAAC,KAAW,CAC9B,WAAY,IAAM,EAAM,MACxB,cAAe,IAAM,EAAM,QAC3B,sBAAuB,IAAG,CAAG,QAC7B,yBAA0B,IAAG,CAAG,OACjC,EAAE,EAOI,SAAS,CAA0B,CACzC,EAC2B,CAC3B,GAAI,aAAc,EACjB,MAAO,CACN,OAAQ,EAAO,SAAS,OACxB,gBAAiB,EAAO,SAAS,gBACjC,YAAa,EAAO,SAAS,YAC7B,OAAQ,EAAO,OACf,QAAS,EAAO,SAAS,OAC1B,EAGD,IAAQ,QAAS,KAAa,GAAY,EAC1C,OAAO,EAOD,SAAS,CAA8B,CAC7C,EACyB,CACzB,IAAM,EAAW,EAA4B,CAAM,EAEnD,MAAO,IACF,EAAS,OAAO,OAAS,EAAI,EAAG,GAAmC,KAAK,UAAU,EAAS,MAAM,CAAE,EAAI,CAAC,KACxG,EAAS,gBAAkB,EAAG,GAA0C,EAAS,eAAgB,EAAI,CAAC,GACzG,GAAyC,EAAS,aAClD,GAAqC,EAAS,OAChD,EAGD,SAAS,CAA2B,CACnC,EAC4B,CAC5B,GAAI,aAAc,EACjB,OAAO,EAAO,SAGf,GAAI,WAAY,EACf,MAAO,CACN,OAAQ,EAAO,QAAU,EAAoC,EAAO,eAAe,EACnF,gBAAiB,EAAO,gBACxB,YAAa,EAAO,YACpB,QAAS,EAAO,OACjB,EAGD,OAAO,EAGR,SAAS,CAA8B,CAAC,EAAyD,CAChG,MAAO,CACN,OAAQ,EAAO,SAAS,OACxB,gBAAiB,EAAO,SAAS,gBACjC,YAAa,EAAO,SAAS,YAC7B,OAAQ,EAAO,OACf,QAAS,EAAO,QAChB,QAAS,EAAO,SAAS,OAC1B,EAGD,SAAS,CAA4B,EAAS,CAC7C,OAAO,IAAI,KAGZ,SAAS,CAAmC,CAAC,EAAwE,CACpH,GAAI,CAAC,EACJ,MAAO,CAAC,EAGT,MAAO,CAAC,EAAkB,CAAe,CAAC,EAG3C,SAAS,CAA4B,CACpC,EACA,EACoC,CACpC,GAAI,CAAC,EACJ,OAAO,EAGR,GAAI,EAAO,KAAK,CAAC,IAAU,EAAM,OAAS,iBAAmB,EAAM,MAAQ,CAAqB,EAC/F,OAAO,EAGR,MAAO,CAAC,GAAG,EAAoC,CAAqB,EAAG,GAAG,CAAM,EAGjF,SAAS,CAA6B,CAAC,EAA+D,CACrG,OAAO,EAAO,KAAK,CAAC,IAAU,EAAM,OAAS,eAAe,GAAG,IAGhE,SAAS,CAA6E,CACrF,EACA,EACqC,CACrC,GAAI,OAAO,IAAuB,WACjC,MAAO,IACH,EACH,UAAW,CACZ,EAGD,OAAO,EAGR,SAAS,CAAsB,CAAC,EAAmE,CAClG,GAAI,GAAS,UAAY,OACxB,OAAO,EAGR,MAAO,IACH,EACH,QAAS,EACV,EAGD,SAAS,CAA+D,CACvE,EACwC,CACxC,MAAO,cAAe,EAGvB,SAAS,CAA+B,CAAC,EAA0C,CAClF,IAAM,EAAU,EAAwB,CAAM,EAE9C,GAAI,CAAC,EACJ,MAAU,MAAM,GAAG,EAAO,0CAA0C,EAGrE,OAAO",
8
+ "debugId": "D8CA00B6DC44E8E864756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,3 @@
1
+ import { type JsxRenderable } from '@ecopages/jsx';
2
+ export declare function parseProjectedSlotRenderablesFromHtml(html: string): Map<string, JsxRenderable[]>;
3
+ export declare function collectAuthoredHydrationScriptMarkupFromHtml(html: string): string | undefined;
@@ -0,0 +1,3 @@
1
+ import{o as z}from"../chunk-5b1en9vz.js";import{hb as y,ib as B}from"../chunk-3xxvmd5c.js";import{pb as A}from"../chunk-hpzgnxgq.js";import"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";import{createMarkupNodeLike as G}from"@ecopages/jsx";function W(q){let k=new Map;for(let v of z(q)){if(K(v))continue;I(k,J(v),G(v))}return k}function X(q){let k=z(q).filter((v)=>D(v));return k.length>0?k.join(""):void 0}function I(q,k,v){let w=q.get(k);if(w){w.push(v);return}q.set(k,[v])}function J(q){let k=/^<([A-Za-z][^\s/>]*)([^>]*)>/s.exec(q);if(!k)return y;let v=k[2]??"",w=/\sslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(v);return w?.[1]??w?.[2]??w?.[3]??y}function K(q){return L(q)||D(q)}function L(q){let k=/^<script\b([^>]*)>/i.exec(q);if(!k)return!1;return E(k[1]??"",B)}function D(q){let k=/^<script\b([^>]*)>/i.exec(q);if(!k)return!1;return E(k[1]??"",A)}function E(q,k){return new RegExp(`(?:^|\\s)${k}(?:\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]+))?`,"i").test(q)}export{W as parseProjectedSlotRenderablesFromHtml,X as collectAuthoredHydrationScriptMarkupFromHtml};
2
+
3
+ //# debugId=26A47F455E55CA6F64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/server/slot-projection-html.ts"],
4
+ "sourcesContent": [
5
+ "import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\n\nimport { HYDRATION_ATTRIBUTE } from '../core/hydration-codec';\nimport { DEFAULT_SLOT_NAME, SLOT_PROJECTION_SCRIPT_ATTRIBUTE } from '../core/slot-projection-runtime';\nimport { collectTopLevelHtmlFragments } from './html-parser';\n\nexport function parseProjectedSlotRenderablesFromHtml(html: string): Map<string, JsxRenderable[]> {\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const fragment of collectTopLevelHtmlFragments(html)) {\n\t\tif (isIgnoredProjectedHtmlFragment(fragment)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tappendProjectedRenderable(\n\t\t\tprojectedContent,\n\t\t\tgetSlotNameFromHtmlFragment(fragment),\n\t\t\tcreateMarkupNodeLike(fragment),\n\t\t);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function collectAuthoredHydrationScriptMarkupFromHtml(html: string): string | undefined {\n\tconst fragments = collectTopLevelHtmlFragments(html).filter((fragment) => isHydrationScriptHtmlFragment(fragment));\n\n\treturn fragments.length > 0 ? fragments.join('') : undefined;\n}\n\nfunction appendProjectedRenderable(\n\tprojectedContent: Map<string, JsxRenderable[]>,\n\tslotName: string,\n\trenderable: JsxRenderable,\n): void {\n\tconst existingRenderables = projectedContent.get(slotName);\n\n\tif (existingRenderables) {\n\t\texistingRenderables.push(renderable);\n\t\treturn;\n\t}\n\n\tprojectedContent.set(slotName, [renderable]);\n}\n\nfunction getSlotNameFromHtmlFragment(fragment: string): string {\n\tconst openingTagMatch = /^<([A-Za-z][^\\s/>]*)([^>]*)>/s.exec(fragment);\n\n\tif (!openingTagMatch) {\n\t\treturn DEFAULT_SLOT_NAME;\n\t}\n\n\tconst attributes = openingTagMatch[2] ?? '';\n\tconst slotMatch = /\\sslot\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]+))/i.exec(attributes);\n\n\treturn slotMatch?.[1] ?? slotMatch?.[2] ?? slotMatch?.[3] ?? DEFAULT_SLOT_NAME;\n}\n\nfunction isIgnoredProjectedHtmlFragment(fragment: string): boolean {\n\treturn isSlotProjectionScriptHtmlFragment(fragment) || isHydrationScriptHtmlFragment(fragment);\n}\n\nfunction isSlotProjectionScriptHtmlFragment(fragment: string): boolean {\n\tconst openingTagMatch = /^<script\\b([^>]*)>/i.exec(fragment);\n\n\tif (!openingTagMatch) {\n\t\treturn false;\n\t}\n\n\treturn hasScriptAttribute(openingTagMatch[1] ?? '', SLOT_PROJECTION_SCRIPT_ATTRIBUTE);\n}\n\nfunction isHydrationScriptHtmlFragment(fragment: string): boolean {\n\tconst openingTagMatch = /^<script\\b([^>]*)>/i.exec(fragment);\n\n\tif (!openingTagMatch) {\n\t\treturn false;\n\t}\n\n\treturn hasScriptAttribute(openingTagMatch[1] ?? '', HYDRATION_ATTRIBUTE);\n}\n\nfunction hasScriptAttribute(attributes: string, attributeName: string): boolean {\n\treturn new RegExp(`(?:^|\\\\s)${attributeName}(?:\\\\s*=\\\\s*(?:\"[^\"]*\"|'[^']*'|[^\\\\s>]+))?`, 'i').test(attributes);\n}\n"
6
+ ],
7
+ "mappings": "mNAAA,0BAAS,iBAMF,IAAS,JAAqC,CAAC,EAA4C,CACjG,IAAM,EAAmB,IAAI,IAE7B,QAAW,KAAY,EAA6B,CAAI,EAAG,CAC1D,GAAI,EAA+B,CAAQ,EAC1C,SAGD,EACC,EACA,EAA4B,CAAQ,EACpC,EAAqB,CAAQ,CAC9B,EAGD,OAAO,EAGD,SAAS,CAA4C,CAAC,EAAkC,CAC9F,IAAM,EAAY,EAA6B,CAAI,EAAE,OAAO,CAAC,IAAa,EAA8B,CAAQ,CAAC,EAEjH,OAAO,EAAU,OAAS,EAAI,EAAU,KAAK,EAAE,EAAI,OAGpD,SAAS,CAAyB,CACjC,EACA,EACA,EACO,CACP,IAAM,EAAsB,EAAiB,IAAI,CAAQ,EAEzD,GAAI,EAAqB,CACxB,EAAoB,KAAK,CAAU,EACnC,OAGD,EAAiB,IAAI,EAAU,CAAC,CAAU,CAAC,EAG5C,SAAS,CAA2B,CAAC,EAA0B,CAC9D,IAAM,EAAkB,gCAAgC,KAAK,CAAQ,EAErE,GAAI,CAAC,EACJ,OAAO,EAGR,IAAM,EAAa,EAAgB,IAAM,GACnC,EAAY,kDAAkD,KAAK,CAAU,EAEnF,OAAO,IAAY,IAAM,IAAY,IAAM,IAAY,IAAM,EAG9D,SAAS,CAA8B,CAAC,EAA2B,CAClE,OAAO,EAAmC,CAAQ,GAAK,EAA8B,CAAQ,EAG9F,SAAS,CAAkC,CAAC,EAA2B,CACtE,IAAM,EAAkB,sBAAsB,KAAK,CAAQ,EAE3D,GAAI,CAAC,EACJ,MAAO,GAGR,OAAO,EAAmB,EAAgB,IAAM,GAAI,CAAgC,EAGrF,SAAS,CAA6B,CAAC,EAA2B,CACjE,IAAM,EAAkB,sBAAsB,KAAK,CAAQ,EAE3D,GAAI,CAAC,EACJ,MAAO,GAGR,OAAO,EAAmB,EAAgB,IAAM,GAAI,CAAmB,EAGxE,SAAS,CAAkB,CAAC,EAAoB,EAAgC,CAC/E,OAAO,IAAI,OAAO,YAAY,8CAA2D,GAAG,EAAE,KAAK,CAAU",
8
+ "debugId": "26A47F455E55CA6F64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,59 @@
1
+ import { type AsyncStateFetcherOptions, type AsyncStateResult } from '@ecopages/signals';
2
+ import type { RadiantElement } from '../core/radiant-element';
3
+ export type ResourceContext<Host extends RadiantElement> = {
4
+ host: Host;
5
+ };
6
+ export type ResourceRequestContext<Host extends RadiantElement> = ResourceContext<Host> & AsyncStateFetcherOptions;
7
+ type HostResourceBaseConfig<Host extends RadiantElement, Value> = {
8
+ /** Seed value exposed from `data` before the first successful resolution. */
9
+ initialValue?: Value;
10
+ /** Milliseconds a successful response stays fresh in the per-instance cache. */
11
+ staleTime?: number;
12
+ /** Milliseconds to wait before transitioning `status` to `'pending'`. */
13
+ pendingDelay?: number;
14
+ /** Called after each successful resolution, including cache hits. */
15
+ onSuccess?: (data: Value, ctx: ResourceContext<Host>) => void;
16
+ /** Called after each failed resolution. Not called for aborted requests. */
17
+ onError?: (error: unknown, ctx: ResourceContext<Host>) => void;
18
+ /** Called after each resolution, whether successful or failed. */
19
+ onSettled?: (data: Value | undefined, error: unknown, ctx: ResourceContext<Host>) => void;
20
+ };
21
+ /** Configuration for a host-owned resource that fetches on connect. */
22
+ export interface HostResourceConfig<Host extends RadiantElement, Value> extends HostResourceBaseConfig<Host, Value> {
23
+ fetcher: (ctx: ResourceRequestContext<Host>) => Promise<Value>;
24
+ source?: undefined;
25
+ }
26
+ /** Configuration for a host-owned resource driven by a reactive source. */
27
+ export interface HostResourceSourcedConfig<Host extends RadiantElement, Source, Value> extends HostResourceBaseConfig<Host, Value> {
28
+ /**
29
+ * Returns the current source value while the host is connected.
30
+ *
31
+ * Falsy values (`false`, `null`, `undefined`) disable fetching and preserve
32
+ * the current resource state.
33
+ */
34
+ source: (ctx: ResourceContext<Host>) => Source | false | null | undefined;
35
+ fetcher: (sourceValue: Source, ctx: ResourceRequestContext<Host>) => Promise<Value>;
36
+ }
37
+ export declare class HostResource<Host extends RadiantElement, Value, Source = never> implements AsyncStateResult<Value> {
38
+ readonly data: AsyncStateResult<Value>['data'];
39
+ readonly status: AsyncStateResult<Value>['status'];
40
+ readonly error: AsyncStateResult<Value>['error'];
41
+ private readonly connected;
42
+ private readonly resource;
43
+ private disposed;
44
+ constructor(host: Host, config: HostResourceConfig<Host, Value> | HostResourceSourcedConfig<Host, Source, Value>);
45
+ connect(): void;
46
+ disconnect(): void;
47
+ refetch(): void;
48
+ abort(): void;
49
+ dispose(): void;
50
+ }
51
+ export declare function createHostResource<Host extends RadiantElement, Value>(host: Host, config: HostResourceConfig<Host, Value>): HostResource<Host, Value>;
52
+ export declare function createHostResource<Host extends RadiantElement, Source, Value>(host: Host, config: HostResourceSourcedConfig<Host, Source, Value>): HostResource<Host, Value, Source>;
53
+ /**
54
+ * Creates a host-owned resource and registers connect/disconnect lifecycle
55
+ * hooks on the provided host.
56
+ */
57
+ export declare function createResource<Host extends RadiantElement, Value>(host: Host, config: HostResourceConfig<Host, Value>): HostResource<Host, Value>;
58
+ export declare function createResource<Host extends RadiantElement, Source, Value>(host: Host, config: HostResourceSourcedConfig<Host, Source, Value>): HostResource<Host, Value, Source>;
59
+ export {};
@@ -0,0 +1,3 @@
1
+ import"../chunk-vgtggzb6.js";import{asyncState as E,state as F}from"@ecopages/signals";class B{data;status;error;connected=F(!1);resource;disposed=!1;constructor(z,j){let m={host:z},D={initialValue:j.initialValue,pendingDelay:j.pendingDelay,staleTime:j.staleTime,onError:(q)=>{j.onError?.(q,m)},onSettled:(q,A)=>{j.onSettled?.(q,A,m)},onSuccess:(q)=>{j.onSuccess?.(q,m)}};if(j.source)this.resource=E({...D,source:()=>{if(this.disposed||!this.connected.get())return!1;return j.source(m)},fetcher:(q,A)=>j.fetcher(q,{...m,...A})});else this.resource=E({...D,source:()=>{if(this.disposed||!this.connected.get())return!1;return!0},fetcher:(q,A)=>j.fetcher({...m,...A})});this.data=this.resource.data,this.status=this.resource.status,this.error=this.resource.error}connect(){if(this.disposed||this.connected.get())return;this.connected.set(!0)}disconnect(){if(this.disposed||!this.connected.get())return;this.connected.set(!1),this.resource.abort()}refetch(){if(this.disposed||!this.connected.get())return;this.resource.refetch()}abort(){if(this.disposed)return;this.resource.abort()}dispose(){if(this.disposed)return;this.disposed=!0,this.connected.set(!1),this.resource.dispose()}}function I(z,j){return new B(z,j)}function J(z,j){let m=new B(z,j);return z.registerConnectedCallback(()=>{m.connect()}),z.registerCleanupCallback(()=>{m.disconnect()}),m}export{J as createResource,I as createHostResource,B as HostResource};
2
+
3
+ //# debugId=BAFAE3A89A400A8364756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/signals/host-resource.ts"],
4
+ "sourcesContent": [
5
+ "import { asyncState, state, type AsyncStateFetcherOptions, type AsyncStateResult } from '@ecopages/signals';\nimport type { RadiantElement } from '../core/radiant-element';\n\nexport type ResourceContext<Host extends RadiantElement> = {\n\thost: Host;\n};\n\nexport type ResourceRequestContext<Host extends RadiantElement> = ResourceContext<Host> & AsyncStateFetcherOptions;\n\ntype HostResourceBaseConfig<Host extends RadiantElement, Value> = {\n\t/** Seed value exposed from `data` before the first successful resolution. */\n\tinitialValue?: Value;\n\n\t/** Milliseconds a successful response stays fresh in the per-instance cache. */\n\tstaleTime?: number;\n\n\t/** Milliseconds to wait before transitioning `status` to `'pending'`. */\n\tpendingDelay?: number;\n\n\t/** Called after each successful resolution, including cache hits. */\n\tonSuccess?: (data: Value, ctx: ResourceContext<Host>) => void;\n\n\t/** Called after each failed resolution. Not called for aborted requests. */\n\tonError?: (error: unknown, ctx: ResourceContext<Host>) => void;\n\n\t/** Called after each resolution, whether successful or failed. */\n\tonSettled?: (data: Value | undefined, error: unknown, ctx: ResourceContext<Host>) => void;\n};\n\n/** Configuration for a host-owned resource that fetches on connect. */\nexport interface HostResourceConfig<Host extends RadiantElement, Value> extends HostResourceBaseConfig<Host, Value> {\n\tfetcher: (ctx: ResourceRequestContext<Host>) => Promise<Value>;\n\tsource?: undefined;\n}\n\n/** Configuration for a host-owned resource driven by a reactive source. */\nexport interface HostResourceSourcedConfig<Host extends RadiantElement, Source, Value> extends HostResourceBaseConfig<\n\tHost,\n\tValue\n> {\n\t/**\n\t * Returns the current source value while the host is connected.\n\t *\n\t * Falsy values (`false`, `null`, `undefined`) disable fetching and preserve\n\t * the current resource state.\n\t */\n\tsource: (ctx: ResourceContext<Host>) => Source | false | null | undefined;\n\n\tfetcher: (sourceValue: Source, ctx: ResourceRequestContext<Host>) => Promise<Value>;\n}\n\nexport class HostResource<Host extends RadiantElement, Value, Source = never> implements AsyncStateResult<Value> {\n\treadonly data: AsyncStateResult<Value>['data'];\n\treadonly status: AsyncStateResult<Value>['status'];\n\treadonly error: AsyncStateResult<Value>['error'];\n\n\tprivate readonly connected = state(false);\n\tprivate readonly resource: AsyncStateResult<Value>;\n\tprivate disposed = false;\n\n\tconstructor(host: Host, config: HostResourceConfig<Host, Value> | HostResourceSourcedConfig<Host, Source, Value>) {\n\t\tconst context: ResourceContext<Host> = { host };\n\t\tconst baseConfig = {\n\t\t\tinitialValue: config.initialValue,\n\t\t\tpendingDelay: config.pendingDelay,\n\t\t\tstaleTime: config.staleTime,\n\t\t\tonError: (error: unknown) => {\n\t\t\t\tconfig.onError?.(error, context);\n\t\t\t},\n\t\t\tonSettled: (data: Value | undefined, error: unknown) => {\n\t\t\t\tconfig.onSettled?.(data, error, context);\n\t\t\t},\n\t\t\tonSuccess: (data: Value) => {\n\t\t\t\tconfig.onSuccess?.(data, context);\n\t\t\t},\n\t\t};\n\n\t\tif (config.source) {\n\t\t\tthis.resource = asyncState({\n\t\t\t\t...baseConfig,\n\t\t\t\tsource: () => {\n\t\t\t\t\tif (this.disposed || !this.connected.get()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn config.source(context);\n\t\t\t\t},\n\t\t\t\tfetcher: (sourceValue, options) => config.fetcher(sourceValue as Source, { ...context, ...options }),\n\t\t\t});\n\t\t} else {\n\t\t\tthis.resource = asyncState({\n\t\t\t\t...baseConfig,\n\t\t\t\tsource: () => {\n\t\t\t\t\tif (this.disposed || !this.connected.get()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\tfetcher: (_connected, options) => config.fetcher({ ...context, ...options }),\n\t\t\t});\n\t\t}\n\n\t\tthis.data = this.resource.data;\n\t\tthis.status = this.resource.status;\n\t\tthis.error = this.resource.error;\n\t}\n\n\tpublic connect(): void {\n\t\tif (this.disposed || this.connected.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connected.set(true);\n\t}\n\n\tpublic disconnect(): void {\n\t\tif (this.disposed || !this.connected.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connected.set(false);\n\t\tthis.resource.abort();\n\t}\n\n\tpublic refetch(): void {\n\t\tif (this.disposed || !this.connected.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resource.refetch();\n\t}\n\n\tpublic abort(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resource.abort();\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.connected.set(false);\n\t\tthis.resource.dispose();\n\t}\n}\n\nexport function createHostResource<Host extends RadiantElement, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value>,\n): HostResource<Host, Value>;\nexport function createHostResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source>;\nexport function createHostResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value> | HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source> {\n\treturn new HostResource<Host, Value, Source>(host, config);\n}\n\n/**\n * Creates a host-owned resource and registers connect/disconnect lifecycle\n * hooks on the provided host.\n */\nexport function createResource<Host extends RadiantElement, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value>,\n): HostResource<Host, Value>;\nexport function createResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source>;\nexport function createResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value> | HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source> {\n\tconst hostResource = new HostResource<Host, Value, Source>(host, config);\n\n\thost.registerConnectedCallback(() => {\n\t\thostResource.connect();\n\t});\n\n\thost.registerCleanupCallback(() => {\n\t\thostResource.disconnect();\n\t});\n\n\treturn hostResource;\n}\n"
6
+ ],
7
+ "mappings": "6BAAA,qBAAS,WAAY,0BAmDd,MAAM,CAAoG,CACvG,KACA,OACA,MAEQ,UAAY,EAAM,EAAK,EACvB,SACT,SAAW,GAEnB,WAAW,CAAC,EAAY,EAA0F,CACjH,IAAM,EAAiC,CAAE,MAAK,EACxC,EAAa,CAClB,aAAc,EAAO,aACrB,aAAc,EAAO,aACrB,UAAW,EAAO,UAClB,QAAS,CAAC,IAAmB,CAC5B,EAAO,UAAU,EAAO,CAAO,GAEhC,UAAW,CAAC,EAAyB,IAAmB,CACvD,EAAO,YAAY,EAAM,EAAO,CAAO,GAExC,UAAW,CAAC,IAAgB,CAC3B,EAAO,YAAY,EAAM,CAAO,EAElC,EAEA,GAAI,EAAO,OACV,KAAK,SAAW,EAAW,IACvB,EACH,OAAQ,IAAM,CACb,GAAI,KAAK,UAAY,CAAC,KAAK,UAAU,IAAI,EACxC,MAAO,GAGR,OAAO,EAAO,OAAO,CAAO,GAE7B,QAAS,CAAC,EAAa,IAAY,EAAO,QAAQ,EAAuB,IAAK,KAAY,CAAQ,CAAC,CACpG,CAAC,EAED,UAAK,SAAW,EAAW,IACvB,EACH,OAAQ,IAAM,CACb,GAAI,KAAK,UAAY,CAAC,KAAK,UAAU,IAAI,EACxC,MAAO,GAGR,MAAO,IAER,QAAS,CAAC,EAAY,IAAY,EAAO,QAAQ,IAAK,KAAY,CAAQ,CAAC,CAC5E,CAAC,EAGF,KAAK,KAAO,KAAK,SAAS,KAC1B,KAAK,OAAS,KAAK,SAAS,OAC5B,KAAK,MAAQ,KAAK,SAAS,MAGrB,OAAO,EAAS,CACtB,GAAI,KAAK,UAAY,KAAK,UAAU,IAAI,EACvC,OAGD,KAAK,UAAU,IAAI,EAAI,EAGjB,UAAU,EAAS,CACzB,GAAI,KAAK,UAAY,CAAC,KAAK,UAAU,IAAI,EACxC,OAGD,KAAK,UAAU,IAAI,EAAK,EACxB,KAAK,SAAS,MAAM,EAGd,OAAO,EAAS,CACtB,GAAI,KAAK,UAAY,CAAC,KAAK,UAAU,IAAI,EACxC,OAGD,KAAK,SAAS,QAAQ,EAGhB,KAAK,EAAS,CACpB,GAAI,KAAK,SACR,OAGD,KAAK,SAAS,MAAM,EAGd,OAAO,EAAS,CACtB,GAAI,KAAK,SACR,OAGD,KAAK,SAAW,GAChB,KAAK,UAAU,IAAI,EAAK,EACxB,KAAK,SAAS,QAAQ,EAExB,CAUO,SAAS,CAA8D,CAC7E,EACA,EACoC,CACpC,OAAO,IAAI,EAAkC,EAAM,CAAM,EAenD,SAAS,CAA0D,CACzE,EACA,EACoC,CACpC,IAAM,EAAe,IAAI,EAAkC,EAAM,CAAM,EAUvE,OARA,EAAK,0BAA0B,IAAM,CACpC,EAAa,QAAQ,EACrB,EAED,EAAK,wBAAwB,IAAM,CAClC,EAAa,WAAW,EACxB,EAEM",
8
+ "debugId": "BAFAE3A89A400A8364756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,45 @@
1
+ import { type JsxRenderable } from '@ecopages/jsx';
2
+ import { type WritableSignal } from '@ecopages/signals';
3
+ import type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';
4
+ import type { RadiantElement } from '../core/radiant-element';
5
+ import type { AttributeTypeConstant } from '../utils/attribute-utils';
6
+ type HostSignalOptions<Value> = {
7
+ host: RadiantElement;
8
+ hydrate?: AttributeTypeConstant;
9
+ hydrationKey?: string;
10
+ initialValue?: Value;
11
+ property: string;
12
+ source?: WritableSignal<Value>;
13
+ };
14
+ export declare function isWritableSignalLike<Value>(value: unknown): value is WritableSignal<Value>;
15
+ /**
16
+ * Host-owned writable signal that bridges signal updates back into Radiant's
17
+ * update callback channel and optional SSR hydration pipeline.
18
+ */
19
+ export declare class HostSignal<Value> implements WritableSignal<Value>, SsrSerializableHydrationBinding {
20
+ private readonly host;
21
+ private readonly hydrate?;
22
+ private readonly hydrationKey?;
23
+ private readonly property;
24
+ private readonly source;
25
+ private currentValue;
26
+ private hasAppliedHostHydration;
27
+ private sourceUnsubscribe?;
28
+ constructor(options: HostSignalOptions<Value>);
29
+ get(): Value;
30
+ set(nextValue: Value): void;
31
+ subscribe(notify: (value: Value) => void): () => void;
32
+ update(updater: (value: Value) => Value): void;
33
+ connectToSource(): void;
34
+ disconnectFromSource(): void;
35
+ hydrateFromHost(): void;
36
+ renderHydrationScript(): JsxRenderable | undefined;
37
+ renderHydrationScriptTag(): string | undefined;
38
+ private findHydrationScriptElement;
39
+ private isObject;
40
+ private resolveInitialValue;
41
+ private serializeHydrationValue;
42
+ private handleSourceChange;
43
+ }
44
+ export declare function createHostSignal<Value>(options: HostSignalOptions<Value>): HostSignal<Value>;
45
+ export {};
@@ -0,0 +1,3 @@
1
+ import{Ea as a,Fa as b,Ga as c}from"../chunk-nnnb6pac.js";import"../chunk-dabagjk6.js";import"../chunk-hpzgnxgq.js";import"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";export{a as isWritableSignalLike,c as createHostSignal,b as HostSignal};
2
+
3
+ //# debugId=8C425FB12C13013F64756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "8C425FB12C13013F64756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,7 @@
1
+ /** Creates the raw `<script type="application/json">` tag used to hydrate a signal field. */
2
+ export declare function createSignalHydrationScriptTag(options: {
3
+ hydrationKey?: string;
4
+ serializedValue: string;
5
+ }): string;
6
+ /** Escapes serialized JSON so it remains safe inside an HTML script tag. */
7
+ export declare function escapeSignalHydrationJson(value: string): string;
@@ -0,0 +1,3 @@
1
+ import{Ha as a,Ia as b}from"../chunk-dabagjk6.js";import"../chunk-hpzgnxgq.js";import"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";export{b as escapeSignalHydrationJson,a as createSignalHydrationScriptTag};
2
+
3
+ //# debugId=5F47A97415912E6864756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "5F47A97415912E6864756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Escapes serialized JSON so it remains safe when embedded inside an HTML
3
+ * `<script>` tag.
4
+ */
5
+ export declare function escapeScriptJson(value: string): string;
@@ -0,0 +1,3 @@
1
+ import{wb as a}from"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";export{a as escapeScriptJson};
2
+
3
+ //# debugId=41664B185705318B64756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "41664B185705318B64756E2164756E21",
8
+ "names": []
9
+ }
@@ -1,4 +1,3 @@
1
- class x{host;eventConfig;constructor(k,q){this.host=k,this.eventConfig=q}emit(k){const q=new CustomEvent(this.eventConfig.name,{detail:k,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(q)}}export{x as EventEmitter};
2
- export{x as U};
1
+ import{yb as a}from"../chunk-wvd1ffe4.js";import"../chunk-vgtggzb6.js";export{a as EventEmitter};
3
2
 
4
- //# debugId=6E8CC678827C651864756E2164756E21
3
+ //# debugId=139B84C5FD630AF664756E2164756E21
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/tools/event-emitter.ts"],
3
+ "sources": [],
4
4
  "sourcesContent": [
5
- "import type { RadiantElement } from '../core/radiant-element';\n\nexport interface EventEmitterConfig {\n name: string;\n bubbles?: boolean;\n cancelable?: boolean;\n composed?: boolean;\n}\n\n/**\n * A generic event emitter class that allows emitting custom events.\n *\n * @template T - The type of the event detail.\n */\nexport class EventEmitter<T = unknown> {\n private host: RadiantElement;\n private eventConfig: EventEmitterConfig;\n\n /**\n * Constructs a new instance of the EventEmitter class.\n *\n * @param host - The host element on which the events will be dispatched.\n * @param eventConfig - The configuration for the event.\n */\n constructor(host: RadiantElement, eventConfig: EventEmitterConfig) {\n this.host = host;\n this.eventConfig = eventConfig;\n }\n\n /**\n * Emits a custom event with the specified detail.\n *\n * @param detail - The detail object to be passed along with the event.\n */\n emit(detail?: T) {\n const event = new CustomEvent(this.eventConfig.name, {\n detail: detail,\n bubbles: this.eventConfig.bubbles,\n cancelable: this.eventConfig.cancelable,\n composed: this.eventConfig.composed,\n });\n this.host.dispatchEvent(event);\n }\n}\n"
6
5
  ],
7
- "mappings": "AAcO,MAAM,CAA0B,CAC7B,KACA,YAQR,WAAW,CAAC,EAAsB,EAAiC,CACjE,KAAK,KAAO,EACZ,KAAK,YAAc,EAQrB,IAAI,CAAC,EAAY,CACf,MAAM,EAAQ,IAAI,YAAY,KAAK,YAAY,KAAM,CACnD,OAAQ,EACR,QAAS,KAAK,YAAY,QAC1B,WAAY,KAAK,YAAY,WAC7B,SAAU,KAAK,YAAY,QAC7B,CAAC,EACD,KAAK,KAAK,cAAc,CAAK,EAEjC",
8
- "debugId": "6E8CC678827C651864756E2164756E21",
6
+ "mappings": "",
7
+ "debugId": "139B84C5FD630AF664756E2164756E21",
9
8
  "names": []
10
9
  }
@@ -1,2 +1,4 @@
1
1
  export * from './stringify-typed';
2
2
  export * from './event-emitter';
3
+ export * from './render-jsx-template';
4
+ export * from './escape-script-json';
@@ -1,3 +1,3 @@
1
- import{c as m}from"./stringify-typed.js";import{U as f}from"./event-emitter.js";export{m as stringifyTyped,f as EventEmitter};
1
+ import{a as x}from"../chunk-jkb2y7c8.js";import{b as a}from"../chunk-cvz9mrxa.js";import{wb as p}from"../chunk-nssj2x13.js";import{yb as t}from"../chunk-wvd1ffe4.js";import"../chunk-vgtggzb6.js";export{a as stringifyTyped,x as renderJsxTemplate,p as escapeScriptJson,t as EventEmitter};
2
2
 
3
- //# debugId=05F38D407380E35D64756E2164756E21
3
+ //# debugId=328891D7088CB96064756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "05F38D407380E35D64756E2164756E21",
7
+ "debugId": "328891D7088CB96064756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -0,0 +1,5 @@
1
+ import { type TemplateResultLike } from '@ecopages/jsx';
2
+ /**
3
+ * Renders a JSX template result into a target element by replacing its children.
4
+ */
5
+ export declare function renderJsxTemplate(template: TemplateResultLike, target: HTMLElement): void;
@@ -0,0 +1,3 @@
1
+ import{a}from"../chunk-jkb2y7c8.js";import"../chunk-vgtggzb6.js";export{a as renderJsxTemplate};
2
+
3
+ //# debugId=33BF6AD35B27EB1564756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "33BF6AD35B27EB1564756E2164756E21",
8
+ "names": []
9
+ }
@@ -7,12 +7,10 @@
7
7
  * @template R - The return type, defaults to T.
8
8
  *
9
9
  * @example
10
- * // For JSON string representation
11
- * <script type="application/json" data-hydration>
12
- * {stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' })}
13
- * </script>
14
- *
15
- * // For maintaining the type
10
+ * // For maintaining the type in JSX attributes
16
11
  * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType
12
+ *
13
+ * // For lower-level JSON string generation outside JSX text children
14
+ * const hydrationPayload = stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' });
17
15
  */
18
16
  export declare function stringifyTyped<T, R = T>(value: T): R extends string ? string : T;
@@ -1,4 +1,3 @@
1
- function t(e){return JSON.stringify(e)}export{t as stringifyTyped};
2
- export{t as c};
1
+ import{b as a}from"../chunk-cvz9mrxa.js";import"../chunk-vgtggzb6.js";export{a as stringifyTyped};
3
2
 
4
- //# debugId=EC5CECAE80ACC8C364756E2164756E21
3
+ //# debugId=3F8DDB103AAD885E64756E2164756E21