rari 0.17.8 → 0.17.10
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/cli.d.mts +0 -4
- package/dist/cli.mjs +1 -1
- package/dist/define-BIL9PMLh.mjs +1 -0
- package/dist/{define-BafO1-XT.d.mts → define-DCZgXfOp.d.mts} +0 -2
- package/dist/font/google-catalog.d.mts +15 -0
- package/dist/font/google.d.mts +1 -3
- package/dist/font/local.d.mts +2 -4
- package/dist/font.d.mts +1 -1
- package/dist/get-client-component-DVAbynLr.mjs +1 -0
- package/dist/headers.d.mts +1 -3
- package/dist/image/runtime-config.d.mts +1 -3
- package/dist/image/static.d.mts +1 -1
- package/dist/image.d.mts +1 -5
- package/dist/index.d.mts +2 -4
- package/dist/mdx/define.d.mts +1 -1
- package/dist/mdx/define.mjs +1 -1
- package/dist/mdx/registry.d.mts +1 -3
- package/dist/mdx.d.mts +1 -5
- package/dist/mdx.mjs +1 -1
- package/dist/og.d.mts +0 -2
- package/dist/platform.d.mts +1 -3
- package/dist/{preload-modules-BDQFWAlZ.mjs → preload-modules-0iyuP4Vs.mjs} +2 -2
- package/dist/proxy/RariRequest.d.mts +2 -4
- package/dist/proxy/RariResponse.d.mts +1 -1
- package/dist/proxy/executor.d.mts +1 -3
- package/dist/{react-helpers-GTRYJwF2.d.mts → react-helpers-CZtKqfS6.d.mts} +0 -2
- package/dist/{router-kf_rLP_F.mjs → router-861SNPMt.mjs} +1 -1
- package/dist/router.d.mts +0 -8
- package/dist/router.mjs +1 -1
- package/dist/runtime/AppRouterProvider.d.mts +1 -5
- package/dist/runtime/AppRouterProvider.mjs +1 -1
- package/dist/runtime/ClientRouter.d.mts +1 -3
- package/dist/runtime/ClientRouter.mjs +3 -3
- package/dist/runtime/ErrorBoundaryWrapper.d.mts +0 -2
- package/dist/runtime/ErrorBoundaryWrapper.mjs +1 -1
- package/dist/runtime/action-flight-refresh.d.mts +0 -2
- package/dist/runtime/action-revalidation-kind.d.mts +1 -3
- package/dist/runtime/call-server.d.mts +1 -3
- package/dist/runtime/entry-client.d.mts +2 -4
- package/dist/runtime/entry-client.mjs +3 -3
- package/dist/runtime/merge-flight-refresh.d.mts +2 -4
- package/dist/runtime/rsc-client-runtime.d.mts +1 -5
- package/dist/runtime/rsc-client-runtime.mjs +1 -1
- package/dist/runtime/rsc-references.d.mts +0 -2
- package/dist/{sitemap-DIL-PFSt.mjs → sitemap-ByPlT2YN.mjs} +1 -1
- package/dist/{static-modules-BnpA9S9v.d.mts → static-modules-DmO7M_cF.d.mts} +0 -4
- package/dist/{types-DAdRjhuk.d.mts → types-CSDt4P_t.d.mts} +0 -4
- package/dist/{types-C8N3Hc8I.d.mts → types-Cw2SI7r7.d.mts} +0 -2
- package/dist/{types-yeW6ju9Y.d.mts → types-DNk27dqJ.d.mts} +0 -10
- package/dist/{types-CkZPEEdi.d.mts → types-DeWes1rB.d.mts} +0 -2
- package/dist/vite.d.mts +2 -26
- package/dist/vite.mjs +77 -75
- package/package.json +13 -13
- package/dist/define-Dsj1lR4C.mjs +0 -1
- package/dist/get-client-component-D2K213pV.mjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as e}from"../route-cache-BfEqTT9i.mjs";import{r as t}from"../path-CTEC1xmy.mjs";import{d as n,g as r,h as i,i as a,n as o,s}from"../type-guards-BLY2PlGR.mjs";import{i as c,t as l}from"../navigate-CSQP4q53.mjs";import{t as u}from"../form-state-C9jn086j.mjs";import{c as d}from"react/compiler-runtime";import{useEffect as f,useLayoutEffect as p,useRef as m,useState as h}from"react";function ee(e,t,n={}){let r=null,i=0,a=0,o=null,s=null,{leading:c=!1,trailing:l=!0,maxWait:u}=n;function d(t){let n=o,r=s;o=null,s=null,a=t,e.apply(r,n)}function f(e){let n=e-i,r=e-a;return i===0||n>=t||n<0||u!==void 0&&r>=u}function p(){let e=Date.now();if(f(e)){h(e);return}let n=e-i,o=e-a,s=t-n,c=u===void 0?1/0:u-o;r=setTimeout(p,Math.min(s,c))}function m(e){a=e,r=setTimeout(p,t),c&&d(e)}function h(e){r=null,l&&o?d(e):(o=null,s=null)}function ee(){r!==null&&clearTimeout(r),a=0,o=null,i=0,s=null,r=null}function g(){r!==null&&h(Date.now())}function _(){return r!==null}function v(...e){let n=Date.now(),a=f(n);if(o=e,s=this,i=n,a){if(r===null){m(i);return}
|
|
2
2
|
/* v8 ignore start - edge case: isInvoking true with existing timeout and maxWait defined */
|
|
3
|
-
if(
|
|
3
|
+
if(u!==void 0){r=setTimeout(p,t),d(i);return}}r??=setTimeout(p,t)}return v.cancel=ee,v.flush=g,v.pending=_,v}const g=/fetch|networkerror|load failed/i;function _(e,t){return{type:`abort`,message:`Navigation was cancelled`,originalError:e,url:t,timestamp:Date.now(),retryable:!1}}function v(e,t){return{type:`timeout`,message:`Navigation request timed out`,originalError:e,url:t,timestamp:Date.now(),retryable:!0}}function y(e,t,n){if(t===404)return{type:`not-found`,message:`Page not found`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:!1};if(t>=500)return{type:`server-error`,message:`Server error: ${t}`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:!0};let r=t===408||t===429;return{type:`fetch-error`,message:`HTTP error: ${t}`,originalError:e,statusCode:t,url:n,timestamp:Date.now(),retryable:r}}function b(e,t){return{type:`network-error`,message:`Network error - check your connection`,originalError:e,url:t,timestamp:Date.now(),retryable:!0}}function x(e,t){return{type:`parse-error`,message:`Failed to parse server response`,
|
|
4
4
|
/* v8 ignore next - defensive check for non-Error values from parse-related condition */
|
|
5
5
|
originalError:o(e),url:t,timestamp:Date.now(),retryable:!1}}function S(e,t){return{type:`fetch-error`,message:o(e)?.message??`Unknown error occurred`,originalError:o(e),url:t,timestamp:Date.now(),retryable:!1}}function C(e,t){if(s(e))return _(o(e)??/* @__PURE__ */ Error(`Aborted`),t);if(n(e)&&(e.name===`TimeoutError`||e.message.includes(`timeout`)))return v(e,t);if(n(e)&&`status`in e){let n=e.status;return typeof n==`number`?y(e,n,t):S(e,t)}return e instanceof TypeError&&g.test(e.message)?b(e,t):e instanceof SyntaxError||n(e)&&e.message.includes(`parse`)?x(e,t):S(e,t)}var te=class{onError;constructor(e={}){
|
|
6
6
|
/* v8 ignore next - default no-op callback */
|
|
7
|
-
this.onError=e.onError??(()=>{})}handleError(e,t){let n=C(e,t);return this.onError(n),console.error(`[rari] Navigation:`,n.type,n.message,{url:n.url,statusCode:n.statusCode,retryable:n.retryable}),n}};function ne(e,t){try{let n=t!=null&&t!==``?t:window.location.origin,r=typeof URL.parse==`function`?URL.parse(e,n):new URL(e,n);return r!=null&&r.origin!==n}catch{return!1}}function re(e){try{let t=typeof URL.parse==`function`?URL.parse(e,window.location.origin):new URL(e,window.location.origin);return t==null?e:`${t.pathname}${t.search}${t.hash}`}catch{return e}}var ie=class{stateHistory;routeAccessOrder;maxHistorySize;scrollableSelector;constructor(e={}){this.stateHistory=/* @__PURE__ */ new Map,this.routeAccessOrder=[],this.maxHistorySize=e.maxHistorySize!=null&&e.maxHistorySize!==0?e.maxHistorySize:50,this.scrollableSelector=e.scrollableSelector!=null&&e.scrollableSelector!==``?e.scrollableSelector:`[data-scrollable], .scrollable, [style*="overflow"]`}captureState(e){let t={scrollPositions:this.captureScrollPositions(),formData:this.captureFormData(),focusedElement:this.captureFocusedElement()};return this.storeState(e,t),t}captureScrollPositions(){let e=/* @__PURE__ */ new Map;try{e.set(`window`,{x:window.scrollX,y:window.scrollY,element:`window`}),document.querySelectorAll(this.scrollableSelector).forEach((t,n)=>{if(t instanceof HTMLElement){let r=t.id||`scrollable-${n}`;(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&e.set(r,{x:t.scrollLeft,y:t.scrollTop,element:r})}})}catch{}return e}captureFormData(){let e=/* @__PURE__ */ new Map;try{document.querySelectorAll(`form`).forEach((t,n)=>{let r=t.id||t.name||`form-${n}`,i=new FormData(t);i.entries().next().done||e.set(r,i)})}catch{}return e}captureFocusedElement(){try{let e=document.activeElement;if(e&&e!==document.body){if(e.id)return`#${e.id}`;if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.name)return`[name="${e.name}"]`}}catch{}return null}storeState(e,t){let n=this.routeAccessOrder.indexOf(e);for(n!==-1&&this.routeAccessOrder.splice(n,1),this.routeAccessOrder.push(e),this.stateHistory.set(e,t);this.routeAccessOrder.length>this.maxHistorySize;){let e=this.routeAccessOrder.shift();e!=null&&e!==``&&this.stateHistory.delete(e)}}restoreState(e){let t=this.stateHistory.get(e);if(!t)return!1;let n=!0;return this.restoreScrollPositions(t.scrollPositions)||(n=!1),this.restoreFormData(t.formData)||(n=!1),t.focusedElement!=null&&t.focusedElement!==``&&this.restoreFocus(t.focusedElement),n}restoreScrollPositions(e){let t=!0;try{e.forEach((e,n)=>{try{if(n===`window`)window.scrollTo(e.x,e.y);else{let r=document.getElementById(n)??document.querySelector(`[data-scrollable-id="${n}"]`);r instanceof HTMLElement?(r.scrollLeft=e.x,r.scrollTop=e.y):t=!1}}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore scroll positions:`,e),t=!1}return t}restoreFormData(e){let t=!0;try{e.forEach((e,n)=>{try{let r=document.getElementById(n),i=r instanceof HTMLFormElement?r:document.querySelector(`form[name="${n}"]`)??document.querySelectorAll(`form`)[Number.parseInt(n.replace(`form-`,``),10)];i instanceof HTMLFormElement&&l(i,e)||(t=!1)}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore form data:`,e),t=!1}return t}restoreFocus(e){try{let t=document.querySelector(e);t instanceof HTMLElement&&requestAnimationFrame(()=>{try{t.focus()}catch{}})}catch{}}};function w(e){return r(e)&&typeof e.navigationId==`number`}function T(e){return r(e)&&typeof e.navigationId==`number`&&`error`in e}function ae(e){let t=e.headers.get(`x-rari-metadata`);if(t!=null&&t!==``)try{let e=JSON.parse(decodeURIComponent(t));if(!r(e))return;if(typeof e.title==`string`&&e.title!==``&&(document.title=e.title),typeof e.description==`string`&&e.description!==``){let t=document.querySelector(`meta[name="description"]`);t||(t=document.createElement(`meta`),t.setAttribute(`name`,`description`),document.head.appendChild(t)),t.setAttribute(`content`,e.description)}}catch{}}async function oe(e,t){return t.aborted?{error:new DOMException(`Aborted`,`AbortError`)}:new Promise(n=>{function r(){window.removeEventListener(`rari:navigate-committed`,i),window.removeEventListener(`rari:navigate-error`,o),t.removeEventListener(`abort`,s)}function i(t){a(t,w)?.navigationId===e&&(r(),n(`committed`))}function o(t){let i=a(t,T);i?.navigationId===e&&(r(),n({error:i.error}))}function s(){r(),n({error:new DOMException(`Aborted`,`AbortError`)})}window.addEventListener(`rari:navigate-committed`,i),window.addEventListener(`rari:navigate-error`,o),t.addEventListener(`abort`,s,{once:!0})})}function se(n){let r=u(35),{children:a,initialRoute:o}=n,l;r[0]===o?l=r[1]:(l=()=>({currentRoute:typeof window<`u`?`${window.location.pathname}${window.location.search}`:c(o),navigationId:0,error:null}),r[0]=o,r[1]=l);let[g,_]=m(l),v=p(null),y=p(!0),b;r[2]===o?b=r[3]:(b=typeof window<`u`?`${window.location.pathname}${window.location.search}`:c(o),r[2]=o,r[3]=b);let x=p(b),S;r[4]===o?S=r[5]:(S=typeof window<`u`?`${window.location.pathname}${window.location.search}${window.location.hash}`:c(o),r[4]=o,r[5]=S);let C=p(S),w=p(0),T;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=new te({onError:ue}),r[6]=T):T=r[6];let se=p(T),E;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=/* @__PURE__ */ new Map,r[7]=E):E=r[7];let D=p(E),O;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=new ie({maxHistorySize:50}),r[8]=O):O=r[8];let k=p(O),de=le,A;r[9]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{v.current&&=(v.current.abort(),null)},r[9]=A):A=r[9];let fe=A,j;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{for(let[,e]of D.current.entries())e.bodyHandedOff?window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{navigationId:e.navigationId,error:new DOMException(`Aborted`,`AbortError`)}})):e.abortController.abort();D.current.clear()},r[10]=j):j=r[10];let pe=j,M;r[11]===g?M=r[12]:(M=(e,t)=>{D.current.delete(e),y.current&&g.navigationId===t&&_(ce)},r[11]=g,r[12]=M);let N=M,P;r[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(e,t)=>{let n=t===void 0?{}:t,r=`${window.location.pathname}${window.location.search}`,i=e?`${r}#${e}`:r;if(e){let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})}i!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&(n.replace?window.history.replaceState(window.history.state,``,i):window.history.pushState(window.history.state,``,i)),C.current=i},r[13]=P):P=r[13];let me=P,F;if(r[14]===Symbol.for(`react.memo_cache_sentinel`)){let e=(e,t,n)=>{n.historyKey!=null&&n.historyKey!==``?requestAnimationFrame(()=>{k.current.restoreState(e)}):t&&requestAnimationFrame(()=>{let e=n=>{let r=n===void 0?0:n,i=document.getElementById(t);i?i.scrollIntoView({behavior:`smooth`,block:`start`}):r<10&&setTimeout(e,50,r+1)};e()})};F=(t,n,r,i,a)=>{y.current&&w.current===i&&(x.current=t,C.current=a,_(e=>({...e,currentRoute:t,navigationId:i,error:null})),e(t,n,r))},r[14]=F}else F=r[14];let he=F,I;r[15]===N?I=r[16]:(I=(e,t,n,r,i)=>{let a=i===void 0?{}:i;if(s(e)){N(t,n);return}let o=se.current.handleError(e,t);y.current&&(_(e=>({...e,error:o})),window.history.replaceState(window.history.state,``,r)),D.current.delete(t),a.emitEvent!==!1&&window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{from:r,to:t,error:o,navigationId:n}}))},r[15]=N,r[16]=I);let L=I,R;r[17]!==N||r[18]!==L?(R=async(e,t)=>{let n=t===void 0?{}:t;if(!e||typeof e!=`string`)return;let[r,i]=e.includes(`#`)?e.split(`#`):[e,``],a=c(r);if(a===x.current){me(i,{replace:n.replace===!0});return}let o=D.current.get(a);if(o)return o.promise;pe(),fe();let s=new AbortController;v.current=s,w.current+=1;let l=w.current;window.dispatchEvent(new CustomEvent(`rari:navigation-start`,{detail:{navigationId:l,targetPath:a}}));let u=(async()=>{let e=C.current;try{(n.historyKey==null||n.historyKey===``)&&k.current.captureState(x.current);let t=n.historyKey!=null&&n.historyKey!==``?n.historyKey:de(),r=window.location.origin+a,o={route:a,navigationId:l,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:t},c=await fetch(r,{headers:{Accept:`text/x-component`,"rari-navigation-id":String(l),"rari-router-state":ee()},cache:`no-store`,signal:s.signal});if(!c.ok&&c.status!==404){L(/* @__PURE__ */ Error(`Failed to fetch: ${c.status}`),a,l,e);return}if(s.signal.aborted){N(a,l);return}let u=new URL(c.url),d=u.pathname,f=`${u.pathname}${u.search}`,p={...o,route:f},m=`${f}${i?`#${i}`:``}`;if(w.current!==l)return;let h=oe(l,s.signal),g=D.current.get(a);if(g!=null&&(g.bodyHandedOff=!0),v.current===s&&(v.current=null),window.dispatchEvent(new CustomEvent(`rari:navigate`,{detail:{from:new URL(e,window.location.origin).pathname,to:d,navigationId:l,options:n,abortSignal:s.signal,rscResponse:c,pendingHistory:{url:m,state:p,replace:n.replace===!0}}})),w.current!==l){window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{navigationId:l,error:new DOMException(`Aborted`,`AbortError`)}}));return}let _=await h;if(w.current!==l)return;if(_!==`committed`){L(_.error,a,l,e,{emitEvent:!1});return}he(f,i,n,l,m),ae(c),D.current.delete(a)}catch(t){L(t,a,l,e)}})();return D.current.set(a,{targetPath:a,navigationId:l,promise:u,abortController:s,bodyHandedOff:!1}),u},r[17]=N,r[18]=L,r[19]=R):R=r[19];let z=R,B=p(z),V;r[20]===z?V=r[21]:(V=()=>(B.current=z,()=>{B.current=null}),r[20]=z,r[21]=V),f(V);let ge=p(null),H,U;r[22]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{ge.current??=h((e,t)=>{B.current?.(e,t)},50,{leading:!0,trailing:!0,maxWait:200})},U=[],r[22]=H,r[23]=U):(H=r[22],U=r[23]),f(H,U);let W;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{if(e.button!==0||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;let t=e.target instanceof Element?e.target:null;for(;t&&!(t instanceof HTMLAnchorElement);)t=t.parentElement;if(!(t instanceof HTMLAnchorElement))return;let n=t;if(n.target&&n.target!==`_self`||n.hasAttribute(`download`))return;let r=n.getAttribute(`href`);if(r==null||r===``||ne(r))return;if(r.startsWith(`#`)){e.preventDefault();let t=r.slice(1),n=document.getElementById(t);if(n){n.scrollIntoView({behavior:`smooth`,block:`start`});let e=`${window.location.pathname}${window.location.search}#${t}`;window.history.pushState(window.history.state,``,e),C.current=e}return}e.preventDefault();let i=re(r);ge.current?.(i,{replace:!1})},r[24]=W):W=r[24];let _e=W,G;r[25]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{let t=`${window.location.pathname}${window.location.search}${window.location.hash}`,n=i(e.state)?e.state:null;B.current&&B.current(t,{replace:!0,scroll:!1,historyKey:n?.key})},r[25]=G):G=r[25];let ve=G,K;r[26]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>{let e=i(window.history.state)?window.history.state:null;if(e?.key==null||e.key===``){let e={route:`${window.location.pathname}${window.location.search}`,navigationId:0,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:de()};window.history.replaceState(e,``,window.location.pathname+window.location.search+window.location.hash)}},r[26]=K):K=r[26];let q;r[27]===o?q=r[28]:(q=[o],r[27]=o,r[28]=q),d(K,q);let J;r[29]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{if(e.persisted){let e=window.location.pathname;k.current.captureState(e)}},r[29]=J):J=r[29];let ye=J,Y;r[30]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{if(e.persisted){let e=window.location.pathname,t=i(window.history.state)?window.history.state:null;requestAnimationFrame(()=>{k.current.restoreState(e),t?.scrollPosition&&window.scrollTo(t.scrollPosition.x,t.scrollPosition.y)})}},r[30]=Y):Y=r[30];let be=Y,X,Z;r[31]===Symbol.for(`react.memo_cache_sentinel`)?(X=()=>(document.addEventListener(`click`,_e),window.addEventListener(`popstate`,ve),window.addEventListener(`pagehide`,ye),window.addEventListener(`pageshow`,be),()=>{document.removeEventListener(`click`,_e),window.removeEventListener(`popstate`,ve),window.removeEventListener(`pagehide`,ye),window.removeEventListener(`pageshow`,be)}),Z=[],r[31]=X,r[32]=Z):(X=r[31],Z=r[32]),d(X,Z);let Q,$;return r[33]===Symbol.for(`react.memo_cache_sentinel`)?(Q=()=>(y.current=!0,e(async(e,t)=>B.current?.(e,t)??Promise.resolve()),()=>{y.current=!1,t(),fe(),pe(),ge.current?.cancel()}),$=[],r[33]=Q,r[34]=$):(Q=r[33],$=r[34]),d(Q,$),a}function ce(e){return{...e}}function le(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`hk-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}function ue(e){console.error(`[rari] Router: Navigation error:`,e)}export{se as ClientRouter};
|
|
7
|
+
this.onError=e.onError??(()=>{})}handleError(e,t){let n=C(e,t);return this.onError(n),console.error(`[rari] Navigation:`,n.type,n.message,{url:n.url,statusCode:n.statusCode,retryable:n.retryable}),n}};function ne(e,t){try{let n=t!=null&&t!==``?t:window.location.origin,r=typeof URL.parse==`function`?URL.parse(e,n):new URL(e,n);return r!=null&&r.origin!==n}catch{return!1}}function re(e){try{let t=typeof URL.parse==`function`?URL.parse(e,window.location.origin):new URL(e,window.location.origin);return t==null?e:`${t.pathname}${t.search}${t.hash}`}catch{return e}}var ie=class{stateHistory;routeAccessOrder;maxHistorySize;scrollableSelector;constructor(e={}){this.stateHistory=/* @__PURE__ */ new Map,this.routeAccessOrder=[],this.maxHistorySize=e.maxHistorySize!=null&&e.maxHistorySize!==0?e.maxHistorySize:50,this.scrollableSelector=e.scrollableSelector!=null&&e.scrollableSelector!==``?e.scrollableSelector:`[data-scrollable], .scrollable, [style*="overflow"]`}captureState(e){let t={scrollPositions:this.captureScrollPositions(),formData:this.captureFormData(),focusedElement:this.captureFocusedElement()};return this.storeState(e,t),t}captureScrollPositions(){let e=/* @__PURE__ */ new Map;try{e.set(`window`,{x:window.scrollX,y:window.scrollY,element:`window`}),document.querySelectorAll(this.scrollableSelector).forEach((t,n)=>{if(t instanceof HTMLElement){let r=t.id||`scrollable-${n}`;(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&e.set(r,{x:t.scrollLeft,y:t.scrollTop,element:r})}})}catch{}return e}captureFormData(){let e=/* @__PURE__ */ new Map;try{document.querySelectorAll(`form`).forEach((t,n)=>{let r=t.id||t.name||`form-${n}`,i=new FormData(t);i.entries().next().done||e.set(r,i)})}catch{}return e}captureFocusedElement(){try{let e=document.activeElement;if(e&&e!==document.body){if(e.id)return`#${e.id}`;if((e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.name)return`[name="${e.name}"]`}}catch{}return null}storeState(e,t){let n=this.routeAccessOrder.indexOf(e);for(n!==-1&&this.routeAccessOrder.splice(n,1),this.routeAccessOrder.push(e),this.stateHistory.set(e,t);this.routeAccessOrder.length>this.maxHistorySize;){let e=this.routeAccessOrder.shift();e!=null&&e!==``&&this.stateHistory.delete(e)}}restoreState(e){let t=this.stateHistory.get(e);if(!t)return!1;let n=!0;return this.restoreScrollPositions(t.scrollPositions)||(n=!1),this.restoreFormData(t.formData)||(n=!1),t.focusedElement!=null&&t.focusedElement!==``&&this.restoreFocus(t.focusedElement),n}restoreScrollPositions(e){let t=!0;try{e.forEach((e,n)=>{try{if(n===`window`)window.scrollTo(e.x,e.y);else{let r=document.getElementById(n)??document.querySelector(`[data-scrollable-id="${n}"]`);r instanceof HTMLElement?(r.scrollLeft=e.x,r.scrollTop=e.y):t=!1}}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore scroll positions:`,e),t=!1}return t}restoreFormData(e){let t=!0;try{e.forEach((e,n)=>{try{let r=document.getElementById(n),i=r instanceof HTMLFormElement?r:document.querySelector(`form[name="${n}"]`)??document.querySelectorAll(`form`)[Number.parseInt(n.replace(`form-`,``),10)];i instanceof HTMLFormElement&&u(i,e)||(t=!1)}catch{t=!1}})}catch(e){console.error(`[rari] Router: Failed to restore form data:`,e),t=!1}return t}restoreFocus(e){try{let t=document.querySelector(e);t instanceof HTMLElement&&requestAnimationFrame(()=>{try{t.focus()}catch{}})}catch{}}};function w(e){return r(e)&&typeof e.navigationId==`number`}function T(e){return r(e)&&typeof e.navigationId==`number`&&`error`in e}function ae(e){let t=e.headers.get(`x-rari-metadata`);if(t!=null&&t!==``)try{let e=JSON.parse(decodeURIComponent(t));if(!r(e))return;if(typeof e.title==`string`&&e.title!==``&&(document.title=e.title),typeof e.description==`string`&&e.description!==``){let t=document.querySelector(`meta[name="description"]`);t||(t=document.createElement(`meta`),t.setAttribute(`name`,`description`),document.head.appendChild(t)),t.setAttribute(`content`,e.description)}}catch{}}async function oe(e,t){return t.aborted?{error:new DOMException(`Aborted`,`AbortError`)}:new Promise(n=>{function r(){window.removeEventListener(`rari:navigate-committed`,i),window.removeEventListener(`rari:navigate-error`,o),t.removeEventListener(`abort`,s)}function i(t){a(t,w)?.navigationId===e&&(r(),n(`committed`))}function o(t){let i=a(t,T);i?.navigationId===e&&(r(),n({error:i.error}))}function s(){r(),n({error:new DOMException(`Aborted`,`AbortError`)})}window.addEventListener(`rari:navigate-committed`,i),window.addEventListener(`rari:navigate-error`,o),t.addEventListener(`abort`,s,{once:!0})})}function se(n){let r=d(35),{children:a,initialRoute:o}=n,u;r[0]===o?u=r[1]:(u=()=>({currentRoute:typeof window<`u`?`${window.location.pathname}${window.location.search}`:t(o),navigationId:0,error:null}),r[0]=o,r[1]=u);let[g,_]=h(u),v=m(null),y=m(!0),b;r[2]===o?b=r[3]:(b=typeof window<`u`?`${window.location.pathname}${window.location.search}`:t(o),r[2]=o,r[3]=b);let x=m(b),S;r[4]===o?S=r[5]:(S=typeof window<`u`?`${window.location.pathname}${window.location.search}${window.location.hash}`:t(o),r[4]=o,r[5]=S);let C=m(S),w=m(0),T;r[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=new te({onError:ue}),r[6]=T):T=r[6];let se=m(T),E;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(E=/* @__PURE__ */ new Map,r[7]=E):E=r[7];let D=m(E),O;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(O=new ie({maxHistorySize:50}),r[8]=O):O=r[8];let k=m(O),de=le,A;r[9]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{v.current&&=(v.current.abort(),null)},r[9]=A):A=r[9];let fe=A,j;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{for(let[,e]of D.current.entries())e.bodyHandedOff?window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{navigationId:e.navigationId,error:new DOMException(`Aborted`,`AbortError`)}})):e.abortController.abort();D.current.clear()},r[10]=j):j=r[10];let pe=j,M;r[11]===g?M=r[12]:(M=(e,t)=>{D.current.delete(e),y.current&&g.navigationId===t&&_(ce)},r[11]=g,r[12]=M);let N=M,P;r[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=(e,t)=>{let n=t===void 0?{}:t,r=`${window.location.pathname}${window.location.search}`,i=e?`${r}#${e}`:r;if(e){let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})}i!==`${window.location.pathname}${window.location.search}${window.location.hash}`&&(n.replace?window.history.replaceState(window.history.state,``,i):window.history.pushState(window.history.state,``,i)),C.current=i},r[13]=P):P=r[13];let me=P,F;if(r[14]===Symbol.for(`react.memo_cache_sentinel`)){let e=(e,t,n)=>{n.historyKey!=null&&n.historyKey!==``?requestAnimationFrame(()=>{k.current.restoreState(e)}):t&&requestAnimationFrame(()=>{let e=n=>{let r=n===void 0?0:n,i=document.getElementById(t);i?i.scrollIntoView({behavior:`smooth`,block:`start`}):r<10&&setTimeout(e,50,r+1)};e()})};F=(t,n,r,i,a)=>{y.current&&w.current===i&&(x.current=t,C.current=a,_(e=>({...e,currentRoute:t,navigationId:i,error:null})),e(t,n,r))},r[14]=F}else F=r[14];let he=F,I;r[15]===N?I=r[16]:(I=(e,t,n,r,i)=>{let a=i===void 0?{}:i;if(s(e)){N(t,n);return}let o=se.current.handleError(e,t);y.current&&(_(e=>({...e,error:o})),window.history.replaceState(window.history.state,``,r)),D.current.delete(t),a.emitEvent!==!1&&window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{from:r,to:t,error:o,navigationId:n}}))},r[15]=N,r[16]=I);let L=I,R;r[17]!==N||r[18]!==L?(R=async(n,r)=>{let i=r===void 0?{}:r;if(!n||typeof n!=`string`)return;let[a,o]=n.includes(`#`)?n.split(`#`):[n,``],s=t(a);if(s===x.current){me(o,{replace:i.replace===!0});return}let c=D.current.get(s);if(c)return c.promise;pe(),fe();let l=new AbortController;v.current=l,w.current+=1;let u=w.current;window.dispatchEvent(new CustomEvent(`rari:navigation-start`,{detail:{navigationId:u,targetPath:s}}));let d=(async()=>{let t=C.current;try{(i.historyKey==null||i.historyKey===``)&&k.current.captureState(x.current);let n=i.historyKey!=null&&i.historyKey!==``?i.historyKey:de(),r=window.location.origin+s,a={route:s,navigationId:u,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:n},c=await fetch(r,{headers:{Accept:`text/x-component`,"rari-navigation-id":String(u),"rari-router-state":e()},cache:`no-store`,signal:l.signal});if(!c.ok&&c.status!==404){L(/* @__PURE__ */ Error(`Failed to fetch: ${c.status}`),s,u,t);return}if(l.signal.aborted){N(s,u);return}let d=new URL(c.url),f=d.pathname,p=`${d.pathname}${d.search}`,m={...a,route:p},h=`${p}${o?`#${o}`:``}`;if(w.current!==u)return;let ee=oe(u,l.signal),g=D.current.get(s);if(g!=null&&(g.bodyHandedOff=!0),v.current===l&&(v.current=null),window.dispatchEvent(new CustomEvent(`rari:navigate`,{detail:{from:new URL(t,window.location.origin).pathname,to:f,navigationId:u,options:i,abortSignal:l.signal,rscResponse:c,pendingHistory:{url:h,state:m,replace:i.replace===!0}}})),w.current!==u){window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{navigationId:u,error:new DOMException(`Aborted`,`AbortError`)}}));return}let _=await ee;if(w.current!==u)return;if(_!==`committed`){L(_.error,s,u,t,{emitEvent:!1});return}he(p,o,i,u,h),ae(c),D.current.delete(s)}catch(e){L(e,s,u,t)}})();return D.current.set(s,{targetPath:s,navigationId:u,promise:d,abortController:l,bodyHandedOff:!1}),d},r[17]=N,r[18]=L,r[19]=R):R=r[19];let z=R,B=m(z),V;r[20]===z?V=r[21]:(V=()=>(B.current=z,()=>{B.current=null}),r[20]=z,r[21]=V),p(V);let ge=m(null),H,U;r[22]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{ge.current??=ee((e,t)=>{B.current?.(e,t)},50,{leading:!0,trailing:!0,maxWait:200})},U=[],r[22]=H,r[23]=U):(H=r[22],U=r[23]),p(H,U);let W;r[24]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{if(e.button!==0||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;let t=e.target instanceof Element?e.target:null;for(;t&&!(t instanceof HTMLAnchorElement);)t=t.parentElement;if(!(t instanceof HTMLAnchorElement))return;let n=t;if(n.target&&n.target!==`_self`||n.hasAttribute(`download`))return;let r=n.getAttribute(`href`);if(r==null||r===``||ne(r))return;if(r.startsWith(`#`)){e.preventDefault();let t=r.slice(1),n=document.getElementById(t);if(n){n.scrollIntoView({behavior:`smooth`,block:`start`});let e=`${window.location.pathname}${window.location.search}#${t}`;window.history.pushState(window.history.state,``,e),C.current=e}return}e.preventDefault();let i=re(r);ge.current?.(i,{replace:!1})},r[24]=W):W=r[24];let _e=W,G;r[25]===Symbol.for(`react.memo_cache_sentinel`)?(G=e=>{let t=`${window.location.pathname}${window.location.search}${window.location.hash}`,n=i(e.state)?e.state:null;B.current&&B.current(t,{replace:!0,scroll:!1,historyKey:n?.key})},r[25]=G):G=r[25];let ve=G,K;r[26]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>{let e=i(window.history.state)?window.history.state:null;if(e?.key==null||e.key===``){let e={route:`${window.location.pathname}${window.location.search}`,navigationId:0,scrollPosition:{x:window.scrollX,y:window.scrollY},timestamp:Date.now(),key:de()};window.history.replaceState(e,``,window.location.pathname+window.location.search+window.location.hash)}},r[26]=K):K=r[26];let q;r[27]===o?q=r[28]:(q=[o],r[27]=o,r[28]=q),f(K,q);let J;r[29]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>{if(e.persisted){let e=window.location.pathname;k.current.captureState(e)}},r[29]=J):J=r[29];let ye=J,Y;r[30]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{if(e.persisted){let e=window.location.pathname,t=i(window.history.state)?window.history.state:null;requestAnimationFrame(()=>{k.current.restoreState(e),t?.scrollPosition&&window.scrollTo(t.scrollPosition.x,t.scrollPosition.y)})}},r[30]=Y):Y=r[30];let be=Y,X,Z;r[31]===Symbol.for(`react.memo_cache_sentinel`)?(X=()=>(document.addEventListener(`click`,_e),window.addEventListener(`popstate`,ve),window.addEventListener(`pagehide`,ye),window.addEventListener(`pageshow`,be),()=>{document.removeEventListener(`click`,_e),window.removeEventListener(`popstate`,ve),window.removeEventListener(`pagehide`,ye),window.removeEventListener(`pageshow`,be)}),Z=[],r[31]=X,r[32]=Z):(X=r[31],Z=r[32]),f(X,Z);let Q,$;return r[33]===Symbol.for(`react.memo_cache_sentinel`)?(Q=()=>(y.current=!0,c(async(e,t)=>B.current?.(e,t)??Promise.resolve()),()=>{y.current=!1,l(),fe(),pe(),ge.current?.cancel()}),$=[],r[33]=Q,r[34]=$):(Q=r[33],$=r[34]),f(Q,$),a}function ce(e){return{...e}}function le(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`hk-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,11)}`}function ue(e){console.error(`[rari] Router: Navigation error:`,e)}export{se as ClientRouter};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, ComponentType, ErrorInfo, ReactNode } from "react";
|
|
2
|
-
//#region src/runtime/boundaries/error-boundary-wrapper.d.ts
|
|
3
2
|
interface ErrorBoundaryWrapperProps {
|
|
4
3
|
readonly errorComponentId: string;
|
|
5
4
|
readonly children: ReactNode;
|
|
@@ -23,5 +22,4 @@ export declare class ErrorBoundaryWrapper extends Component<ErrorBoundaryWrapper
|
|
|
23
22
|
reset: () => void;
|
|
24
23
|
render(): ReactNode;
|
|
25
24
|
}
|
|
26
|
-
//#endregion
|
|
27
25
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"../timer-Duul5JHq.mjs";import{g as t,s as n,u as r}from"../type-guards-BLY2PlGR.mjs";import{r as i}from"../rari-global-5vGzhToD.mjs";import{Component as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c(e){if(r(e))return e;if(t(e)){let t=e.default??e;return r(t)?t:null}return null}var l=class extends a{_isMounted=!1;_pendingTimer=null;constructor(e){super(e),this.state={hasError:!1,error:null,ErrorComponent:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidMount(){this._isMounted=!0}componentWillUnmount(){this._isMounted=!1,this._pendingTimer=e(this._pendingTimer)}componentDidCatch(e,t){if(n(e))return;console.error(`[rari] Error boundary caught error:`,e,t);let r=this.props.errorComponentId;if(r!==``){let e=i();if(r in e){let t=e[r],n=c(t.component);n?this.setState({ErrorComponent:n}):t.loader&&!t.loading&&(t.loading=!0,t.loader().then(e=>{let n=c(e);n&&(t.component=n,t.registered=!0,this.setState({ErrorComponent:n})),t.loading=!1}).catch(e=>{t.loading=!1,console.error(`[rari] Failed to load error component ${r}:`,e)}))}}}reset=()=>{this._pendingTimer=e(this._pendingTimer),this._pendingTimer=setTimeout(()=>{this._isMounted&&this.setState({hasError:!1,error:null,ErrorComponent:null}),this._pendingTimer=null},50)};render(){if(this.state.hasError&&this.state.error){if(n(this.state.error))return null;let{ErrorComponent:e}=this.state;return e?/* @__PURE__ */ o(e,{error:this.state.error,reset:this.reset}):/* @__PURE__ */ s(`div`,{className:`rari-error`,role:`alert`,style:{color:`red`,border:`1px solid red`,padding:`10px`,borderRadius:`4px`,backgroundColor:`#fff5f5`},children:[/* @__PURE__ */ o(`strong`,{children:`Error loading content: `}),this.state.error.message]})}return this.props.children}};export{l as ErrorBoundaryWrapper};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ActionDidNotRevalidate, ActionDidRevalidateDynamicOnly, ActionDidRevalidateStaticAndDynamic, ActionRevalidationKind } from "./action-revalidation-kind.mjs";
|
|
2
|
-
//#region src/runtime/actions/flight-refresh.d.ts
|
|
3
2
|
export interface ActionFlightRefreshDetail {
|
|
4
3
|
element: unknown;
|
|
5
4
|
revalidationKind: ActionRevalidationKind;
|
|
@@ -10,5 +9,4 @@ export interface ActionFlightResponseShape {
|
|
|
10
9
|
readonly f?: unknown;
|
|
11
10
|
}
|
|
12
11
|
export declare function scheduleActionFlightRefresh(response: Response, flightResponse: ActionFlightResponseShape, actionResult: unknown): void;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { ActionDidNotRevalidate, ActionDidRevalidateDynamicOnly, ActionDidRevalidateStaticAndDynamic };
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
//#region src/runtime/actions/revalidation-kind.d.ts
|
|
2
1
|
export type ActionRevalidationKind = 0 | 1 | 2;
|
|
3
2
|
export declare const ActionDidNotRevalidate: 0;
|
|
4
3
|
export declare const ActionDidRevalidateStaticAndDynamic: 1;
|
|
5
4
|
export declare const ActionDidRevalidateDynamicOnly: 2;
|
|
6
|
-
export declare function parseActionRevalidationKind(header: string | null): ActionRevalidationKind;
|
|
7
|
-
//#endregion
|
|
5
|
+
export declare function parseActionRevalidationKind(header: string | null): ActionRevalidationKind;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import "../types-
|
|
1
|
+
import "../types-Cw2SI7r7.mjs";
|
|
2
2
|
import "virtual:rsc-integration.ts";
|
|
3
|
-
|
|
4
|
-
export declare function renderApp(): Promise<void>;
|
|
5
|
-
//#endregion
|
|
3
|
+
export declare function renderApp(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{g as
|
|
1
|
+
import{t as e}from"../router-861SNPMt.mjs";import{g as t,i as n,n as r,p as i,r as a}from"../type-guards-BLY2PlGR.mjs";import{n as o,t as s}from"../preload-modules-0iyuP4Vs.mjs";import{r as c}from"../react-helpers-duOBWuYF.mjs";import{a as l,n as u,r as d}from"../rari-global-5vGzhToD.mjs";import{createElement as f}from"react";import{createFromFetch as p,createFromReadableStream as m}from"virtual:react-flight-client";import{createRoot as h,hydrateRoot as g}from"react-dom/client";import{AppRouterProvider as _}from"virtual:app-router-provider";import{ClientRouter as v}from"virtual:client-router";import"virtual:rsc-integration.ts";function y(e,t){if(e.querySelector(`.rari-error[data-rari-hydration-failure]`))return;let n=document.createElement(`div`);n.className=`rari-error`,n.setAttribute(`data-rari-hydration-failure`,`true`),n.setAttribute(`role`,`alert`),n.style.cssText=`color:red;border:1px solid red;padding:10px;border-radius:4px;background-color:#fff5f5;margin:10px 0;`;let r=document.createElement(`strong`);r.textContent=`Failed to load page: `,n.append(r,document.createTextNode(t)),e.prepend(n)}function b(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT);for(;t.nextNode();){let e=t.currentNode;if(e.nodeType===8&&`data`in e){let t=e.data;if(t===`$`||t===`$?`||t===`/$`)return!0}}return!!(e.querySelector(`[data-reactroot]`)||e.querySelectorAll(`template[data-rri]`).length>0)}function x(e){let t=e.tagName;if(t===`SCRIPT`||t===`STYLE`||t===`LINK`||t===`META`||t===`NOSCRIPT`)return!0;let n=typeof e.getAttribute==`function`?e.getAttribute.bind(e):null;return n==null?!1:n(`data-rari-nav-transition`)!=null||n(`aria-hidden`)===`true`}function S(e){let t=e.firstElementChild;for(;t!=null&&x(t);)t=t.nextElementSibling;return t}function C(e){if(b(e))return!0;let t=S(e);return t!==null&&!t.classList.contains(`rari-error`)}function w(e){return b(e)}function T(e){e.querySelectorAll(`.rari-error:not([data-rari-hydration-failure])`).forEach(e=>{e.remove()})}async function E(e){let t=o(e);for(let e=0;e<10&&i(t);e+=1)t=o(await t);if(i(t))throw Error(`[rari] Failed to resolve Flight element to a React node`);return t}function D(t){if(!c(t))return y(document.body,`RSC payload did not resolve to an <html> document root. Try refreshing the page.`),console.error(`[rari] Hydration skipped: Flight content is not a document root`),!1;let n=f(_,{initialPayload:{element:t}});return n=f(v,{initialRoute:window.location.pathname},n),n=f(e,{initialPathname:window.location.pathname},n),A(n),!0}function O(){Reflect.set(globalThis,`__rari_client_ready`,!0),window.dispatchEvent(new CustomEvent(`rari:client-ready`))}function k(e){if(e===``)return;let t=()=>{document.title.trim()===``&&(document.title=e)};t(),queueMicrotask(t),requestAnimationFrame(()=>{t(),requestAnimationFrame(t)})}function A(e){let t=document.documentElement,n=document.title.trim();w(t)?(T(t),g(document,e,{onRecoverableError(e){import.meta.env.DEV&&console.warn(`[rari] Hydration mismatch:`,e)}})):h(document).render(e),k(n),O()}
|
|
2
2
|
/*! @preserve CLIENT_COMPONENT_IMPORTS_PLACEHOLDER */
|
|
3
|
-
|
|
3
|
+
d(),u();
|
|
4
4
|
/*! @preserve CLIENT_COMPONENT_REGISTRATIONS_PLACEHOLDER */
|
|
5
|
-
function j(){let e=Reflect.get(globalThis,`__rari_f`);if(Array.isArray(e))return e}function M(
|
|
5
|
+
function j(){let e=Reflect.get(globalThis,`__rari_f`);if(Array.isArray(e))return e}function M(e){return t(e)&&typeof e.rscRow==`string`}function N(e){return Array.isArray(e)&&typeof e[1]==`string`}function P(){return!!j()?.some(e=>e!==0)}function F(){let e=j();if(e?.length==null||e.length===0)return null;let t=``,n=[];for(let r of e)r!==0&&(typeof r==`string`?t+=r:N(r)&&n.push(r[1]));if(n.length>0){let e=n.map(e=>Uint8Array.from(atob(e),e=>e.charCodeAt(0))),t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return r}return t?new TextEncoder().encode(t):null}async function I(e,t){let r=new TextDecoder().decode(e);await s(r);let i=l(),a=i.streaming,o=!!(a?.bufferedRows&&a.bufferedRows.length>0);if(t.streaming&&(a?.complete===void 0||o)){let t=new ReadableStream({start(t){let r=!1;t.enqueue(e);let a=e=>{if(r)return;let i=n(e,M);i&&t.enqueue(new TextEncoder().encode(`\n${i.rscRow}`))},o=()=>{r||(r=!0,t.close(),window.removeEventListener(`rari:html-stream-row`,a),window.removeEventListener(`rari:stream-complete`,o))};if(window.addEventListener(`rari:html-stream-row`,a),window.addEventListener(`rari:stream-complete`,o),i.streaming?.bufferedRows){let e=[...i.streaming.bufferedRows];for(let n of e)t.enqueue(new TextEncoder().encode(`\n${n}`));i.streaming.bufferedRows=[]}i.streaming?.complete&&o()}});return m(t)}let c=new ReadableStream({start(t){t.enqueue(e),t.close()}});return m(c)}async function L(e){let t=`Could not load interactive page data.`,n;try{n=await I(e,{streaming:!1})}catch(e){t=a(e,`Failed to parse embedded RSC payload.`);try{let e=window.location.pathname+window.location.search,r=await fetch(e,{headers:{Accept:`text/x-component`},cache:`no-store`});r.ok?n=await p(Promise.resolve(r)):t=`Failed to fetch RSC payload fallback: HTTP ${r.status}.`}catch(e){t=a(e,`Failed to fetch RSC payload fallback.`),console.error(`[rari] Failed to fetch RSC payload fallback:`,e)}}return n==null?(y(document.body,`${t} Try refreshing the page.`),console.error(`[rari] Hydration skipped: failed to load RSC payload`),{ok:!1,errorMessage:t}):(D(await E(n)),{ok:!0,errorMessage:t})}async function R(){try{let e=window.location.pathname+window.location.search,t=await fetch(e,{headers:{Accept:`text/x-component`},cache:`no-store`});if(!t.ok&&t.status!==404)throw Error(`Failed to fetch RSC data: ${t.status}`);if(!t.body)throw Error(`RSC response has no body`);return await p(Promise.resolve(t))}catch(e){if(e instanceof Promise)throw e;return console.error(`[rari] Failed to fetch initial RSC data:`,e),null}}function z(){return new ReadableStream({start(e){let t=t=>{let r=n(t,M);r&&e.enqueue(new TextEncoder().encode(`${r.rscRow}\n`))},r=()=>{e.close(),window.removeEventListener(`rari:html-stream-row`,t),window.removeEventListener(`rari:stream-complete`,r)};window.addEventListener(`rari:html-stream-row`,t),window.addEventListener(`rari:stream-complete`,r);let i=l();if(i.streaming?.bufferedRows){let t=[...i.streaming.bufferedRows];i.streaming.bufferedRows=[];for(let n of t)e.enqueue(new TextEncoder().encode(`${n}\n`))}i.streaming?.complete&&r()}})}async function B(){try{return await m(z())}catch(e){return console.error(`[rari] Failed to process streaming RSC payload:`,e),null}}async function V(e){try{return await I(e,{streaming:!0})}catch(e){return console.error(`[rari] Failed to parse embedded RSC payload:`,e),console.error(`[rari] Error stack:`,r(e)?.stack??`no stack`),null}}async function H(){let e=P(),t=F(),n=document.documentElement,r=C(document.body)||b(n),i=l().streaming,a=!!(i?.bufferedRows&&i.bufferedRows.length>0);try{if(r&&e&&t){await L(t);return}let n=!e&&!a&&!r,i;if(n?i=await R():e&&t?i=await V(t):a&&(i=await B()),i==null)throw Error(`No RSC data available for hydration`);D(await E(i))}catch(e){console.error(`[rari] Error rendering app:`,e)}}function U(){let e=import.meta.hot;if(!e)return{};let n=e.data;return t(n)?{hasRendered:n.hasRendered===!0}:{}}function W(){let e=import.meta.hot;if(!e)return;let n=e.data;t(n)&&(n.hasRendered=!0)}import.meta.hot&&U().hasRendered===!0||(H().catch(e=>{console.error(`[rari] Fatal error:`,e)}),W());export{H as renderApp};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { t as FlightContent } from "../react-helpers-
|
|
1
|
+
import { t as FlightContent } from "../react-helpers-CZtKqfS6.mjs";
|
|
2
2
|
import { ReactElement, ReactNode } from "react";
|
|
3
|
-
//#region src/runtime/flight/merge-refresh.d.ts
|
|
4
3
|
export declare function isLayoutReuseMarker(element: ReactElement): boolean;
|
|
5
4
|
export declare function layoutPathOf(element: ReactElement): string | undefined;
|
|
6
5
|
export declare function setChildrenAtLayoutPath(document: ReactElement, layoutPath: string, nextChildren: ReactNode): ReactElement | null;
|
|
7
6
|
export declare function unwrapFulfilledFlightNode(node: FlightContent): ReactNode;
|
|
8
|
-
export declare function mergeFlightRefresh(current: ReactNode, refresh: ReactNode): ReactNode;
|
|
9
|
-
//#endregion
|
|
7
|
+
export declare function mergeFlightRefresh(current: ReactNode, refresh: ReactNode): ReactNode;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import "../types-
|
|
2
|
-
//#region src/runtime/shared/get-client-component.d.ts
|
|
1
|
+
import "../types-Cw2SI7r7.mjs";
|
|
3
2
|
declare function requireClientComponent(id: string): any;
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/runtime/rsc/client-runtime.d.ts
|
|
6
3
|
declare global {
|
|
7
4
|
var __rari_rsc_require__: typeof requireClientComponent | undefined;
|
|
8
5
|
}
|
|
9
|
-
//#endregion
|
|
10
6
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"../type-guards-BLY2PlGR.mjs";import{
|
|
1
|
+
import{g as e}from"../type-guards-BLY2PlGR.mjs";import{n as t,r as n}from"../get-client-component-DVAbynLr.mjs";import{a as r,i,n as a,r as o,t as s}from"../rari-global-5vGzhToD.mjs";if(i().isDevelopment=process.env.NODE_ENV!==`production`,o(),s(),a(),typeof window<`u`&&(t(),Reflect.set(globalThis,`__rari_rsc_require__`,n)),typeof window<`u`){let e=r();e.streaming??={bufferedRows:[]}}if(import.meta.hot){function t(e){if(!e)return!1;try{return i().serverComponents?.has(e)===!0}catch{return!1}}let n=!1,r=[],a=/* @__PURE__ */ new Map;function o(e,t,i){a.set(e,async e=>{i(e)&&await t(e)}),import.meta.hot.on(e,t=>{(async()=>{if(!n)r.push({event:e,data:t});else try{let n=a.get(e);n&&await n(t)}catch(t){console.error(`[rari] HMR: Error in handler for '${e}':`,t)}})()})}function s(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}function c(t){return e(t)&&Array.isArray(t.serverComponents)}function l(t){return e(t)&&typeof t.path==`string`&&t.path!==``}function u(t){return e(t)}function d(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}function f(t){return e(t)&&typeof t.filePath==`string`&&t.filePath!==``}o(`rari:register-server-component`,e=>{let t=i();t.serverComponents??=/* @__PURE__ */ new Set,t.serverComponents.add(e.filePath)},s),o(`rari:server-components-registry`,e=>{let t=i();t.serverComponents??=/* @__PURE__ */ new Set;for(let n of e.serverComponents)t.serverComponents.add(n)},c),o(`vite:beforeFullReload`,e=>{t(e.path)&&window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.path}}))},l),o(`rari:server-component-updated`,e=>{let n=e.id!=null&&e.id!==``?e.id:e.componentId,r=e.t!=null&&e.t!==0?e.t:e.timestamp;n!=null&&n!==``?window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{componentId:n,filePath:e.filePath!=null&&e.filePath!==``?e.filePath:e.file,type:`server-component`,timestamp:r}})):e.path!=null&&e.path!==``&&t(e.path)&&window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.path}}))},u);function p(e){if(e.title!=null&&e.title!==``&&(document.title=e.title),e.description==null||e.description===``)return;let t=document.querySelector(`meta[name="description"]`);t||(t=document.createElement(`meta`),t.setAttribute(`name`,`description`),document.head.appendChild(t)),t.setAttribute(`content`,e.description)}function m(t){let n=e(t)&&t.success===!0,r=e(t)&&t.reloaded===!0,i=e(t)&&t.content_unchanged===!0,a=e(t)&&typeof t.error==`string`?t.error:`Component reload unsuccessful`;return{ok:n||r,contentUnchanged:i,errorMessage:a}}async function h(e){if(e.routePath!=null&&e.routePath!==``||e.affectedRoutes!=null&&e.affectedRoutes.length!==0)try{let t=await fetch(`/_rari/hmr`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`register`,file_path:e.filePath})});if(!t.ok)throw Error(`Component reload failed: ${t.status}`);let n=m(await t.json());if(!n.ok)throw Error(n.errorMessage);if(n.contentUnchanged)return;await fetch(`/_rari/hmr`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`invalidate`,componentId:e.routePath!=null&&e.routePath!==``?e.routePath:e.filePath,filePath:e.filePath})}),e.metadataChanged&&e.metadata&&p(e.metadata),window.dispatchEvent(new CustomEvent(`rari:app-router-rerender`,{detail:{routePath:e.routePath,affectedRoutes:e.affectedRoutes??(e.routePath==null?[]:[e.routePath]),currentPath:window.location.pathname,preserveParams:!0}}))}catch(e){console.error(`[rari] HMR: App router update failed:`,e)}}o(`rari:app-router-updated`,h,d),o(`rari:server-action-updated`,e=>{window.dispatchEvent(new CustomEvent(`rari:rsc-invalidate`,{detail:{filePath:e.filePath,type:`server-action`}}))},f),r.length>0?(async()=>{try{let e=[...r];r.length=0;for(let{event:t,data:n}of e){let e=a.get(t);e&&await e(n)}}catch(e){console.error(`[rari] HMR: Error during event replay:`,e)}finally{n=!0}})():n=!0}export{};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { createClientModuleProxy as createClientModuleProxy$1, registerServerReference } from "react-server-dom-webpack/server";
|
|
2
|
-
//#region src/runtime/rsc/references.d.ts
|
|
3
2
|
export declare const createClientModuleProxy: typeof createClientModuleProxy$1;
|
|
4
3
|
export declare function registerClientReference<T>(clientReference: T, id: string, exportName: string): T;
|
|
5
|
-
//#endregion
|
|
6
4
|
export { registerServerReference };
|
|
@@ -6,7 +6,7 @@ import{g as e}from"./type-guards-BLY2PlGR.mjs";import{t}from"./xml-DPsk9WTz.mjs"
|
|
|
6
6
|
`)}function v(e){let t=e.some(e=>e.images&&e.images.length>0),n=e.some(e=>e.videos&&e.videos.length>0),r=e.some(e=>e.alternates?.languages),i=[`xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"`];return t&&i.push(`xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"`),n&&i.push(`xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"`),r&&i.push(`xmlns:xhtml="http://www.w3.org/1999/xhtml"`),i}function y(e,n){e.push(` <url>`),e.push(` <loc>${t(n.url)}</loc>`),n.lastModified!=null&&e.push(` <lastmod>${c(n.lastModified)}</lastmod>`),n.changeFrequency&&e.push(` <changefreq>${n.changeFrequency}</changefreq>`),n.priority!==void 0&&e.push(` <priority>${n.priority}</priority>`)}function b(e,n){if(n.alternates?.languages)for(let[r,i]of Object.entries(n.alternates.languages))e.push(` <xhtml:link rel="alternate" hreflang="${t(r)}" href="${t(i)}" />`)}function x(e,t){t.images&&t.images.length>0&&e.push(d(t.images)),t.videos&&t.videos.length>0&&e.push(_(t.videos))}function S(e){let t=[`<?xml version="1.0" encoding="UTF-8"?>`,`<urlset ${v(e).join(` `)}>`];for(let n of e)y(t,n),b(t,n),x(t,n),t.push(` </url>`);return t.push(`</urlset>`),t.join(`
|
|
7
7
|
`)}
|
|
8
8
|
/* v8 ignore start - file system operations, better tested in integration/e2e */
|
|
9
|
-
async function C(e,t=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.json`]){let r=await n({appDir:e,staticFileName:`sitemap.xml`,dynamicBaseName:`sitemap`,extensions:t});return r?[r]:[]}function w(e){return typeof e==`function`||Array.isArray(e)}function T(t){return e(t)?w(t.default):!1}async function E(e,t,n={},r){let a=await i({virtualId:`\0virtual:sitemap`,sourcePath:e.path,sourceCode:t,aliases:n,projectRoot:r,kind:`sitemap`,pluginName:`virtual-sitemap`,label:`sitemap`});if(!T(a))throw Error(`Sitemap module must export a default sitemap array or sitemap generator function`);return a}async function D(e,t){let n=await e.generateSitemaps(),r=o.join(t,`sitemap`);await a.mkdir(r,{recursive:!0});let i=/* @__PURE__ */ new Map;for(let{id:t}of n)try{let n=t.replace(s,`_`);
|
|
9
|
+
async function C(e,t=[`.ts`,`.tsx`,`.js`,`.jsx`,`.mjs`,`.json`]){let r=await n({appDir:e,staticFileName:`sitemap.xml`,dynamicBaseName:`sitemap`,extensions:t});return r?[r]:[]}function w(e){return typeof e==`function`||Array.isArray(e)}function T(t){return e(t)?w(t.default):!1}async function E(e,t,n={},r){let a=await i({virtualId:`\0virtual:sitemap`,sourcePath:e.path,sourceCode:t,aliases:n,projectRoot:r,kind:`sitemap`,pluginName:`virtual-sitemap`,label:`sitemap`});if(!T(a))throw Error(`Sitemap module must export a default sitemap array or sitemap generator function`);return a}async function D(e,t){let n=await e.generateSitemaps(),r=o.join(t,`sitemap`);await a.mkdir(r,{recursive:!0});let i=/* @__PURE__ */ new Map;for(let{id:t}of n)try{let n=t.replace(s,`_`);n&&n.length!==0||(n=`_`);let c=i.get(n);if(c!==void 0)throw Error(`Duplicate sanitized sitemap ID "${n}": original IDs "${c}" and "${t}" collide`);i.set(n,t);let l=typeof e.default==`function`?await e.default({id:t}):e.default;if(!Array.isArray(l))throw TypeError(`Sitemap default export must resolve to a sitemap entry array`);let u=S(l),d=o.join(r,`${n}.xml`);await a.writeFile(d,u)}catch(e){throw Error(`Failed to generate sitemap for id "${t}"`,{cause:e})}}async function O(e,t){let n=typeof e.default==`function`?await e.default():e.default;if(!Array.isArray(n))throw TypeError(`Sitemap default export must resolve to a sitemap entry array`);let r=S(n),i=o.join(t,`sitemap.xml`);await a.writeFile(i,r)}
|
|
10
10
|
/* v8 ignore start - file system operations and dynamic imports, better tested in integration/e2e */
|
|
11
11
|
async function k(e){let{appDir:t,extensions:n,outDir:i,aliases:s={}}=e,c=await C(t,n);if(c.length===0)return!1;await a.mkdir(i,{recursive:!0});let l=c[0];if(l.type===`static`){let e=o.join(i,`sitemap.xml`);return await a.copyFile(l.path,e),!0}try{let e=await E(l,await a.readFile(l.path,`utf-8`),s,r(t));return typeof e.generateSitemaps==`function`?await D(e,i):await O(e,i),!0}catch(e){return console.error(`[rari] Failed to build/execute sitemap file:`,e),!1}}
|
|
12
12
|
/* v8 ignore stop */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, SyntheticEvent } from "react";
|
|
2
2
|
import "virtual:rari-image-config";
|
|
3
|
-
//#region src/image/image.d.ts
|
|
4
3
|
interface ImageProps {
|
|
5
4
|
readonly src: string | StaticImageData;
|
|
6
5
|
readonly alt: string;
|
|
@@ -33,8 +32,6 @@ interface StaticImageData {
|
|
|
33
32
|
readonly blurDataURL?: string;
|
|
34
33
|
}
|
|
35
34
|
declare function Image({ src, alt, width, height, quality, preload, loading, placeholder, blurDataURL, fill, sizes, style, className, onLoad, onError, unoptimized, loader, overrideSrc, decoding }: ImageProps): import("react").JSX.Element;
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/image/static-modules.d.ts
|
|
38
35
|
declare module '*.avif' {
|
|
39
36
|
const image: StaticImageData;
|
|
40
37
|
export default image;
|
|
@@ -59,5 +56,4 @@ declare module '*.webp' {
|
|
|
59
56
|
const image: StaticImageData;
|
|
60
57
|
export default image;
|
|
61
58
|
}
|
|
62
|
-
//#endregion
|
|
63
59
|
export { ImageProps as n, StaticImageData as r, Image as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/proxy/http/response.d.ts
|
|
2
1
|
declare class RariResponse extends Response {
|
|
3
2
|
readonly cookies: ResponseCookies;
|
|
4
3
|
constructor(body?: BodyInit | null, init?: ResponseInit);
|
|
@@ -13,8 +12,6 @@ declare class RariResponse extends Response {
|
|
|
13
12
|
static rewrite(destination: string | URL): RariResponse;
|
|
14
13
|
static json(data: unknown, init?: ResponseInit): RariResponse;
|
|
15
14
|
}
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/proxy/http/types.d.ts
|
|
18
15
|
interface RariRequest {
|
|
19
16
|
readonly url: string;
|
|
20
17
|
readonly method: string;
|
|
@@ -126,5 +123,4 @@ interface ProxyResult {
|
|
|
126
123
|
readonly permanent: boolean;
|
|
127
124
|
};
|
|
128
125
|
}
|
|
129
|
-
//#endregion
|
|
130
126
|
export { ProxyModule as a, RariURL as c, RariResponse as d, ProxyMatcher as i, RequestCookies as l, ProxyConfig as n, ProxyResult as o, ProxyFunction as r, RariFetchEvent as s, CookieOptions as t, ResponseCookies as u };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/shared/types.d.ts
|
|
2
1
|
interface CookieOptions {
|
|
3
2
|
readonly path?: string;
|
|
4
3
|
readonly domain?: string;
|
|
@@ -113,5 +112,4 @@ declare global {
|
|
|
113
112
|
'~clientComponentNames'?: GlobalWithRari['~clientComponentNames'];
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
|
-
//#endregion
|
|
117
115
|
export { ReadonlyHeaders as i, CookieStore as n, ReadonlyCookie as r, CookieOptions as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="vite-plus/client" />
|
|
2
2
|
import { ReactNode as ReactNode$1 } from "react";
|
|
3
|
-
//#region src/ambient.d.ts
|
|
4
3
|
declare module 'virtual:react-flight-client' {
|
|
5
4
|
import type { ReactPromise } from 'react';
|
|
6
5
|
export type Thenable<T> = ReactPromise<T> & Promise<T>;
|
|
@@ -84,8 +83,6 @@ declare global {
|
|
|
84
83
|
}>;
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/router/build/api-routes.d.ts
|
|
89
86
|
interface RouteContext<TParams extends Record<string, string> = Record<string, string>> {
|
|
90
87
|
readonly params: TParams;
|
|
91
88
|
}
|
|
@@ -104,8 +101,6 @@ declare class ApiResponse extends Response {
|
|
|
104
101
|
static redirect(url: string, status?: number): Response;
|
|
105
102
|
static noContent(init?: ResponseInit): Response;
|
|
106
103
|
}
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region src/router/metadata/app-icons.d.ts
|
|
109
104
|
type AppIconKind = 'favicon' | 'icon' | 'apple-icon';
|
|
110
105
|
interface AppIconEntry {
|
|
111
106
|
readonly path: string;
|
|
@@ -117,8 +112,6 @@ interface AppIconEntry {
|
|
|
117
112
|
readonly width?: number;
|
|
118
113
|
readonly height?: number;
|
|
119
114
|
}
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/router/build/types.d.ts
|
|
122
115
|
type RouteSegmentType = 'static' | 'dynamic' | 'catch-all' | 'optional-catch-all';
|
|
123
116
|
interface RouteSegment {
|
|
124
117
|
type: RouteSegmentType;
|
|
@@ -338,8 +331,6 @@ type GenerateMetadata<TParams extends RouteParams = RouteParams, TSearchParams e
|
|
|
338
331
|
searchParams: TSearchParams;
|
|
339
332
|
}>) => RouteMetadata | Promise<RouteMetadata>;
|
|
340
333
|
type GenerateStaticParams<TParams extends RouteParams = RouteParams> = () => TParams[] | Promise<TParams[]>;
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region src/router/metadata/types.d.ts
|
|
343
334
|
interface RobotsRule {
|
|
344
335
|
readonly userAgent?: string | readonly string[];
|
|
345
336
|
readonly allow?: string | readonly string[];
|
|
@@ -436,5 +427,4 @@ interface Feed {
|
|
|
436
427
|
};
|
|
437
428
|
readonly items: readonly FeedEntry[];
|
|
438
429
|
}
|
|
439
|
-
//#endregion
|
|
440
430
|
export { RouteSegmentType as C, RouteContext as D, ApiRouteHandlers as E, RouteHandler as O, RouteSegment as S, ApiResponse as T, LayoutProps as _, Sitemap as a, NotFoundEntry as b, SitemapVideo as c, AppRouteMatch as d, ErrorEntry as f, LayoutEntry as g, GenerateStaticParams as h, RobotsRule as i, AppRouteEntry as l, GenerateMetadata as m, FeedEntry as n, SitemapEntry as o, ErrorProps as p, Robots as r, SitemapImage as s, Feed as t, AppRouteManifest as u, LoadingEntry as v, TemplateEntry as w, PageProps as x, Metadata as y };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/font/types.d.ts
|
|
2
1
|
type FontDisplay = 'auto' | 'block' | 'swap' | 'fallback' | 'optional';
|
|
3
2
|
type LocalFontSrc = string | ReadonlyArray<{
|
|
4
3
|
readonly path: string;
|
|
@@ -39,5 +38,4 @@ interface Font {
|
|
|
39
38
|
};
|
|
40
39
|
readonly variable?: string;
|
|
41
40
|
}
|
|
42
|
-
//#endregion
|
|
43
41
|
export { LocalFontSrc as a, LocalFontOptions as i, FontDisplay as n, GoogleFontOptions as r, Font as t };
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { C as RouteSegmentType, D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, S as RouteSegment, T as ApiResponse, _ as LayoutProps, a as Sitemap, b as NotFoundEntry, c as SitemapVideo, d as AppRouteMatch, f as ErrorEntry, g as LayoutEntry, h as GenerateStaticParams, i as RobotsRule, l as AppRouteEntry, m as GenerateMetadata, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, u as AppRouteManifest, v as LoadingEntry, w as TemplateEntry, x as PageProps, y as Metadata } from "./types-
|
|
2
|
-
import { a as ProxyModule, c as RariURL, i as ProxyMatcher, l as RequestCookies, n as ProxyConfig, o as ProxyResult, r as ProxyFunction, s as RariFetchEvent, t as CookieOptions, u as ResponseCookies } from "./types-
|
|
1
|
+
import { C as RouteSegmentType, D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, S as RouteSegment, T as ApiResponse, _ as LayoutProps, a as Sitemap, b as NotFoundEntry, c as SitemapVideo, d as AppRouteMatch, f as ErrorEntry, g as LayoutEntry, h as GenerateStaticParams, i as RobotsRule, l as AppRouteEntry, m as GenerateMetadata, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, u as AppRouteManifest, v as LoadingEntry, w as TemplateEntry, x as PageProps, y as Metadata } from "./types-DNk27dqJ.mjs";
|
|
2
|
+
import { a as ProxyModule, c as RariURL, i as ProxyMatcher, l as RequestCookies, n as ProxyConfig, o as ProxyResult, r as ProxyFunction, s as RariFetchEvent, t as CookieOptions, u as ResponseCookies } from "./types-CSDt4P_t.mjs";
|
|
3
3
|
import { UserConfig } from "vite-plus";
|
|
4
4
|
import { ReactCompilerOptions as ReactCompilerOptions$1 } from "oxc-transform-react";
|
|
5
|
-
//#region src/vite/analysis/directives.d.ts
|
|
6
5
|
interface DirectiveResult {
|
|
7
6
|
readonly hasUseClient: boolean;
|
|
8
7
|
readonly hasUseServer: boolean;
|
|
@@ -15,8 +14,6 @@ interface ModuleAnalysis {
|
|
|
15
14
|
readonly hasComponentExport: boolean;
|
|
16
15
|
readonly importSources: readonly string[];
|
|
17
16
|
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/vite/analysis/module-cache.d.ts
|
|
20
17
|
declare class ModuleAnalysisCache {
|
|
21
18
|
private readonly cache;
|
|
22
19
|
get(filePath: string, source?: string): ModuleAnalysis;
|
|
@@ -25,14 +22,10 @@ declare class ModuleAnalysisCache {
|
|
|
25
22
|
clear(): void;
|
|
26
23
|
private readMtimeMs;
|
|
27
24
|
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/vite/mdx/registry.d.ts
|
|
30
25
|
interface MdxPluginOptions {
|
|
31
26
|
readonly componentsDir?: string;
|
|
32
27
|
readonly contentDirs?: readonly string[];
|
|
33
28
|
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/vite/plugin/types.d.ts
|
|
36
29
|
/**
|
|
37
30
|
* Public plugin shape returned by rari helpers.
|
|
38
31
|
*
|
|
@@ -44,8 +37,6 @@ interface RariPlugin {
|
|
|
44
37
|
name: string;
|
|
45
38
|
enforce?: 'pre' | 'post';
|
|
46
39
|
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/vite/server/config.d.ts
|
|
49
40
|
interface ServerCSPConfig {
|
|
50
41
|
readonly scriptSrc?: readonly string[];
|
|
51
42
|
readonly styleSrc?: readonly string[];
|
|
@@ -92,8 +83,6 @@ interface ServerConfig {
|
|
|
92
83
|
origin?: string;
|
|
93
84
|
htmlLimitedBots?: string;
|
|
94
85
|
}
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/vite/server/build.d.ts
|
|
97
86
|
interface ServerBuildOptions {
|
|
98
87
|
readonly outDir?: string;
|
|
99
88
|
readonly clientOutDir?: string;
|
|
@@ -118,12 +107,8 @@ interface ServerBuildOptions {
|
|
|
118
107
|
};
|
|
119
108
|
readonly mdx?: MdxPluginOptions;
|
|
120
109
|
}
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region src/vite/transform/react-compiler.d.ts
|
|
123
110
|
type ReactCompilerOptions = ReactCompilerOptions$1;
|
|
124
111
|
type RariCompilerOption = boolean | ReactCompilerOptions;
|
|
125
|
-
//#endregion
|
|
126
|
-
//#region src/proxy/build/vite-plugin.d.ts
|
|
127
112
|
interface ProxyPluginOptions {
|
|
128
113
|
readonly root?: string;
|
|
129
114
|
readonly srcDir?: string;
|
|
@@ -132,8 +117,6 @@ interface ProxyPluginOptions {
|
|
|
132
117
|
readonly verbose?: boolean;
|
|
133
118
|
}
|
|
134
119
|
export declare function rariProxy(options?: ProxyPluginOptions): RariPlugin;
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/router/build/props-extractor.d.ts
|
|
137
120
|
interface ServerSidePropsResult {
|
|
138
121
|
props: Record<string, any>;
|
|
139
122
|
revalidate?: number;
|
|
@@ -251,24 +234,18 @@ export declare function extractServerPropsWithCache(componentPath: string, param
|
|
|
251
234
|
}>, cacheTime?: number): Promise<ServerSidePropsResult>;
|
|
252
235
|
export declare function clearPropsCache(): void;
|
|
253
236
|
export declare function clearPropsCacheForComponent(componentPath: string): void;
|
|
254
|
-
//#endregion
|
|
255
|
-
//#region src/router/build/routes.d.ts
|
|
256
237
|
interface AppRouteGeneratorOptions {
|
|
257
238
|
readonly appDir: string;
|
|
258
239
|
readonly extensions?: readonly string[];
|
|
259
240
|
readonly verbose?: boolean;
|
|
260
241
|
}
|
|
261
242
|
export declare function generateAppRouteManifest(appDir: string, options?: Readonly<Partial<AppRouteGeneratorOptions>>): Promise<AppRouteManifest>;
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region src/router/build/vite-plugin.d.ts
|
|
264
243
|
interface RariRouterPluginOptions {
|
|
265
244
|
readonly appDir?: string;
|
|
266
245
|
readonly extensions?: readonly string[];
|
|
267
246
|
readonly outDir?: string;
|
|
268
247
|
}
|
|
269
248
|
export declare function rariRouter(options?: RariRouterPluginOptions): RariPlugin;
|
|
270
|
-
//#endregion
|
|
271
|
-
//#region src/vite/index.d.ts
|
|
272
249
|
export interface RouterPluginOptions {
|
|
273
250
|
readonly appDir?: string;
|
|
274
251
|
readonly extensions?: readonly string[];
|
|
@@ -337,5 +314,4 @@ export declare function defineRariConfig(config: UserConfig & {
|
|
|
337
314
|
}): UserConfig;
|
|
338
315
|
export type Request = globalThis.Request;
|
|
339
316
|
export type Response = globalThis.Response;
|
|
340
|
-
//#endregion
|
|
341
317
|
export { ApiResponse, type ApiRouteHandlers, type AppRouteEntry, type AppRouteManifest, type AppRouteMatch, type CookieOptions, type ErrorEntry, type ErrorProps, type GenerateMetadata, type GenerateStaticParams, type LayoutEntry, type LayoutProps, type LoadingEntry, type Metadata, type MetadataResult, type NotFoundEntry, type PageProps, type ProxyConfig, type ProxyFunction, type ProxyMatcher, type ProxyModule, type ProxyPluginOptions, type ProxyResult, type RariCompilerOption, type RariFetchEvent, type RariPlugin, type RariURL, type ReactCompilerOptions, type RequestCookies, type ResponseCookies, type Robots, type RobotsRule, type RouteContext, type RouteHandler, type RouteSegment, type RouteSegmentType, type ServerActionConfig, type ServerCSPConfig, type ServerCacheConfig, type ServerCacheControlConfig, type ServerCacheLayerConfig, type ServerConfig, type ServerSidePropsResult, type ServerUseCacheConfig, type Sitemap, type SitemapEntry, type SitemapImage, type SitemapVideo, type StaticParamsResult, type TemplateEntry };
|