@ecopages/radiant 0.3.0-alpha.9 → 0.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (564) hide show
  1. package/README.md +5 -5
  2. package/client/app-bootstrap.d.ts +19 -0
  3. package/client/app-bootstrap.js +3 -0
  4. package/client/app-bootstrap.js.map +10 -0
  5. package/client/hydrator.js +3 -0
  6. package/{dist/client → client}/hydrator.js.map +2 -2
  7. package/client/install-hydrator.js +3 -0
  8. package/{dist/client → client}/install-hydrator.js.map +2 -2
  9. package/context/context-consumer-bootstrap.js +3 -0
  10. package/{dist/context → context}/context-consumer-bootstrap.js.map +4 -4
  11. package/context/context-consumer-runtime.js +3 -0
  12. package/context/context-consumer-runtime.js.map +12 -0
  13. package/context/context-host.js +3 -0
  14. package/{dist/context → context}/context-host.js.map +2 -2
  15. package/context/context-provider.js +3 -0
  16. package/{dist/context → context}/context-provider.js.map +3 -3
  17. package/context/context-ssr-bridge.js +3 -0
  18. package/{dist/context → context}/context-ssr-bridge.js.map +2 -2
  19. package/context/create-context.js +3 -0
  20. package/{dist/context → context}/create-context.js.map +2 -2
  21. package/context/decorators/consume-context.js +3 -0
  22. package/context/decorators/consume-context.js.map +19 -0
  23. package/context/decorators/context-selection-delivery.js +3 -0
  24. package/{dist/context → context}/decorators/context-selection-delivery.js.map +2 -2
  25. package/context/decorators/context-selector.js +3 -0
  26. package/context/decorators/context-selector.js.map +22 -0
  27. package/context/decorators/legacy/consume-context.js +3 -0
  28. package/context/decorators/legacy/consume-context.js.map +16 -0
  29. package/context/decorators/legacy/context-selector-field.js +3 -0
  30. package/context/decorators/legacy/context-selector-field.js.map +17 -0
  31. package/context/decorators/legacy/context-selector.js +3 -0
  32. package/context/decorators/legacy/context-selector.js.map +17 -0
  33. package/context/decorators/legacy/provide-context.js +3 -0
  34. package/{dist/context → context}/decorators/legacy/provide-context.js.map +5 -5
  35. package/context/decorators/on-context-update.js +3 -0
  36. package/{dist/context → context}/decorators/on-context-update.js.map +6 -6
  37. package/context/decorators/provide-context.js +3 -0
  38. package/{dist/context → context}/decorators/provide-context.js.map +5 -5
  39. package/context/decorators/standard/consume-context.js +3 -0
  40. package/{dist/context → context}/decorators/standard/consume-context.js.map +4 -4
  41. package/context/decorators/standard/context-selector-field.js +3 -0
  42. package/{dist/context → context}/decorators/standard/context-selector-field.js.map +4 -4
  43. package/context/decorators/standard/context-selector.js +3 -0
  44. package/{dist/context → context}/decorators/standard/context-selector.js.map +4 -4
  45. package/context/decorators/standard/provide-context.js +3 -0
  46. package/{dist/context → context}/decorators/standard/provide-context.js.map +3 -3
  47. package/context/decorators/standard-legacy-dispatch.d.ts +6 -0
  48. package/context/decorators/standard-legacy-dispatch.js +3 -0
  49. package/context/decorators/standard-legacy-dispatch.js.map +10 -0
  50. package/context/events.js +3 -0
  51. package/context/events.js.map +10 -0
  52. package/context/hydration-script.js +3 -0
  53. package/{dist/context → context}/hydration-script.js.map +2 -2
  54. package/context/index.js +3 -0
  55. package/{dist/context → context}/index.js.map +13 -12
  56. package/controller-registry.js +3 -0
  57. package/{dist/controller-registry.js.map → controller-registry.js.map} +2 -2
  58. package/core/controller-metadata.js +3 -0
  59. package/{dist/core → core}/controller-metadata.js.map +2 -2
  60. package/core/custom-element-metadata.js +3 -0
  61. package/{dist/core → core}/custom-element-metadata.js.map +2 -2
  62. package/core/event-subscription-registry.d.ts +16 -0
  63. package/core/event-subscription-registry.js +3 -0
  64. package/core/event-subscription-registry.js.map +10 -0
  65. package/core/host-ssr-registry.d.ts +13 -0
  66. package/core/host-ssr-registry.js +3 -0
  67. package/core/host-ssr-registry.js.map +10 -0
  68. package/core/hydration-capable-host.d.ts +8 -0
  69. package/core/hydration-capable-host.js +3 -0
  70. package/core/hydration-capable-host.js.map +10 -0
  71. package/core/hydration-codec.js +3 -0
  72. package/{dist/core → core}/hydration-codec.js.map +2 -2
  73. package/{dist/core → core}/radiant-controller.d.ts +42 -20
  74. package/core/radiant-controller.js +3 -0
  75. package/core/radiant-controller.js.map +21 -0
  76. package/{dist/core/radiant-component-ssr.d.ts → core/radiant-element-ssr-host.d.ts} +16 -16
  77. package/core/radiant-element-ssr-host.js +3 -0
  78. package/core/radiant-element-ssr-host.js.map +10 -0
  79. package/core/radiant-element-ssr-registry.d.ts +20 -0
  80. package/core/radiant-element-ssr-registry.js +3 -0
  81. package/core/radiant-element-ssr-registry.js.map +10 -0
  82. package/{dist/core → core}/radiant-element.d.ts +44 -155
  83. package/core/radiant-element.js +3 -0
  84. package/core/radiant-element.js.map +31 -0
  85. package/core/radiant-hydrator-state.js +3 -0
  86. package/{dist/core → core}/radiant-hydrator-state.js.map +2 -2
  87. package/core/reactive-binding-adapter.d.ts +10 -0
  88. package/core/reactive-binding-adapter.js +3 -0
  89. package/core/reactive-binding-adapter.js.map +10 -0
  90. package/core/reactive-host.d.ts +138 -0
  91. package/core/reactive-host.js +3 -0
  92. package/core/reactive-host.js.map +13 -0
  93. package/{dist/core → core}/reactive-jsx-value.d.ts +4 -3
  94. package/core/reactive-jsx-value.js +3 -0
  95. package/core/reactive-jsx-value.js.map +10 -0
  96. package/core/reactive-prop-core.d.ts +39 -0
  97. package/core/reactive-prop-core.js +3 -0
  98. package/{dist/decorators/standard/reactive-prop.js.map → core/reactive-prop-core.js.map} +4 -5
  99. package/{dist/core → core}/reactive-prop-metadata.d.ts +1 -1
  100. package/core/reactive-prop-metadata.js +3 -0
  101. package/core/reactive-prop-metadata.js.map +10 -0
  102. package/core/reactive-property-state.d.ts +20 -0
  103. package/core/reactive-property-state.js +3 -0
  104. package/core/reactive-property-state.js.map +12 -0
  105. package/core/reactivity-adapter.d.ts +8 -0
  106. package/core/reactivity-adapter.js +3 -0
  107. package/core/reactivity-adapter.js.map +12 -0
  108. package/core/reactivity-contract.d.ts +53 -0
  109. package/core/reactivity-contract.js +2 -0
  110. package/core/reactivity-contract.js.map +9 -0
  111. package/core/reactivity-runtime.d.ts +18 -0
  112. package/core/reactivity-runtime.js +3 -0
  113. package/core/reactivity-runtime.js.map +11 -0
  114. package/core/reactivity-signals.d.ts +10 -0
  115. package/core/reactivity-signals.js +3 -0
  116. package/core/reactivity-signals.js.map +10 -0
  117. package/core/render-runtime.d.ts +28 -0
  118. package/core/render-runtime.js +3 -0
  119. package/core/render-runtime.js.map +16 -0
  120. package/core/render-scheduler.d.ts +22 -0
  121. package/core/render-scheduler.js +3 -0
  122. package/core/render-scheduler.js.map +10 -0
  123. package/core/slot-projection-runtime.js +3 -0
  124. package/core/slot-projection-runtime.js.map +12 -0
  125. package/core/ssr-preparation.js +3 -0
  126. package/{dist/core → core}/ssr-preparation.js.map +2 -2
  127. package/decorators/attr.js +3 -0
  128. package/decorators/attr.js.map +18 -0
  129. package/decorators/bound.js +3 -0
  130. package/{dist/decorators → decorators}/bound.js.map +2 -2
  131. package/decorators/bridge.js +3 -0
  132. package/{dist/decorators → decorators}/bridge.js.map +2 -2
  133. package/decorators/controller.js +3 -0
  134. package/{dist/decorators → decorators}/controller.js.map +2 -2
  135. package/decorators/custom-element.js +3 -0
  136. package/{dist/decorators → decorators}/custom-element.js.map +2 -2
  137. package/decorators/debounce.js +3 -0
  138. package/{dist/decorators → decorators}/debounce.js.map +2 -2
  139. package/decorators/event.js +3 -0
  140. package/{dist/decorators → decorators}/event.js.map +3 -3
  141. package/decorators/legacy/attr.js +3 -0
  142. package/decorators/legacy/attr.js.map +15 -0
  143. package/decorators/legacy/bound.js +3 -0
  144. package/{dist/decorators → decorators}/legacy/bound.js.map +2 -2
  145. package/decorators/legacy/custom-element.js +3 -0
  146. package/{dist/decorators → decorators}/legacy/custom-element.js.map +2 -2
  147. package/decorators/legacy/debounce.js +3 -0
  148. package/{dist/decorators → decorators}/legacy/debounce.js.map +2 -2
  149. package/decorators/legacy/event.js +3 -0
  150. package/decorators/legacy/event.js.map +13 -0
  151. package/decorators/legacy/host-readiness.d.ts +8 -0
  152. package/decorators/legacy/host-readiness.js +3 -0
  153. package/decorators/legacy/host-readiness.js.map +11 -0
  154. package/decorators/legacy/instance-initializers.d.ts +34 -0
  155. package/decorators/legacy/instance-initializers.js +3 -0
  156. package/decorators/legacy/instance-initializers.js.map +10 -0
  157. package/decorators/legacy/member-bootstrap.d.ts +10 -0
  158. package/decorators/legacy/member-bootstrap.js +3 -0
  159. package/decorators/legacy/member-bootstrap.js.map +10 -0
  160. package/decorators/legacy/on-event.js +3 -0
  161. package/decorators/legacy/on-event.js.map +13 -0
  162. package/{dist/decorators → decorators}/legacy/on-updated.d.ts +1 -1
  163. package/decorators/legacy/on-updated.js +3 -0
  164. package/decorators/legacy/on-updated.js.map +11 -0
  165. package/decorators/legacy/query-slot.js +3 -0
  166. package/decorators/legacy/query-slot.js.map +13 -0
  167. package/decorators/legacy/query.js +3 -0
  168. package/decorators/legacy/query.js.map +12 -0
  169. package/decorators/legacy/reactive-field.js +3 -0
  170. package/decorators/legacy/reactive-field.js.map +13 -0
  171. package/{dist/decorators → decorators}/legacy/reactive-prop.d.ts +1 -2
  172. package/decorators/legacy/reactive-prop.js +3 -0
  173. package/decorators/legacy/reactive-prop.js.map +15 -0
  174. package/{dist/decorators → decorators}/legacy/signal.d.ts +1 -1
  175. package/decorators/legacy/signal.js +3 -0
  176. package/decorators/legacy/signal.js.map +17 -0
  177. package/decorators/on-event.js +3 -0
  178. package/{dist/decorators → decorators}/on-event.js.map +4 -4
  179. package/decorators/on-updated.js +3 -0
  180. package/decorators/on-updated.js.map +14 -0
  181. package/{dist/decorators → decorators}/prop.d.ts +5 -6
  182. package/decorators/prop.js +3 -0
  183. package/decorators/prop.js.map +18 -0
  184. package/decorators/query-slot.js +3 -0
  185. package/decorators/query-slot.js.map +16 -0
  186. package/decorators/query.js +3 -0
  187. package/{dist/decorators → decorators}/query.js.map +3 -3
  188. package/decorators/shared/auto-bind.d.ts +7 -0
  189. package/decorators/shared/auto-bind.js +3 -0
  190. package/decorators/shared/auto-bind.js.map +10 -0
  191. package/{dist/decorators → decorators}/shared/reactive-attr.d.ts +1 -1
  192. package/decorators/shared/reactive-attr.js +3 -0
  193. package/decorators/shared/reactive-attr.js.map +13 -0
  194. package/decorators/signal.js +3 -0
  195. package/decorators/signal.js.map +19 -0
  196. package/decorators/standard/attr.js +3 -0
  197. package/decorators/standard/attr.js.map +14 -0
  198. package/decorators/standard/bound.js +3 -0
  199. package/{dist/decorators → decorators}/standard/bound.js.map +2 -2
  200. package/decorators/standard/custom-element.js +3 -0
  201. package/{dist/decorators → decorators}/standard/custom-element.js.map +2 -2
  202. package/decorators/standard/debounce.js +3 -0
  203. package/{dist/decorators → decorators}/standard/debounce.js.map +2 -2
  204. package/decorators/standard/event.js +3 -0
  205. package/{dist/decorators → decorators}/standard/event.js.map +2 -2
  206. package/decorators/standard/on-event.js +3 -0
  207. package/{dist/decorators → decorators}/standard/on-event.js.map +3 -3
  208. package/decorators/standard/on-updated.js +3 -0
  209. package/{dist/decorators → decorators}/standard/on-updated.js.map +2 -2
  210. package/{dist/decorators → decorators}/standard/query-slot.d.ts +0 -1
  211. package/decorators/standard/query-slot.js +3 -0
  212. package/decorators/standard/query-slot.js.map +11 -0
  213. package/decorators/standard/query.js +3 -0
  214. package/{dist/decorators → decorators}/standard/query.js.map +2 -2
  215. package/decorators/standard/reactive-field.js +3 -0
  216. package/decorators/standard/reactive-field.js.map +11 -0
  217. package/{dist/decorators → decorators}/standard/reactive-prop.d.ts +1 -1
  218. package/decorators/standard/reactive-prop.js +3 -0
  219. package/decorators/standard/reactive-prop.js.map +13 -0
  220. package/{dist/decorators → decorators}/standard/signal.d.ts +1 -1
  221. package/decorators/standard/signal.js +3 -0
  222. package/decorators/standard/signal.js.map +16 -0
  223. package/{dist/decorators → decorators}/state.d.ts +3 -2
  224. package/decorators/state.js +3 -0
  225. package/decorators/state.js.map +16 -0
  226. package/helpers/create-event-listener.js +3 -0
  227. package/{dist/helpers → helpers}/create-event-listener.js.map +3 -3
  228. package/helpers/create-event.js +3 -0
  229. package/{dist/helpers → helpers}/create-event.js.map +2 -2
  230. package/{dist/helpers → helpers}/create-query-slot.d.ts +0 -1
  231. package/helpers/create-query-slot.js +3 -0
  232. package/helpers/create-query-slot.js.map +10 -0
  233. package/helpers/create-query.js +3 -0
  234. package/{dist/helpers → helpers}/create-query.js.map +2 -2
  235. package/helpers/debounce.js +3 -0
  236. package/{dist/helpers → helpers}/debounce.js.map +2 -2
  237. package/helpers/index.js +3 -0
  238. package/{dist/helpers → helpers}/index.js.map +4 -4
  239. package/index.js +3 -0
  240. package/index.js.map +86 -0
  241. package/package.json +102 -125
  242. package/server/context-ssr.js +3 -0
  243. package/{dist/server → server}/context-ssr.js.map +2 -2
  244. package/server/host-attribute-serialization.d.ts +46 -0
  245. package/server/host-attribute-serialization.js +3 -0
  246. package/server/host-attribute-serialization.js.map +12 -0
  247. package/server/host-script-composition.d.ts +42 -0
  248. package/server/host-script-composition.js +3 -0
  249. package/server/host-script-composition.js.map +10 -0
  250. package/server/html-parser.js +3 -0
  251. package/{dist/server → server}/html-parser.js.map +2 -2
  252. package/server/install-light-dom-shim.js +3 -0
  253. package/server/install-light-dom-shim.js.map +17 -0
  254. package/server/internal-radiant-host.d.ts +2 -0
  255. package/server/internal-radiant-host.js +3 -0
  256. package/server/internal-radiant-host.js.map +9 -0
  257. package/server/light-dom-shim.d.ts +2 -0
  258. package/server/light-dom-shim.js +3 -0
  259. package/server/light-dom-shim.js.map +16 -0
  260. package/server/minimal-dom/document.d.ts +17 -0
  261. package/server/minimal-dom/document.js +3 -0
  262. package/server/minimal-dom/document.js.map +14 -0
  263. package/server/minimal-dom/html.d.ts +7 -0
  264. package/server/minimal-dom/html.js +3 -0
  265. package/server/minimal-dom/html.js.map +13 -0
  266. package/{dist/server/light-dom-shim.d.ts → server/minimal-dom/install.d.ts} +1 -4
  267. package/server/minimal-dom/install.js +3 -0
  268. package/server/minimal-dom/install.js.map +16 -0
  269. package/server/minimal-dom/nodes.d.ts +78 -0
  270. package/server/project-root.js +3 -0
  271. package/{dist/server → server}/project-root.js.map +2 -2
  272. package/server/radiant-element-ssr-bridge.d.ts +21 -0
  273. package/server/radiant-element-ssr-bridge.js +3 -0
  274. package/server/radiant-element-ssr-bridge.js.map +24 -0
  275. package/server/radiant-element-ssr-extractor.d.ts +2 -0
  276. package/server/radiant-element-ssr-extractor.js +3 -0
  277. package/server/radiant-element-ssr-extractor.js.map +12 -0
  278. package/server/radiant-element-ssr-service.d.ts +13 -0
  279. package/server/radiant-element-ssr-service.js +3 -0
  280. package/server/radiant-element-ssr-service.js.map +22 -0
  281. package/server/radiant-element-ssr.d.ts +1 -0
  282. package/server/radiant-element-ssr.js +3 -0
  283. package/server/radiant-element-ssr.js.map +24 -0
  284. package/{dist/server → server}/render-component.d.ts +3 -9
  285. package/server/render-component.js +3 -0
  286. package/server/render-component.js.map +32 -0
  287. package/server/render-controller.js +3 -0
  288. package/server/render-controller.js.map +35 -0
  289. package/server/render-fragment.d.ts +7 -0
  290. package/server/render-fragment.js +3 -0
  291. package/server/render-fragment.js.map +10 -0
  292. package/server/slot-projection-html.js +3 -0
  293. package/{dist/server → server}/slot-projection-html.js.map +5 -5
  294. package/signals/host-resource.js +3 -0
  295. package/{dist/signals → signals}/host-resource.js.map +2 -2
  296. package/{dist/signals → signals}/host-signal.d.ts +2 -1
  297. package/signals/host-signal.js +3 -0
  298. package/signals/host-signal.js.map +13 -0
  299. package/signals/hydration-script.js +3 -0
  300. package/{dist/signals → signals}/hydration-script.js.map +2 -2
  301. package/tools/escape-css-identifier.js +3 -0
  302. package/tools/escape-css-identifier.js.map +10 -0
  303. package/tools/escape-script-json.js +3 -0
  304. package/{dist/tools → tools}/escape-script-json.js.map +2 -2
  305. package/tools/event-emitter.js +3 -0
  306. package/{dist/tools → tools}/event-emitter.js.map +2 -2
  307. package/tools/index.js +3 -0
  308. package/{dist/tools → tools}/index.js.map +3 -3
  309. package/tools/render-jsx-template.js +3 -0
  310. package/{dist/tools → tools}/render-jsx-template.js.map +2 -2
  311. package/types.js +3 -0
  312. package/{dist/types.js.map → types.js.map} +2 -2
  313. package/utils/attribute-utils.js +3 -0
  314. package/{dist/utils → utils}/attribute-utils.js.map +2 -2
  315. package/utils/escape-html-attribute.d.ts +2 -0
  316. package/utils/escape-html-attribute.js +3 -0
  317. package/utils/escape-html-attribute.js.map +10 -0
  318. package/utils/index.js +3 -0
  319. package/{dist/utils → utils}/index.js.map +2 -2
  320. package/dist/LICENSE +0 -21
  321. package/dist/client/hydrator.js +0 -3
  322. package/dist/client/install-hydrator.js +0 -3
  323. package/dist/context/context-consumer-bootstrap.js +0 -3
  324. package/dist/context/context-consumer-runtime.js +0 -3
  325. package/dist/context/context-consumer-runtime.js.map +0 -12
  326. package/dist/context/context-host.js +0 -3
  327. package/dist/context/context-provider.js +0 -3
  328. package/dist/context/context-ssr-bridge.js +0 -3
  329. package/dist/context/create-context.js +0 -3
  330. package/dist/context/decorators/consume-context.js +0 -3
  331. package/dist/context/decorators/consume-context.js.map +0 -19
  332. package/dist/context/decorators/context-selection-delivery.js +0 -3
  333. package/dist/context/decorators/context-selector.js +0 -3
  334. package/dist/context/decorators/context-selector.js.map +0 -21
  335. package/dist/context/decorators/legacy/consume-context.js +0 -3
  336. package/dist/context/decorators/legacy/consume-context.js.map +0 -16
  337. package/dist/context/decorators/legacy/context-selector-field.js +0 -3
  338. package/dist/context/decorators/legacy/context-selector-field.js.map +0 -17
  339. package/dist/context/decorators/legacy/context-selector.js +0 -3
  340. package/dist/context/decorators/legacy/context-selector.js.map +0 -17
  341. package/dist/context/decorators/legacy/provide-context.js +0 -3
  342. package/dist/context/decorators/on-context-update.js +0 -3
  343. package/dist/context/decorators/provide-context.js +0 -3
  344. package/dist/context/decorators/standard/consume-context.js +0 -3
  345. package/dist/context/decorators/standard/context-selector-field.js +0 -3
  346. package/dist/context/decorators/standard/context-selector.js +0 -3
  347. package/dist/context/decorators/standard/provide-context.js +0 -3
  348. package/dist/context/events.js +0 -3
  349. package/dist/context/events.js.map +0 -10
  350. package/dist/context/hydration-script.js +0 -3
  351. package/dist/context/index.js +0 -3
  352. package/dist/controller-registry.js +0 -3
  353. package/dist/core/controller-metadata.js +0 -3
  354. package/dist/core/custom-element-metadata.js +0 -3
  355. package/dist/core/hydration-codec.js +0 -3
  356. package/dist/core/radiant-component-ssr-registry.d.ts +0 -54
  357. package/dist/core/radiant-component-ssr-registry.js +0 -3
  358. package/dist/core/radiant-component-ssr-registry.js.map +0 -10
  359. package/dist/core/radiant-component-ssr.js +0 -3
  360. package/dist/core/radiant-component-ssr.js.map +0 -14
  361. package/dist/core/radiant-controller.js +0 -3
  362. package/dist/core/radiant-controller.js.map +0 -13
  363. package/dist/core/radiant-element.js +0 -3
  364. package/dist/core/radiant-element.js.map +0 -19
  365. package/dist/core/radiant-hydrator-state.js +0 -3
  366. package/dist/core/reactive-host.d.ts +0 -137
  367. package/dist/core/reactive-host.js +0 -3
  368. package/dist/core/reactive-host.js.map +0 -10
  369. package/dist/core/reactive-jsx-value.js +0 -3
  370. package/dist/core/reactive-jsx-value.js.map +0 -10
  371. package/dist/core/reactive-prop-metadata.js +0 -3
  372. package/dist/core/reactive-prop-metadata.js.map +0 -10
  373. package/dist/core/slot-projection-runtime.js +0 -3
  374. package/dist/core/slot-projection-runtime.js.map +0 -12
  375. package/dist/core/ssr-preparation.js +0 -3
  376. package/dist/decorators/attr.js +0 -3
  377. package/dist/decorators/attr.js.map +0 -16
  378. package/dist/decorators/bound.js +0 -3
  379. package/dist/decorators/bridge.js +0 -3
  380. package/dist/decorators/controller.js +0 -3
  381. package/dist/decorators/custom-element.js +0 -3
  382. package/dist/decorators/debounce.js +0 -3
  383. package/dist/decorators/event.js +0 -3
  384. package/dist/decorators/legacy/attr.js +0 -3
  385. package/dist/decorators/legacy/attr.js.map +0 -13
  386. package/dist/decorators/legacy/bound.js +0 -3
  387. package/dist/decorators/legacy/custom-element.js +0 -3
  388. package/dist/decorators/legacy/debounce.js +0 -3
  389. package/dist/decorators/legacy/event.js +0 -3
  390. package/dist/decorators/legacy/event.js.map +0 -13
  391. package/dist/decorators/legacy/instance-initializers.d.ts +0 -16
  392. package/dist/decorators/legacy/instance-initializers.js +0 -3
  393. package/dist/decorators/legacy/instance-initializers.js.map +0 -10
  394. package/dist/decorators/legacy/on-event.js +0 -3
  395. package/dist/decorators/legacy/on-event.js.map +0 -13
  396. package/dist/decorators/legacy/on-updated.js +0 -3
  397. package/dist/decorators/legacy/on-updated.js.map +0 -11
  398. package/dist/decorators/legacy/query-slot.js +0 -3
  399. package/dist/decorators/legacy/query-slot.js.map +0 -13
  400. package/dist/decorators/legacy/query.js +0 -3
  401. package/dist/decorators/legacy/query.js.map +0 -12
  402. package/dist/decorators/legacy/reactive-field.js +0 -3
  403. package/dist/decorators/legacy/reactive-field.js.map +0 -11
  404. package/dist/decorators/legacy/reactive-prop.js +0 -3
  405. package/dist/decorators/legacy/reactive-prop.js.map +0 -13
  406. package/dist/decorators/legacy/signal.js +0 -3
  407. package/dist/decorators/legacy/signal.js.map +0 -15
  408. package/dist/decorators/on-event.js +0 -3
  409. package/dist/decorators/on-updated.js +0 -3
  410. package/dist/decorators/on-updated.js.map +0 -14
  411. package/dist/decorators/prop.js +0 -3
  412. package/dist/decorators/prop.js.map +0 -16
  413. package/dist/decorators/query-slot.js +0 -3
  414. package/dist/decorators/query-slot.js.map +0 -16
  415. package/dist/decorators/query.js +0 -3
  416. package/dist/decorators/shared/reactive-attr.js +0 -3
  417. package/dist/decorators/shared/reactive-attr.js.map +0 -11
  418. package/dist/decorators/signal.js +0 -3
  419. package/dist/decorators/signal.js.map +0 -17
  420. package/dist/decorators/standard/attr.js +0 -3
  421. package/dist/decorators/standard/attr.js.map +0 -12
  422. package/dist/decorators/standard/bound.js +0 -3
  423. package/dist/decorators/standard/custom-element.js +0 -3
  424. package/dist/decorators/standard/debounce.js +0 -3
  425. package/dist/decorators/standard/event.js +0 -3
  426. package/dist/decorators/standard/on-event.js +0 -3
  427. package/dist/decorators/standard/on-updated.js +0 -3
  428. package/dist/decorators/standard/query-slot.js +0 -3
  429. package/dist/decorators/standard/query-slot.js.map +0 -11
  430. package/dist/decorators/standard/query.js +0 -3
  431. package/dist/decorators/standard/reactive-field.js +0 -3
  432. package/dist/decorators/standard/reactive-field.js.map +0 -10
  433. package/dist/decorators/standard/reactive-prop.js +0 -3
  434. package/dist/decorators/standard/signal.js +0 -3
  435. package/dist/decorators/standard/signal.js.map +0 -14
  436. package/dist/decorators/state.js +0 -3
  437. package/dist/decorators/state.js.map +0 -14
  438. package/dist/helpers/create-event-listener.js +0 -3
  439. package/dist/helpers/create-event.js +0 -3
  440. package/dist/helpers/create-query-slot.js +0 -3
  441. package/dist/helpers/create-query-slot.js.map +0 -10
  442. package/dist/helpers/create-query.js +0 -3
  443. package/dist/helpers/debounce.js +0 -3
  444. package/dist/helpers/index.js +0 -3
  445. package/dist/index.js +0 -3
  446. package/dist/index.js.map +0 -72
  447. package/dist/server/context-ssr.js +0 -3
  448. package/dist/server/html-parser.js +0 -3
  449. package/dist/server/install-light-dom-shim.js +0 -3
  450. package/dist/server/install-light-dom-shim.js.map +0 -12
  451. package/dist/server/light-dom-shim.js +0 -3
  452. package/dist/server/light-dom-shim.js.map +0 -11
  453. package/dist/server/project-root.js +0 -3
  454. package/dist/server/radiant-component-ssr-runtime.d.ts +0 -9
  455. package/dist/server/radiant-component-ssr-runtime.js +0 -3
  456. package/dist/server/radiant-component-ssr-runtime.js.map +0 -17
  457. package/dist/server/render-component.js +0 -3
  458. package/dist/server/render-component.js.map +0 -20
  459. package/dist/server/render-controller.js +0 -3
  460. package/dist/server/render-controller.js.map +0 -23
  461. package/dist/server/slot-projection-html.js +0 -3
  462. package/dist/signals/host-resource.js +0 -3
  463. package/dist/signals/host-signal.js +0 -3
  464. package/dist/signals/host-signal.js.map +0 -13
  465. package/dist/signals/hydration-script.js +0 -3
  466. package/dist/tools/escape-css-identifier.js +0 -3
  467. package/dist/tools/escape-css-identifier.js.map +0 -10
  468. package/dist/tools/escape-script-json.js +0 -3
  469. package/dist/tools/event-emitter.js +0 -3
  470. package/dist/tools/index.js +0 -3
  471. package/dist/tools/render-jsx-template.js +0 -3
  472. package/dist/types.js +0 -3
  473. package/dist/utils/attribute-utils.js +0 -3
  474. package/dist/utils/index.js +0 -3
  475. package/size-budget.json +0 -25
  476. /package/{dist/client → client}/hydrator.d.ts +0 -0
  477. /package/{dist/client → client}/install-hydrator.d.ts +0 -0
  478. /package/{dist/context → context}/context-consumer-bootstrap.d.ts +0 -0
  479. /package/{dist/context → context}/context-consumer-runtime.d.ts +0 -0
  480. /package/{dist/context → context}/context-host.d.ts +0 -0
  481. /package/{dist/context → context}/context-provider.d.ts +0 -0
  482. /package/{dist/context → context}/context-ssr-bridge.d.ts +0 -0
  483. /package/{dist/context → context}/create-context.d.ts +0 -0
  484. /package/{dist/context → context}/decorators/consume-context.d.ts +0 -0
  485. /package/{dist/context → context}/decorators/context-selection-delivery.d.ts +0 -0
  486. /package/{dist/context → context}/decorators/context-selector.d.ts +0 -0
  487. /package/{dist/context → context}/decorators/legacy/consume-context.d.ts +0 -0
  488. /package/{dist/context → context}/decorators/legacy/context-selector-field.d.ts +0 -0
  489. /package/{dist/context → context}/decorators/legacy/context-selector.d.ts +0 -0
  490. /package/{dist/context → context}/decorators/legacy/provide-context.d.ts +0 -0
  491. /package/{dist/context → context}/decorators/on-context-update.d.ts +0 -0
  492. /package/{dist/context → context}/decorators/provide-context.d.ts +0 -0
  493. /package/{dist/context → context}/decorators/standard/consume-context.d.ts +0 -0
  494. /package/{dist/context → context}/decorators/standard/context-selector-field.d.ts +0 -0
  495. /package/{dist/context → context}/decorators/standard/context-selector.d.ts +0 -0
  496. /package/{dist/context → context}/decorators/standard/provide-context.d.ts +0 -0
  497. /package/{dist/context → context}/events.d.ts +0 -0
  498. /package/{dist/context → context}/hydration-script.d.ts +0 -0
  499. /package/{dist/context → context}/index.d.ts +0 -0
  500. /package/{dist/context → context}/types.d.ts +0 -0
  501. /package/{dist/context → context}/types.js +0 -0
  502. /package/{dist/context → context}/types.js.map +0 -0
  503. /package/{dist/controller-registry.d.ts → controller-registry.d.ts} +0 -0
  504. /package/{dist/core → core}/controller-metadata.d.ts +0 -0
  505. /package/{dist/core → core}/custom-element-metadata.d.ts +0 -0
  506. /package/{dist/core → core}/hydration-codec.d.ts +0 -0
  507. /package/{dist/core → core}/radiant-hydrator-state.d.ts +0 -0
  508. /package/{dist/core → core}/slot-projection-runtime.d.ts +0 -0
  509. /package/{dist/core → core}/ssr-hydration-binding.d.ts +0 -0
  510. /package/{dist/core → core}/ssr-hydration-binding.js +0 -0
  511. /package/{dist/core → core}/ssr-hydration-binding.js.map +0 -0
  512. /package/{dist/core → core}/ssr-preparation.d.ts +0 -0
  513. /package/{dist/decorators → decorators}/attr.d.ts +0 -0
  514. /package/{dist/decorators → decorators}/bound.d.ts +0 -0
  515. /package/{dist/decorators → decorators}/bridge.d.ts +0 -0
  516. /package/{dist/decorators → decorators}/controller.d.ts +0 -0
  517. /package/{dist/decorators → decorators}/custom-element.d.ts +0 -0
  518. /package/{dist/decorators → decorators}/debounce.d.ts +0 -0
  519. /package/{dist/decorators → decorators}/event.d.ts +0 -0
  520. /package/{dist/decorators → decorators}/legacy/attr.d.ts +0 -0
  521. /package/{dist/decorators → decorators}/legacy/bound.d.ts +0 -0
  522. /package/{dist/decorators → decorators}/legacy/custom-element.d.ts +0 -0
  523. /package/{dist/decorators → decorators}/legacy/debounce.d.ts +0 -0
  524. /package/{dist/decorators → decorators}/legacy/event.d.ts +0 -0
  525. /package/{dist/decorators → decorators}/legacy/on-event.d.ts +0 -0
  526. /package/{dist/decorators → decorators}/legacy/query-slot.d.ts +0 -0
  527. /package/{dist/decorators → decorators}/legacy/query.d.ts +0 -0
  528. /package/{dist/decorators → decorators}/legacy/reactive-field.d.ts +0 -0
  529. /package/{dist/decorators → decorators}/on-event.d.ts +0 -0
  530. /package/{dist/decorators → decorators}/on-updated.d.ts +0 -0
  531. /package/{dist/decorators → decorators}/query-slot.d.ts +0 -0
  532. /package/{dist/decorators → decorators}/query.d.ts +0 -0
  533. /package/{dist/decorators → decorators}/signal.d.ts +0 -0
  534. /package/{dist/decorators → decorators}/standard/attr.d.ts +0 -0
  535. /package/{dist/decorators → decorators}/standard/bound.d.ts +0 -0
  536. /package/{dist/decorators → decorators}/standard/custom-element.d.ts +0 -0
  537. /package/{dist/decorators → decorators}/standard/debounce.d.ts +0 -0
  538. /package/{dist/decorators → decorators}/standard/event.d.ts +0 -0
  539. /package/{dist/decorators → decorators}/standard/on-event.d.ts +0 -0
  540. /package/{dist/decorators → decorators}/standard/on-updated.d.ts +0 -0
  541. /package/{dist/decorators → decorators}/standard/query.d.ts +0 -0
  542. /package/{dist/decorators → decorators}/standard/reactive-field.d.ts +0 -0
  543. /package/{dist/helpers → helpers}/create-event-listener.d.ts +0 -0
  544. /package/{dist/helpers → helpers}/create-event.d.ts +0 -0
  545. /package/{dist/helpers → helpers}/create-query.d.ts +0 -0
  546. /package/{dist/helpers → helpers}/debounce.d.ts +0 -0
  547. /package/{dist/helpers → helpers}/index.d.ts +0 -0
  548. /package/{dist/index.d.ts → index.d.ts} +0 -0
  549. /package/{dist/server → server}/context-ssr.d.ts +0 -0
  550. /package/{dist/server → server}/html-parser.d.ts +0 -0
  551. /package/{dist/server → server}/install-light-dom-shim.d.ts +0 -0
  552. /package/{dist/server → server}/project-root.d.ts +0 -0
  553. /package/{dist/server → server}/render-controller.d.ts +0 -0
  554. /package/{dist/server → server}/slot-projection-html.d.ts +0 -0
  555. /package/{dist/signals → signals}/host-resource.d.ts +0 -0
  556. /package/{dist/signals → signals}/hydration-script.d.ts +0 -0
  557. /package/{dist/tools → tools}/escape-css-identifier.d.ts +0 -0
  558. /package/{dist/tools → tools}/escape-script-json.d.ts +0 -0
  559. /package/{dist/tools → tools}/event-emitter.d.ts +0 -0
  560. /package/{dist/tools → tools}/index.d.ts +0 -0
  561. /package/{dist/tools → tools}/render-jsx-template.d.ts +0 -0
  562. /package/{dist/types.d.ts → types.d.ts} +0 -0
  563. /package/{dist/utils → utils}/attribute-utils.d.ts +0 -0
  564. /package/{dist/utils → utils}/index.d.ts +0 -0
