@ecopages/radiant 0.1.8 → 0.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +289 -34
- package/dist/chunk-0y78f8hj.js +4 -0
- package/dist/chunk-0y78f8hj.js.map +10 -0
- package/dist/chunk-0zq7e1ne.js +4 -0
- package/dist/chunk-0zq7e1ne.js.map +10 -0
- package/dist/chunk-13ydx769.js +4 -0
- package/dist/chunk-13ydx769.js.map +10 -0
- package/dist/chunk-147yvtsn.js +4 -0
- package/dist/chunk-147yvtsn.js.map +10 -0
- package/dist/chunk-17earqbr.js +4 -0
- package/dist/chunk-17earqbr.js.map +10 -0
- package/dist/chunk-1w1dm68j.js +4 -0
- package/dist/chunk-1w1dm68j.js.map +10 -0
- package/dist/chunk-2tgrfv09.js +4 -0
- package/dist/chunk-2tgrfv09.js.map +10 -0
- package/dist/chunk-3b033cgq.js +4 -0
- package/dist/chunk-3b033cgq.js.map +10 -0
- package/dist/chunk-42tyhfvh.js +4 -0
- package/dist/chunk-42tyhfvh.js.map +10 -0
- package/dist/chunk-4cc2syf5.js +4 -0
- package/dist/chunk-4cc2syf5.js.map +10 -0
- package/dist/chunk-4fqkmpra.js +4 -0
- package/dist/chunk-4fqkmpra.js.map +10 -0
- package/dist/chunk-4srpf0y5.js +4 -0
- package/dist/chunk-4srpf0y5.js.map +10 -0
- package/dist/chunk-57w3vmme.js +4 -0
- package/dist/chunk-57w3vmme.js.map +10 -0
- package/dist/chunk-5a2xez36.js +4 -0
- package/dist/chunk-5a2xez36.js.map +10 -0
- package/dist/chunk-5bym7y1d.js +4 -0
- package/dist/chunk-5bym7y1d.js.map +10 -0
- package/dist/chunk-5td6v9k3.js +4 -0
- package/dist/chunk-5td6v9k3.js.map +10 -0
- package/dist/chunk-60015zxq.js +4 -0
- package/dist/chunk-60015zxq.js.map +10 -0
- package/dist/chunk-60q4y3k5.js +4 -0
- package/dist/chunk-60q4y3k5.js.map +10 -0
- package/dist/chunk-6kdxrppw.js +4 -0
- package/dist/chunk-6kdxrppw.js.map +10 -0
- package/dist/chunk-6z34stya.js +4 -0
- package/dist/chunk-6z34stya.js.map +10 -0
- package/dist/chunk-73x7jpdd.js +4 -0
- package/dist/chunk-73x7jpdd.js.map +10 -0
- package/dist/chunk-84fc8cz9.js +4 -0
- package/dist/chunk-84fc8cz9.js.map +10 -0
- package/dist/chunk-8dexhy6c.js +4 -0
- package/dist/chunk-8dexhy6c.js.map +10 -0
- package/dist/chunk-8n2dhx28.js +4 -0
- package/dist/chunk-8n2dhx28.js.map +10 -0
- package/dist/chunk-8tvt04cm.js +4 -0
- package/dist/chunk-8tvt04cm.js.map +10 -0
- package/dist/chunk-8vak8w5w.js +4 -0
- package/dist/chunk-8vak8w5w.js.map +10 -0
- package/dist/chunk-8xy18qmz.js +4 -0
- package/dist/chunk-8xy18qmz.js.map +9 -0
- package/dist/chunk-9554n9t4.js +4 -0
- package/dist/chunk-9554n9t4.js.map +10 -0
- package/dist/chunk-9ascmjk3.js +4 -0
- package/dist/chunk-9ascmjk3.js.map +10 -0
- package/dist/chunk-9gjmqxp2.js +4 -0
- package/dist/chunk-9gjmqxp2.js.map +10 -0
- package/dist/chunk-a7hzs37s.js +4 -0
- package/dist/chunk-a7hzs37s.js.map +10 -0
- package/dist/chunk-aajhkdmn.js +4 -0
- package/dist/chunk-aajhkdmn.js.map +10 -0
- package/dist/chunk-agjb2a3r.js +4 -0
- package/dist/chunk-agjb2a3r.js.map +10 -0
- package/dist/chunk-ak97hp4w.js +4 -0
- package/dist/chunk-ak97hp4w.js.map +10 -0
- package/dist/chunk-bmhn4nbp.js +4 -0
- package/dist/chunk-bmhn4nbp.js.map +10 -0
- package/dist/chunk-c8vqg7r1.js +4 -0
- package/dist/chunk-c8vqg7r1.js.map +10 -0
- package/dist/chunk-cbvd18v1.js +4 -0
- package/dist/chunk-cbvd18v1.js.map +10 -0
- package/dist/chunk-chyn72n9.js +4 -0
- package/dist/chunk-chyn72n9.js.map +10 -0
- package/dist/chunk-cvz9mrxa.js +4 -0
- package/dist/chunk-cvz9mrxa.js.map +10 -0
- package/dist/chunk-d0n7njdy.js +4 -0
- package/dist/chunk-d0n7njdy.js.map +10 -0
- package/dist/chunk-d4v5qpxa.js +4 -0
- package/dist/chunk-d4v5qpxa.js.map +10 -0
- package/dist/chunk-d7hh3ze6.js +4 -0
- package/dist/chunk-d7hh3ze6.js.map +10 -0
- package/dist/chunk-d98q3myg.js +4 -0
- package/dist/chunk-d98q3myg.js.map +10 -0
- package/dist/chunk-dscj0sk9.js +4 -0
- package/dist/chunk-dscj0sk9.js.map +10 -0
- package/dist/chunk-dx1wqc00.js +4 -0
- package/dist/chunk-dx1wqc00.js.map +10 -0
- package/dist/chunk-g0gz7ypq.js +4 -0
- package/dist/chunk-g0gz7ypq.js.map +10 -0
- package/dist/chunk-hkmm3dj9.js +4 -0
- package/dist/chunk-hkmm3dj9.js.map +10 -0
- package/dist/chunk-hn4j8rt5.js +4 -0
- package/dist/chunk-hn4j8rt5.js.map +10 -0
- package/dist/chunk-jce9gqqw.js +4 -0
- package/dist/chunk-jce9gqqw.js.map +10 -0
- package/dist/chunk-jg20mzg8.js +4 -0
- package/dist/chunk-jg20mzg8.js.map +10 -0
- package/dist/chunk-jkb2y7c8.js +4 -0
- package/dist/chunk-jkb2y7c8.js.map +10 -0
- package/dist/chunk-k5hr781q.js +4 -0
- package/dist/chunk-k5hr781q.js.map +10 -0
- package/dist/chunk-ksv01cey.js +4 -0
- package/dist/chunk-ksv01cey.js.map +10 -0
- package/dist/chunk-mpjnqmbq.js +4 -0
- package/dist/chunk-mpjnqmbq.js.map +10 -0
- package/dist/chunk-mqxmfvyp.js +4 -0
- package/dist/chunk-mqxmfvyp.js.map +10 -0
- package/dist/chunk-ms6a9zdt.js +4 -0
- package/dist/chunk-ms6a9zdt.js.map +10 -0
- package/dist/chunk-nerd6fmg.js +4 -0
- package/dist/chunk-nerd6fmg.js.map +10 -0
- package/dist/chunk-nw171z6m.js +4 -0
- package/dist/chunk-nw171z6m.js.map +10 -0
- package/dist/chunk-p6pxdvkk.js +4 -0
- package/dist/chunk-p6pxdvkk.js.map +10 -0
- package/dist/chunk-paehjz94.js +4 -0
- package/dist/chunk-paehjz94.js.map +10 -0
- package/dist/chunk-par0t822.js +4 -0
- package/dist/chunk-par0t822.js.map +10 -0
- package/dist/chunk-qaagk55a.js +4 -0
- package/dist/chunk-qaagk55a.js.map +10 -0
- package/dist/chunk-qbnedp0y.js +4 -0
- package/dist/chunk-qbnedp0y.js.map +10 -0
- package/dist/chunk-qd28hvdx.js +4 -0
- package/dist/chunk-qd28hvdx.js.map +10 -0
- package/dist/chunk-qdj6r8jn.js +4 -0
- package/dist/chunk-qdj6r8jn.js.map +10 -0
- package/dist/chunk-qe6sjr27.js +4 -0
- package/dist/chunk-qe6sjr27.js.map +10 -0
- package/dist/chunk-r1cvaz1t.js +4 -0
- package/dist/chunk-r1cvaz1t.js.map +10 -0
- package/dist/chunk-r75y7ydb.js +4 -0
- package/dist/chunk-r75y7ydb.js.map +10 -0
- package/dist/chunk-s4qgct1z.js +4 -0
- package/dist/chunk-s4qgct1z.js.map +10 -0
- package/dist/chunk-scfk041e.js +4 -0
- package/dist/chunk-scfk041e.js.map +10 -0
- package/dist/chunk-t6x9e177.js +4 -0
- package/dist/chunk-t6x9e177.js.map +10 -0
- package/dist/chunk-t7a1bbxq.js +4 -0
- package/dist/chunk-t7a1bbxq.js.map +10 -0
- package/dist/chunk-tyysm4gk.js +4 -0
- package/dist/chunk-tyysm4gk.js.map +10 -0
- package/dist/chunk-vpfm9yw8.js +4 -0
- package/dist/chunk-vpfm9yw8.js.map +10 -0
- package/dist/chunk-w50v38rv.js +4 -0
- package/dist/chunk-w50v38rv.js.map +10 -0
- package/dist/chunk-x0522ksh.js +4 -0
- package/dist/chunk-x0522ksh.js.map +10 -0
- package/dist/chunk-xd1xn3vy.js +4 -0
- package/dist/chunk-xd1xn3vy.js.map +10 -0
- package/dist/chunk-zb7wh7w4.js +4 -0
- package/dist/chunk-zb7wh7w4.js.map +10 -0
- package/dist/chunk-zj9ez73m.js +4 -0
- package/dist/chunk-zj9ez73m.js.map +10 -0
- package/dist/context/context-consumer-bootstrap.d.ts +41 -0
- package/dist/context/context-consumer-bootstrap.js +3 -0
- package/dist/context/context-consumer-bootstrap.js.map +9 -0
- package/dist/context/context-consumer-runtime.d.ts +34 -0
- package/dist/context/context-consumer-runtime.js +3 -0
- package/dist/context/context-consumer-runtime.js.map +9 -0
- package/dist/context/context-provider.d.ts +50 -2
- package/dist/context/context-provider.js +2 -279
- package/dist/context/context-provider.js.map +3 -6
- package/dist/context/context-ssr-bridge.d.ts +16 -0
- package/dist/context/context-ssr-bridge.js +3 -0
- package/dist/context/context-ssr-bridge.js.map +9 -0
- package/dist/context/create-context.js +2 -6
- package/dist/context/create-context.js.map +3 -4
- package/dist/context/decorators/consume-context.d.ts +10 -6
- package/dist/context/decorators/consume-context.js +2 -64
- package/dist/context/decorators/consume-context.js.map +3 -5
- package/dist/context/decorators/context-selection-delivery.d.ts +1 -0
- package/dist/context/decorators/context-selection-delivery.js +3 -0
- package/dist/context/decorators/context-selection-delivery.js.map +9 -0
- package/dist/context/decorators/context-selector.d.ts +29 -9
- package/dist/context/decorators/context-selector.js +2 -71
- package/dist/context/decorators/context-selector.js.map +3 -5
- package/dist/context/decorators/legacy/consume-context.d.ts +3 -0
- package/dist/context/decorators/legacy/consume-context.js +3 -0
- package/dist/context/decorators/legacy/consume-context.js.map +9 -0
- package/dist/context/decorators/legacy/context-selector-field.d.ts +8 -0
- package/dist/context/decorators/legacy/context-selector-field.js +3 -0
- package/dist/context/decorators/legacy/context-selector-field.js.map +9 -0
- package/dist/context/decorators/legacy/context-selector.d.ts +4 -0
- package/dist/context/decorators/legacy/context-selector.js +3 -0
- package/dist/context/decorators/legacy/context-selector.js.map +9 -0
- package/dist/context/decorators/legacy/provide-context.d.ts +4 -0
- package/dist/context/decorators/legacy/provide-context.js +3 -0
- package/dist/context/decorators/legacy/provide-context.js.map +9 -0
- package/dist/context/decorators/on-context-update.d.ts +31 -0
- package/dist/context/decorators/on-context-update.js +3 -0
- package/dist/context/decorators/on-context-update.js.map +9 -0
- package/dist/context/decorators/provide-context.d.ts +18 -7
- package/dist/context/decorators/provide-context.js +2 -291
- package/dist/context/decorators/provide-context.js.map +3 -7
- package/dist/context/decorators/standard/consume-context.d.ts +3 -0
- package/dist/context/decorators/standard/consume-context.js +3 -0
- package/dist/context/decorators/standard/consume-context.js.map +9 -0
- package/dist/context/decorators/standard/context-selector-field.d.ts +8 -0
- package/dist/context/decorators/standard/context-selector-field.js +3 -0
- package/dist/context/decorators/standard/context-selector-field.js.map +9 -0
- package/dist/context/decorators/standard/context-selector.d.ts +5 -0
- package/dist/context/decorators/standard/context-selector.js +3 -0
- package/dist/context/decorators/standard/context-selector.js.map +9 -0
- package/dist/context/decorators/standard/provide-context.d.ts +4 -0
- package/dist/context/decorators/standard/provide-context.js +3 -0
- package/dist/context/decorators/standard/provide-context.js.map +9 -0
- package/dist/context/events.d.ts +3 -2
- package/dist/context/events.js +2 -53
- package/dist/context/events.js.map +3 -4
- package/dist/context/hydration-script.d.ts +17 -0
- package/dist/context/hydration-script.js +3 -0
- package/dist/context/hydration-script.js.map +9 -0
- package/dist/core/custom-element-metadata.d.ts +3 -0
- package/dist/core/custom-element-metadata.js +3 -0
- package/dist/core/custom-element-metadata.js.map +9 -0
- package/dist/core/hydration-codec.d.ts +24 -0
- package/dist/core/hydration-codec.js +3 -0
- package/dist/core/hydration-codec.js.map +9 -0
- package/dist/core/radiant-component-ssr.d.ts +29 -0
- package/dist/core/radiant-component-ssr.js +3 -0
- package/dist/core/radiant-component-ssr.js.map +9 -0
- package/dist/core/radiant-component.d.ts +106 -0
- package/dist/core/radiant-component.js +3 -0
- package/dist/core/radiant-component.js.map +9 -0
- package/dist/core/radiant-element.d.ts +283 -23
- package/dist/core/radiant-element.js +2 -82
- package/dist/core/radiant-element.js.map +3 -4
- package/dist/core/reactive-jsx-value.d.ts +10 -0
- package/dist/core/reactive-jsx-value.js +3 -0
- package/dist/core/reactive-jsx-value.js.map +9 -0
- package/dist/core/reactive-prop-metadata.d.ts +7 -0
- package/dist/core/reactive-prop-metadata.js +3 -0
- package/dist/core/reactive-prop-metadata.js.map +9 -0
- package/dist/core/slot-projection.d.ts +34 -0
- package/dist/core/slot-projection.js +3 -0
- package/dist/core/slot-projection.js.map +9 -0
- package/dist/core/ssr-hydration-binding.d.ts +14 -0
- package/dist/core/ssr-hydration-binding.js +2 -0
- package/dist/core/ssr-hydration-binding.js.map +9 -0
- package/dist/core/ssr-preparation.d.ts +18 -0
- package/dist/core/ssr-preparation.js +3 -0
- package/dist/core/ssr-preparation.js.map +9 -0
- package/dist/decorators/bound.d.ts +2 -6
- package/dist/decorators/bound.js +2 -23
- package/dist/decorators/bound.js.map +3 -4
- package/dist/decorators/bridge.d.ts +8 -0
- package/dist/decorators/bridge.js +3 -0
- package/dist/decorators/bridge.js.map +9 -0
- package/dist/decorators/custom-element.d.ts +3 -1
- package/dist/decorators/custom-element.js +2 -14
- package/dist/decorators/custom-element.js.map +3 -4
- package/dist/decorators/debounce.d.ts +6 -1
- package/dist/decorators/debounce.js +2 -20
- package/dist/decorators/debounce.js.map +3 -4
- package/dist/decorators/event.d.ts +3 -2
- package/dist/decorators/event.js +2 -46
- package/dist/decorators/event.js.map +3 -5
- package/dist/decorators/legacy/bound.d.ts +9 -0
- package/dist/decorators/legacy/bound.js +3 -0
- package/dist/decorators/legacy/bound.js.map +9 -0
- package/dist/decorators/legacy/custom-element.d.ts +6 -0
- package/dist/decorators/legacy/custom-element.js +3 -0
- package/dist/decorators/legacy/custom-element.js.map +9 -0
- package/dist/decorators/legacy/debounce.d.ts +1 -0
- package/dist/decorators/legacy/debounce.js +3 -0
- package/dist/decorators/legacy/debounce.js.map +9 -0
- package/dist/decorators/legacy/event.d.ts +9 -0
- package/dist/decorators/legacy/event.js +3 -0
- package/dist/decorators/legacy/event.js.map +9 -0
- package/dist/decorators/legacy/instance-initializers.d.ts +17 -0
- package/dist/decorators/legacy/instance-initializers.js +3 -0
- package/dist/decorators/legacy/instance-initializers.js.map +9 -0
- package/dist/decorators/legacy/on-event.d.ts +17 -0
- package/dist/decorators/legacy/on-event.js +3 -0
- package/dist/decorators/legacy/on-event.js.map +9 -0
- package/dist/decorators/legacy/on-updated.d.ts +6 -0
- package/dist/decorators/legacy/on-updated.js +3 -0
- package/dist/decorators/legacy/on-updated.js.map +9 -0
- package/dist/decorators/legacy/query-slot.d.ts +3 -0
- package/dist/decorators/legacy/query-slot.js +3 -0
- package/dist/decorators/legacy/query-slot.js.map +9 -0
- package/dist/decorators/legacy/query.d.ts +23 -0
- package/dist/decorators/legacy/query.js +3 -0
- package/dist/decorators/legacy/query.js.map +9 -0
- package/dist/decorators/{reactive-field.d.ts → legacy/reactive-field.d.ts} +2 -2
- package/dist/decorators/legacy/reactive-field.js +3 -0
- package/dist/decorators/legacy/reactive-field.js.map +9 -0
- package/dist/decorators/{reactive-prop.d.ts → legacy/reactive-prop.d.ts} +4 -3
- package/dist/decorators/legacy/reactive-prop.js +3 -0
- package/dist/decorators/legacy/reactive-prop.js.map +9 -0
- package/dist/decorators/legacy/signal.d.ts +10 -0
- package/dist/decorators/legacy/signal.js +3 -0
- package/dist/decorators/legacy/signal.js.map +9 -0
- package/dist/decorators/on-event.d.ts +6 -17
- package/dist/decorators/on-event.js +2 -47
- package/dist/decorators/on-event.js.map +3 -4
- package/dist/decorators/on-updated.d.ts +3 -4
- package/dist/decorators/on-updated.js +2 -29
- package/dist/decorators/on-updated.js.map +3 -4
- package/dist/decorators/prop.d.ts +14 -0
- package/dist/decorators/prop.js +3 -0
- package/dist/decorators/prop.js.map +9 -0
- package/dist/decorators/query-slot.d.ts +13 -0
- package/dist/decorators/query-slot.js +3 -0
- package/dist/decorators/query-slot.js.map +9 -0
- package/dist/decorators/query.d.ts +7 -35
- package/dist/decorators/query.js +2 -36
- package/dist/decorators/query.js.map +3 -4
- package/dist/decorators/signal.d.ts +23 -0
- package/dist/decorators/signal.js +3 -0
- package/dist/decorators/signal.js.map +9 -0
- package/dist/decorators/standard/bound.d.ts +2 -0
- package/dist/decorators/standard/bound.js +3 -0
- package/dist/decorators/standard/bound.js.map +9 -0
- package/dist/decorators/standard/custom-element.d.ts +1 -0
- package/dist/decorators/standard/custom-element.js +3 -0
- package/dist/decorators/standard/custom-element.js.map +9 -0
- package/dist/decorators/standard/debounce.d.ts +2 -0
- package/dist/decorators/standard/debounce.js +3 -0
- package/dist/decorators/standard/debounce.js.map +9 -0
- package/dist/decorators/standard/event.d.ts +9 -0
- package/dist/decorators/standard/event.js +3 -0
- package/dist/decorators/standard/event.js.map +9 -0
- package/dist/decorators/standard/on-event.d.ts +17 -0
- package/dist/decorators/standard/on-event.js +3 -0
- package/dist/decorators/standard/on-event.js.map +9 -0
- package/dist/decorators/standard/on-updated.d.ts +2 -0
- package/dist/decorators/standard/on-updated.js +3 -0
- package/dist/decorators/standard/on-updated.js.map +9 -0
- package/dist/decorators/standard/query-slot.d.ts +8 -0
- package/dist/decorators/standard/query-slot.js +3 -0
- package/dist/decorators/standard/query-slot.js.map +9 -0
- package/dist/decorators/standard/query.d.ts +2 -0
- package/dist/decorators/standard/query.js +3 -0
- package/dist/decorators/standard/query.js.map +9 -0
- package/dist/decorators/standard/reactive-field.d.ts +2 -0
- package/dist/decorators/standard/reactive-field.js +3 -0
- package/dist/decorators/standard/reactive-field.js.map +9 -0
- package/dist/decorators/standard/reactive-prop.d.ts +2 -0
- package/dist/decorators/standard/reactive-prop.js +3 -0
- package/dist/decorators/standard/reactive-prop.js.map +9 -0
- package/dist/decorators/standard/signal.d.ts +33 -0
- package/dist/decorators/standard/signal.js +3 -0
- package/dist/decorators/standard/signal.js.map +9 -0
- package/dist/decorators/state.d.ts +11 -0
- package/dist/decorators/state.js +3 -0
- package/dist/decorators/state.js.map +9 -0
- package/dist/helpers/create-event-listener.d.ts +28 -0
- package/dist/helpers/create-event-listener.js +3 -0
- package/dist/helpers/create-event-listener.js.map +9 -0
- package/dist/helpers/create-event.d.ts +9 -0
- package/dist/helpers/create-event.js +3 -0
- package/dist/helpers/create-event.js.map +9 -0
- package/dist/helpers/create-query-slot.d.ts +20 -0
- package/dist/helpers/create-query-slot.js +3 -0
- package/dist/helpers/create-query-slot.js.map +9 -0
- package/dist/helpers/create-query.d.ts +27 -0
- package/dist/helpers/create-query.js +3 -0
- package/dist/helpers/create-query.js.map +9 -0
- package/dist/helpers/debounce.d.ts +39 -0
- package/dist/helpers/debounce.js +3 -0
- package/dist/helpers/debounce.js.map +9 -0
- package/dist/helpers/index.d.ts +5 -0
- package/dist/helpers/index.js +3 -0
- package/dist/helpers/index.js.map +9 -0
- package/dist/index.d.ts +24 -6
- package/dist/index.js +2 -716
- package/dist/index.js.map +3 -21
- package/dist/server/context-ssr.d.ts +27 -0
- package/dist/server/context-ssr.js +3 -0
- package/dist/server/context-ssr.js.map +9 -0
- package/dist/server/install-light-dom-shim.d.ts +1 -0
- package/dist/server/install-light-dom-shim.js +3 -0
- package/dist/server/install-light-dom-shim.js.map +10 -0
- package/dist/server/light-dom-shim.d.ts +53 -0
- package/dist/server/light-dom-shim.js +3 -0
- package/dist/server/light-dom-shim.js.map +9 -0
- package/dist/server/project-root.d.ts +20 -0
- package/dist/server/project-root.js +3 -0
- package/dist/server/project-root.js.map +11 -0
- package/dist/server/render-component.d.ts +195 -0
- package/dist/server/render-component.js +3 -0
- package/dist/server/render-component.js.map +10 -0
- package/dist/signals/host-resource.d.ts +59 -0
- package/dist/signals/host-resource.js +3 -0
- package/dist/signals/host-resource.js.map +10 -0
- package/dist/signals/host-signal.d.ts +45 -0
- package/dist/signals/host-signal.js +3 -0
- package/dist/signals/host-signal.js.map +9 -0
- package/dist/signals/hydration-script.d.ts +11 -0
- package/dist/signals/hydration-script.js +3 -0
- package/dist/signals/hydration-script.js.map +9 -0
- package/dist/tools/escape-script-json.d.ts +5 -0
- package/dist/tools/escape-script-json.js +3 -0
- package/dist/tools/escape-script-json.js.map +9 -0
- package/dist/tools/event-emitter.d.ts +1 -1
- package/dist/tools/event-emitter.js +2 -22
- package/dist/tools/event-emitter.js.map +3 -4
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +2 -28
- package/dist/tools/index.js.map +3 -5
- package/dist/tools/render-jsx-template.d.ts +5 -0
- package/dist/tools/render-jsx-template.js +3 -0
- package/dist/tools/render-jsx-template.js.map +9 -0
- package/dist/tools/stringify-typed.d.ts +4 -6
- package/dist/tools/stringify-typed.js +2 -8
- package/dist/tools/stringify-typed.js.map +3 -4
- package/dist/types.d.ts +79 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +10 -0
- package/dist/utils/attribute-utils.d.ts +2 -0
- package/dist/utils/attribute-utils.js +2 -137
- package/dist/utils/attribute-utils.js.map +3 -4
- package/dist/utils/index.js +2 -137
- package/dist/utils/index.js.map +3 -4
- package/package.json +108 -44
- package/size-budget.json +22 -0
- package/dist/context/index.d.ts +0 -7
- package/dist/context/index.js +0 -338
- package/dist/context/index.js.map +0 -16
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -83
- package/dist/core/index.js.map +0 -10
- package/dist/decorators/reactive-field.js +0 -27
- package/dist/decorators/reactive-field.js.map +0 -10
- package/dist/decorators/reactive-prop.js +0 -215
- package/dist/decorators/reactive-prop.js.map +0 -11
- package/dist/decorators.d.ts +0 -7
- package/dist/decorators.js +0 -401
- package/dist/decorators.js.map +0 -18
- package/dist/mixins/index.d.ts +0 -1
- package/dist/mixins/index.js +0 -24
- package/dist/mixins/index.js.map +0 -10
- package/dist/mixins/with-kita.d.ts +0 -15
- package/dist/mixins/with-kita.js +0 -24
- package/dist/mixins/with-kita.js.map +0 -10
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RadiantElement } from '../../core/radiant-element';
|
|
2
|
+
import type { QuerySlotConfig } from '../query-slot';
|
|
3
|
+
export declare function querySlot<T extends Element | Element[]>(options?: QuerySlotConfig): (proto: RadiantElement, propertyName: string | symbol) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RadiantElement } from '../../core/radiant-element';
|
|
2
|
+
import type { QueryConfig } from '../query';
|
|
3
|
+
/**
|
|
4
|
+
* A decorator to query by CSS selector or data-ref attribute.
|
|
5
|
+
* By default it queries for the first element that matches the selector, but it can be configured to query for all elements.
|
|
6
|
+
*
|
|
7
|
+
* @param {QueryConfig} options - The configuration object for the query.
|
|
8
|
+
* @param {boolean} [options.all] - A flag to query for all elements that match the selector. Defaults to `false`.
|
|
9
|
+
* @param {boolean} [options.cache] - A flag to cache the query result. Defaults to `true`.
|
|
10
|
+
* @param {string} [options.selector] - A CSS selector to match elements against. This property is mutually exclusive with `options.ref`.
|
|
11
|
+
* @param {string} [options.ref] - A reference to an element. This property is mutually exclusive with `options.selector`.
|
|
12
|
+
*
|
|
13
|
+
* @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.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* class MyElement extends HTMLElement {
|
|
17
|
+
* @query({ selector: '.my-class' })
|
|
18
|
+
* myElement;
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* // Now, `myElement` will return the first element in the light DOM of `MyElement` that matches the selector '.my-class'.
|
|
22
|
+
*/
|
|
23
|
+
export declare function query<T extends Element | Element[]>({ cache: shouldBeCached, ...options }: QueryConfig): (proto: RadiantElement, propertyName: string | symbol) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RadiantElement } from '
|
|
1
|
+
import type { RadiantElement } from '../../core/radiant-element';
|
|
2
2
|
/**
|
|
3
3
|
* A decorator to define a reactive field.
|
|
4
4
|
* Every time the property changes, the `updated` method will be called.
|
|
@@ -7,4 +7,4 @@ import type { RadiantElement } from '../core/radiant-element';
|
|
|
7
7
|
* @param target The target element.
|
|
8
8
|
* @param propertyKey The property key.
|
|
9
9
|
*/
|
|
10
|
-
export declare function reactiveField(
|
|
10
|
+
export declare function reactiveField(target: RadiantElement, propertyKey: string): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { RadiantElement } from '
|
|
2
|
-
import { type AttributeTypeConstant } from '
|
|
1
|
+
import type { RadiantElement } from '../../core/radiant-element';
|
|
2
|
+
import { type AttributeTypeConstant } from '../../utils/attribute-utils';
|
|
3
3
|
type ReactivePropertyOptions<T> = {
|
|
4
4
|
type: AttributeTypeConstant;
|
|
5
5
|
reflect?: boolean;
|
|
6
6
|
attribute?: string;
|
|
7
7
|
defaultValue?: T;
|
|
8
|
+
bind?: boolean | string;
|
|
8
9
|
};
|
|
9
10
|
/**
|
|
10
11
|
* A decorator to define a reactive property.
|
|
@@ -15,5 +16,5 @@ type ReactivePropertyOptions<T> = {
|
|
|
15
16
|
* @param options.attribute The name of the attribute.
|
|
16
17
|
* @param options.defaultValue The default value of the property.
|
|
17
18
|
*/
|
|
18
|
-
export declare function reactiveProp<T = unknown>({ type, attribute, reflect, defaultValue }: ReactivePropertyOptions<T>): (target: RadiantElement, propertyName: string) => void;
|
|
19
|
+
export declare function reactiveProp<T = unknown>({ type, attribute, reflect, defaultValue, bind, }: ReactivePropertyOptions<T>): (target: RadiantElement, propertyName: string) => void;
|
|
19
20
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RadiantElement, ReactiveBindingOption } from '../../core/radiant-element';
|
|
2
|
+
import type { AttributeTypeConstant } from '../../utils/attribute-utils';
|
|
3
|
+
import type { WritableSignal } from '@ecopages/signals';
|
|
4
|
+
export type SignalDecoratorOptions<Value = unknown> = {
|
|
5
|
+
bind?: ReactiveBindingOption;
|
|
6
|
+
initial?: Value;
|
|
7
|
+
source?: WritableSignal<Value> | ((host: RadiantElement) => WritableSignal<Value>);
|
|
8
|
+
hydrate?: AttributeTypeConstant;
|
|
9
|
+
};
|
|
10
|
+
export declare function signal<Value = unknown>(options?: SignalDecoratorOptions<Value>): (target: RadiantElement, propertyName: string) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{la as a}from"../../chunk-t6x9e177.js";import"../../chunk-57w3vmme.js";import"../../chunk-8tvt04cm.js";import"../../chunk-6z34stya.js";import"../../chunk-ksv01cey.js";import"../../chunk-8n2dhx28.js";import"../../chunk-8xy18qmz.js";export{a as signal};
|
|
2
|
+
|
|
3
|
+
//# debugId=2942703D6CD9888164756E2164756E21
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type OnEventConfig
|
|
3
|
-
|
|
4
|
-
} | {
|
|
5
|
-
ref: string;
|
|
6
|
-
} | {
|
|
7
|
-
window: boolean;
|
|
8
|
-
} | {
|
|
9
|
-
document: boolean;
|
|
10
|
-
});
|
|
1
|
+
import type { StandardOrLegacyMethodDecoratorArgs } from '../types';
|
|
2
|
+
import type { OnEventConfig, OnEventScope } from '../helpers/create-event-listener';
|
|
3
|
+
export type { OnEventConfig, OnEventScope };
|
|
11
4
|
/**
|
|
12
5
|
* A decorator to subscribe to an event on the target element.
|
|
13
6
|
* The event listener will be automatically unsubscribed when the element is disconnected.
|
|
@@ -15,12 +8,8 @@ type OnEventConfig = Pick<RadiantElementEventListener, 'type' | 'options'> & ({
|
|
|
15
8
|
* Note: This decorator uses event delegation, which means it relies on event bubbling.
|
|
16
9
|
* Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.
|
|
17
10
|
* For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.
|
|
11
|
+
* Delegated listeners observe the host light DOM by default, and can optionally observe the shadow root or both trees.
|
|
18
12
|
*
|
|
19
|
-
* @param
|
|
20
|
-
* @param eventConfig.selectors The CSS selector(s) of the target element(s).
|
|
21
|
-
* @param eventConfig.ref The data-ref attribute of the target element.
|
|
22
|
-
* @param eventConfig.type The type of the event to listen for.
|
|
23
|
-
* @param eventConfig.options Optional. An options object that specifies characteristics about the event listener.
|
|
13
|
+
* @param options {@link OnEventConfig} The event configuration.
|
|
24
14
|
*/
|
|
25
|
-
export declare function onEvent(
|
|
26
|
-
export {};
|
|
15
|
+
export declare function onEvent(options: OnEventConfig): (protoOrTarget: StandardOrLegacyMethodDecoratorArgs["protoOrTarget"], nameOrContext: StandardOrLegacyMethodDecoratorArgs["nameOrContext"], descriptor?: StandardOrLegacyMethodDecoratorArgs["descriptor"]) => any;
|
|
@@ -1,48 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
function onEvent(eventConfig) {
|
|
3
|
-
return (proto, _, descriptor) => {
|
|
4
|
-
const originalConnectedCallback = proto.connectedCallback;
|
|
5
|
-
const originalDisconnectedCallback = proto.disconnectedCallback;
|
|
6
|
-
if ("window" in eventConfig) {
|
|
7
|
-
proto.connectedCallback = function() {
|
|
8
|
-
window.addEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);
|
|
9
|
-
originalConnectedCallback.call(this);
|
|
10
|
-
};
|
|
11
|
-
proto.disconnectedCallback = function() {
|
|
12
|
-
window.removeEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);
|
|
13
|
-
originalDisconnectedCallback.call(this);
|
|
14
|
-
};
|
|
15
|
-
return descriptor;
|
|
16
|
-
}
|
|
17
|
-
if ("document" in eventConfig) {
|
|
18
|
-
proto.connectedCallback = function() {
|
|
19
|
-
document.addEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);
|
|
20
|
-
originalConnectedCallback.call(this);
|
|
21
|
-
};
|
|
22
|
-
proto.disconnectedCallback = function() {
|
|
23
|
-
document.removeEventListener(eventConfig.type, descriptor.value.bind(this), eventConfig.options);
|
|
24
|
-
originalDisconnectedCallback.call(this);
|
|
25
|
-
};
|
|
26
|
-
return descriptor;
|
|
27
|
-
}
|
|
28
|
-
const selector = "selector" in eventConfig ? eventConfig.selector : `[data-ref="${eventConfig.ref}"]`;
|
|
29
|
-
const originalMethod = descriptor.value;
|
|
30
|
-
const subscriptionId = `${eventConfig.type}-${selector}`;
|
|
31
|
-
proto.connectedCallback = function() {
|
|
32
|
-
this.subscribeEvent({
|
|
33
|
-
id: subscriptionId,
|
|
34
|
-
selector,
|
|
35
|
-
type: eventConfig.type,
|
|
36
|
-
listener: originalMethod.bind(this),
|
|
37
|
-
options: eventConfig?.options ?? undefined
|
|
38
|
-
});
|
|
39
|
-
originalConnectedCallback.call(this);
|
|
40
|
-
};
|
|
41
|
-
return descriptor;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
onEvent
|
|
46
|
-
};
|
|
1
|
+
import{Ia as a}from"../chunk-d4v5qpxa.js";import"../chunk-3b033cgq.js";import"../chunk-aajhkdmn.js";import"../chunk-8tvt04cm.js";import"../chunk-nerd6fmg.js";import"../chunk-nw171z6m.js";import"../chunk-8xy18qmz.js";export{a as onEvent};
|
|
47
2
|
|
|
48
|
-
//# debugId=
|
|
3
|
+
//# debugId=2318DA2E353CA55564756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"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"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "2318DA2E353CA55564756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StandardOrLegacyMethodDecoratorArgs } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* A decorator to
|
|
4
|
-
* @param eventConfig The event configuration.
|
|
3
|
+
* A decorator to bind a method to the instance.
|
|
5
4
|
*/
|
|
6
|
-
export declare function onUpdated(keyOrKeys: string | string[]): (
|
|
5
|
+
export declare function onUpdated(keyOrKeys: string | string[]): (protoOrTarget: StandardOrLegacyMethodDecoratorArgs["protoOrTarget"], nameOrContext: StandardOrLegacyMethodDecoratorArgs["nameOrContext"], descriptor?: StandardOrLegacyMethodDecoratorArgs["descriptor"]) => any;
|
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
function onUpdated(keyOrKeys) {
|
|
3
|
-
return (proto, methodName) => {
|
|
4
|
-
if (!("updatesRegistry" in proto)) {
|
|
5
|
-
Object.defineProperty(proto, "updatesRegistry", {
|
|
6
|
-
value: new Map,
|
|
7
|
-
configurable: true
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
const updatesRegistry = proto.updatesRegistry;
|
|
11
|
-
if (Array.isArray(keyOrKeys)) {
|
|
12
|
-
for (const key of keyOrKeys) {
|
|
13
|
-
if (!updatesRegistry.has(key)) {
|
|
14
|
-
updatesRegistry.set(key, new Set);
|
|
15
|
-
}
|
|
16
|
-
updatesRegistry.get(key)?.add(methodName);
|
|
17
|
-
}
|
|
18
|
-
} else if (typeof keyOrKeys === "string") {
|
|
19
|
-
if (!updatesRegistry.has(keyOrKeys)) {
|
|
20
|
-
updatesRegistry.set(keyOrKeys, new Set);
|
|
21
|
-
}
|
|
22
|
-
updatesRegistry.get(keyOrKeys)?.add(methodName);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
onUpdated
|
|
28
|
-
};
|
|
1
|
+
import{Ca as a}from"../chunk-0zq7e1ne.js";import"../chunk-tyysm4gk.js";import"../chunk-qdj6r8jn.js";import"../chunk-8tvt04cm.js";import"../chunk-nerd6fmg.js";import"../chunk-8xy18qmz.js";export{a as onUpdated};
|
|
29
2
|
|
|
30
|
-
//# debugId=
|
|
3
|
+
//# debugId=83AB63167809D83E64756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"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"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "83AB63167809D83E64756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactivePropertyOptions } from '../core/radiant-element';
|
|
2
|
+
import type { StandardOrLegacyFieldDecoratorArgs } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Declares a reactive property backed by an HTML attribute.
|
|
5
|
+
*
|
|
6
|
+
* Every write triggers `notifyUpdate` so update callbacks, bindings, and
|
|
7
|
+
* `RadiantComponent` renders stay in sync. When no explicit `bind` option
|
|
8
|
+
* is supplied, `RadiantComponent` hosts expose a JSX companion binding
|
|
9
|
+
* accessor automatically while plain `RadiantElement` hosts keep binding
|
|
10
|
+
* opt-in.
|
|
11
|
+
*
|
|
12
|
+
* @param options {@link ReactivePropertyOptions} The options for the reactive property.
|
|
13
|
+
*/
|
|
14
|
+
export declare function prop<T = unknown>(options: ReactivePropertyOptions<T>): (protoOrTarget: StandardOrLegacyFieldDecoratorArgs["protoOrTarget"], nameOrContext: StandardOrLegacyFieldDecoratorArgs["nameOrContext"]) => any;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{ca as a}from"../chunk-p6pxdvkk.js";import"../chunk-x0522ksh.js";import"../chunk-dscj0sk9.js";import"../chunk-8dexhy6c.js";import"../chunk-8tvt04cm.js";import"../chunk-nerd6fmg.js";import"../chunk-73x7jpdd.js";import"../chunk-8xy18qmz.js";export{a as prop};
|
|
2
|
+
|
|
3
|
+
//# debugId=E51C4954548A2BB464756E2164756E21
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StandardOrLegacyFieldDecoratorArgs } from '../types';
|
|
2
|
+
import type { QuerySlotConfig } from '../helpers/create-query-slot';
|
|
3
|
+
export type { QuerySlotConfig };
|
|
4
|
+
/**
|
|
5
|
+
* Queries projected light-DOM content assigned to a RadiantComponent slot.
|
|
6
|
+
*
|
|
7
|
+
* The decorator returns assigned elements from the default slot when `name` is
|
|
8
|
+
* omitted, or from the named slot when `name` is provided. Results are cached
|
|
9
|
+
* by default and automatically invalidated when slot projection changes.
|
|
10
|
+
*
|
|
11
|
+
* @param options Slot query options.
|
|
12
|
+
*/
|
|
13
|
+
export declare function querySlot<T extends Element | Element[]>(options?: QuerySlotConfig): (protoOrTarget: StandardOrLegacyFieldDecoratorArgs["protoOrTarget"], nameOrContext: StandardOrLegacyFieldDecoratorArgs["nameOrContext"]) => any;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{Y as a}from"../chunk-0y78f8hj.js";import"../chunk-5bym7y1d.js";import"../chunk-9gjmqxp2.js";import"../chunk-bmhn4nbp.js";import"../chunk-8tvt04cm.js";import"../chunk-nerd6fmg.js";import"../chunk-qd28hvdx.js";import"../chunk-8xy18qmz.js";export{a as querySlot};
|
|
2
|
+
|
|
3
|
+
//# debugId=8CBFFD924AFC8B2564756E2164756E21
|
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
type BaseQueryConfig = {
|
|
6
|
-
all?: boolean;
|
|
7
|
-
cache?: boolean;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* The configuration object for the query.
|
|
11
|
-
* It can be configured to query by CSS selector or data-ref attribute.
|
|
12
|
-
*/
|
|
13
|
-
export type QueryConfig = BaseQueryConfig & ({
|
|
14
|
-
selector: string;
|
|
15
|
-
} | {
|
|
16
|
-
ref: string;
|
|
17
|
-
});
|
|
1
|
+
import type { StandardOrLegacyFieldDecoratorArgs } from '../types';
|
|
2
|
+
import type { QueryConfig, QueryScope } from '../helpers/create-query';
|
|
3
|
+
export type { QueryConfig, QueryScope };
|
|
18
4
|
/**
|
|
19
5
|
* A decorator to query by CSS selector or data-ref attribute.
|
|
20
6
|
* By default it queries for the first element that matches the selector, but it can be configured to query for all elements.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @param
|
|
24
|
-
* @param {boolean} [options.cache] - A flag to cache the query result. Defaults to `true`.
|
|
25
|
-
* @param {string} [options.selector] - A CSS selector to match elements against. This property is mutually exclusive with `options.ref`.
|
|
26
|
-
* @param {string} [options.ref] - A reference to an element. This property is mutually exclusive with `options.selector`.
|
|
27
|
-
*
|
|
28
|
-
* @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.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* class MyElement extends HTMLElement {
|
|
32
|
-
* @query({ selector: '.my-class' })
|
|
33
|
-
* myElement;
|
|
34
|
-
* }
|
|
35
|
-
*
|
|
36
|
-
* // Now, `myElement` will return the first element in the light DOM of `MyElement` that matches the selector '.my-class'.
|
|
7
|
+
* It caches the result only when `cache` is enabled.
|
|
8
|
+
* Queries run against the host light DOM by default, but can be directed to the shadow root or both trees.
|
|
9
|
+
* @param options {@link QueryConfig} The options for the reactive property.
|
|
37
10
|
*/
|
|
38
|
-
export declare function query
|
|
39
|
-
export {};
|
|
11
|
+
export declare function query<T extends Element | Element[]>(options: QueryConfig): (protoOrTarget: StandardOrLegacyFieldDecoratorArgs["protoOrTarget"], nameOrContext: StandardOrLegacyFieldDecoratorArgs["nameOrContext"]) => any;
|
package/dist/decorators/query.js
CHANGED
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
function query({
|
|
3
|
-
cache: shouldBeCached = true,
|
|
4
|
-
...options
|
|
5
|
-
}) {
|
|
6
|
-
const cache = new WeakMap;
|
|
7
|
-
return (proto, propertyKey) => {
|
|
8
|
-
const doQuery = function() {
|
|
9
|
-
if (shouldBeCached) {
|
|
10
|
-
const cachedResult = cache.get(this);
|
|
11
|
-
if (cachedResult !== undefined) {
|
|
12
|
-
return cachedResult;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const selector = "selector" in options ? options.selector : `[data-ref="${options.ref}"]`;
|
|
16
|
-
const queryResult = options.all ? this.querySelectorAll(selector) : this.querySelector(selector);
|
|
17
|
-
if (shouldBeCached) {
|
|
18
|
-
cache.set(this, queryResult);
|
|
19
|
-
}
|
|
20
|
-
return queryResult;
|
|
21
|
-
};
|
|
22
|
-
const originalConnectedCallback = proto.connectedCallback;
|
|
23
|
-
proto.connectedCallback = function() {
|
|
24
|
-
Object.defineProperty(this, propertyKey, {
|
|
25
|
-
get: doQuery,
|
|
26
|
-
enumerable: true,
|
|
27
|
-
configurable: true
|
|
28
|
-
});
|
|
29
|
-
originalConnectedCallback.call(this);
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
query
|
|
35
|
-
};
|
|
1
|
+
import{ha as a}from"../chunk-2tgrfv09.js";import"../chunk-qe6sjr27.js";import"../chunk-scfk041e.js";import"../chunk-8tvt04cm.js";import"../chunk-nerd6fmg.js";import"../chunk-g0gz7ypq.js";import"../chunk-8xy18qmz.js";export{a as query};
|
|
36
2
|
|
|
37
|
-
//# debugId=
|
|
3
|
+
//# debugId=20008E9E16D5D5FB64756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"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"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "20008E9E16D5D5FB64756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { StandardOrLegacyFieldDecoratorArgs } from '../types';
|
|
2
|
+
import { type SignalDecoratorOptions } from './legacy/signal';
|
|
3
|
+
export type { SignalDecoratorOptions } from './standard/signal';
|
|
4
|
+
/**
|
|
5
|
+
* Declares a host-aware writable signal field.
|
|
6
|
+
*
|
|
7
|
+
* The decorated member becomes a real `WritableSignal` instance that JSX can
|
|
8
|
+
* consume directly in child or attribute positions. By default the decorator
|
|
9
|
+
* creates a host-owned signal, but it can also connect an existing shared
|
|
10
|
+
* signal through the `source` option or a signal-valued field initializer.
|
|
11
|
+
*
|
|
12
|
+
* Connected signals still flow through Radiant's update callback channel so
|
|
13
|
+
* `@onUpdated(...)` and `this.$.name` bindings continue to work. On
|
|
14
|
+
* `RadiantComponent`, any signal or store reads performed during `render()`
|
|
15
|
+
* now participate in rerender invalidation directly, which makes module-level
|
|
16
|
+
* shared stores a natural fit without prop-bridging them through a second
|
|
17
|
+
* reactive layer.
|
|
18
|
+
*
|
|
19
|
+
* When `hydrate` is provided, SSR host output appends a keyed JSON script so
|
|
20
|
+
* the client can restore the signal's initial value during hydration.
|
|
21
|
+
*/
|
|
22
|
+
export declare function signal(protoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'], nameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext']): any;
|
|
23
|
+
export declare function signal(options?: SignalDecoratorOptions): any;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{ka as a}from"../chunk-c8vqg7r1.js";import"../chunk-t6x9e177.js";import"../chunk-5a2xez36.js";import"../chunk-57w3vmme.js";import"../chunk-8tvt04cm.js";import"../chunk-6z34stya.js";import"../chunk-ksv01cey.js";import"../chunk-8n2dhx28.js";import"../chunk-8xy18qmz.js";export{a as signal};
|
|
2
|
+
|
|
3
|
+
//# debugId=6DA7522CFED013A964756E2164756E21
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function customElement(name: string, options?: ElementDefinitionOptions): <T extends CustomElementConstructor>(_: T, context: ClassDecoratorContext<T>) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RadiantElement } from '../../core/radiant-element';
|
|
2
|
+
import type { EventEmitterConfig } from '../../tools/event-emitter';
|
|
3
|
+
/**
|
|
4
|
+
* Decorator that attaches an EventEmitter to the class field property.
|
|
5
|
+
* The EventEmitter can be used to dispatch custom events from the target element.
|
|
6
|
+
* @param eventConfig Configuration for the event emitter.
|
|
7
|
+
* @see {@link EventEmitter} for more details about how the EventEmitter works.
|
|
8
|
+
*/
|
|
9
|
+
export declare function event(eventConfig: EventEmitterConfig): <T extends RadiantElement, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) => void;
|