@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/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluixi/core",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.84",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"author": "Ibrahima Touré",
|
|
5
6
|
"description": "framework to build apps with DOM runtime, reactive core, router, and JSX runtime; components run once, reactivity updates DOM",
|
|
6
7
|
"private": false,
|
|
7
8
|
"publishConfig": {
|
|
@@ -83,30 +84,30 @@
|
|
|
83
84
|
"./lib/*": "./src/lib/*"
|
|
84
85
|
},
|
|
85
86
|
"dependencies": {
|
|
86
|
-
"@fluixi/dom": "1.0.0-alpha.
|
|
87
|
-
"@fluixi/
|
|
88
|
-
"@fluixi/
|
|
89
|
-
"@fluixi/
|
|
90
|
-
"@fluixi/
|
|
91
|
-
"@fluixi/
|
|
92
|
-
"@fluixi/
|
|
87
|
+
"@fluixi/dom": "1.0.0-alpha.84",
|
|
88
|
+
"@fluixi/head": "1.0.0-alpha.51",
|
|
89
|
+
"@fluixi/jsx": "1.0.0-alpha.84",
|
|
90
|
+
"@fluixi/reactive": "1.0.0-alpha.84",
|
|
91
|
+
"@fluixi/router": "0.1.2-alpha.4",
|
|
92
|
+
"@fluixi/server": "1.0.0-alpha.84",
|
|
93
|
+
"@fluixi/utils": "1.0.0-alpha.84"
|
|
93
94
|
},
|
|
94
95
|
"devDependencies": {
|
|
95
|
-
"@bambiste/mix-builder": "^0.
|
|
96
|
+
"@bambiste/mix-builder": "^0.4.0",
|
|
96
97
|
"@types/fs-extra": "^11.0.4",
|
|
97
98
|
"@types/inquirer": "^9.0.9",
|
|
98
99
|
"chalk": "^5.3.0",
|
|
99
100
|
"commander": "^11.0.0",
|
|
100
101
|
"esbuild": "^0.27.1",
|
|
102
|
+
"execa": "^9.6.1",
|
|
101
103
|
"fs-extra": "^11.3.3",
|
|
102
104
|
"inquirer": "^9.3.8",
|
|
103
105
|
"typescript": "^5.0.0",
|
|
104
106
|
"vite": "^5.0.0",
|
|
105
|
-
"vitest": "^1.0.0",
|
|
106
|
-
"execa": "^9.6.1",
|
|
107
107
|
"vite-plugin-node-polyfills": "^0.25.0",
|
|
108
|
-
"
|
|
109
|
-
"@fluixi/
|
|
108
|
+
"vitest": "^1.0.0",
|
|
109
|
+
"@fluixi/compiler": "1.0.0-alpha.84",
|
|
110
|
+
"@fluixi/vite-plugin": "1.0.0-alpha.84"
|
|
110
111
|
},
|
|
111
112
|
"repository": {
|
|
112
113
|
"type": "git",
|
|
@@ -115,8 +116,8 @@
|
|
|
115
116
|
},
|
|
116
117
|
"peerDependencies": {
|
|
117
118
|
"vite-plugin-node-polyfills": "^0.25.0",
|
|
118
|
-
"@fluixi/compiler": "1.0.0-alpha.
|
|
119
|
-
"@fluixi/vite-plugin": "1.0.0-alpha.
|
|
119
|
+
"@fluixi/compiler": "1.0.0-alpha.84",
|
|
120
|
+
"@fluixi/vite-plugin": "1.0.0-alpha.84"
|
|
120
121
|
},
|
|
121
122
|
"peerDependenciesMeta": {
|
|
122
123
|
"@fluixi/compiler": {
|
|
@@ -131,7 +132,7 @@
|
|
|
131
132
|
},
|
|
132
133
|
"scripts": {
|
|
133
134
|
"build:typings": "tsc -p tsconfig.lib.json",
|
|
134
|
-
"build": "node ../../scripts/gen-version.mjs &&
|
|
135
|
+
"build": "node ../../scripts/gen-version.mjs && cross-env NODE_ENV=production mix-builder && cp types/fluixi.d.ts dist/fluixi.d.ts && pnpm run build:cdn",
|
|
135
136
|
"build:cdn": "cross-env NODE_ENV=production mix-builder --buildConfigFile=build-config.cdn.json",
|
|
136
137
|
"send": "mix-publisher --scoped --buildConfigFileConfig=publish-config.json",
|
|
137
138
|
"pack": "pnpm pack",
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { VERSION } from './version.generated.js';
|
|
2
2
|
/**
|
|
3
|
-
* @fileoverview Main entry point for Fluixi framework
|
|
4
3
|
* @module fluixi
|
|
5
4
|
*/
|
|
6
5
|
|
|
@@ -14,18 +13,7 @@ export { default } from './lib/core.js';
|
|
|
14
13
|
// /**
|
|
15
14
|
// * Global JSX namespace for "jsx": "preserve" mode.
|
|
16
15
|
// * Applied automatically when any file imports from fluixi.
|
|
17
|
-
// * Pattern: same as SolidJS
|
|
16
|
+
// * Pattern: same as SolidJS, the framework main entry carries the global augmentation.
|
|
18
17
|
// */
|
|
19
18
|
// declare global {
|
|
20
|
-
// namespace JSX {
|
|
21
|
-
// type Element = FluixiJSX.Element;
|
|
22
|
-
// interface IntrinsicElements extends FluixiJSX.IntrinsicElements {}
|
|
23
|
-
// interface ElementChildrenAttribute {
|
|
24
|
-
// children: {};
|
|
25
|
-
// }
|
|
26
|
-
// interface IntrinsicAttributes {
|
|
27
|
-
// key?: string | number;
|
|
28
|
-
// }
|
|
29
|
-
// }
|
|
30
|
-
// }
|
|
31
|
-
|
|
19
|
+
// namespace JSX {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var G=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var k=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Z(t))!ee.call(e,r)&&r!==n&&G(e,r,{get:()=>t[r],enumerable:!(o=Q(t,r))||o.enumerable});return e},_e=(e,t,n)=>(k(e,t,"default"),n&&k(n,t,"default"));import{createSignal as w,createMemo as d,createResource as Ce,createEffect as S,getOwner as Pe,onCleanup as O,untrack as A}from"@fluixi/reactive/signal";import{insert as v,createComponent as z,createNativeElement as g,setAttribute as u}from"@fluixi/dom";import{createContext as C,useContext as p}from"@fluixi/reactive/signal";import{get as Re}from"@fluixi/utils/object";import{deepEqual as be}from"@fluixi/utils/compare";import{createRouter as Ae,createBrowserHistory as we,matchRoutes as Se,matchPath as Oe}from"@fluixi/router";import{createMemoryHistory as Ot,createBrowserHistory as Lt,matchRoutes as kt,matchPath as Dt}from"@fluixi/router";import{createResource as ue,createSignal as F}from"@fluixi/reactive/signal";var D=!1,T=new Map;function N(){return D}function Fe(e){D=e}function M(e,t){T.set(e,t)}function E(e){return T.get(e)}function te(){T.clear()}function Ie(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",n=JSON.parse(t);for(let[o,r]of Object.entries(n))T.set(o,r);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function ne(){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=[],o;for(;o=t.nextNode();){let r=o,a=r.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&n.push(r)}n.forEach(r=>r.remove()),te()}typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(ne,100)});function H(){return typeof window>"u"}import{asProvider as re}from"@fluixi/dom";import{createContext as oe,useContext as ae}from"@fluixi/reactive/signal";import{readChildren as ie}from"@fluixi/reactive/signal";var _=!1;function se(){_||(_=!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 V(e,t,n){let o=!!e?.Provider,r=o?e:e.context,a=o?t:e.value,i=o?!1:e.debug??!1;o||se();let s=typeof a=="function"?a():a,c=o?n:e;return r.Provider({value:s,get children(){return c?.children},debug:i})}function qe(e){let t=P(e);return[t,o=>V(t,o.value,o)]}function ce(e,t){if(e.length===0)return ie(()=>t);let[n,o]=e[0],r=e.slice(1);return V(n,o,{get children(){return ce(r,t)}})}function Be(e){return t=>{let n=R(e);return t.children(n)}}function Je(e,t){let n=R(e);return n===e.defaultValue?t():n}function P(e){let t=oe(e),n=o=>(o.debug,t.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(n.$$typeof=Symbol.for("react.provider")),n.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:re(n),defaultValue:e}}function R(e){let t=ae(e);return t!==void 0?t:e.defaultValue}var m=new Map,y=new Map;function de(e,t){return async(...n)=>{let o=t+":"+JSON.stringify(n);if(N()||typeof window<"u"){let a=E(o);if(a!==void 0)return a}if(m.has(o))return m.get(o);if(y.has(o))return y.get(o);let r=Promise.resolve(e(...n)).then(a=>(m.set(o,a),y.delete(o),H()&&M(o,a),a),a=>{throw y.delete(o),a});return y.set(o,r),r}}var[et,le]=F(0),fe=new Set;function pe(e){let t=typeof e=="string"?n=>n.startsWith(e):e;for(let n of m.keys())t(n)&&(m.delete(n),fe.add(n));le(n=>n+1)}function ye(e,t){let[n]=ue(t||(()=>!0),e);return n}var b=new Map;function I(e){return b.has(e)||b.set(e,F(void 0)),b.get(e)}function K(e,t){let n=t||e.name||"action",o=async r=>{let[,a]=I(n),i=()=>a(void 0),s=()=>o(r);a({input:r,pending:!0,clear:i,retry:s});try{let c=await e(r);return a({input:r,result:c,pending:!1,clear:i,retry:s}),c}catch(c){throw a({input:r,error:c,pending:!1,clear:i,retry:s}),c}};return o.url=n,o.with=r=>K((...a)=>e(r,...a),t),o}function me(e){let[t]=I(e.url);return t}function ge(e){return e}var he=P(),tt=he.Provider;import{untrack as j,createMemo as xe,createResource as Te}from"@fluixi/reactive/signal";function ve(e,t){let n,o,r;function a(){return o||(o=e().then(s=>n=s.default)),o}t?.preload&&a();let i=(s=>{if(n){let c=n;return j(()=>c(s))}if(!r){let[c]=Te(()=>a(),{transport:!1});if(r=c,c.error)throw c.error}return xe(()=>{let c=r();return c?j(()=>c(s)):void 0},void 0,{name:"lazy"})});return i.preload=()=>a().then(()=>{}),i.$lazy=!0,i.loader=e,i}import{runWithOwner as Ht}from"@fluixi/reactive/signal";var h=C(),U=C(),$=C(),W=C();function Le(e,t,n){let o,r=e.route.data;if(typeof r=="function"){let x=!1;O(()=>{x=!0});let X=Pe(),[Y]=Ce(()=>r({params:n.params,location:n.location},X,()=>x));o=Y}let a=()=>W.Provider({value:o,get children(){return $.Provider({value:e.params,get children(){return U.Provider({value:{depth:t,...n},get children(){return z(e.component,{})}})}})}});if(!o)return a();let i=o,s=()=>i.loading,[c,l]=w(A(()=>!s()));return S(()=>l(!s())),d(()=>c()?a():null)}function q(e){let t=e.depth+1,[n,o]=w(A(()=>e.matched()[t]?.component));return S(()=>{let r=e.matched()[t]?.component;o(()=>r)}),d(()=>{if(!n())return e.notFound?e.notFound():null;let a=A(()=>e.matched())[t];return Le(a,t,{matched:e.matched,params:e.params,location:e.location})})}function ke(e){return e==null?De():typeof e=="function"?z(e,{}):e}function De(){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 t=g("h1");u(t,"style","margin:0;font-size:2.5rem;font-weight:700"),v(t,"404");let n=g("p");return u(n,"style","margin:0;opacity:.7"),v(n,"This page could not be found."),e.appendChild(t),e.appendChild(n),e}function ft(e){let t=e.history??we(),n=Ae({routes:e.routes,base:e.base,history:t}),[o,r]=w(n.state()),a=n.subscribe(r);O(()=>{a(),n.destroy()});let i=d(()=>(o().match?.matched??[]).filter(x=>x.component)),s={router:n,location:d(()=>o().location),params:d(()=>o().match?.params??{})},c={depth:-1,matched:i,params:s.params,location:s.location,notFound:()=>ke(e.notFound)},l;return h.Provider({value:s,get children(){return l??=q(c)}})}function pt(){let e=p(U);return e?q(e):null}function yt(e){let t=p(h);if(t&&typeof window<"u"){let n=!1;O(()=>n=!0),queueMicrotask(()=>{n||t.router.navigate(e.to,{replace:e.replace!==!1})})}return null}var Ne={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};function L(){let e=p(h);if(e)return e;if(typeof window>"u")return Ne;throw new Error("[router] useRouter must be used within <Router>")}function B(){let e=L().params;return d(()=>e(),{},{equals:(t,n)=>JSON.stringify(t)===JSON.stringify(n)})}function mt(){return p($)??{}}function gt(e){let t=B();return d(()=>t()[e])}function ht(e,t){let n=B();return d(()=>e(n()),void 0,t?{equals:t}:void 0)}function xt(e){let t=J();return d(()=>Oe(typeof e=="function"?e():e,t.pathname))}function Tt(){let e=J(),t=Me();return[d(()=>e.query),(r,a)=>{let i=new URLSearchParams(e.search);for(let[c,l]of Object.entries(r))l===null?i.delete(c):i.set(c,l);let s=i.toString();t(e.pathname+(s?`?${s}`:""),a)}]}function vt(e,t){let n=(o,r)=>be(o,r);return t!==void 0?d(()=>Re(e(),t),void 0,{equals:n}):d(e,void 0,{equals:n})}function J(){let{location:e}=L();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 Ct(e={}){let t=p(h);return n=>{if(!t||n.defaultPrevented||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;let r=n.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 a=new URL(r.href);a.protocol!=="http:"&&a.protocol!=="https:"||a.origin===window.location.origin&&(a.hash&&a.pathname===window.location.pathname&&a.search===window.location.search||e.shouldNavigate&&!e.shouldNavigate(a,r)||(n.preventDefault(),t.router.navigate(a.pathname+a.search+a.hash,{replace:e.replace})))}}function Me(){let{router:e}=L();return(t,n)=>e.navigate(t,n)}function Pt(){return p(W)??(()=>{})}var f=e=>typeof e=="function"?e():e,Ee=new Set(["href","slot","class","className","active","activeClass","replace","children"]);function He(e){let t=p(h),n=typeof document>"u",o=()=>t?.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 i of Object.keys(e)){if(Ee.has(i))continue;let s=e[i];s!=null&&typeof s!="function"&&u(r,i,String(s))}if(typeof r.addEventListener=="function")r.addEventListener("click",i=>{i.metaKey||i.ctrlKey||i.shiftKey||i.altKey||(i.preventDefault(),o())});else{let i=f(e.className??e.class)??"";i&&u(r,"class",i)}typeof r.addEventListener=="function"&&S(()=>{let i=f(e.href)??"";r.setAttribute("href",i);let s=f(e.className??e.class)??"",c=f(e.activeClass)??"",l=f(e.active)??t?.location().pathname===i;r.className=[s,l?c:""].filter(Boolean).join(" ")});let a=e.children;return a!=null&&v(r,a),r}var Rt=He;function bt(e){let t=e.action,n=e.className??e.class,o=t.url??"",r=g("form");u(r,"method","post"),o&&u(r,"action",o),n&&u(r,"class",n);for(let i of Object.keys(e)){if(i==="action"||i==="children"||i==="class"||i==="className")continue;let s=e[i];s!=null&&typeof s!="function"&&u(r,i,String(s))}typeof r.addEventListener=="function"&&r.addEventListener("submit",i=>{i.preventDefault();let s={};new FormData(r).forEach((c,l)=>{s[l]=c}),Promise.resolve(t(s)).catch(()=>{})});let a=e.children;return a!=null&&v(r,a),r}async function At(e,t){let n=Se(e,t);if(!n)return;let o=[];for(let r of n.matched){let a=r.component;a&&typeof a.preload=="function"&&o.push(a.preload())}await Promise.all(o)}export{_e as a,ve as b,V as c,qe as d,ce as e,Be as f,Je as g,P as h,R as i,Fe as j,Ie as k,ne as l,de as m,pe as n,ye as o,K as p,me as q,ge as r,ft as s,pt as t,yt as u,L as v,B as w,mt as x,gt as y,ht as z,xt as A,Tt as B,vt as C,J as D,Ct as E,Me as F,Pt as G,He as H,Rt as I,bt as J,At as K,Ot as L,Lt as M,kt as N,Dt as O,Ht as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as p,B as q,C as r,D as s,E as t,F as u,G as v,H as w,I as x,J as y,K as z,L as A,M as B,N as C,O as D,P as E,b as a,m as b,n as c,o as d,p as e,q as f,r as g,s as h,t as i,u as j,v as k,w as l,x as m,y as n,z as o}from"./chunk-RN7C7HNS.mjs";export{x as A,y as Form,w as Link,i as Outlet,j as Redirect,h as Router,e as action,b as cache,d as createAsync,B as createBrowserHistory,A as createMemoryHistory,a as lazy,D as matchPath,C as matchRoutes,z as preloadRoutes,c as revalidate,E as runWithOwner,r as select,g as useAction,m as useLevelParams,t as useLinkNavigation,s as useLocation,p as useMatch,u as useNavigate,n as useParam,o as useParamSelector,l as useParams,v as useRouteData,k as useRouter,q as useSearchParams,f as useSubmission};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c=!1,u=new Map;function g(){return c}function x(e){c=e}function w(e,t){u.set(e,t)}function h(e){return u.get(e)}function p(){u.clear()}function T(){if(typeof window>"u")return!1;let e=document.getElementById("__FLUIXI_HYDRATION__");if(!e||e.getAttribute("type")!=="application/json")return!1;try{let t=e.textContent||"{}",o=JSON.parse(t);for(let[r,n]of Object.entries(o))u.set(r,n);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function l(){if(typeof window>"u")return;let e=document.getElementById("__FLUIXI_HYDRATION__");e&&e.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),o=[],r;for(;r=t.nextNode();){let n=r,a=n.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&o.push(n)}o.forEach(n=>n.remove()),p()}typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(l,100)});function C(){return typeof window>"u"}import{untrack as f,createMemo as y,createResource as m}from"@fluixi/reactive/signal";function b(e,t){let o,r,n;function a(){return r||(r=e().then(d=>o=d.default)),r}t?.preload&&a();let s=(d=>{if(o){let i=o;return f(()=>i(d))}if(!n){let[i]=m(()=>a(),{transport:!1});if(n=i,i.error)throw i.error}return y(()=>{let i=n();return i?f(()=>i(d)):void 0},void 0,{name:"lazy"})});return s.preload=()=>a().then(()=>{}),s.$lazy=!0,s.loader=e,s}export{g as a,x as b,w as c,h as d,T as e,l as f,C as g,b as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as w,c as L,d as O,g as k,h as I}from"./chunk-FT22BLCQ.mjs";import{createSignal as P,createMemo as d,createResource as ne,createEffect as A,getOwner as re,onCleanup as b,untrack as R}from"@fluixi/reactive/signal";import{insert as v,createComponent as V,createNativeElement as g,setAttribute as u}from"@fluixi/dom";import{createContext as T,useContext as y}from"@fluixi/reactive/signal";import{get as oe}from"@fluixi/utils/object";import{deepEqual as ae}from"@fluixi/utils/compare";import{createRouter as se,createBrowserHistory as ie,matchRoutes as ce,matchPath as ue}from"@fluixi/router";import{createMemoryHistory as tt,createBrowserHistory as nt,matchRoutes as rt,matchPath as ot}from"@fluixi/router";import{createResource as J,createSignal as D}from"@fluixi/reactive/signal";import{asProvider as z}from"@fluixi/dom";import{createContext as B,useContext as ve}from"@fluixi/reactive/signal";import{readChildren as Pe}from"@fluixi/reactive/signal";function N(e){let n=B(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:z(t),defaultValue:e}}var m=new Map,p=new Map;function W(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[ke,G]=D(0),X=new Set;function Q(e){let n=typeof e=="string"?t=>t.startsWith(e):e;for(let t of m.keys())n(t)&&(m.delete(t),X.add(t));G(t=>t+1)}function Y(e,n){let[t]=J(n||(()=>!0),e);return t}var C=new Map;function M(e){return C.has(e)||C.set(e,D(void 0)),C.get(e)}function E(e,n){let t=n||e.name||"action",a=async r=>{let[,o]=M(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=>E((...o)=>e(r,...o),n),a}function Z(e){let[n]=M(e.url);return n}function ee(e){return e}var te=N(),Ne=te.Provider;import{runWithOwner as ct}from"@fluixi/reactive/signal";var h=T(),F=T(),K=T(),U=T();function de(e,n,t){let a,r=e.route.data;if(typeof r=="function"){let x=!1;b(()=>{x=!0});let q=re(),[$]=ne(()=>r({params:t.params,location:t.location},q,()=>x));a=$}let o=()=>U.Provider({value:a,get children(){return K.Provider({value:e.params,get children(){return F.Provider({value:{depth:n,...t},get children(){return V(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 H(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 de(o,n,{matched:e.matched,params:e.params,location:e.location})})}function le(e){return e==null?fe():typeof e=="function"?V(e,{}):e}function fe(){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 He(e){let n=e.history??ie(),t=se({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:()=>le(e.notFound)},l;return h.Provider({value:i,get children(){return l??=H(c)}})}function je(){let e=y(F);return e?H(e):null}function _e(e){let n=y(h);if(n&&typeof window<"u"){let t=!1;b(()=>t=!0),queueMicrotask(()=>{t||n.router.navigate(e.to,{replace:e.replace!==!1})})}return null}var ye={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};function S(){let e=y(h);if(e)return e;if(typeof window>"u")return ye;throw new Error("[router] useRouter must be used within <Router>")}function j(){let e=S().params;return d(()=>e(),{},{equals:(n,t)=>JSON.stringify(n)===JSON.stringify(t)})}function qe(){return y(K)??{}}function $e(e){let n=j();return d(()=>n()[e])}function Ie(e,n){let t=j();return d(()=>e(t()),void 0,n?{equals:n}:void 0)}function ze(e){let n=_();return d(()=>ue(typeof e=="function"?e():e,n.pathname))}function Be(){let e=_(),n=pe();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 Je(e,n){let t=(a,r)=>ae(a,r);return n!==void 0?d(()=>oe(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 We(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 pe(){let{router:e}=S();return(n,t)=>e.navigate(n,t)}function Ge(){return y(U)??(()=>{})}var f=e=>typeof e=="function"?e():e,me=new Set(["href","slot","class","className","active","activeClass","replace","children"]);function ge(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(me.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 Xe=ge;function Qe(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 Ye(e,n){let t=ce(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{Xe as A,Qe as Form,ge as Link,je as Outlet,_e as Redirect,He as Router,E as action,W as cache,Y as createAsync,nt as createBrowserHistory,tt as createMemoryHistory,I as lazy,ot as matchPath,rt as matchRoutes,Ye as preloadRoutes,Q as revalidate,ct as runWithOwner,Je as select,ee as useAction,qe as useLevelParams,We as useLinkNavigation,_ as useLocation,ze as useMatch,pe as useNavigate,$e as useParam,Ie as useParamSelector,j as useParams,Ge as useRouteData,S as useRouter,Be as useSearchParams,Z as useSubmission};
|