rari 0.17.1 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/runtime/AppRouterProvider.mjs +1 -1
- package/dist/runtime/merge-flight-refresh.d.mts +1 -0
- package/dist/runtime/merge-flight-refresh.mjs +1 -1
- package/dist/{types-DfSnnFaF.d.mts → types-CkJ_86mo.d.mts} +9 -9
- package/dist/vite.d.mts +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, T as ApiResponse, _ as LayoutProps, a as Sitemap, c as SitemapVideo, i as RobotsRule, n as FeedEntry, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, t as Feed, x as PageProps, y as Metadata } from "./types-
|
|
1
|
+
import { D as RouteContext, E as ApiRouteHandlers, O as RouteHandler, T as ApiResponse, _ as LayoutProps, a as Sitemap, c as SitemapVideo, i as RobotsRule, n as FeedEntry, o as SitemapEntry, p as ErrorProps, r as Robots, s as SitemapImage, t as Feed, x as PageProps, y as Metadata } from "./types-CkJ_86mo.mjs";
|
|
2
2
|
import { c as RariURL, d as RariResponse, n as ProxyConfig, r as ProxyFunction, s as RariFetchEvent } from "./types-DAdRjhuk.mjs";
|
|
3
3
|
import { RariRequest } from "./proxy/RariRequest.mjs";
|
|
4
4
|
//#region src/navigation/not-found.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,i as t,p as n,r,v as i,w as a}from"../type-guards-BJXKlA6x.mjs";import{r as o}from"../navigation-transition-store-CSKrbtbK.mjs";import"./action-revalidation-kind.mjs";import{isLayoutReuseMarker as s,mergeFlightRefresh as c}from"./merge-flight-refresh.mjs";import{currentRouteLocation as l,flightRouteCache as u}from"./flight-route-cache.mjs";import{n as d,t as f}from"../preload-modules-Dv_GzGCm.mjs";import{n as p,r as m}from"../form-state-DAygOjc8.mjs";import{c as h}from"react/compiler-runtime";import*as g from"react";import{addTransitionType as _,startTransition as v,useEffect as y,useLayoutEffect as b,useRef as x,useState as S,useTransition as ee}from"react";import{Fragment as te,jsx as C,jsxs as w}from"react/jsx-runtime";import{createFromFetch as ne,createFromReadableStream as re}from"virtual:react-flight-client";const T={position:`fixed`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,padding:`24px`,background:`rgba(220, 38, 38, 0.95)`,color:`white`,borderRadius:`8px`,fontSize:`14px`,zIndex:1e4,maxWidth:`500px`,boxShadow:`0 4px 6px rgba(0, 0, 0, 0.3)`},E={padding:`8px 16px`,background:`white`,color:`#dc2626`,border:`none`,borderRadius:`4px`,cursor:`pointer`,fontWeight:`bold`,fontSize:`14px`},D={padding:`8px 16px`,background:`rgba(255, 255, 255, 0.2)`,color:`white`,border:`1px solid rgba(255, 255, 255, 0.3)`,borderRadius:`4px`,cursor:`pointer`,fontSize:`14px`},O={fetch:`Failed to fetch updated content from server.`,parse:`Failed to parse server response.`,stale:`Server returned stale content.`,network:`Network error occurred.`};function k(e){return O[e]}function ie(e){let t=h(27),{failure:n,maxRetries:r,onRefresh:i,onDismiss:a}=e,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ C(`div`,{style:{marginBottom:`16px`,fontWeight:`bold`,fontSize:`16px`},children:`⚠️ HMR Update Failed`}),s={marginBottom:`12px`,opacity:.9},t[0]=o,t[1]=s):(o=t[0],s=t[1]);let c;t[2]===n.type?c=t[3]:(c=k(n.type),t[2]=n.type,t[3]=c);let l;t[4]===c?l=t[5]:(l=/* @__PURE__ */ C(`div`,{style:s,children:c}),t[4]=c,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={marginBottom:`16px`,fontSize:`12px`,opacity:.8,fontFamily:`monospace`},t[6]=u):u=t[6];let d;t[7]===n.details?d=t[8]:(d=/* @__PURE__ */ C(`div`,{style:u,children:n.details}),t[7]=n.details,t[8]=d);let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f={marginBottom:`12px`,fontSize:`12px`,opacity:.7},t[9]=f):f=t[9];let p;t[10]!==n.consecutiveFailures||t[11]!==r?(p=/* @__PURE__ */ w(`div`,{style:f,children:[`Consecutive failures: `,n.consecutiveFailures,` / `,r]}),t[10]=n.consecutiveFailures,t[11]=r,t[12]=p):p=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m={display:`flex`,gap:`8px`},t[13]=m):m=t[13];let g;t[14]===i?g=t[15]:(g=/* @__PURE__ */ C(`button`,{onClick:i,type:`button`,style:E,children:`Refresh Page`}),t[14]=i,t[15]=g);let _;t[16]===a?_=t[17]:(_=/* @__PURE__ */ C(`button`,{onClick:a,type:`button`,style:D,children:`Dismiss`}),t[16]=a,t[17]=_);let v;t[18]!==g||t[19]!==_?(v=/* @__PURE__ */ w(`div`,{style:m,children:[g,_]}),t[18]=g,t[19]=_,t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ C(`div`,{style:{marginTop:`12px`,fontSize:`11px`,opacity:.6},children:`Check the console for detailed error logs.`}),t[21]=y):y=t[21];let b;return t[22]!==v||t[23]!==l||t[24]!==d||t[25]!==p?(b=/* @__PURE__ */ w(`div`,{style:T,children:[o,l,d,p,v,y]}),t[22]=v,t[23]=l,t[24]=d,t[25]=p,t[26]=b):b=t[26],b}function ae(e){return e.historyKey!=null&&e.historyKey!==``?[`nav`,`nav-traverse`]:e.replace===!0?[`nav`,`nav-replace`]:[`nav`,`nav-forward`]}function A(e){e!=null&&typeof window<`u`&&(e.replace===!0?window.history.replaceState(e.state,``,e.url):window.history.pushState(e.state,``,e.url))}function j(e){if(e!=null&&e.url!==``)try{let t=`http://localhost/`;if(typeof window<`u`)try{t=window.location.href}catch{}let n=new URL(e.url,t);o({pathname:n.pathname,search:n.search})}catch{}}function oe(e){let{parsedPayload:t,shouldScrollToTop:n,navigationId:r,transitionTypes:i,pendingHistory:a,startTransition:o=v,currentNavigationIdRef:s,pendingScrollPayloadRef:c,setRenderKey:l,setRscPayload:u,clearHmrError:d,pendingNavigateCommittedIdRef:f}=e;o(()=>{if(s.current===r){if(i!=null)for(let e of i)_(e);A(a),j(a),l(e=>{let r=e+1;return c.current=n?{payload:t,commitKey:r}:null,r}),u(t),d(),f.current=r}})}function se(e,t,n){return e==null||e.commitKey!==n?{shouldScroll:!1,nextPending:null}:t===e.payload?{shouldScroll:!0,nextPending:null}:{shouldScroll:!1,nextPending:e}}const ce=/"timestamp":(\d+)/;function le(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`||g.isValidElement(e)||Array.isArray(e)}function ue(e){return i(e)&&typeof e.from==`string`&&typeof e.to==`string`&&typeof e.navigationId==`number`&&i(e.options)}function de(e){return i(e)&&`element`in e}function fe(e){return i(e)&&typeof e.navigationId==`number`&&typeof e.targetPath==`string`}function pe(e){if(!n(e))return e;if(i(e)&&e.status===`fulfilled`)return le(e.value)?e.value:void 0}function M(e){return g.isValidElement(e)&&(e.type===`html`||e.type===`HTML`)}function N(e){return M(e)||g.isValidElement(e)&&s(e)}function P(e,t){console.error(`[rari] AppRouter: Navigation failed:`,t),window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{from:e.from,to:e.to,error:t,navigationId:e.navigationId}}))}function F(e){return e!=null&&!n(e)&&M(e)?e:null}function me(e){let t=e.pendingHistory?.url,n=t!=null&&t!==``?new URL(t,window.location.origin).hash.length>0:window.location.hash.length>0;return(e.options.historyKey==null||e.options.historyKey===``)&&!n&&e.options.scroll!==!1}async function he(e,t,n,r){let i=await I(e.element);if(r!==n)return{kind:`superseded`};if(!N(i))return{kind:`error`,error:/* @__PURE__ */ Error(`[rari] AppRouter: navigated Flight content did not resolve to an <html> document root`)};let a=F(t);if(g.isValidElement(i)&&s(i)&&a==null)return{kind:`error`,error:/* @__PURE__ */ Error(`[rari] AppRouter: layout-reuse Flight marker requires a previous <html> document`)};let o=a==null?i:c(a,i);return M(o)?{kind:`payload`,payload:{...e,element:o,rawElement:o}}:{kind:`error`,error:/* @__PURE__ */ Error(`[rari] AppRouter: layout-merged Flight content did not resolve to an <html> document root`)}}async function I(e){let t=d(e);for(let e=0;e<10&&n(t);e+=1)t=d(await t);if(n(t))throw Error(`[rari] AppRouter: Flight content did not resolve to a React node`);return t}function L({children:o,initialPayload:s,onNavigate:h}){let[_,v]=S(s),T=x(s),[E,D]=S(0),[,O]=ee(),k=x(O),A=x({x:0,y:0}),j=x(null),N=x(/* @__PURE__ */ new Map),F=x(/* @__PURE__ */ new Set),L=x(h),R=x(0),z=x(0),B=x(null),V=x(null),H=x(/* @__PURE__ */ new Map),U=x([]),W=x(null),G=x(0),[ge,K]=S(null);y(()=>{L.current=h},[h]),y(()=>{k.current=O},[O]),b(()=>{let{shouldScroll:e,nextPending:t}=se(j.current,_,E);j.current=t,e&&window.scrollTo(0,0);let n=V.current;n!=null&&(V.current=null,window.dispatchEvent(new CustomEvent(`rari:navigate-committed`,{detail:{navigationId:n}})))},[_,E]);let _e=e=>{if(e==null||n(e))return;let{pathname:t,search:r}=l();u.set(t,r,e)};y(()=>{T.current=_,_?.element!=null&&_e(_.element)},[_]),y(()=>{if(_?.element!=null){let e=_.element;if(i(e)&&`status`in e&&e.status===`rejected`){let t=e.reason;t!=null&&t!==``&&console.error(`[rari] AppRouter: Flight payload rejected:`,t)}}},[_]);let q=()=>{N.current=p()},ve=()=>{m(N.current)};b(()=>{let e=B.current;e!=null&&_===e&&(B.current=null,window.scrollTo(A.current.x,A.current.y),ve())},[_,E]);let J=(e,t,n,r)=>{G.current+=1;let i={timestamp:Date.now(),error:e,type:t,details:n,filePath:r,consecutiveFailures:G.current};U.current.push(i),U.current.length>10&&U.current.shift(),G.current>=2&&K(i),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`rari:hmr-failure`,{detail:i}))},Y=()=>{setTimeout(()=>{window.location.reload()},1e3)},ye=()=>{G.current>0&&(G.current=0)},be=e=>{if(W.current==null||W.current===``)return!1;if(e===W.current)return!0;let t=ce.exec(e);if(t){let e=Number.parseInt(t[1],10);if(Date.now()-e>5e3)return!0}return!1},xe=e=>{f(e,F.current);let t=new ReadableStream({start(t){t.enqueue(new TextEncoder().encode(e)),t.close()}}),n=re(t);return{element:n,rawElement:n,flightProtocol:e}},Se=async e=>{let t=await e;if(!t.body)throw Error(`Response has no body stream`);let n=t.clone(),r=ne(Promise.resolve(t));return n.text().then(async e=>{await f(e,F.current),e!==``&&(W.current=e)}).catch(()=>{}),{element:r,rawElement:r,flightProtocol:``}},Ce=async(t,n)=>{try{let e=await t.clone().text();if(be(e))return H.current.delete(n),`stale`;await f(e,F.current);let r=await I(ne(Promise.resolve(t)));if(!M(r))throw Error(`[rari] AppRouter: refetched Flight content did not resolve to an <html> document root`);return{element:r,rawElement:r,flightProtocol:e}}catch(t){if(e(t)&&t.name===`AbortError`)throw t;let n=a(t),r=Error(`Failed to parse RSC Flight protocol: ${n.message}`,{cause:n});return J(r,`parse`,r.message,window.location.pathname),r}},we=async(t,n,r)=>{let i=t!=null&&t!==``?t:window.location.pathname,o=R.current,s=r?.commit!==!1,c=`${o}:${i}${window.location.search}:${s?`commit`:`defer`}`,l=H.current.get(c);if(l)return l;let u=(async()=>{try{let e=i+window.location.search,t=await fetch(e,{headers:{Accept:`text/x-component`,"rari-navigation-id":String(R.current)},cache:`no-store`,signal:n});if(!t.ok){let n=/* @__PURE__ */ Error(`Failed to fetch RSC data: ${t.status} ${t.statusText}`);throw J(n,`fetch`,`HTTP ${t.status} when fetching ${e}`,window.location.pathname),n}let r=await Ce(t,c);if(r===`stale`)return;if(r instanceof Error)throw r;return R.current===o&&(s&&v(r),r.flightProtocol!=null&&r.flightProtocol!==``&&(W.current=r.flightProtocol),ye()),H.current.delete(c),r}catch(t){throw H.current.delete(c),e(t)&&t.name!==`AbortError`&&!t.message.includes(`Failed to fetch RSC data`)&&!t.message.includes(`Failed to parse`)&&J(t,`network`,`Network error: ${t.message}`,window.location.pathname),a(t)}})();return H.current.set(c,u),u},Te=x(xe),Ee=x(Se),X=x(we);y(()=>{Te.current=xe,Ee.current=Se,X.current=we}),y(()=>{if(typeof window>`u`)return;let i=async e=>{if(e.rscResponsePromise){let t=await e.rscResponsePromise;if(R.current!==e.navigationId)return;let n=await Ee.current(Promise.resolve(t));return R.current===e.navigationId?n:void 0}if(e.rscResponse){let t=await Ee.current(Promise.resolve(e.rscResponse));return R.current===e.navigationId?t:void 0}if(e.rscFlightProtocol!=null&&e.rscFlightProtocol!==``)return Te.current(e.rscFlightProtocol);if(!e.isStreaming)return X.current(e.to,e.abortSignal,{commit:!1})},o=async(e,t)=>{try{let n=await he(t,T.current?.element,e.navigationId,R.current);return n.kind===`superseded`?null:n.kind===`error`?(P(e,n.error),null):R.current===e.navigationId?n.payload:null}catch(t){return P(e,a(t)),null}},s=(e,t)=>{oe({parsedPayload:t,shouldScrollToTop:me(e),navigationId:e.navigationId,transitionTypes:ae({historyKey:e.options.historyKey,replace:e.options.replace}),pendingHistory:e.pendingHistory,startTransition:k.current,currentNavigationIdRef:R,pendingScrollPayloadRef:j,setRenderKey:D,setRscPayload:v,clearHmrError:()=>{K(null)},pendingNavigateCommittedIdRef:V}),t.flightProtocol!=null&&t.flightProtocol!==``&&(W.current=t.flightProtocol),ye(),L.current&&L.current(e)},d=async t=>{try{return{kind:`payload`,payload:await i(t)}}catch(t){return e(t)&&t.name===`AbortError`?{kind:`aborted`}:{kind:`error`,error:a(t)}}},f=async e=>{let n=t(e,ue);if(!n||n.navigationId!==R.current)return;A.current={x:window.scrollX,y:window.scrollY},q();let r=await d(n);if(r.kind===`aborted`)return;if(r.kind===`error`){P(n,r.error),G.current>=3&&Y();return}let i=r.payload;if(i==null&&n.isStreaming&&R.current===n.navigationId||i==null||R.current!==n.navigationId)return;let a=await o(n,i);a!=null&&s(n,a)},p=async()=>{A.current={x:window.scrollX,y:window.scrollY},q();try{await X.current(),D(e=>e+1),K(null)}catch(e){console.error(`HMR refetch error:`,r(e,String(e))),G.current>=3&&Y()}requestAnimationFrame(()=>{window.scrollTo(A.current.x,A.current.y),ve()})},m=e=>{let r=t(e,de);if(r?.element==null||!le(r.element)&&!n(r.element))return;let{pathname:i,search:o}=l(),s=++z.current,d=R.current,f=`${i}${o}`;A.current={x:window.scrollX,y:window.scrollY},q();try{r.revalidationKind===1?u.clear():r.revalidatedPath!=null&&r.revalidatedPath!==``?u.invalidate(r.revalidatedPath,o):u.invalidate(i,o);let e=T.current?.element,t=u.getElement(i,o)??(e!=null&&n(e)?null:e??null),p=r.element;(async()=>{try{let e=await I(p);if(s!==z.current||R.current!==d)return;let{pathname:n,search:r}=l();if(`${n}${r}`!==f)return;let i=await I(c(t,e));if(s!==z.current||R.current!==d)return;let a=l();if(`${a.pathname}${a.search}`!==f)return;if(!M(i)){let e=/* @__PURE__ */ Error(`[rari] AppRouter: action flight refresh did not resolve to an <html> document root`);J(e,`parse`,`Action flight refresh failed: ${e.message}`,window.location.pathname),G.current>=3&&Y();return}let o={element:i,rawElement:i};B.current=o,g.startTransition(()=>{v(o),K(null)}),_e(i),ye()}catch(e){if(s!==z.current||R.current!==d)return;let t=a(e);J(t,`parse`,`Action flight refresh failed: ${t.message}`,window.location.pathname),G.current>=3&&Y()}})()}catch(e){let t=a(e);J(t,`parse`,`Action flight refresh failed: ${t.message}`,window.location.pathname),G.current>=3&&Y()}},h=async()=>{try{await X.current(),D(e=>e+1),K(null)}catch(e){console.error(`RSC invalidate error:`,r(e,String(e))),G.current>=3&&Y()}},_=e=>{let n=t(e,fe);n&&(F.current.clear(),R.current=n.navigationId,z.current+=1,j.current=null,B.current=null)},y=async()=>{try{await X.current(),K(null)}catch(e){console.error(`Manifest update error:`,r(e,String(e))),G.current>=3&&Y()}},b=e=>{f(e)},x=()=>{p()},S=()=>{h()},ee=()=>{y()};return window.addEventListener(`rari:navigation-start`,_),window.addEventListener(`rari:navigate`,b),window.addEventListener(`rari:app-router-rerender`,x),window.addEventListener(`rari:action-flight-refresh`,m),window.addEventListener(`rari:rsc-invalidate`,S),window.addEventListener(`rari:app-router-manifest-updated`,ee),()=>{window.removeEventListener(`rari:navigation-start`,_),window.removeEventListener(`rari:navigate`,b),window.removeEventListener(`rari:app-router-rerender`,x),window.removeEventListener(`rari:action-flight-refresh`,m),window.removeEventListener(`rari:rsc-invalidate`,S),window.removeEventListener(`rari:app-router-manifest-updated`,ee)}},[]),y(()=>{if(typeof window<`u`&&window.location.hash&&_){let e=window.location.hash.slice(1);requestAnimationFrame(()=>{requestAnimationFrame(()=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`instant`,block:`start`})})})}},[_]);let De=_?.element??o,Z=d(De),[Oe,ke]=S(null),Ae=pe(Z),je=n(Z)&&Ae===void 0,Q=Ae===void 0?n(Z)?null:Z:d(Ae),$=Q!=null&&!n(Q)&&M(Q)?Q:null;if($!=null&&!Object.is($,Oe)&&ke($),je){if(Oe==null)throw Error(`[rari] AppRouter: expected a resolved <html> document root`)}else if($==null)throw Error(`[rari] AppRouter: expected a resolved <html> document root`);return/* @__PURE__ */ w(te,{children:[ge!=null&&/* @__PURE__ */ C(ie,{failure:ge,maxRetries:3,onRefresh:()=>{window.location.reload()},onDismiss:()=>{K(null)}}),je?Oe:$]})}export{L as AppRouterProvider};
|
|
1
|
+
import{d as e,i as t,p as n,r,v as i,w as a}from"../type-guards-BJXKlA6x.mjs";import{r as o}from"../navigation-transition-store-CSKrbtbK.mjs";import"./action-revalidation-kind.mjs";import{isLayoutReuseMarker as s,mergeFlightRefresh as c,unwrapFulfilledFlightNode as l}from"./merge-flight-refresh.mjs";import{currentRouteLocation as u,flightRouteCache as d}from"./flight-route-cache.mjs";import{n as f,t as p}from"../preload-modules-Dv_GzGCm.mjs";import{n as m,r as h}from"../form-state-DAygOjc8.mjs";import{c as g}from"react/compiler-runtime";import*as _ from"react";import{addTransitionType as v,startTransition as y,useEffect as b,useLayoutEffect as x,useRef as S,useState as C,useTransition as w}from"react";import{Fragment as ee,jsx as T,jsxs as E}from"react/jsx-runtime";import{createFromFetch as te,createFromReadableStream as ne}from"virtual:react-flight-client";const D={position:`fixed`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,padding:`24px`,background:`rgba(220, 38, 38, 0.95)`,color:`white`,borderRadius:`8px`,fontSize:`14px`,zIndex:1e4,maxWidth:`500px`,boxShadow:`0 4px 6px rgba(0, 0, 0, 0.3)`},O={padding:`8px 16px`,background:`white`,color:`#dc2626`,border:`none`,borderRadius:`4px`,cursor:`pointer`,fontWeight:`bold`,fontSize:`14px`},k={padding:`8px 16px`,background:`rgba(255, 255, 255, 0.2)`,color:`white`,border:`1px solid rgba(255, 255, 255, 0.3)`,borderRadius:`4px`,cursor:`pointer`,fontSize:`14px`},A={fetch:`Failed to fetch updated content from server.`,parse:`Failed to parse server response.`,stale:`Server returned stale content.`,network:`Network error occurred.`};function j(e){return A[e]}function re(e){let t=g(27),{failure:n,maxRetries:r,onRefresh:i,onDismiss:a}=e,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ T(`div`,{style:{marginBottom:`16px`,fontWeight:`bold`,fontSize:`16px`},children:`⚠️ HMR Update Failed`}),s={marginBottom:`12px`,opacity:.9},t[0]=o,t[1]=s):(o=t[0],s=t[1]);let c;t[2]===n.type?c=t[3]:(c=j(n.type),t[2]=n.type,t[3]=c);let l;t[4]===c?l=t[5]:(l=/* @__PURE__ */ T(`div`,{style:s,children:c}),t[4]=c,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u={marginBottom:`16px`,fontSize:`12px`,opacity:.8,fontFamily:`monospace`},t[6]=u):u=t[6];let d;t[7]===n.details?d=t[8]:(d=/* @__PURE__ */ T(`div`,{style:u,children:n.details}),t[7]=n.details,t[8]=d);let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f={marginBottom:`12px`,fontSize:`12px`,opacity:.7},t[9]=f):f=t[9];let p;t[10]!==n.consecutiveFailures||t[11]!==r?(p=/* @__PURE__ */ E(`div`,{style:f,children:[`Consecutive failures: `,n.consecutiveFailures,` / `,r]}),t[10]=n.consecutiveFailures,t[11]=r,t[12]=p):p=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m={display:`flex`,gap:`8px`},t[13]=m):m=t[13];let h;t[14]===i?h=t[15]:(h=/* @__PURE__ */ T(`button`,{onClick:i,type:`button`,style:O,children:`Refresh Page`}),t[14]=i,t[15]=h);let _;t[16]===a?_=t[17]:(_=/* @__PURE__ */ T(`button`,{onClick:a,type:`button`,style:k,children:`Dismiss`}),t[16]=a,t[17]=_);let v;t[18]!==h||t[19]!==_?(v=/* @__PURE__ */ E(`div`,{style:m,children:[h,_]}),t[18]=h,t[19]=_,t[20]=v):v=t[20];let y;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ T(`div`,{style:{marginTop:`12px`,fontSize:`11px`,opacity:.6},children:`Check the console for detailed error logs.`}),t[21]=y):y=t[21];let b;return t[22]!==v||t[23]!==l||t[24]!==d||t[25]!==p?(b=/* @__PURE__ */ E(`div`,{style:D,children:[o,l,d,p,v,y]}),t[22]=v,t[23]=l,t[24]=d,t[25]=p,t[26]=b):b=t[26],b}function ie(e){return e.historyKey!=null&&e.historyKey!==``?[`nav`,`nav-traverse`]:e.replace===!0?[`nav`,`nav-replace`]:[`nav`,`nav-forward`]}function M(e){e!=null&&typeof window<`u`&&(e.replace===!0?window.history.replaceState(e.state,``,e.url):window.history.pushState(e.state,``,e.url))}function N(e){if(e!=null&&e.url!==``)try{let t=`http://localhost/`;if(typeof window<`u`)try{t=window.location.href}catch{}let n=new URL(e.url,t);o({pathname:n.pathname,search:n.search})}catch{}}function ae(e){let{parsedPayload:t,shouldScrollToTop:n,navigationId:r,transitionTypes:i,pendingHistory:a,startTransition:o=y,currentNavigationIdRef:s,pendingScrollPayloadRef:c,setRenderKey:l,setRscPayload:u,clearHmrError:d,pendingNavigateCommittedIdRef:f}=e;o(()=>{if(s.current===r){if(i!=null)for(let e of i)v(e);M(a),N(a),l(e=>{let r=e+1;return c.current=n?{payload:t,commitKey:r}:null,r}),u(t),d(),f.current=r}})}function oe(e,t,n){return e==null||e.commitKey!==n?{shouldScroll:!1,nextPending:null}:t===e.payload?{shouldScroll:!0,nextPending:null}:{shouldScroll:!1,nextPending:e}}function P(e){return _.isValidElement(e)&&(e.type===`html`||e.type===`HTML`)}function F(e){if(e==null)return null;if(n(e)){let t=l(e);return t===e||!P(t)?null:t}return P(e)?e:null}const se=/"timestamp":(\d+)/;function ce(e){return e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`||_.isValidElement(e)||Array.isArray(e)}function le(e){return i(e)&&typeof e.from==`string`&&typeof e.to==`string`&&typeof e.navigationId==`number`&&i(e.options)}function ue(e){return i(e)&&`element`in e}function de(e){return i(e)&&typeof e.navigationId==`number`&&typeof e.targetPath==`string`}function fe(e){if(!n(e))return e;if(i(e)&&e.status===`fulfilled`)return ce(e.value)?e.value:void 0}function I(e){return _.isValidElement(e)&&(e.type===`html`||e.type===`HTML`)}function L(e){return I(e)||_.isValidElement(e)&&s(e)}function pe(e,t){console.error(`[rari] AppRouter: Navigation failed:`,t),window.dispatchEvent(new CustomEvent(`rari:navigate-error`,{detail:{from:e.from,to:e.to,error:t,navigationId:e.navigationId}}))}function me(e){let t=e.pendingHistory?.url,n=t!=null&&t!==``?new URL(t,window.location.origin).hash.length>0:window.location.hash.length>0;return(e.options.historyKey==null||e.options.historyKey===``)&&!n&&e.options.scroll!==!1}async function he(e,t,n,r){let i=await R(e.element);if(r!==n)return{kind:`superseded`};if(!L(i))return{kind:`error`,error:/* @__PURE__ */ Error(`[rari] AppRouter: navigated Flight content did not resolve to an <html> document root`)};let a=F(t);if(_.isValidElement(i)&&s(i)&&a==null)return{kind:`error`,error:/* @__PURE__ */ Error(`[rari] AppRouter: layout-reuse Flight marker requires a previous <html> document`)};let o=a==null?i:c(a,i);return I(o)?{kind:`payload`,payload:{...e,element:o,rawElement:o}}:{kind:`error`,error:/* @__PURE__ */ Error(`[rari] AppRouter: layout-merged Flight content did not resolve to an <html> document root`)}}async function R(e){let t=f(e);for(let e=0;e<10&&n(t);e+=1)t=f(await t);if(n(t))throw Error(`[rari] AppRouter: Flight content did not resolve to a React node`);return t}function z({children:o,initialPayload:s,onNavigate:l}){let[g,v]=C(s),y=S(s),[D,O]=C(0),[,k]=w(),A=S(k),j=S({x:0,y:0}),M=S(null),N=S(/* @__PURE__ */ new Map),P=S(/* @__PURE__ */ new Set),F=S(l),L=S(0),z=S(0),B=S(null),V=S(null),H=S(/* @__PURE__ */ new Map),U=S([]),W=S(null),G=S(0),[ge,K]=C(null);b(()=>{F.current=l},[l]),b(()=>{A.current=k},[k]),x(()=>{let{shouldScroll:e,nextPending:t}=oe(M.current,g,D);M.current=t,e&&window.scrollTo(0,0);let n=V.current;n!=null&&(V.current=null,window.dispatchEvent(new CustomEvent(`rari:navigate-committed`,{detail:{navigationId:n}})))},[g,D]);let _e=e=>{if(e==null||n(e))return;let{pathname:t,search:r}=u();d.set(t,r,e)};b(()=>{y.current=g,g?.element!=null&&_e(g.element)},[g]),b(()=>{if(g?.element!=null){let e=g.element;if(i(e)&&`status`in e&&e.status===`rejected`){let t=e.reason;t!=null&&t!==``&&console.error(`[rari] AppRouter: Flight payload rejected:`,t)}}},[g]);let q=()=>{N.current=m()},ve=()=>{h(N.current)};x(()=>{let e=B.current;e!=null&&g===e&&(B.current=null,window.scrollTo(j.current.x,j.current.y),ve())},[g,D]);let J=(e,t,n,r)=>{G.current+=1;let i={timestamp:Date.now(),error:e,type:t,details:n,filePath:r,consecutiveFailures:G.current};U.current.push(i),U.current.length>10&&U.current.shift(),G.current>=2&&K(i),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`rari:hmr-failure`,{detail:i}))},Y=()=>{setTimeout(()=>{window.location.reload()},1e3)},ye=()=>{G.current>0&&(G.current=0)},be=e=>{if(W.current==null||W.current===``)return!1;if(e===W.current)return!0;let t=se.exec(e);if(t){let e=Number.parseInt(t[1],10);if(Date.now()-e>5e3)return!0}return!1},xe=e=>{p(e,P.current);let t=new ReadableStream({start(t){t.enqueue(new TextEncoder().encode(e)),t.close()}}),n=ne(t);return{element:n,rawElement:n,flightProtocol:e}},Se=async e=>{let t=await e;if(!t.body)throw Error(`Response has no body stream`);let n=t.clone(),r=te(Promise.resolve(t));return n.text().then(async e=>{await p(e,P.current),e!==``&&(W.current=e)}).catch(()=>{}),{element:r,rawElement:r,flightProtocol:``}},Ce=async(t,n)=>{try{let e=await t.clone().text();if(be(e))return H.current.delete(n),`stale`;await p(e,P.current);let r=await R(te(Promise.resolve(t)));if(!I(r))throw Error(`[rari] AppRouter: refetched Flight content did not resolve to an <html> document root`);return{element:r,rawElement:r,flightProtocol:e}}catch(t){if(e(t)&&t.name===`AbortError`)throw t;let n=a(t),r=Error(`Failed to parse RSC Flight protocol: ${n.message}`,{cause:n});return J(r,`parse`,r.message,window.location.pathname),r}},we=async(t,n,r)=>{let i=t!=null&&t!==``?t:window.location.pathname,o=L.current,s=r?.commit!==!1,c=`${o}:${i}${window.location.search}:${s?`commit`:`defer`}`,l=H.current.get(c);if(l)return l;let u=(async()=>{try{let e=i+window.location.search,t=await fetch(e,{headers:{Accept:`text/x-component`,"rari-navigation-id":String(L.current)},cache:`no-store`,signal:n});if(!t.ok){let n=/* @__PURE__ */ Error(`Failed to fetch RSC data: ${t.status} ${t.statusText}`);throw J(n,`fetch`,`HTTP ${t.status} when fetching ${e}`,window.location.pathname),n}let r=await Ce(t,c);if(r===`stale`)return;if(r instanceof Error)throw r;return L.current===o&&(s&&v(r),r.flightProtocol!=null&&r.flightProtocol!==``&&(W.current=r.flightProtocol),ye()),H.current.delete(c),r}catch(t){throw H.current.delete(c),e(t)&&t.name!==`AbortError`&&!t.message.includes(`Failed to fetch RSC data`)&&!t.message.includes(`Failed to parse`)&&J(t,`network`,`Network error: ${t.message}`,window.location.pathname),a(t)}})();return H.current.set(c,u),u},Te=S(xe),Ee=S(Se),X=S(we);b(()=>{Te.current=xe,Ee.current=Se,X.current=we}),b(()=>{if(typeof window>`u`)return;let i=async e=>{if(e.rscResponsePromise){let t=await e.rscResponsePromise;if(L.current!==e.navigationId)return;let n=await Ee.current(Promise.resolve(t));return L.current===e.navigationId?n:void 0}if(e.rscResponse){let t=await Ee.current(Promise.resolve(e.rscResponse));return L.current===e.navigationId?t:void 0}if(e.rscFlightProtocol!=null&&e.rscFlightProtocol!==``)return Te.current(e.rscFlightProtocol);if(!e.isStreaming)return X.current(e.to,e.abortSignal,{commit:!1})},o=async(e,t)=>{try{let n=await he(t,y.current?.element,e.navigationId,L.current);return n.kind===`superseded`?null:n.kind===`error`?(pe(e,n.error),null):L.current===e.navigationId?n.payload:null}catch(t){return pe(e,a(t)),null}},s=(e,t)=>{ae({parsedPayload:t,shouldScrollToTop:me(e),navigationId:e.navigationId,transitionTypes:ie({historyKey:e.options.historyKey,replace:e.options.replace}),pendingHistory:e.pendingHistory,startTransition:A.current,currentNavigationIdRef:L,pendingScrollPayloadRef:M,setRenderKey:O,setRscPayload:v,clearHmrError:()=>{K(null)},pendingNavigateCommittedIdRef:V}),t.flightProtocol!=null&&t.flightProtocol!==``&&(W.current=t.flightProtocol),ye(),F.current&&F.current(e)},l=async t=>{try{return{kind:`payload`,payload:await i(t)}}catch(t){return e(t)&&t.name===`AbortError`?{kind:`aborted`}:{kind:`error`,error:a(t)}}},f=async e=>{let n=t(e,le);if(!n||n.navigationId!==L.current)return;j.current={x:window.scrollX,y:window.scrollY},q();let r=await l(n);if(r.kind===`aborted`)return;if(r.kind===`error`){pe(n,r.error),G.current>=3&&Y();return}let i=r.payload;if(i==null&&n.isStreaming&&L.current===n.navigationId||i==null||L.current!==n.navigationId)return;let a=await o(n,i);a!=null&&s(n,a)},p=async()=>{j.current={x:window.scrollX,y:window.scrollY},q();try{await X.current(),O(e=>e+1),K(null)}catch(e){console.error(`HMR refetch error:`,r(e,String(e))),G.current>=3&&Y()}requestAnimationFrame(()=>{window.scrollTo(j.current.x,j.current.y),ve()})},m=e=>{let r=t(e,ue);if(r?.element==null||!ce(r.element)&&!n(r.element))return;let{pathname:i,search:o}=u(),s=++z.current,l=L.current,f=`${i}${o}`;j.current={x:window.scrollX,y:window.scrollY},q();try{r.revalidationKind===1?d.clear():r.revalidatedPath!=null&&r.revalidatedPath!==``?d.invalidate(r.revalidatedPath,o):d.invalidate(i,o);let e=y.current?.element,t=d.getElement(i,o)??(e!=null&&n(e)?null:e??null),p=r.element;(async()=>{try{let e=await R(p);if(s!==z.current||L.current!==l)return;let{pathname:n,search:r}=u();if(`${n}${r}`!==f)return;let i=await R(c(t,e));if(s!==z.current||L.current!==l)return;let a=u();if(`${a.pathname}${a.search}`!==f)return;if(!I(i)){let e=/* @__PURE__ */ Error(`[rari] AppRouter: action flight refresh did not resolve to an <html> document root`);J(e,`parse`,`Action flight refresh failed: ${e.message}`,window.location.pathname),G.current>=3&&Y();return}let o={element:i,rawElement:i};B.current=o,_.startTransition(()=>{v(o),K(null)}),_e(i),ye()}catch(e){if(s!==z.current||L.current!==l)return;let t=a(e);J(t,`parse`,`Action flight refresh failed: ${t.message}`,window.location.pathname),G.current>=3&&Y()}})()}catch(e){let t=a(e);J(t,`parse`,`Action flight refresh failed: ${t.message}`,window.location.pathname),G.current>=3&&Y()}},h=async()=>{try{await X.current(),O(e=>e+1),K(null)}catch(e){console.error(`RSC invalidate error:`,r(e,String(e))),G.current>=3&&Y()}},g=e=>{let n=t(e,de);n&&(P.current.clear(),L.current=n.navigationId,z.current+=1,M.current=null,B.current=null)},b=async()=>{try{await X.current(),K(null)}catch(e){console.error(`Manifest update error:`,r(e,String(e))),G.current>=3&&Y()}},x=e=>{f(e)},S=()=>{p()},C=()=>{h()},w=()=>{b()};return window.addEventListener(`rari:navigation-start`,g),window.addEventListener(`rari:navigate`,x),window.addEventListener(`rari:app-router-rerender`,S),window.addEventListener(`rari:action-flight-refresh`,m),window.addEventListener(`rari:rsc-invalidate`,C),window.addEventListener(`rari:app-router-manifest-updated`,w),()=>{window.removeEventListener(`rari:navigation-start`,g),window.removeEventListener(`rari:navigate`,x),window.removeEventListener(`rari:app-router-rerender`,S),window.removeEventListener(`rari:action-flight-refresh`,m),window.removeEventListener(`rari:rsc-invalidate`,C),window.removeEventListener(`rari:app-router-manifest-updated`,w)}},[]),b(()=>{if(typeof window<`u`&&window.location.hash&&g){let e=window.location.hash.slice(1);requestAnimationFrame(()=>{requestAnimationFrame(()=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`instant`,block:`start`})})})}},[g]);let De=g?.element??o,Z=f(De),[Oe,ke]=C(null),Ae=fe(Z),je=n(Z)&&Ae===void 0,Q=Ae===void 0?n(Z)?null:Z:f(Ae),$=Q!=null&&!n(Q)&&I(Q)?Q:null;if($!=null&&!Object.is($,Oe)&&ke($),je){if(Oe==null)throw Error(`[rari] AppRouter: expected a resolved <html> document root`)}else if($==null)throw Error(`[rari] AppRouter: expected a resolved <html> document root`);return/* @__PURE__ */ E(ee,{children:[ge!=null&&/* @__PURE__ */ T(re,{failure:ge,maxRetries:3,onRefresh:()=>{window.location.reload()},onDismiss:()=>{K(null)}}),je?Oe:$]})}export{z as AppRouterProvider};
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
export declare const LAYOUT_REUSE_ELEMENT = "rari-layout-reuse";
|
|
4
4
|
export declare const LAYOUT_REUSE_PATH_PROP = "data-rari-layout-path";
|
|
5
5
|
export declare function isLayoutReuseMarker(element: React.ReactElement): boolean;
|
|
6
|
+
export declare function unwrapFulfilledFlightNode(node: React.ReactNode | PromiseLike<React.ReactNode>): React.ReactNode;
|
|
6
7
|
export declare function spliceLayoutReuseChildren(current: React.ReactNode, nextPage: React.ReactNode, layoutPath?: string): React.ReactNode;
|
|
7
8
|
export declare function mergeFlightRefresh(current: React.ReactNode, refresh: React.ReactNode): React.ReactNode;
|
|
8
9
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,o as t,s as n}from"../type-guards-BJXKlA6x.mjs";import*as r from"react";const i=`rari-layout-reuse`,a=`data-rari-layout-path`;function o(e){return r.isValidElement(e)}function s(t){return e(t.type)}function c(e){return e.type===`head`||e.type===`HEAD`}function l(e){return e.type===`html`||e.type===`HTML`}function u(e){return e.type===`body`||e.type===`BODY`}function d(e){return e.type===i}function f(e){let t=m(e)[a];return typeof t==`string`&&t!==``?t:void 0}function p(e){let t={...e};return delete t.children,t}function m(e){return t(e)}function h(e,t){if(!s(e)||!s(t))return!1;let r=n(e.type)?e.type.$$id:void 0,i=n(t.type)?t.type.$$id:void 0;return r==null||r===``||i==null||i===``||r!==i?!1:(e.key??null)===(t.key??null)}function g(e){return b(m(e).children)}function _(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e))}function v(e,t){let n=e.key,i=typeof n==`string`&&n!==``?`${t}:${n.replace(/^\.+/,``)}`:t;return r.cloneElement(e,{key:i})}function ee(e,t,n){return Array.isArray(e)?y(e,t==null?`.${n}`:`${t}:${n}`):e==null||e===!1||e===!0?[]:o(e)&&t!=null?[v(e,`${t}:${n}`)]:[e]}function y(e,t){if(!Array.isArray(e))return e==null||e===!1||e===!0?[]:o(e)&&t!=null?[v(e,t)]:[e];let n=[];for(let r=0;r<e.length;r+=1)n.push(...ee(e[r],t,r));return n}function b(e){return e==null||e===!1||e===!0?[]:o(e)||typeof e==`string`||typeof e==`number`?[e]:Array.isArray(e)?y(e,null):r.Children.toArray(e)}function x(e){return o(e)?d(e)?!0:b(m(e).children).some(e=>x(e)):!1}function te(e){let t=e.type;return t===`title`||t===`TITLE`||t===`meta`||t===`META`||t===`link`||t===`LINK`}function S(e){if(e.type!==`link`&&e.type!==`LINK`)return!1;let t=m(e).rel;if(typeof t!=`string`||t===``)return!1;let n=t.toLowerCase();return n===`stylesheet`||n===`preload`||n===`modulepreload`||n===`preconnect`||n===`dns-prefetch`||n===`icon`||n===`shortcut icon`||n===`apple-touch-icon`}function C(e){return e.type===r.Fragment}function w(e){let t=[];for(let n of e){if(o(n)&&C(n)){t.push(...w(g(n)));continue}t.push(n)}return t}function T(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=m(e);return t.charSet!=null||t.charset!=null||typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`||typeof t.name==`string`&&t.name.toLowerCase()===`viewport`}function E(e,t){let n=m(e);return w(t).some(e=>{if(!o(e)||!T(e))return!1;let t=m(e);return n.charSet!=null||n.charset!=null?t.charSet!=null||t.charset!=null:typeof n.httpEquiv==`string`&&n.httpEquiv.toLowerCase()===`content-type`?typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`:typeof t.name==`string`&&t.name.toLowerCase()===`viewport`})}function D(e){return e.type===`title`||e.type===`TITLE`}function O(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=m(e).name;return typeof t==`string`&&t.toLowerCase()===`description`}function ne(e){return w(e).some(e=>o(e)&&D(e))}function re(e){return w(e).some(e=>o(e)&&O(e))}function ie(e,t){let n=m(e),r=w(g(e)),i=g(t),a=w(i),s=ne(a),c=re(a);return P(e,n,[...r.filter(e=>{if(!o(e))return!0;if(D(e))return!s;if(e.type===`meta`||e.type===`META`)return T(e)?!E(e,i):O(e)?!c:!1;if(!S(e))return!te(e);let t=m(e);return!a.some(e=>{if(!o(e)||!S(e))return!1;let n=m(e);return t.rel!=null&&t.rel===n.rel&&t.href===n.href})}),...a])}function k(e){return e.length===0?null:e.length===1?e[0]:[...e]}function A(e){let t=[];for(let n of b(e))t.push(j(n));return t}function j(e){if(Array.isArray(e))return k(A(e));if(!o(e))return e;if(d(e))return k(A(m(e).children));let t=m(e),n=b(t.children);if(n.length===0)return e;let r=A(n);return!_(t.children)&&r.every((e,t)=>e===n[t])?e:P(e,t,k(r))}function M(e,t){if(e.length===0)return[j(t)];if(e.length===1)return[$(e[0],t)];let n=[],r=!1;for(let i of e)!r&&o(i)?(r=!0,n.push($(i,t))):n.push(i);return r?n:[j(t)]}function N(e,t){let n=[],r=0;for(let i of t){if(o(i)&&d(i)){n.push(...M(e.slice(r),i)),r=e.length;continue}let t=e[r];n.push(t===void 0?j(i):$(t,i)),r+=1}return r<e.length&&n.push(...e.slice(r)),k(n)}function ae(e,t){let n=b(e),r=b(t);return n.length===0||r.length===0?j(t):r.some(e=>o(e)&&d(e))?N(n,r):n.length===r.length?k(n.map((e,t)=>$(e,r[t]))):j(t)}function P(e,t,n){let i=b(n);return r.cloneElement(e,p(t),...i.length===0?[null]:i)}function F(e,t){let n=g(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(o(i)&&f(i)===t)return{parent:e,slotIndex:r}}for(let e=0;e<n.length;e+=1){let r=n[e];if(!o(r))continue;let i=F(r,t);if(i!=null)return i}return null}function I(e){return e.type===`main`||e.type===`MAIN`||g(e).some(e=>o(e)&&I(e))}const L=/* @__PURE__ */ new Set([.../* @__PURE__ */ new Set(/* @__PURE__ */ `area.base.br.col.embed.hr.img.input.link.meta.param.source.track.wbr.AREA.BASE.BR.COL.EMBED.HR.IMG.INPUT.LINK.META.PARAM.SOURCE.TRACK.WBR`.split(`.`)),`script`,`style`,`iframe`,`textarea`,`noscript`,`template`,`canvas`,`video`,`audio`,`object`,`embed`,`svg`,`math`,`select`,`title`,`SCRIPT`,`STYLE`,`IFRAME`,`TEXTAREA`,`NOSCRIPT`,`TEMPLATE`,`CANVAS`,`VIDEO`,`AUDIO`,`OBJECT`,`EMBED`,`SVG`,`MATH`,`SELECT`,`TITLE`]);function oe(e){return typeof e.type!=`string`||L.has(e.type)?!1:g(e).length===0}function se(e,t){return h(e,t)?!0:e.type===t.type&&(e.key??null)===(t.key??null)}function ce(e){let t=e.type;return t===`nav`||t===`NAV`||t===`header`||t===`HEADER`||t===`footer`||t===`FOOTER`||t===`aside`||t===`ASIDE`}function R(e){return e.type===`main`||e.type===`MAIN`}function z(e){let t=m(e).role;if(typeof t!=`string`||t===``)return!1;let n=t.toLowerCase();return n===`status`||n===`alert`||n===`alertdialog`||n===`log`}function B(e){return typeof e.type==`string`&&!L.has(e.type)&&!ce(e)&&!z(e)}function V(e){return s(e)||C(e)}function H(e,t){return z(e)?!1:B(t)?B(e):V(t)?V(e):!1}function U(e){let t=e.findIndex(e=>o(e)&&R(e));if(t>=0)return t;for(let t=0;t<e.length;t+=1){let n=e[t];if(o(n)&&B(n)&&I(n))return t}for(let t=e.length-1;t>=0;--t){let n=e[t];if(o(n)&&B(n))return t}for(let t=e.length-1;t>=0;--t){let n=e[t];if(o(n)&&V(n))return t}return-1}function W(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n!=null&&n!==!1&&n!==!0&&!o(n)&&(typeof n==`string`||typeof n==`number`))return t}return-1}function le(e){return R(e)||I(e)?!0:g(e).some(e=>o(e)&&B(e))}function ue(e,t){let n=e.length;for(let t=e.length-1;t>=0;--t){let r=e[t];if(o(r)&&(r.type===`footer`||r.type===`FOOTER`)){n=t;continue}break}return[...e.slice(0,n),t,...e.slice(n)]}function de(e,t){let n=e.findIndex(e=>o(e)&&se(e,t));if(n>=0){let r=[...e];return r[n]=$(e[n],t),r}let r=U(e);if(r<0)return null;let i=e[r];return o(i)&&(R(i)||I(i))?G(e,r,i,t):null}function G(e,t,n,r){let i=[...e];return i[t]=P(n,m(n),q(n,r)),i}function K(e,t,n,r){let i=o(n)&&(!V(n)||le(n)),a=[];for(let s=0;s<e.length;s+=1){let c=e[s];if(s===t){a.push(i?P(n,m(n),r):r);continue}o(n)&&o(c)&&H(c,n)||a.push(c)}return a}function q(e,t){let n=g(e);if(n.length===1&&o(n[0]))return $(n[0],t);if(n.length===0)return t;if(o(t)){let e=de(n,t);if(e!=null)return e}let r=U(n);if(r<0){let e=W(n);return e>=0?K(n,e,n[e],t):ue(n,t)}let i=n[r];return o(i)&&(R(i)||I(i))?G(n,r,i,t):K(n,r,i,t)}function J(e,t,n){let r=F(e,n);if(r==null)return null;let i=m(r.parent),a=g(r.parent),s=[...a],c=a[r.slotIndex];return s[r.slotIndex]=o(c)?P(c,m(c),q(c,t)):t,Z(e,r.parent,P(r.parent,i,s))}function Y(e,t,n,r,i){let a=[...n];return a[r]=i,P(e,t,a)}function fe(e,t,n){let r=m(e),i=g(e);if(e.type===`main`||e.type===`MAIN`)return P(e,r,q(e,t));if(i.length===1&&o(i[0]))return P(e,r,X(i[0],t,n));let a=i.findIndex(e=>o(e)&&(e.type===`main`||e.type===`MAIN`));if(a>=0)return Y(e,r,i,a,X(i[a],t,n));for(let a=0;a<i.length;a+=1){let s=i[a];if(o(s)&&I(s))return Y(e,r,i,a,X(s,t,n))}for(let n=0;n<i.length;n+=1){let a=i[n];if(o(a)&&oe(a))return Y(e,r,i,n,P(a,m(a),q(a,t)))}return P(e,r,q(e,t))}function X(e,t,n){if(!o(e))return t;if(o(t)&&d(t)){let r=f(t);return X(e,m(t).children,r??n)}if(n!=null&&n!==``){let r=J(e,t,n);if(r!=null)return r}return fe(e,t,n)}function Z(e,t,n){if(e===t)return n;let r=m(e),i=g(e),a=[],s=!1;for(let e of i){if(!o(e)){a.push(e);continue}if(e===t){s=!0,a.push(n);continue}let r=Z(e,t,n);r!==e&&(s=!0),a.push(r)}return s?P(e,r,a):e}function pe(e,t){let n=m(e),r=g(e),i=g(t),a=r.find(e=>o(e)&&c(e)),s=i.find(e=>o(e)&&c(e)),l=r.find(e=>o(e)&&u(e)),d=i.find(e=>o(e)&&u(e)),f=o(a)&&o(s)?ie(a,s):o(a)?a:s,p=o(l)&&o(d)?$(l,d):o(l)?l:d,h=[];return f!=null&&h.push(f),p!=null&&h.push(p),P(e,n,h)}function me(e,t,n){let r=m(e),i=g(e),a=i.findIndex(e=>o(e)&&u(e)),s=a>=0?i[a]:void 0,c=o(s)?X(s,t.children,n):X(e,t.children,n);if(o(s)&&a>=0){let t=[...i];return t[a]=c,P(e,r,t)}return P(e,r,c)}function Q(e,t){let n=m(e),r=m(t),i=b(r.children);if(i.length===1&&o(i[0])&&d(i[0])){let t=i[0];return X(e,m(t).children,f(t))}let a=ae(n.children,r.children);return a===r.children?t:x(t)?P(e,n,a):P(t,r,a)}function $(e,t){if(e==null)return j(t);if(t==null)return e;if(!o(e)||!o(t))return t;if(d(t)){let n=m(t),r=f(t);return l(e)?me(e,n,r):X(e,n.children,r)}return l(e)&&l(t)&&x(t)?pe(e,t):c(e)||c(t)?t:h(e,t)?x(t)?Q(e,t):t:e.type===t.type?Q(e,t):t}export{i as LAYOUT_REUSE_ELEMENT,a as LAYOUT_REUSE_PATH_PROP,d as isLayoutReuseMarker,$ as mergeFlightRefresh,X as spliceLayoutReuseChildren};
|
|
1
|
+
import{l as e,o as t,p as n,s as r,v as i}from"../type-guards-BJXKlA6x.mjs";import*as a from"react";const o=`rari-layout-reuse`,s=`data-rari-layout-path`;function c(e){return a.isValidElement(e)}function l(t){return e(t.type)}function u(e){return e.type===`head`||e.type===`HEAD`}function d(e){return e.type===`html`||e.type===`HTML`}function f(e){return e.type===`body`||e.type===`BODY`}function p(e){return e.type===o}function m(e){let t=h(e)[s];return typeof t==`string`&&t!==``?t:void 0}function ee(e){let t={...e};return delete t.children,t}function h(e){return t(e)}function g(e,t){if(!l(e)||!l(t))return!1;let n=r(e.type)?e.type.$$id:void 0,i=r(t.type)?t.type.$$id:void 0;return n==null||n===``||i==null||i===``||n!==i?!1:(e.key??null)===(t.key??null)}function _(e){return v(h(e).children)}function te(e){return Array.isArray(e)&&e.some(e=>Array.isArray(e))}function ne(e,t){let n=e.key,r=typeof n==`string`&&n!==``?`${t}:${n.replace(/^\.+/,``)}`:t;return a.cloneElement(e,{key:r})}function re(e,t,n){return Array.isArray(e)?ie(e,t==null?`.${n}`:`${t}:${n}`):e==null||e===!1||e===!0?[]:c(e)&&t!=null?[ne(e,`${t}:${n}`)]:[e]}function ie(e,t){if(!Array.isArray(e))return e==null||e===!1||e===!0?[]:c(e)&&t!=null?[ne(e,t)]:[e];let n=[];for(let r=0;r<e.length;r+=1)n.push(...re(e[r],t,r));return n}function v(e){return e==null||e===!1||e===!0?[]:c(e)||typeof e==`string`||typeof e==`number`?[e]:Array.isArray(e)?ie(e,null):n(e)?[e]:a.Children.toArray(e)}function y(e){return c(e)?p(e)?!0:v(h(e).children).some(e=>y(e)):!1}function ae(e){let t=e.type;return t===`title`||t===`TITLE`||t===`meta`||t===`META`||t===`link`||t===`LINK`}function b(e){if(e.type!==`link`&&e.type!==`LINK`)return!1;let t=h(e).rel;if(typeof t!=`string`||t===``)return!1;let n=t.toLowerCase();return n===`stylesheet`||n===`preload`||n===`modulepreload`||n===`preconnect`||n===`dns-prefetch`||n===`icon`||n===`shortcut icon`||n===`apple-touch-icon`}function x(e){return e.type===a.Fragment}function S(e){return e.type===a.Suspense}function C(e){return e}function oe(e){if(i(e)){if(e.status===`fulfilled`)return e.value;if(i(e._payload)&&e._payload.status===`fulfilled`)return e._payload.value}}function w(e){let t=e;for(let e=0;e<10;e+=1){if(!n(t)&&(!i(t)||!i(t._payload)))return C(t);let e=oe(t);if(e===void 0)return C(t);if(e==null||e===!1||e===!0)return e;t=e}return C(t)}function T(e){let t=w(e);if(Array.isArray(t)){let e=[];for(let n of t)e.push(...T(C(n)));return e}return c(t)&&x(t)?se(_(t)):t==null||t===!1||t===!0?[]:[t]}function se(e){let t=[];for(let n of e)t.push(...T(n));return t}function E(e){return se(_(e))}function D(e){let t=w(e);return Array.isArray(t)?!0:c(t)&&x(t)}function O(e,t){let n=w(e);if(Array.isArray(n)){let e=[];for(let t of n)e.push(...T(C(t)));let r=v(Be(e,t));return a.createElement(a.Fragment,null,...r.length===0?[null]:r)}return c(n)&&x(n)?P(n,h(n),Be(_(n),t)):c(n)?Y(n,t):t}function k(e){let t=[];for(let n of e){if(c(n)&&x(n)){t.push(...k(_(n)));continue}t.push(n)}return t}function A(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=h(e);return t.charSet!=null||t.charset!=null||typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`||typeof t.name==`string`&&t.name.toLowerCase()===`viewport`}function ce(e,t){let n=h(e);return k(t).some(e=>{if(!c(e)||!A(e))return!1;let t=h(e);return n.charSet!=null||n.charset!=null?t.charSet!=null||t.charset!=null:typeof n.httpEquiv==`string`&&n.httpEquiv.toLowerCase()===`content-type`?typeof t.httpEquiv==`string`&&t.httpEquiv.toLowerCase()===`content-type`:typeof t.name==`string`&&t.name.toLowerCase()===`viewport`})}function le(e){return e.type===`title`||e.type===`TITLE`}function ue(e){if(e.type!==`meta`&&e.type!==`META`)return!1;let t=h(e).name;return typeof t==`string`&&t.toLowerCase()===`description`}function de(e){return k(e).some(e=>c(e)&&le(e))}function fe(e){return k(e).some(e=>c(e)&&ue(e))}function pe(e,t){let n=h(e),r=k(_(e)),i=_(t),a=k(i),o=de(a),s=fe(a);return P(e,n,[...r.filter(e=>{if(!c(e))return!0;if(le(e))return!o;if(e.type===`meta`||e.type===`META`)return A(e)?!ce(e,i):ue(e)?!s:!1;if(!b(e))return!ae(e);let t=h(e);return!a.some(e=>{if(!c(e)||!b(e))return!1;let n=h(e);return t.rel!=null&&t.rel===n.rel&&t.href===n.href})}),...a])}function j(e){return e.length===0?null:e.length===1?e[0]:[...e]}function M(e){let t=[];for(let n of v(e))t.push(N(n));return t}function N(e){if(Array.isArray(e))return j(M(e));if(!c(e))return e;if(p(e))return j(M(h(e).children));let t=h(e),n=v(t.children);if(n.length===0)return e;let r=M(n);return!te(t.children)&&r.every((e,t)=>e===n[t])?e:P(e,t,j(r))}function me(e,t){if(e.length===0)return[N(t)];if(e.length===1)return[$(e[0],t)];let n=[],r=!1;for(let i of e)!r&&c(i)?(r=!0,n.push($(i,t))):n.push(i);return r?n:[N(t)]}function he(e,t){let n=[],r=0;for(let i of t){if(c(i)&&p(i)){n.push(...me(e.slice(r),i)),r=e.length;continue}let t=e[r];n.push(t===void 0?N(i):$(t,i)),r+=1}return r<e.length&&n.push(...e.slice(r)),j(n)}function ge(e,t){let n=v(e),r=v(t);return n.length===0||r.length===0?N(t):r.some(e=>c(e)&&p(e))?he(n,r):n.length===r.length?j(n.map((e,t)=>$(e,r[t]))):N(t)}function P(e,t,n){let r=v(n);return a.cloneElement(e,ee(t),...r.length===0?[null]:r)}function _e(e,t){for(let n=0;n<e.length;n+=1){let r=e[n];if(c(r)&&m(r)===t)return n;for(let e of T(r))if(c(e)&&m(e)===t)return n}return-1}function ve(e,t){let n=_(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(c(i)){let e=F(i,t);if(e!=null)return e;continue}let a=w(i);if(c(a)&&F(a,t)!=null)return{parent:e,slotIndex:r}}return null}function F(e,t){let n=_e(_(e),t);return n>=0?{parent:e,slotIndex:n}:ve(e,t)}function I(e){return H(e)?!0:E(e).some(e=>{let t=G(e);return t!=null&&I(t)})}const L=/* @__PURE__ */ new Set([.../* @__PURE__ */ new Set(/* @__PURE__ */ `area.base.br.col.embed.hr.img.input.link.meta.param.source.track.wbr.AREA.BASE.BR.COL.EMBED.HR.IMG.INPUT.LINK.META.PARAM.SOURCE.TRACK.WBR`.split(`.`)),`script`,`style`,`iframe`,`textarea`,`noscript`,`template`,`canvas`,`video`,`audio`,`object`,`embed`,`svg`,`math`,`select`,`title`,`SCRIPT`,`STYLE`,`IFRAME`,`TEXTAREA`,`NOSCRIPT`,`TEMPLATE`,`CANVAS`,`VIDEO`,`AUDIO`,`OBJECT`,`EMBED`,`SVG`,`MATH`,`SELECT`,`TITLE`]);function ye(e){return typeof e.type!=`string`||L.has(e.type)?!1:E(e).length===0}function be(e,t){return g(e,t)?!0:e.type===t.type&&(e.key??null)===(t.key??null)}function R(e){let t=e.type;return t===`nav`||t===`NAV`||t===`header`||t===`HEADER`||t===`footer`||t===`FOOTER`||t===`aside`||t===`ASIDE`}const xe=/^(?:app|page|site|main|mobile|top)?(?:footer|header|navbar|navigation|sidebar|sidenav|topbar|aside|nav)$/,Se=/^(?:app|page|site|main|mobile|top)?footer$/;function Ce(e){return e.replace(/[^a-z0-9]+/gi,``).toLowerCase()}function we(e){if(!r(e.type))return;let t=e.type.$$id,n=t.split(`#`)[0]??t;return(n.split(`/`).pop()??n).replace(/\.(?:tsx|jsx|ts|js)$/i,``)}function z(e){let t=we(e);return t==null?void 0:Ce(t)}function B(e){if(!l(e))return!1;let t=z(e);return t!=null&&xe.test(t)}function Te(e){return R(e)||B(e)}function V(e){if(S(e)){let t=E(e);return t.length===1&&c(t[0])&&V(t[0])}if(B(e)){let t=z(e);return t!=null&&Se.test(t)}let t=e.type;return t===`footer`||t===`FOOTER`}function H(e){return e.type===`main`||e.type===`MAIN`}function Ee(e){let t=h(e).role;if(typeof t!=`string`||t===``)return!1;let n=t.toLowerCase();return n===`status`||n===`alert`||n===`alertdialog`||n===`log`}function U(e){return typeof e.type==`string`&&!L.has(e.type)&&!R(e)&&!Ee(e)}function W(e){return B(e)?!1:l(e)||x(e)}function De(e){let t=E(e);return t.some(e=>c(e)&&Te(e))?!0:t.some(e=>{let t=G(e);return t!=null&&(H(t)||I(t))})}function Oe(e,t){return Ee(e)?!1:U(t)?U(e):W(t)?W(e):!1}function G(e){let t=w(e);return c(t)?t:null}function ke(e){return(S(e)||U(e))&&I(e)}function Ae(e,t){for(let n=e.length-1;n>=0;--n){let r=G(e[n]);if(r!=null&&t(r))return n}return-1}function K(e){let t=e.findIndex(e=>{let t=G(e);return t!=null&&H(t)});if(t>=0)return t;for(let t=0;t<e.length;t+=1){let n=G(e[t]);if(n!=null&&ke(n))return t}let n=Ae(e,U);return n>=0?n:Ae(e,W)}function je(e){return T(e).some(e=>{let t=G(e);return t!=null&&(H(t)||ke(t)||I(t))})}function Me(e,t){for(let n=0;n<e.length;n+=1){let r=T(e[n]);if(r.length!==1)continue;let i=G(r[0]);if(i!=null&&t(i))return n}return-1}function Ne(e,t){for(let n=e.length-1;n>=0;--n){let r=T(e[n]);if(r.length!==1)continue;let i=G(r[0]);if(i!=null&&t(i))return n}return-1}function Pe(e){for(let t=e.length-1;t>=0;--t)if(D(e[t])&&K(T(e[t]))>=0)return t;return-1}function Fe(e){let t=Me(e,H);if(t>=0)return t;for(let t=0;t<e.length;t+=1)if(je(e[t]))return t;let n=Ne(e,U);if(n>=0)return n;let r=Ne(e,W);return r>=0?r:Pe(e)}function Ie(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n!=null&&n!==!1&&n!==!0&&!c(n)&&(typeof n==`string`||typeof n==`number`))return t}return-1}function Le(e){return H(e)||I(e)?!0:E(e).some(e=>{let t=G(e);return t!=null&&U(t)})}function Re(e,t){let n=e.length;for(let t=e.length-1;t>=0;--t){let r=e[t];if(c(r)&&V(r)){n=t;continue}break}return[...e.slice(0,n),t,...e.slice(n)]}function ze(e,t){let n=e.findIndex(e=>c(e)&&be(e,t));if(n>=0){let r=[...e];return r[n]=$(e[n],t),r}let r=K(e);if(r<0)return null;let i=e[r],a=w(i);return c(a)&&(H(a)||I(a))?q(e,r,i,a,t):null}function q(e,t,n,r,i){let a=[...e],o=Y(r,i);return a[t]=c(n)&&n===r?P(n,h(n),o):o,a}function J(e,t,n,r){let i=c(n)&&(!W(n)||Le(n)),a=[];for(let o=0;o<e.length;o+=1){let s=e[o];if(o===t){a.push(i?P(n,h(n),r):r);continue}c(n)&&c(s)&&Oe(s,n)||a.push(s)}return a}function Be(e,t){if(e.length===1&&c(e[0]))return $(e[0],t);if(e.length===0)return t;if(c(t)){let n=ze(e,t);if(n!=null)return n}let n=K(e);if(n<0){let n=Ie(e);return n>=0?J(e,n,e[n],t):Re(e,t)}let r=e[n],i=w(r);return c(i)&&(H(i)||I(i))?q(e,n,r,i,t):J(e,n,r,t)}function Ve(e,t){if(c(e))return $(e,t);if(D(e))return O(e,t);let n=w(e);return n==null||n===!1||n===!0?t:c(n)?$(n,t):null}function Y(e,t){let n=_(e);if(n.length===1){let e=Ve(n[0],t);if(e!=null)return e}if(n.length===0||E(e).length===0)return t;if(c(t)){let e=ze(n,t);if(e!=null)return e}let r=Fe(n);if(r<0){let e=Ie(n);return e>=0?J(n,e,n[e],t):Re(n,t)}let i=n[r];if(D(i)){let e=[...n];return e[r]=O(i,t),e}let a=w(i);return c(a)&&(H(a)||I(a))?q(n,r,i,a,t):J(n,r,i,t)}function He(e,t,n){let r=w(e);if(Array.isArray(r)){let e=[];for(let t of r)e.push(...T(C(t)));return Z(a.createElement(a.Fragment,null,...e.length===0?[null]:e),t,n)}return c(r)?Z(r,t,n):t}function Ue(e,t,r){let i=F(e,r);if(i==null)return null;let a=h(i.parent),o=_(i.parent),s=[...o],l=o[i.slotIndex];return D(l)||!c(l)&&n(l)?s[i.slotIndex]=He(l,t,r):c(l)?s[i.slotIndex]=P(l,h(l),Y(l,t)):s[i.slotIndex]=t,qe(e,i.parent,P(i.parent,a,s))}function X(e,t,n,r,i){let a=[...n];return a[r]=i,P(e,t,a)}function We(e,t,n,r,i){for(let a=0;a<n.length;a+=1){let o=n[a];if(D(o)){if(!je(o))continue;return X(e,t,n,a,O(o,r))}let s=w(o);if(c(s)&&I(s))return X(e,t,n,a,Z(s,r,i))}return null}function Ge(e,t,n,r){for(let i=0;i<n.length;i+=1){let a=n[i];if(c(a)&&ye(a))return X(e,t,n,i,P(a,h(a),Y(a,r)))}return null}function Ke(e,t,n){let r=h(e),i=_(e);if(e.type===`main`||e.type===`MAIN`)return P(e,r,Y(e,t));if(i.length===1&&c(i[0]))return P(e,r,Z(i[0],t,n));if(i.length===1&&D(i[0]))return P(e,r,O(i[0],t));let a=i.findIndex(e=>{let t=G(e);return t!=null&&H(t)});if(a>=0){let o=i[a],s=w(o);return X(e,r,i,a,Z(c(s)?s:o,t,n))}return We(e,r,i,t,n)??Ge(e,r,i,t)??P(e,r,Y(e,t))}function Z(e,t,n){if(!c(e))return t;if(c(t)&&p(t)){let r=m(t);return Z(e,h(t).children,r??n)}if(n!=null&&n!==``){let r=Ue(e,t,n);if(r!=null)return r}return Ke(e,t,n)}function qe(e,t,n){if(e===t)return n;let r=h(e),i=_(e),a=[],o=!1;for(let e of i){if(!c(e)){a.push(e);continue}if(e===t){o=!0,a.push(n);continue}let r=qe(e,t,n);r!==e&&(o=!0),a.push(r)}return o?P(e,r,a):e}function Je(e,t){let n=h(e),r=_(e),i=_(t),a=r.find(e=>c(e)&&u(e)),o=i.find(e=>c(e)&&u(e)),s=r.find(e=>c(e)&&f(e)),l=i.find(e=>c(e)&&f(e)),d=c(a)&&c(o)?pe(a,o):c(a)?a:o,p=c(s)&&c(l)?$(s,l):c(s)?s:l,m=[];return d!=null&&m.push(d),p!=null&&m.push(p),P(e,n,m)}function Ye(e,t,n){let r=h(e),i=_(e),a=i.findIndex(e=>c(e)&&f(e)),o=a>=0?i[a]:void 0,s=c(o)?Z(o,t.children,n):Z(e,t.children,n);if(c(o)&&a>=0){let t=[...i];return t[a]=s,P(e,r,t)}return P(e,r,s)}function Q(e,t){let n=h(e),r=h(t),i=v(r.children);if(i.length===1&&c(i[0])&&p(i[0])){let t=i[0];return Z(e,h(t).children,m(t))}let a=ge(n.children,r.children);return a===r.children?t:y(t)?P(e,n,a):P(t,r,a)}function Xe(e,t){if(y(t))return Q(e,t);let n=_(e),r=_(t);return n.length!==r.length&&De(e)&&r.length>0?P(t,h(t),Y(e,j(r))):Q(e,t)}function $(e,t){if(e==null)return N(t);if(t==null)return e;if(!c(e)||!c(t))return t;if(p(t)){let n=h(t),r=m(t);return d(e)?Ye(e,n,r):Z(e,n.children,r)}return d(e)&&d(t)&&y(t)?Je(e,t):u(e)||u(t)?t:g(e,t)?Xe(e,t):e.type===t.type?Q(e,t):t}export{o as LAYOUT_REUSE_ELEMENT,s as LAYOUT_REUSE_PATH_PROP,p as isLayoutReuseMarker,$ as mergeFlightRefresh,Z as spliceLayoutReuseChildren,w as unwrapFulfilledFlightNode};
|
|
@@ -313,15 +313,15 @@ interface RouteParams {
|
|
|
313
313
|
interface SearchParams {
|
|
314
314
|
readonly [key: string]: string | readonly string[] | undefined;
|
|
315
315
|
}
|
|
316
|
-
|
|
317
|
-
params: TParams;
|
|
318
|
-
searchParams: TSearchParams;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
children: ReactNode;
|
|
322
|
-
params?: TParams;
|
|
323
|
-
pathname?: string;
|
|
324
|
-
}
|
|
316
|
+
interface PageProps<TParams extends RouteParams = RouteParams, TSearchParams extends SearchParams = SearchParams> {
|
|
317
|
+
readonly params: TParams;
|
|
318
|
+
readonly searchParams: TSearchParams;
|
|
319
|
+
}
|
|
320
|
+
interface LayoutProps<TParams extends RouteParams = RouteParams> {
|
|
321
|
+
readonly children: ReactNode;
|
|
322
|
+
readonly params?: TParams;
|
|
323
|
+
readonly pathname?: string;
|
|
324
|
+
}
|
|
325
325
|
interface ErrorProps {
|
|
326
326
|
readonly error: Error;
|
|
327
327
|
readonly reset: () => void;
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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-CkJ_86mo.mjs";
|
|
2
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-DAdRjhuk.mjs";
|
|
3
3
|
import { UserConfig } from "vite-plus";
|
|
4
4
|
import { ReactCompilerOptions as ReactCompilerOptions$1 } from "oxc-transform-react";
|