@ecopages/radiant 0.1.8 → 0.3.0-alpha.0

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 (442) hide show
  1. package/README.md +289 -34
  2. package/dist/chunk-0y78f8hj.js +4 -0
  3. package/dist/chunk-0y78f8hj.js.map +10 -0
  4. package/dist/chunk-0zq7e1ne.js +4 -0
  5. package/dist/chunk-0zq7e1ne.js.map +10 -0
  6. package/dist/chunk-13ydx769.js +4 -0
  7. package/dist/chunk-13ydx769.js.map +10 -0
  8. package/dist/chunk-147yvtsn.js +4 -0
  9. package/dist/chunk-147yvtsn.js.map +10 -0
  10. package/dist/chunk-17earqbr.js +4 -0
  11. package/dist/chunk-17earqbr.js.map +10 -0
  12. package/dist/chunk-1w1dm68j.js +4 -0
  13. package/dist/chunk-1w1dm68j.js.map +10 -0
  14. package/dist/chunk-2tgrfv09.js +4 -0
  15. package/dist/chunk-2tgrfv09.js.map +10 -0
  16. package/dist/chunk-3b033cgq.js +4 -0
  17. package/dist/chunk-3b033cgq.js.map +10 -0
  18. package/dist/chunk-42tyhfvh.js +4 -0
  19. package/dist/chunk-42tyhfvh.js.map +10 -0
  20. package/dist/chunk-4cc2syf5.js +4 -0
  21. package/dist/chunk-4cc2syf5.js.map +10 -0
  22. package/dist/chunk-4fqkmpra.js +4 -0
  23. package/dist/chunk-4fqkmpra.js.map +10 -0
  24. package/dist/chunk-4srpf0y5.js +4 -0
  25. package/dist/chunk-4srpf0y5.js.map +10 -0
  26. package/dist/chunk-57w3vmme.js +4 -0
  27. package/dist/chunk-57w3vmme.js.map +10 -0
  28. package/dist/chunk-5a2xez36.js +4 -0
  29. package/dist/chunk-5a2xez36.js.map +10 -0
  30. package/dist/chunk-5bym7y1d.js +4 -0
  31. package/dist/chunk-5bym7y1d.js.map +10 -0
  32. package/dist/chunk-5td6v9k3.js +4 -0
  33. package/dist/chunk-5td6v9k3.js.map +10 -0
  34. package/dist/chunk-60015zxq.js +4 -0
  35. package/dist/chunk-60015zxq.js.map +10 -0
  36. package/dist/chunk-60q4y3k5.js +4 -0
  37. package/dist/chunk-60q4y3k5.js.map +10 -0
  38. package/dist/chunk-6kdxrppw.js +4 -0
  39. package/dist/chunk-6kdxrppw.js.map +10 -0
  40. package/dist/chunk-6z34stya.js +4 -0
  41. package/dist/chunk-6z34stya.js.map +10 -0
  42. package/dist/chunk-73x7jpdd.js +4 -0
  43. package/dist/chunk-73x7jpdd.js.map +10 -0
  44. package/dist/chunk-84fc8cz9.js +4 -0
  45. package/dist/chunk-84fc8cz9.js.map +10 -0
  46. package/dist/chunk-8dexhy6c.js +4 -0
  47. package/dist/chunk-8dexhy6c.js.map +10 -0
  48. package/dist/chunk-8n2dhx28.js +4 -0
  49. package/dist/chunk-8n2dhx28.js.map +10 -0
  50. package/dist/chunk-8tvt04cm.js +4 -0
  51. package/dist/chunk-8tvt04cm.js.map +10 -0
  52. package/dist/chunk-8vak8w5w.js +4 -0
  53. package/dist/chunk-8vak8w5w.js.map +10 -0
  54. package/dist/chunk-8xy18qmz.js +4 -0
  55. package/dist/chunk-8xy18qmz.js.map +9 -0
  56. package/dist/chunk-9554n9t4.js +4 -0
  57. package/dist/chunk-9554n9t4.js.map +10 -0
  58. package/dist/chunk-9ascmjk3.js +4 -0
  59. package/dist/chunk-9ascmjk3.js.map +10 -0
  60. package/dist/chunk-9gjmqxp2.js +4 -0
  61. package/dist/chunk-9gjmqxp2.js.map +10 -0
  62. package/dist/chunk-a7hzs37s.js +4 -0
  63. package/dist/chunk-a7hzs37s.js.map +10 -0
  64. package/dist/chunk-aajhkdmn.js +4 -0
  65. package/dist/chunk-aajhkdmn.js.map +10 -0
  66. package/dist/chunk-agjb2a3r.js +4 -0
  67. package/dist/chunk-agjb2a3r.js.map +10 -0
  68. package/dist/chunk-ak97hp4w.js +4 -0
  69. package/dist/chunk-ak97hp4w.js.map +10 -0
  70. package/dist/chunk-bmhn4nbp.js +4 -0
  71. package/dist/chunk-bmhn4nbp.js.map +10 -0
  72. package/dist/chunk-c8vqg7r1.js +4 -0
  73. package/dist/chunk-c8vqg7r1.js.map +10 -0
  74. package/dist/chunk-cbvd18v1.js +4 -0
  75. package/dist/chunk-cbvd18v1.js.map +10 -0
  76. package/dist/chunk-chyn72n9.js +4 -0
  77. package/dist/chunk-chyn72n9.js.map +10 -0
  78. package/dist/chunk-cvz9mrxa.js +4 -0
  79. package/dist/chunk-cvz9mrxa.js.map +10 -0
  80. package/dist/chunk-d0n7njdy.js +4 -0
  81. package/dist/chunk-d0n7njdy.js.map +10 -0
  82. package/dist/chunk-d4v5qpxa.js +4 -0
  83. package/dist/chunk-d4v5qpxa.js.map +10 -0
  84. package/dist/chunk-d7hh3ze6.js +4 -0
  85. package/dist/chunk-d7hh3ze6.js.map +10 -0
  86. package/dist/chunk-d98q3myg.js +4 -0
  87. package/dist/chunk-d98q3myg.js.map +10 -0
  88. package/dist/chunk-dscj0sk9.js +4 -0
  89. package/dist/chunk-dscj0sk9.js.map +10 -0
  90. package/dist/chunk-dx1wqc00.js +4 -0
  91. package/dist/chunk-dx1wqc00.js.map +10 -0
  92. package/dist/chunk-g0gz7ypq.js +4 -0
  93. package/dist/chunk-g0gz7ypq.js.map +10 -0
  94. package/dist/chunk-hkmm3dj9.js +4 -0
  95. package/dist/chunk-hkmm3dj9.js.map +10 -0
  96. package/dist/chunk-hn4j8rt5.js +4 -0
  97. package/dist/chunk-hn4j8rt5.js.map +10 -0
  98. package/dist/chunk-jce9gqqw.js +4 -0
  99. package/dist/chunk-jce9gqqw.js.map +10 -0
  100. package/dist/chunk-jg20mzg8.js +4 -0
  101. package/dist/chunk-jg20mzg8.js.map +10 -0
  102. package/dist/chunk-jkb2y7c8.js +4 -0
  103. package/dist/chunk-jkb2y7c8.js.map +10 -0
  104. package/dist/chunk-k5hr781q.js +4 -0
  105. package/dist/chunk-k5hr781q.js.map +10 -0
  106. package/dist/chunk-ksv01cey.js +4 -0
  107. package/dist/chunk-ksv01cey.js.map +10 -0
  108. package/dist/chunk-mpjnqmbq.js +4 -0
  109. package/dist/chunk-mpjnqmbq.js.map +10 -0
  110. package/dist/chunk-mqxmfvyp.js +4 -0
  111. package/dist/chunk-mqxmfvyp.js.map +10 -0
  112. package/dist/chunk-ms6a9zdt.js +4 -0
  113. package/dist/chunk-ms6a9zdt.js.map +10 -0
  114. package/dist/chunk-nerd6fmg.js +4 -0
  115. package/dist/chunk-nerd6fmg.js.map +10 -0
  116. package/dist/chunk-nw171z6m.js +4 -0
  117. package/dist/chunk-nw171z6m.js.map +10 -0
  118. package/dist/chunk-p6pxdvkk.js +4 -0
  119. package/dist/chunk-p6pxdvkk.js.map +10 -0
  120. package/dist/chunk-paehjz94.js +4 -0
  121. package/dist/chunk-paehjz94.js.map +10 -0
  122. package/dist/chunk-par0t822.js +4 -0
  123. package/dist/chunk-par0t822.js.map +10 -0
  124. package/dist/chunk-qaagk55a.js +4 -0
  125. package/dist/chunk-qaagk55a.js.map +10 -0
  126. package/dist/chunk-qbnedp0y.js +4 -0
  127. package/dist/chunk-qbnedp0y.js.map +10 -0
  128. package/dist/chunk-qd28hvdx.js +4 -0
  129. package/dist/chunk-qd28hvdx.js.map +10 -0
  130. package/dist/chunk-qdj6r8jn.js +4 -0
  131. package/dist/chunk-qdj6r8jn.js.map +10 -0
  132. package/dist/chunk-qe6sjr27.js +4 -0
  133. package/dist/chunk-qe6sjr27.js.map +10 -0
  134. package/dist/chunk-r1cvaz1t.js +4 -0
  135. package/dist/chunk-r1cvaz1t.js.map +10 -0
  136. package/dist/chunk-r75y7ydb.js +4 -0
  137. package/dist/chunk-r75y7ydb.js.map +10 -0
  138. package/dist/chunk-s4qgct1z.js +4 -0
  139. package/dist/chunk-s4qgct1z.js.map +10 -0
  140. package/dist/chunk-scfk041e.js +4 -0
  141. package/dist/chunk-scfk041e.js.map +10 -0
  142. package/dist/chunk-t6x9e177.js +4 -0
  143. package/dist/chunk-t6x9e177.js.map +10 -0
  144. package/dist/chunk-t7a1bbxq.js +4 -0
  145. package/dist/chunk-t7a1bbxq.js.map +10 -0
  146. package/dist/chunk-tyysm4gk.js +4 -0
  147. package/dist/chunk-tyysm4gk.js.map +10 -0
  148. package/dist/chunk-vpfm9yw8.js +4 -0
  149. package/dist/chunk-vpfm9yw8.js.map +10 -0
  150. package/dist/chunk-w50v38rv.js +4 -0
  151. package/dist/chunk-w50v38rv.js.map +10 -0
  152. package/dist/chunk-x0522ksh.js +4 -0
  153. package/dist/chunk-x0522ksh.js.map +10 -0
  154. package/dist/chunk-xd1xn3vy.js +4 -0
  155. package/dist/chunk-xd1xn3vy.js.map +10 -0
  156. package/dist/chunk-zb7wh7w4.js +4 -0
  157. package/dist/chunk-zb7wh7w4.js.map +10 -0
  158. package/dist/chunk-zj9ez73m.js +4 -0
  159. package/dist/chunk-zj9ez73m.js.map +10 -0
  160. package/dist/context/context-consumer-bootstrap.d.ts +41 -0
  161. package/dist/context/context-consumer-bootstrap.js +3 -0
  162. package/dist/context/context-consumer-bootstrap.js.map +9 -0
  163. package/dist/context/context-consumer-runtime.d.ts +34 -0
  164. package/dist/context/context-consumer-runtime.js +3 -0
  165. package/dist/context/context-consumer-runtime.js.map +9 -0
  166. package/dist/context/context-provider.d.ts +50 -2
  167. package/dist/context/context-provider.js +2 -279
  168. package/dist/context/context-provider.js.map +3 -6
  169. package/dist/context/context-ssr-bridge.d.ts +16 -0
  170. package/dist/context/context-ssr-bridge.js +3 -0
  171. package/dist/context/context-ssr-bridge.js.map +9 -0
  172. package/dist/context/create-context.js +2 -6
  173. package/dist/context/create-context.js.map +3 -4
  174. package/dist/context/decorators/consume-context.d.ts +10 -6
  175. package/dist/context/decorators/consume-context.js +2 -64
  176. package/dist/context/decorators/consume-context.js.map +3 -5
  177. package/dist/context/decorators/context-selection-delivery.d.ts +1 -0
  178. package/dist/context/decorators/context-selection-delivery.js +3 -0
  179. package/dist/context/decorators/context-selection-delivery.js.map +9 -0
  180. package/dist/context/decorators/context-selector.d.ts +29 -9
  181. package/dist/context/decorators/context-selector.js +2 -71
  182. package/dist/context/decorators/context-selector.js.map +3 -5
  183. package/dist/context/decorators/legacy/consume-context.d.ts +3 -0
  184. package/dist/context/decorators/legacy/consume-context.js +3 -0
  185. package/dist/context/decorators/legacy/consume-context.js.map +9 -0
  186. package/dist/context/decorators/legacy/context-selector-field.d.ts +8 -0
  187. package/dist/context/decorators/legacy/context-selector-field.js +3 -0
  188. package/dist/context/decorators/legacy/context-selector-field.js.map +9 -0
  189. package/dist/context/decorators/legacy/context-selector.d.ts +4 -0
  190. package/dist/context/decorators/legacy/context-selector.js +3 -0
  191. package/dist/context/decorators/legacy/context-selector.js.map +9 -0
  192. package/dist/context/decorators/legacy/provide-context.d.ts +4 -0
  193. package/dist/context/decorators/legacy/provide-context.js +3 -0
  194. package/dist/context/decorators/legacy/provide-context.js.map +9 -0
  195. package/dist/context/decorators/on-context-update.d.ts +31 -0
  196. package/dist/context/decorators/on-context-update.js +3 -0
  197. package/dist/context/decorators/on-context-update.js.map +9 -0
  198. package/dist/context/decorators/provide-context.d.ts +18 -7
  199. package/dist/context/decorators/provide-context.js +2 -291
  200. package/dist/context/decorators/provide-context.js.map +3 -7
  201. package/dist/context/decorators/standard/consume-context.d.ts +3 -0
  202. package/dist/context/decorators/standard/consume-context.js +3 -0
  203. package/dist/context/decorators/standard/consume-context.js.map +9 -0
  204. package/dist/context/decorators/standard/context-selector-field.d.ts +8 -0
  205. package/dist/context/decorators/standard/context-selector-field.js +3 -0
  206. package/dist/context/decorators/standard/context-selector-field.js.map +9 -0
  207. package/dist/context/decorators/standard/context-selector.d.ts +5 -0
  208. package/dist/context/decorators/standard/context-selector.js +3 -0
  209. package/dist/context/decorators/standard/context-selector.js.map +9 -0
  210. package/dist/context/decorators/standard/provide-context.d.ts +4 -0
  211. package/dist/context/decorators/standard/provide-context.js +3 -0
  212. package/dist/context/decorators/standard/provide-context.js.map +9 -0
  213. package/dist/context/events.d.ts +3 -2
  214. package/dist/context/events.js +2 -53
  215. package/dist/context/events.js.map +3 -4
  216. package/dist/context/hydration-script.d.ts +17 -0
  217. package/dist/context/hydration-script.js +3 -0
  218. package/dist/context/hydration-script.js.map +9 -0
  219. package/dist/core/custom-element-metadata.d.ts +3 -0
  220. package/dist/core/custom-element-metadata.js +3 -0
  221. package/dist/core/custom-element-metadata.js.map +9 -0
  222. package/dist/core/hydration-codec.d.ts +24 -0
  223. package/dist/core/hydration-codec.js +3 -0
  224. package/dist/core/hydration-codec.js.map +9 -0
  225. package/dist/core/radiant-component-ssr.d.ts +29 -0
  226. package/dist/core/radiant-component-ssr.js +3 -0
  227. package/dist/core/radiant-component-ssr.js.map +9 -0
  228. package/dist/core/radiant-component.d.ts +106 -0
  229. package/dist/core/radiant-component.js +3 -0
  230. package/dist/core/radiant-component.js.map +9 -0
  231. package/dist/core/radiant-element.d.ts +283 -23
  232. package/dist/core/radiant-element.js +2 -82
  233. package/dist/core/radiant-element.js.map +3 -4
  234. package/dist/core/reactive-jsx-value.d.ts +10 -0
  235. package/dist/core/reactive-jsx-value.js +3 -0
  236. package/dist/core/reactive-jsx-value.js.map +9 -0
  237. package/dist/core/reactive-prop-metadata.d.ts +7 -0
  238. package/dist/core/reactive-prop-metadata.js +3 -0
  239. package/dist/core/reactive-prop-metadata.js.map +9 -0
  240. package/dist/core/slot-projection.d.ts +34 -0
  241. package/dist/core/slot-projection.js +3 -0
  242. package/dist/core/slot-projection.js.map +9 -0
  243. package/dist/core/ssr-hydration-binding.d.ts +14 -0
  244. package/dist/core/ssr-hydration-binding.js +2 -0
  245. package/dist/core/ssr-hydration-binding.js.map +9 -0
  246. package/dist/core/ssr-preparation.d.ts +18 -0
  247. package/dist/core/ssr-preparation.js +3 -0
  248. package/dist/core/ssr-preparation.js.map +9 -0
  249. package/dist/decorators/bound.d.ts +2 -6
  250. package/dist/decorators/bound.js +2 -23
  251. package/dist/decorators/bound.js.map +3 -4
  252. package/dist/decorators/bridge.d.ts +8 -0
  253. package/dist/decorators/bridge.js +3 -0
  254. package/dist/decorators/bridge.js.map +9 -0
  255. package/dist/decorators/custom-element.d.ts +3 -1
  256. package/dist/decorators/custom-element.js +2 -14
  257. package/dist/decorators/custom-element.js.map +3 -4
  258. package/dist/decorators/debounce.d.ts +6 -1
  259. package/dist/decorators/debounce.js +2 -20
  260. package/dist/decorators/debounce.js.map +3 -4
  261. package/dist/decorators/event.d.ts +3 -2
  262. package/dist/decorators/event.js +2 -46
  263. package/dist/decorators/event.js.map +3 -5
  264. package/dist/decorators/legacy/bound.d.ts +9 -0
  265. package/dist/decorators/legacy/bound.js +3 -0
  266. package/dist/decorators/legacy/bound.js.map +9 -0
  267. package/dist/decorators/legacy/custom-element.d.ts +6 -0
  268. package/dist/decorators/legacy/custom-element.js +3 -0
  269. package/dist/decorators/legacy/custom-element.js.map +9 -0
  270. package/dist/decorators/legacy/debounce.d.ts +1 -0
  271. package/dist/decorators/legacy/debounce.js +3 -0
  272. package/dist/decorators/legacy/debounce.js.map +9 -0
  273. package/dist/decorators/legacy/event.d.ts +9 -0
  274. package/dist/decorators/legacy/event.js +3 -0
  275. package/dist/decorators/legacy/event.js.map +9 -0
  276. package/dist/decorators/legacy/instance-initializers.d.ts +17 -0
  277. package/dist/decorators/legacy/instance-initializers.js +3 -0
  278. package/dist/decorators/legacy/instance-initializers.js.map +9 -0
  279. package/dist/decorators/legacy/on-event.d.ts +17 -0
  280. package/dist/decorators/legacy/on-event.js +3 -0
  281. package/dist/decorators/legacy/on-event.js.map +9 -0
  282. package/dist/decorators/legacy/on-updated.d.ts +6 -0
  283. package/dist/decorators/legacy/on-updated.js +3 -0
  284. package/dist/decorators/legacy/on-updated.js.map +9 -0
  285. package/dist/decorators/legacy/query-slot.d.ts +3 -0
  286. package/dist/decorators/legacy/query-slot.js +3 -0
  287. package/dist/decorators/legacy/query-slot.js.map +9 -0
  288. package/dist/decorators/legacy/query.d.ts +23 -0
  289. package/dist/decorators/legacy/query.js +3 -0
  290. package/dist/decorators/legacy/query.js.map +9 -0
  291. package/dist/decorators/{reactive-field.d.ts → legacy/reactive-field.d.ts} +2 -2
  292. package/dist/decorators/legacy/reactive-field.js +3 -0
  293. package/dist/decorators/legacy/reactive-field.js.map +9 -0
  294. package/dist/decorators/{reactive-prop.d.ts → legacy/reactive-prop.d.ts} +4 -3
  295. package/dist/decorators/legacy/reactive-prop.js +3 -0
  296. package/dist/decorators/legacy/reactive-prop.js.map +9 -0
  297. package/dist/decorators/legacy/signal.d.ts +10 -0
  298. package/dist/decorators/legacy/signal.js +3 -0
  299. package/dist/decorators/legacy/signal.js.map +9 -0
  300. package/dist/decorators/on-event.d.ts +6 -17
  301. package/dist/decorators/on-event.js +2 -47
  302. package/dist/decorators/on-event.js.map +3 -4
  303. package/dist/decorators/on-updated.d.ts +3 -4
  304. package/dist/decorators/on-updated.js +2 -29
  305. package/dist/decorators/on-updated.js.map +3 -4
  306. package/dist/decorators/prop.d.ts +14 -0
  307. package/dist/decorators/prop.js +3 -0
  308. package/dist/decorators/prop.js.map +9 -0
  309. package/dist/decorators/query-slot.d.ts +13 -0
  310. package/dist/decorators/query-slot.js +3 -0
  311. package/dist/decorators/query-slot.js.map +9 -0
  312. package/dist/decorators/query.d.ts +7 -35
  313. package/dist/decorators/query.js +2 -36
  314. package/dist/decorators/query.js.map +3 -4
  315. package/dist/decorators/signal.d.ts +23 -0
  316. package/dist/decorators/signal.js +3 -0
  317. package/dist/decorators/signal.js.map +9 -0
  318. package/dist/decorators/standard/bound.d.ts +2 -0
  319. package/dist/decorators/standard/bound.js +3 -0
  320. package/dist/decorators/standard/bound.js.map +9 -0
  321. package/dist/decorators/standard/custom-element.d.ts +1 -0
  322. package/dist/decorators/standard/custom-element.js +3 -0
  323. package/dist/decorators/standard/custom-element.js.map +9 -0
  324. package/dist/decorators/standard/debounce.d.ts +2 -0
  325. package/dist/decorators/standard/debounce.js +3 -0
  326. package/dist/decorators/standard/debounce.js.map +9 -0
  327. package/dist/decorators/standard/event.d.ts +9 -0
  328. package/dist/decorators/standard/event.js +3 -0
  329. package/dist/decorators/standard/event.js.map +9 -0
  330. package/dist/decorators/standard/on-event.d.ts +17 -0
  331. package/dist/decorators/standard/on-event.js +3 -0
  332. package/dist/decorators/standard/on-event.js.map +9 -0
  333. package/dist/decorators/standard/on-updated.d.ts +2 -0
  334. package/dist/decorators/standard/on-updated.js +3 -0
  335. package/dist/decorators/standard/on-updated.js.map +9 -0
  336. package/dist/decorators/standard/query-slot.d.ts +8 -0
  337. package/dist/decorators/standard/query-slot.js +3 -0
  338. package/dist/decorators/standard/query-slot.js.map +9 -0
  339. package/dist/decorators/standard/query.d.ts +2 -0
  340. package/dist/decorators/standard/query.js +3 -0
  341. package/dist/decorators/standard/query.js.map +9 -0
  342. package/dist/decorators/standard/reactive-field.d.ts +2 -0
  343. package/dist/decorators/standard/reactive-field.js +3 -0
  344. package/dist/decorators/standard/reactive-field.js.map +9 -0
  345. package/dist/decorators/standard/reactive-prop.d.ts +2 -0
  346. package/dist/decorators/standard/reactive-prop.js +3 -0
  347. package/dist/decorators/standard/reactive-prop.js.map +9 -0
  348. package/dist/decorators/standard/signal.d.ts +33 -0
  349. package/dist/decorators/standard/signal.js +3 -0
  350. package/dist/decorators/standard/signal.js.map +9 -0
  351. package/dist/decorators/state.d.ts +11 -0
  352. package/dist/decorators/state.js +3 -0
  353. package/dist/decorators/state.js.map +9 -0
  354. package/dist/helpers/create-event-listener.d.ts +28 -0
  355. package/dist/helpers/create-event-listener.js +3 -0
  356. package/dist/helpers/create-event-listener.js.map +9 -0
  357. package/dist/helpers/create-event.d.ts +9 -0
  358. package/dist/helpers/create-event.js +3 -0
  359. package/dist/helpers/create-event.js.map +9 -0
  360. package/dist/helpers/create-query-slot.d.ts +20 -0
  361. package/dist/helpers/create-query-slot.js +3 -0
  362. package/dist/helpers/create-query-slot.js.map +9 -0
  363. package/dist/helpers/create-query.d.ts +27 -0
  364. package/dist/helpers/create-query.js +3 -0
  365. package/dist/helpers/create-query.js.map +9 -0
  366. package/dist/helpers/debounce.d.ts +39 -0
  367. package/dist/helpers/debounce.js +3 -0
  368. package/dist/helpers/debounce.js.map +9 -0
  369. package/dist/helpers/index.d.ts +5 -0
  370. package/dist/helpers/index.js +3 -0
  371. package/dist/helpers/index.js.map +9 -0
  372. package/dist/index.d.ts +24 -6
  373. package/dist/index.js +2 -716
  374. package/dist/index.js.map +3 -21
  375. package/dist/server/context-ssr.d.ts +27 -0
  376. package/dist/server/context-ssr.js +3 -0
  377. package/dist/server/context-ssr.js.map +9 -0
  378. package/dist/server/install-light-dom-shim.d.ts +1 -0
  379. package/dist/server/install-light-dom-shim.js +3 -0
  380. package/dist/server/install-light-dom-shim.js.map +10 -0
  381. package/dist/server/light-dom-shim.d.ts +53 -0
  382. package/dist/server/light-dom-shim.js +3 -0
  383. package/dist/server/light-dom-shim.js.map +9 -0
  384. package/dist/server/project-root.d.ts +20 -0
  385. package/dist/server/project-root.js +3 -0
  386. package/dist/server/project-root.js.map +11 -0
  387. package/dist/server/render-component.d.ts +195 -0
  388. package/dist/server/render-component.js +3 -0
  389. package/dist/server/render-component.js.map +10 -0
  390. package/dist/signals/host-resource.d.ts +59 -0
  391. package/dist/signals/host-resource.js +3 -0
  392. package/dist/signals/host-resource.js.map +10 -0
  393. package/dist/signals/host-signal.d.ts +45 -0
  394. package/dist/signals/host-signal.js +3 -0
  395. package/dist/signals/host-signal.js.map +9 -0
  396. package/dist/signals/hydration-script.d.ts +11 -0
  397. package/dist/signals/hydration-script.js +3 -0
  398. package/dist/signals/hydration-script.js.map +9 -0
  399. package/dist/tools/escape-script-json.d.ts +5 -0
  400. package/dist/tools/escape-script-json.js +3 -0
  401. package/dist/tools/escape-script-json.js.map +9 -0
  402. package/dist/tools/event-emitter.d.ts +1 -1
  403. package/dist/tools/event-emitter.js +2 -22
  404. package/dist/tools/event-emitter.js.map +3 -4
  405. package/dist/tools/index.d.ts +2 -0
  406. package/dist/tools/index.js +2 -28
  407. package/dist/tools/index.js.map +3 -5
  408. package/dist/tools/render-jsx-template.d.ts +5 -0
  409. package/dist/tools/render-jsx-template.js +3 -0
  410. package/dist/tools/render-jsx-template.js.map +9 -0
  411. package/dist/tools/stringify-typed.d.ts +4 -6
  412. package/dist/tools/stringify-typed.js +2 -8
  413. package/dist/tools/stringify-typed.js.map +3 -4
  414. package/dist/types.d.ts +79 -0
  415. package/dist/types.js +3 -0
  416. package/dist/types.js.map +10 -0
  417. package/dist/utils/attribute-utils.d.ts +2 -0
  418. package/dist/utils/attribute-utils.js +2 -137
  419. package/dist/utils/attribute-utils.js.map +3 -4
  420. package/dist/utils/index.js +2 -137
  421. package/dist/utils/index.js.map +3 -4
  422. package/package.json +108 -44
  423. package/size-budget.json +22 -0
  424. package/dist/context/index.d.ts +0 -7
  425. package/dist/context/index.js +0 -338
  426. package/dist/context/index.js.map +0 -16
  427. package/dist/core/index.d.ts +0 -1
  428. package/dist/core/index.js +0 -83
  429. package/dist/core/index.js.map +0 -10
  430. package/dist/decorators/reactive-field.js +0 -27
  431. package/dist/decorators/reactive-field.js.map +0 -10
  432. package/dist/decorators/reactive-prop.js +0 -215
  433. package/dist/decorators/reactive-prop.js.map +0 -11
  434. package/dist/decorators.d.ts +0 -7
  435. package/dist/decorators.js +0 -401
  436. package/dist/decorators.js.map +0 -18
  437. package/dist/mixins/index.d.ts +0 -1
  438. package/dist/mixins/index.js +0 -24
  439. package/dist/mixins/index.js.map +0 -10
  440. package/dist/mixins/with-kita.d.ts +0 -15
  441. package/dist/mixins/with-kita.js +0 -24
  442. package/dist/mixins/with-kita.js.map +0 -10
