@ecopages/radiant 0.3.0-alpha.3 → 0.3.0-alpha.5

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 (450) hide show
  1. package/README.md +66 -56
  2. package/dist/LICENSE +21 -0
  3. package/dist/client/hydrator.d.ts +1 -1
  4. package/dist/client/hydrator.js +2 -2
  5. package/dist/client/hydrator.js.map +5 -3
  6. package/dist/client/install-hydrator.js +2 -2
  7. package/dist/client/install-hydrator.js.map +5 -3
  8. package/dist/context/context-consumer-bootstrap.d.ts +7 -6
  9. package/dist/context/context-consumer-bootstrap.js +2 -2
  10. package/dist/context/context-consumer-bootstrap.js.map +8 -3
  11. package/dist/context/context-consumer-runtime.d.ts +21 -8
  12. package/dist/context/context-consumer-runtime.js +2 -2
  13. package/dist/context/context-consumer-runtime.js.map +6 -3
  14. package/dist/context/context-host.d.ts +25 -0
  15. package/dist/context/context-host.js +3 -0
  16. package/dist/context/context-host.js.map +10 -0
  17. package/dist/context/context-provider.d.ts +10 -6
  18. package/dist/context/context-provider.js +2 -2
  19. package/dist/context/context-provider.js.map +9 -3
  20. package/dist/context/context-ssr-bridge.js +2 -2
  21. package/dist/context/context-ssr-bridge.js.map +4 -3
  22. package/dist/context/create-context.js +2 -2
  23. package/dist/context/create-context.js.map +4 -3
  24. package/dist/context/decorators/consume-context.d.ts +5 -2
  25. package/dist/context/decorators/consume-context.js +2 -2
  26. package/dist/context/decorators/consume-context.js.map +13 -3
  27. package/dist/context/decorators/context-selection-delivery.d.ts +1 -1
  28. package/dist/context/decorators/context-selection-delivery.js +2 -2
  29. package/dist/context/decorators/context-selection-delivery.js.map +5 -3
  30. package/dist/context/decorators/context-selector.d.ts +6 -6
  31. package/dist/context/decorators/context-selector.js +2 -2
  32. package/dist/context/decorators/context-selector.js.map +15 -3
  33. package/dist/context/decorators/legacy/consume-context.d.ts +2 -2
  34. package/dist/context/decorators/legacy/consume-context.js +2 -2
  35. package/dist/context/decorators/legacy/consume-context.js.map +10 -3
  36. package/dist/context/decorators/legacy/context-selector-field.d.ts +2 -2
  37. package/dist/context/decorators/legacy/context-selector-field.js +2 -2
  38. package/dist/context/decorators/legacy/context-selector-field.js.map +11 -3
  39. package/dist/context/decorators/legacy/context-selector.d.ts +2 -2
  40. package/dist/context/decorators/legacy/context-selector.js +2 -2
  41. package/dist/context/decorators/legacy/context-selector.js.map +11 -3
  42. package/dist/context/decorators/legacy/provide-context.d.ts +2 -2
  43. package/dist/context/decorators/legacy/provide-context.js +2 -2
  44. package/dist/context/decorators/legacy/provide-context.js.map +11 -3
  45. package/dist/context/decorators/on-context-update.d.ts +5 -5
  46. package/dist/context/decorators/on-context-update.js +2 -2
  47. package/dist/context/decorators/on-context-update.js.map +14 -3
  48. package/dist/context/decorators/provide-context.d.ts +5 -2
  49. package/dist/context/decorators/provide-context.js +2 -2
  50. package/dist/context/decorators/provide-context.js.map +14 -3
  51. package/dist/context/decorators/standard/consume-context.d.ts +2 -2
  52. package/dist/context/decorators/standard/consume-context.js +2 -2
  53. package/dist/context/decorators/standard/consume-context.js.map +9 -3
  54. package/dist/context/decorators/standard/context-selector-field.d.ts +2 -2
  55. package/dist/context/decorators/standard/context-selector-field.js +2 -2
  56. package/dist/context/decorators/standard/context-selector-field.js.map +10 -3
  57. package/dist/context/decorators/standard/context-selector.d.ts +2 -3
  58. package/dist/context/decorators/standard/context-selector.js +2 -2
  59. package/dist/context/decorators/standard/context-selector.js.map +10 -3
  60. package/dist/context/decorators/standard/provide-context.d.ts +2 -2
  61. package/dist/context/decorators/standard/provide-context.js +2 -2
  62. package/dist/context/decorators/standard/provide-context.js.map +10 -3
  63. package/dist/context/events.d.ts +18 -11
  64. package/dist/context/events.js +2 -2
  65. package/dist/context/events.js.map +4 -3
  66. package/dist/context/hydration-script.js +2 -2
  67. package/dist/context/hydration-script.js.map +6 -3
  68. package/dist/controller-registry.d.ts +28 -0
  69. package/dist/controller-registry.js +3 -0
  70. package/dist/controller-registry.js.map +11 -0
  71. package/dist/core/controller-metadata.d.ts +3 -0
  72. package/dist/core/controller-metadata.js +3 -0
  73. package/dist/core/controller-metadata.js.map +10 -0
  74. package/dist/core/custom-element-metadata.d.ts +11 -0
  75. package/dist/core/custom-element-metadata.js +2 -2
  76. package/dist/core/custom-element-metadata.js.map +4 -3
  77. package/dist/core/hydration-codec.d.ts +8 -1
  78. package/dist/core/hydration-codec.js +2 -2
  79. package/dist/core/hydration-codec.js.map +5 -3
  80. package/dist/core/radiant-component-ssr-registry.d.ts +13 -13
  81. package/dist/core/radiant-component-ssr-registry.js +2 -2
  82. package/dist/core/radiant-component-ssr-registry.js.map +4 -3
  83. package/dist/core/radiant-component-ssr.d.ts +3 -3
  84. package/dist/core/radiant-component-ssr.js +2 -2
  85. package/dist/core/radiant-component-ssr.js.map +8 -3
  86. package/dist/core/radiant-controller.d.ts +127 -0
  87. package/dist/core/radiant-controller.js +3 -0
  88. package/dist/core/radiant-controller.js.map +13 -0
  89. package/dist/core/radiant-element.d.ts +43 -41
  90. package/dist/core/radiant-element.js +2 -2
  91. package/dist/core/radiant-element.js.map +13 -3
  92. package/dist/core/radiant-hydrator-state.d.ts +1 -1
  93. package/dist/core/radiant-hydrator-state.js +2 -2
  94. package/dist/core/radiant-hydrator-state.js.map +4 -3
  95. package/dist/core/reactive-host.d.ts +137 -0
  96. package/dist/core/reactive-host.js +3 -0
  97. package/dist/core/reactive-host.js.map +10 -0
  98. package/dist/core/reactive-jsx-value.js +2 -2
  99. package/dist/core/reactive-jsx-value.js.map +4 -3
  100. package/dist/core/reactive-prop-metadata.js +2 -2
  101. package/dist/core/reactive-prop-metadata.js.map +4 -3
  102. package/dist/core/slot-projection-runtime.js +2 -2
  103. package/dist/core/slot-projection-runtime.js.map +6 -3
  104. package/dist/core/ssr-preparation.js +2 -2
  105. package/dist/core/ssr-preparation.js.map +4 -3
  106. package/dist/decorators/attr.d.ts +6 -0
  107. package/dist/decorators/attr.js +3 -0
  108. package/dist/decorators/attr.js.map +16 -0
  109. package/dist/decorators/bound.d.ts +4 -2
  110. package/dist/decorators/bound.js +2 -2
  111. package/dist/decorators/bound.js.map +7 -3
  112. package/dist/decorators/bridge.d.ts +11 -7
  113. package/dist/decorators/bridge.js +2 -2
  114. package/dist/decorators/bridge.js.map +4 -3
  115. package/dist/decorators/controller.d.ts +2 -0
  116. package/dist/decorators/controller.js +3 -0
  117. package/dist/decorators/controller.js.map +12 -0
  118. package/dist/decorators/custom-element.d.ts +4 -2
  119. package/dist/decorators/custom-element.js +2 -2
  120. package/dist/decorators/custom-element.js.map +7 -3
  121. package/dist/decorators/debounce.d.ts +5 -2
  122. package/dist/decorators/debounce.js +2 -2
  123. package/dist/decorators/debounce.js.map +8 -3
  124. package/dist/decorators/event.d.ts +5 -2
  125. package/dist/decorators/event.js +2 -2
  126. package/dist/decorators/event.js.map +10 -3
  127. package/dist/decorators/legacy/attr.d.ts +2 -0
  128. package/dist/decorators/legacy/attr.js +3 -0
  129. package/dist/decorators/legacy/attr.js.map +13 -0
  130. package/dist/decorators/legacy/bound.js +2 -2
  131. package/dist/decorators/legacy/bound.js.map +4 -3
  132. package/dist/decorators/legacy/custom-element.js +2 -2
  133. package/dist/decorators/legacy/custom-element.js.map +5 -3
  134. package/dist/decorators/legacy/debounce.js +2 -2
  135. package/dist/decorators/legacy/debounce.js.map +5 -3
  136. package/dist/decorators/legacy/event.js +2 -2
  137. package/dist/decorators/legacy/event.js.map +7 -3
  138. package/dist/decorators/legacy/instance-initializers.d.ts +3 -4
  139. package/dist/decorators/legacy/instance-initializers.js +2 -2
  140. package/dist/decorators/legacy/instance-initializers.js.map +4 -3
  141. package/dist/decorators/legacy/on-event.d.ts +2 -2
  142. package/dist/decorators/legacy/on-event.js +2 -2
  143. package/dist/decorators/legacy/on-event.js.map +6 -3
  144. package/dist/decorators/legacy/on-updated.d.ts +7 -2
  145. package/dist/decorators/legacy/on-updated.js +2 -2
  146. package/dist/decorators/legacy/on-updated.js.map +5 -3
  147. package/dist/decorators/legacy/query-slot.js +2 -2
  148. package/dist/decorators/legacy/query-slot.js.map +7 -3
  149. package/dist/decorators/legacy/query.d.ts +7 -2
  150. package/dist/decorators/legacy/query.js +2 -2
  151. package/dist/decorators/legacy/query.js.map +6 -3
  152. package/dist/decorators/legacy/reactive-field.d.ts +2 -2
  153. package/dist/decorators/legacy/reactive-field.js +2 -2
  154. package/dist/decorators/legacy/reactive-field.js.map +5 -3
  155. package/dist/decorators/legacy/reactive-prop.d.ts +10 -16
  156. package/dist/decorators/legacy/reactive-prop.js +2 -2
  157. package/dist/decorators/legacy/reactive-prop.js.map +7 -3
  158. package/dist/decorators/legacy/signal.d.ts +4 -3
  159. package/dist/decorators/legacy/signal.js +2 -2
  160. package/dist/decorators/legacy/signal.js.map +9 -3
  161. package/dist/decorators/on-event.d.ts +6 -3
  162. package/dist/decorators/on-event.js +2 -2
  163. package/dist/decorators/on-event.js.map +9 -3
  164. package/dist/decorators/on-updated.d.ts +12 -2
  165. package/dist/decorators/on-updated.js +2 -2
  166. package/dist/decorators/on-updated.js.map +8 -3
  167. package/dist/decorators/prop.d.ts +19 -7
  168. package/dist/decorators/prop.js +2 -2
  169. package/dist/decorators/prop.js.map +10 -3
  170. package/dist/decorators/query-slot.d.ts +11 -3
  171. package/dist/decorators/query-slot.js +2 -2
  172. package/dist/decorators/query-slot.js.map +10 -3
  173. package/dist/decorators/query.d.ts +9 -2
  174. package/dist/decorators/query.js +2 -2
  175. package/dist/decorators/query.js.map +9 -3
  176. package/dist/decorators/shared/reactive-attr.d.ts +25 -0
  177. package/dist/decorators/shared/reactive-attr.js +3 -0
  178. package/dist/decorators/shared/reactive-attr.js.map +11 -0
  179. package/dist/decorators/signal.d.ts +10 -4
  180. package/dist/decorators/signal.js +2 -2
  181. package/dist/decorators/signal.js.map +11 -3
  182. package/dist/decorators/standard/attr.d.ts +2 -0
  183. package/dist/decorators/standard/attr.js +3 -0
  184. package/dist/decorators/standard/attr.js.map +12 -0
  185. package/dist/decorators/standard/bound.js +2 -2
  186. package/dist/decorators/standard/bound.js.map +4 -3
  187. package/dist/decorators/standard/custom-element.js +2 -2
  188. package/dist/decorators/standard/custom-element.js.map +5 -3
  189. package/dist/decorators/standard/debounce.js +2 -2
  190. package/dist/decorators/standard/debounce.js.map +5 -3
  191. package/dist/decorators/standard/event.js +2 -2
  192. package/dist/decorators/standard/event.js.map +6 -3
  193. package/dist/decorators/standard/on-event.d.ts +2 -1
  194. package/dist/decorators/standard/on-event.js +2 -2
  195. package/dist/decorators/standard/on-event.js.map +5 -3
  196. package/dist/decorators/standard/on-updated.d.ts +5 -1
  197. package/dist/decorators/standard/on-updated.js +2 -2
  198. package/dist/decorators/standard/on-updated.js.map +4 -3
  199. package/dist/decorators/standard/query-slot.d.ts +1 -1
  200. package/dist/decorators/standard/query-slot.js +2 -2
  201. package/dist/decorators/standard/query-slot.js.map +5 -3
  202. package/dist/decorators/standard/query.d.ts +2 -1
  203. package/dist/decorators/standard/query.js +2 -2
  204. package/dist/decorators/standard/query.js.map +5 -3
  205. package/dist/decorators/standard/reactive-field.d.ts +2 -2
  206. package/dist/decorators/standard/reactive-field.js +2 -2
  207. package/dist/decorators/standard/reactive-field.js.map +4 -3
  208. package/dist/decorators/standard/reactive-prop.d.ts +13 -2
  209. package/dist/decorators/standard/reactive-prop.js +2 -2
  210. package/dist/decorators/standard/reactive-prop.js.map +6 -3
  211. package/dist/decorators/standard/signal.d.ts +4 -3
  212. package/dist/decorators/standard/signal.js +2 -2
  213. package/dist/decorators/standard/signal.js.map +8 -3
  214. package/dist/decorators/state.d.ts +6 -5
  215. package/dist/decorators/state.js +2 -2
  216. package/dist/decorators/state.js.map +8 -3
  217. package/dist/helpers/create-event-listener.d.ts +11 -2
  218. package/dist/helpers/create-event-listener.js +2 -2
  219. package/dist/helpers/create-event-listener.js.map +4 -3
  220. package/dist/helpers/create-event.js +2 -2
  221. package/dist/helpers/create-event.js.map +5 -3
  222. package/dist/helpers/create-query-slot.js +2 -2
  223. package/dist/helpers/create-query-slot.js.map +4 -3
  224. package/dist/helpers/create-query.d.ts +14 -3
  225. package/dist/helpers/create-query.js +2 -2
  226. package/dist/helpers/create-query.js.map +4 -3
  227. package/dist/helpers/debounce.js +2 -2
  228. package/dist/helpers/debounce.js.map +4 -3
  229. package/dist/helpers/index.js +2 -2
  230. package/dist/helpers/index.js.map +9 -3
  231. package/dist/index.d.ts +11 -12
  232. package/dist/index.js +2 -2
  233. package/dist/index.js.map +87 -3
  234. package/dist/server/context-ssr.js +2 -2
  235. package/dist/server/context-ssr.js.map +5 -3
  236. package/dist/server/html-parser.js +2 -2
  237. package/dist/server/html-parser.js.map +4 -3
  238. package/dist/server/install-light-dom-shim.js +2 -2
  239. package/dist/server/install-light-dom-shim.js.map +5 -3
  240. package/dist/server/light-dom-shim.js +2 -2
  241. package/dist/server/light-dom-shim.js.map +5 -3
  242. package/dist/server/project-root.js +2 -2
  243. package/dist/server/project-root.js.map +2 -2
  244. package/dist/server/radiant-component-ssr-runtime.d.ts +2 -2
  245. package/dist/server/radiant-component-ssr-runtime.js +2 -2
  246. package/dist/server/radiant-component-ssr-runtime.js.map +11 -3
  247. package/dist/server/render-component.d.ts +3 -13
  248. package/dist/server/render-component.js +2 -2
  249. package/dist/server/render-component.js.map +14 -4
  250. package/dist/server/render-controller.d.ts +57 -0
  251. package/dist/server/render-controller.js +3 -0
  252. package/dist/server/render-controller.js.map +23 -0
  253. package/dist/server/slot-projection-html.js +2 -2
  254. package/dist/server/slot-projection-html.js.map +7 -3
  255. package/dist/signals/host-resource.js +2 -2
  256. package/dist/signals/host-resource.js.map +2 -2
  257. package/dist/signals/host-signal.d.ts +4 -2
  258. package/dist/signals/host-signal.js +2 -2
  259. package/dist/signals/host-signal.js.map +7 -3
  260. package/dist/signals/hydration-script.js +2 -2
  261. package/dist/signals/hydration-script.js.map +6 -3
  262. package/dist/tools/escape-script-json.js +2 -2
  263. package/dist/tools/escape-script-json.js.map +4 -3
  264. package/dist/tools/event-emitter.js +2 -2
  265. package/dist/tools/event-emitter.js.map +4 -3
  266. package/dist/tools/index.js +2 -2
  267. package/dist/tools/index.js.map +7 -3
  268. package/dist/tools/render-jsx-template.js +2 -2
  269. package/dist/tools/render-jsx-template.js.map +4 -3
  270. package/dist/tools/stringify-typed.js +2 -2
  271. package/dist/tools/stringify-typed.js.map +4 -3
  272. package/dist/types.js +2 -2
  273. package/dist/types.js.map +2 -2
  274. package/dist/utils/attribute-utils.js +2 -2
  275. package/dist/utils/attribute-utils.js.map +4 -3
  276. package/dist/utils/index.js +2 -2
  277. package/dist/utils/index.js.map +4 -3
  278. package/package.json +22 -5
  279. package/size-budget.json +11 -2
  280. package/dist/chunk-0bswvy25.js +0 -4
  281. package/dist/chunk-0bswvy25.js.map +0 -10
  282. package/dist/chunk-0btkzzyc.js +0 -4
  283. package/dist/chunk-0btkzzyc.js.map +0 -10
  284. package/dist/chunk-0g0j9re6.js +0 -4
  285. package/dist/chunk-0g0j9re6.js.map +0 -10
  286. package/dist/chunk-1x26p09c.js +0 -4
  287. package/dist/chunk-1x26p09c.js.map +0 -10
  288. package/dist/chunk-21a7jask.js +0 -4
  289. package/dist/chunk-21a7jask.js.map +0 -10
  290. package/dist/chunk-25zjh0kg.js +0 -4
  291. package/dist/chunk-25zjh0kg.js.map +0 -10
  292. package/dist/chunk-30x4hggg.js +0 -4
  293. package/dist/chunk-30x4hggg.js.map +0 -10
  294. package/dist/chunk-3xxvmd5c.js +0 -4
  295. package/dist/chunk-3xxvmd5c.js.map +0 -10
  296. package/dist/chunk-3ynk7e1e.js +0 -4
  297. package/dist/chunk-3ynk7e1e.js.map +0 -10
  298. package/dist/chunk-5b1en9vz.js +0 -4
  299. package/dist/chunk-5b1en9vz.js.map +0 -10
  300. package/dist/chunk-5bkat72n.js +0 -4
  301. package/dist/chunk-5bkat72n.js.map +0 -10
  302. package/dist/chunk-5qeaq3tj.js +0 -4
  303. package/dist/chunk-5qeaq3tj.js.map +0 -10
  304. package/dist/chunk-66e6s792.js +0 -4
  305. package/dist/chunk-66e6s792.js.map +0 -10
  306. package/dist/chunk-79jg8q67.js +0 -4
  307. package/dist/chunk-79jg8q67.js.map +0 -10
  308. package/dist/chunk-8d5ddvvf.js +0 -4
  309. package/dist/chunk-8d5ddvvf.js.map +0 -10
  310. package/dist/chunk-8e9fgtbn.js +0 -4
  311. package/dist/chunk-8e9fgtbn.js.map +0 -10
  312. package/dist/chunk-9mqtp3js.js +0 -4
  313. package/dist/chunk-9mqtp3js.js.map +0 -10
  314. package/dist/chunk-9rj2rwes.js +0 -4
  315. package/dist/chunk-9rj2rwes.js.map +0 -10
  316. package/dist/chunk-atms6yrh.js +0 -4
  317. package/dist/chunk-atms6yrh.js.map +0 -10
  318. package/dist/chunk-bk2nbmcd.js +0 -4
  319. package/dist/chunk-bk2nbmcd.js.map +0 -10
  320. package/dist/chunk-bk6qkvfp.js +0 -4
  321. package/dist/chunk-bk6qkvfp.js.map +0 -10
  322. package/dist/chunk-c0qyz98c.js +0 -4
  323. package/dist/chunk-c0qyz98c.js.map +0 -10
  324. package/dist/chunk-c52qhh0j.js +0 -4
  325. package/dist/chunk-c52qhh0j.js.map +0 -10
  326. package/dist/chunk-cnyxrh9r.js +0 -4
  327. package/dist/chunk-cnyxrh9r.js.map +0 -10
  328. package/dist/chunk-cvz9mrxa.js +0 -4
  329. package/dist/chunk-cvz9mrxa.js.map +0 -10
  330. package/dist/chunk-dabagjk6.js +0 -4
  331. package/dist/chunk-dabagjk6.js.map +0 -10
  332. package/dist/chunk-e0r6ca2g.js +0 -4
  333. package/dist/chunk-e0r6ca2g.js.map +0 -10
  334. package/dist/chunk-eevw1j2q.js +0 -4
  335. package/dist/chunk-eevw1j2q.js.map +0 -10
  336. package/dist/chunk-ek664x1c.js +0 -4
  337. package/dist/chunk-ek664x1c.js.map +0 -10
  338. package/dist/chunk-eyw14d6y.js +0 -4
  339. package/dist/chunk-eyw14d6y.js.map +0 -10
  340. package/dist/chunk-fs4j94bk.js +0 -4
  341. package/dist/chunk-fs4j94bk.js.map +0 -10
  342. package/dist/chunk-g2z3mm6b.js +0 -4
  343. package/dist/chunk-g2z3mm6b.js.map +0 -10
  344. package/dist/chunk-g5n3m11h.js +0 -4
  345. package/dist/chunk-g5n3m11h.js.map +0 -10
  346. package/dist/chunk-gdkte2vd.js +0 -4
  347. package/dist/chunk-gdkte2vd.js.map +0 -10
  348. package/dist/chunk-gg74gdpv.js +0 -4
  349. package/dist/chunk-gg74gdpv.js.map +0 -10
  350. package/dist/chunk-gpv1n74a.js +0 -4
  351. package/dist/chunk-gpv1n74a.js.map +0 -10
  352. package/dist/chunk-h9k7crjc.js +0 -4
  353. package/dist/chunk-h9k7crjc.js.map +0 -10
  354. package/dist/chunk-hpzgnxgq.js +0 -4
  355. package/dist/chunk-hpzgnxgq.js.map +0 -10
  356. package/dist/chunk-hrjc8b1y.js +0 -4
  357. package/dist/chunk-hrjc8b1y.js.map +0 -10
  358. package/dist/chunk-hvy4zvcc.js +0 -4
  359. package/dist/chunk-hvy4zvcc.js.map +0 -10
  360. package/dist/chunk-hztr86b4.js +0 -4
  361. package/dist/chunk-hztr86b4.js.map +0 -10
  362. package/dist/chunk-j3v7rca5.js +0 -4
  363. package/dist/chunk-j3v7rca5.js.map +0 -10
  364. package/dist/chunk-j864sv4w.js +0 -4
  365. package/dist/chunk-j864sv4w.js.map +0 -10
  366. package/dist/chunk-jkb2y7c8.js +0 -4
  367. package/dist/chunk-jkb2y7c8.js.map +0 -10
  368. package/dist/chunk-kakpjgzf.js +0 -4
  369. package/dist/chunk-kakpjgzf.js.map +0 -10
  370. package/dist/chunk-kmebacvv.js +0 -4
  371. package/dist/chunk-kmebacvv.js.map +0 -10
  372. package/dist/chunk-knqsm6v3.js +0 -4
  373. package/dist/chunk-knqsm6v3.js.map +0 -10
  374. package/dist/chunk-mp2vtrkg.js +0 -4
  375. package/dist/chunk-mp2vtrkg.js.map +0 -10
  376. package/dist/chunk-mpsj3cjs.js +0 -4
  377. package/dist/chunk-mpsj3cjs.js.map +0 -10
  378. package/dist/chunk-n4p2542b.js +0 -4
  379. package/dist/chunk-n4p2542b.js.map +0 -10
  380. package/dist/chunk-nctznxyz.js +0 -4
  381. package/dist/chunk-nctznxyz.js.map +0 -10
  382. package/dist/chunk-ndw3hc3v.js +0 -4
  383. package/dist/chunk-ndw3hc3v.js.map +0 -10
  384. package/dist/chunk-nnnb6pac.js +0 -4
  385. package/dist/chunk-nnnb6pac.js.map +0 -10
  386. package/dist/chunk-nssj2x13.js +0 -4
  387. package/dist/chunk-nssj2x13.js.map +0 -10
  388. package/dist/chunk-nvr37vma.js +0 -4
  389. package/dist/chunk-nvr37vma.js.map +0 -10
  390. package/dist/chunk-p8k4g99a.js +0 -4
  391. package/dist/chunk-p8k4g99a.js.map +0 -10
  392. package/dist/chunk-pkszgjqf.js +0 -4
  393. package/dist/chunk-pkszgjqf.js.map +0 -10
  394. package/dist/chunk-q9z6tnzw.js +0 -4
  395. package/dist/chunk-q9z6tnzw.js.map +0 -10
  396. package/dist/chunk-qdz5sncz.js +0 -4
  397. package/dist/chunk-qdz5sncz.js.map +0 -10
  398. package/dist/chunk-qe0eww1n.js +0 -4
  399. package/dist/chunk-qe0eww1n.js.map +0 -10
  400. package/dist/chunk-r33zvvda.js +0 -4
  401. package/dist/chunk-r33zvvda.js.map +0 -10
  402. package/dist/chunk-rkh1vkb9.js +0 -4
  403. package/dist/chunk-rkh1vkb9.js.map +0 -10
  404. package/dist/chunk-rrg759ht.js +0 -4
  405. package/dist/chunk-rrg759ht.js.map +0 -10
  406. package/dist/chunk-s09s5ayx.js +0 -4
  407. package/dist/chunk-s09s5ayx.js.map +0 -10
  408. package/dist/chunk-s5p5z3z4.js +0 -4
  409. package/dist/chunk-s5p5z3z4.js.map +0 -10
  410. package/dist/chunk-sf4a2gy5.js +0 -4
  411. package/dist/chunk-sf4a2gy5.js.map +0 -10
  412. package/dist/chunk-ssnnxzrj.js +0 -4
  413. package/dist/chunk-ssnnxzrj.js.map +0 -10
  414. package/dist/chunk-t8xtvgyg.js +0 -4
  415. package/dist/chunk-t8xtvgyg.js.map +0 -10
  416. package/dist/chunk-v3ta7hnv.js +0 -4
  417. package/dist/chunk-v3ta7hnv.js.map +0 -10
  418. package/dist/chunk-v92hp9g0.js +0 -4
  419. package/dist/chunk-v92hp9g0.js.map +0 -10
  420. package/dist/chunk-vgtggzb6.js +0 -4
  421. package/dist/chunk-vgtggzb6.js.map +0 -9
  422. package/dist/chunk-vk48hgm4.js +0 -4
  423. package/dist/chunk-vk48hgm4.js.map +0 -10
  424. package/dist/chunk-w8s5fnsq.js +0 -4
  425. package/dist/chunk-w8s5fnsq.js.map +0 -10
  426. package/dist/chunk-wd23rn4q.js +0 -4
  427. package/dist/chunk-wd23rn4q.js.map +0 -10
  428. package/dist/chunk-wds4href.js +0 -4
  429. package/dist/chunk-wds4href.js.map +0 -10
  430. package/dist/chunk-wvd1ffe4.js +0 -4
  431. package/dist/chunk-wvd1ffe4.js.map +0 -10
  432. package/dist/chunk-wwbjz9k4.js +0 -4
  433. package/dist/chunk-wwbjz9k4.js.map +0 -10
  434. package/dist/chunk-x2k0ngpz.js +0 -4
  435. package/dist/chunk-x2k0ngpz.js.map +0 -10
  436. package/dist/chunk-x457d0ap.js +0 -4
  437. package/dist/chunk-x457d0ap.js.map +0 -10
  438. package/dist/chunk-xbhtzkre.js +0 -4
  439. package/dist/chunk-xbhtzkre.js.map +0 -10
  440. package/dist/chunk-y139ycfm.js +0 -4
  441. package/dist/chunk-y139ycfm.js.map +0 -10
  442. package/dist/chunk-z9kxfckm.js +0 -4
  443. package/dist/chunk-z9kxfckm.js.map +0 -10
  444. package/dist/chunk-zx5txex8.js +0 -4
  445. package/dist/chunk-zx5txex8.js.map +0 -10
  446. package/dist/chunk-zygdebw8.js +0 -4
  447. package/dist/chunk-zygdebw8.js.map +0 -10
  448. package/dist/core/radiant-component.d.ts +0 -113
  449. package/dist/core/radiant-component.js +0 -3
  450. package/dist/core/radiant-component.js.map +0 -9
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/tools/escape-script-json.ts", "../src/core/hydration-codec.ts", "../src/signals/hydration-script.ts"],
4
4
  "sourcesContent": [
5
+ "/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * `<script>` tag.\n */\nexport function escapeScriptJson(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n",
6
+ "import { escapeScriptJson } from '../tools/escape-script-json';\n\n/** Attribute marker used to identify hydration payloads inside a host. */\nexport const HYDRATION_ATTRIBUTE = 'data-hydration';\n/** Discriminator that scopes a hydration payload to a specific feature. */\nexport const HYDRATION_TYPE_ATTRIBUTE = 'data-hydration-type';\n/** Optional key that scopes a hydration payload to a specific decorated field. */\nexport const HYDRATION_KEY_ATTRIBUTE = 'data-hydration-key';\n\nexport type HydrationPayloadType = 'signal' | 'context';\n\ntype HydrationScriptHost = {\n\tchildren?: ArrayLike<Element> | undefined;\n\tchildNodes?: ArrayLike<{ nodeType: number }> | undefined;\n};\n\n/** Creates a `<script type=\"application/json\">` tag for a hydration payload. */\nexport function createHydrationScriptTag(options: {\n\ttype: HydrationPayloadType;\n\thydrationKey?: string;\n\tserializedValue: string;\n}): string {\n\tconst keyAttribute = options.hydrationKey\n\t\t? ` ${HYDRATION_KEY_ATTRIBUTE}=\"${escapeHtmlAttribute(options.hydrationKey)}\"`\n\t\t: '';\n\n\treturn `<script type=\"application/json\" ${HYDRATION_ATTRIBUTE} ${HYDRATION_TYPE_ATTRIBUTE}=\"${options.type}\"${keyAttribute}>${options.serializedValue}</script>`;\n}\n\n/** Escapes serialized JSON so it remains safe inside an HTML script tag. */\nexport function escapeHydrationJson(value: string): string {\n\treturn escapeScriptJson(value);\n}\n\n/** Parses JSON from a hydration script element, returning the fallback on failure. */\nexport function parseHydrationPayload<T>(element: Element, fallback: T): T {\n\tconst textContent = element.textContent;\n\n\tif (!textContent) {\n\t\treturn fallback;\n\t}\n\n\ttry {\n\t\treturn JSON.parse(textContent) as T;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn(\n\t\t\t\t`[@ecopages/radiant] Failed to parse hydration payload from <script ${HYDRATION_ATTRIBUTE}>:`,\n\t\t\t\ttextContent.slice(0, 120),\n\t\t\t);\n\t\t}\n\t\treturn fallback;\n\t}\n}\n\n/**\n * Finds a hydration script element inside a host by type and optional key.\n *\n * When a key is provided, looks for an exact `data-hydration-key` match.\n * Otherwise, returns the first unkeyed script matching the type.\n */\nexport function findHydrationScript(\n\thost: HydrationScriptHost,\n\ttype: HydrationPayloadType,\n\thydrationKey?: string,\n): Element | null {\n\tconst children = host.children;\n\n\tif (!children || children.length === 0) {\n\t\tconst childNodes = (host as Partial<{ childNodes: ArrayLike<{ nodeType: number }> }>).childNodes;\n\n\t\tif (!childNodes || childNodes.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (let i = 0; i < childNodes.length; i += 1) {\n\t\t\tconst node = childNodes[i]!;\n\n\t\t\tif (node.nodeType !== 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst element = node as unknown as Element;\n\n\t\t\tif (matchesHydrationScript(element, type, hydrationKey)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tfor (let i = 0; i < children.length; i += 1) {\n\t\tif (matchesHydrationScript(children[i]!, type, hydrationKey)) {\n\t\t\treturn children[i]!;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction matchesHydrationScript(element: Element, type: HydrationPayloadType, hydrationKey?: string): boolean {\n\tif (\n\t\telement.tagName !== 'SCRIPT' ||\n\t\t!element.hasAttribute(HYDRATION_ATTRIBUTE) ||\n\t\telement.getAttribute(HYDRATION_TYPE_ATTRIBUTE) !== type\n\t) {\n\t\treturn false;\n\t}\n\n\tif (hydrationKey !== undefined) {\n\t\treturn element.getAttribute(HYDRATION_KEY_ATTRIBUTE) === hydrationKey;\n\t}\n\n\treturn !element.hasAttribute(HYDRATION_KEY_ATTRIBUTE);\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}\n",
7
+ "import { createHydrationScriptTag, escapeHydrationJson } from '../core/hydration-codec';\n\n/** Creates the raw `<script type=\"application/json\">` tag used to hydrate a signal field. */\nexport function createSignalHydrationScriptTag(options: { hydrationKey?: string; serializedValue: string }): string {\n\treturn createHydrationScriptTag({ type: 'signal', ...options });\n}\n\n/** Escapes serialized JSON so it remains safe inside an HTML script tag. */\nexport function escapeSignalHydrationJson(value: string): string {\n\treturn escapeHydrationJson(value);\n}\n"
5
8
  ],
