@ecopages/radiant 0.3.0-alpha.8 → 0.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/README.md +315 -0
- package/dist/client/app-bootstrap.d.ts +19 -0
- package/dist/client/app-bootstrap.js +3 -0
- package/dist/client/app-bootstrap.js.map +10 -0
- package/dist/context/decorators/consume-context.js +2 -2
- package/dist/context/decorators/consume-context.js.map +4 -4
- package/dist/context/decorators/context-selector.js +2 -2
- package/dist/context/decorators/context-selector.js.map +8 -7
- package/dist/context/decorators/legacy/consume-context.js +2 -2
- package/dist/context/decorators/legacy/consume-context.js.map +4 -4
- package/dist/context/decorators/legacy/context-selector-field.js +2 -2
- package/dist/context/decorators/legacy/context-selector-field.js.map +4 -4
- package/dist/context/decorators/legacy/context-selector.js +2 -2
- package/dist/context/decorators/legacy/context-selector.js.map +4 -4
- package/dist/context/decorators/legacy/provide-context.js +2 -2
- package/dist/context/decorators/legacy/provide-context.js.map +4 -4
- package/dist/context/decorators/on-context-update.js +2 -2
- package/dist/context/decorators/on-context-update.js.map +4 -4
- package/dist/context/decorators/provide-context.js +2 -2
- package/dist/context/decorators/provide-context.js.map +4 -4
- package/dist/context/decorators/standard-legacy-dispatch.d.ts +6 -0
- package/dist/context/decorators/standard-legacy-dispatch.js +3 -0
- package/dist/context/decorators/standard-legacy-dispatch.js.map +10 -0
- package/dist/context/index.js +2 -2
- package/dist/context/index.js.map +11 -10
- package/dist/controller-registry.js +2 -2
- package/dist/controller-registry.js.map +3 -3
- package/dist/core/event-subscription-registry.d.ts +16 -0
- package/dist/core/event-subscription-registry.js +3 -0
- package/dist/core/event-subscription-registry.js.map +10 -0
- package/dist/core/host-ssr-registry.d.ts +13 -0
- package/dist/core/host-ssr-registry.js +3 -0
- package/dist/core/host-ssr-registry.js.map +10 -0
- package/dist/core/hydration-capable-host.d.ts +8 -0
- package/dist/core/hydration-capable-host.js +3 -0
- package/dist/core/hydration-capable-host.js.map +10 -0
- package/dist/core/radiant-controller.d.ts +36 -15
- package/dist/core/radiant-controller.js +2 -2
- package/dist/core/radiant-controller.js.map +13 -6
- package/dist/core/{radiant-component-ssr.d.ts → radiant-element-ssr-host.d.ts} +16 -16
- package/dist/core/radiant-element-ssr-host.js +3 -0
- package/dist/core/radiant-element-ssr-host.js.map +10 -0
- package/dist/core/radiant-element-ssr-registry.d.ts +18 -0
- package/dist/core/radiant-element-ssr-registry.js +3 -0
- package/dist/core/radiant-element-ssr-registry.js.map +10 -0
- package/dist/core/radiant-element.d.ts +38 -138
- package/dist/core/radiant-element.js +2 -2
- package/dist/core/radiant-element.js.map +21 -10
- package/dist/core/reactive-host.d.ts +3 -16
- package/dist/core/reactive-host.js +2 -2
- package/dist/core/reactive-host.js.map +7 -4
- package/dist/core/reactive-jsx-value.d.ts +2 -1
- package/dist/core/reactive-jsx-value.js.map +2 -2
- package/dist/core/reactive-prop-core.d.ts +44 -0
- package/dist/core/reactive-prop-core.js +3 -0
- package/dist/core/reactive-prop-core.js.map +11 -0
- package/dist/core/reactive-prop-metadata.d.ts +1 -1
- package/dist/core/reactive-prop-metadata.js +2 -2
- package/dist/core/reactive-prop-metadata.js.map +2 -2
- package/dist/core/reactive-property-state.d.ts +17 -0
- package/dist/core/reactive-property-state.js +3 -0
- package/dist/core/reactive-property-state.js.map +12 -0
- package/dist/core/reactivity-adapter.d.ts +8 -0
- package/dist/core/reactivity-adapter.js +3 -0
- package/dist/core/reactivity-adapter.js.map +12 -0
- package/dist/core/reactivity-contract.d.ts +39 -0
- package/dist/core/reactivity-contract.js +2 -0
- package/dist/core/reactivity-contract.js.map +9 -0
- package/dist/core/reactivity-runtime.d.ts +18 -0
- package/dist/core/reactivity-runtime.js +3 -0
- package/dist/core/reactivity-runtime.js.map +11 -0
- package/dist/core/reactivity-signals.d.ts +10 -0
- package/dist/core/reactivity-signals.js +3 -0
- package/dist/core/reactivity-signals.js.map +10 -0
- package/dist/core/render-runtime.d.ts +28 -0
- package/dist/core/render-runtime.js +3 -0
- package/dist/core/render-runtime.js.map +16 -0
- package/dist/core/render-scheduler.d.ts +22 -0
- package/dist/core/render-scheduler.js +3 -0
- package/dist/core/render-scheduler.js.map +10 -0
- package/dist/core/slot-projection-runtime.js +2 -2
- package/dist/core/slot-projection-runtime.js.map +3 -3
- package/dist/decorators/attr.js +2 -2
- package/dist/decorators/attr.js.map +6 -5
- package/dist/decorators/controller.js +2 -2
- package/dist/decorators/controller.js.map +3 -3
- package/dist/decorators/event.js +2 -2
- package/dist/decorators/event.js.map +3 -3
- package/dist/decorators/legacy/attr.js +2 -2
- package/dist/decorators/legacy/attr.js.map +6 -5
- package/dist/decorators/legacy/event.js +2 -2
- package/dist/decorators/legacy/event.js.map +3 -3
- package/dist/decorators/legacy/host-readiness.d.ts +8 -0
- package/dist/decorators/legacy/host-readiness.js +3 -0
- package/dist/decorators/legacy/host-readiness.js.map +11 -0
- package/dist/decorators/legacy/instance-initializers.d.ts +16 -0
- package/dist/decorators/legacy/instance-initializers.js +2 -2
- package/dist/decorators/legacy/instance-initializers.js.map +3 -3
- package/dist/decorators/legacy/on-event.js +2 -2
- package/dist/decorators/legacy/on-event.js.map +6 -5
- package/dist/decorators/legacy/on-updated.d.ts +1 -1
- package/dist/decorators/legacy/on-updated.js +2 -2
- package/dist/decorators/legacy/on-updated.js.map +4 -4
- package/dist/decorators/legacy/query-slot.js +2 -2
- package/dist/decorators/legacy/query-slot.js.map +5 -5
- package/dist/decorators/legacy/query.js +2 -2
- package/dist/decorators/legacy/query.js.map +3 -3
- package/dist/decorators/legacy/reactive-field.js +2 -2
- package/dist/decorators/legacy/reactive-field.js.map +3 -3
- package/dist/decorators/legacy/reactive-prop.d.ts +1 -1
- package/dist/decorators/legacy/reactive-prop.js +2 -2
- package/dist/decorators/legacy/reactive-prop.js.map +7 -6
- package/dist/decorators/legacy/signal.d.ts +1 -1
- package/dist/decorators/legacy/signal.js +2 -2
- package/dist/decorators/legacy/signal.js.map +6 -5
- package/dist/decorators/on-event.js +2 -2
- package/dist/decorators/on-event.js.map +6 -5
- package/dist/decorators/on-updated.js +2 -2
- package/dist/decorators/on-updated.js.map +4 -4
- package/dist/decorators/prop.d.ts +1 -1
- package/dist/decorators/prop.js +2 -2
- package/dist/decorators/prop.js.map +9 -8
- package/dist/decorators/query-slot.js +2 -2
- package/dist/decorators/query-slot.js.map +6 -6
- package/dist/decorators/query.js +2 -2
- package/dist/decorators/query.js.map +3 -3
- package/dist/decorators/shared/reactive-attr.d.ts +1 -1
- package/dist/decorators/shared/reactive-attr.js +2 -2
- package/dist/decorators/shared/reactive-attr.js.map +5 -4
- package/dist/decorators/signal.js +2 -2
- package/dist/decorators/signal.js.map +7 -6
- package/dist/decorators/standard/attr.js +2 -2
- package/dist/decorators/standard/attr.js.map +5 -4
- package/dist/decorators/standard/on-event.js +2 -2
- package/dist/decorators/standard/on-event.js.map +5 -4
- package/dist/decorators/standard/query-slot.d.ts +0 -1
- package/dist/decorators/standard/query-slot.js +2 -2
- package/dist/decorators/standard/query-slot.js.map +4 -4
- package/dist/decorators/standard/reactive-field.js +2 -2
- package/dist/decorators/standard/reactive-field.js.map +3 -3
- package/dist/decorators/standard/reactive-prop.d.ts +1 -1
- package/dist/decorators/standard/reactive-prop.js +2 -2
- package/dist/decorators/standard/reactive-prop.js.map +6 -5
- package/dist/decorators/standard/signal.d.ts +1 -1
- package/dist/decorators/standard/signal.js +2 -2
- package/dist/decorators/standard/signal.js.map +5 -4
- package/dist/decorators/state.js +2 -2
- package/dist/decorators/state.js.map +4 -4
- package/dist/helpers/create-event-listener.js +2 -2
- package/dist/helpers/create-event-listener.js.map +5 -4
- package/dist/helpers/create-query-slot.d.ts +0 -1
- package/dist/helpers/create-query-slot.js +2 -2
- package/dist/helpers/create-query-slot.js.map +3 -3
- package/dist/helpers/index.js +2 -2
- package/dist/helpers/index.js.map +6 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +37 -25
- package/dist/package.json +209 -0
- package/dist/server/host-attribute-serialization.d.ts +46 -0
- package/dist/server/host-attribute-serialization.js +3 -0
- package/dist/server/host-attribute-serialization.js.map +12 -0
- package/dist/server/host-script-composition.d.ts +42 -0
- package/dist/server/host-script-composition.js +3 -0
- package/dist/server/host-script-composition.js.map +10 -0
- package/dist/server/install-light-dom-shim.js +2 -2
- package/dist/server/install-light-dom-shim.js.map +3 -3
- package/dist/server/internal-radiant-host.d.ts +2 -0
- package/dist/server/internal-radiant-host.js +3 -0
- package/dist/server/internal-radiant-host.js.map +9 -0
- package/dist/server/light-dom-shim.d.ts +9 -0
- package/dist/server/light-dom-shim.js +2 -2
- package/dist/server/light-dom-shim.js.map +3 -3
- package/dist/server/radiant-element-ssr-bridge.d.ts +21 -0
- package/dist/server/radiant-element-ssr-bridge.js +3 -0
- package/dist/server/radiant-element-ssr-bridge.js.map +24 -0
- package/dist/server/radiant-element-ssr-extractor.d.ts +2 -0
- package/dist/server/radiant-element-ssr-extractor.js +3 -0
- package/dist/server/radiant-element-ssr-extractor.js.map +12 -0
- package/dist/server/radiant-element-ssr-service.d.ts +13 -0
- package/dist/server/radiant-element-ssr-service.js +3 -0
- package/dist/server/radiant-element-ssr-service.js.map +22 -0
- package/dist/server/radiant-element-ssr.d.ts +1 -0
- package/dist/server/radiant-element-ssr.js +3 -0
- package/dist/server/radiant-element-ssr.js.map +24 -0
- package/dist/server/render-component.d.ts +3 -9
- package/dist/server/render-component.js +2 -2
- package/dist/server/render-component.js.map +17 -9
- package/dist/server/render-controller.js +2 -2
- package/dist/server/render-controller.js.map +19 -11
- package/dist/server/render-fragment.d.ts +7 -0
- package/dist/server/render-fragment.js +3 -0
- package/dist/server/render-fragment.js.map +10 -0
- package/dist/server/slot-projection-html.js +2 -2
- package/dist/server/slot-projection-html.js.map +3 -3
- package/dist/tools/escape-css-identifier.d.ts +1 -0
- package/dist/tools/escape-css-identifier.js +3 -0
- package/dist/tools/escape-css-identifier.js.map +10 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.js +2 -2
- package/dist/tools/index.js.map +4 -3
- package/dist/utils/escape-html-attribute.d.ts +2 -0
- package/dist/utils/escape-html-attribute.js +3 -0
- package/dist/utils/escape-html-attribute.js.map +10 -0
- package/package.json +12 -5
- package/dist/core/radiant-component-ssr-registry.d.ts +0 -54
- package/dist/core/radiant-component-ssr-registry.js +0 -3
- package/dist/core/radiant-component-ssr-registry.js.map +0 -10
- package/dist/core/radiant-component-ssr.js +0 -3
- package/dist/core/radiant-component-ssr.js.map +0 -14
- package/dist/server/radiant-component-ssr-runtime.d.ts +0 -9
- package/dist/server/radiant-component-ssr-runtime.js +0 -3
- package/dist/server/radiant-component-ssr-runtime.js.map +0 -17
- package/size-budget.json +0 -25
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O=((d)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(d,{get:(x,F)=>(typeof require<"u"?require:x)[F]}):d)(function(d){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+d+'" is not supported')});var $=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),W=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),K=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function q(d,x){Q(d,$,x)}function A(d,x){Q(d,W,x)}function C(d){B(d,$)}function k(d){let x=d;B(d,W,x[K]??=new Set)}function Q(d,x,F){let M=d,R=Object.prototype.hasOwnProperty.call(M,x)?M[x]:void 0;if(Array.isArray(R)){R.push(F);return}Object.defineProperty(M,x,{value:[F]})}function B(d,x,F,M=Object.getPrototypeOf(d)){if(!M||M===Object.prototype)return;B(d,x,F,Object.getPrototypeOf(M));let R=M[x];if(!Array.isArray(R))return;for(let P of R){if(F?.has(P))continue;P(d),F?.add(P)}}function N(d){return typeof d==="function"}function E(d,x,F,M){if(typeof M==="object")return d(void 0,M);return x(F,M)}function X(d,x,F,M,R){if(typeof M==="object"){if(!N(F))throw TypeError("Standard method decorators require a method target");return d(F,M)}if(!R)throw TypeError("Legacy method decorators require a property descriptor");return x(F,M,R)}function J(d){let x=globalThis.CSS;if(typeof x?.escape==="function")return x.escape(d);let F="";for(let M=0;M<d.length;M+=1){let R=d[M]??"",P=R.codePointAt(0)??0;if(P===0){F+="�";continue}let u=P>=1&&P<=31||P===127,D=M===0&&P>=48&&P<=57,r=M===1&&P>=48&&P<=57&&(d[0]??"")==="-",j=M===0&&R==="-"&&d.length===1;if(u||D||r){F+=`\\${P.toString(16)} `;continue}if(P>=128||R==="-"||R==="_"||P>=48&&P<=57||P>=65&&P<=90||P>=97&&P<=122){F+=j?`\\${R}`:R;continue}F+=`\\${R}`}return F}var V=Symbol("radiant.shadowRootListenerHooks"),G=Symbol("radiant.patchedAttachShadow");function Y(d){if(d instanceof Element)return d;if("host"in d)return d.host;return d.element}function L(d){return!(d instanceof Element)}function U(d,x,F,M){let R=(P)=>{if(P.target instanceof Element&&P.target.matches(F))M(P)};return d.addEventListener(x.type,R,x.options),()=>{d.removeEventListener(x.type,R,x.options)}}function t(d,x){let F=Y(d);if(!F[V])F[V]=new Set;if(F[V].add(x),F[G])return;let M=F.attachShadow;F.attachShadow=function(P){let u=M.call(this,P);for(let D of F[V]??[])D();return u},F[G]=!0}function y(d,x,F){if(L(d)&&"scope"in x&&x.scope&&x.scope!=="light")throw Error("RadiantController event listeners only support light DOM scope.");let M=Y(d),R=F.bind(d),P=null,u=null,D=null,r=null,j=!1,H=()=>{P?.(),u?.(),D?.(),r?.(),P=null,u=null,D=null,r=null},S=()=>{if(j)return;if("window"in x&&!P)window.addEventListener(x.type,R,x.options),P=()=>{window.removeEventListener(x.type,R,x.options)};if("document"in x&&!u)document.addEventListener(x.type,R,x.options),u=()=>{document.removeEventListener(x.type,R,x.options)};if("selector"in x||"ref"in x){let T="selector"in x?x.selector:`[data-ref='${J(x.ref)}']`;if(x.scope!=="shadow"&&!D)D=U(M,x,T,R);if(x.scope!=="light"&&M.shadowRoot&&!r)r=U(M.shadowRoot,x,T,R)}};if("selector"in x||"ref"in x){if(x.scope!=="light")t(d,()=>{if(d.isConnected)S()})}if(d.registerConnectedCallback(S),d.registerCleanupCallback(H),d.isConnected)S();return()=>{j=!0,H()}}function Z(d){return(x,F,M)=>{let R=M.value;return q(x,(P)=>{y(P,d,R.bind(P))}),M}}function _(d){return function(x,F){F.addInitializer(function(){y(this,d,x.bind(this))})}}function o(d){function x(F,M,R){return X(_(d),Z(d),F,M,R)}return x}export{o as onEvent};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=273F047A5EF5576564756E2164756E21
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/decorators/bridge.ts", "../src/helpers/create-event-listener.ts", "../src/decorators/legacy/on-event.ts", "../src/decorators/standard/on-event.ts", "../src/decorators/on-event.ts"],
|
|
3
|
+
"sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/decorators/bridge.ts", "../src/tools/escape-css-identifier.ts", "../src/helpers/create-event-listener.ts", "../src/decorators/legacy/on-event.ts", "../src/decorators/standard/on-event.ts", "../src/decorators/on-event.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"type LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\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\
|
|
5
|
+
"type LegacyInstanceInitializer<T extends object = object> = (instance: T) => 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: LegacyInstanceInitializer<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>(instance: T): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyInitializers(\n\t\tinstance,\n\t\tLEGACY_POST_CONSTRUCTION_INITIALIZERS,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<LegacyInstanceInitializer<T>>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(proto: T, key: symbol, initializer: LegacyInstanceInitializer<T>): 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>(\n\tinstance: T,\n\tkey: symbol,\n\texecutedInitializers?: Set<LegacyInstanceInitializer<T>>,\n\tprototype: object | null = Object.getPrototypeOf(instance),\n): void {\n\tif (!prototype || prototype === Object.prototype) {\n\t\treturn;\n\t}\n\n\trunLegacyInitializers(instance, key, executedInitializers, Object.getPrototypeOf(prototype));\n\n\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as LegacyInstanceInitializer<T>[] | undefined;\n\n\tif (!Array.isArray(initializers)) {\n\t\treturn;\n\t}\n\n\tfor (const initializer of initializers) {\n\t\tif (executedInitializers?.has(initializer)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tinitializer(instance);\n\t\texecutedInitializers?.add(initializer);\n\t}\n}\n",
|
|
6
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
|
-
"
|
|
7
|
+
"export function escapeCssIdentifier(value: string): string {\n\tconst cssNamespace = globalThis.CSS as { escape?: (value: string) => string } | undefined;\n\n\tif (typeof cssNamespace?.escape === 'function') {\n\t\treturn cssNamespace.escape(value);\n\t}\n\n\tlet escaped = '';\n\n\tfor (let index = 0; index < value.length; index += 1) {\n\t\tconst character = value[index] ?? '';\n\t\tconst codePoint = character.codePointAt(0) ?? 0;\n\n\t\tif (codePoint === 0) {\n\t\t\tescaped += '\\uFFFD';\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isControlCharacter = (codePoint >= 0x0001 && codePoint <= 0x001f) || codePoint === 0x007f;\n\t\tconst startsWithDigit = index === 0 && codePoint >= 0x0030 && codePoint <= 0x0039;\n\t\tconst startsWithHyphenDigit =\n\t\t\tindex === 1 && codePoint >= 0x0030 && codePoint <= 0x0039 && (value[0] ?? '') === '-';\n\t\tconst isSingleHyphen = index === 0 && character === '-' && value.length === 1;\n\n\t\tif (isControlCharacter || startsWithDigit || startsWithHyphenDigit) {\n\t\t\tescaped += `\\\\${codePoint.toString(16)} `;\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (\n\t\t\tcodePoint >= 0x0080 ||\n\t\t\tcharacter === '-' ||\n\t\t\tcharacter === '_' ||\n\t\t\t(codePoint >= 0x0030 && codePoint <= 0x0039) ||\n\t\t\t(codePoint >= 0x0041 && codePoint <= 0x005a) ||\n\t\t\t(codePoint >= 0x0061 && codePoint <= 0x007a)\n\t\t) {\n\t\t\tescaped += isSingleHyphen ? `\\\\${character}` : character;\n\t\t\tcontinue;\n\t\t}\n\n\t\tescaped += `\\\\${character}`;\n\t}\n\n\treturn escaped;\n}\n",
|
|
8
|
+
"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",
|
|
8
9
|
"import { createEventListener, type EventListenerHost } from '../../helpers/create-event-listener';\nimport type { OnEventConfig } from '../on-event';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\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 (proto: EventListenerHost, _: string, descriptor: PropertyDescriptor) => {\n\t\tconst originalMethod = descriptor.value;\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tcreateEventListener(element, eventConfig, originalMethod.bind(element));\n\t\t});\n\n\t\treturn descriptor;\n\t};\n}\n",
|
|
9
10
|
"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",
|
|
10
11
|
"import type { Method } from '../types';\nimport type { EventListenerHost, OnEventConfig, OnEventScope } from '../helpers/create-event-listener';\nimport { onEvent as legacyOnEvent } from './legacy/on-event';\nimport { onEvent as standardOnEvent } from './standard/on-event';\nimport { methodDecoratorBridge } from './bridge';\n\nexport type { OnEventConfig, OnEventScope };\n\n/**\n * A decorator to subscribe to an event on the target element.\n * The event listener will be automatically unsubscribed when the element is disconnected.\n *\n * Note: This decorator uses event delegation, which means it relies on event bubbling.\n * Therefore, it will not work with events that do not bubble, such as `focus`, `blur`, `load`, `unload`, `scroll`, etc.\n * For focus and blur events, consider using `focusin` and `focusout` which are similar but do bubble.\n * Delegated listeners observe the host light DOM by default, and can optionally observe the shadow root or both trees.\n *\n * @param options {@link OnEventConfig} The event configuration.\n */\nexport function onEvent(options: OnEventConfig) {\n\tfunction decorator<Host extends EventListenerHost, TMethod extends Method>(\n\t\tprotoOrTarget: TMethod,\n\t\tnameOrContext: ClassMethodDecoratorContext<Host, TMethod>,\n\t): void;\n\tfunction decorator(\n\t\tprotoOrTarget: EventListenerHost,\n\t\tnameOrContext: string,\n\t\tdescriptor: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void;\n\tfunction decorator(\n\t\tprotoOrTarget: EventListenerHost | Method,\n\t\tnameOrContext: string | ClassMethodDecoratorContext<EventListenerHost, Method>,\n\t\tdescriptor?: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnEvent(options),\n\t\t\tlegacyOnEvent(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n"
|
|
11
12
|
],
|
|
12
|
-
"mappings": "2PAEA,IAAM,EAA+B,OAAO,IAAI,gDAAgD,
|
|
13
|
-
"debugId": "
|
|
13
|
+
"mappings": "2PAEA,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,CAAC,EAAmB,CAC1F,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GACjE,EAGD,SAAS,CAAqC,CAAC,EAAU,EAAa,EAAiD,CACtH,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,CAAC,CAAW,CACpB,CAAC,EAGF,SAAS,CAAuC,CAC/C,EACA,EACA,EACA,EAA2B,OAAO,eAAe,CAAQ,EAClD,CACP,GAAI,CAAC,GAAa,IAAc,OAAO,UACtC,OAGD,EAAsB,EAAU,EAAK,EAAsB,OAAO,eAAe,CAAS,CAAC,EAE3F,IAAM,EAAgB,EAA2C,GAEjE,GAAI,CAAC,MAAM,QAAQ,CAAY,EAC9B,OAGD,QAAW,KAAe,EAAc,CACvC,GAAI,GAAsB,IAAI,CAA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E,EACA,EACO,CACP,EAAQ,eAAe,QAAS,EAAa,CAC5C,EAAoB,KAAM,EAAa,EAAe,KAAK,IAAI,CAAC,EAChE,GCNI,SAAS,CAAO,CAAC,EAAwB,CAU/C,SAAS,CAAS,CACjB,EACA,EACA,EACyC,CACzC,OAAO,EACN,EAAgB,CAAO,EACvB,EAAc,CAAO,EACrB,EACA,EACA,CACD,EAGD,OAAO",
|
|
14
|
+
"debugId": "273F047A5EF5576564756E2164756E21",
|
|
14
15
|
"names": []
|
|
15
16
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var H=((o)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(d,r)=>(typeof require<"u"?require:d)[r]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var c=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),h=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),R=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function f(o,d){M(o,c,d)}function D(o,d){M(o,h,d)}function b(o){a(o,c)}function w(o){let d=o;a(o,h,d[R]??=new Set)}function M(o,d,r){let t=o,e=Object.prototype.hasOwnProperty.call(t,d)?t[d]:void 0;if(Array.isArray(e)){e.push(r);return}Object.defineProperty(t,d,{value:[r]})}function a(o,d,r,t=Object.getPrototypeOf(o)){if(!t||t===Object.prototype)return;a(o,d,r,Object.getPrototypeOf(t));let e=t[d];if(!Array.isArray(e))return;for(let n of e){if(r?.has(n))continue;n(o),r?.add(n)}}function x(o){return typeof o==="function"}function p(o,d,r,t){if(typeof t==="object")return o(void 0,t);return d(r,t)}function g(o,d,r,t,e){if(typeof t==="object"){if(!x(r))throw TypeError("Standard method decorators require a method target");return o(r,t)}if(!e)throw TypeError("Legacy method decorators require a property descriptor");return d(r,t,e)}function F(o){return(d,r)=>{let t=Symbol(`@ecopages/radiant/on-updated:${r}:cleanup`);f(d,(e)=>{e.registerConnectedCallback(()=>{let n=e[r].bind(e),s=[];if(Array.isArray(o))for(let u of o)s.push(e.registerUpdateCallback(u,n));else if(typeof o==="string")s.push(e.registerUpdateCallback(o,n));e[t]=()=>{for(let u of s)u()}}),e.registerCleanupCallback(()=>{let n=e[t];if(typeof n==="function")n(),delete e[t]})})}}function l(o){return function(d,r){r.addInitializer(function(){let t=d.bind(this);if(Object.defineProperty(this,r.name,{value:t,configurable:!0,writable:!0}),Array.isArray(o))for(let e of o)this.registerUpdateCallback(e,t);else if(typeof o==="string")this.registerUpdateCallback(o,t)})}}function q(o){function d(r,t,e){return g(l(o),F(o),r,t,e)}return d}export{q as onUpdated};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=98CD82210B4E4C0964756E2164756E21
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/decorators/bridge.ts", "../src/decorators/legacy/on-updated.ts", "../src/decorators/standard/on-updated.ts", "../src/decorators/on-updated.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"type LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\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\
|
|
5
|
+
"type LegacyInstanceInitializer<T extends object = object> = (instance: T) => 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: LegacyInstanceInitializer<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>(instance: T): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyInitializers(\n\t\tinstance,\n\t\tLEGACY_POST_CONSTRUCTION_INITIALIZERS,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<LegacyInstanceInitializer<T>>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(proto: T, key: symbol, initializer: LegacyInstanceInitializer<T>): 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>(\n\tinstance: T,\n\tkey: symbol,\n\texecutedInitializers?: Set<LegacyInstanceInitializer<T>>,\n\tprototype: object | null = Object.getPrototypeOf(instance),\n): void {\n\tif (!prototype || prototype === Object.prototype) {\n\t\treturn;\n\t}\n\n\trunLegacyInitializers(instance, key, executedInitializers, Object.getPrototypeOf(prototype));\n\n\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as LegacyInstanceInitializer<T>[] | undefined;\n\n\tif (!Array.isArray(initializers)) {\n\t\treturn;\n\t}\n\n\tfor (const initializer of initializers) {\n\t\tif (executedInitializers?.has(initializer)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tinitializer(instance);\n\t\texecutedInitializers?.add(initializer);\n\t}\n}\n",
|
|
6
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
|
-
"type LegacyUpdatedHost = {\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterUpdateCallback(key: string, update: (
|
|
7
|
+
"type LegacyUpdatedHost = {\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterUpdateCallback(key: string, update: () => void): () => void;\n};\n\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\n/**\n * A decorator to subscribe to an updated callback when a reactive field or property changes.\n * @param eventConfig The event configuration.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\treturn (target: LegacyUpdatedHost, methodName: string) => {\n\t\tconst cleanupKey = Symbol(`@ecopages/radiant/on-updated:${methodName}:cleanup`);\n\n\t\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tconst boundedMethod = (element as any)[methodName].bind(element);\n\t\t\t\tconst cleanups: Array<() => void> = [];\n\n\t\t\t\tif (Array.isArray(keyOrKeys)) {\n\t\t\t\t\tfor (const key of keyOrKeys) {\n\t\t\t\t\t\tcleanups.push(element.registerUpdateCallback(key, boundedMethod));\n\t\t\t\t\t}\n\t\t\t\t} else if (typeof keyOrKeys === 'string') {\n\t\t\t\t\tcleanups.push(element.registerUpdateCallback(keyOrKeys, boundedMethod));\n\t\t\t\t}\n\n\t\t\t\t(element as unknown as Record<PropertyKey, unknown>)[cleanupKey] = () => {\n\t\t\t\t\tfor (const cleanup of cleanups) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t});\n\n\t\t\telement.registerCleanupCallback(() => {\n\t\t\t\tconst cleanup = (element as unknown as Record<PropertyKey, unknown>)[cleanupKey];\n\n\t\t\t\tif (typeof cleanup === 'function') {\n\t\t\t\t\tcleanup();\n\t\t\t\t\tdelete (element as unknown as Record<PropertyKey, unknown>)[cleanupKey];\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n}\n",
|
|
8
8
|
"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",
|
|
9
9
|
"import type { Method } from '../types';\nimport { onUpdated as legacyOnUpdated } from './legacy/on-updated';\nimport { onUpdated as standardOnUpdated } from './standard/on-updated';\nimport { methodDecoratorBridge } from './bridge';\n\ntype UpdateCallback = (...args: unknown[]) => unknown;\n\ntype UpdatedHost = {\n\tregisterCleanupCallback(callback: () => void): void;\n\tregisterConnectedCallback(callback: () => void): void;\n\tregisterUpdateCallback(key: string, update: UpdateCallback): () => void;\n};\n\n/**\n * A decorator to bind a method to the instance.\n */\nexport function onUpdated(keyOrKeys: string | string[]) {\n\tfunction decorator<THost extends UpdatedHost, TMethod extends Method>(\n\t\tprotoOrTarget: TMethod,\n\t\tnameOrContext: ClassMethodDecoratorContext<THost, TMethod>,\n\t): void;\n\tfunction decorator(\n\t\tprotoOrTarget: UpdatedHost,\n\t\tnameOrContext: string,\n\t\tdescriptor: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void;\n\tfunction decorator(\n\t\tprotoOrTarget: UpdatedHost | Method,\n\t\tnameOrContext: string | ClassMethodDecoratorContext<UpdatedHost, Method>,\n\t\tdescriptor?: TypedPropertyDescriptor<Method>,\n\t): TypedPropertyDescriptor<Method> | void {\n\t\treturn methodDecoratorBridge(\n\t\t\tstandardOnUpdated(keyOrKeys),\n\t\t\tlegacyOnUpdated(keyOrKeys),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t\tdescriptor,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": "2PAEA,IAAM,EAA+B,OAAO,IAAI,gDAAgD,
|
|
12
|
-
"debugId": "
|
|
11
|
+
"mappings": "2PAEA,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,CAAC,EAAmB,CAC1F,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GACjE,EAGD,SAAS,CAAqC,CAAC,EAAU,EAAa,EAAiD,CACtH,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AA8B,CAAC,EAErC,GAAI,MAAM,QAAQ,CAAS,EAC1B,QAAW,KAAO,EACjB,EAAS,KAAK,EAAQ,uBAAuB,EAAK,CAAa,CAAC,EAE3D,QAAI,OAAO,IAAc,SAC/B,EAAS,KAAK,EAAQ,uBAAuB,EAAW,CAAa,CAAC,EAGtE,EAAoD,GAAc,IAAM,CACxE,QAAW,KAAW,EACrB,EAAQ,GAGV,EAED,EAAQ,wBAAwB,IAAM,CACrC,IAAM,EAAW,EAAoD,GAErE,GAAI,OAAO,IAAY,WACtB,EAAQ,EACR,OAAQ,EAAoD,GAE7D,EACD,GCtCI,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,GCXI,SAAS,CAAS,CAAC,EAA8B,CAUvD,SAAS,CAAS,CACjB,EACA,EACA,EACyC,CACzC,OAAO,EACN,EAAkB,CAAS,EAC3B,EAAgB,CAAS,EACzB,EACA,EACA,CACD,EAGD,OAAO",
|
|
12
|
+
"debugId": "98CD82210B4E4C0964756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactivePropertyOptions } from '../core/
|
|
1
|
+
import type { ReactivePropertyOptions } from '../core/reactive-prop-core';
|
|
2
2
|
type StandardReactivePropHost<T> = {
|
|
3
3
|
createReactiveProp(propertyName: string, options: ReactivePropertyOptions<T>): void;
|
|
4
4
|
};
|
package/dist/decorators/prop.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var b=((o)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(d,s)=>(typeof require<"u"?require:d)[s]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var j=Symbol.for("@ecopages/radiant.reactivePropDefinitions");function D(o,d,s){let n=o.constructor,R=n[j]??[];if(R.some((M)=>M.name===d))return;R.push({name:d,options:s}),n[j]=R}function r(o){return(o.constructor[j]??[]).slice()}var B=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),S=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),Z=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function w(o,d){E(o,B,d)}function V(o,d){E(o,S,d)}function y(o){L(o,B)}function p(o){let d=o;L(o,S,d[Z]??=new Set)}function E(o,d,s){let n=o,R=Object.prototype.hasOwnProperty.call(n,d)?n[d]:void 0;if(Array.isArray(R)){R.push(s);return}Object.defineProperty(n,d,{value:[s]})}function L(o,d,s,n=Object.getPrototypeOf(o)){if(!n||n===Object.prototype)return;L(o,d,s,Object.getPrototypeOf(n));let R=n[d];if(!Array.isArray(R))return;for(let M of R){if(s?.has(M))continue;M(o),s?.add(M)}}function W(o){switch(o){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function _(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 U(o){try{return JSON.parse(o)}catch{throw TypeError("Invalid JSON string")}}var O={array(o){let d=U(o);if(!Array.isArray(d))throw TypeError(`Expected an array but got a value of type "${typeof d}"`);return d},boolean(o){return!(o==="0"||String(o).toLowerCase()==="false")},number(o){return Number(o.replace(/_/g,""))},object(o){let d=JSON.parse(o);if(d===null||typeof d!=="object"||Array.isArray(d))throw TypeError(`expected value of type "object" but instead got value "${o}" of type "${_(d)}"`);return d},string(o){return o}},T={default:Q,array:q,object:q};function q(o){return JSON.stringify(o)}function Q(o){return`${o}`}function H(o,d){let s=W(d);if(!s)throw TypeError(`[radiant-element] Unknown type "${d}"`);return O[s](o)}function X(o,d){let s=W(d);if(!s)throw TypeError(`[radiant-element] Unknown type "${d}"`);return(T[s]??T.default??Q)(o)}function A(o){return typeof o==="boolean"}function K(o){return typeof o==="number"}function m(o){return typeof o==="string"}function I(o){return Array.isArray(o)}function N(o){return typeof o==="object"&&!Array.isArray(o)&&o!==null}function $(o,d){switch(o){case Boolean:return A(d);case Number:return K(d);case String:return m(d);case Array:return I(d);case Object:return N(d);default:return!1}}var u=(o,d,s,n)=>{if(d===Boolean){let M=o.getAttribute(s);if(M===null)return n;return M===""?!0:H(M,d)}let R=o.getAttribute(s);return R!==null?H(R,d):n??J(d)};function C(o,d){if(d!==void 0&&!$(o,d))throw Error(`defaultValue does not match the expected type for ${o.name}`)}function a(o,d,s,n){return{type:s,name:o,value:n,initialValue:n,attribute:d,converter:{fromAttribute:(R)=>H(R,s),toAttribute:(R)=>X(R,s)}}}function f(o){return typeof o==="function"}function k(o,d,s,n){if(typeof n==="object")return o(void 0,n);return d(s,n)}function oo(o,d,s,n,R){if(typeof n==="object"){if(!f(s))throw TypeError("Standard method decorators require a method target");return o(s,n)}if(!R)throw TypeError("Legacy method decorators require a property descriptor");return d(s,n,R)}function G({type:o,attribute:d,reflect:s,defaultValue:n,bind:R}){return C(o,n),(M,F)=>{let P=d??F;D(M,F,{type:o,reflect:s,attribute:P,defaultValue:n,bind:R});let x=Symbol.for(`@ecopages/radiant.ssr-prop:${F}`);Object.defineProperty(M,F,{get(){return this[x]??n},set(c){this[x]=c},configurable:!0,enumerable:!0}),w(M,(c)=>{c.registerConnectedCallback(()=>{let h=c[F],g=n===void 0?h:n;c.createReactiveProp(F,{type:o,reflect:s,attribute:P,defaultValue:g,bind:R})})})}}function Y({type:o,attribute:d,reflect:s,defaultValue:n,bind:R}){return C(o,n),function(M,F){let P=String(F.name),x=d??P,c=Symbol(`@ecopages/radiant/reactive-prop:${P}:initializer`);return F.addInitializer(function(){let h=this[c],g=n===void 0?h:n;D(this,P,{type:o,reflect:s,attribute:x,defaultValue:n,bind:R}),this.createReactiveProp(P,{type:o,reflect:s,attribute:x,defaultValue:g,bind:R})}),function(h){return this[c]=h,h}}}function Co(o){function d(s,n){return k(Y(o),G(o),s,n)}return d}export{Co as prop};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=1534E809BC88A79F64756E2164756E21
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/utils/attribute-utils.ts", "../src/
|
|
3
|
+
"sources": ["../src/core/reactive-prop-metadata.ts", "../src/decorators/legacy/instance-initializers.ts", "../src/utils/attribute-utils.ts", "../src/core/reactive-prop-core.ts", "../src/decorators/bridge.ts", "../src/decorators/legacy/reactive-prop.ts", "../src/decorators/standard/reactive-prop.ts", "../src/decorators/prop.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"type
|
|
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
|
+
"type LegacyInstanceInitializer<T extends object = object> = (instance: T) => 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: LegacyInstanceInitializer<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>(instance: T): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyInitializers(\n\t\tinstance,\n\t\tLEGACY_POST_CONSTRUCTION_INITIALIZERS,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<LegacyInstanceInitializer<T>>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(proto: T, key: symbol, initializer: LegacyInstanceInitializer<T>): 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>(\n\tinstance: T,\n\tkey: symbol,\n\texecutedInitializers?: Set<LegacyInstanceInitializer<T>>,\n\tprototype: object | null = Object.getPrototypeOf(instance),\n): void {\n\tif (!prototype || prototype === Object.prototype) {\n\t\treturn;\n\t}\n\n\trunLegacyInitializers(instance, key, executedInitializers, Object.getPrototypeOf(prototype));\n\n\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as LegacyInstanceInitializer<T>[] | undefined;\n\n\tif (!Array.isArray(initializers)) {\n\t\treturn;\n\t}\n\n\tfor (const initializer of initializers) {\n\t\tif (executedInitializers?.has(initializer)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tinitializer(instance);\n\t\texecutedInitializers?.add(initializer);\n\t}\n}\n",
|
|
6
7
|
"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",
|
|
8
|
+
"import type { JsxRenderable, SubscribableJsxValue } from '@ecopages/jsx';\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\tvalue?: T;\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 ReactiveField<T = unknown> = {\n\tname: string;\n\tvalue: T;\n\tinitialValue: T;\n};\n\nexport type ReactiveBindingValue<\n\tHost extends object,\n\tProperty extends StringPropertyKey<Host>,\n> = Host[Property] extends JsxRenderable ? Host[Property] : JsxRenderable;\n\nexport type ReactiveBindings<Bindings extends object> = {\n\treadonly [Property in StringPropertyKey<Bindings>]: SubscribableJsxValue<ReactiveBindingValue<Bindings, Property>>;\n};\n\nexport type ReactiveAccessorDefinition<T> = {\n\tbind?: ReactiveBindingOption;\n\tgetValue: () => T | undefined;\n\tsetValue: (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\tvalue: initialValue,\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
9
|
"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",
|
|
8
|
-
"import type
|
|
9
|
-
"import type
|
|
10
|
-
"import type { ReactivePropertyOptions } from '
|
|
11
|
-
"import type { ReactivePropertyOptions } from '../core/radiant-element';\nimport { reactiveProp as legacyReactiveProp } from './legacy/reactive-prop';\nimport { reactiveProp as standardReactiveProp } from './standard/reactive-prop';\nimport { fieldDecoratorBridge } from './bridge';\n\ntype StandardReactivePropHost<T> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<T>): void;\n};\n\ntype LegacyReactivePropHost<T> = StandardReactivePropHost<T> & {\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\n/**\n * Declares a reactive property on a Radiant host.\n *\n * On `RadiantElement`, the property stays aligned with the element attribute\n * channel and can optionally reflect back to markup. On `RadiantController`,\n * the property is exposed through the attached host element as a real JS\n * property so callers can pass objects, arrays, and other non-string values\n * without serializing them into attributes.\n *\n * Every write triggers `notifyUpdate` so update callbacks, bindings, and\n * render lifecycles stay in sync.\n *\n * @param options {@link ReactivePropertyOptions} The options for the reactive property.\n */\nexport function prop<T = unknown>(options: ReactivePropertyOptions<T>) {\n\tfunction decorator<THost extends StandardReactivePropHost<T>, TValue>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n\t): ((this: THost, value: TValue) => TValue) | void;\n\tfunction decorator(protoOrTarget: LegacyReactivePropHost<T>, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: LegacyReactivePropHost<T> | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<StandardReactivePropHost<T>, unknown>,\n\t): ((this: StandardReactivePropHost<T>, value: unknown) => unknown) | void {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardReactiveProp(options),\n\t\t\tlegacyReactiveProp(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n"
|
|
10
|
+
"import { type ReactivePropertyOptions, validateReactivePropertyDefault } from '../../core/reactive-prop-core';\nimport { registerReactivePropDefinition } from '../../core/reactive-prop-metadata';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\ntype ReactivePropHost<T> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<T>): void;\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\n/**\n * Legacy-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<T = unknown>({\n\ttype,\n\tattribute,\n\treflect,\n\tdefaultValue,\n\tbind,\n}: ReactivePropertyOptions<T>) {\n\tvalidateReactivePropertyDefault(type, defaultValue);\n\n\treturn (target: ReactivePropHost<T>, propertyName: string) => {\n\t\tconst attributeKey = attribute ?? propertyName;\n\t\tregisterReactivePropDefinition(target, propertyName, {\n\t\t\ttype,\n\t\t\treflect,\n\t\t\tattribute: attributeKey,\n\t\t\tdefaultValue,\n\t\t\tbind,\n\t\t});\n\n\t\tconst ssrStoreKey = Symbol.for(`@ecopages/radiant.ssr-prop:${propertyName}`);\n\n\t\tObject.defineProperty(target, propertyName, {\n\t\t\tget(this: ReactivePropHost<T> & Record<PropertyKey, unknown>) {\n\t\t\t\treturn this[ssrStoreKey] ?? defaultValue;\n\t\t\t},\n\t\t\tset(this: ReactivePropHost<T> & Record<PropertyKey, unknown>, value: T) {\n\t\t\t\tthis[ssrStoreKey] = value;\n\t\t\t},\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t});\n\n\t\tregisterLegacyInstanceInitializer(target, (element) => {\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tconst initializerValue = element[propertyName as keyof typeof element] as T | undefined;\n\t\t\t\tconst resolvedDefaultValue = defaultValue === undefined ? initializerValue : defaultValue;\n\n\t\t\t\telement.createReactiveProp(propertyName, {\n\t\t\t\t\ttype,\n\t\t\t\t\treflect,\n\t\t\t\t\tattribute: attributeKey,\n\t\t\t\t\tdefaultValue: resolvedDefaultValue,\n\t\t\t\t\tbind,\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t};\n}\n",
|
|
11
|
+
"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\t| P\n\t\t\t\t| 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",
|
|
12
|
+
"import type { ReactivePropertyOptions } from '../core/reactive-prop-core';\nimport { reactiveProp as legacyReactiveProp } from './legacy/reactive-prop';\nimport { reactiveProp as standardReactiveProp } from './standard/reactive-prop';\nimport { fieldDecoratorBridge } from './bridge';\n\ntype StandardReactivePropHost<T> = {\n\tcreateReactiveProp(propertyName: string, options: ReactivePropertyOptions<T>): void;\n};\n\ntype LegacyReactivePropHost<T> = StandardReactivePropHost<T> & {\n\tregisterConnectedCallback(callback: () => void): void;\n};\n\n/**\n * Declares a reactive property on a Radiant host.\n *\n * On `RadiantElement`, the property stays aligned with the element attribute\n * channel and can optionally reflect back to markup. On `RadiantController`,\n * the property is exposed through the attached host element as a real JS\n * property so callers can pass objects, arrays, and other non-string values\n * without serializing them into attributes.\n *\n * Every write triggers `notifyUpdate` so update callbacks, bindings, and\n * render lifecycles stay in sync.\n *\n * @param options {@link ReactivePropertyOptions} The options for the reactive property.\n */\nexport function prop<T = unknown>(options: ReactivePropertyOptions<T>) {\n\tfunction decorator<THost extends StandardReactivePropHost<T>, TValue>(\n\t\tprotoOrTarget: undefined,\n\t\tnameOrContext: ClassFieldDecoratorContext<THost, TValue>,\n\t): ((this: THost, value: TValue) => TValue) | void;\n\tfunction decorator(protoOrTarget: LegacyReactivePropHost<T>, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: LegacyReactivePropHost<T> | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<StandardReactivePropHost<T>, unknown>,\n\t): ((this: StandardReactivePropHost<T>, value: unknown) => unknown) | void {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardReactiveProp(options),\n\t\t\tlegacyReactiveProp(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n"
|
|
12
13
|
],
|
|
13
|
-
"mappings": "2PAEA,IAAM,
|
|
14
|
-
"debugId": "
|
|
14
|
+
"mappings": "2PAEA,IAAM,EAA4B,OAAO,IAAI,2CAA2C,EAWjF,SAAS,CAA8B,CAC7C,EACA,EACA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GAErB,aAAc,GACd,WAAY,EACb,CAAC,EAED,EAAkC,EAAQ,CAAC,IAAY,CACtD,EAAQ,0BAA0B,IAAM,CACvC,IAAM,EAAmB,EAAQ,GAC3B,EAAuB,IAAiB,OAAY,EAAmB,EAE7E,EAAQ,mBAAmB,EAAc,CACxC,OACA,UACA,UAAW,EACX,aAAc,EACd,MACD,CAAC,EACD,EACD,GC/CI,SAAS,CAAyB,EACxC,OACA,YACA,UACA,eACA,QAC8B,CAE9B,OADA,EAAgC,EAAM,CAAY,EAC3C,QAA2C,CAAC,EAAc,EAA2C,CAC3G,IAAM,EAAe,OAAO,EAAQ,IAAI,EAClC,EAAe,GAAa,EAC5B,EAAsB,OAAO,mCAAmC,eAA0B,EAwBhG,OAtBA,EAAQ,eAAe,QAAS,EAAU,CACzC,IAAM,EAAoB,KAAgD,GACpE,EAAwB,IAAiB,OAAY,EAAmB,EAI9E,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,ICxBH,SAAS,EAAiB,CAAC,EAAqC,CAMtE,SAAS,CAAS,CACjB,EACA,EAC0E,CAC1E,OAAO,EACN,EAAqB,CAAO,EAC5B,EAAmB,CAAO,EAC1B,EACA,CACD,EAGD,OAAO",
|
|
15
|
+
"debugId": "1534E809BC88A79F64756E2164756E21",
|
|
15
16
|
"names": []
|
|
16
17
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var B=((d)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(d,{get:(o,t)=>(typeof require<"u"?require:o)[t]}):d)(function(d){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+d+'" is not supported')});var g=Symbol.for("@ecopages/radiant.legacy-instance-initializers"),H=Symbol.for("@ecopages/radiant.legacy-post-construction-initializers"),T=Symbol.for("@ecopages/radiant.legacy-executed-post-construction-initializers");function D(d,o){j(d,g,o)}function m(d,o){j(d,H,o)}function v(d){n(d,g)}function C(d){let o=d;n(d,H,o[T]??=new Set)}function j(d,o,t){let u=d,e=Object.prototype.hasOwnProperty.call(u,o)?u[o]:void 0;if(Array.isArray(e)){e.push(t);return}Object.defineProperty(u,o,{value:[t]})}function n(d,o,t,u=Object.getPrototypeOf(d)){if(!u||u===Object.prototype)return;n(d,o,t,Object.getPrototypeOf(u));let e=u[o];if(!Array.isArray(e))return;for(let M of e){if(t?.has(M))continue;M(d),t?.add(M)}}var x=Symbol.for("@ecopages/radiant.ssr-preparation-callbacks"),P=Symbol.for("@ecopages/radiant.ssr-preparation-running");function w(d,o){let u=d[x];if(Array.isArray(u)){u.push(o);return}Object.defineProperty(d,x,{value:[o],configurable:!0})}function X(d){let o=d,t=o[x];if(!Array.isArray(t))return;o[P]=!0;try{for(let u of t)u()}finally{delete o[P]}}function b(d){return typeof d==="function"}function V(d,o,t,u){if(typeof u==="object")return d(void 0,u);return o(t,u)}function l(d,o,t,u,e){if(typeof u==="object"){if(!b(t))throw TypeError("Standard method decorators require a method target");return d(t,u)}if(!e)throw TypeError("Legacy method decorators require a property descriptor");return o(t,u,e)}function F(d,o={}){let t=null,u,e=()=>{if(o.all)return d.getSlotElements(o.name);return d.getSlotElements(o.name)[0]??null};return{get value(){if(o.cache===!1)return e();let M=d.slotProjectionVersion??0;if(u!==M)t=e(),u=M;return t}}}function h(d={}){return(o,t)=>{let u=(r)=>{return typeof Object.getOwnPropertyDescriptor(r,t)?.get==="function"},e=(r)=>{if(u(r))return;let f=F(r,d);Object.defineProperty(r,t,{get(){return f.value},enumerable:!0,configurable:!0})},M=new WeakMap;Object.defineProperty(o,t,{get(){let r=M.get(this);if(!r)r=F(this,d),M.set(this,r);return r.value},enumerable:!0,configurable:!0}),D(o,(r)=>{w(r,()=>{e(r)}),r.registerConnectedCallback(()=>{e(r)})})}}function R(d={}){return function(o,t){let u=String(t.name);t.addInitializer(function(){let e=F(this,d);Object.defineProperty(this,u,{get(){return e.value},enumerable:!0,configurable:!0})})}}function K(d={}){function o(t,u){return V(R(d),h(d),t,u)}return o}export{K as querySlot};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
3
|
+
//# debugId=DFBFB4E30EFFCDE664756E2164756E21
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/decorators/legacy/instance-initializers.ts", "../src/core/ssr-preparation.ts", "../src/decorators/bridge.ts", "../src/helpers/create-query-slot.ts", "../src/decorators/legacy/query-slot.ts", "../src/decorators/standard/query-slot.ts", "../src/decorators/query-slot.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"type LegacyInstanceInitializer<T extends object = object> = (instance: T) => void;\n\nconst LEGACY_INSTANCE_INITIALIZERS = Symbol.for('@ecopages/radiant.legacy-instance-initializers');\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\
|
|
5
|
+
"type LegacyInstanceInitializer<T extends object = object> = (instance: T) => 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: LegacyInstanceInitializer<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>(instance: T): void {\n\tconst target = instance as Record<PropertyKey, unknown>;\n\n\trunLegacyInitializers(\n\t\tinstance,\n\t\tLEGACY_POST_CONSTRUCTION_INITIALIZERS,\n\t\t(target[LEGACY_EXECUTED_POST_CONSTRUCTION_INITIALIZERS] ??= new Set()) as Set<LegacyInstanceInitializer<T>>,\n\t);\n}\n\nfunction registerInitializer<T extends object>(proto: T, key: symbol, initializer: LegacyInstanceInitializer<T>): 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>(\n\tinstance: T,\n\tkey: symbol,\n\texecutedInitializers?: Set<LegacyInstanceInitializer<T>>,\n\tprototype: object | null = Object.getPrototypeOf(instance),\n): void {\n\tif (!prototype || prototype === Object.prototype) {\n\t\treturn;\n\t}\n\n\trunLegacyInitializers(instance, key, executedInitializers, Object.getPrototypeOf(prototype));\n\n\tconst initializers = (prototype as Record<PropertyKey, unknown>)[key] as LegacyInstanceInitializer<T>[] | undefined;\n\n\tif (!Array.isArray(initializers)) {\n\t\treturn;\n\t}\n\n\tfor (const initializer of initializers) {\n\t\tif (executedInitializers?.has(initializer)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tinitializer(instance);\n\t\texecutedInitializers?.add(initializer);\n\t}\n}\n",
|
|
6
6
|
"type SsrPreparationCallback = () => void;\n\nconst SSR_PREPARATION_CALLBACKS = Symbol.for('@ecopages/radiant.ssr-preparation-callbacks');\nexport const SSR_PREPARATION_RUNNING = Symbol.for('@ecopages/radiant.ssr-preparation-running');\n\n/**\n * Registers instance-local SSR preparation work that should run immediately\n * before a Radiant host serializes its first server render.\n *\n * Decorators use this to defer SSR-only setup until after class fields,\n * reactive props, and authored host content have all been applied.\n */\nexport function registerSsrPreparationCallback(host: object, callback: SsrPreparationCallback): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst existingCallbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (Array.isArray(existingCallbacks)) {\n\t\texistingCallbacks.push(callback);\n\t\treturn;\n\t}\n\n\tObject.defineProperty(host, SSR_PREPARATION_CALLBACKS, {\n\t\tvalue: [callback],\n\t\tconfigurable: true,\n\t});\n}\n\n/**\n * Runs all registered SSR preparation callbacks for the provided host.\n *\n * The callbacks are intentionally retained so repeated SSR serializations stay\n * deterministic after later host mutations.\n */\nexport function runSsrPreparationCallbacks(host: object): void {\n\tconst target = host as Record<PropertyKey, unknown>;\n\tconst callbacks = target[SSR_PREPARATION_CALLBACKS];\n\n\tif (!Array.isArray(callbacks)) {\n\t\treturn;\n\t}\n\n\ttarget[SSR_PREPARATION_RUNNING] = true;\n\n\ttry {\n\t\tfor (const callback of callbacks as SsrPreparationCallback[]) {\n\t\t\tcallback();\n\t\t}\n\t} finally {\n\t\tdelete target[SSR_PREPARATION_RUNNING];\n\t}\n}\n",
|
|
7
7
|
"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",
|
|
8
|
-
"export type QuerySlotConfig = {\n\tall?: boolean;\n\tcache?: boolean;\n\tname?: string;\n};\n\ntype SlotQueryHost = HTMLElement & {\n\
|
|
9
|
-
"import type { RadiantElement } from '../../core/radiant-element';\nimport { createQuerySlot } from '../../helpers/create-query-slot';\nimport { registerSsrPreparationCallback } from '../../core/ssr-preparation';\nimport type { QuerySlotConfig } from '../query-slot';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\ntype SlotQueryHost = RadiantElement & {\n\
|
|
10
|
-
"import { createQuerySlot } from '../../helpers/create-query-slot';\nimport type { QuerySlotConfig } from '../query-slot';\n\ntype SlotQueryHost = HTMLElement & {\n\
|
|
8
|
+
"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",
|
|
9
|
+
"import type { RadiantElement } from '../../core/radiant-element';\nimport { createQuerySlot } from '../../helpers/create-query-slot';\nimport { registerSsrPreparationCallback } from '../../core/ssr-preparation';\nimport type { QuerySlotConfig } from '../query-slot';\nimport { registerLegacyInstanceInitializer } from './instance-initializers';\n\ntype SlotQueryHost = RadiantElement & {\n\tgetSlotElements<T extends Element = Element>(name?: string): T[];\n\tslotProjectionVersion?: number;\n};\n\nexport function querySlot<T extends Element | Element[] | null>(\n\toptions: QuerySlotConfig = {},\n): (proto: RadiantElement, propertyName: string | symbol) => void {\n\treturn (proto: RadiantElement, propertyKey: string | symbol) => {\n\t\tconst hasDefinedInstanceQuery = (instance: SlotQueryHost) => {\n\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(instance, propertyKey);\n\t\t\treturn typeof descriptor?.get === 'function';\n\t\t};\n\n\t\tconst defineSlotQueryProperty = (instance: SlotQueryHost) => {\n\t\t\tif (hasDefinedInstanceQuery(instance)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst accessor = createQuerySlot<T>(instance, options);\n\n\t\t\tObject.defineProperty(instance, propertyKey, {\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\n\t\tconst protoAccessorCache = new WeakMap<SlotQueryHost, ReturnType<typeof createQuerySlot<T>>>();\n\n\t\tObject.defineProperty(proto, propertyKey, {\n\t\t\tget(this: SlotQueryHost) {\n\t\t\t\tlet accessor = protoAccessorCache.get(this);\n\t\t\t\tif (!accessor) {\n\t\t\t\t\taccessor = createQuerySlot<T>(this, options);\n\t\t\t\t\tprotoAccessorCache.set(this, accessor);\n\t\t\t\t}\n\t\t\t\treturn accessor.value;\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t});\n\n\t\tregisterLegacyInstanceInitializer(proto, (element) => {\n\t\t\tregisterSsrPreparationCallback(element, () => {\n\t\t\t\tdefineSlotQueryProperty(element as SlotQueryHost);\n\t\t\t});\n\t\t\telement.registerConnectedCallback(() => {\n\t\t\t\tdefineSlotQueryProperty(element as SlotQueryHost);\n\t\t\t});\n\t\t});\n\t};\n}\n",
|
|
10
|
+
"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",
|
|
11
11
|
"import type { QuerySlotConfig } from '../helpers/create-query-slot';\nimport type { RadiantElement } from '../core/radiant-element';\nimport { querySlot as legacyQuerySlot } from './legacy/query-slot';\nimport { querySlot as standardQuerySlot } from './standard/query-slot';\nimport { fieldDecoratorBridge } from './bridge';\n\nexport type { QuerySlotConfig };\n\ntype QuerySlotDecorator<T extends Element | Element[] | null> = {\n\t(protoOrTarget: undefined, nameOrContext: ClassFieldDecoratorContext<any, T>): void;\n\t(protoOrTarget: RadiantElement, nameOrContext: string): void;\n};\n\n/**\n * Queries projected light-DOM content assigned to a RadiantElement slot.\n *\n * The decorator returns assigned elements from the default slot when `name` is\n * omitted, or from the named slot when `name` is provided. Results are cached\n * by default and automatically invalidated when slot projection changes.\n *\n * @param options Slot query options.\n */\nexport function querySlot<T extends Element | Element[] | null>(options: QuerySlotConfig = {}): QuerySlotDecorator<T> {\n\tfunction decorator(protoOrTarget: undefined, nameOrContext: ClassFieldDecoratorContext<any, T>): void;\n\tfunction decorator(protoOrTarget: RadiantElement, nameOrContext: string): void;\n\tfunction decorator(\n\t\tprotoOrTarget: RadiantElement | undefined,\n\t\tnameOrContext: string | ClassFieldDecoratorContext<any, T>,\n\t): void {\n\t\treturn fieldDecoratorBridge(\n\t\t\tstandardQuerySlot(options) as (target: undefined, context: ClassFieldDecoratorContext<any, T>) => void,\n\t\t\tlegacyQuerySlot<T>(options),\n\t\t\tprotoOrTarget,\n\t\t\tnameOrContext,\n\t\t);\n\t}\n\n\treturn decorator;\n}\n"
|
|
12
12
|
],
|
|
13
|
-
"mappings": "2PAEA,IAAM,EAA+B,OAAO,IAAI,gDAAgD,
|
|
14
|
-
"debugId": "
|
|
13
|
+
"mappings": "2PAEA,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,CAAC,EAAmB,CAC1F,IAAM,EAAS,EAEf,EACC,EACA,EACC,EAAO,KAAoD,IAAI,GACjE,EAGD,SAAS,CAAqC,CAAC,EAAU,EAAa,EAAiD,CACtH,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,CAAC,CAAW,CACpB,CAAC,EAGF,SAAS,CAAuC,CAC/C,EACA,EACA,EACA,EAA2B,OAAO,eAAe,CAAQ,EAClD,CACP,GAAI,CAAC,GAAa,IAAc,OAAO,UACtC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