@ecopages/radiant 0.3.0-beta.0 → 0.3.0-beta.2

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 (578) hide show
  1. package/README.md +5 -5
  2. package/client/app-bootstrap.js +3 -0
  3. package/{dist/client → client}/app-bootstrap.js.map +2 -2
  4. package/client/hydrator.js +3 -0
  5. package/{dist/client → client}/hydrator.js.map +2 -2
  6. package/client/install-hydrator.js +3 -0
  7. package/{dist/client → client}/install-hydrator.js.map +2 -2
  8. package/context/context-consumer-bootstrap.js +3 -0
  9. package/{dist/context → context}/context-consumer-bootstrap.js.map +4 -4
  10. package/context/context-consumer-runtime.js +3 -0
  11. package/context/context-consumer-runtime.js.map +12 -0
  12. package/context/context-host.js +3 -0
  13. package/{dist/context → context}/context-host.js.map +2 -2
  14. package/context/context-provider.js +3 -0
  15. package/{dist/context → context}/context-provider.js.map +3 -3
  16. package/context/context-ssr-bridge.js +3 -0
  17. package/{dist/context → context}/context-ssr-bridge.js.map +2 -2
  18. package/context/create-context.js +3 -0
  19. package/{dist/context → context}/create-context.js.map +2 -2
  20. package/context/decorators/consume-context.js +3 -0
  21. package/{dist/context → context}/decorators/consume-context.js.map +5 -5
  22. package/context/decorators/context-selection-delivery.js +3 -0
  23. package/{dist/context → context}/decorators/context-selection-delivery.js.map +2 -2
  24. package/context/decorators/context-selector.js +3 -0
  25. package/{dist/context → context}/decorators/context-selector.js.map +6 -6
  26. package/context/decorators/legacy/consume-context.js +3 -0
  27. package/context/decorators/legacy/consume-context.js.map +16 -0
  28. package/context/decorators/legacy/context-selector-field.js +3 -0
  29. package/context/decorators/legacy/context-selector-field.js.map +17 -0
  30. package/context/decorators/legacy/context-selector.js +3 -0
  31. package/context/decorators/legacy/context-selector.js.map +17 -0
  32. package/context/decorators/legacy/provide-context.js +3 -0
  33. package/{dist/context → context}/decorators/legacy/provide-context.js.map +4 -4
  34. package/context/decorators/on-context-update.js +3 -0
  35. package/{dist/context → context}/decorators/on-context-update.js.map +5 -5
  36. package/context/decorators/provide-context.js +3 -0
  37. package/{dist/context → context}/decorators/provide-context.js.map +4 -4
  38. package/context/decorators/standard/consume-context.js +3 -0
  39. package/{dist/context → context}/decorators/standard/consume-context.js.map +4 -4
  40. package/context/decorators/standard/context-selector-field.js +3 -0
  41. package/{dist/context → context}/decorators/standard/context-selector-field.js.map +4 -4
  42. package/context/decorators/standard/context-selector.js +3 -0
  43. package/{dist/context → context}/decorators/standard/context-selector.js.map +4 -4
  44. package/context/decorators/standard/provide-context.js +3 -0
  45. package/{dist/context → context}/decorators/standard/provide-context.js.map +3 -3
  46. package/context/decorators/standard-legacy-dispatch.js +3 -0
  47. package/context/decorators/standard-legacy-dispatch.js.map +10 -0
  48. package/context/events.js +3 -0
  49. package/context/events.js.map +10 -0
  50. package/context/hydration-script.js +3 -0
  51. package/{dist/context → context}/hydration-script.js.map +2 -2
  52. package/context/index.js +3 -0
  53. package/{dist/context → context}/index.js.map +6 -6
  54. package/controller-registry.js +3 -0
  55. package/{dist/controller-registry.js.map → controller-registry.js.map} +3 -3
  56. package/core/controller-metadata.js +3 -0
  57. package/{dist/core → core}/controller-metadata.js.map +2 -2
  58. package/core/custom-element-metadata.js +3 -0
  59. package/{dist/core → core}/custom-element-metadata.js.map +2 -2
  60. package/core/event-subscription-registry.js +3 -0
  61. package/{dist/core → core}/event-subscription-registry.js.map +2 -2
  62. package/core/host-ssr-registry.js +3 -0
  63. package/{dist/core → core}/host-ssr-registry.js.map +2 -2
  64. package/core/hydration-capable-host.js +3 -0
  65. package/{dist/core → core}/hydration-capable-host.js.map +2 -2
  66. package/core/hydration-codec.js +3 -0
  67. package/{dist/core → core}/hydration-codec.js.map +2 -2
  68. package/{dist/core → core}/radiant-controller.d.ts +7 -5
  69. package/core/radiant-controller.js +3 -0
  70. package/core/radiant-controller.js.map +21 -0
  71. package/core/radiant-element-ssr-host.js +3 -0
  72. package/{dist/core → core}/radiant-element-ssr-host.js.map +2 -2
  73. package/{dist/core → core}/radiant-element-ssr-registry.d.ts +4 -2
  74. package/core/radiant-element-ssr-registry.js +3 -0
  75. package/core/radiant-element-ssr-registry.js.map +10 -0
  76. package/{dist/core → core}/radiant-element.d.ts +18 -15
  77. package/core/radiant-element.js +3 -0
  78. package/core/radiant-element.js.map +31 -0
  79. package/core/radiant-hydrator-state.js +3 -0
  80. package/{dist/core → core}/radiant-hydrator-state.js.map +2 -2
  81. package/core/reactive-binding-adapter.d.ts +10 -0
  82. package/core/reactive-binding-adapter.js +3 -0
  83. package/core/reactive-binding-adapter.js.map +10 -0
  84. package/core/reactive-host.d.ts +138 -0
  85. package/core/reactive-host.js +3 -0
  86. package/core/reactive-host.js.map +13 -0
  87. package/{dist/core → core}/reactive-jsx-value.d.ts +2 -2
  88. package/core/reactive-jsx-value.js +3 -0
  89. package/core/reactive-jsx-value.js.map +10 -0
  90. package/{dist/core → core}/reactive-prop-core.d.ts +6 -11
  91. package/core/reactive-prop-core.js +3 -0
  92. package/{dist/core → core}/reactive-prop-core.js.map +3 -3
  93. package/core/reactive-prop-metadata.js +3 -0
  94. package/{dist/core → core}/reactive-prop-metadata.js.map +2 -2
  95. package/{dist/core → core}/reactive-property-state.d.ts +5 -2
  96. package/core/reactive-property-state.js +3 -0
  97. package/core/reactive-property-state.js.map +12 -0
  98. package/core/reactivity-adapter.js +3 -0
  99. package/core/reactivity-adapter.js.map +12 -0
  100. package/{dist/core → core}/reactivity-contract.d.ts +14 -0
  101. package/core/reactivity-runtime.js +3 -0
  102. package/core/reactivity-runtime.js.map +11 -0
  103. package/core/reactivity-signals.js +3 -0
  104. package/core/reactivity-signals.js.map +10 -0
  105. package/core/render-runtime.js +3 -0
  106. package/{dist/core → core}/render-runtime.js.map +3 -3
  107. package/core/render-scheduler.js +3 -0
  108. package/{dist/core → core}/render-scheduler.js.map +2 -2
  109. package/core/slot-projection-runtime.js +3 -0
  110. package/{dist/core → core}/slot-projection-runtime.js.map +2 -2
  111. package/core/ssr-preparation.js +3 -0
  112. package/{dist/core → core}/ssr-preparation.js.map +2 -2
  113. package/decorators/attr.js +3 -0
  114. package/decorators/attr.js.map +18 -0
  115. package/decorators/bound.js +3 -0
  116. package/{dist/decorators → decorators}/bound.js.map +2 -2
  117. package/decorators/bridge.js +3 -0
  118. package/{dist/decorators → decorators}/bridge.js.map +2 -2
  119. package/decorators/controller.js +3 -0
  120. package/{dist/decorators → decorators}/controller.js.map +3 -3
  121. package/decorators/custom-element.js +3 -0
  122. package/{dist/decorators → decorators}/custom-element.js.map +2 -2
  123. package/decorators/debounce.js +3 -0
  124. package/{dist/decorators → decorators}/debounce.js.map +2 -2
  125. package/decorators/event.js +3 -0
  126. package/{dist/decorators → decorators}/event.js.map +3 -3
  127. package/decorators/legacy/attr.js +3 -0
  128. package/decorators/legacy/attr.js.map +15 -0
  129. package/decorators/legacy/bound.js +3 -0
  130. package/{dist/decorators → decorators}/legacy/bound.js.map +2 -2
  131. package/decorators/legacy/custom-element.js +3 -0
  132. package/{dist/decorators → decorators}/legacy/custom-element.js.map +2 -2
  133. package/decorators/legacy/debounce.js +3 -0
  134. package/{dist/decorators → decorators}/legacy/debounce.js.map +2 -2
  135. package/decorators/legacy/event.js +3 -0
  136. package/decorators/legacy/event.js.map +13 -0
  137. package/decorators/legacy/host-readiness.js +3 -0
  138. package/decorators/legacy/host-readiness.js.map +11 -0
  139. package/{dist/decorators → decorators}/legacy/instance-initializers.d.ts +4 -2
  140. package/decorators/legacy/instance-initializers.js +3 -0
  141. package/decorators/legacy/instance-initializers.js.map +10 -0
  142. package/decorators/legacy/member-bootstrap.d.ts +10 -0
  143. package/decorators/legacy/member-bootstrap.js +3 -0
  144. package/decorators/legacy/member-bootstrap.js.map +10 -0
  145. package/decorators/legacy/on-event.js +3 -0
  146. package/{dist/decorators → decorators}/legacy/on-event.js.map +3 -3
  147. package/decorators/legacy/on-updated.js +3 -0
  148. package/decorators/legacy/on-updated.js.map +11 -0
  149. package/decorators/legacy/query-slot.js +3 -0
  150. package/decorators/legacy/query-slot.js.map +13 -0
  151. package/decorators/legacy/query.js +3 -0
  152. package/decorators/legacy/query.js.map +12 -0
  153. package/decorators/legacy/reactive-field.js +3 -0
  154. package/decorators/legacy/reactive-field.js.map +13 -0
  155. package/{dist/decorators → decorators}/legacy/reactive-prop.d.ts +0 -1
  156. package/decorators/legacy/reactive-prop.js +3 -0
  157. package/decorators/legacy/reactive-prop.js.map +15 -0
  158. package/decorators/legacy/signal.js +3 -0
  159. package/decorators/legacy/signal.js.map +17 -0
  160. package/decorators/on-event.js +3 -0
  161. package/{dist/decorators → decorators}/on-event.js.map +3 -3
  162. package/decorators/on-updated.js +3 -0
  163. package/{dist/decorators → decorators}/on-updated.js.map +3 -3
  164. package/{dist/decorators → decorators}/prop.d.ts +4 -5
  165. package/decorators/prop.js +3 -0
  166. package/decorators/prop.js.map +18 -0
  167. package/decorators/query-slot.js +3 -0
  168. package/{dist/decorators → decorators}/query-slot.js.map +3 -3
  169. package/decorators/query.js +3 -0
  170. package/{dist/decorators → decorators}/query.js.map +3 -3
  171. package/decorators/shared/auto-bind.d.ts +7 -0
  172. package/decorators/shared/auto-bind.js +3 -0
  173. package/decorators/shared/auto-bind.js.map +10 -0
  174. package/decorators/shared/reactive-attr.js +3 -0
  175. package/decorators/shared/reactive-attr.js.map +13 -0
  176. package/decorators/signal.js +3 -0
  177. package/decorators/signal.js.map +19 -0
  178. package/decorators/standard/attr.js +3 -0
  179. package/decorators/standard/attr.js.map +14 -0
  180. package/decorators/standard/bound.js +3 -0
  181. package/{dist/decorators → decorators}/standard/bound.js.map +2 -2
  182. package/decorators/standard/custom-element.js +3 -0
  183. package/{dist/decorators → decorators}/standard/custom-element.js.map +2 -2
  184. package/decorators/standard/debounce.js +3 -0
  185. package/{dist/decorators → decorators}/standard/debounce.js.map +2 -2
  186. package/decorators/standard/event.js +3 -0
  187. package/{dist/decorators → decorators}/standard/event.js.map +2 -2
  188. package/decorators/standard/on-event.js +3 -0
  189. package/{dist/decorators → decorators}/standard/on-event.js.map +2 -2
  190. package/decorators/standard/on-updated.js +3 -0
  191. package/{dist/decorators → decorators}/standard/on-updated.js.map +2 -2
  192. package/decorators/standard/query-slot.js +3 -0
  193. package/{dist/decorators → decorators}/standard/query-slot.js.map +2 -2
  194. package/decorators/standard/query.js +3 -0
  195. package/{dist/decorators → decorators}/standard/query.js.map +2 -2
  196. package/decorators/standard/reactive-field.js +3 -0
  197. package/decorators/standard/reactive-field.js.map +11 -0
  198. package/decorators/standard/reactive-prop.js +3 -0
  199. package/{dist/decorators → decorators}/standard/reactive-prop.js.map +4 -4
  200. package/decorators/standard/signal.js +3 -0
  201. package/decorators/standard/signal.js.map +16 -0
  202. package/{dist/decorators → decorators}/state.d.ts +3 -2
  203. package/decorators/state.js +3 -0
  204. package/decorators/state.js.map +16 -0
  205. package/helpers/create-event-listener.js +3 -0
  206. package/{dist/helpers → helpers}/create-event-listener.js.map +2 -2
  207. package/helpers/create-event.js +3 -0
  208. package/{dist/helpers → helpers}/create-event.js.map +2 -2
  209. package/helpers/create-query-slot.js +3 -0
  210. package/{dist/helpers → helpers}/create-query-slot.js.map +2 -2
  211. package/helpers/create-query.js +3 -0
  212. package/{dist/helpers → helpers}/create-query.js.map +2 -2
  213. package/helpers/debounce.js +3 -0
  214. package/{dist/helpers → helpers}/debounce.js.map +2 -2
  215. package/helpers/index.js +3 -0
  216. package/{dist/helpers → helpers}/index.js.map +2 -2
  217. package/index.js +3 -0
  218. package/index.js.map +86 -0
  219. package/package.json +99 -129
  220. package/server/context-ssr.js +3 -0
  221. package/{dist/server → server}/context-ssr.js.map +2 -2
  222. package/server/host-attribute-serialization.js +3 -0
  223. package/{dist/server → server}/host-attribute-serialization.js.map +5 -5
  224. package/server/host-script-composition.js +3 -0
  225. package/{dist/server → server}/host-script-composition.js.map +2 -2
  226. package/server/html-parser.js +3 -0
  227. package/{dist/server → server}/html-parser.js.map +2 -2
  228. package/server/install-light-dom-shim.js +3 -0
  229. package/server/install-light-dom-shim.js.map +17 -0
  230. package/server/internal-radiant-host.js +3 -0
  231. package/{dist/server → server}/internal-radiant-host.js.map +1 -1
  232. package/server/light-dom-shim.d.ts +2 -0
  233. package/server/light-dom-shim.js +3 -0
  234. package/server/light-dom-shim.js.map +16 -0
  235. package/server/minimal-dom/document.d.ts +17 -0
  236. package/server/minimal-dom/document.js +3 -0
  237. package/server/minimal-dom/document.js.map +14 -0
  238. package/server/minimal-dom/html.d.ts +7 -0
  239. package/server/minimal-dom/html.js +3 -0
  240. package/server/minimal-dom/html.js.map +13 -0
  241. package/{dist/server/light-dom-shim.d.ts → server/minimal-dom/install.d.ts} +1 -4
  242. package/server/minimal-dom/install.js +3 -0
  243. package/server/minimal-dom/install.js.map +16 -0
  244. package/server/minimal-dom/nodes.d.ts +78 -0
  245. package/server/project-root.js +3 -0
  246. package/{dist/server → server}/project-root.js.map +2 -2
  247. package/server/radiant-element-ssr-bridge.js +3 -0
  248. package/{dist/server → server}/radiant-element-ssr-bridge.js.map +9 -9
  249. package/server/radiant-element-ssr-extractor.js +3 -0
  250. package/{dist/server → server}/radiant-element-ssr-extractor.js.map +3 -3
  251. package/server/radiant-element-ssr-service.js +3 -0
  252. package/{dist/server → server}/radiant-element-ssr-service.js.map +8 -8
  253. package/server/radiant-element-ssr.js +3 -0
  254. package/{dist/server → server}/radiant-element-ssr.js.map +9 -9
  255. package/{dist/server → server}/render-component.d.ts +1 -1
  256. package/server/render-component.js +3 -0
  257. package/server/render-component.js.map +32 -0
  258. package/server/render-controller.js +3 -0
  259. package/server/render-controller.js.map +35 -0
  260. package/server/render-fragment.js +3 -0
  261. package/server/render-fragment.js.map +10 -0
  262. package/server/slot-projection-html.js +3 -0
  263. package/{dist/server → server}/slot-projection-html.js.map +4 -4
  264. package/signals/host-resource.js +3 -0
  265. package/{dist/signals → signals}/host-resource.js.map +2 -2
  266. package/{dist/signals → signals}/host-signal.d.ts +2 -1
  267. package/signals/host-signal.js +3 -0
  268. package/signals/host-signal.js.map +13 -0
  269. package/signals/hydration-script.js +3 -0
  270. package/{dist/signals → signals}/hydration-script.js.map +2 -2
  271. package/tools/escape-css-identifier.js +3 -0
  272. package/{dist/tools → tools}/escape-css-identifier.js.map +2 -2
  273. package/tools/escape-script-json.js +3 -0
  274. package/{dist/tools → tools}/escape-script-json.js.map +2 -2
  275. package/tools/event-emitter.js +3 -0
  276. package/{dist/tools → tools}/event-emitter.js.map +2 -2
  277. package/tools/index.js +3 -0
  278. package/{dist/tools → tools}/index.js.map +2 -2
  279. package/tools/render-jsx-template.js +3 -0
  280. package/{dist/tools → tools}/render-jsx-template.js.map +2 -2
  281. package/types.js +3 -0
  282. package/{dist/types.js.map → types.js.map} +2 -2
  283. package/utils/attribute-utils.js +3 -0
  284. package/{dist/utils → utils}/attribute-utils.js.map +2 -2
  285. package/utils/escape-html-attribute.js +3 -0
  286. package/{dist/utils → utils}/escape-html-attribute.js.map +2 -2
  287. package/utils/index.js +3 -0
  288. package/{dist/utils → utils}/index.js.map +2 -2
  289. package/dist/LICENSE +0 -21
  290. package/dist/README.md +0 -315
  291. package/dist/client/app-bootstrap.js +0 -3
  292. package/dist/client/hydrator.js +0 -3
  293. package/dist/client/install-hydrator.js +0 -3
  294. package/dist/context/context-consumer-bootstrap.js +0 -3
  295. package/dist/context/context-consumer-runtime.js +0 -3
  296. package/dist/context/context-consumer-runtime.js.map +0 -12
  297. package/dist/context/context-host.js +0 -3
  298. package/dist/context/context-provider.js +0 -3
  299. package/dist/context/context-ssr-bridge.js +0 -3
  300. package/dist/context/create-context.js +0 -3
  301. package/dist/context/decorators/consume-context.js +0 -3
  302. package/dist/context/decorators/context-selection-delivery.js +0 -3
  303. package/dist/context/decorators/context-selector.js +0 -3
  304. package/dist/context/decorators/legacy/consume-context.js +0 -3
  305. package/dist/context/decorators/legacy/consume-context.js.map +0 -16
  306. package/dist/context/decorators/legacy/context-selector-field.js +0 -3
  307. package/dist/context/decorators/legacy/context-selector-field.js.map +0 -17
  308. package/dist/context/decorators/legacy/context-selector.js +0 -3
  309. package/dist/context/decorators/legacy/context-selector.js.map +0 -17
  310. package/dist/context/decorators/legacy/provide-context.js +0 -3
  311. package/dist/context/decorators/on-context-update.js +0 -3
  312. package/dist/context/decorators/provide-context.js +0 -3
  313. package/dist/context/decorators/standard/consume-context.js +0 -3
  314. package/dist/context/decorators/standard/context-selector-field.js +0 -3
  315. package/dist/context/decorators/standard/context-selector.js +0 -3
  316. package/dist/context/decorators/standard/provide-context.js +0 -3
  317. package/dist/context/decorators/standard-legacy-dispatch.js +0 -3
  318. package/dist/context/decorators/standard-legacy-dispatch.js.map +0 -10
  319. package/dist/context/events.js +0 -3
  320. package/dist/context/events.js.map +0 -10
  321. package/dist/context/hydration-script.js +0 -3
  322. package/dist/context/index.js +0 -3
  323. package/dist/controller-registry.js +0 -3
  324. package/dist/core/controller-metadata.js +0 -3
  325. package/dist/core/custom-element-metadata.js +0 -3
  326. package/dist/core/event-subscription-registry.js +0 -3
  327. package/dist/core/host-ssr-registry.js +0 -3
  328. package/dist/core/hydration-capable-host.js +0 -3
  329. package/dist/core/hydration-codec.js +0 -3
  330. package/dist/core/radiant-controller.js +0 -3
  331. package/dist/core/radiant-controller.js.map +0 -20
  332. package/dist/core/radiant-element-ssr-host.js +0 -3
  333. package/dist/core/radiant-element-ssr-registry.js +0 -3
  334. package/dist/core/radiant-element-ssr-registry.js.map +0 -10
  335. package/dist/core/radiant-element.js +0 -3
  336. package/dist/core/radiant-element.js.map +0 -30
  337. package/dist/core/radiant-hydrator-state.js +0 -3
  338. package/dist/core/reactive-host.d.ts +0 -124
  339. package/dist/core/reactive-host.js +0 -3
  340. package/dist/core/reactive-host.js.map +0 -13
  341. package/dist/core/reactive-jsx-value.js +0 -3
  342. package/dist/core/reactive-jsx-value.js.map +0 -10
  343. package/dist/core/reactive-prop-core.js +0 -3
  344. package/dist/core/reactive-prop-metadata.js +0 -3
  345. package/dist/core/reactive-property-state.js +0 -3
  346. package/dist/core/reactive-property-state.js.map +0 -12
  347. package/dist/core/reactivity-adapter.js +0 -3
  348. package/dist/core/reactivity-adapter.js.map +0 -12
  349. package/dist/core/reactivity-runtime.js +0 -3
  350. package/dist/core/reactivity-runtime.js.map +0 -11
  351. package/dist/core/reactivity-signals.js +0 -3
  352. package/dist/core/reactivity-signals.js.map +0 -10
  353. package/dist/core/render-runtime.js +0 -3
  354. package/dist/core/render-scheduler.js +0 -3
  355. package/dist/core/slot-projection-runtime.js +0 -3
  356. package/dist/core/ssr-preparation.js +0 -3
  357. package/dist/decorators/attr.js +0 -3
  358. package/dist/decorators/attr.js.map +0 -17
  359. package/dist/decorators/bound.js +0 -3
  360. package/dist/decorators/bridge.js +0 -3
  361. package/dist/decorators/controller.js +0 -3
  362. package/dist/decorators/custom-element.js +0 -3
  363. package/dist/decorators/debounce.js +0 -3
  364. package/dist/decorators/event.js +0 -3
  365. package/dist/decorators/legacy/attr.js +0 -3
  366. package/dist/decorators/legacy/attr.js.map +0 -14
  367. package/dist/decorators/legacy/bound.js +0 -3
  368. package/dist/decorators/legacy/custom-element.js +0 -3
  369. package/dist/decorators/legacy/debounce.js +0 -3
  370. package/dist/decorators/legacy/event.js +0 -3
  371. package/dist/decorators/legacy/event.js.map +0 -13
  372. package/dist/decorators/legacy/host-readiness.js +0 -3
  373. package/dist/decorators/legacy/host-readiness.js.map +0 -11
  374. package/dist/decorators/legacy/instance-initializers.js +0 -3
  375. package/dist/decorators/legacy/instance-initializers.js.map +0 -10
  376. package/dist/decorators/legacy/on-event.js +0 -3
  377. package/dist/decorators/legacy/on-updated.js +0 -3
  378. package/dist/decorators/legacy/on-updated.js.map +0 -11
  379. package/dist/decorators/legacy/query-slot.js +0 -3
  380. package/dist/decorators/legacy/query-slot.js.map +0 -13
  381. package/dist/decorators/legacy/query.js +0 -3
  382. package/dist/decorators/legacy/query.js.map +0 -12
  383. package/dist/decorators/legacy/reactive-field.js +0 -3
  384. package/dist/decorators/legacy/reactive-field.js.map +0 -11
  385. package/dist/decorators/legacy/reactive-prop.js +0 -3
  386. package/dist/decorators/legacy/reactive-prop.js.map +0 -14
  387. package/dist/decorators/legacy/signal.js +0 -3
  388. package/dist/decorators/legacy/signal.js.map +0 -16
  389. package/dist/decorators/on-event.js +0 -3
  390. package/dist/decorators/on-updated.js +0 -3
  391. package/dist/decorators/prop.js +0 -3
  392. package/dist/decorators/prop.js.map +0 -17
  393. package/dist/decorators/query-slot.js +0 -3
  394. package/dist/decorators/query.js +0 -3
  395. package/dist/decorators/shared/reactive-attr.js +0 -3
  396. package/dist/decorators/shared/reactive-attr.js.map +0 -12
  397. package/dist/decorators/signal.js +0 -3
  398. package/dist/decorators/signal.js.map +0 -18
  399. package/dist/decorators/standard/attr.js +0 -3
  400. package/dist/decorators/standard/attr.js.map +0 -13
  401. package/dist/decorators/standard/bound.js +0 -3
  402. package/dist/decorators/standard/custom-element.js +0 -3
  403. package/dist/decorators/standard/debounce.js +0 -3
  404. package/dist/decorators/standard/event.js +0 -3
  405. package/dist/decorators/standard/on-event.js +0 -3
  406. package/dist/decorators/standard/on-updated.js +0 -3
  407. package/dist/decorators/standard/query-slot.js +0 -3
  408. package/dist/decorators/standard/query.js +0 -3
  409. package/dist/decorators/standard/reactive-field.js +0 -3
  410. package/dist/decorators/standard/reactive-field.js.map +0 -10
  411. package/dist/decorators/standard/reactive-prop.js +0 -3
  412. package/dist/decorators/standard/signal.js +0 -3
  413. package/dist/decorators/standard/signal.js.map +0 -15
  414. package/dist/decorators/state.js +0 -3
  415. package/dist/decorators/state.js.map +0 -14
  416. package/dist/helpers/create-event-listener.js +0 -3
  417. package/dist/helpers/create-event.js +0 -3
  418. package/dist/helpers/create-query-slot.js +0 -3
  419. package/dist/helpers/create-query.js +0 -3
  420. package/dist/helpers/debounce.js +0 -3
  421. package/dist/helpers/index.js +0 -3
  422. package/dist/index.js +0 -3
  423. package/dist/index.js.map +0 -83
  424. package/dist/package.json +0 -209
  425. package/dist/server/context-ssr.js +0 -3
  426. package/dist/server/host-attribute-serialization.js +0 -3
  427. package/dist/server/host-script-composition.js +0 -3
  428. package/dist/server/html-parser.js +0 -3
  429. package/dist/server/install-light-dom-shim.js +0 -3
  430. package/dist/server/install-light-dom-shim.js.map +0 -12
  431. package/dist/server/internal-radiant-host.js +0 -3
  432. package/dist/server/light-dom-shim.js +0 -3
  433. package/dist/server/light-dom-shim.js.map +0 -11
  434. package/dist/server/project-root.js +0 -3
  435. package/dist/server/radiant-element-ssr-bridge.js +0 -3
  436. package/dist/server/radiant-element-ssr-extractor.js +0 -3
  437. package/dist/server/radiant-element-ssr-service.js +0 -3
  438. package/dist/server/radiant-element-ssr.js +0 -3
  439. package/dist/server/render-component.js +0 -3
  440. package/dist/server/render-component.js.map +0 -28
  441. package/dist/server/render-controller.js +0 -3
  442. package/dist/server/render-controller.js.map +0 -31
  443. package/dist/server/render-fragment.js +0 -3
  444. package/dist/server/render-fragment.js.map +0 -10
  445. package/dist/server/slot-projection-html.js +0 -3
  446. package/dist/signals/host-resource.js +0 -3
  447. package/dist/signals/host-signal.js +0 -3
  448. package/dist/signals/host-signal.js.map +0 -13
  449. package/dist/signals/hydration-script.js +0 -3
  450. package/dist/tools/escape-css-identifier.js +0 -3
  451. package/dist/tools/escape-script-json.js +0 -3
  452. package/dist/tools/event-emitter.js +0 -3
  453. package/dist/tools/index.js +0 -3
  454. package/dist/tools/render-jsx-template.js +0 -3
  455. package/dist/types.js +0 -3
  456. package/dist/utils/attribute-utils.js +0 -3
  457. package/dist/utils/escape-html-attribute.js +0 -3
  458. package/dist/utils/index.js +0 -3
  459. /package/{dist/client → client}/app-bootstrap.d.ts +0 -0
  460. /package/{dist/client → client}/hydrator.d.ts +0 -0
  461. /package/{dist/client → client}/install-hydrator.d.ts +0 -0
  462. /package/{dist/context → context}/context-consumer-bootstrap.d.ts +0 -0
  463. /package/{dist/context → context}/context-consumer-runtime.d.ts +0 -0
  464. /package/{dist/context → context}/context-host.d.ts +0 -0
  465. /package/{dist/context → context}/context-provider.d.ts +0 -0
  466. /package/{dist/context → context}/context-ssr-bridge.d.ts +0 -0
  467. /package/{dist/context → context}/create-context.d.ts +0 -0
  468. /package/{dist/context → context}/decorators/consume-context.d.ts +0 -0
  469. /package/{dist/context → context}/decorators/context-selection-delivery.d.ts +0 -0
  470. /package/{dist/context → context}/decorators/context-selector.d.ts +0 -0
  471. /package/{dist/context → context}/decorators/legacy/consume-context.d.ts +0 -0
  472. /package/{dist/context → context}/decorators/legacy/context-selector-field.d.ts +0 -0
  473. /package/{dist/context → context}/decorators/legacy/context-selector.d.ts +0 -0
  474. /package/{dist/context → context}/decorators/legacy/provide-context.d.ts +0 -0
  475. /package/{dist/context → context}/decorators/on-context-update.d.ts +0 -0
  476. /package/{dist/context → context}/decorators/provide-context.d.ts +0 -0
  477. /package/{dist/context → context}/decorators/standard/consume-context.d.ts +0 -0
  478. /package/{dist/context → context}/decorators/standard/context-selector-field.d.ts +0 -0
  479. /package/{dist/context → context}/decorators/standard/context-selector.d.ts +0 -0
  480. /package/{dist/context → context}/decorators/standard/provide-context.d.ts +0 -0
  481. /package/{dist/context → context}/decorators/standard-legacy-dispatch.d.ts +0 -0
  482. /package/{dist/context → context}/events.d.ts +0 -0
  483. /package/{dist/context → context}/hydration-script.d.ts +0 -0
  484. /package/{dist/context → context}/index.d.ts +0 -0
  485. /package/{dist/context → context}/types.d.ts +0 -0
  486. /package/{dist/context → context}/types.js +0 -0
  487. /package/{dist/context → context}/types.js.map +0 -0
  488. /package/{dist/controller-registry.d.ts → controller-registry.d.ts} +0 -0
  489. /package/{dist/core → core}/controller-metadata.d.ts +0 -0
  490. /package/{dist/core → core}/custom-element-metadata.d.ts +0 -0
  491. /package/{dist/core → core}/event-subscription-registry.d.ts +0 -0
  492. /package/{dist/core → core}/host-ssr-registry.d.ts +0 -0
  493. /package/{dist/core → core}/hydration-capable-host.d.ts +0 -0
  494. /package/{dist/core → core}/hydration-codec.d.ts +0 -0
  495. /package/{dist/core → core}/radiant-element-ssr-host.d.ts +0 -0
  496. /package/{dist/core → core}/radiant-hydrator-state.d.ts +0 -0
  497. /package/{dist/core → core}/reactive-prop-metadata.d.ts +0 -0
  498. /package/{dist/core → core}/reactivity-adapter.d.ts +0 -0
  499. /package/{dist/core → core}/reactivity-contract.js +0 -0
  500. /package/{dist/core → core}/reactivity-contract.js.map +0 -0
  501. /package/{dist/core → core}/reactivity-runtime.d.ts +0 -0
  502. /package/{dist/core → core}/reactivity-signals.d.ts +0 -0
  503. /package/{dist/core → core}/render-runtime.d.ts +0 -0
  504. /package/{dist/core → core}/render-scheduler.d.ts +0 -0
  505. /package/{dist/core → core}/slot-projection-runtime.d.ts +0 -0
  506. /package/{dist/core → core}/ssr-hydration-binding.d.ts +0 -0
  507. /package/{dist/core → core}/ssr-hydration-binding.js +0 -0
  508. /package/{dist/core → core}/ssr-hydration-binding.js.map +0 -0
  509. /package/{dist/core → core}/ssr-preparation.d.ts +0 -0
  510. /package/{dist/decorators → decorators}/attr.d.ts +0 -0
  511. /package/{dist/decorators → decorators}/bound.d.ts +0 -0
  512. /package/{dist/decorators → decorators}/bridge.d.ts +0 -0
  513. /package/{dist/decorators → decorators}/controller.d.ts +0 -0
  514. /package/{dist/decorators → decorators}/custom-element.d.ts +0 -0
  515. /package/{dist/decorators → decorators}/debounce.d.ts +0 -0
  516. /package/{dist/decorators → decorators}/event.d.ts +0 -0
  517. /package/{dist/decorators → decorators}/legacy/attr.d.ts +0 -0
  518. /package/{dist/decorators → decorators}/legacy/bound.d.ts +0 -0
  519. /package/{dist/decorators → decorators}/legacy/custom-element.d.ts +0 -0
  520. /package/{dist/decorators → decorators}/legacy/debounce.d.ts +0 -0
  521. /package/{dist/decorators → decorators}/legacy/event.d.ts +0 -0
  522. /package/{dist/decorators → decorators}/legacy/host-readiness.d.ts +0 -0
  523. /package/{dist/decorators → decorators}/legacy/on-event.d.ts +0 -0
  524. /package/{dist/decorators → decorators}/legacy/on-updated.d.ts +0 -0
  525. /package/{dist/decorators → decorators}/legacy/query-slot.d.ts +0 -0
  526. /package/{dist/decorators → decorators}/legacy/query.d.ts +0 -0
  527. /package/{dist/decorators → decorators}/legacy/reactive-field.d.ts +0 -0
  528. /package/{dist/decorators → decorators}/legacy/signal.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}/shared/reactive-attr.d.ts +0 -0
  534. /package/{dist/decorators → decorators}/signal.d.ts +0 -0
  535. /package/{dist/decorators → decorators}/standard/attr.d.ts +0 -0
  536. /package/{dist/decorators → decorators}/standard/bound.d.ts +0 -0
  537. /package/{dist/decorators → decorators}/standard/custom-element.d.ts +0 -0
  538. /package/{dist/decorators → decorators}/standard/debounce.d.ts +0 -0
  539. /package/{dist/decorators → decorators}/standard/event.d.ts +0 -0
  540. /package/{dist/decorators → decorators}/standard/on-event.d.ts +0 -0
  541. /package/{dist/decorators → decorators}/standard/on-updated.d.ts +0 -0
  542. /package/{dist/decorators → decorators}/standard/query-slot.d.ts +0 -0
  543. /package/{dist/decorators → decorators}/standard/query.d.ts +0 -0
  544. /package/{dist/decorators → decorators}/standard/reactive-field.d.ts +0 -0
  545. /package/{dist/decorators → decorators}/standard/reactive-prop.d.ts +0 -0
  546. /package/{dist/decorators → decorators}/standard/signal.d.ts +0 -0
  547. /package/{dist/helpers → helpers}/create-event-listener.d.ts +0 -0
  548. /package/{dist/helpers → helpers}/create-event.d.ts +0 -0
  549. /package/{dist/helpers → helpers}/create-query-slot.d.ts +0 -0
  550. /package/{dist/helpers → helpers}/create-query.d.ts +0 -0
  551. /package/{dist/helpers → helpers}/debounce.d.ts +0 -0
  552. /package/{dist/helpers → helpers}/index.d.ts +0 -0
  553. /package/{dist/index.d.ts → index.d.ts} +0 -0
  554. /package/{dist/server → server}/context-ssr.d.ts +0 -0
  555. /package/{dist/server → server}/host-attribute-serialization.d.ts +0 -0
  556. /package/{dist/server → server}/host-script-composition.d.ts +0 -0
  557. /package/{dist/server → server}/html-parser.d.ts +0 -0
  558. /package/{dist/server → server}/install-light-dom-shim.d.ts +0 -0
  559. /package/{dist/server → server}/internal-radiant-host.d.ts +0 -0
  560. /package/{dist/server → server}/project-root.d.ts +0 -0
  561. /package/{dist/server → server}/radiant-element-ssr-bridge.d.ts +0 -0
  562. /package/{dist/server → server}/radiant-element-ssr-extractor.d.ts +0 -0
  563. /package/{dist/server → server}/radiant-element-ssr-service.d.ts +0 -0
  564. /package/{dist/server → server}/radiant-element-ssr.d.ts +0 -0
  565. /package/{dist/server → server}/render-controller.d.ts +0 -0
  566. /package/{dist/server → server}/render-fragment.d.ts +0 -0
  567. /package/{dist/server → server}/slot-projection-html.d.ts +0 -0
  568. /package/{dist/signals → signals}/host-resource.d.ts +0 -0
  569. /package/{dist/signals → signals}/hydration-script.d.ts +0 -0
  570. /package/{dist/tools → tools}/escape-css-identifier.d.ts +0 -0
  571. /package/{dist/tools → tools}/escape-script-json.d.ts +0 -0
  572. /package/{dist/tools → tools}/event-emitter.d.ts +0 -0
  573. /package/{dist/tools → tools}/index.d.ts +0 -0
  574. /package/{dist/tools → tools}/render-jsx-template.d.ts +0 -0
  575. /package/{dist/types.d.ts → types.d.ts} +0 -0
  576. /package/{dist/utils → utils}/attribute-utils.d.ts +0 -0
  577. /package/{dist/utils → utils}/escape-html-attribute.d.ts +0 -0
  578. /package/{dist/utils → utils}/index.d.ts +0 -0
