@ecopages/radiant 0.3.0-alpha.0 → 0.3.0-alpha.10

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 (463) hide show
  1. package/README.md +72 -57
  2. package/dist/LICENSE +21 -0
  3. package/dist/client/app-bootstrap.d.ts +19 -0
  4. package/dist/client/app-bootstrap.js +3 -0
  5. package/dist/client/app-bootstrap.js.map +10 -0
  6. package/dist/client/hydrator.d.ts +19 -0
  7. package/dist/client/hydrator.js +3 -0
  8. package/dist/client/hydrator.js.map +11 -0
  9. package/dist/client/install-hydrator.d.ts +1 -0
  10. package/dist/client/install-hydrator.js +3 -0
  11. package/dist/client/install-hydrator.js.map +12 -0
  12. package/dist/context/context-consumer-bootstrap.d.ts +7 -6
  13. package/dist/context/context-consumer-bootstrap.js +2 -2
  14. package/dist/context/context-consumer-bootstrap.js.map +8 -3
  15. package/dist/context/context-consumer-runtime.d.ts +21 -8
  16. package/dist/context/context-consumer-runtime.js +2 -2
  17. package/dist/context/context-consumer-runtime.js.map +6 -3
  18. package/dist/context/context-host.d.ts +25 -0
  19. package/dist/context/context-host.js +3 -0
  20. package/dist/context/context-host.js.map +10 -0
  21. package/dist/context/context-provider.d.ts +10 -6
  22. package/dist/context/context-provider.js +2 -2
  23. package/dist/context/context-provider.js.map +9 -3
  24. package/dist/context/context-ssr-bridge.js +2 -2
  25. package/dist/context/context-ssr-bridge.js.map +4 -3
  26. package/dist/context/create-context.js +2 -2
  27. package/dist/context/create-context.js.map +4 -3
  28. package/dist/context/decorators/consume-context.d.ts +5 -2
  29. package/dist/context/decorators/consume-context.js +2 -2
  30. package/dist/context/decorators/consume-context.js.map +13 -3
  31. package/dist/context/decorators/context-selection-delivery.d.ts +1 -1
  32. package/dist/context/decorators/context-selection-delivery.js +2 -2
  33. package/dist/context/decorators/context-selection-delivery.js.map +5 -3
  34. package/dist/context/decorators/context-selector.d.ts +6 -11
  35. package/dist/context/decorators/context-selector.js +2 -2
  36. package/dist/context/decorators/context-selector.js.map +15 -3
  37. package/dist/context/decorators/legacy/consume-context.d.ts +2 -2
  38. package/dist/context/decorators/legacy/consume-context.js +2 -2
  39. package/dist/context/decorators/legacy/consume-context.js.map +10 -3
  40. package/dist/context/decorators/legacy/context-selector-field.d.ts +2 -2
  41. package/dist/context/decorators/legacy/context-selector-field.js +2 -2
  42. package/dist/context/decorators/legacy/context-selector-field.js.map +11 -3
  43. package/dist/context/decorators/legacy/context-selector.d.ts +2 -2
  44. package/dist/context/decorators/legacy/context-selector.js +2 -2
  45. package/dist/context/decorators/legacy/context-selector.js.map +11 -3
  46. package/dist/context/decorators/legacy/provide-context.d.ts +2 -2
  47. package/dist/context/decorators/legacy/provide-context.js +2 -2
  48. package/dist/context/decorators/legacy/provide-context.js.map +11 -3
  49. package/dist/context/decorators/on-context-update.d.ts +5 -5
  50. package/dist/context/decorators/on-context-update.js +2 -2
  51. package/dist/context/decorators/on-context-update.js.map +14 -3
  52. package/dist/context/decorators/provide-context.d.ts +5 -2
  53. package/dist/context/decorators/provide-context.js +2 -2
  54. package/dist/context/decorators/provide-context.js.map +14 -3
  55. package/dist/context/decorators/standard/consume-context.d.ts +2 -2
  56. package/dist/context/decorators/standard/consume-context.js +2 -2
  57. package/dist/context/decorators/standard/consume-context.js.map +9 -3
  58. package/dist/context/decorators/standard/context-selector-field.d.ts +2 -2
  59. package/dist/context/decorators/standard/context-selector-field.js +2 -2
  60. package/dist/context/decorators/standard/context-selector-field.js.map +10 -3
  61. package/dist/context/decorators/standard/context-selector.d.ts +2 -3
  62. package/dist/context/decorators/standard/context-selector.js +2 -2
  63. package/dist/context/decorators/standard/context-selector.js.map +10 -3
  64. package/dist/context/decorators/standard/provide-context.d.ts +2 -2
  65. package/dist/context/decorators/standard/provide-context.js +2 -2
  66. package/dist/context/decorators/standard/provide-context.js.map +10 -3
  67. package/dist/context/events.d.ts +18 -11
  68. package/dist/context/events.js +2 -2
  69. package/dist/context/events.js.map +4 -3
  70. package/dist/context/hydration-script.d.ts +0 -4
  71. package/dist/context/hydration-script.js +2 -2
  72. package/dist/context/hydration-script.js.map +6 -3
  73. package/dist/context/index.d.ts +8 -0
  74. package/dist/context/index.js +3 -0
  75. package/dist/context/index.js.map +35 -0
  76. package/dist/controller-registry.d.ts +38 -0
  77. package/dist/controller-registry.js +3 -0
  78. package/dist/controller-registry.js.map +11 -0
  79. package/dist/core/controller-metadata.d.ts +3 -0
  80. package/dist/core/controller-metadata.js +3 -0
  81. package/dist/core/controller-metadata.js.map +10 -0
  82. package/dist/core/custom-element-metadata.d.ts +11 -0
  83. package/dist/core/custom-element-metadata.js +2 -2
  84. package/dist/core/custom-element-metadata.js.map +4 -3
  85. package/dist/core/hydration-codec.d.ts +8 -1
  86. package/dist/core/hydration-codec.js +2 -2
  87. package/dist/core/hydration-codec.js.map +5 -3
  88. package/dist/core/radiant-component-ssr-registry.d.ts +54 -0
  89. package/dist/core/radiant-component-ssr-registry.js +3 -0
  90. package/dist/core/radiant-component-ssr-registry.js.map +10 -0
  91. package/dist/core/radiant-component-ssr.d.ts +3 -3
  92. package/dist/core/radiant-component-ssr.js +2 -2
  93. package/dist/core/radiant-component-ssr.js.map +8 -3
  94. package/dist/core/radiant-controller.d.ts +128 -0
  95. package/dist/core/radiant-controller.js +3 -0
  96. package/dist/core/radiant-controller.js.map +13 -0
  97. package/dist/core/radiant-element.d.ts +80 -41
  98. package/dist/core/radiant-element.js +2 -2
  99. package/dist/core/radiant-element.js.map +13 -3
  100. package/dist/core/radiant-hydrator-state.d.ts +20 -0
  101. package/dist/core/radiant-hydrator-state.js +3 -0
  102. package/dist/core/radiant-hydrator-state.js.map +10 -0
  103. package/dist/core/reactive-host.d.ts +137 -0
  104. package/dist/core/reactive-host.js +3 -0
  105. package/dist/core/reactive-host.js.map +10 -0
  106. package/dist/core/reactive-jsx-value.js +2 -2
  107. package/dist/core/reactive-jsx-value.js.map +4 -3
  108. package/dist/core/reactive-prop-metadata.js +2 -2
  109. package/dist/core/reactive-prop-metadata.js.map +4 -3
  110. package/dist/core/{slot-projection.d.ts → slot-projection-runtime.d.ts} +0 -20
  111. package/dist/core/slot-projection-runtime.js +3 -0
  112. package/dist/core/slot-projection-runtime.js.map +12 -0
  113. package/dist/core/ssr-preparation.js +2 -2
  114. package/dist/core/ssr-preparation.js.map +4 -3
  115. package/dist/decorators/attr.d.ts +6 -0
  116. package/dist/decorators/attr.js +3 -0
  117. package/dist/decorators/attr.js.map +16 -0
  118. package/dist/decorators/bound.d.ts +4 -2
  119. package/dist/decorators/bound.js +2 -2
  120. package/dist/decorators/bound.js.map +7 -3
  121. package/dist/decorators/bridge.d.ts +11 -7
  122. package/dist/decorators/bridge.js +2 -2
  123. package/dist/decorators/bridge.js.map +4 -3
  124. package/dist/decorators/controller.d.ts +2 -0
  125. package/dist/decorators/controller.js +3 -0
  126. package/dist/decorators/controller.js.map +12 -0
  127. package/dist/decorators/custom-element.d.ts +4 -2
  128. package/dist/decorators/custom-element.js +2 -2
  129. package/dist/decorators/custom-element.js.map +7 -3
  130. package/dist/decorators/debounce.d.ts +5 -2
  131. package/dist/decorators/debounce.js +2 -2
  132. package/dist/decorators/debounce.js.map +8 -3
  133. package/dist/decorators/event.d.ts +5 -2
  134. package/dist/decorators/event.js +2 -2
  135. package/dist/decorators/event.js.map +10 -3
  136. package/dist/decorators/legacy/attr.d.ts +2 -0
  137. package/dist/decorators/legacy/attr.js +3 -0
  138. package/dist/decorators/legacy/attr.js.map +13 -0
  139. package/dist/decorators/legacy/bound.js +2 -2
  140. package/dist/decorators/legacy/bound.js.map +4 -3
  141. package/dist/decorators/legacy/custom-element.js +2 -2
  142. package/dist/decorators/legacy/custom-element.js.map +5 -3
  143. package/dist/decorators/legacy/debounce.js +2 -2
  144. package/dist/decorators/legacy/debounce.js.map +5 -3
  145. package/dist/decorators/legacy/event.js +2 -2
  146. package/dist/decorators/legacy/event.js.map +7 -3
  147. package/dist/decorators/legacy/instance-initializers.d.ts +3 -4
  148. package/dist/decorators/legacy/instance-initializers.js +2 -2
  149. package/dist/decorators/legacy/instance-initializers.js.map +4 -3
  150. package/dist/decorators/legacy/on-event.d.ts +2 -2
  151. package/dist/decorators/legacy/on-event.js +2 -2
  152. package/dist/decorators/legacy/on-event.js.map +7 -3
  153. package/dist/decorators/legacy/on-updated.d.ts +7 -2
  154. package/dist/decorators/legacy/on-updated.js +2 -2
  155. package/dist/decorators/legacy/on-updated.js.map +5 -3
  156. package/dist/decorators/legacy/query-slot.d.ts +1 -1
  157. package/dist/decorators/legacy/query-slot.js +2 -2
  158. package/dist/decorators/legacy/query-slot.js.map +7 -3
  159. package/dist/decorators/legacy/query.d.ts +7 -2
  160. package/dist/decorators/legacy/query.js +2 -2
  161. package/dist/decorators/legacy/query.js.map +6 -3
  162. package/dist/decorators/legacy/reactive-field.d.ts +2 -2
  163. package/dist/decorators/legacy/reactive-field.js +2 -2
  164. package/dist/decorators/legacy/reactive-field.js.map +5 -3
  165. package/dist/decorators/legacy/reactive-prop.d.ts +10 -16
  166. package/dist/decorators/legacy/reactive-prop.js +2 -2
  167. package/dist/decorators/legacy/reactive-prop.js.map +7 -3
  168. package/dist/decorators/legacy/signal.d.ts +4 -3
  169. package/dist/decorators/legacy/signal.js +2 -2
  170. package/dist/decorators/legacy/signal.js.map +9 -3
  171. package/dist/decorators/on-event.d.ts +6 -3
  172. package/dist/decorators/on-event.js +2 -2
  173. package/dist/decorators/on-event.js.map +10 -3
  174. package/dist/decorators/on-updated.d.ts +12 -2
  175. package/dist/decorators/on-updated.js +2 -2
  176. package/dist/decorators/on-updated.js.map +8 -3
  177. package/dist/decorators/prop.d.ts +19 -7
  178. package/dist/decorators/prop.js +2 -2
  179. package/dist/decorators/prop.js.map +10 -3
  180. package/dist/decorators/query-slot.d.ts +7 -3
  181. package/dist/decorators/query-slot.js +2 -2
  182. package/dist/decorators/query-slot.js.map +10 -3
  183. package/dist/decorators/query.d.ts +9 -2
  184. package/dist/decorators/query.js +2 -2
  185. package/dist/decorators/query.js.map +9 -3
  186. package/dist/decorators/shared/reactive-attr.d.ts +25 -0
  187. package/dist/decorators/shared/reactive-attr.js +3 -0
  188. package/dist/decorators/shared/reactive-attr.js.map +11 -0
  189. package/dist/decorators/signal.d.ts +10 -4
  190. package/dist/decorators/signal.js +2 -2
  191. package/dist/decorators/signal.js.map +11 -3
  192. package/dist/decorators/standard/attr.d.ts +2 -0
  193. package/dist/decorators/standard/attr.js +3 -0
  194. package/dist/decorators/standard/attr.js.map +12 -0
  195. package/dist/decorators/standard/bound.js +2 -2
  196. package/dist/decorators/standard/bound.js.map +4 -3
  197. package/dist/decorators/standard/custom-element.js +2 -2
  198. package/dist/decorators/standard/custom-element.js.map +5 -3
  199. package/dist/decorators/standard/debounce.js +2 -2
  200. package/dist/decorators/standard/debounce.js.map +5 -3
  201. package/dist/decorators/standard/event.js +2 -2
  202. package/dist/decorators/standard/event.js.map +6 -3
  203. package/dist/decorators/standard/on-event.d.ts +2 -1
  204. package/dist/decorators/standard/on-event.js +2 -2
  205. package/dist/decorators/standard/on-event.js.map +6 -3
  206. package/dist/decorators/standard/on-updated.d.ts +5 -1
  207. package/dist/decorators/standard/on-updated.js +2 -2
  208. package/dist/decorators/standard/on-updated.js.map +4 -3
  209. package/dist/decorators/standard/query-slot.d.ts +1 -1
  210. package/dist/decorators/standard/query-slot.js +2 -2
  211. package/dist/decorators/standard/query-slot.js.map +5 -3
  212. package/dist/decorators/standard/query.d.ts +2 -1
  213. package/dist/decorators/standard/query.js +2 -2
  214. package/dist/decorators/standard/query.js.map +5 -3
  215. package/dist/decorators/standard/reactive-field.d.ts +2 -2
  216. package/dist/decorators/standard/reactive-field.js +2 -2
  217. package/dist/decorators/standard/reactive-field.js.map +4 -3
  218. package/dist/decorators/standard/reactive-prop.d.ts +13 -2
  219. package/dist/decorators/standard/reactive-prop.js +2 -2
  220. package/dist/decorators/standard/reactive-prop.js.map +6 -3
  221. package/dist/decorators/standard/signal.d.ts +4 -3
  222. package/dist/decorators/standard/signal.js +2 -2
  223. package/dist/decorators/standard/signal.js.map +8 -3
  224. package/dist/decorators/state.d.ts +6 -5
  225. package/dist/decorators/state.js +2 -2
  226. package/dist/decorators/state.js.map +8 -3
  227. package/dist/helpers/create-event-listener.d.ts +11 -2
  228. package/dist/helpers/create-event-listener.js +2 -2
  229. package/dist/helpers/create-event-listener.js.map +5 -3
  230. package/dist/helpers/create-event.js +2 -2
  231. package/dist/helpers/create-event.js.map +5 -3
  232. package/dist/helpers/create-query-slot.d.ts +2 -2
  233. package/dist/helpers/create-query-slot.js +2 -2
  234. package/dist/helpers/create-query-slot.js.map +4 -3
  235. package/dist/helpers/create-query.d.ts +14 -3
  236. package/dist/helpers/create-query.js +2 -2
  237. package/dist/helpers/create-query.js.map +4 -3
  238. package/dist/helpers/debounce.js +2 -2
  239. package/dist/helpers/debounce.js.map +4 -3
  240. package/dist/helpers/index.js +2 -2
  241. package/dist/helpers/index.js.map +10 -3
  242. package/dist/index.d.ts +4 -12
  243. package/dist/index.js +2 -2
  244. package/dist/index.js.map +66 -3
  245. package/dist/server/context-ssr.js +2 -2
  246. package/dist/server/context-ssr.js.map +5 -3
  247. package/dist/server/html-parser.d.ts +21 -0
  248. package/dist/server/html-parser.js +3 -0
  249. package/dist/server/html-parser.js.map +10 -0
  250. package/dist/server/install-light-dom-shim.js +2 -2
  251. package/dist/server/install-light-dom-shim.js.map +5 -3
  252. package/dist/server/light-dom-shim.d.ts +9 -0
  253. package/dist/server/light-dom-shim.js +2 -2
  254. package/dist/server/light-dom-shim.js.map +5 -3
  255. package/dist/server/project-root.js +2 -2
  256. package/dist/server/project-root.js.map +2 -2
  257. package/dist/server/radiant-component-ssr-runtime.d.ts +9 -0
  258. package/dist/server/radiant-component-ssr-runtime.js +3 -0
  259. package/dist/server/radiant-component-ssr-runtime.js.map +17 -0
  260. package/dist/server/render-component.d.ts +7 -17
  261. package/dist/server/render-component.js +2 -2
  262. package/dist/server/render-component.js.map +14 -4
  263. package/dist/server/render-controller.d.ts +57 -0
  264. package/dist/server/render-controller.js +3 -0
  265. package/dist/server/render-controller.js.map +23 -0
  266. package/dist/server/slot-projection-html.d.ts +3 -0
  267. package/dist/server/slot-projection-html.js +3 -0
  268. package/dist/server/slot-projection-html.js.map +14 -0
  269. package/dist/signals/host-resource.js +2 -2
  270. package/dist/signals/host-resource.js.map +2 -2
  271. package/dist/signals/host-signal.d.ts +4 -2
  272. package/dist/signals/host-signal.js +2 -2
  273. package/dist/signals/host-signal.js.map +7 -3
  274. package/dist/signals/hydration-script.d.ts +0 -4
  275. package/dist/signals/hydration-script.js +2 -2
  276. package/dist/signals/hydration-script.js.map +6 -3
  277. package/dist/tools/escape-css-identifier.d.ts +1 -0
  278. package/dist/tools/escape-css-identifier.js +3 -0
  279. package/dist/tools/escape-css-identifier.js.map +10 -0
  280. package/dist/tools/escape-script-json.js +2 -2
  281. package/dist/tools/escape-script-json.js.map +4 -3
  282. package/dist/tools/event-emitter.js +2 -2
  283. package/dist/tools/event-emitter.js.map +4 -3
  284. package/dist/tools/index.d.ts +1 -1
  285. package/dist/tools/index.js +2 -2
  286. package/dist/tools/index.js.map +7 -3
  287. package/dist/tools/render-jsx-template.js +2 -2
  288. package/dist/tools/render-jsx-template.js.map +4 -3
  289. package/dist/types.d.ts +0 -21
  290. package/dist/types.js +2 -2
  291. package/dist/types.js.map +3 -3
  292. package/dist/utils/attribute-utils.js +2 -2
  293. package/dist/utils/attribute-utils.js.map +4 -3
  294. package/dist/utils/index.js +2 -2
  295. package/dist/utils/index.js.map +4 -3
  296. package/package.json +41 -8
  297. package/size-budget.json +12 -9
  298. package/dist/chunk-0y78f8hj.js +0 -4
  299. package/dist/chunk-0y78f8hj.js.map +0 -10
  300. package/dist/chunk-0zq7e1ne.js +0 -4
  301. package/dist/chunk-0zq7e1ne.js.map +0 -10
  302. package/dist/chunk-13ydx769.js +0 -4
  303. package/dist/chunk-13ydx769.js.map +0 -10
  304. package/dist/chunk-147yvtsn.js +0 -4
  305. package/dist/chunk-147yvtsn.js.map +0 -10
  306. package/dist/chunk-17earqbr.js +0 -4
  307. package/dist/chunk-17earqbr.js.map +0 -10
  308. package/dist/chunk-1w1dm68j.js +0 -4
  309. package/dist/chunk-1w1dm68j.js.map +0 -10
  310. package/dist/chunk-2tgrfv09.js +0 -4
  311. package/dist/chunk-2tgrfv09.js.map +0 -10
  312. package/dist/chunk-3b033cgq.js +0 -4
  313. package/dist/chunk-3b033cgq.js.map +0 -10
  314. package/dist/chunk-42tyhfvh.js +0 -4
  315. package/dist/chunk-42tyhfvh.js.map +0 -10
  316. package/dist/chunk-4cc2syf5.js +0 -4
  317. package/dist/chunk-4cc2syf5.js.map +0 -10
  318. package/dist/chunk-4fqkmpra.js +0 -4
  319. package/dist/chunk-4fqkmpra.js.map +0 -10
  320. package/dist/chunk-4srpf0y5.js +0 -4
  321. package/dist/chunk-4srpf0y5.js.map +0 -10
  322. package/dist/chunk-57w3vmme.js +0 -4
  323. package/dist/chunk-57w3vmme.js.map +0 -10
  324. package/dist/chunk-5a2xez36.js +0 -4
  325. package/dist/chunk-5a2xez36.js.map +0 -10
  326. package/dist/chunk-5bym7y1d.js +0 -4
  327. package/dist/chunk-5bym7y1d.js.map +0 -10
  328. package/dist/chunk-5td6v9k3.js +0 -4
  329. package/dist/chunk-5td6v9k3.js.map +0 -10
  330. package/dist/chunk-60015zxq.js +0 -4
  331. package/dist/chunk-60015zxq.js.map +0 -10
  332. package/dist/chunk-60q4y3k5.js +0 -4
  333. package/dist/chunk-60q4y3k5.js.map +0 -10
  334. package/dist/chunk-6kdxrppw.js +0 -4
  335. package/dist/chunk-6kdxrppw.js.map +0 -10
  336. package/dist/chunk-6z34stya.js +0 -4
  337. package/dist/chunk-6z34stya.js.map +0 -10
  338. package/dist/chunk-73x7jpdd.js +0 -4
  339. package/dist/chunk-73x7jpdd.js.map +0 -10
  340. package/dist/chunk-84fc8cz9.js +0 -4
  341. package/dist/chunk-84fc8cz9.js.map +0 -10
  342. package/dist/chunk-8dexhy6c.js +0 -4
  343. package/dist/chunk-8dexhy6c.js.map +0 -10
  344. package/dist/chunk-8n2dhx28.js +0 -4
  345. package/dist/chunk-8n2dhx28.js.map +0 -10
  346. package/dist/chunk-8tvt04cm.js +0 -4
  347. package/dist/chunk-8tvt04cm.js.map +0 -10
  348. package/dist/chunk-8vak8w5w.js +0 -4
  349. package/dist/chunk-8vak8w5w.js.map +0 -10
  350. package/dist/chunk-8xy18qmz.js +0 -4
  351. package/dist/chunk-8xy18qmz.js.map +0 -9
  352. package/dist/chunk-9554n9t4.js +0 -4
  353. package/dist/chunk-9554n9t4.js.map +0 -10
  354. package/dist/chunk-9ascmjk3.js +0 -4
  355. package/dist/chunk-9ascmjk3.js.map +0 -10
  356. package/dist/chunk-9gjmqxp2.js +0 -4
  357. package/dist/chunk-9gjmqxp2.js.map +0 -10
  358. package/dist/chunk-a7hzs37s.js +0 -4
  359. package/dist/chunk-a7hzs37s.js.map +0 -10
  360. package/dist/chunk-aajhkdmn.js +0 -4
  361. package/dist/chunk-aajhkdmn.js.map +0 -10
  362. package/dist/chunk-agjb2a3r.js +0 -4
  363. package/dist/chunk-agjb2a3r.js.map +0 -10
  364. package/dist/chunk-ak97hp4w.js +0 -4
  365. package/dist/chunk-ak97hp4w.js.map +0 -10
  366. package/dist/chunk-bmhn4nbp.js +0 -4
  367. package/dist/chunk-bmhn4nbp.js.map +0 -10
  368. package/dist/chunk-c8vqg7r1.js +0 -4
  369. package/dist/chunk-c8vqg7r1.js.map +0 -10
  370. package/dist/chunk-cbvd18v1.js +0 -4
  371. package/dist/chunk-cbvd18v1.js.map +0 -10
  372. package/dist/chunk-chyn72n9.js +0 -4
  373. package/dist/chunk-chyn72n9.js.map +0 -10
  374. package/dist/chunk-cvz9mrxa.js +0 -4
  375. package/dist/chunk-cvz9mrxa.js.map +0 -10
  376. package/dist/chunk-d0n7njdy.js +0 -4
  377. package/dist/chunk-d0n7njdy.js.map +0 -10
  378. package/dist/chunk-d4v5qpxa.js +0 -4
  379. package/dist/chunk-d4v5qpxa.js.map +0 -10
  380. package/dist/chunk-d7hh3ze6.js +0 -4
  381. package/dist/chunk-d7hh3ze6.js.map +0 -10
  382. package/dist/chunk-d98q3myg.js +0 -4
  383. package/dist/chunk-d98q3myg.js.map +0 -10
  384. package/dist/chunk-dscj0sk9.js +0 -4
  385. package/dist/chunk-dscj0sk9.js.map +0 -10
  386. package/dist/chunk-dx1wqc00.js +0 -4
  387. package/dist/chunk-dx1wqc00.js.map +0 -10
  388. package/dist/chunk-g0gz7ypq.js +0 -4
  389. package/dist/chunk-g0gz7ypq.js.map +0 -10
  390. package/dist/chunk-hkmm3dj9.js +0 -4
  391. package/dist/chunk-hkmm3dj9.js.map +0 -10
  392. package/dist/chunk-hn4j8rt5.js +0 -4
  393. package/dist/chunk-hn4j8rt5.js.map +0 -10
  394. package/dist/chunk-jce9gqqw.js +0 -4
  395. package/dist/chunk-jce9gqqw.js.map +0 -10
  396. package/dist/chunk-jg20mzg8.js +0 -4
  397. package/dist/chunk-jg20mzg8.js.map +0 -10
  398. package/dist/chunk-jkb2y7c8.js +0 -4
  399. package/dist/chunk-jkb2y7c8.js.map +0 -10
  400. package/dist/chunk-k5hr781q.js +0 -4
  401. package/dist/chunk-k5hr781q.js.map +0 -10
  402. package/dist/chunk-ksv01cey.js +0 -4
  403. package/dist/chunk-ksv01cey.js.map +0 -10
  404. package/dist/chunk-mpjnqmbq.js +0 -4
  405. package/dist/chunk-mpjnqmbq.js.map +0 -10
  406. package/dist/chunk-mqxmfvyp.js +0 -4
  407. package/dist/chunk-mqxmfvyp.js.map +0 -10
  408. package/dist/chunk-ms6a9zdt.js +0 -4
  409. package/dist/chunk-ms6a9zdt.js.map +0 -10
  410. package/dist/chunk-nerd6fmg.js +0 -4
  411. package/dist/chunk-nerd6fmg.js.map +0 -10
  412. package/dist/chunk-nw171z6m.js +0 -4
  413. package/dist/chunk-nw171z6m.js.map +0 -10
  414. package/dist/chunk-p6pxdvkk.js +0 -4
  415. package/dist/chunk-p6pxdvkk.js.map +0 -10
  416. package/dist/chunk-paehjz94.js +0 -4
  417. package/dist/chunk-paehjz94.js.map +0 -10
  418. package/dist/chunk-par0t822.js +0 -4
  419. package/dist/chunk-par0t822.js.map +0 -10
  420. package/dist/chunk-qaagk55a.js +0 -4
  421. package/dist/chunk-qaagk55a.js.map +0 -10
  422. package/dist/chunk-qbnedp0y.js +0 -4
  423. package/dist/chunk-qbnedp0y.js.map +0 -10
  424. package/dist/chunk-qd28hvdx.js +0 -4
  425. package/dist/chunk-qd28hvdx.js.map +0 -10
  426. package/dist/chunk-qdj6r8jn.js +0 -4
  427. package/dist/chunk-qdj6r8jn.js.map +0 -10
  428. package/dist/chunk-qe6sjr27.js +0 -4
  429. package/dist/chunk-qe6sjr27.js.map +0 -10
  430. package/dist/chunk-r1cvaz1t.js +0 -4
  431. package/dist/chunk-r1cvaz1t.js.map +0 -10
  432. package/dist/chunk-r75y7ydb.js +0 -4
  433. package/dist/chunk-r75y7ydb.js.map +0 -10
  434. package/dist/chunk-s4qgct1z.js +0 -4
  435. package/dist/chunk-s4qgct1z.js.map +0 -10
  436. package/dist/chunk-scfk041e.js +0 -4
  437. package/dist/chunk-scfk041e.js.map +0 -10
  438. package/dist/chunk-t6x9e177.js +0 -4
  439. package/dist/chunk-t6x9e177.js.map +0 -10
  440. package/dist/chunk-t7a1bbxq.js +0 -4
  441. package/dist/chunk-t7a1bbxq.js.map +0 -10
  442. package/dist/chunk-tyysm4gk.js +0 -4
  443. package/dist/chunk-tyysm4gk.js.map +0 -10
  444. package/dist/chunk-vpfm9yw8.js +0 -4
  445. package/dist/chunk-vpfm9yw8.js.map +0 -10
  446. package/dist/chunk-w50v38rv.js +0 -4
  447. package/dist/chunk-w50v38rv.js.map +0 -10
  448. package/dist/chunk-x0522ksh.js +0 -4
  449. package/dist/chunk-x0522ksh.js.map +0 -10
  450. package/dist/chunk-xd1xn3vy.js +0 -4
  451. package/dist/chunk-xd1xn3vy.js.map +0 -10
  452. package/dist/chunk-zb7wh7w4.js +0 -4
  453. package/dist/chunk-zb7wh7w4.js.map +0 -10
  454. package/dist/chunk-zj9ez73m.js +0 -4
  455. package/dist/chunk-zj9ez73m.js.map +0 -10
  456. package/dist/core/radiant-component.d.ts +0 -106
  457. package/dist/core/radiant-component.js +0 -3
  458. package/dist/core/radiant-component.js.map +0 -9
  459. package/dist/core/slot-projection.js +0 -3
  460. package/dist/core/slot-projection.js.map +0 -9
  461. package/dist/tools/stringify-typed.d.ts +0 -16
  462. package/dist/tools/stringify-typed.js +0 -3
  463. package/dist/tools/stringify-typed.js.map +0 -9
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "import { asyncState, state, type AsyncStateFetcherOptions, type AsyncStateResult } from '@ecopages/signals';\nimport type { RadiantElement } from '../core/radiant-element';\n\nexport type ResourceContext<Host extends RadiantElement> = {\n\thost: Host;\n};\n\nexport type ResourceRequestContext<Host extends RadiantElement> = ResourceContext<Host> & AsyncStateFetcherOptions;\n\ntype HostResourceBaseConfig<Host extends RadiantElement, Value> = {\n\t/** Seed value exposed from `data` before the first successful resolution. */\n\tinitialValue?: Value;\n\n\t/** Milliseconds a successful response stays fresh in the per-instance cache. */\n\tstaleTime?: number;\n\n\t/** Milliseconds to wait before transitioning `status` to `'pending'`. */\n\tpendingDelay?: number;\n\n\t/** Called after each successful resolution, including cache hits. */\n\tonSuccess?: (data: Value, ctx: ResourceContext<Host>) => void;\n\n\t/** Called after each failed resolution. Not called for aborted requests. */\n\tonError?: (error: unknown, ctx: ResourceContext<Host>) => void;\n\n\t/** Called after each resolution, whether successful or failed. */\n\tonSettled?: (data: Value | undefined, error: unknown, ctx: ResourceContext<Host>) => void;\n};\n\n/** Configuration for a host-owned resource that fetches on connect. */\nexport interface HostResourceConfig<Host extends RadiantElement, Value> extends HostResourceBaseConfig<Host, Value> {\n\tfetcher: (ctx: ResourceRequestContext<Host>) => Promise<Value>;\n\tsource?: undefined;\n}\n\n/** Configuration for a host-owned resource driven by a reactive source. */\nexport interface HostResourceSourcedConfig<Host extends RadiantElement, Source, Value> extends HostResourceBaseConfig<\n\tHost,\n\tValue\n> {\n\t/**\n\t * Returns the current source value while the host is connected.\n\t *\n\t * Falsy values (`false`, `null`, `undefined`) disable fetching and preserve\n\t * the current resource state.\n\t */\n\tsource: (ctx: ResourceContext<Host>) => Source | false | null | undefined;\n\n\tfetcher: (sourceValue: Source, ctx: ResourceRequestContext<Host>) => Promise<Value>;\n}\n\nexport class HostResource<Host extends RadiantElement, Value, Source = never> implements AsyncStateResult<Value> {\n\treadonly data: AsyncStateResult<Value>['data'];\n\treadonly status: AsyncStateResult<Value>['status'];\n\treadonly error: AsyncStateResult<Value>['error'];\n\n\tprivate readonly connected = state(false);\n\tprivate readonly resource: AsyncStateResult<Value>;\n\tprivate disposed = false;\n\n\tconstructor(host: Host, config: HostResourceConfig<Host, Value> | HostResourceSourcedConfig<Host, Source, Value>) {\n\t\tconst context: ResourceContext<Host> = { host };\n\t\tconst baseConfig = {\n\t\t\tinitialValue: config.initialValue,\n\t\t\tpendingDelay: config.pendingDelay,\n\t\t\tstaleTime: config.staleTime,\n\t\t\tonError: (error: unknown) => {\n\t\t\t\tconfig.onError?.(error, context);\n\t\t\t},\n\t\t\tonSettled: (data: Value | undefined, error: unknown) => {\n\t\t\t\tconfig.onSettled?.(data, error, context);\n\t\t\t},\n\t\t\tonSuccess: (data: Value) => {\n\t\t\t\tconfig.onSuccess?.(data, context);\n\t\t\t},\n\t\t};\n\n\t\tif (config.source) {\n\t\t\tthis.resource = asyncState({\n\t\t\t\t...baseConfig,\n\t\t\t\tsource: () => {\n\t\t\t\t\tif (this.disposed || !this.connected.get()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn config.source(context);\n\t\t\t\t},\n\t\t\t\tfetcher: (sourceValue, options) => config.fetcher(sourceValue as Source, { ...context, ...options }),\n\t\t\t});\n\t\t} else {\n\t\t\tthis.resource = asyncState({\n\t\t\t\t...baseConfig,\n\t\t\t\tsource: () => {\n\t\t\t\t\tif (this.disposed || !this.connected.get()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\t\t\t\t},\n\t\t\t\tfetcher: (_connected, options) => config.fetcher({ ...context, ...options }),\n\t\t\t});\n\t\t}\n\n\t\tthis.data = this.resource.data;\n\t\tthis.status = this.resource.status;\n\t\tthis.error = this.resource.error;\n\t}\n\n\tpublic connect(): void {\n\t\tif (this.disposed || this.connected.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connected.set(true);\n\t}\n\n\tpublic disconnect(): void {\n\t\tif (this.disposed || !this.connected.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.connected.set(false);\n\t\tthis.resource.abort();\n\t}\n\n\tpublic refetch(): void {\n\t\tif (this.disposed || !this.connected.get()) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resource.refetch();\n\t}\n\n\tpublic abort(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.resource.abort();\n\t}\n\n\tpublic dispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.connected.set(false);\n\t\tthis.resource.dispose();\n\t}\n}\n\nexport function createHostResource<Host extends RadiantElement, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value>,\n): HostResource<Host, Value>;\nexport function createHostResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source>;\nexport function createHostResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value> | HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source> {\n\treturn new HostResource<Host, Value, Source>(host, config);\n}\n\n/**\n * Creates a host-owned resource and registers connect/disconnect lifecycle\n * hooks on the provided host.\n */\nexport function createResource<Host extends RadiantElement, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value>,\n): HostResource<Host, Value>;\nexport function createResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source>;\nexport function createResource<Host extends RadiantElement, Source, Value>(\n\thost: Host,\n\tconfig: HostResourceConfig<Host, Value> | HostResourceSourcedConfig<Host, Source, Value>,\n): HostResource<Host, Value, Source> {\n\tconst hostResource = new HostResource<Host, Value, Source>(host, config);\n\n\thost.registerConnectedCallback(() => {\n\t\thostResource.connect();\n\t});\n\n\thost.registerCleanupCallback(() => {\n\t\thostResource.disconnect();\n\t});\n\n\treturn hostResource;\n}\n"
6
6
  ],