@@ -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 { 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';\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\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 StreamableRenderedComponent = 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 renderStreamableComponent<TComponent extends ServerRenderableComponent>(\n\tcomponent: ServerRenderableComponentConstructor<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<StreamableRenderedComponent>;\n\nexport function renderStreamableComponent<TComponent extends ServerRenderableComponent>(\n\toptions: RenderComponentOptions<TComponent>,\n): Promise<StreamableRenderedComponent>;\n\nexport async function renderStreamableComponent<TComponent extends ServerRenderableComponent>(\n\tcomponentOrOptions: ServerRenderableComponentConstructor<TComponent> | RenderComponentOptions<TComponent>,\n\toptions?: RenderComponentCallOptions<TComponent>,\n): Promise<StreamableRenderedComponent> {\n\treturn toStreamableRenderedComponent(\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\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 markup = component.renderHostToString(renderOptions);\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: component.renderHost?.() ?? { nodeType: 1, outerHTML: markup },\n\t\t};\n\t} finally {\n\t\trestoreAmbientContext();\n\t}\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: StreamableRenderedComponent | 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 | StreamableRenderedComponent,\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 | StreamableRenderedComponent,\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 toStreamableRenderedComponent(render: RenderedComponent): StreamableRenderedComponent {\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": "2MASO,DAAM,HAAyC,YAGzC,HAAqC,qBAGrC,EAA0C,0BAG1C,EAAmC,mBA4BzC,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,CAAuE,CAC5F,EACA,EACuC,CACvC,OAAO,EACN,MAAM,EAAwB,EAAgC,EAAoB,CAAO,CAAC,CAC3F,EAGD,eAAe,CAAqE,CACnF,EAC6B,CAC7B,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,EAAS,EAAU,mBAAmB,CAAa,EAEzD,MAAO,CACN,SACA,SAAU,CACT,SACA,gBAAiB,EACjB,cACA,SACD,EACA,QAAS,EAAU,aAAa,GAAK,CAAE,SAAU,EAAG,UAAW,CAAO,CACvE,SACC,CACD,EAAsB,GAIxB,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,CAA6B,CAAC,EAAwD,CAC9F,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": "E62B78C0A966A7EC64756E2164756E21",
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-8xy18qmz.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{qa as a,ra as b,sa as c}from"../chunk-57w3vmme.js";import"../chunk-6z34stya.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{a as isWritableSignalLike,c as createHostSignal,b as HostSignal};
2
+
3
+ //# debugId=2AA2BC54FCAB364764756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "2AA2BC54FCAB364764756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,11 @@
1
+ /** @deprecated Use `HYDRATION_ATTRIBUTE` from `hydration-codec` instead. */
2
+ export declare const SIGNAL_HYDRATION_ATTRIBUTE = "data-hydration";
3
+ /** @deprecated Use `HYDRATION_KEY_ATTRIBUTE` from `hydration-codec` instead. */
4
+ export declare const SIGNAL_HYDRATION_KEY_ATTRIBUTE = "data-hydration-key";
5
+ /** Creates the raw `<script type="application/json">` tag used to hydrate a signal field. */
6
+ export declare function createSignalHydrationScriptTag(options: {
7
+ hydrationKey?: string;
8
+ serializedValue: string;
9
+ }): string;
10
+ /** Escapes serialized JSON so it remains safe inside an HTML script tag. */
11
+ export declare function escapeSignalHydrationJson(value: string): string;
@@ -0,0 +1,3 @@
1
+ import{cb as a,db as b,eb as c,fb as d}from"../chunk-6z34stya.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{d as escapeSignalHydrationJson,c as createSignalHydrationScriptTag,b as SIGNAL_HYDRATION_KEY_ATTRIBUTE,a as SIGNAL_HYDRATION_ATTRIBUTE};
2
+
3
+ //# debugId=DA0DC63B2C1C6FBA64756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "DA0DC63B2C1C6FBA64756E2164756E21",
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{nb as a}from"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{a as escapeScriptJson};
2
+
3
+ //# debugId=4BF5FF15BAECE12164756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "4BF5FF15BAECE12164756E2164756E21",
8
+ "names": []
9
+ }
@@ -1,4 +1,4 @@
1
- import type { RadiantElement } from '..';
1
+ import type { RadiantElement } from '../core/radiant-element';
2
2
  export interface EventEmitterConfig {
3
3
  name: string;
4
4
  bubbles?: boolean;
@@ -1,23 +1,3 @@
1
- // src/tools/event-emitter.ts
2
- class EventEmitter {
3
- host;
4
- eventConfig;
5
- constructor(host, eventConfig) {
6
- this.host = host;
7
- this.eventConfig = eventConfig;
8
- }
9
- emit(detail) {
10
- const event = new CustomEvent(this.eventConfig.name, {
11
- detail,
12
- bubbles: this.eventConfig.bubbles,
13
- cancelable: this.eventConfig.cancelable,
14
- composed: this.eventConfig.composed
15
- });
16
- this.host.dispatchEvent(event);
17
- }
18
- }
19
- export {
20
- EventEmitter
21
- };
1
+ import{pb as a}from"../chunk-qbnedp0y.js";import"../chunk-8xy18qmz.js";export{a as EventEmitter};
22
2
 
23
- //# debugId=B011F9EC3CC948C064756E2164756E21
3
+ //# debugId=B03DE8507783D08B64756E2164756E21
@@ -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 '..';\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,aAA0B;AAAA,EAC7B;AAAA,EACA;AAAA,EAQR,WAAW,CAAC,MAAsB,aAAiC;AACjE,SAAK,OAAO;AACZ,SAAK,cAAc;AAAA;AAAA,EAQrB,IAAI,CAAC,QAAY;AACf,UAAM,QAAQ,IAAI,YAAY,KAAK,YAAY,MAAM;AAAA,MACnD;AAAA,MACA,SAAS,KAAK,YAAY;AAAA,MAC1B,YAAY,KAAK,YAAY;AAAA,MAC7B,UAAU,KAAK,YAAY;AAAA,IAC7B,CAAC;AACD,SAAK,KAAK,cAAc,KAAK;AAAA;AAEjC;",
8
- "debugId": "B011F9EC3CC948C064756E2164756E21",
6
+ "mappings": "",
7
+ "debugId": "B03DE8507783D08B64756E2164756E21",
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,29 +1,3 @@
1
- // src/tools/event-emitter.ts
2
- class EventEmitter {
3
- host;
4
- eventConfig;
5
- constructor(host, eventConfig) {
6
- this.host = host;
7
- this.eventConfig = eventConfig;
8
- }
9
- emit(detail) {
10
- const event = new CustomEvent(this.eventConfig.name, {
11
- detail,
12
- bubbles: this.eventConfig.bubbles,
13
- cancelable: this.eventConfig.cancelable,
14
- composed: this.eventConfig.composed
15
- });
16
- this.host.dispatchEvent(event);
17
- }
18
- }
1
+ import{a as x}from"../chunk-jkb2y7c8.js";import{b as a}from"../chunk-cvz9mrxa.js";import{nb as p}from"../chunk-8n2dhx28.js";import{pb as t}from"../chunk-qbnedp0y.js";import"../chunk-8xy18qmz.js";export{a as stringifyTyped,x as renderJsxTemplate,p as escapeScriptJson,t as EventEmitter};
19
2
 
20
- // src/tools/stringify-typed.ts
21
- function stringifyTyped(value) {
22
- return JSON.stringify(value);
23
- }
24
- export {
25
- stringifyTyped,
26
- EventEmitter
27
- };
28
-
29
- //# debugId=A516128E55704E8064756E2164756E21
3
+ //# debugId=0C1BEF13FC1B648864756E2164756E21
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/tools/event-emitter.ts", "../src/tools/stringify-typed.ts"],
3
+ "sources": [],
4
4
  "sourcesContent": [
5
- "import type { RadiantElement } from '..';\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
- "/**\n * Converts the given value to a JSON string representation or maintains the type based on the generic parameter.\n *\n * @param value - The value to be converted.\n * @returns The JSON string representation of the value or the value itself.\n * @template T - The type of the value.\n * @template R - The return type, defaults to T.\n *\n * @example\n * // For JSON string representation\n * <script type=\"application/json\" data-hydration>\n * {stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' })}\n * </script>\n *\n * // For maintaining the type\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n return JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
7
5
  ],
8
- "mappings": ";AAcO,MAAM,aAA0B;AAAA,EAC7B;AAAA,EACA;AAAA,EAQR,WAAW,CAAC,MAAsB,aAAiC;AACjE,SAAK,OAAO;AACZ,SAAK,cAAc;AAAA;AAAA,EAQrB,IAAI,CAAC,QAAY;AACf,UAAM,QAAQ,IAAI,YAAY,KAAK,YAAY,MAAM;AAAA,MACnD;AAAA,MACA,SAAS,KAAK,YAAY;AAAA,MAC1B,YAAY,KAAK,YAAY;AAAA,MAC7B,UAAU,KAAK,YAAY;AAAA,IAC7B,CAAC;AACD,SAAK,KAAK,cAAc,KAAK;AAAA;AAEjC;;;AC1BO,SAAS,cAAwB,CAAC,OAAyC;AAChF,SAAO,KAAK,UAAU,KAAK;AAAA;",
9
- "debugId": "A516128E55704E8064756E2164756E21",
6
+ "mappings": "",
7
+ "debugId": "0C1BEF13FC1B648864756E2164756E21",
10
8
  "names": []
11
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-8xy18qmz.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,9 +1,3 @@
1
- // src/tools/stringify-typed.ts
2
- function stringifyTyped(value) {
3
- return JSON.stringify(value);
4
- }
5
- export {
6
- stringifyTyped
7
- };
1
+ import{b as a}from"../chunk-cvz9mrxa.js";import"../chunk-8xy18qmz.js";export{a as stringifyTyped};
8
2
 
9
- //# debugId=4776E3D8D4175B4F64756E2164756E21
3
+ //# debugId=3F8DDB103AAD885E64756E2164756E21
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/tools/stringify-typed.ts"],
3
+ "sources": [],
4
4
  "sourcesContent": [
5
- "/**\n * Converts the given value to a JSON string representation or maintains the type based on the generic parameter.\n *\n * @param value - The value to be converted.\n * @returns The JSON string representation of the value or the value itself.\n * @template T - The type of the value.\n * @template R - The return type, defaults to T.\n *\n * @example\n * // For JSON string representation\n * <script type=\"application/json\" data-hydration>\n * {stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' })}\n * </script>\n *\n * // For maintaining the type\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n return JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
6
5
  ],
7
- "mappings": ";AAiBO,SAAS,cAAwB,CAAC,OAAyC;AAChF,SAAO,KAAK,UAAU,KAAK;AAAA;",
8
- "debugId": "4776E3D8D4175B4F64756E2164756E21",
6
+ "mappings": "",
7
+ "debugId": "3F8DDB103AAD885E64756E2164756E21",
9
8
  "names": []
10
9
  }
