@ecopages/radiant 0.1.8 → 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 -279
- package/dist/context/context-provider.js.map +3 -6
- 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 -6
- package/dist/context/create-context.js.map +3 -4
- package/dist/context/decorators/consume-context.d.ts +10 -6
- package/dist/context/decorators/consume-context.js +2 -64
- package/dist/context/decorators/consume-context.js.map +3 -5
- 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 +29 -9
- package/dist/context/decorators/context-selector.js +2 -71
- package/dist/context/decorators/context-selector.js.map +3 -5
- package/dist/context/decorators/legacy/consume-context.d.ts +3 -0
- package/dist/context/decorators/legacy/consume-context.js +3 -0
- package/dist/context/decorators/legacy/consume-context.js.map +9 -0
- 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 +4 -0
- package/dist/context/decorators/legacy/context-selector.js +3 -0
- package/dist/context/decorators/legacy/context-selector.js.map +9 -0
- package/dist/context/decorators/legacy/provide-context.d.ts +4 -0
- package/dist/context/decorators/legacy/provide-context.js +3 -0
- package/dist/context/decorators/legacy/provide-context.js.map +9 -0
- 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 +18 -7
- package/dist/context/decorators/provide-context.js +2 -291
- package/dist/context/decorators/provide-context.js.map +3 -7
- package/dist/context/decorators/standard/consume-context.d.ts +3 -0
- package/dist/context/decorators/standard/consume-context.js +3 -0
- package/dist/context/decorators/standard/consume-context.js.map +9 -0
- 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 +5 -0
- package/dist/context/decorators/standard/context-selector.js +3 -0
- package/dist/context/decorators/standard/context-selector.js.map +9 -0
- package/dist/context/decorators/standard/provide-context.d.ts +4 -0
- package/dist/context/decorators/standard/provide-context.js +3 -0
- package/dist/context/decorators/standard/provide-context.js.map +9 -0
- package/dist/context/events.d.ts +3 -2
- package/dist/context/events.js +2 -53
- 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 +283 -23
- package/dist/core/radiant-element.js +2 -82
- 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.d.ts +2 -6
- package/dist/decorators/bound.js +2 -23
- 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.d.ts +3 -1
- package/dist/decorators/custom-element.js +2 -14
- package/dist/decorators/custom-element.js.map +3 -4
- package/dist/decorators/debounce.d.ts +6 -1
- package/dist/decorators/debounce.js +2 -20
- package/dist/decorators/debounce.js.map +3 -4
- package/dist/decorators/event.d.ts +3 -2
- package/dist/decorators/event.js +2 -46
- package/dist/decorators/event.js.map +3 -5
- package/dist/decorators/legacy/bound.d.ts +9 -0
- package/dist/decorators/legacy/bound.js +3 -0
- package/dist/decorators/legacy/bound.js.map +9 -0
- package/dist/decorators/legacy/custom-element.d.ts +6 -0
- package/dist/decorators/legacy/custom-element.js +3 -0
- package/dist/decorators/legacy/custom-element.js.map +9 -0
- package/dist/decorators/legacy/debounce.d.ts +1 -0
- package/dist/decorators/legacy/debounce.js +3 -0
- package/dist/decorators/legacy/debounce.js.map +9 -0
- package/dist/decorators/legacy/event.d.ts +9 -0
- package/dist/decorators/legacy/event.js +3 -0
- package/dist/decorators/legacy/event.js.map +9 -0
- 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 +17 -0
- package/dist/decorators/legacy/on-event.js +3 -0
- package/dist/decorators/legacy/on-event.js.map +9 -0
- package/dist/decorators/legacy/on-updated.d.ts +6 -0
- package/dist/decorators/legacy/on-updated.js +3 -0
- package/dist/decorators/legacy/on-updated.js.map +9 -0
- 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.d.ts +23 -0
- package/dist/decorators/legacy/query.js +3 -0
- package/dist/decorators/legacy/query.js.map +9 -0
- package/dist/decorators/{reactive-field.d.ts → legacy/reactive-field.d.ts} +2 -2
- package/dist/decorators/legacy/reactive-field.js +3 -0
- package/dist/decorators/legacy/reactive-field.js.map +9 -0
- package/dist/decorators/{reactive-prop.d.ts → legacy/reactive-prop.d.ts} +4 -3
- package/dist/decorators/legacy/reactive-prop.js +3 -0
- package/dist/decorators/legacy/reactive-prop.js.map +9 -0
- 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 +6 -17
- package/dist/decorators/on-event.js +2 -47
- package/dist/decorators/on-event.js.map +3 -4
- package/dist/decorators/on-updated.d.ts +3 -4
- package/dist/decorators/on-updated.js +2 -29
- 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 +7 -35
- package/dist/decorators/query.js +2 -36
- 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.d.ts +2 -0
- package/dist/decorators/standard/bound.js +3 -0
- package/dist/decorators/standard/bound.js.map +9 -0
- package/dist/decorators/standard/custom-element.d.ts +1 -0
- package/dist/decorators/standard/custom-element.js +3 -0
- package/dist/decorators/standard/custom-element.js.map +9 -0
- package/dist/decorators/standard/debounce.d.ts +2 -0
- package/dist/decorators/standard/debounce.js +3 -0
- package/dist/decorators/standard/debounce.js.map +9 -0
- package/dist/decorators/standard/event.d.ts +9 -0
- package/dist/decorators/standard/event.js +3 -0
- package/dist/decorators/standard/event.js.map +9 -0
- package/dist/decorators/standard/on-event.d.ts +17 -0
- package/dist/decorators/standard/on-event.js +3 -0
- package/dist/decorators/standard/on-event.js.map +9 -0
- package/dist/decorators/standard/on-updated.d.ts +2 -0
- package/dist/decorators/standard/on-updated.js +3 -0
- package/dist/decorators/standard/on-updated.js.map +9 -0
- 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.d.ts +2 -0
- package/dist/decorators/standard/query.js +3 -0
- package/dist/decorators/standard/query.js.map +9 -0
- package/dist/decorators/standard/reactive-field.d.ts +2 -0
- package/dist/decorators/standard/reactive-field.js +3 -0
- package/dist/decorators/standard/reactive-field.js.map +9 -0
- package/dist/decorators/standard/reactive-prop.d.ts +2 -0
- package/dist/decorators/standard/reactive-prop.js +3 -0
- package/dist/decorators/standard/reactive-prop.js.map +9 -0
- 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/helpers/index.js.map +9 -0
- package/dist/index.d.ts +24 -6
- package/dist/index.js +2 -716
- package/dist/index.js.map +3 -21
- 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.d.ts +1 -1
- package/dist/tools/event-emitter.js +2 -22
- package/dist/tools/event-emitter.js.map +3 -4
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +2 -28
- package/dist/tools/index.js.map +3 -5
- 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 -8
- package/dist/tools/stringify-typed.js.map +3 -4
- package/dist/types.d.ts +79 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +10 -0
- package/dist/utils/attribute-utils.d.ts +2 -0
- package/dist/utils/attribute-utils.js +2 -137
- package/dist/utils/attribute-utils.js.map +3 -4
- package/dist/utils/index.js +2 -137
- package/dist/utils/index.js.map +3 -4
- package/package.json +108 -44
- package/size-budget.json +22 -0
- package/dist/context/index.d.ts +0 -7
- package/dist/context/index.js +0 -338
- package/dist/context/index.js.map +0 -16
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -83
- package/dist/core/index.js.map +0 -10
- package/dist/decorators/reactive-field.js +0 -27
- package/dist/decorators/reactive-field.js.map +0 -10
- package/dist/decorators/reactive-prop.js +0 -215
- package/dist/decorators/reactive-prop.js.map +0 -11
- package/dist/decorators.d.ts +0 -7
- package/dist/decorators.js +0 -401
- package/dist/decorators.js.map +0 -18
- package/dist/mixins/index.d.ts +0 -1
- package/dist/mixins/index.js +0 -24
- package/dist/mixins/index.js.map +0 -10
- package/dist/mixins/with-kita.d.ts +0 -15
- package/dist/mixins/with-kita.js +0 -24
- 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,106 @@
|
|
|
1
|
+
import { type JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
import { type RenderToStringOptions } from '@ecopages/jsx/server';
|
|
3
|
+
import { RadiantElement } from './radiant-element';
|
|
4
|
+
/**
|
|
5
|
+
* A structured JSX-first Radiant base class.
|
|
6
|
+
* @typeParam Bindings - Explicit internal bindable shape. Include only the
|
|
7
|
+
* prop/state keys that JSX bindings should accept.
|
|
8
|
+
*
|
|
9
|
+
* Treat this as the component's internal reactive/bindable surface, not as the
|
|
10
|
+
* default public custom-element attribute contract. When a component exposes a
|
|
11
|
+
* narrower external API than its internal state, declare a separate public
|
|
12
|
+
* props type for the JSX intrinsic element and keep internal-only state out of
|
|
13
|
+
* that contract.
|
|
14
|
+
*
|
|
15
|
+
* Reusing the same type for both is fine only when the public props and the
|
|
16
|
+
* bindable reactive members are intentionally the same surface.
|
|
17
|
+
*
|
|
18
|
+
* - `render()` describes the view.
|
|
19
|
+
* - `update()` commits the current view into the host.
|
|
20
|
+
* - first render happens automatically on connect.
|
|
21
|
+
* - plain `@prop`, `@state`, and `@signal` reads performed during `render()`
|
|
22
|
+
* participate in tracked rerender invalidation.
|
|
23
|
+
* - `update()` and `requestUpdate()` remain available when a rerender should be
|
|
24
|
+
* scheduled from imperative work outside those tracked reads.
|
|
25
|
+
*/
|
|
26
|
+
export declare class RadiantComponent<Bindings extends object = {}> extends RadiantElement<Bindings> {
|
|
27
|
+
private isRendering;
|
|
28
|
+
private isFirstConnectPending;
|
|
29
|
+
private isRenderScheduled;
|
|
30
|
+
private needsRender;
|
|
31
|
+
private projectedSlotContent;
|
|
32
|
+
private renderSignal?;
|
|
33
|
+
private readonly renderWatcher;
|
|
34
|
+
private slotProjectionObserver?;
|
|
35
|
+
private slotProjectionVersion;
|
|
36
|
+
private readonly ssr;
|
|
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
|
+
private ensureSlotProjectionState;
|
|
95
|
+
private getHostChildNodeCount;
|
|
96
|
+
private getSlotProjectionScriptTag;
|
|
97
|
+
private getAuthoredHydrationScriptMarkup;
|
|
98
|
+
private handleSlotProjectionMutations;
|
|
99
|
+
private addProjectedSlotNode;
|
|
100
|
+
private removeProjectedSlotNode;
|
|
101
|
+
private observeSlotProjection;
|
|
102
|
+
private disconnectSlotProjectionObserver;
|
|
103
|
+
private disconnectRenderWatcher;
|
|
104
|
+
private resolveTrackedRenderOutput;
|
|
105
|
+
private resolveRenderOutput;
|
|
106
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{G as a}from"../chunk-17earqbr.js";import"../chunk-84fc8cz9.js";import"../chunk-9ascmjk3.js";import"../chunk-9554n9t4.js";import"../chunk-9gjmqxp2.js";import"../chunk-8dexhy6c.js";import"../chunk-8tvt04cm.js";import"../chunk-73x7jpdd.js";import"../chunk-ms6a9zdt.js";import"../chunk-dx1wqc00.js";import"../chunk-4cc2syf5.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{a as RadiantComponent};
|
|
2
|
+
|
|
3
|
+
//# debugId=591CEE5AF32145BA64756E2164756E21
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import type { EventEmitter } from '../tools';
|
|
2
|
+
import { type JsxRenderable, type SubscribableJsxValue } from '@ecopages/jsx';
|
|
3
|
+
import type { SsrSerializableContextProvider } from '../context/context-provider';
|
|
1
4
|
import type { UnknownContext } from '../context/types';
|
|
2
|
-
import type {
|
|
5
|
+
import type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';
|
|
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;
|
|
3
12
|
/**
|
|
4
13
|
* Possible positions to insert a rendered template.
|
|
5
14
|
*/
|
|
@@ -11,91 +20,342 @@ export type RadiantElementEventListener = {
|
|
|
11
20
|
selector: string;
|
|
12
21
|
type: string;
|
|
13
22
|
listener: EventListener;
|
|
14
|
-
id: string;
|
|
15
23
|
options?: AddEventListenerOptions;
|
|
16
24
|
};
|
|
17
25
|
/**
|
|
18
26
|
* Represents a property metadata object.
|
|
19
27
|
*/
|
|
20
|
-
export interface
|
|
28
|
+
export interface ReactiveProperty<T = unknown> {
|
|
21
29
|
type: AttributeTypeConstant;
|
|
22
|
-
|
|
23
|
-
|
|
30
|
+
value?: T;
|
|
31
|
+
initialValue?: T;
|
|
32
|
+
name: string;
|
|
33
|
+
attribute: string;
|
|
24
34
|
converter: {
|
|
25
35
|
fromAttribute: (value: string) => ReadAttributeValueReturnType;
|
|
26
36
|
toAttribute: (value: any) => WriteAttributeValueReturnType;
|
|
27
37
|
};
|
|
28
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Represents the options for a reactive property.
|
|
41
|
+
*/
|
|
42
|
+
export type ReactivePropertyOptions<T> = {
|
|
43
|
+
type: AttributeTypeConstant;
|
|
44
|
+
reflect?: boolean;
|
|
45
|
+
attribute?: string;
|
|
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;
|
|
69
|
+
};
|
|
70
|
+
export type ReactiveField<T = unknown> = {
|
|
71
|
+
name: string;
|
|
72
|
+
value: T;
|
|
73
|
+
initialValue: T;
|
|
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
|
+
};
|
|
29
98
|
/**
|
|
30
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.
|
|
31
105
|
*/
|
|
32
|
-
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>;
|
|
33
115
|
/**
|
|
34
116
|
* Called when a property of the element is updated.
|
|
35
117
|
* @param changedProperty - The name of the changed property.
|
|
36
118
|
* @param oldValue - The old value of the property.
|
|
37
119
|
* @param newValue - The new value of the property.
|
|
38
120
|
*/
|
|
39
|
-
|
|
121
|
+
notifyUpdate(changedProperty: string, oldValue: unknown, newValue: unknown): void;
|
|
40
122
|
/**
|
|
41
123
|
* Subscribes to a Radiant element event.
|
|
42
124
|
* @param event - The event listener to subscribe to.
|
|
43
125
|
*/
|
|
44
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;
|
|
45
154
|
/**
|
|
46
155
|
* Subscribes to multiple Radiant element events.
|
|
47
156
|
* @param events - The array of event listeners to subscribe to.
|
|
48
157
|
*/
|
|
49
158
|
subscribeEvents(events: RadiantElementEventListener[]): void;
|
|
50
159
|
/**
|
|
51
|
-
*
|
|
52
|
-
|
|
160
|
+
* It adds a callback to be executed when the Radiant element is disconnected from the DOM.
|
|
161
|
+
*/
|
|
162
|
+
registerCleanupCallback(callback: () => void): void;
|
|
163
|
+
/**
|
|
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.
|
|
53
174
|
*/
|
|
54
|
-
|
|
175
|
+
registerReactiveDependencyReader(property: string, read: () => unknown): void;
|
|
55
176
|
/**
|
|
56
|
-
*
|
|
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.
|
|
57
179
|
*/
|
|
58
|
-
|
|
180
|
+
trackReactiveRead(property: string): void;
|
|
59
181
|
/**
|
|
60
|
-
* Renders a template into the specified target element.
|
|
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
|
+
*
|
|
61
189
|
* @param options - The rendering options.
|
|
62
190
|
* @param options.target - The target element to render the template into.
|
|
63
191
|
* @param options.template - The template string to render.
|
|
64
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.
|
|
65
194
|
*/
|
|
66
195
|
renderTemplate(options: {
|
|
67
196
|
target: HTMLElement;
|
|
68
197
|
template: string;
|
|
69
198
|
insert?: RenderInsertPosition;
|
|
199
|
+
sanitize?: (html: string) => string;
|
|
70
200
|
}): void;
|
|
71
201
|
/**
|
|
72
202
|
* Called when the Radiant element is connected to a context.
|
|
73
203
|
* @param context - The connected context.
|
|
74
204
|
*/
|
|
75
205
|
connectedContextCallback(context: UnknownContext): void;
|
|
206
|
+
/**
|
|
207
|
+
* Gets a reference to a child element by its data-ref attribute.
|
|
208
|
+
* @param ref - The data-ref attribute value of the element to get.
|
|
209
|
+
* @param all - Whether to get all elements with the specified data-ref attribute value.
|
|
210
|
+
* @returns The element with the specified data-ref attribute value, an array of elements or null if no element was found.
|
|
211
|
+
*/
|
|
212
|
+
getRef<T extends Element = Element>(ref: string, all: true): T[];
|
|
213
|
+
getRef<T extends Element = Element>(ref: string, all?: false): T | null;
|
|
76
214
|
}
|
|
77
215
|
/**
|
|
78
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.
|
|
79
224
|
* @extends HTMLElement
|
|
80
|
-
* @implements IRadiantElement
|
|
225
|
+
* @implements IRadiantElement<Bindings>
|
|
81
226
|
*/
|
|
82
|
-
export declare class RadiantElement extends
|
|
83
|
-
|
|
84
|
-
|
|
227
|
+
export declare class RadiantElement<Bindings extends object = {}> extends RadiantElementBase implements IRadiantElement<Bindings> {
|
|
228
|
+
readonly bindings: ReactiveBindings<Bindings>;
|
|
229
|
+
readonly $: ReactiveBindings<Bindings>;
|
|
230
|
+
/**
|
|
231
|
+
* A map of property metadata objects, it contains useful information about the properties configured via decorators.
|
|
232
|
+
*/
|
|
233
|
+
private reactiveProperties;
|
|
234
|
+
/**
|
|
235
|
+
* A map of reactive fields, it contains the reactive fields configured via decorators.
|
|
236
|
+
*/
|
|
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;
|
|
260
|
+
/**
|
|
261
|
+
* A map of property update callbacks. These callbacks are called when a property is updated.
|
|
262
|
+
*/
|
|
263
|
+
private updateCallbacks;
|
|
264
|
+
/**
|
|
265
|
+
* A map of event subscriptions used to manage event listeners on the Radiant element.
|
|
266
|
+
*/
|
|
85
267
|
private eventSubscriptions;
|
|
268
|
+
/**
|
|
269
|
+
* A map for event emitters
|
|
270
|
+
*/
|
|
271
|
+
private eventEmitters;
|
|
272
|
+
/**
|
|
273
|
+
* Callbacks executed whenever the Radiant element is connected to the DOM.
|
|
274
|
+
*/
|
|
275
|
+
private onConnectedCallbacks;
|
|
276
|
+
/**
|
|
277
|
+
* An array of cleanup callbacks to be executed when the Radiant element is disconnected from the DOM.
|
|
278
|
+
*/
|
|
279
|
+
private onDisconnectedCallback;
|
|
280
|
+
/**
|
|
281
|
+
* A flag indicating whether the element has been connected to the DOM.
|
|
282
|
+
*/
|
|
86
283
|
private elementReady;
|
|
284
|
+
constructor();
|
|
285
|
+
private createReactiveBindingNamespace;
|
|
87
286
|
connectedCallback(): void;
|
|
88
287
|
connectedContextCallback(_contextName: UnknownContext): void;
|
|
89
288
|
disconnectedCallback(): void;
|
|
90
|
-
|
|
289
|
+
notifyUpdate(changedProperty: string, oldValue: unknown, value: unknown): void;
|
|
290
|
+
private transformAttributeValue;
|
|
91
291
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
92
|
-
|
|
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, }: {
|
|
93
301
|
target: HTMLElement;
|
|
94
302
|
template: string;
|
|
95
303
|
insert?: RenderInsertPosition;
|
|
304
|
+
sanitize?: (html: string) => string;
|
|
96
305
|
}): void;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
306
|
+
registerReactiveProperty(config: ReactiveProperty): void;
|
|
307
|
+
protected getReactiveProperties(): ReactiveProperty[];
|
|
308
|
+
registerReactiveField<T>(config: ReactiveField<T>): void;
|
|
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;
|
|
339
|
+
subscribeEvents(events: RadiantElementEventListener[]): Array<() => void>;
|
|
340
|
+
subscribeEvent(eventConfig: RadiantElementEventListener): () => void;
|
|
341
|
+
private unsubscribeEvent;
|
|
342
|
+
private removeAllSubscribedEvents;
|
|
343
|
+
/**
|
|
344
|
+
* Registers a callback that runs on every future disconnect.
|
|
345
|
+
*/
|
|
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;
|
|
355
|
+
registerEventEmitter(name: string, emitter: EventEmitter): void;
|
|
356
|
+
getRef<T extends Element = Element>(ref: string, all: true): T[];
|
|
357
|
+
getRef<T extends Element = Element>(ref: string, all?: false): T | null;
|
|
358
|
+
createReactiveField<T>(propertyName: string, initialValue: T, options?: ReactiveFieldOptions): void;
|
|
359
|
+
createReactiveProp<T = unknown>(propertyName: string, options: ReactivePropertyOptions<T>): void;
|
|
101
360
|
}
|
|
361
|
+
export {};
|
|
@@ -1,83 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
class RadiantElement extends HTMLElement {
|
|
3
|
-
eventSubscriptions = new Map;
|
|
4
|
-
elementReady = false;
|
|
5
|
-
connectedCallback() {
|
|
6
|
-
this.elementReady = true;
|
|
7
|
-
}
|
|
8
|
-
connectedContextCallback(_contextName) {
|
|
9
|
-
}
|
|
10
|
-
disconnectedCallback() {
|
|
11
|
-
this.removeAllSubscribedEvents();
|
|
12
|
-
}
|
|
13
|
-
updated(changedProperty, oldValue, value) {
|
|
14
|
-
if (!this.elementReady || !this.updatesRegistry || oldValue === value)
|
|
15
|
-
return;
|
|
16
|
-
const updates = this.updatesRegistry.get(changedProperty);
|
|
17
|
-
if (updates) {
|
|
18
|
-
for (const update of updates) {
|
|
19
|
-
this[update]();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
24
|
-
if (oldValue === newValue || !this.elementReady)
|
|
25
|
-
return;
|
|
26
|
-
if (name in this) {
|
|
27
|
-
const config = this.propertyConfigMap.get(name);
|
|
28
|
-
const transformedValue = newValue ? config?.converter.fromAttribute(newValue) : newValue;
|
|
29
|
-
const transformedOldValue = oldValue ? config?.converter.fromAttribute(oldValue) : oldValue;
|
|
30
|
-
this[name] = transformedValue;
|
|
31
|
-
this.updated(name, transformedOldValue, transformedValue);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
renderTemplate({
|
|
35
|
-
target = this,
|
|
36
|
-
template,
|
|
37
|
-
insert = "replace"
|
|
38
|
-
}) {
|
|
39
|
-
switch (insert) {
|
|
40
|
-
case "replace":
|
|
41
|
-
target.innerHTML = template;
|
|
42
|
-
break;
|
|
43
|
-
case "beforeend":
|
|
44
|
-
target.insertAdjacentHTML("beforeend", template);
|
|
45
|
-
break;
|
|
46
|
-
case "afterbegin":
|
|
47
|
-
target.insertAdjacentHTML("afterbegin", template);
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
subscribeEvents(events) {
|
|
52
|
-
for (const event of events) {
|
|
53
|
-
this.subscribeEvent(event);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
subscribeEvent(eventConfig) {
|
|
57
|
-
const delegatedListener = (delegatedEvent) => {
|
|
58
|
-
if (delegatedEvent.target && delegatedEvent.target.matches(eventConfig.selector)) {
|
|
59
|
-
eventConfig.listener.call(this, delegatedEvent);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
this.addEventListener(eventConfig.type, delegatedListener, eventConfig.options);
|
|
63
|
-
this.eventSubscriptions.set(eventConfig.id, { ...eventConfig, listener: delegatedListener });
|
|
64
|
-
}
|
|
65
|
-
unsubscribeEvent(id) {
|
|
66
|
-
const eventSubscription = this.eventSubscriptions.get(id);
|
|
67
|
-
if (eventSubscription) {
|
|
68
|
-
this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);
|
|
69
|
-
this.eventSubscriptions.delete(id);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
removeAllSubscribedEvents() {
|
|
73
|
-
for (const eventSubscription of this.eventSubscriptions.values()) {
|
|
74
|
-
this.removeEventListener(eventSubscription.type, eventSubscription.listener, eventSubscription.options);
|
|
75
|
-
}
|
|
76
|
-
this.eventSubscriptions.clear();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
export {
|
|
80
|
-
RadiantElement
|
|
81
|
-
};
|
|
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};
|
|
82
2
|
|
|
83
|
-
//# debugId=
|
|
3
|
+
//# debugId=81AC4D5FEB0D36DD64756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { UnknownContext } from '@/context/types';\nimport type { AttributeTypeConstant, ReadAttributeValueReturnType, WriteAttributeValueReturnType } from '@/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 id: string;\n options?: AddEventListenerOptions;\n};\n\n/**\n * Represents a property metadata object.\n */\nexport interface PropertyConfig {\n type: AttributeTypeConstant;\n propertyName: string;\n attributeKey: string;\n converter: {\n fromAttribute: (value: string) => ReadAttributeValueReturnType;\n toAttribute: (value: any) => WriteAttributeValueReturnType;\n };\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 updated(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 * Unsubscribes from a Radiant element event.\n * @param id - The ID of the event listener to unsubscribe from.\n */\n unsubscribeEvent(id: string): void;\n\n /**\n * Removes all subscribed events from the Radiant element.\n */\n removeAllSubscribedEvents(): 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/**\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 declare propertyConfigMap: Map<string, PropertyConfig>;\n declare updatesRegistry: Map<string, Set<string>>;\n private eventSubscriptions = new Map<string, RadiantElementEventListener>();\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 }\n\n updated(changedProperty: string, oldValue: unknown, value: unknown) {\n if (!this.elementReady || !this.updatesRegistry || oldValue === value) return;\n const updates = this.updatesRegistry.get(changedProperty);\n if (updates) {\n for (const update of updates) {\n (this as any)[update]();\n }\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n if (oldValue === newValue || !this.elementReady) return;\n\n if (name in this) {\n const config = this.propertyConfigMap.get(name);\n const transformedValue = newValue ? config?.converter.fromAttribute(newValue) : newValue;\n const transformedOldValue = oldValue ? config?.converter.fromAttribute(oldValue) : oldValue;\n (this as RadiantElement & { [key: string]: any })[name] = transformedValue;\n this.updated(name, transformedOldValue, transformedValue);\n }\n }\n\n 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 subscribeEvents(events: RadiantElementEventListener[]): void {\n for (const event of events) {\n this.subscribeEvent(event);\n }\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\n this.addEventListener(eventConfig.type, delegatedListener, eventConfig.options);\n this.eventSubscriptions.set(eventConfig.id, { ...eventConfig, listener: delegatedListener });\n }\n\n public 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 public 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"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "81AC4D5FEB0D36DD64756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|