7
- "mappings": "6BAAA,qBAAS,WAAY,0BAmDd,MAAM,CAAoG,CACvG,KACA,OACA,MAEQ,UAAY,EAAM,EAAK,EACvB,SACT,SAAW,GAEnB,WAAW,CAAC,EAAY,EAA0F,CACjH,IAAM,EAAiC,CAAE,MAAK,EACxC,EAAa,CAClB,aAAc,EAAO,aACrB,aAAc,EAAO,aACrB,UAAW,EAAO,UAClB,QAAS,CAAC,IAAmB,CAC5B,EAAO,UAAU,EAAO,CAAO,GAEhC,UAAW,CAAC,EAAyB,IAAmB,CACvD,EAAO,YAAY,EAAM,EAAO,CAAO,GAExC,UAAW,CAAC,IAAgB,CAC3B,EAAO,YAAY,EAAM,CAAO,EAElC,EAEA,GAAI,EAAO,OACV,KAAK,SAAW,EAAW,IACvB,EACH,OAAQ,IAAM,CACb,GAAI,KAAK,UAAY,CAAC,KAAK,UAAU,IAAI,EACxC,MAAO,GAGR,OAAO,EAAO,OAAO,CAAO,GAE7B,QAAS,CAAC,EAAa,IAAY,EAAO,QAAQ,EAAuB,IAAK,KAAY,CAAQ,CAAC,CACpG,CAAC,EAED,UAAK,SAAW,EAAW,IACvB,EACH,OAAQ,IAAM,CACb,GAAI,KAAK,UAAY,CAAC,KAAK,UAAU,IAAI,EACxC,MAAO,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AAQ,EAExB,CAUO,SAAS,CAA8D,CAC7E,EACA,EACoC,CACpC,OAAO,IAAI,EAAkC,EAAM,CAAM,EAenD,SAAS,CAA0D,CACzE,EACA,EACoC,CACpC,IAAM,EAAe,IAAI,EAAkC,EAAM,CAAM,EAUvE,OARA,EAAK,0BAA0B,IAAM,CACpC,EAAa,QAAQ,EACrB,EAED,EAAK,wBAAwB,IAAM,CAClC,EAAa,WAAW,EACxB,EAEM",
8
+ "debugId": "B20E9C4650796DAC64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,10 +1,12 @@
1
1
  import { type JsxRenderable } from '@ecopages/jsx';