6
- "mappings": "",
7
- "debugId": "5F47A97415912E6864756E2164756E21",
9
+ "mappings": "2PAIO,SAAS,CAAgB,CAAC,EAAuB,CACvD,OAAO,EACL,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,UAAW,SAAS,EAC5B,QAAQ,UAAW,SAAS,ECPxB,IAAM,EAAsB,iBAEtB,EAA2B,sBAE3B,EAA0B,qBAUhC,SAAS,CAAwB,CAAC,EAI9B,CACV,IAAM,EAAe,EAAQ,aAC1B,IAAI,MAA4B,EAAoB,EAAQ,YAAY,KACxE,GAEH,MAAO,mCAAmC,KAAuB,MAA6B,EAAQ,QAAQ,KAAgB,EAAQ,2BAIhI,SAAS,CAAmB,CAAC,EAAuB,CAC1D,OAAO,EAAiB,CAAK,EAIvB,SAAS,CAAwB,CAAC,EAAkB,EAAgB,CAC1E,IAAM,EAAc,EAAQ,YAE5B,GAAI,CAAC,EACJ,OAAO,EAGR,GAAI,CACH,OAAO,KAAK,MAAM,CAAW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import{wb as a}from"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";export{a as escapeScriptJson};
1
+ var s=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,a)=>(typeof require<"u"?require:r)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function i(e){return e.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}export{i as escapeScriptJson};
2
2
 
