@webtypen/webframez-react 0.0.43 → 0.0.45

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/client.cjs CHANGED
@@ -1 +1 @@
1
- var de=Object.create;var y=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var fe=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var pe=(e,t)=>{for(var n in t)y(e,n,{get:t[n],enumerable:!0})},k=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of le(t))!me.call(e,r)&&r!==n&&y(e,r,{get:()=>t[r],enumerable:!(o=ue(t,r))||o.enumerable});return e};var H=(e,t,n)=>(n=e!=null?de(fe(e)):{},k(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)),Re=e=>k(y({},"__esModule",{value:!0}),e);var ze={};pe(ze,{mountWebframezClient:()=>He,useCookie:()=>ve,useRouter:()=>xe});module.exports=Re(ze);var s=H(require("react"),1),V=require("react-dom/client"),_=require("react-server-dom-webpack/client"),X=require("@webtypen/webframez-react/route-slot");var _e=/^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;function u(e){if(typeof e!="string")return;let t=e.trim();return!t||t==="/"?"":t.replace(/\/+$/,"")}function z(e,t){let n=e.trim(),o=u(t);return!n||!o||_e.test(n)||n.startsWith("/")||o!=="/"&&(n===o||n.startsWith(`${o}/`))?n:o==="/"?n.startsWith("/")?n:`/${n}`:n.startsWith("/")?`${o}${n}`:`${o}/${n}`}function P(e,t){if(!e)return;let n=u(e.basename)??u(t),o=u(e.routeBasePath),r=u(e.transportBasePath),a={...e,...n!==void 0?{basename:n}:{},...o!==void 0?{routeBasePath:o}:{},...r!==void 0?{transportBasePath:r}:{}};return a.favicon&&(a.favicon=z(a.favicon,n)),a.links&&(a.links=a.links.map(c=>({...c,href:z(c.href,n)}))),a}var p=H(require("react"),1),W="webframez-route-children",F="__webframezRouteChildren",j="WebframezRouteChildren",we="__webframezRouteChildrenSlot",he="WebframezRouteChildrenSlot",N=()=>p.default.createElement(W);N.displayName=j;N[F]=!0;var ge=N;function D(e){if(e===W||e===ge)return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[F]===!0||t.displayName===j||t.name==="RouteChildren"}catch{return!1}}function M(e){if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[we]===!0||t.displayName===he||t.name==="RouteChildrenSlot"}catch{return!1}}function $(e){if(!e||typeof e!="object")return!1;try{return"type"in e&&"props"in e}catch{return!1}}function T(e,t){if(e==null||typeof e=="boolean")return e;if(Array.isArray(e)){let l=!1,w=e.map(m=>{let h=T(m,t);return h!==m&&(l=!0),h});return l?w:e}if($(e)&&(D(e.type)||M(e.type)))return t;let n=p.default.isValidElement(e);if(!n&&!$(e))return e;if(n&&(D(e.type)||M(e.type)))return t;let o=e.props??{};if(!("children"in o))return e;let r=T(o.children,t);if(r===o.children)return e;if(n)return Array.isArray(r)?p.default.cloneElement(e,void 0,...r):p.default.cloneElement(e,void 0,r);let a=e,c={...a.props??{},children:r,...a.key!==void 0&&a.key!==null?{key:a.key}:{}};return p.default.createElement(a.type,c)}var d=require("react/jsx-runtime"),Ce={push:()=>{},replace:()=>{},refresh:()=>{},refreshContext:()=>{}},A=typeof s.default.createContext=="function"?s.default.createContext(null):null,J="__WEBFRAMEZ_ROUTER__",Ee="__WEBFRAMEZ_REACT_BUILD_ID",ye="x-webframez-react-build",Te="[data-webframez-head='true']";function G(){if(typeof window>"u"||typeof document>"u")return;let e=()=>{window.scrollTo({top:0,left:0}),document.scrollingElement&&(document.scrollingElement.scrollTop=0),document.documentElement.scrollTop=0,document.body&&(document.body.scrollTop=0)};if(typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(e);return}window.setTimeout(e,0)}function v(e){return u(e)??""}function Ae(e,t){return t?e===t?"/":e.startsWith(`${t}/`)?e.slice(t.length)||"/":e||"/":e||"/"}function Q(e,t){let n=!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`;return e?n==="/"?e:`${e}${n}`:n}function Se(){return v(typeof window>"u"?globalThis.__RSC_ROUTE_BASE_PATH:window.__RSC_ROUTE_BASE_PATH)}function ee(e){if(typeof window>"u")return e||"/";let t=v(window.__RSC_BASENAME),n=Se(),o=Ae(e||"/",t);return Q(n,o)}function te(e){if(typeof window>"u")return e;let t=window.__RSC_ENDPOINT;return typeof t=="string"&&t.trim()!==""?t:e}function Pe(){if(typeof window>"u")return"";let e=window[Ee];return typeof e=="string"?e:""}function Ne(e){let t=Pe();return!!t&&!!e&&t!==e}function I(e){typeof window>"u"||window.location.assign(`${e.pathname}${e.search}${e.hash}`)}function Ie(){return typeof window>"u"?null:window[J]??null}function Le(e){typeof window>"u"||(window[J]=e)}function q(){let e={},t=typeof document>"u"?"":document.cookie;if(!t||t.trim()==="")return e;for(let n of t.split(";")){let o=n.trim();if(!o)continue;let r=o.indexOf("="),a=r>=0?o.slice(0,r).trim():o,c=r>=0?o.slice(r+1):"";a&&(e[a]=decodeURIComponent(c))}return e}function Y(e,t,n={}){let o=[`${e}=${encodeURIComponent(t)}`];return n.path&&o.push(`Path=${n.path}`),n.domain&&o.push(`Domain=${n.domain}`),typeof n.maxAge=="number"&&o.push(`Max-Age=${Math.floor(n.maxAge)}`),n.expires&&o.push(`Expires=${n.expires.toUTCString()}`),n.sameSite&&o.push(`SameSite=${n.sameSite}`),n.secure&&o.push("Secure"),o.join("; ")}function ve(){return s.default.useMemo(()=>({all:()=>q(),get:e=>q()[e],set:(e,t,n)=>{typeof document>"u"||(document.cookie=Y(e,t,n))},remove:(e,t)=>{typeof document>"u"||(document.cookie=Y(e,"",{...t??{},maxAge:0}))}}),[])}function xe(){let e=A?s.default.useContext(A):null;if(!e){let t=Ie();if(t)return t;if(typeof window>"u")return Ce;throw new Error("useRouter must be used inside mountWebframezClient()")}return e}function be({active:e}){return(0,d.jsx)("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:3,zIndex:9999,transformOrigin:"left",transform:e?"scaleX(1)":"scaleX(0)",transition:"transform 180ms ease",background:"linear-gradient(90deg, #0ea5e9, #22c55e)"}})}function Z(e){let t=document.createElement("meta");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function K(e){let t=document.createElement("link");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function L(e){if(typeof document>"u")return;let t=P(e)??e;ne(t),document.body.className=t.bodyClassName||"",document.title=t.title||"Webframez React";for(let n of document.head.querySelectorAll(Te))n.remove();t.description&&Z({name:"description",content:t.description}),t.favicon&&K({rel:"icon",href:t.favicon});for(let n of t.meta??[])Z(n);for(let n of t.links??[])K(n)}function ne(e){if(typeof window>"u")return;let t=P(e)??e,n=u(t.basename),o=u(t.routeBasePath),r=u(t.transportBasePath);window.__RSC_BASENAME=n??"",window.__RSC_ROUTE_BASE_PATH=o??"",r!==void 0&&(window.__RSC_ENDPOINT=Q(r,"/rsc"))}function Be(e){let t=new TextEncoder;return new ReadableStream({start(n){n.enqueue(t.encode(e)),n.close()}})}function Oe(){if(typeof window>"u")return null;let e=window.__RSC_INITIAL_PAYLOAD;return typeof e!="string"||e===""?null:(delete window.__RSC_INITIAL_PAYLOAD,(0,_.createFromReadableStream)(Be(e)))}function Ue(e){let t=te(e),n=ee(window.location.pathname);return Oe()??(0,_.createFromFetch)(fetch(`${t}?path=${encodeURIComponent(n)}&search=${encodeURIComponent(window.location.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}}))}function ke(e,t){return function(){let o=s.default.use(e),r=typeof o.contextModel<"u"&&typeof o.pageModel<"u",[a,c]=(0,s.useState)(o.model),[l,w]=(0,s.useState)(o.contextModel),[m,h]=(0,s.useState)(o.pageModel),[x,b]=(0,s.useState)(o.head),[oe,g]=(0,s.useState)(!1),[re,ie]=(0,s.useState)(!1),[ae,S]=(0,s.useState)(r);async function B(i){let E=te(t),f=ee(i.pathname),R=await fetch(`${E}?path=${encodeURIComponent(f)}&search=${encodeURIComponent(i.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}});return Ne(R.headers.get(ye))?(I(i),await new Promise(()=>{})):await(0,_.createFromFetch)(Promise.resolve(R))}async function C(i,E="push"){g(!0);try{let f=await B(i);L(f.head),b(f.head),c(f.model),w(f.contextModel),h(f.pageModel),S(!0);let R=`${i.pathname}${i.search}${i.hash}`;E==="replace"?(history.replaceState(null,"",R),G()):E==="push"&&(history.pushState(null,"",R),G())}catch(f){console.error("[webframez-react] Failed to render route",f),I(i),c((0,d.jsx)("p",{children:"Failed to load route."}))}finally{g(!1)}}async function se(){g(!0);try{let i=await B(new URL(window.location.href));if(L(i.head),b(i.head),Object.prototype.hasOwnProperty.call(i,"contextModel")){w(i.contextModel),S(!0);return}c(i.model),S(!1)}catch(i){console.error("[webframez-react] Failed to refresh route context",i),I(new URL(window.location.href))}finally{g(!1)}}(0,s.useEffect)(()=>{L(x)},[x]),(0,s.useEffect)(()=>{ie(!0);let i=()=>{C(new URL(window.location.href),"none")};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)}},[]);let O=s.default.useMemo(()=>({push:i=>{C(new URL(i,window.location.origin),"push")},replace:i=>{C(new URL(i,window.location.origin),"replace")},refresh:()=>{C(new URL(window.location.href),"none")},refreshContext:()=>{se()}}),[]);Le(O);let ce=ae&&typeof m<"u"?l?(0,d.jsx)(X.RouteChildrenSlotProvider,{page:m,children:T(l,m)}):m:a,U=(0,d.jsxs)(d.Fragment,{children:[re?(0,d.jsx)(be,{active:oe}):null,ce??(0,d.jsx)("p",{style:{padding:24},children:"Loading..."})]});return A?(0,d.jsx)(A.Provider,{value:O,children:U}):U}}function He(e={}){let t=e.rootId??"root",n=document.getElementById(t);if(!n)throw new Error(`Missing #${t} element`);let o=typeof window<"u"&&window.__RSC_ENDPOINT,r=e.rscEndpoint??o??"/rsc",a=Promise.resolve(Ue(r)).then(l=>(l?.head&&ne(l.head),l)),c=ke(a,r);return(0,V.hydrateRoot)(n,(0,d.jsx)(c,{}))}
1
+ var fe=Object.create;var E=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var we=(e,t)=>{for(var n in t)E(e,n,{get:t[n],enumerable:!0})},z=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of me(t))!_e.call(e,r)&&r!==n&&E(e,r,{get:()=>t[r],enumerable:!(o=pe(t,r))||o.enumerable});return e};var D=(e,t,n)=>(n=e!=null?fe(Re(e)):{},z(t||!e||!e.__esModule?E(n,"default",{value:e,enumerable:!0}):n,e)),he=e=>z(E({},"__esModule",{value:!0}),e);var We={};we(We,{mountWebframezClient:()=>$e,useCookie:()=>Oe,useRouter:()=>ke});module.exports=he(We);var s=D(require("react"),1),Q=require("react-dom/client"),_=require("react-server-dom-webpack/client"),ee=require("@webtypen/webframez-react/route-slot");var ge=/^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;function u(e){if(typeof e!="string")return;let t=e.trim();return!t||t==="/"?"":t.replace(/\/+$/,"")}function M(e,t){let n=e.trim(),o=u(t);return!n||!o||ge.test(n)||n.startsWith("/")||o!=="/"&&(n===o||n.startsWith(`${o}/`))?n:o==="/"?n.startsWith("/")?n:`/${n}`:n.startsWith("/")?`${o}${n}`:`${o}/${n}`}function P(e,t){if(!e)return;let n=u(e.basename)??u(t),o=u(e.routeBasePath),r=u(e.transportBasePath),a={...e,...n!==void 0?{basename:n}:{},...o!==void 0?{routeBasePath:o}:{},...r!==void 0?{transportBasePath:r}:{}};return a.favicon&&(a.favicon=M(a.favicon,n)),a.links&&(a.links=a.links.map(c=>({...c,href:M(c.href,n)}))),a}var p=D(require("react"),1),j="webframez-route-children",G="__webframezRouteChildren",q="WebframezRouteChildren",Ce="__webframezRouteChildrenSlot",ye="WebframezRouteChildrenSlot",I=()=>p.default.createElement(j);I.displayName=q;I[G]=!0;var Ee=I;function $(e){if(e===j||e===Ee)return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[G]===!0||t.displayName===q||t.name==="RouteChildren"}catch{return!1}}function W(e){if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[Ce]===!0||t.displayName===ye||t.name==="RouteChildrenSlot"}catch{return!1}}function F(e){if(!e||typeof e!="object")return!1;try{return"type"in e&&"props"in e}catch{return!1}}function T(e,t){if(e==null||typeof e=="boolean")return e;if(Array.isArray(e)){let f=!1,w=e.map(m=>{let h=T(m,t);return h!==m&&(f=!0),h});return f?w:e}if(F(e)&&($(e.type)||W(e.type)))return t;let n=p.default.isValidElement(e);if(!n&&!F(e))return e;if(n&&($(e.type)||W(e.type)))return t;let o=e.props??{};if(!("children"in o))return e;let r=T(o.children,t);if(r===o.children)return e;if(n)return Array.isArray(r)?p.default.cloneElement(e,void 0,...r):p.default.cloneElement(e,void 0,r);let a=e,c={...a.props??{},children:r,...a.key!==void 0&&a.key!==null?{key:a.key}:{}};return p.default.createElement(a.type,c)}var d=require("react/jsx-runtime"),Te={push:()=>{},replace:()=>{},refresh:()=>{},refreshContext:()=>{}},A=typeof s.default.createContext=="function"?s.default.createContext(null):null,te="__WEBFRAMEZ_ROUTER__",Ae="__WEBFRAMEZ_REACT_BUILD_ID",Se="x-webframez-react-build",Ne="[data-webframez-head='true']";function Y(){if(typeof window>"u"||typeof document>"u")return;let e=()=>{window.scrollTo({top:0,left:0}),document.scrollingElement&&(document.scrollingElement.scrollTop=0),document.documentElement.scrollTop=0,document.body&&(document.body.scrollTop=0)};if(typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(e);return}window.setTimeout(e,0)}function x(e){return u(e)??""}function Pe(e,t){return t?e===t?"/":e.startsWith(`${t}/`)?e.slice(t.length)||"/":e||"/":e||"/"}function ne(e,t){let n=!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`;return e?n==="/"?e:`${e}${n}`:n}function Ie(){return x(typeof window>"u"?globalThis.__RSC_ROUTE_BASE_PATH:window.__RSC_ROUTE_BASE_PATH)}function oe(e){if(typeof window>"u")return e||"/";let t=x(window.__RSC_BASENAME),n=Ie(),o=Pe(e||"/",t);return ne(n,o)}function re(e){if(typeof window>"u")return e;let t=window.__RSC_ENDPOINT;return typeof t=="string"&&t.trim()!==""?t:e}function Le(){if(typeof window>"u")return"";let e=window[Ae];return typeof e=="string"?e:""}function ve(e){let t=Le();return!!t&&!!e&&t!==e}function L(e){typeof window>"u"||window.location.assign(`${e.pathname}${e.search}${e.hash}`)}function xe(){return typeof window>"u"?null:window[te]??null}function be(e){typeof window>"u"||(window[te]=e)}function Be(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Z(e){return Be(e)?s.default.use(e):e}function K(){let e={},t=typeof document>"u"?"":document.cookie;if(!t||t.trim()==="")return e;for(let n of t.split(";")){let o=n.trim();if(!o)continue;let r=o.indexOf("="),a=r>=0?o.slice(0,r).trim():o,c=r>=0?o.slice(r+1):"";a&&(e[a]=decodeURIComponent(c))}return e}function V(e,t,n={}){let o=[`${e}=${encodeURIComponent(t)}`];return n.path&&o.push(`Path=${n.path}`),n.domain&&o.push(`Domain=${n.domain}`),typeof n.maxAge=="number"&&o.push(`Max-Age=${Math.floor(n.maxAge)}`),n.expires&&o.push(`Expires=${n.expires.toUTCString()}`),n.sameSite&&o.push(`SameSite=${n.sameSite}`),n.secure&&o.push("Secure"),o.join("; ")}function Oe(){return s.default.useMemo(()=>({all:()=>K(),get:e=>K()[e],set:(e,t,n)=>{typeof document>"u"||(document.cookie=V(e,t,n))},remove:(e,t)=>{typeof document>"u"||(document.cookie=V(e,"",{...t??{},maxAge:0}))}}),[])}function ke(){let e=A?s.default.useContext(A):null;if(!e){let t=xe();if(t)return t;if(typeof window>"u")return Te;throw new Error("useRouter must be used inside mountWebframezClient()")}return e}function Ue({active:e}){return(0,d.jsx)("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:3,zIndex:9999,transformOrigin:"left",transform:e?"scaleX(1)":"scaleX(0)",transition:"transform 180ms ease",background:"linear-gradient(90deg, #0ea5e9, #22c55e)"}})}function X(e){let t=document.createElement("meta");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function J(e){let t=document.createElement("link");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function v(e){if(typeof document>"u")return;let t=P(e)??e;ie(t),document.body.className=t.bodyClassName||"",document.title=t.title||"Webframez React";for(let n of document.head.querySelectorAll(Ne))n.remove();t.description&&X({name:"description",content:t.description}),t.favicon&&J({rel:"icon",href:t.favicon});for(let n of t.meta??[])X(n);for(let n of t.links??[])J(n)}function ie(e){if(typeof window>"u")return;let t=P(e)??e,n=u(t.basename),o=u(t.routeBasePath),r=u(t.transportBasePath);window.__RSC_BASENAME=n??"",window.__RSC_ROUTE_BASE_PATH=o??"",r!==void 0&&(window.__RSC_ENDPOINT=ne(r,"/rsc"))}function He(e){let t=new TextEncoder;return new ReadableStream({start(n){n.enqueue(t.encode(e)),n.close()}})}function ze(){if(typeof window>"u")return null;let e=window.__RSC_INITIAL_PAYLOAD;return typeof e!="string"||e===""?null:(delete window.__RSC_INITIAL_PAYLOAD,(0,_.createFromReadableStream)(He(e)))}function De(e){let t=re(e),n=oe(window.location.pathname);return ze()??(0,_.createFromFetch)(fetch(`${t}?path=${encodeURIComponent(n)}&search=${encodeURIComponent(window.location.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}}))}function Me(e,t){return function(){let o=s.default.use(e),r=typeof o.contextModel<"u"&&typeof o.pageModel<"u",[a,c]=(0,s.useState)(o.model),[f,w]=(0,s.useState)(o.contextModel),[m,h]=(0,s.useState)(o.pageModel),[b,B]=(0,s.useState)(o.head),[ae,g]=(0,s.useState)(!1),[se,ce]=(0,s.useState)(!1),[de,S]=(0,s.useState)(r);async function O(i){let y=re(t),l=oe(i.pathname),R=await fetch(`${y}?path=${encodeURIComponent(l)}&search=${encodeURIComponent(i.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}});return ve(R.headers.get(Se))?(L(i),await new Promise(()=>{})):await(0,_.createFromFetch)(Promise.resolve(R))}async function C(i,y="push"){g(!0);try{let l=await O(i);v(l.head),B(l.head),c(l.model),w(l.contextModel),h(l.pageModel),S(!0);let R=`${i.pathname}${i.search}${i.hash}`;y==="replace"?(history.replaceState(null,"",R),Y()):y==="push"&&(history.pushState(null,"",R),Y())}catch(l){console.error("[webframez-react] Failed to render route",l),L(i),c((0,d.jsx)("p",{children:"Failed to load route."}))}finally{g(!1)}}async function ue(){g(!0);try{let i=await O(new URL(window.location.href));if(v(i.head),B(i.head),Object.prototype.hasOwnProperty.call(i,"contextModel")){w(i.contextModel),S(!0);return}c(i.model),S(!1)}catch(i){console.error("[webframez-react] Failed to refresh route context",i),L(new URL(window.location.href))}finally{g(!1)}}(0,s.useEffect)(()=>{v(b)},[b]),(0,s.useEffect)(()=>{ce(!0);let i=()=>{C(new URL(window.location.href),"none")};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)}},[]);let k=s.default.useMemo(()=>({push:i=>{C(new URL(i,window.location.origin),"push")},replace:i=>{C(new URL(i,window.location.origin),"replace")},refresh:()=>{C(new URL(window.location.href),"none")},refreshContext:()=>{ue()}}),[]);be(k);let U=Z(f),N=Z(m),le=de&&typeof m<"u"?U?(0,d.jsx)(ee.RouteChildrenSlotProvider,{page:N,children:T(U,N)}):N:a,H=(0,d.jsxs)(d.Fragment,{children:[se?(0,d.jsx)(Ue,{active:ae}):null,le??(0,d.jsx)("p",{style:{padding:24},children:"Loading..."})]});return A?(0,d.jsx)(A.Provider,{value:k,children:H}):H}}function $e(e={}){let t=e.rootId??"root",n=document.getElementById(t);if(!n)throw new Error(`Missing #${t} element`);let o=typeof window<"u"&&window.__RSC_ENDPOINT,r=e.rscEndpoint??o??"/rsc",a=Promise.resolve(De(r)).then(f=>(f?.head&&ie(f.head),f)),c=Me(a,r);return(0,Q.hydrateRoot)(n,(0,d.jsx)(c,{}))}
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- import p,{useEffect as W,useState as f}from"react";import{hydrateRoot as ue}from"react-dom/client";import{createFromFetch as Z,createFromReadableStream as le}from"react-server-dom-webpack/client";import{RouteChildrenSlotProvider as fe}from"@webtypen/webframez-react/route-slot";var ae=/^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;function c(e){if(typeof e!="string")return;let t=e.trim();return!t||t==="/"?"":t.replace(/\/+$/,"")}function U(e,t){let n=e.trim(),o=c(t);return!n||!o||ae.test(n)||n.startsWith("/")||o!=="/"&&(n===o||n.startsWith(`${o}/`))?n:o==="/"?n.startsWith("/")?n:`/${n}`:n.startsWith("/")?`${o}${n}`:`${o}/${n}`}function S(e,t){if(!e)return;let n=c(e.basename)??c(t),o=c(e.routeBasePath),r=c(e.transportBasePath),a={...e,...n!==void 0?{basename:n}:{},...o!==void 0?{routeBasePath:o}:{},...r!==void 0?{transportBasePath:r}:{}};return a.favicon&&(a.favicon=U(a.favicon,n)),a.links&&(a.links=a.links.map(s=>({...s,href:U(s.href,n)}))),a}import _ from"react";var D="webframez-route-children",M="__webframezRouteChildren",$="WebframezRouteChildren",se="__webframezRouteChildrenSlot",ce="WebframezRouteChildrenSlot",P=()=>_.createElement(D);P.displayName=$;P[M]=!0;var de=P;function k(e){if(e===D||e===de)return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[M]===!0||t.displayName===$||t.name==="RouteChildren"}catch{return!1}}function H(e){if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[se]===!0||t.displayName===ce||t.name==="RouteChildrenSlot"}catch{return!1}}function z(e){if(!e||typeof e!="object")return!1;try{return"type"in e&&"props"in e}catch{return!1}}function y(e,t){if(e==null||typeof e=="boolean")return e;if(Array.isArray(e)){let d=!1,w=e.map(l=>{let h=y(l,t);return h!==l&&(d=!0),h});return d?w:e}if(z(e)&&(k(e.type)||H(e.type)))return t;let n=_.isValidElement(e);if(!n&&!z(e))return e;if(n&&(k(e.type)||H(e.type)))return t;let o=e.props??{};if(!("children"in o))return e;let r=y(o.children,t);if(r===o.children)return e;if(n)return Array.isArray(r)?_.cloneElement(e,void 0,...r):_.cloneElement(e,void 0,r);let a=e,s={...a.props??{},children:r,...a.key!==void 0&&a.key!==null?{key:a.key}:{}};return _.createElement(a.type,s)}import{Fragment as Ie,jsx as m,jsxs as Le}from"react/jsx-runtime";var me={push:()=>{},replace:()=>{},refresh:()=>{},refreshContext:()=>{}},T=typeof p.createContext=="function"?p.createContext(null):null,K="__WEBFRAMEZ_ROUTER__",pe="__WEBFRAMEZ_REACT_BUILD_ID",Re="x-webframez-react-build",_e="[data-webframez-head='true']";function F(){if(typeof window>"u"||typeof document>"u")return;let e=()=>{window.scrollTo({top:0,left:0}),document.scrollingElement&&(document.scrollingElement.scrollTop=0),document.documentElement.scrollTop=0,document.body&&(document.body.scrollTop=0)};if(typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(e);return}window.setTimeout(e,0)}function L(e){return c(e)??""}function we(e,t){return t?e===t?"/":e.startsWith(`${t}/`)?e.slice(t.length)||"/":e||"/":e||"/"}function V(e,t){let n=!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`;return e?n==="/"?e:`${e}${n}`:n}function he(){return L(typeof window>"u"?globalThis.__RSC_ROUTE_BASE_PATH:window.__RSC_ROUTE_BASE_PATH)}function X(e){if(typeof window>"u")return e||"/";let t=L(window.__RSC_BASENAME),n=he(),o=we(e||"/",t);return V(n,o)}function J(e){if(typeof window>"u")return e;let t=window.__RSC_ENDPOINT;return typeof t=="string"&&t.trim()!==""?t:e}function ge(){if(typeof window>"u")return"";let e=window[pe];return typeof e=="string"?e:""}function Ce(e){let t=ge();return!!t&&!!e&&t!==e}function N(e){typeof window>"u"||window.location.assign(`${e.pathname}${e.search}${e.hash}`)}function Ee(){return typeof window>"u"?null:window[K]??null}function ye(e){typeof window>"u"||(window[K]=e)}function j(){let e={},t=typeof document>"u"?"":document.cookie;if(!t||t.trim()==="")return e;for(let n of t.split(";")){let o=n.trim();if(!o)continue;let r=o.indexOf("="),a=r>=0?o.slice(0,r).trim():o,s=r>=0?o.slice(r+1):"";a&&(e[a]=decodeURIComponent(s))}return e}function G(e,t,n={}){let o=[`${e}=${encodeURIComponent(t)}`];return n.path&&o.push(`Path=${n.path}`),n.domain&&o.push(`Domain=${n.domain}`),typeof n.maxAge=="number"&&o.push(`Max-Age=${Math.floor(n.maxAge)}`),n.expires&&o.push(`Expires=${n.expires.toUTCString()}`),n.sameSite&&o.push(`SameSite=${n.sameSite}`),n.secure&&o.push("Secure"),o.join("; ")}function Me(){return p.useMemo(()=>({all:()=>j(),get:e=>j()[e],set:(e,t,n)=>{typeof document>"u"||(document.cookie=G(e,t,n))},remove:(e,t)=>{typeof document>"u"||(document.cookie=G(e,"",{...t??{},maxAge:0}))}}),[])}function $e(){let e=T?p.useContext(T):null;if(!e){let t=Ee();if(t)return t;if(typeof window>"u")return me;throw new Error("useRouter must be used inside mountWebframezClient()")}return e}function Te({active:e}){return m("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:3,zIndex:9999,transformOrigin:"left",transform:e?"scaleX(1)":"scaleX(0)",transition:"transform 180ms ease",background:"linear-gradient(90deg, #0ea5e9, #22c55e)"}})}function q(e){let t=document.createElement("meta");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function Y(e){let t=document.createElement("link");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function I(e){if(typeof document>"u")return;let t=S(e)??e;Q(t),document.body.className=t.bodyClassName||"",document.title=t.title||"Webframez React";for(let n of document.head.querySelectorAll(_e))n.remove();t.description&&q({name:"description",content:t.description}),t.favicon&&Y({rel:"icon",href:t.favicon});for(let n of t.meta??[])q(n);for(let n of t.links??[])Y(n)}function Q(e){if(typeof window>"u")return;let t=S(e)??e,n=c(t.basename),o=c(t.routeBasePath),r=c(t.transportBasePath);window.__RSC_BASENAME=n??"",window.__RSC_ROUTE_BASE_PATH=o??"",r!==void 0&&(window.__RSC_ENDPOINT=V(r,"/rsc"))}function Ae(e){let t=new TextEncoder;return new ReadableStream({start(n){n.enqueue(t.encode(e)),n.close()}})}function Se(){if(typeof window>"u")return null;let e=window.__RSC_INITIAL_PAYLOAD;return typeof e!="string"||e===""?null:(delete window.__RSC_INITIAL_PAYLOAD,le(Ae(e)))}function Pe(e){let t=J(e),n=X(window.location.pathname);return Se()??Z(fetch(`${t}?path=${encodeURIComponent(n)}&search=${encodeURIComponent(window.location.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}}))}function Ne(e,t){return function(){let o=p.use(e),r=typeof o.contextModel<"u"&&typeof o.pageModel<"u",[a,s]=f(o.model),[d,w]=f(o.contextModel),[l,h]=f(o.pageModel),[v,x]=f(o.head),[ee,g]=f(!1),[te,ne]=f(!1),[oe,A]=f(r);async function b(i){let E=J(t),u=X(i.pathname),R=await fetch(`${E}?path=${encodeURIComponent(u)}&search=${encodeURIComponent(i.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}});return Ce(R.headers.get(Re))?(N(i),await new Promise(()=>{})):await Z(Promise.resolve(R))}async function C(i,E="push"){g(!0);try{let u=await b(i);I(u.head),x(u.head),s(u.model),w(u.contextModel),h(u.pageModel),A(!0);let R=`${i.pathname}${i.search}${i.hash}`;E==="replace"?(history.replaceState(null,"",R),F()):E==="push"&&(history.pushState(null,"",R),F())}catch(u){console.error("[webframez-react] Failed to render route",u),N(i),s(m("p",{children:"Failed to load route."}))}finally{g(!1)}}async function re(){g(!0);try{let i=await b(new URL(window.location.href));if(I(i.head),x(i.head),Object.prototype.hasOwnProperty.call(i,"contextModel")){w(i.contextModel),A(!0);return}s(i.model),A(!1)}catch(i){console.error("[webframez-react] Failed to refresh route context",i),N(new URL(window.location.href))}finally{g(!1)}}W(()=>{I(v)},[v]),W(()=>{ne(!0);let i=()=>{C(new URL(window.location.href),"none")};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)}},[]);let B=p.useMemo(()=>({push:i=>{C(new URL(i,window.location.origin),"push")},replace:i=>{C(new URL(i,window.location.origin),"replace")},refresh:()=>{C(new URL(window.location.href),"none")},refreshContext:()=>{re()}}),[]);ye(B);let ie=oe&&typeof l<"u"?d?m(fe,{page:l,children:y(d,l)}):l:a,O=Le(Ie,{children:[te?m(Te,{active:ee}):null,ie??m("p",{style:{padding:24},children:"Loading..."})]});return T?m(T.Provider,{value:B,children:O}):O}}function We(e={}){let t=e.rootId??"root",n=document.getElementById(t);if(!n)throw new Error(`Missing #${t} element`);let o=typeof window<"u"&&window.__RSC_ENDPOINT,r=e.rscEndpoint??o??"/rsc",a=Promise.resolve(Pe(r)).then(d=>(d?.head&&Q(d.head),d)),s=Ne(a,r);return ue(n,m(s,{}))}export{We as mountWebframezClient,Me as useCookie,$e as useRouter};
1
+ import p,{useEffect as j,useState as l}from"react";import{hydrateRoot as pe}from"react-dom/client";import{createFromFetch as X,createFromReadableStream as me}from"react-server-dom-webpack/client";import{RouteChildrenSlotProvider as Re}from"@webtypen/webframez-react/route-slot";var de=/^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;function c(e){if(typeof e!="string")return;let t=e.trim();return!t||t==="/"?"":t.replace(/\/+$/,"")}function H(e,t){let n=e.trim(),o=c(t);return!n||!o||de.test(n)||n.startsWith("/")||o!=="/"&&(n===o||n.startsWith(`${o}/`))?n:o==="/"?n.startsWith("/")?n:`/${n}`:n.startsWith("/")?`${o}${n}`:`${o}/${n}`}function N(e,t){if(!e)return;let n=c(e.basename)??c(t),o=c(e.routeBasePath),r=c(e.transportBasePath),a={...e,...n!==void 0?{basename:n}:{},...o!==void 0?{routeBasePath:o}:{},...r!==void 0?{transportBasePath:r}:{}};return a.favicon&&(a.favicon=H(a.favicon,n)),a.links&&(a.links=a.links.map(s=>({...s,href:H(s.href,n)}))),a}import _ from"react";var $="webframez-route-children",W="__webframezRouteChildren",F="WebframezRouteChildren",ue="__webframezRouteChildrenSlot",le="WebframezRouteChildrenSlot",P=()=>_.createElement($);P.displayName=F;P[W]=!0;var fe=P;function z(e){if(e===$||e===fe)return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[W]===!0||t.displayName===F||t.name==="RouteChildren"}catch{return!1}}function D(e){if(!e||typeof e!="function"&&typeof e!="object")return!1;try{let t=e;return t[ue]===!0||t.displayName===le||t.name==="RouteChildrenSlot"}catch{return!1}}function M(e){if(!e||typeof e!="object")return!1;try{return"type"in e&&"props"in e}catch{return!1}}function E(e,t){if(e==null||typeof e=="boolean")return e;if(Array.isArray(e)){let u=!1,w=e.map(m=>{let h=E(m,t);return h!==m&&(u=!0),h});return u?w:e}if(M(e)&&(z(e.type)||D(e.type)))return t;let n=_.isValidElement(e);if(!n&&!M(e))return e;if(n&&(z(e.type)||D(e.type)))return t;let o=e.props??{};if(!("children"in o))return e;let r=E(o.children,t);if(r===o.children)return e;if(n)return Array.isArray(r)?_.cloneElement(e,void 0,...r):_.cloneElement(e,void 0,r);let a=e,s={...a.props??{},children:r,...a.key!==void 0&&a.key!==null?{key:a.key}:{}};return _.createElement(a.type,s)}import{Fragment as be,jsx as f,jsxs as Be}from"react/jsx-runtime";var _e={push:()=>{},replace:()=>{},refresh:()=>{},refreshContext:()=>{}},T=typeof p.createContext=="function"?p.createContext(null):null,J="__WEBFRAMEZ_ROUTER__",we="__WEBFRAMEZ_REACT_BUILD_ID",he="x-webframez-react-build",ge="[data-webframez-head='true']";function G(){if(typeof window>"u"||typeof document>"u")return;let e=()=>{window.scrollTo({top:0,left:0}),document.scrollingElement&&(document.scrollingElement.scrollTop=0),document.documentElement.scrollTop=0,document.body&&(document.body.scrollTop=0)};if(typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(e);return}window.setTimeout(e,0)}function v(e){return c(e)??""}function Ce(e,t){return t?e===t?"/":e.startsWith(`${t}/`)?e.slice(t.length)||"/":e||"/":e||"/"}function Q(e,t){let n=!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`;return e?n==="/"?e:`${e}${n}`:n}function ye(){return v(typeof window>"u"?globalThis.__RSC_ROUTE_BASE_PATH:window.__RSC_ROUTE_BASE_PATH)}function ee(e){if(typeof window>"u")return e||"/";let t=v(window.__RSC_BASENAME),n=ye(),o=Ce(e||"/",t);return Q(n,o)}function te(e){if(typeof window>"u")return e;let t=window.__RSC_ENDPOINT;return typeof t=="string"&&t.trim()!==""?t:e}function Ee(){if(typeof window>"u")return"";let e=window[we];return typeof e=="string"?e:""}function Te(e){let t=Ee();return!!t&&!!e&&t!==e}function I(e){typeof window>"u"||window.location.assign(`${e.pathname}${e.search}${e.hash}`)}function Ae(){return typeof window>"u"?null:window[J]??null}function Se(e){typeof window>"u"||(window[J]=e)}function Ne(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function q(e){return Ne(e)?p.use(e):e}function Y(){let e={},t=typeof document>"u"?"":document.cookie;if(!t||t.trim()==="")return e;for(let n of t.split(";")){let o=n.trim();if(!o)continue;let r=o.indexOf("="),a=r>=0?o.slice(0,r).trim():o,s=r>=0?o.slice(r+1):"";a&&(e[a]=decodeURIComponent(s))}return e}function Z(e,t,n={}){let o=[`${e}=${encodeURIComponent(t)}`];return n.path&&o.push(`Path=${n.path}`),n.domain&&o.push(`Domain=${n.domain}`),typeof n.maxAge=="number"&&o.push(`Max-Age=${Math.floor(n.maxAge)}`),n.expires&&o.push(`Expires=${n.expires.toUTCString()}`),n.sameSite&&o.push(`SameSite=${n.sameSite}`),n.secure&&o.push("Secure"),o.join("; ")}function je(){return p.useMemo(()=>({all:()=>Y(),get:e=>Y()[e],set:(e,t,n)=>{typeof document>"u"||(document.cookie=Z(e,t,n))},remove:(e,t)=>{typeof document>"u"||(document.cookie=Z(e,"",{...t??{},maxAge:0}))}}),[])}function Ge(){let e=T?p.useContext(T):null;if(!e){let t=Ae();if(t)return t;if(typeof window>"u")return _e;throw new Error("useRouter must be used inside mountWebframezClient()")}return e}function Pe({active:e}){return f("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:3,zIndex:9999,transformOrigin:"left",transform:e?"scaleX(1)":"scaleX(0)",transition:"transform 180ms ease",background:"linear-gradient(90deg, #0ea5e9, #22c55e)"}})}function K(e){let t=document.createElement("meta");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function V(e){let t=document.createElement("link");t.setAttribute("data-webframez-head","true");let n=Object.entries(e).filter(([,o])=>!!o);for(let[o,r]of n)t.setAttribute(o,String(r));document.head.appendChild(t)}function L(e){if(typeof document>"u")return;let t=N(e)??e;ne(t),document.body.className=t.bodyClassName||"",document.title=t.title||"Webframez React";for(let n of document.head.querySelectorAll(ge))n.remove();t.description&&K({name:"description",content:t.description}),t.favicon&&V({rel:"icon",href:t.favicon});for(let n of t.meta??[])K(n);for(let n of t.links??[])V(n)}function ne(e){if(typeof window>"u")return;let t=N(e)??e,n=c(t.basename),o=c(t.routeBasePath),r=c(t.transportBasePath);window.__RSC_BASENAME=n??"",window.__RSC_ROUTE_BASE_PATH=o??"",r!==void 0&&(window.__RSC_ENDPOINT=Q(r,"/rsc"))}function Ie(e){let t=new TextEncoder;return new ReadableStream({start(n){n.enqueue(t.encode(e)),n.close()}})}function Le(){if(typeof window>"u")return null;let e=window.__RSC_INITIAL_PAYLOAD;return typeof e!="string"||e===""?null:(delete window.__RSC_INITIAL_PAYLOAD,me(Ie(e)))}function ve(e){let t=te(e),n=ee(window.location.pathname);return Le()??X(fetch(`${t}?path=${encodeURIComponent(n)}&search=${encodeURIComponent(window.location.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}}))}function xe(e,t){return function(){let o=p.use(e),r=typeof o.contextModel<"u"&&typeof o.pageModel<"u",[a,s]=l(o.model),[u,w]=l(o.contextModel),[m,h]=l(o.pageModel),[x,b]=l(o.head),[oe,g]=l(!1),[re,ie]=l(!1),[ae,A]=l(r);async function B(i){let y=te(t),d=ee(i.pathname),R=await fetch(`${y}?path=${encodeURIComponent(d)}&search=${encodeURIComponent(i.search)}`,{cache:"no-store",credentials:"same-origin",headers:{Accept:"text/x-component"}});return Te(R.headers.get(he))?(I(i),await new Promise(()=>{})):await X(Promise.resolve(R))}async function C(i,y="push"){g(!0);try{let d=await B(i);L(d.head),b(d.head),s(d.model),w(d.contextModel),h(d.pageModel),A(!0);let R=`${i.pathname}${i.search}${i.hash}`;y==="replace"?(history.replaceState(null,"",R),G()):y==="push"&&(history.pushState(null,"",R),G())}catch(d){console.error("[webframez-react] Failed to render route",d),I(i),s(f("p",{children:"Failed to load route."}))}finally{g(!1)}}async function se(){g(!0);try{let i=await B(new URL(window.location.href));if(L(i.head),b(i.head),Object.prototype.hasOwnProperty.call(i,"contextModel")){w(i.contextModel),A(!0);return}s(i.model),A(!1)}catch(i){console.error("[webframez-react] Failed to refresh route context",i),I(new URL(window.location.href))}finally{g(!1)}}j(()=>{L(x)},[x]),j(()=>{ie(!0);let i=()=>{C(new URL(window.location.href),"none")};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)}},[]);let O=p.useMemo(()=>({push:i=>{C(new URL(i,window.location.origin),"push")},replace:i=>{C(new URL(i,window.location.origin),"replace")},refresh:()=>{C(new URL(window.location.href),"none")},refreshContext:()=>{se()}}),[]);Se(O);let k=q(u),S=q(m),ce=ae&&typeof m<"u"?k?f(Re,{page:S,children:E(k,S)}):S:a,U=Be(be,{children:[re?f(Pe,{active:oe}):null,ce??f("p",{style:{padding:24},children:"Loading..."})]});return T?f(T.Provider,{value:O,children:U}):U}}function qe(e={}){let t=e.rootId??"root",n=document.getElementById(t);if(!n)throw new Error(`Missing #${t} element`);let o=typeof window<"u"&&window.__RSC_ENDPOINT,r=e.rscEndpoint??o??"/rsc",a=Promise.resolve(ve(r)).then(u=>(u?.head&&ne(u.head),u)),s=xe(a,r);return pe(n,f(s,{}))}export{qe as mountWebframezClient,je as useCookie,Ge as useRouter};
package/dist/http.cjs CHANGED
@@ -156,7 +156,6 @@ function sendRSC(res, model, options = {}) {
156
156
  var import_node_fs = __toESM(require("node:fs"), 1);
157
157
  var import_node_module2 = __toESM(require("node:module"), 1);
158
158
  var import_node_path2 = __toESM(require("node:path"), 1);
159
- var import_route_slot = require("@webtypen/webframez-react/route-slot");
160
159
 
161
160
  // src/head.ts
162
161
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -659,7 +658,7 @@ function createFileRouter(options) {
659
658
  const errorHead = await resolveHead(errorModule, errorProps);
660
659
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
661
660
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
662
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
661
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
663
662
  return {
664
663
  statusCode,
665
664
  model,
@@ -785,7 +784,7 @@ function createFileRouter(options) {
785
784
  const pageHead = await resolveHead(pageModule, pageContext);
786
785
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
787
786
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
788
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
787
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
789
788
  return {
790
789
  statusCode: 200,
791
790
  model,
package/dist/http.js CHANGED
@@ -136,7 +136,6 @@ function sendRSC(res, model, options = {}) {
136
136
  import fs from "node:fs";
137
137
  import Module from "node:module";
138
138
  import path2 from "node:path";
139
- import { RouteChildrenSlot } from "@webtypen/webframez-react/route-slot";
140
139
 
141
140
  // src/head.ts
142
141
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -639,7 +638,7 @@ function createFileRouter(options) {
639
638
  const errorHead = await resolveHead(errorModule, errorProps);
640
639
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
641
640
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
642
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
641
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
643
642
  return {
644
643
  statusCode,
645
644
  model,
@@ -765,7 +764,7 @@ function createFileRouter(options) {
765
764
  const pageHead = await resolveHead(pageModule, pageContext);
766
765
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
767
766
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
768
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
767
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
769
768
  return {
770
769
  statusCode: 200,
771
770
  model,
package/dist/index.cjs CHANGED
@@ -191,7 +191,6 @@ function createRSCHandler(options) {
191
191
  var import_node_fs = __toESM(require("node:fs"), 1);
192
192
  var import_node_module2 = __toESM(require("node:module"), 1);
193
193
  var import_node_path2 = __toESM(require("node:path"), 1);
194
- var import_route_slot = require("@webtypen/webframez-react/route-slot");
195
194
 
196
195
  // src/head.ts
197
196
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -694,7 +693,7 @@ function createFileRouter(options) {
694
693
  const errorHead = await resolveHead(errorModule, errorProps);
695
694
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
696
695
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
697
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
696
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
698
697
  return {
699
698
  statusCode,
700
699
  model,
@@ -820,7 +819,7 @@ function createFileRouter(options) {
820
819
  const pageHead = await resolveHead(pageModule, pageContext);
821
820
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
822
821
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
823
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
822
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
824
823
  return {
825
824
  statusCode: 200,
826
825
  model,
package/dist/index.js CHANGED
@@ -152,7 +152,6 @@ function createRSCHandler(options) {
152
152
  import fs from "node:fs";
153
153
  import Module from "node:module";
154
154
  import path2 from "node:path";
155
- import { RouteChildrenSlot } from "@webtypen/webframez-react/route-slot";
156
155
 
157
156
  // src/head.ts
158
157
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -655,7 +654,7 @@ function createFileRouter(options) {
655
654
  const errorHead = await resolveHead(errorModule, errorProps);
656
655
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
657
656
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
658
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
657
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
659
658
  return {
660
659
  statusCode,
661
660
  model,
@@ -781,7 +780,7 @@ function createFileRouter(options) {
781
780
  const pageHead = await resolveHead(pageModule, pageContext);
782
781
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
783
782
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
784
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
783
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
785
784
  return {
786
785
  statusCode: 200,
787
786
  model,
package/dist/router.cjs CHANGED
@@ -40,7 +40,6 @@ module.exports = __toCommonJS(router_exports);
40
40
  var import_node_fs = __toESM(require("node:fs"), 1);
41
41
  var import_node_module = __toESM(require("node:module"), 1);
42
42
  var import_node_path = __toESM(require("node:path"), 1);
43
- var import_route_slot = require("@webtypen/webframez-react/route-slot");
44
43
 
45
44
  // src/head.ts
46
45
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -543,7 +542,7 @@ function createFileRouter(options) {
543
542
  const errorHead = await resolveHead(errorModule, errorProps);
544
543
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
545
544
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
546
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
545
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
547
546
  return {
548
547
  statusCode,
549
548
  model,
@@ -669,7 +668,7 @@ function createFileRouter(options) {
669
668
  const pageHead = await resolveHead(pageModule, pageContext);
670
669
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
671
670
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
672
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
671
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
673
672
  return {
674
673
  statusCode: 200,
675
674
  model,
package/dist/router.js CHANGED
@@ -10,7 +10,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
10
10
  import fs from "node:fs";
11
11
  import Module from "node:module";
12
12
  import path from "node:path";
13
- import { RouteChildrenSlot } from "@webtypen/webframez-react/route-slot";
14
13
 
15
14
  // src/head.ts
16
15
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -513,7 +512,7 @@ function createFileRouter(options) {
513
512
  const errorHead = await resolveHead(errorModule, errorProps);
514
513
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
515
514
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
516
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
515
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
517
516
  return {
518
517
  statusCode,
519
518
  model,
@@ -639,7 +638,7 @@ function createFileRouter(options) {
639
638
  const pageHead = await resolveHead(pageModule, pageContext);
640
639
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
641
640
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
642
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
641
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
643
642
  return {
644
643
  statusCode: 200,
645
644
  model,
@@ -163,7 +163,6 @@ function sendRSC(res, model, options = {}) {
163
163
  var import_node_fs = __toESM(require("node:fs"), 1);
164
164
  var import_node_module2 = __toESM(require("node:module"), 1);
165
165
  var import_node_path2 = __toESM(require("node:path"), 1);
166
- var import_route_slot = require("@webtypen/webframez-react/route-slot");
167
166
 
168
167
  // src/head.ts
169
168
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -666,7 +665,7 @@ function createFileRouter(options) {
666
665
  const errorHead = await resolveHead(errorModule, errorProps);
667
666
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
668
667
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
669
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
668
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
670
669
  return {
671
670
  statusCode,
672
671
  model,
@@ -792,7 +791,7 @@ function createFileRouter(options) {
792
791
  const pageHead = await resolveHead(pageModule, pageContext);
793
792
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
794
793
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
795
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_route_slot.RouteChildrenSlot, {})) : void 0;
794
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RouteChildren, {})) : void 0;
796
795
  return {
797
796
  statusCode: 200,
798
797
  model,
@@ -139,7 +139,6 @@ function sendRSC(res, model, options = {}) {
139
139
  import fs from "node:fs";
140
140
  import Module from "node:module";
141
141
  import path2 from "node:path";
142
- import { RouteChildrenSlot } from "@webtypen/webframez-react/route-slot";
143
142
 
144
143
  // src/head.ts
145
144
  var ABSOLUTE_ASSET_URL_PATTERN = /^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/\/|#)/;
@@ -642,7 +641,7 @@ function createFileRouter(options) {
642
641
  const errorHead = await resolveHead(errorModule, errorProps);
643
642
  const layoutNode = layoutModule ? await layoutModule.default(context) : null;
644
643
  const model = layoutNode ? injectRouteChildren(layoutNode, errorNode) : errorNode;
645
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
644
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
646
645
  return {
647
646
  statusCode,
648
647
  model,
@@ -768,7 +767,7 @@ function createFileRouter(options) {
768
767
  const pageHead = await resolveHead(pageModule, pageContext);
769
768
  const layoutNode = layoutModule ? await layoutModule.default(pageContext) : null;
770
769
  const model = layoutNode ? injectRouteChildren(layoutNode, pageNode) : pageNode;
771
- const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildrenSlot, {})) : void 0;
770
+ const contextModel = layoutNode ? injectRouteChildren(layoutNode, /* @__PURE__ */ jsx(RouteChildren, {})) : void 0;
772
771
  return {
773
772
  statusCode: 200,
774
773
  model,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-react",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "description": "TypeScript React RSC addition for @webtypen/webframez-core",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "author": {