@fluixi/core 1.0.0-alpha.83 → 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.
Files changed (177) hide show
  1. package/dist/cdn/core.global.js +2 -1
  2. package/dist/cli/generate.cjs +4117 -292
  3. package/dist/cli/generate.mjs +4122 -292
  4. package/dist/cli/index.cjs +4117 -292
  5. package/dist/cli/index.mjs +4122 -292
  6. package/dist/cli/run.cjs +63 -1
  7. package/dist/cli/run.mjs +39 -1
  8. package/dist/src/cdn/chunk-VNLCQBFQ.mjs +747 -0
  9. package/dist/src/cdn/core.cjs +1279 -1
  10. package/dist/src/cdn/core.d.ts +3 -3
  11. package/dist/src/cdn/core.js +3 -3
  12. package/dist/src/cdn/core.mjs +642 -1
  13. package/dist/src/cdn/router-WMN2AA7E.mjs +66 -0
  14. package/dist/src/index.cjs +1201 -1
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +1 -11
  17. package/dist/src/index.mjs +1313 -1
  18. package/dist/src/jsx-dev-runtime.cjs +26 -1
  19. package/dist/src/jsx-dev-runtime.mjs +24 -1
  20. package/dist/src/jsx-runtime.cjs +26 -1
  21. package/dist/src/jsx-runtime.js +0 -9
  22. package/dist/src/jsx-runtime.mjs +24 -1
  23. package/dist/src/lib/client/chunk-2C2KDDQV.mjs +133 -0
  24. package/dist/src/lib/client/index.cjs +870 -1
  25. package/dist/src/lib/client/index.d.ts +17 -6
  26. package/dist/src/lib/client/index.d.ts.map +1 -1
  27. package/dist/src/lib/client/index.js +26 -19
  28. package/dist/src/lib/client/index.mjs +222 -1
  29. package/dist/src/lib/client/router-X526HSWQ.mjs +548 -0
  30. package/dist/src/lib/context/context.cjs +118 -1
  31. package/dist/src/lib/context/context.d.ts +19 -37
  32. package/dist/src/lib/context/context.d.ts.map +1 -1
  33. package/dist/src/lib/context/context.js +8 -45
  34. package/dist/src/lib/context/context.mjs +99 -1
  35. package/dist/src/lib/context/index.cjs +120 -1
  36. package/dist/src/lib/context/index.mjs +99 -1
  37. package/dist/src/lib/control-flow.cjs +35 -1
  38. package/dist/src/lib/control-flow.mjs +25 -1
  39. package/dist/src/lib/core.cjs +1200 -1
  40. package/dist/src/lib/core.d.ts +0 -2
  41. package/dist/src/lib/core.d.ts.map +1 -1
  42. package/dist/src/lib/core.js +14 -48
  43. package/dist/src/lib/core.mjs +1313 -1
  44. package/dist/src/lib/env/index.cjs +60 -1
  45. package/dist/src/lib/env/index.d.ts +5 -5
  46. package/dist/src/lib/env/index.js +5 -5
  47. package/dist/src/lib/env/index.mjs +39 -1
  48. package/dist/src/lib/i18n/index.cjs +108 -1
  49. package/dist/src/lib/i18n/index.d.ts +31 -10
  50. package/dist/src/lib/i18n/index.d.ts.map +1 -1
  51. package/dist/src/lib/i18n/index.js +31 -10
  52. package/dist/src/lib/i18n/index.mjs +88 -1
  53. package/dist/src/lib/index.cjs +633 -1
  54. package/dist/src/lib/index.d.ts +0 -2
  55. package/dist/src/lib/index.d.ts.map +1 -1
  56. package/dist/src/lib/index.js +5 -11
  57. package/dist/src/lib/index.mjs +721 -1
  58. package/dist/src/lib/isomorphic.cjs +85 -1
  59. package/dist/src/lib/isomorphic.d.ts +41 -8
  60. package/dist/src/lib/isomorphic.d.ts.map +1 -1
  61. package/dist/src/lib/isomorphic.js +38 -5
  62. package/dist/src/lib/isomorphic.mjs +64 -1
  63. package/dist/src/lib/jsx-runtime/index.cjs +21 -1
  64. package/dist/src/lib/jsx-runtime/index.d.ts +1 -1
  65. package/dist/src/lib/jsx-runtime/index.js +1 -11
  66. package/dist/src/lib/jsx-runtime/index.mjs +4 -1
  67. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.cjs +21 -1
  68. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.mjs +4 -1
  69. package/dist/src/lib/plugins/fluixi-routes-plugin.cjs +302 -8
  70. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts +15 -1
  71. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts.map +1 -1
  72. package/dist/src/lib/plugins/fluixi-routes-plugin.js +19 -5
  73. package/dist/src/lib/plugins/fluixi-routes-plugin.mjs +271 -8
  74. package/dist/src/lib/plugins/index.cjs +311 -8
  75. package/dist/src/lib/plugins/index.mjs +279 -8
  76. package/dist/src/lib/plugins/route-codegen.cjs +73 -8
  77. package/dist/src/lib/plugins/route-codegen.d.ts +0 -1
  78. package/dist/src/lib/plugins/route-codegen.d.ts.map +1 -1
  79. package/dist/src/lib/plugins/route-codegen.js +4 -5
  80. package/dist/src/lib/plugins/route-codegen.mjs +52 -8
  81. package/dist/src/lib/plugins/route-scanner.cjs +189 -1
  82. package/dist/src/lib/plugins/route-scanner.d.ts +1 -2
  83. package/dist/src/lib/plugins/route-scanner.d.ts.map +1 -1
  84. package/dist/src/lib/plugins/route-scanner.js +7 -8
  85. package/dist/src/lib/plugins/route-scanner.mjs +158 -1
  86. package/dist/src/lib/plugins/vite.cjs +27 -1
  87. package/dist/src/lib/plugins/vite.mjs +6 -1
  88. package/dist/src/lib/render/await.cjs +38 -1
  89. package/dist/src/lib/render/await.d.ts +18 -0
  90. package/dist/src/lib/render/await.d.ts.map +1 -1
  91. package/dist/src/lib/render/await.js +20 -2
  92. package/dist/src/lib/render/await.mjs +17 -1
  93. package/dist/src/lib/render/component.cjs +221 -1
  94. package/dist/src/lib/render/component.d.ts +3 -44
  95. package/dist/src/lib/render/component.d.ts.map +1 -1
  96. package/dist/src/lib/render/component.js +23 -55
  97. package/dist/src/lib/render/component.mjs +214 -1
  98. package/dist/src/lib/render/deferred.cjs +175 -1
  99. package/dist/src/lib/render/deferred.js +5 -5
  100. package/dist/src/lib/render/deferred.mjs +158 -1
  101. package/dist/src/lib/render/index.cjs +573 -1
  102. package/dist/src/lib/render/index.d.ts +3 -17
  103. package/dist/src/lib/render/index.d.ts.map +1 -1
  104. package/dist/src/lib/render/index.js +8 -22
  105. package/dist/src/lib/render/index.mjs +590 -1
  106. package/dist/src/lib/render/lazy.cjs +67 -1
  107. package/dist/src/lib/render/lazy.d.ts +22 -1
  108. package/dist/src/lib/render/lazy.d.ts.map +1 -1
  109. package/dist/src/lib/render/lazy.js +26 -5
  110. package/dist/src/lib/render/lazy.mjs +50 -1
  111. package/dist/src/lib/render/suspense.cjs +141 -1
  112. package/dist/src/lib/render/suspense.d.ts +40 -0
  113. package/dist/src/lib/render/suspense.d.ts.map +1 -1
  114. package/dist/src/lib/render/suspense.js +46 -6
  115. package/dist/src/lib/render/suspense.mjs +136 -1
  116. package/dist/src/lib/render/versions.cjs +35 -1
  117. package/dist/src/lib/render/versions.js +6 -6
  118. package/dist/src/lib/render/versions.mjs +14 -1
  119. package/dist/src/lib/router/data.cjs +230 -1
  120. package/dist/src/lib/router/data.d.ts +1 -13
  121. package/dist/src/lib/router/data.d.ts.map +1 -1
  122. package/dist/src/lib/router/data.js +0 -12
  123. package/dist/src/lib/router/data.mjs +214 -1
  124. package/dist/src/lib/router/index.cjs +627 -1
  125. package/dist/src/lib/router/index.d.ts +62 -10
  126. package/dist/src/lib/router/index.d.ts.map +1 -1
  127. package/dist/src/lib/router/index.js +85 -33
  128. package/dist/src/lib/router/index.mjs +639 -1
  129. package/dist/src/lib/server/hydration.cjs +169 -1
  130. package/dist/src/lib/server/hydration.d.ts +15 -55
  131. package/dist/src/lib/server/hydration.d.ts.map +1 -1
  132. package/dist/src/lib/server/hydration.js +23 -62
  133. package/dist/src/lib/server/hydration.mjs +148 -1
  134. package/dist/src/lib/server/index.cjs +401 -11
  135. package/dist/src/lib/server/index.d.ts +30 -6
  136. package/dist/src/lib/server/index.d.ts.map +1 -1
  137. package/dist/src/lib/server/index.js +34 -11
  138. package/dist/src/lib/server/index.mjs +379 -11
  139. package/dist/src/lib/server/reactive.cjs +197 -1
  140. package/dist/src/lib/server/reactive.d.ts +18 -77
  141. package/dist/src/lib/server/reactive.d.ts.map +1 -1
  142. package/dist/src/lib/server/reactive.js +19 -78
  143. package/dist/src/lib/server/reactive.mjs +176 -1
  144. package/dist/src/lib/theme/index.cjs +110 -1
  145. package/dist/src/lib/theme/index.d.ts +19 -4
  146. package/dist/src/lib/theme/index.d.ts.map +1 -1
  147. package/dist/src/lib/theme/index.js +17 -2
  148. package/dist/src/lib/theme/index.mjs +89 -1
  149. package/dist/src/lib/utils/index.cjs +209 -1
  150. package/dist/src/lib/utils/index.d.ts +0 -93
  151. package/dist/src/lib/utils/index.d.ts.map +1 -1
  152. package/dist/src/lib/utils/index.js +0 -93
  153. package/dist/src/lib/utils/index.mjs +188 -1
  154. package/dist/src/routes.cjs +37 -1
  155. package/dist/src/routes.d.ts +1 -1
  156. package/dist/src/routes.js +2 -2
  157. package/dist/src/routes.mjs +17 -1
  158. package/dist/src/server.cjs +400 -11
  159. package/dist/src/server.d.ts +0 -1
  160. package/dist/src/server.d.ts.map +1 -1
  161. package/dist/src/server.js +0 -1
  162. package/dist/src/server.mjs +377 -11
  163. package/dist/src/utils.cjs +21 -1
  164. package/dist/src/utils.d.ts +1 -1
  165. package/dist/src/utils.js +1 -1
  166. package/dist/src/utils.mjs +4 -1
  167. package/dist/src/version.generated.cjs +26 -1
  168. package/dist/src/version.generated.d.ts +1 -1
  169. package/dist/src/version.generated.js +2 -2
  170. package/dist/src/version.generated.mjs +5 -1
  171. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  172. package/package.json +17 -16
  173. package/src/index.ts +2 -14
  174. package/dist/src/cdn/chunk-55BT3H6E.mjs +0 -1
  175. package/dist/src/cdn/router-5JJZBK4E.mjs +0 -1
  176. package/dist/src/lib/client/chunk-SM4WHBOP.mjs +0 -1
  177. package/dist/src/lib/client/router-IBD4WPQT.mjs +0 -1
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@fluixi/core",
3
- "version": "1.0.0-alpha.83",
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.83",
87
- "@fluixi/jsx": "1.0.0-alpha.83",
88
- "@fluixi/reactive": "1.0.0-alpha.83",
89
- "@fluixi/router": "0.1.2-alpha.3",
90
- "@fluixi/server": "1.0.0-alpha.83",
91
- "@fluixi/utils": "1.0.0-alpha.83",
92
- "@fluixi/head": "1.0.0-alpha.50"
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.1.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
- "@fluixi/compiler": "1.0.0-alpha.83",
109
- "@fluixi/vite-plugin": "1.0.0-alpha.83"
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.83",
119
- "@fluixi/vite-plugin": "1.0.0-alpha.83"
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 && pnpm run build:typings && cross-env NODE_ENV=production mix-builder && cp types/fluixi.d.ts dist/fluixi.d.ts && pnpm run build:cdn",
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 the framework main entry carries the global augmentation.
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 L=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Z(t))!ee.call(e,o)&&o!==n&&G(e,o,{get:()=>t[o],enumerable:!(r=Q(t,o))||r.enumerable});return e},Fe=(e,t,n)=>(L(e,t,"default"),n&&L(n,t,"default"));import{createSignal as w,createMemo as d,createResource as Pe,createEffect as S,getOwner as be,onCleanup as k,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 Ae}from"@fluixi/utils/object";import{deepEqual as we}from"@fluixi/utils/compare";import{createRouter as Se,createBrowserHistory as ke,matchRoutes as Oe,matchPath as Le}from"@fluixi/router";import{createMemoryHistory as Mt,createBrowserHistory as Et,matchRoutes as Ht,matchPath as _t}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 Ie(e){D=e}function M(e,t){T.set(e,t)}function E(e){return T.get(e)}function te(){T.clear()}function Ke(){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[r,o]of Object.entries(n))T.set(r,o);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=[],r;for(;r=t.nextNode();){let o=r,a=o.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&n.push(o)}n.forEach(o=>o.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 r=!!e?.Provider,o=r?e:e.context,a=r?t:e.value,i=r?!1:e.debug??!1;r||se();let s=typeof a=="function"?a():a,c=r?n:e;return o.Provider({value:s,get children(){return c?.children},debug:i})}function Je(e){let t=R(e);return[t,r=>V(t,r.value,r)]}function ce(e,t){if(e.length===0)return ie(()=>t);let[n,r]=e[0],o=e.slice(1);return V(n,r,{get children(){return ce(o,t)}})}function Xe(e){return t=>{let n=P(e);return t.children(n)}}function Ye(e,t){let n=P(e);return n===e.defaultValue?t():n}function R(e,t){let n=oe(e,t),r=o=>(o.debug,n.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(r.$$typeof=Symbol.for("react.provider")),r.$$typeof=Symbol.for("react.provider"),{id:n.id,Provider:re(r),defaultValue:e}}function P(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 r=t+":"+JSON.stringify(n);if(N()||typeof window<"u"){let a=E(r);if(a!==void 0)return a}if(m.has(r))return m.get(r);if(y.has(r))return y.get(r);let o=Promise.resolve(e(...n)).then(a=>(m.set(r,a),y.delete(r),H()&&M(r,a),a),a=>{throw y.delete(r),a});return y.set(r,o),o}}var[nt,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 j(e){return b.has(e)||b.set(e,F(void 0)),b.get(e)}function I(e,t){let n=t||e.name||"action",r=async o=>{let[,a]=j(n),i=()=>a(void 0),s=()=>r(o);a({input:o,pending:!0,clear:i,retry:s});try{let c=await e(o);return a({input:o,result:c,pending:!1,clear:i,retry:s}),c}catch(c){throw a({input:o,error:c,pending:!1,clear:i,retry:s}),c}};return r.url=n,r.with=o=>I((...a)=>e(o,...a),t),r}function me(e){let[t]=j(e.url);return t}function ge(e){return e}var he=R(void 0,"route-data"),rt=he.Provider;import{createComponent as xe}from"@fluixi/dom";import{untrack as Te,createMemo as ve,createResource as Ce}from"@fluixi/reactive/signal";function K(e){if(e!=null&&(typeof e=="object"||typeof e=="function"))try{e.$lazy=!0}catch{}return e}function Re(e,t){let n,r,o;function a(){return r||(r=e().then(s=>n=s.default)),r}t?.preload&&a();let i=(s=>{if(n){let c=n;return K(Te(()=>c(s)))}if(!o){let[c]=Ce(()=>a(),{transport:!1});if(o=c,c.error)throw c.error}return ve(()=>{let c=o();return c?K(xe(c,s)):void 0})});return i.preload=()=>a().then(()=>{}),i.$lazy=!0,i.loader=e,i}import{runWithOwner as It}from"@fluixi/reactive/signal";var h=C(void 0,"router"),U=C(void 0,"outlet"),$=C(void 0,"route-params"),W=C(void 0,"route-data");function De(e,t,n){let r,o=e.route.data;if(typeof o=="function"){let x=!1;k(()=>{x=!0});let X=be(),[Y]=Pe(()=>o({params:n.params,location:n.location},X,()=>x));r=Y}let a=()=>W.Provider({value:r,get children(){return $.Provider({value:e.params,get children(){return U.Provider({value:{depth:t,...n},get children(){return z(e.component,{})}})}})}});if(!r)return a();let i=r,s=()=>i.loading,[c,f]=w(A(()=>!s()));return S(()=>f(!s())),d(()=>c()?a():null)}function q(e){let t=e.depth+1,[n,r]=w(A(()=>e.matched()[t]?.component));return S(()=>{let o=e.matched()[t]?.component;r(()=>o)}),d(()=>{if(!n())return e.notFound?e.notFound():null;let a=A(()=>e.matched())[t];return De(a,t,{matched:e.matched,params:e.params,location:e.location})})}function Ne(e){return e==null?Me():typeof e=="function"?z(e,{}):e}function Me(){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 ht(e){let t=e.history??ke(),n=Se({routes:e.routes,base:e.base,history:t}),[r,o]=w(n.state()),a=n.subscribe(o);k(()=>{a(),n.destroy()});let i=d(()=>(r().match?.matched??[]).filter(x=>x.component)),s={router:n,location:d(()=>r().location),params:d(()=>r().match?.params??{})},c={depth:-1,matched:i,params:s.params,location:s.location,notFound:()=>Ne(e.notFound)},f;return h.Provider({value:s,get children(){return f??=q(c)}})}function xt(){let e=p(U);return e?q(e):null}function Tt(e){let t=p(h);if(t&&typeof window<"u"){let n=!1;k(()=>n=!0),queueMicrotask(()=>{n||t.router.navigate(e.to,{replace:e.replace!==!1})})}return null}var Ee={router:{navigate:()=>{}},location:()=>({pathname:"",search:"",hash:"",query:{}}),params:()=>({})};function O(){let e=p(h);if(e)return e;if(typeof window>"u")return Ee;throw new Error("[router] useRouter must be used within <Router>")}function B(){let e=O().params;return d(()=>e(),{},{equals:(t,n)=>JSON.stringify(t)===JSON.stringify(n)})}function vt(){return p($)??{}}function Ct(e){let t=B();return d(()=>t()[e])}function Rt(e,t){let n=B();return d(()=>e(n()),void 0,t?{equals:t}:void 0)}function Pt(e){let t=J();return d(()=>Le(typeof e=="function"?e():e,t.pathname))}function bt(){let e=J(),t=He();return[d(()=>e.query),(o,a)=>{let i=new URLSearchParams(e.search);for(let[c,f]of Object.entries(o))f===null?i.delete(c):i.set(c,f);let s=i.toString();t(e.pathname+(s?`?${s}`:""),a)}]}function At(e,t){let n=(r,o)=>we(r,o);return t!==void 0?d(()=>Ae(e(),t),void 0,{equals:n}):d(e,void 0,{equals:n})}function J(){let{location:e}=O();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 wt(e={}){let t=p(h);return n=>{if(!t||n.defaultPrevented||n.button!==0||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;let o=n.target?.closest?.("a");if(!o||!o.getAttribute("href")||o.target&&o.target!=="_self"||o.hasAttribute("download")||/(^|\s)external(\s|$)/.test(o.getAttribute("rel")??""))return;let a=new URL(o.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,o)||(n.preventDefault(),t.router.navigate(a.pathname+a.search+a.hash,{replace:e.replace})))}}function He(){let{router:e}=O();return(t,n)=>e.navigate(t,n)}function St(){return p(W)??(()=>{})}var l=e=>typeof e=="function"?e():e,_e=new Set(["href","slot","class","className","active","activeClass","replace","children"]);function Ve(e){let t=p(h),n=()=>t?.router.navigate(l(e.href)??"",{replace:l(e.replace)}),r=g("a");u(r,"href",l(e.href)??""),e.slot&&u(r,"slot",l(e.slot));for(let a of Object.keys(e)){if(_e.has(a))continue;let i=e[a];i!=null&&typeof i!="function"&&u(r,a,String(i))}if(typeof r.addEventListener=="function")r.addEventListener("click",a=>{a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),n())});else{let a=l(e.className??e.class)??"";a&&u(r,"class",a)}typeof r.addEventListener=="function"&&S(()=>{let a=l(e.href)??"";r.setAttribute("href",a);let i=l(e.className??e.class)??"",s=l(e.activeClass)??"",c=l(e.active)??t?.location().pathname===a;r.className=[i,c?s:""].filter(Boolean).join(" ")});let o=e.children;return o!=null&&v(r,o),r}var kt=Ve;function Ot(e){let t=e.action,n=e.className??e.class,r=t.url??"",o=g("form");u(o,"method","post"),r&&u(o,"action",r),n&&u(o,"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(o,i,String(s))}typeof o.addEventListener=="function"&&o.addEventListener("submit",i=>{i.preventDefault();let s={};new FormData(o).forEach((c,f)=>{s[f]=c}),Promise.resolve(t(s)).catch(()=>{})});let a=e.children;return a!=null&&v(o,a),o}async function Lt(e,t){let n=Oe(e,t);if(!n)return;let r=[];for(let o of n.matched){let a=o.component;a&&typeof a.preload=="function"&&r.push(a.preload())}await Promise.all(r)}export{Fe as a,Re as b,V as c,Je as d,ce as e,Xe as f,Ye as g,R as h,P as i,Ie as j,Ke as k,ne as l,de as m,pe as n,ye as o,I as p,me as q,ge as r,ht as s,xt as t,Tt as u,O as v,B as w,vt as x,Ct as y,Rt as z,Pt as A,bt as B,At as C,J as D,wt as E,He as F,St as G,Ve as H,kt as I,Ot as J,Lt as K,Mt as L,Et as M,Ht as N,_t as O,It 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-55BT3H6E.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 u=!1,c=new Map;function w(){return u}function T(n){u=n}function h(n,t){c.set(n,t)}function C(n){return c.get(n)}function p(){c.clear()}function H(){if(typeof window>"u")return!1;let n=document.getElementById("__FLUIXI_HYDRATION__");if(!n||n.getAttribute("type")!=="application/json")return!1;try{let t=n.textContent||"{}",o=JSON.parse(t);for(let[r,e]of Object.entries(o))c.set(r,e);return!0}catch(t){return console.error("Failed to deserialize hydration data:",t),!1}}function y(){if(typeof window>"u")return;let n=document.getElementById("__FLUIXI_HYDRATION__");n&&n.remove();let t=document.createTreeWalker(document.body,NodeFilter.SHOW_COMMENT,null),o=[],r;for(;r=t.nextNode();){let e=r,a=e.nodeValue||"";(a.startsWith("#")||a.startsWith("/"))&&o.push(e)}o.forEach(e=>e.remove()),p()}typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(y,100)});function _(){return typeof window>"u"}import{createComponent as l}from"@fluixi/dom";import{untrack as m,createMemo as g,createResource as x}from"@fluixi/reactive/signal";function f(n){if(n!=null&&(typeof n=="object"||typeof n=="function"))try{n.$lazy=!0}catch{}return n}function O(n,t){let o,r,e;function a(){return r||(r=n().then(d=>o=d.default)),r}t?.preload&&a();let s=(d=>{if(o){let i=o;return f(m(()=>i(d)))}if(!e){let[i]=x(()=>a(),{transport:!1});if(e=i,i.error)throw i.error}return g(()=>{let i=e();return i?f(l(i,d)):void 0})});return s.preload=()=>a().then(()=>{}),s.$lazy=!0,s.loader=n,s}export{w as a,T as b,h as c,C as d,H as e,y as f,_ as g,O as h};
@@ -1 +0,0 @@
1
- import{a as w,c as L,d as O,g as k,h as I}from"./chunk-SM4WHBOP.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,n){let t=B(e,n),o=a=>(a.debug,t.Provider({value:a.value,get children(){return a.children},debug:a.debug}));return typeof Symbol<"u"&&Symbol.for&&(o.$$typeof=Symbol.for("react.provider")),o.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:z(o),defaultValue:e}}var m=new Map,p=new Map;function W(e,n){return async(...t)=>{let o=n+":"+JSON.stringify(t);if(w()||typeof window<"u"){let r=O(o);if(r!==void 0)return r}if(m.has(o))return m.get(o);if(p.has(o))return p.get(o);let a=Promise.resolve(e(...t)).then(r=>(m.set(o,r),p.delete(o),k()&&L(o,r),r),r=>{throw p.delete(o),r});return p.set(o,a),a}}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",o=async a=>{let[,r]=M(t),s=()=>r(void 0),i=()=>o(a);r({input:a,pending:!0,clear:s,retry:i});try{let c=await e(a);return r({input:a,result:c,pending:!1,clear:s,retry:i}),c}catch(c){throw r({input:a,error:c,pending:!1,clear:s,retry:i}),c}};return o.url=t,o.with=a=>E((...r)=>e(a,...r),n),o}function Z(e){let[n]=M(e.url);return n}function ee(e){return e}var te=N(void 0,"route-data"),Ne=te.Provider;import{runWithOwner as ct}from"@fluixi/reactive/signal";var h=T(void 0,"router"),F=T(void 0,"outlet"),K=T(void 0,"route-params"),U=T(void 0,"route-data");function de(e,n,t){let o,a=e.route.data;if(typeof a=="function"){let x=!1;b(()=>{x=!0});let q=re(),[$]=ne(()=>a({params:t.params,location:t.location},q,()=>x));o=$}let r=()=>U.Provider({value:o,get children(){return K.Provider({value:e.params,get children(){return F.Provider({value:{depth:n,...t},get children(){return V(e.component,{})}})}})}});if(!o)return r();let s=o,i=()=>s.loading,[c,f]=P(R(()=>!i()));return A(()=>f(!i())),d(()=>c()?r():null)}function H(e){let n=e.depth+1,[t,o]=P(R(()=>e.matched()[n]?.component));return A(()=>{let a=e.matched()[n]?.component;o(()=>a)}),d(()=>{if(!t())return e.notFound?e.notFound():null;let r=R(()=>e.matched())[n];return de(r,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}),[o,a]=P(t.state()),r=t.subscribe(a);b(()=>{r(),t.destroy()});let s=d(()=>(o().match?.matched??[]).filter(x=>x.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:()=>le(e.notFound)},f;return h.Provider({value:i,get children(){return f??=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),(a,r)=>{let s=new URLSearchParams(e.search);for(let[c,f]of Object.entries(a))f===null?s.delete(c):s.set(c,f);let i=s.toString();n(e.pathname+(i?`?${i}`:""),r)}]}function Je(e,n){let t=(o,a)=>ae(o,a);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 a=t.target?.closest?.("a");if(!a||!a.getAttribute("href")||a.target&&a.target!=="_self"||a.hasAttribute("download")||/(^|\s)external(\s|$)/.test(a.getAttribute("rel")??""))return;let r=new URL(a.href);r.protocol!=="http:"&&r.protocol!=="https:"||r.origin===window.location.origin&&(r.hash&&r.pathname===window.location.pathname&&r.search===window.location.search||e.shouldNavigate&&!e.shouldNavigate(r,a)||(t.preventDefault(),n.router.navigate(r.pathname+r.search+r.hash,{replace:e.replace})))}}function pe(){let{router:e}=S();return(n,t)=>e.navigate(n,t)}function Ge(){return y(U)??(()=>{})}var l=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=()=>n?.router.navigate(l(e.href)??"",{replace:l(e.replace)}),o=g("a");u(o,"href",l(e.href)??""),e.slot&&u(o,"slot",l(e.slot));for(let r of Object.keys(e)){if(me.has(r))continue;let s=e[r];s!=null&&typeof s!="function"&&u(o,r,String(s))}if(typeof o.addEventListener=="function")o.addEventListener("click",r=>{r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||(r.preventDefault(),t())});else{let r=l(e.className??e.class)??"";r&&u(o,"class",r)}typeof o.addEventListener=="function"&&A(()=>{let r=l(e.href)??"";o.setAttribute("href",r);let s=l(e.className??e.class)??"",i=l(e.activeClass)??"",c=l(e.active)??n?.location().pathname===r;o.className=[s,c?i:""].filter(Boolean).join(" ")});let a=e.children;return a!=null&&v(o,a),o}var Xe=ge;function Qe(e){let n=e.action,t=e.className??e.class,o=n.url??"",a=g("form");u(a,"method","post"),o&&u(a,"action",o),t&&u(a,"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(a,s,String(i))}typeof a.addEventListener=="function"&&a.addEventListener("submit",s=>{s.preventDefault();let i={};new FormData(a).forEach((c,f)=>{i[f]=c}),Promise.resolve(n(i)).catch(()=>{})});let r=e.children;return r!=null&&v(a,r),a}async function Ye(e,n){let t=ce(e,n);if(!t)return;let o=[];for(let a of t.matched){let r=a.component;r&&typeof r.preload=="function"&&o.push(r.preload())}await Promise.all(o)}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};