3
- //# debugId=41664B185705318B64756E2164756E21
3
+ //# debugId=91D7070AAF1AF86764756E2164756E21
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/tools/escape-script-json.ts"],
4
4
  "sourcesContent": [
5
+ "/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * `<script>` tag.\n */\nexport function escapeScriptJson(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n"
5
6
  ],
6
- "mappings": "",
7
- "debugId": "41664B185705318B64756E2164756E21",
7
+ "mappings": "2PAIO,SAAS,CAAgB,CAAC,EAAuB,CACvD,OAAO,EACL,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,UAAW,SAAS,EAC5B,QAAQ,UAAW,SAAS",
8
+ "debugId": "91D7070AAF1AF86764756E2164756E21",
8
9
  "names": []
9
10
  }
@@ -1,3 +1,3 @@
1
- import{yb as a}from"../chunk-wvd1ffe4.js";import"../chunk-vgtggzb6.js";export{a as EventEmitter};
1
+ var z=((k)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(k,{get:(q,x)=>(typeof require<"u"?require:q)[x]}):k)(function(k){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+k+'" is not supported')});class y{host;eventConfig;constructor(k,q){this.host=k,this.eventConfig=q}emit(k){let q=new CustomEvent(this.eventConfig.name,{detail:k,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(q)}}export{y as EventEmitter};
2
2
 
3
- //# debugId=139B84C5FD630AF664756E2164756E21
3
+ //# debugId=1E4E1D10DCC1E44064756E2164756E21
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/tools/event-emitter.ts"],
4
4
  "sourcesContent": [
5
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport interface EventEmitterConfig {\n\tname: string;\n\tbubbles?: boolean;\n\tcancelable?: boolean;\n\tcomposed?: 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\tprivate host: RadiantElement;\n\tprivate eventConfig: EventEmitterConfig;\n\n\t/**\n\t * Constructs a new instance of the EventEmitter class.\n\t *\n\t * @param host - The host element on which the events will be dispatched.\n\t * @param eventConfig - The configuration for the event.\n\t */\n\tconstructor(host: RadiantElement, eventConfig: EventEmitterConfig) {\n\t\tthis.host = host;\n\t\tthis.eventConfig = eventConfig;\n\t}\n\n\t/**\n\t * Emits a custom event with the specified detail.\n\t *\n\t * @param detail - The detail object to be passed along with the event.\n\t */\n\temit(detail?: T) {\n\t\tconst event = new CustomEvent(this.eventConfig.name, {\n\t\t\tdetail: detail,\n\t\t\tbubbles: this.eventConfig.bubbles,\n\t\t\tcancelable: this.eventConfig.cancelable,\n\t\t\tcomposed: this.eventConfig.composed,\n\t\t});\n\t\tthis.host.dispatchEvent(event);\n\t}\n}\n"
5
6
  ],
6
- "mappings": "",
7
- "debugId": "139B84C5FD630AF664756E2164756E21",
7
+ "mappings": "2PAcO,MAAM,CAA0B,CAC9B,KACA,YAQR,WAAW,CAAC,EAAsB,EAAiC,CAClE,KAAK,KAAO,EACZ,KAAK,YAAc,EAQpB,IAAI,CAAC,EAAY,CAChB,IAAM,EAAQ,IAAI,YAAY,KAAK,YAAY,KAAM,CACpD,OAAQ,EACR,QAAS,KAAK,YAAY,QAC1B,WAAY,KAAK,YAAY,WAC7B,SAAU,KAAK,YAAY,QAC5B,CAAC,EACD,KAAK,KAAK,cAAc,CAAK,EAE/B",
8
+ "debugId": "1E4E1D10DCC1E44064756E2164756E21",
8
9
  "names": []
9
10
  }
@@ -1,3 +1,3 @@
1
- import{a as x}from"../chunk-jkb2y7c8.js";import{b as a}from"../chunk-cvz9mrxa.js";import{wb as p}from"../chunk-nssj2x13.js";import{yb as t}from"../chunk-wvd1ffe4.js";import"../chunk-vgtggzb6.js";export{a as stringifyTyped,x as renderJsxTemplate,p as escapeScriptJson,t as EventEmitter};
1
+ var a=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function s(e){return e.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}class n{host;eventConfig;constructor(e,r){this.host=e,this.eventConfig=r}emit(e){let r=new CustomEvent(this.eventConfig.name,{detail:e,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(r)}}import{render as i}from"@ecopages/jsx";function g(e,r){i(e,r)}function l(e){return JSON.stringify(e)}export{l as stringifyTyped,g as renderJsxTemplate,s as escapeScriptJson,n as EventEmitter};
2
2
 
3
- //# debugId=328891D7088CB96064756E2164756E21
3
+ //# debugId=347E598DA09323F864756E2164756E21
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/tools/escape-script-json.ts", "../src/tools/event-emitter.ts", "../src/tools/render-jsx-template.ts", "../src/tools/stringify-typed.ts"],
4
4
  "sourcesContent": [
5
+ "/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * `<script>` tag.\n */\nexport function escapeScriptJson(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n",
6
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport interface EventEmitterConfig {\n\tname: string;\n\tbubbles?: boolean;\n\tcancelable?: boolean;\n\tcomposed?: 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\tprivate host: RadiantElement;\n\tprivate eventConfig: EventEmitterConfig;\n\n\t/**\n\t * Constructs a new instance of the EventEmitter class.\n\t *\n\t * @param host - The host element on which the events will be dispatched.\n\t * @param eventConfig - The configuration for the event.\n\t */\n\tconstructor(host: RadiantElement, eventConfig: EventEmitterConfig) {\n\t\tthis.host = host;\n\t\tthis.eventConfig = eventConfig;\n\t}\n\n\t/**\n\t * Emits a custom event with the specified detail.\n\t *\n\t * @param detail - The detail object to be passed along with the event.\n\t */\n\temit(detail?: T) {\n\t\tconst event = new CustomEvent(this.eventConfig.name, {\n\t\t\tdetail: detail,\n\t\t\tbubbles: this.eventConfig.bubbles,\n\t\t\tcancelable: this.eventConfig.cancelable,\n\t\t\tcomposed: this.eventConfig.composed,\n\t\t});\n\t\tthis.host.dispatchEvent(event);\n\t}\n}\n",
7
+ "import { render, type TemplateResultLike } from '@ecopages/jsx';\n\n/**\n * Renders a JSX template result into a target element by replacing its children.\n */\nexport function renderJsxTemplate(template: TemplateResultLike, target: HTMLElement): void {\n\trender(template, target);\n}\n",
8
+ "/**\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 maintaining the type in JSX attributes\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n *\n * // For lower-level JSON string generation outside JSX text children\n * const hydrationPayload = stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' });\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n\treturn JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
5
9
  ],
6
- "mappings": "",
7
- "debugId": "328891D7088CB96064756E2164756E21",
10
+ "mappings": "2PAIO,SAAS,CAAgB,CAAC,EAAuB,CACvD,OAAO,EACL,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,UAAW,SAAS,EAC5B,QAAQ,UAAW,SAAS,ECIxB,MAAM,CAA0B,CAC9B,KACA,YAQR,WAAW,CAAC,EAAsB,EAAiC,CAClE,KAAK,KAAO,EACZ,KAAK,YAAc,EAQpB,IAAI,CAAC,EAAY,CAChB,IAAM,EAAQ,IAAI,YAAY,KAAK,YAAY,KAAM,CACpD,OAAQ,EACR,QAAS,KAAK,YAAY,QAC1B,WAAY,KAAK,YAAY,WAC7B,SAAU,KAAK,YAAY,QAC5B,CAAC,EACD,KAAK,KAAK,cAAc,CAAK,EAE/B,CC3CA,iBAAS,sBAKF,SAAS,CAAiB,CAAC,EAA8B,EAA2B,CAC1F,EAAO,EAAU,CAAM,ECSjB,SAAS,CAAwB,CAAC,EAAyC,CACjF,OAAO,KAAK,UAAU,CAAK",
11
+ "debugId": "347E598DA09323F864756E2164756E21",
8
12
  "names": []
9
13
  }
@@ -1,3 +1,3 @@
1
- import{a}from"../chunk-jkb2y7c8.js";import"../chunk-vgtggzb6.js";export{a as renderJsxTemplate};
1
+ var w=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(k,q)=>(typeof require<"u"?require:k)[q]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});import{render as v}from"@ecopages/jsx";function B(f,k){v(f,k)}export{B as renderJsxTemplate};
2
2
 
