@fluixi/core 1.0.0-alpha.57 → 1.0.0-alpha.59
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 +1 -1
- package/dist/src/cdn/{chunk-DYBLT5DZ.mjs → chunk-AIX3WBJF.mjs} +1 -1
- package/dist/src/cdn/core.cjs +1 -1
- package/dist/src/cdn/core.mjs +1 -1
- package/dist/src/cdn/{router-next-2MKUMMEE.mjs → router-next-X2F3TRKJ.mjs} +1 -1
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.mjs +1 -1
- package/dist/src/lib/client/index.cjs +1 -1
- package/dist/src/lib/client/index.mjs +1 -1
- package/dist/src/lib/client/router-next-DZMNYSCE.mjs +1 -0
- package/dist/src/lib/core.cjs +1 -1
- package/dist/src/lib/core.mjs +1 -1
- package/dist/src/lib/router-next/index.cjs +1 -1
- package/dist/src/lib/router-next/index.d.ts.map +1 -1
- package/dist/src/lib/router-next/index.js +24 -0
- package/dist/src/lib/router-next/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/dist/src/lib/client/router-next-F5ZKD3JR.mjs +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluixi/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.59",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Solid-Compatible Fine-Grained UI Framework",
|
|
6
6
|
"private": false,
|
|
@@ -84,15 +84,15 @@
|
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"vite-plugin-node-polyfills": "^0.25.0",
|
|
87
|
-
"@fluixi/compiler": "1.0.0-alpha.
|
|
88
|
-
"@fluixi/dom": "1.0.0-alpha.
|
|
89
|
-
"@fluixi/jsx": "1.0.0-alpha.
|
|
90
|
-
"@fluixi/vite-plugin": "1.0.0-alpha.
|
|
91
|
-
"@fluixi/reactive": "1.0.0-alpha.
|
|
87
|
+
"@fluixi/compiler": "1.0.0-alpha.59",
|
|
88
|
+
"@fluixi/dom": "1.0.0-alpha.59",
|
|
89
|
+
"@fluixi/jsx": "1.0.0-alpha.59",
|
|
90
|
+
"@fluixi/vite-plugin": "1.0.0-alpha.59",
|
|
91
|
+
"@fluixi/reactive": "1.0.0-alpha.59",
|
|
92
92
|
"@fluixi/router": "0.1.2-alpha.3",
|
|
93
|
-
"@fluixi/server": "1.0.0-alpha.
|
|
94
|
-
"@fluixi/utils": "1.0.0-alpha.
|
|
95
|
-
"@fluixi/head": "1.0.0-alpha.
|
|
93
|
+
"@fluixi/server": "1.0.0-alpha.59",
|
|
94
|
+
"@fluixi/utils": "1.0.0-alpha.59",
|
|
95
|
+
"@fluixi/head": "1.0.0-alpha.26"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@bambiste/mix-builder": "^0.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as w,c as O,d as L,g as D,h as k,i as B}from"./chunk-45GBRHE6.mjs";import{createSignal as P,createMemo as d,createResource as re,createEffect as A,getOwner as oe,onCleanup as b,untrack as R}from"@fluixi/reactive/signal";import{insert as x,createComponent as F,createNativeElement as g,setAttribute as u}from"@fluixi/dom";import{createContext as T,useContext as y}from"@fluixi/reactive/signal";import{get as ae}from"@fluixi/utils/object";import{deepEqual as se}from"@fluixi/utils/compare";import{createRouter as ie,createBrowserHistory as ce,matchRoutes as ue,matchPath as de}from"@fluixi/router";import{createMemoryHistory as tt,createBrowserHistory as nt,matchRoutes as rt,matchPath as ot}from"@fluixi/router";import{createResource as W,createSignal as N}from"@fluixi/reactive/signal";import{asProvider as I}from"@fluixi/dom";import{createContext as J,useContext as Te}from"@fluixi/reactive/signal";import{readChildren as Pe}from"@fluixi/reactive/signal";k("index");function M(e){let n=J(e),t=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:I(t),defaultValue:e}}var m=new Map,p=new Map;function G(e,n){return async(...t)=>{let o=n+":"+JSON.stringify(t);if(w()||typeof window<"u"){let a=L(o);if(a!==void 0)return a}if(m.has(o))return m.get(o);if(p.has(o))return p.get(o);let r=Promise.resolve(e(...t)).then(a=>(m.set(o,a),p.delete(o),D()&&O(o,a),a),a=>{throw p.delete(o),a});return p.set(o,r),r}}var[ke,X]=N(0),Q=new Set;function Y(e){let n=typeof e=="string"?t=>t.startsWith(e):e;for(let t of m.keys())n(t)&&(m.delete(t),Q.add(t));X(t=>t+1)}function Z(e,n){let[t]=W(n||(()=>!0),e);return t}var C=new Map;function V(e){return C.has(e)||C.set(e,N(void 0)),C.get(e)}function E(e,n){let t=n||e.name||"action",o=async r=>{let[,a]=V(t),s=()=>a(void 0),i=()=>o(r);a({input:r,pending:!0,clear:s,retry:i});try{let c=await e(r);return a({input:r,result:c,pending:!1,clear:s,retry:i}),c}catch(c){throw a({input:r,error:c,pending:!1,clear:s,retry:i}),c}};return o.url=t,o.with=r=>E((...a)=>e(r,...a),n),o}function ee(e){let[n]=V(e.url);return n}function te(e){return e}var ne=M(),Me=ne.Provider;import{runWithOwner as ct}from"@fluixi/reactive/signal";var v=T(),K=T(),U=T(),H=T();function le(e,n,t){let o,r=e.route.data;if(typeof r=="function"){let h=!1;b(()=>{h=!0});let $=oe(),[z]=re(()=>r({params:t.params,location:t.location},$,()=>h));o=z}let a=()=>H.Provider({value:o,get children(){return U.Provider({value:e.params,get children(){return K.Provider({value:{depth:n,...t},get children(){return F(e.component,{})}})}})}});if(!o)return a();let s=o,i=()=>s.loading,[c,l]=P(R(()=>!i()));return A(()=>l(!i())),d(()=>c()?a():null)}function j(e){let n=e.depth+1,[t,o]=P(R(()=>e.matched()[n]?.component));return A(()=>{let r=e.matched()[n]?.component;o(()=>r)}),d(()=>{if(!t())return e.notFound?e.notFound():null;let a=R(()=>e.matched())[n];return le(a,n,{matched:e.matched,params:e.params,location:e.location})})}function fe(e){return e==null?ye():typeof e=="function"?F(e,{}):e}function ye(){let e=g("div");u(e,"class","fx-not-found"),u(e,"role","main"),u(e,"style","min-height:60vh;display:grid;place-content:center;gap:.25rem;text-align:center;font-family:system-ui,-apple-system,sans-serif");let n=g("h1");u(n,"style","margin:0;font-size:2.5rem;font-weight:700"),x(n,"404");let t=g("p");return u(t,"style","margin:0;opacity:.7"),x(t,"This page could not be found."),e.appendChild(n),e.appendChild(t),e}function je(e){let n=e.history??ce(),t=ie({routes:e.routes,base:e.base,history:n}),[o,r]=P(t.state()),a=t.subscribe(r);b(()=>{a(),t.destroy()});let s=d(()=>(o().match?.matched??[]).filter(h=>h.component)),i={router:t,location:d(()=>o().location),params:d(()=>o().match?.params??{})},c={depth:-1,matched:s,params:i.params,location:i.location,notFound:()=>fe(e.notFound)},l;return v.Provider({value:i,get children(){return l??=j(c)}})}function qe(){let e=y(K);return e?j(e):null}function _e(e){let n=y(v);if(!n||typeof window>"u")return null;let t=!1;return b(()=>t=!0),queueMicrotask(()=>{t||n.router.navigate(e.to,{replace:e.replace!==!1})}),null}var pe={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};function S(){let e=y(v);if(e)return e;if(typeof window>"u")return pe;throw new Error("[router-next] useRouter must be used within <Router>")}function q(){let e=S().params;return d(()=>e(),{},{equals:(n,t)=>JSON.stringify(n)===JSON.stringify(t)})}function $e(){return y(U)??{}}function ze(e){let n=q();return d(()=>n()[e])}function Be(e,n){let t=q();return d(()=>e(t()),void 0,n?{equals:n}:void 0)}function Ie(e){let n=_();return d(()=>de(typeof e=="function"?e():e,n.pathname))}function Je(){let e=_(),n=me();return[d(()=>e.query),(r,a)=>{let s=new URLSearchParams(e.search);for(let[c,l]of Object.entries(r))l===null?s.delete(c):s.set(c,l);let i=s.toString();n(e.pathname+(i?`?${i}`:""),a)}]}function We(e,n){let t=(o,r)=>se(o,r);return n!==void 0?d(()=>ae(e(),n),void 0,{equals:t}):d(e,void 0,{equals:t})}function _(){let{location:e}=S();return new Proxy({},{get:(n,t)=>e()[t],has:(n,t)=>t in e(),ownKeys:()=>Reflect.ownKeys(e()),getOwnPropertyDescriptor:(n,t)=>Object.getOwnPropertyDescriptor(e(),t)})}function me(){let{router:e}=S();return(n,t)=>e.navigate(n,t)}function Ge(){return y(H)??(()=>{})}var f=e=>typeof e=="function"?e():e;function ge(e){let n=y(v),t=typeof document>"u",o=()=>n?.router.navigate(f(e.href)??"",{replace:f(e.replace)}),r=g("a");if(u(r,"href",f(e.href)??""),e.slot&&u(r,"slot",f(e.slot)),typeof r.addEventListener=="function")r.addEventListener("click",s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),o())});else{let s=f(e.className??e.class)??"";s&&u(r,"class",s)}typeof r.addEventListener=="function"&&A(()=>{let s=f(e.href)??"";r.setAttribute("href",s);let i=f(e.className??e.class)??"",c=f(e.activeClass)??"",l=f(e.active)??n?.location().pathname===s;r.className=[i,l?c:""].filter(Boolean).join(" ")});let a=e.children;return a!=null&&x(r,a),r}var Xe=ge;function Qe(e){let n=e.action,t=e.className??e.class,o=n.url??"",r=g("form");u(r,"method","post"),o&&u(r,"action",o),t&&u(r,"class",t);for(let[s,i]of Object.entries(e))s==="action"||s==="children"||s==="class"||s==="className"||i!=null&&typeof i!="function"&&u(r,s,String(i));typeof r.addEventListener=="function"&&r.addEventListener("submit",s=>{s.preventDefault();let i={};new FormData(r).forEach((c,l)=>{i[l]=c}),Promise.resolve(n(i)).catch(()=>{})});let a=e.children;return a!=null&&x(r,a),r}async function Ye(e,n){let t=ue(e,n);if(!t)return;let o=[];for(let r of t.matched){let a=r.component;a&&typeof a.preload=="function"&&o.push(a.preload())}await Promise.all(o)}export{Xe as A,Qe as Form,ge as Link,qe as Outlet,_e as Redirect,je as Router,E as action,G as cache,Z as createAsync,nt as createBrowserHistory,tt as createMemoryHistory,B as lazy,ot as matchPath,rt as matchRoutes,Ye as preloadRoutes,Y as revalidate,ct as runWithOwner,We as select,te as useAction,$e as useLevelParams,_ as useLocation,Ie as useMatch,me as useNavigate,ze as useParam,Be as useParamSelector,q as useParams,Ge as useRouteData,S as useRouter,Je as useSearchParams,ee as useSubmission};
|