@@ -0,0 +1,79 @@
1
+ import type { RadiantElement } from './core/radiant-element';
2
+ export type Constructor<T = unknown> = {
3
+ new (...args: any[]): NonNullable<T>;
4
+ };
5
+ export type ConstructorParams<T extends Constructor> = ConstructorParameters<T>;
6
+ export type Context = {
7
+ kind: string;
8
+ name: string | symbol;
9
+ access: {
10
+ get?(): unknown;
11
+ set?(value: unknown): void;
12
+ has?(value: unknown): boolean;
13
+ };
14
+ private?: boolean;
15
+ static?: boolean;
16
+ addInitializer?(initializer: () => void): void;
17
+ };
18
+ export type ClassDecorator = <T extends Constructor>(target: T, context: Context) => T | void;
19
+ export type Method = (...args: any[]) => any;
20
+ /**
21
+ * @deprecated
22
+ */
23
+ export type StanderOrLegacyClassDecorator = {
24
+ (target: Constructor): typeof target | void;
25
+ (target: CustomElementConstructor, context: ClassDecoratorContext): void;
26
+ };
27
+ export type LegacyClassDecoratorArgs = {
28
+ protoOrTarget: CustomElementConstructor;
29
+ nameOrContext: string;
30
+ descriptor: PropertyDescriptor;
31
+ };
32
+ export type StandardClassDecoratorArgs = {
33
+ protoOrTarget: CustomElementConstructor;
34
+ nameOrContext: ClassDecoratorContext;
35
+ };
36
+ export type StandardOrLegacyClassDecoratorArgs = LegacyClassDecoratorArgs | StandardClassDecoratorArgs;
37
+ /**
38
+ * @deprecated
39
+ */
40
+ export type StandardOrLegacMethodDecorator = {
41
+ (proto: Constructor<HTMLElement>): PropertyDescriptor;
42
+ (target: Method, context: ClassMethodDecoratorContext): void;
43
+ };
44
+ export type LegacyMethodDecoratorArgs = {
45
+ protoOrTarget: RadiantElement;
46
+ nameOrContext: string;
47
+ descriptor: PropertyDescriptor;
48
+ };
49
+ export type StandardMethodDecoratorArgs = {
50
+ protoOrTarget: Method;
51
+ nameOrContext: ClassMethodDecoratorContext;
52
+ descriptor: undefined;
53
+ };
54
+ export type StandardOrLegacyMethodDecoratorArgs = LegacyMethodDecoratorArgs | StandardMethodDecoratorArgs;
55
+ /**
56
+ * @deprecated
57
+ */
58
+ export type StandardOrLegacyClassFieldDecorator = {
59
+ (proto: RadiantElement, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
60
+ (target: undefined, context: ClassFieldDecoratorContext): void;
61
+ };
62
+ export type LegacyFieldDecoratorArgs = {
63
+ protoOrTarget: RadiantElement;
64
+ nameOrContext: string;
65
+ descriptor: PropertyDescriptor;
66
+ };
67
+ export type StandardFieldDecoratorArgs<T = unknown, V = unknown> = {
68
+ protoOrTarget: undefined;
69
+ nameOrContext: ClassFieldDecoratorContext<T, V>;
70
+ };
71
+ export type StandardOrLegacyFieldDecoratorArgs = LegacyFieldDecoratorArgs | StandardFieldDecoratorArgs;
72
+ export type CustomElementClass = Omit<typeof HTMLElement, 'new'>;
73
+ export declare const guards: {
74
+ isStandard: {
75
+ ClassDecorator: (args: any) => args is [CustomElementConstructor, ClassDecoratorContext<CustomElementConstructor>];
76
+ MethodDecorator: (args: any) => args is [Method, ClassMethodDecoratorContext];
77
+ FieldDecorator: (args: any) => args is [undefined, ClassFieldDecoratorContext];
78
+ };
79
+ };
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ import"./chunk-8xy18qmz.js";var r={isStandard:{ClassDecorator:function(t){return typeof t[1]<"u"},MethodDecorator:function(t){return typeof t[1]==="object"},FieldDecorator:function(t){return typeof t[1]==="object"}}};export{r as guards};
2
+
3
+ //# debugId=91D7439E7D31B5DD64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/types.ts"],
4
+ "sourcesContent": [
5
+ "import type { RadiantElement } from './core/radiant-element';\n\nexport type Constructor<T = unknown> = { new (...args: any[]): NonNullable<T> };\n\nexport type ConstructorParams<T extends Constructor> = ConstructorParameters<T>;\n\nexport type Context = {\n\tkind: string;\n\tname: string | symbol;\n\taccess: {\n\t\tget?(): unknown;\n\t\tset?(value: unknown): void;\n\t\thas?(value: unknown): boolean;\n\t};\n\tprivate?: boolean;\n\tstatic?: boolean;\n\taddInitializer?(initializer: () => void): void;\n};\n\nexport type ClassDecorator = <T extends Constructor>(target: T, context: Context) => T | void;\n\nexport type Method = (...args: any[]) => any;\n\n/**\n * @deprecated\n */\nexport type StanderOrLegacyClassDecorator = {\n\t(target: Constructor): typeof target | void;\n\t(target: CustomElementConstructor, context: ClassDecoratorContext): void;\n};\n\nexport type LegacyClassDecoratorArgs = {\n\tprotoOrTarget: CustomElementConstructor;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardClassDecoratorArgs = {\n\tprotoOrTarget: CustomElementConstructor;\n\tnameOrContext: ClassDecoratorContext;\n};\n\nexport type StandardOrLegacyClassDecoratorArgs = LegacyClassDecoratorArgs | StandardClassDecoratorArgs;\n\n/**\n * @deprecated\n */\nexport type StandardOrLegacMethodDecorator = {\n\t(proto: Constructor<HTMLElement>): PropertyDescriptor;\n\t(target: Method, context: ClassMethodDecoratorContext): void;\n};\n\nexport type LegacyMethodDecoratorArgs = {\n\tprotoOrTarget: RadiantElement;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardMethodDecoratorArgs = {\n\tprotoOrTarget: Method;\n\tnameOrContext: ClassMethodDecoratorContext;\n\tdescriptor: undefined;\n};\n\nexport type StandardOrLegacyMethodDecoratorArgs = LegacyMethodDecoratorArgs | StandardMethodDecoratorArgs;\n\n/**\n * @deprecated\n */\nexport type StandardOrLegacyClassFieldDecorator = {\n\t(proto: RadiantElement, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;\n\t(target: undefined, context: ClassFieldDecoratorContext): void;\n};\n\nexport type LegacyFieldDecoratorArgs = {\n\tprotoOrTarget: RadiantElement;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardFieldDecoratorArgs<T = unknown, V = unknown> = {\n\tprotoOrTarget: undefined;\n\tnameOrContext: ClassFieldDecoratorContext<T, V>;\n};\n\nexport type StandardOrLegacyFieldDecoratorArgs = LegacyFieldDecoratorArgs | StandardFieldDecoratorArgs;\n\nexport type CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport const guards = {\n\tisStandard: {\n\t\tClassDecorator: function (\n\t\t\targs: any,\n\t\t): args is [CustomElementConstructor, ClassDecoratorContext<CustomElementConstructor>] {\n\t\t\treturn typeof args[1] !== 'undefined';\n\t\t},\n\t\tMethodDecorator: function (args: any): args is [Method, ClassMethodDecoratorContext] {\n\t\t\treturn typeof args[1] === 'object';\n\t\t},\n\t\tFieldDecorator: function (args: any): args is [undefined, ClassFieldDecoratorContext] {\n\t\t\treturn typeof args[1] === 'object';\n\t\t},\n\t},\n};\n"
6
+ ],
7
+ "mappings": "4BAyFO,IAAM,EAAS,CACrB,WAAY,CACX,eAAgB,QAAS,CACxB,EACsF,CACtF,OAAO,OAAO,EAAK,GAAO,KAE3B,gBAAiB,QAAS,CAAC,EAA0D,CACpF,OAAO,OAAO,EAAK,KAAO,UAE3B,eAAgB,QAAS,CAAC,EAA4D,CACrF,OAAO,OAAO,EAAK,KAAO,SAE5B,CACD",
8
+ "debugId": "91D7439E7D31B5DD64756E2164756E21",
9
+ "names": []
10
+ }
@@ -1,3 +1,4 @@
1
+ import type { RadiantElement } from '../core/radiant-element';
1
2
  export type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;
2
3
  export type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;
3
4
  /**
@@ -41,3 +42,4 @@ export type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>
41
42
  export declare function writeAttributeValue(value: unknown, type: AttributeTypeConstant): string;
42
43
  export type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;
43
44
  export declare function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean;
45
+ export declare const getInitialValue: (target: RadiantElement, type: AttributeTypeConstant, attributeKey: string, defaultValue: unknown) => unknown;