package/dist/README.md DELETED
@@ -1,315 +0,0 @@
1
- # Radiant
2
-
3
- Radiant is a light-DOM platform for custom elements and DOM-attached controllers.
4
-
5
- It keeps browser primitives visible instead of wrapping them in a synthetic component model. You work with real custom elements, real DOM events, real attributes, and real light-DOM children. Use `RadiantElement` when you want reactive fields, JSX-backed rendering, SSR host serialization, and hydration on a real custom element. Use `RadiantController` when you want behavior attached to existing DOM instead of defining a custom element.
6
-
7
- Radiant deliberately does not use shadow DOM by default. That makes styling, DOM inspection, and authored child content simpler, while giving up some of the encapsulation that conventional custom-element guidance usually prefers.
8
-
9
- For the full docs site, see [radiant.ecopages.app](https://radiant.ecopages.app/).
10
-
11
- ## Installation
12
-
13
- `@ecopages/radiant` is the core package. `@ecopages/jsx` and `@ecopages/signals` are companion packages for TSX rendering and standalone signals.
14
-
15
- `@ecopages/radiant` currently declares both companion packages as peer dependencies.
16
-
17
- Install all three packages:
18
-
19
- ```sh
20
- bun add @ecopages/radiant @ecopages/signals @ecopages/jsx
21
- ```
22
-
23
- Application code does not need to import JSX helpers or Signals primitives directly for every feature, but the current published Radiant surface expects both companion packages to be installed alongside it.
24
-
25
- ## RadiantElement Mental Model
26
-
27
- `RadiantElement` is the structured base class for reactive custom elements.
28
-
29
- - `render()` returns the current JSX view.
30
- - First connect automatically chooses between hydration and a fresh client render.
31
- - `update()` reruns `render()` and commits the current view into the host immediately.
32
- - `requestUpdate()` schedules one rerender in a microtask and coalesces repeated requests.
33
- - `@prop(...)`, `@state`, and `@signal(...)` define reactive members.
34
- - `@onUpdated(...)` is the bridge from reactive member changes to `update()` or `requestUpdate()` when the rendered structure needs to be recomputed.
35
- - `this.bindings.key`, `this.$.key`, and `this.bind('key')` expose stable JSX bindings for reactive members.
36
- - If `render()` is omitted, the base implementation behaves like `<slot />`, so authored light-DOM children pass through unchanged.
37
- - Literal `<slot>` tags project authored light-DOM content, and `getSlotElement(...)`, `getSlotElements(...)`, or `@querySlot(...)` let component logic read the assigned elements.
38
-
39
- The key distinction is this:
40
-
41
- - Use bindings such as `this.$.count` when the shape of the view stays the same and only child values need to change.
42
- - Use `update()` or `requestUpdate()` when a reactive change affects the structure of the JSX tree.
43
-
44
- Signal and store reads performed directly inside `render()` also participate in rerender invalidation, so shared reactive data can drive `RadiantElement` views without an extra wrapper layer.
45
-
46
- ## Counter Example
47
-
48
- This counter shows the intended `RadiantElement` style for stable templates: public props stay explicit, internal state stays local, and bound child values update without forcing a full rerender of the whole template.
49
-
50
- ```tsx
51
- /** @jsxImportSource @ecopages/jsx */
52
-
53
- import type { JsxCustomElementAttributes } from '@ecopages/jsx';
54
- import { RadiantElement, customElement, prop, state } from '@ecopages/radiant';
55
-
56
- type CounterCardBindings = {
57
- count: number;
58
- label: string;
59
- };
60
-
61
- type CounterCardAttributes = {
62
- label?: string;
63
- };
64
-
65
- @customElement('counter-card')
66
- export class CounterCard extends RadiantElement<CounterCardBindings> {
67
- @prop({ type: String, defaultValue: 'Clicks' }) label!: string;
68
- @state count = 0;
69
-
70
- private readonly increment = () => {
71
- this.count += 1;
72
- };
73
-
74
- override render() {
75
- return (
76
- <section>
77
- <h2>{this.$.label}</h2>
78
- <p>Count: {this.$.count}</p>
79
- <button type="button" on:click={this.increment}>
80
- Increment
81
- </button>
82
- </section>
83
- );
84
- }
85
- }
86
-
87
- declare module '@ecopages/jsx/jsx-runtime' {
88
- interface JsxCustomIntrinsicElements {
89
- 'counter-card': JsxCustomElementAttributes<HTMLElement, CounterCardAttributes>;
90
- }
91
- }
92
- ```
93
-
94
- How this works:
95
-
96
- - `@prop(...)` makes `label` part of the component's public reactive property and attribute surface.
97
- - `@state` is internal mutable state.
98
- - `this.$.label` and `this.$.count` are cached JSX bindings, so those text positions can update directly when the underlying reactive members change.
99
- - This example does not call `update()` because the view structure is stable. Only the bound child values change.
100
- - The JSX intrinsic-element declaration uses a public attribute type that is narrower than the internal binding shape. That is usually the right split.
101
-
102
- If the same type truly represents both internal bindings and public JSX attributes, you can reuse it for both. Otherwise, keep those contracts separate.
103
-
104
- ### When To Call `update()`
105
-
106
- Call `update()` or `requestUpdate()` when a reactive change affects which elements should exist, not just their child values.
107
-
108
- ```ts
109
- import { RadiantElement, onUpdated, state } from '@ecopages/radiant';
110
-
111
- export class ResultsPanel extends RadiantElement<{ expanded: boolean }> {
112
- @state expanded = false;
113
-
114
- @onUpdated('expanded')
115
- protected rerenderView(): void {
116
- this.requestUpdate();
117
- }
118
- }
119
- ```
120
-
121
- Use `update()` when you want the rerender immediately. Use `requestUpdate()` when several changes may happen in the same turn and one final rerender is enough.
122
-
123
- ## Reactive JSX Bindings
124
-
125
- Bindings are the non-obvious part of the API, and they are worth being explicit about.
126
-
127
- `RadiantElement<Bindings>` takes a dedicated binding shape, not the full class type. That keeps the binding namespace limited to the reactive props or fields you want JSX to consume.
128
-
129
- These three forms are equivalent:
130
-
131
- - `this.bindings.count`
132
- - `this.$.count`
133
- - `this.bind('count')`
134
-
135
- They all resolve through the same cached binding object.
136
-
137
- Use bindings when:
138
-
139
- - the rendered element structure stays the same
140
- - only text, attribute, or child-value positions need to change
141
- - you want the renderer to patch the owned child range instead of rerunning the whole component view
142
-
143
- Use `@onUpdated(...)` with `update()` or `requestUpdate()` when the reactive change should rebuild the JSX tree.
144
-
145
- ## SSR And Hydration
146
-
147
- `RadiantElement` has two SSR surfaces:
148
-
149
- - `renderToString()` serializes the component view only.
150
- - `renderHostToString()` serializes the custom-element host together with the current view.
151
-
152
- In practice, `renderHostToString()` is the right default for full component SSR because it emits `<my-element>...</my-element>` instead of only the view fragment.
153
-
154
- `mode: 'hydrate'` adds hydration markers for the component view. First-connect hydration is now explicit: SSR pages should import `@ecopages/radiant/client/install-hydrator` before loading component modules, or call `installRadiantHydrator()` from `@ecopages/radiant/client/hydrator` before custom elements upgrade. Without that client hydrator gate, SSR hosts fall back to a fresh client render on first connect.
155
-
156
- For element-owned SSR, the instance methods still work. For adapters, fragment responses, and shared server utilities, prefer the explicit helpers under `@ecopages/radiant/server/render-component`.
157
-
158
- Server runtime setup, fragment rendering helpers, and SSR-specific import guidance now live in [src/server/README.md](src/server/README.md).
159
-
160
- For the client lifecycle and hydration flow diagram, see [src/core/README.md](src/core/README.md).
161
-
162
- ## Event Handling
163
-
164
- Radiant does not invent a synthetic event layer. JSX handlers and decorators work with the native browser event object directly.
165
-
166
- | Use this | When you want | Runtime shape |
167
- | -------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
168
- | `on:*` in JSX | The normal event API | Auto-delegates a fixed allowlist of bubbling events and falls back to direct listeners otherwise |
169
- | `on-native:*` in JSX | Exact element-level browser listener semantics | Always calls `addEventListener(...)` on that element |
170
- | `@onEvent(...)` | Class-level listening from `RadiantElement` | Supports `selector`, `ref`, `window`, and `document` targets |
171
- | `@event(...)` | A typed custom event emitter owned by the component | Dispatches a real `CustomEvent` from the host element |
172
-
173
- ### How JSX Event Binding Works
174
-
175
- `on:*` is the default JSX event API. For a fixed allowlist of bubbling events, Radiant attaches one listener per event type on the render root and dispatches to matched elements. For all other events, `on:*` attaches directly on the element.
176
-
177
- Today the delegated allowlist is:
178
-
179
- - `beforeinput`
180
- - `click`
181
- - `contextmenu`
182
- - `dblclick`
183
- - `focusin`
184
- - `focusout`
185
- - `input`
186
- - `keydown`
187
- - `keyup`
188
- - `mousedown`
189
- - `mouseout`
190
- - `mouseover`
191
- - `mouseup`
192
- - `pointerdown`
193
- - `pointerout`
194
- - `pointerover`
195
- - `pointerup`
196
- - `touchend`
197
- - `touchmove`
198
- - `touchstart`
199
-
200
- Use `on-native:*` when exact attachment semantics matter, such as when an ancestor may stop propagation before the delegated root listener runs or when you want to opt out of delegation for a supported bubbling event.
201
-
202
- Events outside the allowlist, such as `focus`, `blur`, `scroll`, `load`, `invalid`, or `dragstart`, already attach directly when authored with `on:*`.
203
-
204
- ### `@onEvent(...)`
205
-
206
- At the class level, `@onEvent(...)` is the main decorator for incoming DOM events. It can listen to:
207
-
208
- - descendants that match a CSS selector
209
- - descendants marked with `data-ref`
210
- - global `window` events
211
- - global `document` events
212
-
213
- ```tsx
214
- /** @jsxImportSource @ecopages/jsx */
215
-
216
- import { RadiantElement, customElement, onEvent, state } from '@ecopages/radiant';
217
-
218
- @customElement('keyboard-panel')
219
- export class KeyboardPanel extends RadiantElement<{ lastKey: string }> {
220
- @state lastKey = 'none';
221
-
222
- @onEvent({ document: true, type: 'keydown' })
223
- protected onKeydown(event: KeyboardEvent): void {
224
- this.lastKey = event.key;
225
- }
226
-
227
- override render() {
228
- return <p>Last key: {this.$.lastKey}</p>;
229
- }
230
- }
231
- ```
232
-
233
- Important: `@onEvent({ selector: ... })` and `@onEvent({ ref: ... })` currently check `event.target.matches(...)` directly. That means matching is strict against the original target, not ancestor-aware. If a nested element inside a button receives the click, the nested element must match for the handler to run.
234
-
235
- Also note that selector- and ref-based `@onEvent(...)` handlers rely on bubbling. Use `focusin` and `focusout` instead of `focus` and `blur` for that pattern.
236
-
237
- ### `@event(...)`
238
-
239
- Outgoing component events use `@event(...)`, which gives the class a typed `EventEmitter`. Calling `.emit(detail)` dispatches a real `CustomEvent` from the host element.
240
-
241
- ```ts
242
- import type { EventEmitter } from '@ecopages/radiant/tools/event-emitter';
243
- import { RadiantElement, customElement, event } from '@ecopages/radiant';
244
-
245
- type SaveDetail = {
246
- id: string;
247
- };
248
-
249
- @customElement('save-button')
250
- export class SaveButton extends RadiantElement {
251
- @event({ name: 'save-requested', bubbles: true, composed: true })
252
- saveRequested!: EventEmitter<SaveDetail>;
253
-
254
- requestSave(): void {
255
- this.saveRequested.emit({ id: 'draft-1' });
256
- }
257
- }
258
- ```
259
-
260
- The mental model stays simple:
261
-
262
- - DOM events come in through JSX handlers or `@onEvent(...)`
263
- - component events go out through `@event(...)`
264
- - both are ordinary browser events at runtime
265
-
266
- ## Public Entry Points
267
-
268
- These are the documented public import paths exposed by the package.
269
-
270
- | Path | Use for |
271
- | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
272
- | `@ecopages/radiant` | Main client entrypoint. Re-exports `RadiantElement`, `RadiantController`, reactive JSX bindings, common decorators, and controller-registry helpers such as `startControllers(...)` |
273
- | `@ecopages/radiant/context` | Context-related exports as a grouped entrypoint |
274
- | `@ecopages/radiant/context/create-context` | Creating context keys |
275
- | `@ecopages/radiant/context/context-provider` | Low-level context provider class |
276
- | `@ecopages/radiant/context/consume-context` | `@consumeContext(...)` decorator |
277
- | `@ecopages/radiant/context/provide-context` | `@provideContext(...)` decorator |
278
- | `@ecopages/radiant/context/context-selector` | `@contextSelector(...)` decorator — bind a field to context |
279
- | `@ecopages/radiant/context/on-context-update` | `@onContextUpdate(...)` decorator — run a method on context change |
280
- | `@ecopages/radiant/controller-registry` | Controller registration and activation helpers |
281
- | `@ecopages/radiant/core/radiant-element` | Non-JSX reactive custom-element base |
282
- | `@ecopages/radiant/core/radiant-controller` | DOM-attached controller base |
283
- | `@ecopages/radiant/helpers/create-query` | Low-level query helper for component fields |
284
- | `@ecopages/radiant/helpers/create-query-slot` | Low-level slot query helper for component fields |
285
- | `@ecopages/radiant/helpers/create-event` | Low-level typed custom-event helper |
286
- | `@ecopages/radiant/helpers/create-event-listener` | Low-level DOM event-listener helper |
287
- | `@ecopages/radiant/client/hydrator` | Explicit client hydrator installer and status helpers for SSR pages |
288
- | `@ecopages/radiant/client/install-hydrator` | Side-effect entrypoint that enables first-connect hydration before component modules load |
289
- | `@ecopages/radiant/signals/host-resource` | Low-level `HostResource`, `createHostResource(...)`, and `createResource(...)` helpers |
290
- | `@ecopages/radiant/server/light-dom-shim` | Minimal SSR window and host-preparation helpers |
291
- | `@ecopages/radiant/server/render-component` | Canonical component SSR helpers and shared fragment metadata utilities |
292
- | `@ecopages/radiant/server/render-controller` | Controller-host SSR helpers and controller-specific host option types |
293
- | `@ecopages/radiant/server/project-root` | Project-root resolution helper for server adapters |
294
- | `@ecopages/radiant/decorators/bound` | `@bound` |
295
- | `@ecopages/radiant/decorators/custom-element` | `@customElement(...)` |
296
- | `@ecopages/radiant/decorators/debounce` | `@debounce(...)` |
297
- | `@ecopages/radiant/decorators/event` | `@event(...)` |
298
- | `@ecopages/radiant/decorators/on-event` | `@onEvent(...)` |
299
- | `@ecopages/radiant/decorators/on-updated` | `@onUpdated(...)` |
300
- | `@ecopages/radiant/decorators/prop` | `@prop(...)` |
301
- | `@ecopages/radiant/decorators/query` | `@query(...)` |
302
- | `@ecopages/radiant/decorators/query-slot` | `@querySlot(...)` |
303
- | `@ecopages/radiant/decorators/signal` | `@signal(...)` |
304
- | `@ecopages/radiant/decorators/state` | `@state` |
305
- | `@ecopages/radiant/tools/render-jsx-template` | Render a JSX template result into an existing host |
306
- | `@ecopages/radiant/tools/escape-script-json` | Safe JSON-for-script serialization helper |
307
- | `@ecopages/radiant/tools/event-emitter` | Low-level `EventEmitter` helper |
308
-
309
- Prefer focused public subpaths when bundle size matters or when a module only needs one narrow runtime surface. The root entrypoint remains the ergonomic default for common app code, but context, registry, helper, server, signal-resource, and low-level tool imports are better taken from their explicit public subpaths.
310
-
311
- For controller authoring, prefer a single import surface per module. If a file mixes `RadiantController`, `@controller(...)`, `@state`, `@attr(...)`, or `startControllers(...)`, default to `@ecopages/radiant` so controller registration and startup come from the same entrypoint.
312
-
313
- Important: context APIs, controller registry helpers, helper factories, server APIs, and low-level tools have explicit public subpaths. Prefer those focused paths for library and adapter code, or when a module intentionally wants only the registry runtime without the broader client surface; the root entrypoint remains the ergonomic app entrypoint for the common client surface.
314
-
315
- For SSR-specific guidance and examples, see [src/server/README.md](src/server/README.md).
@@ -1,3 +0,0 @@
1
- var a=((p)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(p,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):p)(function(p){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+p+'" is not supported')});async function s({app:p,bootstrap:t,context:o}){let e=await t?.(o);return{app:p(e?.appProps??void 0),onStarted:e?.onStarted}}export{s as prepareRadiantApp};
2
-
3
- //# debugId=CED638BAFDDA666064756E2164756E21
@@ -1,3 +0,0 @@
1
- var C=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(v,z)=>(typeof require<"u"?require:v)[z]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});var j=Symbol.for("@ecopages/radiant.hydrator-installed");function k(){globalThis[j]=!0}function m(){delete globalThis[j]}function q(){return globalThis[j]===!0}function K(){k()}function P(){m()}function Q(){return q()}export{P as uninstallRadiantHydrator,K as installRadiantHydrator,Q as hasRadiantHydrator};
2
-
3
- //# debugId=44CC84C7C166F16C64756E2164756E21
@@ -1,3 +0,0 @@
1
- var C=((m)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(m,{get:(v,z)=>(typeof require<"u"?require:v)[z]}):m)(function(m){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+m+'" is not supported')});var f=Symbol.for("@ecopages/radiant.hydrator-installed");function j(){globalThis[f]=!0}function k(){delete globalThis[f]}function p(){return globalThis[f]===!0}function q(){j()}function K(){k()}function P(){return p()}q();
2
-
3
- //# debugId=AE046A6617778EC864756E2164756E21
@@ -1,3 +0,0 @@
1
- var y=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(w,H)=>(typeof require<"u"?require:w)[H]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});var Z=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),Y=Symbol.for("@ecopages/radiant.ssr-preparation-running");function f(j,w){let F=j[Z];if(Array.isArray(F)){F.push(w);return}Object.defineProperty(j,Z,{value:[w],configurable:!0})}function m(j){let w=j,H=w[Z];if(!Array.isArray(H))return;w[Y]=!0;try{for(let F of H)F()}finally{delete w[Y]}}var z=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function K(){return globalThis}function O(j){K()[z]=j}function $(j){return K()[z]?.(j)}var G;((J)=>{J.SUBSCRIPTION_REQUEST="context-subscription-request";J.CONTEXT_REQUEST="context-request";J.ON_MOUNT="context-on-mount";J.MOUNTED="context-mounted"})(G||={});class D extends Event{context;callback;subscribe;handled=!1;constructor(j,w,H){super("context-request",{bubbles:!0,composed:!0});this.context=j;this.callback=w;this.subscribe=H}markHandled(){this.handled=!0}}class I extends CustomEvent{constructor(j){super("context-on-mount",{detail:{context:j},bubbles:!0,composed:!0})}}class M extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(j,w,H,F,J){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=j;this.callback=w;this.select=H;this.subscribe=F;this.onSubscribe=J}markHandled(){this.handled=!0}}function U(j,w,H,F={}){let J=$(w);if(!J)return!1;if(H(J),j.connectedContextCallback(w),F.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:J}));return!0}function V(j,w,H,F={}){let J=new D(w,(Q)=>{if(H(Q),j.connectedContextCallback(w),F.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:Q}))});return j.dispatchEvent(J),J.handled}function W(j,w){let H=$(j);if(!H)return!1;let F=H.getContext();if(w.select)return w.callback(w.select(F)),!0;return w.callback(F),!0}function X(j,w,H,F){let J=new M(w,H.callback,H.select,F.subscribe,F.onSubscribe);return j.dispatchEvent(J),J.handled}function g(j,w,H,F={}){return B(j,()=>U(j,w,H,F))}function b(j,w,H,F){return B(j,()=>{if(F)return W(w,{callback:H,select:F});return W(w,{callback:H})})}function d(j,w,H,F={}){if(U(j,w,H,F))return!0;return V(j,w,H,F)}function u(j,w,H,F={}){if(F.select){let Q={callback:H,select:F.select};if(W(w,Q))return!0;return X(j,w,Q,{subscribe:F.subscribe,onSubscribe:F.onSubscribe})}let J={callback:H};if(W(w,J))return!0;return X(j,w,J,{subscribe:F.subscribe,onSubscribe:F.onSubscribe})}function B(j,w){return f(j,w),w()}export{u as connectContextSelection,d as connectConsumedContext,b as bootstrapSsrContextSelection,g as bootstrapSsrConsumedContext};
2
-
3
- //# debugId=916174640860D2F664756E2164756E21
@@ -1,3 +0,0 @@
1
- var f=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(k,z)=>(typeof require<"u"?require:k)[z]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});var U=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function W(){return globalThis}function D(j){W()[U]=j}function H(j){return W()[U]?.(j)}var Z;((w)=>{w.SUBSCRIPTION_REQUEST="context-subscription-request";w.CONTEXT_REQUEST="context-request";w.ON_MOUNT="context-on-mount";w.MOUNTED="context-mounted"})(Z||={});class J extends Event{context;callback;subscribe;handled=!1;constructor(j,k,z){super("context-request",{bubbles:!0,composed:!0});this.context=j;this.callback=k;this.subscribe=z}markHandled(){this.handled=!0}}class $ extends CustomEvent{constructor(j){super("context-on-mount",{detail:{context:j},bubbles:!0,composed:!0})}}class K extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(j,k,z,F,w){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=j;this.callback=k;this.select=z;this.subscribe=F;this.onSubscribe=w}markHandled(){this.handled=!0}}function X(j,k,z,F={}){let w=H(k);if(!w)return!1;if(z(w),j.connectedContextCallback(k),F.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:w}));return!0}function Y(j,k,z,F={}){let w=new J(k,(Q)=>{if(z(Q),j.connectedContextCallback(k),F.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:Q}))});return j.dispatchEvent(w),w.handled}function A(j,k){let z=H(j);if(!z)return!1;let F=z.getContext();if(k.select)return k.callback(k.select(F)),!0;return k.callback(F),!0}function L(j,k,z,F){let w=new K(k,z.callback,z.select,F.subscribe,F.onSubscribe);return j.dispatchEvent(w),w.handled}export{L as requestContextSelection,Y as requestConsumedContext,A as initializeContextSelection,X as initializeConsumedContext};
2
-
3
- //# debugId=A42C1D7F427BF19B64756E2164756E21
@@ -1,12 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/context/context-ssr-bridge.ts", "../src/context/events.ts", "../src/context/context-consumer-runtime.ts"],
4
- "sourcesContent": [
5
- "import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nconst SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-provider-resolver');\n\ntype GlobalResolverScope = typeof globalThis & {\n\t[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?: SsrContextProviderResolver;\n};\n\nfunction getGlobalResolverScope(): GlobalResolverScope {\n\treturn globalThis as GlobalResolverScope;\n}\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tgetGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL] = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn getGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?.(context);\n}\n",
6
- "import type { Context, ContextCallback, ContextType, UnknownContext } from './types';\n\n/**\n * List of events which can be emitted by a context provider or requester.\n */\nexport enum ContextEventsTypes {\n\tSUBSCRIPTION_REQUEST = 'context-subscription-request',\n\tCONTEXT_REQUEST = 'context-request',\n\tON_MOUNT = 'context-on-mount',\n\tMOUNTED = 'context-mounted',\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n */\nexport class ContextRequestEvent<T extends UnknownContext> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<ContextType<T>>,\n\t\tpublic readonly subscribe?: boolean,\n\t) {\n\t\tsuper(ContextEventsTypes.CONTEXT_REQUEST, { bubbles: true, composed: true });\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\n/**\n * A type which represents a subscription to a context value.\n */\ntype DirectContextSubscription<T extends UnknownContext> = {\n\tselect?: undefined;\n\tcallback: ContextCallback<ContextType<T>>;\n};\n\ntype SelectedContextSubscription<T extends UnknownContext, Selected> = {\n\tselect: (context: ContextType<T>) => Selected;\n\tcallback: ContextCallback<Selected>;\n};\n\nexport type ContextSubscription<T extends UnknownContext, Selected = ContextType<T>> =\n\t| DirectContextSubscription<T>\n\t| SelectedContextSubscription<T, Selected>;\n\n/**\n * An event fired by a context provider to signal that a context value has been mounted and is available for consumption.\n */\nexport class ContextOnMountEvent extends CustomEvent<{ context: UnknownContext }> {\n\tpublic constructor(context: UnknownContext) {\n\t\tsuper(ContextEventsTypes.ON_MOUNT, {\n\t\t\tdetail: { context },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n *\n * It accepts a `selector` property which can be used to request a specific property of the context value.\n */\nexport class ContextSubscriptionRequestEvent<T extends UnknownContext, Selected = ContextType<T>> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<Selected>,\n\t\tpublic readonly select?: (context: ContextType<T>) => Selected,\n\t\tpublic readonly subscribe?: boolean,\n\t\tpublic readonly onSubscribe?: (unsubscribe: () => void) => void,\n\t) {\n\t\tsuper(ContextEventsTypes.SUBSCRIPTION_REQUEST, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\t/**\n\t\t * A 'context-request-subscription' event can be emitted by any element which desires\n\t\t * a context value to be injected by an external provider.\n\t\t */\n\t\t[ContextEventsTypes.SUBSCRIPTION_REQUEST]: ContextSubscriptionRequestEvent<UnknownContext>;\n\t\t/**\n\t\t * A context-request-provider event can be emitted by a context requester to signal\n\t\t * that it desires a context value to be provided by a context provider.\n\t\t */\n\t\t[ContextEventsTypes.CONTEXT_REQUEST]: ContextRequestEvent<Context<unknown, unknown>>;\n\t\t/**\n\t\t * A 'context-mount' event can be emitted by a context provider to signal\n\t\t * that a context value has been mounted and is available for consumption.\n\t\t */\n\t\t[ContextEventsTypes.ON_MOUNT]: ContextOnMountEvent;\n\t}\n}\n",
7
- "import type { ContextHostLike } from './context-host';\nimport { resolveAmbientSsrContextProvider } from './context-ssr-bridge';\nimport { ContextEventsTypes, ContextRequestEvent, ContextSubscriptionRequestEvent } from './events';\nimport type { ContextCallback, ContextType, UnknownContext } from './types';\n\ntype ConsumedContextAssignment = (provider: unknown) => void;\n\ntype DirectContextSelectionRequest<TContext extends UnknownContext> = {\n\tcallback: (value: ContextType<TContext>) => void;\n\tselect?: undefined;\n};\n\ntype SelectedContextSelectionRequest<TContext extends UnknownContext, Selected> = {\n\tcallback: (value: Selected) => void;\n\tselect: (context: ContextType<TContext>) => Selected;\n};\n\ntype ContextSelectionRequest<TContext extends UnknownContext, Selected = ContextType<TContext>> =\n\t| DirectContextSelectionRequest<TContext>\n\t| SelectedContextSelectionRequest<TContext, Selected>;\n\n/**\n * Resolves a consumed context from the active SSR provider stack when one is available.\n *\n * This keeps SSR-specific lookup outside decorator implementations while preserving\n * the same consumer initialization contract for both standard and legacy decorators.\n *\n * @returns `true` when the context was resolved synchronously from SSR state.\n */\nexport function initializeConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tassign(provider);\n\thost.connectedContextCallback(context);\n\n\tif (options.emitMounted) {\n\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t}\n\n\treturn true;\n}\n\n/**\n * Requests a context provider through the DOM event channel when SSR state is not active.\n */\nexport function requestConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tconst event = new ContextRequestEvent(context, (provider) => {\n\t\tassign(provider);\n\t\thost.connectedContextCallback(context);\n\n\t\tif (options.emitMounted) {\n\t\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t\t}\n\t});\n\n\thost.dispatchEvent(event);\n\treturn event.handled;\n}\n\n/**\n * Resolves a selected context value from the active SSR provider stack when available.\n *\n * @returns `true` when the selection callback was satisfied synchronously from SSR state.\n */\nexport function initializeContextSelection<TContext extends UnknownContext>(\n\tcontext: TContext,\n\trequest: DirectContextSelectionRequest<TContext>,\n): boolean;\nexport function initializeContextSelection<TContext extends UnknownContext, Selected>(\n\tcontext: TContext,\n\trequest: SelectedContextSelectionRequest<TContext, Selected>,\n): boolean;\nexport function initializeContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\tcontext: TContext,\n\trequest: ContextSelectionRequest<TContext, Selected>,\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tconst resolvedContext = provider.getContext() as ContextType<TContext>;\n\n\tif (request.select) {\n\t\trequest.callback(request.select(resolvedContext));\n\t\treturn true;\n\t}\n\n\trequest.callback(resolvedContext);\n\treturn true;\n}\n\n/**\n * Requests a selected context value through the DOM event channel.\n */\nexport function requestContextSelection<TContext extends UnknownContext>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: DirectContextSelectionRequest<TContext>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean;\nexport function requestContextSelection<TContext extends UnknownContext, Selected>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: SelectedContextSelectionRequest<TContext, Selected>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean;\nexport function requestContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: ContextSelectionRequest<TContext, Selected>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean {\n\tconst event = new ContextSubscriptionRequestEvent(\n\t\tcontext,\n\t\trequest.callback as ContextCallback<Selected>,\n\t\trequest.select,\n\t\toptions.subscribe,\n\t\toptions.onSubscribe,\n\t);\n\n\thost.dispatchEvent(event);\n\treturn event.handled;\n}\n"
8
- ],
9
- "mappings": "2PAKA,IAAM,EAAuC,OAAO,IAAI,iDAAiD,EAMzG,SAAS,CAAsB,EAAwB,CACtD,OAAO,WAUD,SAAS,CAAiC,CAAC,EAA4C,CAC7F,EAAuB,EAAE,GAAwC,EAM3D,SAAS,CAAgC,CAAC,EAAqE,CACrH,OAAO,EAAuB,EAAE,KAAwC,CAAO,ECzBzE,IAAK,GAAL,CAAK,IAAL,CACN,uBAAuB,+BACvB,kBAAkB,kBAClB,WAAW,mBACX,UAAU,oBAJC,QAiBL,MAAM,UAAsD,KAAM,CAIvD,QACA,SACA,UALV,QAAU,GAEV,WAAW,CACD,EACA,EACA,EACf,CACD,MAAM,kBAAoC,CAAE,QAAS,GAAM,SAAU,EAAK,CAAC,EAJ3D,eACA,gBACA,iBAKV,WAAW,EAAS,CAC1B,KAAK,QAAU,GAEjB,CAsBO,MAAM,UAA4B,WAAyC,CAC1E,WAAW,CAAC,EAAyB,CAC3C,MAAM,mBAA6B,CAClC,OAAQ,CAAE,SAAQ,EAClB,QAAS,GACT,SAAU,EACX,CAAC,EAEH,CAcO,MAAM,UAA6F,KAAM,CAI9F,QACA,SACA,OACA,UACA,YAPV,QAAU,GAEV,WAAW,CACD,EACA,EACA,EACA,EACA,EACf,CACD,MAAM,+BAAyC,CAC9C,QAAS,GACT,SAAU,EACX,CAAC,EATe,eACA,gBACA,cACA,iBACA,mBAQV,WAAW,EAAS,CAC1B,KAAK,QAAU,GAEjB,CCtEO,SAAS,CAAyB,CACxC,EACA,EACA,EACA,EAAqC,CAAC,EAC5B,CACV,IAAM,EAAW,EAAiC,CAAO,EAEzD,GAAI,CAAC,EACJ,MAAO,GAMR,GAHA,EAAO,CAAQ,EACf,EAAK,yBAAyB,CAAO,EAEjC,EAAQ,YACX,EAAK,cAAc,IAAI,8BAAwC,CAAE,OAAQ,CAAS,CAAC,CAAC,EAGrF,MAAO,GAMD,SAAS,CAAsB,CACrC,EACA,EACA,EACA,EAAqC,CAAC,EAC5B,CACV,IAAM,EAAQ,IAAI,EAAoB,EAAS,CAAC,IAAa,CAI5D,GAHA,EAAO,CAAQ,EACf,EAAK,yBAAyB,CAAO,EAEjC,EAAQ,YACX,EAAK,cAAc,IAAI,8BAAwC,CAAE,OAAQ,CAAS,CAAC,CAAC,EAErF,EAGD,OADA,EAAK,cAAc,CAAK,EACjB,EAAM,QAgBP,SAAS,CAA6F,CAC5G,EACA,EACU,CACV,IAAM,EAAW,EAAiC,CAAO,EAEzD,GAAI,CAAC,EACJ,MAAO,GAGR,IAAM,EAAkB,EAAS,WAAW,EAE5C,GAAI,EAAQ,OAEX,OADA,EAAQ,SAAS,EAAQ,OAAO,CAAe,CAAC,EACzC,GAIR,OADA,EAAQ,SAAS,CAAe,EACzB,GAwBD,SAAS,CAA0F,CACzG,EACA,EACA,EACA,EAIU,CACV,IAAM,EAAQ,IAAI,EACjB,EACA,EAAQ,SACR,EAAQ,OACR,EAAQ,UACR,EAAQ,WACT,EAGA,OADA,EAAK,cAAc,CAAK,EACjB,EAAM",
10
- "debugId": "A42C1D7F427BF19B64756E2164756E21",
11
- "names": []
12
- }
@@ -1,3 +0,0 @@
1
- var o=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function r(e){if(e instanceof Element)return e;if("host"in e)return e.host;if("element"in e)return e.element;return null}function l(e){if(e instanceof Element)return e;if("host"in e)return e.host;if("element"in e)return e.element;return e}export{l as resolveContextHydrationHost,r as resolveContextHostElement};
2
-
3
- //# debugId=1756919FA3B4A60064756E2164756E21
@@ -1,3 +0,0 @@
1
- var K=((L)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(L,{get:(f,g)=>(typeof require<"u"?require:f)[g]}):L)(function(L){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+L+'" is not supported')});function W(L){return L.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var F="data-hydration",z="data-hydration-type",$="data-hydration-key";function J(L){let f=L.hydrationKey?` ${$}="${D(L.hydrationKey)}"`:"";return`<script type="application/json" ${F} ${z}="${L.type}"${f}>${L.serializedValue}</script>`}function w(L){return W(L)}function C(L,f){let g=L.textContent;if(!g)return f;try{return JSON.parse(g)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${F}>:`,g.slice(0,120));return f}}function E(L,f,g){let q=L.children;if(!q||q.length===0){let j=L.childNodes;if(!j||j.length===0)return null;for(let G=0;G<j.length;G+=1){let Q=j[G];if(Q.nodeType!==1)continue;let P=Q;if(X(P,f,g))return P}return null}for(let j=0;j<q.length;j+=1)if(X(q[j],f,g))return q[j];return null}function X(L,f,g){if(L.tagName!=="SCRIPT"||!L.hasAttribute(F)||L.getAttribute(z)!==f)return!1;if(g!==void 0)return L.getAttribute($)===g;return!L.hasAttribute($)}function D(L){return L.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function I(L){if(L instanceof Element)return L;if("host"in L)return L.host;if("element"in L)return L.element;return null}function M(L){if(L instanceof Element)return L;if("host"in L)return L.host;if("element"in L)return L.element;return L}function O(L){return J({type:"context",...L})}function U(L){return w(L)}var B;((j)=>{j.SUBSCRIPTION_REQUEST="context-subscription-request";j.CONTEXT_REQUEST="context-request";j.ON_MOUNT="context-on-mount";j.MOUNTED="context-mounted"})(B||={});class H extends Event{context;callback;subscribe;handled=!1;constructor(L,f,g){super("context-request",{bubbles:!0,composed:!0});this.context=L;this.callback=f;this.subscribe=g}markHandled(){this.handled=!0}}class Z extends CustomEvent{constructor(L){super("context-on-mount",{detail:{context:L},bubbles:!0,composed:!0})}}class m extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(L,f,g,q,j){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=L;this.callback=f;this.select=g;this.subscribe=q;this.onSubscribe=j}markHandled(){this.handled=!0}}import{createMarkupNodeLike as k}from"@ecopages/jsx";class A{host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(L,f){this.host=L,this.context=f.context,this.hydrationKey=f.hydrationKey,this.hydrate=f.hydrate,this.serialize=f.serialize,this.pendingHostHydration=Boolean(f.hydrate),this.value=f.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new Z(this.context))}setContext=(L,f)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(L)){let g=this.value;if(this.value={...L},f)f(this.value);this.notifySubscribers(this.value,g);return}if(this.isObject(this.value)&&this.isObject(L)){let g={...this.value};if(this.value={...this.value,...L},f)f(this.value);this.notifySubscribers(this.value,g)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let L=this.serialize?this.serialize(this.value):this.value;if(typeof L>"u")return;let f=JSON.stringify(L);if(typeof f!=="string")return;return U(f)};renderHydrationScriptTag=()=>{let L=this.serializeHydrationValue();if(!L)return;return O({hydrationKey:this.hydrationKey,serializedValue:L})};renderHydrationScript=()=>{let L=this.renderHydrationScriptTag();if(!L)return;return k(L)};subscribe=(L)=>{let f={hasChanged:(g,q)=>{if(typeof q>"u"||!L.select)return!0;return L.select(g)!==L.select(q)},notify:(g)=>{if(L.select){L.callback(L.select(g),f.unsubscribe);return}L.callback(g,f.unsubscribe)},unsubscribe:()=>{let g=this.subscriptions.indexOf(f);if(g!==-1)this.subscriptions.splice(g,1)}};return this.subscriptions.push(f),f.unsubscribe};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let L=this.findHydrationScriptElement();if(!L)return;this.value=this.mergeHydrationValue(C(L,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(L){if(this.hydrate===Object&&this.isObject(L)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...L};return L}isObject(L){return typeof L==="object"&&!Array.isArray(L)&&L!==null}findHydrationScriptElement(){return E(M(this.host),"context",this.hydrationKey)}notifySubscribers=(L,f)=>{for(let g of this.subscriptions)if(g.hasChanged(L,f))g.notify(L)};handleSubscriptionRequest=(L,{subscribe:f,onSubscribe:g})=>{this.tryHydrateFromHost();let q=f?this.subscribe(L):void 0;if(q)g?.(q);if(typeof this.value>"u")return;if(L.select)L.callback(L.select(this.value),q);else L.callback(this.value,q)};onSubscriptionRequest=(L)=>{let{context:f,callback:g,subscribe:q,select:j,target:G,onSubscribe:Q}=L;if(f!==this.context)return;if(L.markHandled(),L.stopPropagation(),G instanceof EventTarget)G.dispatchEvent(new Z(this.context));if(j){this.handleSubscriptionRequest({select:j,callback:g},{subscribe:q,onSubscribe:Q});return}this.handleSubscriptionRequest({callback:g},{subscribe:q,onSubscribe:Q})};onContextRequest=(L)=>{let{context:f,callback:g}=L;if(f!==this.context)return;L.markHandled(),L.stopPropagation(),g(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}export{A as ContextProvider};
2
-
3
- //# debugId=2A08FAF70F1F982464756E2164756E21
@@ -1,3 +0,0 @@
1
- var k=((d)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(d,{get:(i,j)=>(typeof require<"u"?require:i)[j]}):d)(function(d){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+d+'" is not supported')});var f=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function h(){return globalThis}function q(d){h()[f]=d}function u(d){return h()[f]?.(d)}export{u as resolveAmbientSsrContextProvider,q as installSsrContextProviderResolver};
2
-
3
- //# debugId=5CE1717DD46001F364756E2164756E21
@@ -1,3 +0,0 @@
1
- var p=((d)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(d,{get:(g,m)=>(typeof require<"u"?require:g)[m]}):d)(function(d){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+d+'" is not supported')});var z=(d)=>d;export{z as createContext};
2
-
3
- //# debugId=AEDF0A920662BE3464756E2164756E21
@@ -1,3 +0,0 @@
1
- var z=((d)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(d,{get:(M,u)=>(typeof require<"u"?require:M)[u]}):d)(function(d){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+d+'" is not supported')});var X=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),Z=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),_=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function m(d,M){U(d,X,M)}function K(d,M){U(d,Z,M)}function C(d){P(d,X)}function r(d){let M=d;P(d,Z,M[_]??=new Set)}function U(d,M,u){let F=d,f=Object.prototype.hasOwnProperty.call(F,M)?F[M]:void 0;if(Array.isArray(f)){f.push(u);return}Object.defineProperty(F,M,{value:[u]})}function P(d,M,u,F=Object.getPrototypeOf(d)){if(!F||F===Object.prototype)return;P(d,M,u,Object.getPrototypeOf(F));let f=F[M];if(!Array.isArray(f))return;for(let H of f){if(u?.has(H))continue;H(d),u?.add(H)}}var g=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),Y=Symbol.for("@ecopages/radiant.ssr-preparation-running");function G(d,M){let F=d[g];if(Array.isArray(F)){F.push(M);return}Object.defineProperty(d,g,{value:[M],configurable:!0})}function x(d){let M=d,u=M[g];if(!Array.isArray(u))return;M[Y]=!0;try{for(let F of u)F()}finally{delete M[Y]}}function S(d){return typeof d==="function"}function T(d,M,u,F){if(typeof F==="object")return d(void 0,F);return M(u,F)}function v(d,M,u,F,f){if(typeof F==="object"){if(!S(u))throw TypeError("Standard method decorators require a method target");return d(u,F)}if(!f)throw TypeError("Legacy method decorators require a property descriptor");return M(u,F,f)}var R=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function h(){return globalThis}function l(d){h()[R]=d}function B(d){return h()[R]?.(d)}var b;((f)=>{f.SUBSCRIPTION_REQUEST="context-subscription-request";f.CONTEXT_REQUEST="context-request";f.ON_MOUNT="context-on-mount";f.MOUNTED="context-mounted"})(b||={});class J extends Event{context;callback;subscribe;handled=!1;constructor(d,M,u){super("context-request",{bubbles:!0,composed:!0});this.context=d;this.callback=M;this.subscribe=u}markHandled(){this.handled=!0}}class A extends CustomEvent{constructor(d){super("context-on-mount",{detail:{context:d},bubbles:!0,composed:!0})}}class L extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(d,M,u,F,f){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=d;this.callback=M;this.select=u;this.subscribe=F;this.onSubscribe=f}markHandled(){this.handled=!0}}function Q(d,M,u,F={}){let f=B(M);if(!f)return!1;if(u(f),d.connectedContextCallback(M),F.emitMounted)d.dispatchEvent(new CustomEvent("context-mounted",{detail:f}));return!0}function q(d,M,u,F={}){let f=new J(M,(H)=>{if(u(H),d.connectedContextCallback(M),F.emitMounted)d.dispatchEvent(new CustomEvent("context-mounted",{detail:H}))});return d.dispatchEvent(f),f.handled}function j(d,M){let u=B(d);if(!u)return!1;let F=u.getContext();if(M.select)return M.callback(M.select(F)),!0;return M.callback(F),!0}function W(d,M,u,F){let f=new L(M,u.callback,u.select,F.subscribe,F.onSubscribe);return d.dispatchEvent(f),f.handled}function V(d,M,u,F={}){return O(d,()=>Q(d,M,u,F))}function Md(d,M,u,F){return O(d,()=>{if(F)return j(M,{callback:u,select:F});return j(M,{callback:u})})}function y(d,M,u,F={}){if(Q(d,M,u,F))return!0;return q(d,M,u,F)}function Fd(d,M,u,F={}){if(F.select){let H={callback:u,select:F.select};if(j(M,H))return!0;return W(d,M,H,{subscribe:F.subscribe,onSubscribe:F.onSubscribe})}let f={callback:u};if(j(M,f))return!0;return W(d,M,f,{subscribe:F.subscribe,onSubscribe:F.onSubscribe})}function O(d,M){return G(d,M),M()}function N(d){return(M,u)=>{let F=(H,w)=>{H[u]=w},f=(H,w={})=>{if(H[u])return!0;return y(H,d,(D)=>{F(H,D)},w)};K(M,(H)=>{if(V(H,d,(w)=>{F(H,w)}))return;H.registerConnectedCallback(()=>{if(f(H,{emitMounted:!0}))return;queueMicrotask(()=>{f(H,{emitMounted:!0})})})})}}function k(d){return(M,u)=>{let F=String(u.name),f=(w,D)=>{let $=w;$[F]=D},H=(w,D={})=>{if(w[F])return!0;return y(w,d,(E)=>{f(w,E)},D)};u.addInitializer(function(){if(V(this,d,(w)=>{f(this,w)},{emitMounted:!0}))return;this.registerConnectedCallback(()=>{if(H(this,{emitMounted:!0}))return;queueMicrotask(()=>{H(this,{emitMounted:!0})})})})}}function gd(d){function M(u,F){return T(k(d),N(d),u,F)}return M}export{gd as consumeContext};
2
-
3
- //# debugId=CCA9286D9B0079E464756E2164756E21
@@ -1,3 +0,0 @@
1
- var o=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(u,p)=>(typeof require<"u"?require:u)[p]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var U=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),f=Symbol.for("@ecopages/radiant.ssr-preparation-running");function y(e,u){let V=e[U];if(Array.isArray(V)){V.push(u);return}Object.defineProperty(e,U,{value:[u],configurable:!0})}function j(e){let u=e,p=u[U];if(!Array.isArray(p))return;u[f]=!0;try{for(let V of p)V()}finally{delete u[f]}}function t(e,u,p){let V=!1,d,q=e;return(r)=>{if(q[f]!==!0&&V&&Object.is(d,r))return;if(V=!0,d=r,u(r),p&&typeof q.requestUpdate==="function")q.requestUpdate()}}export{t as createContextSelectionDelivery};
2
-
3
- //# debugId=70EF1283181FE36E64756E2164756E21
@@ -1,3 +0,0 @@
1
- var x=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(f,J)=>(typeof require<"u"?require:f)[J]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});var k=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),z=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),b=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function l(j,f){I(j,k,f)}function B(j,f){I(j,z,f)}function a(j){P(j,k)}function c(j){let f=j;P(j,z,f[b]??=new Set)}function I(j,f,J){let H=j,Q=Object.prototype.hasOwnProperty.call(H,f)?H[f]:void 0;if(Array.isArray(Q)){Q.push(J);return}Object.defineProperty(H,f,{value:[J]})}function P(j,f,J,H=Object.getPrototypeOf(j)){if(!H||H===Object.prototype)return;P(j,f,J,Object.getPrototypeOf(H));let Q=H[f];if(!Array.isArray(Q))return;for(let W of Q){if(J?.has(W))continue;W(j),J?.add(W)}}var N=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),M=Symbol.for("@ecopages/radiant.ssr-preparation-running");function R(j,f){let H=j[N];if(Array.isArray(H)){H.push(f);return}Object.defineProperty(j,N,{value:[f],configurable:!0})}function s(j){let f=j,J=f[N];if(!Array.isArray(J))return;f[M]=!0;try{for(let H of J)H()}finally{delete f[M]}}var T=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function h(){return globalThis}function n(j){h()[T]=j}function q(j){return h()[T]?.(j)}var O;((Q)=>{Q.SUBSCRIPTION_REQUEST="context-subscription-request";Q.CONTEXT_REQUEST="context-request";Q.ON_MOUNT="context-on-mount";Q.MOUNTED="context-mounted"})(O||={});class L extends Event{context;callback;subscribe;handled=!1;constructor(j,f,J){super("context-request",{bubbles:!0,composed:!0});this.context=j;this.callback=f;this.subscribe=J}markHandled(){this.handled=!0}}class d extends CustomEvent{constructor(j){super("context-on-mount",{detail:{context:j},bubbles:!0,composed:!0})}}class _ extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(j,f,J,H,Q){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=j;this.callback=f;this.select=J;this.subscribe=H;this.onSubscribe=Q}markHandled(){this.handled=!0}}function A(j,f,J,H={}){let Q=q(f);if(!Q)return!1;if(J(Q),j.connectedContextCallback(f),H.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:Q}));return!0}function y(j,f,J,H={}){let Q=new L(f,(W)=>{if(J(W),j.connectedContextCallback(f),H.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:W}))});return j.dispatchEvent(Q),Q.handled}function D(j,f){let J=q(j);if(!J)return!1;let H=J.getContext();if(f.select)return f.callback(f.select(H)),!0;return f.callback(H),!0}function E(j,f,J,H){let Q=new _(f,J.callback,J.select,H.subscribe,H.onSubscribe);return j.dispatchEvent(Q),Q.handled}function Qj(j,f,J,H={}){return m(j,()=>A(j,f,J,H))}function V(j,f,J,H){return m(j,()=>{if(H)return D(f,{callback:J,select:H});return D(f,{callback:J})})}function Wj(j,f,J,H={}){if(A(j,f,J,H))return!0;return y(j,f,J,H)}function Y(j,f,J,H={}){if(H.select){let W={callback:J,select:H.select};if(D(f,W))return!0;return E(j,f,W,{subscribe:H.subscribe,onSubscribe:H.onSubscribe})}let Q={callback:J};if(D(f,Q))return!0;return E(j,f,Q,{subscribe:H.subscribe,onSubscribe:H.onSubscribe})}function m(j,f){return R(j,f),f()}function G(j,f,J){let H=!1,Q,W=j;return($)=>{if(W[M]!==!0&&H&&Object.is(Q,$))return;if(H=!0,Q=$,f($),J&&typeof W.requestUpdate==="function")W.requestUpdate()}}function v({context:j,select:f,subscribe:J=!0,requestUpdate:H=!0}){return(Q,W,$)=>{let K=$.value;return B(Q,(w)=>{let X,Z=G(w,(U)=>{K.call(w,U)},H);if(V(w,j,Z,f))return;let F=()=>Y(w,j,Z,{onSubscribe:(U)=>{X=U},select:f,subscribe:J});w.registerCleanupCallback(()=>{X?.(),X=void 0}),w.registerConnectedCallback(()=>{if(F())return;queueMicrotask(()=>{F()})})}),$}}function g({context:j,select:f,subscribe:J=!0,requestUpdate:H=!0}){return function(Q,W){W.addInitializer(function(){let $,K=G(this,(X)=>{Q.call(this,X)},H);if(V(this,j,K,f))return;let w=()=>{return Y(this,j,K,{onSubscribe:(X)=>{$=X},select:f,subscribe:J})};this.registerCleanupCallback(()=>{$?.(),$=void 0}),this.registerConnectedCallback(()=>{if(w())return;queueMicrotask(()=>{w()})})})}}function S(j){let{context:f,select:J,subscribe:H=!0}=j;return(Q,W)=>{B(Q,($)=>{let K,w=G($,(Z)=>{$[W]=Z},!0);if(V($,f,w,J))return;let X=()=>Y($,f,w,{onSubscribe:(Z)=>{K=Z},select:J,subscribe:H});$.registerCleanupCallback(()=>{K?.(),K=void 0}),$.registerConnectedCallback(()=>{if(X())return;queueMicrotask(()=>{X()})})})}}function u(j){let{context:f,select:J,subscribe:H=!0}=j;return function(Q,W){let $=String(W.name);return W.addInitializer(function(){let K,w=G(this,(Z)=>{let F=this;F[$]=Z},!0);if(V(this,f,w,J))return;let X=()=>{return Y(this,f,w,{onSubscribe:(Z)=>{K=Z},select:J,subscribe:H})};this.registerCleanupCallback(()=>{K?.(),K=void 0}),this.registerConnectedCallback(()=>{if(X())return;queueMicrotask(()=>{X()})})}),function(K){return K}}}function C(j,f,J,H,Q,W,$){if(typeof W==="object"){if(W.kind==="field"){if(Q!==void 0)throw TypeError("@contextSelector field decorators require an undefined target");return j(void 0,W)}if(typeof Q!=="function")throw TypeError("@contextSelector standard method decorators require a method target");return f(Q,W)}if($){if(typeof Q==="function"||Q===void 0)throw TypeError("@contextSelector legacy method decorators require a host target");return H(Q,W,$)}if(typeof Q==="function"||Q===void 0)throw TypeError("@contextSelector legacy field decorators require a host target");return J(Q,W)}function Rj(j){function f(J,H,Q){return C(u(j),g(j),S(j),v(j),J,H,Q)}return f}export{Rj as contextSelector};
2
-
3
- //# debugId=5BE170B29B62ACD264756E2164756E21
@@ -1,3 +0,0 @@
1
- var z=((j)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(j,{get:(J,W)=>(typeof require<"u"?require:J)[W]}):j)(function(j){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+j+'" is not supported')});var V=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),Y=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),k=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function g(j,J){B(j,V,J)}function G(j,J){B(j,Y,J)}function m(j){H(j,V)}function S(j){let J=j;H(j,Y,J[k]??=new Set)}function B(j,J,W){let Q=j,$=Object.prototype.hasOwnProperty.call(Q,J)?Q[J]:void 0;if(Array.isArray($)){$.push(W);return}Object.defineProperty(Q,J,{value:[W]})}function H(j,J,W,Q=Object.getPrototypeOf(j)){if(!Q||Q===Object.prototype)return;H(j,J,W,Object.getPrototypeOf(Q));let $=Q[J];if(!Array.isArray($))return;for(let w of $){if(W?.has(w))continue;w(j),W?.add(w)}}var M=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),L=Symbol.for("@ecopages/radiant.ssr-preparation-running");function N(j,J){let Q=j[M];if(Array.isArray(Q)){Q.push(J);return}Object.defineProperty(j,M,{value:[J],configurable:!0})}function h(j){let J=j,W=J[M];if(!Array.isArray(W))return;J[L]=!0;try{for(let Q of W)Q()}finally{delete J[L]}}var O=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function P(){return globalThis}function d(j){P()[O]=j}function X(j){return P()[O]?.(j)}var q;(($)=>{$.SUBSCRIPTION_REQUEST="context-subscription-request";$.CONTEXT_REQUEST="context-request";$.ON_MOUNT="context-on-mount";$.MOUNTED="context-mounted"})(q||={});class Z extends Event{context;callback;subscribe;handled=!1;constructor(j,J,W){super("context-request",{bubbles:!0,composed:!0});this.context=j;this.callback=J;this.subscribe=W}markHandled(){this.handled=!0}}class y extends CustomEvent{constructor(j){super("context-on-mount",{detail:{context:j},bubbles:!0,composed:!0})}}class f extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(j,J,W,Q,$){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=j;this.callback=J;this.select=W;this.subscribe=Q;this.onSubscribe=$}markHandled(){this.handled=!0}}function K(j,J,W,Q={}){let $=X(J);if(!$)return!1;if(W($),j.connectedContextCallback(J),Q.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:$}));return!0}function _(j,J,W,Q={}){let $=new Z(J,(w)=>{if(W(w),j.connectedContextCallback(J),Q.emitMounted)j.dispatchEvent(new CustomEvent("context-mounted",{detail:w}))});return j.dispatchEvent($),$.handled}function F(j,J){let W=X(j);if(!W)return!1;let Q=W.getContext();if(J.select)return J.callback(J.select(Q)),!0;return J.callback(Q),!0}function U(j,J,W,Q){let $=new f(J,W.callback,W.select,Q.subscribe,Q.onSubscribe);return j.dispatchEvent($),$.handled}function A(j,J,W,Q={}){return T(j,()=>K(j,J,W,Q))}function r(j,J,W,Q){return T(j,()=>{if(Q)return F(J,{callback:W,select:Q});return F(J,{callback:W})})}function E(j,J,W,Q={}){if(K(j,J,W,Q))return!0;return _(j,J,W,Q)}function s(j,J,W,Q={}){if(Q.select){let w={callback:W,select:Q.select};if(F(J,w))return!0;return U(j,J,w,{subscribe:Q.subscribe,onSubscribe:Q.onSubscribe})}let $={callback:W};if(F(J,$))return!0;return U(j,J,$,{subscribe:Q.subscribe,onSubscribe:Q.onSubscribe})}function T(j,J){return N(j,J),J()}function t(j){return(J,W)=>{let Q=(w,D)=>{w[W]=D},$=(w,D={})=>{if(w[W])return!0;return E(w,j,(b)=>{Q(w,b)},D)};G(J,(w)=>{if(A(w,j,(D)=>{Q(w,D)}))return;w.registerConnectedCallback(()=>{if($(w,{emitMounted:!0}))return;queueMicrotask(()=>{$(w,{emitMounted:!0})})})})}}export{t as consumeContext};
2
-
3
- //# debugId=8BC61AF639AB255864756E2164756E21
@@ -1,16 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/core/ssr-preparation.ts", "../src/context/context-ssr-bridge.ts", "../src/context/events.ts", "../src/context/context-consumer-runtime.ts", "../src/context/context-consumer-bootstrap.ts", "../src/context/decorators/legacy/consume-context.ts"],
4
- "sourcesContent": [
5
- "type LegacyInstanceInitializer<T extends object = object> = (instance: T) => 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: LegacyInstanceInitializer<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>(instance: T): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyInitializers(\n\t\tinstance,\n\t\tLEGACY_POST_CONSTRUCTION_INITIALIZERS,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<LegacyInstanceInitializer<T>>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(proto: T, key: symbol, initializer: LegacyInstanceInitializer<T>): 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>(\n\tinstance: T,\n\tkey: symbol,\n\texecutedInitializers?: Set<LegacyInstanceInitializer<T>>,\n\tprototype: object | null = Object.getPrototypeOf(instance),\n): void {\n\tif (!prototype || prototype === Object.prototype) {\n\t\treturn;\n\t}\n\n\trunLegacyInitializers(instance, key, executedInitializers, Object.getPrototypeOf(prototype));\n\n\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as LegacyInstanceInitializer<T>[] | undefined;\n\n\tif (!Array.isArray(initializers)) {\n\t\treturn;\n\t}\n\n\tfor (const initializer of initializers) {\n\t\tif (executedInitializers?.has(initializer)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tinitializer(instance);\n\t\texecutedInitializers?.add(initializer);\n\t}\n}\n",
6
- "type SsrPreparationCallback = () => void;\n\nconst SSR_PREPARATION_CALLBACKS = Symbol.for('@ecopages/radiant.ssr-preparation-callbacks');\nexport const SSR_PREPARATION_RUNNING = Symbol.for('@ecopages/radiant.ssr-preparation-running');\n\n/**\n * Registers instance-local SSR preparation work that should run immediately\n * before a Radiant host serializes its first server render.\n *\n * Decorators use this to defer SSR-only setup until after class fields,\n * reactive props, and authored host content have all been applied.\n */\nexport function registerSsrPreparationCallback(host: object, callback: SsrPreparationCallback): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst existingCallbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (Array.isArray(existingCallbacks)) {\n\t\texistingCallbacks.push(callback);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(host, SSR_PREPARATION_CALLBACKS, {\n\t\tvalue: [callback],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all registered SSR preparation callbacks for the provided host.\n *\n * The callbacks are intentionally retained so repeated SSR serializations stay\n * deterministic after later host mutations.\n */\nexport function runSsrPreparationCallbacks(host: object): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst callbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (!Array.isArray(callbacks)) {\n\t\treturn;\n\t}\n\n\ttarget[SSR_PREPARATION_RUNNING] = true;\n\n\ttry {\n\t\tfor (const callback of callbacks as SsrPreparationCallback[]) {\n\t\t\tcallback();\n\t\t}\n\t} finally {\n\t\tdelete target[SSR_PREPARATION_RUNNING];\n\t}\n}\n",
7
- "import type { SsrSerializableContextProvider } from './context-provider';\nimport type { UnknownContext } from './types';\n\ntype SsrContextProviderResolver = (context: UnknownContext) => SsrSerializableContextProvider | undefined;\n\nconst SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL = Symbol.for('@ecopages/radiant.ssr-context-provider-resolver');\n\ntype GlobalResolverScope = typeof globalThis & {\n\t[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?: SsrContextProviderResolver;\n};\n\nfunction getGlobalResolverScope(): GlobalResolverScope {\n\treturn globalThis as GlobalResolverScope;\n}\n\n/**\n * Installs the ambient SSR provider resolver used by shared context runtime helpers.\n *\n * Server-side rendering infrastructure owns the actual provider stack storage and\n * publishes a lookup function here so client/runtime code does not need to import\n * server-oriented modules.\n */\nexport function installSsrContextProviderResolver(resolver: SsrContextProviderResolver): void {\n\tgetGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL] = resolver;\n}\n\n/**\n * Resolves an ambient SSR provider when a server render has published one.\n */\nexport function resolveAmbientSsrContextProvider(context: UnknownContext): SsrSerializableContextProvider | undefined {\n\treturn getGlobalResolverScope()[SSR_CONTEXT_PROVIDER_RESOLVER_SYMBOL]?.(context);\n}\n",
8
- "import type { Context, ContextCallback, ContextType, UnknownContext } from './types';\n\n/**\n * List of events which can be emitted by a context provider or requester.\n */\nexport enum ContextEventsTypes {\n\tSUBSCRIPTION_REQUEST = 'context-subscription-request',\n\tCONTEXT_REQUEST = 'context-request',\n\tON_MOUNT = 'context-on-mount',\n\tMOUNTED = 'context-mounted',\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n */\nexport class ContextRequestEvent<T extends UnknownContext> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<ContextType<T>>,\n\t\tpublic readonly subscribe?: boolean,\n\t) {\n\t\tsuper(ContextEventsTypes.CONTEXT_REQUEST, { bubbles: true, composed: true });\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\n/**\n * A type which represents a subscription to a context value.\n */\ntype DirectContextSubscription<T extends UnknownContext> = {\n\tselect?: undefined;\n\tcallback: ContextCallback<ContextType<T>>;\n};\n\ntype SelectedContextSubscription<T extends UnknownContext, Selected> = {\n\tselect: (context: ContextType<T>) => Selected;\n\tcallback: ContextCallback<Selected>;\n};\n\nexport type ContextSubscription<T extends UnknownContext, Selected = ContextType<T>> =\n\t| DirectContextSubscription<T>\n\t| SelectedContextSubscription<T, Selected>;\n\n/**\n * An event fired by a context provider to signal that a context value has been mounted and is available for consumption.\n */\nexport class ContextOnMountEvent extends CustomEvent<{ context: UnknownContext }> {\n\tpublic constructor(context: UnknownContext) {\n\t\tsuper(ContextEventsTypes.ON_MOUNT, {\n\t\t\tdetail: { context },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n *\n * It accepts a `selector` property which can be used to request a specific property of the context value.\n */\nexport class ContextSubscriptionRequestEvent<T extends UnknownContext, Selected = ContextType<T>> extends Event {\n\tpublic handled = false;\n\n\tpublic constructor(\n\t\tpublic readonly context: T,\n\t\tpublic readonly callback: ContextCallback<Selected>,\n\t\tpublic readonly select?: (context: ContextType<T>) => Selected,\n\t\tpublic readonly subscribe?: boolean,\n\t\tpublic readonly onSubscribe?: (unsubscribe: () => void) => void,\n\t) {\n\t\tsuper(ContextEventsTypes.SUBSCRIPTION_REQUEST, {\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t});\n\t}\n\n\tpublic markHandled(): void {\n\t\tthis.handled = true;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\t/**\n\t\t * A 'context-request-subscription' event can be emitted by any element which desires\n\t\t * a context value to be injected by an external provider.\n\t\t */\n\t\t[ContextEventsTypes.SUBSCRIPTION_REQUEST]: ContextSubscriptionRequestEvent<UnknownContext>;\n\t\t/**\n\t\t * A context-request-provider event can be emitted by a context requester to signal\n\t\t * that it desires a context value to be provided by a context provider.\n\t\t */\n\t\t[ContextEventsTypes.CONTEXT_REQUEST]: ContextRequestEvent<Context<unknown, unknown>>;\n\t\t/**\n\t\t * A 'context-mount' event can be emitted by a context provider to signal\n\t\t * that a context value has been mounted and is available for consumption.\n\t\t */\n\t\t[ContextEventsTypes.ON_MOUNT]: ContextOnMountEvent;\n\t}\n}\n",
9
- "import type { ContextHostLike } from './context-host';\nimport { resolveAmbientSsrContextProvider } from './context-ssr-bridge';\nimport { ContextEventsTypes, ContextRequestEvent, ContextSubscriptionRequestEvent } from './events';\nimport type { ContextCallback, ContextType, UnknownContext } from './types';\n\ntype ConsumedContextAssignment = (provider: unknown) => void;\n\ntype DirectContextSelectionRequest<TContext extends UnknownContext> = {\n\tcallback: (value: ContextType<TContext>) => void;\n\tselect?: undefined;\n};\n\ntype SelectedContextSelectionRequest<TContext extends UnknownContext, Selected> = {\n\tcallback: (value: Selected) => void;\n\tselect: (context: ContextType<TContext>) => Selected;\n};\n\ntype ContextSelectionRequest<TContext extends UnknownContext, Selected = ContextType<TContext>> =\n\t| DirectContextSelectionRequest<TContext>\n\t| SelectedContextSelectionRequest<TContext, Selected>;\n\n/**\n * Resolves a consumed context from the active SSR provider stack when one is available.\n *\n * This keeps SSR-specific lookup outside decorator implementations while preserving\n * the same consumer initialization contract for both standard and legacy decorators.\n *\n * @returns `true` when the context was resolved synchronously from SSR state.\n */\nexport function initializeConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tassign(provider);\n\thost.connectedContextCallback(context);\n\n\tif (options.emitMounted) {\n\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t}\n\n\treturn true;\n}\n\n/**\n * Requests a context provider through the DOM event channel when SSR state is not active.\n */\nexport function requestConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tconst event = new ContextRequestEvent(context, (provider) => {\n\t\tassign(provider);\n\t\thost.connectedContextCallback(context);\n\n\t\tif (options.emitMounted) {\n\t\t\thost.dispatchEvent(new CustomEvent(ContextEventsTypes.MOUNTED, { detail: provider }));\n\t\t}\n\t});\n\n\thost.dispatchEvent(event);\n\treturn event.handled;\n}\n\n/**\n * Resolves a selected context value from the active SSR provider stack when available.\n *\n * @returns `true` when the selection callback was satisfied synchronously from SSR state.\n */\nexport function initializeContextSelection<TContext extends UnknownContext>(\n\tcontext: TContext,\n\trequest: DirectContextSelectionRequest<TContext>,\n): boolean;\nexport function initializeContextSelection<TContext extends UnknownContext, Selected>(\n\tcontext: TContext,\n\trequest: SelectedContextSelectionRequest<TContext, Selected>,\n): boolean;\nexport function initializeContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\tcontext: TContext,\n\trequest: ContextSelectionRequest<TContext, Selected>,\n): boolean {\n\tconst provider = resolveAmbientSsrContextProvider(context);\n\n\tif (!provider) {\n\t\treturn false;\n\t}\n\n\tconst resolvedContext = provider.getContext() as ContextType<TContext>;\n\n\tif (request.select) {\n\t\trequest.callback(request.select(resolvedContext));\n\t\treturn true;\n\t}\n\n\trequest.callback(resolvedContext);\n\treturn true;\n}\n\n/**\n * Requests a selected context value through the DOM event channel.\n */\nexport function requestContextSelection<TContext extends UnknownContext>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: DirectContextSelectionRequest<TContext>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean;\nexport function requestContextSelection<TContext extends UnknownContext, Selected>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: SelectedContextSelectionRequest<TContext, Selected>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean;\nexport function requestContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\trequest: ContextSelectionRequest<TContext, Selected>,\n\toptions: {\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t},\n): boolean {\n\tconst event = new ContextSubscriptionRequestEvent(\n\t\tcontext,\n\t\trequest.callback as ContextCallback<Selected>,\n\t\trequest.select,\n\t\toptions.subscribe,\n\t\toptions.onSubscribe,\n\t);\n\n\thost.dispatchEvent(event);\n\treturn event.handled;\n}\n",
10
- "import type { ContextHostLike } from './context-host';\nimport { registerSsrPreparationCallback } from '../core/ssr-preparation';\nimport {\n\tinitializeConsumedContext,\n\tinitializeContextSelection,\n\trequestConsumedContext,\n\trequestContextSelection,\n} from './context-consumer-runtime';\nimport type { ContextType, UnknownContext } from './types';\n\ntype ConsumedContextAssignment = (provider: unknown) => void;\n\n/**\n * Resolves a consumed context immediately and registers the same resolution to\n * run again during the later SSR preparation phase.\n *\n * This keeps constructor-time state and pre-serialization state aligned after\n * instance fields, props, or authored host content change during SSR setup.\n */\nexport function bootstrapSsrConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\treturn registerAndResolveConsumerBootstrap(host, () => initializeConsumedContext(host, context, assign, options));\n}\n\n/**\n * Resolves a selected context value immediately and registers the same\n * selection for the later SSR preparation phase.\n *\n * This lets nested SSR renders recompute selector-backed state after the host\n * has finished construction and any server-side configuration hooks have run.\n */\nexport function bootstrapSsrContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\thost: object,\n\tcontext: TContext,\n\tcallback: (value: Selected) => void,\n\tselect?: (context: ContextType<TContext>) => Selected,\n): boolean {\n\treturn registerAndResolveConsumerBootstrap(host, () => {\n\t\tif (select) {\n\t\t\treturn initializeContextSelection(context, { callback, select });\n\t\t}\n\n\t\treturn initializeContextSelection(context, {\n\t\t\tcallback: callback as (value: ContextType<TContext>) => void,\n\t\t});\n\t});\n}\n\n/**\n * Resolves a consumed context from SSR when available, otherwise requests it\n * through the DOM event channel for the current client-side lifecycle pass.\n *\n * @returns `true` when the value was satisfied synchronously from SSR state.\n */\nexport function connectConsumedContext(\n\thost: ContextHostLike,\n\tcontext: UnknownContext,\n\tassign: ConsumedContextAssignment,\n\toptions: { emitMounted?: boolean } = {},\n): boolean {\n\tif (initializeConsumedContext(host, context, assign, options)) {\n\t\treturn true;\n\t}\n\n\treturn requestConsumedContext(host, context, assign, options);\n}\n\n/**\n * Resolves a selected context value from SSR when available, otherwise requests\n * it through the DOM event channel for the current client-side lifecycle pass.\n *\n * @returns `true` when the value was satisfied synchronously from SSR state.\n */\nexport function connectContextSelection<TContext extends UnknownContext, Selected = ContextType<TContext>>(\n\thost: ContextHostLike,\n\tcontext: TContext,\n\tcallback: (value: Selected) => void,\n\toptions: {\n\t\tselect?: (context: ContextType<TContext>) => Selected;\n\t\tsubscribe?: boolean;\n\t\tonSubscribe?: (unsubscribe: () => void) => void;\n\t} = {},\n): boolean {\n\tif (options.select) {\n\t\tconst request = { callback, select: options.select };\n\n\t\tif (initializeContextSelection(context, request)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn requestContextSelection(host, context, request, {\n\t\t\tsubscribe: options.subscribe,\n\t\t\tonSubscribe: options.onSubscribe,\n\t\t});\n\t}\n\n\tconst request = {\n\t\tcallback: callback as (value: ContextType<TContext>) => void,\n\t};\n\n\tif (initializeContextSelection(context, request)) {\n\t\treturn true;\n\t}\n\n\treturn requestContextSelection(host, context, request, {\n\t\tsubscribe: options.subscribe,\n\t\tonSubscribe: options.onSubscribe,\n\t});\n}\n\nfunction registerAndResolveConsumerBootstrap<TResult>(host: object, resolve: () => TResult): TResult {\n\tregisterSsrPreparationCallback(host, resolve);\n\treturn resolve();\n}\n",
11
- "import type { ContextHostLike } from '../../context-host';\nimport { registerLegacyPostConstructionInitializer } from '../../../decorators/legacy/instance-initializers';\nimport { bootstrapSsrConsumedContext, connectConsumedContext } from '../../context-consumer-bootstrap';\nimport type { UnknownContext } from '../../types';\n\nexport function consumeContext(context: UnknownContext) {\n\treturn (proto: ContextHostLike, propertyKey: string) => {\n\t\tconst assignContextProvider = (element: ContextHostLike, provider: unknown) => {\n\t\t\t(element as any)[propertyKey] = provider;\n\t\t};\n\t\tconst initializeConsumedContextForHost = (\n\t\t\telement: ContextHostLike,\n\t\t\toptions: { emitMounted?: boolean } = {},\n\t\t) => {\n\t\t\tif ((element as any)[propertyKey]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn connectConsumedContext(\n\t\t\t\telement,\n\t\t\t\tcontext,\n\t\t\t\t(provider) => {\n\t\t\t\t\tassignContextProvider(element, provider);\n\t\t\t\t},\n\t\t\t\toptions,\n\t\t\t);\n\t\t};\n\n\t\tregisterLegacyPostConstructionInitializer(proto, (element) => {\n\t\t\tif (\n\t\t\t\tbootstrapSsrConsumedContext(element, context, (provider) => {\n\t\t\t\t\tassignContextProvider(element, provider);\n\t\t\t\t})\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tif (initializeConsumedContextForHost(element, { emitMounted: true })) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tinitializeConsumedContextForHost(element, { emitMounted: true });\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n"
12
- ],
13
- "mappings": "2PAEA,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,CAAC,EAAmB,CAC1F,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GACjE,EAGD,SAAS,CAAqC,CAAC,EAAU,EAAa,EAAiD,CACtH,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,CAC/C,EACA,EACA,EACA,EAA2B,OAAO,eAAe,CAAQ,EAClD,CACP,GAAI,CAAC,GAAa,IAAc,OAAO,UACtC,OAGD,EAAsB,EAAU,EAAK,EAAsB,OAAO,eAAe,CAAS,CAAC,EAE3F,IAAM,EAAgB,EAA2C,GAEjE,GAAI,CAAC,MAAM,QAAQ,CAAY,EAC9B,OAGD,QAAW,KAAe,EAAc,CACvC,GAAI,GAAsB,IAAI,CAAW,EACxC,SAGD,EAAY,CAAQ,EACpB,GAAsB,IAAI,CAAW,GClGvC,IAAM,EAA4B,OAAO,IAAI,6CAA6C,EAC7E,EAA0B,OAAO,IAAI,2CAA2C,EAStF,SAAS,CAA8B,CAAC,EAAc,EAAwC,CAEpG,IAAM,EADS,EACkB,GAEjC,GAAI,MAAM,QAAQ,CAAiB,EAAG,CACrC,EAAkB,KAAK,CAAQ,EAC/B,OAGD,OAAO,eAAe,EAAM,EAA2B,CACtD,MAAO,CAAC,CAAQ,EAChB,aAAc,EACf,CAAC,EASK,SAAS,CAA0B,CAAC,EAAoB,CAC9D,IAAM,EAAS,EACT,EAAY,EAAO,GAEzB,GAAI,CAAC,MAAM,QAAQ,CAAS,EAC3B,OAGD,EAAO,GAA2B,GAElC,GAAI,CACH,QAAW,KAAY,EACtB,EAAS,SAET,CACD,OAAO,EAAO,IC3ChB,IAAM,EAAuC,OAAO,IAAI,iDAAiD,EAMzG,SAAS,CAAsB,EAAwB,CACtD,OAAO,WAUD,SAAS,CAAiC,CAAC,EAA4C,CAC7F,EAAuB,EAAE,GAAwC,EAM3D,SAAS,CAAgC,CAAC,EAAqE,CACrH,OAAO,EAAuB,EAAE,KAAwC,CAAO,ECzBzE,IAAK,GAAL,CAAK,IAAL,CACN,uBAAuB,+BACvB,kBAAkB,kBAClB,WAAW,mBACX,UAAU,oBAJC,QAiBL,MAAM,UAAsD,KAAM,CAIvD,QACA,SACA,UALV,QAAU,GAEV,WAAW,CACD,EACA,EACA,EACf,CACD,MAAM,kBAAoC,CAAE,QAAS,GAAM,SAAU,EAAK,CAAC,EAJ3D,eACA,gBACA,iBAKV,WAAW,EAAS,CAC1B,KAAK,QAAU,GAEjB,CAsBO,MAAM,UAA4B,WAAyC,CAC1E,WAAW,CAAC,EAAyB,CAC3C,MAAM,mBAA6B,CAClC,OAAQ,CAAE,SAAQ,EAClB,QAAS,GACT,SAAU,EACX,CAAC,EAEH,CAcO,MAAM,UAA6F,KAAM,CAI9F,QACA,SACA,OACA,UACA,YAPV,QAAU,GAEV,WAAW,CACD,EACA,EACA,EACA,EACA,EACf,CACD,MAAM,+BAAyC,CAC9C,QAAS,GACT,SAAU,EACX,CAAC,EATe,eACA,gBACA,cACA,iBACA,mBAQV,WAAW,EAAS,CAC1B,KAAK,QAAU,GAEjB,CCtEO,SAAS,CAAyB,CACxC,EACA,EACA,EACA,EAAqC,CAAC,EAC5B,CACV,IAAM,EAAW,EAAiC,CAAO,EAEzD,GAAI,CAAC,EACJ,MAAO,GAMR,GAHA,EAAO,CAAQ,EACf,EAAK,yBAAyB,CAAO,EAEjC,EAAQ,YACX,EAAK,cAAc,IAAI,8BAAwC,CAAE,OAAQ,CAAS,CAAC,CAAC,EAGrF,MAAO,GAMD,SAAS,CAAsB,CACrC,EACA,EACA,EACA,EAAqC,CAAC,EAC5B,CACV,IAAM,EAAQ,IAAI,EAAoB,EAAS,CAAC,IAAa,CAI5D,GAHA,EAAO,CAAQ,EACf,EAAK,yBAAyB,CAAO,EAEjC,EAAQ,YACX,EAAK,cAAc,IAAI,8BAAwC,CAAE,OAAQ,CAAS,CAAC,CAAC,EAErF,EAGD,OADA,EAAK,cAAc,CAAK,EACjB,EAAM,QAgBP,SAAS,CAA6F,CAC5G,EACA,EACU,CACV,IAAM,EAAW,EAAiC,CAAO,EAEzD,GAAI,CAAC,EACJ,MAAO,GAGR,IAAM,EAAkB,EAAS,WAAW,EAE5C,GAAI,EAAQ,OAEX,OADA,EAAQ,SAAS,EAAQ,OAAO,CAAe,CAAC,EACzC,GAIR,OADA,EAAQ,SAAS,CAAe,EACzB,GAwBD,SAAS,CAA0F,CACzG,EACA,EACA,EACA,EAIU,CACV,IAAM,EAAQ,IAAI,EACjB,EACA,EAAQ,SACR,EAAQ,OACR,EAAQ,UACR,EAAQ,WACT,EAGA,OADA,EAAK,cAAc,CAAK,EACjB,EAAM,QC/HP,SAAS,CAA2B,CAC1C,EACA,EACA,EACA,EAAqC,CAAC,EAC5B,CACV,OAAO,EAAoC,EAAM,IAAM,EAA0B,EAAM,EAAS,EAAQ,CAAO,CAAC,EAU1G,SAAS,CAA+F,CAC9G,EACA,EACA,EACA,EACU,CACV,OAAO,EAAoC,EAAM,IAAM,CACtD,GAAI,EACH,OAAO,EAA2B,EAAS,CAAE,WAAU,QAAO,CAAC,EAGhE,OAAO,EAA2B,EAAS,CAC1C,SAAU,CACX,CAAC,EACD,EASK,SAAS,CAAsB,CACrC,EACA,EACA,EACA,EAAqC,CAAC,EAC5B,CACV,GAAI,EAA0B,EAAM,EAAS,EAAQ,CAAO,EAC3D,MAAO,GAGR,OAAO,EAAuB,EAAM,EAAS,EAAQ,CAAO,EAStD,SAAS,CAA0F,CACzG,EACA,EACA,EACA,EAII,CAAC,EACK,CACV,GAAI,EAAQ,OAAQ,CACnB,IAAM,EAAU,CAAE,WAAU,OAAQ,EAAQ,MAAO,EAEnD,GAAI,EAA2B,EAAS,CAAO,EAC9C,MAAO,GAGR,OAAO,EAAwB,EAAM,EAAS,EAAS,CACtD,UAAW,EAAQ,UACnB,YAAa,EAAQ,WACtB,CAAC,EAGF,IAAM,EAAU,CACf,SAAU,CACX,EAEA,GAAI,EAA2B,EAAS,CAAO,EAC9C,MAAO,GAGR,OAAO,EAAwB,EAAM,EAAS,EAAS,CACtD,UAAW,EAAQ,UACnB,YAAa,EAAQ,WACtB,CAAC,EAGF,SAAS,CAA4C,CAAC,EAAc,EAAiC,CAEpG,OADA,EAA+B,EAAM,CAAO,EACrC,EAAQ,EC/GT,SAAS,CAAc,CAAC,EAAyB,CACvD,MAAO,CAAC,EAAwB,IAAwB,CACvD,IAAM,EAAwB,CAAC,EAA0B,IAAsB,CAC7E,EAAgB,GAAe,GAE3B,EAAmC,CACxC,EACA,EAAqC,CAAC,IAClC,CACJ,GAAK,EAAgB,GACpB,MAAO,GAGR,OAAO,EACN,EACA,EACA,CAAC,IAAa,CACb,EAAsB,EAAS,CAAQ,GAExC,CACD,GAGD,EAA0C,EAAO,CAAC,IAAY,CAC7D,GACC,EAA4B,EAAS,EAAS,CAAC,IAAa,CAC3D,EAAsB,EAAS,CAAQ,EACvC,EAED,OAGD,EAAQ,0BAA0B,IAAM,CACvC,GAAI,EAAiC,EAAS,CAAE,YAAa,EAAK,CAAC,EAClE,OAGD,eAAe,IAAM,CACpB,EAAiC,EAAS,CAAE,YAAa,EAAK,CAAC,EAC/D,EACD,EACD",
14
- "debugId": "8BC61AF639AB255864756E2164756E21",
15
- "names": []
16
- }
@@ -1,3 +0,0 @@
1
- var g=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(j,H)=>(typeof require<"u"?require:j)[H]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});var P=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),N=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),y=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function b(f,j){L(f,P,j)}function O(f,j){L(f,N,j)}function h(f){U(f,P)}function C(f){let j=f;U(f,N,j[y]??=new Set)}function L(f,j,H){let F=f,J=Object.prototype.hasOwnProperty.call(F,j)?F[j]:void 0;if(Array.isArray(J)){J.push(H);return}Object.defineProperty(F,j,{value:[H]})}function U(f,j,H,F=Object.getPrototypeOf(f)){if(!F||F===Object.prototype)return;U(f,j,H,Object.getPrototypeOf(F));let J=F[j];if(!Array.isArray(J))return;for(let Q of J){if(H?.has(Q))continue;Q(f),H?.add(Q)}}var K=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),$=Symbol.for("@ecopages/radiant.ssr-preparation-running");function _(f,j){let F=f[K];if(Array.isArray(F)){F.push(j);return}Object.defineProperty(f,K,{value:[j],configurable:!0})}function v(f){let j=f,H=j[K];if(!Array.isArray(H))return;j[$]=!0;try{for(let F of H)F()}finally{delete j[$]}}var A=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function E(){return globalThis}function p(f){E()[A]=f}function M(f){return E()[A]?.(f)}var T;((J)=>{J.SUBSCRIPTION_REQUEST="context-subscription-request";J.CONTEXT_REQUEST="context-request";J.ON_MOUNT="context-on-mount";J.MOUNTED="context-mounted"})(T||={});class X extends Event{context;callback;subscribe;handled=!1;constructor(f,j,H){super("context-request",{bubbles:!0,composed:!0});this.context=f;this.callback=j;this.subscribe=H}markHandled(){this.handled=!0}}class R extends CustomEvent{constructor(f){super("context-on-mount",{detail:{context:f},bubbles:!0,composed:!0})}}class Z extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(f,j,H,F,J){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=f;this.callback=j;this.select=H;this.subscribe=F;this.onSubscribe=J}markHandled(){this.handled=!0}}function Y(f,j,H,F={}){let J=M(j);if(!J)return!1;if(H(J),f.connectedContextCallback(j),F.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:J}));return!0}function d(f,j,H,F={}){let J=new X(j,(Q)=>{if(H(Q),f.connectedContextCallback(j),F.emitMounted)f.dispatchEvent(new CustomEvent("context-mounted",{detail:Q}))});return f.dispatchEvent(J),J.handled}function W(f,j){let H=M(f);if(!H)return!1;let F=H.getContext();if(j.select)return j.callback(j.select(F)),!0;return j.callback(F),!0}function G(f,j,H,F){let J=new Z(j,H.callback,H.select,F.subscribe,F.onSubscribe);return f.dispatchEvent(J),J.handled}function o(f,j,H,F={}){return z(f,()=>Y(f,j,H,F))}function m(f,j,H,F){return z(f,()=>{if(F)return W(j,{callback:H,select:F});return W(j,{callback:H})})}function e(f,j,H,F={}){if(Y(f,j,H,F))return!0;return d(f,j,H,F)}function k(f,j,H,F={}){if(F.select){let Q={callback:H,select:F.select};if(W(j,Q))return!0;return G(f,j,Q,{subscribe:F.subscribe,onSubscribe:F.onSubscribe})}let J={callback:H};if(W(j,J))return!0;return G(f,j,J,{subscribe:F.subscribe,onSubscribe:F.onSubscribe})}function z(f,j){return _(f,j),j()}function I(f,j,H){let F=!1,J,Q=f;return(V)=>{if(Q[$]!==!0&&F&&Object.is(J,V))return;if(F=!0,J=V,j(V),H&&typeof Q.requestUpdate==="function")Q.requestUpdate()}}function Qf(f){let{context:j,select:H,subscribe:F=!0}=f;return(J,Q)=>{O(J,(V)=>{let w,B=I(V,(D)=>{V[Q]=D},!0);if(m(V,j,B,H))return;let q=()=>k(V,j,B,{onSubscribe:(D)=>{w=D},select:H,subscribe:F});V.registerCleanupCallback(()=>{w?.(),w=void 0}),V.registerConnectedCallback(()=>{if(q())return;queueMicrotask(()=>{q()})})})}}export{Qf as contextSelectorField};
2
-
3
- //# debugId=658105B4EBD0610F64756E2164756E21