@@ -0,0 +1,3 @@
1
+ var{defineProperty:n,getOwnPropertyNames:d,getOwnPropertyDescriptor:g}=Object,u=Object.prototype.hasOwnProperty;function T(e){return this[e]}var H=(e)=>{var m=(E??=new WeakMap).get(e),r;if(m)return m;if(m=n({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var l of d(e))if(!u.call(m,l))n(m,l,{get:T.bind(e,l),enumerable:!(r=g(e,l))||r.enumerable})}return E.set(e,m),m},E;var b=(e)=>e;function y(e,m){this[e]=b.bind(null,m)}var j=(e,m)=>{for(var r in m)n(e,r,{get:m[r],enumerable:!0,configurable:!0,set:y.bind(m,r)})};var x=(e,m)=>()=>(e&&(m=e(e=0)),m);var C=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(m,r)=>(typeof require<"u"?require:m)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function S(e,m={}){let r=null,l,t=()=>{if(m.all)return e.getSlotElements(m.name);return e.getSlotElements(m.name)[0]??null};return{get value(){if(m.cache===!1)return t();let f=e.slotProjectionVersion??0;if(l!==f)r=t(),l=f;return r}}}function I(e={}){return function(m,r){let l=String(r.name);r.addInitializer(function(){let t=S(this,e);Object.defineProperty(this,l,{get(){return t.value},enumerable:!0,configurable:!0})})}}export{I as querySlot};
2
+
3
+ //# debugId=466A9D60A5C69E1E64756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/helpers/create-query-slot.ts", "../src/decorators/standard/query-slot.ts"],
4
+ "sourcesContent": [
5
+ "export type QuerySlotConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tname?: string;\n};\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n};\n\ntype QuerySlotResult<T extends Element | Element[] | null> = {\n\tget value(): T | null;\n};\n\n/**\n * Creates a lazy slot query accessor bound to a host element.\n * Functional equivalent of the `@querySlot` decorator for vanilla JS usage.\n * @param host The host element to query slots within.\n * @param options {@link QuerySlotConfig} The slot query configuration.\n */\nexport function createQuerySlot<T extends Element | Element[] | null = Element | null>(\n\thost: SlotQueryHost,\n\toptions: QuerySlotConfig = {},\n): QuerySlotResult<T> {\n\tlet cached: T | null = null;\n\tlet cachedVersion: number | undefined;\n\n\tconst executeQuery = (): T | null => {\n\t\tif (options.all) {\n\t\t\treturn host.getSlotElements(options.name) as T;\n\t\t}\n\t\treturn (host.getSlotElements(options.name)[0] ?? null) as T | null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache === false) {\n\t\t\t\treturn executeQuery();\n\t\t\t}\n\n\t\t\tconst currentVersion = (host as unknown as Record<string, number | undefined>).slotProjectionVersion ?? 0;\n\n\t\t\tif (cachedVersion !== currentVersion) {\n\t\t\t\tcached = executeQuery();\n\t\t\t\tcachedVersion = currentVersion;\n\t\t\t}\n\n\t\t\treturn cached;\n\t\t},\n\t};\n}\n",
6
+ "import { createQuerySlot } from '../../helpers/create-query-slot';\nimport type { QuerySlotConfig } from '../query-slot';\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n\tslotProjectionVersion?: number;\n};\n\nexport function querySlot(options: QuerySlotConfig = {}) {\n\treturn function <T extends SlotQueryHost, V extends Element | Element[] | null>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tvoid target;\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuerySlot<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n"
7
+ ],
8
+ "mappings": "i0BAoBO,SAAS,CAAsE,CACrF,EACA,EAA2B,CAAC,EACP,CACrB,IAAI,EAAmB,KACnB,EAEE,EAAe,IAAgB,CACpC,GAAI,EAAQ,IACX,OAAO,EAAK,gBAAgB,EAAQ,IAAI,EAEzC,OAAQ,EAAK,gBAAgB,EAAQ,IAAI,EAAE,IAAM,MAGlD,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,QAAU,GACrB,OAAO,EAAa,EAGrB,IAAM,EAAkB,EAAuD,uBAAyB,EAExG,GAAI,IAAkB,EACrB,EAAS,EAAa,EACtB,EAAgB,EAGjB,OAAO,EAET,ECzCM,SAAS,CAAS,CAAC,EAA2B,CAAC,EAAG,CACxD,OAAO,QAAwE,CAC9E,EACA,EACC,CAED,IAAM,EAAe,OAAO,EAAQ,IAAI,EAExC,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAW,EAAmB,KAAM,CAAO,EAEjD,OAAO,eAAe,KAAM,EAAc,CACzC,GAAG,EAAG,CACL,OAAO,EAAS,OAEjB,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
9
+ "debugId": "466A9D60A5C69E1E64756E2164756E21",
10
+ "names": []
11
+ }
@@ -0,0 +1,3 @@
1
+ var{defineProperty:j,getOwnPropertyNames:N,getOwnPropertyDescriptor:P}=Object,y=Object.prototype.hasOwnProperty;function z(f){return this[f]}var L=(f)=>{var m=(H??=new WeakMap).get(f),V;if(m)return m;if(m=j({},"__esModule",{value:!0}),f&&typeof f==="object"||typeof f==="function"){for(var b of N(f))if(!y.call(m,b))j(m,b,{get:z.bind(f,b),enumerable:!(V=P(f,b))||V.enumerable})}return H.set(f,m),m},H;var A=(f)=>f;function B(f,m){this[f]=A.bind(null,m)}var O=(f,m)=>{for(var V in m)j(f,V,{get:m[V],enumerable:!0,configurable:!0,set:B.bind(m,V)})};var U=(f,m)=>()=>(f&&(m=f(f=0)),m);var W=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(m,V)=>(typeof require<"u"?require:m)[V]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});function D(f){return!(f instanceof Element)}function F(f){return"shadowRoot"in f?f.shadowRoot??null:null}function G(f){return f instanceof Element?f:f.host}function K(f,m="light"){let V=F(f);if(m==="shadow")return V?[V]:[];if(m==="both")return V?[f,V]:[f];return[f]}function I(f,m){if(D(f)&&m.scope&&m.scope!=="light")throw Error("RadiantController queries only support light DOM scope.");let V=G(f),b="selector"in m?m.selector:`[data-ref="${m.ref}"]`,E=null,u=()=>{let x=K(V,m.scope);if(m.all)return x.flatMap((T)=>Array.from(T.querySelectorAll(b)));for(let T of x){let C=T.querySelector(b);if(C)return C}return null};return{get value(){if(m.cache){if(E===null||m.all&&Array.isArray(E)&&!E.length)E=u();return E}return u()}}}function _(f){return function(m,V){let b=String(V.name);V.addInitializer(function(){let E=I(this,f);Object.defineProperty(this,b,{get(){return E.value},enumerable:!0,configurable:!0})})}}export{_ as query};
2
+
3
+ //# debugId=97A854DFEC25C99A64756E2164756E21
@@ -5,7 +5,7 @@
5
5
  "type BaseQueryConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tscope?: QueryScope;\n};\n\ntype QueryBySelector = { selector: string };\n\ntype QueryByRef = { ref: string };\n\nexport type QueryHostTarget = Element | { host: Element };\n\n/**\n * Selects which DOM tree a query should read from.\n */\nexport type QueryScope = 'light' | 'shadow' | 'both';\n\nexport type QueryConfig = BaseQueryConfig & (QueryBySelector | QueryByRef);\n\ntype QueryRoot = Element | ShadowRoot;\n\ntype QueryResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\nfunction isControllerQueryTarget(target: QueryHostTarget): target is { host: Element } {\n\treturn !(target instanceof Element);\n}\n\nfunction resolveShadowRoot(host: Element): ShadowRoot | null {\n\treturn 'shadowRoot' in host ? ((host as Element & { shadowRoot?: ShadowRoot | null }).shadowRoot ?? null) : null;\n}\n\n/**\n * Resolves the DOM element that should serve as the query root.\n *\n * `@query(...)` can run on both element hosts and controller instances. This\n * helper normalizes those call sites to the underlying element that actually\n * owns the DOM subtree.\n */\nexport function resolveQueryHost(target: QueryHostTarget): Element {\n\treturn target instanceof Element ? target : target.host;\n}\n\nfunction getQueryRoots(host: Element, scope: QueryScope = 'light'): QueryRoot[] {\n\tconst shadowRoot = resolveShadowRoot(host);\n\n\tif (scope === 'shadow') {\n\t\treturn shadowRoot ? [shadowRoot] : [];\n\t}\n\n\tif (scope === 'both') {\n\t\treturn shadowRoot ? [host, shadowRoot] : [host];\n\t}\n\n\treturn [host];\n}\n\n/**\n * Creates a lazy DOM query accessor bound to an element host or controller.\n * Functional equivalent of the `@query` decorator for vanilla JS usage.\n * @param target The element host or controller to query within.\n * @param options {@link QueryConfig} The query configuration.\n */\nexport function createQuery<T extends Element | Element[] = Element>(\n\ttarget: QueryHostTarget,\n\toptions: QueryConfig,\n): QueryResult<T> {\n\tif (isControllerQueryTarget(target) && options.scope && options.scope !== 'light') {\n\t\tthrow new Error('RadiantController queries only support light DOM scope.');\n\t}\n\n\tconst host = resolveQueryHost(target);\n\tconst selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n\tlet cached: T | null = null;\n\n\tconst executeQuery = (): T | null => {\n\t\tconst roots = getQueryRoots(host, options.scope);\n\n\t\tif (options.all) {\n\t\t\treturn roots.flatMap((root) => Array.from(root.querySelectorAll(selector))) as T;\n\t\t}\n\n\t\tfor (const root of roots) {\n\t\t\tconst match = root.querySelector(selector);\n\t\t\tif (match) {\n\t\t\t\treturn match as T;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache) {\n\t\t\t\tif (cached === null || (options.all && Array.isArray(cached) && !cached.length)) {\n\t\t\t\t\tcached = executeQuery();\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\treturn executeQuery();\n\t\t},\n\t};\n}\n",
