@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,29 @@
1
+ import type { JsxRenderable } from '@ecopages/jsx';
2
+ import type { RenderToStringOptions } from '@ecopages/jsx/server';
3
+ import type { SsrSerializableContextProvider } from '../context/context-provider';
4
+ import type { ReactiveProperty } from './radiant-element';
5
+ import type { ReactivePropDefinition } from './reactive-prop-metadata';
6
+ import type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';
7
+ type RadiantComponentSsrHost = {
8
+ constructor: CustomElementConstructor;
9
+ getAuthoredHydrationScriptMarkup?: () => string | undefined;
10
+ getContextProviders: () => SsrSerializableContextProvider[];
11
+ getHydrationBindings: () => SsrSerializableHydrationBinding[];
12
+ getSlotProjectionScriptTag?: () => string | undefined;
13
+ renderToString: (options?: RenderToStringOptions) => string;
14
+ getReactiveProperties: () => ReactiveProperty[];
15
+ getReactivePropDefinitions: () => ReactivePropDefinition[];
16
+ getPropertyValue: (name: string) => unknown;
17
+ listAttributeNames: () => string[];
18
+ getAttributeValue: (name: string) => string | null;
19
+ };
20
+ export declare class RadiantComponentSsrService {
21
+ private readonly host;
22
+ constructor(host: RadiantComponentSsrHost);
23
+ renderHost(): JsxRenderable;
24
+ renderHostToString(options?: RenderToStringOptions, attributes?: Record<string, string>): string;
25
+ private renderHostContent;
26
+ getHostAttributes(): Record<string, string>;
27
+ private getTagName;
28
+ }
29
+ export {};
@@ -0,0 +1,3 @@
1
+ import{X as a}from"../chunk-9554n9t4.js";import"../chunk-73x7jpdd.js";import"../chunk-ms6a9zdt.js";import"../chunk-dx1wqc00.js";import"../chunk-4cc2syf5.js";import"../chunk-8xy18qmz.js";export{a as RadiantComponentSsrService};
2
+
3
+ //# debugId=96387B8B5ABCCFB864756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "96387B8B5ABCCFB864756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,106 @@
1
+ import { type JsxRenderable } from '@ecopages/jsx';
2
+ import { type RenderToStringOptions } from '@ecopages/jsx/server';
3
+ import { RadiantElement } from './radiant-element';
4
+ /**
5
+ * A structured JSX-first Radiant base class.
6
+ * @typeParam Bindings - Explicit internal bindable shape. Include only the
7
+ * prop/state keys that JSX bindings should accept.
8
+ *
9
+ * Treat this as the component's internal reactive/bindable surface, not as the
10
+ * default public custom-element attribute contract. When a component exposes a
11
+ * narrower external API than its internal state, declare a separate public
12
+ * props type for the JSX intrinsic element and keep internal-only state out of
13
+ * that contract.
14
+ *
15
+ * Reusing the same type for both is fine only when the public props and the
16
+ * bindable reactive members are intentionally the same surface.
17
+ *
18
+ * - `render()` describes the view.
19
+ * - `update()` commits the current view into the host.
20
+ * - first render happens automatically on connect.
21
+ * - plain `@prop`, `@state`, and `@signal` reads performed during `render()`
22
+ * participate in tracked rerender invalidation.
23
+ * - `update()` and `requestUpdate()` remain available when a rerender should be
24
+ * scheduled from imperative work outside those tracked reads.
25
+ */
26
+ export declare class RadiantComponent<Bindings extends object = {}> extends RadiantElement<Bindings> {
27
+ private isRendering;
28
+ private isFirstConnectPending;
29
+ private isRenderScheduled;
30
+ private needsRender;
31
+ private projectedSlotContent;
32
+ private renderSignal?;
33
+ private readonly renderWatcher;
34
+ private slotProjectionObserver?;
35
+ private slotProjectionVersion;
36
+ private readonly ssr;
37
+ connectedCallback(): void;
38
+ /**
39
+ * Returns the current component view.
40
+ *
41
+ * The base implementation behaves like `<slot />`, so authored host children
42
+ * pass through unchanged when a subclass does not override `render()`.
43
+ */
44
+ render(): JsxRenderable;
45
+ /**
46
+ * Serializes the current component view into HTML.
47
+ */
48
+ renderToString(options?: RenderToStringOptions): string;
49
+ /**
50
+ * Returns the component host and current view as a JSX element.
51
+ */
52
+ renderHost(): JsxRenderable;
53
+ /**
54
+ * Serializes the component host and current view into HTML.
55
+ */
56
+ renderHostToString(options?: RenderToStringOptions): string;
57
+ /**
58
+ * Hydrates an SSR-rendered component view in place.
59
+ */
60
+ hydrate(): void;
61
+ /**
62
+ * Queues a component rerender and coalesces repeated requests into the same
63
+ * microtask.
64
+ *
65
+ * Use this when reactive state may change multiple times in the same turn and
66
+ * the current view should refresh once with the final values.
67
+ */
68
+ requestUpdate(): void;
69
+ /**
70
+ * Explicitly rerenders the component into its host.
71
+ */
72
+ update(): void;
73
+ disconnectedCallback(): void;
74
+ /**
75
+ * Returns the first projected element assigned to the default or named slot.
76
+ *
77
+ * Use this when component logic needs direct access to authored light-DOM
78
+ * content after projection.
79
+ *
80
+ * @param name Optional slot name. Omit for the default slot.
81
+ */
82
+ getSlotElement<T extends Element = Element>(name?: string): T | null;
83
+ /**
84
+ * Returns all projected elements assigned to the default or named slot.
85
+ *
86
+ * Text nodes are intentionally excluded so the result matches the element-
87
+ * oriented query semantics used by Radiant decorators.
88
+ *
89
+ * @param name Optional slot name. Omit for the default slot.
90
+ */
91
+ getSlotElements<T extends Element = Element>(name?: string): T[];
92
+ protected shouldAutoBindReactiveMembers(): boolean;
93
+ protected getHostSsrAttributes(): Record<string, string>;
94
+ private ensureSlotProjectionState;
95
+ private getHostChildNodeCount;
96
+ private getSlotProjectionScriptTag;
97
+ private getAuthoredHydrationScriptMarkup;
98
+ private handleSlotProjectionMutations;
99
+ private addProjectedSlotNode;
100
+ private removeProjectedSlotNode;
101
+ private observeSlotProjection;
102
+ private disconnectSlotProjectionObserver;
103
+ private disconnectRenderWatcher;
104
+ private resolveTrackedRenderOutput;
105
+ private resolveRenderOutput;
106
+ }
@@ -0,0 +1,3 @@
1
+ import{G as a}from"../chunk-17earqbr.js";import"../chunk-84fc8cz9.js";import"../chunk-9ascmjk3.js";import"../chunk-9554n9t4.js";import"../chunk-9gjmqxp2.js";import"../chunk-8dexhy6c.js";import"../chunk-8tvt04cm.js";import"../chunk-73x7jpdd.js";import"../chunk-ms6a9zdt.js";import"../chunk-dx1wqc00.js";import"../chunk-4cc2syf5.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{a as RadiantComponent};
2
+
3
+ //# debugId=591CEE5AF32145BA64756E2164756E21
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "591CEE5AF32145BA64756E2164756E21",
8
+ "names": []
9
+ }
@@ -1,5 +1,14 @@
1
+ import type { EventEmitter } from '../tools';
2
+ import { type JsxRenderable, type SubscribableJsxValue } from '@ecopages/jsx';
3
+ import type { SsrSerializableContextProvider } from '../context/context-provider';
1
4
  import type { UnknownContext } from '../context/types';
