@ecopages/radiant 0.2.0 → 0.3.0-alpha.0
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 +289 -34
- package/dist/chunk-0y78f8hj.js +4 -0
- package/dist/chunk-0y78f8hj.js.map +10 -0
- package/dist/chunk-0zq7e1ne.js +4 -0
- package/dist/chunk-0zq7e1ne.js.map +10 -0
- package/dist/chunk-13ydx769.js +4 -0
- package/dist/chunk-13ydx769.js.map +10 -0
- package/dist/chunk-147yvtsn.js +4 -0
- package/dist/chunk-147yvtsn.js.map +10 -0
- package/dist/chunk-17earqbr.js +4 -0
- package/dist/chunk-17earqbr.js.map +10 -0
- package/dist/chunk-1w1dm68j.js +4 -0
- package/dist/chunk-1w1dm68j.js.map +10 -0
- package/dist/chunk-2tgrfv09.js +4 -0
- package/dist/chunk-2tgrfv09.js.map +10 -0
- package/dist/chunk-3b033cgq.js +4 -0
- package/dist/chunk-3b033cgq.js.map +10 -0
- package/dist/chunk-42tyhfvh.js +4 -0
- package/dist/chunk-42tyhfvh.js.map +10 -0
- package/dist/chunk-4cc2syf5.js +4 -0
- package/dist/chunk-4cc2syf5.js.map +10 -0
- package/dist/chunk-4fqkmpra.js +4 -0
- package/dist/chunk-4fqkmpra.js.map +10 -0
- package/dist/chunk-4srpf0y5.js +4 -0
- package/dist/chunk-4srpf0y5.js.map +10 -0
- package/dist/chunk-57w3vmme.js +4 -0
- package/dist/chunk-57w3vmme.js.map +10 -0
- package/dist/chunk-5a2xez36.js +4 -0
- package/dist/chunk-5a2xez36.js.map +10 -0
- package/dist/chunk-5bym7y1d.js +4 -0
- package/dist/chunk-5bym7y1d.js.map +10 -0
- package/dist/chunk-5td6v9k3.js +4 -0
- package/dist/chunk-5td6v9k3.js.map +10 -0
- package/dist/chunk-60015zxq.js +4 -0
- package/dist/chunk-60015zxq.js.map +10 -0
- package/dist/chunk-60q4y3k5.js +4 -0
- package/dist/chunk-60q4y3k5.js.map +10 -0
- package/dist/chunk-6kdxrppw.js +4 -0
- package/dist/chunk-6kdxrppw.js.map +10 -0
- package/dist/chunk-6z34stya.js +4 -0
- package/dist/chunk-6z34stya.js.map +10 -0
- package/dist/chunk-73x7jpdd.js +4 -0
- package/dist/chunk-73x7jpdd.js.map +10 -0
- package/dist/chunk-84fc8cz9.js +4 -0
- package/dist/chunk-84fc8cz9.js.map +10 -0
- package/dist/chunk-8dexhy6c.js +4 -0
- package/dist/chunk-8dexhy6c.js.map +10 -0
- package/dist/chunk-8n2dhx28.js +4 -0
- package/dist/chunk-8n2dhx28.js.map +10 -0
- package/dist/chunk-8tvt04cm.js +4 -0
- package/dist/chunk-8tvt04cm.js.map +10 -0
- package/dist/chunk-8vak8w5w.js +4 -0
- package/dist/chunk-8vak8w5w.js.map +10 -0
- package/dist/chunk-8xy18qmz.js +4 -0
- package/dist/chunk-8xy18qmz.js.map +9 -0
- package/dist/chunk-9554n9t4.js +4 -0
- package/dist/chunk-9554n9t4.js.map +10 -0
- package/dist/chunk-9ascmjk3.js +4 -0
- package/dist/chunk-9ascmjk3.js.map +10 -0
- package/dist/chunk-9gjmqxp2.js +4 -0
- package/dist/chunk-9gjmqxp2.js.map +10 -0
- package/dist/chunk-a7hzs37s.js +4 -0
- package/dist/chunk-a7hzs37s.js.map +10 -0
- package/dist/chunk-aajhkdmn.js +4 -0
- package/dist/chunk-aajhkdmn.js.map +10 -0
- package/dist/chunk-agjb2a3r.js +4 -0
- package/dist/chunk-agjb2a3r.js.map +10 -0
- package/dist/chunk-ak97hp4w.js +4 -0
- package/dist/chunk-ak97hp4w.js.map +10 -0
- package/dist/chunk-bmhn4nbp.js +4 -0
- package/dist/chunk-bmhn4nbp.js.map +10 -0
- package/dist/chunk-c8vqg7r1.js +4 -0
- package/dist/chunk-c8vqg7r1.js.map +10 -0
- package/dist/chunk-cbvd18v1.js +4 -0
- package/dist/chunk-cbvd18v1.js.map +10 -0
- package/dist/chunk-chyn72n9.js +4 -0
- package/dist/chunk-chyn72n9.js.map +10 -0
- package/dist/chunk-cvz9mrxa.js +4 -0
- package/dist/chunk-cvz9mrxa.js.map +10 -0
- package/dist/chunk-d0n7njdy.js +4 -0
- package/dist/chunk-d0n7njdy.js.map +10 -0
- package/dist/chunk-d4v5qpxa.js +4 -0
- package/dist/chunk-d4v5qpxa.js.map +10 -0
- package/dist/chunk-d7hh3ze6.js +4 -0
- package/dist/chunk-d7hh3ze6.js.map +10 -0
- package/dist/chunk-d98q3myg.js +4 -0
- package/dist/chunk-d98q3myg.js.map +10 -0
- package/dist/chunk-dscj0sk9.js +4 -0
- package/dist/chunk-dscj0sk9.js.map +10 -0
- package/dist/chunk-dx1wqc00.js +4 -0
- package/dist/chunk-dx1wqc00.js.map +10 -0
- package/dist/chunk-g0gz7ypq.js +4 -0
- package/dist/chunk-g0gz7ypq.js.map +10 -0
- package/dist/chunk-hkmm3dj9.js +4 -0
- package/dist/chunk-hkmm3dj9.js.map +10 -0
- package/dist/chunk-hn4j8rt5.js +4 -0
- package/dist/chunk-hn4j8rt5.js.map +10 -0
- package/dist/chunk-jce9gqqw.js +4 -0
- package/dist/chunk-jce9gqqw.js.map +10 -0
- package/dist/chunk-jg20mzg8.js +4 -0
- package/dist/chunk-jg20mzg8.js.map +10 -0
- package/dist/chunk-jkb2y7c8.js +4 -0
- package/dist/chunk-jkb2y7c8.js.map +10 -0
- package/dist/chunk-k5hr781q.js +4 -0
- package/dist/chunk-k5hr781q.js.map +10 -0
- package/dist/chunk-ksv01cey.js +4 -0
- package/dist/chunk-ksv01cey.js.map +10 -0
- package/dist/chunk-mpjnqmbq.js +4 -0
- package/dist/chunk-mpjnqmbq.js.map +10 -0
- package/dist/chunk-mqxmfvyp.js +4 -0
- package/dist/chunk-mqxmfvyp.js.map +10 -0
- package/dist/chunk-ms6a9zdt.js +4 -0
- package/dist/chunk-ms6a9zdt.js.map +10 -0
- package/dist/chunk-nerd6fmg.js +4 -0
- package/dist/chunk-nerd6fmg.js.map +10 -0
- package/dist/chunk-nw171z6m.js +4 -0
- package/dist/chunk-nw171z6m.js.map +10 -0
- package/dist/chunk-p6pxdvkk.js +4 -0
- package/dist/chunk-p6pxdvkk.js.map +10 -0
- package/dist/chunk-paehjz94.js +4 -0
- package/dist/chunk-paehjz94.js.map +10 -0
- package/dist/chunk-par0t822.js +4 -0
- package/dist/chunk-par0t822.js.map +10 -0
- package/dist/chunk-qaagk55a.js +4 -0
- package/dist/chunk-qaagk55a.js.map +10 -0
- package/dist/chunk-qbnedp0y.js +4 -0
- package/dist/chunk-qbnedp0y.js.map +10 -0
- package/dist/chunk-qd28hvdx.js +4 -0
- package/dist/chunk-qd28hvdx.js.map +10 -0
- package/dist/chunk-qdj6r8jn.js +4 -0
- package/dist/chunk-qdj6r8jn.js.map +10 -0
- package/dist/chunk-qe6sjr27.js +4 -0
- package/dist/chunk-qe6sjr27.js.map +10 -0
- package/dist/chunk-r1cvaz1t.js +4 -0
- package/dist/chunk-r1cvaz1t.js.map +10 -0
- package/dist/chunk-r75y7ydb.js +4 -0
- package/dist/chunk-r75y7ydb.js.map +10 -0
- package/dist/chunk-s4qgct1z.js +4 -0
- package/dist/chunk-s4qgct1z.js.map +10 -0
- package/dist/chunk-scfk041e.js +4 -0
- package/dist/chunk-scfk041e.js.map +10 -0
- package/dist/chunk-t6x9e177.js +4 -0
- package/dist/chunk-t6x9e177.js.map +10 -0
- package/dist/chunk-t7a1bbxq.js +4 -0
- package/dist/chunk-t7a1bbxq.js.map +10 -0
- package/dist/chunk-tyysm4gk.js +4 -0
- package/dist/chunk-tyysm4gk.js.map +10 -0
- package/dist/chunk-vpfm9yw8.js +4 -0
- package/dist/chunk-vpfm9yw8.js.map +10 -0
- package/dist/chunk-w50v38rv.js +4 -0
- package/dist/chunk-w50v38rv.js.map +10 -0
- package/dist/chunk-x0522ksh.js +4 -0
- package/dist/chunk-x0522ksh.js.map +10 -0
- package/dist/chunk-xd1xn3vy.js +4 -0
- package/dist/chunk-xd1xn3vy.js.map +10 -0
- package/dist/chunk-zb7wh7w4.js +4 -0
- package/dist/chunk-zb7wh7w4.js.map +10 -0
- package/dist/chunk-zj9ez73m.js +4 -0
- package/dist/chunk-zj9ez73m.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 +31 -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 +17 -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.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 +106 -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/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.d.ts +34 -0
- package/dist/core/slot-projection.js +3 -0
- package/dist/core/slot-projection.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/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/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/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 +11 -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.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 +97 -21
- package/size-budget.json +22 -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
|
@@ -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{H as a}from"../chunk-84fc8cz9.js";import"../chunk-9gjmqxp2.js";import"../chunk-8tvt04cm.js";import"../chunk-73x7jpdd.js";import"../chunk-8xy18qmz.js";export{a as RadiantElement};
|
|
3
2
|
|
|
4
|
-
//# debugId=
|
|
3
|
+
//# debugId=81AC4D5FEB0D36DD64756E2164756E21
|
|
@@ -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": "81AC4D5FEB0D36DD64756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
|
@@ -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[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
export declare const DEFAULT_SLOT_NAME = "";
|
|
3
|
+
export declare const SLOT_PROJECTION_SCRIPT_ATTRIBUTE = "data-radiant-slot-projection";
|
|
4
|
+
type ResolvedSlotProjection = {
|
|
5
|
+
containsSlots: boolean;
|
|
6
|
+
value: JsxRenderable;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Captures direct host children as projected slot content for client rendering.
|
|
10
|
+
*/
|
|
11
|
+
export declare function captureProjectedSlotRenderables(host: HTMLElement): Map<string, JsxRenderable[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Parses the SSR slot projection payload back into renderable fragments.
|
|
14
|
+
*/
|
|
15
|
+
export declare function deserializeProjectedSlotRenderables(payload: string): Map<string, JsxRenderable[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Parses serialized child HTML into slot buckets for SSR-driven projection.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseProjectedSlotRenderablesFromHtml(html: string): Map<string, JsxRenderable[]>;
|
|
20
|
+
export declare function collectAuthoredHydrationScriptMarkup(host: HTMLElement): string | undefined;
|
|
21
|
+
export declare function collectAuthoredHydrationScriptMarkupFromHtml(html: string): string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Serializes the current slot assignments into the payload embedded in SSR host output.
|
|
24
|
+
*/
|
|
25
|
+
export declare function serializeProjectedSlotRenderables(projectedContent: ReadonlyMap<string, readonly JsxRenderable[]>): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Resolves literal `<slot>` placeholders inside a JSX tree.
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveSlotProjection(value: JsxRenderable, projectedContent: ReadonlyMap<string, readonly JsxRenderable[]>): ResolvedSlotProjection;
|
|
30
|
+
/**
|
|
31
|
+
* Extracts and removes the SSR slot projection script from the host when present.
|
|
32
|
+
*/
|
|
33
|
+
export declare function takeSlotProjectionScriptPayload(host: HTMLElement): string | undefined;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h,Q as i,R as j}from"../chunk-9ascmjk3.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{j as takeSlotProjectionScriptPayload,h as serializeProjectedSlotRenderables,i as resolveSlotProjection,e as parseProjectedSlotRenderablesFromHtml,d as deserializeProjectedSlotRenderables,g as collectAuthoredHydrationScriptMarkupFromHtml,f as collectAuthoredHydrationScriptMarkup,c as captureProjectedSlotRenderables,b as SLOT_PROJECTION_SCRIPT_ATTRIBUTE,a as DEFAULT_SLOT_NAME};
|
|
2
|
+
|
|
3
|
+
//# debugId=D6B349EF7A834A0E64756E2164756E21
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
/**
|
|
3
|
+
* Serializable host-level hydration payload that can be appended to SSR output.
|
|
4
|
+
*
|
|
5
|
+
* Context providers and other host-owned reactive primitives use this contract
|
|
6
|
+
* to surface keyed `<script type="application/json">` payloads that the client
|
|
7
|
+
* can recover during hydration.
|
|
8
|
+
*/
|
|
9
|
+
export interface SsrSerializableHydrationBinding {
|
|
10
|
+
/** Returns the hydration script as JSX-friendly serialized markup, when available. */
|
|
11
|
+
renderHydrationScript(): JsxRenderable | undefined;
|
|
12
|
+
/** Returns the hydration script as a raw HTML string, when available. */
|
|
13
|
+
renderHydrationScriptTag(): string | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type SsrPreparationCallback = () => void;
|
|
2
|
+
export declare const SSR_PREPARATION_RUNNING: unique symbol;
|
|
3
|
+
/**
|
|
4
|
+
* Registers instance-local SSR preparation work that should run immediately
|
|
5
|
+
* before a Radiant host serializes its first server render.
|
|
6
|
+
*
|
|
7
|
+
* Decorators use this to defer SSR-only setup until after class fields,
|
|
8
|
+
* reactive props, and authored host content have all been applied.
|
|
9
|
+
*/
|
|
10
|
+
export declare function registerSsrPreparationCallback(host: object, callback: SsrPreparationCallback): void;
|
|
11
|
+
/**
|
|
12
|
+
* Runs all registered SSR preparation callbacks for the provided host.
|
|
13
|
+
*
|
|
14
|
+
* The callbacks are intentionally retained so repeated SSR serializations stay
|
|
15
|
+
* deterministic after later host mutations.
|
|
16
|
+
*/
|
|
17
|
+
export declare function runSsrPreparationCallbacks(host: object): void;
|
|
18
|
+
export {};
|
package/dist/decorators/bound.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{wa as a}from"../chunk-w50v38rv.js";import"../chunk-cbvd18v1.js";import"../chunk-xd1xn3vy.js";import"../chunk-nerd6fmg.js";import"../chunk-8xy18qmz.js";export{a as bound};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=9DA7BEE57029EA6B64756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type {\n LegacyMethodDecoratorArgs,\n StandardMethodDecoratorArgs,\n StandardOrLegacyMethodDecoratorArgs,\n} from '../types';\nimport { bound as legacyBound } from './legacy/bound';\nimport { bound as standardBound } from './standard/bound';\n\n/**\n * A decorator to bind a method to the instance.\n */\nexport function bound(\n protoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n nameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n descriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n): any {\n if (typeof nameOrContext === 'object') {\n return standardBound(\n protoOrTarget as StandardMethodDecoratorArgs['protoOrTarget'],\n nameOrContext as StandardMethodDecoratorArgs['nameOrContext'],\n );\n }\n return legacyBound(\n protoOrTarget as LegacyMethodDecoratorArgs['protoOrTarget'],\n nameOrContext as LegacyMethodDecoratorArgs['nameOrContext'],\n descriptor as LegacyMethodDecoratorArgs['descriptor'],\n );\n}\n"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "9DA7BEE57029EA6B64756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LegacyFieldDecoratorArgs, LegacyMethodDecoratorArgs, StandardMethodDecoratorArgs, StandardOrLegacyFieldDecoratorArgs, StandardOrLegacyMethodDecoratorArgs } from '../types';
|
|
2
|
+
type StandardFieldFn = (target: undefined, context: ClassFieldDecoratorContext<any, any>) => any;
|
|
3
|
+
type LegacyFieldFn = (proto: LegacyFieldDecoratorArgs['protoOrTarget'], name: LegacyFieldDecoratorArgs['nameOrContext']) => any;
|
|
4
|
+
type StandardMethodFn = (target: StandardMethodDecoratorArgs['protoOrTarget'], context: StandardMethodDecoratorArgs['nameOrContext']) => any;
|
|
5
|
+
type LegacyMethodFn = (proto: LegacyMethodDecoratorArgs['protoOrTarget'], name: LegacyMethodDecoratorArgs['nameOrContext'], descriptor: LegacyMethodDecoratorArgs['descriptor']) => any;
|
|
6
|
+
export declare function fieldDecoratorBridge(standard: StandardFieldFn, legacy: LegacyFieldFn, protoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'], nameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext']): any;
|
|
7
|
+
export declare function methodDecoratorBridge(standard: StandardMethodFn, legacy: LegacyMethodFn, protoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'], nameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'], descriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor']): any;
|
|
8
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{I as w};
|
|
1
|
+
import{Fa as a}from"../chunk-60015zxq.js";import"../chunk-60q4y3k5.js";import"../chunk-zj9ez73m.js";import"../chunk-ms6a9zdt.js";import"../chunk-8xy18qmz.js";export{a as customElement};
|
|
3
2
|
|
|
4
|
-
//# debugId=
|
|
3
|
+
//# debugId=233D559C4D57950264756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type {\n LegacyClassDecoratorArgs,\n StandardClassDecoratorArgs,\n StandardOrLegacyClassDecoratorArgs,\n} from '../types';\nimport { customElement as legacyCustomElement } from './legacy/custom-element';\nimport { customElement as standardCustomElement } from './standard/custom-element';\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 return function (\n protoOrTarget: StandardOrLegacyClassDecoratorArgs['protoOrTarget'],\n nameOrContext?: StandardOrLegacyClassDecoratorArgs['nameOrContext'],\n ): any {\n if (typeof nameOrContext !== 'undefined') {\n return standardCustomElement(name, options)(\n protoOrTarget as StandardClassDecoratorArgs['protoOrTarget'],\n nameOrContext as StandardClassDecoratorArgs['nameOrContext'],\n );\n }\n return legacyCustomElement(name, options)(protoOrTarget as LegacyClassDecoratorArgs['protoOrTarget']);\n };\n}\n"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "233D559C4D57950264756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{za as a}from"../chunk-mqxmfvyp.js";import"../chunk-hn4j8rt5.js";import"../chunk-8vak8w5w.js";import"../chunk-nerd6fmg.js";import"../chunk-13ydx769.js";import"../chunk-8xy18qmz.js";export{a as debounce};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=BCD4A1D2E7714F4364756E2164756E21
|