6
6
  "import { createQuery, type QueryHostTarget } from '../../helpers/create-query';\nimport type { QueryConfig } from '../query';\n\nexport function query(options: QueryConfig) {\n\treturn function <T extends QueryHostTarget, V extends Element | Element[]>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tvoid target;\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuery<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n"
7
7
  ],
8
- "mappings": "2PAyBA,SAAS,CAAuB,CAAC,EAAsD,CACtF,MAAO,EAAE,aAAkB,SAG5B,SAAS,CAAiB,CAAC,EAAkC,CAC5D,MAAO,eAAgB,EAAS,EAAsD,YAAc,KAAQ,KAUtG,SAAS,CAAgB,CAAC,EAAkC,CAClE,OAAO,aAAkB,QAAU,EAAS,EAAO,KAGpD,SAAS,CAAa,CAAC,EAAe,EAAoB,QAAsB,CAC/E,IAAM,EAAa,EAAkB,CAAI,EAEzC,GAAI,IAAU,SACb,OAAO,EAAa,CAAC,CAAU,EAAI,CAAC,EAGrC,GAAI,IAAU,OACb,OAAO,EAAa,CAAC,EAAM,CAAU,EAAI,CAAC,CAAI,EAG/C,MAAO,CAAC,CAAI,EASN,SAAS,CAAoD,CACnE,EACA,EACiB,CACjB,GAAI,EAAwB,CAAM,GAAK,EAAQ,OAAS,EAAQ,QAAU,QACzE,MAAU,MAAM,yDAAyD,EAG1E,IAAM,EAAO,EAAiB,CAAM,EAC9B,EAAW,aAAc,EAAU,EAAQ,SAAW,cAAc,EAAQ,QAC9E,EAAmB,KAEjB,EAAe,IAAgB,CACpC,IAAM,EAAQ,EAAc,EAAM,EAAQ,KAAK,EAE/C,GAAI,EAAQ,IACX,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E,MAAU,MAAM,yDAAyD,EAG1E,IAAM,EAAO,EAAiB,CAAM,EAC9B,EAAW,aAAc,EAAU,EAAQ,SAAW,cAAc,EAAQ,QAC9E,EAAmB,KAEjB,EAAe,IAAgB,CACpC,IAAM,EAAQ,EAAc,EAAM,EAAQ,KAAK,EAE/C,GAAI,EAAQ,IACX,OAAO,EAAM,QAAQ,CAAC,IAAS,MAAM,KAAK,EAAK,iBAAiB,CAAQ,CAAC,CAAC,EAG3E,QAAW,KAAQ,EAAO,CACzB,IAAM,EAAQ,EAAK,cAAc,CAAQ,EACzC,GAAI,EACH,OAAO,EAIT,OAAO,MAGR,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,MAAO,CAClB,GAAI,IAAW,MAAS,EAAQ,KAAO,MAAM,QAAQ,CAAM,GAAK,CAAC,EAAO,OACvE,EAAS,EAAa,EAEvB,OAAO,EAER,OAAO,EAAa,EAEtB,ECpGM,SAAS,CAAK,CAAC,EAAsB,CAC3C,OAAO,QAAmE,CACzE,EACA,EACC,CAED,IAAM,EAAe,OAAO,EAAQ,IAAI,EAExC,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAW,EAAe,KAAM,CAAO,EAE7C,OAAO,eAAe,KAAM,EAAc,CACzC,GAAG,EAAG,CACL,OAAO,EAAS,OAEjB,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
9
+ "debugId": "97A854DFEC25C99A64756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -0,0 +1,3 @@
1
+ var{defineProperty:n,getOwnPropertyNames:c,getOwnPropertyDescriptor:d}=Object,u=Object.prototype.hasOwnProperty;function p(e){return this[e]}var f=(e)=>{var t=(s??=new WeakMap).get(e),i;if(t)return t;if(t=n({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of c(e))if(!u.call(t,o))n(t,o,{get:p.bind(e,o),enumerable:!(i=d(e,o))||i.enumerable})}return s.set(e,t),t},s;var l=(e)=>e;function v(e,t){this[e]=l.bind(null,t)}var m=(e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0,configurable:!0,set:v.bind(t,i)})};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var R=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,i)=>(typeof require<"u"?require:t)[i]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function a(e){return e.shouldAutoBindReactiveMembers?.()??!1}function V(e,t){let i=String(t.name),o=Symbol(`@ecopages/radiant/state:${i}:initializer`);return t.addInitializer(function(){let r=this[o];this.createReactiveField(i,r,{bind:a(this),suppressInitialNotify:!0})}),function(r){return this[o]=r,r}}export{V as reactiveField};
2
+
3
+ //# debugId=777FC839589F09A364756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/shared/auto-bind.ts", "../src/decorators/standard/reactive-field.ts"],
4
+ "sourcesContent": [
5
+ "import type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\ntype AutoBindHost = ReactiveHostLike & {\n\tshouldAutoBindReactiveMembers?: () => boolean;\n};\n\nexport function resolveHostAutoBind(host: AutoBindHost): ReactiveBindingOption {\n\treturn host.shouldAutoBindReactiveMembers?.() ?? false;\n}\n",
6
+ "import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\n\nexport function reactiveField<T extends ReactiveHostLike, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\tconst contextName = String(context.name);\n\tconst initializerValueKey = Symbol(`@ecopages/radiant/state:${contextName}:initializer`);\n\n\tcontext.addInitializer(function (this: T) {\n\t\tconst initializerValue = (this as Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\tthis.createReactiveField(contextName, initializerValue as V, {\n\t\t\tbind: resolveHostAutoBind(this),\n\t\t\tsuppressInitialNotify: true,\n\t\t});\n\t});\n\n\treturn function (this: T, value: V) {\n\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\treturn value;\n\t};\n}\n"
7
+ ],
8
+ "mappings": "i0BAOO,SAAS,CAAmB,CAAC,EAA2C,CAC9E,OAAO,EAAK,gCAAgC,GAAK,GCL3C,SAAS,CAA4C,CAAC,EAAc,EAA2C,CACrH,IAAM,EAAc,OAAO,EAAQ,IAAI,EACjC,EAAsB,OAAO,2BAA2B,eAAyB,EAUvF,OARA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAA4C,GACtE,KAAK,oBAAoB,EAAa,EAAuB,CAC5D,KAAM,EAAoB,IAAI,EAC9B,sBAAuB,EACxB,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAA4C,GAAuB,EAC7D",
9
+ "debugId": "777FC839589F09A364756E2164756E21",
10
+ "names": []
11
+ }
@@ -1,4 +1,4 @@
1
- import type { ReactivePropertyOptions } from '../../core/radiant-element.js';
1
+ import { type ReactivePropertyOptions } from '../../core/reactive-prop-core.js';
2
2
  type ReactivePropHost<P> = {
3
3
  createReactiveProp(propertyName: string, options: ReactivePropertyOptions<P>): void;
4
4
  };