3
- //# debugId=33BF6AD35B27EB1564756E2164756E21
3
+ //# debugId=6730AC26B382885064756E2164756E21
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/tools/render-jsx-template.ts"],
4
4
  "sourcesContent": [
5
+ "import { render, type TemplateResultLike } from '@ecopages/jsx';\n\n/**\n * Renders a JSX template result into a target element by replacing its children.\n */\nexport function renderJsxTemplate(template: TemplateResultLike, target: HTMLElement): void {\n\trender(template, target);\n}\n"
5
6
  ],
6
- "mappings": "",
7
- "debugId": "33BF6AD35B27EB1564756E2164756E21",
7
+ "mappings": "2PAAA,iBAAS,sBAKF,SAAS,CAAiB,CAAC,EAA8B,EAA2B,CAC1F,EAAO,EAAU,CAAM",
8
+ "debugId": "6730AC26B382885064756E2164756E21",
8
9
  "names": []
9
10
  }
@@ -1,3 +1,3 @@
1
- import{b as a}from"../chunk-cvz9mrxa.js";import"../chunk-vgtggzb6.js";export{a as stringifyTyped};
1
+ var r=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function i(e){return JSON.stringify(e)}export{i as stringifyTyped};
2
2
 
3
- //# debugId=3F8DDB103AAD885E64756E2164756E21
3
+ //# debugId=814F2BDEF827078064756E2164756E21
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/tools/stringify-typed.ts"],
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 maintaining the type in JSX attributes\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n *\n * // For lower-level JSON string generation outside JSX text children\n * const hydrationPayload = stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' });\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n\treturn JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
5
6
  ],
