@useavalon/avalon 0.1.15 → 0.1.17

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/README.md CHANGED
@@ -1,54 +1,54 @@
1
- # @useavalon/avalon
2
-
3
- Core framework package for [Avalon](https://useavalon.dev) — a multi-framework islands architecture for the modern web.
4
-
5
- ## Features
6
-
7
- - Islands architecture with zero JavaScript by default
8
- - Multi-framework support (React, Preact, Vue, Svelte, Solid, Lit, Qwik)
9
- - Selective hydration (`on:client`, `on:visible`, `on:idle`, `on:interaction`)
10
- - File-system routing with nested layouts
11
- - API routes and middleware
12
- - MDX support with rehype/remark plugins
13
- - SSR with streaming support
14
- - Edge deployment via Nitro (Node, Deno, Bun, Cloudflare, Vercel, etc.)
15
- - Vite 8 powered with HMR
16
-
17
- ## Quick start
18
-
19
- ```bash
20
- npm create avalon@latest
21
- # or
22
- bun create avalon
23
- ```
24
-
25
- Or install manually:
26
-
27
- ```bash
28
- bun add @useavalon/avalon
29
- ```
30
-
31
- ## Usage
32
-
33
- ```tsx
34
- // pages/index.tsx
35
- import Counter from '../components/Counter.tsx';
36
-
37
- export default function Home() {
38
- return (
39
- <div>
40
- <h1>Hello Avalon</h1>
41
- <Counter island={{ condition: 'on:visible' }} />
42
- </div>
43
- );
44
- }
45
- ```
46
-
47
- ## Links
48
-
49
- - [Documentation](https://useavalon.dev/docs/introduction)
50
- - [GitHub](https://github.com/useAvalon/Avalon)
51
-
52
- ## License
53
-
54
- MIT
1
+ # @useavalon/avalon
2
+
3
+ Core framework package for [Avalon](https://useavalon.dev) — a multi-framework islands architecture for the modern web.
4
+
5
+ ## Features
6
+
7
+ - Islands architecture with zero JavaScript by default
8
+ - Multi-framework support (React, Preact, Vue, Svelte, Solid, Lit, Qwik)
9
+ - Selective hydration (`on:client`, `on:visible`, `on:idle`, `on:interaction`)
10
+ - File-system routing with nested layouts
11
+ - API routes and middleware
12
+ - MDX support with rehype/remark plugins
13
+ - SSR with streaming support
14
+ - Edge deployment via Nitro (Node, Deno, Bun, Cloudflare, Vercel, etc.)
15
+ - Vite 8 powered with HMR
16
+
17
+ ## Quick start
18
+
19
+ ```bash
20
+ npm create avalon@latest
21
+ # or
22
+ bun create avalon
23
+ ```
24
+
25
+ Or install manually:
26
+
27
+ ```bash
28
+ bun add @useavalon/avalon
29
+ ```
30
+
31
+ ## Usage
32
+
33
+ ```tsx
34
+ // pages/index.tsx
35
+ import Counter from '../components/Counter.tsx';
36
+
37
+ export default function Home() {
38
+ return (
39
+ <div>
40
+ <h1>Hello Avalon</h1>
41
+ <Counter island={{ condition: 'on:visible' }} />
42
+ </div>
43
+ );
44
+ }
45
+ ```
46
+
47
+ ## Links
48
+
49
+ - [Documentation](https://useavalon.dev/docs/introduction)
50
+ - [GitHub](https://github.com/useAvalon/Avalon)
51
+
52
+ ## License
53
+
54
+ MIT
@@ -0,0 +1 @@
1
+ import{BaseFrameworkAdapter as e}from"../framework-adapter.js";export class LitHMRAdapter extends e{name=`lit`;elementConstructors=new WeakMap;tagNames=new WeakMap;canHandle(e){if(!e)return!1;if(typeof e==`function`){let t=e;if(t.__litElement)return!0;try{let t=e.prototype;if(t){if(`render`in t&&`requestUpdate`in t&&`updateComplete`in t)return!0;let e=t;for(;e&&e!==Object.prototype;){let t=e.constructor;if(t&&t.name===`LitElement`)return!0;e=Object.getPrototypeOf(e)}}}catch{}if(t.elementName||t.tagName)return!0;try{let t=e.toString();if(t.includes(`LitElement`)||t.includes(`customElement`)||t.includes("html`")||t.includes("css`")||t.includes(`render()`)||t.includes(`requestUpdate`))return!0}catch{}}if(typeof e!=`object`)return!1;let t=e;return t.default&&typeof t.default==`function`?this.canHandle(t.default):!!t.__litElement}preserveState(e){try{let t=super.preserveState(e);if(!t)return null;let n=e.getAttribute(`data-props`),r=n?JSON.parse(n):{},i=e.getAttribute(`data-src`)||``,a=this.extractComponentName(i),o=e.getAttribute(`data-tag-name`)||this.tagNames.get(e),s=o?e.querySelector(o):e.querySelector(`[data-lit-element]`),c={},l={};if(s){for(let e in s)if(s.hasOwnProperty(e)&&!e.startsWith(`_`))try{let t=s[e];t!=null&&typeof t!=`function`&&typeof t!=`symbol`&&(c[e]=t)}catch{}for(let e=0;e<s.attributes.length;e++){let t=s.attributes[e];l[t.name]=t.value}}return{...t,framework:`lit`,data:{componentName:a,tagName:o||void 0,capturedProps:r,elementProperties:c,elementAttributes:l}}}catch(e){return console.warn(`Failed to preserve Lit state:`,e),null}}async update(e,t,n){if(!this.canHandle(t))throw Error(`Component is not a valid Lit component`);let r;if(typeof t==`object`&&t){let e=t;if(e.default&&typeof e.default==`function`)r=e.default;else throw Error(`Lit component object must have a default export`)}else if(typeof t==`function`)r=t;else throw Error(`Invalid Lit component type`);try{let t=e.getAttribute(`data-tag-name`);if(t||=r.elementName,t||=r.name.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),!t||!t.includes(`-`))throw Error(`Invalid custom element tag name: `+t);this.tagNames.set(e,t),e.setAttribute(`data-tag-name`,t);let i=Array.from(e.querySelectorAll(t));if(i.length===0){let i=customElements.get(t);i?i!==r&&await this.reregisterCustomElement(t,r):customElements.define(t,r);let a=document.createElement(t);Object.entries(n).forEach(([e,t])=>{try{a[e]=t}catch(t){console.warn(`Failed to set property ${e} on Lit element:`,t)}}),e.appendChild(a),this.elementConstructors.set(e,r),e.setAttribute(`data-hydrated`,`true`),e.setAttribute(`data-hydration-status`,`success`);return}let a=customElements.get(t);if(a&&a!==r){await this.reregisterCustomElement(t,r);for(let e of i){let n={},r={};for(let t in e)if(e.hasOwnProperty(t)&&!t.startsWith(`_`))try{let r=e[t];r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&(n[t]=r)}catch{}for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t];r[n.name]=n.value}let i=document.createElement(t);Object.entries(r).forEach(([e,t])=>{i.setAttribute(e,t)}),Object.entries(n).forEach(([e,t])=>{try{i[e]=t}catch(t){console.warn(`Failed to restore property ${e}:`,t)}}),e.parentNode?.replaceChild(i,e)}}else if(a)for(let e of i)Object.entries(n).forEach(([t,n])=>{try{e[t]=n}catch(e){console.warn(`Failed to update property ${t}:`,e)}}),e.requestUpdate&&e.requestUpdate();else{customElements.define(t,r);for(let e of i)e.requestUpdate&&e.requestUpdate()}this.elementConstructors.set(e,r),e.setAttribute(`data-hydrated`,`true`),e.setAttribute(`data-hydration-status`,`success`)}catch(t){throw console.error(`Lit HMR update failed:`,t),e.setAttribute(`data-hydration-status`,`error`),t}}async reregisterCustomElement(e,t){console.warn(`Custom element ${e} is already defined. Replacing all instances with new definition.`)}restoreState(e,t){try{super.restoreState(e,t);let n=t,r=n.data.tagName;if(r){let t=e.querySelector(r);t&&(n.data.elementProperties&&Object.entries(n.data.elementProperties).forEach(([e,n])=>{try{t[e]=n}catch(t){console.warn(`Failed to restore property ${e}:`,t)}}),n.data.elementAttributes&&Object.entries(n.data.elementAttributes).forEach(([e,n])=>{try{t.setAttribute(e,n)}catch(t){console.warn(`Failed to restore attribute ${e}:`,t)}}),t.requestUpdate&&t.requestUpdate())}}catch(e){console.warn(`Failed to restore Lit state:`,e)}}handleError(e,t){console.error(`Lit HMR error:`,t),super.handleError(e,t);let n=e.querySelector(`.hmr-error-indicator`);if(n){let e=t.message,r=``;e.includes(`custom element`)||e.includes(`define`)?r=` (Hint: Check that your element has a valid tag name with a hyphen)`:e.includes(`tag name`)?r=` (Hint: Custom element tag names must contain a hyphen)`:e.includes(`property`)||e.includes(`attribute`)?r=` (Hint: Check @property decorators and attribute names)`:e.includes(`render`)?r=` (Hint: Check the render() method for errors)`:e.includes(`shadow`)&&(r=` (Hint: Check Shadow DOM usage and styles)`),n.textContent=`Lit HMR Error: ${e}${r}`}}extractComponentName(e){let t=e.split(`/`);return t[t.length-1].replace(/\.lit\.(ts|js)$/,``).replace(/\.(ts|js)$/,``)}unmount(e){try{let t=this.tagNames.get(e);t&&(e.querySelectorAll(t).forEach(e=>{e.remove()}),this.tagNames.delete(e)),this.elementConstructors.delete(e)}catch(e){console.warn(`Failed to unmount Lit element:`,e)}}}export const litAdapter=new LitHMRAdapter;
@@ -0,0 +1 @@
1
+ import{BaseFrameworkAdapter as e}from"../framework-adapter.js";export class PreactHMRAdapter extends e{name=`preact`;instances=new WeakMap;canHandle(e){if(!e)return!1;if(typeof e==`function`){let t=e,n=e.prototype;return n&&n.isReactComponent||t.$typeof,!0}if(typeof e!=`object`)return!1;let t=e;return!!(t.$typeof||t.type&&typeof t.type==`function`)}preserveState(e){try{let t=super.preserveState(e);if(!t)return null;let n=e.getAttribute(`data-props`),r=n?JSON.parse(n):{},i=e.getAttribute(`data-src`)||``,a=this.extractComponentName(i);return{...t,framework:`preact`,data:{componentName:a,capturedProps:r}}}catch(e){return console.warn(`Failed to preserve Preact state:`,e),null}}async update(e,t,n){if(!this.canHandle(t))throw Error(`Component is not a valid Preact component`);let r=t;try{let{h:t,hydrate:i}=await import(`preact`);this.instances.get(e)?i(t(r,n),e):(i(t(r,n),e),this.instances.set(e,r)),e.setAttribute(`data-hydrated`,`true`),e.setAttribute(`data-hydration-status`,`success`)}catch(t){throw console.error(`Preact HMR update failed:`,t),e.setAttribute(`data-hydration-status`,`error`),t}}restoreState(e,t){try{super.restoreState(e,t)}catch(e){console.warn(`Failed to restore Preact state:`,e)}}handleError(e,t){console.error(`Preact HMR error:`,t),super.handleError(e,t);let n=e.querySelector(`.hmr-error-indicator`);if(n){let e=t.message,r=``;e.includes(`hooks`)?r=` (Hint: Check hooks usage - hooks must be called in the same order)`:e.includes(`render`)?r=` (Hint: Check component render method for errors)`:(e.includes(`hydration`)||e.includes(`hydrate`))&&(r=` (Hint: Server and client render must match)`),n.textContent=`Preact HMR Error: ${e}${r}`}}extractComponentName(e){let t=e.split(`/`);return t[t.length-1].replace(/\.(tsx?|jsx?)$/,``)}unmount(e){if(this.instances.get(e))try{this.instances.delete(e),e.innerHTML=``}catch(e){console.warn(`Failed to unmount Preact component:`,e)}}}export const preactAdapter=new PreactHMRAdapter;
@@ -0,0 +1 @@
1
+ import{BaseFrameworkAdapter as e}from"../framework-adapter.js";export class QwikHMRAdapter extends e{name=`qwik`;containers=new WeakMap;canHandle(e){if(!e)return!1;if(typeof e==`function`){let t=e;if(t.__brand===`QwikComponent`||t.__qrl||t.getSymbol||t.getHash)return!0;try{let t=e.toString();if(t.includes(`component$`)||t.includes(`qrl`)||t.includes(`useSignal`)||t.includes(`useStore`)||t.includes(`useTask$`)||t.includes(`useVisibleTask$`)||t.includes(`_qrl`)||t.includes(`qwik`))return!0}catch{}}if(typeof e==`object`&&e){let t=e;if(t.default&&typeof t.default==`function`)return this.canHandle(t.default);if(t.__qrl||t.__brand===`QwikComponent`)return!0}return!1}preserveState(e){try{let t=super.preserveState(e);if(!t)return null;let n=e.getAttribute(`data-props`),r=n?JSON.parse(n):{},i=e.getAttribute(`data-src`)||``,a=this.extractComponentName(i),o=e.closest(`[q\\:container]`)||e,s=o.querySelector(`script[type="qwik/json"]`)?.textContent||null,c={},l=o.attributes;if(l)for(let e=0;e<l.length;e++){let t=l[e];t.name.startsWith(`q:`)&&(c[t.name]=t.value)}return{...t,framework:`qwik`,data:{componentName:a,capturedProps:r,containerState:s,qContainerAttrs:c}}}catch(e){return console.warn(`Failed to preserve Qwik state:`,e),null}}async update(e,t,n){if(!this.canHandle(t))throw Error(`Component is not a valid Qwik component`);let r;if(typeof t==`object`&&t){let e=t;if(e.default&&typeof e.default==`function`)r=e.default;else throw Error(`Qwik component object must have a default export`)}else if(typeof t==`function`)r=t;else throw Error(`Invalid Qwik component type`);try{let t=this.containers.get(e);if(t?.cleanup)try{t.cleanup()}catch(e){console.warn(`Failed to clean up existing Qwik container:`,e)}let i=await import(`@builder.io/qwik`);if(i.render){let t=typeof i.jsx==`function`?i.jsx(r,n):r(n);await i.render(e,t)}else{console.warn(`Qwik render API not available, using innerHTML fallback`);let t=r(n);typeof t==`string`&&(e.innerHTML=t)}this.containers.set(e,{}),e.setAttribute(`data-hydrated`,`true`),e.setAttribute(`data-hydration-status`,`success`)}catch(t){throw console.error(`Qwik HMR update failed:`,t),e.setAttribute(`data-hydration-status`,`error`),t}}restoreState(e,t){try{super.restoreState(e,t)}catch(e){console.warn(`Failed to restore Qwik state:`,e)}}handleError(e,t){console.error(`Qwik HMR error:`,t),super.handleError(e,t);let n=e.querySelector(`.hmr-error-indicator`);if(n){let e=t.message,r=``;e.includes(`component$`)||e.includes(`component\\$`)?r=` (Hint: Ensure component is wrapped with component$())`:e.includes(`useSignal`)||e.includes(`useStore`)?r=` (Hint: Qwik hooks must be called inside component$() body)`:e.includes(`QRL`)||e.includes(`qrl`)?r=` (Hint: Check that lazy-loaded boundaries use $ correctly)`:e.includes(`serialize`)||e.includes(`container`)?r=` (Hint: Ensure all state is serializable — Qwik serializes state to the DOM)`:(e.includes(`resumable`)||e.includes(`resume`))&&(r=` (Hint: Server and client container state must match for resumability)`),n.textContent=`Qwik HMR Error: ${e}${r}`}}extractComponentName(e){let t=e.split(`/`);return t[t.length-1].replace(/\.qwik\.(tsx?|jsx?)$/,``).replace(/\.(tsx?|jsx?)$/,``)}unmount(e){let t=this.containers.get(e);if(t)try{t.cleanup&&t.cleanup(),this.containers.delete(e)}catch(e){console.warn(`Failed to unmount Qwik component:`,e)}}}export const qwikAdapter=new QwikHMRAdapter;
@@ -0,0 +1 @@
1
+ import{BaseFrameworkAdapter as e}from"../framework-adapter.js";export class ReactHMRAdapter extends e{name=`react`;roots=new WeakMap;canHandle(e){if(!e)return!1;if(typeof e==`function`){let t=e,n=e.prototype;return n&&n.isReactComponent||t.$$typeof,!0}if(typeof e!=`object`)return!1;let t=e;return!!(t.$$typeof||t.type&&typeof t.type==`function`)}preserveState(e){try{let t=super.preserveState(e);if(!t)return null;let n=e.getAttribute(`data-props`),r=n?JSON.parse(n):{},i=e.getAttribute(`data-src`)||``,a=this.extractComponentName(i);return{...t,framework:`react`,data:{componentName:a,capturedProps:r}}}catch(e){return console.warn(`Failed to preserve React state:`,e),null}}async update(e,t,n){if(!this.canHandle(t))throw Error(`Component is not a valid React component`);let r=t;try{let[t,i]=await Promise.all([import(`react`),import(`react-dom/client`)]),{createElement:a}=t,{hydrateRoot:o}=i,s=this.roots.get(e);if(s){let e=a(r,n);s.render(e)}else{let t=o(e,a(r,n),{onRecoverableError:e=>{console.warn(`React hydration recoverable error during HMR:`,e)}});this.roots.set(e,t)}e.setAttribute(`data-hydrated`,`true`),e.setAttribute(`data-hydration-status`,`success`)}catch(t){throw console.error(`React HMR update failed:`,t),e.setAttribute(`data-hydration-status`,`error`),t}}restoreState(e,t){try{super.restoreState(e,t)}catch(e){console.warn(`Failed to restore React state:`,e)}}handleError(e,t){console.error(`React HMR error:`,t),super.handleError(e,t);let n=e.querySelector(`.hmr-error-indicator`);if(n){let e=t.message,r=``;e.includes(`hooks`)?r=` (Hint: Check hooks usage - hooks must be called in the same order)`:e.includes(`render`)?r=` (Hint: Check component render method for errors)`:e.includes(`hydration`)&&(r=` (Hint: Server and client render must match)`),n.textContent=`React HMR Error: ${e}${r}`}}extractComponentName(e){let t=e.split(`/`);return t[t.length-1].replace(/\.(tsx?|jsx?)$/,``)}unmount(e){let t=this.roots.get(e);if(t)try{t.unmount(),this.roots.delete(e)}catch(e){console.warn(`Failed to unmount React root:`,e)}}}export const reactAdapter=new ReactHMRAdapter;
@@ -0,0 +1 @@
1
+ import{BaseFrameworkAdapter as e}from"../framework-adapter.js";export class SolidHMRAdapter extends e{name=`solid`;disposers=new WeakMap;componentIds=new WeakMap;canHandle(e){if(!e)return!1;if(typeof e==`function`){if(e.__solid)return!0;try{let t=e.toString();if(t.includes(`createSignal`)||t.includes(`createEffect`)||t.includes(`createMemo`)||t.includes(`createResource`)||t.includes(`createStore`)||t.includes(`_$`)||t.includes(`_tmpl$`))return!0}catch{}return!0}if(typeof e!=`object`)return!1;let t=e;return t.default&&typeof t.default==`function`?this.canHandle(t.default):!!t.__solid}preserveState(e){try{let t=super.preserveState(e);if(!t)return null;let n=e.getAttribute(`data-props`),r=n?JSON.parse(n):{},i=e.getAttribute(`data-src`)||``,a=this.extractComponentName(i),o=e.dataset.solidRenderId||e.dataset.renderId;return{...t,framework:`solid`,data:{componentName:a,capturedProps:r,renderId:o}}}catch(e){return console.warn(`Failed to preserve Solid state:`,e),null}}async update(e,t,n){if(!this.canHandle(t))throw Error(`Component is not a valid Solid component`);let r;if(typeof t==`object`&&t){let e=t;if(e.default&&typeof e.default==`function`)r=e.default;else throw Error(`Solid component object must have a default export`)}else if(typeof t==`function`)r=t;else throw Error(`Invalid Solid component type`);try{let t=this.disposers.get(e),i=this.componentIds.get(e),a=globalThis.__SOLID_HMR__;if(a&&i)try{if(a.reload(i,r),t)return}catch(e){console.warn(`Solid HMR runtime reload failed, falling back to full remount:`,e)}if(t)try{t(),this.disposers.delete(e)}catch(e){console.warn(`Failed to dispose existing Solid component:`,e)}let{hydrate:o,createComponent:s}=await import(`solid-js/web`),c=o(()=>s(r,n),e,{renderId:e.dataset.solidRenderId||e.dataset.renderId});this.disposers.set(e,c);let l=e.getAttribute(`data-src`)||``,u=this.generateComponentId(l);if(this.componentIds.set(e,u),a)try{a.createRecord(u,r)}catch(e){console.warn(`Failed to register with Solid HMR runtime:`,e)}e.setAttribute(`data-hydrated`,`true`),e.setAttribute(`data-hydration-status`,`success`)}catch(t){throw console.error(`Solid HMR update failed:`,t),e.setAttribute(`data-hydration-status`,`error`),t}}restoreState(e,t){try{super.restoreState(e,t)}catch(e){console.warn(`Failed to restore Solid state:`,e)}}handleError(e,t){console.error(`Solid HMR error:`,t),super.handleError(e,t);let n=e.querySelector(`.hmr-error-indicator`);if(n){let e=t.message,r=``;e.includes(`signal`)||e.includes(`Signal`)?r=` (Hint: Check signal usage - signals must be called as functions)`:e.includes(`effect`)||e.includes(`Effect`)?r=` (Hint: Check effect usage - effects run after render)`:e.includes(`hydration`)||e.includes(`hydrate`)?r=` (Hint: Server and client render must match)`:e.includes(`createSignal`)||e.includes(`createEffect`)?r=` (Hint: Solid primitives must be called inside component functions)`:e.includes(`reactive`)&&(r=` (Hint: Check reactive dependencies - they must be accessed inside tracking scopes)`),n.textContent=`Solid HMR Error: ${e}${r}`}}extractComponentName(e){let t=e.split(`/`);return t[t.length-1].replace(/\.solid\.(tsx?|jsx?)$/,``).replace(/\.(tsx?|jsx?)$/,``)}generateComponentId(e){return e.replace(/[^a-zA-Z0-9]/g,`_`)}unmount(e){let t=this.disposers.get(e);if(t)try{t(),this.disposers.delete(e),this.componentIds.delete(e)}catch(e){console.warn(`Failed to unmount Solid component:`,e)}}}export const solidAdapter=new SolidHMRAdapter;
@@ -0,0 +1 @@
1
+ import{BaseFrameworkAdapter as e}from"../framework-adapter.js";export class SvelteHMRAdapter extends e{name=`svelte`;instances=new WeakMap;componentIds=new WeakMap;storeSubscriptions=new WeakMap;isSvelteFunction(e){if(e.$$render)return!0;let t=e.prototype;if(t&&(t.$set&&t.$destroy||t.$$))return!0;try{let t=e.toString();if(t.includes(`$set`)||t.includes(`$destroy`)||t.includes(`$$`))return!0}catch{}return!1}canHandle(e){if(!e)return!1;if(typeof e==`function`)return this.isSvelteFunction(e);if(typeof e!=`object`)return!1;let t=e;return t.default&&typeof t.default==`function`?this.canHandle(t.default):t.$$render!==void 0}preserveState(e){try{let t=super.preserveState(e);if(!t)return null;let n=e.dataset.props,r=n?JSON.parse(n):{},i=e.dataset.src||``,a=this.extractComponentName(i),o=this.captureLocalState(e),s=this.captureStoreValues(e);return{...t,framework:`svelte`,data:{componentName:a,capturedProps:r,localState:o,storeValues:s}}}catch(e){return console.warn(`Failed to preserve Svelte state:`,e),null}}extractComponent(e){if(typeof e==`object`&&e){let t=e;if(t.default&&typeof t.default==`function`)return t.default;throw Error(`Svelte component object must have a default export`)}if(typeof e==`function`)return e;throw TypeError(`Invalid Svelte component type`)}async cleanupInstance(e,t){try{let n=this.storeSubscriptions.get(e);n&&(n.forEach(e=>e()),this.storeSubscriptions.delete(e));let r=(await import(`svelte`)).unmount;r?r(t):t.$destroy&&t.$destroy()}catch{t.$destroy&&t.$destroy()}}async mountComponent(e,t,n){try{let r=(await import(`svelte`)).mount;return r?r(e,{target:t,props:n}):new e({target:t,props:n,hydrate:!1,intro:!1})}catch(r){return console.debug(`Svelte 5 API not available, using constructor API:`,r),new e({target:t,props:n,hydrate:!1,intro:!1})}}async update(e,t,n){if(!this.canHandle(t))throw Error(`Component is not a valid Svelte component`);let r=this.extractComponent(t);try{let t=this.instances.get(e);t&&await this.cleanupInstance(e,t).catch(e=>{console.warn(`Failed to destroy existing Svelte instance:`,e)}),e.innerHTML=``;let i=await this.mountComponent(r,e,n);this.instances.set(e,i);let a=e.dataset.src||``;this.componentIds.set(e,this.generateComponentId(a)),e.dataset.hydrated=`true`,e.dataset.hydrationStatus=`success`}catch(t){throw console.error(`Svelte HMR update failed:`,t),e.dataset.hydrationStatus=`error`,t}}restoreState(e,t){try{super.restoreState(e,t)}catch(e){console.warn(`Failed to restore Svelte state:`,e)}}handleError(e,t){console.error(`Svelte HMR error:`,t),super.handleError(e,t);let n=e.querySelector(`.hmr-error-indicator`);if(n){let e=t.message,r=``;e.includes(`$:`)||e.includes(`reactive`)?r=` (Hint: Check reactive statements ($:) - they must be at component top level)`:e.includes(`store`)?r=` (Hint: Check store usage - stores must be imported and subscribed correctly)`:e.includes(`hydration`)||e.includes(`hydrate`)?r=` (Hint: Server and client render must match)`:e.includes(`target`)?r=` (Hint: Check component target - it must be a valid DOM element)`:e.includes(`props`)&&(r=` (Hint: Check component props - they must match the component definition)`),n.textContent=`Svelte HMR Error: ${e}${r}`}}extractComponentName(e){return(e.split(`/`).at(-1)??``).replace(/\.svelte$/,``)}detectSSRContent(e){let t=e.textContent&&e.textContent.trim().length>0,n=e.children&&e.children.length>0,r=e.dataset.ssrContent!==void 0||e.dataset.svelteRendered!==void 0;return t||n||r}generateComponentId(e){return e.replaceAll(/[^a-zA-Z0-9]/g,`_`)}captureLocalState(e){try{let t=this.instances.get(e);if(!t)return;let n=t.$$;return n?.ctx?{ctx:n.ctx,props:n.props,bound:n.bound}:void 0}catch(e){console.debug(`Could not capture Svelte local state:`,e);return}}captureStoreValues(e){}async unmount(e){let t=this.instances.get(e);if(t)try{await this.cleanupInstance(e,t),this.instances.delete(e),this.componentIds.delete(e)}catch(e){console.warn(`Failed to unmount Svelte component:`,e)}}}export const svelteAdapter=new SvelteHMRAdapter;
@@ -0,0 +1 @@
1
+ import{BaseFrameworkAdapter as e}from"../framework-adapter.js";export class VueHMRAdapter extends e{name=`vue`;apps=new WeakMap;componentIds=new WeakMap;canHandle(e){if(!e)return!1;if(typeof e==`function`)return!0;if(typeof e!=`object`)return!1;let t=e;return`setup`in t||`data`in t||`render`in t||`template`in t||`props`in t||`computed`in t||`methods`in t||`components`in t||`emits`in t||`mounted`in t||`created`in t||`beforeMount`in t||`beforeCreate`in t||`__vccOpts`in t}preserveState(e){try{let t=super.preserveState(e);if(!t)return null;let n=e.getAttribute(`data-props`),r=n?JSON.parse(n):{},i=e.getAttribute(`data-src`)||``,a=this.extractComponentName(i),o=this.captureReactiveData(e);return{...t,framework:`vue`,data:{componentName:a,capturedProps:r,reactiveData:o}}}catch(e){return console.warn(`Failed to preserve Vue state:`,e),null}}async update(e,t,n){if(!this.canHandle(t))throw Error(`Component is not a valid Vue component`);let r=t;try{let{createApp:t}=await import(`vue`),i=this.apps.get(e),a=this.componentIds.get(e),o=globalThis.__VUE_HMR_RUNTIME__;if(o&&a)try{if(o.reload(a,r),i)return}catch(e){console.warn(`Vue HMR runtime reload failed, falling back to full remount:`,e)}if(i)try{i.unmount()}catch(e){console.warn(`Failed to unmount existing Vue app:`,e)}let s=t(r,n);s.config.errorHandler=(e,t,n)=>{console.error(`Vue component error during HMR:`,e,n)},s.mount(e,!0),this.apps.set(e,s);let c=e.getAttribute(`data-src`)||``,l=this.generateComponentId(c);this.componentIds.set(e,l),o&&o.createRecord(l,r),e.setAttribute(`data-hydrated`,`true`),e.setAttribute(`data-hydration-status`,`success`)}catch(t){throw console.error(`Vue HMR update failed:`,t),e.setAttribute(`data-hydration-status`,`error`),t}}restoreState(e,t){try{super.restoreState(e,t)}catch(e){console.warn(`Failed to restore Vue state:`,e)}}handleError(e,t){console.error(`Vue HMR error:`,t),super.handleError(e,t);let n=e.querySelector(`.hmr-error-indicator`);if(n){let e=t.message,r=``;e.includes(`reactive`)||e.includes(`ref`)?r=` (Hint: Check reactive state usage - refs must be accessed with .value)`:e.includes(`render`)?r=` (Hint: Check component render function or template for errors)`:e.includes(`hydration`)||e.includes(`mismatch`)?r=` (Hint: Server and client render must match)`:e.includes(`setup`)&&(r=` (Hint: Check setup function - it should return render function or object)`),n.textContent=`Vue HMR Error: ${e}${r}`}}extractComponentName(e){let t=e.split(`/`);return t[t.length-1].replace(/\.(vue|tsx?|jsx?)$/,``)}generateComponentId(e){return e.replace(/[^a-zA-Z0-9]/g,`_`)}captureReactiveData(e){try{let t=e.__vueParentComponent;if(t&&typeof t==`object`){let e=t.data;if(e&&typeof e==`object`)return{...e}}}catch(e){console.debug(`Could not capture Vue reactive data:`,e)}}unmount(e){let t=this.apps.get(e);if(t)try{t.unmount(),this.apps.delete(e),this.componentIds.delete(e)}catch(e){console.warn(`Failed to unmount Vue app:`,e)}}}export const vueAdapter=new VueHMRAdapter;
@@ -1 +1 @@
1
- export{PersistentIsland}from"../components/PersistentIsland.js";export{usePersistentIslandContext,PersistentIslandProvider,createPersistentIslandContext}from"../core/islands/persistent-island-context.js";export{usePersistentState}from"../core/islands/use-persistent-state.js";export{IslandPersistence,defaultIslandPersistence}from"../core/islands/island-persistence.js";export{IslandStateSerializer}from"../core/islands/island-state-serializer.js";export{IslandErrorBoundary,withIslandErrorBoundary}from"../components/IslandErrorBoundary.js";export{LayoutErrorBoundary}from"../components/LayoutErrorBoundary.js";export{LayoutDataErrorBoundary}from"../components/LayoutDataErrorBoundary.js";export{StreamingErrorBoundary,withStreamingErrorBoundary}from"../components/StreamingErrorBoundary.js";export{StreamingLayout,StreamingSuspense,withStreaming,useStreamingState}from"../components/StreamingLayout.js";export{Image}from"../components/Image.js";
1
+ export{PersistentIsland}from"../components/PersistentIsland.tsx";export{usePersistentIslandContext,PersistentIslandProvider,createPersistentIslandContext}from"../core/islands/persistent-island-context.tsx";export{usePersistentState}from"../core/islands/use-persistent-state.js";export{IslandPersistence,defaultIslandPersistence}from"../core/islands/island-persistence.js";export{IslandStateSerializer}from"../core/islands/island-state-serializer.js";export{IslandErrorBoundary,withIslandErrorBoundary}from"../components/IslandErrorBoundary.tsx";export{LayoutErrorBoundary}from"../components/LayoutErrorBoundary.tsx";export{LayoutDataErrorBoundary}from"../components/LayoutDataErrorBoundary.tsx";export{StreamingErrorBoundary,withStreamingErrorBoundary}from"../components/StreamingErrorBoundary.tsx";export{StreamingLayout,StreamingSuspense,withStreaming,useStreamingState}from"../components/StreamingLayout.tsx";export{Image}from"../components/Image.tsx";
@@ -1,4 +1,4 @@
1
- document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,e):e();function e(){let e=document.querySelectorAll(`[data-framework]`);e.length!==0&&e.forEach(e=>{try{let o=e.dataset.framework,s=e.dataset.condition||`on:client`;if(e.dataset.renderStrategy===`ssr-only`||!t(e,s))return;s===`on:client`?c(e,o):s===`on:visible`?n(e,o):s===`on:interaction`?r(e,o):s===`on:idle`?i(e,o):s.startsWith(`media:`)?a(e,o,s.slice(6)):c(e,o)}catch(t){console.error(`Error processing island:`,t),l(e,e.dataset.framework||`unknown`,e.dataset.src||`unknown`,t)}})}function t(e,t){if(!t||t===`on:client`)return!0;if(t.startsWith(`media:`)){let e=t.slice(6);try{return globalThis.matchMedia(e).matches}catch(t){return console.error(`Invalid media query:`,e,t),!0}}return t===`on:visible`||t===`on:interaction`||t===`on:idle`||console.warn(`Unknown hydration condition:`,t),!0}function n(e,t){try{let n=new IntersectionObserver(r=>{r[0].isIntersecting&&(c(e,t),n.disconnect())},{rootMargin:`50px`,threshold:0});n.observe(e)}catch(n){console.error(`Failed to setup intersection observer:`,n),c(e,t)}}function r(e,t){let n=[`click`,`touchstart`,`mouseenter`,`focusin`],r=!1,i=()=>{r||(r=!0,n.forEach(t=>{e.removeEventListener(t,i)}),c(e,t))};try{n.forEach(t=>{e.addEventListener(t,i,{once:!0,passive:!0})})}catch(n){console.error(`Failed to setup interaction observer:`,n),c(e,t)}}function i(e,t){try{`requestIdleCallback`in globalThis?globalThis.requestIdleCallback(()=>{c(e,t)},{timeout:5e3}):document.readyState===`complete`?setTimeout(()=>{c(e,t)},200):globalThis.addEventListener(`load`,()=>{setTimeout(()=>{c(e,t)},200)},{once:!0})}catch(n){console.error(`Failed to setup idle callback:`,n),c(e,t)}}function a(e,t,n){try{let r=globalThis.matchMedia(n);if(r.matches){c(e,t);return}let i=n=>{n.matches&&(c(e,t),r.removeEventListener(`change`,i))};r.addEventListener(`change`,i)}catch(r){console.error(`Failed to setup media query:`,n,r),c(e,t)}}async function o(e){switch(e){case`preact`:return import(`/@useavalon/preact/client`);case`react`:return import(`/@useavalon/react/client`);case`vue`:return import(`/@useavalon/vue/client`);case`svelte`:return import(`/@useavalon/svelte/client`);case`solid`:return import(`/@useavalon/solid/client`);case`lit`:return import(`/@useavalon/lit/client`);case`qwik`:return import(`/@useavalon/qwik/client`);default:throw Error(`Unknown framework: ${e}`)}}function s(e,t){let n=e.default;if(!n){let t=Object.keys(e).filter(e=>e!==`default`);for(let r of t){let t=e[r];if(typeof t==`function`&&t.prototype){n=t;break}}n||=e}if(!n)throw Error(`Component ${t} has no default export`);return n}async function c(e,t){if(e.dataset.hydrated)return;let n=e.dataset.src,r=e.dataset.props;if(!n){console.warn(`Island missing data-src attribute`);return}try{let i=r?JSON.parse(r):{};t===`lit`&&await import(`/@useavalon/lit/client`);let a=s(await import(n),n);try{let n=await o(t);if(!n.hydrate||typeof n.hydrate!=`function`)throw Error(`Integration ${t} does not export a hydrate function`);n.hydrate(e,a,i),e.dataset.hydrated=`true`}catch(r){import.meta.env?.DEV&&console.error(`Integration hydration failed for ${t}: ${n}`,r),e.dataset.hydrationStatus=`failed`,e.dataset.hydrationError=r.message,e.dispatchEvent(new CustomEvent(`hydration-error`,{detail:{framework:t,src:n,error:r.message,timestamp:Date.now(),hydrationType:`integration-level`},bubbles:!0}))}}catch(r){console.error(`❌ Critical error hydrating ${t} island ${n}:`,r),l(e,t,n,r)}}function l(e,t,n,r){console.error(`Hydration error for ${t} island:`,{src:n,error:r.message,stack:r.stack}),e.dataset.hydrationStatus=`failed`,e.dataset.renderStrategy=`ssr-only`,e.classList.add(`hydration-failed`),e.dispatchEvent(new CustomEvent(`hydration-error`,{detail:{framework:t,src:n,error:r.message,timestamp:Date.now()},bubbles:!0})),d()&&u(e,t,n,r)}function u(e,t,n,r){let i=document.createElement(`div`);i.className=`hydration-error-indicator`,i.style.cssText=`
1
+ document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,e):e();function e(){let e=document.querySelectorAll(`[data-framework]`);e.length!==0&&e.forEach(e=>{try{let o=e.dataset.framework,s=e.dataset.condition||`on:client`;if(e.dataset.renderStrategy===`ssr-only`||!t(e,s))return;s===`on:client`?c(e,o):s===`on:visible`?n(e,o):s===`on:interaction`?r(e,o):s===`on:idle`?i(e,o):s.startsWith(`media:`)?a(e,o,s.slice(6)):c(e,o)}catch(t){console.error(`Error processing island:`,t),l(e,e.dataset.framework||`unknown`,e.dataset.src||`unknown`,t)}})}function t(e,t){if(!t||t===`on:client`)return!0;if(t.startsWith(`media:`)){let e=t.slice(6);try{return globalThis.matchMedia(e).matches}catch(t){return console.error(`Invalid media query:`,e,t),!0}}return t===`on:visible`||t===`on:interaction`||t===`on:idle`||console.warn(`Unknown hydration condition:`,t),!0}function n(e,t){try{let n=new IntersectionObserver(r=>{r[0].isIntersecting&&(c(e,t),n.disconnect())},{rootMargin:`50px`,threshold:0});n.observe(e)}catch(n){console.error(`Failed to setup intersection observer:`,n),c(e,t)}}function r(e,t){let n=[`click`,`touchstart`,`mouseenter`,`focusin`],r=!1,i=()=>{r||(r=!0,n.forEach(t=>{e.removeEventListener(t,i)}),c(e,t))};try{n.forEach(t=>{e.addEventListener(t,i,{once:!0,passive:!0})})}catch(n){console.error(`Failed to setup interaction observer:`,n),c(e,t)}}function i(e,t){try{`requestIdleCallback`in globalThis?globalThis.requestIdleCallback(()=>{c(e,t)},{timeout:5e3}):document.readyState===`complete`?setTimeout(()=>{c(e,t)},200):globalThis.addEventListener(`load`,()=>{setTimeout(()=>{c(e,t)},200)},{once:!0})}catch(n){console.error(`Failed to setup idle callback:`,n),c(e,t)}}function a(e,t,n){try{let r=globalThis.matchMedia(n);if(r.matches){c(e,t);return}let i=n=>{n.matches&&(c(e,t),r.removeEventListener(`change`,i))};r.addEventListener(`change`,i)}catch(r){console.error(`Failed to setup media query:`,n,r),c(e,t)}}async function o(e){if(![`preact`,`react`,`vue`,`svelte`,`solid`,`lit`,`qwik`].includes(e))throw Error(`Unknown framework: ${e}`);return import(`/@useavalon/${e}/client`)}function s(e,t){let n=e.default;if(!n){let t=Object.keys(e).filter(e=>e!==`default`);for(let r of t){let t=e[r];if(typeof t==`function`&&t.prototype){n=t;break}}n||=e}if(!n)throw Error(`Component ${t} has no default export`);return n}async function c(e,t){if(e.dataset.hydrated)return;let n=e.dataset.src,r=e.dataset.props;if(!n){console.warn(`Island missing data-src attribute`);return}try{let i=r?JSON.parse(r):{};t===`lit`&&await import(`/@useavalon/lit/client`);let a=s(await import(n),n);try{let n=await o(t);if(!n.hydrate||typeof n.hydrate!=`function`)throw Error(`Integration ${t} does not export a hydrate function`);n.hydrate(e,a,i),e.dataset.hydrated=`true`}catch(r){import.meta.env?.DEV&&console.error(`Integration hydration failed for ${t}: ${n}`,r),e.dataset.hydrationStatus=`failed`,e.dataset.hydrationError=r.message,e.dispatchEvent(new CustomEvent(`hydration-error`,{detail:{framework:t,src:n,error:r.message,timestamp:Date.now(),hydrationType:`integration-level`},bubbles:!0}))}}catch(r){console.error(`❌ Critical error hydrating ${t} island ${n}:`,r),l(e,t,n,r)}}function l(e,t,n,r){console.error(`Hydration error for ${t} island:`,{src:n,error:r.message,stack:r.stack}),e.dataset.hydrationStatus=`failed`,e.dataset.renderStrategy=`ssr-only`,e.classList.add(`hydration-failed`),e.dispatchEvent(new CustomEvent(`hydration-error`,{detail:{framework:t,src:n,error:r.message,timestamp:Date.now()},bubbles:!0})),d()&&u(e,t,n,r)}function u(e,t,n,r){let i=document.createElement(`div`);i.className=`hydration-error-indicator`,i.style.cssText=`
2
2
  position: absolute;
3
3
  top: 0;
4
4
  right: 0;
@@ -36,4 +36,4 @@ document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,e):
36
36
  cursor: pointer;
37
37
  font-size: 14px;
38
38
  line-height: 1;
39
- `,c.onclick=()=>a.remove(),a.appendChild(o),a.appendChild(s),a.appendChild(c),globalThis.getComputedStyle(e).position===`static`&&(e.style.position=`relative`),e.insertBefore(a,e.firstChild)}import.meta.hot&&(import.meta.hot.accept(),import(`./hmr-coordinator.js`).then(async({initializeHMR:e,getHMRCoordinator:t})=>{e();let n=t(),r=new Set;document.querySelectorAll(`[data-framework]`).forEach(e=>{let t=e.dataset.framework;t&&r.add(t)});let i={react:()=>import(`/@useavalon/react/client/hmr`).then(e=>e.reactAdapter),preact:()=>import(`/@useavalon/preact/client/hmr`).then(e=>e.preactAdapter),vue:()=>import(`/@useavalon/vue/client/hmr`).then(e=>e.vueAdapter),svelte:()=>import(`/@useavalon/svelte/client/hmr`).then(e=>e.svelteAdapter),solid:()=>import(`/@useavalon/solid/client/hmr`).then(e=>e.solidAdapter),lit:()=>import(`/@useavalon/lit/client/hmr`).then(e=>e.litAdapter),qwik:()=>import(`/@useavalon/qwik/client/hmr`).then(e=>e.qwikAdapter)};for(let e of r){let t=i[e];if(t)try{let r=await t();n.registerAdapter(e,r)}catch(t){console.warn(`[HMR] Failed to load adapter for ${e}:`,t)}}}).catch(e=>{console.error(`[HMR] Failed to initialize:`,e)}),_());async function g(e,t,n,r){try{let{showHMRErrorOverlay:e}=await import(`./hmr-error-overlay.js`);e({framework:t,src:n,error:r,filePath:n})}catch{h(e,t,n,r)}}function _(){if(!import.meta.hot)return;let e=new Map;async function t(e){let t=e.replaceAll(`\\`,`/`),r=document.querySelectorAll(`[data-src*="${t}"], [data-src$="${t}"]`);if(r.length===0){let e=document.querySelectorAll(`[data-src]`);for(let r of e){let e=r.dataset.src;e&&(e.includes(t)||t.includes(e.replace(/^\//,``)))&&await n(r)}return}for(let e of r)await n(e)}async function n(t){let n=t.dataset.framework,r=t.dataset.src;if(!(!r||!n))try{let i=f(t);e.set(r,i),delete t.dataset.hydrated,delete t.dataset.hydrationStatus;let a=t.querySelector(`.hydration-error-indicator`);a&&a.remove();let o=Date.now();await m(t,n,r.includes(`?`)?`${r}&t=${o}`:`${r}?t=${o}`,r);let s=e.get(r);s&&(p(t,s),e.delete(r)),t.dispatchEvent(new CustomEvent(`hmr-update`,{detail:{framework:n,src:r,timestamp:Date.now(),success:!0},bubbles:!0}))}catch(e){console.error(`[HMR] Failed for ${n} island ${r}:`,e),t.dispatchEvent(new CustomEvent(`hmr-error`,{detail:{framework:n,src:r,error:e.message,timestamp:Date.now()},bubbles:!0})),d()&&g(t,n,r,e)}}import.meta.hot.on(`vite:beforeUpdate`,e=>{for(let n of e.updates||[]){let e=n.path||n.acceptedPath;e&&(e.includes(`/islands/`)||e.includes(`\\islands\\`))&&t(e)}}),import.meta.hot.on(`vite:beforeFullReload`,()=>{let e=document.querySelectorAll(`[data-hydrated="true"]`),t={};for(let n of e){let e=n.dataset.src;e&&(t[e]=f(n))}try{sessionStorage.setItem(`__avalon_hmr_states__`,JSON.stringify(t))}catch{}});try{let e=sessionStorage.getItem(`__avalon_hmr_states__`);if(e){let t=JSON.parse(e);sessionStorage.removeItem(`__avalon_hmr_states__`),setTimeout(()=>{for(let[e,n]of Object.entries(t)){let t=document.querySelector(`[data-src="${e}"]`);t&&n&&p(t,n)}},100)}}catch{}}
39
+ `,c.onclick=()=>a.remove(),a.appendChild(o),a.appendChild(s),a.appendChild(c),globalThis.getComputedStyle(e).position===`static`&&(e.style.position=`relative`),e.insertBefore(a,e.firstChild)}import.meta.hot&&(import.meta.hot.accept(),import(`./hmr-coordinator.js`).then(async({initializeHMR:e,getHMRCoordinator:t})=>{e();let n=t(),r=new Set;document.querySelectorAll(`[data-framework]`).forEach(e=>{let t=e.dataset.framework;t&&r.add(t)});let i=e=>import(`/@useavalon/${e}/client/hmr`).then(t=>t[`${e}Adapter`]),a={react:()=>i(`react`),preact:()=>i(`preact`),vue:()=>i(`vue`),svelte:()=>i(`svelte`),solid:()=>i(`solid`),lit:()=>i(`lit`),qwik:()=>i(`qwik`)};for(let e of r){let t=a[e];if(t)try{let r=await t();n.registerAdapter(e,r)}catch(t){console.warn(`[HMR] Failed to load adapter for ${e}:`,t)}}}).catch(e=>{console.error(`[HMR] Failed to initialize:`,e)}),_());async function g(e,t,n,r){try{let{showHMRErrorOverlay:e}=await import(`./hmr-error-overlay.js`);e({framework:t,src:n,error:r,filePath:n})}catch{h(e,t,n,r)}}function _(){if(!import.meta.hot)return;let e=new Map;async function t(e){let t=e.replaceAll(`\\`,`/`),r=document.querySelectorAll(`[data-src*="${t}"], [data-src$="${t}"]`);if(r.length===0){let e=document.querySelectorAll(`[data-src]`);for(let r of e){let e=r.dataset.src;e&&(e.includes(t)||t.includes(e.replace(/^\//,``)))&&await n(r)}return}for(let e of r)await n(e)}async function n(t){let n=t.dataset.framework,r=t.dataset.src;if(!(!r||!n))try{let i=f(t);e.set(r,i),delete t.dataset.hydrated,delete t.dataset.hydrationStatus;let a=t.querySelector(`.hydration-error-indicator`);a&&a.remove();let o=Date.now();await m(t,n,r.includes(`?`)?`${r}&t=${o}`:`${r}?t=${o}`,r);let s=e.get(r);s&&(p(t,s),e.delete(r)),t.dispatchEvent(new CustomEvent(`hmr-update`,{detail:{framework:n,src:r,timestamp:Date.now(),success:!0},bubbles:!0}))}catch(e){console.error(`[HMR] Failed for ${n} island ${r}:`,e),t.dispatchEvent(new CustomEvent(`hmr-error`,{detail:{framework:n,src:r,error:e.message,timestamp:Date.now()},bubbles:!0})),d()&&g(t,n,r,e)}}import.meta.hot.on(`vite:beforeUpdate`,e=>{for(let n of e.updates||[]){let e=n.path||n.acceptedPath;e&&(e.includes(`/islands/`)||e.includes(`\\islands\\`))&&t(e)}}),import.meta.hot.on(`vite:beforeFullReload`,()=>{let e=document.querySelectorAll(`[data-hydrated="true"]`),t={};for(let n of e){let e=n.dataset.src;e&&(t[e]=f(n))}try{sessionStorage.setItem(`__avalon_hmr_states__`,JSON.stringify(t))}catch{}});try{let e=sessionStorage.getItem(`__avalon_hmr_states__`);if(e){let t=JSON.parse(e);sessionStorage.removeItem(`__avalon_hmr_states__`),setTimeout(()=>{for(let[e,n]of Object.entries(t)){let t=document.querySelector(`[data-src="${e}"]`);t&&n&&p(t,n)}},100)}}catch{}}
@@ -1,68 +1,68 @@
1
- /**
2
- * Type declarations for framework runtime imports
3
- *
4
- * These are dynamic imports that are resolved by Vite at runtime in the browser.
5
- * The actual packages are provided by the user's project dependencies.
6
- */
7
-
8
- declare module 'react' {
9
- export function createElement<P = Record<string, unknown>>(
10
- component: unknown,
11
- props: P | null,
12
- ...children: unknown[]
13
- ): unknown;
14
- export const version: string;
15
- }
16
-
17
- declare module 'react-dom/client' {
18
- export interface Root {
19
- render(element: unknown): void;
20
- unmount(): void;
21
- }
22
-
23
- export function hydrateRoot(
24
- container: HTMLElement,
25
- element: unknown,
26
- options?: {
27
- onRecoverableError?: (error: Error) => void;
28
- }
29
- ): Root;
30
-
31
- export function createRoot(container: HTMLElement): Root;
32
- }
33
-
34
- declare module 'vue' {
35
- export interface App {
36
- mount(rootContainer: HTMLElement | string, isHydrate?: boolean): unknown;
37
- unmount(): void;
38
- use(plugin: unknown, ...options: unknown[]): App;
39
- component(name: string, component: unknown): App;
40
- directive(name: string, directive: unknown): App;
41
- provide(key: string | symbol, value: unknown): App;
42
- config: {
43
- errorHandler?: (err: Error, instance: unknown, info: string) => void;
44
- warnHandler?: (msg: string, instance: unknown, trace: string) => void;
45
- };
46
- }
47
-
48
- export function createApp(rootComponent: unknown, rootProps?: Record<string, unknown>): App;
49
- export const version: string;
50
- }
51
-
52
-
53
- declare module 'svelte' {
54
- export interface SvelteComponent {
55
- new (options: {
56
- target: HTMLElement;
57
- props?: Record<string, unknown>;
58
- hydrate?: boolean;
59
- intro?: boolean;
60
- anchor?: Element | null;
61
- context?: Map<unknown, unknown>;
62
- }): {
63
- $set(props: Record<string, unknown>): void;
64
- $destroy(): void;
65
- $on?(event: string, handler: (...args: unknown[]) => void): () => void;
66
- };
67
- }
68
- }
1
+ /**
2
+ * Type declarations for framework runtime imports
3
+ *
4
+ * These are dynamic imports that are resolved by Vite at runtime in the browser.
5
+ * The actual packages are provided by the user's project dependencies.
6
+ */
7
+
8
+ declare module 'react' {
9
+ export function createElement<P = Record<string, unknown>>(
10
+ component: unknown,
11
+ props: P | null,
12
+ ...children: unknown[]
13
+ ): unknown;
14
+ export const version: string;
15
+ }
16
+
17
+ declare module 'react-dom/client' {
18
+ export interface Root {
19
+ render(element: unknown): void;
20
+ unmount(): void;
21
+ }
22
+
23
+ export function hydrateRoot(
24
+ container: HTMLElement,
25
+ element: unknown,
26
+ options?: {
27
+ onRecoverableError?: (error: Error) => void;
28
+ }
29
+ ): Root;
30
+
31
+ export function createRoot(container: HTMLElement): Root;
32
+ }
33
+
34
+ declare module 'vue' {
35
+ export interface App {
36
+ mount(rootContainer: HTMLElement | string, isHydrate?: boolean): unknown;
37
+ unmount(): void;
38
+ use(plugin: unknown, ...options: unknown[]): App;
39
+ component(name: string, component: unknown): App;
40
+ directive(name: string, directive: unknown): App;
41
+ provide(key: string | symbol, value: unknown): App;
42
+ config: {
43
+ errorHandler?: (err: Error, instance: unknown, info: string) => void;
44
+ warnHandler?: (msg: string, instance: unknown, trace: string) => void;
45
+ };
46
+ }
47
+
48
+ export function createApp(rootComponent: unknown, rootProps?: Record<string, unknown>): App;
49
+ export const version: string;
50
+ }
51
+
52
+
53
+ declare module 'svelte' {
54
+ export interface SvelteComponent {
55
+ new (options: {
56
+ target: HTMLElement;
57
+ props?: Record<string, unknown>;
58
+ hydrate?: boolean;
59
+ intro?: boolean;
60
+ anchor?: Element | null;
61
+ context?: Map<unknown, unknown>;
62
+ }): {
63
+ $set(props: Record<string, unknown>): void;
64
+ $destroy(): void;
65
+ $on?(event: string, handler: (...args: unknown[]) => void): () => void;
66
+ };
67
+ }
68
+ }
@@ -1,46 +1,46 @@
1
- /**
2
- * Type definitions for Vite HMR API
3
- */
4
-
5
- declare module 'vite/types/hmrPayload' {
6
- export interface HMRPayload {
7
- type: 'update' | 'full-reload' | 'prune' | 'error' | 'connected' | 'custom';
8
- updates?: Update[];
9
- timestamp?: number;
10
- path?: string;
11
- err?: Error;
12
- data?: unknown;
13
- event?: string;
14
- }
15
-
16
- export interface Update {
17
- type: 'js-update' | 'css-update';
18
- path: string;
19
- acceptedPath: string;
20
- timestamp: number;
21
- explicitImportRequired?: boolean;
22
- }
23
- }
24
-
25
- declare global {
26
- interface ImportMeta {
27
- hot?: {
28
- accept(): void;
29
- accept(cb: (mod: unknown) => void): void;
30
- accept(dep: string, cb: (mod: unknown) => void): void;
31
- accept(deps: readonly string[], cb: (mods: unknown[]) => void): void;
32
-
33
- dispose(cb: (data: unknown) => void): void;
34
- decline(): void;
35
- invalidate(): void;
36
-
37
- on(event: string, cb: (payload: unknown) => void): void;
38
- off(event: string, cb: (payload: unknown) => void): void;
39
- send(event: string, data?: unknown): void;
40
-
41
- data: unknown;
42
- };
43
- }
44
- }
45
-
46
- export {};
1
+ /**
2
+ * Type definitions for Vite HMR API
3
+ */
4
+
5
+ declare module 'vite/types/hmrPayload' {
6
+ export interface HMRPayload {
7
+ type: 'update' | 'full-reload' | 'prune' | 'error' | 'connected' | 'custom';
8
+ updates?: Update[];
9
+ timestamp?: number;
10
+ path?: string;
11
+ err?: Error;
12
+ data?: unknown;
13
+ event?: string;
14
+ }
15
+
16
+ export interface Update {
17
+ type: 'js-update' | 'css-update';
18
+ path: string;
19
+ acceptedPath: string;
20
+ timestamp: number;
21
+ explicitImportRequired?: boolean;
22
+ }
23
+ }
24
+
25
+ declare global {
26
+ interface ImportMeta {
27
+ hot?: {
28
+ accept(): void;
29
+ accept(cb: (mod: unknown) => void): void;
30
+ accept(dep: string, cb: (mod: unknown) => void): void;
31
+ accept(deps: readonly string[], cb: (mods: unknown[]) => void): void;
32
+
33
+ dispose(cb: (data: unknown) => void): void;
34
+ decline(): void;
35
+ invalidate(): void;
36
+
37
+ on(event: string, cb: (payload: unknown) => void): void;
38
+ off(event: string, cb: (payload: unknown) => void): void;
39
+ send(event: string, data?: unknown): void;
40
+
41
+ data: unknown;
42
+ };
43
+ }
44
+ }
45
+
46
+ export {};
@@ -1,70 +1,70 @@
1
- /**
2
- * Type declarations for Vite virtual modules
3
- *
4
- * These modules are resolved by Vite at runtime in the browser.
5
- * They don't exist as actual files but are provided by Vite's plugin system.
6
- */
7
-
8
- declare module '/@useavalon/preact/client' {
9
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
10
- export function getHydrationScript(): string;
11
- }
12
-
13
- declare module '/@useavalon/react/client' {
14
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
15
- export function getHydrationScript(): string;
16
- }
17
-
18
- declare module '/@useavalon/vue/client' {
19
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
20
- export function getHydrationScript(): string;
21
- }
22
-
23
- declare module '/@useavalon/svelte/client' {
24
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
25
- export function getHydrationScript(): string;
26
- }
27
-
28
- declare module '/@useavalon/solid/client' {
29
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
30
- export function getHydrationScript(): string;
31
- }
32
-
33
- declare module '/@useavalon/lit/client' {
34
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
35
- export function getHydrationScript(): string;
36
- }
37
-
38
- declare module '/@useavalon/qwik/client' {
39
- export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
40
- export function getHydrationScript(): string;
41
- }
42
-
43
- // HMR adapter virtual modules
44
- declare module '/@useavalon/react/client/hmr' {
45
- export { reactAdapter } from '@useavalon/react/client/hmr';
46
- }
47
-
48
- declare module '/@useavalon/preact/client/hmr' {
49
- export { preactAdapter } from '@useavalon/preact/client/hmr';
50
- }
51
-
52
- declare module '/@useavalon/vue/client/hmr' {
53
- export { vueAdapter } from '@useavalon/vue/client/hmr';
54
- }
55
-
56
- declare module '/@useavalon/svelte/client/hmr' {
57
- export { svelteAdapter } from '@useavalon/svelte/client/hmr';
58
- }
59
-
60
- declare module '/@useavalon/solid/client/hmr' {
61
- export { solidAdapter } from '@useavalon/solid/client/hmr';
62
- }
63
-
64
- declare module '/@useavalon/lit/client/hmr' {
65
- export { litAdapter } from '@useavalon/lit/client/hmr';
66
- }
67
-
68
- declare module '/@useavalon/qwik/client/hmr' {
69
- export { qwikAdapter } from '@useavalon/qwik/client/hmr';
70
- }
1
+ /**
2
+ * Type declarations for Vite virtual modules
3
+ *
4
+ * These modules are resolved by Vite at runtime in the browser.
5
+ * They don't exist as actual files but are provided by Vite's plugin system.
6
+ */
7
+
8
+ declare module '/@useavalon/preact/client' {
9
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
10
+ export function getHydrationScript(): string;
11
+ }
12
+
13
+ declare module '/@useavalon/react/client' {
14
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
15
+ export function getHydrationScript(): string;
16
+ }
17
+
18
+ declare module '/@useavalon/vue/client' {
19
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
20
+ export function getHydrationScript(): string;
21
+ }
22
+
23
+ declare module '/@useavalon/svelte/client' {
24
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
25
+ export function getHydrationScript(): string;
26
+ }
27
+
28
+ declare module '/@useavalon/solid/client' {
29
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
30
+ export function getHydrationScript(): string;
31
+ }
32
+
33
+ declare module '/@useavalon/lit/client' {
34
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
35
+ export function getHydrationScript(): string;
36
+ }
37
+
38
+ declare module '/@useavalon/qwik/client' {
39
+ export function hydrate(container: Element, component: unknown, props?: Record<string, unknown>): void;
40
+ export function getHydrationScript(): string;
41
+ }
42
+
43
+ // HMR adapter virtual modules
44
+ declare module '/@useavalon/react/client/hmr' {
45
+ export { reactAdapter } from '@useavalon/react/client/hmr';
46
+ }
47
+
48
+ declare module '/@useavalon/preact/client/hmr' {
49
+ export { preactAdapter } from '@useavalon/preact/client/hmr';
50
+ }
51
+
52
+ declare module '/@useavalon/vue/client/hmr' {
53
+ export { vueAdapter } from '@useavalon/vue/client/hmr';
54
+ }
55
+
56
+ declare module '/@useavalon/svelte/client/hmr' {
57
+ export { svelteAdapter } from '@useavalon/svelte/client/hmr';
58
+ }
59
+
60
+ declare module '/@useavalon/solid/client/hmr' {
61
+ export { solidAdapter } from '@useavalon/solid/client/hmr';
62
+ }
63
+
64
+ declare module '/@useavalon/lit/client/hmr' {
65
+ export { litAdapter } from '@useavalon/lit/client/hmr';
66
+ }
67
+
68
+ declare module '/@useavalon/qwik/client/hmr' {
69
+ export { qwikAdapter } from '@useavalon/qwik/client/hmr';
70
+ }
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";function t(e){return/\s\d+w/.test(e)}export function Image({src:n,alt:r,sizes:i,loading:a=`lazy`,decoding:o=`async`,width:s,height:c,className:l,style:u}){let d,f,p,m;return typeof n==`object`&&n?(d=n.src,f=n.srcset,p=n.width,m=n.height):typeof n==`string`&&(t(n)?(f=n,d=n.split(`,`)[0]?.trim().split(` `)[0]):d=n),e(`img`,{src:d,srcSet:f,sizes:i,alt:r,loading:a,decoding:o,width:s??p,height:c??m,className:l,style:u})}export default Image;
1
+ import{jsx as e}from"preact/jsx-runtime";function t(e){return/\s\d+w/.test(e)}export function Image({src:n,alt:r,sizes:i,loading:a=`lazy`,decoding:o=`async`,width:s,height:c,className:l,style:u}){let d,f,p,m;return typeof n==`object`&&n?(d=n.src,f=n.srcset,p=n.width,m=n.height):typeof n==`string`&&(t(n)?(f=n,d=n.split(`,`)[0]?.trim().split(` `)[0]):d=n),e(`img`,{src:d,srcSet:f,sizes:i,alt:r,loading:a,decoding:o,width:s??p,height:c??m,className:l,style:u})}export default Image;
@@ -1 +1 @@
1
- import{Component as e}from"preact";import{jsx as t,jsxs as n}from"react/jsx-runtime";export class IslandErrorBoundary extends e{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){let n={layoutPath:`island:${this.props.islandId}`,errorType:`island`,timestamp:Date.now(),componentStack:t.componentStack,errorBoundary:`IslandErrorBoundary`};if(this.setState({errorInfo:n}),this.props.onError&&this.props.onError(e,n),typeof Deno<`u`&&Deno.env.get(`NODE_ENV`)===`development`&&console.error(`Island Error [${this.props.islandId}]:`,e),!this.props.isolateError)throw e}handleRemoveIsland=()=>{let e=document.querySelector(`[data-island-id="${this.props.islandId}"]`);e&&e.remove()};handleReloadIsland=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};renderFallback(){let{error:e}=this.state,{fallback:r,islandId:i}=this.props;if(r&&e)return r(e,i);let a=typeof Deno<`u`&&Deno.env.get(`NODE_ENV`)===`development`;return t(`div`,{class:`island-error-boundary`,"data-island-error":i,children:n(`div`,{class:`island-error-container`,children:[n(`div`,{class:`island-error-header`,children:[t(`span`,{class:`island-error-icon`,children:`⚠️`}),t(`span`,{class:`island-error-title`,children:`Island Error`})]}),n(`p`,{class:`island-error-message`,children:[`An error occurred in island "`,i,`". The rest of the page should work normally.`]}),n(`div`,{class:`island-error-actions`,children:[t(`button`,{onClick:this.handleReloadIsland,class:`island-reload-button`,children:`Reload Island`}),t(`button`,{onClick:this.handleRemoveIsland,class:`island-remove-button`,children:`Remove Island`})]}),a&&e&&n(`details`,{class:`island-error-details`,children:[t(`summary`,{children:`Error Details (Development)`}),n(`div`,{class:`island-error-info`,children:[n(`p`,{children:[t(`strong`,{children:`Island ID:`}),` `,i]}),n(`p`,{children:[t(`strong`,{children:`Error:`}),` `,e.message]})]}),t(`pre`,{class:`island-error-stack`,children:e.stack})]})]})})}render(){return this.state.hasError?this.renderFallback():this.props.children}}export function withIslandErrorBoundary(e,n,i){return function(a){return t(IslandErrorBoundary,{islandId:n,fallback:i?.fallback,isolateError:i?.isolateError??!0,onError:i?.onError,children:t(e,{...a})})}}
1
+ import{Component as e}from"preact";import{jsx as t,jsxs as n}from"preact/jsx-runtime";export class IslandErrorBoundary extends e{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){let n={layoutPath:`island:${this.props.islandId}`,errorType:`island`,timestamp:Date.now(),componentStack:t.componentStack,errorBoundary:`IslandErrorBoundary`};if(this.setState({errorInfo:n}),this.props.onError&&this.props.onError(e,n),typeof Deno<`u`&&Deno.env.get(`NODE_ENV`)===`development`&&console.error(`Island Error [${this.props.islandId}]:`,e),!this.props.isolateError)throw e}handleRemoveIsland=()=>{let e=document.querySelector(`[data-island-id="${this.props.islandId}"]`);e&&e.remove()};handleReloadIsland=()=>{this.setState({hasError:!1,error:null,errorInfo:null})};renderFallback(){let{error:e}=this.state,{fallback:r,islandId:i}=this.props;if(r&&e)return r(e,i);let a=typeof Deno<`u`&&Deno.env.get(`NODE_ENV`)===`development`;return t(`div`,{class:`island-error-boundary`,"data-island-error":i,children:n(`div`,{class:`island-error-container`,children:[n(`div`,{class:`island-error-header`,children:[t(`span`,{class:`island-error-icon`,children:`⚠️`}),t(`span`,{class:`island-error-title`,children:`Island Error`})]}),n(`p`,{class:`island-error-message`,children:[`An error occurred in island "`,i,`". The rest of the page should work normally.`]}),n(`div`,{class:`island-error-actions`,children:[t(`button`,{onClick:this.handleReloadIsland,class:`island-reload-button`,children:`Reload Island`}),t(`button`,{onClick:this.handleRemoveIsland,class:`island-remove-button`,children:`Remove Island`})]}),a&&e&&n(`details`,{class:`island-error-details`,children:[t(`summary`,{children:`Error Details (Development)`}),n(`div`,{class:`island-error-info`,children:[n(`p`,{children:[t(`strong`,{children:`Island ID:`}),` `,i]}),n(`p`,{children:[t(`strong`,{children:`Error:`}),` `,e.message]})]}),t(`pre`,{class:`island-error-stack`,children:e.stack})]})]})})}render(){return this.state.hasError?this.renderFallback():this.props.children}}export function withIslandErrorBoundary(e,n,i){return function(a){return t(IslandErrorBoundary,{islandId:n,fallback:i?.fallback,isolateError:i?.isolateError??!0,onError:i?.onError,children:t(e,{...a})})}}
@@ -1 +1 @@
1
- import{Component as e}from"preact";import{jsx as t,jsxs as n}from"react/jsx-runtime";export class LayoutDataErrorBoundary extends e{maxRetries=3;constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null,retryCount:0,isRetrying:!1,fallbackData:e.fallbackData||null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){let n={layoutPath:this.props.layoutPath,errorType:`loader`,timestamp:Date.now(),componentStack:t.componentStack,errorBoundary:`LayoutDataErrorBoundary`};this.setState({errorInfo:n}),this.props.onError&&this.props.onError(e,n)}handleRetry=async()=>{if(!(this.state.retryCount>=this.maxRetries||!this.props.retryLoader)){this.setState({isRetrying:!0});try{let e=await this.props.retryLoader();this.setState({hasError:!1,error:null,errorInfo:null,retryCount:this.state.retryCount+1,isRetrying:!1,fallbackData:e})}catch(e){this.setState({retryCount:this.state.retryCount+1,isRetrying:!1,error:e instanceof Error?e:Error(String(e))})}}};handleUseFallback=()=>{this.state.fallbackData&&this.setState({hasError:!1,error:null,errorInfo:null})};renderErrorUI(){let{error:e,retryCount:r,isRetrying:i,fallbackData:a}=this.state,o=r<this.maxRetries&&this.props.retryLoader,s=a!==null,c=typeof Deno<`u`&&Deno.env.get(`NODE_ENV`)===`development`;return t(`div`,{class:`layout-data-error-boundary`,children:n(`div`,{class:`error-container`,children:[t(`h3`,{children:`Data Loading Error`}),n(`p`,{children:[`Failed to load data for layout: `,this.props.layoutPath]}),n(`div`,{class:`error-actions`,children:[o&&t(`button`,{onClick:this.handleRetry,disabled:i,class:`retry-button`,children:i?`Retrying...`:`Retry (${this.maxRetries-r} left)`}),s&&t(`button`,{onClick:this.handleUseFallback,class:`fallback-button`,children:`Use Cached Data`})]}),c&&e&&n(`details`,{class:`error-details`,children:[t(`summary`,{children:`Error Details (Development)`}),n(`div`,{class:`error-info`,children:[n(`p`,{children:[t(`strong`,{children:`Error:`}),` `,e.message]}),n(`p`,{children:[t(`strong`,{children:`Layout:`}),` `,this.props.layoutPath]}),n(`p`,{children:[t(`strong`,{children:`Retry Count:`}),` `,r]})]}),t(`pre`,{class:`error-stack`,children:e.stack})]})]})})}render(){return this.state.hasError?this.renderErrorUI():this.props.children}}
1
+ import{Component as e}from"preact";import{jsx as t,jsxs as n}from"preact/jsx-runtime";export class LayoutDataErrorBoundary extends e{maxRetries=3;constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null,retryCount:0,isRetrying:!1,fallbackData:e.fallbackData||null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){let n={layoutPath:this.props.layoutPath,errorType:`loader`,timestamp:Date.now(),componentStack:t.componentStack,errorBoundary:`LayoutDataErrorBoundary`};this.setState({errorInfo:n}),this.props.onError&&this.props.onError(e,n)}handleRetry=async()=>{if(!(this.state.retryCount>=this.maxRetries||!this.props.retryLoader)){this.setState({isRetrying:!0});try{let e=await this.props.retryLoader();this.setState({hasError:!1,error:null,errorInfo:null,retryCount:this.state.retryCount+1,isRetrying:!1,fallbackData:e})}catch(e){this.setState({retryCount:this.state.retryCount+1,isRetrying:!1,error:e instanceof Error?e:Error(String(e))})}}};handleUseFallback=()=>{this.state.fallbackData&&this.setState({hasError:!1,error:null,errorInfo:null})};renderErrorUI(){let{error:e,retryCount:r,isRetrying:i,fallbackData:a}=this.state,o=r<this.maxRetries&&this.props.retryLoader,s=a!==null,c=typeof Deno<`u`&&Deno.env.get(`NODE_ENV`)===`development`;return t(`div`,{class:`layout-data-error-boundary`,children:n(`div`,{class:`error-container`,children:[t(`h3`,{children:`Data Loading Error`}),n(`p`,{children:[`Failed to load data for layout: `,this.props.layoutPath]}),n(`div`,{class:`error-actions`,children:[o&&t(`button`,{onClick:this.handleRetry,disabled:i,class:`retry-button`,children:i?`Retrying...`:`Retry (${this.maxRetries-r} left)`}),s&&t(`button`,{onClick:this.handleUseFallback,class:`fallback-button`,children:`Use Cached Data`})]}),c&&e&&n(`details`,{class:`error-details`,children:[t(`summary`,{children:`Error Details (Development)`}),n(`div`,{class:`error-info`,children:[n(`p`,{children:[t(`strong`,{children:`Error:`}),` `,e.message]}),n(`p`,{children:[t(`strong`,{children:`Layout:`}),` `,this.props.layoutPath]}),n(`p`,{children:[t(`strong`,{children:`Retry Count:`}),` `,r]})]}),t(`pre`,{class:`error-stack`,children:e.stack})]})]})})}render(){return this.state.hasError?this.renderErrorUI():this.props.children}}