@ecopages/radiant 0.2.0 → 0.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +293 -34
- package/dist/chunk-0bswvy25.js +4 -0
- package/dist/chunk-0bswvy25.js.map +10 -0
- package/dist/chunk-0btkzzyc.js +4 -0
- package/dist/chunk-0btkzzyc.js.map +10 -0
- package/dist/chunk-0g0j9re6.js +4 -0
- package/dist/chunk-0g0j9re6.js.map +10 -0
- package/dist/chunk-1x26p09c.js +4 -0
- package/dist/chunk-1x26p09c.js.map +10 -0
- package/dist/chunk-21a7jask.js +4 -0
- package/dist/chunk-21a7jask.js.map +10 -0
- package/dist/chunk-25zjh0kg.js +4 -0
- package/dist/chunk-25zjh0kg.js.map +10 -0
- package/dist/chunk-30x4hggg.js +4 -0
- package/dist/chunk-30x4hggg.js.map +10 -0
- package/dist/chunk-3ryr5wx2.js +4 -0
- package/dist/chunk-3ryr5wx2.js.map +10 -0
- 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-3ynk7e1e.js.map +10 -0
- 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-5bkat72n.js.map +10 -0
- package/dist/chunk-5qeaq3tj.js +4 -0
- package/dist/chunk-5qeaq3tj.js.map +10 -0
- package/dist/chunk-66e6s792.js +4 -0
- package/dist/chunk-66e6s792.js.map +10 -0
- package/dist/chunk-79jg8q67.js +4 -0
- package/dist/chunk-79jg8q67.js.map +10 -0
- package/dist/chunk-8d5ddvvf.js +4 -0
- package/dist/chunk-8d5ddvvf.js.map +10 -0
- package/dist/chunk-8e9fgtbn.js +4 -0
- package/dist/chunk-8e9fgtbn.js.map +10 -0
- package/dist/chunk-9mqtp3js.js +4 -0
- package/dist/chunk-9mqtp3js.js.map +10 -0
- package/dist/chunk-9rj2rwes.js +4 -0
- package/dist/chunk-9rj2rwes.js.map +10 -0
- package/dist/chunk-atms6yrh.js +4 -0
- package/dist/chunk-atms6yrh.js.map +10 -0
- package/dist/chunk-bk2nbmcd.js +4 -0
- package/dist/chunk-bk2nbmcd.js.map +10 -0
- package/dist/chunk-bk6qkvfp.js +4 -0
- package/dist/chunk-bk6qkvfp.js.map +10 -0
- 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-c52qhh0j.js.map +10 -0
- package/dist/chunk-cnyxrh9r.js +4 -0
- package/dist/chunk-cnyxrh9r.js.map +10 -0
- package/dist/chunk-cvz9mrxa.js +4 -0
- package/dist/chunk-cvz9mrxa.js.map +10 -0
- 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-eevw1j2q.js.map +10 -0
- package/dist/chunk-ek664x1c.js +4 -0
- package/dist/chunk-ek664x1c.js.map +10 -0
- package/dist/chunk-eyw14d6y.js +4 -0
- package/dist/chunk-eyw14d6y.js.map +10 -0
- package/dist/chunk-fs4j94bk.js +4 -0
- package/dist/chunk-fs4j94bk.js.map +10 -0
- package/dist/chunk-g2z3mm6b.js +4 -0
- package/dist/chunk-g2z3mm6b.js.map +10 -0
- package/dist/chunk-g5n3m11h.js +4 -0
- package/dist/chunk-g5n3m11h.js.map +10 -0
- package/dist/chunk-gdkte2vd.js +4 -0
- package/dist/chunk-gdkte2vd.js.map +10 -0
- package/dist/chunk-gg74gdpv.js +4 -0
- package/dist/chunk-gg74gdpv.js.map +10 -0
- package/dist/chunk-h9k7crjc.js +4 -0
- package/dist/chunk-h9k7crjc.js.map +10 -0
- package/dist/chunk-hpzgnxgq.js +4 -0
- package/dist/chunk-hpzgnxgq.js.map +10 -0
- 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-hvy4zvcc.js.map +10 -0
- package/dist/chunk-hztr86b4.js +4 -0
- package/dist/chunk-hztr86b4.js.map +10 -0
- package/dist/chunk-j3v7rca5.js +4 -0
- package/dist/chunk-j3v7rca5.js.map +10 -0
- package/dist/chunk-j864sv4w.js +4 -0
- package/dist/chunk-j864sv4w.js.map +10 -0
- package/dist/chunk-jkb2y7c8.js +4 -0
- package/dist/chunk-jkb2y7c8.js.map +10 -0
- package/dist/chunk-kakpjgzf.js +4 -0
- package/dist/chunk-kakpjgzf.js.map +10 -0
- package/dist/chunk-kmebacvv.js +4 -0
- package/dist/chunk-kmebacvv.js.map +10 -0
- package/dist/chunk-knqsm6v3.js +4 -0
- package/dist/chunk-knqsm6v3.js.map +10 -0
- package/dist/chunk-mp2vtrkg.js +4 -0
- package/dist/chunk-mp2vtrkg.js.map +10 -0
- package/dist/chunk-mpsj3cjs.js +4 -0
- package/dist/chunk-mpsj3cjs.js.map +10 -0
- package/dist/chunk-n4p2542b.js +4 -0
- package/dist/chunk-n4p2542b.js.map +10 -0
- package/dist/chunk-nctznxyz.js +4 -0
- package/dist/chunk-nctznxyz.js.map +10 -0
- package/dist/chunk-ndw3hc3v.js +4 -0
- package/dist/chunk-ndw3hc3v.js.map +10 -0
- package/dist/chunk-nnnb6pac.js +4 -0
- package/dist/chunk-nnnb6pac.js.map +10 -0
- package/dist/chunk-nssj2x13.js +4 -0
- package/dist/chunk-nssj2x13.js.map +10 -0
- package/dist/chunk-nvr37vma.js +4 -0
- package/dist/chunk-nvr37vma.js.map +10 -0
- package/dist/chunk-p8k4g99a.js +4 -0
- package/dist/chunk-p8k4g99a.js.map +10 -0
- package/dist/chunk-pkszgjqf.js +4 -0
- package/dist/chunk-pkszgjqf.js.map +10 -0
- package/dist/chunk-q9z6tnzw.js +4 -0
- package/dist/chunk-q9z6tnzw.js.map +10 -0
- package/dist/chunk-qdz5sncz.js +4 -0
- package/dist/chunk-qdz5sncz.js.map +10 -0
- package/dist/chunk-qe0eww1n.js +4 -0
- package/dist/chunk-qe0eww1n.js.map +10 -0
- package/dist/chunk-r33zvvda.js +4 -0
- package/dist/chunk-r33zvvda.js.map +10 -0
- package/dist/chunk-rkh1vkb9.js +4 -0
- package/dist/chunk-rkh1vkb9.js.map +10 -0
- package/dist/chunk-rrg759ht.js +4 -0
- package/dist/chunk-rrg759ht.js.map +10 -0
- package/dist/chunk-s09s5ayx.js +4 -0
- package/dist/chunk-s09s5ayx.js.map +10 -0
- 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-ssnnxzrj.js +4 -0
- package/dist/chunk-ssnnxzrj.js.map +10 -0
- package/dist/chunk-t8xtvgyg.js +4 -0
- package/dist/chunk-t8xtvgyg.js.map +10 -0
- package/dist/chunk-v3ta7hnv.js +4 -0
- package/dist/chunk-v3ta7hnv.js.map +10 -0
- package/dist/chunk-v92hp9g0.js +4 -0
- package/dist/chunk-v92hp9g0.js.map +10 -0
- package/dist/chunk-vgtggzb6.js +4 -0
- package/dist/chunk-vgtggzb6.js.map +9 -0
- package/dist/chunk-vk48hgm4.js +4 -0
- package/dist/chunk-vk48hgm4.js.map +10 -0
- package/dist/chunk-w8s5fnsq.js +4 -0
- package/dist/chunk-w8s5fnsq.js.map +10 -0
- package/dist/chunk-wd23rn4q.js +4 -0
- package/dist/chunk-wd23rn4q.js.map +10 -0
- package/dist/chunk-wds4href.js +4 -0
- package/dist/chunk-wds4href.js.map +10 -0
- package/dist/chunk-wvd1ffe4.js +4 -0
- package/dist/chunk-wvd1ffe4.js.map +10 -0
- package/dist/chunk-wwbjz9k4.js +4 -0
- package/dist/chunk-wwbjz9k4.js.map +10 -0
- package/dist/chunk-x2k0ngpz.js +4 -0
- package/dist/chunk-x2k0ngpz.js.map +10 -0
- package/dist/chunk-x457d0ap.js +4 -0
- package/dist/chunk-x457d0ap.js.map +10 -0
- package/dist/chunk-xbhtzkre.js +4 -0
- package/dist/chunk-xbhtzkre.js.map +10 -0
- package/dist/chunk-y139ycfm.js +4 -0
- package/dist/chunk-y139ycfm.js.map +10 -0
- package/dist/chunk-z9kxfckm.js +4 -0
- package/dist/chunk-z9kxfckm.js.map +10 -0
- 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/client/hydrator.js.map +9 -0
- 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.d.ts +41 -0
- package/dist/context/context-consumer-bootstrap.js +3 -0
- package/dist/context/context-consumer-bootstrap.js.map +9 -0
- package/dist/context/context-consumer-runtime.d.ts +34 -0
- package/dist/context/context-consumer-runtime.js +3 -0
- package/dist/context/context-consumer-runtime.js.map +9 -0
- package/dist/context/context-provider.d.ts +50 -2
- package/dist/context/context-provider.js +2 -3
- package/dist/context/context-provider.js.map +3 -4
- package/dist/context/context-ssr-bridge.d.ts +16 -0
- package/dist/context/context-ssr-bridge.js +3 -0
- package/dist/context/context-ssr-bridge.js.map +9 -0
- package/dist/context/create-context.js +2 -3
- package/dist/context/create-context.js.map +3 -4
- package/dist/context/decorators/consume-context.d.ts +8 -4
- package/dist/context/decorators/consume-context.js +2 -3
- package/dist/context/decorators/consume-context.js.map +3 -4
- package/dist/context/decorators/context-selection-delivery.d.ts +1 -0
- package/dist/context/decorators/context-selection-delivery.js +3 -0
- package/dist/context/decorators/context-selection-delivery.js.map +9 -0
- package/dist/context/decorators/context-selector.d.ts +26 -8
- package/dist/context/decorators/context-selector.js +2 -3
- package/dist/context/decorators/context-selector.js.map +3 -4
- package/dist/context/decorators/legacy/consume-context.d.ts +1 -1
- package/dist/context/decorators/legacy/consume-context.js +2 -3
- package/dist/context/decorators/legacy/consume-context.js.map +3 -4
- package/dist/context/decorators/legacy/context-selector-field.d.ts +8 -0
- package/dist/context/decorators/legacy/context-selector-field.js +3 -0
- package/dist/context/decorators/legacy/context-selector-field.js.map +9 -0
- package/dist/context/decorators/legacy/context-selector.d.ts +3 -3
- package/dist/context/decorators/legacy/context-selector.js +2 -3
- package/dist/context/decorators/legacy/context-selector.js.map +3 -4
- package/dist/context/decorators/legacy/provide-context.d.ts +1 -1
- package/dist/context/decorators/legacy/provide-context.js +2 -3
- package/dist/context/decorators/legacy/provide-context.js.map +3 -4
- package/dist/context/decorators/on-context-update.d.ts +31 -0
- package/dist/context/decorators/on-context-update.js +3 -0
- package/dist/context/decorators/on-context-update.js.map +9 -0
- package/dist/context/decorators/provide-context.d.ts +12 -0
- package/dist/context/decorators/provide-context.js +2 -3
- package/dist/context/decorators/provide-context.js.map +3 -4
- package/dist/context/decorators/standard/consume-context.d.ts +1 -1
- package/dist/context/decorators/standard/consume-context.js +2 -3
- package/dist/context/decorators/standard/consume-context.js.map +3 -4
- package/dist/context/decorators/standard/context-selector-field.d.ts +8 -0
- package/dist/context/decorators/standard/context-selector-field.js +3 -0
- package/dist/context/decorators/standard/context-selector-field.js.map +9 -0
- package/dist/context/decorators/standard/context-selector.d.ts +4 -3
- package/dist/context/decorators/standard/context-selector.js +2 -3
- package/dist/context/decorators/standard/context-selector.js.map +3 -4
- package/dist/context/decorators/standard/provide-context.d.ts +1 -1
- package/dist/context/decorators/standard/provide-context.js +2 -3
- package/dist/context/decorators/standard/provide-context.js.map +3 -4
- package/dist/context/events.js +2 -3
- package/dist/context/events.js.map +3 -4
- package/dist/context/hydration-script.d.ts +13 -0
- package/dist/context/hydration-script.js +3 -0
- package/dist/context/hydration-script.js.map +9 -0
- package/dist/core/custom-element-metadata.d.ts +3 -0
- package/dist/core/custom-element-metadata.js +3 -0
- package/dist/core/custom-element-metadata.js.map +9 -0
- package/dist/core/hydration-codec.d.ts +24 -0
- package/dist/core/hydration-codec.js +3 -0
- package/dist/core/hydration-codec.js.map +9 -0
- 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.d.ts +29 -0
- package/dist/core/radiant-component-ssr.js +3 -0
- package/dist/core/radiant-component-ssr.js.map +9 -0
- package/dist/core/radiant-component.d.ts +113 -0
- package/dist/core/radiant-component.js +3 -0
- package/dist/core/radiant-component.js.map +9 -0
- package/dist/core/radiant-element.d.ts +217 -9
- package/dist/core/radiant-element.js +2 -3
- package/dist/core/radiant-element.js.map +3 -4
- 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.d.ts +10 -0
- package/dist/core/reactive-jsx-value.js +3 -0
- package/dist/core/reactive-jsx-value.js.map +9 -0
- package/dist/core/reactive-prop-metadata.d.ts +7 -0
- package/dist/core/reactive-prop-metadata.js +3 -0
- package/dist/core/reactive-prop-metadata.js.map +9 -0
- package/dist/core/slot-projection-runtime.d.ts +14 -0
- package/dist/core/slot-projection-runtime.js +3 -0
- package/dist/core/slot-projection-runtime.js.map +9 -0
- package/dist/core/ssr-hydration-binding.d.ts +14 -0
- package/dist/core/ssr-hydration-binding.js +2 -0
- package/dist/core/ssr-hydration-binding.js.map +9 -0
- package/dist/core/ssr-preparation.d.ts +18 -0
- package/dist/core/ssr-preparation.js +3 -0
- package/dist/core/ssr-preparation.js.map +9 -0
- package/dist/decorators/bound.js +2 -2
- package/dist/decorators/bound.js.map +3 -4
- package/dist/decorators/bridge.d.ts +8 -0
- package/dist/decorators/bridge.js +3 -0
- package/dist/decorators/bridge.js.map +9 -0
- package/dist/decorators/custom-element.js +2 -3
- package/dist/decorators/custom-element.js.map +3 -4
- package/dist/decorators/debounce.js +2 -2
- package/dist/decorators/debounce.js.map +3 -4
- package/dist/decorators/event.js +2 -3
- package/dist/decorators/event.js.map +3 -4
- package/dist/decorators/legacy/bound.js +2 -3
- package/dist/decorators/legacy/bound.js.map +3 -4
- package/dist/decorators/legacy/custom-element.js +2 -3
- package/dist/decorators/legacy/custom-element.js.map +3 -4
- package/dist/decorators/legacy/debounce.js +2 -3
- package/dist/decorators/legacy/debounce.js.map +3 -4
- package/dist/decorators/legacy/event.d.ts +1 -1
- package/dist/decorators/legacy/event.js +2 -2
- package/dist/decorators/legacy/event.js.map +3 -4
- package/dist/decorators/legacy/instance-initializers.d.ts +17 -0
- package/dist/decorators/legacy/instance-initializers.js +3 -0
- package/dist/decorators/legacy/instance-initializers.js.map +9 -0
- package/dist/decorators/legacy/on-event.d.ts +2 -11
- package/dist/decorators/legacy/on-event.js +2 -3
- package/dist/decorators/legacy/on-event.js.map +3 -4
- package/dist/decorators/legacy/on-updated.js +2 -3
- package/dist/decorators/legacy/on-updated.js.map +3 -4
- package/dist/decorators/legacy/query-slot.d.ts +3 -0
- package/dist/decorators/legacy/query-slot.js +3 -0
- package/dist/decorators/legacy/query-slot.js.map +9 -0
- package/dist/decorators/legacy/query.js +2 -3
- package/dist/decorators/legacy/query.js.map +3 -4
- package/dist/decorators/legacy/reactive-field.js +2 -3
- package/dist/decorators/legacy/reactive-field.js.map +3 -4
- package/dist/decorators/legacy/reactive-prop.d.ts +2 -1
- package/dist/decorators/legacy/reactive-prop.js +2 -3
- package/dist/decorators/legacy/reactive-prop.js.map +3 -4
- package/dist/decorators/legacy/signal.d.ts +10 -0
- package/dist/decorators/legacy/signal.js +3 -0
- package/dist/decorators/legacy/signal.js.map +9 -0
- package/dist/decorators/on-event.d.ts +3 -11
- package/dist/decorators/on-event.js +2 -3
- package/dist/decorators/on-event.js.map +3 -4
- package/dist/decorators/on-updated.js +2 -3
- package/dist/decorators/on-updated.js.map +3 -4
- package/dist/decorators/prop.d.ts +14 -0
- package/dist/decorators/prop.js +3 -0
- package/dist/decorators/prop.js.map +9 -0
- package/dist/decorators/query-slot.d.ts +13 -0
- package/dist/decorators/query-slot.js +3 -0
- package/dist/decorators/query-slot.js.map +9 -0
- package/dist/decorators/query.d.ts +4 -13
- package/dist/decorators/query.js +2 -3
- package/dist/decorators/query.js.map +3 -4
- package/dist/decorators/signal.d.ts +23 -0
- package/dist/decorators/signal.js +3 -0
- package/dist/decorators/signal.js.map +9 -0
- package/dist/decorators/standard/bound.js +2 -3
- package/dist/decorators/standard/bound.js.map +3 -4
- package/dist/decorators/standard/custom-element.js +2 -3
- package/dist/decorators/standard/custom-element.js.map +3 -4
- package/dist/decorators/standard/debounce.js +2 -3
- package/dist/decorators/standard/debounce.js.map +3 -4
- package/dist/decorators/standard/event.d.ts +1 -1
- package/dist/decorators/standard/event.js +2 -3
- package/dist/decorators/standard/event.js.map +3 -4
- package/dist/decorators/standard/on-event.d.ts +1 -11
- package/dist/decorators/standard/on-event.js +2 -3
- package/dist/decorators/standard/on-event.js.map +3 -4
- package/dist/decorators/standard/on-updated.js +2 -3
- package/dist/decorators/standard/on-updated.js.map +3 -4
- package/dist/decorators/standard/query-slot.d.ts +8 -0
- package/dist/decorators/standard/query-slot.js +3 -0
- package/dist/decorators/standard/query-slot.js.map +9 -0
- package/dist/decorators/standard/query.js +2 -3
- package/dist/decorators/standard/query.js.map +3 -4
- package/dist/decorators/standard/reactive-field.js +2 -3
- package/dist/decorators/standard/reactive-field.js.map +3 -4
- package/dist/decorators/standard/reactive-prop.d.ts +1 -1
- package/dist/decorators/standard/reactive-prop.js +2 -3
- package/dist/decorators/standard/reactive-prop.js.map +3 -4
- package/dist/decorators/standard/signal.d.ts +33 -0
- package/dist/decorators/standard/signal.js +3 -0
- package/dist/decorators/standard/signal.js.map +9 -0
- package/dist/decorators/state.d.ts +11 -0
- package/dist/decorators/state.js +3 -0
- package/dist/decorators/state.js.map +9 -0
- package/dist/helpers/create-event-listener.d.ts +28 -0
- package/dist/helpers/create-event-listener.js +3 -0
- package/dist/helpers/create-event-listener.js.map +9 -0
- package/dist/helpers/create-event.d.ts +9 -0
- package/dist/helpers/create-event.js +3 -0
- package/dist/helpers/create-event.js.map +9 -0
- package/dist/helpers/create-query-slot.d.ts +20 -0
- package/dist/helpers/create-query-slot.js +3 -0
- package/dist/helpers/create-query-slot.js.map +9 -0
- package/dist/helpers/create-query.d.ts +27 -0
- package/dist/helpers/create-query.js +3 -0
- package/dist/helpers/create-query.js.map +9 -0
- package/dist/helpers/debounce.d.ts +39 -0
- package/dist/helpers/debounce.js +3 -0
- package/dist/helpers/debounce.js.map +9 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.js +3 -0
- package/dist/{mixins → helpers}/index.js.map +1 -1
- package/dist/index.d.ts +13 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/server/context-ssr.d.ts +27 -0
- package/dist/server/context-ssr.js +3 -0
- package/dist/server/context-ssr.js.map +9 -0
- 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.d.ts +1 -0
- package/dist/server/install-light-dom-shim.js +3 -0
- package/dist/server/install-light-dom-shim.js.map +10 -0
- package/dist/server/light-dom-shim.d.ts +53 -0
- package/dist/server/light-dom-shim.js +3 -0
- package/dist/server/light-dom-shim.js.map +9 -0
- package/dist/server/project-root.d.ts +20 -0
- package/dist/server/project-root.js +3 -0
- package/dist/server/project-root.js.map +11 -0
- 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 +195 -0
- package/dist/server/render-component.js +3 -0
- package/dist/server/render-component.js.map +10 -0
- 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.d.ts +59 -0
- package/dist/signals/host-resource.js +3 -0
- package/dist/signals/host-resource.js.map +10 -0
- package/dist/signals/host-signal.d.ts +45 -0
- package/dist/signals/host-signal.js +3 -0
- package/dist/signals/host-signal.js.map +9 -0
- package/dist/signals/hydration-script.d.ts +7 -0
- package/dist/signals/hydration-script.js +3 -0
- package/dist/signals/hydration-script.js.map +9 -0
- package/dist/tools/escape-script-json.d.ts +5 -0
- package/dist/tools/escape-script-json.js +3 -0
- package/dist/tools/escape-script-json.js.map +9 -0
- package/dist/tools/event-emitter.js +2 -3
- package/dist/tools/event-emitter.js.map +3 -4
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +2 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/render-jsx-template.d.ts +5 -0
- package/dist/tools/render-jsx-template.js +3 -0
- package/dist/tools/render-jsx-template.js.map +9 -0
- package/dist/tools/stringify-typed.d.ts +4 -6
- package/dist/tools/stringify-typed.js +2 -3
- package/dist/tools/stringify-typed.js.map +3 -4
- package/dist/types.d.ts +0 -21
- package/dist/types.js +2 -2
- package/dist/types.js.map +3 -3
- package/dist/utils/attribute-utils.js +2 -3
- package/dist/utils/attribute-utils.js.map +3 -4
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +106 -21
- package/size-budget.json +16 -0
- package/dist/decorators/reactive-field.d.ts +0 -6
- package/dist/decorators/reactive-field.js +0 -4
- package/dist/decorators/reactive-field.js.map +0 -10
- package/dist/decorators/reactive-prop.d.ts +0 -8
- package/dist/decorators/reactive-prop.js +0 -4
- package/dist/decorators/reactive-prop.js.map +0 -10
- package/dist/mixins/index.d.ts +0 -1
- package/dist/mixins/index.js +0 -3
- package/dist/mixins/with-kita.d.ts +0 -15
- package/dist/mixins/with-kita.js +0 -4
- package/dist/mixins/with-kita.js.map +0 -10
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
import type { RenderToStringOptions } from '@ecopages/jsx/server';
|
|
3
|
+
import type { SsrSerializableContextProvider } from '../context/context-provider';
|
|
4
|
+
import type { ReactiveProperty } from './radiant-element';
|
|
5
|
+
import type { ReactivePropDefinition } from './reactive-prop-metadata';
|
|
6
|
+
import type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';
|
|
7
|
+
type RadiantComponentSsrHost = {
|
|
8
|
+
constructor: CustomElementConstructor;
|
|
9
|
+
getAuthoredHydrationScriptMarkup?: () => string | undefined;
|
|
10
|
+
getContextProviders: () => SsrSerializableContextProvider[];
|
|
11
|
+
getHydrationBindings: () => SsrSerializableHydrationBinding[];
|
|
12
|
+
getSlotProjectionScriptTag?: () => string | undefined;
|
|
13
|
+
renderToString: (options?: RenderToStringOptions) => string;
|
|
14
|
+
getReactiveProperties: () => ReactiveProperty[];
|
|
15
|
+
getReactivePropDefinitions: () => ReactivePropDefinition[];
|
|
16
|
+
getPropertyValue: (name: string) => unknown;
|
|
17
|
+
listAttributeNames: () => string[];
|
|
18
|
+
getAttributeValue: (name: string) => string | null;
|
|
19
|
+
};
|
|
20
|
+
export declare class RadiantComponentSsrService {
|
|
21
|
+
private readonly host;
|
|
22
|
+
constructor(host: RadiantComponentSsrHost);
|
|
23
|
+
renderHost(): JsxRenderable;
|
|
24
|
+
renderHostToString(options?: RenderToStringOptions, attributes?: Record<string, string>): string;
|
|
25
|
+
private renderHostContent;
|
|
26
|
+
getHostAttributes(): Record<string, string>;
|
|
27
|
+
private getTagName;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { type JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
import type { RenderToStringOptions } from '@ecopages/jsx/server';
|
|
3
|
+
import { RadiantElement } from './radiant-element';
|
|
4
|
+
import { type RadiantComponentRenderBridge } from './radiant-component-ssr-registry';
|
|
5
|
+
/**
|
|
6
|
+
* A structured JSX-first Radiant base class.
|
|
7
|
+
* @typeParam Bindings - Explicit internal bindable shape. Include only the
|
|
8
|
+
* prop/state keys that JSX bindings should accept.
|
|
9
|
+
*
|
|
10
|
+
* Treat this as the component's internal reactive/bindable surface, not as the
|
|
11
|
+
* default public custom-element attribute contract. When a component exposes a
|
|
12
|
+
* narrower external API than its internal state, declare a separate public
|
|
13
|
+
* props type for the JSX intrinsic element and keep internal-only state out of
|
|
14
|
+
* that contract.
|
|
15
|
+
*
|
|
16
|
+
* Reusing the same type for both is fine only when the public props and the
|
|
17
|
+
* bindable reactive members are intentionally the same surface.
|
|
18
|
+
*
|
|
19
|
+
* - `render()` describes the view.
|
|
20
|
+
* - `update()` commits the current view into the host.
|
|
21
|
+
* - first render happens automatically on connect.
|
|
22
|
+
* - plain `@prop`, `@state`, and `@signal` reads performed during `render()`
|
|
23
|
+
* participate in tracked rerender invalidation.
|
|
24
|
+
* - `update()` and `requestUpdate()` remain available when a rerender should be
|
|
25
|
+
* scheduled from imperative work outside those tracked reads.
|
|
26
|
+
*/
|
|
27
|
+
export declare class RadiantComponent<Bindings extends object = {}> extends RadiantElement<Bindings> {
|
|
28
|
+
private isRendering;
|
|
29
|
+
private isFirstConnectPending;
|
|
30
|
+
private isRenderScheduled;
|
|
31
|
+
private needsRender;
|
|
32
|
+
private projectedSlotContent;
|
|
33
|
+
private renderSignal?;
|
|
34
|
+
private readonly renderWatcher;
|
|
35
|
+
private slotProjectionObserver?;
|
|
36
|
+
private slotProjectionVersion;
|
|
37
|
+
connectedCallback(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the current component view.
|
|
40
|
+
*
|
|
41
|
+
* The base implementation behaves like `<slot />`, so authored host children
|
|
42
|
+
* pass through unchanged when a subclass does not override `render()`.
|
|
43
|
+
*/
|
|
44
|
+
render(): JsxRenderable;
|
|
45
|
+
/**
|
|
46
|
+
* Serializes the current component view into HTML.
|
|
47
|
+
*/
|
|
48
|
+
renderToString(options?: RenderToStringOptions): string;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the component host and current view as a JSX element.
|
|
51
|
+
*/
|
|
52
|
+
renderHost(): JsxRenderable;
|
|
53
|
+
/**
|
|
54
|
+
* Serializes the component host and current view into HTML.
|
|
55
|
+
*/
|
|
56
|
+
renderHostToString(options?: RenderToStringOptions): string;
|
|
57
|
+
/**
|
|
58
|
+
* Hydrates an SSR-rendered component view in place.
|
|
59
|
+
*/
|
|
60
|
+
hydrate(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Queues a component rerender and coalesces repeated requests into the same
|
|
63
|
+
* microtask.
|
|
64
|
+
*
|
|
65
|
+
* Use this when reactive state may change multiple times in the same turn and
|
|
66
|
+
* the current view should refresh once with the final values.
|
|
67
|
+
*/
|
|
68
|
+
requestUpdate(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Explicitly rerenders the component into its host.
|
|
71
|
+
*/
|
|
72
|
+
update(): void;
|
|
73
|
+
disconnectedCallback(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the first projected element assigned to the default or named slot.
|
|
76
|
+
*
|
|
77
|
+
* Use this when component logic needs direct access to authored light-DOM
|
|
78
|
+
* content after projection.
|
|
79
|
+
*
|
|
80
|
+
* @param name Optional slot name. Omit for the default slot.
|
|
81
|
+
*/
|
|
82
|
+
getSlotElement<T extends Element = Element>(name?: string): T | null;
|
|
83
|
+
/**
|
|
84
|
+
* Returns all projected elements assigned to the default or named slot.
|
|
85
|
+
*
|
|
86
|
+
* Text nodes are intentionally excluded so the result matches the element-
|
|
87
|
+
* oriented query semantics used by Radiant decorators.
|
|
88
|
+
*
|
|
89
|
+
* @param name Optional slot name. Omit for the default slot.
|
|
90
|
+
*/
|
|
91
|
+
getSlotElements<T extends Element = Element>(name?: string): T[];
|
|
92
|
+
protected shouldAutoBindReactiveMembers(): boolean;
|
|
93
|
+
protected getHostSsrAttributes(): Record<string, string>;
|
|
94
|
+
/**
|
|
95
|
+
* Exposes the inherited SSR helper path to internal server renderers.
|
|
96
|
+
*
|
|
97
|
+
* The bridge is intentionally empty when a subclass overrides the host SSR
|
|
98
|
+
* methods so that custom host serialization remains the source of truth.
|
|
99
|
+
*/
|
|
100
|
+
protected resolveSsrRenderBridge(): RadiantComponentRenderBridge;
|
|
101
|
+
private ensureSlotProjectionState;
|
|
102
|
+
private getHostChildNodeCount;
|
|
103
|
+
private getSlotProjectionScriptTag;
|
|
104
|
+
private getAuthoredHydrationScriptMarkup;
|
|
105
|
+
private handleSlotProjectionMutations;
|
|
106
|
+
private addProjectedSlotNode;
|
|
107
|
+
private removeProjectedSlotNode;
|
|
108
|
+
private observeSlotProjection;
|
|
109
|
+
private disconnectSlotProjectionObserver;
|
|
110
|
+
private disconnectRenderWatcher;
|
|
111
|
+
private resolveTrackedRenderOutput;
|
|
112
|
+
private resolveRenderOutput;
|
|
113
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{P as a}from"../chunk-s5p5z3z4.js";import"../chunk-gdkte2vd.js";import"../chunk-eyw14d6y.js";import"../chunk-cnyxrh9r.js";import"../chunk-gg74gdpv.js";import"../chunk-e0r6ca2g.js";import"../chunk-66e6s792.js";import"../chunk-3xxvmd5c.js";import"../chunk-hpzgnxgq.js";import"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";export{a as RadiantComponent};
|
|
2
|
+
|
|
3
|
+
//# debugId=51A938E8D704D2E664756E2164756E21
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { EventEmitter } from '../tools';
|
|
2
|
+
import { type JsxRenderable, type SubscribableJsxValue } from '@ecopages/jsx';
|
|
3
|
+
import type { SsrSerializableContextProvider } from '../context/context-provider';
|
|
2
4
|
import type { UnknownContext } from '../context/types';
|
|
5
|
+
import type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';
|
|
3
6
|
import { type AttributeTypeConstant, type ReadAttributeValueReturnType, type WriteAttributeValueReturnType } from '../utils/attribute-utils';
|
|
7
|
+
declare const RadiantElementBase: {
|
|
8
|
+
new (): HTMLElement;
|
|
9
|
+
prototype: HTMLElement;
|
|
10
|
+
};
|
|
11
|
+
type ReactiveDependencyReader = () => unknown;
|
|
4
12
|
/**
|
|
5
13
|
* Possible positions to insert a rendered template.
|
|
6
14
|
*/
|
|
@@ -36,16 +44,74 @@ export type ReactivePropertyOptions<T> = {
|
|
|
36
44
|
reflect?: boolean;
|
|
37
45
|
attribute?: string;
|
|
38
46
|
defaultValue?: T;
|
|
47
|
+
/**
|
|
48
|
+
* Exposes a JSX binding companion for the reactive property.
|
|
49
|
+
*
|
|
50
|
+
* - `true` creates a `$propertyName` accessor.
|
|
51
|
+
* - a string creates a custom accessor with that name.
|
|
52
|
+
* - `undefined` defers to the host default.
|
|
53
|
+
*
|
|
54
|
+
* The generated accessor returns a subscribable JSX child value so JSX can
|
|
55
|
+
* patch only the affected child part when the property changes.
|
|
56
|
+
*/
|
|
57
|
+
bind?: boolean | string;
|
|
58
|
+
};
|
|
59
|
+
export type ReactiveBindingOption = boolean | string;
|
|
60
|
+
export type ReactiveFieldOptions = {
|
|
61
|
+
/**
|
|
62
|
+
* Exposes a JSX binding companion for the reactive field.
|
|
63
|
+
*
|
|
64
|
+
* - `true` creates a `$fieldName` accessor.
|
|
65
|
+
* - a string creates a custom accessor with that name.
|
|
66
|
+
* - `undefined` defers to the host default.
|
|
67
|
+
*/
|
|
68
|
+
bind?: ReactiveBindingOption;
|
|
39
69
|
};
|
|
40
70
|
export type ReactiveField<T = unknown> = {
|
|
41
71
|
name: string;
|
|
42
72
|
value: T;
|
|
43
73
|
initialValue: T;
|
|
44
74
|
};
|
|
75
|
+
type StringPropertyKey<Value> = Extract<keyof Value, string>;
|
|
76
|
+
/**
|
|
77
|
+
* Value type produced by a JSX binding for a selected reactive member.
|
|
78
|
+
*
|
|
79
|
+
* Bindings preserve the original property type when it is already renderable by
|
|
80
|
+
* the Ecopages JSX runtime. For non-renderable values, the binding falls back
|
|
81
|
+
* to the broader `JsxRenderable` contract consumed by the renderer.
|
|
82
|
+
*/
|
|
83
|
+
export type ReactiveBindingValue<Host extends object, Property extends StringPropertyKey<Host>> = Host[Property] extends JsxRenderable ? Host[Property] : JsxRenderable;
|
|
84
|
+
/**
|
|
85
|
+
* Namespace of cached JSX bindings keyed by the explicit bindable shape.
|
|
86
|
+
*
|
|
87
|
+
* Radiant exposes this namespace twice on every host:
|
|
88
|
+
*
|
|
89
|
+
* - `host.bindings.key` for the explicit form
|
|
90
|
+
* - `host.$.key` for the short form
|
|
91
|
+
*
|
|
92
|
+
* Both aliases resolve through the same cached binding objects as
|
|
93
|
+
* `host.bind('key')`.
|
|
94
|
+
*/
|
|
95
|
+
export type ReactiveBindings<Bindings extends object> = {
|
|
96
|
+
readonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
|
|
97
|
+
};
|
|
45
98
|
/**
|
|
46
99
|
* Represents an interface for a Radiant element.
|
|
100
|
+
* @typeParam Bindings - Explicit internal bindable shape used to type `bind()` and `getReactiveBinding()`.
|
|
101
|
+
*
|
|
102
|
+
* This shape describes which reactive members are exposed through `bindings`,
|
|
103
|
+
* `$`, and `bind(...)`. It does not automatically define the public JSX
|
|
104
|
+
* attribute contract for the custom element.
|
|
47
105
|
*/
|
|
48
|
-
export interface IRadiantElement {
|
|
106
|
+
export interface IRadiantElement<Bindings extends object = {}> {
|
|
107
|
+
/**
|
|
108
|
+
* Namespace of cached JSX bindings keyed by the explicit bindable shape.
|
|
109
|
+
*/
|
|
110
|
+
readonly bindings: ReactiveBindings<Bindings>;
|
|
111
|
+
/**
|
|
112
|
+
* Short alias for {@link bindings}.
|
|
113
|
+
*/
|
|
114
|
+
readonly $: ReactiveBindings<Bindings>;
|
|
49
115
|
/**
|
|
50
116
|
* Called when a property of the element is updated.
|
|
51
117
|
* @param changedProperty - The name of the changed property.
|
|
@@ -58,6 +124,33 @@ export interface IRadiantElement {
|
|
|
58
124
|
* @param event - The event listener to subscribe to.
|
|
59
125
|
*/
|
|
60
126
|
subscribeEvent(event: RadiantElementEventListener): void;
|
|
127
|
+
/**
|
|
128
|
+
* Registers a callback to be invoked when a reactive property or field changes.
|
|
129
|
+
*
|
|
130
|
+
* @returns A cleanup function that unregisters the callback.
|
|
131
|
+
*/
|
|
132
|
+
registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void;
|
|
133
|
+
/**
|
|
134
|
+
* Returns a subscribable JSX child binding for a reactive property or field.
|
|
135
|
+
*
|
|
136
|
+
* Prefer `this.bindings.key` or `this.$.key` in JSX render code when you want
|
|
137
|
+
* property access syntax without string literals.
|
|
138
|
+
*/
|
|
139
|
+
bind<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
|
|
140
|
+
/**
|
|
141
|
+
* Returns a subscribable JSX child binding for a reactive property or field.
|
|
142
|
+
*
|
|
143
|
+
* This is the primitive lookup used by `bind()`, `bindings.key`, and `$.key`.
|
|
144
|
+
*/
|
|
145
|
+
getReactiveBinding<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
|
|
146
|
+
/**
|
|
147
|
+
* Defines a stable JSX binding companion accessor for a reactive member.
|
|
148
|
+
*
|
|
149
|
+
* Companion bindings create properties such as `$count` directly on the host.
|
|
150
|
+
* Prefer the `bindings` or `$` namespace for new code when you want typed,
|
|
151
|
+
* explicit access to the configured bindable shape.
|
|
152
|
+
*/
|
|
153
|
+
defineReactiveBinding(property: string, bind?: ReactiveBindingOption): void;
|
|
61
154
|
/**
|
|
62
155
|
* Subscribes to multiple Radiant element events.
|
|
63
156
|
* @param events - The array of event listeners to subscribe to.
|
|
@@ -68,16 +161,42 @@ export interface IRadiantElement {
|
|
|
68
161
|
*/
|
|
69
162
|
registerCleanupCallback(callback: () => void): void;
|
|
70
163
|
/**
|
|
71
|
-
*
|
|
164
|
+
* Registers a callback to run on each future host connection.
|
|
165
|
+
*
|
|
166
|
+
* The callback is only invoked from `connectedCallback()`. Registering it
|
|
167
|
+
* after the host is already connected does not invoke it immediately.
|
|
168
|
+
*/
|
|
169
|
+
registerConnectedCallback(callback: () => void): void;
|
|
170
|
+
/**
|
|
171
|
+
* Registers a raw value reader for a reactive member so that tracked render
|
|
172
|
+
* dependencies can read the underlying value without triggering the public
|
|
173
|
+
* getter's dependency tracking.
|
|
174
|
+
*/
|
|
175
|
+
registerReactiveDependencyReader(property: string, read: () => unknown): void;
|
|
176
|
+
/**
|
|
177
|
+
* Records a tracked read of a reactive member during a component render,
|
|
178
|
+
* allowing the signals runtime to re-render only the affected parts.
|
|
179
|
+
*/
|
|
180
|
+
trackReactiveRead(property: string): void;
|
|
181
|
+
/**
|
|
182
|
+
* Renders a trusted HTML template string into the specified target element.
|
|
183
|
+
*
|
|
184
|
+
* **Security:** The `template` string is written to the DOM via `innerHTML`
|
|
185
|
+
* or `insertAdjacentHTML` without built-in sanitization. Callers are
|
|
186
|
+
* responsible for ensuring the input is trusted. Supply a `sanitize`
|
|
187
|
+
* function to transform the template before insertion.
|
|
188
|
+
*
|
|
72
189
|
* @param options - The rendering options.
|
|
73
190
|
* @param options.target - The target element to render the template into.
|
|
74
191
|
* @param options.template - The template string to render.
|
|
75
192
|
* @param options.insert - The position to insert the rendered template. (optional)
|
|
193
|
+
* @param options.sanitize - An optional function that transforms the template string before insertion.
|
|
76
194
|
*/
|
|
77
195
|
renderTemplate(options: {
|
|
78
196
|
target: HTMLElement;
|
|
79
197
|
template: string;
|
|
80
198
|
insert?: RenderInsertPosition;
|
|
199
|
+
sanitize?: (html: string) => string;
|
|
81
200
|
}): void;
|
|
82
201
|
/**
|
|
83
202
|
* Called when the Radiant element is connected to a context.
|
|
@@ -90,14 +209,24 @@ export interface IRadiantElement {
|
|
|
90
209
|
* @param all - Whether to get all elements with the specified data-ref attribute value.
|
|
91
210
|
* @returns The element with the specified data-ref attribute value, an array of elements or null if no element was found.
|
|
92
211
|
*/
|
|
93
|
-
getRef<T extends Element = Element>(ref: string, all:
|
|
212
|
+
getRef<T extends Element = Element>(ref: string, all: true): T[];
|
|
213
|
+
getRef<T extends Element = Element>(ref: string, all?: false): T | null;
|
|
94
214
|
}
|
|
95
215
|
/**
|
|
96
216
|
* A base class for creating custom elements with reactive properties and event subscriptions.
|
|
217
|
+
* @typeParam Bindings - Explicit internal bindable shape. Include only the
|
|
218
|
+
* prop/state keys that JSX bindings should accept.
|
|
219
|
+
*
|
|
220
|
+
* Prefer a separate public props type for custom-element JSX declarations when
|
|
221
|
+
* the external attribute contract differs from the component's internal
|
|
222
|
+
* reactive state. Reuse the same type only when the public props and bindable
|
|
223
|
+
* members are intentionally identical.
|
|
97
224
|
* @extends HTMLElement
|
|
98
|
-
* @implements IRadiantElement
|
|
225
|
+
* @implements IRadiantElement<Bindings>
|
|
99
226
|
*/
|
|
100
|
-
export declare class RadiantElement extends
|
|
227
|
+
export declare class RadiantElement<Bindings extends object = {}> extends RadiantElementBase implements IRadiantElement<Bindings> {
|
|
228
|
+
readonly bindings: ReactiveBindings<Bindings>;
|
|
229
|
+
readonly $: ReactiveBindings<Bindings>;
|
|
101
230
|
/**
|
|
102
231
|
* A map of property metadata objects, it contains useful information about the properties configured via decorators.
|
|
103
232
|
*/
|
|
@@ -106,6 +235,28 @@ export declare class RadiantElement extends HTMLElement implements IRadiantEleme
|
|
|
106
235
|
* A map of reactive fields, it contains the reactive fields configured via decorators.
|
|
107
236
|
*/
|
|
108
237
|
private reactiveFields;
|
|
238
|
+
/**
|
|
239
|
+
* Stable dependency nodes used when plain reactive member reads participate
|
|
240
|
+
* in tracked component renders.
|
|
241
|
+
*/
|
|
242
|
+
private reactiveDependencies;
|
|
243
|
+
/**
|
|
244
|
+
* Raw value readers for reactive members whose public getter should also
|
|
245
|
+
* register tracked render dependencies.
|
|
246
|
+
*/
|
|
247
|
+
private reactiveDependencyReaders;
|
|
248
|
+
/**
|
|
249
|
+
* Stable subscribable JSX bindings keyed by reactive property name.
|
|
250
|
+
*/
|
|
251
|
+
private reactiveBindings;
|
|
252
|
+
/**
|
|
253
|
+
* Registered context providers keyed by decorated property name.
|
|
254
|
+
*/
|
|
255
|
+
private contextProviders;
|
|
256
|
+
/**
|
|
257
|
+
* Registered keyed hydration payload producers appended to SSR host output.
|
|
258
|
+
*/
|
|
259
|
+
private hydrationBindings;
|
|
109
260
|
/**
|
|
110
261
|
* A map of property update callbacks. These callbacks are called when a property is updated.
|
|
111
262
|
*/
|
|
@@ -118,6 +269,10 @@ export declare class RadiantElement extends HTMLElement implements IRadiantEleme
|
|
|
118
269
|
* A map for event emitters
|
|
119
270
|
*/
|
|
120
271
|
private eventEmitters;
|
|
272
|
+
/**
|
|
273
|
+
* Callbacks executed whenever the Radiant element is connected to the DOM.
|
|
274
|
+
*/
|
|
275
|
+
private onConnectedCallbacks;
|
|
121
276
|
/**
|
|
122
277
|
* An array of cleanup callbacks to be executed when the Radiant element is disconnected from the DOM.
|
|
123
278
|
*/
|
|
@@ -126,28 +281,81 @@ export declare class RadiantElement extends HTMLElement implements IRadiantEleme
|
|
|
126
281
|
* A flag indicating whether the element has been connected to the DOM.
|
|
127
282
|
*/
|
|
128
283
|
private elementReady;
|
|
284
|
+
constructor();
|
|
285
|
+
private createReactiveBindingNamespace;
|
|
129
286
|
connectedCallback(): void;
|
|
130
287
|
connectedContextCallback(_contextName: UnknownContext): void;
|
|
131
288
|
disconnectedCallback(): void;
|
|
132
289
|
notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown): void;
|
|
133
290
|
private transformAttributeValue;
|
|
134
291
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
135
|
-
|
|
292
|
+
/**
|
|
293
|
+
* Renders a trusted HTML template string into the specified target element.
|
|
294
|
+
*
|
|
295
|
+
* **Security:** The `template` string is written to the DOM via `innerHTML`
|
|
296
|
+
* or `insertAdjacentHTML` without built-in sanitization. Callers are
|
|
297
|
+
* responsible for ensuring the input is trusted. Supply a `sanitize`
|
|
298
|
+
* function to transform the template before insertion.
|
|
299
|
+
*/
|
|
300
|
+
renderTemplate({ target, template, insert, sanitize, }: {
|
|
136
301
|
target: HTMLElement;
|
|
137
302
|
template: string;
|
|
138
303
|
insert?: RenderInsertPosition;
|
|
304
|
+
sanitize?: (html: string) => string;
|
|
139
305
|
}): void;
|
|
140
306
|
registerReactiveProperty(config: ReactiveProperty): void;
|
|
307
|
+
protected getReactiveProperties(): ReactiveProperty[];
|
|
141
308
|
registerReactiveField<T>(config: ReactiveField<T>): void;
|
|
142
|
-
|
|
309
|
+
registerReactiveDependencyReader(property: string, read: ReactiveDependencyReader): void;
|
|
310
|
+
registerContextProvider(name: string, provider: SsrSerializableContextProvider): void;
|
|
311
|
+
registerHydrationBinding(name: string, binding: SsrSerializableHydrationBinding): void;
|
|
312
|
+
protected getContextProviders(): SsrSerializableContextProvider[];
|
|
313
|
+
protected getHydrationBindings(): SsrSerializableHydrationBinding[];
|
|
314
|
+
/**
|
|
315
|
+
* Flushes any deferred SSR-only preparation work before the host is
|
|
316
|
+
* serialized.
|
|
317
|
+
*
|
|
318
|
+
* Radiant uses this to reapply SSR consumer state after construction so the
|
|
319
|
+
* first server render sees finalized fields, props, and authored content.
|
|
320
|
+
*/
|
|
321
|
+
protected prepareForSsr(): void;
|
|
322
|
+
/**
|
|
323
|
+
* Returns the default JSX binding policy for reactive members on this host.
|
|
324
|
+
*
|
|
325
|
+
* Plain `RadiantElement` instances keep binding opt-in. JSX-first hosts such
|
|
326
|
+
* as `RadiantComponent` override this hook to opt into automatic bindings for
|
|
327
|
+
* `@prop`, `@state`, and direct `createReactiveProp`/`createReactiveField`
|
|
328
|
+
* calls when no explicit `bind` option is supplied.
|
|
329
|
+
*/
|
|
330
|
+
protected shouldAutoBindReactiveMembers(): boolean;
|
|
331
|
+
registerUpdateCallback(property: string, update: (...rest: any[]) => any): () => void;
|
|
332
|
+
getReactiveBinding<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
|
|
333
|
+
bind<Property extends StringPropertyKey<Bindings>>(property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
|
|
334
|
+
defineReactiveBinding(property: string, bind?: ReactiveBindingOption): void;
|
|
335
|
+
private getReactiveDependency;
|
|
336
|
+
trackReactiveRead(property: string): void;
|
|
337
|
+
private readReactiveDependencyValue;
|
|
338
|
+
private readReactiveBindingValue;
|
|
143
339
|
subscribeEvents(events: RadiantElementEventListener[]): Array<() => void>;
|
|
144
340
|
subscribeEvent(eventConfig: RadiantElementEventListener): () => void;
|
|
145
341
|
private unsubscribeEvent;
|
|
146
342
|
private removeAllSubscribedEvents;
|
|
343
|
+
/**
|
|
344
|
+
* Registers a callback that runs on every future disconnect.
|
|
345
|
+
*/
|
|
147
346
|
registerCleanupCallback(callback: () => void): void;
|
|
347
|
+
/**
|
|
348
|
+
* Registers a callback that runs from `connectedCallback()` on future host
|
|
349
|
+
* connections.
|
|
350
|
+
*
|
|
351
|
+
* Registering after the host is already connected does not invoke the
|
|
352
|
+
* callback immediately.
|
|
353
|
+
*/
|
|
354
|
+
registerConnectedCallback(callback: () => void): void;
|
|
148
355
|
registerEventEmitter(name: string, emitter: EventEmitter): void;
|
|
149
356
|
getRef<T extends Element = Element>(ref: string, all: true): T[];
|
|
150
|
-
getRef<T extends Element = Element>(ref: string, all?: false): T;
|
|
151
|
-
createReactiveField<T>(propertyName: string, initialValue: T): void;
|
|
357
|
+
getRef<T extends Element = Element>(ref: string, all?: false): T | null;
|
|
358
|
+
createReactiveField<T>(propertyName: string, initialValue: T, options?: ReactiveFieldOptions): void;
|
|
152
359
|
createReactiveProp<T = unknown>(propertyName: string, options: ReactivePropertyOptions<T>): void;
|
|
153
360
|
}
|
|
361
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{T as s};
|
|
1
|
+
import{Y as a}from"../chunk-gdkte2vd.js";import"../chunk-eyw14d6y.js";import"../chunk-cnyxrh9r.js";import"../chunk-66e6s792.js";import"../chunk-vgtggzb6.js";export{a as RadiantElement};
|
|
3
2
|
|
|
4
|
-
//# debugId=
|
|
3
|
+
//# debugId=AFB01FEC1FA2614F64756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { EventEmitter } from '@/tools';\nimport type { UnknownContext } from '../context/types';\nimport {\n type AttributeTypeConstant,\n type ReadAttributeValueReturnType,\n type WriteAttributeValueReturnType,\n getInitialValue,\n isValueOfType,\n readAttributeValue,\n writeAttributeValue,\n} from '../utils/attribute-utils';\n\n/**\n * Possible positions to insert a rendered template.\n */\nexport type RenderInsertPosition = 'replace' | 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend';\n\n/**\n * Represents a Radiant element event listener.\n */\nexport type RadiantElementEventListener = {\n selector: string;\n type: string;\n listener: EventListener;\n options?: AddEventListenerOptions;\n};\n\n/**\n * Represents a property metadata object.\n */\nexport interface ReactiveProperty<T = unknown> {\n type: AttributeTypeConstant;\n value?: T;\n initialValue?: T;\n name: string;\n attribute: string;\n converter: {\n fromAttribute: (value: string) => ReadAttributeValueReturnType;\n toAttribute: (value: any) => WriteAttributeValueReturnType;\n };\n}\n\n/**\n * Represents the options for a reactive property.\n */\nexport type ReactivePropertyOptions<T> = {\n type: AttributeTypeConstant;\n reflect?: boolean;\n attribute?: string;\n defaultValue?: T;\n};\n\nexport type ReactiveField<T = unknown> = {\n name: string;\n value: T;\n initialValue: T;\n};\n\n/**\n * Represents an interface for a Radiant element.\n */\nexport interface IRadiantElement {\n /**\n * Called when a property of the element is updated.\n * @param changedProperty - The name of the changed property.\n * @param oldValue - The old value of the property.\n * @param newValue - The new value of the property.\n */\n notifyUpdate(changedProperty: string, oldValue: unknown, newValue: unknown): void;\n\n /**\n * Subscribes to a Radiant element event.\n * @param event - The event listener to subscribe to.\n */\n subscribeEvent(event: RadiantElementEventListener): void;\n\n /**\n * Subscribes to multiple Radiant element events.\n * @param events - The array of event listeners to subscribe to.\n */\n subscribeEvents(events: RadiantElementEventListener[]): void;\n\n /**\n * It adds a callback to be executed when the Radiant element is disconnected from the DOM.\n */\n registerCleanupCallback(callback: () => void): void;\n\n /**\n * Renders a template into the specified target element.\n * @param options - The rendering options.\n * @param options.target - The target element to render the template into.\n * @param options.template - The template string to render.\n * @param options.insert - The position to insert the rendered template. (optional)\n */\n renderTemplate(options: {\n target: HTMLElement;\n template: string;\n insert?: RenderInsertPosition;\n }): void;\n\n /**\n * Called when the Radiant element is connected to a context.\n * @param context - The connected context.\n */\n connectedContextCallback(context: UnknownContext): void;\n\n /**\n * Gets a reference to a child element by its data-ref attribute.\n * @param ref - The data-ref attribute value of the element to get.\n * @param all - Whether to get all elements with the specified data-ref attribute value.\n * @returns The element with the specified data-ref attribute value, an array of elements or null if no element was found.\n */\n getRef<T extends Element = Element>(ref: string, all: boolean): T | T[];\n}\n\n/**\n * A base class for creating custom elements with reactive properties and event subscriptions.\n * @extends HTMLElement\n * @implements IRadiantElement\n */\nexport class RadiantElement extends HTMLElement implements IRadiantElement {\n /**\n * A map of property metadata objects, it contains useful information about the properties configured via decorators.\n */\n private reactiveProperties = new Map<string, ReactiveProperty>();\n\n /**\n * A map of reactive fields, it contains the reactive fields configured via decorators.\n */\n private reactiveFields = new Map<string, ReactiveField>();\n\n /**\n * A map of property update callbacks. These callbacks are called when a property is updated.\n */\n private updateCallbacks = new Map<string, Set<(...rest: any[]) => any>>();\n\n /**\n * A map of event subscriptions used to manage event listeners on the Radiant element.\n */\n private eventSubscriptions = new Map<string, RadiantElementEventListener>();\n\n /**\n * A map for event emitters\n */\n private eventEmitters = new Map<string, EventEmitter>();\n\n /**\n * An array of cleanup callbacks to be executed when the Radiant element is disconnected from the DOM.\n */\n private onDisconnectedCallback: (() => void)[] = [];\n\n /**\n * A flag indicating whether the element has been connected to the DOM.\n */\n private elementReady = false;\n\n connectedCallback() {\n this.elementReady = true;\n }\n\n connectedContextCallback(_contextName: UnknownContext): void {}\n\n disconnectedCallback() {\n this.removeAllSubscribedEvents();\n for (const cleanup of this.onDisconnectedCallback) {\n cleanup();\n }\n }\n\n public notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown) {\n if (!this.updateCallbacks || oldValue === value) return;\n const updates = this.updateCallbacks.get(changedProperty);\n\n if (updates) {\n for (const update of updates) {\n update();\n }\n }\n }\n\n private transformAttributeValue(value: string | null, config: any): unknown {\n return value ? config?.converter.fromAttribute(value) : value;\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n if (oldValue === newValue || !this.elementReady) return;\n\n if (this.reactiveProperties.has(name)) {\n const config = this.reactiveProperties.get(name);\n\n const transformedValue = this.transformAttributeValue(newValue, config);\n const transformedOldValue = this.transformAttributeValue(oldValue, config);\n\n const key = config ? config.attribute : name;\n (this as any)[key] = transformedValue;\n this.notifyUpdate(name, transformedOldValue, transformedValue);\n }\n }\n\n public renderTemplate({\n target = this,\n template,\n insert = 'replace',\n }: {\n target: HTMLElement;\n template: string;\n insert?: RenderInsertPosition;\n }) {\n switch (insert) {\n case 'replace':\n target.innerHTML = template;\n break;\n case 'beforeend':\n target.insertAdjacentHTML('beforeend', template);\n break;\n case 'afterbegin':\n target.insertAdjacentHTML('afterbegin', template);\n break;\n }\n }\n\n public registerReactiveProperty(config: ReactiveProperty) {\n this.reactiveProperties.set(config.name, config);\n }\n\n public registerReactiveField<T>(config: ReactiveField<T>) {\n this.reactiveFields.set(config.name, config);\n }\n\n public registerUpdateCallback(property: string, update: (...rest: any[]) => any) {\n if (!this.updateCallbacks.has(property)) {\n this.updateCallbacks.set(property, new Set());\n }\n this.updateCallbacks.get(property)?.add(update);\n }\n\n public subscribeEvents(events: RadiantElementEventListener[]): Array<() => void> {\n const unsubscribers: Array<() => void> = [];\n for (const event of events) {\n unsubscribers.push(this.subscribeEvent(event));\n }\n return unsubscribers;\n }\n\n public subscribeEvent(eventConfig: RadiantElementEventListener): () => void {\n const delegatedListener = (delegatedEvent: Event) => {\n if (delegatedEvent.target && (delegatedEvent.target as Element).matches(eventConfig.selector)) {\n eventConfig.listener.call(this, delegatedEvent);\n }\n };\n const subscriptionId = `${eventConfig.type}:${eventConfig.selector}`;\n this.addEventListener(eventConfig.type, delegatedListener, eventConfig.options);\n this.eventSubscriptions.set(subscriptionId, {\n ...eventConfig,\n listener: delegatedListener,\n });\n\n return this.unsubscribeEvent.bind(this, subscriptionId);\n }\n\n private unsubscribeEvent(id: string): void {\n const eventSubscription = this.eventSubscriptions.get(id);\n if (eventSubscription) {\n this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n this.eventSubscriptions.delete(id);\n }\n }\n\n private removeAllSubscribedEvents(): void {\n for (const eventSubscription of this.eventSubscriptions.values()) {\n this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);\n }\n this.eventSubscriptions.clear();\n }\n\n public registerCleanupCallback(callback: () => void): void {\n this.onDisconnectedCallback.push(callback);\n }\n\n public registerEventEmitter(name: string, emitter: EventEmitter) {\n this.eventEmitters.set(name, emitter);\n }\n\n public getRef<T extends Element = Element>(ref: string, all: true): T[];\n public getRef<T extends Element = Element>(ref: string, all?: false): T;\n public getRef<T extends Element = Element>(ref: string, all = false): T | T[] {\n const selector = `[data-ref=\"${ref}\"]`;\n let result: T | T[];\n if (all) {\n result = Array.from(this.querySelectorAll(selector)) as T[];\n if (result.length === 0) result = [];\n } else {\n result = this.querySelector(selector) as T;\n if (!result) {\n const fragment = document.createDocumentFragment();\n result = fragment as unknown as T;\n }\n }\n return result;\n }\n\n public createReactiveField<T>(propertyName: string, initialValue: T): void {\n const reactiveField: ReactiveField<T> = {\n name: propertyName,\n value: initialValue,\n initialValue: initialValue,\n };\n\n this.registerReactiveField(reactiveField);\n\n Object.defineProperty(this, propertyName, {\n get(this: RadiantElement) {\n return this.reactiveFields.get(propertyName)?.value ?? undefined;\n },\n set(this: RadiantElement, newValue: T) {\n const oldValue = this.reactiveFields.get(propertyName)?.value;\n if (oldValue !== newValue) {\n this.reactiveFields.set(propertyName, { ...reactiveField, value: newValue });\n this.notifyUpdate(propertyName, oldValue, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n\n this.notifyUpdate(propertyName, undefined, initialValue);\n }\n\n public createReactiveProp<T = unknown>(propertyName: string, options: ReactivePropertyOptions<T>): void {\n const { type, attribute, reflect, defaultValue } = options;\n const attributeKey = attribute ?? propertyName;\n\n if (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n throw new Error(`defaultValue does not match the expected type for ${type.name}`);\n }\n\n const initialValue: T | undefined = getInitialValue(this, type, attributeKey, defaultValue) as T;\n\n const propertyMapping: ReactiveProperty<T> = {\n type,\n name: propertyName,\n value: initialValue,\n initialValue,\n attribute: attributeKey,\n converter: {\n fromAttribute: (value) => readAttributeValue(value, type),\n toAttribute: (value) => writeAttributeValue(value, type),\n },\n };\n\n this.registerReactiveProperty(propertyMapping);\n\n const handleReflectRequest = (value: T) => {\n if (reflect) {\n const attributeValue = propertyMapping.converter.toAttribute(value);\n this.setAttribute(attributeKey, attributeValue);\n }\n };\n\n Object.defineProperty(this, propertyName, {\n get: function (this: RadiantElement) {\n return this.reactiveProperties.get(propertyName)?.value ?? undefined;\n },\n set: function (this: RadiantElement, newValue: T) {\n const oldValue = this.reactiveProperties.get(propertyName)?.value;\n if (oldValue !== newValue) {\n this.reactiveProperties.set(propertyName, { ...propertyMapping, value: newValue });\n handleReflectRequest(newValue);\n this.notifyUpdate(propertyName, oldValue, newValue);\n }\n },\n enumerable: true,\n configurable: true,\n });\n\n if (initialValue !== undefined) {\n handleReflectRequest(initialValue as T);\n queueMicrotask(() => {\n this.notifyUpdate(propertyName, undefined, initialValue);\n });\n }\n }\n}\n"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "AFB01FEC1FA2614F64756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks the current JavaScript environment as hydration-enabled for first
|
|
3
|
+
* custom-element connect.
|
|
4
|
+
*
|
|
5
|
+
* `RadiantComponent` reads this flag before deciding whether SSR markup should
|
|
6
|
+
* hydrate in place or be replaced by a fresh client render.
|
|
7
|
+
*/
|
|
8
|
+
export declare function installRadiantHydratorState(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Clears the explicit hydration-enabled flag from `globalThis`.
|
|
11
|
+
*
|
|
12
|
+
* This is mainly used by tests so they can assert both hydrated and non-
|
|
13
|
+
* hydrated first-connect behavior deterministically.
|
|
14
|
+
*/
|
|
15
|
+
export declare function uninstallRadiantHydratorState(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Returns whether first-connect hydration is currently enabled for this
|
|
18
|
+
* JavaScript environment.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isRadiantHydratorInstalled(): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SubscribableJsxValue } from '@ecopages/jsx';
|
|
2
|
+
import type { RadiantElement, ReactiveBindingValue } from './radiant-element';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a stable JSX child binding backed by a Radiant reactive property or field.
|
|
5
|
+
*
|
|
6
|
+
* The returned value resolves eagerly on the server and subscribes to the host's
|
|
7
|
+
* update callbacks on the client so the mounted child range can patch directly
|
|
8
|
+
* when the selected property changes.
|
|
9
|
+
*/
|
|
10
|
+
export declare function bindReactiveValue<Bindings extends object, Host extends RadiantElement<Bindings>, Property extends Extract<keyof Bindings, string>>(host: Host, property: Property): SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactivePropertyOptions } from './radiant-element';
|
|
2
|
+
export type ReactivePropDefinition = {
|
|
3
|
+
name: string;
|
|
4
|
+
options: ReactivePropertyOptions<unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare function registerReactivePropDefinition(target: object, propertyName: string, options: ReactivePropertyOptions<unknown>): void;
|
|
7
|
+
export declare function getReactivePropDefinitions(target: object): ReactivePropDefinition[];
|