2
2
  import { type WritableSignal } from '@ecopages/signals';
3
3
  import type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';
4
- import type { RadiantElement } from '../core/radiant-element';
5
4
  import type { AttributeTypeConstant } from '../utils/attribute-utils';
5
+ type HostSignalOwner = {
6
+ notifyUpdate(property: string, oldValue: unknown, value: unknown): void;
7
+ };
6
8
  type HostSignalOptions<Value> = {
7
- host: RadiantElement;
9
+ host: HostSignalOwner;
8
10
  hydrate?: AttributeTypeConstant;
9
11
  hydrationKey?: string;
10
12
  initialValue?: Value;
@@ -1,3 +1,3 @@
1
- import{qa as a,ra as b,sa as c}from"../chunk-57w3vmme.js";import"../chunk-6z34stya.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{a as isWritableSignalLike,c as createHostSignal,b as HostSignal};
1
+ var K=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(G,Q)=>(typeof require<"u"?require:G)[Q]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});function J(q){return q.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var W="data-hydration",L="data-hydration-type",F="data-hydration-key";function M(q){let G=q.hydrationKey?` ${F}="${U(q.hydrationKey)}"`:"";return`<script type="application/json" ${W} ${L}="${q.type}"${G}>${q.serializedValue}</script>`}function P(q){return J(q)}function z(q,G){let Q=q.textContent;if(!Q)return G;try{return JSON.parse(Q)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${W}>:`,Q.slice(0,120));return G}}function g(q,G,Q){let Z=q.children;if(!Z||Z.length===0){let X=q.childNodes;if(!X||X.length===0)return null;for(let $=0;$<X.length;$+=1){let j=X[$];if(j.nodeType!==1)continue;let w=j;if(C(w,G,Q))return w}return null}for(let X=0;X<Z.length;X+=1)if(C(Z[X],G,Q))return Z[X];return null}function C(q,G,Q){if(q.tagName!=="SCRIPT"||!q.hasAttribute(W)||q.getAttribute(L)!==G)return!1;if(Q!==void 0)return q.getAttribute(F)===Q;return!q.hasAttribute(F)}function U(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function f(q){return M({type:"signal",...q})}function B(q){return P(q)}import{createMarkupNodeLike as O}from"@ecopages/jsx";import{state as b}from"@ecopages/signals";function m(q){return typeof q==="object"&&q!==null&&typeof q.get==="function"&&typeof q.set==="function"&&typeof q.subscribe==="function"&&typeof q.update==="function"}class D{host;hydrate;hydrationKey;property;source;currentValue;hasAppliedHostHydration=!1;sourceUnsubscribe;constructor(q){this.host=q.host,this.hydrate=q.hydrate,this.hydrationKey=q.hydrationKey,this.property=q.property,this.source=q.source??b(this.resolveInitialValue(q.initialValue)),this.currentValue=this.source.get()}get(){return this.source.get()}set(q){this.source.set(q)}subscribe(q){return this.source.subscribe(q)}update(q){this.set(q(this.get()))}connectToSource(){if(this.sourceUnsubscribe)return;let q=this.source.get();if(!Object.is(this.currentValue,q)){let G=this.currentValue;this.currentValue=q,this.host.notifyUpdate(this.property,G,q)}this.sourceUnsubscribe=this.source.subscribe((G)=>{this.handleSourceChange(G)})}disconnectFromSource(){this.sourceUnsubscribe?.(),this.sourceUnsubscribe=void 0}hydrateFromHost(){if(!this.hydrate||this.hasAppliedHostHydration)return;this.hasAppliedHostHydration=!0;let q=this.source.get(),G=this.resolveInitialValue(q);if(!Object.is(q,G))this.source.set(G),this.currentValue=this.source.get(),this.host.notifyUpdate(this.property,q,this.currentValue)}renderHydrationScript(){let q=this.renderHydrationScriptTag();if(!q)return;return O(q)}renderHydrationScriptTag(){let q=this.serializeHydrationValue();if(!q)return;return f({hydrationKey:this.hydrationKey,serializedValue:q})}findHydrationScriptElement(){if(!(this.host instanceof Element))return null;return g(this.host,"signal",this.hydrationKey)}isObject(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}resolveInitialValue(q){if(!this.hydrate)return q;let G=this.findHydrationScriptElement();if(!G)return q;let Q=z(G,q);if(this.hydrate===Object&&this.isObject(Q)&&this.isObject(q))return{...q,...Q};return Q}serializeHydrationValue(){if(!this.hydrate)return;let q=JSON.stringify(this.get());if(typeof q!=="string")return;return B(q)}handleSourceChange(q){let G=this.currentValue;if(this.currentValue=q,!Object.is(G,q))this.host.notifyUpdate(this.property,G,q)}}function H(q){return new D(q)}export{m as isWritableSignalLike,H as createHostSignal,D as HostSignal};
2
2
 
3
- //# debugId=2AA2BC54FCAB364764756E2164756E21
3
+ //# debugId=D824BBB0A9C2DA3964756E2164756E21
@@ -1,9 +1,13 @@
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", "../src/signals/host-signal.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",
8
+ "import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\nimport { state, type WritableSignal } from '@ecopages/signals';\nimport type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';\nimport type { AttributeTypeConstant } from '../utils/attribute-utils';\nimport { findHydrationScript, parseHydrationPayload } from '../core/hydration-codec';\nimport { createSignalHydrationScriptTag, escapeSignalHydrationJson } from './hydration-script';\n\ntype HostSignalOwner = {\n\tnotifyUpdate(property: string, oldValue: unknown, value: unknown): void;\n};\n\ntype HostSignalOptions<Value> = {\n\thost: HostSignalOwner;\n\thydrate?: AttributeTypeConstant;\n\thydrationKey?: string;\n\tinitialValue?: Value;\n\tproperty: string;\n\tsource?: WritableSignal<Value>;\n};\n\nexport function isWritableSignalLike<Value>(value: unknown): value is WritableSignal<Value> {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof (value as WritableSignal<Value>).get === 'function' &&\n\t\ttypeof (value as WritableSignal<Value>).set === 'function' &&\n\t\ttypeof (value as WritableSignal<Value>).subscribe === 'function' &&\n\t\ttypeof (value as WritableSignal<Value>).update === 'function'\n\t);\n}\n\n/**\n * Host-owned writable signal that bridges signal updates back into Radiant's\n * update callback channel and optional SSR hydration pipeline.\n */\nexport class HostSignal<Value> implements WritableSignal<Value>, SsrSerializableHydrationBinding {\n\tprivate readonly host: HostSignalOwner;\n\tprivate readonly hydrate?: AttributeTypeConstant;\n\tprivate readonly hydrationKey?: string;\n\tprivate readonly property: string;\n\tprivate readonly source: WritableSignal<Value>;\n\tprivate currentValue: Value;\n\tprivate hasAppliedHostHydration = false;\n\tprivate sourceUnsubscribe?: () => void;\n\n\tconstructor(options: HostSignalOptions<Value>) {\n\t\tthis.host = options.host;\n\t\tthis.hydrate = options.hydrate;\n\t\tthis.hydrationKey = options.hydrationKey;\n\t\tthis.property = options.property;\n\t\tthis.source = options.source ?? state(this.resolveInitialValue(options.initialValue as Value));\n\t\tthis.currentValue = this.source.get();\n\t}\n\n\tpublic get(): Value {\n\t\treturn this.source.get();\n\t}\n\n\tpublic set(nextValue: Value): void {\n\t\tthis.source.set(nextValue);\n\t}\n\n\tpublic subscribe(notify: (value: Value) => void): () => void {\n\t\treturn this.source.subscribe(notify);\n\t}\n\n\tpublic update(updater: (value: Value) => Value): void {\n\t\tthis.set(updater(this.get()));\n\t}\n\n\tpublic connectToSource(): void {\n\t\tif (this.sourceUnsubscribe) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextValue = this.source.get();\n\n\t\tif (!Object.is(this.currentValue, nextValue)) {\n\t\t\tconst previousValue = this.currentValue;\n\t\t\tthis.currentValue = nextValue;\n\t\t\tthis.host.notifyUpdate(this.property, previousValue, nextValue);\n\t\t}\n\n\t\tthis.sourceUnsubscribe = this.source.subscribe((value) => {\n\t\t\tthis.handleSourceChange(value);\n\t\t});\n\t}\n\n\tpublic disconnectFromSource(): void {\n\t\tthis.sourceUnsubscribe?.();\n\t\tthis.sourceUnsubscribe = undefined;\n\t}\n\n\tpublic hydrateFromHost(): void {\n\t\tif (!this.hydrate || this.hasAppliedHostHydration) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hasAppliedHostHydration = true;\n\n\t\tconst previousValue = this.source.get();\n\t\tconst hydratedValue = this.resolveInitialValue(previousValue);\n\n\t\tif (!Object.is(previousValue, hydratedValue)) {\n\t\t\tthis.source.set(hydratedValue);\n\t\t\tthis.currentValue = this.source.get();\n\t\t\tthis.host.notifyUpdate(this.property, previousValue, this.currentValue);\n\t\t}\n\t}\n\n\tpublic renderHydrationScript(): 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\tpublic renderHydrationScriptTag(): 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 createSignalHydrationScriptTag({\n\t\t\thydrationKey: this.hydrationKey,\n\t\t\tserializedValue,\n\t\t});\n\t}\n\n\tprivate findHydrationScriptElement(): Element | null {\n\t\tif (!(this.host instanceof Element)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn findHydrationScript(this.host, 'signal', this.hydrationKey);\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 resolveInitialValue(initialValue: Value): Value {\n\t\tif (!this.hydrate) {\n\t\t\treturn initialValue;\n\t\t}\n\n\t\tconst hydrationScriptElement = this.findHydrationScriptElement();\n\n\t\tif (!hydrationScriptElement) {\n\t\t\treturn initialValue;\n\t\t}\n\n\t\tconst parsedHydrationValue = parseHydrationPayload(hydrationScriptElement, initialValue);\n\n\t\tif (this.hydrate === Object && this.isObject(parsedHydrationValue) && this.isObject(initialValue)) {\n\t\t\treturn {\n\t\t\t\t...initialValue,\n\t\t\t\t...parsedHydrationValue,\n\t\t\t} as Value;\n\t\t}\n\n\t\treturn parsedHydrationValue;\n\t}\n\n\tprivate serializeHydrationValue(): string | undefined {\n\t\tif (!this.hydrate) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst serializedValue = JSON.stringify(this.get());\n\n\t\tif (typeof serializedValue !== 'string') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn escapeSignalHydrationJson(serializedValue);\n\t}\n\n\tprivate handleSourceChange(nextValue: Value): void {\n\t\tconst previousValue = this.currentValue;\n\t\tthis.currentValue = nextValue;\n\n\t\tif (!Object.is(previousValue, nextValue)) {\n\t\t\tthis.host.notifyUpdate(this.property, previousValue, nextValue);\n\t\t}\n\t}\n}\n\nexport function createHostSignal<Value>(options: HostSignalOptions<Value>): HostSignal<Value> {\n\treturn new HostSignal(options);\n}\n"
5
9
  ],
6
- "mappings": "",
7
- "debugId": "2AA2BC54FCAB364764756E2164756E21",
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,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,EAC5B,KAAM,CACP,GAAI,OAAO,QAAY,IACtB,QAAQ,KACP,sEAAsE,MACtE,EAAY,MAAM,EAAG,GAAG,CACzB,EAED,OAAO,GAUF,SAAS,CAAmB,CAClC,EACA,EACA,EACiB,CACjB,IAAM,EAAW,EAAK,SAEtB,GAAI,CAAC,GAAY,EAAS,SAAW,EAAG,CACvC,IAAM,EAAc,EAAkE,WAEtF,GAAI,CAAC,GAAc,EAAW,SAAW,EACxC,OAAO,KAGR,QAAS,EAAI,EAAG,EAAI,EAAW,OAAQ,GAAK,EAAG,CAC9C,IAAM,EAAO,EAAW,GAExB,GAAI,EAAK,WAAa,EACrB,SAGD,IAAM,EAAU,EAEhB,GAAI,EAAuB,EAAS,EAAM,CAAY,EACrD,OAAO,EAIT,OAAO,KAGR,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U,KAAK,YAAY,EAG1D,QAAQ,CAAC,EAAkD,CAClE,OAAO,OAAO,IAAU,UAAY,CAAC,MAAM,QAAQ,CAAK,GAAK,IAAU,KAGhE,mBAAmB,CAAC,EAA4B,CACvD,GAAI,CAAC,KAAK,QACT,OAAO,EAGR,IAAM,EAAyB,KAAK,2BAA2B,EAE/D,GAAI,CAAC,EACJ,OAAO,EAGR,IAAM,EAAuB,EAAsB,EAAwB,CAAY,EAEvF,GAAI,KAAK,UAAY,QAAU,KAAK,SAAS,CAAoB,GAAK,KAAK,SAAS,CAAY,EAC/F,MAAO,IACH,KACA,CACJ,EAGD,OAAO,EAGA,uBAAuB,EAAuB,CACrD,GAAI,CAAC,KAAK,QACT,OAGD,IAAM,EAAkB,KAAK,UAAU,KAAK,IAAI,CAAC,EAEjD,GAAI,OAAO,IAAoB,SAC9B,OAGD,OAAO,EAA0B,CAAe,EAGzC,kBAAkB,CAAC,EAAwB,CAClD,IAAM,EAAgB,KAAK,aAG3B,GAFA,KAAK,aAAe,EAEhB,CAAC,OAAO,GAAG,EAAe,CAAS,EACtC,KAAK,KAAK,aAAa,KAAK,SAAU,EAAe,CAAS,EAGjE,CAEO,SAAS,CAAuB,CAAC,EAAsD,CAC7F,OAAO,IAAI,EAAW,CAAO",
11
+ "debugId": "D824BBB0A9C2DA3964756E2164756E21",
8
12
  "names": []
9
13
  }
@@ -1,7 +1,3 @@
1
- /** @deprecated Use `HYDRATION_ATTRIBUTE` from `hydration-codec` instead. */
2
- export declare const SIGNAL_HYDRATION_ATTRIBUTE = "data-hydration";
3
- /** @deprecated Use `HYDRATION_KEY_ATTRIBUTE` from `hydration-codec` instead. */
4
- export declare const SIGNAL_HYDRATION_KEY_ATTRIBUTE = "data-hydration-key";
5
1
  /** Creates the raw `<script type="application/json">` tag used to hydrate a signal field. */
6
2
  export declare function createSignalHydrationScriptTag(options: {
7
3
  hydrationKey?: string;
@@ -1,3 +1,3 @@
1
- import{cb as a,db as b,eb as c,fb as d}from"../chunk-6z34stya.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{d as escapeSignalHydrationJson,c as createSignalHydrationScriptTag,b as SIGNAL_HYDRATION_KEY_ATTRIBUTE,a as SIGNAL_HYDRATION_ATTRIBUTE};
1
+ var W=((g)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(g,{get:(q,w)=>(typeof require<"u"?require:q)[w]}):g)(function(g){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+g+'" is not supported')});function Z(g){return g.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var Q="data-hydration",j="data-hydration-type",M="data-hydration-key";function u(g){let q=g.hydrationKey?` ${M}="${J(g.hydrationKey)}"`:"";return`<script type="application/json" ${Q} ${j}="${g.type}"${q}>${g.serializedValue}</script>`}function F(g){return Z(g)}function S(g,q){let w=g.textContent;if(!w)return q;try{return JSON.parse(w)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${Q}>:`,w.slice(0,120));return q}}function f(g,q,w){let G=g.children;if(!G||G.length===0){let z=g.childNodes;if(!z||z.length===0)return null;for(let L=0;L<z.length;L+=1){let V=z[L];if(V.nodeType!==1)continue;let X=V;if($(X,q,w))return X}return null}for(let z=0;z<G.length;z+=1)if($(G[z],q,w))return G[z];return null}function $(g,q,w){if(g.tagName!=="SCRIPT"||!g.hasAttribute(Q)||g.getAttribute(j)!==q)return!1;if(w!==void 0)return g.getAttribute(M)===w;return!g.hasAttribute(M)}function J(g){return g.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function B(g){return u({type:"signal",...g})}function D(g){return F(g)}export{D as escapeSignalHydrationJson,B as createSignalHydrationScriptTag};
2
2
 
3
- //# debugId=DA0DC63B2C1C6FBA64756E2164756E21
3
+ //# debugId=2E79D54D041C6E9564756E2164756E21
@@ -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": "DA0DC63B2C1C6FBA64756E2164756E21",
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,C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  }
@@ -0,0 +1 @@
1
+ export declare function escapeCssIdentifier(value: string): string;
@@ -0,0 +1,3 @@
1
+ var f=((n)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(c,e)=>(typeof require<"u"?require:c)[e]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});function p(n){let c=globalThis.CSS;if(typeof c?.escape==="function")return c.escape(n);let e="";for(let s=0;s<n.length;s+=1){let i=n[s]??"",t=i.codePointAt(0)??0;if(t===0){e+="�";continue}let o=t>=1&&t<=31||t===127,r=s===0&&t>=48&&t<=57,x=s===1&&t>=48&&t<=57&&(n[0]??"")==="-",a=s===0&&i==="-"&&n.length===1;if(o||r||x){e+=`\\${t.toString(16)} `;continue}if(t>=128||i==="-"||i==="_"||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122){e+=a?`\\${i}`:i;continue}e+=`\\${i}`}return e}export{p as escapeCssIdentifier};
2
+
3
+ //# debugId=BF095F02FC2877E864756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/tools/escape-css-identifier.ts"],
4
+ "sourcesContent": [
5
+ "export function escapeCssIdentifier(value: string): string {\n\tconst cssNamespace = globalThis.CSS as { escape?: (value: string) => string } | undefined;\n\n\tif (typeof cssNamespace?.escape === 'function') {\n\t\treturn cssNamespace.escape(value);\n\t}\n\n\tlet escaped = '';\n\n\tfor (let index = 0; index < value.length; index += 1) {\n\t\tconst character = value[index] ?? '';\n\t\tconst codePoint = character.codePointAt(0) ?? 0;\n\n\t\tif (codePoint === 0) {\n\t\t\tescaped += '\\uFFFD';\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isControlCharacter = (codePoint >= 0x0001 && codePoint <= 0x001f) || codePoint === 0x007f;\n\t\tconst startsWithDigit = index === 0 && codePoint >= 0x0030 && codePoint <= 0x0039;\n\t\tconst startsWithHyphenDigit =\n\t\t\tindex === 1 && codePoint >= 0x0030 && codePoint <= 0x0039 && (value[0] ?? '') === '-';\n\t\tconst isSingleHyphen = index === 0 && character === '-' && value.length === 1;\n\n\t\tif (isControlCharacter || startsWithDigit || startsWithHyphenDigit) {\n\t\t\tescaped += `\\\\${codePoint.toString(16)} `;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tcodePoint >= 0x0080 ||\n\t\t\tcharacter === '-' ||\n\t\t\tcharacter === '_' ||\n\t\t\t(codePoint >= 0x0030 && codePoint <= 0x0039) ||\n\t\t\t(codePoint >= 0x0041 && codePoint <= 0x005a) ||\n\t\t\t(codePoint >= 0x0061 && codePoint <= 0x007a)\n\t\t) {\n\t\t\tescaped += isSingleHyphen ? `\\\\${character}` : character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tescaped += `\\\\${character}`;\n\t}\n\n\treturn escaped;\n}\n"
6
+ ],
7
+ "mappings": "2PAAO,SAAS,CAAmB,CAAC,EAAuB,CAC1D,IAAM,EAAe,WAAW,IAEhC,GAAI,OAAO,GAAc,SAAW,WACnC,OAAO,EAAa,OAAO,CAAK,EAGjC,IAAI,EAAU,GAEd,QAAS,EAAQ,EAAG,EAAQ,EAAM,OAAQ,GAAS,EAAG,CACrD,IAAM,EAAY,EAAM,IAAU,GAC5B,EAAY,EAAU,YAAY,CAAC,GAAK,EAE9C,GAAI,IAAc,EAAG,CACpB,GAAW,IACX,SAGD,IAAM,EAAsB,GAAa,GAAU,GAAa,IAAW,IAAc,IACnF,EAAkB,IAAU,GAAK,GAAa,IAAU,GAAa,GACrE,EACL,IAAU,GAAK,GAAa,IAAU,GAAa,KAAW,EAAM,IAAM,MAAQ,IAC7E,EAAiB,IAAU,GAAK,IAAc,KAAO,EAAM,SAAW,EAE5E,GAAI,GAAsB,GAAmB,EAAuB,CACnE,GAAW,KAAK,EAAU,SAAS,EAAE,KACrC,SAGD,GACC,GAAa,KACb,IAAc,KACd,IAAc,KACb,GAAa,IAAU,GAAa,IACpC,GAAa,IAAU,GAAa,IACpC,GAAa,IAAU,GAAa,IACpC,CACD,GAAW,EAAiB,KAAK,IAAc,EAC/C,SAGD,GAAW,KAAK,IAGjB,OAAO",
8
+ "debugId": "BF095F02FC2877E864756E2164756E21",
9
+ "names": []
10
+ }
@@ -1,3 +1,3 @@
1
- import{nb as a}from"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.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=4BF5FF15BAECE12164756E2164756E21
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": "4BF5FF15BAECE12164756E2164756E21",
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{pb as a}from"../chunk-qbnedp0y.js";import"../chunk-8xy18qmz.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=B03DE8507783D08B64756E2164756E21
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": "B03DE8507783D08B64756E2164756E21",
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,4 +1,4 @@
1
- export * from './stringify-typed';
2
1
  export * from './event-emitter';
