@ecopages/radiant 0.3.0-alpha.3 → 0.3.0-alpha.4
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/{chunk-s5p5z3z4.js → chunk-21acj2eq.js} +1 -1
- package/dist/chunk-e5jd9h6t.js +4 -0
- package/dist/chunk-e5jd9h6t.js.map +10 -0
- package/dist/core/radiant-component.js +1 -1
- package/dist/core/slot-projection-runtime.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/slot-projection-html.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3xxvmd5c.js +0 -4
- package/dist/chunk-3xxvmd5c.js.map +0 -10
- /package/dist/{chunk-s5p5z3z4.js.map → chunk-21acj2eq.js.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Y as K}from"./chunk-gdkte2vd.js";import{Sa as X}from"./chunk-gg74gdpv.js";import{Ta as Y}from"./chunk-e0r6ca2g.js";import{hb as D,ib as F,jb as O,kb as Q,lb as T,mb as U,nb as V,ob as W}from"./chunk-
|
|
1
|
+
import{Y as K}from"./chunk-gdkte2vd.js";import{Sa as X}from"./chunk-gg74gdpv.js";import{Ta as Y}from"./chunk-e0r6ca2g.js";import{hb as D,ib as F,jb as O,kb as Q,lb as T,mb as U,nb as V,ob as W}from"./chunk-e5jd9h6t.js";import{pb as L}from"./chunk-hpzgnxgq.js";import{hasHydrationMarkers as Z,hydrate as _,jsx as $,render as A}from"@ecopages/jsx";import{Computed as E,subtle as I}from"@ecopages/signals";class G extends K{isRendering=!1;isFirstConnectPending=!1;isRenderScheduled=!1;needsRender=!1;projectedSlotContent=new Map;renderSignal;renderWatcher=new I.Watcher(()=>{this.requestUpdate()});slotProjectionObserver;slotProjectionVersion=0;connectedCallback(){if(super.connectedCallback(),this.isFirstConnectPending)return;this.isFirstConnectPending=!0,queueMicrotask(()=>{if(this.isFirstConnectPending=!1,!this.isConnected)return;if(this.ensureSlotProjectionState(),this.observeSlotProjection(),J(this)){if(this.needsRender=!1,this.hydrate(),this.needsRender)this.update();return}this.update()})}render(){return $("slot",{})}renderToString(f={}){return this.prepareForSsr(),B().renderView(this,f)}renderHost(){return B().renderHost(this)}renderHostToString(f={}){return B().renderHostToString(this,f)}hydrate(){if(!this.isConnected||this.isRendering)return;this.isRendering=!0,this.disconnectSlotProjectionObserver();try{_(this.resolveTrackedRenderOutput().value,this)}finally{this.isRendering=!1,this.observeSlotProjection()}}requestUpdate(){if(this.needsRender=!0,this.isRenderScheduled)return;this.isRenderScheduled=!0,queueMicrotask(()=>{if(this.isRenderScheduled=!1,!this.needsRender)return;this.update()})}update(){if(this.needsRender=!0,!this.isConnected||this.isRendering)return;if(this.isFirstConnectPending&&J(this))return;while(this.needsRender&&this.isConnected){this.needsRender=!1,this.isRendering=!0,this.disconnectSlotProjectionObserver();try{A(this.resolveTrackedRenderOutput().value,this)}finally{this.isRendering=!1,this.observeSlotProjection()}}}disconnectedCallback(){this.disconnectSlotProjectionObserver(),this.disconnectRenderWatcher(),super.disconnectedCallback()}getSlotElement(f){return this.getSlotElements(f)[0]??null}getSlotElements(f){return this.ensureSlotProjectionState(),(this.projectedSlotContent.get(f??D)??[]).filter((q)=>typeof Node<"u"&&q instanceof Element)}shouldAutoBindReactiveMembers(){return!0}getHostSsrAttributes(){return B().getHostAttributes(this)}resolveSsrRenderBridge(){let f={};if(this.renderHostToString===G.prototype.renderHostToString)f.renderHostToString=(q)=>this.renderHostToString(q);if(this.renderHost===G.prototype.renderHost)f.renderHost=()=>this.renderHost();return f}ensureSlotProjectionState(){if(this.projectedSlotContent.size>0)return;let f=this.isConnected?W(this):void 0;if(typeof f==="string"&&f!==""){this.projectedSlotContent=Q(f),this.slotProjectionVersion+=1;return}if(this.getHostChildNodeCount()>0)this.projectedSlotContent=O(this),this.slotProjectionVersion+=1}getHostChildNodeCount(){return"childNodes"in this&&this.childNodes?this.childNodes.length:0}getSlotProjectionScriptTag(){this.ensureSlotProjectionState();let f=U(this.projectedSlotContent);if(!f)return;return`<script type="application/json" ${F}>${v(f)}</script>`}getAuthoredHydrationScriptMarkup(){let f=T(this);if(f)return f;return}handleSlotProjectionMutations(f){let q=!1;for(let w of f){for(let z of Array.from(w.removedNodes))if(this.removeProjectedSlotNode(z))q=!0;for(let z of Array.from(w.addedNodes)){if(z.parentNode!==this)continue;if(this.addProjectedSlotNode(z))q=!0}}if(q)this.slotProjectionVersion+=1,this.update()}addProjectedSlotNode(f){if(f instanceof HTMLScriptElement&&(f.hasAttribute(F)||f.hasAttribute(L)))return!1;let q=f instanceof Element?f.getAttribute("slot")??D:D,w=this.projectedSlotContent.get(q);if(w){if(w.includes(f))return!1;return w.push(f),!0}return this.projectedSlotContent.set(q,[f]),!0}removeProjectedSlotNode(f){for(let[q,w]of this.projectedSlotContent.entries()){let z=w.indexOf(f);if(z===-1)continue;if(w.splice(z,1),w.length===0)this.projectedSlotContent.delete(q);return!0}return!1}observeSlotProjection(){if(typeof MutationObserver>"u"||this.slotProjectionObserver||!this.isConnected)return;this.slotProjectionObserver=new MutationObserver((f)=>this.handleSlotProjectionMutations(f)),this.slotProjectionObserver.observe(this,{childList:!0})}disconnectSlotProjectionObserver(){this.slotProjectionObserver?.disconnect(),this.slotProjectionObserver=void 0}disconnectRenderWatcher(){if(!this.renderSignal)return;this.renderWatcher.unwatch(this.renderSignal),this.renderSignal=void 0}resolveTrackedRenderOutput(){let f=new E(()=>this.resolveRenderOutput()),q=f.get();if(!this.isConnected)return q;if(this.renderSignal)this.renderWatcher.unwatch(this.renderSignal);return this.renderSignal=f,this.renderWatcher.watch(f),q}resolveRenderOutput(){return this.ensureSlotProjectionState(),V(this.render(),this.projectedSlotContent)}}function B(){let f=Y();if(!f)throw Error("Radiant SSR runtime is unavailable. Import `@ecopages/radiant/server/render-component` before using instance SSR methods.");return f}function J(f){return X()&&Z(f)}function v(f){return f.replace(/</g,"\\u003c")}
|
|
2
2
|
export{G as P};
|
|
3
3
|
|
|
4
4
|
//# debugId=55107CFC631DC79E64756E2164756E21
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{pb as B}from"./chunk-hpzgnxgq.js";import{createMarkupNodeLike as U,isKeyedJsxValue as D,isSlotJsxValue as A}from"@ecopages/jsx";var k="",J="data-radiant-slot-projection";function x(q){let w=new Map;for(let G of Array.from(q.childNodes)){if(F(G))continue;O(w,E(G),G)}return w}function P(q){let w;try{w=JSON.parse(q)}catch{if(typeof console<"u")console.warn("[@ecopages/radiant] Failed to parse slot projection payload:",q.slice(0,120));return new Map}let G=new Map;for(let[W,X]of Object.entries(w)){if(!Array.isArray(X)||X.length===0)continue;G.set($(W),X.map((Q)=>U(Q)))}return G}function R(q){let w=Array.from(q.childNodes).filter((G)=>M(G)).map((G)=>Y(G)??"").filter((G)=>G!=="");return w.length>0?w.join(""):void 0}function f(q){let w={};for(let[G,W]of q.entries()){let X=W.map((Q)=>Y(Q)).filter((Q)=>Q!==void 0&&Q!=="");if(X.length>0)w[G]=X}return Object.keys(w).length>0?JSON.stringify(w):void 0}function T(q,w){let G=!1,W=(Q)=>{if(A(Q))return G=!0,I(Q,w,W);if(D(Q))return h(Q,W(Q.value));if(H(Q))return{_$rType$:1,rootLocalName:Q.rootLocalName,strings:Q.strings,values:Q.values.map((Z)=>W(Z))};if(z(Q))return Array.from(Q,(Z)=>W(Z));return Q},X=W(q);return{containsSlots:G,value:X}}function j(q){for(let w of Array.from(q.childNodes)){if(!K(w))continue;let G=w.textContent??void 0;return w.parentNode?.removeChild(w),G}return}function O(q,w,G){let W=q.get(w);if(W){W.push(G);return}q.set(w,[G])}function h(q,w){return{...q,value:w}}function E(q){if(q instanceof Element)return $(q.getAttribute("slot"));return k}function z(q){return typeof q!=="string"&&typeof q==="object"&&q!==null&&Symbol.iterator in q}function K(q){return q instanceof HTMLScriptElement&&q.hasAttribute(J)}function M(q){return q instanceof HTMLScriptElement&&q.hasAttribute(B)}function F(q){return K(q)||M(q)}function H(q){return typeof q==="object"&&q!==null&&q._$rType$===1&&Array.isArray(q.strings)&&Array.isArray(q.values)}function $(q){return q??k}function Y(q){if(q===void 0||q===null||q===!1||q===!0)return;if(typeof Node<"u"&&q instanceof Node){if(q.nodeType===Node.TEXT_NODE)return q.textContent??"";return q.outerHTML??q.textContent??void 0}if(D(q))return Y(q.value);if(typeof q==="string"||typeof q==="number"||typeof q==="bigint")return String(q);if(typeof q==="object"&&q!==null&&"outerHTML"in q)return typeof q.outerHTML==="string"?q.outerHTML:q.textContent??void 0;if(z(q))return Array.from(q,(w)=>Y(w)??"").join("");return}function I(q,w,G){let W=w.get($(q.name));if(W&&W.length>0)return W.length===1?W[0]:W;if(q.fallback===void 0)return"";return G(q.fallback)}
|
|
2
|
+
export{k as hb,J as ib,x as jb,P as kb,R as lb,f as mb,T as nb,j as ob};
|
|
3
|
+
|
|
4
|
+
//# debugId=7E82A28032BC80C064756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core/slot-projection-runtime.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import {\n\tcreateMarkupNodeLike,\n\tisKeyedJsxValue,\n\tisSlotJsxValue,\n\ttype JsxRenderable,\n\ttype KeyedJsxValue,\n\ttype SlotJsxValue,\n\ttype TemplateResultLike,\n} from '@ecopages/jsx';\n\nimport { HYDRATION_ATTRIBUTE } from './hydration-codec';\n\nexport const DEFAULT_SLOT_NAME = '';\nexport const SLOT_PROJECTION_SCRIPT_ATTRIBUTE = 'data-radiant-slot-projection';\n\ntype ResolvedSlotProjection = {\n\tcontainsSlots: boolean;\n\tvalue: JsxRenderable;\n};\n\nexport function captureProjectedSlotRenderables(host: HTMLElement): Map<string, JsxRenderable[]> {\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (isIgnoredProjectedNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tappendProjectedRenderable(projectedContent, getNodeSlotName(node), node);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function deserializeProjectedSlotRenderables(payload: string): Map<string, JsxRenderable[]> {\n\tlet parsedPayload: Record<string, string[]>;\n\n\ttry {\n\t\tparsedPayload = JSON.parse(payload) as Record<string, string[]>;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn('[@ecopages/radiant] Failed to parse slot projection payload:', payload.slice(0, 120));\n\t\t}\n\t\treturn new Map();\n\t}\n\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const [slotName, fragments] of Object.entries(parsedPayload)) {\n\t\tif (!Array.isArray(fragments) || fragments.length === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tprojectedContent.set(\n\t\t\tnormalizeSlotName(slotName),\n\t\t\tfragments.map((fragment) => createMarkupNodeLike(fragment)),\n\t\t);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function collectAuthoredHydrationScriptMarkup(host: HTMLElement): string | undefined {\n\tconst fragments = Array.from(host.childNodes)\n\t\t.filter((node): node is HTMLScriptElement => isHydrationScriptNode(node))\n\t\t.map((node) => renderableToHtmlFragment(node) ?? '')\n\t\t.filter((fragment) => fragment !== '');\n\n\treturn fragments.length > 0 ? fragments.join('') : undefined;\n}\n\nexport function serializeProjectedSlotRenderables(\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): string | undefined {\n\tconst payload: Record<string, string[]> = {};\n\n\tfor (const [slotName, renderables] of projectedContent.entries()) {\n\t\tconst fragments = renderables\n\t\t\t.map((renderable) => renderableToHtmlFragment(renderable))\n\t\t\t.filter((fragment): fragment is string => fragment !== undefined && fragment !== '');\n\n\t\tif (fragments.length > 0) {\n\t\t\tpayload[slotName] = fragments;\n\t\t}\n\t}\n\n\treturn Object.keys(payload).length > 0 ? JSON.stringify(payload) : undefined;\n}\n\nexport function resolveSlotProjection(\n\tvalue: JsxRenderable,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): ResolvedSlotProjection {\n\tlet containsSlots = false;\n\n\tconst resolveValue = (currentValue: JsxRenderable): JsxRenderable => {\n\t\tif (isSlotJsxValue(currentValue)) {\n\t\t\tcontainsSlots = true;\n\t\t\treturn resolveSlotValue(currentValue, projectedContent, resolveValue);\n\t\t}\n\n\t\tif (isKeyedJsxValue(currentValue)) {\n\t\t\treturn cloneKeyedJsxValue(currentValue, resolveValue(currentValue.value));\n\t\t}\n\n\t\tif (isTemplateResultLike(currentValue)) {\n\t\t\treturn {\n\t\t\t\t_$rType$: 1,\n\t\t\t\trootLocalName: currentValue.rootLocalName,\n\t\t\t\tstrings: currentValue.strings,\n\t\t\t\tvalues: currentValue.values.map((entry) => resolveValue(entry as JsxRenderable)),\n\t\t\t} satisfies TemplateResultLike;\n\t\t}\n\n\t\tif (isIterableRenderable(currentValue)) {\n\t\t\treturn Array.from(currentValue, (entry) => resolveValue(entry as JsxRenderable));\n\t\t}\n\n\t\treturn currentValue;\n\t};\n\n\tconst resolvedValue = resolveValue(value);\n\n\treturn {\n\t\tcontainsSlots,\n\t\tvalue: resolvedValue,\n\t};\n}\n\nexport function takeSlotProjectionScriptPayload(host: HTMLElement): string | undefined {\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (!isSlotProjectionScriptNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst payload = node.textContent ?? undefined;\n\t\tnode.parentNode?.removeChild(node);\n\t\treturn payload;\n\t}\n\n\treturn undefined;\n}\n\nfunction appendProjectedRenderable(\n\tprojectedContent: Map<string, JsxRenderable[]>,\n\tslotName: string,\n\trenderable: JsxRenderable,\n): void {\n\tconst existingRenderables = projectedContent.get(slotName);\n\n\tif (existingRenderables) {\n\t\texistingRenderables.push(renderable);\n\t\treturn;\n\t}\n\n\tprojectedContent.set(slotName, [renderable]);\n}\n\nfunction cloneKeyedJsxValue(value: KeyedJsxValue, nextValue: JsxRenderable): KeyedJsxValue {\n\treturn {\n\t\t...value,\n\t\tvalue: nextValue,\n\t};\n}\n\nfunction getNodeSlotName(node: Node): string {\n\tif (node instanceof Element) {\n\t\treturn normalizeSlotName(node.getAttribute('slot'));\n\t}\n\n\treturn DEFAULT_SLOT_NAME;\n}\n\nfunction isIterableRenderable(value: JsxRenderable): value is Iterable<JsxRenderable> {\n\treturn typeof value !== 'string' && typeof value === 'object' && value !== null && Symbol.iterator in value;\n}\n\nfunction isSlotProjectionScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(SLOT_PROJECTION_SCRIPT_ATTRIBUTE);\n}\n\nfunction isHydrationScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(HYDRATION_ATTRIBUTE);\n}\n\nfunction isIgnoredProjectedNode(node: Node): boolean {\n\treturn isSlotProjectionScriptNode(node) || isHydrationScriptNode(node);\n}\n\nfunction isTemplateResultLike(value: JsxRenderable): value is TemplateResultLike {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t(value as Partial<TemplateResultLike>)['_$rType$'] === 1 &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).strings) &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).values)\n\t);\n}\n\nfunction normalizeSlotName(name: string | undefined | null): string {\n\treturn name ?? DEFAULT_SLOT_NAME;\n}\n\nfunction renderableToHtmlFragment(renderable: JsxRenderable): string | undefined {\n\tif (renderable === undefined || renderable === null || renderable === false || renderable === true) {\n\t\treturn undefined;\n\t}\n\n\tif (typeof Node !== 'undefined' && renderable instanceof Node) {\n\t\tif (renderable.nodeType === Node.TEXT_NODE) {\n\t\t\treturn renderable.textContent ?? '';\n\t\t}\n\n\t\treturn (renderable as Element).outerHTML ?? renderable.textContent ?? undefined;\n\t}\n\n\tif (isKeyedJsxValue(renderable)) {\n\t\treturn renderableToHtmlFragment(renderable.value);\n\t}\n\n\tif (typeof renderable === 'string' || typeof renderable === 'number' || typeof renderable === 'bigint') {\n\t\treturn String(renderable);\n\t}\n\n\tif (typeof renderable === 'object' && renderable !== null && 'outerHTML' in renderable) {\n\t\treturn typeof renderable.outerHTML === 'string' ? renderable.outerHTML : (renderable.textContent ?? undefined);\n\t}\n\n\tif (isIterableRenderable(renderable)) {\n\t\treturn Array.from(renderable, (entry) => renderableToHtmlFragment(entry as JsxRenderable) ?? '').join('');\n\t}\n\n\treturn undefined;\n}\n\nfunction resolveSlotValue(\n\tvalue: SlotJsxValue,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n\tresolveValue: (value: JsxRenderable) => JsxRenderable,\n): JsxRenderable {\n\tconst assignedContent = projectedContent.get(normalizeSlotName(value.name));\n\n\tif (assignedContent && assignedContent.length > 0) {\n\t\treturn assignedContent.length === 1 ? assignedContent[0] : (assignedContent as JsxRenderable);\n\t}\n\n\tif (value.fallback === undefined) {\n\t\treturn '';\n\t}\n\n\treturn resolveValue(value.fallback);\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": "yCAAA,+BACC,qBACA,oBACA,sBASM,IAAM,EAAoB,GACpB,EAAmC,+BAOzC,SAAS,CAA+B,CAAC,EAAiD,CAChG,IAAM,EAAmB,IAAI,IAE7B,QAAW,KAAQ,MAAM,KAAK,EAAK,UAAU,EAAG,CAC/C,GAAI,EAAuB,CAAI,EAC9B,SAGD,EAA0B,EAAkB,EAAgB,CAAI,EAAG,CAAI,EAGxE,OAAO,EAGD,SAAS,CAAmC,CAAC,EAA+C,CAClG,IAAI,EAEJ,GAAI,CACH,EAAgB,KAAK,MAAM,CAAO,EACjC,KAAM,CACP,GAAI,OAAO,QAAY,IACtB,QAAQ,KAAK,+DAAgE,EAAQ,MAAM,EAAG,GAAG,CAAC,EAEnG,OAAO,IAAI,IAGZ,IAAM,EAAmB,IAAI,IAE7B,QAAY,EAAU,KAAc,OAAO,QAAQ,CAAa,EAAG,CAClE,GAAI,CAAC,MAAM,QAAQ,CAAS,GAAK,EAAU,SAAW,EACrD,SAGD,EA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KAAe,aAAsB,KAAM,CAC9D,GAAI,EAAW,WAAa,KAAK,UAChC,OAAO,EAAW,aAAe,GAGlC,OAAQ,EAAuB,WAAa,EAAW,aAAe,OAGvE,GAAI,EAAgB,CAAU,EAC7B,OAAO,EAAyB,EAAW,KAAK,EAGjD,GAAI,OAAO,IAAe,UAAY,OAAO,IAAe,UAAY,OAAO,IAAe,SAC7F,OAAO,OAAO,CAAU,EAGzB,GAAI,OAAO,IAAe,UAAY,IAAe,MAAQ,cAAe,EAC3E,OAAO,OAAO,EAAW,YAAc,SAAW,EAAW,UAAa,EAAW,aAAe,OAGrG,GAAI,EAAqB,CAAU,EAClC,OAAO,MAAM,KAAK,EAAY,CAAC,IAAU,EAAyB,CAAsB,GAAK,EAAE,EAAE,KAAK,EAAE,EAGzG,OAGD,SAAS,CAAgB,CACxB,EACA,EACA,EACgB,CAChB,IAAM,EAAkB,EAAiB,IAAI,EAAkB,EAAM,IAAI,CAAC,EAE1E,GAAI,GAAmB,EAAgB,OAAS,EAC/C,OAAO,EAAgB,SAAW,EAAI,EAAgB,GAAM,EAG7D,GAAI,EAAM,WAAa,OACtB,MAAO,GAGR,OAAO,EAAa,EAAM,QAAQ",
|
|
8
|
+
"debugId": "7E82A28032BC80C064756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{P as a}from"../chunk-
|
|
1
|
+
import{P as a}from"../chunk-21acj2eq.js";import"../chunk-gdkte2vd.js";import"../chunk-eyw14d6y.js";import"../chunk-cnyxrh9r.js";import"../chunk-gg74gdpv.js";import"../chunk-e0r6ca2g.js";import"../chunk-66e6s792.js";import"../chunk-e5jd9h6t.js";import"../chunk-hpzgnxgq.js";import"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";export{a as RadiantComponent};
|
|
2
2
|
|
|
3
3
|
//# debugId=51A938E8D704D2E664756E2164756E21
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{hb as a,ib as b,jb as c,kb as d,lb as e,mb as f,nb as g,ob as h}from"../chunk-
|
|
1
|
+
import{hb as a,ib as b,jb as c,kb as d,lb as e,mb as f,nb as g,ob as h}from"../chunk-e5jd9h6t.js";import"../chunk-hpzgnxgq.js";import"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";export{h as takeSlotProjectionScriptPayload,f as serializeProjectedSlotRenderables,g as resolveSlotProjection,d as deserializeProjectedSlotRenderables,e as collectAuthoredHydrationScriptMarkup,c as captureProjectedSlotRenderables,b as SLOT_PROJECTION_SCRIPT_ATTRIBUTE,a as DEFAULT_SLOT_NAME};
|
|
2
2
|
|
|
3
3
|
//# debugId=8572BD7D803FE40064756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as s}from"./chunk-3ynk7e1e.js";import"./chunk-nctznxyz.js";import{v as e}from"./chunk-wds4href.js";import"./chunk-r33zvvda.js";import"./chunk-fs4j94bk.js";import"./chunk-5qeaq3tj.js";import{z as c}from"./chunk-30x4hggg.js";import{A as r}from"./chunk-qe0eww1n.js";import{B as t}from"./chunk-g5n3m11h.js";import"./chunk-s09s5ayx.js";import"./chunk-g2z3mm6b.js";import"./chunk-x2k0ngpz.js";import"./chunk-kakpjgzf.js";import"./chunk-5bkat72n.js";import"./chunk-p8k4g99a.js";import"./chunk-ek664x1c.js";import{P as T}from"./chunk-
|
|
1
|
+
import{t as s}from"./chunk-3ynk7e1e.js";import"./chunk-nctznxyz.js";import{v as e}from"./chunk-wds4href.js";import"./chunk-r33zvvda.js";import"./chunk-fs4j94bk.js";import"./chunk-5qeaq3tj.js";import{z as c}from"./chunk-30x4hggg.js";import{A as r}from"./chunk-qe0eww1n.js";import{B as t}from"./chunk-g5n3m11h.js";import"./chunk-s09s5ayx.js";import"./chunk-g2z3mm6b.js";import"./chunk-x2k0ngpz.js";import"./chunk-kakpjgzf.js";import"./chunk-5bkat72n.js";import"./chunk-p8k4g99a.js";import"./chunk-ek664x1c.js";import{P as T}from"./chunk-21acj2eq.js";import{Q as U}from"./chunk-z9kxfckm.js";import{R as o}from"./chunk-21a7jask.js";import{S as a,T as n,U as p,V as l}from"./chunk-kmebacvv.js";import"./chunk-c0qyz98c.js";import{Y as S}from"./chunk-gdkte2vd.js";import{Z as u}from"./chunk-ndw3hc3v.js";import"./chunk-mpsj3cjs.js";import"./chunk-0bswvy25.js";import{aa as v}from"./chunk-pkszgjqf.js";import"./chunk-x457d0ap.js";import"./chunk-vk48hgm4.js";import{da as Z}from"./chunk-0btkzzyc.js";import"./chunk-qdz5sncz.js";import"./chunk-w8s5fnsq.js";import{ga as V}from"./chunk-j864sv4w.js";import"./chunk-y139ycfm.js";import"./chunk-rkh1vkb9.js";import{ja as X}from"./chunk-nvr37vma.js";import"./chunk-h9k7crjc.js";import"./chunk-8d5ddvvf.js";import{ma as d}from"./chunk-0g0j9re6.js";import"./chunk-8e9fgtbn.js";import"./chunk-bk2nbmcd.js";import{pa as W}from"./chunk-c52qhh0j.js";import"./chunk-25zjh0kg.js";import"./chunk-mp2vtrkg.js";import{sa as $}from"./chunk-1x26p09c.js";import"./chunk-9rj2rwes.js";import"./chunk-v3ta7hnv.js";import{va as y}from"./chunk-eevw1j2q.js";import"./chunk-knqsm6v3.js";import"./chunk-eyw14d6y.js";import"./chunk-v92hp9g0.js";import{Ba as i}from"./chunk-xbhtzkre.js";import"./chunk-atms6yrh.js";import"./chunk-n4p2542b.js";import"./chunk-nnnb6pac.js";import"./chunk-dabagjk6.js";import{Ja as h}from"./chunk-j3v7rca5.js";import"./chunk-hvy4zvcc.js";import"./chunk-79jg8q67.js";import"./chunk-cnyxrh9r.js";import"./chunk-q9z6tnzw.js";import"./chunk-gg74gdpv.js";import"./chunk-e0r6ca2g.js";import"./chunk-hztr86b4.js";import"./chunk-9mqtp3js.js";import"./chunk-t8xtvgyg.js";import"./chunk-66e6s792.js";import"./chunk-e5jd9h6t.js";import"./chunk-hpzgnxgq.js";import"./chunk-nssj2x13.js";import{xb as Y}from"./chunk-rrg759ht.js";import"./chunk-wvd1ffe4.js";import"./chunk-wd23rn4q.js";import{Ab as x}from"./chunk-bk6qkvfp.js";import{Bb as q}from"./chunk-wwbjz9k4.js";import{Cb as _}from"./chunk-hrjc8b1y.js";import"./chunk-vgtggzb6.js";export{h as state,v as signal,y as querySlot,u as query,e as provideContext,i as prop,d as onUpdated,$ as onEvent,r as onContextUpdate,Z as event,X as debounce,W as customElement,x as createQuerySlot,q as createQuery,_ as createEventListener,Y as createEvent,c as createContext,t as contextSelector,s as consumeContext,V as bound,U as bindReactiveValue,S as RadiantElement,T as RadiantComponent,l as ContextSubscriptionRequestEvent,n as ContextRequestEvent,o as ContextProvider,p as ContextOnMountEvent,a as ContextEventsTypes};
|
|
2
2
|
|
|
3
3
|
//# debugId=9514635D470276B764756E2164756E21
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{o as z}from"../chunk-5b1en9vz.js";import{hb as y,ib as B}from"../chunk-
|
|
1
|
+
import{o as z}from"../chunk-5b1en9vz.js";import{hb as y,ib as B}from"../chunk-e5jd9h6t.js";import{pb as A}from"../chunk-hpzgnxgq.js";import"../chunk-nssj2x13.js";import"../chunk-vgtggzb6.js";import{createMarkupNodeLike as G}from"@ecopages/jsx";function W(q){let k=new Map;for(let v of z(q)){if(K(v))continue;I(k,J(v),G(v))}return k}function X(q){let k=z(q).filter((v)=>D(v));return k.length>0?k.join(""):void 0}function I(q,k,v){let w=q.get(k);if(w){w.push(v);return}q.set(k,[v])}function J(q){let k=/^<([A-Za-z][^\s/>]*)([^>]*)>/s.exec(q);if(!k)return y;let v=k[2]??"",w=/\sslot\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i.exec(v);return w?.[1]??w?.[2]??w?.[3]??y}function K(q){return L(q)||D(q)}function L(q){let k=/^<script\b([^>]*)>/i.exec(q);if(!k)return!1;return E(k[1]??"",B)}function D(q){let k=/^<script\b([^>]*)>/i.exec(q);if(!k)return!1;return E(k[1]??"",A)}function E(q,k){return new RegExp(`(?:^|\\s)${k}(?:\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]+))?`,"i").test(q)}export{W as parseProjectedSlotRenderablesFromHtml,X as collectAuthoredHydrationScriptMarkupFromHtml};
|
|
2
2
|
|
|
3
3
|
//# debugId=26A47F455E55CA6F64756E2164756E21
|
package/package.json
CHANGED
package/dist/chunk-3xxvmd5c.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{pb as B}from"./chunk-hpzgnxgq.js";import{createMarkupNodeLike as U,isKeyedJsxValue as D,isSlotJsxValue as A}from"@ecopages/jsx";var k="",J="data-radiant-slot-projection";function x(q){let w=new Map;for(let G of Array.from(q.childNodes)){if(F(G))continue;O(w,E(G),G)}return w}function P(q){let w;try{w=JSON.parse(q)}catch{if(typeof console<"u")console.warn("[@ecopages/radiant] Failed to parse slot projection payload:",q.slice(0,120));return new Map}let G=new Map;for(let[Q,X]of Object.entries(w)){if(!Array.isArray(X)||X.length===0)continue;G.set($(Q),X.map((W)=>U(W)))}return G}function R(q){let w=Array.from(q.childNodes).filter((G)=>M(G)).map((G)=>Y(G)??"").filter((G)=>G!=="");return w.length>0?w.join(""):void 0}function f(q){let w={};for(let[G,Q]of q.entries()){let X=Q.map((W)=>Y(W)).filter((W)=>W!==void 0&&W!=="");if(X.length>0)w[G]=X}return Object.keys(w).length>0?JSON.stringify(w):void 0}function T(q,w){let G=!1,Q=(W)=>{if(A(W))return G=!0,I(W,w,Q);if(D(W))return h(W,Q(W.value));if(H(W))return{_$rType$:1,strings:W.strings,values:W.values.map((Z)=>Q(Z))};if(z(W))return Array.from(W,(Z)=>Q(Z));return W},X=Q(q);return{containsSlots:G,value:X}}function j(q){for(let w of Array.from(q.childNodes)){if(!K(w))continue;let G=w.textContent??void 0;return w.parentNode?.removeChild(w),G}return}function O(q,w,G){let Q=q.get(w);if(Q){Q.push(G);return}q.set(w,[G])}function h(q,w){return{...q,value:w}}function E(q){if(q instanceof Element)return $(q.getAttribute("slot"));return k}function z(q){return typeof q!=="string"&&typeof q==="object"&&q!==null&&Symbol.iterator in q}function K(q){return q instanceof HTMLScriptElement&&q.hasAttribute(J)}function M(q){return q instanceof HTMLScriptElement&&q.hasAttribute(B)}function F(q){return K(q)||M(q)}function H(q){return typeof q==="object"&&q!==null&&q._$rType$===1&&Array.isArray(q.strings)&&Array.isArray(q.values)}function $(q){return q??k}function Y(q){if(q===void 0||q===null||q===!1||q===!0)return;if(typeof Node<"u"&&q instanceof Node){if(q.nodeType===Node.TEXT_NODE)return q.textContent??"";return q.outerHTML??q.textContent??void 0}if(D(q))return Y(q.value);if(typeof q==="string"||typeof q==="number"||typeof q==="bigint")return String(q);if(typeof q==="object"&&q!==null&&"outerHTML"in q)return typeof q.outerHTML==="string"?q.outerHTML:q.textContent??void 0;if(z(q))return Array.from(q,(w)=>Y(w)??"").join("");return}function I(q,w,G){let Q=w.get($(q.name));if(Q&&Q.length>0)return Q.length===1?Q[0]:Q;if(q.fallback===void 0)return"";return G(q.fallback)}
|
|
2
|
-
export{k as hb,J as ib,x as jb,P as kb,R as lb,f as mb,T as nb,j as ob};
|
|
3
|
-
|
|
4
|
-
//# debugId=072C43197CC7C57F64756E2164756E21
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/core/slot-projection-runtime.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"import {\n\tcreateMarkupNodeLike,\n\tisKeyedJsxValue,\n\tisSlotJsxValue,\n\ttype JsxRenderable,\n\ttype KeyedJsxValue,\n\ttype SlotJsxValue,\n\ttype TemplateResultLike,\n} from '@ecopages/jsx';\n\nimport { HYDRATION_ATTRIBUTE } from './hydration-codec';\n\nexport const DEFAULT_SLOT_NAME = '';\nexport const SLOT_PROJECTION_SCRIPT_ATTRIBUTE = 'data-radiant-slot-projection';\n\ntype ResolvedSlotProjection = {\n\tcontainsSlots: boolean;\n\tvalue: JsxRenderable;\n};\n\nexport function captureProjectedSlotRenderables(host: HTMLElement): Map<string, JsxRenderable[]> {\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (isIgnoredProjectedNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tappendProjectedRenderable(projectedContent, getNodeSlotName(node), node);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function deserializeProjectedSlotRenderables(payload: string): Map<string, JsxRenderable[]> {\n\tlet parsedPayload: Record<string, string[]>;\n\n\ttry {\n\t\tparsedPayload = JSON.parse(payload) as Record<string, string[]>;\n\t} catch {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.warn('[@ecopages/radiant] Failed to parse slot projection payload:', payload.slice(0, 120));\n\t\t}\n\t\treturn new Map();\n\t}\n\n\tconst projectedContent = new Map<string, JsxRenderable[]>();\n\n\tfor (const [slotName, fragments] of Object.entries(parsedPayload)) {\n\t\tif (!Array.isArray(fragments) || fragments.length === 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tprojectedContent.set(\n\t\t\tnormalizeSlotName(slotName),\n\t\t\tfragments.map((fragment) => createMarkupNodeLike(fragment)),\n\t\t);\n\t}\n\n\treturn projectedContent;\n}\n\nexport function collectAuthoredHydrationScriptMarkup(host: HTMLElement): string | undefined {\n\tconst fragments = Array.from(host.childNodes)\n\t\t.filter((node): node is HTMLScriptElement => isHydrationScriptNode(node))\n\t\t.map((node) => renderableToHtmlFragment(node) ?? '')\n\t\t.filter((fragment) => fragment !== '');\n\n\treturn fragments.length > 0 ? fragments.join('') : undefined;\n}\n\nexport function serializeProjectedSlotRenderables(\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): string | undefined {\n\tconst payload: Record<string, string[]> = {};\n\n\tfor (const [slotName, renderables] of projectedContent.entries()) {\n\t\tconst fragments = renderables\n\t\t\t.map((renderable) => renderableToHtmlFragment(renderable))\n\t\t\t.filter((fragment): fragment is string => fragment !== undefined && fragment !== '');\n\n\t\tif (fragments.length > 0) {\n\t\t\tpayload[slotName] = fragments;\n\t\t}\n\t}\n\n\treturn Object.keys(payload).length > 0 ? JSON.stringify(payload) : undefined;\n}\n\nexport function resolveSlotProjection(\n\tvalue: JsxRenderable,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n): ResolvedSlotProjection {\n\tlet containsSlots = false;\n\n\tconst resolveValue = (currentValue: JsxRenderable): JsxRenderable => {\n\t\tif (isSlotJsxValue(currentValue)) {\n\t\t\tcontainsSlots = true;\n\t\t\treturn resolveSlotValue(currentValue, projectedContent, resolveValue);\n\t\t}\n\n\t\tif (isKeyedJsxValue(currentValue)) {\n\t\t\treturn cloneKeyedJsxValue(currentValue, resolveValue(currentValue.value));\n\t\t}\n\n\t\tif (isTemplateResultLike(currentValue)) {\n\t\t\treturn {\n\t\t\t\t_$rType$: 1,\n\t\t\t\tstrings: currentValue.strings,\n\t\t\t\tvalues: currentValue.values.map((entry) => resolveValue(entry as JsxRenderable)),\n\t\t\t} satisfies TemplateResultLike;\n\t\t}\n\n\t\tif (isIterableRenderable(currentValue)) {\n\t\t\treturn Array.from(currentValue, (entry) => resolveValue(entry as JsxRenderable));\n\t\t}\n\n\t\treturn currentValue;\n\t};\n\n\tconst resolvedValue = resolveValue(value);\n\n\treturn {\n\t\tcontainsSlots,\n\t\tvalue: resolvedValue,\n\t};\n}\n\nexport function takeSlotProjectionScriptPayload(host: HTMLElement): string | undefined {\n\tfor (const node of Array.from(host.childNodes)) {\n\t\tif (!isSlotProjectionScriptNode(node)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst payload = node.textContent ?? undefined;\n\t\tnode.parentNode?.removeChild(node);\n\t\treturn payload;\n\t}\n\n\treturn undefined;\n}\n\nfunction appendProjectedRenderable(\n\tprojectedContent: Map<string, JsxRenderable[]>,\n\tslotName: string,\n\trenderable: JsxRenderable,\n): void {\n\tconst existingRenderables = projectedContent.get(slotName);\n\n\tif (existingRenderables) {\n\t\texistingRenderables.push(renderable);\n\t\treturn;\n\t}\n\n\tprojectedContent.set(slotName, [renderable]);\n}\n\nfunction cloneKeyedJsxValue(value: KeyedJsxValue, nextValue: JsxRenderable): KeyedJsxValue {\n\treturn {\n\t\t...value,\n\t\tvalue: nextValue,\n\t};\n}\n\nfunction getNodeSlotName(node: Node): string {\n\tif (node instanceof Element) {\n\t\treturn normalizeSlotName(node.getAttribute('slot'));\n\t}\n\n\treturn DEFAULT_SLOT_NAME;\n}\n\nfunction isIterableRenderable(value: JsxRenderable): value is Iterable<JsxRenderable> {\n\treturn typeof value !== 'string' && typeof value === 'object' && value !== null && Symbol.iterator in value;\n}\n\nfunction isSlotProjectionScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(SLOT_PROJECTION_SCRIPT_ATTRIBUTE);\n}\n\nfunction isHydrationScriptNode(node: Node): node is HTMLScriptElement {\n\treturn node instanceof HTMLScriptElement && node.hasAttribute(HYDRATION_ATTRIBUTE);\n}\n\nfunction isIgnoredProjectedNode(node: Node): boolean {\n\treturn isSlotProjectionScriptNode(node) || isHydrationScriptNode(node);\n}\n\nfunction isTemplateResultLike(value: JsxRenderable): value is TemplateResultLike {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\t(value as Partial<TemplateResultLike>)['_$rType$'] === 1 &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).strings) &&\n\t\tArray.isArray((value as Partial<TemplateResultLike>).values)\n\t);\n}\n\nfunction normalizeSlotName(name: string | undefined | null): string {\n\treturn name ?? DEFAULT_SLOT_NAME;\n}\n\nfunction renderableToHtmlFragment(renderable: JsxRenderable): string | undefined {\n\tif (renderable === undefined || renderable === null || renderable === false || renderable === true) {\n\t\treturn undefined;\n\t}\n\n\tif (typeof Node !== 'undefined' && renderable instanceof Node) {\n\t\tif (renderable.nodeType === Node.TEXT_NODE) {\n\t\t\treturn renderable.textContent ?? '';\n\t\t}\n\n\t\treturn (renderable as Element).outerHTML ?? renderable.textContent ?? undefined;\n\t}\n\n\tif (isKeyedJsxValue(renderable)) {\n\t\treturn renderableToHtmlFragment(renderable.value);\n\t}\n\n\tif (typeof renderable === 'string' || typeof renderable === 'number' || typeof renderable === 'bigint') {\n\t\treturn String(renderable);\n\t}\n\n\tif (typeof renderable === 'object' && renderable !== null && 'outerHTML' in renderable) {\n\t\treturn typeof renderable.outerHTML === 'string' ? renderable.outerHTML : (renderable.textContent ?? undefined);\n\t}\n\n\tif (isIterableRenderable(renderable)) {\n\t\treturn Array.from(renderable, (entry) => renderableToHtmlFragment(entry as JsxRenderable) ?? '').join('');\n\t}\n\n\treturn undefined;\n}\n\nfunction resolveSlotValue(\n\tvalue: SlotJsxValue,\n\tprojectedContent: ReadonlyMap<string, readonly JsxRenderable[]>,\n\tresolveValue: (value: JsxRenderable) => JsxRenderable,\n): JsxRenderable {\n\tconst assignedContent = projectedContent.get(normalizeSlotName(value.name));\n\n\tif (assignedContent && assignedContent.length > 0) {\n\t\treturn assignedContent.length === 1 ? assignedContent[0] : (assignedContent as JsxRenderable);\n\t}\n\n\tif (value.fallback === undefined) {\n\t\treturn '';\n\t}\n\n\treturn resolveValue(value.fallback);\n}\n"
|
|
6
|
-
],
|
|
7
|
-
"mappings": "yCAAA,+BACC,qBACA,oBACA,sBASM,IAAM,EAAoB,GACpB,EAAmC,+BAOzC,SAAS,CAA+B,CAAC,EAAiD,CAChG,IAAM,EAAmB,IAAI,IAE7B,QAAW,KAAQ,MAAM,KAAK,EAAK,UAAU,EAAG,CAC/C,GAAI,EAAuB,CAAI,EAC9B,SAGD,EAA0B,EAAkB,EAAgB,CAAI,EAAG,CAAI,EAGxE,OAAO,EAGD,SAAS,CAAmC,CAAC,EAA+C,CAClG,IAAI,EAEJ,GAAI,CACH,EAAgB,KAAK,MAAM,CAAO,EACjC,KAAM,CACP,GAAI,OAAO,QAAY,IACtB,QAAQ,KAAK,+DAAgE,EAAQ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