@ecopages/radiant 0.3.0-alpha.4 → 0.3.0-alpha.6
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 +71 -59
- 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/context/index.d.ts +8 -0
- package/dist/context/index.js +3 -0
- package/dist/context/index.js.map +35 -0
- 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 +4 -14
- package/dist/index.js +2 -2
- package/dist/index.js.map +60 -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 +26 -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,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/tools/escape-script-json.ts", "../src/core/hydration-codec.ts", "../src/signals/hydration-script.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * `<script>` tag.\n */\nexport function escapeScriptJson(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n",
|
|
6
|
+
"import { escapeScriptJson } from '../tools/escape-script-json';\n\n/** Attribute marker used to identify hydration payloads inside a host. */\nexport const HYDRATION_ATTRIBUTE = 'data-hydration';\n/** Discriminator that scopes a hydration payload to a specific feature. */\nexport const HYDRATION_TYPE_ATTRIBUTE = 'data-hydration-type';\n/** Optional key that scopes a hydration payload to a specific decorated field. */\nexport const HYDRATION_KEY_ATTRIBUTE = 'data-hydration-key';\n\nexport type HydrationPayloadType = 'signal' | 'context';\n\ntype HydrationScriptHost = {\n\tchildren?: ArrayLike<Element> | undefined;\n\tchildNodes?: ArrayLike<{ nodeType: number }> | undefined;\n};\n\n/** Creates a `<script type=\"application/json\">` tag for a hydration payload. */\nexport function createHydrationScriptTag(options: {\n\ttype: HydrationPayloadType;\n\thydrationKey?: string;\n\tserializedValue: string;\n}): string {\n\tconst keyAttribute = options.hydrationKey\n\t\t? ` ${HYDRATION_KEY_ATTRIBUTE}=\"${escapeHtmlAttribute(options.hydrationKey)}\"`\n\t\t: '';\n\n\treturn `<script type=\"application/json\" ${HYDRATION_ATTRIBUTE} ${HYDRATION_TYPE_ATTRIBUTE}=\"${options.type}\"${keyAttribute}>${options.serializedValue}</script>`;\n}\n\n/** Escapes serialized JSON so it remains safe inside an HTML script tag. */\nexport function escapeHydrationJson(value: string): string {\n\treturn escapeScriptJson(value);\n}\n\n/** Parses JSON from a hydration script element, returning the fallback on failure. */\nexport function parseHydrationPayload<T>(element: Element, fallback: T): T {\n\tconst textContent = element.textContent;\n\n\tif (!textContent) {\n\t\treturn fallback;\n\t}\n\n\ttry {\n\t\treturn JSON.parse(textContent) as T;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn(\n\t\t\t\t`[@ecopages/radiant] Failed to parse hydration payload from <script ${HYDRATION_ATTRIBUTE}>:`,\n\t\t\t\ttextContent.slice(0, 120),\n\t\t\t);\n\t\t}\n\t\treturn fallback;\n\t}\n}\n\n/**\n * Finds a hydration script element inside a host by type and optional key.\n *\n * When a key is provided, looks for an exact `data-hydration-key` match.\n * Otherwise, returns the first unkeyed script matching the type.\n */\nexport function findHydrationScript(\n\thost: HydrationScriptHost,\n\ttype: HydrationPayloadType,\n\thydrationKey?: string,\n): Element | null {\n\tconst children = host.children;\n\n\tif (!children || children.length === 0) {\n\t\tconst childNodes = (host as Partial<{ childNodes: ArrayLike<{ nodeType: number }> }>).childNodes;\n\n\t\tif (!childNodes || childNodes.length === 0) {\n\t\t\treturn null;\n\t\t}\n\n\t\tfor (let i = 0; i < childNodes.length; i += 1) {\n\t\t\tconst node = childNodes[i]!;\n\n\t\t\tif (node.nodeType !== 1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst element = node as unknown as Element;\n\n\t\t\tif (matchesHydrationScript(element, type, hydrationKey)) {\n\t\t\t\treturn element;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tfor (let i = 0; i < children.length; i += 1) {\n\t\tif (matchesHydrationScript(children[i]!, type, hydrationKey)) {\n\t\t\treturn children[i]!;\n\t\t}\n\t}\n\n\treturn null;\n}\n\nfunction matchesHydrationScript(element: Element, type: HydrationPayloadType, hydrationKey?: string): boolean {\n\tif (\n\t\telement.tagName !== 'SCRIPT' ||\n\t\t!element.hasAttribute(HYDRATION_ATTRIBUTE) ||\n\t\telement.getAttribute(HYDRATION_TYPE_ATTRIBUTE) !== type\n\t) {\n\t\treturn false;\n\t}\n\n\tif (hydrationKey !== undefined) {\n\t\treturn element.getAttribute(HYDRATION_KEY_ATTRIBUTE) === hydrationKey;\n\t}\n\n\treturn !element.hasAttribute(HYDRATION_KEY_ATTRIBUTE);\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n\treturn value.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<').replace(/>/g, '>');\n}\n",
|
|
7
|
+
"import { createHydrationScriptTag, escapeHydrationJson } from '../core/hydration-codec';\n\n/** Creates the raw `<script type=\"application/json\">` tag used to hydrate a signal field. */\nexport function createSignalHydrationScriptTag(options: { hydrationKey?: string; serializedValue: string }): string {\n\treturn createHydrationScriptTag({ type: 'signal', ...options });\n}\n\n/** Escapes serialized JSON so it remains safe inside an HTML script tag. */\nexport function escapeSignalHydrationJson(value: string): string {\n\treturn escapeHydrationJson(value);\n}\n"
|
|
5
8
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
9
|
+
"mappings": "2PAIO,SAAS,CAAgB,CAAC,EAAuB,CACvD,OAAO,EACL,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,UAAW,SAAS,EAC5B,QAAQ,UAAW,SAAS,ECPxB,IAAM,EAAsB,iBAEtB,EAA2B,sBAE3B,EAA0B,qBAUhC,SAAS,CAAwB,CAAC,EAI9B,CACV,IAAM,EAAe,EAAQ,aAC1B,IAAI,MAA4B,EAAoB,EAAQ,YAAY,KACxE,GAEH,MAAO,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EAAE,QAAQ,KAAM,MAAM,ECnHhG,SAAS,CAA8B,CAAC,EAAqE,CACnH,OAAO,EAAyB,CAAE,KAAM,YAAa,CAAQ,CAAC,EAIxD,SAAS,CAAyB,CAAC,EAAuB,CAChE,OAAO,EAAoB,CAAK",
|
|
10
|
+
"debugId": "2E79D54D041C6E9564756E2164756E21",
|
|
8
11
|
"names": []
|
|
9
12
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var s=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,a)=>(typeof require<"u"?require:r)[a]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function i(e){return e.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}export{i as escapeScriptJson};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=91D7070AAF1AF86764756E2164756E21
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/tools/escape-script-json.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * `<script>` tag.\n */\nexport function escapeScriptJson(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PAIO,SAAS,CAAgB,CAAC,EAAuB,CACvD,OAAO,EACL,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,UAAW,SAAS,EAC5B,QAAQ,UAAW,SAAS",
|
|
8
|
+
"debugId": "91D7070AAF1AF86764756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var z=((k)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(k,{get:(q,x)=>(typeof require<"u"?require:q)[x]}):k)(function(k){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+k+'" is not supported')});class y{host;eventConfig;constructor(k,q){this.host=k,this.eventConfig=q}emit(k){let q=new CustomEvent(this.eventConfig.name,{detail:k,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(q)}}export{y as EventEmitter};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=1E4E1D10DCC1E44064756E2164756E21
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/tools/event-emitter.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"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"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PAcO,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",
|
|
8
|
+
"debugId": "1E4E1D10DCC1E44064756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var a=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function s(e){return e.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}class n{host;eventConfig;constructor(e,r){this.host=e,this.eventConfig=r}emit(e){let r=new CustomEvent(this.eventConfig.name,{detail:e,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(r)}}import{render as i}from"@ecopages/jsx";function g(e,r){i(e,r)}function l(e){return JSON.stringify(e)}export{l as stringifyTyped,g as renderJsxTemplate,s as escapeScriptJson,n as EventEmitter};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=347E598DA09323F864756E2164756E21
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/tools/escape-script-json.ts", "../src/tools/event-emitter.ts", "../src/tools/render-jsx-template.ts", "../src/tools/stringify-typed.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"/**\n * Escapes serialized JSON so it remains safe when embedded inside an HTML\n * `<script>` tag.\n */\nexport function escapeScriptJson(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\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 { render, type TemplateResultLike } from '@ecopages/jsx';\n\n/**\n * Renders a JSX template result into a target element by replacing its children.\n */\nexport function renderJsxTemplate(template: TemplateResultLike, target: HTMLElement): void {\n\trender(template, target);\n}\n",
|
|
8
|
+
"/**\n * Converts the given value to a JSON string representation or maintains the type based on the generic parameter.\n *\n * @param value - The value to be converted.\n * @returns The JSON string representation of the value or the value itself.\n * @template T - The type of the value.\n * @template R - The return type, defaults to T.\n *\n * @example\n * // For maintaining the type in JSX attributes\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n *\n * // For lower-level JSON string generation outside JSX text children\n * const hydrationPayload = stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' });\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n\treturn JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
|
|
5
9
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
10
|
+
"mappings": "2PAIO,SAAS,CAAgB,CAAC,EAAuB,CACvD,OAAO,EACL,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,KAAM,SAAS,EACvB,QAAQ,UAAW,SAAS,EAC5B,QAAQ,UAAW,SAAS,ECIxB,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,CC3CA,iBAAS,sBAKF,SAAS,CAAiB,CAAC,EAA8B,EAA2B,CAC1F,EAAO,EAAU,CAAM,ECSjB,SAAS,CAAwB,CAAC,EAAyC,CACjF,OAAO,KAAK,UAAU,CAAK",
|
|
11
|
+
"debugId": "347E598DA09323F864756E2164756E21",
|
|
8
12
|
"names": []
|
|
9
13
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var w=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(k,q)=>(typeof require<"u"?require:k)[q]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});import{render as v}from"@ecopages/jsx";function B(f,k){v(f,k)}export{B as renderJsxTemplate};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=6730AC26B382885064756E2164756E21
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/tools/render-jsx-template.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"import { render, type TemplateResultLike } from '@ecopages/jsx';\n\n/**\n * Renders a JSX template result into a target element by replacing its children.\n */\nexport function renderJsxTemplate(template: TemplateResultLike, target: HTMLElement): void {\n\trender(template, target);\n}\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PAAA,iBAAS,sBAKF,SAAS,CAAiB,CAAC,EAA8B,EAA2B,CAC1F,EAAO,EAAU,CAAM",
|
|
8
|
+
"debugId": "6730AC26B382885064756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var r=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function i(e){return JSON.stringify(e)}export{i as stringifyTyped};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=814F2BDEF827078064756E2164756E21
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/tools/stringify-typed.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"/**\n * Converts the given value to a JSON string representation or maintains the type based on the generic parameter.\n *\n * @param value - The value to be converted.\n * @returns The JSON string representation of the value or the value itself.\n * @template T - The type of the value.\n * @template R - The return type, defaults to T.\n *\n * @example\n * // For maintaining the type in JSX attributes\n * <my-app my-complex-attribute={stringifyTyped<MyType>(myData)}> // myData is of type MyType\n *\n * // For lower-level JSON string generation outside JSX text children\n * const hydrationPayload = stringifyTyped<Partial<MyContext>, string>({ value: 'Hello World' });\n */\nexport function stringifyTyped<T, R = T>(value: T): R extends string ? string : T {\n\treturn JSON.stringify(value) as unknown as R extends string ? string : T;\n}\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PAeO,SAAS,CAAwB,CAAC,EAAyC,CACjF,OAAO,KAAK,UAAU,CAAK",
|
|
8
|
+
"debugId": "814F2BDEF827078064756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
package/dist/types.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var o=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,e)=>(typeof require<"u"?require:r)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var n={isStandard:{ClassDecorator:function(t){return typeof t[1]<"u"},MethodDecorator:function(t){return typeof t[1]==="object"},FieldDecorator:function(t){return typeof t[1]==="object"}}};export{n as guards};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=13A0204E2BB78E6764756E2164756E21
|
package/dist/types.js.map
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { RadiantElement } from './core/radiant-element';\n\nexport type Constructor<T = unknown> = { new (...args: any[]): NonNullable<T> };\n\nexport type ConstructorParams<T extends Constructor> = ConstructorParameters<T>;\n\nexport type Context = {\n\tkind: string;\n\tname: string | symbol;\n\taccess: {\n\t\tget?(): unknown;\n\t\tset?(value: unknown): void;\n\t\thas?(value: unknown): boolean;\n\t};\n\tprivate?: boolean;\n\tstatic?: boolean;\n\taddInitializer?(initializer: () => void): void;\n};\n\nexport type ClassDecorator = <T extends Constructor>(target: T, context: Context) => T | void;\n\nexport type Method = (...args: any[]) => any;\n\nexport type LegacyClassDecoratorArgs = {\n\tprotoOrTarget: CustomElementConstructor;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardClassDecoratorArgs = {\n\tprotoOrTarget: CustomElementConstructor;\n\tnameOrContext: ClassDecoratorContext;\n};\n\nexport type StandardOrLegacyClassDecoratorArgs = LegacyClassDecoratorArgs | StandardClassDecoratorArgs;\n\nexport type LegacyMethodDecoratorArgs = {\n\tprotoOrTarget: RadiantElement;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardMethodDecoratorArgs = {\n\tprotoOrTarget: Method;\n\tnameOrContext: ClassMethodDecoratorContext;\n\tdescriptor: undefined;\n};\n\nexport type StandardOrLegacyMethodDecoratorArgs = LegacyMethodDecoratorArgs | StandardMethodDecoratorArgs;\n\nexport type LegacyFieldDecoratorArgs = {\n\tprotoOrTarget: RadiantElement;\n\tnameOrContext: string;\n\tdescriptor: PropertyDescriptor;\n};\n\nexport type StandardFieldDecoratorArgs<T = unknown, V = unknown> = {\n\tprotoOrTarget: undefined;\n\tnameOrContext: ClassFieldDecoratorContext<T, V>;\n};\n\nexport type StandardOrLegacyFieldDecoratorArgs = LegacyFieldDecoratorArgs | StandardFieldDecoratorArgs;\n\nexport type CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport const guards = {\n\tisStandard: {\n\t\tClassDecorator: function (\n\t\t\targs: any,\n\t\t): args is [CustomElementConstructor, ClassDecoratorContext<CustomElementConstructor>] {\n\t\t\treturn typeof args[1] !== 'undefined';\n\t\t},\n\t\tMethodDecorator: function (args: any): args is [Method, ClassMethodDecoratorContext] {\n\t\t\treturn typeof args[1] === 'object';\n\t\t},\n\t\tFieldDecorator: function (args: any): args is [undefined, ClassFieldDecoratorContext] {\n\t\t\treturn typeof args[1] === 'object';\n\t\t},\n\t},\n};\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PAiEO,IAAM,EAAS,CACrB,WAAY,CACX,eAAgB,QAAS,CACxB,EACsF,CACtF,OAAO,OAAO,EAAK,GAAO,KAE3B,gBAAiB,QAAS,CAAC,EAA0D,CACpF,OAAO,OAAO,EAAK,KAAO,UAE3B,eAAgB,QAAS,CAAC,EAA4D,CACrF,OAAO,OAAO,EAAK,KAAO,SAE5B,CACD",
|
|
8
|
+
"debugId": "13A0204E2BB78E6764756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var B=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(x,z)=>(typeof require<"u"?require:x)[z]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});function P(q){switch(q){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function R(q){switch(typeof q){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(q))return"array";if(Object.prototype.toString.call(q)==="[object Object]")return"object"}function U(q){switch(q){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function W(q){try{return JSON.parse(q)}catch{throw TypeError("Invalid JSON string")}}var X={array(q){let x=W(q);if(!Array.isArray(x))throw TypeError(`Expected an array but got a value of type "${typeof x}"`);return x},boolean(q){return!(q==="0"||String(q).toLowerCase()==="false")},number(q){return Number(q.replace(/_/g,""))},object(q){let x=JSON.parse(q);if(x===null||typeof x!=="object"||Array.isArray(x))throw TypeError(`expected value of type "object" but instead got value "${q}" of type "${R(x)}"`);return x},string(q){return q}},I={default:Q,array:L,object:L};function L(q){return JSON.stringify(q)}function Q(q){return`${q}`}function M(q,x){let z=P(x);if(!z)throw TypeError(`[radiant-element] Unknown type "${x}"`);return X[z](q)}function F(q,x){let z=P(x);if(!z)throw TypeError(`[radiant-element] Unknown type "${x}"`);return(I[z]??I.default??Q)(q)}function Y(q){return typeof q==="boolean"}function Z(q){return typeof q==="number"}function _(q){return typeof q==="string"}function $(q){return Array.isArray(q)}function k(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}function m(q,x){switch(q){case Boolean:return Y(x);case Number:return Z(x);case String:return _(x);case Array:return $(x);case Object:return k(x);default:return!1}}var h=(q,x,z,E)=>{if(x===Boolean){let G=q.getAttribute(z);if(G===null)return E;return G===""?!0:M(G,x)}let H=q.getAttribute(z);return H!==null?M(H,x):E??U(x)};export{F as writeAttributeValue,M as readAttributeValue,R as parseAttributeTypeDefault,P as parseAttributeTypeConstant,m as isValueOfType,h as getInitialValue,U as defaultValueForType};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=A6359EE45E00B20A64756E2164756E21
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/utils/attribute-utils.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"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B,EAAoB,CAAI",
|
|
8
|
+
"debugId": "A6359EE45E00B20A64756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
package/dist/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
var m=((x)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(x,{get:(q,z)=>(typeof require<"u"?require:q)[z]}):x)(function(x){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+x+'" is not supported')});function P(x){switch(x){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function R(x){switch(typeof x){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(x))return"array";if(Object.prototype.toString.call(x)==="[object Object]")return"object"}function U(x){switch(x){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function W(x){try{return JSON.parse(x)}catch{throw TypeError("Invalid JSON string")}}var X={array(x){let q=W(x);if(!Array.isArray(q))throw TypeError(`Expected an array but got a value of type "${typeof q}"`);return q},boolean(x){return!(x==="0"||String(x).toLowerCase()==="false")},number(x){return Number(x.replace(/_/g,""))},object(x){let q=JSON.parse(x);if(q===null||typeof q!=="object"||Array.isArray(q))throw TypeError(`expected value of type "object" but instead got value "${x}" of type "${R(q)}"`);return q},string(x){return x}},I={default:Q,array:L,object:L};function L(x){return JSON.stringify(x)}function Q(x){return`${x}`}function M(x,q){let z=P(q);if(!z)throw TypeError(`[radiant-element] Unknown type "${q}"`);return X[z](x)}function D(x,q){let z=P(q);if(!z)throw TypeError(`[radiant-element] Unknown type "${q}"`);return(I[z]??I.default??Q)(x)}function Y(x){return typeof x==="boolean"}function Z(x){return typeof x==="number"}function _(x){return typeof x==="string"}function $(x){return Array.isArray(x)}function k(x){return typeof x==="object"&&!Array.isArray(x)&&x!==null}function F(x,q){switch(x){case Boolean:return Y(q);case Number:return Z(q);case String:return _(q);case Array:return $(q);case Object:return k(q);default:return!1}}var h=(x,q,z,E)=>{if(q===Boolean){let G=x.getAttribute(z);if(G===null)return E;return G===""?!0:M(G,q)}let H=x.getAttribute(z);return H!==null?M(H,q):E??U(q)};export{D as writeAttributeValue,M as readAttributeValue,R as parseAttributeTypeDefault,P as parseAttributeTypeConstant,F as isValueOfType,h as getInitialValue,U as defaultValueForType};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=4AD7E8FD49F8E7F964756E2164756E21
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/utils/attribute-utils.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"import type { RadiantElement } from '../core/radiant-element';\n\nexport type AttributeTypeConstant = typeof Array | typeof Boolean | typeof Number | typeof Object | typeof String;\n\nexport type AttributeTypeDefault = Array<unknown> | boolean | number | Record<string, unknown> | string;\n\n/**\n * Parses the given attribute type constant and returns its corresponding string representation.\n *\n * @param constant - The attribute type constant to parse.\n * @returns The string representation of the attribute type constant.\n */\nexport function parseAttributeTypeConstant(constant?: AttributeTypeConstant) {\n\tswitch (constant) {\n\t\tcase Array:\n\t\t\treturn 'array';\n\t\tcase Boolean:\n\t\t\treturn 'boolean';\n\t\tcase Number:\n\t\t\treturn 'number';\n\t\tcase Object:\n\t\t\treturn 'object';\n\t\tcase String:\n\t\t\treturn 'string';\n\t}\n}\n\n/**\n * Parses the attribute type default value and returns its type as a string.\n *\n * @param defaultValue - The default value of the attribute type.\n * @returns The type of the default value as a string.\n */\nexport function parseAttributeTypeDefault(defaultValue?: AttributeTypeDefault) {\n\tswitch (typeof defaultValue) {\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t}\n\n\tif (Array.isArray(defaultValue)) return 'array';\n\tif (Object.prototype.toString.call(defaultValue) === '[object Object]') return 'object';\n}\n\n/**\n * Returns the default value for a given attribute type.\n *\n * @param type - The attribute type constant.\n * @returns The default value for the specified attribute type.\n */\nexport function defaultValueForType(type: AttributeTypeConstant): unknown {\n\tswitch (type) {\n\t\tcase Number:\n\t\t\treturn 0;\n\t\tcase String:\n\t\t\treturn '';\n\t\tcase Boolean:\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn null;\n\t}\n}\n\ntype Reader = (value: string) => number | string | boolean | object | unknown[];\n\n/**\n * Utility function to parse a JSON string safely\n */\nfunction parseJSON<T>(value: string): T {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\tthrow new TypeError('Invalid JSON string');\n\t}\n}\n\n/**\n * Object that maps attribute types to reader functions.\n * @type {Object.<string, Reader>}\n */\nconst readers: { [type: string]: Reader } = {\n\tarray(value: string): unknown[] {\n\t\tconst array = parseJSON<unknown[]>(value);\n\t\tif (!Array.isArray(array)) {\n\t\t\tthrow new TypeError(`Expected an array but got a value of type \"${typeof array}\"`);\n\t\t}\n\t\treturn array;\n\t},\n\n\tboolean(value: string): boolean {\n\t\treturn !(value === '0' || String(value).toLowerCase() === 'false');\n\t},\n\n\tnumber(value: string): number {\n\t\tconst number = Number(value.replace(/_/g, ''));\n\t\treturn number;\n\t},\n\n\tobject(value: string): object {\n\t\tconst object = JSON.parse(value);\n\t\tif (object === null || typeof object !== 'object' || Array.isArray(object)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`expected value of type \"object\" but instead got value \"${value}\" of type \"${parseAttributeTypeDefault(\n\t\t\t\t\tobject,\n\t\t\t\t)}\"`,\n\t\t\t);\n\t\t}\n\t\treturn object;\n\t},\n\n\tstring(value: string): string {\n\t\treturn value;\n\t},\n};\n\ntype Writer = (value: unknown) => string;\n\n/**\n * Object that maps attribute types to writer functions.\n * @type {Object.<string, Writer>}\n */\nconst writers: { [type: string]: Writer } = {\n\tdefault: writeString,\n\tarray: writeJSON,\n\tobject: writeJSON,\n};\n\nfunction writeJSON(value: unknown) {\n\treturn JSON.stringify(value);\n}\n\nfunction writeString(value: unknown) {\n\treturn `${value}`;\n}\n\n/**\n * Reads the attribute value based on the provided type.\n * @param value - The attribute value to be read.\n * @param type - The type of the attribute.\n * @returns The parsed attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function readAttributeValue(value: string, type: AttributeTypeConstant) {\n\tconst readerType = parseAttributeTypeConstant(type);\n\tif (!readerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\treturn readers[readerType]!(value);\n}\n\nexport type ReadAttributeValueReturnType = ReturnType<typeof readAttributeValue>;\n\n/**\n * Writes the attribute value based on the provided type.\n *\n * @param value - The value to be written.\n * @param type - The type of the attribute.\n * @returns The written attribute value.\n * @throws {TypeError} If the provided type is unknown.\n */\nexport function writeAttributeValue(value: unknown, type: AttributeTypeConstant) {\n\tconst writerType = parseAttributeTypeConstant(type);\n\tif (!writerType) throw new TypeError(`[radiant-element] Unknown type \"${type}\"`);\n\tconst writer: Writer = writers[writerType] ?? writers.default ?? writeString;\n\treturn writer(value);\n}\n\nexport type WriteAttributeValueReturnType = ReturnType<typeof writeAttributeValue>;\n\n/*\n * Type guard functions for each type in AttributeTypeConstant\n */\nfunction isBoolean(value: unknown): value is boolean {\n\treturn typeof value === 'boolean';\n}\n\nfunction isNumber(value: unknown): value is number {\n\treturn typeof value === 'number';\n}\n\nfunction isString(value: unknown): value is string {\n\treturn typeof value === 'string';\n}\n\nfunction isArray(value: unknown): value is Array<unknown> {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is object {\n\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n}\n\n/*\n * Check function to ensure defaultValue matches the type\n */\nexport function isValueOfType(type: AttributeTypeConstant, defaultValue: unknown): boolean {\n\tswitch (type) {\n\t\tcase Boolean:\n\t\t\treturn isBoolean(defaultValue);\n\t\tcase Number:\n\t\t\treturn isNumber(defaultValue);\n\t\tcase String:\n\t\t\treturn isString(defaultValue);\n\t\tcase Array:\n\t\t\treturn isArray(defaultValue);\n\t\tcase Object:\n\t\t\treturn isObject(defaultValue);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport const getInitialValue = (\n\ttarget: RadiantElement,\n\ttype: AttributeTypeConstant,\n\tattributeKey: string,\n\tdefaultValue: unknown,\n) => {\n\tif (type === Boolean) {\n\t\tconst attributeValue = target.getAttribute(attributeKey);\n\t\tif (attributeValue === null) {\n\t\t\treturn defaultValue;\n\t\t}\n\n\t\treturn attributeValue === '' ? true : readAttributeValue(attributeValue, type);\n\t}\n\n\tconst attributeValue = target.getAttribute(attributeKey);\n\treturn attributeValue !== null\n\t\t? readAttributeValue(attributeValue, type)\n\t\t: (defaultValue ?? (defaultValueForType(type) as typeof defaultValue));\n};\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": "2PAYO,SAAS,CAA0B,CAAC,EAAkC,CAC5E,OAAQ,QACF,MACJ,MAAO,aACH,QACJ,MAAO,eACH,OACJ,MAAO,cACH,OACJ,MAAO,cACH,OACJ,MAAO,UAUH,SAAS,CAAyB,CAAC,EAAqC,CAC9E,OAAQ,OAAO,OACT,UACJ,MAAO,cACH,SACJ,MAAO,aACH,SACJ,MAAO,SAGT,GAAI,MAAM,QAAQ,CAAY,EAAG,MAAO,QACxC,GAAI,OAAO,UAAU,SAAS,KAAK,CAAY,IAAM,kBAAmB,MAAO,SASzE,SAAS,CAAmB,CAAC,EAAsC,CACzE,OAAQ,QACF,OACJ,MAAO,QACH,OACJ,MAAO,QACH,QACJ,MAAO,WAEP,OAAO,MASV,SAAS,CAAY,CAAC,EAAkB,CACvC,GAAI,CACH,OAAO,KAAK,MAAM,CAAK,EACtB,KAAM,CACP,MAAU,UAAU,qBAAqB,GAQ3C,IAAM,EAAsC,CAC3C,KAAK,CAAC,EAA0B,CAC/B,IAAM,EAAQ,EAAqB,CAAK,EACxC,GAAI,CAAC,MAAM,QAAQ,CAAK,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U,UAAY,CAAC,MAAM,QAAQ,CAAK,GAAK,IAAU,KAMjE,SAAS,CAAa,CAAC,EAA6B,EAAgC,CAC1F,OAAQ,QACF,QACJ,OAAO,EAAU,CAAY,OACzB,OACJ,OAAO,EAAS,CAAY,OACxB,OACJ,OAAO,EAAS,CAAY,OACxB,MACJ,OAAO,EAAQ,CAAY,OACvB,OACJ,OAAO,EAAS,CAAY,UAE5B,MAAO,IAIH,IAAM,EAAkB,CAC9B,EACA,EACA,EACA,IACI,CACJ,GAAI,IAAS,QAAS,CACrB,IAAM,EAAiB,EAAO,aAAa,CAAY,EACvD,GAAI,IAAmB,KACtB,OAAO,EAGR,OAAO,IAAmB,GAAK,GAAO,EAAmB,EAAgB,CAAI,EAG9E,IAAM,EAAiB,EAAO,aAAa,CAAY,EACvD,OAAO,IAAmB,KACvB,EAAmB,EAAgB,CAAI,EACtC,GAAiB,EAAoB,CAAI",
|
|
8
|
+
"debugId": "4AD7E8FD49F8E7F964756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/radiant",
|
|
3
|
-
"version": "0.3.0-alpha.
|
|
3
|
+
"version": "0.3.0-alpha.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/ecopages/radiant.git"
|
|
@@ -19,9 +19,10 @@
|
|
|
19
19
|
"watch:lib": "bun run ./build.ts --watch",
|
|
20
20
|
"size:check": "bun run ./check-size.ts",
|
|
21
21
|
"size:report": "bun run ./check-size.ts --report-only",
|
|
22
|
+
"test:dist": "bun run build:lib && node --test ./test-dist/*.test.mjs",
|
|
22
23
|
"test:standard": "vitest run",
|
|
23
24
|
"test:legacy": "vitest run -- --legacy",
|
|
24
|
-
"test:lib": "bun run test:standard && bun run test:legacy",
|
|
25
|
+
"test:lib": "bun run test:standard && bun run test:legacy && bun run test:dist",
|
|
25
26
|
"test:lib:coverage": "bun run test:standard -- --coverage && bun run vitest run --coverage -- --legacy"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {},
|
|
@@ -91,13 +92,21 @@
|
|
|
91
92
|
"types": "./dist/context/events.d.ts",
|
|
92
93
|
"import": "./dist/context/events.js"
|
|
93
94
|
},
|
|
95
|
+
"./controller-registry": {
|
|
96
|
+
"types": "./dist/controller-registry.d.ts",
|
|
97
|
+
"import": "./dist/controller-registry.js"
|
|
98
|
+
},
|
|
94
99
|
"./core/radiant-element": {
|
|
95
100
|
"types": "./dist/core/radiant-element.d.ts",
|
|
96
101
|
"import": "./dist/core/radiant-element.js"
|
|
97
102
|
},
|
|
98
|
-
"./core/radiant-
|
|
99
|
-
"types": "./dist/core/radiant-
|
|
100
|
-
"import": "./dist/core/radiant-
|
|
103
|
+
"./core/radiant-controller": {
|
|
104
|
+
"types": "./dist/core/radiant-controller.d.ts",
|
|
105
|
+
"import": "./dist/core/radiant-controller.js"
|
|
106
|
+
},
|
|
107
|
+
"./core/reactive-jsx-value": {
|
|
108
|
+
"types": "./dist/core/reactive-jsx-value.d.ts",
|
|
109
|
+
"import": "./dist/core/reactive-jsx-value.js"
|
|
101
110
|
},
|
|
102
111
|
"./client/hydrator": {
|
|
103
112
|
"types": "./dist/client/hydrator.d.ts",
|
|
@@ -123,6 +132,10 @@
|
|
|
123
132
|
"types": "./dist/server/render-component.d.ts",
|
|
124
133
|
"import": "./dist/server/render-component.js"
|
|
125
134
|
},
|
|
135
|
+
"./server/render-controller": {
|
|
136
|
+
"types": "./dist/server/render-controller.d.ts",
|
|
137
|
+
"import": "./dist/server/render-controller.js"
|
|
138
|
+
},
|
|
126
139
|
"./server/project-root": {
|
|
127
140
|
"types": "./dist/server/project-root.d.ts",
|
|
128
141
|
"import": "./dist/server/project-root.js"
|
|
@@ -131,6 +144,14 @@
|
|
|
131
144
|
"types": "./dist/decorators/bound.d.ts",
|
|
132
145
|
"import": "./dist/decorators/bound.js"
|
|
133
146
|
},
|
|
147
|
+
"./decorators/attr": {
|
|
148
|
+
"types": "./dist/decorators/attr.d.ts",
|
|
149
|
+
"import": "./dist/decorators/attr.js"
|
|
150
|
+
},
|
|
151
|
+
"./decorators/controller": {
|
|
152
|
+
"types": "./dist/decorators/controller.d.ts",
|
|
153
|
+
"import": "./dist/decorators/controller.js"
|
|
154
|
+
},
|
|
134
155
|
"./decorators/custom-element": {
|
|
135
156
|
"types": "./dist/decorators/custom-element.d.ts",
|
|
136
157
|
"import": "./dist/decorators/custom-element.js"
|
package/size-budget.json
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bundles": [
|
|
3
3
|
{
|
|
4
|
+
"control": "strict",
|
|
4
5
|
"label": "root-client-surface",
|
|
5
6
|
"entrypoint": "./src/index.ts",
|
|
6
|
-
"maxBytes":
|
|
7
|
-
"maxGzipBytes":
|
|
7
|
+
"maxBytes": 40960,
|
|
8
|
+
"maxGzipBytes": 11264
|
|
8
9
|
},
|
|
9
10
|
{
|
|
11
|
+
"control": "advisory",
|
|
10
12
|
"label": "server-render",
|
|
11
13
|
"entrypoint": "./src/server/render-component.ts",
|
|
12
14
|
"maxBytes": 15360,
|
|
13
15
|
"maxGzipBytes": 5184
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"control": "advisory",
|
|
19
|
+
"label": "server-render-controller",
|
|
20
|
+
"entrypoint": "./src/server/render-controller.ts",
|
|
21
|
+
"maxBytes": 15360,
|
|
22
|
+
"maxGzipBytes": 5376
|
|
14
23
|
}
|
|
15
24
|
]
|
|
16
25
|
}
|
package/dist/chunk-0bswvy25.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Bb as t}from"./chunk-wwbjz9k4.js";function a(r){return function(o,e){let n=String(e.name);e.addInitializer(function(){let i=t(this,r);Object.defineProperty(this,n,{get(){return i.value},enumerable:!0,configurable:!0})})}}
|
|
2
|
-
export{a as $};
|
|
3
|
-
|
|
4
|
-
//# debugId=174B02C349DF3B4664756E2164756E21
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/decorators/standard/query.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { createQuery } from '../../helpers/create-query';\nimport type { QueryConfig } from '../query';\n\nexport function query(options: QueryConfig) {\n\treturn function <T extends HTMLElement, V extends Element | Element[]>(\n\t\t_: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuery<V>(this, options);\n\n\t\t\tObject.defineProperty(this, propertyName, {\n\t\t\t\tget() {\n\t\t\t\t\treturn accessor.value;\n\t\t\t\t},\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t});\n\t\t});\n\t};\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "yCAGO,SAAS,CAAK,CAAC,EAAsB,CAC3C,OAAO,QAA+D,CACrE,EACA,EACC,CACD,IAAM,EAAe,OAAO,EAAQ,IAAI,EAExC,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAW,EAAe,KAAM,CAAO,EAE7C,OAAO,eAAe,KAAM,EAAc,CACzC,GAAG,EAAG,CACL,OAAO,EAAS,OAEjB,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
|
|
8
|
-
"debugId": "174B02C349DF3B4664756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-0btkzzyc.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/decorators/event.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { type EventEmitterConfig } from '../tools/event-emitter';\nimport type { StandardOrLegacyFieldDecoratorArgs } from '../types';\nimport { event as legacyEvent } from './legacy/event';\nimport { event as standardEvent } from './standard/event';\nimport { fieldDecoratorBridge } from './bridge';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig {@link EventEmitterConfig} Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyFieldDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyFieldDecoratorArgs['nameOrContext'],\n\t): any {\n\t\treturn fieldDecoratorBridge(standardEvent(eventConfig), legacyEvent(eventConfig), protoOrTarget, nameOrContext);\n\t};\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "uIAYO,GAAS,LAAK,CAAC,EAAiC,CACtD,OAAO,QAAS,CACf,EACA,EACM,CACN,OAAO,EAAqB,EAAc,CAAW,EAAG,EAAY,CAAW,EAAG,EAAe,CAAa",
|
|
8
|
-
"debugId": "0C61F31D99EFA58E64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-0g0j9re6.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/decorators/on-updated.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { StandardOrLegacyMethodDecoratorArgs } from '../types';\nimport { onUpdated as legacyOnUpdated } from './legacy/on-updated';\nimport { onUpdated as standardOnUpdated } from './standard/on-updated';\nimport { methodDecoratorBridge } from './bridge';\n\n/**\n * A decorator to bind a method to the instance.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): any {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnUpdated(keyOrKeys),\n\t\t\tlegacyOnUpdated(keyOrKeys),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t};\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "uIAQO,GAAS,LAAS,CAAC,EAA8B,CACvD,OAAO,QAAS,CACf,EACA,EACA,EACM,CACN,OAAO,EACN,EAAkB,CAAS,EAC3B,EAAgB,CAAS,EACzB,EACA,EACA,CACD",
|
|
8
|
-
"debugId": "79FD819A4172B94064756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-1x26p09c.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/decorators/on-event.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import type { RadiantElementEventListener } from '../core/radiant-element';\nimport type { StandardOrLegacyMethodDecoratorArgs } from '../types';\nimport type { OnEventConfig, OnEventScope } from '../helpers/create-event-listener';\nimport { onEvent as legacyOnEvent } from './legacy/on-event';\nimport { onEvent as standardOnEvent } from './standard/on-event';\nimport { methodDecoratorBridge } from './bridge';\n\nexport type { OnEventConfig, OnEventScope };\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n * Delegated listeners observe the host light DOM by default, and can optionally observe the shadow root or both trees.\n *\n * @param options {@link OnEventConfig} The event configuration.\n */\nexport function onEvent(options: OnEventConfig) {\n\treturn function (\n\t\tprotoOrTarget: StandardOrLegacyMethodDecoratorArgs['protoOrTarget'],\n\t\tnameOrContext: StandardOrLegacyMethodDecoratorArgs['nameOrContext'],\n\t\tdescriptor?: StandardOrLegacyMethodDecoratorArgs['descriptor'],\n\t): any {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnEvent(options),\n\t\t\tlegacyOnEvent(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t};\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "uIAoBO,GAAS,LAAO,CAAC,EAAwB,CAC/C,OAAO,QAAS,CACf,EACA,EACA,EACM,CACN,OAAO,EACN,EAAgB,CAAO,EACvB,EAAc,CAAO,EACrB,EACA,EACA,CACD",
|
|
8
|
-
"debugId": "DFF5F8F9A61E3D2564756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-21a7jask.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{U as I}from"./chunk-kmebacvv.js";import{W as U,X as Y}from"./chunk-c0qyz98c.js";import{ub as K,vb as Q}from"./chunk-hpzgnxgq.js";import{createMarkupNodeLike as _}from"@ecopages/jsx";class ${host;context;hydrationKey;hydrate;serialize;pendingHostHydration;value;subscriptions=[];constructor(q,A){this.host=q,this.context=A.context,this.hydrationKey=A.hydrationKey,this.hydrate=A.hydrate,this.serialize=A.serialize,this.pendingHostHydration=Boolean(A.hydrate),this.value=A.initialValue,this.tryHydrateFromHost(),this.registerEvents(),this.host.dispatchEvent(new I(this.context))}setContext=(q,A)=>{if(this.tryHydrateFromHost(),this.pendingHostHydration=!1,typeof this.value>"u"&&this.isObject(q)){let B=this.value;if(this.value={...q},A)A(this.value);this.notifySubscribers(this.value,B);return}if(this.isObject(this.value)&&this.isObject(q)){let B={...this.value};if(this.value={...this.value,...q},A)A(this.value);this.notifySubscribers(this.value,B)}};getContext=()=>{return this.tryHydrateFromHost(),this.value};getContextKey=()=>{return this.context};serializeHydrationValue=()=>{if(this.tryHydrateFromHost(),!this.hydrate||typeof this.value>"u")return;let q=this.serialize?this.serialize(this.value):this.value;if(typeof q>"u")return;let A=JSON.stringify(q);if(typeof A!=="string")return;return Y(A)};renderHydrationScriptTag=()=>{let q=this.serializeHydrationValue();if(!q)return;return U({hydrationKey:this.hydrationKey,serializedValue:q})};renderHydrationScript=()=>{let q=this.renderHydrationScriptTag();if(!q)return;return _(q)};subscribe=({select:q,callback:A})=>{this.subscriptions.push({select:q,callback:A})};tryHydrateFromHost(){if(!this.pendingHostHydration)return;let q=this.findHydrationScriptElement();if(!q)return;this.value=this.mergeHydrationValue(K(q,this.value)),this.pendingHostHydration=!1}mergeHydrationValue(q){if(this.hydrate===Object&&this.isObject(q)&&(this.isObject(this.value)||typeof this.value>"u"))return{...this.value??{},...q};return q}isObject(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}findHydrationScriptElement(){return Q(this.host,"context",this.hydrationKey)}notifySubscribers=(q,A)=>{for(let B of this.subscriptions){if(!B.select||typeof A>"u"){this.sendSubscriptionUpdate(B,q);continue}let F=B.select(q),G=B.select(A);if(F!==G)this.sendSubscriptionUpdate(B,q)}};sendSubscriptionUpdate=({select:q,callback:A},B)=>{if(!q)A(B);else A(q(B))};handleSubscriptionRequest=({select:q,callback:A,subscribe:B})=>{if(this.tryHydrateFromHost(),B)this.subscribe({select:q,callback:A});if(typeof this.value>"u")return;if(q)A(q(this.value));else A(this.value)};onSubscriptionRequest=(q)=>{let{context:A,callback:B,subscribe:F,select:G,target:Z}=q;if(A!==this.context)return;q.stopPropagation(),Z.dispatchEvent(new I(this.context)),this.handleSubscriptionRequest({select:G,callback:B,subscribe:F})};onContextRequest=(q)=>{let{context:A,callback:B}=q;if(A!==this.context)return;q.stopPropagation(),B(this)};registerEvents=()=>{this.host.addEventListener("context-subscription-request",this.onSubscriptionRequest),this.host.addEventListener("context-request",this.onContextRequest)}}
|
|
2
|
-
export{$ as R};
|
|
3
|
-
|
|
4
|
-
//# debugId=4E0252ECD83ECA6C64756E2164756E21
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/context/context-provider.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\nimport type { RadiantElement } from '../core/radiant-element';\nimport type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';\nimport type { AttributeTypeConstant } from '../utils/attribute-utils';\nimport {\n\tContextEventsTypes,\n\tContextOnMountEvent,\n\ttype ContextRequestEvent,\n\ttype ContextSubscription,\n\ttype ContextSubscriptionRequestEvent,\n} from './events';\nimport { findHydrationScript, parseHydrationPayload } from '../core/hydration-codec';\nimport { createContextHydrationScriptTag, escapeContextHydrationJson } from './hydration-script';\nimport type { Context, ContextType, UnknownContext } from './types';\n\ntype ContextProviderOptions<T extends UnknownContext> = {\n\tcontext: UnknownContext;\n\thydrationKey?: string;\n\tinitialValue?: T['__context__'];\n\thydrate?: AttributeTypeConstant;\n\tserialize?: (value: ContextType<T>) => unknown;\n};\n\nexport interface SsrSerializableContextProvider extends SsrSerializableHydrationBinding {\n\t/** Returns the current context payload that should be visible to descendants. */\n\tgetContext(): unknown;\n\t/** Returns the context token used to match nested SSR consumers and providers. */\n\tgetContextKey(): UnknownContext;\n}\n\n/**\n * Represents a context provider that allows setting and getting the context,\n * as well as subscribing to context updates.\n *\n * @template T - The type of the context.\n */\nexport interface IContextProvider<T extends Context<unknown, unknown>> {\n\t/**\n\t * Sets the context with the provided update and invokes the optional callback function.\n\t *\n\t * @param update - The partial update to be applied to the context.\n\t * @param callback - An optional callback function that receives the updated context.\n\t */\n\tsetContext: (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => void;\n\n\t/**\n\t * Gets the current context.\n\t *\n\t * @returns The current context.\n\t */\n\tgetContext: () => ContextType<T>;\n\n\t/**\n\t * Subscribes to context updates.\n\t *\n\t * @param subscription - The subscription object that defines the callback function to be invoked on context updates.\n\t */\n\tsubscribe: (subscription: ContextSubscription<T>) => void;\n}\n\n/**\n * It creates a context provider that allows setting and getting the context,\n * It will also be in charge of notifying the subscribers when the context changes.\n *\n * @template T - The type of the context.\n * @implements IContextProvider\n *\n * @example\n * ```ts\n * export class MyElement extends RadiantElement {\n * provider = new ContextProvider<typeof myContext>(this, {\n * context: myContext,\n * initialValue: {\n * value: 'Hello World',\n * },\n * });\n * ```\n */\nexport class ContextProvider<T extends Context<unknown, unknown>>\n\timplements IContextProvider<T>, SsrSerializableContextProvider\n{\n\tprivate host: RadiantElement;\n\tprivate context: UnknownContext;\n\tprivate hydrationKey?: string;\n\tprivate hydrate?: AttributeTypeConstant;\n\tprivate serialize?: (value: ContextType<T>) => unknown;\n\tprivate pendingHostHydration: boolean;\n\tprivate value: ContextType<T> | undefined;\n\n\tsubscriptions: ContextSubscription<T>[] = [];\n\n\t/**\n\t * Creates a new instance of the ContextProvider.\n\t *\n\t * @param host - The host element that will contain the context provider.\n\t * @param options - The options to configure the context provider.\n\t */\n\tconstructor(host: RadiantElement, options: ContextProviderOptions<T>) {\n\t\tthis.host = host;\n\t\tthis.context = options.context;\n\t\tthis.hydrationKey = options.hydrationKey;\n\t\tthis.hydrate = options.hydrate;\n\t\tthis.serialize = options.serialize;\n\t\tthis.pendingHostHydration = Boolean(options.hydrate);\n\t\tthis.value = options.initialValue as ContextType<T>;\n\t\tthis.tryHydrateFromHost();\n\n\t\tthis.registerEvents();\n\t\tthis.host.dispatchEvent(new ContextOnMountEvent(this.context));\n\t}\n\n\tsetContext = (update: Partial<ContextType<T>>, callback?: (context: ContextType<T>) => void) => {\n\t\tthis.tryHydrateFromHost();\n\t\tthis.pendingHostHydration = false;\n\n\t\tif (typeof this.value === 'undefined' && this.isObject(update)) {\n\t\t\tconst oldContext = this.value;\n\t\t\tthis.value = { ...update } as ContextType<T>;\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isObject(this.value) && this.isObject(update)) {\n\t\t\tconst oldContext = { ...this.value };\n\t\t\tthis.value = { ...this.value, ...update };\n\t\t\tif (callback) callback(this.value);\n\t\t\tthis.notifySubscribers(this.value, oldContext);\n\t\t}\n\t};\n\n\tgetContext = () => {\n\t\tthis.tryHydrateFromHost();\n\t\treturn this.value as ContextType<T>;\n\t};\n\n\t/**\n\t * Returns the provider's logical context token.\n\t *\n\t * SSR helpers use this token to resolve the closest matching provider while a\n\t * host subtree is being serialized.\n\t */\n\tgetContextKey = () => {\n\t\treturn this.context;\n\t};\n\n\t/**\n\t * Serializes the current provider value for inclusion in a hydration script.\n\t *\n\t * The serialized payload is JSON-escaped so it can be embedded safely inside a\n\t * `<script type=\"application/json\">` tag.\n\t */\n\tserializeHydrationValue = (): string | undefined => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (!this.hydrate || typeof this.value === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst hydrationValue = this.serialize ? this.serialize(this.value) : this.value;\n\n\t\tif (typeof hydrationValue === 'undefined') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst serializedValue = JSON.stringify(hydrationValue);\n\n\t\tif (typeof serializedValue !== 'string') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn escapeContextHydrationJson(serializedValue);\n\t};\n\n\t/**\n\t * Builds the raw HTML hydration script for this provider.\n\t *\n\t * When `hydrationKey` is present, the marker is scoped so sibling or nested\n\t * providers can recover their own payloads without accidentally reading a\n\t * descendant script.\n\t */\n\trenderHydrationScriptTag = (): string | undefined => {\n\t\tconst serializedValue = this.serializeHydrationValue();\n\n\t\tif (!serializedValue) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createContextHydrationScriptTag({\n\t\t\thydrationKey: this.hydrationKey,\n\t\t\tserializedValue,\n\t\t});\n\t};\n\n\t/**\n\t * Wraps the provider hydration script in a minimal JSX node-like value.\n\t *\n\t * This lets JSX-based host renderers append the script without needing a real\n\t * DOM element instance during SSR.\n\t */\n\trenderHydrationScript = (): JsxRenderable | undefined => {\n\t\tconst outerHTML = this.renderHydrationScriptTag();\n\n\t\tif (!outerHTML) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn createMarkupNodeLike(outerHTML);\n\t};\n\n\tsubscribe = ({ select, callback }: ContextSubscription<T>) => {\n\t\tthis.subscriptions.push({ select, callback });\n\t};\n\n\tprivate tryHydrateFromHost(): void {\n\t\tif (!this.pendingHostHydration) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst hydrationScriptElement = this.findHydrationScriptElement();\n\n\t\tif (!hydrationScriptElement) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.value = this.mergeHydrationValue(\n\t\t\tparseHydrationPayload(hydrationScriptElement, this.value) as ContextType<T>,\n\t\t);\n\t\tthis.pendingHostHydration = false;\n\t}\n\n\tprivate mergeHydrationValue(parsedHydrationValue: ContextType<T>): ContextType<T> {\n\t\tif (\n\t\t\tthis.hydrate === Object &&\n\t\t\tthis.isObject(parsedHydrationValue) &&\n\t\t\t(this.isObject(this.value) || typeof this.value === 'undefined')\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...(this.value ?? {}),\n\t\t\t\t...parsedHydrationValue,\n\t\t\t} as ContextType<T>;\n\t\t}\n\n\t\treturn parsedHydrationValue;\n\t}\n\n\tprivate isObject(value: unknown): value is Record<string, unknown> {\n\t\treturn typeof value === 'object' && !Array.isArray(value) && value !== null;\n\t}\n\n\tprivate findHydrationScriptElement(): Element | null {\n\t\treturn findHydrationScript(this.host as Element, 'context', this.hydrationKey);\n\t}\n\n\tprivate notifySubscribers = (newContext: ContextType<T>, prevContext: ContextType<T> | undefined) => {\n\t\tfor (const sub of this.subscriptions) {\n\t\t\tif (!sub.select || typeof prevContext === 'undefined') {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst newSelected = sub.select(newContext);\n\t\t\tconst prevSelected = sub.select(prevContext);\n\t\t\tif (newSelected !== prevSelected) {\n\t\t\t\tthis.sendSubscriptionUpdate(sub, newContext);\n\t\t\t}\n\t\t}\n\t};\n\n\tprivate sendSubscriptionUpdate = ({ select, callback }: ContextSubscription<T>, context: ContextType<T>) => {\n\t\tif (!select) callback(context);\n\t\telse callback(select(context));\n\t};\n\n\tprivate handleSubscriptionRequest = ({\n\t\tselect,\n\t\tcallback,\n\t\tsubscribe,\n\t}: {\n\t\tselect?: ContextSubscription<T>['select'];\n\t\tcallback: ContextSubscription<T>['callback'];\n\t\tsubscribe?: boolean;\n\t}) => {\n\t\tthis.tryHydrateFromHost();\n\n\t\tif (subscribe) this.subscribe({ select, callback });\n\n\t\tif (typeof this.value === 'undefined') return;\n\n\t\tif (select) {\n\t\t\tcallback(select(this.value));\n\t\t} else {\n\t\t\tcallback(this.value as ContextType<T>);\n\t\t}\n\t};\n\n\tprivate onSubscriptionRequest = (event: ContextSubscriptionRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback, subscribe, select, target } = event;\n\t\tif (context !== this.context) return;\n\n\t\tevent.stopPropagation();\n\n\t\t(target as HTMLElement).dispatchEvent(new ContextOnMountEvent(this.context));\n\n\t\tthis.handleSubscriptionRequest({ select, callback, subscribe });\n\t};\n\n\tprivate onContextRequest = (event: ContextRequestEvent<UnknownContext>) => {\n\t\tconst { context, callback } = event;\n\t\tif (context !== this.context) return;\n\t\tevent.stopPropagation();\n\t\tcallback(this);\n\t};\n\n\tprivate registerEvents = () => {\n\t\tthis.host.addEventListener(ContextEventsTypes.SUBSCRIPTION_REQUEST, this.onSubscriptionRequest);\n\t\tthis.host.addEventListener(ContextEventsTypes.CONTEXT_REQUEST, this.onContextRequest);\n\t};\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "oJAAA,yBAAS,gBA8EF,MAAM,CAEb,CACS,KACA,QACA,aACA,QACA,UACA,qBACA,MAER,cAA0C,CAAC,EAQ3C,WAAW,CAAC,EAAsB,EAAoC,CACrE,KAAK,KAAO,EACZ,KAAK,QAAU,EAAQ,QACvB,KAAK,aAAe,EAAQ,aAC5B,KAAK,QA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I,OAAO,KAAK,MAAU,IAAa,OAEvC,GAAI,EACH,EAAS,EAAO,KAAK,KAAK,CAAC,EAE3B,OAAS,KAAK,KAAuB,GAI/B,sBAAwB,CAAC,IAA2D,CAC3F,IAAQ,UAAS,WAAU,YAAW,SAAQ,UAAW,EACzD,GAAI,IAAY,KAAK,QAAS,OAE9B,EAAM,gBAAgB,EAErB,EAAuB,cAAc,IAAI,EAAoB,KAAK,OAAO,CAAC,EAE3E,KAAK,0BAA0B,CAAE,SAAQ,WAAU,WAAU,CAAC,GAGvD,iBAAmB,CAAC,IAA+C,CAC1E,IAAQ,UAAS,YAAa,EAC9B,GAAI,IAAY,KAAK,QAAS,OAC9B,EAAM,gBAAgB,EACtB,EAAS,IAAI,GAGN,eAAiB,IAAM,CAC9B,KAAK,KAAK,gDAA0D,KAAK,qBAAqB,EAC9F,KAAK,KAAK,mCAAqD,KAAK,gBAAgB,EAEtF",
|
|
8
|
-
"debugId": "4E0252ECD83ECA6C64756E2164756E21",
|
|
9
|
-
"names": []
|
|
10
|
-
}
|
package/dist/chunk-21acj2eq.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{Y as K}from"./chunk-gdkte2vd.js";import{Sa as X}from"./chunk-gg74gdpv.js";import{Ta as Y}from"./chunk-e0r6ca2g.js";import{hb as D,ib as F,jb as O,kb as Q,lb as T,mb as U,nb as V,ob as W}from"./chunk-e5jd9h6t.js";import{pb as L}from"./chunk-hpzgnxgq.js";import{hasHydrationMarkers as Z,hydrate as _,jsx as $,render as A}from"@ecopages/jsx";import{Computed as E,subtle as I}from"@ecopages/signals";class G extends K{isRendering=!1;isFirstConnectPending=!1;isRenderScheduled=!1;needsRender=!1;projectedSlotContent=new Map;renderSignal;renderWatcher=new I.Watcher(()=>{this.requestUpdate()});slotProjectionObserver;slotProjectionVersion=0;connectedCallback(){if(super.connectedCallback(),this.isFirstConnectPending)return;this.isFirstConnectPending=!0,queueMicrotask(()=>{if(this.isFirstConnectPending=!1,!this.isConnected)return;if(this.ensureSlotProjectionState(),this.observeSlotProjection(),J(this)){if(this.needsRender=!1,this.hydrate(),this.needsRender)this.update();return}this.update()})}render(){return $("slot",{})}renderToString(f={}){return this.prepareForSsr(),B().renderView(this,f)}renderHost(){return B().renderHost(this)}renderHostToString(f={}){return B().renderHostToString(this,f)}hydrate(){if(!this.isConnected||this.isRendering)return;this.isRendering=!0,this.disconnectSlotProjectionObserver();try{_(this.resolveTrackedRenderOutput().value,this)}finally{this.isRendering=!1,this.observeSlotProjection()}}requestUpdate(){if(this.needsRender=!0,this.isRenderScheduled)return;this.isRenderScheduled=!0,queueMicrotask(()=>{if(this.isRenderScheduled=!1,!this.needsRender)return;this.update()})}update(){if(this.needsRender=!0,!this.isConnected||this.isRendering)return;if(this.isFirstConnectPending&&J(this))return;while(this.needsRender&&this.isConnected){this.needsRender=!1,this.isRendering=!0,this.disconnectSlotProjectionObserver();try{A(this.resolveTrackedRenderOutput().value,this)}finally{this.isRendering=!1,this.observeSlotProjection()}}}disconnectedCallback(){this.disconnectSlotProjectionObserver(),this.disconnectRenderWatcher(),super.disconnectedCallback()}getSlotElement(f){return this.getSlotElements(f)[0]??null}getSlotElements(f){return this.ensureSlotProjectionState(),(this.projectedSlotContent.get(f??D)??[]).filter((q)=>typeof Node<"u"&&q instanceof Element)}shouldAutoBindReactiveMembers(){return!0}getHostSsrAttributes(){return B().getHostAttributes(this)}resolveSsrRenderBridge(){let f={};if(this.renderHostToString===G.prototype.renderHostToString)f.renderHostToString=(q)=>this.renderHostToString(q);if(this.renderHost===G.prototype.renderHost)f.renderHost=()=>this.renderHost();return f}ensureSlotProjectionState(){if(this.projectedSlotContent.size>0)return;let f=this.isConnected?W(this):void 0;if(typeof f==="string"&&f!==""){this.projectedSlotContent=Q(f),this.slotProjectionVersion+=1;return}if(this.getHostChildNodeCount()>0)this.projectedSlotContent=O(this),this.slotProjectionVersion+=1}getHostChildNodeCount(){return"childNodes"in this&&this.childNodes?this.childNodes.length:0}getSlotProjectionScriptTag(){this.ensureSlotProjectionState();let f=U(this.projectedSlotContent);if(!f)return;return`<script type="application/json" ${F}>${v(f)}</script>`}getAuthoredHydrationScriptMarkup(){let f=T(this);if(f)return f;return}handleSlotProjectionMutations(f){let q=!1;for(let w of f){for(let z of Array.from(w.removedNodes))if(this.removeProjectedSlotNode(z))q=!0;for(let z of Array.from(w.addedNodes)){if(z.parentNode!==this)continue;if(this.addProjectedSlotNode(z))q=!0}}if(q)this.slotProjectionVersion+=1,this.update()}addProjectedSlotNode(f){if(f instanceof HTMLScriptElement&&(f.hasAttribute(F)||f.hasAttribute(L)))return!1;let q=f instanceof Element?f.getAttribute("slot")??D:D,w=this.projectedSlotContent.get(q);if(w){if(w.includes(f))return!1;return w.push(f),!0}return this.projectedSlotContent.set(q,[f]),!0}removeProjectedSlotNode(f){for(let[q,w]of this.projectedSlotContent.entries()){let z=w.indexOf(f);if(z===-1)continue;if(w.splice(z,1),w.length===0)this.projectedSlotContent.delete(q);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 E(()=>this.resolveRenderOutput()),q=f.get();if(!this.isConnected)return q;if(this.renderSignal)this.renderWatcher.unwatch(this.renderSignal);return this.renderSignal=f,this.renderWatcher.watch(f),q}resolveRenderOutput(){return this.ensureSlotProjectionState(),V(this.render(),this.projectedSlotContent)}}function B(){let f=Y();if(!f)throw Error("Radiant SSR runtime is unavailable. Import `@ecopages/radiant/server/render-component` before using instance SSR methods.");return f}function J(f){return X()&&Z(f)}function v(f){return f.replace(/</g,"\\u003c")}
|
|
2
|
-
export{G as P};
|
|
3
|
-
|
|
4
|
-
//# debugId=55107CFC631DC79E64756E2164756E21
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/core/radiant-component.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import {\n\thasHydrationMarkers,\n\thydrate as hydrateJsx,\n\tjsx,\n\trender as renderJsx,\n\ttype JsxRenderable,\n} from '@ecopages/jsx';\nimport type { RenderToStringOptions } from '@ecopages/jsx/server';\nimport { Computed, subtle } from '@ecopages/signals';\nimport { RadiantElement } from './radiant-element';\nimport {\n\tDEFAULT_SLOT_NAME,\n\tSLOT_PROJECTION_SCRIPT_ATTRIBUTE,\n\tcollectAuthoredHydrationScriptMarkup,\n\tcaptureProjectedSlotRenderables,\n\tdeserializeProjectedSlotRenderables,\n\tresolveSlotProjection,\n\tserializeProjectedSlotRenderables,\n\ttakeSlotProjectionScriptPayload,\n} from './slot-projection-runtime';\nimport { HYDRATION_ATTRIBUTE } from './hydration-codec';\nimport { isRadiantHydratorInstalled } from './radiant-hydrator-state';\nimport {\n\tgetRadiantComponentSsrRuntime,\n\ttype RadiantComponentRenderBridge,\n\ttype RadiantComponentSsrCapable,\n} from './radiant-component-ssr-registry';\n\n/**\n * A structured JSX-first Radiant base class.\n * @typeParam Bindings - Explicit internal bindable shape. Include only the\n * prop/state keys that JSX bindings should accept.\n *\n * Treat this as the component's internal reactive/bindable surface, not as the\n * default public custom-element attribute contract. When a component exposes a\n * narrower external API than its internal state, declare a separate public\n * props type for the JSX intrinsic element and keep internal-only state out of\n * that contract.\n *\n * Reusing the same type for both is fine only when the public props and the\n * bindable reactive members are intentionally the same surface.\n *\n * - `render()` describes the view.\n * - `update()` commits the current view into the host.\n * - first render happens automatically on connect.\n * - plain `@prop`, `@state`, and `@signal` reads performed during `render()`\n * participate in tracked rerender invalidation.\n * - `update()` and `requestUpdate()` remain available when a rerender should be\n * scheduled from imperative work outside those tracked reads.\n */\nexport class RadiantComponent<Bindings extends object = {}> extends RadiantElement<Bindings> {\n\tprivate isRendering = false;\n\tprivate isFirstConnectPending = false;\n\tprivate isRenderScheduled = false;\n\tprivate needsRender = false;\n\tprivate projectedSlotContent = new Map<string, JsxRenderable[]>();\n\tprivate renderSignal?: Computed<{ containsSlots: boolean; value: JsxRenderable }>;\n\tprivate readonly renderWatcher = new subtle.Watcher(() => {\n\t\tthis.requestUpdate();\n\t});\n\tprivate slotProjectionObserver?: MutationObserver;\n\tprivate slotProjectionVersion = 0;\n\n\toverride connectedCallback() {\n\t\tsuper.connectedCallback();\n\n\t\tif (this.isFirstConnectPending) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isFirstConnectPending = true;\n\n\t\tqueueMicrotask(() => {\n\t\t\tthis.isFirstConnectPending = false;\n\n\t\t\tif (!this.isConnected) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.ensureSlotProjectionState();\n\t\t\tthis.observeSlotProjection();\n\n\t\t\tif (shouldHydrateOnConnect(this)) {\n\t\t\t\tthis.needsRender = false;\n\t\t\t\tthis.hydrate();\n\n\t\t\t\tif (this.needsRender) {\n\t\t\t\t\tthis.update();\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.update();\n\t\t});\n\t}\n\n\t/**\n\t * Returns the current component view.\n\t *\n\t * The base implementation behaves like `<slot />`, so authored host children\n\t * pass through unchanged when a subclass does not override `render()`.\n\t */\n\tpublic render(): JsxRenderable {\n\t\treturn jsx('slot', {});\n\t}\n\n\t/**\n\t * Serializes the current component view into HTML.\n\t */\n\tpublic renderToString(options: RenderToStringOptions = {}): string {\n\t\tthis.prepareForSsr();\n\n\t\treturn requireRadiantComponentSsrRuntime().renderView(this as unknown as RadiantComponentSsrCapable, options);\n\t}\n\n\t/**\n\t * Returns the component host and current view as a JSX element.\n\t */\n\tpublic renderHost(): JsxRenderable {\n\t\treturn requireRadiantComponentSsrRuntime().renderHost(this as unknown as RadiantComponentSsrCapable);\n\t}\n\n\t/**\n\t * Serializes the component host and current view into HTML.\n\t */\n\tpublic renderHostToString(options: RenderToStringOptions = {}): string {\n\t\treturn requireRadiantComponentSsrRuntime().renderHostToString(\n\t\t\tthis as unknown as RadiantComponentSsrCapable,\n\t\t\toptions,\n\t\t);\n\t}\n\n\t/**\n\t * Hydrates an SSR-rendered component view in place.\n\t */\n\tpublic hydrate(): void {\n\t\tif (!this.isConnected || this.isRendering) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isRendering = true;\n\t\tthis.disconnectSlotProjectionObserver();\n\n\t\ttry {\n\t\t\thydrateJsx(this.resolveTrackedRenderOutput().value, this);\n\t\t} finally {\n\t\t\tthis.isRendering = false;\n\t\t\tthis.observeSlotProjection();\n\t\t}\n\t}\n\n\t/**\n\t * Queues a component rerender and coalesces repeated requests into the same\n\t * microtask.\n\t *\n\t * Use this when reactive state may change multiple times in the same turn and\n\t * the current view should refresh once with the final values.\n\t */\n\tpublic requestUpdate(): void {\n\t\tthis.needsRender = true;\n\n\t\tif (this.isRenderScheduled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.isRenderScheduled = true;\n\n\t\tqueueMicrotask(() => {\n\t\t\tthis.isRenderScheduled = false;\n\n\t\t\tif (!this.needsRender) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.update();\n\t\t});\n\t}\n\n\t/**\n\t * Explicitly rerenders the component into its host.\n\t */\n\tpublic update(): void {\n\t\tthis.needsRender = true;\n\n\t\tif (!this.isConnected || this.isRendering) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.isFirstConnectPending && shouldHydrateOnConnect(this)) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (this.needsRender && this.isConnected) {\n\t\t\tthis.needsRender = false;\n\t\t\tthis.isRendering = true;\n\t\t\tthis.disconnectSlotProjectionObserver();\n\n\t\t\ttry {\n\t\t\t\trenderJsx(this.resolveTrackedRenderOutput().value, this);\n\t\t\t} finally {\n\t\t\t\tthis.isRendering = false;\n\t\t\t\tthis.observeSlotProjection();\n\t\t\t}\n\t\t}\n\t}\n\n\toverride disconnectedCallback() {\n\t\tthis.disconnectSlotProjectionObserver();\n\t\tthis.disconnectRenderWatcher();\n\t\tsuper.disconnectedCallback();\n\t}\n\n\t/**\n\t * Returns the first projected element assigned to the default or named slot.\n\t *\n\t * Use this when component logic needs direct access to authored light-DOM\n\t * content after projection.\n\t *\n\t * @param name Optional slot name. Omit for the default slot.\n\t */\n\tpublic getSlotElement<T extends Element = Element>(name?: string): T | null {\n\t\treturn (this.getSlotElements<T>(name)[0] ?? null) as T | null;\n\t}\n\n\t/**\n\t * Returns all projected elements assigned to the default or named slot.\n\t *\n\t * Text nodes are intentionally excluded so the result matches the element-\n\t * oriented query semantics used by Radiant decorators.\n\t *\n\t * @param name Optional slot name. Omit for the default slot.\n\t */\n\tpublic getSlotElements<T extends Element = Element>(name?: string): T[] {\n\t\tthis.ensureSlotProjectionState();\n\n\t\treturn (this.projectedSlotContent.get(name ?? DEFAULT_SLOT_NAME) ?? []).filter(\n\t\t\t(renderable): renderable is T => typeof Node !== 'undefined' && renderable instanceof Element,\n\t\t);\n\t}\n\n\tprotected override shouldAutoBindReactiveMembers(): boolean {\n\t\treturn true;\n\t}\n\n\tprotected getHostSsrAttributes(): Record<string, string> {\n\t\treturn requireRadiantComponentSsrRuntime().getHostAttributes(this as unknown as RadiantComponentSsrCapable);\n\t}\n\n\t/**\n\t * Exposes the inherited SSR helper path to internal server renderers.\n\t *\n\t * The bridge is intentionally empty when a subclass overrides the host SSR\n\t * methods so that custom host serialization remains the source of truth.\n\t */\n\tprotected resolveSsrRenderBridge(): RadiantComponentRenderBridge {\n\t\tconst bridge: RadiantComponentRenderBridge = {};\n\n\t\tif (this.renderHostToString === RadiantComponent.prototype.renderHostToString) {\n\t\t\tbridge.renderHostToString = (options: RenderToStringOptions | undefined) =>\n\t\t\t\tthis.renderHostToString(options);\n\t\t}\n\n\t\tif (this.renderHost === RadiantComponent.prototype.renderHost) {\n\t\t\tbridge.renderHost = () => this.renderHost();\n\t\t}\n\n\t\treturn bridge;\n\t}\n\n\tprivate ensureSlotProjectionState(): void {\n\t\tif (this.projectedSlotContent.size > 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scriptPayload = this.isConnected ? takeSlotProjectionScriptPayload(this) : undefined;\n\n\t\tif (typeof scriptPayload === 'string' && scriptPayload !== '') {\n\t\t\tthis.projectedSlotContent = deserializeProjectedSlotRenderables(scriptPayload);\n\t\t\tthis.slotProjectionVersion += 1;\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.getHostChildNodeCount() > 0) {\n\t\t\tthis.projectedSlotContent = captureProjectedSlotRenderables(this);\n\t\t\tthis.slotProjectionVersion += 1;\n\t\t}\n\t}\n\n\tprivate getHostChildNodeCount(): number {\n\t\treturn 'childNodes' in this && this.childNodes ? this.childNodes.length : 0;\n\t}\n\n\tprivate getSlotProjectionScriptTag(): string | undefined {\n\t\tthis.ensureSlotProjectionState();\n\t\tconst payload = serializeProjectedSlotRenderables(this.projectedSlotContent);\n\n\t\tif (!payload) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn `<script type=\"application/json\" ${SLOT_PROJECTION_SCRIPT_ATTRIBUTE}>${escapeScriptText(payload)}</script>`;\n\t}\n\n\tprivate getAuthoredHydrationScriptMarkup(): string | undefined {\n\t\tconst authoredHydrationMarkup = collectAuthoredHydrationScriptMarkup(this);\n\n\t\tif (authoredHydrationMarkup) {\n\t\t\treturn authoredHydrationMarkup;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tprivate handleSlotProjectionMutations(records: MutationRecord[]): void {\n\t\tlet hasProjectionChanges = false;\n\n\t\tfor (const record of records) {\n\t\t\tfor (const removedNode of Array.from(record.removedNodes)) {\n\t\t\t\tif (this.removeProjectedSlotNode(removedNode)) {\n\t\t\t\t\thasProjectionChanges = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (const addedNode of Array.from(record.addedNodes)) {\n\t\t\t\tif (addedNode.parentNode !== this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (this.addProjectedSlotNode(addedNode)) {\n\t\t\t\t\thasProjectionChanges = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasProjectionChanges) {\n\t\t\tthis.slotProjectionVersion += 1;\n\t\t\tthis.update();\n\t\t}\n\t}\n\n\tprivate addProjectedSlotNode(node: Node): boolean {\n\t\tif (\n\t\t\tnode instanceof HTMLScriptElement &&\n\t\t\t(node.hasAttribute(SLOT_PROJECTION_SCRIPT_ATTRIBUTE) || node.hasAttribute(HYDRATION_ATTRIBUTE))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst slotName = node instanceof Element ? (node.getAttribute('slot') ?? DEFAULT_SLOT_NAME) : DEFAULT_SLOT_NAME;\n\t\tconst bucket = this.projectedSlotContent.get(slotName);\n\n\t\tif (bucket) {\n\t\t\tif (bucket.includes(node)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbucket.push(node);\n\t\t\treturn true;\n\t\t}\n\n\t\tthis.projectedSlotContent.set(slotName, [node]);\n\t\treturn true;\n\t}\n\n\tprivate removeProjectedSlotNode(node: Node): boolean {\n\t\tfor (const [slotName, bucket] of this.projectedSlotContent.entries()) {\n\t\t\tconst nodeIndex = bucket.indexOf(node);\n\n\t\t\tif (nodeIndex === -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbucket.splice(nodeIndex, 1);\n\n\t\t\tif (bucket.length === 0) {\n\t\t\t\tthis.projectedSlotContent.delete(slotName);\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tprivate observeSlotProjection(): void {\n\t\tif (typeof MutationObserver === 'undefined' || this.slotProjectionObserver || !this.isConnected) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.slotProjectionObserver = new MutationObserver((records) => this.handleSlotProjectionMutations(records));\n\t\tthis.slotProjectionObserver.observe(this, { childList: true });\n\t}\n\n\tprivate disconnectSlotProjectionObserver(): void {\n\t\tthis.slotProjectionObserver?.disconnect();\n\t\tthis.slotProjectionObserver = undefined;\n\t}\n\n\tprivate disconnectRenderWatcher(): void {\n\t\tif (!this.renderSignal) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.renderWatcher.unwatch(this.renderSignal);\n\t\tthis.renderSignal = undefined;\n\t}\n\n\tprivate resolveTrackedRenderOutput(): { containsSlots: boolean; value: JsxRenderable } {\n\t\tconst nextRenderSignal = new Computed(() => this.resolveRenderOutput());\n\t\tconst output = nextRenderSignal.get();\n\n\t\tif (!this.isConnected) {\n\t\t\treturn output;\n\t\t}\n\n\t\tif (this.renderSignal) {\n\t\t\tthis.renderWatcher.unwatch(this.renderSignal);\n\t\t}\n\n\t\tthis.renderSignal = nextRenderSignal;\n\t\tthis.renderWatcher.watch(nextRenderSignal);\n\t\treturn output;\n\t}\n\n\tprivate resolveRenderOutput(): { containsSlots: boolean; value: JsxRenderable } {\n\t\tthis.ensureSlotProjectionState();\n\t\treturn resolveSlotProjection(this.render(), this.projectedSlotContent);\n\t}\n}\n\nfunction requireRadiantComponentSsrRuntime() {\n\tconst runtime = getRadiantComponentSsrRuntime();\n\n\tif (!runtime) {\n\t\tthrow new Error(\n\t\t\t'Radiant SSR runtime is unavailable. Import `@ecopages/radiant/server/render-component` before using instance SSR methods.',\n\t\t);\n\t}\n\n\treturn runtime;\n}\n\nfunction shouldHydrateOnConnect(component: HTMLElement): boolean {\n\treturn isRadiantHydratorInstalled() && hasHydrationMarkers(component);\n}\n\nfunction escapeScriptText(value: string): string {\n\treturn value.replace(/</g, '\\\\u003c');\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "4RAAA,wBACC,OACA,GACA,MACA,sBAID,mBAAS,YAAU,0BA0CZ,MAAM,UAAuD,CAAyB,CACpF,YAAc,GACd,sBAAwB,GACxB,kBAAoB,GACpB,YAAc,GACd,qBAAuB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