3
2
  export * from './render-jsx-template';
3
+ export * from './escape-css-identifier';
4
4
  export * from './escape-script-json';
@@ -1,3 +1,3 @@
1
- import{a as x}from"../chunk-jkb2y7c8.js";import{b as a}from"../chunk-cvz9mrxa.js";import{nb as p}from"../chunk-8n2dhx28.js";import{pb as t}from"../chunk-qbnedp0y.js";import"../chunk-8xy18qmz.js";export{a as stringifyTyped,x as renderJsxTemplate,p as escapeScriptJson,t as EventEmitter};
1
+ var g=((n)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(c,s)=>(typeof require<"u"?require:c)[s]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});function S(n){return n.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}class f{host;eventConfig;constructor(n,c){this.host=n,this.eventConfig=c}emit(n){let c=new CustomEvent(this.eventConfig.name,{detail:n,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(c)}}function H(n){let c=globalThis.CSS;if(typeof c?.escape==="function")return c.escape(n);let s="";for(let o=0;o<n.length;o+=1){let i=n[o]??"",r=i.codePointAt(0)??0;if(r===0){s+="�";continue}let x=r>=1&&r<=31||r===127,t=o===0&&r>=48&&r<=57,e=o===1&&r>=48&&r<=57&&(n[0]??"")==="-",p=o===0&&i==="-"&&n.length===1;if(x||t||e){s+=`\\${r.toString(16)} `;continue}if(r>=128||i==="-"||i==="_"||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){s+=p?`\\${i}`:i;continue}s+=`\\${i}`}return s}import{render as u}from"@ecopages/jsx";function h(n,c){u(n,c)}export{h as renderJsxTemplate,S as escapeScriptJson,H as escapeCssIdentifier,f as EventEmitter};
2
2
 
3
- //# debugId=0C1BEF13FC1B648864756E2164756E21
3
+ //# debugId=19BB6D9EC62E3A1564756E2164756E21
@@ -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/escape-css-identifier.ts", "../src/tools/render-jsx-template.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
+ "export function escapeCssIdentifier(value: string): string {\n\tconst cssNamespace = globalThis.CSS as { escape?: (value: string) => string } | undefined;\n\n\tif (typeof cssNamespace?.escape === 'function') {\n\t\treturn cssNamespace.escape(value);\n\t}\n\n\tlet escaped = '';\n\n\tfor (let index = 0; index < value.length; index += 1) {\n\t\tconst character = value[index] ?? '';\n\t\tconst codePoint = character.codePointAt(0) ?? 0;\n\n\t\tif (codePoint === 0) {\n\t\t\tescaped += '\\uFFFD';\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isControlCharacter = (codePoint >= 0x0001 && codePoint <= 0x001f) || codePoint === 0x007f;\n\t\tconst startsWithDigit = index === 0 && codePoint >= 0x0030 && codePoint <= 0x0039;\n\t\tconst startsWithHyphenDigit =\n\t\t\tindex === 1 && codePoint >= 0x0030 && codePoint <= 0x0039 && (value[0] ?? '') === '-';\n\t\tconst isSingleHyphen = index === 0 && character === '-' && value.length === 1;\n\n\t\tif (isControlCharacter || startsWithDigit || startsWithHyphenDigit) {\n\t\t\tescaped += `\\\\${codePoint.toString(16)} `;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tcodePoint >= 0x0080 ||\n\t\t\tcharacter === '-' ||\n\t\t\tcharacter === '_' ||\n\t\t\t(codePoint >= 0x0030 && codePoint <= 0x0039) ||\n\t\t\t(codePoint >= 0x0041 && codePoint <= 0x005a) ||\n\t\t\t(codePoint >= 0x0061 && codePoint <= 0x007a)\n\t\t) {\n\t\t\tescaped += isSingleHyphen ? `\\\\${character}` : character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tescaped += `\\\\${character}`;\n\t}\n\n\treturn escaped;\n}\n",
8
+ "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
9
  ],
6
- "mappings": "",
7
- "debugId": "0C1BEF13FC1B648864756E2164756E21",
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,CC3CO,SAAS,CAAmB,CAAC,EAAuB,CAC1D,IAAM,EAAe,WAAW,IAEhC,GAAI,OAAO,GAAc,SAAW,WACnC,OAAO,EAAa,OAAO,CAAK,EAGjC,IAAI,EAAU,GAEd,QAAS,EAAQ,EAAG,EAAQ,EAAM,OAAQ,GAAS,EAAG,CACrD,IAAM,EAAY,EAAM,IAAU,GAC5B,EAAY,EAAU,YAAY,CAAC,GAAK,EAE9C,GAAI,IAAc,EAAG,CACpB,GAAW,IACX,SAGD,IAAM,EAAsB,GAAa,GAAU,GAAa,IAAW,IAAc,IACnF,EAAkB,IAAU,GAAK,GAAa,IAAU,GAAa,GACrE,EACL,IAAU,GAAK,GAAa,IAAU,GAAa,KAAW,EAAM,IAAM,MAAQ,IAC7E,EAAiB,IAAU,GAAK,IAAc,KAAO,EAAM,SAAW,EAE5E,GAAI,GAAsB,GAAmB,EAAuB,CACnE,GAAW,KAAK,EAAU,SAAS,EAAE,KACrC,SAGD,GACC,GAAa,KACb,IAAc,KACd,IAAc,KACb,GAAa,IAAU,GAAa,IACpC,GAAa,IAAU,GAAa,IACpC,GAAa,IAAU,GAAa,IACpC,CACD,GAAW,EAAiB,KAAK,IAAc,EAC/C,SAGD,GAAW,KAAK,IAGjB,OAAO,EC5CR,iBAAS,sBAKF,SAAS,CAAiB,CAAC,EAA8B,EAA2B,CAC1F,EAAO,EAAU,CAAM",
11
+ "debugId": "19BB6D9EC62E3A1564756E2164756E21",
8
12
  "names": []
9
13
  }