6
- "mappings": "",
7
- "debugId": "3F8DDB103AAD885E64756E2164756E21",
7
+ "mappings": "2PAeO,SAAS,CAAwB,CAAC,EAAyC,CACjF,OAAO,KAAK,UAAU,CAAK",
8
+ "debugId": "814F2BDEF827078064756E2164756E21",
8
9
  "names": []
9
10
  }
package/dist/types.js CHANGED
@@ -1,3 +1,3 @@
1
- import"./chunk-vgtggzb6.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};
1
+ var o=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,e)=>(typeof require<"u"?require:r)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var n={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{n as guards};
2
2
 
3
- //# debugId=91D7439E7D31B5DD64756E2164756E21
3
+ //# debugId=13A0204E2BB78E6764756E2164756E21
package/dist/types.js.map CHANGED
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
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\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\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\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
6
  ],
7
- "mappings": "4BAiEO,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",
7
+ "mappings": "2PAiEO,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": "13A0204E2BB78E6764756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,3 +1,3 @@
1
- import{ab as a,bb as b,cb as c,db as d,eb as e,fb as f,gb as g}from"../chunk-66e6s792.js";import"../chunk-vgtggzb6.js";export{e as writeAttributeValue,d as readAttributeValue,b as parseAttributeTypeDefault,a as parseAttributeTypeConstant,f as isValueOfType,g as getInitialValue,c as defaultValueForType};
1
+ var B=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(x,z)=>(typeof require<"u"?require:x)[z]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});function P(q){switch(q){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function R(q){switch(typeof q){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(q))return"array";if(Object.prototype.toString.call(q)==="[object Object]")return"object"}function U(q){switch(q){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function W(q){try{return JSON.parse(q)}catch{throw TypeError("Invalid JSON string")}}var X={array(q){let x=W(q);if(!Array.isArray(x))throw TypeError(`Expected an array but got a value of type "${typeof x}"`);return x},boolean(q){return!(q==="0"||String(q).toLowerCase()==="false")},number(q){return Number(q.replace(/_/g,""))},object(q){let x=JSON.parse(q);if(x===null||typeof x!=="object"||Array.isArray(x))throw TypeError(`expected value of type "object" but instead got value "${q}" of type "${R(x)}"`);return x},string(q){return q}},I={default:Q,array:L,object:L};function L(q){return JSON.stringify(q)}function Q(q){return`${q}`}function M(q,x){let z=P(x);if(!z)throw TypeError(`[radiant-element] Unknown type "${x}"`);return X[z](q)}function F(q,x){let z=P(x);if(!z)throw TypeError(`[radiant-element] Unknown type "${x}"`);return(I[z]??I.default??Q)(q)}function Y(q){return typeof q==="boolean"}function Z(q){return typeof q==="number"}function _(q){return typeof q==="string"}function $(q){return Array.isArray(q)}function k(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}function m(q,x){switch(q){case Boolean:return Y(x);case Number:return Z(x);case String:return _(x);case Array:return $(x);case Object:return k(x);default:return!1}}var h=(q,x,z,E)=>{if(x===Boolean){let G=q.getAttribute(z);if(G===null)return E;return G===""?!0:M(G,x)}let H=q.getAttribute(z);return H!==null?M(H,x):E??U(x)};export{F as writeAttributeValue,M as readAttributeValue,R as parseAttributeTypeDefault,P as parseAttributeTypeConstant,m as isValueOfType,h as getInitialValue,U as defaultValueForType};
2
2
 
3
- //# debugId=C2F55D0EA13687F864756E2164756E21
3
+ //# debugId=A6359EE45E00B20A64756E2164756E21
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/utils/attribute-utils.ts"],
4
4
  "sourcesContent": [
5
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n"
5
6
  ],
6
- "mappings": "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IAAmB,KACvB,EAAmB,EAAgB,CAAI,EACtC,GAAiB,EAAoB,CAAI",
8
+ "debugId": "A6359EE45E00B20A64756E2164756E21",
8
9
  "names": []
9
10
  }
@@ -1,3 +1,3 @@
1
- import{ab as e,bb as f,cb as m,db as p,eb as t,fb as x,gb as a}from"../chunk-66e6s792.js";import"../chunk-vgtggzb6.js";export{t as writeAttributeValue,p as readAttributeValue,f as parseAttributeTypeDefault,e as parseAttributeTypeConstant,x as isValueOfType,a as getInitialValue,m as defaultValueForType};
1
+ var m=((x)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(q,z)=>(typeof require<"u"?require:q)[z]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});function P(x){switch(x){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function R(x){switch(typeof x){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(x))return"array";if(Object.prototype.toString.call(x)==="[object Object]")return"object"}function U(x){switch(x){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function W(x){try{return JSON.parse(x)}catch{throw TypeError("Invalid JSON string")}}var X={array(x){let q=W(x);if(!Array.isArray(q))throw TypeError(`Expected an array but got a value of type "${typeof q}"`);return q},boolean(x){return!(x==="0"||String(x).toLowerCase()==="false")},number(x){return Number(x.replace(/_/g,""))},object(x){let q=JSON.parse(x);if(q===null||typeof q!=="object"||Array.isArray(q))throw TypeError(`expected value of type "object" but instead got value "${x}" of type "${R(q)}"`);return q},string(x){return x}},I={default:Q,array:L,object:L};function L(x){return JSON.stringify(x)}function Q(x){return`${x}`}function M(x,q){let z=P(q);if(!z)throw TypeError(`[radiant-element] Unknown type "${q}"`);return X[z](x)}function D(x,q){let z=P(q);if(!z)throw TypeError(`[radiant-element] Unknown type "${q}"`);return(I[z]??I.default??Q)(x)}function Y(x){return typeof x==="boolean"}function Z(x){return typeof x==="number"}function _(x){return typeof x==="string"}function $(x){return Array.isArray(x)}function k(x){return typeof x==="object"&&!Array.isArray(x)&&x!==null}function F(x,q){switch(x){case Boolean:return Y(q);case Number:return Z(q);case String:return _(q);case Array:return $(q);case Object:return k(q);default:return!1}}var h=(x,q,z,E)=>{if(q===Boolean){let G=x.getAttribute(z);if(G===null)return E;return G===""?!0:M(G,q)}let H=x.getAttribute(z);return H!==null?M(H,q):E??U(q)};export{D as writeAttributeValue,M as readAttributeValue,R as parseAttributeTypeDefault,P as parseAttributeTypeConstant,F as isValueOfType,h as getInitialValue,U as defaultValueForType};
2
2
 
3
- //# debugId=93B92726ADA25D5364756E2164756E21
3
+ //# debugId=4AD7E8FD49F8E7F964756E2164756E21
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/utils/attribute-utils.ts"],
4
4
  "sourcesContent": [
5
+ "import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n"
5
6
  ],
6
- "mappings": "",
7
- "debugId": "93B92726ADA25D5364756E2164756E21",
7
+ "mappings": "2PAYO,SAAS,CAA0B,CAAC,EAAkC,CAC5E,OAAQ,QACF,MACJ,MAAO,aACH,QACJ,MAAO,eACH,OACJ,MAAO,cACH,OACJ,MAAO,cACH,OACJ,MAAO,UAUH,SAAS,CAAyB,CAAC,EAAqC,CAC9E,OAAQ,OAAO,OACT,UACJ,MAAO,cACH,SACJ,MAAO,aACH,SACJ,MAAO,SAGT,GAAI,MAAM,QAAQ,CAAY,EAAG,MAAO,QACxC,GAAI,OAAO,UAAU,SAAS,KAAK,CAAY,IAAM,kBAAmB,MAAO,SASzE,SAAS,CAAmB,CAAC,EAAsC,CACzE,OAAQ,QACF,OACJ,MAAO,QACH,OACJ,MAAO,QACH,QACJ,MAAO,WAEP,OAAO,MASV,SAAS,CAAY,CAAC,EAAkB,CACvC,GAAI,CACH,OAAO,KAAK,MAAM,CAAK,EACtB,KAAM,CACP,MAAU,UAAU,qBAAqB,GAQ3C,IAAM,EAAsC,CAC3C,KAAK,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zD,OAAO,MAAM,QAAQ,CAAK,EAG3B,SAAS,CAAQ,CAAC,EAAiC,CAClD,OAAO,OAAO,IAAU,UAAY,CAAC,MAAM,QAAQ,CAAK,GAAK,IAAU,KAMjE,SAAS,CAAa,CAAC,EAA6B,EAAgC,CAC1F,OAAQ,QACF,QACJ,OAAO,EAAU,CAAY,OACzB,OACJ,OAAO,EAAS,CAAY,OACxB,OACJ,OAAO,EAAS,CAAY,OACxB,MACJ,OAAO,EAAQ,CAAY,OACvB,OACJ,OAAO,EAAS,CAAY,UAE5B,MAAO,IAIH,IAAM,EAAkB,CAC9B,EACA,EACA,EACA,IACI,CACJ,GAAI,IAAS,QAAS,CACrB,IAAM,EAAiB,EAAO,aAAa,CAAY,EACvD,GAAI,IAAmB,KACtB,OAAO,EAGR,OAAO,IAAmB,GAAK,GAAO,EAAmB,EAAgB,CAAI,EAG9E,IAAM,EAAiB,EAAO,aAAa,CAAY,EACvD,OAAO,IAAmB,KACvB,EAAmB,EAAgB,CAAI,EACtC,GAAiB,EAAoB,CAAI",
8
+ "debugId": "4AD7E8FD49F8E7F964756E2164756E21",
8
9
  "names": []
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecopages/radiant",
3
- "version": "0.3.0-alpha.3",
3
+ "version": "0.3.0-alpha.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/ecopages/radiant.git"
@@ -19,9 +19,10 @@
19
19
  "watch:lib": "bun run ./build.ts --watch",
20
20
  "size:check": "bun run ./check-size.ts",
21
21
  "size:report": "bun run ./check-size.ts --report-only",
22
+ "test:dist": "bun run build:lib && node --test ./test-dist/*.test.mjs",
22
23
  "test:standard": "vitest run",
23
24
  "test:legacy": "vitest run -- --legacy",
24
- "test:lib": "bun run test:standard && bun run test:legacy",
25
+ "test:lib": "bun run test:standard && bun run test:legacy && bun run test:dist",
25
26
  "test:lib:coverage": "bun run test:standard -- --coverage && bun run vitest run --coverage -- --legacy"
26
27
  },
27
28
  "dependencies": {},
@@ -91,13 +92,17 @@
91
92
  "types": "./dist/context/events.d.ts",
92
93
  "import": "./dist/context/events.js"
93
94
  },
95
+ "./controller-registry": {
96
+ "types": "./dist/controller-registry.d.ts",
97
+ "import": "./dist/controller-registry.js"
98
+ },
94
99
  "./core/radiant-element": {
95
100
  "types": "./dist/core/radiant-element.d.ts",
96
101
  "import": "./dist/core/radiant-element.js"
97
102
  },
98
- "./core/radiant-component": {
99
- "types": "./dist/core/radiant-component.d.ts",
100
- "import": "./dist/core/radiant-component.js"
103
+ "./core/radiant-controller": {
104
+ "types": "./dist/core/radiant-controller.d.ts",
105
+ "import": "./dist/core/radiant-controller.js"
101
106
  },
102
107
  "./client/hydrator": {
103
108
  "types": "./dist/client/hydrator.d.ts",
@@ -123,6 +128,10 @@
123
128
  "types": "./dist/server/render-component.d.ts",
124
129
  "import": "./dist/server/render-component.js"
125
130
  },
131
+ "./server/render-controller": {
132
+ "types": "./dist/server/render-controller.d.ts",
133
+ "import": "./dist/server/render-controller.js"
134
+ },
126
135
  "./server/project-root": {
127
136
  "types": "./dist/server/project-root.d.ts",
128
137
  "import": "./dist/server/project-root.js"
@@ -131,6 +140,14 @@
131
140
  "types": "./dist/decorators/bound.d.ts",
132
141
  "import": "./dist/decorators/bound.js"
133
142
  },
143
+ "./decorators/attr": {
144
+ "types": "./dist/decorators/attr.d.ts",
145
+ "import": "./dist/decorators/attr.js"
146
+ },
147
+ "./decorators/controller": {
148
+ "types": "./dist/decorators/controller.d.ts",
149
+ "import": "./dist/decorators/controller.js"
150
+ },
134
151
  "./decorators/custom-element": {
135
152
  "types": "./dist/decorators/custom-element.d.ts",
136
153
  "import": "./dist/decorators/custom-element.js"
package/size-budget.json CHANGED
@@ -1,16 +1,25 @@
1
1
  {
2
2
  "bundles": [
3
3
  {
4
+ "control": "strict",
4
5
  "label": "root-client-surface",
5
6
  "entrypoint": "./src/index.ts",
6
- "maxBytes": 46080,
7
- "maxGzipBytes": 12288
7
+ "maxBytes": 54272,
8
+ "maxGzipBytes": 14336
8
9
  },
9
10
  {
11
+ "control": "advisory",
10
12
  "label": "server-render",
11
13
  "entrypoint": "./src/server/render-component.ts",
12
14
  "maxBytes": 15360,
13
15
  "maxGzipBytes": 5184
16
+ },
17
+ {
18
+ "control": "advisory",
19
+ "label": "server-render-controller",
20
+ "entrypoint": "./src/server/render-controller.ts",
21
+ "maxBytes": 15360,
22
+ "maxGzipBytes": 5376
14
23
  }
15
24
  ]
16
25
  }
@@ -1,4 +0,0 @@
1
- import{Bb as t}from"./chunk-wwbjz9k4.js";function a(r){return function(o,e){let n=String(e.name);e.addInitializer(function(){let i=t(this,r);Object.defineProperty(this,n,{get(){return i.value},enumerable:!0,configurable:!0})})}}
2
- export{a as $};
3
-
4
- //# debugId=174B02C349DF3B4664756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/decorators/standard/query.ts"],
4
- "sourcesContent": [
5
- "import { createQuery } from '../../helpers/create-query';\nimport type { QueryConfig } from '../query';\n\nexport function query(options: QueryConfig) {\n\treturn function <T extends HTMLElement, V extends Element | Element[]>(\n\t\t_: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuery<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n"
6
- ],
7
- "mappings": "yCAGO,SAAS,CAAK,CAAC,EAAsB,CAC3C,OAAO,QAA+D,CACrE,EACA,EACC,CACD,IAAM,EAAe,OAAO,EAAQ,IAAI,EAExC,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAW,EAAe,KAAM,CAAO,EAE7C,OAAO,eAAe,KAAM,EAAc,CACzC,GAAG,EAAG,CACL,OAAO,EAAS,OAEjB,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
8
- "debugId": "174B02C349DF3B4664756E2164756E21",
9
- "names": []
10
- }
@@ -1,4 +0,0 @@
1
- import{ea as z}from"./chunk-qdz5sncz.js";import{fa as A}from"./chunk-w8s5fnsq.js";import{Oa as q}from"./chunk-q9z6tnzw.js";function K(j){return function(F,G){return q(A(j),z(j),F,G)}}
2
- export{K as da};
3
-
4
- //# debugId=0C61F31D99EFA58E64756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/decorators/event.ts"],
4
- "sourcesContent": [
5
- "import { type EventEmitterConfig } from '../tools/event-emitter';\nimport type { StandardOrLegacyFieldDecoratorArgs } from '../types';\nimport { event as legacyEvent } from './legacy/event';\nimport { event as standardEvent } from './standard/event';\nimport { fieldDecoratorBridge } from './bridge';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig {@link EventEmitterConfig} Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n\t): any {\n\t\treturn fieldDecoratorBridge(standardEvent(eventConfig), legacyEvent(eventConfig), protoOrTarget, nameOrContext);\n\t};\n}\n"
6
- ],
7
- "mappings": "uIAYO,GAAS,LAAK,CAAC,EAAiC,CACtD,OAAO,QAAS,CACf,EACA,EACM,CACN,OAAO,EAAqB,EAAc,CAAW,EAAG,EAAY,CAAW,EAAG,EAAe,CAAa",
8
- "debugId": "0C61F31D99EFA58E64756E2164756E21",
9
- "names": []
10
- }
@@ -1,4 +0,0 @@
1
- import{na as q}from"./chunk-8e9fgtbn.js";import{oa as v}from"./chunk-bk2nbmcd.js";import{Pa as j}from"./chunk-q9z6tnzw.js";function I(f){return function(w,z,E){return j(v(f),q(f),w,z,E)}}
2
- export{I as ma};
3
-
4
- //# debugId=79FD819A4172B94064756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/decorators/on-updated.ts"],
4
- "sourcesContent": [
5
- "import type { StandardOrLegacyMethodDecoratorArgs } from '../types';\nimport { onUpdated as legacyOnUpdated } from './legacy/on-updated';\nimport { onUpdated as standardOnUpdated } from './standard/on-updated';\nimport { methodDecoratorBridge } from './bridge';\n\n/**\n * A decorator to bind a method to the instance.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): any {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnUpdated(keyOrKeys),\n\t\t\tlegacyOnUpdated(keyOrKeys),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t};\n}\n"
6
- ],
7
- "mappings": "uIAQO,GAAS,LAAS,CAAC,EAA8B,CACvD,OAAO,QAAS,CACf,EACA,EACA,EACM,CACN,OAAO,EACN,EAAkB,CAAS,EAC3B,EAAgB,CAAS,EACzB,EACA,EACA,CACD",
8
- "debugId": "79FD819A4172B94064756E2164756E21",
9
- "names": []
10
- }
@@ -1,4 +0,0 @@
1
- import{ta as z}from"./chunk-9rj2rwes.js";import{ua as G}from"./chunk-v3ta7hnv.js";import{Pa as q}from"./chunk-q9z6tnzw.js";function Q(j){return function(H,I,J){return q(G(j),z(j),H,I,J)}}
2
- export{Q as sa};
3
-
4
- //# debugId=DFF5F8F9A61E3D2564756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/decorators/on-event.ts"],
4
- "sourcesContent": [
5
- "import type { RadiantElementEventListener } from '../core/radiant-element';\nimport type { StandardOrLegacyMethodDecoratorArgs } from '../types';\nimport type { OnEventConfig, OnEventScope } from '../helpers/create-event-listener';\nimport { onEvent as legacyOnEvent } from './legacy/on-event';\nimport { onEvent as standardOnEvent } from './standard/on-event';\nimport { methodDecoratorBridge } from './bridge';\n\nexport type { OnEventConfig, OnEventScope };\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n * Delegated listeners observe the host light DOM by default, and can optionally observe the shadow root or both trees.\n *\n * @param options {@link OnEventConfig} The event configuration.\n */\nexport function onEvent(options: OnEventConfig) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): any {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnEvent(options),\n\t\t\tlegacyOnEvent(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t};\n}\n"
6
- ],
7
- "mappings": "uIAoBO,GAAS,LAAO,CAAC,EAAwB,CAC/C,OAAO,QAAS,CACf,EACA,EACA,EACM,CACN,OAAO,EACN,EAAgB,CAAO,EACvB,EAAc,CAAO,EACrB,EACA,EACA,CACD",
8
- "debugId": "DFF5F8F9A61E3D2564756E2164756E21",
9
- "names": []
10
- }
@@ -1,4 +0,0 @@
1
- import{U as I}from"./chunk-kmebacvv.js";import{W as U,X as Y}from"./chunk-c0qyz98c.js";import{ub as K,vb as Q}from"./chunk-hpzgnxgq.js";import{createMarkupNodeLike as _}from"@ecopages/jsx";class ${host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(q,A){this.host=q,this.context=A.context,this.hydrationKey=A.hydrationKey,this.hydrate=A.hydrate,this.serialize=A.serialize,this.pendingHostHydration=Boolean(A.hydrate),this.value=A.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new I(this.context))}setContext=(q,A)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(q)){let B=this.value;if(this.value={...q},A)A(this.value);this.notifySubscribers(this.value,B);return}if(this.isObject(this.value)&&this.isObject(q)){let B={...this.value};if(this.value={...this.value,...q},A)A(this.value);this.notifySubscribers(this.value,B)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let q=this.serialize?this.serialize(this.value):this.value;if(typeof q>"u")return;let A=JSON.stringify(q);if(typeof A!=="string")return;return Y(A)};renderHydrationScriptTag=()=>{let q=this.serializeHydrationValue();if(!q)return;return U({hydrationKey:this.hydrationKey,serializedValue:q})};renderHydrationScript=()=>{let q=this.renderHydrationScriptTag();if(!q)return;return _(q)};subscribe=({select:q,callback:A})=>{this.subscriptions.push({select:q,callback:A})};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let q=this.findHydrationScriptElement();if(!q)return;this.value=this.mergeHydrationValue(K(q,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(q){if(this.hydrate===Object&&this.isObject(q)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...q};return q}isObject(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}findHydrationScriptElement(){return Q(this.host,"context",this.hydrationKey)}notifySubscribers=(q,A)=>{for(let B of this.subscriptions){if(!B.select||typeof A>"u"){this.sendSubscriptionUpdate(B,q);continue}let F=B.select(q),G=B.select(A);if(F!==G)this.sendSubscriptionUpdate(B,q)}};sendSubscriptionUpdate=({select:q,callback:A},B)=>{if(!q)A(B);else A(q(B))};handleSubscriptionRequest=({select:q,callback:A,subscribe:B})=>{if(this.tryHydrateFromHost(),B)this.subscribe({select:q,callback:A});if(typeof this.value>"u")return;if(q)A(q(this.value));else A(this.value)};onSubscriptionRequest=(q)=>{let{context:A,callback:B,subscribe:F,select:G,target:Z}=q;if(A!==this.context)return;q.stopPropagation(),Z.dispatchEvent(new I(this.context)),this.handleSubscriptionRequest({select:G,callback:B,subscribe:F})};onContextRequest=(q)=>{let{context:A,callback:B}=q;if(A!==this.context)return;q.stopPropagation(),B(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}
2
- export{$ as R};
3
-
4
- //# debugId=4E0252ECD83ECA6C64756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/context/context-provider.ts"],
4
- "sourcesContent": [
5
- "import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantElement } from '../core/radiant-element';\nimport type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';\nimport type { AttributeTypeConstant } from '../utils/attribute-utils';\nimport {\n\tContextEventsTypes,\n\tContextOnMountEvent,\n\ttype ContextRequestEvent,\n\ttype ContextSubscription,\n\ttype ContextSubscriptionRequestEvent,\n} from './events';\nimport { findHydrationScript, parseHydrationPayload } from '../core/hydration-codec';\nimport { createContextHydrationScriptTag, escapeContextHydrationJson } from './hydration-script';\nimport type { Context, ContextType, UnknownContext } from './types';\n\ntype ContextProviderOptions<T extends UnknownContext> = {\n\tcontext: UnknownContext;\n\thydrationKey?: string;\n\tinitialValue?: T['__context__'];\n\thydrate?: AttributeTypeConstant;\n\tserialize?: (value: ContextType<T>) => unknown;\n};\n\nexport interface SsrSerializableContextProvider extends SsrSerializableHydrationBinding {\n\t/** Returns the current context payload that should be visible to descendants. */\n\tgetContext(): unknown;\n\t/** Returns the context token used to match nested SSR consumers and providers. */\n\tgetContextKey(): UnknownContext;\n}\n\n/**\n * Represents a context provider that allows setting and getting the context,\n * as well as subscribing to context updates.\n *\n * @template T - The type of the context.\n */\nexport interface IContextProvider<T extends Context<unknown, unknown>> {\n\t/**\n\t * Sets the context with the provided update and invokes the optional callback function.\n\t *\n\t * @param update - The partial update to be applied to the context.\n\t * @param callback - An optional callback function that receives the updated context.\n\t */\n\tsetContext: (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => void;\n\n\t/**\n\t * Gets the current context.\n\t *\n\t * @returns The current context.\n\t */\n\tgetContext: () => ContextType<T>;\n\n\t/**\n\t * Subscribes to context updates.\n\t *\n\t * @param subscription - The subscription object that defines the callback function to be invoked on context updates.\n\t */\n\tsubscribe: (subscription: ContextSubscription<T>) => void;\n}\n\n/**\n * It creates a context provider that allows setting and getting the context,\n * It will also be in charge of notifying the subscribers when the context changes.\n *\n * @template T - The type of the context.\n * @implements IContextProvider\n *\n * @example\n * ```ts\n * export class MyElement extends RadiantElement {\n * provider = new ContextProvider<typeof myContext>(this, {\n * context: myContext,\n * initialValue: {\n * value: 'Hello World',\n * },\n * });\n * ```\n */\nexport class ContextProvider<T extends Context<unknown, unknown>>\n\timplements IContextProvider<T>, SsrSerializableContextProvider\n{\n\tprivate host: RadiantElement;\n\tprivate context: UnknownContext;\n\tprivate hydrationKey?: string;\n\tprivate hydrate?: AttributeTypeConstant;\n\tprivate serialize?: (value: ContextType<T>) => unknown;\n\tprivate pendingHostHydration: boolean;\n\tprivate value: ContextType<T> | undefined;\n\n\tsubscriptions: ContextSubscription<T>[] = [];\n\n\t/**\n\t * Creates a new instance of the ContextProvider.\n\t *\n\t * @param host - The host element that will contain the context provider.\n\t * @param options - The options to configure the context provider.\n\t */\n\tconstructor(host: RadiantElement, options: ContextProviderOptions<T>) {\n\t\tthis.host = host;\n\t\tthis.context = options.context;\n\t\tthis.hydrationKey = options.hydrationKey;\n\t\tthis.hydrate = options.hydrate;\n\t\tthis.serialize = options.serialize;\n\t\tthis.pendingHostHydration = Boolean(options.hydrate);\n\t\tthis.value = options.initialValue as ContextType<T>;\n\t\tthis.tryHydrateFromHost();\n\n\t\tthis.registerEvents();\n\t\tthis.host.dispatchEvent(new ContextOnMountEvent(this.context));\n\t}\n\n\tsetContext = (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => {\n\t\tthis.tryHydrateFromHost();\n\t\tthis.pendingHostHydration = false;\n\n\t\tif (typeof this.value === 'undefined' && this.isObject(update)) {\n\t\t\tconst oldContext = this.value;\n\t\t\tthis.value = { ...update } as ContextType<T>;\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isObject(this.value) && this.isObject(update)) {\n\t\t\tconst oldContext = { ...this.value };\n\t\t\tthis.value = { ...this.value, ...update };\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t}\n\t};\n\n\tgetContext = () => {\n\t\tthis.tryHydrateFromHost();\n\t\treturn this.value as ContextType<T>;\n\t};\n\n\t/**\n\t * Returns the provider's logical context token.\n\t *\n\t * SSR helpers use this token to resolve the closest matching provider while a\n\t * host subtree is being serialized.\n\t */\n\tgetContextKey = () => {\n\t\treturn this.context;\n\t};\n\n\t/**\n\t * Serializes the current provider value for inclusion in a hydration script.\n\t *\n\t * The serialized payload is JSON-escaped so it can be embedded safely inside a\n\t * `<script type=\"application/json\">` tag.\n\t */\n\tserializeHydrationValue = (): string | undefined => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (!this.hydrate || typeof this.value === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst hydrationValue = this.serialize ? this.serialize(this.value) : this.value;\n\n\t\tif (typeof hydrationValue === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst serializedValue = JSON.stringify(hydrationValue);\n\n\t\tif (typeof serializedValue !== 'string') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn escapeContextHydrationJson(serializedValue);\n\t};\n\n\t/**\n\t * Builds the raw HTML hydration script for this provider.\n\t *\n\t * When `hydrationKey` is present, the marker is scoped so sibling or nested\n\t * providers can recover their own payloads without accidentally reading a\n\t * descendant script.\n\t */\n\trenderHydrationScriptTag = (): string | undefined => {\n\t\tconst serializedValue = this.serializeHydrationValue();\n\n\t\tif (!serializedValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createContextHydrationScriptTag({\n\t\t\thydrationKey: this.hydrationKey,\n\t\t\tserializedValue,\n\t\t});\n\t};\n\n\t/**\n\t * Wraps the provider hydration script in a minimal JSX node-like value.\n\t *\n\t * This lets JSX-based host renderers append the script without needing a real\n\t * DOM element instance during SSR.\n\t */\n\trenderHydrationScript = (): JsxRenderable | undefined => {\n\t\tconst outerHTML = this.renderHydrationScriptTag();\n\n\t\tif (!outerHTML) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createMarkupNodeLike(outerHTML);\n\t};\n\n\tsubscribe = ({ select, callback }: ContextSubscription<T>) => {\n\t\tthis.subscriptions.push({ select, callback });\n\t};\n\n\tprivate tryHydrateFromHost(): void {\n\t\tif (!this.pendingHostHydration) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst hydrationScriptElement = this.findHydrationScriptElement();\n\n\t\tif (!hydrationScriptElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value = this.mergeHydrationValue(\n\t\t\tparseHydrationPayload(hydrationScriptElement, this.value) as ContextType<T>,\n\t\t);\n\t\tthis.pendingHostHydration = false;\n\t}\n\n\tprivate mergeHydrationValue(parsedHydrationValue: ContextType<T>): ContextType<T> {\n\t\tif (\n\t\t\tthis.hydrate === Object &&\n\t\t\tthis.isObject(parsedHydrationValue) &&\n\t\t\t(this.isObject(this.value) || typeof this.value === 'undefined')\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...(this.value ?? {}),\n\t\t\t\t...parsedHydrationValue,\n\t\t\t} as ContextType<T>;\n\t\t}\n\n\t\treturn parsedHydrationValue;\n\t}\n\n\tprivate isObject(value: unknown): value is Record<string, unknown> {\n\t\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n\t}\n\n\tprivate findHydrationScriptElement(): Element | null {\n\t\treturn findHydrationScript(this.host as Element, 'context', this.hydrationKey);\n\t}\n\n\tprivate notifySubscribers = (newContext: ContextType<T>, prevContext: ContextType<T> | undefined) => {\n\t\tfor (const sub of this.subscriptions) {\n\t\t\tif (!sub.select || typeof prevContext === 'undefined') {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst newSelected = sub.select(newContext);\n\t\t\tconst prevSelected = sub.select(prevContext);\n\t\t\tif (newSelected !== prevSelected) {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate sendSubscriptionUpdate = ({ select, callback }: ContextSubscription<T>, context: ContextType<T>) => {\n\t\tif (!select) callback(context);\n\t\telse callback(select(context));\n\t};\n\n\tprivate handleSubscriptionRequest = ({\n\t\tselect,\n\t\tcallback,\n\t\tsubscribe,\n\t}: {\n\t\tselect?: ContextSubscription<T>['select'];\n\t\tcallback: ContextSubscription<T>['callback'];\n\t\tsubscribe?: boolean;\n\t}) => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (subscribe) this.subscribe({ select, callback });\n\n\t\tif (typeof this.value === 'undefined') return;\n\n\t\tif (select) {\n\t\t\tcallback(select(this.value));\n\t\t} else {\n\t\t\tcallback(this.value as ContextType<T>);\n\t\t}\n\t};\n\n\tprivate onSubscriptionRequest = (event: ContextSubscriptionRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback, subscribe, select, target } = event;\n\t\tif (context !== this.context) return;\n\n\t\tevent.stopPropagation();\n\n\t\t(target as HTMLElement).dispatchEvent(new ContextOnMountEvent(this.context));\n\n\t\tthis.handleSubscriptionRequest({ select, callback, subscribe });\n\t};\n\n\tprivate onContextRequest = (event: ContextRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback } = event;\n\t\tif (context !== this.context) return;\n\t\tevent.stopPropagation();\n\t\tcallback(this);\n\t};\n\n\tprivate registerEvents = () => {\n\t\tthis.host.addEventListener(ContextEventsTypes.SUBSCRIPTION_REQUEST, this.onSubscriptionRequest);\n\t\tthis.host.addEventListener(ContextEventsTypes.CONTEXT_REQUEST, this.onContextRequest);\n\t};\n}\n"
6
- ],
7
- "mappings": "oJAAA,yBAAS,gBA8EF,MAAM,CAEb,CACS,KACA,QACA,aACA,QACA,UACA,qBACA,MAER,cAA0C,CAAC,EAQ3C,WAAW,CAAC,EAAsB,EAAoC,CACrE,KAAK,KAAO,EACZ,KAAK,QAAU,EAAQ,QACvB,KAAK,aAAe,EAAQ,aAC5B,KAAK,QAAU,EAAQ,QACvB,KAAK,UAAY,EAAQ,UACzB,KAAK,qBAAuB,QAAQ,EAAQ,OAAO,EACnD,KAAK,MAAQ,EAAQ,aACrB,KAAK,mBAAmB,EAExB,KAAK,eAAe,EACpB,KAAK,KAAK,cAAc,IAAI,EAAoB,KAAK,OAAO,CAAC,EAG9D,WAAa,CAAC,EAAiC,IAAiD,CAI/F,GAHA,KAAK,mBAAmB,EACxB,KAAK,qBAAuB,GAExB,OAAO,KAAK,MAAU,KAAe,KAAK,SAAS,CAAM,EAAG,CAC/D,IAAM,EAAa,KAAK,MAExB,GADA,KAAK,MAAQ,IAAK,CAAO,EACrB,EAAU,EAAS,KAAK,KAAK,EACjC,KAAK,kBAAkB,KAAK,MAAO,CAAU,EAC7C,OAGD,GAAI,KAAK,SAAS,KAAK,KAAK,GAAK,KAAK,SAAS,CAAM,EAAG,CACvD,IAAM,EAAa,IAAK,KAAK,KAAM,EAEnC,GADA,KAAK,MAAQ,IAAK,KAAK,SAAU,CAAO,EACpC,EAAU,EAAS,KAAK,KAAK,EACjC,KAAK,kBAAkB,KAAK,MAAO,CAAU,IAI/C,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,b),!window.customElements.get(b))window.customElements.define(b,f,j)}}
2
- export{q as qa};
3
-
4
- //# debugId=6EDD7A6042A1E5F864756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/decorators/legacy/custom-element.ts"],
4
- "sourcesContent": [
5
- "import { setCustomElementTagName } from '../../core/custom-element-metadata';\n\n/**\n * Registers a web component with the given name on the global `window.customElements` registry.\n * @param name selector name.\n * @param options {@link ElementDefinitionOptions}\n */\nexport function customElement(name: string, options?: ElementDefinitionOptions) {\n\treturn (target: CustomElementConstructor) => {\n\t\tsetCustomElementTagName(target, name);\n\n\t\tif (!window.customElements.get(name)) {\n\t\t\twindow.customElements.define(name, target, options);\n\t\t}\n\t};\n}\n"
6
- ],
7
- "mappings": "yCAOO,SAAS,CAAa,CAAC,EAAc,EAAoC,CAC/E,MAAO,CAAC,IAAqC,CAG5C,GAFA,EAAwB,EAAQ,CAAI,EAEhC,CAAC,OAAO,eAAe,IAAI,CAAI,EAClC,OAAO,eAAe,OAAO,EAAM,EAAQ,CAAO",
8
- "debugId": "6EDD7A6042A1E5F864756E2164756E21",
9
- "names": []
10
- }
@@ -1,4 +0,0 @@
1
- var g=(d)=>d;
2
- export{g as z};
3
-
4
- //# debugId=0C72A74D4D52914964756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/context/create-context.ts"],
4
- "sourcesContent": [
5
- "import type { Context } from './types';\n\n/**\n * A function which creates a Context value object\n */\nexport const createContext = <ValueType>(key: unknown) => key as Context<typeof key, ValueType>;\n"
6
- ],
7
- "mappings": "AAKO,IAAM,EAAgB,CAAY,IAAiB",
8
- "debugId": "0C72A74D4D52914964756E2164756E21",
9
- "names": []
10
- }
@@ -1,4 +0,0 @@
1
- import{pb as B}from"./chunk-hpzgnxgq.js";import{createMarkupNodeLike as U,isKeyedJsxValue as D,isSlotJsxValue as A}from"@ecopages/jsx";var k="",J="data-radiant-slot-projection";function x(q){let w=new Map;for(let G of Array.from(q.childNodes)){if(F(G))continue;O(w,E(G),G)}return w}function P(q){let w;try{w=JSON.parse(q)}catch{if(typeof console<"u")console.warn("[@ecopages/radiant] Failed to parse slot projection payload:",q.slice(0,120));return new Map}let G=new Map;for(let[Q,X]of Object.entries(w)){if(!Array.isArray(X)||X.length===0)continue;G.set($(Q),X.map((W)=>U(W)))}return G}function R(q){let w=Array.from(q.childNodes).filter((G)=>M(G)).map((G)=>Y(G)??"").filter((G)=>G!=="");return w.length>0?w.join(""):void 0}function f(q){let w={};for(let[G,Q]of q.entries()){let X=Q.map((W)=>Y(W)).filter((W)=>W!==void 0&&W!=="");if(X.length>0)w[G]=X}return Object.keys(w).length>0?JSON.stringify(w):void 0}function T(q,w){let G=!1,Q=(W)=>{if(A(W))return G=!0,I(W,w,Q);if(D(W))return h(W,Q(W.value));if(H(W))return{_$rType$:1,strings:W.strings,values:W.values.map((Z)=>Q(Z))};if(z(W))return Array.from(W,(Z)=>Q(Z));return W},X=Q(q);return{containsSlots:G,value:X}}function j(q){for(let w of Array.from(q.childNodes)){if(!K(w))continue;let G=w.textContent??void 0;return w.parentNode?.removeChild(w),G}return}function O(q,w,G){let Q=q.get(w);if(Q){Q.push(G);return}q.set(w,[G])}function h(q,w){return{...q,value:w}}function E(q){if(q instanceof Element)return $(q.getAttribute("slot"));return k}function z(q){return typeof q!=="string"&&typeof q==="object"&&q!==null&&Symbol.iterator in q}function K(q){return q instanceof HTMLScriptElement&&q.hasAttribute(J)}function M(q){return q instanceof HTMLScriptElement&&q.hasAttribute(B)}function F(q){return K(q)||M(q)}function H(q){return typeof q==="object"&&q!==null&&q._$rType$===1&&Array.isArray(q.strings)&&Array.isArray(q.values)}function $(q){return q??k}function Y(q){if(q===void 0||q===null||q===!1||q===!0)return;if(typeof Node<"u"&&q instanceof Node){if(q.nodeType===Node.TEXT_NODE)return q.textContent??"";return q.outerHTML??q.textContent??void 0}if(D(q))return Y(q.value);if(typeof q==="string"||typeof q==="number"||typeof q==="bigint")return String(q);if(typeof q==="object"&&q!==null&&"outerHTML"in q)return typeof q.outerHTML==="string"?q.outerHTML:q.textContent??void 0;if(z(q))return Array.from(q,(w)=>Y(w)??"").join("");return}function I(q,w,G){let Q=w.get($(q.name));if(Q&&Q.length>0)return Q.length===1?Q[0]:Q;if(q.fallback===void 0)return"";return G(q.fallback)}
2
- export{k as hb,J as ib,x as jb,P as kb,R as lb,f as mb,T as nb,j as ob};
3
-
4
- //# debugId=072C43197CC7C57F64756E2164756E21