2
- import type { AttributeTypeConstant, ReadAttributeValueReturnType, WriteAttributeValueReturnType } from '../utils';
5
+ import type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';
6
+ import { type AttributeTypeConstant, type ReadAttributeValueReturnType, type WriteAttributeValueReturnType } from '../utils/attribute-utils';
7
+ declare const RadiantElementBase: {
8
+ new (): HTMLElement;
9
+ prototype: HTMLElement;
10
+ };
11
+ type ReactiveDependencyReader = () => unknown;
3
12
  /**
4
13
  * Possible positions to insert a rendered template.
5
14
  */
@@ -11,91 +20,342 @@ export type RadiantElementEventListener = {
11
20
  selector: string;
12
21
  type: string;
13
22
  listener: EventListener;
14
- id: string;
15
23
  options?: AddEventListenerOptions;
16
24
  };
17
25
  /**
18
26
  * Represents a property metadata object.
19
27
  */
20
- export interface PropertyConfig {
28
+ export interface ReactiveProperty<T = unknown> {
21
29
  type: AttributeTypeConstant;
22
- propertyName: string;
23
- attributeKey: string;
30
+ value?: T;
31
+ initialValue?: T;
32
+ name: string;
33
+ attribute: string;
24
34
  converter: {
25
35
  fromAttribute: (value: string) => ReadAttributeValueReturnType;
26
36
  toAttribute: (value: any) => WriteAttributeValueReturnType;
27
37
  };
28
38
  }
39
+ /**
40
+ * Represents the options for a reactive property.
41
+ */
42
+ export type ReactivePropertyOptions<T> = {
43
+ type: AttributeTypeConstant;
44
+ reflect?: boolean;
45
+ attribute?: string;
46
+ defaultValue?: T;
47
+ /**
48
+ * Exposes a JSX binding companion for the reactive property.
49
+ *
50
+ * - `true` creates a `$propertyName` accessor.
51
+ * - a string creates a custom accessor with that name.
52
+ * - `undefined` defers to the host default.
53
+ *
54
+ * The generated accessor returns a subscribable JSX child value so JSX can
55
+ * patch only the affected child part when the property changes.
56
+ */
57
+ bind?: boolean | string;
58
+ };
59
+ export type ReactiveBindingOption = boolean | string;
60
+ export type ReactiveFieldOptions = {
61
+ /**
62
+ * Exposes a JSX binding companion for the reactive field.
63
+ *
64
+ * - `true` creates a `$fieldName` accessor.
65
+ * - a string creates a custom accessor with that name.
66
+ * - `undefined` defers to the host default.
67
+ */
68
+ bind?: ReactiveBindingOption;
69
+ };
70
+ export type ReactiveField<T = unknown> = {
71
+ name: string;
72
+ value: T;
73
+ initialValue: T;
74
+ };
75
+ type StringPropertyKey<Value> = Extract<keyof Value, string>;
76
+ /**
77
+ * Value type produced by a JSX binding for a selected reactive member.
78
+ *
79
+ * Bindings preserve the original property type when it is already renderable by
80
+ * the Ecopages JSX runtime. For non-renderable values, the binding falls back
81
+ * to the broader `JsxRenderable` contract consumed by the renderer.
82
+ */
83
+ export type ReactiveBindingValue<Host extends object, Property extends StringPropertyKey<Host>> = Host[Property] extends JsxRenderable ? Host[Property] : JsxRenderable;
84
+ /**
85
+ * Namespace of cached JSX bindings keyed by the explicit bindable shape.
86
+ *
87
+ * Radiant exposes this namespace twice on every host:
88
+ *
89
+ * - `host.bindings.key` for the explicit form
90
+ * - `host.$.key` for the short form
91
+ *
92
+ * Both aliases resolve through the same cached binding objects as
93
+ * `host.bind('key')`.
94
+ */
95
+ export type ReactiveBindings<Bindings extends object> = {
96
+ readonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
97
+ };
29
98
  /**
30
99
  * Represents an interface for a Radiant element.
100
+ * @typeParam Bindings - Explicit internal bindable shape used to type `bind()` and `getReactiveBinding()`.
101
+ *
102
+ * This shape describes which reactive members are exposed through `bindings`,
103
+ * `$`, and `bind(...)`. It does not automatically define the public JSX
104
+ * attribute contract for the custom element.
31
105
  */
32
- export interface IRadiantElement {
106
+ export interface IRadiantElement<Bindings extends object = {}> {
107
+ /**
108
+ * Namespace of cached JSX bindings keyed by the explicit bindable shape.
109
+ */
110
+ readonly bindings: ReactiveBindings<Bindings>;
111
+ /**
112
+ * Short alias for {@link bindings}.
113
+ */
114
+ readonly $: ReactiveBindings<Bindings>;
33
115
  /**
34
116
  * Called when a property of the element is updated.
35
117
  * @param changedProperty - The name of the changed property.
36
118
  * @param oldValue - The old value of the property.
37
119
  * @param newValue - The new value of the property.
38
120
  */
39
- updated(changedProperty: string, oldValue: unknown, newValue: unknown): void;
121
+ notifyUpdate(changedProperty: string, oldValue: unknown, newValue: unknown): void;
40
122
  /**
41
123
  * Subscribes to a Radiant element event.
42
124
  * @param event - The event listener to subscribe to.
43
125
  */
44
126
  subscribeEvent(event: RadiantElementEventListener): void;
127
+ /**
128
+ * Registers a callback to be invoked when a reactive property or field changes.
129
+ *
130
+ * @returns A cleanup function that unregisters the callback.
131
+ */
132
+ registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void;
133
+ /**
134
+ * Returns a subscribable JSX child binding for a reactive property or field.
135
+ *
136
+ * Prefer `this.bindings.key` or `this.$.key` in JSX render code when you want
137
+ * property access syntax without string literals.
138
+ */
139
+ bind<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
140
+ /**
141
+ * Returns a subscribable JSX child binding for a reactive property or field.
142
+ *
143
+ * This is the primitive lookup used by `bind()`, `bindings.key`, and `$.key`.
144
+ */
145
+ getReactiveBinding<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
146
+ /**
147
+ * Defines a stable JSX binding companion accessor for a reactive member.
148
+ *
149
+ * Companion bindings create properties such as `$count` directly on the host.
150
+ * Prefer the `bindings` or `$` namespace for new code when you want typed,
151
+ * explicit access to the configured bindable shape.
152
+ */
153
+ defineReactiveBinding(property: string, bind?: ReactiveBindingOption): void;
45
154
  /**
46
155
  * Subscribes to multiple Radiant element events.
47
156
  * @param events - The array of event listeners to subscribe to.
48
157
  */
49
158
  subscribeEvents(events: RadiantElementEventListener[]): void;
50
159
  /**
51
- * Unsubscribes from a Radiant element event.
52
- * @param id - The ID of the event listener to unsubscribe from.
160
+ * It adds a callback to be executed when the Radiant element is disconnected from the DOM.
161
+ */
162
+ registerCleanupCallback(callback: () => void): void;
163
+ /**
164
+ * Registers a callback to run on each future host connection.
165
+ *
166
+ * The callback is only invoked from `connectedCallback()`. Registering it
167
+ * after the host is already connected does not invoke it immediately.
168
+ */
169
+ registerConnectedCallback(callback: () => void): void;
170
+ /**
171
+ * Registers a raw value reader for a reactive member so that tracked render
172
+ * dependencies can read the underlying value without triggering the public
173
+ * getter's dependency tracking.
53
174
  */
54
- unsubscribeEvent(id: string): void;
175
+ registerReactiveDependencyReader(property: string, read: () => unknown): void;
55
176
  /**
56
- * Removes all subscribed events from the Radiant element.
177
+ * Records a tracked read of a reactive member during a component render,
178
+ * allowing the signals runtime to re-render only the affected parts.
57
179
  */
58
- removeAllSubscribedEvents(): void;
180
+ trackReactiveRead(property: string): void;
59
181
  /**
60
- * Renders a template into the specified target element.
182
+ * Renders a trusted HTML template string into the specified target element.
183
+ *
184
+ * **Security:** The `template` string is written to the DOM via `innerHTML`
185
+ * or `insertAdjacentHTML` without built-in sanitization. Callers are
186
+ * responsible for ensuring the input is trusted. Supply a `sanitize`
187
+ * function to transform the template before insertion.
188
+ *
61
189
  * @param options - The rendering options.
62
190
  * @param options.target - The target element to render the template into.
63
191
  * @param options.template - The template string to render.
64
192
  * @param options.insert - The position to insert the rendered template. (optional)
193
+ * @param options.sanitize - An optional function that transforms the template string before insertion.
65
194
  */
66
195
  renderTemplate(options: {
67
196
  target: HTMLElement;
68
197
  template: string;
69
198
  insert?: RenderInsertPosition;
199
+ sanitize?: (html: string) => string;
70
200
  }): void;
71
201
  /**
72
202
  * Called when the Radiant element is connected to a context.
73
203
  * @param context - The connected context.
74
204
  */
75
205
  connectedContextCallback(context: UnknownContext): void;
206
+ /**
207
+ * Gets a reference to a child element by its data-ref attribute.
208
+ * @param ref - The data-ref attribute value of the element to get.
209
+ * @param all - Whether to get all elements with the specified data-ref attribute value.
210
+ * @returns The element with the specified data-ref attribute value, an array of elements or null if no element was found.
211
+ */
212
+ getRef<T extends Element = Element>(ref: string, all: true): T[];
213
+ getRef<T extends Element = Element>(ref: string, all?: false): T | null;
76
214
  }
77
215
  /**
78
216
  * A base class for creating custom elements with reactive properties and event subscriptions.
217
+ * @typeParam Bindings - Explicit internal bindable shape. Include only the
218
+ * prop/state keys that JSX bindings should accept.
219
+ *
220
+ * Prefer a separate public props type for custom-element JSX declarations when
221
+ * the external attribute contract differs from the component's internal
222
+ * reactive state. Reuse the same type only when the public props and bindable
223
+ * members are intentionally identical.
79
224
  * @extends HTMLElement
80
- * @implements IRadiantElement
225
+ * @implements IRadiantElement<Bindings>
81
226
  */
82
- export declare class RadiantElement extends HTMLElement implements IRadiantElement {
83
- propertyConfigMap: Map<string, PropertyConfig>;
84
- updatesRegistry: Map<string, Set<string>>;
227
+ export declare class RadiantElement<Bindings extends object = {}> extends RadiantElementBase implements IRadiantElement<Bindings> {
228
+ readonly bindings: ReactiveBindings<Bindings>;
229
+ readonly $: ReactiveBindings<Bindings>;
230
+ /**
231
+ * A map of property metadata objects, it contains useful information about the properties configured via decorators.
232
+ */
233
+ private reactiveProperties;
234
+ /**
235
+ * A map of reactive fields, it contains the reactive fields configured via decorators.
236
+ */
237
+ private reactiveFields;
238
+ /**
239
+ * Stable dependency nodes used when plain reactive member reads participate
240
+ * in tracked component renders.
241
+ */
242
+ private reactiveDependencies;
243
+ /**
244
+ * Raw value readers for reactive members whose public getter should also
245
+ * register tracked render dependencies.
246
+ */
247
+ private reactiveDependencyReaders;
248
+ /**
249
+ * Stable subscribable JSX bindings keyed by reactive property name.
250
+ */
251
+ private reactiveBindings;
252
+ /**
253
+ * Registered context providers keyed by decorated property name.
254
+ */
255
+ private contextProviders;
256
+ /**
257
+ * Registered keyed hydration payload producers appended to SSR host output.
258
+ */
259
+ private hydrationBindings;
260
+ /**
261
+ * A map of property update callbacks. These callbacks are called when a property is updated.
262
+ */
263
+ private updateCallbacks;
264
+ /**
265
+ * A map of event subscriptions used to manage event listeners on the Radiant element.
266
+ */
85
267
  private eventSubscriptions;
268
+ /**
269
+ * A map for event emitters
270
+ */
271
+ private eventEmitters;
272
+ /**
273
+ * Callbacks executed whenever the Radiant element is connected to the DOM.
274
+ */
275
+ private onConnectedCallbacks;
276
+ /**
277
+ * An array of cleanup callbacks to be executed when the Radiant element is disconnected from the DOM.
278
+ */
279
+ private onDisconnectedCallback;
280
+ /**
281
+ * A flag indicating whether the element has been connected to the DOM.
282
+ */
86
283
  private elementReady;
284
+ constructor();
285
+ private createReactiveBindingNamespace;
87
286
  connectedCallback(): void;
88
287
  connectedContextCallback(_contextName: UnknownContext): void;
89
288
  disconnectedCallback(): void;
90
- updated(changedProperty: string, oldValue: unknown, value: unknown): void;
289
+ notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown): void;
290
+ private transformAttributeValue;
91
291
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
92
- renderTemplate({ target, template, insert, }: {
292
+ /**
293
+ * Renders a trusted HTML template string into the specified target element.
294
+ *
295
+ * **Security:** The `template` string is written to the DOM via `innerHTML`
296
+ * or `insertAdjacentHTML` without built-in sanitization. Callers are
297
+ * responsible for ensuring the input is trusted. Supply a `sanitize`
298
+ * function to transform the template before insertion.
299
+ */
300
+ renderTemplate({ target, template, insert, sanitize, }: {
93
301
  target: HTMLElement;
94
302
  template: string;
95
303
  insert?: RenderInsertPosition;
304
+ sanitize?: (html: string) => string;
96
305
  }): void;
97
- subscribeEvents(events: RadiantElementEventListener[]): void;
98
- subscribeEvent(eventConfig: RadiantElementEventListener): void;
99
- unsubscribeEvent(id: string): void;
100
- removeAllSubscribedEvents(): void;
306
+ registerReactiveProperty(config: ReactiveProperty): void;
307
+ protected getReactiveProperties(): ReactiveProperty[];
308
+ registerReactiveField<T>(config: ReactiveField<T>): void;
309
+ registerReactiveDependencyReader(property: string, read: ReactiveDependencyReader): void;
310
+ registerContextProvider(name: string, provider: SsrSerializableContextProvider): void;
311
+ registerHydrationBinding(name: string, binding: SsrSerializableHydrationBinding): void;
312
+ protected getContextProviders(): SsrSerializableContextProvider[];
313
+ protected getHydrationBindings(): SsrSerializableHydrationBinding[];
314
+ /**
315
+ * Flushes any deferred SSR-only preparation work before the host is
316
+ * serialized.
317
+ *
318
+ * Radiant uses this to reapply SSR consumer state after construction so the
319
+ * first server render sees finalized fields, props, and authored content.
320
+ */
321
+ protected prepareForSsr(): void;
322
+ /**
323
+ * Returns the default JSX binding policy for reactive members on this host.
324
+ *
325
+ * Plain `RadiantElement` instances keep binding opt-in. JSX-first hosts such
326
+ * as `RadiantComponent` override this hook to opt into automatic bindings for
327
+ * `@prop`, `@state`, and direct `createReactiveProp`/`createReactiveField`
328
+ * calls when no explicit `bind` option is supplied.
329
+ */
330
+ protected shouldAutoBindReactiveMembers(): boolean;
331
+ registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void;
332
+ getReactiveBinding<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
333
+ bind<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
334
+ defineReactiveBinding(property: string, bind?: ReactiveBindingOption): void;
335
+ private getReactiveDependency;
336
+ trackReactiveRead(property: string): void;
337
+ private readReactiveDependencyValue;
338
+ private readReactiveBindingValue;
339
+ subscribeEvents(events: RadiantElementEventListener[]): Array<() => void>;
340
+ subscribeEvent(eventConfig: RadiantElementEventListener): () => void;
341
+ private unsubscribeEvent;
342
+ private removeAllSubscribedEvents;
343
+ /**
344
+ * Registers a callback that runs on every future disconnect.
345
+ */
346
+ registerCleanupCallback(callback: () => void): void;
347
+ /**
348
+ * Registers a callback that runs from `connectedCallback()` on future host
349
+ * connections.
350
+ *
351
+ * Registering after the host is already connected does not invoke the
352
+ * callback immediately.
353
+ */
354
+ registerConnectedCallback(callback: () => void): void;
355
+ registerEventEmitter(name: string, emitter: EventEmitter): void;
356
+ getRef<T extends Element = Element>(ref: string, all: true): T[];
357
+ getRef<T extends Element = Element>(ref: string, all?: false): T | null;
358
+ createReactiveField<T>(propertyName: string, initialValue: T, options?: ReactiveFieldOptions): void;
359
+ createReactiveProp<T = unknown>(propertyName: string, options: ReactivePropertyOptions<T>): void;
101
360
  }
361
+ export {};
@@ -1,83 +1,3 @@
1
- // src/core/radiant-element.ts
2
- class RadiantElement extends HTMLElement {
3
- eventSubscriptions = new Map;
4
- elementReady = false;
5
- connectedCallback() {
6
- this.elementReady = true;
7
- }
8
- connectedContextCallback(_contextName) {
9
- }
10
- disconnectedCallback() {
11
- this.removeAllSubscribedEvents();
12
- }
13
- updated(changedProperty, oldValue, value) {
14
- if (!this.elementReady || !this.updatesRegistry || oldValue === value)
15
- return;
16
- const updates = this.updatesRegistry.get(changedProperty);
17
- if (updates) {
18
- for (const update of updates) {
19
- this[update]();
20
- }
21
- }
22
- }
23
- attributeChangedCallback(name, oldValue, newValue) {
24
- if (oldValue === newValue || !this.elementReady)
25
- return;
26
- if (name in this) {
27
- const config = this.propertyConfigMap.get(name);
28
- const transformedValue = newValue ? config?.converter.fromAttribute(newValue) : newValue;
29
- const transformedOldValue = oldValue ? config?.converter.fromAttribute(oldValue) : oldValue;
30
- this[name] = transformedValue;
31
- this.updated(name, transformedOldValue, transformedValue);
32
- }
33
- }
34
- renderTemplate({
35
- target = this,
36
- template,
37
- insert = "replace"
38
- }) {
39
- switch (insert) {
40
- case "replace":
41
- target.innerHTML = template;
42
- break;
43
- case "beforeend":
44
- target.insertAdjacentHTML("beforeend", template);
45
- break;
46
- case "afterbegin":
47
- target.insertAdjacentHTML("afterbegin", template);
48
- break;
49
- }
50
- }
51
- subscribeEvents(events) {
52
- for (const event of events) {
53
- this.subscribeEvent(event);
54
- }
55
- }
56
- subscribeEvent(eventConfig) {
57
- const delegatedListener = (delegatedEvent) => {
58
- if (delegatedEvent.target && delegatedEvent.target.matches(eventConfig.selector)) {
59
- eventConfig.listener.call(this, delegatedEvent);
60
- }
61
- };
62
- this.addEventListener(eventConfig.type, delegatedListener, eventConfig.options);
63
- this.eventSubscriptions.set(eventConfig.id, { ...eventConfig, listener: delegatedListener });
64
- }
65
- unsubscribeEvent(id) {
66
- const eventSubscription = this.eventSubscriptions.get(id);
67
- if (eventSubscription) {
68
- this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);
69
- this.eventSubscriptions.delete(id);
70
- }
71
- }
72
- removeAllSubscribedEvents() {
73
- for (const eventSubscription of this.eventSubscriptions.values()) {
74
- this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);
75
- }
76
- this.eventSubscriptions.clear();
77
- }
78
- }
79
- export {
80
- RadiantElement
81
- };
1
+ import{H as a}from"../chunk-84fc8cz9.js";import"../chunk-9gjmqxp2.js";import"../chunk-8tvt04cm.js";import"../chunk-73x7jpdd.js";import"../chunk-8xy18qmz.js";export{a as RadiantElement};
82
2
 
83
- //# debugId=494A682B938300F764756E2164756E21
3
+ //# debugId=81AC4D5FEB0D36DD64756E2164756E21
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/core/radiant-element.ts"],
3
+ "sources": [],
4
4
  "sourcesContent": [
5
- "import type { UnknownContext } from '@/context/types';\nimport type { AttributeTypeConstant, ReadAttributeValueReturnType, WriteAttributeValueReturnType } from '@/utils';\n\n/**\n * Possible positions to insert a rendered template.\n */\nexport type RenderInsertPosition = 'replace' | 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';\n\n/**\n * Represents a Radiant element event listener.\n */\nexport type RadiantElementEventListener = {\n selector: string;\n type: string;\n listener: EventListener;\n id: string;\n options?: AddEventListenerOptions;\n};\n\n/**\n * Represents a property metadata object.\n */\nexport interface PropertyConfig {\n type: AttributeTypeConstant;\n propertyName: string;\n attributeKey: string;\n converter: {\n fromAttribute: (value: string) => ReadAttributeValueReturnType;\n toAttribute: (value: any) => WriteAttributeValueReturnType;\n };\n}\n\n/**\n * Represents an interface for a Radiant element.\n */\nexport interface IRadiantElement {\n /**\n * Called when a property of the element is updated.\n * @param changedProperty - The name of the changed property.\n * @param oldValue - The old value of the property.\n * @param newValue - The new value of the property.\n */\n updated(changedProperty: string, oldValue: unknown, newValue: unknown): void;\n\n /**\n * Subscribes to a Radiant element event.\n * @param event - The event listener to subscribe to.\n */\n subscribeEvent(event: RadiantElementEventListener): void;\n\n /**\n * Subscribes to multiple Radiant element events.\n * @param events - The array of event listeners to subscribe to.\n */\n subscribeEvents(events: RadiantElementEventListener[]): void;\n\n /**\n * Unsubscribes from a Radiant element event.\n * @param id - The ID of the event listener to unsubscribe from.\n */\n unsubscribeEvent(id: string): void;\n\n /**\n * Removes all subscribed events from the Radiant element.\n */\n removeAllSubscribedEvents(): void;\n\n /**\n * Renders a template into the specified target element.\n * @param options - The rendering options.\n * @param options.target - The target element to render the template into.\n * @param options.template - The template string to render.\n * @param options.insert - The position to insert the rendered template. (optional)\n */\n renderTemplate(options: {\n target: HTMLElement;\n template: string;\n insert?: RenderInsertPosition;\n }): void;\n\n /**\n * Called when the Radiant element is connected to a context.\n * @param context - The connected context.\n */\n connectedContextCallback(context: UnknownContext): void;\n}\n\n/**\n * A base class for creating custom elements with reactive properties and event subscriptions.\n * @extends HTMLElement\n * @implements IRadiantElement\n */\nexport class RadiantElement extends HTMLElement implements IRadiantElement {\n declare propertyConfigMap: Map<string, PropertyConfig>;\n declare updatesRegistry: Map<string, Set<string>>;\n private eventSubscriptions = new Map<string, RadiantElementEventListener>();\n private elementReady = false;\n\n connectedCallback() {\n this.elementReady = true;\n }\n\n connectedContextCallback(_contextName: UnknownContext): void {}\n\n disconnectedCallback() {\n this.removeAllSubscribedEvents();\n }\n\n updated(changedProperty: string, oldValue: unknown, value: unknown) {\n if (!this.elementReady || !this.updatesRegistry || oldValue === value) return;\n const updates = this.updatesRegistry.get(changedProperty);\n if (updates) {\n for (const update of updates) {\n (this as any)[update]();\n }\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n if (oldValue === newValue || !this.elementReady) return;\n\n if (name in this) {\n const config = this.propertyConfigMap.get(name);\n const transformedValue = newValue ? config?.converter.fromAttribute(newValue) : newValue;\n const transformedOldValue = oldValue ? config?.converter.fromAttribute(oldValue) : oldValue;\n (this as RadiantElement & { [key: string]: any })[name] = transformedValue;\n this.updated(name, transformedOldValue, transformedValue);\n }\n }\n\n renderTemplate({\n target = this,\n template,\n insert = 'replace',\n }: {\n target: HTMLElement;\n template: string;\n insert?: RenderInsertPosition;\n }) {\n switch (insert) {\n case 'replace':\n target.innerHTML = template;\n break;\n case 'beforeend':\n target.insertAdjacentHTML('beforeend', template);\n break;\n case 'afterbegin':\n target.insertAdjacentHTML('afterbegin', template);\n break;\n }\n }\n\n public subscribeEvents(events: RadiantElementEventListener[]): void {\n for (const event of events) {\n this.subscribeEvent(event);\n }\n }\n\n public subscribeEvent(eventConfig: RadiantElementEventListener): void {\n const delegatedListener = (delegatedEvent: Event) => {\n if (delegatedEvent.target && (delegatedEvent.target as Element).matches(eventConfig.selector)) {\n eventConfig.listener.call(this, delegatedEvent);\n }\n };\n\n this.addEventListener(eventConfig.type, delegatedListener, eventConfig.options);\n this.eventSubscriptions.set(eventConfig.id, { ...eventConfig, listener: delegatedListener });\n }\n\n public unsubscribeEvent(id: string): void {\n const eventSubscription = this.eventSubscriptions.get(id);\n if (eventSubscription) {\n this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n this.eventSubscriptions.delete(id);\n }\n }\n\n public removeAllSubscribedEvents(): void {\n for (const eventSubscription of this.eventSubscriptions.values()) {\n this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n }\n this.eventSubscriptions.clear();\n }\n}\n"
6
5
  ],
7
- "mappings": ";AA4FO,MAAM,uBAAuB,YAAuC;AAAA,EAGjE,qBAAqB,IAAI;AAAA,EACzB,eAAe;AAAA,EAEvB,iBAAiB,GAAG;AAClB,SAAK,eAAe;AAAA;AAAA,EAGtB,wBAAwB,CAAC,cAAoC;AAAA;AAAA,EAE7D,oBAAoB,GAAG;AACrB,SAAK,0BAA0B;AAAA;AAAA,EAGjC,OAAO,CAAC,iBAAyB,UAAmB,OAAgB;AAClE,SAAK,KAAK,iBAAiB,KAAK,mBAAmB,aAAa;AAAO;AACvE,UAAM,UAAU,KAAK,gBAAgB,IAAI,eAAe;AACxD,QAAI,SAAS;AACX,iBAAW,UAAU,SAAS;AAC5B,QAAC,KAAa,QAAQ;AAAA,MACxB;AAAA,IACF;AAAA;AAAA,EAGF,wBAAwB,CAAC,MAAc,UAAyB,UAAyB;AACvF,QAAI,aAAa,aAAa,KAAK;AAAc;AAEjD,QAAI,QAAQ,MAAM;AAChB,YAAM,SAAS,KAAK,kBAAkB,IAAI,IAAI;AAC9C,YAAM,mBAAmB,WAAW,QAAQ,UAAU,cAAc,QAAQ,IAAI;AAChF,YAAM,sBAAsB,WAAW,QAAQ,UAAU,cAAc,QAAQ,IAAI;AACnF,MAAC,KAAiD,QAAQ;AAC1D,WAAK,QAAQ,MAAM,qBAAqB,gBAAgB;AAAA,IAC1D;AAAA;AAAA,EAGF,cAAc;AAAA,IACZ,SAAS;AAAA,IACT;AAAA,IACA,SAAS;AAAA,KAKR;AACD,YAAQ;AAAA,WACD;AACH,eAAO,YAAY;AACnB;AAAA,WACG;AACH,eAAO,mBAAmB,aAAa,QAAQ;AAC/C;AAAA,WACG;AACH,eAAO,mBAAmB,cAAc,QAAQ;AAChD;AAAA;AAAA;AAAA,EAIC,eAAe,CAAC,QAA6C;AAClE,eAAW,SAAS,QAAQ;AAC1B,WAAK,eAAe,KAAK;AAAA,IAC3B;AAAA;AAAA,EAGK,cAAc,CAAC,aAAgD;AACpE,UAAM,oBAAoB,CAAC,mBAA0B;AACnD,UAAI,eAAe,UAAW,eAAe,OAAmB,QAAQ,YAAY,QAAQ,GAAG;AAC7F,oBAAY,SAAS,KAAK,MAAM,cAAc;AAAA,MAChD;AAAA;AAGF,SAAK,iBAAiB,YAAY,MAAM,mBAAmB,YAAY,OAAO;AAC9E,SAAK,mBAAmB,IAAI,YAAY,IAAI,KAAK,aAAa,UAAU,kBAAkB,CAAC;AAAA;AAAA,EAGtF,gBAAgB,CAAC,IAAkB;AACxC,UAAM,oBAAoB,KAAK,mBAAmB,IAAI,EAAE;AACxD,QAAI,mBAAmB;AACrB,WAAK,oBAAoB,kBAAkB,MAAM,kBAAkB,UAAU,kBAAkB,OAAO;AACtG,WAAK,mBAAmB,OAAO,EAAE;AAAA,IACnC;AAAA;AAAA,EAGK,yBAAyB,GAAS;AACvC,eAAW,qBAAqB,KAAK,mBAAmB,OAAO,GAAG;AAChE,WAAK,oBAAoB,kBAAkB,MAAM,kBAAkB,UAAU,kBAAkB,OAAO;AAAA,IACxG;AACA,SAAK,mBAAmB,MAAM;AAAA;AAElC;",
8
- "debugId": "494A682B938300F764756E2164756E21",
6
+ "mappings": "",
7
+ "debugId": "81AC4D5FEB0D36DD64756E2164756E21",
9
8
  "names": []
10
9
  }