@ecopages/radiant 0.3.0-beta.0 → 0.3.0-beta.2
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 +5 -5
- package/client/app-bootstrap.js +3 -0
- package/{dist/client → client}/app-bootstrap.js.map +2 -2
- package/client/hydrator.js +3 -0
- package/{dist/client → client}/hydrator.js.map +2 -2
- package/client/install-hydrator.js +3 -0
- package/{dist/client → client}/install-hydrator.js.map +2 -2
- package/context/context-consumer-bootstrap.js +3 -0
- package/{dist/context → context}/context-consumer-bootstrap.js.map +4 -4
- package/context/context-consumer-runtime.js +3 -0
- package/context/context-consumer-runtime.js.map +12 -0
- package/context/context-host.js +3 -0
- package/{dist/context → context}/context-host.js.map +2 -2
- package/context/context-provider.js +3 -0
- package/{dist/context → context}/context-provider.js.map +3 -3
- package/context/context-ssr-bridge.js +3 -0
- package/{dist/context → context}/context-ssr-bridge.js.map +2 -2
- package/context/create-context.js +3 -0
- package/{dist/context → context}/create-context.js.map +2 -2
- package/context/decorators/consume-context.js +3 -0
- package/{dist/context → context}/decorators/consume-context.js.map +5 -5
- package/context/decorators/context-selection-delivery.js +3 -0
- package/{dist/context → context}/decorators/context-selection-delivery.js.map +2 -2
- package/context/decorators/context-selector.js +3 -0
- package/{dist/context → context}/decorators/context-selector.js.map +6 -6
- package/context/decorators/legacy/consume-context.js +3 -0
- package/context/decorators/legacy/consume-context.js.map +16 -0
- package/context/decorators/legacy/context-selector-field.js +3 -0
- package/context/decorators/legacy/context-selector-field.js.map +17 -0
- package/context/decorators/legacy/context-selector.js +3 -0
- package/context/decorators/legacy/context-selector.js.map +17 -0
- package/context/decorators/legacy/provide-context.js +3 -0
- package/{dist/context → context}/decorators/legacy/provide-context.js.map +4 -4
- package/context/decorators/on-context-update.js +3 -0
- package/{dist/context → context}/decorators/on-context-update.js.map +5 -5
- package/context/decorators/provide-context.js +3 -0
- package/{dist/context → context}/decorators/provide-context.js.map +4 -4
- package/context/decorators/standard/consume-context.js +3 -0
- package/{dist/context → context}/decorators/standard/consume-context.js.map +4 -4
- package/context/decorators/standard/context-selector-field.js +3 -0
- package/{dist/context → context}/decorators/standard/context-selector-field.js.map +4 -4
- package/context/decorators/standard/context-selector.js +3 -0
- package/{dist/context → context}/decorators/standard/context-selector.js.map +4 -4
- package/context/decorators/standard/provide-context.js +3 -0
- package/{dist/context → context}/decorators/standard/provide-context.js.map +3 -3
- package/context/decorators/standard-legacy-dispatch.js +3 -0
- package/context/decorators/standard-legacy-dispatch.js.map +10 -0
- package/context/events.js +3 -0
- package/context/events.js.map +10 -0
- package/context/hydration-script.js +3 -0
- package/{dist/context → context}/hydration-script.js.map +2 -2
- package/context/index.js +3 -0
- package/{dist/context → context}/index.js.map +6 -6
- package/controller-registry.js +3 -0
- package/{dist/controller-registry.js.map → controller-registry.js.map} +3 -3
- package/core/controller-metadata.js +3 -0
- package/{dist/core → core}/controller-metadata.js.map +2 -2
- package/core/custom-element-metadata.js +3 -0
- package/{dist/core → core}/custom-element-metadata.js.map +2 -2
- package/core/event-subscription-registry.js +3 -0
- package/{dist/core → core}/event-subscription-registry.js.map +2 -2
- package/core/host-ssr-registry.js +3 -0
- package/{dist/core → core}/host-ssr-registry.js.map +2 -2
- package/core/hydration-capable-host.js +3 -0
- package/{dist/core → core}/hydration-capable-host.js.map +2 -2
- package/core/hydration-codec.js +3 -0
- package/{dist/core → core}/hydration-codec.js.map +2 -2
- package/{dist/core → core}/radiant-controller.d.ts +7 -5
- package/core/radiant-controller.js +3 -0
- package/core/radiant-controller.js.map +21 -0
- package/core/radiant-element-ssr-host.js +3 -0
- package/{dist/core → core}/radiant-element-ssr-host.js.map +2 -2
- package/{dist/core → core}/radiant-element-ssr-registry.d.ts +4 -2
- package/core/radiant-element-ssr-registry.js +3 -0
- package/core/radiant-element-ssr-registry.js.map +10 -0
- package/{dist/core → core}/radiant-element.d.ts +18 -15
- package/core/radiant-element.js +3 -0
- package/core/radiant-element.js.map +31 -0
- package/core/radiant-hydrator-state.js +3 -0
- package/{dist/core → core}/radiant-hydrator-state.js.map +2 -2
- package/core/reactive-binding-adapter.d.ts +10 -0
- package/core/reactive-binding-adapter.js +3 -0
- package/core/reactive-binding-adapter.js.map +10 -0
- package/core/reactive-host.d.ts +138 -0
- package/core/reactive-host.js +3 -0
- package/core/reactive-host.js.map +13 -0
- package/{dist/core → core}/reactive-jsx-value.d.ts +2 -2
- package/core/reactive-jsx-value.js +3 -0
- package/core/reactive-jsx-value.js.map +10 -0
- package/{dist/core → core}/reactive-prop-core.d.ts +6 -11
- package/core/reactive-prop-core.js +3 -0
- package/{dist/core → core}/reactive-prop-core.js.map +3 -3
- package/core/reactive-prop-metadata.js +3 -0
- package/{dist/core → core}/reactive-prop-metadata.js.map +2 -2
- package/{dist/core → core}/reactive-property-state.d.ts +5 -2
- package/core/reactive-property-state.js +3 -0
- package/core/reactive-property-state.js.map +12 -0
- package/core/reactivity-adapter.js +3 -0
- package/core/reactivity-adapter.js.map +12 -0
- package/{dist/core → core}/reactivity-contract.d.ts +14 -0
- package/core/reactivity-runtime.js +3 -0
- package/core/reactivity-runtime.js.map +11 -0
- package/core/reactivity-signals.js +3 -0
- package/core/reactivity-signals.js.map +10 -0
- package/core/render-runtime.js +3 -0
- package/{dist/core → core}/render-runtime.js.map +3 -3
- package/core/render-scheduler.js +3 -0
- package/{dist/core → core}/render-scheduler.js.map +2 -2
- package/core/slot-projection-runtime.js +3 -0
- package/{dist/core → core}/slot-projection-runtime.js.map +2 -2
- package/core/ssr-preparation.js +3 -0
- package/{dist/core → core}/ssr-preparation.js.map +2 -2
- package/decorators/attr.js +3 -0
- package/decorators/attr.js.map +18 -0
- package/decorators/bound.js +3 -0
- package/{dist/decorators → decorators}/bound.js.map +2 -2
- package/decorators/bridge.js +3 -0
- package/{dist/decorators → decorators}/bridge.js.map +2 -2
- package/decorators/controller.js +3 -0
- package/{dist/decorators → decorators}/controller.js.map +3 -3
- package/decorators/custom-element.js +3 -0
- package/{dist/decorators → decorators}/custom-element.js.map +2 -2
- package/decorators/debounce.js +3 -0
- package/{dist/decorators → decorators}/debounce.js.map +2 -2
- package/decorators/event.js +3 -0
- package/{dist/decorators → decorators}/event.js.map +3 -3
- package/decorators/legacy/attr.js +3 -0
- package/decorators/legacy/attr.js.map +15 -0
- package/decorators/legacy/bound.js +3 -0
- package/{dist/decorators → decorators}/legacy/bound.js.map +2 -2
- package/decorators/legacy/custom-element.js +3 -0
- package/{dist/decorators → decorators}/legacy/custom-element.js.map +2 -2
- package/decorators/legacy/debounce.js +3 -0
- package/{dist/decorators → decorators}/legacy/debounce.js.map +2 -2
- package/decorators/legacy/event.js +3 -0
- package/decorators/legacy/event.js.map +13 -0
- package/decorators/legacy/host-readiness.js +3 -0
- package/decorators/legacy/host-readiness.js.map +11 -0
- package/{dist/decorators → decorators}/legacy/instance-initializers.d.ts +4 -2
- package/decorators/legacy/instance-initializers.js +3 -0
- package/decorators/legacy/instance-initializers.js.map +10 -0
- package/decorators/legacy/member-bootstrap.d.ts +10 -0
- package/decorators/legacy/member-bootstrap.js +3 -0
- package/decorators/legacy/member-bootstrap.js.map +10 -0
- package/decorators/legacy/on-event.js +3 -0
- package/{dist/decorators → decorators}/legacy/on-event.js.map +3 -3
- package/decorators/legacy/on-updated.js +3 -0
- package/decorators/legacy/on-updated.js.map +11 -0
- package/decorators/legacy/query-slot.js +3 -0
- package/decorators/legacy/query-slot.js.map +13 -0
- package/decorators/legacy/query.js +3 -0
- package/decorators/legacy/query.js.map +12 -0
- package/decorators/legacy/reactive-field.js +3 -0
- package/decorators/legacy/reactive-field.js.map +13 -0
- package/{dist/decorators → decorators}/legacy/reactive-prop.d.ts +0 -1
- package/decorators/legacy/reactive-prop.js +3 -0
- package/decorators/legacy/reactive-prop.js.map +15 -0
- package/decorators/legacy/signal.js +3 -0
- package/decorators/legacy/signal.js.map +17 -0
- package/decorators/on-event.js +3 -0
- package/{dist/decorators → decorators}/on-event.js.map +3 -3
- package/decorators/on-updated.js +3 -0
- package/{dist/decorators → decorators}/on-updated.js.map +3 -3
- package/{dist/decorators → decorators}/prop.d.ts +4 -5
- package/decorators/prop.js +3 -0
- package/decorators/prop.js.map +18 -0
- package/decorators/query-slot.js +3 -0
- package/{dist/decorators → decorators}/query-slot.js.map +3 -3
- package/decorators/query.js +3 -0
- package/{dist/decorators → decorators}/query.js.map +3 -3
- package/decorators/shared/auto-bind.d.ts +7 -0
- package/decorators/shared/auto-bind.js +3 -0
- package/decorators/shared/auto-bind.js.map +10 -0
- package/decorators/shared/reactive-attr.js +3 -0
- package/decorators/shared/reactive-attr.js.map +13 -0
- package/decorators/signal.js +3 -0
- package/decorators/signal.js.map +19 -0
- package/decorators/standard/attr.js +3 -0
- package/decorators/standard/attr.js.map +14 -0
- package/decorators/standard/bound.js +3 -0
- package/{dist/decorators → decorators}/standard/bound.js.map +2 -2
- package/decorators/standard/custom-element.js +3 -0
- package/{dist/decorators → decorators}/standard/custom-element.js.map +2 -2
- package/decorators/standard/debounce.js +3 -0
- package/{dist/decorators → decorators}/standard/debounce.js.map +2 -2
- package/decorators/standard/event.js +3 -0
- package/{dist/decorators → decorators}/standard/event.js.map +2 -2
- package/decorators/standard/on-event.js +3 -0
- package/{dist/decorators → decorators}/standard/on-event.js.map +2 -2
- package/decorators/standard/on-updated.js +3 -0
- package/{dist/decorators → decorators}/standard/on-updated.js.map +2 -2
- package/decorators/standard/query-slot.js +3 -0
- package/{dist/decorators → decorators}/standard/query-slot.js.map +2 -2
- package/decorators/standard/query.js +3 -0
- package/{dist/decorators → decorators}/standard/query.js.map +2 -2
- package/decorators/standard/reactive-field.js +3 -0
- package/decorators/standard/reactive-field.js.map +11 -0
- package/decorators/standard/reactive-prop.js +3 -0
- package/{dist/decorators → decorators}/standard/reactive-prop.js.map +4 -4
- package/decorators/standard/signal.js +3 -0
- package/decorators/standard/signal.js.map +16 -0
- package/{dist/decorators → decorators}/state.d.ts +3 -2
- package/decorators/state.js +3 -0
- package/decorators/state.js.map +16 -0
- package/helpers/create-event-listener.js +3 -0
- package/{dist/helpers → helpers}/create-event-listener.js.map +2 -2
- package/helpers/create-event.js +3 -0
- package/{dist/helpers → helpers}/create-event.js.map +2 -2
- package/helpers/create-query-slot.js +3 -0
- package/{dist/helpers → helpers}/create-query-slot.js.map +2 -2
- package/helpers/create-query.js +3 -0
- package/{dist/helpers → helpers}/create-query.js.map +2 -2
- package/helpers/debounce.js +3 -0
- package/{dist/helpers → helpers}/debounce.js.map +2 -2
- package/helpers/index.js +3 -0
- package/{dist/helpers → helpers}/index.js.map +2 -2
- package/index.js +3 -0
- package/index.js.map +86 -0
- package/package.json +99 -129
- package/server/context-ssr.js +3 -0
- package/{dist/server → server}/context-ssr.js.map +2 -2
- package/server/host-attribute-serialization.js +3 -0
- package/{dist/server → server}/host-attribute-serialization.js.map +5 -5
- package/server/host-script-composition.js +3 -0
- package/{dist/server → server}/host-script-composition.js.map +2 -2
- package/server/html-parser.js +3 -0
- package/{dist/server → server}/html-parser.js.map +2 -2
- package/server/install-light-dom-shim.js +3 -0
- package/server/install-light-dom-shim.js.map +17 -0
- package/server/internal-radiant-host.js +3 -0
- package/{dist/server → server}/internal-radiant-host.js.map +1 -1
- package/server/light-dom-shim.d.ts +2 -0
- package/server/light-dom-shim.js +3 -0
- package/server/light-dom-shim.js.map +16 -0
- package/server/minimal-dom/document.d.ts +17 -0
- package/server/minimal-dom/document.js +3 -0
- package/server/minimal-dom/document.js.map +14 -0
- package/server/minimal-dom/html.d.ts +7 -0
- package/server/minimal-dom/html.js +3 -0
- package/server/minimal-dom/html.js.map +13 -0
- package/{dist/server/light-dom-shim.d.ts → server/minimal-dom/install.d.ts} +1 -4
- package/server/minimal-dom/install.js +3 -0
- package/server/minimal-dom/install.js.map +16 -0
- package/server/minimal-dom/nodes.d.ts +78 -0
- package/server/project-root.js +3 -0
- package/{dist/server → server}/project-root.js.map +2 -2
- package/server/radiant-element-ssr-bridge.js +3 -0
- package/{dist/server → server}/radiant-element-ssr-bridge.js.map +9 -9
- package/server/radiant-element-ssr-extractor.js +3 -0
- package/{dist/server → server}/radiant-element-ssr-extractor.js.map +3 -3
- package/server/radiant-element-ssr-service.js +3 -0
- package/{dist/server → server}/radiant-element-ssr-service.js.map +8 -8
- package/server/radiant-element-ssr.js +3 -0
- package/{dist/server → server}/radiant-element-ssr.js.map +9 -9
- package/{dist/server → server}/render-component.d.ts +1 -1
- package/server/render-component.js +3 -0
- package/server/render-component.js.map +32 -0
- package/server/render-controller.js +3 -0
- package/server/render-controller.js.map +35 -0
- package/server/render-fragment.js +3 -0
- package/server/render-fragment.js.map +10 -0
- package/server/slot-projection-html.js +3 -0
- package/{dist/server → server}/slot-projection-html.js.map +4 -4
- package/signals/host-resource.js +3 -0
- package/{dist/signals → signals}/host-resource.js.map +2 -2
- package/{dist/signals → signals}/host-signal.d.ts +2 -1
- package/signals/host-signal.js +3 -0
- package/signals/host-signal.js.map +13 -0
- package/signals/hydration-script.js +3 -0
- package/{dist/signals → signals}/hydration-script.js.map +2 -2
- package/tools/escape-css-identifier.js +3 -0
- package/{dist/tools → tools}/escape-css-identifier.js.map +2 -2
- package/tools/escape-script-json.js +3 -0
- package/{dist/tools → tools}/escape-script-json.js.map +2 -2
- package/tools/event-emitter.js +3 -0
- package/{dist/tools → tools}/event-emitter.js.map +2 -2
- package/tools/index.js +3 -0
- package/{dist/tools → tools}/index.js.map +2 -2
- package/tools/render-jsx-template.js +3 -0
- package/{dist/tools → tools}/render-jsx-template.js.map +2 -2
- package/types.js +3 -0
- package/{dist/types.js.map → types.js.map} +2 -2
- package/utils/attribute-utils.js +3 -0
- package/{dist/utils → utils}/attribute-utils.js.map +2 -2
- package/utils/escape-html-attribute.js +3 -0
- package/{dist/utils → utils}/escape-html-attribute.js.map +2 -2
- package/utils/index.js +3 -0
- package/{dist/utils → utils}/index.js.map +2 -2
- package/dist/LICENSE +0 -21
- package/dist/README.md +0 -315
- package/dist/client/app-bootstrap.js +0 -3
- package/dist/client/hydrator.js +0 -3
- package/dist/client/install-hydrator.js +0 -3
- package/dist/context/context-consumer-bootstrap.js +0 -3
- package/dist/context/context-consumer-runtime.js +0 -3
- package/dist/context/context-consumer-runtime.js.map +0 -12
- package/dist/context/context-host.js +0 -3
- package/dist/context/context-provider.js +0 -3
- package/dist/context/context-ssr-bridge.js +0 -3
- package/dist/context/create-context.js +0 -3
- package/dist/context/decorators/consume-context.js +0 -3
- package/dist/context/decorators/context-selection-delivery.js +0 -3
- package/dist/context/decorators/context-selector.js +0 -3
- package/dist/context/decorators/legacy/consume-context.js +0 -3
- package/dist/context/decorators/legacy/consume-context.js.map +0 -16
- package/dist/context/decorators/legacy/context-selector-field.js +0 -3
- package/dist/context/decorators/legacy/context-selector-field.js.map +0 -17
- package/dist/context/decorators/legacy/context-selector.js +0 -3
- package/dist/context/decorators/legacy/context-selector.js.map +0 -17
- package/dist/context/decorators/legacy/provide-context.js +0 -3
- package/dist/context/decorators/on-context-update.js +0 -3
- package/dist/context/decorators/provide-context.js +0 -3
- package/dist/context/decorators/standard/consume-context.js +0 -3
- package/dist/context/decorators/standard/context-selector-field.js +0 -3
- package/dist/context/decorators/standard/context-selector.js +0 -3
- package/dist/context/decorators/standard/provide-context.js +0 -3
- package/dist/context/decorators/standard-legacy-dispatch.js +0 -3
- package/dist/context/decorators/standard-legacy-dispatch.js.map +0 -10
- package/dist/context/events.js +0 -3
- package/dist/context/events.js.map +0 -10
- package/dist/context/hydration-script.js +0 -3
- package/dist/context/index.js +0 -3
- package/dist/controller-registry.js +0 -3
- package/dist/core/controller-metadata.js +0 -3
- package/dist/core/custom-element-metadata.js +0 -3
- package/dist/core/event-subscription-registry.js +0 -3
- package/dist/core/host-ssr-registry.js +0 -3
- package/dist/core/hydration-capable-host.js +0 -3
- package/dist/core/hydration-codec.js +0 -3
- package/dist/core/radiant-controller.js +0 -3
- package/dist/core/radiant-controller.js.map +0 -20
- package/dist/core/radiant-element-ssr-host.js +0 -3
- package/dist/core/radiant-element-ssr-registry.js +0 -3
- package/dist/core/radiant-element-ssr-registry.js.map +0 -10
- package/dist/core/radiant-element.js +0 -3
- package/dist/core/radiant-element.js.map +0 -30
- package/dist/core/radiant-hydrator-state.js +0 -3
- package/dist/core/reactive-host.d.ts +0 -124
- package/dist/core/reactive-host.js +0 -3
- package/dist/core/reactive-host.js.map +0 -13
- package/dist/core/reactive-jsx-value.js +0 -3
- package/dist/core/reactive-jsx-value.js.map +0 -10
- package/dist/core/reactive-prop-core.js +0 -3
- package/dist/core/reactive-prop-metadata.js +0 -3
- package/dist/core/reactive-property-state.js +0 -3
- package/dist/core/reactive-property-state.js.map +0 -12
- package/dist/core/reactivity-adapter.js +0 -3
- package/dist/core/reactivity-adapter.js.map +0 -12
- package/dist/core/reactivity-runtime.js +0 -3
- package/dist/core/reactivity-runtime.js.map +0 -11
- package/dist/core/reactivity-signals.js +0 -3
- package/dist/core/reactivity-signals.js.map +0 -10
- package/dist/core/render-runtime.js +0 -3
- package/dist/core/render-scheduler.js +0 -3
- package/dist/core/slot-projection-runtime.js +0 -3
- package/dist/core/ssr-preparation.js +0 -3
- package/dist/decorators/attr.js +0 -3
- package/dist/decorators/attr.js.map +0 -17
- package/dist/decorators/bound.js +0 -3
- package/dist/decorators/bridge.js +0 -3
- package/dist/decorators/controller.js +0 -3
- package/dist/decorators/custom-element.js +0 -3
- package/dist/decorators/debounce.js +0 -3
- package/dist/decorators/event.js +0 -3
- package/dist/decorators/legacy/attr.js +0 -3
- package/dist/decorators/legacy/attr.js.map +0 -14
- package/dist/decorators/legacy/bound.js +0 -3
- package/dist/decorators/legacy/custom-element.js +0 -3
- package/dist/decorators/legacy/debounce.js +0 -3
- package/dist/decorators/legacy/event.js +0 -3
- package/dist/decorators/legacy/event.js.map +0 -13
- package/dist/decorators/legacy/host-readiness.js +0 -3
- package/dist/decorators/legacy/host-readiness.js.map +0 -11
- package/dist/decorators/legacy/instance-initializers.js +0 -3
- package/dist/decorators/legacy/instance-initializers.js.map +0 -10
- package/dist/decorators/legacy/on-event.js +0 -3
- package/dist/decorators/legacy/on-updated.js +0 -3
- package/dist/decorators/legacy/on-updated.js.map +0 -11
- package/dist/decorators/legacy/query-slot.js +0 -3
- package/dist/decorators/legacy/query-slot.js.map +0 -13
- package/dist/decorators/legacy/query.js +0 -3
- package/dist/decorators/legacy/query.js.map +0 -12
- package/dist/decorators/legacy/reactive-field.js +0 -3
- package/dist/decorators/legacy/reactive-field.js.map +0 -11
- package/dist/decorators/legacy/reactive-prop.js +0 -3
- package/dist/decorators/legacy/reactive-prop.js.map +0 -14
- package/dist/decorators/legacy/signal.js +0 -3
- package/dist/decorators/legacy/signal.js.map +0 -16
- package/dist/decorators/on-event.js +0 -3
- package/dist/decorators/on-updated.js +0 -3
- package/dist/decorators/prop.js +0 -3
- package/dist/decorators/prop.js.map +0 -17
- package/dist/decorators/query-slot.js +0 -3
- package/dist/decorators/query.js +0 -3
- package/dist/decorators/shared/reactive-attr.js +0 -3
- package/dist/decorators/shared/reactive-attr.js.map +0 -12
- package/dist/decorators/signal.js +0 -3
- package/dist/decorators/signal.js.map +0 -18
- package/dist/decorators/standard/attr.js +0 -3
- package/dist/decorators/standard/attr.js.map +0 -13
- package/dist/decorators/standard/bound.js +0 -3
- package/dist/decorators/standard/custom-element.js +0 -3
- package/dist/decorators/standard/debounce.js +0 -3
- package/dist/decorators/standard/event.js +0 -3
- package/dist/decorators/standard/on-event.js +0 -3
- package/dist/decorators/standard/on-updated.js +0 -3
- package/dist/decorators/standard/query-slot.js +0 -3
- package/dist/decorators/standard/query.js +0 -3
- package/dist/decorators/standard/reactive-field.js +0 -3
- package/dist/decorators/standard/reactive-field.js.map +0 -10
- package/dist/decorators/standard/reactive-prop.js +0 -3
- package/dist/decorators/standard/signal.js +0 -3
- package/dist/decorators/standard/signal.js.map +0 -15
- package/dist/decorators/state.js +0 -3
- package/dist/decorators/state.js.map +0 -14
- package/dist/helpers/create-event-listener.js +0 -3
- package/dist/helpers/create-event.js +0 -3
- package/dist/helpers/create-query-slot.js +0 -3
- package/dist/helpers/create-query.js +0 -3
- package/dist/helpers/debounce.js +0 -3
- package/dist/helpers/index.js +0 -3
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -83
- package/dist/package.json +0 -209
- package/dist/server/context-ssr.js +0 -3
- package/dist/server/host-attribute-serialization.js +0 -3
- package/dist/server/host-script-composition.js +0 -3
- package/dist/server/html-parser.js +0 -3
- package/dist/server/install-light-dom-shim.js +0 -3
- package/dist/server/install-light-dom-shim.js.map +0 -12
- package/dist/server/internal-radiant-host.js +0 -3
- package/dist/server/light-dom-shim.js +0 -3
- package/dist/server/light-dom-shim.js.map +0 -11
- package/dist/server/project-root.js +0 -3
- package/dist/server/radiant-element-ssr-bridge.js +0 -3
- package/dist/server/radiant-element-ssr-extractor.js +0 -3
- package/dist/server/radiant-element-ssr-service.js +0 -3
- package/dist/server/radiant-element-ssr.js +0 -3
- package/dist/server/render-component.js +0 -3
- package/dist/server/render-component.js.map +0 -28
- package/dist/server/render-controller.js +0 -3
- package/dist/server/render-controller.js.map +0 -31
- package/dist/server/render-fragment.js +0 -3
- package/dist/server/render-fragment.js.map +0 -10
- package/dist/server/slot-projection-html.js +0 -3
- package/dist/signals/host-resource.js +0 -3
- package/dist/signals/host-signal.js +0 -3
- package/dist/signals/host-signal.js.map +0 -13
- package/dist/signals/hydration-script.js +0 -3
- package/dist/tools/escape-css-identifier.js +0 -3
- package/dist/tools/escape-script-json.js +0 -3
- package/dist/tools/event-emitter.js +0 -3
- package/dist/tools/index.js +0 -3
- package/dist/tools/render-jsx-template.js +0 -3
- package/dist/types.js +0 -3
- package/dist/utils/attribute-utils.js +0 -3
- package/dist/utils/escape-html-attribute.js +0 -3
- package/dist/utils/index.js +0 -3
- /package/{dist/client → client}/app-bootstrap.d.ts +0 -0
- /package/{dist/client → client}/hydrator.d.ts +0 -0
- /package/{dist/client → client}/install-hydrator.d.ts +0 -0
- /package/{dist/context → context}/context-consumer-bootstrap.d.ts +0 -0
- /package/{dist/context → context}/context-consumer-runtime.d.ts +0 -0
- /package/{dist/context → context}/context-host.d.ts +0 -0
- /package/{dist/context → context}/context-provider.d.ts +0 -0
- /package/{dist/context → context}/context-ssr-bridge.d.ts +0 -0
- /package/{dist/context → context}/create-context.d.ts +0 -0
- /package/{dist/context → context}/decorators/consume-context.d.ts +0 -0
- /package/{dist/context → context}/decorators/context-selection-delivery.d.ts +0 -0
- /package/{dist/context → context}/decorators/context-selector.d.ts +0 -0
- /package/{dist/context → context}/decorators/legacy/consume-context.d.ts +0 -0
- /package/{dist/context → context}/decorators/legacy/context-selector-field.d.ts +0 -0
- /package/{dist/context → context}/decorators/legacy/context-selector.d.ts +0 -0
- /package/{dist/context → context}/decorators/legacy/provide-context.d.ts +0 -0
- /package/{dist/context → context}/decorators/on-context-update.d.ts +0 -0
- /package/{dist/context → context}/decorators/provide-context.d.ts +0 -0
- /package/{dist/context → context}/decorators/standard/consume-context.d.ts +0 -0
- /package/{dist/context → context}/decorators/standard/context-selector-field.d.ts +0 -0
- /package/{dist/context → context}/decorators/standard/context-selector.d.ts +0 -0
- /package/{dist/context → context}/decorators/standard/provide-context.d.ts +0 -0
- /package/{dist/context → context}/decorators/standard-legacy-dispatch.d.ts +0 -0
- /package/{dist/context → context}/events.d.ts +0 -0
- /package/{dist/context → context}/hydration-script.d.ts +0 -0
- /package/{dist/context → context}/index.d.ts +0 -0
- /package/{dist/context → context}/types.d.ts +0 -0
- /package/{dist/context → context}/types.js +0 -0
- /package/{dist/context → context}/types.js.map +0 -0
- /package/{dist/controller-registry.d.ts → controller-registry.d.ts} +0 -0
- /package/{dist/core → core}/controller-metadata.d.ts +0 -0
- /package/{dist/core → core}/custom-element-metadata.d.ts +0 -0
- /package/{dist/core → core}/event-subscription-registry.d.ts +0 -0
- /package/{dist/core → core}/host-ssr-registry.d.ts +0 -0
- /package/{dist/core → core}/hydration-capable-host.d.ts +0 -0
- /package/{dist/core → core}/hydration-codec.d.ts +0 -0
- /package/{dist/core → core}/radiant-element-ssr-host.d.ts +0 -0
- /package/{dist/core → core}/radiant-hydrator-state.d.ts +0 -0
- /package/{dist/core → core}/reactive-prop-metadata.d.ts +0 -0
- /package/{dist/core → core}/reactivity-adapter.d.ts +0 -0
- /package/{dist/core → core}/reactivity-contract.js +0 -0
- /package/{dist/core → core}/reactivity-contract.js.map +0 -0
- /package/{dist/core → core}/reactivity-runtime.d.ts +0 -0
- /package/{dist/core → core}/reactivity-signals.d.ts +0 -0
- /package/{dist/core → core}/render-runtime.d.ts +0 -0
- /package/{dist/core → core}/render-scheduler.d.ts +0 -0
- /package/{dist/core → core}/slot-projection-runtime.d.ts +0 -0
- /package/{dist/core → core}/ssr-hydration-binding.d.ts +0 -0
- /package/{dist/core → core}/ssr-hydration-binding.js +0 -0
- /package/{dist/core → core}/ssr-hydration-binding.js.map +0 -0
- /package/{dist/core → core}/ssr-preparation.d.ts +0 -0
- /package/{dist/decorators → decorators}/attr.d.ts +0 -0
- /package/{dist/decorators → decorators}/bound.d.ts +0 -0
- /package/{dist/decorators → decorators}/bridge.d.ts +0 -0
- /package/{dist/decorators → decorators}/controller.d.ts +0 -0
- /package/{dist/decorators → decorators}/custom-element.d.ts +0 -0
- /package/{dist/decorators → decorators}/debounce.d.ts +0 -0
- /package/{dist/decorators → decorators}/event.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/attr.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/bound.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/custom-element.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/debounce.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/event.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/host-readiness.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/on-event.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/on-updated.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/query-slot.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/query.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/reactive-field.d.ts +0 -0
- /package/{dist/decorators → decorators}/legacy/signal.d.ts +0 -0
- /package/{dist/decorators → decorators}/on-event.d.ts +0 -0
- /package/{dist/decorators → decorators}/on-updated.d.ts +0 -0
- /package/{dist/decorators → decorators}/query-slot.d.ts +0 -0
- /package/{dist/decorators → decorators}/query.d.ts +0 -0
- /package/{dist/decorators → decorators}/shared/reactive-attr.d.ts +0 -0
- /package/{dist/decorators → decorators}/signal.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/attr.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/bound.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/custom-element.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/debounce.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/event.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/on-event.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/on-updated.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/query-slot.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/query.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/reactive-field.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/reactive-prop.d.ts +0 -0
- /package/{dist/decorators → decorators}/standard/signal.d.ts +0 -0
- /package/{dist/helpers → helpers}/create-event-listener.d.ts +0 -0
- /package/{dist/helpers → helpers}/create-event.d.ts +0 -0
- /package/{dist/helpers → helpers}/create-query-slot.d.ts +0 -0
- /package/{dist/helpers → helpers}/create-query.d.ts +0 -0
- /package/{dist/helpers → helpers}/debounce.d.ts +0 -0
- /package/{dist/helpers → helpers}/index.d.ts +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/server → server}/context-ssr.d.ts +0 -0
- /package/{dist/server → server}/host-attribute-serialization.d.ts +0 -0
- /package/{dist/server → server}/host-script-composition.d.ts +0 -0
- /package/{dist/server → server}/html-parser.d.ts +0 -0
- /package/{dist/server → server}/install-light-dom-shim.d.ts +0 -0
- /package/{dist/server → server}/internal-radiant-host.d.ts +0 -0
- /package/{dist/server → server}/project-root.d.ts +0 -0
- /package/{dist/server → server}/radiant-element-ssr-bridge.d.ts +0 -0
- /package/{dist/server → server}/radiant-element-ssr-extractor.d.ts +0 -0
- /package/{dist/server → server}/radiant-element-ssr-service.d.ts +0 -0
- /package/{dist/server → server}/radiant-element-ssr.d.ts +0 -0
- /package/{dist/server → server}/render-controller.d.ts +0 -0
- /package/{dist/server → server}/render-fragment.d.ts +0 -0
- /package/{dist/server → server}/slot-projection-html.d.ts +0 -0
- /package/{dist/signals → signals}/host-resource.d.ts +0 -0
- /package/{dist/signals → signals}/hydration-script.d.ts +0 -0
- /package/{dist/tools → tools}/escape-css-identifier.d.ts +0 -0
- /package/{dist/tools → tools}/escape-script-json.d.ts +0 -0
- /package/{dist/tools → tools}/event-emitter.d.ts +0 -0
- /package/{dist/tools → tools}/index.d.ts +0 -0
- /package/{dist/tools → tools}/render-jsx-template.d.ts +0 -0
- /package/{dist/types.d.ts → types.d.ts} +0 -0
- /package/{dist/utils → utils}/attribute-utils.d.ts +0 -0
- /package/{dist/utils → utils}/escape-html-attribute.d.ts +0 -0
- /package/{dist/utils → utils}/index.d.ts +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utils/attribute-utils.ts", "../src/core/reactive-prop-core.ts", "../src/decorators/shared/auto-bind.ts", "../src/decorators/shared/reactive-attr.ts", "../src/decorators/standard/attr.ts"],
|
|
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",
|
|
6
|
+
"import type { JsxBindingSourceValue, JsxRenderable, SubscribableJsxValueWithAccess } from '@ecopages/jsx';\nimport type { ReactiveState } from './reactivity-contract';\nimport {\n\ttype AttributeTypeConstant,\n\ttype ReadAttributeValueReturnType,\n\ttype WriteAttributeValueReturnType,\n\tisValueOfType,\n\treadAttributeValue,\n\twriteAttributeValue,\n} from '../utils/attribute-utils';\n\ntype StringPropertyKey<Value> = Extract<keyof Value, string>;\n\nexport interface ReactiveProperty<T = unknown> {\n\ttype: AttributeTypeConstant;\n\tinitialValue?: T;\n\tname: string;\n\tattribute: string;\n\tconverter: {\n\t\tfromAttribute: (value: string) => ReadAttributeValueReturnType;\n\t\ttoAttribute: (value: any) => WriteAttributeValueReturnType;\n\t};\n}\n\nexport type ReactivePropertyOptions<T> = {\n\ttype: AttributeTypeConstant;\n\treflect?: boolean;\n\tattribute?: string;\n\tdefaultValue?: T;\n\tbind?: boolean | string;\n};\n\nexport type ReactiveBindingOption = boolean | string;\n\nexport type ReactiveFieldOptions = {\n\tbind?: ReactiveBindingOption;\n\t/** When true, skip the initial notifyUpdate emitted while defining the field. */\n\tsuppressInitialNotify?: boolean;\n};\n\nexport type ReactiveBindingValue<\n\tHost extends object,\n\tProperty extends StringPropertyKey<Host>,\n> = Host[Property] extends JsxBindingSourceValue ? Host[Property] : JsxRenderable;\n\nexport type ReactiveBindings<Bindings extends object> = {\n\treadonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValueWithAccess<\n\t\tReactiveBindingValue<Bindings, Property>\n\t>;\n};\n\nexport type ReactiveAccessorDefinition<T> = {\n\tbind?: ReactiveBindingOption;\n\tsignal: ReactiveState<T>;\n\tonSet?: (value: T) => void;\n};\n\nexport function validateReactivePropertyDefault(type: AttributeTypeConstant, defaultValue: unknown): void {\n\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t}\n}\n\nexport function createReactivePropertyMapping<T>(\n\tpropertyName: string,\n\tattributeKey: string,\n\ttype: AttributeTypeConstant,\n\tinitialValue: T | undefined,\n): ReactiveProperty<T> {\n\treturn {\n\t\ttype,\n\t\tname: propertyName,\n\t\tinitialValue,\n\t\tattribute: attributeKey,\n\t\tconverter: {\n\t\t\tfromAttribute: (value) => readAttributeValue(value, type),\n\t\t\ttoAttribute: (value) => writeAttributeValue(value, type),\n\t\t},\n\t};\n}\n",
|
|
7
|
+
"import type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\ntype AutoBindHost = ReactiveHostLike & {\n\tshouldAutoBindReactiveMembers?: () => boolean;\n};\n\nexport function resolveHostAutoBind(host: AutoBindHost): ReactiveBindingOption {\n\treturn host.shouldAutoBindReactiveMembers?.() ?? false;\n}\n",
|
|
8
|
+
"import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { type ReactiveBindingOption, validateReactivePropertyDefault } from '../../core/reactive-prop-core';\nimport { resolveHostAutoBind } from './auto-bind';\nimport {\n\tdefaultValueForType,\n\treadAttributeValue,\n\ttype AttributeTypeConstant,\n\twriteAttributeValue,\n} from '../../utils/attribute-utils';\n\nexport type AttrConverter<T> = {\n\tfromAttribute?: (value: string | null) => T;\n\ttoAttribute?: (value: T) => string | null;\n};\n\nexport type AttrOptions<T = string | undefined> = {\n\tsource?: string;\n\ttype?: AttributeTypeConstant;\n\tbind?: ReactiveBindingOption;\n\tdefaultValue?: T;\n\tconverter?: AttrConverter<T>;\n};\n\ntype ReactiveAttributeHostApi<Bindings extends object = {}> = ReactiveHostLike<Bindings> & {\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\nexport type ReactiveAttributeHostLike<Bindings extends object = {}> =\n\t| (ReactiveAttributeHostApi<Bindings> & Element)\n\t| (ReactiveAttributeHostApi<Bindings> & { host: Element })\n\t| (ReactiveAttributeHostApi<Bindings> & { element: Element });\n\nfunction resolveAttributeTarget(host: ReactiveAttributeHostLike): Element {\n\tif (host instanceof Element) {\n\t\treturn host;\n\t}\n\n\tif ('host' in host) {\n\t\treturn host.host;\n\t}\n\n\treturn host.element;\n}\n\nfunction toAttributeName(propertyName: string): string {\n\treturn propertyName\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t.replace(/_/g, '-')\n\t\t.toLowerCase();\n}\n\nfunction resolveAttributeValue<T>(rawValue: string | null, options: AttrOptions<T>): T {\n\tif (options.converter?.fromAttribute) {\n\t\tconst convertedValue = options.converter.fromAttribute(rawValue);\n\n\t\tif (rawValue === null && convertedValue === undefined && 'defaultValue' in options) {\n\t\t\treturn options.defaultValue as T;\n\t\t}\n\n\t\treturn convertedValue;\n\t}\n\n\tif (options.type) {\n\t\tif (rawValue === null) {\n\t\t\treturn (options.defaultValue ?? defaultValueForType(options.type)) as T;\n\t\t}\n\n\t\tif (options.type === Boolean && rawValue === '') {\n\t\t\treturn true as T;\n\t\t}\n\n\t\treturn readAttributeValue(rawValue, options.type) as T;\n\t}\n\n\tif (rawValue === null) {\n\t\treturn options.defaultValue as T;\n\t}\n\n\treturn rawValue as T;\n}\n\nfunction readReactiveAttributeValue<T>(\n\thost: ReactiveAttributeHostLike,\n\tattributeName: string,\n\toptions: AttrOptions<T>,\n): T {\n\treturn resolveAttributeValue(resolveAttributeTarget(host).getAttribute(attributeName), options);\n}\n\nfunction writeReactiveAttributeValue<T>(\n\ttarget: Element,\n\tattributeName: string,\n\tvalue: T,\n\toptions: AttrOptions<T>,\n): void {\n\tconst attributeValue = options.converter?.toAttribute\n\t\t? options.converter.toAttribute(value)\n\t\t: options.type\n\t\t\t? writeAttributeValue(value, options.type)\n\t\t\t: value == null\n\t\t\t\t? null\n\t\t\t\t: String(value);\n\n\tif (attributeValue === null) {\n\t\ttarget.removeAttribute(attributeName);\n\t\treturn;\n\t}\n\n\ttarget.setAttribute(attributeName, attributeValue);\n}\n\nexport function installReactiveAttribute<TBindings extends object, TValue>(\n\thost: ReactiveAttributeHostLike<TBindings>,\n\tpropertyName: string,\n\toptions: AttrOptions<TValue> = {},\n): void {\n\tif (options.type) {\n\t\tvalidateReactivePropertyDefault(options.type, options.defaultValue);\n\t}\n\n\tconst hostRecord = host as unknown as Record<PropertyKey, unknown>;\n\tconst attributeName = options.source ?? toAttributeName(propertyName);\n\tconst observerKey = Symbol(`@ecopages/radiant/attr:${propertyName}:observer`);\n\tconst bind = options.bind ?? resolveHostAutoBind(host);\n\n\thost.defineReactiveBinding(propertyName, bind);\n\n\tconst initialValue = readReactiveAttributeValue(host, attributeName, options);\n\tconst signal = host.createReactiveMember(propertyName, initialValue);\n\n\tObject.defineProperty(host, propertyName, {\n\t\tget() {\n\t\t\treturn signal.get();\n\t\t},\n\t\tset(newValue: TValue) {\n\t\t\tconst target = resolveAttributeTarget(this as ReactiveAttributeHostLike);\n\t\t\twriteReactiveAttributeValue(target, attributeName, newValue, options);\n\t\t\tsignal.set(readReactiveAttributeValue(this as ReactiveAttributeHostLike, attributeName, options));\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true,\n\t});\n\n\tconst disconnectObserver = () => {\n\t\tconst observer = hostRecord[observerKey] as MutationObserver | undefined;\n\t\tobserver?.disconnect();\n\t};\n\n\tconst syncAndObserve = () => {\n\t\tsignal.set(readReactiveAttributeValue(host, attributeName, options));\n\n\t\tif (typeof MutationObserver === 'undefined') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst target = resolveAttributeTarget(host);\n\n\t\tdisconnectObserver();\n\n\t\tconst observer = new MutationObserver(() => {\n\t\t\tsignal.set(readReactiveAttributeValue(host, attributeName, options));\n\t\t});\n\n\t\tobserver.observe(target, {\n\t\t\tattributeFilter: [attributeName],\n\t\t\tattributes: true,\n\t\t});\n\n\t\thostRecord[observerKey] = observer;\n\t};\n\n\tsyncAndObserve();\n\thost.registerConnectedCallback(syncAndObserve);\n\thost.registerCleanupCallback(disconnectObserver);\n}\n",
|
|
9
|
+
"import { installReactiveAttribute, type AttrOptions, type ReactiveAttributeHostLike } from '../shared/reactive-attr';\n\nexport function reactiveAttr<TValue = string | undefined>(options: AttrOptions<TValue> = {}) {\n\treturn function <THost extends ReactiveAttributeHostLike>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<THost, TValue>,\n\t) {\n\t\tvoid target;\n\t\tconst propertyName = String(context.name);\n\t\tconst initializerValueKey = Symbol(`@ecopages/radiant/attr:${propertyName}:initializer`);\n\n\t\tcontext.addInitializer(function (this: THost) {\n\t\t\tconst initializerValue = (this as Record<PropertyKey, TValue | undefined>)[initializerValueKey];\n\t\t\tconst defaultValue = (options.defaultValue === undefined ? initializerValue : options.defaultValue) as\n\t\t\t\tTValue | undefined;\n\n\t\t\tinstallReactiveAttribute(this, propertyName, {\n\t\t\t\t...options,\n\t\t\t\tdefaultValue,\n\t\t\t});\n\t\t});\n\n\t\treturn function (this: THost, value: TValue) {\n\t\t\t(this as Record<PropertyKey, TValue | undefined>)[initializerValueKey] = value;\n\t\t\treturn value;\n\t\t};\n\t};\n}\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": "i0BAYO,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,EACvB,MAAU,UAAU,8CAA8C,OAAO,IAAQ,EAElF,OAAO,GAGR,OAAO,CAAC,EAAwB,CAC/B,MAAO,EA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C,EAAe,CAAO,CAAC,GAEjG,WAAY,GACZ,aAAc,EACf,CAAC,EAED,IAAM,EAAqB,IAAM,CACf,EAAW,IAClB,WAAW,GAGhB,EAAiB,IAAM,CAG5B,GAFA,EAAO,IAAI,EAA2B,EAAM,EAAe,CAAO,CAAC,EAE/D,OAAO,iBAAqB,IAC/B,OAGD,IAAM,EAAS,EAAuB,CAAI,EAE1C,EAAmB,EAEnB,IAAM,EAAW,IAAI,iBAAiB,IAAM,CAC3C,EAAO,IAAI,EAA2B,EAAM,EAAe,CAAO,CAAC,EACnE,EAED,EAAS,QAAQ,EAAQ,CACxB,gBAAiB,CAAC,CAAa,EAC/B,WAAY,EACb,CAAC,EAED,EAAW,GAAe,GAG3B,EAAe,EACf,EAAK,0BAA0B,CAAc,EAC7C,EAAK,wBAAwB,CAAkB,EC5KzC,SAAS,EAAyC,CAAC,EAA+B,CAAC,EAAG,CAC5F,OAAO,QAAkD,CACxD,EACA,EACC,CAED,IAAM,EAAe,OAAO,EAAQ,IAAI,EAClC,EAAsB,OAAO,0BAA0B,eAA0B,EAavF,OAXA,EAAQ,eAAe,QAAS,EAAc,CAC7C,IAAM,EAAoB,KAAiD,GACrE,EAAgB,EAAQ,eAAiB,OAAY,EAAmB,EAAQ,aAGtF,EAAyB,KAAM,EAAc,IACzC,EACH,cACD,CAAC,EACD,EAEM,QAAS,CAAc,EAAe,CAE5C,OADC,KAAiD,GAAuB,EAClE",
|
|
12
|
+
"debugId": "43A6DBDB56B6C96B64756E2164756E21",
|
|
13
|
+
"names": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:r,getOwnPropertyNames:a,getOwnPropertyDescriptor:s}=Object,d=Object.prototype.hasOwnProperty;function h(t){return this[t]}var c=(t)=>{var e=(n??=new WeakMap).get(t),i;if(e)return e;if(e=r({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function"){for(var o of a(t))if(!d.call(e,o))r(e,o,{get:h.bind(t,o),enumerable:!(i=s(t,o))||i.enumerable})}return n.set(t,e),e},n;var p=(t)=>t;function m(t,e){this[t]=p.bind(null,e)}var f=(t,e)=>{for(var i in e)r(t,i,{get:e[i],enumerable:!0,configurable:!0,set:m.bind(e,i)})};var u=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});function y(t,e){let i=String(e.name);if(e.private)throw Error(`'bound' cannot decorate private properties like ${i}.`);e.addInitializer(function(){this[i]=this[i].bind(this)})}export{y as bound};
|
|
2
|
+
|
|
3
|
+
//# debugId=6C8C8489D0D826CF64756E2164756E21
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { Method } from '../../types';\n\nexport function bound<T extends Method>(_: T, context: ClassMethodDecoratorContext) {\n\tconst methodName = String(context.name);\n\tif (context.private) {\n\t\tthrow new Error(`'bound' cannot decorate private properties like ${methodName as string}.`);\n\t}\n\tcontext.addInitializer(function (this: any) {\n\t\tthis[methodName] = this[methodName].bind(this);\n\t});\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": "i0BAEO,SAAS,CAAuB,CAAC,EAAM,EAAsC,CACnF,IAAM,EAAa,OAAO,EAAQ,IAAI,EACtC,GAAI,EAAQ,QACX,MAAU,MAAM,mDAAmD,IAAuB,EAE3F,EAAQ,eAAe,QAAS,EAAY,CAC3C,KAAK,GAAc,KAAK,GAAY,KAAK,IAAI,EAC7C",
|
|
8
|
+
"debugId": "6C8C8489D0D826CF64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:y,getOwnPropertyNames:F,getOwnPropertyDescriptor:H}=Object,I=Object.prototype.hasOwnProperty;function J(b){return this[b]}var Q=(b)=>{var j=(z??=new WeakMap).get(b),k;if(j)return j;if(j=y({},"__esModule",{value:!0}),b&&typeof b==="object"||typeof b==="function"){for(var q of F(b))if(!I.call(j,q))y(j,q,{get:J.bind(b,q),enumerable:!(k=H(b,q))||k.enumerable})}return z.set(b,j),j},z;var K=(b)=>b;function P(b,j){this[b]=K.bind(null,j)}var V=(b,j)=>{for(var k in j)y(b,k,{get:j[k],enumerable:!0,configurable:!0,set:P.bind(j,k)})};var W=(b,j)=>()=>(b&&(j=b(b=0)),j);var X=((b)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(b,{get:(j,k)=>(typeof require<"u"?require:j)[k]}):b)(function(b){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+b+'" is not supported')});var B=Symbol.for("@ecopages/radiant.customElementTagName");function D(b,j){b[B]=j}function Z(b){return b[B]}function v(b,j){return function(k,q){q.addInitializer(function(){if(D(this,b),typeof customElements<"u"&&!customElements.get(b))customElements.define(b,this,j)})}}export{v as customElement};
|
|
2
|
+
|
|
3
|
+
//# debugId=D731F9C23D798B5564756E2164756E21
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"export const CUSTOM_ELEMENT_TAG_NAME = Symbol.for('@ecopages/radiant.customElementTagName');\n\ntype CustomElementConstructorWithMetadata = CustomElementConstructor & {\n\t[CUSTOM_ELEMENT_TAG_NAME]?: string;\n};\n\n/**\n * Sets the custom element tag name for a given constructor.\n * This is used internally to associate a class with its custom element tag, which is necessary for features like hydration and SSR support.\n * @param target The constructor of the custom element.\n * @param tagName The tag name to associate with the custom element.\n */\nexport function setCustomElementTagName(target: CustomElementConstructor, tagName: string): void {\n\t(target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME] = tagName;\n}\n\n/**\n * Retrieves the custom element tag name associated with a given constructor.\n * @param target The constructor of the custom element.\n * @returns The tag name associated with the custom element, or `undefined` if not set.\n */\nexport function getCustomElementTagName(target: CustomElementConstructor): string | undefined {\n\treturn (target as CustomElementConstructorWithMetadata)[CUSTOM_ELEMENT_TAG_NAME];\n}\n",
|
|
6
6
|
"import { setCustomElementTagName } from '../../core/custom-element-metadata';\n\nexport function customElement(name: string, options?: ElementDefinitionOptions) {\n\treturn function <T extends CustomElementConstructor>(_: T, context: ClassDecoratorContext<T>) {\n\t\tcontext.addInitializer(function () {\n\t\t\tsetCustomElementTagName(this, name);\n\n\t\t\tif (typeof customElements !== 'undefined' && !customElements.get(name)) {\n\t\t\t\tcustomElements.define(name, this, options);\n\t\t\t}\n\t\t});\n\t};\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": "i0BAAO,IAAM,EAA0B,OAAO,IAAI,wCAAwC,EAYnF,SAAS,CAAuB,CAAC,EAAkC,EAAuB,CAC/F,EAAgD,GAA2B,EAQtE,SAAS,CAAuB,CAAC,EAAsD,CAC7F,OAAQ,EAAgD,GCpBlD,SAAS,CAAa,CAAC,EAAc,EAAoC,CAC/E,OAAO,QAA6C,CAAC,EAAM,EAAmC,CAC7F,EAAQ,eAAe,QAAS,EAAG,CAGlC,GAFA,EAAwB,KAAM,CAAI,EAE9B,OAAO,eAAmB,KAAe,CAAC,eAAe,IAAI,CAAI,EACpE,eAAe,OAAO,EAAM,KAAM,CAAO,EAE1C",
|
|
9
|
+
"debugId": "D731F9C23D798B5564756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:q,getOwnPropertyNames:G,getOwnPropertyDescriptor:H}=Object,J=Object.prototype.hasOwnProperty;function K(M){return this[M]}var O=(M)=>{var y=(D??=new WeakMap).get(M),j;if(y)return y;if(y=q({},"__esModule",{value:!0}),M&&typeof M==="object"||typeof M==="function"){for(var F of G(M))if(!J.call(y,F))q(y,F,{get:K.bind(M,F),enumerable:!(j=H(M,F))||j.enumerable})}return D.set(M,y),y},D;var L=(M)=>M;function N(M,y){this[M]=L.bind(null,y)}var Q=(M,y)=>{for(var j in y)q(M,j,{get:y[j],enumerable:!0,configurable:!0,set:N.bind(y,j)})};var S=(M,y)=>()=>(M&&(y=M(M=0)),y);var U=((M)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(M,{get:(y,j)=>(typeof require<"u"?require:y)[j]}):M)(function(M){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+M+'" is not supported')});function E(M,y){let j=null,F=null,x,B=()=>{if(j!==null)clearTimeout(j),j=null},z=()=>{if(F===null)return x;let W=F;return F=null,B(),x=W(),x},T=function(...W){F=()=>M.apply(this,W),B(),j=setTimeout(()=>{z()},y)};return T.cancel=()=>{B(),F=null},T.flush=()=>{if(F===null)return x;return z()},T.pending=()=>F!==null,T}function Z(M){return(y)=>{let j=new WeakMap;return function(...F){let x=j.get(this);if(!x)x=E((...B)=>{return y.apply(this,B)},M),j.set(this,x);x(...F)}}}export{Z as debounce};
|
|
2
|
+
|
|
3
|
+
//# debugId=236A96CDF0E1B0F164756E2164756E21
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"import type { Method } from '../types';\n\n/**\n * A debounced function with imperative helpers for controlling pending work.\n *\n * @typeParam T The wrapped callback type.\n */\nexport interface DebouncedFunction<T extends Method> {\n\t(...args: Parameters<T>): void;\n\n\t/**\n\t * Cancels the pending callback invocation, if one exists.\n\t */\n\tcancel(): void;\n\n\t/**\n\t * Immediately invokes the latest pending callback invocation.\n\t *\n\t * @returns The callback result when a call is pending, or the last completed\n\t * result when no call is pending.\n\t */\n\tflush(): ReturnType<T> | undefined;\n\n\t/**\n\t * Reports whether the callback currently has a scheduled invocation.\n\t *\n\t * @returns True when a call is pending.\n\t */\n\tpending(): boolean;\n}\n\n/**\n * Creates a debounced wrapper around a function.\n *\n * The returned function delays invocation until the configured timeout has\n * elapsed since the latest call. It also exposes helpers to cancel, flush,\n * and inspect pending work.\n *\n * @typeParam T The wrapped callback type.\n * @param callback The callback to debounce.\n * @param timeout The debounce timeout in milliseconds.\n * @returns A debounced wrapper around the callback.\n */\nexport function debounce<T extends Method>(callback: T, timeout: number): DebouncedFunction<T> {\n\tlet timeoutRef: ReturnType<typeof setTimeout> | null = null;\n\tlet pendingInvocation: (() => ReturnType<T>) | null = null;\n\tlet lastResult: ReturnType<T> | undefined;\n\n\tconst clearPendingCall = () => {\n\t\tif (timeoutRef !== null) {\n\t\t\tclearTimeout(timeoutRef);\n\t\t\ttimeoutRef = null;\n\t\t}\n\t};\n\n\tconst invoke = (): ReturnType<T> | undefined => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\tconst invocation = pendingInvocation;\n\t\tpendingInvocation = null;\n\t\tclearPendingCall();\n\t\tlastResult = invocation();\n\n\t\treturn lastResult;\n\t};\n\n\tconst debounced = function (this: ThisParameterType<T>, ...args: Parameters<T>) {\n\t\tpendingInvocation = () => callback.apply(this, args) as ReturnType<T>;\n\t\tclearPendingCall();\n\t\ttimeoutRef = setTimeout(() => {\n\t\t\tinvoke();\n\t\t}, timeout);\n\t} as DebouncedFunction<T>;\n\n\tdebounced.cancel = () => {\n\t\tclearPendingCall();\n\t\tpendingInvocation = null;\n\t};\n\n\tdebounced.flush = () => {\n\t\tif (pendingInvocation === null) {\n\t\t\treturn lastResult;\n\t\t}\n\n\t\treturn invoke();\n\t};\n\n\tdebounced.pending = () => pendingInvocation !== null;\n\n\treturn debounced;\n}\n",
|
|
6
6
|
"import { debounce as debounceFunction } from '../../helpers/debounce';\nimport type { Method } from '../../types';\n\nexport function debounce(timeout: number): Method {\n\treturn <T extends Method>(originalMethod: T): Method => {\n\t\tconst debouncedByInstance = new WeakMap<object, ReturnType<typeof debounceFunction<T>>>();\n\n\t\treturn function (this: object, ...args: Parameters<T>): void {\n\t\t\tlet debounced = debouncedByInstance.get(this);\n\n\t\t\tif (!debounced) {\n\t\t\t\tdebounced = debounceFunction((...innerArgs: Parameters<T>) => {\n\t\t\t\t\treturn originalMethod.apply(this, innerArgs);\n\t\t\t\t}, timeout);\n\t\t\t\tdebouncedByInstance.set(this, debounced);\n\t\t\t}\n\n\t\t\tdebounced(...args);\n\t\t};\n\t};\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": "i0BA2CO,SAAS,CAA0B,CAAC,EAAa,EAAuC,CAC9F,IAAI,EAAmD,KACnD,EAAkD,KAClD,EAEE,EAAmB,IAAM,CAC9B,GAAI,IAAe,KAClB,aAAa,CAAU,EACvB,EAAa,MAIT,EAAS,IAAiC,CAC/C,GAAI,IAAsB,KACzB,OAAO,EAGR,IAAM,EAAa,EAKnB,OAJA,EAAoB,KACpB,EAAiB,EACjB,EAAa,EAAW,EAEjB,GAGF,EAAY,QAAS,IAAgC,EAAqB,CAC/E,EAAoB,IAAM,EAAS,MAAM,KAAM,CAAI,EACnD,EAAiB,EACjB,EAAa,WAAW,IAAM,CAC7B,EAAO,GACL,CAAO,GAkBX,OAfA,EAAU,OAAS,IAAM,CACxB,EAAiB,EACjB,EAAoB,MAGrB,EAAU,MAAQ,IAAM,CACvB,GAAI,IAAsB,KACzB,OAAO,EAGR,OAAO,EAAO,GAGf,EAAU,QAAU,IAAM,IAAsB,KAEzC,ECxFD,SAAS,CAAQ,CAAC,EAAyB,CACjD,MAAO,CAAmB,IAA8B,CACvD,IAAM,EAAsB,IAAI,QAEhC,OAAO,QAAS,IAAkB,EAA2B,CAC5D,IAAI,EAAY,EAAoB,IAAI,IAAI,EAE5C,GAAI,CAAC,EACJ,EAAY,EAAiB,IAAI,IAA6B,CAC7D,OAAO,EAAe,MAAM,KAAM,CAAS,GACzC,CAAO,EACV,EAAoB,IAAI,KAAM,CAAS,EAGxC,EAAU,GAAG,CAAI",
|
|
9
|
+
"debugId": "236A96CDF0E1B0F164756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:H,getOwnPropertyNames:M,getOwnPropertyDescriptor:N}=Object,O=Object.prototype.hasOwnProperty;function P(z){return this[z]}var U=(z)=>{var A=(K??=new WeakMap).get(z),B;if(A)return A;if(A=H({},"__esModule",{value:!0}),z&&typeof z==="object"||typeof z==="function"){for(var G of M(z))if(!O.call(A,G))H(A,G,{get:P.bind(z,G),enumerable:!(B=N(z,G))||B.enumerable})}return K.set(z,A),A},K;var Q=(z)=>z;function R(z,A){this[z]=Q.bind(null,A)}var V=(z,A)=>{for(var B in A)H(z,B,{get:A[B],enumerable:!0,configurable:!0,set:R.bind(A,B)})};var W=(z,A)=>()=>(z&&(A=z(z=0)),A);var X=((z)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(z,{get:(A,B)=>(typeof require<"u"?require:A)[B]}):z)(function(z){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+z+'" is not supported')});class I{host;eventConfig;constructor(z,A){this.host=z,this.eventConfig=A}emit(z){let A=new CustomEvent(this.eventConfig.name,{detail:z,bubbles:this.eventConfig.bubbles,cancelable:this.eventConfig.cancelable,composed:this.eventConfig.composed});this.host.dispatchEvent(A)}}function L(z,A){let B=new I(z,A);return z.registerEventEmitter(A.name,B),B}function q(z){return function(A,B){B.addInitializer(function(){let G=L(this,z);Object.defineProperty(this,B.name,{get(){return G},enumerable:!0,configurable:!0})})}}export{q as event};
|
|
2
|
+
|
|
3
|
+
//# debugId=A758AE24F40AC01B64756E2164756E21
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"import type { RadiantElement } from '../core/radiant-element';\nimport { EventEmitter, type EventEmitterConfig } from '../tools/event-emitter';\n\n/**\n * Creates an EventEmitter bound to a host element and registers it on the host.\n * Functional equivalent of the `@event` decorator for vanilla JS usage.\n * @param host The host element that will dispatch the events.\n * @param config {@link EventEmitterConfig} The event emitter configuration.\n */\nexport function createEvent<T = unknown>(host: RadiantElement, config: EventEmitterConfig): EventEmitter<T> {\n\tconst emitter = new EventEmitter<T>(host, config);\n\thost.registerEventEmitter(config.name, emitter);\n\treturn emitter;\n}\n",
|
|
7
7
|
"import type { RadiantElement } from '../../core/radiant-element';\nimport { createEvent } from '../../helpers/create-event';\nimport type { EventEmitterConfig } from '../../tools/event-emitter';\n\n/**\n * Decorator that attaches an EventEmitter to the class field property.\n * The EventEmitter can be used to dispatch custom events from the target element.\n * @param eventConfig Configuration for the event emitter.\n * @see {@link EventEmitter} for more details about how the EventEmitter works.\n */\nexport function event(eventConfig: EventEmitterConfig) {\n\treturn function <T extends RadiantElement, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst emitter = createEvent(this, eventConfig);\n\n\t\t\tObject.defineProperty(this, context.name, {\n\t\t\t\tget() {\n\t\t\t\t\treturn emitter;\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"
|
|
8
8
|
],
|
|
9
|
-
"mappings": "
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": "i0BAcO,MAAM,CAA0B,CAC9B,KACA,YAQR,WAAW,CAAC,EAAsB,EAAiC,CAClE,KAAK,KAAO,EACZ,KAAK,YAAc,EAQpB,IAAI,CAAC,EAAY,CAChB,IAAM,EAAQ,IAAI,YAAY,KAAK,YAAY,KAAM,CACpD,OAAQ,EACR,QAAS,KAAK,YAAY,QAC1B,WAAY,KAAK,YAAY,WAC7B,SAAU,KAAK,YAAY,QAC5B,CAAC,EACD,KAAK,KAAK,cAAc,CAAK,EAE/B,CClCO,SAAS,CAAwB,CAAC,EAAsB,EAA6C,CAC3G,IAAM,EAAU,IAAI,EAAgB,EAAM,CAAM,EAEhD,OADA,EAAK,qBAAqB,EAAO,KAAM,CAAO,EACvC,ECFD,SAAS,CAAK,CAAC,EAAiC,CACtD,OAAO,QAAsC,CAAC,EAAc,EAA2C,CACtG,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAU,EAAY,KAAM,CAAW,EAE7C,OAAO,eAAe,KAAM,EAAQ,KAAM,CACzC,GAAG,EAAG,CACL,OAAO,GAER,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
|
|
10
|
+
"debugId": "A758AE24F40AC01B64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:I,getOwnPropertyNames:O,getOwnPropertyDescriptor:S}=Object,T=Object.prototype.hasOwnProperty;function y($){return this[$]}var E=($)=>{var x=(V??=new WeakMap).get($),F;if(x)return x;if(x=I({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var W of O($))if(!T.call(x,W))I(x,W,{get:y.bind($,W),enumerable:!(F=S($,W))||F.enumerable})}return V.set($,x),x},V;var M=($)=>$;function K($,x){this[$]=M.bind(null,x)}var m=($,x)=>{for(var F in x)I($,F,{get:x[F],enumerable:!0,configurable:!0,set:K.bind(x,F)})};var H=($,x)=>()=>($&&(x=$($=0)),x);var b=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(x,F)=>(typeof require<"u"?require:x)[F]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});function X($){let x=globalThis.CSS;if(typeof x?.escape==="function")return x.escape($);let F="";for(let W=0;W<$.length;W+=1){let N=$[W]??"",P=N.codePointAt(0)??0;if(P===0){F+="�";continue}let _=P>=1&&P<=31||P===127,j=W===0&&P>=48&&P<=57,z=W===1&&P>=48&&P<=57&&($[0]??"")==="-",B=W===0&&N==="-"&&$.length===1;if(_||j||z){F+=`\\${P.toString(16)} `;continue}if(P>=128||N==="-"||N==="_"||P>=48&&P<=57||P>=65&&P<=90||P>=97&&P<=122){F+=B?`\\${N}`:N;continue}F+=`\\${N}`}return F}var D=Symbol("radiant.shadowRootListenerHooks"),Y=Symbol("radiant.patchedAttachShadow");function q($){if($ instanceof Element)return $;if("host"in $)return $.host;return $.element}function R($){return!($ instanceof Element)}function Z($,x,F,W){let N=(P)=>{if(P.target instanceof Element&&P.target.matches(F))W(P)};return $.addEventListener(x.type,N,x.options),()=>{$.removeEventListener(x.type,N,x.options)}}function A($,x){let F=q($);if(!F[D])F[D]=new Set;if(F[D].add(x),F[Y])return;let W=F.attachShadow;F.attachShadow=function(P){let _=W.call(this,P);for(let j of F[D]??[])j();return _},F[Y]=!0}function J($,x,F){if(R($)&&"scope"in x&&x.scope&&x.scope!=="light")throw Error("RadiantController event listeners only support light DOM scope.");let W=q($),N=F.bind($),P=null,_=null,j=null,z=null,B=!1,Q=()=>{P?.(),_?.(),j?.(),z?.(),P=null,_=null,j=null,z=null},G=()=>{if(B)return;if("window"in x&&!P)window.addEventListener(x.type,N,x.options),P=()=>{window.removeEventListener(x.type,N,x.options)};if("document"in x&&!_)document.addEventListener(x.type,N,x.options),_=()=>{document.removeEventListener(x.type,N,x.options)};if("selector"in x||"ref"in x){let U="selector"in x?x.selector:`[data-ref='${X(x.ref)}']`;if(x.scope!=="shadow"&&!j)j=Z(W,x,U,N);if(x.scope!=="light"&&W.shadowRoot&&!z)z=Z(W.shadowRoot,x,U,N)}};if("selector"in x||"ref"in x){if(x.scope!=="light")A($,()=>{if($.isConnected)G()})}if($.registerConnectedCallback(G),$.registerCleanupCallback(Q),$.isConnected)G();return()=>{B=!0,Q()}}function u($){return function(x,F){F.addInitializer(function(){J(this,$,x.bind(this))})}}export{u as onEvent};
|
|
2
|
+
|
|
3
|
+
//# debugId=F7180FEAB0EEA53964756E2164756E21
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"import type { RadiantElementEventListener } from '../core/radiant-element';\nimport { escapeCssIdentifier } from '../tools/escape-css-identifier';\n\n/**\n * Selects which DOM tree delegated event listeners should observe.\n */\nexport type OnEventScope = 'light' | 'shadow' | 'both';\n\ntype BaseOnEventConfig = Pick<RadiantElementEventListener, 'type' | 'options'> & {\n\tscope?: OnEventScope;\n};\n\nexport type OnEventConfig = BaseOnEventConfig &\n\t(\n\t\t| {\n\t\t\t\tselector: string;\n\t\t }\n\t\t| {\n\t\t\t\tref: string;\n\t\t }\n\t\t| {\n\t\t\t\twindow: true;\n\t\t }\n\t\t| {\n\t\t\t\tdocument: true;\n\t\t }\n\t);\n\ntype DelegatedEventRoot = Element | ShadowRoot;\n\ntype EventListenerLifecycleHost = {\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterCleanupCallback(callback: () => void): void;\n\tisConnected: boolean;\n};\n\nexport type EventListenerHost =\n\t| (EventListenerLifecycleHost & Element)\n\t| (EventListenerLifecycleHost & { host: Element })\n\t| (EventListenerLifecycleHost & { element: Element });\n\nconst shadowRootListenerHooksKey = Symbol('radiant.shadowRootListenerHooks');\nconst patchedAttachShadowKey = Symbol('radiant.patchedAttachShadow');\n\ntype ShadowRootHookHost = Element & {\n\t[patchedAttachShadowKey]?: true;\n\t[shadowRootListenerHooksKey]?: Set<() => void>;\n};\n\nfunction resolveEventListenerHostElement(host: EventListenerHost): Element {\n\tif (host instanceof Element) {\n\t\treturn host;\n\t}\n\n\tif ('host' in host) {\n\t\treturn host.host;\n\t}\n\n\treturn host.element;\n}\n\nfunction isControllerEventHost(host: EventListenerHost): host is EventListenerLifecycleHost & { host: Element } {\n\treturn !(host instanceof Element);\n}\n\nfunction addDelegatedListener(\n\troot: DelegatedEventRoot,\n\tconfig: Pick<OnEventConfig, 'type' | 'options'>,\n\tselector: string,\n\tlistener: EventListener,\n): () => void {\n\tconst delegatedListener = (event: Event) => {\n\t\tif (event.target instanceof Element && event.target.matches(selector)) {\n\t\t\tlistener(event);\n\t\t}\n\t};\n\n\troot.addEventListener(config.type, delegatedListener, config.options);\n\n\treturn () => {\n\t\troot.removeEventListener(config.type, delegatedListener, config.options);\n\t};\n}\n\nfunction registerShadowRootHook(host: EventListenerHost, hook: () => void): void {\n\tconst shadowAwareHost = resolveEventListenerHostElement(host) as ShadowRootHookHost;\n\n\tif (!shadowAwareHost[shadowRootListenerHooksKey]) {\n\t\tshadowAwareHost[shadowRootListenerHooksKey] = new Set();\n\t}\n\n\tshadowAwareHost[shadowRootListenerHooksKey].add(hook);\n\n\tif (shadowAwareHost[patchedAttachShadowKey]) {\n\t\treturn;\n\t}\n\n\tconst originalAttachShadow = shadowAwareHost.attachShadow;\n\n\tshadowAwareHost.attachShadow = function patchedAttachShadow(init: ShadowRootInit): ShadowRoot {\n\t\tconst shadowRoot = originalAttachShadow.call(this, init);\n\t\tfor (const shadowRootHook of shadowAwareHost[shadowRootListenerHooksKey] ?? []) {\n\t\t\tshadowRootHook();\n\t\t}\n\t\treturn shadowRoot;\n\t};\n\n\tshadowAwareHost[patchedAttachShadowKey] = true;\n}\n\n/**\n * Subscribes to a DOM event with delegation, window, or document targeting.\n * Functional equivalent of the `@onEvent` decorator for vanilla JS usage.\n * Returns a cleanup function to remove the listener.\n * @param host The host RadiantElement.\n * @param config The event listener configuration.\n * @param callback The event handler function.\n */\nexport function createEventListener(\n\thost: EventListenerHost,\n\tconfig: OnEventConfig,\n\tcallback: (event: Event) => void,\n): () => void {\n\tif (isControllerEventHost(host) && 'scope' in config && config.scope && config.scope !== 'light') {\n\t\tthrow new Error('RadiantController event listeners only support light DOM scope.');\n\t}\n\n\tconst hostElement = resolveEventListenerHostElement(host);\n\tconst boundCallback = callback.bind(host);\n\tlet windowCleanup: (() => void) | null = null;\n\tlet documentCleanup: (() => void) | null = null;\n\tlet lightCleanup: (() => void) | null = null;\n\tlet shadowCleanup: (() => void) | null = null;\n\tlet disposed = false;\n\n\tconst detachListeners = () => {\n\t\twindowCleanup?.();\n\t\tdocumentCleanup?.();\n\t\tlightCleanup?.();\n\t\tshadowCleanup?.();\n\n\t\twindowCleanup = null;\n\t\tdocumentCleanup = null;\n\t\tlightCleanup = null;\n\t\tshadowCleanup = null;\n\t};\n\n\tconst attachListeners = () => {\n\t\tif (disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ('window' in config && !windowCleanup) {\n\t\t\twindow.addEventListener(config.type, boundCallback, config.options);\n\t\t\twindowCleanup = () => {\n\t\t\t\twindow.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('document' in config && !documentCleanup) {\n\t\t\tdocument.addEventListener(config.type, boundCallback, config.options);\n\t\t\tdocumentCleanup = () => {\n\t\t\t\tdocument.removeEventListener(config.type, boundCallback, config.options);\n\t\t\t};\n\t\t}\n\n\t\tif ('selector' in config || 'ref' in config) {\n\t\t\tconst selector = 'selector' in config ? config.selector : `[data-ref='${escapeCssIdentifier(config.ref)}']`;\n\n\t\t\tif (config.scope !== 'shadow' && !lightCleanup) {\n\t\t\t\tlightCleanup = addDelegatedListener(hostElement, config, selector, boundCallback);\n\t\t\t}\n\n\t\t\tif (config.scope !== 'light' && hostElement.shadowRoot && !shadowCleanup) {\n\t\t\t\tshadowCleanup = addDelegatedListener(hostElement.shadowRoot, config, selector, boundCallback);\n\t\t\t}\n\t\t}\n\t};\n\n\tif ('selector' in config || 'ref' in config) {\n\t\tif (config.scope !== 'light') {\n\t\t\tregisterShadowRootHook(host, () => {\n\t\t\t\tif (host.isConnected) {\n\t\t\t\t\tattachListeners();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\thost.registerConnectedCallback(attachListeners);\n\thost.registerCleanupCallback(detachListeners);\n\n\tif (host.isConnected) {\n\t\tattachListeners();\n\t}\n\n\treturn () => {\n\t\tdisposed = true;\n\t\tdetachListeners();\n\t};\n}\n",
|
|
7
7
|
"import { createEventListener, type EventListenerHost } from '../../helpers/create-event-listener';\nimport type { OnEventConfig } from '../on-event';\nimport type { Method } from '../../types';\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n *\n * @param eventConfig The event configuration.\n * @param eventConfig.selectors The CSS selector(s) of the target element(s).\n * @param eventConfig.ref The data-ref attribute of the target element.\n * @param eventConfig.type The type of the event to listen for.\n * @param eventConfig.options Optional. An options object that specifies characteristics about the event listener.\n */\nexport function onEvent(eventConfig: OnEventConfig) {\n\treturn function <Host extends EventListenerHost, T extends Method>(\n\t\toriginalMethod: T,\n\t\tcontext: ClassMethodDecoratorContext<Host, T>,\n\t): void {\n\t\tcontext.addInitializer(function (this: Host) {\n\t\t\tcreateEventListener(this, eventConfig, originalMethod.bind(this));\n\t\t});\n\t};\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": "
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": "i0BAAO,SAAS,CAAmB,CAAC,EAAuB,CAC1D,IAAM,EAAe,WAAW,IAEhC,GAAI,OAAO,GAAc,SAAW,WACnC,OAAO,EAAa,OAAO,CAAK,EAGjC,IAAI,EAAU,GAEd,QAAS,EAAQ,EAAG,EAAQ,EAAM,OAAQ,GAAS,EAAG,CACrD,IAAM,EAAY,EAAM,IAAU,GAC5B,EAAY,EAAU,YAAY,CAAC,GAAK,EAE9C,GAAI,IAAc,EAAG,CACpB,GAAW,IACX,SAGD,IAAM,EAAsB,GAAa,GAAU,GAAa,IAAW,IAAc,IACnF,EAAkB,IAAU,GAAK,GAAa,IAAU,GAAa,GACrE,EACL,IAAU,GAAK,GAAa,IAAU,GAAa,KAAW,EAAM,IAAM,MAAQ,IAC7E,EAAiB,IAAU,GAAK,IAAc,KAAO,EAAM,SAAW,EAE5E,GAAI,GAAsB,GAAmB,EAAuB,CACnE,GAAW,KAAK,EAAU,SAAS,EAAE,KACrC,SAGD,GACC,GAAa,KACb,IAAc,KACd,IAAc,KACb,GAAa,IAAU,GAAa,IACpC,GAAa,IAAU,GAAa,IACpC,GAAa,IAAU,GAAa,IACpC,CACD,GAAW,EAAiB,KAAK,IAAc,EAC/C,SAGD,GAAW,KAAK,IAG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nPropertyNames:s,getOwnPropertyDescriptor:d}=Object,p=Object.prototype.hasOwnProperty;function l(t){return this[t]}var c=(t)=>{var e=(r??=new WeakMap).get(t),o;if(e)return e;if(e=n({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function"){for(var i of s(t))if(!p.call(e,i))n(e,i,{get:l.bind(t,i),enumerable:!(o=d(t,i))||o.enumerable})}return r.set(t,e),e},r;var u=(t)=>t;function f(t,e){this[t]=u.bind(null,e)}var g=(t,e)=>{for(var o in e)n(t,o,{get:e[o],enumerable:!0,configurable:!0,set:f.bind(e,o)})};var h=(t,e)=>()=>(t&&(e=t(t=0)),e);var b=((t)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});function U(t){return function(e,o){o.addInitializer(function(){let i=e.bind(this);if(Object.defineProperty(this,o.name,{value:i,configurable:!0,writable:!0}),Array.isArray(t))for(let a of t)this.registerUpdateCallback(a,i);else if(typeof t==="string")this.registerUpdateCallback(t,i)})}}export{U as onUpdated};
|
|
2
|
+
|
|
3
|
+
//# debugId=9529CE35A009321964756E2164756E21
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { Method } from '../../types';\n\ntype UpdatedHost = {\n\tregisterUpdateCallback(key: string, update: (...args: unknown[]) => unknown): () => void;\n};\n\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn function <THost extends UpdatedHost, T extends Method>(\n\t\toriginalMethod: T,\n\t\tcontext: ClassMethodDecoratorContext<THost, T>,\n\t): void {\n\t\tcontext.addInitializer(function (this: THost) {\n\t\t\tconst boundMethod = originalMethod.bind(this);\n\n\t\t\tObject.defineProperty(this, context.name, {\n\t\t\t\tvalue: boundMethod,\n\t\t\t\tconfigurable: true,\n\t\t\t\twritable: true,\n\t\t\t});\n\n\t\t\tif (Array.isArray(keyOrKeys)) {\n\t\t\t\tfor (const key of keyOrKeys) {\n\t\t\t\t\tthis.registerUpdateCallback(key, boundMethod);\n\t\t\t\t}\n\t\t\t} else if (typeof keyOrKeys === 'string') {\n\t\t\t\tthis.registerUpdateCallback(keyOrKeys, boundMethod);\n\t\t\t}\n\t\t});\n\t};\n}\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": "i0BAMO,SAAS,CAAS,CAAC,EAA8B,CACvD,OAAO,QAAsD,CAC5D,EACA,EACO,CACP,EAAQ,eAAe,QAAS,EAAc,CAC7C,IAAM,EAAc,EAAe,KAAK,IAAI,EAQ5C,GANA,OAAO,eAAe,KAAM,EAAQ,KAAM,CACzC,MAAO,EACP,aAAc,GACd,SAAU,EACX,CAAC,EAEG,MAAM,QAAQ,CAAS,EAC1B,QAAW,KAAO,EACjB,KAAK,uBAAuB,EAAK,CAAW,EAEvC,QAAI,OAAO,IAAc,SAC/B,KAAK,uBAAuB,EAAW,CAAW,EAEnD",
|
|
8
|
+
"debugId": "9529CE35A009321964756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:n,getOwnPropertyNames:d,getOwnPropertyDescriptor:g}=Object,u=Object.prototype.hasOwnProperty;function T(e){return this[e]}var H=(e)=>{var m=(E??=new WeakMap).get(e),r;if(m)return m;if(m=n({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var l of d(e))if(!u.call(m,l))n(m,l,{get:T.bind(e,l),enumerable:!(r=g(e,l))||r.enumerable})}return E.set(e,m),m},E;var b=(e)=>e;function y(e,m){this[e]=b.bind(null,m)}var j=(e,m)=>{for(var r in m)n(e,r,{get:m[r],enumerable:!0,configurable:!0,set:y.bind(m,r)})};var x=(e,m)=>()=>(e&&(m=e(e=0)),m);var C=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(m,r)=>(typeof require<"u"?require:m)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function S(e,m={}){let r=null,l,t=()=>{if(m.all)return e.getSlotElements(m.name);return e.getSlotElements(m.name)[0]??null};return{get value(){if(m.cache===!1)return t();let f=e.slotProjectionVersion??0;if(l!==f)r=t(),l=f;return r}}}function I(e={}){return function(m,r){let l=String(r.name);r.addInitializer(function(){let t=S(this,e);Object.defineProperty(this,l,{get(){return t.value},enumerable:!0,configurable:!0})})}}export{I as querySlot};
|
|
2
|
+
|
|
3
|
+
//# debugId=466A9D60A5C69E1E64756E2164756E21
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"export type QuerySlotConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tname?: string;\n};\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n};\n\ntype QuerySlotResult<T extends Element | Element[] | null> = {\n\tget value(): T | null;\n};\n\n/**\n * Creates a lazy slot query accessor bound to a host element.\n * Functional equivalent of the `@querySlot` decorator for vanilla JS usage.\n * @param host The host element to query slots within.\n * @param options {@link QuerySlotConfig} The slot query configuration.\n */\nexport function createQuerySlot<T extends Element | Element[] | null = Element | null>(\n\thost: SlotQueryHost,\n\toptions: QuerySlotConfig = {},\n): QuerySlotResult<T> {\n\tlet cached: T | null = null;\n\tlet cachedVersion: number | undefined;\n\n\tconst executeQuery = (): T | null => {\n\t\tif (options.all) {\n\t\t\treturn host.getSlotElements(options.name) as T;\n\t\t}\n\t\treturn (host.getSlotElements(options.name)[0] ?? null) as T | null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache === false) {\n\t\t\t\treturn executeQuery();\n\t\t\t}\n\n\t\t\tconst currentVersion = (host as unknown as Record<string, number | undefined>).slotProjectionVersion ?? 0;\n\n\t\t\tif (cachedVersion !== currentVersion) {\n\t\t\t\tcached = executeQuery();\n\t\t\t\tcachedVersion = currentVersion;\n\t\t\t}\n\n\t\t\treturn cached;\n\t\t},\n\t};\n}\n",
|
|
6
6
|
"import { createQuerySlot } from '../../helpers/create-query-slot';\nimport type { QuerySlotConfig } from '../query-slot';\n\ntype SlotQueryHost = HTMLElement & {\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n\tslotProjectionVersion?: number;\n};\n\nexport function querySlot(options: QuerySlotConfig = {}) {\n\treturn function <T extends SlotQueryHost, V extends Element | Element[] | null>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tvoid target;\n\t\tconst propertyName = String(context.name);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst accessor = createQuerySlot<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"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": "i0BAoBO,SAAS,CAAsE,CACrF,EACA,EAA2B,CAAC,EACP,CACrB,IAAI,EAAmB,KACnB,EAEE,EAAe,IAAgB,CACpC,GAAI,EAAQ,IACX,OAAO,EAAK,gBAAgB,EAAQ,IAAI,EAEzC,OAAQ,EAAK,gBAAgB,EAAQ,IAAI,EAAE,IAAM,MAGlD,MAAO,IACF,MAAK,EAAa,CACrB,GAAI,EAAQ,QAAU,GACrB,OAAO,EAAa,EAGrB,IAAM,EAAkB,EAAuD,uBAAyB,EAExG,GAAI,IAAkB,EACrB,EAAS,EAAa,EACtB,EAAgB,EAGjB,OAAO,EAET,ECzCM,SAAS,CAAS,CAAC,EAA2B,CAAC,EAAG,CACxD,OAAO,QAAwE,CAC9E,EACA,EACC,CAED,IAAM,EAAe,OAAO,EAAQ,IAAI,EAExC,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAW,EAAmB,KAAM,CAAO,EAEjD,OAAO,eAAe,KAAM,EAAc,CACzC,GAAG,EAAG,CACL,OAAO,EAAS,OAEjB,WAAY,GACZ,aAAc,EACf,CAAC,EACD",
|
|
9
|
+
"debugId": "466A9D60A5C69E1E64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:j,getOwnPropertyNames:N,getOwnPropertyDescriptor:P}=Object,y=Object.prototype.hasOwnProperty;function z(f){return this[f]}var L=(f)=>{var m=(H??=new WeakMap).get(f),V;if(m)return m;if(m=j({},"__esModule",{value:!0}),f&&typeof f==="object"||typeof f==="function"){for(var b of N(f))if(!y.call(m,b))j(m,b,{get:z.bind(f,b),enumerable:!(V=P(f,b))||V.enumerable})}return H.set(f,m),m},H;var A=(f)=>f;function B(f,m){this[f]=A.bind(null,m)}var O=(f,m)=>{for(var V in m)j(f,V,{get:m[V],enumerable:!0,configurable:!0,set:B.bind(m,V)})};var U=(f,m)=>()=>(f&&(m=f(f=0)),m);var W=((f)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(m,V)=>(typeof require<"u"?require:m)[V]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});function D(f){return!(f instanceof Element)}function F(f){return"shadowRoot"in f?f.shadowRoot??null:null}function G(f){return f instanceof Element?f:f.host}function K(f,m="light"){let V=F(f);if(m==="shadow")return V?[V]:[];if(m==="both")return V?[f,V]:[f];return[f]}function I(f,m){if(D(f)&&m.scope&&m.scope!=="light")throw Error("RadiantController queries only support light DOM scope.");let V=G(f),b="selector"in m?m.selector:`[data-ref="${m.ref}"]`,E=null,u=()=>{let x=K(V,m.scope);if(m.all)return x.flatMap((T)=>Array.from(T.querySelectorAll(b)));for(let T of x){let C=T.querySelector(b);if(C)return C}return null};return{get value(){if(m.cache){if(E===null||m.all&&Array.isArray(E)&&!E.length)E=u();return E}return u()}}}function _(f){return function(m,V){let b=String(V.name);V.addInitializer(function(){let E=I(this,f);Object.defineProperty(this,b,{get(){return E.value},enumerable:!0,configurable:!0})})}}export{_ as query};
|
|
2
|
+
|
|
3
|
+
//# debugId=97A854DFEC25C99A64756E2164756E21
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type BaseQueryConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tscope?: QueryScope;\n};\n\ntype QueryBySelector = { selector: string };\n\ntype QueryByRef = { ref: string };\n\nexport type QueryHostTarget = Element | { host: Element };\n\n/**\n * Selects which DOM tree a query should read from.\n */\nexport type QueryScope = 'light' | 'shadow' | 'both';\n\nexport type QueryConfig = BaseQueryConfig & (QueryBySelector | QueryByRef);\n\ntype QueryRoot = Element | ShadowRoot;\n\ntype QueryResult<T extends Element | Element[]> = {\n\tget value(): T | null;\n};\n\nfunction isControllerQueryTarget(target: QueryHostTarget): target is { host: Element } {\n\treturn !(target instanceof Element);\n}\n\nfunction resolveShadowRoot(host: Element): ShadowRoot | null {\n\treturn 'shadowRoot' in host ? ((host as Element & { shadowRoot?: ShadowRoot | null }).shadowRoot ?? null) : null;\n}\n\n/**\n * Resolves the DOM element that should serve as the query root.\n *\n * `@query(...)` can run on both element hosts and controller instances. This\n * helper normalizes those call sites to the underlying element that actually\n * owns the DOM subtree.\n */\nexport function resolveQueryHost(target: QueryHostTarget): Element {\n\treturn target instanceof Element ? target : target.host;\n}\n\nfunction getQueryRoots(host: Element, scope: QueryScope = 'light'): QueryRoot[] {\n\tconst shadowRoot = resolveShadowRoot(host);\n\n\tif (scope === 'shadow') {\n\t\treturn shadowRoot ? [shadowRoot] : [];\n\t}\n\n\tif (scope === 'both') {\n\t\treturn shadowRoot ? [host, shadowRoot] : [host];\n\t}\n\n\treturn [host];\n}\n\n/**\n * Creates a lazy DOM query accessor bound to an element host or controller.\n * Functional equivalent of the `@query` decorator for vanilla JS usage.\n * @param target The element host or controller to query within.\n * @param options {@link QueryConfig} The query configuration.\n */\nexport function createQuery<T extends Element | Element[] = Element>(\n\ttarget: QueryHostTarget,\n\toptions: QueryConfig,\n): QueryResult<T> {\n\tif (isControllerQueryTarget(target) && options.scope && options.scope !== 'light') {\n\t\tthrow new Error('RadiantController queries only support light DOM scope.');\n\t}\n\n\tconst host = resolveQueryHost(target);\n\tconst selector = 'selector' in options ? options.selector : `[data-ref=\"${options.ref}\"]`;\n\tlet cached: T | null = null;\n\n\tconst executeQuery = (): T | null => {\n\t\tconst roots = getQueryRoots(host, options.scope);\n\n\t\tif (options.all) {\n\t\t\treturn roots.flatMap((root) => Array.from(root.querySelectorAll(selector))) as T;\n\t\t}\n\n\t\tfor (const root of roots) {\n\t\t\tconst match = root.querySelector(selector);\n\t\t\tif (match) {\n\t\t\t\treturn match as T;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t};\n\n\treturn {\n\t\tget value(): T | null {\n\t\t\tif (options.cache) {\n\t\t\t\tif (cached === null || (options.all && Array.isArray(cached) && !cached.length)) {\n\t\t\t\t\tcached = executeQuery();\n\t\t\t\t}\n\t\t\t\treturn cached;\n\t\t\t}\n\t\t\treturn executeQuery();\n\t\t},\n\t};\n}\n",
|
|
6
6
|
"import { createQuery, type QueryHostTarget } from '../../helpers/create-query';\nimport type { QueryConfig } from '../query';\n\nexport function query(options: QueryConfig) {\n\treturn function <T extends QueryHostTarget, V extends Element | Element[]>(\n\t\ttarget: undefined,\n\t\tcontext: ClassFieldDecoratorContext<T, V>,\n\t) {\n\t\tvoid target;\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"
|
|
7
7
|
],
|
|
8
|
-
"mappings": "
|
|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,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",
|
|
9
|
+
"debugId": "97A854DFEC25C99A64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:n,getOwnPropertyNames:c,getOwnPropertyDescriptor:d}=Object,u=Object.prototype.hasOwnProperty;function p(e){return this[e]}var f=(e)=>{var t=(s??=new WeakMap).get(e),i;if(t)return t;if(t=n({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of c(e))if(!u.call(t,o))n(t,o,{get:p.bind(e,o),enumerable:!(i=d(e,o))||i.enumerable})}return s.set(e,t),t},s;var l=(e)=>e;function v(e,t){this[e]=l.bind(null,t)}var m=(e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0,configurable:!0,set:v.bind(t,i)})};var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var R=((e)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,i)=>(typeof require<"u"?require:t)[i]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function a(e){return e.shouldAutoBindReactiveMembers?.()??!1}function V(e,t){let i=String(t.name),o=Symbol(`@ecopages/radiant/state:${i}:initializer`);return t.addInitializer(function(){let r=this[o];this.createReactiveField(i,r,{bind:a(this),suppressInitialNotify:!0})}),function(r){return this[o]=r,r}}export{V as reactiveField};
|
|
2
|
+
|
|
3
|
+
//# debugId=777FC839589F09A364756E2164756E21
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/decorators/shared/auto-bind.ts", "../src/decorators/standard/reactive-field.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\ntype AutoBindHost = ReactiveHostLike & {\n\tshouldAutoBindReactiveMembers?: () => boolean;\n};\n\nexport function resolveHostAutoBind(host: AutoBindHost): ReactiveBindingOption {\n\treturn host.shouldAutoBindReactiveMembers?.() ?? false;\n}\n",
|
|
6
|
+
"import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\n\nexport function reactiveField<T extends ReactiveHostLike, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\tconst contextName = String(context.name);\n\tconst initializerValueKey = Symbol(`@ecopages/radiant/state:${contextName}:initializer`);\n\n\tcontext.addInitializer(function (this: T) {\n\t\tconst initializerValue = (this as Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\tthis.createReactiveField(contextName, initializerValue as V, {\n\t\t\tbind: resolveHostAutoBind(this),\n\t\t\tsuppressInitialNotify: true,\n\t\t});\n\t});\n\n\treturn function (this: T, value: V) {\n\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\treturn value;\n\t};\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": "i0BAOO,SAAS,CAAmB,CAAC,EAA2C,CAC9E,OAAO,EAAK,gCAAgC,GAAK,GCL3C,SAAS,CAA4C,CAAC,EAAc,EAA2C,CACrH,IAAM,EAAc,OAAO,EAAQ,IAAI,EACjC,EAAsB,OAAO,2BAA2B,eAAyB,EAUvF,OARA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAA4C,GACtE,KAAK,oBAAoB,EAAa,EAAuB,CAC5D,KAAM,EAAoB,IAAI,EAC9B,sBAAuB,EACxB,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAA4C,GAAuB,EAC7D",
|
|
9
|
+
"debugId": "777FC839589F09A364756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:D,getOwnPropertyNames:$,getOwnPropertyDescriptor:x}=Object,B=Object.prototype.hasOwnProperty;function U(o){return this[o]}var K=(o)=>{var R=(k??=new WeakMap).get(o),n;if(R)return R;if(R=D({},"__esModule",{value:!0}),o&&typeof o==="object"||typeof o==="function"){for(var P of $(o))if(!B.call(R,P))D(R,P,{get:U.bind(o,P),enumerable:!(n=x(o,P))||n.enumerable})}return k.set(o,R),R},k;var m=(o)=>o;function h(o,R){this[o]=m.bind(null,R)}var i=(o,R)=>{for(var n in R)D(o,n,{get:R[n],enumerable:!0,configurable:!0,set:h.bind(R,n)})};var b=(o,R)=>()=>(o&&(R=o(o=0)),R);var f=((o)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(R,n)=>(typeof require<"u"?require:R)[n]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var _=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function q(o,R,n){let P=o.constructor,c=P[_]??[];if(c.some((I)=>I.name===R))return;c.push({name:R,options:n}),P[_]=c}function p(o){return(o.constructor[_]??[]).slice()}function L(o){switch(o){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function z(o){switch(typeof o){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(o))return"array";if(Object.prototype.toString.call(o)==="[object Object]")return"object"}function J(o){switch(o){case Number:return 0;case String:return"";case Boolean:return!1;default:return null}}function S(o){try{return JSON.parse(o)}catch{throw TypeError("Invalid JSON string")}}var g={array(o){let R=S(o);if(!Array.isArray(R))throw TypeError(`Expected an array but got a value of type "${typeof R}"`);return R},boolean(o){return!(o==="0"||String(o).toLowerCase()==="false")},number(o){return Number(o.replace(/_/g,""))},object(o){let R=JSON.parse(o);if(R===null||typeof R!=="object"||Array.isArray(R))throw TypeError(`expected value of type "object" but instead got value "${o}" of type "${z(R)}"`);return R},string(o){return o}},G={default:M,array:H,object:H};function H(o){return JSON.stringify(o)}function M(o){return`${o}`}function C(o,R){let n=L(R);if(!n)throw TypeError(`[radiant-element] Unknown type "${R}"`);return g[n](o)}function Q(o,R){let n=L(R);if(!n)throw TypeError(`[radiant-element] Unknown type "${R}"`);return(G[n]??G.default??M)(o)}function j(o){return typeof o==="boolean"}function T(o){return typeof o==="number"}function A(o){return typeof o==="string"}function N(o){return Array.isArray(o)}function w(o){return typeof o==="object"&&!Array.isArray(o)&&o!==null}function X(o,R){switch(o){case Boolean:return j(R);case Number:return T(R);case String:return A(R);case Array:return N(R);case Object:return w(R);default:return!1}}var V=(o,R,n,P)=>{if(R===Boolean){let I=o.getAttribute(n);if(I===null)return P;return I===""?!0:C(I,R)}let c=o.getAttribute(n);return c!==null?C(c,R):P??J(R)};function Y(o,R){if(R!==void 0&&!X(o,R))throw Error(`defaultValue does not match the expected type for ${o.name}`)}function l(o,R,n,P){return{type:n,name:o,initialValue:P,attribute:R,converter:{fromAttribute:(c)=>C(c,n),toAttribute:(c)=>Q(c,n)}}}function e({type:o,attribute:R,reflect:n,defaultValue:P,bind:c}){return Y(o,P),function(I,O){let E=String(O.name),W=R??E,F=Symbol(`@ecopages/radiant/reactive-prop:${E}:initializer`);return O.addInitializer(function(){let s=this[F],Z=P===void 0?s:P;q(this,E,{type:o,reflect:n,attribute:W,defaultValue:P,bind:c}),this.createReactiveProp(E,{type:o,reflect:n,attribute:W,defaultValue:Z,bind:c})}),function(s){return this[F]=s,s}}}export{e as reactiveProp};
|
|
2
|
+
|
|
3
|
+
//# debugId=BA2727CC6F2C320D64756E2164756E21
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { ReactivePropertyOptions } from './reactive-prop-core';\n\nconst REACTIVE_PROP_DEFINITIONS = Symbol.for('@ecopages/radiant.reactivePropDefinitions');\n\nexport type ReactivePropDefinition = {\n\tname: string;\n\toptions: ReactivePropertyOptions<unknown>;\n};\n\ntype RadiantConstructorWithReactiveProps = CustomElementConstructor & {\n\t[REACTIVE_PROP_DEFINITIONS]?: ReactivePropDefinition[];\n};\n\nexport function registerReactivePropDefinition(\n\ttarget: object,\n\tpropertyName: string,\n\toptions: ReactivePropertyOptions<unknown>,\n): void {\n\tconst constructor = target.constructor as RadiantConstructorWithReactiveProps;\n\tconst definitions = constructor[REACTIVE_PROP_DEFINITIONS] ?? [];\n\n\tif (definitions.some((definition) => definition.name === propertyName)) {\n\t\treturn;\n\t}\n\n\tdefinitions.push({ name: propertyName, options });\n\tconstructor[REACTIVE_PROP_DEFINITIONS] = definitions;\n}\n\nexport function getReactivePropDefinitions(target: object): ReactivePropDefinition[] {\n\treturn ((target.constructor as RadiantConstructorWithReactiveProps)[REACTIVE_PROP_DEFINITIONS] ?? []).slice();\n}\n",
|
|
6
6
|
"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",
|
|
7
|
-
"import type { JsxRenderable,
|
|
8
|
-
"import { type ReactivePropertyOptions, validateReactivePropertyDefault } from '../../core/reactive-prop-core.js';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\n\ntype ReactivePropHost<P> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<P>): void;\n};\n\n/**\n * Standard-decorator implementation for `@prop(...)`.\n *\n * The decorated host is expected to expose `createReactiveProp(...)`, which\n * lets both `RadiantElement` and `RadiantController` share the same public\n * decorator while keeping their runtime channels different.\n */\nexport function reactiveProp<P = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<P>) {\n\tvalidateReactivePropertyDefault(type, defaultValue);\n\treturn function <T extends ReactivePropHost<P>, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\t\tconst propertyName = String(context.name);\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tconst initializerValueKey = Symbol(`@ecopages/radiant/reactive-prop:${propertyName}:initializer`);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst initializerValue = (this as T & Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\t\tconst resolvedDefaultValue = (defaultValue === undefined ? initializerValue : defaultValue) as\n\t\t\t\
|
|
7
|
+
"import type { JsxBindingSourceValue, JsxRenderable, SubscribableJsxValueWithAccess } from '@ecopages/jsx';\nimport type { ReactiveState } from './reactivity-contract';\nimport {\n\ttype AttributeTypeConstant,\n\ttype ReadAttributeValueReturnType,\n\ttype WriteAttributeValueReturnType,\n\tisValueOfType,\n\treadAttributeValue,\n\twriteAttributeValue,\n} from '../utils/attribute-utils';\n\ntype StringPropertyKey<Value> = Extract<keyof Value, string>;\n\nexport interface ReactiveProperty<T = unknown> {\n\ttype: AttributeTypeConstant;\n\tinitialValue?: T;\n\tname: string;\n\tattribute: string;\n\tconverter: {\n\t\tfromAttribute: (value: string) => ReadAttributeValueReturnType;\n\t\ttoAttribute: (value: any) => WriteAttributeValueReturnType;\n\t};\n}\n\nexport type ReactivePropertyOptions<T> = {\n\ttype: AttributeTypeConstant;\n\treflect?: boolean;\n\tattribute?: string;\n\tdefaultValue?: T;\n\tbind?: boolean | string;\n};\n\nexport type ReactiveBindingOption = boolean | string;\n\nexport type ReactiveFieldOptions = {\n\tbind?: ReactiveBindingOption;\n\t/** When true, skip the initial notifyUpdate emitted while defining the field. */\n\tsuppressInitialNotify?: boolean;\n};\n\nexport type ReactiveBindingValue<\n\tHost extends object,\n\tProperty extends StringPropertyKey<Host>,\n> = Host[Property] extends JsxBindingSourceValue ? Host[Property] : JsxRenderable;\n\nexport type ReactiveBindings<Bindings extends object> = {\n\treadonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValueWithAccess<\n\t\tReactiveBindingValue<Bindings, Property>\n\t>;\n};\n\nexport type ReactiveAccessorDefinition<T> = {\n\tbind?: ReactiveBindingOption;\n\tsignal: ReactiveState<T>;\n\tonSet?: (value: T) => void;\n};\n\nexport function validateReactivePropertyDefault(type: AttributeTypeConstant, defaultValue: unknown): void {\n\tif (defaultValue !== undefined && !isValueOfType(type, defaultValue)) {\n\t\tthrow new Error(`defaultValue does not match the expected type for ${type.name}`);\n\t}\n}\n\nexport function createReactivePropertyMapping<T>(\n\tpropertyName: string,\n\tattributeKey: string,\n\ttype: AttributeTypeConstant,\n\tinitialValue: T | undefined,\n): ReactiveProperty<T> {\n\treturn {\n\t\ttype,\n\t\tname: propertyName,\n\t\tinitialValue,\n\t\tattribute: attributeKey,\n\t\tconverter: {\n\t\t\tfromAttribute: (value) => readAttributeValue(value, type),\n\t\t\ttoAttribute: (value) => writeAttributeValue(value, type),\n\t\t},\n\t};\n}\n",
|
|
8
|
+
"import { type ReactivePropertyOptions, validateReactivePropertyDefault } from '../../core/reactive-prop-core.js';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\n\ntype ReactivePropHost<P> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<P>): void;\n};\n\n/**\n * Standard-decorator implementation for `@prop(...)`.\n *\n * The decorated host is expected to expose `createReactiveProp(...)`, which\n * lets both `RadiantElement` and `RadiantController` share the same public\n * decorator while keeping their runtime channels different.\n */\nexport function reactiveProp<P = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<P>) {\n\tvalidateReactivePropertyDefault(type, defaultValue);\n\treturn function <T extends ReactivePropHost<P>, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\t\tconst propertyName = String(context.name);\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tconst initializerValueKey = Symbol(`@ecopages/radiant/reactive-prop:${propertyName}:initializer`);\n\n\t\tcontext.addInitializer(function (this: T) {\n\t\t\tconst initializerValue = (this as T & Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\t\tconst resolvedDefaultValue = (defaultValue === undefined ? initializerValue : defaultValue) as\n\t\t\t\tP | undefined;\n\n\t\t\tregisterReactivePropDefinition(this, propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t\tthis.createReactiveProp(propertyName, {\n\t\t\t\ttype,\n\t\t\t\treflect,\n\t\t\t\tattribute: attributeKey,\n\t\t\t\tdefaultValue: resolvedDefaultValue,\n\t\t\t\tbind,\n\t\t\t});\n\t\t});\n\n\t\treturn function (this: T, value: V) {\n\t\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\t\treturn value;\n\t\t};\n\t};\n}\n"
|
|
9
9
|
],
|
|
10
|
-
"mappings": "
|
|
11
|
-
"debugId": "
|
|
10
|
+
"mappings": "i0BAEA,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,CAA8B,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAc,EAAO,YACrB,EAAc,EAAY,IAA8B,CAAC,EAE/D,GAAI,EAAY,KAAK,CAAC,IAAe,EAAW,OAAS,CAAY,EACpE,OAGD,EAAY,KAAK,CAAE,KAAM,EAAc,SAAQ,CAAC,EAChD,EAAY,GAA6B,EAGnC,SAAS,CAA0B,CAAC,EAA0C,CACpF,OAAS,EAAO,YAAoD,IAA8B,CAAC,GAAG,MAAM,EClBtG,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,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EAC3C,QAA2C,CAAC,EAAc,EAA2C,CAC3G,IAAM,EAAe,OAAO,EAAQ,IAAI,EAClC,EAAe,GAAa,EAC5B,EAAsB,OAAO,mCAAmC,eAA0B,EAuBhG,OArBA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAAgD,GACpE,EAAwB,IAAiB,OAAY,EAAmB,EAG9E,EAA+B,KAAM,EAAc,CAClD,OACA,UACA,UAAW,EACX,eACA,MACD,CAAC,EACD,KAAK,mBAAmB,EAAc,CACrC,OACA,UACA,UAAW,EACX,aAAc,EACd,MACD,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAA4C,GAAuB,EAC7D",
|
|
11
|
+
"debugId": "BA2727CC6F2C320D64756E2164756E21",
|
|
12
12
|
"names": []
|
|
13
13
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:w,getOwnPropertyNames:_,getOwnPropertyDescriptor:k}=Object,A=Object.prototype.hasOwnProperty;function E(q){return this[q]}var H=(q)=>{var G=(L??=new WeakMap).get(q),Q;if(G)return G;if(G=w({},"__esModule",{value:!0}),q&&typeof q==="object"||typeof q==="function"){for(var X of _(q))if(!A.call(G,X))w(G,X,{get:E.bind(q,X),enumerable:!(Q=k(q,X))||Q.enumerable})}return L.set(q,G),G},L;var I=(q)=>q;function N(q,G){this[q]=I.bind(null,G)}var V=(q,G)=>{for(var Q in G)w(q,Q,{get:G[Q],enumerable:!0,configurable:!0,set:N.bind(G,Q)})};var c=(q,G)=>()=>(q&&(G=q(q=0)),G);var T=((q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(q,{get:(G,Q)=>(typeof require<"u"?require:G)[Q]}):q)(function(q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+q+'" is not supported')});function W(q){return q.replace(/&/g,"\\u0026").replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}var J="data-hydration",f="data-hydration-type",B="data-hydration-key";function z(q){let G=q.hydrationKey?` ${B}="${m(q.hydrationKey)}"`:"";return`<script type="application/json" ${J} ${f}="${q.type}"${G}>${q.serializedValue}</script>`}function C(q){return W(q)}function O(q,G){let Q=q.textContent;if(!Q)return G;try{return JSON.parse(Q)}catch{if(typeof console<"u")console.warn(`[@ecopages/radiant] Failed to parse hydration payload from <script ${J}>:`,Q.slice(0,120));return G}}function D(q,G,Q){let X=q.children;if(!X||X.length===0){let Z=q.childNodes;if(!Z||Z.length===0)return null;for(let $=0;$<Z.length;$+=1){let M=Z[$];if(M.nodeType!==1)continue;let j=M;if(P(j,G,Q))return j}return null}for(let Z=0;Z<X.length;Z+=1)if(P(X[Z],G,Q))return X[Z];return null}function P(q,G,Q){if(q.tagName!=="SCRIPT"||!q.hasAttribute(J)||q.getAttribute(f)!==G)return!1;if(Q!==void 0)return q.getAttribute(B)===Q;return!q.hasAttribute(B)}function m(q){return q.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function U(q){return q.shouldAutoBindReactiveMembers?.()??!1}function x(q){return z({type:"signal",...q})}function K(q){return C(q)}import{createMarkupNodeLike as v}from"@ecopages/jsx";import{state as S}from"@ecopages/signals";function b(q){return typeof q==="object"&&q!==null&&typeof q.get==="function"&&typeof q.set==="function"&&typeof q.subscribe==="function"&&typeof q.update==="function"}class g{host;hydrate;hydrationKey;property;source;currentValue;hasAppliedHostHydration=!1;sourceUnsubscribe;constructor(q){this.host=q.host,this.hydrate=q.hydrate,this.hydrationKey=q.hydrationKey,this.property=q.property,this.source=q.source??S(this.resolveInitialValue(q.initialValue)),this.currentValue=this.source.get(),this.host.registerReactiveMember(this.property,this.source)}get(){return this.source.get()}set(q){this.source.set(q)}subscribe(q){return this.source.subscribe(q)}update(q){this.set(q(this.get()))}connectToSource(){if(this.sourceUnsubscribe)return;let q=this.source.get();if(!Object.is(this.currentValue,q))this.currentValue=q;this.sourceUnsubscribe=this.source.subscribe((G)=>{this.handleSourceChange(G)})}disconnectFromSource(){this.sourceUnsubscribe?.(),this.sourceUnsubscribe=void 0}hydrateFromHost(){if(!this.hydrate||this.hasAppliedHostHydration)return;this.hasAppliedHostHydration=!0;let q=this.source.get(),G=this.resolveInitialValue(q);if(!Object.is(q,G))this.source.set(G),this.currentValue=this.source.get()}renderHydrationScript(){let q=this.renderHydrationScriptTag();if(!q)return;return v(q)}renderHydrationScriptTag(){let q=this.serializeHydrationValue();if(!q)return;return x({hydrationKey:this.hydrationKey,serializedValue:q})}findHydrationScriptElement(){if(!(this.host instanceof Element))return null;return D(this.host,"signal",this.hydrationKey)}isObject(q){return typeof q==="object"&&!Array.isArray(q)&&q!==null}resolveInitialValue(q){if(!this.hydrate)return q;let G=this.findHydrationScriptElement();if(!G)return q;let Q=O(G,q);if(this.hydrate===Object&&this.isObject(Q)&&this.isObject(q))return{...q,...Q};return Q}serializeHydrationValue(){if(!this.hydrate)return;let q=JSON.stringify(this.get());if(typeof q!=="string")return;return K(q)}handleSourceChange(q){this.currentValue=q}}function R(q){return new g(q)}function Y(q){return typeof q.registerHydrationBinding==="function"}function Q0(q={}){return function(G,Q){let X=String(Q.name);return function(Z){let $=typeof q.source==="function"?q.source(this):q.source??(b(Z)?Z:void 0),M=$!==void 0?q.initial:Z===void 0?q.initial:Z,j=q.bind??U(this);this.defineReactiveBinding(X,j);let F=R({host:this,hydrate:q.hydrate,hydrationKey:X,initialValue:M,property:X,source:$});if(this.registerConnectedCallback(()=>{F.hydrateFromHost(),F.connectToSource()}),this.registerCleanupCallback(()=>{F.disconnectFromSource()}),q.hydrate&&Y(this))this.registerHydrationBinding(X,F);return F}}}export{Q0 as signal};
|
|
2
|
+
|
|
3
|
+
//# debugId=6D92CC35E8375D3464756E2164756E21
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/tools/escape-script-json.ts", "../src/core/hydration-codec.ts", "../src/decorators/shared/auto-bind.ts", "../src/signals/hydration-script.ts", "../src/signals/host-signal.ts", "../src/core/hydration-capable-host.ts", "../src/decorators/standard/signal.ts"],
|
|
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 type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\ntype AutoBindHost = ReactiveHostLike & {\n\tshouldAutoBindReactiveMembers?: () => boolean;\n};\n\nexport function resolveHostAutoBind(host: AutoBindHost): ReactiveBindingOption {\n\treturn host.shouldAutoBindReactiveMembers?.() ?? false;\n}\n",
|
|
8
|
+
"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",
|
|
9
|
+
"import { createMarkupNodeLike, type JsxRenderable } from '@ecopages/jsx';\nimport { state, type WritableSignal } from '@ecopages/signals';\nimport type { ReactiveState } from '../core/reactivity-contract';\nimport type { SsrSerializableHydrationBinding } from '../core/ssr-hydration-binding';\nimport type { AttributeTypeConstant } from '../utils/attribute-utils';\nimport { findHydrationScript, parseHydrationPayload } from '../core/hydration-codec';\nimport { createSignalHydrationScriptTag, escapeSignalHydrationJson } from './hydration-script';\n\ntype HostSignalOwner = {\n\tregisterReactiveMember<Value>(property: string, signal: ReactiveState<Value>): void;\n};\n\ntype HostSignalOptions<Value> = {\n\thost: HostSignalOwner;\n\thydrate?: AttributeTypeConstant;\n\thydrationKey?: string;\n\tinitialValue?: Value;\n\tproperty: string;\n\tsource?: WritableSignal<Value>;\n};\n\nexport function isWritableSignalLike<Value>(value: unknown): value is WritableSignal<Value> {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof (value as WritableSignal<Value>).get === 'function' &&\n\t\ttypeof (value as WritableSignal<Value>).set === 'function' &&\n\t\ttypeof (value as WritableSignal<Value>).subscribe === 'function' &&\n\t\ttypeof (value as WritableSignal<Value>).update === 'function'\n\t);\n}\n\n/**\n * Host-owned writable signal that bridges signal updates back into Radiant's\n * update callback channel and optional SSR hydration pipeline.\n */\nexport class HostSignal<Value> implements WritableSignal<Value>, SsrSerializableHydrationBinding {\n\tprivate readonly host: HostSignalOwner;\n\tprivate readonly hydrate?: AttributeTypeConstant;\n\tprivate readonly hydrationKey?: string;\n\tprivate readonly property: string;\n\tprivate readonly source: WritableSignal<Value>;\n\tprivate currentValue: Value;\n\tprivate hasAppliedHostHydration = false;\n\tprivate sourceUnsubscribe?: () => void;\n\n\tconstructor(options: HostSignalOptions<Value>) {\n\t\tthis.host = options.host;\n\t\tthis.hydrate = options.hydrate;\n\t\tthis.hydrationKey = options.hydrationKey;\n\t\tthis.property = options.property;\n\t\tthis.source = options.source ?? state(this.resolveInitialValue(options.initialValue as Value));\n\t\tthis.currentValue = this.source.get();\n\t\tthis.host.registerReactiveMember(this.property, this.source);\n\t}\n\n\tpublic get(): Value {\n\t\treturn this.source.get();\n\t}\n\n\tpublic set(nextValue: Value): void {\n\t\tthis.source.set(nextValue);\n\t}\n\n\tpublic subscribe(notify: (value: Value) => void): () => void {\n\t\treturn this.source.subscribe(notify);\n\t}\n\n\tpublic update(updater: (value: Value) => Value): void {\n\t\tthis.set(updater(this.get()));\n\t}\n\n\tpublic connectToSource(): void {\n\t\tif (this.sourceUnsubscribe) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextValue = this.source.get();\n\n\t\tif (!Object.is(this.currentValue, nextValue)) {\n\t\t\tthis.currentValue = nextValue;\n\t\t}\n\n\t\tthis.sourceUnsubscribe = this.source.subscribe((value) => {\n\t\t\tthis.handleSourceChange(value);\n\t\t});\n\t}\n\n\tpublic disconnectFromSource(): void {\n\t\tthis.sourceUnsubscribe?.();\n\t\tthis.sourceUnsubscribe = undefined;\n\t}\n\n\tpublic hydrateFromHost(): void {\n\t\tif (!this.hydrate || this.hasAppliedHostHydration) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hasAppliedHostHydration = true;\n\n\t\tconst previousValue = this.source.get();\n\t\tconst hydratedValue = this.resolveInitialValue(previousValue);\n\n\t\tif (!Object.is(previousValue, hydratedValue)) {\n\t\t\tthis.source.set(hydratedValue);\n\t\t\tthis.currentValue = this.source.get();\n\t\t}\n\t}\n\n\tpublic renderHydrationScript(): 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\tpublic renderHydrationScriptTag(): 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 createSignalHydrationScriptTag({\n\t\t\thydrationKey: this.hydrationKey,\n\t\t\tserializedValue,\n\t\t});\n\t}\n\n\tprivate findHydrationScriptElement(): Element | null {\n\t\tif (!(this.host instanceof Element)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn findHydrationScript(this.host, 'signal', this.hydrationKey);\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 resolveInitialValue(initialValue: Value): Value {\n\t\tif (!this.hydrate) {\n\t\t\treturn initialValue;\n\t\t}\n\n\t\tconst hydrationScriptElement = this.findHydrationScriptElement();\n\n\t\tif (!hydrationScriptElement) {\n\t\t\treturn initialValue;\n\t\t}\n\n\t\tconst parsedHydrationValue = parseHydrationPayload(hydrationScriptElement, initialValue);\n\n\t\tif (this.hydrate === Object && this.isObject(parsedHydrationValue) && this.isObject(initialValue)) {\n\t\t\treturn {\n\t\t\t\t...initialValue,\n\t\t\t\t...parsedHydrationValue,\n\t\t\t} as Value;\n\t\t}\n\n\t\treturn parsedHydrationValue;\n\t}\n\n\tprivate serializeHydrationValue(): string | undefined {\n\t\tif (!this.hydrate) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst serializedValue = JSON.stringify(this.get());\n\n\t\tif (typeof serializedValue !== 'string') {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn escapeSignalHydrationJson(serializedValue);\n\t}\n\n\tprivate handleSourceChange(nextValue: Value): void {\n\t\tthis.currentValue = nextValue;\n\t}\n}\n\nexport function createHostSignal<Value>(options: HostSignalOptions<Value>): HostSignal<Value> {\n\treturn new HostSignal(options);\n}\n",
|
|
10
|
+
"import type { SsrSerializableHydrationBinding } from './ssr-hydration-binding';\n\n/**\n * Hosts that can register keyed SSR hydration bindings.\n */\nexport interface HydrationCapableHost {\n\tregisterHydrationBinding(name: string, binding: SsrSerializableHydrationBinding): void;\n}\n\nexport function isHydrationCapableHost(host: object): host is HydrationCapableHost {\n\treturn typeof (host as HydrationCapableHost).registerHydrationBinding === 'function';\n}\n",
|
|
11
|
+
"import type { WritableSignal } from '@ecopages/signals';\nimport type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\nimport { createHostSignal, isWritableSignalLike } from '../../signals/host-signal';\nimport { isHydrationCapableHost } from '../../core/hydration-capable-host';\nimport type { AttributeTypeConstant } from '../../utils/attribute-utils';\n\n/** Options for the `@signal` decorator. */\nexport type SignalDecoratorOptions<Value = unknown> = {\n\t/**\n\t * Exposes a JSX binding companion for the decorated signal.\n\t *\n\t * - `true` creates a `$propertyName` accessor.\n\t * - a string creates a custom accessor with that name.\n\t * - `undefined` defers to the host default.\n\t */\n\tbind?: ReactiveBindingOption;\n\n\t/**\n\t * Optional initial value used when the field does not provide one directly.\n\t *\n\t * This is primarily useful with `declare field: WritableSignal<T>` syntax,\n\t * which keeps the component surface clean while still letting the decorator\n\t * own signal construction.\n\t */\n\tinitial?: Value;\n\n\t/**\n\t * Connects an existing writable signal to the host instead of creating a\n\t * host-owned one.\n\t */\n\tsource?: WritableSignal<Value> | ((host: ReactiveHostLike) => WritableSignal<Value>);\n\n\t/**\n\t * Serializes the current signal value into a keyed hydration script during\n\t * SSR and restores it on the client.\n\t */\n\thydrate?: AttributeTypeConstant;\n};\n\nexport function signal<Value = unknown>(options: SignalDecoratorOptions<Value> = {}) {\n\treturn function <T extends ReactiveHostLike, Value>(_: undefined, context: ClassFieldDecoratorContext<T, unknown>) {\n\t\tconst propertyName = String(context.name);\n\n\t\treturn function (this: T, initialValue: Value | WritableSignal<Value>) {\n\t\t\tconst resolvedSource =\n\t\t\t\ttypeof options.source === 'function'\n\t\t\t\t\t? options.source(this)\n\t\t\t\t\t: (options.source ?? (isWritableSignalLike<Value>(initialValue) ? initialValue : undefined));\n\t\t\tconst resolvedInitialValue =\n\t\t\t\tresolvedSource !== undefined\n\t\t\t\t\t? options.initial\n\t\t\t\t\t: ((initialValue === undefined ? options.initial : initialValue) as Value);\n\t\t\tconst bind = options.bind ?? resolveHostAutoBind(this);\n\n\t\t\tthis.defineReactiveBinding(propertyName, bind);\n\n\t\t\tconst hostSignal = createHostSignal({\n\t\t\t\thost: this,\n\t\t\t\thydrate: options.hydrate,\n\t\t\t\thydrationKey: propertyName,\n\t\t\t\tinitialValue: resolvedInitialValue,\n\t\t\t\tproperty: propertyName,\n\t\t\t\tsource: resolvedSource,\n\t\t\t});\n\n\t\t\tthis.registerConnectedCallback(() => {\n\t\t\t\thostSignal.hydrateFromHost();\n\t\t\t\thostSignal.connectToSource();\n\t\t\t});\n\t\t\tthis.registerCleanupCallback(() => {\n\t\t\t\thostSignal.disconnectFromSource();\n\t\t\t});\n\n\t\t\tif (options.hydrate && isHydrationCapableHost(this)) {\n\t\t\t\tthis.registerHydrationBinding(propertyName, hostSignal);\n\t\t\t}\n\n\t\t\treturn hostSignal as unknown as WritableSignal<Value>;\n\t\t};\n\t};\n}\n"
|
|
12
|
+
],
|
|
13
|
+
"mappings": "i0BAIO,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,mCAAmC,KAAuB,MAA6B,EAAQ,QAAQ,KAAgB,EAAQ,2BAIhI,SAAS,CAAmB,CAAC,EAAuB,CAC1D,OAAO,EAAiB,CAAK,EAIvB,SAAS,CAAwB,CAAC,EAAkB,EAAgB,CAC1E,IAAM,EAAc,EAAQ,YAE5B,GAAI,CAAC,EACJ,OAAO,EAGR,GAAI,CACH,OAAO,KAAK,MAAM,CAAW,EAC5B,KAAM,CACP,GAAI,OAAO,QAAY,IACtB,QAAQ,KACP,sEAAsE,MACtE,EAAY,MAAM,EAAG,GAAG,CACzB,EAED,OAAO,GAUF,SAAS,CAAmB,CAClC,EACA,EACA,EACiB,CACjB,IAAM,EAAW,EAAK,SAEtB,GAAI,CAAC,GAAY,EAAS,SAAW,EAAG,CACvC,IAAM,EAAc,EAAkE,WAEtF,GAAI,CAAC,GAAc,EAAW,SAAW,EACxC,OAAO,KAGR,QAAS,EAAI,EAAG,EAAI,EAAW,OAAQ,GAAK,EAAG,CAC9C,IAAM,EAAO,EAAW,GAExB,GAAI,EAAK,WAAa,EACrB,SAGD,IAAM,EAAU,EAEhB,GAAI,EAAu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aAAc,EACd,aAAc,EACd,SAAU,EACV,OAAQ,CACT,CAAC,EAUD,GARA,KAAK,0BAA0B,IAAM,CACpC,EAAW,gBAAgB,EAC3B,EAAW,gBAAgB,EAC3B,EACD,KAAK,wBAAwB,IAAM,CAClC,EAAW,qBAAqB,EAChC,EAEG,EAAQ,SAAW,EAAuB,IAAI,EACjD,KAAK,yBAAyB,EAAc,CAAU,EAGvD,OAAO",
|
|
14
|
+
"debugId": "6D92CC35E8375D3464756E2164756E21",
|
|
15
|
+
"names": []
|
|
16
|
+
}
|
|
@@ -2,8 +2,9 @@ import type { ReactiveHostLike } from '../core/reactive-host';
|
|
|
2
2
|
/**
|
|
3
3
|
* Declares internal mutable component state.
|
|
4
4
|
*
|
|
5
|
-
* Each write
|
|
6
|
-
*
|
|
5
|
+
* Each write updates the member state, which notifies `@onUpdated` listeners and
|
|
6
|
+
* keeps JSX bindings in sync. Render invalidation happens through the reactive
|
|
7
|
+
* render path when `render()` reads reactive members. When no explicit binding option
|
|
7
8
|
* is supplied, `RadiantElement` hosts expose a JSX companion binding
|
|
8
9
|
* accessor automatically while plain imperative hosts keep binding
|
|
9
10
|
* opt-in.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:c,getOwnPropertyNames:T,getOwnPropertyDescriptor:l}=Object,D=Object.prototype.hasOwnProperty;function L(o){return this[o]}var k=(o)=>{var t=(s??=new WeakMap).get(o),d;if(t)return t;if(t=c({},"__esModule",{value:!0}),o&&typeof o==="object"||typeof o==="function"){for(var e of T(o))if(!D.call(t,e))c(t,e,{get:L.bind(o,e),enumerable:!(d=l(o,e))||d.enumerable})}return s.set(o,t),t},s;var C=(o)=>o;function V(o,t){this[o]=C.bind(null,t)}var A=(o,t)=>{for(var d in t)c(o,d,{get:t[d],enumerable:!0,configurable:!0,set:V.bind(t,d)})};var O=(o,t)=>()=>(o&&(t=o(o=0)),t);var q=((o)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(t,d)=>(typeof require<"u"?require:t)[d]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var M=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),R=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),B=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function F(o,t){H(o,M,t)}function f(o,t){H(o,R,t)}function _(o){j(o,M)}function y(o,t){let d=o;S(o,t,d[B]??=new Set)}function H(o,t,d){let e=o,r=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;if(Array.isArray(r)){r.push(d);return}Object.defineProperty(e,t,{value:[d]})}function j(o,t){w(o,(d)=>{let e=d[t];if(!Array.isArray(e))return;for(let r of e)r(o)})}function S(o,t,d){for(let e of x(o)){let r=e[R];if(!Array.isArray(r))continue;for(let n of r){if(d.has(n))continue;n(o,t),d.add(n)}}}function x(o){let t=[],d=Object.getPrototypeOf(o);while(d&&d!==Object.prototype)t.unshift(d),d=Object.getPrototypeOf(d);return t}function w(o,t){for(let d of x(o))t(d)}function v(o){return typeof o==="function"}function a(o,t,d,e){if(typeof e==="object")return o(void 0,e);return t(d,e)}function G(o,t,d,e,r){if(typeof e==="object"){if(!v(d))throw TypeError("Standard method decorators require a method target");return o(d,e)}if(!r)throw TypeError("Legacy method decorators require a property descriptor");return t(d,e,r)}function u(o){return o.shouldAutoBindReactiveMembers?.()??!1}function g(o,t,d,e=!1){if(o.getReactiveMember(t))return;if(o.createReactiveMember(t,d),e!==void 0&&e!==!1)o.defineReactiveBinding(t,e)}function h(o,t){F(o,(d)=>{g(d,t,d[t],u(d))}),f(o,(d)=>{d.createReactiveField(t,d[t],{bind:u(d)})})}function P(o,t){let d=String(t.name),e=Symbol(`@ecopages/radiant/state:${d}:initializer`);return t.addInitializer(function(){let r=this[e];this.createReactiveField(d,r,{bind:u(this),suppressInitialNotify:!0})}),function(r){return this[e]=r,r}}function z(o,t){return a(P,h,o,t)}export{z as state};
|
|
2
|
+
|
|
3
|
+
//# debugId=01BBD8A672AFCD0964756E2164756E21
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/decorators/bridge.ts", "../src/decorators/shared/auto-bind.ts", "../src/decorators/legacy/member-bootstrap.ts", "../src/decorators/legacy/reactive-field.ts", "../src/decorators/standard/reactive-field.ts", "../src/decorators/state.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"export type LegacyPostConstructionPhase = 'connect' | 'ssr';\n\ntype LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\ntype LegacyPostConstructionInitializer<T extends object = object> = (\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\nconst LEGACY_POST_CONSTRUCTION_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-post-construction-initializers');\nconst LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS = Symbol.for(\n\t'@ecopages/radiant.legacy-executed-post-construction-initializers',\n);\n\n/**\n * Registers per-instance initialization work for a legacy decorator.\n *\n * Legacy decorators execute against the prototype, so any initialization that\n * needs the concrete element instance must be deferred until construction time.\n */\nexport function registerLegacyInstanceInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyInstanceInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_INSTANCE_INITIALIZERS, initializer);\n}\n\n/**\n * Registers post-construction work for a legacy decorator.\n *\n * This phase exists for decorators that eagerly write instance fields. With\n * legacy decorators plus `useDefineForClassFields`, subclass field definition\n * can overwrite values written during the base-class constructor.\n */\nexport function registerLegacyPostConstructionInitializer<T extends object>(\n\tproto: T,\n\tinitializer: LegacyPostConstructionInitializer<T>,\n): void {\n\tregisterInitializer(proto, LEGACY_POST_CONSTRUCTION_INITIALIZERS, initializer);\n}\n\n/**\n * Runs all legacy decorator initializers for a newly constructed element.\n *\n * Initializers are collected from the prototype chain and executed from base to\n * derived class so inherited setup remains stable.\n */\nexport function runLegacyInstanceInitializers<T extends object>(instance: T): void {\n\trunLegacyInitializers(instance, LEGACY_INSTANCE_INITIALIZERS);\n}\n\n/**\n * Runs legacy decorator setup that must happen after subclass field\n * initialization has completed.\n *\n * Each initializer runs at most once per instance even if multiple lifecycle\n * entrypoints call this helper.\n */\nexport function runLegacyPostConstructionInitializers<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyPostConstructionInitializersOnPrototypeChain(\n\t\tinstance,\n\t\tphase,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<\n\t\t\tLegacyPostConstructionInitializer<T>\n\t\t>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(\n\tproto: T,\n\tkey: symbol,\n\tinitializer: LegacyInstanceInitializer<T> | LegacyPostConstructionInitializer<T>,\n): void {\n\tconst target = proto as Record<PropertyKey, unknown>;\n\tconst ownInitializers = Object.prototype.hasOwnProperty.call(target, key) ? target[key] : undefined;\n\n\tif (Array.isArray(ownInitializers)) {\n\t\townInitializers.push(initializer);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(target, key, {\n\t\tvalue: [initializer],\n\t});\n}\n\nfunction runLegacyInitializers<T extends object>(instance: T, key: symbol): void {\n\twalkPrototypeChain(instance, (prototype) => {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as\n\t\t\tLegacyInstanceInitializer<T>[] | undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tinitializer(instance);\n\t\t}\n\t});\n}\n\nfunction runLegacyPostConstructionInitializersOnPrototypeChain<T extends object>(\n\tinstance: T,\n\tphase: LegacyPostConstructionPhase,\n\texecutedInitializers: Set<LegacyPostConstructionInitializer<T>>,\n): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tconst initializers = (prototype as Record<PropertyKey, unknown>)[LEGACY_POST_CONSTRUCTION_INITIALIZERS] as\n\t\t\tLegacyPostConstructionInitializer<T>[] | undefined;\n\n\t\tif (!Array.isArray(initializers)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tfor (const initializer of initializers) {\n\t\t\tif (executedInitializers.has(initializer)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tinitializer(instance, phase);\n\t\t\texecutedInitializers.add(initializer);\n\t\t}\n\t}\n}\n\nfunction collectPrototypeChain<T extends object>(instance: T): object[] {\n\tconst prototypes: object[] = [];\n\tlet prototype: object | null = Object.getPrototypeOf(instance);\n\n\twhile (prototype && prototype !== Object.prototype) {\n\t\tprototypes.unshift(prototype);\n\t\tprototype = Object.getPrototypeOf(prototype);\n\t}\n\n\treturn prototypes;\n}\n\nfunction walkPrototypeChain<T extends object>(instance: T, visit: (prototype: object) => void): void {\n\tfor (const prototype of collectPrototypeChain(instance)) {\n\t\tvisit(prototype);\n\t}\n}\n",
|
|
6
|
+
"import type { Method } from '../types';\n\ntype StandardFieldFn<Host extends object, Value, Result> = (\n\ttarget: undefined,\n\tcontext: ClassFieldDecoratorContext<Host, Value>,\n) => Result;\n\ntype LegacyFieldFn<Proto, Result> = (proto: Proto, name: string) => Result;\n\ntype StandardMethodFn<Host extends object, TMethod extends Method, Result> = (\n\ttarget: TMethod,\n\tcontext: ClassMethodDecoratorContext<Host, TMethod>,\n) => Result;\n\ntype LegacyMethodFn<Proto, Result> = (proto: Proto, name: string, descriptor: PropertyDescriptor) => Result;\n\nfunction isMethod(value: unknown): value is Method {\n\treturn typeof value === 'function';\n}\n\nexport function fieldDecoratorBridge<Host extends object, Value, Result, Proto>(\n\tstandard: StandardFieldFn<Host, Value, Result>,\n\tlegacy: LegacyFieldFn<Proto, void>,\n\tprotoOrTarget: undefined,\n\tnameOrContext: ClassFieldDecoratorContext<Host, Value>,\n): Result;\nexport function fieldDecoratorBridge<Host extends object, Value, Proto, Result>(\n\tstandard: StandardFieldFn<Host, Value, void>,\n\tlegacy: LegacyFieldFn<Proto, Result>,\n\tprotoOrTarget: Proto,\n\tnameOrContext: string,\n): Result;\nexport function fieldDecoratorBridge<Host extends object, Value, StandardResult, Proto, LegacyResult>(\n\tstandard: StandardFieldFn<Host, Value, StandardResult>,\n\tlegacy: LegacyFieldFn<Proto, LegacyResult>,\n\tprotoOrTarget: Proto | undefined,\n\tnameOrContext: string | ClassFieldDecoratorContext<Host, Value>,\n): StandardResult | LegacyResult;\n\nexport function fieldDecoratorBridge(\n\tstandard: StandardFieldFn<object, unknown, unknown>,\n\tlegacy: LegacyFieldFn<unknown, unknown>,\n\tprotoOrTarget: unknown,\n\tnameOrContext: string | ClassFieldDecoratorContext<object, unknown>,\n): unknown {\n\tif (typeof nameOrContext === 'object') {\n\t\treturn standard(undefined, nameOrContext);\n\t}\n\n\treturn legacy(protoOrTarget, nameOrContext);\n}\n\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, Result, Proto>(\n\tstandard: StandardMethodFn<Host, TMethod, Result>,\n\tlegacy: LegacyMethodFn<Proto, void>,\n\tprotoOrTarget: TMethod,\n\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\tdescriptor?: undefined,\n): Result;\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, Proto, Result>(\n\tstandard: StandardMethodFn<Host, TMethod, void>,\n\tlegacy: LegacyMethodFn<Proto, Result>,\n\tprotoOrTarget: Proto,\n\tnameOrContext: string,\n\tdescriptor: PropertyDescriptor,\n): Result;\nexport function methodDecoratorBridge<Host extends object, TMethod extends Method, StandardResult, Proto, LegacyResult>(\n\tstandard: StandardMethodFn<Host, TMethod, StandardResult>,\n\tlegacy: LegacyMethodFn<Proto, LegacyResult>,\n\tprotoOrTarget: Proto | TMethod,\n\tnameOrContext: string | ClassMethodDecoratorContext<Host, TMethod>,\n\tdescriptor?: PropertyDescriptor,\n): StandardResult | LegacyResult;\n\nexport function methodDecoratorBridge(\n\tstandard: StandardMethodFn<object, Method, unknown>,\n\tlegacy: LegacyMethodFn<unknown, unknown>,\n\tprotoOrTarget: unknown,\n\tnameOrContext: string | ClassMethodDecoratorContext<object, Method>,\n\tdescriptor?: PropertyDescriptor,\n): unknown {\n\tif (typeof nameOrContext === 'object') {\n\t\tif (!isMethod(protoOrTarget)) {\n\t\t\tthrow new TypeError('Standard method decorators require a method target');\n\t\t}\n\n\t\treturn standard(protoOrTarget, nameOrContext);\n\t}\n\n\tif (!descriptor) {\n\t\tthrow new TypeError('Legacy method decorators require a property descriptor');\n\t}\n\n\treturn legacy(protoOrTarget, nameOrContext, descriptor);\n}\n",
|
|
7
|
+
"import type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\ntype AutoBindHost = ReactiveHostLike & {\n\tshouldAutoBindReactiveMembers?: () => boolean;\n};\n\nexport function resolveHostAutoBind(host: AutoBindHost): ReactiveBindingOption {\n\treturn host.shouldAutoBindReactiveMembers?.() ?? false;\n}\n",
|
|
8
|
+
"import type { ReactiveBindingOption } from '../../core/reactive-prop-core';\nimport type { ReactiveHostLike } from '../../core/reactive-host';\n\n/**\n * Registers a member `State` early enough for subclass field initializers that\n * read `this.$.member` (for example `this.$.preference.map(...)`).\n *\n * Post-construction setup still runs afterward to install accessors, SSR prop\n * resolution, and attribute channels once class fields have finished writing.\n */\nexport function bootstrapReactiveMemberBinding(\n\thost: ReactiveHostLike,\n\tpropertyName: string,\n\tinitialValue: unknown,\n\tbind: ReactiveBindingOption = false,\n): void {\n\tif (host.getReactiveMember(propertyName)) {\n\t\treturn;\n\t}\n\n\thost.createReactiveMember(propertyName, initialValue);\n\n\tif (bind !== undefined && bind !== false) {\n\t\thost.defineReactiveBinding(propertyName, bind);\n\t}\n}\n",
|
|
9
|
+
"import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\nimport { registerLegacyInstanceInitializer, registerLegacyPostConstructionInitializer } from './instance-initializers';\nimport { bootstrapReactiveMemberBinding } from './member-bootstrap';\n\n/**\n * A decorator to define a reactive field.\n * Every time the property changes, the `updated` method will be called.\n * Due the fact the value is always undefined before the first update,\n * we are adding a `isDefined` WeakSet to track if the property has been defined.\n * @param target The target element.\n * @param propertyKey The property key.\n */\nexport function reactiveField(target: ReactiveHostLike, propertyKey: string) {\n\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\tbootstrapReactiveMemberBinding(\n\t\t\telement,\n\t\t\tpropertyKey,\n\t\t\telement[propertyKey as keyof typeof element],\n\t\t\tresolveHostAutoBind(element),\n\t\t);\n\t});\n\n\tregisterLegacyPostConstructionInitializer(target, (element) => {\n\t\telement.createReactiveField(propertyKey, element[propertyKey as keyof typeof element], {\n\t\t\tbind: resolveHostAutoBind(element),\n\t\t});\n\t});\n}\n",
|
|
10
|
+
"import type { ReactiveHostLike } from '../../core/reactive-host';\nimport { resolveHostAutoBind } from '../shared/auto-bind';\n\nexport function reactiveField<T extends ReactiveHostLike, V>(_: undefined, context: ClassFieldDecoratorContext<T, V>) {\n\tconst contextName = String(context.name);\n\tconst initializerValueKey = Symbol(`@ecopages/radiant/state:${contextName}:initializer`);\n\n\tcontext.addInitializer(function (this: T) {\n\t\tconst initializerValue = (this as Record<PropertyKey, V | undefined>)[initializerValueKey];\n\t\tthis.createReactiveField(contextName, initializerValue as V, {\n\t\t\tbind: resolveHostAutoBind(this),\n\t\t\tsuppressInitialNotify: true,\n\t\t});\n\t});\n\n\treturn function (this: T, value: V) {\n\t\t(this as Record<PropertyKey, V | undefined>)[initializerValueKey] = value;\n\t\treturn value;\n\t};\n}\n",
|
|
11
|
+
"import type { ReactiveHostLike } from '../core/reactive-host';\nimport { reactiveField as legacyReactiveField } from './legacy/reactive-field';\nimport { reactiveField as standardReactiveField } from './standard/reactive-field';\nimport { fieldDecoratorBridge } from './bridge';\n\n/**\n * Declares internal mutable component state.\n *\n * Each write updates the member state, which notifies `@onUpdated` listeners and\n * keeps JSX bindings in sync. Render invalidation happens through the reactive\n * render path when `render()` reads reactive members. When no explicit binding option\n * is supplied, `RadiantElement` hosts expose a JSX companion binding\n * accessor automatically while plain imperative hosts keep binding\n * opt-in.\n */\nexport function state<THost extends ReactiveHostLike, TValue>(\n\tprotoOrTarget: undefined,\n\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n): (this: THost, value: TValue) => TValue;\nexport function state(protoOrTarget: ReactiveHostLike, nameOrContext: string): void;\nexport function state(\n\tprotoOrTarget: ReactiveHostLike | undefined,\n\tnameOrContext: string | ClassFieldDecoratorContext<ReactiveHostLike, unknown>,\n): ((this: ReactiveHostLike, value: unknown) => unknown) | void {\n\treturn fieldDecoratorBridge(standardReactiveField, legacyReactiveField, protoOrTarget, nameOrContext);\n}\n"
|
|
12
|
+
],
|
|
13
|
+
"mappings": "i0BAQA,IAAM,EAA+B,OAAO,IAAI,gDAAgD,EAC1F,EAAwC,OAAO,IAAI,yDAAyD,EAC5G,EAAiD,OAAO,IAC7D,kEACD,EAQO,SAAS,CAAmD,CAClE,EACA,EACO,CACP,EAAoB,EAAO,EAA8B,CAAW,EAU9D,SAAS,CAA2D,CAC1E,EACA,EACO,CACP,EAAoB,EAAO,EAAuC,CAAW,EASvE,SAAS,CAA+C,CAAC,EAAmB,CAClF,EAAsB,EAAU,CAA4B,EAUtD,SAAS,CAAuD,CACtE,EACA,EACO,CACP,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GAGjE,EAGD,SAAS,CAAqC,CAC7C,EACA,EACA,EACO,CACP,IAAM,EAAS,EACT,EAAkB,OAAO,UAAU,eAAe,KAAK,EAAQ,CAAG,EAAI,EAAO,GAAO,OAE1F,GAAI,MAAM,QAAQ,CAAe,EAAG,CACnC,EAAgB,KAAK,CAAW,EAChC,OAGD,OAAO,eAAe,EAAQ,EAAK,CAClC,MAAO,CA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,CAC9E,OAAO,EAAK,gCAAgC,GAAK,GCE3C,SAAS,CAA8B,CAC7C,EACA,EACA,EACA,EAA8B,GACvB,CACP,GAAI,EAAK,kBAAkB,CAAY,EACtC,OAKD,GAFA,EAAK,qBAAqB,EAAc,CAAY,EAEhD,IAAS,QAAa,IAAS,GAClC,EAAK,sBAAsB,EAAc,CAAI,ECVxC,SAAS,CAAa,CAAC,EAA0B,EAAqB,CAC5E,EAAkC,EAAQ,CAAC,IAAY,CACtD,EACC,EACA,EACA,EAAQ,GACR,EAAoB,CAAO,CAC5B,EACA,EAED,EAA0C,EAAQ,CAAC,IAAY,CAC9D,EAAQ,oBAAoB,EAAa,EAAQ,GAAsC,CACtF,KAAM,EAAoB,CAAO,CAClC,CAAC,EACD,ECxBK,SAAS,CAA4C,CAAC,EAAc,EAA2C,CACrH,IAAM,EAAc,OAAO,EAAQ,IAAI,EACjC,EAAsB,OAAO,2BAA2B,eAAyB,EAUvF,OARA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAA4C,GACtE,KAAK,oBAAoB,EAAa,EAAuB,CAC5D,KAAM,EAAoB,IAAI,EAC9B,sBAAuB,EACxB,CAAC,EACD,EAEM,QAAS,CAAU,EAAU,CAEnC,OADC,KAA4C,GAAuB,EAC7D,GCGF,SAAS,CAAK,CACpB,EACA,EAC+D,CAC/D,OAAO,EAAqB,EAAuB,EAAqB,EAAe,CAAa",
|
|
14
|
+
"debugId": "01BBD8A672AFCD0964756E2164756E21",
|
|
15
|
+
"names": []
|
|
16
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var{defineProperty:I,getOwnPropertyNames:J,getOwnPropertyDescriptor:M}=Object,O=Object.prototype.hasOwnProperty;function S($){return this[$]}var A=($)=>{var x=(V??=new WeakMap).get($),F;if(x)return x;if(x=I({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var W of J($))if(!O.call(x,W))I(x,W,{get:S.bind($,W),enumerable:!(F=M($,W))||F.enumerable})}return V.set($,x),x},V;var T=($)=>$;function y($,x){this[$]=T.bind(null,x)}var E=($,x)=>{for(var F in x)I($,F,{get:x[F],enumerable:!0,configurable:!0,set:y.bind(x,F)})};var m=($,x)=>()=>($&&(x=$($=0)),x);var H=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(x,F)=>(typeof require<"u"?require:x)[F]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});function X($){let x=globalThis.CSS;if(typeof x?.escape==="function")return x.escape($);let F="";for(let W=0;W<$.length;W+=1){let N=$[W]??"",P=N.codePointAt(0)??0;if(P===0){F+="�";continue}let _=P>=1&&P<=31||P===127,j=W===0&&P>=48&&P<=57,z=W===1&&P>=48&&P<=57&&($[0]??"")==="-",B=W===0&&N==="-"&&$.length===1;if(_||j||z){F+=`\\${P.toString(16)} `;continue}if(P>=128||N==="-"||N==="_"||P>=48&&P<=57||P>=65&&P<=90||P>=97&&P<=122){F+=B?`\\${N}`:N;continue}F+=`\\${N}`}return F}var D=Symbol("radiant.shadowRootListenerHooks"),Y=Symbol("radiant.patchedAttachShadow");function q($){if($ instanceof Element)return $;if("host"in $)return $.host;return $.element}function K($){return!($ instanceof Element)}function Z($,x,F,W){let N=(P)=>{if(P.target instanceof Element&&P.target.matches(F))W(P)};return $.addEventListener(x.type,N,x.options),()=>{$.removeEventListener(x.type,N,x.options)}}function R($,x){let F=q($);if(!F[D])F[D]=new Set;if(F[D].add(x),F[Y])return;let W=F.attachShadow;F.attachShadow=function(P){let _=W.call(this,P);for(let j of F[D]??[])j();return _},F[Y]=!0}function k($,x,F){if(K($)&&"scope"in x&&x.scope&&x.scope!=="light")throw Error("RadiantController event listeners only support light DOM scope.");let W=q($),N=F.bind($),P=null,_=null,j=null,z=null,B=!1,Q=()=>{P?.(),_?.(),j?.(),z?.(),P=null,_=null,j=null,z=null},G=()=>{if(B)return;if("window"in x&&!P)window.addEventListener(x.type,N,x.options),P=()=>{window.removeEventListener(x.type,N,x.options)};if("document"in x&&!_)document.addEventListener(x.type,N,x.options),_=()=>{document.removeEventListener(x.type,N,x.options)};if("selector"in x||"ref"in x){let U="selector"in x?x.selector:`[data-ref='${X(x.ref)}']`;if(x.scope!=="shadow"&&!j)j=Z(W,x,U,N);if(x.scope!=="light"&&W.shadowRoot&&!z)z=Z(W.shadowRoot,x,U,N)}};if("selector"in x||"ref"in x){if(x.scope!=="light")R($,()=>{if($.isConnected)G()})}if($.registerConnectedCallback(G),$.registerCleanupCallback(Q),$.isConnected)G();return()=>{B=!0,Q()}}export{k as createEventListener};
|
|
2
|
+
|
|
3
|
+
//# debugId=95635E2CBD21FD0964756E2164756E21
|