@ecopages/radiant 0.3.0-alpha.4 → 0.3.0-alpha.5
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 +66 -56
- package/dist/LICENSE +21 -0
- package/dist/client/hydrator.d.ts +1 -1
- package/dist/client/hydrator.js +2 -2
- package/dist/client/hydrator.js.map +5 -3
- package/dist/client/install-hydrator.js +2 -2
- package/dist/client/install-hydrator.js.map +5 -3
- package/dist/context/context-consumer-bootstrap.d.ts +7 -6
- package/dist/context/context-consumer-bootstrap.js +2 -2
- package/dist/context/context-consumer-bootstrap.js.map +8 -3
- package/dist/context/context-consumer-runtime.d.ts +21 -8
- package/dist/context/context-consumer-runtime.js +2 -2
- package/dist/context/context-consumer-runtime.js.map +6 -3
- package/dist/context/context-host.d.ts +25 -0
- package/dist/context/context-host.js +3 -0
- package/dist/context/context-host.js.map +10 -0
- package/dist/context/context-provider.d.ts +10 -6
- package/dist/context/context-provider.js +2 -2
- package/dist/context/context-provider.js.map +9 -3
- package/dist/context/context-ssr-bridge.js +2 -2
- package/dist/context/context-ssr-bridge.js.map +4 -3
- package/dist/context/create-context.js +2 -2
- package/dist/context/create-context.js.map +4 -3
- package/dist/context/decorators/consume-context.d.ts +5 -2
- package/dist/context/decorators/consume-context.js +2 -2
- package/dist/context/decorators/consume-context.js.map +13 -3
- package/dist/context/decorators/context-selection-delivery.d.ts +1 -1
- package/dist/context/decorators/context-selection-delivery.js +2 -2
- package/dist/context/decorators/context-selection-delivery.js.map +5 -3
- package/dist/context/decorators/context-selector.d.ts +6 -6
- package/dist/context/decorators/context-selector.js +2 -2
- package/dist/context/decorators/context-selector.js.map +15 -3
- package/dist/context/decorators/legacy/consume-context.d.ts +2 -2
- package/dist/context/decorators/legacy/consume-context.js +2 -2
- package/dist/context/decorators/legacy/consume-context.js.map +10 -3
- package/dist/context/decorators/legacy/context-selector-field.d.ts +2 -2
- package/dist/context/decorators/legacy/context-selector-field.js +2 -2
- package/dist/context/decorators/legacy/context-selector-field.js.map +11 -3
- package/dist/context/decorators/legacy/context-selector.d.ts +2 -2
- package/dist/context/decorators/legacy/context-selector.js +2 -2
- package/dist/context/decorators/legacy/context-selector.js.map +11 -3
- package/dist/context/decorators/legacy/provide-context.d.ts +2 -2
- package/dist/context/decorators/legacy/provide-context.js +2 -2
- package/dist/context/decorators/legacy/provide-context.js.map +11 -3
- package/dist/context/decorators/on-context-update.d.ts +5 -5
- package/dist/context/decorators/on-context-update.js +2 -2
- package/dist/context/decorators/on-context-update.js.map +14 -3
- package/dist/context/decorators/provide-context.d.ts +5 -2
- package/dist/context/decorators/provide-context.js +2 -2
- package/dist/context/decorators/provide-context.js.map +14 -3
- package/dist/context/decorators/standard/consume-context.d.ts +2 -2
- package/dist/context/decorators/standard/consume-context.js +2 -2
- package/dist/context/decorators/standard/consume-context.js.map +9 -3
- package/dist/context/decorators/standard/context-selector-field.d.ts +2 -2
- package/dist/context/decorators/standard/context-selector-field.js +2 -2
- package/dist/context/decorators/standard/context-selector-field.js.map +10 -3
- package/dist/context/decorators/standard/context-selector.d.ts +2 -3
- package/dist/context/decorators/standard/context-selector.js +2 -2
- package/dist/context/decorators/standard/context-selector.js.map +10 -3
- package/dist/context/decorators/standard/provide-context.d.ts +2 -2
- package/dist/context/decorators/standard/provide-context.js +2 -2
- package/dist/context/decorators/standard/provide-context.js.map +10 -3
- package/dist/context/events.d.ts +18 -11
- package/dist/context/events.js +2 -2
- package/dist/context/events.js.map +4 -3
- package/dist/context/hydration-script.js +2 -2
- package/dist/context/hydration-script.js.map +6 -3
- package/dist/controller-registry.d.ts +28 -0
- package/dist/controller-registry.js +3 -0
- package/dist/controller-registry.js.map +11 -0
- package/dist/core/controller-metadata.d.ts +3 -0
- package/dist/core/controller-metadata.js +3 -0
- package/dist/core/controller-metadata.js.map +10 -0
- package/dist/core/custom-element-metadata.d.ts +11 -0
- package/dist/core/custom-element-metadata.js +2 -2
- package/dist/core/custom-element-metadata.js.map +4 -3
- package/dist/core/hydration-codec.d.ts +8 -1
- package/dist/core/hydration-codec.js +2 -2
- package/dist/core/hydration-codec.js.map +5 -3
- package/dist/core/radiant-component-ssr-registry.d.ts +13 -13
- package/dist/core/radiant-component-ssr-registry.js +2 -2
- package/dist/core/radiant-component-ssr-registry.js.map +4 -3
- package/dist/core/radiant-component-ssr.d.ts +3 -3
- package/dist/core/radiant-component-ssr.js +2 -2
- package/dist/core/radiant-component-ssr.js.map +8 -3
- package/dist/core/radiant-controller.d.ts +127 -0
- package/dist/core/radiant-controller.js +3 -0
- package/dist/core/radiant-controller.js.map +13 -0
- package/dist/core/radiant-element.d.ts +43 -41
- package/dist/core/radiant-element.js +2 -2
- package/dist/core/radiant-element.js.map +13 -3
- package/dist/core/radiant-hydrator-state.d.ts +1 -1
- package/dist/core/radiant-hydrator-state.js +2 -2
- package/dist/core/radiant-hydrator-state.js.map +4 -3
- package/dist/core/reactive-host.d.ts +137 -0
- package/dist/core/reactive-host.js +3 -0
- package/dist/core/reactive-host.js.map +10 -0
- package/dist/core/reactive-jsx-value.js +2 -2
- package/dist/core/reactive-jsx-value.js.map +4 -3
- package/dist/core/reactive-prop-metadata.js +2 -2
- package/dist/core/reactive-prop-metadata.js.map +4 -3
- package/dist/core/slot-projection-runtime.js +2 -2
- package/dist/core/slot-projection-runtime.js.map +6 -3
- package/dist/core/ssr-preparation.js +2 -2
- package/dist/core/ssr-preparation.js.map +4 -3
- package/dist/decorators/attr.d.ts +6 -0
- package/dist/decorators/attr.js +3 -0
- package/dist/decorators/attr.js.map +16 -0
- package/dist/decorators/bound.d.ts +4 -2
- package/dist/decorators/bound.js +2 -2
- package/dist/decorators/bound.js.map +7 -3
- package/dist/decorators/bridge.d.ts +11 -7
- package/dist/decorators/bridge.js +2 -2
- package/dist/decorators/bridge.js.map +4 -3
- package/dist/decorators/controller.d.ts +2 -0
- package/dist/decorators/controller.js +3 -0
- package/dist/decorators/controller.js.map +12 -0
- package/dist/decorators/custom-element.d.ts +4 -2
- package/dist/decorators/custom-element.js +2 -2
- package/dist/decorators/custom-element.js.map +7 -3
- package/dist/decorators/debounce.d.ts +5 -2
- package/dist/decorators/debounce.js +2 -2
- package/dist/decorators/debounce.js.map +8 -3
- package/dist/decorators/event.d.ts +5 -2
- package/dist/decorators/event.js +2 -2
- package/dist/decorators/event.js.map +10 -3
- package/dist/decorators/legacy/attr.d.ts +2 -0
- package/dist/decorators/legacy/attr.js +3 -0
- package/dist/decorators/legacy/attr.js.map +13 -0
- package/dist/decorators/legacy/bound.js +2 -2
- package/dist/decorators/legacy/bound.js.map +4 -3
- package/dist/decorators/legacy/custom-element.js +2 -2
- package/dist/decorators/legacy/custom-element.js.map +5 -3
- package/dist/decorators/legacy/debounce.js +2 -2
- package/dist/decorators/legacy/debounce.js.map +5 -3
- package/dist/decorators/legacy/event.js +2 -2
- package/dist/decorators/legacy/event.js.map +7 -3
- package/dist/decorators/legacy/instance-initializers.d.ts +3 -4
- package/dist/decorators/legacy/instance-initializers.js +2 -2
- package/dist/decorators/legacy/instance-initializers.js.map +4 -3
- package/dist/decorators/legacy/on-event.d.ts +2 -2
- package/dist/decorators/legacy/on-event.js +2 -2
- package/dist/decorators/legacy/on-event.js.map +6 -3
- package/dist/decorators/legacy/on-updated.d.ts +7 -2
- package/dist/decorators/legacy/on-updated.js +2 -2
- package/dist/decorators/legacy/on-updated.js.map +5 -3
- package/dist/decorators/legacy/query-slot.js +2 -2
- package/dist/decorators/legacy/query-slot.js.map +7 -3
- package/dist/decorators/legacy/query.d.ts +7 -2
- package/dist/decorators/legacy/query.js +2 -2
- package/dist/decorators/legacy/query.js.map +6 -3
- package/dist/decorators/legacy/reactive-field.d.ts +2 -2
- package/dist/decorators/legacy/reactive-field.js +2 -2
- package/dist/decorators/legacy/reactive-field.js.map +5 -3
- package/dist/decorators/legacy/reactive-prop.d.ts +10 -16
- package/dist/decorators/legacy/reactive-prop.js +2 -2
- package/dist/decorators/legacy/reactive-prop.js.map +7 -3
- package/dist/decorators/legacy/signal.d.ts +4 -3
- package/dist/decorators/legacy/signal.js +2 -2
- package/dist/decorators/legacy/signal.js.map +9 -3
- package/dist/decorators/on-event.d.ts +6 -3
- package/dist/decorators/on-event.js +2 -2
- package/dist/decorators/on-event.js.map +9 -3
- package/dist/decorators/on-updated.d.ts +12 -2
- package/dist/decorators/on-updated.js +2 -2
- package/dist/decorators/on-updated.js.map +8 -3
- package/dist/decorators/prop.d.ts +19 -7
- package/dist/decorators/prop.js +2 -2
- package/dist/decorators/prop.js.map +10 -3
- package/dist/decorators/query-slot.d.ts +11 -3
- package/dist/decorators/query-slot.js +2 -2
- package/dist/decorators/query-slot.js.map +10 -3
- package/dist/decorators/query.d.ts +9 -2
- package/dist/decorators/query.js +2 -2
- package/dist/decorators/query.js.map +9 -3
- package/dist/decorators/shared/reactive-attr.d.ts +25 -0
- package/dist/decorators/shared/reactive-attr.js +3 -0
- package/dist/decorators/shared/reactive-attr.js.map +11 -0
- package/dist/decorators/signal.d.ts +10 -4
- package/dist/decorators/signal.js +2 -2
- package/dist/decorators/signal.js.map +11 -3
- package/dist/decorators/standard/attr.d.ts +2 -0
- package/dist/decorators/standard/attr.js +3 -0
- package/dist/decorators/standard/attr.js.map +12 -0
- package/dist/decorators/standard/bound.js +2 -2
- package/dist/decorators/standard/bound.js.map +4 -3
- package/dist/decorators/standard/custom-element.js +2 -2
- package/dist/decorators/standard/custom-element.js.map +5 -3
- package/dist/decorators/standard/debounce.js +2 -2
- package/dist/decorators/standard/debounce.js.map +5 -3
- package/dist/decorators/standard/event.js +2 -2
- package/dist/decorators/standard/event.js.map +6 -3
- package/dist/decorators/standard/on-event.d.ts +2 -1
- package/dist/decorators/standard/on-event.js +2 -2
- package/dist/decorators/standard/on-event.js.map +5 -3
- package/dist/decorators/standard/on-updated.d.ts +5 -1
- package/dist/decorators/standard/on-updated.js +2 -2
- package/dist/decorators/standard/on-updated.js.map +4 -3
- package/dist/decorators/standard/query-slot.d.ts +1 -1
- package/dist/decorators/standard/query-slot.js +2 -2
- package/dist/decorators/standard/query-slot.js.map +5 -3
- package/dist/decorators/standard/query.d.ts +2 -1
- package/dist/decorators/standard/query.js +2 -2
- package/dist/decorators/standard/query.js.map +5 -3
- package/dist/decorators/standard/reactive-field.d.ts +2 -2
- package/dist/decorators/standard/reactive-field.js +2 -2
- package/dist/decorators/standard/reactive-field.js.map +4 -3
- package/dist/decorators/standard/reactive-prop.d.ts +13 -2
- package/dist/decorators/standard/reactive-prop.js +2 -2
- package/dist/decorators/standard/reactive-prop.js.map +6 -3
- package/dist/decorators/standard/signal.d.ts +4 -3
- package/dist/decorators/standard/signal.js +2 -2
- package/dist/decorators/standard/signal.js.map +8 -3
- package/dist/decorators/state.d.ts +6 -5
- package/dist/decorators/state.js +2 -2
- package/dist/decorators/state.js.map +8 -3
- package/dist/helpers/create-event-listener.d.ts +11 -2
- package/dist/helpers/create-event-listener.js +2 -2
- package/dist/helpers/create-event-listener.js.map +4 -3
- package/dist/helpers/create-event.js +2 -2
- package/dist/helpers/create-event.js.map +5 -3
- package/dist/helpers/create-query-slot.js +2 -2
- package/dist/helpers/create-query-slot.js.map +4 -3
- package/dist/helpers/create-query.d.ts +14 -3
- package/dist/helpers/create-query.js +2 -2
- package/dist/helpers/create-query.js.map +4 -3
- package/dist/helpers/debounce.js +2 -2
- package/dist/helpers/debounce.js.map +4 -3
- package/dist/helpers/index.js +2 -2
- package/dist/helpers/index.js.map +9 -3
- package/dist/index.d.ts +11 -12
- package/dist/index.js +2 -2
- package/dist/index.js.map +87 -3
- package/dist/server/context-ssr.js +2 -2
- package/dist/server/context-ssr.js.map +5 -3
- package/dist/server/html-parser.js +2 -2
- package/dist/server/html-parser.js.map +4 -3
- package/dist/server/install-light-dom-shim.js +2 -2
- package/dist/server/install-light-dom-shim.js.map +5 -3
- package/dist/server/light-dom-shim.js +2 -2
- package/dist/server/light-dom-shim.js.map +5 -3
- package/dist/server/project-root.js +2 -2
- package/dist/server/project-root.js.map +2 -2
- package/dist/server/radiant-component-ssr-runtime.d.ts +2 -2
- package/dist/server/radiant-component-ssr-runtime.js +2 -2
- package/dist/server/radiant-component-ssr-runtime.js.map +11 -3
- package/dist/server/render-component.d.ts +3 -13
- package/dist/server/render-component.js +2 -2
- package/dist/server/render-component.js.map +14 -4
- package/dist/server/render-controller.d.ts +57 -0
- package/dist/server/render-controller.js +3 -0
- package/dist/server/render-controller.js.map +23 -0
- package/dist/server/slot-projection-html.js +2 -2
- package/dist/server/slot-projection-html.js.map +7 -3
- package/dist/signals/host-resource.js +2 -2
- package/dist/signals/host-resource.js.map +2 -2
- package/dist/signals/host-signal.d.ts +4 -2
- package/dist/signals/host-signal.js +2 -2
- package/dist/signals/host-signal.js.map +7 -3
- package/dist/signals/hydration-script.js +2 -2
- package/dist/signals/hydration-script.js.map +6 -3
- package/dist/tools/escape-script-json.js +2 -2
- package/dist/tools/escape-script-json.js.map +4 -3
- package/dist/tools/event-emitter.js +2 -2
- package/dist/tools/event-emitter.js.map +4 -3
- package/dist/tools/index.js +2 -2
- package/dist/tools/index.js.map +7 -3
- package/dist/tools/render-jsx-template.js +2 -2
- package/dist/tools/render-jsx-template.js.map +4 -3
- package/dist/tools/stringify-typed.js +2 -2
- package/dist/tools/stringify-typed.js.map +4 -3
- package/dist/types.js +2 -2
- package/dist/types.js.map +2 -2
- package/dist/utils/attribute-utils.js +2 -2
- package/dist/utils/attribute-utils.js.map +4 -3
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.js.map +4 -3
- package/package.json +22 -5
- package/size-budget.json +11 -2
- package/dist/chunk-0bswvy25.js +0 -4
- package/dist/chunk-0bswvy25.js.map +0 -10
- package/dist/chunk-0btkzzyc.js +0 -4
- package/dist/chunk-0btkzzyc.js.map +0 -10
- package/dist/chunk-0g0j9re6.js +0 -4
- package/dist/chunk-0g0j9re6.js.map +0 -10
- package/dist/chunk-1x26p09c.js +0 -4
- package/dist/chunk-1x26p09c.js.map +0 -10
- package/dist/chunk-21a7jask.js +0 -4
- package/dist/chunk-21a7jask.js.map +0 -10
- package/dist/chunk-21acj2eq.js +0 -4
- package/dist/chunk-21acj2eq.js.map +0 -10
- package/dist/chunk-25zjh0kg.js +0 -4
- package/dist/chunk-25zjh0kg.js.map +0 -10
- package/dist/chunk-30x4hggg.js +0 -4
- package/dist/chunk-30x4hggg.js.map +0 -10
- package/dist/chunk-3ynk7e1e.js +0 -4
- package/dist/chunk-3ynk7e1e.js.map +0 -10
- package/dist/chunk-5b1en9vz.js +0 -4
- package/dist/chunk-5b1en9vz.js.map +0 -10
- package/dist/chunk-5bkat72n.js +0 -4
- package/dist/chunk-5bkat72n.js.map +0 -10
- package/dist/chunk-5qeaq3tj.js +0 -4
- package/dist/chunk-5qeaq3tj.js.map +0 -10
- package/dist/chunk-66e6s792.js +0 -4
- package/dist/chunk-66e6s792.js.map +0 -10
- package/dist/chunk-79jg8q67.js +0 -4
- package/dist/chunk-79jg8q67.js.map +0 -10
- package/dist/chunk-8d5ddvvf.js +0 -4
- package/dist/chunk-8d5ddvvf.js.map +0 -10
- package/dist/chunk-8e9fgtbn.js +0 -4
- package/dist/chunk-8e9fgtbn.js.map +0 -10
- package/dist/chunk-9mqtp3js.js +0 -4
- package/dist/chunk-9mqtp3js.js.map +0 -10
- package/dist/chunk-9rj2rwes.js +0 -4
- package/dist/chunk-9rj2rwes.js.map +0 -10
- package/dist/chunk-atms6yrh.js +0 -4
- package/dist/chunk-atms6yrh.js.map +0 -10
- package/dist/chunk-bk2nbmcd.js +0 -4
- package/dist/chunk-bk2nbmcd.js.map +0 -10
- package/dist/chunk-bk6qkvfp.js +0 -4
- package/dist/chunk-bk6qkvfp.js.map +0 -10
- package/dist/chunk-c0qyz98c.js +0 -4
- package/dist/chunk-c0qyz98c.js.map +0 -10
- package/dist/chunk-c52qhh0j.js +0 -4
- package/dist/chunk-c52qhh0j.js.map +0 -10
- package/dist/chunk-cnyxrh9r.js +0 -4
- package/dist/chunk-cnyxrh9r.js.map +0 -10
- package/dist/chunk-cvz9mrxa.js +0 -4
- package/dist/chunk-cvz9mrxa.js.map +0 -10
- package/dist/chunk-dabagjk6.js +0 -4
- package/dist/chunk-dabagjk6.js.map +0 -10
- package/dist/chunk-e0r6ca2g.js +0 -4
- package/dist/chunk-e0r6ca2g.js.map +0 -10
- package/dist/chunk-e5jd9h6t.js +0 -4
- package/dist/chunk-e5jd9h6t.js.map +0 -10
- package/dist/chunk-eevw1j2q.js +0 -4
- package/dist/chunk-eevw1j2q.js.map +0 -10
- package/dist/chunk-ek664x1c.js +0 -4
- package/dist/chunk-ek664x1c.js.map +0 -10
- package/dist/chunk-eyw14d6y.js +0 -4
- package/dist/chunk-eyw14d6y.js.map +0 -10
- package/dist/chunk-fs4j94bk.js +0 -4
- package/dist/chunk-fs4j94bk.js.map +0 -10
- package/dist/chunk-g2z3mm6b.js +0 -4
- package/dist/chunk-g2z3mm6b.js.map +0 -10
- package/dist/chunk-g5n3m11h.js +0 -4
- package/dist/chunk-g5n3m11h.js.map +0 -10
- package/dist/chunk-gdkte2vd.js +0 -4
- package/dist/chunk-gdkte2vd.js.map +0 -10
- package/dist/chunk-gg74gdpv.js +0 -4
- package/dist/chunk-gg74gdpv.js.map +0 -10
- package/dist/chunk-gpv1n74a.js +0 -4
- package/dist/chunk-gpv1n74a.js.map +0 -10
- package/dist/chunk-h9k7crjc.js +0 -4
- package/dist/chunk-h9k7crjc.js.map +0 -10
- package/dist/chunk-hpzgnxgq.js +0 -4
- package/dist/chunk-hpzgnxgq.js.map +0 -10
- package/dist/chunk-hrjc8b1y.js +0 -4
- package/dist/chunk-hrjc8b1y.js.map +0 -10
- package/dist/chunk-hvy4zvcc.js +0 -4
- package/dist/chunk-hvy4zvcc.js.map +0 -10
- package/dist/chunk-hztr86b4.js +0 -4
- package/dist/chunk-hztr86b4.js.map +0 -10
- package/dist/chunk-j3v7rca5.js +0 -4
- package/dist/chunk-j3v7rca5.js.map +0 -10
- package/dist/chunk-j864sv4w.js +0 -4
- package/dist/chunk-j864sv4w.js.map +0 -10
- package/dist/chunk-jkb2y7c8.js +0 -4
- package/dist/chunk-jkb2y7c8.js.map +0 -10
- package/dist/chunk-kakpjgzf.js +0 -4
- package/dist/chunk-kakpjgzf.js.map +0 -10
- package/dist/chunk-kmebacvv.js +0 -4
- package/dist/chunk-kmebacvv.js.map +0 -10
- package/dist/chunk-knqsm6v3.js +0 -4
- package/dist/chunk-knqsm6v3.js.map +0 -10
- package/dist/chunk-mp2vtrkg.js +0 -4
- package/dist/chunk-mp2vtrkg.js.map +0 -10
- package/dist/chunk-mpsj3cjs.js +0 -4
- package/dist/chunk-mpsj3cjs.js.map +0 -10
- package/dist/chunk-n4p2542b.js +0 -4
- package/dist/chunk-n4p2542b.js.map +0 -10
- package/dist/chunk-nctznxyz.js +0 -4
- package/dist/chunk-nctznxyz.js.map +0 -10
- package/dist/chunk-ndw3hc3v.js +0 -4
- package/dist/chunk-ndw3hc3v.js.map +0 -10
- package/dist/chunk-nnnb6pac.js +0 -4
- package/dist/chunk-nnnb6pac.js.map +0 -10
- package/dist/chunk-nssj2x13.js +0 -4
- package/dist/chunk-nssj2x13.js.map +0 -10
- package/dist/chunk-nvr37vma.js +0 -4
- package/dist/chunk-nvr37vma.js.map +0 -10
- package/dist/chunk-p8k4g99a.js +0 -4
- package/dist/chunk-p8k4g99a.js.map +0 -10
- package/dist/chunk-pkszgjqf.js +0 -4
- package/dist/chunk-pkszgjqf.js.map +0 -10
- package/dist/chunk-q9z6tnzw.js +0 -4
- package/dist/chunk-q9z6tnzw.js.map +0 -10
- package/dist/chunk-qdz5sncz.js +0 -4
- package/dist/chunk-qdz5sncz.js.map +0 -10
- package/dist/chunk-qe0eww1n.js +0 -4
- package/dist/chunk-qe0eww1n.js.map +0 -10
- package/dist/chunk-r33zvvda.js +0 -4
- package/dist/chunk-r33zvvda.js.map +0 -10
- package/dist/chunk-rkh1vkb9.js +0 -4
- package/dist/chunk-rkh1vkb9.js.map +0 -10
- package/dist/chunk-rrg759ht.js +0 -4
- package/dist/chunk-rrg759ht.js.map +0 -10
- package/dist/chunk-s09s5ayx.js +0 -4
- package/dist/chunk-s09s5ayx.js.map +0 -10
- package/dist/chunk-sf4a2gy5.js +0 -4
- package/dist/chunk-sf4a2gy5.js.map +0 -10
- package/dist/chunk-ssnnxzrj.js +0 -4
- package/dist/chunk-ssnnxzrj.js.map +0 -10
- package/dist/chunk-t8xtvgyg.js +0 -4
- package/dist/chunk-t8xtvgyg.js.map +0 -10
- package/dist/chunk-v3ta7hnv.js +0 -4
- package/dist/chunk-v3ta7hnv.js.map +0 -10
- package/dist/chunk-v92hp9g0.js +0 -4
- package/dist/chunk-v92hp9g0.js.map +0 -10
- package/dist/chunk-vgtggzb6.js +0 -4
- package/dist/chunk-vgtggzb6.js.map +0 -9
- package/dist/chunk-vk48hgm4.js +0 -4
- package/dist/chunk-vk48hgm4.js.map +0 -10
- package/dist/chunk-w8s5fnsq.js +0 -4
- package/dist/chunk-w8s5fnsq.js.map +0 -10
- package/dist/chunk-wd23rn4q.js +0 -4
- package/dist/chunk-wd23rn4q.js.map +0 -10
- package/dist/chunk-wds4href.js +0 -4
- package/dist/chunk-wds4href.js.map +0 -10
- package/dist/chunk-wvd1ffe4.js +0 -4
- package/dist/chunk-wvd1ffe4.js.map +0 -10
- package/dist/chunk-wwbjz9k4.js +0 -4
- package/dist/chunk-wwbjz9k4.js.map +0 -10
- package/dist/chunk-x2k0ngpz.js +0 -4
- package/dist/chunk-x2k0ngpz.js.map +0 -10
- package/dist/chunk-x457d0ap.js +0 -4
- package/dist/chunk-x457d0ap.js.map +0 -10
- package/dist/chunk-xbhtzkre.js +0 -4
- package/dist/chunk-xbhtzkre.js.map +0 -10
- package/dist/chunk-y139ycfm.js +0 -4
- package/dist/chunk-y139ycfm.js.map +0 -10
- package/dist/chunk-z9kxfckm.js +0 -4
- package/dist/chunk-z9kxfckm.js.map +0 -10
- package/dist/chunk-zx5txex8.js +0 -4
- package/dist/chunk-zx5txex8.js.map +0 -10
- package/dist/chunk-zygdebw8.js +0 -4
- package/dist/chunk-zygdebw8.js.map +0 -10
- package/dist/core/radiant-component.d.ts +0 -113
- package/dist/core/radiant-component.js +0 -3
- package/dist/core/radiant-component.js.map +0 -9
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/helpers/create-query.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"type BaseQueryConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tscope?: QueryScope;\n};\n\ntype QueryBySelector = { selector: string };\n\ntype QueryByRef = { ref: string };\n\nexport type QueryHostTarget = Element | { host: Element };\n\n/**\n * Selects which DOM tree a query should read from.\n */\nexport type QueryScope = 'light' | 'shadow' | 'both';\n\nexport type QueryConfig = BaseQueryConfig & (QueryBySelector | QueryByRef);\n\ntype QueryRoot = Element | ShadowRoot;\n\ntype QueryResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\nfunction isControllerQueryTarget(target: QueryHostTarget): target is { host: Element } {\n\treturn !(target instanceof Element);\n}\n\nfunction resolveShadowRoot(host: Element): ShadowRoot | null {\n\treturn 'shadowRoot' in host ? ((host as Element & { shadowRoot?: ShadowRoot | null }).shadowRoot ?? null) : null;\n}\n\n/**\n * Resolves the DOM element that should serve as the query root.\n *\n * `@query(...)` can run on both element hosts and controller instances. This\n * helper normalizes those call sites to the underlying element that actually\n * owns the DOM subtree.\n */\nexport function resolveQueryHost(target: QueryHostTarget): Element {\n\treturn target instanceof Element ? target : target.host;\n}\n\nfunction getQueryRoots(host: Element, scope: QueryScope = 'light'): QueryRoot[] {\n\tconst shadowRoot = resolveShadowRoot(host);\n\n\tif (scope === 'shadow') {\n\t\treturn shadowRoot ? [shadowRoot] : [];\n\t}\n\n\tif (scope === 'both') {\n\t\treturn shadowRoot ? [host, shadowRoot] : [host];\n\t}\n\n\treturn [host];\n}\n\n/**\n * Creates a lazy DOM query accessor bound to an element host or controller.\n * Functional equivalent of the `@query` decorator for vanilla JS usage.\n * @param target The element host or controller to query within.\n * @param options {@link QueryConfig} The query configuration.\n */\nexport function createQuery<T extends Element | Element[] = Element>(\n\ttarget: QueryHostTarget,\n\toptions: QueryConfig,\n): QueryResult<T> {\n\tif (isControllerQueryTarget(target) && options.scope && options.scope !== 'light') {\n\t\tthrow new Error('RadiantController queries only support light DOM scope.');\n\t}\n\n\tconst host = resolveQueryHost(target);\n\tconst selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n\tlet cached: T | null = null;\n\n\tconst executeQuery = (): T | null => {\n\t\tconst roots = getQueryRoots(host, options.scope);\n\n\t\tif (options.all) {\n\t\t\treturn roots.flatMap((root) => Array.from(root.querySelectorAll(selector))) as T;\n\t\t}\n\n\t\tfor (const root of roots) {\n\t\t\tconst match = root.querySelector(selector);\n\t\t\tif (match) {\n\t\t\t\treturn match as T;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache) {\n\t\t\t\tif (cached === null || (options.all && Array.isArray(cached) && !cached.length)) {\n\t\t\t\t\tcached = executeQuery();\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\treturn executeQuery();\n\t\t},\n\t};\n}\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PAyBA,SAAS,CAAuB,CAAC,EAAsD,CACtF,MAAO,EAAE,aAAkB,SAG5B,SAAS,CAAiB,CAAC,EAAkC,CAC5D,MAAO,eAAgB,EAAS,EAAsD,YAAc,KAAQ,KAUtG,SAAS,CAAgB,CAAC,EAAkC,CAClE,OAAO,aAAkB,QAAU,EAAS,EAAO,KAGpD,SAAS,CAAa,CAAC,EAAe,EAAoB,QAAsB,CAC/E,IAAM,EAAa,EAAkB,CAAI,EAEzC,GAAI,IAAU,SACb,OAAO,EAAa,CAAC,CAAU,EAAI,CAAC,EAGrC,GAAI,IAAU,OACb,OAAO,EAAa,CAAC,EAAM,CAAU,EAAI,CAAC,CAAI,EAG/C,MAAO,CAAC,CAAI,EASN,SAAS,CAAoD,CACnE,EACA,EACiB,CACjB,GAAI,EAAwB,CAAM,GAAK,EAAQ,OAAS,EAAQ,QAAU,QACzE,MAAU,MAAM,yDAAyD,EAG1E,IAAM,EAAO,EAAiB,CAAM,EAC9B,EAAW,aAAc,EAAU,EAAQ,SAAW,cAAc,EAAQ,QAC9E,EAAmB,KAEjB,EAAe,IAAgB,CACpC,IAAM,EAAQ,EAAc,EAAM,EAAQ,KAAK,EAE/C,GAAI,EAAQ,IACX,OAAO,EAAM,QAAQ,CAAC,IAAS,MAAM,KAAK,EAAK,iBAAiB,CAAQ,CAAC,CAAC,EAG3E,QAAW,KAAQ,EAAO,CACzB,IAAM,EAAQ,EAAK,cAAc,CAAQ,EACzC,GAAI,EACH,OAAO,EAIT,OAAO,MAGR,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,MAAO,CAClB,GAAI,IAAW,MAAS,EAAQ,KAAO,MAAM,QAAQ,CAAM,GAAK,CAAC,EAAO,OACvE,EAAS,EAAa,EAEvB,OAAO,EAER,OAAO,EAAa,EAEtB",
|
|
8
|
+
"debugId": "D4DC29A9DD8A39B764756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
package/dist/helpers/debounce.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var J=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(E,z)=>(typeof require<"u"?require:E)[z]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});function L(q,E){let z=null,j=null,B,F=()=>{if(z!==null)clearTimeout(z),z=null},H=()=>{if(j===null)return B;let G=j;return j=null,F(),B=G(),B},D=function(...G){j=()=>q.apply(this,G),F(),z=setTimeout(()=>{H()},E)};return D.cancel=()=>{F(),j=null},D.flush=()=>{if(j===null)return B;return H()},D.pending=()=>j!==null,D}export{L as debounce};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=C03902A4E5F2B24F64756E2164756E21
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/helpers/debounce.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"import type { Method } from '../types';\n\n/**\n * A debounced function with imperative helpers for controlling pending work.\n *\n * @typeParam T The wrapped callback type.\n */\nexport interface DebouncedFunction<T extends Method> {\n\t(...args: Parameters<T>): void;\n\n\t/**\n\t * Cancels the pending callback invocation, if one exists.\n\t */\n\tcancel(): void;\n\n\t/**\n\t * Immediately invokes the latest pending callback invocation.\n\t *\n\t * @returns The callback result when a call is pending, or the last completed\n\t * result when no call is pending.\n\t */\n\tflush(): ReturnType<T> | undefined;\n\n\t/**\n\t * Reports whether the callback currently has a scheduled invocation.\n\t *\n\t * @returns True when a call is pending.\n\t */\n\tpending(): boolean;\n}\n\n/**\n * Creates a debounced wrapper around a function.\n *\n * The returned function delays invocation until the configured timeout has\n * elapsed since the latest call. It also exposes helpers to cancel, flush,\n * and inspect pending work.\n *\n * @typeParam T The wrapped callback type.\n * @param callback The callback to debounce.\n * @param timeout The debounce timeout in milliseconds.\n * @returns A debounced wrapper around the callback.\n */\nexport function debounce<T extends Method>(callback: T, timeout: number): DebouncedFunction<T> {\n\tlet timeoutRef: ReturnType<typeof setTimeout> | null = null;\n\tlet pendingInvocation: (() => ReturnType<T>) | null = null;\n\tlet lastResult: ReturnType<T> | undefined;\n\n\tconst clearPendingCall = () => {\n\t\tif (timeoutRef !== null) {\n\t\t\tclearTimeout(timeoutRef);\n\t\t\ttimeoutRef = null;\n\t\t}\n\t};\n\n\tconst invoke = (): ReturnType<T> | undefined => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\tconst invocation = pendingInvocation;\n\t\tpendingInvocation = null;\n\t\tclearPendingCall();\n\t\tlastResult = invocation();\n\n\t\treturn lastResult;\n\t};\n\n\tconst debounced = function (this: ThisParameterType<T>, ...args: Parameters<T>) {\n\t\tpendingInvocation = () => callback.apply(this, args) as ReturnType<T>;\n\t\tclearPendingCall();\n\t\ttimeoutRef = setTimeout(() => {\n\t\t\tinvoke();\n\t\t}, timeout);\n\t} as DebouncedFunction<T>;\n\n\tdebounced.cancel = () => {\n\t\tclearPendingCall();\n\t\tpendingInvocation = null;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\treturn invoke();\n\t};\n\n\tdebounced.pending = () => pendingInvocation !== null;\n\n\treturn debounced;\n}\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PA2CO,SAAS,CAA0B,CAAC,EAAa,EAAuC,CAC9F,IAAI,EAAmD,KACnD,EAAkD,KAClD,EAEE,EAAmB,IAAM,CAC9B,GAAI,IAAe,KAClB,aAAa,CAAU,EACvB,EAAa,MAIT,EAAS,IAAiC,CAC/C,GAAI,IAAsB,KACzB,OAAO,EAGR,IAAM,EAAa,EAKnB,OAJA,EAAoB,KACpB,EAAiB,EACjB,EAAa,EAAW,EAEjB,GAGF,EAAY,QAAS,IAAgC,EAAqB,CAC/E,EAAoB,IAAM,EAAS,MAAM,KAAM,CAAI,EACnD,EAAiB,EACjB,EAAa,WAAW,IAAM,CAC7B,EAAO,GACL,CAAO,GAkBX,OAfA,EAAU,OAAS,IAAM,CACxB,EAAiB,EACjB,EAAoB,MAGrB,EAAU,MAAQ,IAAM,CACvB,GAAI,IAAsB,KACzB,OAAO,EAGR,OAAO,EAAO,GAGf,EAAU,QAAU,IAAM,IAAsB,KAEzC",
|
|
8
|
+
"debugId": "C03902A4E5F2B24F64756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
package/dist/helpers/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var A=((B)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(B,{get:(x,G)=>(typeof require<"u"?require:x)[G]}):B)(function(B){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+B+'" is not supported')});function L(B,x){let G=null,U=null,N,W=()=>{if(G!==null)clearTimeout(G),G=null},Y=()=>{if(U===null)return N;let Z=U;return U=null,W(),N=Z(),N},X=function(...Z){U=()=>B.apply(this,Z),W(),G=setTimeout(()=>{Y()},x)};return X.cancel=()=>{W(),U=null},X.flush=()=>{if(U===null)return N;return Y()},X.pending=()=>U!==null,X}class j{host;eventConfig;constructor(B,x){this.host=B,this.eventConfig=x}emit(B){let x=new CustomEvent(this.eventConfig.name,{detail:B,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(x)}}function R(B,x){let G=new j(B,x);return B.registerEventEmitter(x.name,G),G}var _=Symbol("radiant.shadowRootListenerHooks"),D=Symbol("radiant.patchedAttachShadow");function J(B){if(B instanceof Element)return B;if("host"in B)return B.host;return B.element}function P(B){return!(B instanceof Element)}function F(B,x,G,U){let N=(W)=>{if(W.target instanceof Element&&W.target.matches(G))U(W)};return B.addEventListener(x.type,N,x.options),()=>{B.removeEventListener(x.type,N,x.options)}}function V(B,x){let G=J(B);if(!G[_])G[_]=new Set;if(G[_].add(x),G[D])return;let U=G.attachShadow;G.attachShadow=function(W){let Y=U.call(this,W);for(let X of G[_]??[])X();return Y},G[D]=!0}function k(B,x,G){if(P(B)&&"scope"in x&&x.scope&&x.scope!=="light")throw Error("RadiantController event listeners only support light DOM scope.");let U=J(B),N=G.bind(B),W=null,Y=null,X=null,Z=null,z=!1,M=()=>{W?.(),Y?.(),X?.(),Z?.(),W=null,Y=null,X=null,Z=null},$=()=>{if(z)return;if("window"in x&&!W)window.addEventListener(x.type,N,x.options),W=()=>{window.removeEventListener(x.type,N,x.options)};if("document"in x&&!Y)document.addEventListener(x.type,N,x.options),Y=()=>{document.removeEventListener(x.type,N,x.options)};if("selector"in x||"ref"in x){let O="selector"in x?x.selector:`[data-ref='${CSS.escape(x.ref)}']`;if(x.scope!=="shadow"&&!X)X=F(U,x,O,N);if(x.scope!=="light"&&U.shadowRoot&&!Z)Z=F(U.shadowRoot,x,O,N)}};if("selector"in x||"ref"in x){if(x.scope!=="light")V(B,()=>{if(B.isConnected)$()})}if(B.registerConnectedCallback($),B.registerCleanupCallback(M),B.isConnected)$();return()=>{z=!0,M()}}function K(B){return!(B instanceof Element)}function I(B){return"shadowRoot"in B?B.shadowRoot??null:null}function Q(B){return B instanceof Element?B:B.host}function q(B,x="light"){let G=I(B);if(x==="shadow")return G?[G]:[];if(x==="both")return G?[B,G]:[B];return[B]}function C(B,x){if(K(B)&&x.scope&&x.scope!=="light")throw Error("RadiantController queries only support light DOM scope.");let G=Q(B),U="selector"in x?x.selector:`[data-ref="${x.ref}"]`,N=null,W=()=>{let Y=q(G,x.scope);if(x.all)return Y.flatMap((X)=>Array.from(X.querySelectorAll(U)));for(let X of Y){let Z=X.querySelector(U);if(Z)return Z}return null};return{get value(){if(x.cache){if(N===null||x.all&&Array.isArray(N)&&!N.length)N=W();return N}return W()}}}function v(B,x={}){let G=null,U,N=()=>{if(x.all)return typeof B.getSlotElements==="function"?B.getSlotElements(x.name):[];return typeof B.getSlotElement==="function"?B.getSlotElement(x.name):null};return{get value(){if(x.cache===!1)return N();let W=B.slotProjectionVersion??0;if(U!==W)G=N(),U=W;return G}}}export{Q as resolveQueryHost,L as debounce,v as createQuerySlot,C as createQuery,k as createEventListener,R as createEvent};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=F5EEAA50DC46DEBD64756E2164756E21
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/helpers/debounce.ts", "../src/tools/event-emitter.ts", "../src/helpers/create-event.ts", "../src/helpers/create-event-listener.ts", "../src/helpers/create-query.ts", "../src/helpers/create-query-slot.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"import type { Method } from '../types';\n\n/**\n * A debounced function with imperative helpers for controlling pending work.\n *\n * @typeParam T The wrapped callback type.\n */\nexport interface DebouncedFunction<T extends Method> {\n\t(...args: Parameters<T>): void;\n\n\t/**\n\t * Cancels the pending callback invocation, if one exists.\n\t */\n\tcancel(): void;\n\n\t/**\n\t * Immediately invokes the latest pending callback invocation.\n\t *\n\t * @returns The callback result when a call is pending, or the last completed\n\t * result when no call is pending.\n\t */\n\tflush(): ReturnType<T> | undefined;\n\n\t/**\n\t * Reports whether the callback currently has a scheduled invocation.\n\t *\n\t * @returns True when a call is pending.\n\t */\n\tpending(): boolean;\n}\n\n/**\n * Creates a debounced wrapper around a function.\n *\n * The returned function delays invocation until the configured timeout has\n * elapsed since the latest call. It also exposes helpers to cancel, flush,\n * and inspect pending work.\n *\n * @typeParam T The wrapped callback type.\n * @param callback The callback to debounce.\n * @param timeout The debounce timeout in milliseconds.\n * @returns A debounced wrapper around the callback.\n */\nexport function debounce<T extends Method>(callback: T, timeout: number): DebouncedFunction<T> {\n\tlet timeoutRef: ReturnType<typeof setTimeout> | null = null;\n\tlet pendingInvocation: (() => ReturnType<T>) | null = null;\n\tlet lastResult: ReturnType<T> | undefined;\n\n\tconst clearPendingCall = () => {\n\t\tif (timeoutRef !== null) {\n\t\t\tclearTimeout(timeoutRef);\n\t\t\ttimeoutRef = null;\n\t\t}\n\t};\n\n\tconst invoke = (): ReturnType<T> | undefined => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\tconst invocation = pendingInvocation;\n\t\tpendingInvocation = null;\n\t\tclearPendingCall();\n\t\tlastResult = invocation();\n\n\t\treturn lastResult;\n\t};\n\n\tconst debounced = function (this: ThisParameterType<T>, ...args: Parameters<T>) {\n\t\tpendingInvocation = () => callback.apply(this, args) as ReturnType<T>;\n\t\tclearPendingCall();\n\t\ttimeoutRef = setTimeout(() => {\n\t\t\tinvoke();\n\t\t}, timeout);\n\t} as DebouncedFunction<T>;\n\n\tdebounced.cancel = () => {\n\t\tclearPendingCall();\n\t\tpendingInvocation = null;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\treturn invoke();\n\t};\n\n\tdebounced.pending = () => pendingInvocation !== null;\n\n\treturn debounced;\n}\n",
|
|
6
|
+
"import type { RadiantElement } from '../core/radiant-element';\n\nexport interface EventEmitterConfig {\n\tname: string;\n\tbubbles?: boolean;\n\tcancelable?: boolean;\n\tcomposed?: 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\tprivate host: RadiantElement;\n\tprivate eventConfig: EventEmitterConfig;\n\n\t/**\n\t * Constructs a new instance of the EventEmitter class.\n\t *\n\t * @param host - The host element on which the events will be dispatched.\n\t * @param eventConfig - The configuration for the event.\n\t */\n\tconstructor(host: RadiantElement, eventConfig: EventEmitterConfig) {\n\t\tthis.host = host;\n\t\tthis.eventConfig = eventConfig;\n\t}\n\n\t/**\n\t * Emits a custom event with the specified detail.\n\t *\n\t * @param detail - The detail object to be passed along with the event.\n\t */\n\temit(detail?: T) {\n\t\tconst event = new CustomEvent(this.eventConfig.name, {\n\t\t\tdetail: detail,\n\t\t\tbubbles: this.eventConfig.bubbles,\n\t\t\tcancelable: this.eventConfig.cancelable,\n\t\t\tcomposed: this.eventConfig.composed,\n\t\t});\n\t\tthis.host.dispatchEvent(event);\n\t}\n}\n",
|
|
7
|
+
"import type { RadiantElement } from '../core/radiant-element';\nimport { EventEmitter, type EventEmitterConfig } from '../tools/event-emitter';\n\n/**\n * Creates an EventEmitter bound to a host element and registers it on the host.\n * Functional equivalent of the `@event` decorator for vanilla JS usage.\n * @param host The host element that will dispatch the events.\n * @param config {@link EventEmitterConfig} The event emitter configuration.\n */\nexport function createEvent<T = unknown>(host: RadiantElement, config: EventEmitterConfig): EventEmitter<T> {\n\tconst emitter = new EventEmitter<T>(host, config);\n\thost.registerEventEmitter(config.name, emitter);\n\treturn emitter;\n}\n",
|
|
8
|
+
"import type { RadiantElementEventListener } from '../core/radiant-element';\n\n/**\n * Selects which DOM tree delegated event listeners should observe.\n */\nexport type OnEventScope = 'light' | 'shadow' | 'both';\n\ntype BaseOnEventConfig = Pick<RadiantElementEventListener, 'type' | 'options'> & {\n\tscope?: OnEventScope;\n};\n\nexport type OnEventConfig = BaseOnEventConfig &\n\t(\n\t\t| {\n\t\t\t\tselector: string;\n\t\t }\n\t\t| {\n\t\t\t\tref: string;\n\t\t }\n\t\t| {\n\t\t\t\twindow: true;\n\t\t }\n\t\t| {\n\t\t\t\tdocument: true;\n\t\t }\n\t);\n\ntype DelegatedEventRoot = Element | ShadowRoot;\n\ntype EventListenerLifecycleHost = {\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterCleanupCallback(callback: () => void): void;\n\tisConnected: boolean;\n};\n\nexport type EventListenerHost =\n\t| (EventListenerLifecycleHost & Element)\n\t| (EventListenerLifecycleHost & { host: Element })\n\t| (EventListenerLifecycleHost & { element: Element });\n\nconst shadowRootListenerHooksKey = Symbol('radiant.shadowRootListenerHooks');\nconst patchedAttachShadowKey = Symbol('radiant.patchedAttachShadow');\n\ntype ShadowRootHookHost = Element & {\n\t[patchedAttachShadowKey]?: true;\n\t[shadowRootListenerHooksKey]?: Set<() => void>;\n};\n\nfunction resolveEventListenerHostElement(host: EventListenerHost): Element {\n\tif (host instanceof Element) {\n\t\treturn host;\n\t}\n\n\tif ('host' in host) {\n\t\treturn host.host;\n\t}\n\n\treturn host.element;\n}\n\nfunction isControllerEventHost(host: EventListenerHost): host is EventListenerLifecycleHost & { host: Element } {\n\treturn !(host instanceof Element);\n}\n\nfunction addDelegatedListener(\n\troot: DelegatedEventRoot,\n\tconfig: Pick<OnEventConfig, 'type' | 'options'>,\n\tselector: string,\n\tlistener: EventListener,\n): () => void {\n\tconst delegatedListener = (event: Event) => {\n\t\tif (event.target instanceof Element && event.target.matches(selector)) {\n\t\t\tlistener(event);\n\t\t}\n\t};\n\n\troot.addEventListener(config.type, delegatedListener, config.options);\n\n\treturn () => {\n\t\troot.removeEventListener(config.type, delegatedListener, config.options);\n\t};\n}\n\nfunction registerShadowRootHook(host: EventListenerHost, hook: () => void): void {\n\tconst shadowAwareHost = resolveEventListenerHostElement(host) as ShadowRootHookHost;\n\n\tif (!shadowAwareHost[shadowRootListenerHooksKey]) {\n\t\tshadowAwareHost[shadowRootListenerHooksKey] = new Set();\n\t}\n\n\tshadowAwareHost[shadowRootListenerHooksKey].add(hook);\n\n\tif (shadowAwareHost[patchedAttachShadowKey]) {\n\t\treturn;\n\t}\n\n\tconst originalAttachShadow = shadowAwareHost.attachShadow;\n\n\tshadowAwareHost.attachShadow = function patchedAttachShadow(init: ShadowRootInit): ShadowRoot {\n\t\tconst shadowRoot = originalAttachShadow.call(this, init);\n\t\tfor (const shadowRootHook of shadowAwareHost[shadowRootListenerHooksKey] ?? []) {\n\t\t\tshadowRootHook();\n\t\t}\n\t\treturn shadowRoot;\n\t};\n\n\tshadowAwareHost[patchedAttachShadowKey] = true;\n}\n\n/**\n * Subscribes to a DOM event with delegation, window, or document targeting.\n * Functional equivalent of the `@onEvent` decorator for vanilla JS usage.\n * Returns a cleanup function to remove the listener.\n * @param host The host RadiantElement.\n * @param config The event listener configuration.\n * @param callback The event handler function.\n */\nexport function createEventListener(\n\thost: EventListenerHost,\n\tconfig: OnEventConfig,\n\tcallback: (event: Event) => void,\n): () => void {\n\tif (isControllerEventHost(host) && 'scope' in config && config.scope && config.scope !== 'light') {\n\t\tthrow new Error('RadiantController event listeners only support light DOM scope.');\n\t}\n\n\tconst hostElement = resolveEventListenerHostElement(host);\n\tconst boundCallback = callback.bind(host);\n\tlet windowCleanup: (() => void) | null = null;\n\tlet documentCleanup: (() => void) | null = null;\n\tlet lightCleanup: (() => void) | null = null;\n\tlet shadowCleanup: (() => void) | null = null;\n\tlet disposed = false;\n\n\tconst detachListeners = () => {\n\t\twindowCleanup?.();\n\t\tdocumentCleanup?.();\n\t\tlightCleanup?.();\n\t\tshadowCleanup?.();\n\n\t\twindowCleanup = null;\n\t\tdocumentCleanup = null;\n\t\tlightCleanup = null;\n\t\tshadowCleanup = null;\n\t};\n\n\tconst attachListeners = () => {\n\t\tif (disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ('window' in config && !windowCleanup) {\n\t\t\twindow.addEventListener(config.type, boundCallback, config.options);\n\t\t\twindowCleanup = () => {\n\t\t\t\twindow.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('document' in config && !documentCleanup) {\n\t\t\tdocument.addEventListener(config.type, boundCallback, config.options);\n\t\t\tdocumentCleanup = () => {\n\t\t\t\tdocument.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('selector' in config || 'ref' in config) {\n\t\t\tconst selector = 'selector' in config ? config.selector : `[data-ref='${CSS.escape(config.ref)}']`;\n\n\t\t\tif (config.scope !== 'shadow' && !lightCleanup) {\n\t\t\t\tlightCleanup = addDelegatedListener(hostElement, config, selector, boundCallback);\n\t\t\t}\n\n\t\t\tif (config.scope !== 'light' && hostElement.shadowRoot && !shadowCleanup) {\n\t\t\t\tshadowCleanup = addDelegatedListener(hostElement.shadowRoot, config, selector, boundCallback);\n\t\t\t}\n\t\t}\n\t};\n\n\tif ('selector' in config || 'ref' in config) {\n\t\tif (config.scope !== 'light') {\n\t\t\tregisterShadowRootHook(host, () => {\n\t\t\t\tif (host.isConnected) {\n\t\t\t\t\tattachListeners();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\thost.registerConnectedCallback(attachListeners);\n\thost.registerCleanupCallback(detachListeners);\n\n\tif (host.isConnected) {\n\t\tattachListeners();\n\t}\n\n\treturn () => {\n\t\tdisposed = true;\n\t\tdetachListeners();\n\t};\n}\n",
|
|
9
|
+
"type BaseQueryConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tscope?: QueryScope;\n};\n\ntype QueryBySelector = { selector: string };\n\ntype QueryByRef = { ref: string };\n\nexport type QueryHostTarget = Element | { host: Element };\n\n/**\n * Selects which DOM tree a query should read from.\n */\nexport type QueryScope = 'light' | 'shadow' | 'both';\n\nexport type QueryConfig = BaseQueryConfig & (QueryBySelector | QueryByRef);\n\ntype QueryRoot = Element | ShadowRoot;\n\ntype QueryResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\nfunction isControllerQueryTarget(target: QueryHostTarget): target is { host: Element } {\n\treturn !(target instanceof Element);\n}\n\nfunction resolveShadowRoot(host: Element): ShadowRoot | null {\n\treturn 'shadowRoot' in host ? ((host as Element & { shadowRoot?: ShadowRoot | null }).shadowRoot ?? null) : null;\n}\n\n/**\n * Resolves the DOM element that should serve as the query root.\n *\n * `@query(...)` can run on both element hosts and controller instances. This\n * helper normalizes those call sites to the underlying element that actually\n * owns the DOM subtree.\n */\nexport function resolveQueryHost(target: QueryHostTarget): Element {\n\treturn target instanceof Element ? target : target.host;\n}\n\nfunction getQueryRoots(host: Element, scope: QueryScope = 'light'): QueryRoot[] {\n\tconst shadowRoot = resolveShadowRoot(host);\n\n\tif (scope === 'shadow') {\n\t\treturn shadowRoot ? [shadowRoot] : [];\n\t}\n\n\tif (scope === 'both') {\n\t\treturn shadowRoot ? [host, shadowRoot] : [host];\n\t}\n\n\treturn [host];\n}\n\n/**\n * Creates a lazy DOM query accessor bound to an element host or controller.\n * Functional equivalent of the `@query` decorator for vanilla JS usage.\n * @param target The element host or controller to query within.\n * @param options {@link QueryConfig} The query configuration.\n */\nexport function createQuery<T extends Element | Element[] = Element>(\n\ttarget: QueryHostTarget,\n\toptions: QueryConfig,\n): QueryResult<T> {\n\tif (isControllerQueryTarget(target) && options.scope && options.scope !== 'light') {\n\t\tthrow new Error('RadiantController queries only support light DOM scope.');\n\t}\n\n\tconst host = resolveQueryHost(target);\n\tconst selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n\tlet cached: T | null = null;\n\n\tconst executeQuery = (): T | null => {\n\t\tconst roots = getQueryRoots(host, options.scope);\n\n\t\tif (options.all) {\n\t\t\treturn roots.flatMap((root) => Array.from(root.querySelectorAll(selector))) as T;\n\t\t}\n\n\t\tfor (const root of roots) {\n\t\t\tconst match = root.querySelector(selector);\n\t\t\tif (match) {\n\t\t\t\treturn match as T;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache) {\n\t\t\t\tif (cached === null || (options.all && Array.isArray(cached) && !cached.length)) {\n\t\t\t\t\tcached = executeQuery();\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\treturn executeQuery();\n\t\t},\n\t};\n}\n",
|
|
10
|
+
"export type QuerySlotConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tname?: string;\n};\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElement<T extends Element = Element>(name?: string): T | null;\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n};\n\ntype QuerySlotResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\n/**\n * Creates a lazy slot query accessor bound to a host element.\n * Functional equivalent of the `@querySlot` decorator for vanilla JS usage.\n * @param host The host element to query slots within.\n * @param options {@link QuerySlotConfig} The slot query configuration.\n */\nexport function createQuerySlot<T extends Element | Element[] = Element>(\n\thost: SlotQueryHost,\n\toptions: QuerySlotConfig = {},\n): QuerySlotResult<T> {\n\tlet cached: T | null = null;\n\tlet cachedVersion: number | undefined;\n\n\tconst executeQuery = (): T | null => {\n\t\tif (options.all) {\n\t\t\treturn (typeof host.getSlotElements === 'function' ? host.getSlotElements(options.name) : []) as T;\n\t\t}\n\t\treturn (typeof host.getSlotElement === 'function' ? host.getSlotElement(options.name) : null) as T | null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache === false) {\n\t\t\t\treturn executeQuery();\n\t\t\t}\n\n\t\t\tconst currentVersion = (host as unknown as Record<string, number | undefined>).slotProjectionVersion ?? 0;\n\n\t\t\tif (cachedVersion !== currentVersion) {\n\t\t\t\tcached = executeQuery();\n\t\t\t\tcachedVersion = currentVersion;\n\t\t\t}\n\n\t\t\treturn cached;\n\t\t},\n\t};\n}\n"
|
|
5
11
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
12
|
+
"mappings": "2PA2CO,SAAS,CAA0B,CAAC,EAAa,EAAuC,CAC9F,IAAI,EAAmD,KACnD,EAAkD,KAClD,EAEE,EAAmB,IAAM,CAC9B,GAAI,IAAe,KAClB,aAAa,CAAU,EACvB,EAAa,MAIT,EAAS,IAAiC,CAC/C,GAAI,IAAsB,KACzB,OAAO,EAGR,IAAM,EAAa,EAKnB,OAJA,EAAoB,KACpB,EAAiB,EACjB,EAAa,EAAW,EAEjB,GAGF,EAAY,QAAS,IAAgC,EAAqB,CAC/E,EAAoB,IAAM,EAAS,MAAM,KAAM,CAAI,EACnD,EAAiB,EACjB,EAAa,WAAW,IAAM,CAC7B,EAAO,GACL,CAAO,GAkBX,OAfA,EAAU,OAAS,IAAM,CACxB,EAAiB,EACjB,EAAoB,MAGrB,EAAU,MAAQ,IAAM,CACvB,GAAI,IAAsB,KACzB,OAAO,EAGR,OAAO,EAAO,GAGf,EAAU,QAAU,IAAM,IAAsB,KAEzC,EC7ED,MAAM,CAA0B,CAC9B,KACA,YAQR,WAAW,CAAC,EAAsB,EAAiC,CAClE,KAAK,KAAO,EACZ,KAAK,YAAc,EAQpB,IAAI,CAAC,EAAY,CAChB,IAAM,EAAQ,IAAI,YAAY,KAAK,YAAY,KAAM,CACpD,OAAQ,EACR,QAAS,KAAK,YAAY,QAC1B,WAAY,KAAK,YAAY,WAC7B,SAAU,KAAK,YAAY,QAC5B,CAAC,EACD,KAAK,KAAK,cAAc,CAAK,EAE/B,CClCO,SAAS,CAAwB,CAAC,EAAsB,EAA6C,CAC3G,IAAM,EAAU,IAAI,EAAgB,EAAM,CAAM,EAEhD,OADA,EAAK,qBAAqB,EAAO,KAAM,CAAO,EACvC,EC4BR,IAAM,EAA6B,OAAO,iCAAiC,EACrE,EAAyB,OAAO,6BAA6B,EAOnE,SAAS,CAA+B,CAAC,EAAkC,CAC1E,GAAI,aAAgB,QACnB,OAAO,EAGR,GAAI,SAAU,EACb,OAAO,EAAK,KAGb,OAAO,EAAK,QAGb,SAAS,CAAqB,CAAC,EAAiF,CAC/G,MAAO,EAAE,aAAgB,SAG1B,SAAS,CAAoB,CAC5B,EACA,EACA,EACA,EACa,CACb,IAAM,EAAoB,CAAC,IAAiB,CAC3C,GAAI,EAAM,kBAAkB,SAAW,EAAM,OAAO,QAAQ,CAAQ,EACnE,EAAS,CAAK,GAMhB,OAFA,EAAK,iBAAiB,EAAO,KAAM,EAAmB,EAAO,OAAO,EAE7D,IAAM,CACZ,EAAK,oBAAoB,EAAO,KAAM,EAAmB,EAAO,OAAO,GAIzE,SAAS,CAAsB,CAAC,EAAyB,EAAwB,CAChF,IAAM,EAAkB,EAAgC,CAAI,EAE5D,GAAI,CAAC,EAAgB,GACpB,EAAgB,GAA8B,IAAI,IAKnD,GAFA,EAAgB,GAA4B,IAAI,CAAI,EAEhD,EAAgB,GACnB,OAGD,IAAM,EAAuB,EAAgB,aAE7C,EAAgB,aAAe,QAA4B,CAAC,EAAkC,CAC7F,IAAM,EAAa,EAAqB,KAAK,KAAM,CAAI,EACvD,QAAW,KAAkB,EAAgB,IAA+B,CAAC,EAC5E,EAAe,EAEhB,OAAO,GAGR,EAAgB,GAA0B,GAWpC,SAAS,CAAmB,CAClC,EACA,EACA,EACa,CACb,GAAI,EAAsB,CAAI,GAAK,UAAW,GAAU,EAAO,OAAS,EAAO,QAAU,QACxF,MAAU,MAAM,iEAAiE,EAGlF,IAAM,EAAc,EAAgC,CAAI,EAClD,EAAgB,EAAS,KAAK,CAAI,EACpC,EAAqC,KACrC,EAAuC,KACvC,EAAoC,KACpC,EAAqC,KACrC,EAAW,GAET,EAAkB,IAAM,CAC7B,IAAgB,EAChB,IAAkB,EAClB,IAAe,EACf,IAAgB,EAEhB,EAAgB,KAChB,EAAkB,KAClB,EAAe,KACf,EAAgB,MAGX,EAAkB,IAAM,CAC7B,GAAI,EACH,OAGD,GAAI,WAAY,GAAU,CAAC,EAC1B,OAAO,iBAAiB,EAAO,KAAM,EAAe,EAAO,OAAO,EAClE,EAAgB,IAAM,CACrB,OAAO,oBAAoB,EAAO,KAAM,EAAe,EAAO,OAAO,GAIvE,GAAI,aAAc,GAAU,CAAC,EAC5B,SAAS,iBAAiB,EAAO,KAAM,EAAe,EAAO,OAAO,EACpE,EAAkB,IAAM,CACvB,SAAS,oBAAoB,EAAO,KAAM,EAAe,EAAO,OAAO,GAIzE,GAAI,aAAc,GAAU,QAAS,EAAQ,CAC5C,IAAM,EAAW,aAAc,EAAS,EAAO,SAAW,cAAc,IAAI,OAAO,EAAO,GAAG,MAE7F,GAAI,EAAO,QAAU,UAAY,CAAC,EACjC,EAAe,EAAqB,EAAa,EAAQ,EAAU,CAAa,EAGjF,GAAI,EAAO,QAAU,SAAW,EAAY,YAAc,CAAC,EAC1D,EAAgB,EAAqB,EAAY,WAAY,EAAQ,EAAU,CAAa,IAK/F,GAAI,aAAc,GAAU,QAAS,GACpC,GAAI,EAAO,QAAU,QACpB,EAAuB,EAAM,IAAM,CAClC,GAAI,EAAK,YACR,EAAgB,EAEjB,EAOH,GAHA,EAAK,0BAA0B,CAAe,EAC9C,EAAK,wBAAwB,CAAe,EAExC,EAAK,YACR,EAAgB,EAGjB,MAAO,IAAM,CACZ,EAAW,GACX,EAAgB,GC5KlB,SAAS,CAAuB,CAAC,EAAsD,CACtF,MAAO,EAAE,aAAkB,SAG5B,SAAS,CAAiB,CAAC,EAAkC,CAC5D,MAAO,eAAgB,EAAS,EAAsD,YAAc,KAAQ,KAUtG,SAAS,CAAgB,CAAC,EAAkC,CAClE,OAAO,aAAkB,QAAU,EAAS,EAAO,KAGpD,SAAS,CAAa,CAAC,EAAe,EAAoB,QAAsB,CAC/E,IAAM,EAAa,EAAkB,CAAI,EAEzC,GAAI,IAAU,SACb,OAAO,EAAa,CAAC,CAAU,EAAI,CAAC,EAGrC,GAAI,IAAU,OACb,OAAO,EAAa,CAAC,EAAM,CAAU,EAAI,CAAC,CAAI,EAG/C,MAAO,CAAC,CAAI,EASN,SAAS,CAAoD,CACnE,EACA,EACiB,CACjB,GAAI,EAAwB,CAAM,GAAK,EAAQ,OAAS,EAAQ,QAAU,QACzE,MAAU,MAAM,yDAAyD,EAG1E,IAAM,EAAO,EAAiB,CAAM,EAC9B,EAAW,aAAc,EAAU,EAAQ,SAAW,cAAc,EAAQ,QAC9E,EAAmB,KAEjB,EAAe,IAAgB,CACpC,IAAM,EAAQ,EAAc,EAAM,EAAQ,KAAK,EAE/C,GAAI,EAAQ,IACX,OAAO,EAAM,QAAQ,CAAC,IAAS,MAAM,KAAK,EAAK,iBAAiB,CAAQ,CAAC,CAAC,EAG3E,QAAW,KAAQ,EAAO,CACzB,IAAM,EAAQ,EAAK,cAAc,CAAQ,EACzC,GAAI,EACH,OAAO,EAIT,OAAO,MAGR,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,MAAO,CAClB,GAAI,IAAW,MAAS,EAAQ,KAAO,MAAM,QAAQ,CAAM,GAAK,CAAC,EAAO,OACvE,EAAS,EAAa,EAEvB,OAAO,EAER,OAAO,EAAa,EAEtB,EClFM,SAAS,CAAwD,CACvE,EACA,EAA2B,CAAC,EACP,CACrB,IAAI,EAAmB,KACnB,EAEE,EAAe,IAAgB,CACpC,GAAI,EAAQ,IACX,OAAQ,OAAO,EAAK,kBAAoB,WAAa,EAAK,gBAAgB,EAAQ,IAAI,EAAI,CAAC,EAE5F,OAAQ,OAAO,EAAK,iBAAmB,WAAa,EAAK,eAAe,EAAQ,IAAI,EAAI,MAGzF,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,QAAU,GACrB,OAAO,EAAa,EAGrB,IAAM,EAAkB,EAAuD,uBAAyB,EAExG,GAAI,IAAkB,EACrB,EAAS,EAAa,EACtB,EAAgB,EAGjB,OAAO,EAET",
|
|
13
|
+
"debugId": "F5EEAA50DC46DEBD64756E2164756E21",
|
|
8
14
|
"names": []
|
|
9
15
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
export * from './core/radiant-element';
|
|
2
|
-
export * from './core/radiant-
|
|
2
|
+
export * from './core/radiant-controller';
|
|
3
3
|
export * from './core/reactive-jsx-value';
|
|
4
|
+
export * from './controller-registry';
|
|
5
|
+
export * from './context/context-provider';
|
|
6
|
+
export * from './context/create-context';
|
|
7
|
+
export * from './context/events';
|
|
8
|
+
export * from './context/decorators/consume-context';
|
|
9
|
+
export * from './context/decorators/context-selector';
|
|
10
|
+
export * from './context/decorators/on-context-update';
|
|
11
|
+
export * from './context/decorators/provide-context';
|
|
12
|
+
export * from './decorators/attr';
|
|
4
13
|
export * from './decorators/bound';
|
|
14
|
+
export * from './decorators/controller';
|
|
5
15
|
export * from './decorators/custom-element';
|
|
6
16
|
export * from './decorators/debounce';
|
|
7
17
|
export * from './decorators/event';
|
|
@@ -12,14 +22,3 @@ export * from './decorators/query';
|
|
|
12
22
|
export * from './decorators/query-slot';
|
|
13
23
|
export * from './decorators/signal';
|
|
14
24
|
export * from './decorators/state';
|
|
15
|
-
export * from './context/context-provider';
|
|
16
|
-
export * from './context/create-context';
|
|
17
|
-
export * from './context/events';
|
|
18
|
-
export * from './context/decorators/consume-context';
|
|
19
|
-
export * from './context/decorators/context-selector';
|
|
20
|
-
export * from './context/decorators/on-context-update';
|
|
21
|
-
export * from './context/decorators/provide-context';
|
|
22
|
-
export * from './helpers/create-query';
|
|
23
|
-
export * from './helpers/create-query-slot';
|
|
24
|
-
export * from './helpers/create-event';
|
|
25
|
-
export * from './helpers/create-event-listener';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as s}from"./chunk-3ynk7e1e.js";import"./chunk-nctznxyz.js";import{v as e}from"./chunk-wds4href.js";import"./chunk-r33zvvda.js";import"./chunk-fs4j94bk.js";import"./chunk-5qeaq3tj.js";import{z as c}from"./chunk-30x4hggg.js";import{A as r}from"./chunk-qe0eww1n.js";import{B as t}from"./chunk-g5n3m11h.js";import"./chunk-s09s5ayx.js";import"./chunk-g2z3mm6b.js";import"./chunk-x2k0ngpz.js";import"./chunk-kakpjgzf.js";import"./chunk-5bkat72n.js";import"./chunk-p8k4g99a.js";import"./chunk-ek664x1c.js";import{P as T}from"./chunk-21acj2eq.js";import{Q as U}from"./chunk-z9kxfckm.js";import{R as o}from"./chunk-21a7jask.js";import{S as a,T as n,U as p,V as l}from"./chunk-kmebacvv.js";import"./chunk-c0qyz98c.js";import{Y as S}from"./chunk-gdkte2vd.js";import{Z as u}from"./chunk-ndw3hc3v.js";import"./chunk-mpsj3cjs.js";import"./chunk-0bswvy25.js";import{aa as v}from"./chunk-pkszgjqf.js";import"./chunk-x457d0ap.js";import"./chunk-vk48hgm4.js";import{da as Z}from"./chunk-0btkzzyc.js";import"./chunk-qdz5sncz.js";import"./chunk-w8s5fnsq.js";import{ga as V}from"./chunk-j864sv4w.js";import"./chunk-y139ycfm.js";import"./chunk-rkh1vkb9.js";import{ja as X}from"./chunk-nvr37vma.js";import"./chunk-h9k7crjc.js";import"./chunk-8d5ddvvf.js";import{ma as d}from"./chunk-0g0j9re6.js";import"./chunk-8e9fgtbn.js";import"./chunk-bk2nbmcd.js";import{pa as W}from"./chunk-c52qhh0j.js";import"./chunk-25zjh0kg.js";import"./chunk-mp2vtrkg.js";import{sa as $}from"./chunk-1x26p09c.js";import"./chunk-9rj2rwes.js";import"./chunk-v3ta7hnv.js";import{va as y}from"./chunk-eevw1j2q.js";import"./chunk-knqsm6v3.js";import"./chunk-eyw14d6y.js";import"./chunk-v92hp9g0.js";import{Ba as i}from"./chunk-xbhtzkre.js";import"./chunk-atms6yrh.js";import"./chunk-n4p2542b.js";import"./chunk-nnnb6pac.js";import"./chunk-dabagjk6.js";import{Ja as h}from"./chunk-j3v7rca5.js";import"./chunk-hvy4zvcc.js";import"./chunk-79jg8q67.js";import"./chunk-cnyxrh9r.js";import"./chunk-q9z6tnzw.js";import"./chunk-gg74gdpv.js";import"./chunk-e0r6ca2g.js";import"./chunk-hztr86b4.js";import"./chunk-9mqtp3js.js";import"./chunk-t8xtvgyg.js";import"./chunk-66e6s792.js";import"./chunk-e5jd9h6t.js";import"./chunk-hpzgnxgq.js";import"./chunk-nssj2x13.js";import{xb as Y}from"./chunk-rrg759ht.js";import"./chunk-wvd1ffe4.js";import"./chunk-wd23rn4q.js";import{Ab as x}from"./chunk-bk6qkvfp.js";import{Bb as q}from"./chunk-wwbjz9k4.js";import{Cb as _}from"./chunk-hrjc8b1y.js";import"./chunk-vgtggzb6.js";export{h as state,v as signal,y as querySlot,u as query,e as provideContext,i as prop,d as onUpdated,$ as onEvent,r as onContextUpdate,Z as event,X as debounce,W as customElement,x as createQuerySlot,q as createQuery,_ as createEventListener,Y as createEvent,c as createContext,t as contextSelector,s as consumeContext,V as bound,U as bindReactiveValue,S as RadiantElement,T as RadiantComponent,l as ContextSubscriptionRequestEvent,n as ContextRequestEvent,o as ContextProvider,p as ContextOnMountEvent,a as ContextEventsTypes};
|
|
1
|
+
var m2=((F)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(F,{get:(M,$)=>(typeof require<"u"?require:M)[$]}):F)(function(F){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+F+'" is not supported')});var QF=Symbol.for("@ecopages/radiant.legacy-instance-initializers");function B(F,M){let H=F[QF];if(Array.isArray(H)){H.push(M);return}Object.defineProperty(F,QF,{value:[M],configurable:!0})}function x(F){let M=[],$=Object.getPrototypeOf(F);while($&&$!==Object.prototype)M.push($),$=Object.getPrototypeOf($);for(let H=M.length-1;H>=0;H-=1){let W=M[H][QF];if(!Array.isArray(W))continue;for(let j of W)j(F)}}import{createSubscribableJsxValue as l0}from"@ecopages/jsx";import{trackDependency as OF}from"@ecopages/signals";class CF{read;subscribers=new Set;watcherListeners=new Set;version=0;constructor(F){this.read=F}get(){return OF(this),this.read()}subscribe(F){return this.subscribers.add(F),()=>{this.subscribers.delete(F)}}addWatcher(F){return this.watcherListeners.add(F),()=>{this.watcherListeners.delete(F)}}getVersion(){return this.version}notify(F){this.version+=1;let M;try{this.notifyWatchers()}catch($){M=$}if(this.publish(F),M)throw M}publish(F){for(let M of this.subscribers)M(F)}notifyWatchers(){let F=[];for(let M of this.watcherListeners)try{M()}catch($){F.push($)}if(F.length===1)throw F[0];if(F.length>1)throw AggregateError(F,"Multiple reactive dependency notifications failed.")}}function n0(F){return typeof F==="object"&&F!==null&&typeof F.get==="function"}class w{host;access;shouldAutoBind;bindings;$;reactiveFields=new Map;reactiveDependencies=new Map;reactiveDependencyReaders=new Map;reactiveBindings=new Map;updateCallbacks=new Map;onConnectedCallbacks=[];onDisconnectedCallback=[];constructor(F,M,$){this.host=F;this.access=M;this.shouldAutoBind=$;let H=this.createReactiveBindingNamespace();this.bindings=H,this.$=H}connectHost(){for(let F of this.onConnectedCallbacks)F()}disconnectHost(){for(let F of this.onDisconnectedCallback)F()}notifyUpdate(F,M,$){if(M===$)return;this.reactiveDependencies.get(F)?.notify($);let H=this.updateCallbacks.get(F);if(H)for(let W of H)W()}registerCleanupCallback(F){this.onDisconnectedCallback.push(F)}registerConnectedCallback(F){this.onConnectedCallbacks.push(F)}registerHydrationBinding(F,M){}registerReactiveDependencyReader(F,M){this.reactiveDependencyReaders.set(F,M)}registerUpdateCallback(F,M){if(!this.updateCallbacks.has(F))this.updateCallbacks.set(F,new Set);let $=this.updateCallbacks.get(F);return $.add(M),()=>{if($.delete(M),$.size===0)this.updateCallbacks.delete(F)}}getReactiveBinding(F){let M=this.reactiveBindings.get(F);if(M)return M;let $=l0({getValue:()=>this.readReactiveBindingValue(F),subscribe:(H)=>this.registerUpdateCallback(F,()=>{H(this.readReactiveBindingValue(F))})});return this.reactiveBindings.set(F,$),$}bind(F){return this.getReactiveBinding(F)}defineReactiveBinding(F,M=!0){let $=typeof M==="string"?M:M?`$${F}`:void 0,H=this.access.getBindingTarget?.(this.host)??this.host;if(!$||this.access.hasProperty(this.host,$))return;this.access.defineProperty(H,$,{get:()=>this.getReactiveBinding(F),enumerable:!1,configurable:!0})}trackReactiveRead(F){OF(this.getReactiveDependency(F))}defineReactiveAccessor(F,M){let $=M.bind??this.shouldAutoBind();if(this.defineReactiveBinding(F,$),this.registerReactiveDependencyReader(F,M.getValue),this.access.defineProperty(this.host,F,{get:()=>{return this.trackReactiveRead(F),M.getValue()},set:(H)=>{let W=M.getValue();if(W===H)return;M.setValue(H),this.notifyUpdate(F,W,H)},enumerable:!0,configurable:!0}),M.notifyInitialValue!==void 0)this.notifyUpdate(F,void 0,M.notifyInitialValue)}createReactiveField(F,M,$={}){let H={name:F,value:M,initialValue:M};this.reactiveFields.set(F,H),this.defineReactiveAccessor(F,{bind:$.bind,getValue:()=>this.reactiveFields.get(F)?.value,setValue:(W)=>{this.reactiveFields.set(F,{...H,value:W})},notifyInitialValue:M})}createReactiveBindingNamespace(){return new Proxy(Object.create(null),{get:(F,M)=>{if(typeof M!=="string")return;return this.getReactiveBinding(M)}})}getReactiveDependency(F){let M=this.reactiveDependencies.get(F);if(M)return M;let $=new CF(()=>this.readReactiveDependencyValue(F));return this.reactiveDependencies.set(F,$),$}readReactiveDependencyValue(F){let M=this.reactiveDependencyReaders.get(F);if(M)return M();return this.readReactiveBindingValue(F)}readReactiveBindingValue(F){let M=this.access.readProperty(this.host,F);if(n0(M))return M.get();return M}}var BF=Symbol(),N=Symbol();function v(F,M){let H=F[BF];if(Array.isArray(H)){H.push(M);return}Object.defineProperty(F,BF,{value:[M],configurable:!0})}function fF(F){let M=F,$=M[BF];if(!Array.isArray($))return;M[N]=!0;try{for(let H of $)H()}finally{delete M[N]}}function SF(F){return F.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var _="data-hydration",xF="data-hydration-type",LF="data-hydration-key";function b(F){let M=F.hydrationKey?` ${LF}="${a0(F.hydrationKey)}"`:"";return`<script type="application/json" ${_} ${xF}="${F.type}"${M}>${F.serializedValue}</script>`}function h(F){return SF(F)}function g(F,M){let $=F.textContent;if(!$)return M;try{return JSON.parse($)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${_}>:`,$.slice(0,120));return M}}function y(F,M,$){let H=F.children;if(!H||H.length===0){let W=F.childNodes;if(!W||W.length===0)return null;for(let j=0;j<W.length;j+=1){let P=W[j];if(P.nodeType!==1)continue;let Z=P;if(VF(Z,M,$))return Z}return null}for(let W=0;W<H.length;W+=1)if(VF(H[W],M,$))return H[W];return null}function VF(F,M,$){if(F.tagName!=="SCRIPT"||!F.hasAttribute(_)||F.getAttribute(xF)!==M)return!1;if($!==void 0)return F.getAttribute(LF)===$;return!F.hasAttribute(LF)}function a0(F){return F.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}import{createMarkupNodeLike as r0,isKeyedJsxValue as NF,isSlotJsxValue as o0}from"@ecopages/jsx";var K="",u="data-radiant-slot-projection";function vF(F){let M=new Map;for(let $ of Array.from(F.childNodes)){if(M2($))continue;t0(M,F2($),$)}return M}function bF(F){let M;try{M=JSON.parse(F)}catch{if(typeof console<"u")console.warn("[@ecopages/radiant] Failed to parse slot projection payload:",F.slice(0,120));return new Map}let $=new Map;for(let[H,W]of Object.entries(M)){if(!Array.isArray(W)||W.length===0)continue;$.set(AF(H),W.map((j)=>r0(j)))}return $}function hF(F){let M=Array.from(F.childNodes).filter(($)=>cF($)).map(($)=>m($)??"").filter(($)=>$!=="");return M.length>0?M.join(""):void 0}function gF(F){let M={};for(let[$,H]of F.entries()){let W=H.map((j)=>m(j)).filter((j)=>j!==void 0&&j!=="");if(W.length>0)M[$]=W}return Object.keys(M).length>0?JSON.stringify(M):void 0}function yF(F,M){let $=!1,H=(j)=>{if(o0(j))return $=!0,H2(j,M,H);if(NF(j))return e0(j,H(j.value));if($2(j))return{_$rType$:1,rootLocalName:j.rootLocalName,strings:j.strings,values:j.values.map((P)=>H(P))};if(uF(j))return Array.from(j,(P)=>H(P));return j},W=H(F);return{containsSlots:$,value:W}}function mF(F){for(let M of Array.from(F.childNodes)){if(!dF(M))continue;let $=M.textContent??void 0;return M.parentNode?.removeChild(M),$}return}function t0(F,M,$){let H=F.get(M);if(H){H.push($);return}F.set(M,[$])}function e0(F,M){return{...F,value:M}}function F2(F){if(F instanceof Element)return AF(F.getAttribute("slot"));return K}function uF(F){return typeof F!=="string"&&typeof F==="object"&&F!==null&&Symbol.iterator in F}function dF(F){return F instanceof HTMLScriptElement&&F.hasAttribute(u)}function cF(F){return F instanceof HTMLScriptElement&&F.hasAttribute(_)}function M2(F){return dF(F)||cF(F)}function $2(F){return typeof F==="object"&&F!==null&&F._$rType$===1&&Array.isArray(F.strings)&&Array.isArray(F.values)}function AF(F){return F??K}function m(F){if(F===void 0||F===null||F===!1||F===!0)return;if(typeof Node<"u"&&F instanceof Node){if(F.nodeType===Node.TEXT_NODE)return F.textContent??"";return F.outerHTML??F.textContent??void 0}if(NF(F))return m(F.value);if(typeof F==="string"||typeof F==="number"||typeof F==="bigint")return String(F);if(typeof F==="object"&&F!==null&&"outerHTML"in F)return typeof F.outerHTML==="string"?F.outerHTML:F.textContent??void 0;if(uF(F))return Array.from(F,(M)=>m(M)??"").join("");return}function H2(F,M,$){let H=M.get(AF(F.name));if(H&&H.length>0)return H.length===1?H[0]:H;if(F.fallback===void 0)return"";return $(F.fallback)}var UF=Symbol.for("@ecopages/radiant.hydrator-installed");function e2(){globalThis[UF]=!0}function FM(){delete globalThis[UF]}function pF(){return globalThis[UF]===!0}var sF=Symbol.for("@ecopages/radiant.component-ssr-runtime");function iF(){return globalThis[sF]}function $M(F){globalThis[sF]=F}function aF(F){switch(F){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function W2(F){switch(typeof F){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(F))return"array";if(Object.prototype.toString.call(F)==="[object Object]")return"object"}function O(F){switch(F){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function j2(F){try{return JSON.parse(F)}catch{throw TypeError("Invalid JSON string")}}var P2={array(F){let M=j2(F);if(!Array.isArray(M))throw TypeError(`Expected an array but got a value of type "${typeof M}"`);return M},boolean(F){return!(F==="0"||String(F).toLowerCase()==="false")},number(F){return Number(F.replace(/_/g,""))},object(F){let M=JSON.parse(F);if(M===null||typeof M!=="object"||Array.isArray(M))throw TypeError(`expected value of type "object" but instead got value "${F}" of type "${W2(M)}"`);return M},string(F){return F}},lF={default:rF,array:nF,object:nF};function nF(F){return JSON.stringify(F)}function rF(F){return`${F}`}function I(F,M){let $=aF(M);if(!$)throw TypeError(`[radiant-element] Unknown type "${M}"`);return P2[$](F)}function d(F,M){let $=aF(M);if(!$)throw TypeError(`[radiant-element] Unknown type "${M}"`);return(lF[$]??lF.default??rF)(F)}function Z2(F){return typeof F==="boolean"}function G2(F){return typeof F==="number"}function X2(F){return typeof F==="string"}function Q2(F){return Array.isArray(F)}function B2(F){return typeof F==="object"&&!Array.isArray(F)&&F!==null}function U(F,M){switch(F){case Boolean:return Z2(M);case Number:return G2(M);case String:return X2(M);case Array:return Q2(M);case Object:return B2(M);default:return!1}}var oF=(F,M,$,H)=>{if(M===Boolean){let j=F.getAttribute($);if(j===null)return H;return j===""?!0:I(j,M)}let W=F.getAttribute($);return W!==null?I(W,M):H??O(M)};import{hasHydrationMarkers as L2,hydrate as A2,jsx as U2,render as Y2}from"@ecopages/jsx";import{Computed as D2,subtle as J2}from"@ecopages/signals";var R2=q2();function q2(){if(typeof HTMLElement<"u")return HTMLElement;throw Error("RadiantElement requires HTMLElement. Install '@ecopages/radiant/server/light-dom-shim' before importing Radiant components in SSR.")}class p extends R2{bindings;$;reactiveHost;reactiveProperties=new Map;contextProviders=new Map;hydrationBindings=new Map;eventSubscriptions=new Map;eventEmitters=new Map;elementReady=!1;isRendering=!1;isFirstConnectPending=!1;isRenderScheduled=!1;needsRender=!1;projectedSlotContent=new Map;renderSignal;renderWatcher=new J2.Watcher(()=>{this.requestUpdate()});slotProjectionObserver;slotProjectionVersion=0;constructor(){super();this.reactiveHost=new w(this,{defineProperty:(F,M,$)=>Object.defineProperty(F,M,$),getBindingTarget:(F)=>Object.getPrototypeOf(F)??F,hasProperty:(F,M)=>(M in F),readProperty:(F,M)=>F[M]},()=>this.shouldAutoBindReactiveMembers()),this.bindings=this.reactiveHost.bindings,this.$=this.reactiveHost.$,x(this)}connectedCallback(){let F=this.isFirstConnectPending;if(this.elementReady=!0,this.reactiveHost.connectHost(),F)return;this.isFirstConnectPending=!0,queueMicrotask(()=>{if(this.isFirstConnectPending=!1,!this.isConnected)return;if(!this.shouldRunRenderLifecycle())return;if(this.ensureSlotProjectionState(),this.observeSlotProjection(),tF(this)){if(this.needsRender=!1,this.hydrate(),this.needsRender)this.update();return}this.update()})}connectedContextCallback(F){}disconnectedCallback(){this.disconnectSlotProjectionObserver(),this.disconnectRenderWatcher(),this.removeAllSubscribedEvents(),this.reactiveHost.disconnectHost()}notifyUpdate(F,M,$){this.reactiveHost.notifyUpdate(F,M,$)}transformAttributeValue(F,M){return F!==null?M?.converter.fromAttribute(F):F}attributeChangedCallback(F,M,$){if(M===$||!this.elementReady)return;if(this.reactiveProperties.has(F)){let H=this.reactiveProperties.get(F),W=this.transformAttributeValue($,H),j=this.transformAttributeValue(M,H),P=H?H.attribute:F;this[P]=W,this.notifyUpdate(F,j,W)}}renderTemplate({target:F=this,template:M,insert:$="replace",sanitize:H}){let W=H?H(M):M;switch($){case"replace":F.innerHTML=W;break;case"beforeend":F.insertAdjacentHTML("beforeend",W);break;case"afterbegin":F.insertAdjacentHTML("afterbegin",W);break;case"beforebegin":F.insertAdjacentHTML("beforebegin",W);break;case"afterend":F.insertAdjacentHTML("afterend",W);break}}render(){return U2("slot",{})}renderToString(F={}){if(!this.shouldRunRenderLifecycle())return this.innerHTML;return this.prepareForSsr(),c().renderView(this,F)}renderHost(){return c().renderHost(this)}renderHostToString(F={}){return c().renderHostToString(this,F)}hydrate(){if(!this.shouldRunRenderLifecycle()||!this.isConnected||this.isRendering)return;this.isRendering=!0,this.disconnectSlotProjectionObserver();try{A2(this.resolveTrackedRenderOutput().value,this)}finally{this.isRendering=!1,this.observeSlotProjection()}}requestUpdate(){if(!this.shouldRunRenderLifecycle())return;if(this.needsRender=!0,this.isRenderScheduled)return;this.isRenderScheduled=!0,queueMicrotask(()=>{if(this.isRenderScheduled=!1,!this.needsRender)return;this.update()})}update(){if(!this.shouldRunRenderLifecycle())return;if(this.needsRender=!0,!this.isConnected||this.isRendering)return;if(this.isFirstConnectPending&&tF(this))return;while(this.needsRender&&this.isConnected){this.needsRender=!1,this.isRendering=!0,this.disconnectSlotProjectionObserver();try{Y2(this.resolveTrackedRenderOutput().value,this)}finally{this.isRendering=!1,this.observeSlotProjection()}}}registerReactiveProperty(F){this.reactiveProperties.set(F.name,F)}getReactiveProperties(){return Array.from(this.reactiveProperties.values())}registerReactiveDependencyReader(F,M){this.reactiveHost.registerReactiveDependencyReader(F,M)}registerContextProvider(F,M){this.contextProviders.set(F,M),this.registerHydrationBinding(F,M)}registerHydrationBinding(F,M){this.hydrationBindings.set(F,M)}getContextProviders(){return Array.from(this.contextProviders.values())}getHydrationBindings(){return Array.from(this.hydrationBindings.values())}prepareForSsr(){fF(this)}shouldAutoBindReactiveMembers(){return!0}shouldRunRenderLifecycle(){return this.render!==p.prototype.render}getHostSsrAttributes(){return c().getHostAttributes(this)}resolveSsrRenderBridge(){let F={};if(this.renderHostToString===p.prototype.renderHostToString)F.renderHostToString=(M)=>this.renderHostToString(M);if(this.renderHost===p.prototype.renderHost)F.renderHost=()=>this.renderHost();return F}registerUpdateCallback(F,M){return this.reactiveHost.registerUpdateCallback(F,M)}getReactiveBinding(F){return this.reactiveHost.getReactiveBinding(F)}bind(F){return this.reactiveHost.bind(F)}defineReactiveBinding(F,M=!0){this.reactiveHost.defineReactiveBinding(F,M)}trackReactiveRead(F){this.reactiveHost.trackReactiveRead(F)}subscribeEvents(F){let M=[];for(let $ of F)M.push(this.subscribeEvent($));return M}subscribeEvent(F){let M=(H)=>{if(H.target&&H.target.matches(F.selector))F.listener.call(this,H)},$=`${F.type}:${F.selector}`;return this.addEventListener(F.type,M,F.options),this.eventSubscriptions.set($,{...F,listener:M}),this.unsubscribeEvent.bind(this,$)}unsubscribeEvent(F){let M=this.eventSubscriptions.get(F);if(M)this.removeEventListener(M.type,M.listener,M.options),this.eventSubscriptions.delete(F)}removeAllSubscribedEvents(){for(let F of this.eventSubscriptions.values())this.removeEventListener(F.type,F.listener,F.options);this.eventSubscriptions.clear()}registerCleanupCallback(F){this.reactiveHost.registerCleanupCallback(F)}registerConnectedCallback(F){this.reactiveHost.registerConnectedCallback(F)}registerEventEmitter(F,M){this.eventEmitters.set(F,M)}getRef(F,M=!1){let $=`[data-ref="${F}"]`;if(M)return Array.from(this.querySelectorAll($));return this.querySelector($)??null}getSlotElement(F){return this.getSlotElements(F)[0]??null}getSlotElements(F){return this.ensureSlotProjectionState(),(this.projectedSlotContent.get(F??K)??[]).filter((M)=>typeof Node<"u"&&M instanceof Element)}createReactiveField(F,M,$={}){this.reactiveHost.createReactiveField(F,M,$)}createReactiveProp(F,M){let{type:$,attribute:H,reflect:W,defaultValue:j}=M,P=H??F;if(j!==void 0&&!U($,j))throw Error(`defaultValue does not match the expected type for ${$.name}`);let Z=oF(this,$,P,j);if(this.hasAttribute(P)&&(!W||Z==null||Z===""))this.removeAttribute(P);let G={type:$,name:F,value:Z,initialValue:Z,attribute:P,converter:{fromAttribute:(Q)=>I(Q,$),toAttribute:(Q)=>d(Q,$)}};this.registerReactiveProperty(G);let X=(Q)=>{if(W)if(Q==null||Q===""||Q===!1)this.removeAttribute(P);else{let L=G.converter.toAttribute(Q);this.setAttribute(P,L)}};if(this.reactiveHost.defineReactiveAccessor(F,{bind:M.bind,getValue:()=>this.reactiveProperties.get(F)?.value,setValue:(Q)=>{this.reactiveProperties.set(F,{...G,value:Q}),X(Q)}}),Z!==void 0)queueMicrotask(()=>{let Q=this.reactiveProperties.get(F)?.value;if(Q===void 0)return;X(Q),this.notifyUpdate(F,void 0,Q)})}ensureSlotProjectionState(){if(this.projectedSlotContent.size>0)return;let F=this.isConnected?mF(this):void 0;if(typeof F==="string"&&F!==""){this.projectedSlotContent=bF(F),this.slotProjectionVersion+=1;return}if(this.getHostChildNodeCount()>0)this.projectedSlotContent=vF(this),this.slotProjectionVersion+=1}getHostChildNodeCount(){return"childNodes"in this&&this.childNodes?this.childNodes.length:0}getSlotProjectionScriptTag(){this.ensureSlotProjectionState();let F=gF(this.projectedSlotContent);if(!F)return;return`<script type="application/json" ${u}>${_2(F)}</script>`}getAuthoredHydrationScriptMarkup(){let F=hF(this);if(F)return F;return}handleSlotProjectionMutations(F){let M=!1;for(let $ of F){for(let H of Array.from($.removedNodes))if(this.removeProjectedSlotNode(H))M=!0;for(let H of Array.from($.addedNodes)){if(H.parentNode!==this)continue;if(this.addProjectedSlotNode(H))M=!0}}if(M)this.slotProjectionVersion+=1,this.update()}addProjectedSlotNode(F){if(F instanceof HTMLScriptElement&&(F.hasAttribute(u)||F.hasAttribute(_)))return!1;let M=F instanceof Element?F.getAttribute("slot")??K:K,$=this.projectedSlotContent.get(M);if($){if($.includes(F))return!1;return $.push(F),!0}return this.projectedSlotContent.set(M,[F]),!0}removeProjectedSlotNode(F){for(let[M,$]of this.projectedSlotContent.entries()){let H=$.indexOf(F);if(H===-1)continue;if($.splice(H,1),$.length===0)this.projectedSlotContent.delete(M);return!0}return!1}observeSlotProjection(){if(typeof MutationObserver>"u"||this.slotProjectionObserver||!this.isConnected)return;this.slotProjectionObserver=new MutationObserver((F)=>this.handleSlotProjectionMutations(F)),this.slotProjectionObserver.observe(this,{childList:!0})}disconnectSlotProjectionObserver(){this.slotProjectionObserver?.disconnect(),this.slotProjectionObserver=void 0}disconnectRenderWatcher(){if(!this.renderSignal)return;this.renderWatcher.unwatch(this.renderSignal),this.renderSignal=void 0}resolveTrackedRenderOutput(){let F=new D2(()=>this.resolveRenderOutput()),M=F.get();if(!this.isConnected)return M;if(this.renderSignal)this.renderWatcher.unwatch(this.renderSignal);return this.renderSignal=F,this.renderWatcher.watch(F),M}resolveRenderOutput(){return this.ensureSlotProjectionState(),yF(this.render(),this.projectedSlotContent)}}function c(){let F=iF();if(!F)throw Error("Radiant SSR runtime is unavailable. Import `@ecopages/radiant/server/render-component` before using instance SSR methods.");return F}function tF(F){return pF()&&L2(F)}function _2(F){return F.replace(/</g,"\\u003c")}import{render as z2}from"@ecopages/jsx";import{Computed as k2,subtle as K2}from"@ecopages/signals";class eF{host;element;bindings;$;reactiveHost;connected=!1;isRendering=!1;isRenderScheduled=!1;needsRender=!1;renderSignal;renderWatcher=new K2.Watcher(()=>{this.requestUpdate()});constructor(F){this.host=F,this.element=F,this.reactiveHost=new w(this,{defineProperty:(M,$,H)=>Object.defineProperty(M,$,H),hasProperty:(M,$)=>($ in M),readProperty:(M,$)=>M[$]},()=>this.shouldAutoBindReactiveMembers()),this.bindings=this.reactiveHost.bindings,this.$=this.reactiveHost.$,x(this)}connect(){if(this.connected=!0,this.reactiveHost.connectHost(),this.shouldRunRenderLifecycle())this.update()}connectForSsrRender(){this.connected=!0,this.reactiveHost.connectHost()}disconnect(){this.connected=!1,this.disconnectRenderWatcher(),this.reactiveHost.disconnectHost()}disconnectForSsrRender(){this.disconnectRenderWatcher(),this.reactiveHost.disconnectHost(),this.connected=!1}get isConnected(){return this.connected}render(){return null}requestUpdate(){if(!this.shouldRunRenderLifecycle())return;if(this.needsRender=!0,this.isRenderScheduled)return;this.isRenderScheduled=!0,queueMicrotask(()=>{if(this.isRenderScheduled=!1,!this.needsRender)return;this.update()})}update(){if(!this.shouldRunRenderLifecycle())return;let F=this.getRenderTarget();if(!F)return;if(this.needsRender=!0,!this.connected||this.isRendering)return;while(this.needsRender){this.needsRender=!1,this.isRendering=!0;try{z2(this.resolveTrackedRenderOutput(),F)}finally{this.isRendering=!1}}}bind(F){return this.reactiveHost.bind(F)}getReactiveBinding(F){return this.reactiveHost.getReactiveBinding(F)}createReactiveField(F,M,$={}){this.reactiveHost.createReactiveField(F,M,$)}createReactiveProp(F,M){let{type:$,defaultValue:H,bind:W}=M;if(H!==void 0&&!U($,H))throw Error(`defaultValue does not match the expected type for ${$.name}`);let j=Object.getOwnPropertyDescriptor(this.host,F),P=this.host,G=P[F]??H??O($);this.reactiveHost.defineReactiveAccessor(F,{bind:W,getValue:()=>G,setValue:(X)=>{G=X},notifyInitialValue:G}),Object.defineProperty(this.host,F,{get:()=>this[F],set:(X)=>{this[F]=X},enumerable:j?.enumerable??!0,configurable:!0}),this.registerCleanupCallback(()=>{let X=this[F];if(j){if(Object.defineProperty(this.host,F,j),"value"in j&&j.writable)P[F]=X;return}delete P[F];try{P[F]=X}catch{Object.defineProperty(this.host,F,{value:X,writable:!0,enumerable:!0,configurable:!0})}})}defineReactiveBinding(F,M=!0){this.reactiveHost.defineReactiveBinding(F,M)}notifyUpdate(F,M,$){this.reactiveHost.notifyUpdate(F,M,$)}registerUpdateCallback(F,M){return this.reactiveHost.registerUpdateCallback(F,M)}connectedContextCallback(F){}registerContextProvider(F,M){}registerHydrationBinding(F,M){}registerCleanupCallback(F){this.reactiveHost.registerCleanupCallback(F)}registerConnectedCallback(F){this.reactiveHost.registerConnectedCallback(F)}registerReactiveDependencyReader(F,M){this.reactiveHost.registerReactiveDependencyReader(F,M)}trackReactiveRead(F){this.reactiveHost.trackReactiveRead(F)}addEventListener(F,M,$){this.host.addEventListener(F,M,$)}removeEventListener(F,M,$){this.host.removeEventListener(F,M,$)}dispatchEvent(F){return this.host.dispatchEvent(F)}getRef(F,M=!1){let $=`[data-ref="${F}"]`;if(M)return Array.from(this.host.querySelectorAll($));return this.host.querySelector($)??null}shouldAutoBindReactiveMembers(){return!0}shouldRunRenderLifecycle(){return this.render!==eF.prototype.render}getRenderTarget(){return this.host instanceof HTMLElement?this.host:null}disconnectRenderWatcher(){if(!this.renderSignal)return;this.renderWatcher.unwatch(this.renderSignal),this.renderSignal=void 0}resolveTrackedRenderOutput(){let F=new k2(()=>this.render()),M=F.get();if(!this.connected)return M;if(this.renderSignal)this.renderWatcher.unwatch(this.renderSignal);return this.renderSignal=F,this.renderWatcher.watch(F),M}}function kM(F,M){return F.bind(M)}var F0=Symbol.for("@ecopages/radiant.controllerIdentifier");function YF(F,M){F[F0]=M}function IM(F){return F[F0]}var i="data-controller",M0=Symbol.for("@ecopages/radiant.controller-registry-state");function I2(){let F=globalThis,M=F[M0];if(M)return M;let $={activeRuntimes:new Set,controllerRegistrationStrategy:"keep-current",controllerRegistry:new Map};return F[M0]=$,$}var l=I2(),T=l.controllerRegistry,E=l.activeRuntimes;function $0(F){let M=F.getAttribute(i);if(!M)return[];return M.split(/\s+/).map(($)=>$.trim()).filter(($)=>$.length>0)}function s(F,M){if(F instanceof Element&&F.hasAttribute(i))M(F);for(let $ of Array.from(F.querySelectorAll(`[${i}]`)))M($)}class H0{root;controllersByElement=new Map;observer;stopped=!1;constructor(F=document){this.root=F;this.start()}stop(){if(this.stopped)return;this.stopped=!0,this.observer?.disconnect(),this.observer=void 0;for(let[F,M]of this.controllersByElement)for(let[$]of M)this.disconnectController(F,$);E.delete(this)}reconcileRegisteredController(F){s(this.root,(M)=>{if(!$0(M).includes(F))return;this.connectController(M,F)})}replaceRegisteredController(F){for(let[M,$]of Array.from(this.controllersByElement.entries())){if(!$.has(F))continue;this.disconnectController(M,F)}this.reconcileRegisteredController(F)}start(){if(s(this.root,(M)=>{this.reconcileElement(M)}),typeof MutationObserver>"u"){E.add(this);return}this.observer=new MutationObserver((M)=>{for(let $ of M){if($.type==="attributes"&&$.target instanceof Element){this.reconcileElement($.target);continue}for(let H of Array.from($.removedNodes)){if(!(H instanceof Element))continue;s(H,(W)=>{this.disconnectElementControllers(W)})}for(let H of Array.from($.addedNodes)){if(!(H instanceof Element))continue;s(H,(W)=>{this.reconcileElement(W)})}}});let F=this.root instanceof Document?this.root.documentElement:this.root;this.observer.observe(F,{attributeFilter:[i],attributes:!0,childList:!0,subtree:!0}),E.add(this)}reconcileElement(F){let M=new Set($0(F)),$=this.controllersByElement.get(F);if($){for(let H of $.keys())if(!M.has(H))this.disconnectController(F,H)}for(let H of M)this.connectController(F,H)}connectController(F,M){let $=T.get(M);if(!$)return;let H=this.controllersByElement.get(F);if(!H)H=new Map,this.controllersByElement.set(F,H);if(H.has(M))return;let W=new $(F);H.set(M,W),W.connect()}disconnectController(F,M){let $=this.controllersByElement.get(F);if(!$)return;let H=$.get(M);if(!H)return;if(H.disconnect(),$.delete(M),$.size===0)this.controllersByElement.delete(F)}disconnectElementControllers(F){let M=this.controllersByElement.get(F);if(!M)return;for(let $ of Array.from(M.keys()))this.disconnectController(F,$)}}function E2(F,M){let $=T.get(F);if($)return $;YF(M,F),T.set(F,M);for(let H of Array.from(E))H.reconcileRegisteredController(F);return M}function wM(F){return T.has(F)}function T2(F,M){if(T.get(F)===M)return M;YF(M,F),T.set(F,M);for(let H of Array.from(E))H.replaceRegisteredController(F);return M}function W0(F){l.controllerRegistrationStrategy=F}function OM(){W0("replace")}function CM(){W0("keep-current")}function j0(F,M){if(l.controllerRegistrationStrategy==="replace")return T2(F,M);return E2(F,M)}function fM(F=document){return new H0(F)}function SM(){for(let F of Array.from(E))F.stop()}var DF;((W)=>{W.SUBSCRIPTION_REQUEST="context-subscription-request";W.CONTEXT_REQUEST="context-request";W.ON_MOUNT="context-on-mount";W.MOUNTED="context-mounted"})(DF||={});class JF extends Event{context;callback;subscribe;handled=!1;constructor(F,M,$){super("context-request",{bubbles:!0,composed:!0});this.context=F;this.callback=M;this.subscribe=$}markHandled(){this.handled=!0}}class n extends CustomEvent{constructor(F){super("context-on-mount",{detail:{context:F},bubbles:!0,composed:!0})}}class RF extends Event{context;callback;select;subscribe;onSubscribe;handled=!1;constructor(F,M,$,H,W){super("context-subscription-request",{bubbles:!0,composed:!0});this.context=F;this.callback=M;this.select=$;this.subscribe=H;this.onSubscribe=W}markHandled(){this.handled=!0}}function P0(F){return b({type:"context",...F})}function Z0(F){return h(F)}function bM(F){if(F instanceof Element)return F;if("host"in F)return F.host;if("element"in F)return F.element;return null}function G0(F){if(F instanceof Element)return F;if("host"in F)return F.host;if("element"in F)return F.element;return F}import{createMarkupNodeLike as w2}from"@ecopages/jsx";class C{host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(F,M){this.host=F,this.context=M.context,this.hydrationKey=M.hydrationKey,this.hydrate=M.hydrate,this.serialize=M.serialize,this.pendingHostHydration=Boolean(M.hydrate),this.value=M.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new n(this.context))}setContext=(F,M)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(F)){let $=this.value;if(this.value={...F},M)M(this.value);this.notifySubscribers(this.value,$);return}if(this.isObject(this.value)&&this.isObject(F)){let $={...this.value};if(this.value={...this.value,...F},M)M(this.value);this.notifySubscribers(this.value,$)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let F=this.serialize?this.serialize(this.value):this.value;if(typeof F>"u")return;let M=JSON.stringify(F);if(typeof M!=="string")return;return Z0(M)};renderHydrationScriptTag=()=>{let F=this.serializeHydrationValue();if(!F)return;return P0({hydrationKey:this.hydrationKey,serializedValue:F})};renderHydrationScript=()=>{let F=this.renderHydrationScriptTag();if(!F)return;return w2(F)};subscribe=(F)=>{let M={hasChanged:($,H)=>{if(typeof H>"u"||!F.select)return!0;return F.select($)!==F.select(H)},notify:($)=>{if(F.select){F.callback(F.select($),M.unsubscribe);return}F.callback($,M.unsubscribe)},unsubscribe:()=>{let $=this.subscriptions.indexOf(M);if($!==-1)this.subscriptions.splice($,1)}};return this.subscriptions.push(M),M.unsubscribe};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let F=this.findHydrationScriptElement();if(!F)return;this.value=this.mergeHydrationValue(g(F,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(F){if(this.hydrate===Object&&this.isObject(F)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...F};return F}isObject(F){return typeof F==="object"&&!Array.isArray(F)&&F!==null}findHydrationScriptElement(){return y(G0(this.host),"context",this.hydrationKey)}notifySubscribers=(F,M)=>{for(let $ of this.subscriptions)if($.hasChanged(F,M))$.notify(F)};handleSubscriptionRequest=(F,{subscribe:M,onSubscribe:$})=>{this.tryHydrateFromHost();let H=M?this.subscribe(F):void 0;if(H)$?.(H);if(typeof this.value>"u")return;if(F.select)F.callback(F.select(this.value),H);else F.callback(this.value,H)};onSubscriptionRequest=(F)=>{let{context:M,callback:$,subscribe:H,select:W,target:j,onSubscribe:P}=F;if(M!==this.context)return;if(F.markHandled(),F.stopPropagation(),j instanceof EventTarget)j.dispatchEvent(new n(this.context));if(W){this.handleSubscriptionRequest({select:W,callback:$},{subscribe:H,onSubscribe:P});return}this.handleSubscriptionRequest({callback:$},{subscribe:H,onSubscribe:P})};onContextRequest=(F)=>{let{context:M,callback:$}=F;if(M!==this.context)return;F.markHandled(),F.stopPropagation(),$(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}var pM=(F)=>F;var X0=Symbol.for("@ecopages/radiant.ssr-context-provider-resolver");function Q0(){return globalThis}function iM(F){Q0()[X0]=F}function qF(F){return Q0()[X0]?.(F)}function _F(F,M,$,H={}){let W=qF(M);if(!W)return!1;if($(W),F.connectedContextCallback(M),H.emitMounted)F.dispatchEvent(new CustomEvent("context-mounted",{detail:W}));return!0}function B0(F,M,$,H={}){let W=new JF(M,(j)=>{if($(j),F.connectedContextCallback(M),H.emitMounted)F.dispatchEvent(new CustomEvent("context-mounted",{detail:j}))});return F.dispatchEvent(W),W.handled}function f(F,M){let $=qF(F);if(!$)return!1;let H=$.getContext();if(M.select)return M.callback(M.select(H)),!0;return M.callback(H),!0}function zF(F,M,$,H){let W=new RF(M,$.callback,$.select,H.subscribe,H.onSubscribe);return F.dispatchEvent(W),W.handled}function a(F,M,$,H={}){return L0(F,()=>_F(F,M,$,H))}function J(F,M,$,H){return L0(F,()=>{if(H)return f(M,{callback:$,select:H});return f(M,{callback:$})})}function r(F,M,$,H={}){if(_F(F,M,$,H))return!0;return B0(F,M,$,H)}function Y(F,M,$,H={}){if(H.select){let j={callback:$,select:H.select};if(f(M,j))return!0;return zF(F,M,j,{subscribe:H.subscribe,onSubscribe:H.onSubscribe})}let W={callback:$};if(f(M,W))return!0;return zF(F,M,W,{subscribe:H.subscribe,onSubscribe:H.onSubscribe})}function L0(F,M){return v(F,M),M()}function A0(F){return(M,$)=>{let H=(j,P)=>{j[$]=P},W=(j,P={})=>{if(j[$])return!0;return r(j,F,(Z)=>{H(j,Z)},P)};B(M,(j)=>{a(j,F,(P)=>{H(j,P)}),j.registerConnectedCallback(()=>{if(W(j,{emitMounted:!0}))return;queueMicrotask(()=>{W(j,{emitMounted:!0})})})})}}function U0(F){return(M,$)=>{let H=String($.name),W=(P,Z)=>{let G=P;G[H]=Z},j=(P,Z={})=>{if(P[H])return!0;return r(P,F,(X)=>{W(P,X)},Z)};$.addInitializer(function(){if(a(this,F,(P)=>{W(this,P)},{emitMounted:!0}))return;this.registerConnectedCallback(()=>{if(j(this,{emitMounted:!0}))return;queueMicrotask(()=>{j(this,{emitMounted:!0})})})})}}function O2(F){return typeof F==="function"}function A(F,M,$,H){if(typeof H==="object")return F(void 0,H);return M($,H)}function D(F,M,$,H,W){if(typeof H==="object"){if(!O2($))throw TypeError("Standard method decorators require a method target");return F($,H)}if(!W)throw TypeError("Legacy method decorators require a property descriptor");return M($,H,W)}function X$(F){function M($,H){return A(U0(F),A0(F),$,H)}return M}function R(F,M,$){let H=!1,W,j=F;return(P)=>{if(j[N]!==!0&&H&&Object.is(W,P))return;if(H=!0,W=P,M(P),$&&typeof j.requestUpdate==="function")j.requestUpdate()}}function o({context:F,select:M,subscribe:$=!0,requestUpdate:H=!0}){return(W,j,P)=>{let Z=P.value;return B(W,(G)=>{let X,Q=R(G,(L)=>{Z.call(G,L)},H);J(G,F,Q,M),G.registerConnectedCallback(()=>{if(Y(G,F,Q,{onSubscribe:(L)=>{X=L},select:M,subscribe:$}))return;queueMicrotask(()=>{Y(G,F,Q,{onSubscribe:(L)=>{X=L},select:M,subscribe:$})})}),G.registerCleanupCallback(()=>{X?.(),X=void 0})}),P}}function t({context:F,select:M,subscribe:$=!0,requestUpdate:H=!0}){return function(W,j){j.addInitializer(function(){let P,Z=R(this,(X)=>{W.call(this,X)},H);if(J(this,F,Z,M))return;let G=()=>{return Y(this,F,Z,{onSubscribe:(X)=>{P=X},select:M,subscribe:$})};this.registerCleanupCallback(()=>{P?.(),P=void 0}),this.registerConnectedCallback(()=>{if(G())return;queueMicrotask(()=>{G()})})})}}function Y0(F){let{context:M,select:$,subscribe:H=!0}=F;return(W,j)=>{B(W,(P)=>{let Z,G=R(P,(X)=>{P[j]=X},!0);J(P,M,G,$),P.registerConnectedCallback(()=>{if(Y(P,M,G,{onSubscribe:(X)=>{Z=X},select:$,subscribe:H}))return;queueMicrotask(()=>{Y(P,M,G,{onSubscribe:(X)=>{Z=X},select:$,subscribe:H})})}),P.registerCleanupCallback(()=>{Z?.(),Z=void 0})})}}function D0(F){let{context:M,select:$,subscribe:H=!0}=F;return function(W,j){let P=String(j.name);return j.addInitializer(function(){let Z,G=R(this,(Q)=>{let L=this;L[P]=Q},!0);if(J(this,M,G,$))return;let X=()=>{return Y(this,M,G,{onSubscribe:(Q)=>{Z=Q},select:$,subscribe:H})};this.registerCleanupCallback(()=>{Z?.(),Z=void 0}),this.registerConnectedCallback(()=>{if(X())return;queueMicrotask(()=>{X()})})}),function(Z){return Z}}}function S$(F){function M($,H,W){if(typeof H==="object"){if(H.kind==="field"){if($!==void 0)throw TypeError("@contextSelector field decorators require an undefined target");return D0(F)(void 0,H)}if(typeof $!=="function")throw TypeError("@contextSelector standard method decorators require a method target");return t(F)($,H)}if(W){if(typeof $==="function"||$===void 0)throw TypeError("@contextSelector legacy method decorators require a host target");return o(F)($,H,W)}if(typeof $==="function"||$===void 0)throw TypeError("@contextSelector legacy field decorators require a host target");return Y0(F)($,H)}return M}function b$(F){function M($,H,W){return D(t(F),o(F),$,H,W)}return M}function J0({context:F,initialValue:M,hydrate:$,serialize:H}){return(W,j)=>{let P=(Z)=>{if(Z[j])return;let G=new C(Z,{context:F,hydrationKey:j,initialValue:M,hydrate:$,serialize:H});Z[j]=G,Z.registerContextProvider(j,G),Z.connectedContextCallback(F)};B(W,(Z)=>{P(Z),Z.registerConnectedCallback(()=>{P(Z)})})}}function R0({context:F,initialValue:M,hydrate:$,serialize:H}){return(W,j)=>{let P=String(j.name);j.addInitializer(function(){let Z=this,G=new C(this,{context:F,hydrationKey:P,initialValue:M,hydrate:$,serialize:H});Z[P]=G,this.registerContextProvider(P,G),this.connectedContextCallback(F)})}}function i$(F){function M($,H){return A(R0(F),J0(F),$,H)}return M}function kF(F){if(F instanceof Element)return F;if("host"in F)return F.host;return F.element}function C2(F){return F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase()}function f2(F,M){if(M.converter?.fromAttribute){let $=M.converter.fromAttribute(F);if(F===null&&$===void 0&&"defaultValue"in M)return M.defaultValue;return $}if(M.type){if(F===null)return M.defaultValue??O(M.type);if(M.type===Boolean&&F==="")return!0;return I(F,M.type)}if(F===null)return M.defaultValue;return F}function z(F,M,$){return f2(kF(F).getAttribute(M),$)}function S2(F,M,$,H){let W=H.converter?.toAttribute?H.converter.toAttribute($):H.type?d($,H.type):$==null?null:String($);if(W===null){F.removeAttribute(M);return}F.setAttribute(M,W)}function e(F,M,$={}){if($.type&&$.defaultValue!==void 0&&!U($.type,$.defaultValue))throw Error(`defaultValue does not match the expected type for ${$.type.name}`);let H=F,W=$.source??C2(M),j=Symbol(`@ecopages/radiant/attr:${M}:observer`),P=Symbol(`@ecopages/radiant/attr:${M}:last-value`),Z=$.bind??F.shouldAutoBindReactiveMembers?.()??!1;F.defineReactiveBinding(M,Z),F.registerReactiveDependencyReader(M,()=>z(F,W,$)),H[P]=z(F,W,$),Object.defineProperty(F,M,{get(){return F.trackReactiveRead(M),z(this,W,$)},set(Q){let L=kF(this),q=z(this,W,$);S2(L,W,Q,$);let k=z(this,W,$);if(Object.is(q,k))return;this[P]=k,F.notifyUpdate(M,q,k)},enumerable:!0,configurable:!0});let G=()=>{H[j]?.disconnect()},X=()=>{let Q=z(F,W,$),L=H[P];if(!Object.is(L,Q))H[P]=Q,F.notifyUpdate(M,L,Q);if(typeof MutationObserver>"u")return;let q=kF(F);G();let k=new MutationObserver(()=>{let XF=z(F,W,$),wF=H[P];if(Object.is(wF,XF))return;H[P]=XF,F.notifyUpdate(M,wF,XF)});k.observe(q,{attributeFilter:[W],attributes:!0}),H[j]=k};X(),F.registerConnectedCallback(X),F.registerCleanupCallback(G)}function q0(F={}){return(M,$)=>{let H=Symbol(`@ecopages/radiant/attr:${$}:installed`);B(M,(W)=>{W.registerConnectedCallback(()=>{if(W[H])return;let j=W[$],P=F.defaultValue===void 0?j:F.defaultValue;e(W,$,{...F,defaultValue:P}),W[H]=!0})})}}function _0(F={}){return function(M,$){let H=String($.name),W=Symbol(`@ecopages/radiant/attr:${H}:initializer`);return $.addInitializer(function(){let j=this[W],P=F.defaultValue===void 0?j:F.defaultValue;e(this,H,{...F,defaultValue:P})}),function(j){return this[W]=j,j}}}function WH(F={}){function M($,H){return A(_0(F),q0(F),$,H)}return M}function z0(F,M,$){let H=$.value;return{configurable:!0,get(){if(this===F.prototype||Object.prototype.hasOwnProperty.call(this,M))return H;let W=H.bind(this);return Object.defineProperty(this,M,{value:W,configurable:!0,writable:!0}),W}}}function k0(F,M){let $=String(M.name);if(M.private)throw Error(`'bound' cannot decorate private properties like ${$}.`);M.addInitializer(function(){this[$]=this[$].bind(this)})}function BH(F,M,$){return D(k0,z0,F,M,$)}function UH(F){return function(M){return j0(F,M)}}var K0=Symbol.for("@ecopages/radiant.customElementTagName");function FF(F,M){F[K0]=M}function DH(F){return F[K0]}function I0(F,M){return($)=>{if(FF($,F),typeof customElements<"u"&&!customElements.get(F))customElements.define(F,$,M)}}function E0(F,M){return function($,H){H.addInitializer(function(){if(FF(this,F),typeof customElements<"u"&&!customElements.get(F))customElements.define(F,this,M)})}}function IH(F,M){function $(H,W){if(typeof W<"u")return E0(F,M)(H,W);return I0(F,M)(H)}return $}function MF(F,M){let $=null,H=null,W,j=()=>{if($!==null)clearTimeout($),$=null},P=()=>{if(H===null)return W;let G=H;return H=null,j(),W=G(),W},Z=function(...G){H=()=>F.apply(this,G),j(),$=setTimeout(()=>{P()},M)};return Z.cancel=()=>{j(),H=null},Z.flush=()=>{if(H===null)return W;return P()},Z.pending=()=>H!==null,Z}function T0(F){return(M,$,H)=>{let W=H.value,j=new WeakMap;return H.value=function(...Z){let G=j.get(this);if(!G)G=MF((...X)=>{return W.apply(this,X)},F),j.set(this,G);G(...Z)},H}}function w0(F){return(M)=>{let $=new WeakMap;return function(...H){let W=$.get(this);if(!W)W=MF((...j)=>{return M.apply(this,j)},F),$.set(this,W);W(...H)}}}function NH(F){function M($,H,W){return D(w0(F),T0(F),$,H,W)}return M}class KF{host;eventConfig;constructor(F,M){this.host=F,this.eventConfig=M}emit(F){let M=new CustomEvent(this.eventConfig.name,{detail:F,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(M)}}function $F(F,M){let $=new KF(F,M);return F.registerEventEmitter(M.name,$),$}function O0(F){return(M,$)=>{B(M,(H)=>{let W=$F(H,F);H.registerConnectedCallback(()=>{Object.defineProperty(H,$,{get(){return W},enumerable:!0,configurable:!0})})})}}function C0(F){return function(M,$){$.addInitializer(function(){let H=$F(this,F);Object.defineProperty(this,$.name,{get(){return H},enumerable:!0,configurable:!0})})}}function lH(F){function M($,H){return A(C0(F),O0(F),$,H)}return M}var HF=Symbol("radiant.shadowRootListenerHooks"),f0=Symbol("radiant.patchedAttachShadow");function V0(F){if(F instanceof Element)return F;if("host"in F)return F.host;return F.element}function V2(F){return!(F instanceof Element)}function S0(F,M,$,H){let W=(j)=>{if(j.target instanceof Element&&j.target.matches($))H(j)};return F.addEventListener(M.type,W,M.options),()=>{F.removeEventListener(M.type,W,M.options)}}function x2(F,M){let $=V0(F);if(!$[HF])$[HF]=new Set;if($[HF].add(M),$[f0])return;let H=$.attachShadow;$.attachShadow=function(j){let P=H.call(this,j);for(let Z of $[HF]??[])Z();return P},$[f0]=!0}function WF(F,M,$){if(V2(F)&&"scope"in M&&M.scope&&M.scope!=="light")throw Error("RadiantController event listeners only support light DOM scope.");let H=V0(F),W=$.bind(F),j=null,P=null,Z=null,G=null,X=!1,Q=()=>{j?.(),P?.(),Z?.(),G?.(),j=null,P=null,Z=null,G=null},L=()=>{if(X)return;if("window"in M&&!j)window.addEventListener(M.type,W,M.options),j=()=>{window.removeEventListener(M.type,W,M.options)};if("document"in M&&!P)document.addEventListener(M.type,W,M.options),P=()=>{document.removeEventListener(M.type,W,M.options)};if("selector"in M||"ref"in M){let q="selector"in M?M.selector:`[data-ref='${CSS.escape(M.ref)}']`;if(M.scope!=="shadow"&&!Z)Z=S0(H,M,q,W);if(M.scope!=="light"&&H.shadowRoot&&!G)G=S0(H.shadowRoot,M,q,W)}};if("selector"in M||"ref"in M){if(M.scope!=="light")x2(F,()=>{if(F.isConnected)L()})}if(F.registerConnectedCallback(L),F.registerCleanupCallback(Q),F.isConnected)L();return()=>{X=!0,Q()}}function x0(F){return(M,$,H)=>{let W=H.value;return B(M,(j)=>{WF(j,F,W.bind(j))}),H}}function N0(F){return function(M,$){$.addInitializer(function(){WF(this,F,M.bind(this))})}}function W9(F){function M($,H,W){return D(N0(F),x0(F),$,H,W)}return M}function v0(F){return(M,$)=>{let H=Symbol(`@ecopages/radiant/on-updated:${$}:cleanup`);B(M,(W)=>{W.registerConnectedCallback(()=>{let j=W[$].bind(W),P=[];if(Array.isArray(F))for(let Z of F)P.push(W.registerUpdateCallback(Z,j));else if(typeof F==="string")P.push(W.registerUpdateCallback(F,j));W[H]=()=>{for(let Z of P)Z()}}),W.registerCleanupCallback(()=>{let j=W[H];if(typeof j==="function")j(),delete W[H]})})}}function b0(F){return function(M,$){$.addInitializer(function(){let H=M.bind(this);if(Object.defineProperty(this,$.name,{value:H,configurable:!0,writable:!0}),Array.isArray(F))for(let W of F)this.registerUpdateCallback(W,H);else if(typeof F==="string")this.registerUpdateCallback(F,H)})}}function L9(F){function M($,H,W){return D(b0(F),v0(F),$,H,W)}return M}var IF=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function jF(F,M,$){let H=F.constructor,W=H[IF]??[];if(W.some((j)=>j.name===M))return;W.push({name:M,options:$}),H[IF]=W}function U9(F){return(F.constructor[IF]??[]).slice()}function h0({type:F,attribute:M,reflect:$,defaultValue:H,bind:W}){if(H!==void 0&&!U(F,H))throw Error(`defaultValue does not match the expected type for ${F.name}`);return(j,P)=>{let Z=M??P;jF(j,P,{type:F,reflect:$,attribute:Z,defaultValue:H,bind:W});let G=Symbol.for(`@ecopages/radiant.ssr-prop:${P}`);Object.defineProperty(j,P,{get(){return this[G]??H},set(X){this[G]=X},configurable:!0,enumerable:!0}),B(j,(X)=>{X.registerConnectedCallback(()=>{let Q=X[P],L=H===void 0?Q:H;X.createReactiveProp(P,{type:F,reflect:$,attribute:Z,defaultValue:L,bind:W})})})}}function g0({type:F,attribute:M,reflect:$,defaultValue:H,bind:W}){if(H!==void 0&&!U(F,H))throw Error(`defaultValue does not match the expected type for ${F.name}`);return function(j,P){let Z=String(P.name),G=M??Z,X=Symbol(`@ecopages/radiant/reactive-prop:${Z}:initializer`);return P.addInitializer(function(){let Q=this[X],L=H===void 0?Q:H;jF(this,Z,{type:F,reflect:$,attribute:G,defaultValue:H,bind:W}),this.createReactiveProp(Z,{type:F,reflect:$,attribute:G,defaultValue:L,bind:W})}),function(Q){return this[X]=Q,Q}}}function T9(F){function M($,H){return A(g0(F),h0(F),$,H)}return M}function N2(F){return!(F instanceof Element)}function v2(F){return"shadowRoot"in F?F.shadowRoot??null:null}function b2(F){return F instanceof Element?F:F.host}function h2(F,M="light"){let $=v2(F);if(M==="shadow")return $?[$]:[];if(M==="both")return $?[F,$]:[F];return[F]}function PF(F,M){if(N2(F)&&M.scope&&M.scope!=="light")throw Error("RadiantController queries only support light DOM scope.");let $=b2(F),H="selector"in M?M.selector:`[data-ref="${M.ref}"]`,W=null,j=()=>{let P=h2($,M.scope);if(M.all)return P.flatMap((Z)=>Array.from(Z.querySelectorAll(H)));for(let Z of P){let G=Z.querySelector(H);if(G)return G}return null};return{get value(){if(M.cache){if(W===null||M.all&&Array.isArray(W)&&!W.length)W=j();return W}return j()}}}function y0({cache:F=!0,...M}){return($,H)=>{B($,(W)=>{W.registerConnectedCallback(()=>{let j=PF(W,{cache:F,...M});Object.defineProperty(W,H,{get(){return j.value},enumerable:!0,configurable:!0})})})}}function m0(F){return function(M,$){let H=String($.name);$.addInitializer(function(){let W=PF(this,F);Object.defineProperty(this,H,{get(){return W.value},enumerable:!0,configurable:!0})})}}function h9(F){function M($,H){return A(m0(F),y0(F),$,H)}return M}function S(F,M={}){let $=null,H,W=()=>{if(M.all)return typeof F.getSlotElements==="function"?F.getSlotElements(M.name):[];return typeof F.getSlotElement==="function"?F.getSlotElement(M.name):null};return{get value(){if(M.cache===!1)return W();let j=F.slotProjectionVersion??0;if(H!==j)$=W(),H=j;return $}}}function u0(F={}){return(M,$)=>{let H=(P)=>{return typeof Object.getOwnPropertyDescriptor(P,$)?.get==="function"},W=(P)=>{if(H(P))return;let Z=S(P,F);Object.defineProperty(P,$,{get(){return Z.value},enumerable:!0,configurable:!0})},j=new WeakMap;Object.defineProperty(M,$,{get(){let P=j.get(this);if(!P)P=S(this,F),j.set(this,P);return P.value},enumerable:!0,configurable:!0}),B(M,(P)=>{v(P,()=>{W(P)}),P.registerConnectedCallback(()=>{W(P)})})}}function d0(F={}){return function(M,$){let H=String($.name);$.addInitializer(function(){let W=S(this,F);Object.defineProperty(this,H,{get(){return W.value},enumerable:!0,configurable:!0})})}}function a9(F={}){function M($,H){return A(d0(F),u0(F),$,H)}return M}function c0(F){return b({type:"signal",...F})}function p0(F){return h(F)}import{createMarkupNodeLike as g2}from"@ecopages/jsx";import{state as y2}from"@ecopages/signals";function ZF(F){return typeof F==="object"&&F!==null&&typeof F.get==="function"&&typeof F.set==="function"&&typeof F.subscribe==="function"&&typeof F.update==="function"}class V{host;hydrate;hydrationKey;property;source;currentValue;hasAppliedHostHydration=!1;sourceUnsubscribe;constructor(F){this.host=F.host,this.hydrate=F.hydrate,this.hydrationKey=F.hydrationKey,this.property=F.property,this.source=F.source??y2(this.resolveInitialValue(F.initialValue)),this.currentValue=this.source.get()}get(){return this.source.get()}set(F){this.source.set(F)}subscribe(F){return this.source.subscribe(F)}update(F){this.set(F(this.get()))}connectToSource(){if(this.sourceUnsubscribe)return;let F=this.source.get();if(!Object.is(this.currentValue,F)){let M=this.currentValue;this.currentValue=F,this.host.notifyUpdate(this.property,M,F)}this.sourceUnsubscribe=this.source.subscribe((M)=>{this.handleSourceChange(M)})}disconnectFromSource(){this.sourceUnsubscribe?.(),this.sourceUnsubscribe=void 0}hydrateFromHost(){if(!this.hydrate||this.hasAppliedHostHydration)return;this.hasAppliedHostHydration=!0;let F=this.source.get(),M=this.resolveInitialValue(F);if(!Object.is(F,M))this.source.set(M),this.currentValue=this.source.get(),this.host.notifyUpdate(this.property,F,this.currentValue)}renderHydrationScript(){let F=this.renderHydrationScriptTag();if(!F)return;return g2(F)}renderHydrationScriptTag(){let F=this.serializeHydrationValue();if(!F)return;return c0({hydrationKey:this.hydrationKey,serializedValue:F})}findHydrationScriptElement(){if(!(this.host instanceof Element))return null;return y(this.host,"signal",this.hydrationKey)}isObject(F){return typeof F==="object"&&!Array.isArray(F)&&F!==null}resolveInitialValue(F){if(!this.hydrate)return F;let M=this.findHydrationScriptElement();if(!M)return F;let $=g(M,F);if(this.hydrate===Object&&this.isObject($)&&this.isObject(F))return{...F,...$};return $}serializeHydrationValue(){if(!this.hydrate)return;let F=JSON.stringify(this.get());if(typeof F!=="string")return;return p0(F)}handleSourceChange(F){let M=this.currentValue;if(this.currentValue=F,!Object.is(M,F))this.host.notifyUpdate(this.property,M,F)}}function GF(F){return new V(F)}function EF(F={}){return(M,$)=>{let H=(W)=>{let j=W[$];if(j instanceof V)return j;let P=typeof F.source==="function"?F.source(W):F.source??(ZF(j)?j:void 0),Z=F.bind??W.shouldAutoBindReactiveMembers?.()??!1,G=P!==void 0?F.initial:j===void 0?F.initial:j;W.defineReactiveBinding($,Z);let X=GF({host:W,hydrate:F.hydrate,hydrationKey:$,initialValue:G,property:$,source:P});if(W.registerConnectedCallback(()=>{X.hydrateFromHost(),X.connectToSource()}),W.registerCleanupCallback(()=>{X.disconnectFromSource()}),F.hydrate)W.registerHydrationBinding($,X);return W[$]=X,X};B(M,(W)=>{let j=H(W);W.registerConnectedCallback(()=>{if(!(W[$]instanceof V))W[$]=j})})}}function TF(F={}){return function(M,$){let H=String($.name);return function(W){let j=typeof F.source==="function"?F.source(this):F.source??(ZF(W)?W:void 0),P=j!==void 0?F.initial:W===void 0?F.initial:W,Z=F.bind??this.shouldAutoBindReactiveMembers?.()??!1;this.defineReactiveBinding(H,Z);let G=GF({host:this,hydrate:F.hydrate,hydrationKey:H,initialValue:P,property:H,source:j});if(this.registerConnectedCallback(()=>{G.hydrateFromHost(),G.connectToSource()}),this.registerCleanupCallback(()=>{G.disconnectFromSource()}),F.hydrate)this.registerHydrationBinding(H,G);return G}}}function B3(F,M){if(typeof M<"u"){if(typeof M==="object"){if(F!==void 0)throw TypeError("@signal standard decorators require an undefined target");return TF()(void 0,M)}if(F===void 0)throw TypeError("@signal legacy decorators require a host target");return EF()(F,M)}let $=F??{};function H(W,j){if(typeof j==="object"){if(W!==void 0)throw TypeError("@signal standard decorators require an undefined target");return TF($)(void 0,j)}if(W===void 0)throw TypeError("@signal legacy decorators require a host target");return EF($)(W,j)}return H}function s0(F,M){B(F,($)=>{$.registerConnectedCallback(()=>{$.createReactiveField(M,$[M],{bind:$.shouldAutoBindReactiveMembers?.()??!1})})})}function i0(F,M){let $=Symbol(`__${String(M.name)}__value`),H=String(M.name);return M.addInitializer(function(){this.defineReactiveBinding(H,this.shouldAutoBindReactiveMembers?.()??!1),this.registerReactiveDependencyReader(H,()=>this[$]),Object.defineProperty(this,M.name,{get(){return this.trackReactiveRead(H),this[$]},set(W){let j=this[$];if(j!==W)this[$]=W,this.notifyUpdate(H,j,W)},enumerable:!0,configurable:!0})}),function(W){return this[$]=W,W}}function q3(F,M){return A(i0,s0,F,M)}export{SM as stopControllers,q3 as state,fM as startControllers,B3 as signal,W0 as setControllerRegistrationStrategy,T2 as replaceController,j0 as registerControllerWithConfiguredStrategy,E2 as registerController,a9 as querySlot,h9 as query,i$ as provideContext,T9 as prop,L9 as onUpdated,W9 as onEvent,b$ as onContextUpdate,wM as hasRegisteredController,lH as event,OM as enableControllerReplacementForHmr,CM as disableControllerReplacementForHmr,NH as debounce,IH as customElement,pM as createContext,UH as controller,S$ as contextSelector,X$ as consumeContext,BH as bound,kM as bindReactiveValue,WH as attr,p as RadiantElement,eF as RadiantController,H0 as ControllerRegistryRuntime,RF as ContextSubscriptionRequestEvent,JF as ContextRequestEvent,C as ContextProvider,n as ContextOnMountEvent,DF as ContextEventsTypes,i as CONTROLLER_ATTRIBUTE};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=852FE9CF05920E6B64756E2164756E21
|