@fluixi/core 1.0.0-alpha.76 → 1.0.0-alpha.78
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 +104 -39
- package/dist/cdn/core.global.js +1 -1
- package/dist/src/cdn/{chunk-MYXLT5LG.mjs → chunk-3IZZ7QBW.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-YWV2KJP4.mjs → router-next-W2YUEGIJ.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-G4DNKAF2.mjs +1 -0
- package/dist/src/lib/core.cjs +1 -1
- package/dist/src/lib/core.d.ts +4 -3
- package/dist/src/lib/core.d.ts.map +1 -1
- package/dist/src/lib/core.js +4 -3
- package/dist/src/lib/core.mjs +1 -1
- package/dist/src/lib/index.cjs +1 -1
- package/dist/src/lib/index.mjs +1 -1
- package/dist/src/lib/render/index.cjs +1 -1
- package/dist/src/lib/render/index.mjs +1 -1
- package/dist/src/lib/render/versions.cjs +1 -1
- package/dist/src/lib/render/versions.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 +12 -11
- package/dist/src/lib/router-next/index.mjs +1 -1
- package/dist/src/version.generated.cjs +1 -1
- package/dist/src/version.generated.d.ts +1 -1
- package/dist/src/version.generated.js +1 -1
- package/dist/src/version.generated.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist/src/lib/client/router-next-2FH6DRYT.mjs +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluixi/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.78",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "framework to build apps with DOM runtime, reactive core, router, and JSX runtime; components run once, reactivity updates DOM",
|
|
6
6
|
"private": false,
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"registry": "https://registry.npmjs.org/",
|
|
@@ -89,13 +89,13 @@
|
|
|
89
89
|
"./lib/*": "./src/lib/*"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@fluixi/dom": "1.0.0-alpha.
|
|
93
|
-
"@fluixi/jsx": "1.0.0-alpha.
|
|
94
|
-
"@fluixi/reactive": "1.0.0-alpha.
|
|
92
|
+
"@fluixi/dom": "1.0.0-alpha.78",
|
|
93
|
+
"@fluixi/jsx": "1.0.0-alpha.78",
|
|
94
|
+
"@fluixi/reactive": "1.0.0-alpha.78",
|
|
95
95
|
"@fluixi/router": "0.1.2-alpha.3",
|
|
96
|
-
"@fluixi/server": "1.0.0-alpha.
|
|
97
|
-
"@fluixi/utils": "1.0.0-alpha.
|
|
98
|
-
"@fluixi/head": "1.0.0-alpha.
|
|
96
|
+
"@fluixi/server": "1.0.0-alpha.78",
|
|
97
|
+
"@fluixi/utils": "1.0.0-alpha.78",
|
|
98
|
+
"@fluixi/head": "1.0.0-alpha.45"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@bambiste/mix-builder": "^0.1.0",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
"vitest": "^1.0.0",
|
|
112
112
|
"execa": "^9.6.1",
|
|
113
113
|
"vite-plugin-node-polyfills": "^0.25.0",
|
|
114
|
-
"@fluixi/compiler": "1.0.0-alpha.
|
|
115
|
-
"@fluixi/vite-plugin": "1.0.0-alpha.
|
|
114
|
+
"@fluixi/compiler": "1.0.0-alpha.78",
|
|
115
|
+
"@fluixi/vite-plugin": "1.0.0-alpha.78"
|
|
116
116
|
},
|
|
117
117
|
"repository": {
|
|
118
118
|
"type": "git",
|
|
@@ -121,8 +121,8 @@
|
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
123
|
"vite-plugin-node-polyfills": "^0.25.0",
|
|
124
|
-
"@fluixi/compiler": "1.0.0-alpha.
|
|
125
|
-
"@fluixi/vite-plugin": "1.0.0-alpha.
|
|
124
|
+
"@fluixi/compiler": "1.0.0-alpha.78",
|
|
125
|
+
"@fluixi/vite-plugin": "1.0.0-alpha.78"
|
|
126
126
|
},
|
|
127
127
|
"peerDependenciesMeta": {
|
|
128
128
|
"@fluixi/compiler": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as w,c as L,d as O,g as k,h as N,i as z}from"./chunk-7CZ3YHHR.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 v,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 rt,createBrowserHistory as ot,matchRoutes as at,matchPath as st}from"@fluixi/router";import{createResource as W,createSignal as M}from"@fluixi/reactive/signal";import{asProvider as B}from"@fluixi/dom";import{createContext as J,useContext as Te}from"@fluixi/reactive/signal";import{readChildren as Ae}from"@fluixi/reactive/signal";N("index");function D(e){let n=J(e),t=a=>(a.debug,n.Provider({value:a.value,get children(){return a.children},debug:a.debug}));return typeof Symbol<"u"&&Symbol.for&&(t.$$typeof=Symbol.for("react.provider")),t.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:B(t),defaultValue:e}}var m=new Map,p=new Map;function G(e,n){return async(...t)=>{let a=n+":"+JSON.stringify(t);if(w()||typeof window<"u"){let o=O(a);if(o!==void 0)return o}if(m.has(a))return m.get(a);if(p.has(a))return p.get(a);let r=Promise.resolve(e(...t)).then(o=>(m.set(a,o),p.delete(a),k()&&L(a,o),o),o=>{throw p.delete(a),o});return p.set(a,r),r}}var[De,X]=M(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 E(e){return C.has(e)||C.set(e,M(void 0)),C.get(e)}function V(e,n){let t=n||e.name||"action",a=async r=>{let[,o]=E(t),s=()=>o(void 0),i=()=>a(r);o({input:r,pending:!0,clear:s,retry:i});try{let c=await e(r);return o({input:r,result:c,pending:!1,clear:s,retry:i}),c}catch(c){throw o({input:r,error:c,pending:!1,clear:s,retry:i}),c}};return a.url=t,a.with=r=>V((...o)=>e(r,...o),n),a}function ee(e){let[n]=E(e.url);return n}function te(e){return e}var ne=D(),Me=ne.Provider;import{runWithOwner as dt}from"@fluixi/reactive/signal";var h=T(),K=T(),U=T(),H=T();function le(e,n,t){let a,r=e.route.data;if(typeof r=="function"){let x=!1;b(()=>{x=!0});let $=oe(),[I]=re(()=>r({params:t.params,location:t.location},$,()=>x));a=I}let o=()=>H.Provider({value:a,get children(){return U.Provider({value:e.params,get children(){return K.Provider({value:{depth:n,...t},get children(){return F(e.component,{})}})}})}});if(!a)return o();let s=a,i=()=>s.loading,[c,l]=P(R(()=>!i()));return A(()=>l(!i())),d(()=>c()?o():null)}function j(e){let n=e.depth+1,[t,a]=P(R(()=>e.matched()[n]?.component));return A(()=>{let r=e.matched()[n]?.component;a(()=>r)}),d(()=>{if(!t())return e.notFound?e.notFound():null;let o=R(()=>e.matched())[n];return le(o,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"),v(n,"404");let t=g("p");return u(t,"style","margin:0;opacity:.7"),v(t,"This page could not be found."),e.appendChild(n),e.appendChild(t),e}function _e(e){let n=e.history??ce(),t=ie({routes:e.routes,base:e.base,history:n}),[a,r]=P(t.state()),o=t.subscribe(r);b(()=>{o(),t.destroy()});let s=d(()=>(a().match?.matched??[]).filter(x=>x.component)),i={router:t,location:d(()=>a().location),params:d(()=>a().match?.params??{})},c={depth:-1,matched:s,params:i.params,location:i.location,notFound:()=>fe(e.notFound)},l;return h.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(h);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(h);if(e)return e;if(typeof window>"u")return pe;throw new Error("[router-next] useRouter must be used within <Router>")}function _(){let e=S().params;return d(()=>e(),{},{equals:(n,t)=>JSON.stringify(n)===JSON.stringify(t)})}function Ie(){return y(U)??{}}function ze(e){let n=_();return d(()=>n()[e])}function Be(e,n){let t=_();return d(()=>e(t()),void 0,n?{equals:n}:void 0)}function Je(e){let n=q();return d(()=>de(typeof e=="function"?e():e,n.pathname))}function We(){let e=q(),n=me();return[d(()=>e.query),(r,o)=>{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}`:""),o)}]}function Ge(e,n){let t=(a,r)=>se(a,r);return n!==void 0?d(()=>ae(e(),n),void 0,{equals:t}):d(e,void 0,{equals:t})}function q(){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 Xe(e={}){let n=y(h);return t=>{if(!n||t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let r=t.target?.closest?.("a");if(!r||!r.getAttribute("href")||r.target&&r.target!=="_self"||r.hasAttribute("download")||/(^|\s)external(\s|$)/.test(r.getAttribute("rel")??""))return;let o=new URL(r.href);o.protocol!=="http:"&&o.protocol!=="https:"||o.origin===window.location.origin&&(o.hash&&o.pathname===window.location.pathname&&o.search===window.location.search||e.shouldNavigate&&!e.shouldNavigate(o,r)||(t.preventDefault(),n.router.navigate(o.pathname+o.search+o.hash,{replace:e.replace})))}}function me(){let{router:e}=S();return(n,t)=>e.navigate(n,t)}function Qe(){return y(H)??(()=>{})}var f=e=>typeof e=="function"?e():e,ge=new Set(["href","slot","class","className","active","activeClass","replace","children"]);function he(e){let n=y(h),t=typeof document>"u",a=()=>n?.router.navigate(f(e.href)??"",{replace:f(e.replace)}),r=g("a");u(r,"href",f(e.href)??""),e.slot&&u(r,"slot",f(e.slot));for(let s of Object.keys(e)){if(ge.has(s))continue;let i=e[s];i!=null&&typeof i!="function"&&u(r,s,String(i))}if(typeof r.addEventListener=="function")r.addEventListener("click",s=>{s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||(s.preventDefault(),a())});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 o=e.children;return o!=null&&v(r,o),r}var Ye=he;function Ze(e){let n=e.action,t=e.className??e.class,a=n.url??"",r=g("form");u(r,"method","post"),a&&u(r,"action",a),t&&u(r,"class",t);for(let s of Object.keys(e)){if(s==="action"||s==="children"||s==="class"||s==="className")continue;let i=e[s];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 o=e.children;return o!=null&&v(r,o),r}async function et(e,n){let t=ue(e,n);if(!t)return;let a=[];for(let r of t.matched){let o=r.component;o&&typeof o.preload=="function"&&a.push(o.preload())}await Promise.all(a)}export{Ye as A,Ze as Form,he as Link,qe as Outlet,$e as Redirect,_e as Router,V as action,G as cache,Z as createAsync,ot as createBrowserHistory,rt as createMemoryHistory,z as lazy,st as matchPath,at as matchRoutes,et as preloadRoutes,Y as revalidate,dt as runWithOwner,Ge as select,te as useAction,Ie as useLevelParams,Xe as useLinkNavigation,q as useLocation,Je as useMatch,me as useNavigate,ze as useParam,Be as useParamSelector,_ as useParams,Qe as useRouteData,S as useRouter,We as useSearchParams,ee as useSubmission};
|