@@ -0,0 +1,3 @@
1
+ var{defineProperty:D,getOwnPropertyNames:$,getOwnPropertyDescriptor:x}=Object,B=Object.prototype.hasOwnProperty;function U(o){return this[o]}var K=(o)=>{var R=(k??=new WeakMap).get(o),n;if(R)return R;if(R=D({},"__esModule",{value:!0}),o&&typeof o==="object"||typeof o==="function"){for(var P of $(o))if(!B.call(R,P))D(R,P,{get:U.bind(o,P),enumerable:!(n=x(o,P))||n.enumerable})}return k.set(o,R),R},k;var m=(o)=>o;function h(o,R){this[o]=m.bind(null,R)}var i=(o,R)=>{for(var n in R)D(o,n,{get:R[n],enumerable:!0,configurable:!0,set:h.bind(R,n)})};var b=(o,R)=>()=>(o&&(R=o(o=0)),R);var f=((o)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(R,n)=>(typeof require<"u"?require:R)[n]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var _=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function q(o,R,n){let P=o.constructor,c=P[_]??[];if(c.some((I)=>I.name===R))return;c.push({name:R,options:n}),P[_]=c}function p(o){return(o.constructor[_]??[]).slice()}function L(o){switch(o){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function z(o){switch(typeof o){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(o))return"array";if(Object.prototype.toString.call(o)==="[object Object]")return"object"}function J(o){switch(o){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function S(o){try{return JSON.parse(o)}catch{throw TypeError("Invalid JSON string")}}var g={array(o){let R=S(o);if(!Array.isArray(R))throw TypeError(`Expected an array but got a value of type "${typeof R}"`);return R},boolean(o){return!(o==="0"||String(o).toLowerCase()==="false")},number(o){return Number(o.replace(/_/g,""))},object(o){let R=JSON.parse(o);if(R===null||typeof R!=="object"||Array.isArray(R))throw TypeError(`expected value of type "object" but instead got value "${o}" of type "${z(R)}"`);return R},string(o){return o}},G={default:M,array:H,object:H};function H(o){return JSON.stringify(o)}function M(o){return`${o}`}function C(o,R){let n=L(R);if(!n)throw TypeError(`[radiant-element] Unknown type "${R}"`);return g[n](o)}function Q(o,R){let n=L(R);if(!n)throw TypeError(`[radiant-element] Unknown type "${R}"`);return(G[n]??G.default??M)(o)}function j(o){return typeof o==="boolean"}function T(o){return typeof o==="number"}function A(o){return typeof o==="string"}function N(o){return Array.isArray(o)}function w(o){return typeof o==="object"&&!Array.isArray(o)&&o!==null}function X(o,R){switch(o){case Boolean:return j(R);case Number:return T(R);case String:return A(R);case Array:return N(R);case Object:return w(R);default:return!1}}var V=(o,R,n,P)=>{if(R===Boolean){let I=o.getAttribute(n);if(I===null)return P;return I===""?!0:C(I,R)}let c=o.getAttribute(n);return c!==null?C(c,R):P??J(R)};function Y(o,R){if(R!==void 0&&!X(o,R))throw Error(`defaultValue does not match the expected type for ${o.name}`)}function l(o,R,n,P){return{type:n,name:o,initialValue:P,attribute:R,converter:{fromAttribute:(c)=>C(c,n),toAttribute:(c)=>Q(c,n)}}}function e({type:o,attribute:R,reflect:n,defaultValue:P,bind:c}){return Y(o,P),function(I,O){let E=String(O.name),W=R??E,F=Symbol(`@ecopages/radiant/reactive-prop:${E}:initializer`);return O.addInitializer(function(){let s=this[F],Z=P===void 0?s:P;q(this,E,{type:o,reflect:n,attribute:W,defaultValue:P,bind:c}),this.createReactiveProp(E,{type:o,reflect:n,attribute:W,defaultValue:Z,bind:c})}),function(s){return this[F]=s,s}}}export{e as reactiveProp};
2
+
3
+ //# debugId=BA2727CC6F2C320D64756E2164756E21
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/core/reactive-prop-metadata.ts", "../src/utils/attribute-utils.ts", "../src/core/reactive-prop-core.ts", "../src/decorators/standard/reactive-prop.ts"],
4
+ "sourcesContent": [
5
+ "import type { ReactivePropertyOptions } from './reactive-prop-core';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
6
+ "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",
7
+ "import type { JsxBindingSourceValue, JsxRenderable, SubscribableJsxValueWithAccess } from '@ecopages/jsx';\nimport type { ReactiveState } from './reactivity-contract';\nimport {\n\ttype AttributeTypeConstant,\n\ttype ReadAttributeValueReturnType,\n\ttype WriteAttributeValueReturnType,\n\tisValueOfType,\n\treadAttributeValue,\n\twriteAttributeValue,\n} from '../utils/attribute-utils';\n\ntype StringPropertyKey<Value> = Extract<keyof Value, string>;\n\nexport interface ReactiveProperty<T = unknown> {\n\ttype: AttributeTypeConstant;\n\tinitialValue?: T;\n\tname: string;\n\tattribute: string;\n\tconverter: {\n\t\tfromAttribute: (value: string) => ReadAttributeValueReturnType;\n\t\ttoAttribute: (value: any) => WriteAttributeValueReturnType;\n\t};\n}\n\nexport type ReactivePropertyOptions<T> = {\n\ttype: AttributeTypeConstant;\n\treflect?: boolean;\n\tattribute?: string;\n\tdefaultValue?: T;\n\tbind?: boolean | string;\n};\n\nexport type ReactiveBindingOption = boolean | string;\n\nexport type ReactiveFieldOptions = {\n\tbind?: ReactiveBindingOption;\n\t/** When true, skip the initial notifyUpdate emitted while defining the field. */\n\tsuppressInitialNotify?: boolean;\n};\n\nexport type ReactiveBindingValue<\n\tHost extends object,\n\tProperty extends StringPropertyKey<Host>,\n> = Host[Property] extends JsxBindingSourceValue ? Host[Property] : JsxRenderable;\n\nexport type ReactiveBindings<Bindings extends object> = {\n\treadonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValueWithAccess<\n\t\tReactiveBindingValue<Bindings, Property>\n\t>;\n};\n\nexport type ReactiveAccessorDefinition<T> = {\n\tbind?: ReactiveBindingOption;\n\tsignal: ReactiveState<T>;\n\tonSet?: (value: T) => void;\n};\n\nexport function validateReactivePropertyDefault(type: AttributeTypeConstant, defaultValue: unknown): void {\n\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t}\n}\n\nexport function createReactivePropertyMapping<T>(\n\tpropertyName: string,\n\tattributeKey: string,\n\ttype: AttributeTypeConstant,\n\tinitialValue: T | undefined,\n): ReactiveProperty<T> {\n\treturn {\n\t\ttype,\n\t\tname: propertyName,\n\t\tinitialValue,\n\t\tattribute: attributeKey,\n\t\tconverter: {\n\t\t\tfromAttribute: (value) => readAttributeValue(value, type),\n\t\t\ttoAttribute: (value) => writeAttributeValue(value, type),\n\t\t},\n\t};\n}\n",
8
+ "import { type ReactivePropertyOptions, validateReactivePropertyDefault } from '../../core/reactive-prop-core.js';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\n\ntype ReactivePropHost<P> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<P>): void;\n};\n\n/**\n * Standard-decorator implementation for `@prop(...)`.\n *\n * The decorated host is expected to expose `createReactiveProp(...)`, which\n * lets both `RadiantElement` and `RadiantController` share the same public\n * decorator while keeping their runtime channels different.\n */\nexport function reactiveProp<P = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<P>) {\n\tvalidateReactivePropertyDefault(type, defaultValue);\n\treturn function <T extends ReactivePropHost<P>, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\t\tconst propertyName = String(context.name);\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tconst initializerValueKey = Symbol(`@ecopages/radiant/reactive-prop:${propertyName}:initializer`);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst initializerValue = (this as T & Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\t\tconst resolvedDefaultValue = (defaultValue === undefined ? initializerValue : defaultValue) as\n\t\t\t\tP | undefined;\n\n\t\t\tregisterReactivePropDefinition(this, propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t\tthis.createReactiveProp(propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue: resolvedDefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t});\n\n\t\treturn function (this: T, value: V) {\n\t\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\t\treturn value;\n\t\t};\n\t};\n}\n"
9
+ ],
10
+ "mappings": "i0BAEA,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,CAA8B,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAc,EAAO,YACrB,EAAc,EAAY,IAA8B,CAAC,EAE/D,GAAI,EAAY,KAAK,CAAC,IAAe,EAAW,OAAS,CAAY,EACpE,OAGD,EAAY,KAAK,CAAE,KAAM,EAAc,SAAQ,CAAC,EAChD,EAAY,GAA6B,EAGnC,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM,EClBtG,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,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AsB,OAAO,mCAAmC,eAA0B,EAuBhG,OArBA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAAgD,GACpE,EAAwB,IAAiB,OAAY,EAAmB,EAG9E,EAA+B,KAAM,EAAc,CAClD,OACA,UACA,UAAW,EACX,eACA,MACD,CAAC,EACD,KAAK,mBAAmB,EAAc,CACrC,OACA,UACA,UAAW,EACX,aAAc,EACd,MACD,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAA4C,GAAuB,EAC7D",
11
+ "debugId": "BA2727CC6F2C320D64756E2164756E21",
12
+ "names": []
13
+ }
@@ -1,5 +1,5 @@
1
1
  import type { WritableSignal } from '@ecopages/signals';
2
- import type { ReactiveBindingOption } from '../../core/radiant-element';
2
+ import type { ReactiveBindingOption } from '../../core/reactive-prop-core';
3
3
  import type { ReactiveHostLike } from '../../core/reactive-host';
4
4
  import type { AttributeTypeConstant } from '../../utils/attribute-utils';
5
5
  /** Options for the `@signal` decorator. */
@@ -0,0 +1,3 @@
1
+ var{defineProperty:w,getOwnPropertyNames:_,getOwnPropertyDescriptor:k}=Object,A=Object.prototype.hasOwnProperty;function E(q){return this[q]}var H=(q)=>{var G=(L??=new WeakMap).get(q),Q;if(G)return G;if(G=w({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var X of _(q))if(!A.call(G,X))w(G,X,{get:E.bind(q,X),enumerable:!(Q=k(q,X))||Q.enumerable})}return L.set(q,G),G},L;var I=(q)=>q;function N(q,G){this[q]=I.bind(null,G)}var V=(q,G)=>{for(var Q in G)w(q,Q,{get:G[Q],enumerable:!0,configurable:!0,set:N.bind(G,Q)})};var c=(q,G)=>()=>(q&&(G=q(q=0)),G);var T=((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 W(q){return q.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var J="data-hydration",f="data-hydration-type",B="data-hydration-key";function z(q){let G=q.hydrationKey?` ${B}="${m(q.hydrationKey)}"`:"";return`<script type="application/json" ${J} ${f}="${q.type}"${G}>${q.serializedValue}</script>`}function C(q){return W(q)}function O(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 ${J}>:`,Q.slice(0,120));return G}}function D(q,G,Q){let X=q.children;if(!X||X.length===0){let Z=q.childNodes;if(!Z||Z.length===0)return null;for(let $=0;$<Z.length;$+=1){let M=Z[$];if(M.nodeType!==1)continue;let j=M;if(P(j,G,Q))return j}return null}for(let Z=0;Z<X.length;Z+=1)if(P(X[Z],G,Q))return X[Z];return null}function P(q,G,Q){if(q.tagName!=="SCRIPT"||!q.hasAttribute(J)||q.getAttribute(f)!==G)return!1;if(Q!==void 0)return q.getAttribute(B)===Q;return!q.hasAttribute(B)}function m(q){return q.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function U(q){return q.shouldAutoBindReactiveMembers?.()??!1}function x(q){return z({type:"signal",...q})}function K(q){return C(q)}import{createMarkupNodeLike as v}from"@ecopages/jsx";import{state as S}from"@ecopages/signals";function b(q){return typeof q==="object"&&q!==null&&typeof q.get==="function"&&typeof q.set==="function"&&typeof q.subscribe==="function"&&typeof q.update==="function"}class g{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??S(this.resolveInitialValue(q.initialValue)),this.currentValue=this.source.get(),this.host.registerReactiveMember(this.property,this.source)}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))this.currentValue=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()}renderHydrationScript(){let q=this.renderHydrationScriptTag();if(!q)return;return v(q)}renderHydrationScriptTag(){let q=this.serializeHydrationValue();if(!q)return;return x({hydrationKey:this.hydrationKey,serializedValue:q})}findHydrationScriptElement(){if(!(this.host instanceof Element))return null;return D(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=O(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 K(q)}handleSourceChange(q){this.currentValue=q}}function R(q){return new g(q)}function Y(q){return typeof q.registerHydrationBinding==="function"}function Q0(q={}){return function(G,Q){let X=String(Q.name);return function(Z){let $=typeof q.source==="function"?q.source(this):q.source??(b(Z)?Z:void 0),M=$!==void 0?q.initial:Z===void 0?q.initial:Z,j=q.bind??U(this);this.defineReactiveBinding(X,j);let F=R({host:this,hydrate:q.hydrate,hydrationKey:X,initialValue:M,property:X,source:$});if(this.registerConnectedCallback(()=>{F.hydrateFromHost(),F.connectToSource()}),this.registerCleanupCallback(()=>{F.disconnectFromSource()}),q.hydrate&&Y(this))this.registerHydrationBinding(X,F);return F}}}export{Q0 as signal};
2
+
3
+ //# debugId=6D92CC35E8375D3464756E2164756E21
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/tools/escape-script-json.ts", "../src/core/hydration-codec.ts", "../src/decorators/shared/auto-bind.ts", "../src/signals/hydration-script.ts", "../src/signals/host-signal.ts", "../src/core/hydration-capable-host.ts", "../src/decorators/standard/signal.ts"],
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 type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\ntype AutoBindHost = ReactiveHostLike & {\n\tshouldAutoBindReactiveMembers?: () => boolean;\n};\n\nexport function resolveHostAutoBind(host: AutoBindHost): ReactiveBindingOption {\n\treturn host.shouldAutoBindReactiveMembers?.() ?? false;\n}\n",
8
+ "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",
9
+ "import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\nimport { state, type WritableSignal } from '@ecopages/signals';\nimport type { ReactiveState } from '../core/reactivity-contract';\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\tregisterReactiveMember<Value>(property: string, signal: ReactiveState<Value>): 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\tthis.host.registerReactiveMember(this.property, this.source);\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\tthis.currentValue = 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}\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\tthis.currentValue = nextValue;\n\t}\n}\n\nexport function createHostSignal<Value>(options: HostSignalOptions<Value>): HostSignal<Value> {\n\treturn new HostSignal(options);\n}\n",
10
+ "import type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\n\n/**\n * Hosts that can register keyed SSR hydration bindings.\n */\nexport interface HydrationCapableHost {\n\tregisterHydrationBinding(name: string, binding: SsrSerializableHydrationBinding): void;\n}\n\nexport function isHydrationCapableHost(host: object): host is HydrationCapableHost {\n\treturn typeof (host as HydrationCapableHost).registerHydrationBinding === 'function';\n}\n",
11
+ "import type { WritableSignal } from '@ecopages/signals';\nimport type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\nimport { createHostSignal, isWritableSignalLike } from '../../signals/host-signal';\nimport { isHydrationCapableHost } from '../../core/hydration-capable-host';\nimport type { AttributeTypeConstant } from '../../utils/attribute-utils';\n\n/** Options for the `@signal` decorator. */\nexport type SignalDecoratorOptions<Value = unknown> = {\n\t/**\n\t * Exposes a JSX binding companion for the decorated signal.\n\t *\n\t * - `true` creates a `$propertyName` accessor.\n\t * - a string creates a custom accessor with that name.\n\t * - `undefined` defers to the host default.\n\t */\n\tbind?: ReactiveBindingOption;\n\n\t/**\n\t * Optional initial value used when the field does not provide one directly.\n\t *\n\t * This is primarily useful with `declare field: WritableSignal<T>` syntax,\n\t * which keeps the component surface clean while still letting the decorator\n\t * own signal construction.\n\t */\n\tinitial?: Value;\n\n\t/**\n\t * Connects an existing writable signal to the host instead of creating a\n\t * host-owned one.\n\t */\n\tsource?: WritableSignal<Value> | ((host: ReactiveHostLike) => WritableSignal<Value>);\n\n\t/**\n\t * Serializes the current signal value into a keyed hydration script during\n\t * SSR and restores it on the client.\n\t */\n\thydrate?: AttributeTypeConstant;\n};\n\nexport function signal<Value = unknown>(options: SignalDecoratorOptions<Value> = {}) {\n\treturn function <T extends ReactiveHostLike, Value>(_: undefined, context: ClassFieldDecoratorContext<T, unknown>) {\n\t\tconst propertyName = String(context.name);\n\n\t\treturn function (this: T, initialValue: Value | WritableSignal<Value>) {\n\t\t\tconst resolvedSource =\n\t\t\t\ttypeof options.source === 'function'\n\t\t\t\t\t? options.source(this)\n\t\t\t\t\t: (options.source ?? (isWritableSignalLike<Value>(initialValue) ? initialValue : undefined));\n\t\t\tconst resolvedInitialValue =\n\t\t\t\tresolvedSource !== undefined\n\t\t\t\t\t? options.initial\n\t\t\t\t\t: ((initialValue === undefined ? options.initial : initialValue) as Value);\n\t\t\tconst bind = options.bind ?? resolveHostAutoBind(this);\n\n\t\t\tthis.defineReactiveBinding(propertyName, bind);\n\n\t\t\tconst hostSignal = createHostSignal({\n\t\t\t\thost: this,\n\t\t\t\thydrate: options.hydrate,\n\t\t\t\thydrationKey: propertyName,\n\t\t\t\tinitialValue: resolvedInitialValue,\n\t\t\t\tproperty: propertyName,\n\t\t\t\tsource: resolvedSource,\n\t\t\t});\n\n\t\t\tthis.registerConnectedCallback(() => {\n\t\t\t\thostSignal.hydrateFromHost();\n\t\t\t\thostSignal.connectToSource();\n\t\t\t});\n\t\t\tthis.registerCleanupCallback(() => {\n\t\t\t\thostSignal.disconnectFromSource();\n\t\t\t});\n\n\t\t\tif (options.hydrate && isHydrationCapableHost(this)) {\n\t\t\t\tthis.registerHydrationBinding(propertyName, hostSignal);\n\t\t\t}\n\n\t\t\treturn hostSignal as unknown as WritableSignal<Value>;\n\t\t};\n\t};\n}\n"
12
+ ],
13
+ "mappings": "i0BAIO,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,EAE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,EAAQ,QACjB,aAAc,EACd,aAAc,EACd,SAAU,EACV,OAAQ,CACT,CAAC,EAUD,GARA,KAAK,0BAA0B,IAAM,CACpC,EAAW,gBAAgB,EAC3B,EAAW,gBAAgB,EAC3B,EACD,KAAK,wBAAwB,IAAM,CAClC,EAAW,qBAAqB,EAChC,EAEG,EAAQ,SAAW,EAAuB,IAAI,EACjD,KAAK,yBAAyB,EAAc,CAAU,EAGvD,OAAO",
14
+ "debugId": "6D92CC35E8375D3464756E2164756E21",
15
+ "names": []
16
+ }
@@ -2,8 +2,9 @@ import type { ReactiveHostLike } from '../core/reactive-host';
2
2
  /**
3
3
  * Declares internal mutable component state.
4
4
  *
5
- * Each write triggers `notifyUpdate` so update callbacks, bindings, and
6
- * `RadiantElement` renders stay in sync. When no explicit binding option
5
+ * Each write updates the member state, which notifies `@onUpdated` listeners and
6
+ * keeps JSX bindings in sync. Render invalidation happens through the reactive
7
+ * render path when `render()` reads reactive members. When no explicit binding option
7
8
  * is supplied, `RadiantElement` hosts expose a JSX companion binding
8
9
  * accessor automatically while plain imperative hosts keep binding
9
10
  * opt-in.
@@ -0,0 +1,3 @@
1
+ var{defineProperty:c,getOwnPropertyNames:T,getOwnPropertyDescriptor:l}=Object,D=Object.prototype.hasOwnProperty;function L(o){return this[o]}var k=(o)=>{var t=(s??=new WeakMap).get(o),d;if(t)return t;if(t=c({},"__esModule",{value:!0}),o&&typeof o==="object"||typeof o==="function"){for(var e of T(o))if(!D.call(t,e))c(t,e,{get:L.bind(o,e),enumerable:!(d=l(o,e))||d.enumerable})}return s.set(o,t),t},s;var C=(o)=>o;function V(o,t){this[o]=C.bind(null,t)}var A=(o,t)=>{for(var d in t)c(o,d,{get:t[d],enumerable:!0,configurable:!0,set:V.bind(t,d)})};var O=(o,t)=>()=>(o&&(t=o(o=0)),t);var q=((o)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,d)=>(typeof require<"u"?require:t)[d]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var M=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),R=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),B=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function F(o,t){H(o,M,t)}function f(o,t){H(o,R,t)}function _(o){j(o,M)}function y(o,t){let d=o;S(o,t,d[B]??=new Set)}function H(o,t,d){let e=o,r=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;if(Array.isArray(r)){r.push(d);return}Object.defineProperty(e,t,{value:[d]})}function j(o,t){w(o,(d)=>{let e=d[t];if(!Array.isArray(e))return;for(let r of e)r(o)})}function S(o,t,d){for(let e of x(o)){let r=e[R];if(!Array.isArray(r))continue;for(let n of r){if(d.has(n))continue;n(o,t),d.add(n)}}}function x(o){let t=[],d=Object.getPrototypeOf(o);while(d&&d!==Object.prototype)t.unshift(d),d=Object.getPrototypeOf(d);return t}function w(o,t){for(let d of x(o))t(d)}function v(o){return typeof o==="function"}function a(o,t,d,e){if(typeof e==="object")return o(void 0,e);return t(d,e)}function G(o,t,d,e,r){if(typeof e==="object"){if(!v(d))throw TypeError("Standard method decorators require a method target");return o(d,e)}if(!r)throw TypeError("Legacy method decorators require a property descriptor");return t(d,e,r)}function u(o){return o.shouldAutoBindReactiveMembers?.()??!1}function g(o,t,d,e=!1){if(o.getReactiveMember(t))return;if(o.createReactiveMember(t,d),e!==void 0&&e!==!1)o.defineReactiveBinding(t,e)}function h(o,t){F(o,(d)=>{g(d,t,d[t],u(d))}),f(o,(d)=>{d.createReactiveField(t,d[t],{bind:u(d)})})}function P(o,t){let d=String(t.name),e=Symbol(`@ecopages/radiant/state:${d}:initializer`);return t.addInitializer(function(){let r=this[e];this.createReactiveField(d,r,{bind:u(this),suppressInitialNotify:!0})}),function(r){return this[e]=r,r}}function z(o,t){return a(P,h,o,t)}export{z as state};
2
+
3
+ //# debugId=01BBD8A672AFCD0964756E2164756E21
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/decorators/bridge.ts", "../src/decorators/shared/auto-bind.ts", "../src/decorators/legacy/member-bootstrap.ts", "../src/decorators/legacy/reactive-field.ts", "../src/decorators/standard/reactive-field.ts", "../src/decorators/state.ts"],
4
+ "sourcesContent": [
5
+ "export type LegacyPostConstructionPhase = 'connect' | 'ssr';\n\ntype LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\ntype LegacyPostConstructionInitializer<T extends object = object> = (\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\nconst LEGACY_POST_CONSTRUCTION_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-post-construction-initializers');\nconst LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS = Symbol.for(\n\t'@ecopages/radiant.legacy-executed-post-construction-initializers',\n);\n\n/**\n * Registers per-instance initialization work for a legacy decorator.\n *\n * Legacy decorators execute against the prototype, so any initialization that\n * needs the concrete element instance must be deferred until construction time.\n */\nexport function registerLegacyInstanceInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyInstanceInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_INSTANCE_INITIALIZERS, initializer);\n}\n\n/**\n * Registers post-construction work for a legacy decorator.\n *\n * This phase exists for decorators that eagerly write instance fields. With\n * legacy decorators plus `useDefineForClassFields`, subclass field definition\n * can overwrite values written during the base-class constructor.\n */\nexport function registerLegacyPostConstructionInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyPostConstructionInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_POST_CONSTRUCTION_INITIALIZERS, initializer);\n}\n\n/**\n * Runs all legacy decorator initializers for a newly constructed element.\n *\n * Initializers are collected from the prototype chain and executed from base to\n * derived class so inherited setup remains stable.\n */\nexport function runLegacyInstanceInitializers<T extends object>(instance: T): void {\n\trunLegacyInitializers(instance, LEGACY_INSTANCE_INITIALIZERS);\n}\n\n/**\n * Runs legacy decorator setup that must happen after subclass field\n * initialization has completed.\n *\n * Each initializer runs at most once per instance even if multiple lifecycle\n * entrypoints call this helper.\n */\nexport function runLegacyPostConstructionInitializers<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyPostConstructionInitializersOnPrototypeChain(\n\t\tinstance,\n\t\tphase,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<\n\t\t\tLegacyPostConstructionInitializer<T>\n\t\t>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(\n\tproto: T,\n\tkey: symbol,\n\tinitializer: LegacyInstanceInitializer<T> | LegacyPostConstructionInitializer<T>,\n): void {\n\tconst target = proto as Record<PropertyKey, unknown>;\n\tconst ownInitializers = Object.prototype.hasOwnProperty.call(target, key) ? target[key] : undefined;\n\n\tif (Array.isArray(ownInitializers)) {\n\t\townInitializers.push(initializer);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(target, key, {\n\t\tvalue: [initializer],\n\t});\n}\n\nfunction runLegacyInitializers<T extends object>(instance: T, key: symbol): void {\n\twalkPrototypeChain(instance, (prototype) => {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as\n\t\t\tLegacyInstanceInitializer<T>[] | undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tinitializer(instance);\n\t\t}\n\t});\n}\n\nfunction runLegacyPostConstructionInitializersOnPrototypeChain<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n\texecutedInitializers: Set<LegacyPostConstructionInitializer<T>>,\n): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[LEGACY_POST_CONSTRUCTION_INITIALIZERS] as\n\t\t\tLegacyPostConstructionInitializer<T>[] | undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tif (executedInitializers.has(initializer)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tinitializer(instance, phase);\n\t\t\texecutedInitializers.add(initializer);\n\t\t}\n\t}\n}\n\nfunction collectPrototypeChain<T extends object>(instance: T): object[] {\n\tconst prototypes: object[] = [];\n\tlet prototype: object | null = Object.getPrototypeOf(instance);\n\n\twhile (prototype && prototype !== Object.prototype) {\n\t\tprototypes.unshift(prototype);\n\t\tprototype = Object.getPrototypeOf(prototype);\n\t}\n\n\treturn prototypes;\n}\n\nfunction walkPrototypeChain<T extends object>(instance: T, visit: (prototype: object) => void): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tvisit(prototype);\n\t}\n}\n",
6
+ "import type { Method } from '../types';\n\ntype StandardFieldFn<Host extends object, Value, Result> = (\n\ttarget: undefined,\n\tcontext: ClassFieldDecoratorContext<Host, Value>,\n) => Result;\n\ntype LegacyFieldFn<Proto, Result> = (proto: Proto, name: string) => Result;\n\ntype StandardMethodFn<Host extends object, TMethod extends Method, Result> = (\n\ttarget: TMethod,\n\tcontext: ClassMethodDecoratorContext<Host, TMethod>,\n) => Result;\n\ntype LegacyMethodFn<Proto, Result> = (proto: Proto, name: string, descriptor: PropertyDescriptor) => Result;\n\nfunction isMethod(value: unknown): value is Method {\n\treturn typeof value === 'function';\n}\n\nexport function fieldDecoratorBridge<Host extends object, Value, Result, Proto>(\n\tstandard: StandardFieldFn<Host, Value, Result>,\n\tlegacy: LegacyFieldFn<Proto, void>,\n\tprotoOrTarget: undefined,\n\tnameOrContext: ClassFieldDecoratorContext<Host, Value>,\n): Result;\nexport function fieldDecoratorBridge<Host extends object, Value, Proto, Result>(\n\tstandard: StandardFieldFn<Host, Value, void>,\n\tlegacy: LegacyFieldFn<Proto, Result>,\n\tprotoOrTarget: Proto,\n\tnameOrContext: string,\n): Result;\nexport function fieldDecoratorBridge<Host extends object, Value, StandardResult, Proto, LegacyResult>(\n\tstandard: StandardFieldFn<Host, Value, StandardResult>,\n\tlegacy: LegacyFieldFn<Proto, LegacyResult>,\n\tprotoOrTarget: Proto | undefined,\n\tnameOrContext: string | ClassFieldDecoratorContext<Host, Value>,\n): StandardResult | LegacyResult;\n\nexport function fieldDecoratorBridge(\n\tstandard: StandardFieldFn<object, unknown, unknown>,\n\tlegacy: LegacyFieldFn<unknown, unknown>,\n\tprotoOrTarget: unknown,\n\tnameOrContext: string | ClassFieldDecoratorContext<object, unknown>,\n): unknown {\n\tif (typeof nameOrContext === 'object') {\n\t\treturn standard(undefined, nameOrContext);\n\t}\n\n\treturn legacy(protoOrTarget, nameOrContext);\n}\n\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, Result, Proto>(\n\tstandard: StandardMethodFn<Host, TMethod, Result>,\n\tlegacy: LegacyMethodFn<Proto, void>,\n\tprotoOrTarget: TMethod,\n\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\tdescriptor?: undefined,\n): Result;\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, Proto, Result>(\n\tstandard: StandardMethodFn<Host, TMethod, void>,\n\tlegacy: LegacyMethodFn<Proto, Result>,\n\tprotoOrTarget: Proto,\n\tnameOrContext: string,\n\tdescriptor: PropertyDescriptor,\n): Result;\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, StandardResult, Proto, LegacyResult>(\n\tstandard: StandardMethodFn<Host, TMethod, StandardResult>,\n\tlegacy: LegacyMethodFn<Proto, LegacyResult>,\n\tprotoOrTarget: Proto | TMethod,\n\tnameOrContext: string | ClassMethodDecoratorContext<Host, TMethod>,\n\tdescriptor?: PropertyDescriptor,\n): StandardResult | LegacyResult;\n\nexport function methodDecoratorBridge(\n\tstandard: StandardMethodFn<object, Method, unknown>,\n\tlegacy: LegacyMethodFn<unknown, unknown>,\n\tprotoOrTarget: unknown,\n\tnameOrContext: string | ClassMethodDecoratorContext<object, Method>,\n\tdescriptor?: PropertyDescriptor,\n): unknown {\n\tif (typeof nameOrContext === 'object') {\n\t\tif (!isMethod(protoOrTarget)) {\n\t\t\tthrow new TypeError('Standard method decorators require a method target');\n\t\t}\n\n\t\treturn standard(protoOrTarget, nameOrContext);\n\t}\n\n\tif (!descriptor) {\n\t\tthrow new TypeError('Legacy method decorators require a property descriptor');\n\t}\n\n\treturn legacy(protoOrTarget, nameOrContext, descriptor);\n}\n",
7
+ "import type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\ntype AutoBindHost = ReactiveHostLike & {\n\tshouldAutoBindReactiveMembers?: () => boolean;\n};\n\nexport function resolveHostAutoBind(host: AutoBindHost): ReactiveBindingOption {\n\treturn host.shouldAutoBindReactiveMembers?.() ?? false;\n}\n",
8
+ "import type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\n/**\n * Registers a member `State` early enough for subclass field initializers that\n * read `this.$.member` (for example `this.$.preference.map(...)`).\n *\n * Post-construction setup still runs afterward to install accessors, SSR prop\n * resolution, and attribute channels once class fields have finished writing.\n */\nexport function bootstrapReactiveMemberBinding(\n\thost: ReactiveHostLike,\n\tpropertyName: string,\n\tinitialValue: unknown,\n\tbind: ReactiveBindingOption = false,\n): void {\n\tif (host.getReactiveMember(propertyName)) {\n\t\treturn;\n\t}\n\n\thost.createReactiveMember(propertyName, initialValue);\n\n\tif (bind !== undefined && bind !== false) {\n\t\thost.defineReactiveBinding(propertyName, bind);\n\t}\n}\n",
9
+ "import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\nimport { registerLegacyInstanceInitializer, registerLegacyPostConstructionInitializer } from './instance-initializers';\nimport { bootstrapReactiveMemberBinding } from './member-bootstrap';\n\n/**\n * A decorator to define a reactive field.\n * Every time the property changes, the `updated` method will be called.\n * Due the fact the value is always undefined before the first update,\n * we are adding a `isDefined` WeakSet to track if the property has been defined.\n * @param target The target element.\n * @param propertyKey The property key.\n */\nexport function reactiveField(target: ReactiveHostLike, propertyKey: string) {\n\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\tbootstrapReactiveMemberBinding(\n\t\t\telement,\n\t\t\tpropertyKey,\n\t\t\telement[propertyKey as keyof typeof element],\n\t\t\tresolveHostAutoBind(element),\n\t\t);\n\t});\n\n\tregisterLegacyPostConstructionInitializer(target, (element) => {\n\t\telement.createReactiveField(propertyKey, element[propertyKey as keyof typeof element], {\n\t\t\tbind: resolveHostAutoBind(element),\n\t\t});\n\t});\n}\n",
10
+ "import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\n\nexport function reactiveField<T extends ReactiveHostLike, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\tconst contextName = String(context.name);\n\tconst initializerValueKey = Symbol(`@ecopages/radiant/state:${contextName}:initializer`);\n\n\tcontext.addInitializer(function (this: T) {\n\t\tconst initializerValue = (this as Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\tthis.createReactiveField(contextName, initializerValue as V, {\n\t\t\tbind: resolveHostAutoBind(this),\n\t\t\tsuppressInitialNotify: true,\n\t\t});\n\t});\n\n\treturn function (this: T, value: V) {\n\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\treturn value;\n\t};\n}\n",
11
+ "import type { ReactiveHostLike } from '../core/reactive-host';\nimport { reactiveField as legacyReactiveField } from './legacy/reactive-field';\nimport { reactiveField as standardReactiveField } from './standard/reactive-field';\nimport { fieldDecoratorBridge } from './bridge';\n\n/**\n * Declares internal mutable component state.\n *\n * Each write updates the member state, which notifies `@onUpdated` listeners and\n * keeps JSX bindings in sync. Render invalidation happens through the reactive\n * render path when `render()` reads reactive members. When no explicit binding option\n * is supplied, `RadiantElement` hosts expose a JSX companion binding\n * accessor automatically while plain imperative hosts keep binding\n * opt-in.\n */\nexport function state<THost extends ReactiveHostLike, TValue>(\n\tprotoOrTarget: undefined,\n\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n): (this: THost, value: TValue) => TValue;\nexport function state(protoOrTarget: ReactiveHostLike, nameOrContext: string): void;\nexport function state(\n\tprotoOrTarget: ReactiveHostLike | undefined,\n\tnameOrContext: string | ClassFieldDecoratorContext<ReactiveHostLike, unknown>,\n): ((this: ReactiveHostLike, value: unknown) => unknown) | void {\n\treturn fieldDecoratorBridge(standardReactiveField, legacyReactiveField, protoOrTarget, nameOrContext);\n}\n"
12
+ ],
13
+ "mappings": "i0BAQA,IAAM,EAA+B,OAAO,IAAI,gDAAgD,EAC1F,EAAwC,OAAO,IAAI,yDAAyD,EAC5G,EAAiD,OAAO,IAC7D,kEACD,EAQO,SAAS,CAAmD,CAClE,EACA,EACO,CACP,EAAoB,EAAO,EAA8B,CAAW,EAU9D,SAAS,CAA2D,CAC1E,EACA,EACO,CACP,EAAoB,EAAO,EAAuC,CAAW,EASvE,SAAS,CAA+C,CAAC,EAAmB,CAClF,EAAsB,EAAU,CAA4B,EAUtD,SAAS,CAAuD,CACtE,EACA,EACO,CACP,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GAGjE,EAGD,SAAS,CAAqC,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAS,EACT,EAAkB,OAAO,UAAU,eAAe,KAAK,EAAQ,CAAG,EAAI,EAAO,GAAO,OAE1F,GAAI,MAAM,QAAQ,CAAe,EAAG,CACnC,EAAgB,KAAK,CAAW,EAChC,OAGD,OAAO,eAAe,EAAQ,EAAK,CAClC,MAAO,CAAC,CAAW,CACpB,CAAC,EAGF,SAAS,CAAuC,CAAC,EAAa,EAAmB,CAChF,EAAmB,EAAU,CAAC,IAAc,CAC3C,IAAM,EAAgB,EAA2C,GAGjE,GAAI,CAAC,MAAM,QAAQ,CAAY,EA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CAAY,EAEhD,IAAS,QAAa,IAAS,GAClC,EAAK,sBAAsB,EAAc,CAAI,ECVxC,SAAS,CAAa,CAAC,EAA0B,EAAqB,CAC5E,EAAkC,EAAQ,CAAC,IAAY,CACtD,EACC,EACA,EACA,EAAQ,GACR,EAAoB,CAAO,CAC5B,EACA,EAED,EAA0C,EAAQ,CAAC,IAAY,CAC9D,EAAQ,oBAAoB,EAAa,EAAQ,GAAsC,CACtF,KAAM,EAAoB,CAAO,CAClC,CAAC,EACD,ECxBK,SAAS,CAA4C,CAAC,EAAc,EAA2C,CACrH,IAAM,EAAc,OAAO,EAAQ,IAAI,EACjC,EAAsB,OAAO,2BAA2B,eAAyB,EAUvF,OARA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAA4C,GACtE,KAAK,oBAAoB,EAAa,EAAuB,CAC5D,KAAM,EAAoB,IAAI,EAC9B,sBAAuB,EACxB,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAA4C,GAAuB,EAC7D,GCGF,SAAS,CAAK,CACpB,EACA,EAC+D,CAC/D,OAAO,EAAqB,EAAuB,EAAqB,EAAe,CAAa",
14
+ "debugId": "01BBD8A672AFCD0964756E2164756E21",
15
+ "names": []
16
+ }
@@ -0,0 +1,3 @@
1
+ var{defineProperty:I,getOwnPropertyNames:J,getOwnPropertyDescriptor:M}=Object,O=Object.prototype.hasOwnProperty;function S($){return this[$]}var A=($)=>{var x=(V??=new WeakMap).get($),F;if(x)return x;if(x=I({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var W of J($))if(!O.call(x,W))I(x,W,{get:S.bind($,W),enumerable:!(F=M($,W))||F.enumerable})}return V.set($,x),x},V;var T=($)=>$;function y($,x){this[$]=T.bind(null,x)}var E=($,x)=>{for(var F in x)I($,F,{get:x[F],enumerable:!0,configurable:!0,set:y.bind(x,F)})};var m=($,x)=>()=>($&&(x=$($=0)),x);var H=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(x,F)=>(typeof require<"u"?require:x)[F]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});function X($){let x=globalThis.CSS;if(typeof x?.escape==="function")return x.escape($);let F="";for(let W=0;W<$.length;W+=1){let N=$[W]??"",P=N.codePointAt(0)??0;if(P===0){F+="�";continue}let _=P>=1&&P<=31||P===127,j=W===0&&P>=48&&P<=57,z=W===1&&P>=48&&P<=57&&($[0]??"")==="-",B=W===0&&N==="-"&&$.length===1;if(_||j||z){F+=`\\${P.toString(16)} `;continue}if(P>=128||N==="-"||N==="_"||P>=48&&P<=57||P>=65&&P<=90||P>=97&&P<=122){F+=B?`\\${N}`:N;continue}F+=`\\${N}`}return F}var D=Symbol("radiant.shadowRootListenerHooks"),Y=Symbol("radiant.patchedAttachShadow");function q($){if($ instanceof Element)return $;if("host"in $)return $.host;return $.element}function K($){return!($ instanceof Element)}function Z($,x,F,W){let N=(P)=>{if(P.target instanceof Element&&P.target.matches(F))W(P)};return $.addEventListener(x.type,N,x.options),()=>{$.removeEventListener(x.type,N,x.options)}}function R($,x){let F=q($);if(!F[D])F[D]=new Set;if(F[D].add(x),F[Y])return;let W=F.attachShadow;F.attachShadow=function(P){let _=W.call(this,P);for(let j of F[D]??[])j();return _},F[Y]=!0}function k($,x,F){if(K($)&&"scope"in x&&x.scope&&x.scope!=="light")throw Error("RadiantController event listeners only support light DOM scope.");let W=q($),N=F.bind($),P=null,_=null,j=null,z=null,B=!1,Q=()=>{P?.(),_?.(),j?.(),z?.(),P=null,_=null,j=null,z=null},G=()=>{if(B)return;if("window"in x&&!P)window.addEventListener(x.type,N,x.options),P=()=>{window.removeEventListener(x.type,N,x.options)};if("document"in x&&!_)document.addEventListener(x.type,N,x.options),_=()=>{document.removeEventListener(x.type,N,x.options)};if("selector"in x||"ref"in x){let U="selector"in x?x.selector:`[data-ref='${X(x.ref)}']`;if(x.scope!=="shadow"&&!j)j=Z(W,x,U,N);if(x.scope!=="light"&&W.shadowRoot&&!z)z=Z(W.shadowRoot,x,U,N)}};if("selector"in x||"ref"in x){if(x.scope!=="light")R($,()=>{if($.isConnected)G()})}if($.registerConnectedCallback(G),$.registerCleanupCallback(Q),$.isConnected)G();return()=>{B=!0,Q()}}export{k as createEventListener};
2
+
3
+ //# debugId=95635E2CBD21FD0964756E2164756E21
@@ -2,10 +2,10 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/tools/escape-css-identifier.ts", "../src/helpers/create-event-listener.ts"],
4
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 &&\n\t\t\tcodePoint >= 0x0030 &&\n\t\t\tcodePoint <= 0x0039 &&\n\t\t\t(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}",
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
6
  "import type { RadiantElementEventListener } from '../core/radiant-element';\nimport { escapeCssIdentifier } from '../tools/escape-css-identifier';\n\n/**\n * Selects which DOM tree delegated event listeners should observe.\n */\nexport type OnEventScope = 'light' | 'shadow' | 'both';\n\ntype BaseOnEventConfig = Pick<RadiantElementEventListener, 'type' | 'options'> & {\n\tscope?: OnEventScope;\n};\n\nexport type OnEventConfig = BaseOnEventConfig &\n\t(\n\t\t| {\n\t\t\t\tselector: string;\n\t\t }\n\t\t| {\n\t\t\t\tref: string;\n\t\t }\n\t\t| {\n\t\t\t\twindow: true;\n\t\t }\n\t\t| {\n\t\t\t\tdocument: true;\n\t\t }\n\t);\n\ntype DelegatedEventRoot = Element | ShadowRoot;\n\ntype EventListenerLifecycleHost = {\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterCleanupCallback(callback: () => void): void;\n\tisConnected: boolean;\n};\n\nexport type EventListenerHost =\n\t| (EventListenerLifecycleHost & Element)\n\t| (EventListenerLifecycleHost & { host: Element })\n\t| (EventListenerLifecycleHost & { element: Element });\n\nconst shadowRootListenerHooksKey = Symbol('radiant.shadowRootListenerHooks');\nconst patchedAttachShadowKey = Symbol('radiant.patchedAttachShadow');\n\ntype ShadowRootHookHost = Element & {\n\t[patchedAttachShadowKey]?: true;\n\t[shadowRootListenerHooksKey]?: Set<() => void>;\n};\n\nfunction resolveEventListenerHostElement(host: EventListenerHost): Element {\n\tif (host instanceof Element) {\n\t\treturn host;\n\t}\n\n\tif ('host' in host) {\n\t\treturn host.host;\n\t}\n\n\treturn host.element;\n}\n\nfunction isControllerEventHost(host: EventListenerHost): host is EventListenerLifecycleHost & { host: Element } {\n\treturn !(host instanceof Element);\n}\n\nfunction addDelegatedListener(\n\troot: DelegatedEventRoot,\n\tconfig: Pick<OnEventConfig, 'type' | 'options'>,\n\tselector: string,\n\tlistener: EventListener,\n): () => void {\n\tconst delegatedListener = (event: Event) => {\n\t\tif (event.target instanceof Element && event.target.matches(selector)) {\n\t\t\tlistener(event);\n\t\t}\n\t};\n\n\troot.addEventListener(config.type, delegatedListener, config.options);\n\n\treturn () => {\n\t\troot.removeEventListener(config.type, delegatedListener, config.options);\n\t};\n}\n\nfunction registerShadowRootHook(host: EventListenerHost, hook: () => void): void {\n\tconst shadowAwareHost = resolveEventListenerHostElement(host) as ShadowRootHookHost;\n\n\tif (!shadowAwareHost[shadowRootListenerHooksKey]) {\n\t\tshadowAwareHost[shadowRootListenerHooksKey] = new Set();\n\t}\n\n\tshadowAwareHost[shadowRootListenerHooksKey].add(hook);\n\n\tif (shadowAwareHost[patchedAttachShadowKey]) {\n\t\treturn;\n\t}\n\n\tconst originalAttachShadow = shadowAwareHost.attachShadow;\n\n\tshadowAwareHost.attachShadow = function patchedAttachShadow(init: ShadowRootInit): ShadowRoot {\n\t\tconst shadowRoot = originalAttachShadow.call(this, init);\n\t\tfor (const shadowRootHook of shadowAwareHost[shadowRootListenerHooksKey] ?? []) {\n\t\t\tshadowRootHook();\n\t\t}\n\t\treturn shadowRoot;\n\t};\n\n\tshadowAwareHost[patchedAttachShadowKey] = true;\n}\n\n/**\n * Subscribes to a DOM event with delegation, window, or document targeting.\n * Functional equivalent of the `@onEvent` decorator for vanilla JS usage.\n * Returns a cleanup function to remove the listener.\n * @param host The host RadiantElement.\n * @param config The event listener configuration.\n * @param callback The event handler function.\n */\nexport function createEventListener(\n\thost: EventListenerHost,\n\tconfig: OnEventConfig,\n\tcallback: (event: Event) => void,\n): () => void {\n\tif (isControllerEventHost(host) && 'scope' in config && config.scope && config.scope !== 'light') {\n\t\tthrow new Error('RadiantController event listeners only support light DOM scope.');\n\t}\n\n\tconst hostElement = resolveEventListenerHostElement(host);\n\tconst boundCallback = callback.bind(host);\n\tlet windowCleanup: (() => void) | null = null;\n\tlet documentCleanup: (() => void) | null = null;\n\tlet lightCleanup: (() => void) | null = null;\n\tlet shadowCleanup: (() => void) | null = null;\n\tlet disposed = false;\n\n\tconst detachListeners = () => {\n\t\twindowCleanup?.();\n\t\tdocumentCleanup?.();\n\t\tlightCleanup?.();\n\t\tshadowCleanup?.();\n\n\t\twindowCleanup = null;\n\t\tdocumentCleanup = null;\n\t\tlightCleanup = null;\n\t\tshadowCleanup = null;\n\t};\n\n\tconst attachListeners = () => {\n\t\tif (disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ('window' in config && !windowCleanup) {\n\t\t\twindow.addEventListener(config.type, boundCallback, config.options);\n\t\t\twindowCleanup = () => {\n\t\t\t\twindow.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('document' in config && !documentCleanup) {\n\t\t\tdocument.addEventListener(config.type, boundCallback, config.options);\n\t\t\tdocumentCleanup = () => {\n\t\t\t\tdocument.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('selector' in config || 'ref' in config) {\n\t\t\tconst selector = 'selector' in config ? config.selector : `[data-ref='${escapeCssIdentifier(config.ref)}']`;\n\n\t\t\tif (config.scope !== 'shadow' && !lightCleanup) {\n\t\t\t\tlightCleanup = addDelegatedListener(hostElement, config, selector, boundCallback);\n\t\t\t}\n\n\t\t\tif (config.scope !== 'light' && hostElement.shadowRoot && !shadowCleanup) {\n\t\t\t\tshadowCleanup = addDelegatedListener(hostElement.shadowRoot, config, selector, boundCallback);\n\t\t\t}\n\t\t}\n\t};\n\n\tif ('selector' in config || 'ref' in config) {\n\t\tif (config.scope !== 'light') {\n\t\t\tregisterShadowRootHook(host, () => {\n\t\t\t\tif (host.isConnected) {\n\t\t\t\t\tattachListeners();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\thost.registerConnectedCallback(attachListeners);\n\thost.registerCleanupCallback(detachListeners);\n\n\tif (host.isConnected) {\n\t\tattachListeners();\n\t}\n\n\treturn () => {\n\t\tdisposed = true;\n\t\tdetachListeners();\n\t};\n}\n"
7
7
  ],
8
- "mappings": "2PAAO,SAAS,CAAmB,CAAC,EAAuB,CAC1D,IAAM,EAAe,WAAW,IAEhC,GAAI,OAAO,GAAc,SAAW,WACnC,OAAO,EA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ClB,EAAe,KACf,EAAgB,MAGX,EAAkB,IAAM,CAC7B,GAAI,EACH,OAGD,GAAI,WAAY,GAAU,CAAC,EAC1B,OAAO,iBAAiB,EAAO,KAAM,EAAe,EAAO,OAAO,EAClE,EAAgB,IAAM,CACrB,OAAO,oBAAoB,EAAO,KAAM,EAAe,EAAO,OAAO,GAIvE,GAAI,aAAc,GAAU,CAAC,EAC5B,SAAS,iBAAiB,EAAO,KAAM,EAAe,EAAO,OAAO,EACpE,EAAkB,IAAM,CACvB,SAAS,oBAAoB,EAAO,KAAM,EAAe,EAAO,OAAO,GAIzE,GAAI,aAAc,GAAU,QAAS,EAAQ,CAC5C,IAAM,EAAW,aAAc,EAAS,EAAO,SAAW,cAAc,EAAoB,EAAO,GAAG,MAEtG,GAAI,EAAO,QAAU,UAAY,CAAC,EACjC,EAAe,EAAqB,EAAa,EAAQ,EAAU,CAAa,EAGjF,GAAI,EAAO,QAAU,SAAW,EAAY,YAAc,CAAC,EAC1D,EAAgB,EAAqB,EAAY,WAAY,EAAQ,EAAU,CAAa,IAK/F,GAAI,aAAc,GAAU,QAAS,GACpC,GAAI,EAAO,QAAU,QACpB,EAAuB,EAAM,IAAM,CAClC,GAAI,EAAK,YACR,EAAgB,EAEjB,EAOH,GAHA,EAAK,0BAA0B,CAAe,EAC9C,EAAK,wBAAwB,CAAe,EAExC,EAAK,YACR,EAAgB,EAGjB,MAAO,IAAM,CACZ,EAAW,GACX,EAAgB",
9
+ "debugId": "95635E2CBD21FD0964756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -0,0 +1,3 @@
1
+ var{defineProperty:B,getOwnPropertyNames:H,getOwnPropertyDescriptor:I}=Object,K=Object.prototype.hasOwnProperty;function L(x){return this[x]}var O=(x)=>{var y=(G??=new WeakMap).get(x),z;if(y)return y;if(y=B({},"__esModule",{value:!0}),x&&typeof x==="object"||typeof x==="function"){for(var A of H(x))if(!K.call(y,A))B(y,A,{get:L.bind(x,A),enumerable:!(z=I(x,A))||z.enumerable})}return G.set(x,y),y},G;var M=(x)=>x;function N(x,y){this[x]=M.bind(null,y)}var P=(x,y)=>{for(var z in y)B(x,z,{get:y[z],enumerable:!0,configurable:!0,set:N.bind(y,z)})};var Q=(x,y)=>()=>(x&&(y=x(x=0)),y);var R=((x)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(y,z)=>(typeof require<"u"?require:y)[z]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});class D{host;eventConfig;constructor(x,y){this.host=x,this.eventConfig=y}emit(x){let y=new CustomEvent(this.eventConfig.name,{detail:x,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(y)}}function X(x,y){let z=new D(x,y);return x.registerEventEmitter(y.name,z),z}export{X as createEvent};
2
+
3
+ //# debugId=0D3FDA5676CAADF064756E2164756E21
@@ -5,7 +5,7 @@
5
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",
6
6
  "import type { RadiantElement } from '../core/radiant-element';\nimport { EventEmitter, type EventEmitterConfig } from '../tools/event-emitter';\n\n/**\n * Creates an EventEmitter bound to a host element and registers it on the host.\n * Functional equivalent of the `@event` decorator for vanilla JS usage.\n * @param host The host element that will dispatch the events.\n * @param config {@link EventEmitterConfig} The event emitter configuration.\n */\nexport function createEvent<T = unknown>(host: RadiantElement, config: EventEmitterConfig): EventEmitter<T> {\n\tconst emitter = new EventEmitter<T>(host, config);\n\thost.registerEventEmitter(config.name, emitter);\n\treturn emitter;\n}\n"
7
7
  ],
8
- "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,CClCO,SAAS,CAAwB,CAAC,EAAsB,EAA6C,CAC3G,IAAM,EAAU,IAAI,EAAgB,EAAM,CAAM,EAEhD,OADA,EAAK,qBAAqB,EAAO,KAAM,CAAO,EACvC",
9
- "debugId": "757906FF96EF03CE64756E2164756E21",
8
+ "mappings": "i0BAcO,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,CClCO,SAAS,CAAwB,CAAC,EAAsB,EAA6C,CAC3G,IAAM,EAAU,IAAI,EAAgB,EAAM,CAAM,EAEhD,OADA,EAAK,qBAAqB,EAAO,KAAM,CAAO,EACvC",
9
+ "debugId": "0D3FDA5676CAADF064756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -4,7 +4,6 @@ export type QuerySlotConfig = {
4
4
  name?: string;
5
5
  };
6
6
  type SlotQueryHost = HTMLElement & {
7
- getSlotElement<T extends Element = Element>(name?: string): T | null;
8
7
  getSlotElements<T extends Element = Element>(name?: string): T[];
9
8
  };
10
9
  type QuerySlotResult<T extends Element | Element[] | null> = {
@@ -0,0 +1,3 @@
1
+ var{defineProperty:E,getOwnPropertyNames:K,getOwnPropertyDescriptor:L}=Object,M=Object.prototype.hasOwnProperty;function N(j){return this[j]}var R=(j)=>{var A=(I??=new WeakMap).get(j),B;if(A)return A;if(A=E({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var D of K(j))if(!M.call(A,D))E(A,D,{get:N.bind(j,D),enumerable:!(B=L(j,D))||B.enumerable})}return I.set(j,A),A},I;var O=(j)=>j;function P(j,A){this[j]=O.bind(null,A)}var U=(j,A)=>{for(var B in A)E(j,B,{get:A[B],enumerable:!0,configurable:!0,set:P.bind(A,B)})};var W=(j,A)=>()=>(j&&(A=j(j=0)),A);var X=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(A,B)=>(typeof require<"u"?require:A)[B]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});function Z(j,A={}){let B=null,D,G=()=>{if(A.all)return j.getSlotElements(A.name);return j.getSlotElements(A.name)[0]??null};return{get value(){if(A.cache===!1)return G();let H=j.slotProjectionVersion??0;if(D!==H)B=G(),D=H;return B}}}export{Z as createQuerySlot};
2
+
3
+ //# debugId=9D69F01A4187A30F64756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/helpers/create-query-slot.ts"],
4
+ "sourcesContent": [
5
+ "export type QuerySlotConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tname?: string;\n};\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n};\n\ntype QuerySlotResult<T extends Element | Element[] | null> = {\n\tget value(): T | null;\n};\n\n/**\n * Creates a lazy slot query accessor bound to a host element.\n * Functional equivalent of the `@querySlot` decorator for vanilla JS usage.\n * @param host The host element to query slots within.\n * @param options {@link QuerySlotConfig} The slot query configuration.\n */\nexport function createQuerySlot<T extends Element | Element[] | null = Element | null>(\n\thost: SlotQueryHost,\n\toptions: QuerySlotConfig = {},\n): QuerySlotResult<T> {\n\tlet cached: T | null = null;\n\tlet cachedVersion: number | undefined;\n\n\tconst executeQuery = (): T | null => {\n\t\tif (options.all) {\n\t\t\treturn host.getSlotElements(options.name) as T;\n\t\t}\n\t\treturn (host.getSlotElements(options.name)[0] ?? null) as T | null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache === false) {\n\t\t\t\treturn executeQuery();\n\t\t\t}\n\n\t\t\tconst currentVersion = (host as unknown as Record<string, number | undefined>).slotProjectionVersion ?? 0;\n\n\t\t\tif (cachedVersion !== currentVersion) {\n\t\t\t\tcached = executeQuery();\n\t\t\t\tcachedVersion = currentVersion;\n\t\t\t}\n\n\t\t\treturn cached;\n\t\t},\n\t};\n}\n"
6
+ ],
7
+ "mappings": "i0BAoBO,SAAS,CAAsE,CACrF,EACA,EAA2B,CAAC,EACP,CACrB,IAAI,EAAmB,KACnB,EAEE,EAAe,IAAgB,CACpC,GAAI,EAAQ,IACX,OAAO,EAAK,gBAAgB,EAAQ,IAAI,EAEzC,OAAQ,EAAK,gBAAgB,EAAQ,IAAI,EAAE,IAAM,MAGlD,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,QAAU,GACrB,OAAO,EAAa,EAGrB,IAAM,EAAkB,EAAuD,uBAAyB,EAExG,GAAI,IAAkB,EACrB,EAAS,EAAa,EACtB,EAAgB,EAGjB,OAAO,EAET",
8
+ "debugId": "9D69F01A4187A30F64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,3 @@
1
+ var{defineProperty:K,getOwnPropertyNames:V,getOwnPropertyDescriptor:W}=Object,X=Object.prototype.hasOwnProperty;function Y(j){return this[j]}var D=(j)=>{var A=(U??=new WeakMap).get(j),B;if(A)return A;if(A=K({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var E of V(j))if(!X.call(A,E))K(A,E,{get:Y.bind(j,E),enumerable:!(B=W(j,E))||B.enumerable})}return U.set(j,A),A},U;var Z=(j)=>j;function _(j,A){this[j]=Z.bind(null,A)}var F=(j,A)=>{for(var B in A)K(j,B,{get:A[B],enumerable:!0,configurable:!0,set:_.bind(A,B)})};var H=(j,A)=>()=>(j&&(A=j(j=0)),A);var J=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(A,B)=>(typeof require<"u"?require:A)[B]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});function $(j){return!(j instanceof Element)}function b(j){return"shadowRoot"in j?j.shadowRoot??null:null}function k(j){return j instanceof Element?j:j.host}function z(j,A="light"){let B=b(j);if(A==="shadow")return B?[B]:[];if(A==="both")return B?[j,B]:[j];return[j]}function O(j,A){if($(j)&&A.scope&&A.scope!=="light")throw Error("RadiantController queries only support light DOM scope.");let B=k(j),E="selector"in A?A.selector:`[data-ref="${A.ref}"]`,G=null,L=()=>{let N=z(B,A.scope);if(A.all)return N.flatMap((I)=>Array.from(I.querySelectorAll(E)));for(let I of N){let P=I.querySelector(E);if(P)return P}return null};return{get value(){if(A.cache){if(G===null||A.all&&Array.isArray(G)&&!G.length)G=L();return G}return L()}}}export{k as resolveQueryHost,O as createQuery};
2
+
3
+ //# debugId=CDFDEB46BDE0D97664756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "type BaseQueryConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tscope?: QueryScope;\n};\n\ntype QueryBySelector = { selector: string };\n\ntype QueryByRef = { ref: string };\n\nexport type QueryHostTarget = Element | { host: Element };\n\n/**\n * Selects which DOM tree a query should read from.\n */\nexport type QueryScope = 'light' | 'shadow' | 'both';\n\nexport type QueryConfig = BaseQueryConfig & (QueryBySelector | QueryByRef);\n\ntype QueryRoot = Element | ShadowRoot;\n\ntype QueryResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\nfunction isControllerQueryTarget(target: QueryHostTarget): target is { host: Element } {\n\treturn !(target instanceof Element);\n}\n\nfunction resolveShadowRoot(host: Element): ShadowRoot | null {\n\treturn 'shadowRoot' in host ? ((host as Element & { shadowRoot?: ShadowRoot | null }).shadowRoot ?? null) : null;\n}\n\n/**\n * Resolves the DOM element that should serve as the query root.\n *\n * `@query(...)` can run on both element hosts and controller instances. This\n * helper normalizes those call sites to the underlying element that actually\n * owns the DOM subtree.\n */\nexport function resolveQueryHost(target: QueryHostTarget): Element {\n\treturn target instanceof Element ? target : target.host;\n}\n\nfunction getQueryRoots(host: Element, scope: QueryScope = 'light'): QueryRoot[] {\n\tconst shadowRoot = resolveShadowRoot(host);\n\n\tif (scope === 'shadow') {\n\t\treturn shadowRoot ? [shadowRoot] : [];\n\t}\n\n\tif (scope === 'both') {\n\t\treturn shadowRoot ? [host, shadowRoot] : [host];\n\t}\n\n\treturn [host];\n}\n\n/**\n * Creates a lazy DOM query accessor bound to an element host or controller.\n * Functional equivalent of the `@query` decorator for vanilla JS usage.\n * @param target The element host or controller to query within.\n * @param options {@link QueryConfig} The query configuration.\n */\nexport function createQuery<T extends Element | Element[] = Element>(\n\ttarget: QueryHostTarget,\n\toptions: QueryConfig,\n): QueryResult<T> {\n\tif (isControllerQueryTarget(target) && options.scope && options.scope !== 'light') {\n\t\tthrow new Error('RadiantController queries only support light DOM scope.');\n\t}\n\n\tconst host = resolveQueryHost(target);\n\tconst selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n\tlet cached: T | null = null;\n\n\tconst executeQuery = (): T | null => {\n\t\tconst roots = getQueryRoots(host, options.scope);\n\n\t\tif (options.all) {\n\t\t\treturn roots.flatMap((root) => Array.from(root.querySelectorAll(selector))) as T;\n\t\t}\n\n\t\tfor (const root of roots) {\n\t\t\tconst match = root.querySelector(selector);\n\t\t\tif (match) {\n\t\t\t\treturn match as T;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache) {\n\t\t\t\tif (cached === null || (options.all && Array.isArray(cached) && !cached.length)) {\n\t\t\t\t\tcached = executeQuery();\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\treturn executeQuery();\n\t\t},\n\t};\n}\n"
6
6
  ],
7
- "mappings": "2PAyBA,SAAS,CAAuB,CAAC,EAAsD,CACtF,MAAO,EAAE,aAAkB,SAG5B,SAAS,CAAiB,CAAC,EAAkC,CAC5D,MAAO,eAAgB,EAAS,EAAsD,YAAc,KAAQ,KAUtG,SAAS,CAAgB,CAAC,EAAkC,CAClE,OAAO,aAAkB,QAAU,EAAS,EAAO,KAGpD,SAAS,CAAa,CAAC,EAAe,EAAoB,QAAsB,CAC/E,IAAM,EAAa,EAAkB,CAAI,EAEzC,GAAI,IAAU,SACb,OAAO,EAAa,CAAC,CAAU,EAAI,CAAC,EAGrC,GAAI,IAAU,OACb,OAAO,EAAa,CAAC,EAAM,CAAU,EAAI,CAAC,CAAI,EAG/C,MAAO,CAAC,CAAI,EASN,SAAS,CAAoD,CACnE,EACA,EACiB,CACjB,GAAI,EAAwB,CAAM,GAAK,EAAQ,OAAS,EAAQ,QAAU,QACzE,MAAU,MAAM,yDAAyD,EAG1E,IAAM,EAAO,EAAiB,CAAM,EAC9B,EAAW,aAAc,EAAU,EAAQ,SAAW,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AQ,EAAc,EAAM,EAAQ,KAAK,EAE/C,GAAI,EAAQ,IACX,OAAO,EAAM,QAAQ,CAAC,IAAS,MAAM,KAAK,EAAK,iBAAiB,CAAQ,CAAC,CAAC,EAG3E,QAAW,KAAQ,EAAO,CACzB,IAAM,EAAQ,EAAK,cAAc,CAAQ,EACzC,GAAI,EACH,OAAO,EAIT,OAAO,MAGR,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,MAAO,CAClB,GAAI,IAAW,MAAS,EAAQ,KAAO,MAAM,QAAQ,CAAM,GAAK,CAAC,EAAO,OACvE,EAAS,EAAa,EAEvB,OAAO,EAER,OAAO,EAAa,EAEtB",
8
+ "debugId": "CDFDEB46BDE0D97664756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,3 @@
1
+ var{defineProperty:H,getOwnPropertyNames:L,getOwnPropertyDescriptor:M}=Object,N=Object.prototype.hasOwnProperty;function O(j){return this[j]}var U=(j)=>{var q=(K??=new WeakMap).get(j),z;if(q)return q;if(q=H({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var B of L(j))if(!N.call(q,B))H(q,B,{get:O.bind(j,B),enumerable:!(z=M(j,B))||z.enumerable})}return K.set(j,q),q},K;var Q=(j)=>j;function S(j,q){this[j]=Q.bind(null,q)}var V=(j,q)=>{for(var z in q)H(j,z,{get:q[z],enumerable:!0,configurable:!0,set:S.bind(q,z)})};var W=(j,q)=>()=>(j&&(q=j(j=0)),q);var X=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(q,z)=>(typeof require<"u"?require:q)[z]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});function Z(j,q){let z=null,B=null,D,F=()=>{if(z!==null)clearTimeout(z),z=null},J=()=>{if(B===null)return D;let G=B;return B=null,F(),D=G(),D},E=function(...G){B=()=>j.apply(this,G),F(),z=setTimeout(()=>{J()},q)};return E.cancel=()=>{F(),B=null},E.flush=()=>{if(B===null)return D;return J()},E.pending=()=>B!==null,E}export{Z as debounce};
2
+
3
+ //# debugId=F738313E2B51C3E564756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "import type { Method } from '../types';\n\n/**\n * A debounced function with imperative helpers for controlling pending work.\n *\n * @typeParam T The wrapped callback type.\n */\nexport interface DebouncedFunction<T extends Method> {\n\t(...args: Parameters<T>): void;\n\n\t/**\n\t * Cancels the pending callback invocation, if one exists.\n\t */\n\tcancel(): void;\n\n\t/**\n\t * Immediately invokes the latest pending callback invocation.\n\t *\n\t * @returns The callback result when a call is pending, or the last completed\n\t * result when no call is pending.\n\t */\n\tflush(): ReturnType<T> | undefined;\n\n\t/**\n\t * Reports whether the callback currently has a scheduled invocation.\n\t *\n\t * @returns True when a call is pending.\n\t */\n\tpending(): boolean;\n}\n\n/**\n * Creates a debounced wrapper around a function.\n *\n * The returned function delays invocation until the configured timeout has\n * elapsed since the latest call. It also exposes helpers to cancel, flush,\n * and inspect pending work.\n *\n * @typeParam T The wrapped callback type.\n * @param callback The callback to debounce.\n * @param timeout The debounce timeout in milliseconds.\n * @returns A debounced wrapper around the callback.\n */\nexport function debounce<T extends Method>(callback: T, timeout: number): DebouncedFunction<T> {\n\tlet timeoutRef: ReturnType<typeof setTimeout> | null = null;\n\tlet pendingInvocation: (() => ReturnType<T>) | null = null;\n\tlet lastResult: ReturnType<T> | undefined;\n\n\tconst clearPendingCall = () => {\n\t\tif (timeoutRef !== null) {\n\t\t\tclearTimeout(timeoutRef);\n\t\t\ttimeoutRef = null;\n\t\t}\n\t};\n\n\tconst invoke = (): ReturnType<T> | undefined => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\tconst invocation = pendingInvocation;\n\t\tpendingInvocation = null;\n\t\tclearPendingCall();\n\t\tlastResult = invocation();\n\n\t\treturn lastResult;\n\t};\n\n\tconst debounced = function (this: ThisParameterType<T>, ...args: Parameters<T>) {\n\t\tpendingInvocation = () => callback.apply(this, args) as ReturnType<T>;\n\t\tclearPendingCall();\n\t\ttimeoutRef = setTimeout(() => {\n\t\t\tinvoke();\n\t\t}, timeout);\n\t} as DebouncedFunction<T>;\n\n\tdebounced.cancel = () => {\n\t\tclearPendingCall();\n\t\tpendingInvocation = null;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\treturn invoke();\n\t};\n\n\tdebounced.pending = () => pendingInvocation !== null;\n\n\treturn debounced;\n}\n"
6
6
  ],
7
- "mappings": "2PA2CO,SAAS,CAA0B,CAAC,EAAa,EAAuC,CAC9F,IAAI,EAAmD,KACnD,EAAkD,KAClD,EAEE,EAAmB,IAAM,CAC9B,GAAI,IAAe,KAClB,aAAa,CAAU,EACvB,EAAa,MAIT,EAAS,IAAiC,CAC/C,GAAI,IAAsB,KACzB,OAAO,EAGR,IAAM,EAAa,EAKnB,OAJA,EAAoB,KACpB,EAAiB,EACjB,EAAa,EAAW,EAEjB,GAGF,EAAY,QAAS,IAAgC,EAAqB,CAC/E,EAAoB,IAAM,EAAS,MAAM,KAAM,CAAI,EACnD,EAAiB,EACjB,EAAa,WAAW,IAAM,CAC7B,EAAO,GACL,CAAO,GAkBX,OAfA,EAAU,OAAS,IAAM,CACxB,EAAiB,EACjB,EAAoB,MAGrB,EAAU,MAAQ,IAAM,CACvB,GAAI,IAAsB,KACzB,OAAO,EAGR,OAAO,EAAO,GAGf,EAAU,QAAU,IAAM,IAAsB,KAEzC",
8
- "debugId": "C03902A4E5F2B24F64756E2164756E21",
7
+ "mappings": "i0BA2CO,SAAS,CAA0B,CAAC,EAAa,EAAuC,CAC9F,IAAI,EAAmD,KACnD,EAAkD,KAClD,EAEE,EAAmB,IAAM,CAC9B,GAAI,IAAe,KAClB,aAAa,CAAU,EACvB,EAAa,MAIT,EAAS,IAAiC,CAC/C,GAAI,IAAsB,KACzB,OAAO,EAGR,IAAM,EAAa,EAKnB,OAJA,EAAoB,KACpB,EAAiB,EACjB,EAAa,EAAW,EAEjB,GAGF,EAAY,QAAS,IAAgC,EAAqB,CAC/E,EAAoB,IAAM,EAAS,MAAM,KAAM,CAAI,EACnD,EAAiB,EACjB,EAAa,WAAW,IAAM,CAC7B,EAAO,GACL,CAAO,GAkBX,OAfA,EAAU,OAAS,IAAM,CACxB,EAAiB,EACjB,EAAoB,MAGrB,EAAU,MAAQ,IAAM,CACvB,GAAI,IAAsB,KACzB,OAAO,EAGR,OAAO,EAAO,GAGf,EAAU,QAAU,IAAM,IAAsB,KAEzC",
8
+ "debugId": "F738313E2B51C3E564756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -0,0 +1,3 @@
1
+ var{defineProperty:D,getOwnPropertyNames:I,getOwnPropertyDescriptor:S}=Object,Q=Object.prototype.hasOwnProperty;function A(x){return this[x]}var C=(x)=>{var $=(O??=new WeakMap).get(x),W;if($)return $;if($=D({},"__esModule",{value:!0}),x&&typeof x==="object"||typeof x==="function"){for(var _ of I(x))if(!Q.call($,_))D($,_,{get:A.bind(x,_),enumerable:!(W=S(x,_))||W.enumerable})}return O.set(x,$),$},O;var q=(x)=>x;function L(x,$){this[x]=q.bind(null,$)}var b=(x,$)=>{for(var W in $)D(x,W,{get:$[W],enumerable:!0,configurable:!0,set:L.bind($,W)})};var m=(x,$)=>()=>(x&&($=x(x=0)),$);var v=((x)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:($,W)=>(typeof require<"u"?require:$)[W]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});function p(x,$){let W=null,_=null,B,N=()=>{if(W!==null)clearTimeout(W),W=null},U=()=>{if(_===null)return B;let X=_;return _=null,N(),B=X(),B},G=function(...X){_=()=>x.apply(this,X),N(),W=setTimeout(()=>{U()},$)};return G.cancel=()=>{N(),_=null},G.flush=()=>{if(_===null)return B;return U()},G.pending=()=>_!==null,G}class F{host;eventConfig;constructor(x,$){this.host=x,this.eventConfig=$}emit(x){let $=new CustomEvent(this.eventConfig.name,{detail:x,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent($)}}function d(x,$){let W=new F(x,$);return x.registerEventEmitter($.name,W),W}function P(x){let $=globalThis.CSS;if(typeof $?.escape==="function")return $.escape(x);let W="";for(let _=0;_<x.length;_+=1){let B=x[_]??"",N=B.codePointAt(0)??0;if(N===0){W+="�";continue}let U=N>=1&&N<=31||N===127,G=_===0&&N>=48&&N<=57,X=_===1&&N>=48&&N<=57&&(x[0]??"")==="-",Y=_===0&&B==="-"&&x.length===1;if(U||G||X){W+=`\\${N.toString(16)} `;continue}if(N>=128||B==="-"||B==="_"||N>=48&&N<=57||N>=65&&N<=90||N>=97&&N<=122){W+=Y?`\\${B}`:B;continue}W+=`\\${B}`}return W}var Z=Symbol("radiant.shadowRootListenerHooks"),J=Symbol("radiant.patchedAttachShadow");function K(x){if(x instanceof Element)return x;if("host"in x)return x.host;return x.element}function T(x){return!(x instanceof Element)}function V(x,$,W,_){let B=(N)=>{if(N.target instanceof Element&&N.target.matches(W))_(N)};return x.addEventListener($.type,B,$.options),()=>{x.removeEventListener($.type,B,$.options)}}function H(x,$){let W=K(x);if(!W[Z])W[Z]=new Set;if(W[Z].add($),W[J])return;let _=W.attachShadow;W.attachShadow=function(N){let U=_.call(this,N);for(let G of W[Z]??[])G();return U},W[J]=!0}function c(x,$,W){if(T(x)&&"scope"in $&&$.scope&&$.scope!=="light")throw Error("RadiantController event listeners only support light DOM scope.");let _=K(x),B=W.bind(x),N=null,U=null,G=null,X=null,Y=!1,z=()=>{N?.(),U?.(),G?.(),X?.(),N=null,U=null,G=null,X=null},j=()=>{if(Y)return;if("window"in $&&!N)window.addEventListener($.type,B,$.options),N=()=>{window.removeEventListener($.type,B,$.options)};if("document"in $&&!U)document.addEventListener($.type,B,$.options),U=()=>{document.removeEventListener($.type,B,$.options)};if("selector"in $||"ref"in $){let M="selector"in $?$.selector:`[data-ref='${P($.ref)}']`;if($.scope!=="shadow"&&!G)G=V(_,$,M,B);if($.scope!=="light"&&_.shadowRoot&&!X)X=V(_.shadowRoot,$,M,B)}};if("selector"in $||"ref"in $){if($.scope!=="light")H(x,()=>{if(x.isConnected)j()})}if(x.registerConnectedCallback(j),x.registerCleanupCallback(z),x.isConnected)j();return()=>{Y=!0,z()}}function E(x){return!(x instanceof Element)}function R(x){return"shadowRoot"in x?x.shadowRoot??null:null}function y(x){return x instanceof Element?x:x.host}function k(x,$="light"){let W=R(x);if($==="shadow")return W?[W]:[];if($==="both")return W?[x,W]:[x];return[x]}function s(x,$){if(E(x)&&$.scope&&$.scope!=="light")throw Error("RadiantController queries only support light DOM scope.");let W=y(x),_="selector"in $?$.selector:`[data-ref="${$.ref}"]`,B=null,N=()=>{let U=k(W,$.scope);if($.all)return U.flatMap((G)=>Array.from(G.querySelectorAll(_)));for(let G of U){let X=G.querySelector(_);if(X)return X}return null};return{get value(){if($.cache){if(B===null||$.all&&Array.isArray(B)&&!B.length)B=N();return B}return N()}}}function n(x,$={}){let W=null,_,B=()=>{if($.all)return x.getSlotElements($.name);return x.getSlotElements($.name)[0]??null};return{get value(){if($.cache===!1)return B();let N=x.slotProjectionVersion??0;if(_!==N)W=B(),_=N;return W}}}export{y as resolveQueryHost,p as debounce,n as createQuerySlot,s as createQuery,c as createEventListener,d as createEvent};
2
+
3
+ //# debugId=8494EE3E9EF074C364756E2164756E21