@fluixi/core 1.0.0-alpha.82 → 1.0.0-alpha.84
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/cdn/core.global.js +2 -1
- package/dist/cli/generate.cjs +4117 -292
- package/dist/cli/generate.mjs +4122 -292
- package/dist/cli/index.cjs +4117 -292
- package/dist/cli/index.mjs +4122 -292
- package/dist/cli/run.cjs +63 -1
- package/dist/cli/run.mjs +39 -1
- package/dist/src/cdn/chunk-VNLCQBFQ.mjs +747 -0
- package/dist/src/cdn/core.cjs +1279 -1
- package/dist/src/cdn/core.d.ts +3 -3
- package/dist/src/cdn/core.js +3 -3
- package/dist/src/cdn/core.mjs +642 -1
- package/dist/src/cdn/router-WMN2AA7E.mjs +66 -0
- package/dist/src/index.cjs +1201 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -11
- package/dist/src/index.mjs +1313 -1
- package/dist/src/jsx-dev-runtime.cjs +26 -1
- package/dist/src/jsx-dev-runtime.mjs +24 -1
- package/dist/src/jsx-runtime.cjs +26 -1
- package/dist/src/jsx-runtime.js +0 -9
- package/dist/src/jsx-runtime.mjs +24 -1
- package/dist/src/lib/client/chunk-2C2KDDQV.mjs +133 -0
- package/dist/src/lib/client/index.cjs +870 -1
- package/dist/src/lib/client/index.d.ts +10 -14
- package/dist/src/lib/client/index.d.ts.map +1 -1
- package/dist/src/lib/client/index.js +36 -21
- package/dist/src/lib/client/index.mjs +222 -1
- package/dist/src/lib/client/router-X526HSWQ.mjs +548 -0
- package/dist/src/lib/context/context.cjs +118 -1
- package/dist/src/lib/context/context.d.ts +20 -38
- package/dist/src/lib/context/context.d.ts.map +1 -1
- package/dist/src/lib/context/context.js +10 -47
- package/dist/src/lib/context/context.mjs +99 -1
- package/dist/src/lib/context/index.cjs +120 -1
- package/dist/src/lib/context/index.mjs +99 -1
- package/dist/src/lib/control-flow.cjs +35 -1
- package/dist/src/lib/control-flow.mjs +25 -1
- package/dist/src/lib/core.cjs +1200 -1
- package/dist/src/lib/core.d.ts +0 -2
- package/dist/src/lib/core.d.ts.map +1 -1
- package/dist/src/lib/core.js +14 -48
- package/dist/src/lib/core.mjs +1313 -1
- package/dist/src/lib/env/index.cjs +60 -1
- package/dist/src/lib/env/index.d.ts +7 -8
- package/dist/src/lib/env/index.d.ts.map +1 -1
- package/dist/src/lib/env/index.js +14 -9
- package/dist/src/lib/env/index.mjs +39 -1
- package/dist/src/lib/i18n/index.cjs +108 -1
- package/dist/src/lib/i18n/index.d.ts +31 -10
- package/dist/src/lib/i18n/index.d.ts.map +1 -1
- package/dist/src/lib/i18n/index.js +31 -10
- package/dist/src/lib/i18n/index.mjs +88 -1
- package/dist/src/lib/index.cjs +633 -1
- package/dist/src/lib/index.d.ts +0 -2
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +5 -11
- package/dist/src/lib/index.mjs +721 -1
- package/dist/src/lib/isomorphic.cjs +85 -1
- package/dist/src/lib/isomorphic.d.ts +41 -8
- package/dist/src/lib/isomorphic.d.ts.map +1 -1
- package/dist/src/lib/isomorphic.js +38 -5
- package/dist/src/lib/isomorphic.mjs +64 -1
- package/dist/src/lib/jsx-runtime/index.cjs +21 -1
- package/dist/src/lib/jsx-runtime/index.d.ts +1 -1
- package/dist/src/lib/jsx-runtime/index.js +1 -11
- package/dist/src/lib/jsx-runtime/index.mjs +4 -1
- package/dist/src/lib/jsx-runtime/jsx-dev-runtime.cjs +21 -1
- package/dist/src/lib/jsx-runtime/jsx-dev-runtime.mjs +4 -1
- package/dist/src/lib/plugins/fluixi-routes-plugin.cjs +302 -8
- package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts +15 -1
- package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts.map +1 -1
- package/dist/src/lib/plugins/fluixi-routes-plugin.js +19 -5
- package/dist/src/lib/plugins/fluixi-routes-plugin.mjs +271 -8
- package/dist/src/lib/plugins/index.cjs +311 -8
- package/dist/src/lib/plugins/index.mjs +279 -8
- package/dist/src/lib/plugins/route-codegen.cjs +73 -8
- package/dist/src/lib/plugins/route-codegen.d.ts +0 -1
- package/dist/src/lib/plugins/route-codegen.d.ts.map +1 -1
- package/dist/src/lib/plugins/route-codegen.js +4 -5
- package/dist/src/lib/plugins/route-codegen.mjs +52 -8
- package/dist/src/lib/plugins/route-scanner.cjs +189 -1
- package/dist/src/lib/plugins/route-scanner.d.ts +1 -2
- package/dist/src/lib/plugins/route-scanner.d.ts.map +1 -1
- package/dist/src/lib/plugins/route-scanner.js +7 -8
- package/dist/src/lib/plugins/route-scanner.mjs +158 -1
- package/dist/src/lib/plugins/vite.cjs +27 -1
- package/dist/src/lib/plugins/vite.mjs +6 -1
- package/dist/src/lib/render/await.cjs +38 -1
- package/dist/src/lib/render/await.d.ts +18 -0
- package/dist/src/lib/render/await.d.ts.map +1 -1
- package/dist/src/lib/render/await.js +20 -2
- package/dist/src/lib/render/await.mjs +17 -1
- package/dist/src/lib/render/component.cjs +221 -1
- package/dist/src/lib/render/component.d.ts +3 -44
- package/dist/src/lib/render/component.d.ts.map +1 -1
- package/dist/src/lib/render/component.js +32 -59
- package/dist/src/lib/render/component.mjs +214 -1
- package/dist/src/lib/render/deferred.cjs +175 -1
- package/dist/src/lib/render/deferred.d.ts.map +1 -1
- package/dist/src/lib/render/deferred.js +8 -8
- package/dist/src/lib/render/deferred.mjs +158 -1
- package/dist/src/lib/render/index.cjs +573 -1
- package/dist/src/lib/render/index.d.ts +3 -17
- package/dist/src/lib/render/index.d.ts.map +1 -1
- package/dist/src/lib/render/index.js +12 -26
- package/dist/src/lib/render/index.mjs +590 -1
- package/dist/src/lib/render/lazy.cjs +67 -1
- package/dist/src/lib/render/lazy.d.ts +22 -1
- package/dist/src/lib/render/lazy.d.ts.map +1 -1
- package/dist/src/lib/render/lazy.js +47 -8
- package/dist/src/lib/render/lazy.mjs +50 -1
- package/dist/src/lib/render/suspense.cjs +141 -1
- package/dist/src/lib/render/suspense.d.ts +40 -0
- package/dist/src/lib/render/suspense.d.ts.map +1 -1
- package/dist/src/lib/render/suspense.js +47 -7
- package/dist/src/lib/render/suspense.mjs +136 -1
- package/dist/src/lib/render/versions.cjs +35 -1
- package/dist/src/lib/render/versions.js +6 -6
- package/dist/src/lib/render/versions.mjs +14 -1
- package/dist/src/lib/router/data.cjs +230 -1
- package/dist/src/lib/router/data.d.ts +1 -13
- package/dist/src/lib/router/data.d.ts.map +1 -1
- package/dist/src/lib/router/data.js +1 -13
- package/dist/src/lib/router/data.mjs +214 -1
- package/dist/src/lib/router/index.cjs +627 -1
- package/dist/src/lib/router/index.d.ts +62 -10
- package/dist/src/lib/router/index.d.ts.map +1 -1
- package/dist/src/lib/router/index.js +90 -39
- package/dist/src/lib/router/index.mjs +639 -1
- package/dist/src/lib/server/hydration.cjs +169 -1
- package/dist/src/lib/server/hydration.d.ts +15 -55
- package/dist/src/lib/server/hydration.d.ts.map +1 -1
- package/dist/src/lib/server/hydration.js +23 -62
- package/dist/src/lib/server/hydration.mjs +148 -1
- package/dist/src/lib/server/index.cjs +401 -11
- package/dist/src/lib/server/index.d.ts +30 -6
- package/dist/src/lib/server/index.d.ts.map +1 -1
- package/dist/src/lib/server/index.js +34 -11
- package/dist/src/lib/server/index.mjs +379 -11
- package/dist/src/lib/server/reactive.cjs +197 -1
- package/dist/src/lib/server/reactive.d.ts +18 -77
- package/dist/src/lib/server/reactive.d.ts.map +1 -1
- package/dist/src/lib/server/reactive.js +19 -78
- package/dist/src/lib/server/reactive.mjs +176 -1
- package/dist/src/lib/theme/index.cjs +110 -1
- package/dist/src/lib/theme/index.d.ts +19 -4
- package/dist/src/lib/theme/index.d.ts.map +1 -1
- package/dist/src/lib/theme/index.js +17 -2
- package/dist/src/lib/theme/index.mjs +89 -1
- package/dist/src/lib/utils/index.cjs +209 -1
- package/dist/src/lib/utils/index.d.ts +0 -93
- package/dist/src/lib/utils/index.d.ts.map +1 -1
- package/dist/src/lib/utils/index.js +0 -93
- package/dist/src/lib/utils/index.mjs +188 -1
- package/dist/src/routes.cjs +37 -1
- package/dist/src/routes.d.ts +1 -1
- package/dist/src/routes.js +2 -2
- package/dist/src/routes.mjs +17 -1
- package/dist/src/server.cjs +400 -11
- package/dist/src/server.d.ts +0 -1
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +0 -1
- package/dist/src/server.mjs +377 -11
- package/dist/src/utils.cjs +21 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.js +1 -1
- package/dist/src/utils.mjs +4 -1
- package/dist/src/version.generated.cjs +26 -1
- package/dist/src/version.generated.d.ts +1 -1
- package/dist/src/version.generated.js +2 -2
- package/dist/src/version.generated.mjs +5 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +17 -16
- package/src/index.ts +2 -14
- package/dist/src/cdn/chunk-RN7C7HNS.mjs +0 -1
- package/dist/src/cdn/router-QB3W43UQ.mjs +0 -1
- package/dist/src/lib/client/chunk-FT22BLCQ.mjs +0 -1
- package/dist/src/lib/client/router-IH7JYMRU.mjs +0 -1
package/dist/src/index.mjs
CHANGED
|
@@ -1 +1,1313 @@
|
|
|
1
|
-
var E="1.0.0-alpha.82";import{signal as wo,memo as Po,effect as Ro,resource as Ao,createEffect as Zt,createMemo as en,createSignal as tn,createResource as ko,createRoot as nn,createComputed as rn,createRenderEffect as on,onCleanup as sn,getOwner as an,runWithOwner as cn,batch as un,untrack as dn,createDeferred as ln,setOwner as fn}from"@fluixi/reactive/signal";import{createDebounce as Lo,createDebouncedResource as Eo,createDebouncedSignal as Mo,createSelector as pn}from"@fluixi/reactive/signal";import{readSignal as mn,reduceSignal as yn}from"@fluixi/reactive/operators";import{createRoot as at}from"@fluixi/reactive/signal";import{registerCoreVersion as Ie}from"@fluixi/dom";import{stampVersions as J,warnOnVersionSkew as B,versions as wn}from"@fluixi/dom";Ie(E);import{isDOMNode as ct,delegateEvents as Te,insert as ut}from"@fluixi/dom";import{createComponent as Ne,asComponent as Fe}from"@fluixi/dom";import{untrack as X,onCleanup as g,getOwner as D,createEffect as b,createMemo as Y,createSignal as _e,isSignal as Ve,batch as je,runWithOwner as G,isOwnerDisposed as Ke}from"@fluixi/reactive/signal";var M=Symbol.for("fluixi-lifecycle");function Q(){let e=D();if(!e)return null;if(!e[M]){let t={mounts:[],effects:[],scheduled:!1};e[M]=t}return e[M]}var Z=typeof window>"u";function ee(e){if(e.scheduled)return;if(Z){e.mounts=[],e.effects=[];return}e.scheduled=!0;let t=D();queueMicrotask(()=>{if(Ke(t)){e.mounts=[],e.effects=[];return}G(t,()=>{for(let n of e.mounts)try{let r=n();typeof r=="function"&&g(r)}catch(r){console.error("Error in onMount callback:",r)}for(let n of e.effects){let r;b(()=>{r&&r(),r=n()}),g(()=>{r&&r()})}e.mounts=[],e.effects=[]})})}function S(e,t){return Ne(e,t)}function te(e,t){let n=typeof e=="function"?X(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!Ve(n)){try{n.$name=e.name}catch{}return Fe(n)}return n}function w(e,t=!0){if(Z)return;let n=Q();if(n){if(!t){n.scheduled||e();return}n.mounts.push(e),ee(n)}else{if(!t){e();return}b(()=>{let r=X(e);typeof r=="function"&&g(r)})}}function P(e){g(e)}function I(e){let t=Q();if(t)t.effects.push(e),ee(t);else{let n;b(()=>{n&&n(),n=e()}),g(()=>{n&&n()})}}function ne(e){return Y(e)}function re(e){let t={current:e};return g(()=>{t.current=null}),t}function oe(e,t){let[n,r]=_e(t);return[n,s=>{r(e(n(),s))}]}function ie(e,t,n,r){I(()=>{let o=e&&"current"in e?e.current:e;if(o)return o.addEventListener(t,n,r),()=>{o.removeEventListener(t,n,r)}})}function se(e){return e}import{createSignal as N,createMemo as He,createEffect as Ue,createRenderEffect as $e,isSignal as ae,readChildren as ze,useContext as We,createContext as qe,createSuspenseBoundary as Je,provideSuspense as ce}from"@fluixi/reactive/signal";import{asSuspense as Be,isComponent as Xe,createComponent as ue,runWithoutHydration as Ye}from"@fluixi/dom";function de(e){return typeof window>"u"?!1:typeof Node=="function"&&e instanceof Node?!0:!!(e&&typeof e=="object"&&typeof e.nodeType=="number")}function le(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function fe(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}function pe(e){return!!(e&&typeof e=="object"&&"type"in e&&"props"in e)}var me=qe();function R(e){return ue(Ge,e)}function Ge(e){let t=Je(),n=We(me),r=n?n.register(t.inFallback):void 0;function o(u){return u==null||typeof u=="boolean"?null:typeof u=="function"&&Xe(u)&&!ae(u)?u():u}let s=Ye(()=>o(e.fallback??null)),i=ce(t,()=>ze(()=>e.children)),a=(u,y)=>{if(!(y>8))if(Array.isArray(u))for(let q of u)a(q,y+1);else typeof u=="function"&&ae(u)&&a(u(),y+1)};ce(t,()=>{$e(()=>a(i,0))});let[c,d]=N(void 0),f=fe(i);return f&&(t.increment(),i.then(u=>{d(()=>u),t.decrement()},()=>t.decrement())),He(()=>(r?r.showFallback():t.inFallback())?s:f?c():i)}function ye(e){return ue(Qe,e)}function Qe(e){let{revealOrder:t="together",tail:n}=e,r=[];function o(){if(t==="together"){let i=r.every(a=>!a.inFallback());r.forEach(a=>{a.setShowContent(i),a.setShowFallback(!i)})}else{let i=t==="backwards"?[...r].reverse():r,a=!1;for(let c of i)a||c.inFallback()?(a=!0,c.setShowContent(!1),c.setShowFallback(n!=="hidden")):(c.setShowContent(!0),c.setShowFallback(!1))}}let s={register:i=>{let[a,c]=N(!0),[d,f]=N(!1);return r.push({inFallback:i,setShowContent:c,setShowFallback:f}),Ue(()=>{i(),o()}),{showContent:a,showFallback:d}}};return me.Provider({value:s,children:e.children})}Be(R);Object.defineProperty(R,"__suspense",{value:!0,enumerable:!0});import{untrack as ge,createMemo as Ze,createResource as et}from"@fluixi/reactive/signal";function C(e,t){let n,r,o;function s(){return r||(r=e().then(a=>n=a.default)),r}t?.preload&&s();let i=(a=>{if(n){let c=n;return ge(()=>c(a))}if(!o){let[c]=et(()=>s(),{transport:!1});if(o=c,c.error)throw c.error}return Ze(()=>{let c=o();return c?ge(()=>c(a)):void 0},void 0,{name:"lazy"})});return i.preload=()=>s().then(()=>{}),i.$lazy=!0,i.loader=e,i}import{createMemo as tt,createSignal as nt}from"@fluixi/reactive/signal";import{observeIntersection as rt}from"@fluixi/dom/utils";var he=typeof window>"u";function xe(e,t){let n=t.export??"default",r=C(()=>e().then(s=>{let i=s[n];if(typeof i!="function")throw new Error(`deferred(): module has no '${n}' export (got ${typeof i}).`);return{default:i}}),{fallback:t.fallback});function o(s){if(t.strategy.kind==="never")return he?r(s):null;if(he||t.strategy.kind==="eager")return r(s);let[i,a]=nt(!1),c=()=>{r.preload().then(()=>a(!0))},d=t.strategy.kind==="visible"?ot():void 0;return it(t.strategy,c,d),tt(()=>i()?r(s):d??t.fallback??null,void 0,{name:"deferred"})}return o.preload=r.preload,o}function ot(){let e=document.createElement("span");return e.setAttribute("data-fx-load","visible"),e.style.display="block",e}function it(e,t,n){let r=!1,o=()=>{r||(r=!0,t())};switch(e.kind){case"idle":{let s=globalThis.requestIdleCallback;s?s(o):setTimeout(o,1);return}case"visible":{if(!n||typeof IntersectionObserver>"u"){o();return}let s=rt(n,i=>{i&&(s(),o())},{rootMargin:e.rootMargin??"0px"});return}case"interaction":{let s=()=>{for(let i of e.events)document.removeEventListener(i,s,!0);o()};for(let i of e.events)document.addEventListener(i,s,{capture:!0,passive:!0});return}case"media":{if(typeof matchMedia>"u"){o();return}let s=matchMedia(e.query);if(s.matches){o();return}let i=a=>{a.matches&&(s.removeEventListener("change",i),o())};s.addEventListener("change",i);return}default:o()}}import{createResource as st}from"@fluixi/reactive/signal";function ve(e){let t=()=>{let r=e.value;return typeof r=="function"?r():r},[n]=st(t);return()=>{if(n.loading)return e.fallback;let r=e.children;return typeof r=="function"?r(n()):r}}var F=typeof window>"u";function Ce(e,t,n={}){if(Te(["click","input","change","submit"]),F)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let r;return at(o=>{r=o;let s=typeof e=="function"?e():e;t.textContent="",J(t),B(),ut(t,()=>s)}),()=>{r&&(r(),r=void 0)}}function dt(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function lt(e,t,n={}){let r=document.createElement("div");r.setAttribute("data-portal","true"),t.appendChild(r);let o=Ce(e,r,n);return()=>{o(),t.contains(r)&&t.removeChild(r)}}function ft(e){return!!(e==null||typeof e=="function"||ct(e)||dt(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function pt(){F||Te(["click","input","change","submit"])}function mt(){}import{asProvider as yt}from"@fluixi/dom";import{createContext as gt,useContext as ht}from"@fluixi/reactive/signal";import{readChildren as xt}from"@fluixi/reactive/signal";var be=!1;function vt(){be||(be=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function _(e,t,n){let r=!!e?.Provider,o=r?e:e.context,s=r?t:e.value,i=r?!1:e.debug??!1;r||vt();let a=typeof s=="function"?s():s,c=r?n:e;return o.Provider({value:a,get children(){return c?.children},debug:i})}function Tt(e){let t=h(e);return[t,r=>_(t,r.value,r)]}function Se(e,t){if(e.length===0)return xt(()=>t);let[n,r]=e[0],o=e.slice(1);return _(n,r,{get children(){return Se(o,t)}})}function Ct(e){return t=>{let n=x(e);return t.children(n)}}function bt(e,t){let n=x(e);return n===e.defaultValue?t():n}function h(e){let t=gt(e),n=r=>(r.debug,t.Provider({value:r.value,get children(){return r.children},debug:r.debug}));return typeof Symbol<"u"&&Symbol.for&&(n.$$typeof=Symbol.for("react.provider")),n.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:yt(n),defaultValue:e}}function x(e){let t=ht(e);return t!==void 0?t:e.defaultValue}import{createSignal as St,createMemo as wt}from"@fluixi/reactive/signal";import{getServerData as Pt}from"@fluixi/dom";var Rt="__fluixi_iso_states__",At="__iso:";function kt(){return globalThis[Rt]??=new Map}function we(e){if(typeof window>"u")return;let t=Pt();return t?t[At+e]:void 0}function Pe(e,t){let n=we(e),r=n!==void 0?n:typeof window<"u"&&t.client?t.client():t.fallback,[o,s]=St(r);return kt().set(e,{server:t.server,set:s}),{value:o,set:s,key:e}}function Ot(e,t){let n=we(e)!==void 0,r=Pe(e,{server:t.server,fallback:t.fallback}),o=()=>r.value()??t.fallback,s=u=>{if(!(!t.persist||typeof localStorage>"u"))try{localStorage.setItem(t.persist,JSON.stringify(u))}catch{}},i=u=>{r.set(u),s(u)},a=(u,y)=>{i({...o(),[u]:y})},c={};for(let u of Object.keys(t.fallback))c[u]=wt(()=>o()[u]);let d=null;return{value:o,fields:c,set:i,setField:a,ensureInit:()=>n||!t.client?Promise.resolve():(d||(d=Promise.resolve(t.client()).then(u=>{i(u)}).catch(u=>{throw d=null,u})),d),key:e}}var Re=typeof document>"u",Ae=!Re;function ke(){let e=new Map;return{getItem:t=>e.has(t)?e.get(t):null,setItem:(t,n)=>{e.set(t,String(n))},removeItem:t=>{e.delete(t)},clear:()=>e.clear(),key:t=>Array.from(e.keys())[t]??null,get length(){return e.size}}}var A=typeof localStorage<"u"?localStorage:ke(),k={get window(){return typeof window<"u"?window:void 0},get document(){return typeof document<"u"?document:void 0}};function Lt(e,t){return Ae?e():t}import{createSignal as Oe}from"@fluixi/reactive/signal";function Et(e){return e?e===!0?{dark:"dark",light:"light"}:e:null}function Mt(e){let t=e.storageKey??"theme",n=e.attribute??"data-theme",r=Et(e.system),o=()=>{let l=A.getItem(t);return l&&e.themes.includes(l)?l:r&&k.window?.matchMedia?.("(prefers-color-scheme: dark)")?.matches?r.dark:r?r.light:e.default},[s,i]=Oe(o()),[a,c]=Oe(!1),d=l=>{k.document?.documentElement.setAttribute(n,l);try{A.setItem(t,l)}catch{}},f=l=>{if(!e.themes.includes(l))return;let De=s();i(()=>l),d(l),e.onChange?.(l,De),e.load&&(c(!0),e.onLoading?.(l),Promise.resolve(e.load(l)).finally(()=>{c(!1),e.onLoaded?.(l)}))};return{value:s,isLoading:a,set:f,toggle:()=>{let l=e.themes.indexOf(s());f(e.themes[(l+1)%e.themes.length])},init:()=>d(s()),headScript:()=>`<script>(function(){try{var c=${JSON.stringify({k:t,a:n,d:e.default,sys:r})},t=localStorage.getItem(c.k);if(!t&&c.sys)t=matchMedia('(prefers-color-scheme: dark)').matches?c.sys.dark:c.sys.light;if(!t)t=c.d;document.documentElement.setAttribute(c.a,t);}catch(e){}})();<\/script>`}}import{createSignal as K,createMemo as v,createResource as Vt,createEffect as H,getOwner as jt,onCleanup as Le,untrack as V}from"@fluixi/reactive/signal";import{insert as j,createComponent as Ee,createNativeElement as O,setAttribute as m}from"@fluixi/dom";import{createContext as L,useContext as Me}from"@fluixi/reactive/signal";import{get as Br}from"@fluixi/utils/object";import{deepEqual as Yr}from"@fluixi/utils/compare";import{createRouter as Kt,createBrowserHistory as Ht,matchRoutes as Qr,matchPath as Zr}from"@fluixi/router";import{createMemoryHistory as no,createBrowserHistory as ro,matchRoutes as oo,matchPath as io}from"@fluixi/router";import{createResource as Lr,createSignal as Ft}from"@fluixi/reactive/signal";var Dt=new Map;function It(){Dt.clear()}function Nt(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),n=[],r;for(;r=t.nextNode();){let o=r,s=o.nodeValue||"";(s.startsWith("#")||s.startsWith("/"))&&n.push(o)}n.forEach(o=>o.remove()),It()}typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(Nt,100)});var[Ir,Nr]=Ft(0);var _t=h(),Fr=_t.Provider;import{runWithOwner as uo}from"@fluixi/reactive/signal";var U=L(),Ut=L(),$t=L(),zt=L();function Wt(e,t,n){let r,o=e.route.data;if(typeof o=="function"){let f=!1;Le(()=>{f=!0});let u=jt(),[y]=Vt(()=>o({params:n.params,location:n.location},u,()=>f));r=y}let s=()=>zt.Provider({value:r,get children(){return $t.Provider({value:e.params,get children(){return Ut.Provider({value:{depth:t,...n},get children(){return Ee(e.component,{})}})}})}});if(!r)return s();let i=r,a=()=>i.loading,[c,d]=K(V(()=>!a()));return H(()=>d(!a())),v(()=>c()?s():null)}function qt(e){let t=e.depth+1,[n,r]=K(V(()=>e.matched()[t]?.component));return H(()=>{let o=e.matched()[t]?.component;r(()=>o)}),v(()=>{if(!n())return e.notFound?e.notFound():null;let s=V(()=>e.matched())[t];return Wt(s,t,{matched:e.matched,params:e.params,location:e.location})})}function Jt(e){return e==null?Bt():typeof e=="function"?Ee(e,{}):e}function Bt(){let e=O("div");m(e,"class","fx-not-found"),m(e,"role","main"),m(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let t=O("h1");m(t,"style","margin:0;font-size:2.5rem;font-weight:700"),j(t,"404");let n=O("p");return m(n,"style","margin:0;opacity:.7"),j(n,"This page could not be found."),e.appendChild(t),e.appendChild(n),e}function $(e){let t=e.history??Ht(),n=Kt({routes:e.routes,base:e.base,history:t}),[r,o]=K(n.state()),s=n.subscribe(o);Le(()=>{s(),n.destroy()});let i=v(()=>(r().match?.matched??[]).filter(f=>f.component)),a={router:n,location:v(()=>r().location),params:v(()=>r().match?.params??{})},c={depth:-1,matched:i,params:a.params,location:a.location,notFound:()=>Jt(e.notFound)},d;return U.Provider({value:a,get children(){return d??=qt(c)}})}var Xt={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};function T(){let e=Me(U);if(e)return e;if(typeof window>"u")return Xt;throw new Error("[router] useRouter must be used within <Router>")}function Yt(){let e=T().params;return v(()=>e(),{},{equals:(t,n)=>JSON.stringify(t)===JSON.stringify(n)})}function Gt(){let{location:e}=T();return new Proxy({},{get:(t,n)=>e()[n],has:(t,n)=>n in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(t,n)=>Object.getOwnPropertyDescriptor(e(),n)})}function z(){let{router:e}=T();return(t,n)=>e.navigate(t,n)}var p=e=>typeof e=="function"?e():e,Qt=new Set(["href","slot","class","className","active","activeClass","replace","children"]);function W(e){let t=Me(U),n=typeof document>"u",r=()=>t?.router.navigate(p(e.href)??"",{replace:p(e.replace)}),o=O("a");m(o,"href",p(e.href)??""),e.slot&&m(o,"slot",p(e.slot));for(let i of Object.keys(e)){if(Qt.has(i))continue;let a=e[i];a!=null&&typeof a!="function"&&m(o,i,String(a))}if(typeof o.addEventListener=="function")o.addEventListener("click",i=>{i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||(i.preventDefault(),r())});else{let i=p(e.className??e.class)??"";i&&m(o,"class",i)}typeof o.addEventListener=="function"&&H(()=>{let i=p(e.href)??"";o.setAttribute("href",i);let a=p(e.className??e.class)??"",c=p(e.activeClass)??"",d=p(e.active)??t?.location().pathname===i;o.className=[a,d?c:""].filter(Boolean).join(" ")});let s=e.children;return s!=null&&j(o,s),o}import{html as $o,svg as zo}from"@fluixi/dom";import{query as qo,queryAll as Jo,closest as Bo,addClass as Xo,removeClass as Yo,toggleClass as Go,hasClass as Qo,setAttribute as Zo,getAttribute as ei,removeAttribute as ti,setStyles as ni,getStyle as ri,createElement as oi,removeChildren as ii,appendChildren as si,isVisible as ai,scrollIntoView as ci,getOffset as ui,delegate as di,waitForElement as li,observeIntersection as fi,observeResize as pi}from"@fluixi/dom";import{classMap as yi,styleMap as gi,Island as hi,hydrateIslands as xi,mergeProps as vi,splitProps as Ti}from"@fluixi/dom";import{Show as po,For as mo,Index as yo,Switch as go,Match as ho,Dynamic as xo,ErrorBoundary as vo,Portal as To,ClientOnly as Co,NoSsr as bo}from"@fluixi/dom";import{createStore as Si,untrackStore as wi,unwrap as Pi,Store as Ri}from"@fluixi/reactive/store";var gn="0.0.1",hn="Fluixi";var xn={createComponent:S,onMount:w,onUnmount:P,createEffect:Zt,createMemo:en,createSignal:tn,createContext:h,createRoot:nn,createDeferred:ln,createComputed:rn,createRenderEffect:on,createSelector:pn,onCleanup:sn,getOwner:an,runWithOwner:cn,batch:un,untrack:dn,useContext:x,setOwner:fn,Router:$,Link:W,useRouter:T,useNavigate:z,read:mn,reduce:yn,VERSION:gn,FRAMEWORK_NAME:hn};export{te as $component,ve as Await,Co as ClientOnly,xo as Dynamic,vo as ErrorBoundary,hn as FRAMEWORK_NAME,mo as For,yo as Index,hi as Island,W as Link,ho as Match,bo as NoSsr,To as Portal,$ as Router,po as Show,Ri as Store,R as Suspense,ye as SuspenseList,go as Switch,E as VERSION,Xo as addClass,si as appendChildren,un as batch,yi as classMap,mt as cleanupDelegation,Lt as clientOnly,Bo as closest,Se as composeProviders,S as createComponent,rn as createComputed,Ct as createConsumer,h as createContext,Tt as createContextWithProvider,Lo as createDebounce,Eo as createDebouncedResource,Mo as createDebouncedSignal,ln as createDeferred,Zt as createEffect,Pe as createIsomorphicState,Ot as createIsomorphicStore,en as createMemo,ke as createMemoryStorage,_ as createProvider,on as createRenderEffect,ko as createResource,nn as createRoot,pn as createSelector,tn as createSignal,Si as createStore,Mt as createTheme,xn as default,xe as deferred,di as delegate,oi as domCreateElement,Ro as effect,k as env,ei as getAttribute,ui as getOffset,an as getOwner,ri as getStyle,Qo as hasClass,$o as html,xi as hydrateIslands,pt as initDelegation,Ae as isClient,pe as isJSXElement,le as isLitResult,de as isNode,ft as isRenderable,Re as isServer,ai as isVisible,C as lazy,Po as memo,vi as mergeProps,fi as observeIntersection,pi as observeResize,sn as onCleanup,w as onMount,P as onUnmount,lt as portal,qo as query,Jo as queryAll,mn as read,yn as reduce,ti as removeAttribute,ii as removeChildren,Yo as removeClass,Ce as render,Ao as resource,cn as runWithOwner,ci as scrollIntoView,Zo as setAttribute,fn as setOwner,ni as setStyles,wo as signal,Ti as splitProps,A as storage,gi as styleMap,zo as svg,Go as toggleClass,dn as untrack,wi as untrackStore,Pi as unwrap,se as useCallback,x as useContext,I as useEffect,ie as useEventListener,Gt as useLocation,ne as useMemo,z as useNavigate,Yt as useParams,bt as useProvide,oe as useReducer,re as useRef,T as useRouter,li as waitForElement};
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.84 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
|
+
|
|
3
|
+
// src/version.generated.ts
|
|
4
|
+
var VERSION = "1.0.0-alpha.84";
|
|
5
|
+
|
|
6
|
+
// src/lib/core.ts
|
|
7
|
+
import {
|
|
8
|
+
signal,
|
|
9
|
+
memo,
|
|
10
|
+
effect,
|
|
11
|
+
resource,
|
|
12
|
+
createEffect as createEffect4,
|
|
13
|
+
createMemo as createMemo7,
|
|
14
|
+
createSignal as createSignal8,
|
|
15
|
+
createResource as createResource6,
|
|
16
|
+
createRoot as createRoot3,
|
|
17
|
+
createComputed as createComputed2,
|
|
18
|
+
createRenderEffect as createRenderEffect3,
|
|
19
|
+
onCleanup as onCleanup3,
|
|
20
|
+
getOwner as getOwner3,
|
|
21
|
+
runWithOwner as runWithOwner3,
|
|
22
|
+
batch as batch2,
|
|
23
|
+
untrack as untrack4,
|
|
24
|
+
createDeferred as createDeferred2,
|
|
25
|
+
setOwner
|
|
26
|
+
} from "@fluixi/reactive/signal";
|
|
27
|
+
import {
|
|
28
|
+
createDebounce,
|
|
29
|
+
createDebouncedResource,
|
|
30
|
+
createDebouncedSignal,
|
|
31
|
+
createSelector
|
|
32
|
+
} from "@fluixi/reactive/signal";
|
|
33
|
+
import {
|
|
34
|
+
readSignal as read2,
|
|
35
|
+
reduceSignal as reduce
|
|
36
|
+
} from "@fluixi/reactive/operators";
|
|
37
|
+
|
|
38
|
+
// src/lib/render/index.ts
|
|
39
|
+
import { isServer as isServer3 } from "@fluixi/dom";
|
|
40
|
+
import { createRoot as createRoot2 } from "@fluixi/reactive/signal";
|
|
41
|
+
|
|
42
|
+
// src/lib/render/versions.ts
|
|
43
|
+
import { registerCoreVersion } from "@fluixi/dom";
|
|
44
|
+
import { stampVersions, warnOnVersionSkew, versions } from "@fluixi/dom";
|
|
45
|
+
registerCoreVersion(VERSION);
|
|
46
|
+
|
|
47
|
+
// src/lib/render/index.ts
|
|
48
|
+
import {
|
|
49
|
+
isDOMNode,
|
|
50
|
+
delegateEvents,
|
|
51
|
+
insert
|
|
52
|
+
} from "@fluixi/dom";
|
|
53
|
+
|
|
54
|
+
// src/lib/render/component.ts
|
|
55
|
+
import { isServer } from "@fluixi/dom";
|
|
56
|
+
import {
|
|
57
|
+
createComponent as domCreateComponent,
|
|
58
|
+
asComponent
|
|
59
|
+
} from "@fluixi/dom";
|
|
60
|
+
import {
|
|
61
|
+
untrack,
|
|
62
|
+
onCleanup,
|
|
63
|
+
getOwner,
|
|
64
|
+
createEffect,
|
|
65
|
+
createMemo,
|
|
66
|
+
createSignal,
|
|
67
|
+
isSignal,
|
|
68
|
+
batch,
|
|
69
|
+
runWithOwner,
|
|
70
|
+
isOwnerDisposed
|
|
71
|
+
} from "@fluixi/reactive/signal";
|
|
72
|
+
var _LIFECYCLE = /* @__PURE__ */ Symbol.for("fluixi-lifecycle");
|
|
73
|
+
function getOwnerLifecycle() {
|
|
74
|
+
const owner = getOwner();
|
|
75
|
+
if (!owner) return null;
|
|
76
|
+
if (!owner[_LIFECYCLE]) {
|
|
77
|
+
const lc = { mounts: [], effects: [], scheduled: false };
|
|
78
|
+
owner[_LIFECYCLE] = lc;
|
|
79
|
+
}
|
|
80
|
+
return owner[_LIFECYCLE];
|
|
81
|
+
}
|
|
82
|
+
function scheduleLifecycleFlush(lc) {
|
|
83
|
+
if (lc.scheduled) return;
|
|
84
|
+
if (isServer()) {
|
|
85
|
+
lc.mounts = [];
|
|
86
|
+
lc.effects = [];
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
lc.scheduled = true;
|
|
90
|
+
const owner = getOwner();
|
|
91
|
+
queueMicrotask(() => {
|
|
92
|
+
if (isOwnerDisposed(owner)) {
|
|
93
|
+
lc.mounts = [];
|
|
94
|
+
lc.effects = [];
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
runWithOwner(owner, () => {
|
|
98
|
+
for (const cb of lc.mounts) {
|
|
99
|
+
try {
|
|
100
|
+
const cleanup = cb();
|
|
101
|
+
if (typeof cleanup === "function") {
|
|
102
|
+
onCleanup(cleanup);
|
|
103
|
+
}
|
|
104
|
+
} catch (e) {
|
|
105
|
+
console.error("Error in onMount callback:", e);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
for (const cb of lc.effects) {
|
|
109
|
+
let cleanup;
|
|
110
|
+
createEffect(() => {
|
|
111
|
+
if (cleanup) cleanup();
|
|
112
|
+
cleanup = cb();
|
|
113
|
+
});
|
|
114
|
+
onCleanup(() => {
|
|
115
|
+
if (cleanup) cleanup();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
lc.mounts = [];
|
|
119
|
+
lc.effects = [];
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function createComponent(Comp, props) {
|
|
124
|
+
return domCreateComponent(Comp, props);
|
|
125
|
+
}
|
|
126
|
+
function $component(value, props) {
|
|
127
|
+
const component = typeof value === "function" ? untrack(() => value(props)) : value;
|
|
128
|
+
const nameable = component != null && (typeof component === "function" || typeof component === "object");
|
|
129
|
+
if (nameable) {
|
|
130
|
+
try {
|
|
131
|
+
component["$name"] = value.name;
|
|
132
|
+
} catch {
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (nameable && !isSignal(component)) {
|
|
136
|
+
return asComponent(component);
|
|
137
|
+
}
|
|
138
|
+
return component;
|
|
139
|
+
}
|
|
140
|
+
function onMount(fn, reactive = true) {
|
|
141
|
+
if (isServer()) return;
|
|
142
|
+
const lc = getOwnerLifecycle();
|
|
143
|
+
if (lc) {
|
|
144
|
+
if (!reactive) {
|
|
145
|
+
if (!lc.scheduled) {
|
|
146
|
+
fn();
|
|
147
|
+
}
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
lc.mounts.push(fn);
|
|
151
|
+
scheduleLifecycleFlush(lc);
|
|
152
|
+
} else {
|
|
153
|
+
if (!reactive) {
|
|
154
|
+
fn();
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
createEffect(() => {
|
|
158
|
+
const cleanup = untrack(fn);
|
|
159
|
+
if (typeof cleanup === "function") {
|
|
160
|
+
onCleanup(cleanup);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function onUnmount(fn) {
|
|
166
|
+
onCleanup(fn);
|
|
167
|
+
}
|
|
168
|
+
function useEffect(callback) {
|
|
169
|
+
const lc = getOwnerLifecycle();
|
|
170
|
+
if (lc) {
|
|
171
|
+
lc.effects.push(callback);
|
|
172
|
+
scheduleLifecycleFlush(lc);
|
|
173
|
+
} else {
|
|
174
|
+
let cleanup;
|
|
175
|
+
createEffect(() => {
|
|
176
|
+
if (cleanup) cleanup();
|
|
177
|
+
cleanup = callback();
|
|
178
|
+
});
|
|
179
|
+
onCleanup(() => {
|
|
180
|
+
if (cleanup) cleanup();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function useMemo(fn) {
|
|
185
|
+
return createMemo(fn);
|
|
186
|
+
}
|
|
187
|
+
function useRef(initialValue) {
|
|
188
|
+
const ref = { current: initialValue };
|
|
189
|
+
onCleanup(() => {
|
|
190
|
+
ref.current = null;
|
|
191
|
+
});
|
|
192
|
+
return ref;
|
|
193
|
+
}
|
|
194
|
+
function useReducer(reducer, initialState) {
|
|
195
|
+
const [state, setState] = createSignal(initialState);
|
|
196
|
+
const dispatch = (action2) => {
|
|
197
|
+
setState(reducer(state(), action2));
|
|
198
|
+
};
|
|
199
|
+
return [state, dispatch];
|
|
200
|
+
}
|
|
201
|
+
function useEventListener(target, event, handler, options) {
|
|
202
|
+
useEffect(() => {
|
|
203
|
+
const element = target && "current" in target ? target.current : target;
|
|
204
|
+
if (!element) return;
|
|
205
|
+
element.addEventListener(event, handler, options);
|
|
206
|
+
return () => {
|
|
207
|
+
element.removeEventListener(event, handler, options);
|
|
208
|
+
};
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function useCallback(callback) {
|
|
212
|
+
return callback;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// src/lib/render/suspense.ts
|
|
216
|
+
import {
|
|
217
|
+
createSignal as createSignal2,
|
|
218
|
+
createMemo as createMemo2,
|
|
219
|
+
createEffect as createEffect2,
|
|
220
|
+
createRenderEffect as createRenderEffect2,
|
|
221
|
+
isSignal as isSignal2,
|
|
222
|
+
readChildren,
|
|
223
|
+
useContext as useContext2,
|
|
224
|
+
createContext as createContext2,
|
|
225
|
+
createSuspenseBoundary,
|
|
226
|
+
provideSuspense
|
|
227
|
+
} from "@fluixi/reactive/signal";
|
|
228
|
+
import {
|
|
229
|
+
asSuspense,
|
|
230
|
+
isComponent,
|
|
231
|
+
createComponent as createComponent2,
|
|
232
|
+
runWithoutHydration
|
|
233
|
+
} from "@fluixi/dom";
|
|
234
|
+
function isNode(value) {
|
|
235
|
+
if (typeof window === "undefined") return false;
|
|
236
|
+
if (typeof Node === "function" && value instanceof Node) return true;
|
|
237
|
+
return !!(value && typeof value === "object" && typeof value.nodeType === "number");
|
|
238
|
+
}
|
|
239
|
+
function isLitResult(value) {
|
|
240
|
+
if (!value || typeof value !== "object") return false;
|
|
241
|
+
return !!(typeof value["_$litType$"] !== "undefined" || typeof value["_$litDirective$"] !== "undefined" || Array.isArray(value.strings) && Array.isArray(value.values));
|
|
242
|
+
}
|
|
243
|
+
function isPromise(value) {
|
|
244
|
+
return !!(value && typeof value === "object" && typeof value.then === "function" || value instanceof Promise);
|
|
245
|
+
}
|
|
246
|
+
function isJSXElement(value) {
|
|
247
|
+
return !!(value && typeof value === "object" && "type" in value && "props" in value);
|
|
248
|
+
}
|
|
249
|
+
var SuspenseListContext = createContext2(void 0, "suspense-list");
|
|
250
|
+
function Suspense(props) {
|
|
251
|
+
return createComponent2(SuspenseImpl, props);
|
|
252
|
+
}
|
|
253
|
+
function SuspenseImpl(props) {
|
|
254
|
+
const boundary = createSuspenseBoundary();
|
|
255
|
+
const listCtx = useContext2(SuspenseListContext);
|
|
256
|
+
const listState = listCtx ? listCtx.register(boundary.inFallback) : void 0;
|
|
257
|
+
function instantiateOnce(val) {
|
|
258
|
+
if (val == null || typeof val === "boolean") return null;
|
|
259
|
+
if (typeof val === "function" && isComponent(val) && !isSignal2(val)) return val();
|
|
260
|
+
return val;
|
|
261
|
+
}
|
|
262
|
+
const fallback = runWithoutHydration(() => instantiateOnce(props.fallback ?? null));
|
|
263
|
+
const children = provideSuspense(boundary, () => readChildren(() => props.children));
|
|
264
|
+
const track = (value, depth) => {
|
|
265
|
+
if (depth > 8) return;
|
|
266
|
+
if (Array.isArray(value)) {
|
|
267
|
+
for (const x of value) track(x, depth + 1);
|
|
268
|
+
} else if (typeof value === "function" && isSignal2(value)) {
|
|
269
|
+
track(value(), depth + 1);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
provideSuspense(boundary, () => {
|
|
273
|
+
createRenderEffect2(() => track(children, 0));
|
|
274
|
+
});
|
|
275
|
+
const [resolved, setResolved] = createSignal2(void 0);
|
|
276
|
+
const childIsPromise = isPromise(children);
|
|
277
|
+
if (childIsPromise) {
|
|
278
|
+
boundary.increment();
|
|
279
|
+
children.then(
|
|
280
|
+
(v) => {
|
|
281
|
+
setResolved(() => v);
|
|
282
|
+
boundary.decrement();
|
|
283
|
+
},
|
|
284
|
+
() => boundary.decrement()
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
return createMemo2(() => {
|
|
288
|
+
const showFallback = listState ? listState.showFallback() : boundary.inFallback();
|
|
289
|
+
if (showFallback) return fallback;
|
|
290
|
+
if (childIsPromise) return resolved();
|
|
291
|
+
return children;
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
function SuspenseList(props) {
|
|
295
|
+
return createComponent2(SuspenseListImpl, props);
|
|
296
|
+
}
|
|
297
|
+
function SuspenseListImpl(props) {
|
|
298
|
+
const { revealOrder = "together", tail } = props;
|
|
299
|
+
const registrations = [];
|
|
300
|
+
function coordinateReveal() {
|
|
301
|
+
if (revealOrder === "together") {
|
|
302
|
+
const allResolved = registrations.every((r) => !r.inFallback());
|
|
303
|
+
registrations.forEach((r) => {
|
|
304
|
+
r.setShowContent(allResolved);
|
|
305
|
+
r.setShowFallback(!allResolved);
|
|
306
|
+
});
|
|
307
|
+
} else {
|
|
308
|
+
const items = revealOrder === "backwards" ? [...registrations].reverse() : registrations;
|
|
309
|
+
let blocked = false;
|
|
310
|
+
for (const r of items) {
|
|
311
|
+
if (blocked || r.inFallback()) {
|
|
312
|
+
blocked = true;
|
|
313
|
+
r.setShowContent(false);
|
|
314
|
+
r.setShowFallback(tail !== "hidden");
|
|
315
|
+
} else {
|
|
316
|
+
r.setShowContent(true);
|
|
317
|
+
r.setShowFallback(false);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const coordinator = {
|
|
323
|
+
register: (inFallback) => {
|
|
324
|
+
const [showContent, setShowContent] = createSignal2(true);
|
|
325
|
+
const [showFallback, setShowFallback] = createSignal2(false);
|
|
326
|
+
registrations.push({ inFallback, setShowContent, setShowFallback });
|
|
327
|
+
createEffect2(() => {
|
|
328
|
+
inFallback();
|
|
329
|
+
coordinateReveal();
|
|
330
|
+
});
|
|
331
|
+
return { showContent, showFallback };
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
return SuspenseListContext.Provider({
|
|
335
|
+
value: coordinator,
|
|
336
|
+
children: props.children
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
asSuspense(Suspense);
|
|
340
|
+
Object.defineProperty(Suspense, "__suspense", { value: true, enumerable: true });
|
|
341
|
+
|
|
342
|
+
// src/lib/render/lazy.ts
|
|
343
|
+
import { createComponent as createComponent3 } from "@fluixi/dom";
|
|
344
|
+
import {
|
|
345
|
+
untrack as untrack2,
|
|
346
|
+
createMemo as createMemo3,
|
|
347
|
+
createResource as createResource2
|
|
348
|
+
} from "@fluixi/reactive/signal";
|
|
349
|
+
function fromChunk(value) {
|
|
350
|
+
if (value != null && (typeof value === "object" || typeof value === "function")) {
|
|
351
|
+
try {
|
|
352
|
+
value["$lazy"] = true;
|
|
353
|
+
} catch {
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return value;
|
|
357
|
+
}
|
|
358
|
+
function lazy(loader, options) {
|
|
359
|
+
let resolved;
|
|
360
|
+
let promise;
|
|
361
|
+
let component;
|
|
362
|
+
function load() {
|
|
363
|
+
if (!promise) {
|
|
364
|
+
promise = loader().then((mod) => resolved = mod.default);
|
|
365
|
+
}
|
|
366
|
+
return promise;
|
|
367
|
+
}
|
|
368
|
+
if (options?.preload) load();
|
|
369
|
+
const LazyWrapper = ((props) => {
|
|
370
|
+
if (resolved) {
|
|
371
|
+
const C = resolved;
|
|
372
|
+
return fromChunk(untrack2(() => C(props)));
|
|
373
|
+
}
|
|
374
|
+
if (!component) {
|
|
375
|
+
const [resource2] = createResource2(() => load(), { transport: false });
|
|
376
|
+
component = resource2;
|
|
377
|
+
if (resource2.error) throw resource2.error;
|
|
378
|
+
}
|
|
379
|
+
return createMemo3(() => {
|
|
380
|
+
const C = component();
|
|
381
|
+
return C ? fromChunk(createComponent3(C, props)) : void 0;
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
LazyWrapper.preload = () => load().then(() => void 0);
|
|
385
|
+
LazyWrapper.$lazy = true;
|
|
386
|
+
LazyWrapper.loader = loader;
|
|
387
|
+
return LazyWrapper;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// src/lib/render/deferred.ts
|
|
391
|
+
import { isServer as isServer2 } from "@fluixi/dom";
|
|
392
|
+
import { createMemo as createMemo4, createSignal as createSignal3 } from "@fluixi/reactive/signal";
|
|
393
|
+
import { observeIntersection } from "@fluixi/dom/utils";
|
|
394
|
+
function deferred(loader, options) {
|
|
395
|
+
const exportName = options.export ?? "default";
|
|
396
|
+
const Lazy = lazy(
|
|
397
|
+
() => loader().then((mod) => {
|
|
398
|
+
const component = mod[exportName];
|
|
399
|
+
if (typeof component !== "function") {
|
|
400
|
+
throw new Error(
|
|
401
|
+
`deferred(): module has no '${exportName}' export (got ${typeof component}).`
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
return { default: component };
|
|
405
|
+
}),
|
|
406
|
+
{ fallback: options.fallback }
|
|
407
|
+
);
|
|
408
|
+
function Deferred(props) {
|
|
409
|
+
if (options.strategy.kind === "never") return isServer2() ? Lazy(props) : null;
|
|
410
|
+
if (isServer2() || options.strategy.kind === "eager") return Lazy(props);
|
|
411
|
+
const [ready, setReady] = createSignal3(false);
|
|
412
|
+
const start = () => {
|
|
413
|
+
void Lazy.preload().then(() => setReady(true));
|
|
414
|
+
};
|
|
415
|
+
const anchor = options.strategy.kind === "visible" ? createAnchor() : void 0;
|
|
416
|
+
schedule(options.strategy, start, anchor);
|
|
417
|
+
return createMemo4(() => ready() ? Lazy(props) : anchor ?? options.fallback ?? null, void 0, {
|
|
418
|
+
name: "deferred"
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
Deferred.preload = Lazy.preload;
|
|
422
|
+
return Deferred;
|
|
423
|
+
}
|
|
424
|
+
function createAnchor() {
|
|
425
|
+
const el = document.createElement("span");
|
|
426
|
+
el.setAttribute("data-fx-load", "visible");
|
|
427
|
+
el.style.display = "block";
|
|
428
|
+
return el;
|
|
429
|
+
}
|
|
430
|
+
function schedule(strategy, start, anchor) {
|
|
431
|
+
let fired = false;
|
|
432
|
+
const once = () => {
|
|
433
|
+
if (fired) return;
|
|
434
|
+
fired = true;
|
|
435
|
+
start();
|
|
436
|
+
};
|
|
437
|
+
switch (strategy.kind) {
|
|
438
|
+
case "idle": {
|
|
439
|
+
const ric = globalThis.requestIdleCallback;
|
|
440
|
+
if (ric) ric(once);
|
|
441
|
+
else setTimeout(once, 1);
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
case "visible": {
|
|
445
|
+
if (!anchor || typeof IntersectionObserver === "undefined") {
|
|
446
|
+
once();
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const stop = observeIntersection(
|
|
450
|
+
anchor,
|
|
451
|
+
(isIntersecting) => {
|
|
452
|
+
if (!isIntersecting) return;
|
|
453
|
+
stop();
|
|
454
|
+
once();
|
|
455
|
+
},
|
|
456
|
+
{ rootMargin: strategy.rootMargin ?? "0px" }
|
|
457
|
+
);
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
case "interaction": {
|
|
461
|
+
const handler = () => {
|
|
462
|
+
for (const event of strategy.events) {
|
|
463
|
+
document.removeEventListener(event, handler, true);
|
|
464
|
+
}
|
|
465
|
+
once();
|
|
466
|
+
};
|
|
467
|
+
for (const event of strategy.events) {
|
|
468
|
+
document.addEventListener(event, handler, { capture: true, passive: true });
|
|
469
|
+
}
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
case "media": {
|
|
473
|
+
if (typeof matchMedia === "undefined") {
|
|
474
|
+
once();
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
const query2 = matchMedia(strategy.query);
|
|
478
|
+
if (query2.matches) {
|
|
479
|
+
once();
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const onChange = (e) => {
|
|
483
|
+
if (!e.matches) return;
|
|
484
|
+
query2.removeEventListener("change", onChange);
|
|
485
|
+
once();
|
|
486
|
+
};
|
|
487
|
+
query2.addEventListener("change", onChange);
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
/* c8 ignore next 3 */
|
|
491
|
+
default:
|
|
492
|
+
once();
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// src/lib/render/await.ts
|
|
497
|
+
import { createResource as createResource3 } from "@fluixi/reactive/signal";
|
|
498
|
+
function Await(props) {
|
|
499
|
+
const fetcher = () => {
|
|
500
|
+
const v = props.value;
|
|
501
|
+
return typeof v === "function" ? v() : v;
|
|
502
|
+
};
|
|
503
|
+
const [data] = createResource3(fetcher);
|
|
504
|
+
return () => {
|
|
505
|
+
if (data.loading) return props.fallback;
|
|
506
|
+
const child = props.children;
|
|
507
|
+
return typeof child === "function" ? child(data()) : child;
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// src/lib/render/index.ts
|
|
512
|
+
function render(code, container, options = {}) {
|
|
513
|
+
delegateEvents(["click", "input", "change", "submit"]);
|
|
514
|
+
if (isServer3()) {
|
|
515
|
+
throw new Error(
|
|
516
|
+
"render() is for client-side only. Use renderToString() on server."
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
if (!container) {
|
|
520
|
+
throw new Error("Container element is required");
|
|
521
|
+
}
|
|
522
|
+
let disposer;
|
|
523
|
+
createRoot2((dispose) => {
|
|
524
|
+
disposer = dispose;
|
|
525
|
+
const result = typeof code === "function" ? code() : code;
|
|
526
|
+
container.textContent = "";
|
|
527
|
+
stampVersions(container);
|
|
528
|
+
warnOnVersionSkew();
|
|
529
|
+
insert(container, () => result);
|
|
530
|
+
});
|
|
531
|
+
return () => {
|
|
532
|
+
if (disposer) {
|
|
533
|
+
disposer();
|
|
534
|
+
disposer = void 0;
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
function isLitTemplateResult(value) {
|
|
539
|
+
return value && typeof value === "object" && (value["_$litType$"] !== void 0 || value["_$litDirective$"] !== void 0);
|
|
540
|
+
}
|
|
541
|
+
function portal(code, target, options = {}) {
|
|
542
|
+
const container = document.createElement("div");
|
|
543
|
+
container.setAttribute("data-portal", "true");
|
|
544
|
+
target.appendChild(container);
|
|
545
|
+
const dispose = render(code, container, options);
|
|
546
|
+
return () => {
|
|
547
|
+
dispose();
|
|
548
|
+
if (target.contains(container)) {
|
|
549
|
+
target.removeChild(container);
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
function isRenderable(value) {
|
|
554
|
+
if (value == null) return true;
|
|
555
|
+
if (typeof value === "function") return true;
|
|
556
|
+
if (isDOMNode(value)) return true;
|
|
557
|
+
if (isLitTemplateResult(value)) return true;
|
|
558
|
+
if (Array.isArray(value)) return true;
|
|
559
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
560
|
+
return true;
|
|
561
|
+
}
|
|
562
|
+
return false;
|
|
563
|
+
}
|
|
564
|
+
function initDelegation() {
|
|
565
|
+
if (isServer3()) return;
|
|
566
|
+
delegateEvents(["click", "input", "change", "submit"]);
|
|
567
|
+
}
|
|
568
|
+
function cleanupDelegation() {
|
|
569
|
+
if (isServer3()) return;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// src/lib/context/context.ts
|
|
573
|
+
import { asProvider } from "@fluixi/dom";
|
|
574
|
+
import { createContext as createReactiveContext, useContext as useReactiveContext } from "@fluixi/reactive/signal";
|
|
575
|
+
import {
|
|
576
|
+
readChildren as readChildren2
|
|
577
|
+
} from "@fluixi/reactive/signal";
|
|
578
|
+
var _warnedEagerProvider = false;
|
|
579
|
+
function warnEagerProvider() {
|
|
580
|
+
if (_warnedEagerProvider) return;
|
|
581
|
+
_warnedEagerProvider = true;
|
|
582
|
+
if (typeof process !== "undefined" && true) return;
|
|
583
|
+
console.warn(
|
|
584
|
+
"[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={...}>{props.children}</Context.Provider>"
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
function createProvider(a, value, childProps) {
|
|
588
|
+
const isLazyForm = !!a?.Provider;
|
|
589
|
+
const context = isLazyForm ? a : a.context;
|
|
590
|
+
const rawValue = isLazyForm ? value : a.value;
|
|
591
|
+
const debug = isLazyForm ? false : a.debug ?? false;
|
|
592
|
+
if (!isLazyForm) warnEagerProvider();
|
|
593
|
+
const resolvedValue = typeof rawValue === "function" ? rawValue() : rawValue;
|
|
594
|
+
const sourceProps = isLazyForm ? childProps : a;
|
|
595
|
+
return context.Provider({
|
|
596
|
+
value: resolvedValue,
|
|
597
|
+
get children() {
|
|
598
|
+
return sourceProps?.children;
|
|
599
|
+
},
|
|
600
|
+
debug
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
function createContextWithProvider(defaultValue) {
|
|
604
|
+
const context = createContext3(defaultValue);
|
|
605
|
+
const provider = (props) => {
|
|
606
|
+
return createProvider(context, props.value, props);
|
|
607
|
+
};
|
|
608
|
+
return [context, provider];
|
|
609
|
+
}
|
|
610
|
+
function composeProviders(contexts, children) {
|
|
611
|
+
if (contexts.length === 0) {
|
|
612
|
+
return readChildren2(() => children);
|
|
613
|
+
}
|
|
614
|
+
const [context, value] = contexts[0];
|
|
615
|
+
const remaining = contexts.slice(1);
|
|
616
|
+
return createProvider(context, value, {
|
|
617
|
+
get children() {
|
|
618
|
+
return composeProviders(remaining, children);
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
function createConsumer(context) {
|
|
623
|
+
return (props) => {
|
|
624
|
+
const value = useContext3(context);
|
|
625
|
+
return props.children(value);
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
function useProvide(context, factory) {
|
|
629
|
+
const existing = useContext3(context);
|
|
630
|
+
if (existing === context.defaultValue) {
|
|
631
|
+
return factory();
|
|
632
|
+
}
|
|
633
|
+
return existing;
|
|
634
|
+
}
|
|
635
|
+
function createContext3(defaultValue, name) {
|
|
636
|
+
const context = createReactiveContext(defaultValue, name);
|
|
637
|
+
const Provider = (props) => {
|
|
638
|
+
if (props.debug === true) {
|
|
639
|
+
}
|
|
640
|
+
return context.Provider({
|
|
641
|
+
value: props.value,
|
|
642
|
+
get children() {
|
|
643
|
+
return props.children;
|
|
644
|
+
},
|
|
645
|
+
debug: props.debug
|
|
646
|
+
});
|
|
647
|
+
};
|
|
648
|
+
if (typeof Symbol !== "undefined" && Symbol.for) {
|
|
649
|
+
Provider.$$typeof = /* @__PURE__ */ Symbol.for("react.provider");
|
|
650
|
+
}
|
|
651
|
+
Provider.$$typeof = /* @__PURE__ */ Symbol.for("react.provider");
|
|
652
|
+
return {
|
|
653
|
+
id: context.id,
|
|
654
|
+
Provider: asProvider(Provider),
|
|
655
|
+
defaultValue
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function useContext3(context) {
|
|
659
|
+
const value = useReactiveContext(context);
|
|
660
|
+
return value !== void 0 ? value : context.defaultValue;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
// src/lib/isomorphic.ts
|
|
664
|
+
import { createSignal as createSignal4, createMemo as createMemo5 } from "@fluixi/reactive/signal";
|
|
665
|
+
import { getServerData } from "@fluixi/dom";
|
|
666
|
+
var REGISTRY_KEY = "__fluixi_iso_states__";
|
|
667
|
+
var SEED_PREFIX = "__iso:";
|
|
668
|
+
function registry() {
|
|
669
|
+
return globalThis[REGISTRY_KEY] ??= /* @__PURE__ */ new Map();
|
|
670
|
+
}
|
|
671
|
+
function readSeed(key) {
|
|
672
|
+
if (typeof window === "undefined") return void 0;
|
|
673
|
+
const data = getServerData();
|
|
674
|
+
return data ? data[SEED_PREFIX + key] : void 0;
|
|
675
|
+
}
|
|
676
|
+
function createIsomorphicState(key, options) {
|
|
677
|
+
const seed = readSeed(key);
|
|
678
|
+
const initial = seed !== void 0 ? seed : typeof window !== "undefined" && options.client ? options.client() : options.fallback;
|
|
679
|
+
const [value, set] = createSignal4(initial);
|
|
680
|
+
registry().set(key, { server: options.server, set });
|
|
681
|
+
return { value, set, key };
|
|
682
|
+
}
|
|
683
|
+
function createIsomorphicStore(key, options) {
|
|
684
|
+
const seeded = readSeed(key) !== void 0;
|
|
685
|
+
const base = createIsomorphicState(key, {
|
|
686
|
+
server: options.server,
|
|
687
|
+
fallback: options.fallback
|
|
688
|
+
});
|
|
689
|
+
const value = () => base.value() ?? options.fallback;
|
|
690
|
+
const persistWrite = (v) => {
|
|
691
|
+
if (!options.persist || typeof localStorage === "undefined") return;
|
|
692
|
+
try {
|
|
693
|
+
localStorage.setItem(options.persist, JSON.stringify(v));
|
|
694
|
+
} catch {
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
const set = (v) => {
|
|
698
|
+
base.set(v);
|
|
699
|
+
persistWrite(v);
|
|
700
|
+
};
|
|
701
|
+
const setField = (k, val) => {
|
|
702
|
+
set({ ...value(), [k]: val });
|
|
703
|
+
};
|
|
704
|
+
const fields = {};
|
|
705
|
+
for (const k of Object.keys(options.fallback)) {
|
|
706
|
+
fields[k] = createMemo5(() => value()[k]);
|
|
707
|
+
}
|
|
708
|
+
let initPromise = null;
|
|
709
|
+
const ensureInit = () => {
|
|
710
|
+
if (seeded || !options.client) return Promise.resolve();
|
|
711
|
+
if (!initPromise) {
|
|
712
|
+
initPromise = Promise.resolve(options.client()).then((v) => {
|
|
713
|
+
set(v);
|
|
714
|
+
}).catch((e) => {
|
|
715
|
+
initPromise = null;
|
|
716
|
+
throw e;
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
return initPromise;
|
|
720
|
+
};
|
|
721
|
+
return { value, fields, set, setField, ensureInit, key };
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// src/lib/env/index.ts
|
|
725
|
+
import { isServer as isServer4 } from "@fluixi/dom";
|
|
726
|
+
import { isServer as onServer } from "@fluixi/dom";
|
|
727
|
+
function isClient() {
|
|
728
|
+
return !onServer();
|
|
729
|
+
}
|
|
730
|
+
function createMemoryStorage() {
|
|
731
|
+
const mem = /* @__PURE__ */ new Map();
|
|
732
|
+
return {
|
|
733
|
+
getItem: (k) => mem.has(k) ? mem.get(k) : null,
|
|
734
|
+
setItem: (k, v) => void mem.set(k, String(v)),
|
|
735
|
+
removeItem: (k) => void mem.delete(k),
|
|
736
|
+
clear: () => mem.clear(),
|
|
737
|
+
key: (i) => Array.from(mem.keys())[i] ?? null,
|
|
738
|
+
get length() {
|
|
739
|
+
return mem.size;
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
var storage = typeof localStorage !== "undefined" ? localStorage : createMemoryStorage();
|
|
744
|
+
var env = {
|
|
745
|
+
get window() {
|
|
746
|
+
return typeof window !== "undefined" ? window : void 0;
|
|
747
|
+
},
|
|
748
|
+
get document() {
|
|
749
|
+
return typeof document !== "undefined" ? document : void 0;
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
function clientOnly(fn, fallback) {
|
|
753
|
+
return isClient() ? fn() : fallback;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// src/lib/theme/index.ts
|
|
757
|
+
import { createSignal as createSignal5 } from "@fluixi/reactive/signal";
|
|
758
|
+
function systemMap(system) {
|
|
759
|
+
if (!system) return null;
|
|
760
|
+
if (system === true) return { dark: "dark", light: "light" };
|
|
761
|
+
return system;
|
|
762
|
+
}
|
|
763
|
+
function createTheme(options) {
|
|
764
|
+
const storageKey = options.storageKey ?? "theme";
|
|
765
|
+
const attribute = options.attribute ?? "data-theme";
|
|
766
|
+
const sys = systemMap(options.system);
|
|
767
|
+
const detectInitial = () => {
|
|
768
|
+
const stored = storage.getItem(storageKey);
|
|
769
|
+
if (stored && options.themes.includes(stored)) return stored;
|
|
770
|
+
if (sys && env.window?.matchMedia?.("(prefers-color-scheme: dark)")?.matches) return sys.dark;
|
|
771
|
+
if (sys) return sys.light;
|
|
772
|
+
return options.default;
|
|
773
|
+
};
|
|
774
|
+
const [value, setValue] = createSignal5(detectInitial());
|
|
775
|
+
const [isLoading, setLoading] = createSignal5(false);
|
|
776
|
+
const apply = (t) => {
|
|
777
|
+
env.document?.documentElement.setAttribute(attribute, t);
|
|
778
|
+
try {
|
|
779
|
+
storage.setItem(storageKey, t);
|
|
780
|
+
} catch {
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
const set = (t) => {
|
|
784
|
+
if (!options.themes.includes(t)) return;
|
|
785
|
+
const prev = value();
|
|
786
|
+
setValue(() => t);
|
|
787
|
+
apply(t);
|
|
788
|
+
options.onChange?.(t, prev);
|
|
789
|
+
if (options.load) {
|
|
790
|
+
setLoading(true);
|
|
791
|
+
options.onLoading?.(t);
|
|
792
|
+
Promise.resolve(options.load(t)).finally(() => {
|
|
793
|
+
setLoading(false);
|
|
794
|
+
options.onLoaded?.(t);
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
};
|
|
798
|
+
const toggle = () => {
|
|
799
|
+
const i = options.themes.indexOf(value());
|
|
800
|
+
set(options.themes[(i + 1) % options.themes.length]);
|
|
801
|
+
};
|
|
802
|
+
const init = () => apply(value());
|
|
803
|
+
const headScript = () => {
|
|
804
|
+
const cfg = JSON.stringify({
|
|
805
|
+
k: storageKey,
|
|
806
|
+
a: attribute,
|
|
807
|
+
d: options.default,
|
|
808
|
+
sys
|
|
809
|
+
});
|
|
810
|
+
return `<script>(function(){try{var c=${cfg},t=localStorage.getItem(c.k);if(!t&&c.sys)t=matchMedia('(prefers-color-scheme: dark)').matches?c.sys.dark:c.sys.light;if(!t)t=c.d;document.documentElement.setAttribute(c.a,t);}catch(e){}})();<\/script>`;
|
|
811
|
+
};
|
|
812
|
+
return { value, isLoading, set, toggle, init, headScript };
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// src/lib/router/index.ts
|
|
816
|
+
import {
|
|
817
|
+
createSignal as createSignal7,
|
|
818
|
+
createMemo as createMemo6,
|
|
819
|
+
createResource as createResource5,
|
|
820
|
+
createEffect as createEffect3,
|
|
821
|
+
getOwner as getOwner2,
|
|
822
|
+
onCleanup as onCleanup2,
|
|
823
|
+
untrack as untrack3
|
|
824
|
+
} from "@fluixi/reactive/signal";
|
|
825
|
+
import {
|
|
826
|
+
insert as insert2,
|
|
827
|
+
createComponent as createComponent4,
|
|
828
|
+
createNativeElement,
|
|
829
|
+
setAttribute
|
|
830
|
+
} from "@fluixi/dom";
|
|
831
|
+
import { createContext as createContext4, useContext as useContext4 } from "@fluixi/reactive/signal";
|
|
832
|
+
import { get } from "@fluixi/utils/object";
|
|
833
|
+
import { deepEqual } from "@fluixi/utils/compare";
|
|
834
|
+
import {
|
|
835
|
+
createRouter as createCoreRouter,
|
|
836
|
+
createBrowserHistory,
|
|
837
|
+
matchRoutes,
|
|
838
|
+
matchPath
|
|
839
|
+
} from "@fluixi/router";
|
|
840
|
+
import {
|
|
841
|
+
createMemoryHistory,
|
|
842
|
+
createBrowserHistory as createBrowserHistory2,
|
|
843
|
+
matchRoutes as matchRoutes2,
|
|
844
|
+
matchPath as matchPath2
|
|
845
|
+
} from "@fluixi/router";
|
|
846
|
+
|
|
847
|
+
// src/lib/router/data.ts
|
|
848
|
+
import {
|
|
849
|
+
createResource as createResource4,
|
|
850
|
+
createSignal as createSignal6
|
|
851
|
+
} from "@fluixi/reactive/signal";
|
|
852
|
+
|
|
853
|
+
// src/lib/server/hydration.ts
|
|
854
|
+
import { isServer as domIsServer } from "@fluixi/dom";
|
|
855
|
+
var hydrationDataMap = /* @__PURE__ */ new Map();
|
|
856
|
+
function clearHydrationData() {
|
|
857
|
+
hydrationDataMap.clear();
|
|
858
|
+
}
|
|
859
|
+
function cleanupHydration() {
|
|
860
|
+
if (typeof window === "undefined") {
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
const script = document.getElementById("__FLUIXI_HYDRATION__");
|
|
864
|
+
if (script) {
|
|
865
|
+
script.remove();
|
|
866
|
+
}
|
|
867
|
+
const walker = document.createTreeWalker(
|
|
868
|
+
document.body,
|
|
869
|
+
NodeFilter.SHOW_COMMENT,
|
|
870
|
+
null
|
|
871
|
+
);
|
|
872
|
+
const comments = [];
|
|
873
|
+
let node;
|
|
874
|
+
while (node = walker.nextNode()) {
|
|
875
|
+
const comment = node;
|
|
876
|
+
const text = comment.nodeValue || "";
|
|
877
|
+
if (text.startsWith("#") || text.startsWith("/")) {
|
|
878
|
+
comments.push(comment);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
comments.forEach((comment) => comment.remove());
|
|
882
|
+
clearHydrationData();
|
|
883
|
+
}
|
|
884
|
+
if (typeof window !== "undefined") {
|
|
885
|
+
window.addEventListener("load", () => {
|
|
886
|
+
setTimeout(cleanupHydration, 100);
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// src/lib/router/data.ts
|
|
891
|
+
var [revalidationVersion, setRevalidationVersion] = createSignal6(0);
|
|
892
|
+
var RouteDataContext = createContext3(void 0, "route-data");
|
|
893
|
+
var RouteDataProvider = RouteDataContext.Provider;
|
|
894
|
+
|
|
895
|
+
// src/lib/router/index.ts
|
|
896
|
+
import { runWithOwner as runWithOwner2 } from "@fluixi/reactive/signal";
|
|
897
|
+
var RouterContext = createContext4(void 0, "router");
|
|
898
|
+
var OutletContext = createContext4(void 0, "outlet");
|
|
899
|
+
var LevelParamsContext = createContext4(void 0, "route-params");
|
|
900
|
+
var RouteDataContext2 = createContext4(void 0, "route-data");
|
|
901
|
+
function renderLayer(m, depth, base) {
|
|
902
|
+
let data;
|
|
903
|
+
const loader = m.route.data;
|
|
904
|
+
if (typeof loader === "function") {
|
|
905
|
+
let cancelled = false;
|
|
906
|
+
onCleanup2(() => {
|
|
907
|
+
cancelled = true;
|
|
908
|
+
});
|
|
909
|
+
const owner = getOwner2();
|
|
910
|
+
const [resource2] = createResource5(
|
|
911
|
+
() => loader({ params: base.params, location: base.location }, owner, () => cancelled)
|
|
912
|
+
);
|
|
913
|
+
data = resource2;
|
|
914
|
+
}
|
|
915
|
+
const buildPage = () => RouteDataContext2.Provider({
|
|
916
|
+
value: data,
|
|
917
|
+
get children() {
|
|
918
|
+
return LevelParamsContext.Provider({
|
|
919
|
+
value: m.params,
|
|
920
|
+
get children() {
|
|
921
|
+
return OutletContext.Provider({
|
|
922
|
+
value: { depth, ...base },
|
|
923
|
+
get children() {
|
|
924
|
+
return createComponent4(m.component, {});
|
|
925
|
+
}
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
});
|
|
931
|
+
if (!data) return buildPage();
|
|
932
|
+
const res = data;
|
|
933
|
+
const isLoading = () => res.loading;
|
|
934
|
+
const [ready, setReady] = createSignal7(untrack3(() => !isLoading()));
|
|
935
|
+
createEffect3(() => setReady(!isLoading()));
|
|
936
|
+
return createMemo6(() => ready() ? buildPage() : null);
|
|
937
|
+
}
|
|
938
|
+
function renderChild(ctx) {
|
|
939
|
+
const childIdx = ctx.depth + 1;
|
|
940
|
+
const [childComp, setChildComp] = createSignal7(
|
|
941
|
+
untrack3(() => ctx.matched()[childIdx]?.component)
|
|
942
|
+
);
|
|
943
|
+
createEffect3(() => {
|
|
944
|
+
const c = ctx.matched()[childIdx]?.component;
|
|
945
|
+
setChildComp(() => c);
|
|
946
|
+
});
|
|
947
|
+
return createMemo6(() => {
|
|
948
|
+
const component = childComp();
|
|
949
|
+
if (!component) {
|
|
950
|
+
return ctx.notFound ? ctx.notFound() : null;
|
|
951
|
+
}
|
|
952
|
+
const m = untrack3(() => ctx.matched())[childIdx];
|
|
953
|
+
return renderLayer(m, childIdx, {
|
|
954
|
+
matched: ctx.matched,
|
|
955
|
+
params: ctx.params,
|
|
956
|
+
location: ctx.location
|
|
957
|
+
});
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
function renderNotFound(notFound) {
|
|
961
|
+
if (notFound == null) return buildDefaultNotFound();
|
|
962
|
+
return typeof notFound === "function" ? createComponent4(notFound, {}) : notFound;
|
|
963
|
+
}
|
|
964
|
+
function buildDefaultNotFound() {
|
|
965
|
+
const el = createNativeElement("div");
|
|
966
|
+
setAttribute(el, "class", "fx-not-found");
|
|
967
|
+
setAttribute(el, "role", "main");
|
|
968
|
+
setAttribute(
|
|
969
|
+
el,
|
|
970
|
+
"style",
|
|
971
|
+
"min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif"
|
|
972
|
+
);
|
|
973
|
+
const h1 = createNativeElement("h1");
|
|
974
|
+
setAttribute(h1, "style", "margin:0;font-size:2.5rem;font-weight:700");
|
|
975
|
+
insert2(h1, "404");
|
|
976
|
+
const p = createNativeElement("p");
|
|
977
|
+
setAttribute(p, "style", "margin:0;opacity:.7");
|
|
978
|
+
insert2(p, "This page could not be found.");
|
|
979
|
+
el.appendChild(h1);
|
|
980
|
+
el.appendChild(p);
|
|
981
|
+
return el;
|
|
982
|
+
}
|
|
983
|
+
function Router(props) {
|
|
984
|
+
const history = props.history ?? createBrowserHistory();
|
|
985
|
+
const router = createCoreRouter({
|
|
986
|
+
routes: props.routes,
|
|
987
|
+
base: props.base,
|
|
988
|
+
history
|
|
989
|
+
});
|
|
990
|
+
const [state, setState] = createSignal7(router.state());
|
|
991
|
+
const unsub = router.subscribe(setState);
|
|
992
|
+
onCleanup2(() => {
|
|
993
|
+
unsub();
|
|
994
|
+
router.destroy();
|
|
995
|
+
});
|
|
996
|
+
const matched = createMemo6(
|
|
997
|
+
() => (state().match?.matched ?? []).filter((m) => m.component)
|
|
998
|
+
);
|
|
999
|
+
const ctx = {
|
|
1000
|
+
router,
|
|
1001
|
+
location: createMemo6(() => state().location),
|
|
1002
|
+
params: createMemo6(() => state().match?.params ?? {})
|
|
1003
|
+
};
|
|
1004
|
+
const root = {
|
|
1005
|
+
depth: -1,
|
|
1006
|
+
matched,
|
|
1007
|
+
params: ctx.params,
|
|
1008
|
+
location: ctx.location,
|
|
1009
|
+
// Only the root carries this: renderChild shows it when the URL matched nothing.
|
|
1010
|
+
notFound: () => renderNotFound(props.notFound)
|
|
1011
|
+
};
|
|
1012
|
+
let rootView;
|
|
1013
|
+
return RouterContext.Provider({
|
|
1014
|
+
value: ctx,
|
|
1015
|
+
get children() {
|
|
1016
|
+
return rootView ??= renderChild(root);
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
var _ssrRouterStub = {
|
|
1021
|
+
router: { navigate: () => {
|
|
1022
|
+
} },
|
|
1023
|
+
location: () => ({ pathname: "", search: "", hash: "", query: {} }),
|
|
1024
|
+
params: () => ({})
|
|
1025
|
+
};
|
|
1026
|
+
function useRouter() {
|
|
1027
|
+
const ctx = useContext4(RouterContext);
|
|
1028
|
+
if (ctx) return ctx;
|
|
1029
|
+
if (typeof window === "undefined") return _ssrRouterStub;
|
|
1030
|
+
throw new Error("[router] useRouter must be used within <Router>");
|
|
1031
|
+
}
|
|
1032
|
+
function useParams() {
|
|
1033
|
+
const params = useRouter().params;
|
|
1034
|
+
return createMemo6(() => params(), {}, {
|
|
1035
|
+
equals: (a, b) => JSON.stringify(a) === JSON.stringify(b)
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
function useLocation() {
|
|
1039
|
+
const { location } = useRouter();
|
|
1040
|
+
return new Proxy({}, {
|
|
1041
|
+
get: (_t, key) => location()[key],
|
|
1042
|
+
has: (_t, key) => key in location(),
|
|
1043
|
+
ownKeys: () => Reflect.ownKeys(location()),
|
|
1044
|
+
getOwnPropertyDescriptor: (_t, key) => Object.getOwnPropertyDescriptor(location(), key)
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
1047
|
+
function useNavigate() {
|
|
1048
|
+
const { router } = useRouter();
|
|
1049
|
+
return (to, options) => router.navigate(to, options);
|
|
1050
|
+
}
|
|
1051
|
+
var read = (v) => typeof v === "function" ? v() : v;
|
|
1052
|
+
var LINK_OWN_PROPS = /* @__PURE__ */ new Set([
|
|
1053
|
+
"href",
|
|
1054
|
+
"slot",
|
|
1055
|
+
"class",
|
|
1056
|
+
"className",
|
|
1057
|
+
"active",
|
|
1058
|
+
"activeClass",
|
|
1059
|
+
"replace",
|
|
1060
|
+
"children"
|
|
1061
|
+
]);
|
|
1062
|
+
function Link(props) {
|
|
1063
|
+
const ctx = useContext4(RouterContext);
|
|
1064
|
+
const navigate = () => ctx?.router.navigate(read(props.href) ?? "", { replace: read(props.replace) });
|
|
1065
|
+
const a = createNativeElement("a");
|
|
1066
|
+
setAttribute(a, "href", read(props.href) ?? "");
|
|
1067
|
+
if (props.slot) setAttribute(a, "slot", read(props.slot));
|
|
1068
|
+
for (const k of Object.keys(props)) {
|
|
1069
|
+
if (LINK_OWN_PROPS.has(k)) continue;
|
|
1070
|
+
const v = props[k];
|
|
1071
|
+
if (v != null && typeof v !== "function") setAttribute(a, k, String(v));
|
|
1072
|
+
}
|
|
1073
|
+
if (typeof a.addEventListener === "function") {
|
|
1074
|
+
a.addEventListener("click", (e) => {
|
|
1075
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
1076
|
+
e.preventDefault();
|
|
1077
|
+
navigate();
|
|
1078
|
+
});
|
|
1079
|
+
} else {
|
|
1080
|
+
const base = read(props.className ?? props.class) ?? "";
|
|
1081
|
+
if (base) setAttribute(a, "class", base);
|
|
1082
|
+
}
|
|
1083
|
+
if (typeof a.addEventListener === "function") {
|
|
1084
|
+
createEffect3(() => {
|
|
1085
|
+
const href = read(props.href) ?? "";
|
|
1086
|
+
a.setAttribute("href", href);
|
|
1087
|
+
const base = read(props.className ?? props.class) ?? "";
|
|
1088
|
+
const activeClass = read(props.activeClass) ?? "";
|
|
1089
|
+
const active = read(props.active) ?? ctx?.location().pathname === href;
|
|
1090
|
+
a.className = [base, active ? activeClass : ""].filter(Boolean).join(" ");
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
const linkChildren = props.children;
|
|
1094
|
+
if (linkChildren != null) insert2(a, linkChildren);
|
|
1095
|
+
return a;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
// src/lib/core.ts
|
|
1099
|
+
import { html, svg } from "@fluixi/dom";
|
|
1100
|
+
import {
|
|
1101
|
+
query,
|
|
1102
|
+
queryAll,
|
|
1103
|
+
closest,
|
|
1104
|
+
addClass,
|
|
1105
|
+
removeClass,
|
|
1106
|
+
toggleClass,
|
|
1107
|
+
hasClass,
|
|
1108
|
+
setAttribute as setAttribute2,
|
|
1109
|
+
getAttribute,
|
|
1110
|
+
removeAttribute,
|
|
1111
|
+
setStyles,
|
|
1112
|
+
getStyle,
|
|
1113
|
+
createElement,
|
|
1114
|
+
removeChildren,
|
|
1115
|
+
appendChildren,
|
|
1116
|
+
isVisible,
|
|
1117
|
+
scrollIntoView,
|
|
1118
|
+
getOffset,
|
|
1119
|
+
delegate,
|
|
1120
|
+
waitForElement,
|
|
1121
|
+
observeIntersection as observeIntersection2,
|
|
1122
|
+
observeResize
|
|
1123
|
+
} from "@fluixi/dom";
|
|
1124
|
+
import {
|
|
1125
|
+
classMap,
|
|
1126
|
+
styleMap,
|
|
1127
|
+
Island,
|
|
1128
|
+
hydrateIslands,
|
|
1129
|
+
mergeProps,
|
|
1130
|
+
splitProps
|
|
1131
|
+
} from "@fluixi/dom";
|
|
1132
|
+
|
|
1133
|
+
// src/lib/control-flow.ts
|
|
1134
|
+
import {
|
|
1135
|
+
Show,
|
|
1136
|
+
For,
|
|
1137
|
+
Index,
|
|
1138
|
+
Switch,
|
|
1139
|
+
Match,
|
|
1140
|
+
Dynamic,
|
|
1141
|
+
ErrorBoundary,
|
|
1142
|
+
Portal,
|
|
1143
|
+
ClientOnly,
|
|
1144
|
+
NoSsr
|
|
1145
|
+
} from "@fluixi/dom";
|
|
1146
|
+
|
|
1147
|
+
// src/lib/core.ts
|
|
1148
|
+
import { createStore, untrackStore, unwrap, Store } from "@fluixi/reactive/store";
|
|
1149
|
+
var VERSION2 = "0.0.1";
|
|
1150
|
+
var FRAMEWORK_NAME = "Fluixi";
|
|
1151
|
+
var core_default = {
|
|
1152
|
+
// Core
|
|
1153
|
+
createComponent,
|
|
1154
|
+
// render,
|
|
1155
|
+
onMount,
|
|
1156
|
+
onUnmount,
|
|
1157
|
+
createEffect: createEffect4,
|
|
1158
|
+
createMemo: createMemo7,
|
|
1159
|
+
createSignal: createSignal8,
|
|
1160
|
+
createContext: createContext3,
|
|
1161
|
+
createRoot: createRoot3,
|
|
1162
|
+
createDeferred: createDeferred2,
|
|
1163
|
+
createComputed: createComputed2,
|
|
1164
|
+
createRenderEffect: createRenderEffect3,
|
|
1165
|
+
createSelector,
|
|
1166
|
+
onCleanup: onCleanup3,
|
|
1167
|
+
getOwner: getOwner3,
|
|
1168
|
+
runWithOwner: runWithOwner3,
|
|
1169
|
+
batch: batch2,
|
|
1170
|
+
untrack: untrack4,
|
|
1171
|
+
useContext: useContext3,
|
|
1172
|
+
setOwner,
|
|
1173
|
+
// Control Flow
|
|
1174
|
+
// Show,
|
|
1175
|
+
// For,
|
|
1176
|
+
// Switch,
|
|
1177
|
+
// Match,
|
|
1178
|
+
// Portal,
|
|
1179
|
+
// Dynamic,
|
|
1180
|
+
// Context
|
|
1181
|
+
// Provider,
|
|
1182
|
+
// Resources
|
|
1183
|
+
// createResource,
|
|
1184
|
+
// Router
|
|
1185
|
+
// createRouter,
|
|
1186
|
+
Router,
|
|
1187
|
+
Link,
|
|
1188
|
+
useRouter,
|
|
1189
|
+
useNavigate,
|
|
1190
|
+
read: read2,
|
|
1191
|
+
reduce,
|
|
1192
|
+
// Meta
|
|
1193
|
+
VERSION: VERSION2,
|
|
1194
|
+
FRAMEWORK_NAME
|
|
1195
|
+
};
|
|
1196
|
+
export {
|
|
1197
|
+
$component,
|
|
1198
|
+
Await,
|
|
1199
|
+
ClientOnly,
|
|
1200
|
+
Dynamic,
|
|
1201
|
+
ErrorBoundary,
|
|
1202
|
+
FRAMEWORK_NAME,
|
|
1203
|
+
For,
|
|
1204
|
+
Index,
|
|
1205
|
+
Island,
|
|
1206
|
+
Link,
|
|
1207
|
+
Match,
|
|
1208
|
+
NoSsr,
|
|
1209
|
+
Portal,
|
|
1210
|
+
Router,
|
|
1211
|
+
Show,
|
|
1212
|
+
Store,
|
|
1213
|
+
Suspense,
|
|
1214
|
+
SuspenseList,
|
|
1215
|
+
Switch,
|
|
1216
|
+
VERSION,
|
|
1217
|
+
addClass,
|
|
1218
|
+
appendChildren,
|
|
1219
|
+
batch2 as batch,
|
|
1220
|
+
classMap,
|
|
1221
|
+
cleanupDelegation,
|
|
1222
|
+
clientOnly,
|
|
1223
|
+
closest,
|
|
1224
|
+
composeProviders,
|
|
1225
|
+
createComponent,
|
|
1226
|
+
createComputed2 as createComputed,
|
|
1227
|
+
createConsumer,
|
|
1228
|
+
createContext3 as createContext,
|
|
1229
|
+
createContextWithProvider,
|
|
1230
|
+
createDebounce,
|
|
1231
|
+
createDebouncedResource,
|
|
1232
|
+
createDebouncedSignal,
|
|
1233
|
+
createDeferred2 as createDeferred,
|
|
1234
|
+
createEffect4 as createEffect,
|
|
1235
|
+
createIsomorphicState,
|
|
1236
|
+
createIsomorphicStore,
|
|
1237
|
+
createMemo7 as createMemo,
|
|
1238
|
+
createMemoryStorage,
|
|
1239
|
+
createProvider,
|
|
1240
|
+
createRenderEffect3 as createRenderEffect,
|
|
1241
|
+
createResource6 as createResource,
|
|
1242
|
+
createRoot3 as createRoot,
|
|
1243
|
+
createSelector,
|
|
1244
|
+
createSignal8 as createSignal,
|
|
1245
|
+
createStore,
|
|
1246
|
+
createTheme,
|
|
1247
|
+
core_default as default,
|
|
1248
|
+
deferred,
|
|
1249
|
+
delegate,
|
|
1250
|
+
createElement as domCreateElement,
|
|
1251
|
+
effect,
|
|
1252
|
+
env,
|
|
1253
|
+
getAttribute,
|
|
1254
|
+
getOffset,
|
|
1255
|
+
getOwner3 as getOwner,
|
|
1256
|
+
getStyle,
|
|
1257
|
+
hasClass,
|
|
1258
|
+
html,
|
|
1259
|
+
hydrateIslands,
|
|
1260
|
+
initDelegation,
|
|
1261
|
+
isClient,
|
|
1262
|
+
isJSXElement,
|
|
1263
|
+
isLitResult,
|
|
1264
|
+
isNode,
|
|
1265
|
+
isRenderable,
|
|
1266
|
+
isServer4 as isServer,
|
|
1267
|
+
isVisible,
|
|
1268
|
+
lazy,
|
|
1269
|
+
memo,
|
|
1270
|
+
mergeProps,
|
|
1271
|
+
observeIntersection2 as observeIntersection,
|
|
1272
|
+
observeResize,
|
|
1273
|
+
onCleanup3 as onCleanup,
|
|
1274
|
+
onMount,
|
|
1275
|
+
onUnmount,
|
|
1276
|
+
portal,
|
|
1277
|
+
query,
|
|
1278
|
+
queryAll,
|
|
1279
|
+
read2 as read,
|
|
1280
|
+
reduce,
|
|
1281
|
+
removeAttribute,
|
|
1282
|
+
removeChildren,
|
|
1283
|
+
removeClass,
|
|
1284
|
+
render,
|
|
1285
|
+
resource,
|
|
1286
|
+
runWithOwner3 as runWithOwner,
|
|
1287
|
+
scrollIntoView,
|
|
1288
|
+
setAttribute2 as setAttribute,
|
|
1289
|
+
setOwner,
|
|
1290
|
+
setStyles,
|
|
1291
|
+
signal,
|
|
1292
|
+
splitProps,
|
|
1293
|
+
storage,
|
|
1294
|
+
styleMap,
|
|
1295
|
+
svg,
|
|
1296
|
+
toggleClass,
|
|
1297
|
+
untrack4 as untrack,
|
|
1298
|
+
untrackStore,
|
|
1299
|
+
unwrap,
|
|
1300
|
+
useCallback,
|
|
1301
|
+
useContext3 as useContext,
|
|
1302
|
+
useEffect,
|
|
1303
|
+
useEventListener,
|
|
1304
|
+
useLocation,
|
|
1305
|
+
useMemo,
|
|
1306
|
+
useNavigate,
|
|
1307
|
+
useParams,
|
|
1308
|
+
useProvide,
|
|
1309
|
+
useReducer,
|
|
1310
|
+
useRef,
|
|
1311
|
+
useRouter,
|
|
1312
|
+
waitForElement
|
|
1313
|
+
};
|