@ecopages/radiant 0.3.0-alpha.0 → 0.3.0-alpha.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.
- package/README.md +5 -1
- package/dist/{chunk-scfk041e.js → chunk-0bswvy25.js} +3 -3
- package/dist/{chunk-scfk041e.js.map → chunk-0bswvy25.js.map} +1 -1
- package/dist/chunk-0btkzzyc.js +4 -0
- package/dist/{chunk-r75y7ydb.js.map → chunk-0btkzzyc.js.map} +1 -1
- package/dist/chunk-0g0j9re6.js +4 -0
- package/dist/{chunk-0zq7e1ne.js.map → chunk-0g0j9re6.js.map} +1 -1
- package/dist/chunk-1x26p09c.js +4 -0
- package/dist/{chunk-d4v5qpxa.js.map → chunk-1x26p09c.js.map} +1 -1
- package/dist/{chunk-jg20mzg8.js → chunk-21a7jask.js} +3 -3
- package/dist/{chunk-jg20mzg8.js.map → chunk-21a7jask.js.map} +1 -1
- package/dist/chunk-25zjh0kg.js +4 -0
- package/dist/{chunk-60q4y3k5.js.map → chunk-25zjh0kg.js.map} +1 -1
- package/dist/chunk-30x4hggg.js +4 -0
- package/dist/{chunk-zb7wh7w4.js.map → chunk-30x4hggg.js.map} +1 -1
- package/dist/chunk-3ryr5wx2.js +4 -0
- package/dist/{chunk-9554n9t4.js.map → chunk-3ryr5wx2.js.map} +2 -2
- package/dist/chunk-3xxvmd5c.js +4 -0
- package/dist/chunk-3xxvmd5c.js.map +10 -0
- package/dist/chunk-3ynk7e1e.js +4 -0
- package/dist/{chunk-d7hh3ze6.js.map → chunk-3ynk7e1e.js.map} +1 -1
- package/dist/chunk-4e559cy5.js +4 -0
- package/dist/chunk-4e559cy5.js.map +10 -0
- package/dist/chunk-5b1en9vz.js +4 -0
- package/dist/chunk-5b1en9vz.js.map +10 -0
- package/dist/chunk-5bkat72n.js +4 -0
- package/dist/{chunk-5td6v9k3.js.map → chunk-5bkat72n.js.map} +2 -2
- package/dist/{chunk-4srpf0y5.js → chunk-5qeaq3tj.js} +3 -3
- package/dist/{chunk-4srpf0y5.js.map → chunk-5qeaq3tj.js.map} +1 -1
- package/dist/{chunk-73x7jpdd.js → chunk-66e6s792.js} +2 -2
- package/dist/{chunk-73x7jpdd.js.map → chunk-66e6s792.js.map} +1 -1
- package/dist/{chunk-paehjz94.js → chunk-79jg8q67.js} +2 -2
- package/dist/{chunk-paehjz94.js.map → chunk-79jg8q67.js.map} +1 -1
- package/dist/{chunk-8vak8w5w.js → chunk-8d5ddvvf.js} +3 -3
- package/dist/{chunk-8vak8w5w.js.map → chunk-8d5ddvvf.js.map} +1 -1
- package/dist/{chunk-tyysm4gk.js → chunk-8e9fgtbn.js} +3 -3
- package/dist/{chunk-tyysm4gk.js.map → chunk-8e9fgtbn.js.map} +1 -1
- package/dist/{chunk-8dexhy6c.js → chunk-9mqtp3js.js} +2 -2
- package/dist/{chunk-8dexhy6c.js.map → chunk-9mqtp3js.js.map} +1 -1
- package/dist/chunk-9rj2rwes.js +4 -0
- package/dist/{chunk-3b033cgq.js.map → chunk-9rj2rwes.js.map} +1 -1
- package/dist/{chunk-x0522ksh.js → chunk-atms6yrh.js} +3 -3
- package/dist/{chunk-x0522ksh.js.map → chunk-atms6yrh.js.map} +1 -1
- package/dist/{chunk-qdj6r8jn.js → chunk-bk2nbmcd.js} +2 -2
- package/dist/{chunk-qdj6r8jn.js.map → chunk-bk2nbmcd.js.map} +1 -1
- package/dist/{chunk-qd28hvdx.js → chunk-bk6qkvfp.js} +2 -2
- package/dist/{chunk-qd28hvdx.js.map → chunk-bk6qkvfp.js.map} +1 -1
- package/dist/chunk-c0qyz98c.js +4 -0
- package/dist/chunk-c0qyz98c.js.map +10 -0
- package/dist/chunk-c52qhh0j.js +4 -0
- package/dist/{chunk-60015zxq.js.map → chunk-c52qhh0j.js.map} +1 -1
- package/dist/{chunk-8tvt04cm.js → chunk-cnyxrh9r.js} +2 -2
- package/dist/{chunk-8tvt04cm.js.map → chunk-cnyxrh9r.js.map} +1 -1
- package/dist/chunk-dabagjk6.js +4 -0
- package/dist/chunk-dabagjk6.js.map +10 -0
- package/dist/chunk-e0r6ca2g.js +4 -0
- package/dist/chunk-e0r6ca2g.js.map +10 -0
- package/dist/chunk-eevw1j2q.js +4 -0
- package/dist/{chunk-0y78f8hj.js.map → chunk-eevw1j2q.js.map} +2 -2
- package/dist/{chunk-s4qgct1z.js → chunk-ek664x1c.js} +3 -3
- package/dist/{chunk-s4qgct1z.js.map → chunk-ek664x1c.js.map} +1 -1
- package/dist/{chunk-9gjmqxp2.js → chunk-eyw14d6y.js} +2 -2
- package/dist/{chunk-9gjmqxp2.js.map → chunk-eyw14d6y.js.map} +1 -1
- package/dist/{chunk-hkmm3dj9.js → chunk-fs4j94bk.js} +3 -3
- package/dist/{chunk-hkmm3dj9.js.map → chunk-fs4j94bk.js.map} +1 -1
- package/dist/{chunk-chyn72n9.js → chunk-g2z3mm6b.js} +3 -3
- package/dist/{chunk-chyn72n9.js.map → chunk-g2z3mm6b.js.map} +1 -1
- package/dist/chunk-g5n3m11h.js +4 -0
- package/dist/chunk-g5n3m11h.js.map +10 -0
- package/dist/{chunk-84fc8cz9.js → chunk-gdkte2vd.js} +3 -3
- package/dist/{chunk-84fc8cz9.js.map → chunk-gdkte2vd.js.map} +1 -1
- package/dist/chunk-gg74gdpv.js +4 -0
- package/dist/chunk-gg74gdpv.js.map +10 -0
- package/dist/{chunk-hn4j8rt5.js → chunk-h9k7crjc.js} +3 -3
- package/dist/{chunk-hn4j8rt5.js.map → chunk-h9k7crjc.js.map} +1 -1
- package/dist/{chunk-ksv01cey.js → chunk-hpzgnxgq.js} +3 -3
- package/dist/{chunk-ksv01cey.js.map → chunk-hpzgnxgq.js.map} +1 -1
- package/dist/chunk-hrjc8b1y.js +4 -0
- package/dist/chunk-hrjc8b1y.js.map +10 -0
- package/dist/chunk-hvy4zvcc.js +4 -0
- package/dist/{chunk-t7a1bbxq.js.map → chunk-hvy4zvcc.js.map} +1 -1
- package/dist/{chunk-ms6a9zdt.js → chunk-hztr86b4.js} +2 -2
- package/dist/{chunk-ms6a9zdt.js.map → chunk-hztr86b4.js.map} +1 -1
- package/dist/chunk-j3v7rca5.js +4 -0
- package/dist/{chunk-4fqkmpra.js.map → chunk-j3v7rca5.js.map} +1 -1
- package/dist/chunk-j864sv4w.js +4 -0
- package/dist/{chunk-w50v38rv.js.map → chunk-j864sv4w.js.map} +1 -1
- package/dist/chunk-kakpjgzf.js +4 -0
- package/dist/{chunk-d98q3myg.js.map → chunk-kakpjgzf.js.map} +2 -2
- package/dist/{chunk-1w1dm68j.js → chunk-kmebacvv.js} +2 -2
- package/dist/{chunk-1w1dm68j.js.map → chunk-kmebacvv.js.map} +1 -1
- package/dist/chunk-knqsm6v3.js +4 -0
- package/dist/{chunk-5bym7y1d.js.map → chunk-knqsm6v3.js.map} +2 -2
- package/dist/chunk-mp2vtrkg.js +4 -0
- package/dist/{chunk-zj9ez73m.js.map → chunk-mp2vtrkg.js.map} +1 -1
- package/dist/chunk-mpsj3cjs.js +4 -0
- package/dist/{chunk-qe6sjr27.js.map → chunk-mpsj3cjs.js.map} +1 -1
- package/dist/{chunk-dscj0sk9.js → chunk-n4p2542b.js} +3 -3
- package/dist/{chunk-dscj0sk9.js.map → chunk-n4p2542b.js.map} +1 -1
- package/dist/{chunk-agjb2a3r.js → chunk-nctznxyz.js} +3 -3
- package/dist/{chunk-agjb2a3r.js.map → chunk-nctznxyz.js.map} +1 -1
- package/dist/chunk-ndw3hc3v.js +4 -0
- package/dist/{chunk-2tgrfv09.js.map → chunk-ndw3hc3v.js.map} +2 -2
- package/dist/{chunk-57w3vmme.js → chunk-nnnb6pac.js} +3 -3
- package/dist/{chunk-57w3vmme.js.map → chunk-nnnb6pac.js.map} +1 -1
- package/dist/{chunk-8n2dhx28.js → chunk-nssj2x13.js} +2 -2
- package/dist/{chunk-8n2dhx28.js.map → chunk-nssj2x13.js.map} +1 -1
- package/dist/chunk-nvr37vma.js +4 -0
- package/dist/{chunk-mqxmfvyp.js.map → chunk-nvr37vma.js.map} +1 -1
- package/dist/chunk-p8k4g99a.js +4 -0
- package/dist/{chunk-vpfm9yw8.js.map → chunk-p8k4g99a.js.map} +2 -2
- package/dist/chunk-pkszgjqf.js +4 -0
- package/dist/{chunk-c8vqg7r1.js.map → chunk-pkszgjqf.js.map} +1 -1
- package/dist/{chunk-nerd6fmg.js → chunk-q9z6tnzw.js} +2 -2
- package/dist/{chunk-nerd6fmg.js.map → chunk-q9z6tnzw.js.map} +1 -1
- package/dist/chunk-qdz5sncz.js +4 -0
- package/dist/{chunk-a7hzs37s.js.map → chunk-qdz5sncz.js.map} +1 -1
- package/dist/chunk-qe0eww1n.js +4 -0
- package/dist/{chunk-ak97hp4w.js.map → chunk-qe0eww1n.js.map} +2 -2
- package/dist/{chunk-d0n7njdy.js → chunk-r33zvvda.js} +3 -3
- package/dist/{chunk-d0n7njdy.js.map → chunk-r33zvvda.js.map} +1 -1
- package/dist/{chunk-xd1xn3vy.js → chunk-rkh1vkb9.js} +2 -2
- package/dist/{chunk-xd1xn3vy.js.map → chunk-rkh1vkb9.js.map} +1 -1
- package/dist/chunk-rrg759ht.js +4 -0
- package/dist/{chunk-42tyhfvh.js.map → chunk-rrg759ht.js.map} +1 -1
- package/dist/{chunk-par0t822.js → chunk-s09s5ayx.js} +3 -3
- package/dist/{chunk-par0t822.js.map → chunk-s09s5ayx.js.map} +1 -1
- package/dist/chunk-s5p5z3z4.js +4 -0
- package/dist/chunk-s5p5z3z4.js.map +10 -0
- package/dist/chunk-sf4a2gy5.js +4 -0
- package/dist/chunk-sf4a2gy5.js.map +10 -0
- package/dist/{chunk-dx1wqc00.js → chunk-ssnnxzrj.js} +3 -3
- package/dist/{chunk-dx1wqc00.js.map → chunk-ssnnxzrj.js.map} +1 -1
- package/dist/{chunk-4cc2syf5.js → chunk-t8xtvgyg.js} +2 -2
- package/dist/{chunk-4cc2syf5.js.map → chunk-t8xtvgyg.js.map} +1 -1
- package/dist/chunk-v3ta7hnv.js +4 -0
- package/dist/{chunk-aajhkdmn.js.map → chunk-v3ta7hnv.js.map} +1 -1
- package/dist/{chunk-bmhn4nbp.js → chunk-v92hp9g0.js} +3 -3
- package/dist/{chunk-bmhn4nbp.js.map → chunk-v92hp9g0.js.map} +1 -1
- package/dist/{chunk-8xy18qmz.js → chunk-vgtggzb6.js} +2 -2
- package/dist/{chunk-8xy18qmz.js.map → chunk-vgtggzb6.js.map} +1 -1
- package/dist/{chunk-5a2xez36.js → chunk-vk48hgm4.js} +3 -3
- package/dist/{chunk-5a2xez36.js.map → chunk-vk48hgm4.js.map} +1 -1
- package/dist/{chunk-k5hr781q.js → chunk-w8s5fnsq.js} +3 -3
- package/dist/{chunk-k5hr781q.js.map → chunk-w8s5fnsq.js.map} +1 -1
- package/dist/{chunk-13ydx769.js → chunk-wd23rn4q.js} +2 -2
- package/dist/{chunk-13ydx769.js.map → chunk-wd23rn4q.js.map} +1 -1
- package/dist/chunk-wds4href.js +4 -0
- package/dist/{chunk-147yvtsn.js.map → chunk-wds4href.js.map} +2 -2
- package/dist/{chunk-qbnedp0y.js → chunk-wvd1ffe4.js} +2 -2
- package/dist/{chunk-qbnedp0y.js.map → chunk-wvd1ffe4.js.map} +1 -1
- package/dist/{chunk-g0gz7ypq.js → chunk-wwbjz9k4.js} +2 -2
- package/dist/{chunk-g0gz7ypq.js.map → chunk-wwbjz9k4.js.map} +1 -1
- package/dist/{chunk-qaagk55a.js → chunk-x2k0ngpz.js} +3 -3
- package/dist/{chunk-qaagk55a.js.map → chunk-x2k0ngpz.js.map} +1 -1
- package/dist/{chunk-t6x9e177.js → chunk-x457d0ap.js} +3 -3
- package/dist/{chunk-t6x9e177.js.map → chunk-x457d0ap.js.map} +1 -1
- package/dist/chunk-xbhtzkre.js +4 -0
- package/dist/{chunk-p6pxdvkk.js.map → chunk-xbhtzkre.js.map} +1 -1
- package/dist/{chunk-cbvd18v1.js → chunk-y139ycfm.js} +2 -2
- package/dist/{chunk-cbvd18v1.js.map → chunk-y139ycfm.js.map} +1 -1
- package/dist/chunk-z9kxfckm.js +4 -0
- package/dist/{chunk-mpjnqmbq.js.map → chunk-z9kxfckm.js.map} +1 -1
- package/dist/chunk-zx5txex8.js +4 -0
- package/dist/chunk-zx5txex8.js.map +10 -0
- package/dist/client/hydrator.d.ts +19 -0
- package/dist/client/hydrator.js +3 -0
- package/dist/{core/slot-projection.js.map → client/hydrator.js.map} +1 -1
- package/dist/client/install-hydrator.d.ts +1 -0
- package/dist/client/install-hydrator.js +3 -0
- package/dist/client/install-hydrator.js.map +10 -0
- package/dist/context/context-consumer-bootstrap.js +2 -2
- package/dist/context/context-consumer-bootstrap.js.map +1 -1
- package/dist/context/context-consumer-runtime.js +2 -2
- package/dist/context/context-consumer-runtime.js.map +1 -1
- package/dist/context/context-provider.js +2 -2
- package/dist/context/context-provider.js.map +1 -1
- package/dist/context/context-ssr-bridge.js +2 -2
- package/dist/context/context-ssr-bridge.js.map +1 -1
- package/dist/context/create-context.js +2 -2
- package/dist/context/create-context.js.map +1 -1
- package/dist/context/decorators/consume-context.js +2 -2
- package/dist/context/decorators/consume-context.js.map +1 -1
- package/dist/context/decorators/context-selection-delivery.js +2 -2
- package/dist/context/decorators/context-selection-delivery.js.map +1 -1
- package/dist/context/decorators/context-selector.d.ts +0 -5
- package/dist/context/decorators/context-selector.js +2 -2
- package/dist/context/decorators/context-selector.js.map +1 -1
- package/dist/context/decorators/legacy/consume-context.js +2 -2
- package/dist/context/decorators/legacy/consume-context.js.map +1 -1
- package/dist/context/decorators/legacy/context-selector-field.js +2 -2
- package/dist/context/decorators/legacy/context-selector-field.js.map +1 -1
- package/dist/context/decorators/legacy/context-selector.js +2 -2
- package/dist/context/decorators/legacy/context-selector.js.map +1 -1
- package/dist/context/decorators/legacy/provide-context.js +2 -2
- package/dist/context/decorators/legacy/provide-context.js.map +1 -1
- package/dist/context/decorators/on-context-update.js +2 -2
- package/dist/context/decorators/on-context-update.js.map +1 -1
- package/dist/context/decorators/provide-context.js +2 -2
- package/dist/context/decorators/provide-context.js.map +1 -1
- package/dist/context/decorators/standard/consume-context.js +2 -2
- package/dist/context/decorators/standard/consume-context.js.map +1 -1
- package/dist/context/decorators/standard/context-selector-field.js +2 -2
- package/dist/context/decorators/standard/context-selector-field.js.map +1 -1
- package/dist/context/decorators/standard/context-selector.js +2 -2
- package/dist/context/decorators/standard/context-selector.js.map +1 -1
- package/dist/context/decorators/standard/provide-context.js +2 -2
- package/dist/context/decorators/standard/provide-context.js.map +1 -1
- package/dist/context/events.js +2 -2
- package/dist/context/events.js.map +1 -1
- package/dist/context/hydration-script.d.ts +0 -4
- package/dist/context/hydration-script.js +2 -2
- package/dist/context/hydration-script.js.map +1 -1
- package/dist/core/custom-element-metadata.js +2 -2
- package/dist/core/custom-element-metadata.js.map +1 -1
- package/dist/core/hydration-codec.js +2 -2
- package/dist/core/hydration-codec.js.map +1 -1
- package/dist/core/radiant-component-ssr-registry.d.ts +54 -0
- package/dist/core/radiant-component-ssr-registry.js +3 -0
- package/dist/core/radiant-component-ssr-registry.js.map +9 -0
- package/dist/core/radiant-component-ssr.js +2 -2
- package/dist/core/radiant-component-ssr.js.map +1 -1
- package/dist/core/radiant-component.d.ts +9 -2
- package/dist/core/radiant-component.js +2 -2
- package/dist/core/radiant-component.js.map +1 -1
- package/dist/core/radiant-element.js +2 -2
- package/dist/core/radiant-element.js.map +1 -1
- package/dist/core/radiant-hydrator-state.d.ts +20 -0
- package/dist/core/radiant-hydrator-state.js +3 -0
- package/dist/core/radiant-hydrator-state.js.map +9 -0
- package/dist/core/reactive-jsx-value.js +2 -2
- package/dist/core/reactive-jsx-value.js.map +1 -1
- package/dist/core/reactive-prop-metadata.js +2 -2
- package/dist/core/reactive-prop-metadata.js.map +1 -1
- package/dist/core/{slot-projection.d.ts → slot-projection-runtime.d.ts} +0 -20
- package/dist/core/slot-projection-runtime.js +3 -0
- package/dist/core/slot-projection-runtime.js.map +9 -0
- package/dist/core/ssr-preparation.js +2 -2
- package/dist/core/ssr-preparation.js.map +1 -1
- package/dist/decorators/bound.js +2 -2
- package/dist/decorators/bound.js.map +1 -1
- package/dist/decorators/bridge.js +2 -2
- package/dist/decorators/bridge.js.map +1 -1
- package/dist/decorators/custom-element.js +2 -2
- package/dist/decorators/custom-element.js.map +1 -1
- package/dist/decorators/debounce.js +2 -2
- package/dist/decorators/debounce.js.map +1 -1
- package/dist/decorators/event.js +2 -2
- package/dist/decorators/event.js.map +1 -1
- package/dist/decorators/legacy/bound.js +2 -2
- package/dist/decorators/legacy/bound.js.map +1 -1
- package/dist/decorators/legacy/custom-element.js +2 -2
- package/dist/decorators/legacy/custom-element.js.map +1 -1
- package/dist/decorators/legacy/debounce.js +2 -2
- package/dist/decorators/legacy/debounce.js.map +1 -1
- package/dist/decorators/legacy/event.js +2 -2
- package/dist/decorators/legacy/event.js.map +1 -1
- package/dist/decorators/legacy/instance-initializers.js +2 -2
- package/dist/decorators/legacy/instance-initializers.js.map +1 -1
- package/dist/decorators/legacy/on-event.js +2 -2
- package/dist/decorators/legacy/on-event.js.map +1 -1
- package/dist/decorators/legacy/on-updated.js +2 -2
- package/dist/decorators/legacy/on-updated.js.map +1 -1
- package/dist/decorators/legacy/query-slot.js +2 -2
- package/dist/decorators/legacy/query-slot.js.map +1 -1
- package/dist/decorators/legacy/query.js +2 -2
- package/dist/decorators/legacy/query.js.map +1 -1
- package/dist/decorators/legacy/reactive-field.js +2 -2
- package/dist/decorators/legacy/reactive-field.js.map +1 -1
- package/dist/decorators/legacy/reactive-prop.js +2 -2
- package/dist/decorators/legacy/reactive-prop.js.map +1 -1
- package/dist/decorators/legacy/signal.js +2 -2
- package/dist/decorators/legacy/signal.js.map +1 -1
- package/dist/decorators/on-event.js +2 -2
- package/dist/decorators/on-event.js.map +1 -1
- package/dist/decorators/on-updated.js +2 -2
- package/dist/decorators/on-updated.js.map +1 -1
- package/dist/decorators/prop.js +2 -2
- package/dist/decorators/prop.js.map +1 -1
- package/dist/decorators/query-slot.js +2 -2
- package/dist/decorators/query-slot.js.map +1 -1
- package/dist/decorators/query.js +2 -2
- package/dist/decorators/query.js.map +1 -1
- package/dist/decorators/signal.js +2 -2
- package/dist/decorators/signal.js.map +1 -1
- package/dist/decorators/standard/bound.js +2 -2
- package/dist/decorators/standard/bound.js.map +1 -1
- package/dist/decorators/standard/custom-element.js +2 -2
- package/dist/decorators/standard/custom-element.js.map +1 -1
- package/dist/decorators/standard/debounce.js +2 -2
- package/dist/decorators/standard/debounce.js.map +1 -1
- package/dist/decorators/standard/event.js +2 -2
- package/dist/decorators/standard/event.js.map +1 -1
- package/dist/decorators/standard/on-event.js +2 -2
- package/dist/decorators/standard/on-event.js.map +1 -1
- package/dist/decorators/standard/on-updated.js +2 -2
- package/dist/decorators/standard/on-updated.js.map +1 -1
- package/dist/decorators/standard/query-slot.js +2 -2
- package/dist/decorators/standard/query-slot.js.map +1 -1
- package/dist/decorators/standard/query.js +2 -2
- package/dist/decorators/standard/query.js.map +1 -1
- package/dist/decorators/standard/reactive-field.js +2 -2
- package/dist/decorators/standard/reactive-field.js.map +1 -1
- package/dist/decorators/standard/reactive-prop.js +2 -2
- package/dist/decorators/standard/reactive-prop.js.map +1 -1
- package/dist/decorators/standard/signal.js +2 -2
- package/dist/decorators/standard/signal.js.map +1 -1
- package/dist/decorators/state.js +2 -2
- package/dist/decorators/state.js.map +1 -1
- package/dist/helpers/create-event-listener.js +2 -2
- package/dist/helpers/create-event-listener.js.map +1 -1
- package/dist/helpers/create-event.js +2 -2
- package/dist/helpers/create-event.js.map +1 -1
- package/dist/helpers/create-query-slot.js +2 -2
- package/dist/helpers/create-query-slot.js.map +1 -1
- package/dist/helpers/create-query.js +2 -2
- package/dist/helpers/create-query.js.map +1 -1
- package/dist/helpers/debounce.js +2 -2
- package/dist/helpers/debounce.js.map +1 -1
- package/dist/helpers/index.js +2 -2
- package/dist/helpers/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/server/context-ssr.js +2 -2
- package/dist/server/context-ssr.js.map +1 -1
- package/dist/server/html-parser.d.ts +21 -0
- package/dist/server/html-parser.js +3 -0
- package/dist/server/html-parser.js.map +9 -0
- package/dist/server/install-light-dom-shim.js +2 -2
- package/dist/server/install-light-dom-shim.js.map +2 -2
- package/dist/server/light-dom-shim.js +2 -2
- package/dist/server/light-dom-shim.js.map +1 -1
- package/dist/server/project-root.js +1 -1
- package/dist/server/radiant-component-ssr-runtime.d.ts +9 -0
- package/dist/server/radiant-component-ssr-runtime.js +3 -0
- package/dist/server/radiant-component-ssr-runtime.js.map +9 -0
- package/dist/server/render-component.d.ts +5 -5
- package/dist/server/render-component.js +2 -2
- package/dist/server/render-component.js.map +3 -3
- package/dist/server/slot-projection-html.d.ts +3 -0
- package/dist/server/slot-projection-html.js +3 -0
- package/dist/server/slot-projection-html.js.map +10 -0
- package/dist/signals/host-resource.js +1 -1
- package/dist/signals/host-signal.js +2 -2
- package/dist/signals/host-signal.js.map +1 -1
- package/dist/signals/hydration-script.d.ts +0 -4
- package/dist/signals/hydration-script.js +2 -2
- package/dist/signals/hydration-script.js.map +1 -1
- package/dist/tools/escape-script-json.js +2 -2
- package/dist/tools/escape-script-json.js.map +1 -1
- package/dist/tools/event-emitter.js +2 -2
- package/dist/tools/event-emitter.js.map +1 -1
- package/dist/tools/index.js +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/render-jsx-template.js +1 -1
- package/dist/tools/stringify-typed.js +1 -1
- package/dist/types.d.ts +0 -21
- package/dist/types.js +1 -1
- package/dist/types.js.map +2 -2
- package/dist/utils/attribute-utils.js +2 -2
- package/dist/utils/attribute-utils.js.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +14 -1
- package/size-budget.json +2 -8
- package/dist/chunk-0y78f8hj.js +0 -4
- package/dist/chunk-0zq7e1ne.js +0 -4
- package/dist/chunk-147yvtsn.js +0 -4
- package/dist/chunk-17earqbr.js +0 -4
- package/dist/chunk-17earqbr.js.map +0 -10
- package/dist/chunk-2tgrfv09.js +0 -4
- package/dist/chunk-3b033cgq.js +0 -4
- package/dist/chunk-42tyhfvh.js +0 -4
- package/dist/chunk-4fqkmpra.js +0 -4
- package/dist/chunk-5bym7y1d.js +0 -4
- package/dist/chunk-5td6v9k3.js +0 -4
- package/dist/chunk-60015zxq.js +0 -4
- package/dist/chunk-60q4y3k5.js +0 -4
- package/dist/chunk-6kdxrppw.js +0 -4
- package/dist/chunk-6kdxrppw.js.map +0 -10
- package/dist/chunk-6z34stya.js +0 -4
- package/dist/chunk-6z34stya.js.map +0 -10
- package/dist/chunk-9554n9t4.js +0 -4
- package/dist/chunk-9ascmjk3.js +0 -4
- package/dist/chunk-9ascmjk3.js.map +0 -10
- package/dist/chunk-a7hzs37s.js +0 -4
- package/dist/chunk-aajhkdmn.js +0 -4
- package/dist/chunk-ak97hp4w.js +0 -4
- package/dist/chunk-c8vqg7r1.js +0 -4
- package/dist/chunk-d4v5qpxa.js +0 -4
- package/dist/chunk-d7hh3ze6.js +0 -4
- package/dist/chunk-d98q3myg.js +0 -4
- package/dist/chunk-jce9gqqw.js +0 -4
- package/dist/chunk-jce9gqqw.js.map +0 -10
- package/dist/chunk-mpjnqmbq.js +0 -4
- package/dist/chunk-mqxmfvyp.js +0 -4
- package/dist/chunk-nw171z6m.js +0 -4
- package/dist/chunk-nw171z6m.js.map +0 -10
- package/dist/chunk-p6pxdvkk.js +0 -4
- package/dist/chunk-qe6sjr27.js +0 -4
- package/dist/chunk-r1cvaz1t.js +0 -4
- package/dist/chunk-r1cvaz1t.js.map +0 -10
- package/dist/chunk-r75y7ydb.js +0 -4
- package/dist/chunk-t7a1bbxq.js +0 -4
- package/dist/chunk-vpfm9yw8.js +0 -4
- package/dist/chunk-w50v38rv.js +0 -4
- package/dist/chunk-zb7wh7w4.js +0 -4
- package/dist/chunk-zj9ez73m.js +0 -4
- package/dist/core/slot-projection.js +0 -3
package/README.md
CHANGED
|
@@ -149,7 +149,9 @@ Use `@onUpdated(...)` with `update()` or `requestUpdate()` when the reactive cha
|
|
|
149
149
|
|
|
150
150
|
In practice, `renderHostToString()` is the right default for full component SSR because it emits `<my-element>...</my-element>` instead of only the view fragment.
|
|
151
151
|
|
|
152
|
-
`hydrate: true` adds hydration markers for the component view.
|
|
152
|
+
`hydrate: true` 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.
|
|
153
|
+
|
|
154
|
+
For component-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`.
|
|
153
155
|
|
|
154
156
|
Server runtime setup, fragment rendering helpers, and SSR-specific import guidance now live in [src/server/README.md](src/server/README.md).
|
|
155
157
|
|
|
@@ -275,6 +277,8 @@ These are the documented public import paths exposed by the package.
|
|
|
275
277
|
| `@ecopages/radiant/context/on-context-update` | `@onContextUpdate(...)` decorator — run a method on context change |
|
|
276
278
|
| `@ecopages/radiant/core/radiant-element` | Non-JSX reactive custom-element base |
|
|
277
279
|
| `@ecopages/radiant/core/radiant-component` | JSX-first component base |
|
|
280
|
+
| `@ecopages/radiant/client/hydrator` | Explicit client hydrator installer and status helpers for SSR pages |
|
|
281
|
+
| `@ecopages/radiant/client/install-hydrator` | Side-effect entrypoint that enables first-connect hydration before component modules load |
|
|
278
282
|
| `@ecopages/radiant/signals/host-resource` | Low-level `HostResource`, `createHostResource(...)`, and `createResource(...)` helpers |
|
|
279
283
|
| `@ecopages/radiant/server/light-dom-shim` | Minimal SSR window and host-preparation helpers |
|
|
280
284
|
| `@ecopages/radiant/server/render-component` | Canonical component SSR helpers and metadata utilities |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{a as
|
|
1
|
+
import{Bb as t}from"./chunk-wwbjz9k4.js";function a(r){return function(o,e){let n=String(e.name);e.addInitializer(function(){let i=t(this,r);Object.defineProperty(this,n,{get(){return i.value},enumerable:!0,configurable:!0})})}}
|
|
2
|
+
export{a as $};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=174B02C349DF3B4664756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { createQuery } from '../../helpers/create-query';\nimport type { QueryConfig } from '../query';\n\nexport function query(options: QueryConfig) {\n\treturn function <T extends HTMLElement, V extends Element | Element[]>(\n\t\t_: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuery<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "yCAGO,SAAS,CAAK,CAAC,EAAsB,CAC3C,OAAO,QAA+D,CACrE,EACA,EACC,CACD,IAAM,EAAe,OAAO,EAAQ,IAAI,EAExC,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAW,EAAe,KAAM,CAAO,EAE7C,OAAO,eAAe,KAAM,EAAc,CACzC,GAAG,EAAG,CACL,OAAO,EAAS,OAEjB,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "174B02C349DF3B4664756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { type EventEmitterConfig } from '../tools/event-emitter';\nimport type { StandardOrLegacyFieldDecoratorArgs } from '../types';\nimport { event as legacyEvent } from './legacy/event';\nimport { event as standardEvent } from './standard/event';\nimport { fieldDecoratorBridge } from './bridge';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig {@link EventEmitterConfig} Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n\t): any {\n\t\treturn fieldDecoratorBridge(standardEvent(eventConfig), legacyEvent(eventConfig), protoOrTarget, nameOrContext);\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "uIAYO,GAAS,LAAK,CAAC,EAAiC,CACtD,OAAO,QAAS,CACf,EACA,EACM,CACN,OAAO,EAAqB,EAAc,CAAW,EAAG,EAAY,CAAW,EAAG,EAAe,CAAa",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "0C61F31D99EFA58E64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { StandardOrLegacyMethodDecoratorArgs } from '../types';\nimport { onUpdated as legacyOnUpdated } from './legacy/on-updated';\nimport { onUpdated as standardOnUpdated } from './standard/on-updated';\nimport { methodDecoratorBridge } from './bridge';\n\n/**\n * A decorator to bind a method to the instance.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): any {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnUpdated(keyOrKeys),\n\t\t\tlegacyOnUpdated(keyOrKeys),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "uIAQO,GAAS,LAAS,CAAC,EAA8B,CACvD,OAAO,QAAS,CACf,EACA,EACA,EACM,CACN,OAAO,EACN,EAAkB,CAAS,EAC3B,EAAgB,CAAS,EACzB,EACA,EACA,CACD",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "79FD819A4172B94064756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { RadiantElementEventListener } from '../core/radiant-element';\nimport type { StandardOrLegacyMethodDecoratorArgs } from '../types';\nimport type { OnEventConfig, OnEventScope } from '../helpers/create-event-listener';\nimport { onEvent as legacyOnEvent } from './legacy/on-event';\nimport { onEvent as standardOnEvent } from './standard/on-event';\nimport { methodDecoratorBridge } from './bridge';\n\nexport type { OnEventConfig, OnEventScope };\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n * Delegated listeners observe the host light DOM by default, and can optionally observe the shadow root or both trees.\n *\n * @param options {@link OnEventConfig} The event configuration.\n */\nexport function onEvent(options: OnEventConfig) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): any {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnEvent(options),\n\t\t\tlegacyOnEvent(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "uIAoBO,GAAS,LAAO,CAAC,EAAwB,CAC/C,OAAO,QAAS,CACf,EACA,EACA,EACM,CACN,OAAO,EACN,EAAgB,CAAO,EACvB,EAAc,CAAO,EACrB,EACA,EACA,CACD",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "DFF5F8F9A61E3D2564756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{$ as
|
|
1
|
+
import{U as I}from"./chunk-kmebacvv.js";import{W as U,X as Y}from"./chunk-c0qyz98c.js";import{ub as K,vb as Q}from"./chunk-hpzgnxgq.js";import{createMarkupNodeLike as _}from"@ecopages/jsx";class ${host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(q,A){this.host=q,this.context=A.context,this.hydrationKey=A.hydrationKey,this.hydrate=A.hydrate,this.serialize=A.serialize,this.pendingHostHydration=Boolean(A.hydrate),this.value=A.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new I(this.context))}setContext=(q,A)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(q)){let B=this.value;if(this.value={...q},A)A(this.value);this.notifySubscribers(this.value,B);return}if(this.isObject(this.value)&&this.isObject(q)){let B={...this.value};if(this.value={...this.value,...q},A)A(this.value);this.notifySubscribers(this.value,B)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let q=this.serialize?this.serialize(this.value):this.value;if(typeof q>"u")return;let A=JSON.stringify(q);if(typeof A!=="string")return;return Y(A)};renderHydrationScriptTag=()=>{let q=this.serializeHydrationValue();if(!q)return;return U({hydrationKey:this.hydrationKey,serializedValue:q})};renderHydrationScript=()=>{let q=this.renderHydrationScriptTag();if(!q)return;return _(q)};subscribe=({select:q,callback:A})=>{this.subscriptions.push({select:q,callback:A})};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let q=this.findHydrationScriptElement();if(!q)return;this.value=this.mergeHydrationValue(K(q,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(q){if(this.hydrate===Object&&this.isObject(q)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...q};return q}isObject(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}findHydrationScriptElement(){return Q(this.host,"context",this.hydrationKey)}notifySubscribers=(q,A)=>{for(let B of this.subscriptions){if(!B.select||typeof A>"u"){this.sendSubscriptionUpdate(B,q);continue}let F=B.select(q),G=B.select(A);if(F!==G)this.sendSubscriptionUpdate(B,q)}};sendSubscriptionUpdate=({select:q,callback:A},B)=>{if(!q)A(B);else A(q(B))};handleSubscriptionRequest=({select:q,callback:A,subscribe:B})=>{if(this.tryHydrateFromHost(),B)this.subscribe({select:q,callback:A});if(typeof this.value>"u")return;if(q)A(q(this.value));else A(this.value)};onSubscriptionRequest=(q)=>{let{context:A,callback:B,subscribe:F,select:G,target:Z}=q;if(A!==this.context)return;q.stopPropagation(),Z.dispatchEvent(new I(this.context)),this.handleSubscriptionRequest({select:G,callback:B,subscribe:F})};onContextRequest=(q)=>{let{context:A,callback:B}=q;if(A!==this.context)return;q.stopPropagation(),B(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}
|
|
2
|
+
export{$ as R};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=4E0252ECD83ECA6C64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantElement } from '../core/radiant-element';\nimport type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';\nimport type { AttributeTypeConstant } from '../utils/attribute-utils';\nimport {\n\tContextEventsTypes,\n\tContextOnMountEvent,\n\ttype ContextRequestEvent,\n\ttype ContextSubscription,\n\ttype ContextSubscriptionRequestEvent,\n} from './events';\nimport { findHydrationScript, parseHydrationPayload } from '../core/hydration-codec';\nimport { createContextHydrationScriptTag, escapeContextHydrationJson } from './hydration-script';\nimport type { Context, ContextType, UnknownContext } from './types';\n\ntype ContextProviderOptions<T extends UnknownContext> = {\n\tcontext: UnknownContext;\n\thydrationKey?: string;\n\tinitialValue?: T['__context__'];\n\thydrate?: AttributeTypeConstant;\n\tserialize?: (value: ContextType<T>) => unknown;\n};\n\nexport interface SsrSerializableContextProvider extends SsrSerializableHydrationBinding {\n\t/** Returns the current context payload that should be visible to descendants. */\n\tgetContext(): unknown;\n\t/** Returns the context token used to match nested SSR consumers and providers. */\n\tgetContextKey(): UnknownContext;\n}\n\n/**\n * Represents a context provider that allows setting and getting the context,\n * as well as subscribing to context updates.\n *\n * @template T - The type of the context.\n */\nexport interface IContextProvider<T extends Context<unknown, unknown>> {\n\t/**\n\t * Sets the context with the provided update and invokes the optional callback function.\n\t *\n\t * @param update - The partial update to be applied to the context.\n\t * @param callback - An optional callback function that receives the updated context.\n\t */\n\tsetContext: (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => void;\n\n\t/**\n\t * Gets the current context.\n\t *\n\t * @returns The current context.\n\t */\n\tgetContext: () => ContextType<T>;\n\n\t/**\n\t * Subscribes to context updates.\n\t *\n\t * @param subscription - The subscription object that defines the callback function to be invoked on context updates.\n\t */\n\tsubscribe: (subscription: ContextSubscription<T>) => void;\n}\n\n/**\n * It creates a context provider that allows setting and getting the context,\n * It will also be in charge of notifying the subscribers when the context changes.\n *\n * @template T - The type of the context.\n * @implements IContextProvider\n *\n * @example\n * ```ts\n * export class MyElement extends RadiantElement {\n * provider = new ContextProvider<typeof myContext>(this, {\n * context: myContext,\n * initialValue: {\n * value: 'Hello World',\n * },\n * });\n * ```\n */\nexport class ContextProvider<T extends Context<unknown, unknown>>\n\timplements IContextProvider<T>, SsrSerializableContextProvider\n{\n\tprivate host: RadiantElement;\n\tprivate context: UnknownContext;\n\tprivate hydrationKey?: string;\n\tprivate hydrate?: AttributeTypeConstant;\n\tprivate serialize?: (value: ContextType<T>) => unknown;\n\tprivate pendingHostHydration: boolean;\n\tprivate value: ContextType<T> | undefined;\n\n\tsubscriptions: ContextSubscription<T>[] = [];\n\n\t/**\n\t * Creates a new instance of the ContextProvider.\n\t *\n\t * @param host - The host element that will contain the context provider.\n\t * @param options - The options to configure the context provider.\n\t */\n\tconstructor(host: RadiantElement, options: ContextProviderOptions<T>) {\n\t\tthis.host = host;\n\t\tthis.context = options.context;\n\t\tthis.hydrationKey = options.hydrationKey;\n\t\tthis.hydrate = options.hydrate;\n\t\tthis.serialize = options.serialize;\n\t\tthis.pendingHostHydration = Boolean(options.hydrate);\n\t\tthis.value = options.initialValue as ContextType<T>;\n\t\tthis.tryHydrateFromHost();\n\n\t\tthis.registerEvents();\n\t\tthis.host.dispatchEvent(new ContextOnMountEvent(this.context));\n\t}\n\n\tsetContext = (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => {\n\t\tthis.tryHydrateFromHost();\n\t\tthis.pendingHostHydration = false;\n\n\t\tif (typeof this.value === 'undefined' && this.isObject(update)) {\n\t\t\tconst oldContext = this.value;\n\t\t\tthis.value = { ...update } as ContextType<T>;\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isObject(this.value) && this.isObject(update)) {\n\t\t\tconst oldContext = { ...this.value };\n\t\t\tthis.value = { ...this.value, ...update };\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t}\n\t};\n\n\tgetContext = () => {\n\t\tthis.tryHydrateFromHost();\n\t\treturn this.value as ContextType<T>;\n\t};\n\n\t/**\n\t * Returns the provider's logical context token.\n\t *\n\t * SSR helpers use this token to resolve the closest matching provider while a\n\t * host subtree is being serialized.\n\t */\n\tgetContextKey = () => {\n\t\treturn this.context;\n\t};\n\n\t/**\n\t * Serializes the current provider value for inclusion in a hydration script.\n\t *\n\t * The serialized payload is JSON-escaped so it can be embedded safely inside a\n\t * `<script type=\"application/json\">` tag.\n\t */\n\tserializeHydrationValue = (): string | undefined => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (!this.hydrate || typeof this.value === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst hydrationValue = this.serialize ? this.serialize(this.value) : this.value;\n\n\t\tif (typeof hydrationValue === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst serializedValue = JSON.stringify(hydrationValue);\n\n\t\tif (typeof serializedValue !== 'string') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn escapeContextHydrationJson(serializedValue);\n\t};\n\n\t/**\n\t * Builds the raw HTML hydration script for this provider.\n\t *\n\t * When `hydrationKey` is present, the marker is scoped so sibling or nested\n\t * providers can recover their own payloads without accidentally reading a\n\t * descendant script.\n\t */\n\trenderHydrationScriptTag = (): string | undefined => {\n\t\tconst serializedValue = this.serializeHydrationValue();\n\n\t\tif (!serializedValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createContextHydrationScriptTag({\n\t\t\thydrationKey: this.hydrationKey,\n\t\t\tserializedValue,\n\t\t});\n\t};\n\n\t/**\n\t * Wraps the provider hydration script in a minimal JSX node-like value.\n\t *\n\t * This lets JSX-based host renderers append the script without needing a real\n\t * DOM element instance during SSR.\n\t */\n\trenderHydrationScript = (): JsxRenderable | undefined => {\n\t\tconst outerHTML = this.renderHydrationScriptTag();\n\n\t\tif (!outerHTML) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createMarkupNodeLike(outerHTML);\n\t};\n\n\tsubscribe = ({ select, callback }: ContextSubscription<T>) => {\n\t\tthis.subscriptions.push({ select, callback });\n\t};\n\n\tprivate tryHydrateFromHost(): void {\n\t\tif (!this.pendingHostHydration) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst hydrationScriptElement = this.findHydrationScriptElement();\n\n\t\tif (!hydrationScriptElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value = this.mergeHydrationValue(\n\t\t\tparseHydrationPayload(hydrationScriptElement, this.value) as ContextType<T>,\n\t\t);\n\t\tthis.pendingHostHydration = false;\n\t}\n\n\tprivate mergeHydrationValue(parsedHydrationValue: ContextType<T>): ContextType<T> {\n\t\tif (\n\t\t\tthis.hydrate === Object &&\n\t\t\tthis.isObject(parsedHydrationValue) &&\n\t\t\t(this.isObject(this.value) || typeof this.value === 'undefined')\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...(this.value ?? {}),\n\t\t\t\t...parsedHydrationValue,\n\t\t\t} as ContextType<T>;\n\t\t}\n\n\t\treturn parsedHydrationValue;\n\t}\n\n\tprivate isObject(value: unknown): value is Record<string, unknown> {\n\t\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n\t}\n\n\tprivate findHydrationScriptElement(): Element | null {\n\t\treturn findHydrationScript(this.host as Element, 'context', this.hydrationKey);\n\t}\n\n\tprivate notifySubscribers = (newContext: ContextType<T>, prevContext: ContextType<T> | undefined) => {\n\t\tfor (const sub of this.subscriptions) {\n\t\t\tif (!sub.select || typeof prevContext === 'undefined') {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst newSelected = sub.select(newContext);\n\t\t\tconst prevSelected = sub.select(prevContext);\n\t\t\tif (newSelected !== prevSelected) {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate sendSubscriptionUpdate = ({ select, callback }: ContextSubscription<T>, context: ContextType<T>) => {\n\t\tif (!select) callback(context);\n\t\telse callback(select(context));\n\t};\n\n\tprivate handleSubscriptionRequest = ({\n\t\tselect,\n\t\tcallback,\n\t\tsubscribe,\n\t}: {\n\t\tselect?: ContextSubscription<T>['select'];\n\t\tcallback: ContextSubscription<T>['callback'];\n\t\tsubscribe?: boolean;\n\t}) => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (subscribe) this.subscribe({ select, callback });\n\n\t\tif (typeof this.value === 'undefined') return;\n\n\t\tif (select) {\n\t\t\tcallback(select(this.value));\n\t\t} else {\n\t\t\tcallback(this.value as ContextType<T>);\n\t\t}\n\t};\n\n\tprivate onSubscriptionRequest = (event: ContextSubscriptionRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback, subscribe, select, target } = event;\n\t\tif (context !== this.context) return;\n\n\t\tevent.stopPropagation();\n\n\t\t(target as HTMLElement).dispatchEvent(new ContextOnMountEvent(this.context));\n\n\t\tthis.handleSubscriptionRequest({ select, callback, subscribe });\n\t};\n\n\tprivate onContextRequest = (event: ContextRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback } = event;\n\t\tif (context !== this.context) return;\n\t\tevent.stopPropagation();\n\t\tcallback(this);\n\t};\n\n\tprivate registerEvents = () => {\n\t\tthis.host.addEventListener(ContextEventsTypes.SUBSCRIPTION_REQUEST, this.onSubscriptionRequest);\n\t\tthis.host.addEventListener(ContextEventsTypes.CONTEXT_REQUEST, this.onContextRequest);\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "oJAAA,yBAAS,gBA8EF,MAAM,CAEb,CACS,KACA,QACA,aACA,QACA,UACA,qBACA,MAER,cAA0C,CAAC,EAQ3C,WAAW,CAAC,EAAsB,EAAoC,CACrE,KAAK,KAAO,EACZ,KAAK,QAAU,EAAQ,QACvB,KAAK,aAAe,EAAQ,aAC5B,KAAK,QAAU,EAAQ,QACvB,KAAK,UAAY,EAAQ,UACzB,KAAK,qBAAuB,QAAQ,EAAQ,OAAO,EACnD,KAAK,MAAQ,EAAQ,aACrB,KAAK,mBAAmB,EAExB,KAAK,eAAe,EACpB,KAAK,KAAK,cAAc,IAAI,EAAoB,KAAK,OAAO,CAAC,EAG9D,WAAa,CAAC,EAAiC,IAAiD,CAI/F,GAHA,KAAK,mBAAmB,EACxB,KAAK,qBAAuB,GAEx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E,KAAK,0BAA0B,CAAE,SAAQ,WAAU,WAAU,CAAC,GAGvD,iBAAmB,CAAC,IAA+C,CAC1E,IAAQ,UAAS,YAAa,EAC9B,GAAI,IAAY,KAAK,QAAS,OAC9B,EAAM,gBAAgB,EACtB,EAAS,IAAI,GAGN,eAAiB,IAAM,CAC9B,KAAK,KAAK,gDAA0D,KAAK,qBAAqB,EAC9F,KAAK,KAAK,mCAAqD,KAAK,gBAAgB,EAEtF",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "4E0252ECD83ECA6C64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { setCustomElementTagName } from '../../core/custom-element-metadata';\n\n/**\n * Registers a web component with the given name on the global `window.customElements` registry.\n * @param name selector name.\n * @param options {@link ElementDefinitionOptions}\n */\nexport function customElement(name: string, options?: ElementDefinitionOptions) {\n\treturn (target: CustomElementConstructor) => {\n\t\tsetCustomElementTagName(target, name);\n\n\t\tif (!window.customElements.get(name)) {\n\t\t\twindow.customElements.define(name, target, options);\n\t\t}\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "yCAOO,SAAS,CAAa,CAAC,EAAc,EAAoC,CAC/E,MAAO,CAAC,IAAqC,CAG5C,GAFA,EAAwB,EAAQ,CAAI,EAEhC,CAAC,OAAO,eAAe,IAAI,CAAI,EAClC,OAAO,eAAe,OAAO,EAAM,EAAQ,CAAO",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "6EDD7A6042A1E5F864756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { Context } from './types';\n\n/**\n * A function which creates a Context value object\n */\nexport const createContext = <ValueType>(key: unknown) => key as Context<typeof key, ValueType>;\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "AAKO,IAAM,EAAgB,CAAY,IAAiB",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "0C72A74D4D52914964756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{h as g}from"./chunk-ssnnxzrj.js";import{Xa as a}from"./chunk-hztr86b4.js";import{eb as s}from"./chunk-66e6s792.js";class p{host;constructor(e){this.host=e}renderHost(){return{nodeType:1,outerHTML:this.renderHostToString({hydrate:!0})}}renderHostToString(e={},i=this.getHostAttributes()){let t=this.getTagName(),r=g(this.host.getContextProviders());try{return`<${t}${u(i)}>${this.renderHostContent(e)}</${t}>`}finally{r()}}renderHostContent(e){let i=this.host.renderToString(e),t=this.host.getAuthoredHydrationScriptMarkup?.()??"",r=this.host.getSlotProjectionScriptTag?.()??"";if(!e.hydrate)return`${i}${t}${r}`;let n=this.host.getHydrationBindings().map((o)=>o.renderHydrationScriptTag()).filter((o)=>typeof o==="string").join("");return`${i}${r}${n}`}getHostAttributes(){let e={},i=new Set;for(let t of this.host.getReactiveProperties()){let r=this.host.getPropertyValue(t.name);if(r===void 0||r===null||r===!1)continue;e[t.attribute]=String(t.converter.toAttribute(r)),i.add(t.attribute)}for(let t of this.host.getReactivePropDefinitions()){let r=t.options.attribute??t.name;if(i.has(r))continue;let n=this.host.getPropertyValue(t.name);if(n===void 0||n===null||n===!1)continue;e[r]=String(s(n,t.options.type)),i.add(r)}for(let t of this.host.listAttributeNames()){let r=this.host.getAttributeValue(t);if(r!==null)e[t]=r}return e}getTagName(){let e=a(this.host.constructor);if(!e)throw Error(`${this.host.constructor.name} is missing @customElement metadata.`);return e}}function u(e){return Object.entries(e).map(([i,t])=>` ${i}="${c(t)}"`).join("")}function c(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}
|
|
2
|
+
export{p as g};
|
|
3
|
+
|
|
4
|
+
//# debugId=6FBBF457664117B864756E2164756E21
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { JsxRenderable } from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport { withSsrContextProviders } from '../server/context-ssr';\nimport { getCustomElementTagName } from './custom-element-metadata';\nimport type { ReactiveProperty } from './radiant-element';\nimport type { ReactivePropDefinition } from './reactive-prop-metadata';\nimport type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\nimport { writeAttributeValue } from '../utils/attribute-utils';\n\ntype RadiantComponentSsrHost = {\n\tconstructor: CustomElementConstructor;\n\tgetAuthoredHydrationScriptMarkup?: () => string | undefined;\n\tgetContextProviders: () => SsrSerializableContextProvider[];\n\tgetHydrationBindings: () => SsrSerializableHydrationBinding[];\n\tgetSlotProjectionScriptTag?: () => string | undefined;\n\trenderToString: (options?: RenderToStringOptions) => string;\n\tgetReactiveProperties: () => ReactiveProperty[];\n\tgetReactivePropDefinitions: () => ReactivePropDefinition[];\n\tgetPropertyValue: (name: string) => unknown;\n\tlistAttributeNames: () => string[];\n\tgetAttributeValue: (name: string) => string | null;\n};\n\nexport class RadiantComponentSsrService {\n\tconstructor(private readonly host: RadiantComponentSsrHost) {}\n\n\tpublic renderHost(): JsxRenderable {\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\touterHTML: this.renderHostToString({ hydrate: true }),\n\t\t};\n\t}\n\n\tpublic renderHostToString(options: RenderToStringOptions = {}, attributes = this.getHostAttributes()): string {\n\t\tconst tagName = this.getTagName();\n\t\tconst restoreSsrContexts = withSsrContextProviders(this.host.getContextProviders());\n\n\t\ttry {\n\t\t\treturn `<${tagName}${serializeHostAttributes(attributes)}>${this.renderHostContent(options)}</${tagName}>`;\n\t\t} finally {\n\t\t\trestoreSsrContexts();\n\t\t}\n\t}\n\n\tprivate renderHostContent(options: RenderToStringOptions): string {\n\t\tconst hostContent = this.host.renderToString(options);\n\t\tconst authoredHydrationMarkup = this.host.getAuthoredHydrationScriptMarkup?.() ?? '';\n\t\tconst slotProjectionScript = this.host.getSlotProjectionScriptTag?.() ?? '';\n\n\t\tif (!options.hydrate) {\n\t\t\treturn `${hostContent}${authoredHydrationMarkup}${slotProjectionScript}`;\n\t\t}\n\n\t\tconst hydrationScripts = this.host\n\t\t\t.getHydrationBindings()\n\t\t\t.map((binding) => binding.renderHydrationScriptTag())\n\t\t\t.filter((markup): markup is string => typeof markup === 'string')\n\t\t\t.join('');\n\n\t\treturn `${hostContent}${slotProjectionScript}${hydrationScripts}`;\n\t}\n\n\tpublic getHostAttributes(): Record<string, string> {\n\t\tconst attributes: Record<string, string> = {};\n\t\tconst seenAttributes = new Set<string>();\n\n\t\tfor (const property of this.host.getReactiveProperties()) {\n\t\t\tconst currentValue = this.host.getPropertyValue(property.name);\n\t\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattributes[property.attribute] = String(property.converter.toAttribute(currentValue));\n\t\t\tseenAttributes.add(property.attribute);\n\t\t}\n\n\t\tfor (const definition of this.host.getReactivePropDefinitions()) {\n\t\t\tconst attributeName = definition.options.attribute ?? definition.name;\n\n\t\t\tif (seenAttributes.has(attributeName)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst currentValue = this.host.getPropertyValue(definition.name);\n\n\t\t\tif (currentValue === undefined || currentValue === null || currentValue === false) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tattributes[attributeName] = String(writeAttributeValue(currentValue, definition.options.type));\n\t\t\tseenAttributes.add(attributeName);\n\t\t}\n\n\t\tfor (const attributeName of this.host.listAttributeNames()) {\n\t\t\tconst attributeValue = this.host.getAttributeValue(attributeName);\n\t\t\tif (attributeValue !== null) {\n\t\t\t\tattributes[attributeName] = attributeValue;\n\t\t\t}\n\t\t}\n\n\t\treturn attributes;\n\t}\n\n\tprivate getTagName(): string {\n\t\tconst tagName = getCustomElementTagName(this.host.constructor);\n\n\t\tif (!tagName) {\n\t\t\tthrow new Error(`${this.host.constructor.name} is missing @customElement metadata.`);\n\t\t}\n\n\t\treturn tagName;\n\t}\n}\n\nfunction serializeHostAttributes(attributes: Record<string, string>): string {\n\treturn Object.entries(attributes)\n\t\t.map(([name, value]) => ` ${name}=\"${escapeAttribute(value)}\"`)\n\t\t.join('');\n}\n\nfunction escapeAttribute(value: string): string {\n\treturn value.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<').replace(/>/g, '>');\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": "sIAwBO,AAAM,LAA2B,CACV,KAA7B,WAAW,CAAkB,EAA+B,CAA/B,YAEtB,UAAU,EAAkB,CAClC,MAAO,CACN,SAAU,EACV,UAAW,KAAK,mBAAmB,CAAE,QAAS,EAAK,CAAC,CACrD,EAGM,kBAAkB,CAAC,EAAiC,CAAC,EAAG,EAAa,KAAK,kBAAkB,EAAW,CAC7G,IAAM,EAAU,KAAK,WAAW,EAC1B,EAAqB,EAAwB,KAAK,KAAK,oBAAoB,CAAC,EAElF,GAAI,CACH,MAAO,IAAI,IAAU,EAAwB,CAAU,KAAK,KAAK,kBAAkB,CAAO,MAAM,YAC/F,CACD,EAAmB,GAIb,iBAAiB,CAAC,EAAwC,CACjE,IAAM,EAAc,KAAK,KAAK,eAAe,CAAO,EAC9C,EAA0B,KAAK,KAAK,mCAAmC,GAAK,GAC5E,EAAuB,KAAK,KAAK,6BAA6B,GAAK,GAEzE,GAAI,CAAC,EAAQ,QACZ,MAAO,GAAG,IAAc,IAA0B,IAGnD,IAAM,EAAmB,KAAK,KAC5B,qBAAqB,EACrB,IAAI,CAAC,IAAY,EAAQ,yBAAyB,CAAC,EACnD,OAAO,CAAC,IAA6B,OAAO,IAAW,QAAQ,EAC/D,KAAK,EAAE,EAET,MAAO,GAAG,IAAc,IAAuB,IAGzC,iBAAiB,EAA2B,CAClD,IAAM,EAAqC,CAAC,EACtC,EAAiB,IAAI,IAE3B,QAAW,KAAY,KA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|
|
|
1
|
+
import{pb as B}from"./chunk-hpzgnxgq.js";import{createMarkupNodeLike as U,isKeyedJsxValue as D,isSlotJsxValue as A}from"@ecopages/jsx";var k="",J="data-radiant-slot-projection";function x(q){let w=new Map;for(let G of Array.from(q.childNodes)){if(F(G))continue;O(w,E(G),G)}return w}function P(q){let w;try{w=JSON.parse(q)}catch{if(typeof console<"u")console.warn("[@ecopages/radiant] Failed to parse slot projection payload:",q.slice(0,120));return new Map}let G=new Map;for(let[Q,X]of Object.entries(w)){if(!Array.isArray(X)||X.length===0)continue;G.set($(Q),X.map((W)=>U(W)))}return G}function R(q){let w=Array.from(q.childNodes).filter((G)=>M(G)).map((G)=>Y(G)??"").filter((G)=>G!=="");return w.length>0?w.join(""):void 0}function f(q){let w={};for(let[G,Q]of q.entries()){let X=Q.map((W)=>Y(W)).filter((W)=>W!==void 0&&W!=="");if(X.length>0)w[G]=X}return Object.keys(w).length>0?JSON.stringify(w):void 0}function T(q,w){let G=!1,Q=(W)=>{if(A(W))return G=!0,I(W,w,Q);if(D(W))return h(W,Q(W.value));if(H(W))return{_$rType$:1,strings:W.strings,values:W.values.map((Z)=>Q(Z))};if(z(W))return Array.from(W,(Z)=>Q(Z));return W},X=Q(q);return{containsSlots:G,value:X}}function j(q){for(let w of Array.from(q.childNodes)){if(!K(w))continue;let G=w.textContent??void 0;return w.parentNode?.removeChild(w),G}return}function O(q,w,G){let Q=q.get(w);if(Q){Q.push(G);return}q.set(w,[G])}function h(q,w){return{...q,value:w}}function E(q){if(q instanceof Element)return $(q.getAttribute("slot"));return k}function z(q){return typeof q!=="string"&&typeof q==="object"&&q!==null&&Symbol.iterator in q}function K(q){return q instanceof HTMLScriptElement&&q.hasAttribute(J)}function M(q){return q instanceof HTMLScriptElement&&q.hasAttribute(B)}function F(q){return K(q)||M(q)}function H(q){return typeof q==="object"&&q!==null&&q._$rType$===1&&Array.isArray(q.strings)&&Array.isArray(q.values)}function $(q){return q??k}function Y(q){if(q===void 0||q===null||q===!1||q===!0)return;if(typeof Node<"u"&&q instanceof Node){if(q.nodeType===Node.TEXT_NODE)return q.textContent??"";return q.outerHTML??q.textContent??void 0}if(D(q))return Y(q.value);if(typeof q==="string"||typeof q==="number"||typeof q==="bigint")return String(q);if(typeof q==="object"&&q!==null&&"outerHTML"in q)return typeof q.outerHTML==="string"?q.outerHTML:q.textContent??void 0;if(z(q))return Array.from(q,(w)=>Y(w)??"").join("");return}function I(q,w,G){let Q=w.get($(q.name));if(Q&&Q.length>0)return Q.length===1?Q[0]:Q;if(q.fallback===void 0)return"";return G(q.fallback)}
|
|
2
|
+
export{k as hb,J as ib,x as jb,P as kb,R as lb,f as mb,T as nb,j as ob};
|
|
3
|
+
|
|
4
|
+
//# debugId=072C43197CC7C57F64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core/slot-projection-runtime.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import {\n\tcreateMarkupNodeLike,\n\tisKeyedJsxValue,\n\tisSlotJsxValue,\n\ttype JsxRenderable,\n\ttype KeyedJsxValue,\n\ttype SlotJsxValue,\n\ttype TemplateResultLike,\n} from '@ecopages/jsx';\n\nimport { HYDRATION_ATTRIBUTE } from './hydration-codec';\n\nexport const DEFAULT_SLOT_NAME = '';\nexport const SLOT_PROJECTION_SCRIPT_ATTRIBUTE = 'data-radiant-slot-projection';\n\ntype ResolvedSlotProjection = {\n\tcontainsSlots: boolean;\n\tvalue: JsxRenderable;\n};\n\nexport function captureProjectedSlotRenderables(host: HTMLElement): Map<string, JsxRenderable[]> {\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (isIgnoredProjectedNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tappendProjectedRenderable(projectedContent, getNodeSlotName(node), node);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function deserializeProjectedSlotRenderables(payload: string): Map<string, JsxRenderable[]> {\n\tlet parsedPayload: Record<string, string[]>;\n\n\ttry {\n\t\tparsedPayload = JSON.parse(payload) as Record<string, string[]>;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn('[@ecopages/radiant] Failed to parse slot projection payload:', payload.slice(0, 120));\n\t\t}\n\t\treturn new Map();\n\t}\n\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const [slotName, fragments] of Object.entries(parsedPayload)) {\n\t\tif (!Array.isArray(fragments) || fragments.length === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tprojectedContent.set(\n\t\t\tnormalizeSlotName(slotName),\n\t\t\tfragments.map((fragment) => createMarkupNodeLike(fragment)),\n\t\t);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function collectAuthoredHydrationScriptMarkup(host: HTMLElement): string | undefined {\n\tconst fragments = Array.from(host.childNodes)\n\t\t.filter((node): node is HTMLScriptElement => isHydrationScriptNode(node))\n\t\t.map((node) => renderableToHtmlFragment(node) ?? '')\n\t\t.filter((fragment) => fragment !== '');\n\n\treturn fragments.length > 0 ? fragments.join('') : undefined;\n}\n\nexport function serializeProjectedSlotRenderables(\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): string | undefined {\n\tconst payload: Record<string, string[]> = {};\n\n\tfor (const [slotName, renderables] of projectedContent.entries()) {\n\t\tconst fragments = renderables\n\t\t\t.map((renderable) => renderableToHtmlFragment(renderable))\n\t\t\t.filter((fragment): fragment is string => fragment !== undefined && fragment !== '');\n\n\t\tif (fragments.length > 0) {\n\t\t\tpayload[slotName] = fragments;\n\t\t}\n\t}\n\n\treturn Object.keys(payload).length > 0 ? JSON.stringify(payload) : undefined;\n}\n\nexport function resolveSlotProjection(\n\tvalue: JsxRenderable,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): ResolvedSlotProjection {\n\tlet containsSlots = false;\n\n\tconst resolveValue = (currentValue: JsxRenderable): JsxRenderable => {\n\t\tif (isSlotJsxValue(currentValue)) {\n\t\t\tcontainsSlots = true;\n\t\t\treturn resolveSlotValue(currentValue, projectedContent, resolveValue);\n\t\t}\n\n\t\tif (isKeyedJsxValue(currentValue)) {\n\t\t\treturn cloneKeyedJsxValue(currentValue, resolveValue(currentValue.value));\n\t\t}\n\n\t\tif (isTemplateResultLike(currentValue)) {\n\t\t\treturn {\n\t\t\t\t_$rType$: 1,\n\t\t\t\tstrings: currentValue.strings,\n\t\t\t\tvalues: currentValue.values.map((entry) => resolveValue(entry as JsxRenderable)),\n\t\t\t} satisfies TemplateResultLike;\n\t\t}\n\n\t\tif (isIterableRenderable(currentValue)) {\n\t\t\treturn Array.from(currentValue, (entry) => resolveValue(entry as JsxRenderable));\n\t\t}\n\n\t\treturn currentValue;\n\t};\n\n\tconst resolvedValue = resolveValue(value);\n\n\treturn {\n\t\tcontainsSlots,\n\t\tvalue: resolvedValue,\n\t};\n}\n\nexport function takeSlotProjectionScriptPayload(host: HTMLElement): string | undefined {\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (!isSlotProjectionScriptNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst payload = node.textContent ?? undefined;\n\t\tnode.parentNode?.removeChild(node);\n\t\treturn payload;\n\t}\n\n\treturn undefined;\n}\n\nfunction appendProjectedRenderable(\n\tprojectedContent: Map<string, JsxRenderable[]>,\n\tslotName: string,\n\trenderable: JsxRenderable,\n): void {\n\tconst existingRenderables = projectedContent.get(slotName);\n\n\tif (existingRenderables) {\n\t\texistingRenderables.push(renderable);\n\t\treturn;\n\t}\n\n\tprojectedContent.set(slotName, [renderable]);\n}\n\nfunction cloneKeyedJsxValue(value: KeyedJsxValue, nextValue: JsxRenderable): KeyedJsxValue {\n\treturn {\n\t\t...value,\n\t\tvalue: nextValue,\n\t};\n}\n\nfunction getNodeSlotName(node: Node): string {\n\tif (node instanceof Element) {\n\t\treturn normalizeSlotName(node.getAttribute('slot'));\n\t}\n\n\treturn DEFAULT_SLOT_NAME;\n}\n\nfunction isIterableRenderable(value: JsxRenderable): value is Iterable<JsxRenderable> {\n\treturn typeof value !== 'string' && typeof value === 'object' && value !== null && Symbol.iterator in value;\n}\n\nfunction isSlotProjectionScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(SLOT_PROJECTION_SCRIPT_ATTRIBUTE);\n}\n\nfunction isHydrationScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(HYDRATION_ATTRIBUTE);\n}\n\nfunction isIgnoredProjectedNode(node: Node): boolean {\n\treturn isSlotProjectionScriptNode(node) || isHydrationScriptNode(node);\n}\n\nfunction isTemplateResultLike(value: JsxRenderable): value is TemplateResultLike {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t(value as Partial<TemplateResultLike>)['_$rType$'] === 1 &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).strings) &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).values)\n\t);\n}\n\nfunction normalizeSlotName(name: string | undefined | null): string {\n\treturn name ?? DEFAULT_SLOT_NAME;\n}\n\nfunction renderableToHtmlFragment(renderable: JsxRenderable): string | undefined {\n\tif (renderable === undefined || renderable === null || renderable === false || renderable === true) {\n\t\treturn undefined;\n\t}\n\n\tif (typeof Node !== 'undefined' && renderable instanceof Node) {\n\t\tif (renderable.nodeType === Node.TEXT_NODE) {\n\t\t\treturn renderable.textContent ?? '';\n\t\t}\n\n\t\treturn (renderable as Element).outerHTML ?? renderable.textContent ?? undefined;\n\t}\n\n\tif (isKeyedJsxValue(renderable)) {\n\t\treturn renderableToHtmlFragment(renderable.value);\n\t}\n\n\tif (typeof renderable === 'string' || typeof renderable === 'number' || typeof renderable === 'bigint') {\n\t\treturn String(renderable);\n\t}\n\n\tif (typeof renderable === 'object' && renderable !== null && 'outerHTML' in renderable) {\n\t\treturn typeof renderable.outerHTML === 'string' ? renderable.outerHTML : (renderable.textContent ?? undefined);\n\t}\n\n\tif (isIterableRenderable(renderable)) {\n\t\treturn Array.from(renderable, (entry) => renderableToHtmlFragment(entry as JsxRenderable) ?? '').join('');\n\t}\n\n\treturn undefined;\n}\n\nfunction resolveSlotValue(\n\tvalue: SlotJsxValue,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n\tresolveValue: (value: JsxRenderable) => JsxRenderable,\n): JsxRenderable {\n\tconst assignedContent = projectedContent.get(normalizeSlotName(value.name));\n\n\tif (assignedContent && assignedContent.length > 0) {\n\t\treturn assignedContent.length === 1 ? assignedContent[0] : (assignedContent as JsxRenderable);\n\t}\n\n\tif (value.fallback === undefined) {\n\t\treturn '';\n\t}\n\n\treturn resolveValue(value.fallback);\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "yCAAA,+BACC,qBACA,oBACA,sBASM,IAAM,EAAoB,GACpB,EAAmC,+BAOzC,SAAS,CAA+B,CAAC,EAAiD,CAChG,IAAM,EAAmB,IAAI,IAE7B,QAAW,KAAQ,MAAM,KAAK,EAAK,UAAU,EAAG,CAC/C,GAAI,EAAuB,CAAI,EAC9B,SAGD,EAA0B,EAAkB,EAAgB,CAAI,EAAG,CAAI,EAGxE,OAAO,EAGD,SAAS,CAAmC,CAAC,EAA+C,CAClG,IAAI,EAEJ,GAAI,CACH,EAAgB,KAAK,MAAM,CAAO,EACjC,KAAM,CACP,GAAI,OAAO,QAAY,IACtB,QAAQ,KAAK,+DAAgE,EAAQ,MAAM,EAAG,GAAG,CAAC,EAEnG,OAAO,IAAI,IAGZ,IAAM,EAAmB,IAAI,IAE7B,QAAY,EAAU,KAAc,OAAO,QAAQ,CAAa,EAAG,CAClE,GAAI,CAAC,MAAM,QAAQ,CAAS,GAAK,EAAU,SAAW,EACrD,SAGD,EAAiB,IAChB,EAAkB,CAAQ,EAC1B,EAAU,IAAI,CAAC,IAAa,EAAqB,CAAQ,CAAC,CAC3D,EAGD,OAAO,EA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vE,GAAI,EAAgB,CAAU,EAC7B,OAAO,EAAyB,EAAW,KAAK,EAGjD,GAAI,OAAO,IAAe,UAAY,OAAO,IAAe,UAAY,OAAO,IAAe,SAC7F,OAAO,OAAO,CAAU,EAGzB,GAAI,OAAO,IAAe,UAAY,IAAe,MAAQ,cAAe,EAC3E,OAAO,OAAO,EAAW,YAAc,SAAW,EAAW,UAAa,EAAW,aAAe,OAGrG,GAAI,EAAqB,CAAU,EAClC,OAAO,MAAM,KAAK,EAAY,CAAC,IAAU,EAAyB,CAAsB,GAAK,EAAE,EAAE,KAAK,EAAE,EAGzG,OAGD,SAAS,CAAgB,CACxB,EACA,EACA,EACgB,CAChB,IAAM,EAAkB,EAAiB,IAAI,EAAkB,EAAM,IAAI,CAAC,EAE1E,GAAI,GAAmB,EAAgB,OAAS,EAC/C,OAAO,EAAgB,SAAW,EAAI,EAAgB,GAAM,EAG7D,GAAI,EAAM,WAAa,OACtB,MAAO,GAGR,OAAO,EAAa,EAAM,QAAQ",
|
|
8
|
+
"debugId": "072C43197CC7C57F64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { StandardOrLegacyFieldDecoratorArgs } from '../../types';\nimport type { UnknownContext } from '../types';\nimport { consumeContext as legacyConsumeContext } from './legacy/consume-context';\nimport { consumeContext as standardConsumeContext } from './standard/consume-context';\nimport { fieldDecoratorBridge } from '../../decorators/bridge';\n\n/**\n * Injects the nearest matching context provider onto a decorated field.\n *\n * During SSR the field can be resolved from the active SSR context stack; on\n * the client it falls back to the DOM event-based context channel.\n *\n * @param context Context token to consume from ancestor providers.\n * @returns A standard-or-legacy decorator implementation for the target field.\n */\nexport function consumeContext(context: UnknownContext) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n\t): any {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardConsumeContext(context),\n\t\t\tlegacyConsumeContext(context),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "qIAeO,GAAS,LAAc,CAAC,EAAyB,CACvD,OAAO,QAAS,CACf,EACA,EACM,CACN,OAAO,EACN,EAAuB,CAAO,EAC9B,EAAqB,CAAO,EAC5B,EACA,CACD",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "7CA7CEA5D2B9258D64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{g as F}from"./chunk-3ryr5wx2.js";import{Ta as z,Ua as A}from"./chunk-e0r6ca2g.js";import{Za as D}from"./chunk-9mqtp3js.js";import{renderToString as M}from"@ecopages/jsx/server";import{withServerCustomElementRenderHook as N}from"@ecopages/jsx/server";var O=Symbol.for("@ecopages/jsx.active-ssr-hydrate"),y=new WeakSet;function P(f){return{nodeType:1,outerHTML:G(f,{hydrate:!0})}}function G(f,j={}){return J(f).renderHostToString(j,I(f))}function I(f){let j=f;if(y.has(f))return J(f).getHostAttributes();y.add(f);try{return j.getHostSsrAttributes()}finally{y.delete(f)}}function J(f){let j=f;return new F({constructor:j.constructor,getAuthoredHydrationScriptMarkup:()=>j.getAuthoredHydrationScriptMarkup(),getHydrationBindings:()=>j.getHydrationBindings(),getSlotProjectionScriptTag:()=>j.getSlotProjectionScriptTag(),renderToString:(k)=>j.renderToString(k),getContextProviders:()=>j.getContextProviders(),getReactiveProperties:()=>j.getReactiveProperties(),getReactivePropDefinitions:()=>D(f),getPropertyValue:(k)=>j[k],listAttributeNames:()=>typeof j.getAttributeNames==="function"?j.getAttributeNames():[],getAttributeValue:(k)=>j.getAttribute(k)})}function Q(f){return N(({instance:j})=>{let k=K(j);if(!k?.renderHostToString)return;let q=k.renderHostToString;return{nodeType:1,get outerHTML(){return q({hydrate:U()})}}},f)}function K(f){return f.resolveSsrRenderBridge?.()}function U(){return globalThis[O]===!0}function V(){let f=z();if(f)return f;let j={getHostAttributes:I,renderHost:P,renderHostToString:G,resolveRenderBridge:K,renderView:(k,q={})=>{let L=k;return Q(()=>M(L.resolveTrackedRenderOutput().value,q))}};return A(j),j}V();
|
|
2
|
+
export{V as f};
|
|
3
|
+
|
|
4
|
+
//# debugId=662F75D20A3DD1AA64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/server/radiant-component-ssr-runtime.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { JsxRenderable } from '@ecopages/jsx';\nimport { renderToString as renderJsxToString } from '@ecopages/jsx/server';\nimport { withServerCustomElementRenderHook } from '@ecopages/jsx/server';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { getReactivePropDefinitions } from '../core/reactive-prop-metadata';\nimport { RadiantComponentSsrService } from '../core/radiant-component-ssr';\nimport {\n\tgetRadiantComponentSsrRuntime,\n\tregisterRadiantComponentSsrRuntime,\n\ttype RadiantComponentRenderBridge,\n\ttype RadiantComponentSsrCapable,\n\ttype RadiantComponentSsrRuntime,\n} from '../core/radiant-component-ssr-registry';\nimport type { SsrSerializableContextProvider } from '../context/context-provider';\nimport type { ReactiveProperty } from '../core/radiant-element';\nimport type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';\n\ntype RadiantComponentSsrHostBridge = Record<string, unknown> & {\n\tconstructor: CustomElementConstructor;\n\tgetAttribute(name: string): string | null;\n\tgetAttributeNames?(): string[];\n\tgetAuthoredHydrationScriptMarkup(): string | undefined;\n\tgetContextProviders(): SsrSerializableContextProvider[];\n\tgetHostSsrAttributes(): Record<string, string>;\n\tgetHydrationBindings(): SsrSerializableHydrationBinding[];\n\tgetReactiveProperties(): ReactiveProperty[];\n\tgetSlotProjectionScriptTag(): string | undefined;\n\tresolveTrackedRenderOutput(): { containsSlots: boolean; value: JsxRenderable };\n\trenderToString(options?: RenderToStringOptions): string;\n\tresolveSsrRenderBridge(): RadiantComponentRenderBridge;\n};\n\nconst ACTIVE_SSR_HYDRATE_SYMBOL = Symbol.for('@ecopages/jsx.active-ssr-hydrate');\nconst hostAttributeResolutionInProgress = new WeakSet<object>();\n\n/**\n * Produces a JSX-compatible host preview for a Radiant component.\n *\n * The preview always serializes with hydration enabled because it is intended\n * for shell composition, where nested client islands must preserve hydration\n * markers when embedded into a larger SSR document.\n */\nfunction renderRadiantComponentHost(component: RadiantComponentSsrCapable): JsxRenderable {\n\treturn {\n\t\tnodeType: 1,\n\t\touterHTML: renderRadiantComponentHostToString(component, { hydrate: true }),\n\t};\n}\n\n/**\n * Serializes a Radiant component host through the shared SSR service.\n *\n * This path centralizes host serialization so direct component renders and\n * nested JSX custom-element renders follow the same attribute and hydration\n * rules.\n */\nfunction renderRadiantComponentHostToString(\n\tcomponent: RadiantComponentSsrCapable,\n\toptions: RenderToStringOptions = {},\n): string {\n\treturn createRadiantComponentSsrService(component).renderHostToString(\n\t\toptions,\n\t\tgetRadiantComponentHostSsrAttributes(component),\n\t);\n}\n\n/**\n * Resolves the final host attribute map for a Radiant component.\n *\n * The recursion guard is required because `getHostSsrAttributes()` can itself\n * delegate back into the shared runtime. When that happens, the runtime falls\n * back to the raw SSR service attribute collector for the current call.\n */\nfunction getRadiantComponentHostSsrAttributes(component: RadiantComponentSsrCapable): Record<string, string> {\n\tconst bridge = component as unknown as RadiantComponentSsrHostBridge;\n\n\tif (hostAttributeResolutionInProgress.has(component)) {\n\t\treturn createRadiantComponentSsrService(component).getHostAttributes();\n\t}\n\n\thostAttributeResolutionInProgress.add(component);\n\n\ttry {\n\t\treturn bridge.getHostSsrAttributes();\n\t} finally {\n\t\thostAttributeResolutionInProgress.delete(component);\n\t}\n}\n\n/**\n * Adapts a `RadiantComponent` instance to the older `RadiantComponentSsrService`\n * contract.\n *\n * Keeping this adapter local lets the base class shed its eager SSR service\n * instance while preserving the established host serialization behavior.\n */\nfunction createRadiantComponentSsrService(component: RadiantComponentSsrCapable): RadiantComponentSsrService {\n\tconst bridge = component as unknown as RadiantComponentSsrHostBridge;\n\n\treturn new RadiantComponentSsrService({\n\t\tconstructor: bridge.constructor,\n\t\tgetAuthoredHydrationScriptMarkup: () => bridge.getAuthoredHydrationScriptMarkup(),\n\t\tgetHydrationBindings: () => bridge.getHydrationBindings(),\n\t\tgetSlotProjectionScriptTag: () => bridge.getSlotProjectionScriptTag(),\n\t\trenderToString: (options) => bridge.renderToString(options),\n\t\tgetContextProviders: () => bridge.getContextProviders(),\n\t\tgetReactiveProperties: () => bridge.getReactiveProperties(),\n\t\tgetReactivePropDefinitions: () => getReactivePropDefinitions(component),\n\t\tgetPropertyValue: (name) => bridge[name],\n\t\tlistAttributeNames: () => (typeof bridge.getAttributeNames === 'function' ? bridge.getAttributeNames() : []),\n\t\tgetAttributeValue: (name) => bridge.getAttribute(name),\n\t});\n}\n\n/**\n * Installs a temporary JSX custom-element render hook that understands\n * `RadiantComponent` SSR bridges.\n *\n * This makes nested intrinsic custom-element renders honor explicit host SSR\n * overrides instead of always falling back to the inherited JSX runtime path.\n */\nfunction withRadiantServerCustomElementRenderBridge<T>(render: () => T): T {\n\treturn withServerCustomElementRenderHook(({ instance }) => {\n\t\tconst nestedBridge = resolveRadiantComponentRenderBridge(instance as unknown as RadiantComponentSsrCapable);\n\n\t\tif (!nestedBridge?.renderHostToString) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst renderHostToString = nestedBridge.renderHostToString;\n\n\t\treturn {\n\t\t\tnodeType: 1,\n\t\t\tget outerHTML() {\n\t\t\t\treturn renderHostToString({ hydrate: isActiveSsrHydrateMode() });\n\t\t\t},\n\t\t};\n\t}, render);\n}\n\n/**\n * Resolves the SSR bridge exposed by a component instance, when present.\n */\nfunction resolveRadiantComponentRenderBridge(\n\tcomponent: RadiantComponentSsrCapable,\n): RadiantComponentRenderBridge | undefined {\n\treturn component.resolveSsrRenderBridge?.();\n}\n\n/**\n * Reads the active JSX SSR hydrate flag from `globalThis`.\n *\n * Nested custom-element serialization mirrors the hydrate mode of the current\n * top-level render so host and child markup stay consistent.\n */\nfunction isActiveSsrHydrateMode(): boolean {\n\treturn (globalThis as typeof globalThis & Record<PropertyKey, unknown>)[ACTIVE_SSR_HYDRATE_SYMBOL] === true;\n}\n\n/**\n * Registers the shared Radiant SSR runtime if it is not already present.\n *\n * Server entrypoints call this eagerly so instance SSR methods, nested JSX\n * custom-element SSR, and portable server helpers all share one implementation\n * and one bridge-resolution strategy.\n */\nexport function ensureRadiantComponentSsrRuntimeRegistered() {\n\tconst existingRuntime = getRadiantComponentSsrRuntime();\n\n\tif (existingRuntime) {\n\t\treturn existingRuntime;\n\t}\n\n\tconst runtime: RadiantComponentSsrRuntime = {\n\t\tgetHostAttributes: getRadiantComponentHostSsrAttributes,\n\t\trenderHost: renderRadiantComponentHost,\n\t\trenderHostToString: renderRadiantComponentHostToString,\n\t\tresolveRenderBridge: resolveRadiantComponentRenderBridge,\n\t\trenderView: (component, options = {}) => {\n\t\t\tconst bridge = component as unknown as RadiantComponentSsrHostBridge;\n\n\t\t\treturn withRadiantServerCustomElementRenderBridge(() =>\n\t\t\t\trenderJsxToString(bridge.resolveTrackedRenderOutput().value, options),\n\t\t\t);\n\t\t},\n\t};\n\n\tregisterRadiantComponentSsrRuntime(runtime);\n\treturn runtime;\n}\n\nensureRadiantComponentSsrRuntimeRegistered();\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "8IACA,mBAAS,uBACT,4CAAS,6BA8BT,IAAM,EAA4B,OAAO,IAAI,kCAAkC,EACzE,EAAoC,IAAI,QAS9C,SAAS,CAA0B,CAAC,EAAsD,CACzF,MAAO,CACN,SAAU,EACV,UAAW,EAAmC,EAAW,CAAE,QAAS,EAAK,CAAC,CAC3E,EAUD,SAAS,CAAkC,CAC1C,EACA,EAAiC,CAAC,EACzB,CACT,OAAO,EAAiC,CAAS,EAAE,mB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,EAAsC,CAC3C,kBAAmB,EACnB,WAAY,EACZ,mBAAoB,EACpB,oBAAqB,EACrB,WAAY,CAAC,EAAW,EAAU,CAAC,IAAM,CACxC,IAAM,EAAS,EAEf,OAAO,EAA2C,IACjD,EAAkB,EAAO,2BAA2B,EAAE,MAAO,CAAO,CACrE,EAEF,EAGA,OADA,EAAmC,CAAO,EACnC,EAGR,EAA2C",
|
|
8
|
+
"debugId": "662F75D20A3DD1AA64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var a=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(e){let o=[],n=0;while(n<e.length){let t=n;if(e.startsWith("<!--",n)){let r=e.indexOf("-->",n+4);n=r===-1?e.length:r+3,o.push(e.slice(t,n));continue}if(e[n]!=="<"){let r=e.indexOf("<",n);n=r===-1?e.length:r,o.push(e.slice(t,n));continue}let i=u(e,n);if(!i){o.push(e.slice(t));break}if(i.type!=="open"||i.selfClosing||a.has(i.tagName)){n=i.end,o.push(e.slice(t,n));continue}n=i.end;let c=1;while(n<e.length&&c>0){let r=e.indexOf("<",n);if(r===-1){n=e.length;break}let s=u(e,r);if(!s){n=e.length;break}if(n=s.end,s.type==="comment"||s.type==="declaration")continue;if(s.type==="open"&&!s.selfClosing&&!a.has(s.tagName)){c+=1;continue}if(s.type==="close")c-=1}o.push(e.slice(t,n))}return o.filter((t)=>t!=="")}function l(e,o){let n;for(let t=o+1;t<e.length;t+=1){let i=e[t];if(n){if(i===n)n=void 0;continue}if(i==='"'||i==="'"){n=i;continue}if(i===">")return t+1}return e.length}function p(e){let o={},n=/([:^@A-Za-z0-9_.-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>/]+)))?/g;for(let t of e.matchAll(n)){let[,i,c,r,s]=t;if(!i)continue;o[i]=c??r??s??""}return o}function u(e,o){if(e.startsWith("<!--",o)){let g=e.indexOf("-->",o+4);return{end:g===-1?e.length:g+3,type:"comment"}}let n=l(e,o),t=e.slice(o+1,n-1).trim();if(t==="")return;if(t.startsWith("!")||t.startsWith("?"))return{end:n,type:"declaration"};if(t.startsWith("/"))return{end:n,type:"close"};let i=/\/\s*$/.test(t),c=i?t.replace(/\/\s*$/,"").trim():t,r=c.split(/[\s/>]/,1)[0]?.toLowerCase()??"",s=r.length,f=c.slice(s).trim(),d=i||a.has(r)?"":b(e,o,n,r);return{attributes:p(f),end:n,innerHtml:d,selfClosing:i,tagName:r,type:"open"}}function b(e,o,n,t){let i=n,c=1;while(i<e.length&&c>0){let r=e.indexOf("<",i);if(r===-1)return e.slice(n);let s=u(e,r);if(!s)return e.slice(n);if(s.type==="open"&&s.tagName===t&&!s.selfClosing&&!a.has(t))c+=1;if(s.type==="close"){if(e.slice(r+2,s.end-1).trim().toLowerCase()===t){if(c-=1,c===0)return e.slice(n,r)}}i=s.end}return e.slice(n)}
|
|
2
|
+
export{a as n,x as o,l as p,p as q,u as r,b as s};
|
|
3
|
+
|
|
4
|
+
//# debugId=E71CC61E756A708564756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/server/html-parser.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"export type ParsedHtmlTag = {\n\tattributes: Record<string, string>;\n\tend: number;\n\tinnerHtml: string;\n\tselfClosing: boolean;\n\ttagName: string;\n\ttype: 'open';\n};\n\nexport type ParsedHtmlToken =\n\t| ParsedHtmlTag\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'close';\n\t }\n\t| {\n\t\t\tend: number;\n\t\t\ttype: 'comment' | 'declaration';\n\t };\n\nexport const voidElementNames = new Set([\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n]);\n\nexport function collectTopLevelHtmlFragments(html: string): string[] {\n\tconst fragments: string[] = [];\n\tlet index = 0;\n\n\twhile (index < html.length) {\n\t\tconst fragmentStart = index;\n\n\t\tif (html.startsWith('<!--', index)) {\n\t\t\tconst commentEnd = html.indexOf('-->', index + 4);\n\t\t\tindex = commentEnd === -1 ? html.length : commentEnd + 3;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (html[index] !== '<') {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\t\t\tindex = nextTagIndex === -1 ? html.length : nextTagIndex;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst token = parseHtmlTagToken(html, index);\n\n\t\tif (!token) {\n\t\t\tfragments.push(html.slice(fragmentStart));\n\t\t\tbreak;\n\t\t}\n\n\t\tif (token.type !== 'open' || token.selfClosing || voidElementNames.has(token.tagName)) {\n\t\t\tindex = token.end;\n\t\t\tfragments.push(html.slice(fragmentStart, index));\n\t\t\tcontinue;\n\t\t}\n\n\t\tindex = token.end;\n\t\tlet depth = 1;\n\n\t\twhile (index < html.length && depth > 0) {\n\t\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\t\tif (nextTagIndex === -1) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst nestedToken = parseHtmlTagToken(html, nextTagIndex);\n\n\t\t\tif (!nestedToken) {\n\t\t\t\tindex = html.length;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tindex = nestedToken.end;\n\n\t\t\tif (nestedToken.type === 'comment' || nestedToken.type === 'declaration') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'open' && !nestedToken.selfClosing && !voidElementNames.has(nestedToken.tagName)) {\n\t\t\t\tdepth += 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (nestedToken.type === 'close') {\n\t\t\t\tdepth -= 1;\n\t\t\t}\n\t\t}\n\n\t\tfragments.push(html.slice(fragmentStart, index));\n\t}\n\n\treturn fragments.filter((fragment) => fragment !== '');\n}\n\nexport function findHtmlTagEnd(html: string, startIndex: number): number {\n\tlet quote: '\"' | \"'\" | undefined;\n\n\tfor (let index = startIndex + 1; index < html.length; index += 1) {\n\t\tconst character = html[index];\n\n\t\tif (quote) {\n\t\t\tif (character === quote) {\n\t\t\t\tquote = undefined;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '\"' || character === \"'\") {\n\t\t\tquote = character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (character === '>') {\n\t\t\treturn index + 1;\n\t\t}\n\t}\n\n\treturn html.length;\n}\n\nexport function parseAttributes(rawAttributes: string): Record<string, string> {\n\tconst attributes: Record<string, string> = {};\n\tconst attributePattern = /([:^@A-Za-z0-9_.-]+)(?:\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s\"'>/]+)))?/g;\n\n\tfor (const match of rawAttributes.matchAll(attributePattern)) {\n\t\tconst [, name, doubleQuoted, singleQuoted, bareValue] = match;\n\n\t\tif (!name) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tattributes[name] = doubleQuoted ?? singleQuoted ?? bareValue ?? '';\n\t}\n\n\treturn attributes;\n}\n\nexport function parseHtmlTagToken(html: string, startIndex: number): ParsedHtmlToken | undefined {\n\tif (html.startsWith('<!--', startIndex)) {\n\t\tconst endIndex = html.indexOf('-->', startIndex + 4);\n\t\treturn {\n\t\t\tend: endIndex === -1 ? html.length : endIndex + 3,\n\t\t\ttype: 'comment',\n\t\t};\n\t}\n\n\tconst endIndex = findHtmlTagEnd(html, startIndex);\n\tconst rawToken = html.slice(startIndex + 1, endIndex - 1).trim();\n\n\tif (rawToken === '') {\n\t\treturn undefined;\n\t}\n\n\tif (rawToken.startsWith('!') || rawToken.startsWith('?')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'declaration',\n\t\t};\n\t}\n\n\tif (rawToken.startsWith('/')) {\n\t\treturn {\n\t\t\tend: endIndex,\n\t\t\ttype: 'close',\n\t\t};\n\t}\n\n\tconst selfClosing = /\\/\\s*$/.test(rawToken);\n\tconst tagBody = selfClosing ? rawToken.replace(/\\/\\s*$/, '').trim() : rawToken;\n\tconst tagName = tagBody.split(/[\\s/>]/, 1)[0]?.toLowerCase() ?? '';\n\tconst attributesStart = tagName.length;\n\tconst rawAttributes = tagBody.slice(attributesStart).trim();\n\tconst innerHtml =\n\t\tselfClosing || voidElementNames.has(tagName)\n\t\t\t? ''\n\t\t\t: extractInnerHtmlFragment(html, startIndex, endIndex, tagName);\n\n\treturn {\n\t\tattributes: parseAttributes(rawAttributes),\n\t\tend: endIndex,\n\t\tinnerHtml,\n\t\tselfClosing,\n\t\ttagName,\n\t\ttype: 'open',\n\t};\n}\n\nexport function extractInnerHtmlFragment(\n\thtml: string,\n\tstartIndex: number,\n\ttagEndIndex: number,\n\ttagName: string,\n): string {\n\tlet index = tagEndIndex;\n\tlet depth = 1;\n\n\twhile (index < html.length && depth > 0) {\n\t\tconst nextTagIndex = html.indexOf('<', index);\n\n\t\tif (nextTagIndex === -1) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tconst nextTag = parseHtmlTagToken(html, nextTagIndex);\n\n\t\tif (!nextTag) {\n\t\t\treturn html.slice(tagEndIndex);\n\t\t}\n\n\t\tif (\n\t\t\tnextTag.type === 'open' &&\n\t\t\tnextTag.tagName === tagName &&\n\t\t\t!nextTag.selfClosing &&\n\t\t\t!voidElementNames.has(tagName)\n\t\t) {\n\t\t\tdepth += 1;\n\t\t}\n\n\t\tif (nextTag.type === 'close') {\n\t\t\tconst closingName = html\n\t\t\t\t.slice(nextTagIndex + 2, nextTag.end - 1)\n\t\t\t\t.trim()\n\t\t\t\t.toLowerCase();\n\n\t\t\tif (closingName === tagName) {\n\t\t\t\tdepth -= 1;\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\treturn html.slice(tagEndI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@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { SSR_PREPARATION_RUNNING } from '../../core/ssr-preparation';\n\ntype RequestUpdateCapable = {\n\trequestUpdate(): void;\n};\n\nexport function createContextSelectionDelivery(host: object, apply: (value: unknown) => void, requestUpdate: boolean) {\n\tlet hasDeliveredValue = false;\n\tlet previousValue: unknown;\n\tconst target = host as Record<PropertyKey, unknown>;\n\n\treturn (value: unknown) => {\n\t\tif (target[SSR_PREPARATION_RUNNING] !== true && hasDeliveredValue && Object.is(previousValue, value)) {\n\t\t\treturn;\n\t\t}\n\n\t\thasDeliveredValue = true;\n\t\tpreviousValue = value;\n\t\tapply(value);\n\n\t\tif (requestUpdate && typeof target.requestUpdate === 'function') {\n\t\t\t(target as RequestUpdateCapable).requestUpdate();\n\t\t}\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": "yCAMO,SAAS,CAA8B,CAAC,EAAc,EAAiC,EAAwB,CACrH,IAAI,EAAoB,GACpB,EACE,EAAS,EAEf,MAAO,CAAC,IAAmB,CAC1B,GAAI,EAAO,KAA6B,IAAQ,GAAqB,OAAO,GAAG,EAAe,CAAK,EAClG,OAOD,GAJA,EAAoB,GACpB,EAAgB,EAChB,EAAM,CAAK,EAEP,GAAiB,OAAO,EAAO,gBAAkB,WACnD,EAAgC,cAAc",
|
|
8
|
+
"debugId": "303FD5A078DE1F1664756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{m as
|
|
1
|
+
import{R as i}from"./chunk-21a7jask.js";function m({context:e,initialValue:r,hydrate:d,serialize:a}){return(s,n)=>{let t=String(n.name);n.addInitializer(function(){let o=new i(this,{context:e,hydrationKey:t,initialValue:r,hydrate:d,serialize:a});this[t]=o,this.registerContextProvider(t,o),this.connectedContextCallback(e)})}}
|
|
2
|
+
export{m as y};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=C88335ADB4F5189264756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { RadiantElement } from '../../../core/radiant-element';\nimport { ContextProvider } from '../../context-provider';\nimport type { UnknownContext } from '../../types';\nimport type { ProvideContextOptions } from '../provide-context';\n\nexport function provideContext<T extends UnknownContext>({\n\tcontext,\n\tinitialValue,\n\thydrate,\n\tserialize,\n}: ProvideContextOptions<T>) {\n\treturn <C extends RadiantElement, V>(_: undefined, targetContext: ClassFieldDecoratorContext<C, V>) => {\n\t\tconst contextName = String(targetContext.name);\n\t\ttargetContext.addInitializer(function (this: C) {\n\t\t\tconst provider = new ContextProvider<T>(this, {\n\t\t\t\tcontext,\n\t\t\t\thydrationKey: contextName,\n\t\t\t\tinitialValue,\n\t\t\t\thydrate,\n\t\t\t\tserialize,\n\t\t\t});\n\t\t\t(this as any)[contextName] = provider;\n\t\t\tthis.registerContextProvider(contextName, provider);\n\t\t\tthis.connectedContextCallback(context);\n\t\t});\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "wCAKO,SAAS,CAAwC,EACvD,UACA,eACA,UACA,aAC4B,CAC5B,MAAO,CAA8B,EAAc,IAAoD,CACtG,IAAM,EAAc,OAAO,EAAc,IAAI,EAC7C,EAAc,eAAe,QAAS,EAAU,CAC/C,IAAM,EAAW,IAAI,EAAmB,KAAM,CAC7C,UACA,aAAc,EACd,eACA,UACA,WACD,CAAC,EACA,KAAa,GAAe,EAC7B,KAAK,wBAAwB,EAAa,CAAQ,EAClD,KAAK,yBAAyB,CAAO,EACrC",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "C88335ADB4F5189264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
function P(q){switch(q){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function R(q){switch(typeof q){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(q))return"array";if(Object.prototype.toString.call(q)==="[object Object]")return"object"}function U(q){switch(q){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function W(q){try{return JSON.parse(q)}catch{throw TypeError("Invalid JSON string")}}var X={array(q){let x=W(q);if(!Array.isArray(x))throw TypeError(`Expected an array but got a value of type "${typeof x}"`);return x},boolean(q){return!(q==="0"||String(q).toLowerCase()==="false")},number(q){return Number(q.replace(/_/g,""))},object(q){let x=JSON.parse(q);if(x===null||typeof x!=="object"||Array.isArray(x))throw TypeError(`expected value of type "object" but instead got value "${q}" of type "${R(x)}"`);return x},string(q){return q}},I={default:Q,array:L,object:L};function L(q){return JSON.stringify(q)}function Q(q){return`${q}`}function M(q,x){let z=P(x);if(!z)throw TypeError(`[radiant-element] Unknown type "${x}"`);return X[z](q)}function B(q,x){let z=P(x);if(!z)throw TypeError(`[radiant-element] Unknown type "${x}"`);return(I[z]??I.default??Q)(q)}function Y(q){return typeof q==="boolean"}function Z(q){return typeof q==="number"}function _(q){return typeof q==="string"}function $(q){return Array.isArray(q)}function k(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}function D(q,x){switch(q){case Boolean:return Y(x);case Number:return Z(x);case String:return _(x);case Array:return $(x);case Object:return k(x);default:return!1}}var F=(q,x,z,E)=>{if(x===Boolean){let G=q.getAttribute(z);if(G===null)return E;return G===""?!0:M(G,x)}let H=q.getAttribute(z);return H!==null?M(H,x):E??U(x)};
|
|
2
|
-
export{P as
|
|
2
|
+
export{P as ab,R as bb,U as cb,M as db,B as eb,D as fb,F as gb};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=4A3079E514112AAA64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "AAYO,SAAS,CAA0B,CAAC,EAAkC,C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
8
|
+
"debugId": "4A3079E514112AAA64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
function o(a,t){let n=Symbol(`__${String(t.name)}__value`),i=String(t.name);return t.addInitializer(function(){this.defineReactiveBinding(i,this.shouldAutoBindReactiveMembers?.()??!1),this.registerReactiveDependencyReader(i,()=>this[n]),Object.defineProperty(this,t.name,{get(){return this.trackReactiveRead(i),this[n]},set(e){let r=this[n];if(r!==e)this[n]=e,this.notifyUpdate(i,r,e)},enumerable:!0,configurable:!0})}),function(e){return this[n]=e,e}}
|
|
2
|
-
export{o as
|
|
2
|
+
export{o as La};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=220A061FA1CAD20D64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { RadiantElement } from '../../core/radiant-element';\n\nexport function reactiveField<T extends RadiantElement, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\tconst privatePropertyKey = Symbol(`__${String(context.name)}__value`);\n\n\tconst contextName = String(context.name);\n\n\tcontext.addInitializer(function (this: T) {\n\t\tthis.defineReactiveBinding(contextName, this.shouldAutoBindReactiveMembers?.() ?? false);\n\t\tthis.registerReactiveDependencyReader(\n\t\t\tcontextName,\n\t\t\t() => (this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey],\n\t\t);\n\n\t\tObject.defineProperty(this, context.name, {\n\t\t\tget() {\n\t\t\t\t(this as RadiantElement).trackReactiveRead(contextName);\n\t\t\t\treturn (this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey];\n\t\t\t},\n\t\t\tset(newValue: unknown) {\n\t\t\t\tconst oldValue = (this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey];\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\t(this as unknown as Record<PropertyKey, unknown>)[privatePropertyKey] = newValue;\n\t\t\t\t\t(this as RadiantElement).notifyUpdate(contextName, oldValue, newValue);\n\t\t\t\t}\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\t});\n\n\treturn function (this: T, value: V) {\n\t\t(this as any)[privatePropertyKey] = value;\n\t\treturn value;\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "AAEO,SAAS,CAA0C,CAAC,EAAc,EAA2C,CACnH,IAAM,EAAqB,OAAO,KAAK,OAAO,EAAQ,IAAI,UAAU,EAE9D,EAAc,OAAO,EAAQ,IAAI,EA0BvC,OAxBA,EAAQ,eAAe,QAAS,EAAU,CACzC,KAAK,sBAAsB,EAAa,KAAK,gCAAgC,GAAK,EAAK,EACvF,KAAK,iCACJ,EACA,IAAO,KAAiD,EACzD,EAEA,OAAO,eAAe,KAAM,EAAQ,KAAM,CACzC,GAAG,EAAG,CAEL,OADC,KAAwB,kBAAkB,CAAW,EAC9C,KAAiD,IAE1D,GAAG,CAAC,EAAmB,CACtB,IAAM,EAAY,KAAiD,GACnE,GAAI,IAAa,EACf,KAAiD,GAAsB,EACvE,KAAwB,aAAa,EAAa,EAAU,CAAQ,GAGvE,WAAY,GACZ,aAAc,EACf,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAAa,GAAsB,EAC7B",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "220A061FA1CAD20D64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{i as
|
|
1
|
+
import{zb as n}from"./chunk-wd23rn4q.js";function i(o){return(r)=>{let t=new WeakMap;return function(...u){let e=t.get(this);if(!e)e=n((...c)=>{return r.apply(this,c)},o),t.set(this,e);e(...u)}}}
|
|
2
|
+
export{i as la};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=5EDBD7E888177D3A64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { debounce as debounceFunction } from '../../helpers/debounce';\nimport type { Method } from '../../types';\n\nexport function debounce(timeout: number): Method {\n\treturn <T extends Method>(originalMethod: T): Method => {\n\t\tconst debouncedByInstance = new WeakMap<object, ReturnType<typeof debounceFunction<T>>>();\n\n\t\treturn function (this: object, ...args: Parameters<T>): void {\n\t\t\tlet debounced = debouncedByInstance.get(this);\n\n\t\t\tif (!debounced) {\n\t\t\t\tdebounced = debounceFunction((...innerArgs: Parameters<T>) => {\n\t\t\t\t\treturn originalMethod.apply(this, innerArgs);\n\t\t\t\t}, timeout);\n\t\t\t\tdebouncedByInstance.set(this, debounced);\n\t\t\t}\n\n\t\t\tdebounced(...args);\n\t\t};\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "yCAGO,SAAS,CAAQ,CAAC,EAAyB,CACjD,MAAO,CAAmB,IAA8B,CACvD,IAAM,EAAsB,IAAI,QAEhC,OAAO,QAAS,IAAkB,EAA2B,CAC5D,IAAI,EAAY,EAAoB,IAAI,IAAI,EAE5C,GAAI,CAAC,EACJ,EAAY,EAAiB,IAAI,IAA6B,CAC7D,OAAO,EAAe,MAAM,KAAM,CAAS,GACzC,CAAO,EACV,EAAoB,IAAI,KAAM,CAAS,EAGxC,EAAU,GAAG,CAAI",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "5EDBD7E888177D3A64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{B as
|
|
1
|
+
import{Ma as q}from"./chunk-cnyxrh9r.js";function B(j){return(v,w)=>{q(v,(f)=>{f.registerConnectedCallback(()=>{let p=f[w].bind(f);if(Array.isArray(j))for(let x of j)f.registerUpdateCallback(x,p);else if(typeof j==="string")f.registerUpdateCallback(j,p)})})}}
|
|
2
|
+
export{B as na};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=D031813E5430A1FB64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { RadiantElement } from '../../core/radiant-element';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * A decorator to subscribe to an updated callback when a reactive field or property changes.\n * @param eventConfig The event configuration.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn (target: RadiantElement, methodName: string) => {\n\t\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tconst boundedMethod = (element as any)[methodName].bind(element);\n\t\t\t\tif (Array.isArray(keyOrKeys)) {\n\t\t\t\t\tfor (const key of keyOrKeys) {\n\t\t\t\t\t\telement.registerUpdateCallback(key, boundedMethod);\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof keyOrKeys === 'string') {\n\t\t\t\t\telement.registerUpdateCallback(keyOrKeys, boundedMethod);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "yCAOO,SAAS,CAAS,CAAC,EAA8B,CACvD,MAAO,CAAC,EAAwB,IAAuB,CACtD,EAAkC,EAAQ,CAAC,IAAY,CACtD,EAAQ,0BAA0B,IAAM,CACvC,IAAM,EAAiB,EAAgB,GAAY,KAAK,CAAO,EAC/D,GAAI,MAAM,QAAQ,CAAS,EAC1B,QAAW,KAAO,EACjB,EAAQ,uBAAuB,EAAK,CAAa,EAE5C,QAAI,OAAO,IAAc,SAC/B,EAAQ,uBAAuB,EAAW,CAAa,EAExD,EACD",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "D031813E5430A1FB64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var o=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function s(t,i,r){let n=t.constructor,e=n[o]??[];if(e.some((c)=>c.name===i))return;e.push({name:i,options:r}),n[o]=e}function a(t){return(t.constructor[o]??[]).slice()}
|
|
2
|
-
export{s as
|
|
2
|
+
export{s as Ya,a as Za};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=635174EB742DD32D64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { ReactivePropertyOptions } from './radiant-element';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "AAEA,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,CAA8B,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAc,EAAO,YACrB,EAAc,EAAY,IAA8B,CAAC,EAE/D,GAAI,EAAY,KAAK,CAAC,IAAe,EAAW,OAAS,CAAY,EACpE,OAGD,EAAY,KAAK,CAAE,KAAM,EAAc,SAAQ,CAAC,EAChD,EAAY,GAA6B,EAGnC,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "635174EB742DD32D64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import type { RadiantElement } from '../../core/radiant-element';\nimport { createEventListener } from '../../helpers/create-event-listener';\nimport type { OnEventConfig } from '../on-event';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n *\n * @param eventConfig The event configuration.\n * @param eventConfig.selectors The CSS selector(s) of the target element(s).\n * @param eventConfig.ref The data-ref attribute of the target element.\n * @param eventConfig.type The type of the event to listen for.\n * @param eventConfig.options Optional. An options object that specifies characteristics about the event listener.\n */\nexport function onEvent(eventConfig: OnEventConfig) {\n\treturn (proto: RadiantElement, _: string, descriptor: PropertyDescriptor) => {\n\t\tconst originalMethod = descriptor.value;\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tcreateEventListener(element, eventConfig, originalMethod.bind(element));\n\t\t});\n\n\t\treturn descriptor;\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": "wFAmBO,GAAS,CAAO,CAAC,EAA4B,CACnD,MAAO,CAAC,EAAuB,EAAW,IAAmC,CAC5E,IAAM,EAAiB,EAAW,MAMlC,OAJA,EAAkC,EAAO,CAAC,IAAY,CACrD,EAAoB,EAAS,EAAa,EAAe,KAAK,CAAO,CAAC,EACtE,EAEM",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "63AD6211503C544464756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{R as
|
|
1
|
+
import{Ma as E}from"./chunk-cnyxrh9r.js";import{Ya as G}from"./chunk-9mqtp3js.js";import{fb as F}from"./chunk-66e6s792.js";function R({type:q,attribute:H,reflect:x,defaultValue:h,bind:A}){if(h!==void 0&&!F(q,h))throw Error(`defaultValue does not match the expected type for ${q.name}`);return(w,j)=>{let B=H??j;G(w,j,{type:q,reflect:x,attribute:B,defaultValue:h,bind:A});let C=Symbol.for(`@ecopages/radiant.ssr-prop:${j}`);Object.defineProperty(w,j,{get(){return this[C]??h},set(k){this[C]=k},configurable:!0,enumerable:!0}),E(w,(k)=>{k.registerConnectedCallback(()=>{let J=k[j],M=h===void 0?J:h;k.createReactiveProp(j,{type:q,reflect:x,attribute:B,defaultValue:M,bind:A})})})}}
|
|
2
|
+
export{R as Ca};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=5474F34EDDA8C4B864756E2164756E21
|