@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
package/dist/index.js.map
CHANGED
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * Registers a web component with the given name on the global `window.customElements` registry.\n * @param name selector name.\n */\nexport function customElement(name: string) {\n return (target: CustomElementConstructor) => {\n if (!globalThis.window) return;\n if (!window.customElements.get(name)) {\n window.customElements.define(name, target);\n }\n };\n}\n",
|
|
6
|
-
"import type { RadiantElement } from '..';\n\nexport interface EventEmitterConfig {\n name: string;\n bubbles?: boolean;\n cancelable?: boolean;\n composed?: boolean;\n}\n\n/**\n * A generic event emitter class that allows emitting custom events.\n *\n * @template T - The type of the event detail.\n */\nexport class EventEmitter<T = unknown> {\n private host: RadiantElement;\n private eventConfig: EventEmitterConfig;\n\n /**\n * Constructs a new instance of the EventEmitter class.\n *\n * @param host - The host element on which the events will be dispatched.\n * @param eventConfig - The configuration for the event.\n */\n constructor(host: RadiantElement, eventConfig: EventEmitterConfig) {\n this.host = host;\n this.eventConfig = eventConfig;\n }\n\n /**\n * Emits a custom event with the specified detail.\n *\n * @param detail - The detail object to be passed along with the event.\n */\n emit(detail?: T) {\n const event = new CustomEvent(this.eventConfig.name, {\n detail: detail,\n bubbles: this.eventConfig.bubbles,\n cancelable: this.eventConfig.cancelable,\n composed: this.eventConfig.composed,\n });\n this.host.dispatchEvent(event);\n }\n}\n",
|
|
7
|
-
"import { EventEmitter, type EventEmitterConfig } from '@/tools/event-emitter';\n\nconst eventEmitters = new WeakMap();\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n return (target: any, propertyKey: string) => {\n if (!propertyKey) {\n throw new Error('The propertyKey is missing for the event decorator.');\n }\n\n if (!eventConfig || !eventConfig.name) {\n throw new Error('Invalid eventConfig provided.');\n }\n\n const uniqueKey = Symbol(eventConfig.name);\n\n Object.defineProperty(target, propertyKey, {\n get() {\n const emittersMap: Map<symbol, EventEmitter> = eventEmitters.get(this) || new Map();\n if (!emittersMap.has(uniqueKey)) {\n emittersMap.set(uniqueKey, new EventEmitter(this, eventConfig));\n eventEmitters.set(this, emittersMap);\n }\n\n return emittersMap.get(uniqueKey);\n },\n });\n };\n}\n",
|
|
8
|
-
"import type { RadiantElement, RadiantElementEventListener } from '@/core/radiant-element';\n\ntype OnEventConfig = Pick<RadiantElementEventListener, 'type' | 'options'> &\n (\n | {\n selector: string;\n }\n | {\n ref: string;\n }\n | {\n window: boolean;\n }\n | {\n document: boolean;\n }\n );\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n *\n * @param eventConfig The event configuration.\n * @param eventConfig.selectors The CSS selector(s) of the target element(s).\n * @param eventConfig.ref The data-ref attribute of the target element.\n * @param eventConfig.type The type of the event to listen for.\n * @param eventConfig.options Optional. An options object that specifies characteristics about the event listener.\n */\nexport function onEvent(eventConfig: OnEventConfig) {\n return (proto: RadiantElement, _: string, descriptor: PropertyDescriptor) => {\n const originalConnectedCallback = proto.connectedCallback;\n const originalDisconnectedCallback = proto.disconnectedCallback;\n\n if ('window' in eventConfig) {\n proto.connectedCallback = function (this: RadiantElement) {\n window.addEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);\n originalConnectedCallback.call(this);\n };\n\n proto.disconnectedCallback = function (this: RadiantElement) {\n window.removeEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);\n originalDisconnectedCallback.call(this);\n };\n\n return descriptor;\n }\n\n if ('document' in eventConfig) {\n proto.connectedCallback = function (this: RadiantElement) {\n document.addEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);\n originalConnectedCallback.call(this);\n };\n\n proto.disconnectedCallback = function (this: RadiantElement) {\n document.removeEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);\n originalDisconnectedCallback.call(this);\n };\n\n return descriptor;\n }\n\n const selector = 'selector' in eventConfig ? eventConfig.selector : `[data-ref=\"${eventConfig.ref}\"]`;\n\n const originalMethod = descriptor.value;\n const subscriptionId = `${eventConfig.type}-${selector}`;\n\n proto.connectedCallback = function (this: RadiantElement) {\n this.subscribeEvent({\n id: subscriptionId,\n selector: selector,\n type: eventConfig.type,\n listener: originalMethod.bind(this),\n options: eventConfig?.options ?? undefined,\n });\n\n originalConnectedCallback.call(this);\n };\n\n return descriptor;\n };\n}\n",
|
|
9
|
-
"import type { RadiantElement } from '@/core/radiant-element';\n\n/**\n * A decorator to subscribe to an updated callback when a reactive field or property changes.\n * @param eventConfig The event configuration.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n return (proto: RadiantElement, methodName: string) => {\n if (!('updatesRegistry' in proto)) {\n Object.defineProperty(proto, 'updatesRegistry', {\n value: new Map<string, Set<string>>(),\n configurable: true,\n });\n }\n\n const updatesRegistry = proto.updatesRegistry;\n\n if (Array.isArray(keyOrKeys)) {\n for (const key of keyOrKeys) {\n if (!updatesRegistry.has(key)) {\n updatesRegistry.set(key, new Set());\n }\n updatesRegistry.get(key)?.add(methodName);\n }\n } else if (typeof keyOrKeys === 'string') {\n if (!updatesRegistry.has(keyOrKeys)) {\n updatesRegistry.set(keyOrKeys, new Set());\n }\n updatesRegistry.get(keyOrKeys)?.add(methodName);\n }\n };\n}\n",
|
|
10
|
-
"import type { RadiantElement } from '@/core';\n\n/**\n * The base configuration object for the query.\n */\ntype BaseQueryConfig = {\n all?: boolean;\n cache?: boolean;\n};\n\n/**\n * The configuration object for the query.\n * It can be configured to query by CSS selector or data-ref attribute.\n */\nexport type QueryConfig = BaseQueryConfig &\n (\n | {\n selector: string;\n }\n | {\n ref: string;\n }\n );\n\n/**\n * A decorator to query by CSS selector or data-ref attribute.\n * By default it queries for the first element that matches the selector, but it can be configured to query for all elements.\n *\n * @param {QueryConfig} options - The configuration object for the query.\n * @param {boolean} [options.all] - A flag to query for all elements that match the selector. Defaults to `false`.\n * @param {boolean} [options.cache] - A flag to cache the query result. Defaults to `true`.\n * @param {string} [options.selector] - A CSS selector to match elements against. This property is mutually exclusive with `options.ref`.\n * @param {string} [options.ref] - A reference to an element. This property is mutually exclusive with `options.selector`.\n *\n * @returns {Function} A decorator function that, when applied to a class property, will replace it with a getter. The getter will return the result of the query when accessed.\n *\n * @example\n * class MyElement extends HTMLElement {\n * @query({ selector: '.my-class' })\n * myElement;\n * }\n *\n * // Now, `myElement` will return the first element in the light DOM of `MyElement` that matches the selector '.my-class'.\n */\nexport function query({\n cache: shouldBeCached = true,\n ...options\n}: QueryConfig): (proto: RadiantElement, propertyKey: string | symbol) => void {\n const cache = new WeakMap<Element, Element | NodeList | null>();\n\n return (proto: RadiantElement, propertyKey: string | symbol) => {\n const doQuery = function (this: Element) {\n if (shouldBeCached) {\n const cachedResult = cache.get(this);\n if (cachedResult !== undefined) {\n return cachedResult;\n }\n }\n\n const selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n const queryResult = options.all ? this.querySelectorAll(selector) : this.querySelector(selector);\n\n if (shouldBeCached) {\n cache.set(this, queryResult);\n }\n\n return queryResult;\n };\n\n const originalConnectedCallback = proto.connectedCallback;\n\n proto.connectedCallback = function (this: RadiantElement) {\n Object.defineProperty(this, propertyKey, {\n get: doQuery,\n enumerable: true,\n configurable: true,\n });\n\n originalConnectedCallback.call(this);\n };\n };\n}\n",
|
|
11
|
-
"export type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n switch (constant) {\n case Array:\n return 'array';\n case Boolean:\n return 'boolean';\n case Number:\n return 'number';\n case Object:\n return 'object';\n case String:\n return 'string';\n }\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n switch (typeof defaultValue) {\n case 'boolean':\n return 'boolean';\n case 'number':\n return 'number';\n case 'string':\n return 'string';\n }\n\n if (Array.isArray(defaultValue)) return 'array';\n if (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n switch (type) {\n case Number:\n return 0;\n case String:\n return '';\n case Boolean:\n return false;\n default:\n return null;\n }\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n try {\n return JSON.parse(value);\n } catch (error) {\n throw new TypeError('Invalid JSON string');\n }\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n array(value: string): unknown[] {\n const array = parseJSON<unknown[]>(value);\n if (!Array.isArray(array)) {\n throw new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n }\n return array;\n },\n\n boolean(value: string): boolean {\n return !(value === '0' || String(value).toLowerCase() === 'false');\n },\n\n number(value: string): number {\n const number = Number(value.replace(/_/g, ''));\n return number;\n },\n\n object(value: string): object {\n const object = JSON.parse(value);\n if (object === null || typeof object !== 'object' || Array.isArray(object)) {\n throw new TypeError(\n `expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n object,\n )}\"`,\n );\n }\n return object;\n },\n\n string(value: string): string {\n return value;\n },\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n default: writeString,\n array: writeJSON,\n object: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n return JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n return `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n const readerType = parseAttributeTypeConstant(type);\n if (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n return readers[readerType](value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n const writerType = parseAttributeTypeConstant(type);\n if (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n return (writers[writerType] || writers.default)(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n return typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n return Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n return typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n switch (type) {\n case Boolean:\n return isBoolean(defaultValue);\n case Number:\n return isNumber(defaultValue);\n case String:\n return isString(defaultValue);\n case Array:\n return isArray(defaultValue);\n case Object:\n return isObject(defaultValue);\n default:\n return false;\n }\n}\n",
|
|
12
|
-
"import type { PropertyConfig, RadiantElement } from '@/core/radiant-element';\nimport {\n type AttributeTypeConstant,\n defaultValueForType,\n isValueOfType,\n readAttributeValue,\n writeAttributeValue,\n} from '@/utils/attribute-utils';\n\ntype ReactivePropertyOptions<T> = {\n type: AttributeTypeConstant;\n reflect?: boolean;\n attribute?: string;\n defaultValue?: T;\n};\n\n/**\n * A decorator to define a reactive property.\n * Every time the property changes, the `updated` method will be called.\n * @param options The options for the reactive property.\n * @param options.type The type of the property value.\n * @param options.reflect Whether to reflect the property to the attribute.\n * @param options.attribute The name of the attribute.\n * @param options.defaultValue The default value of the property.\n */\nexport function reactiveProp<T = unknown>({ type, attribute, reflect, defaultValue }: ReactivePropertyOptions<T>) {\n if (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n throw new Error(`defaultValue does not match the expected type for ${type.name}`);\n }\n\n return (target: RadiantElement, propertyName: string) => {\n const originalValues = new WeakMap<WeakKey, unknown>();\n const attributeKey = attribute ?? propertyName;\n\n if (propertyName in target) {\n throw new Error(`Property \"${propertyName}\" already exists on ${target.constructor.name}`);\n }\n\n const propertyMapping: PropertyConfig = {\n type,\n propertyName,\n attributeKey,\n converter: {\n fromAttribute: (value) => readAttributeValue(value, type),\n toAttribute: (value) => writeAttributeValue(value, type),\n },\n };\n\n addPropertyToMappings(target, propertyMapping);\n\n Object.defineProperty(target, propertyName, {\n get: function () {\n if (!originalValues.has(this)) {\n const initialValue = getInitialValue(this, type, attributeKey, defaultValue as T);\n originalValues.set(this, initialValue);\n }\n return originalValues.get(this);\n },\n set: function (newValue: T) {\n const oldValue = originalValues.get(this);\n if (oldValue === newValue) return;\n originalValues.set(this, newValue);\n if (reflect) {\n const attributeValue = propertyMapping.converter.toAttribute(newValue);\n this.setAttribute(attributeKey, attributeValue);\n }\n this.updated(propertyName, oldValue, newValue);\n },\n enumerable: true,\n configurable: true,\n });\n\n const originalConnectedCallback = target.connectedCallback;\n\n target.connectedCallback = function (this: RadiantElement) {\n originalConnectedCallback.call(this);\n this.updated(propertyName, null, defaultValue);\n };\n\n addObservedAttribute(target, attributeKey);\n };\n}\n\nconst getInitialValue = (\n target: RadiantElement,\n type: AttributeTypeConstant,\n attributeKey: string,\n defaultValue: unknown,\n) => {\n if (type === Boolean) {\n const hasAttribute = target.hasAttribute(attributeKey);\n return hasAttribute || defaultValue;\n }\n\n const attributeValue = target.getAttribute(attributeKey);\n return attributeValue !== null\n ? readAttributeValue(attributeValue, type)\n : defaultValue || (defaultValueForType(type) as typeof defaultValue);\n};\n\nconst addPropertyToMappings = (target: RadiantElement, propertyMapping: PropertyConfig) => {\n if (!('propertyConfigMap' in target)) {\n Object.defineProperty(target, 'propertyConfigMap', {\n value: new Map<string, PropertyConfig>(),\n configurable: true,\n });\n }\n\n target.propertyConfigMap.set(propertyMapping.propertyName, propertyMapping);\n};\n\nfunction addObservedAttribute(target: RadiantElement, attribute: string) {\n const ctor = target.constructor as typeof RadiantElement;\n const existingObservedAttributes = (ctor as any).observedAttributes || [];\n if (!existingObservedAttributes.includes(attribute)) {\n const newObservedAttributes = [...existingObservedAttributes, attribute];\n Object.defineProperty(ctor, 'observedAttributes', {\n get() {\n return newObservedAttributes;\n },\n configurable: true,\n });\n }\n}\n",
|
|
13
|
-
"import type { RadiantElement } from '@/core/radiant-element';\n\n/**\n * A decorator to define a reactive field.\n * Every time the property changes, the `updated` method will be called.\n * Due the fact the value is always undefined before the first update,\n * we are adding a `isDefined` WeakSet to track if the property has been defined.\n * @param target The target element.\n * @param propertyKey The property key.\n */\nexport function reactiveField(proto: RadiantElement, propertyKey: string) {\n const originalValues = new WeakMap<WeakKey, unknown>();\n const isDefined = new WeakSet<WeakKey>();\n\n Object.defineProperty(proto, propertyKey, {\n get: function () {\n return originalValues.get(this);\n },\n set: function (newValue: unknown) {\n if (isDefined.has(this)) {\n const oldValue = originalValues.get(this);\n if (oldValue !== newValue) {\n originalValues.set(this, newValue);\n this.updated(propertyKey, oldValue, newValue);\n }\n } else {\n originalValues.set(this, newValue);\n isDefined.add(this);\n }\n },\n });\n}\n",
|
|
14
|
-
"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",
|
|
15
|
-
"import type { Context } from './types';\n\n/**\n * A function which creates a Context value object\n */\nexport const createContext = <ValueType>(key: unknown) => key as Context<typeof key, ValueType>;\n",
|
|
16
|
-
"import type { Context, ContextCallback, ContextType, UnknownContext } from './types';\n\n/**\n * List of events which can be emitted by a context provider or requester.\n */\nexport enum ContextEventsTypes {\n SUBSCRIPTION_REQUEST = 'context--subscription-request',\n CONTEXT_REQUEST = 'context-request',\n ON_MOUNT = 'context--on-mount',\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n */\nexport class ContextRequestEvent<T extends UnknownContext> extends Event {\n public constructor(\n public readonly context: T,\n public readonly callback: ContextCallback<ContextType<T>>,\n public readonly subscribe?: boolean,\n ) {\n super(ContextEventsTypes.CONTEXT_REQUEST, { bubbles: true, composed: true });\n }\n}\n\n/**\n * A type which represents a subscription to a context value.\n */\nexport type ContextSubscription<T extends UnknownContext> = {\n select?: (context: ContextType<T>) => unknown;\n callback: (value: unknown) => void;\n};\n\n/**\n * An event fired by a context provider to signal that a context value has been mounted and is available for consumption.\n */\nexport class ContextOnMountEvent extends CustomEvent<{ context: UnknownContext }> {\n public constructor(context: UnknownContext) {\n super(ContextEventsTypes.ON_MOUNT, {\n detail: { context },\n bubbles: true,\n composed: true,\n });\n }\n}\n\n/**\n * An event fired by a context requester to signal it desires a named context.\n *\n * A provider should inspect the `context` property of the event to determine if it has a value that can\n * satisfy the request, calling the `callback` with the requested value if so.\n *\n * If the requested context event contains a truthy `subscribe` value, then a provider can call the callback\n * multiple times if the value is changed, if this is the case the provider should pass an `unsubscribe`\n * function to the callback which requesters can invoke to indicate they no longer wish to receive these updates.\n *\n * It accepts a `selector` property which can be used to request a specific property of the context value.\n */\nexport class ContextSubscriptionRequestEvent<T extends UnknownContext> extends Event {\n public constructor(\n public readonly context: T,\n public readonly callback: (value: ContextType<T> | { [K in keyof ContextType<T>]: ContextType<T>[K] }) => void,\n public readonly select?: (context: ContextType<T>) => unknown,\n public readonly subscribe?: boolean,\n ) {\n super(ContextEventsTypes.SUBSCRIPTION_REQUEST, {\n bubbles: true,\n composed: true,\n });\n }\n}\n\ndeclare global {\n interface HTMLElementEventMap {\n /**\n * A 'context-request-subscription' event can be emitted by any element which desires\n * a context value to be injected by an external provider.\n */\n [ContextEventsTypes.SUBSCRIPTION_REQUEST]: ContextSubscriptionRequestEvent<UnknownContext>;\n /**\n * A context-request-provider event can be emitted by a context requester to signal\n * that it desires a context value to be provided by a context provider.\n */\n [ContextEventsTypes.CONTEXT_REQUEST]: ContextRequestEvent<Context<unknown, unknown>>;\n /**\n * A 'context-mount' event can be emitted by a context provider to signal\n * that a context value has been mounted and is available for consumption.\n */\n [ContextEventsTypes.ON_MOUNT]: ContextOnMountEvent;\n }\n}\n",
|
|
17
|
-
"import type { RadiantElement } from '@/core/radiant-element';\nimport { type AttributeTypeConstant, readAttributeValue } from '@/utils/attribute-utils';\nimport { query } from '..';\nimport {\n ContextEventsTypes,\n ContextOnMountEvent,\n type ContextRequestEvent,\n type ContextSubscription,\n type ContextSubscriptionRequestEvent,\n} from './events';\nimport type { Context, ContextType, UnknownContext } from './types';\n\ntype ContextProviderOptions<T extends UnknownContext> = {\n context: UnknownContext;\n initialValue?: T['__context__'];\n hydrate?: AttributeTypeConstant;\n};\n\n/**\n * Represents a context provider that allows setting and getting the context,\n * as well as subscribing to context updates.\n *\n * @template T - The type of the context.\n */\nexport interface IContextProvider<T extends Context<unknown, unknown>> {\n /**\n * Sets the context with the provided update and invokes the optional callback function.\n *\n * @param update - The partial update to be applied to the context.\n * @param callback - An optional callback function that receives the updated context.\n */\n setContext: (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => void;\n\n /**\n * Gets the current context.\n *\n * @returns The current context.\n */\n getContext: () => ContextType<T>;\n\n /**\n * Subscribes to context updates.\n *\n * @param subscription - The subscription object that defines the callback function to be invoked on context updates.\n */\n subscribe: (subscription: ContextSubscription<T>) => void;\n}\n\n/**\n * It creates a context provider that allows setting and getting the context,\n * It will also be in charge of notifying the subscribers when the context changes.\n *\n * @template T - The type of the context.\n * @implements IContextProvider\n *\n * @example\n * ```ts\n * export class MyElement extends RadiantElement {\n * provider = new ContextProvider<typeof myContext>(this, {\n * context: myContext,\n * initialValue: {\n * value: 'Hello World',\n * },\n * });\n * ```\n */\nexport class ContextProvider<T extends Context<unknown, unknown>> implements IContextProvider<T> {\n private host: RadiantElement;\n private context: UnknownContext;\n private value: ContextType<T> | undefined;\n\n subscriptions: ContextSubscription<T>[] = [];\n\n /**\n * Creates a new instance of the ContextProvider.\n *\n * @param host - The host element that will contain the context provider.\n * @param options - The options to configure the context provider.\n */\n constructor(host: RadiantElement, options: ContextProviderOptions<T>) {\n this.host = host;\n this.context = options.context;\n let contextValue: T['__context__'] | undefined = options.initialValue;\n\n if (options.hydrate) {\n const hydrationScriptElement = this.host.querySelector('script[data-hydration]');\n if (hydrationScriptElement?.textContent) {\n const hydrationValue = hydrationScriptElement.textContent;\n const parsedHydrationValue = readAttributeValue(hydrationValue, options.hydrate) as ContextType<T>;\n\n if (\n options.hydrate === Object &&\n this.isObject(parsedHydrationValue) &&\n (this.isObject(contextValue) || typeof contextValue === 'undefined')\n ) {\n contextValue = {\n ...(contextValue ?? {}),\n ...parsedHydrationValue,\n };\n } else {\n contextValue = parsedHydrationValue;\n }\n }\n }\n\n this.value = contextValue as ContextType<T>;\n\n this.registerEvents();\n this.host.dispatchEvent(new ContextOnMountEvent(this.context));\n }\n\n setContext = (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => {\n if (typeof this.value === 'object') {\n const oldContext = { ...this.value };\n this.value = { ...this.value, ...update };\n if (callback) callback(this.value);\n this.notifySubscribers(this.value, oldContext);\n }\n };\n\n getContext = () => {\n return this.value as ContextType<T>;\n };\n\n subscribe = ({ select, callback }: ContextSubscription<T>) => {\n this.subscriptions.push({ select, callback });\n };\n\n private isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && !Array.isArray(value) && value !== null;\n }\n\n private notifySubscribers = (newContext: ContextType<T>, prevContext: ContextType<T>) => {\n for (const sub of this.subscriptions) {\n if (!sub.select) return this.sendSubscriptionUpdate(sub, newContext);\n const newSelected = sub.select(newContext);\n const prevSelected = sub.select(prevContext);\n if (newSelected !== prevSelected) {\n this.sendSubscriptionUpdate(sub, newContext);\n }\n }\n };\n\n private sendSubscriptionUpdate = ({ select, callback }: ContextSubscription<T>, context: ContextType<T>) => {\n if (!select) callback(context);\n else callback(select(context));\n };\n\n private handleSubscriptionRequest = ({\n select,\n callback,\n subscribe,\n }: {\n select?: ContextSubscription<T>['select'];\n callback: ContextSubscription<T>['callback'];\n subscribe?: boolean;\n }) => {\n if (subscribe) this.subscribe({ select, callback });\n\n if (!this.value) return;\n\n if (select) {\n callback(select(this.value));\n } else {\n callback(this.value as ContextType<T>);\n }\n };\n\n private onSubscriptionRequest = (event: ContextSubscriptionRequestEvent<UnknownContext>) => {\n const { context, callback, subscribe, select, target } = event;\n if (context !== this.context) return;\n\n event.stopPropagation();\n\n (target as HTMLElement).dispatchEvent(new ContextOnMountEvent(this.context));\n\n this.handleSubscriptionRequest({ select, callback, subscribe });\n };\n\n private onContextRequest = (event: ContextRequestEvent<UnknownContext>) => {\n const { context, callback } = event;\n if (context !== this.context) return;\n event.stopPropagation();\n callback(this);\n };\n\n private registerEvents = () => {\n this.host.addEventListener(ContextEventsTypes.SUBSCRIPTION_REQUEST, this.onSubscriptionRequest);\n this.host.addEventListener(ContextEventsTypes.CONTEXT_REQUEST, this.onContextRequest);\n };\n}\n",
|
|
18
|
-
"import { ContextProvider } from '@/context/context-provider';\nimport type { UnknownContext } from '@/context/types';\nimport type { RadiantElement } from '@/core/radiant-element';\nimport type { AttributeTypeConstant } from '@/utils/attribute-utils';\n\ntype CreateContextOptions<T extends UnknownContext> = {\n context: T;\n initialValue?: T['__context__'];\n hydrate?: AttributeTypeConstant;\n};\n\n/**\n * A decorator to provide a context to the target element.\n * @param contextToProvide\n * @returns\n */\nexport function provideContext<T extends UnknownContext>({ context, initialValue, hydrate }: CreateContextOptions<T>) {\n return (proto: RadiantElement, propertyKey: string) => {\n const originalConnectedCallback = proto.connectedCallback;\n\n proto.connectedCallback = function (this: RadiantElement) {\n originalConnectedCallback.call(this);\n (this as any)[propertyKey] = new ContextProvider<T>(this, { context, initialValue, hydrate });\n this.connectedContextCallback(context);\n };\n };\n}\n",
|
|
19
|
-
"import { ContextRequestEvent } from '@/context/events';\nimport type { UnknownContext } from '@/context/types';\nimport type { RadiantElement } from '@/core/radiant-element';\n\n/**\n * A decorator to provide a context to the target element.\n * @param contextToProvide\n * @returns\n */\nexport function consumeContext(contextToProvide: UnknownContext) {\n return (proto: RadiantElement, propertyKey: string) => {\n const originalConnectedCallback = proto.connectedCallback;\n\n proto.connectedCallback = function (this: RadiantElement) {\n originalConnectedCallback.call(this);\n this.dispatchEvent(\n new ContextRequestEvent(contextToProvide, (context) => {\n (this as any)[propertyKey] = context;\n this.connectedContextCallback(contextToProvide);\n }),\n );\n };\n };\n}\n",
|
|
20
|
-
"import { ContextSubscriptionRequestEvent } from '@/context/events';\nimport type { Context, ContextType, UnknownContext } from '@/context/types';\nimport type { RadiantElement } from '@/core/radiant-element';\n\ntype ArgsType<T extends UnknownContext> = SubscribeToContextOptions<T>['select'] extends (...args: any[]) => infer R\n ? R\n : ContextType<T>;\n\ntype SubscribeToContextOptions<T extends UnknownContext> = {\n context: T;\n select?: (context: T['__context__']) => unknown;\n subscribe?: boolean;\n};\n/**\n * A decorator to subscribe to a context selector.\n * @param context The context to subscribe to.\n * @param selector The selector to subscribe to. If not provided, the whole context will be subscribed to.\n * @param subscribe @default true Whether to subscribe or unsubscribe. Optional.\n * @returns\n */\nexport function contextSelector<T extends Context<unknown, unknown>>({\n context,\n select,\n subscribe = true,\n}: SubscribeToContextOptions<T>) {\n return (proto: RadiantElement, _: string, descriptor: PropertyDescriptor) => {\n const originalMethod = descriptor.value;\n const originalConnectedCallback = proto.connectedCallback;\n\n proto.connectedCallback = function (this: RadiantElement) {\n originalConnectedCallback.call(this);\n this.dispatchEvent(new ContextSubscriptionRequestEvent(context, originalMethod.bind(this), select, subscribe));\n };\n\n descriptor.value = function (...args: ArgsType<T>[]) {\n const result = originalMethod.apply(this, args);\n return result;\n };\n\n return descriptor;\n };\n}\n",
|
|
21
|
-
"import type { RadiantElement, RenderInsertPosition } from '@/core/radiant-element';\n\ntype Constructor<T> = new (...args: any[]) => T;\n\ntype WithKitaRenderTemplateProps = {\n target: HTMLElement;\n template: JSX.Element | string;\n insert?: RenderInsertPosition;\n};\n\ninterface WithKitaMixin {\n renderTemplate: (props: WithKitaRenderTemplateProps) => Promise<void>;\n}\n\n/**\n * A mixin that provides a method to render a JSX template into an HTMLElement.\n */\nexport function WithKita<T extends Constructor<RadiantElement>>(Base: T): T & Constructor<WithKitaMixin> {\n return class extends Base implements WithKitaMixin {\n override async renderTemplate({ target = this, template, insert = 'replace' }: WithKitaRenderTemplateProps) {\n const safeTemplate = typeof template !== 'string' ? template.toString() : template;\n switch (insert) {\n case 'replace':\n target.innerHTML = safeTemplate;\n break;\n case 'beforeend':\n target.insertAdjacentHTML('beforeend', safeTemplate);\n break;\n case 'afterbegin':\n target.insertAdjacentHTML('afterbegin', safeTemplate);\n break;\n }\n }\n } as T & Constructor<WithKitaMixin>;\n}\n",
|
|
22
|
-
"/**\n * Converts the given value to a JSON string representation or maintains the type based on the generic parameter.\n *\n * @param value - The value to be converted.\n * @returns The JSON string representation of the value or the value itself.\n * @template T - The type of the value.\n * @template R - The return type, defaults to T.\n *\n * @example\n * // For JSON string representation\n * <script type=\"application/json\" data-hydration>\n * {stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' })}\n * </script>\n *\n * // For maintaining the type\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n return JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
|
|
23
5
|
],
|
|
24
|
-
"mappings": ";AAIO,SAAS,aAAa,CAAC,MAAc;AAC1C,SAAO,CAAC,WAAqC;AAC3C,SAAK,WAAW;AAAQ;AACxB,SAAK,OAAO,eAAe,IAAI,IAAI,GAAG;AACpC,aAAO,eAAe,OAAO,MAAM,MAAM;AAAA,IAC3C;AAAA;AAAA;;;ACKG,MAAM,aAA0B;AAAA,EAC7B;AAAA,EACA;AAAA,EAQR,WAAW,CAAC,MAAsB,aAAiC;AACjE,SAAK,OAAO;AACZ,SAAK,cAAc;AAAA;AAAA,EAQrB,IAAI,CAAC,QAAY;AACf,UAAM,QAAQ,IAAI,YAAY,KAAK,YAAY,MAAM;AAAA,MACnD;AAAA,MACA,SAAS,KAAK,YAAY;AAAA,MAC1B,YAAY,KAAK,YAAY;AAAA,MAC7B,UAAU,KAAK,YAAY;AAAA,IAC7B,CAAC;AACD,SAAK,KAAK,cAAc,KAAK;AAAA;AAEjC;;;ACjCO,SAAS,KAAK,CAAC,aAAiC;AACrD,SAAO,CAAC,QAAa,gBAAwB;AAC3C,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,KAAa,eAAe;AAC7B,aAAK,yBAAyB,gBAAgB;AAAA,OAC/C,CACH;AAAA;AAAA;AAAA;;;ACAC,SAAS,eAAoD;AAAA,EAClE;AAAA,EACA;AAAA,EACA,YAAY;AAAA,GACmB;AAC/B,SAAO,CAAC,OAAuB,GAAW,eAAmC;AAC3E,UAAM,iBAAiB,WAAW;AAClC,UAAM,4BAA4B,MAAM;AAExC,UAAM,4BAA6B,GAAuB;AACxD,gCAA0B,KAAK,IAAI;AACnC,WAAK,cAAc,IAAI,gCAAgC,SAAS,eAAe,KAAK,IAAI,GAAG,QAAQ,SAAS,CAAC;AAAA;AAG/G,eAAW,gBAAiB,IAAI,MAAqB;AACnD,YAAM,SAAS,eAAe,MAAM,MAAM,IAAI;AAC9C,aAAO;AAAA;AAGT,WAAO;AAAA;AAAA;;ACtBJ,SAAS,QAA+C,CAAC,MAAyC;AACvG,SAAO,cAAc,KAA8B;AAAA,SAClC,eAAc,GAAG,SAAS,MAAM,UAAU,SAAS,aAA0C;AAC1G,YAAM,sBAAsB,aAAa,WAAW,SAAS,SAAS,IAAI;AAC1E,cAAQ;AAAA,aACD;AACH,iBAAO,YAAY;AACnB;AAAA,aACG;AACH,iBAAO,mBAAmB,aAAa,YAAY;AACnD;AAAA,aACG;AACH,iBAAO,mBAAmB,cAAc,YAAY;AACpD;AAAA;AAAA;AAAA,EAGR;AAAA;;AChBK,SAAS,cAAwB,CAAC,OAAyC;AAChF,SAAO,KAAK,UAAU,KAAK;AAAA;",
|
|
25
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "B6A1B7EED2B4CACB64756E2164756E21",
|
|
26
8
|
"names": []
|
|
27
9
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SsrSerializableContextProvider } from '../context/context-provider';
|
|
2
|
+
import type { ContextType, UnknownContext } from '../context/types';
|
|
3
|
+
/**
|
|
4
|
+
* Pushes a temporary provider frame onto the SSR context stack.
|
|
5
|
+
*
|
|
6
|
+
* On the server, each call creates an isolated `AsyncLocalStorage` context so
|
|
7
|
+
* concurrent renders cannot corrupt each other.
|
|
8
|
+
*
|
|
9
|
+
* In browser test environments where `AsyncLocalStorage` is unavailable, a
|
|
10
|
+
* synchronous global stack is used as a fallback.
|
|
11
|
+
*/
|
|
12
|
+
export declare function withSsrContextProviders(providers: readonly SsrSerializableContextProvider[]): () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the nearest SSR-visible provider for a given context token.
|
|
15
|
+
*
|
|
16
|
+
* Lookup walks the provider frames from innermost to outermost so nested host
|
|
17
|
+
* serialization behaves the same way as runtime context resolution in the DOM.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveSsrContextProvider<T extends UnknownContext>(context: T): SsrSerializableContextProvider | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the current SSR-visible value for a given context token.
|
|
22
|
+
*
|
|
23
|
+
* This is the ergonomic helper consumed by SSR-aware decorators and component
|
|
24
|
+
* render paths when they only need the context payload instead of the full
|
|
25
|
+
* provider instance.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveSsrContextValue<T extends UnknownContext>(context: T): ContextType<T> | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/server/install-light-dom-shim.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { installLightDomShim } from './light-dom-shim';\n\ninstallLightDomShim();\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "2EAEA,HAAoB",
|
|
8
|
+
"debugId": "C4400E1D9340C2EC64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
type MinimalCustomElementRegistry = {
|
|
2
|
+
define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void;
|
|
3
|
+
get(name: string): CustomElementConstructor | undefined;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Minimal window-like runtime surface exposed by the SSR light-DOM shim.
|
|
7
|
+
*
|
|
8
|
+
* This is intentionally much smaller than a browser `window`; it only includes
|
|
9
|
+
* the constructors and registry access that Radiant SSR currently needs.
|
|
10
|
+
*/
|
|
11
|
+
export type LightDomShimWindow = {
|
|
12
|
+
/** Event constructor exposed to SSR-created components. */
|
|
13
|
+
CustomEvent: typeof CustomEvent;
|
|
14
|
+
/** Element constructor exposed to SSR-created components. */
|
|
15
|
+
Element: typeof Element;
|
|
16
|
+
/** Event constructor exposed to SSR-created components. */
|
|
17
|
+
Event: typeof Event;
|
|
18
|
+
/** EventTarget constructor exposed to SSR-created components. */
|
|
19
|
+
EventTarget: typeof EventTarget;
|
|
20
|
+
/** HTMLScriptElement constructor used by slot projection payload parsing. */
|
|
21
|
+
HTMLScriptElement: typeof HTMLScriptElement;
|
|
22
|
+
/** HTMLElement constructor exposed to SSR-created components. */
|
|
23
|
+
HTMLElement: typeof HTMLElement;
|
|
24
|
+
/** Node constructor exposed to SSR-created components. */
|
|
25
|
+
Node: typeof Node;
|
|
26
|
+
/** Custom element registry used while rendering in SSR. */
|
|
27
|
+
customElements: MinimalCustomElementRegistry;
|
|
28
|
+
};
|
|
29
|
+
/** Host preparation options accepted by the server render environment. */
|
|
30
|
+
export type PrepareServerRenderHostOptions = {
|
|
31
|
+
/** Serialized light-DOM content to attach to the host before SSR. */
|
|
32
|
+
authoredContent?: string;
|
|
33
|
+
};
|
|
34
|
+
/** Reusable SSR environment used to prepare component hosts before rendering. */
|
|
35
|
+
export type ServerRenderEnvironment = {
|
|
36
|
+
/** Prepares the host instance for rendering, including authored light-DOM content. */
|
|
37
|
+
prepareHost(host: HTMLElement, options?: PrepareServerRenderHostOptions): void;
|
|
38
|
+
};
|
|
39
|
+
/** Ensures that a minimal window-like SSR runtime is available and returns it. */
|
|
40
|
+
export declare function ensureLightDomShim(): LightDomShimWindow;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a reusable SSR environment that can prepare a component host with
|
|
43
|
+
* authored light-DOM content before rendering.
|
|
44
|
+
*
|
|
45
|
+
* Adapters can reuse a single environment across multiple render calls when
|
|
46
|
+
* they want a single host-preparation entrypoint backed by the installed shim.
|
|
47
|
+
*/
|
|
48
|
+
export declare function createServerRenderEnvironment(): ServerRenderEnvironment;
|
|
49
|
+
/**
|
|
50
|
+
* Installs the smallest global surface needed to instantiate Radiant custom elements during SSR.
|
|
51
|
+
*/
|
|
52
|
+
export declare function installLightDomShim(): LightDomShimWindow;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options that constrain how {@link resolveProjectRoot} searches ancestor
|
|
3
|
+
* directories.
|
|
4
|
+
*/
|
|
5
|
+
export type ResolveProjectRootOptions = {
|
|
6
|
+
/** Expected `package.json#name` value for the resolved project root. */
|
|
7
|
+
packageName?: string;
|
|
8
|
+
/** Additional relative paths that must exist inside the resolved directory. */
|
|
9
|
+
requiredPaths?: string[];
|
|
10
|
+
/** Starting directories to search upward from before giving up. */
|
|
11
|
+
startDirectories?: string[];
|
|
12
|
+
/** Absolute or relative directory where the upward search must stop. */
|
|
13
|
+
stopAt?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Resolves the nearest ancestor directory that matches the provided package and
|
|
17
|
+
* path markers. Framework adapters can use this to find their project root
|
|
18
|
+
* without hardcoding a fixed number of parent-directory guesses.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveProjectRoot(options?: ResolveProjectRootOptions): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"../chunk-8xy18qmz.js";var{existsSync:T,readFileSync:U}=(()=>({}));function C(e){if(typeof e!=="string")throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function w(e,f){var l="",n=0,i=-1,r=0,g;for(var u=0;u<=e.length;++u){if(u<e.length)g=e.charCodeAt(u);else if(g===47)break;else g=47;if(g===47){if(i===u-1||r===1);else if(i!==u-1&&r===2){if(l.length<2||n!==2||l.charCodeAt(l.length-1)!==46||l.charCodeAt(l.length-2)!==46){if(l.length>2){var v=l.lastIndexOf("/");if(v!==l.length-1){if(v===-1)l="",n=0;else l=l.slice(0,v),n=l.length-1-l.lastIndexOf("/");i=u,r=0;continue}}else if(l.length===2||l.length===1){l="",n=0,i=u,r=0;continue}}if(f){if(l.length>0)l+="/..";else l="..";n=2}}else{if(l.length>0)l+="/"+e.slice(i+1,u);else l=e.slice(i+1,u);n=u-i-1}i=u,r=0}else if(g===46&&r!==-1)++r;else r=-1}return l}function m(e,f){var l=f.dir||f.root,n=f.base||(f.name||"")+(f.ext||"");if(!l)return n;if(l===f.root)return l+n;return l+e+n}function b(){var e="",f=!1,l;for(var n=arguments.length-1;n>=-1&&!f;n--){var i;if(n>=0)i=arguments[n];else{if(l===void 0)l=process.cwd();i=l}if(C(i),i.length===0)continue;e=i+"/"+e,f=i.charCodeAt(0)===47}if(e=w(e,!f),f)if(e.length>0)return"/"+e;else return"/";else if(e.length>0)return e;else return"."}function L(e){if(C(e),e.length===0)return".";var f=e.charCodeAt(0)===47,l=e.charCodeAt(e.length-1)===47;if(e=w(e,!f),e.length===0&&!f)e=".";if(e.length>0&&l)e+="/";if(f)return"/"+e;return e}function _(e){return C(e),e.length>0&&e.charCodeAt(0)===47}function z(){if(arguments.length===0)return".";var e;for(var f=0;f<arguments.length;++f){var l=arguments[f];if(C(l),l.length>0)if(e===void 0)e=l;else e+="/"+l}if(e===void 0)return".";return L(e)}function S(e,f){if(C(e),C(f),e===f)return"";if(e=b(e),f=b(f),e===f)return"";var l=1;for(;l<e.length;++l)if(e.charCodeAt(l)!==47)break;var n=e.length,i=n-l,r=1;for(;r<f.length;++r)if(f.charCodeAt(r)!==47)break;var g=f.length,u=g-r,v=i<u?i:u,A=-1,s=0;for(;s<=v;++s){if(s===v){if(u>v){if(f.charCodeAt(r+s)===47)return f.slice(r+s+1);else if(s===0)return f.slice(r+s)}else if(i>v){if(e.charCodeAt(l+s)===47)A=s;else if(s===0)A=0}break}var t=e.charCodeAt(l+s),h=f.charCodeAt(r+s);if(t!==h)break;else if(t===47)A=s}var d="";for(s=l+A+1;s<=n;++s)if(s===n||e.charCodeAt(s)===47)if(d.length===0)d+="..";else d+="/..";if(d.length>0)return d+f.slice(r+A);else{if(r+=A,f.charCodeAt(r)===47)++r;return f.slice(r)}}function E(e){return e}function c(e){if(C(e),e.length===0)return".";var f=e.charCodeAt(0),l=f===47,n=-1,i=!0;for(var r=e.length-1;r>=1;--r)if(f=e.charCodeAt(r),f===47){if(!i){n=r;break}}else i=!1;if(n===-1)return l?"/":".";if(l&&n===1)return"//";return e.slice(0,n)}function B(e,f){if(f!==void 0&&typeof f!=="string")throw TypeError('"ext" argument must be a string');C(e);var l=0,n=-1,i=!0,r;if(f!==void 0&&f.length>0&&f.length<=e.length){if(f.length===e.length&&f===e)return"";var g=f.length-1,u=-1;for(r=e.length-1;r>=0;--r){var v=e.charCodeAt(r);if(v===47){if(!i){l=r+1;break}}else{if(u===-1)i=!1,u=r+1;if(g>=0)if(v===f.charCodeAt(g)){if(--g===-1)n=r}else g=-1,n=u}}if(l===n)n=u;else if(n===-1)n=e.length;return e.slice(l,n)}else{for(r=e.length-1;r>=0;--r)if(e.charCodeAt(r)===47){if(!i){l=r+1;break}}else if(n===-1)i=!1,n=r+1;if(n===-1)return"";return e.slice(l,n)}}function G(e){C(e);var f=-1,l=0,n=-1,i=!0,r=0;for(var g=e.length-1;g>=0;--g){var u=e.charCodeAt(g);if(u===47){if(!i){l=g+1;break}continue}if(n===-1)i=!1,n=g+1;if(u===46){if(f===-1)f=g;else if(r!==1)r=1}else if(f!==-1)r=-1}if(f===-1||n===-1||r===0||r===1&&f===n-1&&f===l+1)return"";return e.slice(f,n)}function H(e){if(e===null||typeof e!=="object")throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return m("/",e)}function K(e){C(e);var f={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return f;var l=e.charCodeAt(0),n=l===47,i;if(n)f.root="/",i=1;else i=0;var r=-1,g=0,u=-1,v=!0,A=e.length-1,s=0;for(;A>=i;--A){if(l=e.charCodeAt(A),l===47){if(!v){g=A+1;break}continue}if(u===-1)v=!1,u=A+1;if(l===46){if(r===-1)r=A;else if(s!==1)s=1}else if(r!==-1)s=-1}if(r===-1||u===-1||s===0||s===1&&r===u-1&&r===g+1){if(u!==-1)if(g===0&&n)f.base=f.name=e.slice(1,u);else f.base=f.name=e.slice(g,u)}else{if(g===0&&n)f.name=e.slice(1,r),f.base=e.slice(1,u);else f.name=e.slice(g,r),f.base=e.slice(g,u);f.ext=e.slice(r,u)}if(g>0)f.dir=e.slice(0,g-1);else if(n)f.dir="/";return f}var M="/",Q=":",$=((e)=>(e.posix=e,e))({resolve:b,normalize:L,isAbsolute:_,join:z,relative:S,_makeLong:E,dirname:c,basename:B,extname:G,format:H,parse:K,sep:M,delimiter:Q,win32:null,posix:null});function k(e={}){let f=Y(e.startDirectories?.length?e.startDirectories:[process.cwd(),import.meta.dirname]),l=b(e.stopAt??"/");for(let n of f){let i=V(n,l,e);if(i)return i}throw Error(Z(e,f))}function V(e,f,l){let n=b(e);for(;;){if(W(n,l))return n;if(n===f)return;let i=c(n);if(i===n)return;n=i}}function W(e,f){if(!X(e,f.packageName))return!1;return(f.requiredPaths??[]).every((l)=>T(b(e,l)))}function X(e,f){if(!f)return!0;let l=b(e,"package.json");if(!T(l))return!1;try{return JSON.parse(U(l,"utf8")).name===f}catch{return!1}}function Y(e){return Array.from(new Set(e.map((f)=>b(f))))}function Z(e,f){let l=[e.packageName?`package name ${JSON.stringify(e.packageName)}`:void 0,e.requiredPaths?.length?`paths ${e.requiredPaths.map((n)=>JSON.stringify(n)).join(", ")}`:void 0].filter((n)=>typeof n==="string").join(" and ");return`Unable to resolve a project root${l?` matching ${l}`:""} from ${f.join(", ")}.`}export{k as resolveProjectRoot};
|
|
2
|
+
|
|
3
|
+
//# debugId=092C65A79F3C884364756E2164756E21
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/server/project-root.ts", "node:path"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\n\n/**\n * Options that constrain how {@link resolveProjectRoot} searches ancestor\n * directories.\n */\nexport type ResolveProjectRootOptions = {\n\t/** Expected `package.json#name` value for the resolved project root. */\n\tpackageName?: string;\n\t/** Additional relative paths that must exist inside the resolved directory. */\n\trequiredPaths?: string[];\n\t/** Starting directories to search upward from before giving up. */\n\tstartDirectories?: string[];\n\t/** Absolute or relative directory where the upward search must stop. */\n\tstopAt?: string;\n};\n\n/**\n * Resolves the nearest ancestor directory that matches the provided package and\n * path markers. Framework adapters can use this to find their project root\n * without hardcoding a fixed number of parent-directory guesses.\n */\nexport function resolveProjectRoot(options: ResolveProjectRootOptions = {}): string {\n\tconst candidateStarts = dedupeDirectories(\n\t\toptions.startDirectories?.length ? options.startDirectories : [process.cwd(), import.meta.dirname],\n\t);\n\tconst stopAt = resolve(options.stopAt ?? '/');\n\n\tfor (const startDirectory of candidateStarts) {\n\t\tconst resolvedRoot = resolveProjectRootFrom(startDirectory, stopAt, options);\n\n\t\tif (resolvedRoot) {\n\t\t\treturn resolvedRoot;\n\t\t}\n\t}\n\n\tthrow new Error(createResolveProjectRootError(options, candidateStarts));\n}\n\nfunction resolveProjectRootFrom(\n\tstartDirectory: string,\n\tstopAt: string,\n\toptions: ResolveProjectRootOptions,\n): string | undefined {\n\tlet currentDirectory = resolve(startDirectory);\n\n\tfor (;;) {\n\t\tif (matchesProjectRoot(currentDirectory, options)) {\n\t\t\treturn currentDirectory;\n\t\t}\n\n\t\tif (currentDirectory === stopAt) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst parentDirectory = dirname(currentDirectory);\n\n\t\tif (parentDirectory === currentDirectory) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tcurrentDirectory = parentDirectory;\n\t}\n}\n\nfunction matchesProjectRoot(directory: string, options: ResolveProjectRootOptions): boolean {\n\tif (!matchesPackageName(directory, options.packageName)) {\n\t\treturn false;\n\t}\n\n\treturn (options.requiredPaths ?? []).every((requiredPath) => existsSync(resolve(directory, requiredPath)));\n}\n\nfunction matchesPackageName(directory: string, packageName: string | undefined): boolean {\n\tif (!packageName) {\n\t\treturn true;\n\t}\n\n\tconst packageJsonPath = resolve(directory, 'package.json');\n\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn false;\n\t}\n\n\ttry {\n\t\tconst packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as { name?: string };\n\t\treturn packageJson.name === packageName;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction dedupeDirectories(directories: string[]): string[] {\n\treturn Array.from(new Set(directories.map((directory) => resolve(directory))));\n}\n\nfunction createResolveProjectRootError(options: ResolveProjectRootOptions, startDirectories: string[]): string {\n\tconst markerSummary = [\n\t\toptions.packageName ? `package name ${JSON.stringify(options.packageName)}` : undefined,\n\t\toptions.requiredPaths?.length\n\t\t\t? `paths ${options.requiredPaths.map((path) => JSON.stringify(path)).join(', ')}`\n\t\t\t: undefined,\n\t]\n\t\t.filter((marker): marker is string => typeof marker === 'string')\n\t\t.join(' and ');\n\n\treturn `Unable to resolve a project root${markerSummary ? ` matching ${markerSummary}` : ''} from ${startDirectories.join(', ')}.`;\n}\n",
|
|
6
|
+
"function assertPath(path){if(typeof path!==\"string\")throw TypeError(\"Path must be a string. Received \"+JSON.stringify(path))}function normalizeStringPosix(path,allowAboveRoot){var res=\"\",lastSegmentLength=0,lastSlash=-1,dots=0,code;for(var i=0;i<=path.length;++i){if(i<path.length)code=path.charCodeAt(i);else if(code===47)break;else code=47;if(code===47){if(lastSlash===i-1||dots===1);else if(lastSlash!==i-1&&dots===2){if(res.length<2||lastSegmentLength!==2||res.charCodeAt(res.length-1)!==46||res.charCodeAt(res.length-2)!==46){if(res.length>2){var lastSlashIndex=res.lastIndexOf(\"/\");if(lastSlashIndex!==res.length-1){if(lastSlashIndex===-1)res=\"\",lastSegmentLength=0;else res=res.slice(0,lastSlashIndex),lastSegmentLength=res.length-1-res.lastIndexOf(\"/\");lastSlash=i,dots=0;continue}}else if(res.length===2||res.length===1){res=\"\",lastSegmentLength=0,lastSlash=i,dots=0;continue}}if(allowAboveRoot){if(res.length>0)res+=\"/..\";else res=\"..\";lastSegmentLength=2}}else{if(res.length>0)res+=\"/\"+path.slice(lastSlash+1,i);else res=path.slice(lastSlash+1,i);lastSegmentLength=i-lastSlash-1}lastSlash=i,dots=0}else if(code===46&&dots!==-1)++dots;else dots=-1}return res}function _format(sep,pathObject){var dir=pathObject.dir||pathObject.root,base=pathObject.base||(pathObject.name||\"\")+(pathObject.ext||\"\");if(!dir)return base;if(dir===pathObject.root)return dir+base;return dir+sep+base}function resolve(){var resolvedPath=\"\",resolvedAbsolute=!1,cwd;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path;if(i>=0)path=arguments[i];else{if(cwd===void 0)cwd=process.cwd();path=cwd}if(assertPath(path),path.length===0)continue;resolvedPath=path+\"/\"+resolvedPath,resolvedAbsolute=path.charCodeAt(0)===47}if(resolvedPath=normalizeStringPosix(resolvedPath,!resolvedAbsolute),resolvedAbsolute)if(resolvedPath.length>0)return\"/\"+resolvedPath;else return\"/\";else if(resolvedPath.length>0)return resolvedPath;else return\".\"}function normalize(path){if(assertPath(path),path.length===0)return\".\";var isAbsolute=path.charCodeAt(0)===47,trailingSeparator=path.charCodeAt(path.length-1)===47;if(path=normalizeStringPosix(path,!isAbsolute),path.length===0&&!isAbsolute)path=\".\";if(path.length>0&&trailingSeparator)path+=\"/\";if(isAbsolute)return\"/\"+path;return path}function isAbsolute(path){return assertPath(path),path.length>0&&path.charCodeAt(0)===47}function join(){if(arguments.length===0)return\".\";var joined;for(var i=0;i<arguments.length;++i){var arg=arguments[i];if(assertPath(arg),arg.length>0)if(joined===void 0)joined=arg;else joined+=\"/\"+arg}if(joined===void 0)return\".\";return normalize(joined)}function relative(from,to){if(assertPath(from),assertPath(to),from===to)return\"\";if(from=resolve(from),to=resolve(to),from===to)return\"\";var fromStart=1;for(;fromStart<from.length;++fromStart)if(from.charCodeAt(fromStart)!==47)break;var fromEnd=from.length,fromLen=fromEnd-fromStart,toStart=1;for(;toStart<to.length;++toStart)if(to.charCodeAt(toStart)!==47)break;var toEnd=to.length,toLen=toEnd-toStart,length=fromLen<toLen?fromLen:toLen,lastCommonSep=-1,i=0;for(;i<=length;++i){if(i===length){if(toLen>length){if(to.charCodeAt(toStart+i)===47)return to.slice(toStart+i+1);else if(i===0)return to.slice(toStart+i)}else if(fromLen>length){if(from.charCodeAt(fromStart+i)===47)lastCommonSep=i;else if(i===0)lastCommonSep=0}break}var fromCode=from.charCodeAt(fromStart+i),toCode=to.charCodeAt(toStart+i);if(fromCode!==toCode)break;else if(fromCode===47)lastCommonSep=i}var out=\"\";for(i=fromStart+lastCommonSep+1;i<=fromEnd;++i)if(i===fromEnd||from.charCodeAt(i)===47)if(out.length===0)out+=\"..\";else out+=\"/..\";if(out.length>0)return out+to.slice(toStart+lastCommonSep);else{if(toStart+=lastCommonSep,to.charCodeAt(toStart)===47)++toStart;return to.slice(toStart)}}function _makeLong(path){return path}function dirname(path){if(assertPath(path),path.length===0)return\".\";var code=path.charCodeAt(0),hasRoot=code===47,end=-1,matchedSlash=!0;for(var i=path.length-1;i>=1;--i)if(code=path.charCodeAt(i),code===47){if(!matchedSlash){end=i;break}}else matchedSlash=!1;if(end===-1)return hasRoot?\"/\":\".\";if(hasRoot&&end===1)return\"//\";return path.slice(0,end)}function basename(path,ext){if(ext!==void 0&&typeof ext!==\"string\")throw TypeError('\"ext\" argument must be a string');assertPath(path);var start=0,end=-1,matchedSlash=!0,i;if(ext!==void 0&&ext.length>0&&ext.length<=path.length){if(ext.length===path.length&&ext===path)return\"\";var extIdx=ext.length-1,firstNonSlashEnd=-1;for(i=path.length-1;i>=0;--i){var code=path.charCodeAt(i);if(code===47){if(!matchedSlash){start=i+1;break}}else{if(firstNonSlashEnd===-1)matchedSlash=!1,firstNonSlashEnd=i+1;if(extIdx>=0)if(code===ext.charCodeAt(extIdx)){if(--extIdx===-1)end=i}else extIdx=-1,end=firstNonSlashEnd}}if(start===end)end=firstNonSlashEnd;else if(end===-1)end=path.length;return path.slice(start,end)}else{for(i=path.length-1;i>=0;--i)if(path.charCodeAt(i)===47){if(!matchedSlash){start=i+1;break}}else if(end===-1)matchedSlash=!1,end=i+1;if(end===-1)return\"\";return path.slice(start,end)}}function extname(path){assertPath(path);var startDot=-1,startPart=0,end=-1,matchedSlash=!0,preDotState=0;for(var i=path.length-1;i>=0;--i){var code=path.charCodeAt(i);if(code===47){if(!matchedSlash){startPart=i+1;break}continue}if(end===-1)matchedSlash=!1,end=i+1;if(code===46){if(startDot===-1)startDot=i;else if(preDotState!==1)preDotState=1}else if(startDot!==-1)preDotState=-1}if(startDot===-1||end===-1||preDotState===0||preDotState===1&&startDot===end-1&&startDot===startPart+1)return\"\";return path.slice(startDot,end)}function format(pathObject){if(pathObject===null||typeof pathObject!==\"object\")throw TypeError('The \"pathObject\" argument must be of type Object. Received type '+typeof pathObject);return _format(\"/\",pathObject)}function parse(path){assertPath(path);var ret={root:\"\",dir:\"\",base:\"\",ext:\"\",name:\"\"};if(path.length===0)return ret;var code=path.charCodeAt(0),isAbsolute2=code===47,start;if(isAbsolute2)ret.root=\"/\",start=1;else start=0;var startDot=-1,startPart=0,end=-1,matchedSlash=!0,i=path.length-1,preDotState=0;for(;i>=start;--i){if(code=path.charCodeAt(i),code===47){if(!matchedSlash){startPart=i+1;break}continue}if(end===-1)matchedSlash=!1,end=i+1;if(code===46){if(startDot===-1)startDot=i;else if(preDotState!==1)preDotState=1}else if(startDot!==-1)preDotState=-1}if(startDot===-1||end===-1||preDotState===0||preDotState===1&&startDot===end-1&&startDot===startPart+1){if(end!==-1)if(startPart===0&&isAbsolute2)ret.base=ret.name=path.slice(1,end);else ret.base=ret.name=path.slice(startPart,end)}else{if(startPart===0&&isAbsolute2)ret.name=path.slice(1,startDot),ret.base=path.slice(1,end);else ret.name=path.slice(startPart,startDot),ret.base=path.slice(startPart,end);ret.ext=path.slice(startDot,end)}if(startPart>0)ret.dir=path.slice(0,startPart-1);else if(isAbsolute2)ret.dir=\"/\";return ret}var sep=\"/\",delimiter=\":\",posix=((p)=>(p.posix=p,p))({resolve,normalize,isAbsolute,join,relative,_makeLong,dirname,basename,extname,format,parse,sep,delimiter,win32:null,posix:null});var path_default=posix;export{sep,resolve,relative,posix,parse,normalize,join,isAbsolute,format,extname,dirname,delimiter,path_default as default,basename,_makeLong};"
|
|
7
|
+
],
|
|
8
|
+
"mappings": "6BAAA,4CCAA,SAAS,CAAU,CAAC,EAAK,CAAC,GAAG,OAAO,IAAO,SAAS,MAAM,UAAU,mCAAmC,KAAK,UAAU,CAAI,CAAC,EAAE,SAAS,CAAoB,CAAC,EAAK,EAAe,CAAC,IAAI,EAAI,GAAG,EAAkB,EAAE,EAAU,GAAG,EAAK,EAAE,EAAK,QAAQ,EAAE,EAAE,GAAG,EAAK,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,EAAK,OAAO,EAAK,EAAK,WAAW,CAAC,EAAO,QAAG,IAAO,GAAG,MAAW,OAAK,GAAG,GAAG,IAAO,GAAG,CAAC,GAAG,IAAY,EAAE,GAAG,IAAO,GAAQ,QAAG,IAAY,EAAE,GAAG,IAAO,EAAE,CAAC,GAAG,EAAI,OAAO,GAAG,IAAoB,GAAG,EAAI,WAAW,EAAI,OAAO,CAAC,IAAI,IAAI,EAAI,WAAW,EAAI,OAAO,CAAC,IAAI,IAAI,GAAG,EAAI,OAAO,EAAE,CAAC,IAAI,EAAe,EAAI,YAAY,GAAG,EAAE,GAAG,IAAiB,EAAI,OAAO,EAAE,CAAC,GAAG,IAAiB,GAAG,EAAI,GAAG,EAA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 @@
|
|
|
1
|
+
import type { JsxRenderable } from '@ecopages/jsx';
|
|
2
|
+
import type { RenderToStringOptions } from '@ecopages/jsx/server';
|
|
3
|
+
import type { ContextType, UnknownContext } from '../context/types';
|
|
4
|
+
import { type ServerRenderEnvironment } from './light-dom-shim';
|
|
5
|
+
/** Default response header carrying the fragment render timestamp. */
|
|
6
|
+
export declare const RENDERED_COMPONENT_GENERATED_AT_HEADER = "x-generated-at";
|
|
7
|
+
/** Default response header carrying the custom-element tag name for the fragment. */
|
|
8
|
+
export declare const RENDERED_COMPONENT_TAG_NAME_HEADER = "x-radiant-tag-name";
|
|
9
|
+
/** Default response header carrying the client module URL for the fragment. */
|
|
10
|
+
export declare const RENDERED_COMPONENT_CLIENT_MODULE_HEADER = "x-radiant-client-module";
|
|
11
|
+
/** Default response header carrying serialized fragment asset metadata. */
|
|
12
|
+
export declare const RENDERED_COMPONENT_ASSETS_HEADER = "x-radiant-assets";
|
|
13
|
+
/** Asset dependency emitted by a rendered fragment. */
|
|
14
|
+
export type RenderedComponentAsset = {
|
|
15
|
+
/** Browser module specifier that must be loaded to activate the fragment. */
|
|
16
|
+
kind: 'script-module';
|
|
17
|
+
/** Runtime loading policy for the module. */
|
|
18
|
+
stage?: 'hydrate' | 'idle' | 'immediate';
|
|
19
|
+
/** Module specifier or browser-importable URL. */
|
|
20
|
+
src: string;
|
|
21
|
+
} | {
|
|
22
|
+
/** Module graph preload hint for adapters that control the document head. */
|
|
23
|
+
kind: 'modulepreload';
|
|
24
|
+
/** Module specifier or browser-importable URL. */
|
|
25
|
+
href: string;
|
|
26
|
+
} | {
|
|
27
|
+
/** Stylesheet dependency required by the rendered fragment. */
|
|
28
|
+
kind: 'style';
|
|
29
|
+
/** Browser-importable stylesheet URL. */
|
|
30
|
+
href: string;
|
|
31
|
+
/** Optional media query applied to the stylesheet link. */
|
|
32
|
+
media?: string;
|
|
33
|
+
};
|
|
34
|
+
/** Creates a module asset entry for a rendered fragment. */
|
|
35
|
+
export declare function scriptModuleAsset(src: string, stage?: 'hydrate' | 'idle' | 'immediate'): RenderedComponentAsset;
|
|
36
|
+
/** Creates a modulepreload hint for a rendered fragment. */
|
|
37
|
+
export declare function modulePreloadAsset(href: string): RenderedComponentAsset;
|
|
38
|
+
/** Creates a stylesheet asset entry for a rendered fragment. */
|
|
39
|
+
export declare function styleAsset(href: string, media?: string): RenderedComponentAsset;
|
|
40
|
+
/** Portable metadata for a server-rendered custom-element fragment. */
|
|
41
|
+
export type RenderedComponentMetadata = {
|
|
42
|
+
/** Asset dependencies required by the rendered fragment. */
|
|
43
|
+
assets: readonly RenderedComponentAsset[];
|
|
44
|
+
/** Browser-importable client module URL used to register the component before hydration. */
|
|
45
|
+
clientModuleUrl?: string;
|
|
46
|
+
/** ISO timestamp describing when the fragment was rendered. */
|
|
47
|
+
generatedAt: string;
|
|
48
|
+
/** Custom-element tag name emitted at the fragment root. */
|
|
49
|
+
tagName: string;
|
|
50
|
+
};
|
|
51
|
+
/** Canonical server render result returned by `renderComponent()`. */
|
|
52
|
+
export type RenderedComponent = {
|
|
53
|
+
/** Serialized custom-element host markup. */
|
|
54
|
+
markup: string;
|
|
55
|
+
/** Transport-agnostic metadata that adapters can map onto headers or JSON. */
|
|
56
|
+
metadata: RenderedComponentMetadata;
|
|
57
|
+
/** JSX-compatible preview value that can be embedded into a larger SSR shell. */
|
|
58
|
+
preview: JsxRenderable;
|
|
59
|
+
};
|
|
60
|
+
/** Serializable metadata for a server-rendered custom-element fragment. */
|
|
61
|
+
export type RenderedComponentPayload = {
|
|
62
|
+
/** Asset dependencies required by the rendered fragment. */
|
|
63
|
+
assets?: readonly RenderedComponentAsset[];
|
|
64
|
+
/** Browser-importable client module URL used to register the component before hydration. */
|
|
65
|
+
clientModuleSrc?: string;
|
|
66
|
+
/** ISO timestamp describing when the fragment was rendered. */
|
|
67
|
+
generatedAt: string;
|
|
68
|
+
/** Serialized custom-element host markup. */
|
|
69
|
+
markup: string;
|
|
70
|
+
/** Custom-element tag name emitted at the fragment root. */
|
|
71
|
+
tagName: string;
|
|
72
|
+
};
|
|
73
|
+
/** Full SSR result including a JSX-compatible preview value for shell composition. */
|
|
74
|
+
export type StreamableRenderedComponent = RenderedComponentPayload & {
|
|
75
|
+
/** JSX-compatible preview value that can be embedded into a larger SSR shell. */
|
|
76
|
+
preview: JsxRenderable;
|
|
77
|
+
};
|
|
78
|
+
/** Minimal component contract needed for framework-agnostic SSR helpers. */
|
|
79
|
+
export type ServerRenderableComponent = {
|
|
80
|
+
renderHost?: () => JsxRenderable;
|
|
81
|
+
renderHostToString: (options?: RenderToStringOptions) => string;
|
|
82
|
+
};
|
|
83
|
+
/** Constructor shape for a server-renderable component. */
|
|
84
|
+
export type ServerRenderableComponentConstructor<TComponent extends ServerRenderableComponent> = CustomElementConstructor & {
|
|
85
|
+
new (): TComponent;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Resolves the browser-importable client module URL for a component constructor.
|
|
89
|
+
*
|
|
90
|
+
* Use this when the server adapter can derive the client entry lazily instead of
|
|
91
|
+
* hardcoding `clientModuleSrc` for every render call.
|
|
92
|
+
*/
|
|
93
|
+
export type ResolveRenderedComponentClientModule<TComponent extends ServerRenderableComponent> = (component: ServerRenderableComponentConstructor<TComponent>) => string | undefined | Promise<string | undefined>;
|
|
94
|
+
/**
|
|
95
|
+
* Resolves fragment assets for a component constructor.
|
|
96
|
+
*
|
|
97
|
+
* Prefer this over `resolveClientModuleSrc(...)` for new adapters so assets can
|
|
98
|
+
* describe scripts, styles, and preload hints through one transport-agnostic shape.
|
|
99
|
+
*/
|
|
100
|
+
export type ResolveRenderedComponentAssets<TComponent extends ServerRenderableComponent> = (component: ServerRenderableComponentConstructor<TComponent>) => readonly RenderedComponentAsset[] | undefined | Promise<readonly RenderedComponentAsset[] | undefined>;
|
|
101
|
+
/**
|
|
102
|
+
* Prepares a component host before SSR so slot-aware logic can observe authored
|
|
103
|
+
* light-DOM content during render.
|
|
104
|
+
*/
|
|
105
|
+
export type PrepareRenderedComponentHost<TComponent extends ServerRenderableComponent> = (host: TComponent & HTMLElement, environment: ServerRenderEnvironment) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Ambient SSR context value visible while a standalone component render runs.
|
|
108
|
+
*
|
|
109
|
+
* This lets adapters provide ancestor-like context to `consumeContext(...)` and
|
|
110
|
+
* `contextSelector(...)` without needing to instantiate a real provider host.
|
|
111
|
+
*/
|
|
112
|
+
export type RenderComponentSsrContextEntry<TContext extends UnknownContext = UnknownContext> = {
|
|
113
|
+
context: TContext;
|
|
114
|
+
value: ContextType<TContext>;
|
|
115
|
+
};
|
|
116
|
+
type RenderComponentSharedOptions<TComponent extends ServerRenderableComponent> = {
|
|
117
|
+
/** Asset dependencies required by the rendered fragment. */
|
|
118
|
+
assets?: readonly RenderedComponentAsset[];
|
|
119
|
+
/** Serialized authored light-DOM content to attach to the host before rendering. */
|
|
120
|
+
authoredContent?: string;
|
|
121
|
+
/** Browser-importable client module URL used to register the component before hydration. */
|
|
122
|
+
clientModuleSrc?: string;
|
|
123
|
+
/** Initializes the component instance before the host is rendered. */
|
|
124
|
+
initialize?: (component: TComponent) => void;
|
|
125
|
+
/** SSR environment responsible for preparing the host runtime and authored content. */
|
|
126
|
+
environment?: ServerRenderEnvironment;
|
|
127
|
+
/**
|
|
128
|
+
* Dedicated host-preparation hook for slot-aware SSR.
|
|
129
|
+
*
|
|
130
|
+
* Use this when the server needs to append or mutate authored light-DOM
|
|
131
|
+
* nodes directly instead of passing `authoredContent` as a string.
|
|
132
|
+
*/
|
|
133
|
+
prepareHost?: PrepareRenderedComponentHost<TComponent>;
|
|
134
|
+
/**
|
|
135
|
+
* Ambient SSR context entries that should be visible while the component is
|
|
136
|
+
* instantiated and rendered.
|
|
137
|
+
*
|
|
138
|
+
* This solves standalone fragment renders that need to consume context from a
|
|
139
|
+
* parent-like server environment.
|
|
140
|
+
*/
|
|
141
|
+
ssrContext?: readonly RenderComponentSsrContextEntry[];
|
|
142
|
+
/** Clock override used by tests and adapters that need deterministic timestamps. */
|
|
143
|
+
now?: () => Date;
|
|
144
|
+
/** JSX server-renderer options forwarded to `renderHostToString()`. */
|
|
145
|
+
renderOptions?: RenderToStringOptions;
|
|
146
|
+
/** Lazy asset resolver used when `assets` are not provided directly. */
|
|
147
|
+
resolveAssets?: ResolveRenderedComponentAssets<TComponent>;
|
|
148
|
+
/** Lazy client-module resolver used when `clientModuleSrc` is not provided directly. */
|
|
149
|
+
resolveClientModuleSrc?: ResolveRenderedComponentClientModule<TComponent>;
|
|
150
|
+
/** Explicit tag-name override when `@customElement(...)` metadata is not desired. */
|
|
151
|
+
tagName?: string;
|
|
152
|
+
};
|
|
153
|
+
/** Options accepted by the reusable SSR component rendering helpers. */
|
|
154
|
+
export type RenderComponentOptions<TComponent extends ServerRenderableComponent> = RenderComponentSharedOptions<TComponent> & ({
|
|
155
|
+
component: ServerRenderableComponentConstructor<TComponent>;
|
|
156
|
+
} | {
|
|
157
|
+
load: () => Promise<ServerRenderableComponentConstructor<TComponent>>;
|
|
158
|
+
});
|
|
159
|
+
/** Call-site options used when the component constructor is passed directly. */
|
|
160
|
+
export type RenderComponentCallOptions<TComponent extends ServerRenderableComponent> = RenderComponentSharedOptions<TComponent>;
|
|
161
|
+
/**
|
|
162
|
+
* Serializes a custom element into HTML, inferring its tag name from
|
|
163
|
+
* `@customElement(...)` metadata when the caller does not provide one.
|
|
164
|
+
*/
|
|
165
|
+
export declare function renderComponentToString<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<string>;
|
|
166
|
+
export declare function renderComponentToString<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<string>;
|
|
167
|
+
/**
|
|
168
|
+
* Renders a custom element into the canonical portable server-rendered shape,
|
|
169
|
+
* separating transport-agnostic metadata from any HTTP-specific adapter.
|
|
170
|
+
*/
|
|
171
|
+
export declare function renderComponent<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<RenderedComponent>;
|
|
172
|
+
export declare function renderComponent<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<RenderedComponent>;
|
|
173
|
+
/**
|
|
174
|
+
* Serializes a custom element into a fragment payload that frameworks can
|
|
175
|
+
* attach to any response shape they prefer.
|
|
176
|
+
*/
|
|
177
|
+
export declare function renderComponentToPayload<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<RenderedComponentPayload>;
|
|
178
|
+
export declare function renderComponentToPayload<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<RenderedComponentPayload>;
|
|
179
|
+
/**
|
|
180
|
+
* Renders a component into both fragment metadata and a JSX-compatible preview
|
|
181
|
+
* value that can be embedded into a larger server-rendered shell.
|
|
182
|
+
*/
|
|
183
|
+
export declare function renderStreamableComponent<TComponent extends ServerRenderableComponent>(component: ServerRenderableComponentConstructor<TComponent>, options?: RenderComponentCallOptions<TComponent>): Promise<StreamableRenderedComponent>;
|
|
184
|
+
export declare function renderStreamableComponent<TComponent extends ServerRenderableComponent>(options: RenderComponentOptions<TComponent>): Promise<StreamableRenderedComponent>;
|
|
185
|
+
/**
|
|
186
|
+
* Drops the preview renderable so the result can be sent through lightweight
|
|
187
|
+
* framework adapters or JSON/HTML fragment endpoints.
|
|
188
|
+
*/
|
|
189
|
+
export declare function toRenderedComponentPayload(render: StreamableRenderedComponent | RenderedComponent): RenderedComponentPayload;
|
|
190
|
+
/**
|
|
191
|
+
* Converts a rendered fragment payload into the standard metadata headers used
|
|
192
|
+
* by client-side fragment loaders.
|
|
193
|
+
*/
|
|
194
|
+
export declare function createRenderedComponentHeaders(render: RenderedComponent | RenderedComponentMetadata | RenderedComponentPayload | StreamableRenderedComponent): Record<string, string>;
|
|
195
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{d as Z}from"../chunk-jce9gqqw.js";import{Ya as Y}from"../chunk-ms6a9zdt.js";import{Za as X}from"../chunk-dx1wqc00.js";import"../chunk-4cc2syf5.js";import"../chunk-8xy18qmz.js";var x="x-generated-at",L="x-radiant-tag-name",P="x-radiant-client-module",T="x-radiant-assets";function A(j,q="hydrate"){return{kind:"script-module",src:j,stage:q}}function C(j){return{kind:"modulepreload",href:j}}function z(j,q){return q?{kind:"style",href:j,media:q}:{kind:"style",href:j}}async function c(j,q){return(await J(K(j,q))).markup}async function O(j,q){return J(K(j,q))}async function l(j,q){return D(await J(K(j,q)))}async function m(j,q){return f(await J(K(j,q)))}async function J(j){let q=j.environment??Z(),B=X(_(j.ssrContext));try{let F="component"in j?j.component:await j.load(),G=new F;R(q,G,j.authoredContent,j.prepareHost),j.initialize?.(G);let Q=j.clientModuleSrc??await j.resolveClientModuleSrc?.(F),b=j.assets??await j.resolveAssets?.(F)??[],V=v(b,Q),w=E(V)??Q,I=j.tagName??S(F),U=(j.now??N)().toISOString(),k=h(j.renderOptions),W=G.renderHostToString(k);return{markup:W,metadata:{assets:V,clientModuleUrl:w,generatedAt:U,tagName:I},preview:G.renderHost?.()??{nodeType:1,outerHTML:W}}}finally{B()}}function R(j,q,B,F){if(!y(q)){if(B===void 0&&F===void 0)return;throw Error(`${q.constructor.name} cannot prepare SSR host content because it does not expose an innerHTML host surface.`)}j.prepareHost(q,{authoredContent:B}),F?.(q,j)}function _(j){if(!j||j.length===0)return[];return j.map((q)=>({getContext:()=>q.value,getContextKey:()=>q.context,renderHydrationScript:()=>{return},renderHydrationScriptTag:()=>{return}}))}function D(j){if("metadata"in j)return{assets:j.metadata.assets,clientModuleSrc:j.metadata.clientModuleUrl,generatedAt:j.metadata.generatedAt,markup:j.markup,tagName:j.metadata.tagName};let{preview:q,...B}=j;return B}function p(j){let q=H(j);return{...q.assets.length>0?{[T]:JSON.stringify(q.assets)}:{},...q.clientModuleUrl?{[P]:q.clientModuleUrl}:{},[x]:q.generatedAt,[L]:q.tagName}}function H(j){if("metadata"in j)return j.metadata;if("markup"in j)return{assets:j.assets??$(j.clientModuleSrc),clientModuleUrl:j.clientModuleSrc,generatedAt:j.generatedAt,tagName:j.tagName};return j}function f(j){return{assets:j.metadata.assets,clientModuleSrc:j.metadata.clientModuleUrl,generatedAt:j.metadata.generatedAt,markup:j.markup,preview:j.preview,tagName:j.metadata.tagName}}function N(){return new Date}function $(j){if(!j)return[];return[A(j)]}function v(j,q){if(!q)return j;if(j.some((B)=>B.kind==="script-module"&&B.src===q))return j;return[...$(q),...j]}function E(j){return j.find((q)=>q.kind==="script-module")?.src}function K(j,q){if(typeof j==="function")return{...q,component:j};return j}function h(j){if(j?.hydrate!==void 0)return j;return{...j,hydrate:!0}}function y(j){return"innerHTML"in j}function S(j){let q=Y(j);if(!q)throw Error(`${j.name} is missing @customElement metadata.`);return q}export{D as toRenderedComponentPayload,z as styleAsset,A as scriptModuleAsset,m as renderStreamableComponent,c as renderComponentToString,l as renderComponentToPayload,O as renderComponent,C as modulePreloadAsset,p as createRenderedComponentHeaders,L as RENDERED_COMPONENT_TAG_NAME_HEADER,x as RENDERED_COMPONENT_GENERATED_AT_HEADER,P as RENDERED_COMPONENT_CLIENT_MODULE_HEADER,T as RENDERED_COMPONENT_ASSETS_HEADER};
|
|
2
|
+
|
|
3
|
+
//# debugId=E62B78C0A966A7EC64756E2164756E21
|