@@ -1,3 +1,3 @@
1
- import{a}from"../chunk-jkb2y7c8.js";import"../chunk-8xy18qmz.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
  }
package/dist/types.d.ts CHANGED
@@ -17,13 +17,6 @@ export type Context = {
17
17
  };
18
18
  export type ClassDecorator = <T extends Constructor>(target: T, context: Context) => T | void;
19
19
  export type Method = (...args: any[]) => any;
20
- /**
21
- * @deprecated
22
- */
23
- export type StanderOrLegacyClassDecorator = {
24
- (target: Constructor): typeof target | void;
25
- (target: CustomElementConstructor, context: ClassDecoratorContext): void;
26
- };
27
20
  export type LegacyClassDecoratorArgs = {
28
21
  protoOrTarget: CustomElementConstructor;
29
22
  nameOrContext: string;
@@ -34,13 +27,6 @@ export type StandardClassDecoratorArgs = {
34
27
  nameOrContext: ClassDecoratorContext;
35
28
  };
36
29
  export type StandardOrLegacyClassDecoratorArgs = LegacyClassDecoratorArgs | StandardClassDecoratorArgs;
37
- /**
38
- * @deprecated
39
- */
40
- export type StandardOrLegacMethodDecorator = {
41
- (proto: Constructor<HTMLElement>): PropertyDescriptor;
42
- (target: Method, context: ClassMethodDecoratorContext): void;
43
- };
44
30
  export type LegacyMethodDecoratorArgs = {
45
31
  protoOrTarget: RadiantElement;
46
32
  nameOrContext: string;
@@ -52,13 +38,6 @@ export type StandardMethodDecoratorArgs = {
52
38
  descriptor: undefined;
53
39
  };
54
40
  export type StandardOrLegacyMethodDecoratorArgs = LegacyMethodDecoratorArgs | StandardMethodDecoratorArgs;
55
- /**
56
- * @deprecated
57
- */
58
- export type StandardOrLegacyClassFieldDecorator = {
59
- (proto: RadiantElement, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
60
- (target: undefined, context: ClassFieldDecoratorContext): void;
61
- };
62
41
  export type LegacyFieldDecoratorArgs = {
63
42
  protoOrTarget: RadiantElement;
64
43
  nameOrContext: string;
package/dist/types.js CHANGED
@@ -1,3 +1,3 @@
1
- import"./chunk-8xy18qmz.js";var r={isStandard:{ClassDecorator:function(t){return typeof t[1]<"u"},MethodDecorator:function(t){return typeof t[1]==="object"},FieldDecorator:function(t){return typeof t[1]==="object"}}};export{r as guards};
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
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/types.ts"],
4
4
  "sourcesContent": [
5
- "import type { RadiantElement } from './core/radiant-element';\n\nexport type Constructor<T = unknown> = { new (...args: any[]): NonNullable<T> };\n\nexport type ConstructorParams<T extends Constructor> = ConstructorParameters<T>;\n\nexport type Context = {\n\tkind: string;\n\tname: string | symbol;\n\taccess: {\n\t\tget?(): unknown;\n\t\tset?(value: unknown): void;\n\t\thas?(value: unknown): boolean;\n\t};\n\tprivate?: boolean;\n\tstatic?: boolean;\n\taddInitializer?(initializer: () => void): void;\n};\n\nexport type ClassDecorator = <T extends Constructor>(target: T, context: Context) => T | void;\n\nexport type Method = (...args: any[]) => any;\n\n/**\n * @deprecated\n */\nexport type StanderOrLegacyClassDecorator = {\n\t(target: Constructor): typeof target | void;\n\t(target: CustomElementConstructor, context: ClassDecoratorContext): void;\n};\n\nexport type LegacyClassDecoratorArgs = {\n\tprotoOrTarget: CustomElementConstructor;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardClassDecoratorArgs = {\n\tprotoOrTarget: CustomElementConstructor;\n\tnameOrContext: ClassDecoratorContext;\n};\n\nexport type StandardOrLegacyClassDecoratorArgs = LegacyClassDecoratorArgs | StandardClassDecoratorArgs;\n\n/**\n * @deprecated\n */\nexport type StandardOrLegacMethodDecorator = {\n\t(proto: Constructor<HTMLElement>): PropertyDescriptor;\n\t(target: Method, context: ClassMethodDecoratorContext): void;\n};\n\nexport type LegacyMethodDecoratorArgs = {\n\tprotoOrTarget: RadiantElement;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardMethodDecoratorArgs = {\n\tprotoOrTarget: Method;\n\tnameOrContext: ClassMethodDecoratorContext;\n\tdescriptor: undefined;\n};\n\nexport type StandardOrLegacyMethodDecoratorArgs = LegacyMethodDecoratorArgs | StandardMethodDecoratorArgs;\n\n/**\n * @deprecated\n */\nexport type StandardOrLegacyClassFieldDecorator = {\n\t(proto: RadiantElement, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;\n\t(target: undefined, context: ClassFieldDecoratorContext): void;\n};\n\nexport type LegacyFieldDecoratorArgs = {\n\tprotoOrTarget: RadiantElement;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardFieldDecoratorArgs<T = unknown, V = unknown> = {\n\tprotoOrTarget: undefined;\n\tnameOrContext: ClassFieldDecoratorContext<T, V>;\n};\n\nexport type StandardOrLegacyFieldDecoratorArgs = LegacyFieldDecoratorArgs | StandardFieldDecoratorArgs;\n\nexport type CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport const guards = {\n\tisStandard: {\n\t\tClassDecorator: function (\n\t\t\targs: any,\n\t\t): args is [CustomElementConstructor, ClassDecoratorContext<CustomElementConstructor>] {\n\t\t\treturn typeof args[1] !== 'undefined';\n\t\t},\n\t\tMethodDecorator: function (args: any): args is [Method, ClassMethodDecoratorContext] {\n\t\t\treturn typeof args[1] === 'object';\n\t\t},\n\t\tFieldDecorator: function (args: any): args is [undefined, ClassFieldDecoratorContext] {\n\t\t\treturn typeof args[1] === 'object';\n\t\t},\n\t},\n};\n"
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": "4BAyFO,IAAM,EAAS,CACrB,WAAY,CACX,eAAgB,QAAS,CACxB,EACsF,CACtF,OAAO,OAAO,EAAK,GAAO,KAE3B,gBAAiB,QAAS,CAAC,EAA0D,CACpF,OAAO,OAAO,EAAK,KAAO,UAE3B,eAAgB,QAAS,CAAC,EAA4D,CACrF,OAAO,OAAO,EAAK,KAAO,SAE5B,CACD",
8
- "debugId": "91D7439E7D31B5DD64756E2164756E21",
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{Pa as a,Qa as b,Ra as c,Sa as d,Ta as e,Ua as f,Va as g}from"../chunk-73x7jpdd.js";import"../chunk-8xy18qmz.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=C4FCCDEA9B2B021764756E2164756E21
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": "",
7
- "debugId": "C4FCCDEA9B2B021764756E2164756E21",
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,CAAC,EAA0B,CAC/B,IAAM,EAAQ,EAAqB,CAAK,EACxC,GAAI,CAAC,MAAM,QAAQ,CAAK,EACvB,MAAU,UAAU,8CAA8C,OAAO,IAAQ,EAElF,OAAO,GAGR,OAAO,CAAC,EAAwB,CAC/B,MAAO,EAAE,IAAU,KAAO,OAAO,CAAK,EAAE,YAAY,IAAM,UAG3D,MAAM,CAAC,EAAuB,CAE7B,OADe,OAAO,EAAM,QAAQ,KAAM,EAAE,C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AQ,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": "A6359EE45E00B20A64756E2164756E21",
8
9
  "names": []
9
10
  }
@@ -1,3 +1,3 @@
1
- import{Pa as e,Qa as f,Ra as m,Sa as p,Ta as t,Ua as x,Va as a}from"../chunk-73x7jpdd.js";import"../chunk-8xy18qmz.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=0A4F7006E06F727564756E2164756E21
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": "0A4F7006E06F727564756E2164756E21",
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,GA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D,GAAI,CAAC,EAAY,MAAU,UAAU,mCAAmC,IAAO,EAE/E,OADuB,EAAQ,IAAe,EAAQ,SAAW,GACnD,CAAK,EAQpB,SAAS,CAAS,CAAC,EAAkC,CACpD,OAAO,OAAO,IAAU,UAGzB,SAAS,CAAQ,CAAC,EAAiC,CAClD,OAAO,OAAO,IAAU,SAGzB,SAAS,CAAQ,CAAC,EAAiC,CAClD,OAAO,OAAO,IAAU,SAGzB,SAAS,CAAO,CAAC,EAAyC,CACzD,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.0",
3
+ "version": "0.3.0-alpha.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/ecopages/radiant.git"
@@ -48,6 +48,7 @@
48
48
  "size-budget.json"
49
49
  ],
50
50
  "sideEffects": [
51
+ "./dist/client/install-hydrator.js",
51
52
  "./dist/server/install-light-dom-shim.js"
52
53
  ],
53
54
  "exports": {
@@ -86,13 +87,37 @@
86
87
  "types": "./dist/context/decorators/on-context-update.d.ts",
87
88
  "import": "./dist/context/decorators/on-context-update.js"
88
89
  },
90
+ "./context/events": {
91
+ "types": "./dist/context/events.d.ts",
92
+ "import": "./dist/context/events.js"
93
+ },
94
+ "./controller-registry": {
95
+ "types": "./dist/controller-registry.d.ts",
96
+ "import": "./dist/controller-registry.js"
97
+ },
89
98
  "./core/radiant-element": {
90
99
  "types": "./dist/core/radiant-element.d.ts",
91
100
  "import": "./dist/core/radiant-element.js"
92
101
  },
93
- "./core/radiant-component": {
94
- "types": "./dist/core/radiant-component.d.ts",
95
- "import": "./dist/core/radiant-component.js"
102
+ "./core/radiant-controller": {
103
+ "types": "./dist/core/radiant-controller.d.ts",
104
+ "import": "./dist/core/radiant-controller.js"
105
+ },
106
+ "./core/reactive-jsx-value": {
107
+ "types": "./dist/core/reactive-jsx-value.d.ts",
108
+ "import": "./dist/core/reactive-jsx-value.js"
109
+ },
110
+ "./client/hydrator": {
111
+ "types": "./dist/client/hydrator.d.ts",
112
+ "import": "./dist/client/hydrator.js"
113
+ },
114
+ "./client/app-bootstrap": {
115
+ "types": "./dist/client/app-bootstrap.d.ts",
116
+ "import": "./dist/client/app-bootstrap.js"
117
+ },
118
+ "./client/install-hydrator": {
119
+ "types": "./dist/client/install-hydrator.d.ts",
120
+ "import": "./dist/client/install-hydrator.js"
96
121
  },
97
122
  "./signals/host-resource": {
98
123
  "types": "./dist/signals/host-resource.d.ts",
@@ -110,6 +135,10 @@
110
135
  "types": "./dist/server/render-component.d.ts",
111
136
  "import": "./dist/server/render-component.js"
112
137
  },
138
+ "./server/render-controller": {
139
+ "types": "./dist/server/render-controller.d.ts",
140
+ "import": "./dist/server/render-controller.js"
141
+ },
113
142
  "./server/project-root": {
114
143
  "types": "./dist/server/project-root.d.ts",
115
144
  "import": "./dist/server/project-root.js"
@@ -118,6 +147,14 @@
118
147
  "types": "./dist/decorators/bound.d.ts",
119
148
  "import": "./dist/decorators/bound.js"
120
149
  },
150
+ "./decorators/attr": {
151
+ "types": "./dist/decorators/attr.d.ts",
152
+ "import": "./dist/decorators/attr.js"
153
+ },
154
+ "./decorators/controller": {
155
+ "types": "./dist/decorators/controller.d.ts",
156
+ "import": "./dist/decorators/controller.js"
157
+ },
121
158
  "./decorators/custom-element": {
122
159
  "types": "./dist/decorators/custom-element.d.ts",
123
160
  "import": "./dist/decorators/custom-element.js"
@@ -182,10 +219,6 @@
182
219
  "types": "./dist/decorators/state.d.ts",
183
220
  "import": "./dist/decorators/state.js"
184
221
  },
185
- "./tools/stringify-typed": {
186
- "types": "./dist/tools/stringify-typed.d.ts",
187
- "import": "./dist/tools/stringify-typed.js"
188
- },
189
222
  "./tools/render-jsx-template": {
190
223
  "types": "./dist/tools/render-jsx-template.d.ts",
191
224
  "import": "./dist/tools/render-jsx-template.js"